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

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 (53) hide show
  1. package/README.md +10 -6
  2. package/dist/cjs/index.cjs +559 -18
  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 +63 -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/Tooltip/Tooltip.d.ts +5 -0
  15. package/dist/cjs/types/components/Tooltip/index.d.ts +2 -0
  16. package/dist/cjs/types/components/index.d.ts +4 -1
  17. package/dist/esm/index.js +556 -19
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/types/components/Button/Button.d.ts +12 -0
  20. package/dist/esm/types/components/Footer/Footer.d.ts +63 -0
  21. package/dist/esm/types/components/Footer/index.d.ts +2 -0
  22. package/dist/esm/types/components/Header/Header.d.ts +19 -1
  23. package/dist/esm/types/components/Header/index.d.ts +1 -1
  24. package/dist/esm/types/components/SvgBcLogo/SvgBcLogo.d.ts +3 -0
  25. package/dist/esm/types/components/SvgBcLogo/index.d.ts +1 -0
  26. package/dist/esm/types/components/Tag/Tag.d.ts +6 -0
  27. package/dist/esm/types/components/TagGroup/TagGroup.d.ts +9 -0
  28. package/dist/esm/types/components/TagList/TagList.d.ts +3 -0
  29. package/dist/esm/types/components/Tooltip/Tooltip.d.ts +5 -0
  30. package/dist/esm/types/components/Tooltip/index.d.ts +2 -0
  31. package/dist/esm/types/components/index.d.ts +4 -1
  32. package/dist/index.d.ts +120 -3
  33. package/package.json +18 -17
  34. package/dist/assets/BCSans-Bold-ZqE3sZik.woff +0 -0
  35. package/dist/assets/BCSans-Bold-onJZunl0.woff2 +0 -0
  36. package/dist/assets/BCSans-BoldItalic-4P_OlA2s.woff +0 -0
  37. package/dist/assets/BCSans-BoldItalic-GxGpSOWy.woff2 +0 -0
  38. package/dist/assets/BCSans-Italic-Pz_cGW4F.woff2 +0 -0
  39. package/dist/assets/BCSans-Italic-UhTyhoET.woff +0 -0
  40. package/dist/assets/BCSans-Light-A03rbYd1.woff2 +0 -0
  41. package/dist/assets/BCSans-Light-playkmYo.woff +0 -0
  42. package/dist/assets/BCSans-LightItalic-HTeW1g69.woff2 +0 -0
  43. package/dist/assets/BCSans-LightItalic-tgMWPWlK.woff +0 -0
  44. package/dist/assets/BCSans-Regular-jMf6NRx3.woff +0 -0
  45. package/dist/assets/BCSans-Regular-ysGfRp0T.woff2 +0 -0
  46. package/dist/assets/index-t1vEzjyT.css +0 -1
  47. package/dist/assets/index-yaBoZILt.js +0 -48
  48. package/dist/cjs/types/components/SelectItem/SelectItem.d.ts +0 -16
  49. package/dist/cjs/types/components/SelectItem/index.d.ts +0 -2
  50. package/dist/esm/types/components/SelectItem/SelectItem.d.ts +0 -16
  51. package/dist/esm/types/components/SelectItem/index.d.ts +0 -2
  52. package/dist/index.html +0 -14
  53. package/dist/vite.svg +0 -1
@@ -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,63 @@
1
+ import React from "react";
2
+ import "./Footer.css";
3
+ export interface FooterLinksProps {
4
+ /**
5
+ * Title for the list of links - associated to the list of links as a `<figcaption>`
6
+ */
7
+ title: string;
8
+ /**
9
+ * Array of link elements (`<a>` or `<Link>`)
10
+ */
11
+ links: React.ReactElement[];
12
+ }
13
+ /**
14
+ * A titled list of links for use in the Footer. Rendered inside a `<figure>`
15
+ * with the `title` prop inside of the `<figcaption>`.
16
+ * @param {FooterLinksProps} props
17
+ * @returns {React.ReactElement}
18
+ */
19
+ export declare function FooterLinks({ title, links }: FooterLinksProps): import("react/jsx-runtime").JSX.Element;
20
+ export interface FooterProps {
21
+ /**
22
+ * Land acknowledgement block (defaults to Gov.bc.ca land acknowledgement)
23
+ */
24
+ acknowledgement?: React.ReactElement;
25
+ /**
26
+ * Logo slot (defaults to BC Gov horizontal logo)
27
+ */
28
+ logo?: React.ReactElement;
29
+ /**
30
+ * Contact information block (defaults to Gov.bc.ca contact information)
31
+ */
32
+ contact?: React.ReactElement;
33
+ /**
34
+ * Link list block (defaults to Gov.bc.ca link list).
35
+ *
36
+ * Pass the `<FooterLinks>` component for a styles-included list.
37
+ */
38
+ links?: React.ReactElement;
39
+ /**
40
+ * Copyright string (defaults to current year)
41
+ */
42
+ copyright?: string;
43
+ /**
44
+ * Hide the acknowledgement section
45
+ */
46
+ hideAcknowledgement?: boolean;
47
+ /**
48
+ * Hide the logo, contact information, and links section
49
+ */
50
+ hideLogoAndLinks?: boolean;
51
+ /**
52
+ * Hide the copyright string
53
+ */
54
+ hideCopyright?: boolean;
55
+ }
56
+ /**
57
+ * A `<footer>` element with default content included.
58
+ *
59
+ * Passing `children` replaces `logo`, `contact`, and `links`.
60
+ * @param {FooterProps} props
61
+ * @returns {React.ReactElement}
62
+ */
63
+ export default function Footer({ children, acknowledgement, logo, contact, links, copyright, hideAcknowledgement, hideLogoAndLinks, hideCopyright, }: React.PropsWithChildren<FooterProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default, FooterLinks } from "./Footer";
2
+ export type { FooterProps, FooterLinksProps } 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;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { TooltipProps, TooltipTrigger } from "react-aria-components";
3
+ import "./Tooltip.css";
4
+ export default function Tooltip({ children, placement, }: React.PropsWithChildren<TooltipProps>): import("react/jsx-runtime").JSX.Element;
5
+ export { TooltipTrigger };
@@ -0,0 +1,2 @@
1
+ export { default, TooltipTrigger } from "./Tooltip";
2
+ export type { TooltipProps } from "./Tooltip";
@@ -1,7 +1,10 @@
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, FooterLinks } 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";
10
+ export { default as Tooltip, TooltipTrigger } from "./Tooltip";