mirror of
https://github.com/snowball-tools/snowballtools-base.git
synced 2024-11-17 16:29:19 +00:00
[6/n][Storybook] Checkbox update argTypes (#43)
This commit is contained in:
commit
1aa57aaecc
@ -6,13 +6,25 @@ const meta: Meta<typeof Checkbox> = {
|
|||||||
title: 'Components/Checkbox',
|
title: 'Components/Checkbox',
|
||||||
component: Checkbox,
|
component: Checkbox,
|
||||||
tags: ['autodocs'],
|
tags: ['autodocs'],
|
||||||
args: {
|
argTypes: {
|
||||||
label: 'string',
|
label: {
|
||||||
description: 'string',
|
control: 'text',
|
||||||
checked: 'CheckedState' as unknown as any,
|
},
|
||||||
defaultChecked: 'CheckedState' as unknown as any,
|
description: {
|
||||||
required: 'boolean' as unknown as any,
|
control: 'text',
|
||||||
onCheckedChange: '(checked: CheckedState) => void' as unknown as any,
|
},
|
||||||
|
checked: {
|
||||||
|
control: 'boolean',
|
||||||
|
},
|
||||||
|
defaultChecked: {
|
||||||
|
control: 'boolean',
|
||||||
|
},
|
||||||
|
required: {
|
||||||
|
control: 'boolean',
|
||||||
|
},
|
||||||
|
onCheckedChange: {
|
||||||
|
action: 'checkedChange',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -28,6 +40,7 @@ export const Default: Story = {
|
|||||||
defaultChecked,
|
defaultChecked,
|
||||||
required,
|
required,
|
||||||
onCheckedChange,
|
onCheckedChange,
|
||||||
|
...arg
|
||||||
}) => (
|
}) => (
|
||||||
<Checkbox
|
<Checkbox
|
||||||
label={label}
|
label={label}
|
||||||
@ -36,6 +49,15 @@ export const Default: Story = {
|
|||||||
defaultChecked={defaultChecked}
|
defaultChecked={defaultChecked}
|
||||||
required={required}
|
required={required}
|
||||||
onCheckedChange={onCheckedChange}
|
onCheckedChange={onCheckedChange}
|
||||||
|
{...arg}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
|
args: {
|
||||||
|
label: 'Label',
|
||||||
|
description: 'Description',
|
||||||
|
checked: false,
|
||||||
|
defaultChecked: false,
|
||||||
|
required: false,
|
||||||
|
onCheckedChange: (checked: boolean) => console.log(checked),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user