-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datepickers): introduce Datepicker component (#373)
- Loading branch information
Austin Green
authored
Jul 3, 2019
1 parent
4a3b6a6
commit 31dc792
Showing
33 changed files
with
2,493 additions
and
13 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
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,44 @@ | ||
# @zendeskgarden/react-datepickers [](https://www.npmjs.com/package/@zendeskgarden/react-datepickers) | ||
|
||
This package includes components relating to datepickers in the | ||
[Garden Design System](https://zendeskgarden.github.io/). | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install @zendeskgarden/react-datepickers | ||
|
||
# Peer Dependencies - Also Required | ||
npm install react react-dom prop-types styled-components @zendeskgarden/react-theming | ||
``` | ||
|
||
## Usage | ||
|
||
```jsx static | ||
/** | ||
* Include datepickers styling at the root of your application | ||
*/ | ||
import '@zendeskgarden/react-datepickers/dist/styles.css'; | ||
|
||
import { ThemeProvider } from '@zendeskgarden/react-theming'; | ||
import { Field, Label, Input } from '@zendeskgarden/react-forms'; | ||
import { Datepicker } from '@zendeskgarden/react-datepickers'; | ||
|
||
/** | ||
* Place a `ThemeProvider` at the root of your React application | ||
*/ | ||
<ThemeProvider> | ||
<Field> | ||
<Label>Example datepicker</Label> | ||
<Datepicker value={new Date()} onChange={selectedDate => console.log(selectedDate)}> | ||
<Input /> | ||
</Datepicker> | ||
</Field> | ||
</ThemeProvider>; | ||
``` | ||
|
||
## date-fns dependency | ||
|
||
We currently use the v2, `date-fns@next`, distribution of [date-fns](https://date-fns.org/). | ||
This allows us to provide a wider range of locales and include non-strict date parsing. | ||
Ensure you are depending on locales from this version of `date-fns`. |
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,53 @@ | ||
{ | ||
"name": "@zendeskgarden/react-datepickers", | ||
"description": "Components relating to datepickers in the Garden Design System", | ||
"license": "Apache-2.0", | ||
"author": "Zendesk Garden <[email protected]>", | ||
"homepage": "https://garden.zendesk.com/", | ||
"repository": "https://github.com/zendeskgarden/react-components", | ||
"bugs": { | ||
"url": "https://github.com/zendeskgarden/react-components/issues" | ||
}, | ||
"version": "0.0.0", | ||
"main": "./dist/index.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "../../utils/scripts/build.sh", | ||
"build:demo": "../../utils/scripts/build-demo.sh", | ||
"start": "../../utils/scripts/start.sh" | ||
}, | ||
"types": "dist/typings/index.d.ts", | ||
"dependencies": { | ||
"@zendeskgarden/container-utilities": "^0.1.0", | ||
"classnames": "^2.2.5", | ||
"date-fns": "^2.0.0-beta.2", | ||
"polished": "^3.4.1", | ||
"react-popper": "^1.3.3" | ||
}, | ||
"peerDependencies": { | ||
"@zendeskgarden/react-theming": "^6.0.0", | ||
"prop-types": "^15.6.1", | ||
"react": "^16.8.0", | ||
"react-dom": "^16.8.0", | ||
"styled-components": "^4.2.0" | ||
}, | ||
"devDependencies": { | ||
"@zendeskgarden/css-arrows": "3.1.1", | ||
"@zendeskgarden/css-menus": "9.0.11", | ||
"@zendeskgarden/react-theming": "^6.0.1", | ||
"@zendeskgarden/svg-icons": "6.3.0" | ||
}, | ||
"keywords": [ | ||
"components", | ||
"garden", | ||
"react", | ||
"zendesk" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"zendeskgarden:library": "GardenDatepickers", | ||
"zendeskgarden:src": "src/index.ts" | ||
} |
Oops, something went wrong.