@kwantis-id3/frontend-library 0.27.2 → 1.0.0-rc.4
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/esm/index.js +226 -61
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Accordion/Accordion.d.ts +3 -4
- package/dist/esm/types/components/Accordion/AccordionStyled.d.ts +4 -4
- package/dist/esm/types/components/Button/Button.d.ts +1 -2
- package/dist/esm/types/components/Card/Card.d.ts +15 -0
- package/dist/esm/types/components/Card/CardInterfaces.d.ts +6 -0
- package/dist/esm/types/components/Card/CardStyled.d.ts +24 -0
- package/dist/esm/types/components/Card/index.d.ts +2 -0
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +6 -5
- package/dist/esm/types/components/Dropdown/DropdownStyled.d.ts +10 -11
- package/dist/esm/types/components/Indicator/ErrorIndicator.d.ts +3 -0
- package/dist/esm/types/components/Indicator/Indicator.d.ts +7 -0
- package/dist/esm/types/components/Indicator/IndicatorInterfaces.d.ts +11 -0
- package/dist/esm/types/components/Indicator/LiveIndicator.d.ts +3 -0
- package/dist/esm/types/components/Indicator/SuccessIndicator.d.ts +3 -0
- package/dist/esm/types/components/Indicator/WarningIndicator.d.ts +3 -0
- package/dist/esm/types/components/Indicator/index.d.ts +2 -0
- package/dist/esm/types/components/InputField/InputField.d.ts +1 -2
- package/dist/esm/types/components/InputField/StyledInputField.d.ts +2 -2
- package/dist/esm/types/components/Modal/StyledModal.d.ts +4 -2
- package/dist/esm/types/components/MultiViewList/MultiViewList.d.ts +3 -0
- package/dist/esm/types/components/MultiViewList/MultiViewListInterfaces.d.ts +6 -0
- package/dist/esm/types/components/MultiViewList/MultiViewListStyled.d.ts +4 -0
- package/dist/esm/types/components/MultiViewList/index.d.ts +2 -0
- package/dist/esm/types/components/SelectFilter/MultiSelect.d.ts +2 -4
- package/dist/esm/types/components/SelectFilter/SingleSelect.d.ts +2 -4
- package/dist/esm/types/components/Slider/Slider.d.ts +4 -6
- package/dist/esm/types/components/Slider/SliderStyled.d.ts +4 -4
- package/dist/esm/types/components/Table/DebouncedFilter.d.ts +7 -0
- package/dist/esm/types/components/Table/DebouncedInput.d.ts +6 -0
- package/dist/esm/types/components/Table/Table.d.ts +3 -0
- package/dist/esm/types/components/Table/TableInterfaces.d.ts +21 -0
- package/dist/esm/types/components/Table/TableStyled.d.ts +14 -0
- package/dist/esm/types/components/Table/index.d.ts +2 -0
- package/dist/esm/types/components/Tag/Tag.d.ts +24 -0
- package/dist/esm/types/components/Tag/index.d.ts +1 -0
- package/dist/esm/types/components/ThemeContext/ThemeContext.d.ts +5 -71
- package/dist/esm/types/components/ThemeContext/ThemeInterfaces.d.ts +109 -0
- package/dist/esm/types/components/ThemeContext/index.d.ts +2 -1
- package/dist/esm/types/components/index.d.ts +6 -1
- package/dist/esm/types/utils/colors.d.ts +20 -0
- package/dist/esm/types/utils/index.d.ts +3 -0
- package/dist/esm/types/utils/styled.d.ts +1 -38
- package/dist/esm/types/utils/testing.d.ts +54 -0
- package/dist/esm/types/utils/transientOptions.d.ts +7 -0
- package/dist/esm/types/utils/usePrefersColorScheme.d.ts +1 -0
- package/dist/index.d.ts +255 -85
- package/package.json +8 -6
- package/src/types/emotion.d.ts +8 -0
- package/src/types/tanstack.d.ts +7 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,42 +1,14 @@
|
|
|
1
1
|
import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
-
import { Interpolation, CreateStyled
|
|
5
|
-
import { Theme,
|
|
6
|
-
|
|
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;
|
|
3
|
+
import React__default, { FC, PropsWithChildren } from 'react';
|
|
4
|
+
import { Interpolation, CreateStyled } from '@emotion/styled';
|
|
5
|
+
import { Theme, Interpolation as Interpolation$1 } from '@emotion/react';
|
|
6
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
35
7
|
|
|
36
8
|
type ButtonVariants = "contained" | "outlined" | "text";
|
|
37
9
|
type ButtonProps = {
|
|
38
10
|
/** Color of the button */
|
|
39
|
-
color?:
|
|
11
|
+
color?: string;
|
|
40
12
|
/** Type of the button */
|
|
41
13
|
type?: "button" | "submit" | "reset";
|
|
42
14
|
/** Custom styles */
|
|
@@ -55,6 +27,120 @@ type ButtonProps = {
|
|
|
55
27
|
};
|
|
56
28
|
declare const Button: (props: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
57
29
|
|
|
30
|
+
type TColorScale = {
|
|
31
|
+
50: string;
|
|
32
|
+
100: string;
|
|
33
|
+
200: string;
|
|
34
|
+
300: string;
|
|
35
|
+
400: string;
|
|
36
|
+
500: string;
|
|
37
|
+
600: string;
|
|
38
|
+
700: string;
|
|
39
|
+
800: string;
|
|
40
|
+
900: string;
|
|
41
|
+
950: string;
|
|
42
|
+
};
|
|
43
|
+
interface ICommonColors {
|
|
44
|
+
red: TColorScale;
|
|
45
|
+
green: TColorScale;
|
|
46
|
+
blue: TColorScale;
|
|
47
|
+
yellow: TColorScale;
|
|
48
|
+
purple: TColorScale;
|
|
49
|
+
darkBlue: TColorScale;
|
|
50
|
+
orange: TColorScale;
|
|
51
|
+
gray: TColorScale;
|
|
52
|
+
}
|
|
53
|
+
interface IBackgroundColors {
|
|
54
|
+
main: string;
|
|
55
|
+
radialGradient: string;
|
|
56
|
+
}
|
|
57
|
+
interface ISharedColorProperties {
|
|
58
|
+
/** Represents the color itself */
|
|
59
|
+
main: string;
|
|
60
|
+
/** A slightly different color derived from the main one */
|
|
61
|
+
variant: string;
|
|
62
|
+
}
|
|
63
|
+
interface IStandardPaletteColor extends ISharedColorProperties {
|
|
64
|
+
/** The color to be used for text and elements that need to contrast with the main / variant */
|
|
65
|
+
contrast: string;
|
|
66
|
+
}
|
|
67
|
+
interface ITagColors {
|
|
68
|
+
default: {
|
|
69
|
+
main: string;
|
|
70
|
+
text: string;
|
|
71
|
+
};
|
|
72
|
+
warm: {
|
|
73
|
+
main: string;
|
|
74
|
+
text: string;
|
|
75
|
+
};
|
|
76
|
+
cold: {
|
|
77
|
+
main: string;
|
|
78
|
+
text: string;
|
|
79
|
+
};
|
|
80
|
+
paper: {
|
|
81
|
+
main: string;
|
|
82
|
+
text: string;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
interface IIndicatorColors {
|
|
86
|
+
main: string;
|
|
87
|
+
mainFill: string;
|
|
88
|
+
success: string;
|
|
89
|
+
successFill: string;
|
|
90
|
+
warning: string;
|
|
91
|
+
warningFill: string;
|
|
92
|
+
error: string;
|
|
93
|
+
errorFill: string;
|
|
94
|
+
}
|
|
95
|
+
interface IPalette {
|
|
96
|
+
/** Application background */
|
|
97
|
+
background: IBackgroundColors;
|
|
98
|
+
/** Primary Brand Color */
|
|
99
|
+
primary: IStandardPaletteColor;
|
|
100
|
+
/** Color config for actions solved with a success */
|
|
101
|
+
success: IStandardPaletteColor;
|
|
102
|
+
/** Color config for actions solved with a warning */
|
|
103
|
+
warning: IStandardPaletteColor;
|
|
104
|
+
/** Color config for actions solved with an error */
|
|
105
|
+
error: IStandardPaletteColor;
|
|
106
|
+
/** Color config for surfaces*/
|
|
107
|
+
surface: IStandardPaletteColor;
|
|
108
|
+
/** Color config for borders */
|
|
109
|
+
border: ISharedColorProperties;
|
|
110
|
+
/** Color config for tags */
|
|
111
|
+
tag: ITagColors;
|
|
112
|
+
/** Color config for indicators */
|
|
113
|
+
indicator: IIndicatorColors;
|
|
114
|
+
}
|
|
115
|
+
type TThemeMode = "light" | "dark" | "system";
|
|
116
|
+
interface IThemeContextProps {
|
|
117
|
+
/** From this prop you can override (even partially) the palettes (dark and light) of the library. */
|
|
118
|
+
palettes?: {
|
|
119
|
+
light?: Partial<IPalette>;
|
|
120
|
+
dark?: Partial<IPalette>;
|
|
121
|
+
};
|
|
122
|
+
defaultMode?: TThemeMode;
|
|
123
|
+
}
|
|
124
|
+
interface IThemeContextValue {
|
|
125
|
+
/** Which mode is currently active */
|
|
126
|
+
mode: TThemeMode;
|
|
127
|
+
/** Which mode is currently displayed.
|
|
128
|
+
* This is useful when the mode is set to "system" and the user has a dark mode preference.
|
|
129
|
+
*/
|
|
130
|
+
displayedMode: "light" | "dark";
|
|
131
|
+
/** A collection of common Colors with variants */
|
|
132
|
+
commonColors: ICommonColors;
|
|
133
|
+
/** This will contain the palette of the correct color mode. */
|
|
134
|
+
activePalette: IPalette;
|
|
135
|
+
/** use this function to change the mode */
|
|
136
|
+
setMode: (mode: TThemeMode) => void;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare const defaultLightPalette: IPalette;
|
|
140
|
+
declare const defaultDarkPalette: IPalette;
|
|
141
|
+
declare const ThemeContextProvider: ({ palettes, defaultMode, children, }: React__default.PropsWithChildren<IThemeContextProps>) => JSX.Element;
|
|
142
|
+
declare const useThemeContext: () => IThemeContextValue;
|
|
143
|
+
|
|
58
144
|
type AccordionProps = {
|
|
59
145
|
/** Text of the accordion trigger */
|
|
60
146
|
title: string;
|
|
@@ -65,11 +151,11 @@ type AccordionProps = {
|
|
|
65
151
|
/** Works only if uncontrolled (isOpen props is not present) */
|
|
66
152
|
defaultOpen?: boolean;
|
|
67
153
|
/** Color of the accordion */
|
|
68
|
-
color?:
|
|
154
|
+
color?: string;
|
|
69
155
|
/** Color of the icon */
|
|
70
|
-
iconColor?:
|
|
156
|
+
iconColor?: string;
|
|
71
157
|
/** Color of the divider */
|
|
72
|
-
dividerColor?:
|
|
158
|
+
dividerColor?: string;
|
|
73
159
|
/** Hide the icon */
|
|
74
160
|
hideIcon?: boolean;
|
|
75
161
|
/** Hide the divider */
|
|
@@ -95,7 +181,7 @@ interface TextFieldProps extends React__default.InputHTMLAttributes<HTMLInputEle
|
|
|
95
181
|
/** Disables the input */
|
|
96
182
|
isDisabled?: boolean;
|
|
97
183
|
/** The color of the input */
|
|
98
|
-
color?:
|
|
184
|
+
color?: string;
|
|
99
185
|
/** Change the styles of the input field */
|
|
100
186
|
sx?: React__default.CSSProperties;
|
|
101
187
|
}
|
|
@@ -130,7 +216,7 @@ interface SingleSelectProps<Option = {
|
|
|
130
216
|
/** Wether the select is loading */
|
|
131
217
|
isLoading?: boolean;
|
|
132
218
|
/** The color of the select */
|
|
133
|
-
color?:
|
|
219
|
+
color?: string;
|
|
134
220
|
/** The HTML id of the container */
|
|
135
221
|
containerId?: string;
|
|
136
222
|
/** The HTML id of the select */
|
|
@@ -144,7 +230,7 @@ interface SingleSelectProps<Option = {
|
|
|
144
230
|
/** Wether the select is required */
|
|
145
231
|
required?: boolean;
|
|
146
232
|
}
|
|
147
|
-
declare const SingleSelect: <Option>(props: SingleSelectProps<Option>) =>
|
|
233
|
+
declare const SingleSelect: <Option>(props: SingleSelectProps<Option>) => _emotion_react_jsx_runtime.JSX.Element;
|
|
148
234
|
|
|
149
235
|
interface MultiSelectProps<Option = {
|
|
150
236
|
label: string;
|
|
@@ -175,7 +261,7 @@ interface MultiSelectProps<Option = {
|
|
|
175
261
|
/** Wether the select is loading */
|
|
176
262
|
isLoading?: boolean;
|
|
177
263
|
/** The color of the select */
|
|
178
|
-
color?:
|
|
264
|
+
color?: string;
|
|
179
265
|
/** The HTML id of the container */
|
|
180
266
|
containerId?: string;
|
|
181
267
|
/** The HTML id of the select */
|
|
@@ -187,7 +273,7 @@ interface MultiSelectProps<Option = {
|
|
|
187
273
|
/** Wether the select is required */
|
|
188
274
|
required?: boolean;
|
|
189
275
|
}
|
|
190
|
-
declare const MultiSelect: <Option>(props: MultiSelectProps<Option>) =>
|
|
276
|
+
declare const MultiSelect: <Option>(props: MultiSelectProps<Option>) => _emotion_react_jsx_runtime.JSX.Element;
|
|
191
277
|
|
|
192
278
|
type SliderProps = {
|
|
193
279
|
/** The values of the slider. */
|
|
@@ -201,11 +287,11 @@ type SliderProps = {
|
|
|
201
287
|
/** The onFinalChange handler of the slider. (called only when the thumb is released) */
|
|
202
288
|
onFinalChange?: (values: number[]) => void;
|
|
203
289
|
/** The color of the slider */
|
|
204
|
-
color?:
|
|
290
|
+
color?: string;
|
|
205
291
|
/** The color of the section not included in the range */
|
|
206
|
-
unselectedColor?:
|
|
292
|
+
unselectedColor?: string;
|
|
207
293
|
/** The color of the thumb */
|
|
208
|
-
thumbColor?:
|
|
294
|
+
thumbColor?: string;
|
|
209
295
|
/** The HTML id of the slider */
|
|
210
296
|
htmlId?: string;
|
|
211
297
|
/** The class name of the slider */
|
|
@@ -221,11 +307,11 @@ type SliderProps = {
|
|
|
221
307
|
/** Wether the thumbs can overlap */
|
|
222
308
|
allowOverlap?: boolean;
|
|
223
309
|
};
|
|
224
|
-
declare const Slider: (props: SliderProps) =>
|
|
310
|
+
declare const Slider: (props: SliderProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
225
311
|
|
|
226
312
|
/**
|
|
227
313
|
* @property {string} value - The value displayed in the dropdown item
|
|
228
|
-
* @property {
|
|
314
|
+
* @property {string} color - The color of the dropdown item
|
|
229
315
|
* @property {string} textColor - The text color of the dropdown item
|
|
230
316
|
* @property {DropdownItem[]} children - The children of the dropdown item
|
|
231
317
|
* @property {() => void} onClick - The onClick handler of the dropdown item
|
|
@@ -234,9 +320,11 @@ type DropdownItem = {
|
|
|
234
320
|
/** The value displayed in the item */
|
|
235
321
|
value: string;
|
|
236
322
|
/** The color of the item */
|
|
237
|
-
|
|
323
|
+
bgColor?: string;
|
|
238
324
|
/** The text color of the item */
|
|
239
325
|
textColor?: string;
|
|
326
|
+
/** The hover color of the item */
|
|
327
|
+
hoverColor?: string;
|
|
240
328
|
/** The children of the item */
|
|
241
329
|
children?: DropdownItem[];
|
|
242
330
|
/** Wether the item is hidden or not */
|
|
@@ -252,9 +340,9 @@ type DropdownProps = {
|
|
|
252
340
|
/** The trigger element of the dropdown. Clicking on this item will open the dropdown */
|
|
253
341
|
trigger: React__default.ReactNode;
|
|
254
342
|
/** The color of the dropdown */
|
|
255
|
-
|
|
343
|
+
bgColor?: string;
|
|
256
344
|
/** The hover color of the dropdown */
|
|
257
|
-
hoverColor?:
|
|
345
|
+
hoverColor?: string;
|
|
258
346
|
/** Controls wether the dropdown should extend towards the left or the right */
|
|
259
347
|
direction?: "left" | "right";
|
|
260
348
|
/** The mobile breakpoint, by default it's 768px */
|
|
@@ -280,6 +368,94 @@ interface ModalProps {
|
|
|
280
368
|
}
|
|
281
369
|
declare const Modal: React__default.FC<ModalProps>;
|
|
282
370
|
|
|
371
|
+
type TIndicatorInstanceProps = {
|
|
372
|
+
outerColor?: string;
|
|
373
|
+
innerColor?: string;
|
|
374
|
+
size?: number;
|
|
375
|
+
title?: string;
|
|
376
|
+
onClick?: (e: React.MouseEvent<SVGSVGElement>) => void;
|
|
377
|
+
};
|
|
378
|
+
type TIndicatorProps = {
|
|
379
|
+
variant: TIndicatorVariants;
|
|
380
|
+
} & TIndicatorInstanceProps;
|
|
381
|
+
type TIndicatorVariants = "live" | "success" | "warning" | "error";
|
|
382
|
+
|
|
383
|
+
type TGenericIndicatorProps = {
|
|
384
|
+
variant: TIndicatorVariants;
|
|
385
|
+
} & TIndicatorProps;
|
|
386
|
+
declare const Indicator: FC<TGenericIndicatorProps>;
|
|
387
|
+
|
|
388
|
+
type TTagProps = {
|
|
389
|
+
text: string;
|
|
390
|
+
/**
|
|
391
|
+
* If `variant` is set to `custom`, `bgColor` and `textColor` will be used.
|
|
392
|
+
* Otherwise, the `variant` will be used to determine the colors.
|
|
393
|
+
*
|
|
394
|
+
* The variants are the keys of the interface `@see ITagColors`, which by default are:
|
|
395
|
+
* - `default`
|
|
396
|
+
* - `warm`
|
|
397
|
+
* - `cold`
|
|
398
|
+
* - `paper`
|
|
399
|
+
*/
|
|
400
|
+
variant: keyof ITagColors | "custom";
|
|
401
|
+
/** To use this prop, the variant must be set to `custom` */
|
|
402
|
+
bgColor?: string;
|
|
403
|
+
/** To use this prop, the variant must be set to `custom` */
|
|
404
|
+
textColor?: string;
|
|
405
|
+
sx?: Interpolation<Theme>;
|
|
406
|
+
};
|
|
407
|
+
declare const Tag: FC<TTagProps>;
|
|
408
|
+
|
|
409
|
+
type TCardSectionProps = PropsWithChildren & {
|
|
410
|
+
sx?: Interpolation$1<Theme>;
|
|
411
|
+
onClick?: (e: React__default.MouseEvent<HTMLElement>) => void;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
/** @jsxImportSource @emotion/react */
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* The Card component is a container component that can be used to display content in a structured way.
|
|
418
|
+
* It has 3 possible sizes: small, medium and large.
|
|
419
|
+
*
|
|
420
|
+
*/
|
|
421
|
+
declare const Card: FC<TCardSectionProps>;
|
|
422
|
+
declare const CardHeader: FC<TCardSectionProps>;
|
|
423
|
+
declare const CardContent: FC<TCardSectionProps>;
|
|
424
|
+
declare const CardFooter: FC<TCardSectionProps>;
|
|
425
|
+
declare const CardIndicators: FC<TCardSectionProps>;
|
|
426
|
+
declare const CardMediaSection: FC<TCardSectionProps>;
|
|
427
|
+
|
|
428
|
+
type TCellValues = string | number | boolean | null;
|
|
429
|
+
type TTableProps<Cell extends TCellValues, Row extends TTableRow<Cell>> = {
|
|
430
|
+
columns: ColumnDef<Row, Cell>[];
|
|
431
|
+
data: Row[] | undefined;
|
|
432
|
+
};
|
|
433
|
+
type TTableCell<T extends TCellValues> = {
|
|
434
|
+
value: T;
|
|
435
|
+
bgColor?: string | null;
|
|
436
|
+
textColor?: string | null;
|
|
437
|
+
};
|
|
438
|
+
type TTableRow<T extends TCellValues> = {
|
|
439
|
+
info?: {
|
|
440
|
+
bgColor?: string | null;
|
|
441
|
+
textColor?: string | null;
|
|
442
|
+
[key: string]: string | number | boolean | null | undefined;
|
|
443
|
+
};
|
|
444
|
+
cells: {
|
|
445
|
+
[key: string]: TTableCell<T>;
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
declare const Table: <Cell extends TCellValues, Row extends TTableRow<Cell>>(props: TTableProps<Cell, Row>) => _emotion_react_jsx_runtime.JSX.Element;
|
|
450
|
+
declare const renderCell: (value: string | number | boolean | null) => _emotion_react_jsx_runtime.JSX.Element;
|
|
451
|
+
|
|
452
|
+
type TMultiViewListProps<Cell extends TCellValues, Row extends TTableRow<Cell>> = TTableProps<Cell, Row> & {
|
|
453
|
+
mode: "table" | "cards";
|
|
454
|
+
cardComponent: (item: Row) => React__default.ReactNode;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
declare const MultiViewList: <Cell extends TCellValues, Row extends TTableRow<Cell>>(props: TMultiViewListProps<Cell, Row>) => _emotion_react_jsx_runtime.JSX.Element;
|
|
458
|
+
|
|
283
459
|
/**
|
|
284
460
|
* Hook to check if the screen is mobile. The default breakpoint is 768px.
|
|
285
461
|
* @param {number=} mobileBreakpoint breakpoint width to check against
|
|
@@ -287,42 +463,36 @@ declare const Modal: React__default.FC<ModalProps>;
|
|
|
287
463
|
*/
|
|
288
464
|
declare const useIsMobile: (mobileBreakpoint?: number) => boolean;
|
|
289
465
|
|
|
290
|
-
|
|
466
|
+
/**
|
|
467
|
+
* emotion.js doesn't support transient options out of the box.
|
|
468
|
+
*
|
|
469
|
+
* 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.
|
|
470
|
+
* This specific opt-in utility copies the styled-component approach; if used, props starting with `$` will not be passed to the DOM.
|
|
471
|
+
* @see https://github.com/emotion-js/emotion/issues/2193#issuecomment-766173118
|
|
472
|
+
*/
|
|
473
|
+
declare const transientOptions: Parameters<CreateStyled>[1];
|
|
291
474
|
|
|
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
475
|
declare const styled: CreateStyled;
|
|
327
476
|
|
|
328
|
-
|
|
477
|
+
/**
|
|
478
|
+
*
|
|
479
|
+
* @param color the color to get the contrast color for
|
|
480
|
+
* @returns the most readable color between black and white
|
|
481
|
+
*/
|
|
482
|
+
declare const getContrastColor: (color: string) => string;
|
|
483
|
+
/**
|
|
484
|
+
*
|
|
485
|
+
* @param color the color to darken
|
|
486
|
+
* @param strength the strength (0-100) to darken the color
|
|
487
|
+
* @returns the color darkened by the strength
|
|
488
|
+
*/
|
|
489
|
+
declare const darkenColor: (color: string, strength?: number) => string;
|
|
490
|
+
/**
|
|
491
|
+
*
|
|
492
|
+
* @param color the color to lighten
|
|
493
|
+
* @param strength the strength (0-100) to lighten the color
|
|
494
|
+
* @returns the color lightened by the strength
|
|
495
|
+
*/
|
|
496
|
+
declare const lightenColor: (color: string, strength?: number) => string;
|
|
497
|
+
|
|
498
|
+
export { Accordion, AccordionProps, Button, ButtonProps, Card, CardContent, CardFooter, CardHeader, CardIndicators, CardMediaSection, Dropdown, DropdownItem, DropdownProps, IBackgroundColors, ICommonColors, IIndicatorColors, IPalette, IStandardPaletteColor, ITagColors, IThemeContextProps, IThemeContextValue, Indicator, InputField, Modal, MultiSelect, MultiSelectProps, MultiViewList, SingleSelect, SingleSelectProps, Slider, SliderProps, TCardSectionProps, TCellValues, TColorScale, TIndicatorProps, TIndicatorVariants, TMultiViewListProps, TTableCell, TTableProps, TTableRow, TTagProps, TThemeMode, Table, Tag, ThemeContextProvider, darkenColor, defaultDarkPalette, defaultLightPalette, getContrastColor, lightenColor, renderCell, styled, transientOptions, useIsMobile, useThemeContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kwantis-id3/frontend-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"description": "Kwantis frontend components collection",
|
|
5
5
|
"scriptsComments": {
|
|
6
6
|
"storybook": "Starts storybook in development mode",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"@storybook/react-webpack5": "7.4.6",
|
|
55
55
|
"@storybook/testing-library": "0.2.2",
|
|
56
56
|
"@testing-library/jest-dom": "^5.16.5",
|
|
57
|
-
"@testing-library/react": "^
|
|
58
|
-
"@testing-library/user-event": "^14.
|
|
57
|
+
"@testing-library/react": "^16.2.0",
|
|
58
|
+
"@testing-library/user-event": "^14.6.1",
|
|
59
59
|
"@types/react": "^18.0.33",
|
|
60
60
|
"@types/testing-library__jest-dom": "^5.14.5",
|
|
61
61
|
"@types/tinycolor2": "^1.4.3",
|
|
62
62
|
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
63
63
|
"@typescript-eslint/parser": "^5.58.0",
|
|
64
|
-
"@vitest/coverage-v8": "^
|
|
64
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
65
65
|
"chromatic": "^11.0.4",
|
|
66
66
|
"eslint": "^8.38.0",
|
|
67
67
|
"eslint-config-prettier": "^8.8.0",
|
|
@@ -79,15 +79,17 @@
|
|
|
79
79
|
"ts-node": "^10.9.1",
|
|
80
80
|
"tslib": "^2.5.0",
|
|
81
81
|
"typescript": "^5.0.3",
|
|
82
|
-
"vitest": "^
|
|
82
|
+
"vitest": "^3.0.5"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
|
+
"@tanstack/react-table": "^8.0.0",
|
|
85
86
|
"react": ">= 17.0.2"
|
|
86
87
|
},
|
|
87
88
|
"main": "dist/cjs/index.js",
|
|
88
89
|
"module": "dist/esm/index.js",
|
|
89
90
|
"files": [
|
|
90
|
-
"dist"
|
|
91
|
+
"dist",
|
|
92
|
+
"src/types"
|
|
91
93
|
],
|
|
92
94
|
"types": "dist/index.d.ts",
|
|
93
95
|
"dependencies": {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "@emotion/styled";
|
|
2
|
+
import { IThemeContextValue } from "../components/ThemeContext/ThemeInterfaces";
|
|
3
|
+
|
|
4
|
+
// override the default theme
|
|
5
|
+
declare module "@emotion/react" {
|
|
6
|
+
// eslint-disable-next-line
|
|
7
|
+
export interface Theme extends IThemeContextValue {}
|
|
8
|
+
}
|