@monolith-forensics/monolith-ui 1.0.7 → 1.0.8

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.
Files changed (40) hide show
  1. package/Button/Button.js +234 -0
  2. package/{src/Calendar → Calendar}/Calendar.js +365 -329
  3. package/{src/Calendar → Calendar}/CalendarStyles.js +190 -168
  4. package/{src/Calendar → Calendar}/calendarHelpers.js +194 -194
  5. package/DateInput/DateInput.js +583 -0
  6. package/FieldLabel/FieldLabel.js +134 -0
  7. package/FileInputField/FileInputField.js +171 -0
  8. package/Pill/Pill.js +137 -0
  9. package/SelectBox/SelectBox.js +579 -0
  10. package/TagBox/TagBox.js +563 -0
  11. package/{src/TagBox/TagBox.js → TagBox/TagBoxOLD.js} +75 -75
  12. package/{src/TagBox → TagBox}/TagBoxStyles.js +122 -122
  13. package/TextAreaInput/TextAreaInput.js +35 -0
  14. package/TextInput/TextInput.js +37 -0
  15. package/core/index.js +16 -0
  16. package/package.json +15 -12
  17. package/primitives/Input.js +127 -0
  18. package/primitives/TextArea.js +65 -0
  19. package/theme/breakpoints.js +11 -0
  20. package/theme/components.js +140 -0
  21. package/theme/index.js +77 -0
  22. package/theme/shadows.js +33 -0
  23. package/theme/typography.js +58 -0
  24. package/theme/variants.js +235 -0
  25. package/.gitattributes +0 -2
  26. package/index.js +0 -8
  27. package/src/CheckBox.js +0 -49
  28. package/src/DataGrid/DataGrid.js +0 -729
  29. package/src/DateBox.js +0 -77
  30. package/src/Form.js +0 -116
  31. package/src/Input.js +0 -160
  32. package/src/Menu.js +0 -196
  33. package/src/NumberBox.js +0 -121
  34. package/src/OptionButton.js +0 -89
  35. package/src/SelectBox.js +0 -252
  36. package/src/TextArea.js +0 -85
  37. package/src/TextAreaBox.js +0 -43
  38. package/src/TextBox.js +0 -10
  39. package/src/TimeBox.js +0 -0
  40. package/src/Timeline.js +0 -153
