-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(date): use internal element builder
- Loading branch information
Showing
6 changed files
with
35 additions
and
32 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 |
---|---|---|
@@ -1,17 +1 @@ | ||
<!--prettier-ignore-start--> | ||
# @equinor/fusion-react-date | ||
[](https://www.npmjs.com/package/@equinor/fusion-react-date) | ||
|
||
[Storybook](https://equinor.github.io/fusion-react-components/?path=/docs/data-date) | ||
|
||
[Fusion Web Component](https://github.com/equinor/fusion-web-components/tree/main/packages/date) | ||
|
||
### Installation | ||
|
||
```sh | ||
npm install @equinor/fusion-react-date | ||
``` | ||
|
||
## Example Usage | ||
|
||
TODO |
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 |
---|---|---|
@@ -1,7 +1,22 @@ | ||
import * as React from 'react'; | ||
import { createComponent } from '@lit-labs/react'; | ||
import { createComponent } from '@equinor/fusion-react-utils'; | ||
import { DateRangeElement as HTMLDateRangeCustomElement, dateRangeTag } from '@equinor/fusion-wc-date'; | ||
|
||
export const DateRange = createComponent(React, dateRangeTag, HTMLDateRangeCustomElement); | ||
export { HTMLDateRangeCustomElement }; | ||
|
||
type ElementProps = React.PropsWithChildren< | ||
Partial< | ||
Pick< | ||
HTMLDateRangeCustomElement, | ||
'from' | 'to' | 'format' | 'suffix' | 'variant' | 'locale' | 'seconds' | 'weekstart' | 'capitalize' | ||
> | ||
> | ||
>; | ||
|
||
export const DateRange = createComponent<HTMLDateRangeCustomElement, ElementProps>( | ||
HTMLDateRangeCustomElement, | ||
dateRangeTag | ||
); | ||
|
||
export type DateRangeProps = React.ComponentProps<typeof DateRange>; | ||
|
||
export default DateRange; |
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,7 +1,15 @@ | ||
import * as React from 'react'; | ||
import { createComponent } from '@lit-labs/react'; | ||
import { createComponent } from '@equinor/fusion-react-utils'; | ||
import { DateTimeElement as HTMLDateTimeCustomElement, dateTimeTag } from '@equinor/fusion-wc-date'; | ||
|
||
export const DateTime = createComponent(React, dateTimeTag, HTMLDateTimeCustomElement); | ||
export { HTMLDateTimeCustomElement }; | ||
|
||
type ElementProps = React.PropsWithChildren<Partial<Pick<HTMLDateTimeCustomElement, 'date' | 'format' | 'locale'>>>; | ||
|
||
export const DateTime = createComponent<HTMLDateTimeCustomElement, ElementProps>( | ||
HTMLDateTimeCustomElement, | ||
dateTimeTag | ||
); | ||
|
||
export type DateTimeProps = React.ComponentProps<typeof DateTime>; | ||
|
||
export default DateTime; |
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