-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mantine, date-range): popover opens close to dropdown (#3959)
* fix(mantine, date-range): popover opens close to dropdown * feat(website, date range): add demo for inline and popover calendars
- Loading branch information
1 parent
612f1dc
commit c26776e
Showing
8 changed files
with
103 additions
and
17 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
24 changes: 24 additions & 0 deletions
24
packages/website/src/examples/date-range/inline/DateRangePickerInlineCalendar.demo.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {DateRangePickerInlineCalendar, DateRangePickerValue} from '@coveord/plasma-mantine'; | ||
import dayjs from 'dayjs'; | ||
import {useState} from 'react'; | ||
|
||
const Demo = () => { | ||
const [range, setRange] = useState<DateRangePickerValue>([null, null]); | ||
const onCancel = () => console.log('Cancel'); | ||
|
||
return ( | ||
<DateRangePickerInlineCalendar | ||
initialRange={range} | ||
onApply={setRange} | ||
onCancel={onCancel} | ||
presets={{ | ||
year2k: {label: 'Year 2K', range: [new Date('2000/01/01'), new Date('2000/12/31')]}, | ||
currentMonth: { | ||
label: 'Month', | ||
range: [dayjs().startOf('month').toDate(), dayjs().endOf('month').toDate()], | ||
}, | ||
}} | ||
/> | ||
); | ||
}; | ||
export default Demo; |
12 changes: 12 additions & 0 deletions
12
packages/website/src/examples/date-range/popover/DateRangePickerPopoverCalendar.demo.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {DateRangePickerPopoverCalendar} from '@coveord/plasma-mantine'; | ||
import dayjs from 'dayjs'; | ||
|
||
const Demo = () => ( | ||
<DateRangePickerPopoverCalendar | ||
presets={{ | ||
year2k: {label: 'Year 2K', range: [new Date('2000/01/01'), new Date('2000/12/31')]}, | ||
currentMonth: {label: 'Month', range: [dayjs().startOf('month').toDate(), dayjs().endOf('month').toDate()]}, | ||
}} | ||
/> | ||
); | ||
export default Demo; |
17 changes: 17 additions & 0 deletions
17
packages/website/src/pages/date-range/DateRangePickerInlineCalendar.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {DateRangePickerInlineCalendarMetadata} from '@coveord/plasma-components-props-analyzer'; | ||
import DateRangePickerInlineDemo from '@examples/date-range/inline/DateRangePickerInlineCalendar.demo?demo'; | ||
|
||
import {PageLayout} from '../../building-blocs/PageLayout'; | ||
|
||
const Page = () => ( | ||
<PageLayout | ||
section="Date range" | ||
title="Date Range Picker Inline Calendar" | ||
propsMetadata={DateRangePickerInlineCalendarMetadata} | ||
description="." | ||
id="DateRangePickerInlineCalendar" | ||
demo={<DateRangePickerInlineDemo layout="vertical" center />} | ||
/> | ||
); | ||
|
||
export default Page; |
17 changes: 17 additions & 0 deletions
17
packages/website/src/pages/date-range/DateRangePickerPopoverCalendar.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {DateRangePickerPopoverCalendarMetadata} from '@coveord/plasma-components-props-analyzer'; | ||
import DateRangePickerDemo from '@examples/date-range/popover/DateRangePickerPopoverCalendar.demo?demo'; | ||
|
||
import {PageLayout} from '../../building-blocs/PageLayout'; | ||
|
||
const Page = () => ( | ||
<PageLayout | ||
section="Date range" | ||
title="Date Range Picker Popover Calendar" | ||
propsMetadata={DateRangePickerPopoverCalendarMetadata} | ||
description="." | ||
id="DateRangePickerPopoverCalendar" | ||
demo={<DateRangePickerDemo layout="vertical" center />} | ||
/> | ||
); | ||
|
||
export default Page; |