@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.
Files changed (52) hide show
  1. package/package.json +21 -3
  2. package/rollup.config.js +10 -0
  3. package/src/components/ArrowButton/ArrowButton.tsx +54 -0
  4. package/src/components/ArrowButton/index.tsx +1 -0
  5. package/src/components/Button/Button.tsx +278 -0
  6. package/src/components/Button/index.ts +1 -0
  7. package/src/{Calendar → components/Calendar}/Calendar.js +365 -329
  8. package/src/{Calendar → components/Calendar}/CalendarStyles.js +190 -168
  9. package/src/{Calendar → components/Calendar}/calendarHelpers.js +194 -194
  10. package/src/components/DateInput/DateInput.js +583 -0
  11. package/src/components/FieldLabel/FieldLabel.tsx +152 -0
  12. package/src/components/FieldLabel/index.ts +1 -0
  13. package/src/components/FileInputField/FileInputField.js +171 -0
  14. package/src/components/Input/Input.tsx +141 -0
  15. package/src/components/Input/index.tsx +1 -0
  16. package/src/components/Pill/Pill.tsx +144 -0
  17. package/src/components/Pill/index.ts +1 -0
  18. package/src/components/SelectBox/SelectBox.js +543 -0
  19. package/src/components/TagBox/TagBox.js +563 -0
  20. package/src/components/TextArea/TextArea.tsx +70 -0
  21. package/src/components/TextArea/index.ts +1 -0
  22. package/src/components/TextAreaInput/TextAreaInput.tsx +48 -0
  23. package/src/components/TextAreaInput/index.ts +1 -0
  24. package/src/components/TextInput/TextInput.tsx +50 -0
  25. package/src/components/TextInput/index.tsx +1 -0
  26. package/src/components/core/index.js +16 -0
  27. package/src/components/index.ts +7 -0
  28. package/src/components/theme/breakpoints.js +11 -0
  29. package/src/components/theme/components.js +140 -0
  30. package/src/components/theme/index.js +77 -0
  31. package/src/components/theme/shadows.js +33 -0
  32. package/src/components/theme/typography.js +58 -0
  33. package/src/components/theme/variants.js +235 -0
  34. package/src/index.ts +1 -0
  35. package/tsconfig.json +109 -0
  36. package/index.js +0 -8
  37. package/src/CheckBox.js +0 -49
  38. package/src/DataGrid/DataGrid.js +0 -729
  39. package/src/DateBox.js +0 -77
  40. package/src/Form.js +0 -116
  41. package/src/Input.js +0 -160
  42. package/src/Menu.js +0 -196
  43. package/src/NumberBox.js +0 -121
  44. package/src/OptionButton.js +0 -89
  45. package/src/SelectBox.js +0 -252
  46. package/src/TagBox/TagBox.js +0 -75
  47. package/src/TagBox/TagBoxStyles.js +0 -122
  48. package/src/TextArea.js +0 -85
  49. package/src/TextAreaBox.js +0 -43
  50. package/src/TextBox.js +0 -10
  51. package/src/TimeBox.js +0 -0
  52. package/src/Timeline.js +0 -153
@@ -0,0 +1,50 @@
1
+ import React from "react";
2
+ import FieldLabel from "../FieldLabel";
3
+ import StyledInput from "../Input";
4
+
5
+ interface TextInputProps {
6
+ label?: string;
7
+ error?: boolean;
8
+ errorMessage?: string;
9
+ required?: boolean;
10
+ colSpan?: number;
11
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
12
+ description?: string | null;
13
+ }
14
+
15
+ const TextInput: React.FC<TextInputProps> = ({
16
+ label,
17
+ error,
18
+ errorMessage,
19
+ required,
20
+ colSpan = 1,
21
+ size,
22
+ description,
23
+ ...other
24
+ }) => {
25
+ return (
26
+ <div
27
+ style={{
28
+ gridColumn: `span ${colSpan}`,
29
+ display: "flex",
30
+ flexDirection: "column",
31
+ justifyContent: "space-between",
32
+ }}
33
+ >
34
+ {label && (
35
+ <FieldLabel
36
+ error={error}
37
+ errorMessage={errorMessage}
38
+ asterisk={required}
39
+ size={size}
40
+ description={description}
41
+ >
42
+ {label}
43
+ </FieldLabel>
44
+ )}
45
+ <StyledInput error={error} {...other} />
46
+ </div>
47
+ );
48
+ };
49
+
50
+ export default TextInput;
@@ -0,0 +1 @@
1
+ export { default } from "./TextInput";
@@ -0,0 +1,16 @@
1
+ import { ThemeProvider } from "styled-components";
2
+
3
+ import variants from "@monolith-ui/theme/variants";
4
+
5
+ export const MonolithThemeProvider = ({ children, theme }) => {
6
+ let selectedTheme = theme
7
+ ? variants.find((variant) => variant.name === theme)
8
+ : variants[1]; // Default to dark theme
9
+
10
+ if (!selectedTheme) {
11
+ console.warn(new Error(`The theme ${theme} is not valid`));
12
+ selectedTheme = variants[1]; // Default to dark theme
13
+ }
14
+
15
+ return <ThemeProvider theme={selectedTheme}>{children}</ThemeProvider>;
16
+ };
@@ -0,0 +1,7 @@
1
+ export { default as Button } from "./Button";
2
+ export { default as Input } from "./Input";
3
+ export { default as TextArea } from "./TextArea";
4
+ export { default as FieldLabel } from "./FieldLabel";
5
+ export { default as TextInput } from "./TextInput";
6
+ export { default as TextAreaInput } from "./TextAreaInput";
7
+ export { default as Pill } from "./Pill";
@@ -0,0 +1,11 @@
1
+ const breakpoints = {
2
+ values: {
3
+ xs: 0,
4
+ sm: 600,
5
+ md: 900,
6
+ lg: 1200,
7
+ xl: 1536,
8
+ },
9
+ };
10
+
11
+ export default breakpoints;
@@ -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;
@@ -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/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./components";