File: /var/www/design.system/src/molecules/Inputs/Radio/Radio.stories.tsx
import { Meta, StoryObj } from '@storybook/react';
import { useArgs } from '@storybook/preview-api'; // Импортируем хук useArgs
import Radio from './Radio.tsx';
const meta: Meta<typeof Radio> = {
component: Radio,
title: 'Molecules/Inputs/Radio',
tags: ['autodocs'],
argTypes: {
checked: {
control: 'boolean',
},
},
};
export default meta;
type Story = StoryObj<typeof Radio>;
export const Default: Story = {
render: function Render(args) {
const [{ checked }, updateArgs] = useArgs();
const handleChange = (value: boolean) => {
updateArgs({ checked: value });
};
return <Radio {...args} checked={checked} onChange={handleChange} />;
},
args: {
checked: false,
label: 'Label',
description: 'Description',
},
};