-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbutton.stories.js
More file actions
55 lines (51 loc) · 1.27 KB
/
button.stories.js
File metadata and controls
55 lines (51 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from "react"
import { Button, IconButton } from "."
import { iconsList } from "@/components/icon"
const icons = Object.keys(iconsList)
export const Basic = args => <Button {...args} />
export const BaseIconButton = args => (
<IconButton
{...args}
label=""
cursor="pointer"
icon="chevron_left"
iconSize="small"
tooltip="Previous"
/>
)
export default {
component: Button,
tags: ["autodocs"],
args: {
onClick: () => alert("clicked"),
flavour: "default",
id: "some-id",
className: "some-classname",
label: "My button",
loadingLabel: "Loading button",
icon: icons[0],
isLoading: false,
disabled: false,
danger: false,
warning: false,
large: false,
neutral: false,
},
argTypes: {
flavour: {
options: ["default", "hollow", "borderless"],
control: { type: "radio" },
},
id: { control: "text" },
className: { control: "text" },
label: { control: "text" },
loadingLabel: { control: "text" },
icon: { options: icons, type: "select" },
isLoading: { control: "boolean" },
disabled: { control: "boolean" },
danger: { control: "boolean" },
warning: { control: "boolean" },
large: { control: "boolean" },
neutral: { control: "boolean" },
},
}