@kwantis-id3/frontend-library 0.27.2 → 1.0.0-rc.3
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 +109 -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/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/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 +4 -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 +5 -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 +223 -85
- package/package.json +4 -4
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { Interpolation } from "@emotion/styled";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Theme } from "@emotion/react";
|
|
5
|
-
import { ThemeColorsExtended } from "../ThemeContext/ThemeContext";
|
|
6
5
|
export type AccordionProps = {
|
|
7
6
|
/** Text of the accordion trigger */
|
|
8
7
|
title: string;
|
|
@@ -13,11 +12,11 @@ export type AccordionProps = {
|
|
|
13
12
|
/** Works only if uncontrolled (isOpen props is not present) */
|
|
14
13
|
defaultOpen?: boolean;
|
|
15
14
|
/** Color of the accordion */
|
|
16
|
-
color?:
|
|
15
|
+
color?: string;
|
|
17
16
|
/** Color of the icon */
|
|
18
|
-
iconColor?:
|
|
17
|
+
iconColor?: string;
|
|
19
18
|
/** Color of the divider */
|
|
20
|
-
dividerColor?:
|
|
19
|
+
dividerColor?: string;
|
|
21
20
|
/** Hide the icon */
|
|
22
21
|
hideIcon?: boolean;
|
|
23
22
|
/** Hide the divider */
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export declare const Divider: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
4
|
} & {
|
|
5
5
|
$color: string;
|
|
6
6
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
7
|
export declare const TitleDiv: import("@emotion/styled").StyledComponent<{
|
|
8
|
-
theme?: import("
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
9
|
as?: React.ElementType;
|
|
10
10
|
} & {
|
|
11
11
|
$color: string;
|
|
12
12
|
$textColor: string;
|
|
13
13
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
14
|
export declare const IconContainer: import("@emotion/styled").StyledComponent<{
|
|
15
|
-
theme?: import("
|
|
15
|
+
theme?: import("@emotion/react").Theme;
|
|
16
16
|
as?: React.ElementType;
|
|
17
17
|
} & {
|
|
18
18
|
$iconColor: string;
|
|
19
19
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
20
20
|
export declare const TitleH2: import("@emotion/styled").StyledComponent<{
|
|
21
|
-
theme?: import("
|
|
21
|
+
theme?: import("@emotion/react").Theme;
|
|
22
22
|
as?: React.ElementType;
|
|
23
23
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { ThemeColorsExtended } from "../ThemeContext/ThemeContext";
|
|
4
3
|
import { Interpolation } from "@emotion/styled";
|
|
5
4
|
import { Theme } from "@emotion/react";
|
|
6
5
|
export type ButtonVariants = "contained" | "outlined" | "text";
|
|
7
6
|
export type ButtonProps = {
|
|
8
7
|
/** Color of the button */
|
|
9
|
-
color?:
|
|
8
|
+
color?: string;
|
|
10
9
|
/** Type of the button */
|
|
11
10
|
type?: "button" | "submit" | "reset";
|
|
12
11
|
/** Custom styles */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
import { TCardSectionProps } from "./CardInterfaces";
|
|
4
|
+
/**
|
|
5
|
+
* The Card component is a container component that can be used to display content in a structured way.
|
|
6
|
+
* It has 3 possible sizes: small, medium and large.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
declare const Card: FC<TCardSectionProps>;
|
|
10
|
+
declare const CardHeader: FC<TCardSectionProps>;
|
|
11
|
+
declare const CardContent: FC<TCardSectionProps>;
|
|
12
|
+
declare const CardFooter: FC<TCardSectionProps>;
|
|
13
|
+
declare const CardIndicators: FC<TCardSectionProps>;
|
|
14
|
+
declare const CardMediaSection: FC<TCardSectionProps>;
|
|
15
|
+
export { Card, CardHeader, CardContent, CardFooter, CardIndicators, CardMediaSection, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const StyledCard: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
5
|
+
export declare const StyledHeader: import("@emotion/styled").StyledComponent<{
|
|
6
|
+
theme?: import("@emotion/react").Theme;
|
|
7
|
+
as?: React.ElementType;
|
|
8
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
9
|
+
export declare const StyledContent: import("@emotion/styled").StyledComponent<{
|
|
10
|
+
theme?: import("@emotion/react").Theme;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const StyledFooter: import("@emotion/styled").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme;
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
17
|
+
export declare const StyledMediaSection: import("@emotion/styled").StyledComponent<{
|
|
18
|
+
theme?: import("@emotion/react").Theme;
|
|
19
|
+
as?: React.ElementType;
|
|
20
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
21
|
+
export declare const StyledCardIndicators: import("@emotion/styled").StyledComponent<{
|
|
22
|
+
theme?: import("@emotion/react").Theme;
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { ThemeColorsExtended } from "../ThemeContext/ThemeContext";
|
|
4
3
|
/**
|
|
5
4
|
* @property {string} value - The value displayed in the dropdown item
|
|
6
|
-
* @property {
|
|
5
|
+
* @property {string} color - The color of the dropdown item
|
|
7
6
|
* @property {string} textColor - The text color of the dropdown item
|
|
8
7
|
* @property {DropdownItem[]} children - The children of the dropdown item
|
|
9
8
|
* @property {() => void} onClick - The onClick handler of the dropdown item
|
|
@@ -12,9 +11,11 @@ export type DropdownItem = {
|
|
|
12
11
|
/** The value displayed in the item */
|
|
13
12
|
value: string;
|
|
14
13
|
/** The color of the item */
|
|
15
|
-
|
|
14
|
+
bgColor?: string;
|
|
16
15
|
/** The text color of the item */
|
|
17
16
|
textColor?: string;
|
|
17
|
+
/** The hover color of the item */
|
|
18
|
+
hoverColor?: string;
|
|
18
19
|
/** The children of the item */
|
|
19
20
|
children?: DropdownItem[];
|
|
20
21
|
/** Wether the item is hidden or not */
|
|
@@ -30,9 +31,9 @@ export type DropdownProps = {
|
|
|
30
31
|
/** The trigger element of the dropdown. Clicking on this item will open the dropdown */
|
|
31
32
|
trigger: React.ReactNode;
|
|
32
33
|
/** The color of the dropdown */
|
|
33
|
-
|
|
34
|
+
bgColor?: string;
|
|
34
35
|
/** The hover color of the dropdown */
|
|
35
|
-
hoverColor?:
|
|
36
|
+
hoverColor?: string;
|
|
36
37
|
/** Controls wether the dropdown should extend towards the left or the right */
|
|
37
38
|
direction?: "left" | "right";
|
|
38
39
|
/** The mobile breakpoint, by default it's 768px */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare const DropdownContainer: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
5
|
export declare const DropdownTrigger: import("@emotion/styled").StyledComponent<{
|
|
6
|
-
theme?: import("
|
|
6
|
+
theme?: import("@emotion/react").Theme;
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
9
|
export declare const DropdownBody: import("@emotion/styled").StyledComponent<{
|
|
10
|
-
theme?: import("
|
|
10
|
+
theme?: import("@emotion/react").Theme;
|
|
11
11
|
as?: React.ElementType;
|
|
12
12
|
} & {
|
|
13
13
|
$direction: string;
|
|
@@ -15,7 +15,7 @@ export declare const DropdownBody: import("@emotion/styled").StyledComponent<{
|
|
|
15
15
|
$bgColor: string;
|
|
16
16
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
17
17
|
export declare const DropdownItemInnerContainer: import("@emotion/styled").StyledComponent<{
|
|
18
|
-
theme?: import("
|
|
18
|
+
theme?: import("@emotion/react").Theme;
|
|
19
19
|
as?: React.ElementType;
|
|
20
20
|
} & {
|
|
21
21
|
$bgColor: string;
|
|
@@ -25,36 +25,35 @@ export declare const DropdownItemInnerContainer: import("@emotion/styled").Style
|
|
|
25
25
|
$direction: string;
|
|
26
26
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
27
27
|
export declare const DropdownBodyMobile: import("@emotion/styled").StyledComponent<{
|
|
28
|
-
theme?: import("
|
|
28
|
+
theme?: import("@emotion/react").Theme;
|
|
29
29
|
as?: React.ElementType;
|
|
30
30
|
} & {
|
|
31
31
|
$isOpen: boolean;
|
|
32
32
|
$bgColor: string;
|
|
33
33
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
34
34
|
export declare const DropdownItemMobileContainer: import("@emotion/styled").StyledComponent<{
|
|
35
|
-
theme?: import("
|
|
35
|
+
theme?: import("@emotion/react").Theme;
|
|
36
36
|
as?: React.ElementType;
|
|
37
37
|
} & {
|
|
38
|
-
$bgColor: string;
|
|
39
38
|
$textColor: string;
|
|
40
39
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
41
40
|
export declare const AccordionBody: import("@emotion/styled").StyledComponent<{
|
|
42
|
-
theme?: import("
|
|
41
|
+
theme?: import("@emotion/react").Theme;
|
|
43
42
|
as?: React.ElementType;
|
|
44
43
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
45
44
|
export declare const ClickableItemMobile: import("@emotion/styled").StyledComponent<{
|
|
46
|
-
theme?: import("
|
|
45
|
+
theme?: import("@emotion/react").Theme;
|
|
47
46
|
as?: React.ElementType;
|
|
48
47
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
49
48
|
export declare const MobileItemTitle: import("@emotion/styled").StyledComponent<{
|
|
50
|
-
theme?: import("
|
|
49
|
+
theme?: import("@emotion/react").Theme;
|
|
51
50
|
as?: React.ElementType;
|
|
52
51
|
} & {
|
|
53
52
|
$bgColor?: string;
|
|
54
53
|
$textColor?: string;
|
|
55
54
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
56
55
|
export declare const ItemSpanValue: import("@emotion/styled").StyledComponent<{
|
|
57
|
-
theme?: import("
|
|
56
|
+
theme?: import("@emotion/react").Theme;
|
|
58
57
|
as?: React.ElementType;
|
|
59
58
|
} & {
|
|
60
59
|
$direction: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { TIndicatorProps, TIndicatorVariants } from "./IndicatorInterfaces";
|
|
3
|
+
type TGenericIndicatorProps = {
|
|
4
|
+
variant: TIndicatorVariants;
|
|
5
|
+
} & TIndicatorProps;
|
|
6
|
+
export declare const Indicator: FC<TGenericIndicatorProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type TIndicatorInstanceProps = {
|
|
2
|
+
outerColor?: string;
|
|
3
|
+
innerColor?: string;
|
|
4
|
+
size?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
onClick?: (e: React.MouseEvent<SVGSVGElement>) => void;
|
|
7
|
+
};
|
|
8
|
+
export type TIndicatorProps = {
|
|
9
|
+
variant: TIndicatorVariants;
|
|
10
|
+
} & TIndicatorInstanceProps;
|
|
11
|
+
export type TIndicatorVariants = "live" | "success" | "warning" | "error";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ThemeColorsExtended } from "../ThemeContext/ThemeContext";
|
|
3
2
|
interface TextFieldProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
3
|
/** Classname given to the container div */
|
|
5
4
|
containerClassName?: string;
|
|
6
5
|
/** Disables the input */
|
|
7
6
|
isDisabled?: boolean;
|
|
8
7
|
/** The color of the input */
|
|
9
|
-
color?:
|
|
8
|
+
color?: string;
|
|
10
9
|
/** Change the styles of the input field */
|
|
11
10
|
sx?: React.CSSProperties;
|
|
12
11
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const InputContainer: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
5
|
export declare const StyledInput: import("@emotion/styled").StyledComponent<{
|
|
6
|
-
theme?: import("
|
|
6
|
+
theme?: import("@emotion/react").Theme;
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
} & {
|
|
9
9
|
$color: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export declare const DialogElement: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
4
|
} & {
|
|
5
5
|
$width?: string;
|
|
6
6
|
$height?: string;
|
|
7
|
+
$bgColor?: string;
|
|
8
|
+
$textColor?: string;
|
|
7
9
|
}, import("react").DetailedHTMLProps<import("react").DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, {}>;
|
|
8
10
|
export declare const ExitButtonContainer: import("@emotion/styled").StyledComponent<{
|
|
9
|
-
theme?: import("
|
|
11
|
+
theme?: import("@emotion/react").Theme;
|
|
10
12
|
as?: React.ElementType;
|
|
11
13
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ThemeColorsExtended } from "../ThemeContext/ThemeContext";
|
|
3
1
|
export interface MultiSelectProps<Option = {
|
|
4
2
|
label: string;
|
|
5
3
|
value: string;
|
|
@@ -29,7 +27,7 @@ export interface MultiSelectProps<Option = {
|
|
|
29
27
|
/** Wether the select is loading */
|
|
30
28
|
isLoading?: boolean;
|
|
31
29
|
/** The color of the select */
|
|
32
|
-
color?:
|
|
30
|
+
color?: string;
|
|
33
31
|
/** The HTML id of the container */
|
|
34
32
|
containerId?: string;
|
|
35
33
|
/** The HTML id of the select */
|
|
@@ -41,4 +39,4 @@ export interface MultiSelectProps<Option = {
|
|
|
41
39
|
/** Wether the select is required */
|
|
42
40
|
required?: boolean;
|
|
43
41
|
}
|
|
44
|
-
export declare const MultiSelect: <Option>(props: MultiSelectProps<Option>) =>
|
|
42
|
+
export declare const MultiSelect: <Option>(props: MultiSelectProps<Option>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ThemeColorsExtended } from "../ThemeContext/ThemeContext";
|
|
3
1
|
export interface SingleSelectProps<Option = {
|
|
4
2
|
label: string;
|
|
5
3
|
value: string;
|
|
@@ -29,7 +27,7 @@ export interface SingleSelectProps<Option = {
|
|
|
29
27
|
/** Wether the select is loading */
|
|
30
28
|
isLoading?: boolean;
|
|
31
29
|
/** The color of the select */
|
|
32
|
-
color?:
|
|
30
|
+
color?: string;
|
|
33
31
|
/** The HTML id of the container */
|
|
34
32
|
containerId?: string;
|
|
35
33
|
/** The HTML id of the select */
|
|
@@ -43,4 +41,4 @@ export interface SingleSelectProps<Option = {
|
|
|
43
41
|
/** Wether the select is required */
|
|
44
42
|
required?: boolean;
|
|
45
43
|
}
|
|
46
|
-
export declare const SingleSelect: <Option>(props: SingleSelectProps<Option>) =>
|
|
44
|
+
export declare const SingleSelect: <Option>(props: SingleSelectProps<Option>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ThemeColorsExtended } from "../ThemeContext/ThemeContext";
|
|
3
1
|
export type SliderProps = {
|
|
4
2
|
/** The values of the slider. */
|
|
5
3
|
values: number[];
|
|
@@ -12,11 +10,11 @@ export type SliderProps = {
|
|
|
12
10
|
/** The onFinalChange handler of the slider. (called only when the thumb is released) */
|
|
13
11
|
onFinalChange?: (values: number[]) => void;
|
|
14
12
|
/** The color of the slider */
|
|
15
|
-
color?:
|
|
13
|
+
color?: string;
|
|
16
14
|
/** The color of the section not included in the range */
|
|
17
|
-
unselectedColor?:
|
|
15
|
+
unselectedColor?: string;
|
|
18
16
|
/** The color of the thumb */
|
|
19
|
-
thumbColor?:
|
|
17
|
+
thumbColor?: string;
|
|
20
18
|
/** The HTML id of the slider */
|
|
21
19
|
htmlId?: string;
|
|
22
20
|
/** The class name of the slider */
|
|
@@ -32,4 +30,4 @@ export type SliderProps = {
|
|
|
32
30
|
/** Wether the thumbs can overlap */
|
|
33
31
|
allowOverlap?: boolean;
|
|
34
32
|
};
|
|
35
|
-
export declare const Slider: (props: SliderProps) =>
|
|
33
|
+
export declare const Slider: (props: SliderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare const OuterTrackDiv: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
5
|
export declare const InnerTrackDiv: import("@emotion/styled").StyledComponent<{
|
|
6
|
-
theme?: import("
|
|
6
|
+
theme?: import("@emotion/react").Theme;
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
} & {
|
|
9
9
|
$bgColor: string;
|
|
10
10
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
11
|
export declare const ThumbDiv: import("@emotion/styled").StyledComponent<{
|
|
12
|
-
theme?: import("
|
|
12
|
+
theme?: import("@emotion/react").Theme;
|
|
13
13
|
as?: React.ElementType;
|
|
14
14
|
} & {
|
|
15
15
|
$bgColor: string;
|
|
@@ -17,7 +17,7 @@ export declare const ThumbDiv: import("@emotion/styled").StyledComponent<{
|
|
|
17
17
|
$disabled?: boolean;
|
|
18
18
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
19
19
|
export declare const ThumbValueSpan: import("@emotion/styled").StyledComponent<{
|
|
20
|
-
theme?: import("
|
|
20
|
+
theme?: import("@emotion/react").Theme;
|
|
21
21
|
as?: React.ElementType;
|
|
22
22
|
} & {
|
|
23
23
|
$textColor: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { ITagColors } from "../ThemeContext/ThemeInterfaces";
|
|
3
|
+
import { Interpolation } from "@emotion/styled";
|
|
4
|
+
import { Theme } from "@emotion/react";
|
|
5
|
+
export type TTagProps = {
|
|
6
|
+
text: string;
|
|
7
|
+
/**
|
|
8
|
+
* If `variant` is set to `custom`, `bgColor` and `textColor` will be used.
|
|
9
|
+
* Otherwise, the `variant` will be used to determine the colors.
|
|
10
|
+
*
|
|
11
|
+
* The variants are the keys of the interface `@see ITagColors`, which by default are:
|
|
12
|
+
* - `default`
|
|
13
|
+
* - `warm`
|
|
14
|
+
* - `cold`
|
|
15
|
+
* - `paper`
|
|
16
|
+
*/
|
|
17
|
+
variant: keyof ITagColors | "custom";
|
|
18
|
+
/** To use this prop, the variant must be set to `custom` */
|
|
19
|
+
bgColor?: string;
|
|
20
|
+
/** To use this prop, the variant must be set to `custom` */
|
|
21
|
+
textColor?: string;
|
|
22
|
+
sx?: Interpolation<Theme>;
|
|
23
|
+
};
|
|
24
|
+
export declare const Tag: FC<TTagProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag, TTagProps } from "./Tag";
|
|
@@ -1,72 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export
|
|
7
|
-
primary: Color;
|
|
8
|
-
secondary: Color;
|
|
9
|
-
tertiary: Color;
|
|
10
|
-
statusOk: Color;
|
|
11
|
-
statusWarning: Color;
|
|
12
|
-
statusCritical: Color;
|
|
13
|
-
statusNeutral: Color;
|
|
14
|
-
}
|
|
15
|
-
export interface ThemeContextProps {
|
|
16
|
-
colors: ThemeColorsObject;
|
|
17
|
-
}
|
|
18
|
-
interface Nothing {
|
|
19
|
-
}
|
|
20
|
-
type Union<T, U> = T | (U & Nothing);
|
|
21
|
-
export type ThemeColors = keyof ThemeColorsObject;
|
|
22
|
-
export type ThemeColorsExtended = Union<ThemeColors, string>;
|
|
23
|
-
export type ThemeProperties = ThemeContextProps & {
|
|
24
|
-
getColor: (color: ThemeColorsExtended) => Color;
|
|
25
|
-
};
|
|
26
|
-
export declare const defaultThemeColors: {
|
|
27
|
-
primary: {
|
|
28
|
-
main: string;
|
|
29
|
-
contrastText: string;
|
|
30
|
-
};
|
|
31
|
-
secondary: {
|
|
32
|
-
main: string;
|
|
33
|
-
contrastText: string;
|
|
34
|
-
};
|
|
35
|
-
tertiary: {
|
|
36
|
-
main: string;
|
|
37
|
-
contrastText: string;
|
|
38
|
-
};
|
|
39
|
-
statusOk: {
|
|
40
|
-
main: string;
|
|
41
|
-
contrastText: string;
|
|
42
|
-
};
|
|
43
|
-
statusWarning: {
|
|
44
|
-
main: string;
|
|
45
|
-
contrastText: string;
|
|
46
|
-
};
|
|
47
|
-
statusCritical: {
|
|
48
|
-
main: string;
|
|
49
|
-
contrastText: string;
|
|
50
|
-
};
|
|
51
|
-
statusNeutral: {
|
|
52
|
-
main: string;
|
|
53
|
-
contrastText: string;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export declare const ThemeContextProvider: (props: React.PropsWithChildren<{
|
|
57
|
-
theme?: ThemeContextProps;
|
|
58
|
-
}>) => React.JSX.Element;
|
|
59
|
-
type NestedObject<T> = {
|
|
60
|
-
[key: string]: T | NestedObject<T>;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Returns the value of a nested object given a string path
|
|
64
|
-
* This function is supposed to be used ONLY to retrieve values from the theme object
|
|
65
|
-
*
|
|
66
|
-
* @param object the object to search
|
|
67
|
-
* @param path a string representing the path to the value
|
|
68
|
-
* @returns the value of the nested object
|
|
69
|
-
*/
|
|
70
|
-
export declare function getObjectValueByPath<T>(obj: NestedObject<T>, path: string): T | undefined;
|
|
71
|
-
export declare const useThemeContext: () => ThemeProperties;
|
|
72
|
-
export {};
|
|
2
|
+
import { IPalette, IThemeContextProps, IThemeContextValue } from "./ThemeInterfaces";
|
|
3
|
+
export declare const defaultLightPalette: IPalette;
|
|
4
|
+
export declare const defaultDarkPalette: IPalette;
|
|
5
|
+
export declare const ThemeContextProvider: ({ palettes, defaultMode, children, }: React.PropsWithChildren<IThemeContextProps>) => JSX.Element;
|
|
6
|
+
export declare const useThemeContext: () => IThemeContextValue;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export type TColorScale = {
|
|
2
|
+
50: string;
|
|
3
|
+
100: string;
|
|
4
|
+
200: string;
|
|
5
|
+
300: string;
|
|
6
|
+
400: string;
|
|
7
|
+
500: string;
|
|
8
|
+
600: string;
|
|
9
|
+
700: string;
|
|
10
|
+
800: string;
|
|
11
|
+
900: string;
|
|
12
|
+
950: string;
|
|
13
|
+
};
|
|
14
|
+
export interface ICommonColors {
|
|
15
|
+
red: TColorScale;
|
|
16
|
+
green: TColorScale;
|
|
17
|
+
blue: TColorScale;
|
|
18
|
+
yellow: TColorScale;
|
|
19
|
+
purple: TColorScale;
|
|
20
|
+
darkBlue: TColorScale;
|
|
21
|
+
orange: TColorScale;
|
|
22
|
+
gray: TColorScale;
|
|
23
|
+
}
|
|
24
|
+
export interface IBackgroundColors {
|
|
25
|
+
main: string;
|
|
26
|
+
radialGradient: string;
|
|
27
|
+
}
|
|
28
|
+
interface ISharedColorProperties {
|
|
29
|
+
/** Represents the color itself */
|
|
30
|
+
main: string;
|
|
31
|
+
/** A slightly different color derived from the main one */
|
|
32
|
+
variant: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IStandardPaletteColor extends ISharedColorProperties {
|
|
35
|
+
/** The color to be used for text and elements that need to contrast with the main / variant */
|
|
36
|
+
contrast: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ITagColors {
|
|
39
|
+
default: {
|
|
40
|
+
main: string;
|
|
41
|
+
text: string;
|
|
42
|
+
};
|
|
43
|
+
warm: {
|
|
44
|
+
main: string;
|
|
45
|
+
text: string;
|
|
46
|
+
};
|
|
47
|
+
cold: {
|
|
48
|
+
main: string;
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
paper: {
|
|
52
|
+
main: string;
|
|
53
|
+
text: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface IIndicatorColors {
|
|
57
|
+
main: string;
|
|
58
|
+
mainFill: string;
|
|
59
|
+
success: string;
|
|
60
|
+
successFill: string;
|
|
61
|
+
warning: string;
|
|
62
|
+
warningFill: string;
|
|
63
|
+
error: string;
|
|
64
|
+
errorFill: string;
|
|
65
|
+
}
|
|
66
|
+
export interface IPalette {
|
|
67
|
+
/** Application background */
|
|
68
|
+
background: IBackgroundColors;
|
|
69
|
+
/** Primary Brand Color */
|
|
70
|
+
primary: IStandardPaletteColor;
|
|
71
|
+
/** Color config for actions solved with a success */
|
|
72
|
+
success: IStandardPaletteColor;
|
|
73
|
+
/** Color config for actions solved with a warning */
|
|
74
|
+
warning: IStandardPaletteColor;
|
|
75
|
+
/** Color config for actions solved with an error */
|
|
76
|
+
error: IStandardPaletteColor;
|
|
77
|
+
/** Color config for surfaces*/
|
|
78
|
+
surface: IStandardPaletteColor;
|
|
79
|
+
/** Color config for borders */
|
|
80
|
+
border: ISharedColorProperties;
|
|
81
|
+
/** Color config for tags */
|
|
82
|
+
tag: ITagColors;
|
|
83
|
+
/** Color config for indicators */
|
|
84
|
+
indicator: IIndicatorColors;
|
|
85
|
+
}
|
|
86
|
+
export type TThemeMode = "light" | "dark" | "system";
|
|
87
|
+
export interface IThemeContextProps {
|
|
88
|
+
/** From this prop you can override (even partially) the palettes (dark and light) of the library. */
|
|
89
|
+
palettes?: {
|
|
90
|
+
light?: Partial<IPalette>;
|
|
91
|
+
dark?: Partial<IPalette>;
|
|
92
|
+
};
|
|
93
|
+
defaultMode?: TThemeMode;
|
|
94
|
+
}
|
|
95
|
+
export interface IThemeContextValue {
|
|
96
|
+
/** Which mode is currently active */
|
|
97
|
+
mode: TThemeMode;
|
|
98
|
+
/** Which mode is currently displayed.
|
|
99
|
+
* This is useful when the mode is set to "system" and the user has a dark mode preference.
|
|
100
|
+
*/
|
|
101
|
+
displayedMode: "light" | "dark";
|
|
102
|
+
/** A collection of common Colors with variants */
|
|
103
|
+
commonColors: ICommonColors;
|
|
104
|
+
/** This will contain the palette of the correct color mode. */
|
|
105
|
+
activePalette: IPalette;
|
|
106
|
+
/** use this function to change the mode */
|
|
107
|
+
setMode: (mode: TThemeMode) => void;
|
|
108
|
+
}
|
|
109
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./ThemeContext";
|
|
2
|
+
export * from "./ThemeInterfaces";
|