@dashadmin/dash-boilerplate 1.3.49 → 1.3.51
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/dist/index.cjs +56 -62
- package/dist/index.js +57 -63
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -602,23 +602,14 @@ var createMinimalTheme = (mode, extendedOptions) => {
|
|
|
602
602
|
const colors = getThemeColors(mode);
|
|
603
603
|
const fontSizeBase = getCssVariableNumber("--font-size-base", 14);
|
|
604
604
|
const borderRadiusBase = getCssVariableNumber("--border-radius-base", 6);
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
keys: ["xs", "sm", "md", "lg", "xl"],
|
|
609
|
-
values: { xs: 0, sm: 600, md: 900, lg: 1200, xl: 1536 }
|
|
610
|
-
},
|
|
605
|
+
const primaryMain = colors.btnBg || colors.primaryColor;
|
|
606
|
+
const primaryContrastText = colors.btnColor || colors.primaryContrast;
|
|
607
|
+
const custom = {
|
|
611
608
|
palette: {
|
|
612
609
|
mode,
|
|
613
610
|
primary: {
|
|
614
|
-
main:
|
|
615
|
-
|
|
616
|
-
// getContrastText(main) (picks black/white text by contrast ratio) when
|
|
617
|
-
// omitted. Trusting --primary-contrast here caused illegible button text
|
|
618
|
-
// whenever an app picked a --primary-contrast too close in tone to
|
|
619
|
-
// --primary-color (e.g. vanexa-system's near-identical blues, 2026-08-03) —
|
|
620
|
-
// --primary-contrast is also used standalone as a gradient stop elsewhere,
|
|
621
|
-
// so it was never guaranteed to double as a legible foreground color.
|
|
611
|
+
main: primaryMain,
|
|
612
|
+
contrastText: primaryContrastText
|
|
622
613
|
},
|
|
623
614
|
secondary: {
|
|
624
615
|
main: colors.secondaryColor
|
|
@@ -640,7 +631,7 @@ var createMinimalTheme = (mode, extendedOptions) => {
|
|
|
640
631
|
shape: {
|
|
641
632
|
borderRadius: borderRadiusBase
|
|
642
633
|
},
|
|
643
|
-
components: {
|
|
634
|
+
components: __spreadValues({
|
|
644
635
|
MuiButton: {
|
|
645
636
|
styleOverrides: {
|
|
646
637
|
root: {
|
|
@@ -660,12 +651,59 @@ var createMinimalTheme = (mode, extendedOptions) => {
|
|
|
660
651
|
MuiPaper: {
|
|
661
652
|
styleOverrides: {
|
|
662
653
|
root: {
|
|
663
|
-
|
|
654
|
+
color: "var(--text-color)",
|
|
655
|
+
backgroundColor: "var(--component-bg)",
|
|
656
|
+
"&.Mui-focused": {
|
|
657
|
+
color: "var(--primary-color)",
|
|
658
|
+
backgroundColor: "var(--component-bg)"
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
MuiOutlinedInput: {
|
|
664
|
+
styleOverrides: {
|
|
665
|
+
root: {
|
|
666
|
+
color: "var(--text-color)",
|
|
667
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
668
|
+
borderColor: "var(--border-color)"
|
|
669
|
+
},
|
|
670
|
+
"&:hover .MuiOutlinedInput-notchedOutline": {
|
|
671
|
+
borderColor: "var(--primary-color)"
|
|
672
|
+
},
|
|
673
|
+
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
|
674
|
+
borderColor: "var(--primary-color)"
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
MuiInputLabel: {
|
|
680
|
+
styleOverrides: {
|
|
681
|
+
root: {
|
|
682
|
+
color: "var(--text-color)",
|
|
683
|
+
"&.Mui-focused": {
|
|
684
|
+
color: "var(--primary-color)"
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
MuiSelect: {
|
|
690
|
+
styleOverrides: {
|
|
691
|
+
select: {
|
|
692
|
+
color: "var(--text-color)"
|
|
693
|
+
},
|
|
694
|
+
icon: {
|
|
695
|
+
color: "var(--text-color)"
|
|
664
696
|
}
|
|
665
697
|
}
|
|
666
698
|
}
|
|
667
|
-
}
|
|
668
|
-
}
|
|
699
|
+
}, (extendedOptions == null ? void 0 : extendedOptions.components) || {})
|
|
700
|
+
};
|
|
701
|
+
console.log("custom theme options:", custom);
|
|
702
|
+
const createdTheme = (0, import_material.createTheme)(__spreadValues(__spreadValues({}, custom), extendedOptions ? ((_a) => {
|
|
703
|
+
var _b = _a, { components } = _b, rest = __objRest(_b, ["components"]);
|
|
704
|
+
return rest;
|
|
705
|
+
})(extendedOptions) : {}));
|
|
706
|
+
return createdTheme;
|
|
669
707
|
};
|
|
670
708
|
var DashThemeContext = (0, import_react4.createContext)(null);
|
|
671
709
|
var useDashThemeContextLight = () => {
|
|
@@ -736,50 +774,6 @@ var DashThemeProviderLight = ({
|
|
|
736
774
|
window.addEventListener("DASHTRefreshTheme", handler);
|
|
737
775
|
return () => window.removeEventListener("DASHTRefreshTheme", handler);
|
|
738
776
|
}, []);
|
|
739
|
-
const currentModeRef = (0, import_react4.useRef)(currentMode);
|
|
740
|
-
currentModeRef.current = currentMode;
|
|
741
|
-
(0, import_react4.useEffect)(() => {
|
|
742
|
-
if (typeof document === "undefined" || typeof MutationObserver === "undefined") return;
|
|
743
|
-
let pending = false;
|
|
744
|
-
const rerun = () => {
|
|
745
|
-
if (pending) return;
|
|
746
|
-
pending = true;
|
|
747
|
-
queueMicrotask(() => {
|
|
748
|
-
pending = false;
|
|
749
|
-
(0, import_dash_utils.updateDomCssVariables)(currentModeRef.current);
|
|
750
|
-
refreshTheme();
|
|
751
|
-
});
|
|
752
|
-
};
|
|
753
|
-
const observer = new MutationObserver((mutations) => {
|
|
754
|
-
for (const mutation of mutations) {
|
|
755
|
-
for (const node of Array.from(mutation.addedNodes)) {
|
|
756
|
-
if (!(node instanceof HTMLElement)) continue;
|
|
757
|
-
if (node.id === "dash-theme-variables") continue;
|
|
758
|
-
if (node.tagName === "STYLE") {
|
|
759
|
-
rerun();
|
|
760
|
-
} else if (node.tagName === "LINK" && node.rel === "stylesheet") {
|
|
761
|
-
const link = node;
|
|
762
|
-
if (link.sheet) {
|
|
763
|
-
rerun();
|
|
764
|
-
} else {
|
|
765
|
-
link.addEventListener("load", rerun, { once: true });
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
});
|
|
771
|
-
observer.observe(document.head, { childList: true });
|
|
772
|
-
const onWindowLoad = () => rerun();
|
|
773
|
-
if (document.readyState === "complete") {
|
|
774
|
-
rerun();
|
|
775
|
-
} else {
|
|
776
|
-
window.addEventListener("load", onWindowLoad, { once: true });
|
|
777
|
-
}
|
|
778
|
-
return () => {
|
|
779
|
-
observer.disconnect();
|
|
780
|
-
window.removeEventListener("load", onWindowLoad);
|
|
781
|
-
};
|
|
782
|
-
}, []);
|
|
783
777
|
const contextValue = (0, import_react4.useMemo)(
|
|
784
778
|
() => ({
|
|
785
779
|
theme,
|
package/dist/index.js
CHANGED
|
@@ -484,7 +484,7 @@ import { DASH_REDUX_ACTIONS } from "dash-admin-state";
|
|
|
484
484
|
import { Avatar } from "@mui/material";
|
|
485
485
|
|
|
486
486
|
// src/theme/DashThemeProviderLight.tsx
|
|
487
|
-
import { createContext as createContext2, useContext as useContext2, useState as useState3, useEffect as useEffect2, useMemo as useMemo2
|
|
487
|
+
import { createContext as createContext2, useContext as useContext2, useState as useState3, useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
488
488
|
import CssBaseline from "@mui/material/CssBaseline";
|
|
489
489
|
import { createTheme, ThemeProvider } from "@mui/material";
|
|
490
490
|
import { updateDomCssVariables } from "dash-utils";
|
|
@@ -531,23 +531,14 @@ var createMinimalTheme = (mode, extendedOptions) => {
|
|
|
531
531
|
const colors = getThemeColors(mode);
|
|
532
532
|
const fontSizeBase = getCssVariableNumber("--font-size-base", 14);
|
|
533
533
|
const borderRadiusBase = getCssVariableNumber("--border-radius-base", 6);
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
keys: ["xs", "sm", "md", "lg", "xl"],
|
|
538
|
-
values: { xs: 0, sm: 600, md: 900, lg: 1200, xl: 1536 }
|
|
539
|
-
},
|
|
534
|
+
const primaryMain = colors.btnBg || colors.primaryColor;
|
|
535
|
+
const primaryContrastText = colors.btnColor || colors.primaryContrast;
|
|
536
|
+
const custom = {
|
|
540
537
|
palette: {
|
|
541
538
|
mode,
|
|
542
539
|
primary: {
|
|
543
|
-
main:
|
|
544
|
-
|
|
545
|
-
// getContrastText(main) (picks black/white text by contrast ratio) when
|
|
546
|
-
// omitted. Trusting --primary-contrast here caused illegible button text
|
|
547
|
-
// whenever an app picked a --primary-contrast too close in tone to
|
|
548
|
-
// --primary-color (e.g. vanexa-system's near-identical blues, 2026-08-03) —
|
|
549
|
-
// --primary-contrast is also used standalone as a gradient stop elsewhere,
|
|
550
|
-
// so it was never guaranteed to double as a legible foreground color.
|
|
540
|
+
main: primaryMain,
|
|
541
|
+
contrastText: primaryContrastText
|
|
551
542
|
},
|
|
552
543
|
secondary: {
|
|
553
544
|
main: colors.secondaryColor
|
|
@@ -569,7 +560,7 @@ var createMinimalTheme = (mode, extendedOptions) => {
|
|
|
569
560
|
shape: {
|
|
570
561
|
borderRadius: borderRadiusBase
|
|
571
562
|
},
|
|
572
|
-
components: {
|
|
563
|
+
components: __spreadValues({
|
|
573
564
|
MuiButton: {
|
|
574
565
|
styleOverrides: {
|
|
575
566
|
root: {
|
|
@@ -589,12 +580,59 @@ var createMinimalTheme = (mode, extendedOptions) => {
|
|
|
589
580
|
MuiPaper: {
|
|
590
581
|
styleOverrides: {
|
|
591
582
|
root: {
|
|
592
|
-
|
|
583
|
+
color: "var(--text-color)",
|
|
584
|
+
backgroundColor: "var(--component-bg)",
|
|
585
|
+
"&.Mui-focused": {
|
|
586
|
+
color: "var(--primary-color)",
|
|
587
|
+
backgroundColor: "var(--component-bg)"
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
MuiOutlinedInput: {
|
|
593
|
+
styleOverrides: {
|
|
594
|
+
root: {
|
|
595
|
+
color: "var(--text-color)",
|
|
596
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
597
|
+
borderColor: "var(--border-color)"
|
|
598
|
+
},
|
|
599
|
+
"&:hover .MuiOutlinedInput-notchedOutline": {
|
|
600
|
+
borderColor: "var(--primary-color)"
|
|
601
|
+
},
|
|
602
|
+
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
|
603
|
+
borderColor: "var(--primary-color)"
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
MuiInputLabel: {
|
|
609
|
+
styleOverrides: {
|
|
610
|
+
root: {
|
|
611
|
+
color: "var(--text-color)",
|
|
612
|
+
"&.Mui-focused": {
|
|
613
|
+
color: "var(--primary-color)"
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
MuiSelect: {
|
|
619
|
+
styleOverrides: {
|
|
620
|
+
select: {
|
|
621
|
+
color: "var(--text-color)"
|
|
622
|
+
},
|
|
623
|
+
icon: {
|
|
624
|
+
color: "var(--text-color)"
|
|
593
625
|
}
|
|
594
626
|
}
|
|
595
627
|
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
628
|
+
}, (extendedOptions == null ? void 0 : extendedOptions.components) || {})
|
|
629
|
+
};
|
|
630
|
+
console.log("custom theme options:", custom);
|
|
631
|
+
const createdTheme = createTheme(__spreadValues(__spreadValues({}, custom), extendedOptions ? ((_a) => {
|
|
632
|
+
var _b = _a, { components } = _b, rest = __objRest(_b, ["components"]);
|
|
633
|
+
return rest;
|
|
634
|
+
})(extendedOptions) : {}));
|
|
635
|
+
return createdTheme;
|
|
598
636
|
};
|
|
599
637
|
var DashThemeContext = createContext2(null);
|
|
600
638
|
var useDashThemeContextLight = () => {
|
|
@@ -665,50 +703,6 @@ var DashThemeProviderLight = ({
|
|
|
665
703
|
window.addEventListener("DASHTRefreshTheme", handler);
|
|
666
704
|
return () => window.removeEventListener("DASHTRefreshTheme", handler);
|
|
667
705
|
}, []);
|
|
668
|
-
const currentModeRef = useRef(currentMode);
|
|
669
|
-
currentModeRef.current = currentMode;
|
|
670
|
-
useEffect2(() => {
|
|
671
|
-
if (typeof document === "undefined" || typeof MutationObserver === "undefined") return;
|
|
672
|
-
let pending = false;
|
|
673
|
-
const rerun = () => {
|
|
674
|
-
if (pending) return;
|
|
675
|
-
pending = true;
|
|
676
|
-
queueMicrotask(() => {
|
|
677
|
-
pending = false;
|
|
678
|
-
updateDomCssVariables(currentModeRef.current);
|
|
679
|
-
refreshTheme();
|
|
680
|
-
});
|
|
681
|
-
};
|
|
682
|
-
const observer = new MutationObserver((mutations) => {
|
|
683
|
-
for (const mutation of mutations) {
|
|
684
|
-
for (const node of Array.from(mutation.addedNodes)) {
|
|
685
|
-
if (!(node instanceof HTMLElement)) continue;
|
|
686
|
-
if (node.id === "dash-theme-variables") continue;
|
|
687
|
-
if (node.tagName === "STYLE") {
|
|
688
|
-
rerun();
|
|
689
|
-
} else if (node.tagName === "LINK" && node.rel === "stylesheet") {
|
|
690
|
-
const link = node;
|
|
691
|
-
if (link.sheet) {
|
|
692
|
-
rerun();
|
|
693
|
-
} else {
|
|
694
|
-
link.addEventListener("load", rerun, { once: true });
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
});
|
|
700
|
-
observer.observe(document.head, { childList: true });
|
|
701
|
-
const onWindowLoad = () => rerun();
|
|
702
|
-
if (document.readyState === "complete") {
|
|
703
|
-
rerun();
|
|
704
|
-
} else {
|
|
705
|
-
window.addEventListener("load", onWindowLoad, { once: true });
|
|
706
|
-
}
|
|
707
|
-
return () => {
|
|
708
|
-
observer.disconnect();
|
|
709
|
-
window.removeEventListener("load", onWindowLoad);
|
|
710
|
-
};
|
|
711
|
-
}, []);
|
|
712
706
|
const contextValue = useMemo2(
|
|
713
707
|
() => ({
|
|
714
708
|
theme,
|