@dashadmin/dash-styles 1.3.17 → 1.3.19

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 (54) hide show
  1. package/dist/assets/fonts/Montserrat-Black.ttf +0 -0
  2. package/dist/assets/fonts/Montserrat-Bold.ttf +0 -0
  3. package/dist/assets/fonts/Montserrat-Medium.ttf +0 -0
  4. package/dist/assets/fonts/Montserrat-Regular.ttf +0 -0
  5. package/dist/assets/fonts/Montserrat-SemiBold.ttf +0 -0
  6. package/dist/dash-css-transformer.less +766 -0
  7. package/dist/dash-variables.less +10 -0
  8. package/dist/dash.less +38 -0
  9. package/dist/helpers/getAllCssVariablesFromStyleSheets.js +1 -0
  10. package/dist/index.tsx.suffixed +680 -0
  11. package/dist/styles/button.less +120 -0
  12. package/dist/styles/buttons.less +10 -0
  13. package/dist/styles/card.less +337 -0
  14. package/dist/styles/common.less +62 -0
  15. package/dist/styles/components/notfound.less +50 -0
  16. package/dist/styles/extra.less +25 -0
  17. package/dist/styles/filters.less +7 -0
  18. package/dist/styles/forms.less +41 -0
  19. package/dist/styles/framed.less +45 -0
  20. package/dist/styles/header.less +879 -0
  21. package/dist/styles/input.copy.less +223 -0
  22. package/dist/styles/input.less +223 -0
  23. package/dist/styles/layout.less +296 -0
  24. package/dist/styles/links.less +28 -0
  25. package/dist/styles/loader.less +20 -0
  26. package/dist/styles/login.less +331 -0
  27. package/dist/styles/modal.less +0 -0
  28. package/dist/styles/module.less +29 -0
  29. package/dist/styles/mui-overrides.less +62 -0
  30. package/dist/styles/notification.less +46 -0
  31. package/dist/styles/pages/profile.less +139 -0
  32. package/dist/styles/pagination.less +90 -0
  33. package/dist/styles/popover.less +21 -0
  34. package/dist/styles/react-admin/common.less +184 -0
  35. package/dist/styles/react-admin/toolbar.less +22 -0
  36. package/dist/styles/root.less +13 -0
  37. package/dist/styles/sidebar.less +705 -0
  38. package/dist/styles/splash.less +44 -0
  39. package/dist/styles/static.less +59 -0
  40. package/dist/styles/stats.less +5 -0
  41. package/dist/styles/svg.less +30 -0
  42. package/dist/styles/switch.less +7 -0
  43. package/dist/styles/table.less +196 -0
  44. package/dist/styles/tabs.less +173 -0
  45. package/dist/styles/tags.less +97 -0
  46. package/dist/styles/toast.less +83 -0
  47. package/dist/styles/toolbar.less +90 -0
  48. package/dist/styles/transition.less +226 -0
  49. package/dist/styles/uploader.less +38 -0
  50. package/dist/variables/breakpoints.less +35 -0
  51. package/dist/variables/colors.less +205 -0
  52. package/dist/variables/dash-colors.less +52 -0
  53. package/dist/variables/sizes.less +150 -0
  54. package/package.json +14 -3
