import type { Meta, StoryObj } from '@storybook/react-vite'; import { Switch } from './switch'; import { Label } from '../label/label'; const meta = { title: 'Components/Switch', component: Switch, parameters: { layout: 'centered', docs: { description: { component: 'On/off toggle that applies immediately. If the change only takes effect after a Save button, use Checkbox instead.', }, }, }, tags: ['autodocs'], argTypes: { size: { control: 'inline-radio', options: ['xs', 'sm', 'md', 'lg'] }, colorPalette: { control: 'select', options: ['primary', 'secondary', 'tertiary', 'black', 'red', 'green', 'yellow'], }, }, } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => (
), }; export const Sizes: Story = { render: () => (
{(['xs', 'sm', 'md', 'lg'] as const).map((size) => ( ))}
), }; /** The track picks up whichever palette it is given when switched on. */ export const Palettes: Story = { render: () => (
{(['primary', 'secondary', 'tertiary', 'black', 'red', 'green'] as const).map((palette) => ( ))}
), }; export const States: Story = { render: () => (
), };