@m4l/graphics 0.1.39 → 0.1.41
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.
- package/components/GlobalStyle/{index.30beab6e.js → index.2c5d07c1.js} +14 -11
- package/hooks/{index.53eeb77d.js → index.5c8cfbbc.js} +18 -19
- package/hooks/index.d.ts +1 -1
- package/hooks/useResponsive/index.1409e387.js +7 -0
- package/hooks/useResponsive/index.d.ts +0 -7
- package/index.js +22 -24
- package/package.json +1 -1
- package/hooks/useResponsive/index.fc5e1b4f.js +0 -20
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { useTheme as e } from "@mui/material/styles";
|
|
2
2
|
import { GlobalStyles as a } from "@mui/material";
|
|
3
|
-
import { globalRemSize as
|
|
4
|
-
import { jsx as
|
|
3
|
+
import { globalRemSize as t } from "@m4l/styles";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
function s() {
|
|
6
|
-
const
|
|
7
|
-
return console.log("test spacing formula ",
|
|
6
|
+
const o = e();
|
|
7
|
+
return console.log("test spacing formula ", o.spacing(1)), /* @__PURE__ */ r(a, {
|
|
8
8
|
styles: {
|
|
9
|
+
body: {
|
|
10
|
+
backgroundColor: `${o.palette.background.background}!important`
|
|
11
|
+
},
|
|
9
12
|
"#nprogress": {
|
|
10
13
|
pointerEvents: "none",
|
|
11
14
|
"& .bar": {
|
|
@@ -14,9 +17,9 @@ function s() {
|
|
|
14
17
|
height: 2,
|
|
15
18
|
width: "100%",
|
|
16
19
|
position: "fixed",
|
|
17
|
-
zIndex:
|
|
18
|
-
backgroundColor:
|
|
19
|
-
boxShadow: `0 0 2px ${
|
|
20
|
+
zIndex: o.zIndex.snackbar,
|
|
21
|
+
backgroundColor: o.palette.primary.main,
|
|
22
|
+
boxShadow: `0 0 2px ${o.palette.primary.main}`
|
|
20
23
|
},
|
|
21
24
|
"& .peg": {
|
|
22
25
|
right: 0,
|
|
@@ -26,13 +29,13 @@ function s() {
|
|
|
26
29
|
display: "block",
|
|
27
30
|
position: "absolute",
|
|
28
31
|
transform: "rotate(3deg) translate(0px, -4px)",
|
|
29
|
-
boxShadow: `0 0 10px ${
|
|
32
|
+
boxShadow: `0 0 10px ${o.palette.primary.main}, 0 0 5px ${o.palette.primary.main}`
|
|
30
33
|
}
|
|
31
34
|
},
|
|
32
35
|
"& html": {
|
|
33
|
-
fontSize:
|
|
34
|
-
[
|
|
35
|
-
fontSize:
|
|
36
|
+
fontSize: t.desktop,
|
|
37
|
+
[o.breakpoints.down("sm")]: {
|
|
38
|
+
fontSize: t.mobile
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
@@ -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 "@
|
|
6
|
-
|
|
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
|
|
17
|
-
const [
|
|
15
|
+
function b(e) {
|
|
16
|
+
const [s, t] = f(!1), o = e || 100;
|
|
18
17
|
return n(() => (window.onscroll = () => {
|
|
19
|
-
window.pageYOffset >
|
|
18
|
+
window.pageYOffset > o ? t(!0) : t(!1);
|
|
20
19
|
}, () => {
|
|
21
20
|
window.onscroll = null;
|
|
22
|
-
}), [
|
|
21
|
+
}), [o]), s;
|
|
23
22
|
}
|
|
24
|
-
const
|
|
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
|
|
31
|
-
const
|
|
29
|
+
function v(e) {
|
|
30
|
+
const s = r(null);
|
|
32
31
|
return c(() => {
|
|
33
|
-
const t =
|
|
32
|
+
const t = s?.current;
|
|
34
33
|
if (!t)
|
|
35
34
|
return;
|
|
36
|
-
const
|
|
35
|
+
const o = new ResizeObserver((u) => {
|
|
37
36
|
e(t, u[0]);
|
|
38
37
|
});
|
|
39
|
-
return
|
|
40
|
-
|
|
38
|
+
return o.observe(t), () => {
|
|
39
|
+
o.disconnect();
|
|
41
40
|
};
|
|
42
|
-
}, [e,
|
|
41
|
+
}, [e, s.current]), s;
|
|
43
42
|
}
|
|
44
43
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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 {
|
|
8
|
+
export { useResponsiveDesktop } from './useResponsive';
|
|
@@ -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
|
|
2
|
-
import { F as
|
|
3
|
-
import { L as F, a as
|
|
1
|
+
import { G as x } from "./components/GlobalStyle/index.2c5d07c1.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
|
|
7
|
-
import { b as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { C as
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
v as LocalesProvider,
|
|
29
|
+
I as getAnchorElPositionWindow,
|
|
30
|
+
C as getLocaleFromNetwork,
|
|
32
31
|
P as useFirstRender,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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,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
|
-
};
|