@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.
@@ -0,0 +1,1885 @@
1
+ import * as react from 'react';
2
+ import react__default, { ButtonHTMLAttributes, MouseEvent as MouseEvent$1, InputHTMLAttributes, AnchorHTMLAttributes, ReactNode, CSSProperties, HTMLAttributes, RefObject, SyntheticEvent } from 'react';
3
+
4
+ /**
5
+ * Responsive Utilities
6
+ *
7
+ * Provides types and utilities for breakpoint-aware component props.
8
+ * Supports responsive object syntax for size and other props.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ /**
13
+ * Breakpoint names matching the design token system
14
+ */
15
+ type Breakpoint = "base" | "sm" | "md" | "lg" | "xl" | "2xl";
16
+ /**
17
+ * Responsive prop value type
18
+ *
19
+ * Can be either:
20
+ * - A single value (applies to all breakpoints)
21
+ * - An object with breakpoint keys (applies at each breakpoint)
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * // Single value
26
+ * <Button size="md" />
27
+ *
28
+ * // Responsive object
29
+ * <Button size={{ base: "sm", md: "md", lg: "lg" }} />
30
+ * ```
31
+ */
32
+ type ResponsiveProp<T> = T | Partial<Record<Breakpoint, T>>;
33
+
34
+ type ButtonVariant = "primary" | "secondary" | "ghost" | "destructive";
35
+ type ButtonSize = "sm" | "md" | "lg";
36
+ interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
37
+ /** Visual style variant */
38
+ variant?: ButtonVariant;
39
+ /**
40
+ * Button size - supports responsive object syntax
41
+ * @example
42
+ * ```tsx
43
+ * // Single value
44
+ * <Button size="md" />
45
+ *
46
+ * // Responsive
47
+ * <Button size={{ base: "sm", md: "md", lg: "lg" }} />
48
+ * ```
49
+ */
50
+ size?: ResponsiveProp<ButtonSize>;
51
+ /** Loading state */
52
+ loading?: boolean;
53
+ /** Click handler */
54
+ onClick?: (event: MouseEvent$1<HTMLElement>) => void;
55
+ /** Button content */
56
+ children?: react__default.ReactNode;
57
+ }
58
+ /**
59
+ * React wrapper for ds-button Web Component.
60
+ * Provides type-safe props and event handling.
61
+ */
62
+ declare const Button: react__default.ForwardRefExoticComponent<ButtonProps & react__default.RefAttributes<HTMLElement>>;
63
+
64
+ type InputType = "text" | "email" | "password" | "number" | "tel" | "url" | "search";
65
+ type InputSize = "sm" | "md" | "lg";
66
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "onInput"> {
67
+ /** Input type */
68
+ type?: InputType;
69
+ /**
70
+ * Input size - supports responsive object syntax
71
+ * @example
72
+ * ```tsx
73
+ * // Single value
74
+ * <Input size="md" />
75
+ *
76
+ * // Responsive
77
+ * <Input size={{ base: "sm", md: "md", lg: "lg" }} />
78
+ * ```
79
+ */
80
+ size?: ResponsiveProp<InputSize>;
81
+ /** Error state */
82
+ error?: boolean;
83
+ /** Change handler - fires when input loses focus with changed value */
84
+ onChange?: (value: string, event: Event) => void;
85
+ /** Value change handler - fires on every keystroke */
86
+ onValueChange?: (value: string, event: Event) => void;
87
+ }
88
+ /**
89
+ * React wrapper for ds-input Web Component.
90
+ * Provides type-safe props and event handling.
91
+ */
92
+ declare const Input: react__default.ForwardRefExoticComponent<InputProps & react__default.RefAttributes<HTMLElement>>;
93
+
94
+ /**
95
+ * Event type definitions for React wrapper components.
96
+ * These types match the custom events emitted by Web Components.
97
+ */
98
+ /**
99
+ * Event detail for ds:navigate custom event from ds-link.
100
+ */
101
+ interface DsNavigateEventDetail {
102
+ /** The target URL */
103
+ href: string;
104
+ /** Whether the link opens in a new tab */
105
+ external: boolean;
106
+ /** The original DOM event that triggered navigation */
107
+ originalEvent: MouseEvent | KeyboardEvent;
108
+ }
109
+ /**
110
+ * Event detail for input value changes.
111
+ */
112
+ interface DsInputEventDetail {
113
+ value: string;
114
+ }
115
+ /**
116
+ * Typed event handler for ds:navigate.
117
+ */
118
+ type NavigateEventHandler = (event: CustomEvent<DsNavigateEventDetail>) => void;
119
+ /**
120
+ * Typed event handler for input events.
121
+ */
122
+ type InputValueHandler = (value: string, event: CustomEvent<DsInputEventDetail>) => void;
123
+
124
+ /**
125
+ * Polymorphic type utilities for asChild pattern.
126
+ */
127
+ /**
128
+ * Spacing values supported by Box component.
129
+ * Maps to design system spacing tokens.
130
+ */
131
+ type SpacingValue = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24;
132
+ /**
133
+ * Display values for Box component.
134
+ */
135
+ type DisplayValue = "block" | "inline" | "inline-block" | "flex" | "inline-flex" | "grid" | "inline-grid" | "none";
136
+ /**
137
+ * Flex direction values.
138
+ */
139
+ type FlexDirection = "row" | "row-reverse" | "column" | "column-reverse";
140
+ /**
141
+ * Alignment values for flex/grid.
142
+ */
143
+ type AlignValue = "start" | "end" | "center" | "stretch" | "baseline";
144
+ /**
145
+ * Justify values for flex/grid.
146
+ */
147
+ type JustifyValue = "start" | "end" | "center" | "between" | "around" | "evenly";
148
+ /**
149
+ * Base props for components supporting asChild pattern.
150
+ */
151
+ interface AsChildProps {
152
+ /**
153
+ * When true, the component renders its child element with merged props
154
+ * instead of its default element.
155
+ */
156
+ asChild?: boolean;
157
+ }
158
+
159
+ type LinkVariant = "default" | "muted" | "underline";
160
+ interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">, AsChildProps {
161
+ /** Target URL */
162
+ href: string;
163
+ /** Whether the link opens in a new tab */
164
+ external?: boolean;
165
+ /** Visual variant */
166
+ variant?: LinkVariant;
167
+ /** Handler for ds:navigate event. Can prevent default navigation. */
168
+ onNavigate?: NavigateEventHandler;
169
+ /** Link content */
170
+ children?: ReactNode;
171
+ }
172
+ /**
173
+ * React wrapper for ds-link Web Component.
174
+ * Provides type-safe props and onNavigate event handler.
175
+ * Supports asChild for Next.js Link integration.
176
+ */
177
+ declare const Link: react.ForwardRefExoticComponent<LinkProps & react.RefAttributes<HTMLElement>>;
178
+
179
+ type IconSize = "xs" | "sm" | "md" | "lg" | "xl";
180
+ /**
181
+ * Icon name from Lucide library (kebab-case format).
182
+ * This is a nominal type alias to document the expected format.
183
+ */
184
+ type IconName = string;
185
+ interface IconProps {
186
+ /** Icon name from Lucide library (kebab-case) */
187
+ name: string;
188
+ /**
189
+ * Icon size - supports responsive object syntax
190
+ * @example
191
+ * ```tsx
192
+ * // Single value
193
+ * <Icon name="check" size="md" />
194
+ *
195
+ * // Responsive
196
+ * <Icon name="check" size={{ base: "sm", md: "md", lg: "lg" }} />
197
+ * ```
198
+ */
199
+ size?: ResponsiveProp<IconSize>;
200
+ /** Accessible label. When omitted, icon is decorative. */
201
+ label?: string;
202
+ /** Custom color (CSS value) */
203
+ color?: string;
204
+ /** Additional CSS classes */
205
+ className?: string;
206
+ }
207
+ /**
208
+ * React wrapper for ds-icon Web Component.
209
+ * Provides type-safe props for icon display.
210
+ */
211
+ declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLElement>>;
212
+
213
+ type SpinnerSize = "sm" | "md" | "lg";
214
+ interface SpinnerProps {
215
+ /**
216
+ * Spinner size - supports responsive object syntax
217
+ * @example
218
+ * ```tsx
219
+ * // Single value
220
+ * <Spinner size="md" />
221
+ *
222
+ * // Responsive
223
+ * <Spinner size={{ base: "sm", md: "md" }} />
224
+ * ```
225
+ */
226
+ size?: ResponsiveProp<SpinnerSize>;
227
+ /** Accessible label for screen readers */
228
+ label?: string;
229
+ /** Additional CSS classes */
230
+ className?: string;
231
+ }
232
+ /**
233
+ * React wrapper for ds-spinner Web Component.
234
+ * Provides type-safe props for loading indicator.
235
+ */
236
+ declare const Spinner: react.ForwardRefExoticComponent<SpinnerProps & react.RefAttributes<HTMLElement>>;
237
+
238
+ interface VisuallyHiddenProps {
239
+ /** When true, content becomes visible on focus */
240
+ focusable?: boolean;
241
+ /** Hidden content */
242
+ children: ReactNode;
243
+ /** Additional CSS classes */
244
+ className?: string;
245
+ }
246
+ /**
247
+ * React wrapper for ds-visually-hidden Web Component.
248
+ * Hides content visually while keeping it accessible to screen readers.
249
+ */
250
+ declare const VisuallyHidden: react.ForwardRefExoticComponent<VisuallyHiddenProps & react.RefAttributes<HTMLElement>>;
251
+
252
+ type TextSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
253
+ type TextWeight = "normal" | "medium" | "semibold" | "bold";
254
+ type TextVariant = "default" | "muted" | "success" | "warning" | "error";
255
+ interface TextProps extends AsChildProps {
256
+ /** Text size */
257
+ size?: TextSize;
258
+ /** Font weight */
259
+ weight?: TextWeight;
260
+ /** Color variant */
261
+ variant?: TextVariant;
262
+ /** Truncate text with ellipsis */
263
+ truncate?: boolean;
264
+ /** Additional CSS classes */
265
+ className?: string;
266
+ /** Text content */
267
+ children?: ReactNode;
268
+ }
269
+ /**
270
+ * Text is a typography primitive that applies consistent text styling.
271
+ * Supports asChild for semantic HTML elements (h1-h6, p, etc.).
272
+ *
273
+ * @example
274
+ * ```tsx
275
+ * <Text size="lg" weight="bold">Large bold text</Text>
276
+ *
277
+ * <Text size="2xl" weight="bold" asChild>
278
+ * <h1>Page Title</h1>
279
+ * </Text>
280
+ *
281
+ * <Text variant="muted" asChild>
282
+ * <p>Muted paragraph text</p>
283
+ * </Text>
284
+ * ```
285
+ */
286
+ declare const Text: react.ForwardRefExoticComponent<TextProps & react.RefAttributes<HTMLElement>>;
287
+
288
+ interface BoxProps extends AsChildProps {
289
+ p?: SpacingValue;
290
+ px?: SpacingValue;
291
+ py?: SpacingValue;
292
+ pt?: SpacingValue;
293
+ pr?: SpacingValue;
294
+ pb?: SpacingValue;
295
+ pl?: SpacingValue;
296
+ m?: SpacingValue;
297
+ mx?: SpacingValue;
298
+ my?: SpacingValue;
299
+ mt?: SpacingValue;
300
+ mr?: SpacingValue;
301
+ mb?: SpacingValue;
302
+ ml?: SpacingValue;
303
+ gap?: SpacingValue;
304
+ display?: DisplayValue;
305
+ flexDirection?: FlexDirection;
306
+ alignItems?: AlignValue;
307
+ justifyContent?: JustifyValue;
308
+ flexWrap?: "wrap" | "nowrap" | "wrap-reverse";
309
+ flexGrow?: 0 | 1;
310
+ flexShrink?: 0 | 1;
311
+ className?: string;
312
+ style?: CSSProperties;
313
+ children?: ReactNode;
314
+ }
315
+ /**
316
+ * Box is a layout primitive that applies spacing and layout CSS classes.
317
+ * Supports asChild for semantic HTML rendering.
318
+ *
319
+ * @example
320
+ * ```tsx
321
+ * <Box p={4} display="flex" gap={2}>
322
+ * <span>Item 1</span>
323
+ * <span>Item 2</span>
324
+ * </Box>
325
+ *
326
+ * <Box p={6} asChild>
327
+ * <main>Content</main>
328
+ * </Box>
329
+ * ```
330
+ */
331
+ declare const Box: react.ForwardRefExoticComponent<BoxProps & react.RefAttributes<HTMLElement>>;
332
+
333
+ interface SlotProps extends HTMLAttributes<HTMLElement> {
334
+ children?: ReactNode;
335
+ }
336
+ /**
337
+ * Slot renders its child element with merged props.
338
+ * Used internally by asChild implementations.
339
+ *
340
+ * - Validates that children is a single React element
341
+ * - Merges props (className concatenated, styles merged, events composed)
342
+ * - Forwards refs to the child element
343
+ */
344
+ declare const Slot: react.ForwardRefExoticComponent<SlotProps & react.RefAttributes<HTMLElement>>;
345
+
346
+ /**
347
+ * Portal React Component
348
+ *
349
+ * Renders children into a DOM node outside the parent component hierarchy.
350
+ * Useful for modals, tooltips, dropdowns, and other overlay patterns.
351
+ */
352
+
353
+ interface PortalProps {
354
+ /** Content to render in the portal */
355
+ children: ReactNode;
356
+ /** Container element to render into (defaults to document.body) */
357
+ container?: Element | null;
358
+ /** CSS selector for container element (alternative to container prop) */
359
+ containerSelector?: string;
360
+ /** Whether the portal is disabled (renders children in place) */
361
+ disabled?: boolean;
362
+ }
363
+ /**
364
+ * Portal component for rendering content outside the normal React tree.
365
+ *
366
+ * @example
367
+ * ```tsx
368
+ * // Basic usage - renders to document.body
369
+ * <Portal>
370
+ * <div className="modal">Modal content</div>
371
+ * </Portal>
372
+ *
373
+ * // Custom container
374
+ * <Portal container={document.getElementById('portal-root')}>
375
+ * <div className="dropdown">Dropdown content</div>
376
+ * </Portal>
377
+ *
378
+ * // Using selector
379
+ * <Portal containerSelector="#portal-root">
380
+ * <div>Content</div>
381
+ * </Portal>
382
+ *
383
+ * // Disabled portal (renders in place)
384
+ * <Portal disabled>
385
+ * <div>Renders here instead</div>
386
+ * </Portal>
387
+ * ```
388
+ */
389
+ declare function Portal({ children, container, containerSelector, disabled, }: PortalProps): ReactNode;
390
+ declare namespace Portal {
391
+ var displayName: string;
392
+ }
393
+
394
+ interface FocusScopeProps {
395
+ /** Content to wrap with focus management */
396
+ children: ReactNode;
397
+ /** Whether to trap focus within the scope */
398
+ trap?: boolean;
399
+ /** Whether to restore focus to the previously focused element on unmount */
400
+ restoreFocus?: boolean;
401
+ /** Whether to auto-focus the first focusable element on mount */
402
+ autoFocus?: boolean;
403
+ /** Ref to element to focus on mount (overrides autoFocus behavior) */
404
+ initialFocus?: RefObject<HTMLElement>;
405
+ /** Ref to element to restore focus to on unmount */
406
+ returnFocus?: RefObject<HTMLElement>;
407
+ /** Callback when focus leaves the scope (only when trap is false) */
408
+ onFocusOutside?: (event: FocusEvent) => void;
409
+ /** Whether the focus scope is active */
410
+ active?: boolean;
411
+ /** Additional class name for the wrapper */
412
+ className?: string;
413
+ /** Render as a different element */
414
+ as?: keyof JSX.IntrinsicElements;
415
+ }
416
+ interface FocusScopeRef {
417
+ /** Focus the first focusable element */
418
+ focusFirst: () => void;
419
+ /** Focus the last focusable element */
420
+ focusLast: () => void;
421
+ /** Get all focusable elements */
422
+ getFocusableElements: () => HTMLElement[];
423
+ }
424
+ /**
425
+ * FocusScope component for managing focus within a container.
426
+ *
427
+ * @example
428
+ * ```tsx
429
+ * // Basic modal usage
430
+ * <FocusScope trap restoreFocus autoFocus>
431
+ * <div role="dialog" aria-modal="true">
432
+ * <input placeholder="First input" />
433
+ * <button>Close</button>
434
+ * </div>
435
+ * </FocusScope>
436
+ *
437
+ * // With initial focus
438
+ * const submitRef = useRef<HTMLButtonElement>(null);
439
+ *
440
+ * <FocusScope trap restoreFocus initialFocus={submitRef}>
441
+ * <input />
442
+ * <button ref={submitRef}>Submit</button>
443
+ * </FocusScope>
444
+ *
445
+ * // Controlled activation
446
+ * <FocusScope trap active={isOpen}>
447
+ * {children}
448
+ * </FocusScope>
449
+ * ```
450
+ */
451
+ declare const FocusScope: react.ForwardRefExoticComponent<FocusScopeProps & react.RefAttributes<FocusScopeRef>>;
452
+
453
+ /**
454
+ * ClientOnly React Component
455
+ *
456
+ * Prevents SSR for browser-only components. Renders fallback on server
457
+ * and during hydration, then shows children after client-side mount.
458
+ */
459
+
460
+ interface ClientOnlyProps {
461
+ /** Content to render only on the client */
462
+ children: ReactNode;
463
+ /** Fallback content to show during SSR and hydration */
464
+ fallback?: ReactNode;
465
+ }
466
+ /**
467
+ * ClientOnly component for browser-only rendering.
468
+ *
469
+ * Useful for components that:
470
+ * - Access browser APIs (window, document, localStorage)
471
+ * - Use third-party libraries that don't support SSR
472
+ * - Need to avoid hydration mismatches
473
+ *
474
+ * @example
475
+ * ```tsx
476
+ * // Basic usage
477
+ * <ClientOnly>
478
+ * <BrowserOnlyChart data={data} />
479
+ * </ClientOnly>
480
+ *
481
+ * // With fallback
482
+ * <ClientOnly fallback={<Skeleton height={300} />}>
483
+ * <Chart data={data} />
484
+ * </ClientOnly>
485
+ *
486
+ * // For localStorage access
487
+ * <ClientOnly fallback={<span>Loading preferences...</span>}>
488
+ * <UserPreferences />
489
+ * </ClientOnly>
490
+ * ```
491
+ */
492
+ declare function ClientOnly({ children, fallback }: ClientOnlyProps): ReactNode;
493
+ declare namespace ClientOnly {
494
+ var displayName: string;
495
+ }
496
+ /**
497
+ * Hook for client-only rendering logic.
498
+ *
499
+ * @returns true when running on the client after hydration
500
+ *
501
+ * @example
502
+ * ```tsx
503
+ * function MyComponent() {
504
+ * const isClient = useIsClient();
505
+ *
506
+ * if (!isClient) {
507
+ * return <Skeleton />;
508
+ * }
509
+ *
510
+ * return <ClientSideContent />;
511
+ * }
512
+ * ```
513
+ */
514
+ declare function useIsClient(): boolean;
515
+
516
+ type AlertVariant = "info" | "success" | "warning" | "error";
517
+ interface AlertProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
518
+ /** Visual variant */
519
+ variant?: AlertVariant;
520
+ /** Alert title */
521
+ title?: string;
522
+ /** Whether the alert can be closed */
523
+ closable?: boolean;
524
+ /** Hide the default icon */
525
+ hideIcon?: boolean;
526
+ /** Custom icon element */
527
+ icon?: ReactNode;
528
+ /** Action slot content */
529
+ action?: ReactNode;
530
+ /** Callback when close button is clicked */
531
+ onClose?: () => void;
532
+ /** Alert content/description */
533
+ children?: ReactNode;
534
+ }
535
+ /**
536
+ * Alert component for contextual feedback messages.
537
+ *
538
+ * @example
539
+ * ```tsx
540
+ * // Basic usage
541
+ * <Alert variant="success" title="Success">
542
+ * Your changes have been saved.
543
+ * </Alert>
544
+ *
545
+ * // Closable alert
546
+ * <Alert variant="error" title="Error" closable onClose={() => setShowAlert(false)}>
547
+ * An error occurred while saving.
548
+ * </Alert>
549
+ *
550
+ * // With action
551
+ * <Alert variant="warning" title="Warning" action={<Button size="sm">Undo</Button>}>
552
+ * This action cannot be reversed.
553
+ * </Alert>
554
+ * ```
555
+ */
556
+ declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
557
+
558
+ type ToastVariant = "info" | "success" | "warning" | "error";
559
+ type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
560
+ type ToastState = "entering" | "visible" | "exiting" | "dismissed";
561
+ interface ToastAction {
562
+ label: string;
563
+ onClick: () => void;
564
+ }
565
+ interface ToastOptions$1 {
566
+ title: string;
567
+ description?: string;
568
+ variant?: ToastVariant;
569
+ duration?: number;
570
+ action?: ToastAction;
571
+ }
572
+ interface ToastData extends ToastOptions$1 {
573
+ id: string;
574
+ state: ToastState;
575
+ createdAt: number;
576
+ }
577
+ interface ToastProviderProps {
578
+ /** Toast position */
579
+ position?: ToastPosition;
580
+ /** Maximum simultaneous toasts */
581
+ max?: number;
582
+ /** Default duration in ms */
583
+ duration?: number;
584
+ /** Children (your app) */
585
+ children: ReactNode;
586
+ }
587
+ /**
588
+ * Toast Provider component.
589
+ *
590
+ * @example
591
+ * ```tsx
592
+ * <Toast.Provider position="top-right" max={5}>
593
+ * <App />
594
+ * </Toast.Provider>
595
+ * ```
596
+ */
597
+ declare function ToastProvider({ position, max, duration: defaultDuration, children, }: ToastProviderProps): ReactNode;
598
+ declare namespace ToastProvider {
599
+ var displayName: string;
600
+ }
601
+
602
+ interface ToastOptions {
603
+ /** Toast title (required) */
604
+ title: string;
605
+ /** Optional description */
606
+ description?: string;
607
+ /** Visual variant */
608
+ variant?: "info" | "success" | "warning" | "error";
609
+ /** Auto-dismiss duration in ms (0 = no auto-dismiss) */
610
+ duration?: number;
611
+ /** Optional action button */
612
+ action?: {
613
+ label: string;
614
+ onClick: () => void;
615
+ };
616
+ }
617
+ interface UseToastReturn {
618
+ /** Show a toast notification */
619
+ toast: (options: ToastOptions) => string;
620
+ /** Dismiss a specific toast */
621
+ dismiss: (id: string) => void;
622
+ /** Dismiss all toasts */
623
+ dismissAll: () => void;
624
+ }
625
+ /**
626
+ * Hook for showing toast notifications.
627
+ *
628
+ * @example
629
+ * ```tsx
630
+ * function MyComponent() {
631
+ * const { toast, dismiss } = useToast();
632
+ *
633
+ * const handleSave = async () => {
634
+ * try {
635
+ * await saveData();
636
+ * toast({ title: "Saved!", variant: "success" });
637
+ * } catch {
638
+ * toast({
639
+ * title: "Error",
640
+ * description: "Failed to save",
641
+ * variant: "error",
642
+ * action: { label: "Retry", onClick: handleSave },
643
+ * });
644
+ * }
645
+ * };
646
+ *
647
+ * return <button onClick={handleSave}>Save</button>;
648
+ * }
649
+ * ```
650
+ */
651
+ declare function useToast(): UseToastReturn;
652
+
653
+ /**
654
+ * Toast Compound Component
655
+ *
656
+ * Non-blocking notification system with queue management and animations.
657
+ */
658
+
659
+ /**
660
+ * Toast compound component.
661
+ *
662
+ * @example
663
+ * ```tsx
664
+ * // In your app root (e.g., layout.tsx)
665
+ * import { Toast } from "@hypoth-ui/react/client";
666
+ *
667
+ * export default function RootLayout({ children }) {
668
+ * return (
669
+ * <html>
670
+ * <body>
671
+ * <Toast.Provider position="top-right" max={5}>
672
+ * {children}
673
+ * </Toast.Provider>
674
+ * </body>
675
+ * </html>
676
+ * );
677
+ * }
678
+ *
679
+ * // In any component
680
+ * import { useToast } from "@hypoth-ui/react/client";
681
+ *
682
+ * function SaveButton() {
683
+ * const { toast } = useToast();
684
+ *
685
+ * const handleSave = async () => {
686
+ * try {
687
+ * await save();
688
+ * toast({ title: "Saved!", variant: "success" });
689
+ * } catch {
690
+ * toast({
691
+ * title: "Error",
692
+ * description: "Failed to save",
693
+ * variant: "error",
694
+ * action: { label: "Retry", onClick: handleSave },
695
+ * });
696
+ * }
697
+ * };
698
+ *
699
+ * return <button onClick={handleSave}>Save</button>;
700
+ * }
701
+ * ```
702
+ */
703
+ declare const Toast: {
704
+ readonly Provider: typeof ToastProvider;
705
+ };
706
+
707
+ type ProgressVariant = "linear" | "circular";
708
+ type ProgressSize = "sm" | "md" | "lg";
709
+ interface ProgressProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
710
+ /**
711
+ * Current progress value (0-100). Omit for indeterminate.
712
+ */
713
+ value?: number;
714
+ /**
715
+ * Maximum value.
716
+ * @default 100
717
+ */
718
+ max?: number;
719
+ /**
720
+ * Visual variant.
721
+ * @default "linear"
722
+ */
723
+ variant?: ProgressVariant;
724
+ /**
725
+ * Size variant - supports responsive object syntax.
726
+ * @default "md"
727
+ * @example
728
+ * ```tsx
729
+ * // Single value
730
+ * <Progress value={75} size="md" />
731
+ *
732
+ * // Responsive
733
+ * <Progress value={75} size={{ base: "sm", md: "lg" }} />
734
+ * ```
735
+ */
736
+ size?: ResponsiveProp<ProgressSize>;
737
+ /**
738
+ * Accessible label.
739
+ */
740
+ label?: string;
741
+ /**
742
+ * Show value as percentage text (circular only).
743
+ * @default false
744
+ */
745
+ showValue?: boolean;
746
+ }
747
+ /**
748
+ * Progress indicator component for showing loading or completion status.
749
+ *
750
+ * @example
751
+ * ```tsx
752
+ * // Determinate linear progress
753
+ * <Progress value={75} label="Uploading..." />
754
+ *
755
+ * // Indeterminate circular progress
756
+ * <Progress variant="circular" label="Loading" />
757
+ *
758
+ * // Circular with percentage display
759
+ * <Progress variant="circular" value={45} showValue />
760
+ * ```
761
+ */
762
+ declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLElement>>;
763
+ declare global {
764
+ namespace JSX {
765
+ interface IntrinsicElements {
766
+ "ds-progress": ProgressProps & {
767
+ ref?: React.Ref<HTMLElement>;
768
+ "show-value"?: boolean;
769
+ };
770
+ }
771
+ }
772
+ }
773
+
774
+ type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
775
+ type AvatarShape = "circle" | "square";
776
+ type AvatarStatus = "online" | "offline" | "away" | "busy";
777
+ interface AvatarProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
778
+ /**
779
+ * Image source URL.
780
+ */
781
+ src?: string;
782
+ /**
783
+ * Alt text for image.
784
+ */
785
+ alt?: string;
786
+ /**
787
+ * User's name (used for initials fallback).
788
+ */
789
+ name?: string;
790
+ /**
791
+ * Size variant - supports responsive object syntax.
792
+ * @default "md"
793
+ * @example
794
+ * ```tsx
795
+ * // Single value
796
+ * <Avatar name="John Doe" size="md" />
797
+ *
798
+ * // Responsive
799
+ * <Avatar name="John Doe" size={{ base: "sm", md: "lg" }} />
800
+ * ```
801
+ */
802
+ size?: ResponsiveProp<AvatarSize>;
803
+ /**
804
+ * Shape variant.
805
+ * @default "circle"
806
+ */
807
+ shape?: AvatarShape;
808
+ /**
809
+ * Status indicator.
810
+ */
811
+ status?: AvatarStatus;
812
+ /**
813
+ * Whether to show status indicator.
814
+ * @default false
815
+ */
816
+ showStatus?: boolean;
817
+ }
818
+ declare global {
819
+ namespace JSX {
820
+ interface IntrinsicElements {
821
+ "ds-avatar": AvatarProps & {
822
+ ref?: React.Ref<HTMLElement>;
823
+ "show-status"?: boolean;
824
+ };
825
+ }
826
+ }
827
+ }
828
+
829
+ interface AvatarGroupProps extends HTMLAttributes<HTMLElement> {
830
+ /**
831
+ * Maximum number of avatars to display before showing overflow.
832
+ * @default 5
833
+ */
834
+ max?: number;
835
+ /**
836
+ * Size variant (inherited by child avatars) - supports responsive object syntax.
837
+ * @default "md"
838
+ * @example
839
+ * ```tsx
840
+ * // Single value
841
+ * <AvatarGroup size="md">...</AvatarGroup>
842
+ *
843
+ * // Responsive
844
+ * <AvatarGroup size={{ base: "sm", md: "lg" }}>...</AvatarGroup>
845
+ * ```
846
+ */
847
+ size?: ResponsiveProp<AvatarSize>;
848
+ /**
849
+ * Avatar children.
850
+ */
851
+ children?: ReactNode;
852
+ }
853
+ /**
854
+ * Avatar group component for displaying multiple avatars with overflow indicator.
855
+ *
856
+ * @example
857
+ * ```tsx
858
+ * <AvatarGroup max={3}>
859
+ * <Avatar name="Alice" />
860
+ * <Avatar name="Bob" />
861
+ * <Avatar name="Charlie" />
862
+ * <Avatar name="Diana" />
863
+ * <Avatar name="Eve" />
864
+ * </AvatarGroup>
865
+ * // Shows 3 avatars + "+2" overflow indicator
866
+ * ```
867
+ */
868
+ declare const AvatarGroup: react.ForwardRefExoticComponent<AvatarGroupProps & react.RefAttributes<HTMLElement>>;
869
+ declare global {
870
+ namespace JSX {
871
+ interface IntrinsicElements {
872
+ "ds-avatar-group": AvatarGroupProps & {
873
+ ref?: React.Ref<HTMLElement>;
874
+ };
875
+ }
876
+ }
877
+ }
878
+
879
+ /**
880
+ * Avatar compound component for user representation.
881
+ *
882
+ * @example
883
+ * ```tsx
884
+ * // Single avatar
885
+ * <Avatar src="/user.jpg" name="John Doe" />
886
+ *
887
+ * // Avatar group
888
+ * <Avatar.Group max={3}>
889
+ * <Avatar name="Alice" />
890
+ * <Avatar name="Bob" />
891
+ * <Avatar name="Charlie" />
892
+ * </Avatar.Group>
893
+ * ```
894
+ */
895
+ declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLElement>> & {
896
+ Group: react.ForwardRefExoticComponent<AvatarGroupProps & react.RefAttributes<HTMLElement>>;
897
+ };
898
+
899
+ type TableAlign = "left" | "center" | "right";
900
+ type SortDirection = "asc" | "desc" | "none";
901
+ interface TableHeadProps extends HTMLAttributes<HTMLElement> {
902
+ /**
903
+ * Column key for sorting.
904
+ */
905
+ column?: string;
906
+ /**
907
+ * Text alignment.
908
+ * @default "left"
909
+ */
910
+ align?: TableAlign;
911
+ /**
912
+ * Whether this column is sortable.
913
+ * @default false
914
+ */
915
+ sortable?: boolean;
916
+ /**
917
+ * Current sort direction.
918
+ * @default "none"
919
+ */
920
+ sortDirection?: SortDirection;
921
+ /**
922
+ * Column width (CSS value).
923
+ */
924
+ width?: string;
925
+ /**
926
+ * Callback when sort is triggered.
927
+ */
928
+ onSort?: (column: string, direction: SortDirection) => void;
929
+ /**
930
+ * Header cell content.
931
+ */
932
+ children?: ReactNode;
933
+ }
934
+ /**
935
+ * Table header cell component (th).
936
+ */
937
+ declare const TableHead: react.ForwardRefExoticComponent<TableHeadProps & react.RefAttributes<HTMLElement>>;
938
+
939
+ interface TableCellProps extends HTMLAttributes<HTMLElement> {
940
+ /**
941
+ * Text alignment.
942
+ * @default "left"
943
+ */
944
+ align?: TableAlign;
945
+ /**
946
+ * Column span.
947
+ * @default 1
948
+ */
949
+ colSpan?: number;
950
+ /**
951
+ * Row span.
952
+ * @default 1
953
+ */
954
+ rowSpan?: number;
955
+ /**
956
+ * Cell content.
957
+ */
958
+ children?: ReactNode;
959
+ }
960
+ /**
961
+ * Table cell component (td).
962
+ */
963
+ declare const TableCell: react.ForwardRefExoticComponent<TableCellProps & react.RefAttributes<HTMLElement>>;
964
+
965
+ interface TableRowProps extends HTMLAttributes<HTMLElement> {
966
+ /**
967
+ * Row ID for selection tracking.
968
+ */
969
+ rowId?: string;
970
+ /**
971
+ * Whether this row is selected.
972
+ * @default false
973
+ */
974
+ selected?: boolean;
975
+ /**
976
+ * Row cells.
977
+ */
978
+ children?: ReactNode;
979
+ }
980
+ /**
981
+ * Table row component (tr).
982
+ */
983
+ declare const TableRow: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLElement>>;
984
+
985
+ interface TableBodyProps extends HTMLAttributes<HTMLElement> {
986
+ /**
987
+ * Table body rows.
988
+ */
989
+ children?: ReactNode;
990
+ }
991
+ /**
992
+ * Table body component (tbody).
993
+ */
994
+ declare const TableBody: react.ForwardRefExoticComponent<TableBodyProps & react.RefAttributes<HTMLElement>>;
995
+
996
+ interface TableHeaderProps extends HTMLAttributes<HTMLElement> {
997
+ /**
998
+ * Table header rows.
999
+ */
1000
+ children?: ReactNode;
1001
+ }
1002
+ /**
1003
+ * Table header component (thead).
1004
+ */
1005
+ declare const TableHeader: react.ForwardRefExoticComponent<TableHeaderProps & react.RefAttributes<HTMLElement>>;
1006
+
1007
+ type TableSize = "compact" | "default" | "spacious";
1008
+ interface TableRootProps extends HTMLAttributes<HTMLElement> {
1009
+ /**
1010
+ * Size variant.
1011
+ * @default "default"
1012
+ */
1013
+ size?: TableSize;
1014
+ /**
1015
+ * Whether to show striped rows.
1016
+ * @default false
1017
+ */
1018
+ striped?: boolean;
1019
+ /**
1020
+ * Whether to remove borders.
1021
+ * @default false
1022
+ */
1023
+ borderless?: boolean;
1024
+ /**
1025
+ * Whether to use fixed layout.
1026
+ * @default false
1027
+ */
1028
+ fixed?: boolean;
1029
+ /**
1030
+ * Whether header is sticky.
1031
+ * @default false
1032
+ */
1033
+ stickyHeader?: boolean;
1034
+ /**
1035
+ * Accessible caption for screen readers.
1036
+ */
1037
+ caption?: string;
1038
+ /**
1039
+ * Table content.
1040
+ */
1041
+ children?: ReactNode;
1042
+ }
1043
+
1044
+ /**
1045
+ * Table compound component for structured data display.
1046
+ *
1047
+ * @example
1048
+ * ```tsx
1049
+ * <Table striped>
1050
+ * <Table.Header>
1051
+ * <Table.Row>
1052
+ * <Table.Head sortable column="name" onSort={handleSort}>Name</Table.Head>
1053
+ * <Table.Head>Email</Table.Head>
1054
+ * </Table.Row>
1055
+ * </Table.Header>
1056
+ * <Table.Body>
1057
+ * <Table.Row>
1058
+ * <Table.Cell>John Doe</Table.Cell>
1059
+ * <Table.Cell>john@example.com</Table.Cell>
1060
+ * </Table.Row>
1061
+ * </Table.Body>
1062
+ * </Table>
1063
+ * ```
1064
+ */
1065
+ declare const Table: react.ForwardRefExoticComponent<TableRootProps & react.RefAttributes<HTMLElement>> & {
1066
+ Header: react.ForwardRefExoticComponent<TableHeaderProps & react.RefAttributes<HTMLElement>>;
1067
+ Body: react.ForwardRefExoticComponent<TableBodyProps & react.RefAttributes<HTMLElement>>;
1068
+ Row: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLElement>>;
1069
+ Head: react.ForwardRefExoticComponent<TableHeadProps & react.RefAttributes<HTMLElement>>;
1070
+ Cell: react.ForwardRefExoticComponent<TableCellProps & react.RefAttributes<HTMLElement>>;
1071
+ };
1072
+
1073
+ declare global {
1074
+ namespace JSX {
1075
+ interface IntrinsicElements {
1076
+ "ds-table": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1077
+ ref?: React.Ref<HTMLElement>;
1078
+ size?: string;
1079
+ striped?: boolean;
1080
+ borderless?: boolean;
1081
+ fixed?: boolean;
1082
+ "sticky-header"?: boolean;
1083
+ caption?: string;
1084
+ };
1085
+ "ds-table-header": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1086
+ ref?: React.Ref<HTMLElement>;
1087
+ };
1088
+ "ds-table-body": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1089
+ ref?: React.Ref<HTMLElement>;
1090
+ };
1091
+ "ds-table-row": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1092
+ ref?: React.Ref<HTMLElement>;
1093
+ "row-id"?: string;
1094
+ selected?: boolean;
1095
+ };
1096
+ "ds-table-head": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1097
+ ref?: React.Ref<HTMLElement>;
1098
+ column?: string;
1099
+ align?: string;
1100
+ sortable?: boolean;
1101
+ "sort-direction"?: string;
1102
+ width?: string;
1103
+ "onDs-sort"?: (event: CustomEvent) => void;
1104
+ };
1105
+ "ds-table-cell": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1106
+ ref?: React.Ref<HTMLElement>;
1107
+ align?: string;
1108
+ colspan?: number;
1109
+ rowspan?: number;
1110
+ };
1111
+ }
1112
+ }
1113
+ }
1114
+
1115
+ type SkeletonVariant = "text" | "circular" | "rectangular" | "rounded";
1116
+ type SkeletonSize = "xs" | "sm" | "md" | "lg" | "xl";
1117
+ type SkeletonWidth = "full" | "3/4" | "1/2" | "1/4";
1118
+ type SkeletonAnimation = "wave" | "pulse" | "none";
1119
+ interface SkeletonProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
1120
+ /**
1121
+ * Shape variant.
1122
+ * @default "text"
1123
+ */
1124
+ variant?: SkeletonVariant;
1125
+ /**
1126
+ * Size preset for height - supports responsive object syntax.
1127
+ * @example
1128
+ * ```tsx
1129
+ * // Single value
1130
+ * <Skeleton size="md" />
1131
+ *
1132
+ * // Responsive
1133
+ * <Skeleton size={{ base: "sm", md: "lg" }} />
1134
+ * ```
1135
+ */
1136
+ size?: ResponsiveProp<SkeletonSize>;
1137
+ /**
1138
+ * Width preset.
1139
+ */
1140
+ width?: SkeletonWidth;
1141
+ /**
1142
+ * Custom width (CSS value).
1143
+ */
1144
+ customWidth?: string;
1145
+ /**
1146
+ * Custom height (CSS value).
1147
+ */
1148
+ customHeight?: string;
1149
+ /**
1150
+ * Animation type.
1151
+ * @default "wave"
1152
+ */
1153
+ animation?: SkeletonAnimation;
1154
+ /**
1155
+ * Accessible label for screen readers.
1156
+ * @default "Loading..."
1157
+ */
1158
+ label?: string;
1159
+ }
1160
+ /**
1161
+ * Skeleton loading placeholder component for content that is loading.
1162
+ *
1163
+ * @example
1164
+ * ```tsx
1165
+ * // Text skeleton
1166
+ * <Skeleton variant="text" width="3/4" />
1167
+ *
1168
+ * // Circular avatar skeleton
1169
+ * <Skeleton variant="circular" customWidth="40px" customHeight="40px" />
1170
+ *
1171
+ * // Card skeleton layout
1172
+ * <div className="space-y-2">
1173
+ * <Skeleton variant="rectangular" customHeight="200px" />
1174
+ * <Skeleton variant="text" width="1/2" />
1175
+ * <Skeleton variant="text" />
1176
+ * <Skeleton variant="text" width="3/4" />
1177
+ * </div>
1178
+ * ```
1179
+ */
1180
+ declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLElement>>;
1181
+ declare global {
1182
+ namespace JSX {
1183
+ interface IntrinsicElements {
1184
+ "ds-skeleton": SkeletonProps & {
1185
+ ref?: React.Ref<HTMLElement>;
1186
+ "custom-width"?: string;
1187
+ "custom-height"?: string;
1188
+ };
1189
+ }
1190
+ }
1191
+ }
1192
+
1193
+ type BadgeVariant = "neutral" | "primary" | "secondary" | "success" | "warning" | "error" | "info";
1194
+ type BadgeSize = "sm" | "md" | "lg";
1195
+ type BadgePosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
1196
+ interface BadgeProps extends Omit<HTMLAttributes<HTMLElement>, "content"> {
1197
+ /**
1198
+ * Badge content/count.
1199
+ */
1200
+ content?: string | number;
1201
+ /**
1202
+ * Maximum count to show. Displays "{max}+" if exceeded.
1203
+ */
1204
+ max?: number;
1205
+ /**
1206
+ * Color variant.
1207
+ * @default "primary"
1208
+ */
1209
+ variant?: BadgeVariant;
1210
+ /**
1211
+ * Size variant - supports responsive object syntax.
1212
+ * @default "md"
1213
+ * @example
1214
+ * ```tsx
1215
+ * // Single value
1216
+ * <Badge content={5} size="md" />
1217
+ *
1218
+ * // Responsive
1219
+ * <Badge content={5} size={{ base: "sm", md: "md" }} />
1220
+ * ```
1221
+ */
1222
+ size?: ResponsiveProp<BadgeSize>;
1223
+ /**
1224
+ * Use outline style.
1225
+ * @default false
1226
+ */
1227
+ outline?: boolean;
1228
+ /**
1229
+ * Show as dot (no content).
1230
+ * @default false
1231
+ */
1232
+ dot?: boolean;
1233
+ /**
1234
+ * Position when used in wrapper.
1235
+ * @default "top-right"
1236
+ */
1237
+ position?: BadgePosition;
1238
+ /**
1239
+ * Show pulse animation.
1240
+ * @default false
1241
+ */
1242
+ pulse?: boolean;
1243
+ }
1244
+ /**
1245
+ * Badge component for counts, notifications, and status indicators.
1246
+ *
1247
+ * @example
1248
+ * ```tsx
1249
+ * // Count badge
1250
+ * <Badge content={5} variant="error" />
1251
+ *
1252
+ * // Max count
1253
+ * <Badge content={150} max={99} />
1254
+ *
1255
+ * // Dot indicator
1256
+ * <Badge dot variant="success" />
1257
+ * ```
1258
+ */
1259
+ declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLElement>>;
1260
+ declare global {
1261
+ namespace JSX {
1262
+ interface IntrinsicElements {
1263
+ "ds-badge": BadgeProps & {
1264
+ ref?: React.Ref<HTMLElement>;
1265
+ };
1266
+ }
1267
+ }
1268
+ }
1269
+
1270
+ type TagVariant = "neutral" | "primary" | "secondary" | "success" | "warning" | "error" | "info";
1271
+ type TagSize = "sm" | "md" | "lg";
1272
+ interface TagProps extends HTMLAttributes<HTMLElement> {
1273
+ /**
1274
+ * Color variant.
1275
+ * @default "neutral"
1276
+ */
1277
+ variant?: TagVariant;
1278
+ /**
1279
+ * Size variant - supports responsive object syntax.
1280
+ * @default "md"
1281
+ * @example
1282
+ * ```tsx
1283
+ * // Single value
1284
+ * <Tag size="md">React</Tag>
1285
+ *
1286
+ * // Responsive
1287
+ * <Tag size={{ base: "sm", md: "md" }}>React</Tag>
1288
+ * ```
1289
+ */
1290
+ size?: ResponsiveProp<TagSize>;
1291
+ /**
1292
+ * Use solid (filled) style instead of subtle.
1293
+ * @default false
1294
+ */
1295
+ solid?: boolean;
1296
+ /**
1297
+ * Show remove button.
1298
+ * @default false
1299
+ */
1300
+ removable?: boolean;
1301
+ /**
1302
+ * Make tag clickable/interactive.
1303
+ * @default false
1304
+ */
1305
+ clickable?: boolean;
1306
+ /**
1307
+ * Disable the tag.
1308
+ * @default false
1309
+ */
1310
+ disabled?: boolean;
1311
+ /**
1312
+ * Value for identification in events.
1313
+ */
1314
+ value?: string;
1315
+ /**
1316
+ * Callback when remove button is clicked.
1317
+ */
1318
+ onRemove?: (value: string) => void;
1319
+ /**
1320
+ * Tag content.
1321
+ */
1322
+ children?: ReactNode;
1323
+ }
1324
+ /**
1325
+ * Tag component for categorization with optional remove action.
1326
+ *
1327
+ * @example
1328
+ * ```tsx
1329
+ * // Basic tag
1330
+ * <Tag variant="primary">React</Tag>
1331
+ *
1332
+ * // Removable tag
1333
+ * <Tag removable onRemove={(value) => console.log('Removed:', value)} value="react">
1334
+ * React
1335
+ * </Tag>
1336
+ *
1337
+ * // Clickable tag
1338
+ * <Tag clickable onClick={() => console.log('Clicked')}>
1339
+ * Click me
1340
+ * </Tag>
1341
+ * ```
1342
+ */
1343
+ declare const Tag: react.ForwardRefExoticComponent<TagProps & react.RefAttributes<HTMLElement>>;
1344
+ declare global {
1345
+ namespace JSX {
1346
+ interface IntrinsicElements {
1347
+ "ds-tag": TagProps & {
1348
+ ref?: React.Ref<HTMLElement>;
1349
+ "onDs-remove"?: (event: CustomEvent) => void;
1350
+ "onDs-click"?: (event: CustomEvent) => void;
1351
+ };
1352
+ }
1353
+ }
1354
+ }
1355
+
1356
+ interface TreeItemProps extends Omit<HTMLAttributes<HTMLElement>, "onSelect"> {
1357
+ /**
1358
+ * Unique item ID.
1359
+ */
1360
+ itemId?: string;
1361
+ /**
1362
+ * Whether item is expanded.
1363
+ * @default false
1364
+ */
1365
+ expanded?: boolean;
1366
+ /**
1367
+ * Whether item is selected.
1368
+ * @default false
1369
+ */
1370
+ selected?: boolean;
1371
+ /**
1372
+ * Whether item is disabled.
1373
+ * @default false
1374
+ */
1375
+ disabled?: boolean;
1376
+ /**
1377
+ * Callback when expand state changes.
1378
+ */
1379
+ onExpand?: (itemId: string, expanded: boolean) => void;
1380
+ /**
1381
+ * Callback when item is selected.
1382
+ */
1383
+ onItemSelect?: (itemId: string, selected: boolean) => void;
1384
+ /**
1385
+ * Callback when item is activated (Enter/double-click).
1386
+ */
1387
+ onActivate?: (itemId: string) => void;
1388
+ /**
1389
+ * Item label content.
1390
+ */
1391
+ children?: ReactNode;
1392
+ }
1393
+ /**
1394
+ * Tree item component for hierarchical nodes.
1395
+ */
1396
+ declare const TreeItem: react.ForwardRefExoticComponent<TreeItemProps & react.RefAttributes<HTMLElement>>;
1397
+
1398
+ type TreeSelectionMode = "single" | "multiple" | "none";
1399
+ type TreeSize = "default" | "compact";
1400
+ interface TreeRootProps extends HTMLAttributes<HTMLElement> {
1401
+ /**
1402
+ * Selection mode.
1403
+ * @default "single"
1404
+ */
1405
+ selectionMode?: TreeSelectionMode;
1406
+ /**
1407
+ * Size variant.
1408
+ * @default "default"
1409
+ */
1410
+ size?: TreeSize;
1411
+ /**
1412
+ * Show connecting lines.
1413
+ * @default false
1414
+ */
1415
+ lines?: boolean;
1416
+ /**
1417
+ * Accessible label.
1418
+ * @default "Tree"
1419
+ */
1420
+ label?: string;
1421
+ /**
1422
+ * Whether the tree is in a loading state.
1423
+ * When true, sets aria-busy and disables keyboard navigation.
1424
+ * @default false
1425
+ */
1426
+ loading?: boolean;
1427
+ /**
1428
+ * Text to display/announce during loading.
1429
+ * @default "Loading..."
1430
+ */
1431
+ loadingText?: string;
1432
+ /**
1433
+ * Node IDs that are currently loading children.
1434
+ * Allows for node-level loading indicators.
1435
+ */
1436
+ loadingNodes?: string[];
1437
+ /**
1438
+ * Callback when selection changes.
1439
+ */
1440
+ onSelectionChange?: (selectedItems: string[]) => void;
1441
+ /**
1442
+ * Tree content (TreeItem elements).
1443
+ */
1444
+ children?: ReactNode;
1445
+ }
1446
+
1447
+ /**
1448
+ * Tree compound component for hierarchical data display.
1449
+ *
1450
+ * @example
1451
+ * ```tsx
1452
+ * <Tree selectionMode="single" onSelectionChange={(ids) => console.log(ids)}>
1453
+ * <Tree.Item itemId="1">
1454
+ * Documents
1455
+ * <div slot="children">
1456
+ * <Tree.Item itemId="1-1">Work</Tree.Item>
1457
+ * <Tree.Item itemId="1-2">Personal</Tree.Item>
1458
+ * </div>
1459
+ * </Tree.Item>
1460
+ * <Tree.Item itemId="2">Pictures</Tree.Item>
1461
+ * </Tree>
1462
+ * ```
1463
+ */
1464
+ declare const Tree: react.ForwardRefExoticComponent<TreeRootProps & react.RefAttributes<HTMLElement>> & {
1465
+ Item: react.ForwardRefExoticComponent<TreeItemProps & react.RefAttributes<HTMLElement>>;
1466
+ };
1467
+
1468
+ declare global {
1469
+ namespace JSX {
1470
+ interface IntrinsicElements {
1471
+ "ds-tree": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1472
+ ref?: React.Ref<HTMLElement>;
1473
+ "selection-mode"?: string;
1474
+ size?: string;
1475
+ lines?: boolean;
1476
+ label?: string;
1477
+ "onDs-selection-change"?: (event: CustomEvent) => void;
1478
+ };
1479
+ "ds-tree-item": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1480
+ ref?: React.Ref<HTMLElement>;
1481
+ "item-id"?: string;
1482
+ expanded?: boolean;
1483
+ selected?: boolean;
1484
+ disabled?: boolean;
1485
+ "onDs-expand"?: (event: CustomEvent) => void;
1486
+ "onDs-select"?: (event: CustomEvent) => void;
1487
+ "onDs-activate"?: (event: CustomEvent) => void;
1488
+ };
1489
+ }
1490
+ }
1491
+ }
1492
+
1493
+ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "onSelect"> {
1494
+ /**
1495
+ * Unique item ID.
1496
+ */
1497
+ itemId?: string;
1498
+ /**
1499
+ * Whether item is selected.
1500
+ * @default false
1501
+ */
1502
+ selected?: boolean;
1503
+ /**
1504
+ * Whether item is disabled.
1505
+ * @default false
1506
+ */
1507
+ disabled?: boolean;
1508
+ /**
1509
+ * Value for identification.
1510
+ */
1511
+ value?: string;
1512
+ /**
1513
+ * Callback when item is selected.
1514
+ */
1515
+ onItemSelect?: (itemId: string, value: string, selected: boolean) => void;
1516
+ /**
1517
+ * Callback when item is activated (Enter/double-click).
1518
+ */
1519
+ onActivate?: (itemId: string, value: string) => void;
1520
+ /**
1521
+ * Item content.
1522
+ */
1523
+ children?: ReactNode;
1524
+ }
1525
+ /**
1526
+ * List item component for collection items.
1527
+ */
1528
+ declare const ListItem: react.ForwardRefExoticComponent<ListItemProps & react.RefAttributes<HTMLElement>>;
1529
+
1530
+ type ListSelectionMode = "single" | "multiple" | "none";
1531
+ type ListOrientation = "vertical" | "horizontal";
1532
+ type ListSize = "default" | "compact" | "spacious";
1533
+ interface ListRootProps extends HTMLAttributes<HTMLElement> {
1534
+ /**
1535
+ * Selection mode.
1536
+ * @default "single"
1537
+ */
1538
+ selectionMode?: ListSelectionMode;
1539
+ /**
1540
+ * List orientation.
1541
+ * @default "vertical"
1542
+ */
1543
+ orientation?: ListOrientation;
1544
+ /**
1545
+ * Size variant.
1546
+ * @default "default"
1547
+ */
1548
+ size?: ListSize;
1549
+ /**
1550
+ * Show border around list.
1551
+ * @default false
1552
+ */
1553
+ bordered?: boolean;
1554
+ /**
1555
+ * Accessible label.
1556
+ * @default "List"
1557
+ */
1558
+ label?: string;
1559
+ /**
1560
+ * Callback when selection changes.
1561
+ */
1562
+ onSelectionChange?: (selectedItems: string[]) => void;
1563
+ /**
1564
+ * List content (ListItem elements).
1565
+ */
1566
+ children?: ReactNode;
1567
+ }
1568
+
1569
+ /**
1570
+ * List compound component for collection display.
1571
+ *
1572
+ * @example
1573
+ * ```tsx
1574
+ * <List selectionMode="single" onSelectionChange={(ids) => console.log(ids)}>
1575
+ * <List.Item itemId="1">Item 1</List.Item>
1576
+ * <List.Item itemId="2">Item 2</List.Item>
1577
+ * <List.Item itemId="3" disabled>Item 3 (disabled)</List.Item>
1578
+ * </List>
1579
+ * ```
1580
+ */
1581
+ declare const List: react.ForwardRefExoticComponent<ListRootProps & react.RefAttributes<HTMLElement>> & {
1582
+ Item: react.ForwardRefExoticComponent<ListItemProps & react.RefAttributes<HTMLElement>>;
1583
+ };
1584
+
1585
+ declare global {
1586
+ namespace JSX {
1587
+ interface IntrinsicElements {
1588
+ "ds-list": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1589
+ ref?: React.Ref<HTMLElement>;
1590
+ "selection-mode"?: string;
1591
+ orientation?: string;
1592
+ size?: string;
1593
+ bordered?: boolean;
1594
+ label?: string;
1595
+ "onDs-selection-change"?: (event: CustomEvent) => void;
1596
+ };
1597
+ "ds-list-item": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
1598
+ ref?: React.Ref<HTMLElement>;
1599
+ "item-id"?: string;
1600
+ selected?: boolean;
1601
+ disabled?: boolean;
1602
+ value?: string;
1603
+ "onDs-select"?: (event: CustomEvent) => void;
1604
+ "onDs-activate"?: (event: CustomEvent) => void;
1605
+ };
1606
+ }
1607
+ }
1608
+ }
1609
+
1610
+ type CalendarSize = "default" | "compact";
1611
+ interface CalendarProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
1612
+ /**
1613
+ * Selected date (ISO format: YYYY-MM-DD).
1614
+ */
1615
+ value?: string;
1616
+ /**
1617
+ * Minimum selectable date (ISO format).
1618
+ */
1619
+ min?: string;
1620
+ /**
1621
+ * Maximum selectable date (ISO format).
1622
+ */
1623
+ max?: string;
1624
+ /**
1625
+ * Disabled dates (array of ISO format strings).
1626
+ */
1627
+ disabledDates?: string[];
1628
+ /**
1629
+ * Locale for month/day names.
1630
+ * @default "en-US"
1631
+ */
1632
+ locale?: string;
1633
+ /**
1634
+ * Size variant.
1635
+ * @default "default"
1636
+ */
1637
+ size?: CalendarSize;
1638
+ /**
1639
+ * First day of week (0 = Sunday, 1 = Monday).
1640
+ * @default 0
1641
+ */
1642
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
1643
+ /**
1644
+ * Callback when a date is selected.
1645
+ */
1646
+ onChange?: (value: string, date: Date) => void;
1647
+ /**
1648
+ * Callback when the displayed month changes.
1649
+ */
1650
+ onMonthChange?: (month: number, year: number) => void;
1651
+ }
1652
+ /**
1653
+ * Calendar component for date selection.
1654
+ *
1655
+ * @example
1656
+ * ```tsx
1657
+ * <Calendar
1658
+ * value="2024-01-15"
1659
+ * min="2024-01-01"
1660
+ * max="2024-12-31"
1661
+ * onChange={(value, date) => console.log(value, date)}
1662
+ * />
1663
+ * ```
1664
+ */
1665
+ declare const Calendar: react.ForwardRefExoticComponent<CalendarProps & react.RefAttributes<HTMLElement>>;
1666
+ declare global {
1667
+ namespace JSX {
1668
+ interface IntrinsicElements {
1669
+ "ds-calendar": CalendarProps & {
1670
+ ref?: React.Ref<HTMLElement>;
1671
+ "disabled-dates"?: string;
1672
+ "first-day-of-week"?: number;
1673
+ "onDs-change"?: (event: CustomEvent) => void;
1674
+ "onDs-month-change"?: (event: CustomEvent) => void;
1675
+ };
1676
+ }
1677
+ }
1678
+ }
1679
+
1680
+ type DataTableSortDirection = "asc" | "desc" | "none";
1681
+ interface DataTableColumn {
1682
+ id: string;
1683
+ header: string;
1684
+ accessor?: string;
1685
+ sortable?: boolean;
1686
+ resizable?: boolean;
1687
+ width?: string;
1688
+ minWidth?: string;
1689
+ maxWidth?: string;
1690
+ align?: "left" | "center" | "right";
1691
+ }
1692
+ interface DataTableSort {
1693
+ column: string;
1694
+ direction: DataTableSortDirection;
1695
+ }
1696
+ interface DataTablePagination {
1697
+ page: number;
1698
+ pageSize: number;
1699
+ total: number;
1700
+ }
1701
+ interface DataTableProps {
1702
+ /**
1703
+ * Enable virtualization for large datasets.
1704
+ * @default false
1705
+ */
1706
+ virtualized?: boolean;
1707
+ /**
1708
+ * Row height for virtualization (in pixels).
1709
+ * @default 48
1710
+ */
1711
+ rowHeight?: number;
1712
+ /**
1713
+ * Number of overscan rows for virtualization.
1714
+ * @default 5
1715
+ */
1716
+ overscan?: number;
1717
+ /**
1718
+ * Total number of rows (for server-side pagination).
1719
+ * @default 0
1720
+ */
1721
+ totalRows?: number;
1722
+ /**
1723
+ * Current page (1-indexed).
1724
+ * @default 1
1725
+ */
1726
+ page?: number;
1727
+ /**
1728
+ * Page size.
1729
+ * @default 10
1730
+ */
1731
+ pageSize?: number;
1732
+ /**
1733
+ * Available page sizes as comma-separated string.
1734
+ * @default "10,25,50,100"
1735
+ */
1736
+ pageSizes?: string;
1737
+ /**
1738
+ * Enable row selection.
1739
+ * @default false
1740
+ */
1741
+ selectable?: boolean;
1742
+ /**
1743
+ * Selection mode.
1744
+ * @default "multiple"
1745
+ */
1746
+ selectionMode?: "single" | "multiple";
1747
+ /**
1748
+ * Show loading state.
1749
+ * @default false
1750
+ */
1751
+ loading?: boolean;
1752
+ /**
1753
+ * Sort column ID.
1754
+ */
1755
+ sortColumn?: string;
1756
+ /**
1757
+ * Sort direction.
1758
+ * @default "none"
1759
+ */
1760
+ sortDirection?: "asc" | "desc" | "none";
1761
+ /**
1762
+ * Filter/search query.
1763
+ */
1764
+ filter?: string;
1765
+ /**
1766
+ * Empty state message.
1767
+ * @default "No data available"
1768
+ */
1769
+ emptyMessage?: string;
1770
+ /**
1771
+ * Callback when sort changes.
1772
+ */
1773
+ onSort?: (detail: {
1774
+ column: string;
1775
+ direction: "asc" | "desc" | "none";
1776
+ }) => void;
1777
+ /**
1778
+ * Callback when page changes.
1779
+ */
1780
+ onPageChange?: (detail: {
1781
+ page: number;
1782
+ }) => void;
1783
+ /**
1784
+ * Callback when page size changes.
1785
+ */
1786
+ onPageSizeChange?: (detail: {
1787
+ pageSize: number;
1788
+ }) => void;
1789
+ /**
1790
+ * Callback when row selection changes.
1791
+ */
1792
+ onSelectionChange?: (detail: {
1793
+ selectedRows: string[];
1794
+ }) => void;
1795
+ /**
1796
+ * Table content (use Table sub-components).
1797
+ */
1798
+ children?: ReactNode;
1799
+ /**
1800
+ * Additional class name.
1801
+ */
1802
+ className?: string;
1803
+ }
1804
+ /**
1805
+ * DataTable component for displaying large datasets with virtualization,
1806
+ * pagination, sorting, and selection support.
1807
+ *
1808
+ * @example
1809
+ * ```tsx
1810
+ * <DataTable
1811
+ * totalRows={100}
1812
+ * page={1}
1813
+ * pageSize={10}
1814
+ * selectable
1815
+ * onPageChange={(detail) => console.log(detail.page)}
1816
+ * >
1817
+ * <Table>
1818
+ * <TableHeader>...</TableHeader>
1819
+ * <TableBody>...</TableBody>
1820
+ * </Table>
1821
+ * </DataTable>
1822
+ * ```
1823
+ */
1824
+ declare const DataTable: react.ForwardRefExoticComponent<DataTableProps & react.RefAttributes<HTMLElement>>;
1825
+
1826
+ /**
1827
+ * Event normalization utilities for Web Component → React interop.
1828
+ * Handles event bubbling and synthetic event creation.
1829
+ */
1830
+ /**
1831
+ * Creates a wrapped event handler that normalizes Web Component custom events
1832
+ * to work with React's event system.
1833
+ */
1834
+ declare function createEventHandler<T extends SyntheticEvent>(handler: ((event: T) => void) | undefined): ((event: Event) => void) | undefined;
1835
+ /**
1836
+ * Attaches event listeners to a Web Component element.
1837
+ * Returns a cleanup function.
1838
+ */
1839
+ declare function attachEventListeners(element: Element, events: Record<string, ((event: Event) => void) | undefined>): () => void;
1840
+
1841
+ /**
1842
+ * Factory for creating React wrapper components around Web Components.
1843
+ * Handles ref forwarding and property/attribute synchronization.
1844
+ */
1845
+ interface WrapperConfig<P extends Record<string, unknown>> {
1846
+ /** The custom element tag name */
1847
+ tagName: string;
1848
+ /** Properties to sync to the element */
1849
+ properties?: (keyof P)[];
1850
+ /** Event name mappings: React prop name → DOM event name */
1851
+ events?: Record<string, string>;
1852
+ /** Default prop values */
1853
+ defaults?: Partial<P>;
1854
+ }
1855
+ /**
1856
+ * Creates a React wrapper component for a Web Component.
1857
+ * Handles property synchronization and event forwarding.
1858
+ */
1859
+ declare function createComponent<E extends HTMLElement, P extends Record<string, unknown> = Record<string, unknown>>(config: WrapperConfig<P>): react.ForwardRefExoticComponent<react.PropsWithoutRef<P & Omit<any, "ref"> & {
1860
+ children?: React.ReactNode;
1861
+ }> & react.RefAttributes<E>>;
1862
+
1863
+ /**
1864
+ * Composes two event handlers, calling child handler first.
1865
+ * If child handler calls preventDefault(), parent handler is skipped.
1866
+ */
1867
+ declare function composeEventHandlers<E extends SyntheticEvent | Event>(parentHandler?: (event: E) => void, childHandler?: (event: E) => void): (event: E) => void;
1868
+ /**
1869
+ * Merges two className strings, filtering out falsy values.
1870
+ */
1871
+ declare function mergeClassNames(...classNames: (string | undefined | null | false)[]): string;
1872
+ /**
1873
+ * Merges two style objects, with child styles taking precedence.
1874
+ */
1875
+ declare function mergeStyles(parentStyle?: CSSProperties, childStyle?: CSSProperties): CSSProperties | undefined;
1876
+ /**
1877
+ * Merges slot props with child props.
1878
+ * - className: concatenated
1879
+ * - style: merged (child wins conflicts)
1880
+ * - event handlers: composed (both called, child first)
1881
+ * - other props: child wins
1882
+ */
1883
+ declare function mergeProps<T extends Record<string, unknown>>(slotProps: T, childProps: T): T;
1884
+
1885
+ export { useToast as $, type AlignValue as A, type ButtonProps as B, type ClientOnlyProps as C, type DsNavigateEventDetail as D, VisuallyHidden as E, type FocusScopeProps as F, Text as G, Box as H, type InputProps as I, type JustifyValue as J, Slot as K, type LinkProps as L, Portal as M, type NavigateEventHandler as N, FocusScope as O, type PortalProps as P, ClientOnly as Q, type ResponsiveProp as R, type SpinnerProps as S, type TextProps as T, useIsClient as U, type VisuallyHiddenProps as V, type WrapperConfig as W, Alert as X, type AlertProps as Y, type AlertVariant as Z, Toast as _, type ButtonVariant as a, type CalendarProps as a$, type ToastProviderProps as a0, type ToastVariant as a1, type ToastPosition as a2, type ToastState as a3, type ToastAction as a4, type ToastData as a5, type ToastOptions as a6, type UseToastReturn as a7, Progress as a8, type ProgressProps as a9, type SkeletonVariant as aA, type SkeletonSize as aB, type SkeletonWidth as aC, type SkeletonAnimation as aD, Badge as aE, type BadgeProps as aF, type BadgeVariant as aG, type BadgeSize as aH, type BadgePosition as aI, Tag as aJ, type TagProps as aK, type TagVariant as aL, type TagSize as aM, Tree as aN, TreeItem as aO, type TreeRootProps as aP, type TreeSelectionMode as aQ, type TreeSize as aR, type TreeItemProps as aS, List as aT, ListItem as aU, type ListRootProps as aV, type ListSelectionMode as aW, type ListOrientation as aX, type ListSize as aY, type ListItemProps as aZ, Calendar as a_, type ProgressVariant as aa, type ProgressSize as ab, Avatar as ac, AvatarGroup as ad, type AvatarProps as ae, type AvatarSize as af, type AvatarShape as ag, type AvatarStatus as ah, type AvatarGroupProps as ai, Table as aj, TableHeader as ak, TableBody as al, TableRow as am, TableHead as an, TableCell as ao, type TableRootProps as ap, type TableSize as aq, type TableHeaderProps as ar, type TableBodyProps as as, type TableRowProps as at, type TableHeadProps as au, type TableAlign as av, type SortDirection as aw, type TableCellProps as ax, Skeleton as ay, type SkeletonProps as az, type ButtonSize as b, type CalendarSize as b0, DataTable as b1, type DataTableProps as b2, type DataTableColumn as b3, type DataTableSort as b4, type DataTablePagination as b5, type DataTableSortDirection as b6, createEventHandler as b7, attachEventListeners as b8, createComponent as b9, composeEventHandlers as ba, mergeClassNames as bb, mergeStyles as bc, mergeProps as bd, type InputType as c, type InputSize as d, type LinkVariant as e, type IconProps as f, type IconName as g, type IconSize as h, type SpinnerSize as i, type TextSize as j, type TextWeight as k, type TextVariant as l, type BoxProps as m, type SlotProps as n, type FocusScopeRef as o, type DsInputEventDetail as p, type InputValueHandler as q, type SpacingValue as r, type DisplayValue as s, type FlexDirection as t, type AsChildProps as u, Button as v, Input as w, Link as x, Icon as y, Spinner as z };