freemium-ui 2.0.0-beta.2 → 2.0.0-beta.3

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/lib/index.d.ts DELETED
@@ -1,1155 +0,0 @@
1
- import { CheckboxProps as CheckboxProps$1 } from '@radix-ui/react-checkbox';
2
- import { UseSelectProps, UseComboboxProps } from 'downshift';
3
- import { LabelProps } from '@radix-ui/react-label';
4
- import { DateInput3Props, DateRangeInput3Props } from '@blueprintjs/datetime2';
5
- import * as RadixPopover from '@radix-ui/react-popover';
6
- import { RadioGroupContextValue } from '@radix-ui/react-radio-group';
7
- import { DraggableSyntheticListeners } from '@dnd-kit/core';
8
- import { CoreOptions } from '@tanstack/react-table';
9
- import { TabsProps as TabsProps$1 } from '@radix-ui/react-tabs';
10
- import { TooltipProviderProps, TooltipProps as TooltipProps$1, TooltipArrowProps } from '@radix-ui/react-tooltip';
11
- import { TransitionProps as TransitionProps$1 } from 'react-transition-group/Transition';
12
- export { TransitionStatus } from 'react-transition-group/Transition';
13
-
14
- type LevelType = 'warning' | 'success' | 'error' | 'info';
15
-
16
- type AlertData = {
17
- message: string;
18
- linkText?: string;
19
- href?: string;
20
- };
21
-
22
- interface AlertProps {
23
- /**
24
- * data to be displayed in the alert
25
- */
26
- data?: AlertData;
27
- /**
28
- * Level of the alert
29
- */
30
- level: LevelType;
31
- /**
32
- * Whether the alert can be dismissed
33
- */
34
- canDismiss?: boolean;
35
- /**
36
- * Timeout for the alert to disappear
37
- */
38
- timeout?: number;
39
- /**
40
- * Class name to be overriden
41
- */
42
- overideClassName?: string;
43
- /**
44
- * Children to be displayed in the alert
45
- */
46
- children?: React.ReactNode | string;
47
- /**
48
- * Function to be called when the alert is closed
49
- */
50
- onClose?: () => any;
51
- /**
52
- * Function to be called when the alert is dismissed
53
- */
54
- onDisappear?: () => any;
55
- }
56
-
57
- type ButtonSizeKey = 'mini' | 'normal' | 'large';
58
- type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link';
59
-
60
- interface ButtonProps
61
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
62
- /**
63
- * The size of the button
64
- */
65
- size?: ButtonSizeKey;
66
- /**
67
- * The variant of the button
68
- */
69
- variant?: 'primary' | 'secondary' | 'danger' | 'link';
70
- /**
71
- * The children to be displayed in the button
72
- */
73
- children?: React.ReactNode | string;
74
- /**
75
- * Whether the button is loading
76
- */
77
- loading?: boolean;
78
- /**
79
- * Whether the button is inline
80
- */
81
- inline?: boolean;
82
- }
83
-
84
- interface CheckboxProps extends CheckboxProps$1 {
85
- /**
86
- * Whether the checkbox is required
87
- */
88
- isRequired?: boolean;
89
- /**
90
- * Whether the checkbox is errored
91
- */
92
- isErrored?: boolean;
93
- /**
94
- * Label for the checkbox
95
- */
96
- label?: string;
97
- }
98
-
99
- interface ConfirmationProps {
100
- /**
101
- * Is the confirmation open
102
- */
103
- isOpen?: boolean;
104
- /**
105
- * Is the confirm button disabled
106
- */
107
- confirmButtonDisabled?: boolean;
108
- /**
109
- * Is the cancel button disabled
110
- */
111
- cancelButtonDisabled?: boolean;
112
- /**
113
- * Title of the confirmation
114
- */
115
- title?: string;
116
- /**
117
- * Description of the confirmation
118
- */
119
- description?: string;
120
- /**
121
- * Width of the confirmation
122
- */
123
- width?: string;
124
- /**
125
- * Function to be called when the confirmation is dismissed
126
- */
127
- onDismiss?: (type: 'overlay' | 'button') => void;
128
- /**
129
- * Function to be called when the confirmation is confirmed
130
- */
131
- onConfirm?: () => void;
132
- /**
133
- * Confirm button text
134
- */
135
- confirmButtonText?: string;
136
- /**
137
- * Cancel button text
138
- */
139
- cancelButtonText?: string;
140
- /**
141
- * Styles for the overlay
142
- */
143
- bodyStyles?: React.CSSProperties;
144
- /**
145
- * Styles for the content
146
- */
147
- contentStyles?: React.CSSProperties;
148
- /**
149
- * Styles for the footer
150
- */
151
- footerStyles?: React.CSSProperties;
152
- }
153
-
154
- type DrawerSizeType =
155
- | 'default'
156
- | 'medium'
157
- | 'small'
158
- | 'large'
159
- | 'x-large';
160
-
161
- type DrawerPlacement = 'left' | 'right';
162
-
163
- interface DrawerProps {
164
- /**
165
- * The children to be displayed in the drawer
166
- */
167
- children?: React.ReactNode | string;
168
- /**
169
- * Whether the drawer is open
170
- */
171
- isOpen?: boolean;
172
- /**
173
- * The placement of the drawer
174
- */
175
- placement?: DrawerPlacement;
176
- /**
177
- * The size of the drawer
178
- */
179
- size?: DrawerSizeType;
180
- /**
181
- * Whether the drawer is full height
182
- */
183
- isFullHeight?: boolean;
184
- /**
185
- * Should the drawer close when clicking outside
186
- */
187
- clickOutToClose?: boolean;
188
- /**
189
- * Should we hide the dismiss icon
190
- */
191
- hideDismissIcon?: boolean;
192
- /**
193
- * Custom class to be added to the drawer
194
- */
195
- customClass?: string;
196
- /**
197
- * Function to be called when the drawer is dismissed
198
- */
199
- onDismiss?: () => void;
200
- }
201
-
202
- type DropdownTypes = 'button' | 'input';
203
-
204
- type DefaultDropdownItem = {
205
- id: string | number;
206
- name?: string;
207
- disabled?: boolean;
208
- [key: string]: any;
209
- };
210
-
211
- interface DropdownProps<
212
- T extends DefaultDropdownItem = DefaultDropdownItem,
213
- > {
214
- /**
215
- * The items to be displayed in the dropdown
216
- */
217
- items?: Array<T>;
218
- /**
219
- * The identifier for the items
220
- */
221
- itemIdentifier?: string;
222
- /**
223
- * The selected item
224
- */
225
- defaultSelectedItem?: T | null;
226
- /**
227
- * Function to be called when the selected item changes
228
- */
229
- onChange?: (item?: T | null) => void;
230
- /**
231
- * Fuction to give the string representation of the item
232
- */
233
- itemToString: (item: T | null, type?: 'list-item' | 'display') => string;
234
- /**
235
- * The type of the dropdown
236
- */
237
- type: DropdownTypes;
238
- /**
239
- * Is the dropdown read only
240
- */
241
- readOnly?: boolean;
242
- /**
243
- * Whether disabled select
244
- */
245
- disabled?: boolean;
246
- /**
247
- * The name of the dropdown
248
- */
249
- name?: string;
250
- /**
251
- * The width of the dropdown
252
- */
253
- width?: string;
254
- /**
255
- * The key to be used for filtering
256
- */
257
- filterKey?: string;
258
- /**
259
- *
260
- */
261
- getCustomMessage?: (inoutValue: string) => string;
262
- /**
263
- *
264
- */
265
- emptyItemsText?: string;
266
- /**
267
- *
268
- */
269
- hideClear?: boolean;
270
- /**
271
- *
272
- */
273
- errorText?: string;
274
- /**
275
- *
276
- */
277
- className?: string;
278
- /**
279
- *
280
- */
281
- style?: React.CSSProperties;
282
- /**
283
- *
284
- */
285
- isErrored?: boolean;
286
- /**
287
- *
288
- */
289
- isRequired?: boolean;
290
- /**
291
- *
292
- */
293
- isMenuLoading?: boolean;
294
- /**
295
- *
296
- */
297
- onCustomValueAdd?: (item: {
298
- inputValue: string;
299
- customValues: boolean;
300
- }) => void;
301
- /**
302
- *
303
- */
304
- customValues?: boolean;
305
- /**
306
- *
307
- */
308
- id?: string;
309
- /**
310
- *
311
- */
312
- label?: string;
313
- /**
314
- *
315
- */
316
- placeholder?: string;
317
- /**
318
- *
319
- */
320
- useSelectProps?: UseSelectProps<T>;
321
- /**
322
- *
323
- */
324
- useComboboxProps?: UseComboboxProps<T>;
325
- }
326
-
327
- interface CommonProps {
328
- /**
329
- * Is this a required field?
330
- */
331
- isRequired?: boolean;
332
- /**
333
- * Is this a error field?
334
- */
335
- isErrored?: boolean;
336
- /**
337
- * Error text to be shown
338
- */
339
- errorText?: string;
340
- /**
341
- * Id of the button
342
- */
343
- id?: string;
344
- /**
345
- * Id of the button
346
- */
347
- label?: string;
348
- /**
349
- * Label of the button
350
- */
351
- inline?: boolean;
352
- /**
353
- * The max length of the input
354
- */
355
- maxLength?: number;
356
- /**
357
- * Whether to show character count
358
- */
359
- showCount?: boolean;
360
- inputStyle?: React.CSSProperties;
361
- startLabel?: React.ReactNode | any;
362
- startAdornment?: React.ReactNode | any;
363
- endLabel?: React.ReactNode | any;
364
- endAdornment?: React.ReactNode | any;
365
- labelProps?: LabelProps;
366
- containerProps?: React.HTMLAttributes<HTMLDivElement>;
367
- }
368
-
369
- interface InputProps
370
- extends CommonProps,
371
- React.InputHTMLAttributes<HTMLInputElement> {
372
- ref?: React.Ref<HTMLInputElement>;
373
- }
374
-
375
- interface TextAreaProps
376
- extends CommonProps,
377
- React.TextareaHTMLAttributes<HTMLTextAreaElement> {
378
- ref?: React.Ref<HTMLTextAreaElement>;
379
- }
380
-
381
- type Sizes = 'mini' | 'small' | 'medium' | 'big';
382
- type Speeds = 'slow' | 'medium' | 'fast';
383
-
384
- type LoaderPropTypes = {
385
- /**
386
- * Size of Select input
387
- */
388
- size?: Sizes;
389
- /**
390
- * Speed of Select input
391
- */
392
- speed?: Speeds;
393
- };
394
-
395
- interface MenuItemProps {
396
- id: string;
397
- name: string;
398
- disabled?: boolean;
399
- [key: string]: any;
400
- }
401
-
402
- type MenuProps<T extends MenuItemProps = MenuItemProps> = {
403
- /**
404
- * value of menu
405
- */
406
- value?: T;
407
- /**
408
- * Called when a menu item is selected
409
- */
410
- onSelect?: (option: T) => void;
411
- closeMenuCallback?: () => void;
412
- /**
413
- * options for menu button
414
- */
415
- options?: Array<T>;
416
- /**
417
- * The children or label
418
- */
419
- trigger: React.ReactNode | string;
420
- /**
421
- * Is the button inline
422
- * @deprecated
423
- */
424
- highlightedIndex?: number | null;
425
- /**
426
- * id Accessor of menu
427
- */
428
- idAccessor?: string;
429
- /**
430
- * name Accessor of menu
431
- */
432
- nameAccessor?: string;
433
- /**
434
- * Is the button inline
435
- */
436
- isOpen?: boolean;
437
- /**
438
- * should show the Arrow?
439
- */
440
- showArrow?: boolean;
441
- };
442
-
443
- type ModalAlignType = 'top' | 'center' | 'bottom';
444
- type ModalPositionType = 'left' | 'center' | 'right';
445
- type ModalSizeType =
446
- | 'default'
447
- | 'medium'
448
- | 'small'
449
- | 'large'
450
- | 'x-large';
451
-
452
- interface ModalProps {
453
- /**
454
- * The children or label
455
- */
456
- children?: React.ReactNode | string;
457
- /**
458
- * Is the button inline
459
- */
460
- isOpen?: boolean;
461
- /**
462
- * Is the button inline
463
- */
464
- fullWidth?: boolean;
465
- /**
466
- * Is the button inline
467
- */
468
- align?: ModalAlignType;
469
- /**
470
- * Is the button inline
471
- */
472
- position?: ModalPositionType;
473
- /**
474
- * Is the button inline
475
- */
476
- size?: ModalSizeType;
477
- /**
478
- * How large should the button be?
479
- */
480
- onDismiss?: () => void;
481
- /**
482
- * The children or label
483
- */
484
- customClass?: string;
485
- /**
486
- * The children or label
487
- */
488
- customModalContentStyles?: React.CSSProperties;
489
- }
490
-
491
- type DefaultMultiSelectDropdownItem = {};
492
-
493
- interface MultiSelectDropdownProps<
494
- T extends DefaultMultiSelectDropdownItem,
495
- > {
496
- /**
497
- * dropdown item content
498
- */
499
- items?: Array<T>;
500
- /**
501
- * Id of the item
502
- */
503
- itemIdentifier?: string;
504
- /**
505
- * default selected item of dropdown
506
- */
507
- defaultSelectedItem?: T | null;
508
- /**
509
- * Called when select an option or input value change
510
- */
511
- onChange?: (item?: T | null) => void;
512
- itemToString: (item: T | null) => string;
513
- /**
514
- * Is the dropdown readonly
515
- */
516
- readOnly?: boolean;
517
- /**
518
- * Whether disabled select
519
- */
520
- disabled?: boolean;
521
- /**
522
- * name of the drowpdown
523
- */
524
- name?: string;
525
- /**
526
- * width of the multi select drowpdown
527
- */
528
- width?: string;
529
-
530
- filterKey?: string;
531
- getCustomMessage?: (inoutValue: string) => string;
532
- /**
533
- * Empty items text box
534
- */
535
- emptyItemsText?: string;
536
- /**
537
- * Whether to allow hide or clear when click
538
- */
539
- hideClear?: boolean;
540
- /**
541
- * Error text to be shown
542
- */
543
- errorText?: string;
544
- /**
545
- * Is this a error field?
546
- */
547
- isErrored?: boolean;
548
- /**
549
- * Is this a required field?
550
- */
551
- isRequired?: boolean;
552
- /**
553
- * Is menu loading?
554
- */
555
- isMenuLoading?: boolean;
556
- handleInputChange?: (inputValue: string) => void;
557
- onCustomValueAdd?: (item: {
558
- inputValue: string;
559
- customValues: boolean;
560
- }) => void;
561
- /**
562
- * Is this custom value
563
- */
564
- customValues?: boolean;
565
- /**
566
- * id of the drowpdown
567
- */
568
- id?: string;
569
- /**
570
- * label for the drowpdown
571
- */
572
- label?: string;
573
- placeholder?: string;
574
- useSelectProps?: UseSelectProps<T>;
575
- useComboboxProps?: UseComboboxProps<T>;
576
- }
577
-
578
- type DefaultProps = {
579
- /**
580
- * Is this a required field?
581
- */
582
- isRequired?: boolean;
583
- /**
584
- * Is this a error field?
585
- */
586
- isErrored?: boolean;
587
- /**
588
- * Error text to be shown
589
- */
590
- errorText?: string;
591
- /**
592
- * Id of the date picker
593
- */
594
- id?: string;
595
- /**
596
- * name of the date picker
597
- */
598
- name?: string;
599
- /**
600
- * label for the picker
601
- */
602
- label?: string;
603
- placeholder?: string;
604
- /**
605
- * Whether disabled select
606
- */
607
-
608
- disabled?: boolean;
609
- };
610
-
611
- type DatePickerProps = DefaultProps &
612
- Partial<DateInput3Props> & {
613
- displayFormat?: string;
614
- // showFooter?: boolean;
615
- };
616
-
617
- type DateRangePickerProps = DefaultProps &
618
- Partial<DateRangeInput3Props> & {
619
- displayFormat?: string;
620
- // showFooter?: boolean;
621
- };
622
-
623
- type DateTimePickerProps = DefaultProps &
624
- Partial<DateInput3Props> & {
625
- displayFormat?: string;
626
- // showFooter?: boolean;
627
- };
628
-
629
- type DateTimeRangePickerProps = DefaultProps &
630
- Partial<DateRangeInput3Props> & {
631
- displayFormat?: string;
632
- // showFooter?: boolean;
633
- };
634
-
635
- type Origin = {
636
- vertical?: 'top' | 'center' | 'bottom';
637
- horizontal?: 'left' | 'center' | 'right';
638
- };
639
-
640
- interface PopoverProps {
641
- /**
642
- * How large should the button be?
643
- */
644
- onClose?: (event?: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
645
- /**
646
- * Which variant the button should be
647
- */
648
- id?: string;
649
- /**
650
- * The children or label
651
- */
652
- trigger: React.ReactNode | string;
653
- /**
654
- * The children or label
655
- */
656
- children?: React.ReactNode | string;
657
- /**
658
- * Is the button inline
659
- */
660
- hoverOutToClose?: boolean;
661
- /**
662
- * Is the button inline
663
- */
664
- hoverToOpen?: boolean;
665
-
666
- /**
667
- * Is the button inline
668
- */
669
- arrow?: boolean;
670
- /**
671
- * Is the button inline
672
- */
673
- avoidCollisions?: boolean;
674
- /**
675
- * Is the button inline
676
- */
677
- side?: RadixPopover.PopperContentProps['side'];
678
- /**
679
- * Is the button inline
680
- */
681
- align?: RadixPopover.PopperContentProps['align'];
682
- /**
683
- * Is the button inline
684
- * @deprecated
685
- */
686
- anchorOrigin?: Origin;
687
- /**
688
- * Is the button inline
689
- * * @deprecated
690
- */
691
- transformOrigin?: Origin;
692
- /**
693
- * Is the button inline
694
- * * @deprecated
695
- */
696
- clickOutToClose?: boolean;
697
- /**
698
- * Is the button inline
699
- * * @deprecated
700
- */
701
- autoCloseDuration?: number;
702
- }
703
-
704
- type RadioProps = {
705
- /**
706
- * Is the Radio button selected
707
- */
708
- selected?: boolean;
709
- /**
710
- * Function to be called when the selected item changes
711
- */
712
- onChange?: RadioGroupContextValue['onValueChange'];
713
- /**
714
- * Whether disabled select
715
- */
716
- disabled?: boolean;
717
- /**
718
- * label for the radio button
719
- */
720
- label?: string;
721
- /**
722
- * The class name of radio button
723
- */
724
-
725
- className?: string;
726
- /**
727
- * Id of the button
728
- */
729
- id?: string;
730
- };
731
-
732
- interface RadioItemProps {
733
- id: string;
734
- name: string;
735
- hide?: boolean;
736
- disabled?: boolean;
737
- [key: string]: any;
738
- }
739
-
740
- type RadioGroupProps<T extends RadioItemProps = RadioItemProps> = {
741
- /**
742
- * Select options
743
- */
744
- options?: Array<T>;
745
- /**
746
- * Id accessor of radio button
747
- */
748
- idAccessor?: string;
749
- /**
750
- * The default value
751
- */
752
- defaultValue?: string;
753
- /**
754
- * Value of radio button
755
- */
756
- value?: RadioGroupContextValue['value'];
757
- /**
758
- * Function to be called when the selected item changes
759
- */
760
- onChange?: RadioGroupContextValue['onValueChange'];
761
- /**
762
- * Name accesssor of radio button
763
- */
764
- nameAccessor?: string;
765
- /**
766
- * The description of the content
767
- */
768
- label?: string;
769
- /**
770
- * class Name of Radio button
771
- */
772
- className?: string;
773
- /**
774
- * Id of the button
775
- */
776
- id?: string;
777
- };
778
-
779
- type ReorderItemType = {
780
- id: string | number;
781
- [key: string]: any;
782
- };
783
-
784
- type ReorderProps<T extends ReorderItemType = ReorderItemType> = {
785
- /**
786
- * Items of reorder
787
- */
788
- items: T[];
789
- /**
790
- * Class name of reorder
791
- */
792
- className?: string;
793
- /**
794
- * Whether disabled select
795
- */
796
- disabled?: boolean;
797
- /**
798
- * should show the Dragger?
799
- */
800
- showDragger?: boolean;
801
- customFilter?: (item: T) => boolean;
802
- onReorder?: (items: T[]) => void;
803
- customRender: (
804
- item: T,
805
- index: number,
806
- listeners?: DraggableSyntheticListeners,
807
- ) => React.ReactNode;
808
- };
809
-
810
- type RowData = unknown | object | any[];
811
-
812
- interface TableProps<T extends RowData> {
813
- /**
814
- * How large should the button be?
815
- */
816
- data: CoreOptions<T>['data'];
817
- columns: CoreOptions<T>['columns'];
818
- showFooter?: boolean;
819
- // count: number;
820
- // pageSize: number;
821
- // pageIndex?: number;
822
- // columnOrder?: string[];
823
- // hiddenColumns?: string[];
824
- // selectedRowIds?: Record<string, boolean>;
825
- // disableSelectMenuOptionIds?: string[];
826
- // hideSelectMenuOptionIds?: string[];
827
- // selectMenuOptions?: MenuItemProps[];
828
- // selectMenuOptionsHandler?: (option: MenuItemProps) => void;
829
- // setPageIndex?: (
830
- // pageIndex: number,
831
- // ) => void | React.Dispatch<React.SetStateAction<number>>;
832
- // setSelectedRowIds?: (
833
- // selectedRowIds: Record<string, boolean>,
834
- // ) => void | React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
835
- // onRowClick?: (row: Row, column: ColumnInstance) => void;
836
- // onNextPageClick?: () => void;
837
- // onPreviousPageClick?: () => void;
838
- // rowPropGetter?: (row: Row) => TableCommonProps;
839
- // cellPropGetter?: (cell: Cell) => TableCommonProps;
840
- // rowMenuOptions?: (rowData?: any) => MenuItemProps[];
841
- // onSelectAllRows?: (checked: boolean) => void;
842
- // onRowSelect?: (row: Row, checked: boolean) => void;
843
- // onMenuOptionSelect?: (optionId: string, row: any) => void;
844
- // tableOptions?: Partial<TableOptions<any>> &
845
- // UseRowSelectOptions<any> &
846
- // UsePaginationOptions<any>;
847
- // enableNextPage?: boolean;
848
- // enablePreviousPage?: boolean;
849
- // isLoading?: boolean;
850
- // isFetching?: boolean;
851
- // hideActions?: boolean;
852
- // hideFilters?: boolean;
853
- // hideTableOnEmpty?: boolean;
854
- // disableSelectMenuOptions?: boolean;
855
- // disableRowSelect?: boolean;
856
- // hideTopPagination?: boolean;
857
- // showTableOnLoading?: boolean;
858
- // indeterminateCount?: boolean;
859
- // hideSelectAllInTable?: boolean;
860
- // hideBottomPagination?: boolean;
861
- // hideLoaderOnTopPagination?: boolean;
862
- // dataKey?: string;
863
- // loaderStyles?: React.CSSProperties;
864
- // infoComponent?: React.ReactElement;
865
- // actionComponent?: React.ReactElement;
866
- // filterComponent?: React.ReactElement;
867
- // headerComponent?: React.ReactElement;
868
- // emptyComponent?: React.ReactElement;
869
- // loadingComponent?: React.ReactElement;
870
- }
871
-
872
- interface TabsItemProps {
873
- id: string;
874
- name: string;
875
- hide?: boolean;
876
- disabled?: boolean;
877
- [key: string]: any;
878
- }
879
-
880
- type TabsProps<T extends TabsItemProps = TabsItemProps> = {
881
- /**
882
- * options for Tabs
883
- */
884
- options?: Array<T>;
885
- renderTabsContent?: (tabOption: T) => React.ReactNode;
886
- /**
887
- * Id accessor of tabes
888
- */
889
- idAccessor?: string;
890
- /**
891
- * Name accessor of tabes
892
- */
893
- nameAccessor?: string;
894
- ref?: React.RefObject<HTMLDivElement>;
895
- /**
896
- * value for tabs
897
- */
898
- value?: TabsProps$1['value'];
899
- /**
900
- * default value of tabes
901
- */
902
- defaultValue?: TabsProps$1['defaultValue'];
903
- /**
904
- * Function to be called when the selected item changes
905
- */
906
-
907
- onChange?: TabsProps$1['onValueChange'];
908
- };
909
-
910
- interface TagProps {
911
- /**
912
- * State of the tag
913
- */
914
- state?: 'error' | 'default' | 'transparent';
915
- /**
916
- * Show border around the tag
917
- */
918
- showBorder?: boolean;
919
- /**
920
- * Image source for the avatar
921
- */
922
- avatarImgSrc?: string;
923
- /**
924
- * Image alt for the avatar
925
- */
926
- avatarImgAlt?: string;
927
- /**
928
- * Text for the avatar
929
- */
930
- avatarText?: string;
931
- /**
932
- * Function to be called when the tag is closed
933
- */
934
- onClose?: () => void;
935
- /**
936
- * Children of the tag
937
- */
938
- children?: React.ReactNode;
939
- /**
940
- * Props for the icon
941
- */
942
- iconProps?: React.HTMLAttributes<HTMLButtonElement>;
943
- }
944
-
945
- type ThemeProviderType<Theme> = React.ComponentType<{
946
- children: React.ReactNode;
947
- theme: Theme;
948
- }>;
949
-
950
- type ToastTypes = 'success' | 'warning' | 'error' | 'info';
951
-
952
- interface ToastType {
953
- /**
954
- * How large should the button be?
955
- */
956
- text?: string;
957
- /**
958
- * How large should the button be?
959
- */
960
- type?: ToastTypes;
961
- /**
962
- * How large should the button be?
963
- */
964
- delay?: number;
965
- /**
966
- * How large should the button be?
967
- */
968
- customIcon?: React.ReactNode;
969
- /**
970
- * How large should the button be?
971
- */
972
- fixed?: boolean;
973
- /**
974
- * How large should the button be?
975
- */
976
- showProgress?: boolean;
977
- // actions?: Array<ToastAction>;
978
- }
979
-
980
- type ToastWithID = ToastType & {
981
- id: string;
982
- };
983
-
984
- type ToastItemProps = ToastWithID & {
985
- index: number;
986
- };
987
-
988
- type UpdateToastsFunction<T> = (
989
- fn: (toasts: Array<T>) => Array<T>,
990
- ) => void;
991
-
992
- interface ToastContextType {
993
- toasts: Array<ToastWithID>;
994
- windowState: 'focus' | 'blur';
995
- addToast: (toast: ToastType) => void;
996
- updateToasts: (fn: (oldToasts: ToastWithID[]) => ToastWithID[]) => void;
997
- }
998
-
999
- type ToggleSizes = 'sm' | 'md' | 'lg';
1000
-
1001
- interface ToggleProps
1002
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
1003
- /**
1004
- * The position of the tooltip
1005
- */
1006
- on?: boolean;
1007
- handleChange?: (on: boolean) => void;
1008
- /**
1009
- * Is the button inline
1010
- */
1011
- size?: ToggleSizes;
1012
- /**
1013
- * Is hasIcon enabled?
1014
- */
1015
- hasIcon?: boolean;
1016
- thumbProps?: React.HTMLAttributes<HTMLSpanElement>;
1017
- /**
1018
- * Is this a required field?
1019
- */
1020
- isRequired?: boolean;
1021
- /**
1022
- * Is this a error field?
1023
- */
1024
- isErrored?: boolean;
1025
- }
1026
-
1027
- type Position =
1028
- | 'top'
1029
- | 'top-start'
1030
- | 'top-end'
1031
- | 'bottom'
1032
- | 'bottom-start'
1033
- | 'bottom-end'
1034
- | 'left'
1035
- | 'left-start'
1036
- | 'left-end'
1037
- | 'right'
1038
- | 'right-start'
1039
- | 'right-end';
1040
-
1041
- type Side = 'top' | 'right' | 'bottom' | 'left';
1042
- type Align = 'start' | 'end' | 'center';
1043
-
1044
- interface TooltipProps {
1045
- /**
1046
- * HTML to be rendered in the tooltip
1047
- */
1048
- html?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1049
- /**
1050
- * String to be rendered in the tooltip
1051
- */
1052
- label?: string;
1053
- /**
1054
- * The position of the tooltip
1055
- */
1056
- position: Position;
1057
- delay?: number;
1058
- /**
1059
- * Whether to show the arrow,
1060
- */
1061
- arrow?: boolean;
1062
- /**
1063
- * Whether disabled select
1064
- */
1065
- disabled?: boolean;
1066
- /**
1067
- * Class name of tooltip
1068
- */
1069
- className?: string;
1070
- style?: React.CSSProperties;
1071
- /**
1072
- * The children or label
1073
- */
1074
- replaceChild?: boolean;
1075
- tabIndex?: number;
1076
- children?: React.ReactNode | string | null;
1077
- providerProps?: TooltipProviderProps;
1078
- rootProps?: TooltipProps$1;
1079
- arrowProps?: TooltipArrowProps;
1080
- }
1081
-
1082
- type BaseProps = Pick<
1083
- TransitionProps$1,
1084
- | 'in'
1085
- | 'onEnter'
1086
- | 'onEntering'
1087
- | 'onEntered'
1088
- | 'onExit'
1089
- | 'onExiting'
1090
- | 'onExited'
1091
- | 'unmountOnExit'
1092
- | 'timeout'
1093
- >;
1094
-
1095
- interface TransitionProps extends BaseProps {
1096
- transition?: string;
1097
- children: (styles: React.CSSProperties) => React.ReactNode;
1098
- styles: TransitionStyles;
1099
- }
1100
-
1101
- type TransitionStyleState = 'init' | 'entered' | 'exiting';
1102
-
1103
- type TransitionStyles = {
1104
- [K in TransitionStyleState]?: React.CSSProperties;
1105
- };
1106
-
1107
-
1108
- type SlidePlacement = 'left' | 'right' | 'bottom' | 'top';
1109
-
1110
- type SlideProps = Omit<TransitionProps, 'styles' | 'timeout'> & {
1111
- /** The direction to slide drawer from */
1112
- placement?: SlidePlacement;
1113
- /** The transition timeout */
1114
- timeout?: number;
1115
- };
1116
-
1117
- type FadeProps = Omit<TransitionProps, 'styles' | 'timeout'> & {
1118
- timeout?: number;
1119
- };
1120
-
1121
- interface SlideFadeProps
1122
- extends Omit<TransitionProps, 'styles' | 'timeout'> {
1123
- /**
1124
- * The initial offset to slide from
1125
- */
1126
- initialOffset?: string;
1127
- /**
1128
- * The transition timeout
1129
- */
1130
- timeout?: number;
1131
- }
1132
-
1133
- type TypographyWeightType = 'regular' | 'bold' | 'semi-bold';
1134
-
1135
- type TypographyVariantType =
1136
- | 'primary'
1137
- | 'secondary'
1138
- | 'heading'
1139
- | 'heading1'
1140
- | 'heading2'
1141
- | 'heading3'
1142
- | 'heading4'
1143
- | 'caption';
1144
-
1145
- interface TypographyProps
1146
- extends React.HtmlHTMLAttributes<HTMLSpanElement> {
1147
- /**
1148
- * The children or label
1149
- */
1150
- children?: React.ReactNode | string;
1151
- variant?: TypographyVariantType;
1152
- weight?: TypographyWeightType;
1153
- }
1154
-
1155
- export type { AlertProps, Align, BaseProps, ButtonProps, ButtonSizeKey, ButtonVariant, CheckboxProps, ConfirmationProps, DatePickerProps, DateRangePickerProps, DateTimePickerProps, DateTimeRangePickerProps, DefaultDropdownItem, DefaultMultiSelectDropdownItem, DefaultProps, DrawerPlacement, DrawerProps, DrawerSizeType, DropdownProps, DropdownTypes, FadeProps, InputProps, LevelType, LoaderPropTypes, MenuItemProps, MenuProps, ModalAlignType, ModalPositionType, ModalProps, ModalSizeType, MultiSelectDropdownProps, Origin, PopoverProps, Position, RadioGroupProps, RadioItemProps, RadioProps, ReorderItemType, ReorderProps, RowData, Side, Sizes, SlideFadeProps, SlidePlacement, SlideProps, Speeds, TableProps, TabsItemProps, TabsProps, TagProps, TextAreaProps, ThemeProviderType, ToastContextType, ToastItemProps, ToastType, ToastTypes, ToastWithID, ToggleProps, ToggleSizes, TooltipProps, TransitionProps, TransitionStyleState, TransitionStyles, TypographyProps, TypographyVariantType, TypographyWeightType, UpdateToastsFunction };