@touchtech/baselayer-ui 8.1.1 → 8.1.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/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.stories.d.ts +17 -0
- package/dist/components/ButtonBadge/ButtonBadge.d.ts +1 -1
- package/dist/components/ButtonBadge/ButtonBadge.stories.d.ts +8 -0
- package/dist/components/ButtonLink/ButtonLink.d.ts +2 -2
- package/dist/components/ButtonLink/ButtonLink.stories.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.stories.d.ts +9 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.stories.d.ts +9 -0
- package/dist/components/ColorSwatch/ColorSwatch.d.ts +1 -1
- package/dist/components/ColorSwatch/ColorSwatch.stories.d.ts +8 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +1 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.d.ts +11 -0
- package/dist/components/Dropdown/Clickable.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +4 -4
- package/dist/components/Dropdown/Dropdown.stories.d.ts +10 -0
- package/dist/components/FileInput/FileInput.d.ts +2 -2
- package/dist/components/FileInput/FileInput.stories.d.ts +15 -0
- package/dist/components/FloatingPanel/FloatingPanel.d.ts +2 -2
- package/dist/components/FloatingPanel/FloatingPanel.stories.d.ts +11 -0
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.stories.d.ts +8 -0
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/IconButton/IconButton.stories.d.ts +14 -0
- package/dist/components/IconButtonLink/IconButtonLink.d.ts +2 -2
- package/dist/components/IconButtonLink/IconButtonLink.stories.d.ts +14 -0
- package/dist/components/Image/Image.d.ts +1 -1
- package/dist/components/Image/Image.stories.d.ts +12 -0
- package/dist/components/Label/Label.d.ts +1 -1
- package/dist/components/Label/Label.stories.d.ts +9 -0
- package/dist/components/ListView/ListView.d.ts +1 -1
- package/dist/components/ListView/ListView.stories.d.ts +12 -0
- package/dist/components/ListView/ListViewItem.d.ts +1 -1
- package/dist/components/ListView/ListViewLinkItem.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +1 -1
- package/dist/components/Menu/Menu.stories.d.ts +72 -0
- package/dist/components/Menu/MenuContainer.d.ts +2 -2
- package/dist/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/Menu/MenuLinkItem.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.stories.d.ts +11 -0
- package/dist/components/Overlay/Overlay.d.ts +1 -1
- package/dist/components/Overlay/Overlay.stories.d.ts +8 -0
- package/dist/components/Select/GroupOption/GroupOption.d.ts +9 -0
- package/dist/components/Select/GroupOption/index.d.ts +1 -0
- package/dist/components/Select/Option/Option.d.ts +8 -0
- package/dist/components/Select/Option/index.d.ts +1 -0
- package/dist/components/Select/Search/Search.d.ts +6 -0
- package/dist/components/Select/Search/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +15 -0
- package/dist/components/Select/Select.stories.d.ts +9 -0
- package/dist/components/Select/SelectContext.d.ts +18 -0
- package/dist/components/Select/Selector/Selector.d.ts +7 -0
- package/dist/components/Select/Selector/index.d.ts +1 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +2 -2
- package/dist/components/Table/Table.stories.d.ts +7 -0
- package/dist/components/Table/TableHeader.d.ts +1 -1
- package/dist/components/Table/TableRow.d.ts +1 -1
- package/dist/components/Table/TableRowCell.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +9 -0
- package/dist/components/Tag/Tag.stories.d.ts +7 -0
- package/dist/components/Tag/index.d.ts +1 -0
- package/dist/components/TextInput/TextInput.d.ts +1 -1
- package/dist/components/TextInput/TextInput.stories.d.ts +11 -0
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.stories.d.ts +7 -0
- package/dist/components/Toast/ToastContainer.d.ts +1 -1
- package/dist/components/Video/Video.d.ts +2 -2
- package/dist/components/Video/Video.stories.d.ts +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -20
- package/dist/index.js.LICENSE.txt +18 -0
- package/dist/styles.css +442 -330
- package/dist/types/common.d.ts +6 -0
- package/dist/types/index.d.ts +3 -8
- package/dist/types/select.d.ts +8 -0
- package/dist/types/textInput.d.ts +2 -0
- package/package.json +50 -44
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Button as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function Disabled(): JSX.Element;
|
|
8
|
+
export function Inverted(): JSX.Element;
|
|
9
|
+
export function Rounded(): JSX.Element;
|
|
10
|
+
export function NoShadow(): JSX.Element;
|
|
11
|
+
export function NoBorder(): JSX.Element;
|
|
12
|
+
export function Transparent(): JSX.Element;
|
|
13
|
+
export function WithIcon(): JSX.Element;
|
|
14
|
+
export function WithImage(): JSX.Element;
|
|
15
|
+
export function StretchHorizontally(): JSX.Element;
|
|
16
|
+
export function StretchVertically(): JSX.Element;
|
|
17
|
+
import Button from "./Button";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode, ElementType, RefObject } from "react";
|
|
2
2
|
import { Size } from "../../types";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type OffsetSide = "left" | "right";
|
|
4
|
+
type ButtonLinkProps = {
|
|
5
5
|
as?: ElementType;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
className?: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { ButtonLink as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function Inverted(): JSX.Element;
|
|
8
|
+
export function Rounded(): JSX.Element;
|
|
9
|
+
export function NoShadow(): JSX.Element;
|
|
10
|
+
export function NoBorder(): JSX.Element;
|
|
11
|
+
export function Transparent(): JSX.Element;
|
|
12
|
+
export function Disabled(): JSX.Element;
|
|
13
|
+
export function WithIcon(): JSX.Element;
|
|
14
|
+
export function WithImage(): JSX.Element;
|
|
15
|
+
export function StretchHorizontally(): JSX.Element;
|
|
16
|
+
export function StretchVertically(): JSX.Element;
|
|
17
|
+
export function CustomButtonLink(): JSX.Element;
|
|
18
|
+
import ButtonLink from "./ButtonLink";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Size } from "../../types";
|
|
3
|
-
|
|
3
|
+
type CheckboxProps = {
|
|
4
4
|
label?: string;
|
|
5
|
-
onChange
|
|
5
|
+
onChange?: (value: boolean) => void;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
checked?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Checkbox as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function Disabled(): JSX.Element;
|
|
8
|
+
export function Indeterminated(): JSX.Element;
|
|
9
|
+
import Checkbox from "./Checkbox";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { ColorPicker as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Vertical(): JSX.Element;
|
|
7
|
+
export function Horizontal(): JSX.Element;
|
|
8
|
+
export function Togglable(): JSX.Element;
|
|
9
|
+
import ColorPicker from "./ColorPicker";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { ConfirmationModal as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function NoPadding(): JSX.Element;
|
|
8
|
+
export function NoOverlay(): JSX.Element;
|
|
9
|
+
export function NoShadow(): JSX.Element;
|
|
10
|
+
export function OnAnotherModal(): JSX.Element;
|
|
11
|
+
import ConfirmationModal from "./ConfirmationModal";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Item, RenderDisplayProps } from "./Dropdown";
|
|
3
|
-
export
|
|
3
|
+
export type ClickableProps<T extends Item> = Omit<RenderDisplayProps<T>, "selectedItem" | "toggleIsOpen"> & {
|
|
4
4
|
onClick: RenderDisplayProps<T>["toggleIsOpen"];
|
|
5
5
|
};
|
|
6
6
|
export declare function Clickable<T extends Item>({ display, isDisabled, onClick: handleClick, }: ClickableProps<T>): JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ReactChild, ReactElement } from "react";
|
|
2
2
|
import { MenuPlacement } from "../Menu";
|
|
3
|
-
export
|
|
3
|
+
export type Item = {
|
|
4
4
|
id: number | string;
|
|
5
5
|
name: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type RenderDisplayProps<T extends Item> = Pick<DropdownProps<T>, "display" | "selectedItem"> & {
|
|
8
8
|
isDisabled: boolean;
|
|
9
9
|
toggleIsOpen: () => void;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type RenderClickableFn<T extends Item> = (props: RenderDisplayProps<T>) => ReactElement;
|
|
12
|
+
export type ItemBodyRendererFn<T extends Item> = (state: {
|
|
13
13
|
item: T;
|
|
14
14
|
isSelected: boolean;
|
|
15
15
|
}) => ReactChild;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Dropdown as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export const Default: any;
|
|
7
|
+
export const WithCustomClickable: any;
|
|
8
|
+
export const WithCustomItemBody: any;
|
|
9
|
+
export const WithCustomPlacement: any;
|
|
10
|
+
import { Dropdown } from "./Dropdown";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ChangeEvent } from "react";
|
|
2
2
|
import { Size } from "../../types";
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export type FileInputSize = Size;
|
|
4
|
+
type Props = {
|
|
5
5
|
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
accept?: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { FileInput as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function TextLabel(): JSX.Element;
|
|
8
|
+
export function Rounded(): JSX.Element;
|
|
9
|
+
export function Disabled(): JSX.Element;
|
|
10
|
+
export function Inverted(): JSX.Element;
|
|
11
|
+
export function noShadow(): JSX.Element;
|
|
12
|
+
export function noBorder(): JSX.Element;
|
|
13
|
+
export function noPadding(): JSX.Element;
|
|
14
|
+
export function Transparent(): JSX.Element;
|
|
15
|
+
import FileInput from "./FileInput";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from "react";
|
|
2
|
-
|
|
2
|
+
type Placement = {
|
|
3
3
|
horizontal: "right" | "rightEdge" | "rightOnEdge" | "left" | "leftEdge" | "leftOnEdge" | "leftOnEdge" | "center";
|
|
4
4
|
vertical: "top" | "topEdge" | "topOnEdge" | "bottom" | "bottomEdge" | "bottomOnEdge" | "center";
|
|
5
5
|
parent: "viewport" | "container";
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type FloatingPanelProps = {
|
|
8
8
|
className?: string;
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
containerRef?: RefObject<HTMLDivElement>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { FloatingPanel as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function Edges(): JSX.Element;
|
|
8
|
+
export function OnEdges(): JSX.Element;
|
|
9
|
+
export function Layout(): JSX.Element;
|
|
10
|
+
export function ViewportVsContainer(): JSX.Element;
|
|
11
|
+
import FloatingPanel from "./FloatingPanel";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { IconButton as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function WithChildren(): JSX.Element;
|
|
8
|
+
export function Rounded(): JSX.Element;
|
|
9
|
+
export function Disabled(): JSX.Element;
|
|
10
|
+
export function Inverted(): JSX.Element;
|
|
11
|
+
export function noShadow(): JSX.Element;
|
|
12
|
+
export function noBorder(): JSX.Element;
|
|
13
|
+
export function Transparent(): JSX.Element;
|
|
14
|
+
import IconButton from "./IconButton";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementType, ReactNode, RefObject } from "react";
|
|
2
2
|
import { Size } from "../../types";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type OffsetSide = "top" | "right" | "bottom" | "left";
|
|
4
|
+
type IconButtonLinkProps = {
|
|
5
5
|
as?: ElementType;
|
|
6
6
|
containerRef?: RefObject<HTMLElement>;
|
|
7
7
|
src: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { IconButtonLink as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function WithChildren(): JSX.Element;
|
|
8
|
+
export function Rounded(): JSX.Element;
|
|
9
|
+
export function Inverted(): JSX.Element;
|
|
10
|
+
export function noShadow(): JSX.Element;
|
|
11
|
+
export function noBorder(): JSX.Element;
|
|
12
|
+
export function Transparent(): JSX.Element;
|
|
13
|
+
export function Disabled(): JSX.Element;
|
|
14
|
+
import IconButtonLink from "./IconButtonLink";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Image as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function WithOverlay(): JSX.Element;
|
|
8
|
+
export function Contain(): JSX.Element;
|
|
9
|
+
export function Cover(): JSX.Element;
|
|
10
|
+
export function StretchVertically(): JSX.Element;
|
|
11
|
+
export function StretchHorizontally(): JSX.Element;
|
|
12
|
+
import Image from "./Image";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Label as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function WithChild(): JSX.Element;
|
|
8
|
+
export function WithStyledValue(): JSX.Element;
|
|
9
|
+
import Label from "./Label";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { ListView as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function Active(): JSX.Element;
|
|
8
|
+
export function Disabled(): JSX.Element;
|
|
9
|
+
export function Transparent(): JSX.Element;
|
|
10
|
+
export function NoPadding(): JSX.Element;
|
|
11
|
+
export function CustomHeader(): JSX.Element;
|
|
12
|
+
import ListView from "./ListView";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Menu as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
export namespace args {
|
|
5
|
+
const isOpen: boolean;
|
|
6
|
+
const verticalPlacement: string;
|
|
7
|
+
const horizontalPlacement: string;
|
|
8
|
+
const items: JSX.Element[];
|
|
9
|
+
}
|
|
10
|
+
export namespace argTypes {
|
|
11
|
+
export namespace items_1 {
|
|
12
|
+
namespace table {
|
|
13
|
+
const disable: boolean;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export { items_1 as items };
|
|
17
|
+
export namespace containerRef {
|
|
18
|
+
export namespace table_1 {
|
|
19
|
+
const disable_1: boolean;
|
|
20
|
+
export { disable_1 as disable };
|
|
21
|
+
}
|
|
22
|
+
export { table_1 as table };
|
|
23
|
+
}
|
|
24
|
+
export namespace className {
|
|
25
|
+
export namespace table_2 {
|
|
26
|
+
const disable_2: boolean;
|
|
27
|
+
export { disable_2 as disable };
|
|
28
|
+
}
|
|
29
|
+
export { table_2 as table };
|
|
30
|
+
}
|
|
31
|
+
export namespace verticalPlacement_1 {
|
|
32
|
+
const control: string;
|
|
33
|
+
const options: string[];
|
|
34
|
+
}
|
|
35
|
+
export { verticalPlacement_1 as verticalPlacement };
|
|
36
|
+
export namespace horizontalPlacement_1 {
|
|
37
|
+
const control_1: string;
|
|
38
|
+
export { control_1 as control };
|
|
39
|
+
const options_1: string[];
|
|
40
|
+
export { options_1 as options };
|
|
41
|
+
}
|
|
42
|
+
export { horizontalPlacement_1 as horizontalPlacement };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export default _default;
|
|
46
|
+
export const Default: any;
|
|
47
|
+
export const Active: any;
|
|
48
|
+
export const WithHeader: any;
|
|
49
|
+
export const WithFooter: any;
|
|
50
|
+
export const NoMenuItemPadding: any;
|
|
51
|
+
export const WithCustomMenuItem: any;
|
|
52
|
+
export function WithSubMenu(args: any): JSX.Element;
|
|
53
|
+
export namespace WithSubMenu {
|
|
54
|
+
export namespace argTypes_1 {
|
|
55
|
+
namespace header {
|
|
56
|
+
export namespace table_3 {
|
|
57
|
+
const disable_3: boolean;
|
|
58
|
+
export { disable_3 as disable };
|
|
59
|
+
}
|
|
60
|
+
export { table_3 as table };
|
|
61
|
+
}
|
|
62
|
+
namespace footer {
|
|
63
|
+
export namespace table_4 {
|
|
64
|
+
const disable_4: boolean;
|
|
65
|
+
export { disable_4 as disable };
|
|
66
|
+
}
|
|
67
|
+
export { table_4 as table };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export { argTypes_1 as argTypes };
|
|
71
|
+
}
|
|
72
|
+
import Menu from "./Menu";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode, ReactElement } from "react";
|
|
2
|
-
export
|
|
2
|
+
export type MenuPlacement = {
|
|
3
3
|
horizontal: "right" | "left";
|
|
4
4
|
vertical: "top" | "bottom";
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type MenuContainerProps = {
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
button?: ReactElement;
|
|
9
9
|
className?: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Modal as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function Transparent(): JSX.Element;
|
|
8
|
+
export function NoShadow(): JSX.Element;
|
|
9
|
+
export function NoOverlay(): JSX.Element;
|
|
10
|
+
export function WithButton(): JSX.Element;
|
|
11
|
+
import Modal from "./Modal";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OptionType } from "../../../types";
|
|
3
|
+
type Props = {
|
|
4
|
+
className?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
options: Array<OptionType>;
|
|
7
|
+
};
|
|
8
|
+
declare function GroupOption({ className, label, options }: Props): JSX.Element;
|
|
9
|
+
export default GroupOption;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GroupOption } from "./GroupOption";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Option } from "./Option";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Search } from "./Search";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GroupOptionType, OptionType, Size } from "../../types";
|
|
3
|
+
type SelectProps = {
|
|
4
|
+
placeholder: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
size?: Size;
|
|
9
|
+
showSelectedAsTags?: boolean;
|
|
10
|
+
groupedOptionCollapsed?: boolean;
|
|
11
|
+
options: Array<OptionType | GroupOptionType>;
|
|
12
|
+
onChange?: (values: Array<string>) => void;
|
|
13
|
+
};
|
|
14
|
+
declare function Select({ placeholder, className, multiple, size, disabled, options, showSelectedAsTags, groupedOptionCollapsed, onChange }: SelectProps): JSX.Element;
|
|
15
|
+
export default Select;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Select as component };
|
|
3
|
+
export const title: string;
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export function Default(): JSX.Element;
|
|
7
|
+
export function Multi(): JSX.Element;
|
|
8
|
+
export function GroupedOptions(): JSX.Element;
|
|
9
|
+
import Select from "./Select";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GroupOptionType, OptionType } from "../../types";
|
|
3
|
+
type Props = {
|
|
4
|
+
options: Array<OptionType | GroupOptionType>;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
onChange?: (values: Array<string>) => void;
|
|
8
|
+
};
|
|
9
|
+
type SelectContextState = {
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
selectedValues: Array<string>;
|
|
12
|
+
updateSelectedValues: (value: string) => void;
|
|
13
|
+
searchKeyword: string;
|
|
14
|
+
setSearchKeyword: (value: string) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const SelectContext: React.Context<SelectContextState>;
|
|
17
|
+
declare const SelectContextProvider: ({ options, children, multiple, onChange, }: Props) => JSX.Element;
|
|
18
|
+
export { SelectContext, SelectContextProvider };
|