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