-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbutton.stories.tsx
44 lines (37 loc) · 1.21 KB
/
button.stories.tsx
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
import { ComponentMeta, ComponentStory } from '@storybook/react';
import centered from '@storybook/addon-centered/react';
import { Button, ButtonSize, ButtonTheme } from './button';
export default {
title: 'Button',
component: Button,
decorators: [centered],
} as ComponentMeta<typeof Button>;
const Story: ComponentStory<typeof Button> = args => <Button {...args} />;
export const Primary = Story.bind({});
Primary.args = {
text: 'Button',
theme: ButtonTheme.Primary,
};
export const Secondary = Story.bind({});
Secondary.args = {
text: 'Button',
theme: ButtonTheme.Secondary,
};
export const CustomGradient = Story.bind({});
CustomGradient.args = {
text: 'Button',
gradient: { from: 'white', to: 'gray' },
color: 'black',
};
export const LongButton = Story.bind({});
LongButton.args = {
text: 'This is a very, very long button',
};
const StorySizes: ComponentStory<typeof Button> = args => (
<div style={{ display: 'flex', gap: '20px', alignItems: 'self-end' }}>
<Button text="Large" size={ButtonSize.Large} {...args} />
<Button text="Medium" size={ButtonSize.Medium} {...args} />
<Button text="Small" size={ButtonSize.Small} {...args} />
</div>
);
export const Sizes = StorySizes.bind({});