@factorearth/component-library 3.2.11-alpha.0 → 3.3.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.js +16 -16
- package/dist/Atoms/ContentDropdown/ContentDropdown.d.ts +11 -0
- package/dist/Atoms/ContentDropdown/ContentDropdown.js +37 -0
- package/dist/Atoms/ContentDropdown/ContentDropdown.js.map +1 -0
- package/dist/Atoms/DateField/DateField.js +94 -94
- 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.js +63 -63
- package/dist/Atoms/Pagination/Pagination.js +26 -26
- package/dist/Atoms/PhoneNumberField/PhoneNumberField.js +4 -4
- 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/Tab/Tab.d.ts +10 -0
- package/dist/Atoms/Tab/Tab.js +26 -0
- package/dist/Atoms/Tab/Tab.js.map +1 -0
- package/dist/Atoms/TextField/TextField.js +20 -20
- package/dist/Molecules/Form/Form.d.ts +14 -0
- package/dist/Molecules/Form/Form.js +16 -0
- package/dist/Molecules/Form/Form.js.map +1 -0
- package/dist/Molecules/Thumbnail/Thumbnail.js +47 -47
- package/dist/Organisms/Card/Card.js +36 -36
- package/dist/Organisms/Modal/Modal.js +68 -68
- package/dist/Organisms/TabManager/TabManager.d.ts +9 -0
- package/dist/Organisms/TabManager/TabManager.js +46 -0
- package/dist/Organisms/TabManager/TabManager.js.map +1 -0
- package/dist/Theme/ThemeProvider.js +7 -7
- package/dist/Theme/ThemeProvider.js.map +1 -1
- package/dist/Theme/tokens.json +109 -16
- package/dist/Theme/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect } from "react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
3
|
import { FiPlus, FiMinus } from "react-icons/fi";
|
|
4
|
-
const NumberFieldContainer = styled.div `
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
width: 100%;
|
|
4
|
+
const NumberFieldContainer = styled.div `
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 100%;
|
|
8
8
|
`;
|
|
9
|
-
const NumberInput = styled.input `
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
text-align: center;
|
|
14
|
-
min-width: 67px;
|
|
15
|
-
height: 38px;
|
|
16
|
-
width: 100%;
|
|
17
|
-
gap: 10px;
|
|
18
|
-
align-self: stretch;
|
|
19
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
20
|
-
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
21
|
-
border-width: 1px;
|
|
22
|
-
border-style: solid;
|
|
23
|
-
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
24
|
-
border-right: none;
|
|
25
|
-
border-left: none;
|
|
26
|
-
border-radius: 0px;
|
|
27
|
-
padding: 0;
|
|
28
|
-
&:focus-visible {
|
|
29
|
-
outline: none;
|
|
30
|
-
}
|
|
31
|
-
&::-webkit-inner-spin-button,
|
|
32
|
-
::-webkit-outer-spin-button {
|
|
33
|
-
-webkit-appearance: none;
|
|
34
|
-
margin: 0;
|
|
35
|
-
}
|
|
36
|
-
::placeholder {
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
}
|
|
9
|
+
const NumberInput = styled.input `
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
text-align: center;
|
|
14
|
+
min-width: 67px;
|
|
15
|
+
height: 38px;
|
|
16
|
+
width: 100%;
|
|
17
|
+
gap: 10px;
|
|
18
|
+
align-self: stretch;
|
|
19
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
20
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
21
|
+
border-width: 1px;
|
|
22
|
+
border-style: solid;
|
|
23
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
24
|
+
border-right: none;
|
|
25
|
+
border-left: none;
|
|
26
|
+
border-radius: 0px;
|
|
27
|
+
padding: 0;
|
|
28
|
+
&:focus-visible {
|
|
29
|
+
outline: none;
|
|
30
|
+
}
|
|
31
|
+
&::-webkit-inner-spin-button,
|
|
32
|
+
::-webkit-outer-spin-button {
|
|
33
|
+
-webkit-appearance: none;
|
|
34
|
+
margin: 0;
|
|
35
|
+
}
|
|
36
|
+
::placeholder {
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
}
|
|
39
39
|
`;
|
|
40
|
-
const DecrementButton = styled.div `
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
display: flex;
|
|
43
|
-
width: 16px;
|
|
44
|
-
height: 22px;
|
|
45
|
-
padding: 8px 16px;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
align-items: center;
|
|
48
|
-
border-radius: 4px 0px 0px 4px;
|
|
49
|
-
border-width: 1px;
|
|
50
|
-
border-style: solid;
|
|
51
|
-
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
52
|
-
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
53
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
40
|
+
const DecrementButton = styled.div `
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
display: flex;
|
|
43
|
+
width: 16px;
|
|
44
|
+
height: 22px;
|
|
45
|
+
padding: 8px 16px;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
align-items: center;
|
|
48
|
+
border-radius: 4px 0px 0px 4px;
|
|
49
|
+
border-width: 1px;
|
|
50
|
+
border-style: solid;
|
|
51
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
52
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
53
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
54
54
|
`;
|
|
55
|
-
const IncrementButton = styled.div `
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
display: flex;
|
|
58
|
-
width: 16px;
|
|
59
|
-
height: 22px;
|
|
60
|
-
padding: 8px 16px;
|
|
61
|
-
justify-content: center;
|
|
62
|
-
align-items: center;
|
|
63
|
-
border-width: 1px;
|
|
64
|
-
border-style: solid;
|
|
65
|
-
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
66
|
-
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
67
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
68
|
-
${({ moreHorizon }) => !moreHorizon && `border-radius: 0px 4px 4px 0px;`}
|
|
69
|
-
${({ moreHorizon }) => moreHorizon && `border-right: none;`}
|
|
55
|
+
const IncrementButton = styled.div `
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
display: flex;
|
|
58
|
+
width: 16px;
|
|
59
|
+
height: 22px;
|
|
60
|
+
padding: 8px 16px;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
align-items: center;
|
|
63
|
+
border-width: 1px;
|
|
64
|
+
border-style: solid;
|
|
65
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
66
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
67
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
68
|
+
${({ moreHorizon }) => !moreHorizon && `border-radius: 0px 4px 4px 0px;`}
|
|
69
|
+
${({ moreHorizon }) => moreHorizon && `border-right: none;`}
|
|
70
70
|
`;
|
|
71
71
|
export const NumberField = (props) => {
|
|
72
72
|
const { colorPalette, handleChange, handleBlur, fromTable, moreHorizon, value, ...inputProps } = props;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
3
|
import { FiChevronLeft, FiChevronRight } from "react-icons/fi";
|
|
4
|
-
const PaginationContainer = styled.div `
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
gap: 16px;
|
|
9
|
-
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
4
|
+
const PaginationContainer = styled.div `
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
gap: 16px;
|
|
9
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
10
10
|
`;
|
|
11
11
|
const PageNumber = styled.div(({ isActive, colorPalette, }) => ({
|
|
12
12
|
height: "14px",
|
|
@@ -27,28 +27,28 @@ const PageNumber = styled.div(({ isActive, colorPalette, }) => ({
|
|
|
27
27
|
fontWeight: 600,
|
|
28
28
|
lineHeight: "100%",
|
|
29
29
|
}));
|
|
30
|
-
const Ellipsis = styled.span `
|
|
31
|
-
height: 35px;
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
30
|
+
const Ellipsis = styled.span `
|
|
31
|
+
height: 35px;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
36
36
|
`;
|
|
37
|
-
const RightButton = styled(FiChevronRight) `
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
display: inline-flex;
|
|
40
|
-
height: 24px;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
align-items: center;
|
|
43
|
-
flex-shrink: 0;
|
|
37
|
+
const RightButton = styled(FiChevronRight) `
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
height: 24px;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
align-items: center;
|
|
43
|
+
flex-shrink: 0;
|
|
44
44
|
`;
|
|
45
|
-
const LeftButton = styled(FiChevronLeft) `
|
|
46
|
-
cursor: pointer;
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
height: 24px;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
align-items: center;
|
|
51
|
-
flex-shrink: 0;
|
|
45
|
+
const LeftButton = styled(FiChevronLeft) `
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
height: 24px;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
align-items: center;
|
|
51
|
+
flex-shrink: 0;
|
|
52
52
|
`;
|
|
53
53
|
const getMinAndMax = (number, maxVisiblePages) => {
|
|
54
54
|
const min = Math.floor(number / maxVisiblePages) * maxVisiblePages + 1;
|
|
@@ -3,10 +3,10 @@ import { AsYouType, getCountries, getCountryCallingCode, } from "libphonenumber-
|
|
|
3
3
|
import React, { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { DropdownSelect } from "../DropdownField/DropdownField";
|
|
5
5
|
import { TextFieldWrapper } from "../TextField/TextField";
|
|
6
|
-
const PhoneNumberContainer = styled.div `
|
|
7
|
-
display: flex;
|
|
8
|
-
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
9
|
-
width: 100%;
|
|
6
|
+
const PhoneNumberContainer = styled.div `
|
|
7
|
+
display: flex;
|
|
8
|
+
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
9
|
+
width: 100%;
|
|
10
10
|
`;
|
|
11
11
|
export const PhoneNumberField = (props) => {
|
|
12
12
|
const { activeEditing, handleBlur, handleChange, moreHorizon, placeholder, initialValue, colorPalette, ...remainderProps } = props;
|
|
@@ -15,9 +15,22 @@ export const SelectField = (props) => {
|
|
|
15
15
|
const { handleChange, colorPalette, options, moreHorizon, values, type } = props;
|
|
16
16
|
const [open, setOpen] = useState(false);
|
|
17
17
|
const [selectedValues, setSelectedValues] = useState([]);
|
|
18
|
+
const [selectedId, setSelectedId] = useState(Array.isArray(selectedValues) && selectedValues.length === 1 ? selectedValues[0].id || "" : "");
|
|
18
19
|
useEffect(() => {
|
|
19
20
|
setSelectedValues(values && type === "checkbox" ? Object.values(values) : values || []);
|
|
20
21
|
}, [values]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (Array.isArray(selectedValues) && selectedValues.length === 1) {
|
|
24
|
+
setSelectedId(selectedValues[0].id);
|
|
25
|
+
}
|
|
26
|
+
}, [selectedValues]);
|
|
27
|
+
function onClick(id) {
|
|
28
|
+
if (type === "radio" && id === selectedId) {
|
|
29
|
+
setSelectedId("");
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
handleChange({ target: { value: "", id: "" } });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
21
34
|
return (React.createElement(React.Fragment, null,
|
|
22
35
|
React.createElement(DropdownSelect, { components: {
|
|
23
36
|
DropdownIndicator: type === "radio" ? RadioIndicator : CheckBoxIndicator,
|
|
@@ -59,7 +72,7 @@ export const SelectField = (props) => {
|
|
|
59
72
|
gap: "8px",
|
|
60
73
|
paddingBottom: "16px",
|
|
61
74
|
} },
|
|
62
|
-
React.createElement("input", { type: type, id: option.linkedId || option.id, defaultValue: option.value || "", checked: checked, onChange: handleChange }),
|
|
75
|
+
React.createElement("input", { type: type, id: option.linkedId || option.id, defaultValue: option.value || "", checked: checked, onChange: handleChange, onClick: () => { onClick(option.linkedId || option.id); } }),
|
|
63
76
|
React.createElement("label", { htmlFor: option.label }, option.label)));
|
|
64
77
|
})))));
|
|
65
78
|
};
|
|
@@ -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,E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M,CAAC,KAAK,IAAI,EAAE,EAChC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GACxD;oBACF,+BAAO,OAAO,EAAE,MAAM,CAAC,KAAK,IAAG,MAAM,CAAC,KAAK,CAAS,CAC/C,CACN,CAAC;YACH,CAAC,CAAC,CACG,CACC,CACN,CACH,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -2,49 +2,49 @@ import React, { useState, useRef, useEffect } from 'react';
|
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { GoSortAsc, GoSortDesc } from "react-icons/go";
|
|
4
4
|
import { TiMinus } from "react-icons/ti";
|
|
5
|
-
const DropdownContainer = styled.div `
|
|
6
|
-
position: relative;
|
|
7
|
-
display: inline-block;
|
|
5
|
+
const DropdownContainer = styled.div `
|
|
6
|
+
position: relative;
|
|
7
|
+
display: inline-block;
|
|
8
8
|
`;
|
|
9
|
-
const DropdownButton = styled.button `
|
|
10
|
-
background-color: #f0f0f0;
|
|
11
|
-
border: none;
|
|
12
|
-
padding: 10px;
|
|
13
|
-
border-radius: 4px;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
9
|
+
const DropdownButton = styled.button `
|
|
10
|
+
background-color: #f0f0f0;
|
|
11
|
+
border: none;
|
|
12
|
+
padding: 10px;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
17
|
`;
|
|
18
|
-
const Menu = styled.div `
|
|
19
|
-
display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
|
|
20
|
-
position: absolute;
|
|
21
|
-
top: 100%;
|
|
22
|
-
left: 0;
|
|
23
|
-
background-color: #fff;
|
|
24
|
-
border: 1px solid #ccc;
|
|
25
|
-
border-radius: 4px;
|
|
26
|
-
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
|
27
|
-
min-width: 200px;
|
|
28
|
-
z-index: 1000;
|
|
18
|
+
const Menu = styled.div `
|
|
19
|
+
display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 100%;
|
|
22
|
+
left: 0;
|
|
23
|
+
background-color: #fff;
|
|
24
|
+
border: 1px solid #ccc;
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
|
27
|
+
min-width: 200px;
|
|
28
|
+
z-index: 1000;
|
|
29
29
|
`;
|
|
30
|
-
const MenuItem = styled.button `
|
|
31
|
-
background: none;
|
|
32
|
-
border: none;
|
|
33
|
-
padding: 10px;
|
|
34
|
-
width: 100%;
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
transition: background-color 0.2s;
|
|
39
|
-
|
|
40
|
-
&:hover {
|
|
41
|
-
background-color: #f0f0f0;
|
|
42
|
-
}
|
|
30
|
+
const MenuItem = styled.button `
|
|
31
|
+
background: none;
|
|
32
|
+
border: none;
|
|
33
|
+
padding: 10px;
|
|
34
|
+
width: 100%;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
transition: background-color 0.2s;
|
|
39
|
+
|
|
40
|
+
&:hover {
|
|
41
|
+
background-color: #f0f0f0;
|
|
42
|
+
}
|
|
43
43
|
`;
|
|
44
|
-
const IconContainer = styled.span `
|
|
45
|
-
margin-right: 8px;
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
44
|
+
const IconContainer = styled.span `
|
|
45
|
+
margin-right: 8px;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
48
|
`;
|
|
49
49
|
export const SortDropdown = () => {
|
|
50
50
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import React from "react";
|
|
3
|
+
const TabDiv = styled.div `
|
|
4
|
+
display: flex;
|
|
5
|
+
padding: 6px 12px;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 8px;
|
|
9
|
+
border-radius: 4px 4px 0px 0px;
|
|
10
|
+
background: ${({ colors, selected }) => selected ? colors.tab.selected : colors.tab.notSelected};
|
|
11
|
+
cursor: ${({ selected }) => selected ? "auto" : "pointer"};
|
|
12
|
+
border: .5px solid ${({ colors }) => colors.tab.selected};
|
|
13
|
+
`;
|
|
14
|
+
const Label = styled.p `
|
|
15
|
+
color: ${({ colors, selected }) => selected ? colors.tabText.selected : colors.tabText.notSelected};
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
line-height: 150%;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
margin: 0px;
|
|
20
|
+
`;
|
|
21
|
+
export function Tab(props) {
|
|
22
|
+
const { colors, handleClick, label, selected, ...remainingProps } = props;
|
|
23
|
+
return (React.createElement(TabDiv, { colors: colors, selected: selected, role: !selected ? "button" : undefined, "aria-label": `${label} tab`, onClick: !selected ? handleClick : undefined, key: `${label} form`, ...remainingProps },
|
|
24
|
+
React.createElement(Label, { colors: colors, selected: selected }, label)));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=Tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../lib/Atoms/Tab/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAyC;;;;;;;eAOnD,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,Q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
|
-
width: 100%;
|
|
5
|
-
min-width: 60px;
|
|
6
|
-
min-height: 30px;
|
|
7
|
-
font-weight: 600;
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
cursor: text;
|
|
3
|
+
const InputWrapper = styled.input `
|
|
4
|
+
width: 100%;
|
|
5
|
+
min-width: 60px;
|
|
6
|
+
min-height: 30px;
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
cursor: text;
|
|
10
10
|
${({ moreHorizon }) => moreHorizon &&
|
|
11
|
-
`border-top-right-radius: 0px;border-bottom-right-radius: 0px;`}
|
|
12
|
-
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
13
|
-
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
14
|
-
border-style: solid;
|
|
15
|
-
border-width: 1px;
|
|
16
|
-
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
17
|
-
padding: 0;
|
|
18
|
-
padding-left: 16px;
|
|
19
|
-
${({ moreHorizon }) => moreHorizon && `border-right: none;`}
|
|
20
|
-
height: 38px;
|
|
21
|
-
::placeholder {
|
|
22
|
-
font-weight: 500;
|
|
23
|
-
}
|
|
11
|
+
`border-top-right-radius: 0px;border-bottom-right-radius: 0px;`}
|
|
12
|
+
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
13
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
14
|
+
border-style: solid;
|
|
15
|
+
border-width: 1px;
|
|
16
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
17
|
+
padding: 0;
|
|
18
|
+
padding-left: 16px;
|
|
19
|
+
${({ moreHorizon }) => moreHorizon && `border-right: none;`}
|
|
20
|
+
height: 38px;
|
|
21
|
+
::placeholder {
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
}
|
|
24
24
|
`;
|
|
25
25
|
export const TextFieldWrapper = (props) => {
|
|
26
26
|
const { activeEditing, colorPalette, moreHorizon, onChange, value, ...remainderProps } = props;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Colors } from "../../Theme/types";
|
|
3
|
+
export declare const ContentContainer: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
} & {
|
|
7
|
+
colors: Colors;
|
|
8
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
interface Props {
|
|
10
|
+
colors: Colors;
|
|
11
|
+
children: JSX.Element[];
|
|
12
|
+
}
|
|
13
|
+
export declare function Form(props: Props): React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
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};
|
|
11
|
+
`;
|
|
12
|
+
export function Form(props) {
|
|
13
|
+
const { children, colors } = props;
|
|
14
|
+
return (React.createElement(ContentContainer, { colors: colors }, children));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../../lib/Molecules/Form/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAqB;;;;;;;qBAO1C,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;CAC7D,CAAC;AAOF,MAAM,UAAU,IAAI,CAAC,KAAY;IAChC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACnC,OAAO,CACN,oBAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,IAC9B,QAAQ,CACS,CACnB,CAAC;AACH,CAAC"}
|
|
@@ -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: ${({ color }) => color.background.primary};
|
|
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: ${({ 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;
|
|
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: ${({ 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;
|
|
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);
|