@kwantis-id3/frontend-library 0.27.1 → 1.0.0-rc.10

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.
Files changed (79) hide show
  1. package/README.md +6 -332
  2. package/dist/esm/index.js +398 -114
  3. package/dist/esm/index.js.map +1 -1
  4. package/dist/esm/types/components/Accordion/Accordion.d.ts +3 -38
  5. package/dist/esm/types/components/Accordion/AccordionInterfaces.d.ts +21 -0
  6. package/dist/esm/types/components/Accordion/AccordionStyled.d.ts +23 -14
  7. package/dist/esm/types/components/Accordion/index.d.ts +2 -1
  8. package/dist/esm/types/components/Button/Button.d.ts +2 -25
  9. package/dist/esm/types/components/Button/ButtonInterfaces.d.ts +24 -0
  10. package/dist/esm/types/components/Button/ButtonStyled.d.ts +41 -0
  11. package/dist/esm/types/components/Button/index.d.ts +2 -1
  12. package/dist/esm/types/components/Card/Card.d.ts +15 -0
  13. package/dist/esm/types/components/Card/CardInterfaces.d.ts +6 -0
  14. package/dist/esm/types/components/Card/CardStyled.d.ts +24 -0
  15. package/dist/esm/types/components/Card/index.d.ts +2 -0
  16. package/dist/esm/types/components/Drawer/Drawer.d.ts +3 -0
  17. package/dist/esm/types/components/Drawer/DrawerInterfaces.d.ts +21 -0
  18. package/dist/esm/types/components/Drawer/DrawerStyled.d.ts +25 -0
  19. package/dist/esm/types/components/Drawer/index.d.ts +2 -0
  20. package/dist/esm/types/components/Dropdown/Dropdown.d.ts +2 -42
  21. package/dist/esm/types/components/Dropdown/DropdownInterfaces.d.ts +43 -0
  22. package/dist/esm/types/components/Dropdown/DropdownStyled.d.ts +10 -11
  23. package/dist/esm/types/components/Dropdown/index.d.ts +2 -1
  24. package/dist/esm/types/components/Indicator/ErrorIndicator.d.ts +3 -0
  25. package/dist/esm/types/components/Indicator/Indicator.d.ts +7 -0
  26. package/dist/esm/types/components/Indicator/IndicatorInterfaces.d.ts +11 -0
  27. package/dist/esm/types/components/Indicator/LiveIndicator.d.ts +3 -0
  28. package/dist/esm/types/components/Indicator/SuccessIndicator.d.ts +3 -0
  29. package/dist/esm/types/components/Indicator/WarningIndicator.d.ts +3 -0
  30. package/dist/esm/types/components/Indicator/index.d.ts +2 -0
  31. package/dist/esm/types/components/InputField/InputField.d.ts +3 -12
  32. package/dist/esm/types/components/InputField/InputFieldInterfaces.d.ts +8 -0
  33. package/dist/esm/types/components/InputField/{StyledInputField.d.ts → InputFieldStyled.d.ts} +2 -2
  34. package/dist/esm/types/components/InputField/index.d.ts +2 -1
  35. package/dist/esm/types/components/Modal/Modal.d.ts +3 -19
  36. package/dist/esm/types/components/Modal/ModalInterfaces.d.ts +16 -0
  37. package/dist/esm/types/components/Modal/{StyledModal.d.ts → ModalStyled.d.ts} +4 -2
  38. package/dist/esm/types/components/Modal/index.d.ts +2 -2
  39. package/dist/esm/types/components/MultiViewList/MultiViewList.d.ts +3 -0
  40. package/dist/esm/types/components/MultiViewList/MultiViewListInterfaces.d.ts +5 -0
  41. package/dist/esm/types/components/MultiViewList/MultiViewListStyled.d.ts +4 -0
  42. package/dist/esm/types/components/MultiViewList/index.d.ts +2 -0
  43. package/dist/esm/types/components/SelectFilter/MultiSelect.d.ts +2 -4
  44. package/dist/esm/types/components/SelectFilter/SingleSelect.d.ts +2 -4
  45. package/dist/esm/types/components/SelectFilter/index.d.ts +2 -2
  46. package/dist/esm/types/components/Slider/Slider.d.ts +5 -7
  47. package/dist/esm/types/components/Slider/SliderStyled.d.ts +4 -4
  48. package/dist/esm/types/components/Slider/index.d.ts +1 -1
  49. package/dist/esm/types/components/Table/DebouncedFilter.d.ts +7 -0
  50. package/dist/esm/types/components/Table/DebouncedInput.d.ts +5 -0
  51. package/dist/esm/types/components/Table/Table.d.ts +3 -0
  52. package/dist/esm/types/components/Table/TableInterfaces.d.ts +21 -0
  53. package/dist/esm/types/components/Table/TableStyled.d.ts +14 -0
  54. package/dist/esm/types/components/Table/index.d.ts +2 -0
  55. package/dist/esm/types/components/Tag/Tag.d.ts +4 -0
  56. package/dist/esm/types/components/Tag/TagInterfaces.d.ts +22 -0
  57. package/dist/esm/types/components/Tag/TagStyled.d.ts +7 -0
  58. package/dist/esm/types/components/Tag/index.d.ts +2 -0
  59. package/dist/esm/types/components/ThemeContext/ThemeContext.d.ts +6 -72
  60. package/dist/esm/types/components/ThemeContext/ThemeInterfaces.d.ts +109 -0
  61. package/dist/esm/types/components/ThemeContext/index.d.ts +2 -1
  62. package/dist/esm/types/components/TreeView/ControlledTreeView.d.ts +4 -0
  63. package/dist/esm/types/components/TreeView/TreeUtils.d.ts +3 -0
  64. package/dist/esm/types/components/TreeView/TreeViewInterfaces.d.ts +77 -0
  65. package/dist/esm/types/components/TreeView/TreeViewSyled.d.ts +24 -0
  66. package/dist/esm/types/components/TreeView/UncontrolledTreeView.d.ts +3 -0
  67. package/dist/esm/types/components/TreeView/index.d.ts +3 -0
  68. package/dist/esm/types/components/index.d.ts +15 -8
  69. package/dist/esm/types/utils/colors.d.ts +30 -0
  70. package/dist/esm/types/utils/index.d.ts +1 -0
  71. package/dist/esm/types/utils/styled.d.ts +1 -38
  72. package/dist/esm/types/utils/testing.d.ts +53 -0
  73. package/dist/esm/types/utils/transientOptions.d.ts +7 -0
  74. package/dist/esm/types/utils/usePrefersColorScheme.d.ts +1 -0
  75. package/dist/index.d.ts +423 -133
  76. package/package.json +33 -26
  77. package/src/types/emotion.d.ts +8 -0
  78. package/src/types/tanstack.d.ts +7 -0
  79. package/changelog.md +0 -192
