@m4l/graphics 7.2.2 → 7.2.3-beta.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.
Files changed (97) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +43 -43
  3. package/lib/graphics.d.ts +6 -0
  4. package/lib/graphics.d.ts.map +1 -0
  5. package/package.json +29 -57
  6. package/components/GlobalStyles/index.d.ts +0 -8
  7. package/components/GlobalStyles/index.js +0 -82
  8. package/components/index.d.ts +0 -1
  9. package/components/index.js +0 -1
  10. package/contexts/DeviceTypeContext/helper.d.ts +0 -9
  11. package/contexts/DeviceTypeContext/helper.js +0 -4
  12. package/contexts/DeviceTypeContext/index.d.ts +0 -15
  13. package/contexts/DeviceTypeContext/index.js +0 -18
  14. package/contexts/DeviceTypeContext/store.d.ts +0 -18
  15. package/contexts/DeviceTypeContext/store.js +0 -36
  16. package/contexts/DeviceTypeContext/types.d.ts +0 -36
  17. package/contexts/FormatterContext/index.d.ts +0 -12
  18. package/contexts/FormatterContext/index.js +0 -74
  19. package/contexts/FormatterContext/types.d.ts +0 -58
  20. package/contexts/HostThemeContext/index.d.ts +0 -11
  21. package/contexts/HostThemeContext/index.js +0 -46
  22. package/contexts/HostThemeContext/types.d.ts +0 -17
  23. package/contexts/LocalesContext/helper.d.ts +0 -25
  24. package/contexts/LocalesContext/helper.js +0 -35
  25. package/contexts/LocalesContext/index.d.ts +0 -11
  26. package/contexts/LocalesContext/index.js +0 -71
  27. package/contexts/LocalesContext/types.d.ts +0 -26
  28. package/contexts/ResponsiveContainerContext/constants.d.ts +0 -2
  29. package/contexts/ResponsiveContainerContext/constants.js +0 -4
  30. package/contexts/ResponsiveContainerContext/index.d.ts +0 -16
  31. package/contexts/ResponsiveContainerContext/index.js +0 -51
  32. package/contexts/ResponsiveContainerContext/store.d.ts +0 -18
  33. package/contexts/ResponsiveContainerContext/store.js +0 -33
  34. package/contexts/ResponsiveContainerContext/types.d.ts +0 -26
  35. package/contexts/ThemeSettingsContext/ThemeSettingsContext.d.ts +0 -19
  36. package/contexts/ThemeSettingsContext/ThemeSettingsContext.js +0 -32
  37. package/contexts/ThemeSettingsContext/constants.d.ts +0 -2
  38. package/contexts/ThemeSettingsContext/constants.js +0 -10
  39. package/contexts/ThemeSettingsContext/index.d.ts +0 -3
  40. package/contexts/ThemeSettingsContext/index.js +0 -1
  41. package/contexts/ThemeSettingsContext/store.d.ts +0 -19
  42. package/contexts/ThemeSettingsContext/store.js +0 -177
  43. package/contexts/ThemeSettingsContext/types.d.ts +0 -71
  44. package/contexts/index.d.ts +0 -12
  45. package/contexts/index.js +0 -1
  46. package/hooks/index.d.ts +0 -14
  47. package/hooks/index.js +0 -1
  48. package/hooks/useFirstRender/index.d.ts +0 -9
  49. package/hooks/useFirstRender/index.js +0 -10
  50. package/hooks/useFormatter/index.d.ts +0 -8
  51. package/hooks/useFormatter/index.js +0 -11
  52. package/hooks/useHostTheme/index.d.ts +0 -8
  53. package/hooks/useHostTheme/index.js +0 -11
  54. package/hooks/useIsMobile/index.d.ts +0 -14
  55. package/hooks/useIsMobile/index.js +0 -16
  56. package/hooks/useIsMountedRef/index.d.ts +0 -8
  57. package/hooks/useIsMountedRef/index.js +0 -13
  58. package/hooks/useLocales/index.d.ts +0 -8
  59. package/hooks/useLocales/index.js +0 -11
  60. package/hooks/useOffSetTop.d.ts +0 -8
  61. package/hooks/useOffSetTop.js +0 -12
  62. package/hooks/usePaginate/index.d.ts +0 -14
  63. package/hooks/usePaginate/index.js +0 -76
  64. package/hooks/usePaginate/index.test.d.ts +0 -35
  65. package/hooks/usePaginate/types.d.ts +0 -21
  66. package/hooks/usePaginate/types.js +0 -8
  67. package/hooks/useResizeObserver/index.d.ts +0 -9
  68. package/hooks/useResizeObserver/index.js +0 -18
  69. package/hooks/useResponsive/index.d.ts +0 -5
  70. package/hooks/useResponsive/index.js +0 -7
  71. package/hooks/useResponsiveContainer/index.d.ts +0 -6
  72. package/hooks/useResponsiveContainer/index.js +0 -12
  73. package/hooks/useRows/index.d.ts +0 -11
  74. package/hooks/useRows/index.js +0 -70
  75. package/hooks/useRows/index.test.d.ts +0 -1
  76. package/hooks/useRows/state.d.ts +0 -29
  77. package/hooks/useRows/state.js +0 -25
  78. package/hooks/useRows/state.test.d.ts +0 -1
  79. package/hooks/useRows/types.d.ts +0 -9
  80. package/hooks/useThemSettingsStore/index.d.ts +0 -9
  81. package/hooks/useThemSettingsStore/index.js +0 -12
  82. package/hooks/useUserAgent/index.d.ts +0 -4
  83. package/hooks/useUserAgent/index.js +0 -25
  84. package/test/setup.d.ts +0 -0
  85. package/test/utils.d.ts +0 -9
  86. package/utils/anchorEl.d.ts +0 -20
  87. package/utils/anchorEl.js +0 -49
  88. package/utils/getContrastTextColor/getContrastTextColor.d.ts +0 -5
  89. package/utils/getContrastTextColor/getContrastTextColor.js +0 -14
  90. package/utils/getContrastTextColor/index.d.ts +0 -2
  91. package/utils/getContrastTextColor/index.js +0 -1
  92. package/utils/getContrastTextColor/types.d.ts +0 -2
  93. package/utils/index.d.ts +0 -3
  94. package/utils/index.js +0 -1
  95. package/utils/strings.d.ts +0 -1
  96. package/utils/strings.js +0 -4
  97. package/vite-env.d.ts +0 -1
