@bcgov/design-system-react-components 0.0.1 → 0.0.3

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.
Files changed (39) hide show
  1. package/README.md +27 -7
  2. package/dist/assets/BCSans-Bold-ZqE3sZik.woff +0 -0
  3. package/dist/assets/BCSans-Bold-onJZunl0.woff2 +0 -0
  4. package/dist/assets/BCSans-BoldItalic-4P_OlA2s.woff +0 -0
  5. package/dist/assets/BCSans-BoldItalic-GxGpSOWy.woff2 +0 -0
  6. package/dist/assets/BCSans-Italic-Pz_cGW4F.woff2 +0 -0
  7. package/dist/assets/BCSans-Italic-UhTyhoET.woff +0 -0
  8. package/dist/assets/BCSans-Light-A03rbYd1.woff2 +0 -0
  9. package/dist/assets/BCSans-Light-playkmYo.woff +0 -0
  10. package/dist/assets/BCSans-LightItalic-HTeW1g69.woff2 +0 -0
  11. package/dist/assets/BCSans-LightItalic-tgMWPWlK.woff +0 -0
  12. package/dist/assets/BCSans-Regular-jMf6NRx3.woff +0 -0
  13. package/dist/assets/BCSans-Regular-ysGfRp0T.woff2 +0 -0
  14. package/dist/assets/index-t1vEzjyT.css +1 -0
  15. package/dist/assets/index-yaBoZILt.js +48 -0
  16. package/dist/cjs/index.cjs +6963 -2151
  17. package/dist/cjs/index.cjs.map +1 -1
  18. package/dist/cjs/types/components/Button/Button.d.ts +9 -0
  19. package/dist/cjs/types/components/Button/index.d.ts +2 -0
  20. package/dist/cjs/types/components/Select/Select.d.ts +30 -0
  21. package/dist/cjs/types/components/Select/index.d.ts +2 -0
  22. package/dist/cjs/types/components/SelectItem/SelectItem.d.ts +16 -0
  23. package/dist/cjs/types/components/SelectItem/index.d.ts +2 -0
  24. package/dist/cjs/types/components/Tag/Tag.d.ts +1 -4
  25. package/dist/cjs/types/components/index.d.ts +4 -0
  26. package/dist/esm/index.js +6962 -2153
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/types/components/Button/Button.d.ts +9 -0
  29. package/dist/esm/types/components/Button/index.d.ts +2 -0
  30. package/dist/esm/types/components/Select/Select.d.ts +30 -0
  31. package/dist/esm/types/components/Select/index.d.ts +2 -0
  32. package/dist/esm/types/components/SelectItem/SelectItem.d.ts +16 -0
  33. package/dist/esm/types/components/SelectItem/index.d.ts +2 -0
  34. package/dist/esm/types/components/Tag/Tag.d.ts +1 -4
  35. package/dist/esm/types/components/index.d.ts +4 -0
  36. package/dist/index.d.ts +54 -4
  37. package/dist/index.html +14 -0
  38. package/dist/vite.svg +1 -0
  39. package/package.json +29 -29
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @bcgov/design-system-react-components
2
2
 
