import { useState } from 'react'; import type { Meta, StoryObj } from 'storybook-react-rsbuild'; import { Switch, Checkbox, RadioGroup, RadioItem, SegmentedControl, Control, } from '../components/ui'; /* Grouped selection controls. Anchored on Switch for the docgen table; the stories below showcase each control. */ const meta = { title: 'Selection/Controls', component: Switch, parameters: { docs: { description: { component: 'Toggle, checkbox, radio group and segmented control. The `Control` helper pairs any of them with a clickable label.', }, }, }, argTypes: { defaultChecked: { control: 'boolean' }, checked: { control: 'boolean' }, disabled: { control: 'boolean' }, onCheckedChange: { action: 'checked changed' }, }, } satisfies Meta; export default meta; type Story = StoryObj; export const Playground: Story = { args: { defaultChecked: false }, }; export const Switches: Story = { render: () => (
}>Wi-Fi
), }; export const Checkboxes: Story = { render: () => (
}>Sync to iCloud }>Share analytics
), }; export const Radios: Story = { render: () => ( }>Compact }>Comfortable }>Spacious ), }; function SegmentedDemo() { const [v, setV] = useState('day'); return ( ); } export const Segmented: Story = { render: () => };