@@ -1,46 +0,0 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { createContext as h, useMemo as d } from "react";
3
- import { CssBaseline as p } from "@mui/material";
4
- import { deepmerge as t } from "@mui/utils";
5
- import { G as f } from "../../components/GlobalStyles/index.js";
6
- import { experimental_extendTheme as u, Experimental_CssVarsProvider as x, StyledEngineProvider as v } from "@mui/material/styles";
7
- import { u as C } from "../../hooks/useIsMobile/index.js";
8
- const S = h(null);
9
- function y(l) {
10
- const { children: c, hostThemeOptions: s, fnComponentsOverrides: n } = l, i = C(), a = d(() => {
11
- const e = {
12
- ...s
13
- }, r = u({
14
- cssVarPrefix: "m4l",
15
- colorSchemes: {
16
- light: t({}, e),
17
- finalTheme: t({}, e),
18
- dark: t({}, e)
19
- },
20
- generalSettings: {
21
- isMobile: i
22
- }
23
- });
24
- return r.components = n(r), r;
25
- }, [i]);
26
- return /* @__PURE__ */ m(x, { theme: a, children: [
27
- /* @__PURE__ */ o(f, {}),
28
- /* @__PURE__ */ o(
29
- S.Provider,
30
- {
31
- value: {
32
- hostThemeOptions: s,
33
- fnComponentsOverrides: n
34
- },
35
- children: /* @__PURE__ */ m(v, { injectFirst: !0, children: [
36
- /* @__PURE__ */ o(p, { enableColorScheme: !0 }),
37
- c
38
- ] })
39
- }
40
- )
41
- ] });
42
- }
43
- export {
44
- S as H,
45
- y as a
46
- };
@@ -1,17 +0,0 @@
1
- import { Theme, CssVarsTheme } from '@mui/material/styles';
2
- import { ReactNode } from 'react';
3
- export type EventFunListener = (...args: any[]) => void;
4
- export interface HostThemeType {
5
- /**
6
- * "dataTestId" es una variable que se encarga de asignar un id a un componente
7
- * @createdAt 2024-10-08 18:52:29 - automatic
8
- */
9
- dataTestId?: string;
10
- hostThemeOptions: Theme;
11
- fnComponentsOverrides: (theme: Omit<Theme, 'palette' | 'applyStyles'> & CssVarsTheme) => any;
12
- }
13
- export interface HostThemeProviderProps extends HostThemeType {
14
- isMicroFrontEnd: boolean;
15
- children: ReactNode;
16
- }
17
- export type HostThemeContextType = HostThemeType;
@@ -1,25 +0,0 @@
1
- import { BaseLocale, LocaleType, NetworkLocaleType } from './types';
2
- /**
3
- * Obtiene el locale de la red
4
- * @author Juan Escobar - automatic
5
- * @createdAt 2024-10-06 20:07:18 - automatic
6
- * @updatedAt 2024-10-06 20:07:18 - automatic
7
- * @updatedUser Juan Escobar - automatic
8
- */
9
- export declare function getLocaleFromNetwork(locale: NetworkLocaleType, host_static_assets: string, environment_assets: string): Promise<LocaleType>;
10
- /**
11
- * Une los elementos de un locale
12
- * @author Juan Escobar - automatic
13
- * @createdAt 2024-10-06 20:07:18 - automatic
14
- * @updatedAt 2024-10-06 20:07:18 - automatic
15
- * @updatedUser Juan Escobar - automatic
16
- */
17
- export declare function joinLocale(baseLocale: BaseLocale): string;
18
- /**
19
- * Divide un locale en sus partes
20
- * @author Juan Escobar - automatic
21
- * @createdAt 2024-10-06 20:07:18 - automatic
22
- * @updatedAt 2024-10-06 20:07:18 - automatic
23
- * @updatedUser Juan Escobar - automatic
24
- */
25
- export declare function splitLocale(locale: string): BaseLocale;
@@ -1,35 +0,0 @@
1
- import o from "date-fns/locale/en-US";
2
- async function g(n, e, s) {
3
- const r = l(n), t = { ...n };
4
- let i;
5
- return r === "es" ? i = (await import("date-fns/locale/es")).default : r === "fr" ? i = (await import("date-fns/locale/fr")).default : r === "en-US" ? i = o : (i = o, t.lang = "en", t.script = void 0, t.region = "US", t.urlIcon = `${e}/${s}/frontend/commons/assets/icons/langs/lang_en.svg`, t.name = "English US*"), {
6
- ...t,
7
- module: i,
8
- localeString: l(t)
9
- };
10
- }
11
- function l(n) {
12
- let e = n.lang;
13
- return n.script && n.script !== "" && (e = e + "-" + n.script), n.region && n.region !== "" && (e = e + "-" + n.region), e;
14
- }
15
- function a(n) {
16
- try {
17
- const e = new Intl.Locale(n);
18
- return {
19
- lang: e.language || "",
20
- script: e.script,
21
- region: e.region
22
- };
23
- } catch {
24
- return {
25
- lang: "en",
26
- script: void 0,
27
- region: "US"
28
- };
29
- }
30
- }
31
- export {
32
- g,
33
- l as j,
34
- a as s
35
- };
@@ -1,11 +0,0 @@
1
- import { LocalesProviderProps, LocalesContextProps } from './types';
2
- declare const LocalesContext: import('react').Context<LocalesContextProps | null>;
3
- /**
4
- * Proveedor de locales
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-06 20:07:18 - automatic
7
- * @updatedAt 2024-10-06 20:07:18 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
- */
10
- declare function LocalesProvider(props: LocalesProviderProps): import("react").JSX.Element | null;
11
- export { LocalesProvider, LocalesContext };
@@ -1,71 +0,0 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { createContext as A, useState as d, useCallback as O, useEffect as E } from "react";
3
- import { AdapterDateFns as k } from "@mui/x-date-pickers/AdapterDateFns";
4
- import { LocalizationProvider as x } from "@mui/x-date-pickers";
5
- import { useEnvironment as F, useNetwork as P, useHostTools as j, useLocalStorageWithListener as G, EmitEvents as a } from "@m4l/core";
6
- import { s as I, j as V } from "./helper.js";
7
- const b = A(null);
8
- function B(_) {
9
- const { children: g, isMicroFrontEnd: e, localeHost: i, getLocaleFromNetwork: s } = _;
10
- if (e && !i)
11
- throw Error("Must set localeHost in microfrontend");
12
- if (!e && !s)
13
- throw Error("Must set getLocaleFromNetwork in host");
14
- const { domain_token: L, host_static_assets: p, environment_assets: C } = F(), { networkOperation: S } = P(), { events_add_listener: h, events_remove_listener: v, events_emit: T } = j(), [r, l] = d(() => {
15
- if (e)
16
- return i;
17
- }), [o, c] = G(
18
- "localeHost",
19
- navigator.language
20
- ), [H, N] = d(""), u = O((t) => {
21
- l(t);
22
- }, []);
23
- if (E(() => (e && h(a.EMMIT_EVENT_HOST_LOCALE_CHANGE, u), () => {
24
- e && v(a.EMMIT_EVENT_HOST_LOCALE_CHANGE, u);
25
- }), []), E(() => {
26
- let t = !0;
27
- if (!e && s && !(o === H && o !== ""))
28
- return S({
29
- method: "POST",
30
- endPoint: "na/locales",
31
- data: { ...I(o), domain_token: L },
32
- responseToCamelCase: !0,
33
- bodyToSnakeCase: !0
34
- }).then((m) => {
35
- t && s(m.data, p, C).then(
36
- (n) => {
37
- l(n), N(n.localeString), o !== n.localeString && c(n.localeString), T(a.EMMIT_EVENT_HOST_LOCALE_CHANGE, n);
38
- }
39
- );
40
- }).finally(() => {
41
- }), function() {
42
- t = !1;
43
- };
44
- }, [o]), !r)
45
- return null;
46
- const M = (t) => {
47
- (t.lang !== r.lang || t.script !== r.script || t.region !== r.region) && c(V(t));
48
- };
49
- return /* @__PURE__ */ f(
50
- b.Provider,
51
- {
52
- value: {
53
- currentLocale: r,
54
- onChangeLocale: M
55
- },
56
- children: /* @__PURE__ */ f(
57
- x,
58
- {
59
- dateAdapter: k,
60
- adapterLocale: r.module,
61
- dateFormats: { hours24h: "23" },
62
- children: g
63
- }
64
- )
65
- }
66
- );
67
- }
68
- export {
69
- b as L,
70
- B as a
71
- };
@@ -1,26 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { Locale } from 'date-fns';
3
- export type SupportedLocales = 'en-US' | 'es' | 'fr';
4
- export interface BaseLocale {
5
- lang: string;
6
- script?: string;
7
- region?: string;
8
- }
9
- export interface NetworkLocaleType extends BaseLocale {
10
- name: string;
11
- urlIcon: string;
12
- }
13
- export interface LocaleType extends NetworkLocaleType {
14
- module: Locale;
15
- localeString: string;
16
- }
17
- export type LocalesProviderProps = {
18
- isMicroFrontEnd: boolean;
19
- localeHost?: LocaleType;
20
- getLocaleFromNetwork?: (locale: NetworkLocaleType, host_static_assets: string, environment_assets: string) => Promise<LocaleType>;
21
- children: ReactNode;
22
- };
23
- export type LocalesContextProps = {
24
- currentLocale?: LocaleType;
25
- onChangeLocale: (newLocaleString: BaseLocale) => void;
26
- };
@@ -1,2 +0,0 @@
1
- import { BreakPointsType } from './types';
2
- export declare const BREAKPOINTS: BreakPointsType;
@@ -1,4 +0,0 @@
1
- const s = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 };
2
- export {
3
- s as B
4
- };
@@ -1,16 +0,0 @@
1
- import { ResponsiveContainerProviderProps } from './types';
2
- declare const ResponsiveContainerContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').ResponsiveContainerStateWithActions>, "setState"> & {
3
- setState<A extends string | {
4
- type: unknown;
5
- }>(partial: import('./types').ResponsiveContainerStateWithActions | Partial<import('./types').ResponsiveContainerStateWithActions> | ((state: import('./types').ResponsiveContainerStateWithActions) => import('./types').ResponsiveContainerStateWithActions | Partial<import('./types').ResponsiveContainerStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
6
- }, "setState"> & {
7
- setState(nextStateOrUpdater: import('./types').ResponsiveContainerStateWithActions | Partial<import('./types').ResponsiveContainerStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('./types').ResponsiveContainerStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
8
- type: unknown;
9
- } | undefined): void;
10
- }) | null>;
11
- /**
12
- * Proveedor de contenedor responsivo
13
- * @deprecated usar useIsMobile
14
- */
15
- declare const ResponsiveContainerProvider: (props: ResponsiveContainerProviderProps) => import("react").JSX.Element;
16
- export { ResponsiveContainerProvider, ResponsiveContainerContext };
@@ -1,51 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { createContext as p, useRef as v, useCallback as u, useMemo as d, useLayoutEffect as R } from "react";
3
- import { B as i } from "./constants.js";
4
- import b from "lodash-es/throttle";
5
- import { c as h } from "./store.js";
6
- const k = p(null), y = (l) => {
7
- const { children: f, observedDivRef: s } = l, o = v();
8
- o.current || (o.current = h({
9
- breakPoint: "md",
10
- isUpSm: !1,
11
- isXs: !1
12
- }));
13
- const c = u(() => {
14
- const n = s;
15
- if (n instanceof HTMLElement && n.clientWidth) {
16
- const e = Object.keys(
17
- i
18
- );
19
- for (let t = 0; t < e.length; t++) {
20
- const r = e[t];
21
- if (n.clientWidth <= i[r]) {
22
- o.current?.getState().responsiveContainerActions.setBreakpoint(r);
23
- break;
24
- } else t === e.length - 1 && n.clientWidth >= i[r] && o.current?.getState().responsiveContainerActions.setBreakpoint(r);
25
- }
26
- }
27
- }, [s]), a = d(
28
- () => b(c, 200, {
29
- leading: !1,
30
- trailing: !0
31
- }),
32
- [c]
33
- );
34
- return R(() => {
35
- const n = () => {
36
- a();
37
- }, e = s;
38
- if (e && e instanceof Element) {
39
- const t = new ResizeObserver((r) => {
40
- n();
41
- });
42
- return t.observe(e), () => {
43
- t.disconnect();
44
- };
45
- }
46
- }, [s, a]), /* @__PURE__ */ m(k.Provider, { value: o.current, children: f });
47
- };
48
- export {
49
- k as R,
50
- y as a
51
- };
@@ -1,18 +0,0 @@
1
- import { InitialResponsiveContainerProps, ResponsiveContainerStateWithActions } from './types';
2
- /**
3
- * Crea la tienda de contenedor responsivo
4
- * @author Juan Escobar - automatic
5
- * @createdAt 2024-10-06 20:07:18 - automatic
6
- * @updatedAt 2024-10-06 20:07:18 - automatic
7
- * @updatedUser Juan Escobar - automatic
8
- */
9
- export declare const createResponsiveContainerStore: (initProps: InitialResponsiveContainerProps) => Omit<Omit<import('zustand').StoreApi<ResponsiveContainerStateWithActions>, "setState"> & {
10
- setState<A extends string | {
11
- type: unknown;
12
- }>(partial: ResponsiveContainerStateWithActions | Partial<ResponsiveContainerStateWithActions> | ((state: ResponsiveContainerStateWithActions) => ResponsiveContainerStateWithActions | Partial<ResponsiveContainerStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
13
- }, "setState"> & {
14
- setState(nextStateOrUpdater: ResponsiveContainerStateWithActions | Partial<ResponsiveContainerStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<ResponsiveContainerStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
15
- type: unknown;
16
- } | undefined): void;
17
- };
18
- export type ResponsiveContainerStore = ReturnType<typeof createResponsiveContainerStore>;
@@ -1,33 +0,0 @@
1
- import { createStore as i } from "zustand";
2
- import { devtools as m } from "zustand/middleware";
3
- import { immer as n } from "zustand/middleware/immer";
4
- const S = (r) => {
5
- const s = {
6
- ...r
7
- };
8
- return i(
9
- m(
10
- n((t, p) => ({
11
- ...s,
12
- responsiveContainerActions: {
13
- /**
14
- * Establece el punto de interrupción
15
- * @author Juan Escobar - automatic
16
- * @createdAt 2024-10-06 20:07:18 - automatic
17
- * @updatedAt 2024-10-06 20:07:18 - automatic
18
- * @updatedUser Juan Escobar - automatic
19
- */
20
- setBreakpoint: (e) => {
21
- t((o) => {
22
- o.breakPoint = e, o.isUpSm = e !== "xs" && e !== "sm", o.isXs = e === "xs";
23
- });
24
- }
25
- }
26
- })),
27
- { name: "Responsive Relative Store" }
28
- )
29
- );
30
- };
31
- export {
32
- S as c
33
- };
@@ -1,26 +0,0 @@
1
- export type BreakpointType = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
2
- export type BreakPointsType = Record<BreakpointType, number>;
3
- export interface ResponsiveRelativeContextProps {
4
- breakPoint: BreakpointType;
5
- }
6
- export interface ResponsiveContainerProviderProps {
7
- observedDivRef: Element | Text | null;
8
- children: React.ReactNode;
9
- }
10
- export type CurrentState = {
11
- width: number;
12
- height: number;
13
- mounted: boolean;
14
- breakpoint: BreakpointType;
15
- };
16
- export interface ResponsiveContainerState {
17
- breakPoint: BreakpointType;
18
- isUpSm: boolean;
19
- isXs: boolean;
20
- }
21
- export type InitialResponsiveContainerProps = Pick<ResponsiveContainerState, 'breakPoint' | 'isUpSm' | 'isXs'>;
22
- export interface ResponsiveContainerStateWithActions extends ResponsiveContainerState {
23
- responsiveContainerActions: {
24
- setBreakpoint: (breakPoint: BreakpointType) => void;
25
- };
26
- }
@@ -1,19 +0,0 @@
1
- import { ThemeSettingsProviderProps } from './types';
2
- declare const ThemeSettingsContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').ThemeSettingsStateWithActions>, "setState"> & {
3
- setState<A extends string | {
4
- type: unknown;
5
- }>(partial: import('./types').ThemeSettingsStateWithActions | Partial<import('./types').ThemeSettingsStateWithActions> | ((state: import('./types').ThemeSettingsStateWithActions) => import('./types').ThemeSettingsStateWithActions | Partial<import('./types').ThemeSettingsStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
6
- }, "setState"> & {
7
- setState(nextStateOrUpdater: import('./types').ThemeSettingsStateWithActions | Partial<import('./types').ThemeSettingsStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('./types').ThemeSettingsStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
8
- type: unknown;
9
- } | undefined): void;
10
- }) | null>;
11
- /**
12
- * Theme settings provider
13
- * @author Juan Escobar - automatic
14
- * @createdAt 2024-10-06 20:07:18 - automatic
15
- * @updatedAt 2024-10-08 19:28:36 - automatic
16
- * @updatedUser Juan Escobar - automatic
17
- */
18
- declare function ThemeSettingsProvider({ children, themeSettingsForced }: ThemeSettingsProviderProps): import("react").JSX.Element;
19
- export { ThemeSettingsProvider, ThemeSettingsContext };
@@ -1,32 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { createContext as a, useRef as c } from "react";
3
- import { useLocalStorageWithListener as p } from "@m4l/core";
4
- import { getUserThemeOptions as f, presetsOptionsMainColor as g } from "@m4l/styles";
5
- import { c as h } from "./store.js";
6
- import { d as r } from "./constants.js";
7
- const l = a(null);
8
- function x({ children: s, themeSettingsForced: t }) {
9
- const [n, i] = p(
10
- "theme_setting",
11
- r
12
- ), o = {
13
- ...r,
14
- //Por si hay algo en el local storage incopatible con el default
15
- ...n,
16
- ...t || {}
17
- //Si es forzado, se sobreescribe y por eso es el último
18
- }, e = c();
19
- return e.current || (e.current = h({
20
- themeUserSettings: o,
21
- themeOptions: f(o.themeMode, o.themeColor),
22
- presetsOptionsColorMain: g,
23
- //Para visibilidad de los colores en el radiogroup de SettingsLayout
24
- open: !1,
25
- themeSettingsPersistFn: t ? void 0 : i
26
- // Solo se instancia cuando esta en host, cuando esta storybook no se instancia, evitando guardar en localStorage
27
- }), e.current.getState().settingsActions.init()), /* @__PURE__ */ m(l.Provider, { value: e.current, children: s });
28
- }
29
- export {
30
- l as T,
31
- x as a
32
- };
@@ -1,2 +0,0 @@
1
- import { ThemeUserSettings } from './types';
2
- export declare const defaultThemeSettings: ThemeUserSettings;
@@ -1,10 +0,0 @@
1
- const e = {
2
- themeMode: "light",
3
- themeDirection: "ltr",
4
- themeColor: "patronus",
5
- themeLayout: "horizontal",
6
- themeStretch: !1
7
- };
8
- export {
9
- e as d
10
- };
@@ -1,3 +0,0 @@
1
- export * from './ThemeSettingsContext';
2
- export type { ThemeUserSettings as ThemeSettingsType, ThemeUserMode as ThemeMode, ThemeUserDirection as ThemeDirection, ThemeUserLayout as ThemeLayout, ThemeUserStretch as ThemeStretch, ThemeSettingsStore, ThemeSettingsStateWithActions, } from './types';
3
- export { defaultThemeSettings } from './constants';
@@ -1,19 +0,0 @@
1
- import { InitialThemeSettingsStoreProps, ThemeSettingsStateWithActions } from './types';
2
- import { WritableDraft } from 'immer/dist/internal';
3
- /**
4
- * Crea la tienda de configuración del tema
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-06 20:07:18 - automatic
7
- * @updatedAt 2024-10-08 19:28:36 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
- */
10
- export declare const createThemeSettingsStore: (initialState: InitialThemeSettingsStoreProps) => Omit<Omit<import('zustand').StoreApi<ThemeSettingsStateWithActions>, "setState"> & {
11
- setState<A extends string | {
12
- type: unknown;
13
- }>(partial: ThemeSettingsStateWithActions | Partial<ThemeSettingsStateWithActions> | ((state: ThemeSettingsStateWithActions) => ThemeSettingsStateWithActions | Partial<ThemeSettingsStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
14
- }, "setState"> & {
15
- setState(nextStateOrUpdater: ThemeSettingsStateWithActions | Partial<ThemeSettingsStateWithActions> | ((state: WritableDraft<ThemeSettingsStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
16
- type: unknown;
17
- } | undefined): void;
18
- };
19
- export type ThemeSettingsStore = ReturnType<typeof createThemeSettingsStore>;