@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 S } from "zustand";
2
- import { devtools as c } from "zustand/middleware";
3
- import { immer as p } from "zustand/middleware/immer";
4
- import { getPaletteByPreset as a, createCustomShadows as d, shadows as h, typographyOld as u, getColorPresets as f } from "@m4l/styles";
5
- import { alpha as U } from "@mui/system";
6
- import { d as s } from "./constants.js";
7
- function g(r, o = "m4l") {
8
- const m = document.querySelector('[data-mui-color-scheme="light"]');
9
- m && Object.keys(r).forEach((t) => {
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 l = `--${o}-${t}`;
13
- m.style.setProperty(l, e.toString());
14
- } else typeof e == "object" && e !== null && g(e, `${o}-${t}`);
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 || s, m = o.themeMode === "light", t = a(o.themeColor), e = m ? t.light : t.dark;
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
- ...u,
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: m ? h.light : h.dark,
28
+ shadows: h ? g.light : g.dark,
29
29
  customShadows: {
30
- primary: `0 8px 16px 0 ${U(
31
- f(o.themeColor)?.main || "#fff",
32
- 0.2
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
- }, g(r.themeOptions);
36
+ }, p(r.themeOptions);
38
37
  }, i = (r) => {
39
38
  r.themeSettingsPersistFn && r.themeSettingsPersistFn(r.themeUserSettings);
40
- }, P = (r) => S(
41
- c(
42
- p((o, m) => ({
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
- ...s
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
- P as c
175
+ $ as c
177
176
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team*",
6
6
  "type": "module",