|
| 1 | +import type { Meta, StoryObj } from '@storybook/react' |
| 2 | +import { Button } from '../components/ui/Button' |
| 3 | + |
| 4 | +const meta: Meta<typeof Button> = { |
| 5 | + title: 'Components/Button', |
| 6 | + component: Button, |
| 7 | + tags: ['autodocs'], |
| 8 | + argTypes: { |
| 9 | + variant: { |
| 10 | + control: 'select', |
| 11 | + options: ['primary', 'secondary', 'danger', 'ghost'], |
| 12 | + }, |
| 13 | + size: { |
| 14 | + control: 'select', |
| 15 | + options: ['sm', 'md', 'lg'], |
| 16 | + }, |
| 17 | + disabled: { control: 'boolean' }, |
| 18 | + }, |
| 19 | +} |
| 20 | +export default meta |
| 21 | +type Story = StoryObj<typeof Button> |
| 22 | + |
| 23 | +export const Primary: Story = { |
| 24 | + args: { children: 'Primary action', variant: 'primary' }, |
| 25 | +} |
| 26 | + |
| 27 | +export const Secondary: Story = { |
| 28 | + args: { children: 'Secondary action', variant: 'secondary' }, |
| 29 | +} |
| 30 | + |
| 31 | +export const Danger: Story = { |
| 32 | + args: { children: 'Delete', variant: 'danger' }, |
| 33 | +} |
| 34 | + |
| 35 | +export const Loading: Story = { |
| 36 | + args: { children: 'Saving...', loading: true, disabled: true }, |
| 37 | +} |
| 38 | + |
| 39 | +export const Disabled: Story = { |
| 40 | + args: { children: 'Disabled', disabled: true }, |
| 41 | +} |
0 commit comments