@m4l/graphics 7.1.1 → 7.1.2
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.
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import { createStore as
|
|
2
|
-
import { devtools as
|
|
3
|
-
import { immer as
|
|
4
|
-
import { getPaletteByPreset as
|
|
5
|
-
import { alpha as
|
|
6
|
-
import { d as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
import { createStore as c } from "zustand";
|
|
2
|
+
import { devtools as a } from "zustand/middleware";
|
|
3
|
+
import { immer as d } from "zustand/middleware/immer";
|
|
4
|
+
import { getPaletteByPreset as u, createCustomShadows as U, shadows as g, typographyOld as f, getColorPresets as m } from "@m4l/styles";
|
|
5
|
+
import { alpha as s } from "@mui/system";
|
|
6
|
+
import { d as l } from "./constants.js";
|
|
7
|
+
function p(r, o = "m4l") {
|
|
8
|
+
const h = document.querySelector('[data-mui-color-scheme="light"]');
|
|
9
|
+
h && Object.keys(r).forEach((t) => {
|
|
10
10
|
const e = r[t];
|
|
11
11
|
if (typeof e == "string" || typeof e == "number") {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
} else typeof e == "object" && e !== null &&
|
|
12
|
+
const S = `--${o}-${t}`;
|
|
13
|
+
h.style.setProperty(S, e.toString());
|
|
14
|
+
} else typeof e == "object" && e !== null && p(e, `${o}-${t}`);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
const n = (r) => {
|
|
18
|
-
const o = r.themeUserSettings ||
|
|
18
|
+
const o = r.themeUserSettings || l, h = o.themeMode === "light", t = u(o.themeColor), e = h ? t.light : t.dark;
|
|
19
19
|
r.themeOptions = {
|
|
20
20
|
...r.themeOptions,
|
|
21
|
-
...
|
|
21
|
+
...f,
|
|
22
22
|
palette: {
|
|
23
23
|
...r.themeOptions?.palette ?? {},
|
|
24
24
|
...e
|
|
25
25
|
},
|
|
26
26
|
shape: { borderRadius: 8 },
|
|
27
27
|
direction: o.themeDirection,
|
|
28
|
-
shadows:
|
|
28
|
+
shadows: h ? g.light : g.dark,
|
|
29
29
|
customShadows: {
|
|
30
|
-
primary: `0 8px
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
34
|
-
...d(o.themeMode)
|
|
30
|
+
primary: h ? `0 4px 8px -4px ${s(m(o.themeColor)?.enabledLight, 0.12)},
|
|
31
|
+
0 2px 27px 2px ${s(m(o.themeColor)?.enabledLight, 0.02)}` : `0 4px 8px -4px ${s(m(o.themeColor)?.enabledDark, 0.12)},
|
|
32
|
+
0 2px 27px 2px ${s(m(o.themeColor)?.enabledDark, 0.02)}`,
|
|
33
|
+
...U(o.themeMode)
|
|
35
34
|
},
|
|
36
35
|
stretch: o.themeStretch
|
|
37
|
-
},
|
|
36
|
+
}, p(r.themeOptions);
|
|
38
37
|
}, i = (r) => {
|
|
39
38
|
r.themeSettingsPersistFn && r.themeSettingsPersistFn(r.themeUserSettings);
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
}, $ = (r) => c(
|
|
40
|
+
a(
|
|
41
|
+
d((o, h) => ({
|
|
43
42
|
...r,
|
|
44
43
|
settingsActions: {
|
|
45
44
|
/**
|
|
@@ -163,7 +162,7 @@ const n = (r) => {
|
|
|
163
162
|
onResetSetting: () => {
|
|
164
163
|
o((t) => {
|
|
165
164
|
t.themeUserSettings = {
|
|
166
|
-
...
|
|
165
|
+
...l
|
|
167
166
|
}, i(t), n(t);
|
|
168
167
|
});
|
|
169
168
|
}
|
|
@@ -173,5 +172,5 @@ const n = (r) => {
|
|
|
173
172
|
)
|
|
174
173
|
);
|
|
175
174
|
export {
|
|
176
|
-
|
|
175
|
+
$ as c
|
|
177
176
|
};
|