@bcgov/design-system-react-components 0.0.1 → 0.0.2
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 +25 -7
- package/dist/cjs/index.cjs +1325 -905
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +9 -0
- package/dist/cjs/types/components/Button/index.d.ts +2 -0
- package/dist/cjs/types/components/Tag/Tag.d.ts +1 -4
- package/dist/cjs/types/components/index.d.ts +2 -0
- package/dist/esm/index.js +1326 -907
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Button/Button.d.ts +9 -0
- package/dist/esm/types/components/Button/index.d.ts +2 -0
- package/dist/esm/types/components/Tag/Tag.d.ts +1 -4
- package/dist/esm/types/components/index.d.ts +2 -0
- package/dist/index.d.ts +11 -4
- package/package.json +25 -25
package/README.md
CHANGED
|
@@ -12,19 +12,36 @@ To use, install this package and import the components into your application.
|
|
|
12
12
|
|
|
13
13
|
`npm install @bcgov/design-system-react-components`
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## BC Sans font dependency
|
|
16
|
+
|
|
17
|
+
This package installs [@bcgov/bc-sans](https://www.npmjs.com/package/@bcgov/bc-sans) as a peer dependency. You must import the font-face declarations from @bcgov/bc-sans and ensure the font is reachable for your end user. The React components require that the `BC Sans` font-face is available to display correctly. The components do not ship their own copies of the font to minimize your bundle size.
|
|
18
|
+
|
|
19
|
+
**Important!** If you are on a BC Government-provisioned laptop, you already have the BC Sans font installed on your machine. This package uses `BC Sans` (with a space) for its font styles. If you are using this component library but not supplying the font, it's possible that your machine will still display the font correctly for you, **but not your end user**. Make sure to check this by disabling the font on your machine or by testing with another machine.
|
|
20
|
+
|
|
21
|
+
### Use
|
|
16
22
|
|
|
17
23
|
```jsx
|
|
18
24
|
// App.jsx
|
|
19
25
|
|
|
26
|
+
// If you're already importing the BC Sans font-face somewhere else in your
|
|
27
|
+
// project, there is no need to import it again. Just make sure the `BC Sans`
|
|
28
|
+
// declaration and font files are available.
|
|
29
|
+
import "@bcgov/bc-sans/css/BC_Sans.css";
|
|
30
|
+
|
|
31
|
+
// Import the individual components you need
|
|
20
32
|
import { TagGroup, TagList } from "@bcgov/design-system-react-components";
|
|
21
33
|
|
|
22
34
|
export default function App() {
|
|
23
35
|
return (
|
|
24
|
-
<TagGroup aria-label="
|
|
25
|
-
<TagList
|
|
36
|
+
<TagGroup aria-label="Tag group with two items">
|
|
37
|
+
<TagList
|
|
38
|
+
items={[
|
|
39
|
+
{ id: "one", textValue: "One" },
|
|
40
|
+
{ id: "two", textValue: "Two" },
|
|
41
|
+
]}
|
|
42
|
+
/>
|
|
26
43
|
</TagGroup>
|
|
27
|
-
)
|
|
44
|
+
);
|
|
28
45
|
}
|
|
29
46
|
```
|
|
30
47
|
|
|
@@ -32,6 +49,7 @@ export default function App() {
|
|
|
32
49
|
|
|
33
50
|
| Component | React Aria Components docs link |
|
|
34
51
|
| ---------------------- | --------------------------------------------------------- |
|
|
52
|
+
| Button | https://react-spectrum.adobe.com/react-aria/Button.html |
|
|
35
53
|
| TagGroup, TagList, Tag | https://react-spectrum.adobe.com/react-aria/TagGroup.html |
|
|
36
54
|
|
|
37
55
|
## Supported React versions
|
|
@@ -56,13 +74,13 @@ Components live in `./src/components` and are targeted by the build process with
|
|
|
56
74
|
|
|
57
75
|
Storybook stories live in `./src/stories`.
|
|
58
76
|
|
|
59
|
-
Run `npm run storybook` to access the Storybook instance for the component library.
|
|
77
|
+
Run `npm run storybook-dev` to access the Storybook instance for the component library.
|
|
60
78
|
|
|
61
79
|
### Vite kitchen sink application
|
|
62
80
|
|
|
63
81
|
Vite uses the components code directly from `./src/components` in groups of content in `./src/pages`.
|
|
64
82
|
|
|
65
|
-
Run `npm run vite` to access the Vite React demo app.
|
|
83
|
+
Run `npm run vite-dev` to access the Vite React demo app.
|
|
66
84
|
|
|
67
85
|
### Publish new versions
|
|
68
86
|
|
|
@@ -70,4 +88,4 @@ To generate an updated copy of the package for distribution, run the included Ro
|
|
|
70
88
|
|
|
71
89
|
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
90
|
|
|
73
|
-
Update the package version in `package.json` and run `npm
|
|
91
|
+
Update the package version in `package.json` and run `npm publish` to push a new version.
|