import type { Meta, StoryObj } from '@storybook/react-vite'; import { type ComponentMatrixCellProps, Story } from './_internal/Story'; import { Checkbox, type CheckboxProps } from './Checkbox'; const meta = { component: Checkbox, parameters: { layout: 'fullscreen', }, title: 'components/Checkbox', } satisfies Meta; export default meta; type CheckboxSize = NonNullable; type StoryDefinition = StoryObj; const STATE_COLUMNS: { key: string; label: string; props: Partial; }[] = [ { key: 'unchecked', label: 'Unchecked', props: {} }, { key: 'checked', label: 'Checked', props: { defaultChecked: true } }, { key: 'indeterminate', label: 'Mixed', props: { indeterminate: true } }, { key: 'focus', label: 'Focus', props: { className: 'pseudo-focus-visible', defaultChecked: true }, }, { key: 'invalid', label: 'Invalid', props: { 'aria-invalid': true, defaultChecked: true }, }, { key: 'disabled', label: 'Disabled', props: { disabled: true } }, ]; const SIZE_ROWS: { key: CheckboxSize; label: string; }[] = [ { key: 'md', label: 'Medium' }, { key: 'sm', label: 'Small' }, ]; const STATE_PROPS = Object.fromEntries( STATE_COLUMNS.map((state) => [state.key, state.props]), ) as Record>; function CheckboxStateCell({ column, row }: ComponentMatrixCellProps) { return ( ); } export const All: StoryDefinition = { render: () => ( ), };