import React from 'react'; import Radio from '@/components/Radio'; import RadioGroup from '@/components/RadioGroup'; import FormLabel from '@/components/FormLabel'; import { Meta, StoryFn } from '@storybook/react-webpack5'; export default { title: 'Components/Radio', component: RadioGroup, argTypes: { value: { control: { type: 'select', }, table: { type: { summary: 'any' } }, options: ['On', 'Off'], description: 'Value of the selected radio button. The DOM API casts this to a string.', }, onChange: { table: { type: { summary: 'func' } }, description: 'Callback fired when the state is changed. Signature: `function(event: React.ChangeEvent) => void`', }, }, parameters: { controls: { expanded: true, include: ['value', 'onChange'], }, }, docs: { description: { component: 'This component is identical to the MUI RadioGroup component.', }, }, } as Meta; const RadioGroupTemplate: StoryFn = (args) => { const [value, setValue] = React.useState(args.value || 'On'); const handleChange = (event: React.ChangeEvent) => { setValue((event.target as HTMLInputElement).value); }; return ( } label="On" /> } label="Off" /> } label="(Disabled option)" /> ); }; export const ControlledRadioGroup = { render: RadioGroupTemplate, };