@bcgov/design-system-react-components 0.0.2 → 0.0.4

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 +34 -11
  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 +5068 -733
  17. package/dist/cjs/index.cjs.map +1 -1
  18. package/dist/cjs/types/components/Header/Header.d.ts +11 -0
  19. package/dist/cjs/types/components/Header/index.d.ts +2 -0
  20. package/dist/cjs/types/components/Select/Select.d.ts +36 -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 -1
  25. package/dist/cjs/types/components/index.d.ts +2 -0
  26. package/dist/esm/index.js +5068 -736
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/types/components/Header/Header.d.ts +11 -0
  29. package/dist/esm/types/components/Header/index.d.ts +2 -0
  30. package/dist/esm/types/components/Select/Select.d.ts +36 -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 -1
  35. package/dist/esm/types/components/index.d.ts +2 -0
  36. package/dist/index.d.ts +48 -3
  37. package/dist/index.html +14 -0
  38. package/dist/vite.svg +1 -0
  39. package/package.json +24 -24
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import "./Header.css";
3
+ export declare function SvgBcLogo(): import("react/jsx-runtime").JSX.Element;
4
+ export interface HeaderProps {
5
+ logoLinkElement?: React.ReactElement;
6
+ logoImage?: JSX.Element;
7
+ skipLinks?: React.ReactElement[];
8
+ title?: string;
9
+ titleElement?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p";
10
+ }
11
+ export default function Header({ children, logoLinkElement, logoImage, skipLinks, title, titleElement, }: React.PropsWithChildren<HeaderProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default, SvgBcLogo } from "./Header";
2
+ export type { HeaderProps } from "./Header";
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import { Key, ListBoxItemProps as ReactAriaListBoxItemProps, SelectProps as ReactAriaSelectProps } from "react-aria-components";
3
+ import "./Select.css";
4
+ export interface ListBoxItemProps extends ReactAriaListBoxItemProps {
5
+ /** Text label for the option. Provide an `id` if this is not unique. */
6
+ label: string;
7
+ /** Descriptive text that appears below the option's label */
8
+ description?: string;
9
+ /** Marks an option visually with red text to indicate a destructive/dangerous option */
10
+ isDestructive?: boolean;
11
+ /** Left icon slot */
12
+ iconLeft?: React.ReactElement;
13
+ /** Right icon slot */
14
+ iconRight?: React.ReactElement;
15
+ }
16
+ export interface SelectionSectionProps {
17
+ id: Key;
18
+ /** Label for the section */
19
+ header?: string;
20
+ /** Flat list of options within the section */
21
+ items: ListBoxItemProps[];
22
+ }
23
+ export interface SelectProps<T extends object> extends ReactAriaSelectProps<T> {
24
+ /** Use `items` for a flat list of options */
25
+ items?: ListBoxItemProps[];
26
+ /** Use `sections` for a sectioned list with `items` options in each section */
27
+ sections?: SelectionSectionProps[];
28
+ /** Text label for the Select component */
29
+ label?: string;
30
+ /** Temporary text that occupies the select input when no option has been selected. */
31
+ placeholder?: string;
32
+ /** Defaults to `medium` */
33
+ size?: "small" | "medium";
34
+ }
35
+ /** Select displays a collapsible list of options and allows a user to select one of them. */
36
+ export default function Select<T extends object>({ items, sections, label, placeholder, size, ...props }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from "./Select";
2
+ export type { SelectProps } from "./Select";
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { ListBoxItemProps } from "react-aria-components";
3
+ import "./SelectItem.css";
4
+ export interface SelectItemProps extends ListBoxItemProps {
5
+ /** Text label for the option. Provide an `id` if this is not unique. */
6
+ label: string;
7
+ /** Descriptive text that appears below the option's label */
8
+ description?: string;
9
+ /** Marks an option visually with red text to indicate danger */
10
+ isDestructive?: boolean;
11
+ /** Left icon slot */
12
+ iconLeft?: React.ReactElement;
13
+ /** Right icon slot */
14
+ iconRight?: React.ReactElement;
15
+ }
16
+ export default function SelectItem({ description, id, iconLeft, iconRight, isDestructive, label, }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from "./SelectItem";
2
+ export type { SelectItemProps } from "./SelectItem";
@@ -5,4 +5,4 @@ export interface TagProps extends ReactAriaTagProps {
5
5
  icon?: React.ReactNode;
6
6
  color?: "bc-blue" | "bc-gold" | "blue" | "dark" | "gray" | "grey" | "green" | "red" | "yellow";
7
7
  }
8
- export default function Tag({ className, color, icon, id, textValue, }: TagProps): import("react/jsx-runtime").JSX.Element;
8
+ export default function Tag({ color, icon, id, textValue }: TagProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,7 @@
1
1
  import "@bcgov/design-tokens/css/variables.css";
2
2
  export { default as Button } from "./Button";
3
+ export { default as Header, SvgBcLogo } from "./Header";
4
+ export { default as Select } from "./Select";
3
5
  export { default as Tag } from "./Tag";
4
6
  export { default as TagGroup } from "./TagGroup";
5
7
  export { default as TagList } from "./TagList";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { ButtonProps as ButtonProps$1, TagProps as TagProps$1, TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1 } from 'react-aria-components';
3
+ import { ButtonProps as ButtonProps$1, SelectProps as SelectProps$1, ListBoxItemProps as ListBoxItemProps$1, Key, TagProps as TagProps$1, TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1 } from 'react-aria-components';
4
+ import React$1 from 'react';
4
5
 
5
6
  interface ButtonProps extends ButtonProps$1 {
6
7
  size?: "small" | "medium";
@@ -10,11 +11,55 @@ interface ButtonProps extends ButtonProps$1 {
10
11
  }
11
12
  declare function Button({ size, variant, danger, isIconButton, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
12
13
 
14
+ declare function SvgBcLogo(): react_jsx_runtime.JSX.Element;
15
+ interface HeaderProps {
16
+ logoLinkElement?: React$1.ReactElement;
17
+ logoImage?: JSX.Element;
18
+ skipLinks?: React$1.ReactElement[];
19
+ title?: string;
20
+ titleElement?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p";
21
+ }
22
+ declare function Header({ children, logoLinkElement, logoImage, skipLinks, title, titleElement, }: React$1.PropsWithChildren<HeaderProps>): react_jsx_runtime.JSX.Element;
23
+
24
+ interface ListBoxItemProps extends ListBoxItemProps$1 {
25
+ /** Text label for the option. Provide an `id` if this is not unique. */
26
+ label: string;
27
+ /** Descriptive text that appears below the option's label */
28
+ description?: string;
29
+ /** Marks an option visually with red text to indicate a destructive/dangerous option */
30
+ isDestructive?: boolean;
31
+ /** Left icon slot */
32
+ iconLeft?: React$1.ReactElement;
33
+ /** Right icon slot */
34
+ iconRight?: React$1.ReactElement;
35
+ }
36
+ interface SelectionSectionProps {
37
+ id: Key;
38
+ /** Label for the section */
39
+ header?: string;
40
+ /** Flat list of options within the section */
41
+ items: ListBoxItemProps[];
42
+ }
43
+ interface SelectProps<T extends object> extends SelectProps$1<T> {
44
+ /** Use `items` for a flat list of options */
45
+ items?: ListBoxItemProps[];
46
+ /** Use `sections` for a sectioned list with `items` options in each section */
47
+ sections?: SelectionSectionProps[];
48
+ /** Text label for the Select component */
49
+ label?: string;
50
+ /** Temporary text that occupies the select input when no option has been selected. */
51
+ placeholder?: string;
52
+ /** Defaults to `medium` */
53
+ size?: "small" | "medium";
54
+ }
55
+ /** Select displays a collapsible list of options and allows a user to select one of them. */
56
+ declare function Select<T extends object>({ items, sections, label, placeholder, size, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
57
+
13
58
  interface TagProps extends TagProps$1 {
14
59
  icon?: React.ReactNode;
15
60
  color?: "bc-blue" | "bc-gold" | "blue" | "dark" | "gray" | "grey" | "green" | "red" | "yellow";
16
61
  }
17
- declare function Tag({ className, color, icon, id, textValue, }: TagProps): react_jsx_runtime.JSX.Element;
62
+ declare function Tag({ color, icon, id, textValue }: TagProps): react_jsx_runtime.JSX.Element;
18
63
 
19
64
  interface TagGroupProps extends TagGroupProps$1 {
20
65
  label?: string;
@@ -29,4 +74,4 @@ interface TagListProps<T> extends Pick<TagListProps$1<T>, "children" | "renderEm
29
74
  }
30
75
  declare function TagList<T extends object>({ items, orientation, renderEmptyState, ...props }: TagListProps<T>): react_jsx_runtime.JSX.Element;
31
76
 
32
- export { Button, Tag, TagGroup, TagList };
77
+ export { Button, Header, Select, SvgBcLogo, Tag, TagGroup, TagList };
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>BC Design System React Components Vite Kitchen Sink</title>
8
+ <script type="module" crossorigin src="/assets/index-yaBoZILt.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-t1vEzjyT.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bcgov/design-system-react-components",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "rollup": "rollup -c --bundleConfigAsCjs",
@@ -18,8 +18,8 @@
18
18
  ],
19
19
  "types": "dist/index.d.ts",
20
20
  "dependencies": {
21
- "@bcgov/design-tokens": "^2.0.0",
22
- "react-aria-components": "^1.0.0-rc.0"
21
+ "@bcgov/design-tokens": "^2.0.1",
22
+ "react-aria-components": "1.1.1"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@bcgov/bc-sans": "^2.1.0",
@@ -27,35 +27,35 @@
27
27
  "react-dom": "^16.14.0 || ^17.0.0-rc.1 || ^18.0.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@react-stately/data": "^3.10.3",
30
+ "@react-stately/data": "^3.11.2",
31
31
  "@rollup/plugin-commonjs": "^25.0.7",
32
- "@rollup/plugin-json": "^6.0.1",
32
+ "@rollup/plugin-json": "^6.1.0",
33
33
  "@rollup/plugin-node-resolve": "^15.2.3",
34
- "@rollup/plugin-typescript": "^11.1.5",
35
- "@storybook/addon-essentials": "^7.6.1",
36
- "@storybook/addon-interactions": "^7.6.1",
37
- "@storybook/addon-links": "^7.6.1",
38
- "@storybook/blocks": "^7.6.1",
39
- "@storybook/react": "^7.6.1",
40
- "@storybook/react-vite": "^7.6.1",
34
+ "@rollup/plugin-typescript": "^11.1.6",
35
+ "@storybook/addon-essentials": "^8.0.0-rc.1",
36
+ "@storybook/addon-interactions": "^8.0.0-rc.1",
37
+ "@storybook/addon-links": "^8.0.0-rc.1",
38
+ "@storybook/blocks": "^8.0.0-rc.1",
39
+ "@storybook/react": "^8.0.0-rc.1",
40
+ "@storybook/react-vite": "^8.0.0-rc.1",
41
41
  "@storybook/testing-library": "^0.2.2",
42
- "@types/react": "^18.2.39",
43
- "@types/react-dom": "^18.2.17",
44
- "@typescript-eslint/eslint-plugin": "^6.13.1",
45
- "@typescript-eslint/parser": "^6.13.1",
46
- "@vitejs/plugin-react": "^4.2.0",
47
- "eslint": "^8.54.0",
42
+ "@types/react": "^18.2.64",
43
+ "@types/react-dom": "^18.2.20",
44
+ "@typescript-eslint/eslint-plugin": "^7.1.1",
45
+ "@typescript-eslint/parser": "^7.1.1",
46
+ "@vitejs/plugin-react": "^4.2.1",
47
+ "eslint": "^8.57.0",
48
48
  "eslint-plugin-react-hooks": "^4.6.0",
49
- "eslint-plugin-react-refresh": "^0.4.3",
50
- "eslint-plugin-storybook": "^0.6.15",
51
- "rollup": "^4.6.0",
49
+ "eslint-plugin-react-refresh": "^0.4.5",
50
+ "eslint-plugin-storybook": "^0.8.0",
51
+ "rollup": "^4.12.1",
52
52
  "rollup-plugin-dts": "^6.1.0",
53
53
  "rollup-plugin-peer-deps-external": "^2.2.4",
54
54
  "rollup-plugin-postcss": "^4.0.2",
55
- "storybook": "^7.6.1",
55
+ "storybook": "^8.0.0-rc.1",
56
56
  "tslib": "^2.6.2",
57
- "typescript": "^5.3.2",
58
- "vite": "^5.0.4"
57
+ "typescript": "^5.4.2",
58
+ "vite": "^5.1.5"
59
59
  },
60
60
  "author": "Tyler Krys <Tyler.Krys@gov.bc.ca>",
61
61
  "license": "Apache-2.0",