@eml-payments/ui-kit 1.5.4 → 1.5.6

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,488 @@
1
+ import * as React$1 from 'react';
2
+ import React__default, { PropsWithChildren, InputHTMLAttributes, ComponentProps, ReactNode, JSX } from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
+ import { ColumnDef, SortingState, Row } from '@tanstack/react-table';
7
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
8
+ import * as SelectPrimitive from '@radix-ui/react-select';
9
+ import { SelectTrigger as SelectTrigger$1, SelectContent as SelectContent$1 } from '@radix-ui/react-select';
10
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
11
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
12
+ import { Checkbox as Checkbox$1 } from '@radix-ui/react-checkbox';
13
+ import * as SwitchPrimitives from '@radix-ui/react-switch';
14
+ import { Switch as Switch$1 } from '@radix-ui/react-switch';
15
+ import * as LabelPrimitive from '@radix-ui/react-label';
16
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
17
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
18
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
19
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
20
+
21
+ type ColorVariant = string | {
22
+ light: string;
23
+ dark: string;
24
+ };
25
+ type UIKitColors = {
26
+ primary?: ColorVariant;
27
+ secondary?: ColorVariant;
28
+ accent?: ColorVariant;
29
+ success?: ColorVariant;
30
+ warning?: ColorVariant;
31
+ error?: ColorVariant;
32
+ info?: ColorVariant;
33
+ background?: ColorVariant;
34
+ foreground?: ColorVariant;
35
+ textPrimary?: ColorVariant;
36
+ textSecondary?: ColorVariant;
37
+ [key: string]: ColorVariant | undefined;
38
+ };
39
+ type UIKitConfig = {
40
+ colors?: UIKitColors;
41
+ radius?: string;
42
+ fontFamily?: string;
43
+ [key: string]: unknown;
44
+ };
45
+
46
+ declare const UIKitProvider: React__default.FC<PropsWithChildren<{
47
+ config?: UIKitConfig;
48
+ }>>;
49
+
50
+ declare const useUIKitTheme: () => UIKitConfig;
51
+
52
+ declare const buttonVariants: (props?: ({
53
+ variant?: "primary" | "secondary" | "primaryFilled" | "primaryOutlined" | "primaryText" | "secondaryFilled" | "secondaryOutlined" | "secondaryText" | "outlined" | "ghost" | "destructive" | null | undefined;
54
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
55
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
56
+
57
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
58
+ children: React.ReactNode;
59
+ asChild?: boolean;
60
+ loading?: boolean;
61
+ loadingText?: string;
62
+ icon?: React.ReactNode;
63
+ iconPosition?: 'left' | 'right';
64
+ }
65
+
66
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
67
+
68
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
69
+ label?: string;
70
+ error?: string;
71
+ helperText?: string;
72
+ icon?: React.ReactNode;
73
+ variant?: 'default' | 'search';
74
+ }
75
+
76
+ declare const Input: React__default.ForwardRefExoticComponent<InputProps & React__default.RefAttributes<HTMLInputElement>>;
77
+
78
+ type DropdownStructure = 'default' | 'checkbox' | 'radio' | 'grouped' | 'submenu';
79
+ type DropdownOption = {
80
+ label: string;
81
+ value?: string;
82
+ checked?: boolean;
83
+ onCheckedChange?: (checked: boolean) => void;
84
+ onClick?: () => void;
85
+ disabled?: boolean;
86
+ subOptions?: DropdownOption[];
87
+ groupLabel?: string;
88
+ };
89
+
90
+ type FlexColumnDef<T> = ColumnDef<T> & {
91
+ flex?: number;
92
+ };
93
+ type InfiniteScrollOptions = {
94
+ enabled: boolean;
95
+ hasNextPage: boolean;
96
+ isFetchingNextPage?: boolean;
97
+ fetchNextPage: () => void;
98
+ rootMarginPx?: number;
99
+ loadingMoreMessage?: string;
100
+ noMoreDataMessage?: string;
101
+ };
102
+ type PaginationMode = 'client' | 'server' | 'none';
103
+ interface VirtualizationOptions {
104
+ enabled: boolean;
105
+ rowEstimate?: number;
106
+ overscan?: number;
107
+ }
108
+ interface TableProps<T> {
109
+ id: string;
110
+ height?: number | string;
111
+ data: T[];
112
+ columns: FlexColumnDef<T>[];
113
+ rowIdKey?: keyof T | 'id';
114
+ className?: string;
115
+ isLoading?: boolean;
116
+ showSkeletonRows?: boolean;
117
+ checkboxSelection?: boolean;
118
+ checkboxPosition?: 'start' | 'end';
119
+ sorting?: SortingState;
120
+ onSortingChange?: (s: SortingState) => void;
121
+ onSelectionChange?: (selectedIds: string[]) => void;
122
+ enableRowSelection?: (row: Row<T>) => boolean;
123
+ onRefetch?: (pageIndex: number, pageSize: number) => void;
124
+ isMultiRowSelection?: boolean;
125
+ totalServerRows?: number;
126
+ paginationMode?: PaginationMode;
127
+ noRowsMessage?: string;
128
+ rowsPerPage?: number;
129
+ selectedRowIds?: string[];
130
+ tableActionsDropdown?: {
131
+ getOptions: (row: T) => DropdownOption[];
132
+ structure?: DropdownStructure;
133
+ renderCustomTrigger?: (row: T) => React.ReactNode;
134
+ menuAlignment?: 'start' | 'end' | 'center' | undefined;
135
+ isDisabled?: boolean | ((row: T) => boolean);
136
+ };
137
+ onRowClick?: (row: T) => void;
138
+ isRowClickable?: (row: T) => boolean;
139
+ showHeader?: boolean;
140
+ grouping?: string[];
141
+ isSearchActive?: boolean;
142
+ noSearchResultsMessage?: string;
143
+ infiniteScroll?: InfiniteScrollOptions;
144
+ virtualization?: VirtualizationOptions;
145
+ }
146
+
147
+ declare function Table<T extends {
148
+ id: string;
149
+ }>(props: Readonly<TableProps<T>>): react_jsx_runtime.JSX.Element;
150
+
151
+ declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
152
+ declare const Tooltip: React$1.FC<TooltipPrimitive.TooltipProps>;
153
+ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
154
+ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
155
+
156
+ interface SelectTriggerProps extends ComponentProps<typeof SelectTrigger$1> {
157
+ error?: boolean;
158
+ size?: 'sm' | 'md';
159
+ }
160
+ interface SelectContentProps extends ComponentProps<typeof SelectContent$1> {
161
+ showAlwaysSearch?: boolean;
162
+ searchPlaceholder?: string;
163
+ }
164
+
165
+ declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
166
+ declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
167
+ declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
168
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & SelectTriggerProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
169
+ declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
170
+ declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
171
+ declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & SelectContentProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
172
+ declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
173
+ declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
174
+ declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
175
+
176
+ interface SelectWrapperOptions {
177
+ label: string;
178
+ value: string;
179
+ }
180
+ interface SelectWrapperProps {
181
+ label?: string;
182
+ options: SelectWrapperOptions[];
183
+ value: string;
184
+ onChange: (value: string) => void;
185
+ size?: 'small' | 'default';
186
+ disabled?: boolean;
187
+ error?: boolean;
188
+ placeholder?: string;
189
+ className?: string;
190
+ }
191
+
192
+ declare const SelectWrapper: ({ label, options, value, onChange, size, disabled, error, placeholder, className, }: SelectWrapperProps) => react_jsx_runtime.JSX.Element;
193
+
194
+ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
195
+ declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
196
+
197
+ interface CheckboxProps extends ComponentProps<typeof Checkbox$1> {
198
+ label?: string;
199
+ labelPosition?: 'left' | 'right' | 'top' | 'bottom';
200
+ }
201
+
202
+ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<Omit<CheckboxPrimitive.CheckboxProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & CheckboxProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
203
+
204
+ interface SwitchProps extends ComponentProps<typeof Switch$1> {
205
+ label?: string;
206
+ labelPosition?: 'left' | 'right' | 'top' | 'bottom';
207
+ }
208
+
209
+ declare const Switch: React$1.ForwardRefExoticComponent<Omit<Omit<SwitchPrimitives.SwitchProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & SwitchProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
210
+
211
+ declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_dist_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
212
+
213
+ declare const DropdownWrapper: ({ triggerElement, options, className, structure, selectedValue, onValueChange, menuAlignment, isTriggerElementDisabled, }: {
214
+ triggerElement: React__default.ReactNode;
215
+ options: DropdownOption[];
216
+ className?: string;
217
+ structure?: DropdownStructure;
218
+ selectedValue?: string;
219
+ onValueChange?: (value: string) => void;
220
+ menuAlignment?: "start" | "end" | "center";
221
+ isTriggerElementDisabled?: boolean;
222
+ }) => react_jsx_runtime.JSX.Element;
223
+
224
+ declare function DropdownMenu({ ...props }: Readonly<React$1.ComponentProps<typeof DropdownMenuPrimitive.Root>>): react_jsx_runtime.JSX.Element;
225
+ declare function DropdownMenuPortal({ ...props }: Readonly<React$1.ComponentProps<typeof DropdownMenuPrimitive.Portal>>): react_jsx_runtime.JSX.Element;
226
+ declare function DropdownMenuTrigger({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
227
+ declare function DropdownMenuContent({ className, sideOffset, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Content>): react_jsx_runtime.JSX.Element;
228
+ declare function DropdownMenuGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Group>): react_jsx_runtime.JSX.Element;
229
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
230
+ inset?: boolean;
231
+ variant?: 'default' | 'destructive';
232
+ }): react_jsx_runtime.JSX.Element;
233
+ declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): react_jsx_runtime.JSX.Element;
234
+ declare function DropdownMenuRadioGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): react_jsx_runtime.JSX.Element;
235
+ declare function DropdownMenuRadioItem({ className, children, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): react_jsx_runtime.JSX.Element;
236
+ declare function DropdownMenuLabel({ className, inset, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
237
+ inset?: boolean;
238
+ }): react_jsx_runtime.JSX.Element;
239
+ declare function DropdownMenuSeparator({ className, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Separator>): react_jsx_runtime.JSX.Element;
240
+ declare function DropdownMenuShortcut({ className, ...props }: React$1.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
241
+ declare function DropdownMenuSub({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Sub>): react_jsx_runtime.JSX.Element;
242
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
243
+ inset?: boolean;
244
+ }): react_jsx_runtime.JSX.Element;
245
+ declare function DropdownMenuSubContent({ className, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): react_jsx_runtime.JSX.Element;
246
+
247
+ declare const Card: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
248
+ declare const CardHeader: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
249
+ declare const CardTitle: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
250
+ declare const CardDescription: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
251
+ declare const CardAction: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
252
+ declare const CardContent: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
253
+ declare const CardFooter: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
254
+
255
+ interface CardContainerProps {
256
+ title: string;
257
+ icon: ReactNode;
258
+ children: ReactNode;
259
+ className?: string;
260
+ }
261
+ declare const CardContainer: ({ title, icon, children, className }: CardContainerProps) => react_jsx_runtime.JSX.Element;
262
+
263
+ declare const alertVariants: (props?: ({
264
+ variant?: "success" | "warning" | "error" | "default" | null | undefined;
265
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
266
+
267
+ type AlertProps = React.ComponentProps<'div'> & VariantProps<typeof alertVariants> & {
268
+ onClose?: () => void;
269
+ isVisible?: boolean;
270
+ disableAnimation?: boolean;
271
+ position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
272
+ };
273
+
274
+ declare function Alert({ className, variant, onClose, isVisible, disableAnimation, position, ...props }: AlertProps): react_jsx_runtime.JSX.Element | null;
275
+
276
+ type AlertContainerProps = AlertProps & {
277
+ title?: string;
278
+ description?: string;
279
+ icon?: React.ReactNode;
280
+ };
281
+
282
+ declare const AlertContainer: ({ variant, isVisible, title, description, onClose, className, disableAnimation, position, icon, }: AlertContainerProps) => react_jsx_runtime.JSX.Element;
283
+
284
+ declare function Dialog({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
285
+ declare function DialogTrigger({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
286
+ declare function DialogPortal({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Portal>): react_jsx_runtime.JSX.Element;
287
+ declare function DialogClose({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
288
+ declare function DialogOverlay({ className, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Overlay>): react_jsx_runtime.JSX.Element;
289
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Content> & {
290
+ showCloseButton?: boolean;
291
+ }): react_jsx_runtime.JSX.Element;
292
+ declare function DialogHeader({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
293
+ declare function DialogFooter({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
294
+ declare function DialogTitle({ className, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
295
+ declare function DialogDescription({ className, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
296
+
297
+ interface DialogContainerProps {
298
+ open?: boolean;
299
+ onOpenChange?: (open: boolean) => void;
300
+ triggerElement: React$1.ReactNode;
301
+ title: string;
302
+ description?: string;
303
+ children?: React$1.ReactNode;
304
+ submitLoader?: boolean;
305
+ submitLabel?: string;
306
+ cancelLabel?: string;
307
+ backLabel?: string;
308
+ onSubmit?: () => void;
309
+ onCancel?: () => void;
310
+ onBack?: () => void;
311
+ isSubmitDisabled?: boolean;
312
+ fullScreen?: boolean;
313
+ showCloseButton?: boolean;
314
+ showCancelButton?: boolean;
315
+ showSubmitButton?: boolean;
316
+ customFooter?: React$1.ReactNode;
317
+ }
318
+ declare function DialogContainer({ open, onOpenChange, triggerElement, title, description, children, submitLoader, submitLabel, cancelLabel, backLabel, onSubmit, onCancel, onBack, isSubmitDisabled, fullScreen, showCloseButton, showCancelButton, showSubmitButton, customFooter, }: Readonly<DialogContainerProps>): react_jsx_runtime.JSX.Element;
319
+
320
+ type Orientation = 'horizontal' | 'vertical';
321
+ interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {
322
+ orientation?: Orientation;
323
+ color?: string;
324
+ }
325
+
326
+ declare const Divider: React$1.FC<DividerProps>;
327
+
328
+ interface PillsProps {
329
+ label: string;
330
+ size?: 'default' | 'small';
331
+ variant?: 'filled' | 'outlined';
332
+ color?: 'primary' | 'secondary' | 'warning' | 'error' | 'info' | 'success';
333
+ onClick?: () => void;
334
+ disabled?: boolean;
335
+ className?: string;
336
+ }
337
+
338
+ declare const Pills: ({ label, size, variant, color, onClick, disabled, className, }: PillsProps) => react_jsx_runtime.JSX.Element;
339
+
340
+ type EllipsisMode = 'end' | 'middle';
341
+ interface EllipsisTextProps extends React.HTMLAttributes<HTMLSpanElement> {
342
+ text: string;
343
+ maxLength?: number;
344
+ mode?: EllipsisMode;
345
+ width?: string;
346
+ }
347
+
348
+ declare const EllipsisText: React$1.FC<EllipsisTextProps>;
349
+
350
+ declare const tabsTriggerVariants: (props?: ({
351
+ color?: "primary" | "secondary" | null | undefined;
352
+ orientation?: "horizontal" | "vertical" | null | undefined;
353
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
354
+
355
+ type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger> & VariantProps<typeof tabsTriggerVariants> & {
356
+ icon?: ReactNode;
357
+ iconPosition?: 'left' | 'right';
358
+ vertical?: boolean;
359
+ onClick?: () => void;
360
+ };
361
+
362
+ declare function Tabs({ className, ...props }: ComponentProps<typeof TabsPrimitive.Root>): react_jsx_runtime.JSX.Element;
363
+ declare function TabsList({ className, vertical, ...props }: ComponentProps<typeof TabsPrimitive.List> & {
364
+ vertical?: boolean;
365
+ }): react_jsx_runtime.JSX.Element;
366
+ declare function TabsTrigger({ icon, iconPosition, vertical, color, className, children, ...props }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
367
+ declare function TabsContent({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>): react_jsx_runtime.JSX.Element;
368
+
369
+ declare function Avatar({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Root>): react_jsx_runtime.JSX.Element;
370
+ declare function AvatarImage({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Image>): react_jsx_runtime.JSX.Element;
371
+ declare function AvatarFallback({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Fallback>): react_jsx_runtime.JSX.Element;
372
+
373
+ interface SpinnerProps {
374
+ size?: number;
375
+ color?: string;
376
+ className?: string;
377
+ 'aria-label'?: string;
378
+ }
379
+
380
+ declare function Spinner({ size, color, className, 'aria-label': ariaLabel, }: SpinnerProps): react_jsx_runtime.JSX.Element;
381
+
382
+ interface UICreditCardProps {
383
+ cardholderName: string;
384
+ cardholderNameLabel?: string;
385
+ cardNumber: string;
386
+ cardNumberLabel?: string;
387
+ frontImageUrl: string;
388
+ backImageUrl: string;
389
+ cvv?: string;
390
+ cvvLabel?: string;
391
+ expiryDate?: string;
392
+ expiryDateLabel?: string;
393
+ aspectRatio?: number;
394
+ classNames?: {
395
+ container?: string;
396
+ front?: string;
397
+ back?: string;
398
+ fieldLabel?: string;
399
+ fieldValue?: string;
400
+ copyIcon?: string;
401
+ };
402
+ customFrontContent?: React.ReactNode;
403
+ customBackContent?: React.ReactNode;
404
+ isFlipped?: boolean;
405
+ enableCopy?: boolean;
406
+ }
407
+
408
+ declare const UICreditCard: ({ cvv, cvvLabel, cardNumber, cardNumberLabel, expiryDate, expiryDateLabel, enableCopy, classNames, backImageUrl, frontImageUrl, cardholderName, cardholderNameLabel, isFlipped, customBackContent, customFrontContent, aspectRatio, }: UICreditCardProps) => JSX.Element;
409
+
410
+ interface CopyButtonProps {
411
+ value: string;
412
+ className?: string;
413
+ }
414
+
415
+ declare const CopyButton: ({ value, className }: CopyButtonProps) => react_jsx_runtime.JSX.Element;
416
+
417
+ interface Step<T extends string = string, P = unknown> {
418
+ id: T;
419
+ label: string;
420
+ content: React.ReactNode | ((props: P & {
421
+ step: T;
422
+ }) => React.ReactNode);
423
+ }
424
+ interface StepperProps<T extends string, P = unknown> {
425
+ steps: Step<T, P>[];
426
+ currentStep: T;
427
+ onStepChange?: (step: T) => void;
428
+ contentProps?: P;
429
+ className?: string;
430
+ showIndicators?: boolean;
431
+ orientation?: 'horizontal' | 'vertical';
432
+ }
433
+
434
+ declare function Stepper<T extends string>({ steps, currentStep, onStepChange, contentProps, className, showIndicators, orientation, }: Readonly<StepperProps<T>>): react_jsx_runtime.JSX.Element;
435
+
436
+ declare function useStepper<T extends string>(steps: T[], initialStep?: T): {
437
+ currentStep: T;
438
+ currentIndex: number;
439
+ isFirst: boolean;
440
+ isLast: boolean;
441
+ goNext: () => void;
442
+ goBack: () => void;
443
+ goTo: (step: T) => void;
444
+ reset: () => void;
445
+ };
446
+
447
+ interface SkeletonProps {
448
+ variant?: 'text' | 'rectangular' | 'circular' | 'rounded';
449
+ width?: number | string;
450
+ height?: number | string;
451
+ animation?: 'pulse' | 'wave' | false;
452
+ className?: string;
453
+ style?: React.CSSProperties;
454
+ }
455
+
456
+ declare function Skeleton({ variant, width, height, animation, className, style }: SkeletonProps): react_jsx_runtime.JSX.Element;
457
+
458
+ interface CounterProps {
459
+ to: number;
460
+ from?: number;
461
+ duration?: number;
462
+ autoStart?: boolean;
463
+ prefix?: string;
464
+ suffix?: string;
465
+ decimals?: number;
466
+ separator?: string;
467
+ className?: string;
468
+ style?: React.CSSProperties;
469
+ onComplete?: () => void;
470
+ triggerOnVisible?: boolean;
471
+ }
472
+
473
+ declare function Counter({ to, from, duration, autoStart, prefix, suffix, decimals, separator, className, style, onComplete, triggerOnVisible, }: CounterProps): react_jsx_runtime.JSX.Element;
474
+
475
+ interface SearchInputProps {
476
+ onSearch: (query: string) => void;
477
+ onClear?: () => void;
478
+ debounce?: number;
479
+ minChars?: number;
480
+ maxChars?: number;
481
+ placeholder?: string;
482
+ clearIcon?: React.ReactNode;
483
+ className?: string;
484
+ }
485
+
486
+ declare const SearchInput: React__default.FC<SearchInputProps>;
487
+
488
+ export { Alert, AlertContainer, type AlertContainerProps, type AlertProps, Avatar, AvatarFallback, AvatarImage, Button, Card, CardAction, CardContainer, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type ColorVariant, CopyButton, type CopyButtonProps, Counter, type CounterProps, Dialog, DialogClose, DialogContainer, type DialogContainerProps, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DropdownWrapper, EllipsisText, type FlexColumnDef, type InfiniteScrollOptions, Input, type InputProps, Label, type PaginationMode, Pills, type PillsProps, RadioGroup, RadioGroupItem, SearchInput, type SearchInputProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectWrapper, type SelectWrapperOptions, type SelectWrapperProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type Step, Stepper, type StepperProps, Switch, Table, type TableProps, Tabs, TabsContent, TabsList, TabsTrigger, type TabsTriggerProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UICreditCard, type UIKitColors, type UIKitConfig, UIKitProvider, type VirtualizationOptions, useStepper, useUIKitTheme };
@@ -0,0 +1,488 @@
1
+ import * as React$1 from 'react';
2
+ import React__default, { PropsWithChildren, InputHTMLAttributes, ComponentProps, ReactNode, JSX } from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
+ import { ColumnDef, SortingState, Row } from '@tanstack/react-table';
7
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
8
+ import * as SelectPrimitive from '@radix-ui/react-select';
9
+ import { SelectTrigger as SelectTrigger$1, SelectContent as SelectContent$1 } from '@radix-ui/react-select';
10
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
11
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
12
+ import { Checkbox as Checkbox$1 } from '@radix-ui/react-checkbox';
13
+ import * as SwitchPrimitives from '@radix-ui/react-switch';
14
+ import { Switch as Switch$1 } from '@radix-ui/react-switch';
15
+ import * as LabelPrimitive from '@radix-ui/react-label';
16
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
17
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
18
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
19
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
20
+
21
+ type ColorVariant = string | {
22
+ light: string;
23
+ dark: string;
24
+ };
25
+ type UIKitColors = {
26
+ primary?: ColorVariant;
27
+ secondary?: ColorVariant;
28
+ accent?: ColorVariant;
29
+ success?: ColorVariant;
30
+ warning?: ColorVariant;
31
+ error?: ColorVariant;
32
+ info?: ColorVariant;
33
+ background?: ColorVariant;
34
+ foreground?: ColorVariant;
35
+ textPrimary?: ColorVariant;
36
+ textSecondary?: ColorVariant;
37
+ [key: string]: ColorVariant | undefined;
38
+ };
39
+ type UIKitConfig = {
40
+ colors?: UIKitColors;
41
+ radius?: string;
42
+ fontFamily?: string;
43
+ [key: string]: unknown;
44
+ };
45
+
46
+ declare const UIKitProvider: React__default.FC<PropsWithChildren<{
47
+ config?: UIKitConfig;
48
+ }>>;
49
+
50
+ declare const useUIKitTheme: () => UIKitConfig;
51
+
52
+ declare const buttonVariants: (props?: ({
53
+ variant?: "primary" | "secondary" | "primaryFilled" | "primaryOutlined" | "primaryText" | "secondaryFilled" | "secondaryOutlined" | "secondaryText" | "outlined" | "ghost" | "destructive" | null | undefined;
54
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
55
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
56
+
57
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
58
+ children: React.ReactNode;
59
+ asChild?: boolean;
60
+ loading?: boolean;
61
+ loadingText?: string;
62
+ icon?: React.ReactNode;
63
+ iconPosition?: 'left' | 'right';
64
+ }
65
+
66
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
67
+
68
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
69
+ label?: string;
70
+ error?: string;
71
+ helperText?: string;
72
+ icon?: React.ReactNode;
73
+ variant?: 'default' | 'search';
74
+ }
75
+
76
+ declare const Input: React__default.ForwardRefExoticComponent<InputProps & React__default.RefAttributes<HTMLInputElement>>;
77
+
78
+ type DropdownStructure = 'default' | 'checkbox' | 'radio' | 'grouped' | 'submenu';
79
+ type DropdownOption = {
80
+ label: string;
81
+ value?: string;
82
+ checked?: boolean;
83
+ onCheckedChange?: (checked: boolean) => void;
84
+ onClick?: () => void;
85
+ disabled?: boolean;
86
+ subOptions?: DropdownOption[];
87
+ groupLabel?: string;
88
+ };
89
+
90
+ type FlexColumnDef<T> = ColumnDef<T> & {
91
+ flex?: number;
92
+ };
93
+ type InfiniteScrollOptions = {
94
+ enabled: boolean;
95
+ hasNextPage: boolean;
96
+ isFetchingNextPage?: boolean;
97
+ fetchNextPage: () => void;
98
+ rootMarginPx?: number;
99
+ loadingMoreMessage?: string;
100
+ noMoreDataMessage?: string;
101
+ };
102
+ type PaginationMode = 'client' | 'server' | 'none';
103
+ interface VirtualizationOptions {
104
+ enabled: boolean;
105
+ rowEstimate?: number;
106
+ overscan?: number;
107
+ }
108
+ interface TableProps<T> {
109
+ id: string;
110
+ height?: number | string;
111
+ data: T[];
112
+ columns: FlexColumnDef<T>[];
113
+ rowIdKey?: keyof T | 'id';
114
+ className?: string;
115
+ isLoading?: boolean;
116
+ showSkeletonRows?: boolean;
117
+ checkboxSelection?: boolean;
118
+ checkboxPosition?: 'start' | 'end';
119
+ sorting?: SortingState;
120
+ onSortingChange?: (s: SortingState) => void;
121
+ onSelectionChange?: (selectedIds: string[]) => void;
122
+ enableRowSelection?: (row: Row<T>) => boolean;
123
+ onRefetch?: (pageIndex: number, pageSize: number) => void;
124
+ isMultiRowSelection?: boolean;
125
+ totalServerRows?: number;
126
+ paginationMode?: PaginationMode;
127
+ noRowsMessage?: string;
128
+ rowsPerPage?: number;
129
+ selectedRowIds?: string[];
130
+ tableActionsDropdown?: {
131
+ getOptions: (row: T) => DropdownOption[];
132
+ structure?: DropdownStructure;
133
+ renderCustomTrigger?: (row: T) => React.ReactNode;
134
+ menuAlignment?: 'start' | 'end' | 'center' | undefined;
135
+ isDisabled?: boolean | ((row: T) => boolean);
136
+ };
137
+ onRowClick?: (row: T) => void;
138
+ isRowClickable?: (row: T) => boolean;
139
+ showHeader?: boolean;
140
+ grouping?: string[];
141
+ isSearchActive?: boolean;
142
+ noSearchResultsMessage?: string;
143
+ infiniteScroll?: InfiniteScrollOptions;
144
+ virtualization?: VirtualizationOptions;
145
+ }
146
+
147
+ declare function Table<T extends {
148
+ id: string;
149
+ }>(props: Readonly<TableProps<T>>): react_jsx_runtime.JSX.Element;
150
+
151
+ declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
152
+ declare const Tooltip: React$1.FC<TooltipPrimitive.TooltipProps>;
153
+ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
154
+ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
155
+
156
+ interface SelectTriggerProps extends ComponentProps<typeof SelectTrigger$1> {
157
+ error?: boolean;
158
+ size?: 'sm' | 'md';
159
+ }
160
+ interface SelectContentProps extends ComponentProps<typeof SelectContent$1> {
161
+ showAlwaysSearch?: boolean;
162
+ searchPlaceholder?: string;
163
+ }
164
+
165
+ declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
166
+ declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
167
+ declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
168
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & SelectTriggerProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
169
+ declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
170
+ declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
171
+ declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & SelectContentProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
172
+ declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
173
+ declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
174
+ declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
175
+
176
+ interface SelectWrapperOptions {
177
+ label: string;
178
+ value: string;
179
+ }
180
+ interface SelectWrapperProps {
181
+ label?: string;
182
+ options: SelectWrapperOptions[];
183
+ value: string;
184
+ onChange: (value: string) => void;
185
+ size?: 'small' | 'default';
186
+ disabled?: boolean;
187
+ error?: boolean;
188
+ placeholder?: string;
189
+ className?: string;
190
+ }
191
+
192
+ declare const SelectWrapper: ({ label, options, value, onChange, size, disabled, error, placeholder, className, }: SelectWrapperProps) => react_jsx_runtime.JSX.Element;
193
+
194
+ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
195
+ declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
196
+
197
+ interface CheckboxProps extends ComponentProps<typeof Checkbox$1> {
198
+ label?: string;
199
+ labelPosition?: 'left' | 'right' | 'top' | 'bottom';
200
+ }
201
+
202
+ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<Omit<CheckboxPrimitive.CheckboxProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & CheckboxProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
203
+
204
+ interface SwitchProps extends ComponentProps<typeof Switch$1> {
205
+ label?: string;
206
+ labelPosition?: 'left' | 'right' | 'top' | 'bottom';
207
+ }
208
+
209
+ declare const Switch: React$1.ForwardRefExoticComponent<Omit<Omit<SwitchPrimitives.SwitchProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & SwitchProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
210
+
211
+ declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_dist_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
212
+
213
+ declare const DropdownWrapper: ({ triggerElement, options, className, structure, selectedValue, onValueChange, menuAlignment, isTriggerElementDisabled, }: {
214
+ triggerElement: React__default.ReactNode;
215
+ options: DropdownOption[];
216
+ className?: string;
217
+ structure?: DropdownStructure;
218
+ selectedValue?: string;
219
+ onValueChange?: (value: string) => void;
220
+ menuAlignment?: "start" | "end" | "center";
221
+ isTriggerElementDisabled?: boolean;
222
+ }) => react_jsx_runtime.JSX.Element;
223
+
224
+ declare function DropdownMenu({ ...props }: Readonly<React$1.ComponentProps<typeof DropdownMenuPrimitive.Root>>): react_jsx_runtime.JSX.Element;
225
+ declare function DropdownMenuPortal({ ...props }: Readonly<React$1.ComponentProps<typeof DropdownMenuPrimitive.Portal>>): react_jsx_runtime.JSX.Element;
226
+ declare function DropdownMenuTrigger({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
227
+ declare function DropdownMenuContent({ className, sideOffset, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Content>): react_jsx_runtime.JSX.Element;
228
+ declare function DropdownMenuGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Group>): react_jsx_runtime.JSX.Element;
229
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
230
+ inset?: boolean;
231
+ variant?: 'default' | 'destructive';
232
+ }): react_jsx_runtime.JSX.Element;
233
+ declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): react_jsx_runtime.JSX.Element;
234
+ declare function DropdownMenuRadioGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): react_jsx_runtime.JSX.Element;
235
+ declare function DropdownMenuRadioItem({ className, children, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): react_jsx_runtime.JSX.Element;
236
+ declare function DropdownMenuLabel({ className, inset, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
237
+ inset?: boolean;
238
+ }): react_jsx_runtime.JSX.Element;
239
+ declare function DropdownMenuSeparator({ className, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Separator>): react_jsx_runtime.JSX.Element;
240
+ declare function DropdownMenuShortcut({ className, ...props }: React$1.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
241
+ declare function DropdownMenuSub({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Sub>): react_jsx_runtime.JSX.Element;
242
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
243
+ inset?: boolean;
244
+ }): react_jsx_runtime.JSX.Element;
245
+ declare function DropdownMenuSubContent({ className, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): react_jsx_runtime.JSX.Element;
246
+
247
+ declare const Card: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
248
+ declare const CardHeader: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
249
+ declare const CardTitle: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
250
+ declare const CardDescription: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
251
+ declare const CardAction: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
252
+ declare const CardContent: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
253
+ declare const CardFooter: ({ className, ...props }: ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
254
+
255
+ interface CardContainerProps {
256
+ title: string;
257
+ icon: ReactNode;
258
+ children: ReactNode;
259
+ className?: string;
260
+ }
261
+ declare const CardContainer: ({ title, icon, children, className }: CardContainerProps) => react_jsx_runtime.JSX.Element;
262
+
263
+ declare const alertVariants: (props?: ({
264
+ variant?: "success" | "warning" | "error" | "default" | null | undefined;
265
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
266
+
267
+ type AlertProps = React.ComponentProps<'div'> & VariantProps<typeof alertVariants> & {
268
+ onClose?: () => void;
269
+ isVisible?: boolean;
270
+ disableAnimation?: boolean;
271
+ position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
272
+ };
273
+
274
+ declare function Alert({ className, variant, onClose, isVisible, disableAnimation, position, ...props }: AlertProps): react_jsx_runtime.JSX.Element | null;
275
+
276
+ type AlertContainerProps = AlertProps & {
277
+ title?: string;
278
+ description?: string;
279
+ icon?: React.ReactNode;
280
+ };
281
+
282
+ declare const AlertContainer: ({ variant, isVisible, title, description, onClose, className, disableAnimation, position, icon, }: AlertContainerProps) => react_jsx_runtime.JSX.Element;
283
+
284
+ declare function Dialog({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
285
+ declare function DialogTrigger({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
286
+ declare function DialogPortal({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Portal>): react_jsx_runtime.JSX.Element;
287
+ declare function DialogClose({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
288
+ declare function DialogOverlay({ className, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Overlay>): react_jsx_runtime.JSX.Element;
289
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Content> & {
290
+ showCloseButton?: boolean;
291
+ }): react_jsx_runtime.JSX.Element;
292
+ declare function DialogHeader({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
293
+ declare function DialogFooter({ className, ...props }: React$1.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
294
+ declare function DialogTitle({ className, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
295
+ declare function DialogDescription({ className, ...props }: React$1.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
296
+
297
+ interface DialogContainerProps {
298
+ open?: boolean;
299
+ onOpenChange?: (open: boolean) => void;
300
+ triggerElement: React$1.ReactNode;
301
+ title: string;
302
+ description?: string;
303
+ children?: React$1.ReactNode;
304
+ submitLoader?: boolean;
305
+ submitLabel?: string;
306
+ cancelLabel?: string;
307
+ backLabel?: string;
308
+ onSubmit?: () => void;
309
+ onCancel?: () => void;
310
+ onBack?: () => void;
311
+ isSubmitDisabled?: boolean;
312
+ fullScreen?: boolean;
313
+ showCloseButton?: boolean;
314
+ showCancelButton?: boolean;
315
+ showSubmitButton?: boolean;
316
+ customFooter?: React$1.ReactNode;
317
+ }
318
+ declare function DialogContainer({ open, onOpenChange, triggerElement, title, description, children, submitLoader, submitLabel, cancelLabel, backLabel, onSubmit, onCancel, onBack, isSubmitDisabled, fullScreen, showCloseButton, showCancelButton, showSubmitButton, customFooter, }: Readonly<DialogContainerProps>): react_jsx_runtime.JSX.Element;
319
+
320
+ type Orientation = 'horizontal' | 'vertical';
321
+ interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {
322
+ orientation?: Orientation;
323
+ color?: string;
324
+ }
325
+
326
+ declare const Divider: React$1.FC<DividerProps>;
327
+
328
+ interface PillsProps {
329
+ label: string;
330
+ size?: 'default' | 'small';
331
+ variant?: 'filled' | 'outlined';
332
+ color?: 'primary' | 'secondary' | 'warning' | 'error' | 'info' | 'success';
333
+ onClick?: () => void;
334
+ disabled?: boolean;
335
+ className?: string;
336
+ }
337
+
338
+ declare const Pills: ({ label, size, variant, color, onClick, disabled, className, }: PillsProps) => react_jsx_runtime.JSX.Element;
339
+
340
+ type EllipsisMode = 'end' | 'middle';
341
+ interface EllipsisTextProps extends React.HTMLAttributes<HTMLSpanElement> {
342
+ text: string;
343
+ maxLength?: number;
344
+ mode?: EllipsisMode;
345
+ width?: string;
346
+ }
347
+
348
+ declare const EllipsisText: React$1.FC<EllipsisTextProps>;
349
+
350
+ declare const tabsTriggerVariants: (props?: ({
351
+ color?: "primary" | "secondary" | null | undefined;
352
+ orientation?: "horizontal" | "vertical" | null | undefined;
353
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
354
+
355
+ type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger> & VariantProps<typeof tabsTriggerVariants> & {
356
+ icon?: ReactNode;
357
+ iconPosition?: 'left' | 'right';
358
+ vertical?: boolean;
359
+ onClick?: () => void;
360
+ };
361
+
362
+ declare function Tabs({ className, ...props }: ComponentProps<typeof TabsPrimitive.Root>): react_jsx_runtime.JSX.Element;
363
+ declare function TabsList({ className, vertical, ...props }: ComponentProps<typeof TabsPrimitive.List> & {
364
+ vertical?: boolean;
365
+ }): react_jsx_runtime.JSX.Element;
366
+ declare function TabsTrigger({ icon, iconPosition, vertical, color, className, children, ...props }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
367
+ declare function TabsContent({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>): react_jsx_runtime.JSX.Element;
368
+
369
+ declare function Avatar({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Root>): react_jsx_runtime.JSX.Element;
370
+ declare function AvatarImage({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Image>): react_jsx_runtime.JSX.Element;
371
+ declare function AvatarFallback({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Fallback>): react_jsx_runtime.JSX.Element;
372
+
373
+ interface SpinnerProps {
374
+ size?: number;
375
+ color?: string;
376
+ className?: string;
377
+ 'aria-label'?: string;
378
+ }
379
+
380
+ declare function Spinner({ size, color, className, 'aria-label': ariaLabel, }: SpinnerProps): react_jsx_runtime.JSX.Element;
381
+
382
+ interface UICreditCardProps {
383
+ cardholderName: string;
384
+ cardholderNameLabel?: string;
385
+ cardNumber: string;
386
+ cardNumberLabel?: string;
387
+ frontImageUrl: string;
388
+ backImageUrl: string;
389
+ cvv?: string;
390
+ cvvLabel?: string;
391
+ expiryDate?: string;
392
+ expiryDateLabel?: string;
393
+ aspectRatio?: number;
394
+ classNames?: {
395
+ container?: string;
396
+ front?: string;
397
+ back?: string;
398
+ fieldLabel?: string;
399
+ fieldValue?: string;
400
+ copyIcon?: string;
401
+ };
402
+ customFrontContent?: React.ReactNode;
403
+ customBackContent?: React.ReactNode;
404
+ isFlipped?: boolean;
405
+ enableCopy?: boolean;
406
+ }
407
+
408
+ declare const UICreditCard: ({ cvv, cvvLabel, cardNumber, cardNumberLabel, expiryDate, expiryDateLabel, enableCopy, classNames, backImageUrl, frontImageUrl, cardholderName, cardholderNameLabel, isFlipped, customBackContent, customFrontContent, aspectRatio, }: UICreditCardProps) => JSX.Element;
409
+
410
+ interface CopyButtonProps {
411
+ value: string;
412
+ className?: string;
413
+ }
414
+
415
+ declare const CopyButton: ({ value, className }: CopyButtonProps) => react_jsx_runtime.JSX.Element;
416
+
417
+ interface Step<T extends string = string, P = unknown> {
418
+ id: T;
419
+ label: string;
420
+ content: React.ReactNode | ((props: P & {
421
+ step: T;
422
+ }) => React.ReactNode);
423
+ }
424
+ interface StepperProps<T extends string, P = unknown> {
425
+ steps: Step<T, P>[];
426
+ currentStep: T;
427
+ onStepChange?: (step: T) => void;
428
+ contentProps?: P;
429
+ className?: string;
430
+ showIndicators?: boolean;
431
+ orientation?: 'horizontal' | 'vertical';
432
+ }
433
+
434
+ declare function Stepper<T extends string>({ steps, currentStep, onStepChange, contentProps, className, showIndicators, orientation, }: Readonly<StepperProps<T>>): react_jsx_runtime.JSX.Element;
435
+
436
+ declare function useStepper<T extends string>(steps: T[], initialStep?: T): {
437
+ currentStep: T;
438
+ currentIndex: number;
439
+ isFirst: boolean;
440
+ isLast: boolean;
441
+ goNext: () => void;
442
+ goBack: () => void;
443
+ goTo: (step: T) => void;
444
+ reset: () => void;
445
+ };
446
+
447
+ interface SkeletonProps {
448
+ variant?: 'text' | 'rectangular' | 'circular' | 'rounded';
449
+ width?: number | string;
450
+ height?: number | string;
451
+ animation?: 'pulse' | 'wave' | false;
452
+ className?: string;
453
+ style?: React.CSSProperties;
454
+ }
455
+
456
+ declare function Skeleton({ variant, width, height, animation, className, style }: SkeletonProps): react_jsx_runtime.JSX.Element;
457
+
458
+ interface CounterProps {
459
+ to: number;
460
+ from?: number;
461
+ duration?: number;
462
+ autoStart?: boolean;
463
+ prefix?: string;
464
+ suffix?: string;
465
+ decimals?: number;
466
+ separator?: string;
467
+ className?: string;
468
+ style?: React.CSSProperties;
469
+ onComplete?: () => void;
470
+ triggerOnVisible?: boolean;
471
+ }
472
+
473
+ declare function Counter({ to, from, duration, autoStart, prefix, suffix, decimals, separator, className, style, onComplete, triggerOnVisible, }: CounterProps): react_jsx_runtime.JSX.Element;
474
+
475
+ interface SearchInputProps {
476
+ onSearch: (query: string) => void;
477
+ onClear?: () => void;
478
+ debounce?: number;
479
+ minChars?: number;
480
+ maxChars?: number;
481
+ placeholder?: string;
482
+ clearIcon?: React.ReactNode;
483
+ className?: string;
484
+ }
485
+
486
+ declare const SearchInput: React__default.FC<SearchInputProps>;
487
+
488
+ export { Alert, AlertContainer, type AlertContainerProps, type AlertProps, Avatar, AvatarFallback, AvatarImage, Button, Card, CardAction, CardContainer, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type ColorVariant, CopyButton, type CopyButtonProps, Counter, type CounterProps, Dialog, DialogClose, DialogContainer, type DialogContainerProps, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DropdownWrapper, EllipsisText, type FlexColumnDef, type InfiniteScrollOptions, Input, type InputProps, Label, type PaginationMode, Pills, type PillsProps, RadioGroup, RadioGroupItem, SearchInput, type SearchInputProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectWrapper, type SelectWrapperOptions, type SelectWrapperProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type Step, Stepper, type StepperProps, Switch, Table, type TableProps, Tabs, TabsContent, TabsList, TabsTrigger, type TabsTriggerProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UICreditCard, type UIKitColors, type UIKitConfig, UIKitProvider, type VirtualizationOptions, useStepper, useUIKitTheme };
@@ -3,9 +3,10 @@ import { Combobox as ComboboxPrimitive } from '@base-ui/react';
3
3
  declare const Combobox: typeof ComboboxPrimitive.Root;
4
4
  declare function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props): import("react/jsx-runtime").JSX.Element;
5
5
  declare function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
6
- declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxPrimitive.Input.Props & {
6
+ declare function ComboboxInput({ className, children, disabled, isLoading, showTrigger, showClear, ...props }: ComboboxPrimitive.Input.Props & {
7
7
  showTrigger?: boolean;
8
8
  showClear?: boolean;
9
+ isLoading?: boolean;
9
10
  }): import("react/jsx-runtime").JSX.Element;
10
11
  declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>): import("react/jsx-runtime").JSX.Element;
11
12
  declare function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props): import("react/jsx-runtime").JSX.Element;
@@ -24,5 +25,4 @@ declare function ComboboxChip({ className, children, showRemove, ...props }: Com
24
25
  showRemove?: boolean;
25
26
  }): import("react/jsx-runtime").JSX.Element;
26
27
  declare function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props): import("react/jsx-runtime").JSX.Element;
27
- declare function useComboboxAnchor(): React.MutableRefObject<HTMLDivElement | null>;
28
- export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
28
+ export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, };
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from 'react';
4
3
  import { Combobox as ComboboxPrimitive } from '@base-ui/react';
5
4
  import { cn } from '../../lib/utils';
6
5
  import { Button } from '../../components/Button';
7
6
  import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '../../components/InputGroup';
7
+ import { Spinner } from '../../components/Spinner';
8
8
  import { ChevronDownIcon, XIcon, CheckIcon } from 'lucide-react';
9
9
  const Combobox = ComboboxPrimitive.Root;
10
10
  function ComboboxValue({ ...props }) {
@@ -16,11 +16,13 @@ function ComboboxTrigger({ className, children, ...props }) {
16
16
  function ComboboxClear({ className, ...props }) {
17
17
  return (_jsx(ComboboxPrimitive.Clear, { "data-slot": "combobox-clear", className: cn(className), ...props, render: _jsx(InputGroupButton, { variant: "ghost", size: "xs", className: "hover:border-transparent hover:bg-gray-100 disabled:bg-transparent", children: _jsx(XIcon, { className: "pointer-events-none" }) }) }));
18
18
  }
19
- function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
20
- return (_jsxs(InputGroup, { className: cn('w-auto', className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: disabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "xs", variant: "ghost", "data-slot": "input-group-button", className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent hover:border-transparent hover:bg-gray-100 disabled:bg-transparent", disabled: disabled, children: _jsx(ComboboxTrigger, {}) })), showClear && _jsx(ComboboxClear, { disabled: disabled })] }), children] }));
19
+ function ComboboxInput({ className, children, disabled = false, isLoading = false, showTrigger = true, showClear = false, ...props }) {
20
+ const isDisabled = disabled || isLoading;
21
+ return (_jsxs(InputGroup, { className: cn('w-auto', className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: isDisabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && !isLoading && (_jsx(InputGroupButton, { size: "xs", variant: "ghost", "data-slot": "input-group-button", className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent hover:border-transparent hover:bg-gray-100 disabled:bg-transparent", disabled: isDisabled, children: _jsx(ComboboxTrigger, {}) })), showClear &&
22
+ (isLoading ? (_jsx(InputGroupButton, { variant: "ghost", size: "xs", disabled: true, className: "hover:border-transparent hover:bg-gray-100 disabled:bg-transparent", children: _jsx(Spinner, { size: 14, color: "var(--uikit-primary)", "aria-label": "Loading options" }) })) : (_jsx(ComboboxClear, { disabled: isDisabled })))] }), children] }));
21
23
  }
22
24
  function ComboboxContent({ className, side = 'bottom', sideOffset = 6, align = 'start', alignOffset = 0, anchor, ...props }) {
23
- return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, className: cn('bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:border-input/30 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)', className), ...props }) }) }));
25
+ return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": Boolean(anchor), className: cn('bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:border-input/30 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)', className), ...props }) }) }));
24
26
  }
25
27
  function ComboboxList({ className, ...props }) {
26
28
  return (_jsx(ComboboxPrimitive.List, { "data-slot": "combobox-list", className: cn('no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 p-1 data-empty:p-0 overflow-y-auto overscroll-contain', className), ...props }));
@@ -52,7 +54,4 @@ function ComboboxChip({ className, children, showRemove = true, ...props }) {
52
54
  function ComboboxChipsInput({ className, ...props }) {
53
55
  return (_jsx(ComboboxPrimitive.Input, { "data-slot": "combobox-chip-input", className: cn('min-w-16 flex-1 outline-none', className), ...props }));
54
56
  }
55
- function useComboboxAnchor() {
56
- return React.useRef(null);
57
- }
58
- export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
57
+ export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, };
@@ -9,4 +9,5 @@ export declare const WithAddButton: Story;
9
9
  export declare const MultiSelect: Story;
10
10
  export declare const WithGroups: Story;
11
11
  export declare const Disabled: Story;
12
+ export declare const LoadingItems: Story;
12
13
  export declare const WithCustomContent: Story;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
- import { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, useComboboxAnchor, ComboboxValue, ComboboxCollection, } from './Combobox';
3
+ import { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxValue, ComboboxCollection, } from './Combobox';
4
+ import { useComboboxAnchor } from './useComboboxAnchor';
4
5
  const meta = {
5
6
  title: 'UIKit/Combobox',
6
7
  component: Combobox,
@@ -74,6 +75,9 @@ export const WithGroups = {
74
75
  export const Disabled = {
75
76
  render: () => (_jsxs(Combobox, { items: fruits, disabled: true, defaultInputValue: fruits[0], children: [_jsx(ComboboxInput, { placeholder: "Search fruits...", disabled: true }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: "No fruits found" }), _jsx(ComboboxList, { children: (fruit) => (_jsx(ComboboxItem, { value: fruit, children: fruit }, fruit)) })] })] })),
76
77
  };
78
+ export const LoadingItems = {
79
+ render: () => (_jsxs(Combobox, { items: [], children: [_jsx(ComboboxInput, { placeholder: "Loading fruits...", showClear: true, isLoading: true }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: "Loading fruits..." }), _jsx(ComboboxList, { children: (item) => (_jsx(ComboboxItem, { value: item, children: item }, item)) })] })] })),
80
+ };
77
81
  const users = [
78
82
  { id: 1, name: 'John Doe', email: 'john@example.com', role: 'Developer' },
79
83
  { id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'Designer' },
@@ -1 +1,2 @@
1
1
  export * from './Combobox';
2
+ export * from './useComboboxAnchor';
@@ -1 +1,2 @@
1
1
  export * from './Combobox';
2
+ export * from './useComboboxAnchor';
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare function useComboboxAnchor(): React.MutableRefObject<HTMLDivElement | null>;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ export function useComboboxAnchor() {
3
+ return React.useRef(null);
4
+ }
@@ -0,0 +1 @@
1
+ export { BaseTable } from './BaseTable';
@@ -0,0 +1 @@
1
+ export { BaseTable } from './BaseTable';
@@ -128,6 +128,11 @@ const groupingData = Array.from({ length: 5 }).map((_, i) => ({
128
128
  name: `User ${i + 1}`,
129
129
  amount: getRandomInt(1000) + 100,
130
130
  }));
131
+ const formatNumber = (amount) => new Intl.NumberFormat('en-US', {
132
+ style: 'currency',
133
+ currency: 'GBP',
134
+ minimumFractionDigits: 2,
135
+ }).format(amount);
131
136
  const groupingColumns = [
132
137
  {
133
138
  accessorKey: 'name',
@@ -138,7 +143,10 @@ const groupingColumns = [
138
143
  accessorKey: 'amount',
139
144
  header: 'Amount',
140
145
  flex: 1,
141
- cell: ({ row }) => (_jsxs("span", { style: { textAlign: 'right', display: 'block' }, children: ["$", row.original.amount.toFixed(2)] })),
146
+ meta: {
147
+ groupTotalFormatter: (amount) => formatNumber(amount),
148
+ },
149
+ cell: ({ row }) => (_jsx("span", { style: { textAlign: 'right', display: 'block' }, children: formatNumber(row.original.amount) })),
142
150
  },
143
151
  {
144
152
  accessorKey: 'date',
@@ -5,6 +5,13 @@ declare module '@tanstack/react-table' {
5
5
  interface TableMeta<TData> {
6
6
  hasActions?: boolean;
7
7
  }
8
+ interface ColumnMeta<TData, TValue> {
9
+ isSelectionColumn?: boolean;
10
+ bgColor?: string;
11
+ groupTotalFormatter?: (value: number, context: {
12
+ rows: TData[];
13
+ }) => ReactNode;
14
+ }
8
15
  }
9
16
  export type FlexColumnDef<T> = ColumnDef<T> & {
10
17
  flex?: number;
@@ -1,14 +1,49 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { classNames } from '../../../utils';
3
3
  export function renderGroupRow({ row, onGroupRowClick }) {
4
+ var _a;
4
5
  const columnId = row.groupingColumnId;
5
6
  const groupValue = row.getGroupingValue(columnId);
6
7
  const clickable = Boolean(onGroupRowClick);
8
+ const leafRows = row.getLeafRows();
9
+ const totalColumn = [...row.getVisibleCells()].reverse().find((cell) => {
10
+ if (cell.column.id === columnId || cell.column.id === 'select') {
11
+ return false;
12
+ }
13
+ return leafRows.some((leafRow) => {
14
+ const value = leafRow.getValue(cell.column.id);
15
+ return typeof value === 'number' && Number.isFinite(value);
16
+ });
17
+ });
18
+ const groupedTotal = totalColumn
19
+ ? leafRows.reduce((sum, leafRow) => {
20
+ const value = leafRow.getValue(totalColumn.column.id);
21
+ if (typeof value !== 'number' || !Number.isFinite(value)) {
22
+ return sum;
23
+ }
24
+ return sum + value;
25
+ }, 0)
26
+ : null;
27
+ const groupTotalFormatter = (_a = totalColumn === null || totalColumn === void 0 ? void 0 : totalColumn.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.groupTotalFormatter;
28
+ let formattedGroupedTotal = null;
29
+ if (groupedTotal !== null) {
30
+ if (groupTotalFormatter) {
31
+ formattedGroupedTotal = groupTotalFormatter(groupedTotal, {
32
+ rows: leafRows.map((leafRow) => leafRow.original),
33
+ });
34
+ }
35
+ else {
36
+ formattedGroupedTotal = new Intl.NumberFormat(undefined, {
37
+ minimumFractionDigits: Number.isInteger(groupedTotal) ? 0 : 2,
38
+ maximumFractionDigits: 2,
39
+ }).format(groupedTotal);
40
+ }
41
+ }
7
42
  return (_jsx("tr", { className: classNames('border-none', clickable && 'cursor-pointer hover:bg-muted/40'), onClick: clickable
8
43
  ? () => onGroupRowClick === null || onGroupRowClick === void 0 ? void 0 : onGroupRowClick({
9
44
  columnId,
10
45
  value: groupValue,
11
46
  rows: row.subRows.map((r) => r.original),
12
47
  })
13
- : undefined, children: _jsx("td", { colSpan: row.getVisibleCells().length, className: "p-0", children: _jsx("div", { className: "px-4 py-4 text-sm text-muted-foreground", children: String(groupValue) }) }) }));
48
+ : undefined, children: _jsx("td", { colSpan: row.getVisibleCells().length, className: "p-0", children: _jsxs("div", { className: "flex items-center justify-between gap-4 px-4 py-4 text-sm text-muted-foreground", children: [_jsx("span", { children: String(groupValue) }), formattedGroupedTotal !== null && (_jsx("span", { className: "font-semibold text-foreground", children: formattedGroupedTotal }))] }) }) }));
14
49
  }
@@ -24,7 +24,6 @@ export function useInfiniteScrolling(params) {
24
24
  count: allRows.length + (isInfinite && hasNextPage ? 1 : 0),
25
25
  getScrollElement: () => parentScrollRef.current,
26
26
  estimateSize: () => { var _a; return (_a = virtualization === null || virtualization === void 0 ? void 0 : virtualization.rowEstimate) !== null && _a !== void 0 ? _a : 48; },
27
- measureElement: (el) => { var _a; return (_a = el === null || el === void 0 ? void 0 : el.getBoundingClientRect().height) !== null && _a !== void 0 ? _a : 48; },
28
27
  overscan: (_a = virtualization === null || virtualization === void 0 ? void 0 : virtualization.overscan) !== null && _a !== void 0 ? _a : 6,
29
28
  });
30
29
  const loadLockRef = useRef(false);
@@ -1,4 +1,4 @@
1
- import { useEffect, useMemo, useRef, useState } from 'react';
1
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
2
2
  import { useReactTable, getCoreRowModel, getSortedRowModel, getPaginationRowModel, getGroupedRowModel, getExpandedRowModel, } from '@tanstack/react-table';
3
3
  import { applyFlexSizes, getCheckboxSelectionColumn } from '../table.helpers';
4
4
  import { usePaginationController } from './usePaginationController';
@@ -12,7 +12,17 @@ export function useTableController({ id, height, data, columns, checkboxSelectio
12
12
  const columnVisibility = useMemo(() => {
13
13
  return Object.fromEntries(stableGrouping.map((columnId) => [columnId, false]));
14
14
  }, [stableGrouping]);
15
- const [tableColumns, setTableColumns] = useState(() => applyFlexSizes(columns !== null && columns !== void 0 ? columns : []));
15
+ const [containerWidth, setContainerWidth] = useState(0);
16
+ useLayoutEffect(() => {
17
+ if (!parentScrollRef.current)
18
+ return;
19
+ const ro = new ResizeObserver(([entry]) => {
20
+ setContainerWidth(entry.contentRect.width);
21
+ });
22
+ ro.observe(parentScrollRef.current);
23
+ return () => ro.disconnect();
24
+ }, []);
25
+ const [tableColumns, setTableColumns] = useState(() => applyFlexSizes(columns !== null && columns !== void 0 ? columns : [], containerWidth, !!(virtualization === null || virtualization === void 0 ? void 0 : virtualization.enabled)));
16
26
  const [internalSorting, setInternalSorting] = useState(sorting !== null && sorting !== void 0 ? sorting : []);
17
27
  const [internalRowSelection, setInternalRowSelection] = useState(() => {
18
28
  if (selectedRowIds) {
@@ -98,7 +108,7 @@ export function useTableController({ id, height, data, columns, checkboxSelectio
98
108
  return checkboxSelection ? getCheckboxSelectionColumn(table) : null;
99
109
  }, [checkboxSelection, table]);
100
110
  useEffect(() => {
101
- const normalized = applyFlexSizes(columns !== null && columns !== void 0 ? columns : []);
111
+ const normalized = applyFlexSizes(columns !== null && columns !== void 0 ? columns : [], containerWidth, !!(virtualization === null || virtualization === void 0 ? void 0 : virtualization.enabled));
102
112
  let finalColumns;
103
113
  if (checkboxSelection && selectionColumn) {
104
114
  if (checkboxPosition === 'start') {
@@ -115,7 +125,7 @@ export function useTableController({ id, height, data, columns, checkboxSelectio
115
125
  finalColumns = normalized;
116
126
  }
117
127
  setTableColumns(finalColumns);
118
- }, [columns, checkboxSelection, checkboxPosition]);
128
+ }, [columns, checkboxSelection, checkboxPosition, containerWidth, virtualization === null || virtualization === void 0 ? void 0 : virtualization.enabled]);
119
129
  return {
120
130
  table,
121
131
  height,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eml-payments/ui-kit",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "private": false,
5
5
  "description": "ARLO UIKit",
6
6
  "homepage": "https://github.com/EML-Payments/arlo.npm.uikit#readme",