@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
|
@@ -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.
|
|
@@ -3,7 +3,7 @@ import { type ISelectMenuContext } from "./types";
|
|
|
3
3
|
/** What the shared handler leaves for its caller to do. */
|
|
4
4
|
export type TSelectKeyOutcome = "handled" | "navigate" | "ignored";
|
|
5
5
|
/** The slice of the menu context the shared handler reads, so callers can pass the context whole. */
|
|
6
|
-
export type TSelectKeyContext = Pick<ISelectMenuContext, "closeMenu" | "commitAndClose" | "containerRef" | "searchable" | "searchInputRef" | "isLoading" | "loadError" | "onInteractionMode">;
|
|
6
|
+
export type TSelectKeyContext = Pick<ISelectMenuContext, "closeMenu" | "commitAndClose" | "containerRef" | "menuNodeRef" | "searchable" | "searchInputRef" | "isLoading" | "loadError" | "onInteractionMode">;
|
|
7
7
|
/** The refs that locate the two inputs focus can live in. */
|
|
8
8
|
export type TSelectFocusRefs = Pick<ISelectMenuContext, "searchInputRef" | "containerRef">;
|
|
9
9
|
/**
|
|
@@ -14,9 +14,15 @@ export declare function getControlInput(containerRef: RefObject<HTMLDivElement>)
|
|
|
14
14
|
/** Focus follows the search box while it exists, and the control input otherwise. */
|
|
15
15
|
export declare function focusMenuInput({ searchInputRef, containerRef }: TSelectFocusRefs): void;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* the
|
|
20
|
-
*
|
|
17
|
+
* Escape and Tab, wherever focus sits inside the open menu. Escape discards the draft and closes. Tab
|
|
18
|
+
* walks the menu's own tab stops and, past either end, commits like an outside click and leaves —
|
|
19
|
+
* from the control input, so the browser's own Tab carries on to the field before or after the Select.
|
|
20
|
+
* Returns whether the key was one of the two.
|
|
21
|
+
*/
|
|
22
|
+
export declare function handleMenuExitKey(e: KeyboardEvent<Element>, ctx: TSelectKeyContext): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The open menu's keyboard model, shared by the search box and by the control. Escape and Tab are
|
|
25
|
+
* {@link handleMenuExitKey}'s, and navigation keys are refused while the loader or the error notice
|
|
26
|
+
* stands in for the list. "navigate" means react-select's own option navigation still has to see the key.
|
|
21
27
|
*/
|
|
22
28
|
export declare function handleMenuKey(e: KeyboardEvent<Element>, ctx: TSelectKeyContext): TSelectKeyOutcome;
|
|
@@ -263,6 +263,15 @@ export interface ISelectMenuContext {
|
|
|
263
263
|
/** Records the input modality (see {@link ISelectOptionContext.interactionMode}); set to "keyboard" here. */
|
|
264
264
|
onInteractionMode: (mode: TSelectInteractionMode) => void;
|
|
265
265
|
}
|
|
266
|
+
/** What the in-menu search box exposes about the rendered list, read from react-select's DOM. */
|
|
267
|
+
export interface ISelectMenuListState {
|
|
268
|
+
/** The listbox the search box controls; absent while the loader or error notice replaces it. */
|
|
269
|
+
listboxId?: string;
|
|
270
|
+
/** The option react-select has focused. */
|
|
271
|
+
activeOptionId?: string;
|
|
272
|
+
/** Announced politely: the result count, or the no-options notice. */
|
|
273
|
+
status: string;
|
|
274
|
+
}
|
|
266
275
|
export interface IOptionLabelOverlayProps {
|
|
267
276
|
anchorRef: RefObject<HTMLElement>;
|
|
268
277
|
className: string;
|
|
@@ -110,6 +110,14 @@ export interface ITabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "
|
|
|
110
110
|
* Color of the tab. Only applicable for filled variant.
|
|
111
111
|
*/
|
|
112
112
|
color?: "primary" | "secondary";
|
|
113
|
+
/**
|
|
114
|
+
* Accessible name of the tab list. Use when the tabs have no visible heading.
|
|
115
|
+
*/
|
|
116
|
+
"aria-label"?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Id of a visible element that names the tab list.
|
|
119
|
+
*/
|
|
120
|
+
"aria-labelledby"?: string;
|
|
113
121
|
}
|
|
114
122
|
type TTabsType = React.ForwardRefExoticComponent<React.PropsWithoutRef<ITabsProps> & React.RefAttributes<HTMLDivElement>> & {
|
|
115
123
|
Tab: typeof Tab;
|
|
@@ -26,7 +26,7 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
|
|
|
26
26
|
listItem: string[];
|
|
27
27
|
};
|
|
28
28
|
filled: {
|
|
29
|
-
listItem: string;
|
|
29
|
+
listItem: string[];
|
|
30
30
|
};
|
|
31
31
|
contained: {
|
|
32
32
|
list: string;
|
|
@@ -74,7 +74,7 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
|
|
|
74
74
|
listItem: string[];
|
|
75
75
|
};
|
|
76
76
|
filled: {
|
|
77
|
-
listItem: string;
|
|
77
|
+
listItem: string[];
|
|
78
78
|
};
|
|
79
79
|
contained: {
|
|
80
80
|
list: string;
|
|
@@ -122,7 +122,7 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
|
|
|
122
122
|
listItem: string[];
|
|
123
123
|
};
|
|
124
124
|
filled: {
|
|
125
|
-
listItem: string;
|
|
125
|
+
listItem: string[];
|
|
126
126
|
};
|
|
127
127
|
contained: {
|
|
128
128
|
list: string;
|
|
@@ -10,7 +10,7 @@ export declare const toastVariants: import("tailwind-variants").TVReturnType<{
|
|
|
10
10
|
};
|
|
11
11
|
warning: {
|
|
12
12
|
root: string;
|
|
13
|
-
|
|
13
|
+
content: string;
|
|
14
14
|
};
|
|
15
15
|
error: {
|
|
16
16
|
root: string;
|
|
@@ -41,7 +41,7 @@ export declare const toastVariants: import("tailwind-variants").TVReturnType<{
|
|
|
41
41
|
};
|
|
42
42
|
warning: {
|
|
43
43
|
root: string;
|
|
44
|
-
|
|
44
|
+
content: string;
|
|
45
45
|
};
|
|
46
46
|
error: {
|
|
47
47
|
root: string;
|
|
@@ -72,7 +72,7 @@ export declare const toastVariants: import("tailwind-variants").TVReturnType<{
|
|
|
72
72
|
};
|
|
73
73
|
warning: {
|
|
74
74
|
root: string;
|
|
75
|
-
|
|
75
|
+
content: string;
|
|
76
76
|
};
|
|
77
77
|
error: {
|
|
78
78
|
root: string;
|
|
@@ -4,7 +4,7 @@ import { type TIconType } from "../adpIcon";
|
|
|
4
4
|
/**
|
|
5
5
|
* Toggle component props
|
|
6
6
|
*/
|
|
7
|
-
export interface IToggleProps extends Omit<React.HTMLProps<HTMLInputElement>, "label" | "size"> {
|
|
7
|
+
export interface IToggleProps extends Omit<React.HTMLProps<HTMLInputElement>, "label" | "size" | "checked" | "defaultChecked"> {
|
|
8
8
|
/**
|
|
9
9
|
* id for the Toggle
|
|
10
10
|
*/
|
|
@@ -23,10 +23,14 @@ export interface IToggleProps extends Omit<React.HTMLProps<HTMLInputElement>, "l
|
|
|
23
23
|
*/
|
|
24
24
|
label?: React.ReactNode;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @default false
|
|
26
|
+
* Controlled toggled state. Omit it to let the Toggle manage its own state.
|
|
28
27
|
*/
|
|
29
28
|
toggled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Initial toggled state when `toggled` is omitted.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
defaultToggled?: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* Provide an optional icon for the toggled state of the component.
|
|
32
36
|
*/
|
|
@@ -28,7 +28,7 @@ export declare const toggleVariants: import("tailwind-variants").TVReturnType<{
|
|
|
28
28
|
};
|
|
29
29
|
}, {
|
|
30
30
|
wrapper: string;
|
|
31
|
-
container: string;
|
|
31
|
+
container: string[];
|
|
32
32
|
button: string;
|
|
33
33
|
icon: string;
|
|
34
34
|
label: string;
|
|
@@ -62,7 +62,7 @@ export declare const toggleVariants: import("tailwind-variants").TVReturnType<{
|
|
|
62
62
|
};
|
|
63
63
|
}, {
|
|
64
64
|
wrapper: string;
|
|
65
|
-
container: string;
|
|
65
|
+
container: string[];
|
|
66
66
|
button: string;
|
|
67
67
|
icon: string;
|
|
68
68
|
label: string;
|
|
@@ -96,7 +96,7 @@ export declare const toggleVariants: import("tailwind-variants").TVReturnType<{
|
|
|
96
96
|
};
|
|
97
97
|
}, {
|
|
98
98
|
wrapper: string;
|
|
99
|
-
container: string;
|
|
99
|
+
container: string[];
|
|
100
100
|
button: string;
|
|
101
101
|
icon: string;
|
|
102
102
|
label: string;
|
|
@@ -37,6 +37,22 @@ export interface ITooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
37
37
|
* Gate it on a condition, e.g. `canOpen={isTruncated}`. @default true
|
|
38
38
|
*/
|
|
39
39
|
canOpen?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the synthesized wrapper of a non-interactive trigger is a tab stop. Pass `false` for a
|
|
42
|
+
* trigger nested inside another control whose accessible name already carries the tooltip text: the
|
|
43
|
+
* wrapper then has no `tabIndex` at all, so it adds no focusable descendant, and the tooltip opens on
|
|
44
|
+
* hover only. @default true
|
|
45
|
+
*/
|
|
46
|
+
focusable?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the trigger is linked to the tooltip via `aria-describedby`, so screen readers announce
|
|
49
|
+
* the tooltip text as the trigger's description. When omitted, the link is skipped automatically if
|
|
50
|
+
* the tooltip text only repeats the trigger's accessible name (its `aria-label` or text content),
|
|
51
|
+
* so the text is not read twice. Pass `true`/`false` to force either behavior, e.g. `false` when the
|
|
52
|
+
* trigger's name comes from content Tooltip cannot inspect. A non-clickable tooltip that does not
|
|
53
|
+
* describe its trigger is also hidden from assistive technology and stays a purely visual hint.
|
|
54
|
+
*/
|
|
55
|
+
describeTrigger?: boolean;
|
|
40
56
|
}
|
|
41
57
|
export declare const Tooltip: React.ForwardRefExoticComponent<ITooltipProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
58
|
export {};
|
|
@@ -4,6 +4,8 @@ interface ITransferListItemProps {
|
|
|
4
4
|
item: ITransferListItem;
|
|
5
5
|
panel: TTransferPanel;
|
|
6
6
|
index: number;
|
|
7
|
+
/** Number of rows in the panel's list, exposed as aria-setsize alongside the row's position. */
|
|
8
|
+
setSize: number;
|
|
7
9
|
/** Row element id, referenced by the panel listbox's aria-activedescendant. */
|
|
8
10
|
id: string;
|
|
9
11
|
checked: boolean;
|
|
@@ -15,6 +17,8 @@ interface ITransferListItemProps {
|
|
|
15
17
|
isLast: boolean;
|
|
16
18
|
showTopIndicator: boolean;
|
|
17
19
|
showBottomIndicator: boolean;
|
|
20
|
+
/** Escape has hidden the full-text reveal of a truncated label; it returns on the next hover or move. */
|
|
21
|
+
isPeekDismissed: boolean;
|
|
18
22
|
onToggle: () => void;
|
|
19
23
|
onRemove?: () => void;
|
|
20
24
|
onMoveUp?: () => void;
|
|
@@ -23,12 +27,13 @@ interface ITransferListItemProps {
|
|
|
23
27
|
onDragEnd: () => void;
|
|
24
28
|
onDragOver: (e: React.DragEvent) => void;
|
|
25
29
|
onDrop: (e: React.DragEvent) => void;
|
|
30
|
+
onMouseEnter: () => void;
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* A single transfer list row: drag handle + position badge (selected, reorderable
|
|
29
34
|
* only), checkbox, label, and remove / reorder controls.
|
|
30
35
|
*/
|
|
31
|
-
export declare function TransferListItem({ item, panel, index, id, checked, active, reorderable, disabled, isFirst, isLast, showTopIndicator, showBottomIndicator, onToggle, onRemove, onMoveUp, onMoveDown, onDragStart, onDragEnd, onDragOver, onDrop }: ITransferListItemProps): React.ReactElement;
|
|
36
|
+
export declare function TransferListItem({ item, panel, index, setSize, id, checked, active, reorderable, disabled, isFirst, isLast, showTopIndicator, showBottomIndicator, isPeekDismissed, onToggle, onRemove, onMoveUp, onMoveDown, onDragStart, onDragEnd, onDragOver, onDrop, onMouseEnter }: ITransferListItemProps): React.ReactElement;
|
|
32
37
|
export declare namespace TransferListItem {
|
|
33
38
|
var displayName: string;
|
|
34
39
|
}
|
|
@@ -20,6 +20,8 @@ interface ITransferListPanelProps {
|
|
|
20
20
|
isLoadingMore?: boolean;
|
|
21
21
|
/** Loader REPLACES the rows (a search/refresh fetch, not a page append). */
|
|
22
22
|
isLoading?: boolean;
|
|
23
|
+
/** The search has a query its rows do not answer yet, so the result count is not announced. */
|
|
24
|
+
isSearchPending?: boolean;
|
|
23
25
|
/** Replaces the rows when set: the panel's source failed to load. */
|
|
24
26
|
loadError?: React.ReactNode;
|
|
25
27
|
/** Shown under the loaded rows when a page append failed; renders a retry button. */
|
|
@@ -57,7 +59,7 @@ interface ITransferListPanelProps {
|
|
|
57
59
|
* One panel of the transfer list: header (title, count, optional reload),
|
|
58
60
|
* optional search + header slot, and a scrollable list of rows or an empty state.
|
|
59
61
|
*/
|
|
60
|
-
export declare function TransferListPanel({ panel, title, items, reorderable, disabled, emptyText, searchable, searchValue, searchPlaceholder, onSearchChange, headerSlot, reloadTooltip, onReload, isReloading, hasMore, onLoadMore, isLoadingMore, isLoading, loadError, loadMoreError, onRetryLoadMore, retryLabel, totalCount, selectAllChecked, selectAllIndeterminate, selectAllCount, onToggleSelectAll, moveLabel, moveCount, moveDisabled, moveIconSide, onMove, isChecked, onToggle, onRemove, onMoveUp, onMoveDown, dropIndex, showDropOverlay, onItemDragStart, onItemDragEnd, onItemDragOver, onListDragOver, onListDrop }: ITransferListPanelProps): React.ReactElement;
|
|
62
|
+
export declare function TransferListPanel({ panel, title, items, reorderable, disabled, emptyText, searchable, searchValue, searchPlaceholder, onSearchChange, headerSlot, reloadTooltip, onReload, isReloading, hasMore, onLoadMore, isLoadingMore, isLoading, isSearchPending, loadError, loadMoreError, onRetryLoadMore, retryLabel, totalCount, selectAllChecked, selectAllIndeterminate, selectAllCount, onToggleSelectAll, moveLabel, moveCount, moveDisabled, moveIconSide, onMove, isChecked, onToggle, onRemove, onMoveUp, onMoveDown, dropIndex, showDropOverlay, onItemDragStart, onItemDragEnd, onItemDragOver, onListDragOver, onListDrop }: ITransferListPanelProps): React.ReactElement;
|
|
61
63
|
export declare namespace TransferListPanel {
|
|
62
64
|
var displayName: string;
|
|
63
65
|
}
|
|
@@ -47,6 +47,7 @@ export declare const transferListVariants: import("tailwind-variants").TVReturnT
|
|
|
47
47
|
headerSlot: string;
|
|
48
48
|
selectAllRow: string;
|
|
49
49
|
listRegion: string;
|
|
50
|
+
listbox: string;
|
|
50
51
|
listWrap: string;
|
|
51
52
|
list: string;
|
|
52
53
|
virtualScroll: string;
|
|
@@ -117,6 +118,7 @@ export declare const transferListVariants: import("tailwind-variants").TVReturnT
|
|
|
117
118
|
headerSlot: string;
|
|
118
119
|
selectAllRow: string;
|
|
119
120
|
listRegion: string;
|
|
121
|
+
listbox: string;
|
|
120
122
|
listWrap: string;
|
|
121
123
|
list: string;
|
|
122
124
|
virtualScroll: string;
|
|
@@ -187,6 +189,7 @@ export declare const transferListVariants: import("tailwind-variants").TVReturnT
|
|
|
187
189
|
headerSlot: string;
|
|
188
190
|
selectAllRow: string;
|
|
189
191
|
listRegion: string;
|
|
192
|
+
listbox: string;
|
|
190
193
|
listWrap: string;
|
|
191
194
|
list: string;
|
|
192
195
|
virtualScroll: string;
|
|
@@ -35,6 +35,8 @@ interface ITransferListSource {
|
|
|
35
35
|
availableLoadMoreError?: ReactNode;
|
|
36
36
|
onRetryLoadMoreAvailable?: () => void;
|
|
37
37
|
availableTotalCount?: number;
|
|
38
|
+
/** A typed query has not yet been handed to the async source (still debouncing), so the rows are the last query's. */
|
|
39
|
+
isAvailableSearchPending: boolean;
|
|
38
40
|
/** In async mode these make the panel's search controlled and server-driven. */
|
|
39
41
|
availableSearchTerm?: string;
|
|
40
42
|
onAvailableSearchChange?: (query: string) => void;
|