@kwantis-id3/frontend-library 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +7 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ThemeContext/ThemeContext.d.ts +39 -32
- package/dist/cjs/types/components/accordion/Accordion.d.ts +10 -0
- package/dist/cjs/types/components/button/Button.d.ts +1 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ThemeContext/ThemeContext.d.ts +39 -32
- package/dist/esm/types/components/accordion/Accordion.d.ts +10 -0
- package/dist/esm/types/components/button/Button.d.ts +1 -2
- package/dist/index.d.ts +11 -18
- package/package.json +16 -2
|
@@ -1,43 +1,50 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tertiary: string;
|
|
6
|
-
statusOk: string;
|
|
7
|
-
statusWarning: string;
|
|
8
|
-
statusCritical: string;
|
|
9
|
-
statusNeutral: string;
|
|
2
|
+
export type Color = {
|
|
3
|
+
main: string;
|
|
4
|
+
contrastText: string;
|
|
10
5
|
};
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
export type ThemeColorsObject = {
|
|
7
|
+
primary: Color;
|
|
8
|
+
secondary: Color;
|
|
9
|
+
tertiary: Color;
|
|
10
|
+
statusOk: Color;
|
|
11
|
+
statusWarning: Color;
|
|
12
|
+
statusCritical: Color;
|
|
13
|
+
statusNeutral: Color;
|
|
18
14
|
};
|
|
19
15
|
interface ThemeContextProps {
|
|
20
16
|
colors: ThemeColorsObject;
|
|
21
|
-
textColors: ThemeTextColorsObject;
|
|
22
17
|
}
|
|
23
18
|
export type ThemeColors = keyof ThemeColorsObject;
|
|
24
|
-
export type ThemeTextColors = keyof ThemeTextColorsObject;
|
|
25
19
|
export declare const defaultThemeColors: {
|
|
26
|
-
primary:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
20
|
+
primary: {
|
|
21
|
+
main: string;
|
|
22
|
+
contrastText: string;
|
|
23
|
+
};
|
|
24
|
+
secondary: {
|
|
25
|
+
main: string;
|
|
26
|
+
contrastText: string;
|
|
27
|
+
};
|
|
28
|
+
tertiary: {
|
|
29
|
+
main: string;
|
|
30
|
+
contrastText: string;
|
|
31
|
+
};
|
|
32
|
+
statusOk: {
|
|
33
|
+
main: string;
|
|
34
|
+
contrastText: string;
|
|
35
|
+
};
|
|
36
|
+
statusWarning: {
|
|
37
|
+
main: string;
|
|
38
|
+
contrastText: string;
|
|
39
|
+
};
|
|
40
|
+
statusCritical: {
|
|
41
|
+
main: string;
|
|
42
|
+
contrastText: string;
|
|
43
|
+
};
|
|
44
|
+
statusNeutral: {
|
|
45
|
+
main: string;
|
|
46
|
+
contrastText: string;
|
|
47
|
+
};
|
|
41
48
|
};
|
|
42
49
|
export declare const ThemeContextProvider: (props: React.PropsWithChildren<{
|
|
43
50
|
theme?: ThemeContextProps;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface AccordionProps {
|
|
3
|
+
title: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
isOpen?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
onOpen?: () => void;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const Accordion: (props: AccordionProps) => JSX.Element;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { ThemeColors
|
|
2
|
+
import { ThemeColors } from "../ThemeContext/ThemeContext";
|
|
3
3
|
import { Interpolation } from "@emotion/styled";
|
|
4
4
|
import { Theme } from "@emotion/react";
|
|
5
5
|
export type ButtonVariants = "contained" | "outlined" | "text";
|
|
6
6
|
export interface ButtonProps {
|
|
7
7
|
label: string;
|
|
8
8
|
color?: ThemeColors;
|
|
9
|
-
textColor?: ThemeTextColors;
|
|
10
9
|
sx?: Interpolation<Theme>;
|
|
11
10
|
variant?: ButtonVariants;
|
|
12
11
|
onClick?: () => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,29 +3,23 @@ import React from 'react';
|
|
|
3
3
|
import { Interpolation } from '@emotion/styled';
|
|
4
4
|
import { Theme } from '@emotion/react';
|
|
5
5
|
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
tertiary: string;
|
|
10
|
-
statusOk: string;
|
|
11
|
-
statusWarning: string;
|
|
12
|
-
statusCritical: string;
|
|
13
|
-
statusNeutral: string;
|
|
6
|
+
type Color = {
|
|
7
|
+
main: string;
|
|
8
|
+
contrastText: string;
|
|
14
9
|
};
|
|
15
|
-
type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
type ThemeColorsObject = {
|
|
11
|
+
primary: Color;
|
|
12
|
+
secondary: Color;
|
|
13
|
+
tertiary: Color;
|
|
14
|
+
statusOk: Color;
|
|
15
|
+
statusWarning: Color;
|
|
16
|
+
statusCritical: Color;
|
|
17
|
+
statusNeutral: Color;
|
|
22
18
|
};
|
|
23
19
|
interface ThemeContextProps {
|
|
24
20
|
colors: ThemeColorsObject;
|
|
25
|
-
textColors: ThemeTextColorsObject;
|
|
26
21
|
}
|
|
27
22
|
type ThemeColors = keyof ThemeColorsObject;
|
|
28
|
-
type ThemeTextColors = keyof ThemeTextColorsObject;
|
|
29
23
|
declare const ThemeContextProvider: (props: React.PropsWithChildren<{
|
|
30
24
|
theme?: ThemeContextProps;
|
|
31
25
|
}>) => JSX.Element;
|
|
@@ -35,7 +29,6 @@ type ButtonVariants = "contained" | "outlined" | "text";
|
|
|
35
29
|
interface ButtonProps {
|
|
36
30
|
label: string;
|
|
37
31
|
color?: ThemeColors;
|
|
38
|
-
textColor?: ThemeTextColors;
|
|
39
32
|
sx?: Interpolation<Theme>;
|
|
40
33
|
variant?: ButtonVariants;
|
|
41
34
|
onClick?: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kwantis-id3/frontend-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Kwantis frontend components collection",
|
|
5
5
|
"author": "kwantis",
|
|
6
6
|
"license": "apache-2.0",
|
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
"@rollup/plugin-commonjs": "^24.0.1",
|
|
11
11
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
12
12
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
13
|
+
"@storybook/addon-essentials": "7.0.6",
|
|
14
|
+
"@storybook/addon-interactions": "7.0.6",
|
|
15
|
+
"@storybook/addon-links": "7.0.6",
|
|
16
|
+
"@storybook/blocks": "7.0.6",
|
|
17
|
+
"@storybook/react": "7.0.6",
|
|
18
|
+
"@storybook/react-webpack5": "7.0.6",
|
|
19
|
+
"@storybook/testing-library": "0.0.14-next.2",
|
|
13
20
|
"@testing-library/jest-dom": "^5.16.5",
|
|
14
21
|
"@testing-library/react": "^14.0.0",
|
|
15
22
|
"@types/jest": "^29.5.0",
|
|
@@ -23,8 +30,12 @@
|
|
|
23
30
|
"jest": "^29.5.0",
|
|
24
31
|
"jest-config": "^29.5.0",
|
|
25
32
|
"jest-environment-jsdom": "^29.5.0",
|
|
33
|
+
"prop-types": "15.8.1",
|
|
34
|
+
"react": "18.2.0",
|
|
35
|
+
"react-dom": "18.2.0",
|
|
26
36
|
"rollup": "^3.20.2",
|
|
27
37
|
"rollup-plugin-dts": "^5.3.0",
|
|
38
|
+
"storybook": "7.0.6",
|
|
28
39
|
"ts-jest": "^29.1.0",
|
|
29
40
|
"ts-node": "^10.9.1",
|
|
30
41
|
"tslib": "^2.5.0",
|
|
@@ -41,11 +52,14 @@
|
|
|
41
52
|
"types": "dist/index.d.ts",
|
|
42
53
|
"dependencies": {
|
|
43
54
|
"@rollup/plugin-terser": "^0.4.1",
|
|
55
|
+
"react-collapsible": "^2.10.0",
|
|
56
|
+
"react-icons-kit": "^2.0.0",
|
|
44
57
|
"rollup-plugin-peer-deps-external": "^2.2.4"
|
|
45
58
|
},
|
|
46
59
|
"scripts": {
|
|
47
60
|
"rollup": "rollup -c",
|
|
48
61
|
"test": "jest",
|
|
49
|
-
"storybook": "storybook dev -p 6006"
|
|
62
|
+
"storybook": "storybook dev -p 6006",
|
|
63
|
+
"build-storybook": "storybook build"
|
|
50
64
|
}
|
|
51
65
|
}
|