[7/n][Storybook] DatePicker update argTypes

This commit is contained in:
Vivian Phung 2024-05-14 15:48:01 -04:00 committed by Vivian Phung
parent 1aa57aaecc
commit a63d0f69ed

View File

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