@unifiedsoftware/react-ui 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,207 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as react from 'react';
2
3
  import react__default, { Dispatch, SetStateAction } from 'react';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ declare global {
6
+ interface WindowEventMap {
7
+ 'local-storage': CustomEvent;
8
+ }
9
+ }
10
+ type SetValue<T> = Dispatch<SetStateAction<T>>;
11
+ /**
12
+ * It's a React hook that allows you to store and retrieve data from localStorage
13
+ * @param {string} key - string
14
+ * @param {T} initialValue - The initial value to use if the key doesn't exist in localStorage.
15
+ * @returns An array of two items. The first item is the value of the local storage key. The second
16
+ * item is a function that can be used to set the value of the local storage key.
17
+ */
18
+ declare function useLocalStorage<T>(key: string, initialValue: T): [T, SetValue<T>];
19
+
20
+ /**
21
+ * It returns the previous value of the given value
22
+ * @param {any} value - any - The value to track.
23
+ * @returns The previous value of the variable.
24
+ */
25
+ declare const usePrevious: (value: any) => undefined;
26
+
27
+ interface Disclosure {
28
+ isOpen: boolean;
29
+ onOpen: () => void;
30
+ onClose: () => void;
31
+ onToggle: () => void;
32
+ }
33
+ declare function useDisclosure({ defaultValue }?: {
34
+ defaultValue?: boolean;
35
+ }): Disclosure;
36
+
37
+ type Handler = (event: MouseEvent) => void;
38
+ declare const useOnClickOutside: <T extends HTMLElement = HTMLElement>(ref: react.RefObject<T>, handler: Handler) => void;
39
+
40
+ interface Helpers {
41
+ goToNextStep: () => void;
42
+ goToPrevStep: () => void;
43
+ reset: () => void;
44
+ canGoToNextStep: boolean;
45
+ canGoToPrevStep: boolean;
46
+ setStep: Dispatch<SetStateAction<number>>;
47
+ }
48
+ /**
49
+ * It returns a tuple with the current step and an object with functions to manipulate the step
50
+ * @param {number} maxStep - number - The maximum number of steps in the stepper.
51
+ * @returns An array with two elements. The first element is the current step. The second element is an
52
+ * object with the following properties:
53
+ */
54
+ declare const useStep: (maxStep: number) => [number, Helpers];
55
+
56
+ declare function useDebounce<T>(value: T, delay?: number): T;
57
+
58
+ type ScrollAlignment = 'start' | 'center' | 'end' | 'auto';
59
+ type ScrollBehavior = 'auto' | 'smooth';
60
+ interface ScrollToOptions {
61
+ align?: ScrollAlignment;
62
+ behavior?: ScrollBehavior;
63
+ }
64
+ type Key = number | string;
65
+ interface Virtualizer {
66
+ getVirtualItems: () => VirtualItem[];
67
+ getTotalSize: () => number;
68
+ scrollToIndex: (index: number, options: ScrollToOptions) => void;
69
+ scrollToOffset: (toOffset: number, options: ScrollToOptions) => void;
70
+ }
71
+ interface VirtualItem {
72
+ key: Key;
73
+ index: number;
74
+ start: number;
75
+ end: number;
76
+ size: number;
77
+ lane: number;
78
+ }
79
+
80
+ interface VirtualizerOptions {
81
+ parentRef: React.MutableRefObject<Element | null>;
82
+ total?: number;
83
+ overscan?: number;
84
+ count?: number;
85
+ hasNextPage?: boolean;
86
+ isFetchingNextPage?: boolean;
87
+ onFetchNextPage?: () => Promise<void> | void;
88
+ estimateSize: (index: number) => number;
89
+ }
90
+ declare function useVirtualizer(options: VirtualizerOptions): Virtualizer;
91
+
92
+ declare enum QueryStatus {
93
+ IDLE = 0,
94
+ LOADING = 1,
95
+ SUCCESS = 2,
96
+ ERROR = 3
97
+ }
98
+ interface QueryOptions {
99
+ page?: number;
100
+ }
101
+ interface InfiniteData<TData = any> {
102
+ pages: TData[];
103
+ }
104
+ type QueryFunction<TData = unknown> = (options: QueryOptions) => Promise<TData>;
105
+ interface UseInfiniteQueryOptions<TData = unknown> {
106
+ query: QueryFunction<TData>;
107
+ getNextPage: (lastPage: TData, allPages: TData[]) => number | undefined;
108
+ disabled?: boolean;
109
+ }
110
+ interface UseInfiniteQueryResult<TData = unknown, TError = unknown> {
111
+ status: QueryStatus;
112
+ data?: InfiniteData<TData>;
113
+ error?: TError;
114
+ hasNextPage?: boolean;
115
+ isFetchingNextPage: boolean;
116
+ fetchNextPage: () => Promise<void>;
117
+ }
118
+
119
+ declare function useInfiniteQuery<TData = unknown, TError = unknown>(options: UseInfiniteQueryOptions<TData>, deps?: React.DependencyList): UseInfiniteQueryResult<TData, TError>;
120
+
121
+ interface Resize {
122
+ width: number;
123
+ height: number;
124
+ }
125
+ interface UseElementSizeOptions<T> {
126
+ ref?: React.MutableRefObject<T | null>;
127
+ target?: T;
128
+ callback?: (resize: Resize) => void;
129
+ }
130
+ declare function useElementSize<T extends HTMLElement = any>(options: UseElementSizeOptions<T>): Resize;
131
+
132
+ interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
133
+ as?: React.ElementType;
134
+ }
135
+ declare const List: react.ForwardRefExoticComponent<ListProps & react.RefAttributes<HTMLDivElement>>;
136
+
137
+ interface ListItemProps extends react__default.HTMLAttributes<HTMLDivElement> {
138
+ as?: react__default.ElementType;
139
+ title: string;
140
+ subtitle?: string;
141
+ startContent?: react__default.ReactNode;
142
+ endContent?: react__default.ReactNode;
143
+ level?: number;
144
+ hoverable?: boolean;
145
+ selected?: boolean;
146
+ disabled?: boolean;
147
+ slotProps?: {
148
+ title?: react__default.HTMLAttributes<HTMLDivElement>;
149
+ subtitle?: react__default.HTMLAttributes<HTMLDivElement>;
150
+ };
151
+ }
152
+ declare const ListItem: react__default.ForwardRefExoticComponent<ListItemProps & react__default.RefAttributes<HTMLDivElement>>;
153
+
154
+ type ListGroupProps = ListItemProps & {
155
+ expandVisible?: boolean;
156
+ expandPosition?: 'start' | 'end';
157
+ isOpen?: boolean;
158
+ onOpen?: () => void;
159
+ onClose?: () => void;
160
+ onToggle?: () => void;
161
+ };
162
+ declare const ListGroup: react.ForwardRefExoticComponent<ListItemProps & {
163
+ expandVisible?: boolean | undefined;
164
+ expandPosition?: "start" | "end" | undefined;
165
+ isOpen?: boolean | undefined;
166
+ onOpen?: (() => void) | undefined;
167
+ onClose?: (() => void) | undefined;
168
+ onToggle?: (() => void) | undefined;
169
+ } & react.RefAttributes<HTMLDivElement>>;
170
+
171
+ type AutocompleteItem = Record<string, any>;
172
+ type AutocompleteKeyField<TAutocompleteItem> = keyof TAutocompleteItem;
173
+ interface AutocompleteSingleProps<TAutocompleteItem extends AutocompleteItem, TAutocompleteKeyField extends AutocompleteKeyField<TAutocompleteItem> = 'key'> {
174
+ isMultiple?: false;
175
+ value: TAutocompleteItem[TAutocompleteKeyField] | null;
176
+ onChange?: (value: TAutocompleteItem | null) => void;
177
+ onValueChange?: (value: TAutocompleteItem[TAutocompleteKeyField] | null) => void;
178
+ }
179
+ interface AutocompleteMultipleProps<TAutocompleteItem extends AutocompleteItem, TAutocompleteKeyField extends AutocompleteKeyField<TAutocompleteItem> = 'key'> {
180
+ isMultiple: true;
181
+ value: TAutocompleteItem[TAutocompleteKeyField][];
182
+ onChange?: (value: TAutocompleteItem[]) => void;
183
+ onValueChange?: (value: TAutocompleteItem[TAutocompleteKeyField][]) => void;
184
+ }
185
+ type NativeAttrs$a<TAutocompleteItem extends AutocompleteItem, TAutocompleteKeyField extends AutocompleteKeyField<TAutocompleteItem> = 'key'> = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$a<TAutocompleteItem, TAutocompleteKeyField>>;
186
+ type Props$a<TAutocompleteItem extends AutocompleteItem, TAutocompleteKeyField extends AutocompleteKeyField<TAutocompleteItem> = 'key'> = {
187
+ data: TAutocompleteItem[];
188
+ keyField?: TAutocompleteKeyField;
189
+ textField?: keyof TAutocompleteItem;
190
+ placeholder?: string;
191
+ filter?: string;
192
+ loading?: boolean;
193
+ disabled?: boolean;
194
+ disclosure?: Disclosure;
195
+ virtual?: Omit<VirtualizerOptions, 'parentRef'>;
196
+ startContent?: React.ReactNode;
197
+ endContent?: React.ReactNode;
198
+ onItemSelect?: (item: TAutocompleteItem) => void;
199
+ onFilterChange?: (value: string) => void;
200
+ renderItem?: (item: TAutocompleteItem, props: ListItemProps) => React.ReactNode;
201
+ } & (AutocompleteSingleProps<TAutocompleteItem, TAutocompleteKeyField> | AutocompleteMultipleProps<TAutocompleteItem, TAutocompleteKeyField>);
202
+ type AutocompleteProps<TAutocompleteItem extends AutocompleteItem, TAutocompleteKeyField extends AutocompleteKeyField<TAutocompleteItem> = 'key'> = Props$a<TAutocompleteItem, TAutocompleteKeyField> & NativeAttrs$a<TAutocompleteItem, TAutocompleteKeyField>;
203
+
204
+ declare const Autocomplete: <TAutocompleteItem extends AutocompleteItem, TAutocompleteKeyField extends keyof TAutocompleteItem = "key">(props: AutocompleteProps<TAutocompleteItem, TAutocompleteKeyField>) => react_jsx_runtime.JSX.Element;
4
205
 
