@cloudwick/astral-ui 8.1.0 → 8.3.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 +1 -1
- package/dist/components/card/card.d.ts +20 -1
- package/dist/components/card/cardVariants.d.ts +28 -22
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/ctaGroup/ctaGroup.d.ts +16 -10
- package/dist/components/ctaGroup/ctaGroupVariants.d.ts +6 -6
- package/dist/components/ctaGroup/index.d.ts +1 -1
- package/dist/components/dataTable/DataTableColumnSettings.d.ts +2 -1
- package/dist/components/fileUpload/fileUpload.d.ts +2 -2
- package/dist/components/fileUpload/fileUploadVariants.d.ts +3 -0
- package/dist/components/modal/modal.d.ts +21 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferDropdown.d.ts +10 -4
- package/dist/components/multiSelectTransfer/multiSelectTransferDropdownHeader.d.ts +31 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferModal.d.ts +3 -1
- package/dist/components/multiSelectTransfer/multiSelectTransferOptionRow.d.ts +33 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferPill.d.ts +9 -2
- package/dist/components/multiSelectTransfer/multiSelectTransferTrigger.d.ts +8 -0
- package/dist/components/multiSelectTransfer/multiSelectTransferVariants.d.ts +54 -0
- package/dist/components/multiSelectTransfer/types.d.ts +9 -0
- package/dist/components/otp/input.d.ts +4 -0
- package/dist/components/pagination/paginationUtils.d.ts +17 -0
- package/dist/components/pagination/usePaginationCollapse.d.ts +22 -0
- package/dist/components/scrollbar/scrollbar.d.ts +7 -0
- package/dist/components/select/selectComponents.d.ts +14 -1
- package/dist/components/select/selectKeyboard.d.ts +28 -0
- package/dist/components/select/selectVariants.d.ts +15 -0
- package/dist/components/select/types.d.ts +23 -2
- package/dist/components/select/utils.d.ts +3 -0
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabsVariants.d.ts +3 -3
- package/dist/components/toast/toastVariants.d.ts +3 -3
- package/dist/components/toggle/toggle.d.ts +7 -3
- package/dist/components/toggle/toggleVariants.d.ts +3 -3
- package/dist/components/tooltip/tooltip.d.ts +16 -0
- package/dist/components/transferList/transferListItem.d.ts +6 -1
- package/dist/components/transferList/transferListPanel.d.ts +3 -1
- package/dist/components/transferList/transferListVariants.d.ts +3 -0
- package/dist/components/transferList/useTransferListSource.d.ts +2 -0
- package/dist/css/index.min.css +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useFilterQuery.d.ts +2 -2
- package/dist/hooks/useLabelPeekDismissal.d.ts +11 -0
- package/dist/index.cjs.js +5 -5
- package/dist/index.esm.js +5 -5
- package/dist/utils/fieldHelperText.d.ts +23 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/stringUtils/index.d.ts +2 -0
- package/dist/utils/stringUtils/joinIds.d.ts +10 -0
- package/dist/utils/stringUtils/resultsAvailable.d.ts +9 -0
- package/dist/utils/truncatedLabelReveal.d.ts +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,10 @@ export interface ICardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
34
34
|
* Props for the CTAGroup component. Pass an object with the props for the CTAGroup.
|
|
35
35
|
*/
|
|
36
36
|
ctaGroupProps?: ICTAGroupProps;
|
|
37
|
+
/**
|
|
38
|
+
* Insets the header from the card edges so the bottom divider aligns with the body content
|
|
39
|
+
*/
|
|
40
|
+
inset?: boolean;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* Card header component
|
|
@@ -46,14 +50,29 @@ export interface ICardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
46
50
|
declare const CardHeader: React.ForwardRefExoticComponent<ICardHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
51
|
/**
|
|
48
52
|
* Card body props
|
|
53
|
+
*
|
|
54
|
+
* A scrollable body must be named with `aria-label` or `aria-labelledby`, since it is exposed as a region.
|
|
49
55
|
*/
|
|
50
|
-
export type TCardBodyProps = React.HTMLAttributes<HTMLDivElement
|
|
56
|
+
export type TCardBodyProps = React.HTMLAttributes<HTMLDivElement> & ({
|
|
57
|
+
/**
|
|
58
|
+
* Makes the body a keyboard-focusable scroll region (`tabIndex={0}`, `role="region"`, `overflow-auto`).
|
|
59
|
+
* Use only when the body scrolls, e.g. when it has a constrained height.
|
|
60
|
+
*/
|
|
61
|
+
scrollable?: false;
|
|
62
|
+
} | {
|
|
63
|
+
scrollable: true;
|
|
64
|
+
"aria-label": string;
|
|
65
|
+
} | {
|
|
66
|
+
scrollable: true;
|
|
67
|
+
"aria-labelledby": string;
|
|
68
|
+
});
|
|
51
69
|
/**
|
|
52
70
|
* Card body component
|
|
53
71
|
*
|
|
54
72
|
* @example
|
|
55
73
|
* ```tsx
|
|
56
74
|
* <Card.Body>Card content goes here</Card.Body>
|
|
75
|
+
* <Card.Body scrollable aria-label="Activity" className="max-h-96">Long content</Card.Body>
|
|
57
76
|
* ```
|
|
58
77
|
*/
|
|
59
78
|
declare const CardBody: React.ForwardRefExoticComponent<TCardBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,41 +1,47 @@
|
|
|
1
1
|
export declare const cardVariants: import("tailwind-variants").TVReturnType<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
body?: import("tailwind-merge").ClassNameValue;
|
|
6
|
-
footer?: import("tailwind-merge").ClassNameValue;
|
|
7
|
-
header?: import("tailwind-merge").ClassNameValue;
|
|
2
|
+
inset: {
|
|
3
|
+
true: {
|
|
4
|
+
header: string;
|
|
8
5
|
};
|
|
9
6
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
base?: import("tailwind-merge").ClassNameValue;
|
|
14
|
-
body?: import("tailwind-merge").ClassNameValue;
|
|
15
|
-
footer?: import("tailwind-merge").ClassNameValue;
|
|
16
|
-
header?: import("tailwind-merge").ClassNameValue;
|
|
7
|
+
scrollable: {
|
|
8
|
+
true: {
|
|
9
|
+
body: string;
|
|
17
10
|
};
|
|
18
11
|
};
|
|
19
|
-
}
|
|
12
|
+
}, {
|
|
20
13
|
base: string;
|
|
21
14
|
header: string;
|
|
22
15
|
body: string;
|
|
23
16
|
footer: string;
|
|
24
17
|
}, undefined, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
body?: import("tailwind-merge").ClassNameValue;
|
|
29
|
-
footer?: import("tailwind-merge").ClassNameValue;
|
|
30
|
-
header?: import("tailwind-merge").ClassNameValue;
|
|
18
|
+
inset: {
|
|
19
|
+
true: {
|
|
20
|
+
header: string;
|
|
31
21
|
};
|
|
32
22
|
};
|
|
33
|
-
|
|
23
|
+
scrollable: {
|
|
24
|
+
true: {
|
|
25
|
+
body: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}, {
|
|
34
29
|
base: string;
|
|
35
30
|
header: string;
|
|
36
31
|
body: string;
|
|
37
32
|
footer: string;
|
|
38
|
-
}, import("tailwind-variants").TVReturnType<
|
|
33
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
34
|
+
inset: {
|
|
35
|
+
true: {
|
|
36
|
+
header: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
scrollable: {
|
|
40
|
+
true: {
|
|
41
|
+
body: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
39
45
|
base: string;
|
|
40
46
|
header: string;
|
|
41
47
|
body: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Card, CardHeader, CardBody, CardFooter, type ICardHeaderProps } from "./card";
|
|
1
|
+
export { Card, CardHeader, CardBody, CardFooter, type TCardProps, type ICardHeaderProps, type TCardBodyProps, type TCardFooterProps } from "./card";
|
|
2
2
|
export { cardVariants } from "./cardVariants";
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
export interface ICTAGroupItem {
|
|
3
|
+
/** Callback to execute when the CTA is clicked */
|
|
4
|
+
callback: () => void;
|
|
5
|
+
/** Icon to render inside the CTA */
|
|
6
|
+
icon: React.ReactNode;
|
|
7
|
+
/** Label for the CTA. Also shown as tooltip when shrink is false. */
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Overrides the accessible name of the icon-only CTA, which otherwise comes from `label`.
|
|
11
|
+
* When it differs from `label`, the tooltip text is announced as the button's description.
|
|
12
|
+
*/
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
/** Determines whether the CTA should be disabled */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
2
17
|
export interface ICTAGroupProps {
|
|
3
18
|
/**
|
|
4
19
|
* List of CTAs which render as icons or as dropdown items in case of mobile view
|
|
5
20
|
*/
|
|
6
|
-
ctaList:
|
|
7
|
-
/** Callback to execute when the CTA is clicked */
|
|
8
|
-
callback: () => void;
|
|
9
|
-
/** Icon to render inside the CTA */
|
|
10
|
-
icon: React.ReactNode;
|
|
11
|
-
/** Label for the CTA. Also shown as tooltip when shrink is false. */
|
|
12
|
-
label: React.ReactNode;
|
|
13
|
-
/** Determines whether the CTA should be disabled */
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
}[];
|
|
21
|
+
ctaList: ICTAGroupItem[];
|
|
16
22
|
/** Determines whether to show the CTAGroup as a dropdown */
|
|
17
23
|
shrink?: boolean;
|
|
18
24
|
/** Overwrite CTAGroup container styles */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const ctaGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
2
2
|
variant: {
|
|
3
3
|
icon: {
|
|
4
|
-
cta: string
|
|
4
|
+
cta: string;
|
|
5
5
|
};
|
|
6
6
|
button: {
|
|
7
|
-
cta: string
|
|
7
|
+
cta: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
}, {
|
|
@@ -14,10 +14,10 @@ export declare const ctaGroupVariants: import("tailwind-variants").TVReturnType<
|
|
|
14
14
|
}, undefined, {
|
|
15
15
|
variant: {
|
|
16
16
|
icon: {
|
|
17
|
-
cta: string
|
|
17
|
+
cta: string;
|
|
18
18
|
};
|
|
19
19
|
button: {
|
|
20
|
-
cta: string
|
|
20
|
+
cta: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
}, {
|
|
@@ -27,10 +27,10 @@ export declare const ctaGroupVariants: import("tailwind-variants").TVReturnType<
|
|
|
27
27
|
}, import("tailwind-variants").TVReturnType<{
|
|
28
28
|
variant: {
|
|
29
29
|
icon: {
|
|
30
|
-
cta: string
|
|
30
|
+
cta: string;
|
|
31
31
|
};
|
|
32
32
|
button: {
|
|
33
|
-
cta: string
|
|
33
|
+
cta: string;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
}, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CTAGroup, type ICTAGroupProps } from "./ctaGroup";
|
|
1
|
+
export { CTAGroup, type ICTAGroupProps, type ICTAGroupItem } from "./ctaGroup";
|
|
2
2
|
export { ctaGroupVariants } from "./ctaGroupVariants";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TColumn } from "./types";
|
|
2
|
-
export declare const DataTableColumnSettings: ({ columns, setColumns, isOpen, onClose }: {
|
|
2
|
+
export declare const DataTableColumnSettings: ({ id, columns, setColumns, isOpen, onClose }: {
|
|
3
|
+
id?: string;
|
|
3
4
|
columns: TColumn[];
|
|
4
5
|
setColumns: (columns: TColumn[]) => void;
|
|
5
6
|
isOpen: boolean;
|
|
@@ -25,8 +25,8 @@ export interface IFileUploadProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
maxFileSize?: number;
|
|
26
26
|
/** Function to retry uploading files that failed */
|
|
27
27
|
retryFailedUpload?: () => void;
|
|
28
|
-
/**
|
|
29
|
-
resetUploadState: () => void;
|
|
28
|
+
/** Called with the name of a removed file so its entry can be cleared from `uploadState`; other files' entries must be kept */
|
|
29
|
+
resetUploadState: (fileName: string) => void;
|
|
30
30
|
/** Function triggered after file validation to handle the upload logic */
|
|
31
31
|
handleUpload: (file: File | File[]) => void;
|
|
32
32
|
}
|
|
@@ -33,6 +33,7 @@ export declare const fileUploadVariants: import("tailwind-variants").TVReturnTyp
|
|
|
33
33
|
dropArea: string[];
|
|
34
34
|
iconWrapper: string;
|
|
35
35
|
icon: string;
|
|
36
|
+
infoText: string;
|
|
36
37
|
}, undefined, {
|
|
37
38
|
state: {
|
|
38
39
|
default: {
|
|
@@ -68,6 +69,7 @@ export declare const fileUploadVariants: import("tailwind-variants").TVReturnTyp
|
|
|
68
69
|
dropArea: string[];
|
|
69
70
|
iconWrapper: string;
|
|
70
71
|
icon: string;
|
|
72
|
+
infoText: string;
|
|
71
73
|
}, import("tailwind-variants").TVReturnType<{
|
|
72
74
|
state: {
|
|
73
75
|
default: {
|
|
@@ -103,4 +105,5 @@ export declare const fileUploadVariants: import("tailwind-variants").TVReturnTyp
|
|
|
103
105
|
dropArea: string[];
|
|
104
106
|
iconWrapper: string;
|
|
105
107
|
icon: string;
|
|
108
|
+
infoText: string;
|
|
106
109
|
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -39,6 +39,11 @@ export interface IModalProps {
|
|
|
39
39
|
* Callback function for onHide
|
|
40
40
|
*/
|
|
41
41
|
onHide?: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Accessible name for the dialog. Takes precedence over the name derived from Modal.Header, so use it
|
|
44
|
+
* when the header holds no title text (an icon, a search input) or when no header is rendered.
|
|
45
|
+
*/
|
|
46
|
+
"aria-label"?: string;
|
|
42
47
|
}
|
|
43
48
|
export interface IModalHeaderProps {
|
|
44
49
|
/**
|
|
@@ -59,6 +64,18 @@ export interface IModalBodyProps {
|
|
|
59
64
|
* Dynamically updates the classes applied to the component
|
|
60
65
|
*/
|
|
61
66
|
className?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Accessible name for the body while its content overflows and it becomes a focusable scroll region
|
|
69
|
+
* @default "Scrollable content"
|
|
70
|
+
*/
|
|
71
|
+
"aria-label"?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Reserves a 4px gutter (padding offset by negative margins) so focus rings on controls at the body's
|
|
74
|
+
* edges stay visible while it scrolls. A body that fits its content never clips, so this is only
|
|
75
|
+
* needed for long, scrolling content. It interacts with width, padding and margin overrides.
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
gutter?: boolean;
|
|
62
79
|
}
|
|
63
80
|
type TModalCompoundComponent = React.ForwardRefExoticComponent<React.PropsWithoutRef<IModalProps> & React.RefAttributes<HTMLDivElement>> & {
|
|
64
81
|
Header: typeof ModalHeader;
|
|
@@ -88,6 +105,10 @@ declare const ModalHeader: React.ForwardRefExoticComponent<IModalHeaderProps & R
|
|
|
88
105
|
/**
|
|
89
106
|
* Modal body component for rendering content inside the Modal.
|
|
90
107
|
*
|
|
108
|
+
* The body only becomes a scroll container once its content overflows, because a scroll container
|
|
109
|
+
* clips focus rings and shadows at its edges. Pass `gutter` to keep edge focus rings visible while
|
|
110
|
+
* it scrolls.
|
|
111
|
+
*
|
|
91
112
|
* @example
|
|
92
113
|
* ```tsx
|
|
93
114
|
* <Modal.Body>Modal content goes here</Modal.Body>
|
|
@@ -6,10 +6,12 @@ interface IMultiSelectTransferDropdownProps {
|
|
|
6
6
|
error?: boolean;
|
|
7
7
|
size: TMultiSelectTransferSize;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
/** Renders the in-dropdown search input. With `false` the option list itself owns focus. */
|
|
10
|
+
searchable: boolean;
|
|
9
11
|
filterQuery: string;
|
|
10
12
|
onFilterInput: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
-
onFilterKeyDown: (e: React.KeyboardEvent<
|
|
12
|
-
onFilterKeyUp: (e: React.KeyboardEvent<
|
|
13
|
+
onFilterKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
14
|
+
onFilterKeyUp: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
13
15
|
onFilterBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
14
16
|
searchPlaceholder: string;
|
|
15
17
|
/** Readonly so the option source's pool can be passed through without a defensive copy. */
|
|
@@ -19,6 +21,10 @@ interface IMultiSelectTransferDropdownProps {
|
|
|
19
21
|
hasSelectAll: boolean;
|
|
20
22
|
areAllSelected: boolean;
|
|
21
23
|
onSelectAll: () => void;
|
|
24
|
+
/** Escape from anywhere in the dropdown: discard the draft and close. */
|
|
25
|
+
onCancel: () => void;
|
|
26
|
+
/** Tab out of the dropdown's last (or Shift+Tab out of its first) control: commit and close. */
|
|
27
|
+
onCommit: () => void;
|
|
22
28
|
/** Any load in flight; renders the loader row below the list. */
|
|
23
29
|
isLoading?: boolean;
|
|
24
30
|
/**
|
|
@@ -40,10 +46,10 @@ interface IMultiSelectTransferDropdownProps {
|
|
|
40
46
|
isReloading?: boolean;
|
|
41
47
|
}
|
|
42
48
|
/**
|
|
43
|
-
* The open-state dropdown for MultiSelectTransfer:
|
|
49
|
+
* The open-state dropdown for MultiSelectTransfer: an optional search input, an optional "Select All"
|
|
44
50
|
* row, the (draft-checked) option list, and the infinite-scroll sentinel.
|
|
45
51
|
*/
|
|
46
|
-
export declare function MultiSelectTransferDropdown({ error, size, disabled, filterQuery, onFilterInput, onFilterKeyDown, onFilterKeyUp, onFilterBlur, searchPlaceholder, options, selectedValues, onOptionToggle, hasSelectAll, areAllSelected, onSelectAll, isLoading, isSearchFetch, sentinelRef, loadError, loadMoreError, onRetryLoadMore, retryLabel, reloadTooltip, onReload, isReloading }: IMultiSelectTransferDropdownProps): React.ReactElement;
|
|
52
|
+
export declare function MultiSelectTransferDropdown({ error, size, disabled, searchable, filterQuery, onFilterInput, onFilterKeyDown, onFilterKeyUp, onFilterBlur, searchPlaceholder, options, selectedValues, onOptionToggle, hasSelectAll, areAllSelected, onSelectAll, onCancel, onCommit, isLoading, isSearchFetch, sentinelRef, loadError, loadMoreError, onRetryLoadMore, retryLabel, reloadTooltip, onReload, isReloading }: IMultiSelectTransferDropdownProps): React.ReactElement;
|
|
47
53
|
export declare namespace MultiSelectTransferDropdown {
|
|
48
54
|
var displayName: string;
|
|
49
55
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface IMultiSelectTransferDropdownHeaderProps {
|
|
3
|
+
/** tv() class for the strip itself, resolved by the dropdown that owns the variant config. */
|
|
4
|
+
headerClass: string;
|
|
5
|
+
/** tv() class for the search input. */
|
|
6
|
+
filterInputClass: string;
|
|
7
|
+
/** Renders the search input. With `false` the header holds only the reload affordance. */
|
|
8
|
+
searchable: boolean;
|
|
9
|
+
filterQuery: string;
|
|
10
|
+
onFilterInput: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
onFilterKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
12
|
+
onFilterKeyUp: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
13
|
+
onFilterBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
14
|
+
searchPlaceholder: string;
|
|
15
|
+
/** The listbox this combobox drives, and the row its activedescendant points at. */
|
|
16
|
+
listboxId: string;
|
|
17
|
+
activeDescendant?: string;
|
|
18
|
+
reloadTooltip?: string;
|
|
19
|
+
onReload?: () => void;
|
|
20
|
+
isReloading?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The chrome above the dropdown's option list: the search input — a combobox driving the listbox
|
|
24
|
+
* below it through `aria-activedescendant` — and the optional reload button. With neither on screen
|
|
25
|
+
* it renders nothing, so the rows start at the top of the dropdown rather than under an empty bar.
|
|
26
|
+
*/
|
|
27
|
+
export declare function MultiSelectTransferDropdownHeader({ headerClass, filterInputClass, searchable, filterQuery, onFilterInput, onFilterKeyDown, onFilterKeyUp, onFilterBlur, searchPlaceholder, listboxId, activeDescendant, reloadTooltip, onReload, isReloading }: IMultiSelectTransferDropdownHeaderProps): React.ReactElement | null;
|
|
28
|
+
export declare namespace MultiSelectTransferDropdownHeader {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -14,6 +14,8 @@ interface IMultiSelectTransferModalProps {
|
|
|
14
14
|
reloadTooltip?: string;
|
|
15
15
|
onReload?: () => void;
|
|
16
16
|
isReloading?: boolean;
|
|
17
|
+
/** Renders both panels' search inputs; forwarded straight to TransferList. */
|
|
18
|
+
searchable?: boolean;
|
|
17
19
|
searchPlaceholder?: string;
|
|
18
20
|
availablePanelHeaderSlot?: React.ReactNode;
|
|
19
21
|
selectedPanelHeaderSlot?: React.ReactNode;
|
|
@@ -39,7 +41,7 @@ interface IMultiSelectTransferModalProps {
|
|
|
39
41
|
* The transfer-list modal surface for MultiSelectTransfer: full-screen on mobile, a widened
|
|
40
42
|
* centered dialog from sm up. Hosts the two-panel TransferList plus a pinned footer bar.
|
|
41
43
|
*/
|
|
42
|
-
export declare function MultiSelectTransferModal({ showModal, availableItems, selectedItems, onChange, onCancel, onDone, header, title, subtitle, reorderable, reloadTooltip, onReload, isReloading, searchPlaceholder, availablePanelHeaderSlot, selectedPanelHeaderSlot, hasMoreAvailable, onLoadMoreAvailable, isLoadingAvailable, isLoadingMoreAvailable, availableLoadError, availableLoadMoreError, onRetryLoadMoreAvailable, retryLabel, availableTotalCount, availableSearchTerm, onAvailableSearchChange, cancelLabel, doneLabel }: IMultiSelectTransferModalProps): React.ReactElement;
|
|
44
|
+
export declare function MultiSelectTransferModal({ showModal, availableItems, selectedItems, onChange, onCancel, onDone, header, title, subtitle, reorderable, reloadTooltip, onReload, isReloading, searchable, searchPlaceholder, availablePanelHeaderSlot, selectedPanelHeaderSlot, hasMoreAvailable, onLoadMoreAvailable, isLoadingAvailable, isLoadingMoreAvailable, availableLoadError, availableLoadMoreError, onRetryLoadMoreAvailable, retryLabel, availableTotalCount, availableSearchTerm, onAvailableSearchChange, cancelLabel, doneLabel }: IMultiSelectTransferModalProps): React.ReactElement;
|
|
43
45
|
export declare namespace MultiSelectTransferModal {
|
|
44
46
|
var displayName: string;
|
|
45
47
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface IOptionRowProps {
|
|
3
|
+
id: string;
|
|
4
|
+
/** 1-based position and list length, so a windowed list still reports where the row sits. */
|
|
5
|
+
posInSet: number;
|
|
6
|
+
setSize: number;
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
checked: boolean;
|
|
9
|
+
active: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Escape has hidden the label reveal (see useLabelPeekDismissal). */
|
|
12
|
+
isPeekDismissed: boolean;
|
|
13
|
+
onToggle: () => void;
|
|
14
|
+
onActivate: () => void;
|
|
15
|
+
onMouseEnter: () => void;
|
|
16
|
+
optionItemClass: string | undefined;
|
|
17
|
+
optionLabelWrapClass: string;
|
|
18
|
+
optionLabelClass: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A single dropdown row (both "Select All" and regular options): checkbox + label. Measures
|
|
22
|
+
* its own label via `useIsTruncated` so the hover/focus expand affordance (see
|
|
23
|
+
* multiSelectTransferVariants' optionLabel) only ever shows up on rows whose text is actually
|
|
24
|
+
* clipped.
|
|
25
|
+
*
|
|
26
|
+
* Rows are not individually tabbable: focus sits on the single tab stop above them — the filter input
|
|
27
|
+
* (a combobox) where the search is shown, otherwise the listbox itself — and keyboard navigation is
|
|
28
|
+
* driven from there by `aria-activedescendant` / arrow keys. `active` marks the row the arrow keys
|
|
29
|
+
* have landed on so it can be highlighted and scrolled into view; the pointer path still toggles on
|
|
30
|
+
* click / activates on hover. The keyboard-active row reveals a truncated label just as a hovered one does.
|
|
31
|
+
*/
|
|
32
|
+
export declare function OptionRow({ id, posInSet, setSize, label, checked, active, disabled, isPeekDismissed, onToggle, onActivate, onMouseEnter, optionItemClass, optionLabelWrapClass, optionLabelClass }: IOptionRowProps): React.ReactElement;
|
|
33
|
+
export {};
|
|
@@ -2,11 +2,13 @@ import * as React from "react";
|
|
|
2
2
|
import { type TMultiSelectTransferOption } from "./types";
|
|
3
3
|
interface IMultiSelectTransferPillProps {
|
|
4
4
|
option: TMultiSelectTransferOption;
|
|
5
|
+
/** Id of the label element, so the trigger can include the label in its accessible name. */
|
|
6
|
+
labelId: string;
|
|
5
7
|
/** tv() class for the pill container (doubles as the truncation observer root). */
|
|
6
8
|
pillClass: string;
|
|
7
9
|
/** tv() class for the (truncating) label. */
|
|
8
10
|
pillLabelClass: string;
|
|
9
|
-
/** tv() class for the dismiss
|
|
11
|
+
/** tv() class for the dismiss control. */
|
|
10
12
|
pillDismissClass: string;
|
|
11
13
|
onRemove: (option: TMultiSelectTransferOption, e: React.MouseEvent) => void;
|
|
12
14
|
}
|
|
@@ -20,8 +22,13 @@ interface IMultiSelectTransferPillProps {
|
|
|
20
22
|
* its target. `triggerElementClassName` makes the Tooltip's trigger span a shrinkable flex box so
|
|
21
23
|
* the nested label still truncates against the pill's max-width. Non-string (ReactNode) labels
|
|
22
24
|
* have no text to show, so they render plainly.
|
|
25
|
+
*
|
|
26
|
+
* The pill sits inside the trigger's `role="button"`, which may hold no focusable content, so the
|
|
27
|
+
* tooltip opens on hover only and the dismiss "X" is pointer-only and hidden from assistive tech. The
|
|
28
|
+
* trigger's accessible name already carries every visible label, and an option is removed from the
|
|
29
|
+
* keyboard by unticking it in the dropdown or the transfer list.
|
|
23
30
|
*/
|
|
24
|
-
export declare function MultiSelectTransferPill({ option, pillClass, pillLabelClass, pillDismissClass, onRemove }: IMultiSelectTransferPillProps): React.ReactElement;
|
|
31
|
+
export declare function MultiSelectTransferPill({ option, labelId, pillClass, pillLabelClass, pillDismissClass, onRemove }: IMultiSelectTransferPillProps): React.ReactElement;
|
|
25
32
|
export declare namespace MultiSelectTransferPill {
|
|
26
33
|
var displayName: string;
|
|
27
34
|
}
|
|
@@ -2,6 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import type { TMultiSelectTransferOption, TMultiSelectTransferSize } from "./types";
|
|
3
3
|
interface IMultiSelectTransferTriggerProps {
|
|
4
4
|
id: string;
|
|
5
|
+
/** Id of the field's visible label; the trigger's accessible name is the label followed by the selected labels. */
|
|
6
|
+
labelId?: string;
|
|
7
|
+
/** Id of the helper text element that describes the trigger. */
|
|
8
|
+
helperTextId: string;
|
|
5
9
|
error?: boolean;
|
|
6
10
|
size: TMultiSelectTransferSize;
|
|
7
11
|
disabled: boolean;
|
|
@@ -19,6 +23,10 @@ interface IMultiSelectTransferTriggerProps {
|
|
|
19
23
|
* The read-only control for MultiSelectTransfer: committed pills (capped by `maxVisiblePills` with a
|
|
20
24
|
* "+N More" overflow), the transfer-list CTA and the open/close chevron. It owns no state.
|
|
21
25
|
*
|
|
26
|
+
* The field box is a plain wrapper that toggles on click anywhere inside it. The focusable
|
|
27
|
+
* `role="button"` covers the pills only, and the CTA button sits beside it rather than inside it: a
|
|
28
|
+
* button's content is presentational, so a control nested in one is hidden from assistive tech.
|
|
29
|
+
*
|
|
22
30
|
* The trigger comes back through `forwardRef`, not a `triggerRef` prop: a ref taken as an ordinary
|
|
23
31
|
* prop cannot be merged with a caller's own, and is invisible to anything composing over `ref`.
|
|
24
32
|
*/
|
|
@@ -41,6 +41,23 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
41
41
|
};
|
|
42
42
|
false: {};
|
|
43
43
|
};
|
|
44
|
+
optionDisabled: {
|
|
45
|
+
true: {
|
|
46
|
+
optionItem: string;
|
|
47
|
+
};
|
|
48
|
+
false: {};
|
|
49
|
+
};
|
|
50
|
+
active: {
|
|
51
|
+
true: {
|
|
52
|
+
optionItem: string;
|
|
53
|
+
};
|
|
54
|
+
false: {};
|
|
55
|
+
};
|
|
56
|
+
searchable: {
|
|
57
|
+
false: {
|
|
58
|
+
dropdownHeader: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
44
61
|
}, {
|
|
45
62
|
base: string;
|
|
46
63
|
label: string;
|
|
@@ -50,6 +67,7 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
50
67
|
dropdownHeader: string;
|
|
51
68
|
filterInput: string;
|
|
52
69
|
optionsList: string;
|
|
70
|
+
optionsListbox: string;
|
|
53
71
|
noOptionsMessage: string;
|
|
54
72
|
loaderRow: string;
|
|
55
73
|
errorMessage: string;
|
|
@@ -108,6 +126,23 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
108
126
|
};
|
|
109
127
|
false: {};
|
|
110
128
|
};
|
|
129
|
+
optionDisabled: {
|
|
130
|
+
true: {
|
|
131
|
+
optionItem: string;
|
|
132
|
+
};
|
|
133
|
+
false: {};
|
|
134
|
+
};
|
|
135
|
+
active: {
|
|
136
|
+
true: {
|
|
137
|
+
optionItem: string;
|
|
138
|
+
};
|
|
139
|
+
false: {};
|
|
140
|
+
};
|
|
141
|
+
searchable: {
|
|
142
|
+
false: {
|
|
143
|
+
dropdownHeader: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
111
146
|
}, {
|
|
112
147
|
base: string;
|
|
113
148
|
label: string;
|
|
@@ -117,6 +152,7 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
117
152
|
dropdownHeader: string;
|
|
118
153
|
filterInput: string;
|
|
119
154
|
optionsList: string;
|
|
155
|
+
optionsListbox: string;
|
|
120
156
|
noOptionsMessage: string;
|
|
121
157
|
loaderRow: string;
|
|
122
158
|
errorMessage: string;
|
|
@@ -175,6 +211,23 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
175
211
|
};
|
|
176
212
|
false: {};
|
|
177
213
|
};
|
|
214
|
+
optionDisabled: {
|
|
215
|
+
true: {
|
|
216
|
+
optionItem: string;
|
|
217
|
+
};
|
|
218
|
+
false: {};
|
|
219
|
+
};
|
|
220
|
+
active: {
|
|
221
|
+
true: {
|
|
222
|
+
optionItem: string;
|
|
223
|
+
};
|
|
224
|
+
false: {};
|
|
225
|
+
};
|
|
226
|
+
searchable: {
|
|
227
|
+
false: {
|
|
228
|
+
dropdownHeader: string;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
178
231
|
}, {
|
|
179
232
|
base: string;
|
|
180
233
|
label: string;
|
|
@@ -184,6 +237,7 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
184
237
|
dropdownHeader: string;
|
|
185
238
|
filterInput: string;
|
|
186
239
|
optionsList: string;
|
|
240
|
+
optionsListbox: string;
|
|
187
241
|
noOptionsMessage: string;
|
|
188
242
|
loaderRow: string;
|
|
189
243
|
errorMessage: string;
|
|
@@ -50,6 +50,15 @@ export interface IMultiSelectTransferProps {
|
|
|
50
50
|
* With `loadOptions`: notification-only, for analytics or `filterValue` syncing.
|
|
51
51
|
*/
|
|
52
52
|
onFilterChange?: (query: string) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Renders the dropdown's search input and the transfer list modal's two panel search inputs. With
|
|
55
|
+
* `false` the dropdown's option list becomes the focused widget on open and owns the keyboard
|
|
56
|
+
* (`role="listbox"` plus `aria-activedescendant`), so Escape, Tab, the arrows, Home/End and Enter
|
|
57
|
+
* behave as they do with the input present, and Space activates the active row. Only the ability to
|
|
58
|
+
* narrow the list is gone, which suits short, fixed option sets. The reload button is unaffected.
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
searchable?: boolean;
|
|
53
62
|
/** Placeholder for the dropdown filter input and the transfer list modal's panel search inputs. @default "Search..." */
|
|
54
63
|
searchPlaceholder?: string;
|
|
55
64
|
/** Debounce for the search query, in both sync and `loadOptions` mode. Set to 0 to disable. @default 300 */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type TPageItem = number | "ellipsis-start" | "ellipsis-end";
|
|
2
|
+
/**
|
|
3
|
+
* Slot budgets for the page list, widest first. Every budget renders a different list, and the
|
|
4
|
+
* last one is always a single slot for the active page.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getSlotBudgets: (totalPages: number) => number[];
|
|
7
|
+
/**
|
|
8
|
+
* Pages and ellipses to render within `slots` items, around `requestedPage` clamped to the range.
|
|
9
|
+
*
|
|
10
|
+
* - All pages when they fit.
|
|
11
|
+
* - Five or more slots: the first and last page stay visible, with the active page and an equal
|
|
12
|
+
* number of siblings either side between two ellipses. Near either end the ellipsis on that
|
|
13
|
+
* side is dropped, so an ellipsis always hides at least two pages.
|
|
14
|
+
* - Three slots: the active page and its neighbours.
|
|
15
|
+
* - One slot: the active page.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getPageItems: (totalPages: number, requestedPage: number, slots: number) => TPageItem[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface IUsePaginationCollapseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Stages are numbered from widest (`minStage`) to narrowest (`maxStage`).
|
|
5
|
+
*/
|
|
6
|
+
minStage: number;
|
|
7
|
+
maxStage: number;
|
|
8
|
+
/**
|
|
9
|
+
* Any change to this key restarts the collapse from `minStage`.
|
|
10
|
+
*/
|
|
11
|
+
resetKey: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Picks the widest collapse stage whose content fits on one line inside the element.
|
|
15
|
+
*
|
|
16
|
+
* Collapsing steps one stage per layout pass. When the element, its parent or the viewport
|
|
17
|
+
* resizes, the stage is reset to `minStage` and collapsed again inside a single `flushSync`, so
|
|
18
|
+
* growing back works even when the element is sized by a shrink-to-fit parent, and intermediate
|
|
19
|
+
* stages are never painted.
|
|
20
|
+
*/
|
|
21
|
+
export declare const usePaginationCollapse: (ref: React.RefObject<HTMLElement>, { minStage, maxStage, resetKey }: IUsePaginationCollapseOptions) => number;
|
|
22
|
+
export {};
|
|
@@ -41,6 +41,13 @@ export interface IScrollbarProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
41
41
|
* areas so they don't clutter landmark navigation.
|
|
42
42
|
*/
|
|
43
43
|
"aria-label"?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Whether overflowing content makes the scroll area a Tab stop. Set it to false when an ancestor
|
|
46
|
+
* already scrolls this content from the keyboard - a listbox moving `aria-activedescendant`, for
|
|
47
|
+
* example - so the area does not add a second, inert stop inside that widget.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
focusable?: boolean;
|
|
44
51
|
}
|
|
45
52
|
/**
|
|
46
53
|
* Scrollbar component provides a custom scrollbar with support for both vertical and horizontal scrolling.
|