import type { Meta, StoryObj } from '@storybook/react' import { ChevronRight, Mail, Loader2, Plus } from 'lucide-react' import { Button } from '@/components/ui/button' const meta = { title: 'Primitives/Button', component: Button, tags: ['autodocs'], parameters: { layout: 'centered' }, argTypes: { variant: { control: 'select', options: ['default', 'secondary', 'outline', 'ghost', 'link', 'destructive'], }, size: { control: 'select', options: ['default', 'sm', 'lg', 'icon', 'icon-sm', 'icon-lg'], }, disabled: { control: 'boolean' }, asChild: { control: 'boolean' }, }, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { args: { children: 'Button', variant: 'default', size: 'default', }, } export const Secondary: Story = { args: { children: 'Secondary', variant: 'secondary', }, } export const Outline: Story = { args: { children: 'Outline', variant: 'outline', }, } export const Ghost: Story = { args: { children: 'Ghost', variant: 'ghost', }, } export const Link: Story = { args: { children: 'Link', variant: 'link', }, } export const Destructive: Story = { args: { children: 'Delete', variant: 'destructive', }, } export const Small: Story = { args: { children: 'Small', size: 'sm', }, } export const Large: Story = { args: { children: 'Large', size: 'lg', }, } export const Icon: Story = { args: { size: 'icon', children: , 'aria-label': 'Add', }, } export const IconSmall: Story = { args: { size: 'icon-sm', children: , 'aria-label': 'Add', }, } export const IconLarge: Story = { args: { size: 'icon-lg', children: , 'aria-label': 'Add', }, } export const WithIcon: Story = { args: { children: ( <> Login with Email ), }, } export const WithTrailingIcon: Story = { args: { children: ( <> Next ), }, } export const Loading: Story = { args: { disabled: true, children: ( <> Please wait ), }, } export const Disabled: Story = { args: { children: 'Disabled', disabled: true, }, } export const AsChild: Story = { args: { asChild: true, children: Link styled as Button, }, } export const AllVariants: Story = { render: () => (
{(['default', 'secondary', 'outline', 'ghost', 'link', 'destructive'] as const).map( (variant) => (
{variant}
), )}
), }