@yomologic/react-ui 0.2.6 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { ClassValue } from 'clsx';
4
4
 
5
5
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
- variant?: "primary" | "secondary" | "outline" | "ghost" | "danger";
6
+ variant?: "primary" | "secondary" | "outline" | "ghost" | "info" | "success" | "warning" | "error";
7
7
  size?: "xs" | "sm" | "md" | "lg" | "xl";
8
8
  isLoading?: boolean;
9
9
  leftIcon?: React.ReactNode;
@@ -11,13 +11,59 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
11
11
  }
12
12
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
13
 
14
- interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
14
+ interface FormState {
15
+ values: Record<string, any>;
16
+ errors: Record<string, string>;
17
+ touched: Record<string, boolean>;
18
+ isSubmitting: boolean;
19
+ isSubmitted: boolean;
20
+ }
21
+ interface FormContextValue extends FormState {
22
+ registerField: (name: string, validate?: ValidationFunction) => void;
23
+ unregisterField: (name: string) => void;
24
+ setFieldValue: (name: string, value: any) => void;
25
+ setFieldTouched: (name: string, touched: boolean) => void;
26
+ validateField: (name: string, value?: any) => Promise<void>;
27
+ getFieldError: (name: string) => string | undefined;
28
+ shouldShowError: (name: string) => boolean;
29
+ }
30
+ type ValidationFunction = (value: any) => string | undefined | Promise<string | undefined>;
31
+ interface FormProps {
32
+ children: ReactNode;
33
+ onSubmit: (values: Record<string, any>) => void | Promise<void>;
34
+ className?: string;
35
+ spacing?: "none" | "dense" | "normal";
36
+ }
37
+ declare function useFormContext(): FormContextValue;
38
+ declare function useForm(): FormContextValue | null;
39
+ declare function Form({ children, onSubmit, className, spacing, }: FormProps): react_jsx_runtime.JSX.Element;
40
+
41
+ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "pattern"> {
42
+ /** Field name - required when used inside Form */
43
+ name?: string;
15
44
  label?: string;
16
45
  error?: string;
17
46
  helperText?: string;
18
47
  leftIcon?: React.ReactNode;
19
48
  rightIcon?: React.ReactNode;
20
49
  fullWidth?: boolean;
50
+ /** Custom validation function that returns error message or undefined if valid */
51
+ validate?: ValidationFunction;
52
+ /** Callback when validation error changes */
53
+ onValidationError?: (error: string | undefined) => void;
54
+ /** Regex pattern for validation (string or RegExp) */
55
+ pattern?: RegExp | string;
56
+ /** Custom error messages for built-in validations */
57
+ errorMessages?: {
58
+ required?: string;
59
+ minLength?: string;
60
+ maxLength?: string;
61
+ min?: string;
62
+ max?: string;
63
+ pattern?: string;
64
+ email?: string;
65
+ url?: string;
66
+ };
21
67
  }
22
68
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
23
69
 
@@ -32,24 +78,49 @@ declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HT
32
78
  declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
33
79
  declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
34
80
  declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
81
+ interface CardMediaProps extends React.HTMLAttributes<HTMLDivElement> {
82
+ image?: string;
83
+ video?: string;
84
+ component?: "img" | "video" | "div";
85
+ aspectRatio?: "16/9" | "4/3" | "1/1" | "21/9" | string;
86
+ alt?: string;
87
+ }
88
+ declare const CardMedia: React.ForwardRefExoticComponent<CardMediaProps & React.RefAttributes<HTMLDivElement>>;
89
+ interface CardActionsProps extends React.HTMLAttributes<HTMLDivElement> {
90
+ disableSpacing?: boolean;
91
+ }
92
+ declare const CardActions: React.ForwardRefExoticComponent<CardActionsProps & React.RefAttributes<HTMLDivElement>>;
93
+ interface CardActionAreaProps extends React.HTMLAttributes<HTMLDivElement> {
94
+ disabled?: boolean;
95
+ }
96
+ declare const CardActionArea: React.ForwardRefExoticComponent<CardActionAreaProps & React.RefAttributes<HTMLDivElement>>;
35
97
 
36
98
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
37
- variant?: "default" | "primary" | "success" | "warning" | "danger" | "info";
99
+ variant?: "default" | "info" | "success" | "warning" | "error";
38
100
  size?: "xs" | "sm" | "md" | "lg" | "xl";
39
- dot?: boolean;
101
+ leftIcon?: React.ReactNode;
102
+ rightIcon?: React.ReactNode;
40
103
  }
41
104
  declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
42
105
 
