@bcgov/design-system-react-components 0.1.1-rc1 → 0.1.2
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.
- package/README.md +2 -0
- package/dist/cjs/index.cjs +272 -28
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.d.ts +3 -0
- package/dist/cjs/types/components/Icons/SvgCheckCircleIcon/index.d.ts +1 -0
- package/dist/cjs/types/components/Icons/SvgCloseIcon/SvgCloseIcon.d.ts +3 -0
- package/dist/cjs/types/components/Icons/SvgCloseIcon/index.d.ts +1 -0
- package/dist/cjs/types/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.d.ts +3 -0
- package/dist/cjs/types/components/Icons/SvgExclamationCircleIcon/index.d.ts +1 -0
- package/dist/cjs/types/components/Icons/SvgInfoIcon/SvgInfoIcon.d.ts +3 -0
- package/dist/cjs/types/components/Icons/SvgInfoIcon/index.d.ts +1 -0
- package/dist/cjs/types/components/InlineAlert/InlineAlert.d.ts +12 -0
- package/dist/cjs/types/components/InlineAlert/index.d.ts +2 -0
- package/dist/cjs/types/components/Select/Select.d.ts +4 -1
- package/dist/cjs/types/components/Switch/Switch.d.ts +7 -0
- package/dist/cjs/types/components/Switch/index.d.ts +2 -0
- package/dist/cjs/types/components/index.d.ts +8 -1
- package/dist/esm/index.js +267 -30
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.d.ts +3 -0
- package/dist/esm/types/components/Icons/SvgCheckCircleIcon/index.d.ts +1 -0
- package/dist/esm/types/components/Icons/SvgCloseIcon/SvgCloseIcon.d.ts +3 -0
- package/dist/esm/types/components/Icons/SvgCloseIcon/index.d.ts +1 -0
- package/dist/esm/types/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.d.ts +3 -0
- package/dist/esm/types/components/Icons/SvgExclamationCircleIcon/index.d.ts +1 -0
- package/dist/esm/types/components/Icons/SvgInfoIcon/SvgInfoIcon.d.ts +3 -0
- package/dist/esm/types/components/Icons/SvgInfoIcon/index.d.ts +1 -0
- package/dist/esm/types/components/InlineAlert/InlineAlert.d.ts +12 -0
- package/dist/esm/types/components/InlineAlert/index.d.ts +2 -0
- package/dist/esm/types/components/Select/Select.d.ts +4 -1
- package/dist/esm/types/components/Switch/Switch.d.ts +7 -0
- package/dist/esm/types/components/Switch/index.d.ts +2 -0
- package/dist/esm/types/components/index.d.ts +8 -1
- package/dist/index.d.ts +44 -4
- package/package.json +1 -1
- /package/dist/cjs/types/components/{SvgBcLogo → Icons/SvgBcLogo}/SvgBcLogo.d.ts +0 -0
- /package/dist/cjs/types/components/{SvgBcLogo → Icons/SvgBcLogo}/index.d.ts +0 -0
- /package/dist/cjs/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/SvgExclamationIcon.d.ts +0 -0
- /package/dist/cjs/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/index.d.ts +0 -0
- /package/dist/esm/types/components/{SvgBcLogo → Icons/SvgBcLogo}/SvgBcLogo.d.ts +0 -0
- /package/dist/esm/types/components/{SvgBcLogo → Icons/SvgBcLogo}/index.d.ts +0 -0
- /package/dist/esm/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/SvgExclamationIcon.d.ts +0 -0
- /package/dist/esm/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./SvgCheckCircleIcon";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./SvgCloseIcon";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./SvgExclamationCircleIcon";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./SvgInfoIcon";
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
isCloseable?: boolean;
|
|
8
|
+
isIconHidden?: boolean;
|
|
9
|
+
role?: React.AriaRole | undefined;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export default function InlineAlert({ variant, title, description, isIconHidden, isCloseable, role, children, onClose, ...props }: InlineAlertProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import "@bcgov/design-tokens/css/variables.css";
|
|
2
|
+
export { default as InlineAlert } from "./InlineAlert";
|
|
2
3
|
export { default as Button } from "./Button";
|
|
3
4
|
export { default as Header } from "./Header";
|
|
4
5
|
export { default as Footer, FooterLinks } from "./Footer";
|
|
5
6
|
export { default as Form } from "./Form";
|
|
6
7
|
export { default as Select } from "./Select";
|
|
7
|
-
export { default as SvgBcLogo } from "./SvgBcLogo";
|
|
8
|
+
export { default as SvgBcLogo } from "./Icons/SvgBcLogo";
|
|
9
|
+
export { default as SvgCheckCircleIcon } from "./Icons/SvgCheckCircleIcon";
|
|
10
|
+
export { default as SvgExclamationIcon } from "./Icons/SvgExclamationIcon";
|
|
11
|
+
export { default as SvgExclamationCircleIcon } from "./Icons/SvgExclamationCircleIcon";
|
|
12
|
+
export { default as SvgCloseIcon } from "./Icons/SvgCloseIcon";
|
|
13
|
+
export { default as SvgInfoIcon } from "./Icons/SvgInfoIcon";
|
|
8
14
|
export { default as Tag } from "./Tag";
|
|
9
15
|
export { default as TagGroup } from "./TagGroup";
|
|
10
16
|
export { default as TagList } from "./TagList";
|
|
11
17
|
export { default as TextArea } from "./TextArea";
|
|
12
18
|
export { default as TextField } from "./TextField";
|
|
19
|
+
export { default as Switch } from "./Switch";
|
|
13
20
|
export { default as Tooltip, TooltipTrigger } from "./Tooltip";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
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
|
+
isCloseable?: boolean;
|
|
11
|
+
isIconHidden?: boolean;
|
|
12
|
+
role?: React$1.AriaRole | undefined;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare function InlineAlert({ variant, title, description, isIconHidden, isCloseable, role, children, onClose, ...props }: InlineAlertProps): react_jsx_runtime.JSX.Element;
|
|
5
16
|
|
|
6
17
|
interface ButtonProps extends ButtonProps$1 {
|
|
7
18
|
/**
|
|
@@ -147,15 +158,38 @@ interface SelectProps<T extends object> extends SelectProps$1<T> {
|
|
|
147
158
|
placeholder?: string;
|
|
148
159
|
/** Defaults to `medium` */
|
|
149
160
|
size?: "small" | "medium";
|
|
161
|
+
/** Description or helper text that renders below the select input */
|
|
162
|
+
description?: string;
|
|
163
|
+
/** Used for data validation and error handling */
|
|
150
164
|
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
151
165
|
}
|
|
152
166
|
/** 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;
|
|
167
|
+
declare function Select<T extends object>({ items, sections, label, description, placeholder, size, errorMessage, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
154
168
|
|
|
155
169
|
declare function SvgBcLogo({ id }: {
|
|
156
170
|
id?: string | undefined;
|
|
157
171
|
}): react_jsx_runtime.JSX.Element;
|
|
158
172
|
|
|
173
|
+
declare function SvgCheckCircleIcon({ id }: {
|
|
174
|
+
id?: string | undefined;
|
|
175
|
+
}): react_jsx_runtime.JSX.Element;
|
|
176
|
+
|
|
177
|
+
declare function SvgExclamationIcon({ id }: {
|
|
178
|
+
id?: string | undefined;
|
|
179
|
+
}): react_jsx_runtime.JSX.Element;
|
|
180
|
+
|
|
181
|
+
declare function SvgExclamationCircleIcon({ id, }: {
|
|
182
|
+
id?: string | undefined;
|
|
183
|
+
}): react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
declare function SvgCloseIcon({ id }: {
|
|
186
|
+
id?: string | undefined;
|
|
187
|
+
}): react_jsx_runtime.JSX.Element;
|
|
188
|
+
|
|
189
|
+
declare function SvgInfoIcon({ id }: {
|
|
190
|
+
id?: string | undefined;
|
|
191
|
+
}): react_jsx_runtime.JSX.Element;
|
|
192
|
+
|
|
159
193
|
interface TagProps extends TagProps$1 {
|
|
160
194
|
/**
|
|
161
195
|
* Icon that appears to the left of the `textValue` field
|
|
@@ -210,6 +244,12 @@ interface TextFieldProps extends TextFieldProps$1 {
|
|
|
210
244
|
}
|
|
211
245
|
declare function TextField({ size, label, description, errorMessage, iconLeft, iconRight, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
212
246
|
|
|
247
|
+
interface SwitchProps extends SwitchProps$1 {
|
|
248
|
+
children?: React.ReactNode;
|
|
249
|
+
labelPosition?: "left" | "right";
|
|
250
|
+
}
|
|
251
|
+
declare function Switch({ labelPosition, children, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
252
|
+
|
|
213
253
|
declare function Tooltip(props: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
214
254
|
|
|
215
|
-
export { Button, Footer, FooterLinks, Form, Header, Select, SvgBcLogo, Tag, TagGroup, TagList, TextArea, TextField, Tooltip };
|
|
255
|
+
export { Button, Footer, FooterLinks, Form, Header, InlineAlert, Select, SvgBcLogo, SvgCheckCircleIcon, SvgCloseIcon, SvgExclamationCircleIcon, SvgExclamationIcon, SvgInfoIcon, Switch, Tag, TagGroup, TagList, TextArea, TextField, Tooltip };
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/cjs/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/esm/types/components/{SvgExclamationIcon → Icons/SvgExclamationIcon}/index.d.ts
RENAMED
|
File without changes
|