import { action } from '@storybook/addon-actions'; import type { Meta, Story } from '@storybook/react'; import MuiGrid from '@mui/material/Grid'; import { Switch } from './switch'; import type { SwitchProps } from './switch'; const args: SwitchProps = { size: 'small', onChange: action('Toggled') }; export default { args, component: Switch, title: 'Forms/Toggle (Switch)', argTypes: { size: { description: 'The size of the toggle (on/off switch).', options: ['small', 'medium', undefined], control: { type: 'select' }, table: { defaultValue: { summary: 'medium' } } } } } as Meta; const SwitchTemplate: Story = args => { return ; }; const ToggleTemplate: Story = args => { return ( ); }; export const Primary = SwitchTemplate.bind({}); Primary.args = { defaultChecked: false, disabled: false }; export const ControlledSwitch = SwitchTemplate.bind({}); ControlledSwitch.args = { size: 'medium', checked: false, disabled: false, hovered: false, label: '' }; export const ToggleBig = ToggleTemplate.bind({}); ToggleBig.args = { size: 'medium' }; export const ToggleSmall = ToggleTemplate.bind({}); ToggleSmall.args = { size: 'small' };