@factorearth/component-library 3.3.13-alpha.0 → 3.5.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/README.md +11 -11
- package/dist/Atoms/Buttons/Button.d.ts +1 -1
- package/dist/Atoms/Buttons/Button.js +17 -17
- package/dist/Atoms/Buttons/Button.js.map +1 -1
- package/dist/Atoms/DateField/DateField.d.ts +1 -1
- package/dist/Atoms/DateField/DateField.js +94 -94
- package/dist/Atoms/DateField/DateField.js.map +1 -1
- package/dist/Atoms/DropdownField/DropdownField.d.ts +1 -1
- package/dist/Atoms/FieldWrapper/FieldWrapper.js +21 -21
- package/dist/Atoms/MoreHorizonButton/MoreHorizonButton.js +52 -52
- package/dist/Atoms/NoteField/NoteField.js +38 -38
- package/dist/Atoms/NumberField/NumberField.d.ts +1 -1
- package/dist/Atoms/NumberField/NumberField.js +63 -63
- package/dist/Atoms/NumberField/NumberField.js.map +1 -1
- package/dist/Atoms/Pagination/Pagination.js +26 -26
- package/dist/Atoms/PhoneNumberField/PhoneNumberField.d.ts +1 -1
- package/dist/Atoms/PhoneNumberField/PhoneNumberField.js +6 -8
- package/dist/Atoms/PhoneNumberField/PhoneNumberField.js.map +1 -1
- package/dist/Atoms/SelectField/SelectField.d.ts +1 -1
- package/dist/Atoms/SelectField/SelectField.js +14 -1
- package/dist/Atoms/SelectField/SelectField.js.map +1 -1
- package/dist/Atoms/SortDropdown/SortDropdown.js +39 -39
- package/dist/Atoms/TextField/TextField.d.ts +1 -1
- package/dist/Atoms/TextField/TextField.js +20 -23
- package/dist/Atoms/TextField/TextField.js.map +1 -1
- package/dist/Atoms/Toggle/Toggle.d.ts +13 -0
- package/dist/Atoms/Toggle/Toggle.js +59 -0
- package/dist/Atoms/Toggle/Toggle.js.map +1 -0
- package/dist/Molecules/NavMenu/NavMenu.d.ts +38 -0
- package/dist/Molecules/NavMenu/NavMenu.js +178 -0
- package/dist/Molecules/NavMenu/NavMenu.js.map +1 -0
- package/dist/Molecules/Thumbnail/Thumbnail.d.ts +1 -1
- package/dist/Molecules/Thumbnail/Thumbnail.js +51 -51
- package/dist/Molecules/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/Organisms/Card/Card.d.ts +1 -1
- package/dist/Organisms/Card/Card.js +36 -36
- package/dist/Organisms/Card/Card.js.map +1 -1
- package/dist/Organisms/Modal/Modal.d.ts +2 -2
- package/dist/Organisms/Modal/Modal.js +68 -68
- package/dist/Organisms/Modal/Modal.js.map +1 -1
- package/dist/Theme/ThemeProvider.js +15 -43
- package/dist/Theme/ThemeProvider.js.map +1 -1
- package/dist/Theme/tokens.json +105 -36
- package/dist/Theme/types.d.ts +2 -22
- package/dist/index.d.ts +2 -5
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/Atoms/ContentDropdown/ContentDropdown.d.ts +0 -11
- package/dist/Atoms/ContentDropdown/ContentDropdown.js +0 -37
- package/dist/Atoms/ContentDropdown/ContentDropdown.js.map +0 -1
- package/dist/Atoms/Tab/Tab.d.ts +0 -10
- package/dist/Atoms/Tab/Tab.js +0 -26
- package/dist/Atoms/Tab/Tab.js.map +0 -1
- package/dist/Molecules/Form/Form.d.ts +0 -14
- package/dist/Molecules/Form/Form.js +0 -16
- package/dist/Molecules/Form/Form.js.map +0 -1
- package/dist/Organisms/TabManager/TabManager.d.ts +0 -9
- package/dist/Organisms/TabManager/TabManager.js +0 -46
- package/dist/Organisms/TabManager/TabManager.js.map +0 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import React, { useState, useMemo } from 'react';
|
|
3
|
+
import { FiMenu, FiCloud, FiCloudOff, FiSun, FiMoon, FiChevronRight, FiX } from "react-icons/fi";
|
|
4
|
+
import Toggle from "../../Atoms/Toggle/Toggle";
|
|
5
|
+
import { DropdownSelect } from "../../Atoms/DropdownField/DropdownField";
|
|
6
|
+
const NavMenu = styled.div `
|
|
7
|
+
display: flex;
|
|
8
|
+
width: 320px;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
11
|
+
`;
|
|
12
|
+
const NavBarHeader = styled.div `
|
|
13
|
+
display: flex;
|
|
14
|
+
padding: 24px 0px 24px 24px;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 16px;
|
|
17
|
+
border-width: 0 0 1px 0;
|
|
18
|
+
border-style: solid;
|
|
19
|
+
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
20
|
+
`;
|
|
21
|
+
const OnlineStatus = styled.div `
|
|
22
|
+
display: flex;
|
|
23
|
+
padding: 8px 12px;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
border-radius: 32px;
|
|
28
|
+
font-weight: 700;
|
|
29
|
+
border-width: 1px;
|
|
30
|
+
border-style: solid;
|
|
31
|
+
border-color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
32
|
+
color: ${({ colorPalette }) => colorPalette.buttonBackground.success};
|
|
33
|
+
background: #EBFAED;
|
|
34
|
+
`;
|
|
35
|
+
const OfflineStatus = styled.div `
|
|
36
|
+
display: flex;
|
|
37
|
+
padding: 8px 12px;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 8px;
|
|
41
|
+
border-radius: 32px;
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
border-width: 1px;
|
|
44
|
+
border-style: solid;
|
|
45
|
+
border-color: ${({ colorPalette }) => colorPalette.text.secondary};
|
|
46
|
+
color: ${({ colorPalette }) => colorPalette.text.secondary};
|
|
47
|
+
`;
|
|
48
|
+
const DropdownContainer = styled.div `
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
align-self: stretch;
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
font-weight: 700;
|
|
55
|
+
line-height: 21px;
|
|
56
|
+
padding: 0 16px 24px;
|
|
57
|
+
border-width: 0 0 1px 0;
|
|
58
|
+
border-style: solid;
|
|
59
|
+
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
60
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
61
|
+
`;
|
|
62
|
+
const MenuItems = styled.div `
|
|
63
|
+
align-items: flex-start;
|
|
64
|
+
align-self: stretch;
|
|
65
|
+
`;
|
|
66
|
+
const MenuItem = styled.div `
|
|
67
|
+
display: flex;
|
|
68
|
+
padding: 8px 16px;
|
|
69
|
+
align-items: center;
|
|
70
|
+
color: ${({ colorPalette }) => colorPalette.text.tertiary};
|
|
71
|
+
font-weight: 700;
|
|
72
|
+
border-width: 0 0 1px 0;
|
|
73
|
+
border-style: solid;
|
|
74
|
+
border-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
75
|
+
width: 288px;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
`;
|
|
78
|
+
const Location = styled.div `
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: 10px;
|
|
82
|
+
flex: 1 0 0;
|
|
83
|
+
font-size: 16px;
|
|
84
|
+
line-height: 150%;
|
|
85
|
+
`;
|
|
86
|
+
const Toggles = styled.div `
|
|
87
|
+
padding: 24px 0px;
|
|
88
|
+
`;
|
|
89
|
+
const AppInfo = styled.div `
|
|
90
|
+
padding: 16px;
|
|
91
|
+
width: 288px;
|
|
92
|
+
background: ${({ colorPalette }) => colorPalette.background.tertiary};
|
|
93
|
+
`;
|
|
94
|
+
const LogoAndCopyRights = styled.div `
|
|
95
|
+
display: flex;
|
|
96
|
+
gap: 16px;
|
|
97
|
+
margin-bottom: 12px;
|
|
98
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
99
|
+
`;
|
|
100
|
+
const CopyRights = styled.div `
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
font-style: normal;
|
|
103
|
+
font-weight: 400;
|
|
104
|
+
line-height: 55%;
|
|
105
|
+
`;
|
|
106
|
+
const Version = styled.div `
|
|
107
|
+
text-align: center;
|
|
108
|
+
font-size: 14px;
|
|
109
|
+
font-weight: 400;
|
|
110
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
111
|
+
`;
|
|
112
|
+
const NavBar = (props) => {
|
|
113
|
+
const { colorPalette, locations, appInfo } = props;
|
|
114
|
+
const [navOpen, setNavOpen] = useState(false);
|
|
115
|
+
const locationsList = useMemo(() => {
|
|
116
|
+
const buildNavElements = (locations) => {
|
|
117
|
+
const locationsJsx = locations.map(location => {
|
|
118
|
+
return (React.createElement(MenuItem, { colorPalette: colorPalette, onClick: location.onClick, key: location.name },
|
|
119
|
+
React.createElement(Location, null,
|
|
120
|
+
location?.icon,
|
|
121
|
+
location.name),
|
|
122
|
+
React.createElement(FiChevronRight, null)));
|
|
123
|
+
});
|
|
124
|
+
return locationsJsx;
|
|
125
|
+
};
|
|
126
|
+
return buildNavElements(locations);
|
|
127
|
+
}, [locations, colorPalette]);
|
|
128
|
+
return (React.createElement(NavMenu, { colorPalette: colorPalette },
|
|
129
|
+
React.createElement(NavBarHeader, { colorPalette: colorPalette },
|
|
130
|
+
React.createElement("div", { style: { cursor: "pointer" }, id: "Navigation", onClick: () => { setNavOpen(!navOpen); } }, navOpen ? React.createElement(FiX, { size: 24, color: colorPalette.text.primary }) : React.createElement(FiMenu, { size: 24, color: colorPalette.text.primary })),
|
|
131
|
+
appInfo.headerLogo && React.createElement("img", { src: appInfo.headerLogo, alt: "FactoEarth Logo", style: { width: "40px", cursor: "pointer" } }),
|
|
132
|
+
appInfo.offlineCapabale && (appInfo.online ? React.createElement(OnlineStatus, { colorPalette: colorPalette },
|
|
133
|
+
React.createElement(FiCloud, null),
|
|
134
|
+
"Online") : React.createElement(OfflineStatus, { colorPalette: colorPalette },
|
|
135
|
+
React.createElement(FiCloudOff, null),
|
|
136
|
+
"Offline"))),
|
|
137
|
+
navOpen && (React.createElement("div", { style: { boxShadow: "5px 5px 5px rgba(64, 64, 64, 0.2)" } },
|
|
138
|
+
appInfo.dropdown && React.createElement(DropdownContainer, { colorPalette: colorPalette },
|
|
139
|
+
React.createElement("p", null, "Projects"),
|
|
140
|
+
React.createElement(DropdownSelect, { colorPalette: colorPalette, onChange: (e) => {
|
|
141
|
+
appInfo.setSelectedProject(e);
|
|
142
|
+
}, options: appInfo.dropdownOptions, isMulti: false, isSearchable: true, menuPortalTarget: document.body, value: appInfo.selectedProject, id: "page-size", name: "page-size", menuPlacement: "auto" })),
|
|
143
|
+
React.createElement(MenuItems, null, locationsList),
|
|
144
|
+
React.createElement(Toggles, { className: "toggles" },
|
|
145
|
+
appInfo.offlineCapabale && React.createElement(Toggle, { colorPalette: colorPalette, modes: [
|
|
146
|
+
{
|
|
147
|
+
mode: "Offline",
|
|
148
|
+
icon: React.createElement(FiCloudOff, null)
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
mode: "Online",
|
|
152
|
+
icon: React.createElement(FiCloud, null)
|
|
153
|
+
}
|
|
154
|
+
], setState: appInfo.setOnline }),
|
|
155
|
+
React.createElement(Toggle, { colorPalette: colorPalette, modes: [
|
|
156
|
+
{
|
|
157
|
+
mode: "Light",
|
|
158
|
+
icon: React.createElement(FiSun, null)
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
mode: "Dark",
|
|
162
|
+
icon: React.createElement(FiMoon, null)
|
|
163
|
+
}
|
|
164
|
+
], setState: appInfo.setTheme })),
|
|
165
|
+
React.createElement("div", null,
|
|
166
|
+
React.createElement(AppInfo, { colorPalette: colorPalette },
|
|
167
|
+
React.createElement(LogoAndCopyRights, { colorPalette: colorPalette },
|
|
168
|
+
appInfo.menuLogo && React.createElement("img", { src: colorPalette.theme === "light" ? appInfo.menuLogo : appInfo.menuLogoDark, alt: "FactoEarth Logo", style: { width: "100px", height: "42.577px" } }),
|
|
169
|
+
appInfo.copyRight && React.createElement(CopyRights, null,
|
|
170
|
+
React.createElement("p", null, appInfo.copyRight),
|
|
171
|
+
React.createElement("p", null, "All Rights Reserved."))),
|
|
172
|
+
React.createElement(Version, { colorPalette: colorPalette },
|
|
173
|
+
appInfo.name,
|
|
174
|
+
" ",
|
|
175
|
+
appInfo.versionNum)))))));
|
|
176
|
+
};
|
|
177
|
+
export default NavBar;
|
|
178
|
+
//# sourceMappingURL=NavMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavMenu.js","sourceRoot":"","sources":["../../../lib/Molecules/NavMenu/NavMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,MAAM,MAAM,2BAA2B,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AAgCxE,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAA0B;;;;gBAIpC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO;CACpE,CAAC;AAGF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA0B;;;;;;;kBAOvC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS;CACxE,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA0B;;;;;;;;;;kBAUvC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO;WAClE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO;;CAErE,CAAA;AA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AM,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode, Dispatch, SetStateAction } from "react";
|
|
2
2
|
import { Colors } from "Theme/types";
|
|
3
3
|
export declare const Thumbnail: ({ colorPalette, handleSubmit, settingsChildren, showImage, setShowImage, fieldInstance, s3Key, signedUrl, uploadButtonText, handleRemove, changed, handleChange, }: {
|
|
4
|
-
colorPalette: Colors;
|
|
4
|
+
colorPalette: Colors & string;
|
|
5
5
|
handleSubmit: (newValueData: {
|
|
6
6
|
target: {
|
|
7
7
|
name: string;
|
|
@@ -2,56 +2,56 @@ import React, { useState, useRef, useEffect, } from "react";
|
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
3
|
import { FiTrash2, FiEye, FiEyeOff, FiSettings } from "react-icons/fi";
|
|
4
4
|
import { Button } from "../../Atoms/Buttons/Button";
|
|
5
|
-
const Container = styled.div `
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
align-items: end;
|
|
9
|
-
justify-content: start;
|
|
10
|
-
gap: 16px;
|
|
11
|
-
flex-shrink: 0;
|
|
12
|
-
background-color: ${({
|
|
13
|
-
${({ showImage, showSettings }) => showImage && `height: 278px; width: 200px`}
|
|
5
|
+
const Container = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: end;
|
|
9
|
+
justify-content: start;
|
|
10
|
+
gap: 16px;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
background-color: ${({ color }) => color.background.primary};
|
|
13
|
+
${({ showImage, showSettings }) => showImage && `height: 278px; width: 200px`}
|
|
14
14
|
`;
|
|
15
|
-
const InputArea = styled.div `
|
|
16
|
-
width: 150px;
|
|
17
|
-
height: 132px;
|
|
18
|
-
display: flex;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
align-items: center;
|
|
21
|
-
background-color: ${({
|
|
22
|
-
border-style: solid;
|
|
23
|
-
border-width: 1px;
|
|
24
|
-
border-color: ${({
|
|
25
|
-
position: relative;
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
padding: 24px;
|
|
15
|
+
const InputArea = styled.div `
|
|
16
|
+
width: 150px;
|
|
17
|
+
height: 132px;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
background-color: ${({ color }) => color.background.tertiary};
|
|
22
|
+
border-style: solid;
|
|
23
|
+
border-width: 1px;
|
|
24
|
+
border-color: ${({ color }) => color.border.primary};
|
|
25
|
+
position: relative;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
border-radius: 4px;
|
|
29
|
+
padding: 24px;
|
|
30
30
|
`;
|
|
31
|
-
const SettingsArea = styled.div `
|
|
32
|
-
width: 168px;
|
|
33
|
-
height: 148px;
|
|
34
|
-
display: flex;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
align-items: center;
|
|
37
|
-
background-color: ${({
|
|
38
|
-
border-style: solid;
|
|
39
|
-
border-width: 1px;
|
|
40
|
-
border-color: ${({
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
border-radius: 4px;
|
|
44
|
-
gap: 16px;
|
|
45
|
-
padding: 16px;
|
|
31
|
+
const SettingsArea = styled.div `
|
|
32
|
+
width: 168px;
|
|
33
|
+
height: 148px;
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
background-color: ${({ color }) => color.background.secondary};
|
|
38
|
+
border-style: solid;
|
|
39
|
+
border-width: 1px;
|
|
40
|
+
border-color: ${({ color }) => color.border.primary};
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
border-radius: 4px;
|
|
44
|
+
gap: 16px;
|
|
45
|
+
padding: 16px;
|
|
46
46
|
`;
|
|
47
|
-
const PreviewImage = styled.img `
|
|
48
|
-
width: 100%;
|
|
49
|
-
height: 100%;
|
|
50
|
-
object-fit: cover;
|
|
51
|
-
position: absolute;
|
|
52
|
-
top: 0;
|
|
53
|
-
left: 0;
|
|
54
|
-
z-index: 1;
|
|
47
|
+
const PreviewImage = styled.img `
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
object-fit: cover;
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 0;
|
|
53
|
+
left: 0;
|
|
54
|
+
z-index: 1;
|
|
55
55
|
`;
|
|
56
56
|
export const Thumbnail = ({ colorPalette, handleSubmit, settingsChildren, showImage, setShowImage, fieldInstance, s3Key, signedUrl, uploadButtonText, handleRemove, changed, handleChange, }) => {
|
|
57
57
|
const [selectedImage, setSelectedImage] = useState(null);
|
|
@@ -112,17 +112,17 @@ export const Thumbnail = ({ colorPalette, handleSubmit, settingsChildren, showIm
|
|
|
112
112
|
const handleToggleSettings = () => {
|
|
113
113
|
setShowSettings(!showSettings);
|
|
114
114
|
};
|
|
115
|
-
return (React.createElement(Container, {
|
|
115
|
+
return (React.createElement(Container, { color: colorPalette, showImage: showImage, showSettings: showSettings, key: `thumbnail_${fieldInstance.id}` },
|
|
116
116
|
React.createElement("div", { style: { display: "flex" } },
|
|
117
117
|
React.createElement(Button, { colorPalette: colorPalette, icon: !showImage ? React.createElement(FiEye, null) : React.createElement(FiEyeOff, null), variant: "outlined", onClick: handleToggleImage, "aria-label": !showImage ? "show-image" : "hide-image" }),
|
|
118
118
|
showImage && selectedImage && (React.createElement(React.Fragment, null,
|
|
119
119
|
React.createElement(Button, { colorPalette: colorPalette, icon: React.createElement(FiSettings, null), variant: "outlined", style: { borderColor: "transparent" }, onClick: handleToggleSettings }),
|
|
120
120
|
handleRemove && (React.createElement(Button, { colorPalette: colorPalette, icon: React.createElement(FiTrash2, null), variant: "destructive", onClick: handleRemove }))))),
|
|
121
|
-
showImage && !showSettings && (React.createElement(InputArea, { onDrop: handleDrop, onDragOver: handleDragOver,
|
|
122
|
-
selectedImage && (React.createElement(PreviewImage, { alt: s3Key || "Uploaded Image", src: selectedImage })),
|
|
121
|
+
showImage && !showSettings && (React.createElement(InputArea, { onDrop: handleDrop, onDragOver: handleDragOver, color: colorPalette },
|
|
122
|
+
selectedImage && (React.createElement(PreviewImage, { alt: s3Key || "Uploaded Image", color: colorPalette, src: selectedImage })),
|
|
123
123
|
React.createElement(Button, { colorPalette: colorPalette, label: "Browse", variant: "filled", onClick: handleBrowseClick },
|
|
124
124
|
React.createElement("input", { type: "file", name: "key", accept: acceptedFileTypes.join(","), onChange: handleImageUpload, ref: inputRef, id: `upload-image-${fieldInstance.id}`, multiple: false, style: { display: "none" } })))),
|
|
125
|
-
showSettings && showImage && (React.createElement(SettingsArea, {
|
|
125
|
+
showSettings && showImage && (React.createElement(SettingsArea, { color: colorPalette }, settingsChildren)),
|
|
126
126
|
changed && (React.createElement(Button, { colorPalette: colorPalette, onClick: handleSubmit, variant: "filled", style: { margin: "0 auto" } }, uploadButtonText))));
|
|
127
127
|
};
|
|
128
128
|
//# sourceMappingURL=Thumbnail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thumbnail.js","sourceRoot":"","sources":["../../../lib/Molecules/Thumbnail/Thumbnail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACb,QAAQ,EAER,MAAM,EAGN,SAAS,GACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAI1B;;;;;;;qBAOmB,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Thumbnail.js","sourceRoot":"","sources":["../../../lib/Molecules/Thumbnail/Thumbnail.tsx"],"names":[],"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AM,EACX,IAAI,EAAC,KAAK,EACV,MAAM,EAAE,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,EACnC,QAAQ,EAAE,iBAAiB,EAC3B,GAAG,EAAE,QAAQ,EACb,EAAE,EAAE,gBAAgB,aAAa,CAAC,EAAE,EAAE,EACtC,QAAQ,EAAE,KAAK,EACf,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAG,GAC1B,CACM,CACE,CACZ;QACA,YAAY,IAAI,SAAS,IAAI,CAC7B,oBAAC,YAAY,IAAC,KAAK,EAAE,YAAY,IAAG,gBAAgB,CAAgB,CACpE;QACA,OAAO,IAAI,CACX,oBAAC,MAAM,IACN,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,YAAmB,EAC5B,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAE1B,gBAAgB,CACT,CACT,CACU,CACZ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Colors } from "../../Theme/types";
|
|
3
3
|
interface CardProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
4
|
-
colorPalette: Colors;
|
|
4
|
+
colorPalette: Colors & string;
|
|
5
5
|
thumbnail: JSX.Element;
|
|
6
6
|
thumbnailSectionFields: React.ReactNode[] | JSX.Element[];
|
|
7
7
|
remainingFields: React.ReactNode[] | JSX.Element[];
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
-
const CardContainer = styled.div `
|
|
4
|
-
padding: 24px;
|
|
5
|
-
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
6
|
-
border-width: 0.5px;
|
|
7
|
-
border-style: solid;
|
|
8
|
-
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
9
|
-
border-right: none;
|
|
10
|
-
border-left: none;
|
|
3
|
+
const CardContainer = styled.div `
|
|
4
|
+
padding: 24px;
|
|
5
|
+
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
6
|
+
border-width: 0.5px;
|
|
7
|
+
border-style: solid;
|
|
8
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
9
|
+
border-right: none;
|
|
10
|
+
border-left: none;
|
|
11
11
|
`;
|
|
12
|
-
const FieldsXThumbnailSection = styled.section `
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
flex-direction: row-reverse;
|
|
16
|
-
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
17
|
-
@media (max-width: 600px) {
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
align-items: flex-end;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
:has(div > div[aria-label="show-image"]) {
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
}
|
|
12
|
+
const FieldsXThumbnailSection = styled.section `
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
flex-direction: row-reverse;
|
|
16
|
+
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
17
|
+
@media (max-width: 600px) {
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: flex-end;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:has(div > div[aria-label="show-image"]) {
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
}
|
|
25
25
|
`;
|
|
26
|
-
const ThumbnailSectionFields = styled.section `
|
|
27
|
-
padding: 16px 24px 0px 0px;
|
|
28
|
-
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
width: 100%;
|
|
33
|
-
@media (max-width: 600px) {
|
|
34
|
-
padding: 16px 0px 0px 24px;
|
|
35
|
-
}
|
|
26
|
+
const ThumbnailSectionFields = styled.section `
|
|
27
|
+
padding: 16px 24px 0px 0px;
|
|
28
|
+
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
width: 100%;
|
|
33
|
+
@media (max-width: 600px) {
|
|
34
|
+
padding: 16px 0px 0px 24px;
|
|
35
|
+
}
|
|
36
36
|
`;
|
|
37
|
-
const ButtonContainer = styled.div `
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: flex-end;
|
|
40
|
-
gap: 24px;
|
|
41
|
-
padding-top: 24px;
|
|
37
|
+
const ButtonContainer = styled.div `
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
gap: 24px;
|
|
41
|
+
padding-top: 24px;
|
|
42
42
|
`;
|
|
43
43
|
export const Card = forwardRef((props, ref) => {
|
|
44
44
|
const { colorPalette, thumbnail, thumbnailSectionFields, remainingFields, buttons, } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../lib/Organisms/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../lib/Organisms/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAA0B;;qBAErC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO;;;iBAGzD,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,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ledComponent<{
|
|
|
42
42
|
interface ModalProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
43
43
|
open: boolean;
|
|
44
44
|
children: React.ReactNode;
|
|
45
|
-
colorPalette: Colors;
|
|
45
|
+
colorPalette: Colors & string;
|
|
46
46
|
setOpen: (open: boolean) => void;
|
|
47
47
|
}
|
|
48
48
|
export declare const Modal: (props: ModalProps) => React.JSX.Element;
|
|
49
49
|
interface ConfirmationModalProps {
|
|
50
|
-
colorPalette: Colors;
|
|
50
|
+
colorPalette: Colors & string;
|
|
51
51
|
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
52
52
|
confirmTitle: string;
|
|
53
53
|
confirmText: string;
|
|
@@ -3,82 +3,82 @@ 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
|
-
export const StyledDialog = styled(Dialog.Overlay) `
|
|
7
|
-
background-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
8
|
-
opacity: 0.8;
|
|
9
|
-
position: absolute;
|
|
10
|
-
inset: 0;
|
|
11
|
-
animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
12
|
-
z-index: 1000;
|
|
6
|
+
export const StyledDialog = styled(Dialog.Overlay) `
|
|
7
|
+
background-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
8
|
+
opacity: 0.8;
|
|
9
|
+
position: absolute;
|
|
10
|
+
inset: 0;
|
|
11
|
+
animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
12
|
+
z-index: 1000;
|
|
13
13
|
`;
|
|
14
|
-
export const StyledContent = styled(Dialog.Content) `
|
|
15
|
-
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
16
|
-
box-shadow: ${({ colorPalette }) => `${colorPalette.background.secondary} 0px 5px 15px`};
|
|
17
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
18
|
-
border-radius: 4px;
|
|
19
|
-
position: fixed;
|
|
20
|
-
top: 50%;
|
|
21
|
-
left: 50%;
|
|
22
|
-
transform: translate(-50%, -50%);
|
|
23
|
-
max-height: 85vh;
|
|
24
|
-
animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
25
|
-
z-index: 1000;
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
min-width: 300px;
|
|
29
|
-
gap: 16px;
|
|
30
|
-
:focus {
|
|
31
|
-
outline: none;
|
|
32
|
-
}
|
|
14
|
+
export const StyledContent = styled(Dialog.Content) `
|
|
15
|
+
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
16
|
+
box-shadow: ${({ colorPalette }) => `${colorPalette.background.secondary} 0px 5px 15px`};
|
|
17
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
position: fixed;
|
|
20
|
+
top: 50%;
|
|
21
|
+
left: 50%;
|
|
22
|
+
transform: translate(-50%, -50%);
|
|
23
|
+
max-height: 85vh;
|
|
24
|
+
animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
25
|
+
z-index: 1000;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
min-width: 300px;
|
|
29
|
+
gap: 16px;
|
|
30
|
+
:focus {
|
|
31
|
+
outline: none;
|
|
32
|
+
}
|
|
33
33
|
`;
|
|
34
|
-
export const DialogContainer = styled.div `
|
|
35
|
-
display: flex;
|
|
36
|
-
padding: 24px 24px 0px 24px;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
align-items: center;
|
|
39
|
-
gap: 16px;
|
|
40
|
-
align-self: stretch;
|
|
34
|
+
export const DialogContainer = styled.div `
|
|
35
|
+
display: flex;
|
|
36
|
+
padding: 24px 24px 0px 24px;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 16px;
|
|
40
|
+
align-self: stretch;
|
|
41
41
|
`;
|
|
42
|
-
export const ModalTitleContainer = styled.div `
|
|
43
|
-
display: flex;
|
|
44
|
-
justify-content: space-between;
|
|
45
|
-
width: 100%;
|
|
42
|
+
export const ModalTitleContainer = styled.div `
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
width: 100%;
|
|
46
46
|
`;
|
|
47
|
-
export const ModalTitle = styled.div `
|
|
48
|
-
font-size: 24px;
|
|
49
|
-
font-style: normal;
|
|
50
|
-
font-weight: 600;
|
|
51
|
-
line-height: 150%;
|
|
47
|
+
export const ModalTitle = styled.div `
|
|
48
|
+
font-size: 24px;
|
|
49
|
+
font-style: normal;
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
line-height: 150%;
|
|
52
52
|
`;
|
|
53
|
-
export const ModalHeading = styled.div `
|
|
54
|
-
font-size: 16px;
|
|
55
|
-
font-style: normal;
|
|
56
|
-
font-weight: 700;
|
|
57
|
-
line-height: 150%;
|
|
53
|
+
export const ModalHeading = styled.div `
|
|
54
|
+
font-size: 16px;
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 700;
|
|
57
|
+
line-height: 150%;
|
|
58
58
|
`;
|
|
59
|
-
export const ModelSubHeading = styled.div `
|
|
60
|
-
font-size: 16px;
|
|
61
|
-
font-style: normal;
|
|
62
|
-
font-weight: 400;
|
|
63
|
-
line-height: 24px; /* 150% */
|
|
64
|
-
letter-spacing: 0.16px;
|
|
65
|
-
width: 100%;
|
|
59
|
+
export const ModelSubHeading = styled.div `
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
font-style: normal;
|
|
62
|
+
font-weight: 400;
|
|
63
|
+
line-height: 24px; /* 150% */
|
|
64
|
+
letter-spacing: 0.16px;
|
|
65
|
+
width: 100%;
|
|
66
66
|
`;
|
|
67
|
-
export const ModalFooter = styled.div `
|
|
68
|
-
display: flex;
|
|
69
|
-
padding: 24px 16px;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
align-items: center;
|
|
72
|
-
gap: 16px;
|
|
73
|
-
align-self: stretch;
|
|
67
|
+
export const ModalFooter = styled.div `
|
|
68
|
+
display: flex;
|
|
69
|
+
padding: 24px 16px;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 16px;
|
|
73
|
+
align-self: stretch;
|
|
74
74
|
`;
|
|
75
|
-
export const ModalInputBox = styled.div `
|
|
76
|
-
display: flex;
|
|
77
|
-
width: 322px;
|
|
78
|
-
flex-direction: column;
|
|
79
|
-
justify-content: center;
|
|
80
|
-
align-items: flex-start;
|
|
81
|
-
gap: 8px;
|
|
75
|
+
export const ModalInputBox = styled.div `
|
|
76
|
+
display: flex;
|
|
77
|
+
width: 322px;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
align-items: flex-start;
|
|
81
|
+
gap: 8px;
|
|
82
82
|
`;
|
|
83
83
|
export const Modal = (props) => {
|
|
84
84
|
const { open, children, colorPalette, setOpen, ...remainderProps } = props;
|
|
@@ -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;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../lib/Organisms/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;A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