@bcgov/design-system-react-components 0.0.2 → 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 +2 -0
- 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 +4825 -433
- package/dist/cjs/index.cjs.map +1 -1
- 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/index.d.ts +2 -0
- package/dist/esm/index.js +4826 -436
- package/dist/esm/index.js.map +1 -1
- 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/index.d.ts +2 -0
- package/dist/index.d.ts +45 -2
- package/dist/index.html +14 -0
- package/dist/vite.svg +1 -0
- package/package.json +22 -22
|
@@ -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,5 +1,7 @@
|
|
|
1
1
|
import "@bcgov/design-tokens/css/variables.css";
|
|
2
2
|
export { default as Button } from "./Button";
|
|
3
|
+
export { default as Select } from "./Select";
|
|
4
|
+
export { default as SelectItem } from "./SelectItem";
|
|
3
5
|
export { default as Tag } from "./Tag";
|
|
4
6
|
export { default as TagGroup } from "./TagGroup";
|
|
5
7
|
export { default as TagList } from "./TagList";
|