@bcgov/design-system-react-components 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/dist/cjs/index.cjs +8074 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/types/components/Tag/Tag.d.ts +11 -0
- package/dist/cjs/types/components/Tag/index.d.ts +2 -0
- package/dist/cjs/types/components/TagGroup/TagGroup.d.ts +8 -0
- package/dist/cjs/types/components/TagGroup/index.d.ts +2 -0
- package/dist/cjs/types/components/TagList/TagList.d.ts +8 -0
- package/dist/cjs/types/components/TagList/index.d.ts +2 -0
- package/dist/cjs/types/components/index.d.ts +3 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/esm/index.js +8070 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types/components/Tag/Tag.d.ts +11 -0
- package/dist/esm/types/components/Tag/index.d.ts +2 -0
- package/dist/esm/types/components/TagGroup/TagGroup.d.ts +8 -0
- package/dist/esm/types/components/TagGroup/index.d.ts +2 -0
- package/dist/esm/types/components/TagList/TagList.d.ts +8 -0
- package/dist/esm/types/components/TagList/index.d.ts +2 -0
- package/dist/esm/types/components/index.d.ts +3 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/index.d.ts +25 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @bcgov/design-system-react-components
|
|
2
|
+
|
|
3
|
+
This package contains a library of React components built using [React Aria Components](https://react-spectrum.adobe.com/react-aria/react-aria-components.html) to implement the BC Design System.
|
|
4
|
+
|
|
5
|
+
Questions? Please email the <a href="mailto:DesignSystem@gov.bc.ca">GDX OSS Design Team</a>.
|
|
6
|
+
|
|
7
|
+
See repository: https://github.com/bcgov/design-system
|
|
8
|
+
|
|
9
|
+
To use, install this package and import the components into your application.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
`npm install @bcgov/design-system-react-components`
|
|
14
|
+
|
|
15
|
+
## Use
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
// App.jsx
|
|
19
|
+
|
|
20
|
+
import { TagGroup, TagList } from "@bcgov/design-system-react-components";
|
|
21
|
+
|
|
22
|
+
export default function App() {
|
|
23
|
+
return (
|
|
24
|
+
<TagGroup aria-label="Tags">
|
|
25
|
+
<TagList items={[]}>
|
|
26
|
+
</TagGroup>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Component list
|
|
32
|
+
|
|
33
|
+
| Component | React Aria Components docs link |
|
|
34
|
+
| ---------------------- | --------------------------------------------------------- |
|
|
35
|
+
| TagGroup, TagList, Tag | https://react-spectrum.adobe.com/react-aria/TagGroup.html |
|
|
36
|
+
|
|
37
|
+
## Supported React versions
|
|
38
|
+
|
|
39
|
+
This package has a peer dependency on `react` and `react-dom` at these versions: `"^16.14.0 || ^17.0.0-rc.1 || ^18.0.0"`
|
|
40
|
+
|
|
41
|
+
By targeting v16.4.0 as a minimum, we get to use [React's modern JSX transformation](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) in `tsconfig.json`:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
"jsx": "react-jsx",
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This means there's no need for unused `import React from "react"` statements in your JSX files.
|
|
48
|
+
|
|
49
|
+
## Development
|
|
50
|
+
|
|
51
|
+
### Components
|
|
52
|
+
|
|
53
|
+
Components live in `./src/components` and are targeted by the build process with an export in `./src/index.ts`.
|
|
54
|
+
|
|
55
|
+
### Storybook
|
|
56
|
+
|
|
57
|
+
Storybook stories live in `./src/stories`.
|
|
58
|
+
|
|
59
|
+
Run `npm run storybook` to access the Storybook instance for the component library.
|
|
60
|
+
|
|
61
|
+
### Vite kitchen sink application
|
|
62
|
+
|
|
63
|
+
Vite uses the components code directly from `./src/components` in groups of content in `./src/pages`.
|
|
64
|
+
|
|
65
|
+
Run `npm run vite` to access the Vite React demo app.
|
|
66
|
+
|
|
67
|
+
### Publish new versions
|
|
68
|
+
|
|
69
|
+
To generate an updated copy of the package for distribution, run the included Rollup script: `npm run rollup`.
|
|
70
|
+
|
|
71
|
+
This will place artifacts in the `dist` folder, which is targeted for publishing in `package.json` with the [`files` field](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#files).
|
|
72
|
+
|
|
73
|
+
Update the package version in `package.json` and run `npm run publish` to push a new version.
|