@cloudwick/astral-ui 7.0.1 → 8.1.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 (90) hide show
  1. package/README.md +3 -1
  2. package/dist/components/accordion/accordion.d.ts +5 -1
  3. package/dist/components/breadcrumbs/breadcrumbs.d.ts +5 -6
  4. package/dist/components/button/reloadButton.d.ts +20 -0
  5. package/dist/components/card/card.d.ts +7 -8
  6. package/dist/components/card/cardVariants.d.ts +3 -3
  7. package/dist/components/dropdown/dropdown.d.ts +17 -0
  8. package/dist/components/emptyState/emptyState.d.ts +1 -4
  9. package/dist/components/emptyState/emptyStateVariants.d.ts +3 -3
  10. package/dist/components/modal/modal.d.ts +6 -7
  11. package/dist/components/multiSelectTransfer/index.d.ts +3 -0
  12. package/dist/components/multiSelectTransfer/multiSelectTransfer.d.ts +7 -0
  13. package/dist/components/multiSelectTransfer/multiSelectTransferDropdown.d.ts +50 -0
  14. package/dist/components/multiSelectTransfer/multiSelectTransferModal.d.ts +46 -0
  15. package/dist/components/multiSelectTransfer/multiSelectTransferPill.d.ts +28 -0
  16. package/dist/components/multiSelectTransfer/multiSelectTransferTrigger.d.ts +26 -0
  17. package/dist/components/multiSelectTransfer/multiSelectTransferVariants.d.ts +202 -0
  18. package/dist/components/multiSelectTransfer/types.d.ts +138 -0
  19. package/dist/components/multiSelectTransfer/useMultiSelectTransferDraft.d.ts +24 -0
  20. package/dist/components/multiSelectTransfer/useMultiSelectTransferOptionSource.d.ts +56 -0
  21. package/dist/components/panel/panel.d.ts +1 -2
  22. package/dist/components/radioGroup/index.d.ts +1 -1
  23. package/dist/components/radioGroup/radioGroup.d.ts +76 -12
  24. package/dist/components/radioGroup/radioGroupVariants.d.ts +30 -9
  25. package/dist/components/scrollbar/scrollbar.d.ts +7 -0
  26. package/dist/components/select/index.d.ts +2 -2
  27. package/dist/components/select/select.d.ts +7 -46
  28. package/dist/components/select/selectComponents.d.ts +29 -0
  29. package/dist/components/select/selectMenu.d.ts +12 -0
  30. package/dist/components/select/selectVariants.d.ts +21 -0
  31. package/dist/components/select/types.d.ts +252 -1
  32. package/dist/components/select/useSelectOptionSource.d.ts +39 -0
  33. package/dist/components/select/useSelectOutsideClose.d.ts +16 -0
  34. package/dist/components/select/utils.d.ts +3 -0
  35. package/dist/components/tabs/tabs.d.ts +4 -5
  36. package/dist/components/tabs/tabsVariants.d.ts +12 -0
  37. package/dist/components/tooltip/tooltip.d.ts +17 -6
  38. package/dist/components/tooltip/tooltipVariants.d.ts +6 -6
  39. package/dist/components/transferList/index.d.ts +3 -0
  40. package/dist/components/transferList/transferList.d.ts +9 -0
  41. package/dist/components/transferList/transferListItem.d.ts +35 -0
  42. package/dist/components/transferList/transferListPanel.d.ts +64 -0
  43. package/dist/components/transferList/transferListPanelHeader.d.ts +29 -0
  44. package/dist/components/transferList/transferListVariants.d.ts +211 -0
  45. package/dist/components/transferList/types.d.ts +152 -0
  46. package/dist/components/transferList/useDragAutoScroll.d.ts +13 -0
  47. package/dist/components/transferList/useTransferList.d.ts +28 -0
  48. package/dist/components/transferList/useTransferListPanelKeys.d.ts +28 -0
  49. package/dist/components/transferList/useTransferListSource.d.ts +49 -0
  50. package/dist/css/fonts.min.css +1 -1
  51. package/dist/css/index.min.css +1 -1
  52. package/dist/fonts/NotoSans-Bold.woff2 +0 -0
  53. package/dist/fonts/NotoSans-BoldItalic.woff2 +0 -0
  54. package/dist/fonts/NotoSans-Italic.woff2 +0 -0
  55. package/dist/fonts/NotoSans-Medium.woff2 +0 -0
  56. package/dist/fonts/NotoSans-MediumItalic.woff2 +0 -0
  57. package/dist/fonts/NotoSans-Regular.woff2 +0 -0
  58. package/dist/fonts/NotoSans-SemiBold.woff2 +0 -0
  59. package/dist/fonts/NotoSans-SemiBoldItalic.woff2 +0 -0
  60. package/dist/hooks/index.d.ts +10 -0
  61. package/dist/hooks/useAsyncOptions.d.ts +85 -0
  62. package/dist/hooks/useAsyncOptionsReducer.d.ts +75 -0
  63. package/dist/hooks/useAvailableProjection.d.ts +20 -0
  64. package/dist/hooks/useDebouncedCallback.d.ts +10 -0
  65. package/dist/hooks/useFilterQuery.d.ts +28 -0
  66. package/dist/hooks/useIgnoredPropWarning.d.ts +5 -0
  67. package/dist/hooks/useInfiniteScroll.d.ts +33 -0
  68. package/dist/hooks/useIsTruncated.d.ts +25 -0
  69. package/dist/hooks/useListboxKeyboardNav.d.ts +47 -0
  70. package/dist/hooks/useOnValueChange.d.ts +6 -0
  71. package/dist/hooks/usePrefetchBaseline.d.ts +22 -0
  72. package/dist/index.cjs.js +5 -5
  73. package/dist/index.d.ts +3 -0
  74. package/dist/index.esm.js +5 -5
  75. package/dist/utils/devWarn.d.ts +5 -0
  76. package/dist/utils/elementUtils.d.ts +18 -0
  77. package/dist/utils/index.d.ts +7 -1
  78. package/dist/utils/matchesQuery.d.ts +13 -0
  79. package/dist/utils/mergeUnique.d.ts +6 -0
  80. package/dist/utils/resolveLoadErrors.d.ts +20 -0
  81. package/dist/utils/resolveReloadControls.d.ts +23 -0
  82. package/package.json +3 -3
  83. package/dist/fonts/Inter_18pt-Bold.ttf +0 -0
  84. package/dist/fonts/Inter_18pt-BoldItalic.ttf +0 -0
  85. package/dist/fonts/Inter_18pt-Italic.ttf +0 -0
  86. package/dist/fonts/Inter_18pt-Medium.ttf +0 -0
  87. package/dist/fonts/Inter_18pt-MediumItalic.ttf +0 -0
  88. package/dist/fonts/Inter_18pt-Regular.ttf +0 -0
  89. package/dist/fonts/Inter_18pt-SemiBold.ttf +0 -0
  90. package/dist/fonts/Inter_18pt-SemiBoldItalic.ttf +0 -0
