import type { Meta, StoryObj } from '@storybook/react-webpack5'; import { useState } from 'react'; import Radio, { type RadioProps } from './Radio'; import AvatarView from '../avatarView'; import { Flag } from '@wise/art'; import { fn } from 'storybook/test'; const meta: Meta = { component: Radio, title: 'Forms/Radio', argTypes: { disabled: { control: 'boolean' }, }, }; export default meta; export const Basic: StoryObj = { render: (args) => { return ; }, args: { checked: false, disabled: false, label: 'Without Avatar', name: 'name', secondary: 'This is secondary text', id: 'radioGroup1', value: 'option1', }, }; export const Variants: StoryObj = { render: () => { const [selectedValue, setSelectedValue] = useState('option1'); return ( <>
setSelectedValue('option1')} />
} value="option2" checked={selectedValue === 'option2'} onChange={() => setSelectedValue('option2')} />
); }, };