@m4l/graphics 0.1.39 → 0.1.40

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.
@@ -2,9 +2,8 @@ import { useRef as r, useEffect as n, useState as f, useContext as i, useLayoutE
2
2
  import { H as m } from "../contexts/HostThemeContext/index.a6a62c70.js";
3
3
  import "../contexts/FormatterContext/index.92336f4c.js";
4
4
  import "../contexts/LocalesContext/index.53f0b702.js";
5
- import "@mui/material/styles";
6
- import "@mui/material/useMediaQuery";
7
- function b() {
5
+ import "@m4l/styles";
6
+ function T() {
8
7
  const e = r(!0);
9
8
  return n(
10
9
  () => () => {
@@ -13,37 +12,37 @@ function b() {
13
12
  []
14
13
  ), e;
15
14
  }
16
- function h(e) {
17
- const [o, t] = f(!1), s = e || 100;
15
+ function b(e) {
16
+ const [s, t] = f(!1), o = e || 100;
18
17
  return n(() => (window.onscroll = () => {
19
- window.pageYOffset > s ? t(!0) : t(!1);
18
+ window.pageYOffset > o ? t(!0) : t(!1);
20
19
  }, () => {
21
20
  window.onscroll = null;
22
- }), [s]), o;
21
+ }), [o]), s;
23
22
  }
24
- const v = () => {
23
+ const h = () => {
25
24
  const e = i(m);
26
25
  if (!e)
27
26
  throw new Error("useHostTheme context must be use inside HostThemeProvider");
28
27
  return e;
29
28
  };
30
- function x(e) {
31
- const o = r(null);
29
+ function v(e) {
30
+ const s = r(null);
32
31
  return c(() => {
33
- const t = o?.current;
32
+ const t = s?.current;
34
33
  if (!t)
35
34
  return;
36
- const s = new ResizeObserver((u) => {
35
+ const o = new ResizeObserver((u) => {
37
36
  e(t, u[0]);
38
37
  });
39
- return s.observe(t), () => {
40
- s.disconnect();
38
+ return o.observe(t), () => {
39
+ o.disconnect();
41
40
  };
42
- }, [e, o.current]), o;
41
+ }, [e, s.current]), s;
43
42
  }
44
43
  export {
45
- h as a,
46
- v as b,
47
- x as c,
48
- b as u
44
+ b as a,
45
+ h as b,
46
+ v as c,
47
+ T as u
49
48
  };
package/hooks/index.d.ts CHANGED
@@ -5,4 +5,4 @@ export { useLocales } from './useLocales';
5
5
  export { useOffSetTop } from './useOffSetTop';
6
6
  export { useHostTheme } from './useHostTheme';
7
7
  export { useResizeObserver } from './useResizeObserver';
8
- export { useResponsive, useResponsiveDesktop } from './useResponsive';
8
+ export { useResponsiveDesktop } from './useResponsive';
@@ -0,0 +1,7 @@
1
+ import { useResponsive as s } from "@m4l/styles";
2
+ function p() {
3
+ return s("up", "sm");
4
+ }
5
+ export {
6
+ p as u
7
+ };
@@ -1,8 +1 @@
1
- import { Breakpoint } from '@mui/material';
2
- declare type Query = 'up' | 'down' | 'between' | 'only';
3
- declare type Key = Breakpoint | number;
4
- declare type Start = Breakpoint | number;
5
- declare type End = Breakpoint | number;
6
- export declare function useResponsive(query: Query, key?: Key, start?: Start, end?: End): boolean | undefined;
7
1
  export declare function useResponsiveDesktop(): boolean | undefined;
8
- export {};
package/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { G as n } from "./components/GlobalStyle/index.30beab6e.js";
2
- import { F as c, a as d } from "./contexts/FormatterContext/index.92336f4c.js";
3
- import { L as F, a as C, g as L } from "./contexts/LocalesContext/index.53f0b702.js";
1
+ import { G as x } from "./components/GlobalStyle/index.30beab6e.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";
4
4
  import { H as g, a as h } from "./contexts/HostThemeContext/index.a6a62c70.js";
5
5
  import { u as P } from "./hooks/useFirstRender/index.1e9b02fb.js";
6
- import { u as b } from "./hooks/useFormatter/index.57ac8cca.js";
7
- import { b as w, u as z, a as G, c as O } from "./hooks/index.53eeb77d.js";
8
- import { u as y } from "./hooks/useLocales/index.d5a80aff.js";
9
- import { u as D, a as E } from "./hooks/useResponsive/index.fc5e1b4f.js";
10
- import { C as M, g as N } from "./utils/index.6909c662.js";
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.5c8cfbbc.js";
8
+ import { u as S } from "./hooks/useLocales/index.d5a80aff.js";
9
+ import { u as A } from "./hooks/useResponsive/index.1409e387.js";
10
+ import { C as E, g as I } from "./utils/index.6909c662.js";
11
11
  import "@mui/material/styles";
12
12
  import "@mui/material";
13
13
  import "@m4l/styles";
@@ -17,25 +17,23 @@ import "@m4l/core";
17
17
  import "@mui/x-date-pickers/AdapterDateFns";
18
18
  import "@mui/x-date-pickers";
19
19
  import "date-fns/locale/en-US";
20
- import "@mui/material/useMediaQuery";
21
20
  export {
22
- M as Capitalize,
23
- c as FormatterContext,
24
- d as FormatterProvider,
25
- n as GlobalStyles,
21
+ E as Capitalize,
22
+ n as FormatterContext,
23
+ c as FormatterProvider,
24
+ x as GlobalStyles,
26
25
  g as HostThemeContext,
27
26
  h as HostThemeProvider,
28
27
  F as LocalesContext,
29
- C as LocalesProvider,
30
- N as getAnchorElPositionWindow,
31
- L as getLocaleFromNetwork,
28
+ v as LocalesProvider,
29
+ I as getAnchorElPositionWindow,
30
+ C as getLocaleFromNetwork,
32
31
  P as useFirstRender,
33
- b as useFormatter,
34
- w as useHostTheme,
35
- z as useIsMountedRef,
36
- y as useLocales,
37
- G as useOffSetTop,
38
- O as useResizeObserver,
39
- D as useResponsive,
40
- E as useResponsiveDesktop
32
+ T as useFormatter,
33
+ k as useHostTheme,
34
+ w as useIsMountedRef,
35
+ S as useLocales,
36
+ z as useOffSetTop,
37
+ G as useResizeObserver,
38
+ A as useResponsiveDesktop
41
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team*",
6
6
  "dependencies": {
@@ -1,20 +0,0 @@
1
- import { useTheme as m } from "@mui/material/styles";
2
- import o from "@mui/material/useMediaQuery";
3
- function c(e, t, s, i) {
4
- const n = m(), r = o(n.breakpoints.up(t)), p = o(n.breakpoints.down(t)), u = o(n.breakpoints.between(s, i)), a = o(n.breakpoints.only(t));
5
- if (e === "up")
6
- return r;
7
- if (e === "down")
8
- return p;
9
- if (e === "between")
10
- return u;
11
- if (e === "only")
12
- return a;
13
- }
14
- function b() {
15
- return c("up", "sm");
16
- }
17
- export {
18
- b as a,
19
- c as u
20
- };