@dashadmin/dash-styles 1.3.25 → 1.3.26
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 +979 -0
- package/dist/index.d.cts +1181 -0
- package/dist/index.d.ts +1181 -0
- package/dist/index.js +193 -166
- package/package.json +42 -41
- package/{dist → src}/dash-css-transformer.less +5 -2
- package/src/helpers/getAllCssVariablesFromStyleSheets.tsx +46 -0
- package/src/index.tsx +1052 -0
- package/{dist → src}/styles/header.less +3 -0
- package/{dist → src}/styles/tabs.less +7 -0
- package/{dist → src}/variables/breakpoints.less +1 -1
- package/dist/helpers/getAllCssVariablesFromStyleSheets.js +0 -1
- /package/{dist → src}/assets/fonts/Montserrat-Black.ttf +0 -0
- /package/{dist → src}/assets/fonts/Montserrat-Bold.ttf +0 -0
- /package/{dist → src}/assets/fonts/Montserrat-Medium.ttf +0 -0
- /package/{dist → src}/assets/fonts/Montserrat-Regular.ttf +0 -0
- /package/{dist → src}/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- /package/{dist → src}/dash-variables.less +0 -0
- /package/{dist → src}/dash.less +0 -0
- /package/{dist → src}/index.tsx.suffixed +0 -0
- /package/{dist → src}/styles/button.less +0 -0
- /package/{dist → src}/styles/buttons.less +0 -0
- /package/{dist → src}/styles/card.less +0 -0
- /package/{dist → src}/styles/common.less +0 -0
- /package/{dist → src}/styles/components/notfound.less +0 -0
- /package/{dist → src}/styles/extra.less +0 -0
- /package/{dist → src}/styles/filters.less +0 -0
- /package/{dist → src}/styles/forms.less +0 -0
- /package/{dist → src}/styles/framed.less +0 -0
- /package/{dist → src}/styles/input.copy.less +0 -0
- /package/{dist → src}/styles/input.less +0 -0
- /package/{dist → src}/styles/layout.less +0 -0
- /package/{dist → src}/styles/links.less +0 -0
- /package/{dist → src}/styles/loader.less +0 -0
- /package/{dist → src}/styles/login.less +0 -0
- /package/{dist → src}/styles/modal.less +0 -0
- /package/{dist → src}/styles/module.less +0 -0
- /package/{dist → src}/styles/mui-overrides.less +0 -0
- /package/{dist → src}/styles/notification.less +0 -0
- /package/{dist → src}/styles/pages/profile.less +0 -0
- /package/{dist → src}/styles/pagination.less +0 -0
- /package/{dist → src}/styles/popover.less +0 -0
- /package/{dist → src}/styles/react-admin/common.less +0 -0
- /package/{dist → src}/styles/react-admin/toolbar.less +0 -0
- /package/{dist → src}/styles/root.less +0 -0
- /package/{dist → src}/styles/sidebar.less +0 -0
- /package/{dist → src}/styles/splash.less +0 -0
- /package/{dist → src}/styles/static.less +0 -0
- /package/{dist → src}/styles/stats.less +0 -0
- /package/{dist → src}/styles/svg.less +0 -0
- /package/{dist → src}/styles/switch.less +0 -0
- /package/{dist → src}/styles/table.less +0 -0
- /package/{dist → src}/styles/tags.less +0 -0
- /package/{dist → src}/styles/toast.less +0 -0
- /package/{dist → src}/styles/toolbar.less +0 -0
- /package/{dist → src}/styles/transition.less +0 -0
- /package/{dist → src}/styles/uploader.less +0 -0
- /package/{dist → src}/variables/colors.less +0 -0
- /package/{dist → src}/variables/dash-colors.less +0 -0
- /package/{dist → src}/variables/sizes.less +0 -0
package/dist/index.js
CHANGED
|
@@ -1,91 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/index.tsx
|
|
34
|
+
import { defaultTheme } from "react-admin";
|
|
35
|
+
import { deepmerge } from "@mui/utils";
|
|
36
|
+
import { theme as antdTheme } from "antd";
|
|
37
|
+
var getAllCssVariablesFromStyleSheets = (selector) => {
|
|
38
|
+
var _a;
|
|
39
|
+
const cssVariables = {};
|
|
40
|
+
for (let i = 0; i < document.styleSheets.length; i++) {
|
|
7
41
|
try {
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
42
|
+
const styleSheet = document.styleSheets[i];
|
|
43
|
+
if (((_a = styleSheet.ownerNode) == null ? void 0 : _a.id) === "dash-theme-variables") continue;
|
|
44
|
+
if (!styleSheet.cssRules) continue;
|
|
45
|
+
for (let j = 0; j < styleSheet.cssRules.length; j++) {
|
|
46
|
+
const rule = styleSheet.cssRules[j];
|
|
47
|
+
if (rule.selectorText === selector) {
|
|
48
|
+
const style = rule.style;
|
|
49
|
+
for (let k = 0; k < style.length; k++) {
|
|
50
|
+
const prop = style[k];
|
|
51
|
+
if (prop.startsWith("--")) {
|
|
52
|
+
cssVariables[prop] = style.getPropertyValue(prop).trim();
|
|
53
|
+
}
|
|
17
54
|
}
|
|
18
55
|
}
|
|
19
56
|
}
|
|
20
57
|
} catch (e) {
|
|
21
58
|
console.warn("Could not access stylesheet:", e);
|
|
22
59
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
60
|
+
}
|
|
61
|
+
return cssVariables;
|
|
62
|
+
};
|
|
63
|
+
var defaultOptions = (options) => {
|
|
64
|
+
const _a = options || {}, { tenantSettings, colors } = _a, otherOptions = __objRest(_a, ["tenantSettings", "colors"]);
|
|
65
|
+
const currentTheme = document.documentElement.getAttribute("data-theme") || "dark";
|
|
66
|
+
const cssVars = getAllCssVariablesFromStyleSheets(":root");
|
|
67
|
+
const _color = (key, colorKey, mode = null) => {
|
|
68
|
+
if (colors) {
|
|
69
|
+
const colorValue = colors[`${colorKey}--${mode || currentTheme}`];
|
|
70
|
+
return colorValue ? { [key]: colorValue } : {};
|
|
71
|
+
} else if (cssVars[`--${colorKey}--${mode || currentTheme}`]) {
|
|
72
|
+
const cssVarValue = cssVars[`--${colorKey}--${mode || currentTheme}`];
|
|
73
|
+
return cssVarValue ? { [key]: cssVarValue } : {};
|
|
74
|
+
} else {
|
|
33
75
|
return {};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
...r("secondary", "text-light", t),
|
|
53
|
-
...r("disabled", "disabled-color", t)
|
|
54
|
-
},
|
|
55
|
-
action: {
|
|
56
|
-
...r("active", "component-active-bg", t),
|
|
57
|
-
...r("hover", "component-hover-bg", t),
|
|
58
|
-
...r("disabled", "disabled-color", t),
|
|
59
|
-
...r("disabledBackground", "disabled-bg", t)
|
|
60
|
-
},
|
|
61
|
-
//..._color('divider', 'component-border-split', mode),
|
|
62
|
-
...r("border", "border-color", t),
|
|
63
|
-
error: {
|
|
64
|
-
...r("main", "alert-error-bg", t),
|
|
65
|
-
...r("contrastText", "alert-error-title", t)
|
|
66
|
-
},
|
|
67
|
-
warning: {
|
|
68
|
-
...r("main", "alert-warning-bg", t),
|
|
69
|
-
...r("contrastText", "alert-warning-title", t)
|
|
70
|
-
},
|
|
71
|
-
info: {
|
|
72
|
-
...r("main", "alert-info-bg", t),
|
|
73
|
-
...r("contrastText", "alert-info-title", t)
|
|
74
|
-
},
|
|
75
|
-
success: {
|
|
76
|
-
...r("main", "alert-success-bg", t),
|
|
77
|
-
...r("contrastText", "alert-success-title", t)
|
|
78
|
-
},
|
|
79
|
-
common: {
|
|
80
|
-
...r("black", "text-color", t),
|
|
81
|
-
...r("white", "text-contrast", t)
|
|
82
|
-
},
|
|
83
|
-
variant: {
|
|
84
|
-
...r("containedBg", "btn-bg", t)
|
|
85
|
-
}
|
|
86
|
-
};
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const createPalette = (mode = "light") => {
|
|
79
|
+
const palette = __spreadProps(__spreadValues({
|
|
80
|
+
mode,
|
|
81
|
+
background: __spreadValues(__spreadValues({}, _color("default", "module-bg", mode)), _color("paper", "module-bg", mode)),
|
|
82
|
+
primary: __spreadValues(__spreadValues({}, _color("main", "btn-bg", mode)), _color("contrastText", "primary-contrast", mode)),
|
|
83
|
+
secondary: __spreadValues({}, _color("main", "secondary-color", mode)),
|
|
84
|
+
text: __spreadValues(__spreadValues(__spreadValues({}, _color("primary", "text-color", mode)), _color("secondary", "text-light", mode)), _color("disabled", "disabled-color", mode)),
|
|
85
|
+
action: __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, _color("active", "component-active-bg", mode)), _color("hover", "component-hover-bg", mode)), _color("disabled", "disabled-color", mode)), _color("disabledBackground", "disabled-bg", mode))
|
|
86
|
+
}, _color("border", "border-color", mode)), {
|
|
87
|
+
error: __spreadValues(__spreadValues({}, _color("main", "alert-error-bg", mode)), _color("contrastText", "alert-error-title", mode)),
|
|
88
|
+
warning: __spreadValues(__spreadValues({}, _color("main", "alert-warning-bg", mode)), _color("contrastText", "alert-warning-title", mode)),
|
|
89
|
+
info: __spreadValues(__spreadValues({}, _color("main", "alert-info-bg", mode)), _color("contrastText", "alert-info-title", mode)),
|
|
90
|
+
success: __spreadValues(__spreadValues({}, _color("main", "alert-success-bg", mode)), _color("contrastText", "alert-success-title", mode)),
|
|
91
|
+
common: __spreadValues(__spreadValues({}, _color("black", "text-color", mode)), _color("white", "text-contrast", mode)),
|
|
92
|
+
variant: __spreadValues({}, _color("containedBg", "btn-bg", mode))
|
|
93
|
+
});
|
|
87
94
|
return Object.fromEntries(
|
|
88
|
-
Object.entries(
|
|
95
|
+
Object.entries(palette).filter(([_, value]) => {
|
|
96
|
+
if (typeof value === "object" && value !== null) {
|
|
97
|
+
return Object.keys(value).length > 0;
|
|
98
|
+
}
|
|
99
|
+
return value !== void 0;
|
|
100
|
+
})
|
|
89
101
|
);
|
|
90
102
|
};
|
|
91
103
|
return {
|
|
@@ -100,14 +112,14 @@ const h = (n) => {
|
|
|
100
112
|
// Enable both light and dark color schemes - NO 'system' to force light/dark only
|
|
101
113
|
colorSchemes: {
|
|
102
114
|
light: {
|
|
103
|
-
palette:
|
|
115
|
+
palette: createPalette("light")
|
|
104
116
|
},
|
|
105
117
|
dark: {
|
|
106
|
-
palette:
|
|
118
|
+
palette: createPalette("dark")
|
|
107
119
|
}
|
|
108
120
|
},
|
|
109
|
-
defaultColorScheme:
|
|
110
|
-
palette:
|
|
121
|
+
defaultColorScheme: currentTheme || "dark",
|
|
122
|
+
palette: createPalette(currentTheme),
|
|
111
123
|
// Don't put your custom CSS variables in the palette
|
|
112
124
|
// Instead, use them directly in component overrides
|
|
113
125
|
typography: {
|
|
@@ -804,124 +816,139 @@ const h = (n) => {
|
|
|
804
816
|
}
|
|
805
817
|
}
|
|
806
818
|
};
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
},
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
819
|
+
};
|
|
820
|
+
var defaultComponentOverrides = (options) => {
|
|
821
|
+
const full = defaultOptions(options || {});
|
|
822
|
+
const _a = full, { palette, colorSchemes, defaultColorScheme, cssVariables } = _a, safeOptions = __objRest(_a, ["palette", "colorSchemes", "defaultColorScheme", "cssVariables"]);
|
|
823
|
+
return safeOptions;
|
|
824
|
+
};
|
|
825
|
+
var appTheme = (muiThemeOptions, options) => {
|
|
826
|
+
const _a = options || {}, { tenantSettings, colors } = _a, otherOptions = __objRest(_a, ["tenantSettings", "colors"]);
|
|
827
|
+
const baseTheme = __spreadValues({
|
|
828
|
+
cssVariables: true
|
|
829
|
+
}, defaultOptions(options));
|
|
830
|
+
const theme = muiThemeOptions ? deepmerge(deepmerge(defaultTheme, baseTheme), muiThemeOptions) : deepmerge(defaultTheme, baseTheme);
|
|
831
|
+
return theme;
|
|
832
|
+
};
|
|
833
|
+
var getAntTheme = (options) => {
|
|
834
|
+
const { colors } = options || {};
|
|
835
|
+
const currentTheme = document.documentElement.getAttribute("data-theme") || "dark";
|
|
836
|
+
const cssVars = getAllCssVariablesFromStyleSheets(":root");
|
|
837
|
+
const resolve = (colorKey) => {
|
|
838
|
+
const suffixed = `--${colorKey}--${currentTheme}`;
|
|
839
|
+
if (colors == null ? void 0 : colors[`${colorKey}--${currentTheme}`]) {
|
|
840
|
+
return colors[`${colorKey}--${currentTheme}`];
|
|
841
|
+
}
|
|
842
|
+
if (cssVars[suffixed]) {
|
|
843
|
+
return cssVars[suffixed];
|
|
844
|
+
}
|
|
845
|
+
if (cssVars[`--${colorKey}`]) {
|
|
846
|
+
return cssVars[`--${colorKey}`];
|
|
847
|
+
}
|
|
848
|
+
return void 0;
|
|
814
849
|
};
|
|
815
|
-
|
|
816
|
-
}, k = (n) => {
|
|
817
|
-
const { colors: c } = n || {}, a = document.documentElement.getAttribute("data-theme") || "dark", e = h(":root"), o = (r) => {
|
|
818
|
-
const i = `--${r}--${a}`;
|
|
819
|
-
if (c?.[`${r}--${a}`])
|
|
820
|
-
return c[`${r}--${a}`];
|
|
821
|
-
if (e[i])
|
|
822
|
-
return e[i];
|
|
823
|
-
if (e[`--${r}`])
|
|
824
|
-
return e[`--${r}`];
|
|
825
|
-
}, l = {
|
|
850
|
+
const token = {
|
|
826
851
|
// Core
|
|
827
|
-
colorPrimary:
|
|
828
|
-
colorSuccess:
|
|
829
|
-
colorWarning:
|
|
830
|
-
colorError:
|
|
831
|
-
colorInfo:
|
|
852
|
+
colorPrimary: resolve("btn-bg"),
|
|
853
|
+
colorSuccess: resolve("alert-success-bg"),
|
|
854
|
+
colorWarning: resolve("alert-warning-bg"),
|
|
855
|
+
colorError: resolve("alert-error-bg"),
|
|
856
|
+
colorInfo: resolve("alert-info-bg"),
|
|
832
857
|
// Text
|
|
833
|
-
colorText:
|
|
834
|
-
colorTextSecondary:
|
|
835
|
-
colorTextDisabled:
|
|
858
|
+
colorText: resolve("text-color"),
|
|
859
|
+
colorTextSecondary: resolve("text-light-color"),
|
|
860
|
+
colorTextDisabled: resolve("disabled-color"),
|
|
836
861
|
// Background
|
|
837
|
-
colorBgBase:
|
|
838
|
-
colorBgContainer:
|
|
839
|
-
colorBgElevated:
|
|
840
|
-
colorBgLayout:
|
|
862
|
+
colorBgBase: resolve("bodybg-primary"),
|
|
863
|
+
colorBgContainer: resolve("component-bg"),
|
|
864
|
+
colorBgElevated: resolve("module-bg"),
|
|
865
|
+
colorBgLayout: resolve("body-bg"),
|
|
841
866
|
// Borders
|
|
842
|
-
colorBorder:
|
|
843
|
-
colorSplit:
|
|
867
|
+
colorBorder: resolve("border-color"),
|
|
868
|
+
colorSplit: resolve("border-color-split"),
|
|
844
869
|
// Typography
|
|
845
870
|
fontSize: 14,
|
|
846
871
|
borderRadius: 6
|
|
847
872
|
};
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
})
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
873
|
+
Object.keys(token).forEach((k) => {
|
|
874
|
+
if (token[k] === void 0) delete token[k];
|
|
875
|
+
});
|
|
876
|
+
return {
|
|
877
|
+
cssVar: true,
|
|
878
|
+
hashed: false,
|
|
879
|
+
algorithm: currentTheme === "dark" ? antdTheme.darkAlgorithm : antdTheme.defaultAlgorithm,
|
|
880
|
+
token,
|
|
855
881
|
components: {
|
|
856
882
|
Table: {
|
|
857
|
-
headerBg:
|
|
858
|
-
headerColor:
|
|
859
|
-
rowHoverBg:
|
|
860
|
-
rowSelectedBg:
|
|
861
|
-
borderColor:
|
|
862
|
-
footerBg:
|
|
883
|
+
headerBg: resolve("table-header-bg"),
|
|
884
|
+
headerColor: resolve("table-header-color"),
|
|
885
|
+
rowHoverBg: resolve("component-hover-bg"),
|
|
886
|
+
rowSelectedBg: resolve("component-active-bg"),
|
|
887
|
+
borderColor: resolve("border-color"),
|
|
888
|
+
footerBg: resolve("component-bg")
|
|
863
889
|
},
|
|
864
890
|
Button: {
|
|
865
|
-
colorPrimary:
|
|
866
|
-
colorPrimaryHover:
|
|
867
|
-
colorPrimaryActive:
|
|
868
|
-
defaultBg:
|
|
869
|
-
defaultColor:
|
|
870
|
-
defaultBorderColor:
|
|
891
|
+
colorPrimary: resolve("btn-bg"),
|
|
892
|
+
colorPrimaryHover: resolve("highlight-color"),
|
|
893
|
+
colorPrimaryActive: resolve("btn-active-bg"),
|
|
894
|
+
defaultBg: resolve("secondary-color"),
|
|
895
|
+
defaultColor: resolve("text-color"),
|
|
896
|
+
defaultBorderColor: resolve("border-color")
|
|
871
897
|
},
|
|
872
898
|
Input: {
|
|
873
|
-
colorBgContainer:
|
|
874
|
-
colorBorder:
|
|
875
|
-
colorText:
|
|
876
|
-
activeBorderColor:
|
|
877
|
-
hoverBorderColor:
|
|
899
|
+
colorBgContainer: resolve("component-bg"),
|
|
900
|
+
colorBorder: resolve("border-color"),
|
|
901
|
+
colorText: resolve("text-color"),
|
|
902
|
+
activeBorderColor: resolve("primary-color"),
|
|
903
|
+
hoverBorderColor: resolve("primary-color")
|
|
878
904
|
},
|
|
879
905
|
Select: {
|
|
880
|
-
colorBgContainer:
|
|
881
|
-
colorBorder:
|
|
882
|
-
colorText:
|
|
906
|
+
colorBgContainer: resolve("component-bg"),
|
|
907
|
+
colorBorder: resolve("border-color"),
|
|
908
|
+
colorText: resolve("text-color")
|
|
883
909
|
},
|
|
884
910
|
Dropdown: {
|
|
885
|
-
colorBgElevated:
|
|
886
|
-
colorText:
|
|
911
|
+
colorBgElevated: resolve("component-bg"),
|
|
912
|
+
colorText: resolve("text-color")
|
|
887
913
|
},
|
|
888
914
|
Modal: {
|
|
889
|
-
contentBg:
|
|
890
|
-
headerBg:
|
|
891
|
-
titleColor:
|
|
915
|
+
contentBg: resolve("component-bg"),
|
|
916
|
+
headerBg: resolve("component-bg"),
|
|
917
|
+
titleColor: resolve("text-color")
|
|
892
918
|
},
|
|
893
919
|
Layout: {
|
|
894
|
-
headerBg:
|
|
895
|
-
bodyBg:
|
|
896
|
-
siderBg:
|
|
920
|
+
headerBg: resolve("primary-color"),
|
|
921
|
+
bodyBg: resolve("bodybg-primary"),
|
|
922
|
+
siderBg: resolve("sidebar-bg")
|
|
897
923
|
},
|
|
898
924
|
Menu: {
|
|
899
925
|
itemBg: "transparent",
|
|
900
|
-
itemColor:
|
|
901
|
-
itemHoverBg:
|
|
902
|
-
itemSelectedBg:
|
|
903
|
-
itemSelectedColor:
|
|
926
|
+
itemColor: resolve("text-color"),
|
|
927
|
+
itemHoverBg: resolve("component-hover-bg"),
|
|
928
|
+
itemSelectedBg: resolve("component-active-bg"),
|
|
929
|
+
itemSelectedColor: resolve("highlight-color")
|
|
904
930
|
},
|
|
905
931
|
Card: {
|
|
906
|
-
colorBgContainer:
|
|
907
|
-
colorBorderSecondary:
|
|
932
|
+
colorBgContainer: resolve("component-bg"),
|
|
933
|
+
colorBorderSecondary: resolve("border-color")
|
|
908
934
|
},
|
|
909
935
|
Tooltip: {
|
|
910
|
-
colorBgSpotlight:
|
|
911
|
-
colorTextLightSolid:
|
|
936
|
+
colorBgSpotlight: resolve("module-bg"),
|
|
937
|
+
colorTextLightSolid: resolve("text-color")
|
|
912
938
|
},
|
|
913
939
|
Tabs: {
|
|
914
|
-
itemColor:
|
|
915
|
-
itemSelectedColor:
|
|
916
|
-
inkBarColor:
|
|
940
|
+
itemColor: resolve("text-color"),
|
|
941
|
+
itemSelectedColor: resolve("highlight-color"),
|
|
942
|
+
inkBarColor: resolve("highlight-color")
|
|
917
943
|
}
|
|
918
944
|
}
|
|
919
945
|
};
|
|
920
946
|
};
|
|
947
|
+
var index_default = appTheme;
|
|
921
948
|
export {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
949
|
+
appTheme,
|
|
950
|
+
index_default as default,
|
|
951
|
+
defaultComponentOverrides,
|
|
952
|
+
defaultOptions,
|
|
953
|
+
getAntTheme
|
|
927
954
|
};
|
package/package.json
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
"name": "@dashadmin/dash-styles",
|
|
3
|
+
"version": "1.3.26",
|
|
4
|
+
"main": "dist/index.cjs",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"require": "./dist/index.cjs"
|
|
10
|
+
},
|
|
11
|
+
"./dash.less": {
|
|
12
|
+
"import": "./src/dash.less",
|
|
13
|
+
"require": "./src/dash.less"
|
|
14
|
+
},
|
|
15
|
+
"./styles/*": {
|
|
16
|
+
"import": "./src/styles/*",
|
|
17
|
+
"require": "./src/styles/*"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"devDependencies": {},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@mui/utils": "^7.3.10",
|
|
24
|
+
"react-admin": "5.14.6"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"antd": ">=5.0.0"
|
|
28
|
+
},
|
|
29
|
+
"module": "dist/index.js",
|
|
30
|
+
"types": "dist/index.d.ts",
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"registry": "https://registry.npmjs.org"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsup"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"src"
|
|
41
|
+
],
|
|
42
|
+
"type": "module"
|
|
43
|
+
}
|
|
@@ -376,8 +376,11 @@
|
|
|
376
376
|
// Widths
|
|
377
377
|
--min-body-width: 575px;
|
|
378
378
|
--sidebar-mini-drawer-width: 100px;
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
// Layout dimensions are NOT runtime-injected like colors; they must reference the
|
|
380
|
+
// LESS vars so per-app overrides in apps/<app>/src/dash-variables.less take effect
|
|
381
|
+
// (the Vite `additionalData` imports dash defaults -> app overrides -> this transformer).
|
|
382
|
+
--sidebar-large-width: @sidebar-large-width;
|
|
383
|
+
--sidebar-small-width: @sidebar-small-width;
|
|
381
384
|
--sidebar-horizontal-height: 120px;
|
|
382
385
|
|
|
383
386
|
--app-sidebar-width: 230px;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const getAllCssVariablesFromStyleSheets = (selector: string) => {
|
|
2
|
+
|
|
3
|
+
const cssVariables = {};
|
|
4
|
+
|
|
5
|
+
// Loop through all style sheets
|
|
6
|
+
for (let i = 0; i < document.styleSheets.length; i++) {
|
|
7
|
+
try {
|
|
8
|
+
const styleSheet = document.styleSheets[i];
|
|
9
|
+
// Skip if the stylesheet is from a different origin and can't be accessed
|
|
10
|
+
if (!styleSheet.cssRules) continue;
|
|
11
|
+
|
|
12
|
+
// Loop through all CSS rules in the stylesheet
|
|
13
|
+
for (let j = 0; j < styleSheet.cssRules.length; j++) {
|
|
14
|
+
const rule = styleSheet.cssRules[j];
|
|
15
|
+
|
|
16
|
+
// Check if it's a style rule (type 1)
|
|
17
|
+
|
|
18
|
+
/* @ts-ignore */
|
|
19
|
+
if (rule.selectorText === selector) {
|
|
20
|
+
|
|
21
|
+
/* @ts-ignore */
|
|
22
|
+
const style = rule.style;
|
|
23
|
+
|
|
24
|
+
// Loop through all style properties
|
|
25
|
+
for (let k = 0; k < style.length; k++) {
|
|
26
|
+
const prop = style[k];
|
|
27
|
+
if (prop.startsWith('--')) {
|
|
28
|
+
//console.log(prop,style.getPropertyValue(prop).trim());
|
|
29
|
+
cssVariables[prop] = style.getPropertyValue(prop).trim();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
} catch (e) {
|
|
36
|
+
// Skip cross-origin stylesheets that throw security errors
|
|
37
|
+
console.warn('Could not access stylesheet:', e);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
return cssVariables;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export default getAllCssVariablesFromStyleSheets;
|