@monolith-forensics/monolith-ui 1.1.0 → 1.1.1
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 +4 -1
- package/Button/Button.tsx +0 -382
- package/Button/index.ts +0 -2
- package/Calendar/Calendar.tsx +0 -376
- package/Calendar/CalendarStyles.tsx +0 -180
- package/Calendar/calendarHelpers.ts +0 -196
- package/Calendar/index.ts +0 -1
- package/CheckBox/CheckBox.tsx +0 -61
- package/CheckBox/index.ts +0 -1
- package/DateInput/DateInput.tsx +0 -717
- package/DateInput/index.ts +0 -1
- package/DropDownMenu/DropDownMenu.tsx +0 -402
- package/DropDownMenu/index.ts +0 -1
- package/Error/Error.tsx +0 -51
- package/Error/index.ts +0 -1
- package/FieldLabel/FieldLabel.tsx +0 -155
- package/FieldLabel/index.ts +0 -1
- package/FileInputField/FileInputField.tsx +0 -179
- package/FileInputField/index.ts +0 -1
- package/Flyout/Flyout.tsx +0 -172
- package/Flyout/FlyoutHeader.tsx +0 -14
- package/Flyout/FlyoutTitle.tsx +0 -10
- package/Flyout/index.ts +0 -3
- package/FormSection/FormSection.tsx +0 -71
- package/FormSection/index.ts +0 -1
- package/Grid/Grid.tsx +0 -18
- package/Grid/index.ts +0 -1
- package/IconButton/IconButton.tsx +0 -27
- package/IconButton/index.ts +0 -1
- package/Input/Input.tsx +0 -164
- package/Input/index.ts +0 -1
- package/Modal/Modal.tsx +0 -172
- package/Modal/index.ts +0 -1
- package/Pill/Pill.tsx +0 -174
- package/Pill/index.ts +0 -1
- package/SelectBox/SelectBox.tsx +0 -745
- package/SelectBox/index.ts +0 -1
- package/Switch/Switch.tsx +0 -204
- package/Switch/index.ts +0 -1
- package/TagBox/TagBox.tsx +0 -694
- package/TagBox/TagBoxStyles.tsx +0 -116
- package/TagBox/index.ts +0 -1
- package/TextArea/TextArea.tsx +0 -92
- package/TextArea/index.ts +0 -1
- package/TextAreaInput/TextAreaInput.tsx +0 -46
- package/TextAreaInput/index.ts +0 -1
- package/TextInput/TextInput.tsx +0 -48
- package/TextInput/index.ts +0 -1
- package/Tooltip/Tooltip.tsx +0 -68
- package/Tooltip/index.ts +0 -1
- package/core/ArrowButton.tsx +0 -51
- package/core/ClearButton.tsx +0 -51
- package/core/MonolithThemeProvider.js +0 -16
- package/core/StyledContent.tsx +0 -50
- package/core/StyledFloatContainer.tsx +0 -7
- package/core/Types/Size.ts +0 -3
- package/core/Types/Variant.ts +0 -10
- package/core/index.ts +0 -6
- package/index.ts +0 -22
- package/theme/breakpoints.js +0 -11
- package/theme/components.js +0 -138
- package/theme/index.js +0 -76
- package/theme/shadows.js +0 -33
- package/theme/typography.js +0 -58
- package/theme/variants.js +0 -234
- package/tsconfig.json +0 -109
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monolith-forensics/monolith-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"author": "Matt Danner (Monolith Forensics LLC)",
|
|
6
6
|
"license": "private",
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"url": "git+"
|
|
10
10
|
},
|
|
11
11
|
"types": "index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
12
15
|
"scripts": {
|
|
13
16
|
"prepublish": "rm -r ./dist && tsc"
|
|
14
17
|
},
|
package/Button/Button.tsx
DELETED
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, ReactNode, forwardRef } from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import { Loader2Icon } from "lucide-react";
|
|
4
|
-
import { Size, Variant } from "../core";
|
|
5
|
-
|
|
6
|
-
const colors = {
|
|
7
|
-
gray: "#888888",
|
|
8
|
-
red: "#e03131",
|
|
9
|
-
pink: "#c2255c",
|
|
10
|
-
grape: "#9c36b5",
|
|
11
|
-
violet: "#6741d9",
|
|
12
|
-
indigo: "#3b5bdb",
|
|
13
|
-
cyan: "#0c8599",
|
|
14
|
-
teal: "#099268",
|
|
15
|
-
green: "#2f9e44",
|
|
16
|
-
lime: "#66a80f",
|
|
17
|
-
yellow: "#f08c00",
|
|
18
|
-
orange: "#e8590c",
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type ColorKeys = keyof typeof colors;
|
|
22
|
-
|
|
23
|
-
interface StyledButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
24
|
-
fullWidth?: boolean;
|
|
25
|
-
size?: string;
|
|
26
|
-
variant?: string;
|
|
27
|
-
color?: ColorKeys | string;
|
|
28
|
-
// Add more custom props here if needed
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const StyledButton = styled.button<StyledButtonProps>`
|
|
32
|
-
user-select: none;
|
|
33
|
-
display: flex;
|
|
34
|
-
outline: none;
|
|
35
|
-
white-space: nowrap;
|
|
36
|
-
|
|
37
|
-
width: ${({ fullWidth }) => (fullWidth ? "100%" : "fit-content")};
|
|
38
|
-
height: ${({ theme, size }) => {
|
|
39
|
-
switch (size) {
|
|
40
|
-
case "xxs":
|
|
41
|
-
return `24px`;
|
|
42
|
-
case "xs":
|
|
43
|
-
return `28px`;
|
|
44
|
-
case "sm":
|
|
45
|
-
return `34px`;
|
|
46
|
-
case "md":
|
|
47
|
-
return `40px`;
|
|
48
|
-
case "lg":
|
|
49
|
-
return `48px`;
|
|
50
|
-
case "xl":
|
|
51
|
-
return `58px`;
|
|
52
|
-
default:
|
|
53
|
-
return `34px`;
|
|
54
|
-
}
|
|
55
|
-
}};
|
|
56
|
-
|
|
57
|
-
font-weight: 525;
|
|
58
|
-
letter-spacing: 0.75px;
|
|
59
|
-
font-size: ${({ theme, size }) => {
|
|
60
|
-
switch (size) {
|
|
61
|
-
case "xxs":
|
|
62
|
-
return `11px`;
|
|
63
|
-
case "xs":
|
|
64
|
-
return `12px`;
|
|
65
|
-
case "sm":
|
|
66
|
-
return `14px`;
|
|
67
|
-
case "md":
|
|
68
|
-
return `16px`;
|
|
69
|
-
case "lg":
|
|
70
|
-
return `18px`;
|
|
71
|
-
case "xl":
|
|
72
|
-
return `20px`;
|
|
73
|
-
default:
|
|
74
|
-
return `14px`;
|
|
75
|
-
}
|
|
76
|
-
}};
|
|
77
|
-
|
|
78
|
-
padding: ${({ theme, size, variant }) => {
|
|
79
|
-
if (variant === "text") return `0px 0px`;
|
|
80
|
-
switch (size) {
|
|
81
|
-
case "xxs":
|
|
82
|
-
return `0px 8px`;
|
|
83
|
-
case "xs":
|
|
84
|
-
return `0px 12px`;
|
|
85
|
-
case "sm":
|
|
86
|
-
return `0px 16px`;
|
|
87
|
-
case "md":
|
|
88
|
-
return `0px 20px`;
|
|
89
|
-
case "lg":
|
|
90
|
-
return `0px 24px`;
|
|
91
|
-
case "xl":
|
|
92
|
-
return `0px 30px`;
|
|
93
|
-
default:
|
|
94
|
-
return `0px 16px`;
|
|
95
|
-
}
|
|
96
|
-
}};
|
|
97
|
-
|
|
98
|
-
color: ${({ theme, variant, color }) => {
|
|
99
|
-
if (variant === "default") return theme.palette.text.primary;
|
|
100
|
-
if (variant === "contained") return "white";
|
|
101
|
-
if (variant === "filled") return "white";
|
|
102
|
-
|
|
103
|
-
switch (color) {
|
|
104
|
-
case "primary":
|
|
105
|
-
return theme.palette.primary.main;
|
|
106
|
-
case undefined:
|
|
107
|
-
return theme.palette.text.primary;
|
|
108
|
-
default:
|
|
109
|
-
return color
|
|
110
|
-
? theme?.palette?.[color]?.main ||
|
|
111
|
-
colors[color as keyof typeof colors] ||
|
|
112
|
-
theme.palette.text.primary
|
|
113
|
-
: theme.palette.text.primary;
|
|
114
|
-
}
|
|
115
|
-
}};
|
|
116
|
-
|
|
117
|
-
background-color: ${({ theme, variant, color }) => {
|
|
118
|
-
if (variant === "default") return "transparent";
|
|
119
|
-
switch (variant) {
|
|
120
|
-
case "contained":
|
|
121
|
-
return color
|
|
122
|
-
? theme?.palette?.[color]?.main ||
|
|
123
|
-
colors[color as keyof typeof colors] ||
|
|
124
|
-
theme.palette.background.secondary
|
|
125
|
-
: theme.palette.background.secondary;
|
|
126
|
-
case "filled":
|
|
127
|
-
return color
|
|
128
|
-
? theme?.palette?.[color]?.main ||
|
|
129
|
-
colors[color as keyof typeof colors] ||
|
|
130
|
-
theme.palette.background.secondary
|
|
131
|
-
: theme.palette.background.secondary;
|
|
132
|
-
case "light":
|
|
133
|
-
return (
|
|
134
|
-
(color
|
|
135
|
-
? theme?.palette?.[color]?.main ||
|
|
136
|
-
colors[color as keyof typeof colors] ||
|
|
137
|
-
theme.palette.background.secondary
|
|
138
|
-
: theme.palette.background.secondary) + "30"
|
|
139
|
-
);
|
|
140
|
-
case "outlined":
|
|
141
|
-
return "transparent";
|
|
142
|
-
case "text":
|
|
143
|
-
return "transparent";
|
|
144
|
-
default:
|
|
145
|
-
return "transparent";
|
|
146
|
-
}
|
|
147
|
-
}};
|
|
148
|
-
|
|
149
|
-
border-radius: 4px;
|
|
150
|
-
border: 1px solid
|
|
151
|
-
${({ theme, variant, color }) => {
|
|
152
|
-
switch (variant) {
|
|
153
|
-
case "contained":
|
|
154
|
-
return "transparent";
|
|
155
|
-
case "filled":
|
|
156
|
-
return "transparent";
|
|
157
|
-
case "light":
|
|
158
|
-
return "transparent";
|
|
159
|
-
case "outlined":
|
|
160
|
-
return color
|
|
161
|
-
? theme?.palette?.[color]?.main ||
|
|
162
|
-
colors[color as keyof typeof colors] ||
|
|
163
|
-
theme.palette.divider
|
|
164
|
-
: theme.palette.divider;
|
|
165
|
-
case "text":
|
|
166
|
-
return "transparent";
|
|
167
|
-
case "subtle":
|
|
168
|
-
return "transparent";
|
|
169
|
-
default:
|
|
170
|
-
return color
|
|
171
|
-
? theme?.palette?.[color]?.main ||
|
|
172
|
-
colors[color as keyof typeof colors] ||
|
|
173
|
-
theme.palette.divider
|
|
174
|
-
: theme.palette.divider;
|
|
175
|
-
}
|
|
176
|
-
}};
|
|
177
|
-
|
|
178
|
-
cursor: pointer;
|
|
179
|
-
|
|
180
|
-
transition: background-color 0.2s, border 0.2s;
|
|
181
|
-
|
|
182
|
-
.inner-span {
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.button-label {
|
|
188
|
-
display: flex;
|
|
189
|
-
align-items: center;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
[data-position="left"] {
|
|
193
|
-
margin-inline-end: 6px;
|
|
194
|
-
display: flex;
|
|
195
|
-
align-items: center;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
[data-position="right"] {
|
|
199
|
-
margin-inline-start: 6px;
|
|
200
|
-
display: flex;
|
|
201
|
-
align-items: center;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
&:hover {
|
|
205
|
-
background-color: ${({ theme, variant, color }) => {
|
|
206
|
-
if (variant === "default") return "transparent";
|
|
207
|
-
switch (variant) {
|
|
208
|
-
case "contained":
|
|
209
|
-
return (
|
|
210
|
-
(color
|
|
211
|
-
? theme?.palette?.[color]?.main ||
|
|
212
|
-
colors[color as keyof typeof colors] ||
|
|
213
|
-
theme.palette.background.secondary
|
|
214
|
-
: theme.palette.background.secondary) + "90"
|
|
215
|
-
);
|
|
216
|
-
case "filled":
|
|
217
|
-
return (
|
|
218
|
-
(color
|
|
219
|
-
? theme?.palette?.[color]?.main ||
|
|
220
|
-
colors[color as keyof typeof colors] ||
|
|
221
|
-
theme.palette.background.secondary
|
|
222
|
-
: theme.palette.background.secondary) + "90"
|
|
223
|
-
);
|
|
224
|
-
case "light":
|
|
225
|
-
return (
|
|
226
|
-
(color
|
|
227
|
-
? theme?.palette?.[color]?.main ||
|
|
228
|
-
colors[color as keyof typeof colors] ||
|
|
229
|
-
theme.palette.background.secondary
|
|
230
|
-
: theme.palette.background.secondary) + "70"
|
|
231
|
-
);
|
|
232
|
-
case "outlined":
|
|
233
|
-
return theme.palette.action.hover;
|
|
234
|
-
case "text":
|
|
235
|
-
return "transparent";
|
|
236
|
-
case "subtle":
|
|
237
|
-
return color
|
|
238
|
-
? (theme?.palette?.[color]?.main ||
|
|
239
|
-
colors[color as keyof typeof colors]) + "30" ||
|
|
240
|
-
theme.palette.action.hover
|
|
241
|
-
: theme.palette.action.hover;
|
|
242
|
-
default:
|
|
243
|
-
return theme.palette.action.hover;
|
|
244
|
-
}
|
|
245
|
-
}};
|
|
246
|
-
|
|
247
|
-
border: 1px solid
|
|
248
|
-
${({ theme, variant, color }) => {
|
|
249
|
-
switch (variant) {
|
|
250
|
-
case "contained":
|
|
251
|
-
return "transparent";
|
|
252
|
-
case "filled":
|
|
253
|
-
return "transparent";
|
|
254
|
-
case "light":
|
|
255
|
-
return "transparent";
|
|
256
|
-
case "outlined":
|
|
257
|
-
return color
|
|
258
|
-
? colors[color as keyof typeof colors] || theme.palette.divider
|
|
259
|
-
: theme.palette.divider;
|
|
260
|
-
case "text":
|
|
261
|
-
return "transparent";
|
|
262
|
-
case "subtle":
|
|
263
|
-
return "transparent";
|
|
264
|
-
default:
|
|
265
|
-
return color
|
|
266
|
-
? theme?.palette?.[color]?.main ||
|
|
267
|
-
colors[color as keyof typeof colors] ||
|
|
268
|
-
theme.palette.divider
|
|
269
|
-
: theme.palette.divider;
|
|
270
|
-
}
|
|
271
|
-
}};
|
|
272
|
-
opacity: ${({ variant }) => (variant === "text" ? 0.8 : 1)};
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
|
|
276
|
-
pointer-events: ${({ disabled }) => (disabled ? "none" : "auto")};
|
|
277
|
-
|
|
278
|
-
&:focus {
|
|
279
|
-
text-decoration: underline;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
&:active {
|
|
283
|
-
// simulate physical button press
|
|
284
|
-
translate: 0px 1px;
|
|
285
|
-
text-decoration: none;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// disabled styles
|
|
289
|
-
${({ disabled }) =>
|
|
290
|
-
disabled &&
|
|
291
|
-
`
|
|
292
|
-
cursor: not-allowed;
|
|
293
|
-
opacity: 0.5;
|
|
294
|
-
pointer-events: none;
|
|
295
|
-
`}
|
|
296
|
-
`;
|
|
297
|
-
|
|
298
|
-
const StyledAnchor = styled.a`
|
|
299
|
-
text-decoration: none;
|
|
300
|
-
height: 100%;
|
|
301
|
-
|
|
302
|
-
&:hover {
|
|
303
|
-
text-decoration: none !important;
|
|
304
|
-
}
|
|
305
|
-
`;
|
|
306
|
-
|
|
307
|
-
const StyledLoader = styled.span`
|
|
308
|
-
svg {
|
|
309
|
-
width: 16px;
|
|
310
|
-
height: 16px;
|
|
311
|
-
color: ${({ theme, color }) =>
|
|
312
|
-
color
|
|
313
|
-
? theme.palette[color] || colors[color as keyof typeof colors]
|
|
314
|
-
: theme.palette.primary};
|
|
315
|
-
|
|
316
|
-
animation: spin 0.75s linear infinite;
|
|
317
|
-
|
|
318
|
-
@keyframes spin {
|
|
319
|
-
100% {
|
|
320
|
-
transform: rotate(360deg);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
`;
|
|
325
|
-
|
|
326
|
-
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
327
|
-
children?: ReactNode | string;
|
|
328
|
-
className?: string;
|
|
329
|
-
loading?: boolean;
|
|
330
|
-
leftSection?: ReactNode;
|
|
331
|
-
rightSection?: ReactNode;
|
|
332
|
-
href?: string | null;
|
|
333
|
-
download?: string | null;
|
|
334
|
-
fullWidth?: boolean;
|
|
335
|
-
size?: Size;
|
|
336
|
-
variant?: Variant;
|
|
337
|
-
color?: string;
|
|
338
|
-
disabled?: boolean;
|
|
339
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
|
|
343
|
-
const {
|
|
344
|
-
children,
|
|
345
|
-
loading = false,
|
|
346
|
-
leftSection = null,
|
|
347
|
-
rightSection = null,
|
|
348
|
-
href = null,
|
|
349
|
-
download = null,
|
|
350
|
-
...other
|
|
351
|
-
} = props;
|
|
352
|
-
|
|
353
|
-
const buttonContent = (
|
|
354
|
-
<span className="inner-span" style={{ height: "100%" }}>
|
|
355
|
-
{loading ? (
|
|
356
|
-
<StyledLoader>
|
|
357
|
-
<Loader2Icon />
|
|
358
|
-
</StyledLoader>
|
|
359
|
-
) : (
|
|
360
|
-
<>
|
|
361
|
-
{leftSection && <span data-position="left">{leftSection}</span>}
|
|
362
|
-
<span className="button-label">{children}</span>
|
|
363
|
-
{rightSection && <span data-position="right">{rightSection}</span>}
|
|
364
|
-
</>
|
|
365
|
-
)}
|
|
366
|
-
</span>
|
|
367
|
-
);
|
|
368
|
-
|
|
369
|
-
return (
|
|
370
|
-
<StyledButton ref={ref} {...other}>
|
|
371
|
-
{href ? (
|
|
372
|
-
<StyledAnchor href={href} download={download}>
|
|
373
|
-
{buttonContent}
|
|
374
|
-
</StyledAnchor>
|
|
375
|
-
) : (
|
|
376
|
-
buttonContent
|
|
377
|
-
)}
|
|
378
|
-
</StyledButton>
|
|
379
|
-
);
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
export default Button;
|
package/Button/index.ts
DELETED