|
| 1 | +import type { Meta, StoryObj } from '@storybook/react-vite' |
| 2 | +import { GradientButton } from './GradientButton' |
| 3 | + |
| 4 | +const meta: Meta<typeof GradientButton> = { |
| 5 | + title: 'Components/GradientButton', |
| 6 | + component: GradientButton, |
| 7 | + parameters: { |
| 8 | + layout: 'centered', |
| 9 | + }, |
| 10 | + tags: ['autodocs'], |
| 11 | + argTypes: { |
| 12 | + variant: { |
| 13 | + control: 'select', |
| 14 | + options: ['blue', 'purple', 'red', 'mint'], |
| 15 | + }, |
| 16 | + size: { |
| 17 | + control: 'select', |
| 18 | + options: ['sm', 'md', 'lg'], |
| 19 | + }, |
| 20 | + }, |
| 21 | +} |
| 22 | + |
| 23 | +export default meta |
| 24 | +type Story = StoryObj<typeof meta> |
| 25 | + |
| 26 | +export const Purple: Story = { |
| 27 | + args: { |
| 28 | + variant: 'purple', |
| 29 | + children: 'Continue', |
| 30 | + }, |
| 31 | +} |
| 32 | + |
| 33 | +export const Blue: Story = { |
| 34 | + args: { |
| 35 | + variant: 'blue', |
| 36 | + children: 'Connect Wallet', |
| 37 | + }, |
| 38 | +} |
| 39 | + |
| 40 | +export const Red: Story = { |
| 41 | + args: { |
| 42 | + variant: 'red', |
| 43 | + children: 'Disconnect', |
| 44 | + }, |
| 45 | +} |
| 46 | + |
| 47 | +export const Mint: Story = { |
| 48 | + args: { |
| 49 | + variant: 'mint', |
| 50 | + children: 'Confirm', |
| 51 | + }, |
| 52 | +} |
| 53 | + |
| 54 | +export const Loading: Story = { |
| 55 | + args: { |
| 56 | + variant: 'purple', |
| 57 | + children: 'Processing...', |
| 58 | + loading: true, |
| 59 | + }, |
| 60 | +} |
| 61 | + |
| 62 | +export const Disabled: Story = { |
| 63 | + args: { |
| 64 | + variant: 'purple', |
| 65 | + children: 'Disabled', |
| 66 | + disabled: true, |
| 67 | + }, |
| 68 | +} |
| 69 | + |
| 70 | +export const FullWidth: Story = { |
| 71 | + args: { |
| 72 | + variant: 'purple', |
| 73 | + children: 'Full Width Button', |
| 74 | + fullWidth: true, |
| 75 | + }, |
| 76 | + decorators: [ |
| 77 | + (Story) => ( |
| 78 | + <div className="w-80"> |
| 79 | + <Story /> |
| 80 | + </div> |
| 81 | + ), |
| 82 | + ], |
| 83 | +} |
| 84 | + |
| 85 | +export const AllSizes: Story = { |
| 86 | + render: () => ( |
| 87 | + <div className="flex items-center gap-4"> |
| 88 | + <GradientButton size="sm">Small</GradientButton> |
| 89 | + <GradientButton size="md">Medium</GradientButton> |
| 90 | + <GradientButton size="lg">Large</GradientButton> |
| 91 | + </div> |
| 92 | + ), |
| 93 | +} |
| 94 | + |
| 95 | +export const AllVariants: Story = { |
| 96 | + render: () => ( |
| 97 | + <div className="flex flex-wrap gap-4"> |
| 98 | + <GradientButton variant="purple">Purple</GradientButton> |
| 99 | + <GradientButton variant="blue">Blue</GradientButton> |
| 100 | + <GradientButton variant="red">Red</GradientButton> |
| 101 | + <GradientButton variant="mint">Mint</GradientButton> |
| 102 | + </div> |
| 103 | + ), |
| 104 | +} |
0 commit comments