@cloudwick/astral-ui 8.2.0 → 8.4.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/button/button.d.ts +2 -0
- 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/index.d.ts +1 -1
- package/dist/components/modal/modal.d.ts +48 -4
- package/dist/components/modal/modalContext.d.ts +22 -0
- package/dist/components/modal/modalTitle.d.ts +21 -0
- package/dist/components/modal/modalVariants.d.ts +18 -3
- package/dist/components/multiSelectTransfer/multiSelectTransferDropdown.d.ts +5 -1
- package/dist/components/multiSelectTransfer/multiSelectTransferOptionRow.d.ts +8 -2
- 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 +36 -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/panel/panelContext.d.ts +7 -0
- package/dist/components/scrollbar/scrollbar.d.ts +7 -0
- package/dist/components/select/selectKeyboard.d.ts +11 -5
- package/dist/components/select/types.d.ts +9 -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 +2 -0
- package/dist/hooks/useLabelPeekDismissal.d.ts +11 -0
- package/dist/hooks/usePartRegistration.d.ts +10 -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
|
@@ -58,6 +58,8 @@ export interface IButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButton
|
|
|
58
58
|
* This prop accepts a ReactNode, if this is passed then the button will render
|
|
59
59
|
* tooltip on hover of the button.
|
|
60
60
|
* This tooltip is only on hover and not on click.
|
|
61
|
+
* A string tooltip on a button without text also becomes the button's `aria-label`, unless
|
|
62
|
+
* `aria-label` or `aria-labelledby` is passed.
|
|
61
63
|
*/
|
|
62
64
|
tooltip?: React.ReactNode;
|
|
63
65
|
/**
|
|
@@ -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>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Modal, ModalHeader, ModalBody, type IModalProps, type IModalHeaderProps, type IModalBodyProps } from "./modal";
|
|
1
|
+
export { Modal, ModalHeader, ModalTitle, ModalBody, type IModalProps, type IModalHeaderProps, type IModalTitleProps, type IModalBodyProps } from "./modal";
|
|
2
2
|
export { modalVariants } from "./modalVariants";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ModalTitle, type IModalTitleProps } from "./modalTitle";
|
|
2
3
|
export interface IModalProps {
|
|
3
4
|
/**
|
|
4
5
|
* Control modal's visibility
|
|
@@ -39,6 +40,25 @@ export interface IModalProps {
|
|
|
39
40
|
* Callback function for onHide
|
|
40
41
|
*/
|
|
41
42
|
onHide?: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Accessible name for the dialog. Takes precedence over the name derived from Modal.Title or Modal.Header,
|
|
45
|
+
* so use it when the header holds no title text (an icon, a search input) or when no header is rendered.
|
|
46
|
+
*/
|
|
47
|
+
"aria-label"?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Id of the element that names the dialog. Takes precedence over Modal.Title, Modal.Header and `aria-label`.
|
|
50
|
+
*/
|
|
51
|
+
"aria-labelledby"?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Id of the element that describes the dialog, or `false` for no description.
|
|
54
|
+
* @default the id of the rendered Modal.Body, unless it contains the Modal.Title
|
|
55
|
+
*/
|
|
56
|
+
"aria-describedby"?: string | false;
|
|
57
|
+
/**
|
|
58
|
+
* Accessible name of the built-in close button
|
|
59
|
+
* @default "Close"
|
|
60
|
+
*/
|
|
61
|
+
closeButtonLabel?: string;
|
|
42
62
|
}
|
|
43
63
|
export interface IModalHeaderProps {
|
|
44
64
|
/**
|
|
@@ -59,9 +79,22 @@ export interface IModalBodyProps {
|
|
|
59
79
|
* Dynamically updates the classes applied to the component
|
|
60
80
|
*/
|
|
61
81
|
className?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Accessible name for the body while its content overflows and it becomes a focusable scroll region
|
|
84
|
+
* @default "Scrollable content"
|
|
85
|
+
*/
|
|
86
|
+
"aria-label"?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Reserves a 4px gutter (padding offset by negative margins) so focus rings on controls at the body's
|
|
89
|
+
* edges stay visible while it scrolls. A body that fits its content never clips, so this is only
|
|
90
|
+
* needed for long, scrolling content. It interacts with width, padding and margin overrides.
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
gutter?: boolean;
|
|
62
94
|
}
|
|
63
95
|
type TModalCompoundComponent = React.ForwardRefExoticComponent<React.PropsWithoutRef<IModalProps> & React.RefAttributes<HTMLDivElement>> & {
|
|
64
96
|
Header: typeof ModalHeader;
|
|
97
|
+
Title: typeof ModalTitle;
|
|
65
98
|
Body: typeof ModalBody;
|
|
66
99
|
};
|
|
67
100
|
/**
|
|
@@ -70,28 +103,39 @@ type TModalCompoundComponent = React.ForwardRefExoticComponent<React.PropsWithou
|
|
|
70
103
|
* @example
|
|
71
104
|
* ```tsx
|
|
72
105
|
* <Modal showModal={modalVisible} onHide={() => setModalVisible(false)}>
|
|
73
|
-
* <Modal.Header>
|
|
106
|
+
* <Modal.Header>
|
|
107
|
+
* <Modal.Title>Modal Title</Modal.Title>
|
|
108
|
+
* </Modal.Header>
|
|
74
109
|
* <Modal.Body>Modal content goes here</Modal.Body>
|
|
75
110
|
* </Modal>
|
|
76
111
|
* ```
|
|
77
112
|
*/
|
|
78
113
|
export declare const Modal: TModalCompoundComponent;
|
|
79
114
|
/**
|
|
80
|
-
* Modal header component for
|
|
115
|
+
* Modal header component. With a Modal.Title inside, it is a layout row for the title and any actions;
|
|
116
|
+
* without one, the whole header is the dialog's heading and name.
|
|
81
117
|
*
|
|
82
118
|
* @example
|
|
83
119
|
* ```tsx
|
|
84
|
-
* <Modal.Header>
|
|
120
|
+
* <Modal.Header>
|
|
121
|
+
* <Modal.Title>Modal Title</Modal.Title>
|
|
122
|
+
* <Button aria-label="Download" prefixIcon="download" />
|
|
123
|
+
* </Modal.Header>
|
|
85
124
|
* ```
|
|
86
125
|
*/
|
|
87
126
|
declare const ModalHeader: React.ForwardRefExoticComponent<IModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
88
127
|
/**
|
|
89
128
|
* Modal body component for rendering content inside the Modal.
|
|
90
129
|
*
|
|
130
|
+
* The body only becomes a scroll container once its content overflows, because a scroll container
|
|
131
|
+
* clips focus rings and shadows at its edges. Pass `gutter` to keep edge focus rings visible while
|
|
132
|
+
* it scrolls.
|
|
133
|
+
*
|
|
91
134
|
* @example
|
|
92
135
|
* ```tsx
|
|
93
136
|
* <Modal.Body>Modal content goes here</Modal.Body>
|
|
94
137
|
* ```
|
|
95
138
|
*/
|
|
96
139
|
declare const ModalBody: React.ForwardRefExoticComponent<IModalBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
97
|
-
export { ModalHeader, ModalBody };
|
|
140
|
+
export { ModalHeader, ModalTitle, ModalBody };
|
|
141
|
+
export type { IModalTitleProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface IModalContext {
|
|
3
|
+
labelId: string;
|
|
4
|
+
descId: string;
|
|
5
|
+
closeButton: boolean;
|
|
6
|
+
titleRendered: boolean;
|
|
7
|
+
setHeaderMounted: (mounted: boolean) => void;
|
|
8
|
+
setTitleMounted: (mounted: boolean) => void;
|
|
9
|
+
setTitleInBodyMounted: (mounted: boolean) => void;
|
|
10
|
+
setBodyMounted: (mounted: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const ModalContext: React.Context<IModalContext | null>;
|
|
13
|
+
/**
|
|
14
|
+
* True inside Modal.Body. A Modal.Title there would otherwise be both the dialog's name and part of its
|
|
15
|
+
* description, which describes the dialog with the whole body.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ModalBodyContext: React.Context<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* Development warnings for a dialog with no accessible name, and for a heading that contains controls,
|
|
20
|
+
* which then become part of the heading and of the dialog's name. Warns once per Modal instance.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useModalNameWarnings(dialog: HTMLElement | null, labelId: string, named: boolean, titleRendered: boolean): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface IModalTitleProps {
|
|
3
|
+
/**
|
|
4
|
+
* Title text of the Modal
|
|
5
|
+
*/
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Dynamically updates the classes applied to the component
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Modal title component. It is the dialog's heading and names the dialog, so the header's actions stay
|
|
14
|
+
* out of the name. Place it inside Modal.Header, or in Modal.Body for dialogs that show the title there.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Modal.Title>Modal Title</Modal.Title>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const ModalTitle: React.ForwardRefExoticComponent<IModalTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
export declare const modalVariants: import("tailwind-variants").TVReturnType<{
|
|
2
2
|
headerless: {
|
|
3
|
+
true: {};
|
|
4
|
+
};
|
|
5
|
+
closeButton: {
|
|
3
6
|
true: {
|
|
4
|
-
|
|
7
|
+
header: string;
|
|
5
8
|
};
|
|
6
9
|
};
|
|
7
10
|
}, {
|
|
8
11
|
container: string[];
|
|
9
12
|
modal: string[];
|
|
13
|
+
header: string;
|
|
14
|
+
title: string;
|
|
10
15
|
}, undefined, {
|
|
11
16
|
headerless: {
|
|
17
|
+
true: {};
|
|
18
|
+
};
|
|
19
|
+
closeButton: {
|
|
12
20
|
true: {
|
|
13
|
-
|
|
21
|
+
header: string;
|
|
14
22
|
};
|
|
15
23
|
};
|
|
16
24
|
}, {
|
|
17
25
|
container: string[];
|
|
18
26
|
modal: string[];
|
|
27
|
+
header: string;
|
|
28
|
+
title: string;
|
|
19
29
|
}, import("tailwind-variants").TVReturnType<{
|
|
20
30
|
headerless: {
|
|
31
|
+
true: {};
|
|
32
|
+
};
|
|
33
|
+
closeButton: {
|
|
21
34
|
true: {
|
|
22
|
-
|
|
35
|
+
header: string;
|
|
23
36
|
};
|
|
24
37
|
};
|
|
25
38
|
}, {
|
|
26
39
|
container: string[];
|
|
27
40
|
modal: string[];
|
|
41
|
+
header: string;
|
|
42
|
+
title: string;
|
|
28
43
|
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -21,6 +21,10 @@ interface IMultiSelectTransferDropdownProps {
|
|
|
21
21
|
hasSelectAll: boolean;
|
|
22
22
|
areAllSelected: boolean;
|
|
23
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;
|
|
24
28
|
/** Any load in flight; renders the loader row below the list. */
|
|
25
29
|
isLoading?: boolean;
|
|
26
30
|
/**
|
|
@@ -45,7 +49,7 @@ interface IMultiSelectTransferDropdownProps {
|
|
|
45
49
|
* The open-state dropdown for MultiSelectTransfer: an optional search input, an optional "Select All"
|
|
46
50
|
* row, the (draft-checked) option list, and the infinite-scroll sentinel.
|
|
47
51
|
*/
|
|
48
|
-
export declare function MultiSelectTransferDropdown({ error, size, disabled, searchable, 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;
|
|
49
53
|
export declare namespace MultiSelectTransferDropdown {
|
|
50
54
|
var displayName: string;
|
|
51
55
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
interface IOptionRowProps {
|
|
3
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;
|
|
4
7
|
label: React.ReactNode;
|
|
5
8
|
checked: boolean;
|
|
6
9
|
active: boolean;
|
|
7
10
|
disabled?: boolean;
|
|
11
|
+
/** Escape has hidden the label reveal (see useLabelPeekDismissal). */
|
|
12
|
+
isPeekDismissed: boolean;
|
|
8
13
|
onToggle: () => void;
|
|
9
14
|
onActivate: () => void;
|
|
15
|
+
onMouseEnter: () => void;
|
|
10
16
|
optionItemClass: string | undefined;
|
|
11
17
|
optionLabelWrapClass: string;
|
|
12
18
|
optionLabelClass: string;
|
|
@@ -21,7 +27,7 @@ interface IOptionRowProps {
|
|
|
21
27
|
* (a combobox) where the search is shown, otherwise the listbox itself — and keyboard navigation is
|
|
22
28
|
* driven from there by `aria-activedescendant` / arrow keys. `active` marks the row the arrow keys
|
|
23
29
|
* have landed on so it can be highlighted and scrolled into view; the pointer path still toggles on
|
|
24
|
-
* click / activates on hover.
|
|
30
|
+
* click / activates on hover. The keyboard-active row reveals a truncated label just as a hovered one does.
|
|
25
31
|
*/
|
|
26
|
-
export declare function OptionRow({ id, label, checked, active, disabled, onToggle, onActivate, optionItemClass, optionLabelWrapClass, optionLabelClass }: IOptionRowProps): React.ReactElement;
|
|
32
|
+
export declare function OptionRow({ id, posInSet, setSize, label, checked, active, disabled, isPeekDismissed, onToggle, onActivate, onMouseEnter, optionItemClass, optionLabelWrapClass, optionLabelClass }: IOptionRowProps): React.ReactElement;
|
|
27
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,18 @@ 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
|
+
};
|
|
44
56
|
searchable: {
|
|
45
57
|
false: {
|
|
46
58
|
dropdownHeader: string;
|
|
@@ -114,6 +126,18 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
114
126
|
};
|
|
115
127
|
false: {};
|
|
116
128
|
};
|
|
129
|
+
optionDisabled: {
|
|
130
|
+
true: {
|
|
131
|
+
optionItem: string;
|
|
132
|
+
};
|
|
133
|
+
false: {};
|
|
134
|
+
};
|
|
135
|
+
active: {
|
|
136
|
+
true: {
|
|
137
|
+
optionItem: string;
|
|
138
|
+
};
|
|
139
|
+
false: {};
|
|
140
|
+
};
|
|
117
141
|
searchable: {
|
|
118
142
|
false: {
|
|
119
143
|
dropdownHeader: string;
|
|
@@ -187,6 +211,18 @@ export declare const multiSelectTransferVariants: import("tailwind-variants").TV
|
|
|
187
211
|
};
|
|
188
212
|
false: {};
|
|
189
213
|
};
|
|
214
|
+
optionDisabled: {
|
|
215
|
+
true: {
|
|
216
|
+
optionItem: string;
|
|
217
|
+
};
|
|
218
|
+
false: {};
|
|
219
|
+
};
|
|
220
|
+
active: {
|
|
221
|
+
true: {
|
|
222
|
+
optionItem: string;
|
|
223
|
+
};
|
|
224
|
+
false: {};
|
|
225
|
+
};
|
|
190
226
|
searchable: {
|
|
191
227
|
false: {
|
|
192
228
|
dropdownHeader: string;
|
|
@@ -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[];
|