import type { Meta, StoryObj } from '@storybook/nextjs-vite'; import { AlertTriangle, Bell, ChevronDown, ChevronRight, Download, ExternalLink as ExternalLinkIcon, Heart, Menu, MessageSquare, Plus, Search, Settings, ShoppingCart, Trash2, X } from 'lucide-react'; import React from 'react'; import { Button } from '../components/ui/button'; const meta = { title: 'UI/Button', component: Button, argTypes: { variant: { control: 'select', options: ['accent', 'outline', 'transparent', 'destructive', 'warning'], }, size: { control: 'select', options: ['default', 'small', 'compact', 'icon'], }, fullWidth: { control: 'boolean' }, disabled: { control: 'boolean' }, loading: { control: 'boolean' }, }, } satisfies Meta; export default meta; type Story = StoryObj; // === Surface variants === export const Accent: Story = { args: { children: 'Button', variant: 'accent' }, }; export const Outline: Story = { args: { children: 'Button', variant: 'outline' }, }; export const Transparent: Story = { args: { children: 'Button', variant: 'transparent' }, }; export const Destructive: Story = { args: { children: 'Delete', variant: 'destructive', leftIcon: }, }; export const Warning: Story = { args: { children: 'Proceed with caution', variant: 'warning', leftIcon: }, }; // === Sizes === export const SizeDefault: Story = { args: { children: 'Button', size: 'default' }, }; export const SizeSmall: Story = { args: { children: 'Button', size: 'small' }, }; // Caption-scale 24px pill for slim strips (announcement/promo bars). export const SizeCompact: Story = { args: { children: 'Read Article', size: 'compact', variant: 'outline', leftIcon: }, }; // === Icon-only === export const IconOnly: Story = { args: { leftIcon: , size: 'icon', variant: 'outline' }, }; // === With icons === export const WithLeftIcon: Story = { args: { children: 'Add Item', leftIcon: }, }; export const WithRightIcon: Story = { args: { children: 'Next', rightIcon: }, }; export const WithBothIcons: Story = { args: { children: 'Download', leftIcon: , rightIcon: }, }; // === States === export const Disabled: Story = { args: { children: 'Disabled', disabled: true }, }; export const Loading: Story = { args: { children: 'Loading...', loading: true }, }; export const FullWidth: Story = { args: { children: 'Full Width', fullWidth: true }, }; // === SplitIcon (single click target with visual divider) === export const SplitIcon: Story = { args: { children: 'Save', splitIcon: }, } export const SplitIconOutline: Story = { args: { children: 'Open', variant: 'outline', splitIcon: }, } export const SplitIconAsLink: Story = { args: { children: 'Documentation', href: '/docs', splitIcon: }, } export const SplitIconSmall: Story = { args: { children: 'Save', size: 'small', splitIcon: }, } // === As link === export const AsLink: Story = { args: { children: 'Go to Home', href: '/' }, }; export const ExternalLink: Story = { args: { children: 'External Link', href: 'https://example.com', openInNewTab: true }, }; // === Showcase === export const AllVariants: Story = { args: { children: 'Button' }, render: () => { const variants = ['accent', 'outline', 'transparent', 'destructive', 'warning'] as const const labels: Record = { accent: 'Accent', outline: 'Outline', transparent: 'Transparent', destructive: 'Destructive', warning: 'Warning', } return (
{variants.map((variant) => ( ))}
) }, }; export const AllSizes: Story = { args: { children: 'Button' }, render: () => (
), }; export const IconButtonGrid: Story = { args: { children: 'Icon' }, render: () => (
), }; export const WithIconsShowcase: Story = { args: { children: 'Button' }, render: () => (
), }; export const StatesShowcase: Story = { args: { children: 'Button' }, render: () => (
), }; export const NotificationCounters: Story = { args: { children: 'Counter' }, render: () => (
), };