-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from Enterwell/feature/component-datetimerange…
…picker-and-timeintpu feat: Added components DateTimeRangePicker and TimeInput
- Loading branch information
Showing
17 changed files
with
736 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { DateTimeRangePicker } from '@enterwell/react-ui'; | ||
import { useState } from 'react'; | ||
|
||
export function ExampleDateTimeRangePicker() { | ||
const [start, setStart] = useState<Date>(new Date(new Date().getTime() - 1000 * 60 * 60 * 24)); | ||
const [end, setEnd] = useState<Date>(new Date()); | ||
|
||
return ( | ||
// @highlight-start | ||
<DateTimeRangePicker | ||
start={start} | ||
end={end} | ||
onChange={(start, end) => { setStart(start); setEnd(end); }} /> | ||
// @highlight-end | ||
) | ||
} |
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,14 @@ | ||
import { TimeInput } from '@enterwell/react-ui'; | ||
import { useState } from 'react'; | ||
|
||
export function ExampleTimeInput() { | ||
const [value, setValue] = useState('12:00'); | ||
|
||
return ( | ||
// @highlight-start | ||
<TimeInput | ||
value={value} | ||
onTimeChange={(setValue)} /> | ||
// @highlight-end | ||
) | ||
} |
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
33 changes: 33 additions & 0 deletions
33
apps/docs/pages/react-ui/components/date-time-range-picker.mdx
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,33 @@ | ||
--- | ||
title: DateTimeRangePicker | ||
--- | ||
|
||
import { DateTimeRangePicker } from '@enterwell/react-ui'; | ||
import { ComponentWithSource } from '../../../components/docs/ComponentWithSource.tsx'; | ||
import { ExampleDateTimeRangePicker } from '../../../components/ExampleDateTimeRangePicker.tsx'; | ||
import { ComponentDescription, ComponentParameters, ComponentSource } from '../../../components/docs/ComponentDocs'; | ||
|
||
# DateTimeRangePicker | ||
|
||
## Description | ||
|
||
<ComponentDescription name="DateTimeRangePicker" /> | ||
|
||
### Parameters | ||
|
||
<ComponentParameters name="DateTimeRangePicker" /> | ||
|
||
## Example | ||
|
||
<ComponentWithSource component={ ExampleDateTimeRangePicker } centered /> | ||
|
||
## Inspect | ||
|
||
<details> | ||
<summary>Source code</summary> | ||
<ComponentSource | ||
package="@enterwell/react-ui" | ||
directory="DateTimeRangePicker" | ||
name="DateTimeRangePicker" | ||
/> | ||
</details> |
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,33 @@ | ||
--- | ||
title: TimeInput | ||
--- | ||
|
||
import { TimeInput } from '@enterwell/react-ui'; | ||
import { ComponentWithSource } from '../../../components/docs/ComponentWithSource.tsx'; | ||
import { ExampleTimeInput } from '../../../components/ExampleTimeInput.tsx'; | ||
import { ComponentDescription, ComponentParameters, ComponentSource } from '../../../components/docs/ComponentDocs'; | ||
|
||
# TimeInput | ||
|
||
## Description | ||
|
||
<ComponentDescription name="TimeInput" /> | ||
|
||
### Parameters | ||
|
||
<ComponentParameters name="TimeInput" /> | ||
|
||
## Example | ||
|
||
<ComponentWithSource component={ ExampleTimeInput } centered /> | ||
|
||
## Inspect | ||
|
||
<details> | ||
<summary>Source code</summary> | ||
<ComponentSource | ||
package="@enterwell/react-ui" | ||
directory="TimeInput" | ||
name="TimeInput" | ||
/> | ||
</details> |
Oops, something went wrong.