5
206
  interface BackdropProps extends React.HTMLAttributes<HTMLDivElement> {
6
207
  isOpen: boolean;
@@ -10,7 +211,7 @@ declare const Backdrop: react.ForwardRefExoticComponent<BackdropProps & react.Re
10
211
 
11
212
  type BadgePlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
12
213
 
13
- interface Props$8 {
214
+ interface Props$9 {
14
215
  /**
15
216
  * The placement of the badge relative to its content.
16
217
  */
@@ -20,15 +221,15 @@ interface Props$8 {
20
221
  */
21
222
  content?: React.ReactNode;
22
223
  }
23
- type NativeAttrs$8 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$8>;
24
- type BadgeProps = Props$8 & NativeAttrs$8;
224
+ type NativeAttrs$9 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$9>;
225
+ type BadgeProps = Props$9 & NativeAttrs$9;
25
226
  declare const Badge: React.FC<BadgeProps>;
26
227
 
27
228
  type ButtonVariant = 'filled' | 'outlined' | 'flat' | 'text' | 'plain';
28
229
  type ButtonColor = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger';
29
230
  type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
30
231
 
31
- interface Props$7 {
232
+ interface Props$8 {
32
233
  /**
33
234
  * The HTML element type or React component to render as the button.
34
235
  */
@@ -67,9 +268,9 @@ interface Props$7 {
67
268
  */
68
269
  disabled?: boolean;
69
270
  }
70
- type NativeAttrs$7 = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof Props$7>;
71
- type ButtonProps = Props$7 & NativeAttrs$7;
72
- declare const Button: react.ForwardRefExoticComponent<Props$7 & NativeAttrs$7 & react.RefAttributes<HTMLButtonElement>>;
271
+ type NativeAttrs$8 = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof Props$8>;
272
+ type ButtonProps = Props$8 & NativeAttrs$8;
273
+ declare const Button: react.ForwardRefExoticComponent<Props$8 & NativeAttrs$8 & react.RefAttributes<HTMLButtonElement>>;
73
274
 
74
275
  interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
75
276
  as?: React.ElementType;
@@ -89,7 +290,7 @@ type ChipVariant = 'filled' | 'outlined' | 'text';
89
290
  type ChipColor = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger';
90
291
  type ChipSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
91
292
 
92
- interface Props$6 {
293
+ interface Props$7 {
93
294
  /**
94
295
  * The HTML element type or React component to render as the chip.
95
296
  */
@@ -107,9 +308,9 @@ interface Props$6 {
107
308
  */
108
309
  size?: ChipSize;
109
310
  }
110
- type NativeAttrs$6 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$6>;
111
- type ChipProps = Props$6 & NativeAttrs$6;
112
- declare const Chip: react.ForwardRefExoticComponent<Props$6 & NativeAttrs$6 & react.RefAttributes<HTMLDivElement>>;
311
+ type NativeAttrs$7 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$7>;
312
+ type ChipProps = Props$7 & NativeAttrs$7;
313
+ declare const Chip: react.ForwardRefExoticComponent<Props$7 & NativeAttrs$7 & react.RefAttributes<HTMLDivElement>>;
113
314
 
114
315
  interface CollapseProps {
115
316
  children: React.ReactNode;
@@ -160,7 +361,7 @@ interface IconProps {
160
361
  }
161
362
  declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<unknown>>;
162
363
 
163
- interface Props$5 {
364
+ interface Props$6 {
164
365
  /**
165
366
  * The HTML element type or React component to render as the menu item.
166
367
  */
@@ -186,9 +387,9 @@ interface Props$5 {
186
387
  */
187
388
  disabled?: boolean;
188
389
  }
189
- type NativeAttrs$5 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$5 | 'items'>;
190
- type MenuItemProps = Props$5 & NativeAttrs$5;
191
- declare const MenuItem: react.ForwardRefExoticComponent<Props$5 & NativeAttrs$5 & react.RefAttributes<HTMLDivElement>>;
390
+ type NativeAttrs$6 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$6 | 'items'>;
391
+ type MenuItemProps = Props$6 & NativeAttrs$6;
392
+ declare const MenuItem: react.ForwardRefExoticComponent<Props$6 & NativeAttrs$6 & react.RefAttributes<HTMLDivElement>>;
192
393
 
193
394
  type MenuSubmenuProps = Omit<MenuItemProps, 'items'> & {
194
395
  items?: MenuItemType[];
@@ -212,7 +413,7 @@ type MenuItemType = (MenuGroupProps & {
212
413
  }) | (MenuItemProps & {
213
414
  type?: 'item';
214
415
  });
215
- interface Props$4 {
416
+ interface Props$5 {
216
417
  /**
217
418
  * The currently selected value of the menu.
218
419
  */
@@ -248,8 +449,8 @@ interface Props$4 {
248
449
  */
249
450
  onItemSelect?: (props: MenuItemProps) => void;
250
451
  }
251
- type NativeAttrs$4 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$4 | 'items'>;
252
- type MenuProps = Props$4 & NativeAttrs$4 & {
452
+ type NativeAttrs$5 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$5 | 'items'>;
453
+ type MenuProps = Props$5 & NativeAttrs$5 & {
253
454
  items?: MenuItemType[];
254
455
  };
255
456
  declare const Menu: React.FC<MenuProps>;
@@ -311,7 +512,7 @@ interface PortalProps {
311
512
  }
312
513
  declare const Portal: react.ForwardRefExoticComponent<PortalProps & react.RefAttributes<HTMLDivElement>>;
313
514
 
314
- interface Props$3 {
515
+ interface Props$4 {
315
516
  /**
316
517
  * The HTML element type or React component to render as the tab.
317
518
  */
@@ -328,16 +529,24 @@ interface Props$3 {
328
529
  * Whether the tab is disabled.
329
530
  */
330
531
  disabled?: boolean;
532
+ /**
533
+ * Content to display at the start of the tab, before the tab's text.
534
+ */
535
+ startContent?: React.ReactNode;
536
+ /**
537
+ * Content to display at the end of the tab, after the tab's text.
538
+ */
539
+ endContent?: React.ReactNode;
331
540
  }
332
- type NativeAttrs$3 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$3>;
333
- type TabProps = Props$3 & NativeAttrs$3;
334
- declare const Tab: react.ForwardRefExoticComponent<Props$3 & NativeAttrs$3 & {
541
+ type NativeAttrs$4 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$4>;
542
+ type TabProps = Props$4 & NativeAttrs$4;
543
+ declare const Tab: react.ForwardRefExoticComponent<Props$4 & NativeAttrs$4 & {
335
544
  children?: react.ReactNode;
336
545
  } & react.RefAttributes<HTMLDivElement>>;
337
546
 
338
547
  type TabsAlignmet = 'start' | 'center' | 'end' | 'stretch';
339
548
 
340
- interface Props$2 {
549
+ interface Props$3 {
341
550
  /**
342
551
  * The currently selected value of the tabs.
343
552
  */
@@ -359,8 +568,8 @@ interface Props$2 {
359
568
  */
360
569
  onClose?: (value: any) => void;
361
570
  }
362
- type NativeAttrs$2 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$2>;
363
- type TabsProps = Props$2 & NativeAttrs$2;
571
+ type NativeAttrs$3 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$3>;
572
+ type TabsProps = Props$3 & NativeAttrs$3;
364
573
  declare const Tabs: React.FC<TabsProps>;
365
574
 
366
575
  type ToolbarSize = 'auto' | 'sm' | 'md' | 'lg';
@@ -369,6 +578,8 @@ interface ToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
369
578
  size?: ToolbarSize;
370
579
  title?: string;
371
580
  subtitle?: string;
581
+ startContent?: React.ReactNode;
582
+ endContent?: React.ReactNode;
372
583
  startAction?: React.ReactNode;
373
584
  endAction?: React.ReactNode;
374
585
  }
@@ -388,245 +599,66 @@ declare const Transition: react.ForwardRefExoticComponent<TransitionProps & reac
388
599
 
389
600
  interface ScrollAreaProps {
390
601
  children: React.ReactNode;
391
- height?: number;
602
+ autoHide?: boolean;
392
603
  style?: React.CSSProperties;
393
604
  }
394
605
  declare const ScrollArea: react.ForwardRefExoticComponent<ScrollAreaProps & react.RefAttributes<HTMLDivElement>>;
395
606
 
396
- interface Props$1 {
607
+ interface Props$2 {
397
608
  inputRef?: React.RefObject<HTMLInputElement>;
398
609
  startContent?: React.ReactNode;
399
610
  endContent?: React.ReactNode;
400
611
  }
401
- type NativeAttrs$1 = Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof Props$1>;
402
- type TextInputProps = Props$1 & NativeAttrs$1;
403
- declare const TextInput: react.ForwardRefExoticComponent<Props$1 & NativeAttrs$1 & react.RefAttributes<HTMLInputElement>>;
404
-
405
- type SelectItem = {
406
- key: any;
407
- text: string;
408
- } | any;
409
- type SelectData<TSelectItem = SelectItem> = {
410
- items: TSelectItem[];
411
- total: number;
412
- };
413
- type SelectState = {
414
- skip: number;
415
- filter: string;
416
- };
417
- interface VirtualScrollerProps {
418
- pageSize?: number;
419
- }
420
- type SelectBaseProps<TSelectItem = SelectItem> = {
421
- data: SelectData<TSelectItem>;
422
- value?: TSelectItem | null;
423
- placeholder?: string;
424
- keyField?: string;
425
- textField?: string;
426
- filterable?: boolean;
427
- filter?: string;
428
- virtual?: VirtualScrollerProps;
429
- disabled?: boolean;
430
- loading?: boolean;
431
- className?: string;
432
- onFilterChange?: (filter: string) => void;
433
- onChange: (value: any) => void;
434
- renderItem?: (item: TSelectItem) => React.ReactNode;
435
- };
436
- type SelectClientProps<TSelectItem = SelectItem> = {
437
- filterMode: 'client';
438
- page?: number;
439
- pageSize?: number;
440
- } & SelectBaseProps<TSelectItem>;
441
- type SelectServerProps<TSelectItem = SelectItem> = {
442
- filterMode: 'server';
443
- onDataChange: (data: SelectData) => void;
444
- getData: (state: SelectState) => Promise<SelectData<TSelectItem>>;
445
- } & SelectBaseProps<TSelectItem>;
446
- type SelectProps<TSelectItem = SelectItem> = SelectClientProps<TSelectItem> | SelectServerProps<TSelectItem>;
447
-
448
- declare const Select: (props: SelectProps) => react_jsx_runtime.JSX.Element;
449
-
450
- type SwitchProps = {
451
- value?: boolean;
452
- defaultValue?: boolean;
453
- error?: boolean;
454
- onChange?: (value: boolean) => void;
455
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'>;
456
- declare const Switch: React.FC<SwitchProps>;
457
-
458
- declare global {
459
- interface WindowEventMap {
460
- 'local-storage': CustomEvent;
461
- }
462
- }
463
- type SetValue<T> = Dispatch<SetStateAction<T>>;
464
- /**
465
- * It's a React hook that allows you to store and retrieve data from localStorage
466
- * @param {string} key - string
467
- * @param {T} initialValue - The initial value to use if the key doesn't exist in localStorage.
468
- * @returns An array of two items. The first item is the value of the local storage key. The second
469
- * item is a function that can be used to set the value of the local storage key.
470
- */
471
- declare function useLocalStorage<T>(key: string, initialValue: T): [T, SetValue<T>];
612
+ type NativeAttrs$2 = Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof Props$2>;
613
+ type TextInputProps = Props$2 & NativeAttrs$2;
614
+ declare const TextInput: react.ForwardRefExoticComponent<Props$2 & NativeAttrs$2 & react.RefAttributes<HTMLInputElement>>;
472
615
 
473
- /**
474
- * It returns the previous value of the given value
475
- * @param {any} value - any - The value to track.
476
- * @returns The previous value of the variable.
477
- */
478
- declare const usePrevious: (value: any) => undefined;
479
-
480
- interface Disclosure {
481
- isOpen: boolean;
482
- onOpen: () => void;
483
- onClose: () => void;
484
- onToggle: () => void;
485
- }
486
- declare function useDisclosure({ defaultValue }?: {
487
- defaultValue?: boolean;
488
- }): Disclosure;
489
-
490
- type Handler = (event: MouseEvent) => void;
491
- declare const useOnClickOutside: <T extends HTMLElement = HTMLElement>(ref: react.RefObject<T>, handler: Handler) => void;
492
-
493
- interface Helpers {
494
- goToNextStep: () => void;
495
- goToPrevStep: () => void;
496
- reset: () => void;
497
- canGoToNextStep: boolean;
498
- canGoToPrevStep: boolean;
499
- setStep: Dispatch<SetStateAction<number>>;
500
- }
501
- /**
502
- * It returns a tuple with the current step and an object with functions to manipulate the step
503
- * @param {number} maxStep - number - The maximum number of steps in the stepper.
504
- * @returns An array with two elements. The first element is the current step. The second element is an
505
- * object with the following properties:
506
- */
507
- declare const useStep: (maxStep: number) => [number, Helpers];
508
-
509
- declare function useDebounce<T>(value: T, delay?: number): T;
510
-
511
- declare enum QueryStatus {
512
- IDLE = 0,
513
- LOADING = 1,
514
- SUCCESS = 2,
515
- ERROR = 3
516
- }
517
- interface QueryOptions {
518
- page?: number;
519
- }
520
- interface InfiniteData<TData = any> {
521
- pages: TData[];
522
- }
523
- type QueryFunction<TData = unknown> = (options: QueryOptions) => Promise<TData>;
524
- interface UseInfiniteQueryOptions<TData = unknown> {
525
- query: QueryFunction<TData>;
526
- getNextPage: (lastPage: TData, allPages: TData[]) => number | undefined;
527
- disabled?: boolean;
528
- }
529
- interface UseInfiniteQueryResult<TData = unknown, TError = unknown> {
530
- status: QueryStatus;
531
- data?: InfiniteData<TData>;
532
- error?: TError;
533
- hasNextPage?: boolean;
534
- isFetchingNextPage: boolean;
535
- fetchNextPage: () => Promise<void>;
536
- }
537
-
538
- declare function useInfiniteQuery<TData = unknown, TError = unknown>(options: UseInfiniteQueryOptions<TData>, deps?: React.DependencyList): UseInfiniteQueryResult<TData, TError>;
539
-
540
- interface Resize {
541
- width: number;
542
- height: number;
543
- }
544
- interface UseElementSizeOptions<T> {
545
- ref?: React.MutableRefObject<T | null>;
546
- target?: T;
547
- callback?: (resize: Resize) => void;
548
- }
549
- declare function useElementSize<T extends HTMLElement = any>(options: UseElementSizeOptions<T>): Resize;
550
-
551
- interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
552
- as?: React.ElementType;
553
- }
554
- declare const List: react.ForwardRefExoticComponent<ListProps & react.RefAttributes<HTMLDivElement>>;
555
-
556
- interface ListItemProps extends react__default.HTMLAttributes<HTMLDivElement> {
557
- as?: react__default.ElementType;
558
- title: string;
559
- subtitle?: string;
560
- startContent?: react__default.ReactNode;
561
- endContent?: react__default.ReactNode;
562
- level?: number;
563
- hoverable?: boolean;
564
- selected?: boolean;
616
+ interface Props$1 {
617
+ name?: string;
618
+ value?: string;
619
+ defaultValue?: string;
620
+ checked?: boolean;
621
+ defaultChecked?: boolean;
565
622
  disabled?: boolean;
566
- slotProps?: {
567
- title?: react__default.HTMLAttributes<HTMLDivElement>;
568
- subtitle?: react__default.HTMLAttributes<HTMLDivElement>;
569
- };
623
+ onChange?: (value: string) => void;
624
+ onCheckedChange?: (checked: boolean) => void;
570
625
  }
571
- declare const ListItem: react__default.ForwardRefExoticComponent<ListItemProps & react__default.RefAttributes<HTMLDivElement>>;
626
+ type NativeAttrs$1 = Omit<React.LabelHTMLAttributes<HTMLLabelElement>, keyof Props$1>;
627
+ type SwitchProps = Props$1 & NativeAttrs$1;
628
+ declare const Switch: react.ForwardRefExoticComponent<Props$1 & NativeAttrs$1 & react.RefAttributes<HTMLLabelElement>>;
572
629
 
573
- type ListGroupProps = ListItemProps & {
574
- expandVisible?: boolean;
575
- expandPosition?: 'start' | 'end';
576
- isOpen?: boolean;
577
- onOpen?: () => void;
578
- onClose?: () => void;
579
- onToggle?: () => void;
580
- };
581
- declare const ListGroup: react.ForwardRefExoticComponent<ListItemProps & {
582
- expandVisible?: boolean | undefined;
583
- expandPosition?: "end" | "start" | undefined;
584
- isOpen?: boolean | undefined;
585
- onOpen?: (() => void) | undefined;
586
- onClose?: (() => void) | undefined;
587
- onToggle?: (() => void) | undefined;
588
- } & react.RefAttributes<HTMLDivElement>>;
589
-
590
- type ComboboxItem = Record<string, any>;
591
- type ComboboxKeyField<TComboboxItem> = keyof TComboboxItem;
592
- interface VirtualProps {
593
- count?: number;
594
- hasNextPage?: boolean;
595
- isFetchingNextPage?: boolean;
596
- onFetchNextPage?: () => Promise<void> | void;
597
- estimateSize: (index: number) => number;
598
- }
599
- interface ComboboxSingleProps<TComboboxItem extends ComboboxItem, TComboboxKeyField extends ComboboxKeyField<TComboboxItem> = 'key'> {
630
+ type SelectItem = Record<string, any>;
631
+ type SelectKeyField<TSelectItem> = keyof TSelectItem;
632
+ interface SelectSingleProps<TSelectItem extends SelectItem, TSelectKeyField extends SelectKeyField<TSelectItem> = 'key'> {
600
633
  isMultiple?: false;
601
- value: TComboboxItem[TComboboxKeyField] | undefined;
602
- onChange?: (value: TComboboxItem | undefined) => void;
603
- onValueChange?: (value: TComboboxItem[TComboboxKeyField] | undefined) => void;
634
+ value: TSelectItem[TSelectKeyField] | null;
635
+ onChange?: (value: TSelectItem | null) => void;
636
+ onValueChange?: (value: TSelectItem[TSelectKeyField] | null) => void;
604
637
  }
605
- interface ComboboxMultipleProps<TComboboxItem extends ComboboxItem, TComboboxKeyField extends ComboboxKeyField<TComboboxItem> = 'key'> {
638
+ interface SelectMultipleProps<TSelectItem extends SelectItem, TSelectKeyField extends SelectKeyField<TSelectItem> = 'key'> {
606
639
  isMultiple: true;
607
- value: TComboboxItem[TComboboxKeyField][];
608
- onChange?: (value: TComboboxItem[]) => void;
609
- onValueChange?: (value: TComboboxItem[TComboboxKeyField][]) => void;
610
- }
611
- type NativeAttrs<TComboboxItem extends ComboboxItem, TComboboxKeyField extends ComboboxKeyField<TComboboxItem> = 'key'> = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props<TComboboxItem, TComboboxKeyField>>;
612
- type Props<TComboboxItem extends ComboboxItem, TComboboxKeyField extends ComboboxKeyField<TComboboxItem> = 'key'> = {
613
- data: TComboboxItem[];
614
- keyField?: TComboboxKeyField;
615
- textField?: keyof TComboboxItem;
640
+ value: TSelectItem[TSelectKeyField][];
641
+ onChange?: (value: TSelectItem[]) => void;
642
+ onValueChange?: (value: TSelectItem[TSelectKeyField][]) => void;
643
+ }
644
+ type NativeAttrs<TSelectItem extends SelectItem, TSelectKeyField extends SelectKeyField<TSelectItem> = 'key'> = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props<TSelectItem, TSelectKeyField>>;
645
+ type Props<TSelectItem extends SelectItem, TSelectKeyField extends SelectKeyField<TSelectItem> = 'key'> = {
646
+ data: TSelectItem[];
647
+ keyField?: TSelectKeyField;
648
+ textField?: keyof TSelectItem;
616
649
  placeholder?: string;
617
- filterable?: boolean;
618
- filter?: string;
619
650
  loading?: boolean;
620
651
  disabled?: boolean;
621
652
  disclosure?: Disclosure;
622
- virtual?: VirtualProps;
623
- onItemSelect?: (item: TComboboxItem) => void;
624
- onFilterChange?: (value: string) => void;
625
- renderItem?: (item: TComboboxItem, props: ListItemProps) => React.ReactNode;
626
- } & (ComboboxSingleProps<TComboboxItem, TComboboxKeyField> | ComboboxMultipleProps<TComboboxItem, TComboboxKeyField>);
627
- type ComboboxProps<TComboboxItem extends ComboboxItem, TComboboxKeyField extends ComboboxKeyField<TComboboxItem> = 'key'> = Props<TComboboxItem, TComboboxKeyField> & NativeAttrs<TComboboxItem, TComboboxKeyField>;
653
+ virtual?: Omit<VirtualizerOptions, 'parentRef'>;
654
+ startContent?: React.ReactNode;
655
+ endContent?: React.ReactNode;
656
+ onItemSelect?: (item: TSelectItem) => void;
657
+ renderItem?: (item: TSelectItem, props: ListItemProps) => React.ReactNode;
658
+ } & (SelectSingleProps<TSelectItem, TSelectKeyField> | SelectMultipleProps<TSelectItem, TSelectKeyField>);
659
+ type SelectProps<TSelectItem extends SelectItem, TSelectKeyField extends SelectKeyField<TSelectItem> = 'key'> = Props<TSelectItem, TSelectKeyField> & NativeAttrs<TSelectItem, TSelectKeyField>;
628
660
 
629
- declare const Combobox: <TComboboxItem extends ComboboxItem, TComboboxKeyField extends keyof TComboboxItem = "key">(props: ComboboxProps<TComboboxItem, TComboboxKeyField>) => react_jsx_runtime.JSX.Element;
661
+ declare const Select: <TSelectItem extends SelectItem, TSelectKeyField extends keyof TSelectItem = "key">(props: SelectProps<TSelectItem, TSelectKeyField>) => react_jsx_runtime.JSX.Element;
630
662
 
631
663
  interface FieldProps extends React.HTMLAttributes<HTMLDivElement> {
632
664
  label: string;
@@ -644,4 +676,4 @@ type ReactRef<T> = React.RefCallback<T> | React.MutableRefObject<T>;
644
676
  declare function assignRef<T = any>(ref: ReactRef<T> | null | undefined, value: T): void;
645
677
  declare function mergeRefs<T>(...refs: (ReactRef<T> | null | undefined)[]): (node: T | null) => void;
646
678
 
647
- export { Accordion, AccordionContent, AccordionContentProps, AccordionHeader, AccordionHeaderProps, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, AccordionProps, Backdrop, BackdropProps, Badge, BadgeProps, Button, ButtonColor, ButtonProps, ButtonSize, ButtonVariant, Card, CardHeader, CardHeaderProps, CardProps, Chip, ChipProps, Collapse, CollapseContent, CollapseContentProps, CollapseContext, CollapseContextValue, CollapseProps, CollapseTrigger, CollapseTriggerProps, Combobox, ComboboxItem, ComboboxKeyField, ComboboxMultipleProps, ComboboxProps, ComboboxSingleProps, Disclosure, Drawer, DrawerPosition, DrawerProps, DrawerSize, Field, FieldProps, Icon, IconProps, InfiniteData, List, ListGroup, ListGroupProps, ListItem, ListItemProps, ListProps, Menu, MenuContext, MenuContextValue, MenuGroup, MenuGroupItemType, MenuGroupProps, MenuItem, MenuItemProps, MenuItemType, MenuProps, MenuSubmenu, MenuSubmenuProps, MenuValueContext, Portal, PortalProps, QueryFunction, QueryOptions, QueryStatus, ReactRef, Resize, ScrollArea, ScrollAreaProps, Select, SelectData, SelectItem, SelectProps, SelectState, Switch, SwitchProps, Tab, TabProps, Tabs, TabsAlignmet, TabsProps, TextInput, TextInputProps, Toolbar, ToolbarProps, ToolbarSize, Transition, TransitionProps, UseInfiniteQueryOptions, UseInfiniteQueryResult, assignRef, clsx, getOpenValuesByPathname, mergeRefs, scrollToItem, useAccordionItem, useCollapse, useDebounce, useDisclosure, useElementSize, useInfiniteQuery, useLocalStorage, useMenu, useMenuItemValue, useOnClickOutside, usePrevious, useStep };
679
+ export { Accordion, AccordionContent, AccordionContentProps, AccordionHeader, AccordionHeaderProps, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, AccordionProps, Autocomplete, AutocompleteItem, AutocompleteKeyField, AutocompleteMultipleProps, AutocompleteProps, AutocompleteSingleProps, Backdrop, BackdropProps, Badge, BadgeProps, Button, ButtonColor, ButtonProps, ButtonSize, ButtonVariant, Card, CardHeader, CardHeaderProps, CardProps, Chip, ChipProps, Collapse, CollapseContent, CollapseContentProps, CollapseContext, CollapseContextValue, CollapseProps, CollapseTrigger, CollapseTriggerProps, Disclosure, Drawer, DrawerPosition, DrawerProps, DrawerSize, Field, FieldProps, Icon, IconProps, InfiniteData, List, ListGroup, ListGroupProps, ListItem, ListItemProps, ListProps, Menu, MenuContext, MenuContextValue, MenuGroup, MenuGroupItemType, MenuGroupProps, MenuItem, MenuItemProps, MenuItemType, MenuProps, MenuSubmenu, MenuSubmenuProps, MenuValueContext, Portal, PortalProps, QueryFunction, QueryOptions, QueryStatus, ReactRef, Resize, ScrollAlignment, ScrollArea, ScrollAreaProps, ScrollBehavior, ScrollToOptions, Select, SelectItem, SelectKeyField, SelectMultipleProps, SelectProps, SelectSingleProps, Switch, SwitchProps, Tab, TabProps, Tabs, TabsAlignmet, TabsProps, TextInput, TextInputProps, Toolbar, ToolbarProps, ToolbarSize, Transition, TransitionProps, UseInfiniteQueryOptions, UseInfiniteQueryResult, VirtualItem, Virtualizer, VirtualizerOptions, assignRef, clsx, getOpenValuesByPathname, mergeRefs, scrollToItem, useAccordionItem, useCollapse, useDebounce, useDisclosure, useElementSize, useInfiniteQuery, useLocalStorage, useMenu, useMenuItemValue, useOnClickOutside, usePrevious, useStep, useVirtualizer };