@@ -1,4 +1,7 @@
1
- import type { ReactNode } from "react";
1
+ import type { ChangeEvent, FocusEvent, KeyboardEvent, ReactNode, ReactElement, MutableRefObject, RefObject } from "react";
2
+ import type { Props as ReactSelectProps, GroupBase } from "react-select";
3
+ import type { TLoadOptions, TPrefetch } from "@hooks";
4
+ import { type TIconType } from "../adpIcon";
2
5
  /**
3
6
  * Available sizes for the Select component
4
7
  */
@@ -16,5 +19,253 @@ export type TSelectSize = `${ESelectSizes}`;
16
19
  export interface IOption {
17
20
  label: ReactNode;
18
21
  value: any;
22
+ /** Plain-text used for searching when `label` is a ReactNode. Takes precedence over label/value. */
23
+ searchValue?: string;
19
24
  isFixed?: boolean;
25
+ isDisabled?: boolean;
26
+ }
27
+ /**
28
+ * Async option source. Page one only: a resolved page that reports `hasMore` is dev-warned, and no
29
+ * further page is ever requested.
30
+ */
31
+ export type TSelectLoadOptions = TLoadOptions<IOption>;
32
+ /** Latest input modality. Drives which signal shows an option's full-text overlay. */
33
+ export type TSelectInteractionMode = "pointer" | "keyboard";
34
+ /** Options as react-select accepts them — sync mode may carry groups; async mode never does. */
35
+ export type TSelectOptions<Group extends GroupBase<IOption> = GroupBase<IOption>> = readonly (IOption | Group)[];
36
+ /**
37
+ * Props for the Select component
38
+ */
39
+ export interface ISelectProps<IsMulti extends boolean = false, Group extends GroupBase<IOption> = GroupBase<IOption>> extends Omit<ReactSelectProps<IOption, IsMulti, Group>, "options" | "value" | "className" | "inputValue" | "onInputChange" | "isSearchable" | "isLoading" | "filterOption"> {
40
+ /** Unique id for the select input */
41
+ id?: string;
42
+ /** Custom className for wrapper */
43
+ className?: string;
44
+ /** Label displayed above select */
45
+ label?: ReactNode;
46
+ /** Select size variant */
47
+ size?: TSelectSize;
48
+ /** Options or groups to render. Ignored (dev warning) when `loadOptions` is set — seed with `initialOptions` instead. */
49
+ options?: ReactSelectProps<IOption, IsMulti, Group>["options"];
50
+ /** Current value of the select */
51
+ value?: ReactSelectProps<IOption, IsMulti, Group>["value"];
52
+ /** Helper text displayed below */
53
+ helperText?: ReactNode;
54
+ /** Display error styling */
55
+ error?: boolean;
56
+ /** Disable the select */
57
+ disabled?: boolean;
58
+ /** Enable creatable select */
59
+ creatable?: boolean;
60
+ /** Field touched state */
61
+ touched?: boolean;
62
+ /** Max number of visible values in multi */
63
+ maxVisibleValues?: number;
64
+ /** Label for truncated values */
65
+ maxVisibleValuesMsg?: string;
66
+ /** Custom footer in menu */
67
+ menuFooter?: ReactNode;
68
+ /** Prefix icon for the control */
69
+ prefixIcon?: TIconType | ReactNode;
70
+ /** Suffix icon for the control */
71
+ suffixIcon?: TIconType | ReactNode;
72
+ /** Placeholder text for the search input inside the dropdown */
73
+ searchPlaceholder?: string;
74
+ /** Tooltip for the select reload button. */
75
+ reloadTooltip?: string;
76
+ /** The reload button is shown when this is provided. Fired when the reload button is clicked. */
77
+ onReload?: () => void;
78
+ /** Spins the select reload button. */
79
+ isReloading?: boolean;
80
+ /** Seeds/re-syncs dropdown search; semi-controlled — pair with onFilterChange. Applies in both modes. */
81
+ filterValue?: string;
82
+ /**
83
+ * Debounced search-query callback; also called with "" when the component clears search.
84
+ *
85
+ * Without `loadOptions`: switches off local filtering — `options` is treated as already filtered
86
+ * for the query — and the fetch, loading state, and response ordering are the consumer's
87
+ * responsibility.
88
+ *
89
+ * With `loadOptions`: notification-only, for analytics or `filterValue` syncing.
90
+ */
91
+ onFilterChange?: (query: string) => void;
92
+ /** Debounce for the search query, in both sync and `loadOptions` mode. Set to 0 to disable. @default 300 */
93
+ filterDebounceMs?: number;
94
+ /** Replaces option list with loader. OR-ed with the loader's own state, so it still applies in async mode. @default false */
95
+ isLoading?: boolean;
96
+ /**
97
+ * Custom client-side match, replacing the shared `matchesQuery` default.
98
+ *
99
+ * @deprecated Use `onFilterChange` instead, which does the same job without a second filtering axis:
100
+ * it hands you the query and treats `options` as already filtered, so your predicate lives in your own
101
+ * `useMemo` rather than in a react-select callback. Pair with `filterDebounceMs={0}` to keep filtering
102
+ * synchronous. Ignored entirely when filtering is already delegated (`onFilterChange`/`loadOptions`),
103
+ * and scheduled for removal in the next major.
104
+ *
105
+ * ```tsx
106
+ * const visible = useMemo(() => all.filter(( o ) => myMatch( o, query )), [ all, query ]);
107
+ * <Select options={visible} onFilterChange={setQuery} filterDebounceMs={0} />
108
+ * ```
109
+ */
110
+ filterOption?: ReactSelectProps<IOption, IsMulti, Group>["filterOption"];
111
+ /**
112
+ * Server-side option source. When provided, `Select` owns the option list, the request lifecycle and
113
+ * the loading state; `options` is ignored (dev warning) and `onFilterChange` becomes
114
+ * notification-only. Responsible for mapping the payload to `IOption` — envelopes and domain
115
+ * filtering are the consumer's business. Options are stored exactly as returned, so extra fields
116
+ * survive. A fresh inline arrow is fine: the loader is read through a ref.
117
+ *
118
+ * Page one only: `cursor` / `hasMore` / `total` in the result are ignored.
119
+ */
120
+ loadOptions?: TSelectLoadOptions;
121
+ /**
122
+ * Seed rows for a list you already have — an SSR payload, a route loader, a warm cache. They paint on the
123
+ * first frame, so there is no loader to sit through, and they stay put while the baseline fetch revalidates
124
+ * over them. They do not suppress that fetch: pair with `prefetch="never"` if the seed is the whole list
125
+ * until the user types. A *search* replaces them, since seed rows are not results for a query; clearing it
126
+ * brings them back until a fetched baseline lands. Async mode only — ignored (dev warning) without
127
+ * `loadOptions`, where the rows belong in `options`.
128
+ */
129
+ initialOptions?: readonly IOption[];
130
+ /**
131
+ * When to fetch the unfiltered baseline.
132
+ * - `"open"` — on first menu open. Right for forms with several server-filtered Selects, where paying
133
+ * for menus the user may never open is the worse trade.
134
+ * - `"mount"` — at render, before any interaction. Use when the list is near-certain to be needed and
135
+ * a visible-but-empty Select would read as broken.
136
+ * - `"never"` — no baseline at all; fetch only once the user types. For heavy lists.
137
+ *
138
+ * Async mode only — ignored (dev warning) without `loadOptions`, where `options` are already on screen
139
+ * and there is nothing to fetch.
140
+ * @default "open"
141
+ */
142
+ prefetch?: TPrefetch;
143
+ /** Clearing the search revalidates the cached baseline instead of just restoring it. Costs one request per menu close. @default false */
144
+ refetchOnClear?: boolean;
145
+ /**
146
+ * Identity of the option set, for dependent selects. When it changes, cached results are dropped and
147
+ * the list is repopulated — immediately if the menu is open, otherwise on next open. Compose several
148
+ * parents into one scalar: ``optionsKey={`${domainId}|${accessType}`}``. Does NOT clear the selection.
149
+ */
150
+ optionsKey?: string | number;
151
+ /** Shown in the menu when `loadOptions` rejects. @default "Couldn't load options." */
152
+ loadErrorMessage?: ReactNode;
153
+ /** Shows the menu's reload button in async mode, wired to re-run the current query. @default false */
154
+ showReloadButton?: boolean;
155
+ /** Notified when a load rejects (the component renders `loadErrorMessage` and swallows it). */
156
+ onLoadError?: (error: unknown) => void;
157
+ }
158
+ /**
159
+ * Per-render option config for the SelectOption component. react-select keys custom components by
160
+ * reference and remounts them whenever that reference changes; the `customComponents` object in
161
+ * select.tsx is rebuilt every render. Feeding these live values through context (rather than a
162
+ * closure inside a freshly-created Option) lets SelectOption keep a stable module-level identity,
163
+ * so react-select re-renders it in place instead of remounting - which is what keeps the
164
+ * `useIsTruncated` measurement (and the hover-expand affordance) from flickering.
165
+ */
166
+ export interface ISelectOptionContext {
167
+ /**
168
+ * In-progress multi-select draft, as a value Set. Drives checkboxes / Select All while the
169
+ * committed value drives the control. A Set rather than the array: every option row tests its own
170
+ * membership, so an array would make one menu render O(options x draft).
171
+ */
172
+ draftValues?: ReadonlySet<IOption["value"]>;
173
+ /**
174
+ * Checked state of the Select All row: every option the query currently leaves VISIBLE is in the
175
+ * draft. Resolved on the Select, which is the only place that knows the visible set — react-select
176
+ * hands each option its unfiltered `options` array, so deriving it here would report unchecked
177
+ * even with every visible row ticked.
178
+ */
179
+ areAllSelected?: boolean;
180
+ /** Toggle a single option in the multi-select draft. */
181
+ onToggleDraftOption?: (option: IOption) => void;
182
+ /** Toggle Select All / Deselect All on the multi-select draft (shared with the keyboard path). */
183
+ onSelectAll?: () => void;
184
+ /** tv() class for the label wrapper. */
185
+ optionLabelWrapClass: string;
186
+ /** tv() class for the (truncating) label. */
187
+ optionLabelClass: string;
188
+ /** tv() class for the hover/focus full-text overlay. */
189
+ optionOverlayClass: string;
190
+ /**
191
+ * Latest input modality, shared across every option. The full-text overlay follows the pointer
192
+ * (local `isHovered`) while the user is using the mouse, and react-select's `isFocused` while
193
+ * they're navigating by keyboard. Without this, react-select's `isFocused` - which lingers on the
194
+ * last-focused option after the pointer leaves, and is also set by mouse hover - keeps an
195
+ * overlay visible after the mouse has moved away (and shows two at once mid-transition).
196
+ *
197
+ * State on the Select, not a shared ref: this decides what an option renders, and writing a ref
198
+ * schedules no re-render. Setting the mode it already holds is a no-op React bails out of, so
199
+ * hovering along a list costs a render only at a genuine modality switch.
200
+ */
201
+ interactionMode: TSelectInteractionMode;
202
+ /** Records the modality the user just used. See {@link ISelectOptionContext.interactionMode}. */
203
+ onInteractionMode: (mode: TSelectInteractionMode) => void;
204
+ }
205
+ /**
206
+ * Per-instance menu config via context (keeps SelectMenu's stable identity).
207
+ */
208
+ export interface ISelectMenuContext {
209
+ /** Current search text (controls react-select's inputValue). */
210
+ filterQuery: string;
211
+ /** Updates the query and (debounced) notifies `onFilterChange`. */
212
+ onFilterInput: (e: ChangeEvent<HTMLInputElement>) => void;
213
+ /** Marks Backspace/Delete held; defer debounce until keyup. */
214
+ onFilterKeyDown: (e: KeyboardEvent<HTMLInputElement>) => void;
215
+ /** On Backspace/Delete release, starts the deferred debounce. */
216
+ onFilterKeyUp: (e: KeyboardEvent<HTMLInputElement>) => void;
217
+ /** On blur during hold, flush deferred debounce. */
218
+ onFilterBlur: (e: FocusEvent<HTMLInputElement>) => void;
219
+ /** Placeholder for the search input. */
220
+ searchPlaceholder: string;
221
+ /** Optional custom footer rendered below the option list. */
222
+ menuFooter?: ReactNode;
223
+ /** Close the menu, discarding the multi-select draft. */
224
+ closeMenu: () => void;
225
+ /** Commit the multi-select draft, then close. */
226
+ commitAndClose: () => void;
227
+ /** tv() class for the search container. */
228
+ searchContainerClass: string;
229
+ /** tv() class for the search input. */
230
+ searchInputClass: string;
231
+ /** tv() class for the loader shown in place of the option list. */
232
+ loaderClass: string;
233
+ /** Replaces the option list with the loader. */
234
+ isLoading?: boolean;
235
+ /** Replaces the option list when set (async load failure). */
236
+ loadError?: ReactNode;
237
+ /** tv() class for the error container. */
238
+ errorClass: string;
239
+ /** Ref to the search input; focused when the menu opens. */
240
+ searchInputRef: RefObject<HTMLInputElement>;
241
+ /** Captures the menu's (possibly portaled) DOM node for the outside-click check. */
242
+ menuNodeRef: MutableRefObject<HTMLDivElement | null>;
243
+ /** Ref to the component wrapper, used to reach react-select's hidden control input. */
244
+ containerRef: RefObject<HTMLDivElement>;
245
+ /** Shown when provided; fired on reload-button click. */
246
+ onReload?: () => void;
247
+ /** Spins/disables the reload button. */
248
+ isReloading?: boolean;
249
+ /** Reload-button tooltip / aria-label. */
250
+ reloadTooltip?: string;
251
+ /** Records the input modality (see {@link ISelectOptionContext.interactionMode}); set to "keyboard" here. */
252
+ onInteractionMode: (mode: TSelectInteractionMode) => void;
253
+ }
254
+ export interface IOptionLabelOverlayProps {
255
+ anchorRef: RefObject<HTMLElement>;
256
+ className: string;
257
+ children: ReactNode;
258
+ }
259
+ export interface ITruncatedMultiValueProps {
260
+ /** The plain-text label, used as the Tooltip title. */
261
+ label: string;
262
+ /** react-select's rendered chip (MultiValueContainer + label + remove). */
263
+ chip: ReactElement;
264
+ }
265
+ export interface ISelectComponentsConfig {
266
+ prefixIcon?: TIconType | ReactNode;
267
+ suffixIcon?: TIconType | ReactNode;
268
+ maxVisibleValues: number;
269
+ maxVisibleValuesMsg?: string;
270
+ disabled: boolean;
20
271
  }
