@yomologic/react-ui 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts DELETED
@@ -1,994 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { ClassValue } from 'clsx';
4
-
5
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
- variant?: "primary" | "secondary" | "outline" | "ghost" | "info" | "success" | "warning" | "error";
7
- size?: "xs" | "sm" | "md" | "lg" | "xl";
8
- isLoading?: boolean;
9
- leftIcon?: React.ReactNode;
10
- rightIcon?: React.ReactNode;
11
- }
12
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
-
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;
44
- label?: string;
45
- error?: string;
46
- helperText?: string;
47
- leftIcon?: React.ReactNode;
48
- rightIcon?: React.ReactNode;
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
- };
67
- }
68
- declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
69
-
70
- interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
71
- variant?: "default" | "bordered" | "elevated";
72
- padding?: "none" | "sm" | "md" | "lg";
73
- hoverable?: boolean;
74
- }
75
- declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
76
- declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
77
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
78
- declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
79
- declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
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>>;
97
-
98
- interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
99
- variant?: "default" | "info" | "success" | "warning" | "error";
100
- size?: "xs" | "sm" | "md" | "lg" | "xl";
101
- leftIcon?: React.ReactNode;
102
- rightIcon?: React.ReactNode;
103
- }
104
- declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
105
-
106
- interface CheckboxProps {
107
- label?: string;
108
- name?: string;
109
- checked?: boolean;
110
- onChange?: (checked: boolean) => void;
111
- disabled?: boolean;
112
- className?: string;
113
- id?: string;
114
- size?: "xs" | "sm" | "md" | "lg" | "xl";
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;
124
- interface CheckboxOption {
125
- value: string;
126
- label: string;
127
- disabled?: boolean;
128
- }
129
- interface CheckboxGroupProps {
130
- label?: string;
131
- name: string;
132
- options: CheckboxOption[];
133
- value?: string[];
134
- onChange?: (value: string[]) => void;
135
- className?: string;
136
- orientation?: "vertical" | "horizontal";
137
- required?: boolean;
138
- disabled?: boolean;
139
- size?: "xs" | "sm" | "md" | "lg" | "xl";
140
- error?: string;
141
- helperText?: string;
142
- validate?: ValidationFunction;
143
- }
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;
145
-
146
- interface RadioOption {
147
- value: string;
148
- label: string;
149
- disabled?: boolean;
150
- }
151
- interface RadioGroupProps {
152
- label?: string;
153
- name: string;
154
- options: RadioOption[];
155
- value?: string;
156
- onChange?: (value: string) => void;
157
- className?: string;
158
- orientation?: "vertical" | "horizontal";
159
- required?: boolean;
160
- disabled?: boolean;
161
- size?: "xs" | "sm" | "md" | "lg" | "xl";
162
- error?: string;
163
- helperText?: string;
164
- errorMessage?: string;
165
- validate?: ValidationFunction;
166
- }
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;
168
-
169
- interface SelectOption {
170
- value: string | number;
171
- label: string;
172
- disabled?: boolean;
173
- }
174
- interface SelectProps {
175
- /**
176
- * Field name - required when used inside Form
177
- */
178
- name?: string;
179
- /**
180
- * Label text displayed above the select
181
- */
182
- label?: string;
183
- /**
184
- * Placeholder text when no option is selected
185
- */
186
- placeholder?: string;
187
- /**
188
- * Array of options for the select
189
- */
190
- options?: SelectOption[];
191
- /**
192
- * Current selected value
193
- */
194
- value?: string | number;
195
- /**
196
- * Callback when selection changes
197
- */
198
- onChange?: (value: string | number) => void;
199
- /**
200
- * Custom content to render in the select menu (overrides options)
201
- */
202
- children?: ReactNode;
203
- /**
204
- * Disable the select
205
- */
206
- disabled?: boolean;
207
- /**
208
- * Error message to display
209
- */
210
- error?: string;
211
- /**
212
- * Helper text to display below the select
213
- */
214
- helperText?: string;
215
- /**
216
- * Mark the field as required
217
- */
218
- required?: boolean;
219
- /**
220
- * Size of the select
221
- */
222
- size?: "xs" | "sm" | "md" | "lg" | "xl";
223
- /**
224
- * Additional CSS classes
225
- */
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;
389
- }
390
- declare function FormHelperText({ children, error, className, }: FormHelperTextProps): react_jsx_runtime.JSX.Element;
391
-
392
- interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
393
- size?: "sm" | "md" | "lg" | "xl";
394
- color?: "primary" | "secondary" | "white";
395
- label?: string;
396
- }
397
- declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLDivElement>>;
398
-
399
- interface CodeSnippetProps {
400
- code: string;
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;
611
- }
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>>;
633
-
634
- interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
635
- variant?: "info" | "success" | "warning" | "error";
636
- title?: string;
637
- dismissible?: boolean;
638
- onDismiss?: () => void;
639
- icon?: React.ReactNode;
640
- }
641
- declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
642
-
643
- interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
644
- maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
645
- centered?: boolean;
646
- padding?: boolean;
647
- }
648
- declare const Container: React.ForwardRefExoticComponent<ContainerProps & React.RefAttributes<HTMLDivElement>>;
649
-
650
- interface SectionLayoutProps {
651
- children: React.ReactNode;
652
- hasStickyPreview?: boolean;
653
- }
654
- /**
655
- * SectionLayout - Wrapper component for showcase sections
656
- *
657
- * @param hasStickyPreview - When true, expects the first child to be a sticky preview section
658
- * that stays at the top while the rest of the content scrolls
659
- */
660
- declare function SectionLayout({ children, hasStickyPreview, }: SectionLayoutProps): react_jsx_runtime.JSX.Element | null;
661
-
662
- interface NavItem$2 {
663
- id: string;
664
- label?: string;
665
- type?: "link" | "button" | "dropdown" | "divider" | "custom";
666
- href?: string;
667
- onClick?: () => void;
668
- icon?: React.ReactNode;
669
- badge?: string | number;
670
- disabled?: boolean;
671
- target?: "_blank" | "_self";
672
- children?: NavItem$2[];
673
- render?: () => React.ReactNode;
674
- }
675
- interface NavProps extends React.HTMLAttributes<HTMLElement> {
676
- items: NavItem$2[];
677
- variant?: "primary" | "secondary" | "ghost";
678
- orientation?: "horizontal" | "vertical";
679
- size?: "xs" | "sm" | "md" | "lg" | "xl";
680
- mobileBreakpoint?: "sm" | "md" | "lg";
681
- mobileMenuDirection?: "top" | "left" | "right";
682
- logo?: React.ReactNode;
683
- actions?: React.ReactNode;
684
- sticky?: boolean;
685
- activeId?: string;
686
- onItemClick?: (item: NavItem$2) => void;
687
- }
688
- declare const Nav: React.ForwardRefExoticComponent<NavProps & React.RefAttributes<HTMLElement>>;
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
-
722
- interface NavItem {
723
- id: string;
724
- label: string;
725
- icon?: React.ReactNode;
726
- }
727
- interface NavSection {
728
- title: string;
729
- items: NavItem[];
730
- }
731
- interface SidebarNavProps {
732
- title: string;
733
- subtitle?: string;
734
- items?: NavItem[];
735
- sections?: NavSection[];
736
- activeItem: string;
737
- onItemClick: (itemId: string) => void;
738
- footer?: React.ReactNode;
739
- position?: "left" | "right";
740
- }
741
- declare function SidebarNav({ title, subtitle, items, sections, activeItem, onItemClick, footer, position, }: SidebarNavProps): react_jsx_runtime.JSX.Element;
742
-
743
- interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
744
- icon?: React.ReactNode;
745
- title: string;
746
- description?: string;
747
- action?: React.ReactNode;
748
- }
749
- declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
750
-
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>;
759
- }
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;
776
- }
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;
796
- };
797
- showcase: {
798
- bg: string;
799
- surface: string;
800
- "surface-elevated": string;
801
- "text-primary": string;
802
- "text-secondary": string;
803
- border: string;
804
- };
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;
823
- };
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;
845
- };
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
- };
883
- };
884
- };
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;
900
- };
901
- showcase: {
902
- bg: string;
903
- surface: string;
904
- "surface-elevated": string;
905
- "text-primary": string;
906
- "text-secondary": string;
907
- border: string;
908
- };
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;
927
- };
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;
949
- };
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
- };
987
- };
988
- };
989
- };
990
- type ThemeId = keyof typeof themes;
991
-
992
- declare function cn(...inputs: ClassValue[]): string;
993
-
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 };