43
106
  interface CheckboxProps {
44
107
  label?: string;
108
+ name?: string;
45
109
  checked?: boolean;
46
110
  onChange?: (checked: boolean) => void;
47
111
  disabled?: boolean;
48
112
  className?: string;
49
113
  id?: string;
50
114
  size?: "xs" | "sm" | "md" | "lg" | "xl";
51
- }
52
- declare function Checkbox({ label, checked, onChange, disabled, className, id, size, }: CheckboxProps): react_jsx_runtime.JSX.Element;
115
+ required?: boolean;
116
+ /** Custom validation function that returns error message or undefined if valid */
117
+ validate?: ValidationFunction;
118
+ /** Callback when validation error changes */
119
+ onValidationError?: (error: string | undefined) => void;
120
+ /** Custom error message for required validation */
121
+ errorMessage?: string;
122
+ }
123
+ declare function Checkbox({ label, name, checked: externalChecked, onChange, disabled, className, id, size, required, validate, onValidationError, errorMessage, }: CheckboxProps): react_jsx_runtime.JSX.Element;
53
124
  interface CheckboxOption {
54
125
  value: string;
55
126
  label: string;
@@ -66,8 +137,11 @@ interface CheckboxGroupProps {
66
137
  required?: boolean;
67
138
  disabled?: boolean;
68
139
  size?: "xs" | "sm" | "md" | "lg" | "xl";
140
+ error?: string;
141
+ helperText?: string;
142
+ validate?: ValidationFunction;
69
143
  }
70
- declare function CheckboxGroup({ label, name, options, value, onChange, className, orientation, required, disabled, size, }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
144
+ declare function CheckboxGroup({ label, name, options, value: externalValue, onChange: externalOnChange, className, orientation, required, disabled, size, error: externalError, helperText, validate, }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
71
145
 
72
146
  interface RadioOption {
73
147
  value: string;
@@ -85,17 +159,25 @@ interface RadioGroupProps {
85
159
  required?: boolean;
86
160
  disabled?: boolean;
87
161
  size?: "xs" | "sm" | "md" | "lg" | "xl";
162
+ error?: string;
163
+ helperText?: string;
164
+ errorMessage?: string;
165
+ validate?: ValidationFunction;
88
166
  }
89
- declare function RadioGroup({ label, name, options, value, onChange, className, orientation, required, disabled, size, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
167
+ declare function RadioGroup({ label, name, options, value: externalValue, onChange, className, orientation, required, disabled, size, error, helperText, errorMessage, validate, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
90
168
 
91
- interface DropdownOption {
169
+ interface SelectOption {
92
170
  value: string | number;
93
171
  label: string;
94
172
  disabled?: boolean;
95
173
  }
96
- interface DropdownProps {
174
+ interface SelectProps {
97
175
  /**
98
- * Label text displayed above the dropdown
176
+ * Field name - required when used inside Form
177
+ */
178
+ name?: string;
179
+ /**
180
+ * Label text displayed above the select
99
181
  */
100
182
  label?: string;
101
183
  /**
@@ -103,9 +185,9 @@ interface DropdownProps {
103
185
  */
104
186
  placeholder?: string;
105
187
  /**
106
- * Array of options for the dropdown
188
+ * Array of options for the select
107
189
  */
108
- options?: DropdownOption[];
190
+ options?: SelectOption[];
109
191
  /**
110
192
  * Current selected value
111
193
  */
@@ -115,11 +197,11 @@ interface DropdownProps {
115
197
  */
116
198
  onChange?: (value: string | number) => void;
117
199
  /**
118
- * Custom content to render in the dropdown menu (overrides options)
200
+ * Custom content to render in the select menu (overrides options)
119
201
  */
120
202
  children?: ReactNode;
121
203
  /**
122
- * Disable the dropdown
204
+ * Disable the select
123
205
  */
124
206
  disabled?: boolean;
125
207
  /**
@@ -127,7 +209,7 @@ interface DropdownProps {
127
209
  */
128
210
  error?: string;
129
211
  /**
130
- * Helper text to display below the dropdown
212
+ * Helper text to display below the select
131
213
  */
132
214
  helperText?: string;
133
215
  /**
@@ -135,15 +217,177 @@ interface DropdownProps {
135
217
  */
136
218
  required?: boolean;
137
219
  /**
138
- * Size of the dropdown
220
+ * Size of the select
139
221
  */
140
222
  size?: "xs" | "sm" | "md" | "lg" | "xl";
141
223
  /**
142
224
  * Additional CSS classes
143
225
  */
144
226
  className?: string;
227
+ /**
228
+ * Custom validation function that returns error message or undefined if valid
229
+ */
230
+ validate?: ValidationFunction;
231
+ /**
232
+ * Callback when validation error changes
233
+ */
234
+ onValidationError?: (error: string | undefined) => void;
235
+ /**
236
+ * Custom error message for required validation
237
+ */
238
+ errorMessage?: string;
239
+ }
240
+ declare function Select({ name, label, placeholder, options, value: externalValue, onChange, children, disabled, error, helperText, required, size, className, validate, onValidationError: _onValidationError, errorMessage, }: SelectProps): react_jsx_runtime.JSX.Element;
241
+
242
+ interface FormControlState {
243
+ /** Whether the field has been modified from its initial value */
244
+ isDirty: boolean;
245
+ /** Whether the field has been interacted with (focused) */
246
+ isTouched: boolean;
247
+ /** Whether the field value passes validation */
248
+ isValid: boolean;
249
+ /** Whether the field is required */
250
+ isRequired: boolean;
251
+ /** Whether the field is disabled */
252
+ isDisabled: boolean;
253
+ /** Whether the field is currently being validated */
254
+ isValidating: boolean;
255
+ /** Error message if validation fails */
256
+ error?: string;
257
+ /** Current field value */
258
+ value: any;
259
+ }
260
+ interface FormControlContextValue extends FormControlState {
261
+ /** Unique ID for the field */
262
+ fieldId: string;
263
+ /** Name attribute for the field */
264
+ name?: string;
265
+ /** Register a control (input, select, etc.) with the form control */
266
+ registerControl: (control: HTMLElement) => void;
267
+ /** Unregister a control */
268
+ unregisterControl: (control: HTMLElement) => void;
269
+ /** Update the field value */
270
+ setValue: (value: any) => void;
271
+ /** Mark the field as touched */
272
+ setTouched: (touched: boolean) => void;
273
+ /** Set validation error */
274
+ setError: (error?: string) => void;
275
+ /** Trigger validation */
276
+ validate: () => Promise<boolean>;
277
+ }
278
+ /** Props to inject into child component when using asChild or render props */
279
+ interface FormFieldProps {
280
+ id: string;
281
+ name?: string;
282
+ value: any;
283
+ onChange: (e: any) => void;
284
+ onBlur: () => void;
285
+ disabled?: boolean;
286
+ required?: boolean;
287
+ "aria-invalid"?: boolean;
288
+ "aria-describedby"?: string;
289
+ }
290
+ interface ValidationRule {
291
+ /** Validation function that returns true if valid, false or error message if invalid */
292
+ validate: (value: any, formData?: any) => boolean | string | Promise<boolean | string>;
293
+ /** Error message to display when validation fails */
294
+ message?: string;
295
+ }
296
+ interface FormControlProps {
297
+ /** The name attribute for the form field */
298
+ name?: string;
299
+ /** The default value for the field */
300
+ defaultValue?: any;
301
+ /** Controlled value */
302
+ value?: any;
303
+ /** Callback when value changes */
304
+ onChange?: (value: any) => void;
305
+ /** Callback when field is blurred */
306
+ onBlur?: () => void;
307
+ /** Whether the field is required (shows asterisk in label) */
308
+ required?: boolean;
309
+ /** Whether the field is disabled */
310
+ disabled?: boolean;
311
+ /** Error message to display */
312
+ error?: string;
313
+ /** Helper text to display below the field */
314
+ helperText?: string;
315
+ /** Validation rules */
316
+ validate?: ValidationRule | ValidationRule[] | ((value: any) => boolean | string | Promise<boolean | string>);
317
+ /** Whether to validate on change */
318
+ validateOnChange?: boolean;
319
+ /** Whether to validate on blur */
320
+ validateOnBlur?: boolean;
321
+ /** Label for the field */
322
+ label?: string;
323
+ /** Additional CSS classes */
324
+ className?: string;
325
+ /**
326
+ * Child components - can be:
327
+ * 1. Component that uses useFormControl() hook
328
+ * 2. Render function: (fieldProps) => ReactNode
329
+ * 3. Single child element when using asChild
330
+ */
331
+ children: ReactNode | ((props: FormFieldProps & FormControlState) => ReactNode);
332
+ /**
333
+ * When true, merges props into the child element instead of wrapping
334
+ * Similar to Radix UI's asChild pattern
335
+ */
336
+ asChild?: boolean;
337
+ }
338
+ declare function useFormControlContext(): FormControlContextValue;
339
+ declare function useFormControl(): FormControlContextValue | null;
340
+ /**
341
+ * Hook for creating custom form fields with full FormControl integration
342
+ * Returns field props and state for easy integration
343
+ *
344
+ * @example
345
+ * function CustomInput() {
346
+ * const { fieldProps, state } = useFormField();
347
+ * return (
348
+ * <input
349
+ * {...fieldProps}
350
+ * className={state.error ? 'border-red-500' : 'border-(--color-border)'}
351
+ * />
352
+ * );
353
+ * }
354
+ */
355
+ declare function useFormField(): {
356
+ fieldProps: FormFieldProps;
357
+ state: FormControlState;
358
+ /**
359
+ * Helper to spread all field props at once
360
+ * @example <input {...register()} />
361
+ */
362
+ register: () => FormFieldProps;
363
+ /**
364
+ * Direct access to form control methods
365
+ */
366
+ setValue: (value: any) => void;
367
+ setTouched: (touched: boolean) => void;
368
+ setError: (error?: string) => void;
369
+ validate: () => Promise<boolean>;
370
+ };
371
+ declare function FormControl({ name, defaultValue, value: controlledValue, onChange, onBlur, required, disabled, error: externalError, helperText, validate: validationRules, validateOnChange, validateOnBlur, label, className, children, asChild, }: FormControlProps): react_jsx_runtime.JSX.Element;
372
+ interface FormControlLabelProps {
373
+ /** The control element (checkbox, radio, switch) */
374
+ control: ReactNode;
375
+ /** Label text */
376
+ label: ReactNode;
377
+ /** Whether the control is disabled */
378
+ disabled?: boolean;
379
+ /** Additional CSS classes */
380
+ className?: string;
381
+ /** Label placement */
382
+ labelPlacement?: "start" | "end" | "top" | "bottom";
383
+ }
384
+ declare function FormControlLabel({ control, label, disabled, className, labelPlacement, }: FormControlLabelProps): react_jsx_runtime.JSX.Element;
385
+ interface FormHelperTextProps {
386
+ children: ReactNode;
387
+ error?: boolean;
388
+ className?: string;
145
389
  }
146
- declare function Dropdown({ label, placeholder, options, value, onChange, children, disabled, error, helperText, required, size, className, }: DropdownProps): react_jsx_runtime.JSX.Element;
390
+ declare function FormHelperText({ children, error, className, }: FormHelperTextProps): react_jsx_runtime.JSX.Element;
147
391
 
148
392
  interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
149
393
  size?: "sm" | "md" | "lg" | "xl";
@@ -155,8 +399,237 @@ declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefA
155
399
  interface CodeSnippetProps {
156
400
  code: string;
157
401
  language?: string;
402
+ fontSize?: "small" | "body" | "h6";
403
+ wrap?: boolean;
404
+ }
405
+ declare function CodeSnippet({ code, language, fontSize, wrap, }: CodeSnippetProps): react_jsx_runtime.JSX.Element;
406
+
407
+ interface RatingProps {
408
+ value: number;
409
+ max?: number;
410
+ size?: number;
411
+ color?: string;
412
+ className?: string;
413
+ responsive?: boolean;
414
+ mobileSize?: number;
415
+ interactive?: boolean;
416
+ onChange?: (value: number) => void;
417
+ showValue?: boolean;
418
+ valuePosition?: "inline" | "bottom";
419
+ valueFormat?: "decimal" | "fraction";
420
+ }
421
+ declare const Rating: React.FC<RatingProps>;
422
+
423
+ interface DividerProps {
424
+ /**
425
+ * The variant to use
426
+ * @default "fullWidth"
427
+ */
428
+ variant?: "fullWidth" | "inset" | "middle";
429
+ /**
430
+ * The orientation of the divider
431
+ * @default "horizontal"
432
+ */
433
+ orientation?: "horizontal" | "vertical";
434
+ /**
435
+ * The alignment of the content when children are provided
436
+ * @default "center"
437
+ */
438
+ textAlign?: "left" | "center" | "right";
439
+ /**
440
+ * If true, the divider will have flex item properties when in a flex container
441
+ * @default false
442
+ */
443
+ flexItem?: boolean;
444
+ /**
445
+ * Thickness of the divider line in pixels
446
+ * @default 1
447
+ */
448
+ thickness?: number;
449
+ /**
450
+ * Content to be rendered inside the divider
451
+ */
452
+ children?: React.ReactNode;
453
+ /**
454
+ * Additional CSS classes
455
+ */
456
+ className?: string;
457
+ }
458
+ declare const Divider: React.FC<DividerProps>;
459
+
460
+ interface SliderMark {
461
+ value: number;
462
+ label?: string;
463
+ }
464
+ interface SliderProps {
465
+ /**
466
+ * The value of the slider. For range sliders, provide an array.
467
+ */
468
+ value?: number | number[];
469
+ /**
470
+ * The default value. Use when the component is not controlled.
471
+ */
472
+ defaultValue?: number | number[];
473
+ /**
474
+ * Callback function that is fired when the slider's value changed.
475
+ */
476
+ onChange?: (value: number | number[]) => void;
477
+ /**
478
+ * The minimum allowed value of the slider.
479
+ * @default 0
480
+ */
481
+ min?: number;
482
+ /**
483
+ * The maximum allowed value of the slider.
484
+ * @default 100
485
+ */
486
+ max?: number;
487
+ /**
488
+ * The granularity with which the slider can step through values.
489
+ * Set to null to restrict values to marks only.
490
+ * @default 1
491
+ */
492
+ step?: number | null;
493
+ /**
494
+ * Marks indicate predetermined values to which the user can move the slider.
495
+ * If `true`, marks are generated automatically. If `false`, no marks are shown.
496
+ * You can also provide an array of marks with custom labels.
497
+ * @default false
498
+ */
499
+ marks?: boolean | SliderMark[];
500
+ /**
501
+ * If `true`, the slider will be disabled.
502
+ * @default false
503
+ */
504
+ disabled?: boolean;
505
+ /**
506
+ * The orientation of the slider.
507
+ * @default "horizontal"
508
+ */
509
+ orientation?: "horizontal" | "vertical";
510
+ /**
511
+ * The size of the slider.
512
+ * @default "medium"
513
+ */
514
+ size?: "small" | "medium";
515
+ /**
516
+ * Controls when the value label is displayed.
517
+ * @default "auto"
518
+ */
519
+ valueLabelDisplay?: "on" | "auto" | "off";
520
+ /**
521
+ * Show value labels on hover over marks.
522
+ * @default false
523
+ */
524
+ showMarkLabelsOnHover?: boolean;
525
+ /**
526
+ * The color of the slider.
527
+ * @default "primary"
528
+ */
529
+ color?: "primary" | "secondary";
530
+ /**
531
+ * The track display mode.
532
+ * @default "normal"
533
+ */
534
+ track?: "normal" | "inverted" | false;
535
+ /**
536
+ * A function to format the value label.
537
+ */
538
+ valueLabelFormat?: (value: number) => string;
539
+ /**
540
+ * Additional CSS classes
541
+ */
542
+ className?: string;
543
+ /**
544
+ * The id of the input element.
545
+ */
546
+ id?: string;
547
+ /**
548
+ * The name of the input element.
549
+ */
550
+ name?: string;
551
+ /**
552
+ * Accessible label for the slider.
553
+ */
554
+ "aria-label"?: string;
555
+ /**
556
+ * The id of the element containing a label for the slider.
557
+ */
558
+ "aria-labelledby"?: string;
559
+ }
560
+ declare const Slider: React.FC<SliderProps>;
561
+
562
+ interface SwitchProps {
563
+ /**
564
+ * Whether the switch is checked
565
+ */
566
+ checked?: boolean;
567
+ /**
568
+ * Callback when the switch state changes
569
+ */
570
+ onChange?: (checked: boolean) => void;
571
+ /**
572
+ * Whether the switch is disabled
573
+ */
574
+ disabled?: boolean;
575
+ /**
576
+ * Label text for the switch
577
+ */
578
+ label?: string;
579
+ /**
580
+ * Position of the label relative to the switch
581
+ */
582
+ labelPlacement?: "start" | "end" | "top" | "bottom";
583
+ /**
584
+ * Size of the switch
585
+ */
586
+ size?: "sm" | "md" | "lg";
587
+ /**
588
+ * Color variant of the switch when checked
589
+ */
590
+ color?: "primary" | "success" | "info" | "warning" | "error";
591
+ /**
592
+ * Additional CSS classes
593
+ */
594
+ className?: string;
595
+ /**
596
+ * Name attribute for the input
597
+ */
598
+ name?: string;
599
+ /**
600
+ * Required field indicator
601
+ */
602
+ required?: boolean;
603
+ /**
604
+ * Custom validation function
605
+ */
606
+ validate?: ValidationFunction;
607
+ /**
608
+ * Custom error message for required validation
609
+ */
610
+ errorMessage?: string;
158
611
  }
159
- declare function CodeSnippet({ code, language }: CodeSnippetProps): react_jsx_runtime.JSX.Element;
612
+ declare function Switch({ checked: controlledChecked, onChange, disabled, label, labelPlacement, size, color, className, name, required, validate, errorMessage, }: SwitchProps): react_jsx_runtime.JSX.Element;
613
+
614
+ interface DialogProps {
615
+ open: boolean;
616
+ onClose: () => void;
617
+ size?: "sm" | "md" | "lg" | "xl" | "full";
618
+ variant?: "default" | "info" | "success" | "warning" | "error";
619
+ showCloseButton?: boolean;
620
+ closeOnBackdropClick?: boolean;
621
+ closeOnEscape?: boolean;
622
+ children: React.ReactNode;
623
+ }
624
+ declare const Dialog: {
625
+ ({ open, onClose, size, variant, showCloseButton, closeOnBackdropClick, closeOnEscape, children, }: DialogProps): react_jsx_runtime.JSX.Element | null;
626
+ displayName: string;
627
+ };
628
+ declare const DialogHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
629
+ declare const DialogTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
630
+ declare const DialogDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
631
+ declare const DialogContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
632
+ declare const DialogFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
160
633
 
161
634
  interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
162
635
  variant?: "info" | "success" | "warning" | "error";
@@ -186,7 +659,7 @@ interface SectionLayoutProps {
186
659
  */
187
660
  declare function SectionLayout({ children, hasStickyPreview, }: SectionLayoutProps): react_jsx_runtime.JSX.Element | null;
188
661
 
189
- interface NavItem$1 {
662
+ interface NavItem$2 {
190
663
  id: string;
191
664
  label?: string;
192
665
  type?: "link" | "button" | "dropdown" | "divider" | "custom";
@@ -196,23 +669,56 @@ interface NavItem$1 {
196
669
  badge?: string | number;
197
670
  disabled?: boolean;
198
671
  target?: "_blank" | "_self";
199
- children?: NavItem$1[];
672
+ children?: NavItem$2[];
200
673
  render?: () => React.ReactNode;
201
674
  }
202
675
  interface NavProps extends React.HTMLAttributes<HTMLElement> {
203
- items: NavItem$1[];
204
- variant?: "primary" | "secondary" | "outline" | "ghost";
676
+ items: NavItem$2[];
677
+ variant?: "primary" | "secondary" | "ghost";
205
678
  orientation?: "horizontal" | "vertical";
206
679
  size?: "xs" | "sm" | "md" | "lg" | "xl";
207
680
  mobileBreakpoint?: "sm" | "md" | "lg";
681
+ mobileMenuDirection?: "top" | "left" | "right";
208
682
  logo?: React.ReactNode;
209
683
  actions?: React.ReactNode;
210
684
  sticky?: boolean;
211
685
  activeId?: string;
212
- onItemClick?: (item: NavItem$1) => void;
686
+ onItemClick?: (item: NavItem$2) => void;
213
687
  }
214
688
  declare const Nav: React.ForwardRefExoticComponent<NavProps & React.RefAttributes<HTMLElement>>;
215
689
 
690
+ interface NavItem$1 {
691
+ id: string;
692
+ label: string;
693
+ icon?: React.ReactNode;
694
+ }
695
+ interface NavSection$1 {
696
+ title: string;
697
+ items: NavItem$1[];
698
+ }
699
+ interface DrawerProps {
700
+ title: string;
701
+ subtitle?: string;
702
+ items?: NavItem$1[];
703
+ sections?: NavSection$1[];
704
+ activeItem: string;
705
+ onItemClick: (itemId: string) => void;
706
+ footer?: React.ReactNode;
707
+ position?: "left" | "right";
708
+ homeUrl?: string;
709
+ autoHideOnScroll?: boolean;
710
+ headerActions?: React.ReactNode;
711
+ }
712
+ declare function Drawer({ title, subtitle, items, sections, activeItem, onItemClick, footer, position, homeUrl, autoHideOnScroll, headerActions, }: DrawerProps): react_jsx_runtime.JSX.Element;
713
+
714
+ interface HeaderProps {
715
+ children: React.ReactNode;
716
+ autoHideOnScroll?: boolean;
717
+ className?: string;
718
+ position?: "fixed" | "sticky" | "static";
719
+ }
720
+ declare function Header({ children, autoHideOnScroll, className, position, }: HeaderProps): react_jsx_runtime.JSX.Element;
721
+
216
722
  interface NavItem {
217
723
  id: string;
218
724
  label: string;
@@ -242,319 +748,247 @@ interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
242
748
  }
243
749
  declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
244
750
 
245
- /**
246
- * Theme System Types
247
- *
248
- * This defines the structure for customizable themes that can be
249
- * edited in the Theme Builder and applied across all components.
250
- */
251
- interface ColorShades {
252
- 50?: string;
253
- 100?: string;
254
- 200?: string;
255
- 300?: string;
256
- 400?: string;
257
- 500: string;
258
- 600?: string;
259
- 700?: string;
260
- 800?: string;
261
- 900?: string;
262
- }
263
- interface ThemeColors {
264
- primary: ColorShades;
265
- secondary: ColorShades;
266
- success: string;
267
- error: string;
268
- warning: string;
269
- info: string;
270
- gray: ColorShades;
271
- background: string;
272
- foreground: string;
273
- muted: string;
274
- mutedForeground: string;
275
- }
276
- interface ThemeSpacing {
277
- xs: string;
278
- sm: string;
279
- md: string;
280
- lg: string;
281
- xl: string;
282
- '2xl': string;
283
- }
284
- interface ThemeBorderRadius {
285
- none: string;
286
- sm: string;
287
- md: string;
288
- lg: string;
289
- xl: string;
290
- full: string;
291
- }
292
- interface ThemeTypography {
293
- fontFamily: {
294
- sans: string[];
295
- mono: string[];
296
- };
297
- fontSize: {
298
- xs: string;
299
- sm: string;
300
- base: string;
301
- lg: string;
302
- xl: string;
303
- '2xl': string;
304
- '3xl': string;
305
- };
306
- fontWeight: {
307
- normal: string;
308
- medium: string;
309
- semibold: string;
310
- bold: string;
311
- };
312
- }
313
- interface ButtonTheme {
314
- padding: {
315
- xs: {
316
- x: string;
317
- y: string;
318
- };
319
- sm: {
320
- x: string;
321
- y: string;
322
- };
323
- md: {
324
- x: string;
325
- y: string;
326
- };
327
- lg: {
328
- x: string;
329
- y: string;
330
- };
331
- xl: {
332
- x: string;
333
- y: string;
334
- };
335
- };
336
- fontSize: {
337
- xs: string;
338
- sm: string;
339
- md: string;
340
- lg: string;
341
- xl: string;
342
- };
343
- borderRadius: string;
344
- fontWeight: string;
345
- }
346
- interface CardTheme {
347
- padding: {
348
- none: string;
349
- sm: string;
350
- md: string;
351
- lg: string;
352
- };
353
- borderRadius: string;
354
- borderWidth: string;
355
- shadow: {
356
- flat: string;
357
- elevated: string;
358
- };
751
+ interface Theme {
752
+ name: string;
753
+ id: string;
754
+ colors: Record<string, string>;
755
+ components: Record<string, Record<string, string>>;
756
+ typography?: Record<string, string>;
757
+ showcase?: Record<string, string>;
758
+ semanticColors?: Record<string, string>;
359
759
  }
360
- interface InputTheme {
361
- padding: {
362
- xs: string;
363
- sm: string;
364
- md: string;
365
- lg: string;
366
- xl: string;
367
- };
368
- fontSize: {
369
- xs: string;
370
- sm: string;
371
- md: string;
372
- lg: string;
373
- xl: string;
374
- };
375
- borderRadius: string;
376
- borderWidth: string;
377
- }
378
- interface CheckboxTheme {
379
- size: {
380
- xs: string;
381
- sm: string;
382
- md: string;
383
- lg: string;
384
- xl: string;
385
- };
386
- labelSpacing: {
387
- xs: string;
388
- sm: string;
389
- md: string;
390
- lg: string;
391
- xl: string;
392
- };
393
- labelFontSize: {
394
- xs: string;
395
- sm: string;
396
- md: string;
397
- lg: string;
398
- xl: string;
399
- };
400
- borderRadius: string;
401
- }
402
- interface RadioTheme {
403
- size: {
404
- xs: string;
405
- sm: string;
406
- md: string;
407
- lg: string;
408
- xl: string;
409
- };
410
- labelSpacing: {
411
- xs: string;
412
- sm: string;
413
- md: string;
414
- lg: string;
415
- xl: string;
416
- };
417
- labelFontSize: {
418
- xs: string;
419
- sm: string;
420
- md: string;
421
- lg: string;
422
- xl: string;
423
- };
760
+ interface ThemeContextType {
761
+ currentTheme: string;
762
+ availableThemes: {
763
+ id: string;
764
+ name: string;
765
+ }[];
766
+ setTheme: (themeId: string) => void;
767
+ setCSSVariable: (name: string, value: string) => void;
768
+ getCSSVariable: (name: string) => string;
769
+ exportThemeCSS: () => string;
770
+ }
771
+ interface ThemeProviderProps {
772
+ children: ReactNode;
773
+ defaultTheme?: string;
774
+ customTheme?: Theme;
775
+ storageKey?: string;
424
776
  }
425
- interface DropdownTheme {
426
- padding: {
427
- xs: {
428
- x: string;
429
- y: string;
430
- };
431
- sm: {
432
- x: string;
433
- y: string;
434
- };
435
- md: {
436
- x: string;
437
- y: string;
438
- };
439
- lg: {
440
- x: string;
441
- y: string;
442
- };
443
- xl: {
444
- x: string;
445
- y: string;
446
- };
447
- };
448
- fontSize: {
449
- xs: string;
450
- sm: string;
451
- md: string;
452
- lg: string;
453
- xl: string;
454
- };
455
- iconSize: {
456
- xs: string;
457
- sm: string;
458
- md: string;
459
- lg: string;
460
- xl: string;
461
- };
462
- optionPadding: {
463
- xs: {
464
- x: string;
465
- y: string;
777
+ declare function ThemeProvider({ children, defaultTheme, customTheme, storageKey, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
778
+ declare function useTheme(): ThemeContextType;
779
+
780
+ declare const themes: {
781
+ light: {
782
+ name: string;
783
+ id: string;
784
+ colors: {
785
+ primary: string;
786
+ "primary-hover": string;
787
+ "primary-active": string;
788
+ secondary: string;
789
+ "secondary-hover": string;
790
+ background: string;
791
+ foreground: string;
792
+ muted: string;
793
+ "muted-foreground": string;
794
+ placeholder: string;
795
+ border: string;
466
796
  };
467
- sm: {
468
- x: string;
469
- y: string;
797
+ showcase: {
798
+ bg: string;
799
+ surface: string;
800
+ "surface-elevated": string;
801
+ "text-primary": string;
802
+ "text-secondary": string;
803
+ border: string;
470
804
  };
471
- md: {
472
- x: string;
473
- y: string;
805
+ typography: {
806
+ h1: string;
807
+ "h1-desktop": string;
808
+ h2: string;
809
+ "h2-desktop": string;
810
+ h3: string;
811
+ "h3-desktop": string;
812
+ h4: string;
813
+ "h4-desktop": string;
814
+ h5: string;
815
+ "h5-desktop": string;
816
+ h6: string;
817
+ "h6-desktop": string;
818
+ body: string;
819
+ "body-desktop": string;
820
+ small: string;
821
+ "small-desktop": string;
822
+ caption: string;
474
823
  };
475
- lg: {
476
- x: string;
477
- y: string;
824
+ semanticColors: {
825
+ info: string;
826
+ "info-foreground": string;
827
+ "info-muted": string;
828
+ "info-muted-foreground": string;
829
+ "info-border": string;
830
+ success: string;
831
+ "success-foreground": string;
832
+ "success-muted": string;
833
+ "success-muted-foreground": string;
834
+ "success-border": string;
835
+ warning: string;
836
+ "warning-foreground": string;
837
+ "warning-muted": string;
838
+ "warning-muted-foreground": string;
839
+ "warning-border": string;
840
+ error: string;
841
+ "error-foreground": string;
842
+ "error-muted": string;
843
+ "error-muted-foreground": string;
844
+ "error-border": string;
478
845
  };
479
- xl: {
480
- x: string;
481
- y: string;
846
+ components: {
847
+ checkbox: {
848
+ "border-color": string;
849
+ "checked-color": string;
850
+ "label-color": string;
851
+ "hover-bg": string;
852
+ };
853
+ radio: {
854
+ "border-color": string;
855
+ "checked-color": string;
856
+ "label-color": string;
857
+ "hover-bg": string;
858
+ };
859
+ button: {
860
+ "primary-text": string;
861
+ "secondary-text": string;
862
+ };
863
+ "card-icons": {
864
+ "blue-bg": string;
865
+ "blue-bg-hover": string;
866
+ "blue-text": string;
867
+ "purple-bg": string;
868
+ "purple-bg-hover": string;
869
+ "purple-text": string;
870
+ "green-bg": string;
871
+ "green-bg-hover": string;
872
+ "green-text": string;
873
+ "orange-bg": string;
874
+ "orange-bg-hover": string;
875
+ "orange-text": string;
876
+ "pink-bg": string;
877
+ "pink-bg-hover": string;
878
+ "pink-text": string;
879
+ "indigo-bg": string;
880
+ "indigo-bg-hover": string;
881
+ "indigo-text": string;
882
+ };
482
883
  };
483
884
  };
484
- optionFontSize: {
485
- xs: string;
486
- sm: string;
487
- md: string;
488
- lg: string;
489
- xl: string;
490
- };
491
- borderRadius: string;
492
- borderWidth: string;
493
- }
494
- interface NavTheme {
495
- height: string;
496
- itemPadding: {
497
- xs: {
498
- x: string;
499
- y: string;
885
+ dark: {
886
+ name: string;
887
+ id: string;
888
+ colors: {
889
+ primary: string;
890
+ "primary-hover": string;
891
+ "primary-active": string;
892
+ secondary: string;
893
+ "secondary-hover": string;
894
+ background: string;
895
+ foreground: string;
896
+ muted: string;
897
+ "muted-foreground": string;
898
+ placeholder: string;
899
+ border: string;
500
900
  };
501
- sm: {
502
- x: string;
503
- y: string;
901
+ showcase: {
902
+ bg: string;
903
+ surface: string;
904
+ "surface-elevated": string;
905
+ "text-primary": string;
906
+ "text-secondary": string;
907
+ border: string;
504
908
  };
505
- md: {
506
- x: string;
507
- y: string;
909
+ typography: {
910
+ h1: string;
911
+ "h1-desktop": string;
912
+ h2: string;
913
+ "h2-desktop": string;
914
+ h3: string;
915
+ "h3-desktop": string;
916
+ h4: string;
917
+ "h4-desktop": string;
918
+ h5: string;
919
+ "h5-desktop": string;
920
+ h6: string;
921
+ "h6-desktop": string;
922
+ body: string;
923
+ "body-desktop": string;
924
+ small: string;
925
+ "small-desktop": string;
926
+ caption: string;
508
927
  };
509
- lg: {
510
- x: string;
511
- y: string;
928
+ semanticColors: {
929
+ info: string;
930
+ "info-foreground": string;
931
+ "info-muted": string;
932
+ "info-muted-foreground": string;
933
+ "info-border": string;
934
+ success: string;
935
+ "success-foreground": string;
936
+ "success-muted": string;
937
+ "success-muted-foreground": string;
938
+ "success-border": string;
939
+ warning: string;
940
+ "warning-foreground": string;
941
+ "warning-muted": string;
942
+ "warning-muted-foreground": string;
943
+ "warning-border": string;
944
+ error: string;
945
+ "error-foreground": string;
946
+ "error-muted": string;
947
+ "error-muted-foreground": string;
948
+ "error-border": string;
512
949
  };
513
- xl: {
514
- x: string;
515
- y: string;
950
+ components: {
951
+ checkbox: {
952
+ "border-color": string;
953
+ "checked-color": string;
954
+ "label-color": string;
955
+ "hover-bg": string;
956
+ };
957
+ radio: {
958
+ "border-color": string;
959
+ "checked-color": string;
960
+ "label-color": string;
961
+ "hover-bg": string;
962
+ };
963
+ button: {
964
+ "primary-text": string;
965
+ "secondary-text": string;
966
+ };
967
+ "card-icons": {
968
+ "blue-bg": string;
969
+ "blue-bg-hover": string;
970
+ "blue-text": string;
971
+ "purple-bg": string;
972
+ "purple-bg-hover": string;
973
+ "purple-text": string;
974
+ "green-bg": string;
975
+ "green-bg-hover": string;
976
+ "green-text": string;
977
+ "orange-bg": string;
978
+ "orange-bg-hover": string;
979
+ "orange-text": string;
980
+ "pink-bg": string;
981
+ "pink-bg-hover": string;
982
+ "pink-text": string;
983
+ "indigo-bg": string;
984
+ "indigo-bg-hover": string;
985
+ "indigo-text": string;
986
+ };
516
987
  };
517
988
  };
518
- fontSize: {
519
- xs: string;
520
- sm: string;
521
- md: string;
522
- lg: string;
523
- xl: string;
524
- };
525
- borderRadius: string;
526
- gap: string;
527
- }
528
- interface ComponentThemes {
529
- button: ButtonTheme;
530
- card: CardTheme;
531
- input: InputTheme;
532
- checkbox: CheckboxTheme;
533
- radio: RadioTheme;
534
- dropdown: DropdownTheme;
535
- nav: NavTheme;
536
- }
537
- interface Theme {
538
- name: string;
539
- version: string;
540
- colors: ThemeColors;
541
- spacing: ThemeSpacing;
542
- borderRadius: ThemeBorderRadius;
543
- typography: ThemeTypography;
544
- components: ComponentThemes;
545
- }
546
-
547
- interface ThemeContextType {
548
- theme: Theme;
549
- setTheme: (theme: Theme) => void;
550
- applyTheme: (theme: Theme) => void;
551
- resetTheme: () => void;
552
- }
553
- declare function ThemeProvider({ children }: {
554
- children: ReactNode;
555
- }): react_jsx_runtime.JSX.Element;
556
- declare function useTheme(): ThemeContextType;
989
+ };
990
+ type ThemeId = keyof typeof themes;
557
991
 
558
992
  declare function cn(...inputs: ClassValue[]): string;
559
993
 
560
- export { Alert, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Dropdown, EmptyState, Input, Nav, type NavItem$1 as NavItem, type NavProps, type NavSection, RadioGroup, SectionLayout, SidebarNav, type NavItem as SidebarNavItem, Spinner, type Theme, ThemeProvider, cn, useTheme };
994
+ export { Alert, Badge, Button, Card, CardActionArea, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardMedia, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Divider, Drawer, type NavItem$1 as DrawerNavItem, type NavSection$1 as DrawerNavSection, type DrawerProps, EmptyState, Form, type FormContextValue, FormControl, type FormControlContextValue, FormControlLabel, type FormControlProps, type FormControlState, type FormFieldProps, FormHelperText, type FormState, Header, type HeaderProps, Input, Nav, type NavItem$2 as NavItem, type NavProps, type NavSection, RadioGroup, Rating, SectionLayout, Select, type SelectOption, type SelectProps, SidebarNav, type NavItem as SidebarNavItem, Slider, type SliderMark, type SliderProps, Spinner, Switch, type SwitchProps, type ThemeId, ThemeProvider, type ValidationFunction, type ValidationRule, cn, themes, useForm, useFormContext, useFormControl, useFormControlContext, useFormField, useTheme };