@bcgov/design-system-react-components 0.1.1 → 0.1.2-rc1

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 (47) hide show
  1. package/README.md +3 -0
  2. package/dist/cjs/index.cjs +280 -28
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/types/components/ButtonGroup/ButtonGroup.d.ts +7 -0
  5. package/dist/cjs/types/components/ButtonGroup/index.d.ts +2 -0
  6. package/dist/cjs/types/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.d.ts +3 -0
  7. package/dist/cjs/types/components/Icons/SvgCheckCircleIcon/index.d.ts +1 -0
  8. package/dist/cjs/types/components/Icons/SvgCloseIcon/SvgCloseIcon.d.ts +3 -0
  9. package/dist/cjs/types/components/Icons/SvgCloseIcon/index.d.ts +1 -0
  10. package/dist/cjs/types/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.d.ts +3 -0
  11. package/dist/cjs/types/components/Icons/SvgExclamationCircleIcon/index.d.ts +1 -0
  12. package/dist/cjs/types/components/Icons/SvgInfoIcon/SvgInfoIcon.d.ts +3 -0
  13. package/dist/cjs/types/components/Icons/SvgInfoIcon/index.d.ts +1 -0
  14. package/dist/cjs/types/components/InlineAlert/InlineAlert.d.ts +13 -0
  15. package/dist/cjs/types/components/InlineAlert/index.d.ts +2 -0
  16. package/dist/cjs/types/components/Select/Select.d.ts +4 -1
  17. package/dist/cjs/types/components/Switch/Switch.d.ts +7 -0
  18. package/dist/cjs/types/components/Switch/index.d.ts +2 -0
  19. package/dist/cjs/types/components/index.d.ts +9 -1
  20. package/dist/esm/index.js +274 -30
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/types/components/ButtonGroup/ButtonGroup.d.ts +7 -0
  23. package/dist/esm/types/components/ButtonGroup/index.d.ts +2 -0
  24. package/dist/esm/types/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.d.ts +3 -0
  25. package/dist/esm/types/components/Icons/SvgCheckCircleIcon/index.d.ts +1 -0
  26. package/dist/esm/types/components/Icons/SvgCloseIcon/SvgCloseIcon.d.ts +3 -0
  27. package/dist/esm/types/components/Icons/SvgCloseIcon/index.d.ts +1 -0
  28. package/dist/esm/types/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.d.ts +3 -0
  29. package/dist/esm/types/components/Icons/SvgExclamationCircleIcon/index.d.ts +1 -0
  30. package/dist/esm/types/components/Icons/SvgInfoIcon/SvgInfoIcon.d.ts +3 -0
  31. package/dist/esm/types/components/Icons/SvgInfoIcon/index.d.ts +1 -0
  32. package/dist/esm/types/components/InlineAlert/InlineAlert.d.ts +13 -0
  33. package/dist/esm/types/components/InlineAlert/index.d.ts +2 -0
  34. package/dist/esm/types/components/Select/Select.d.ts +4 -1
  35. package/dist/esm/types/components/Switch/Switch.d.ts +7 -0
  36. package/dist/esm/types/components/Switch/index.d.ts +2 -0
  37. package/dist/esm/types/components/index.d.ts +9 -1
  38. package/dist/index.d.ts +52 -4
  39. package/package.json +1 -1
  40. /package/dist/cjs/types/components/{SvgBcLogo → Icons/SvgBcLogo}/SvgBcLogo.d.ts +0 -0
  41. /package/dist/cjs/types/components/{SvgBcLogo → Icons/SvgBcLogo}/index.d.ts +0 -0
  42. /package/dist/cjs/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/SvgExclamationIcon.d.ts +0 -0
  43. /package/dist/cjs/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/index.d.ts +0 -0
  44. /package/dist/esm/types/components/{SvgBcLogo → Icons/SvgBcLogo}/SvgBcLogo.d.ts +0 -0
  45. /package/dist/esm/types/components/{SvgBcLogo → Icons/SvgBcLogo}/index.d.ts +0 -0
  46. /package/dist/esm/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/SvgExclamationIcon.d.ts +0 -0
  47. /package/dist/esm/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/index.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ import "./ButtonGroup.css";
