@m4l/graphics 1.0.10 → 1.0.11

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.
@@ -0,0 +1,4 @@
1
+ import "@mui/material/styles";
2
+ import "@mui/material";
3
+ import "@m4l/styles";
4
+ import "react/jsx-runtime";
@@ -1,17 +1,17 @@
1
- import { createContext as c, useMemo as h } from "react";
2
- import { CssBaseline as a } from "@mui/material";
1
+ import { createContext as c, useMemo as a } from "react";
2
+ import { CssBaseline as h } from "@mui/material";
3
3
  import { G as d } from "../../components/GlobalStyle/index.b7393a44.js";
4
- import { createTheme as p, experimental_extendTheme as x, Experimental_CssVarsProvider as f, StyledEngineProvider as T } from "@mui/material/styles";
4
+ import { createTheme as p, experimental_extendTheme as x, Experimental_CssVarsProvider as f, StyledEngineProvider as u } from "@mui/material/styles";
5
5
  import { jsxs as s, jsx as t } from "react/jsx-runtime";
6
- const u = c(null);
6
+ const T = c(null);
7
7
  function H(m) {
8
8
  const {
9
9
  children: i,
10
- hostThemeOptions: l,
11
- fnComponentsOverrides: o
12
- } = m, n = h(() => {
10
+ hostThemeOptions: o,
11
+ fnComponentsOverrides: n
12
+ } = m, l = a(() => {
13
13
  const e = p({
14
- ...l
14
+ ...o
15
15
  }), r = x({
16
16
  cssVarPrefix: "m4l",
17
17
  colorSchemes: {
@@ -20,18 +20,18 @@ function H(m) {
20
20
  dark: e
21
21
  }
22
22
  });
23
- return r.components = o(r), r;
23
+ return r.components = n(r), r;
24
24
  }, []);
25
25
  return /* @__PURE__ */ s(f, {
26
- theme: n,
27
- children: [/* @__PURE__ */ t(d, {}), /* @__PURE__ */ t(u.Provider, {
26
+ theme: l,
27
+ children: [/* @__PURE__ */ t(d, {}), /* @__PURE__ */ t(T.Provider, {
28
28
  value: {
29
- hostThemeOptions: n,
30
- fnComponentsOverrides: o
29
+ hostThemeOptions: o,
30
+ fnComponentsOverrides: n
31
31
  },
32
- children: /* @__PURE__ */ s(T, {
32
+ children: /* @__PURE__ */ s(u, {
33
33
  injectFirst: !0,
34
- children: [/* @__PURE__ */ t(a, {
34
+ children: [/* @__PURE__ */ t(h, {
35
35
  enableColorScheme: !0
36
36
  }), i]
37
37
  })
@@ -39,6 +39,6 @@ function H(m) {
39
39
  });
40
40
  }
41
41
  export {
42
- u as H,
42
+ T as H,
43
43
  H as a
44
44
  };
@@ -1,8 +1,12 @@
1
+ import "./FormatterContext/index.92336f4c.js";
2
+ import "./LocalesContext/index.53f0b702.js";
1
3
  import { createContext as f, useRef as T, useMemo as k, useLayoutEffect as y, useEffect as b } from "react";
2
- import { c as v, d as R, i as P, l as E } from "../node_modules.7cdb697c.js";
4
+ import { c as v, d as R, i as P, l as E } from "../node_modules.9690bbee.js";
3
5
  import { jsx as x } from "react/jsx-runtime";
6
+ import "date-fns/locale/en-US";
7
+ import "./HostThemeContext/index.89c85eb6.js";
4
8
  import { useNetwork as M, useLocalStorageWithListener as w } from "@m4l/core";
5
- import { getColorPresets as m, getColorState as d, typography as L, palette as S, SECONDARY as A, COMMON as N, ERROR as D, WARNING as z, INFO as B, SUCCESS as $, shadows as p, createCustomShadows as j, defaultThemeOptions as W, defaultPreset as _, colorPresets as F } from "@m4l/styles";
9
+ import { getColorPresets as m, getColorState as d, typography as L, palette as p, SECONDARY as A, COMMON as N, ERROR as D, WARNING as z, INFO as B, SUCCESS as $, shadows as S, createCustomShadows as j, defaultThemeOptions as W, defaultPreset as _, colorPresets as F } from "@m4l/styles";
6
10
  import { alpha as I } from "@mui/system";
7
11
  import { u as U } from "../hooks/useFirstRender/index.1e9b02fb.js";
8
12
  const C = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, K = (r) => {
@@ -24,7 +28,7 @@ const C = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, K = (r) => {
24
28
  { name: "Responsive Relative Store" }
25
29
  )
26
30
  );
27
- }, X = f(null), te = (r) => {
31
+ }, X = f(null), se = (r) => {
28
32
  const {
29
33
  children: t,
30
34
  observedDivRef: o
@@ -100,7 +104,7 @@ const c = (r) => {
100
104
  typography: L,
101
105
  palette: {
102
106
  ...r.themeOptions.palette,
103
- ...o ? S.light : S.dark,
107
+ ...o ? p.light : p.dark,
104
108
  primary: m(t.themeColorPresets),
105
109
  state: d(t.themeColorPresets, t.themeMode),
106
110
  representative: t.themeMode === "light" ? m(t.themeColorPresets)?.light : m(t.themeColorPresets)?.darker,
@@ -156,7 +160,7 @@ const c = (r) => {
156
160
  },
157
161
  shape: { borderRadius: 8 },
158
162
  direction: t.themeDirection,
159
- shadows: o ? p.light : p.dark,
163
+ shadows: o ? S.light : S.dark,
160
164
  customShadows: {
161
165
  primary: `0 8px 16px 0 ${I(
162
166
  m(t.themeColorPresets)?.main || "#fff",
@@ -240,7 +244,7 @@ const c = (r) => {
240
244
  { name: "ExampleStore" }
241
245
  )
242
246
  ), G = f(null);
243
- function ne({
247
+ function ie({
244
248
  children: r,
245
249
  themeSettings: t
246
250
  }) {
@@ -270,7 +274,7 @@ function ne({
270
274
  export {
271
275
  X as R,
272
276
  G as T,
273
- te as a,
274
- ne as b,
277
+ se as a,
278
+ ie as b,
275
279
  u as d
276
280
  };
@@ -0,0 +1,57 @@
1
+ import { useRef as r, useEffect as n, useState as f, useContext as u, useLayoutEffect as c } from "react";
2
+ import { H as m } from "../contexts/HostThemeContext/index.89c85eb6.js";
3
+ import { u as a } from "../node_modules.9690bbee.js";
4
+ import { T as p } from "../contexts/index.9a0fbc7c.js";
5
+ import "../contexts/FormatterContext/index.92336f4c.js";
6
+ import "../contexts/LocalesContext/index.53f0b702.js";
7
+ import "@m4l/styles";
8
+ function b() {
9
+ const e = r(!0);
10
+ return n(
11
+ () => () => {
12
+ e.current = !1;
13
+ },
14
+ []
15
+ ), e;
16
+ }
17
+ function g(e) {
18
+ const [o, t] = f(!1), s = e || 100;
19
+ return n(() => (window.onscroll = () => {
20
+ window.pageYOffset > s ? t(!0) : t(!1);
21
+ }, () => {
22
+ window.onscroll = null;
23
+ }), [s]), o;
24
+ }
25
+ const v = () => {
26
+ const e = u(m);
27
+ if (!e)
28
+ throw new Error("useHostTheme context must be use inside HostThemeProvider");
29
+ return e;
30
+ };
31
+ function H(e) {
32
+ const o = r(null);
33
+ return c(() => {
34
+ const t = o?.current;
35
+ if (!t)
36
+ return;
37
+ const s = new ResizeObserver((i) => {
38
+ e(t, i[0]);
39
+ });
40
+ return s.observe(t), () => {
41
+ s.disconnect();
42
+ };
43
+ }, [e, o.current]), o;
44
+ }
45
+ function O(e, o) {
46
+ const t = u(p);
47
+ if (!t)
48
+ throw new Error("useSettingsStore context must be use inside SettignsContext");
49
+ return a(t, e, o);
50
+ }
51
+ export {
52
+ g as a,
53
+ v as b,
54
+ H as c,
55
+ O as d,
56
+ b as u
57
+ };
@@ -1,5 +1,5 @@
1
1
  import { useState as n, useEffect as o } from "react";
2
- import { t as s } from "../../node_modules.7cdb697c.js";
2
+ import { t as s } from "../../node_modules.9690bbee.js";
3
3
  const t = () => typeof navigator > "u" ? !1 : /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), l = () => {
4
4
  const [i, r] = n(t());
5
5
  return o(() => {
@@ -1,6 +1,6 @@
1
1
  import { useContext as t } from "react";
2
- import { u as r } from "../../node_modules.7cdb697c.js";
3
- import { R as n } from "../../contexts/index.955e2da6.js";
2
+ import { u as r } from "../../node_modules.9690bbee.js";
3
+ import { R as n } from "../../contexts/index.9a0fbc7c.js";
4
4
  import { useResponsive as i } from "@m4l/styles";
5
5
  function f(e, s) {
6
6
  const o = t(n);
package/index.js CHANGED
@@ -1,43 +1,43 @@
1
1
  import { G as l } from "./components/GlobalStyle/index.b7393a44.js";
2
- import { L as C, a as T, g } from "./contexts/LocalesContext/index.53f0b702.js";
3
- import { F as R, a as S } from "./contexts/FormatterContext/index.92336f4c.js";
4
- import { R as F, a as P, T as b, b as L, d as H } from "./contexts/index.955e2da6.js";
5
- import { H as w, a as z } from "./contexts/HostThemeContext/index.02e36f38.js";
2
+ import { F as C, a as T } from "./contexts/FormatterContext/index.92336f4c.js";
3
+ import { L as h, a as R, g as S } from "./contexts/LocalesContext/index.53f0b702.js";
4
+ import { R as F, a as P, T as b, b as L, d as H } from "./contexts/index.9a0fbc7c.js";
5
+ import { H as w, a as z } from "./contexts/HostThemeContext/index.89c85eb6.js";
6
6
  import { u as I } from "./hooks/useFirstRender/index.1e9b02fb.js";
7
7
  import { u as O } from "./hooks/useFormatter/index.57ac8cca.js";
8
- import { b as A, u as D, a as E, c as N, d as W } from "./hooks/index.91cf59db.js";
8
+ import { b as A, u as D, a as E, c as N, d as W } from "./hooks/index.ff8c4415.js";
9
9
  import { u as q } from "./hooks/useLocales/index.d5a80aff.js";
10
- import { u as J, a as K } from "./hooks/useResponsive/index.d09000d7.js";
11
- import { u as U } from "./hooks/useIsMobile/index.028b5710.js";
10
+ import { u as J, a as K } from "./hooks/useResponsive/index.ea7ff1dc.js";
11
+ import { u as U } from "./hooks/useIsMobile/index.54bf37f7.js";
12
12
  import { C as X, g as Y } from "./utils/index.6909c662.js";
13
13
  import "@mui/material/styles";
14
14
  import "@mui/material";
15
15
  import "@m4l/styles";
16
16
  import "react/jsx-runtime";
17
17
  import "react";
18
+ import "@m4l/core";
18
19
  import "@mui/x-date-pickers/AdapterDateFns";
19
20
  import "@mui/x-date-pickers";
20
- import "@m4l/core";
21
21
  import "date-fns/locale/en-US";
22
- import "./node_modules.7cdb697c.js";
22
+ import "./node_modules.9690bbee.js";
23
23
  import "./commonjs.e3daa2e5.js";
24
24
  import "@mui/system";
25
25
  export {
26
26
  X as Capitalize,
27
- R as FormatterContext,
28
- S as FormatterProvider,
27
+ C as FormatterContext,
28
+ T as FormatterProvider,
29
29
  l as GlobalStyles,
30
30
  w as HostThemeContext,
31
31
  z as HostThemeProvider,
32
- C as LocalesContext,
33
- T as LocalesProvider,
32
+ h as LocalesContext,
33
+ R as LocalesProvider,
34
34
  F as ResponsiveContainerContext,
35
35
  P as ResponsiveContainerProvider,
36
36
  b as ThemeSettingsContext,
37
37
  L as ThemeSettingsProvider,
38
38
  H as defaultThemeSettings,
39
39
  Y as getAnchorElPositionWindow,
40
- g as getLocaleFromNetwork,
40
+ S as getLocaleFromNetwork,
41
41
  I as useFirstRender,
42
42
  O as useFormatter,
43
43
  A as useHostTheme,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team*",
6
6
  "dependencies": {
package/vite-env.d.ts CHANGED
@@ -1 +1 @@
1
- /// <reference types="vite/client" />
1
+ /// <reference types="vite/client" />
@@ -1 +0,0 @@
1
-
@@ -1,54 +0,0 @@
1
- import { useRef as n, useEffect as r, useState as i, useContext as u, useLayoutEffect as c } from "react";
2
- import { H as m } from "../contexts/HostThemeContext/index.02e36f38.js";
3
- import { u as a } from "../node_modules.7cdb697c.js";
4
- import { T as l } from "../contexts/index.955e2da6.js";
5
- function S() {
6
- const e = n(!0);
7
- return r(
8
- () => () => {
9
- e.current = !1;
10
- },
11
- []
12
- ), e;
13
- }
14
- function x(e) {
15
- const [s, t] = i(!1), o = e || 100;
16
- return r(() => (window.onscroll = () => {
17
- window.pageYOffset > o ? t(!0) : t(!1);
18
- }, () => {
19
- window.onscroll = null;
20
- }), [o]), s;
21
- }
22
- const h = () => {
23
- const e = u(m);
24
- if (!e)
25
- throw new Error("useHostTheme context must be use inside HostThemeProvider");
26
- return e;
27
- };
28
- function b(e) {
29
- const s = n(null);
30
- return c(() => {
31
- const t = s?.current;
32
- if (!t)
33
- return;
34
- const o = new ResizeObserver((f) => {
35
- e(t, f[0]);
36
- });
37
- return o.observe(t), () => {
38
- o.disconnect();
39
- };
40
- }, [e, s.current]), s;
41
- }
42
- function g(e, s) {
43
- const t = u(l);
44
- if (!t)
45
- throw new Error("useSettingsStore context must be use inside SettignsContext");
46
- return a(t, e, s);
47
- }
48
- export {
49
- x as a,
50
- h as b,
51
- b as c,
52
- g as d,
53
- S as u
54
- };