@hypoth-ui/react 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/chunk-5A7SNEOH.js +1991 -0
- package/dist/client-8T-8F3H4.d.ts +1885 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +87 -0
- package/dist/index.d.ts +3068 -0
- package/dist/index.js +6804 -0
- package/package.json +68 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3068 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { ButtonHTMLAttributes, ReactNode, HTMLAttributes, TextareaHTMLAttributes, InputHTMLAttributes, ReactElement, Component, ComponentType, CSSProperties } from 'react';
|
|
3
|
+
import { R as ResponsiveProp } from './client-8T-8F3H4.js';
|
|
4
|
+
export { X as Alert, Y as AlertProps, Z as AlertVariant, A as AlignValue, u as AsChildProps, ac as Avatar, ad as AvatarGroup, ai as AvatarGroupProps, ae as AvatarProps, ag as AvatarShape, af as AvatarSize, ah as AvatarStatus, aE as Badge, aI as BadgePosition, aF as BadgeProps, aH as BadgeSize, aG as BadgeVariant, H as Box, m as BoxProps, b as ButtonSize, a as ButtonVariant, a_ as Calendar, a$ as CalendarProps, b0 as CalendarSize, Q as ClientOnly, C as ClientOnlyProps, b1 as DataTable, b3 as DataTableColumn, b5 as DataTablePagination, b2 as DataTableProps, b4 as DataTableSort, b6 as DataTableSortDirection, s as DisplayValue, p as DsInputEventDetail, D as DsNavigateEventDetail, t as FlexDirection, O as FocusScope, F as FocusScopeProps, o as FocusScopeRef, y as Icon, g as IconName, f as IconProps, h as IconSize, w as Input, I as InputProps, d as InputSize, c as InputType, q as InputValueHandler, J as JustifyValue, v as LegacyButton, B as LegacyButtonProps, x as Link, L as LinkProps, e as LinkVariant, aT as List, aU as ListItem, aZ as ListItemProps, aX as ListOrientation, aV as ListRootProps, aW as ListSelectionMode, aY as ListSize, N as NavigateEventHandler, M as Portal, P as PortalProps, a8 as Progress, a9 as ProgressProps, ab as ProgressSize, aa as ProgressVariant, ay as Skeleton, aD as SkeletonAnimation, az as SkeletonProps, aB as SkeletonSize, aA as SkeletonVariant, aC as SkeletonWidth, K as Slot, n as SlotProps, aw as SortDirection, r as SpacingValue, z as Spinner, S as SpinnerProps, i as SpinnerSize, aj as Table, av as TableAlign, al as TableBody, as as TableBodyProps, ao as TableCell, ax as TableCellProps, an as TableHead, au as TableHeadProps, ak as TableHeader, ar as TableHeaderProps, ap as TableRootProps, am as TableRow, at as TableRowProps, aq as TableSize, aJ as Tag, aK as TagProps, aM as TagSize, aL as TagVariant, G as Text, T as TextProps, j as TextSize, l as TextVariant, k as TextWeight, _ as Toast, a4 as ToastAction, a5 as ToastData, a6 as ToastOptions, a2 as ToastPosition, a0 as ToastProviderProps, a3 as ToastState, a1 as ToastVariant, aN as Tree, aO as TreeItem, aS as TreeItemProps, aP as TreeRootProps, aQ as TreeSelectionMode, aR as TreeSize, a7 as UseToastReturn, E as VisuallyHidden, V as VisuallyHiddenProps, W as WrapperConfig, b8 as attachEventListeners, ba as composeEventHandlers, b9 as createComponent, b7 as createEventHandler, bb as mergeClassNames, bd as mergeProps, bc as mergeStyles, U as useIsClient, $ as useToast } from './client-8T-8F3H4.js';
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { DialogRole, Placement as Placement$1, Option, DateRange, FileInfo, FileUploadError, TimeSegment, TimeValue } from '@hypoth-ui/primitives-dom';
|
|
7
|
+
export { DialogRole, FileInfo, FileUploadError, TimeSegment, TimeValue, formatBytes } from '@hypoth-ui/primitives-dom';
|
|
8
|
+
|
|
9
|
+
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "disabled"> {
|
|
10
|
+
/** Button content */
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
/** Button type */
|
|
13
|
+
type?: "button" | "submit" | "reset";
|
|
14
|
+
/** Whether button is disabled */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Whether button is in loading state */
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
/** Render as child element (polymorphic) */
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
/** Called when button is activated */
|
|
21
|
+
onPress?: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Accessible button component with loading and disabled states.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <Button onPress={() => console.log("clicked")}>Click me</Button>
|
|
29
|
+
*
|
|
30
|
+
* <Button loading>Saving...</Button>
|
|
31
|
+
*
|
|
32
|
+
* <Button asChild>
|
|
33
|
+
* <a href="/link">Link styled as button</a>
|
|
34
|
+
* </Button>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
|
|
39
|
+
interface FieldProps extends HTMLAttributes<HTMLElement> {
|
|
40
|
+
/** Whether the field has an error */
|
|
41
|
+
error?: boolean;
|
|
42
|
+
/** Whether the field is disabled */
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/** Whether the field is required */
|
|
45
|
+
required?: boolean;
|
|
46
|
+
/** Field content */
|
|
47
|
+
children?: react__default.ReactNode;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* React wrapper for ds-field Web Component.
|
|
51
|
+
* Container for form field with label, input, description, and error message.
|
|
52
|
+
*/
|
|
53
|
+
declare const Field: react__default.ForwardRefExoticComponent<FieldProps & react__default.RefAttributes<HTMLElement>>;
|
|
54
|
+
|
|
55
|
+
interface LabelProps extends HTMLAttributes<HTMLElement> {
|
|
56
|
+
/** For attribute linking to input */
|
|
57
|
+
htmlFor?: string;
|
|
58
|
+
/** Label content */
|
|
59
|
+
children?: react__default.ReactNode;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* React wrapper for ds-label Web Component.
|
|
63
|
+
* Label for form fields with automatic ID association.
|
|
64
|
+
*/
|
|
65
|
+
declare const Label: react__default.ForwardRefExoticComponent<LabelProps & react__default.RefAttributes<HTMLElement>>;
|
|
66
|
+
|
|
67
|
+
interface FieldDescriptionProps extends HTMLAttributes<HTMLElement> {
|
|
68
|
+
/** Description content */
|
|
69
|
+
children?: react__default.ReactNode;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* React wrapper for ds-field-description Web Component.
|
|
73
|
+
* Help text for form fields.
|
|
74
|
+
*/
|
|
75
|
+
declare const FieldDescription: react__default.ForwardRefExoticComponent<FieldDescriptionProps & react__default.RefAttributes<HTMLElement>>;
|
|
76
|
+
|
|
77
|
+
interface FieldErrorProps extends HTMLAttributes<HTMLElement> {
|
|
78
|
+
/** Error message content */
|
|
79
|
+
children?: react__default.ReactNode;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* React wrapper for ds-field-error Web Component.
|
|
83
|
+
* Error message for form fields.
|
|
84
|
+
*/
|
|
85
|
+
declare const FieldError: react__default.ForwardRefExoticComponent<FieldErrorProps & react__default.RefAttributes<HTMLElement>>;
|
|
86
|
+
|
|
87
|
+
interface DialogCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
88
|
+
/** Button content */
|
|
89
|
+
children?: ReactNode;
|
|
90
|
+
/** Render as child element (polymorphic) */
|
|
91
|
+
asChild?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type DialogContentSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
95
|
+
interface DialogContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
96
|
+
/** Dialog content */
|
|
97
|
+
children?: ReactNode;
|
|
98
|
+
/** Content size */
|
|
99
|
+
size?: DialogContentSize;
|
|
100
|
+
/** Container element for portal (defaults to document.body) */
|
|
101
|
+
container?: HTMLElement | null;
|
|
102
|
+
/** Force mount even when closed (for animations) */
|
|
103
|
+
forceMount?: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface DialogDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
107
|
+
/** Description content */
|
|
108
|
+
children?: ReactNode;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface DialogRootProps {
|
|
112
|
+
/** Dialog content */
|
|
113
|
+
children?: ReactNode;
|
|
114
|
+
/** Custom ID for the dialog (SSR-safe auto-generated if not provided) */
|
|
115
|
+
id?: string;
|
|
116
|
+
/** Controlled open state */
|
|
117
|
+
open?: boolean;
|
|
118
|
+
/** Default open state (uncontrolled) */
|
|
119
|
+
defaultOpen?: boolean;
|
|
120
|
+
/** Called when open state changes */
|
|
121
|
+
onOpenChange?: (open: boolean) => void;
|
|
122
|
+
/** Dialog role */
|
|
123
|
+
role?: DialogRole;
|
|
124
|
+
/** Whether dialog is modal (traps focus) */
|
|
125
|
+
modal?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Root component for Dialog compound pattern.
|
|
129
|
+
* Provides context to Trigger, Content, Title, Description, and Close.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```tsx
|
|
133
|
+
* <Dialog.Root>
|
|
134
|
+
* <Dialog.Trigger>Open</Dialog.Trigger>
|
|
135
|
+
* <Dialog.Content>
|
|
136
|
+
* <Dialog.Title>Dialog Title</Dialog.Title>
|
|
137
|
+
* <Dialog.Description>Dialog description</Dialog.Description>
|
|
138
|
+
* <Dialog.Close>Close</Dialog.Close>
|
|
139
|
+
* </Dialog.Content>
|
|
140
|
+
* </Dialog.Root>
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
declare function DialogRoot({ children, id, open: controlledOpen, defaultOpen, onOpenChange, role, modal, }: DialogRootProps): react_jsx_runtime.JSX.Element;
|
|
144
|
+
declare namespace DialogRoot {
|
|
145
|
+
var displayName: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
interface DialogTitleProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
149
|
+
/** Title content */
|
|
150
|
+
children?: ReactNode;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface DialogTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
154
|
+
/** Trigger content */
|
|
155
|
+
children?: ReactNode;
|
|
156
|
+
/** Render as child element (polymorphic) */
|
|
157
|
+
asChild?: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare const Dialog: {
|
|
161
|
+
Root: typeof DialogRoot;
|
|
162
|
+
Trigger: react.ForwardRefExoticComponent<DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
163
|
+
Content: react.ForwardRefExoticComponent<DialogContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
164
|
+
Title: react.ForwardRefExoticComponent<DialogTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
165
|
+
Description: react.ForwardRefExoticComponent<DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
166
|
+
Close: react.ForwardRefExoticComponent<DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
type TextareaSize = "sm" | "md" | "lg";
|
|
170
|
+
interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "onInput"> {
|
|
171
|
+
/**
|
|
172
|
+
* Textarea size - supports responsive object syntax
|
|
173
|
+
* @example
|
|
174
|
+
* ```tsx
|
|
175
|
+
* // Single value
|
|
176
|
+
* <Textarea size="md" />
|
|
177
|
+
*
|
|
178
|
+
* // Responsive
|
|
179
|
+
* <Textarea size={{ base: "sm", md: "md", lg: "lg" }} />
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
size?: ResponsiveProp<TextareaSize>;
|
|
183
|
+
/** Error state */
|
|
184
|
+
error?: boolean;
|
|
185
|
+
/** Auto-resize to fit content */
|
|
186
|
+
autoResize?: boolean;
|
|
187
|
+
/** Change handler */
|
|
188
|
+
onChange?: (value: string, event: Event) => void;
|
|
189
|
+
/** Value change handler - fires on every keystroke */
|
|
190
|
+
onValueChange?: (value: string, event: Event) => void;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* React wrapper for ds-textarea Web Component.
|
|
194
|
+
* Multi-line text input with auto-resize support.
|
|
195
|
+
*/
|
|
196
|
+
declare const Textarea: react__default.ForwardRefExoticComponent<TextareaProps & react__default.RefAttributes<HTMLElement>>;
|
|
197
|
+
|
|
198
|
+
interface CheckboxProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
|
|
199
|
+
/** Checkbox name */
|
|
200
|
+
name?: string;
|
|
201
|
+
/** Checkbox value */
|
|
202
|
+
value?: string;
|
|
203
|
+
/** Whether checked */
|
|
204
|
+
checked?: boolean;
|
|
205
|
+
/** Default checked state (uncontrolled) */
|
|
206
|
+
defaultChecked?: boolean;
|
|
207
|
+
/** Whether disabled */
|
|
208
|
+
disabled?: boolean;
|
|
209
|
+
/** Whether required */
|
|
210
|
+
required?: boolean;
|
|
211
|
+
/** Indeterminate state */
|
|
212
|
+
indeterminate?: boolean;
|
|
213
|
+
/** Change handler */
|
|
214
|
+
onChange?: (checked: boolean, event: Event) => void;
|
|
215
|
+
/** Checkbox label content */
|
|
216
|
+
children?: react__default.ReactNode;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* React wrapper for ds-checkbox Web Component.
|
|
220
|
+
* Checkbox input with tri-state support.
|
|
221
|
+
*/
|
|
222
|
+
declare const Checkbox: react__default.ForwardRefExoticComponent<CheckboxProps & react__default.RefAttributes<HTMLElement>>;
|
|
223
|
+
|
|
224
|
+
type RadioOrientation = "horizontal" | "vertical";
|
|
225
|
+
interface RadioGroupProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
|
|
226
|
+
/** Group name */
|
|
227
|
+
name?: string;
|
|
228
|
+
/** Selected value */
|
|
229
|
+
value?: string;
|
|
230
|
+
/** Default value (uncontrolled) */
|
|
231
|
+
defaultValue?: string;
|
|
232
|
+
/** Whether disabled */
|
|
233
|
+
disabled?: boolean;
|
|
234
|
+
/** Whether required */
|
|
235
|
+
required?: boolean;
|
|
236
|
+
/** Layout orientation */
|
|
237
|
+
orientation?: RadioOrientation;
|
|
238
|
+
/** Change handler */
|
|
239
|
+
onChange?: (value: string, event: Event) => void;
|
|
240
|
+
/** Radio options */
|
|
241
|
+
children?: react__default.ReactNode;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* React wrapper for ds-radio-group Web Component.
|
|
245
|
+
* Radio group with roving focus.
|
|
246
|
+
*/
|
|
247
|
+
declare const RadioGroup: react__default.ForwardRefExoticComponent<RadioGroupProps & react__default.RefAttributes<HTMLElement>>;
|
|
248
|
+
|
|
249
|
+
interface RadioProps extends HTMLAttributes<HTMLElement> {
|
|
250
|
+
/** Radio value */
|
|
251
|
+
value: string;
|
|
252
|
+
/** Whether disabled */
|
|
253
|
+
disabled?: boolean;
|
|
254
|
+
/** Radio label content */
|
|
255
|
+
children?: react__default.ReactNode;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* React wrapper for ds-radio Web Component.
|
|
259
|
+
* Individual radio option within a RadioGroup.
|
|
260
|
+
*/
|
|
261
|
+
declare const Radio: react__default.ForwardRefExoticComponent<RadioProps & react__default.RefAttributes<HTMLElement>>;
|
|
262
|
+
|
|
263
|
+
interface SwitchProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
|
|
264
|
+
/** Switch name */
|
|
265
|
+
name?: string;
|
|
266
|
+
/** Whether checked/on */
|
|
267
|
+
checked?: boolean;
|
|
268
|
+
/** Default checked state (uncontrolled) */
|
|
269
|
+
defaultChecked?: boolean;
|
|
270
|
+
/** Whether disabled */
|
|
271
|
+
disabled?: boolean;
|
|
272
|
+
/** Whether required */
|
|
273
|
+
required?: boolean;
|
|
274
|
+
/** Change handler */
|
|
275
|
+
onChange?: (checked: boolean, event: Event) => void;
|
|
276
|
+
/** Switch label content */
|
|
277
|
+
children?: react__default.ReactNode;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* React wrapper for ds-switch Web Component.
|
|
281
|
+
* Toggle switch with role="switch".
|
|
282
|
+
*/
|
|
283
|
+
declare const Switch: react__default.ForwardRefExoticComponent<SwitchProps & react__default.RefAttributes<HTMLElement>>;
|
|
284
|
+
|
|
285
|
+
type Placement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
286
|
+
interface PopoverProps extends HTMLAttributes<HTMLElement> {
|
|
287
|
+
/** Whether the popover is open */
|
|
288
|
+
open?: boolean;
|
|
289
|
+
/** Placement relative to trigger */
|
|
290
|
+
placement?: Placement;
|
|
291
|
+
/** Offset from trigger in pixels */
|
|
292
|
+
offset?: number;
|
|
293
|
+
/** Whether to flip placement when near viewport edge */
|
|
294
|
+
flip?: boolean;
|
|
295
|
+
/** Whether Escape closes the popover */
|
|
296
|
+
closeOnEscape?: boolean;
|
|
297
|
+
/** Whether clicking outside closes the popover */
|
|
298
|
+
closeOnOutsideClick?: boolean;
|
|
299
|
+
/** Handler for open event */
|
|
300
|
+
onOpen?: () => void;
|
|
301
|
+
/** Handler for close event */
|
|
302
|
+
onClose?: () => void;
|
|
303
|
+
/** Popover content */
|
|
304
|
+
children?: react__default.ReactNode;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* React wrapper for ds-popover Web Component.
|
|
308
|
+
* Non-modal popover with anchor positioning.
|
|
309
|
+
*/
|
|
310
|
+
declare const Popover: react__default.ForwardRefExoticComponent<PopoverProps & react__default.RefAttributes<HTMLElement>>;
|
|
311
|
+
|
|
312
|
+
interface PopoverContentProps extends HTMLAttributes<HTMLElement> {
|
|
313
|
+
/** Popover content */
|
|
314
|
+
children?: react__default.ReactNode;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* React wrapper for ds-popover-content Web Component.
|
|
318
|
+
* Container for popover content.
|
|
319
|
+
*/
|
|
320
|
+
declare const PopoverContent: react__default.ForwardRefExoticComponent<PopoverContentProps & react__default.RefAttributes<HTMLElement>>;
|
|
321
|
+
|
|
322
|
+
interface TooltipProps extends HTMLAttributes<HTMLElement> {
|
|
323
|
+
/** Whether the tooltip is open */
|
|
324
|
+
open?: boolean;
|
|
325
|
+
/** Placement relative to trigger */
|
|
326
|
+
placement?: Placement;
|
|
327
|
+
/** Offset from trigger in pixels */
|
|
328
|
+
offset?: number;
|
|
329
|
+
/** Delay before showing tooltip (ms) */
|
|
330
|
+
showDelay?: number;
|
|
331
|
+
/** Delay before hiding tooltip (ms) */
|
|
332
|
+
hideDelay?: number;
|
|
333
|
+
/** Tooltip content */
|
|
334
|
+
children?: react__default.ReactNode;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* React wrapper for ds-tooltip Web Component.
|
|
338
|
+
* Informational tooltip shown on hover/focus.
|
|
339
|
+
*/
|
|
340
|
+
declare const Tooltip: react__default.ForwardRefExoticComponent<TooltipProps & react__default.RefAttributes<HTMLElement>>;
|
|
341
|
+
|
|
342
|
+
interface TooltipContentProps extends HTMLAttributes<HTMLElement> {
|
|
343
|
+
/** Tooltip content */
|
|
344
|
+
children?: react__default.ReactNode;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* React wrapper for ds-tooltip-content Web Component.
|
|
348
|
+
* Container for tooltip content.
|
|
349
|
+
*/
|
|
350
|
+
declare const TooltipContent: react__default.ForwardRefExoticComponent<TooltipContentProps & react__default.RefAttributes<HTMLElement>>;
|
|
351
|
+
|
|
352
|
+
interface MenuContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
353
|
+
/** Menu content */
|
|
354
|
+
children?: ReactNode;
|
|
355
|
+
/** Container element for portal (defaults to document.body) */
|
|
356
|
+
container?: HTMLElement | null;
|
|
357
|
+
/** Force mount even when closed (for animations) */
|
|
358
|
+
forceMount?: boolean;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
interface MenuItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
362
|
+
/** Item content */
|
|
363
|
+
children?: ReactNode;
|
|
364
|
+
/** Value passed to onSelect */
|
|
365
|
+
value?: string;
|
|
366
|
+
/** Whether item is disabled */
|
|
367
|
+
disabled?: boolean;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
interface MenuLabelProps extends HTMLAttributes<HTMLDivElement> {
|
|
371
|
+
/** Label content */
|
|
372
|
+
children?: ReactNode;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
interface MenuRootProps {
|
|
376
|
+
/** Menu content */
|
|
377
|
+
children?: ReactNode;
|
|
378
|
+
/** Custom ID for the menu (SSR-safe auto-generated if not provided) */
|
|
379
|
+
id?: string;
|
|
380
|
+
/** Controlled open state */
|
|
381
|
+
open?: boolean;
|
|
382
|
+
/** Default open state (uncontrolled) */
|
|
383
|
+
defaultOpen?: boolean;
|
|
384
|
+
/** Called when open state changes */
|
|
385
|
+
onOpenChange?: (open: boolean) => void;
|
|
386
|
+
/** Called when an item is selected */
|
|
387
|
+
onSelect?: (value: string) => void;
|
|
388
|
+
/** Placement relative to trigger */
|
|
389
|
+
placement?: Placement$1;
|
|
390
|
+
/** Offset from trigger in pixels */
|
|
391
|
+
offset?: number;
|
|
392
|
+
/** Whether to flip placement on viewport edge */
|
|
393
|
+
flip?: boolean;
|
|
394
|
+
/** Whether to loop navigation at ends */
|
|
395
|
+
loop?: boolean;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Root component for Menu compound pattern.
|
|
399
|
+
* Provides context to Trigger, Content, and Item.
|
|
400
|
+
*
|
|
401
|
+
* @example
|
|
402
|
+
* ```tsx
|
|
403
|
+
* <Menu.Root onSelect={(value) => console.log(value)}>
|
|
404
|
+
* <Menu.Trigger>Open Menu</Menu.Trigger>
|
|
405
|
+
* <Menu.Content>
|
|
406
|
+
* <Menu.Item value="edit">Edit</Menu.Item>
|
|
407
|
+
* <Menu.Item value="delete">Delete</Menu.Item>
|
|
408
|
+
* </Menu.Content>
|
|
409
|
+
* </Menu.Root>
|
|
410
|
+
* ```
|
|
411
|
+
*/
|
|
412
|
+
declare function MenuRoot({ children, id, open: controlledOpen, defaultOpen, onOpenChange, onSelect, placement, offset, flip, loop, }: MenuRootProps): react_jsx_runtime.JSX.Element;
|
|
413
|
+
declare namespace MenuRoot {
|
|
414
|
+
var displayName: string;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
interface MenuSeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
interface MenuTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
421
|
+
/** Trigger content */
|
|
422
|
+
children?: ReactNode;
|
|
423
|
+
/** Render as child element (polymorphic) */
|
|
424
|
+
asChild?: boolean;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
declare const Menu: {
|
|
428
|
+
Root: typeof MenuRoot;
|
|
429
|
+
Trigger: react.ForwardRefExoticComponent<MenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
430
|
+
Content: react.ForwardRefExoticComponent<MenuContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
431
|
+
Item: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
432
|
+
Separator: react.ForwardRefExoticComponent<MenuSeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
433
|
+
Label: react.ForwardRefExoticComponent<MenuLabelProps & react.RefAttributes<HTMLDivElement>>;
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
interface SelectContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
437
|
+
/** Content container */
|
|
438
|
+
children?: ReactNode;
|
|
439
|
+
/** Optional label for accessibility */
|
|
440
|
+
"aria-label"?: string;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
interface SelectGroupProps extends HTMLAttributes<HTMLFieldSetElement> {
|
|
444
|
+
/** Group content (Label and Options) */
|
|
445
|
+
children?: ReactNode;
|
|
446
|
+
/** Optional label text (alternative to using Select.Label as child) */
|
|
447
|
+
label?: string;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
interface SelectLabelProps extends HTMLAttributes<HTMLDivElement> {
|
|
451
|
+
/** Label content */
|
|
452
|
+
children?: ReactNode;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
interface SelectOptionProps extends Omit<HTMLAttributes<HTMLDivElement>, "value"> {
|
|
456
|
+
/** Option value */
|
|
457
|
+
value: string;
|
|
458
|
+
/** Display label (uses children if not specified) */
|
|
459
|
+
label?: string;
|
|
460
|
+
/** Whether the option is disabled */
|
|
461
|
+
disabled?: boolean;
|
|
462
|
+
/** Option content */
|
|
463
|
+
children?: ReactNode;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
interface SelectRootProps {
|
|
467
|
+
/** Select content */
|
|
468
|
+
children?: ReactNode;
|
|
469
|
+
/** Custom ID for the select (SSR-safe auto-generated if not provided) */
|
|
470
|
+
id?: string;
|
|
471
|
+
/** Controlled open state */
|
|
472
|
+
open?: boolean;
|
|
473
|
+
/** Default open state (uncontrolled) */
|
|
474
|
+
defaultOpen?: boolean;
|
|
475
|
+
/** Called when open state changes */
|
|
476
|
+
onOpenChange?: (open: boolean) => void;
|
|
477
|
+
/** Controlled value */
|
|
478
|
+
value?: string | null;
|
|
479
|
+
/** Default value (uncontrolled) */
|
|
480
|
+
defaultValue?: string | null;
|
|
481
|
+
/** Called when value changes */
|
|
482
|
+
onValueChange?: (value: string | null) => void;
|
|
483
|
+
/** Placement relative to trigger */
|
|
484
|
+
placement?: Placement$1;
|
|
485
|
+
/** Offset from trigger in pixels */
|
|
486
|
+
offset?: number;
|
|
487
|
+
/** Whether to flip placement on viewport edge */
|
|
488
|
+
flip?: boolean;
|
|
489
|
+
/** Whether select is disabled */
|
|
490
|
+
disabled?: boolean;
|
|
491
|
+
/** Whether select is read-only */
|
|
492
|
+
readOnly?: boolean;
|
|
493
|
+
/** Enable typeahead search */
|
|
494
|
+
searchable?: boolean;
|
|
495
|
+
/** Allow clearing the selection */
|
|
496
|
+
clearable?: boolean;
|
|
497
|
+
/** Whether the select is in a loading state (e.g., fetching options) */
|
|
498
|
+
loading?: boolean;
|
|
499
|
+
/** Text to display/announce during loading */
|
|
500
|
+
loadingText?: string;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Root component for Select compound pattern.
|
|
504
|
+
* Provides context to Trigger, Content, and Option.
|
|
505
|
+
*
|
|
506
|
+
* @example
|
|
507
|
+
* ```tsx
|
|
508
|
+
* <Select.Root onValueChange={(value) => console.log(value)}>
|
|
509
|
+
* <Select.Trigger>Select a fruit</Select.Trigger>
|
|
510
|
+
* <Select.Content>
|
|
511
|
+
* <Select.Option value="apple">Apple</Select.Option>
|
|
512
|
+
* <Select.Option value="banana">Banana</Select.Option>
|
|
513
|
+
* </Select.Content>
|
|
514
|
+
* </Select.Root>
|
|
515
|
+
* ```
|
|
516
|
+
*/
|
|
517
|
+
declare function SelectRoot({ children, id, open: controlledOpen, defaultOpen, onOpenChange, value: controlledValue, defaultValue, onValueChange, placement: _placement, offset: _offset, flip: _flip, disabled, readOnly, searchable, clearable, loading, loadingText, }: SelectRootProps): react_jsx_runtime.JSX.Element;
|
|
518
|
+
declare namespace SelectRoot {
|
|
519
|
+
var displayName: string;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
interface SelectSeparatorProps extends HTMLAttributes<HTMLHRElement> {
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
interface SelectTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
526
|
+
/** Trigger content */
|
|
527
|
+
children?: ReactNode;
|
|
528
|
+
/** Render as child element (polymorphic) */
|
|
529
|
+
asChild?: boolean;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
interface SelectValueProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
533
|
+
/** Placeholder text when no value is selected */
|
|
534
|
+
placeholder?: string;
|
|
535
|
+
/** Custom render function for the value */
|
|
536
|
+
children?: ReactNode | ((value: string | null) => ReactNode);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
declare const Select: {
|
|
540
|
+
Root: typeof SelectRoot;
|
|
541
|
+
Trigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
542
|
+
Value: react.ForwardRefExoticComponent<SelectValueProps & react.RefAttributes<HTMLSpanElement>>;
|
|
543
|
+
Content: react.ForwardRefExoticComponent<SelectContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
544
|
+
Group: react.ForwardRefExoticComponent<SelectGroupProps & react.RefAttributes<HTMLFieldSetElement>>;
|
|
545
|
+
Option: react.ForwardRefExoticComponent<SelectOptionProps & react.RefAttributes<HTMLDivElement>>;
|
|
546
|
+
Separator: react.ForwardRefExoticComponent<SelectSeparatorProps & react.RefAttributes<HTMLHRElement>>;
|
|
547
|
+
Label: react.ForwardRefExoticComponent<SelectLabelProps & react.RefAttributes<HTMLDivElement>>;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
interface ComboboxContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
551
|
+
/** Content container */
|
|
552
|
+
children?: ReactNode;
|
|
553
|
+
/** Optional label for accessibility */
|
|
554
|
+
"aria-label"?: string;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
interface ComboboxEmptyProps extends HTMLAttributes<HTMLOutputElement> {
|
|
558
|
+
/** Empty state content */
|
|
559
|
+
children?: ReactNode;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
interface ComboboxInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> {
|
|
563
|
+
/** Render as child element (polymorphic) */
|
|
564
|
+
asChild?: boolean;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
interface ComboboxLoadingProps extends HTMLAttributes<HTMLOutputElement> {
|
|
568
|
+
/** Loading indicator content */
|
|
569
|
+
children?: ReactNode;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
interface ComboboxOptionProps extends Omit<HTMLAttributes<HTMLDivElement>, "value"> {
|
|
573
|
+
/** Option value */
|
|
574
|
+
value: string;
|
|
575
|
+
/** Display label (uses children if not specified) */
|
|
576
|
+
label?: string;
|
|
577
|
+
/** Whether the option is disabled */
|
|
578
|
+
disabled?: boolean;
|
|
579
|
+
/** Option content */
|
|
580
|
+
children?: ReactNode;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
interface ComboboxRootProps<Multi extends boolean = false> {
|
|
584
|
+
/** Combobox content */
|
|
585
|
+
children?: ReactNode;
|
|
586
|
+
/** Controlled open state */
|
|
587
|
+
open?: boolean;
|
|
588
|
+
/** Default open state (uncontrolled) */
|
|
589
|
+
defaultOpen?: boolean;
|
|
590
|
+
/** Called when open state changes */
|
|
591
|
+
onOpenChange?: (open: boolean) => void;
|
|
592
|
+
/** Controlled value (single-select) */
|
|
593
|
+
value?: Multi extends true ? string[] : string | null;
|
|
594
|
+
/** Default value (uncontrolled) */
|
|
595
|
+
defaultValue?: Multi extends true ? string[] : string | null;
|
|
596
|
+
/** Called when value changes */
|
|
597
|
+
onValueChange?: (value: Multi extends true ? string[] : string | null) => void;
|
|
598
|
+
/** Called when input value changes */
|
|
599
|
+
onInputChange?: (query: string) => void;
|
|
600
|
+
/** Enable multi-select mode */
|
|
601
|
+
multiple?: Multi;
|
|
602
|
+
/** Allow creating new values */
|
|
603
|
+
creatable?: boolean;
|
|
604
|
+
/** Called when new value is created */
|
|
605
|
+
onCreateValue?: (value: string) => void;
|
|
606
|
+
/** Async item loader */
|
|
607
|
+
loadItems?: (query: string) => Promise<Option<string>[]>;
|
|
608
|
+
/** Static items */
|
|
609
|
+
items?: Option<string>[];
|
|
610
|
+
/** Debounce delay for async (ms) */
|
|
611
|
+
debounce?: number;
|
|
612
|
+
/** Virtualization threshold */
|
|
613
|
+
virtualizationThreshold?: number;
|
|
614
|
+
/** Placement relative to input */
|
|
615
|
+
placement?: Placement$1;
|
|
616
|
+
/** Offset from input in pixels */
|
|
617
|
+
offset?: number;
|
|
618
|
+
/** Whether to flip placement on viewport edge */
|
|
619
|
+
flip?: boolean;
|
|
620
|
+
/** Whether combobox is disabled */
|
|
621
|
+
disabled?: boolean;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Root component for Combobox compound pattern.
|
|
625
|
+
* Provides context to Input, Content, Option, and Tag.
|
|
626
|
+
*
|
|
627
|
+
* @example
|
|
628
|
+
* ```tsx
|
|
629
|
+
* <Combobox.Root onValueChange={(value) => console.log(value)}>
|
|
630
|
+
* <Combobox.Input placeholder="Search..." />
|
|
631
|
+
* <Combobox.Content>
|
|
632
|
+
* <Combobox.Option value="apple">Apple</Combobox.Option>
|
|
633
|
+
* <Combobox.Option value="banana">Banana</Combobox.Option>
|
|
634
|
+
* </Combobox.Content>
|
|
635
|
+
* </Combobox.Root>
|
|
636
|
+
* ```
|
|
637
|
+
*/
|
|
638
|
+
declare function ComboboxRoot<Multi extends boolean = false>({ children, open: controlledOpen, defaultOpen, onOpenChange, value: controlledValue, defaultValue, onValueChange, onInputChange, multiple, creatable, onCreateValue, loadItems, items: staticItems, debounce, virtualizationThreshold, placement: _placement, offset: _offset, flip: _flip, disabled, }: ComboboxRootProps<Multi>): react_jsx_runtime.JSX.Element;
|
|
639
|
+
declare namespace ComboboxRoot {
|
|
640
|
+
var displayName: string;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
interface ComboboxTagProps extends Omit<HTMLAttributes<HTMLDivElement>, "value"> {
|
|
644
|
+
/** Tag value */
|
|
645
|
+
value: string;
|
|
646
|
+
/** Display label */
|
|
647
|
+
label?: string;
|
|
648
|
+
/** Tag content */
|
|
649
|
+
children?: ReactNode;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
declare const Combobox: {
|
|
653
|
+
Root: typeof ComboboxRoot;
|
|
654
|
+
Input: react.ForwardRefExoticComponent<ComboboxInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
655
|
+
Content: react.ForwardRefExoticComponent<ComboboxContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
656
|
+
Option: react.ForwardRefExoticComponent<ComboboxOptionProps & react.RefAttributes<HTMLDivElement>>;
|
|
657
|
+
Tag: react.ForwardRefExoticComponent<ComboboxTagProps & react.RefAttributes<HTMLDivElement>>;
|
|
658
|
+
Empty: react.ForwardRefExoticComponent<ComboboxEmptyProps & react.RefAttributes<HTMLOutputElement>>;
|
|
659
|
+
Loading: react.ForwardRefExoticComponent<ComboboxLoadingProps & react.RefAttributes<HTMLOutputElement>>;
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
interface DatePickerCalendarProps extends HTMLAttributes<HTMLDivElement> {
|
|
663
|
+
/** Custom header renderer */
|
|
664
|
+
renderHeader?: (props: {
|
|
665
|
+
month: string;
|
|
666
|
+
year: number;
|
|
667
|
+
onPrevMonth: () => void;
|
|
668
|
+
onNextMonth: () => void;
|
|
669
|
+
}) => ReactNode;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
interface DatePickerContentProps extends HTMLAttributes<HTMLDialogElement> {
|
|
673
|
+
/** Content */
|
|
674
|
+
children?: ReactNode;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
interface DatePickerTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
678
|
+
/** Trigger content */
|
|
679
|
+
children?: ReactNode;
|
|
680
|
+
/** Render as child element (polymorphic) */
|
|
681
|
+
asChild?: boolean;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
type DatePickerMode = "single" | "range";
|
|
685
|
+
|
|
686
|
+
interface DatePickerRootProps {
|
|
687
|
+
/** DatePicker content */
|
|
688
|
+
children?: ReactNode;
|
|
689
|
+
/** Controlled open state */
|
|
690
|
+
open?: boolean;
|
|
691
|
+
/** Default open state (uncontrolled) */
|
|
692
|
+
defaultOpen?: boolean;
|
|
693
|
+
/** Called when open state changes */
|
|
694
|
+
onOpenChange?: (open: boolean) => void;
|
|
695
|
+
/** Selection mode: single date or date range */
|
|
696
|
+
mode?: DatePickerMode;
|
|
697
|
+
/** Controlled value (single mode) */
|
|
698
|
+
value?: Date | null;
|
|
699
|
+
/** Default value (single mode, uncontrolled) */
|
|
700
|
+
defaultValue?: Date | null;
|
|
701
|
+
/** Called when date changes (single mode) */
|
|
702
|
+
onValueChange?: (value: Date | null) => void;
|
|
703
|
+
/** Controlled range (range mode) */
|
|
704
|
+
range?: DateRange;
|
|
705
|
+
/** Default range (range mode, uncontrolled) */
|
|
706
|
+
defaultRange?: DateRange;
|
|
707
|
+
/** Called when range changes */
|
|
708
|
+
onRangeChange?: (range: DateRange) => void;
|
|
709
|
+
/** Minimum selectable date */
|
|
710
|
+
minDate?: Date;
|
|
711
|
+
/** Maximum selectable date */
|
|
712
|
+
maxDate?: Date;
|
|
713
|
+
/** Locale for date formatting */
|
|
714
|
+
locale?: string;
|
|
715
|
+
/** First day of week (0=Sunday, 1=Monday) */
|
|
716
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
717
|
+
/** Placement relative to trigger */
|
|
718
|
+
placement?: Placement$1;
|
|
719
|
+
/** Offset from trigger in pixels */
|
|
720
|
+
offset?: number;
|
|
721
|
+
/** Whether to flip placement on viewport edge */
|
|
722
|
+
flip?: boolean;
|
|
723
|
+
/** Whether picker is disabled */
|
|
724
|
+
disabled?: boolean;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Root component for DatePicker compound pattern.
|
|
728
|
+
* Provides context to Trigger, Calendar, and related components.
|
|
729
|
+
*
|
|
730
|
+
* @example
|
|
731
|
+
* ```tsx
|
|
732
|
+
* <DatePicker.Root onValueChange={(date) => console.log(date)}>
|
|
733
|
+
* <DatePicker.Trigger>Select date</DatePicker.Trigger>
|
|
734
|
+
* <DatePicker.Content>
|
|
735
|
+
* <DatePicker.Calendar />
|
|
736
|
+
* </DatePicker.Content>
|
|
737
|
+
* </DatePicker.Root>
|
|
738
|
+
* ```
|
|
739
|
+
*/
|
|
740
|
+
declare function DatePickerRoot({ children, open: controlledOpen, defaultOpen, onOpenChange, mode, value: controlledValue, defaultValue, onValueChange, range: controlledRange, defaultRange, onRangeChange, minDate, maxDate, locale, firstDayOfWeek, placement: _placement, offset: _offset, flip: _flip, disabled, }: DatePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
741
|
+
declare namespace DatePickerRoot {
|
|
742
|
+
var displayName: string;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
declare const DatePicker: {
|
|
746
|
+
readonly Root: typeof DatePickerRoot;
|
|
747
|
+
readonly Trigger: react.ForwardRefExoticComponent<DatePickerTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
748
|
+
readonly Content: react.ForwardRefExoticComponent<DatePickerContentProps & react.RefAttributes<HTMLDialogElement>>;
|
|
749
|
+
readonly Calendar: react.ForwardRefExoticComponent<DatePickerCalendarProps & react.RefAttributes<HTMLDivElement>>;
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
interface SliderThumbProps extends HTMLAttributes<HTMLDivElement> {
|
|
753
|
+
/** Thumb type for range mode */
|
|
754
|
+
type?: "single" | "min" | "max";
|
|
755
|
+
/** Accessible label */
|
|
756
|
+
"aria-label"?: string;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
interface SliderRangeProps extends HTMLAttributes<HTMLDivElement> {
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
interface SliderTrackProps extends HTMLAttributes<HTMLDivElement> {
|
|
763
|
+
/** Track content (Range, Thumb components) */
|
|
764
|
+
children?: ReactNode;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
interface SliderRootProps {
|
|
768
|
+
/** Slider content */
|
|
769
|
+
children?: ReactNode;
|
|
770
|
+
/** Minimum allowed value */
|
|
771
|
+
min?: number;
|
|
772
|
+
/** Maximum allowed value */
|
|
773
|
+
max?: number;
|
|
774
|
+
/** Step increment */
|
|
775
|
+
step?: number;
|
|
776
|
+
/** Controlled value (single mode) */
|
|
777
|
+
value?: number;
|
|
778
|
+
/** Default value (single mode, uncontrolled) */
|
|
779
|
+
defaultValue?: number;
|
|
780
|
+
/** Called when value changes */
|
|
781
|
+
onValueChange?: (value: number) => void;
|
|
782
|
+
/** Range mode (two thumbs) */
|
|
783
|
+
range?: boolean;
|
|
784
|
+
/** Controlled range values */
|
|
785
|
+
rangeValue?: {
|
|
786
|
+
min: number;
|
|
787
|
+
max: number;
|
|
788
|
+
};
|
|
789
|
+
/** Default range values */
|
|
790
|
+
defaultRangeValue?: {
|
|
791
|
+
min: number;
|
|
792
|
+
max: number;
|
|
793
|
+
};
|
|
794
|
+
/** Called when range changes */
|
|
795
|
+
onRangeChange?: (range: {
|
|
796
|
+
min: number;
|
|
797
|
+
max: number;
|
|
798
|
+
}) => void;
|
|
799
|
+
/** Orientation */
|
|
800
|
+
orientation?: "horizontal" | "vertical";
|
|
801
|
+
/** Disabled state */
|
|
802
|
+
disabled?: boolean;
|
|
803
|
+
/** Value text formatter for screen readers */
|
|
804
|
+
formatValueText?: (value: number) => string;
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Root component for Slider compound pattern.
|
|
808
|
+
* Provides context to Track, Thumb, and Range components.
|
|
809
|
+
*
|
|
810
|
+
* @example
|
|
811
|
+
* ```tsx
|
|
812
|
+
* // Single value slider
|
|
813
|
+
* <Slider.Root onValueChange={(value) => console.log(value)}>
|
|
814
|
+
* <Slider.Track>
|
|
815
|
+
* <Slider.Range />
|
|
816
|
+
* <Slider.Thumb />
|
|
817
|
+
* </Slider.Track>
|
|
818
|
+
* </Slider.Root>
|
|
819
|
+
*
|
|
820
|
+
* // Range slider
|
|
821
|
+
* <Slider.Root range onRangeChange={(range) => console.log(range)}>
|
|
822
|
+
* <Slider.Track>
|
|
823
|
+
* <Slider.Range />
|
|
824
|
+
* <Slider.Thumb type="min" />
|
|
825
|
+
* <Slider.Thumb type="max" />
|
|
826
|
+
* </Slider.Track>
|
|
827
|
+
* </Slider.Root>
|
|
828
|
+
* ```
|
|
829
|
+
*/
|
|
830
|
+
declare function SliderRoot({ children, min, max, step, value: controlledValue, defaultValue, onValueChange, range, rangeValue: controlledRangeValue, defaultRangeValue, onRangeChange, orientation, disabled, formatValueText, }: SliderRootProps): react_jsx_runtime.JSX.Element;
|
|
831
|
+
declare namespace SliderRoot {
|
|
832
|
+
var displayName: string;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
declare const Slider: {
|
|
836
|
+
readonly Root: typeof SliderRoot;
|
|
837
|
+
readonly Track: react.ForwardRefExoticComponent<SliderTrackProps & react.RefAttributes<HTMLDivElement>>;
|
|
838
|
+
readonly Range: react.ForwardRefExoticComponent<SliderRangeProps & react.RefAttributes<HTMLDivElement>>;
|
|
839
|
+
readonly Thumb: react.ForwardRefExoticComponent<SliderThumbProps & react.RefAttributes<HTMLDivElement>>;
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
interface NumberInputDecrementProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
interface NumberInputIncrementProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
interface NumberInputFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange"> {
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
type NumberInputFormat = "decimal" | "currency" | "percent";
|
|
852
|
+
|
|
853
|
+
interface NumberInputRootProps {
|
|
854
|
+
/** NumberInput content */
|
|
855
|
+
children?: ReactNode;
|
|
856
|
+
/** Minimum allowed value */
|
|
857
|
+
min?: number;
|
|
858
|
+
/** Maximum allowed value */
|
|
859
|
+
max?: number;
|
|
860
|
+
/** Step increment */
|
|
861
|
+
step?: number;
|
|
862
|
+
/** Decimal precision */
|
|
863
|
+
precision?: number;
|
|
864
|
+
/** Controlled value */
|
|
865
|
+
value?: number | null;
|
|
866
|
+
/** Default value (uncontrolled) */
|
|
867
|
+
defaultValue?: number;
|
|
868
|
+
/** Called when value changes */
|
|
869
|
+
onValueChange?: (value: number) => void;
|
|
870
|
+
/** Format type */
|
|
871
|
+
format?: NumberInputFormat;
|
|
872
|
+
/** Currency code (for currency format) */
|
|
873
|
+
currency?: string;
|
|
874
|
+
/** Locale for formatting */
|
|
875
|
+
locale?: string;
|
|
876
|
+
/** Allow empty input */
|
|
877
|
+
allowEmpty?: boolean;
|
|
878
|
+
/** Disabled state */
|
|
879
|
+
disabled?: boolean;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Root component for NumberInput compound pattern.
|
|
883
|
+
* Provides context to Input, Increment, and Decrement components.
|
|
884
|
+
*
|
|
885
|
+
* @example
|
|
886
|
+
* ```tsx
|
|
887
|
+
* <NumberInput.Root min={0} max={100} onValueChange={(v) => console.log(v)}>
|
|
888
|
+
* <NumberInput.Decrement>-</NumberInput.Decrement>
|
|
889
|
+
* <NumberInput.Input />
|
|
890
|
+
* <NumberInput.Increment>+</NumberInput.Increment>
|
|
891
|
+
* </NumberInput.Root>
|
|
892
|
+
* ```
|
|
893
|
+
*/
|
|
894
|
+
declare function NumberInputRoot({ children, min, max, step, precision, value: controlledValue, defaultValue, onValueChange, format, currency, locale, allowEmpty, disabled, }: NumberInputRootProps): react_jsx_runtime.JSX.Element;
|
|
895
|
+
declare namespace NumberInputRoot {
|
|
896
|
+
var displayName: string;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
declare const NumberInput: {
|
|
900
|
+
readonly Root: typeof NumberInputRoot;
|
|
901
|
+
readonly Input: react.ForwardRefExoticComponent<NumberInputFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
902
|
+
readonly Increment: react.ForwardRefExoticComponent<NumberInputIncrementProps & react.RefAttributes<HTMLButtonElement>>;
|
|
903
|
+
readonly Decrement: react.ForwardRefExoticComponent<NumberInputDecrementProps & react.RefAttributes<HTMLButtonElement>>;
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
interface FileUploadItemProps extends Omit<HTMLAttributes<HTMLLIElement>, "children"> {
|
|
907
|
+
/** The file info to display */
|
|
908
|
+
file: FileInfo;
|
|
909
|
+
/** Custom render function for file content */
|
|
910
|
+
children?: ReactNode | ((file: FileInfo) => ReactNode);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
interface FileUploadInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
interface FileUploadDropzoneProps extends HTMLAttributes<HTMLDivElement> {
|
|
917
|
+
/** Dropzone content */
|
|
918
|
+
children?: ReactNode;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
interface FileUploadRootProps {
|
|
922
|
+
/** FileUpload content */
|
|
923
|
+
children?: ReactNode;
|
|
924
|
+
/** Accepted file types (MIME types or extensions) */
|
|
925
|
+
accept?: string;
|
|
926
|
+
/** Maximum number of files */
|
|
927
|
+
maxFiles?: number;
|
|
928
|
+
/** Maximum file size in bytes */
|
|
929
|
+
maxSize?: number;
|
|
930
|
+
/** Minimum file size in bytes */
|
|
931
|
+
minSize?: number;
|
|
932
|
+
/** Allow multiple files */
|
|
933
|
+
multiple?: boolean;
|
|
934
|
+
/** Disabled state */
|
|
935
|
+
disabled?: boolean;
|
|
936
|
+
/** Called when files are added */
|
|
937
|
+
onFilesAdd?: (files: FileInfo[]) => void;
|
|
938
|
+
/** Called when a file is removed */
|
|
939
|
+
onFileRemove?: (file: FileInfo) => void;
|
|
940
|
+
/** Called when files change */
|
|
941
|
+
onFilesChange?: (files: FileInfo[]) => void;
|
|
942
|
+
/** Called on validation error */
|
|
943
|
+
onError?: (error: FileUploadError) => void;
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Root component for FileUpload compound pattern.
|
|
947
|
+
* Provides context to Dropzone, Input, FileList, and Item components.
|
|
948
|
+
*
|
|
949
|
+
* @example
|
|
950
|
+
* ```tsx
|
|
951
|
+
* <FileUpload.Root accept="image/*" maxSize={5242880} onFilesChange={(files) => console.log(files)}>
|
|
952
|
+
* <FileUpload.Dropzone>
|
|
953
|
+
* <p>Drop files here or click to upload</p>
|
|
954
|
+
* </FileUpload.Dropzone>
|
|
955
|
+
* <FileUpload.FileList />
|
|
956
|
+
* </FileUpload.Root>
|
|
957
|
+
* ```
|
|
958
|
+
*/
|
|
959
|
+
declare function FileUploadRoot({ children, accept, maxFiles, maxSize, minSize, multiple, disabled, onFilesAdd, onFileRemove, onFilesChange, onError, }: FileUploadRootProps): react_jsx_runtime.JSX.Element;
|
|
960
|
+
declare namespace FileUploadRoot {
|
|
961
|
+
var displayName: string;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
declare const FileUpload: {
|
|
965
|
+
readonly Root: typeof FileUploadRoot;
|
|
966
|
+
readonly Dropzone: react.ForwardRefExoticComponent<FileUploadDropzoneProps & react.RefAttributes<HTMLDivElement>>;
|
|
967
|
+
readonly Input: react.ForwardRefExoticComponent<FileUploadInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
968
|
+
readonly Item: react.ForwardRefExoticComponent<FileUploadItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
interface TimePickerSegmentProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
972
|
+
/** Which segment this represents */
|
|
973
|
+
segment: TimeSegment;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
interface TimePickerRootProps {
|
|
977
|
+
/** TimePicker content */
|
|
978
|
+
children?: ReactNode;
|
|
979
|
+
/** 12-hour or 24-hour format */
|
|
980
|
+
hourFormat?: 12 | 24;
|
|
981
|
+
/** Show seconds segment */
|
|
982
|
+
showSeconds?: boolean;
|
|
983
|
+
/** Controlled time value */
|
|
984
|
+
value?: TimeValue;
|
|
985
|
+
/** Default time value (uncontrolled) */
|
|
986
|
+
defaultValue?: TimeValue;
|
|
987
|
+
/** Called when time changes */
|
|
988
|
+
onValueChange?: (value: TimeValue) => void;
|
|
989
|
+
/** Minute step */
|
|
990
|
+
minuteStep?: number;
|
|
991
|
+
/** Second step */
|
|
992
|
+
secondStep?: number;
|
|
993
|
+
/** Minimum time */
|
|
994
|
+
minTime?: TimeValue;
|
|
995
|
+
/** Maximum time */
|
|
996
|
+
maxTime?: TimeValue;
|
|
997
|
+
/** Disabled state */
|
|
998
|
+
disabled?: boolean;
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Root component for TimePicker compound pattern.
|
|
1002
|
+
* Provides context to Segment components.
|
|
1003
|
+
*
|
|
1004
|
+
* @example
|
|
1005
|
+
* ```tsx
|
|
1006
|
+
* <TimePicker.Root hourFormat={12} onValueChange={(time) => console.log(time)}>
|
|
1007
|
+
* <TimePicker.Segment segment="hour" />
|
|
1008
|
+
* <span>:</span>
|
|
1009
|
+
* <TimePicker.Segment segment="minute" />
|
|
1010
|
+
* <TimePicker.Segment segment="period" />
|
|
1011
|
+
* </TimePicker.Root>
|
|
1012
|
+
* ```
|
|
1013
|
+
*/
|
|
1014
|
+
declare function TimePickerRoot({ children, hourFormat, showSeconds, value: controlledValue, defaultValue, onValueChange, minuteStep, secondStep, minTime, maxTime, disabled, }: TimePickerRootProps): react_jsx_runtime.JSX.Element;
|
|
1015
|
+
declare namespace TimePickerRoot {
|
|
1016
|
+
var displayName: string;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
declare const TimePicker: {
|
|
1020
|
+
readonly Root: typeof TimePickerRoot;
|
|
1021
|
+
readonly Segment: react.ForwardRefExoticComponent<TimePickerSegmentProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
interface PinInputFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange"> {
|
|
1025
|
+
/** Field index (0-based) */
|
|
1026
|
+
index: number;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
interface PinInputRootProps {
|
|
1030
|
+
/** PinInput content */
|
|
1031
|
+
children?: ReactNode;
|
|
1032
|
+
/** Number of input fields */
|
|
1033
|
+
length?: number;
|
|
1034
|
+
/** Controlled value */
|
|
1035
|
+
value?: string;
|
|
1036
|
+
/** Default value (uncontrolled) */
|
|
1037
|
+
defaultValue?: string;
|
|
1038
|
+
/** Called when value changes */
|
|
1039
|
+
onValueChange?: (value: string) => void;
|
|
1040
|
+
/** Called when all digits entered */
|
|
1041
|
+
onComplete?: (value: string) => void;
|
|
1042
|
+
/** Allow alphanumeric characters */
|
|
1043
|
+
alphanumeric?: boolean;
|
|
1044
|
+
/** Disabled state */
|
|
1045
|
+
disabled?: boolean;
|
|
1046
|
+
/** Mask input (like password) */
|
|
1047
|
+
mask?: boolean;
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Root component for PinInput compound pattern.
|
|
1051
|
+
* Provides context to Field components.
|
|
1052
|
+
*
|
|
1053
|
+
* @example
|
|
1054
|
+
* ```tsx
|
|
1055
|
+
* <PinInput.Root length={6} onComplete={(value) => verifyOTP(value)}>
|
|
1056
|
+
* <PinInput.Field index={0} />
|
|
1057
|
+
* <PinInput.Field index={1} />
|
|
1058
|
+
* <PinInput.Field index={2} />
|
|
1059
|
+
* <PinInput.Field index={3} />
|
|
1060
|
+
* <PinInput.Field index={4} />
|
|
1061
|
+
* <PinInput.Field index={5} />
|
|
1062
|
+
* </PinInput.Root>
|
|
1063
|
+
* ```
|
|
1064
|
+
*/
|
|
1065
|
+
declare function PinInputRoot({ children, length, value: controlledValue, defaultValue, onValueChange, onComplete, alphanumeric, disabled, mask, }: PinInputRootProps): react_jsx_runtime.JSX.Element;
|
|
1066
|
+
declare namespace PinInputRoot {
|
|
1067
|
+
var displayName: string;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
declare const PinInput: {
|
|
1071
|
+
readonly Root: typeof PinInputRoot;
|
|
1072
|
+
readonly Field: react.ForwardRefExoticComponent<PinInputFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
interface PresenceProps {
|
|
1076
|
+
/**
|
|
1077
|
+
* Whether the child should be present (visible)
|
|
1078
|
+
*/
|
|
1079
|
+
present: boolean;
|
|
1080
|
+
/**
|
|
1081
|
+
* The child element to animate. Must be a single React element that accepts a ref.
|
|
1082
|
+
*/
|
|
1083
|
+
children: ReactElement;
|
|
1084
|
+
/**
|
|
1085
|
+
* Force the child to always be mounted (useful for SSR or animation debugging)
|
|
1086
|
+
* @default false
|
|
1087
|
+
*/
|
|
1088
|
+
forceMount?: boolean;
|
|
1089
|
+
/**
|
|
1090
|
+
* Called when the exit animation completes
|
|
1091
|
+
*/
|
|
1092
|
+
onExitComplete?: () => void;
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Presence component for managing exit animations.
|
|
1096
|
+
*
|
|
1097
|
+
* Keeps a child element mounted until its exit animation completes,
|
|
1098
|
+
* allowing for smooth enter/exit transitions.
|
|
1099
|
+
*
|
|
1100
|
+
* The child receives a ref and data-state attribute for animation:
|
|
1101
|
+
* - data-state="open" when entering
|
|
1102
|
+
* - data-state="closed" when exiting
|
|
1103
|
+
*
|
|
1104
|
+
* @example
|
|
1105
|
+
* ```tsx
|
|
1106
|
+
* <Presence present={isOpen} onExitComplete={() => console.log("closed")}>
|
|
1107
|
+
* <Dialog.Content className="animate-fade-in data-[state=closed]:animate-fade-out">
|
|
1108
|
+
* Dialog content
|
|
1109
|
+
* </Dialog.Content>
|
|
1110
|
+
* </Presence>
|
|
1111
|
+
* ```
|
|
1112
|
+
*/
|
|
1113
|
+
declare function Presence({ present, children, forceMount, onExitComplete, }: PresenceProps): ReactElement | null;
|
|
1114
|
+
|
|
1115
|
+
interface UsePresenceOptions {
|
|
1116
|
+
/**
|
|
1117
|
+
* Whether the element should be present (visible)
|
|
1118
|
+
*/
|
|
1119
|
+
present: boolean;
|
|
1120
|
+
/**
|
|
1121
|
+
* Called when the exit animation completes
|
|
1122
|
+
*/
|
|
1123
|
+
onExitComplete?: () => void;
|
|
1124
|
+
}
|
|
1125
|
+
interface UsePresenceReturn {
|
|
1126
|
+
/**
|
|
1127
|
+
* Whether the element should be rendered
|
|
1128
|
+
*/
|
|
1129
|
+
isPresent: boolean;
|
|
1130
|
+
/**
|
|
1131
|
+
* Ref to attach to the animated element
|
|
1132
|
+
*/
|
|
1133
|
+
ref: React.RefCallback<HTMLElement>;
|
|
1134
|
+
/**
|
|
1135
|
+
* Current animation state for data-state attribute
|
|
1136
|
+
*/
|
|
1137
|
+
dataState: "open" | "closed";
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Hook for managing presence/exit animations.
|
|
1141
|
+
*
|
|
1142
|
+
* Keeps an element mounted until its exit animation completes,
|
|
1143
|
+
* allowing for smooth enter/exit transitions.
|
|
1144
|
+
*
|
|
1145
|
+
* @example
|
|
1146
|
+
* ```tsx
|
|
1147
|
+
* function AnimatedDialog({ isOpen, onClose }) {
|
|
1148
|
+
* const { isPresent, ref, dataState } = usePresence({
|
|
1149
|
+
* present: isOpen,
|
|
1150
|
+
* onExitComplete: () => console.log("exit complete"),
|
|
1151
|
+
* });
|
|
1152
|
+
*
|
|
1153
|
+
* if (!isPresent) return null;
|
|
1154
|
+
*
|
|
1155
|
+
* return (
|
|
1156
|
+
* <div ref={ref} data-state={dataState} className="animate-fade-in">
|
|
1157
|
+
* Dialog content
|
|
1158
|
+
* </div>
|
|
1159
|
+
* );
|
|
1160
|
+
* }
|
|
1161
|
+
* ```
|
|
1162
|
+
*/
|
|
1163
|
+
declare function usePresence(options: UsePresenceOptions): UsePresenceReturn;
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Error Boundary utility for React adapters.
|
|
1167
|
+
*
|
|
1168
|
+
* Provides graceful error handling for design system components,
|
|
1169
|
+
* preventing component errors from crashing the entire application.
|
|
1170
|
+
*
|
|
1171
|
+
* @example
|
|
1172
|
+
* ```tsx
|
|
1173
|
+
* import { ErrorBoundary, withErrorBoundary } from "@hypoth-ui/react";
|
|
1174
|
+
*
|
|
1175
|
+
* // Use as a component wrapper
|
|
1176
|
+
* <ErrorBoundary fallback={<div>Component error</div>}>
|
|
1177
|
+
* <Dialog>...</Dialog>
|
|
1178
|
+
* </ErrorBoundary>
|
|
1179
|
+
*
|
|
1180
|
+
* // Or as a higher-order component
|
|
1181
|
+
* const SafeDialog = withErrorBoundary(Dialog, {
|
|
1182
|
+
* fallback: <div>Dialog failed to load</div>,
|
|
1183
|
+
* });
|
|
1184
|
+
* ```
|
|
1185
|
+
*/
|
|
1186
|
+
|
|
1187
|
+
interface ErrorBoundaryProps {
|
|
1188
|
+
/** Child components to wrap */
|
|
1189
|
+
children: ReactNode;
|
|
1190
|
+
/** Fallback UI to show on error */
|
|
1191
|
+
fallback?: ReactNode | ((error: Error, resetError: () => void) => ReactNode);
|
|
1192
|
+
/** Callback when an error is caught */
|
|
1193
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
1194
|
+
/** Reset key - changing this resets the error state */
|
|
1195
|
+
resetKey?: string | number;
|
|
1196
|
+
}
|
|
1197
|
+
interface ErrorBoundaryState {
|
|
1198
|
+
hasError: boolean;
|
|
1199
|
+
error: Error | null;
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* Error boundary component that catches JavaScript errors in child components.
|
|
1203
|
+
*
|
|
1204
|
+
* Features:
|
|
1205
|
+
* - Catches errors during rendering, lifecycle, and constructors
|
|
1206
|
+
* - Provides fallback UI instead of crashing
|
|
1207
|
+
* - Supports error recovery via resetKey or resetError callback
|
|
1208
|
+
* - Logs errors for debugging
|
|
1209
|
+
*/
|
|
1210
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
1211
|
+
constructor(props: ErrorBoundaryProps);
|
|
1212
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
1213
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
1214
|
+
componentDidUpdate(prevProps: ErrorBoundaryProps): void;
|
|
1215
|
+
resetError: () => void;
|
|
1216
|
+
render(): ReactNode;
|
|
1217
|
+
}
|
|
1218
|
+
interface WithErrorBoundaryOptions {
|
|
1219
|
+
/** Fallback UI to show on error */
|
|
1220
|
+
fallback?: ReactNode | ((error: Error, resetError: () => void) => ReactNode);
|
|
1221
|
+
/** Callback when an error is caught */
|
|
1222
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* Higher-order component that wraps a component with an ErrorBoundary.
|
|
1226
|
+
*
|
|
1227
|
+
* @example
|
|
1228
|
+
* ```tsx
|
|
1229
|
+
* const SafeDialog = withErrorBoundary(Dialog, {
|
|
1230
|
+
* fallback: <div>Failed to load dialog</div>,
|
|
1231
|
+
* onError: (error) => reportError(error),
|
|
1232
|
+
* });
|
|
1233
|
+
* ```
|
|
1234
|
+
*/
|
|
1235
|
+
declare function withErrorBoundary<P extends object>(WrappedComponent: ComponentType<P>, options?: WithErrorBoundaryOptions): ComponentType<P>;
|
|
1236
|
+
/**
|
|
1237
|
+
* Default error fallback component for design system components.
|
|
1238
|
+
*
|
|
1239
|
+
* Provides a simple error message in development and nothing in production.
|
|
1240
|
+
*/
|
|
1241
|
+
declare function DSErrorFallback({ error, componentName, }: {
|
|
1242
|
+
error: Error;
|
|
1243
|
+
componentName?: string;
|
|
1244
|
+
}): ReactNode;
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* Loading State Types
|
|
1248
|
+
*
|
|
1249
|
+
* Standardized loading state props for async components.
|
|
1250
|
+
*
|
|
1251
|
+
* @packageDocumentation
|
|
1252
|
+
*/
|
|
1253
|
+
/**
|
|
1254
|
+
* Loading state props for components that support async data.
|
|
1255
|
+
*
|
|
1256
|
+
* Components implementing this interface:
|
|
1257
|
+
* - Select (loading options)
|
|
1258
|
+
* - Combobox (loading search results)
|
|
1259
|
+
* - Table (loading rows)
|
|
1260
|
+
* - Tree (loading children)
|
|
1261
|
+
*
|
|
1262
|
+
* @example
|
|
1263
|
+
* ```tsx
|
|
1264
|
+
* // Basic loading state
|
|
1265
|
+
* <Select loading>
|
|
1266
|
+
* <SelectTrigger>Loading...</SelectTrigger>
|
|
1267
|
+
* </Select>
|
|
1268
|
+
*
|
|
1269
|
+
* // With loading text
|
|
1270
|
+
* <Select loading loadingText="Fetching options...">
|
|
1271
|
+
* <SelectTrigger>Select an option</SelectTrigger>
|
|
1272
|
+
* </Select>
|
|
1273
|
+
*
|
|
1274
|
+
* // Table with skeleton rows
|
|
1275
|
+
* <Table loading skeletonRows={5}>
|
|
1276
|
+
* <TableHeader>...</TableHeader>
|
|
1277
|
+
* </Table>
|
|
1278
|
+
* ```
|
|
1279
|
+
*/
|
|
1280
|
+
interface LoadingProps {
|
|
1281
|
+
/**
|
|
1282
|
+
* Whether the component is in a loading state.
|
|
1283
|
+
* When true:
|
|
1284
|
+
* - Sets aria-busy="true" for screen readers
|
|
1285
|
+
* - Disables keyboard navigation
|
|
1286
|
+
* - Shows loading indicator (component-specific)
|
|
1287
|
+
*/
|
|
1288
|
+
loading?: boolean;
|
|
1289
|
+
/**
|
|
1290
|
+
* Text to display/announce during loading.
|
|
1291
|
+
* Used for both visual loading indicator and screen reader announcement.
|
|
1292
|
+
* @default "Loading..."
|
|
1293
|
+
*/
|
|
1294
|
+
loadingText?: string;
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
* Extended loading props for table-like components.
|
|
1298
|
+
*/
|
|
1299
|
+
interface TableLoadingProps extends LoadingProps {
|
|
1300
|
+
/**
|
|
1301
|
+
* Number of skeleton rows to show during loading.
|
|
1302
|
+
* Only applies when `loading` is true.
|
|
1303
|
+
* @default 3
|
|
1304
|
+
*/
|
|
1305
|
+
skeletonRows?: number;
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Extended loading props for tree-like components.
|
|
1309
|
+
*/
|
|
1310
|
+
interface TreeLoadingProps extends LoadingProps {
|
|
1311
|
+
/**
|
|
1312
|
+
* Node IDs that are currently loading children.
|
|
1313
|
+
* Allows for node-level loading indicators.
|
|
1314
|
+
*/
|
|
1315
|
+
loadingNodes?: Set<string> | string[];
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Loading state detail for async operations.
|
|
1319
|
+
*/
|
|
1320
|
+
interface LoadingState {
|
|
1321
|
+
/** Whether currently loading */
|
|
1322
|
+
isLoading: boolean;
|
|
1323
|
+
/** Error that occurred during loading, if any */
|
|
1324
|
+
error?: Error | null;
|
|
1325
|
+
/** Progress percentage (0-100) for determinate loading */
|
|
1326
|
+
progress?: number;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Callback for when loading state changes.
|
|
1330
|
+
*/
|
|
1331
|
+
type OnLoadingChange = (state: LoadingState) => void;
|
|
1332
|
+
|
|
1333
|
+
interface CardRootProps extends HTMLAttributes<HTMLElement> {
|
|
1334
|
+
/** Card content */
|
|
1335
|
+
children?: ReactNode;
|
|
1336
|
+
}
|
|
1337
|
+
interface CardHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
1338
|
+
/** Header content */
|
|
1339
|
+
children?: ReactNode;
|
|
1340
|
+
}
|
|
1341
|
+
interface CardContentProps extends HTMLAttributes<HTMLElement> {
|
|
1342
|
+
/** Content */
|
|
1343
|
+
children?: ReactNode;
|
|
1344
|
+
}
|
|
1345
|
+
interface CardFooterProps extends HTMLAttributes<HTMLElement> {
|
|
1346
|
+
/** Footer content */
|
|
1347
|
+
children?: ReactNode;
|
|
1348
|
+
}
|
|
1349
|
+
declare const Card: {
|
|
1350
|
+
Root: react.ForwardRefExoticComponent<CardRootProps & react.RefAttributes<HTMLElement>>;
|
|
1351
|
+
Header: react.ForwardRefExoticComponent<CardHeaderProps & react.RefAttributes<HTMLElement>>;
|
|
1352
|
+
Content: react.ForwardRefExoticComponent<CardContentProps & react.RefAttributes<HTMLElement>>;
|
|
1353
|
+
Footer: react.ForwardRefExoticComponent<CardFooterProps & react.RefAttributes<HTMLElement>>;
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
type SeparatorOrientation = "horizontal" | "vertical";
|
|
1357
|
+
interface SeparatorProps extends HTMLAttributes<HTMLElement> {
|
|
1358
|
+
/** Visual orientation of the separator */
|
|
1359
|
+
orientation?: SeparatorOrientation;
|
|
1360
|
+
/** Whether the separator is purely decorative (no semantic meaning) */
|
|
1361
|
+
decorative?: boolean;
|
|
1362
|
+
}
|
|
1363
|
+
/**
|
|
1364
|
+
* Separator component - visual divider between content sections.
|
|
1365
|
+
*/
|
|
1366
|
+
declare const Separator: react.ForwardRefExoticComponent<SeparatorProps & react.RefAttributes<HTMLElement>>;
|
|
1367
|
+
|
|
1368
|
+
interface AspectRatioProps extends HTMLAttributes<HTMLElement> {
|
|
1369
|
+
/** Content to maintain aspect ratio */
|
|
1370
|
+
children?: ReactNode;
|
|
1371
|
+
/**
|
|
1372
|
+
* Aspect ratio as width/height (e.g., "16/9", "4/3", "1/1").
|
|
1373
|
+
* Can also be a number (e.g., 1.777 for 16:9).
|
|
1374
|
+
*/
|
|
1375
|
+
ratio?: string | number;
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* AspectRatio component - maintains consistent width-to-height ratio.
|
|
1379
|
+
*/
|
|
1380
|
+
declare const AspectRatio: react.ForwardRefExoticComponent<AspectRatioProps & react.RefAttributes<HTMLElement>>;
|
|
1381
|
+
|
|
1382
|
+
interface CollapsibleRootProps extends HTMLAttributes<HTMLElement> {
|
|
1383
|
+
/** Content */
|
|
1384
|
+
children?: ReactNode;
|
|
1385
|
+
/** Controlled open state */
|
|
1386
|
+
open?: boolean;
|
|
1387
|
+
/** Default open state (uncontrolled) */
|
|
1388
|
+
defaultOpen?: boolean;
|
|
1389
|
+
/** Called when open state changes */
|
|
1390
|
+
onOpenChange?: (open: boolean) => void;
|
|
1391
|
+
/** Disable the collapsible */
|
|
1392
|
+
disabled?: boolean;
|
|
1393
|
+
}
|
|
1394
|
+
interface CollapsibleTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1395
|
+
/** Trigger content */
|
|
1396
|
+
children?: ReactNode;
|
|
1397
|
+
}
|
|
1398
|
+
interface CollapsibleContentProps extends HTMLAttributes<HTMLElement> {
|
|
1399
|
+
/** Content */
|
|
1400
|
+
children?: ReactNode;
|
|
1401
|
+
/** Keep mounted when collapsed */
|
|
1402
|
+
forceMount?: boolean;
|
|
1403
|
+
}
|
|
1404
|
+
declare const Collapsible: {
|
|
1405
|
+
Root: react.ForwardRefExoticComponent<CollapsibleRootProps & react.RefAttributes<HTMLElement>>;
|
|
1406
|
+
Trigger: react.ForwardRefExoticComponent<CollapsibleTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1407
|
+
Content: react.ForwardRefExoticComponent<CollapsibleContentProps & react.RefAttributes<HTMLElement>>;
|
|
1408
|
+
};
|
|
1409
|
+
|
|
1410
|
+
type TabsOrientation = "horizontal" | "vertical";
|
|
1411
|
+
type TabsActivationMode = "automatic" | "manual";
|
|
1412
|
+
interface TabsRootProps extends HTMLAttributes<HTMLElement> {
|
|
1413
|
+
/** Content */
|
|
1414
|
+
children?: ReactNode;
|
|
1415
|
+
/** Controlled value */
|
|
1416
|
+
value?: string;
|
|
1417
|
+
/** Default value (uncontrolled) */
|
|
1418
|
+
defaultValue?: string;
|
|
1419
|
+
/** Called when value changes */
|
|
1420
|
+
onValueChange?: (value: string) => void;
|
|
1421
|
+
/** Keyboard navigation orientation */
|
|
1422
|
+
orientation?: TabsOrientation;
|
|
1423
|
+
/** Activation mode */
|
|
1424
|
+
activationMode?: TabsActivationMode;
|
|
1425
|
+
}
|
|
1426
|
+
interface TabsListProps extends HTMLAttributes<HTMLElement> {
|
|
1427
|
+
/** Content */
|
|
1428
|
+
children?: ReactNode;
|
|
1429
|
+
/** Loop focus at ends */
|
|
1430
|
+
loop?: boolean;
|
|
1431
|
+
}
|
|
1432
|
+
interface TabsTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1433
|
+
/** Content */
|
|
1434
|
+
children?: ReactNode;
|
|
1435
|
+
/** Unique value identifying this tab */
|
|
1436
|
+
value: string;
|
|
1437
|
+
/** Disable this tab */
|
|
1438
|
+
disabled?: boolean;
|
|
1439
|
+
}
|
|
1440
|
+
interface TabsContentProps extends HTMLAttributes<HTMLElement> {
|
|
1441
|
+
/** Content */
|
|
1442
|
+
children?: ReactNode;
|
|
1443
|
+
/** Value of associated tab */
|
|
1444
|
+
value: string;
|
|
1445
|
+
/** Keep mounted when inactive */
|
|
1446
|
+
forceMount?: boolean;
|
|
1447
|
+
}
|
|
1448
|
+
declare const Tabs: {
|
|
1449
|
+
Root: react.ForwardRefExoticComponent<TabsRootProps & react.RefAttributes<HTMLElement>>;
|
|
1450
|
+
List: react.ForwardRefExoticComponent<TabsListProps & react.RefAttributes<HTMLElement>>;
|
|
1451
|
+
Trigger: react.ForwardRefExoticComponent<TabsTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1452
|
+
Content: react.ForwardRefExoticComponent<TabsContentProps & react.RefAttributes<HTMLElement>>;
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1455
|
+
type AccordionType = "single" | "multiple";
|
|
1456
|
+
type AccordionOrientation = "horizontal" | "vertical";
|
|
1457
|
+
interface AccordionSingleProps {
|
|
1458
|
+
type: "single";
|
|
1459
|
+
/** Controlled value */
|
|
1460
|
+
value?: string;
|
|
1461
|
+
/** Default value (uncontrolled) */
|
|
1462
|
+
defaultValue?: string;
|
|
1463
|
+
/** Called when value changes */
|
|
1464
|
+
onValueChange?: (value: string) => void;
|
|
1465
|
+
/** Allow collapsing all items */
|
|
1466
|
+
collapsible?: boolean;
|
|
1467
|
+
}
|
|
1468
|
+
interface AccordionMultipleProps {
|
|
1469
|
+
type: "multiple";
|
|
1470
|
+
/** Controlled value */
|
|
1471
|
+
value?: string[];
|
|
1472
|
+
/** Default value (uncontrolled) */
|
|
1473
|
+
defaultValue?: string[];
|
|
1474
|
+
/** Called when value changes */
|
|
1475
|
+
onValueChange?: (value: string[]) => void;
|
|
1476
|
+
}
|
|
1477
|
+
type AccordionRootBaseProps = HTMLAttributes<HTMLElement> & {
|
|
1478
|
+
children?: ReactNode;
|
|
1479
|
+
orientation?: AccordionOrientation;
|
|
1480
|
+
};
|
|
1481
|
+
type AccordionRootProps = AccordionRootBaseProps & (AccordionSingleProps | AccordionMultipleProps);
|
|
1482
|
+
interface AccordionItemProps extends HTMLAttributes<HTMLElement> {
|
|
1483
|
+
children?: ReactNode;
|
|
1484
|
+
/** Unique value identifying this item */
|
|
1485
|
+
value: string;
|
|
1486
|
+
/** Disable this item */
|
|
1487
|
+
disabled?: boolean;
|
|
1488
|
+
}
|
|
1489
|
+
interface AccordionTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1490
|
+
children?: ReactNode;
|
|
1491
|
+
}
|
|
1492
|
+
interface AccordionContentProps extends HTMLAttributes<HTMLElement> {
|
|
1493
|
+
children?: ReactNode;
|
|
1494
|
+
/** Keep mounted when collapsed */
|
|
1495
|
+
forceMount?: boolean;
|
|
1496
|
+
}
|
|
1497
|
+
declare const Accordion: {
|
|
1498
|
+
Root: react.ForwardRefExoticComponent<AccordionRootProps & react.RefAttributes<HTMLElement>>;
|
|
1499
|
+
Item: react.ForwardRefExoticComponent<AccordionItemProps & react.RefAttributes<HTMLElement>>;
|
|
1500
|
+
Trigger: react.ForwardRefExoticComponent<AccordionTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1501
|
+
Content: react.ForwardRefExoticComponent<AccordionContentProps & react.RefAttributes<HTMLElement>>;
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
type AlertDialogContentSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
1505
|
+
interface AlertDialogRootProps extends HTMLAttributes<HTMLElement> {
|
|
1506
|
+
/** Content */
|
|
1507
|
+
children?: ReactNode;
|
|
1508
|
+
/** Controlled open state */
|
|
1509
|
+
open?: boolean;
|
|
1510
|
+
/** Default open state (uncontrolled) */
|
|
1511
|
+
defaultOpen?: boolean;
|
|
1512
|
+
/** Called when open state changes */
|
|
1513
|
+
onOpenChange?: (open: boolean) => void;
|
|
1514
|
+
/** Whether to animate open/close transitions */
|
|
1515
|
+
animated?: boolean;
|
|
1516
|
+
}
|
|
1517
|
+
interface AlertDialogTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1518
|
+
/** Trigger content (typically a button) */
|
|
1519
|
+
children?: ReactNode;
|
|
1520
|
+
}
|
|
1521
|
+
interface AlertDialogContentProps extends HTMLAttributes<HTMLElement> {
|
|
1522
|
+
/** Content */
|
|
1523
|
+
children?: ReactNode;
|
|
1524
|
+
/** Size of the content */
|
|
1525
|
+
size?: AlertDialogContentSize;
|
|
1526
|
+
}
|
|
1527
|
+
interface AlertDialogHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
1528
|
+
/** Header content */
|
|
1529
|
+
children?: ReactNode;
|
|
1530
|
+
}
|
|
1531
|
+
interface AlertDialogFooterProps extends HTMLAttributes<HTMLElement> {
|
|
1532
|
+
/** Footer content */
|
|
1533
|
+
children?: ReactNode;
|
|
1534
|
+
}
|
|
1535
|
+
interface AlertDialogTitleProps extends HTMLAttributes<HTMLElement> {
|
|
1536
|
+
/** Title content */
|
|
1537
|
+
children?: ReactNode;
|
|
1538
|
+
}
|
|
1539
|
+
interface AlertDialogDescriptionProps extends HTMLAttributes<HTMLElement> {
|
|
1540
|
+
/** Description content */
|
|
1541
|
+
children?: ReactNode;
|
|
1542
|
+
}
|
|
1543
|
+
interface AlertDialogActionProps extends HTMLAttributes<HTMLElement> {
|
|
1544
|
+
/** Action button content */
|
|
1545
|
+
children?: ReactNode;
|
|
1546
|
+
/** Called when action is clicked */
|
|
1547
|
+
onClick?: () => void;
|
|
1548
|
+
}
|
|
1549
|
+
interface AlertDialogCancelProps extends HTMLAttributes<HTMLElement> {
|
|
1550
|
+
/** Cancel button content */
|
|
1551
|
+
children?: ReactNode;
|
|
1552
|
+
/** Called when cancel is clicked */
|
|
1553
|
+
onClick?: () => void;
|
|
1554
|
+
}
|
|
1555
|
+
declare const AlertDialog: {
|
|
1556
|
+
Root: react.ForwardRefExoticComponent<AlertDialogRootProps & react.RefAttributes<HTMLElement>>;
|
|
1557
|
+
Trigger: react.ForwardRefExoticComponent<AlertDialogTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1558
|
+
Content: react.ForwardRefExoticComponent<AlertDialogContentProps & react.RefAttributes<HTMLElement>>;
|
|
1559
|
+
Header: react.ForwardRefExoticComponent<AlertDialogHeaderProps & react.RefAttributes<HTMLElement>>;
|
|
1560
|
+
Footer: react.ForwardRefExoticComponent<AlertDialogFooterProps & react.RefAttributes<HTMLElement>>;
|
|
1561
|
+
Title: react.ForwardRefExoticComponent<AlertDialogTitleProps & react.RefAttributes<HTMLElement>>;
|
|
1562
|
+
Description: react.ForwardRefExoticComponent<AlertDialogDescriptionProps & react.RefAttributes<HTMLElement>>;
|
|
1563
|
+
Action: react.ForwardRefExoticComponent<AlertDialogActionProps & react.RefAttributes<HTMLElement>>;
|
|
1564
|
+
Cancel: react.ForwardRefExoticComponent<AlertDialogCancelProps & react.RefAttributes<HTMLElement>>;
|
|
1565
|
+
};
|
|
1566
|
+
|
|
1567
|
+
type SheetSide = "top" | "right" | "bottom" | "left";
|
|
1568
|
+
type SheetContentSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
1569
|
+
interface SheetRootProps extends HTMLAttributes<HTMLElement> {
|
|
1570
|
+
/** Content */
|
|
1571
|
+
children?: ReactNode;
|
|
1572
|
+
/** Controlled open state */
|
|
1573
|
+
open?: boolean;
|
|
1574
|
+
/** Default open state (uncontrolled) */
|
|
1575
|
+
defaultOpen?: boolean;
|
|
1576
|
+
/** Called when open state changes */
|
|
1577
|
+
onOpenChange?: (open: boolean) => void;
|
|
1578
|
+
/** Whether Escape key closes the sheet */
|
|
1579
|
+
closeOnEscape?: boolean;
|
|
1580
|
+
/** Whether clicking the overlay closes the sheet */
|
|
1581
|
+
closeOnOverlay?: boolean;
|
|
1582
|
+
/** Whether to animate open/close transitions */
|
|
1583
|
+
animated?: boolean;
|
|
1584
|
+
}
|
|
1585
|
+
interface SheetTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1586
|
+
/** Trigger content (typically a button) */
|
|
1587
|
+
children?: ReactNode;
|
|
1588
|
+
}
|
|
1589
|
+
interface SheetContentProps extends HTMLAttributes<HTMLElement> {
|
|
1590
|
+
/** Content */
|
|
1591
|
+
children?: ReactNode;
|
|
1592
|
+
/** Side of the screen the sheet appears from */
|
|
1593
|
+
side?: SheetSide;
|
|
1594
|
+
/** Size of the content */
|
|
1595
|
+
size?: SheetContentSize;
|
|
1596
|
+
}
|
|
1597
|
+
interface SheetHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
1598
|
+
/** Header content */
|
|
1599
|
+
children?: ReactNode;
|
|
1600
|
+
}
|
|
1601
|
+
interface SheetFooterProps extends HTMLAttributes<HTMLElement> {
|
|
1602
|
+
/** Footer content */
|
|
1603
|
+
children?: ReactNode;
|
|
1604
|
+
}
|
|
1605
|
+
interface SheetTitleProps extends HTMLAttributes<HTMLElement> {
|
|
1606
|
+
/** Title content */
|
|
1607
|
+
children?: ReactNode;
|
|
1608
|
+
}
|
|
1609
|
+
interface SheetDescriptionProps extends HTMLAttributes<HTMLElement> {
|
|
1610
|
+
/** Description content */
|
|
1611
|
+
children?: ReactNode;
|
|
1612
|
+
}
|
|
1613
|
+
interface SheetCloseProps extends HTMLAttributes<HTMLElement> {
|
|
1614
|
+
/** Close button content */
|
|
1615
|
+
children?: ReactNode;
|
|
1616
|
+
}
|
|
1617
|
+
declare const Sheet: {
|
|
1618
|
+
Root: react.ForwardRefExoticComponent<SheetRootProps & react.RefAttributes<HTMLElement>>;
|
|
1619
|
+
Trigger: react.ForwardRefExoticComponent<SheetTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1620
|
+
Content: react.ForwardRefExoticComponent<SheetContentProps & react.RefAttributes<HTMLElement>>;
|
|
1621
|
+
Header: react.ForwardRefExoticComponent<SheetHeaderProps & react.RefAttributes<HTMLElement>>;
|
|
1622
|
+
Footer: react.ForwardRefExoticComponent<SheetFooterProps & react.RefAttributes<HTMLElement>>;
|
|
1623
|
+
Title: react.ForwardRefExoticComponent<SheetTitleProps & react.RefAttributes<HTMLElement>>;
|
|
1624
|
+
Description: react.ForwardRefExoticComponent<SheetDescriptionProps & react.RefAttributes<HTMLElement>>;
|
|
1625
|
+
Close: react.ForwardRefExoticComponent<SheetCloseProps & react.RefAttributes<HTMLElement>>;
|
|
1626
|
+
};
|
|
1627
|
+
|
|
1628
|
+
type DrawerSide = "top" | "right" | "bottom" | "left";
|
|
1629
|
+
interface DrawerRootProps extends HTMLAttributes<HTMLElement> {
|
|
1630
|
+
/** Content */
|
|
1631
|
+
children?: ReactNode;
|
|
1632
|
+
/** Controlled open state */
|
|
1633
|
+
open?: boolean;
|
|
1634
|
+
/** Default open state (uncontrolled) */
|
|
1635
|
+
defaultOpen?: boolean;
|
|
1636
|
+
/** Called when open state changes */
|
|
1637
|
+
onOpenChange?: (open: boolean) => void;
|
|
1638
|
+
/** Side of the screen the drawer appears from */
|
|
1639
|
+
side?: DrawerSide;
|
|
1640
|
+
/** Whether swipe-to-dismiss is enabled */
|
|
1641
|
+
swipeDismiss?: boolean;
|
|
1642
|
+
/** Whether Escape key closes the drawer */
|
|
1643
|
+
closeOnEscape?: boolean;
|
|
1644
|
+
/** Whether clicking the overlay closes the drawer */
|
|
1645
|
+
closeOnOverlay?: boolean;
|
|
1646
|
+
/** Whether to animate open/close transitions */
|
|
1647
|
+
animated?: boolean;
|
|
1648
|
+
}
|
|
1649
|
+
interface DrawerTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1650
|
+
/** Trigger content (typically a button) */
|
|
1651
|
+
children?: ReactNode;
|
|
1652
|
+
}
|
|
1653
|
+
interface DrawerContentProps extends HTMLAttributes<HTMLElement> {
|
|
1654
|
+
/** Content */
|
|
1655
|
+
children?: ReactNode;
|
|
1656
|
+
}
|
|
1657
|
+
interface DrawerHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
1658
|
+
/** Header content */
|
|
1659
|
+
children?: ReactNode;
|
|
1660
|
+
}
|
|
1661
|
+
interface DrawerFooterProps extends HTMLAttributes<HTMLElement> {
|
|
1662
|
+
/** Footer content */
|
|
1663
|
+
children?: ReactNode;
|
|
1664
|
+
}
|
|
1665
|
+
interface DrawerTitleProps extends HTMLAttributes<HTMLElement> {
|
|
1666
|
+
/** Title content */
|
|
1667
|
+
children?: ReactNode;
|
|
1668
|
+
}
|
|
1669
|
+
interface DrawerDescriptionProps extends HTMLAttributes<HTMLElement> {
|
|
1670
|
+
/** Description content */
|
|
1671
|
+
children?: ReactNode;
|
|
1672
|
+
}
|
|
1673
|
+
declare const Drawer: {
|
|
1674
|
+
Root: react.ForwardRefExoticComponent<DrawerRootProps & react.RefAttributes<HTMLElement>>;
|
|
1675
|
+
Trigger: react.ForwardRefExoticComponent<DrawerTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1676
|
+
Content: react.ForwardRefExoticComponent<DrawerContentProps & react.RefAttributes<HTMLElement>>;
|
|
1677
|
+
Header: react.ForwardRefExoticComponent<DrawerHeaderProps & react.RefAttributes<HTMLElement>>;
|
|
1678
|
+
Footer: react.ForwardRefExoticComponent<DrawerFooterProps & react.RefAttributes<HTMLElement>>;
|
|
1679
|
+
Title: react.ForwardRefExoticComponent<DrawerTitleProps & react.RefAttributes<HTMLElement>>;
|
|
1680
|
+
Description: react.ForwardRefExoticComponent<DrawerDescriptionProps & react.RefAttributes<HTMLElement>>;
|
|
1681
|
+
};
|
|
1682
|
+
|
|
1683
|
+
type DropdownMenuPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
1684
|
+
type DropdownMenuItemVariant = "default" | "destructive";
|
|
1685
|
+
interface DropdownMenuRootProps extends HTMLAttributes<HTMLElement> {
|
|
1686
|
+
/** Content */
|
|
1687
|
+
children?: ReactNode;
|
|
1688
|
+
/** Controlled open state */
|
|
1689
|
+
open?: boolean;
|
|
1690
|
+
/** Default open state (uncontrolled) */
|
|
1691
|
+
defaultOpen?: boolean;
|
|
1692
|
+
/** Called when open state changes */
|
|
1693
|
+
onOpenChange?: (open: boolean) => void;
|
|
1694
|
+
/** Placement relative to trigger */
|
|
1695
|
+
placement?: DropdownMenuPlacement;
|
|
1696
|
+
/** Offset distance from trigger in pixels */
|
|
1697
|
+
offset?: number;
|
|
1698
|
+
/** Whether to flip placement when near viewport edge */
|
|
1699
|
+
flip?: boolean;
|
|
1700
|
+
/** Whether to animate open/close transitions */
|
|
1701
|
+
animated?: boolean;
|
|
1702
|
+
/** Modal behavior - blocks interaction outside menu */
|
|
1703
|
+
modal?: boolean;
|
|
1704
|
+
}
|
|
1705
|
+
interface DropdownMenuTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1706
|
+
/** Trigger content (typically a button) */
|
|
1707
|
+
children?: ReactNode;
|
|
1708
|
+
}
|
|
1709
|
+
interface DropdownMenuContentProps extends HTMLAttributes<HTMLElement> {
|
|
1710
|
+
/** Content */
|
|
1711
|
+
children?: ReactNode;
|
|
1712
|
+
}
|
|
1713
|
+
interface DropdownMenuItemProps extends Omit<HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
1714
|
+
/** Item content */
|
|
1715
|
+
children?: ReactNode;
|
|
1716
|
+
/** Value for selection events */
|
|
1717
|
+
value?: string;
|
|
1718
|
+
/** Visual variant */
|
|
1719
|
+
variant?: DropdownMenuItemVariant;
|
|
1720
|
+
/** Disabled state */
|
|
1721
|
+
disabled?: boolean;
|
|
1722
|
+
/** Called when item is selected */
|
|
1723
|
+
onSelect?: (value: string) => void;
|
|
1724
|
+
}
|
|
1725
|
+
interface DropdownMenuSeparatorProps extends HTMLAttributes<HTMLElement> {
|
|
1726
|
+
}
|
|
1727
|
+
interface DropdownMenuLabelProps extends HTMLAttributes<HTMLElement> {
|
|
1728
|
+
/** Label content */
|
|
1729
|
+
children?: ReactNode;
|
|
1730
|
+
}
|
|
1731
|
+
interface DropdownMenuCheckboxItemProps extends HTMLAttributes<HTMLElement> {
|
|
1732
|
+
/** Item content */
|
|
1733
|
+
children?: ReactNode;
|
|
1734
|
+
/** Whether the checkbox is checked */
|
|
1735
|
+
checked?: boolean;
|
|
1736
|
+
/** Called when checkbox state changes */
|
|
1737
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1738
|
+
/** Disabled state */
|
|
1739
|
+
disabled?: boolean;
|
|
1740
|
+
}
|
|
1741
|
+
interface DropdownMenuRadioGroupProps extends HTMLAttributes<HTMLElement> {
|
|
1742
|
+
/** Radio items */
|
|
1743
|
+
children?: ReactNode;
|
|
1744
|
+
/** Currently selected value */
|
|
1745
|
+
value?: string;
|
|
1746
|
+
/** Called when selection changes */
|
|
1747
|
+
onValueChange?: (value: string) => void;
|
|
1748
|
+
}
|
|
1749
|
+
interface DropdownMenuRadioItemProps extends HTMLAttributes<HTMLElement> {
|
|
1750
|
+
/** Item content */
|
|
1751
|
+
children?: ReactNode;
|
|
1752
|
+
/** Value for this radio item */
|
|
1753
|
+
value: string;
|
|
1754
|
+
/** Disabled state */
|
|
1755
|
+
disabled?: boolean;
|
|
1756
|
+
}
|
|
1757
|
+
declare const DropdownMenu: {
|
|
1758
|
+
Root: react.ForwardRefExoticComponent<DropdownMenuRootProps & react.RefAttributes<HTMLElement>>;
|
|
1759
|
+
Trigger: react.ForwardRefExoticComponent<DropdownMenuTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1760
|
+
Content: react.ForwardRefExoticComponent<DropdownMenuContentProps & react.RefAttributes<HTMLElement>>;
|
|
1761
|
+
Item: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLElement>>;
|
|
1762
|
+
Separator: react.ForwardRefExoticComponent<DropdownMenuSeparatorProps & react.RefAttributes<HTMLElement>>;
|
|
1763
|
+
Label: react.ForwardRefExoticComponent<DropdownMenuLabelProps & react.RefAttributes<HTMLElement>>;
|
|
1764
|
+
CheckboxItem: react.ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & react.RefAttributes<HTMLElement>>;
|
|
1765
|
+
RadioGroup: react.ForwardRefExoticComponent<DropdownMenuRadioGroupProps & react.RefAttributes<HTMLElement>>;
|
|
1766
|
+
RadioItem: react.ForwardRefExoticComponent<DropdownMenuRadioItemProps & react.RefAttributes<HTMLElement>>;
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
type ContextMenuItemVariant = "default" | "destructive";
|
|
1770
|
+
interface ContextMenuRootProps extends HTMLAttributes<HTMLElement> {
|
|
1771
|
+
/** Content */
|
|
1772
|
+
children?: ReactNode;
|
|
1773
|
+
/** Controlled open state */
|
|
1774
|
+
open?: boolean;
|
|
1775
|
+
/** Called when open state changes */
|
|
1776
|
+
onOpenChange?: (open: boolean) => void;
|
|
1777
|
+
/** Whether to animate open/close transitions */
|
|
1778
|
+
animated?: boolean;
|
|
1779
|
+
}
|
|
1780
|
+
interface ContextMenuTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1781
|
+
/** Trigger content (the area that responds to right-click) */
|
|
1782
|
+
children?: ReactNode;
|
|
1783
|
+
}
|
|
1784
|
+
interface ContextMenuContentProps extends HTMLAttributes<HTMLElement> {
|
|
1785
|
+
/** Content */
|
|
1786
|
+
children?: ReactNode;
|
|
1787
|
+
}
|
|
1788
|
+
interface ContextMenuItemProps extends Omit<HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
1789
|
+
/** Item content */
|
|
1790
|
+
children?: ReactNode;
|
|
1791
|
+
/** Value for selection events */
|
|
1792
|
+
value?: string;
|
|
1793
|
+
/** Visual variant */
|
|
1794
|
+
variant?: ContextMenuItemVariant;
|
|
1795
|
+
/** Disabled state */
|
|
1796
|
+
disabled?: boolean;
|
|
1797
|
+
/** Called when item is selected */
|
|
1798
|
+
onSelect?: (value: string) => void;
|
|
1799
|
+
}
|
|
1800
|
+
interface ContextMenuSeparatorProps extends HTMLAttributes<HTMLElement> {
|
|
1801
|
+
}
|
|
1802
|
+
interface ContextMenuLabelProps extends HTMLAttributes<HTMLElement> {
|
|
1803
|
+
/** Label content */
|
|
1804
|
+
children?: ReactNode;
|
|
1805
|
+
}
|
|
1806
|
+
declare const ContextMenu: {
|
|
1807
|
+
Root: react.ForwardRefExoticComponent<ContextMenuRootProps & react.RefAttributes<HTMLElement>>;
|
|
1808
|
+
Trigger: react.ForwardRefExoticComponent<ContextMenuTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1809
|
+
Content: react.ForwardRefExoticComponent<ContextMenuContentProps & react.RefAttributes<HTMLElement>>;
|
|
1810
|
+
Item: react.ForwardRefExoticComponent<ContextMenuItemProps & react.RefAttributes<HTMLElement>>;
|
|
1811
|
+
Separator: react.ForwardRefExoticComponent<ContextMenuSeparatorProps & react.RefAttributes<HTMLElement>>;
|
|
1812
|
+
Label: react.ForwardRefExoticComponent<ContextMenuLabelProps & react.RefAttributes<HTMLElement>>;
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
type HoverCardPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
1816
|
+
interface HoverCardRootProps extends HTMLAttributes<HTMLElement> {
|
|
1817
|
+
/** Content */
|
|
1818
|
+
children?: ReactNode;
|
|
1819
|
+
/** Controlled open state */
|
|
1820
|
+
open?: boolean;
|
|
1821
|
+
/** Default open state (uncontrolled) */
|
|
1822
|
+
defaultOpen?: boolean;
|
|
1823
|
+
/** Called when open state changes */
|
|
1824
|
+
onOpenChange?: (open: boolean) => void;
|
|
1825
|
+
/** Placement relative to trigger */
|
|
1826
|
+
placement?: HoverCardPlacement;
|
|
1827
|
+
/** Offset distance from trigger in pixels */
|
|
1828
|
+
offset?: number;
|
|
1829
|
+
/** Whether to flip placement when near viewport edge */
|
|
1830
|
+
flip?: boolean;
|
|
1831
|
+
/** Delay in ms before showing on hover */
|
|
1832
|
+
openDelay?: number;
|
|
1833
|
+
/** Delay in ms before hiding after hover leaves */
|
|
1834
|
+
closeDelay?: number;
|
|
1835
|
+
/** Whether to animate open/close transitions */
|
|
1836
|
+
animated?: boolean;
|
|
1837
|
+
}
|
|
1838
|
+
interface HoverCardTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1839
|
+
/** Trigger content */
|
|
1840
|
+
children?: ReactNode;
|
|
1841
|
+
}
|
|
1842
|
+
interface HoverCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
1843
|
+
/** Content */
|
|
1844
|
+
children?: ReactNode;
|
|
1845
|
+
}
|
|
1846
|
+
declare const HoverCard: {
|
|
1847
|
+
Root: react.ForwardRefExoticComponent<HoverCardRootProps & react.RefAttributes<HTMLElement>>;
|
|
1848
|
+
Trigger: react.ForwardRefExoticComponent<HoverCardTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1849
|
+
Content: react.ForwardRefExoticComponent<HoverCardContentProps & react.RefAttributes<HTMLElement>>;
|
|
1850
|
+
};
|
|
1851
|
+
|
|
1852
|
+
type NavigationMenuOrientation = "horizontal" | "vertical";
|
|
1853
|
+
interface NavigationMenuRootProps extends HTMLAttributes<HTMLElement> {
|
|
1854
|
+
/** Content */
|
|
1855
|
+
children?: ReactNode;
|
|
1856
|
+
/** Controlled active value */
|
|
1857
|
+
value?: string;
|
|
1858
|
+
/** Default active value (uncontrolled) */
|
|
1859
|
+
defaultValue?: string;
|
|
1860
|
+
/** Called when active value changes */
|
|
1861
|
+
onValueChange?: (value: string) => void;
|
|
1862
|
+
/** Delay in ms before opening on hover */
|
|
1863
|
+
delayDuration?: number;
|
|
1864
|
+
/** Delay in ms before closing when pointer leaves */
|
|
1865
|
+
skipDelayDuration?: number;
|
|
1866
|
+
/** Orientation (horizontal or vertical) */
|
|
1867
|
+
orientation?: NavigationMenuOrientation;
|
|
1868
|
+
}
|
|
1869
|
+
interface NavigationMenuListProps extends HTMLAttributes<HTMLElement> {
|
|
1870
|
+
/** List items */
|
|
1871
|
+
children?: ReactNode;
|
|
1872
|
+
}
|
|
1873
|
+
interface NavigationMenuItemProps extends HTMLAttributes<HTMLElement> {
|
|
1874
|
+
/** Item content */
|
|
1875
|
+
children?: ReactNode;
|
|
1876
|
+
/** Unique value for this item */
|
|
1877
|
+
value: string;
|
|
1878
|
+
}
|
|
1879
|
+
interface NavigationMenuTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
1880
|
+
/** Trigger content */
|
|
1881
|
+
children?: ReactNode;
|
|
1882
|
+
/** Disabled state */
|
|
1883
|
+
disabled?: boolean;
|
|
1884
|
+
}
|
|
1885
|
+
interface NavigationMenuContentProps extends HTMLAttributes<HTMLElement> {
|
|
1886
|
+
/** Content */
|
|
1887
|
+
children?: ReactNode;
|
|
1888
|
+
}
|
|
1889
|
+
interface NavigationMenuLinkProps extends HTMLAttributes<HTMLElement> {
|
|
1890
|
+
/** Link content */
|
|
1891
|
+
children?: ReactNode;
|
|
1892
|
+
/** URL to navigate to */
|
|
1893
|
+
href?: string;
|
|
1894
|
+
/** Whether this link is currently active */
|
|
1895
|
+
active?: boolean;
|
|
1896
|
+
/** Disabled state */
|
|
1897
|
+
disabled?: boolean;
|
|
1898
|
+
/** Called when link is clicked */
|
|
1899
|
+
onNavigate?: (href: string) => void;
|
|
1900
|
+
}
|
|
1901
|
+
interface NavigationMenuIndicatorProps extends HTMLAttributes<HTMLElement> {
|
|
1902
|
+
}
|
|
1903
|
+
interface NavigationMenuViewportProps extends HTMLAttributes<HTMLElement> {
|
|
1904
|
+
}
|
|
1905
|
+
declare const NavigationMenu: {
|
|
1906
|
+
Root: react.ForwardRefExoticComponent<NavigationMenuRootProps & react.RefAttributes<HTMLElement>>;
|
|
1907
|
+
List: react.ForwardRefExoticComponent<NavigationMenuListProps & react.RefAttributes<HTMLElement>>;
|
|
1908
|
+
Item: react.ForwardRefExoticComponent<NavigationMenuItemProps & react.RefAttributes<HTMLElement>>;
|
|
1909
|
+
Trigger: react.ForwardRefExoticComponent<NavigationMenuTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
1910
|
+
Content: react.ForwardRefExoticComponent<NavigationMenuContentProps & react.RefAttributes<HTMLElement>>;
|
|
1911
|
+
Link: react.ForwardRefExoticComponent<NavigationMenuLinkProps & react.RefAttributes<HTMLElement>>;
|
|
1912
|
+
Indicator: react.ForwardRefExoticComponent<NavigationMenuIndicatorProps & react.RefAttributes<HTMLElement>>;
|
|
1913
|
+
Viewport: react.ForwardRefExoticComponent<NavigationMenuViewportProps & react.RefAttributes<HTMLElement>>;
|
|
1914
|
+
};
|
|
1915
|
+
|
|
1916
|
+
type ScrollAreaType = "auto" | "always" | "scroll" | "hover";
|
|
1917
|
+
interface ScrollAreaRootProps extends HTMLAttributes<HTMLElement> {
|
|
1918
|
+
/** Content */
|
|
1919
|
+
children?: ReactNode;
|
|
1920
|
+
/** When scrollbars are visible */
|
|
1921
|
+
type?: ScrollAreaType;
|
|
1922
|
+
/** Scroll hide delay in ms (for hover type) */
|
|
1923
|
+
scrollHideDelay?: number;
|
|
1924
|
+
/** Orientation for which to show scrollbar */
|
|
1925
|
+
orientation?: "vertical" | "horizontal" | "both";
|
|
1926
|
+
/** Custom styles */
|
|
1927
|
+
style?: CSSProperties;
|
|
1928
|
+
}
|
|
1929
|
+
interface ScrollAreaViewportProps extends HTMLAttributes<HTMLElement> {
|
|
1930
|
+
/** Scrollable content */
|
|
1931
|
+
children?: ReactNode;
|
|
1932
|
+
}
|
|
1933
|
+
interface ScrollAreaScrollbarProps extends HTMLAttributes<HTMLElement> {
|
|
1934
|
+
/** Scrollbar content (typically a thumb) */
|
|
1935
|
+
children?: ReactNode;
|
|
1936
|
+
/** Scrollbar orientation */
|
|
1937
|
+
orientation?: "vertical" | "horizontal";
|
|
1938
|
+
}
|
|
1939
|
+
interface ScrollAreaThumbProps extends HTMLAttributes<HTMLElement> {
|
|
1940
|
+
}
|
|
1941
|
+
declare const ScrollArea: {
|
|
1942
|
+
Root: react.ForwardRefExoticComponent<ScrollAreaRootProps & react.RefAttributes<HTMLElement>>;
|
|
1943
|
+
Viewport: react.ForwardRefExoticComponent<ScrollAreaViewportProps & react.RefAttributes<HTMLElement>>;
|
|
1944
|
+
Scrollbar: react.ForwardRefExoticComponent<ScrollAreaScrollbarProps & react.RefAttributes<HTMLElement>>;
|
|
1945
|
+
Thumb: react.ForwardRefExoticComponent<ScrollAreaThumbProps & react.RefAttributes<HTMLElement>>;
|
|
1946
|
+
};
|
|
1947
|
+
|
|
1948
|
+
interface BreadcrumbRootProps extends HTMLAttributes<HTMLElement> {
|
|
1949
|
+
children?: ReactNode;
|
|
1950
|
+
}
|
|
1951
|
+
interface BreadcrumbListProps extends HTMLAttributes<HTMLElement> {
|
|
1952
|
+
children?: ReactNode;
|
|
1953
|
+
}
|
|
1954
|
+
interface BreadcrumbItemProps extends HTMLAttributes<HTMLElement> {
|
|
1955
|
+
children?: ReactNode;
|
|
1956
|
+
}
|
|
1957
|
+
interface BreadcrumbLinkProps extends HTMLAttributes<HTMLElement> {
|
|
1958
|
+
children?: ReactNode;
|
|
1959
|
+
href?: string;
|
|
1960
|
+
onNavigate?: (href: string) => void;
|
|
1961
|
+
}
|
|
1962
|
+
interface BreadcrumbPageProps extends HTMLAttributes<HTMLElement> {
|
|
1963
|
+
children?: ReactNode;
|
|
1964
|
+
}
|
|
1965
|
+
interface BreadcrumbSeparatorProps extends HTMLAttributes<HTMLElement> {
|
|
1966
|
+
children?: ReactNode;
|
|
1967
|
+
}
|
|
1968
|
+
declare const Breadcrumb: {
|
|
1969
|
+
Root: react.ForwardRefExoticComponent<BreadcrumbRootProps & react.RefAttributes<HTMLElement>>;
|
|
1970
|
+
List: react.ForwardRefExoticComponent<BreadcrumbListProps & react.RefAttributes<HTMLElement>>;
|
|
1971
|
+
Item: react.ForwardRefExoticComponent<BreadcrumbItemProps & react.RefAttributes<HTMLElement>>;
|
|
1972
|
+
Link: react.ForwardRefExoticComponent<BreadcrumbLinkProps & react.RefAttributes<HTMLElement>>;
|
|
1973
|
+
Page: react.ForwardRefExoticComponent<BreadcrumbPageProps & react.RefAttributes<HTMLElement>>;
|
|
1974
|
+
Separator: react.ForwardRefExoticComponent<BreadcrumbSeparatorProps & react.RefAttributes<HTMLElement>>;
|
|
1975
|
+
};
|
|
1976
|
+
|
|
1977
|
+
interface PaginationRootProps extends HTMLAttributes<HTMLElement> {
|
|
1978
|
+
children?: ReactNode;
|
|
1979
|
+
page?: number;
|
|
1980
|
+
defaultPage?: number;
|
|
1981
|
+
totalPages?: number;
|
|
1982
|
+
onPageChange?: (page: number) => void;
|
|
1983
|
+
}
|
|
1984
|
+
interface PaginationContentProps extends HTMLAttributes<HTMLElement> {
|
|
1985
|
+
children?: ReactNode;
|
|
1986
|
+
}
|
|
1987
|
+
interface PaginationItemProps extends HTMLAttributes<HTMLElement> {
|
|
1988
|
+
children?: ReactNode;
|
|
1989
|
+
}
|
|
1990
|
+
interface PaginationLinkProps extends HTMLAttributes<HTMLElement> {
|
|
1991
|
+
children?: ReactNode;
|
|
1992
|
+
page: number;
|
|
1993
|
+
active?: boolean;
|
|
1994
|
+
}
|
|
1995
|
+
interface PaginationPreviousProps extends HTMLAttributes<HTMLElement> {
|
|
1996
|
+
children?: ReactNode;
|
|
1997
|
+
disabled?: boolean;
|
|
1998
|
+
}
|
|
1999
|
+
interface PaginationNextProps extends HTMLAttributes<HTMLElement> {
|
|
2000
|
+
children?: ReactNode;
|
|
2001
|
+
disabled?: boolean;
|
|
2002
|
+
}
|
|
2003
|
+
interface PaginationEllipsisProps extends HTMLAttributes<HTMLElement> {
|
|
2004
|
+
}
|
|
2005
|
+
declare const Pagination: {
|
|
2006
|
+
Root: react.ForwardRefExoticComponent<PaginationRootProps & react.RefAttributes<HTMLElement>>;
|
|
2007
|
+
Content: react.ForwardRefExoticComponent<PaginationContentProps & react.RefAttributes<HTMLElement>>;
|
|
2008
|
+
Item: react.ForwardRefExoticComponent<PaginationItemProps & react.RefAttributes<HTMLElement>>;
|
|
2009
|
+
Link: react.ForwardRefExoticComponent<PaginationLinkProps & react.RefAttributes<HTMLElement>>;
|
|
2010
|
+
Previous: react.ForwardRefExoticComponent<PaginationPreviousProps & react.RefAttributes<HTMLElement>>;
|
|
2011
|
+
Next: react.ForwardRefExoticComponent<PaginationNextProps & react.RefAttributes<HTMLElement>>;
|
|
2012
|
+
Ellipsis: react.ForwardRefExoticComponent<PaginationEllipsisProps & react.RefAttributes<HTMLElement>>;
|
|
2013
|
+
};
|
|
2014
|
+
|
|
2015
|
+
type StepperOrientation = "horizontal" | "vertical";
|
|
2016
|
+
interface StepperRootProps extends HTMLAttributes<HTMLElement> {
|
|
2017
|
+
children?: ReactNode;
|
|
2018
|
+
value?: number;
|
|
2019
|
+
defaultValue?: number;
|
|
2020
|
+
onStepChange?: (step: number) => void;
|
|
2021
|
+
orientation?: StepperOrientation;
|
|
2022
|
+
linear?: boolean;
|
|
2023
|
+
}
|
|
2024
|
+
interface StepperItemProps extends HTMLAttributes<HTMLElement> {
|
|
2025
|
+
children?: ReactNode;
|
|
2026
|
+
step: number;
|
|
2027
|
+
completed?: boolean;
|
|
2028
|
+
disabled?: boolean;
|
|
2029
|
+
}
|
|
2030
|
+
interface StepperTriggerProps extends HTMLAttributes<HTMLElement> {
|
|
2031
|
+
children?: ReactNode;
|
|
2032
|
+
}
|
|
2033
|
+
interface StepperIndicatorProps extends HTMLAttributes<HTMLElement> {
|
|
2034
|
+
children?: ReactNode;
|
|
2035
|
+
}
|
|
2036
|
+
interface StepperTitleProps extends HTMLAttributes<HTMLElement> {
|
|
2037
|
+
children?: ReactNode;
|
|
2038
|
+
}
|
|
2039
|
+
interface StepperDescriptionProps extends HTMLAttributes<HTMLElement> {
|
|
2040
|
+
children?: ReactNode;
|
|
2041
|
+
}
|
|
2042
|
+
interface StepperSeparatorProps extends HTMLAttributes<HTMLElement> {
|
|
2043
|
+
}
|
|
2044
|
+
interface StepperContentProps extends HTMLAttributes<HTMLElement> {
|
|
2045
|
+
children?: ReactNode;
|
|
2046
|
+
}
|
|
2047
|
+
declare const Stepper: {
|
|
2048
|
+
Root: react.ForwardRefExoticComponent<StepperRootProps & react.RefAttributes<HTMLElement>>;
|
|
2049
|
+
Item: react.ForwardRefExoticComponent<StepperItemProps & react.RefAttributes<HTMLElement>>;
|
|
2050
|
+
Trigger: react.ForwardRefExoticComponent<StepperTriggerProps & react.RefAttributes<HTMLElement>>;
|
|
2051
|
+
Indicator: react.ForwardRefExoticComponent<StepperIndicatorProps & react.RefAttributes<HTMLElement>>;
|
|
2052
|
+
Title: react.ForwardRefExoticComponent<StepperTitleProps & react.RefAttributes<HTMLElement>>;
|
|
2053
|
+
Description: react.ForwardRefExoticComponent<StepperDescriptionProps & react.RefAttributes<HTMLElement>>;
|
|
2054
|
+
Separator: react.ForwardRefExoticComponent<StepperSeparatorProps & react.RefAttributes<HTMLElement>>;
|
|
2055
|
+
Content: react.ForwardRefExoticComponent<StepperContentProps & react.RefAttributes<HTMLElement>>;
|
|
2056
|
+
};
|
|
2057
|
+
|
|
2058
|
+
interface CommandRootProps extends Omit<HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
2059
|
+
children?: ReactNode;
|
|
2060
|
+
value?: string;
|
|
2061
|
+
defaultValue?: string;
|
|
2062
|
+
onValueChange?: (value: string) => void;
|
|
2063
|
+
onSelect?: (value: string) => void;
|
|
2064
|
+
loading?: boolean;
|
|
2065
|
+
filter?: boolean;
|
|
2066
|
+
label?: string;
|
|
2067
|
+
}
|
|
2068
|
+
interface CommandInputProps extends HTMLAttributes<HTMLElement> {
|
|
2069
|
+
placeholder?: string;
|
|
2070
|
+
disabled?: boolean;
|
|
2071
|
+
value?: string;
|
|
2072
|
+
}
|
|
2073
|
+
interface CommandListProps extends HTMLAttributes<HTMLElement> {
|
|
2074
|
+
children?: ReactNode;
|
|
2075
|
+
}
|
|
2076
|
+
interface CommandItemProps extends Omit<HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
2077
|
+
children?: ReactNode;
|
|
2078
|
+
value?: string;
|
|
2079
|
+
keywords?: string;
|
|
2080
|
+
disabled?: boolean;
|
|
2081
|
+
onSelect?: (value: string) => void;
|
|
2082
|
+
}
|
|
2083
|
+
interface CommandGroupProps extends HTMLAttributes<HTMLElement> {
|
|
2084
|
+
children?: ReactNode;
|
|
2085
|
+
heading?: string;
|
|
2086
|
+
}
|
|
2087
|
+
interface CommandSeparatorProps extends HTMLAttributes<HTMLElement> {
|
|
2088
|
+
}
|
|
2089
|
+
interface CommandEmptyProps extends HTMLAttributes<HTMLElement> {
|
|
2090
|
+
children?: ReactNode;
|
|
2091
|
+
}
|
|
2092
|
+
interface CommandLoadingProps extends HTMLAttributes<HTMLElement> {
|
|
2093
|
+
children?: ReactNode;
|
|
2094
|
+
}
|
|
2095
|
+
declare const Command: {
|
|
2096
|
+
Root: react.ForwardRefExoticComponent<CommandRootProps & react.RefAttributes<HTMLElement>>;
|
|
2097
|
+
Input: react.ForwardRefExoticComponent<CommandInputProps & react.RefAttributes<HTMLElement>>;
|
|
2098
|
+
List: react.ForwardRefExoticComponent<CommandListProps & react.RefAttributes<HTMLElement>>;
|
|
2099
|
+
Item: react.ForwardRefExoticComponent<CommandItemProps & react.RefAttributes<HTMLElement>>;
|
|
2100
|
+
Group: react.ForwardRefExoticComponent<CommandGroupProps & react.RefAttributes<HTMLElement>>;
|
|
2101
|
+
Separator: react.ForwardRefExoticComponent<CommandSeparatorProps & react.RefAttributes<HTMLElement>>;
|
|
2102
|
+
Empty: react.ForwardRefExoticComponent<CommandEmptyProps & react.RefAttributes<HTMLElement>>;
|
|
2103
|
+
Loading: react.ForwardRefExoticComponent<CommandLoadingProps & react.RefAttributes<HTMLElement>>;
|
|
2104
|
+
};
|
|
2105
|
+
|
|
2106
|
+
/**
|
|
2107
|
+
* SSR-Safe ID Generation Hooks
|
|
2108
|
+
*
|
|
2109
|
+
* Provides React 18 useId()-based hooks for stable ID generation
|
|
2110
|
+
* that works correctly with SSR and hydration.
|
|
2111
|
+
*
|
|
2112
|
+
* @packageDocumentation
|
|
2113
|
+
*/
|
|
2114
|
+
/**
|
|
2115
|
+
* Options for useStableId hook
|
|
2116
|
+
*/
|
|
2117
|
+
interface UseStableIdOptions {
|
|
2118
|
+
/**
|
|
2119
|
+
* Custom ID to use instead of auto-generated one.
|
|
2120
|
+
* Useful when consumer wants to control the ID.
|
|
2121
|
+
*/
|
|
2122
|
+
id?: string;
|
|
2123
|
+
/**
|
|
2124
|
+
* Prefix for the generated ID.
|
|
2125
|
+
* @default "ds"
|
|
2126
|
+
*/
|
|
2127
|
+
prefix?: string;
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Options for useStableIds hook
|
|
2131
|
+
*/
|
|
2132
|
+
interface UseStableIdsOptions<T extends string> extends UseStableIdOptions {
|
|
2133
|
+
/**
|
|
2134
|
+
* Parts to generate related IDs for.
|
|
2135
|
+
* Each part will get an ID derived from the base ID.
|
|
2136
|
+
*/
|
|
2137
|
+
parts: readonly T[];
|
|
2138
|
+
}
|
|
2139
|
+
/**
|
|
2140
|
+
* Return type for useStableIds hook
|
|
2141
|
+
*/
|
|
2142
|
+
type StableIds<T extends string> = {
|
|
2143
|
+
/** The base ID */
|
|
2144
|
+
baseId: string;
|
|
2145
|
+
} & Record<T, string>;
|
|
2146
|
+
/**
|
|
2147
|
+
* Generate a stable, SSR-safe ID for a component.
|
|
2148
|
+
*
|
|
2149
|
+
* Uses React 18's useId() under the hood, which:
|
|
2150
|
+
* - Generates deterministic IDs that match between server and client
|
|
2151
|
+
* - Avoids hydration mismatches
|
|
2152
|
+
* - Is unique within the React tree
|
|
2153
|
+
*
|
|
2154
|
+
* @example Basic usage
|
|
2155
|
+
* ```tsx
|
|
2156
|
+
* function Dialog() {
|
|
2157
|
+
* const titleId = useStableId({ prefix: "dialog-title" });
|
|
2158
|
+
* return (
|
|
2159
|
+
* <div role="dialog" aria-labelledby={titleId}>
|
|
2160
|
+
* <h2 id={titleId}>Dialog Title</h2>
|
|
2161
|
+
* </div>
|
|
2162
|
+
* );
|
|
2163
|
+
* }
|
|
2164
|
+
* ```
|
|
2165
|
+
*
|
|
2166
|
+
* @example With custom ID override
|
|
2167
|
+
* ```tsx
|
|
2168
|
+
* function Dialog({ id }: { id?: string }) {
|
|
2169
|
+
* // Uses provided id if available, otherwise generates one
|
|
2170
|
+
* const titleId = useStableId({ id, prefix: "dialog-title" });
|
|
2171
|
+
* // ...
|
|
2172
|
+
* }
|
|
2173
|
+
* ```
|
|
2174
|
+
*/
|
|
2175
|
+
declare function useStableId(options?: UseStableIdOptions): string;
|
|
2176
|
+
/**
|
|
2177
|
+
* Generate multiple related stable IDs for a component with multiple ARIA relationships.
|
|
2178
|
+
*
|
|
2179
|
+
* Useful for components like Dialog that need IDs for title, description, and content.
|
|
2180
|
+
*
|
|
2181
|
+
* @example Dialog with multiple ARIA relationships
|
|
2182
|
+
* ```tsx
|
|
2183
|
+
* function Dialog() {
|
|
2184
|
+
* const ids = useStableIds({
|
|
2185
|
+
* prefix: "dialog",
|
|
2186
|
+
* parts: ["title", "description", "content"] as const,
|
|
2187
|
+
* });
|
|
2188
|
+
*
|
|
2189
|
+
* return (
|
|
2190
|
+
* <div
|
|
2191
|
+
* role="dialog"
|
|
2192
|
+
* aria-labelledby={ids.title}
|
|
2193
|
+
* aria-describedby={ids.description}
|
|
2194
|
+
* >
|
|
2195
|
+
* <h2 id={ids.title}>Title</h2>
|
|
2196
|
+
* <p id={ids.description}>Description</p>
|
|
2197
|
+
* <div id={ids.content}>Content</div>
|
|
2198
|
+
* </div>
|
|
2199
|
+
* );
|
|
2200
|
+
* }
|
|
2201
|
+
* ```
|
|
2202
|
+
*
|
|
2203
|
+
* @example Select with listbox and options
|
|
2204
|
+
* ```tsx
|
|
2205
|
+
* function Select() {
|
|
2206
|
+
* const ids = useStableIds({
|
|
2207
|
+
* prefix: "select",
|
|
2208
|
+
* parts: ["trigger", "listbox", "label"] as const,
|
|
2209
|
+
* });
|
|
2210
|
+
*
|
|
2211
|
+
* return (
|
|
2212
|
+
* <>
|
|
2213
|
+
* <label id={ids.label}>Choose option</label>
|
|
2214
|
+
* <button
|
|
2215
|
+
* id={ids.trigger}
|
|
2216
|
+
* aria-labelledby={ids.label}
|
|
2217
|
+
* aria-controls={ids.listbox}
|
|
2218
|
+
* >
|
|
2219
|
+
* Select...
|
|
2220
|
+
* </button>
|
|
2221
|
+
* <ul id={ids.listbox} role="listbox">
|
|
2222
|
+
* ...
|
|
2223
|
+
* </ul>
|
|
2224
|
+
* </>
|
|
2225
|
+
* );
|
|
2226
|
+
* }
|
|
2227
|
+
* ```
|
|
2228
|
+
*/
|
|
2229
|
+
declare function useStableIds<T extends string>(options: UseStableIdsOptions<T>): StableIds<T>;
|
|
2230
|
+
/**
|
|
2231
|
+
* Create a scoped ID generator function from a base ID.
|
|
2232
|
+
* Useful when you need to generate IDs dynamically within a component.
|
|
2233
|
+
*
|
|
2234
|
+
* @example Dynamic list items
|
|
2235
|
+
* ```tsx
|
|
2236
|
+
* function TreeView({ items }) {
|
|
2237
|
+
* const baseId = useStableId({ prefix: "tree" });
|
|
2238
|
+
* const scopedId = useScopedIdGenerator(baseId);
|
|
2239
|
+
*
|
|
2240
|
+
* return (
|
|
2241
|
+
* <ul role="tree" id={baseId}>
|
|
2242
|
+
* {items.map((item, index) => (
|
|
2243
|
+
* <li key={item.id} id={scopedId(`item-${index}`)}>
|
|
2244
|
+
* {item.label}
|
|
2245
|
+
* </li>
|
|
2246
|
+
* ))}
|
|
2247
|
+
* </ul>
|
|
2248
|
+
* );
|
|
2249
|
+
* }
|
|
2250
|
+
* ```
|
|
2251
|
+
*/
|
|
2252
|
+
declare function useScopedIdGenerator(baseId: string): (suffix: string) => string;
|
|
2253
|
+
/**
|
|
2254
|
+
* Hook to conditionally include an ID attribute.
|
|
2255
|
+
* Returns undefined if the ID would be empty or invalid.
|
|
2256
|
+
*
|
|
2257
|
+
* @example Conditional aria-describedby
|
|
2258
|
+
* ```tsx
|
|
2259
|
+
* function Input({ description }: { description?: string }) {
|
|
2260
|
+
* const descriptionId = useStableId({ prefix: "input-desc" });
|
|
2261
|
+
* const ariaDescribedBy = useConditionalId(description ? descriptionId : undefined);
|
|
2262
|
+
*
|
|
2263
|
+
* return (
|
|
2264
|
+
* <>
|
|
2265
|
+
* <input aria-describedby={ariaDescribedBy} />
|
|
2266
|
+
* {description && <p id={descriptionId}>{description}</p>}
|
|
2267
|
+
* </>
|
|
2268
|
+
* );
|
|
2269
|
+
* }
|
|
2270
|
+
* ```
|
|
2271
|
+
*/
|
|
2272
|
+
declare function useConditionalId(id: string | undefined): string | undefined;
|
|
2273
|
+
|
|
2274
|
+
/**
|
|
2275
|
+
* React Responsive Classes Hook
|
|
2276
|
+
*
|
|
2277
|
+
* Converts React responsive object syntax to CSS classes.
|
|
2278
|
+
* React syntax: { base: "column", md: "row" }
|
|
2279
|
+
* Output: ["ds-flow--md:dir-row"]
|
|
2280
|
+
*/
|
|
2281
|
+
/**
|
|
2282
|
+
* Breakpoint tokens for responsive values.
|
|
2283
|
+
*/
|
|
2284
|
+
type BreakpointToken$1 = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2285
|
+
/**
|
|
2286
|
+
* Responsive value type for React props.
|
|
2287
|
+
* Can be a simple value or an object with breakpoint overrides.
|
|
2288
|
+
*/
|
|
2289
|
+
type ResponsiveValue<T> = T | Partial<Record<"base" | BreakpointToken$1, T>>;
|
|
2290
|
+
|
|
2291
|
+
/**
|
|
2292
|
+
* Flow React Component
|
|
2293
|
+
*
|
|
2294
|
+
* Primary 1D layout primitive with responsive direction switching.
|
|
2295
|
+
*/
|
|
2296
|
+
|
|
2297
|
+
type FlexDirection = "row" | "column" | "row-reverse" | "column-reverse";
|
|
2298
|
+
type FlexAlign$1 = "start" | "center" | "end" | "stretch" | "baseline";
|
|
2299
|
+
type FlexJustify = "start" | "center" | "end" | "between" | "around" | "evenly";
|
|
2300
|
+
type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
2301
|
+
type SpacingToken$7 = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2302
|
+
interface FlowProps {
|
|
2303
|
+
/** Flex direction. Supports responsive object syntax. */
|
|
2304
|
+
direction?: ResponsiveValue<FlexDirection>;
|
|
2305
|
+
/** Gap between children. Supports responsive object syntax. */
|
|
2306
|
+
gap?: ResponsiveValue<SpacingToken$7>;
|
|
2307
|
+
/** Cross-axis alignment. */
|
|
2308
|
+
align?: FlexAlign$1;
|
|
2309
|
+
/** Main-axis alignment. */
|
|
2310
|
+
justify?: FlexJustify;
|
|
2311
|
+
/** Flex wrap behavior. */
|
|
2312
|
+
wrap?: FlexWrap;
|
|
2313
|
+
/** Use inline-flex instead of flex. */
|
|
2314
|
+
inline?: boolean;
|
|
2315
|
+
/** Additional CSS class names. */
|
|
2316
|
+
className?: string;
|
|
2317
|
+
/** Children elements. */
|
|
2318
|
+
children?: react__default.ReactNode;
|
|
2319
|
+
}
|
|
2320
|
+
/**
|
|
2321
|
+
* React wrapper for ds-flow Web Component.
|
|
2322
|
+
*/
|
|
2323
|
+
declare const Flow: react__default.ForwardRefExoticComponent<FlowProps & react__default.RefAttributes<HTMLElement>>;
|
|
2324
|
+
|
|
2325
|
+
/**
|
|
2326
|
+
* Container React Component
|
|
2327
|
+
*
|
|
2328
|
+
* Constrains content width with responsive max-widths and padding.
|
|
2329
|
+
*/
|
|
2330
|
+
|
|
2331
|
+
type ContainerSizeToken$1 = "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
2332
|
+
type SpacingToken$6 = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2333
|
+
interface ContainerProps {
|
|
2334
|
+
/** Maximum width constraint. */
|
|
2335
|
+
size?: ContainerSizeToken$1;
|
|
2336
|
+
/** Horizontal padding. */
|
|
2337
|
+
padding?: SpacingToken$6;
|
|
2338
|
+
/** Additional CSS class names. */
|
|
2339
|
+
className?: string;
|
|
2340
|
+
/** Children elements. */
|
|
2341
|
+
children?: react__default.ReactNode;
|
|
2342
|
+
}
|
|
2343
|
+
/**
|
|
2344
|
+
* React wrapper for ds-container Web Component.
|
|
2345
|
+
*/
|
|
2346
|
+
declare const Container: react__default.ForwardRefExoticComponent<ContainerProps & react__default.RefAttributes<HTMLElement>>;
|
|
2347
|
+
|
|
2348
|
+
/**
|
|
2349
|
+
* Grid React Component
|
|
2350
|
+
*
|
|
2351
|
+
* 2D grid layout with responsive columns.
|
|
2352
|
+
*/
|
|
2353
|
+
|
|
2354
|
+
type GridColumns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "auto-fit" | "auto-fill";
|
|
2355
|
+
type SpacingToken$5 = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2356
|
+
interface GridProps {
|
|
2357
|
+
/** Number of columns. Supports responsive object syntax. */
|
|
2358
|
+
columns?: ResponsiveValue<GridColumns>;
|
|
2359
|
+
/** Gap between grid items. Supports responsive object syntax. */
|
|
2360
|
+
gap?: ResponsiveValue<SpacingToken$5>;
|
|
2361
|
+
/** Row gap override. */
|
|
2362
|
+
rowGap?: SpacingToken$5;
|
|
2363
|
+
/** Column gap override. */
|
|
2364
|
+
columnGap?: SpacingToken$5;
|
|
2365
|
+
/** Additional CSS class names. */
|
|
2366
|
+
className?: string;
|
|
2367
|
+
/** Children elements. */
|
|
2368
|
+
children?: react__default.ReactNode;
|
|
2369
|
+
}
|
|
2370
|
+
/**
|
|
2371
|
+
* React wrapper for ds-grid Web Component.
|
|
2372
|
+
*/
|
|
2373
|
+
declare const Grid: react__default.ForwardRefExoticComponent<GridProps & react__default.RefAttributes<HTMLElement>>;
|
|
2374
|
+
|
|
2375
|
+
/**
|
|
2376
|
+
* Box React Component
|
|
2377
|
+
*
|
|
2378
|
+
* Token-only styling escape hatch for padding, background, and radius.
|
|
2379
|
+
*/
|
|
2380
|
+
|
|
2381
|
+
type SpacingToken$4 = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2382
|
+
type SurfaceToken$1 = "background" | "surface" | "surface-raised" | "surface-sunken" | "muted";
|
|
2383
|
+
type RadiusToken = "none" | "sm" | "md" | "lg" | "xl" | "full";
|
|
2384
|
+
interface BoxProps {
|
|
2385
|
+
/** Padding (all sides). */
|
|
2386
|
+
p?: SpacingToken$4;
|
|
2387
|
+
/** Horizontal padding. */
|
|
2388
|
+
px?: SpacingToken$4;
|
|
2389
|
+
/** Vertical padding. */
|
|
2390
|
+
py?: SpacingToken$4;
|
|
2391
|
+
/** Background color token. */
|
|
2392
|
+
bg?: SurfaceToken$1;
|
|
2393
|
+
/** Border radius token. */
|
|
2394
|
+
radius?: RadiusToken;
|
|
2395
|
+
/** Additional CSS class names. */
|
|
2396
|
+
className?: string;
|
|
2397
|
+
/** Children elements. */
|
|
2398
|
+
children?: react__default.ReactNode;
|
|
2399
|
+
}
|
|
2400
|
+
/**
|
|
2401
|
+
* React wrapper for ds-box Web Component.
|
|
2402
|
+
*/
|
|
2403
|
+
declare const Box: react__default.ForwardRefExoticComponent<BoxProps & react__default.RefAttributes<HTMLElement>>;
|
|
2404
|
+
|
|
2405
|
+
/**
|
|
2406
|
+
* Page React Component
|
|
2407
|
+
*
|
|
2408
|
+
* Page wrapper with min-height and background.
|
|
2409
|
+
*/
|
|
2410
|
+
|
|
2411
|
+
type SurfaceToken = "background" | "surface" | "surface-raised" | "surface-sunken" | "muted";
|
|
2412
|
+
type MinHeightValue = "viewport" | "full";
|
|
2413
|
+
interface PageProps {
|
|
2414
|
+
/** Background color token. */
|
|
2415
|
+
bg?: SurfaceToken;
|
|
2416
|
+
/** Minimum height. */
|
|
2417
|
+
minHeight?: MinHeightValue;
|
|
2418
|
+
/** Additional CSS class names. */
|
|
2419
|
+
className?: string;
|
|
2420
|
+
/** Children elements. */
|
|
2421
|
+
children?: react__default.ReactNode;
|
|
2422
|
+
}
|
|
2423
|
+
/**
|
|
2424
|
+
* React wrapper for ds-page Web Component.
|
|
2425
|
+
*/
|
|
2426
|
+
declare const Page: react__default.ForwardRefExoticComponent<PageProps & react__default.RefAttributes<HTMLElement>>;
|
|
2427
|
+
|
|
2428
|
+
/**
|
|
2429
|
+
* Section React Component
|
|
2430
|
+
*
|
|
2431
|
+
* Semantic section wrapper with consistent vertical spacing.
|
|
2432
|
+
*/
|
|
2433
|
+
|
|
2434
|
+
type SpacingToken$3 = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2435
|
+
interface SectionProps {
|
|
2436
|
+
/** Vertical padding. */
|
|
2437
|
+
spacing?: SpacingToken$3;
|
|
2438
|
+
/** Additional CSS class names. */
|
|
2439
|
+
className?: string;
|
|
2440
|
+
/** Children elements. */
|
|
2441
|
+
children?: react__default.ReactNode;
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* React wrapper for ds-section Web Component.
|
|
2445
|
+
*/
|
|
2446
|
+
declare const Section: react__default.ForwardRefExoticComponent<SectionProps & react__default.RefAttributes<HTMLElement>>;
|
|
2447
|
+
|
|
2448
|
+
/**
|
|
2449
|
+
* AppShell React Component
|
|
2450
|
+
*
|
|
2451
|
+
* Application structure with compound component pattern.
|
|
2452
|
+
*/
|
|
2453
|
+
|
|
2454
|
+
type SidebarPosition = "left" | "right" | "none";
|
|
2455
|
+
interface AppShellProps {
|
|
2456
|
+
/** Sidebar position. */
|
|
2457
|
+
sidebarPosition?: SidebarPosition;
|
|
2458
|
+
/** Additional CSS class names. */
|
|
2459
|
+
className?: string;
|
|
2460
|
+
/** Children elements. */
|
|
2461
|
+
children?: react__default.ReactNode;
|
|
2462
|
+
}
|
|
2463
|
+
interface HeaderProps {
|
|
2464
|
+
/** Enable sticky positioning. */
|
|
2465
|
+
sticky?: boolean;
|
|
2466
|
+
/** Enable safe area insets. */
|
|
2467
|
+
safeArea?: boolean;
|
|
2468
|
+
/** Additional CSS class names. */
|
|
2469
|
+
className?: string;
|
|
2470
|
+
/** Children elements. */
|
|
2471
|
+
children?: react__default.ReactNode;
|
|
2472
|
+
}
|
|
2473
|
+
interface FooterProps {
|
|
2474
|
+
/** Enable sticky positioning. */
|
|
2475
|
+
sticky?: boolean;
|
|
2476
|
+
/** Enable safe area insets. */
|
|
2477
|
+
safeArea?: boolean;
|
|
2478
|
+
/** Additional CSS class names. */
|
|
2479
|
+
className?: string;
|
|
2480
|
+
/** Children elements. */
|
|
2481
|
+
children?: react__default.ReactNode;
|
|
2482
|
+
}
|
|
2483
|
+
interface MainProps {
|
|
2484
|
+
/** Element ID for skip-link targeting. */
|
|
2485
|
+
id?: string;
|
|
2486
|
+
/** Additional CSS class names. */
|
|
2487
|
+
className?: string;
|
|
2488
|
+
/** Children elements. */
|
|
2489
|
+
children?: react__default.ReactNode;
|
|
2490
|
+
}
|
|
2491
|
+
interface SidebarProps {
|
|
2492
|
+
/** Additional CSS class names. */
|
|
2493
|
+
className?: string;
|
|
2494
|
+
/** Children elements. */
|
|
2495
|
+
children?: react__default.ReactNode;
|
|
2496
|
+
}
|
|
2497
|
+
declare const AppShell: react__default.ForwardRefExoticComponent<AppShellProps & react__default.RefAttributes<HTMLElement>> & {
|
|
2498
|
+
Header: react__default.ForwardRefExoticComponent<HeaderProps & react__default.RefAttributes<HTMLElement>>;
|
|
2499
|
+
Footer: react__default.ForwardRefExoticComponent<FooterProps & react__default.RefAttributes<HTMLElement>>;
|
|
2500
|
+
Main: react__default.ForwardRefExoticComponent<MainProps & react__default.RefAttributes<HTMLElement>>;
|
|
2501
|
+
Sidebar: react__default.ForwardRefExoticComponent<SidebarProps & react__default.RefAttributes<HTMLElement>>;
|
|
2502
|
+
};
|
|
2503
|
+
|
|
2504
|
+
type SpacingToken$2 = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2505
|
+
type SpacerAxis = "horizontal" | "vertical";
|
|
2506
|
+
interface SpacerProps {
|
|
2507
|
+
/** Size of the space. */
|
|
2508
|
+
size?: SpacingToken$2;
|
|
2509
|
+
/** Axis direction. */
|
|
2510
|
+
axis?: SpacerAxis;
|
|
2511
|
+
/** Additional CSS class names. */
|
|
2512
|
+
className?: string;
|
|
2513
|
+
}
|
|
2514
|
+
/**
|
|
2515
|
+
* React wrapper for ds-spacer Web Component.
|
|
2516
|
+
*/
|
|
2517
|
+
declare const Spacer: react.ForwardRefExoticComponent<SpacerProps & react.RefAttributes<HTMLElement>>;
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* Center React Component
|
|
2521
|
+
*
|
|
2522
|
+
* Centers content horizontally/vertically with optional max-width.
|
|
2523
|
+
*/
|
|
2524
|
+
|
|
2525
|
+
type ContainerSizeToken = "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
2526
|
+
interface CenterProps {
|
|
2527
|
+
/** Maximum width constraint. */
|
|
2528
|
+
maxWidth?: ContainerSizeToken;
|
|
2529
|
+
/** Enable vertical centering. */
|
|
2530
|
+
vertical?: boolean;
|
|
2531
|
+
/** Additional CSS class names. */
|
|
2532
|
+
className?: string;
|
|
2533
|
+
/** Children elements. */
|
|
2534
|
+
children?: react__default.ReactNode;
|
|
2535
|
+
}
|
|
2536
|
+
/**
|
|
2537
|
+
* React wrapper for ds-center Web Component.
|
|
2538
|
+
*/
|
|
2539
|
+
declare const Center: react__default.ForwardRefExoticComponent<CenterProps & react__default.RefAttributes<HTMLElement>>;
|
|
2540
|
+
|
|
2541
|
+
/**
|
|
2542
|
+
* Split React Component
|
|
2543
|
+
*
|
|
2544
|
+
* Two-region layout with collapse breakpoint.
|
|
2545
|
+
*/
|
|
2546
|
+
|
|
2547
|
+
type BreakpointToken = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2548
|
+
type SpacingToken$1 = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2549
|
+
type SplitRatio = "equal" | "1:2" | "2:1" | "1:3" | "3:1";
|
|
2550
|
+
interface SplitProps {
|
|
2551
|
+
/** Breakpoint at which to collapse to single column. */
|
|
2552
|
+
collapseAt?: BreakpointToken;
|
|
2553
|
+
/** Gap between regions. */
|
|
2554
|
+
gap?: SpacingToken$1;
|
|
2555
|
+
/** Width ratio between regions. */
|
|
2556
|
+
ratio?: SplitRatio;
|
|
2557
|
+
/** Additional CSS class names. */
|
|
2558
|
+
className?: string;
|
|
2559
|
+
/** Children elements (should be exactly 2). */
|
|
2560
|
+
children?: react__default.ReactNode;
|
|
2561
|
+
}
|
|
2562
|
+
/**
|
|
2563
|
+
* React wrapper for ds-split Web Component.
|
|
2564
|
+
*/
|
|
2565
|
+
declare const Split: react__default.ForwardRefExoticComponent<SplitProps & react__default.RefAttributes<HTMLElement>>;
|
|
2566
|
+
|
|
2567
|
+
/**
|
|
2568
|
+
* Wrap React Component
|
|
2569
|
+
*
|
|
2570
|
+
* Wrapping row layout for tags/chips.
|
|
2571
|
+
*/
|
|
2572
|
+
|
|
2573
|
+
type SpacingToken = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
2574
|
+
type FlexAlign = "start" | "center" | "end";
|
|
2575
|
+
interface WrapProps {
|
|
2576
|
+
/** Gap between items. */
|
|
2577
|
+
gap?: SpacingToken;
|
|
2578
|
+
/** Row gap override. */
|
|
2579
|
+
rowGap?: SpacingToken;
|
|
2580
|
+
/** Cross-axis alignment. */
|
|
2581
|
+
align?: FlexAlign;
|
|
2582
|
+
/** Additional CSS class names. */
|
|
2583
|
+
className?: string;
|
|
2584
|
+
/** Children elements. */
|
|
2585
|
+
children?: react__default.ReactNode;
|
|
2586
|
+
}
|
|
2587
|
+
/**
|
|
2588
|
+
* React wrapper for ds-wrap Web Component.
|
|
2589
|
+
*/
|
|
2590
|
+
declare const Wrap: react__default.ForwardRefExoticComponent<WrapProps & react__default.RefAttributes<HTMLElement>>;
|
|
2591
|
+
|
|
2592
|
+
interface StackProps extends Omit<FlowProps, "direction"> {
|
|
2593
|
+
/** Gap between children. Supports responsive object syntax. */
|
|
2594
|
+
gap?: FlowProps["gap"];
|
|
2595
|
+
}
|
|
2596
|
+
/**
|
|
2597
|
+
* Stack is a Flow with direction="column".
|
|
2598
|
+
*/
|
|
2599
|
+
declare const Stack: react.ForwardRefExoticComponent<StackProps & react.RefAttributes<HTMLElement>>;
|
|
2600
|
+
|
|
2601
|
+
interface InlineProps extends Omit<FlowProps, "direction"> {
|
|
2602
|
+
/** Gap between children. Supports responsive object syntax. */
|
|
2603
|
+
gap?: FlowProps["gap"];
|
|
2604
|
+
}
|
|
2605
|
+
/**
|
|
2606
|
+
* Inline is a Flow with direction="row".
|
|
2607
|
+
*/
|
|
2608
|
+
declare const Inline: react.ForwardRefExoticComponent<InlineProps & react.RefAttributes<HTMLElement>>;
|
|
2609
|
+
|
|
2610
|
+
/**
|
|
2611
|
+
* Theme System Types
|
|
2612
|
+
*
|
|
2613
|
+
* Type definitions for the theme and density system.
|
|
2614
|
+
*
|
|
2615
|
+
* @packageDocumentation
|
|
2616
|
+
*/
|
|
2617
|
+
/**
|
|
2618
|
+
* Color mode (light or dark theme)
|
|
2619
|
+
*/
|
|
2620
|
+
type ColorMode = "light" | "dark" | "system";
|
|
2621
|
+
/**
|
|
2622
|
+
* Resolved color mode (excludes "system")
|
|
2623
|
+
*/
|
|
2624
|
+
type ResolvedColorMode = "light" | "dark";
|
|
2625
|
+
/**
|
|
2626
|
+
* Density mode for component sizing
|
|
2627
|
+
*/
|
|
2628
|
+
type Density = "compact" | "default" | "spacious";
|
|
2629
|
+
/**
|
|
2630
|
+
* Theme configuration
|
|
2631
|
+
*/
|
|
2632
|
+
interface ThemeConfig {
|
|
2633
|
+
/** Color mode preference */
|
|
2634
|
+
colorMode: ColorMode;
|
|
2635
|
+
/** Density preference */
|
|
2636
|
+
density: Density;
|
|
2637
|
+
}
|
|
2638
|
+
/**
|
|
2639
|
+
* Theme context value
|
|
2640
|
+
*/
|
|
2641
|
+
interface ThemeContextValue {
|
|
2642
|
+
/** Current color mode setting (may be "system") */
|
|
2643
|
+
colorMode: ColorMode;
|
|
2644
|
+
/** Resolved color mode (never "system") */
|
|
2645
|
+
resolvedColorMode: ResolvedColorMode;
|
|
2646
|
+
/** Current density setting */
|
|
2647
|
+
density: Density;
|
|
2648
|
+
/** Set the color mode */
|
|
2649
|
+
setColorMode: (mode: ColorMode) => void;
|
|
2650
|
+
/** Set the density */
|
|
2651
|
+
setDensity: (density: Density) => void;
|
|
2652
|
+
/** Toggle between light and dark (ignores system) */
|
|
2653
|
+
toggleColorMode: () => void;
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* Density context value (subset of theme for density-only use)
|
|
2657
|
+
*/
|
|
2658
|
+
interface DensityContextValue {
|
|
2659
|
+
/** Current density setting */
|
|
2660
|
+
density: Density;
|
|
2661
|
+
/** Set the density */
|
|
2662
|
+
setDensity: (density: Density) => void;
|
|
2663
|
+
}
|
|
2664
|
+
/**
|
|
2665
|
+
* Storage key configuration
|
|
2666
|
+
*/
|
|
2667
|
+
interface StorageKeys {
|
|
2668
|
+
/** Key for color mode storage */
|
|
2669
|
+
colorMode: string;
|
|
2670
|
+
/** Key for density storage */
|
|
2671
|
+
density: string;
|
|
2672
|
+
}
|
|
2673
|
+
/**
|
|
2674
|
+
* Default storage keys
|
|
2675
|
+
*/
|
|
2676
|
+
declare const DEFAULT_STORAGE_KEYS: StorageKeys;
|
|
2677
|
+
/**
|
|
2678
|
+
* Default theme configuration
|
|
2679
|
+
*/
|
|
2680
|
+
declare const DEFAULT_THEME: ThemeConfig;
|
|
2681
|
+
/**
|
|
2682
|
+
* CSS attribute names for theme
|
|
2683
|
+
*/
|
|
2684
|
+
declare const THEME_ATTRIBUTES: {
|
|
2685
|
+
readonly colorMode: "data-theme";
|
|
2686
|
+
readonly density: "data-density";
|
|
2687
|
+
};
|
|
2688
|
+
|
|
2689
|
+
/**
|
|
2690
|
+
* Theme Provider
|
|
2691
|
+
*
|
|
2692
|
+
* React context provider for theme and density settings.
|
|
2693
|
+
*
|
|
2694
|
+
* @packageDocumentation
|
|
2695
|
+
*/
|
|
2696
|
+
|
|
2697
|
+
/**
|
|
2698
|
+
* Props for ThemeProvider
|
|
2699
|
+
*/
|
|
2700
|
+
interface ThemeProviderProps {
|
|
2701
|
+
/** Child components */
|
|
2702
|
+
children: ReactNode;
|
|
2703
|
+
/** Default color mode */
|
|
2704
|
+
defaultColorMode?: ColorMode;
|
|
2705
|
+
/** Default density */
|
|
2706
|
+
defaultDensity?: Density;
|
|
2707
|
+
/** Storage keys for persistence */
|
|
2708
|
+
storageKeys?: StorageKeys;
|
|
2709
|
+
/** Whether to sync theme to DOM attributes (default: true) */
|
|
2710
|
+
syncToDOM?: boolean;
|
|
2711
|
+
/** Custom attribute names */
|
|
2712
|
+
attributes?: {
|
|
2713
|
+
colorMode?: string;
|
|
2714
|
+
density?: string;
|
|
2715
|
+
};
|
|
2716
|
+
/** Forced color mode (disables user preference) */
|
|
2717
|
+
forcedColorMode?: ColorMode;
|
|
2718
|
+
/** Forced density (disables user preference) */
|
|
2719
|
+
forcedDensity?: Density;
|
|
2720
|
+
}
|
|
2721
|
+
/**
|
|
2722
|
+
* Theme Provider Component
|
|
2723
|
+
*
|
|
2724
|
+
* Provides theme context to the component tree. Handles:
|
|
2725
|
+
* - Color mode (light/dark/system)
|
|
2726
|
+
* - Density (compact/default/spacious)
|
|
2727
|
+
* - Persistence to localStorage/cookies
|
|
2728
|
+
* - System color mode detection
|
|
2729
|
+
* - DOM attribute synchronization
|
|
2730
|
+
*
|
|
2731
|
+
* @example
|
|
2732
|
+
* ```tsx
|
|
2733
|
+
* // Basic usage
|
|
2734
|
+
* function App() {
|
|
2735
|
+
* return (
|
|
2736
|
+
* <ThemeProvider>
|
|
2737
|
+
* <MyApp />
|
|
2738
|
+
* </ThemeProvider>
|
|
2739
|
+
* );
|
|
2740
|
+
* }
|
|
2741
|
+
*
|
|
2742
|
+
* // With custom defaults
|
|
2743
|
+
* function App() {
|
|
2744
|
+
* return (
|
|
2745
|
+
* <ThemeProvider
|
|
2746
|
+
* defaultColorMode="dark"
|
|
2747
|
+
* defaultDensity="compact"
|
|
2748
|
+
* >
|
|
2749
|
+
* <MyApp />
|
|
2750
|
+
* </ThemeProvider>
|
|
2751
|
+
* );
|
|
2752
|
+
* }
|
|
2753
|
+
*
|
|
2754
|
+
* // In Next.js App Router
|
|
2755
|
+
* // app/layout.tsx
|
|
2756
|
+
* import { ThemeProvider, getThemeScriptProps } from '@hypoth-ui/react/theme';
|
|
2757
|
+
*
|
|
2758
|
+
* export default function RootLayout({ children }) {
|
|
2759
|
+
* return (
|
|
2760
|
+
* <html>
|
|
2761
|
+
* <head>
|
|
2762
|
+
* <script {...getThemeScriptProps()} />
|
|
2763
|
+
* </head>
|
|
2764
|
+
* <body>
|
|
2765
|
+
* <ThemeProvider>{children}</ThemeProvider>
|
|
2766
|
+
* </body>
|
|
2767
|
+
* </html>
|
|
2768
|
+
* );
|
|
2769
|
+
* }
|
|
2770
|
+
* ```
|
|
2771
|
+
*/
|
|
2772
|
+
declare function ThemeProvider({ children, defaultColorMode, defaultDensity, storageKeys, syncToDOM, attributes, forcedColorMode, forcedDensity, }: ThemeProviderProps): JSX.Element;
|
|
2773
|
+
declare namespace ThemeProvider {
|
|
2774
|
+
var displayName: string;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
/**
|
|
2778
|
+
* Density Provider
|
|
2779
|
+
*
|
|
2780
|
+
* Lightweight provider for density-only contexts.
|
|
2781
|
+
* Use this when you only need density control without color mode.
|
|
2782
|
+
*
|
|
2783
|
+
* @packageDocumentation
|
|
2784
|
+
*/
|
|
2785
|
+
|
|
2786
|
+
/**
|
|
2787
|
+
* Props for DensityProvider
|
|
2788
|
+
*/
|
|
2789
|
+
interface DensityProviderProps {
|
|
2790
|
+
/** Child components */
|
|
2791
|
+
children: ReactNode;
|
|
2792
|
+
/** Default density */
|
|
2793
|
+
defaultDensity?: Density;
|
|
2794
|
+
/** Storage keys for persistence */
|
|
2795
|
+
storageKeys?: StorageKeys;
|
|
2796
|
+
/** Whether to sync density to DOM attributes (default: true) */
|
|
2797
|
+
syncToDOM?: boolean;
|
|
2798
|
+
/** Custom attribute name for density */
|
|
2799
|
+
attribute?: string;
|
|
2800
|
+
/** Forced density value (disables user preference) */
|
|
2801
|
+
forcedDensity?: Density;
|
|
2802
|
+
}
|
|
2803
|
+
/**
|
|
2804
|
+
* Density Provider Component
|
|
2805
|
+
*
|
|
2806
|
+
* Provides density context to the component tree without color mode support.
|
|
2807
|
+
* Use this for sections that need independent density control.
|
|
2808
|
+
*
|
|
2809
|
+
* @example
|
|
2810
|
+
* ```tsx
|
|
2811
|
+
* // Make a data table section more compact
|
|
2812
|
+
* function DataSection() {
|
|
2813
|
+
* return (
|
|
2814
|
+
* <DensityProvider defaultDensity="compact">
|
|
2815
|
+
* <DataTable data={data} />
|
|
2816
|
+
* </DensityProvider>
|
|
2817
|
+
* );
|
|
2818
|
+
* }
|
|
2819
|
+
*
|
|
2820
|
+
* // Force compact density for a specific area
|
|
2821
|
+
* function SidePanel() {
|
|
2822
|
+
* return (
|
|
2823
|
+
* <DensityProvider forcedDensity="compact">
|
|
2824
|
+
* <Navigation />
|
|
2825
|
+
* <FilterControls />
|
|
2826
|
+
* </DensityProvider>
|
|
2827
|
+
* );
|
|
2828
|
+
* }
|
|
2829
|
+
* ```
|
|
2830
|
+
*/
|
|
2831
|
+
declare function DensityProvider({ children, defaultDensity, storageKeys, syncToDOM, attribute, forcedDensity, }: DensityProviderProps): JSX.Element;
|
|
2832
|
+
declare namespace DensityProvider {
|
|
2833
|
+
var displayName: string;
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* Hook to access density context from DensityProvider
|
|
2837
|
+
*
|
|
2838
|
+
* @throws Error if used outside of DensityProvider or ThemeProvider
|
|
2839
|
+
*
|
|
2840
|
+
* @example
|
|
2841
|
+
* ```tsx
|
|
2842
|
+
* function CompactToggle() {
|
|
2843
|
+
* const { density, setDensity } = useDensityContext();
|
|
2844
|
+
*
|
|
2845
|
+
* return (
|
|
2846
|
+
* <button onClick={() => setDensity(density === 'compact' ? 'default' : 'compact')}>
|
|
2847
|
+
* Toggle Compact Mode
|
|
2848
|
+
* </button>
|
|
2849
|
+
* );
|
|
2850
|
+
* }
|
|
2851
|
+
* ```
|
|
2852
|
+
*/
|
|
2853
|
+
declare function useDensityContext(): DensityContextValue;
|
|
2854
|
+
|
|
2855
|
+
/**
|
|
2856
|
+
* Hook to access theme context
|
|
2857
|
+
*
|
|
2858
|
+
* @throws Error if used outside of ThemeProvider
|
|
2859
|
+
*
|
|
2860
|
+
* @example
|
|
2861
|
+
* ```tsx
|
|
2862
|
+
* function MyComponent() {
|
|
2863
|
+
* const { colorMode, setColorMode, density, setDensity } = useTheme();
|
|
2864
|
+
*
|
|
2865
|
+
* return (
|
|
2866
|
+
* <div>
|
|
2867
|
+
* <p>Current mode: {colorMode}</p>
|
|
2868
|
+
* <button onClick={() => setColorMode('dark')}>Dark</button>
|
|
2869
|
+
* <button onClick={() => setDensity('compact')}>Compact</button>
|
|
2870
|
+
* </div>
|
|
2871
|
+
* );
|
|
2872
|
+
* }
|
|
2873
|
+
* ```
|
|
2874
|
+
*/
|
|
2875
|
+
declare function useTheme(): ThemeContextValue;
|
|
2876
|
+
/**
|
|
2877
|
+
* Options for useThemeState hook
|
|
2878
|
+
*/
|
|
2879
|
+
interface UseThemeStateOptions {
|
|
2880
|
+
/** Default color mode */
|
|
2881
|
+
defaultColorMode?: ColorMode;
|
|
2882
|
+
/** Default density */
|
|
2883
|
+
defaultDensity?: Density;
|
|
2884
|
+
/** Storage keys */
|
|
2885
|
+
storageKeys?: StorageKeys;
|
|
2886
|
+
/** Whether to sync to DOM attributes */
|
|
2887
|
+
syncToDOM?: boolean;
|
|
2888
|
+
/** Attribute names for DOM sync */
|
|
2889
|
+
attributes?: {
|
|
2890
|
+
colorMode?: string;
|
|
2891
|
+
density?: string;
|
|
2892
|
+
};
|
|
2893
|
+
}
|
|
2894
|
+
/**
|
|
2895
|
+
* Low-level hook for managing theme state
|
|
2896
|
+
*
|
|
2897
|
+
* This hook manages the theme state internally and can be used
|
|
2898
|
+
* to build custom ThemeProvider implementations.
|
|
2899
|
+
*
|
|
2900
|
+
* @example
|
|
2901
|
+
* ```tsx
|
|
2902
|
+
* function CustomThemeProvider({ children }) {
|
|
2903
|
+
* const themeState = useThemeState({
|
|
2904
|
+
* defaultColorMode: 'system',
|
|
2905
|
+
* defaultDensity: 'default',
|
|
2906
|
+
* });
|
|
2907
|
+
*
|
|
2908
|
+
* return (
|
|
2909
|
+
* <ThemeContext.Provider value={themeState}>
|
|
2910
|
+
* {children}
|
|
2911
|
+
* </ThemeContext.Provider>
|
|
2912
|
+
* );
|
|
2913
|
+
* }
|
|
2914
|
+
* ```
|
|
2915
|
+
*/
|
|
2916
|
+
declare function useThemeState(options?: UseThemeStateOptions): ThemeContextValue;
|
|
2917
|
+
/**
|
|
2918
|
+
* Hook to get only the resolved color mode
|
|
2919
|
+
*
|
|
2920
|
+
* @example
|
|
2921
|
+
* ```tsx
|
|
2922
|
+
* function ThemedIcon() {
|
|
2923
|
+
* const colorMode = useColorMode();
|
|
2924
|
+
* return <Icon name={colorMode === 'dark' ? 'moon' : 'sun'} />;
|
|
2925
|
+
* }
|
|
2926
|
+
* ```
|
|
2927
|
+
*/
|
|
2928
|
+
declare function useColorMode(): ResolvedColorMode;
|
|
2929
|
+
/**
|
|
2930
|
+
* Hook to get only the density setting
|
|
2931
|
+
*
|
|
2932
|
+
* @example
|
|
2933
|
+
* ```tsx
|
|
2934
|
+
* function DenseTable() {
|
|
2935
|
+
* const density = useDensity();
|
|
2936
|
+
* return <Table compact={density === 'compact'} />;
|
|
2937
|
+
* }
|
|
2938
|
+
* ```
|
|
2939
|
+
*/
|
|
2940
|
+
declare function useDensity(): Density;
|
|
2941
|
+
|
|
2942
|
+
/**
|
|
2943
|
+
* Theme Storage Utilities
|
|
2944
|
+
*
|
|
2945
|
+
* Persistence utilities for theme preferences using localStorage and cookies.
|
|
2946
|
+
* Supports both client-side storage and SSR-safe cookie parsing.
|
|
2947
|
+
*
|
|
2948
|
+
* @packageDocumentation
|
|
2949
|
+
*/
|
|
2950
|
+
|
|
2951
|
+
/**
|
|
2952
|
+
* Parse theme from cookie string (for SSR)
|
|
2953
|
+
*
|
|
2954
|
+
* @param cookieString - The cookie header string from the request
|
|
2955
|
+
* @param keys - Storage keys to look for
|
|
2956
|
+
* @returns Parsed theme configuration
|
|
2957
|
+
*
|
|
2958
|
+
* @example
|
|
2959
|
+
* ```ts
|
|
2960
|
+
* // In Next.js App Router
|
|
2961
|
+
* import { cookies } from 'next/headers';
|
|
2962
|
+
*
|
|
2963
|
+
* export default function Layout({ children }) {
|
|
2964
|
+
* const cookieStore = cookies();
|
|
2965
|
+
* const theme = parseThemeCookie(cookieStore.toString());
|
|
2966
|
+
* return (
|
|
2967
|
+
* <html data-theme={theme.colorMode} data-density={theme.density}>
|
|
2968
|
+
* ...
|
|
2969
|
+
* </html>
|
|
2970
|
+
* );
|
|
2971
|
+
* }
|
|
2972
|
+
* ```
|
|
2973
|
+
*/
|
|
2974
|
+
declare function parseThemeCookie(cookieString: string, keys?: StorageKeys): ThemeConfig;
|
|
2975
|
+
/**
|
|
2976
|
+
* Sync theme to both localStorage and cookies
|
|
2977
|
+
* This ensures SSR can read the theme from cookies while
|
|
2978
|
+
* client-side code can use localStorage for faster access.
|
|
2979
|
+
*/
|
|
2980
|
+
declare function syncThemeStorage(theme: Partial<ThemeConfig>, keys?: StorageKeys): void;
|
|
2981
|
+
/**
|
|
2982
|
+
* Get the system color mode preference
|
|
2983
|
+
*/
|
|
2984
|
+
declare function getSystemColorMode(): ResolvedColorMode;
|
|
2985
|
+
|
|
2986
|
+
/**
|
|
2987
|
+
* Theme Script Utilities
|
|
2988
|
+
*
|
|
2989
|
+
* Generates inline scripts to prevent flash of unstyled content (FOUC)
|
|
2990
|
+
* when using theme preferences stored in localStorage/cookies.
|
|
2991
|
+
*
|
|
2992
|
+
* @packageDocumentation
|
|
2993
|
+
*/
|
|
2994
|
+
|
|
2995
|
+
/**
|
|
2996
|
+
* Options for the theme script
|
|
2997
|
+
*/
|
|
2998
|
+
interface ThemeScriptOptions {
|
|
2999
|
+
/** Storage keys for theme values */
|
|
3000
|
+
storageKeys?: StorageKeys;
|
|
3001
|
+
/** Default color mode if none stored */
|
|
3002
|
+
defaultColorMode?: "light" | "dark" | "system";
|
|
3003
|
+
/** Default density if none stored */
|
|
3004
|
+
defaultDensity?: "compact" | "default" | "spacious";
|
|
3005
|
+
/** Attribute names for theme */
|
|
3006
|
+
attributes?: {
|
|
3007
|
+
colorMode?: string;
|
|
3008
|
+
density?: string;
|
|
3009
|
+
};
|
|
3010
|
+
/** Enable cookie fallback for SSR */
|
|
3011
|
+
useCookies?: boolean;
|
|
3012
|
+
}
|
|
3013
|
+
/**
|
|
3014
|
+
* Generate the theme initialization script content
|
|
3015
|
+
*
|
|
3016
|
+
* This script runs synchronously before React hydrates, preventing FOUC.
|
|
3017
|
+
* It reads from localStorage (and optionally cookies) and sets data attributes.
|
|
3018
|
+
*/
|
|
3019
|
+
declare function getThemeScriptContent(options?: ThemeScriptOptions): string;
|
|
3020
|
+
/**
|
|
3021
|
+
* Generate a script element string for inclusion in HTML head
|
|
3022
|
+
*
|
|
3023
|
+
* @example
|
|
3024
|
+
* ```tsx
|
|
3025
|
+
* // In Next.js App Router layout.tsx
|
|
3026
|
+
* import { getThemeScriptTag } from '@hypoth-ui/react/theme';
|
|
3027
|
+
*
|
|
3028
|
+
* export default function RootLayout({ children }) {
|
|
3029
|
+
* return (
|
|
3030
|
+
* <html>
|
|
3031
|
+
* <head>
|
|
3032
|
+
* <script dangerouslySetInnerHTML={{ __html: getThemeScriptTag() }} />
|
|
3033
|
+
* </head>
|
|
3034
|
+
* <body>{children}</body>
|
|
3035
|
+
* </html>
|
|
3036
|
+
* );
|
|
3037
|
+
* }
|
|
3038
|
+
* ```
|
|
3039
|
+
*/
|
|
3040
|
+
declare function getThemeScriptTag(options?: ThemeScriptOptions): string;
|
|
3041
|
+
/**
|
|
3042
|
+
* React component props for ThemeScript
|
|
3043
|
+
*/
|
|
3044
|
+
interface ThemeScriptProps extends ThemeScriptOptions {
|
|
3045
|
+
/** Nonce for CSP (Content Security Policy) */
|
|
3046
|
+
nonce?: string;
|
|
3047
|
+
}
|
|
3048
|
+
/**
|
|
3049
|
+
* Get props for a script element
|
|
3050
|
+
*
|
|
3051
|
+
* @example
|
|
3052
|
+
* ```tsx
|
|
3053
|
+
* import { getThemeScriptProps } from '@hypoth-ui/react/theme';
|
|
3054
|
+
*
|
|
3055
|
+
* function Head() {
|
|
3056
|
+
* const scriptProps = getThemeScriptProps({ nonce: 'abc123' });
|
|
3057
|
+
* return <script {...scriptProps} />;
|
|
3058
|
+
* }
|
|
3059
|
+
* ```
|
|
3060
|
+
*/
|
|
3061
|
+
declare function getThemeScriptProps(options?: ThemeScriptProps): {
|
|
3062
|
+
dangerouslySetInnerHTML: {
|
|
3063
|
+
__html: string;
|
|
3064
|
+
};
|
|
3065
|
+
nonce?: string;
|
|
3066
|
+
};
|
|
3067
|
+
|
|
3068
|
+
export { Accordion, type AccordionContentProps, type AccordionItemProps, type AccordionOrientation, type AccordionRootProps, type AccordionTriggerProps, type AccordionType, AlertDialog, type AlertDialogActionProps, type AlertDialogCancelProps, type AlertDialogContentProps, type AlertDialogContentSize, type AlertDialogDescriptionProps, type AlertDialogFooterProps, type AlertDialogHeaderProps, type AlertDialogRootProps, type AlertDialogTitleProps, type AlertDialogTriggerProps, AppShell, type AppShellProps, AspectRatio, type AspectRatioProps, Breadcrumb, type BreadcrumbItemProps, type BreadcrumbLinkProps, type BreadcrumbListProps, type BreadcrumbPageProps, type BreadcrumbRootProps, type BreadcrumbSeparatorProps, Button, type ButtonProps, Card, type CardContentProps, type CardFooterProps, type CardHeaderProps, type CardRootProps, Center, type CenterProps, Checkbox, type CheckboxProps, Collapsible, type CollapsibleContentProps, type CollapsibleRootProps, type CollapsibleTriggerProps, type ColorMode, Combobox, type ComboboxContentProps, type ComboboxEmptyProps, type ComboboxInputProps, type ComboboxLoadingProps, type ComboboxOptionProps, type ComboboxRootProps, type ComboboxTagProps, Command, type CommandEmptyProps, type CommandGroupProps, type CommandInputProps, type CommandItemProps, type CommandListProps, type CommandLoadingProps, type CommandRootProps, type CommandSeparatorProps, Container, type ContainerProps, ContextMenu, type ContextMenuContentProps, type ContextMenuItemProps, type ContextMenuItemVariant, type ContextMenuLabelProps, type ContextMenuRootProps, type ContextMenuSeparatorProps, type ContextMenuTriggerProps, DEFAULT_STORAGE_KEYS, DEFAULT_THEME, DSErrorFallback, DatePicker, type DatePickerCalendarProps, type DatePickerContentProps, type DatePickerMode, type DatePickerRootProps, type DatePickerTriggerProps, type Density, type DensityContextValue, DensityProvider, type DensityProviderProps, Dialog, type DialogCloseProps, type DialogContentProps, type DialogContentSize, type DialogDescriptionProps, type DialogRootProps, type DialogTitleProps, type DialogTriggerProps, Drawer, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerHeaderProps, type DrawerRootProps, type DrawerSide, type DrawerTitleProps, type DrawerTriggerProps, DropdownMenu, type DropdownMenuCheckboxItemProps, type DropdownMenuContentProps, type DropdownMenuItemProps, type DropdownMenuItemVariant, type DropdownMenuLabelProps, type DropdownMenuPlacement, type DropdownMenuRadioGroupProps, type DropdownMenuRadioItemProps, type DropdownMenuRootProps, type DropdownMenuSeparatorProps, type DropdownMenuTriggerProps, ErrorBoundary, type ErrorBoundaryProps, type ErrorBoundaryState, Field, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, type FieldProps, FileUpload, type FileUploadDropzoneProps, type FileUploadInputProps, type FileUploadItemProps, type FileUploadRootProps, Flow, type FlowProps, Grid, type GridProps, HoverCard, type HoverCardContentProps, type HoverCardPlacement, type HoverCardRootProps, type HoverCardTriggerProps, Inline, type InlineProps, Label, type LabelProps, Box as LayoutBox, type BoxProps as LayoutBoxProps, type FooterProps as LayoutFooterProps, type HeaderProps as LayoutHeaderProps, type LoadingProps, type LoadingState, type MainProps, Menu, type MenuContentProps, type MenuItemProps, type MenuLabelProps, type MenuRootProps, type MenuSeparatorProps, type MenuTriggerProps, NavigationMenu, type NavigationMenuContentProps, type NavigationMenuIndicatorProps, type NavigationMenuItemProps, type NavigationMenuLinkProps, type NavigationMenuListProps, type NavigationMenuOrientation, type NavigationMenuRootProps, type NavigationMenuTriggerProps, type NavigationMenuViewportProps, NumberInput, type NumberInputDecrementProps, type NumberInputFieldProps, type NumberInputFormat, type NumberInputIncrementProps, type NumberInputRootProps, type OnLoadingChange, Page, type PageProps, Pagination, type PaginationContentProps, type PaginationEllipsisProps, type PaginationItemProps, type PaginationLinkProps, type PaginationNextProps, type PaginationPreviousProps, type PaginationRootProps, PinInput, type PinInputFieldProps, type PinInputRootProps, type Placement, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, Presence, type PresenceProps, Radio, RadioGroup, type RadioGroupProps, type RadioOrientation, type RadioProps, type ResolvedColorMode, ScrollArea, type ScrollAreaRootProps, type ScrollAreaScrollbarProps, type ScrollAreaThumbProps, type ScrollAreaType, type ScrollAreaViewportProps, Section, type SectionProps, Select, type SelectContentProps, type SelectLabelProps, type SelectOptionProps, type SelectRootProps, type SelectSeparatorProps, type SelectTriggerProps, type SelectValueProps, Separator, type SeparatorOrientation, type SeparatorProps, Sheet, type SheetCloseProps, type SheetContentProps, type SheetContentSize, type SheetDescriptionProps, type SheetFooterProps, type SheetHeaderProps, type SheetRootProps, type SheetSide, type SheetTitleProps, type SheetTriggerProps, type SidebarProps, Slider, type SliderRangeProps, type SliderRootProps, type SliderThumbProps, type SliderTrackProps, Spacer, type SpacerProps, Split, type SplitProps, type StableIds, Stack, type StackProps, Stepper, type StepperContentProps, type StepperDescriptionProps, type StepperIndicatorProps, type StepperItemProps, type StepperOrientation, type StepperRootProps, type StepperSeparatorProps, type StepperTitleProps, type StepperTriggerProps, type StorageKeys, Switch, type SwitchProps, THEME_ATTRIBUTES, type TableLoadingProps, Tabs, type TabsActivationMode, type TabsContentProps, type TabsListProps, type TabsOrientation, type TabsRootProps, type TabsTriggerProps, Textarea, type TextareaProps, type TextareaSize, type ThemeConfig, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, type ThemeScriptOptions, type ThemeScriptProps, TimePicker, type TimePickerRootProps, type TimePickerSegmentProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, type TreeLoadingProps, type UsePresenceOptions, type UsePresenceReturn, type UseStableIdOptions, type UseStableIdsOptions, type WithErrorBoundaryOptions, Wrap, type WrapProps, getSystemColorMode, getThemeScriptContent, getThemeScriptProps, getThemeScriptTag, parseThemeCookie, syncThemeStorage, useColorMode, useConditionalId, useDensity, useDensityContext, usePresence, useScopedIdGenerator, useStableId, useStableIds, useTheme, useThemeState, withErrorBoundary };
|