@kwantis-id3/frontend-library 0.3.0 → 0.4.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 +12 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ThemeContext/ThemeContext.d.ts +18 -6
- package/dist/cjs/types/components/button/Button.d.ts +7 -3
- package/dist/esm/index.js +12 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ThemeContext/ThemeContext.d.ts +18 -6
- package/dist/esm/types/components/button/Button.d.ts +7 -3
- package/dist/index.d.ts +23 -8
- package/package.json +12 -2
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type KwantisColors = "primary" | "secondary" | "tertiary" | "textPrimary" | "textSecondary" | "textTertiary" | "statusOk" | "statusWarning" | "statusCritical" | "statusNeutral";
|
|
3
2
|
export type KwantisColorsObject = {
|
|
4
3
|
primary: string;
|
|
5
4
|
secondary: string;
|
|
6
5
|
tertiary: string;
|
|
7
|
-
textPrimary: string;
|
|
8
|
-
textSecondary: string;
|
|
9
|
-
textTertiary: string;
|
|
10
6
|
statusOk: string;
|
|
11
7
|
statusWarning: string;
|
|
12
8
|
statusCritical: string;
|
|
13
9
|
statusNeutral: string;
|
|
14
10
|
};
|
|
11
|
+
export type KwantisTextColorsObject = {
|
|
12
|
+
primary: string;
|
|
13
|
+
secondary: string;
|
|
14
|
+
tertiary: string;
|
|
15
|
+
statusOk: string;
|
|
16
|
+
statusWarning: string;
|
|
17
|
+
statusCritical: string;
|
|
18
|
+
statusNeutral: string;
|
|
19
|
+
};
|
|
20
|
+
export type KwantisColors = keyof KwantisColorsObject;
|
|
21
|
+
export type KwantisTextColors = keyof KwantisTextColorsObject;
|
|
22
|
+
interface KwantisThemeContextProps {
|
|
23
|
+
colors: KwantisColorsObject;
|
|
24
|
+
textColors: KwantisTextColorsObject;
|
|
25
|
+
}
|
|
15
26
|
export declare const KwantisThemeContextProvider: (props: React.PropsWithChildren<{
|
|
16
|
-
theme?:
|
|
27
|
+
theme?: KwantisThemeContextProps;
|
|
17
28
|
}>) => JSX.Element;
|
|
18
|
-
export declare const useKwantisThemeContext: () =>
|
|
29
|
+
export declare const useKwantisThemeContext: () => KwantisThemeContextProps;
|
|
30
|
+
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { KwantisColors } from "../ThemeContext/ThemeContext";
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { KwantisColors, KwantisTextColors } from "../ThemeContext/ThemeContext";
|
|
3
|
+
import { Interpolation } from "@emotion/styled";
|
|
4
|
+
import { Theme } from "@emotion/react";
|
|
3
5
|
export interface ButtonProps {
|
|
4
6
|
label: string;
|
|
5
7
|
color?: KwantisColors;
|
|
8
|
+
textColor?: KwantisTextColors;
|
|
9
|
+
sx?: Interpolation<Theme>;
|
|
6
10
|
}
|
|
7
|
-
export declare const Button: (props: ButtonProps) =>
|
|
11
|
+
export declare const Button: (props: ButtonProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { Interpolation } from '@emotion/styled';
|
|
4
|
+
import { Theme } from '@emotion/react';
|
|
3
5
|
|
|
4
|
-
type KwantisColors = "primary" | "secondary" | "tertiary" | "textPrimary" | "textSecondary" | "textTertiary" | "statusOk" | "statusWarning" | "statusCritical" | "statusNeutral";
|
|
5
6
|
type KwantisColorsObject = {
|
|
6
7
|
primary: string;
|
|
7
8
|
secondary: string;
|
|
8
9
|
tertiary: string;
|
|
9
|
-
textPrimary: string;
|
|
10
|
-
textSecondary: string;
|
|
11
|
-
textTertiary: string;
|
|
12
10
|
statusOk: string;
|
|
13
11
|
statusWarning: string;
|
|
14
12
|
statusCritical: string;
|
|
15
13
|
statusNeutral: string;
|
|
16
14
|
};
|
|
15
|
+
type KwantisTextColorsObject = {
|
|
16
|
+
primary: string;
|
|
17
|
+
secondary: string;
|
|
18
|
+
tertiary: string;
|
|
19
|
+
statusOk: string;
|
|
20
|
+
statusWarning: string;
|
|
21
|
+
statusCritical: string;
|
|
22
|
+
statusNeutral: string;
|
|
23
|
+
};
|
|
24
|
+
type KwantisColors = keyof KwantisColorsObject;
|
|
25
|
+
type KwantisTextColors = keyof KwantisTextColorsObject;
|
|
26
|
+
interface KwantisThemeContextProps {
|
|
27
|
+
colors: KwantisColorsObject;
|
|
28
|
+
textColors: KwantisTextColorsObject;
|
|
29
|
+
}
|
|
17
30
|
declare const KwantisThemeContextProvider: (props: React.PropsWithChildren<{
|
|
18
|
-
theme?:
|
|
31
|
+
theme?: KwantisThemeContextProps;
|
|
19
32
|
}>) => JSX.Element;
|
|
20
|
-
declare const useKwantisThemeContext: () =>
|
|
33
|
+
declare const useKwantisThemeContext: () => KwantisThemeContextProps;
|
|
21
34
|
|
|
22
35
|
interface ButtonProps {
|
|
23
36
|
label: string;
|
|
24
37
|
color?: KwantisColors;
|
|
38
|
+
textColor?: KwantisTextColors;
|
|
39
|
+
sx?: Interpolation<Theme>;
|
|
25
40
|
}
|
|
26
|
-
declare const Button: (props: ButtonProps) =>
|
|
41
|
+
declare const Button: (props: ButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
27
42
|
|
|
28
43
|
export { Button, ButtonProps, KwantisColors, KwantisColorsObject, KwantisThemeContextProvider, useKwantisThemeContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kwantis-id3/frontend-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Kwantis frontend components collection",
|
|
5
5
|
"author": "kwantis",
|
|
6
6
|
"license": "apache-2.0",
|
|
@@ -10,14 +10,23 @@
|
|
|
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
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
14
|
+
"@testing-library/react": "^14.0.0",
|
|
15
|
+
"@types/jest": "^29.5.0",
|
|
13
16
|
"@types/react": "^18.0.33",
|
|
17
|
+
"@types/testing-library__jest-dom": "^5.14.5",
|
|
14
18
|
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
15
19
|
"@typescript-eslint/parser": "^5.58.0",
|
|
16
20
|
"eslint": "^8.38.0",
|
|
17
21
|
"eslint-plugin-react": "^7.32.2",
|
|
18
22
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
23
|
+
"jest": "^29.5.0",
|
|
24
|
+
"jest-config": "^29.5.0",
|
|
25
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
19
26
|
"rollup": "^3.20.2",
|
|
20
27
|
"rollup-plugin-dts": "^5.3.0",
|
|
28
|
+
"ts-jest": "^29.1.0",
|
|
29
|
+
"ts-node": "^10.9.1",
|
|
21
30
|
"tslib": "^2.5.0",
|
|
22
31
|
"typescript": "^5.0.3"
|
|
23
32
|
},
|
|
@@ -35,6 +44,7 @@
|
|
|
35
44
|
"rollup-plugin-peer-deps-external": "^2.2.4"
|
|
36
45
|
},
|
|
37
46
|
"scripts": {
|
|
38
|
-
"rollup": "rollup -c"
|
|
47
|
+
"rollup": "rollup -c",
|
|
48
|
+
"test": "jest"
|
|
39
49
|
}
|
|
40
50
|
}
|