import { Meta, StoryObj } from '@storybook/react-webpack5'; import { useState } from 'react'; import List from '../../list'; import { ListItem } from '../ListItem'; import { SB_LIST_ITEM_ADDITIONAL_INFO as INFO, SB_LIST_ITEM_MEDIA as MEDIA, } from '../_stories/subcomponents'; import type { ListItemRadioProps } from './ListItemRadio'; import { fn } from 'storybook/test'; import { ProfileType } from '../../common'; const meta: Meta = { component: ListItem.Radio, title: 'Content/ListItem/ListItem.Radio', args: { name: 'radio-group', value: 'option1', checked: false, onChange: fn(), }, argTypes: { onChange: { table: { type: { summary: '(value: string | number) => void' }, }, }, }, } satisfies Meta; export default meta; type Story = StoryObj; export const Playground: Story = { render: (args: ListItemRadioProps) => { return ( } additionalInfo={INFO.nonInteractive} /> ); }, }; /** * Radio controls follow the native HTML behaviour and can be grouped using the `name` prop. */ export const RadioGroup: Story = { parameters: { controls: { disable: true }, }, render: function Render() { const [selectedValue, setSelectedValue] = useState('2'); return ( } title="First option" subtitle="This is the first choice" media={} /> } title="Second option" subtitle="This is the second choice" media={} /> } title="Third option" subtitle="This is the third choice" media={} /> ); }, };