import { Meta, StoryObj } from '@storybook/react-webpack5'; import { fn } from 'storybook/test'; import { createSandboxStory, globalScope, } from '../../../.storybook/components/sandbox/SandboxEditor'; import Field from '../../Field/Field'; import Checkbox from '..'; import { withVariantConfig } from '../../../.storybook/helpers'; import { lorem10 } from '../../test-utils'; const meta: Meta = { component: Checkbox, title: 'Forms/Checkbox', args: { label: 'This is the label', onChange: fn(), }, }; export default meta; type Story = StoryObj; export const Sandbox = createSandboxStory({ code: `const App = () => { const [checked, setChecked] = React.useState(false); return ( setChecked((prev) => !prev)} /> ); };`, scope: globalScope, }); export const Basic: Story = {}; export const Multiple: Story = { render: (args) => { return ( <> ); }, ...withVariantConfig(['default', 'dark']), }; export const WithinField = { decorators: [ (Story) => ( <> ), ], } satisfies Story;