@@ -0,0 +1,39 @@
1
+ import { type ReactNode } from "react";
2
+ import type { GroupBase } from "react-select";
3
+ import { type TPrefetch } from "@hooks";
4
+ import type { IOption, TSelectLoadOptions, TSelectOptions } from "./types";
5
+ interface IUseSelectOptionSourceArgs<Group extends GroupBase<IOption>> {
6
+ options?: TSelectOptions<Group>;
7
+ loadOptions?: TSelectLoadOptions;
8
+ initialOptions?: readonly IOption[];
9
+ prefetch?: TPrefetch;
10
+ refetchOnClear?: boolean;
11
+ optionsKey?: string | number;
12
+ loadErrorMessage?: ReactNode;
13
+ showReloadButton?: boolean;
14
+ onLoadError?: (error: unknown) => void;
15
+ /** Consumer-owned loading flag; OR-ed with the async loader rather than replaced by it. */
16
+ isLoading?: boolean;
17
+ onReload?: () => void;
18
+ isReloading?: boolean;
19
+ onFilterChange?: (query: string) => void;
20
+ }
21
+ interface ISelectOptionSource<Group extends GroupBase<IOption>> {
22
+ options: TSelectOptions<Group>;
23
+ isServerFiltered: boolean;
24
+ /** Loader instead of rows (SelectMenu's `isLoading`). */
25
+ isLoading: boolean;
26
+ isReloading?: boolean;
27
+ onReload?: () => void;
28
+ /** Hand to `useFilterQuery`; notifies the consumer AND drives the async source. */
29
+ onFilterQueryChange: (query: string) => void;
30
+ ensureDefaults: () => void;
31
+ loadError?: ReactNode;
32
+ }
33
+ /**
34
+ * All of `Select`'s option-source policy: async vs sync mode detection, value precedence between the
35
+ * consumer's own flags and the loader's derived ones, default messages, and the dev warnings for the
36
+ * two footguns a type-level XOR cannot express against react-select's generics.
37
+ */
38
+ export declare function useSelectOptionSource<Group extends GroupBase<IOption>>({ options, loadOptions, initialOptions, prefetch, refetchOnClear, optionsKey, loadErrorMessage, showReloadButton, onLoadError, isLoading, onReload, isReloading, onFilterChange }: IUseSelectOptionSourceArgs<Group>): ISelectOptionSource<Group>;
39
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type MutableRefObject } from "react";
2
+ interface IUseSelectOutsideCloseArgs {
3
+ /** Only while the menu is open is a listener attached. */
4
+ menuOpen: boolean;
5
+ /** The menu's (possibly portaled) DOM node, so clicks inside it are not "outside". */
6
+ menuNodeRef: MutableRefObject<HTMLDivElement | null>;
7
+ /** Commits the multi-select draft, then closes. */
8
+ commitAndClose: () => void;
9
+ }
10
+ /**
11
+ * Closes the dropdown on interaction outside the component. react-select's own outside-click
12
+ * handling relies on its input being focused (it is not — focus lives in the dropdown search input),
13
+ * so Select handles it here instead.
14
+ */
15
+ export declare function useSelectOutsideClose({ menuOpen, menuNodeRef, commitAndClose }: IUseSelectOutsideCloseArgs): void;
16
+ export {};
@@ -1,3 +1,6 @@
1
1
  import { type StylesConfig, type GroupBase } from "react-select";
