@monolith-forensics/monolith-ui 1.0.7 → 1.0.9
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/package.json +21 -3
- package/rollup.config.js +10 -0
- package/src/components/ArrowButton/ArrowButton.tsx +54 -0
- package/src/components/ArrowButton/index.tsx +1 -0
- package/src/components/Button/Button.tsx +278 -0
- package/src/components/Button/index.ts +1 -0
- package/src/{Calendar → components/Calendar}/Calendar.js +365 -329
- package/src/{Calendar → components/Calendar}/CalendarStyles.js +190 -168
- package/src/{Calendar → components/Calendar}/calendarHelpers.js +194 -194
- package/src/components/DateInput/DateInput.js +583 -0
- package/src/components/FieldLabel/FieldLabel.tsx +152 -0
- package/src/components/FieldLabel/index.ts +1 -0
- package/src/components/FileInputField/FileInputField.js +171 -0
- package/src/components/Input/Input.tsx +141 -0
- package/src/components/Input/index.tsx +1 -0
- package/src/components/Pill/Pill.tsx +144 -0
- package/src/components/Pill/index.ts +1 -0
- package/src/components/SelectBox/SelectBox.js +543 -0
- package/src/components/TagBox/TagBox.js +563 -0
- package/src/components/TextArea/TextArea.tsx +70 -0
- package/src/components/TextArea/index.ts +1 -0
- package/src/components/TextAreaInput/TextAreaInput.tsx +48 -0
- package/src/components/TextAreaInput/index.ts +1 -0
- package/src/components/TextInput/TextInput.tsx +50 -0
- package/src/components/TextInput/index.tsx +1 -0
- package/src/components/core/index.js +16 -0
- package/src/components/index.ts +7 -0
- package/src/components/theme/breakpoints.js +11 -0
- package/src/components/theme/components.js +140 -0
- package/src/components/theme/index.js +77 -0
- package/src/components/theme/shadows.js +33 -0
- package/src/components/theme/typography.js +58 -0
- package/src/components/theme/variants.js +235 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +109 -0
- package/index.js +0 -8
- package/src/CheckBox.js +0 -49
- package/src/DataGrid/DataGrid.js +0 -729
- package/src/DateBox.js +0 -77
- package/src/Form.js +0 -116
- package/src/Input.js +0 -160
- package/src/Menu.js +0 -196
- package/src/NumberBox.js +0 -121
- package/src/OptionButton.js +0 -89
- package/src/SelectBox.js +0 -252
- package/src/TagBox/TagBox.js +0 -75
- package/src/TagBox/TagBoxStyles.js +0 -122
- package/src/TextArea.js +0 -85
- package/src/TextAreaBox.js +0 -43
- package/src/TextBox.js +0 -10
- package/src/TimeBox.js +0 -0
- package/src/Timeline.js +0 -153
package/package.json
CHANGED
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monolith-forensics/monolith-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "UI used for Monolith Apps",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"compile": "rollup -c",
|
|
8
10
|
"publish": "npm publish"
|
|
9
11
|
},
|
|
10
12
|
"repository": {
|
|
11
13
|
"type": "git",
|
|
12
14
|
"url": "git+https://github.com/Monolith-Forensics/monolith-ui.git"
|
|
13
15
|
},
|
|
14
|
-
"author": "Matt Danner",
|
|
16
|
+
"author": "Matt Danner, Monolith Forensics LLC",
|
|
15
17
|
"license": "ISC",
|
|
16
18
|
"bugs": {
|
|
17
19
|
"url": "https://github.com/Monolith-Forensics/monolith-ui/issues"
|
|
18
20
|
},
|
|
19
|
-
"homepage": "https://github.com/Monolith-Forensics/monolith-ui#readme"
|
|
21
|
+
"homepage": "https://github.com/Monolith-Forensics/monolith-ui#readme",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@floating-ui/react": "^0.26.16",
|
|
24
|
+
"@radix-ui/react-tooltip": "^1.0.7",
|
|
25
|
+
"deepmerge": "^4.3.1",
|
|
26
|
+
"lucide-react": "^0.378.0",
|
|
27
|
+
"react-textarea-autosize": "^8.5.3",
|
|
28
|
+
"styled-components": "^6.1.11"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
32
|
+
"@types/react": "^18.3.2",
|
|
33
|
+
"react": "^18.3.1",
|
|
34
|
+
"rollup": "^4.18.0",
|
|
35
|
+
"tslib": "^2.6.2",
|
|
36
|
+
"typescript": "^5.4.5"
|
|
37
|
+
}
|
|
20
38
|
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
5
|
+
interface ArrowIconProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ArrowIcon: React.FC<ArrowIconProps> = styled(
|
|
10
|
+
({ className, ...props }: ArrowIconProps) => (
|
|
11
|
+
<div className={className} {...props}>
|
|
12
|
+
<ChevronDownIcon size={16} />
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
)`
|
|
16
|
+
color: ${(props) => props.theme.palette.text.secondary};
|
|
17
|
+
transition: transform 0.2s ease-in-out;
|
|
18
|
+
transform: rotate(0deg);
|
|
19
|
+
will-change: transform;
|
|
20
|
+
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
interface ArrowButtonProps {
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const ArrowButton: React.FC<ArrowButtonProps> = styled(
|
|
32
|
+
({ className, ...props }: ArrowButtonProps) => (
|
|
33
|
+
<button
|
|
34
|
+
className={className}
|
|
35
|
+
{...props}
|
|
36
|
+
tabIndex={-1}
|
|
37
|
+
data-default-btn={true}
|
|
38
|
+
>
|
|
39
|
+
<ArrowIcon />
|
|
40
|
+
</button>
|
|
41
|
+
)
|
|
42
|
+
)`
|
|
43
|
+
position: absolute;
|
|
44
|
+
right: 0;
|
|
45
|
+
height: 100%;
|
|
46
|
+
padding-inline: 10px;
|
|
47
|
+
background: none;
|
|
48
|
+
border: none;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
margin: 0;
|
|
51
|
+
outline: none;
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
export default ArrowButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ArrowButton";
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
|
|
5
|
+
const colors = {
|
|
6
|
+
gray: "#dee2e6",
|
|
7
|
+
red: "#e03131",
|
|
8
|
+
pink: "#c2255c",
|
|
9
|
+
grape: "#9c36b5",
|
|
10
|
+
violet: "#6741d9",
|
|
11
|
+
indigo: "#3b5bdb",
|
|
12
|
+
cyan: "#0c8599",
|
|
13
|
+
teal: "#099268",
|
|
14
|
+
green: "#2f9e44",
|
|
15
|
+
lime: "#66a80f",
|
|
16
|
+
yellow: "#f08c00",
|
|
17
|
+
orange: "#e8590c",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
interface StyledButtonProps {
|
|
21
|
+
variant?:
|
|
22
|
+
| "default"
|
|
23
|
+
| "contained"
|
|
24
|
+
| "filled"
|
|
25
|
+
| "light"
|
|
26
|
+
| "outlined"
|
|
27
|
+
| "text"
|
|
28
|
+
| "subtle";
|
|
29
|
+
color?: string;
|
|
30
|
+
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
31
|
+
fullWidth?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const StyledButton = styled.button<StyledButtonProps>`
|
|
35
|
+
width: ${({ fullWidth }) => (fullWidth ? "100%" : "auto")};
|
|
36
|
+
height: ${({ size }) => {
|
|
37
|
+
switch (size) {
|
|
38
|
+
case "xxs":
|
|
39
|
+
return `24px`;
|
|
40
|
+
case "xs":
|
|
41
|
+
return `28px`;
|
|
42
|
+
case "sm":
|
|
43
|
+
return `34px`;
|
|
44
|
+
case "md":
|
|
45
|
+
return `40px`;
|
|
46
|
+
case "lg":
|
|
47
|
+
return `48px`;
|
|
48
|
+
case "xl":
|
|
49
|
+
return `58px`;
|
|
50
|
+
default:
|
|
51
|
+
return `34px`;
|
|
52
|
+
}
|
|
53
|
+
}};
|
|
54
|
+
|
|
55
|
+
font-weight: 525;
|
|
56
|
+
letter-spacing: 0.75px;
|
|
57
|
+
font-size: ${({ size }) => {
|
|
58
|
+
switch (size) {
|
|
59
|
+
case "xxs":
|
|
60
|
+
return `11px`;
|
|
61
|
+
case "xs":
|
|
62
|
+
return `12px`;
|
|
63
|
+
case "sm":
|
|
64
|
+
return `14px`;
|
|
65
|
+
case "md":
|
|
66
|
+
return `16px`;
|
|
67
|
+
case "lg":
|
|
68
|
+
return `18px`;
|
|
69
|
+
case "xl":
|
|
70
|
+
return `20px`;
|
|
71
|
+
default:
|
|
72
|
+
return `14px`;
|
|
73
|
+
}
|
|
74
|
+
}};
|
|
75
|
+
|
|
76
|
+
padding: ${({ size }) => {
|
|
77
|
+
switch (size) {
|
|
78
|
+
case "xxs":
|
|
79
|
+
return `0px 8px`;
|
|
80
|
+
case "xs":
|
|
81
|
+
return `0px 12px`;
|
|
82
|
+
case "sm":
|
|
83
|
+
return `0px 16px`;
|
|
84
|
+
case "md":
|
|
85
|
+
return `0px 20px`;
|
|
86
|
+
case "lg":
|
|
87
|
+
return `0px 24px`;
|
|
88
|
+
case "xl":
|
|
89
|
+
return `0px 30px`;
|
|
90
|
+
default:
|
|
91
|
+
return `0px 16px`;
|
|
92
|
+
}
|
|
93
|
+
}};
|
|
94
|
+
|
|
95
|
+
color: ${({ theme, variant, color }) => {
|
|
96
|
+
if (variant === "default") return theme.palette.text.primary;
|
|
97
|
+
if (variant === "contained") return "white";
|
|
98
|
+
if (variant === "filled") return "white";
|
|
99
|
+
|
|
100
|
+
switch (color) {
|
|
101
|
+
case "primary":
|
|
102
|
+
return theme.palette.primary.main;
|
|
103
|
+
case undefined || null:
|
|
104
|
+
return theme.palette.text.primary;
|
|
105
|
+
default:
|
|
106
|
+
return (
|
|
107
|
+
theme?.palette?.[color!]?.main ||
|
|
108
|
+
colors?.[color!] ||
|
|
109
|
+
theme.palette.text.primary
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
}};
|
|
113
|
+
|
|
114
|
+
background-color: ${({ theme, variant, color }) => {
|
|
115
|
+
if (variant === "default") return "transparent";
|
|
116
|
+
switch (variant) {
|
|
117
|
+
case "contained":
|
|
118
|
+
if (!color) return theme.palette.background.secondary;
|
|
119
|
+
return (
|
|
120
|
+
theme?.palette?.[color]?.main ||
|
|
121
|
+
colors?.[color] ||
|
|
122
|
+
theme.palette.background.secondary
|
|
123
|
+
);
|
|
124
|
+
case "filled":
|
|
125
|
+
if (!color) return theme.palette.background.secondary;
|
|
126
|
+
return (
|
|
127
|
+
theme?.palette?.[color]?.main ||
|
|
128
|
+
colors?.[color] ||
|
|
129
|
+
theme.palette.background.secondary
|
|
130
|
+
);
|
|
131
|
+
case "light":
|
|
132
|
+
if (!color) return theme.palette.background.secondary + "30";
|
|
133
|
+
return (
|
|
134
|
+
(theme?.palette?.[color]?.main ||
|
|
135
|
+
colors?.[color] ||
|
|
136
|
+
theme.palette.background.secondary) + "30"
|
|
137
|
+
);
|
|
138
|
+
case "outlined":
|
|
139
|
+
return "transparent";
|
|
140
|
+
case "text":
|
|
141
|
+
return "transparent";
|
|
142
|
+
default:
|
|
143
|
+
return "transparent";
|
|
144
|
+
}
|
|
145
|
+
}};
|
|
146
|
+
|
|
147
|
+
border-radius: 4px;
|
|
148
|
+
border: 1px solid
|
|
149
|
+
${({ theme, variant, color }) => {
|
|
150
|
+
switch (variant) {
|
|
151
|
+
case "contained":
|
|
152
|
+
return "transparent";
|
|
153
|
+
case "filled":
|
|
154
|
+
return "transparent";
|
|
155
|
+
case "light":
|
|
156
|
+
return "transparent";
|
|
157
|
+
case "outlined":
|
|
158
|
+
if (!color) return theme.palette.divider;
|
|
159
|
+
return (
|
|
160
|
+
theme?.palette?.[color]?.main ||
|
|
161
|
+
colors?.[color] ||
|
|
162
|
+
theme.palette.divider
|
|
163
|
+
);
|
|
164
|
+
case "text":
|
|
165
|
+
return "transparent";
|
|
166
|
+
case "subtle":
|
|
167
|
+
return "transparent";
|
|
168
|
+
default:
|
|
169
|
+
if (!color) return theme.palette.divider;
|
|
170
|
+
return (
|
|
171
|
+
theme?.palette?.[color]?.main ||
|
|
172
|
+
colors?.[color] ||
|
|
173
|
+
theme.palette.divider
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}};
|
|
177
|
+
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
|
|
180
|
+
transition: background-color 0.2s, border 0.2s;
|
|
181
|
+
|
|
182
|
+
&:hover {
|
|
183
|
+
background-color: ${({ theme, variant, color }) => {
|
|
184
|
+
if (variant === "default") return "transparent";
|
|
185
|
+
switch (variant) {
|
|
186
|
+
case "contained":
|
|
187
|
+
if (!color) return theme.palette.background.secondary + "90";
|
|
188
|
+
return (
|
|
189
|
+
(theme?.palette?.[color]?.main ||
|
|
190
|
+
colors?.[color] ||
|
|
191
|
+
theme.palette.background.secondary) + "90"
|
|
192
|
+
);
|
|
193
|
+
case "filled":
|
|
194
|
+
if (!color) return theme.palette.background.secondary + "90";
|
|
195
|
+
return (
|
|
196
|
+
(theme?.palette?.[color]?.main ||
|
|
197
|
+
colors?.[color] ||
|
|
198
|
+
theme.palette.background.secondary) + "90"
|
|
199
|
+
);
|
|
200
|
+
case "light":
|
|
201
|
+
if (!color) return theme.palette.background.secondary + "70";
|
|
202
|
+
return (
|
|
203
|
+
(theme?.palette?.[color]?.main ||
|
|
204
|
+
colors?.[color] ||
|
|
205
|
+
theme.palette.background.secondary) + "70"
|
|
206
|
+
);
|
|
207
|
+
case "outlined":
|
|
208
|
+
return theme.palette.action.hover;
|
|
209
|
+
case "text":
|
|
210
|
+
return "transparent";
|
|
211
|
+
case "subtle":
|
|
212
|
+
if (!color) return theme.palette.action.hover;
|
|
213
|
+
return theme?.palette?.[color]?.main || colors?.[color]
|
|
214
|
+
? (theme?.palette?.[color]?.main || colors?.[color]) + "30"
|
|
215
|
+
: theme.palette.action.hover;
|
|
216
|
+
default:
|
|
217
|
+
return theme.palette.action.hover;
|
|
218
|
+
}
|
|
219
|
+
}};
|
|
220
|
+
|
|
221
|
+
border: 1px solid
|
|
222
|
+
${({ theme, variant, color }) => {
|
|
223
|
+
switch (variant) {
|
|
224
|
+
case "contained":
|
|
225
|
+
return "transparent";
|
|
226
|
+
case "filled":
|
|
227
|
+
return "transparent";
|
|
228
|
+
case "light":
|
|
229
|
+
return "transparent";
|
|
230
|
+
case "outlined":
|
|
231
|
+
if (!color) return theme.palette.divider;
|
|
232
|
+
return colors?.[color] || theme.palette.divider;
|
|
233
|
+
case "text":
|
|
234
|
+
return "transparent";
|
|
235
|
+
case "subtle":
|
|
236
|
+
return "transparent";
|
|
237
|
+
default:
|
|
238
|
+
if (!color) return theme.palette.divider;
|
|
239
|
+
return (
|
|
240
|
+
theme?.palette?.[color]?.main ||
|
|
241
|
+
colors?.[color] ||
|
|
242
|
+
theme.palette.divider
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
}};
|
|
246
|
+
}
|
|
247
|
+
`;
|
|
248
|
+
|
|
249
|
+
export interface ButtonProps {
|
|
250
|
+
children: React.ReactNode;
|
|
251
|
+
variant?:
|
|
252
|
+
| "default"
|
|
253
|
+
| "contained"
|
|
254
|
+
| "filled"
|
|
255
|
+
| "light"
|
|
256
|
+
| "outlined"
|
|
257
|
+
| "text"
|
|
258
|
+
| "subtle";
|
|
259
|
+
color?: string;
|
|
260
|
+
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
261
|
+
fullWidth?: boolean;
|
|
262
|
+
onClick?: () => void;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const Button = forwardRef(
|
|
266
|
+
(props: ButtonProps, ref: React.Ref<HTMLButtonElement>) => {
|
|
267
|
+
const { children, ...other } = props;
|
|
268
|
+
return (
|
|
269
|
+
<StyledButton ref={ref} {...other}>
|
|
270
|
+
<span style={{ height: "100%" }}>
|
|
271
|
+
<span style={{ height: "100%" }}>{children}</span>
|
|
272
|
+
</span>
|
|
273
|
+
</StyledButton>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Button";
|