package/dist/index.d.ts CHANGED
@@ -1,48 +1,23 @@
1
- import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
2
- import * as React$1 from 'react';
3
- import React__default from 'react';
4
- import { Interpolation, CreateStyled as CreateStyled$1, CreateStyledComponent, FilteringStyledOptions, StyledOptions } from '@emotion/styled';
5
- import { Theme, PropsOf } from '@emotion/react';
1
+ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
2
+ import { Interpolation, Theme as Theme$1 } from '@emotion/react';
3
+ import { Theme } from '@emotion/react/dist/declarations/src';
4
+ import * as react from 'react';
5
+ import { PropsWithChildren, ReactNode, FC } from 'react';
6
+ import { ColumnDef } from '@tanstack/react-table';
7
+ import { CreateStyled } from '@emotion/styled';
6
8
 
7
- interface Color {
8
- main: string;
9
- contrastText: string;
10
- }
11
- interface ThemeColorsObject {
12
- primary: Color;
13
- secondary: Color;
14
- tertiary: Color;
15
- statusOk: Color;
16
- statusWarning: Color;
17
- statusCritical: Color;
18
- statusNeutral: Color;
19
- }
20
- interface ThemeContextProps {
21
- colors: ThemeColorsObject;
22
- }
23
- interface Nothing {
24
- }
25
- type Union<T, U> = T | (U & Nothing);
26
- type ThemeColors = keyof ThemeColorsObject;
27
- type ThemeColorsExtended = Union<ThemeColors, string>;
28
- type ThemeProperties = ThemeContextProps & {
29
- getColor: (color: ThemeColorsExtended) => Color;
30
- };
31
- declare const ThemeContextProvider: (props: React__default.PropsWithChildren<{
32
- theme?: ThemeContextProps;
33
- }>) => React__default.JSX.Element;
34
- declare const useThemeContext: () => ThemeProperties;
35
-
36
- type ButtonVariants = "contained" | "outlined" | "text";
37
- type ButtonProps = {
9
+ type TButtonVariants = "contained" | "outlined" | "text";
10
+ type TButtonProps = {
38
11
  /** Color of the button */
39
- color?: ThemeColorsExtended;
12
+ color?: string;
40
13
  /** Type of the button */
41
14
  type?: "button" | "submit" | "reset";
42
15
  /** Custom styles */
43
16
  sx?: Interpolation<Theme>;
44
17
  /** Variant of the button, either `contained`, `outlined` or `text` */
45
- variant?: ButtonVariants;
18
+ variant?: TButtonVariants;
19
+ /** The button size; either "large" or "small" */
20
+ size?: "small" | "large";
46
21
  /** onClick handler */
47
22
  onClick?: () => void;
48
23
  className?: string;
@@ -51,55 +26,162 @@ type ButtonProps = {
51
26
  /** Disabled state */
52
27
  disabled?: boolean;
53
28
  /** Elements to render as children */
54
- children?: React$1.ReactNode;
29
+ children?: React.ReactNode;
55
30
  };
56
- declare const Button: (props: ButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
57
31
 
58
- type AccordionProps = {
59
- /** Text of the accordion trigger */
32
+ declare const Button: (props: TButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
33
+
34
+ type TColorScale = {
35
+ 50: string;
36
+ 100: string;
37
+ 200: string;
38
+ 300: string;
39
+ 400: string;
40
+ 500: string;
41
+ 600: string;
42
+ 700: string;
43
+ 800: string;
44
+ 900: string;
45
+ 950: string;
46
+ };
47
+ interface ICommonColors {
48
+ red: TColorScale;
49
+ green: TColorScale;
50
+ blue: TColorScale;
51
+ yellow: TColorScale;
52
+ purple: TColorScale;
53
+ darkBlue: TColorScale;
54
+ orange: TColorScale;
55
+ gray: TColorScale;
56
+ }
57
+ interface IBackgroundColors {
58
+ main: string;
59
+ radialGradient: string;
60
+ }
61
+ interface ISharedColorProperties {
62
+ /** Represents the color itself */
63
+ main: string;
64
+ /** A slightly different color derived from the main one */
65
+ variant: string;
66
+ }
67
+ interface IStandardPaletteColor extends ISharedColorProperties {
68
+ /** The color to be used for text and elements that need to contrast with the main / variant */
69
+ contrast: string;
70
+ }
71
+ interface ITagColors {
72
+ default: {
73
+ main: string;
74
+ text: string;
75
+ };
76
+ warm: {
77
+ main: string;
78
+ text: string;
79
+ };
80
+ cold: {
81
+ main: string;
82
+ text: string;
83
+ };
84
+ paper: {
85
+ main: string;
86
+ text: string;
87
+ };
88
+ }
89
+ interface IIndicatorColors {
90
+ main: string;
91
+ mainFill: string;
92
+ success: string;
93
+ successFill: string;
94
+ warning: string;
95
+ warningFill: string;
96
+ error: string;
97
+ errorFill: string;
98
+ }
99
+ interface IPalette {
100
+ /** Application background */
101
+ background: IBackgroundColors;
102
+ /** Primary Brand Color */
103
+ primary: IStandardPaletteColor;
104
+ /** Color config for actions solved with a success */
105
+ success: IStandardPaletteColor;
106
+ /** Color config for actions solved with a warning */
107
+ warning: IStandardPaletteColor;
108
+ /** Color config for actions solved with an error */
109
+ error: IStandardPaletteColor;
110
+ /** Color config for surfaces*/
111
+ surface: IStandardPaletteColor;
112
+ /** Color config for borders */
113
+ border: ISharedColorProperties;
114
+ /** Color config for tags */
115
+ tag: ITagColors;
116
+ /** Color config for indicators */
117
+ indicator: IIndicatorColors;
118
+ }
119
+ type TThemeMode = "light" | "dark" | "system";
120
+ interface IThemeContextProps {
121
+ /** From this prop you can override (even partially) the palettes (dark and light) of the library. */
122
+ palettes?: {
123
+ light?: Partial<IPalette>;
124
+ dark?: Partial<IPalette>;
125
+ };
126
+ defaultMode?: TThemeMode;
127
+ }
128
+ interface IThemeContextValue {
129
+ /** Which mode is currently active */
130
+ mode: TThemeMode;
131
+ /** Which mode is currently displayed.
132
+ * This is useful when the mode is set to "system" and the user has a dark mode preference.
133
+ */
134
+ displayedMode: "light" | "dark";
135
+ /** A collection of common Colors with variants */
136
+ commonColors: ICommonColors;
137
+ /** This will contain the palette of the correct color mode. */
138
+ activePalette: IPalette;
139
+ /** use this function to change the mode */
140
+ setMode: (mode: TThemeMode) => void;
141
+ }
142
+
143
+ declare const defaultLightPalette: IPalette;
144
+ declare const defaultDarkPalette: IPalette;
145
+ declare const ThemeContextProvider: ({ palettes, defaultMode, children, }: PropsWithChildren<IThemeContextProps>) => ReactNode;
146
+ declare const useThemeContext: () => IThemeContextValue;
147
+
148
+ type TAccordionProps = PropsWithChildren & {
149
+ /** Title to be used if no custom trigger is passed */
60
150
  title: string;
61
- /** Content of the accordion */
62
- children: React__default.ReactNode;
63
- /** Custom trigger component */
64
- customTrigger?: React__default.ReactNode;
65
- /** Works only if uncontrolled (isOpen props is not present) */
66
- defaultOpen?: boolean;
67
- /** Color of the accordion */
68
- color?: ThemeColorsExtended;
69
- /** Color of the icon */
70
- iconColor?: ThemeColorsExtended;
71
- /** Color of the divider */
72
- dividerColor?: ThemeColorsExtended;
73
- /** Hide the icon */
74
- hideIcon?: boolean;
75
- /** Hide the divider */
76
- hideDivider?: boolean;
77
151
  /** Pass your state value here if the Accordion needs to be Controlled */
78
152
  isOpen?: boolean;
79
- /** Lazy render the content of the accordion */
80
- isLazy?: boolean;
81
- /** onClick handler */
153
+ /** Default open state if the accordion is Uncontrolled */
154
+ defaultOpen?: boolean;
155
+ /** Callback function to be called when the Accordion is clicked */
82
156
  onClick?: () => void;
83
- /** onOpen handler */
157
+ /** Callback function to be called when the Accordion opens */
84
158
  onOpen?: () => void;
85
- /** onClose handler */
159
+ /** Callback function to be called when the Accordion closes */
86
160
  onClose?: () => void;
87
- /** Custom styles */
88
- sx?: Interpolation<Theme>;
161
+ /** Custom trigger element */
162
+ trigger?: (isOpen: boolean) => React.ReactNode;
163
+ /** Variant of the Accordion. Default has everything wrapped in borders, while light just renders the content and the title without setting colors
164
+ * @default "default"
165
+ */
166
+ variant?: "default" | "light";
89
167
  };
90
- declare const Accordion: (props: AccordionProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
91
168
 
92
- interface TextFieldProps extends React__default.InputHTMLAttributes<HTMLInputElement> {
169
+ declare const Accordion: FC<TAccordionProps>;
170
+
171
+ declare const InputField: react.ForwardRefExoticComponent<react.InputHTMLAttributes<HTMLInputElement> & {
172
+ containerClassName?: string;
173
+ color?: string;
174
+ sx?: React.CSSProperties;
175
+ } & react.RefAttributes<HTMLInputElement>>;
176
+
177
+ type TTextFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {
93
178
  /** Classname given to the container div */
94
179
  containerClassName?: string;
95
- /** Disables the input */
96
- isDisabled?: boolean;
97
180
  /** The color of the input */
98
- color?: ThemeColorsExtended;
181
+ color?: string;
99
182
  /** Change the styles of the input field */
100
- sx?: React__default.CSSProperties;
101
- }
102
- declare const InputField: React__default.ForwardRefExoticComponent<TextFieldProps & React__default.RefAttributes<HTMLInputElement>>;
183
+ sx?: React.CSSProperties;
184
+ };
103
185
 
104
186
  interface SingleSelectProps<Option = {
105
187
  label: string;
@@ -130,7 +212,7 @@ interface SingleSelectProps<Option = {
130
212
  /** Wether the select is loading */
131
213
  isLoading?: boolean;
132
214
  /** The color of the select */
133
- color?: ThemeColorsExtended;
215
+ color?: string;
134
216
  /** The HTML id of the container */
135
217
  containerId?: string;
136
218
  /** The HTML id of the select */
@@ -144,7 +226,7 @@ interface SingleSelectProps<Option = {
144
226
  /** Wether the select is required */
145
227
  required?: boolean;
146
228
  }
147
- declare const SingleSelect: <Option>(props: SingleSelectProps<Option>) => React__default.JSX.Element;
229
+ declare const SingleSelect: <Option>(props: SingleSelectProps<Option>) => _emotion_react_jsx_runtime.JSX.Element;
148
230
 
149
231
  interface MultiSelectProps<Option = {
150
232
  label: string;
@@ -175,7 +257,7 @@ interface MultiSelectProps<Option = {
175
257
  /** Wether the select is loading */
176
258
  isLoading?: boolean;
177
259
  /** The color of the select */
178
- color?: ThemeColorsExtended;
260
+ color?: string;
179
261
  /** The HTML id of the container */
180
262
  containerId?: string;
181
263
  /** The HTML id of the select */
@@ -187,9 +269,9 @@ interface MultiSelectProps<Option = {
187
269
  /** Wether the select is required */
188
270
  required?: boolean;
189
271
  }
190
- declare const MultiSelect: <Option>(props: MultiSelectProps<Option>) => React__default.JSX.Element;
272
+ declare const MultiSelect: <Option>(props: MultiSelectProps<Option>) => _emotion_react_jsx_runtime.JSX.Element;
191
273
 
192
- type SliderProps = {
274
+ type TSliderProps = {
193
275
  /** The values of the slider. */
194
276
  values: number[];
195
277
  /** The minimum value of the slider. */
@@ -201,11 +283,11 @@ type SliderProps = {
201
283
  /** The onFinalChange handler of the slider. (called only when the thumb is released) */
202
284
  onFinalChange?: (values: number[]) => void;
203
285
  /** The color of the slider */
204
- color?: ThemeColorsExtended;
286
+ color?: string;
205
287
  /** The color of the section not included in the range */
206
- unselectedColor?: ThemeColorsExtended;
288
+ unselectedColor?: string;
207
289
  /** The color of the thumb */
208
- thumbColor?: ThemeColorsExtended;
290
+ thumbColor?: string;
209
291
  /** The HTML id of the slider */
210
292
  htmlId?: string;
211
293
  /** The class name of the slider */
@@ -221,24 +303,26 @@ type SliderProps = {
221
303
  /** Wether the thumbs can overlap */
222
304
  allowOverlap?: boolean;
223
305
  };
224
- declare const Slider: (props: SliderProps) => React__default.JSX.Element;
306
+ declare const Slider: (props: TSliderProps) => _emotion_react_jsx_runtime.JSX.Element;
225
307
 
226
308
  /**
227
309
  * @property {string} value - The value displayed in the dropdown item
228
- * @property {ThemeColorsExtended} color - The color of the dropdown item
310
+ * @property {string} color - The color of the dropdown item
229
311
  * @property {string} textColor - The text color of the dropdown item
230
312
  * @property {DropdownItem[]} children - The children of the dropdown item
231
313
  * @property {() => void} onClick - The onClick handler of the dropdown item
232
314
  */
233
- type DropdownItem = {
315
+ type TDropdownItem = {
234
316
  /** The value displayed in the item */
235
317
  value: string;
236
318
  /** The color of the item */
237
- color?: ThemeColorsExtended;
319
+ bgColor?: string;
238
320
  /** The text color of the item */
239
321
  textColor?: string;
322
+ /** The hover color of the item */
323
+ hoverColor?: string;
240
324
  /** The children of the item */
241
- children?: DropdownItem[];
325
+ children?: TDropdownItem[];
242
326
  /** Wether the item is hidden or not */
243
327
  isHidden?: boolean;
244
328
  /** Wether the dropdown should close when the item is clicked */
@@ -246,25 +330,30 @@ type DropdownItem = {
246
330
  /** The onClick handler of the item */
247
331
  onClick?: () => void;
248
332
  };
249
- type DropdownProps = {
333
+ type TDropdownProps = {
250
334
  /** The content of the dropdown */
251
- content: DropdownItem[];
335
+ content: TDropdownItem[];
252
336
  /** The trigger element of the dropdown. Clicking on this item will open the dropdown */
253
- trigger: React__default.ReactNode;
337
+ trigger: React.ReactNode;
254
338
  /** The color of the dropdown */
255
- color?: ThemeColorsExtended;
339
+ bgColor?: string;
256
340
  /** The hover color of the dropdown */
257
- hoverColor?: ThemeColorsExtended;
341
+ hoverColor?: string;
258
342
  /** Controls wether the dropdown should extend towards the left or the right */
259
343
  direction?: "left" | "right";
260
344
  /** The mobile breakpoint, by default it's 768px */
261
345
  mobileBreakpoint?: number;
262
346
  };
263
- declare const Dropdown: (props: DropdownProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
347
+ type TDropdownItemProps = TDropdownItem & {
348
+ direction?: string;
349
+ closeBody: () => void;
350
+ };
351
+
352
+ declare const Dropdown: (props: TDropdownProps) => _emotion_react_jsx_runtime.JSX.Element;
264
353
 
265
- interface ModalProps {
354
+ type TModalProps = {
266
355
  /** The content of the modal */
267
- children: React__default.ReactNode;
356
+ children: React.ReactNode;
268
357
  /** Cointrols whether the modal should be open or not. */
269
358
  isOpen: boolean;
270
359
  /** The handler to be called when the modal is closed */
@@ -276,9 +365,206 @@ interface ModalProps {
276
365
  /** custom height */
277
366
  height?: string;
278
367
  /** custom css */
279
- sx?: React__default.CSSProperties;
280
- }
281
- declare const Modal: React__default.FC<ModalProps>;
368
+ sx?: React.CSSProperties;
369
+ };
370
+
371
+ declare const Modal: FC<TModalProps>;
372
+
373
+ type TIndicatorInstanceProps = {
374
+ outerColor?: string;
375
+ innerColor?: string;
376
+ size?: number;
377
+ title?: string;
378
+ onClick?: (e: React.MouseEvent<SVGSVGElement>) => void;
379
+ };
380
+ type TIndicatorProps = {
381
+ variant: TIndicatorVariants;
382
+ } & TIndicatorInstanceProps;
383
+ type TIndicatorVariants = "live" | "success" | "warning" | "error";
384
+
385
+ type TGenericIndicatorProps = {
386
+ variant: TIndicatorVariants;
387
+ } & TIndicatorProps;
388
+ declare const Indicator: FC<TGenericIndicatorProps>;
389
+
390
+ type TTagProps = {
391
+ text: string;
392
+ /**
393
+ * If `variant` is set to `custom`, `bgColor` and `textColor` will be used.
394
+ * Otherwise, the `variant` will be used to determine the colors.
395
+ *
396
+ * The variants are the keys of the interface `@see ITagColors`, which by default are:
397
+ * - `default`
398
+ * - `warm`
399
+ * - `cold`
400
+ * - `paper`
401
+ */
402
+ variant: keyof ITagColors | "custom";
403
+ /** To use this prop, the variant must be set to `custom` */
404
+ bgColor?: string;
405
+ /** To use this prop, the variant must be set to `custom` */
406
+ textColor?: string;
407
+ sx?: Interpolation<Theme>;
408
+ };
409
+
410
+ /** @jsxImportSource @emotion/react */
411
+
412
+ declare const Tag: FC<TTagProps>;
413
+
414
+ type TCardSectionProps = PropsWithChildren & {
415
+ sx?: Interpolation<Theme$1>;
416
+ onClick?: (e: React.MouseEvent<HTMLElement>) => void;
417
+ };
418
+
419
+ /** @jsxImportSource @emotion/react */
420
+
421
+ /**
422
+ * The Card component is a container component that can be used to display content in a structured way.
423
+ * It has 3 possible sizes: small, medium and large.
424
+ *
425
+ */
426
+ declare const Card: FC<TCardSectionProps>;
427
+ declare const CardHeader: FC<TCardSectionProps>;
428
+ declare const CardContent: FC<TCardSectionProps>;
429
+ declare const CardFooter: FC<TCardSectionProps>;
430
+ declare const CardIndicators: FC<TCardSectionProps>;
431
+ declare const CardMediaSection: FC<TCardSectionProps>;
432
+
433
+ type TCellValues = string | number | boolean | null;
434
+ type TTableProps<Cell extends TCellValues, Row extends TTableRow<Cell>> = {
435
+ columns: ColumnDef<Row, Cell>[];
436
+ data: Row[] | undefined;
437
+ };
438
+ type TTableCell<T extends TCellValues> = {
439
+ value: T;
440
+ bgColor?: string | null;
441
+ textColor?: string | null;
442
+ };
443
+ type TTableRow<T extends TCellValues> = {
444
+ info?: {
445
+ bgColor?: string | null;
446
+ textColor?: string | null;
447
+ [key: string]: string | number | boolean | null | undefined;
448
+ };
449
+ cells: {
450
+ [key: string]: TTableCell<T>;
451
+ };
452
+ };
453
+
454
+ declare const Table: <Cell extends TCellValues, Row extends TTableRow<Cell>>(props: TTableProps<Cell, Row>) => _emotion_react_jsx_runtime.JSX.Element;
455
+ declare const renderCell: (value: string | number | boolean | null) => _emotion_react_jsx_runtime.JSX.Element;
456
+
457
+ type TMultiViewListProps<Cell extends TCellValues, Row extends TTableRow<Cell>> = TTableProps<Cell, Row> & {
458
+ mode: "table" | "cards";
459
+ cardComponent: (item: Row) => React.ReactNode;
460
+ };
461
+
462
+ declare const MultiViewList: <Cell extends TCellValues, Row extends TTableRow<Cell>>(props: TMultiViewListProps<Cell, Row>) => _emotion_react_jsx_runtime.JSX.Element;
463
+
464
+ /**
465
+ * A callback to customize how items are rendered
466
+ * @property isOpen: A boolean indicating if the item is expanded
467
+ * @property hasChildren: A boolean indicating if the item has children
468
+ * @property item: the entire item object
469
+ */
470
+ type TCustomRenderProps = {
471
+ isOpen: boolean;
472
+ item: TTreeViewItem;
473
+ };
474
+ /**
475
+ * A callback to customize how the content of the items is rendered
476
+ * @extends TCustomRenderProps
477
+ * @property icon: The icon of the item. If the renderIcon callback is provided, this will be the result of that callback
478
+ * @property title: The title of the item. If the renderTitle callback is provided, this will be the result of that callback
479
+ */
480
+ type TRenderTriggerProps = TCustomRenderProps & {
481
+ icon: React.ReactNode;
482
+ title: React.ReactNode;
483
+ };
484
+ type TTreeItemFunctions = {
485
+ /** A callback to customize how the titles are rendered */
486
+ renderTitle?: (props: TCustomRenderProps) => React.ReactNode;
487
+ /** A callback to customize how the icons are rendered */
488
+ renderIcon?: (props: TCustomRenderProps) => React.ReactNode;
489
+ /** A callback to customize how the content of the items is rendered */
490
+ renderTrigger?: (props: TRenderTriggerProps) => React.ReactNode;
491
+ /** A callback executed when an item is focused. An item gets focused when you click on it. Focusing and item will also select it. */
492
+ onFocusItem?: (item: TTreeViewItem) => void;
493
+ /** A callback executed when an item is selected. To select an item, ctrl+click on it. */
494
+ onSelectItems?: (item: string[]) => void;
495
+ /** A callback executed when an item is expanded */
496
+ onExpandItem?: (item: TTreeViewItem) => void;
497
+ /** A callback executed when an item is collapsed */
498
+ onCollapseItem?: (item: TTreeViewItem) => void;
499
+ /** A callback to handle the expansion of items without children */
500
+ onMissingChildren?: (item: TTreeViewItem) => void;
501
+ };
502
+ type TTreeViewProps = TTreeItemFunctions & {
503
+ /** An array representing the items that the tree needs to render */
504
+ items: TTreeViewItem[];
505
+ /** Disable multi-selection possibility */
506
+ isMultiSelectionDisabled?: boolean;
507
+ /** Custom styles */
508
+ sx?: Interpolation<Theme$1>;
509
+ };
510
+ type TUncontrolledTreeViewProps = TTreeViewProps & {
511
+ items: TTreeViewItem[];
512
+ };
513
+ type TControlledTreeViewProps = TTreeViewProps & {
514
+ /** The current state of the Tree View. */
515
+ viewState: TViewState;
516
+ };
517
+ type TViewState = {
518
+ /** The list of ids of items that are selected */
519
+ selectedItems?: string[];
520
+ /** The list of ids of items that are expanded */
521
+ expandedItems?: string[];
522
+ /** The focused item */
523
+ focusedItem?: string;
524
+ };
525
+ type TTreeViewItem = TTreeItemFunctions & {
526
+ /** Item identifier */
527
+ id: string;
528
+ /** Item name */
529
+ name: string;
530
+ /** The possible children of this item */
531
+ children?: string[];
532
+ /** If the item should be rendered as a folder even with no children */
533
+ isFolder?: boolean;
534
+ /** A callback to fetch children asynchronously */
535
+ childrenAsync?: () => Promise<TTreeViewItem[]>;
536
+ /** Custom styles */
537
+ sx?: Interpolation<Theme$1>;
538
+ };
539
+
540
+ /** @jsxImportSource @emotion/react */
541
+
542
+ declare const ControlledTreeView: FC<TControlledTreeViewProps>;
543
+
544
+ declare const UncontrolledTreeView: FC<TUncontrolledTreeViewProps>;
545
+
546
+ type TDrawerProps = {
547
+ /** Position of the drawer */
548
+ anchor: "top" | "right" | "bottom" | "left";
549
+ /** Trigger showed when drawer is closed */
550
+ closedTrigger?: ReactNode;
551
+ /** Trigger showed when drawer is open */
552
+ openTrigger?: ReactNode;
553
+ /** Component to be rendered when Drawer is open */
554
+ openContent?: ReactNode;
555
+ /** Component to be rendered when Drawer is closed */
556
+ closedContent?: ReactNode;
557
+ /** Min open of the drawer as number of pixels. If not defined the minOpen will be the height of closedContent if present, otherwise 0px */
558
+ minOpen?: number;
559
+ /** Max open of the drawer as number of pixels. If not defined the maxOpen will be the height of openContent with limit at 90vh/vw */
560
+ maxOpen?: number;
561
+ /** Background color */
562
+ bgColor?: string;
563
+ /** Trigger hover color */
564
+ triggerHoverColor?: string;
565
+ };
566
+
567
+ declare const Drawer: ({ anchor, openContent, closedContent, openTrigger, closedTrigger, minOpen, maxOpen, bgColor, triggerHoverColor, }: TDrawerProps) => _emotion_react_jsx_runtime.JSX.Element;
282
568
 
283
569
  /**
284
570
  * Hook to check if the screen is mobile. The default breakpoint is 768px.
@@ -287,42 +573,46 @@ declare const Modal: React__default.FC<ModalProps>;
287
573
  */
288
574
  declare const useIsMobile: (mobileBreakpoint?: number) => boolean;
289
575
 
290
- declare const transientOptions: Parameters<CreateStyled$1>[1];
576
+ /**
577
+ * emotion.js doesn't support transient options out of the box.
578
+ *
579
+ * Without them, you will get a warning in the console for every custom prop that you pass to a styled component, since it will be forwarded to the DOM.
580
+ * This specific opt-in utility copies the styled-component approach; if used, props starting with `$` will not be passed to the DOM.
581
+ * @see https://github.com/emotion-js/emotion/issues/2193#issuecomment-766173118
582
+ */
583
+ declare const transientOptions: Parameters<CreateStyled>[1];
291
584
 
292
- type StyledTags = {
293
- [Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent<{
294
- theme?: ThemeContextProps;
295
- as?: React.ElementType;
296
- }, JSX.IntrinsicElements[Tag]>;
297
- };
298
- interface BaseCreateStyled {
299
- <C extends React.ComponentClass<React.ComponentProps<C>>, ForwardedProps extends keyof React.ComponentProps<C> & string = keyof React.ComponentProps<C> & string>(component: C, options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps>): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & {
300
- theme?: ThemeContextProps;
301
- }, {}, {
302
- ref?: React.Ref<InstanceType<C>>;
303
- }>;
304
- <C extends React.ComponentClass<React.ComponentProps<C>>>(component: C, options?: StyledOptions<React.ComponentProps<C>>): CreateStyledComponent<PropsOf<C> & {
305
- theme?: ThemeContextProps;
306
- }, {}, {
307
- ref?: React.Ref<InstanceType<C>>;
308
- }>;
309
- <C extends React.ComponentType<React.ComponentProps<C>>, ForwardedProps extends keyof React.ComponentProps<C> & string = keyof React.ComponentProps<C> & string>(component: C, options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps>): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & {
310
- theme?: ThemeContextProps;
311
- }>;
312
- <C extends React.ComponentType<React.ComponentProps<C>>>(component: C, options?: StyledOptions<React.ComponentProps<C>>): CreateStyledComponent<PropsOf<C> & {
313
- theme?: ThemeContextProps;
314
- }>;
315
- <Tag extends keyof JSX.IntrinsicElements, ForwardedProps extends keyof JSX.IntrinsicElements[Tag] & string = keyof JSX.IntrinsicElements[Tag] & string>(tag: Tag, options: FilteringStyledOptions<JSX.IntrinsicElements[Tag], ForwardedProps>): CreateStyledComponent<{
316
- theme?: ThemeContextProps;
317
- as?: React.ElementType;
318
- }, Pick<JSX.IntrinsicElements[Tag], ForwardedProps>>;
319
- <Tag extends keyof JSX.IntrinsicElements>(tag: Tag, options?: StyledOptions<JSX.IntrinsicElements[Tag]>): CreateStyledComponent<{
320
- theme?: ThemeContextProps;
321
- as?: React.ElementType;
322
- }, JSX.IntrinsicElements[Tag]>;
323
- }
324
- interface CreateStyled extends BaseCreateStyled, StyledTags {
325
- }
326
585
  declare const styled: CreateStyled;
327
586
 
328
- export { Accordion, AccordionProps, Button, ButtonProps, Dropdown, DropdownItem, DropdownProps, InputField, Modal, MultiSelect, MultiSelectProps, SingleSelect, SingleSelectProps, Slider, SliderProps, ThemeColors, ThemeColorsObject, ThemeContextProps, ThemeContextProvider, ThemeProperties, styled, transientOptions, useIsMobile, useThemeContext };
587
+ /**
588
+ *
589
+ * @param color the color to get the contrast color for
590
+ * @returns the most readable color between black and white
591
+ */
592
+ declare const getContrastColor: (color: string) => string;
593
+ /**
594
+ *
595
+ * @param color a color
596
+ * @param strength the strength (0-100) to darken the color
597
+ * @returns the color darkened by the strength
598
+ */
599
+ declare const darkenColor: (color: string, strength?: number) => string;
600
+ /**
601
+ *
602
+ * @param color a color
603
+ * @param strength the strength (0-100) to lighten the color
604
+ * @returns the color lightened by the strength
605
+ */
606
+ declare const lightenColor: (color: string, strength?: number) => string;
607
+ /**
608
+ * @param color a color
609
+ * @returns the hover color, based on if the color is dark or light
610
+ */
611
+ declare const getHoverColor: (color: string) => string;
612
+ /**
613
+ * @param color a color
614
+ * @returns the active color, based on if the color is dark or light
615
+ */
616
+ declare const getActiveColor: (color: string) => string;
617
+
618
+ export { Accordion, Button, Card, CardContent, CardFooter, CardHeader, CardIndicators, CardMediaSection, ControlledTreeView, Drawer, Dropdown, IBackgroundColors, ICommonColors, IIndicatorColors, IPalette, IStandardPaletteColor, ITagColors, IThemeContextProps, IThemeContextValue, Indicator, InputField, Modal, MultiSelect, MultiSelectProps, MultiViewList, SingleSelect, SingleSelectProps, Slider, TAccordionProps, TButtonProps, TButtonVariants, TCardSectionProps, TCellValues, TColorScale, TControlledTreeViewProps, TCustomRenderProps, TDrawerProps, TDropdownItem, TDropdownItemProps, TDropdownProps, TIndicatorInstanceProps, TIndicatorProps, TIndicatorVariants, TModalProps, TMultiViewListProps, TRenderTriggerProps, TSliderProps, TTableCell, TTableProps, TTableRow, TTagProps, TTextFieldProps, TThemeMode, TTreeViewItem, TUncontrolledTreeViewProps, TViewState, Table, Tag, ThemeContextProvider, UncontrolledTreeView, darkenColor, defaultDarkPalette, defaultLightPalette, getActiveColor, getContrastColor, getHoverColor, lightenColor, renderCell, styled, transientOptions, useIsMobile, useThemeContext };