@cloudwick/astral-ui 7.0.0 → 8.0.0
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 +3 -1
- package/dist/components/accordion/accordion.d.ts +5 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +5 -6
- package/dist/components/card/card.d.ts +7 -8
- package/dist/components/card/cardVariants.d.ts +3 -3
- package/dist/components/dropdown/dropdown.d.ts +17 -0
- package/dist/components/emptyState/emptyState.d.ts +1 -4
- package/dist/components/modal/modal.d.ts +6 -7
- package/dist/components/multiSelectTransfer/index.d.ts +3 -0
- package/dist/components/multiSelectTransfer/multiSelectTransfer.d.ts +6 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferDropdown.d.ts +32 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferModal.d.ts +34 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferPill.d.ts +28 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferVariants.d.ts +184 -0
- package/dist/components/multiSelectTransfer/types.d.ts +56 -0
- package/dist/components/panel/panel.d.ts +1 -2
- package/dist/components/radioGroup/index.d.ts +1 -1
- package/dist/components/radioGroup/radioGroup.d.ts +76 -12
- package/dist/components/radioGroup/radioGroupVariants.d.ts +30 -9
- package/dist/components/scrollbar/scrollbar.d.ts +7 -0
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/select.d.ts +3 -41
- package/dist/components/select/selectComponents.d.ts +45 -0
- package/dist/components/select/selectVariants.d.ts +15 -0
- package/dist/components/select/types.d.ts +138 -1
- package/dist/components/select/utils.d.ts +2 -0
- package/dist/components/tabs/tabs.d.ts +4 -5
- package/dist/components/tabs/tabsVariants.d.ts +12 -0
- package/dist/components/tooltip/tooltip.d.ts +17 -6
- package/dist/components/tooltip/tooltipVariants.d.ts +6 -6
- package/dist/components/transferList/index.d.ts +3 -0
- package/dist/components/transferList/transferList.d.ts +12 -0
- package/dist/components/transferList/transferListItem.d.ts +35 -0
- package/dist/components/transferList/transferListPanel.d.ts +51 -0
- package/dist/components/transferList/transferListVariants.d.ts +202 -0
- package/dist/components/transferList/types.d.ts +76 -0
- package/dist/components/transferList/useDragAutoScroll.d.ts +13 -0
- package/dist/components/transferList/useTransferList.d.ts +28 -0
- package/dist/css/fonts.min.css +1 -1
- package/dist/css/index.min.css +1 -1
- package/dist/fonts/NotoSans-Bold.woff2 +0 -0
- package/dist/fonts/NotoSans-BoldItalic.woff2 +0 -0
- package/dist/fonts/NotoSans-Italic.woff2 +0 -0
- package/dist/fonts/NotoSans-Medium.woff2 +0 -0
- package/dist/fonts/NotoSans-MediumItalic.woff2 +0 -0
- package/dist/fonts/NotoSans-Regular.woff2 +0 -0
- package/dist/fonts/NotoSans-SemiBold.woff2 +0 -0
- package/dist/fonts/NotoSans-SemiBoldItalic.woff2 +0 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/useDebouncedCallback.d.ts +10 -0
- package/dist/hooks/useInfiniteScroll.d.ts +24 -0
- package/dist/hooks/useIsTruncated.d.ts +25 -0
- package/dist/hooks/useListboxKeyboardNav.d.ts +47 -0
- package/dist/index.cjs.js +5 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +5 -5
- package/dist/utils/elementUtils.d.ts +18 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/matchesQuery.d.ts +13 -0
- package/package.json +2 -2
- package/dist/fonts/Inter_18pt-Bold.ttf +0 -0
- package/dist/fonts/Inter_18pt-BoldItalic.ttf +0 -0
- package/dist/fonts/Inter_18pt-Italic.ttf +0 -0
- package/dist/fonts/Inter_18pt-Medium.ttf +0 -0
- package/dist/fonts/Inter_18pt-MediumItalic.ttf +0 -0
- package/dist/fonts/Inter_18pt-Regular.ttf +0 -0
- package/dist/fonts/Inter_18pt-SemiBold.ttf +0 -0
- package/dist/fonts/Inter_18pt-SemiBoldItalic.ttf +0 -0
|
@@ -3,14 +3,24 @@ import { type ReactElement } from "react";
|
|
|
3
3
|
import { type IRadioProps } from "../radio";
|
|
4
4
|
export type TRadioGroupSize = "sm" | "md" | "lg";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Marks a prop as unsupported for the current variant.
|
|
7
|
+
*
|
|
8
|
+
* We encode the reason as the property's *type* (a descriptive string literal)
|
|
9
|
+
* rather than using `never`. With `never`, the compiler can't narrow the
|
|
10
|
+
* discriminated union to the branch you're actually using, so it reports the
|
|
11
|
+
* mismatch against the wrong branch (e.g. `Type 'string' is not assignable to
|
|
12
|
+
* type '"neutral" | "primary"'`) — which never mentions the real problem.
|
|
13
|
+
* A string-literal type keeps the branch narrowable, so the error reads
|
|
14
|
+
* `Type '"primary"' is not assignable to type '<this message>'` instead.
|
|
7
15
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
type TUnsupportedProp<TReason extends string> = TReason;
|
|
17
|
+
/**
|
|
18
|
+
* Props common to every RadioGroup variant.
|
|
19
|
+
*
|
|
20
|
+
* `color` is stripped from the inherited HTML attributes so each variant can
|
|
21
|
+
* re-declare it (or forbid it) — see the variant-specific prop types below.
|
|
22
|
+
*/
|
|
23
|
+
interface IRadioGroupBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "color"> {
|
|
14
24
|
/**
|
|
15
25
|
* Pass space separated class names to override the RadioGroup styling
|
|
16
26
|
*/
|
|
@@ -33,21 +43,75 @@ export interface IRadioGroupProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
33
43
|
* A selected value is passed as an argument to the function.
|
|
34
44
|
*/
|
|
35
45
|
onChange?: (arg: string) => void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Props for the `outline` and `text` variants: a vertical list of radio
|
|
49
|
+
* options. These support `size` and `radioPlacement`; they do **not** support
|
|
50
|
+
* `color` (setting it is a type error — `color` is `segmented`-only).
|
|
51
|
+
*/
|
|
52
|
+
export interface IRadioGroupListProps extends IRadioGroupBaseProps {
|
|
53
|
+
/**
|
|
54
|
+
* Variant of the RadioGroup.
|
|
55
|
+
* - `outline`: each option sits in its own bordered box.
|
|
56
|
+
* - `text`: all options share one bordered container.
|
|
57
|
+
* @default outline
|
|
58
|
+
*/
|
|
59
|
+
variant?: "outline" | "text";
|
|
60
|
+
/**
|
|
61
|
+
* Size of the Radio group.
|
|
62
|
+
* @default md
|
|
63
|
+
*/
|
|
64
|
+
size?: TRadioGroupSize;
|
|
36
65
|
/**
|
|
37
|
-
* Placement of the radio
|
|
66
|
+
* Placement of the radio relative to its label.
|
|
38
67
|
* @default "start"
|
|
39
68
|
*/
|
|
40
69
|
radioPlacement?: "start" | "end";
|
|
41
70
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
71
|
+
* Not supported by the `outline`/`text` variants — `color` only applies to
|
|
72
|
+
* the `segmented` variant.
|
|
44
73
|
*/
|
|
45
|
-
|
|
74
|
+
color?: TUnsupportedProp<"`color` is only supported when `variant` is \"segmented\"">;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Props for the `segmented` variant: a bordered, equal-width pill selector
|
|
78
|
+
* (segmented control) that visually hides the radio dot. It supports `color`;
|
|
79
|
+
* it does **not** support `size` or `radioPlacement` (the pills are a fixed
|
|
80
|
+
* height and the radio dot is hidden, so both are type errors here).
|
|
81
|
+
*/
|
|
82
|
+
export interface IRadioGroupSegmentedProps extends IRadioGroupBaseProps {
|
|
83
|
+
variant: "segmented";
|
|
84
|
+
/**
|
|
85
|
+
* Active-pill color. `neutral` gives the active pill a white/dark card;
|
|
86
|
+
* `primary` fills it with the brand color.
|
|
87
|
+
* @default neutral
|
|
88
|
+
*/
|
|
89
|
+
color?: "neutral" | "primary";
|
|
90
|
+
/**
|
|
91
|
+
* Not supported by the `segmented` variant — pills have a fixed height.
|
|
92
|
+
*/
|
|
93
|
+
size?: TUnsupportedProp<"`size` is not supported by the \"segmented\" variant (pills have a fixed height)">;
|
|
94
|
+
/**
|
|
95
|
+
* Not supported by the `segmented` variant — the radio dot is hidden.
|
|
96
|
+
*/
|
|
97
|
+
radioPlacement?: TUnsupportedProp<"`radioPlacement` is not supported by the \"segmented\" variant (the radio dot is hidden)">;
|
|
46
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* RadioGroup component props. This is a discriminated union on `variant`, so
|
|
101
|
+
* the compiler only allows the props that apply to the chosen variant:
|
|
102
|
+
*
|
|
103
|
+
* | variant | `size` | `radioPlacement` | `color` |
|
|
104
|
+
* | ------------------- | :----: | :--------------: | :-----: |
|
|
105
|
+
* | `outline` (default) | yes | yes | no |
|
|
106
|
+
* | `text` | yes | yes | no |
|
|
107
|
+
* | `segmented` | no | no | yes |
|
|
108
|
+
*/
|
|
109
|
+
export type TRadioGroupProps = IRadioGroupListProps | IRadioGroupSegmentedProps;
|
|
47
110
|
/**
|
|
48
111
|
* RadioGroup component for grouping radio button options
|
|
49
112
|
*/
|
|
50
113
|
export declare const RadioGroup: {
|
|
51
|
-
({ size, options, onChange, className, selectedValue, disabled, radioPlacement, variant }:
|
|
114
|
+
({ size, options, onChange, className, selectedValue, disabled, radioPlacement, variant, color, name }: TRadioGroupProps): ReactElement;
|
|
52
115
|
displayName: string;
|
|
53
116
|
};
|
|
117
|
+
export {};
|
|
@@ -8,6 +8,15 @@ export declare const radioGroupVariants: import("tailwind-variants").TVReturnTyp
|
|
|
8
8
|
root: string;
|
|
9
9
|
item: string;
|
|
10
10
|
};
|
|
11
|
+
segmented: {
|
|
12
|
+
root: string[];
|
|
13
|
+
item: string[];
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
color: {
|
|
18
|
+
neutral: {};
|
|
19
|
+
primary: {};
|
|
11
20
|
};
|
|
12
21
|
size: {
|
|
13
22
|
sm: {
|
|
@@ -21,9 +30,7 @@ export declare const radioGroupVariants: import("tailwind-variants").TVReturnTyp
|
|
|
21
30
|
};
|
|
22
31
|
};
|
|
23
32
|
checked: {
|
|
24
|
-
true: {
|
|
25
|
-
item: string;
|
|
26
|
-
};
|
|
33
|
+
true: {};
|
|
27
34
|
};
|
|
28
35
|
disabled: {
|
|
29
36
|
true: {
|
|
@@ -45,6 +52,15 @@ export declare const radioGroupVariants: import("tailwind-variants").TVReturnTyp
|
|
|
45
52
|
root: string;
|
|
46
53
|
item: string;
|
|
47
54
|
};
|
|
55
|
+
segmented: {
|
|
56
|
+
root: string[];
|
|
57
|
+
item: string[];
|
|
58
|
+
label: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
color: {
|
|
62
|
+
neutral: {};
|
|
63
|
+
primary: {};
|
|
48
64
|
};
|
|
49
65
|
size: {
|
|
50
66
|
sm: {
|
|
@@ -58,9 +74,7 @@ export declare const radioGroupVariants: import("tailwind-variants").TVReturnTyp
|
|
|
58
74
|
};
|
|
59
75
|
};
|
|
60
76
|
checked: {
|
|
61
|
-
true: {
|
|
62
|
-
item: string;
|
|
63
|
-
};
|
|
77
|
+
true: {};
|
|
64
78
|
};
|
|
65
79
|
disabled: {
|
|
66
80
|
true: {
|
|
@@ -82,6 +96,15 @@ export declare const radioGroupVariants: import("tailwind-variants").TVReturnTyp
|
|
|
82
96
|
root: string;
|
|
83
97
|
item: string;
|
|
84
98
|
};
|
|
99
|
+
segmented: {
|
|
100
|
+
root: string[];
|
|
101
|
+
item: string[];
|
|
102
|
+
label: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
color: {
|
|
106
|
+
neutral: {};
|
|
107
|
+
primary: {};
|
|
85
108
|
};
|
|
86
109
|
size: {
|
|
87
110
|
sm: {
|
|
@@ -95,9 +118,7 @@ export declare const radioGroupVariants: import("tailwind-variants").TVReturnTyp
|
|
|
95
118
|
};
|
|
96
119
|
};
|
|
97
120
|
checked: {
|
|
98
|
-
true: {
|
|
99
|
-
item: string;
|
|
100
|
-
};
|
|
121
|
+
true: {};
|
|
101
122
|
};
|
|
102
123
|
disabled: {
|
|
103
124
|
true: {
|
|
@@ -34,6 +34,13 @@ export interface IScrollbarProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
34
34
|
* Optional ID for the scrollbar container
|
|
35
35
|
*/
|
|
36
36
|
id?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Optional accessible name for the scroll area. When the content overflows the
|
|
39
|
+
* container becomes keyboard-scrollable; providing this label also promotes it
|
|
40
|
+
* to a discoverable `region` landmark. Leave it unset for incidental scroll
|
|
41
|
+
* areas so they don't clutter landmark navigation.
|
|
42
|
+
*/
|
|
43
|
+
"aria-label"?: string;
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
46
|
* Scrollbar component provides a custom scrollbar with support for both vertical and horizontal scrolling.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Select
|
|
1
|
+
export { Select } from "./select";
|
|
2
2
|
export { selectVariants } from "./selectVariants";
|
|
3
|
-
export type { IOption } from "./types";
|
|
3
|
+
export type { IOption, ISelectProps } from "./types";
|
|
@@ -1,44 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type TSelectSize, type IOption } from "./types";
|
|
5
|
-
/**
|
|
6
|
-
* Props for the Select component
|
|
7
|
-
*/
|
|
8
|
-
export interface ISelectProps<IsMulti extends boolean = false, Group extends GroupBase<IOption> = GroupBase<IOption>> extends Omit<ReactSelectProps<IOption, IsMulti, Group>, "options" | "value" | "className"> {
|
|
9
|
-
/** Unique id for the select input */
|
|
10
|
-
id?: string;
|
|
11
|
-
/** Custom className for wrapper */
|
|
12
|
-
className?: string;
|
|
13
|
-
/** Label displayed above select */
|
|
14
|
-
label?: ReactNode;
|
|
15
|
-
/** Select size variant */
|
|
16
|
-
size?: TSelectSize;
|
|
17
|
-
/** Options or groups to render */
|
|
18
|
-
options?: ReactSelectProps<IOption, IsMulti, Group>["options"];
|
|
19
|
-
/** Current value of the select */
|
|
20
|
-
value?: ReactSelectProps<IOption, IsMulti, Group>["value"];
|
|
21
|
-
/** Helper text displayed below */
|
|
22
|
-
helperText?: ReactNode;
|
|
23
|
-
/** Display error styling */
|
|
24
|
-
error?: boolean;
|
|
25
|
-
/** Disable the select */
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/** Enable creatable select */
|
|
28
|
-
creatable?: boolean;
|
|
29
|
-
/** Field touched state */
|
|
30
|
-
touched?: boolean;
|
|
31
|
-
/** Max number of visible values in multi */
|
|
32
|
-
maxVisibleValues?: number;
|
|
33
|
-
/** Label for truncated values */
|
|
34
|
-
maxVisibleValuesMsg?: string;
|
|
35
|
-
/** Custom footer in menu */
|
|
36
|
-
menuFooter?: ReactNode;
|
|
37
|
-
/** Prefix icon for the control */
|
|
38
|
-
prefixIcon?: TIconType | ReactNode;
|
|
39
|
-
/** Suffix icon for the control */
|
|
40
|
-
suffixIcon?: TIconType | ReactNode;
|
|
41
|
-
}
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { type GroupBase } from "react-select";
|
|
3
|
+
import { type IOption, type ISelectProps } from "./types";
|
|
42
4
|
/**
|
|
43
5
|
* Select component for single or multi selection
|
|
44
6
|
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ReactElement } from "react";
|
|
3
|
+
import { type GroupBase, type OptionProps, type MultiValueProps, type MultiValueRemoveProps, type DropdownIndicatorProps, type ValueContainerProps, type InputProps, type MenuProps } from "react-select";
|
|
4
|
+
import { type IOption, type ISelectOptionContext, type ISelectMenuContext, type ISelectComponentsConfig } from "./types";
|
|
5
|
+
export declare const SelectOptionContext: React.Context<ISelectOptionContext>;
|
|
6
|
+
export declare const SelectMenuContext: React.Context<ISelectMenuContext | null>;
|
|
7
|
+
/**
|
|
8
|
+
* react-select's Menu with an in-dropdown search input (plus optional reload button and footer)
|
|
9
|
+
* above the option list. Defined at module level with a stable identity so react-select never
|
|
10
|
+
* remounts it - which is what keeps the search input's focus, caret, and the MenuList scroll
|
|
11
|
+
* position alive across keystrokes. All live values arrive via {@link SelectMenuContext}.
|
|
12
|
+
*
|
|
13
|
+
* The search input sits inside the Menu but OUTSIDE the MenuList on purpose: react-select's
|
|
14
|
+
* onInputBlur refocuses its own control input if the active element is inside the MenuList, so
|
|
15
|
+
* keeping the search field outside stops that focus war; the caller's controlled menuIsOpen keeps
|
|
16
|
+
* the menu open.
|
|
17
|
+
*/
|
|
18
|
+
export declare function SelectMenu<IsMulti extends boolean = boolean, Group extends GroupBase<IOption> = GroupBase<IOption>>(props: MenuProps<IOption, IsMulti, Group>): ReactElement;
|
|
19
|
+
export declare namespace SelectMenu {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A single dropdown option (handles Select All, multi-select checkboxes, and the selected
|
|
24
|
+
* checkmark). Defined at module level with a stable identity so react-select never remounts it;
|
|
25
|
+
* live selection state arrives via {@link SelectOptionContext}. The label truncates to one line
|
|
26
|
+
* and, only when genuinely clipped (`useIsTruncated`), shows its full text on hover/focus in a
|
|
27
|
+
* `position:fixed` overlay - see {@link OptionLabelOverlay}.
|
|
28
|
+
*/
|
|
29
|
+
export declare function SelectOption<IsMulti extends boolean = boolean, Group extends GroupBase<IOption> = GroupBase<IOption>>(props: OptionProps<IOption, IsMulti, Group>): ReactElement;
|
|
30
|
+
export declare namespace SelectOption {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Builds the react-select custom components that are independent of the in-dropdown
|
|
35
|
+
* search/focus machinery (kept in select.tsx) and of per-option selection state (the Option is
|
|
36
|
+
* the stable {@link SelectOption} above). These are stateless, so recreating them per render is
|
|
37
|
+
* harmless - react-select only remounts the focus-sensitive Menu component.
|
|
38
|
+
*/
|
|
39
|
+
export declare function createSelectComponents<IsMulti extends boolean = false, Group extends GroupBase<IOption> = GroupBase<IOption>>(config: ISelectComponentsConfig): {
|
|
40
|
+
DropdownIndicator: (props: DropdownIndicatorProps<IOption, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
ValueContainer: ({ children, ...props }: ValueContainerProps<IOption, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
MultiValue: (props: MultiValueProps<IOption>) => import("react/jsx-runtime").JSX.Element | null;
|
|
43
|
+
MultiValueRemove: (props: MultiValueRemoveProps<IOption, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
Input: (props: InputProps<IOption, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
};
|
|
@@ -11,6 +11,11 @@ export declare const selectVariants: import("tailwind-variants").TVReturnType<{
|
|
|
11
11
|
base: string;
|
|
12
12
|
label: string;
|
|
13
13
|
helperText: string;
|
|
14
|
+
menuSearchContainer: string;
|
|
15
|
+
menuSearchInput: string;
|
|
16
|
+
optionLabelWrap: string;
|
|
17
|
+
optionLabel: string;
|
|
18
|
+
optionOverlay: string;
|
|
14
19
|
}, undefined, {
|
|
15
20
|
error: {
|
|
16
21
|
true: {
|
|
@@ -24,6 +29,11 @@ export declare const selectVariants: import("tailwind-variants").TVReturnType<{
|
|
|
24
29
|
base: string;
|
|
25
30
|
label: string;
|
|
26
31
|
helperText: string;
|
|
32
|
+
menuSearchContainer: string;
|
|
33
|
+
menuSearchInput: string;
|
|
34
|
+
optionLabelWrap: string;
|
|
35
|
+
optionLabel: string;
|
|
36
|
+
optionOverlay: string;
|
|
27
37
|
}, import("tailwind-variants").TVReturnType<{
|
|
28
38
|
error: {
|
|
29
39
|
true: {
|
|
@@ -37,4 +47,9 @@ export declare const selectVariants: import("tailwind-variants").TVReturnType<{
|
|
|
37
47
|
base: string;
|
|
38
48
|
label: string;
|
|
39
49
|
helperText: string;
|
|
50
|
+
menuSearchContainer: string;
|
|
51
|
+
menuSearchInput: string;
|
|
52
|
+
optionLabelWrap: string;
|
|
53
|
+
optionLabel: string;
|
|
54
|
+
optionOverlay: string;
|
|
40
55
|
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ReactNode, ReactElement, MutableRefObject, RefObject } from "react";
|
|
2
|
+
import type { Props as ReactSelectProps, GroupBase } from "react-select";
|
|
3
|
+
import { type TIconType } from "../adpIcon";
|
|
2
4
|
/**
|
|
3
5
|
* Available sizes for the Select component
|
|
4
6
|
*/
|
|
@@ -16,5 +18,140 @@ export type TSelectSize = `${ESelectSizes}`;
|
|
|
16
18
|
export interface IOption {
|
|
17
19
|
label: ReactNode;
|
|
18
20
|
value: any;
|
|
21
|
+
/** Plain-text used for searching when `label` is a ReactNode. Takes precedence over label/value. */
|
|
22
|
+
searchValue?: string;
|
|
19
23
|
isFixed?: boolean;
|
|
24
|
+
isDisabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props for the Select component
|
|
28
|
+
*/
|
|
29
|
+
export interface ISelectProps<IsMulti extends boolean = false, Group extends GroupBase<IOption> = GroupBase<IOption>> extends Omit<ReactSelectProps<IOption, IsMulti, Group>, "options" | "value" | "className" | "inputValue" | "onInputChange" | "isSearchable"> {
|
|
30
|
+
/** Unique id for the select input */
|
|
31
|
+
id?: string;
|
|
32
|
+
/** Custom className for wrapper */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Label displayed above select */
|
|
35
|
+
label?: ReactNode;
|
|
36
|
+
/** Select size variant */
|
|
37
|
+
size?: TSelectSize;
|
|
38
|
+
/** Options or groups to render */
|
|
39
|
+
options?: ReactSelectProps<IOption, IsMulti, Group>["options"];
|
|
40
|
+
/** Current value of the select */
|
|
41
|
+
value?: ReactSelectProps<IOption, IsMulti, Group>["value"];
|
|
42
|
+
/** Helper text displayed below */
|
|
43
|
+
helperText?: ReactNode;
|
|
44
|
+
/** Display error styling */
|
|
45
|
+
error?: boolean;
|
|
46
|
+
/** Disable the select */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** Enable creatable select */
|
|
49
|
+
creatable?: boolean;
|
|
50
|
+
/** Field touched state */
|
|
51
|
+
touched?: boolean;
|
|
52
|
+
/** Max number of visible values in multi */
|
|
53
|
+
maxVisibleValues?: number;
|
|
54
|
+
/** Label for truncated values */
|
|
55
|
+
maxVisibleValuesMsg?: string;
|
|
56
|
+
/** Custom footer in menu */
|
|
57
|
+
menuFooter?: ReactNode;
|
|
58
|
+
/** Prefix icon for the control */
|
|
59
|
+
prefixIcon?: TIconType | ReactNode;
|
|
60
|
+
/** Suffix icon for the control */
|
|
61
|
+
suffixIcon?: TIconType | ReactNode;
|
|
62
|
+
/** Placeholder text for the search input inside the dropdown */
|
|
63
|
+
searchPlaceholder?: string;
|
|
64
|
+
/** Tooltip for the select reload button. */
|
|
65
|
+
reloadTooltip?: string;
|
|
66
|
+
/** The reload button is shown when this is provided. Fired when the reload button is clicked. */
|
|
67
|
+
onReload?: () => void;
|
|
68
|
+
/** Spins the select reload button. */
|
|
69
|
+
isReloading?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Per-render option config for the SelectOption component. react-select keys custom components by
|
|
73
|
+
* reference and remounts them whenever that reference changes; the `customComponents` object in
|
|
74
|
+
* select.tsx is rebuilt every render. Feeding these live values through context (rather than a
|
|
75
|
+
* closure inside a freshly-created Option) lets SelectOption keep a stable module-level identity,
|
|
76
|
+
* so react-select re-renders it in place instead of remounting - which is what keeps the
|
|
77
|
+
* `useIsTruncated` measurement (and the hover-expand affordance) from flickering.
|
|
78
|
+
*/
|
|
79
|
+
export interface ISelectOptionContext {
|
|
80
|
+
/** In-progress multi-select draft. Drives checkboxes / Select All while the committed value drives the control. */
|
|
81
|
+
draftValues?: IOption[];
|
|
82
|
+
/** Toggle a single option in the multi-select draft. */
|
|
83
|
+
onToggleDraftOption?: (option: IOption) => void;
|
|
84
|
+
/** Toggle Select All / Deselect All on the multi-select draft (shared with the keyboard path). */
|
|
85
|
+
onSelectAll?: () => void;
|
|
86
|
+
/** tv() class for the label wrapper. */
|
|
87
|
+
optionLabelWrapClass: string;
|
|
88
|
+
/** tv() class for the (truncating) label. */
|
|
89
|
+
optionLabelClass: string;
|
|
90
|
+
/** tv() class for the hover/focus full-text overlay. */
|
|
91
|
+
optionOverlayClass: string;
|
|
92
|
+
/**
|
|
93
|
+
* Latest input modality, shared across every option. The full-text overlay follows the pointer
|
|
94
|
+
* (local `isHovered`) while the user is using the mouse, and react-select's `isFocused` while
|
|
95
|
+
* they're navigating by keyboard. Without this, react-select's `isFocused` - which lingers on the
|
|
96
|
+
* last-focused option after the pointer leaves, and is also set by mouse hover - keeps an
|
|
97
|
+
* overlay visible after the mouse has moved away (and shows two at once mid-transition).
|
|
98
|
+
*/
|
|
99
|
+
interactionModeRef: MutableRefObject<"pointer" | "keyboard">;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Live, per-instance config for the stable SelectMenu component. Mirrors {@link ISelectOptionContext}:
|
|
103
|
+
* routing these through context lets SelectMenu keep a module-level identity - so react-select never
|
|
104
|
+
* remounts it and the search input keeps its focus, caret, and scroll position across keystrokes -
|
|
105
|
+
* while still re-rendering with current values whenever they change. (A component closing over these
|
|
106
|
+
* directly would freeze them at first render, since its identity must never change.)
|
|
107
|
+
*/
|
|
108
|
+
export interface ISelectMenuContext {
|
|
109
|
+
/** Current search text (controls react-select's inputValue). */
|
|
110
|
+
filterQuery: string;
|
|
111
|
+
/** Called with the search input's new value. */
|
|
112
|
+
onFilterChange: (value: string) => void;
|
|
113
|
+
/** Placeholder for the search input. */
|
|
114
|
+
searchPlaceholder: string;
|
|
115
|
+
/** Optional custom footer rendered below the option list. */
|
|
116
|
+
menuFooter?: ReactNode;
|
|
117
|
+
/** Close the menu, discarding the multi-select draft. */
|
|
118
|
+
closeMenu: () => void;
|
|
119
|
+
/** Commit the multi-select draft, then close. */
|
|
120
|
+
commitAndClose: () => void;
|
|
121
|
+
/** tv() class for the search container. */
|
|
122
|
+
searchContainerClass: string;
|
|
123
|
+
/** tv() class for the search input. */
|
|
124
|
+
searchInputClass: string;
|
|
125
|
+
/** Ref to the search input; focused when the menu opens. */
|
|
126
|
+
searchInputRef: RefObject<HTMLInputElement>;
|
|
127
|
+
/** Captures the menu's (possibly portaled) DOM node for the outside-click check. */
|
|
128
|
+
menuNodeRef: MutableRefObject<HTMLDivElement | null>;
|
|
129
|
+
/** Ref to the component wrapper, used to reach react-select's hidden control input. */
|
|
130
|
+
containerRef: RefObject<HTMLDivElement>;
|
|
131
|
+
/** Shown when provided; fired on reload-button click. */
|
|
132
|
+
onReload?: () => void;
|
|
133
|
+
/** Spins/disables the reload button. */
|
|
134
|
+
isReloading?: boolean;
|
|
135
|
+
/** Reload-button tooltip / aria-label. */
|
|
136
|
+
reloadTooltip?: string;
|
|
137
|
+
/** Shared input-modality flag (see {@link ISelectOptionContext}); flipped to "keyboard" here. */
|
|
138
|
+
interactionModeRef: MutableRefObject<"pointer" | "keyboard">;
|
|
139
|
+
}
|
|
140
|
+
export interface IOptionLabelOverlayProps {
|
|
141
|
+
anchorRef: RefObject<HTMLElement>;
|
|
142
|
+
className: string;
|
|
143
|
+
children: ReactNode;
|
|
144
|
+
}
|
|
145
|
+
export interface ITruncatedMultiValueProps {
|
|
146
|
+
/** The plain-text label, used as the Tooltip title. */
|
|
147
|
+
label: string;
|
|
148
|
+
/** react-select's rendered chip (MultiValueContainer + label + remove). */
|
|
149
|
+
chip: ReactElement;
|
|
150
|
+
}
|
|
151
|
+
export interface ISelectComponentsConfig {
|
|
152
|
+
prefixIcon?: TIconType | ReactNode;
|
|
153
|
+
suffixIcon?: TIconType | ReactNode;
|
|
154
|
+
maxVisibleValues: number;
|
|
155
|
+
maxVisibleValuesMsg?: string;
|
|
156
|
+
disabled: boolean;
|
|
20
157
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type StylesConfig, type GroupBase } from "react-select";
|
|
2
2
|
import { type TSelectSize, type IOption } from "./types";
|
|
3
|
+
export declare const getSelectableOptions: (options: readonly (IOption | GroupBase<IOption>)[]) => IOption[];
|
|
4
|
+
export declare const areAllSelectableSelected: (options: readonly (IOption | GroupBase<IOption>)[], draft: IOption[]) => boolean;
|
|
3
5
|
export declare const reactSelectCustomStyles: <IsMulti extends boolean, Group extends GroupBase<IOption>>(error: boolean, size: TSelectSize, multiSelect: boolean) => StylesConfig<IOption, IsMulti, Group>;
|
|
@@ -105,15 +105,14 @@ export interface ITabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "
|
|
|
105
105
|
* Variant of the tab.
|
|
106
106
|
* @default text
|
|
107
107
|
*/
|
|
108
|
-
variant?: "filled" | "text" | "brick";
|
|
108
|
+
variant?: "filled" | "text" | "brick" | "contained";
|
|
109
109
|
/**
|
|
110
110
|
* Color of the tab. Only applicable for filled variant.
|
|
111
111
|
*/
|
|
112
112
|
color?: "primary" | "secondary";
|
|
113
113
|
}
|
|
114
|
-
|
|
115
|
-
type TTabsType = typeof TabsComponent & {
|
|
114
|
+
type TTabsType = React.ForwardRefExoticComponent<React.PropsWithoutRef<ITabsProps> & React.RefAttributes<HTMLDivElement>> & {
|
|
116
115
|
Tab: typeof Tab;
|
|
117
116
|
};
|
|
118
|
-
declare const Tabs: TTabsType;
|
|
119
|
-
export {
|
|
117
|
+
export declare const Tabs: TTabsType;
|
|
118
|
+
export {};
|
|
@@ -28,6 +28,10 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
|
|
|
28
28
|
filled: {
|
|
29
29
|
listItem: string;
|
|
30
30
|
};
|
|
31
|
+
contained: {
|
|
32
|
+
list: string;
|
|
33
|
+
listItem: string[];
|
|
34
|
+
};
|
|
31
35
|
};
|
|
32
36
|
color: {
|
|
33
37
|
primary: {};
|
|
@@ -72,6 +76,10 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
|
|
|
72
76
|
filled: {
|
|
73
77
|
listItem: string;
|
|
74
78
|
};
|
|
79
|
+
contained: {
|
|
80
|
+
list: string;
|
|
81
|
+
listItem: string[];
|
|
82
|
+
};
|
|
75
83
|
};
|
|
76
84
|
color: {
|
|
77
85
|
primary: {};
|
|
@@ -116,6 +124,10 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
|
|
|
116
124
|
filled: {
|
|
117
125
|
listItem: string;
|
|
118
126
|
};
|
|
127
|
+
contained: {
|
|
128
|
+
list: string;
|
|
129
|
+
listItem: string[];
|
|
130
|
+
};
|
|
119
131
|
};
|
|
120
132
|
color: {
|
|
121
133
|
primary: {};
|
|
@@ -18,14 +18,25 @@ export interface ITooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
18
18
|
className?: string;
|
|
19
19
|
/** Override trigger element class names */
|
|
20
20
|
triggerElementClassName?: string;
|
|
21
|
-
/** Callback executed on trigger click */
|
|
22
|
-
onTriggerClick?: () => void;
|
|
23
21
|
/** Render tooltip outside portal @default false */
|
|
24
22
|
renderOutsidePortal?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Opt a custom trigger into the "interactive" path. Native interactive
|
|
25
|
+
* elements (`button`, `a`, `summary`, `input`, `select`, `textarea`) are
|
|
26
|
+
* detected automatically, but a custom component (e.g. this library's
|
|
27
|
+
* `Button`) cannot be introspected. Set this when the trigger is a custom
|
|
28
|
+
* component that renders a real interactive element and forwards its `ref`
|
|
29
|
+
* and DOM props (`onClick`, `aria-*`, `className`) to it. When true the
|
|
30
|
+
* reference props are merged directly onto the trigger instead of wrapping it
|
|
31
|
+
* in a `span`. @default false
|
|
32
|
+
*/
|
|
33
|
+
interactiveTrigger?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Master gate for whether the tooltip may open. When `false` no interaction opens the popover and
|
|
36
|
+
* the wrapper leaves the tab order, but the trigger still renders exactly as normal.
|
|
37
|
+
* Gate it on a condition, e.g. `canOpen={isTruncated}`. @default true
|
|
38
|
+
*/
|
|
39
|
+
canOpen?: boolean;
|
|
29
40
|
}
|
|
30
41
|
export declare const Tooltip: React.ForwardRefExoticComponent<ITooltipProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
42
|
export {};
|
|
@@ -11,8 +11,8 @@ export declare const tooltipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
11
11
|
title: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
interactive: {
|
|
15
|
+
false: {
|
|
16
16
|
trigger: string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -35,8 +35,8 @@ export declare const tooltipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
35
35
|
title: string;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
interactive: {
|
|
39
|
+
false: {
|
|
40
40
|
trigger: string;
|
|
41
41
|
};
|
|
42
42
|
};
|
|
@@ -59,8 +59,8 @@ export declare const tooltipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
59
59
|
title: string;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
interactive: {
|
|
63
|
+
false: {
|
|
64
64
|
trigger: string;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ITransferListProps } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* A fully-controlled two-panel transfer list. Move items between the Available
|
|
5
|
+
* and Selected panels via checkboxes + arrow controls or native drag-and-drop.
|
|
6
|
+
* Rendering and ownership of any surrounding chrome (modal, footer) is left to
|
|
7
|
+
* the consumer.
|
|
8
|
+
*/
|
|
9
|
+
export declare function TransferList({ availableItems, selectedItems, onChange, availablePanelTitle, selectedPanelTitle, searchable, availableSearchTerm, onAvailableSearchChange, selectedSearchTerm, onSelectedSearchChange, searchPlaceholder, availablePanelHeaderSlot, selectedPanelHeaderSlot, moveToSelectedLabel, moveToAvailableLabel, reorderable, reloadTooltip, onReload, isReloading, hasMoreAvailable, onLoadMoreAvailable, isLoadingMoreAvailable, disabled, availableEmptyText, selectedEmptyText, className }: ITransferListProps): React.ReactElement;
|
|
10
|
+
export declare namespace TransferList {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|