2
+ export interface ButtonGroupProps extends React.PropsWithChildren {
3
+ orientation?: "horizontal" | "vertical";
4
+ alignment?: "start" | "center" | "end";
5
+ ariaLabel?: string | undefined;
6
+ }
7
+ export default function ButtonGroup({ orientation, alignment, ariaLabel, children, ...props }: ButtonGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from "./ButtonGroup";
2
+ export type { ButtonGroupProps } from "./ButtonGroup";
@@ -0,0 +1,3 @@
1
+ export default function SvgCheckCircleIcon({ id }: {
2
+ id?: string | undefined;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from "./SvgCheckCircleIcon";
@@ -0,0 +1,3 @@
1
+ export default function SvgCloseIcon({ id }: {
2
+ id?: string | undefined;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from "./SvgCloseIcon";
@@ -0,0 +1,3 @@
1
+ export default function SvgExclamationCircleIcon({ id, }: {
2
+ id?: string | undefined;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from "./SvgExclamationCircleIcon";
@@ -0,0 +1,3 @@
1
+ export default function SvgInfoIcon({ id }: {
2
+ id?: string | undefined;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from "./SvgInfoIcon";
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import "./InlineAlert.css";
3
+ export interface InlineAlertProps extends React.PropsWithChildren {
4
+ variant?: "info" | "success" | "warning" | "danger";
5
+ title?: string;
6
+ description?: string;
7
+ buttons?: React.ReactNode;
8
+ isCloseable?: boolean;
9
+ isIconHidden?: boolean;
10
+ role?: React.AriaRole | undefined;
11
+ onClose?: () => void;
12
+ }
13
+ export default function InlineAlert({ variant, title, description, isIconHidden, isCloseable, role, buttons, children, onClose, ...props }: InlineAlertProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from "./InlineAlert";
2
+ export type { InlineAlertProps } from "./InlineAlert";
@@ -31,7 +31,10 @@ export interface SelectProps<T extends object> extends ReactAriaSelectProps<T> {
31
31
  placeholder?: string;
32
32
  /** Defaults to `medium` */
33
33
  size?: "small" | "medium";
34
+ /** Description or helper text that renders below the select input */
35
+ description?: string;
36
+ /** Used for data validation and error handling */
34
37
  errorMessage?: string | ((validation: ValidationResult) => string);
35
38
  }
36
39
  /** Select displays a collapsible list of options and allows a user to select one of them. */
37
- export default function Select<T extends object>({ items, sections, label, placeholder, size, errorMessage, ...props }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
40
+ export default function Select<T extends object>({ items, sections, label, description, placeholder, size, errorMessage, ...props }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { SwitchProps as ReactAriaSwitchProps } from "react-aria-components";
2
+ import "./Switch.css";
3
+ export interface SwitchProps extends ReactAriaSwitchProps {
4
+ children?: React.ReactNode;
5
+ labelPosition?: "left" | "right";
6
+ }
7
+ export default function Switch({ labelPosition, children, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from "./Switch";
2
+ export type { SwitchProps } from "./Switch";
@@ -1,13 +1,21 @@
1
1
  import "@bcgov/design-tokens/css/variables.css";
2
+ export { default as InlineAlert } from "./InlineAlert";
2
3
  export { default as Button } from "./Button";
4
+ export { default as ButtonGroup } from "./ButtonGroup";
3
5
  export { default as Header } from "./Header";
4
6
  export { default as Footer, FooterLinks } from "./Footer";
5
7
  export { default as Form } from "./Form";
6
8
  export { default as Select } from "./Select";
7
- export { default as SvgBcLogo } from "./SvgBcLogo";
9
+ export { default as SvgBcLogo } from "./Icons/SvgBcLogo";
10
+ export { default as SvgCheckCircleIcon } from "./Icons/SvgCheckCircleIcon";
11
+ export { default as SvgExclamationIcon } from "./Icons/SvgExclamationIcon";
12
+ export { default as SvgExclamationCircleIcon } from "./Icons/SvgExclamationCircleIcon";
13
+ export { default as SvgCloseIcon } from "./Icons/SvgCloseIcon";
14
+ export { default as SvgInfoIcon } from "./Icons/SvgInfoIcon";
8
15
  export { default as Tag } from "./Tag";
9
16
  export { default as TagGroup } from "./TagGroup";
10
17
  export { default as TagList } from "./TagList";
11
18
  export { default as TextArea } from "./TextArea";
12
19
  export { default as TextField } from "./TextField";
20
+ export { default as Switch } from "./Switch";
13
21
  export { default as Tooltip, TooltipTrigger } from "./Tooltip";
package/dist/index.d.ts CHANGED
@@ -1,7 +1,19 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ButtonProps as ButtonProps$1, FormProps as FormProps$1, SelectProps as SelectProps$1, ValidationResult, ListBoxItemProps as ListBoxItemProps$1, Key, TagProps as TagProps$1, TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1, TextFieldProps as TextFieldProps$1, TooltipProps } from 'react-aria-components';
3
- export { TooltipTrigger } from 'react-aria-components';
4
2
  import React$1 from 'react';
3
+ import { ButtonProps as ButtonProps$1, FormProps as FormProps$1, SelectProps as SelectProps$1, ValidationResult, ListBoxItemProps as ListBoxItemProps$1, Key, TagProps as TagProps$1, TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1, TextFieldProps as TextFieldProps$1, SwitchProps as SwitchProps$1, TooltipProps } from 'react-aria-components';
4
+ export { TooltipTrigger } from 'react-aria-components';
5
+
6
+ interface InlineAlertProps extends React$1.PropsWithChildren {
7
+ variant?: "info" | "success" | "warning" | "danger";
8
+ title?: string;
9
+ description?: string;
10
+ buttons?: React$1.ReactNode;
11
+ isCloseable?: boolean;
12
+ isIconHidden?: boolean;
13
+ role?: React$1.AriaRole | undefined;
14
+ onClose?: () => void;
15
+ }
16
+ declare function InlineAlert({ variant, title, description, isIconHidden, isCloseable, role, buttons, children, onClose, ...props }: InlineAlertProps): react_jsx_runtime.JSX.Element;
5
17
 
6
18
  interface ButtonProps extends ButtonProps$1 {
7
19
  /**
@@ -23,6 +35,13 @@ interface ButtonProps extends ButtonProps$1 {
23
35
  }
24
36
  declare function Button({ size, variant, danger, isIconButton, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
25
37
 
38
+ interface ButtonGroupProps extends React.PropsWithChildren {
39
+ orientation?: "horizontal" | "vertical";
40
+ alignment?: "start" | "center" | "end";
41
+ ariaLabel?: string | undefined;
42
+ }
43
+ declare function ButtonGroup({ orientation, alignment, ariaLabel, children, ...props }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
44
+
26
45
  interface HeaderProps {
27
46
  /**
28
47
  * Link element that surrounds the logo. Use what's appropriate for your
@@ -147,15 +166,38 @@ interface SelectProps<T extends object> extends SelectProps$1<T> {
147
166
  placeholder?: string;
148
167
  /** Defaults to `medium` */
149
168
  size?: "small" | "medium";
169
+ /** Description or helper text that renders below the select input */
170
+ description?: string;
171
+ /** Used for data validation and error handling */
150
172
  errorMessage?: string | ((validation: ValidationResult) => string);
151
173
  }
152
174
  /** Select displays a collapsible list of options and allows a user to select one of them. */
153
- declare function Select<T extends object>({ items, sections, label, placeholder, size, errorMessage, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
175
+ declare function Select<T extends object>({ items, sections, label, description, placeholder, size, errorMessage, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
154
176
 
155
177
  declare function SvgBcLogo({ id }: {
156
178
  id?: string | undefined;
157
179
  }): react_jsx_runtime.JSX.Element;
158
180
 
181
+ declare function SvgCheckCircleIcon({ id }: {
182
+ id?: string | undefined;
183
+ }): react_jsx_runtime.JSX.Element;
184
+
185
+ declare function SvgExclamationIcon({ id }: {
186
+ id?: string | undefined;
187
+ }): react_jsx_runtime.JSX.Element;
188
+
189
+ declare function SvgExclamationCircleIcon({ id, }: {
190
+ id?: string | undefined;
191
+ }): react_jsx_runtime.JSX.Element;
192
+
193
+ declare function SvgCloseIcon({ id }: {
194
+ id?: string | undefined;
195
+ }): react_jsx_runtime.JSX.Element;
196
+
197
+ declare function SvgInfoIcon({ id }: {
198
+ id?: string | undefined;
199
+ }): react_jsx_runtime.JSX.Element;
200
+
159
201
  interface TagProps extends TagProps$1 {
160
202
  /**
161
203
  * Icon that appears to the left of the `textValue` field
@@ -210,6 +252,12 @@ interface TextFieldProps extends TextFieldProps$1 {
210
252
  }
211
253
  declare function TextField({ size, label, description, errorMessage, iconLeft, iconRight, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
212
254
 
255
+ interface SwitchProps extends SwitchProps$1 {
256
+ children?: React.ReactNode;
257
+ labelPosition?: "left" | "right";
258
+ }
259
+ declare function Switch({ labelPosition, children, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
260
+
213
261
  declare function Tooltip(props: TooltipProps): react_jsx_runtime.JSX.Element;
214
262
 
215
- export { Button, Footer, FooterLinks, Form, Header, Select, SvgBcLogo, Tag, TagGroup, TagList, TextArea, TextField, Tooltip };
263
+ export { Button, ButtonGroup, Footer, FooterLinks, Form, Header, InlineAlert, Select, SvgBcLogo, SvgCheckCircleIcon, SvgCloseIcon, SvgExclamationCircleIcon, SvgExclamationIcon, SvgInfoIcon, Switch, Tag, TagGroup, TagList, TextArea, TextField, Tooltip };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bcgov/design-system-react-components",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-rc1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "rollup": "rm -rf dist && rollup -c --bundleConfigAsCjs",