@factorearth/component-library 4.1.0 → 4.2.0-alpha.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/Atoms/ProgressBar/ProgressBar.d.ts +10 -0
- package/dist/Atoms/ProgressBar/ProgressBar.js +24 -0
- package/dist/Atoms/ProgressBar/ProgressBar.js.map +1 -0
- package/dist/Organisms/Modal/Modal.d.ts +11 -3
- package/dist/Organisms/Modal/Modal.js +36 -16
- package/dist/Organisms/Modal/Modal.js.map +1 -1
- package/dist/Theme/ThemeProvider.js +28 -0
- package/dist/Theme/ThemeProvider.js.map +1 -1
- package/dist/Theme/types.d.ts +14 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Colors } from "../../Theme/types";
|
|
3
|
+
import { ToastVariant } from "Organisms/Modal/Modal";
|
|
4
|
+
export type PercentValue = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100;
|
|
5
|
+
declare const ProgressBar: ({ progress, colorPalette, variant, }: {
|
|
6
|
+
progress: PercentValue;
|
|
7
|
+
colorPalette: Colors;
|
|
8
|
+
variant: ToastVariant;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import React from "react";
|
|
3
|
+
const ProgressBarContainer = styled.div `
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 20px;
|
|
6
|
+
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
7
|
+
border: ${({ colorPalette }) => colorPalette.border.primary};
|
|
8
|
+
border-style: solid;
|
|
9
|
+
border-width: 0.5px;
|
|
10
|
+
border-radius: 12px;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
padding: 2px;
|
|
13
|
+
`;
|
|
14
|
+
const ProgressBarFiller = styled.div `
|
|
15
|
+
height: 100%;
|
|
16
|
+
width: ${({ progress }) => progress}%;
|
|
17
|
+
background-color: ${({ colorPalette, variant }) => colorPalette.toastText[variant]};
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
transition: width 0.3s ease-in-out;
|
|
20
|
+
`;
|
|
21
|
+
const ProgressBar = ({ progress, colorPalette, variant, }) => (React.createElement(ProgressBarContainer, { colorPalette: colorPalette },
|
|
22
|
+
React.createElement(ProgressBarFiller, { progress: progress, colorPalette: colorPalette, variant: variant })));
|
|
23
|
+
export default ProgressBar;
|
|
24
|
+
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../lib/Atoms/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AA2G1B,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAA0B;;;qBAG5C,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO;WAC/D,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO;;;;;;CAM3D,CAAC;AAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAIlC;;UAEQ,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ;qBACf,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,CACjD,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC;;;CAGhC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,EACpB,QAAQ,EACR,YAAY,EACZ,OAAO,GAKP,EAAE,EAAE,CAAC,CACL,oBAAC,oBAAoB,IAAC,YAAY,EAAE,YAAY;IAC/C,oBAAC,iBAAiB,IACjB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,GACf,CACoB,CACvB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
3
3
|
import { Colors } from "../../Theme/types";
|
|
4
|
+
export type ToastVariant = "primary" | "success" | "destructive" | "warning" | "info";
|
|
4
5
|
export declare const StyledDialog: import("@emotion/styled").StyledComponent<Dialog.DialogOverlayProps & React.RefAttributes<HTMLDivElement> & {
|
|
5
6
|
theme?: import("@emotion/react").Theme;
|
|
6
7
|
} & {
|
|
7
8
|
colorPalette: Colors;
|
|
9
|
+
toast?: ToastVariant;
|
|
8
10
|
}, {}, {}>;
|
|
9
11
|
export declare const StyledContent: import("@emotion/styled").StyledComponent<Dialog.DialogContentProps & React.RefAttributes<HTMLDivElement> & {
|
|
10
12
|
theme?: import("@emotion/react").Theme;
|
|
11
13
|
} & {
|
|
12
14
|
colorPalette: Colors;
|
|
15
|
+
toast?: ToastVariant;
|
|
13
16
|
}, {}, {}>;
|
|
14
17
|
export declare const DialogContainer: import("@emotion/styled").StyledComponent<{
|
|
15
18
|
theme?: import("@emotion/react").Theme;
|
|
@@ -44,15 +47,20 @@ interface ModalProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDi
|
|
|
44
47
|
children: React.ReactNode;
|
|
45
48
|
colorPalette: Colors;
|
|
46
49
|
setOpen: (open: boolean) => void;
|
|
50
|
+
toast?: ToastVariant;
|
|
51
|
+
timeout?: number;
|
|
47
52
|
}
|
|
48
53
|
export declare const Modal: (props: ModalProps) => React.JSX.Element;
|
|
49
|
-
interface ConfirmationModalProps {
|
|
54
|
+
interface ConfirmationModalProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
50
55
|
colorPalette: Colors;
|
|
51
56
|
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
52
|
-
confirmTitle: string;
|
|
53
|
-
|
|
57
|
+
confirmTitle: string | JSX.Element;
|
|
58
|
+
details: string | JSX.Element;
|
|
54
59
|
handleSubmit: any;
|
|
55
60
|
open: boolean;
|
|
61
|
+
toast?: ToastVariant;
|
|
62
|
+
canClose?: boolean;
|
|
63
|
+
timeout?: number;
|
|
56
64
|
}
|
|
57
65
|
export declare const ConfirmationModal: (props: ConfirmationModalProps) => React.JSX.Element;
|
|
58
66
|
export {};
|
|
@@ -3,8 +3,9 @@ import * as Dialog from "@radix-ui/react-dialog";
|
|
|
3
3
|
import styled from "@emotion/styled";
|
|
4
4
|
import { Button } from "../../Atoms/Buttons/Button";
|
|
5
5
|
import { FiX } from "react-icons/fi";
|
|
6
|
+
import { useEffect } from "react";
|
|
6
7
|
export const StyledDialog = styled(Dialog.Overlay) `
|
|
7
|
-
|
|
8
|
+
${({ colorPalette, toast }) => !toast && `background-color: ${colorPalette.background.secondary}`};
|
|
8
9
|
opacity: 0.8;
|
|
9
10
|
position: absolute;
|
|
10
11
|
inset: 0;
|
|
@@ -12,12 +13,13 @@ export const StyledDialog = styled(Dialog.Overlay) `
|
|
|
12
13
|
z-index: 1000;
|
|
13
14
|
`;
|
|
14
15
|
export const StyledContent = styled(Dialog.Content) `
|
|
15
|
-
|
|
16
|
+
${({ colorPalette, toast }) => !toast
|
|
17
|
+
? `background-color: ${colorPalette.background.primary}; color: ${colorPalette.text.primary};`
|
|
18
|
+
: `background-color: ${colorPalette.toastBackground[toast]}; color: ${colorPalette.toastText[toast]};`};
|
|
16
19
|
box-shadow: ${({ colorPalette }) => `${colorPalette.background.secondary} 0px 5px 15px`};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
top: 50%;
|
|
20
|
+
${({ toast }) => !toast && `border-radius: 4px;`};
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: ${({ toast }) => (toast ? "64px" : "50%")};
|
|
21
23
|
left: 50%;
|
|
22
24
|
transform: translate(-50%, -50%);
|
|
23
25
|
max-height: 85vh;
|
|
@@ -26,6 +28,7 @@ export const StyledContent = styled(Dialog.Content) `
|
|
|
26
28
|
display: flex;
|
|
27
29
|
flex-direction: column;
|
|
28
30
|
min-width: 300px;
|
|
31
|
+
${({ toast }) => toast && `width: 100%;`};
|
|
29
32
|
gap: 16px;
|
|
30
33
|
:focus {
|
|
31
34
|
outline: none;
|
|
@@ -42,6 +45,7 @@ export const DialogContainer = styled.div `
|
|
|
42
45
|
export const ModalTitleContainer = styled.div `
|
|
43
46
|
display: flex;
|
|
44
47
|
justify-content: space-between;
|
|
48
|
+
align-items: center;
|
|
45
49
|
width: 100%;
|
|
46
50
|
`;
|
|
47
51
|
export const ModalTitle = styled.div `
|
|
@@ -81,23 +85,39 @@ export const ModalInputBox = styled.div `
|
|
|
81
85
|
gap: 8px;
|
|
82
86
|
`;
|
|
83
87
|
export const Modal = (props) => {
|
|
84
|
-
const { open, children, colorPalette, setOpen, ...htmlProps } = props;
|
|
88
|
+
const { open, children, colorPalette, setOpen, toast, timeout, ...htmlProps } = props;
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
let timer;
|
|
91
|
+
if (open && toast) {
|
|
92
|
+
timer = setTimeout(() => {
|
|
93
|
+
setOpen(false);
|
|
94
|
+
}, timeout || 5000);
|
|
95
|
+
}
|
|
96
|
+
return () => {
|
|
97
|
+
if (timer) {
|
|
98
|
+
clearTimeout(timer);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}, [open]);
|
|
85
102
|
return (React.createElement(Dialog.Root, { open: open, modal: true },
|
|
86
103
|
React.createElement(Dialog.Portal, null,
|
|
87
104
|
React.createElement(Dialog.Title, null),
|
|
88
|
-
React.createElement(StyledDialog, { colorPalette: colorPalette }),
|
|
89
|
-
React.createElement(StyledContent, { ...htmlProps, colorPalette: colorPalette, onInteractOutside: () =>
|
|
105
|
+
React.createElement(StyledDialog, { colorPalette: colorPalette, toast: toast }),
|
|
106
|
+
React.createElement(StyledContent, { ...htmlProps, colorPalette: colorPalette, onInteractOutside: () => {
|
|
107
|
+
if (toast)
|
|
108
|
+
setOpen(true);
|
|
109
|
+
}, onPointerDownOutside: () => setOpen(false), toast: toast }, children))));
|
|
90
110
|
};
|
|
91
111
|
export const ConfirmationModal = (props) => {
|
|
92
|
-
const { colorPalette, setOpen, confirmTitle,
|
|
93
|
-
return (React.createElement(Modal, { colorPalette: colorPalette, open: open, setOpen: setOpen },
|
|
94
|
-
React.createElement(DialogContainer,
|
|
112
|
+
const { colorPalette, setOpen, confirmTitle, details, handleSubmit, open, toast, canClose, timeout, ...htmlProps } = props;
|
|
113
|
+
return (React.createElement(Modal, { colorPalette: colorPalette, open: open, setOpen: setOpen, ...htmlProps, toast: toast, timeout: timeout },
|
|
114
|
+
React.createElement(DialogContainer, { ...(toast ? { style: { padding: "24px" } } : {}) },
|
|
95
115
|
React.createElement(ModalTitleContainer, null,
|
|
96
116
|
React.createElement(ModalTitle, null, confirmTitle),
|
|
97
|
-
React.createElement(FiX, { onClick: () => setOpen(false), size: 24 })),
|
|
98
|
-
React.createElement(ModelSubHeading, null,
|
|
99
|
-
React.createElement(ModalFooter, null,
|
|
117
|
+
canClose && React.createElement(FiX, { onClick: () => setOpen(false), size: 24 })),
|
|
118
|
+
React.createElement(ModelSubHeading, null, details),
|
|
119
|
+
!toast && (React.createElement(ModalFooter, null,
|
|
100
120
|
React.createElement(Button, { colorPalette: colorPalette, variant: "filled", label: "Ok", onClick: handleSubmit }),
|
|
101
|
-
React.createElement(Button, { colorPalette: colorPalette, variant: "destructive", label: "Cancel", onClick: () => setOpen(false) })))));
|
|
121
|
+
React.createElement(Button, { colorPalette: colorPalette, variant: "destructive", label: "Cancel", onClick: () => setOpen(false) }))))));
|
|
102
122
|
};
|
|
103
123
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../lib/Organisms/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAEjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../lib/Organisms/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAEjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAGhD;GACC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,CAAC,KAAK,IAAI,qBAAqB,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE;;;;;;CAMnE,CAAC;AAEF,MAAM,CAAC,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MAAM,EACL,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,GAAG,SAAS,EACZ,GAAG,KAAK,CAAC;IACV,OAAO,CACN,oBAAC,KAAK,IACL,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,KACZ,SAAS,EACb,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO;QAEhB,oBAAC,eAAe,OAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,oBAAC,mBAAmB;gBACnB,oBAAC,UAAU,QAAE,YAAY,CAAc;gBACtC,QAAQ,IAAI,oBAAC,GAAG,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,GAAI,CACxC;YACtB,oBAAC,eAAe,QAAE,OAAO,CAAmB;YAC3C,CAAC,KAAK,IAAI,CACV,oBAAC,WAAW;gBACX,oBAAC,MAAM,IACN,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAC,IAAI,EACV,OAAO,EAAE,YAAY,GACpB;gBACF,oBAAC,MAAM,IACN,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAC,aAAa,EACrB,KAAK,EAAC,QAAQ,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAC5B,CACW,CACd,CACgB,CACX,CACR,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -122,6 +122,20 @@ export const lightTheme = {
|
|
|
122
122
|
selected: white["100"],
|
|
123
123
|
notSelected: grey["800"],
|
|
124
124
|
},
|
|
125
|
+
toastText: {
|
|
126
|
+
success: green["300"],
|
|
127
|
+
destructive: red["400"],
|
|
128
|
+
info: blue["500"],
|
|
129
|
+
warning: orange["300"],
|
|
130
|
+
primary: grey["1100"],
|
|
131
|
+
},
|
|
132
|
+
toastBackground: {
|
|
133
|
+
success: green["100"],
|
|
134
|
+
destructive: red["100"],
|
|
135
|
+
info: blue["100"],
|
|
136
|
+
warning: orange["100"],
|
|
137
|
+
primary: grey["200"],
|
|
138
|
+
},
|
|
125
139
|
theme: "light",
|
|
126
140
|
};
|
|
127
141
|
export const darkTheme = {
|
|
@@ -202,6 +216,20 @@ export const darkTheme = {
|
|
|
202
216
|
selected: grey["1200"],
|
|
203
217
|
notSelected: grey["400"],
|
|
204
218
|
},
|
|
219
|
+
toastText: {
|
|
220
|
+
success: green["300"],
|
|
221
|
+
destructive: red["400"],
|
|
222
|
+
info: blue["500"],
|
|
223
|
+
warning: orange["300"],
|
|
224
|
+
primary: grey["1100"],
|
|
225
|
+
},
|
|
226
|
+
toastBackground: {
|
|
227
|
+
success: green["100"],
|
|
228
|
+
destructive: red["100"],
|
|
229
|
+
info: blue["100"],
|
|
230
|
+
warning: orange["100"],
|
|
231
|
+
primary: grey["200"],
|
|
232
|
+
},
|
|
205
233
|
theme: "dark",
|
|
206
234
|
};
|
|
207
235
|
const ThemeContext = createContext({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../lib/Theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../lib/Theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,MAAM,MAAM,eAAe,CAAC;AAInC,MAAM,EAAE,MAAM,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,KAAK,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,YAAY,GAAG,aAAa,CAAC;IAClC,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,CAAC,SAA2B,EAAE,EAAE,GAAE,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC7B,QAAQ,EACR,UAAU,GAIV,EAAE,EAAE;IACJ,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,CAAC,SAA2B,EAAE,EAAE;QACnD,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;YAC3B,QAAQ,CAAC,UAAU,CAAC,CAAC;YACrB,OAAO;QACR,CAAC;QACD,QAAQ,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,CACN,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE;QACzE,6BACC,KAAK,EAAE;gBACN,eAAe,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO;gBACzC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;aACzB,IAEA,QAAQ,CACJ,CACiB,CACxB,CAAC;AACH,CAAC,CAAC"}
|
package/dist/Theme/types.d.ts
CHANGED
|
@@ -127,6 +127,20 @@ export interface Colors {
|
|
|
127
127
|
icon: string;
|
|
128
128
|
disabled: string;
|
|
129
129
|
};
|
|
130
|
+
toastText: {
|
|
131
|
+
success: string;
|
|
132
|
+
destructive: string;
|
|
133
|
+
info: string;
|
|
134
|
+
primary: string;
|
|
135
|
+
warning: string;
|
|
136
|
+
};
|
|
137
|
+
toastBackground: {
|
|
138
|
+
success: string;
|
|
139
|
+
destructive: string;
|
|
140
|
+
info: string;
|
|
141
|
+
primary: string;
|
|
142
|
+
warning: string;
|
|
143
|
+
};
|
|
130
144
|
theme: "light" | "dark";
|
|
131
145
|
}
|
|
132
146
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factorearth/component-library",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0-alpha.0",
|
|
4
4
|
"description": " A storybook component library for FactorEarth",
|
|
5
5
|
"author": "madtrx <marlin.makori@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/FactorEarth/RecordMiddleware#readme",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"access": "public",
|
|
47
47
|
"registry": "https://registry.npmjs.org/"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "8480f7773d44c1e12f5b7bd2bf6aaf5fe61cb957",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@emotion/react": "^11.13.0",
|
|
52
52
|
"@emotion/styled": "^11.13.0",
|