@bcgov/design-system-react-components 0.0.7 → 0.0.8-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.
- package/dist/cjs/index.cjs +322 -20
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/components/Select/Select.d.ts +3 -2
- package/dist/cjs/types/components/TextField/TextField.d.ts +12 -0
- package/dist/cjs/types/components/TextField/index.d.ts +2 -0
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/esm/index.js +322 -21
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Select/Select.d.ts +3 -2
- package/dist/esm/types/components/TextField/TextField.d.ts +12 -0
- package/dist/esm/types/components/TextField/index.d.ts +2 -0
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/index.d.ts +14 -3
- package/package.json +11 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Key, ListBoxItemProps as ReactAriaListBoxItemProps, SelectProps as ReactAriaSelectProps } from "react-aria-components";
|
|
2
|
+
import { Key, ListBoxItemProps as ReactAriaListBoxItemProps, SelectProps as ReactAriaSelectProps, ValidationResult } from "react-aria-components";
|
|
3
3
|
import "./Select.css";
|
|
4
4
|
export interface ListBoxItemProps extends ReactAriaListBoxItemProps {
|
|
5
5
|
/** Text label for the option. Provide an `id` if this is not unique. */
|
|
@@ -31,6 +31,7 @@ export interface SelectProps<T extends object> extends ReactAriaSelectProps<T> {
|
|
|
31
31
|
placeholder?: string;
|
|
32
32
|
/** Defaults to `medium` */
|
|
33
33
|
size?: "small" | "medium";
|
|
34
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
34
35
|
}
|
|
35
36
|
/** 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;
|
|
37
|
+
export default function Select<T extends object>({ items, sections, label, placeholder, size, errorMessage, ...props }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextFieldProps as ReactAriaTextFieldProps, ValidationResult } from "react-aria-components";
|
|
3
|
+
import "./TextField.css";
|
|
4
|
+
export interface TextFieldProps extends ReactAriaTextFieldProps {
|
|
5
|
+
size?: "medium" | "small";
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
9
|
+
iconLeft?: React.ReactElement;
|
|
10
|
+
iconRight?: React.ReactElement;
|
|
11
|
+
}
|
|
12
|
+
export default function TextField({ size, label, description, errorMessage, iconLeft, iconRight, ...props }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,4 +7,5 @@ export { default as SvgBcLogo } from "./SvgBcLogo";
|
|
|
7
7
|
export { default as Tag } from "./Tag";
|
|
8
8
|
export { default as TagGroup } from "./TagGroup";
|
|
9
9
|
export { default as TagList } from "./TagList";
|
|
10
|
+
export { default as TextField } from "./TextField";
|
|
10
11
|
export { default as Tooltip, TooltipTrigger } from "./Tooltip";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { ButtonProps as ButtonProps$1, SelectProps as SelectProps$1, ListBoxItemProps as ListBoxItemProps$1, Key, TagProps as TagProps$1, TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1, TooltipProps } from 'react-aria-components';
|
|
3
|
+
import { ButtonProps as ButtonProps$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';
|
|
4
4
|
export { TooltipTrigger } from 'react-aria-components';
|
|
5
5
|
import React$1 from 'react';
|
|
6
6
|
|
|
@@ -144,9 +144,10 @@ interface SelectProps<T extends object> extends SelectProps$1<T> {
|
|
|
144
144
|
placeholder?: string;
|
|
145
145
|
/** Defaults to `medium` */
|
|
146
146
|
size?: "small" | "medium";
|
|
147
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
147
148
|
}
|
|
148
149
|
/** Select displays a collapsible list of options and allows a user to select one of them. */
|
|
149
|
-
declare function Select<T extends object>({ items, sections, label, placeholder, size, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
150
|
+
declare function Select<T extends object>({ items, sections, label, placeholder, size, errorMessage, ...props }: SelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
150
151
|
|
|
151
152
|
declare function SvgBcLogo({ id }: {
|
|
152
153
|
id?: string | undefined;
|
|
@@ -189,6 +190,16 @@ interface TagListProps<T> extends Pick<TagListProps$1<T>, "children" | "renderEm
|
|
|
189
190
|
}
|
|
190
191
|
declare function TagList<T extends object>({ items, orientation, renderEmptyState, ...props }: TagListProps<T>): react_jsx_runtime.JSX.Element;
|
|
191
192
|
|
|
193
|
+
interface TextFieldProps extends TextFieldProps$1 {
|
|
194
|
+
size?: "medium" | "small";
|
|
195
|
+
label?: string;
|
|
196
|
+
description?: string;
|
|
197
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
198
|
+
iconLeft?: React.ReactElement;
|
|
199
|
+
iconRight?: React.ReactElement;
|
|
200
|
+
}
|
|
201
|
+
declare function TextField({ size, label, description, errorMessage, iconLeft, iconRight, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
202
|
+
|
|
192
203
|
declare function Tooltip(props: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
193
204
|
|
|
194
|
-
export { Button, Footer, FooterLinks, Header, Select, SvgBcLogo, Tag, TagGroup, TagList, Tooltip };
|
|
205
|
+
export { Button, Footer, FooterLinks, Header, Select, SvgBcLogo, Tag, TagGroup, TagList, TextField, Tooltip };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcgov/design-system-react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8-rc1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"rollup": "rm -rf dist && rollup -c --bundleConfigAsCjs",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"@rollup/plugin-json": "6.1.0",
|
|
38
38
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
39
39
|
"@rollup/plugin-typescript": "11.1.6",
|
|
40
|
-
"@storybook/addon-a11y": "8.
|
|
41
|
-
"@storybook/addon-essentials": "8.
|
|
42
|
-
"@storybook/addon-interactions": "8.
|
|
43
|
-
"@storybook/addon-links": "8.
|
|
44
|
-
"@storybook/blocks": "8.
|
|
45
|
-
"@storybook/react": "8.
|
|
46
|
-
"@storybook/react-vite": "8.
|
|
47
|
-
"@storybook/test": "8.
|
|
48
|
-
"@storybook/test-runner": "0.
|
|
40
|
+
"@storybook/addon-a11y": "8.2.3",
|
|
41
|
+
"@storybook/addon-essentials": "8.2.3",
|
|
42
|
+
"@storybook/addon-interactions": "8.2.3",
|
|
43
|
+
"@storybook/addon-links": "8.2.3",
|
|
44
|
+
"@storybook/blocks": "8.2.3",
|
|
45
|
+
"@storybook/react": "8.2.3",
|
|
46
|
+
"@storybook/react-vite": "8.2.3",
|
|
47
|
+
"@storybook/test": "8.2.3",
|
|
48
|
+
"@storybook/test-runner": "0.19.1",
|
|
49
49
|
"@testing-library/jest-dom": "6.4.5",
|
|
50
50
|
"@testing-library/react": "16.0.0",
|
|
51
51
|
"@types/jest": "29.5.12",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"rollup-plugin-dts": "6.1.1",
|
|
67
67
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
68
68
|
"rollup-plugin-postcss": "4.0.2",
|
|
69
|
-
"storybook": "8.
|
|
69
|
+
"storybook": "8.2.3",
|
|
70
70
|
"ts-jest": "29.1.4",
|
|
71
71
|
"ts-node": "10.9.2",
|
|
72
72
|
"tslib": "2.6.2",
|