-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
8,049 additions
and
17,665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 19 additions & 3 deletions
22
packages/ui/src/components/DateInput/__stories__/Exclude.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 13 additions & 30 deletions
43
packages/ui/src/components/DateInput/__stories__/Months.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,17 @@ | ||
import type { StoryFn } from '@storybook/react' | ||
import { useState } from 'react' | ||
import { DateInput } from '..' | ||
import { Template } from './Template' | ||
|
||
export const Months: StoryFn = args => { | ||
const [startDate, setStartDate] = useState<Date | null>(null) | ||
const [endDate, setEndDate] = useState<Date | null>(null) | ||
const onChange = (dates: [Date | null, Date | null]) => { | ||
const [start, end] = dates | ||
setStartDate(start) | ||
setEndDate(end) | ||
} | ||
export const Months = Template.bind({}) | ||
|
||
return ( | ||
<DateInput | ||
label="Date" | ||
startDate={startDate} | ||
endDate={endDate} | ||
onChange={onChange} | ||
showMonthYearPicker | ||
selectsRange | ||
{...args} | ||
/> | ||
) | ||
Months.args = { | ||
label: 'Months', | ||
showMonthYearPicker: true, | ||
disabled: false, | ||
} | ||
|
||
Months.parameters = { | ||
docs: { | ||
description: { | ||
story: | ||
'Using prop `showMonthYearPicker` you can select only months and years.', | ||
}, | ||
}, | ||
} | ||
Months.decorators = [ | ||
StoryComponent => ( | ||
<div style={{ height: '350px' }}> | ||
<StoryComponent /> | ||
</div> | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 54 additions & 10 deletions
64
packages/ui/src/components/DateInput/__stories__/Range.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,7 @@ export const Size: StoryFn<typeof DateInput> = args => ( | |
))} | ||
</Stack> | ||
) | ||
|
||
Size.args = { | ||
value: 'Sat 24 Dec 2024', | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/ui/src/components/DateInput/__stories__/Template.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import type { StoryFn } from '@storybook/react' | ||
import type { ComponentProps } from 'react' | ||
import { DateInput } from '..' | ||
|
||
export const Template: StoryFn<ComponentProps<typeof DateInput>> = props => ( | ||
export const Template: StoryFn<typeof DateInput> = props => ( | ||
<DateInput {...props} /> | ||
) | ||
|
||
Template.args = { | ||
label: 'Date Input', | ||
required: true, | ||
placeholder: 'YYYY-MM-DD', | ||
} |
19 changes: 0 additions & 19 deletions
19
packages/ui/src/components/DateInput/__stories__/Uncontrolled.stories.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.