@factorearth/component-library 3.2.2-alpha.0 → 3.2.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.
|
@@ -33,6 +33,9 @@ const NumberInput = styled.input `
|
|
|
33
33
|
-webkit-appearance: none;
|
|
34
34
|
margin: 0;
|
|
35
35
|
}
|
|
36
|
+
::placeholder {
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
}
|
|
36
39
|
`;
|
|
37
40
|
const DecrementButton = styled.div `
|
|
38
41
|
cursor: pointer;
|
|
@@ -76,7 +79,7 @@ export const NumberField = (props) => {
|
|
|
76
79
|
}, [value]);
|
|
77
80
|
const handleIncrement = () => {
|
|
78
81
|
let stepper = 0.1;
|
|
79
|
-
const leadingZeros = stringInt.length - stringInt.replace(/^0+/,
|
|
82
|
+
const leadingZeros = stringInt.length - stringInt.replace(/^0+/, "").length;
|
|
80
83
|
const event = {
|
|
81
84
|
target: {
|
|
82
85
|
name: inputRef.current?.name || "",
|
|
@@ -95,10 +98,10 @@ export const NumberField = (props) => {
|
|
|
95
98
|
stepper = 1;
|
|
96
99
|
newValue = String(Number(newValue) + stepper);
|
|
97
100
|
if (Number(newValue) > 0)
|
|
98
|
-
newValue = newValue.padStart(leadingZeros + newValue.toString().length,
|
|
101
|
+
newValue = newValue.padStart(leadingZeros + newValue.toString().length, "0");
|
|
99
102
|
}
|
|
100
103
|
else {
|
|
101
|
-
const decimalPlaces = newValue.split(
|
|
104
|
+
const decimalPlaces = newValue.split(".")[1].length;
|
|
102
105
|
stepper = 1 / Math.pow(10, decimalPlaces);
|
|
103
106
|
newValue = String((Number(newValue) + stepper).toFixed(decimalPlaces));
|
|
104
107
|
}
|
|
@@ -111,7 +114,7 @@ export const NumberField = (props) => {
|
|
|
111
114
|
};
|
|
112
115
|
const handleDecrement = () => {
|
|
113
116
|
let stepper = 1;
|
|
114
|
-
const leadingZeros = stringInt.length - stringInt.replace(/^0+/,
|
|
117
|
+
const leadingZeros = stringInt.length - stringInt.replace(/^0+/, "").length;
|
|
115
118
|
const event = {
|
|
116
119
|
target: {
|
|
117
120
|
name: inputRef.current?.name || "",
|
|
@@ -129,10 +132,10 @@ export const NumberField = (props) => {
|
|
|
129
132
|
if (!newValue.includes(".")) {
|
|
130
133
|
newValue = String(Number(newValue) - stepper);
|
|
131
134
|
if (Number(newValue) > 0)
|
|
132
|
-
newValue = newValue.padStart(leadingZeros + newValue.toString().length,
|
|
135
|
+
newValue = newValue.padStart(leadingZeros + newValue.toString().length, "0");
|
|
133
136
|
}
|
|
134
137
|
else {
|
|
135
|
-
const decimalPlaces = newValue.split(
|
|
138
|
+
const decimalPlaces = newValue.split(".")[1].length;
|
|
136
139
|
stepper = 1 / Math.pow(10, decimalPlaces);
|
|
137
140
|
newValue = String((Number(newValue) - stepper).toFixed(decimalPlaces));
|
|
138
141
|
}
|
|
@@ -154,7 +157,6 @@ export const NumberField = (props) => {
|
|
|
154
157
|
};
|
|
155
158
|
const handleNumberChange = (e) => {
|
|
156
159
|
if (!e.target.value.match(/^[\+\-]?\d+(\.\d*)?([eE][\+\-]?\d+)?$/)) {
|
|
157
|
-
setStringInt("");
|
|
158
160
|
return;
|
|
159
161
|
}
|
|
160
162
|
else {
|
|
@@ -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,CAAmC;;;;CAIzE,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAA0B;;;;;;;;;;UAUhD,CAAC,EAAE,YAA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,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YAEvC,oBAAC,MAAM,OAAG,CACO;QACjB,WAAW,IAAI,WAAW,CACL,CACvB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Colors } from "../../Theme/types";
|
|
3
|
+
export declare const StyledDialog: import("@emotion/styled").StyledComponent<any, {}, {
|
|
4
|
+
ref?: React.Ref<any> | undefined;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const StyledContent: import("@emotion/styled").StyledComponent<any, {}, {
|
|
7
|
+
ref?: React.Ref<any> | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const DialogContainer: import("@emotion/styled").StyledComponent<{
|
|
10
|
+
theme?: import("@emotion/react").Theme;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const ModalTitleContainer: import("@emotion/styled").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme;
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
17
|
+
export declare const ModalTitle: import("@emotion/styled").StyledComponent<{
|
|
18
|
+
theme?: import("@emotion/react").Theme;
|
|
19
|
+
as?: React.ElementType;
|
|
20
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
21
|
+
export declare const ModalHeading: import("@emotion/styled").StyledComponent<{
|
|
22
|
+
theme?: import("@emotion/react").Theme;
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
25
|
+
export declare const ModelSubHeading: import("@emotion/styled").StyledComponent<{
|
|
26
|
+
theme?: import("@emotion/react").Theme;
|
|
27
|
+
as?: React.ElementType;
|
|
28
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
29
|
+
export declare const ModalFooter: import("@emotion/styled").StyledComponent<{
|
|
30
|
+
theme?: import("@emotion/react").Theme;
|
|
31
|
+
as?: React.ElementType;
|
|
32
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
33
|
+
export declare const ModalInputBox: import("@emotion/styled").StyledComponent<{
|
|
34
|
+
theme?: import("@emotion/react").Theme;
|
|
35
|
+
as?: React.ElementType;
|
|
36
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
37
|
interface ModalProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
4
38
|
open: boolean;
|
|
5
39
|
children: React.ReactNode;
|
|
@@ -12,7 +46,8 @@ interface ConfirmationModalProps {
|
|
|
12
46
|
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
13
47
|
confirmTitle: string;
|
|
14
48
|
confirmText: string;
|
|
15
|
-
handleSubmit:
|
|
49
|
+
handleSubmit: any;
|
|
50
|
+
open: boolean;
|
|
16
51
|
}
|
|
17
52
|
export declare const ConfirmationModal: (props: ConfirmationModalProps) => React.JSX.Element;
|
|
18
53
|
export {};
|
|
@@ -3,7 +3,7 @@ import * as Dialog from "@radix-ui/react-dialog";
|
|
|
3
3
|
import styled from "@emotion/styled";
|
|
4
4
|
import { Button } from "../../Atoms/Buttons/Button";
|
|
5
5
|
import { FiX } from "react-icons/fi";
|
|
6
|
-
const StyledDialog = styled(Dialog.Overlay) `
|
|
6
|
+
export const StyledDialog = styled(Dialog.Overlay) `
|
|
7
7
|
background-color: ${({ colorPalette }) => colorPalette.background.secondary};
|
|
8
8
|
opacity: 0.8;
|
|
9
9
|
position: absolute;
|
|
@@ -11,7 +11,7 @@ const StyledDialog = styled(Dialog.Overlay) `
|
|
|
11
11
|
animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
12
12
|
z-index: 1000;
|
|
13
13
|
`;
|
|
14
|
-
const StyledContent = styled(Dialog.Content) `
|
|
14
|
+
export const StyledContent = styled(Dialog.Content) `
|
|
15
15
|
background-color: ${({ colorPalette }) => colorPalette.background.primary};
|
|
16
16
|
box-shadow: ${({ colorPalette }) => `${colorPalette.background.secondary} 0px 5px 15px`};
|
|
17
17
|
color: ${({ colorPalette }) => colorPalette.text.primary};
|
|
@@ -31,7 +31,7 @@ const StyledContent = styled(Dialog.Content) `
|
|
|
31
31
|
outline: none;
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
|
-
const DialogContainer = styled.div `
|
|
34
|
+
export const DialogContainer = styled.div `
|
|
35
35
|
display: flex;
|
|
36
36
|
padding: 24px 24px 0px 24px;
|
|
37
37
|
flex-direction: column;
|
|
@@ -39,13 +39,24 @@ const DialogContainer = styled.div `
|
|
|
39
39
|
gap: 16px;
|
|
40
40
|
align-self: stretch;
|
|
41
41
|
`;
|
|
42
|
-
const
|
|
42
|
+
export const ModalTitleContainer = styled.div `
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
width: 100%;
|
|
46
|
+
`;
|
|
47
|
+
export const ModalTitle = styled.div `
|
|
48
|
+
font-size: 24px;
|
|
49
|
+
font-style: normal;
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
line-height: 150%;
|
|
52
|
+
`;
|
|
53
|
+
export const ModalHeading = styled.div `
|
|
43
54
|
font-size: 16px;
|
|
44
55
|
font-style: normal;
|
|
45
56
|
font-weight: 700;
|
|
46
57
|
line-height: 150%;
|
|
47
58
|
`;
|
|
48
|
-
const ModelSubHeading = styled.div `
|
|
59
|
+
export const ModelSubHeading = styled.div `
|
|
49
60
|
font-size: 16px;
|
|
50
61
|
font-style: normal;
|
|
51
62
|
font-weight: 400;
|
|
@@ -53,7 +64,7 @@ const ModelSubHeading = styled.div `
|
|
|
53
64
|
letter-spacing: 0.16px;
|
|
54
65
|
width: 100%;
|
|
55
66
|
`;
|
|
56
|
-
const ModalFooter = styled.div `
|
|
67
|
+
export const ModalFooter = styled.div `
|
|
57
68
|
display: flex;
|
|
58
69
|
padding: 24px 16px;
|
|
59
70
|
justify-content: center;
|
|
@@ -61,7 +72,7 @@ const ModalFooter = styled.div `
|
|
|
61
72
|
gap: 16px;
|
|
62
73
|
align-self: stretch;
|
|
63
74
|
`;
|
|
64
|
-
const ModalInputBox = styled.div `
|
|
75
|
+
export const ModalInputBox = styled.div `
|
|
65
76
|
display: flex;
|
|
66
77
|
width: 322px;
|
|
67
78
|
flex-direction: column;
|
|
@@ -78,18 +89,15 @@ export const Modal = (props) => {
|
|
|
78
89
|
React.createElement(StyledContent, { ...props, colorPalette: colorPalette, onInteractOutside: () => setOpen(false), onPointerDownOutside: () => setOpen(false) }, children))));
|
|
79
90
|
};
|
|
80
91
|
export const ConfirmationModal = (props) => {
|
|
81
|
-
const { colorPalette, setOpen, confirmTitle, confirmText, handleSubmit } = props;
|
|
82
|
-
return (React.createElement(
|
|
83
|
-
React.createElement(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
React.createElement(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
React.createElement(ModalFooter, null,
|
|
92
|
-
React.createElement(Button, { colorPalette: colorPalette, variant: "filled", label: "Ok", onClick: handleSubmit }),
|
|
93
|
-
React.createElement(Button, { colorPalette: colorPalette, variant: "destructive", label: "Cancel", onClick: () => setOpen(false) }))));
|
|
92
|
+
const { colorPalette, setOpen, confirmTitle, confirmText, handleSubmit, open, } = props;
|
|
93
|
+
return (React.createElement(Modal, { colorPalette: colorPalette, open: open, setOpen: setOpen },
|
|
94
|
+
React.createElement(DialogContainer, null,
|
|
95
|
+
React.createElement(ModalTitleContainer, null,
|
|
96
|
+
React.createElement(ModalTitle, null, confirmTitle),
|
|
97
|
+
React.createElement(FiX, { onClick: () => setOpen(false), size: 24 })),
|
|
98
|
+
React.createElement(ModelSubHeading, null, confirmText),
|
|
99
|
+
React.createElement(ModalFooter, null,
|
|
100
|
+
React.createElement(Button, { colorPalette: colorPalette, variant: "filled", label: "Ok", onClick: handleSubmit }),
|
|
101
|
+
React.createElement(Button, { colorPalette: colorPalette, variant: "destructive", label: "Cancel", onClick: () => setOpen(false) })))));
|
|
94
102
|
};
|
|
95
103
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../lib/Organisms/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAEjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAA0B;
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../lib/Organisms/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAEjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAA0B;qBACvD,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS;;;;;;CAM3E,CAAC;AA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2.
|
|
3
|
+
"version": "3.2.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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"access": "public",
|
|
47
47
|
"registry": "https://registry.npmjs.org/"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "8eebf3ebe78a55fd0f3424265e29c7340128b646",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@emotion/react": "^11.13.0",
|
|
52
52
|
"@emotion/styled": "^11.13.0",
|