feat: Added Storybook Controls (#9676)

Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
Jaideep Guntupalliandsean-brydon authored and GitHub committed 2023-06-23 09:04:26 +00:00
1 parent 0a0c400333
commit 8f5e6370b0
13 files changed
+426 -106

No files matched your search

@@ -55,15 +55,31 @@ export const Template = (args) => <Calendar {...args} />;
</Canvas>
<Canvas>
<Story name="Onclick Handlers">
<Calendar
startHour={8}
endHour={17}
events={events}
onEventClick={(e) => alert(e.title)}
onEmptyCellClick={(date) => alert(date.toString())}
sortEvents
hoverEventDuration={30}
/>
<Story name="Onclick Handlers"
args={{
startHour: 8,
endHour: 17,
hoverEventDuration: 30,
}}
argTypes={{
startHour: {
control: { type: "number", min: 0, max: 23, step: 1 },
},
endHour: {
control: { type: "number", min: 0, max: 23, step: 1 },
},
hoverEventDuration: {
control: { type: "number", min: 0, max: 60, step: 1 },
},
}}
>
{({...args}) => (
<Calendar {...args}
events={events}
onEventClick={(e) => alert(e.title)}
onEmptyCellClick={(date) => alert(date.toString())}
sortEvents
/>
)}
</Story>
</Canvas>