@dashadmin/dash-styles 0.0.0 → 1.3.16

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 (66) hide show
  1. package/package.json +20 -5
  2. package/.editorconfig +0 -12
  3. package/.eslintignore +0 -0
  4. package/.eslintrc.json +0 -7
  5. package/.prettierignore +0 -5
  6. package/.prettierrc.cjs +0 -3
  7. package/commitlint.config.cjs +0 -40
  8. package/dist/README.md +0 -1
  9. package/dist/index.d.ts +0 -3
  10. package/dist/package.json +0 -34
  11. package/src/assets/fonts/Montserrat-Black.ttf +0 -0
  12. package/src/assets/fonts/Montserrat-Bold.ttf +0 -0
  13. package/src/assets/fonts/Montserrat-Medium.ttf +0 -0
  14. package/src/assets/fonts/Montserrat-Regular.ttf +0 -0
  15. package/src/assets/fonts/Montserrat-SemiBold.ttf +0 -0
  16. package/src/dash-css-transformer.less +0 -766
  17. package/src/dash-variables.less +0 -10
  18. package/src/dash.less +0 -38
  19. package/src/helpers/getAllCssVariablesFromStyleSheets.tsx +0 -46
  20. package/src/index.tsx.suffixed +0 -680
  21. package/src/styles/button.less +0 -120
  22. package/src/styles/buttons.less +0 -10
  23. package/src/styles/card.less +0 -337
  24. package/src/styles/common.less +0 -62
  25. package/src/styles/components/notfound.less +0 -50
  26. package/src/styles/extra.less +0 -25
  27. package/src/styles/filters.less +0 -7
  28. package/src/styles/forms.less +0 -41
  29. package/src/styles/framed.less +0 -45
  30. package/src/styles/header.less +0 -879
  31. package/src/styles/input.copy.less +0 -223
  32. package/src/styles/input.less +0 -223
  33. package/src/styles/layout.less +0 -296
  34. package/src/styles/links.less +0 -28
  35. package/src/styles/loader.less +0 -20
  36. package/src/styles/login.less +0 -331
  37. package/src/styles/modal.less +0 -0
  38. package/src/styles/module.less +0 -29
  39. package/src/styles/mui-overrides.less +0 -62
  40. package/src/styles/notification.less +0 -46
  41. package/src/styles/pages/profile.less +0 -139
  42. package/src/styles/pagination.less +0 -90
  43. package/src/styles/popover.less +0 -21
  44. package/src/styles/react-admin/common.less +0 -184
  45. package/src/styles/react-admin/toolbar.less +0 -22
  46. package/src/styles/root.less +0 -13
  47. package/src/styles/sidebar.less +0 -705
  48. package/src/styles/splash.less +0 -44
  49. package/src/styles/static.less +0 -59
  50. package/src/styles/stats.less +0 -5
  51. package/src/styles/svg.less +0 -30
  52. package/src/styles/switch.less +0 -7
  53. package/src/styles/table.less +0 -196
  54. package/src/styles/tabs.less +0 -173
  55. package/src/styles/tags.less +0 -97
  56. package/src/styles/toast.less +0 -83
  57. package/src/styles/toolbar.less +0 -90
  58. package/src/styles/transition.less +0 -226
  59. package/src/styles/uploader.less +0 -38
  60. package/src/variables/breakpoints.less +0 -35
  61. package/src/variables/colors.less +0 -205
  62. package/src/variables/dash-colors.less +0 -52
  63. package/src/variables/sizes.less +0 -150
  64. package/tsconfig.eslint.json +0 -12
  65. package/tsconfig.json +0 -22
  66. package/vite.config.mts +0 -7
@@ -1,680 +0,0 @@
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
-