@m4l/graphics 7.1.2-beta.1 → 7.1.3
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,45 @@
|
|
|
1
1
|
import { createStore as S } from "zustand";
|
|
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
|
-
|
|
2
|
+
import { devtools as a } from "zustand/middleware";
|
|
3
|
+
import { immer as d } from "zustand/middleware/immer";
|
|
4
|
+
import { getPaletteByPreset as u, createCustomShadows as x, shadows as p, typographyOld as y, getColorPresets as m } from "@m4l/styles";
|
|
5
|
+
import { alpha as s } from "@mui/system";
|
|
6
|
+
import { d as g } from "./constants.js";
|
|
7
|
+
function l(r, o = "m4l") {
|
|
8
|
+
const n = document.querySelector('[data-mui-color-scheme="light"]');
|
|
9
|
+
n && 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 c = `--${o}-${t}`;
|
|
13
|
+
n.style.setProperty(c, e.toString());
|
|
14
|
+
} else typeof e == "object" && e !== null && l(e, `${o}-${t}`);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
const o = r.themeUserSettings ||
|
|
17
|
+
const h = (r) => {
|
|
18
|
+
const o = r.themeUserSettings || g, n = o.themeMode === "light", t = u(o.themeColor), e = n ? t.light : t.dark;
|
|
19
19
|
r.themeOptions = {
|
|
20
20
|
...r.themeOptions,
|
|
21
|
-
...
|
|
21
|
+
...y,
|
|
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: n ? p.light : p.dark,
|
|
29
29
|
customShadows: {
|
|
30
|
-
primary: `0 8px
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
34
|
-
|
|
30
|
+
primary: n ? `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
|
+
...x(o.themeMode),
|
|
34
|
+
primary2: n ? `0px 2px 3px 0px ${s(m(o.themeColor)?.hoverOpacityLight, 0.2)}` : `0px 2px 3px 0px ${s(m(o.themeColor)?.hoverOpacityDark, 0.2)}`
|
|
35
35
|
},
|
|
36
36
|
stretch: o.themeStretch
|
|
37
|
-
},
|
|
37
|
+
}, l(r.themeOptions);
|
|
38
38
|
}, i = (r) => {
|
|
39
39
|
r.themeSettingsPersistFn && r.themeSettingsPersistFn(r.themeUserSettings);
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
}, T = (r) => S(
|
|
41
|
+
a(
|
|
42
|
+
d((o, n) => ({
|
|
43
43
|
...r,
|
|
44
44
|
settingsActions: {
|
|
45
45
|
/**
|
|
@@ -51,7 +51,7 @@ const n = (r) => {
|
|
|
51
51
|
*/
|
|
52
52
|
init: () => {
|
|
53
53
|
o((t) => {
|
|
54
|
-
|
|
54
|
+
h(t);
|
|
55
55
|
});
|
|
56
56
|
},
|
|
57
57
|
/**
|
|
@@ -63,7 +63,7 @@ const n = (r) => {
|
|
|
63
63
|
*/
|
|
64
64
|
setThemeSettings: (t) => {
|
|
65
65
|
o((e) => {
|
|
66
|
-
e.themeUserSettings = { ...e.themeUserSettings, ...t }, i(e),
|
|
66
|
+
e.themeUserSettings = { ...e.themeUserSettings, ...t }, i(e), h(e);
|
|
67
67
|
});
|
|
68
68
|
},
|
|
69
69
|
/**
|
|
@@ -78,7 +78,7 @@ const n = (r) => {
|
|
|
78
78
|
e.themeUserSettings = {
|
|
79
79
|
...e.themeUserSettings,
|
|
80
80
|
themeMode: t.target.value
|
|
81
|
-
}, i(e),
|
|
81
|
+
}, i(e), h(e);
|
|
82
82
|
});
|
|
83
83
|
},
|
|
84
84
|
/**
|
|
@@ -105,7 +105,7 @@ const n = (r) => {
|
|
|
105
105
|
e.themeUserSettings = {
|
|
106
106
|
...e.themeUserSettings,
|
|
107
107
|
themeDirection: t.target.value
|
|
108
|
-
}, i(e),
|
|
108
|
+
}, i(e), h(e);
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
/**
|
|
@@ -120,7 +120,7 @@ const n = (r) => {
|
|
|
120
120
|
e.themeUserSettings = {
|
|
121
121
|
...e.themeUserSettings,
|
|
122
122
|
themeColor: t.target.value
|
|
123
|
-
}, i(e),
|
|
123
|
+
}, i(e), h(e);
|
|
124
124
|
});
|
|
125
125
|
},
|
|
126
126
|
/**
|
|
@@ -135,7 +135,7 @@ const n = (r) => {
|
|
|
135
135
|
e.themeUserSettings = {
|
|
136
136
|
...e.themeUserSettings,
|
|
137
137
|
themeLayout: t.target.value
|
|
138
|
-
}, i(e),
|
|
138
|
+
}, i(e), h(e);
|
|
139
139
|
});
|
|
140
140
|
},
|
|
141
141
|
/**
|
|
@@ -150,7 +150,7 @@ const n = (r) => {
|
|
|
150
150
|
t.themeUserSettings = {
|
|
151
151
|
...t.themeUserSettings,
|
|
152
152
|
themeStretch: !t.themeUserSettings.themeStretch
|
|
153
|
-
}, i(t),
|
|
153
|
+
}, i(t), h(t);
|
|
154
154
|
});
|
|
155
155
|
},
|
|
156
156
|
/**
|
|
@@ -163,8 +163,8 @@ const n = (r) => {
|
|
|
163
163
|
onResetSetting: () => {
|
|
164
164
|
o((t) => {
|
|
165
165
|
t.themeUserSettings = {
|
|
166
|
-
...
|
|
167
|
-
}, i(t),
|
|
166
|
+
...g
|
|
167
|
+
}, i(t), h(t);
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -173,5 +173,5 @@ const n = (r) => {
|
|
|
173
173
|
)
|
|
174
174
|
);
|
|
175
175
|
export {
|
|
176
|
-
|
|
176
|
+
T as c
|
|
177
177
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/graphics",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.3",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "M4L Team*",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@m4l/core": "^2.0.0",
|
|
20
|
-
"@m4l/styles": "7.
|
|
20
|
+
"@m4l/styles": "^7.0.0",
|
|
21
21
|
"@mui/material": "5.16.7",
|
|
22
22
|
"@mui/x-date-pickers": "6.20.2",
|
|
23
23
|
"@types/react": "^18.0.0",
|