@factorearth/component-library 3.1.2 → 3.1.3-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/dist/Atoms/Buttons/Button.d.ts +0 -2
- package/dist/Atoms/Buttons/Button.js +2 -3
- package/dist/Atoms/Buttons/Button.js.map +1 -1
- package/dist/Atoms/DropdownField/DropdownField.d.ts +1 -1
- package/dist/Atoms/DropdownField/DropdownField.js +29 -15
- package/dist/Atoms/DropdownField/DropdownField.js.map +1 -1
- package/dist/Atoms/FieldWrapper/FieldWrapper.js +2 -1
- package/dist/Atoms/FieldWrapper/FieldWrapper.js.map +1 -1
- package/dist/Atoms/Modal/Modal.d.ts +14 -0
- package/dist/Atoms/Modal/Modal.js +25 -0
- package/dist/Atoms/Modal/Modal.js.map +1 -0
- package/dist/Atoms/MoreHorizonButton/MoreHorizonButton.js +2 -2
- package/dist/Atoms/MoreHorizonButton/MoreHorizonButton.js.map +1 -1
- package/dist/Atoms/NumberField/NumberField.d.ts +3 -8
- package/dist/Atoms/NumberField/NumberField.js +75 -29
- package/dist/Atoms/NumberField/NumberField.js.map +1 -1
- package/dist/Atoms/SelectField/SelectField.d.ts +16 -0
- package/dist/Atoms/SelectField/SelectField.js +65 -0
- package/dist/Atoms/SelectField/SelectField.js.map +1 -0
- package/dist/Atoms/TextField/TextField.d.ts +2 -2
- package/dist/Atoms/TextField/TextField.js +3 -0
- package/dist/Atoms/TextField/TextField.js.map +1 -1
- package/dist/Molecules/Thumbnail/Thumbnail.js +4 -4
- package/dist/Molecules/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/Organisms/Modal/Modal.d.ts +10 -0
- package/dist/Organisms/Modal/Modal.js +43 -0
- package/dist/Organisms/Modal/Modal.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +287 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +15 -14
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CSSObject } from "@emotion/styled";
|
|
3
2
|
import { Colors } from "../../Theme/types";
|
|
4
3
|
type ButtonVariants = "success" | "destructive" | "outlined" | "filled";
|
|
5
4
|
interface ButtonProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
6
5
|
colorPalette: Colors & string;
|
|
7
|
-
styles?: CSSObject;
|
|
8
6
|
icon?: JSX.Element;
|
|
9
7
|
variant: ButtonVariants;
|
|
10
8
|
label?: string;
|
|
@@ -16,11 +16,10 @@ const DivButton = styled.div `
|
|
|
16
16
|
font-size: 14px;
|
|
17
17
|
font-weight: 700;
|
|
18
18
|
border-color: ${({ color, variant }) => color.buttonBorder[variant]};
|
|
19
|
-
${({ styles }) => styles && styles}
|
|
20
19
|
`;
|
|
21
20
|
export const Button = (props) => {
|
|
22
|
-
const { colorPalette,
|
|
23
|
-
return (React.createElement(DivButton, { ...props, color: colorPalette,
|
|
21
|
+
const { colorPalette, icon, variant, label, children } = props;
|
|
22
|
+
return (React.createElement(DivButton, { ...props, color: colorPalette, variant: variant, role: "button", tabIndex: 0 },
|
|
24
23
|
icon && icon,
|
|
25
24
|
label && label,
|
|
26
25
|
children && children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../lib/Atoms/Buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAqB,MAAM,iBAAiB,CAAC;AAKpD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../lib/Atoms/Buttons/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAqB,MAAM,iBAAiB,CAAC;AAKpD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAA4C;;qBAEnD,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC;UACnE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;;;;;;;;;;;;iBAY3C,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAE,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC;CACpE,CAAC;AAUF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAE,EAAE;IAC5C,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC/D,OAAO,CACN,oBAAC,SAAS,OAAK,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC;QACpF,IAAI,IAAI,IAAI;QACZ,KAAK,IAAI,KAAK;QACd,QAAQ,IAAI,QAAQ,CACV,CACZ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Select from "react-select";
|
|
3
3
|
import Createable from "react-select/creatable";
|
|
4
|
-
export const
|
|
5
|
-
const { colorPalette, moreHorizon, createAble } = props;
|
|
6
|
-
const
|
|
4
|
+
export const DropdownSelect = (props) => {
|
|
5
|
+
const { colorPalette, moreHorizon, createAble, styles } = props;
|
|
6
|
+
const defaultStyles = {
|
|
7
7
|
control: (provided, state) => ({
|
|
8
|
-
|
|
8
|
+
...provided,
|
|
9
|
+
paddingLeft: "8px",
|
|
9
10
|
justifyContent: "center",
|
|
10
11
|
alignSelf: "stretch",
|
|
11
12
|
backgroundColor: colorPalette.background.primary,
|
|
@@ -14,38 +15,50 @@ export const DropdownField = (props) => {
|
|
|
14
15
|
display: "flex",
|
|
15
16
|
alignItems: "center",
|
|
16
17
|
fontSize: "14px",
|
|
17
|
-
zIndex: "1000",
|
|
18
18
|
height: "40px",
|
|
19
|
+
overflow: "auto",
|
|
19
20
|
color: colorPalette.text.primary,
|
|
20
21
|
borderTopRightRadius: !moreHorizon ? "4px" : "0px",
|
|
21
22
|
borderBottomRightRadius: !moreHorizon ? "4px" : "0px",
|
|
22
|
-
border:
|
|
23
|
+
border: `1px solid ${colorPalette.border.primary}`,
|
|
24
|
+
borderRight: !moreHorizon
|
|
23
25
|
? `1px solid ${colorPalette.border.primary}`
|
|
24
|
-
:
|
|
26
|
+
: "none",
|
|
27
|
+
"::placeholder": {
|
|
28
|
+
color: colorPalette.text.secondary,
|
|
29
|
+
},
|
|
25
30
|
":hover": {
|
|
26
31
|
...provided[":hover"],
|
|
27
32
|
border: `1px solid ${colorPalette.border.primary}`,
|
|
33
|
+
backgroundColor: colorPalette.background.primary,
|
|
28
34
|
boxShadow: "none",
|
|
35
|
+
borderRight: !moreHorizon
|
|
36
|
+
? `1px solid ${colorPalette.border.primary}`
|
|
37
|
+
: "none",
|
|
29
38
|
},
|
|
30
39
|
":active": {
|
|
31
40
|
...provided[":active"],
|
|
32
41
|
border: `1px solid ${colorPalette.border.primary}`,
|
|
42
|
+
backgroundColor: colorPalette.background.primary,
|
|
33
43
|
boxShadow: "none",
|
|
44
|
+
borderRight: !moreHorizon
|
|
45
|
+
? `1px solid ${colorPalette.border.primary}`
|
|
46
|
+
: "none",
|
|
34
47
|
},
|
|
35
48
|
":focus": {
|
|
36
49
|
...provided[":focus"],
|
|
37
50
|
border: `1px solid ${colorPalette.border.primary}`,
|
|
51
|
+
backgroundColor: colorPalette.background.primary,
|
|
38
52
|
boxShadow: "none",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
borderRight: !moreHorizon
|
|
54
|
+
? `1px solid ${colorPalette.border.primary}`
|
|
55
|
+
: "none",
|
|
42
56
|
},
|
|
43
57
|
boxShadow: "none",
|
|
44
58
|
}),
|
|
45
59
|
input: (provided, state) => ({
|
|
46
60
|
...provided,
|
|
47
61
|
color: colorPalette.text.primary,
|
|
48
|
-
height: "40px",
|
|
49
62
|
width: "100%",
|
|
50
63
|
}),
|
|
51
64
|
container: (provided, state) => ({
|
|
@@ -77,12 +90,12 @@ export const DropdownField = (props) => {
|
|
|
77
90
|
}),
|
|
78
91
|
multiValue: (provided, state) => ({
|
|
79
92
|
...provided,
|
|
80
|
-
backgroundColor: colorPalette.background.
|
|
81
|
-
color: colorPalette.text.
|
|
93
|
+
backgroundColor: colorPalette.background.secondary,
|
|
94
|
+
color: colorPalette.text.primary,
|
|
82
95
|
}),
|
|
83
96
|
multiValueLabel: (provided, state) => ({
|
|
84
97
|
...provided,
|
|
85
|
-
color: colorPalette.text.
|
|
98
|
+
color: colorPalette.text.primary,
|
|
86
99
|
}),
|
|
87
100
|
singleValue: (provided, state) => ({
|
|
88
101
|
...provided,
|
|
@@ -93,8 +106,9 @@ export const DropdownField = (props) => {
|
|
|
93
106
|
display: "none",
|
|
94
107
|
}),
|
|
95
108
|
};
|
|
109
|
+
const customStyles = styles ? { ...defaultStyles, ...styles } : defaultStyles;
|
|
96
110
|
return (React.createElement("div", { style: { display: "flex", width: "100%" } },
|
|
97
|
-
createAble ? (React.createElement(Createable, { styles: styles, ...props })) : (React.createElement(Select, { styles:
|
|
111
|
+
createAble ? (React.createElement(Createable, { styles: styles, ...props })) : (React.createElement(Select, { ...props, styles: customStyles })),
|
|
98
112
|
moreHorizon && moreHorizon));
|
|
99
113
|
};
|
|
100
114
|
//# sourceMappingURL=DropdownField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownField.js","sourceRoot":"","sources":["../../../lib/Atoms/DropdownField/DropdownField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAA4B,MAAM,cAAc,CAAC;AAExD,OAAO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,EAAE,CAAC,QAAa,EAAE,KAAU,EAAE,EAAE,CAAC,CAAC;YAC5C,GAAG,QAAQ;YACX,eAAe,EAAE,YAAY,CAAC,UAAU,CAAC,OAAO;YAChD,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO;SAChC,CAAC;QACF,kBAAkB,EAAE,CAAC,QAAa,EAAE,KAAU,EAAE,EAAE,CAAC,CAAC;YACnD,OAAO,EAAE,MAAM;SACf,CAAC;KACF,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;IAC9E,OAAO,CACN,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;QAC5C,UAAU,CAAC,CAAC,CAAC,CACb,oBAAC,UAAU,IAAC,MAAM,EAAE,MAAM,KAAM,KAAK,GAAI,CACzC,CAAC,CAAC,CAAC,CACH,oBAAC,MAAM,OAAK,KAAK,EAAE,MAAM,EAAE,YAAY,GAAI,CAC3C;QACA,WAAW,IAAI,WAAW,CACtB,CACN,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -7,7 +7,7 @@ const FieldWrapperContainer = styled.div `
|
|
|
7
7
|
`;
|
|
8
8
|
const LabelContainer = styled.label `
|
|
9
9
|
display: flex;
|
|
10
|
-
height: 56px;
|
|
10
|
+
min-height: 56px;
|
|
11
11
|
align-items: center;
|
|
12
12
|
gap: 16px;
|
|
13
13
|
text-overflow: ellipsis;
|
|
@@ -22,6 +22,7 @@ const FieldActionContainer = styled.div `
|
|
|
22
22
|
display: flex;
|
|
23
23
|
width: 100%;
|
|
24
24
|
padding: 8px 0;
|
|
25
|
+
align-items: center;
|
|
25
26
|
`;
|
|
26
27
|
export const FieldWrapper = (props) => {
|
|
27
28
|
const { colorPalette, label, children, link } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldWrapper.js","sourceRoot":"","sources":["../../../lib/Atoms/FieldWrapper/FieldWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAA0B;;;;CAIjE,CAAC;AACF,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAA0B;;;;;;;;;;UAUnD,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO;;CAExD,CAAC;AAEF,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"FieldWrapper.js","sourceRoot":"","sources":["../../../lib/Atoms/FieldWrapper/FieldWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAA0B;;;;CAIjE,CAAC;AACF,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAA0B;;;;;;;;;;UAUnD,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO;;CAExD,CAAC;AAEF,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;EAKrC,CAAA;AAaF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;IACxD,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACtD,OAAO,CACN,oBAAC,qBAAqB,IAAC,YAAY,EAAE,YAAY;QAC/C,KAAK,IAAI,CACT,oBAAC,cAAc,IAAC,YAAY,EAAE,YAAY;YAAG,KAAK;YAAE,IAAI,CAAkB,CAC1E;QACA,QAAQ,CACc,CACxB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAE,EAAE;IACpE,OAAO,oBAAC,oBAAoB,QAAE,KAAK,CAAC,QAAQ,CAAwB,CAAC;AACtE,CAAC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Colors } from "../../Theme/types";
|
|
3
|
+
interface ModalProps {
|
|
4
|
+
title: string;
|
|
5
|
+
buttonText: string;
|
|
6
|
+
triggerComponent?: (onOpen: () => void) => JSX.Element;
|
|
7
|
+
modalComponent?: (onClose: () => void) => JSX.Element;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
colorPalette: Colors & string;
|
|
10
|
+
onOpen: () => void;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const Modal: (props: ModalProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
3
|
+
const DefaultTrigger = ({ buttonText, colorPalette }) => {
|
|
4
|
+
return (React.createElement(Dialog.Trigger, { asChild: true },
|
|
5
|
+
React.createElement("button", { style: { color: colorPalette.text.primary } }, buttonText)));
|
|
6
|
+
};
|
|
7
|
+
const DefaultModalContent = ({ title, colorPalette, children }) => {
|
|
8
|
+
return (React.createElement(React.Fragment, null,
|
|
9
|
+
React.createElement(Dialog.Title, { style: { color: colorPalette.text.primary } }, title),
|
|
10
|
+
children));
|
|
11
|
+
};
|
|
12
|
+
export const Modal = (props) => {
|
|
13
|
+
const { title, buttonText, triggerComponent, children, colorPalette, onOpen, onClose, modalComponent } = props;
|
|
14
|
+
return (React.createElement(Dialog.Root, null,
|
|
15
|
+
triggerComponent ? (triggerComponent(onOpen)) : (React.createElement(DefaultTrigger, { buttonText: buttonText, colorPalette: colorPalette })),
|
|
16
|
+
React.createElement(Dialog.Portal, null,
|
|
17
|
+
React.createElement(Dialog.Overlay, null),
|
|
18
|
+
React.createElement(Dialog.Content, { style: { backgroundColor: colorPalette.background.primary } },
|
|
19
|
+
modalComponent ? (modalComponent(onClose)) : (React.createElement(DefaultModalContent, { colorPalette: colorPalette, title: title }, children)),
|
|
20
|
+
React.createElement(Dialog.Close, { asChild: true },
|
|
21
|
+
React.createElement("button", { "aria-label": "Close", style: { backgroundColor: colorPalette.background.primary, color: colorPalette.text.primary } },
|
|
22
|
+
React.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
23
|
+
React.createElement("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }))))))));
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../lib/Atoms/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAcjD,MAAM,cAAc,GAAG,CAAC,EAAE,UAAU,EAAE,YAAY,EAAuB,EAAE,EAAE;IAC5E,OAAO,CACN,oBAAC,MAAM,CAAC,OAAO,IAAC,OAAO;QACtB,gCAAQ,KAAK,EAAE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AE,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE;wBAE7F,6BACC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;4BAElC,8BACC,CAAC,EAAC,ygBAAygB,EAC3gB,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,GACX,CACH,CACE,CACK,CACC,CACF,CACH,CACd,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -66,7 +66,7 @@ const MoreHorizonMenu = styled.div `
|
|
|
66
66
|
export const MoreHorizonButton = ({ colorPalette, handleToggleHistory, handleRefreshField, styles, }) => {
|
|
67
67
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
68
68
|
const [loading, setLoading] = useState(false);
|
|
69
|
-
const [yPosition, setYPosition] = useState("
|
|
69
|
+
const [yPosition, setYPosition] = useState("down");
|
|
70
70
|
const [xPosition, setXPosition] = useState("center");
|
|
71
71
|
const menuRef = useRef(null);
|
|
72
72
|
const buttonRef = useRef(null);
|
|
@@ -81,7 +81,7 @@ export const MoreHorizonButton = ({ colorPalette, handleToggleHistory, handleRef
|
|
|
81
81
|
setYPosition("down");
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
|
-
setYPosition("
|
|
84
|
+
setYPosition("down");
|
|
85
85
|
}
|
|
86
86
|
if (buttonRect.width > buttonRect.x) {
|
|
87
87
|
setXPosition("right");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreHorizonButton.js","sourceRoot":"","sources":["../../../lib/Atoms/MoreHorizonButton/MoreHorizonButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,MAAqB,MAAM,iBAAiB,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B,oBAAC,WAAW,OAAG;0BAEI,CACH,CACI,CACvB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CSSObject } from "@emotion/styled";
|
|
3
2
|
import { Colors } from "Theme/types";
|
|
4
|
-
interface NumberFieldProps {
|
|
3
|
+
interface NumberFieldProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
5
4
|
colorPalette: Colors & string;
|
|
6
5
|
handleChange: (event: {
|
|
7
6
|
target: {
|
|
8
7
|
name: string;
|
|
9
|
-
value:
|
|
8
|
+
value: string;
|
|
10
9
|
};
|
|
11
10
|
}) => Promise<void>;
|
|
12
11
|
handleBlur?: (newValue?: string | number) => Promise<void>;
|
|
13
12
|
fromTable?: boolean;
|
|
14
|
-
value: string | number | undefined;
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
styles?: CSSObject;
|
|
17
13
|
moreHorizon?: JSX.Element;
|
|
18
|
-
name?: string;
|
|
19
14
|
}
|
|
20
|
-
export declare const NumberField: (
|
|
15
|
+
export declare const NumberField: (props: NumberFieldProps) => React.JSX.Element;
|
|
21
16
|
export {};
|
|
@@ -5,23 +5,22 @@ const NumberFieldContainer = styled.div `
|
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
width: 100%;
|
|
8
|
-
${({ styles }) => styles && styles}
|
|
9
8
|
`;
|
|
10
9
|
const NumberInput = styled.input `
|
|
11
10
|
display: flex;
|
|
12
11
|
justify-content: center;
|
|
13
12
|
align-items: center;
|
|
14
13
|
text-align: center;
|
|
15
|
-
min-width:
|
|
14
|
+
min-width: 120px;
|
|
16
15
|
height: 38px;
|
|
17
16
|
width: 100%;
|
|
18
17
|
gap: 10px;
|
|
19
18
|
align-self: stretch;
|
|
20
|
-
color: ${({
|
|
21
|
-
background: ${({
|
|
19
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
20
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
22
21
|
border-width: 1px;
|
|
23
22
|
border-style: solid;
|
|
24
|
-
border-color: ${({
|
|
23
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
25
24
|
border-right: none;
|
|
26
25
|
border-left: none;
|
|
27
26
|
border-radius: 0px;
|
|
@@ -46,9 +45,9 @@ const DecrementButton = styled.div `
|
|
|
46
45
|
border-radius: 4px 0px 0px 4px;
|
|
47
46
|
border-width: 1px;
|
|
48
47
|
border-style: solid;
|
|
49
|
-
border-color: ${({
|
|
50
|
-
background: ${({
|
|
51
|
-
color: ${({
|
|
48
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
49
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
50
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
52
51
|
`;
|
|
53
52
|
const IncrementButton = styled.div `
|
|
54
53
|
cursor: pointer;
|
|
@@ -60,39 +59,78 @@ const IncrementButton = styled.div `
|
|
|
60
59
|
align-items: center;
|
|
61
60
|
border-width: 1px;
|
|
62
61
|
border-style: solid;
|
|
63
|
-
border-color: ${({
|
|
64
|
-
background: ${({
|
|
65
|
-
color: ${({
|
|
62
|
+
border-color: ${({ colorPalette }) => colorPalette.border.primary};
|
|
63
|
+
background: ${({ colorPalette }) => colorPalette.background.primary};
|
|
64
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
66
65
|
${({ moreHorizon }) => !moreHorizon && `border-radius: 0px 4px 4px 0px;`}
|
|
67
66
|
${({ moreHorizon }) => moreHorizon && `border-right: none;`}
|
|
68
67
|
`;
|
|
69
|
-
export const NumberField = (
|
|
68
|
+
export const NumberField = (props) => {
|
|
69
|
+
const { colorPalette, handleChange, handleBlur, fromTable, moreHorizon, value, } = props;
|
|
70
70
|
const inputRef = useRef(null);
|
|
71
71
|
const [numberValue, setNumberValue] = useState(value ? Number(value) : "");
|
|
72
72
|
useEffect(() => {
|
|
73
73
|
setNumberValue(value ? Number(value) : "");
|
|
74
|
+
if (inputRef.current)
|
|
75
|
+
inputRef.current.value = value ? String(value) : "";
|
|
74
76
|
}, [value]);
|
|
75
77
|
const handleIncrement = () => {
|
|
76
|
-
|
|
78
|
+
let stepper = 0.1;
|
|
79
|
+
const event = {
|
|
80
|
+
target: {
|
|
81
|
+
name: inputRef.current?.name || "",
|
|
82
|
+
value: String(numberValue),
|
|
83
|
+
},
|
|
84
|
+
};
|
|
77
85
|
if (numberValue === "" || numberValue === undefined) {
|
|
78
|
-
event.target.value = "1";
|
|
79
86
|
setNumberValue(1);
|
|
87
|
+
event.target.value = "1";
|
|
88
|
+
if (inputRef.current)
|
|
89
|
+
inputRef.current.value = event.target.value;
|
|
80
90
|
}
|
|
81
91
|
else {
|
|
82
|
-
|
|
83
|
-
|
|
92
|
+
let newValue = Number(numberValue);
|
|
93
|
+
if (!String(newValue).includes(".")) {
|
|
94
|
+
stepper = 1;
|
|
95
|
+
newValue = newValue + stepper;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
newValue = (newValue + stepper).toFixed(1);
|
|
99
|
+
}
|
|
100
|
+
setNumberValue(newValue);
|
|
101
|
+
event.target.value = String(newValue);
|
|
102
|
+
if (inputRef.current)
|
|
103
|
+
inputRef.current.value = event.target.value;
|
|
84
104
|
}
|
|
85
105
|
handleChange(event);
|
|
86
106
|
};
|
|
87
107
|
const handleDecrement = () => {
|
|
88
|
-
|
|
108
|
+
let stepper = 0.1;
|
|
109
|
+
const event = {
|
|
110
|
+
target: {
|
|
111
|
+
name: inputRef.current?.name || "",
|
|
112
|
+
value: String(numberValue),
|
|
113
|
+
},
|
|
114
|
+
};
|
|
89
115
|
if (numberValue === "" || numberValue === undefined) {
|
|
90
|
-
event.target.value = "-1";
|
|
91
116
|
setNumberValue(-1);
|
|
117
|
+
event.target.value = "-1";
|
|
118
|
+
if (inputRef.current)
|
|
119
|
+
inputRef.current.value = event.target.value;
|
|
92
120
|
}
|
|
93
121
|
else {
|
|
94
|
-
|
|
95
|
-
|
|
122
|
+
let newValue = Number(numberValue);
|
|
123
|
+
if (!String(newValue).includes(".")) {
|
|
124
|
+
stepper = 1;
|
|
125
|
+
newValue = newValue - stepper;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
newValue = (newValue - stepper).toFixed(1);
|
|
129
|
+
}
|
|
130
|
+
setNumberValue(newValue);
|
|
131
|
+
event.target.value = String(newValue);
|
|
132
|
+
if (inputRef.current)
|
|
133
|
+
inputRef.current.value = event.target.value;
|
|
96
134
|
}
|
|
97
135
|
handleChange(event);
|
|
98
136
|
};
|
|
@@ -106,23 +144,31 @@ export const NumberField = ({ colorPalette, handleChange, handleBlur, fromTable,
|
|
|
106
144
|
}
|
|
107
145
|
};
|
|
108
146
|
const handleNumberChange = (e) => {
|
|
109
|
-
|
|
110
|
-
if (isNaN(value)) {
|
|
111
|
-
e.target.value = "";
|
|
147
|
+
if (!e.target.value.match(/^[\+\-]?\d+(\.\d*)?([eE][\+\-]?\d+)?$/)) {
|
|
112
148
|
setNumberValue("");
|
|
149
|
+
return;
|
|
113
150
|
}
|
|
114
151
|
else {
|
|
115
|
-
|
|
152
|
+
if (e.target.value.endsWith(".")) {
|
|
153
|
+
setNumberValue(e.target.value);
|
|
154
|
+
if (inputRef.current)
|
|
155
|
+
inputRef.current.value = e.target.value;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
setNumberValue(e.target.value);
|
|
159
|
+
if (inputRef.current)
|
|
160
|
+
inputRef.current.value = e.target.value;
|
|
161
|
+
handleChange(e);
|
|
162
|
+
}
|
|
116
163
|
}
|
|
117
|
-
handleChange(e);
|
|
118
164
|
};
|
|
119
|
-
return (React.createElement(NumberFieldContainer, {
|
|
120
|
-
React.createElement(DecrementButton, {
|
|
165
|
+
return (React.createElement(NumberFieldContainer, { colorPalette: colorPalette },
|
|
166
|
+
React.createElement(DecrementButton, { colorPalette: colorPalette, onClick: handleDecrement, tabIndex: -1, onBlur: () => {
|
|
121
167
|
handleBlur && handleBlur(inputRef.current?.value || "");
|
|
122
168
|
} },
|
|
123
169
|
React.createElement(FiMinus, null)),
|
|
124
|
-
React.createElement(NumberInput, {
|
|
125
|
-
React.createElement(IncrementButton, {
|
|
170
|
+
React.createElement(NumberInput, { ...props, value: numberValue, onChange: handleNumberChange, onBlur: (e) => handleBlur && handleBlur(e.target.value), color: colorPalette, ref: inputRef, onFocus: handleFocus, type: "text" }),
|
|
171
|
+
React.createElement(IncrementButton, { colorPalette: colorPalette, onClick: handleIncrement, tabIndex: -1, onBlur: () => {
|
|
126
172
|
handleBlur && handleBlur(inputRef.current?.value || "");
|
|
127
173
|
}, moreHorizon: moreHorizon ? true : false },
|
|
128
174
|
React.createElement(FiPlus, null)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberField.js","sourceRoot":"","sources":["../../../lib/Atoms/NumberField/NumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,MAAqB,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGjD,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"NumberField.js","sourceRoot":"","sources":["../../../lib/Atoms/NumberField/NumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,MAAqB,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGjD,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAmC;;;;CAIzE,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAA0B;;;;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|
4
|
+
export interface CheckboxFieldValues {
|
|
5
|
+
[key: string]: Option;
|
|
6
|
+
}
|
|
7
|
+
interface SelectFieldProps {
|
|
8
|
+
handleChange(e: React.ChangeEvent<HTMLInputElement>): void;
|
|
9
|
+
colorPalette: Colors & string;
|
|
10
|
+
options: Option[];
|
|
11
|
+
moreHorizon?: JSX.Element;
|
|
12
|
+
values: CheckboxFieldValues | Option[] | undefined;
|
|
13
|
+
type: "radio" | "checkbox";
|
|
14
|
+
}
|
|
15
|
+
export declare const SelectField: (props: SelectFieldProps) => React.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { DropdownSelect } from "../DropdownField/DropdownField";
|
|
2
|
+
import React, { useState, useEffect } from "react";
|
|
3
|
+
import { Modal } from "../../Organisms/Modal/Modal";
|
|
4
|
+
import { FiX, FiCheckSquare, FiCheckCircle } from "react-icons/fi";
|
|
5
|
+
import { components } from "react-select";
|
|
6
|
+
const RadioIndicator = (props) => {
|
|
7
|
+
return (React.createElement(components.DropdownIndicator, { ...props },
|
|
8
|
+
React.createElement(FiCheckCircle, null)));
|
|
9
|
+
};
|
|
10
|
+
const CheckBoxIndicator = (props) => {
|
|
11
|
+
return (React.createElement(components.DropdownIndicator, { ...props },
|
|
12
|
+
React.createElement(FiCheckSquare, null)));
|
|
13
|
+
};
|
|
14
|
+
export const SelectField = (props) => {
|
|
15
|
+
const { handleChange, colorPalette, options, moreHorizon, values, type } = props;
|
|
16
|
+
const [open, setOpen] = useState(false);
|
|
17
|
+
const [selectOptions, setSelectOptions] = useState([]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setSelectOptions(options);
|
|
20
|
+
}, [values]);
|
|
21
|
+
return (React.createElement(React.Fragment, null,
|
|
22
|
+
React.createElement(DropdownSelect, { components: {
|
|
23
|
+
DropdownIndicator: type === "radio" ? RadioIndicator : CheckBoxIndicator,
|
|
24
|
+
}, colorPalette: colorPalette, options: options, isMulti: type === "radio" ? false : true, menuPortalTarget: document.body, isSearchable: false, value: values ? (type === "checkbox" ? Object.values(values) : values) : [], id: "", name: "", menuPlacement: "auto", menuIsOpen: false, onFocus: () => setOpen(true), isClearable: type === "checkbox" ? false : true, moreHorizon: moreHorizon ? moreHorizon : undefined, styles: {
|
|
25
|
+
multiValue: (provided, state) => ({
|
|
26
|
+
...provided,
|
|
27
|
+
backgroundColor: colorPalette.background.secondary,
|
|
28
|
+
color: colorPalette.text.primary,
|
|
29
|
+
padding: "4px",
|
|
30
|
+
"div[role=button]": {
|
|
31
|
+
display: "none",
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
} }),
|
|
35
|
+
React.createElement(Modal, { colorPalette: colorPalette, open: open, setOpen: setOpen },
|
|
36
|
+
React.createElement("div", { style: {
|
|
37
|
+
width: "100",
|
|
38
|
+
display: "flex",
|
|
39
|
+
justifyContent: "end",
|
|
40
|
+
padding: "24px 24px 0px 24px",
|
|
41
|
+
} },
|
|
42
|
+
React.createElement(FiX, { onClick: () => setOpen(!open), size: 24 })),
|
|
43
|
+
React.createElement("div", { style: {
|
|
44
|
+
display: "flex",
|
|
45
|
+
padding: "0px 24px 24px 24px",
|
|
46
|
+
justifyContent: "space-evenly",
|
|
47
|
+
flexWrap: "wrap",
|
|
48
|
+
overflow: "auto",
|
|
49
|
+
} }, selectOptions.map((option) => (React.createElement("div", { key: `${option.id}`, style: {
|
|
50
|
+
fontSize: "14px",
|
|
51
|
+
fontWeight: "600",
|
|
52
|
+
display: "flex",
|
|
53
|
+
justifyContent: "center",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
gap: "8px",
|
|
56
|
+
paddingBottom: "16px",
|
|
57
|
+
} },
|
|
58
|
+
React.createElement("input", { type: type, id: option.linkedId || option.id, value: option.label || "", checked: values
|
|
59
|
+
? values instanceof Array
|
|
60
|
+
? values.some((value) => value.id === option.id)
|
|
61
|
+
: values[option.id] && true
|
|
62
|
+
: false, onChange: handleChange }),
|
|
63
|
+
React.createElement("label", { htmlFor: option.label }, option.label))))))));
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=SelectField.js.map
|
|
@@ -0,0 +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;IACxD,OAAO,CACN,oBAAC,UAAU,CAAC,iBAAiB,OAAK,KAAK;QACtC,oBAAC,aAAa,OAAG,CACa,CAC/B,CAAC;AACH,CAAC,CAAC;AACF,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IAC3D,OAAO,CACN,oBAAC,UAAU,CAAC,iBAAiB,OAAK,KAAK;QACtC,oBAAC,aAAa,OAAG,CACa,CAC/B,CAAC;AACH,CAAC,CAAC;AAeF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACtD,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,GACvE,KAAK,CAAC;IACP,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IAEjE,SAAS,CAAC,GAAG,EAAE;QACd,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC3B,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AAE,MAAM,CAAC,KAAK,IAAG,MAAM,CAAC,KAAK,CAAS,CAC/C,CACN,CAAC,CACG,CACC,CACN,CACH,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Colors } from "../../Theme/types";
|
|
3
3
|
interface TextFieldWrapperProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
4
|
-
activeEditing
|
|
4
|
+
activeEditing?: boolean;
|
|
5
5
|
colorPalette: Colors & string;
|
|
6
|
-
moreHorizon
|
|
6
|
+
moreHorizon?: JSX.Element;
|
|
7
7
|
}
|
|
8
8
|
export declare const TextFieldWrapper: (props: TextFieldWrapperProps) => React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -17,6 +17,9 @@ const InputWrapper = styled.input `
|
|
|
17
17
|
padding-left: 16px;
|
|
18
18
|
${({ moreHorizon }) => moreHorizon && `border-right: none;`}
|
|
19
19
|
height: 38px;
|
|
20
|
+
::placeholder {
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
}
|
|
20
23
|
`;
|
|
21
24
|
export const TextFieldWrapper = (props) => {
|
|
22
25
|
const { activeEditing, value, onChange, moreHorizon } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../lib/Atoms/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAG/B;;;;;;GAMC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CACrB,WAAW;IACX,+DAA+D;qBAC5C,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO;iBACzD,CAA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,GAAG,CAAC,OAAO,CAAC;QAC1B,IAAI,aAAa,IAAI,MAAM,EAAE,CAAC;YAC7B,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC;gBACrB,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACzC,CAAC;QACF,CAAC;IACF,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;IAEnC,MAAM,YAAY,GAAG,CAAC,CAAsC,EAAE,EAAE;QAC/D,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACnC,IAAI,QAAQ;YAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;QAC7C,oBAAC,YAAY,OACR,KAAK,EACT,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GACtC;QACD,WAAW,IAAI,WAAW,CACtB,CACN,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -116,13 +116,13 @@ export const Thumbnail = ({ colorPalette, handleSubmit, settingsChildren, showIm
|
|
|
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
|
-
React.createElement(Button, { colorPalette: colorPalette, icon: React.createElement(FiSettings, null), variant: "outlined",
|
|
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
121
|
showImage && !showSettings && (React.createElement(InputArea, { onDrop: handleDrop, onDragOver: handleDragOver, color: colorPalette },
|
|
122
122
|
selectedImage && (React.createElement(PreviewImage, { alt: s3Key || "Uploaded Image", color: colorPalette, src: selectedImage })),
|
|
123
|
-
React.createElement(Button, { colorPalette: colorPalette, label: "Browse",
|
|
124
|
-
React.createElement("input", { type: "file", name: "key", accept: acceptedFileTypes.join(","), onChange: handleImageUpload, ref: inputRef, id: `upload-image-${fieldInstance.id}`, multiple: false })))),
|
|
123
|
+
React.createElement(Button, { colorPalette: colorPalette, label: "Browse", variant: "filled", onClick: handleBrowseClick },
|
|
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
125
|
showSettings && showImage && (React.createElement(SettingsArea, { color: colorPalette }, settingsChildren)),
|
|
126
|
-
changed && (React.createElement(Button, { colorPalette: colorPalette, onClick: handleSubmit, variant: "filled",
|
|
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,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YAAY,GACpB,CACF,CACC,CACH,CACI;QACL,SAAS,IAAI,CAAC,YAAY,IAAI,CAC9B,oBAAC,SAAS,IACT,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,YAAY;YAElB,aAAa,IAAI,CACjB,oBAAC,YAAY,IACZ,GAAG,EAAE,KAAK,IAAI,gBAAgB,EAC9B,KAAK,EAAE,YAAY,EACnB,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,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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Colors } from "../../Theme/types";
|
|
3
|
+
interface ModalProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
4
|
+
open: boolean;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
colorPalette: Colors & string;
|
|
7
|
+
setOpen: (open: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Modal: (props: ModalProps) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
const StyledDialog = styled(Dialog.Overlay) `
|
|
5
|
+
background-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
6
|
+
opacity: 0.8;
|
|
7
|
+
position: absolute;
|
|
8
|
+
inset: 0;
|
|
9
|
+
animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
10
|
+
z-index: 1000;
|
|
11
|
+
`;
|
|
12
|
+
const StyledContent = styled(Dialog.Content) `
|
|
13
|
+
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
14
|
+
box-shadow: ${({ colorPalette }) => `${colorPalette.background.secondary} 0px 5px 15px`};
|
|
15
|
+
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
16
|
+
border-radius: 4px;
|
|
17
|
+
position: fixed;
|
|
18
|
+
top: 50%;
|
|
19
|
+
left: 50%;
|
|
20
|
+
transform: translate(-50%, -50%);
|
|
21
|
+
max-height: 85vh;
|
|
22
|
+
animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
23
|
+
z-index: 1000;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
min-width: 696px;
|
|
27
|
+
gap: 16px;
|
|
28
|
+
@media (max-width: 660px) {
|
|
29
|
+
min-width: 300px;
|
|
30
|
+
}
|
|
31
|
+
:focus {
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
export const Modal = (props) => {
|
|
36
|
+
const { open, children, colorPalette, setOpen } = props;
|
|
37
|
+
return (React.createElement(Dialog.Root, { open: open, modal: true },
|
|
38
|
+
React.createElement(Dialog.Portal, null,
|
|
39
|
+
React.createElement(Dialog.Title, null),
|
|
40
|
+
React.createElement(StyledDialog, { colorPalette: colorPalette }),
|
|
41
|
+
React.createElement(StyledContent, { ...props, colorPalette: colorPalette, onInteractOutside: () => setOpen(false), onPointerDownOutside: () => setOpen(false) }, children))));
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +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;AAIrC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAA0B;qBAChD,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS;;;;;;CAM3E,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAA0B;qBACjD,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO;eAC3D,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAClC,GAAG,YAAY,CAAC,UAAU,CAAC,SAAS,eAAe;UAC3C,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;CAmBxD,CAAC;AAaF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAiB,EAAE,EAAE;IAC1C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAExD,OAAO,CACN,oBAAC,MAAM,CAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI;QACnC,oBAAC,MAAM,CAAC,MAAM;YACd,oBAAC,MAAM,CAAC,KAAK,OAAG;YACf,oBAAC,YAAY,IAAC,YAAY,EAAE,YAAY,GAAI;YAC5C,oBAAC,aAAa,OACT,KAAK,EACT,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EACvC,oBAAoB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAEzC,QAAQ,CACM,CACD,CACH,CACd,CAAC;AACH,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,3 +9,5 @@ export * from "./Atoms/DropdownField/DropdownField";
|
|
|
9
9
|
export * from "./Molecules/Thumbnail/Thumbnail";
|
|
10
10
|
export * from "./Organisms/Card/Card";
|
|
11
11
|
export * from "./Atoms/NoteField/NoteField";
|
|
12
|
+
export * from "./Atoms/SelectField/SelectField";
|
|
13
|
+
export * from "./Organisms/Modal/Modal";
|
package/dist/index.js
CHANGED
|
@@ -11,4 +11,6 @@ export * from "./Atoms/DropdownField/DropdownField";
|
|
|
11
11
|
export * from "./Molecules/Thumbnail/Thumbnail";
|
|
12
12
|
export * from "./Organisms/Card/Card";
|
|
13
13
|
export * from "./Atoms/NoteField/NoteField";
|
|
14
|
+
export * from "./Atoms/SelectField/SelectField";
|
|
15
|
+
export * from "./Organisms/Modal/Modal";
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iCAAiC,CAAC;AAChD,6DAA6D;AAC7D,cAAc,+BAA+B,CAAC;AAC9C,qDAAqD;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iCAAiC,CAAC;AAChD,6DAA6D;AAC7D,cAAc,+BAA+B,CAAC;AAC9C,qDAAqD;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
export interface AwsDefaults {
|
|
2
|
+
id: string;
|
|
3
|
+
createdAt: string;
|
|
4
|
+
updatedAt: string;
|
|
5
|
+
group: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AwsItems<T> {
|
|
8
|
+
items: T[];
|
|
9
|
+
nextToken?: string;
|
|
10
|
+
}
|
|
11
|
+
export type UpdateObj = Record<string, FieldInstance> & {
|
|
12
|
+
_nav?: string;
|
|
13
|
+
};
|
|
14
|
+
export interface FieldContinuationDataForResolver extends AwsDefaults {
|
|
15
|
+
continuationActions: string[];
|
|
16
|
+
fieldTemplateId: string;
|
|
17
|
+
formTemplateId: string;
|
|
18
|
+
instanceToContinueOn: string;
|
|
19
|
+
parentFormTemplateId: string;
|
|
20
|
+
readGroups: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface FieldContinuationData extends FieldContinuationDataForResolver {
|
|
23
|
+
fieldTemplate?: FieldTemplate;
|
|
24
|
+
formTemplate?: FormTemplate;
|
|
25
|
+
}
|
|
26
|
+
export interface Option extends AwsDefaults {
|
|
27
|
+
fieldTemplateId: string;
|
|
28
|
+
formTemplate: string;
|
|
29
|
+
label: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
docId?: string;
|
|
32
|
+
exportData?: string[];
|
|
33
|
+
exportActions?: string[];
|
|
34
|
+
linkedId?: string;
|
|
35
|
+
deleted?: boolean;
|
|
36
|
+
readGroups: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface FieldTemplateForResolver extends AwsDefaults {
|
|
39
|
+
action: string[];
|
|
40
|
+
actionData: string[];
|
|
41
|
+
deleted?: boolean;
|
|
42
|
+
exportData: string[];
|
|
43
|
+
exportType: string;
|
|
44
|
+
exportActions: string[];
|
|
45
|
+
formTemplate: string;
|
|
46
|
+
header: string;
|
|
47
|
+
inputType: string;
|
|
48
|
+
optionsOrder?: string[];
|
|
49
|
+
rowOrder?: string[];
|
|
50
|
+
tableField?: string;
|
|
51
|
+
docId: string;
|
|
52
|
+
continuationDataId?: string;
|
|
53
|
+
placeholder?: string;
|
|
54
|
+
pixelFollowing?: number;
|
|
55
|
+
pixelInitial?: number;
|
|
56
|
+
rowsAllowed?: number;
|
|
57
|
+
totalExtraLines?: number;
|
|
58
|
+
font?: string;
|
|
59
|
+
fontSize?: number;
|
|
60
|
+
bold?: boolean;
|
|
61
|
+
rollLinkId?: string;
|
|
62
|
+
version?: string;
|
|
63
|
+
baseFieldTemplate?: string;
|
|
64
|
+
readGroups: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface FieldTemplate extends FieldTemplateForResolver {
|
|
67
|
+
tableFields?: AwsItems<FieldTemplate>;
|
|
68
|
+
options?: AwsItems<Option>;
|
|
69
|
+
continuationData?: FieldContinuationData;
|
|
70
|
+
}
|
|
71
|
+
export interface FormTemplateForResolver extends AwsDefaults {
|
|
72
|
+
createdBy?: string;
|
|
73
|
+
deleted?: boolean;
|
|
74
|
+
description?: string;
|
|
75
|
+
exportInstruction?: string;
|
|
76
|
+
exportType?: string;
|
|
77
|
+
fieldsOrder?: string[];
|
|
78
|
+
formTemplateGroup: string;
|
|
79
|
+
imagesPerPage?: number;
|
|
80
|
+
projectId?: string;
|
|
81
|
+
publish?: boolean;
|
|
82
|
+
template: string;
|
|
83
|
+
templateName?: string;
|
|
84
|
+
type?: string;
|
|
85
|
+
updatedBy?: string;
|
|
86
|
+
version?: string;
|
|
87
|
+
versionName?: string;
|
|
88
|
+
readGroups: string[];
|
|
89
|
+
}
|
|
90
|
+
export interface FormTemplate extends FormTemplateForResolver {
|
|
91
|
+
fieldTemplates?: AwsItems<FieldTemplate>;
|
|
92
|
+
}
|
|
93
|
+
export interface FormGroupForResolver extends AwsDefaults {
|
|
94
|
+
users?: string[];
|
|
95
|
+
name: string;
|
|
96
|
+
projectId: string;
|
|
97
|
+
type: string;
|
|
98
|
+
formOrder: string[];
|
|
99
|
+
group: string;
|
|
100
|
+
}
|
|
101
|
+
export interface FormGroup extends FormGroupForResolver {
|
|
102
|
+
fieldInstances?: AwsItems<FieldInstance>;
|
|
103
|
+
formInstances?: AwsItems<FormInstance>;
|
|
104
|
+
}
|
|
105
|
+
export interface FormInstanceForResolver extends AwsDefaults {
|
|
106
|
+
formTemplateId: string;
|
|
107
|
+
formGroup: string;
|
|
108
|
+
exportInstruction?: string;
|
|
109
|
+
group: string;
|
|
110
|
+
}
|
|
111
|
+
export interface FormInstance extends FormInstanceForResolver {
|
|
112
|
+
formTemplate?: FormTemplate;
|
|
113
|
+
fieldInstances: AwsItems<FieldInstance>;
|
|
114
|
+
}
|
|
115
|
+
export interface FieldInstanceForResolver extends AwsDefaults {
|
|
116
|
+
formInstance?: string | null;
|
|
117
|
+
formGroup: string;
|
|
118
|
+
fieldTemplateId: string | null;
|
|
119
|
+
value: string;
|
|
120
|
+
altInstanceId?: string;
|
|
121
|
+
imageId?: string;
|
|
122
|
+
tableField?: string | null;
|
|
123
|
+
fieldsOrder: string[] | null;
|
|
124
|
+
sortingPriority?: string | null;
|
|
125
|
+
notes: string;
|
|
126
|
+
forceUpdateData?: string;
|
|
127
|
+
exportInstruction?: string;
|
|
128
|
+
authors: string[];
|
|
129
|
+
editing: string;
|
|
130
|
+
lastAuthor?: string;
|
|
131
|
+
group: string;
|
|
132
|
+
/**
|
|
133
|
+
* This will only appear on offline fields. DO NOT ATTACH TO FIELD INSTANCE AND TRY TO PASS TO BATCH RESOLVER
|
|
134
|
+
*/
|
|
135
|
+
touched?: number;
|
|
136
|
+
}
|
|
137
|
+
export interface FieldInstance extends FieldInstanceForResolver {
|
|
138
|
+
fieldTemplate?: FieldTemplate | null;
|
|
139
|
+
altInstance?: FieldInstanceForResolver | null;
|
|
140
|
+
image?: Image | null;
|
|
141
|
+
tableFields: AwsItems<FieldInstance>;
|
|
142
|
+
}
|
|
143
|
+
export interface Image extends AwsDefaults {
|
|
144
|
+
key: string | {
|
|
145
|
+
files: File[];
|
|
146
|
+
};
|
|
147
|
+
formGroup: string;
|
|
148
|
+
project: string;
|
|
149
|
+
rotation: string;
|
|
150
|
+
dpi: string;
|
|
151
|
+
aspectX: string;
|
|
152
|
+
aspectY: string;
|
|
153
|
+
group: string;
|
|
154
|
+
}
|
|
155
|
+
export interface Analytics {
|
|
156
|
+
userDoc?: string;
|
|
157
|
+
newFormGroups?: number;
|
|
158
|
+
newFormInstances?: number;
|
|
159
|
+
exports?: number;
|
|
160
|
+
events?: string[];
|
|
161
|
+
errors?: string[];
|
|
162
|
+
startTime?: string;
|
|
163
|
+
endTime?: string;
|
|
164
|
+
id: string;
|
|
165
|
+
createdAt?: string;
|
|
166
|
+
updatedAt?: string;
|
|
167
|
+
group: string;
|
|
168
|
+
}
|
|
169
|
+
export interface AnalyticsEvent extends AwsDefaults {
|
|
170
|
+
userDoc: string;
|
|
171
|
+
action?: string;
|
|
172
|
+
data?: string;
|
|
173
|
+
startTime?: string;
|
|
174
|
+
endTime?: string;
|
|
175
|
+
error?: string;
|
|
176
|
+
group: string;
|
|
177
|
+
}
|
|
178
|
+
export interface UserForResolver extends AwsDefaults {
|
|
179
|
+
username: string;
|
|
180
|
+
email?: string;
|
|
181
|
+
hideTutorial?: boolean;
|
|
182
|
+
isDeveloper?: boolean;
|
|
183
|
+
lightMode?: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface User extends UserForResolver {
|
|
186
|
+
messages?: [UserMessage];
|
|
187
|
+
analytics?: [Analytics];
|
|
188
|
+
}
|
|
189
|
+
export interface UserMessage extends AwsDefaults {
|
|
190
|
+
userId: string;
|
|
191
|
+
messageId: string;
|
|
192
|
+
user?: User;
|
|
193
|
+
message?: Message;
|
|
194
|
+
read?: boolean;
|
|
195
|
+
lightMode?: boolean;
|
|
196
|
+
group: string;
|
|
197
|
+
}
|
|
198
|
+
export interface Message extends AwsDefaults {
|
|
199
|
+
subject?: string;
|
|
200
|
+
from?: string;
|
|
201
|
+
author?: string;
|
|
202
|
+
message?: string;
|
|
203
|
+
projects?: [string];
|
|
204
|
+
group: string;
|
|
205
|
+
}
|
|
206
|
+
export interface ProjectForResolver extends AwsDefaults {
|
|
207
|
+
users?: string[];
|
|
208
|
+
name?: string;
|
|
209
|
+
public?: boolean;
|
|
210
|
+
forceUpdateData?: string;
|
|
211
|
+
group: string;
|
|
212
|
+
}
|
|
213
|
+
export interface Project extends ProjectForResolver {
|
|
214
|
+
formGroups: AwsItems<FormGroup>;
|
|
215
|
+
/**
|
|
216
|
+
* This only exists in state, for the purpose of knowing if the project needs to be the one that is on the "online" side of the
|
|
217
|
+
* sync menu
|
|
218
|
+
*/
|
|
219
|
+
sync?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* This only exists in state, for the purpose of knowing if the project exists only offline. That way, you can select this
|
|
222
|
+
* project within the sync menu
|
|
223
|
+
*/
|
|
224
|
+
offline?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* This exists only in state, for the purpose of knowing if the project exists only online. If you delete a project while online
|
|
227
|
+
* with this flag, the project then gets an offline flag because it still exists offline
|
|
228
|
+
*/
|
|
229
|
+
offlineAndOnline?: boolean;
|
|
230
|
+
}
|
|
231
|
+
export interface ImageBinary {
|
|
232
|
+
key: string;
|
|
233
|
+
binary: File;
|
|
234
|
+
}
|
|
235
|
+
export interface JsonStructure {
|
|
236
|
+
continuationDatas: FieldContinuationDataForResolver[];
|
|
237
|
+
fieldInstances: FieldInstanceForResolver[];
|
|
238
|
+
fieldTemplates: FieldTemplateForResolver[];
|
|
239
|
+
formGroups: FormGroupForResolver[];
|
|
240
|
+
formInstances: FormInstanceForResolver[];
|
|
241
|
+
formTemplates: FormTemplateForResolver[];
|
|
242
|
+
images: Image[];
|
|
243
|
+
options: Option[];
|
|
244
|
+
projects: ProjectForResolver[];
|
|
245
|
+
revisions: Revision[];
|
|
246
|
+
version: number;
|
|
247
|
+
}
|
|
248
|
+
export declare const CURRENT_JSON_VERSION = 1;
|
|
249
|
+
export interface Revision extends AwsDefaults {
|
|
250
|
+
fieldInstance: string;
|
|
251
|
+
formGroup: string;
|
|
252
|
+
value: string;
|
|
253
|
+
author: string;
|
|
254
|
+
group: string;
|
|
255
|
+
}
|
|
256
|
+
export type Source = "json" | "local" | "remote";
|
|
257
|
+
export interface SyncConfig {
|
|
258
|
+
/** Where the sync/merge request is going */
|
|
259
|
+
destination: Source;
|
|
260
|
+
/** Whether or not the user is online */
|
|
261
|
+
online: boolean;
|
|
262
|
+
/** When syncing from remote to local, whether or not the image binaries should be saved */
|
|
263
|
+
savePhotos?: boolean;
|
|
264
|
+
/** Where the sync/merge request is originating */
|
|
265
|
+
source: Source;
|
|
266
|
+
}
|
|
267
|
+
export interface AutoSyncConfig {
|
|
268
|
+
id: string;
|
|
269
|
+
baseTemplate: string;
|
|
270
|
+
versionIds: string[];
|
|
271
|
+
createdAt: string;
|
|
272
|
+
updatedAt: string;
|
|
273
|
+
autoSync: boolean;
|
|
274
|
+
}
|
|
275
|
+
export interface ProjectConfig {
|
|
276
|
+
id: string;
|
|
277
|
+
projectId: string;
|
|
278
|
+
userId: string;
|
|
279
|
+
createdAt: string;
|
|
280
|
+
updatedAt: string;
|
|
281
|
+
}
|
|
282
|
+
export interface BatchDeleteInput {
|
|
283
|
+
id: string;
|
|
284
|
+
}
|
|
285
|
+
export type RequirePropAsType<T, K extends keyof T, Type> = T & {
|
|
286
|
+
[P in K]-?: Type;
|
|
287
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AA+QA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factorearth/component-library",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3-alpha.0",
|
|
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",
|
|
@@ -24,28 +24,29 @@
|
|
|
24
24
|
"url": "https://github.com/FactorEarth/RecordMiddleware/issues"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@chromatic-com/storybook": "^
|
|
28
|
-
"@storybook/addon-backgrounds": "^8.
|
|
27
|
+
"@chromatic-com/storybook": "^2.0.2",
|
|
28
|
+
"@storybook/addon-backgrounds": "^8.3.3",
|
|
29
29
|
"@storybook/addon-designs": "^8.0.3",
|
|
30
|
-
"@storybook/addon-essentials": "^8.
|
|
31
|
-
"@storybook/addon-interactions": "^8.
|
|
32
|
-
"@storybook/addon-links": "^8.
|
|
33
|
-
"@storybook/addon-
|
|
34
|
-
"@storybook/addon-
|
|
35
|
-
"@storybook/
|
|
36
|
-
"@storybook/
|
|
37
|
-
"@storybook/react
|
|
38
|
-
"@storybook/
|
|
30
|
+
"@storybook/addon-essentials": "^8.3.3",
|
|
31
|
+
"@storybook/addon-interactions": "^8.3.3",
|
|
32
|
+
"@storybook/addon-links": "^8.3.3",
|
|
33
|
+
"@storybook/addon-mdx-gfm": "^8.3.3",
|
|
34
|
+
"@storybook/addon-onboarding": "^8.3.3",
|
|
35
|
+
"@storybook/addon-themes": "^8.3.3",
|
|
36
|
+
"@storybook/blocks": "^8.3.3",
|
|
37
|
+
"@storybook/react": "^8.3.3",
|
|
38
|
+
"@storybook/react-vite": "^8.3.3",
|
|
39
|
+
"@storybook/test": "^8.3.3",
|
|
39
40
|
"chromatic": "^11.7.1",
|
|
40
41
|
"prop-types": "^15.8.1",
|
|
41
|
-
"storybook": "^8.
|
|
42
|
+
"storybook": "^8.3.3",
|
|
42
43
|
"storybook-dark-mode": "^4.0.2"
|
|
43
44
|
},
|
|
44
45
|
"publishConfig": {
|
|
45
46
|
"access": "public",
|
|
46
47
|
"registry": "https://registry.npmjs.org/"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "aa559eed97a96d9c7164d1f6125ed09c5aae63cb",
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"@emotion/react": "^11.13.0",
|
|
51
52
|
"@emotion/styled": "^11.13.0",
|