@m4l/graphics 0.1.54 → 1.0.0
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.94f31f63.js → index.c11ef3f3.js} +19 -14
- package/contexts/HostThemeContext/index.86691e12.js +43 -0
- package/contexts/HostThemeContext/types.d.ts +3 -3
- package/contexts/{index.2d1e9989.js → index.d28ab716.js} +2 -2
- package/hooks/{index.2e0ca338.js → index.73785922.js} +3 -3
- package/hooks/useIsMobile/{index.c710a8a7.js → index.3de7c47a.js} +1 -1
- package/hooks/useResponsive/{index.70446acb.js → index.2b01d764.js} +2 -2
- package/index.js +7 -7
- package/package.json +1 -1
- package/contexts/HostThemeContext/index.4291ba89.js +0 -54
- /package/{node_modules.9690bbee.js → node_modules.9eeccca4.js} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { useTheme as o } from "@mui/material/styles";
|
|
2
2
|
import { GlobalStyles as e } from "@mui/material";
|
|
3
|
-
import { globalRemSize as
|
|
3
|
+
import { globalRemSize as r } from "@m4l/styles";
|
|
4
4
|
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */ a(e, {
|
|
5
|
+
function p() {
|
|
6
|
+
const t = o();
|
|
7
|
+
return console.log("theme test", t), /* @__PURE__ */ a(e, {
|
|
8
8
|
styles: {
|
|
9
9
|
body: {
|
|
10
|
-
backgroundColor: `${r.palette.background.background}!important`,
|
|
11
10
|
textRendering: "geometricPrecision",
|
|
11
|
+
width: "100%",
|
|
12
|
+
height: "100vh",
|
|
12
13
|
"*::-webkit-scrollbar": {
|
|
13
14
|
width: "7px",
|
|
14
15
|
height: "7px",
|
|
@@ -23,8 +24,12 @@ function s() {
|
|
|
23
24
|
backgroundColor: "transparent"
|
|
24
25
|
},
|
|
25
26
|
"*::-webkit-scrollbar-thumb": {
|
|
26
|
-
background:
|
|
27
|
+
background: t.vars.palette,
|
|
27
28
|
borderRadius: "2px!important"
|
|
29
|
+
},
|
|
30
|
+
"& #root": {
|
|
31
|
+
width: "100%",
|
|
32
|
+
height: "100%"
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
35
|
"#nprogress": {
|
|
@@ -35,9 +40,9 @@ function s() {
|
|
|
35
40
|
height: 2,
|
|
36
41
|
width: "100%",
|
|
37
42
|
position: "fixed",
|
|
38
|
-
zIndex:
|
|
39
|
-
backgroundColor:
|
|
40
|
-
boxShadow: `0 0 2px ${
|
|
43
|
+
zIndex: t.zIndex.snackbar,
|
|
44
|
+
backgroundColor: t.vars.palette.primary.main,
|
|
45
|
+
boxShadow: `0 0 2px ${t.vars.palette.primary.main}`
|
|
41
46
|
},
|
|
42
47
|
"& .peg": {
|
|
43
48
|
right: 0,
|
|
@@ -47,18 +52,18 @@ function s() {
|
|
|
47
52
|
display: "block",
|
|
48
53
|
position: "absolute",
|
|
49
54
|
transform: "rotate(3deg) translate(0px, -4px)",
|
|
50
|
-
boxShadow: `0 0 10px ${
|
|
55
|
+
boxShadow: `0 0 10px ${t.vars.palette.primary.main}, 0 0 5px ${t.vars.palette.primary.main}`
|
|
51
56
|
}
|
|
52
57
|
},
|
|
53
58
|
"& html": {
|
|
54
|
-
fontSize:
|
|
55
|
-
[
|
|
56
|
-
fontSize:
|
|
59
|
+
fontSize: r.desktop,
|
|
60
|
+
[t.breakpoints.down("sm")]: {
|
|
61
|
+
fontSize: r.mobile
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
}
|
|
60
65
|
});
|
|
61
66
|
}
|
|
62
67
|
export {
|
|
63
|
-
|
|
68
|
+
p as G
|
|
64
69
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createContext as l, useMemo as c } from "react";
|
|
2
|
+
import { CssBaseline as h } from "@mui/material";
|
|
3
|
+
import { createTheme as a, experimental_extendTheme as d, Experimental_CssVarsProvider as p, StyledEngineProvider as x } from "@mui/material/styles";
|
|
4
|
+
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
const T = l(null);
|
|
6
|
+
function g(i) {
|
|
7
|
+
const {
|
|
8
|
+
children: m,
|
|
9
|
+
hostThemeOptions: t,
|
|
10
|
+
fnComponentsOverrides: n
|
|
11
|
+
} = i, e = a({
|
|
12
|
+
...t
|
|
13
|
+
}), s = c(() => {
|
|
14
|
+
const r = d({
|
|
15
|
+
cssVarPrefix: "m4l",
|
|
16
|
+
colorSchemes: {
|
|
17
|
+
light: e,
|
|
18
|
+
finalTheme: e,
|
|
19
|
+
dark: e
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return r.components = n(r), r;
|
|
23
|
+
}, []);
|
|
24
|
+
return console.log("finalTheme", s), /* @__PURE__ */ o(p, {
|
|
25
|
+
theme: s,
|
|
26
|
+
children: /* @__PURE__ */ o(T.Provider, {
|
|
27
|
+
value: {
|
|
28
|
+
hostThemeOptions: t,
|
|
29
|
+
fnComponentsOverrides: n
|
|
30
|
+
},
|
|
31
|
+
children: /* @__PURE__ */ f(x, {
|
|
32
|
+
injectFirst: !0,
|
|
33
|
+
children: [/* @__PURE__ */ o(h, {
|
|
34
|
+
enableColorScheme: !0
|
|
35
|
+
}), m]
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
T as H,
|
|
42
|
+
g as a
|
|
43
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Theme, CssVarsTheme } from '@mui/material/styles';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export declare type EventFunListener = (...args: any[]) => void;
|
|
4
4
|
export interface HostThemeType {
|
|
5
|
-
hostThemeOptions:
|
|
6
|
-
fnComponentsOverrides: (theme: Theme) => any;
|
|
5
|
+
hostThemeOptions: Theme;
|
|
6
|
+
fnComponentsOverrides: (theme: Omit<Theme, "palette" | "applyStyles"> & CssVarsTheme) => any;
|
|
7
7
|
}
|
|
8
8
|
export interface HostThemeProviderProps extends HostThemeType {
|
|
9
9
|
isMicroFrontEnd: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./FormatterContext/index.92336f4c.js";
|
|
2
2
|
import "./LocalesContext/index.53f0b702.js";
|
|
3
3
|
import { createContext as d, useRef as p, useMemo as v, useLayoutEffect as f } from "react";
|
|
4
|
-
import { c as u, d as R, i as g, l as h } from "../node_modules.
|
|
4
|
+
import { c as u, d as R, i as g, l as h } from "../node_modules.9eeccca4.js";
|
|
5
5
|
import { jsx as x } from "react/jsx-runtime";
|
|
6
6
|
import "date-fns/locale/en-US";
|
|
7
|
-
import "./HostThemeContext/index.
|
|
7
|
+
import "./HostThemeContext/index.86691e12.js";
|
|
8
8
|
const m = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, S = (c) => {
|
|
9
9
|
const a = {
|
|
10
10
|
...c
|
|
@@ -1,9 +1,9 @@
|
|
|
1
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.
|
|
2
|
+
import { H as m } from "../contexts/HostThemeContext/index.86691e12.js";
|
|
3
3
|
import "../contexts/FormatterContext/index.92336f4c.js";
|
|
4
4
|
import "../contexts/LocalesContext/index.53f0b702.js";
|
|
5
|
-
import "../contexts/index.
|
|
6
|
-
import "../node_modules.
|
|
5
|
+
import "../contexts/index.d28ab716.js";
|
|
6
|
+
import "../node_modules.9eeccca4.js";
|
|
7
7
|
import "@m4l/styles";
|
|
8
8
|
function h() {
|
|
9
9
|
const e = r(!0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as n, useEffect as o } from "react";
|
|
2
|
-
import { t as s } from "../../node_modules.
|
|
2
|
+
import { t as s } from "../../node_modules.9eeccca4.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.
|
|
3
|
-
import { R as n } from "../../contexts/index.
|
|
2
|
+
import { u as r } from "../../node_modules.9eeccca4.js";
|
|
3
|
+
import { R as n } from "../../contexts/index.d28ab716.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,14 +1,14 @@
|
|
|
1
|
-
import { G as l } from "./components/GlobalStyle/index.
|
|
1
|
+
import { G as l } from "./components/GlobalStyle/index.c11ef3f3.js";
|
|
2
2
|
import { F as C, a as R } from "./contexts/FormatterContext/index.92336f4c.js";
|
|
3
3
|
import { L as c, a as F, g as L } from "./contexts/LocalesContext/index.53f0b702.js";
|
|
4
|
-
import { R as b, a as g } from "./contexts/index.
|
|
5
|
-
import { H, a as T } from "./contexts/HostThemeContext/index.
|
|
4
|
+
import { R as b, a as g } from "./contexts/index.d28ab716.js";
|
|
5
|
+
import { H, a as T } from "./contexts/HostThemeContext/index.86691e12.js";
|
|
6
6
|
import { u as k } from "./hooks/useFirstRender/index.1e9b02fb.js";
|
|
7
7
|
import { u as z } from "./hooks/useFormatter/index.57ac8cca.js";
|
|
8
|
-
import { b as I, u as M, a as O, c as y } from "./hooks/index.
|
|
8
|
+
import { b as I, u as M, a as O, c as y } from "./hooks/index.73785922.js";
|
|
9
9
|
import { u as D } from "./hooks/useLocales/index.d5a80aff.js";
|
|
10
|
-
import { u as N, a as W } from "./hooks/useResponsive/index.
|
|
11
|
-
import { u as q } from "./hooks/useIsMobile/index.
|
|
10
|
+
import { u as N, a as W } from "./hooks/useResponsive/index.2b01d764.js";
|
|
11
|
+
import { u as q } from "./hooks/useIsMobile/index.3de7c47a.js";
|
|
12
12
|
import { C as J, g as K } from "./utils/index.6909c662.js";
|
|
13
13
|
import "@mui/material/styles";
|
|
14
14
|
import "@mui/material";
|
|
@@ -19,7 +19,7 @@ import "@m4l/core";
|
|
|
19
19
|
import "@mui/x-date-pickers/AdapterDateFns";
|
|
20
20
|
import "@mui/x-date-pickers";
|
|
21
21
|
import "date-fns/locale/en-US";
|
|
22
|
-
import "./node_modules.
|
|
22
|
+
import "./node_modules.9eeccca4.js";
|
|
23
23
|
import "./commonjs.e3daa2e5.js";
|
|
24
24
|
export {
|
|
25
25
|
J as Capitalize,
|
package/package.json
CHANGED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { createContext as H, useState as E, useMemo as v, useCallback as M, useEffect as c } from "react";
|
|
2
|
-
import { CssBaseline as C } from "@mui/material";
|
|
3
|
-
import { createTheme as O, StyledEngineProvider as N, ThemeProvider as S } from "@mui/material/styles";
|
|
4
|
-
import { useHostTools as x, EmitEvents as r } from "@m4l/core";
|
|
5
|
-
import { jsx as n, jsxs as F } from "react/jsx-runtime";
|
|
6
|
-
const I = H(null);
|
|
7
|
-
function b(l) {
|
|
8
|
-
const {
|
|
9
|
-
children: h,
|
|
10
|
-
hostThemeOptions: t,
|
|
11
|
-
fnComponentsOverrides: i,
|
|
12
|
-
isMicroFrontEnd: s
|
|
13
|
-
} = l, [o, m] = E(t), {
|
|
14
|
-
events_add_listener: a,
|
|
15
|
-
events_remove_listener: u,
|
|
16
|
-
events_emit: _
|
|
17
|
-
} = x(), [f, d] = E(!0), p = v(() => {
|
|
18
|
-
const e = O(o);
|
|
19
|
-
return e.components = i(e), e;
|
|
20
|
-
}, [o]), T = M((e) => {
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
m(e);
|
|
23
|
-
}, 0);
|
|
24
|
-
}, []);
|
|
25
|
-
return c(() => (s && a(r.EMMIT_EVENT_HOST_THEME_CHANGE, T), () => {
|
|
26
|
-
s && u(r.EMMIT_EVENT_HOST_THEME_CHANGE, T);
|
|
27
|
-
}), []), c(() => {
|
|
28
|
-
if (f) {
|
|
29
|
-
d(!1);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
s || (setTimeout(() => {
|
|
33
|
-
m(t);
|
|
34
|
-
}, 0), _(r.EMMIT_EVENT_HOST_THEME_CHANGE, t));
|
|
35
|
-
}, [t]), /* @__PURE__ */ n(I.Provider, {
|
|
36
|
-
value: {
|
|
37
|
-
hostThemeOptions: o,
|
|
38
|
-
fnComponentsOverrides: i
|
|
39
|
-
},
|
|
40
|
-
children: /* @__PURE__ */ n(N, {
|
|
41
|
-
injectFirst: !0,
|
|
42
|
-
children: /* @__PURE__ */ F(S, {
|
|
43
|
-
theme: p,
|
|
44
|
-
children: [/* @__PURE__ */ n(C, {
|
|
45
|
-
enableColorScheme: !0
|
|
46
|
-
}), h]
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
I as H,
|
|
53
|
-
b as a
|
|
54
|
-
};
|
|
File without changes
|