@martinsura/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1192 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as react from 'react';
4
+ import { ComponentType, ReactElement, ReactNode } from 'react';
5
+ import { VariantProps } from 'class-variance-authority';
6
+ import * as _tabler_icons_react from '@tabler/icons-react';
7
+
8
+ declare const defaultIcons: {
9
+ readonly dots: react.ForwardRefExoticComponent<_tabler_icons_react.IconProps & react.RefAttributes<SVGSVGElement>>;
10
+ readonly edit: react.ForwardRefExoticComponent<_tabler_icons_react.IconProps & react.RefAttributes<SVGSVGElement>>;
11
+ readonly create: react.ForwardRefExoticComponent<_tabler_icons_react.IconProps & react.RefAttributes<SVGSVGElement>>;
12
+ readonly delete: react.ForwardRefExoticComponent<_tabler_icons_react.IconProps & react.RefAttributes<SVGSVGElement>>;
13
+ readonly remove: react.ForwardRefExoticComponent<_tabler_icons_react.IconProps & react.RefAttributes<SVGSVGElement>>;
14
+ readonly excel: react.ForwardRefExoticComponent<_tabler_icons_react.IconProps & react.RefAttributes<SVGSVGElement>>;
15
+ readonly file: react.ForwardRefExoticComponent<_tabler_icons_react.IconProps & react.RefAttributes<SVGSVGElement>>;
16
+ readonly download: react.ForwardRefExoticComponent<_tabler_icons_react.IconProps & react.RefAttributes<SVGSVGElement>>;
17
+ };
18
+ type UiDefaultIconType = keyof typeof defaultIcons;
19
+ type UiIconType = UiDefaultIconType | (string & {});
20
+ declare function registerIcons(icons: Record<string, ComponentType<IconProps>>): void;
21
+ declare function getIcon(type: string): ComponentType<IconProps> | undefined;
22
+
23
+ type ConfirmOptions = {
24
+ message: string;
25
+ confirmOk?: string;
26
+ confirmCancel?: string;
27
+ confirmColor?: "red" | "primary";
28
+ };
29
+ type PopconfirmProps = ConfirmOptions & {
30
+ children?: ReactElement;
31
+ onConfirm: () => void;
32
+ onCancel?: () => void;
33
+ open?: boolean;
34
+ onOpenChange?: (open: boolean) => void;
35
+ anchorRect?: DOMRect | null;
36
+ classNames?: {
37
+ trigger?: string;
38
+ overlay?: string;
39
+ panel?: string;
40
+ message?: string;
41
+ actions?: string;
42
+ cancelButton?: string;
43
+ confirmButton?: string;
44
+ };
45
+ };
46
+ declare const Popconfirm: ({ children, onConfirm, onCancel, open: controlledOpen, onOpenChange, anchorRect, classNames, ...confirm }: PopconfirmProps) => react_jsx_runtime.JSX.Element;
47
+
48
+ type IconProps = {
49
+ size?: number;
50
+ strokeWidth?: number;
51
+ className?: string;
52
+ };
53
+ declare const buttonVariants: (props?: ({
54
+ variant?: "link" | "default" | "primary" | "danger" | "success" | "ghost" | null | undefined;
55
+ size?: "small" | "middle" | "large" | null | undefined;
56
+ block?: boolean | null | undefined;
57
+ shape?: "circle" | "default" | "round" | null | undefined;
58
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
59
+ type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>["variant"]>;
60
+ type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>["size"]>;
61
+ type ButtonProps = {
62
+ text?: string;
63
+ children?: ReactNode;
64
+ onClick?: () => void;
65
+ loading?: boolean;
66
+ disabled?: boolean;
67
+ variant?: ButtonVariant;
68
+ className?: string;
69
+ htmlType?: "button" | "submit" | "reset";
70
+ icon?: ComponentType<IconProps>;
71
+ iconType?: UiIconType;
72
+ iconPosition?: "left" | "right";
73
+ block?: boolean;
74
+ size?: ButtonSize;
75
+ iconSize?: number;
76
+ confirm?: ConfirmOptions;
77
+ shape?: "default" | "circle" | "round";
78
+ classNames?: {
79
+ icon?: string;
80
+ content?: string;
81
+ spinner?: string;
82
+ };
83
+ };
84
+ declare const Button: ({ variant, size, shape, block, iconPosition, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
85
+
86
+ type InputFieldProps = {
87
+ children: ReactNode;
88
+ noMargin?: boolean;
89
+ className?: string;
90
+ };
91
+ declare const InputField: ({ noMargin, className, children }: InputFieldProps) => react_jsx_runtime.JSX.Element;
92
+
93
+ type InputLabelProps = {
94
+ label: string;
95
+ required?: boolean;
96
+ className?: string;
97
+ requiredMarkClassName?: string;
98
+ };
99
+ declare const InputLabel: ({ label, required, className, requiredMarkClassName }: InputLabelProps) => react_jsx_runtime.JSX.Element;
100
+
101
+ type InputErrorProps = {
102
+ error: string;
103
+ className?: string;
104
+ };
105
+ declare const InputError: ({ error, className }: InputErrorProps) => react_jsx_runtime.JSX.Element;
106
+
107
+ type ServerErrorValue = {
108
+ title: string;
109
+ detail?: string;
110
+ } | null | undefined;
111
+ type ErrorProviderProps = {
112
+ resolveInputError: (name: string) => string[];
113
+ resolveServerError: () => ServerErrorValue;
114
+ children: ReactNode;
115
+ };
116
+ declare const ErrorProvider: ({ resolveInputError, resolveServerError, children }: ErrorProviderProps) => react_jsx_runtime.JSX.Element;
117
+
118
+ type TextInputProps = {
119
+ label?: string;
120
+ placeholder?: string;
121
+ value?: string | null;
122
+ onChange?: (value: string) => void;
123
+ required?: boolean;
124
+ disabled?: boolean;
125
+ password?: boolean;
126
+ newPassword?: boolean;
127
+ className?: string;
128
+ error?: ReactNode;
129
+ customError?: ReactNode;
130
+ errorName?: string;
131
+ noMargin?: boolean;
132
+ size?: "small" | "middle" | "large";
133
+ classNames?: {
134
+ label?: string;
135
+ requiredMark?: string;
136
+ inputWrapper?: string;
137
+ input?: string;
138
+ passwordToggle?: string;
139
+ error?: string;
140
+ };
141
+ };
142
+ declare const TextInput: ({ size, password, newPassword, ...props }: TextInputProps) => react_jsx_runtime.JSX.Element;
143
+
144
+ type NumberInputProps = {
145
+ label?: string;
146
+ placeholder?: string;
147
+ value?: number | null;
148
+ onChange?: (value: number | null) => void;
149
+ required?: boolean;
150
+ disabled?: boolean;
151
+ min?: number;
152
+ max?: number;
153
+ className?: string;
154
+ error?: ReactNode;
155
+ customError?: ReactNode;
156
+ errorName?: string;
157
+ noMargin?: boolean;
158
+ size?: "small" | "middle" | "large";
159
+ classNames?: {
160
+ label?: string;
161
+ requiredMark?: string;
162
+ input?: string;
163
+ error?: string;
164
+ };
165
+ };
166
+ declare const NumberInput: ({ size, ...props }: NumberInputProps) => react_jsx_runtime.JSX.Element;
167
+
168
+ type CheckboxInputProps = {
169
+ label?: string;
170
+ value?: boolean | null;
171
+ onChange?: (value: boolean) => void;
172
+ disabled?: boolean;
173
+ className?: string;
174
+ error?: ReactNode;
175
+ customError?: ReactNode;
176
+ errorName?: string;
177
+ noMargin?: boolean;
178
+ classNames?: {
179
+ label?: string;
180
+ control?: string;
181
+ indicator?: string;
182
+ text?: string;
183
+ error?: string;
184
+ };
185
+ };
186
+ declare const CheckboxInput: ({ value, ...props }: CheckboxInputProps) => react_jsx_runtime.JSX.Element;
187
+
188
+ type SwitchInputProps = {
189
+ label?: string;
190
+ value?: boolean | null;
191
+ onChange?: (value: boolean) => void;
192
+ disabled?: boolean;
193
+ className?: string;
194
+ error?: ReactNode;
195
+ customError?: ReactNode;
196
+ errorName?: string;
197
+ noMargin?: boolean;
198
+ checkedLabel?: ReactNode;
199
+ uncheckedLabel?: ReactNode;
200
+ size?: "small" | "middle";
201
+ classNames?: {
202
+ label?: string;
203
+ track?: string;
204
+ thumb?: string;
205
+ text?: string;
206
+ error?: string;
207
+ };
208
+ };
209
+ declare const SwitchInput: ({ value, size, ...props }: SwitchInputProps) => react_jsx_runtime.JSX.Element;
210
+
211
+ type ColorInputProps = {
212
+ label?: string;
213
+ placeholder?: string;
214
+ value?: string | null;
215
+ onChange?: (value: string | null) => void;
216
+ required?: boolean;
217
+ disabled?: boolean;
218
+ className?: string;
219
+ error?: ReactNode;
220
+ customError?: ReactNode;
221
+ errorName?: string;
222
+ noMargin?: boolean;
223
+ size?: "small" | "middle" | "large";
224
+ presets?: string[];
225
+ allowClear?: boolean;
226
+ variant?: "default" | "picker";
227
+ showAlpha?: boolean;
228
+ classNames?: {
229
+ label?: string;
230
+ requiredMark?: string;
231
+ trigger?: string;
232
+ swatch?: string;
233
+ value?: string;
234
+ clearButton?: string;
235
+ icon?: string;
236
+ panel?: string;
237
+ saturation?: string;
238
+ hueSlider?: string;
239
+ alphaSlider?: string;
240
+ hexRow?: string;
241
+ hexInput?: string;
242
+ preview?: string;
243
+ presets?: string;
244
+ presetButton?: string;
245
+ error?: string;
246
+ };
247
+ };
248
+ declare const ColorInput: ({ size, placeholder, presets, allowClear, variant, showAlpha, ...props }: ColorInputProps) => react_jsx_runtime.JSX.Element;
249
+
250
+ type TableSize = "small" | "middle" | "large";
251
+ type ColumnType = "date" | "datetime" | "yes/no" | "boolean" | "dot";
252
+ type TableColumn<T> = {
253
+ title?: string;
254
+ dataField?: keyof T;
255
+ type?: ColumnType;
256
+ align?: "left" | "center" | "right";
257
+ width?: number | string;
258
+ wrap?: boolean;
259
+ render?: (item: T) => ReactNode;
260
+ sortBy?: never;
261
+ };
262
+ type TableProps<T> = {
263
+ items: T[];
264
+ columns: TableColumn<T>[];
265
+ loading?: boolean;
266
+ emptyText?: string;
267
+ rowKey?: keyof T;
268
+ size?: TableSize;
269
+ onRowClick?: (item: T) => void;
270
+ verticalBorders?: boolean;
271
+ className?: string;
272
+ classNames?: {
273
+ overlay?: string;
274
+ table?: string;
275
+ headerRow?: string;
276
+ headerCell?: string;
277
+ bodyRow?: string;
278
+ bodyCell?: string;
279
+ emptyCell?: string;
280
+ };
281
+ };
282
+ declare const Table: <T extends object>({ loading, emptyText, size, verticalBorders, ...props }: TableProps<T>) => react_jsx_runtime.JSX.Element;
283
+
284
+ declare const SortDirection: {
285
+ readonly Asc: "Asc";
286
+ readonly Desc: "Desc";
287
+ };
288
+ type SortDirection = typeof SortDirection[keyof typeof SortDirection];
289
+ type GridApiQuery<TSortField, TFilter extends object> = {
290
+ pageNumber: number;
291
+ pageSize: number;
292
+ sortBy?: TSortField;
293
+ direction?: SortDirection;
294
+ } & TFilter;
295
+ type GridState<TSortField = never, TFilter extends object = Record<string, never>> = {
296
+ pageNumber: number;
297
+ pageSize: number;
298
+ sortBy?: TSortField;
299
+ direction?: SortDirection;
300
+ filter: TFilter;
301
+ };
302
+ type GridHandle<TSortField = never, TFilter extends object = Record<string, never>> = GridState<TSortField, TFilter> & {
303
+ onChange: (changes: Partial<GridState<TSortField, TFilter>>) => void;
304
+ apiQuery: GridApiQuery<TSortField, TFilter>;
305
+ };
306
+ declare function useGrid<TSortField = never, TFilter extends object = Record<string, never>>(defaults?: Partial<GridState<TSortField, TFilter>>, storageKey?: string): GridHandle<TSortField, TFilter>;
307
+
308
+ type GridColumn<T, TSortField = never> = {
309
+ title?: string;
310
+ dataField?: keyof T;
311
+ sortBy?: TSortField;
312
+ type?: ColumnType;
313
+ align?: "left" | "center" | "right";
314
+ width?: number | string;
315
+ wrap?: boolean;
316
+ render?: (item: T) => ReactNode;
317
+ };
318
+ type GridSelection<T> = {
319
+ selectedItems: T[];
320
+ onChange: (items: T[]) => void;
321
+ };
322
+ type GridProps<T, TSortField = never, TFilter extends object = Record<string, never>> = {
323
+ items: T[];
324
+ totalCount: number;
325
+ loading: boolean;
326
+ columns: GridColumn<T, TSortField>[];
327
+ grid: GridHandle<TSortField, TFilter>;
328
+ rowKey?: keyof T;
329
+ emptyText?: string;
330
+ size?: TableSize;
331
+ selection?: GridSelection<T>;
332
+ onRowClick?: (item: T) => void;
333
+ verticalBorders?: boolean;
334
+ showPageNumberChanger?: boolean;
335
+ showPageSizeChanger?: boolean;
336
+ className?: string;
337
+ classNames?: {
338
+ overlay?: string;
339
+ table?: string;
340
+ headerRow?: string;
341
+ headerCell?: string;
342
+ bodyRow?: string;
343
+ bodyCell?: string;
344
+ emptyCell?: string;
345
+ loadingCell?: string;
346
+ pagination?: {
347
+ root?: string;
348
+ summary?: string;
349
+ controls?: string;
350
+ pageSizeSelect?: string;
351
+ button?: string;
352
+ activeButton?: string;
353
+ };
354
+ };
355
+ };
356
+ declare const Grid: <T extends object, TSortField = never, TFilter extends object = Record<string, never>>(props: GridProps<T, TSortField, TFilter>) => react_jsx_runtime.JSX.Element;
357
+
358
+ type FilterDescriptor<TFilter extends object> = {
359
+ label: string;
360
+ keys: (keyof TFilter)[];
361
+ formatValue?: (filter: TFilter) => string | null | undefined;
362
+ };
363
+ type GridFiltersProps<TFilter extends object> = {
364
+ grid: GridHandle<any, TFilter>;
365
+ children: ReactNode;
366
+ descriptors?: FilterDescriptor<TFilter>[];
367
+ className?: string;
368
+ classNames?: {
369
+ inputs?: string;
370
+ activeFilters?: string;
371
+ chip?: string;
372
+ chipRemove?: string;
373
+ clearAll?: string;
374
+ };
375
+ };
376
+ declare const GridFilters: <TFilter extends object>(props: GridFiltersProps<TFilter>) => react_jsx_runtime.JSX.Element;
377
+
378
+ type FilterTextInputProps<TFilter extends object> = {
379
+ grid: GridHandle<any, TFilter>;
380
+ filterKey: keyof TFilter;
381
+ placeholder?: string;
382
+ label?: string;
383
+ debounce?: number;
384
+ };
385
+ declare const FilterTextInput: <TFilter extends object>({ debounce, ...props }: FilterTextInputProps<TFilter>) => react_jsx_runtime.JSX.Element;
386
+
387
+ type FilterNumberInputProps<TFilter extends object> = {
388
+ grid: GridHandle<any, TFilter>;
389
+ filterKey: keyof TFilter;
390
+ placeholder?: string;
391
+ label?: string;
392
+ debounce?: number;
393
+ min?: number;
394
+ max?: number;
395
+ };
396
+ declare const FilterNumberInput: <TFilter extends object>({ debounce, ...props }: FilterNumberInputProps<TFilter>) => react_jsx_runtime.JSX.Element;
397
+
398
+ type FilterCheckboxInputProps<TFilter extends object> = {
399
+ grid: GridHandle<any, TFilter>;
400
+ filterKey: keyof TFilter;
401
+ label?: string;
402
+ };
403
+ declare const FilterCheckboxInput: <TFilter extends object>(props: FilterCheckboxInputProps<TFilter>) => react_jsx_runtime.JSX.Element;
404
+
405
+ type DefaultVK$3<T extends object> = "value" extends keyof T ? "value" : string & keyof T;
406
+ type FilterSelectInputProps<TFilter extends object, TOption extends object, VK extends string & keyof TOption = DefaultVK$3<TOption>> = {
407
+ grid: GridHandle<any, TFilter>;
408
+ filterKey: keyof TFilter;
409
+ options?: TOption[];
410
+ labelKey?: keyof TOption & string;
411
+ valueKey?: VK;
412
+ placeholder?: string;
413
+ label?: string;
414
+ };
415
+ declare const FilterSelectInput: <TFilter extends object, TOption extends object, VK extends string & keyof TOption = DefaultVK$3<TOption>>(props: FilterSelectInputProps<TFilter, TOption, VK>) => react_jsx_runtime.JSX.Element;
416
+
417
+ type FilterDateInputProps<TFilter extends object> = {
418
+ grid: GridHandle<any, TFilter>;
419
+ filterKey: keyof TFilter;
420
+ placeholder?: string;
421
+ label?: string;
422
+ showTime?: boolean;
423
+ };
424
+ declare const FilterDateInput: <TFilter extends object>(props: FilterDateInputProps<TFilter>) => react_jsx_runtime.JSX.Element;
425
+
426
+ type DefaultVK$2<T extends object> = "value" extends keyof T ? Extract<"value", string & keyof T> : string & keyof T;
427
+ type FilterSelectGroupItem<TFilter extends object, TOption extends object, VK extends string & keyof TOption = DefaultVK$2<TOption>> = {
428
+ label: string;
429
+ filterKey: keyof TFilter;
430
+ options?: TOption[];
431
+ placeholder?: string;
432
+ labelKey?: keyof TOption & string;
433
+ valueKey?: VK;
434
+ };
435
+ type FilterSelectGroupPopoverProps<TFilter extends object, TOption extends object, VK extends string & keyof TOption = DefaultVK$2<TOption>> = {
436
+ grid: GridHandle<any, TFilter>;
437
+ groups: FilterSelectGroupItem<TFilter, TOption, VK>[];
438
+ label?: string;
439
+ icon?: ComponentType<IconProps>;
440
+ className?: string;
441
+ block?: boolean;
442
+ };
443
+ declare const FilterSelectGroupPopover: <TFilter extends object, TOption extends object, VK extends string & keyof TOption = DefaultVK$2<TOption>>(props: FilterSelectGroupPopoverProps<TFilter, TOption, VK>) => react_jsx_runtime.JSX.Element;
444
+
445
+ type FilterDateRangeGroup<TFilter extends object> = {
446
+ label: string;
447
+ fromKey: keyof TFilter;
448
+ toKey: keyof TFilter;
449
+ };
450
+ type FilterDateRangePopoverProps<TFilter extends object> = {
451
+ grid: GridHandle<any, TFilter>;
452
+ groups: FilterDateRangeGroup<TFilter>[];
453
+ label?: string;
454
+ className?: string;
455
+ block?: boolean;
456
+ };
457
+ declare const FilterDateRangePopover: <TFilter extends object>(props: FilterDateRangePopoverProps<TFilter>) => react_jsx_runtime.JSX.Element;
458
+
459
+ type DrawerPlacement = "top" | "bottom" | "left" | "right";
460
+ type DrawerProps = {
461
+ isOpen: boolean;
462
+ onClose: (saved: boolean) => void;
463
+ children: ReactNode;
464
+ placement?: DrawerPlacement;
465
+ className?: string;
466
+ classNames?: {
467
+ overlay?: string;
468
+ panel?: string;
469
+ header?: string;
470
+ title?: string;
471
+ closeButton?: string;
472
+ body?: string;
473
+ loading?: string;
474
+ footer?: string;
475
+ };
476
+ };
477
+ declare const Drawer: ({ placement, ...props }: DrawerProps) => react.ReactPortal | null;
478
+
479
+ type DrawerTitleProps = {
480
+ children: ReactNode;
481
+ };
482
+ declare const DrawerTitle: ({ children }: DrawerTitleProps) => null;
483
+
484
+ type DrawerFooterProps = {
485
+ children: ReactNode;
486
+ align?: "left" | "center" | "right";
487
+ };
488
+ declare const DrawerFooter: ({ children, align }: DrawerFooterProps) => null;
489
+
490
+ type DrawerContentProps = {
491
+ children: ReactNode;
492
+ loading?: boolean;
493
+ };
494
+ declare const DrawerContent: ({ loading, children }: DrawerContentProps) => react_jsx_runtime.JSX.Element;
495
+
496
+ type DrawerContextValue = {
497
+ close: () => void;
498
+ saveAndClose: (message?: string) => void;
499
+ setTitle: (title: string) => void;
500
+ setFooter: (footer: ReactNode) => void;
501
+ setLoading: (loading: boolean) => void;
502
+ };
503
+ declare function useDrawer(): DrawerContextValue;
504
+
505
+ type PanelProps = {
506
+ title?: string;
507
+ children?: ReactNode;
508
+ footer?: ReactNode;
509
+ className?: string;
510
+ variant?: "outlined" | "borderless";
511
+ inner?: boolean;
512
+ headerExtra?: ReactNode;
513
+ showServerError?: boolean;
514
+ classNames?: {
515
+ header?: string;
516
+ title?: string;
517
+ headerExtra?: string;
518
+ body?: string;
519
+ footer?: string;
520
+ serverError?: string;
521
+ };
522
+ };
523
+ declare const Panel: ({ variant, inner, ...props }: PanelProps) => react_jsx_runtime.JSX.Element;
524
+
525
+ type TabOption<T extends string = string> = {
526
+ label: React.ReactNode;
527
+ value: T;
528
+ };
529
+ type TabsProps<T extends string = string> = {
530
+ options: TabOption<T>[];
531
+ value: T;
532
+ onChange: (value: T) => void;
533
+ block?: boolean;
534
+ className?: string;
535
+ classNames?: {
536
+ list?: string;
537
+ tab?: string;
538
+ activeTab?: string;
539
+ inactiveTab?: string;
540
+ };
541
+ };
542
+ declare const Tabs: <T extends string = string>({ block, ...props }: TabsProps<T>) => react_jsx_runtime.JSX.Element;
543
+
544
+ type TagColor = "geekblue" | "blue" | "green" | "cyan" | "red" | "volcano" | "orange" | "gold" | "purple" | "magenta" | "gray" | "default";
545
+ type TagVariant = "outlined" | "filled";
546
+ type TagProps = {
547
+ children: ReactNode;
548
+ color?: TagColor;
549
+ variant?: TagVariant;
550
+ className?: string;
551
+ contentClassName?: string;
552
+ };
553
+ declare const Tag: ({ color, variant, ...props }: TagProps) => react_jsx_runtime.JSX.Element;
554
+ type ActiveTagProps = {
555
+ value: boolean;
556
+ trueLabel?: string;
557
+ falseLabel?: string;
558
+ };
559
+ declare const ActiveTag: ({ value, trueLabel, falseLabel, }: ActiveTagProps) => react_jsx_runtime.JSX.Element;
560
+ type FlagTagProps = {
561
+ value: boolean;
562
+ label: string;
563
+ color?: TagColor;
564
+ variant?: TagVariant;
565
+ };
566
+ declare const FlagTag: ({ value, label, color, variant }: FlagTagProps) => react_jsx_runtime.JSX.Element | null;
567
+
568
+ type BadgeProps = {
569
+ count?: number;
570
+ children?: ReactNode;
571
+ showZero?: boolean;
572
+ size?: "default" | "small";
573
+ className?: string;
574
+ classNames?: {
575
+ badge?: string;
576
+ };
577
+ };
578
+ declare const Badge: ({ count, size, showZero, ...props }: BadgeProps) => react_jsx_runtime.JSX.Element;
579
+
580
+ declare const sizeClasses: {
581
+ readonly xs: "w-6 h-6 text-[10px]";
582
+ readonly sm: "w-7 h-7 text-xs";
583
+ readonly md: "w-8 h-8 text-sm";
584
+ readonly lg: "w-10 h-10 text-base";
585
+ readonly xl: "w-12 h-12 text-lg";
586
+ };
587
+ type AvatarSize = keyof typeof sizeClasses;
588
+ type AvatarProps = {
589
+ name?: string;
590
+ src?: string;
591
+ size?: AvatarSize;
592
+ color?: string;
593
+ className?: string;
594
+ initialsClassName?: string;
595
+ };
596
+ declare const Avatar: ({ size, ...props }: AvatarProps) => react_jsx_runtime.JSX.Element;
597
+
598
+ type DateInputProps = {
599
+ label?: string;
600
+ placeholder?: string;
601
+ value?: Date | null;
602
+ onChange?: (value: Date | null) => void;
603
+ minDate?: Date;
604
+ maxDate?: Date;
605
+ isDateDisabled?: (date: Date) => boolean;
606
+ required?: boolean;
607
+ disabled?: boolean;
608
+ className?: string;
609
+ error?: ReactNode;
610
+ customError?: ReactNode;
611
+ errorName?: string;
612
+ noMargin?: boolean;
613
+ size?: "small" | "middle" | "large";
614
+ showTime?: boolean;
615
+ classNames?: {
616
+ label?: string;
617
+ requiredMark?: string;
618
+ trigger?: string;
619
+ value?: string;
620
+ clearButton?: string;
621
+ icon?: string;
622
+ error?: string;
623
+ };
624
+ };
625
+ declare const DateInput: ({ size, showTime, ...props }: DateInputProps) => react_jsx_runtime.JSX.Element;
626
+
627
+ type ToolbarAction = "bold" | "italic" | "underline" | "bullet" | "numbered" | "link" | "unlink" | "clear";
628
+ type HtmlInputProps = {
629
+ label?: string;
630
+ placeholder?: string;
631
+ value?: string | null;
632
+ onChange?: (value: string) => void;
633
+ required?: boolean;
634
+ disabled?: boolean;
635
+ className?: string;
636
+ error?: ReactNode;
637
+ customError?: ReactNode;
638
+ errorName?: string;
639
+ noMargin?: boolean;
640
+ minHeight?: number;
641
+ toolbar?: ToolbarAction[];
642
+ classNames?: {
643
+ label?: string;
644
+ requiredMark?: string;
645
+ shell?: string;
646
+ toolbar?: string;
647
+ toolbarButton?: string;
648
+ placeholder?: string;
649
+ editor?: string;
650
+ error?: string;
651
+ };
652
+ };
653
+ declare const HtmlInput: ({ placeholder, value, disabled, minHeight, toolbar, ...props }: HtmlInputProps) => react_jsx_runtime.JSX.Element;
654
+
655
+ type UploadStatus = "idle" | "uploading" | "uploaded" | "error";
656
+ type UploadItem<TMeta = unknown> = {
657
+ id: string;
658
+ name: string;
659
+ size?: number;
660
+ mimeType?: string;
661
+ url?: string;
662
+ status: UploadStatus;
663
+ progress?: number;
664
+ error?: string;
665
+ file?: File;
666
+ meta?: TMeta;
667
+ };
668
+ type UploadConfig<TMeta = unknown> = {
669
+ uploadFile: (file: File) => Promise<UploadItem<TMeta>>;
670
+ onRemoveClick?: (item: UploadItem<TMeta>) => Promise<void> | void;
671
+ removeFile?: (item: UploadItem<TMeta>) => Promise<void> | void;
672
+ downloadFile?: (item: UploadItem<TMeta>) => Promise<void> | void;
673
+ };
674
+ type UploadProviderProps = {
675
+ config: UploadConfig<any>;
676
+ children: ReactNode;
677
+ };
678
+ declare const UploadProvider: ({ config, children }: UploadProviderProps) => react_jsx_runtime.JSX.Element;
679
+ declare function useUploadConfig<TMeta = unknown>(): UploadConfig<TMeta> | null;
680
+
681
+ type UploadInputProps<TMeta = unknown> = {
682
+ value?: UploadItem<TMeta>[];
683
+ defaultValue?: UploadItem<TMeta>[];
684
+ onChange?: (items: UploadItem<TMeta>[]) => void;
685
+ label?: string;
686
+ required?: boolean;
687
+ disabled?: boolean;
688
+ className?: string;
689
+ error?: ReactNode;
690
+ customError?: ReactNode;
691
+ errorName?: string;
692
+ noMargin?: boolean;
693
+ multiple?: boolean;
694
+ accept?: string;
695
+ maxFiles?: number;
696
+ placeholder?: string;
697
+ browseText?: string;
698
+ autoUpload?: boolean;
699
+ variant?: "dropzone" | "button";
700
+ renderTrigger?: (api: {
701
+ open: () => void;
702
+ disabled: boolean;
703
+ dragActive: boolean;
704
+ itemCount: number;
705
+ remainingSlots?: number;
706
+ }) => ReactNode;
707
+ texts?: Partial<{
708
+ placeholder: string;
709
+ helperSingle: string;
710
+ helperMultiple: string;
711
+ browseButton: string;
712
+ }>;
713
+ onUpload?: UploadConfig<TMeta>["uploadFile"];
714
+ onRemoveClick?: UploadConfig<TMeta>["onRemoveClick"];
715
+ onRemove?: UploadConfig<TMeta>["removeFile"];
716
+ onDownload?: UploadConfig<TMeta>["downloadFile"];
717
+ classNames?: {
718
+ label?: string;
719
+ requiredMark?: string;
720
+ trigger?: string;
721
+ dropzone?: string;
722
+ fileList?: string;
723
+ fileItem?: string;
724
+ fileIcon?: string;
725
+ fileName?: string;
726
+ fileMeta?: string;
727
+ fileActions?: string;
728
+ downloadButton?: string;
729
+ removeButton?: string;
730
+ error?: string;
731
+ };
732
+ };
733
+ declare const UploadInput: <TMeta = unknown>({ defaultValue, multiple, autoUpload, variant, placeholder, browseText, ...props }: UploadInputProps<TMeta>) => react_jsx_runtime.JSX.Element;
734
+
735
+ type DefaultVK$1<T extends object> = "value" extends keyof T ? Extract<"value", string & keyof T> : string & keyof T;
736
+ type SelectInputProps<T extends object, VK extends string & keyof T = DefaultVK$1<T>> = {
737
+ options?: T[] | null;
738
+ loading?: boolean;
739
+ labelKey?: keyof T & string;
740
+ valueKey?: VK;
741
+ label?: string;
742
+ placeholder?: string;
743
+ value?: T[VK] | null;
744
+ onChange?: (value: T[VK] | null) => void;
745
+ required?: boolean;
746
+ disabled?: boolean;
747
+ className?: string;
748
+ error?: ReactNode;
749
+ customError?: ReactNode;
750
+ errorName?: string;
751
+ noMargin?: boolean;
752
+ size?: "small" | "middle" | "large";
753
+ allowClear?: boolean;
754
+ showSearch?: boolean;
755
+ treatZeroAsEmpty?: boolean;
756
+ classNames?: {
757
+ label?: string;
758
+ requiredMark?: string;
759
+ trigger?: string;
760
+ value?: string;
761
+ clearButton?: string;
762
+ icon?: string;
763
+ error?: string;
764
+ };
765
+ };
766
+ declare const SelectInput: <T extends object, VK extends string & keyof T = DefaultVK$1<T>>({ options, labelKey, valueKey, size, showSearch, ...props }: SelectInputProps<T, VK>) => react_jsx_runtime.JSX.Element;
767
+
768
+ type DefaultVK<T extends object> = "value" extends keyof T ? Extract<"value", string & keyof T> : string & keyof T;
769
+ type MultiSelectInputProps<T extends object, VK extends string & keyof T = DefaultVK<T>> = {
770
+ options?: T[] | null;
771
+ loading?: boolean;
772
+ labelKey?: keyof T & string;
773
+ valueKey?: VK;
774
+ label?: string;
775
+ placeholder?: string;
776
+ value?: T[VK][] | null;
777
+ onChange?: (value: T[VK][]) => void;
778
+ required?: boolean;
779
+ disabled?: boolean;
780
+ className?: string;
781
+ error?: ReactNode;
782
+ customError?: ReactNode;
783
+ errorName?: string;
784
+ noMargin?: boolean;
785
+ size?: "small" | "middle" | "large";
786
+ allowClear?: boolean;
787
+ showSearch?: boolean;
788
+ maxTagsVisible?: number;
789
+ classNames?: {
790
+ label?: string;
791
+ requiredMark?: string;
792
+ trigger?: string;
793
+ tags?: string;
794
+ tag?: string;
795
+ tagRemove?: string;
796
+ overflowTag?: string;
797
+ placeholder?: string;
798
+ icon?: string;
799
+ error?: string;
800
+ };
801
+ };
802
+ declare const MultiSelectInput: <T extends object, VK extends string & keyof T = DefaultVK<T>>({ options, labelKey, valueKey, size, showSearch, maxTagsVisible, ...props }: MultiSelectInputProps<T, VK>) => react_jsx_runtime.JSX.Element;
803
+
804
+ type AlertType = "success" | "error" | "warning" | "info";
805
+ type AlertProps = {
806
+ type?: AlertType;
807
+ message: string;
808
+ description?: string;
809
+ closable?: boolean;
810
+ className?: string;
811
+ classNames?: {
812
+ icon?: string;
813
+ content?: string;
814
+ message?: string;
815
+ description?: string;
816
+ closeButton?: string;
817
+ };
818
+ };
819
+ declare const Alert: ({ type, message, description, closable, className, classNames }: AlertProps) => react_jsx_runtime.JSX.Element | null;
820
+
821
+ declare const ServerError: ({ className }: {
822
+ className?: string;
823
+ }) => react_jsx_runtime.JSX.Element | null;
824
+
825
+ type NotificationType = "success" | "error" | "warning" | "info";
826
+ type NotificationOptions = {
827
+ description?: string;
828
+ duration?: number;
829
+ };
830
+ declare const notification: {
831
+ success: (message: string, options?: NotificationOptions) => void | undefined;
832
+ error: (message: string, options?: NotificationOptions) => void | undefined;
833
+ warning: (message: string, options?: NotificationOptions) => void | undefined;
834
+ info: (message: string, options?: NotificationOptions) => void | undefined;
835
+ };
836
+ declare const NotificationProvider: ({ children }: {
837
+ children: React.ReactNode;
838
+ }) => react_jsx_runtime.JSX.Element;
839
+
840
+ declare const useNotification: () => {
841
+ success: (message: string, options?: NotificationOptions) => void;
842
+ error: (message: string, options?: NotificationOptions) => void;
843
+ warning: (message: string, options?: NotificationOptions) => void;
844
+ info: (message: string, options?: NotificationOptions) => void;
845
+ };
846
+
847
+ type EmptyProps = {
848
+ text?: string;
849
+ description?: string;
850
+ icon?: React.FC<{
851
+ size?: number | string;
852
+ strokeWidth?: number;
853
+ className?: string;
854
+ }>;
855
+ className?: string;
856
+ size?: "default" | "compact";
857
+ };
858
+ declare const Empty: ({ text, description, icon: Icon, className, size, }: EmptyProps) => react_jsx_runtime.JSX.Element;
859
+
860
+ type PrettyProps = {
861
+ data: unknown;
862
+ className?: string;
863
+ };
864
+ declare const Pretty: ({ data, className }: PrettyProps) => react_jsx_runtime.JSX.Element;
865
+
866
+ type SkeletonProps = {
867
+ active?: boolean;
868
+ title?: boolean;
869
+ paragraph?: {
870
+ rows?: number;
871
+ };
872
+ className?: string;
873
+ };
874
+ declare const Skeleton: ({ active, title, paragraph, className, }: SkeletonProps) => react_jsx_runtime.JSX.Element;
875
+
876
+ type DropdownDivider = {
877
+ divider: true;
878
+ visible?: boolean;
879
+ };
880
+ type DropdownAction = {
881
+ divider?: false;
882
+ label: ReactNode;
883
+ custom?: boolean;
884
+ icon?: ComponentType<IconProps>;
885
+ iconType?: UiIconType;
886
+ color?: string;
887
+ disabled?: boolean;
888
+ visible?: boolean;
889
+ closeOnSelect?: boolean;
890
+ onSelect?: () => void;
891
+ confirm?: ConfirmOptions;
892
+ className?: string;
893
+ };
894
+ type DropdownOption = DropdownDivider | DropdownAction;
895
+ type DropdownPlacement = "auto" | "bottom-start" | "bottom-end";
896
+ type DropdownProps = {
897
+ children: ReactNode;
898
+ options?: DropdownOption[];
899
+ content?: ReactNode | ((api: {
900
+ close: () => void;
901
+ }) => ReactNode);
902
+ open?: boolean;
903
+ onOpenChange?: (open: boolean) => void;
904
+ placement?: DropdownPlacement;
905
+ panelClassName?: string;
906
+ className?: string;
907
+ matchTriggerWidth?: boolean;
908
+ classNames?: {
909
+ trigger?: string;
910
+ panel?: string;
911
+ divider?: string;
912
+ option?: string;
913
+ optionIcon?: string;
914
+ optionLabel?: string;
915
+ content?: string;
916
+ };
917
+ };
918
+ declare const Dropdown: ({ children, options, content, open: controlledOpen, onOpenChange, placement, panelClassName, className, matchTriggerWidth, classNames, }: DropdownProps) => react_jsx_runtime.JSX.Element;
919
+
920
+ type TooltipPlacement = "top" | "bottom" | "left" | "right";
921
+ type TooltipProps = {
922
+ title?: ReactNode;
923
+ children: ReactNode;
924
+ placement?: TooltipPlacement;
925
+ open?: boolean;
926
+ onOpenChange?: (open: boolean) => void;
927
+ maxWidth?: number;
928
+ className?: string;
929
+ contentClassName?: string;
930
+ arrow?: boolean;
931
+ classNames?: {
932
+ trigger?: string;
933
+ panel?: string;
934
+ arrow?: string;
935
+ };
936
+ };
937
+ declare const Tooltip: ({ title, children, placement, open: controlledOpen, onOpenChange, maxWidth, className, contentClassName, arrow, classNames, }: TooltipProps) => react_jsx_runtime.JSX.Element;
938
+
939
+ declare const uiTheme: {
940
+ colors: {
941
+ primary: {
942
+ bg: string;
943
+ hover: string;
944
+ text: string;
945
+ };
946
+ danger: {
947
+ bg: string;
948
+ hover: string;
949
+ text: string;
950
+ };
951
+ success: {
952
+ bg: string;
953
+ hover: string;
954
+ text: string;
955
+ };
956
+ warning: {
957
+ bg: string;
958
+ hover: string;
959
+ text: string;
960
+ };
961
+ info: {
962
+ bg: string;
963
+ hover: string;
964
+ text: string;
965
+ };
966
+ };
967
+ size: {
968
+ small: {
969
+ height: string;
970
+ px: string;
971
+ text: string;
972
+ radius: string;
973
+ };
974
+ middle: {
975
+ height: string;
976
+ px: string;
977
+ text: string;
978
+ radius: string;
979
+ };
980
+ large: {
981
+ height: string;
982
+ px: string;
983
+ text: string;
984
+ radius: string;
985
+ };
986
+ };
987
+ radius: {
988
+ sm: string;
989
+ md: string;
990
+ lg: string;
991
+ full: string;
992
+ };
993
+ border: {
994
+ color: string;
995
+ input: string;
996
+ focus: string;
997
+ width: string;
998
+ };
999
+ shadow: {
1000
+ sm: string;
1001
+ md: string;
1002
+ };
1003
+ font: {
1004
+ family: string;
1005
+ size: {
1006
+ sm: string;
1007
+ md: string;
1008
+ lg: string;
1009
+ };
1010
+ };
1011
+ gray: {
1012
+ 50: string;
1013
+ 100: string;
1014
+ 200: string;
1015
+ 300: string;
1016
+ 400: string;
1017
+ 500: string;
1018
+ 600: string;
1019
+ 700: string;
1020
+ 800: string;
1021
+ 900: string;
1022
+ };
1023
+ layout: {
1024
+ panel: {
1025
+ headerHeight: string;
1026
+ headerPx: string;
1027
+ bodyPadding: string;
1028
+ footerPx: string;
1029
+ footerPy: string;
1030
+ };
1031
+ drawer: {
1032
+ headerHeight: string;
1033
+ headerPx: string;
1034
+ bodyPadding: string;
1035
+ footerPx: string;
1036
+ footerPy: string;
1037
+ };
1038
+ popup: {
1039
+ panelPadding: string;
1040
+ compactPaddingX: string;
1041
+ compactPaddingY: string;
1042
+ compactGap: string;
1043
+ text: string;
1044
+ };
1045
+ table: {
1046
+ small: {
1047
+ cellPx: string;
1048
+ thPy: string;
1049
+ tdPy: string;
1050
+ emptyPy: string;
1051
+ };
1052
+ middle: {
1053
+ cellPx: string;
1054
+ thPy: string;
1055
+ tdPy: string;
1056
+ emptyPy: string;
1057
+ };
1058
+ large: {
1059
+ cellPx: string;
1060
+ thPy: string;
1061
+ tdPy: string;
1062
+ emptyPy: string;
1063
+ };
1064
+ };
1065
+ empty: {
1066
+ defaultPy: string;
1067
+ compactPy: string;
1068
+ defaultIconBox: string;
1069
+ compactIconBox: string;
1070
+ defaultIcon: string;
1071
+ compactIcon: string;
1072
+ compactText: string;
1073
+ compactDescription: string;
1074
+ };
1075
+ };
1076
+ };
1077
+ type UiColor = keyof typeof uiTheme.colors | string;
1078
+ type UiSize = keyof typeof uiTheme.size;
1079
+
1080
+ type SpinnerColor = "primary" | "danger" | "success" | "warning" | "info" | "current";
1081
+ type SpinnerSize = UiSize | number;
1082
+ type SpinnerProps = {
1083
+ size?: SpinnerSize;
1084
+ color?: SpinnerColor;
1085
+ label?: string;
1086
+ center?: boolean;
1087
+ className?: string;
1088
+ };
1089
+ declare const Spinner: ({ size, color, label, center, className, }: SpinnerProps) => react_jsx_runtime.JSX.Element;
1090
+
1091
+ type ColorConfig = {
1092
+ bg: string;
1093
+ hover: string;
1094
+ text: string;
1095
+ };
1096
+ type BorderConfig = {
1097
+ color?: string;
1098
+ input?: string;
1099
+ focus?: string;
1100
+ width?: string;
1101
+ };
1102
+ type SizeConfig = {
1103
+ height?: string;
1104
+ px?: string;
1105
+ text?: string;
1106
+ };
1107
+ type RadiusConfig = {
1108
+ sm?: string;
1109
+ md?: string;
1110
+ lg?: string;
1111
+ };
1112
+ type GrayConfig = {
1113
+ 50?: string;
1114
+ 100?: string;
1115
+ 200?: string;
1116
+ 300?: string;
1117
+ 400?: string;
1118
+ 500?: string;
1119
+ 600?: string;
1120
+ 700?: string;
1121
+ 800?: string;
1122
+ 900?: string;
1123
+ };
1124
+ type LayoutSizeConfig = {
1125
+ cellPx?: string;
1126
+ thPy?: string;
1127
+ tdPy?: string;
1128
+ emptyPy?: string;
1129
+ };
1130
+ type PanelLayoutConfig = {
1131
+ headerHeight?: string;
1132
+ headerPx?: string;
1133
+ bodyPadding?: string;
1134
+ footerPx?: string;
1135
+ footerPy?: string;
1136
+ };
1137
+ type DrawerLayoutConfig = {
1138
+ headerHeight?: string;
1139
+ headerPx?: string;
1140
+ bodyPadding?: string;
1141
+ footerPx?: string;
1142
+ footerPy?: string;
1143
+ };
1144
+ type PopupLayoutConfig = {
1145
+ panelPadding?: string;
1146
+ compactPaddingX?: string;
1147
+ compactPaddingY?: string;
1148
+ compactGap?: string;
1149
+ text?: string;
1150
+ };
1151
+ type EmptyLayoutConfig = {
1152
+ defaultPy?: string;
1153
+ compactPy?: string;
1154
+ defaultIconBox?: string;
1155
+ compactIconBox?: string;
1156
+ defaultIcon?: string;
1157
+ compactIcon?: string;
1158
+ compactText?: string;
1159
+ compactDescription?: string;
1160
+ };
1161
+ type UiThemeConfig = {
1162
+ icons?: Record<string, ComponentType<IconProps>>;
1163
+ colors?: {
1164
+ primary?: Partial<ColorConfig>;
1165
+ danger?: Partial<ColorConfig>;
1166
+ success?: Partial<ColorConfig>;
1167
+ warning?: Partial<ColorConfig>;
1168
+ info?: Partial<ColorConfig>;
1169
+ };
1170
+ border?: BorderConfig;
1171
+ radius?: RadiusConfig;
1172
+ gray?: GrayConfig;
1173
+ size?: {
1174
+ small?: SizeConfig;
1175
+ middle?: SizeConfig;
1176
+ large?: SizeConfig;
1177
+ };
1178
+ layout?: {
1179
+ panel?: PanelLayoutConfig;
1180
+ drawer?: DrawerLayoutConfig;
1181
+ popup?: PopupLayoutConfig;
1182
+ empty?: EmptyLayoutConfig;
1183
+ table?: {
1184
+ small?: LayoutSizeConfig;
1185
+ middle?: LayoutSizeConfig;
1186
+ large?: LayoutSizeConfig;
1187
+ };
1188
+ };
1189
+ };
1190
+ declare function initUI(config?: UiThemeConfig): void;
1191
+
1192
+ export { ActiveTag, type ActiveTagProps, Alert, type AlertProps, type AlertType, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, Button, type ButtonSize, type ButtonVariant, CheckboxInput, type CheckboxInputProps, ColorInput, type ColorInputProps, type ColumnType, type ConfirmOptions, DateInput, type DateInputProps, Drawer, DrawerContent, DrawerFooter, type DrawerPlacement, type DrawerProps, DrawerTitle, Dropdown, type DropdownOption, type DropdownPlacement, type DropdownProps, Empty, type EmptyProps, ErrorProvider, FilterCheckboxInput, FilterDateInput, type FilterDateRangeGroup, FilterDateRangePopover, type FilterDescriptor, FilterNumberInput, type FilterSelectGroupItem, FilterSelectGroupPopover, FilterSelectInput, FilterTextInput, FlagTag, type FlagTagProps, Grid, type GridApiQuery, type GridColumn, GridFilters, type GridHandle, type GridProps, type GridState, HtmlInput, type HtmlInputProps, type IconProps, InputError, InputField, InputLabel, MultiSelectInput, type MultiSelectInputProps, type NotificationOptions, NotificationProvider, type NotificationType, NumberInput, type NumberInputProps, Panel, type PanelProps, Popconfirm, type PopconfirmProps, Pretty, type PrettyProps, SelectInput, type SelectInputProps, ServerError, type ServerErrorValue, Skeleton, type SkeletonProps, SortDirection, Spinner, type SpinnerColor, type SpinnerProps, SwitchInput, type SwitchInputProps, type TabOption, Table, type TableColumn, type TableProps, type TableSize, Tabs, type TabsProps, Tag, type TagProps, TextInput, type TextInputProps, Tooltip, type TooltipPlacement, type TooltipProps, type UiColor, type UiDefaultIconType, type UiIconType, type UiSize, type UiThemeConfig, type UploadConfig, UploadInput, type UploadInputProps, type UploadItem, UploadProvider, type UploadStatus, getIcon, initUI, notification, registerIcons, uiTheme, useDrawer, useGrid, useNotification, useUploadConfig };