@clarlabs/ui 0.1.2

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,625 @@
1
+ import { default as default_2 } from 'react';
2
+
3
+ export declare function Accordion({ items, allowMultiple, defaultOpenIds, className }: AccordionProps): default_2.JSX.Element;
4
+
5
+ export declare interface AccordionItemProps {
6
+ id: string;
7
+ title: string;
8
+ content: default_2.ReactNode;
9
+ }
10
+
11
+ export declare interface AccordionProps {
12
+ items: AccordionItemProps[];
13
+ allowMultiple?: boolean;
14
+ defaultOpenIds?: string[];
15
+ className?: string;
16
+ }
17
+
18
+ export declare function Alert({ variant, title, message, dismissible, onDismiss, className }: AlertProps): default_2.JSX.Element;
19
+
20
+ export declare interface AlertProps {
21
+ variant?: AlertVariant;
22
+ title?: string;
23
+ message: string;
24
+ dismissible?: boolean;
25
+ onDismiss?: () => void;
26
+ className?: string;
27
+ }
28
+
29
+ export declare type AlertVariant = 'info' | 'success' | 'warning' | 'error';
30
+
31
+ export declare function Avatar({ src, alt, initials, size, status, className }: AvatarProps): default_2.JSX.Element;
32
+
33
+ export declare interface AvatarProps {
34
+ src?: string;
35
+ alt?: string;
36
+ initials?: string;
37
+ size?: AvatarSize;
38
+ status?: 'online' | 'offline' | 'busy' | 'away';
39
+ className?: string;
40
+ }
41
+
42
+ export declare type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
43
+
44
+ export declare function Badge({ children, variant, size, dot, className }: BadgeProps): default_2.JSX.Element;
45
+
46
+ export declare interface BadgeProps {
47
+ children: default_2.ReactNode;
48
+ variant?: BadgeVariant;
49
+ size?: BadgeSize;
50
+ dot?: boolean;
51
+ className?: string;
52
+ }
53
+
54
+ export declare type BadgeSize = 'sm' | 'md' | 'lg';
55
+
56
+ export declare type BadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
57
+
58
+ export declare interface BreadcrumbItem {
59
+ label: string;
60
+ href?: string;
61
+ onClick?: () => void;
62
+ }
63
+
64
+ export declare function Breadcrumbs({ items, separator, className }: BreadcrumbsProps): default_2.JSX.Element;
65
+
66
+ export declare interface BreadcrumbsProps {
67
+ items: BreadcrumbItem[];
68
+ separator?: string;
69
+ className?: string;
70
+ }
71
+
72
+ export declare function Button({ variant, size, fullWidth, loading, disabled, className, children, ...props }: ButtonProps): default_2.JSX.Element;
73
+
74
+ export declare function ButtonGroup({ children, orientation, fullWidth, className }: ButtonGroupProps): default_2.JSX.Element;
75
+
76
+ export declare type ButtonGroupOrientation = 'horizontal' | 'vertical';
77
+
78
+ export declare interface ButtonGroupProps {
79
+ children: default_2.ReactNode;
80
+ orientation?: ButtonGroupOrientation;
81
+ fullWidth?: boolean;
82
+ className?: string;
83
+ }
84
+
85
+ export declare interface ButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
86
+ variant?: ButtonVariant;
87
+ size?: ButtonSize;
88
+ fullWidth?: boolean;
89
+ loading?: boolean;
90
+ children: default_2.ReactNode;
91
+ }
92
+
93
+ export declare type ButtonSize = 'sm' | 'md' | 'lg';
94
+
95
+ export declare type ButtonVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'outline' | 'ghost';
96
+
97
+ export declare function Card({ children, title, subtitle, footer, image, hoverable, className, onClick }: CardProps): default_2.JSX.Element;
98
+
99
+ export declare interface CardProps {
100
+ children: default_2.ReactNode;
101
+ title?: string;
102
+ subtitle?: string;
103
+ footer?: default_2.ReactNode;
104
+ image?: string;
105
+ hoverable?: boolean;
106
+ className?: string;
107
+ onClick?: () => void;
108
+ }
109
+
110
+ export declare function Checkbox({ label, indeterminate, className, ...props }: CheckboxProps): default_2.JSX.Element;
111
+
112
+ export declare interface CheckboxProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'type'> {
113
+ label?: string;
114
+ indeterminate?: boolean;
115
+ }
116
+
117
+ export declare function Combobox({ options, value: controlledValue, defaultValue, onChange, placeholder, disabled, className, allowCustomValue, filterFunction }: ComboboxProps): default_2.JSX.Element;
118
+
119
+ export declare interface ComboboxOption {
120
+ value: string;
121
+ label: string;
122
+ disabled?: boolean;
123
+ }
124
+
125
+ export declare interface ComboboxProps {
126
+ options: ComboboxOption[];
127
+ value?: string;
128
+ defaultValue?: string;
129
+ onChange?: (value: string) => void;
130
+ placeholder?: string;
131
+ disabled?: boolean;
132
+ className?: string;
133
+ allowCustomValue?: boolean;
134
+ filterFunction?: (option: ComboboxOption, searchTerm: string) => boolean;
135
+ }
136
+
137
+ export declare function Datagrid<T extends Record<string, any>>({ columns, data, onRowClick, striped, hoverable, className }: DatagridProps<T>): default_2.JSX.Element;
138
+
139
+ export declare interface DatagridColumn<T = any> {
140
+ key: string;
141
+ header: string;
142
+ width?: string;
143
+ render?: (value: any, row: T) => default_2.ReactNode;
144
+ }
145
+
146
+ export declare interface DatagridProps<T = any> {
147
+ columns: DatagridColumn<T>[];
148
+ data: T[];
149
+ onRowClick?: (row: T) => void;
150
+ striped?: boolean;
151
+ hoverable?: boolean;
152
+ className?: string;
153
+ }
154
+
155
+ export declare function DatePicker({ value, onChange, minDate, maxDate, className, ...props }: DatePickerProps): default_2.JSX.Element;
156
+
157
+ export declare interface DatePickerProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'onChange'> {
158
+ value?: Date;
159
+ onChange?: (date: Date | null) => void;
160
+ minDate?: Date;
161
+ maxDate?: Date;
162
+ }
163
+
164
+ export declare interface DateRange {
165
+ start: Date | null;
166
+ end: Date | null;
167
+ }
168
+
169
+ export declare function DateRangePicker({ value, onChange, minDate, maxDate, className }: DateRangePickerProps): default_2.JSX.Element;
170
+
171
+ export declare interface DateRangePickerProps {
172
+ value?: DateRange;
173
+ onChange?: (range: DateRange) => void;
174
+ minDate?: Date;
175
+ maxDate?: Date;
176
+ className?: string;
177
+ }
178
+
179
+ export declare function Divider({ orientation, variant, label, className }: DividerProps): default_2.JSX.Element;
180
+
181
+ export declare type DividerOrientation = 'horizontal' | 'vertical';
182
+
183
+ export declare interface DividerProps {
184
+ orientation?: DividerOrientation;
185
+ variant?: DividerVariant;
186
+ label?: string;
187
+ className?: string;
188
+ }
189
+
190
+ export declare type DividerVariant = 'solid' | 'dashed' | 'dotted';
191
+
192
+ export declare function Dropdown({ options, value, onChange, placeholder, disabled, className }: DropdownProps): default_2.JSX.Element;
193
+
194
+ export declare interface DropdownOption {
195
+ label: string;
196
+ value: string;
197
+ disabled?: boolean;
198
+ }
199
+
200
+ export declare interface DropdownProps {
201
+ options: DropdownOption[];
202
+ value?: string;
203
+ onChange?: (value: string) => void;
204
+ placeholder?: string;
205
+ disabled?: boolean;
206
+ className?: string;
207
+ }
208
+
209
+ export declare interface FileItem {
210
+ file: File;
211
+ status: FileStatus;
212
+ progress?: number;
213
+ error?: string;
214
+ }
215
+
216
+ export declare function FilePicker({ accept, multiple, maxSize, disabled, onChange, onUpload, className }: FilePickerProps): default_2.JSX.Element;
217
+
218
+ export declare interface FilePickerProps {
219
+ accept?: string;
220
+ multiple?: boolean;
221
+ maxSize?: number;
222
+ disabled?: boolean;
223
+ onChange?: (files: FileItem[]) => void;
224
+ onUpload?: (file: File) => Promise<void>;
225
+ className?: string;
226
+ }
227
+
228
+ export declare type FileStatus = 'idle' | 'processing' | 'uploaded' | 'failed';
229
+
230
+ export declare function Header({ logo, title, children, actions, sticky, className }: HeaderProps): default_2.JSX.Element;
231
+
232
+ export declare interface HeaderProps {
233
+ logo?: default_2.ReactNode;
234
+ title?: string;
235
+ children?: default_2.ReactNode;
236
+ actions?: default_2.ReactNode;
237
+ sticky?: boolean;
238
+ className?: string;
239
+ }
240
+
241
+ export declare const Input: default_2.ForwardRefExoticComponent<InputProps & default_2.RefAttributes<HTMLInputElement>>;
242
+
243
+ export declare interface InputProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'size'> {
244
+ label?: string;
245
+ error?: string;
246
+ helperText?: string;
247
+ size?: InputSize;
248
+ variant?: InputVariant;
249
+ icon?: default_2.ReactNode;
250
+ fullWidth?: boolean;
251
+ }
252
+
253
+ export declare type InputSize = 'sm' | 'md' | 'lg';
254
+
255
+ export declare type InputVariant = 'default' | 'error' | 'success';
256
+
257
+ export declare function Label({ size, required, disabled, className, children, ...props }: LabelProps): default_2.JSX.Element;
258
+
259
+ export declare interface LabelProps extends default_2.LabelHTMLAttributes<HTMLLabelElement> {
260
+ size?: LabelSize;
261
+ required?: boolean;
262
+ disabled?: boolean;
263
+ children: default_2.ReactNode;
264
+ }
265
+
266
+ export declare type LabelSize = 'sm' | 'md' | 'lg';
267
+
268
+ export declare function List({ items, hoverable, dividers, className }: ListProps): default_2.JSX.Element;
269
+
270
+ export declare interface ListItem {
271
+ id: string;
272
+ content: default_2.ReactNode;
273
+ icon?: default_2.ReactNode;
274
+ badge?: default_2.ReactNode;
275
+ disabled?: boolean;
276
+ onClick?: () => void;
277
+ }
278
+
279
+ export declare interface ListProps {
280
+ items: ListItem[];
281
+ hoverable?: boolean;
282
+ dividers?: boolean;
283
+ className?: string;
284
+ }
285
+
286
+ export declare function Modal({ isOpen, onClose, title, children, footer, size, closeOnOverlayClick, showCloseButton, className }: ModalProps): default_2.JSX.Element | null;
287
+
288
+ export declare interface ModalProps {
289
+ isOpen: boolean;
290
+ onClose: () => void;
291
+ title?: string;
292
+ children: default_2.ReactNode;
293
+ footer?: default_2.ReactNode;
294
+ size?: ModalSize;
295
+ closeOnOverlayClick?: boolean;
296
+ showCloseButton?: boolean;
297
+ className?: string;
298
+ }
299
+
300
+ export declare type ModalSize = 'sm' | 'md' | 'lg' | 'xl';
301
+
302
+ export declare interface NavItem {
303
+ id: string;
304
+ label: string;
305
+ icon?: default_2.ReactNode;
306
+ href?: string;
307
+ onClick?: () => void;
308
+ children?: NavItem[];
309
+ disabled?: boolean;
310
+ badge?: default_2.ReactNode;
311
+ megaMenu?: boolean;
312
+ }
313
+
314
+ export declare type NavOrientation = 'vertical' | 'horizontal';
315
+
316
+ export declare function Pagination({ currentPage, totalPages, onPageChange, showFirstLast, siblingCount, className }: PaginationProps): default_2.JSX.Element;
317
+
318
+ export declare interface PaginationProps {
319
+ currentPage: number;
320
+ totalPages: number;
321
+ onPageChange: (page: number) => void;
322
+ showFirstLast?: boolean;
323
+ siblingCount?: number;
324
+ className?: string;
325
+ }
326
+
327
+ export declare function ProgressBar({ value, max, variant, size, showLabel, label, animated, striped, className }: ProgressBarProps): default_2.JSX.Element;
328
+
329
+ export declare interface ProgressBarProps {
330
+ value: number;
331
+ max?: number;
332
+ variant?: ProgressBarVariant;
333
+ size?: ProgressBarSize;
334
+ showLabel?: boolean;
335
+ label?: string;
336
+ animated?: boolean;
337
+ striped?: boolean;
338
+ className?: string;
339
+ }
340
+
341
+ export declare type ProgressBarSize = 'sm' | 'md' | 'lg';
342
+
343
+ export declare type ProgressBarVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
344
+
345
+ export declare function RadioButton({ label, value, name, checked, disabled, onChange, className, ...props }: RadioButtonProps): default_2.JSX.Element;
346
+
347
+ export declare interface RadioButtonProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'type'> {
348
+ label?: string;
349
+ value: string;
350
+ name: string;
351
+ checked?: boolean;
352
+ disabled?: boolean;
353
+ onChange?: (event: default_2.ChangeEvent<HTMLInputElement>) => void;
354
+ }
355
+
356
+ export declare function RangeInput({ label, min, max, step, value, showValue, showMinMax, onChange, className, disabled, ...props }: RangeInputProps): default_2.JSX.Element;
357
+
358
+ export declare interface RangeInputProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'type'> {
359
+ label?: string;
360
+ min?: number;
361
+ max?: number;
362
+ step?: number;
363
+ value?: number;
364
+ showValue?: boolean;
365
+ showMinMax?: boolean;
366
+ onChange?: (event: default_2.ChangeEvent<HTMLInputElement>) => void;
367
+ }
368
+
369
+ export declare function RichSelect({ options, value, onChange, placeholder, disabled, searchable, className }: RichSelectProps): default_2.JSX.Element;
370
+
371
+ export declare interface RichSelectOption {
372
+ label: string;
373
+ value: string;
374
+ description?: string;
375
+ icon?: default_2.ReactNode;
376
+ disabled?: boolean;
377
+ }
378
+
379
+ export declare interface RichSelectProps {
380
+ options: RichSelectOption[];
381
+ value?: string;
382
+ onChange?: (value: string) => void;
383
+ placeholder?: string;
384
+ disabled?: boolean;
385
+ searchable?: boolean;
386
+ className?: string;
387
+ }
388
+
389
+ export declare function SidePanel({ isOpen, onClose, title, children, footer, position, size, closeOnOverlayClick, showCloseButton, className }: SidePanelProps): default_2.JSX.Element | null;
390
+
391
+ export declare type SidePanelPosition = 'left' | 'right';
392
+
393
+ export declare interface SidePanelProps {
394
+ isOpen: boolean;
395
+ onClose: () => void;
396
+ title?: string;
397
+ children: default_2.ReactNode;
398
+ footer?: default_2.ReactNode;
399
+ position?: SidePanelPosition;
400
+ size?: SidePanelSize;
401
+ closeOnOverlayClick?: boolean;
402
+ showCloseButton?: boolean;
403
+ className?: string;
404
+ }
405
+
406
+ export declare type SidePanelSize = 'sm' | 'md' | 'lg';
407
+
408
+ export declare function Signpost({ trigger, children, position, className }: SignpostProps): default_2.JSX.Element;
409
+
410
+ export declare type SignpostPosition = 'top' | 'bottom' | 'left' | 'right';
411
+
412
+ export declare interface SignpostProps {
413
+ trigger: default_2.ReactNode;
414
+ children: default_2.ReactNode;
415
+ position?: SignpostPosition;
416
+ className?: string;
417
+ }
418
+
419
+ export declare function Spinner({ size, variant, className, label }: SpinnerProps): default_2.JSX.Element;
420
+
421
+ export declare interface SpinnerProps {
422
+ size?: SpinnerSize;
423
+ variant?: SpinnerVariant;
424
+ className?: string;
425
+ label?: string;
426
+ }
427
+
428
+ export declare type SpinnerSize = 'sm' | 'md' | 'lg';
429
+
430
+ export declare type SpinnerVariant = 'default' | 'primary' | 'secondary';
431
+
432
+ export declare function StackView({ children, direction, align, justify, spacing, wrap, className, style }: StackViewProps): default_2.JSX.Element;
433
+
434
+ export declare type StackViewAlign = 'start' | 'center' | 'end' | 'stretch';
435
+
436
+ export declare type StackViewDirection = 'horizontal' | 'vertical';
437
+
438
+ export declare type StackViewJustify = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
439
+
440
+ export declare interface StackViewProps {
441
+ children: default_2.ReactNode;
442
+ direction?: StackViewDirection;
443
+ align?: StackViewAlign;
444
+ justify?: StackViewJustify;
445
+ spacing?: StackViewSpacing;
446
+ wrap?: boolean;
447
+ className?: string;
448
+ style?: default_2.CSSProperties;
449
+ }
450
+
451
+ export declare type StackViewSpacing = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
452
+
453
+ export declare function Stepper({ steps, currentStep, orientation, onStepClick, className }: StepperProps): default_2.JSX.Element;
454
+
455
+ export declare type StepperOrientation = 'horizontal' | 'vertical';
456
+
457
+ export declare interface StepperProps {
458
+ steps: StepperStep[];
459
+ currentStep: number;
460
+ orientation?: StepperOrientation;
461
+ onStepClick?: (index: number) => void;
462
+ className?: string;
463
+ }
464
+
465
+ export declare interface StepperStep {
466
+ label: string;
467
+ description?: string;
468
+ icon?: default_2.ReactNode;
469
+ }
470
+
471
+ export declare interface TabItem {
472
+ id: string;
473
+ label: string;
474
+ content: default_2.ReactNode;
475
+ disabled?: boolean;
476
+ icon?: default_2.ReactNode;
477
+ }
478
+
479
+ export declare function Table<T = any>({ columns, data, striped, hoverable, bordered, compact, onRowClick, className }: TableProps<T>): default_2.JSX.Element;
480
+
481
+ export declare interface TableColumn<T = any> {
482
+ key: string;
483
+ header: string;
484
+ width?: string;
485
+ render?: (value: any, row: T) => default_2.ReactNode;
486
+ }
487
+
488
+ export declare interface TableProps<T = any> {
489
+ columns: TableColumn<T>[];
490
+ data: T[];
491
+ striped?: boolean;
492
+ hoverable?: boolean;
493
+ bordered?: boolean;
494
+ compact?: boolean;
495
+ onRowClick?: (row: T) => void;
496
+ className?: string;
497
+ }
498
+
499
+ export declare function Tabs({ items, defaultActiveId, variant, fullWidth, onChange, className }: TabsProps): default_2.JSX.Element;
500
+
501
+ export declare interface TabsProps {
502
+ items: TabItem[];
503
+ defaultActiveId?: string;
504
+ variant?: TabsVariant;
505
+ fullWidth?: boolean;
506
+ onChange?: (id: string) => void;
507
+ className?: string;
508
+ }
509
+
510
+ export declare type TabsVariant = 'default' | 'pills' | 'underline';
511
+
512
+ export declare const Textarea: default_2.ForwardRefExoticComponent<TextareaProps & default_2.RefAttributes<HTMLTextAreaElement>>;
513
+
514
+ export declare interface TextareaProps extends default_2.TextareaHTMLAttributes<HTMLTextAreaElement> {
515
+ label?: string;
516
+ helperText?: string;
517
+ error?: string;
518
+ size?: TextareaSize;
519
+ variant?: TextareaVariant;
520
+ fullWidth?: boolean;
521
+ resize?: 'none' | 'vertical' | 'horizontal' | 'both';
522
+ }
523
+
524
+ export declare type TextareaSize = 'sm' | 'md' | 'lg';
525
+
526
+ export declare type TextareaVariant = 'default' | 'success' | 'error';
527
+
528
+ export declare function Timeline({ items, orientation, className }: TimelineProps): default_2.JSX.Element;
529
+
530
+ export declare interface TimelineItem {
531
+ id: string;
532
+ title: string;
533
+ description?: string;
534
+ date?: string;
535
+ icon?: default_2.ReactNode;
536
+ color?: 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
537
+ }
538
+
539
+ export declare type TimelineOrientation = 'vertical' | 'horizontal';
540
+
541
+ export declare interface TimelineProps {
542
+ items: TimelineItem[];
543
+ orientation?: TimelineOrientation;
544
+ className?: string;
545
+ }
546
+
547
+ declare interface ToastContextValue {
548
+ showToast: (message: string, options?: ToastOptions) => void;
549
+ }
550
+
551
+ export declare interface ToastOptions {
552
+ variant?: ToastVariant;
553
+ duration?: number;
554
+ dismissible?: boolean;
555
+ }
556
+
557
+ export declare type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
558
+
559
+ export declare function ToastProvider({ children, position, maxToasts }: ToastProviderProps): default_2.JSX.Element;
560
+
561
+ export declare interface ToastProviderProps {
562
+ children: default_2.ReactNode;
563
+ position?: ToastPosition;
564
+ maxToasts?: number;
565
+ }
566
+
567
+ export declare type ToastVariant = 'info' | 'success' | 'warning' | 'error';
568
+
569
+ export declare function ToggleSwitch({ checked, defaultChecked, onChange, label, disabled, size, className }: ToggleSwitchProps): default_2.JSX.Element;
570
+
571
+ export declare interface ToggleSwitchProps {
572
+ checked?: boolean;
573
+ defaultChecked?: boolean;
574
+ onChange?: (checked: boolean) => void;
575
+ label?: string;
576
+ disabled?: boolean;
577
+ size?: ToggleSwitchSize;
578
+ className?: string;
579
+ }
580
+
581
+ export declare type ToggleSwitchSize = 'sm' | 'md' | 'lg';
582
+
583
+ export declare function Tooltip({ children, content, position, delay, className }: TooltipProps): default_2.JSX.Element;
584
+
585
+ export declare type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
586
+
587
+ export declare interface TooltipProps {
588
+ children: default_2.ReactElement;
589
+ content: default_2.ReactNode;
590
+ position?: TooltipPosition;
591
+ delay?: number;
592
+ className?: string;
593
+ }
594
+
595
+ export declare interface TreeNode {
596
+ id: string;
597
+ label: string;
598
+ icon?: default_2.ReactNode;
599
+ children?: TreeNode[];
600
+ disabled?: boolean;
601
+ }
602
+
603
+ export declare function TreeView({ data, defaultExpandedIds, onNodeClick, className }: TreeViewProps): default_2.JSX.Element;
604
+
605
+ export declare interface TreeViewProps {
606
+ data: TreeNode[];
607
+ defaultExpandedIds?: string[];
608
+ onNodeClick?: (node: TreeNode) => void;
609
+ className?: string;
610
+ }
611
+
612
+ export declare function useToast(): ToastContextValue;
613
+
614
+ export declare function VerticalNav({ items, orientation, defaultExpandedIds, onItemClick, className, collapsed }: VerticalNavProps): default_2.JSX.Element;
615
+
616
+ export declare interface VerticalNavProps {
617
+ items: NavItem[];
618
+ orientation?: NavOrientation;
619
+ defaultExpandedIds?: string[];
620
+ onItemClick?: (item: NavItem) => void;
621
+ className?: string;
622
+ collapsed?: boolean;
623
+ }
624
+
625
+ export { }