2
2
  import { type TSelectSize, type IOption } from "./types";
3
+ export declare const SELECT_ALL_VALUE = "select-all";
4
+ export declare const getSelectableOptions: (options: readonly (IOption | GroupBase<IOption>)[]) => IOption[];
5
+ export declare const areAllSelectableSelected: (selectable: readonly IOption[], draftValues: ReadonlySet<IOption["value"]>) => boolean;
3
6
  export declare const reactSelectCustomStyles: <IsMulti extends boolean, Group extends GroupBase<IOption>>(error: boolean, size: TSelectSize, multiSelect: boolean) => StylesConfig<IOption, IsMulti, Group>;
@@ -105,15 +105,14 @@ export interface ITabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "
105
105
  * Variant of the tab.
106
106
  * @default text
107
107
  */
108
- variant?: "filled" | "text" | "brick";
108
+ variant?: "filled" | "text" | "brick" | "contained";
109
109
  /**
110
110
  * Color of the tab. Only applicable for filled variant.
111
111
  */
112
112
  color?: "primary" | "secondary";
113
113
  }
114
- declare const TabsComponent: React.ForwardRefExoticComponent<ITabsProps & React.RefAttributes<HTMLDivElement>>;
115
- type TTabsType = typeof TabsComponent & {
114
+ type TTabsType = React.ForwardRefExoticComponent<React.PropsWithoutRef<ITabsProps> & React.RefAttributes<HTMLDivElement>> & {
116
115
  Tab: typeof Tab;
117
116
  };
118
- declare const Tabs: TTabsType;
119
- export { Tabs };
117
+ export declare const Tabs: TTabsType;
118
+ export {};
@@ -28,6 +28,10 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
28
28
  filled: {
29
29
  listItem: string;
30
30
  };
31
+ contained: {
32
+ list: string;
33
+ listItem: string[];
34
+ };
31
35
  };
