@factorearth/component-library 6.2.1-modal-tweaks.0 → 6.2.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/Atoms/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/Atoms/ProgressBar/ProgressBar.js +3 -3
- package/dist/Atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/Atoms/SelectField/SelectField.d.ts +1 -0
- package/dist/Atoms/SelectField/SelectField.js +11 -4
- package/dist/Atoms/SelectField/SelectField.js.map +1 -1
- package/dist/Molecules/NavMenu/NavMenu.js +124 -124
- package/dist/Organisms/Modal/Modal.d.ts +9 -0
- package/dist/Organisms/Modal/Modal.js +90 -86
- package/dist/Organisms/Modal/Modal.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,9 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { Colors } from "../../Theme/types";
|
|
3
3
|
import { ToastVariant } from "Organisms/Modal/Modal";
|
|
4
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, }: {
|
|
5
|
+
declare const ProgressBar: ({ progress, colorPalette, variant, minimized }: {
|
|
6
6
|
progress: PercentValue;
|
|
7
7
|
colorPalette: Colors;
|
|
8
8
|
variant: ToastVariant;
|
|
9
|
+
minimized?: boolean;
|
|
9
10
|
}) => React.JSX.Element;
|
|
10
11
|
export default ProgressBar;
|
|
@@ -2,14 +2,14 @@ import styled from "@emotion/styled";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
const ProgressBarContainer = styled.div `
|
|
4
4
|
width: 100%;
|
|
5
|
-
height: 14px;
|
|
5
|
+
height: ${({ minimized }) => minimized ? "4px" : "14px"};
|
|
6
6
|
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
7
7
|
border: ${({ colorPalette }) => colorPalette.border.primary};
|
|
8
8
|
border-style: solid;
|
|
9
9
|
border-width: 0.5px;
|
|
10
10
|
border-radius: 12px;
|
|
11
11
|
overflow: hidden;
|
|
12
|
-
padding: 2px;
|
|
12
|
+
padding: ${({ minimized }) => minimized ? "0px" : "2px"};
|
|
13
13
|
`;
|
|
14
14
|
const ProgressBarFiller = styled.div `
|
|
15
15
|
height: 100%;
|
|
@@ -18,7 +18,7 @@ const ProgressBarFiller = styled.div `
|
|
|
18
18
|
border-radius: 12px;
|
|
19
19
|
transition: width 0.3s ease-in-out;
|
|
20
20
|
`;
|
|
21
|
-
const ProgressBar = ({ progress, colorPalette, variant, }) => (React.createElement(ProgressBarContainer, { colorPalette: colorPalette },
|
|
21
|
+
const ProgressBar = ({ progress, colorPalette, variant, minimized }) => (React.createElement(ProgressBarContainer, { colorPalette: colorPalette, minimized: minimized || false },
|
|
22
22
|
React.createElement(ProgressBarFiller, { progress: progress, colorPalette: colorPalette, variant: variant })));
|
|
23
23
|
export default ProgressBar;
|
|
24
24
|
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../lib/Atoms/ProgressBar/ProgressBar.tsx"],"names":[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O,EAAE,OAAO,GACf,CACoB,CACvB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -11,6 +11,7 @@ interface SelectFieldProps {
|
|
|
11
11
|
moreHorizon?: React.JSX.Element;
|
|
12
12
|
values: CheckboxFieldValues | Option[] | undefined;
|
|
13
13
|
type: "radio" | "checkbox";
|
|
14
|
+
label: string;
|
|
14
15
|
}
|
|
15
16
|
export declare const SelectField: (props: SelectFieldProps) => React.JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -12,7 +12,7 @@ const CheckBoxIndicator = (props) => {
|
|
|
12
12
|
React.createElement(FiCheckSquare, null)));
|
|
13
13
|
};
|
|
14
14
|
export const SelectField = (props) => {
|
|
15
|
-
const { handleChange, colorPalette, options, moreHorizon, values, type } = props;
|
|
15
|
+
const { handleChange, colorPalette, options, moreHorizon, values, type, label } = props;
|
|
16
16
|
const [open, setOpen] = useState(false);
|
|
17
17
|
const [selectedValues, setSelectedValues] = useState([]);
|
|
18
18
|
const [selectedId, setSelectedId] = useState(Array.isArray(selectedValues) && selectedValues.length === 1 ? selectedValues[0].id || "" : "");
|
|
@@ -52,10 +52,12 @@ export const SelectField = (props) => {
|
|
|
52
52
|
justifyContent: "end",
|
|
53
53
|
padding: "24px 24px 0px 24px",
|
|
54
54
|
} },
|
|
55
|
-
React.createElement(
|
|
55
|
+
React.createElement("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", width: "100%" } },
|
|
56
|
+
React.createElement("div", { style: { fontSize: "1.5rem", fontWeight: "700" } }, label),
|
|
57
|
+
React.createElement(FiX, { "data-test": "x", onClick: () => setOpen(!open), size: 24 }))),
|
|
56
58
|
React.createElement("div", { style: {
|
|
57
59
|
display: "flex",
|
|
58
|
-
padding: "
|
|
60
|
+
padding: "24px 24px 24px 24px",
|
|
59
61
|
overflow: "auto",
|
|
60
62
|
flexDirection: "column",
|
|
61
63
|
alignItems: "start",
|
|
@@ -72,7 +74,12 @@ export const SelectField = (props) => {
|
|
|
72
74
|
gap: "8px",
|
|
73
75
|
paddingBottom: "16px",
|
|
74
76
|
} },
|
|
75
|
-
React.createElement("input", { type: type, id: option.linkedId || option.id, defaultValue: option.value || "", checked: checked, onChange: handleChange, onClick: () => { onClick(option.linkedId || option.id); }
|
|
77
|
+
React.createElement("input", { type: type, id: option.linkedId || option.id, defaultValue: option.value || "", checked: checked, onChange: handleChange, onClick: () => { onClick(option.linkedId || option.id); }, style: {
|
|
78
|
+
width: '20px',
|
|
79
|
+
height: '20px',
|
|
80
|
+
transform: 'scale(1.5)', // Makes it 1.5x bigger
|
|
81
|
+
marginRight: '8px'
|
|
82
|
+
} }),
|
|
76
83
|
React.createElement("label", { htmlFor: option.label }, option.label)));
|
|
77
84
|
})))));
|
|
78
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.js","sourceRoot":"","sources":["../../../lib/Atoms/SelectField/SelectField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;AAIlE,MAAM,cAAc,GAAG,CAAC,KAA6B,EAAE,EAAE;IACrD,OAAO,CACH,oBAAC,UAAU,CAAC,iBAAiB,OAAK,KAAK;QACnC,oBAAC,aAAa,OAAG,CACU,CAClC,CAAC;AACN,CAAC,CAAC;AACF,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IACxD,OAAO,CACH,oBAAC,UAAU,CAAC,iBAAiB,OAAK,KAAK;QACnC,oBAAC,aAAa,OAAG,CACU,CAClC,CAAC;AACN,CAAC,CAAC;
|
|
1
|
+
{"version":3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/react";
|
|
|
3
3
|
import React, { useState, useMemo, useRef, useEffect } 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: 100%;
|
|
16
|
+
const NavMenu = styled.div `
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
20
|
+
width: 100%;
|
|
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};
|
|
30
|
-
width: 100%;
|
|
31
|
-
@media (max-width: 500px) {
|
|
32
|
-
justify-content: space-between;
|
|
33
|
-
flex-wrap: wrap;
|
|
34
|
-
align-items: center;
|
|
35
|
-
height: max-content;
|
|
36
|
-
}
|
|
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
|
+
width: 100%;
|
|
31
|
+
@media (max-width: 500px) {
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
align-items: center;
|
|
35
|
+
height: max-content;
|
|
36
|
+
}
|
|
37
37
|
`;
|
|
38
|
-
const NavContent = styled.div `
|
|
39
|
-
align-items: center;
|
|
40
|
-
gap: 16px;
|
|
41
|
-
padding-top: 16px;
|
|
42
|
-
padding-bottom: 16px;
|
|
43
|
-
|
|
44
|
-
@media (max-width: 500px) {
|
|
45
|
-
justify-content: flex-end;
|
|
46
|
-
align-items: center;
|
|
47
|
-
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
48
|
-
width: ${({ isWrapped }) => (isWrapped ? "100%" : "fit-content")};
|
|
49
|
-
border-top: ${({ isWrapped, colorPalette }) => isWrapped ? `1px solid ${colorPalette.background.secondary}` : "none"};
|
|
50
|
-
}
|
|
38
|
+
const NavContent = styled.div `
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 16px;
|
|
41
|
+
padding-top: 16px;
|
|
42
|
+
padding-bottom: 16px;
|
|
43
|
+
|
|
44
|
+
@media (max-width: 500px) {
|
|
45
|
+
justify-content: flex-end;
|
|
46
|
+
align-items: center;
|
|
47
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
48
|
+
width: ${({ isWrapped }) => (isWrapped ? "100%" : "fit-content")};
|
|
49
|
+
border-top: ${({ isWrapped, colorPalette }) => isWrapped ? `1px solid ${colorPalette.background.secondary}` : "none"};
|
|
50
|
+
}
|
|
51
51
|
`;
|
|
52
|
-
const OnlineStatus = styled.div `
|
|
53
|
-
display: flex;
|
|
54
|
-
padding: 8px 12px;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
align-items: center;
|
|
57
|
-
gap: 8px;
|
|
58
|
-
border-radius: 32px;
|
|
59
|
-
font-weight: 700;
|
|
60
|
-
border-width: 1px;
|
|
61
|
-
border-style: solid;
|
|
62
|
-
border-color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
63
|
-
color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
64
|
-
background: #ebfaed;
|
|
65
|
-
cursor: pointer;
|
|
52
|
+
const OnlineStatus = styled.div `
|
|
53
|
+
display: flex;
|
|
54
|
+
padding: 8px 12px;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 8px;
|
|
58
|
+
border-radius: 32px;
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
border-width: 1px;
|
|
61
|
+
border-style: solid;
|
|
62
|
+
border-color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
63
|
+
color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
64
|
+
background: #ebfaed;
|
|
65
|
+
cursor: pointer;
|
|
66
66
|
`;
|
|
67
|
-
const OfflineStatus = styled.div `
|
|
68
|
-
display: flex;
|
|
69
|
-
padding: 8px 12px;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
align-items: center;
|
|
72
|
-
gap: 8px;
|
|
73
|
-
border-radius: 32px;
|
|
74
|
-
font-weight: 700;
|
|
75
|
-
border-width: 1px;
|
|
76
|
-
border-style: solid;
|
|
77
|
-
border-color: ${({ colorPalette }) => colorPalette.utils.icon};
|
|
78
|
-
color: ${({ colorPalette }) => colorPalette.utils.icon};
|
|
79
|
-
cursor: pointer;
|
|
67
|
+
const OfflineStatus = styled.div `
|
|
68
|
+
display: flex;
|
|
69
|
+
padding: 8px 12px;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 8px;
|
|
73
|
+
border-radius: 32px;
|
|
74
|
+
font-weight: 700;
|
|
75
|
+
border-width: 1px;
|
|
76
|
+
border-style: solid;
|
|
77
|
+
border-color: ${({ colorPalette }) => colorPalette.utils.icon};
|
|
78
|
+
color: ${({ colorPalette }) => colorPalette.utils.icon};
|
|
79
|
+
cursor: pointer;
|
|
80
80
|
`;
|
|
81
|
-
const NavMenuDropdown = styled.div `
|
|
82
|
-
width: 320px;
|
|
83
|
-
position: absolute;
|
|
84
|
-
top: 88px;
|
|
85
|
-
z-index: 1000;
|
|
86
|
-
box-shadow: 5px 5px 5px rgba(64, 64, 64, 0.2);
|
|
87
|
-
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
88
|
-
animation: ${slideInLeft} 0.5s ease-out forwards;
|
|
89
|
-
display: ${({ navOpen }) => (navOpen ? "flex" : "none")};
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
&:focus {
|
|
92
|
-
outline: none;
|
|
93
|
-
}
|
|
81
|
+
const NavMenuDropdown = styled.div `
|
|
82
|
+
width: 320px;
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 88px;
|
|
85
|
+
z-index: 1000;
|
|
86
|
+
box-shadow: 5px 5px 5px rgba(64, 64, 64, 0.2);
|
|
87
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
88
|
+
animation: ${slideInLeft} 0.5s ease-out forwards;
|
|
89
|
+
display: ${({ navOpen }) => (navOpen ? "flex" : "none")};
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
&:focus {
|
|
92
|
+
outline: none;
|
|
93
|
+
}
|
|
94
94
|
`;
|
|
95
|
-
const MenuItems = styled.div `
|
|
96
|
-
align-items: flex-start;
|
|
97
|
-
align-self: stretch;
|
|
95
|
+
const MenuItems = styled.div `
|
|
96
|
+
align-items: flex-start;
|
|
97
|
+
align-self: stretch;
|
|
98
98
|
`;
|
|
99
|
-
const MenuItem = styled.div `
|
|
100
|
-
display: flex;
|
|
101
|
-
padding: 8px 16px;
|
|
102
|
-
align-items: center;
|
|
103
|
-
color: ${({ colorPalette }) => colorPalette.text.tertiary};
|
|
104
|
-
font-weight: 700;
|
|
105
|
-
border-width: 0 0 1px 0;
|
|
106
|
-
border-style: solid;
|
|
107
|
-
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
108
|
-
width: 288px;
|
|
109
|
-
cursor: pointer;
|
|
99
|
+
const MenuItem = styled.div `
|
|
100
|
+
display: flex;
|
|
101
|
+
padding: 8px 16px;
|
|
102
|
+
align-items: center;
|
|
103
|
+
color: ${({ colorPalette }) => colorPalette.text.tertiary};
|
|
104
|
+
font-weight: 700;
|
|
105
|
+
border-width: 0 0 1px 0;
|
|
106
|
+
border-style: solid;
|
|
107
|
+
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
108
|
+
width: 288px;
|
|
109
|
+
cursor: pointer;
|
|
110
110
|
`;
|
|
111
|
-
const Location = styled.div `
|
|
112
|
-
display: flex;
|
|
113
|
-
align-items: center;
|
|
114
|
-
gap: 10px;
|
|
115
|
-
flex: 1 0 0;
|
|
116
|
-
font-size: 16px;
|
|
117
|
-
line-height: 150%;
|
|
111
|
+
const Location = styled.div `
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
gap: 10px;
|
|
115
|
+
flex: 1 0 0;
|
|
116
|
+
font-size: 16px;
|
|
117
|
+
line-height: 150%;
|
|
118
118
|
`;
|
|
119
|
-
const Toggles = styled.div `
|
|
120
|
-
padding: 24px 0px;
|
|
119
|
+
const Toggles = styled.div `
|
|
120
|
+
padding: 24px 0px;
|
|
121
121
|
`;
|
|
122
|
-
const AppInfo = styled.div `
|
|
123
|
-
padding: 16px;
|
|
124
|
-
width: 288px;
|
|
125
|
-
background: ${({ colorPalette }) => colorPalette.background.tertiary};
|
|
122
|
+
const AppInfo = styled.div `
|
|
123
|
+
padding: 16px;
|
|
124
|
+
width: 288px;
|
|
125
|
+
background: ${({ colorPalette }) => colorPalette.background.tertiary};
|
|
126
126
|
`;
|
|
127
|
-
const LogoAndCopyRights = styled.div `
|
|
128
|
-
display: flex;
|
|
129
|
-
gap: 16px;
|
|
130
|
-
margin-bottom: 12px;
|
|
131
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
127
|
+
const LogoAndCopyRights = styled.div `
|
|
128
|
+
display: flex;
|
|
129
|
+
gap: 16px;
|
|
130
|
+
margin-bottom: 12px;
|
|
131
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
132
132
|
`;
|
|
133
|
-
const CopyRights = styled.div `
|
|
134
|
-
font-size: 12px;
|
|
135
|
-
font-style: normal;
|
|
136
|
-
font-weight: 400;
|
|
137
|
-
line-height: 55%;
|
|
133
|
+
const CopyRights = styled.div `
|
|
134
|
+
font-size: 12px;
|
|
135
|
+
font-style: normal;
|
|
136
|
+
font-weight: 400;
|
|
137
|
+
line-height: 55%;
|
|
138
138
|
`;
|
|
139
|
-
const Version = styled.div `
|
|
140
|
-
text-align: center;
|
|
141
|
-
font-size: 14px;
|
|
142
|
-
font-weight: 400;
|
|
143
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
139
|
+
const Version = styled.div `
|
|
140
|
+
text-align: center;
|
|
141
|
+
font-size: 14px;
|
|
142
|
+
font-weight: 400;
|
|
143
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
144
144
|
`;
|
|
145
145
|
const NavBar = (props) => {
|
|
146
146
|
const { colorPalette, locations, appInfo } = props;
|
|
@@ -13,6 +13,7 @@ export declare const StyledContent: import("@emotion/styled").StyledComponent<Di
|
|
|
13
13
|
} & {
|
|
14
14
|
colorPalette: Colors;
|
|
15
15
|
toast?: ToastVariant;
|
|
16
|
+
minimized?: boolean;
|
|
16
17
|
}, {}, {}>;
|
|
17
18
|
export declare const DialogContainer: import("@emotion/styled").StyledComponent<{
|
|
18
19
|
theme?: import("@emotion/react").Theme;
|
|
@@ -25,6 +26,8 @@ export declare const ModalTitleContainer: import("@emotion/styled").StyledCompon
|
|
|
25
26
|
export declare const ModalTitle: import("@emotion/styled").StyledComponent<{
|
|
26
27
|
theme?: import("@emotion/react").Theme;
|
|
27
28
|
as?: React.ElementType;
|
|
29
|
+
} & {
|
|
30
|
+
minimized?: boolean;
|
|
28
31
|
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
29
32
|
export declare const ModalHeading: import("@emotion/styled").StyledComponent<{
|
|
30
33
|
theme?: import("@emotion/react").Theme;
|
|
@@ -53,12 +56,16 @@ interface ModalProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDi
|
|
|
53
56
|
setOpen: (open: boolean) => void;
|
|
54
57
|
toast?: ToastVariant;
|
|
55
58
|
timeout?: number;
|
|
59
|
+
canMinimize?: boolean;
|
|
60
|
+
setMinimized?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
61
|
+
minimized?: boolean;
|
|
56
62
|
modal?: boolean;
|
|
57
63
|
}
|
|
58
64
|
export declare const Modal: (props: ModalProps) => React.JSX.Element;
|
|
59
65
|
interface ConfirmationModalProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
60
66
|
colorPalette: Colors;
|
|
61
67
|
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
68
|
+
setMinimized?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
62
69
|
confirmTitle: string | React.JSX.Element;
|
|
63
70
|
details: string | React.JSX.Element;
|
|
64
71
|
handleSubmit?: () => void;
|
|
@@ -66,6 +73,8 @@ interface ConfirmationModalProps extends React.DetailedHTMLProps<React.HTMLAttri
|
|
|
66
73
|
toast?: ToastVariant;
|
|
67
74
|
canClose?: boolean;
|
|
68
75
|
timeout?: number;
|
|
76
|
+
canMinimize?: boolean;
|
|
77
|
+
minimized?: boolean;
|
|
69
78
|
modal?: boolean;
|
|
70
79
|
confirmationText?: string;
|
|
71
80
|
}
|
|
@@ -4,105 +4,108 @@ 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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
${({
|
|
32
|
-
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
}
|
|
36
38
|
`;
|
|
37
|
-
export const DialogContainer = styled.div `
|
|
38
|
-
display: flex;
|
|
39
|
-
padding: 24px 24px 0px 24px;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
align-items: center;
|
|
42
|
-
gap: 16px;
|
|
43
|
-
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;
|
|
44
46
|
`;
|
|
45
|
-
export const ModalTitleContainer = styled.div `
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
align-items: center;
|
|
49
|
-
width: 100%;
|
|
47
|
+
export const ModalTitleContainer = styled.div `
|
|
48
|
+
display: flex;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
align-items: center;
|
|
51
|
+
width: 100%;
|
|
50
52
|
`;
|
|
51
|
-
export const ModalTitle = styled.div `
|
|
52
|
-
font-size: 24px;
|
|
53
|
-
font-style: normal;
|
|
54
|
-
font-weight: 600;
|
|
55
|
-
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%;
|
|
56
58
|
`;
|
|
57
|
-
export const ModalHeading = styled.div `
|
|
58
|
-
font-size: 16px;
|
|
59
|
-
font-style: normal;
|
|
60
|
-
font-weight: 700;
|
|
61
|
-
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%;
|
|
62
64
|
`;
|
|
63
|
-
export const ModelSubHeading = styled.div `
|
|
64
|
-
font-size: 16px;
|
|
65
|
-
font-style: normal;
|
|
66
|
-
font-weight: 400;
|
|
67
|
-
line-height: 24px; /* 150% */
|
|
68
|
-
letter-spacing: 0.16px;
|
|
69
|
-
width: 100%;
|
|
70
|
-
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;
|
|
71
73
|
`;
|
|
72
|
-
export const ModalFooter = styled.div `
|
|
73
|
-
display: flex;
|
|
74
|
-
padding: 24px 16px;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
align-items: center;
|
|
77
|
-
gap: 16px;
|
|
78
|
-
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;
|
|
79
81
|
`;
|
|
80
|
-
export const ModalInputBox = styled.div `
|
|
81
|
-
display: flex;
|
|
82
|
-
width: 322px;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
justify-content: center;
|
|
85
|
-
align-items: flex-start;
|
|
86
|
-
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;
|
|
87
89
|
`;
|
|
88
|
-
export const ConfirmationInput = styled.input `
|
|
89
|
-
display: flex;
|
|
90
|
-
width: 275px;
|
|
91
|
-
flex-direction: column;
|
|
92
|
-
align-items: flex-start;
|
|
93
|
-
gap: 8px;
|
|
94
|
-
height: 40px;
|
|
95
|
-
padding: 8px 16px;
|
|
96
|
-
justify-content: center;
|
|
97
|
-
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;
|
|
98
100
|
`;
|
|
99
101
|
export const Modal = (props) => {
|
|
100
|
-
const { open, children, colorPalette, setOpen, toast, timeout, modal, ...htmlProps } = props;
|
|
102
|
+
const { open, children, colorPalette, setOpen, toast, timeout, canMinimize, setMinimized, minimized, modal, ...htmlProps } = props;
|
|
101
103
|
useEffect(() => {
|
|
102
104
|
let timer;
|
|
103
105
|
if (open && toast && timeout) {
|
|
104
106
|
timer = setTimeout(() => {
|
|
105
107
|
setOpen(false);
|
|
108
|
+
setMinimized && setMinimized(false);
|
|
106
109
|
}, timeout);
|
|
107
110
|
}
|
|
108
111
|
return () => {
|
|
@@ -110,7 +113,7 @@ export const Modal = (props) => {
|
|
|
110
113
|
clearTimeout(timer);
|
|
111
114
|
}
|
|
112
115
|
};
|
|
113
|
-
}, [open]);
|
|
116
|
+
}, [open, minimized]);
|
|
114
117
|
return (React.createElement(Dialog.Root, { open: open, modal: modal ? true : modal },
|
|
115
118
|
React.createElement(Dialog.Portal, null,
|
|
116
119
|
React.createElement(Dialog.Title, null),
|
|
@@ -118,15 +121,16 @@ export const Modal = (props) => {
|
|
|
118
121
|
React.createElement(StyledContent, { ...htmlProps, colorPalette: colorPalette, onInteractOutside: () => {
|
|
119
122
|
if (toast)
|
|
120
123
|
setOpen(true);
|
|
121
|
-
}, onPointerDownOutside: () => setOpen(false), onClick: () =>
|
|
124
|
+
}, onPointerDownOutside: () => setOpen(false), onClick: () => canMinimize && setMinimized && setMinimized(!minimized), toast: toast, minimized: minimized }, children))));
|
|
122
125
|
};
|
|
123
126
|
export const ConfirmationModal = (props) => {
|
|
124
|
-
const { colorPalette, setOpen, confirmTitle, details, handleSubmit, open, toast, canClose, timeout, modal, confirmationText, ...htmlProps } = props;
|
|
127
|
+
const { colorPalette, setOpen, confirmTitle, details, handleSubmit, open, toast, canClose, timeout, canMinimize, setMinimized, minimized, modal, confirmationText, ...htmlProps } = props;
|
|
125
128
|
const [confirmationInputValue, setConfirmationInputValue] = useState("");
|
|
126
|
-
|
|
129
|
+
// The modal...
|
|
130
|
+
return (React.createElement(Modal, { colorPalette: colorPalette, open: open, setOpen: setOpen, ...htmlProps, toast: toast, timeout: timeout, canMinimize: canMinimize, setMinimized: setMinimized, minimized: minimized, modal: modal },
|
|
127
131
|
React.createElement(DialogContainer, { ...(toast ? { style: { padding: "24px" } } : {}) },
|
|
128
132
|
React.createElement(ModalTitleContainer, null,
|
|
129
|
-
React.createElement(ModalTitle,
|
|
133
|
+
React.createElement(ModalTitle, { minimized: minimized }, confirmTitle),
|
|
130
134
|
canClose && React.createElement(FiX, { onClick: () => setOpen(false), size: 24 })),
|
|
131
135
|
React.createElement(ModelSubHeading, null, details),
|
|
132
136
|
confirmationText && (React.createElement(ConfirmationInput, { type: "text", placeholder: `Type ${confirmationText} to confirm this action...`, value: confirmationInputValue, onChange: (e) => setConfirmationInputValue(e.target.value), "aria-label": `Confirmation input: Type ${confirmationText} to confirm this action` })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../lib/Organisms/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,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;AASlC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAGhD;GACC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../lib/Organisms/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,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;AASlC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAGhD;GACC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE,CACvB,C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H,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAC,aAAa,EACrB,KAAK,EAAC,QAAQ,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAC/B,CACQ,CACjB,CACa,CACd,CACX,CAAC;AACN,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,8 +30,8 @@ export * from "./Organisms/Card/Card";
|
|
|
30
30
|
export * from "./Organisms/EditUserPerms/EditUserPerms";
|
|
31
31
|
export * from "./Organisms/ErrorSplash/ErrorSplash";
|
|
32
32
|
export * from "./Organisms/Modal/Modal";
|
|
33
|
-
export * from "./Organisms/TabManager/TabManager";
|
|
34
33
|
export * from "./Organisms/Table/Table";
|
|
34
|
+
export * from "./Organisms/TabManager/TabManager";
|
|
35
35
|
export * from "./Organisms/Tutorial/Tutorial";
|
|
36
36
|
export * from "./Theme/ThemeProvider";
|
|
37
37
|
export * from "./Theme/types";
|
package/dist/index.js
CHANGED
|
@@ -31,8 +31,8 @@ export * from "./Organisms/Card/Card";
|
|
|
31
31
|
export * from "./Organisms/EditUserPerms/EditUserPerms";
|
|
32
32
|
export * from "./Organisms/ErrorSplash/ErrorSplash";
|
|
33
33
|
export * from "./Organisms/Modal/Modal";
|
|
34
|
-
export * from "./Organisms/TabManager/TabManager";
|
|
35
34
|
export * from "./Organisms/Table/Table";
|
|
35
|
+
export * from "./Organisms/TabManager/TabManager";
|
|
36
36
|
export * from "./Organisms/Tutorial/Tutorial";
|
|
37
37
|
export * from "./Theme/ThemeProvider";
|
|
38
38
|
export * from "./Theme/types";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,k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C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factorearth/component-library",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.3",
|
|
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"access": "public",
|
|
48
48
|
"registry": "https://registry.npmjs.org/"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "236e8131ebcfd8d5d2166e3699b641114a000f47",
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@emotion/react": "^11.13.0",
|
|
53
53
|
"@emotion/styled": "^11.13.0",
|