-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.stories.tsx
More file actions
76 lines (70 loc) · 1.67 KB
/
Copy pathButton.stories.tsx
File metadata and controls
76 lines (70 loc) · 1.67 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { actionButton, themeClass, vars } from '@comma/design-system';
import type { Meta, StoryObj } from '@storybook/react-vite';
type ButtonStoryArgs = {
children: string;
tone: 'primary' | 'secondary';
disabled: boolean;
};
const meta = {
title: 'Design System/Button',
argTypes: {
tone: {
control: 'inline-radio',
options: ['primary', 'secondary']
},
disabled: {
control: 'boolean'
}
},
args: {
children: '다음',
tone: 'primary',
disabled: false
}
} satisfies Meta<ButtonStoryArgs>;
export default meta;
type Story = StoryObj<ButtonStoryArgs>;
export const Playground: Story = {
render: ({ children, tone, disabled }) => (
<div
className={themeClass}
style={{
minHeight: 240,
display: 'grid',
placeItems: 'center',
background: vars.color.backgroundPrimary,
fontFamily: vars.font.body
}}
>
<button className={actionButton({ tone })} disabled={disabled} type="button">
{children}
</button>
</div>
)
};
export const Variants: Story = {
render: () => (
<div
className={themeClass}
style={{
minHeight: 240,
display: 'flex',
alignItems: 'center',
gap: 12,
padding: 32,
background: vars.color.backgroundPrimary,
fontFamily: vars.font.body
}}
>
<button className={actionButton()} type="button">
Primary
</button>
<button className={actionButton({ tone: 'secondary' })} type="button">
Secondary
</button>
<button className={actionButton()} disabled type="button">
Disabled
</button>
</div>
)
};