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

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 (29) hide show
  1. package/README.md +3 -0
  2. package/dist/cjs/index.cjs +37 -11
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/types/components/Button/Button.d.ts +12 -0
  5. package/dist/cjs/types/components/Footer/Footer.d.ts +37 -0
  6. package/dist/cjs/types/components/Footer/index.d.ts +2 -0
  7. package/dist/cjs/types/components/Header/Header.d.ts +19 -1
  8. package/dist/cjs/types/components/Header/index.d.ts +1 -1
  9. package/dist/cjs/types/components/SvgBcLogo/SvgBcLogo.d.ts +3 -0
  10. package/dist/cjs/types/components/SvgBcLogo/index.d.ts +1 -0
  11. package/dist/cjs/types/components/Tag/Tag.d.ts +6 -0
  12. package/dist/cjs/types/components/TagGroup/TagGroup.d.ts +9 -0
  13. package/dist/cjs/types/components/TagList/TagList.d.ts +3 -0
  14. package/dist/cjs/types/components/index.d.ts +3 -1
  15. package/dist/esm/index.js +37 -12
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/types/components/Button/Button.d.ts +12 -0
  18. package/dist/esm/types/components/Footer/Footer.d.ts +37 -0
  19. package/dist/esm/types/components/Footer/index.d.ts +2 -0
  20. package/dist/esm/types/components/Header/Header.d.ts +19 -1
  21. package/dist/esm/types/components/Header/index.d.ts +1 -1
  22. package/dist/esm/types/components/SvgBcLogo/SvgBcLogo.d.ts +3 -0
  23. package/dist/esm/types/components/SvgBcLogo/index.d.ts +1 -0
  24. package/dist/esm/types/components/Tag/Tag.d.ts +6 -0
  25. package/dist/esm/types/components/TagGroup/TagGroup.d.ts +9 -0
  26. package/dist/esm/types/components/TagList/TagList.d.ts +3 -0
  27. package/dist/esm/types/components/index.d.ts +3 -1
  28. package/dist/index.d.ts +90 -2
  29. package/package.json +9 -9
@@ -1,9 +1,21 @@
1
1
  import { ButtonProps as ReactAriaButtonProps } from "react-aria-components";
2
2
  import "./Button.css";
3
3
  export interface ButtonProps extends ReactAriaButtonProps {
4
+ /**
5
+ * Defaults to `medium`. `small` is shorter vertically.
6
+ */
4
7
  size?: "small" | "medium";
8
+ /**
9
+ * Defaults to `primary`.
10
+ */
5
11
  variant?: "primary" | "secondary" | "tertiary" | "link";
12
+ /**
13
+ * For destructive/deletion actions.
14
+ */
6
15
  danger?: boolean;
16
+ /**
17
+ * If true, renders a square button intended for a single icon.
18
+ */
7
19
  isIconButton?: boolean;
8
20
  }