3
+ [![Lifecycle:Experimental](https://img.shields.io/badge/Lifecycle-Experimental-339999)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
4
+
3
5
  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
6
 
5
7
  Questions? Please email the <a href="mailto:DesignSystem@gov.bc.ca">GDX OSS Design Team</a>.
@@ -12,19 +14,36 @@ To use, install this package and import the components into your application.
12
14
 
13
15
  `npm install @bcgov/design-system-react-components`
14
16
 
15
- ## Use
17
+ ## BC Sans font dependency
18
+
19
+ 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.
20
+
21
+ **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.
22
+
23
+ ### Use
16
24
 
17
25
  ```jsx
18
26
  // App.jsx
19
27
 
28
+ // If you're already importing the BC Sans font-face somewhere else in your
29
+ // project, there is no need to import it again. Just make sure the `BC Sans`
30
+ // declaration and font files are available.
31
+ import "@bcgov/bc-sans/css/BC_Sans.css";
32
+
33
+ // Import the individual components you need
20
34
  import { TagGroup, TagList } from "@bcgov/design-system-react-components";
21
35
 
22
36
  export default function App() {
23
37
  return (
24
- <TagGroup aria-label="Tags">
25
- <TagList items={[]}>
38
+ <TagGroup aria-label="Tag group with two items">
39
+ <TagList
40
+ items={[
41
+ { id: "one", textValue: "One" },
42
+ { id: "two", textValue: "Two" },
43
+ ]}
44
+ />
26
45
  </TagGroup>
27
- )
46
+ );
28
47
  }
29
48
  ```
30
49
 
@@ -32,6 +51,7 @@ export default function App() {
32
51
 
33
52
  | Component | React Aria Components docs link |
34
53
  | ---------------------- | --------------------------------------------------------- |
54
+ | Button | https://react-spectrum.adobe.com/react-aria/Button.html |
35
55
  | TagGroup, TagList, Tag | https://react-spectrum.adobe.com/react-aria/TagGroup.html |
36
56
 
37
57
  ## Supported React versions
@@ -56,13 +76,13 @@ Components live in `./src/components` and are targeted by the build process with
56
76
 
57
77
  Storybook stories live in `./src/stories`.
58
78
 
59
- Run `npm run storybook` to access the Storybook instance for the component library.
79
+ Run `npm run storybook-dev` to access the Storybook instance for the component library.
60
80
 
61
81
  ### Vite kitchen sink application
62
82
 
63
83
  Vite uses the components code directly from `./src/components` in groups of content in `./src/pages`.
64
84
 
65
- Run `npm run vite` to access the Vite React demo app.
85
+ Run `npm run vite-dev` to access the Vite React demo app.
66
86
 
67
87
  ### Publish new versions
68
88
 
@@ -70,4 +90,4 @@ To generate an updated copy of the package for distribution, run the included Ro
70
90
 
71
91
  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
92
 
73
- Update the package version in `package.json` and run `npm run publish` to push a new version.
93
+ Update the package version in `package.json` and run `npm publish` to push a new version.
@@ -0,0 +1 @@
1
+ #root{max-width:1280px;margin:0 auto;padding:2rem}h1,h2,h3,h4,h5,h6{font-family:var(--typography-font-families-bc-sans)}:root{--surface-opacity-0: 0;--surface-opacity-10: .1;--surface-opacity-20: .2;--surface-opacity-30: .3;--surface-opacity-40: .4;--surface-opacity-50: .5;--surface-opacity-60: .6;--surface-opacity-70: .7;--surface-opacity-80: .8;--surface-opacity-90: .9;--surface-opacity-100: 1;--surface-primary-default: #013366;--surface-primary-hover: #1E5189;--surface-primary-disabled: #edebe9;--surface-primary-active: #2E5DD7;--surface-secondary-default: #ffffff;--surface-secondary-hover: #edebe9;--surface-secondary-disabled: #edebe9;--surface-secondary-active: #2E5DD7;--surface-tertiary-default: #ffffff00;--surface-tertiary-hover: #eceae8;--surface-tertiary-disabled: #edebe9;--surface-tertiary-active: #2E5DD7;--surface-danger-default: #ce3e39;--surface-danger-hover: #a2312d;--surface-danger-active: #2E5DD7;--surface-danger-disabled: #edebe9;--surface-background-white: #ffffff;--surface-background-light: #faf9f8;--surface-border-light: #d8d8d8;--surface-border-medium: #898785;--surface-border-dark: #353433;--surface-overlay-default: #00000073;--surface-brand-gold-10: #fff8e9;--surface-brand-gold-20: #feebc2;--surface-brand-gold-30: #fddf9d;--surface-brand-gold-40: #fdd47b;--surface-brand-gold-50: #fcc85d;--surface-brand-gold-60: #f8ba47;--surface-brand-gold-70: #ce9737;--surface-brand-gold-80: #a5792b;--surface-brand-gold-90: #7e5d21;--surface-brand-gold-100: #584215;--surface-brand-blue-10: #f1f8fe;--surface-brand-blue-20: #d8eafd;--surface-brand-blue-30: #c1ddfc;--surface-brand-blue-40: #a8d0fb;--surface-brand-blue-50: #91c4fa;--surface-brand-blue-60: #7ab8f9;--surface-brand-blue-70: #5595d9;--surface-brand-blue-80: #3470b1;--surface-brand-blue-90: #1e5189;--surface-brand-blue-100: #053662;--surface-brand-gray-10: #faf9f8;--surface-brand-gray-20: #f3f2f1;--surface-brand-gray-30: #eceae8;--surface-brand-gray-40: #e0dedc;--surface-brand-gray-50: #d1cfcd;--surface-brand-gray-60: #c6c5c3;--surface-brand-gray-70: #9f9d9c;--surface-brand-gray-80: #605e5c;--surface-brand-gray-90: #3d3c3b;--surface-brand-gray-100: #353433;--surface-brand-gray-110: #252423;--surface-brand-gray-white: #ffffff;--surface-icons-primary: #2d2d2d;--surface-icons-secondary: #474543;--surface-icons-disabled: #9f9d9c;--surface-icons-link: #255a90;--surface-icons-info: #053662;--surface-icons-danger: #ce3e39;--surface-icons-success: #42814a;--surface-icons-warning: #f8bb47;--surface-support-surface-color-info: #f7f9fc;--surface-support-surface-color-danger: #f4e1e2;--surface-support-surface-color-success: #f6fff8;--surface-support-surface-color-warning: #fef1d8;--surface-support-border-color-info: #053662;--surface-support-border-color-danger: #ce3e39;--surface-support-border-color-success: #42814a;--surface-support-border-color-warning: #f8bb47;--surface-shadow-none: 0 .30000001192092896px .8999999761581421px 0 #0000001a, 0 1.600000023841858px 3.5999999046325684px 0 #00000021;--surface-shadow-small: 0 .6000000238418579px 1.7999999523162842px 0 #0000001a, 0 3.200000047683716px 7.199999809265137px 0 #00000021;--surface-shadow-medium: 0 1.2000000476837158px 3.5999999046325684px 0 #0000001a, 0 6.400000095367432px 14.399999618530273px 0 #00000021;--surface-shadow-large: 0 4.800000190734863px 14.399999618530273px 0 #0000002e, 0 25.600000381469727px 57.599998474121094px 0 #00000038;--surface-border-radius-none: 0;--surface-border-radius-small: 2px;--surface-border-radius-medium: 4px;--surface-border-radius-large: 6px;--surface-border-width-none: 0;--surface-border-width-small: 1px;--surface-border-width-medium: 2px;--surface-border-width-large: 4px;--surface-size-small: 0px 8px;--surface-size-medium: 6px 16px;--support-support-surface-color-info: #f7f9fc;--support-support-surface-color-danger: #f4e1e2;--support-support-surface-color-success: #f6fff8;--support-support-surface-color-warning: #fef1d8;--support-support-border-color-info: #053662;--support-support-border-color-danger: #ce3e39;--support-support-border-color-success: #42814a;--support-support-border-color-warning: #f8bb47;--icons-icons-primary: #2d2d2d;--icons-icons-secondary: #474543;--icons-icons-disabled: #9f9d9c;--icons-icons-link: #255a90;--icons-icons-info: #053662;--icons-icons-danger: #ce3e39;--icons-icons-success: #42814a;--icons-icons-warning: #f8bb47;--icons-icons-primary-invert: #ffffff;--icons-size-xsmall: 14px;--icons-size-small: 16px;--icons-size-medium: 20px;--icons-size-large: 24px;--icons-size-xlarge: 32px;--layout-border-width-none: 0;--layout-border-width-small: 1px;--layout-border-width-medium: 2px;--layout-border-width-large: 4px;--layout-padding-none: 0;--layout-padding-xsmall: 4px;--layout-padding-small: 8px;--layout-padding-medium: 16px;--layout-padding-large: 24px;--layout-padding-xlarge: 32px;--layout-margin-none: 0;--layout-margin-hair: 2px;--layout-margin-xsmall: 4px;--layout-margin-small: 8px;--layout-margin-medium: 16px;--layout-margin-large: 24px;--layout-margin-xlarge: 32px;--layout-margin-xxlarge: 40px;--layout-margin-xxxlarge: 48px;--layout-margin-huge: 56px;--typography-font-families-bc-sans: "BC Sans";--typography-line-heights-xxdense: 1.313rem;--typography-line-heights-xdense: 1.688rem;--typography-line-heights-dense: 1.913rem;--typography-line-heights-regular: 2.125rem;--typography-line-heights-sparse: 2.25rem;--typography-line-heights-xsparse: 3rem;--typography-line-heights-xxsparse: 3.375rem;--typography-line-heights-auto: AUTO;--typography-font-weights-regular: 400;--typography-font-weights-bold: 700;--typography-font-weights-italic: Italic;--typography-font-size-label: .875rem;--typography-font-size-body: 1rem;--typography-font-size-large-body: 1.125rem;--typography-font-size-h5: 1.25rem;--typography-font-size-h4: 1.5rem;--typography-font-size-h3: 1.75rem;--typography-font-size-h2: 2rem;--typography-font-size-h1: 2.25rem;--typography-font-size-display: 3rem;--typography-letter-spacing-0: 0em;--typography-paragraph-spacing-0: 0;--typography-regular-label: 400 .875rem/1.313rem "BC Sans";--typography-regular-body: 400 1rem/1.688rem "BC Sans";--typography-regular-large-body: 400 1.125rem/1.913rem "BC Sans";--typography-regular-h5: 400 1.25rem/2.125rem "BC Sans";--typography-regular-h4: 400 1.5rem/2.25rem "BC Sans";--typography-regular-h3: 400 1.75rem/3rem "BC Sans";--typography-regular-h2: 400 2rem/3.375rem "BC Sans";--typography-regular-h1: 400 2.25rem/3rem "BC Sans";--typography-regular-display: 400 3rem/AUTO "BC Sans";--typography-bold-label: 700 .875rem/1.313rem "BC Sans";--typography-bold-body: 700 1rem/1.688rem "BC Sans";--typography-bold-large-body: 700 1.125rem/1.913rem "BC Sans";--typography-bold-h5: 700 1.25rem/2.125rem "BC Sans";--typography-bold-h4: 700 1.5rem/2.25rem "BC Sans";--typography-bold-h3: 700 1.75rem/3.375rem "BC Sans";--typography-bold-h2: 700 2rem/3rem "BC Sans";--typography-bold-h1: 700 2.25rem/AUTO "BC Sans";--typography-bold-display: 700 3rem/AUTO "BC Sans";--typography-italic-label: 400 italic .875rem/1.313rem "BC Sans";--typography-italic-body: 400 italic 1rem/1.688rem "BC Sans";--typography-italic-large-body: 400 italic 1.125rem/1.913rem "BC Sans";--typography-italic-h5: 400 italic 1.25rem/2.125rem "BC Sans";--typography-italic-h4: 400 italic 1.5rem/2.25rem "BC Sans";--typography-italic-h3: 400 italic 1.75rem/3.375rem "BC Sans";--typography-italic-h2: 400 italic 2rem/3.375rem "BC Sans";--typography-italic-h1: 400 italic 2.25rem/3rem "BC Sans";--typography-italic-display: 400 italic 3rem/AUTO "BC Sans";--typography-text-case-none: none;--typography-text-decoration-none: none;--typography-paragraph-indent-0: 0px;--typography-color-primary: #2D2D2D;--typography-color-secondary: #474543;--typography-color-disabled: #9F9D9C;--typography-color-link: #255A90;--typography-color-primary-invert: #FFFFFF;--typography-color-secondary-invert: #ECEAE8}@font-face{font-family:BC Sans;font-style:normal;font-weight:400;src:url(/assets/BCSans-Regular-ysGfRp0T.woff2) format("woff2"),url(/assets/BCSans-Regular-jMf6NRx3.woff) format("woff")}@font-face{font-family:BC Sans;font-style:italic;font-weight:400;src:url(/assets/BCSans-Italic-Pz_cGW4F.woff2) format("woff2"),url(/assets/BCSans-Italic-UhTyhoET.woff) format("woff")}@font-face{font-family:BC Sans;font-style:normal;font-weight:700;src:url(/assets/BCSans-Bold-onJZunl0.woff2) format("woff2"),url(/assets/BCSans-Bold-ZqE3sZik.woff) format("woff")}@font-face{font-family:BC Sans;font-style:italic;font-weight:700;src:url(/assets/BCSans-BoldItalic-GxGpSOWy.woff2) format("woff2"),url(/assets/BCSans-BoldItalic-4P_OlA2s.woff) format("woff")}@font-face{font-family:BC Sans;font-style:normal;font-weight:300;src:url(/assets/BCSans-Light-A03rbYd1.woff2) format("woff2"),url(/assets/BCSans-Light-playkmYo.woff) format("woff")}@font-face{font-family:BC Sans;font-style:italic;font-weight:300;src:url(/assets/BCSans-LightItalic-HTeW1g69.woff2) format("woff2"),url(/assets/BCSans-LightItalic-tgMWPWlK.woff) format("woff")}.react-aria-Button{border:none;border-radius:var(--layout-border-radius-medium, 4px);cursor:pointer;display:inline-flex;align-items:center;gap:var(--layout-padding-small);font:var(--typography-regular-body);padding-left:16px;padding-right:16px}.react-aria-Button[data-disabled]{cursor:not-allowed}.react-aria-Button[data-focused]{outline:2px solid var(--surface-primary-active)}.react-aria-Button.icon{align-items:center;justify-content:space-around}.react-aria-Button.small{min-height:32px}.react-aria-Button.small.icon{padding:unset;height:32px;width:32px}.react-aria-Button.medium{min-height:40px}.react-aria-Button.medium.icon{padding:unset;height:40px;width:40px}.react-aria-Button.primary{background:var(--surface-primary-default);color:var(--typography-color-primary-invert)}.react-aria-Button.primary.danger{background-color:var(--surface-danger-default)}.react-aria-Button.primary[data-disabled]{background-color:var(--surface-primary-disabled);color:var(--typography-color-disabled)}.react-aria-Button.primary[data-hovered]{background-color:var(--surface-primary-hover)}.react-aria-Button.primary.danger[data-hovered]{background-color:var(--surface-danger-hover)}.react-aria-Button.secondary{background-color:var(--surface-secondary-default);border:1px solid var(--surface-border-dark);color:var(--typography-color-primary)}.react-aria-Button.secondary.danger{border-color:var(--surface-support-border-color-danger);color:var(--surface-danger-default)}.react-aria-Button.secondary[data-disabled]{background-color:var(--surface-primary-disabled);border-color:var(--surface-border-light);color:var(--typography-color-disabled)}.react-aria-Button.secondary[data-hovered]{background-color:var(--surface-secondary-hover)}.react-aria-Button.secondary.danger[data-hovered]{background-color:var(--surface-support-surface-color-danger)}.react-aria-Button.tertiary{background-color:var(--surface-tertiary-default);color:var(--typography-color-primary)}.react-aria-Button.tertiary.danger{color:var(--surface-danger-default)}.react-aria-Button.tertiary[data-disabled]{background-color:var(--surface-tertiary-default);color:var(--typography-color-disabled)}.react-aria-Button.tertiary[data-hovered]{background-color:var(--surface-tertiary-hover)}.react-aria-Button.tertiary.danger[data-hovered]{background-color:var(--surface-support-surface-color-danger)}.react-aria-Button.link{background-color:var(--surface-tertiary-default);color:var(--typography-color-link);text-decoration:underline;text-underline-offset:.3em}.react-aria-Button.link.danger{color:var(--surface-danger-default)}.react-aria-Button.link[data-disabled]{color:var(--typography-color-disabled)}.react-aria-TagGroup{color:var(--typography-color-primary, #2d2d2d);font:var(--typography-regular-label, 400 .875rem/1.313rem "BC Sans")}.react-aria-Label,.react-aria-Text{display:block;margin:var(--layout-margin-small) var(--layout-margin-none)}.react-aria-Text.error{color:var(--surface-danger-default, #ce3e39)}.react-aria-Tag{color:var(--typography-color-primary, #2d2d2d);cursor:pointer;border-radius:var(--layout-margin-hair, 2px);border:1px solid;box-sizing:content-box;font:var(--typography-regular-label, 400 .875rem/1.313rem "BC Sans");padding:2px 8px;width:fit-content}.react-aria-Tag__contents{display:flex;align-items:center;gap:8px}.react-aria-Tag__contents .react-aria-Button{background:none;border:none;color:var(--typography-color-primary, #2d2d2d);cursor:pointer;display:flex;margin:0;padding:0}.react-aria-Tag.bc-blue{background-color:var(--surface-color-primary-default, #013366);border-color:var(--surface-color-primary-hover, #1e5189);color:var(--typography-color-primary-invert, #ffffff)}.react-aria-Tag.bc-blue .react-aria-Tag__contents>.react-aria-Button{color:var(--typography-color-primary-invert, #ffffff)}.react-aria-Tag.bc-gold{background-color:var(--surface-color-brand-gold-60, #f8ba47);border-color:var(--surface-color-primary-hover, #1e5189)}.react-aria-Tag.blue{background-color:var(--surface-support-surface-color-info, #f7f9fc);border-color:var(--surface-support-border-color-info, #053662)}.react-aria-Tag.dark{border-color:var(--surface-primary-hover, #1e5189);background:var(--surface-brand-gray-110, #252423);color:var(--typography-color-primary-invert, #ffffff)}.react-aria-Tag.dark .react-aria-Tag__contents>.react-aria-Button{color:var(--typography-color-primary-invert, #ffffff)}.react-aria-Tag.gray,.react-aria-Tag.grey{background-color:var(--surface-brand-gray-20, #f3f2f1);border-color:var(--surface-border-dark, #353433)}.react-aria-Tag.green{background-color:var(--surface-support-surface-color-success, #f6fff8);border-color:var(--surface-support-border-color-success, #42814a)}.react-aria-Tag.red{background-color:var(--surface-support-surface-color-danger, #f4e1e2);border-color:var(--surface-support-border-color-danger, #ce3e39)}.react-aria-Tag.yellow{background-color:var(--surface-support-surface-color-warning, #fef1d8);border-color:var(--surface-support-border-color-warning, #f8bb47)}.react-aria-Tag[data-selected]{border:2px solid var(--surface-primary-active, #2e5dd7);padding:1px 7px}.react-aria-Tag[data-focused]{outline:4px solid #3b99fc;outline-offset:1px}.react-aria-Tag[data-disabled]{background-color:var(--surface-primary-disabled, #edebe9);border-color:var(--surface-border-light, #d8d8d8);color:var(--typography-color-disabled, #9f9d9c);cursor:not-allowed}.react-aria-TagList{display:flex;flex-wrap:wrap;gap:var(--layout-padding-small);width:fit-content}.horizontal{flex-direction:row}.vertical{flex-direction:column}