@factorearth/component-library 5.3.7-alpha.0 → 5.3.7
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.
|
@@ -3,121 +3,121 @@ import { keyframes } from "@emotion/react";
|
|
|
3
3
|
import React, { useState, useMemo, useRef } from "react";
|
|
4
4
|
import { FiMenu, FiCloud, FiCloudOff, FiSun, FiMoon, FiChevronRight, FiX, } from "react-icons/fi";
|
|
5
5
|
import Toggle from "../../Atoms/Toggle/Toggle";
|
|
6
|
-
const slideInLeft = keyframes `
|
|
7
|
-
0% {
|
|
8
|
-
transform: translateX(-100%);
|
|
9
|
-
opacity: 0;
|
|
10
|
-
}
|
|
11
|
-
100% {
|
|
12
|
-
transform: translateX(0);
|
|
13
|
-
opacity: 1;
|
|
14
|
-
}
|
|
6
|
+
const slideInLeft = keyframes `
|
|
7
|
+
0% {
|
|
8
|
+
transform: translateX(-100%);
|
|
9
|
+
opacity: 0;
|
|
10
|
+
}
|
|
11
|
+
100% {
|
|
12
|
+
transform: translateX(0);
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
15
|
`;
|
|
16
|
-
const NavMenu = styled.div `
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
20
|
-
width: 100vw;
|
|
16
|
+
const NavMenu = styled.div `
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
20
|
+
width: 100vw;
|
|
21
21
|
`;
|
|
22
|
-
const NavBarHeader = styled.div `
|
|
23
|
-
display: flex;
|
|
24
|
-
justify-content: space-between;
|
|
25
|
-
align-items: center;
|
|
26
|
-
height: 88px;
|
|
27
|
-
border-width: 0 0 1px 0;
|
|
28
|
-
border-style: solid;
|
|
29
|
-
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
22
|
+
const NavBarHeader = styled.div `
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
align-items: center;
|
|
26
|
+
height: 88px;
|
|
27
|
+
border-width: 0 0 1px 0;
|
|
28
|
+
border-style: solid;
|
|
29
|
+
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
30
30
|
`;
|
|
31
|
-
const OnlineStatus = styled.div `
|
|
32
|
-
display: flex;
|
|
33
|
-
padding: 8px 12px;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
align-items: center;
|
|
36
|
-
gap: 8px;
|
|
37
|
-
border-radius: 32px;
|
|
38
|
-
font-weight: 700;
|
|
39
|
-
border-width: 1px;
|
|
40
|
-
border-style: solid;
|
|
41
|
-
border-color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
42
|
-
color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
43
|
-
background: #ebfaed;
|
|
31
|
+
const OnlineStatus = styled.div `
|
|
32
|
+
display: flex;
|
|
33
|
+
padding: 8px 12px;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 8px;
|
|
37
|
+
border-radius: 32px;
|
|
38
|
+
font-weight: 700;
|
|
39
|
+
border-width: 1px;
|
|
40
|
+
border-style: solid;
|
|
41
|
+
border-color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
42
|
+
color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
43
|
+
background: #ebfaed;
|
|
44
44
|
`;
|
|
45
|
-
const OfflineStatus = styled.div `
|
|
46
|
-
display: flex;
|
|
47
|
-
padding: 8px 12px;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
align-items: center;
|
|
50
|
-
gap: 8px;
|
|
51
|
-
border-radius: 32px;
|
|
52
|
-
font-weight: 700;
|
|
53
|
-
border-width: 1px;
|
|
54
|
-
border-style: solid;
|
|
55
|
-
border-color: ${({ colorPalette }) => colorPalette.utils.icon};
|
|
56
|
-
color: ${({ colorPalette }) => colorPalette.utils.icon};
|
|
45
|
+
const OfflineStatus = styled.div `
|
|
46
|
+
display: flex;
|
|
47
|
+
padding: 8px 12px;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: 8px;
|
|
51
|
+
border-radius: 32px;
|
|
52
|
+
font-weight: 700;
|
|
53
|
+
border-width: 1px;
|
|
54
|
+
border-style: solid;
|
|
55
|
+
border-color: ${({ colorPalette }) => colorPalette.utils.icon};
|
|
56
|
+
color: ${({ colorPalette }) => colorPalette.utils.icon};
|
|
57
57
|
`;
|
|
58
|
-
const NavMenuDropdown = styled.div `
|
|
59
|
-
width: 320px;
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: 88px;
|
|
62
|
-
z-index: 1000;
|
|
63
|
-
box-shadow: 5px 5px 5px rgba(64, 64, 64, 0.2);
|
|
64
|
-
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
65
|
-
animation: ${slideInLeft} 0.5s ease-out forwards;
|
|
66
|
-
display: ${({ navOpen }) => (navOpen ? "flex" : "none")};
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
&:focus {
|
|
69
|
-
outline: none;
|
|
70
|
-
}
|
|
58
|
+
const NavMenuDropdown = styled.div `
|
|
59
|
+
width: 320px;
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 88px;
|
|
62
|
+
z-index: 1000;
|
|
63
|
+
box-shadow: 5px 5px 5px rgba(64, 64, 64, 0.2);
|
|
64
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
65
|
+
animation: ${slideInLeft} 0.5s ease-out forwards;
|
|
66
|
+
display: ${({ navOpen }) => (navOpen ? "flex" : "none")};
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
&:focus {
|
|
69
|
+
outline: none;
|
|
70
|
+
}
|
|
71
71
|
`;
|
|
72
|
-
const MenuItems = styled.div `
|
|
73
|
-
align-items: flex-start;
|
|
74
|
-
align-self: stretch;
|
|
72
|
+
const MenuItems = styled.div `
|
|
73
|
+
align-items: flex-start;
|
|
74
|
+
align-self: stretch;
|
|
75
75
|
`;
|
|
76
|
-
const MenuItem = styled.div `
|
|
77
|
-
display: flex;
|
|
78
|
-
padding: 8px 16px;
|
|
79
|
-
align-items: center;
|
|
80
|
-
color: ${({ colorPalette }) => colorPalette.text.tertiary};
|
|
81
|
-
font-weight: 700;
|
|
82
|
-
border-width: 0 0 1px 0;
|
|
83
|
-
border-style: solid;
|
|
84
|
-
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
85
|
-
width: 288px;
|
|
86
|
-
cursor: pointer;
|
|
76
|
+
const MenuItem = styled.div `
|
|
77
|
+
display: flex;
|
|
78
|
+
padding: 8px 16px;
|
|
79
|
+
align-items: center;
|
|
80
|
+
color: ${({ colorPalette }) => colorPalette.text.tertiary};
|
|
81
|
+
font-weight: 700;
|
|
82
|
+
border-width: 0 0 1px 0;
|
|
83
|
+
border-style: solid;
|
|
84
|
+
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
85
|
+
width: 288px;
|
|
86
|
+
cursor: pointer;
|
|
87
87
|
`;
|
|
88
|
-
const Location = styled.div `
|
|
89
|
-
display: flex;
|
|
90
|
-
align-items: center;
|
|
91
|
-
gap: 10px;
|
|
92
|
-
flex: 1 0 0;
|
|
93
|
-
font-size: 16px;
|
|
94
|
-
line-height: 150%;
|
|
88
|
+
const Location = styled.div `
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: 10px;
|
|
92
|
+
flex: 1 0 0;
|
|
93
|
+
font-size: 16px;
|
|
94
|
+
line-height: 150%;
|
|
95
95
|
`;
|
|
96
|
-
const Toggles = styled.div `
|
|
97
|
-
padding: 24px 0px;
|
|
96
|
+
const Toggles = styled.div `
|
|
97
|
+
padding: 24px 0px;
|
|
98
98
|
`;
|
|
99
|
-
const AppInfo = styled.div `
|
|
100
|
-
padding: 16px;
|
|
101
|
-
width: 288px;
|
|
102
|
-
background: ${({ colorPalette }) => colorPalette.background.tertiary};
|
|
99
|
+
const AppInfo = styled.div `
|
|
100
|
+
padding: 16px;
|
|
101
|
+
width: 288px;
|
|
102
|
+
background: ${({ colorPalette }) => colorPalette.background.tertiary};
|
|
103
103
|
`;
|
|
104
|
-
const LogoAndCopyRights = styled.div `
|
|
105
|
-
display: flex;
|
|
106
|
-
gap: 16px;
|
|
107
|
-
margin-bottom: 12px;
|
|
108
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
104
|
+
const LogoAndCopyRights = styled.div `
|
|
105
|
+
display: flex;
|
|
106
|
+
gap: 16px;
|
|
107
|
+
margin-bottom: 12px;
|
|
108
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
109
109
|
`;
|
|
110
|
-
const CopyRights = styled.div `
|
|
111
|
-
font-size: 12px;
|
|
112
|
-
font-style: normal;
|
|
113
|
-
font-weight: 400;
|
|
114
|
-
line-height: 55%;
|
|
110
|
+
const CopyRights = styled.div `
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
font-style: normal;
|
|
113
|
+
font-weight: 400;
|
|
114
|
+
line-height: 55%;
|
|
115
115
|
`;
|
|
116
|
-
const Version = styled.div `
|
|
117
|
-
text-align: center;
|
|
118
|
-
font-size: 14px;
|
|
119
|
-
font-weight: 400;
|
|
120
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
116
|
+
const Version = styled.div `
|
|
117
|
+
text-align: center;
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
font-weight: 400;
|
|
120
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
121
121
|
`;
|
|
122
122
|
const NavBar = (props) => {
|
|
123
123
|
const { colorPalette, locations, appInfo } = props;
|
|
@@ -209,10 +209,23 @@ const NavBar = (props) => {
|
|
|
209
209
|
appInfo.copyRight && (React.createElement(CopyRights, null,
|
|
210
210
|
React.createElement("p", null, appInfo.copyRight),
|
|
211
211
|
React.createElement("p", null, "All Rights Reserved.")))),
|
|
212
|
-
React.createElement(Version, { colorPalette: colorPalette },
|
|
212
|
+
React.createElement(Version, { colorPalette: colorPalette }, appInfo.versionNumOnClick ? (React.createElement("div", { style: { cursor: "pointer", fontWeight: 700 },
|
|
213
|
+
// The onClick function uses an if statement to protect against the onClick function being undefined.
|
|
214
|
+
// This is a workaround for the fact that the onClick function is optional in the appInfo interface.
|
|
215
|
+
onClick: () => {
|
|
216
|
+
if (appInfo.versionNumOnClick) {
|
|
217
|
+
appInfo.versionNumOnClick();
|
|
218
|
+
}
|
|
219
|
+
} },
|
|
213
220
|
appInfo.name,
|
|
214
221
|
" ",
|
|
215
|
-
appInfo.versionNum
|
|
222
|
+
appInfo.versionNum,
|
|
223
|
+
" - Release Notes")) : (React.createElement(React.Fragment, null,
|
|
224
|
+
" ",
|
|
225
|
+
appInfo.name,
|
|
226
|
+
" ",
|
|
227
|
+
appInfo.versionNum,
|
|
228
|
+
" "))))))));
|
|
216
229
|
};
|
|
217
230
|
export default NavBar;
|
|
218
231
|
//# sourceMappingURL=NavMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavMenu.js","sourceRoot":"","sources":["../../../lib/Molecules/NavMenu/NavMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EACN,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAK,EACL,MAAM,EACN,cAAc,EACd,GAAG,GACH,MAAM,gBAAgB,CAAC;AACxB,OAAO,MAAM,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"NavMenu.js","sourceRoot":"","sources":["../../../lib/Molecules/NavMenu/NavMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,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;gCAClB,CAAC,CAAC,OAAO,CAAC,YAAY,EAExB,GAAG,EAAC,iBAAiB,EACrB,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,GAC5C,CACF;wBACA,OAAO,CAAC,SAAS,IAAI,CACrB,oBAAC,UAAU;4BACV,+BAAI,OAAO,CAAC,SAAS,CAAK;4BAC1B,sDAA2B,CACf,CACb,CACkB;oBACpB,oBAAC,OAAO,IAAC,YAAY,EAAE,YAAY,IACjC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC5B,6BACC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE;wBAC7C,qGAAqG;wBACrG,oGAAoG;wBACpG,OAAO,EAAE,GAAG,EAAE;4BACb,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;gCAC/B,OAAO,CAAC,iBAAiB,EAAE,CAAC;4BAC7B,CAAC;wBACF,CAAC;wBAEA,OAAO,CAAC,IAAI;;wBAAG,OAAO,CAAC,UAAU;2CAC7B,CACN,CAAC,CAAC,CAAC,CACH;;wBAAI,OAAO,CAAC,IAAI;;wBAAG,OAAO,CAAC,UAAU;4BAAK,CAC1C,CACQ,CACD,CACL,CACW,CACT,CACV,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -4,99 +4,99 @@ import styled from "@emotion/styled";
|
|
|
4
4
|
import { Button } from "../../Atoms/Buttons/Button";
|
|
5
5
|
import { FiX } from "react-icons/fi";
|
|
6
6
|
import { useEffect } from "react";
|
|
7
|
-
export const StyledDialog = styled(Dialog.Overlay) `
|
|
8
|
-
${({ colorPalette, toast }) => !toast && `background-color: ${colorPalette.background.secondary}`};
|
|
9
|
-
opacity: 0.8;
|
|
10
|
-
position: absolute;
|
|
11
|
-
inset: 0;
|
|
12
|
-
animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
13
|
-
z-index: 1000;
|
|
7
|
+
export const StyledDialog = styled(Dialog.Overlay) `
|
|
8
|
+
${({ colorPalette, toast }) => !toast && `background-color: ${colorPalette.background.secondary}`};
|
|
9
|
+
opacity: 0.8;
|
|
10
|
+
position: absolute;
|
|
11
|
+
inset: 0;
|
|
12
|
+
animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
13
|
+
z-index: 1000;
|
|
14
14
|
`;
|
|
15
|
-
export const StyledContent = styled(Dialog.Content) `
|
|
15
|
+
export const StyledContent = styled(Dialog.Content) `
|
|
16
16
|
${({ colorPalette, toast }) => !toast
|
|
17
17
|
? `background-color: ${colorPalette.background.primary}; color: ${colorPalette.text.primary};`
|
|
18
|
-
: `background-color: ${colorPalette.toastBackground[toast]}; color: ${colorPalette.toastText[toast]};`};
|
|
19
|
-
box-shadow: ${({ colorPalette }) => `${colorPalette.background.secondary} 0px 5px 15px`};
|
|
20
|
-
${({ toast }) => !toast && `border-radius: 4px;`};
|
|
21
|
-
position: absolute;
|
|
22
|
-
top: ${({ toast }) => (toast ? "64px" : "50%")};
|
|
23
|
-
${({ minimized }) => minimized && "top: 45px"};
|
|
24
|
-
left: 50%;
|
|
25
|
-
transform: translate(-50%, -50%);
|
|
26
|
-
max-height: 85vh;
|
|
27
|
-
animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
28
|
-
z-index: 1000;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
min-width: ${({ minimized }) => (minimized ? "100px" : "300px")};
|
|
32
|
-
${({ toast }) => toast && `width: 100%;`};
|
|
33
|
-
${({ minimized }) => minimized && "width: 30%"};
|
|
34
|
-
gap: 16px;
|
|
35
|
-
:focus {
|
|
36
|
-
outline: none;
|
|
37
|
-
}
|
|
18
|
+
: `background-color: ${colorPalette.toastBackground[toast]}; color: ${colorPalette.toastText[toast]};`};
|
|
19
|
+
box-shadow: ${({ colorPalette }) => `${colorPalette.background.secondary} 0px 5px 15px`};
|
|
20
|
+
${({ toast }) => !toast && `border-radius: 4px;`};
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: ${({ toast }) => (toast ? "64px" : "50%")};
|
|
23
|
+
${({ minimized }) => minimized && "top: 45px"};
|
|
24
|
+
left: 50%;
|
|
25
|
+
transform: translate(-50%, -50%);
|
|
26
|
+
max-height: 85vh;
|
|
27
|
+
animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
28
|
+
z-index: 1000;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
min-width: ${({ minimized }) => (minimized ? "100px" : "300px")};
|
|
32
|
+
${({ toast }) => toast && `width: 100%;`};
|
|
33
|
+
${({ minimized }) => minimized && "width: 30%"};
|
|
34
|
+
gap: 16px;
|
|
35
|
+
:focus {
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
38
38
|
`;
|
|
39
|
-
export const DialogContainer = styled.div `
|
|
40
|
-
display: flex;
|
|
41
|
-
padding: 24px 24px 0px 24px;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
align-items: center;
|
|
44
|
-
gap: 16px;
|
|
45
|
-
align-self: stretch;
|
|
39
|
+
export const DialogContainer = styled.div `
|
|
40
|
+
display: flex;
|
|
41
|
+
padding: 24px 24px 0px 24px;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: 16px;
|
|
45
|
+
align-self: stretch;
|
|
46
46
|
`;
|
|
47
|
-
export const ModalTitleContainer = styled.div `
|
|
48
|
-
display: flex;
|
|
49
|
-
justify-content: space-between;
|
|
50
|
-
align-items: center;
|
|
51
|
-
width: 100%;
|
|
47
|
+
export const ModalTitleContainer = styled.div `
|
|
48
|
+
display: flex;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
align-items: center;
|
|
51
|
+
width: 100%;
|
|
52
52
|
`;
|
|
53
|
-
export const ModalTitle = styled.div `
|
|
54
|
-
font-size: ${({ minimized }) => (minimized ? "12px" : "24px")};
|
|
55
|
-
font-style: normal;
|
|
56
|
-
font-weight: 600;
|
|
57
|
-
line-height: 150%;
|
|
53
|
+
export const ModalTitle = styled.div `
|
|
54
|
+
font-size: ${({ minimized }) => (minimized ? "12px" : "24px")};
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
line-height: 150%;
|
|
58
58
|
`;
|
|
59
|
-
export const ModalHeading = styled.div `
|
|
60
|
-
font-size: 16px;
|
|
61
|
-
font-style: normal;
|
|
62
|
-
font-weight: 700;
|
|
63
|
-
line-height: 150%;
|
|
59
|
+
export const ModalHeading = styled.div `
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
font-style: normal;
|
|
62
|
+
font-weight: 700;
|
|
63
|
+
line-height: 150%;
|
|
64
64
|
`;
|
|
65
|
-
export const ModelSubHeading = styled.div `
|
|
66
|
-
font-size: 16px;
|
|
67
|
-
font-style: normal;
|
|
68
|
-
font-weight: 400;
|
|
69
|
-
line-height: 24px; /* 150% */
|
|
70
|
-
letter-spacing: 0.16px;
|
|
71
|
-
width: 100%;
|
|
72
|
-
white-space: pre-line;
|
|
65
|
+
export const ModelSubHeading = styled.div `
|
|
66
|
+
font-size: 16px;
|
|
67
|
+
font-style: normal;
|
|
68
|
+
font-weight: 400;
|
|
69
|
+
line-height: 24px; /* 150% */
|
|
70
|
+
letter-spacing: 0.16px;
|
|
71
|
+
width: 100%;
|
|
72
|
+
white-space: pre-line;
|
|
73
73
|
`;
|
|
74
|
-
export const ModalFooter = styled.div `
|
|
75
|
-
display: flex;
|
|
76
|
-
padding: 24px 16px;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
align-items: center;
|
|
79
|
-
gap: 16px;
|
|
80
|
-
align-self: stretch;
|
|
74
|
+
export const ModalFooter = styled.div `
|
|
75
|
+
display: flex;
|
|
76
|
+
padding: 24px 16px;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: 16px;
|
|
80
|
+
align-self: stretch;
|
|
81
81
|
`;
|
|
82
|
-
export const ModalInputBox = styled.div `
|
|
83
|
-
display: flex;
|
|
84
|
-
width: 322px;
|
|
85
|
-
flex-direction: column;
|
|
86
|
-
justify-content: center;
|
|
87
|
-
align-items: flex-start;
|
|
88
|
-
gap: 8px;
|
|
82
|
+
export const ModalInputBox = styled.div `
|
|
83
|
+
display: flex;
|
|
84
|
+
width: 322px;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
align-items: flex-start;
|
|
88
|
+
gap: 8px;
|
|
89
89
|
`;
|
|
90
|
-
export const ConfirmationInput = styled.input `
|
|
91
|
-
display: flex;
|
|
92
|
-
width: 275px;
|
|
93
|
-
flex-direction: column;
|
|
94
|
-
align-items: flex-start;
|
|
95
|
-
gap: 8px;
|
|
96
|
-
height: 40px;
|
|
97
|
-
padding: 8px 16px;
|
|
98
|
-
justify-content: center;
|
|
99
|
-
flex: 1 0 0;
|
|
90
|
+
export const ConfirmationInput = styled.input `
|
|
91
|
+
display: flex;
|
|
92
|
+
width: 275px;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
align-items: flex-start;
|
|
95
|
+
gap: 8px;
|
|
96
|
+
height: 40px;
|
|
97
|
+
padding: 8px 16px;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
flex: 1 0 0;
|
|
100
100
|
`;
|
|
101
101
|
export const Modal = (props) => {
|
|
102
102
|
const { open, children, colorPalette, setOpen, toast, timeout, canMinimize, setMinimized, minimized, modal, ...htmlProps } = props;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factorearth/component-library",
|
|
3
|
-
"version": "5.3.7
|
|
3
|
+
"version": "5.3.7",
|
|
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": "fbade46b6b0626ca7e0849eed064e9e34a0edec9",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@emotion/react": "^11.13.0",
|
|
52
52
|
"@emotion/styled": "^11.13.0",
|