Compare commits

...

9 Commits

Author SHA1 Message Date
GitStart-Cal.com bfc18b2fa2
Merge branch 'main' into date-range-picker-storybook 2023-10-05 12:09:39 +00:00
GitStart-Cal.com 0bbb2e7b63
Merge branch 'main' into date-range-picker-storybook 2023-09-28 12:16:45 +00:00
GitStart-Cal.com 61738eba98
Merge branch 'main' into date-range-picker-storybook 2023-09-11 14:20:10 +00:00
GitStart-Cal.com c1e469d264
Merge branch 'main' into date-range-picker-storybook 2023-09-01 21:52:59 +00:00
GitStart-Cal.com f92132ed1b
Merge branch 'main' into date-range-picker-storybook 2023-08-25 20:25:19 +08:00
GitStart-Cal.com 3f66ca859d
Merge branch 'main' into date-range-picker-storybook 2023-08-25 04:59:38 +08:00
GitStart-Cal.com 681b936b55
Merge branch 'main' into date-range-picker-storybook 2023-08-24 20:15:41 +08:00
GitStart-Cal.com 6f0b43fe7f
Merge branch 'main' into date-range-picker-storybook 2023-08-22 11:30:55 -03:00
gitstart-calcom bfcf5fa4e8 Add DateRangePicker in storybook 2023-08-18 11:48:59 +00:00
1 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,72 @@
import { Canvas, Meta, Story } from "@storybook/addon-docs";
import { Examples, Example, Title, CustomArgsTable } from "@calcom/storybook/components";
import DateRangePicker from "./DateRangePicker";
<Meta title="UI/DateRangePicker" component={DateRangePicker} />
<Title title="DateRangePicker" suffix="Brief" subtitle="Version 1.0 — Last Update: 18 Aug 2023" />
## Definitions
`DateRangePicker` is a component that allows the user to select a date range.
## Structure
The `DateRangePicker` component has a state to determine whether it's disabled or not, and the currently selected start and end dates.
<CustomArgsTable of={DateRangePicker} />
## Examples
<Examples title="DateRangePicker">
<Example title="Default">
<DateRangePicker startDate={new Date(2023, 8, 14)} endDate={new Date(2023, 8, 20)} />
</Example>
<Example title="Disabled">
<DateRangePicker startDate={new Date(2023, 8, 14)} endDate={new Date(2023, 8, 20)} disabled />
</Example>
</Examples>
## DateRangePicker Story
<Canvas>
<Story
name="DateRangePicker"
args={{
startDate: new Date(2023, 8, 14),
endDate: new Date(2023, 8, 20),
disabled: false,
onDatesChange: ({ startDate, endDate }) => {
console.log(startDate, endDate);
},
}}
argTypes={{
startDate: {
control: {
type: "date",
},
},
endDate: {
control: {
type: "date",
},
},
disabled: {
control: {
type: "boolean",
},
},
}}>
{({ startDate, endDate, disabled, onDatesChange }) => (
<DateRangePicker
startDate={startDate}
endDate={endDate}
disabled={disabled}
onDatesChange={onDatesChange}
/>
)}
</Story>
</Canvas>