@bcgov/design-system-react-components 0.8.0 → 0.8.1-pr760
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 +20 -9
- package/dist/cjs/index.cjs +557 -709
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +556 -708
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +129 -72
- package/package.json +31 -27
package/README.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
# @bcgov/design-system-react-components
|
|
2
2
|
|
|
3
|
-
This package contains a library of React components built using
|
|
3
|
+
This package contains a library of React components, built using React Aria, as part of the B.C. Design System.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
To use these components, install this package and import the components you need into your application.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- GitHub: https://github.com/bcgov/design-system/
|
|
8
|
+
- Storybook: https://designsystem.gov.bc.ca/react-components/
|
|
9
|
+
- Documentation: https://gov.bc.ca/designsystem/
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
If you have questions, you can:
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
- <a href="mailto:DesignSystem@gov.bc.ca">Email designsystem@gov.bc.ca</a>
|
|
14
|
+
- <a href="https://github.com/bcgov/design-system/issues">Open an issue on GitHub</a>
|
|
12
15
|
|
|
13
16
|
## Install
|
|
14
17
|
|
|
@@ -66,6 +69,8 @@ export default function App() {
|
|
|
66
69
|
|
|
67
70
|
## Component list
|
|
68
71
|
|
|
72
|
+
Most components are based on <a href="https://react-aria.adobe.com">React Aria</a> primitives.
|
|
73
|
+
|
|
69
74
|
| Component | React Aria docs link |
|
|
70
75
|
| --------------------------------------------------------------------------- | ---------------------------------------------- |
|
|
71
76
|
| AlertBanner | N/A |
|
|
@@ -108,6 +113,8 @@ export default function App() {
|
|
|
108
113
|
|
|
109
114
|
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 || ^19.0.0"`
|
|
110
115
|
|
|
116
|
+
If using React v16 or v17, you'll need to use an [SSRProvider](https://react-aria.adobe.com/SSRProvider) to prevent errors from components that rely on the [useId hook](https://react-aria.adobe.com/useId).
|
|
117
|
+
|
|
111
118
|
By targeting v16.14.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`:
|
|
112
119
|
|
|
113
120
|
```json
|
|
@@ -188,7 +195,11 @@ Then in a local React project folder, use `npm link @bcgov/design-system-react-c
|
|
|
188
195
|
|
|
189
196
|
### Linting
|
|
190
197
|
|
|
191
|
-
ESLint is used for linting. See configuration file `eslint.config.js` and `lint` script in `package.json`.
|
|
198
|
+
ESLint is used for linting TypeScript files. See configuration file `eslint.config.js` and `lint:ts` script in `package.json`.
|
|
199
|
+
|
|
200
|
+
Stylelint is used for linting CSS files. See configuration file `stylelint.config.mjs` and `lint:css` script in `package.json`.
|
|
201
|
+
|
|
202
|
+
The `lint` script in `package.json` runs both the TypeScript and CSS linting in series.
|
|
192
203
|
|
|
193
204
|
### Formatting
|
|
194
205
|
|
|
@@ -198,14 +209,14 @@ Prettier is used for formatting. See configuration file `prettier.config.js` and
|
|
|
198
209
|
|
|
199
210
|
#### npm package
|
|
200
211
|
|
|
201
|
-
Publishing new versions of the package
|
|
212
|
+
Publishing new versions of the package is done via GitHub Actions.
|
|
202
213
|
|
|
203
214
|
GitHub Actions are located in `/.github/workflows` in the project root. Actions are included to:
|
|
204
215
|
|
|
205
216
|
- Build the Storybook and Vite applications on merge to `main`
|
|
206
217
|
- Test (Vitest and Playwright) on pull request
|
|
207
|
-
- Publish new versions of the library
|
|
208
|
-
- Publish new versions of the library
|
|
218
|
+
- Publish new versions of the library to npm (`next` tag) and GitHub Packages on merge to `main`
|
|
219
|
+
- Publish new production versions of the library to npm (`latest` tag) and GitHub Packages when a GitHub release is published
|
|
209
220
|
|
|
210
221
|
#### GitHub release
|
|
211
222
|
|