@@ -0,0 +1,140 @@
1
+ const components = {
2
+ MuiButtonBase: {
3
+ defaultProps: {
4
+ disableRipple: true,
5
+ },
6
+ },
7
+ MuiLink: {
8
+ defaultProps: {
9
+ underline: "hover",
10
+ },
11
+ },
12
+ MuiCardHeader: {
13
+ defaultProps: {
14
+ titleTypographyProps: {
15
+ variant: "h6",
16
+ },
17
+ },
18
+ styleOverrides: {
19
+ action: {
20
+ marginTop: "-4px",
21
+ marginRight: "-4px",
22
+ },
23
+ },
24
+ },
25
+ MuiCard: {
26
+ styleOverrides: {
27
+ root: {
28
+ borderRadius: "0px",
29
+ // boxShadow:
30
+ // "rgba(50, 50, 93, 0.025) 0px 2px 5px -1px, rgba(0, 0, 0, 0.05) 0px 1px 3px -1px",
31
+ boxShadow:
32
+ "0 1px 3px rgb(0 0 0 / 12%), 0 1px 2px rgb(0 0 0 / 24%) !important",
33
+ backgroundImage: "none",
34
+ },
35
+ },
36
+ },
37
+ MuiPaper: {
38
+ styleOverrides: {
39
+ root: {
40
+ backgroundImage: "none",
41
+ },
42
+ },
43
+ },
44
+ MuiPickersDay: {
45
+ styleOverrides: {
46
+ day: {
47
+ fontWeight: "300",
48
+ },
49
+ },
50
+ },
51
+ MuiPickersYear: {
52
+ styleOverrides: {
53
+ root: {
54
+ height: "64px",
55
+ },
56
+ },
57
+ },
58
+ MuiPickersCalendar: {
59
+ styleOverrides: {
60
+ transitionContainer: {
61
+ marginTop: "6px",
62
+ },
63
+ },
64
+ },
65
+ MuiPickersCalendarHeader: {
66
+ styleOverrides: {
67
+ iconButton: {
68
+ backgroundColor: "transparent",
69
+ "& > *": {
70
+ backgroundColor: "transparent",
71
+ },
72
+ },
73
+ switchHeader: {
74
+ marginTop: "2px",
75
+ marginBottom: "4px",
76
+ },
77
+ },
78
+ },
79
+ MuiPickersClock: {
80
+ styleOverrides: {
81
+ container: {
82
+ margin: `32px 0 4px`,
83
+ },
84
+ },
85
+ },
86
+ MuiPickersClockNumber: {
87
+ styleOverrides: {
88
+ clockNumber: {
89
+ left: `calc(50% - 16px)`,
90
+ width: "32px",
91
+ height: "32px",
92
+ },
93
+ },
94
+ },
95
+ MuiPickerDTHeader: {
96
+ styleOverrides: {
97
+ dateHeader: {
98
+ "& h4": {
99
+ fontSize: "2.125rem",
100
+ fontWeight: 400,
101
+ },
102
+ },
103
+ timeHeader: {
104
+ "& h3": {
105
+ fontSize: "3rem",
106
+ fontWeight: 400,
107
+ },
108
+ },
109
+ },
110
+ },
111
+ MuiPickersTimePicker: {
112
+ styleOverrides: {
113
+ hourMinuteLabel: {
114
+ "& h2": {
115
+ fontSize: "3.75rem",
116
+ fontWeight: 300,
117
+ },
118
+ },
119
+ },
120
+ },
121
+ MuiPickersToolbar: {
122
+ styleOverrides: {
123
+ toolbar: {
124
+ "& h4": {
125
+ fontSize: "2.125rem",
126
+ fontWeight: 400,
127
+ },
128
+ },
129
+ },
130
+ },
131
+ MuiChip: {
132
+ styleOverrides: {
133
+ root: {
134
+ borderRadius: "16px",
135
+ },
136
+ },
137
+ },
138
+ };
139
+
140
+ export default components;
package/theme/index.js ADDED
@@ -0,0 +1,77 @@
1
+ import "@mui/lab/themeAugmentation";
2
+
3
+ import { createTheme as createMuiTheme } from "@mui/material/styles";
4
+ import variants from "./variants";
5
+ import typography from "./typography";
6
+ import breakpoints from "./breakpoints";
7
+ import components from "./components";
8
+ import shadows from "./shadows";
9
+
10
+ const createTheme = (name) => {
11
+ let themeConfig = variants.find((variant) => variant.name === name);
12
+
13
+ if (!themeConfig) {
14
+ console.warn(new Error(`The theme ${name} is not valid`));
15
+ themeConfig = variants[0];
16
+ }
17
+
18
+ const componentsStyled = {
19
+ ...components,
20
+ MuiButton: {
21
+ variants: [
22
+ {
23
+ props: { variant: "outlined-filled" },
24
+ style: {
25
+ border: "1px solid #CCC",
26
+ color: themeConfig.palette.secondary.main,
27
+ backgroundColor: themeConfig.palette.background.paper,
28
+ },
29
+ },
30
+ ],
31
+ },
32
+ MuiMenu: {
33
+ styleOverrides: {
34
+ paper: {
35
+ minWidth: 150,
36
+ backgroundColor: themeConfig.palette.menu.background,
37
+ border: `1px solid ${
38
+ themeConfig.name === "DARK"
39
+ ? "rgba(255, 255, 255, 0.12)"
40
+ : "rgba(0, 0, 0, 0.12)"
41
+ }`,
42
+ },
43
+ },
44
+ },
45
+ };
46
+
47
+ return createMuiTheme(
48
+ {
49
+ spacing: 4,
50
+ breakpoints: breakpoints,
51
+ // @ts-ignore
52
+ components: componentsStyled,
53
+ typography: typography,
54
+ // shadows: shadows,
55
+ palette: themeConfig.palette,
56
+ zIndex: {
57
+ mobileStepper: 1800,
58
+ fab: 1801,
59
+ speedDial: 1802,
60
+ appBar: 1803,
61
+ modal: 1501,
62
+ snackbar: 1806,
63
+ tooltip: 1807,
64
+ },
65
+ },
66
+ {
67
+ name: themeConfig.name,
68
+ header: themeConfig.header,
69
+ footer: themeConfig.footer,
70
+ sidebar: themeConfig.sidebar,
71
+ scrollbar: themeConfig.scrollbar,
72
+ mfBorder: themeConfig.mfBorder,
73
+ }
74
+ );
75
+ };
76
+
77
+ export default createTheme;
@@ -0,0 +1,33 @@
1
+ function createShadow() {
2
+ return `box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);`;
3
+ }
4
+
5
+ const shadows = [
6
+ "none",
7
+ createShadow(),
8
+ createShadow(),
9
+ createShadow(),
10
+ createShadow(),
11
+ createShadow(),
12
+ createShadow(),
13
+ createShadow(),
14
+ createShadow(),
15
+ createShadow(),
16
+ createShadow(),
17
+ createShadow(),
18
+ createShadow(),
19
+ createShadow(),
20
+ createShadow(),
21
+ createShadow(),
22
+ createShadow(),
23
+ createShadow(),
24
+ createShadow(),
25
+ createShadow(),
26
+ createShadow(),
27
+ createShadow(),
28
+ createShadow(),
29
+ createShadow(),
30
+ createShadow(),
31
+ ];
32
+
33
+ export default shadows;
@@ -0,0 +1,58 @@
1
+ const typography = {
2
+ fontFamily: [
3
+ "Inter",
4
+ "-apple-system",
5
+ "BlinkMacSystemFont",
6
+ '"Segoe UI"',
7
+ "Roboto",
8
+ '"Helvetica Neue"',
9
+ "Arial",
10
+ "sans-serif",
11
+ '"Apple Color Emoji"',
12
+ '"Segoe UI Emoji"',
13
+ '"Segoe UI Symbol"',
14
+ ].join(","),
15
+ fontSize: 13,
16
+ fontWeightLight: 300,
17
+ fontWeightRegular: 400,
18
+ fontWeightMedium: 500,
19
+ fontWeightBold: 600,
20
+ h1: {
21
+ fontSize: "2rem",
22
+ fontWeight: 600,
23
+ lineHeight: 1.25,
24
+ },
25
+ h2: {
26
+ fontSize: "1.75rem",
27
+ fontWeight: 600,
28
+ lineHeight: 1.25,
29
+ },
30
+ h3: {
31
+ fontSize: "1.5rem",
32
+ fontWeight: 600,
33
+ lineHeight: 1.25,
34
+ },
35
+ h4: {
36
+ fontSize: "1.125rem",
37
+ fontWeight: 500,
38
+ lineHeight: 1.25,
39
+ },
40
+ h5: {
41
+ fontSize: "1.0625rem",
42
+ fontWeight: 500,
43
+ lineHeight: 1.25,
44
+ },
45
+ h6: {
46
+ fontSize: "1rem",
47
+ fontWeight: 500,
48
+ lineHeight: 1.25,
49
+ },
50
+ body1: {
51
+ fontSize: 13,
52
+ },
53
+ button: {
54
+ textTransform: "none",
55
+ },
56
+ };
57
+
58
+ export default typography;
@@ -0,0 +1,235 @@
1
+ import merge from "deepmerge";
2
+
3
+ // Themes
4
+ export const THEMES = {
5
+ DEFAULT: "DEFAULT",
6
+ DARK: "DARK",
7
+ LIGHT: "LIGHT",
8
+ };
9
+
10
+ const customBlue = {
11
+ 50: "#e9f0fb",
12
+ 100: "#c8daf4",
13
+ 200: "#a3c1ed",
14
+ 300: "#7ea8e5",
15
+ 400: "#6395e0",
16
+ 500: "#4782da",
17
+ 600: "#407ad6",
18
+ 700: "#376fd0",
19
+ 800: "#2f65cb",
20
+ 900: "#2052c2 ",
21
+ };
22
+
23
+ const defaultVariant = {
24
+ name: THEMES.DEFAULT,
25
+ palette: {
26
+ mode: "light",
27
+ primary: {
28
+ main: customBlue[700],
29
+ contrastText: "#FFF",
30
+ },
31
+ secondary: {
32
+ main: "#FFF",
33
+ contrastText: "#000",
34
+ },
35
+ third: {
36
+ main: "#000",
37
+ contrastText: "#FFF",
38
+ },
39
+ fourth: {
40
+ main: "#ff4500",
41
+ contrastText: "#FFF",
42
+ },
43
+ background: {
44
+ // default: "#F7F9FC",
45
+ default: "#FFF",
46
+ paper: "#FFF",
47
+ alt: "#ededed",
48
+ secondary: "#f0f0f0",
49
+ gradient: "linear-gradient(#FFFFFF 0%, #ccdcf9 50%)",
50
+ },
51
+ menu: {
52
+ background: "#FFF",
53
+ },
54
+ signature: {
55
+ penColor: "#000000",
56
+ borderColor: "#444444",
57
+ backgroundColor: "",
58
+ },
59
+ text: {
60
+ primary: "rgba(0, 0, 0, 0.95)",
61
+ secondary: "rgba(0, 0, 0, 0.75)",
62
+ },
63
+ input: {
64
+ background: "#fbfbfb",
65
+ border: "rgba(0, 0, 0, 0.2)",
66
+ borderHover: "#BDBDBD",
67
+ borderFocus: "#BDBDBD",
68
+ borderError: "#F44336",
69
+ borderDisabled: "#E0E0E0",
70
+ text: "#000",
71
+ textDisabled: "#6d6d6d",
72
+ placeholder: "#6d6d6d",
73
+ },
74
+ textArea: {
75
+ background: "#f1f1f4",
76
+ border: "rgba(0, 0, 0, 0.2)",
77
+ borderHover: "#BDBDBD",
78
+ borderFocus: "#BDBDBD",
79
+ borderError: "#F44336",
80
+ borderDisabled: "#E0E0E0",
81
+ text: "#000",
82
+ textDisabled: "#9E9E9E",
83
+ placeholder: "#9E9E9E",
84
+ },
85
+ dataGrid: {
86
+ hover: "#efefef",
87
+ },
88
+ action: {
89
+ hover: "rgba(0, 0, 0, 0.1)",
90
+ },
91
+ divider: "rgba(0, 0, 0, 0.3)",
92
+ },
93
+ header: {
94
+ color: "rgba(0, 0, 0, 0.95)",
95
+ background: "#FFF",
96
+ search: {
97
+ color: "rgba(0, 0, 0, 0.6)",
98
+ },
99
+ indicator: {
100
+ background: customBlue[600],
101
+ },
102
+ },
103
+ footer: {
104
+ color: "rgba(0, 0, 0, 0.6)",
105
+ background: "#FFF",
106
+ },
107
+ sidebar: {
108
+ color: "rgba(0, 0, 0, 0.95)",
109
+ background: "#233044",
110
+ active: "#455466",
111
+ header: {
112
+ color: "#FFF",
113
+ background: "#233044",
114
+ brand: {
115
+ color: customBlue[500],
116
+ },
117
+ },
118
+ badge: {
119
+ color: "#FFF",
120
+ background: customBlue[500],
121
+ },
122
+ },
123
+ scrollbar: {
124
+ track: "#f1f1f1",
125
+ thumb: "#DDD",
126
+ thumbHover: "#BBB",
127
+ },
128
+ mfBorder: {
129
+ primary: "#f1f1f1",
130
+ secondary: "#DDD",
131
+ },
132
+ zIndex: {
133
+ snackbar: 999999,
134
+ },
135
+ };
136
+
137
+ const darkVariant = merge(defaultVariant, {
138
+ name: THEMES.DARK,
139
+ palette: {
140
+ mode: "dark",
141
+ divider: "rgba(255, 255, 255, 0.15)",
142
+ action: {
143
+ hover: "rgba(255, 255, 255, 0.05)",
144
+ },
145
+ primary: {
146
+ main: customBlue[500],
147
+ contrastText: "#FFF",
148
+ },
149
+ secondary: {
150
+ main: "#3f3f3f",
151
+ contrastText: "#FFF",
152
+ },
153
+ background: {
154
+ default: "#222222",
155
+ paper: "#333333",
156
+ alt: "#1e1e1e",
157
+ secondary: "#303030",
158
+ gradient: "linear-gradient(#333333 0%, #1e1e1e 50%)",
159
+ },
160
+ menu: {
161
+ background: "#222222",
162
+ },
163
+ text: {
164
+ primary: "rgba(255, 255, 255, 0.95)",
165
+ secondary: "rgba(255, 255, 255, 0.6)",
166
+ },
167
+ divider: "rgba(255, 255, 255, 0.15)",
168
+ signature: {
169
+ penColor: "#eeeeee",
170
+ borderColor: "#999999",
171
+ backgroundColor: "rgba(60,60,60,1)",
172
+ },
173
+ input: {
174
+ background: "#272727",
175
+ border: "#ffffff1a",
176
+ borderHover: "#BDBDBD",
177
+ borderFocus: "#BDBDBD",
178
+ borderError: "#F44336",
179
+ borderDisabled: "#E0E0E0",
180
+ text: "#000",
181
+ textDisabled: "#6d6d6d",
182
+ placeholder: "#6d6d6d",
183
+ },
184
+ textArea: {
185
+ background: "#292929",
186
+ border: "rgba(255, 255, 255, 0.2)",
187
+ borderHover: "#BDBDBD",
188
+ borderFocus: "#BDBDBD",
189
+ borderError: "#F44336",
190
+ borderDisabled: "#E0E0E0",
191
+ text: "#000",
192
+ textDisabled: "#9E9E9E",
193
+ placeholder: "#9E9E9E",
194
+ },
195
+ dataGrid: {
196
+ hover: "#2f2f2f",
197
+ },
198
+ },
199
+ header: {
200
+ color: "rgba(255, 255, 255, 0.95)",
201
+ background: "#1B2635",
202
+ search: {
203
+ color: "rgba(255, 255, 255, 0.6)",
204
+ },
205
+ },
206
+ footer: {
207
+ color: "rgba(255, 255, 255, 0.6)",
208
+ background: "#222222",
209
+ },
210
+ sidebar: {
211
+ color: "rgba(255, 255, 255, 0.95)",
212
+ background: "#181818",
213
+ active: "#313131",
214
+ header: {
215
+ color: "#FFF",
216
+ background: "#181818",
217
+ brand: {
218
+ color: "#FFFFFF",
219
+ },
220
+ },
221
+ },
222
+ scrollbar: {
223
+ thumb: "#3f3f3f",
224
+ track: "#252525",
225
+ thumbHover: "#151515",
226
+ },
227
+ mfBorder: {
228
+ primary: "#3f3f3f",
229
+ secondary: "#252525",
230
+ },
231
+ });
232
+
233
+ const variants = [defaultVariant, darkVariant];
234
+
235
+ export default variants;
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
package/index.js DELETED
@@ -1,8 +0,0 @@
1
- export * from "./src/Form";
2
- export * from "./src/Input";
3
- export * from "./src/TextArea";
4
- export * from "./src/TextBox";
5
- export * from "./src/TextAreaBox";
6
- export * from "./src/NumberBox";
7
- export * from "./src/SelectBox";
8
- export * from "./src/DateBox";
package/src/CheckBox.js DELETED
@@ -1,49 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import CheckBoxOutlineBlankOutlinedIcon from "@mui/icons-material/CheckBoxOutlineBlankOutlined";
3
- import CheckBoxIcon from "@mui/icons-material/CheckBox";
4
- import { useState } from "react";
5
- import { useEffect } from "react";
6
-
7
- const CheckBox = styled(
8
- ({ className, checked = true, onChange = () => {}, style = {} }) => {
9
- const [checkedState, setCheckedState] = useState(checked);
10
-
11
- const handleChange = (e) => {
12
- e.stopPropagation();
13
- setCheckedState(!checkedState);
14
- onChange({ newValue: !checkedState, previousValue: checkedState });
15
- };
16
-
17
- useEffect(() => {
18
- setCheckedState(checked);
19
- }, [checked]);
20
-
21
- return (
22
- <div className={className} onClick={handleChange}>
23
- {checkedState === true ? (
24
- <CheckBoxIcon className="checkbox checked" />
25
- ) : (
26
- <CheckBoxOutlineBlankOutlinedIcon className="checkbox unchecked" />
27
- )}
28
- </div>
29
- );
30
- }
31
- )((props) => ({
32
- display: "flex",
33
- alignItems: "center",
34
- width: 20,
35
- cursor: "pointer",
36
- ".checkbox": {
37
- color: props.theme.palette.primary.main,
38
- ...props.style,
39
- fontSize: (() => {
40
- if (props.size === "small") return 16;
41
- if (props.size === "medium") return 20;
42
- if (props.size === "large") return 24;
43
- return 16;
44
- })(),
45
- // padding: 5,
46
- },
47
- }));
48
-
49
- export default CheckBox;