@reopt-ai/opt-ui-primitives 1.4.2

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.
@@ -0,0 +1,1186 @@
1
+ import * as react from 'react';
2
+ import react__default, { CSSProperties, ComponentPropsWithoutRef, ReactNode, ReactElement } from 'react';
3
+ import * as _floating_ui_core from '@floating-ui/core';
4
+ import * as _floating_ui_react from '@floating-ui/react';
5
+ import { MiddlewareState, Placement, Strategy, OpenChangeReason } from '@floating-ui/react';
6
+ import * as _floating_ui_react_dom from '@floating-ui/react-dom';
7
+ import * as react_jsx_runtime from 'react/jsx-runtime';
8
+
9
+ /**
10
+ * Manages controlled/uncontrolled state for input components.
11
+ * When `controlledValue` is provided, acts as controlled; otherwise uses internal state.
12
+ */
13
+ declare function useControllableState<T>(defaultValue: T, controlledValue: T | undefined, onChange: ((value: T) => void) | undefined): [T, (value: T) => void];
14
+
15
+ type AnimationState = "idle" | "entering" | "entered" | "leaving";
16
+ /**
17
+ * Manages data-enter/data-leave animation attributes.
18
+ *
19
+ * The leave phase waits on the Web Animations API — `element.getAnimations()`
20
+ * (element-scoped, NOT the subtree) — so unmount happens exactly when the
21
+ * element's own CSS transition/animation settles. This replaces the previous
22
+ * animationend/transitionend listener approach, which had two defects:
23
+ * 1. a hardcoded 300ms fallback that unmounted BEFORE any longer animation,
24
+ * 2. listeners on the root element that also fired on a DESCENDANT's
25
+ * transitionend (bubbling), unmounting the panel prematurely.
26
+ * Because `getAnimations()` reports only the element's own animations, a child
27
+ * finishing its transition can no longer end the parent early.
28
+ *
29
+ * Flow:
30
+ * open=true → mount → rAF → data-enter (triggers CSS transition/animation)
31
+ * open=false → data-leave → await own getAnimations().finished → unmount
32
+ *
33
+ * Environments without the Web Animations API (e.g. jsdom) unmount on the next
34
+ * animation frame — the data-leave frame still paints, with no magic timeout.
35
+ */
36
+ declare function useEnterLeave(open: boolean, options?: {
37
+ animated?: boolean;
38
+ }): {
39
+ ref: react.RefObject<HTMLElement | null>;
40
+ mounted: boolean;
41
+ dataAttributes: Record<string, string>;
42
+ state: AnimationState;
43
+ };
44
+
45
+ /** Returns `focusVisibleProps` to spread on a focusable element. */
46
+ declare function useFocusVisible(): {
47
+ focusVisibleProps: {
48
+ onFocus: (e: React.FocusEvent) => void;
49
+ onBlur: (e: React.FocusEvent) => void;
50
+ };
51
+ };
52
+
53
+ /** Options for `RovingTabindex`. */
54
+ interface RovingTabindexOptions {
55
+ orientation?: "horizontal" | "vertical" | "both";
56
+ loop?: boolean;
57
+ rtl?: boolean;
58
+ /**
59
+ * Grid mode: the number of columns the items are laid out in. When set,
60
+ * ArrowUp/ArrowDown move by a whole row (±columns) and ArrowLeft/ArrowRight
61
+ * by one cell, regardless of `orientation` (WAI-ARIA grid pattern).
62
+ */
63
+ columns?: number;
64
+ }
65
+ /**
66
+ * Implements roving tabindex pattern for keyboard navigation.
67
+ *
68
+ * Only the active item has tabindex="0", all others have tabindex="-1".
69
+ * Arrow keys move focus between items. Sets data-active-item on the focused element.
70
+ *
71
+ * Compatible with the legacy Composite data-active-item styling contract.
72
+ */
73
+ declare function useRovingTabindex(options?: RovingTabindexOptions): {
74
+ containerRef: react.RefObject<HTMLElement | null>;
75
+ containerProps: {
76
+ ref: react.RefObject<HTMLElement | null>;
77
+ onKeyDown: (e: React.KeyboardEvent) => void;
78
+ };
79
+ activeId: string | null;
80
+ register: (id: string, element: HTMLElement, disabled?: boolean) => void;
81
+ unregister: (id: string) => void;
82
+ moveTo: (id: string) => void;
83
+ getTabIndex: (id: string) => 0 | -1;
84
+ };
85
+
86
+ /** Why an overlay's open state changed, forwarded to `onOpenChange`. */
87
+ type DismissReason = "escape-key" | "outside-press" | "ancestor-scroll";
88
+ /** Dismissal behavior. `true` enables outside-press + escape-key. */
89
+ type DismissConfig = boolean | {
90
+ outsidePress?: boolean;
91
+ escapeKey?: boolean;
92
+ ancestorScroll?: boolean;
93
+ };
94
+ /** Physical side a popup is placed on, derived from the resolved placement. */
95
+ type Side = "top" | "right" | "bottom" | "left";
96
+ /** Alignment of a popup along its side. */
97
+ type Align = "start" | "center" | "end";
98
+ /** Arguments passed to a function-valued offset. */
99
+ interface OffsetArgs {
100
+ rects: MiddlewareState["rects"];
101
+ placement: Placement;
102
+ }
103
+ /** A fixed pixel offset or one derived from the anchor/popup dimensions. */
104
+ type OffsetValue = number | ((args: OffsetArgs) => number);
105
+ /** Options for `useFloating`. */
106
+ interface UseFloatingOptions {
107
+ placement?: Placement;
108
+ strategy?: Strategy;
109
+ /** @deprecated Use `sideOffset`. Distance from the anchor along the side axis. */
110
+ gutter?: number;
111
+ /** Distance from the anchor along the side (main) axis. Default 4. */
112
+ sideOffset?: OffsetValue;
113
+ /** Distance along the alignment (cross) axis. */
114
+ alignOffset?: OffsetValue;
115
+ sameWidth?: boolean;
116
+ flip?: boolean;
117
+ /**
118
+ * Once positioned, keep the flipped side sticky instead of flipping back as
119
+ * the popup content resizes (e.g. a combobox list shrinking per keystroke).
120
+ */
121
+ lazyFlip?: boolean;
122
+ shift?: number | boolean;
123
+ overflowPadding?: number;
124
+ open?: boolean;
125
+ /** Called when floating-ui requests a close (dismiss). */
126
+ onOpenChange?: (open: boolean, reason?: DismissReason) => void;
127
+ /**
128
+ * Delegate outside-press / escape-key dismissal to @floating-ui/react's
129
+ * `useDismiss` (shadow-DOM-safe, reference-aware) instead of hand-rolled
130
+ * document listeners. Off unless set. Requires `onOpenChange`.
131
+ */
132
+ dismiss?: DismissConfig;
133
+ }
134
+ /**
135
+ * Wraps @floating-ui/react with an API compatible with the legacy popover
136
+ * positioning layer. Maps options (sideOffset/alignOffset, sameWidth, flip,
137
+ * shift, lazyFlip) to Floating UI middleware and surfaces positioning state
138
+ * (side/align/isPositioned/anchorHidden) plus CSS custom properties — without
139
+ * imposing any visual styling.
140
+ */
141
+ declare function useFloating(options?: UseFloatingOptions): {
142
+ refs: {
143
+ reference: react.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>;
144
+ floating: React.MutableRefObject<HTMLElement | null>;
145
+ setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void;
146
+ setFloating: (node: HTMLElement | null) => void;
147
+ } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>;
148
+ floatingStyles: CSSProperties;
149
+ placement: Placement;
150
+ side: Side;
151
+ align: Align;
152
+ isPositioned: boolean;
153
+ anchorHidden: boolean;
154
+ context: {
155
+ x: number;
156
+ y: number;
157
+ placement: Placement;
158
+ strategy: Strategy;
159
+ middlewareData: _floating_ui_core.MiddlewareData;
160
+ isPositioned: boolean;
161
+ update: () => void;
162
+ floatingStyles: React.CSSProperties;
163
+ open: boolean;
164
+ onOpenChange: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;
165
+ events: _floating_ui_react.FloatingEvents;
166
+ dataRef: React.MutableRefObject<_floating_ui_react.ContextData>;
167
+ nodeId: string | undefined;
168
+ floatingId: string | undefined;
169
+ refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>;
170
+ elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>;
171
+ };
172
+ getReferenceProps: () => {
173
+ ref: ((node: _floating_ui_react_dom.ReferenceType | null) => void) & ((node: _floating_ui_react.ReferenceType | null) => void);
174
+ };
175
+ getFloatingProps: () => {
176
+ ref: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
177
+ style: CSSProperties;
178
+ };
179
+ /**
180
+ * `data-open`/`data-closed`/`data-side`/`data-align`/`data-anchor-hidden`
181
+ * for the positioner. Additive — spread onto the panel alongside existing
182
+ * data attributes so Core can target open state, resolved side, and anchor
183
+ * visibility with CSS only.
184
+ */
185
+ getPositionerStateProps: (isOpen: boolean) => Record<string, string>;
186
+ };
187
+
188
+ /**
189
+ * Generates a stable unique ID for a component.
190
+ * Uses React's built-in useId() for SSR-safe ID generation.
191
+ */
192
+ declare function useId(providedId?: string): string;
193
+
194
+ /** Options for {@link useFocusableWhenDisabled}. */
195
+ interface FocusableWhenDisabledOptions {
196
+ disabled?: boolean;
197
+ /**
198
+ * Keep the element focusable and announced while disabled (APG pattern):
199
+ * emit `aria-disabled` instead of the native `disabled` attribute so it stays
200
+ * in the tab order and accessibility tree. The consumer must still suppress
201
+ * activation (Enter/Space/click) while disabled.
202
+ */
203
+ focusableWhenDisabled?: boolean;
204
+ /** Whether the target is a native `<button>` (which takes `disabled`). */
205
+ isNativeButton?: boolean;
206
+ /** tabIndex to apply to a non-native element to keep it focusable. */
207
+ tabIndex?: number;
208
+ }
209
+ /** Attribute props to spread onto the focusable element. */
210
+ interface FocusableWhenDisabledProps {
211
+ disabled?: boolean;
212
+ "aria-disabled"?: true;
213
+ tabIndex?: number;
214
+ }
215
+ /**
216
+ * Resolve the disabled/aria-disabled/tabIndex attributes for a control that may
217
+ * stay focusable while disabled.
218
+ *
219
+ * Native `disabled` removes an element from the tab order AND the accessibility
220
+ * tree — a screen-reader user tabbing through never learns the control exists.
221
+ * The APG "focusable disabled" pattern keeps it reachable via `aria-disabled`
222
+ * instead. This is opt-in (`focusableWhenDisabled`) so existing behavior — a
223
+ * plain native `disabled` — is unchanged by default.
224
+ */
225
+ declare function useFocusableWhenDisabled({ disabled, focusableWhenDisabled, isNativeButton, tabIndex, }: FocusableWhenDisabledOptions): FocusableWhenDisabledProps;
226
+
227
+ /**
228
+ * Virtual-focus widgets (Menu/Select/Combobox/Command) keep DOM focus on the
229
+ * input/container and point `aria-activedescendant` at the active option, so the
230
+ * browser does NOT auto-scroll the highlighted option into view. Call this with
231
+ * the active option's element id to scroll it into view on each move — keeping
232
+ * the highlight visible when arrowing past the scrollable viewport edge.
233
+ *
234
+ * `block: "nearest"` avoids scrolling when the option is already fully visible.
235
+ */
236
+ declare function useScrollActiveDescendantIntoView(activeId: string | null | undefined): void;
237
+
238
+ /** Props for `DisclosureRoot`. */
239
+ interface DisclosureRootProps {
240
+ children: ReactNode;
241
+ open?: boolean;
242
+ defaultOpen?: boolean;
243
+ /** Called when the open state changes. */
244
+ onOpenChange?: (open: boolean) => void;
245
+ /** @deprecated Use `onOpenChange`. */
246
+ setOpen?: (open: boolean) => void;
247
+ animated?: boolean;
248
+ }
249
+ /** Renders the `DisclosureRoot` component. */
250
+ declare function DisclosureRoot({ children, open: controlledOpen, defaultOpen, onOpenChange, setOpen: setOpenDeprecated, animated, }: DisclosureRootProps): react_jsx_runtime.JSX.Element;
251
+ /** Props for `DisclosureTrigger`. */
252
+ interface DisclosureTriggerProps extends ComponentPropsWithoutRef<"button"> {
253
+ }
254
+ /** Renders the `DisclosureTrigger` component. */
255
+ declare function DisclosureTrigger({ onClick, ...props }: DisclosureTriggerProps): react_jsx_runtime.JSX.Element;
256
+ /** Props for `DisclosureContent`. */
257
+ interface DisclosureContentProps extends ComponentPropsWithoutRef<"div"> {
258
+ /**
259
+ * When closed, keep the content in the DOM as `hidden="until-found"` (instead
260
+ * of unmounting) so browser find-in-page can reveal it. Chromium progressive
261
+ * enhancement; disables the enter/leave animation for this content. On reveal
262
+ * a `beforematch` event opens the disclosure so state stays consistent.
263
+ */
264
+ hiddenUntilFound?: boolean;
265
+ }
266
+ /** Renders the `DisclosureContent` component. */
267
+ declare function DisclosureContent({ hiddenUntilFound, style, ...props }: DisclosureContentProps): react_jsx_runtime.JSX.Element | null;
268
+
269
+ /** Props for `Button`. */
270
+ interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
271
+ /**
272
+ * Whether Enter activates the button. Set to `false` to suppress the native
273
+ * Enter→click (e.g. a non-submit button inside a form). Default: native.
274
+ */
275
+ clickOnEnter?: boolean;
276
+ /**
277
+ * Whether Space activates the button. Set to `false` to suppress the native
278
+ * Space→click. Default: native.
279
+ */
280
+ clickOnSpace?: boolean;
281
+ /**
282
+ * Keep the button focusable and announced while disabled (APG pattern):
283
+ * emits `aria-disabled` instead of the native `disabled` attribute and blocks
284
+ * activation. Default: false — a disabled button uses native `disabled`.
285
+ */
286
+ focusableWhenDisabled?: boolean;
287
+ }
288
+ /**
289
+ * Accessible button primitive.
290
+ * Native <button> with keyboard handling defaults.
291
+ * Zero-overhead button primitive for the current stack.
292
+ */
293
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
294
+
295
+ /**
296
+ * Returns a function that closes the nearest dialog. Useful for custom dismiss
297
+ * affordances (e.g. swipe-to-dismiss) that aren't a `DialogDismiss` button.
298
+ */
299
+ declare function useDialogClose(): () => void;
300
+ /** Props for `DialogRoot`. */
301
+ interface DialogRootProps {
302
+ children: ReactNode;
303
+ open?: boolean;
304
+ defaultOpen?: boolean;
305
+ /** Called when the open state changes. */
306
+ onOpenChange?: (open: boolean) => void;
307
+ /** @deprecated Use `onOpenChange`. */
308
+ setOpen?: (open: boolean) => void;
309
+ animated?: boolean;
310
+ }
311
+ /** Renders the `DialogRoot` component. */
312
+ declare function DialogRoot({ children, open: controlledOpen, defaultOpen, onOpenChange, setOpen: setOpenDeprecated, animated, }: DialogRootProps): react_jsx_runtime.JSX.Element;
313
+ /** Props for `DialogDisclosure`. */
314
+ interface DialogDisclosureProps extends ComponentPropsWithoutRef<"button"> {
315
+ }
316
+ declare const DialogDisclosure: react.ForwardRefExoticComponent<DialogDisclosureProps & react.RefAttributes<HTMLButtonElement>>;
317
+ /** Props for `DialogPanel`. */
318
+ interface DialogPanelProps extends Omit<ComponentPropsWithoutRef<"dialog">, "open"> {
319
+ backdrop?: ReactNode;
320
+ /** Close when the backdrop (outside the panel) is pressed. Default true. */
321
+ dismissOnBackdrop?: boolean;
322
+ /** Close on the Escape key. Default true. Alert dialogs set this false. */
323
+ dismissOnEscape?: boolean;
324
+ }
325
+ declare const DialogPanel: react.ForwardRefExoticComponent<DialogPanelProps & react.RefAttributes<HTMLDialogElement>>;
326
+ /** Props for `AlertDialogPanel`. */
327
+ interface AlertDialogPanelProps extends Omit<DialogPanelProps, "role"> {
328
+ }
329
+ /**
330
+ * A dialog that demands an explicit choice: `role="alertdialog"` and no
331
+ * backdrop/Escape dismissal by default. Compose with the other Dialog parts
332
+ * (DialogRoot/Disclosure/Heading/Description/Dismiss).
333
+ */
334
+ declare const AlertDialogPanel: react.ForwardRefExoticComponent<AlertDialogPanelProps & react.RefAttributes<HTMLDialogElement>>;
335
+ /** Props for `DialogHeading`. */
336
+ interface DialogHeadingProps extends ComponentPropsWithoutRef<"h2"> {
337
+ }
338
+ /** Renders the `DialogHeading` component. */
339
+ declare function DialogHeading(props: DialogHeadingProps): react_jsx_runtime.JSX.Element;
340
+ /** Props for `DialogDescription`. */
341
+ interface DialogDescriptionProps extends ComponentPropsWithoutRef<"p"> {
342
+ }
343
+ /** Renders the `DialogDescription` component. */
344
+ declare function DialogDescription(props: DialogDescriptionProps): react_jsx_runtime.JSX.Element;
345
+ /** Props for `DialogDismiss`. */
346
+ interface DialogDismissProps extends ComponentPropsWithoutRef<"button"> {
347
+ }
348
+ declare const DialogDismiss: react.ForwardRefExoticComponent<DialogDismissProps & react.RefAttributes<HTMLButtonElement>>;
349
+
350
+ /** Props for `TabsRoot`. */
351
+ interface TabsRootProps {
352
+ children: ReactNode;
353
+ selectedId?: string;
354
+ defaultSelectedId?: string;
355
+ /** Called when the selected tab changes. */
356
+ onSelectedIdChange?: (id: string) => void;
357
+ /** @deprecated Use `onSelectedIdChange`. */
358
+ setSelectedId?: (id: string) => void;
359
+ orientation?: "horizontal" | "vertical";
360
+ }
361
+ /** Renders the `TabsRoot` component. */
362
+ declare function TabsRoot({ children, selectedId: controlledId, defaultSelectedId, onSelectedIdChange, setSelectedId: setSelectedIdDeprecated, orientation, }: TabsRootProps): react_jsx_runtime.JSX.Element;
363
+ /** Props for `TabList`. */
364
+ interface TabListProps extends ComponentPropsWithoutRef<"div"> {
365
+ }
366
+ /** Renders the `TabList` component. */
367
+ declare function TabList({ role, onKeyDown, ...props }: TabListProps): react_jsx_runtime.JSX.Element;
368
+ /** Props for `Tab`. */
369
+ interface TabProps extends Omit<ComponentPropsWithoutRef<"button">, "id"> {
370
+ id: string;
371
+ disabled?: boolean;
372
+ }
373
+ /** Renders the `Tab` component. */
374
+ declare function Tab({ id, disabled, onClick, ...props }: TabProps): react_jsx_runtime.JSX.Element;
375
+ /** Props for `TabPanel`. */
376
+ interface TabPanelProps extends Omit<ComponentPropsWithoutRef<"div">, "id"> {
377
+ tabId: string;
378
+ }
379
+ /** Renders the `TabPanel` component. */
380
+ declare function TabPanel({ tabId, ...props }: TabPanelProps): react_jsx_runtime.JSX.Element | null;
381
+
382
+ interface RadioGroupContextValue {
383
+ name: string;
384
+ value: string;
385
+ setValue: (value: string) => void;
386
+ disabled: boolean;
387
+ orientation: "horizontal" | "vertical";
388
+ }
389
+ /** Returns the active `RadioGroupContext` value. */
390
+ declare function useRadioGroupContext(): RadioGroupContextValue | null;
391
+ /** Props for `RadioGroupRoot`. */
392
+ interface RadioGroupRootProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
393
+ children: ReactNode;
394
+ name?: string;
395
+ value?: string;
396
+ defaultValue?: string;
397
+ /** Called when the selected value changes. */
398
+ onValueChange?: (value: string) => void;
399
+ /** @deprecated Use `onValueChange`. */
400
+ onChange?: (value: string) => void;
401
+ disabled?: boolean;
402
+ orientation?: "horizontal" | "vertical";
403
+ }
404
+ /** Renders the `RadioGroupRoot` component. */
405
+ declare function RadioGroupRoot({ children, name: providedName, value: controlledValue, defaultValue, onValueChange, onChange, disabled, orientation, ...props }: RadioGroupRootProps): react_jsx_runtime.JSX.Element;
406
+ /** Props for `Radio`. */
407
+ interface RadioProps extends Omit<ComponentPropsWithoutRef<"input">, "onChange" | "type"> {
408
+ value: string;
409
+ disabled?: boolean;
410
+ }
411
+ declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
412
+
413
+ /** Where a portaled overlay mounts: an element, an element id, or body. */
414
+ type PortalRoot = HTMLElement | string | null;
415
+
416
+ /** Props for `TooltipProvider`. */
417
+ interface TooltipProviderProps {
418
+ children: ReactNode;
419
+ timeout?: number;
420
+ showTimeout?: number;
421
+ hideTimeout?: number;
422
+ placement?: "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
423
+ animated?: boolean;
424
+ /** Render the tooltip in a portal (escapes clipping). Default: false. */
425
+ portal?: boolean;
426
+ /** Portal mount target (element or element id). Defaults to document.body. */
427
+ portalRoot?: PortalRoot;
428
+ }
429
+ /** Renders the `TooltipProvider` component. */
430
+ declare function TooltipProvider({ children, timeout, showTimeout, hideTimeout, placement, animated, portal, portalRoot, }: TooltipProviderProps): react_jsx_runtime.JSX.Element;
431
+ /** Props for `TooltipAnchor`. */
432
+ interface TooltipAnchorProps extends ComponentPropsWithoutRef<"div"> {
433
+ /** Render a custom element instead of a wrapper div. The element receives tooltip props. */
434
+ render?: react__default.ReactElement;
435
+ }
436
+ declare const TooltipAnchor: react__default.ForwardRefExoticComponent<TooltipAnchorProps & react__default.RefAttributes<HTMLDivElement>>;
437
+ /** Props for `Tooltip`. */
438
+ interface TooltipProps extends ComponentPropsWithoutRef<"div"> {
439
+ }
440
+ /** Renders the `Tooltip` component. */
441
+ declare function Tooltip({ children, onMouseEnter, onMouseLeave, ...props }: TooltipProps): react_jsx_runtime.JSX.Element | null;
442
+
443
+ /** Props for `PopoverRoot`. */
444
+ interface PopoverRootProps {
445
+ children: ReactNode;
446
+ open?: boolean;
447
+ defaultOpen?: boolean;
448
+ /** Called when the open state changes. */
449
+ onOpenChange?: (open: boolean) => void;
450
+ /** @deprecated Use `onOpenChange`. */
451
+ setOpen?: (open: boolean) => void;
452
+ placement?: "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
453
+ /**
454
+ * Move focus into the panel on open and restore it to the trigger on close.
455
+ * Default: false — opt in, since many consumers manage focus themselves
456
+ * (e.g. a popover acting as a custom menu).
457
+ */
458
+ manageFocus?: boolean;
459
+ animated?: boolean;
460
+ /** Render the panel in a portal (escapes `overflow`/`transform` clipping).
461
+ * Default: false. */
462
+ portal?: boolean;
463
+ /** Portal mount target (element or element id). Defaults to document.body.
464
+ * Point this inside a themed subtree (e.g. opt-shell `[data-harness]`) to
465
+ * keep scoped design tokens applied. */
466
+ portalRoot?: PortalRoot;
467
+ }
468
+ /** Renders the `PopoverRoot` component. */
469
+ declare function PopoverRoot({ children, open: controlledOpen, defaultOpen, onOpenChange, setOpen: setOpenDeprecated, placement, manageFocus, animated, portal, portalRoot, }: PopoverRootProps): react_jsx_runtime.JSX.Element;
470
+ /** Props for `PopoverTrigger`. */
471
+ interface PopoverTriggerProps extends ComponentPropsWithoutRef<"button"> {
472
+ }
473
+ declare const PopoverTrigger: react.ForwardRefExoticComponent<PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>;
474
+ /** Props for `PopoverContent`. */
475
+ interface PopoverContentProps extends ComponentPropsWithoutRef<"div"> {
476
+ }
477
+ /** Renders the `PopoverContent` component. */
478
+ declare function PopoverContent({ children, ...props }: PopoverContentProps): react_jsx_runtime.JSX.Element | null;
479
+ /** Props for `PopoverClose`. */
480
+ interface PopoverCloseProps extends ComponentPropsWithoutRef<"button"> {
481
+ }
482
+ declare const PopoverClose: react.ForwardRefExoticComponent<PopoverCloseProps & react.RefAttributes<HTMLButtonElement>>;
483
+
484
+ /** Props for `SelectRoot`. */
485
+ interface SelectRootProps {
486
+ children: ReactNode;
487
+ /** Selected value(s). `string` in single mode, `string[]` when `multiple`. */
488
+ value?: string | string[];
489
+ defaultValue?: string | string[];
490
+ /** Called when the selected value changes. */
491
+ onValueChange?: (value: string | string[]) => void;
492
+ /** @deprecated Use `onValueChange`. */
493
+ setValue?: (value: string | string[]) => void;
494
+ /** Allow selecting more than one option. The value becomes a `string[]`. */
495
+ multiple?: boolean;
496
+ /** Form field name. Renders hidden input(s) so the value submits with a form. */
497
+ name?: string;
498
+ open?: boolean;
499
+ /** Called when the open state changes. */
500
+ onOpenChange?: (open: boolean) => void;
501
+ /** @deprecated Use `onOpenChange`. */
502
+ setOpen?: (open: boolean) => void;
503
+ animated?: boolean;
504
+ /** Render the listbox in a portal (escapes clipping). Default: false. */
505
+ portal?: boolean;
506
+ /** Portal mount target (element or element id). Defaults to document.body. */
507
+ portalRoot?: PortalRoot;
508
+ }
509
+ /** Renders the `SelectRoot` component. */
510
+ declare function SelectRoot({ children, value: controlledValue, defaultValue, onValueChange, setValue: setValueDeprecated, multiple, name, open: controlledOpen, onOpenChange, setOpen: setOpenDeprecated, animated, portal, portalRoot, }: SelectRootProps): react_jsx_runtime.JSX.Element;
511
+ /** Props for `SelectLabel`. */
512
+ interface SelectLabelProps extends ComponentPropsWithoutRef<"label"> {
513
+ }
514
+ /** Renders the `SelectLabel` component. */
515
+ declare function SelectLabel(props: SelectLabelProps): react_jsx_runtime.JSX.Element;
516
+ /** Props for `SelectTrigger`. */
517
+ interface SelectTriggerProps extends ComponentPropsWithoutRef<"button"> {
518
+ }
519
+ declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
520
+ /** Props for `SelectPopover`. */
521
+ interface SelectPopoverProps extends ComponentPropsWithoutRef<"div"> {
522
+ }
523
+ /** Renders the `SelectPopover` component. */
524
+ declare function SelectPopover({ children, ...props }: SelectPopoverProps): react_jsx_runtime.JSX.Element | null;
525
+ /** Props for `SelectItem`. */
526
+ interface SelectItemProps extends ComponentPropsWithoutRef<"div"> {
527
+ value: string;
528
+ disabled?: boolean;
529
+ }
530
+ /** Renders the `SelectItem` component. */
531
+ declare function SelectItem({ value: itemValue, disabled, onClick, children, ...props }: SelectItemProps): react_jsx_runtime.JSX.Element;
532
+
533
+ /** Props for `ComboboxRoot`. */
534
+ interface ComboboxRootProps {
535
+ children: ReactNode;
536
+ value?: string;
537
+ defaultValue?: string;
538
+ /** Called when the selected value changes. */
539
+ onValueChange?: (value: string) => void;
540
+ /** @deprecated Use `onValueChange`. */
541
+ setValue?: (value: string) => void;
542
+ open?: boolean;
543
+ /** Called when the open state changes. */
544
+ onOpenChange?: (open: boolean) => void;
545
+ /** @deprecated Use `onOpenChange`. */
546
+ setOpen?: (open: boolean) => void;
547
+ animated?: boolean;
548
+ /** Render the listbox in a portal (escapes clipping). Default: false. */
549
+ portal?: boolean;
550
+ /** Portal mount target (element or element id). Defaults to document.body. */
551
+ portalRoot?: PortalRoot;
552
+ }
553
+ /** Renders the `ComboboxRoot` component. */
554
+ declare function ComboboxRoot({ children, value: controlledValue, defaultValue, onValueChange, setValue: setValueDeprecated, open: controlledOpen, onOpenChange, setOpen: setOpenDeprecated, animated, portal, portalRoot, }: ComboboxRootProps): react_jsx_runtime.JSX.Element;
555
+ /** Props for `ComboboxInput`. */
556
+ interface ComboboxInputProps extends Omit<ComponentPropsWithoutRef<"input">, "value" | "onChange"> {
557
+ }
558
+ declare const ComboboxInput: react.ForwardRefExoticComponent<ComboboxInputProps & react.RefAttributes<HTMLInputElement>>;
559
+ /** Props for `ComboboxPopover`. */
560
+ interface ComboboxPopoverProps extends ComponentPropsWithoutRef<"div"> {
561
+ }
562
+ /** Renders the `ComboboxPopover` component. */
563
+ declare function ComboboxPopover({ children, ...props }: ComboboxPopoverProps): react_jsx_runtime.JSX.Element | null;
564
+ /** Props for `ComboboxItem`. */
565
+ interface ComboboxItemProps extends ComponentPropsWithoutRef<"div"> {
566
+ value: string;
567
+ disabled?: boolean;
568
+ }
569
+ /** Renders the `ComboboxItem` component. */
570
+ declare function ComboboxItem({ value: itemValue, disabled, onClick, children, ...props }: ComboboxItemProps): react_jsx_runtime.JSX.Element;
571
+ /** Props for `ComboboxGroup`. */
572
+ interface ComboboxGroupProps extends ComponentPropsWithoutRef<"div"> {
573
+ }
574
+ /** Renders the `ComboboxGroup` component. */
575
+ declare function ComboboxGroup({ children, ...props }: ComboboxGroupProps): react_jsx_runtime.JSX.Element;
576
+ /** Props for `ComboboxGroupLabel`. */
577
+ interface ComboboxGroupLabelProps extends ComponentPropsWithoutRef<"div"> {
578
+ }
579
+ /** Renders the `ComboboxGroupLabel` component. */
580
+ declare function ComboboxGroupLabel(props: ComboboxGroupLabelProps): react_jsx_runtime.JSX.Element;
581
+
582
+ /** Props for `CommandRoot`. */
583
+ interface CommandRootProps extends ComponentPropsWithoutRef<"div"> {
584
+ value?: string;
585
+ defaultValue?: string;
586
+ onValueChange?: (value: string) => void;
587
+ /** Whether items auto-filter based on `search`. Default: true. */
588
+ shouldFilter?: boolean;
589
+ /** Custom filter function. Default: case-insensitive substring match. */
590
+ filter?: (value: string, search: string, keywords: string[]) => boolean;
591
+ /** Called on Escape in the input — e.g. dismiss a host dialog. */
592
+ onEscape?: () => void;
593
+ }
594
+ /** Renders the `CommandRoot` component. */
595
+ declare function CommandRoot({ children, value: controlledValue, defaultValue, onValueChange, shouldFilter, filter, onEscape, ...props }: CommandRootProps): react_jsx_runtime.JSX.Element;
596
+ /** Props for `CommandInput`. */
597
+ interface CommandInputProps extends Omit<ComponentPropsWithoutRef<"input">, "value" | "onChange"> {
598
+ /** Optional controlled value. Falls back to root search state. */
599
+ value?: string;
600
+ /** Notified on every keystroke (in addition to root search update). */
601
+ onValueChange?: (value: string) => void;
602
+ }
603
+ declare const CommandInput: react.ForwardRefExoticComponent<CommandInputProps & react.RefAttributes<HTMLInputElement>>;
604
+ /** Props for `CommandList`. */
605
+ interface CommandListProps extends ComponentPropsWithoutRef<"div"> {
606
+ }
607
+ /** Renders the `CommandList` component. */
608
+ declare function CommandList({ children, ...props }: CommandListProps): react_jsx_runtime.JSX.Element;
609
+ /** Props for `CommandEmpty`. */
610
+ interface CommandEmptyProps extends ComponentPropsWithoutRef<"div"> {
611
+ }
612
+ /** Renders the `CommandEmpty` component. Hidden while any item is visible. */
613
+ declare function CommandEmpty({ children, ...props }: CommandEmptyProps): react_jsx_runtime.JSX.Element | null;
614
+ /** Props for `CommandGroup`. */
615
+ interface CommandGroupProps extends ComponentPropsWithoutRef<"div"> {
616
+ /** Optional heading rendered as group label. */
617
+ heading?: ReactNode;
618
+ }
619
+ /** Renders the `CommandGroup` component. */
620
+ declare function CommandGroup({ heading, children, ...props }: CommandGroupProps): react_jsx_runtime.JSX.Element;
621
+ /** Props for `CommandSeparator`. */
622
+ interface CommandSeparatorProps extends ComponentPropsWithoutRef<"div"> {
623
+ }
624
+ /** Renders the `CommandSeparator` component. */
625
+ declare function CommandSeparator(props: CommandSeparatorProps): react_jsx_runtime.JSX.Element;
626
+ /** Props for `CommandItem`. */
627
+ interface CommandItemProps extends Omit<ComponentPropsWithoutRef<"div">, "onSelect"> {
628
+ /** Searchable value for this item. Falls back to the rendered label. */
629
+ value: string;
630
+ /** Additional terms to match the search input against. */
631
+ keywords?: string[];
632
+ disabled?: boolean;
633
+ /** Fired on click or Enter when this item is active. */
634
+ onSelect?: (value: string) => void;
635
+ }
636
+ declare const CommandItem: react.ForwardRefExoticComponent<CommandItemProps & react.RefAttributes<HTMLDivElement>>;
637
+ /** Read live command state (search, active, value) inside descendants. */
638
+ declare function useCommandState(): {
639
+ search: string;
640
+ value: string;
641
+ activeValue: string;
642
+ visibleValues: string[];
643
+ };
644
+
645
+ interface MenubarContextValue {
646
+ activeMenuId: string | null;
647
+ setActiveMenuId: (id: string | null) => void;
648
+ }
649
+ /** Returns the active `MenubarContext` value. */
650
+ declare function useMenubarContext(): MenubarContextValue | null;
651
+ /** Props for `MenubarRoot`. */
652
+ interface MenubarRootProps {
653
+ children: ReactNode;
654
+ }
655
+ /** Renders the `MenubarRoot` component. */
656
+ declare function MenubarRoot({ children }: MenubarRootProps): react_jsx_runtime.JSX.Element;
657
+ /** Props for `MenubarContainer`. */
658
+ interface MenubarContainerProps extends ComponentPropsWithoutRef<"div"> {
659
+ }
660
+ /** Renders the `MenubarContainer` component. Arrow keys rove between triggers. */
661
+ declare function MenubarContainer({ onKeyDown, ...props }: MenubarContainerProps): react_jsx_runtime.JSX.Element;
662
+ /** Props for `MenuRoot`. */
663
+ interface MenuRootProps {
664
+ children: ReactNode;
665
+ open?: boolean;
666
+ /** Called when the open state changes. */
667
+ onOpenChange?: (open: boolean) => void;
668
+ /** @deprecated Use `onOpenChange`. */
669
+ setOpen?: (open: boolean) => void;
670
+ animated?: boolean;
671
+ /** Render the menu in a portal (escapes clipping). Default: false. */
672
+ portal?: boolean;
673
+ /** Portal mount target (element or element id). Defaults to document.body. */
674
+ portalRoot?: PortalRoot;
675
+ }
676
+ /** Renders the `MenuRoot` component. */
677
+ declare function MenuRoot({ children, open: controlledOpen, onOpenChange, setOpen: setOpenDeprecated, animated, portal, portalRoot, }: MenuRootProps): react_jsx_runtime.JSX.Element;
678
+ /** Props for `MenuTrigger`. */
679
+ interface MenuTriggerProps extends ComponentPropsWithoutRef<"button"> {
680
+ }
681
+ declare const MenuTrigger: react.ForwardRefExoticComponent<MenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
682
+ /** Props for `MenuPopover`. */
683
+ interface MenuPopoverProps extends ComponentPropsWithoutRef<"div"> {
684
+ }
685
+ /** Renders the `MenuPopover` component. */
686
+ declare function MenuPopover({ children, onKeyDown, ...props }: MenuPopoverProps): react_jsx_runtime.JSX.Element | null;
687
+ /** Props for `MenuItem`. */
688
+ interface MenuItemProps extends ComponentPropsWithoutRef<"div"> {
689
+ disabled?: boolean;
690
+ hideOnClick?: boolean;
691
+ }
692
+ /** Renders the `MenuItem` component. */
693
+ declare function MenuItem({ disabled, hideOnClick, onClick, children, ...props }: MenuItemProps): react_jsx_runtime.JSX.Element;
694
+ /** Props for `MenuItemCheckbox`. */
695
+ interface MenuItemCheckboxProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
696
+ checked?: boolean;
697
+ onChange?: (checked: boolean) => void;
698
+ disabled?: boolean;
699
+ name?: string;
700
+ value?: string;
701
+ }
702
+ /** Renders the `MenuItemCheckbox` component. */
703
+ declare function MenuItemCheckbox({ checked, onChange, disabled, onClick, children, ...props }: MenuItemCheckboxProps): react_jsx_runtime.JSX.Element;
704
+ /** Props for `MenuItemRadio`. */
705
+ interface MenuItemRadioProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
706
+ checked?: boolean;
707
+ onChange?: (checked: boolean) => void;
708
+ disabled?: boolean;
709
+ name?: string;
710
+ value?: string;
711
+ }
712
+ /** Renders the `MenuItemRadio` component. */
713
+ declare function MenuItemRadio({ checked, onChange, disabled, onClick, children, ...props }: MenuItemRadioProps): react_jsx_runtime.JSX.Element;
714
+ /** Props for `MenuSeparator`. */
715
+ interface MenuSeparatorProps extends ComponentPropsWithoutRef<"hr"> {
716
+ }
717
+ /** Renders the `MenuSeparator` component. */
718
+ declare function MenuSeparator(props: MenuSeparatorProps): react_jsx_runtime.JSX.Element;
719
+ /** Props for `MenuButtonArrow`. */
720
+ interface MenuButtonArrowProps extends ComponentPropsWithoutRef<"span"> {
721
+ }
722
+ /** Renders the `MenuButtonArrow` component. */
723
+ declare function MenuButtonArrow(props: MenuButtonArrowProps): react_jsx_runtime.JSX.Element;
724
+
725
+ /** Props for `ToolbarRoot`. */
726
+ interface ToolbarRootProps {
727
+ children: ReactNode;
728
+ orientation?: "horizontal" | "vertical";
729
+ }
730
+ /** Renders the `ToolbarRoot` component. */
731
+ declare function ToolbarRoot({ children, orientation, }: ToolbarRootProps): react_jsx_runtime.JSX.Element;
732
+ /** Props for `ToolbarContainer`. */
733
+ interface ToolbarContainerProps extends ComponentPropsWithoutRef<"div"> {
734
+ }
735
+ /** Renders the `ToolbarContainer` component. */
736
+ declare function ToolbarContainer({ onKeyDown, ...props }: ToolbarContainerProps): react_jsx_runtime.JSX.Element;
737
+ /** Props for `ToolbarButton`. */
738
+ interface ToolbarButtonProps extends ComponentPropsWithoutRef<"button"> {
739
+ }
740
+ /** Renders the `ToolbarButton` component. */
741
+ declare function ToolbarButton({ disabled, onFocus, ...props }: ToolbarButtonProps): react_jsx_runtime.JSX.Element;
742
+ /** Props for `ToolbarSeparator`. */
743
+ interface ToolbarSeparatorProps extends ComponentPropsWithoutRef<"hr"> {
744
+ }
745
+ /** Renders the `ToolbarSeparator` component. */
746
+ declare function ToolbarSeparator(props: ToolbarSeparatorProps): react_jsx_runtime.JSX.Element;
747
+
748
+ /** Props for `CompositeProvider`. */
749
+ interface CompositeProviderProps {
750
+ children: ReactNode;
751
+ focusLoop?: boolean;
752
+ focusWrap?: boolean;
753
+ orientation?: "horizontal" | "vertical" | "both";
754
+ activeId?: string | null;
755
+ /** Called when the active item changes. */
756
+ onActiveIdChange?: (id: string) => void;
757
+ /** @deprecated Use `onActiveIdChange`. */
758
+ setActiveId?: (id: string) => void;
759
+ }
760
+ /** Renders the `CompositeProvider` component. */
761
+ declare function CompositeProvider({ children, focusLoop, focusWrap, orientation, activeId: controlledActiveId, onActiveIdChange, setActiveId: setActiveIdDeprecated, }: CompositeProviderProps): react_jsx_runtime.JSX.Element;
762
+ /** Props for `Composite`. */
763
+ interface CompositeProps extends ComponentPropsWithoutRef<"div"> {
764
+ render?: ReactElement;
765
+ }
766
+ /** Renders the `Composite` component. */
767
+ declare function Composite({ onKeyDown, render, ...props }: CompositeProps): react_jsx_runtime.JSX.Element;
768
+ /** Props for `CompositeRow`. */
769
+ interface CompositeRowProps extends ComponentPropsWithoutRef<"div"> {
770
+ render?: ReactElement;
771
+ }
772
+ /** Renders the `CompositeRow` component. */
773
+ declare function CompositeRow({ render, ...props }: CompositeRowProps): react_jsx_runtime.JSX.Element;
774
+ /** Props for `CompositeItem`. */
775
+ interface CompositeItemProps extends ComponentPropsWithoutRef<"button"> {
776
+ id?: string;
777
+ row?: number;
778
+ col?: number;
779
+ disabled?: boolean;
780
+ render?: ReactElement;
781
+ }
782
+ /** Renders the `CompositeItem` component. */
783
+ declare function CompositeItem({ id: providedId, row, col, disabled, render, onFocus, ...props }: CompositeItemProps): react_jsx_runtime.JSX.Element;
784
+
785
+ /** Props for the headless separator primitive. */
786
+ interface SeparatorProps extends ComponentPropsWithoutRef<"div"> {
787
+ /** Visual/semantic axis of the separator. Defaults to `"horizontal"`. */
788
+ orientation?: "horizontal" | "vertical";
789
+ /**
790
+ * When `true`, the separator is purely visual: it exposes no role to the
791
+ * accessibility tree (use when an adjacent label already conveys the break).
792
+ */
793
+ decorative?: boolean;
794
+ }
795
+ /**
796
+ * Headless separator: renders a `<div>` with the correct WAI-ARIA semantics
797
+ * (`role="separator"` + `aria-orientation`) unless `decorative`. Carries a
798
+ * `data-orientation` attribute so consumers can style each axis.
799
+ */
800
+ declare const Separator: react.ForwardRefExoticComponent<SeparatorProps & react.RefAttributes<HTMLDivElement>>;
801
+
802
+ /** Props for `ToggleGroup`. */
803
+ interface ToggleGroupProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange"> {
804
+ /** Selected value(s). String for single mode, string[] for `toggleMultiple`. */
805
+ value?: string | string[];
806
+ defaultValue?: string | string[];
807
+ onValueChange?: (value: string | string[]) => void;
808
+ /** Allow more than one item pressed at once. */
809
+ toggleMultiple?: boolean;
810
+ orientation?: "horizontal" | "vertical";
811
+ disabled?: boolean;
812
+ }
813
+ /**
814
+ * Groups related `Toggle`s with roving-tabindex keyboard navigation and shared
815
+ * pressed-state selection (single by default, or multiple via `toggleMultiple`).
816
+ * Renders a `role="group"` element and provides selection context to children.
817
+ */
818
+ declare function ToggleGroup({ value: controlledValue, defaultValue, onValueChange, toggleMultiple, orientation, disabled, onKeyDown, ...props }: ToggleGroupProps): react_jsx_runtime.JSX.Element;
819
+ /** Props for `Toggle`. */
820
+ interface ToggleProps extends Omit<ComponentPropsWithoutRef<"button">, "value" | "onChange"> {
821
+ /** Controlled pressed state (standalone use only). */
822
+ pressed?: boolean;
823
+ /** Initial pressed state when uncontrolled (standalone use only). */
824
+ defaultPressed?: boolean;
825
+ /** Pressed-state change callback (standalone use only). */
826
+ onPressedChange?: (pressed: boolean) => void;
827
+ /** Identifies this toggle inside a `ToggleGroup`. Required within a group. */
828
+ value?: string;
829
+ }
830
+ /**
831
+ * A two-state button (`aria-pressed`). Works standalone or, when rendered
832
+ * inside a `ToggleGroup`, derives its pressed state from the group selection
833
+ * and participates in roving-tabindex navigation.
834
+ */
835
+ declare function Toggle({ pressed: pressedProp, defaultPressed, onPressedChange, value, disabled, onClick, onFocus, ...props }: ToggleProps): react_jsx_runtime.JSX.Element;
836
+
837
+ /** Props for `Switch`. */
838
+ interface SwitchProps extends Omit<ComponentPropsWithoutRef<"button">, "onChange" | "value" | "type" | "checked"> {
839
+ checked?: boolean;
840
+ defaultChecked?: boolean;
841
+ onCheckedChange?: (checked: boolean) => void;
842
+ disabled?: boolean;
843
+ /** Emit a hidden native checkbox so the switch participates in form submit. */
844
+ name?: string;
845
+ value?: string;
846
+ required?: boolean;
847
+ }
848
+ /**
849
+ * Toggle switch primitive (`role="switch"`). Controlled or uncontrolled, with
850
+ * an optional hidden native input for form submission. Exposes `data-state`
851
+ * (checked/unchecked) and `data-disabled` for Core to style — no visuals here.
852
+ */
853
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
854
+
855
+ /** Props for `Checkbox`. */
856
+ interface CheckboxProps extends Omit<ComponentPropsWithoutRef<"button">, "onChange" | "value" | "type" | "checked"> {
857
+ checked?: boolean;
858
+ defaultChecked?: boolean;
859
+ /** Tri-state "mixed" — announced as `aria-checked="mixed"`. */
860
+ indeterminate?: boolean;
861
+ onCheckedChange?: (checked: boolean) => void;
862
+ disabled?: boolean;
863
+ /** Emit a hidden native checkbox so it participates in form submit. */
864
+ name?: string;
865
+ value?: string;
866
+ required?: boolean;
867
+ }
868
+ /**
869
+ * Checkbox primitive (`role="checkbox"`) supporting an indeterminate tri-state
870
+ * (`aria-checked="mixed"`). Controlled or uncontrolled, with an optional hidden
871
+ * native input for form submission. Exposes `data-state`
872
+ * (checked/unchecked/indeterminate) for Core to render the check/indicator.
873
+ */
874
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLButtonElement>>;
875
+
876
+ /** Props for `Progress`. */
877
+ interface ProgressProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
878
+ /** Current value; `null` (or omitted) renders an indeterminate progressbar. */
879
+ value?: number | null;
880
+ min?: number;
881
+ max?: number;
882
+ /** Override the localized `aria-valuetext`. */
883
+ getValueLabel?: (value: number, min: number, max: number) => string;
884
+ children?: React.ReactNode;
885
+ }
886
+ /**
887
+ * Progressbar primitive (`role="progressbar"`). Reports value/min/max and a
888
+ * localized `aria-valuetext`; omit `value` (or pass `null`) for the
889
+ * indeterminate state. Exposes `data-state`
890
+ * (indeterminate/loading/complete) — no visuals here.
891
+ */
892
+ declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLDivElement>>;
893
+
894
+ /** Props for `Meter`. */
895
+ interface MeterProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
896
+ /** Current value within [min, max]. */
897
+ value: number;
898
+ min?: number;
899
+ max?: number;
900
+ /** Override the localized `aria-valuetext`. */
901
+ getValueLabel?: (value: number, min: number, max: number) => string;
902
+ children?: React.ReactNode;
903
+ }
904
+ /**
905
+ * Meter primitive (`role="meter"`) — a scalar measurement within a known range
906
+ * (e.g. disk usage, score), distinct from Progress (task completion). Reports
907
+ * value/min/max and a localized `aria-valuetext`; exposes `data-value`.
908
+ */
909
+ declare const Meter: react.ForwardRefExoticComponent<MeterProps & react.RefAttributes<HTMLDivElement>>;
910
+
911
+ /** Props for `AccordionRoot`. */
912
+ interface AccordionRootProps {
913
+ children: ReactNode;
914
+ /** `"single"` allows one open panel, `"multiple"` allows many. */
915
+ type?: "single" | "multiple";
916
+ /** Selected value(s). `string | null` for single, `string[]` for multiple. */
917
+ value?: string | string[] | null;
918
+ defaultValue?: string | string[] | null;
919
+ onValueChange?: (value: string | string[] | null) => void;
920
+ /** Single mode: allow closing the open panel (so none is open). */
921
+ collapsible?: boolean;
922
+ disabled?: boolean;
923
+ /** Animate content enter/leave (default `true`). */
924
+ animated?: boolean;
925
+ }
926
+ /** Renders the `AccordionRoot` component. */
927
+ declare function AccordionRoot({ children, type, value: controlledValue, defaultValue, onValueChange, collapsible, disabled, animated, }: AccordionRootProps): react_jsx_runtime.JSX.Element;
928
+ /** Props for `AccordionItem`. */
929
+ interface AccordionItemProps extends ComponentPropsWithoutRef<"div"> {
930
+ /** Unique value identifying this item within the accordion. */
931
+ value: string;
932
+ disabled?: boolean;
933
+ }
934
+ /** Renders the `AccordionItem` component. */
935
+ declare function AccordionItem({ value, disabled, ...props }: AccordionItemProps): react_jsx_runtime.JSX.Element;
936
+ /** Props for `AccordionTrigger`. */
937
+ interface AccordionTriggerProps extends ComponentPropsWithoutRef<"button"> {
938
+ }
939
+ /** Renders the `AccordionTrigger` component. */
940
+ declare function AccordionTrigger({ onClick, disabled, ...props }: AccordionTriggerProps): react_jsx_runtime.JSX.Element;
941
+ /** Props for `AccordionContent`. */
942
+ interface AccordionContentProps extends ComponentPropsWithoutRef<"div"> {
943
+ }
944
+ /** Renders the `AccordionContent` component. */
945
+ declare function AccordionContent({ style, ...props }: AccordionContentProps): react_jsx_runtime.JSX.Element | null;
946
+
947
+ /** Field name → error message map. Keys can be dot-paths (e.g. "items.0"). */
948
+ type FormErrors = Partial<Record<string, string>>;
949
+ /** Controls when the `validate` callback is invoked. */
950
+ type ValidateOn = "change" | "blur" | "submit";
951
+ /** Configuration for {@link useFormStore}. */
952
+ interface FormStoreOptions<V extends Record<string, unknown> = Record<string, unknown>> {
953
+ /** Initial field values. Also used by `reset()` and `isDirty()`. */
954
+ defaultValues: V;
955
+ /** Return an errors object keyed by field name. Invoked based on `validateOn`. */
956
+ validate?: (values: V) => FormErrors | void;
957
+ /** Called after successful validation on submit. Supports async (enables `isSubmitting`). */
958
+ onSubmit?: (values: V) => void | Promise<void>;
959
+ /** When to run `validate`. `"change"` (default) | `"blur"` | `"submit"` */
960
+ validateOn?: ValidateOn;
961
+ }
962
+ /** Reactive form store returned by {@link useFormStore}. Provides typed field access, validation, dirty tracking, and async submit. */
963
+ interface FormStoreInstance<V extends Record<string, unknown> = Record<string, unknown>> {
964
+ /** Get current values snapshot */
965
+ getValues(): V;
966
+ /** Get a field value by key (type-safe when V is specific) */
967
+ getValue<K extends keyof V & string>(name: K): V[K];
968
+ /** Get a field value by dot-path */
969
+ getValue(name: string): unknown;
970
+ /** Set a field value (type-safe when V is specific) */
971
+ setValue<K extends keyof V & string>(name: K, value: V[K]): void;
972
+ /** Set a field value by dot-path */
973
+ setValue(name: string, value: unknown): void;
974
+ /** Get all current errors */
975
+ getErrors(): FormErrors;
976
+ /** Get validation error for a field */
977
+ getError(name: string): string | undefined;
978
+ /** Set validation error for a specific field */
979
+ setError(name: string, error: string | undefined): void;
980
+ /** Check if a field has been touched */
981
+ getFieldTouched(name: string): boolean;
982
+ /** Mark a field as touched */
983
+ setFieldTouched(name: string, touched: boolean): void;
984
+ /** Check if any field differs from default */
985
+ isDirty(): boolean;
986
+ /** Check if a specific field differs from default */
987
+ isFieldDirty(name: string): boolean;
988
+ /** Run validation and return errors */
989
+ validate(): FormErrors;
990
+ /** Reset entire form to default values */
991
+ reset(): void;
992
+ /** Reset a single field to its default value */
993
+ resetField(name: string): void;
994
+ /** Submit handler (supports async onSubmit) */
995
+ submit(e?: {
996
+ preventDefault?(): void;
997
+ }): void;
998
+ /**
999
+ * Register a control element for a field so `submit()` can move focus to the
1000
+ * first invalid control (WCAG-critical error recovery). Returns an
1001
+ * unregister function; registration order approximates DOM order.
1002
+ */
1003
+ registerControl(name: string, getElement: () => HTMLElement | null): () => void;
1004
+ /** Whether an async submit is in progress */
1005
+ isSubmitting(): boolean;
1006
+ /** Error thrown by the last async onSubmit (cleared on next submit or reset) */
1007
+ getSubmitError(): unknown;
1008
+ /** Push item to array field */
1009
+ push<K extends keyof V & string>(name: K, item: V[K] extends (infer U)[] ? U : unknown): void;
1010
+ /** Push item to array field by dot-path */
1011
+ push(name: string, item: unknown): void;
1012
+ /** Remove item from array field by index */
1013
+ remove(name: string, index: number): void;
1014
+ /** Subscribe for re-renders */
1015
+ subscribe(listener: () => void): () => void;
1016
+ /** Get snapshot version for useSyncExternalStore */
1017
+ getSnapshot(): number;
1018
+ }
1019
+ /**
1020
+ * Creates and manages a form store with type-safe field access.
1021
+ *
1022
+ * The store is created once (via internal `useRef`) and the options are kept
1023
+ * fresh via a ref so `validate`/`onSubmit` closures always see current props.
1024
+ *
1025
+ * @param options - Store configuration (defaultValues, validate, onSubmit, validateOn)
1026
+ * @returns A `FormStoreInstance<V>` with typed getValue/setValue
1027
+ *
1028
+ * @example
1029
+ * ```tsx
1030
+ * const form = useFormStore({
1031
+ * defaultValues: { email: "", password: "" },
1032
+ * validate: (values) => {
1033
+ * const errors: FormErrors = {};
1034
+ * if (!values.email) errors.email = "Required";
1035
+ * return errors;
1036
+ * },
1037
+ * onSubmit: async (values) => { await api.save(values); },
1038
+ * });
1039
+ *
1040
+ * form.getValue("email"); // type: string
1041
+ * form.isDirty(); // true if any field changed
1042
+ * form.isSubmitting(); // true during async submit
1043
+ * form.getSubmitError(); // last async submit error or undefined
1044
+ * ```
1045
+ */
1046
+ declare function useFormStore<V extends Record<string, unknown>>(options: FormStoreOptions<V>): FormStoreInstance<V>;
1047
+ /**
1048
+ * Subscribe to a single field value. Re-renders only when that field changes.
1049
+ *
1050
+ * @param store - The form store instance
1051
+ * @param name - Field name (supports dot-path, e.g. "items.0")
1052
+ * @returns The current field value, cast to `T`
1053
+ *
1054
+ * @example
1055
+ * ```tsx
1056
+ * const email = useFieldValue<string>(form, "email");
1057
+ * ```
1058
+ */
1059
+ declare function useFieldValue<T = unknown>(store: FormStoreInstance, name: string): T;
1060
+
1061
+ /**
1062
+ * Provides form store to descendant form components.
1063
+ * Form provider for the current typed FormStore stack.
1064
+ */
1065
+ declare function FormProvider({ store, children, }: {
1066
+ store: FormStoreInstance;
1067
+ children: ReactNode;
1068
+ }): react_jsx_runtime.JSX.Element;
1069
+ /**
1070
+ * Access the form store from any descendant component.
1071
+ * Typed form context hook for the current FormStore stack.
1072
+ */
1073
+ declare function useFormContext(): FormStoreInstance | null;
1074
+
1075
+ /** Props for `FormRoot`. */
1076
+ interface FormRootProps extends ComponentPropsWithoutRef<"form"> {
1077
+ }
1078
+ /** Renders the `FormRoot` component. */
1079
+ declare function FormRoot({ onSubmit, ...props }: FormRootProps): react_jsx_runtime.JSX.Element;
1080
+ /** Props for `FormField`. */
1081
+ interface FormFieldProps extends ComponentPropsWithoutRef<"div"> {
1082
+ /** Field name. When set, descendant label/control/error/description are
1083
+ * automatically wired together (htmlFor/id/aria-describedby). */
1084
+ name?: string;
1085
+ }
1086
+ /** Renders the `FormField` component. */
1087
+ declare function FormField({ name, ...props }: FormFieldProps): react_jsx_runtime.JSX.Element;
1088
+ /** Props for `FormLabel`. */
1089
+ interface FormLabelProps extends ComponentPropsWithoutRef<"label"> {
1090
+ /** @deprecated Field association is derived from the enclosing `FormField`. */
1091
+ name?: string;
1092
+ }
1093
+ /** Renders the `FormLabel` component. */
1094
+ declare function FormLabel({ htmlFor, name: _name, ...props }: FormLabelProps): react_jsx_runtime.JSX.Element;
1095
+ /** Props for `FormInput`. */
1096
+ interface FormInputProps extends Omit<ComponentPropsWithoutRef<"input">, "name"> {
1097
+ name: string;
1098
+ }
1099
+ declare const FormInput: react.ForwardRefExoticComponent<FormInputProps & react.RefAttributes<HTMLInputElement>>;
1100
+ /** Props for `FormTextarea`. */
1101
+ interface FormTextareaProps extends Omit<ComponentPropsWithoutRef<"textarea">, "name"> {
1102
+ name: string;
1103
+ }
1104
+ declare const FormTextarea: react.ForwardRefExoticComponent<FormTextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
1105
+ /** Props for `FormSelect`. */
1106
+ interface FormSelectProps extends Omit<ComponentPropsWithoutRef<"select">, "name"> {
1107
+ name: string;
1108
+ }
1109
+ declare const FormSelect: react.ForwardRefExoticComponent<FormSelectProps & react.RefAttributes<HTMLSelectElement>>;
1110
+ /** Props for `FormSwitch`. */
1111
+ interface FormSwitchProps extends Omit<ComponentPropsWithoutRef<"button">, "name" | "onChange" | "type"> {
1112
+ name: string;
1113
+ }
1114
+ declare const FormSwitch: react.ForwardRefExoticComponent<FormSwitchProps & react.RefAttributes<HTMLButtonElement>>;
1115
+ /** Props for `FormCheckbox`. */
1116
+ interface FormCheckboxProps extends Omit<ComponentPropsWithoutRef<"input">, "name" | "type"> {
1117
+ name: string;
1118
+ value?: string;
1119
+ }
1120
+ declare const FormCheckbox: react.ForwardRefExoticComponent<FormCheckboxProps & react.RefAttributes<HTMLInputElement>>;
1121
+ /** Props for `FormRadioGroup`. */
1122
+ interface FormRadioGroupProps extends ComponentPropsWithoutRef<"div"> {
1123
+ /** @deprecated Pass `name` to each `FormRadio` instead. */
1124
+ name?: string;
1125
+ }
1126
+ /** Renders the `FormRadioGroup` component. */
1127
+ declare function FormRadioGroup({ name: _name, ...props }: FormRadioGroupProps): react_jsx_runtime.JSX.Element;
1128
+ /** Props for `FormRadio`. */
1129
+ interface FormRadioProps extends Omit<ComponentPropsWithoutRef<"input">, "name" | "type"> {
1130
+ name: string;
1131
+ value: string;
1132
+ }
1133
+ declare const FormRadio: react.ForwardRefExoticComponent<FormRadioProps & react.RefAttributes<HTMLInputElement>>;
1134
+ /** Props for `FormDescription`. */
1135
+ interface FormDescriptionProps extends ComponentPropsWithoutRef<"p"> {
1136
+ /** @deprecated Association is derived from the enclosing `FormField`. */
1137
+ name?: string;
1138
+ }
1139
+ /** Renders the `FormDescription` component. */
1140
+ declare function FormDescription({ name: _name, ...props }: FormDescriptionProps): react_jsx_runtime.JSX.Element;
1141
+ /** Props for `FormError`. */
1142
+ interface FormErrorProps extends ComponentPropsWithoutRef<"p"> {
1143
+ name: string;
1144
+ }
1145
+ /** Renders the `FormError` component. */
1146
+ declare function FormError({ name, children, ...props }: FormErrorProps): react_jsx_runtime.JSX.Element | null;
1147
+ /** Props for `FormControl`. */
1148
+ type FormControlProps = FormInputProps;
1149
+ /** Alias of {@link FormInput}. */
1150
+ declare const FormControl: react.ForwardRefExoticComponent<FormInputProps & react.RefAttributes<HTMLInputElement>>;
1151
+ /** Props for `FormSubmit`. */
1152
+ interface FormSubmitProps extends ComponentPropsWithoutRef<"button"> {
1153
+ }
1154
+ /** Renders the `FormSubmit` component. Auto-disables during async submit. */
1155
+ declare function FormSubmit({ type, disabled, ...props }: FormSubmitProps): react_jsx_runtime.JSX.Element;
1156
+ /** Props for `FormReset`. */
1157
+ interface FormResetProps extends ComponentPropsWithoutRef<"button"> {
1158
+ }
1159
+ /** Renders the `FormReset` component. */
1160
+ declare function FormReset({ onClick, ...props }: FormResetProps): react_jsx_runtime.JSX.Element;
1161
+ /** Props for `FormPush`. */
1162
+ interface FormPushProps extends Omit<ComponentPropsWithoutRef<"button">, "value"> {
1163
+ name: string;
1164
+ value: unknown;
1165
+ }
1166
+ /** Renders the `FormPush` component. */
1167
+ declare function FormPush({ name, value, onClick, ...props }: FormPushProps): react_jsx_runtime.JSX.Element;
1168
+ /** Props for `FormRemove`. */
1169
+ interface FormRemoveProps extends ComponentPropsWithoutRef<"button"> {
1170
+ name: string;
1171
+ index: number;
1172
+ }
1173
+ /** Renders the `FormRemove` component. */
1174
+ declare function FormRemove({ name, index, onClick, ...props }: FormRemoveProps): react_jsx_runtime.JSX.Element;
1175
+ /** Props for `FormGroup`. */
1176
+ interface FormGroupProps extends ComponentPropsWithoutRef<"fieldset"> {
1177
+ }
1178
+ /** Renders the `FormGroup` component. */
1179
+ declare function FormGroup(props: FormGroupProps): react_jsx_runtime.JSX.Element;
1180
+ /** Props for `FormGroupLabel`. */
1181
+ interface FormGroupLabelProps extends ComponentPropsWithoutRef<"legend"> {
1182
+ }
1183
+ /** Renders the `FormGroupLabel` component. */
1184
+ declare function FormGroupLabel(props: FormGroupLabelProps): react_jsx_runtime.JSX.Element;
1185
+
1186
+ export { AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, AccordionRoot, type AccordionRootProps, AccordionTrigger, type AccordionTriggerProps, AlertDialogPanel, type AlertDialogPanelProps, type Align, Button, type ButtonProps, Checkbox, type CheckboxProps, ComboboxGroup, ComboboxGroupLabel, type ComboboxGroupLabelProps, type ComboboxGroupProps, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, ComboboxPopover, type ComboboxPopoverProps, ComboboxRoot, type ComboboxRootProps, CommandEmpty, type CommandEmptyProps, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, type CommandItemProps, CommandList, type CommandListProps, CommandRoot, type CommandRootProps, CommandSeparator, type CommandSeparatorProps, Composite, CompositeItem, type CompositeItemProps, type CompositeProps, CompositeProvider, type CompositeProviderProps, CompositeRow, type CompositeRowProps, DialogDescription, type DialogDescriptionProps, DialogDisclosure, type DialogDisclosureProps, DialogDismiss, type DialogDismissProps, DialogHeading, type DialogHeadingProps, DialogPanel, type DialogPanelProps, DialogRoot, type DialogRootProps, DisclosureContent, type DisclosureContentProps, DisclosureRoot, type DisclosureRootProps, DisclosureTrigger, type DisclosureTriggerProps, type FocusableWhenDisabledOptions, type FocusableWhenDisabledProps, FormCheckbox, type FormCheckboxProps, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormErrors, FormField, type FormFieldProps, FormGroup, FormGroupLabel, type FormGroupLabelProps, type FormGroupProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormProvider, FormPush, type FormPushProps, FormRadio, FormRadioGroup, type FormRadioGroupProps, type FormRadioProps, FormRemove, type FormRemoveProps, FormReset, type FormResetProps, FormRoot, type FormRootProps, FormSelect, type FormSelectProps, type FormStoreInstance, type FormStoreOptions, FormSubmit, type FormSubmitProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, MenuButtonArrow, type MenuButtonArrowProps, MenuItem, MenuItemCheckbox, type MenuItemCheckboxProps, type MenuItemProps, MenuItemRadio, type MenuItemRadioProps, MenuPopover, type MenuPopoverProps, MenuRoot, type MenuRootProps, MenuSeparator, type MenuSeparatorProps, MenuTrigger, type MenuTriggerProps, MenubarContainer, type MenubarContainerProps, MenubarRoot, type MenubarRootProps, Meter, type MeterProps, type OffsetArgs, type OffsetValue, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, PopoverRoot, type PopoverRootProps, PopoverTrigger, type PopoverTriggerProps, Progress, type ProgressProps, Radio, RadioGroupRoot, type RadioGroupRootProps, type RadioProps, type RovingTabindexOptions, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectPopover, type SelectPopoverProps, SelectRoot, type SelectRootProps, SelectTrigger, type SelectTriggerProps, Separator, type SeparatorProps, type Side, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, TabsRoot, type TabsRootProps, Toggle, ToggleGroup, type ToggleGroupProps, type ToggleProps, ToolbarButton, type ToolbarButtonProps, ToolbarContainer, type ToolbarContainerProps, ToolbarRoot, type ToolbarRootProps, ToolbarSeparator, type ToolbarSeparatorProps, Tooltip, TooltipAnchor, type TooltipAnchorProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, type UseFloatingOptions, type ValidateOn, useCommandState, useControllableState, useDialogClose, useEnterLeave, useFieldValue, useFloating, useFocusVisible, useFocusableWhenDisabled, useFormContext, useFormStore, useId, useMenubarContext, useRadioGroupContext, useRovingTabindex, useScrollActiveDescendantIntoView };