@kwantis-id3/frontend-library 0.4.0 → 0.4.2
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 +1 -1
- package/dist/cjs/index.js +16 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ThemeContext/ThemeContext.d.ts +28 -10
- package/dist/cjs/types/components/ThemeContext/index.d.ts +1 -1
- package/dist/cjs/types/components/button/Button.d.ts +9 -3
- package/dist/cjs/types/components/index.d.ts +1 -1
- package/dist/esm/index.js +18 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ThemeContext/ThemeContext.d.ts +28 -10
- package/dist/esm/types/components/ThemeContext/index.d.ts +1 -1
- package/dist/esm/types/components/button/Button.d.ts +9 -3
- package/dist/esm/types/components/index.d.ts +1 -1
- package/dist/index.d.ts +19 -13
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type
|
|
2
|
+
export type ThemeColorsObject = {
|
|
3
3
|
primary: string;
|
|
4
4
|
secondary: string;
|
|
5
5
|
tertiary: string;
|
|
@@ -8,7 +8,7 @@ export type KwantisColorsObject = {
|
|
|
8
8
|
statusCritical: string;
|
|
9
9
|
statusNeutral: string;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type ThemeTextColorsObject = {
|
|
12
12
|
primary: string;
|
|
13
13
|
secondary: string;
|
|
14
14
|
tertiary: string;
|
|
@@ -17,14 +17,32 @@ export type KwantisTextColorsObject = {
|
|
|
17
17
|
statusCritical: string;
|
|
18
18
|
statusNeutral: string;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
colors: KwantisColorsObject;
|
|
24
|
-
textColors: KwantisTextColorsObject;
|
|
20
|
+
interface ThemeContextProps {
|
|
21
|
+
colors: ThemeColorsObject;
|
|
22
|
+
textColors: ThemeTextColorsObject;
|
|
25
23
|
}
|
|
26
|
-
export
|
|
27
|
-
|
|
24
|
+
export type ThemeColors = keyof ThemeColorsObject;
|
|
25
|
+
export type ThemeTextColors = keyof ThemeTextColorsObject;
|
|
26
|
+
export declare const defaultThemeColors: {
|
|
27
|
+
primary: string;
|
|
28
|
+
secondary: string;
|
|
29
|
+
tertiary: string;
|
|
30
|
+
statusOk: string;
|
|
31
|
+
statusWarning: string;
|
|
32
|
+
statusCritical: string;
|
|
33
|
+
statusNeutral: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const defaultThemeTextColors: {
|
|
36
|
+
primary: string;
|
|
37
|
+
secondary: string;
|
|
38
|
+
tertiary: string;
|
|
39
|
+
statusOk: string;
|
|
40
|
+
statusWarning: string;
|
|
41
|
+
statusCritical: string;
|
|
42
|
+
statusNeutral: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const ThemeContextProvider: (props: React.PropsWithChildren<{
|
|
45
|
+
theme?: ThemeContextProps;
|
|
28
46
|
}>) => JSX.Element;
|
|
29
|
-
export declare const
|
|
47
|
+
export declare const useThemeContext: () => ThemeContextProps;
|
|
30
48
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext, } from "./ThemeContext";
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeColors, ThemeTextColors } from "../ThemeContext/ThemeContext";
|
|
3
3
|
import { Interpolation } from "@emotion/styled";
|
|
4
4
|
import { Theme } from "@emotion/react";
|
|
5
|
+
export type ButtonVariants = "contained" | "outlined" | "text";
|
|
5
6
|
export interface ButtonProps {
|
|
6
7
|
label: string;
|
|
7
|
-
color?:
|
|
8
|
-
textColor?:
|
|
8
|
+
color?: ThemeColors;
|
|
9
|
+
textColor?: ThemeTextColors;
|
|
9
10
|
sx?: Interpolation<Theme>;
|
|
11
|
+
variant?: ButtonVariants;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
htmlClassName?: string;
|
|
14
|
+
htmlId?: string;
|
|
15
|
+
disabled?: boolean;
|
|
10
16
|
}
|
|
11
17
|
export declare const Button: (props: ButtonProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Button, ButtonProps } from "./button";
|
|
2
|
-
export {
|
|
2
|
+
export { ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext, } from "./ThemeContext";
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { Interpolation } from '@emotion/styled';
|
|
4
4
|
import { Theme } from '@emotion/react';
|
|
5
5
|
|
|
6
|
-
type
|
|
6
|
+
type ThemeColorsObject = {
|
|
7
7
|
primary: string;
|
|
8
8
|
secondary: string;
|
|
9
9
|
tertiary: string;
|
|
@@ -12,7 +12,7 @@ type KwantisColorsObject = {
|
|
|
12
12
|
statusCritical: string;
|
|
13
13
|
statusNeutral: string;
|
|
14
14
|
};
|
|
15
|
-
type
|
|
15
|
+
type ThemeTextColorsObject = {
|
|
16
16
|
primary: string;
|
|
17
17
|
secondary: string;
|
|
18
18
|
tertiary: string;
|
|
@@ -21,23 +21,29 @@ type KwantisTextColorsObject = {
|
|
|
21
21
|
statusCritical: string;
|
|
22
22
|
statusNeutral: string;
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
colors: KwantisColorsObject;
|
|
28
|
-
textColors: KwantisTextColorsObject;
|
|
24
|
+
interface ThemeContextProps {
|
|
25
|
+
colors: ThemeColorsObject;
|
|
26
|
+
textColors: ThemeTextColorsObject;
|
|
29
27
|
}
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
type ThemeColors = keyof ThemeColorsObject;
|
|
29
|
+
type ThemeTextColors = keyof ThemeTextColorsObject;
|
|
30
|
+
declare const ThemeContextProvider: (props: React.PropsWithChildren<{
|
|
31
|
+
theme?: ThemeContextProps;
|
|
32
32
|
}>) => JSX.Element;
|
|
33
|
-
declare const
|
|
33
|
+
declare const useThemeContext: () => ThemeContextProps;
|
|
34
34
|
|
|
35
|
+
type ButtonVariants = "contained" | "outlined" | "text";
|
|
35
36
|
interface ButtonProps {
|
|
36
37
|
label: string;
|
|
37
|
-
color?:
|
|
38
|
-
textColor?:
|
|
38
|
+
color?: ThemeColors;
|
|
39
|
+
textColor?: ThemeTextColors;
|
|
39
40
|
sx?: Interpolation<Theme>;
|
|
41
|
+
variant?: ButtonVariants;
|
|
42
|
+
onClick?: () => void;
|
|
43
|
+
htmlClassName?: string;
|
|
44
|
+
htmlId?: string;
|
|
45
|
+
disabled?: boolean;
|
|
40
46
|
}
|
|
41
47
|
declare const Button: (props: ButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
42
48
|
|
|
43
|
-
export { Button, ButtonProps,
|
|
49
|
+
export { Button, ButtonProps, ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext };
|