import type { Meta, StoryObj } from 'storybook-solidjs-vite'; import { fn } from 'storybook/test'; import { Button } from './button'; import { componentDescription } from '../stories/docs/element-controls'; /** * Convention exemplar — every component story should follow this shape: * `component`, a description, `argTypes` (controls), `args` (defaults incl. * `fn()` for events), a `Playground` story rendered from args, plus showcase * stories for notable variations. */ const meta = { title: 'Solid (Advanced)/Primitives/Button', component: Button, tags: ['autodocs'], parameters: { layout: 'padded', docs: { description: componentDescription([ 'A clickable button with style **variants** and **sizes**, built on a native ``), }; export const Ghost: Story = { args: { variant: 'ghost', children: 'Ghost' }, ...src(``), }; export const Outline: Story = { args: { variant: 'outline', children: 'Outline' }, ...src(``), }; export const Small: Story = { args: { size: 'sm', children: 'Small' }, ...src(``), }; export const Large: Story = { args: { size: 'lg', children: 'Large' }, ...src(``), }; export const Disabled: Story = { args: { disabled: true, children: 'Disabled' }, ...src(``), }; const PlusIcon = () => ( ); export const Icon: Story = { args: { size: 'icon', children: , 'aria-label': 'Add' } as never, ...src(``), }; /** All variants and sizes side by side (showcase — not driven by controls). */ export const AllVariants: Story = { render: () => (
), ...src(`
`), };