@cloudwick/astral-ui 8.2.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.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/components/card/card.d.ts +20 -1
  3. package/dist/components/card/cardVariants.d.ts +28 -22
  4. package/dist/components/card/index.d.ts +1 -1
  5. package/dist/components/ctaGroup/ctaGroup.d.ts +16 -10
  6. package/dist/components/ctaGroup/ctaGroupVariants.d.ts +6 -6
  7. package/dist/components/ctaGroup/index.d.ts +1 -1
  8. package/dist/components/dataTable/DataTableColumnSettings.d.ts +2 -1
  9. package/dist/components/fileUpload/fileUpload.d.ts +2 -2
  10. package/dist/components/fileUpload/fileUploadVariants.d.ts +3 -0
  11. package/dist/components/modal/modal.d.ts +21 -0
  12. package/dist/components/multiSelectTransfer/multiSelectTransferDropdown.d.ts +5 -1
  13. package/dist/components/multiSelectTransfer/multiSelectTransferOptionRow.d.ts +8 -2
  14. package/dist/components/multiSelectTransfer/multiSelectTransferPill.d.ts +9 -2
  15. package/dist/components/multiSelectTransfer/multiSelectTransferTrigger.d.ts +8 -0
  16. package/dist/components/multiSelectTransfer/multiSelectTransferVariants.d.ts +36 -0
  17. package/dist/components/otp/input.d.ts +4 -0
  18. package/dist/components/pagination/paginationUtils.d.ts +17 -0
  19. package/dist/components/pagination/usePaginationCollapse.d.ts +22 -0
  20. package/dist/components/scrollbar/scrollbar.d.ts +7 -0
  21. package/dist/components/select/selectKeyboard.d.ts +11 -5
  22. package/dist/components/select/types.d.ts +9 -0
  23. package/dist/components/tabs/tabs.d.ts +8 -0
  24. package/dist/components/tabs/tabsVariants.d.ts +3 -3
  25. package/dist/components/toast/toastVariants.d.ts +3 -3
  26. package/dist/components/toggle/toggle.d.ts +7 -3
  27. package/dist/components/toggle/toggleVariants.d.ts +3 -3
  28. package/dist/components/tooltip/tooltip.d.ts +16 -0
  29. package/dist/components/transferList/transferListItem.d.ts +6 -1
  30. package/dist/components/transferList/transferListPanel.d.ts +3 -1
  31. package/dist/components/transferList/transferListVariants.d.ts +3 -0
  32. package/dist/components/transferList/useTransferListSource.d.ts +2 -0
  33. package/dist/css/index.min.css +1 -1
  34. package/dist/hooks/index.d.ts +1 -0
  35. package/dist/hooks/useLabelPeekDismissal.d.ts +11 -0
  36. package/dist/index.cjs.js +5 -5
  37. package/dist/index.esm.js +5 -5
  38. package/dist/utils/fieldHelperText.d.ts +23 -0
  39. package/dist/utils/index.d.ts +2 -0
  40. package/dist/utils/stringUtils/index.d.ts +2 -0
  41. package/dist/utils/stringUtils/joinIds.d.ts +10 -0
  42. package/dist/utils/stringUtils/resultsAvailable.d.ts +9 -0
  43. package/dist/utils/truncatedLabelReveal.d.ts +7 -0
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  UI Library for Cloudwick
4
4
 
5
- Version - 8.2.0
5
+ Version - 8.3.0
6
6
 
7
7
  ## Installation
8
8
 
@@ -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
- [key: string]: {
3
- [key: string]: import("tailwind-merge").ClassNameValue | {
4
- base?: import("tailwind-merge").ClassNameValue;
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
- [x: string]: {
12
- [x: string]: import("tailwind-merge").ClassNameValue | {
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
- [key: string]: {
26
- [key: string]: import("tailwind-merge").ClassNameValue | {
27
- base?: import("tailwind-merge").ClassNameValue;
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<unknown, {
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
- /** Function to reset the upload state */
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>
@@ -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 button. */
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;
@@ -28,6 +28,10 @@ interface IInputProps {
28
28
  * Whether the input is in an error state
29
29
  */
30
30
  error: boolean;
31
+ /**
32
+ * Id of the element that describes the input
33
+ */
34
+ describedBy?: string;
31
35
  }
32
36
  /**
33
37
  * Input component for OTP field
@@ -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.
@@ -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
- * The open menu's keyboard model, shared by the search box and by the control. Escape discards the
18
- * draft and closes, Tab commits it and closes, and navigation keys are refused while the loader or
19
- * the error notice stands in for the list. "navigate" means react-select's own option navigation
20
- * still has to see the key.
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
- iconWrapper: string;
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
- iconWrapper: string;
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
- iconWrapper: string;
75
+ content: string;
76
76
  };
77
77
  error: {
78
78
  root: string;