kosmio 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.
package/types/ui.d.ts ADDED
@@ -0,0 +1,875 @@
1
+ import type {
2
+ ButtonHTMLAttributes,
3
+ CSSProperties,
4
+ ElementType,
5
+ HTMLAttributes,
6
+ ImgHTMLAttributes,
7
+ InputHTMLAttributes,
8
+ LabelHTMLAttributes,
9
+ MouseEventHandler,
10
+ ReactNode,
11
+ Ref,
12
+ } from "react";
13
+
14
+ export type ButtonVariant = "plain" | "primary" | string;
15
+ export type TextSize = "xxxl" | "xxl" | "xl" | "lg" | "md" | "sm" | "xs" | "xxs" | `text-${string}`;
16
+ export type TextColor = string;
17
+ export type TextFont = "default" | "main" | "mono" | `text-font-${string}`;
18
+ export type TextWeight = "regular" | "medium" | "semibold" | "bold" | `text-weight-${string}`;
19
+ export type TextLineHeight = "none" | "tight" | "normal" | "relaxed" | `text-leading-${string}`;
20
+ export type TextAlignment =
21
+ | "start"
22
+ | "center"
23
+ | "end"
24
+ | "left"
25
+ | "right"
26
+ | "justify"
27
+ | `kosmio-text-align-${string}`;
28
+ export type SelectOptionValue = string | number;
29
+
30
+ export interface BorderStyleDefinition {
31
+ color: string;
32
+ size: string;
33
+ }
34
+
35
+ export interface TypoStyleDefinition {
36
+ font?: TextFont | string;
37
+ fontSize: TextSize | string;
38
+ fontColor: TextColor;
39
+ weight: TextWeight | string;
40
+ lineHeight: TextLineHeight | string;
41
+ as?: ElementType;
42
+ }
43
+
44
+ export interface ContainerStyleDefinition {
45
+ borderStyle: BorderStyleDefinition;
46
+ typoStyle: TypoStyleDefinition;
47
+ backgroundColor: string;
48
+ padding: string;
49
+ radii: string;
50
+ }
51
+
52
+ export function BorderStyle(color: string, size: string): BorderStyleDefinition;
53
+ export function TypoStyle(
54
+ fontSize: TextSize | string,
55
+ fontColor: TextColor,
56
+ weight: TextWeight | string,
57
+ lineHeight: TextLineHeight | string,
58
+ as?: ElementType
59
+ ): TypoStyleDefinition;
60
+ export function ContainerStyle(
61
+ borderStyle: BorderStyleDefinition,
62
+ typoStyle: TypoStyleDefinition,
63
+ backgroundColor: string,
64
+ padding: string,
65
+ radii: string
66
+ ): ContainerStyleDefinition;
67
+
68
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
69
+ as?: ElementType;
70
+ variant?: ButtonVariant;
71
+ danger?: boolean;
72
+ active?: boolean;
73
+ showTooltip?: boolean;
74
+ tooltipText?: string;
75
+ tooltipDirection?: "left" | "right";
76
+ }
77
+
78
+ export const BUTTON_VARIANTS: Record<string, string>;
79
+ export const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLElement>>;
80
+ export default Button;
81
+
82
+ export interface ActionButtonProps extends Omit<ButtonProps, "children"> {
83
+ text?: ReactNode;
84
+ icon?: ReactNode;
85
+ iconPosition?: "start" | "end";
86
+ }
87
+
88
+ export function ActionButton(props: ActionButtonProps): import("react").JSX.Element;
89
+
90
+ export interface FloatingActionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
91
+ icon?: ReactNode;
92
+ label: string;
93
+ compact?: boolean;
94
+ }
95
+
96
+ export const FloatingActionButton: import("react").ForwardRefExoticComponent<
97
+ FloatingActionButtonProps & import("react").RefAttributes<HTMLButtonElement>
98
+ >;
99
+
100
+ export interface SelectionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "title"> {
101
+ icon?: ReactNode;
102
+ title?: ReactNode;
103
+ subtitle?: ReactNode;
104
+ selectedLabel?: ReactNode;
105
+ isSelectable?: boolean;
106
+ isSelected?: boolean;
107
+ }
108
+
109
+ export const SelectionButton: import("react").ForwardRefExoticComponent<
110
+ SelectionButtonProps & import("react").RefAttributes<HTMLButtonElement>
111
+ >;
112
+
113
+ export type IconVariant = "default" | "static" | "reversed" | "reversedDynamic" | "accent" | "invalid" | string;
114
+ export type IconSize = "xxs" | "xs" | "sm" | "md" | "xmd" | "lg" | "xl" | "xxl" | "xxxl" | string;
115
+
116
+ export interface IconProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "size"> {
117
+ src: string;
118
+ variant?: IconVariant;
119
+ size?: IconSize;
120
+ decorative?: boolean;
121
+ }
122
+
123
+ export const Icon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<HTMLElement>>;
124
+
125
+ export interface IconChevronProps extends HTMLAttributes<HTMLSpanElement> {
126
+ colored?: boolean;
127
+ size?: IconSize;
128
+ isOpen?: boolean;
129
+ }
130
+
131
+ export function IconChevron(props: IconChevronProps): import("react").JSX.Element;
132
+
133
+ export interface IconDefinition {
134
+ src: string;
135
+ alt?: string;
136
+ altKey?: string;
137
+ size?: IconSize;
138
+ variant?: IconVariant;
139
+ }
140
+
141
+ export interface IconComponentProps extends Omit<IconProps, "src"> {
142
+ name: string;
143
+ translateAlt?: (key: string) => string;
144
+ }
145
+
146
+ export function createIconComponent(
147
+ icons: Record<string, IconDefinition>,
148
+ defaultVariant?: IconVariant
149
+ ): (props: IconComponentProps) => import("react").JSX.Element | null;
150
+
151
+ export interface TextProps extends Omit<HTMLAttributes<HTMLElement>, "color"> {
152
+ as?: ElementType;
153
+ color?: TextColor;
154
+ dynamic?: boolean;
155
+ size?: TextSize;
156
+ font?: TextFont;
157
+ weight?: TextWeight;
158
+ lineHeight?: TextLineHeight;
159
+ align?: TextAlignment;
160
+ left?: boolean;
161
+ center?: boolean;
162
+ right?: boolean;
163
+ inline?: boolean;
164
+ ellipsis?: boolean;
165
+ elipsis?: boolean;
166
+ }
167
+
168
+ export const TEXT_ALIGNMENTS: Record<string, string>;
169
+ export const TEXT_FONTS: Record<string, string>;
170
+ export const TEXT_LINE_HEIGHTS: Record<string, string>;
171
+ export const TEXT_SIZES: Record<string, string>;
172
+ export const TEXT_WEIGHTS: Record<string, string>;
173
+ export function createTextStyle(
174
+ font?: TextFont,
175
+ weight?: TextWeight,
176
+ size?: TextSize,
177
+ lineHeight?: TextLineHeight
178
+ ): string;
179
+ export function createTypo(
180
+ typoStyle?: TypoStyleDefinition,
181
+ as?: ElementType,
182
+ color?: TextColor,
183
+ defaultClassName?: string
184
+ ): import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLElement>> & {
185
+ defaultPropsConfig?: {
186
+ typoStyle?: TypoStyleDefinition;
187
+ as?: ElementType;
188
+ color?: TextColor;
189
+ className?: string;
190
+ };
191
+ };
192
+ export type TypoDefinition =
193
+ | TypoStyleDefinition
194
+ | [
195
+ typoStyle?: TypoStyleDefinition,
196
+ color?: TextColor,
197
+ defaultClassName?: string
198
+ ];
199
+ export function createTypos(
200
+ typoDefinitions?: TypoDefinition[]
201
+ ): Array<import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLElement>>>;
202
+ export const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLElement>>;
203
+
204
+ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
205
+ text?: ReactNode;
206
+ color?: string;
207
+ }
208
+
209
+ export function Tag(props: TagProps): import("react").JSX.Element;
210
+ export function ColorTag(props: TagProps): import("react").JSX.Element;
211
+
212
+ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
213
+ variant?: "plain" | string;
214
+ format?: RegExp | string;
215
+ isValid?: (value: string, event: import("react").ChangeEvent<HTMLInputElement>) => boolean;
216
+ invalid?: boolean;
217
+ onValueChange?: (value: string, event: import("react").ChangeEvent<HTMLInputElement>) => void;
218
+ }
219
+
220
+ export const INPUT_VARIANTS: Record<string, string>;
221
+ export const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
222
+
223
+ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
224
+ variant?: "plain" | "custom" | string;
225
+ containerClassName?: string;
226
+ labelClassName?: string;
227
+ markClassName?: string;
228
+ textClassName?: string;
229
+ label?: ReactNode;
230
+ onCheckedChange?: (checked: boolean, event: import("react").ChangeEvent<HTMLInputElement>) => void;
231
+ }
232
+
233
+ export const CHECKBOX_VARIANTS: Record<string, string>;
234
+ export const Checkbox: import("react").ForwardRefExoticComponent<
235
+ CheckboxProps & import("react").RefAttributes<HTMLInputElement>
236
+ >;
237
+
238
+ export interface SearchbarProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
239
+ variant?: "plain" | "full" | string;
240
+ onValueChange?: (value: string, event: import("react").ChangeEvent<HTMLInputElement>) => void;
241
+ onSearch?: (value: string) => void;
242
+ searchButtonType?: "button" | "submit" | "reset";
243
+ searchButtonLabel?: string;
244
+ searchIcon?: ReactNode;
245
+ inputRef?: Ref<HTMLInputElement>;
246
+ }
247
+
248
+ export const SEARCHBAR_VARIANTS: Record<string, string>;
249
+ export const Searchbar: import("react").ForwardRefExoticComponent<
250
+ SearchbarProps & import("react").RefAttributes<HTMLDivElement>
251
+ >;
252
+
253
+ export interface SelectOption {
254
+ value: SelectOptionValue;
255
+ label?: ReactNode;
256
+ disabled?: boolean;
257
+ className?: string;
258
+ }
259
+
260
+ export interface SelectChangeEvent {
261
+ target: {
262
+ name?: string;
263
+ value: SelectOptionValue;
264
+ };
265
+ currentTarget: {
266
+ name?: string;
267
+ value: SelectOptionValue;
268
+ };
269
+ }
270
+
271
+ export interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
272
+ variant?: "plain" | string;
273
+ options?: Array<SelectOption | SelectOptionValue>;
274
+ searchable?: boolean;
275
+ placeholder?: string;
276
+ searchPlaceholder?: string;
277
+ searchIcon?: ReactNode;
278
+ searchLabel?: ReactNode;
279
+ emptyLabel?: ReactNode;
280
+ closeLabel?: string;
281
+ selectOptionLabel?: string;
282
+ value?: SelectOptionValue;
283
+ defaultValue?: SelectOptionValue;
284
+ disabled?: boolean;
285
+ required?: boolean;
286
+ name?: string;
287
+ onChange?: (event: SelectChangeEvent) => void;
288
+ onValueChange?: (value: SelectOptionValue, event: SelectChangeEvent) => void;
289
+ }
290
+
291
+ export const SELECT_VARIANTS: Record<string, string>;
292
+ export const Select: import("react").ForwardRefExoticComponent<
293
+ SelectProps & import("react").RefAttributes<HTMLButtonElement>
294
+ >;
295
+
296
+ export interface FormInputProps extends Omit<InputProps, "onChange" | "onValueChange"> {
297
+ label?: ReactNode;
298
+ validations?: Record<string, unknown>;
299
+ labelClassName?: string;
300
+ fieldClassName?: string;
301
+ invalid?: boolean;
302
+ invalidLabel?: ReactNode;
303
+ requiredLabel?: ReactNode;
304
+ onChange?: (value: string, event: import("react").ChangeEvent<HTMLInputElement>) => void;
305
+ }
306
+
307
+ export const FormInput: import("react").ForwardRefExoticComponent<
308
+ FormInputProps & import("react").RefAttributes<HTMLInputElement>
309
+ >;
310
+
311
+ export interface FormSelectProps extends Omit<SelectProps, "onChange" | "onValueChange"> {
312
+ label?: ReactNode;
313
+ labelClassName?: string;
314
+ fieldClassName?: string;
315
+ requiredLabel?: ReactNode;
316
+ selectOptionLabel?: string;
317
+ onChange?: (value: SelectOptionValue, event: SelectChangeEvent) => void;
318
+ }
319
+
320
+ export function FormSelect(props: FormSelectProps): import("react").JSX.Element;
321
+
322
+ export interface FormCheckboxProps extends Omit<CheckboxProps, "onChange"> {
323
+ label?: ReactNode;
324
+ labelClassName?: string;
325
+ fieldClassName?: string;
326
+ requiredLabel?: ReactNode;
327
+ onChange?: (checked: boolean, event: import("react").ChangeEvent<HTMLInputElement>) => void;
328
+ }
329
+
330
+ export function FormCheckbox(props: FormCheckboxProps): import("react").JSX.Element;
331
+
332
+ export type GeneratorInputComponent =
333
+ | ReactNode
334
+ | ((text: string, index: number) => ReactNode);
335
+
336
+ export interface GeneratorInputChangePayload {
337
+ texts: string[];
338
+ components: ReactNode[];
339
+ }
340
+
341
+ export interface GeneratorInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> {
342
+ label?: ReactNode;
343
+ value?: string[];
344
+ defaultValue?: string[];
345
+ onChange?: (value: string[]) => void;
346
+ onGeneratedChange?: (payload: GeneratorInputChangePayload) => void;
347
+ component?: GeneratorInputComponent;
348
+ className?: string;
349
+ labelClassName?: string;
350
+ fieldClassName?: string;
351
+ inputClassName?: string;
352
+ }
353
+
354
+ export function GeneratorInput(props: GeneratorInputProps): import("react").JSX.Element;
355
+
356
+ export interface EnumOptionDefinition {
357
+ value: SelectOptionValue;
358
+ label?: ReactNode;
359
+ labelKey?: string;
360
+ icon?: string;
361
+ iconName?: string;
362
+ iconVariant?: IconVariant;
363
+ iconSize?: IconSize;
364
+ className?: string;
365
+ [key: string]: unknown;
366
+ }
367
+
368
+ export interface EnumOptionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
369
+ option: EnumOptionDefinition;
370
+ selected?: boolean;
371
+ onSelect?: (option: EnumOptionDefinition, event: import("react").MouseEvent<HTMLButtonElement>) => void;
372
+ renderIcon?: (option: EnumOptionDefinition) => ReactNode;
373
+ }
374
+
375
+ export function EnumOption(props: EnumOptionProps): import("react").JSX.Element;
376
+
377
+ export interface EnumSelectorProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "translate"> {
378
+ enumValues?: Array<EnumOptionDefinition | SelectOptionValue> | Record<string, EnumOptionDefinition | SelectOptionValue>;
379
+ selectedValue?: SelectOptionValue | null;
380
+ onValueChange?: (value: SelectOptionValue, option: EnumOptionDefinition) => void;
381
+ translationKeyPrefix?: string;
382
+ getIcon?: (value: SelectOptionValue, option: EnumOptionDefinition) => string | undefined;
383
+ getLabel?: (value: SelectOptionValue, translate: (key: string) => string, option: EnumOptionDefinition) => ReactNode;
384
+ renderIcon?: (option: EnumOptionDefinition) => ReactNode;
385
+ translate?: (key: string) => string;
386
+ isOptionVisible?: (value: SelectOptionValue, option: EnumOptionDefinition) => boolean;
387
+ optionClassName?: string;
388
+ ariaLabel?: string;
389
+ }
390
+
391
+ export function EnumSelector(props: EnumSelectorProps): import("react").JSX.Element;
392
+
393
+ export interface CardProps extends HTMLAttributes<HTMLDivElement> {}
394
+ export function Card(props: CardProps): import("react").JSX.Element;
395
+
396
+ export interface ContainerProps extends HTMLAttributes<HTMLElement> {
397
+ as?: ElementType;
398
+ containerStyle?: ContainerStyleDefinition;
399
+ }
400
+
401
+ export const Container: import("react").ForwardRefExoticComponent<
402
+ ContainerProps & import("react").RefAttributes<HTMLElement>
403
+ >;
404
+ export function createContainer(
405
+ containerStyle?: ContainerStyleDefinition,
406
+ as?: ElementType,
407
+ defaultClassName?: string
408
+ ): import("react").ForwardRefExoticComponent<ContainerProps & import("react").RefAttributes<HTMLElement>> & {
409
+ defaultPropsConfig?: {
410
+ containerStyle?: ContainerStyleDefinition;
411
+ as?: ElementType;
412
+ className?: string;
413
+ };
414
+ };
415
+ export type ContainerDefinition =
416
+ | ContainerStyleDefinition
417
+ | [
418
+ containerStyle?: ContainerStyleDefinition,
419
+ as?: ElementType,
420
+ defaultClassName?: string
421
+ ];
422
+ export function createContainers(
423
+ containerDefinitions?: ContainerDefinition[]
424
+ ): Array<import("react").ForwardRefExoticComponent<ContainerProps & import("react").RefAttributes<HTMLElement>>>;
425
+
426
+ export interface PageProps extends HTMLAttributes<HTMLElement> {
427
+ formLauncher?: unknown;
428
+ showOperationsShortcut?: boolean;
429
+ showContentCard?: boolean;
430
+ fullsize?: boolean;
431
+ }
432
+
433
+ export function Page(props: PageProps): import("react").JSX.Element;
434
+
435
+ export interface NavItemConfig {
436
+ id?: string;
437
+ name?: ReactNode;
438
+ label?: ReactNode;
439
+ url?: string;
440
+ to?: string;
441
+ path?: string;
442
+ routeKey?: string;
443
+ activeRoutes?: string[];
444
+ icon?: ReactNode;
445
+ iconSelected?: ReactNode;
446
+ iconName?: string;
447
+ iconSelectedName?: string;
448
+ badge?: ReactNode;
449
+ className?: string;
450
+ active?: boolean;
451
+ isActive?: (pathname: string, item: NavItem) => boolean;
452
+ onClick?: (...args: unknown[]) => unknown;
453
+ }
454
+
455
+ export class NavItem {
456
+ id?: string;
457
+ name?: ReactNode;
458
+ label?: ReactNode;
459
+ url?: string;
460
+ to?: string;
461
+ path?: string;
462
+ routeKey?: string;
463
+ activeRoutes: string[];
464
+ icon?: ReactNode;
465
+ iconSelected?: ReactNode;
466
+ iconName?: string;
467
+ iconSelectedName?: string;
468
+ badge?: ReactNode;
469
+ className?: string;
470
+ active?: boolean;
471
+ isActive?: (pathname: string, item: NavItem) => boolean;
472
+ onClick?: (...args: unknown[]) => unknown;
473
+ constructor(config?: NavItemConfig);
474
+ matches(pathname: string): boolean;
475
+ static from(data?: NavItemConfig | NavItem): NavItem;
476
+ }
477
+
478
+ export interface SidebarNavProps extends HTMLAttributes<HTMLElement> {
479
+ navItems?: Array<NavItemConfig | NavItem>;
480
+ NavItemComponent?: (props: { navItem: NavItem; active: boolean }) => ReactNode;
481
+ pathname?: string;
482
+ }
483
+
484
+ export function SidebarNav(props: SidebarNavProps): import("react").JSX.Element | null;
485
+
486
+ export type MobileRouteTransitionDirection = "forward" | "back";
487
+
488
+ export interface MobileRouteTransitionContext {
489
+ pathname: string;
490
+ navigationType?: string;
491
+ routeMatch?: unknown;
492
+ }
493
+
494
+ export interface MobileRouteTransitionRule {
495
+ id?: string;
496
+ routeKey?: string;
497
+ pathname?: string;
498
+ enabled?: boolean;
499
+ durationMs?: number;
500
+ enterClassName?: string;
501
+ exitClassName?: string;
502
+ match?: (context: MobileRouteTransitionContext) => boolean;
503
+ }
504
+
505
+ export interface MobileRouteTransitionResult {
506
+ enabled: boolean;
507
+ durationMs: number | null;
508
+ routeMatch?: unknown;
509
+ direction: MobileRouteTransitionDirection;
510
+ enterClassName: string;
511
+ exitClassName: string;
512
+ }
513
+
514
+ export interface ResolveMobileRouteTransitionOptions {
515
+ pathname: string;
516
+ navigationType?: string;
517
+ directionHint?: MobileRouteTransitionDirection;
518
+ previousPathname?: string | null;
519
+ rules?: MobileRouteTransitionRule[];
520
+ matchRoute?: (pathname: string) => unknown;
521
+ defaultTransition?: Partial<MobileRouteTransitionRule>;
522
+ }
523
+
524
+ export const DEFAULT_MOBILE_ROUTE_TRANSITION_STATE_KEY: string;
525
+ export function resolveMobileRouteTransition(options: ResolveMobileRouteTransitionOptions): MobileRouteTransitionResult;
526
+
527
+ export interface MobileRouteTransitionProps extends HTMLAttributes<HTMLDivElement> {
528
+ outlet?: ReactNode;
529
+ location?: {
530
+ key?: string;
531
+ pathname?: string;
532
+ state?: Record<string, unknown> | null;
533
+ };
534
+ navigationType?: string;
535
+ isMobile?: boolean;
536
+ rules?: MobileRouteTransitionRule[];
537
+ router?: {
538
+ matchLocalizedRoute?: (pathname: string) => unknown;
539
+ };
540
+ matchRoute?: (pathname: string) => unknown;
541
+ stateKey?: string;
542
+ defaultTransition?: Partial<MobileRouteTransitionRule>;
543
+ layerClassName?: string;
544
+ }
545
+
546
+ export function MobileRouteTransition(props: MobileRouteTransitionProps): import("react").JSX.Element;
547
+
548
+ export interface NativeBackButtonHandlerProps {
549
+ app?: {
550
+ addListener?: (
551
+ eventName: "backButton",
552
+ listenerFunc: (event: { canGoBack?: boolean }) => void
553
+ ) => Promise<{ remove?: () => void | Promise<void> }>;
554
+ };
555
+ isNative?: boolean;
556
+ router?: {
557
+ matchLocalizedRoute?: (pathname: string) => { routeKey?: string } | null;
558
+ };
559
+ mainRouteKeys?: Iterable<string>;
560
+ transitionStateKey?: string;
561
+ closeableSelectSelectors?: string[];
562
+ selectSheetBackdropSelector?: string;
563
+ selectDropdownSelector?: string;
564
+ closeableOverlaySelectors?: string[];
565
+ }
566
+
567
+ export function NativeBackButtonHandler(props: NativeBackButtonHandlerProps): null;
568
+
569
+ export interface AppearChildrenProps {
570
+ children?: ReactNode;
571
+ }
572
+
573
+ export function AppearChildren(props: AppearChildrenProps): ReactNode;
574
+
575
+ export interface ClickableProps extends ButtonHTMLAttributes<HTMLButtonElement> {}
576
+ export const Clickable: import("react").ForwardRefExoticComponent<
577
+ ClickableProps & import("react").RefAttributes<HTMLButtonElement>
578
+ >;
579
+
580
+ export interface CollapsibleBoxProps extends HTMLAttributes<HTMLDivElement> {
581
+ titleBox?: ReactNode | ((isExpanded: boolean) => ReactNode);
582
+ defaultExpanded?: boolean;
583
+ }
584
+
585
+ export function CollapsibleBox(props: CollapsibleBoxProps): import("react").JSX.Element;
586
+
587
+ export interface CollapsibleCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
588
+ title?: ReactNode;
589
+ defaultExpanded?: boolean;
590
+ }
591
+
592
+ export function CollapsibleCard(props: CollapsibleCardProps): import("react").JSX.Element;
593
+
594
+ export interface GridProps extends HTMLAttributes<HTMLDivElement> {
595
+ minColumnWidth?: number;
596
+ maxColumns?: number;
597
+ gap?: number;
598
+ padding?: number;
599
+ staggerMs?: number;
600
+ maxStaggerMs?: number;
601
+ }
602
+
603
+ export function Grid(props: GridProps): import("react").JSX.Element;
604
+
605
+ export interface LoaderProps extends HTMLAttributes<HTMLDivElement> {}
606
+ export function Loader(props: LoaderProps): import("react").JSX.Element;
607
+
608
+ export interface BackdropProps extends ButtonHTMLAttributes<HTMLButtonElement> {
609
+ label?: string;
610
+ }
611
+
612
+ export function Backdrop(props: BackdropProps): import("react").JSX.Element;
613
+
614
+ export interface OverlayDismissOptions {
615
+ enabled?: boolean;
616
+ initialFocusRef?: { current: HTMLElement | null };
617
+ onEnterKeyDown?: (event: KeyboardEvent) => void;
618
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
619
+ restoreFocus?: boolean;
620
+ rootRef?: { current: HTMLElement | null };
621
+ trapFocus?: boolean;
622
+ useCapture?: boolean;
623
+ }
624
+
625
+ export function useOverlayDismiss(options?: OverlayDismissOptions): void;
626
+
627
+ export interface OverlayProps extends HTMLAttributes<HTMLDivElement> {
628
+ backdropLabel?: string;
629
+ backdropStyle?: CSSProperties;
630
+ centerContent?: boolean;
631
+ closing?: boolean;
632
+ initialFocusRef?: { current: HTMLElement | null };
633
+ onBackdropClick?: MouseEventHandler<HTMLButtonElement>;
634
+ onEnterKeyDown?: (event: KeyboardEvent) => void;
635
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
636
+ portal?: boolean;
637
+ portalTarget?: Element | DocumentFragment | null;
638
+ restoreFocus?: boolean;
639
+ trapFocus?: boolean;
640
+ useKeyboardCapture?: boolean;
641
+ }
642
+
643
+ export function Overlay(props: OverlayProps): import("react").JSX.Element | null;
644
+
645
+ export interface OverlayDialogProps extends OverlayProps {
646
+ role?: string;
647
+ }
648
+
649
+ export function OverlayDialog(props: OverlayDialogProps): import("react").JSX.Element | null;
650
+
651
+ export interface UseSheetDragDismissOptions {
652
+ canStartContentDrag?: (event: PointerEvent | import("react").PointerEvent<HTMLElement>) => boolean;
653
+ closing?: boolean;
654
+ containerRef?: { current: HTMLElement | null };
655
+ dragZoneRef?: { current: HTMLElement | null };
656
+ enableContentDrag?: boolean;
657
+ isMobile?: boolean;
658
+ onDragDismiss?: () => void;
659
+ onRequestClose?: () => void;
660
+ scrollRef?: { current: HTMLElement | null };
661
+ showDragHandle?: boolean;
662
+ }
663
+
664
+ export interface UseSheetDragDismissResult {
665
+ backdropStyle: CSSProperties;
666
+ dragging: boolean;
667
+ gestureClosing: boolean;
668
+ handlePointerDown: (event: import("react").PointerEvent<HTMLElement>, source?: "content" | "handle") => void;
669
+ handlePointerEnd: (event: import("react").PointerEvent<HTMLElement>) => void;
670
+ handlePointerMove: (event: import("react").PointerEvent<HTMLElement>) => void;
671
+ handleTransitionEnd: () => void;
672
+ sheetStyle: CSSProperties;
673
+ }
674
+
675
+ export function useSheetDragDismiss(options?: UseSheetDragDismissOptions): UseSheetDragDismissResult;
676
+
677
+ export interface SheetProps extends OverlayProps {
678
+ beforeScrollContent?: ReactNode;
679
+ canStartContentDrag?: (event: PointerEvent | import("react").PointerEvent<HTMLElement>) => boolean;
680
+ enableContentDrag?: boolean;
681
+ feedbackState?: "success" | "failure" | string;
682
+ isMobile?: boolean;
683
+ onDragDismiss?: () => void;
684
+ onRequestClose?: () => void;
685
+ showDragHandle?: boolean;
686
+ }
687
+
688
+ export const Sheet: import("react").ForwardRefExoticComponent<SheetProps & import("react").RefAttributes<HTMLDivElement>>;
689
+
690
+ export interface TableColumn<Row = Record<string, unknown>> {
691
+ key: string;
692
+ header?: ReactNode;
693
+ accessor?: (row: Row) => unknown;
694
+ cell?: (row: Row) => ReactNode;
695
+ sortable?: boolean;
696
+ width?: string | number;
697
+ className?: string;
698
+ headerClassName?: string;
699
+ cellClassName?: string;
700
+ }
701
+
702
+ export interface TableShortcut<Row = Record<string, unknown>> {
703
+ key?: string;
704
+ keys?: string | string[];
705
+ shortcut?: string;
706
+ enabled?: boolean;
707
+ preventDefault?: boolean;
708
+ stopPropagation?: boolean;
709
+ onTrigger?: (row: Row, event: KeyboardEvent) => void;
710
+ }
711
+
712
+ export interface TableProps<Row = Record<string, unknown>> extends HTMLAttributes<HTMLDivElement> {
713
+ data?: Row[];
714
+ columns?: TableColumn<Row>[];
715
+ initialSort?: { key: string | null; direction: "asc" | "desc" };
716
+ getRowKey?: (row: Row, index: number) => string | number;
717
+ striped?: boolean;
718
+ conditionalRowClassName?: (row: Row, index: number) => string;
719
+ onRowClick?: (row: Row, event?: unknown) => void;
720
+ onSelectedClick?: (row: Row, event?: unknown) => void;
721
+ onDeselect?: () => void;
722
+ onSelectionChange?: (row: Row | null, key: string | number | null) => void;
723
+ onRowRightClick?: (row: Row, event: unknown) => void;
724
+ selectOnRightClick?: boolean;
725
+ onEnterRow?: (row: Row, event: unknown) => void;
726
+ enableKeyboardNav?: boolean;
727
+ hasActiveSearch?: boolean;
728
+ isLoading?: boolean;
729
+ sourceDataCount?: number | null;
730
+ rowShortcuts?: TableShortcut<Row>[];
731
+ sortAscIcon?: ReactNode;
732
+ sortDescIcon?: ReactNode;
733
+ emptyState?: ReactNode | ((context: TableStateContext<Row>) => ReactNode);
734
+ noResultsState?: ReactNode | ((context: TableStateContext<Row>) => ReactNode);
735
+ }
736
+
737
+ export interface TableStateContext<Row = Record<string, unknown>> {
738
+ className: string;
739
+ columns: TableColumn<Row>[];
740
+ data: Row[];
741
+ hasActiveSearch: boolean;
742
+ sourceDataCount: number | null;
743
+ }
744
+
745
+ export function Table<Row = Record<string, unknown>>(props: TableProps<Row>): import("react").JSX.Element;
746
+ export function TableBody<Row = Record<string, unknown>>(props: Record<string, unknown>): import("react").JSX.Element;
747
+ export function TableHead<Row = Record<string, unknown>>(props: Record<string, unknown>): import("react").JSX.Element;
748
+ export function TableRow<Row = Record<string, unknown>>(props: Record<string, unknown>): import("react").JSX.Element;
749
+ export function FullSearchBar(props: {
750
+ options?: Array<Record<string, unknown>>;
751
+ selectedOption?: SelectOptionValue;
752
+ onChangeOption?: (value: SelectOptionValue) => void;
753
+ setData?: (data: unknown[]) => void;
754
+ onQueryChange?: (query: string) => void;
755
+ initialQuery?: string;
756
+ filters?: boolean;
757
+ addButton?: boolean;
758
+ buttonName?: string;
759
+ enableCtrlF?: boolean;
760
+ translate?: (key: string, values?: Record<string, unknown>) => string;
761
+ isMobile?: boolean;
762
+ onAdd?: (option?: Record<string, unknown> | null) => void;
763
+ searchIcon?: ReactNode;
764
+ renderActionButton?: (props: Record<string, unknown>) => ReactNode;
765
+ searchScope?: string;
766
+ }): import("react").JSX.Element;
767
+ export function TableCRUD<Row = Record<string, unknown>>(
768
+ props: TableProps<Row> & {
769
+ id?: string;
770
+ table_name?: string | null;
771
+ addFormName?: string;
772
+ searchKeys?: string[];
773
+ initialData?: Row[];
774
+ buttonName?: string;
775
+ includeHeader?: boolean;
776
+ translate?: (key: string, values?: Record<string, unknown>) => string;
777
+ renderActionButton?: (props: Record<string, unknown>) => ReactNode;
778
+ searchIcon?: ReactNode;
779
+ searchScope?: string;
780
+ includePageSearchbar?: boolean;
781
+ useGlobalSearch?: boolean;
782
+ }
783
+ ): import("react").JSX.Element;
784
+ export function ResponsiveTable<Row = Record<string, unknown>>(props: {
785
+ id?: string;
786
+ table_name?: string;
787
+ addFormName?: string;
788
+ optionsFormName?: string;
789
+ searchKeys?: string[];
790
+ columns?: TableColumn<Row>[];
791
+ initialData?: Row[];
792
+ isLoading?: boolean;
793
+ buttonName?: string;
794
+ mainAction?: (row: Row, event?: unknown) => void;
795
+ desktopMenuActions?: unknown[];
796
+ onEditRow?: (row: Row) => void;
797
+ onToggleArchiveRow?: (row: Row) => void;
798
+ onDeleteRow?: (row: Row) => void;
799
+ allowArchive?: boolean;
800
+ allowDelete?: boolean;
801
+ openMobileMenu?: (row: Row, event?: unknown) => void;
802
+ conditionalRowClassName?: (row: Row, index: number) => string;
803
+ rowShortcuts?: TableShortcut<Row>[];
804
+ fillAvailableHeight?: boolean;
805
+ includeHeader?: boolean;
806
+ translate?: (key: string, values?: Record<string, unknown>) => string;
807
+ createActionsPayload?: (row: Row, actions: unknown[]) => unknown;
808
+ TableCRUDComponent?: (props: Record<string, unknown>) => ReactNode;
809
+ renderActionButton?: (props: Record<string, unknown>) => ReactNode;
810
+ searchIcon?: ReactNode;
811
+ emptyState?: ReactNode | ((context: TableStateContext<Row>) => ReactNode);
812
+ noResultsState?: ReactNode | ((context: TableStateContext<Row>) => ReactNode);
813
+ searchScope?: string;
814
+ includePageSearchbar?: boolean;
815
+ useGlobalSearch?: boolean;
816
+ }): import("react").JSX.Element;
817
+ export function useDebounce<Value = unknown>(value: Value, delay?: number): Value;
818
+ export const GLOBAL_TABLE_SEARCH_SCOPE: string;
819
+ export function TableSearchProvider(props: {
820
+ children?: ReactNode;
821
+ resetKey?: string | number;
822
+ }): import("react").JSX.Element;
823
+ export function useTableSearch(
824
+ scope?: string,
825
+ options?: { debounceMs?: number }
826
+ ): {
827
+ query: string;
828
+ debouncedQuery: string;
829
+ setQuery: (value: string) => void;
830
+ clearQuery: () => void;
831
+ };
832
+ export function EmptyCell(props: { icon?: ReactNode }): import("react").JSX.Element;
833
+ export function TextCell<Row = Record<string, unknown>>(props: {
834
+ row: Row;
835
+ getValue: (row: Row) => ReactNode;
836
+ renderEmpty?: ReactNode;
837
+ }): ReactNode;
838
+ export function IconTextCell<Row = Record<string, unknown>>(props: {
839
+ row: Row;
840
+ getIconName?: (row: Row) => string | undefined;
841
+ getIconSrc?: (row: Row) => string | undefined;
842
+ getAlt?: (row: Row) => string;
843
+ getValue: (row: Row) => ReactNode;
844
+ renderIcon?: (props: { name: string; alt: string; size: IconSize; row: Row }) => ReactNode;
845
+ size?: IconSize;
846
+ }): import("react").JSX.Element;
847
+ export function FloatingRowMenu<Row = Record<string, unknown>>(props: {
848
+ x: number;
849
+ y: number;
850
+ row?: Row | null;
851
+ actions?: Array<{
852
+ label?: ReactNode | ((row: Row) => ReactNode);
853
+ icon?: string;
854
+ iconName?: string;
855
+ renderIcon?: (props: { icon?: string; iconName?: string; row: Row }) => ReactNode;
856
+ onClick?: (row: Row) => void;
857
+ color?: string;
858
+ shortcut?: ReactNode;
859
+ disabled?: boolean | ((row: Row) => boolean);
860
+ }>;
861
+ onClose?: () => void;
862
+ }): import("react").JSX.Element | null;
863
+ export function useTableSorting<Row = Record<string, unknown>>(options: {
864
+ data: Row[];
865
+ columns: TableColumn<Row>[];
866
+ initialSort?: { key: string | null; direction: "asc" | "desc" };
867
+ }): {
868
+ sortConfig: { key: string | null; direction: "asc" | "desc" };
869
+ requestSort: (key: string, sortable?: boolean) => void;
870
+ sortedData: Row[];
871
+ };
872
+ export function useTableSelection<Row = Record<string, unknown>>(options: Record<string, unknown>): {
873
+ selectedKey: string | number | null;
874
+ getRowHandlers: (row: Row, rowKey: string | number) => Record<string, unknown>;
875
+ };