[7/n][Storybook] DatePicker update argTypes (#44)

This commit is contained in:
Vivian Phung 2024-05-14 17:15:32 -04:00 committed by GitHub
commit 29caf510ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,23 @@ const meta: Meta<typeof DatePicker> = {
title: 'Components/DatePicker',
component: DatePicker,
tags: ['autodocs'],
argTypes: {
calendarProps: {
control: 'object',
},
onChange: {
action: 'change',
},
value: {
control: 'text',
},
selectRange: {
control: 'boolean',
},
onReset: {
action: 'reset',
},
},
};
export default meta;
@ -13,13 +30,21 @@ export default meta;
type Story = StoryObj<typeof DatePicker>;
export const Default: Story = {
render: ({ calendarProps, onChange, value, selectRange, onReset }) => (
render: ({
calendarProps,
onChange,
value,
selectRange,
onReset,
...args
}) => (
<DatePicker
calendarProps={calendarProps}
onChange={onChange}
value={value}
selectRange={selectRange}
onReset={onReset}
{...args}
/>
),
};