82 lines
2.3 KiB
TypeScript
82 lines
2.3 KiB
TypeScript
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
||
|
|
import { Button } from './button';
|
||
|
|
import { Mail, ArrowRight, Trash2, Edit } from 'lucide-react';
|
||
|
|
|
||
|
|
const meta = {
|
||
|
|
title: 'UI/Button',
|
||
|
|
component: Button,
|
||
|
|
tags: ['autodocs'],
|
||
|
|
argTypes: {
|
||
|
|
variant: {
|
||
|
|
control: 'select',
|
||
|
|
options: ['default', 'primary', 'destructive', 'outline', 'secondary', 'ghost', 'gaming', 'terminal', 'nature', 'glass'],
|
||
|
|
},
|
||
|
|
size: {
|
||
|
|
control: 'select',
|
||
|
|
options: ['default', 'sm', 'lg', 'icon'],
|
||
|
|
},
|
||
|
|
disabled: { control: 'boolean' },
|
||
|
|
asChild: { table: { disable: true } },
|
||
|
|
},
|
||
|
|
args: {
|
||
|
|
children: 'Button',
|
||
|
|
variant: 'default',
|
||
|
|
size: 'default',
|
||
|
|
}
|
||
|
|
} satisfies Meta<typeof Button>;
|
||
|
|
|
||
|
|
export default meta;
|
||
|
|
type Story = StoryObj<typeof meta>;
|
||
|
|
|
||
|
|
export const Default: Story = {};
|
||
|
|
|
||
|
|
export const Variants = {
|
||
|
|
render: () => (
|
||
|
|
<div className="flex flex-wrap gap-4 items-center bg-black/80 p-8 rounded-lg">
|
||
|
|
<Button variant="default">Default</Button>
|
||
|
|
<Button variant="secondary">Secondary</Button>
|
||
|
|
<Button variant="destructive">Destructive</Button>
|
||
|
|
<Button variant="outline">Outline</Button>
|
||
|
|
<Button variant="ghost">Ghost</Button>
|
||
|
|
<Button variant="gaming">Gaming</Button>
|
||
|
|
<Button variant="terminal">Terminal</Button>
|
||
|
|
<Button variant="nature">Nature</Button>
|
||
|
|
<Button variant="glass">Glass</Button>
|
||
|
|
</div>
|
||
|
|
),
|
||
|
|
};
|
||
|
|
|
||
|
|
export const Sizes = {
|
||
|
|
render: () => (
|
||
|
|
<div className="flex flex-wrap gap-4 items-center">
|
||
|
|
<Button size="lg">Large</Button>
|
||
|
|
<Button size="default">Default</Button>
|
||
|
|
<Button size="sm">Small</Button>
|
||
|
|
<Button size="icon"><Mail className="w-4 h-4" /></Button>
|
||
|
|
</div>
|
||
|
|
),
|
||
|
|
};
|
||
|
|
|
||
|
|
export const WithIcon: Story = {
|
||
|
|
args: {
|
||
|
|
children: 'Email Login',
|
||
|
|
icon: <Mail className="w-4 h-4" />,
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
export const Destructive: Story = {
|
||
|
|
args: {
|
||
|
|
variant: 'destructive',
|
||
|
|
children: 'Delete Account',
|
||
|
|
icon: <Trash2 className="w-4 h-4" />,
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
export const LoadingState: Story = {
|
||
|
|
render: () => (
|
||
|
|
<Button disabled>
|
||
|
|
Loading...
|
||
|
|
</Button>
|
||
|
|
),
|
||
|
|
};
|