@nethru/ui 1.0.81 → 2.0.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/base/AddableFormList.js +56 -0
- package/base/Alert.js +27 -0
- package/base/Checkbox.js +20 -0
- package/base/CircularProgressButton.js +36 -0
- package/base/ColumnedSection.js +44 -0
- package/base/DropdownButton.js +74 -0
- package/base/MainHeader.js +56 -0
- package/base/MenuItem.js +92 -0
- package/base/PropertyTable.js +69 -0
- package/base/SearchTextField.js +44 -0
- package/base/SearchableSelect.js +64 -0
- package/base/Select.js +33 -0
- package/{dist → base}/Slider.js +12 -13
- package/base/Snackbar.js +33 -0
- package/base/Switch.js +20 -0
- package/base/assets/icons.js +390 -0
- package/base/assets/images.js +1 -0
- package/base/colors/blue.js +15 -0
- package/base/colors/blueGrey.js +6 -0
- package/base/colors/green.js +13 -0
- package/base/colors/grey.js +18 -0
- package/base/colors/index.js +9 -0
- package/base/colors/lime.js +13 -0
- package/base/colors/orange.js +13 -0
- package/base/colors/purple.js +13 -0
- package/base/colors/red.js +13 -0
- package/base/colors/yellow.js +13 -0
- package/base/datagrid/DataGrid.js +57 -0
- package/base/datagrid/Footer.js +51 -0
- package/base/datagrid/Pagination.js +24 -0
- package/base/dialog/AlertDialog.js +21 -0
- package/base/dialog/ConfirmDialog.js +29 -0
- package/base/dialog/Dialog.js +56 -0
- package/base/dialog/SimpleDialog.js +33 -0
- package/{dist → base}/error/Error.js +1 -2
- package/base/frame/AppBar.js +54 -0
- package/base/frame/Brand.js +36 -0
- package/base/frame/Frame.js +49 -0
- package/{dist → base/frame}/sidebar/MenuToggler.js +14 -3
- package/{dist → base/frame}/sidebar/PrimaryMenu.js +15 -20
- package/base/frame/sidebar/SecondaryMenu.js +41 -0
- package/{dist → base/frame}/sidebar/Sidebar.js +21 -10
- package/base/frame/sidebar/SidebarContext.js +74 -0
- package/base/frame/sidebar/css/primary.module.css +69 -0
- package/base/frame/sidebar/css/sidebar.module.css +63 -0
- package/base/index.js +33 -0
- package/{dist → base}/samples/menu.sample.json +2 -2
- package/base/styles/borderRadius.js +7 -0
- package/base/styles/createTheme.js +90 -0
- package/base/styles/globalStyles.js +47 -0
- package/base/styles/mui/alert.js +40 -0
- package/base/styles/mui/appBar.js +17 -0
- package/base/styles/mui/autocomplete.js +46 -0
- package/base/styles/mui/avatar.js +14 -0
- package/base/styles/mui/button.js +276 -0
- package/base/styles/mui/buttonBase.js +10 -0
- package/base/styles/mui/checkbox.js +37 -0
- package/base/styles/mui/chip.js +83 -0
- package/base/styles/mui/cssBaseline.js +12 -0
- package/base/styles/mui/dataGrid.js +101 -0
- package/base/styles/mui/dialog.js +13 -0
- package/base/styles/mui/dialogActions.js +8 -0
- package/base/styles/mui/dialogContent.js +10 -0
- package/base/styles/mui/dialogTitle.js +11 -0
- package/base/styles/mui/formControl.js +8 -0
- package/base/styles/mui/formControlLabel.js +9 -0
- package/base/styles/mui/formHelperText.js +10 -0
- package/base/styles/mui/grid.js +15 -0
- package/base/styles/mui/icon.js +12 -0
- package/base/styles/mui/iconButton.js +79 -0
- package/base/styles/mui/inputLabel.js +13 -0
- package/base/styles/mui/list.js +11 -0
- package/base/styles/mui/menuItem.js +83 -0
- package/base/styles/mui/outlinedInput.js +53 -0
- package/base/styles/mui/paginationItem.js +25 -0
- package/base/styles/mui/paper.js +8 -0
- package/base/styles/mui/popover.js +11 -0
- package/base/styles/mui/select.js +11 -0
- package/base/styles/mui/slider.js +15 -0
- package/base/styles/mui/snackbar.js +24 -0
- package/base/styles/mui/switch.js +33 -0
- package/base/styles/mui/tab.js +23 -0
- package/base/styles/mui/tablePagination.js +8 -0
- package/base/styles/mui/tabs.js +20 -0
- package/base/styles/mui/textField.js +11 -0
- package/base/styles/mui/toggleButton.js +96 -0
- package/base/styles/mui/tooltip.js +22 -0
- package/base/styles/palette.js +40 -0
- package/base/styles/shadow.js +8 -0
- package/base/styles/typography.js +131 -0
- package/package.json +14 -10
- package/dist/Accordion.js +0 -45
- package/dist/AccordionDetails.js +0 -19
- package/dist/AccordionSummary.js +0 -35
- package/dist/AlertDialog.js +0 -55
- package/dist/AppBar.js +0 -68
- package/dist/AppendableFormList.js +0 -56
- package/dist/AvatarDropdown.js +0 -80
- package/dist/Button.js +0 -61
- package/dist/Checkbox.js +0 -27
- package/dist/CircularProgress.js +0 -33
- package/dist/ColumnedSection.js +0 -64
- package/dist/ConfirmDialog.js +0 -65
- package/dist/DataGrid.js +0 -150
- package/dist/Dialog.js +0 -42
- package/dist/DropdownButton.js +0 -59
- package/dist/FormLabel.js +0 -23
- package/dist/Frame.js +0 -47
- package/dist/GroupSelect.js +0 -67
- package/dist/ListItem.js +0 -21
- package/dist/ListItemDivider.js +0 -15
- package/dist/ListItemGrid.js +0 -12
- package/dist/ListItemText.js +0 -44
- package/dist/MainHeader.js +0 -59
- package/dist/PropertyTable.js +0 -141
- package/dist/ReferenceChipList.js +0 -59
- package/dist/SearchTextField.js +0 -24
- package/dist/SearchableSelect.js +0 -41
- package/dist/Section.js +0 -22
- package/dist/Select.js +0 -48
- package/dist/ShadowedSection.js +0 -36
- package/dist/Snackbar.js +0 -51
- package/dist/StatusChip.js +0 -34
- package/dist/Switch.js +0 -37
- package/dist/TabbedSection.js +0 -37
- package/dist/Tabs.js +0 -38
- package/dist/TextField.js +0 -25
- package/dist/index.js +0 -42
- package/dist/samples/global.sample.css +0 -59
- package/dist/sidebar/MenuTree.js +0 -95
- package/dist/sidebar/MenuTreeGroup.js +0 -65
- package/dist/sidebar/SecondaryMenu.js +0 -36
- package/dist/sidebar/SidebarContext.js +0 -122
- package/dist/sidebar/css/primary.module.css +0 -80
- package/dist/sidebar/css/sidebar.module.css +0 -50
- package/dist/variables.js +0 -6
- /package/{dist → base}/editor/Editor.js +0 -0
- /package/{dist → base}/editor/nScript.js +0 -0
- /package/{dist → base}/editor/nScriptKeywords.js +0 -0
- /package/{dist → base}/error/HttpError.js +0 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { blue, grey, orange, red } from "../../colors";
|
|
2
|
+
import typography from "../typography";
|
|
3
|
+
import borderRadius from "../borderRadius";
|
|
4
|
+
export const primary = {
|
|
5
|
+
contained: (ownerState, theme) => {
|
|
6
|
+
return ownerState.color === 'primary' && ownerState.variant === 'contained' && {
|
|
7
|
+
color: theme.palette.primary.contrastText,
|
|
8
|
+
backgroundColor: theme.palette.primary.main,
|
|
9
|
+
':hover, &.Mui-focusVisible': {
|
|
10
|
+
color: theme.palette.primary.contrastText,
|
|
11
|
+
backgroundColor: '#242424'
|
|
12
|
+
},
|
|
13
|
+
':active': {
|
|
14
|
+
color: grey[300],
|
|
15
|
+
backgroundColor: '#141414'
|
|
16
|
+
},
|
|
17
|
+
':disabled': {
|
|
18
|
+
color: grey[500],
|
|
19
|
+
backgroundColor: grey[300]
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
outlined: (ownerState, theme) => {
|
|
24
|
+
return ownerState.color === 'primary' && ownerState.variant === 'outlined' && {
|
|
25
|
+
color: grey[900],
|
|
26
|
+
backgroundColor: '#fff',
|
|
27
|
+
borderColor: grey[700],
|
|
28
|
+
':hover, &.Mui-focusVisible': {
|
|
29
|
+
color: grey[900],
|
|
30
|
+
backgroundColor: grey[10]
|
|
31
|
+
},
|
|
32
|
+
':active': {
|
|
33
|
+
color: grey[900],
|
|
34
|
+
backgroundColor: grey[20]
|
|
35
|
+
},
|
|
36
|
+
':disabled': {
|
|
37
|
+
color: grey[400],
|
|
38
|
+
backgroundColor: '#fff',
|
|
39
|
+
borderColor: grey[400]
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
text: (ownerState, theme) => {
|
|
44
|
+
return ownerState.color === 'primary' && ownerState.variant === 'text' && {
|
|
45
|
+
color: grey[900],
|
|
46
|
+
backgroundColor: '#fff',
|
|
47
|
+
':hover, &.Mui-focusVisible': {
|
|
48
|
+
color: grey[900],
|
|
49
|
+
backgroundColor: grey[100]
|
|
50
|
+
},
|
|
51
|
+
':active': {
|
|
52
|
+
color: grey[900],
|
|
53
|
+
backgroundColor: grey[200]
|
|
54
|
+
},
|
|
55
|
+
':disabled': {
|
|
56
|
+
color: grey[400],
|
|
57
|
+
backgroundColor: '#fff'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export const info = {
|
|
63
|
+
contained: (ownerState, theme) => {
|
|
64
|
+
return ownerState.color === 'info' && ownerState.variant === 'contained' && {
|
|
65
|
+
color: theme.palette.info.contrastText,
|
|
66
|
+
backgroundColor: theme.palette.info.main,
|
|
67
|
+
':hover, &.Mui-focusVisible': {
|
|
68
|
+
color: theme.palette.info.contrastText,
|
|
69
|
+
backgroundColor: blue[600]
|
|
70
|
+
},
|
|
71
|
+
':active': {
|
|
72
|
+
color: theme.palette.info.contrastText,
|
|
73
|
+
backgroundColor: blue[800]
|
|
74
|
+
},
|
|
75
|
+
':disabled': {
|
|
76
|
+
color: grey[500],
|
|
77
|
+
backgroundColor: grey[300]
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
outlined: (ownerState, theme) => {
|
|
82
|
+
return ownerState.color === 'info' && ownerState.variant === 'outlined' && {
|
|
83
|
+
color: blue[500],
|
|
84
|
+
backgroundColor: '#fff',
|
|
85
|
+
borderColor: blue[500],
|
|
86
|
+
':hover, &.Mui-focusVisible': {
|
|
87
|
+
color: blue[500],
|
|
88
|
+
backgroundColor: blue[50]
|
|
89
|
+
},
|
|
90
|
+
':active': {
|
|
91
|
+
color: blue[500],
|
|
92
|
+
backgroundColor: blue[100]
|
|
93
|
+
},
|
|
94
|
+
':disabled': {
|
|
95
|
+
color: grey[400],
|
|
96
|
+
backgroundColor: '#fff',
|
|
97
|
+
borderColor: grey[400]
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
text: (ownerState, theme) => {
|
|
102
|
+
return ownerState.color === 'info' && ownerState.variant === 'text' && {
|
|
103
|
+
color: blue[500],
|
|
104
|
+
backgroundColor: '#fff',
|
|
105
|
+
':hover, &.Mui-focusVisible': {
|
|
106
|
+
color: blue[500],
|
|
107
|
+
backgroundColor: blue[50]
|
|
108
|
+
},
|
|
109
|
+
':active': {
|
|
110
|
+
color: blue[500],
|
|
111
|
+
backgroundColor: blue[100]
|
|
112
|
+
},
|
|
113
|
+
':disabled': {
|
|
114
|
+
color: grey[400],
|
|
115
|
+
backgroundColor: '#fff'
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
export const warning = {
|
|
121
|
+
contained: (ownerState, theme) => {
|
|
122
|
+
return ownerState.color === 'warning' && ownerState.variant === 'contained' && {
|
|
123
|
+
color: theme.palette.warning.contrastText,
|
|
124
|
+
backgroundColor: theme.palette.warning.main,
|
|
125
|
+
':hover, &.Mui-focusVisible': {
|
|
126
|
+
color: theme.palette.warning.contrastText,
|
|
127
|
+
backgroundColor: orange[600]
|
|
128
|
+
},
|
|
129
|
+
':active': {
|
|
130
|
+
color: theme.palette.warning.contrastText,
|
|
131
|
+
backgroundColor: orange[800]
|
|
132
|
+
},
|
|
133
|
+
':disabled': {
|
|
134
|
+
color: grey[500],
|
|
135
|
+
backgroundColor: grey[300]
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
export const error = {
|
|
141
|
+
contained: (ownerState, theme) => {
|
|
142
|
+
return ownerState.color === 'error' && ownerState.variant === 'contained' && {
|
|
143
|
+
color: theme.palette.error.contrastText,
|
|
144
|
+
backgroundColor: theme.palette.error.main,
|
|
145
|
+
':hover, &.Mui-focusVisible': {
|
|
146
|
+
color: theme.palette.error.contrastText,
|
|
147
|
+
backgroundColor: red[600]
|
|
148
|
+
},
|
|
149
|
+
':active': {
|
|
150
|
+
color: theme.palette.error.contrastText,
|
|
151
|
+
backgroundColor: red[800]
|
|
152
|
+
},
|
|
153
|
+
':disabled': {
|
|
154
|
+
color: grey[500],
|
|
155
|
+
backgroundColor: grey[300]
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
outlined: (ownerState, theme) => {
|
|
160
|
+
return ownerState.color === 'error' && ownerState.variant === 'outlined' && {
|
|
161
|
+
color: red[700],
|
|
162
|
+
backgroundColor: '#fff',
|
|
163
|
+
borderColor: red[600],
|
|
164
|
+
':hover, &.Mui-focusVisible': {
|
|
165
|
+
color: red[700],
|
|
166
|
+
backgroundColor: red[50] //'#fef2f4',
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
':active': {
|
|
170
|
+
color: red[700],
|
|
171
|
+
backgroundColor: red[100] //'#fcdee5',
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
':disabled': {
|
|
175
|
+
color: grey[400],
|
|
176
|
+
backgroundColor: '#fff',
|
|
177
|
+
borderColor: grey[400]
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
text: (ownerState, theme) => {
|
|
182
|
+
return ownerState.color === 'error' && ownerState.variant === 'text' && {
|
|
183
|
+
color: red[700],
|
|
184
|
+
backgroundColor: '#fff',
|
|
185
|
+
':hover, &.Mui-focusVisible': {
|
|
186
|
+
color: red[700],
|
|
187
|
+
backgroundColor: red[50] //'#fef2f4',
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
':active': {
|
|
191
|
+
color: red[700],
|
|
192
|
+
backgroundColor: red[100] //'#fcdee5',
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
':disabled': {
|
|
196
|
+
color: grey[400],
|
|
197
|
+
backgroundColor: '#fff'
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
export const crud = {
|
|
203
|
+
contained: (ownerState, theme) => {
|
|
204
|
+
return ownerState.color === 'crud' && ownerState.variant === 'contained' && {
|
|
205
|
+
color: theme.palette.crud.contrastText,
|
|
206
|
+
backgroundColor: theme.palette.crud.main,
|
|
207
|
+
':hover, &.Mui-focusVisible': {
|
|
208
|
+
color: theme.palette.crud.contrastText,
|
|
209
|
+
backgroundColor: blue[100]
|
|
210
|
+
},
|
|
211
|
+
':active': {
|
|
212
|
+
color: theme.palette.crud.contrastText,
|
|
213
|
+
backgroundColor: blue[200]
|
|
214
|
+
},
|
|
215
|
+
':disabled': {
|
|
216
|
+
color: grey[400],
|
|
217
|
+
backgroundColor: grey[150]
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
export const styles = {
|
|
223
|
+
defaultProps: {
|
|
224
|
+
variant: 'contained'
|
|
225
|
+
},
|
|
226
|
+
styleOverrides: {
|
|
227
|
+
root: ({
|
|
228
|
+
ownerState,
|
|
229
|
+
theme
|
|
230
|
+
}) => ({
|
|
231
|
+
...primary.contained(ownerState, theme),
|
|
232
|
+
...primary.outlined(ownerState, theme),
|
|
233
|
+
...primary.text(ownerState, theme),
|
|
234
|
+
...info.contained(ownerState, theme),
|
|
235
|
+
...info.outlined(ownerState, theme),
|
|
236
|
+
...info.text(ownerState, theme),
|
|
237
|
+
...warning.contained(ownerState, theme),
|
|
238
|
+
...error.contained(ownerState, theme),
|
|
239
|
+
...error.outlined(ownerState, theme),
|
|
240
|
+
...error.text(ownerState, theme),
|
|
241
|
+
...crud.contained(ownerState, theme),
|
|
242
|
+
fontFamily: typography.fontFamily,
|
|
243
|
+
borderRadius: borderRadius[2],
|
|
244
|
+
boxShadow: 'none!important'
|
|
245
|
+
}),
|
|
246
|
+
sizeMedium: ({
|
|
247
|
+
ownerState,
|
|
248
|
+
theme
|
|
249
|
+
}) => ({
|
|
250
|
+
minWidth: 60,
|
|
251
|
+
height: ownerState.color === 'crud' ? 26 : 36,
|
|
252
|
+
padding: ownerState.color === 'crud' ? '0px 2px' : '8px 12px',
|
|
253
|
+
fontSize: typography.bodyMdSemibold.fontSize,
|
|
254
|
+
fontWeight: typography.bodyMdSemibold.fontWeight
|
|
255
|
+
}),
|
|
256
|
+
sizeSmall: {
|
|
257
|
+
minWidth: '50px',
|
|
258
|
+
height: '26px',
|
|
259
|
+
padding: '8px 8px',
|
|
260
|
+
fontSize: typography.bodySmSemibold.fontSize,
|
|
261
|
+
fontWeight: typography.bodySmSemibold.fontWeight
|
|
262
|
+
},
|
|
263
|
+
startIcon: ({
|
|
264
|
+
ownerState,
|
|
265
|
+
theme
|
|
266
|
+
}) => ({
|
|
267
|
+
marginRight: theme.spacing(ownerState.color === 'crud' ? 0.5 : 1)
|
|
268
|
+
}),
|
|
269
|
+
endIcon: ({
|
|
270
|
+
ownerState,
|
|
271
|
+
theme
|
|
272
|
+
}) => ({
|
|
273
|
+
marginLeft: theme.spacing(ownerState.color === 'crud' ? 0.5 : 1)
|
|
274
|
+
})
|
|
275
|
+
}
|
|
276
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { grey } from "../../colors";
|
|
2
|
+
export const styles = {
|
|
3
|
+
styleOverrides: {
|
|
4
|
+
root: ({
|
|
5
|
+
ownerState,
|
|
6
|
+
theme
|
|
7
|
+
}) => ({
|
|
8
|
+
':hover, &.Mui-focusVisible': {
|
|
9
|
+
backgroundColor: grey[10]
|
|
10
|
+
},
|
|
11
|
+
'&:active': {
|
|
12
|
+
backgroundColor: grey[20]
|
|
13
|
+
},
|
|
14
|
+
'& svg': {
|
|
15
|
+
fill: fillColor(ownerState, theme),
|
|
16
|
+
width: 20,
|
|
17
|
+
height: 20
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
sizeLarge: {
|
|
21
|
+
width: 28,
|
|
22
|
+
height: 28
|
|
23
|
+
},
|
|
24
|
+
sizeMedium: {
|
|
25
|
+
width: 26,
|
|
26
|
+
height: 26
|
|
27
|
+
},
|
|
28
|
+
sizeSmall: {
|
|
29
|
+
width: 24,
|
|
30
|
+
height: 24
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function fillColor(ownerState, theme) {
|
|
35
|
+
if (ownerState.disabled) return ownerState.checked ? grey[700] : grey[400];
|
|
36
|
+
// return ownerState.checked ? theme.palette.info.main : grey[700];
|
|
37
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { blue, green, grey, lime, orange } from "../../colors";
|
|
2
|
+
import typography from "../typography";
|
|
3
|
+
import { lighten } from "@mui/material/styles";
|
|
4
|
+
export const styles = {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
size: 'small'
|
|
7
|
+
},
|
|
8
|
+
styleOverrides: {
|
|
9
|
+
root: ({
|
|
10
|
+
ownerState,
|
|
11
|
+
theme
|
|
12
|
+
}) => ({
|
|
13
|
+
fontFamily: typography.fontFamily,
|
|
14
|
+
fontSize: typography.bodySmMedium.fontSize,
|
|
15
|
+
fontWeight: typography.bodySmMedium.fontWeight,
|
|
16
|
+
letterSpacing: typography.bodySmMedium.letterSpacing,
|
|
17
|
+
color: textColor(ownerState, theme),
|
|
18
|
+
backgroundColor: backgroundColor(ownerState, theme),
|
|
19
|
+
borderColor: borderColor(ownerState, theme),
|
|
20
|
+
'&:hover, &.Mui-focusVisible': {
|
|
21
|
+
backgroundColor: hoverColor(ownerState, theme)
|
|
22
|
+
},
|
|
23
|
+
'&:active': {
|
|
24
|
+
backgroundColor: activeColor(ownerState, theme),
|
|
25
|
+
boxShadow: 'none'
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
sizeMedium: undefined,
|
|
29
|
+
sizeSmall: {
|
|
30
|
+
height: 26
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function textColor(ownerState, theme) {
|
|
35
|
+
switch (ownerState.color) {
|
|
36
|
+
case 'blue':
|
|
37
|
+
return theme.palette.blue.contrastText;
|
|
38
|
+
case 'green':
|
|
39
|
+
return theme.palette.green.contrastText;
|
|
40
|
+
case 'orange':
|
|
41
|
+
return theme.palette.orange.contrastText;
|
|
42
|
+
case 'lime':
|
|
43
|
+
return theme.palette.lime.contrastText;
|
|
44
|
+
default:
|
|
45
|
+
return grey[900];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function backgroundColor(ownerState, theme) {
|
|
49
|
+
if (ownerState.variant === 'outlined') return undefined;
|
|
50
|
+
switch (ownerState.color) {
|
|
51
|
+
case 'blue':
|
|
52
|
+
return blue[50];
|
|
53
|
+
case 'green':
|
|
54
|
+
return green[50];
|
|
55
|
+
case 'orange':
|
|
56
|
+
return orange[50];
|
|
57
|
+
case 'lime':
|
|
58
|
+
return lime[50];
|
|
59
|
+
default:
|
|
60
|
+
return grey[7];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function borderColor(ownerState, theme) {
|
|
64
|
+
if (ownerState.variant !== 'outlined') return undefined;
|
|
65
|
+
switch (ownerState.color) {
|
|
66
|
+
case 'blue':
|
|
67
|
+
return blue[500];
|
|
68
|
+
case 'green':
|
|
69
|
+
return green[500];
|
|
70
|
+
case 'orange':
|
|
71
|
+
return orange[500];
|
|
72
|
+
case 'lime':
|
|
73
|
+
return lime[500];
|
|
74
|
+
default:
|
|
75
|
+
return grey[300];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function hoverColor(ownerState, theme) {
|
|
79
|
+
return ownerState.clickable && lighten(textColor(ownerState, theme), 0.8);
|
|
80
|
+
}
|
|
81
|
+
function activeColor(ownerState, theme) {
|
|
82
|
+
return ownerState.clickable && lighten(textColor(ownerState, theme), 0.7);
|
|
83
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import typography from "../typography";
|
|
2
|
+
import { blue, grey } from "../../colors";
|
|
3
|
+
import borderRadius from "../borderRadius";
|
|
4
|
+
export const styles = {
|
|
5
|
+
styleOverrides: {
|
|
6
|
+
root: {
|
|
7
|
+
fontFamily: typography.fontFamily,
|
|
8
|
+
...typography.bodyMdMedium,
|
|
9
|
+
border: 'none'
|
|
10
|
+
},
|
|
11
|
+
main: ({
|
|
12
|
+
ownerState
|
|
13
|
+
}) => ({
|
|
14
|
+
border: `1px solid ${ownerState?.error ? 'red' : grey[300]}`,
|
|
15
|
+
borderRadius: borderRadius[2]
|
|
16
|
+
}),
|
|
17
|
+
footerContainer: {
|
|
18
|
+
border: 'none',
|
|
19
|
+
'.MuiDataGrid-selectedRowCount': {
|
|
20
|
+
...typography.bodySmMedium,
|
|
21
|
+
color: grey[700]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
columnHeaders: {
|
|
25
|
+
minHeight: 'unset !important'
|
|
26
|
+
},
|
|
27
|
+
columnHeader: {
|
|
28
|
+
...typography.bodySmBold,
|
|
29
|
+
color: grey[600],
|
|
30
|
+
backgroundColor: grey[50],
|
|
31
|
+
height: '35px !important',
|
|
32
|
+
'&:focus, &:focus-within': {
|
|
33
|
+
outline: 'none'
|
|
34
|
+
},
|
|
35
|
+
'.Mui-checked, .MuiCheckbox-indeterminate': {
|
|
36
|
+
color: blue[500]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
iconButtonContainer: {
|
|
40
|
+
...typography.bodySmRegular,
|
|
41
|
+
marginLeft: 2,
|
|
42
|
+
'.MuiIconButton-root': {
|
|
43
|
+
color: grey[600],
|
|
44
|
+
width: 16,
|
|
45
|
+
height: 16
|
|
46
|
+
},
|
|
47
|
+
'.MuiIconButton-root svg': {
|
|
48
|
+
width: 14,
|
|
49
|
+
height: 14
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
row: {
|
|
53
|
+
minHeight: 'unset !important',
|
|
54
|
+
'.MuiDataGrid-cell .MuiDataGrid-actions': {
|
|
55
|
+
display: 'none'
|
|
56
|
+
},
|
|
57
|
+
'&.Mui-hovered': {
|
|
58
|
+
backgroundColor: grey[5],
|
|
59
|
+
'.MuiDataGrid-cell .MuiDataGrid-actions': {
|
|
60
|
+
display: 'block'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
'&.Mui-selected, &.Mui-selected.Mui-hovered': {
|
|
64
|
+
backgroundColor: blue[5]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
rowReorderCell: {
|
|
68
|
+
color: grey[700]
|
|
69
|
+
},
|
|
70
|
+
cell: ({
|
|
71
|
+
ownerState
|
|
72
|
+
}) => ({
|
|
73
|
+
minHeight: '40px !important',
|
|
74
|
+
paddingTop: 10,
|
|
75
|
+
paddingBottom: 10,
|
|
76
|
+
'&.MuiTypography-bold': {
|
|
77
|
+
fontWeight: 'bold'
|
|
78
|
+
},
|
|
79
|
+
'&.MuiTypography-greyed': {
|
|
80
|
+
color: grey[600]
|
|
81
|
+
},
|
|
82
|
+
'&:focus, &:focus-within': {
|
|
83
|
+
outline: ownerState?.editable ? `solid ${blue[500]} 1px` : 'none'
|
|
84
|
+
},
|
|
85
|
+
'&.MuiDataGrid-cell--editing': {
|
|
86
|
+
boxShadow: 'none',
|
|
87
|
+
'&:focus, &:focus-within': {
|
|
88
|
+
outline: `solid ${blue[500]} 1px`
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
cellCheckbox: {
|
|
93
|
+
'.Mui-checked': {
|
|
94
|
+
color: blue[500]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
overlayWrapperInner: {
|
|
98
|
+
...typography.bodySmRegular
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { grey } from "../../colors";
|
|
2
|
+
import borderRadius from "../borderRadius";
|
|
3
|
+
export const styles = {
|
|
4
|
+
styleOverrides: {
|
|
5
|
+
item: {
|
|
6
|
+
'.MuiGrid-box': {
|
|
7
|
+
// height: 'calc(100% - 32px)',
|
|
8
|
+
backgroundColor: grey[50],
|
|
9
|
+
border: `1px solid ${grey[300]}`,
|
|
10
|
+
padding: '16px !important',
|
|
11
|
+
borderRadius: `${borderRadius[2]}px`
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|