@kwantis-id3/frontend-library 0.5.0 → 0.6.1
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/README.md +22 -0
- package/dist/cjs/index.js +31 -11
- 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 +20 -0
- package/dist/cjs/types/components/accordion/AccordionStyled.d.ts +24 -0
- package/dist/cjs/types/components/accordion/index.d.ts +1 -0
- package/dist/cjs/types/components/button/Button.d.ts +1 -2
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/esm/index.js +31 -11
- 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 +20 -0
- package/dist/esm/types/components/accordion/AccordionStyled.d.ts +24 -0
- package/dist/esm/types/components/accordion/index.d.ts +1 -0
- package/dist/esm/types/components/button/Button.d.ts +1 -2
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/index.d.ts +28 -19
- 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,20 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { Interpolation } from "@emotion/styled";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { ThemeColors } from "../ThemeContext";
|
|
5
|
+
import { Theme } from "@emotion/react";
|
|
6
|
+
export interface AccordionProps {
|
|
7
|
+
title: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
color?: ThemeColors;
|
|
10
|
+
iconColor?: ThemeColors;
|
|
11
|
+
dividerColor?: ThemeColors;
|
|
12
|
+
variant?: "contained" | "outlined" | "text";
|
|
13
|
+
isOpen?: boolean;
|
|
14
|
+
isLazy?: boolean;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
onOpen?: () => void;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
sx?: Interpolation<Theme>;
|
|
19
|
+
}
|
|
20
|
+
export declare const Accordion: (props: AccordionProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Divider: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
color: string;
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export declare const TitleDiv: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
as?: import("react").ElementType<any> | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
color: string;
|
|
13
|
+
textColor: string;
|
|
14
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
15
|
+
export declare const IconContainer: import("@emotion/styled").StyledComponent<{
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
as?: import("react").ElementType<any> | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
iconColor: string;
|
|
20
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
21
|
+
export declare const TitleH2: import("@emotion/styled").StyledComponent<{
|
|
22
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
23
|
+
as?: import("react").ElementType<any> | undefined;
|
|
24
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Accordion, AccordionProps } from "./Accordion";
|
|
@@ -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;
|
|
@@ -45,4 +38,20 @@ interface ButtonProps {
|
|
|
45
38
|
}
|
|
46
39
|
declare const Button: (props: ButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
interface AccordionProps {
|
|
42
|
+
title: string;
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
color?: ThemeColors;
|
|
45
|
+
iconColor?: ThemeColors;
|
|
46
|
+
dividerColor?: ThemeColors;
|
|
47
|
+
variant?: "contained" | "outlined" | "text";
|
|
48
|
+
isOpen?: boolean;
|
|
49
|
+
isLazy?: boolean;
|
|
50
|
+
onClick?: () => void;
|
|
51
|
+
onOpen?: () => void;
|
|
52
|
+
onClose?: () => void;
|
|
53
|
+
sx?: Interpolation<Theme>;
|
|
54
|
+
}
|
|
55
|
+
declare const Accordion: (props: AccordionProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
56
|
+
|
|
57
|
+
export { Accordion, AccordionProps, Button, ButtonProps, ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kwantis-id3/frontend-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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
|
}
|