@m4l/graphics 3.0.1 → 3.0.3

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,82 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useTheme as o } from "@mui/material/styles";
3
+ import { GlobalStyles as a } from "@mui/material";
4
+ import { globalRemSize as r } from "@m4l/styles";
5
+ function s() {
6
+ const t = o();
7
+ return /* @__PURE__ */ e(
8
+ a,
9
+ {
10
+ styles: {
11
+ body: {
12
+ textRendering: "geometricPrecision",
13
+ width: "100%",
14
+ height: "100vh",
15
+ "input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active": {
16
+ color: t.vars.palette.text.primary
17
+ },
18
+ "*::-webkit-scrollbar": {
19
+ // camino de la barra con radio
20
+ width: "7px",
21
+ height: "7px",
22
+ borderRadius: "3px",
23
+ backgroundColor: "transparent"
24
+ },
25
+ "*::-webkit-scrollbar-track": {
26
+ // Camino de la barrra sin radio
27
+ backgroundColor: "transparent",
28
+ border: "0px solid transparent"
29
+ },
30
+ "*::-webkit-scrollbar-corner": {
31
+ backgroundColor: "transparent"
32
+ },
33
+ // FireFox
34
+ // scrollbarColor: `${theme.vars.palette.primary.main} white`,
35
+ // scrollbarWidth: 'thin',
36
+ // Chrome
37
+ "*::-webkit-scrollbar-thumb": {
38
+ // barra que se mueve
39
+ background: t.vars.palette.general.scrollBar,
40
+ borderRadius: "2px!important"
41
+ },
42
+ "& #root": {
43
+ width: "100%",
44
+ height: "100%"
45
+ }
46
+ },
47
+ "#nprogress": {
48
+ pointerEvents: "none",
49
+ "& .bar": {
50
+ top: 0,
51
+ left: 0,
52
+ height: 2,
53
+ width: "100%",
54
+ position: "fixed",
55
+ zIndex: t.zIndex.snackbar,
56
+ backgroundColor: t.vars.palette.primary.main,
57
+ boxShadow: `0 0 2px ${t.vars.palette.primary.main}`
58
+ },
59
+ "& .peg": {
60
+ right: 0,
61
+ opacity: 1,
62
+ width: 100,
63
+ height: "100%",
64
+ display: "block",
65
+ position: "absolute",
66
+ transform: "rotate(3deg) translate(0px, -4px)",
67
+ boxShadow: `0 0 10px ${t.vars.palette.primary.main}, 0 0 5px ${t.vars.palette.primary.main}`
68
+ }
69
+ },
70
+ "& html": {
71
+ fontSize: r.desktop,
72
+ [t.breakpoints.down("sm")]: {
73
+ fontSize: r.mobile
74
+ }
75
+ }
76
+ }
77
+ }
78
+ );
79
+ }
80
+ export {
81
+ s as G
82
+ };
@@ -0,0 +1,74 @@
1
+ import { jsx as D } from "react/jsx-runtime";
2
+ import { createContext as C, useState as k, useCallback as p, useEffect as v } from "react";
3
+ import { useHostTools as R, usePropageteMF as h, EmitEvents as f } from "@m4l/core";
4
+ import { u as V } from "../../hooks/useFirstRender/index-B-Q0TTn0.js";
5
+ const x = C(null);
6
+ function I(T) {
7
+ const { children: b, isMicroFrontEnd: F, currencyFormatter: l, numberFormatter: M, dateFormatter: t } = T, r = l?.decimalDigits || 0, o = l?.code || "USD", a = M?.decimalSymbol || 0.1.toLocaleString().substring(1, 2), s = M?.thousandsSymbol || 1e3.toLocaleString().substring(1, 2), m = t?.dateFormat || "yyyy-MM-dd", n = t?.dateMask || "____-__-__", c = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", i = t?.datetimeMask || "____-__-__ __:__:__", _ = t?.timeFormat || "HH:mm:ss", d = t?.timeMask || "__:__:__", u = t?.formatDate || (() => {
8
+ throw new Error("Incorrect use of formatDate");
9
+ }), y = V(), { events_emit: g } = R(), [H, E] = k({
10
+ currencyFormatter: {
11
+ decimalDigits: r,
12
+ code: o
13
+ },
14
+ numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
15
+ dateFormatter: {
16
+ dateFormat: m,
17
+ dateMask: n,
18
+ datetimeFormat: c,
19
+ datetimeMask: i,
20
+ timeFormat: _,
21
+ timeMask: d,
22
+ formatDate: u
23
+ }
24
+ }), S = p((e) => {
25
+ E(e);
26
+ }, []);
27
+ return h({
28
+ isMicroFrontEnd: F,
29
+ event: f.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
30
+ setHandler: S
31
+ }), v(() => {
32
+ if (F || y)
33
+ return;
34
+ const e = {
35
+ currencyFormatter: { decimalDigits: r, code: o },
36
+ numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
37
+ dateFormatter: {
38
+ dateFormat: m,
39
+ dateMask: n,
40
+ datetimeFormat: c,
41
+ datetimeMask: i,
42
+ timeFormat: _,
43
+ timeMask: d,
44
+ formatDate: u
45
+ }
46
+ };
47
+ E(e), g(f.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
48
+ }, [
49
+ y,
50
+ o,
51
+ r,
52
+ a,
53
+ s,
54
+ m,
55
+ n,
56
+ c,
57
+ i,
58
+ _,
59
+ d,
60
+ u
61
+ ]), /* @__PURE__ */ D(
62
+ x.Provider,
63
+ {
64
+ value: {
65
+ ...H
66
+ },
67
+ children: b
68
+ }
69
+ );
70
+ }
71
+ export {
72
+ x as F,
73
+ I as a
74
+ };
@@ -0,0 +1,44 @@
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { createContext as c, useMemo as h } from "react";
3
+ import { CssBaseline as d } from "@mui/material";
4
+ import { G as p } from "../../components/GlobalStyle/index-C3p7OfnO.js";
5
+ import { createTheme as x, experimental_extendTheme as f, Experimental_CssVarsProvider as u, StyledEngineProvider as T } from "@mui/material/styles";
6
+ const v = c(null);
7
+ function j(m) {
8
+ const { children: l, hostThemeOptions: o, fnComponentsOverrides: n, isMobile: s } = m, a = h(() => {
9
+ const e = x({
10
+ ...o
11
+ }), r = f({
12
+ cssVarPrefix: "m4l",
13
+ colorSchemes: {
14
+ light: e,
15
+ finalTheme: e,
16
+ dark: e
17
+ },
18
+ generalSettings: {
19
+ isMobile: s
20
+ }
21
+ });
22
+ return r.components = n(r), r;
23
+ }, [s]);
24
+ return /* @__PURE__ */ i(u, { theme: a, children: [
25
+ /* @__PURE__ */ t(p, {}),
26
+ /* @__PURE__ */ t(
27
+ v.Provider,
28
+ {
29
+ value: {
30
+ hostThemeOptions: o,
31
+ fnComponentsOverrides: n
32
+ },
33
+ children: /* @__PURE__ */ i(T, { injectFirst: !0, children: [
34
+ /* @__PURE__ */ t(d, { enableColorScheme: !0 }),
35
+ l
36
+ ] })
37
+ }
38
+ )
39
+ ] });
40
+ }
41
+ export {
42
+ v as H,
43
+ j as a
44
+ };
@@ -1,13 +1,13 @@
1
- import { createContext as k, useState as E, useCallback as x, useEffect as _ } from "react";
1
+ import { jsx as E } from "react/jsx-runtime";
2
+ import { createContext as k, useState as _, useCallback as x, useEffect as L } from "react";
2
3
  import { AdapterDateFns as F } from "@mui/x-date-pickers/AdapterDateFns";
