bigbuffet-rw/stories/Button.stories.tsx

65 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-02-02 16:19:52 -08:00
import { ComponentStory, ComponentMeta } from '@storybook/react';
2023-02-02 18:23:47 -08:00
import React from 'react';
2023-02-02 16:19:52 -08:00
import Button from 'soapbox/components/ui/button/button';
2023-02-02 16:19:52 -08:00
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
2023-02-02 19:53:26 -08:00
title: 'UI/Button',
2023-02-02 16:19:52 -08:00
component: Button,
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
argTypes: {
2023-02-02 19:53:26 -08:00
text: { type: 'string', defaultValue: 'Button' },
theme: {
control: 'select',
options: [
'primary',
'secondary',
'tertiary',
'accent',
'danger',
'transparent',
'outline',
'muted',
],
2023-02-02 19:53:26 -08:00
defaultValue: 'primary',
},
2023-02-02 19:53:26 -08:00
size: {
control: 'select',
options: [
'xs',
'sm',
'md',
'lg',
],
defaultValue: 'md',
},
disabled: { type: 'boolean', defaultValue: false },
onClick: { action: 'onClick' },
2023-02-02 16:19:52 -08:00
},
} as ComponentMeta<typeof Button>;
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />;
export const Primary = Template.bind({});
// More on args: https://storybook.js.org/docs/react/writing-stories/args
Primary.args = {
theme: 'primary',
2023-02-02 16:19:52 -08:00
};
export const Secondary = Template.bind({});
Secondary.args = {
2023-02-02 19:53:26 -08:00
theme: 'secondary',
2023-02-02 16:19:52 -08:00
};
export const Large = Template.bind({});
Large.args = {
size: 'lg',
2023-02-02 16:19:52 -08:00
};
export const Small = Template.bind({});
Small.args = {
size: 'sm',
2023-02-02 16:19:52 -08:00
};