@m4l/graphics 0.1.45 → 0.1.47

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 @@
1
+
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,45 @@
1
+ import { useRef as n, useEffect as r, useState as f, useContext as c, useLayoutEffect as i } from "react";
2
+ import { H as l } from "../contexts/HostThemeContext/index.4291ba89.js";
3
+ function w() {
4
+ const e = n(!0);
5
+ return r(
6
+ () => () => {
7
+ e.current = !1;
8
+ },
9
+ []
10
+ ), e;
11
+ }
12
+ function d(e) {
13
+ const [s, t] = f(!1), o = e || 100;
14
+ return r(() => (window.onscroll = () => {
15
+ window.pageYOffset > o ? t(!0) : t(!1);
16
+ }, () => {
17
+ window.onscroll = null;
18
+ }), [o]), s;
19
+ }
20
+ const p = () => {
21
+ const e = c(l);
22
+ if (!e)
23
+ throw new Error("useHostTheme context must be use inside HostThemeProvider");
24
+ return e;
25
+ };
26
+ function T(e) {
27
+ const s = n(null);
28
+ return i(() => {
29
+ const t = s?.current;
30
+ if (!t)
31
+ return;
32
+ const o = new ResizeObserver((u) => {
33
+ e(t, u[0]);
34
+ });
35
+ return o.observe(t), () => {
36
+ o.disconnect();
37
+ };
38
+ }, [e, s.current]), s;
39
+ }
40
+ export {
41
+ d as a,
42
+ p as b,
43
+ T as c,
44
+ w as u
45
+ };
package/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { G as x } from "./components/GlobalStyle/index.fff91e86.js";
2
- import { F as n, a as c } from "./contexts/FormatterContext/index.92336f4c.js";
3
- import { L as F, a as v, g as C } from "./contexts/LocalesContext/index.53f0b702.js";
2
+ import { L as n, a as c, g as d } from "./contexts/LocalesContext/index.53f0b702.js";
3
+ import { F as v, a as C } from "./contexts/FormatterContext/index.92336f4c.js";
4
4
  import { H as g, a as h } from "./contexts/HostThemeContext/index.4291ba89.js";
5
5
  import { u as P } from "./hooks/useFirstRender/index.1e9b02fb.js";
6
6
  import { u as T } from "./hooks/useFormatter/index.57ac8cca.js";
7
- import { b as k, u as w, a as z, c as G } from "./hooks/index.0b942257.js";
7
+ import { b as k, u as w, a as z, c as G } from "./hooks/index.33d67709.js";
8
8
  import { u as S } from "./hooks/useLocales/index.d5a80aff.js";
9
9
  import { u as A } from "./hooks/useResponsive/index.1409e387.js";
10
10
  import { C as E, g as I } from "./utils/index.6909c662.js";
@@ -13,21 +13,21 @@ import "@mui/material";
13
13
  import "@m4l/styles";
14
14
  import "react/jsx-runtime";
15
15
  import "react";
16
- import "@m4l/core";
17
16
  import "@mui/x-date-pickers/AdapterDateFns";
18
17
  import "@mui/x-date-pickers";
18
+ import "@m4l/core";
19
19
  import "date-fns/locale/en-US";
20
20
  export {
21
21
  E as Capitalize,
22
- n as FormatterContext,
23
- c as FormatterProvider,
22
+ v as FormatterContext,
23
+ C as FormatterProvider,
24
24
  x as GlobalStyles,
25
25
  g as HostThemeContext,
26
26
  h as HostThemeProvider,
27
- F as LocalesContext,
28
- v as LocalesProvider,
27
+ n as LocalesContext,
28
+ c as LocalesProvider,
29
29
  I as getAnchorElPositionWindow,
30
- C as getLocaleFromNetwork,
30
+ d as getLocaleFromNetwork,
31
31
  P as useFirstRender,
32
32
  T as useFormatter,
33
33
  k as useHostTheme,
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "0.1.45",
3
+ "version": "0.1.47",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team*",
6
6
  "dependencies": {
7
- "@m4l/core": "*",
8
- "@m4l/styles": "*",
7
+ "@m4l/core": "^0.1.52",
8
+ "@m4l/styles": "^0.0.38",
9
9
  "date-fns": "^2.30.0"
10
10
  },
11
11
  "peerDependencies": {
@@ -1,4 +0,0 @@
1
- import "@mui/material/styles";
2
- import "@mui/material";
3
- import "@m4l/styles";
4
- import "react/jsx-runtime";
@@ -1,4 +0,0 @@
1
- import "./FormatterContext/index.92336f4c.js";
2
- import "./LocalesContext/index.53f0b702.js";
3
- import "date-fns/locale/en-US";
4
- import "./HostThemeContext/index.4291ba89.js";
@@ -1,48 +0,0 @@
1
- import { useRef as r, useEffect as n, useState as f, useContext as i, useLayoutEffect as c } from "react";
2
- import { H as m } from "../contexts/HostThemeContext/index.4291ba89.js";
3
- import "../contexts/FormatterContext/index.92336f4c.js";
4
- import "../contexts/LocalesContext/index.53f0b702.js";
5
- import "@m4l/styles";
6
- function T() {
7
- const e = r(!0);
8
- return n(
9
- () => () => {
10
- e.current = !1;
11
- },
12
- []
13
- ), e;
14
- }
15
- function b(e) {
16
- const [s, t] = f(!1), o = e || 100;
17
- return n(() => (window.onscroll = () => {
18
- window.pageYOffset > o ? t(!0) : t(!1);
19
- }, () => {
20
- window.onscroll = null;
21
- }), [o]), s;
22
- }
23
- const h = () => {
24
- const e = i(m);
25
- if (!e)
26
- throw new Error("useHostTheme context must be use inside HostThemeProvider");
27
- return e;
28
- };
29
- function v(e) {
30
- const s = r(null);
31
- return c(() => {
32
- const t = s?.current;
33
- if (!t)
34
- return;
35
- const o = new ResizeObserver((u) => {
36
- e(t, u[0]);
37
- });
38
- return o.observe(t), () => {
39
- o.disconnect();
40
- };
41
- }, [e, s.current]), s;
42
- }
43
- export {
44
- b as a,
45
- h as b,
46
- v as c,
47
- T as u
48
- };