@factorearth/component-library 5.1.0 → 5.1.2-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/Accordion/Accordion.js +18 -18
- package/dist/Atoms/Badge/Badge.js +18 -18
- package/dist/Atoms/Box/Box.js +15 -15
- package/dist/Atoms/Buttons/Button.js +23 -23
- package/dist/Atoms/ContentDropdown/ContentDropdown.js +24 -24
- package/dist/Atoms/DateField/DateField.js +94 -94
- package/dist/Atoms/FieldWrapper/FieldWrapper.js +35 -35
- package/dist/Atoms/MoreHorizonButton/MoreHorizonButton.js +52 -52
- package/dist/Atoms/NoteField/NoteField.js +38 -38
- package/dist/Atoms/NumberField/NumberField.js +63 -63
- package/dist/Atoms/OptionsDropdown/OptionsDropdown.js +38 -38
- package/dist/Atoms/Pagination/Pagination.js +25 -25
- package/dist/Atoms/PhoneNumberField/PhoneNumberField.js +4 -4
- package/dist/Atoms/ProgressBar/ProgressBar.js +16 -16
- package/dist/Atoms/SortDropdown/SortDropdown.js +39 -39
- package/dist/Atoms/Tab/Tab.js +18 -18
- package/dist/Atoms/TextField/TextField.js +24 -24
- package/dist/Atoms/Toggle/Toggle.js +11 -11
- package/dist/Atoms/Typography/Typography.js +7 -7
- package/dist/Molecules/Form/Form.js +8 -8
- package/dist/Molecules/NavMenu/NavMenu.js +102 -102
- package/dist/Molecules/TableHeader/TableHeader.js +14 -14
- package/dist/Molecules/TableRow/TableRow.js +27 -27
- package/dist/Molecules/Thumbnail/Thumbnail.js +48 -47
- package/dist/Molecules/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/Organisms/Card/Card.js +33 -36
- package/dist/Organisms/Card/Card.js.map +1 -1
- package/dist/Organisms/EditUserPerms/EditUserPerms.js +67 -67
- package/dist/Organisms/ErrorSplash/ErrorSplash.js +44 -44
- package/dist/Organisms/Modal/Modal.js +71 -71
- package/dist/Organisms/TabManager/TabManager.js +13 -13
- package/dist/Organisms/Table/Table.js +14 -14
- package/dist/Organisms/Tutorial/Tutorial.js +51 -51
- package/package.json +2 -2
- package/dist/Organisms/Splash/Splash.d.ts +0 -10
- package/dist/Organisms/Splash/Splash.js +0 -82
- package/dist/Organisms/Splash/Splash.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import React from "react";
|
|
3
|
-
export const ContentContainer = styled.div `
|
|
4
|
-
display: flex;
|
|
5
|
-
padding: 24px;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
gap: 8px;
|
|
9
|
-
align-self: stretch;
|
|
10
|
-
background-color: ${({ colors }) => colors.background.primary};
|
|
3
|
+
export const ContentContainer = styled.div `
|
|
4
|
+
display: flex;
|
|
5
|
+
padding: 24px;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 8px;
|
|
9
|
+
align-self: stretch;
|
|
10
|
+
background-color: ${({ colors }) => colors.background.primary};
|
|
11
11
|
`;
|
|
12
12
|
function Form(props) {
|
|
13
13
|
const { children, colors } = props;
|
|
@@ -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;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
3
|
import { SortDropdown } from "../../Atoms/SortDropdown/SortDropdown";
|
|
4
|
-
const HeaderCell = styled.th `
|
|
5
|
-
display: flex;
|
|
6
|
-
height: 56px;
|
|
7
|
-
padding: 0px 8px;
|
|
8
|
-
align-items: center;
|
|
9
|
-
gap: 16px;
|
|
10
|
-
align-self: stretch;
|
|
11
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
12
|
-
align-items: center;
|
|
13
|
-
min-height: 40px;
|
|
14
|
-
font-size: 16px;
|
|
15
|
-
justify-content: space-between;
|
|
16
|
-
width: 100%;
|
|
17
|
-
display: flex;
|
|
4
|
+
const HeaderCell = styled.th `
|
|
5
|
+
display: flex;
|
|
6
|
+
height: 56px;
|
|
7
|
+
padding: 0px 8px;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 16px;
|
|
10
|
+
align-self: stretch;
|
|
11
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
12
|
+
align-items: center;
|
|
13
|
+
min-height: 40px;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
width: 100%;
|
|
17
|
+
display: flex;
|
|
18
18
|
`;
|
|
19
19
|
export const TableHeader = (props) => {
|
|
20
20
|
const { columns, colorPalette } = props;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
-
const StyledTableRow = styled.tr `
|
|
4
|
-
display: flex;
|
|
5
|
-
border-width: 1px;
|
|
6
|
-
border-style: solid;
|
|
7
|
-
border-color: ${({ colorPalette }) => colorPalette.border.secondary};
|
|
8
|
-
background: $ ${({ colorPalette }) => colorPalette.background.primary};
|
|
9
|
-
border-right: none;
|
|
10
|
-
border-left: none;
|
|
11
|
-
border-top: none;
|
|
3
|
+
const StyledTableRow = styled.tr `
|
|
4
|
+
display: flex;
|
|
5
|
+
border-width: 1px;
|
|
6
|
+
border-style: solid;
|
|
7
|
+
border-color: ${({ colorPalette }) => colorPalette.border.secondary};
|
|
8
|
+
background: $ ${({ colorPalette }) => colorPalette.background.primary};
|
|
9
|
+
border-right: none;
|
|
10
|
+
border-left: none;
|
|
11
|
+
border-top: none;
|
|
12
12
|
`;
|
|
13
|
-
export const TableCell = styled.td `
|
|
14
|
-
width: 100%;
|
|
15
|
-
min-height: 50px;
|
|
16
|
-
display: flex;
|
|
17
|
-
padding: 0px 8px;
|
|
18
|
-
justify-content: flex-start;
|
|
19
|
-
align-items: center;
|
|
20
|
-
align-self: stretch;
|
|
21
|
-
justify-content: start;
|
|
22
|
-
flex: 1;
|
|
23
|
-
font-size: 16px;
|
|
24
|
-
font-weight: 400;
|
|
25
|
-
word-break: break-word;
|
|
26
|
-
white-space: normal;
|
|
27
|
-
flex-wrap: wrap;
|
|
28
|
-
:hover: {
|
|
29
|
-
background: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
30
|
-
}
|
|
13
|
+
export const TableCell = styled.td `
|
|
14
|
+
width: 100%;
|
|
15
|
+
min-height: 50px;
|
|
16
|
+
display: flex;
|
|
17
|
+
padding: 0px 8px;
|
|
18
|
+
justify-content: flex-start;
|
|
19
|
+
align-items: center;
|
|
20
|
+
align-self: stretch;
|
|
21
|
+
justify-content: start;
|
|
22
|
+
flex: 1;
|
|
23
|
+
font-size: 16px;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
word-break: break-word;
|
|
26
|
+
white-space: normal;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
:hover: {
|
|
29
|
+
background: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
30
|
+
}
|
|
31
31
|
`;
|
|
32
32
|
export const TableRow = ({ index, colorPalette, rowData, columnConfig, }) => {
|
|
33
33
|
const rows = Object.entries(rowData)
|
|
@@ -2,56 +2,55 @@ 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
|
-
|
|
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
|
+
${({ showImage }) => showImage && `height: 278px; width: 200px`}
|
|
14
13
|
`;
|
|
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: ${({ colors }) => colors.background.tertiary};
|
|
22
|
-
border-style: solid;
|
|
23
|
-
border-width: 1px;
|
|
24
|
-
border-color: ${({ colors }) => colors.border.primary};
|
|
25
|
-
position: relative;
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
padding: 24px;
|
|
14
|
+
const InputArea = styled.div `
|
|
15
|
+
width: 150px;
|
|
16
|
+
height: 132px;
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
align-items: center;
|
|
20
|
+
background-color: ${({ colors }) => colors.background.tertiary};
|
|
21
|
+
border-style: solid;
|
|
22
|
+
border-width: 1px;
|
|
23
|
+
border-color: ${({ colors }) => colors.border.primary};
|
|
24
|
+
position: relative;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
padding: 24px;
|
|
30
29
|
`;
|
|
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: ${({ colors }) => colors.background.secondary};
|
|
38
|
-
border-style: solid;
|
|
39
|
-
border-width: 1px;
|
|
40
|
-
border-color: ${({ colors }) => colors.border.primary};
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
border-radius: 4px;
|
|
44
|
-
gap: 16px;
|
|
45
|
-
padding: 16px;
|
|
30
|
+
const SettingsArea = styled.div `
|
|
31
|
+
width: 168px;
|
|
32
|
+
height: 148px;
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
background-color: ${({ colors }) => colors.background.secondary};
|
|
37
|
+
border-style: solid;
|
|
38
|
+
border-width: 1px;
|
|
39
|
+
border-color: ${({ colors }) => colors.border.primary};
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
gap: 16px;
|
|
44
|
+
padding: 16px;
|
|
46
45
|
`;
|
|
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;
|
|
46
|
+
const PreviewImage = styled.img `
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
object-fit: cover;
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
z-index: 1;
|
|
55
54
|
`;
|
|
56
55
|
export const Thumbnail = ({ colorPalette, handleSubmit, settingsChildren, showImage, setShowImage, fieldInstance, s3Key, signedUrl, uploadButtonText, handleRemove, changed, handleChange, }) => {
|
|
57
56
|
const [selectedImage, setSelectedImage] = useState(null);
|
|
@@ -66,6 +65,7 @@ export const Thumbnail = ({ colorPalette, handleSubmit, settingsChildren, showIm
|
|
|
66
65
|
useEffect(() => {
|
|
67
66
|
if (inputRef && inputRef.current?.files?.[0]) {
|
|
68
67
|
const file = inputRef.current?.files?.[0];
|
|
68
|
+
console.log(`the file in the useEffect: `, file);
|
|
69
69
|
if (file) {
|
|
70
70
|
const imageUrl = URL.createObjectURL(file);
|
|
71
71
|
setSelectedImage(imageUrl);
|
|
@@ -80,6 +80,7 @@ export const Thumbnail = ({ colorPalette, handleSubmit, settingsChildren, showIm
|
|
|
80
80
|
}, [signedUrl, s3Key]);
|
|
81
81
|
const handleImageUpload = (event) => {
|
|
82
82
|
const file = event.target.files?.[0];
|
|
83
|
+
console.log(`the file in image upload: `, file);
|
|
83
84
|
if (file) {
|
|
84
85
|
const imageUrl = URL.createObjectURL(file);
|
|
85
86
|
setSelectedImage(imageUrl);
|
|
@@ -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,E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AI,CAAC,YAAY,IAAI,CAC9B,oBAAC,SAAS,IACT,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,YAAY;YAEnB,aAAa,IAAI,CACjB,oBAAC,YAAY,IACZ,GAAG,EAAE,KAAK,IAAI,gBAAgB,EAC9B,GAAG,EAAE,aAAa,GACjB,CACF;YACD,oBAAC,MAAM,IACN,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAC,QAAQ,EACd,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,iBAAiB;gBAE1B,+BACC,IAAI,EAAC,MAAM,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,EAAE,GACzB,CACM,CACE,CACZ;QACA,YAAY,IAAI,SAAS,IAAI,CAC7B,oBAAC,YAAY,IAAC,MAAM,EAAE,YAAY,IAAG,gBAAgB,CAAgB,CACrE;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,44 +1,41 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
-
const CardContainer = styled.div `
|
|
4
|
-
padding: 24px;
|
|
5
|
-
|
|
6
|
-
border-
|
|
7
|
-
border-
|
|
8
|
-
border-
|
|
9
|
-
border-
|
|
10
|
-
border-left: none;
|
|
3
|
+
const CardContainer = styled.div `
|
|
4
|
+
padding: 24px;
|
|
5
|
+
border-width: 0.5px;
|
|
6
|
+
border-style: solid;
|
|
7
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
8
|
+
border-right: none;
|
|
9
|
+
border-left: none;
|
|
11
10
|
`;
|
|
12
|
-
const FieldsXThumbnailSection = styled.section `
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
flex-direction: row-reverse;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
11
|
+
const FieldsXThumbnailSection = styled.section `
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
flex-direction: row-reverse;
|
|
15
|
+
@media (max-width: 600px) {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: flex-end;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:has(div > div > button[aria-label="show-image"]) {
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
}
|
|
25
23
|
`;
|
|
26
|
-
const ThumbnailSectionFields = styled.section `
|
|
27
|
-
padding: 16px 24px 0px 0px;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
width:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
24
|
+
const ThumbnailSectionFields = styled.section `
|
|
25
|
+
padding: 16px 24px 0px 0px;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
width: 100%;
|
|
30
|
+
@media (max-width: 600px) {
|
|
31
|
+
padding: 16px 0px 0px 24px;
|
|
32
|
+
}
|
|
36
33
|
`;
|
|
37
|
-
const ButtonContainer = styled.div `
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: flex-end;
|
|
40
|
-
gap: 24px;
|
|
41
|
-
padding-top: 24px;
|
|
34
|
+
const ButtonContainer = styled.div `
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: flex-end;
|
|
37
|
+
gap: 24px;
|
|
38
|
+
padding-top: 24px;
|
|
42
39
|
`;
|
|
43
40
|
export const Card = forwardRef((props, ref) => {
|
|
44
41
|
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,CAA2B
|
|
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,CAA2B;;;;iBAI1C,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO;;;CAGjE,CAAC;AAEF,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,CAE5C;;;;;;;;;;;;CAYD,CAAC;AAEF,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,CAA2B;;;;;;;;;CASvE,CAAC;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKjC,CAAC;AAcF,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAC7B,CAAC,KAAgB,EAAE,GAAiC,EAAE,EAAE;IACvD,MAAM,EACL,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,eAAe,EACf,OAAO,GACP,GAAG,KAAK,CAAC;IACV,OAAO,CACN,oBAA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