@@ -0,0 +1,680 @@
1
+ import { defaultTheme } from 'react-admin';
2
+ import { deepmerge } from '@mui/utils';
3
+
4
+ const getAllCssVariablesFromStyleSheets = (selector: string) => {
5
+ const cssVariables = {};
6
+
7
+ for (let i = 0; i < document.styleSheets.length; i++) {
8
+ try {
9
+ const styleSheet = document.styleSheets[i];
10
+ if (!styleSheet.cssRules) continue;
11
+
12
+ for (let j = 0; j < styleSheet.cssRules.length; j++) {
13
+ const rule = styleSheet.cssRules[j];
14
+
15
+ /* @ts-ignore */
16
+ if (rule.selectorText === selector) {
17
+ /* @ts-ignore */
18
+ const style = rule.style;
19
+
20
+ for (let k = 0; k < style.length; k++) {
21
+ const prop = style[k];
22
+ if (prop.startsWith('--')) {
23
+ cssVariables[prop] = style.getPropertyValue(prop).trim();
24
+ }
25
+ }
26
+ }
27
+ }
28
+ } catch (e) {
29
+ console.warn('Could not access stylesheet:', e);
30
+ }
31
+ }
32
+
33
+ return cssVariables;
34
+ };
35
+
36
+ export const defaultOptions = (options) => {
37
+ const { tenantSettings, colors, ...otherOptions } = options || {};
38
+ const currentTheme = document.documentElement.getAttribute('data-theme') || 'light';
39
+ const cssVars = getAllCssVariablesFromStyleSheets(":root");
40
+
41
+ const _color = (key, colorKey, mode = null) => {
42
+ if (colors) {
43
+ const colorValue = colors[`${colorKey}--${mode || currentTheme}`];
44
+ return colorValue ? { [key]: colorValue } : {};
45
+ } else if (cssVars[`--${colorKey}--${mode || currentTheme}`]) {
46
+ const cssVarValue = cssVars[`--${colorKey}--${mode || currentTheme}`];
47
+ return cssVarValue ? { [key]: cssVarValue } : {};
48
+ } else {
49
+ return {};
50
+ }
51
+ };
52
+
53
+ const createPalette = (mode = 'light') => {
54
+ const palette = {
55
+ mode,
56
+ background: {
57
+ ..._color('default', 'module-bg', mode),
58
+ ..._color('paper', 'module-bg', mode)
59
+ },
60
+ primary: {
61
+ ..._color('main', 'primary-color', mode),
62
+ ..._color('contrastText', 'primary-contrast', mode)
63
+ },
64
+ secondary: {
65
+ ..._color('main', 'secondary-color', mode)
66
+ },
67
+ text: {
68
+ ..._color('primary', 'text-color', mode),
69
+ ..._color('secondary', 'text-light', mode),
70
+ ..._color('disabled', 'disabled-color', mode)
71
+ },
72
+ action: {
73
+ ..._color('active', 'component-active-bg', mode),
74
+ ..._color('hover', 'component-hover-bg', mode),
75
+ ..._color('disabled', 'disabled-color', mode),
76
+ ..._color('disabledBackground', 'disabled-bg', mode)
77
+ },
78
+ //..._color('divider', 'component-border-split', mode),
79
+ ..._color('border', 'border-color', mode),
80
+ error: {
81
+ ..._color('main', 'alert-error-bg', mode),
82
+ ..._color('contrastText', 'alert-error-title', mode)
83
+ },
84
+ warning: {
85
+ ..._color('main', 'alert-warning-bg', mode),
86
+ ..._color('contrastText', 'alert-warning-title', mode)
87
+ },
88
+ info: {
89
+ ..._color('main', 'alert-info-bg', mode),
90
+ ..._color('contrastText', 'alert-info-title', mode)
91
+ },
92
+ success: {
93
+ ..._color('main', 'alert-success-bg', mode),
94
+ ..._color('contrastText', 'alert-success-title', mode)
95
+ },
96
+ common: {
97
+ ..._color('black', 'text-color', mode),
98
+ ..._color('white', 'text-contrast', mode)
99
+ },
100
+ /* variant: {
101
+ ..._color('containedBg', 'btn-bg', mode),
102
+
103
+ }*/
104
+ };
105
+
106
+ // Filter out empty objects and undefined values
107
+ return Object.fromEntries(
108
+ Object.entries(palette).filter(([_, value]) => {
109
+ if (typeof value === 'object' && value !== null) {
110
+ return Object.keys(value).length > 0;
111
+ }
112
+ return value !== undefined;
113
+ })
114
+ );
115
+ };
116
+
117
+ return {
118
+ cssVariables: {
119
+ cssVarPrefix: 'dash', // Your custom prefix
120
+ colorSchemeSelector: 'data-theme', // Tell MUI to use data attributes
121
+ },
122
+ // Enable both light and dark color schemes
123
+ /*colorSchemes: {
124
+ light: true,
125
+ dark: true,
126
+ },*/
127
+
128
+ colorSchemes: {
129
+ light: {
130
+ palette: createPalette('light')
131
+ },
132
+ dark: {
133
+ palette: createPalette('dark')
134
+ },
135
+ /*system: {
136
+ palette: createPalette('dark')
137
+ },*/
138
+ },
139
+
140
+ defaultColorScheme: currentTheme,
141
+
142
+
143
+ palette: createPalette(currentTheme),
144
+
145
+
146
+ // Don't put your custom CSS variables in the palette
147
+ // Instead, use them directly in component overrides
148
+ typography: {
149
+ allVariants: {
150
+ //color: 'var(--text-color)', // Keep using your CSS variables here
151
+ },
152
+ },
153
+ components: {
154
+ // Override ALL color usage in component overrides
155
+ MuiCssBaseline: {
156
+ styleOverrides: {
157
+ body: {
158
+ backgroundColor: `var(--bodybg-primary${currentTheme === 'dark' ? '--dark' : '--light'})`,
159
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
160
+ },
161
+ },
162
+ },
163
+
164
+
165
+ /* MuiIconButton: {
166
+ styleOverrides: {
167
+ root: {
168
+ backgroundColor: 'var(--btn-bg)',
169
+ color: 'var(--btn-color)',
170
+
171
+ '&.MuiIconButton-containedPrimary': {
172
+ backgroundColor: 'var(--primary-color)',
173
+ color: 'var(--btn-color)',
174
+ '&:hover': {
175
+ backgroundColor: 'var(--highlight-color)',
176
+ },
177
+ },
178
+ '&.MuiIconButton-containedSecondary': {
179
+ backgroundColor: 'var(--secondary-color)',
180
+ color: 'var(--btn-color)',
181
+ '&:hover': {
182
+ backgroundColor: 'var(--highlight-color)',
183
+ },
184
+ },
185
+ '&.MuiIconButton-outlinedPrimary': {
186
+ backgroundColor: 'inherit',
187
+ borderColor: 'var(--primary-color)',
188
+ color: 'var(--text-color)',
189
+ '&:hover': {
190
+ borderColor: 'var(--highlight-color)',
191
+ },
192
+ },
193
+ '&.MuiIconButton-outlinedSecondary': {
194
+ backgroundColor: 'inherit',
195
+ borderColor: 'var(--primary-color)',
196
+ color: 'var(--text-color)',
197
+ '&:hover': {
198
+ borderColor: 'var(--highlight-color)',
199
+ },
200
+ },
201
+ },
202
+ },
203
+ },*/
204
+ MuiButton: {
205
+ styleOverrides: {
206
+ root: {
207
+ backgroundColor: `var(--btn-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
208
+ color: `var(--btn-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
209
+
210
+ '&.MuiButton-containedPrimary': {
211
+ backgroundColor: `var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
212
+ color: `var(--btn-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
213
+ '&:hover': {
214
+ backgroundColor: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
215
+ },
216
+ },
217
+ '&.MuiButton-containedSecondary': {
218
+ backgroundColor: `var(--secondary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
219
+ color: `var(--btn-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
220
+ '&:hover': {
221
+ backgroundColor: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
222
+ },
223
+ },
224
+ '&.MuiButton-outlinedPrimary': {
225
+ backgroundColor: 'inherit',
226
+ borderColor: `var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
227
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
228
+ '&:hover': {
229
+ borderColor: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
230
+ },
231
+ },
232
+ '&.MuiButton-outlinedSecondary': {
233
+ backgroundColor: 'inherit',
234
+ borderColor: `var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
235
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
236
+ '&:hover': {
237
+ borderColor: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
238
+ },
239
+ },
240
+ '&.MuiButton-textPrimary': {
241
+ color: `var(--link-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
242
+ background: 'none',
243
+ '&:hover': {
244
+ color: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
245
+ textDecoration: 'underline',
246
+ background: 'none',
247
+ },
248
+ },
249
+ '&.MuiButton-textSecondary': {
250
+ color: `var(--text-light-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
251
+ background: 'none',
252
+ '&:hover': {
253
+ color: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
254
+ textDecoration: 'underline',
255
+ background: 'none',
256
+ },
257
+ },
258
+ },
259
+ },
260
+ },
261
+ MuiDialog: {
262
+ styleOverrides: {
263
+ root: {
264
+ zIndex: 100
265
+ }
266
+ }
267
+ },
268
+ MuiTooltip: {
269
+ styleOverrides: {
270
+ tooltip: {
271
+ backgroundColor: `var(--module-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
272
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
273
+ border: `1px solid var(--border-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
274
+ fontSize: '0.75rem',
275
+ maxWidth: 300,
276
+ '& .MuiTooltip-arrow': {
277
+ color: `var(--module-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
278
+ '&::before': {
279
+ border: `1px solid var(--border-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
280
+ },
281
+ },
282
+ },
283
+ popper: {
284
+ '&[data-popper-placement*="bottom"] .MuiTooltip-tooltip': {
285
+ marginTop: '8px',
286
+ },
287
+ '&[data-popper-placement*="top"] .MuiTooltip-tooltip': {
288
+ marginBottom: '8px',
289
+ },
290
+ '&[data-popper-placement*="right"] .MuiTooltip-tooltip': {
291
+ marginLeft: '8px',
292
+ },
293
+ '&[data-popper-placement*="left"] .MuiTooltip-tooltip': {
294
+ marginRight: '8px',
295
+ },
296
+ },
297
+ },
298
+ },
299
+ MuiTabs: {
300
+ styleOverrides: {
301
+ indicator: {
302
+ backgroundColor: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
303
+ },
304
+ },
305
+ },
306
+
307
+ RaReferenceField: {
308
+ styleOverrides: {
309
+ root: {
310
+ '& .RaReferenceField-link>*': {
311
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
312
+ },
313
+ },
314
+ },
315
+ },
316
+ RaSingleFieldList: {
317
+ styleOverrides: {
318
+ root: {
319
+ '& .RaSingleFieldList-link>*': {
320
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
321
+ },
322
+ },
323
+ },
324
+ },
325
+ MuiInputAdornment: {
326
+ styleOverrides: {
327
+ root: {
328
+ '& svg': {
329
+ color: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
330
+ },
331
+ },
332
+ },
333
+ },
334
+ MuiTab: {
335
+ styleOverrides: {
336
+ root: {
337
+ '&.MuiButtonBase-root': {
338
+ '&.Mui-selected': {
339
+ color: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
340
+ backgroundColor: `var(--tab-selected-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
341
+ },
342
+ '&.MuiTab-textColorPrimary': {
343
+ color: `var(--table-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
344
+ },
345
+ },
346
+ },
347
+ },
348
+ },
349
+ MuiAlert: {
350
+ styleOverrides: {
351
+ root: {
352
+ '&.MuiAlert-standardInfo': {
353
+ backgroundColor: `var(--module-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
354
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
355
+ '& .MuiAlert-icon': {
356
+ color: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
357
+ },
358
+ '& .MuiAlertTitle-root': {
359
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
360
+ },
361
+ },
362
+ '&.MuiAlert-standardError': {
363
+ backgroundColor: `var(--dash-alert-error-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
364
+ color: `var(--dash-alert-error-title${currentTheme === 'dark' ? '--dark' : '--light'})`,
365
+ },
366
+ '&.MuiAlert-standardWarning': {
367
+ backgroundColor: `var(--dash-alert-warning-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
368
+ color: `var(--dash-alert-warning-title${currentTheme === 'dark' ? '--dark' : '--light'})`,
369
+ },
370
+ '&.MuiAlert-standardSuccess': {
371
+ backgroundColor: `var(--dash-alert-success-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
372
+ color: `var(--dash-alert-success-title${currentTheme === 'dark' ? '--dark' : '--light'})`,
373
+ },
374
+ },
375
+ },
376
+ },
377
+ MuiAccordion: {
378
+ styleOverrides: {
379
+ root: {
380
+ backgroundColor: `var(--module-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
381
+ '&.MuiPaper-root': {
382
+ backgroundColor: `var(--module-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
383
+ },
384
+ },
385
+ },
386
+ },
387
+ MuiAccordionSummary: {
388
+ styleOverrides: {
389
+ expandIconWrapper: {
390
+ color: 'inherit',
391
+ '& .MuiSvgIcon-root': {
392
+ color: 'inherit',
393
+ },
394
+ },
395
+ },
396
+ },
397
+ MuiBox: {
398
+ styleOverrides: {
399
+ root: {
400
+ display: 'flex !important',
401
+ },
402
+ },
403
+ },
404
+ /* MuiCard: {
405
+ styleOverrides: {
406
+ root: {
407
+ backgroundColor: `var(--module-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
408
+ },
409
+ },
410
+ },
411
+ MuiPaper: {
412
+ styleOverrides: {
413
+ root: {
414
+ marginBottom: 8,
415
+ backgroundColor: `var(--module-bg${currentTheme === 'dark' ? '--dark' : '--light'})`, // Use the correct variable name
416
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
417
+ },
418
+ },
419
+ },
420
+ */
421
+ MuiAppBar: {
422
+ styleOverrides: {
423
+ root: {
424
+ backgroundColor: `var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
425
+ color: `var(--text-contrast-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
426
+ },
427
+ },
428
+ },
429
+ /*MuiChip: {
430
+ styleOverrides: {
431
+ root: {
432
+ '&.MuiChip-colorPrimary': {
433
+ backgroundColor: `var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
434
+ color: `var(--text-light-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
435
+ },
436
+ '&.MuiChip-colorSecondary': {
437
+ backgroundColor: `var(--secondary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
438
+ color: `var(--text-light-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
439
+ },
440
+ },
441
+ },
442
+ },*/
443
+ MuiTextField: {
444
+ styleOverrides: {
445
+ root: {
446
+ '& .MuiOutlinedInput-root': {
447
+ '& fieldset': {
448
+ borderColor: `var(--border-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
449
+ },
450
+ '&:hover fieldset': {
451
+ borderColor: `var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
452
+ },
453
+ '&.Mui-focused fieldset': {
454
+ borderColor: `var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
455
+ },
456
+ },
457
+ '& .MuiInputLabel-root': {
458
+ color: `var(--text-light-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
459
+ '&.Mui-focused': {
460
+ color: `var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
461
+ },
462
+ },
463
+ '& .MuiInputBase-input': {
464
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
465
+ },
466
+ },
467
+ },
468
+ },
469
+ // Add more component overrides as needed for other elements that use primary/secondary colors
470
+ MuiIconButton: {
471
+ styleOverrides: {
472
+ root: {
473
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
474
+ '&:hover': {
475
+ backgroundColor: `var(--component-hover-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
476
+ },
477
+ },
478
+ },
479
+ },
480
+ MuiTable: {
481
+ styleOverrides: {
482
+ root: {
483
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
484
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
485
+ },
486
+ },
487
+ },
488
+
489
+ MuiTableHead: {
490
+ styleOverrides: {
491
+ root: {
492
+ backgroundColor: `var(--table-header-bg${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
493
+ color: `var(--table-header-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
494
+ },
495
+ },
496
+ },
497
+ MuiTableRow: {
498
+ styleOverrides: {
499
+ root: {
500
+ '&:hover': {
501
+ backgroundColor: `var(--component-hover-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
502
+ },
503
+ '&.MuiTableRow-head': {
504
+ backgroundColor: `var(--table-header-bg${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
505
+ color: `var(--table-header-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
506
+ },
507
+ },
508
+ },
509
+ },
510
+ MuiTableCell: {
511
+ styleOverrides: {
512
+ root: {
513
+ textWrapMode: 'nowrap',
514
+ borderColor: `var(--border-color-split${currentTheme === 'dark' ? '--dark' : '--light'})`,
515
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
516
+ //borderBottom: `1px solid var(--border-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
517
+ '& .MuiTableSortLabel-root, & .MuiTableSortLabel-icon': {
518
+ color: `var(--table-header-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
519
+ },
520
+ },
521
+ head: {
522
+ fontWeight: 600,
523
+ color: `var(--table-header-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
524
+ backgroundColor: `var(--table-header-bg${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
525
+ },
526
+ },
527
+ },
528
+ MuiDataGrid: {
529
+ styleOverrides: {
530
+ root: {
531
+
532
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
533
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
534
+ border: `1px solid var(--dash-border-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
535
+ '& .MuiDataGrid-main': {
536
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
537
+ },
538
+ '& .MuiDataGrid-overlay': {
539
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
540
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
541
+ },
542
+ // Add this to target the header row specifically
543
+ '& .MuiDataGrid-columnHeaderRow': {
544
+ color: `var(--table-header-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
545
+ backgroundColor: `var(--table-header-bg${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
546
+ },
547
+ // Also target the container that holds the header
548
+ '& .MuiDataGrid-container--top [role=row]': {
549
+ color: `var(--table-header-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
550
+ backgroundColor: `var(--table-header-bg${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
551
+ },
552
+ },
553
+ columnHeader: {
554
+ color: `var(--table-header-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
555
+ backgroundColor: `var(--table-header-bg${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
556
+ '& .MuiSvgIcon-root': {
557
+ color: `var(--highlight-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
558
+
559
+ },
560
+
561
+ },
562
+ columnHeaders: {
563
+ backgroundColor: `var(--primary-contrast${currentTheme === 'dark' ? '--dark' : '--light'})`,
564
+ color: `var(--btn-primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
565
+ borderBottom: `1px solid var(--border-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
566
+ '& .MuiDataGrid-columnHeaderTitle': {
567
+ color: `var(--btn-primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
568
+ fontWeight: 600,
569
+ },
570
+ '& .MuiDataGrid-iconSeparator': {
571
+ color: `var(--btn-primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
572
+ },
573
+ '& .MuiDataGrid-sortIcon': {
574
+ color: `var(--btn-primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
575
+ },
576
+ '& .MuiDataGrid-menuIcon': {
577
+ color: `var(--btn-primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
578
+ },
579
+ },
580
+ // Add this new selector for the column header row
581
+ columnHeaderRow: {
582
+ color: `var(--table-header-color${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
583
+ backgroundColor: `var(--table-header-bg${currentTheme === 'dark' ? '--dark' : '--light'}) !important`,
584
+ },
585
+ cell: {
586
+ borderBottom: `1px solid var(--border-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
587
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
588
+ '&:focus': {
589
+ outline: `1px solid var(--primary-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
590
+ },
591
+ '&.MuiDataGrid-cell--editing': {
592
+ backgroundColor: `var(--component-active-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
593
+ },
594
+ },
595
+ row: {
596
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
597
+ '&:hover': {
598
+ backgroundColor: `var(--component-hover-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
599
+ },
600
+ '&.Mui-selected': {
601
+ backgroundColor: `var(--component-active-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
602
+ '&:hover': {
603
+ backgroundColor: `var(--component-hover-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
604
+ },
605
+ },
606
+ '&.MuiDataGrid-row--odd': {
607
+ backgroundColor: `var(--bodybg-primary${currentTheme === 'dark' ? '--dark' : '--light'})`,
608
+ },
609
+ },
610
+ footerContainer: {
611
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
612
+ borderTop: `1px solid var(--border-color-split${currentTheme === 'dark' ? '--dark' : '--light'})`,
613
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
614
+ },
615
+ toolbarContainer: {
616
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
617
+ borderBottom: `1px solid var(--border-color-split${currentTheme === 'dark' ? '--dark' : '--light'})`,
618
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
619
+ '& .MuiButton-root': {
620
+ color: `var(--btn-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
621
+ '&:hover': {
622
+ backgroundColor: `var(--btn-hover-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
623
+ },
624
+ },
625
+ },
626
+ filterForm: {
627
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
628
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
629
+ },
630
+ panel: {
631
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
632
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
633
+ border: `1px solid var(--dash-border-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
634
+ },
635
+ panelHeader: {
636
+ backgroundColor: `var(--primary-contrast${currentTheme === 'dark' ? '--dark' : '--light'})`,
637
+ borderBottom: `1px solid var(--border-color-split${currentTheme === 'dark' ? '--dark' : '--light'})`,
638
+ },
639
+ panelContent: {
640
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
641
+ },
642
+ columnMenu: {
643
+ backgroundColor: `var(--component-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
644
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
645
+ '& .MuiMenuItem-root': {
646
+ color: `var(--text-color${currentTheme === 'dark' ? '--dark' : '--light'})`,
647
+ '&:hover': {
648
+ backgroundColor: `var(--component-hover-bg${currentTheme === 'dark' ? '--dark' : '--light'})`,
649
+ },
650
+ },
651
+ },
652
+ },
653
+ },
654
+
655
+ }
656
+ };
657
+
658
+ }
659
+
660
+ export const appTheme = (muiThemeOptions?: any, options?: {
661
+ tenantSettings?: any;
662
+ colors?: any;
663
+ [key: string]: any;
664
+ }) => {
665
+ const { tenantSettings, colors, ...otherOptions } = options || {};
666
+
667
+ const baseTheme = {
668
+ cssVariables: true,
669
+ ...defaultOptions(options),
670
+ };
671
+
672
+ const theme = muiThemeOptions
673
+ ? deepmerge(deepmerge(defaultTheme, baseTheme), muiThemeOptions)
674
+ : deepmerge(defaultTheme, baseTheme);
675
+
676
+ return theme;
677
+ };
678
+
679
+ export default appTheme;
680
+