32
36
  color: {
33
37
  primary: {};
@@ -72,6 +76,10 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
72
76
  filled: {
73
77
  listItem: string;
74
78
  };
79
+ contained: {
80
+ list: string;
81
+ listItem: string[];
82
+ };
75
83
  };
76
84
  color: {
77
85
  primary: {};
@@ -116,6 +124,10 @@ export declare const tabsVariants: import("tailwind-variants").TVReturnType<{
116
124
  filled: {
117
125
  listItem: string;
118
126
  };
127
+ contained: {
128
+ list: string;
129
+ listItem: string[];
130
+ };
119
131
  };
120
132
  color: {
121
133
  primary: {};
@@ -18,14 +18,25 @@ export interface ITooltipProps extends React.HTMLAttributes<HTMLDivElement> {
18
18
  className?: string;
19
19
  /** Override trigger element class names */
20
20
  triggerElementClassName?: string;
21
- /** Callback executed on trigger click */
22
- onTriggerClick?: () => void;
23
21
  /** Render tooltip outside portal @default false */
24
22
  renderOutsidePortal?: boolean;
25
- /** aria-label for the trigger element */
26
- triggerAriaLabel?: string;
27
- /** Disable tooltip interactions @default false */
28
- disabled?: boolean;
23
+ /**
24
+ * Opt a custom trigger into the "interactive" path. Native interactive
25
+ * elements (`button`, `a`, `summary`, `input`, `select`, `textarea`) are
26
+ * detected automatically, but a custom component (e.g. this library's
27
+ * `Button`) cannot be introspected. Set this when the trigger is a custom
28
+ * component that renders a real interactive element and forwards its `ref`
29
+ * and DOM props (`onClick`, `aria-*`, `className`) to it. When true the
30
+ * reference props are merged directly onto the trigger instead of wrapping it
31
+ * in a `span`. @default false
32
+ */
33
+ interactiveTrigger?: boolean;
34
+ /**
35
+ * Master gate for whether the tooltip may open. When `false` no interaction opens the popover and
36
+ * the wrapper leaves the tab order, but the trigger still renders exactly as normal.
37
+ * Gate it on a condition, e.g. `canOpen={isTruncated}`. @default true
38
+ */
39
+ canOpen?: boolean;
29
40
  }
30
41
  export declare const Tooltip: React.ForwardRefExoticComponent<ITooltipProps & React.RefAttributes<HTMLDivElement>>;
31
42
  export {};
@@ -11,8 +11,8 @@ export declare const tooltipVariants: import("tailwind-variants").TVReturnType<{
11
11
  title: string;
12
12
  };
13
13
  };
14
- disabled: {
15
- true: {
14
+ interactive: {
15
+ false: {
16
16
  trigger: string;
17
17
  };
18
18
  };
@@ -35,8 +35,8 @@ export declare const tooltipVariants: import("tailwind-variants").TVReturnType<{
35
35
  title: string;
36
36
  };
37
37
  };
38
- disabled: {
39
- true: {
38
+ interactive: {
39
+ false: {
40
40
  trigger: string;
41
41
  };
42
42
  };
@@ -59,8 +59,8 @@ export declare const tooltipVariants: import("tailwind-variants").TVReturnType<{
59
59
  title: string;
60
60
  };
61
61
  };
62
- disabled: {
63
- true: {
62
+ interactive: {
63
+ false: {
64
64
  trigger: string;
65
65
  };
66
66
  };
@@ -0,0 +1,3 @@
1
+ export { TransferList } from "./transferList";
2
+ export { transferListVariants } from "./transferListVariants";
3
+ export type { ITransferListProps, ITransferListItem, TTransferListValue, TTransferPanel, TTransferListLoadOptions, TTransferListPrefetch } from "./types";
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import type { ITransferListProps } from "./types";
3
+ /**
4
+ * A fully-controlled two-panel transfer list. Move items between the Available
5
+ * and Selected panels via checkboxes + arrow controls or native drag-and-drop.
6
+ * Rendering and ownership of any surrounding chrome (modal, footer) is left to
7
+ * the consumer. The forwarded ref lands on the wrapper `<div>`.
8
+ */
9
+ export declare const TransferList: React.ForwardRefExoticComponent<ITransferListProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import type { ITransferListItem, TTransferPanel } from "./types";
3
+ interface ITransferListItemProps {
4
+ item: ITransferListItem;
5
+ panel: TTransferPanel;
6
+ index: number;
7
+ /** Row element id, referenced by the panel listbox's aria-activedescendant. */
8
+ id: string;
9
+ checked: boolean;
10
+ /** The row the keyboard navigation has landed on (highlighted, no DOM focus). */
11
+ active: boolean;
12
+ reorderable: boolean;
13
+ disabled: boolean;
14
+ isFirst: boolean;
15
+ isLast: boolean;
16
+ showTopIndicator: boolean;
17
+ showBottomIndicator: boolean;
18
+ onToggle: () => void;
19
+ onRemove?: () => void;
20
+ onMoveUp?: () => void;
21
+ onMoveDown?: () => void;
22
+ onDragStart: (e: React.DragEvent) => void;
23
+ onDragEnd: () => void;
24
+ onDragOver: (e: React.DragEvent) => void;
25
+ onDrop: (e: React.DragEvent) => void;
26
+ }
27
+ /**
28
+ * A single transfer list row: drag handle + position badge (selected, reorderable
29
+ * only), checkbox, label, and remove / reorder controls.
30
+ */
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;
32
+ export declare namespace TransferListItem {
33
+ var displayName: string;
34
+ }
35
+ export {};
@@ -0,0 +1,64 @@
1
+ import * as React from "react";
2
+ import type { ITransferListItem, TTransferListValue, TTransferPanel } from "./types";
3
+ interface ITransferListPanelProps {
4
+ panel: TTransferPanel;
5
+ title: React.ReactNode;
6
+ items: ITransferListItem[];
7
+ reorderable: boolean;
8
+ disabled: boolean;
9
+ emptyText: React.ReactNode;
10
+ searchable: boolean;
11
+ searchValue: string;
12
+ searchPlaceholder: string;
13
+ onSearchChange: (query: string) => void;
14
+ headerSlot?: React.ReactNode;
15
+ reloadTooltip?: string;
16
+ onReload?: () => void;
17
+ isReloading?: boolean;
18
+ hasMore?: boolean;
19
+ onLoadMore?: () => void;
20
+ isLoadingMore?: boolean;
21
+ /** Loader REPLACES the rows (a search/refresh fetch, not a page append). */
22
+ isLoading?: boolean;
23
+ /** Replaces the rows when set: the panel's source failed to load. */
24
+ loadError?: React.ReactNode;
25
+ /** Shown under the loaded rows when a page append failed; renders a retry button. */
26
+ loadMoreError?: React.ReactNode;
27
+ /** Fired by the retry button under `loadMoreError`. */
28
+ onRetryLoadMore?: () => void;
29
+ /** Label for that retry button. */
30
+ retryLabel?: string;
31
+ /** Server-side total; the header count becomes "(loaded of total)". */
32
+ totalCount?: number;
33
+ selectAllChecked: boolean;
34
+ selectAllIndeterminate: boolean;
35
+ /** Search-visible, non-disabled row count — the scope the select-all checkbox acts on. */
36
+ selectAllCount: number;
37
+ onToggleSelectAll: () => void;
38
+ moveLabel: string;
39
+ moveCount: number;
40
+ moveDisabled: boolean;
41
+ moveIconSide: "left" | "right";
42
+ onMove: () => void;
43
+ isChecked: (value: TTransferListValue) => boolean;
44
+ onToggle: (value: TTransferListValue) => void;
45
+ onRemove?: (value: TTransferListValue) => void;
46
+ onMoveUp?: (index: number) => void;
47
+ onMoveDown?: (index: number) => void;
48
+ dropIndex: number | null;
49
+ showDropOverlay: boolean;
50
+ onItemDragStart: (e: React.DragEvent, value: TTransferListValue) => void;
51
+ onItemDragEnd: () => void;
52
+ onItemDragOver: (e: React.DragEvent, index: number) => void;
53
+ onListDragOver: (e: React.DragEvent) => void;
54
+ onListDrop: (e: React.DragEvent) => void;
55
+ }
56
+ /**
57
+ * One panel of the transfer list: header (title, count, optional reload),
58
+ * optional search + header slot, and a scrollable list of rows or an empty state.
59
+ */
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;
61
+ export declare namespace TransferListPanel {
62
+ var displayName: string;
63
+ }
64
+ export {};
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import type { TTransferPanel } from "./types";
3
+ interface ITransferListPanelHeaderProps {
4
+ panel: TTransferPanel;
5
+ title: React.ReactNode;
6
+ /** Rows currently loaded in this panel. */
7
+ count: number;
8
+ /** Server-side total; the count becomes "(loaded of total)" when it exceeds `count`. */
9
+ totalCount?: number;
10
+ disabled: boolean;
11
+ searchable: boolean;
12
+ searchValue: string;
13
+ searchPlaceholder: string;
14
+ onSearchChange: (query: string) => void;
15
+ headerSlot?: React.ReactNode;
16
+ reloadTooltip?: string;
17
+ onReload?: () => void;
18
+ isReloading?: boolean;
19
+ }
20
+ /**
21
+ * The non-interactive chrome above a transfer-list panel's listbox: title + count, the optional
22
+ * reload button, the search input, and the consumer's header slot. It shares no state with the
23
+ * listbox below it.
24
+ */
25
+ export declare function TransferListPanelHeader({ panel, title, count, totalCount, disabled, searchable, searchValue, searchPlaceholder, onSearchChange, headerSlot, reloadTooltip, onReload, isReloading }: ITransferListPanelHeaderProps): React.ReactElement;
26
+ export declare namespace TransferListPanelHeader {
27
+ var displayName: string;
28
+ }
29
+ export {};