3
4
  import { LocalizationProvider as U } from "@mui/x-date-pickers";
4
5
  import { useEnvironment as P, useNetwork as I, useHostTools as j, useLocalStorageWithListener as w, EmitEvents as u } from "@m4l/core";
5
- import L from "date-fns/locale/en-US";
6
- import { jsx as S } from "react/jsx-runtime";
6
+ import S from "date-fns/locale/en-US";
7
7
  async function B(t, e, o) {
8
8
  const s = g(t), r = { ...t };
9
9
  let i;
10
- return s === "es" ? i = (await import("date-fns/locale/es")).default : s === "fr" ? i = (await import("date-fns/locale/fr")).default : s === "en-US" ? i = L : (i = L, r.lang = "en", r.script = void 0, r.region = "US", r.url_icon = `${e}/${o}/frontend/commons/assets/icons/langs/lang_en.svg`, r.name = "English US*"), {
10
+ return s === "es" ? i = (await import("date-fns/locale/es")).default : s === "fr" ? i = (await import("date-fns/locale/fr")).default : s === "en-US" ? i = S : (i = S, r.lang = "en", r.script = void 0, r.region = "US", r.url_icon = `${e}/${o}/frontend/commons/assets/icons/langs/lang_en.svg`, r.name = "English US*"), {
11
11
  ...r,
12
12
  module: i,
13
13
  localeString: g(r)
@@ -35,46 +35,35 @@ function y(t) {
35
35
  }
36
36
  const G = k(null);
37
37
  function J(t) {
38
- const {
39
- children: e,
40
- isMicroFrontEnd: o,
41
- localeHost: s,
42
- getLocaleFromNetwork: r
43
- } = t;
38
+ const { children: e, isMicroFrontEnd: o, localeHost: s, getLocaleFromNetwork: r } = t;
44
39
  if (o && !s)
45
40
  throw Error("Must set localeHost in microfrontend");
46
41
  if (!o && !r)
47
42
  throw Error("Must set getLocaleFromNetwork in host");
48
- const {
49
- domain_token: i,
50
- host_static_assets: v,
51
- environment_assets: h
52
- } = P(), {
53
- networkOperation: C
54
- } = I(), {
55
- events_add_listener: N,
56
- events_remove_listener: T,
57
- events_emit: H
58
- } = j(), [a, f] = E(() => {
43
+ const { domain_token: i, host_static_assets: v, environment_assets: h } = P(), { networkOperation: C } = I(), { events_add_listener: N, events_remove_listener: T, events_emit: H } = j(), [a, f] = _(() => {
59
44
  if (o)
60
45
  return s;
61
- }), [l, m] = w("localeHost", navigator.language), [M, A] = E(""), d = x((n) => {
46
+ }), [l, m] = w(
47
+ "localeHost",
48
+ navigator.language
49
+ ), [M, A] = _(""), d = x((n) => {
62
50
  f(n);
63
51
  }, []);
64
- if (_(() => (o && N(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, d), () => {
52
+ if (L(() => (o && N(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, d), () => {
65
53
  o && T(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, d);
66
- }), []), _(() => {
54
+ }), []), L(() => {
67
55
  let n = !0;
68
56
  if (!o && r && !(l === M && l !== ""))
69
57
  return C({
70
58
  method: "POST",
71
59
  endPoint: "na/locales",
72
- data: {
73
- ...y(l),
74
- domain_token: i
75
- }
60
+ data: { ...y(l), domain_token: i }
76
61
  }).then((p) => {
77
- n && r(p.data, v, h).then((c) => {
62
+ n && r(
63
+ p.data,
64
+ v,
65
+ h
66
+ ).then((c) => {
78
67
  f(c), A(c.localeString), l !== c.localeString && m(c.localeString), H(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, c);
79
68
  });
80
69
  }).finally(() => {
@@ -86,20 +75,24 @@ function J(t) {
86
75
  const O = (n) => {
87
76
  (n.lang !== a.lang || n.script !== a.script || n.region !== a.region) && m(g(n));
88
77
  };
89
- return /* @__PURE__ */ S(G.Provider, {
90
- value: {
91
- currentLocale: a,
92
- onChangeLocale: O
93
- },
94
- children: /* @__PURE__ */ S(U, {
95
- dateAdapter: F,
96
- adapterLocale: a.module,
97
- dateFormats: {
98
- hours24h: "23"
78
+ return /* @__PURE__ */ E(
79
+ G.Provider,
80
+ {
81
+ value: {
82
+ currentLocale: a,
83
+ onChangeLocale: O
99
84
  },
100
- children: e
101
- })
102
- });
85
+ children: /* @__PURE__ */ E(
86
+ U,
87
+ {
88
+ dateAdapter: F,
89
+ adapterLocale: a.module,
90
+ dateFormats: { hours24h: "23" },
91
+ children: e
92
+ }
93
+ )
94
+ }
95
+ );
103
96
  }
104
97
  export {
105
98
  G as L,
@@ -1,6 +1,6 @@
1
- import { createContext as S, useRef as f, useMemo as R, useLayoutEffect as k, useEffect as P } from "react";
2
- import { c as T, d as C, i as v, l as O } from "../node_modules-BHhXVwYT.js";
3
- import { jsx as y } from "react/jsx-runtime";
1
+ import { jsx as S } from "react/jsx-runtime";
2
+ import { createContext as f, useRef as T, useMemo as R, useLayoutEffect as k, useEffect as P } from "react";
3
+ import { c as C, d as v, i as y, l as O } from "../node_modules-BHhXVwYT.js";
4
4
  import { useNetwork as x, useLocalStorageWithListener as M } from "@m4l/core";
5
5
  import { getPaletteByPreset as w, typography as E, shadows as d, getColorPresets as L, createCustomShadows as B, defaultThemeOptions as A, presetsOptions as D } from "@m4l/styles";
6
6
  import { alpha as z } from "@mui/system";
@@ -9,9 +9,9 @@ const g = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, j = (r) => {
9
9
  const n = {
10
10
  ...r
11
11
  };
12
- return T(
13
- C(
14
- v((o, t) => ({
12
+ return C(
13
+ v(
14
+ y((o, t) => ({
15
15
  ...n,
16
16
  responsiveContainerActions: {
17
17
  setBreakpoint: (e) => {
@@ -24,11 +24,8 @@ const g = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, j = (r) => {
24
24
  { name: "Responsive Relative Store" }
25
25
  )
26
26
  );
27
- }, W = S(null), F = (r) => {
28
- const {
29
- children: n,
30
- observedDivRef: o
31
- } = r, t = f();
27
+ }, W = f(null), F = (r) => {
28
+ const { children: n, observedDivRef: o } = r, t = T();
32
29
  t.current || (t.current = j({
33
30
  breakPoint: "md",
34
31
  isUpSm: !1,
@@ -37,35 +34,37 @@ const g = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, j = (r) => {
37
34
  const e = () => {
38
35
  const s = o;
39
36
  if (s instanceof HTMLElement && s.clientWidth) {
40
- const a = Object.keys(g);
41
- for (let h = 0; h < a.length; h++) {
42
- const u = a[h];
37
+ const h = Object.keys(
38
+ g
39
+ );
40
+ for (let a = 0; a < h.length; a++) {
41
+ const u = h[a];
43
42
  if (s.clientWidth <= g[u]) {
44
43
  t.current?.getState().responsiveContainerActions.setBreakpoint(u);
45
44
  break;
46
- } else h === a.length - 1 && s.clientWidth >= g[u] && t.current?.getState().responsiveContainerActions.setBreakpoint(u);
45
+ } else a === h.length - 1 && s.clientWidth >= g[u] && t.current?.getState().responsiveContainerActions.setBreakpoint(u);
47
46
  }
48
47
  }
49
- }, i = R(() => O.throttle(e, 200, {
50
- leading: !1,
51
- trailing: !0
52
- }), [e]);
48
+ }, i = R(
49
+ () => O.throttle(e, 200, {
50
+ leading: !1,
51
+ trailing: !0
52
+ }),
53
+ [e]
54
+ );
53
55
  return k(() => {
54
56
  const s = () => {
55
57
  i();
56
- }, a = o;
57
- if (a && a instanceof Element) {
58
- const h = new ResizeObserver((u) => {
58
+ }, h = o;
59
+ if (h && h instanceof Element) {
60
+ const a = new ResizeObserver((u) => {
59
61
  s();
60
62
  });
61
- return h.observe(a), () => {
62
- h.disconnect();
63
+ return a.observe(h), () => {
64
+ a.disconnect();
63
65
  };
64
66
  }
65
- }, [o]), /* @__PURE__ */ y(W.Provider, {
66
- value: t.current,
67
- children: n
68
- });
67
+ }, [o]), /* @__PURE__ */ S(W.Provider, { value: t.current, children: n });
69
68
  }, p = {
70
69
  themeMode: "light",
71
70
  themeDirection: "ltr",
@@ -88,45 +87,42 @@ function b(r, n = "m4l") {
88
87
  } else typeof e == "object" && e !== null && b(e, `${n}-${t}`);
89
88
  });
90
89
  }
91
- const m = {
90
+ const l = {
92
91
  mainChannel: "",
93
92
  lightChannel: "",
94
93
  darkChannel: "",
95
94
  contrastTextChannel: ""
96
95
  }, c = (r) => {
97
- const n = r.currentThemeSettings || p, o = n.themeMode === "light", t = w(n.themeColorPresets), e = o ? t.light : t.dark, i = n.isMobile;
96
+ const n = r.currentThemeSettings || p, o = n.themeMode === "light", t = w(n.themeColorPresets), e = o ? t.light : t.dark;
98
97
  r.themeOptions = {
99
98
  ...r.themeOptions,
100
99
  typography: E,
101
- generalSettings: {
102
- isMobile: i
103
- },
104
100
  palette: {
105
101
  ...r.themeOptions?.palette ?? {},
106
102
  ...e,
107
103
  primary: {
108
104
  ...e.primary,
109
- ...m
105
+ ...l
110
106
  },
111
107
  secondary: {
112
108
  ...e.secondary,
113
- ...m
109
+ ...l
114
110
  },
115
111
  info: {
116
112
  ...e.info,
117
- ...m
113
+ ...l
118
114
  },
119
115
  error: {
120
116
  ...e.error,
121
- ...m
117
+ ...l
122
118
  },
123
119
  success: {
124
120
  ...e.success,
125
- ...m
121
+ ...l
126
122
  },
127
123
  warning: {
128
124
  ...e.warning,
129
- ...m
125
+ ...l
130
126
  },
131
127
  text: {
132
128
  ...e.text,
@@ -163,11 +159,11 @@ const m = {
163
159
  },
164
160
  stretch: n.themeStretch
165
161
  }, b(r.themeOptions);
166
- }, l = (r) => {
162
+ }, m = (r) => {
167
163
  r.setterThemeSettings && r.setterThemeSettings(r.currentThemeSettings);
168
- }, _ = (r) => T(
169
- C(
170
- v((n, o) => ({
164
+ }, _ = (r) => C(
165
+ v(
166
+ y((n, o) => ({
171
167
  ...r,
172
168
  settingsActions: {
173
169
  init: () => {
@@ -177,7 +173,7 @@ const m = {
177
173
  },
178
174
  setThemeSettings: (t) => {
179
175
  n((e) => {
180
- e.currentThemeSettings = { ...e.currentThemeSettings, ...t }, l(e), c(e);
176
+ e.currentThemeSettings = { ...e.currentThemeSettings, ...t }, m(e), c(e);
181
177
  });
182
178
  },
183
179
  onChangeMode: (t) => {
@@ -185,7 +181,7 @@ const m = {
185
181
  e.currentThemeSettings = {
186
182
  ...e.currentThemeSettings,
187
183
  themeMode: t.target.value
188
- }, l(e), c(e);
184
+ }, m(e), c(e);
189
185
  });
190
186
  },
191
187
  handleOpen: () => {
@@ -198,7 +194,7 @@ const m = {
198
194
  e.currentThemeSettings = {
199
195
  ...e.currentThemeSettings,
200
196
  themeDirection: t.target.value
201
- }, l(e), c(e);
197
+ }, m(e), c(e);
202
198
  });
203
199
  },
204
200
  onChangeColor: (t) => {
@@ -206,7 +202,7 @@ const m = {
206
202
  e.currentThemeSettings = {
207
203
  ...e.currentThemeSettings,
208
204
  themeColorPresets: t.target.value
209
- }, l(e), c(e);
205
+ }, m(e), c(e);
210
206
  });
211
207
  },
212
208
  onChangeLayout: (t) => {
@@ -214,7 +210,7 @@ const m = {
214
210
  e.currentThemeSettings = {
215
211
  ...e.currentThemeSettings,
216
212
  themeLayout: t.target.value
217
- }, l(e), c(e);
213
+ }, m(e), c(e);
218
214
  });
219
215
  },
220
216
  onToggleStretch: () => {
@@ -222,28 +218,26 @@ const m = {
222
218
  t.currentThemeSettings = {
223
219
  ...t.currentThemeSettings,
224
220
  themeStretch: !t.currentThemeSettings.themeStretch
225
- }, l(t), c(t);
221
+ }, m(t), c(t);
226
222
  });
227
223
  },
228
224
  onResetSetting: () => {
229
225
  n((t) => {
230
226
  t.currentThemeSettings = {
231
227
  ...p
232
- }, l(t), c(t);
228
+ }, m(t), c(t);
233
229
  });
234
230
  }
235
231
  }
236
232
  })),
237
233
  { name: "ThemeSettingsStore" }
238
234
  )
239
- ), N = S(null);
240
- function G({
241
- children: r,
242
- themeSettings: n
243
- }) {
244
- const {
245
- networkOperation: o
246
- } = x(), t = $(), [e, i] = M("theme_setting", {}), s = f();
235
+ ), N = f(null);
236
+ function G({ children: r, themeSettings: n }) {
237
+ const { networkOperation: o } = x(), t = $(), [e, i] = M(
238
+ "theme_setting",
239
+ {}
240
+ ), s = T();
247
241
  return s.current || (s.current = _({
248
242
  networkOperation: o,
249
243
  currentThemeSettings: {
@@ -256,13 +250,8 @@ function G({
256
250
  open: !1,
257
251
  setterThemeSettings: n ? void 0 : i
258
252
  }), s.current.getState().settingsActions.init()), P(() => {
259
- s.current?.getState().settingsActions.setThemeSettings({
260
- isMobile: t
261
- });
262
- }, [t]), /* @__PURE__ */ y(N.Provider, {
263
- value: s.current,
264
- children: r
265
- });
253
+ s.current?.getState().settingsActions.setThemeSettings({ isMobile: t });
254
+ }, [t]), /* @__PURE__ */ S(N.Provider, { value: s.current, children: r });
266
255
  }
267
256
  export {
268
257
  W as R,
@@ -1,7 +1,7 @@
1
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-L-9XyXob.js";
2
+ import { H as m } from "../contexts/HostThemeContext/index-BMSwOCtA.js";
3
3
  import { u as a } from "../node_modules-BHhXVwYT.js";
4
- import { T as l } from "../contexts/index-B5tlaHe1.js";
4
+ import { T as l } from "../contexts/index-DEyJidab.js";
5
5
  function S() {
6
6
  const e = n(!0);
7
7
  return r(
@@ -1,5 +1,5 @@
1
1
  import { useContext as r } from "react";
2
- import { F as e } from "../../contexts/FormatterContext/index-BHG3bJJo.js";
2
+ import { F as e } from "../../contexts/FormatterContext/index-Ch6IW7j8.js";
3
3
  const m = () => {
4
4
  const t = r(e);
5
5
  if (!t) throw new Error("useFormatter context must be use inside FormatterProvider");
@@ -1,5 +1,5 @@
1
1
  import { useContext as o } from "react";
2
- import { L as t } from "../../contexts/LocalesContext/index--VwMF60R.js";
2
+ import { L as t } from "../../contexts/LocalesContext/index-C89UlO0s.js";
3
3
  const n = () => {
4
4
  const e = o(t);
5
5
  if (!e) throw new Error("useLocales context must be use inside LocalesProvider");
@@ -1,6 +1,6 @@
1
1
  import { useContext as t } from "react";
2
2
  import { u as r } from "../../node_modules-BHhXVwYT.js";
3
- import { R as n } from "../../contexts/index-B5tlaHe1.js";
3
+ import { R as n } from "../../contexts/index-DEyJidab.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,13 +1,13 @@
1
- import { G as s } from "./components/GlobalStyle/index-BwMNLyTC.js";
2
- import { L as r, a, g as i } from "./contexts/LocalesContext/index--VwMF60R.js";
3
- import { F as m, a as p } from "./contexts/FormatterContext/index-BHG3bJJo.js";
4
- import { R as x, a as f, T as d, b as l, d as v } from "./contexts/index-B5tlaHe1.js";
5
- import { H as T, a as g } from "./contexts/HostThemeContext/index-L-9XyXob.js";
1
+ import { G as s } from "./components/GlobalStyle/index-C3p7OfnO.js";
2
+ import { L as r, a, g as i } from "./contexts/LocalesContext/index-C89UlO0s.js";
3
+ import { F as m, a as p } from "./contexts/FormatterContext/index-Ch6IW7j8.js";
4
+ import { R as x, a as f, T as d, b as l, d as v } from "./contexts/index-DEyJidab.js";
5
+ import { H as T, a as g } from "./contexts/HostThemeContext/index-BMSwOCtA.js";
6
6
  import { u as R } from "./hooks/useFirstRender/index-B-Q0TTn0.js";
7
- import { u as c } from "./hooks/useFormatter/index-DfdAcbzw.js";
8
- import { b as P, u as b, a as L, c as H, d as k } from "./hooks/index-Ds71tnc2.js";
9
- import { u as z } from "./hooks/useLocales/index-mTHn9nqY.js";
10
- import { u as I, a as M } from "./hooks/useResponsive/index-2q6r6mFX.js";
7
+ import { u as c } from "./hooks/useFormatter/index-BBgQ4lJL.js";
8
+ import { b as P, u as b, a as L, c as H, d as k } from "./hooks/index-Y3uj_IzK.js";
9
+ import { u as z } from "./hooks/useLocales/index-_thMBNE7.js";
10
+ import { u as I, a as M } from "./hooks/useResponsive/index-Dki-WJi8.js";
11
11
  import { u as y } from "./hooks/useIsMobile/index-Bro0dV28.js";
12
12
  import { C as D, g as E } from "./utils/index-DZG6QXjf.js";
13
13
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
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,79 +0,0 @@
1
- import { useTheme as e } from "@mui/material/styles";
2
- import { GlobalStyles as o } from "@mui/material";
3
- import { globalRemSize as r } from "@m4l/styles";
4
- import { jsx as a } from "react/jsx-runtime";
5
- function s() {
6
- const t = e();
7
- return /* @__PURE__ */ a(o, {
8
- styles: {
9
- body: {
10
- textRendering: "geometricPrecision",
11
- width: "100%",
12
- height: "100vh",
13
- "input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active": {
14
- color: t.vars.palette.text.primary
15
- },
16
- "*::-webkit-scrollbar": {
17
- // camino de la barra con radio
18
- width: "7px",
19
- height: "7px",
20
- borderRadius: "3px",
21
- backgroundColor: "transparent"
22
- },
23
- "*::-webkit-scrollbar-track": {
24
- // Camino de la barrra sin radio
25
- backgroundColor: "transparent",
26
- border: "0px solid transparent"
27
- },
28
- "*::-webkit-scrollbar-corner": {
29
- backgroundColor: "transparent"
30
- },
31
- // FireFox
32
- // scrollbarColor: `${theme.vars.palette.primary.main} white`,
33
- // scrollbarWidth: 'thin',
34
- // Chrome
35
- "*::-webkit-scrollbar-thumb": {
36
- // barra que se mueve
37
- background: t.vars.palette.general.scrollBar,
38
- borderRadius: "2px!important"
39
- },
40
- "& #root": {
41
- width: "100%",
42
- height: "100%"
43
- }
44
- },
45
- "#nprogress": {
46
- pointerEvents: "none",
47
- "& .bar": {
48
- top: 0,
49
- left: 0,
50
- height: 2,
51
- width: "100%",
52
- position: "fixed",
53
- zIndex: t.zIndex.snackbar,
54
- backgroundColor: t.vars.palette.primary.main,
55
- boxShadow: `0 0 2px ${t.vars.palette.primary.main}`
56
- },
57
- "& .peg": {
58
- right: 0,
59
- opacity: 1,
60
- width: 100,
61
- height: "100%",
62
- display: "block",
63
- position: "absolute",
64
- transform: "rotate(3deg) translate(0px, -4px)",
65
- boxShadow: `0 0 10px ${t.vars.palette.primary.main}, 0 0 5px ${t.vars.palette.primary.main}`
66
- }
67
- },
68
- "& html": {
69
- fontSize: r.desktop,
70
- [t.breakpoints.down("sm")]: {
71
- fontSize: r.mobile
72
- }
73
- }
74
- }
75
- });
76
- }
77
- export {
78
- s as G
79
- };
@@ -1,75 +0,0 @@
1
- import { createContext as D, useState as C, useCallback as k, useEffect as p } from "react";
2
- import { useHostTools as v, usePropageteMF as R, EmitEvents as f } from "@m4l/core";
3
- import { u as h } from "../../hooks/useFirstRender/index-B-Q0TTn0.js";
4
- import { jsx as V } from "react/jsx-runtime";
5
- const x = D(null);
6
- function I(T) {
7
- const {
8
- children: b,
9
- isMicroFrontEnd: F,
10
- currencyFormatter: l,
11
- numberFormatter: M,
12
- dateFormatter: t
13
- } = T, r = l?.decimalDigits || 0, o = l?.code || "USD", a = M?.decimalSymbol || 0.1.toLocaleString().substring(1, 2), s = M?.thousandsSymbol || 1e3.toLocaleString().substring(1, 2), m = t?.dateFormat || "yyyy-MM-dd", n = t?.dateMask || "____-__-__", c = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", i = t?.datetimeMask || "____-__-__ __:__:__", _ = t?.timeFormat || "HH:mm:ss", d = t?.timeMask || "__:__:__", u = t?.formatDate || (() => {
14
- throw new Error("Incorrect use of formatDate");
15
- }), y = h(), {
16
- events_emit: g
17
- } = v(), [H, E] = C({
18
- currencyFormatter: {
19
- decimalDigits: r,
20
- code: o
21
- },
22
- numberFormatter: {
23
- decimalSymbol: a,
24
- thousandsSymbol: s
25
- },
26
- dateFormatter: {
27
- dateFormat: m,
28
- dateMask: n,
29
- datetimeFormat: c,
30
- datetimeMask: i,
31
- timeFormat: _,
32
- timeMask: d,
33
- formatDate: u
34
- }
35
- }), S = k((e) => {
36
- E(e);
37
- }, []);
38
- return R({
39
- isMicroFrontEnd: F,
40
- event: f.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
41
- setHandler: S
42
- }), p(() => {
43
- if (F || y)
44
- return;
45
- const e = {
46
- currencyFormatter: {
47
- decimalDigits: r,
48
- code: o
49
- },
50
- numberFormatter: {
51
- decimalSymbol: a,
52
- thousandsSymbol: s
53
- },
54
- dateFormatter: {
55
- dateFormat: m,
56
- dateMask: n,
57
- datetimeFormat: c,
58
- datetimeMask: i,
59
- timeFormat: _,
60
- timeMask: d,
61
- formatDate: u
62
- }
63
- };
64
- E(e), g(f.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
65
- }, [y, o, r, a, s, m, n, c, i, _, d, u]), /* @__PURE__ */ V(x.Provider, {
66
- value: {
67
- ...H
68
- },
69
- children: b
70
- });
71
- }
72
- export {
73
- x as F,
74
- I as a
75
- };
@@ -1,45 +0,0 @@
1
- import { createContext as a, useMemo as h } from "react";
2
- import { CssBaseline as d } from "@mui/material";
3
- import { G as p } from "../../components/GlobalStyle/index-BwMNLyTC.js";
4
- import { createTheme as x, experimental_extendTheme as f, Experimental_CssVarsProvider as u, StyledEngineProvider as T } from "@mui/material/styles";
5
- import { jsxs as s, jsx as o } from "react/jsx-runtime";
6
- const v = a(null);
7
- function H(i) {
8
- const {
9
- children: m,
10
- hostThemeOptions: t,
11
- fnComponentsOverrides: n,
12
- isMobile: l
13
- } = i, c = h(() => {
14
- const e = x({
15
- ...t
16
- }), r = f({
17
- cssVarPrefix: "m4l",
18
- colorSchemes: {
19
- light: e,
20
- finalTheme: e,
21
- dark: e
22
- }
23
- });
24
- return r.components = n(r), r;
25
- }, [l]);
26
- return /* @__PURE__ */ s(u, {
27
- theme: c,
28
- children: [/* @__PURE__ */ o(p, {}), /* @__PURE__ */ o(v.Provider, {
29
- value: {
30
- hostThemeOptions: t,
31
- fnComponentsOverrides: n
32
- },
33
- children: /* @__PURE__ */ s(T, {
34
- injectFirst: !0,
35
- children: [/* @__PURE__ */ o(d, {
36
- enableColorScheme: !0
37
- }), m]
38
- })
39
- })]
40
- });
41
- }
42
- export {
43
- v as H,
44
- H as a
45
- };