@bcgov/design-system-react-components 0.0.1 → 0.0.3
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 +27 -7
- package/dist/assets/BCSans-Bold-ZqE3sZik.woff +0 -0
- package/dist/assets/BCSans-Bold-onJZunl0.woff2 +0 -0
- package/dist/assets/BCSans-BoldItalic-4P_OlA2s.woff +0 -0
- package/dist/assets/BCSans-BoldItalic-GxGpSOWy.woff2 +0 -0
- package/dist/assets/BCSans-Italic-Pz_cGW4F.woff2 +0 -0
- package/dist/assets/BCSans-Italic-UhTyhoET.woff +0 -0
- package/dist/assets/BCSans-Light-A03rbYd1.woff2 +0 -0
- package/dist/assets/BCSans-Light-playkmYo.woff +0 -0
- package/dist/assets/BCSans-LightItalic-HTeW1g69.woff2 +0 -0
- package/dist/assets/BCSans-LightItalic-tgMWPWlK.woff +0 -0
- package/dist/assets/BCSans-Regular-jMf6NRx3.woff +0 -0
- package/dist/assets/BCSans-Regular-ysGfRp0T.woff2 +0 -0
- package/dist/assets/index-t1vEzjyT.css +1 -0
- package/dist/assets/index-yaBoZILt.js +48 -0
- package/dist/cjs/index.cjs +6963 -2151
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +9 -0
- package/dist/cjs/types/components/Button/index.d.ts +2 -0
- package/dist/cjs/types/components/Select/Select.d.ts +30 -0
- package/dist/cjs/types/components/Select/index.d.ts +2 -0
- package/dist/cjs/types/components/SelectItem/SelectItem.d.ts +16 -0
- package/dist/cjs/types/components/SelectItem/index.d.ts +2 -0
- package/dist/cjs/types/components/Tag/Tag.d.ts +1 -4
- package/dist/cjs/types/components/index.d.ts +4 -0
- package/dist/esm/index.js +6962 -2153
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Button/Button.d.ts +9 -0
- package/dist/esm/types/components/Button/index.d.ts +2 -0
- package/dist/esm/types/components/Select/Select.d.ts +30 -0
- package/dist/esm/types/components/Select/index.d.ts +2 -0
- package/dist/esm/types/components/SelectItem/SelectItem.d.ts +16 -0
- package/dist/esm/types/components/SelectItem/index.d.ts +2 -0
- package/dist/esm/types/components/Tag/Tag.d.ts +1 -4
- package/dist/esm/types/components/index.d.ts +4 -0
- package/dist/index.d.ts +54 -4
- package/dist/index.html +14 -0
- package/dist/vite.svg +1 -0
- package/package.json +29 -29
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonProps as ReactAriaButtonProps } from "react-aria-components";
|
|
2
|
+
import "./Button.css";
|
|
3
|
+
export interface ButtonProps extends ReactAriaButtonProps {
|
|
4
|
+
size?: "small" | "medium";
|
|
5
|
+
variant?: "primary" | "secondary" | "tertiary" | "link";
|
|
6
|
+
danger?: boolean;
|
|
7
|
+
isIconButton?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default function Button({ size, variant, danger, isIconButton, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Key, ListBoxItemProps as ReactAriaListBoxItemProps, SelectProps as ReactAriaSelectProps } from "react-aria-components";
|
|
3
|
+
import "./Select.css";
|
|
4
|
+
export interface ListBoxItemProps extends ReactAriaListBoxItemProps {
|
|
5
|
+
/** Text label for the option. Provide an `id` if this is not unique. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Descriptive text that appears below the option's label */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Marks an option visually with red text to indicate danger */
|
|
10
|
+
isDestructive?: boolean;
|
|
11
|
+
/** Left icon slot */
|
|
12
|
+
iconLeft?: React.ReactElement;
|
|
13
|
+
/** Right icon slot */
|
|
14
|
+
iconRight?: React.ReactElement;
|
|
15
|
+
}
|
|
16
|
+
export interface SelectionSectionProps {
|
|
17
|
+
/** Display name for the section */
|
|
18
|
+
id: Key;
|
|
19
|
+
header?: string;
|
|
20
|
+
items: ListBoxItemProps[];
|
|
21
|
+
}
|
|
22
|
+
export interface SelectProps<T extends object> extends ReactAriaSelectProps<T> {
|
|
23
|
+
items?: ListBoxItemProps[];
|
|
24
|
+
sections?: SelectionSectionProps[];
|
|
25
|
+
/** Text label for the Select component */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Defaults to `medium` */
|
|
28
|
+
size?: "small" | "medium";
|
|
29
|
+
}
|
|
30
|
+
export default function Select<T extends object>({ items, sections, label, size, ...props }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ListBoxItemProps } from "react-aria-components";
|
|
3
|
+
import "./SelectItem.css";
|
|
4
|
+
export interface SelectItemProps extends ListBoxItemProps {
|
|
5
|
+
/** Text label for the option. Provide an `id` if this is not unique. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Descriptive text that appears below the option's label */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Marks an option visually with red text to indicate danger */
|
|
10
|
+
isDestructive?: boolean;
|
|
11
|
+
/** Left icon slot */
|
|
12
|
+
iconLeft?: React.ReactElement;
|
|
13
|
+
/** Right icon slot */
|
|
14
|
+
iconRight?: React.ReactElement;
|
|
15
|
+
}
|
|
16
|
+
export default function SelectItem({ description, id, iconLeft, iconRight, isDestructive, label, }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { TagProps as ReactAriaTagProps } from "react-aria-components";
|
|
3
|
-
import "@bcgov/design-tokens/css/variables.css";
|
|
4
|
-
import "@bcgov/bc-sans/css/BC_Sans.css";
|
|
5
3
|
import "./Tag.css";
|
|
6
4
|
export interface TagProps extends ReactAriaTagProps {
|
|
7
|
-
id: Key;
|
|
8
5
|
icon?: React.ReactNode;
|
|
9
6
|
color?: "bc-blue" | "bc-gold" | "blue" | "dark" | "gray" | "grey" | "green" | "red" | "yellow";
|
|
10
7
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import "@bcgov/design-tokens/css/variables.css";
|
|
2
|
+
export { default as Button } from "./Button";
|
|
3
|
+
export { default as Select } from "./Select";
|
|
4
|
+
export { default as SelectItem } from "./SelectItem";
|
|
1
5
|
export { default as Tag } from "./Tag";
|
|
2
6
|
export { default as TagGroup } from "./TagGroup";
|
|
3
7
|
export { default as TagList } from "./TagList";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,59 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Key } from 'react';
|
|
3
|
-
import
|
|
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 } from 'react-aria-components';
|
|
4
|
+
import React$1 from 'react';
|
|
4
5
|
|
|
5
|
-
interface
|
|
6
|
+
interface ButtonProps extends ButtonProps$1 {
|
|
7
|
+
size?: "small" | "medium";
|
|
8
|
+
variant?: "primary" | "secondary" | "tertiary" | "link";
|
|
9
|
+
danger?: boolean;
|
|
10
|
+
isIconButton?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function Button({ size, variant, danger, isIconButton, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
interface ListBoxItemProps extends ListBoxItemProps$1 {
|
|
15
|
+
/** Text label for the option. Provide an `id` if this is not unique. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Descriptive text that appears below the option's label */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Marks an option visually with red text to indicate danger */
|
|
20
|
+
isDestructive?: boolean;
|
|
21
|
+
/** Left icon slot */
|
|
22
|
+
iconLeft?: React$1.ReactElement;
|
|
23
|
+
/** Right icon slot */
|
|
24
|
+
iconRight?: React$1.ReactElement;
|
|
25
|
+
}
|
|
26
|
+
interface SelectionSectionProps {
|
|
27
|
+
/** Display name for the section */
|
|
6
28
|
id: Key;
|
|
29
|
+
header?: string;
|
|
30
|
+
items: ListBoxItemProps[];
|
|
31
|
+
}
|
|
32
|
+
interface SelectProps<T extends object> extends SelectProps$1<T> {
|
|
33
|
+
items?: ListBoxItemProps[];
|
|
34
|
+
sections?: SelectionSectionProps[];
|
|
35
|
+
/** Text label for the Select component */
|
|
36
|
+
label?: string;
|
|
37
|
+
/** Defaults to `medium` */
|
|
38
|
+
size?: "small" | "medium";
|
|
39
|
+
}
|
|
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
|
+
|
|
56
|
+
interface TagProps extends TagProps$1 {
|
|
7
57
|
icon?: React.ReactNode;
|
|
8
58
|
color?: "bc-blue" | "bc-gold" | "blue" | "dark" | "gray" | "grey" | "green" | "red" | "yellow";
|
|
9
59
|
}
|
|
@@ -22,4 +72,4 @@ interface TagListProps<T> extends Pick<TagListProps$1<T>, "children" | "renderEm
|
|
|
22
72
|
}
|
|
23
73
|
declare function TagList<T extends object>({ items, orientation, renderEmptyState, ...props }: TagListProps<T>): react_jsx_runtime.JSX.Element;
|
|
24
74
|
|
|
25
|
-
export { Tag, TagGroup, TagList };
|
|
75
|
+
export { Button, Select, SelectItem, Tag, TagGroup, TagList };
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>BC Design System React Components Vite Kitchen Sink</title>
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-yaBoZILt.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-t1vEzjyT.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcgov/design-system-react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"
|
|
7
|
-
"build-vite": "tsc && vite build",
|
|
6
|
+
"rollup": "rollup -c --bundleConfigAsCjs",
|
|
8
7
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
9
|
-
"
|
|
10
|
-
"storybook": "storybook
|
|
11
|
-
"
|
|
12
|
-
"
|
|
8
|
+
"storybook-dev": "storybook dev -p 6006",
|
|
9
|
+
"storybook-build": "storybook build",
|
|
10
|
+
"vite-dev": "vite",
|
|
11
|
+
"vite-build": "tsc && vite build",
|
|
12
|
+
"vite-preview": "vite preview"
|
|
13
13
|
},
|
|
14
14
|
"main": "dist/cjs/index.cjs",
|
|
15
15
|
"module": "dist/esm/index.js",
|
|
@@ -18,44 +18,44 @@
|
|
|
18
18
|
],
|
|
19
19
|
"types": "dist/index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@bcgov/
|
|
22
|
-
"
|
|
23
|
-
"react-aria-components": "^1.0.0-rc.0"
|
|
21
|
+
"@bcgov/design-tokens": "^2.0.1",
|
|
22
|
+
"react-aria-components": "1.0.1"
|
|
24
23
|
},
|
|
25
24
|
"peerDependencies": {
|
|
25
|
+
"@bcgov/bc-sans": "^2.1.0",
|
|
26
26
|
"react": "^16.14.0 || ^17.0.0-rc.1 || ^18.0.0",
|
|
27
27
|
"react-dom": "^16.14.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@react-stately/data": "^3.10.3",
|
|
31
31
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
32
|
-
"@rollup/plugin-json": "^6.0
|
|
32
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
33
33
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
34
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
35
|
-
"@storybook/addon-essentials": "^
|
|
36
|
-
"@storybook/addon-interactions": "^
|
|
37
|
-
"@storybook/addon-links": "^
|
|
38
|
-
"@storybook/blocks": "^
|
|
39
|
-
"@storybook/react": "^
|
|
40
|
-
"@storybook/react-vite": "^
|
|
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",
|
|
41
41
|
"@storybook/testing-library": "^0.2.2",
|
|
42
|
-
"@types/react": "^18.2.
|
|
43
|
-
"@types/react-dom": "^18.2.
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
45
|
-
"@typescript-eslint/parser": "^6.
|
|
46
|
-
"@vitejs/plugin-react": "^4.
|
|
47
|
-
"eslint": "^8.
|
|
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",
|
|
46
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
47
|
+
"eslint": "^8.56.0",
|
|
48
48
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
49
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
49
|
+
"eslint-plugin-react-refresh": "^0.4.5",
|
|
50
50
|
"eslint-plugin-storybook": "^0.6.15",
|
|
51
|
-
"rollup": "^4.
|
|
51
|
+
"rollup": "^4.9.6",
|
|
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": "^
|
|
55
|
+
"storybook": "^8.0.0-alpha.17",
|
|
56
56
|
"tslib": "^2.6.2",
|
|
57
|
-
"typescript": "^5.
|
|
58
|
-
"vite": "^
|
|
57
|
+
"typescript": "^5.3.3",
|
|
58
|
+
"vite": "^5.0.12"
|
|
59
59
|
},
|
|
60
60
|
"author": "Tyler Krys <Tyler.Krys@gov.bc.ca>",
|
|
61
61
|
"license": "Apache-2.0",
|