9
21
  export default function Button({ size, variant, danger, isIconButton, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ import "./Footer.css";
3
+ export interface FooterProps {
4
+ /**
5
+ * Land acknowledgement block (defaults to Gov.bc.ca land acknowledgement)
6
+ */
7
+ acknowledgement?: React.ReactElement;
8
+ /**
9
+ * Logo slot (defaults to BC Gov horizontal logo)
10
+ */
11
+ logo?: React.ReactElement;
12
+ /**
13
+ * Contact information block (defaults to Gov.bc.ca contact information)
14
+ */
15
+ contact?: React.ReactElement;
16
+ /**
17
+ * Link list block (defaults to Gov.bc.ca link list)
18
+ */
19
+ links?: React.ReactElement;
20
+ /**
21
+ * Copyright string (defaults to current year)
22
+ */
23
+ copyright?: string;
24
+ /**
25
+ * Hide the acknowledgement section
26
+ */
27
+ hideAcknowledgement?: boolean;
28
+ /**
29
+ * Hide the logo, contact information, and links section
30
+ */
31
+ hideLogoAndLinks?: boolean;
32
+ /**
33
+ * Hide the copyright string
34
+ */
35
+ hideCopyright?: boolean;
36
+ }
37
+ export default function Footer({ acknowledgement, logo, contact, links, copyright, hideAcknowledgement, hideLogoAndLinks, hideCopyright, }: FooterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from "./Footer";
2
+ export type { FooterProps } from "./Footer";
@@ -1,11 +1,29 @@
1
1
  import React from "react";
2
2
  import "./Header.css";
3
- export declare function SvgBcLogo(): import("react/jsx-runtime").JSX.Element;
4
3
  export interface HeaderProps {
4
+ /**
5
+ * Link element that surrounds the logo. Use what's appropriate for your
6
+ * router, like a `<Link>`. Defaults to a generic HTML link element like
7
+ * `<a href="/" title="Government of British Columbia">`.
8
+ */
5
9
  logoLinkElement?: React.ReactElement;
10
+ /**
11
+ * Image used for the logo. Defaults to an SVG of the Government of B.C. logo.
12
+ */
6
13
  logoImage?: JSX.Element;
14
+ /**
15
+ * Array of link elements that are not visible until they are focused. Used
16
+ * for accessibility for keyboard users, to let them easily skip to main
17
+ * content, navigation, etc.
18
+ */
7
19
  skipLinks?: React.ReactElement[];
20
+ /**
21
+ * Header title text that appears to the right of the logo.
22
+ */
8
23
  title?: string;
24
+ /**
25
+ * Desired element that renders the `title` string. Defaults to `<span>`.
26
+ */
9
27
  titleElement?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p";
10
28
  }
11
29
  export default function Header({ children, logoLinkElement, logoImage, skipLinks, title, titleElement, }: React.PropsWithChildren<HeaderProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- export { default, SvgBcLogo } from "./Header";
1
+ export { default } from "./Header";
2
2
  export type { HeaderProps } from "./Header";
@@ -0,0 +1,3 @@
1
+ export default function SvgBcLogo({ id }: {
2
+ id?: string | undefined;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from "./SvgBcLogo";
@@ -2,7 +2,13 @@
2
2
  import { TagProps as ReactAriaTagProps } from "react-aria-components";
3
3
  import "./Tag.css";
4
4
  export interface TagProps extends ReactAriaTagProps {
5
+ /**
6
+ * Icon that appears to the left of the `textValue` field
7
+ */
5
8
  icon?: React.ReactNode;
9
+ /**
10
+ * Background color
11
+ */
6
12
  color?: "bc-blue" | "bc-gold" | "blue" | "dark" | "gray" | "grey" | "green" | "red" | "yellow";
7
13
  }
8
14
  export default function Tag({ color, icon, id, textValue }: TagProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,17 @@
1
1
  import { TagGroupProps as ReactAriaTagGroupProps } from "react-aria-components";
2
2
  import "./TagGroup.css";
3
3
  export interface TagGroupProps extends ReactAriaTagGroupProps {
4
+ /**
5
+ * Labels the TagGroup, appears above the tags.
6
+ */
4
7
  label?: string;
8
+ /**
9
+ * Extended description of the TagGroup, appears below the tags.
10
+ */
5
11
  description?: string;
12
+ /**
13
+ * Error message, appears below the tags and below the optional description.
14
+ */
6
15
  errorMessage?: string;
7
16
  }
8
17
  export default function TagGroup({ children, label, description, errorMessage, ...props }: TagGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,9 @@ import { TagProps } from "../Tag";
3
3
  import "./TagList.css";
4
4
  export interface TagListProps<T> extends Pick<ReactAriaTagListProps<T>, "children" | "renderEmptyState"> {
5
5
  items: TagProps[];
6
+ /**
7
+ * Used to set the `flex-direction` on the TagList.
8
+ */
6
9
  orientation?: "horizontal" | "vertical";
7
10
  }
8
11
  export default function TagList<T extends object>({ items, orientation, renderEmptyState, ...props }: TagListProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,9 @@
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";
3
+ export { default as Header } from "./Header";
4
+ export { default as Footer } from "./Footer";
4
5
  export { default as Select } from "./Select";
6
+ export { default as SvgBcLogo } from "./SvgBcLogo";
5
7
  export { default as Tag } from "./Tag";
6
8
  export { default as TagGroup } from "./TagGroup";
7
9
  export { default as TagList } from "./TagList";
package/dist/index.d.ts CHANGED
@@ -4,23 +4,89 @@ import { ButtonProps as ButtonProps$1, SelectProps as SelectProps$1, ListBoxItem
4
4
  import React$1 from 'react';
5
5
 
6
6
  interface ButtonProps extends ButtonProps$1 {
7
+ /**
8
+ * Defaults to `medium`. `small` is shorter vertically.
9
+ */
7
10
  size?: "small" | "medium";
11
+ /**
12
+ * Defaults to `primary`.
13
+ */
8
14
  variant?: "primary" | "secondary" | "tertiary" | "link";
15
+ /**
16
+ * For destructive/deletion actions.
17
+ */
9
18
  danger?: boolean;
19
+ /**
20
+ * If true, renders a square button intended for a single icon.
21
+ */
10
22
  isIconButton?: boolean;
11
23
  }
12
24
  declare function Button({ size, variant, danger, isIconButton, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
13
25
 
14
- declare function SvgBcLogo(): react_jsx_runtime.JSX.Element;
15
26
  interface HeaderProps {
27
+ /**
28
+ * Link element that surrounds the logo. Use what's appropriate for your
29
+ * router, like a `<Link>`. Defaults to a generic HTML link element like
30
+ * `<a href="/" title="Government of British Columbia">`.
31
+ */
16
32
  logoLinkElement?: React$1.ReactElement;
33
+ /**
34
+ * Image used for the logo. Defaults to an SVG of the Government of B.C. logo.
35
+ */
17
36
  logoImage?: JSX.Element;
37
+ /**
38
+ * Array of link elements that are not visible until they are focused. Used
39
+ * for accessibility for keyboard users, to let them easily skip to main
40
+ * content, navigation, etc.
41
+ */
18
42
  skipLinks?: React$1.ReactElement[];
43
+ /**
44
+ * Header title text that appears to the right of the logo.
45
+ */
19
46
  title?: string;
47
+ /**
48
+ * Desired element that renders the `title` string. Defaults to `<span>`.
49
+ */
20
50
  titleElement?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p";
21
51
  }
22
52
  declare function Header({ children, logoLinkElement, logoImage, skipLinks, title, titleElement, }: React$1.PropsWithChildren<HeaderProps>): react_jsx_runtime.JSX.Element;
23
53
 
54
+ interface FooterProps {
55
+ /**
56
+ * Land acknowledgement block (defaults to Gov.bc.ca land acknowledgement)
57
+ */
58
+ acknowledgement?: React$1.ReactElement;
59
+ /**
60
+ * Logo slot (defaults to BC Gov horizontal logo)
61
+ */
62
+ logo?: React$1.ReactElement;
63
+ /**
64
+ * Contact information block (defaults to Gov.bc.ca contact information)
65
+ */
66
+ contact?: React$1.ReactElement;
67
+ /**
68
+ * Link list block (defaults to Gov.bc.ca link list)
69
+ */
70
+ links?: React$1.ReactElement;
71
+ /**
72
+ * Copyright string (defaults to current year)
73
+ */
74
+ copyright?: string;
75
+ /**
76
+ * Hide the acknowledgement section
77
+ */
78
+ hideAcknowledgement?: boolean;
79
+ /**
80
+ * Hide the logo, contact information, and links section
81
+ */
82
+ hideLogoAndLinks?: boolean;
83
+ /**
84
+ * Hide the copyright string
85
+ */
86
+ hideCopyright?: boolean;
87
+ }
88
+ declare function Footer({ acknowledgement, logo, contact, links, copyright, hideAcknowledgement, hideLogoAndLinks, hideCopyright, }: FooterProps): react_jsx_runtime.JSX.Element;
89
+
24
90
  interface ListBoxItemProps extends ListBoxItemProps$1 {
25
91
  /** Text label for the option. Provide an `id` if this is not unique. */
26
92
  label: string;
@@ -55,23 +121,45 @@ interface SelectProps<T extends object> extends SelectProps$1<T> {
55
121
  /** Select displays a collapsible list of options and allows a user to select one of them. */
56
122
  declare function Select<T extends object>({ items, sections, label, placeholder, size, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
57
123
 
124
+ declare function SvgBcLogo({ id }: {
125
+ id?: string | undefined;
126
+ }): react_jsx_runtime.JSX.Element;
127
+
58
128
  interface TagProps extends TagProps$1 {
129
+ /**
130
+ * Icon that appears to the left of the `textValue` field
131
+ */
59
132
  icon?: React.ReactNode;
133
+ /**
134
+ * Background color
135
+ */
60
136
  color?: "bc-blue" | "bc-gold" | "blue" | "dark" | "gray" | "grey" | "green" | "red" | "yellow";
61
137
  }
62
138
  declare function Tag({ color, icon, id, textValue }: TagProps): react_jsx_runtime.JSX.Element;
63
139
 
64
140
  interface TagGroupProps extends TagGroupProps$1 {
141
+ /**
142
+ * Labels the TagGroup, appears above the tags.
143
+ */
65
144
  label?: string;
145
+ /**
146
+ * Extended description of the TagGroup, appears below the tags.
147
+ */
66
148
  description?: string;
149
+ /**
150
+ * Error message, appears below the tags and below the optional description.
151
+ */
67
152
  errorMessage?: string;
68
153
  }
69
154
  declare function TagGroup({ children, label, description, errorMessage, ...props }: TagGroupProps): react_jsx_runtime.JSX.Element;
70
155
 
71
156
  interface TagListProps<T> extends Pick<TagListProps$1<T>, "children" | "renderEmptyState"> {
72
157
  items: TagProps[];
158
+ /**
159
+ * Used to set the `flex-direction` on the TagList.
160
+ */
73
161
  orientation?: "horizontal" | "vertical";
74
162
  }
75
163
  declare function TagList<T extends object>({ items, orientation, renderEmptyState, ...props }: TagListProps<T>): react_jsx_runtime.JSX.Element;
76
164
 
77
- export { Button, Header, Select, SvgBcLogo, Tag, TagGroup, TagList };
165
+ export { Button, Footer, Header, Select, SvgBcLogo, Tag, TagGroup, TagList };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bcgov/design-system-react-components",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "rollup": "rollup -c --bundleConfigAsCjs",
@@ -32,15 +32,15 @@
32
32
  "@rollup/plugin-json": "^6.1.0",
33
33
  "@rollup/plugin-node-resolve": "^15.2.3",
34
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",
35
+ "@storybook/addon-essentials": "^8.0.0-rc.3",
36
+ "@storybook/addon-interactions": "^8.0.0-rc.3",
37
+ "@storybook/addon-links": "^8.0.0-rc.3",
38
+ "@storybook/blocks": "^8.0.0-rc.3",
39
+ "@storybook/react": "^8.0.0-rc.3",
40
+ "@storybook/react-vite": "^8.0.0-rc.3",
41
41
  "@storybook/testing-library": "^0.2.2",
42
42
  "@types/react": "^18.2.64",
43
- "@types/react-dom": "^18.2.20",
43
+ "@types/react-dom": "^18.2.21",
44
44
  "@typescript-eslint/eslint-plugin": "^7.1.1",
45
45
  "@typescript-eslint/parser": "^7.1.1",
46
46
  "@vitejs/plugin-react": "^4.2.1",
@@ -52,7 +52,7 @@
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": "^8.0.0-rc.1",
55
+ "storybook": "^8.0.0-rc.3",
56
56
  "tslib": "^2.6.2",
57
57
  "typescript": "^5.4.2",
58
58
  "vite": "^5.1.5"