@zesty-io/material 0.6.5 → 0.7.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.
- package/es/FieldTypeText/index.d.ts +6 -6
- package/es/FieldTypeText/index.js +14 -4
- package/es/LegacyTheme/index.d.ts +1 -2
- package/es/LegacyTheme/index.js +80 -17
- package/es/LegacyTheme/palette.d.ts +1 -1
- package/es/LegacyTheme/palette.js +10 -10
- package/es/theme/index.js +25 -0
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { OutlinedTextFieldProps } from
|
|
2
|
-
import { ReactNode } from
|
|
3
|
-
export interface FieldTypeTextProps extends Omit<OutlinedTextFieldProps,
|
|
1
|
+
import { OutlinedTextFieldProps } from "@mui/material/TextField";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export interface FieldTypeTextProps extends Omit<OutlinedTextFieldProps, "variant"> {
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
* Max length of the field
|
|
6
|
+
* @default 150
|
|
7
|
+
*/
|
|
8
8
|
maxLength?: number;
|
|
9
9
|
value: string;
|
|
10
10
|
endLabel?: ReactNode;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import MuiTextField from
|
|
3
|
-
import { FormControl, FormLabel, Box, InputAdornment } from
|
|
2
|
+
import MuiTextField from "@mui/material/TextField";
|
|
3
|
+
import { FormControl, FormLabel, Box, InputAdornment } from "@mui/material";
|
|
4
4
|
const FieldTypeText = ({ label, maxLength = 150, value, helperText, required, endLabel, ...props }) => {
|
|
5
|
-
return (_jsxs(FormControl, { fullWidth: true, required: required, children: [_jsxs(FormLabel, { sx: {
|
|
6
|
-
|
|
5
|
+
return (_jsxs(FormControl, { fullWidth: true, required: required, children: [_jsxs(FormLabel, { sx: {
|
|
6
|
+
lineHeight: "inherit",
|
|
7
|
+
fontSize: "inherit",
|
|
8
|
+
display: "flex",
|
|
9
|
+
justifyContent: "space-between",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
"& .MuiFormLabel-asterisk": { order: 2 },
|
|
12
|
+
mb: 0.5,
|
|
13
|
+
}, children: [_jsx(Box, { sx: { order: 1 }, children: label }), _jsx(Box, { sx: { order: 3, flex: 1, textAlign: "right" }, children: endLabel })] }), _jsx(MuiTextField, { size: "small", variant: "outlined", value: value, error: value?.length > maxLength, helperText: value?.length > maxLength
|
|
14
|
+
? "Your input is over the specified limit"
|
|
15
|
+
: helperText, InputProps: {
|
|
16
|
+
endAdornment: (_jsxs(InputAdornment, { position: "end", sx: { fontSize: "14px" }, children: [value?.length, "/", maxLength] })),
|
|
7
17
|
}, ...props })] }));
|
|
8
18
|
};
|
|
9
19
|
export default FieldTypeText;
|
package/es/LegacyTheme/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// No checking legacy theme to not have conflicting module augmentation
|
|
2
2
|
// @ts-nocheck
|
|
3
|
-
import palette from
|
|
4
|
-
import typography from
|
|
5
|
-
import { createTheme } from
|
|
3
|
+
import palette from "./palette";
|
|
4
|
+
import typography from "./typography";
|
|
5
|
+
import { createTheme } from "@mui/material/styles";
|
|
6
6
|
let theme = createTheme({
|
|
7
7
|
palette,
|
|
8
8
|
typography,
|
|
@@ -12,14 +12,23 @@ theme = createTheme(theme, {
|
|
|
12
12
|
MuiAccordionSummary: {
|
|
13
13
|
styleOverrides: {
|
|
14
14
|
root: {
|
|
15
|
-
backgroundColor:
|
|
15
|
+
backgroundColor: "#e4e9f1",
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
MuiButton: {
|
|
20
20
|
styleOverrides: {
|
|
21
21
|
root: {
|
|
22
|
-
minWidth:
|
|
22
|
+
minWidth: "auto",
|
|
23
|
+
boxShadow: "none",
|
|
24
|
+
textTransform: "none",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
MuiButtonGroup: {
|
|
29
|
+
styleOverrides: {
|
|
30
|
+
root: {
|
|
31
|
+
boxShadow: "none",
|
|
23
32
|
},
|
|
24
33
|
},
|
|
25
34
|
},
|
|
@@ -28,8 +37,8 @@ theme = createTheme(theme, {
|
|
|
28
37
|
tooltip: {
|
|
29
38
|
color: theme.palette.primary.contrastText,
|
|
30
39
|
backgroundColor: theme.palette.primary.main,
|
|
31
|
-
fontSize:
|
|
32
|
-
lineHeight:
|
|
40
|
+
fontSize: "14px",
|
|
41
|
+
lineHeight: "20px",
|
|
33
42
|
},
|
|
34
43
|
arrow: {
|
|
35
44
|
color: theme.palette.primary.main,
|
|
@@ -56,26 +65,80 @@ theme = createTheme(theme, {
|
|
|
56
65
|
MuiCard: {
|
|
57
66
|
styleOverrides: {
|
|
58
67
|
root: {
|
|
59
|
-
overflow:
|
|
68
|
+
overflow: "visible",
|
|
60
69
|
},
|
|
61
70
|
},
|
|
62
71
|
},
|
|
63
72
|
MuiCardHeader: {
|
|
64
73
|
styleOverrides: {
|
|
65
74
|
root: {
|
|
66
|
-
backgroundColor:
|
|
75
|
+
backgroundColor: "#e4e9f1",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
MuiCssBaseline: {
|
|
80
|
+
styleOverrides: {
|
|
81
|
+
body: {
|
|
82
|
+
boxSizing: "content-box",
|
|
83
|
+
"&::-webkit-scrollbar, & *::-webkit-scrollbar": {
|
|
84
|
+
width: "8px",
|
|
85
|
+
height: "8px",
|
|
86
|
+
},
|
|
87
|
+
"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece": {
|
|
88
|
+
backgroundColor: "#f2f4f7",
|
|
89
|
+
borderRadius: "4px",
|
|
90
|
+
},
|
|
91
|
+
"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": {
|
|
92
|
+
backgroundColor: "#d0d5dd",
|
|
93
|
+
borderRadius: "4px",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
MuiOutlinedInput: {
|
|
99
|
+
styleOverrides: {
|
|
100
|
+
root: {
|
|
101
|
+
padding: "0px 8px",
|
|
102
|
+
borderRadius: "8px",
|
|
103
|
+
backgroundColor: theme.palette.common.white,
|
|
104
|
+
"&.Mui-disabled .MuiOutlinedInput-notchedOutline": {
|
|
105
|
+
borderColor: "#F2F4F7",
|
|
106
|
+
},
|
|
107
|
+
"&:hover .MuiOutlinedInput-notchedOutline": {
|
|
108
|
+
borderColor: "#F2F4F7",
|
|
109
|
+
},
|
|
110
|
+
"&.Mui-focused:hover .MuiOutlinedInput-notchedOutline": {
|
|
111
|
+
borderColor: "#FF5D0A",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
input: {
|
|
115
|
+
padding: "10px 0px",
|
|
116
|
+
":read-only": {
|
|
117
|
+
color: "#475467",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
sizeSmall: {
|
|
121
|
+
input: {
|
|
122
|
+
padding: "8px 0px",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
notchedOutline: {
|
|
126
|
+
borderColor: "#F2F4F7",
|
|
67
127
|
},
|
|
68
128
|
},
|
|
69
129
|
},
|
|
70
|
-
|
|
130
|
+
MuiLink: {
|
|
71
131
|
styleOverrides: {
|
|
72
|
-
root:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}
|
|
132
|
+
root: {
|
|
133
|
+
color: theme.palette.info.dark,
|
|
134
|
+
textDecorationColor: theme.palette.info.main,
|
|
135
|
+
"&:hover": {
|
|
136
|
+
textDecorationColor: theme.palette.info.dark,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
defaultProps: {
|
|
141
|
+
underline: "hover",
|
|
79
142
|
},
|
|
80
143
|
},
|
|
81
144
|
},
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
const palette = {
|
|
2
2
|
primary: {
|
|
3
|
-
main:
|
|
4
|
-
contrastText:
|
|
3
|
+
main: "#404759",
|
|
4
|
+
contrastText: "#ffffff",
|
|
5
5
|
},
|
|
6
6
|
secondary: {
|
|
7
|
-
main:
|
|
8
|
-
contrastText:
|
|
7
|
+
main: "#497edf",
|
|
8
|
+
contrastText: "#ffffff",
|
|
9
9
|
},
|
|
10
10
|
success: {
|
|
11
|
-
main:
|
|
12
|
-
contrastText:
|
|
11
|
+
main: "#75bf25",
|
|
12
|
+
contrastText: "#ffffff",
|
|
13
13
|
},
|
|
14
14
|
warning: {
|
|
15
|
-
main:
|
|
16
|
-
contrastText:
|
|
15
|
+
main: "#f17829",
|
|
16
|
+
contrastText: "#ffffff",
|
|
17
17
|
},
|
|
18
18
|
error: {
|
|
19
|
-
main:
|
|
20
|
-
contrastText:
|
|
19
|
+
main: "#e53c05",
|
|
20
|
+
contrastText: "#ffffff",
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
export default palette;
|
package/es/theme/index.js
CHANGED
|
@@ -417,6 +417,31 @@ theme = createTheme(theme, {
|
|
|
417
417
|
},
|
|
418
418
|
},
|
|
419
419
|
},
|
|
420
|
+
MuiCssBaseline: {
|
|
421
|
+
styleOverrides: {
|
|
422
|
+
body: {
|
|
423
|
+
"&::-webkit-scrollbar, & *::-webkit-scrollbar": {
|
|
424
|
+
width: "8px",
|
|
425
|
+
height: "8px",
|
|
426
|
+
},
|
|
427
|
+
"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece": {
|
|
428
|
+
backgroundColor: theme.palette.grey[100],
|
|
429
|
+
borderRadius: "4px",
|
|
430
|
+
},
|
|
431
|
+
"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": {
|
|
432
|
+
backgroundColor: theme.palette.grey[300],
|
|
433
|
+
borderRadius: "4px",
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
MuiDivider: {
|
|
439
|
+
styleOverrides: {
|
|
440
|
+
root: {
|
|
441
|
+
borderColor: theme.palette.border
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
420
445
|
},
|
|
421
446
|
});
|
|
422
447
|
export default theme;
|