@bcgov/design-system-react-components 0.0.3 → 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.
@@ -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";
@@ -6,7 +6,7 @@ export interface ListBoxItemProps extends ReactAriaListBoxItemProps {
6
6
  label: string;
7
7
  /** Descriptive text that appears below the option's label */
8
8
  description?: string;
9
- /** Marks an option visually with red text to indicate danger */
9
+ /** Marks an option visually with red text to indicate a destructive/dangerous option */
10
10
  isDestructive?: boolean;
11
11
  /** Left icon slot */
12
12
  iconLeft?: React.ReactElement;
@@ -14,17 +14,23 @@ export interface ListBoxItemProps extends ReactAriaListBoxItemProps {
14
14
  iconRight?: React.ReactElement;
15
15
  }
16
16
  export interface SelectionSectionProps {
17
- /** Display name for the section */
18
17
  id: Key;
18
+ /** Label for the section */
19
19
  header?: string;
20
+ /** Flat list of options within the section */
20
21
  items: ListBoxItemProps[];
21
22
  }
22
23
  export interface SelectProps<T extends object> extends ReactAriaSelectProps<T> {
24
+ /** Use `items` for a flat list of options */
23
25
  items?: ListBoxItemProps[];
26
+ /** Use `sections` for a sectioned list with `items` options in each section */
24
27
  sections?: SelectionSectionProps[];
25
28
  /** Text label for the Select component */
26
29
  label?: string;
30
+ /** Temporary text that occupies the select input when no option has been selected. */
31
+ placeholder?: string;
27
32
  /** Defaults to `medium` */
28
33
  size?: "small" | "medium";
29
34
  }
30
- export default function Select<T extends object>({ items, sections, label, size, ...props }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
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;
@@ -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,7 +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";
3
4
  export { default as Select } from "./Select";
4
- export { default as SelectItem } from "./SelectItem";
5
5
  export { default as Tag } from "./Tag";
6
6
  export { default as TagGroup } from "./TagGroup";
7
7
  export { default as TagList } from "./TagList";
package/dist/index.d.ts CHANGED
@@ -11,12 +11,22 @@ interface ButtonProps extends ButtonProps$1 {
11
11
  }
12
12
  declare function Button({ size, variant, danger, isIconButton, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
13
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
+
14
24
  interface ListBoxItemProps extends ListBoxItemProps$1 {
15
25
  /** Text label for the option. Provide an `id` if this is not unique. */
16
26
  label: string;
17
27
  /** Descriptive text that appears below the option's label */
18
28
  description?: string;
19
- /** Marks an option visually with red text to indicate danger */
29
+ /** Marks an option visually with red text to indicate a destructive/dangerous option */
20
30
  isDestructive?: boolean;
21
31
  /** Left icon slot */
22
32
  iconLeft?: React$1.ReactElement;
@@ -24,40 +34,32 @@ interface ListBoxItemProps extends ListBoxItemProps$1 {
24
34
  iconRight?: React$1.ReactElement;
25
35
  }
26
36
  interface SelectionSectionProps {
27
- /** Display name for the section */
28
37
  id: Key;
38
+ /** Label for the section */
29
39
  header?: string;
40
+ /** Flat list of options within the section */
30
41
  items: ListBoxItemProps[];
31
42
  }
32
43
  interface SelectProps<T extends object> extends SelectProps$1<T> {
44
+ /** Use `items` for a flat list of options */
33
45
  items?: ListBoxItemProps[];
46
+ /** Use `sections` for a sectioned list with `items` options in each section */
34
47
  sections?: SelectionSectionProps[];
35
48
  /** Text label for the Select component */
36
49
  label?: string;
50
+ /** Temporary text that occupies the select input when no option has been selected. */
51
+ placeholder?: string;
37
52
  /** Defaults to `medium` */
38
53
  size?: "small" | "medium";
39
54
  }
40
- declare function Select<T extends object>({ items, sections, label, size, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
41
-
42
- interface SelectItemProps extends ListBoxItemProps$1 {
43
- /** Text label for the option. Provide an `id` if this is not unique. */
44
- label: string;
45
- /** Descriptive text that appears below the option's label */
46
- description?: string;
47
- /** Marks an option visually with red text to indicate danger */
48
- isDestructive?: boolean;
49
- /** Left icon slot */
50
- iconLeft?: React$1.ReactElement;
51
- /** Right icon slot */
52
- iconRight?: React$1.ReactElement;
53
- }
54
- declare function SelectItem({ description, id, iconLeft, iconRight, isDestructive, label, }: SelectItemProps): react_jsx_runtime.JSX.Element;
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;
55
57
 
56
58
  interface TagProps extends TagProps$1 {
57
59
  icon?: React.ReactNode;
58
60
  color?: "bc-blue" | "bc-gold" | "blue" | "dark" | "gray" | "grey" | "green" | "red" | "yellow";
59
61
  }
60
- 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;
61
63
 
62
64
  interface TagGroupProps extends TagGroupProps$1 {
63
65
  label?: string;
@@ -72,4 +74,4 @@ interface TagListProps<T> extends Pick<TagListProps$1<T>, "children" | "renderEm
72
74
  }
73
75
  declare function TagList<T extends object>({ items, orientation, renderEmptyState, ...props }: TagListProps<T>): react_jsx_runtime.JSX.Element;
74
76
 
75
- export { Button, Select, SelectItem, Tag, TagGroup, TagList };
77
+ export { Button, 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.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "rollup": "rollup -c --bundleConfigAsCjs",
@@ -19,7 +19,7 @@
19
19
  "types": "dist/index.d.ts",
20
20
  "dependencies": {
21
21
  "@bcgov/design-tokens": "^2.0.1",
22
- "react-aria-components": "1.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
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-alpha.17",
36
- "@storybook/addon-interactions": "^8.0.0-alpha.17",
37
- "@storybook/addon-links": "^8.0.0-alpha.17",
38
- "@storybook/blocks": "^8.0.0-alpha.17",
39
- "@storybook/react": "^8.0.0-alpha.17",
40
- "@storybook/react-vite": "^8.0.0-alpha.17",
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.51",
43
- "@types/react-dom": "^18.2.18",
44
- "@typescript-eslint/eslint-plugin": "^6.20.0",
45
- "@typescript-eslint/parser": "^6.20.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
46
  "@vitejs/plugin-react": "^4.2.1",
47
- "eslint": "^8.56.0",
47
+ "eslint": "^8.57.0",
48
48
  "eslint-plugin-react-hooks": "^4.6.0",
49
49
  "eslint-plugin-react-refresh": "^0.4.5",
50
- "eslint-plugin-storybook": "^0.6.15",
51
- "rollup": "^4.9.6",
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": "^8.0.0-alpha.17",
55
+ "storybook": "^8.0.0-rc.1",
56
56
  "tslib": "^2.6.2",
57
- "typescript": "^5.3.3",
58
- "vite": "^5.0.12"
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",