import type { Meta, StoryObj } from '@storybook/react'; import { action } from 'storybook/actions'; import React, { useState } from 'react'; import { RadioInput } from '../RadioInput'; const meta: Meta = { title: 'Form/RadioInput', component: RadioInput, args: { value: 'my-radio', onChange: (e) => { action('onChange')(e); }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => { const [isChecked, setIsChecked] = useState(false); return ( { action('onChange')(e); setIsChecked(true); }} /> ); }, }; export const Checked: Story = { args: { isChecked: true, }, }; export const Disabled: Story = { args: { isDisabled: true, isChecked: false, }, }; export const DisabledAndChecked: Story = { args: { isDisabled: true, isChecked: true, }, }; export const InADisabledFieldset: Story = { render: (args) => (
), }; export const InADisabledFieldsetAndChecked: Story = { args: { isChecked: true, }, render: InADisabledFieldset.render, };