@zydon/common 2.6.34 → 2.6.36
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/dist/chunk-AWP4VFQW.js +20 -0
- package/dist/chunk-HXK3S7YV.js +7 -0
- package/dist/chunk-KQPFHDQK.js +17 -0
- package/dist/components/Common/index.js +3 -3
- package/dist/components/ToggleTheme/index.js +2 -2
- package/dist/index.js +3 -3
- package/dist/theme/settings-provider.js +1 -1
- package/dist/theme/theme-provider.d.ts +16 -1
- package/dist/theme/theme-provider.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-C7MNFGMF.js +0 -17
- package/dist/chunk-GHYF7BOH.js +0 -7
- package/dist/chunk-HKDJJCVM.js +0 -6
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createContext, memo, useContext, useMemo } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
var m={modeStorageKey:"mui-mode",defaultMode:"light"},p=`
|
|
5
|
+
(function() {
|
|
6
|
+
const modeStorageKey = '${m.modeStorageKey}';
|
|
7
|
+
const defaultMode = '${m.defaultMode}';
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
const storedMode = localStorage.getItem(modeStorageKey) || defaultMode;
|
|
11
|
+
const mode = ['light', 'dark'].includes(storedMode) ? storedMode : defaultMode;
|
|
12
|
+
|
|
13
|
+
document.documentElement.setAttribute('data-mui-color-scheme', mode);
|
|
14
|
+
} catch (e) {
|
|
15
|
+
document.documentElement.setAttribute('data-mui-color-scheme', defaultMode);
|
|
16
|
+
}
|
|
17
|
+
})();
|
|
18
|
+
`;var c=createContext(void 0),v=()=>{let e=useContext(c);if(!e)throw new Error("useSettingsContext deve ser usado dentro de um SettingsProvider");return e},x=({children:e,primaryColor:t,fontFamily:o,compactLayout:n,colorScheme:d="light",contrast:r,navColor:s,navLayout:i,setColorScheme:u})=>{let g=useMemo(()=>({primaryColor:t,fontFamily:o,compactLayout:n,colorScheme:d,contrast:r,navColor:s,navLayout:i,setColorScheme:u}),[t,o,n,d,r,s,i,u]);return jsx(c.Provider,{value:{settings:g},children:e})},K=memo(x);
|
|
19
|
+
|
|
20
|
+
export { m as a, p as b, c, v as d, K as e };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { d } from './chunk-AWP4VFQW.js';
|
|
2
|
+
import { useCallback, useEffect } from 'react';
|
|
3
|
+
import { useColorScheme } from '@mui/material/styles';
|
|
4
|
+
|
|
5
|
+
var i=e=>{typeof document<"u"&&document.documentElement.setAttribute("data-mui-color-scheme",e);};var S=()=>{let{mode:e,setMode:o}=useColorScheme(),{settings:{setColorScheme:m}}=d(),t=useCallback(r=>{o(r),m(r),setTimeout(()=>{window.location.reload();},300);},[o,m]),n=useCallback(()=>{t(e==="light"?"dark":"light");},[e,t]);return useEffect(()=>{i(e);},[e]),{colorScheme:e,isDark:e==="dark",toggleTheme:n,setColorScheme:t}};
|
|
6
|
+
|
|
7
|
+
export { i as a, S as b };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { a } from './chunk-SO64ZYQB.js';
|
|
2
|
+
import { a as a$1, e } from './chunk-H7GUTAKH.js';
|
|
3
|
+
import { a as a$3, b } from './chunk-AIB3I5MO.js';
|
|
4
|
+
import { p, r, a as a$2 } from './chunk-HTXWJ57Q.js';
|
|
5
|
+
import { a as a$6 } from './chunk-GUFT6XPG.js';
|
|
6
|
+
import { a as a$7 } from './chunk-HXK3S7YV.js';
|
|
7
|
+
import { a as a$5, e as e$1, d } from './chunk-AWP4VFQW.js';
|
|
8
|
+
import { c } from './chunk-V2UHZWRE.js';
|
|
9
|
+
import { a as a$4 } from './chunk-QQDMA4TE.js';
|
|
10
|
+
import { useMemo, useEffect } from 'react';
|
|
11
|
+
import M from '@mui/material/CssBaseline';
|
|
12
|
+
import { experimental_extendTheme, lighten, darken, Experimental_CssVarsProvider } from '@mui/material/styles';
|
|
13
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
|
+
|
|
15
|
+
var E=o=>({lighter:lighten(o,.815),light:lighten(o,.225),main:o,dark:darken(o,.15),darker:darken(o,.35),contrastText:"#000"});function K(o,t,e$1=""){let m=E(t.primaryColor);a(p,"dark.palette.primary",m),a(p,"light.palette.primary",m);let i={colorSchemes:p,shadows:a$1(t.colorScheme),customShadows:r(t.colorScheme,m.main),shape:{borderRadius:8},components:a$2,typography:{...e,fontFamily:c(t.fontFamily)},cssVarPrefix:e$1,shouldSkipGeneratingVar:W},r$1=a$3(i,t),a$4={};return experimental_extendTheme(r$1,o,b(t),a$4)}function W(o,t){let e=["mixins","overlays","direction","breakpoints","cssVarPrefix","unstable_sxConfig","typography","colorSchemes"],m={global:["tonalOffset","dividerChannel","contrastThreshold"],grey:["A100","A200","A400","A700"],text:["icon"]};if(o[0]==="palette"){let r=o[1],a=m[r]||m.global;return o.some(n=>a?.includes(n))}return o.some(r=>e?.includes(r))}var G=({children:o,cssVarPrefix:t})=>{let{settings:e}=d(),m=useMemo(()=>{let r=K(a$6[1].systemValue,{primaryColor:e.primaryColor,colorScheme:e.colorScheme,contrast:e.contrast,navLayout:e.navLayout,navColor:e.navColor,compactLayout:e.compactLayout,fontFamily:e.fontFamily,setColorScheme:e.setColorScheme},t),a=r.colorSchemes?.[e.colorScheme]?.palette;return a&&(r.palette=a),r},[e,t]),i=useMemo(()=>({theme:m,mode:e.colorScheme,defaultMode:e.colorScheme,defaultColorScheme:e.colorScheme,modeStorageKey:a$5.modeStorageKey,colorSchemeStorageKey:a$5.modeStorageKey}),[m,e.colorScheme]);return useEffect(()=>{a$7(e.colorScheme);},[e.colorScheme]),jsxs(Experimental_CssVarsProvider,{...i,children:[jsx(M,{}),o]})},D=({children:o,cssVarPrefix:t="app",primaryColor:e="#4E5BEC",fontFamily:m="Public Sans",compactLayout:i=!0,contrast:r="default",navColor:a="integrate",navLayout:n="vertical",colorScheme:k="light"})=>{let[A,F]=a$4(a$5.modeStorageKey,k);return jsx(e$1,{primaryColor:e,fontFamily:m,compactLayout:i,contrast:r,navColor:a,navLayout:n,colorScheme:A,setColorScheme:F,children:jsx(G,{cssVarPrefix:t,children:o})})},me=D;
|
|
16
|
+
|
|
17
|
+
export { K as a, me as b };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a } from '../../chunk-P26W2RT7.js';
|
|
2
2
|
import '../../chunk-QGFD5EQE.js';
|
|
3
|
-
import { b } from '../../chunk-
|
|
3
|
+
import { b } from '../../chunk-KQPFHDQK.js';
|
|
4
4
|
import '../../chunk-SO64ZYQB.js';
|
|
5
5
|
import '../../chunk-H7GUTAKH.js';
|
|
6
6
|
import '../../chunk-AIB3I5MO.js';
|
|
7
7
|
import '../../chunk-CFVUZ4S5.js';
|
|
8
8
|
import '../../chunk-HTXWJ57Q.js';
|
|
9
9
|
import '../../chunk-GUFT6XPG.js';
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import '../../chunk-
|
|
10
|
+
import '../../chunk-HXK3S7YV.js';
|
|
11
|
+
import '../../chunk-AWP4VFQW.js';
|
|
12
12
|
import { j } from '../../chunk-V2UHZWRE.js';
|
|
13
13
|
import '../../chunk-QQDMA4TE.js';
|
|
14
14
|
import '../../chunk-Z2TDWMRU.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
import { b } from '../../chunk-HXK3S7YV.js';
|
|
2
|
+
import '../../chunk-AWP4VFQW.js';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import t from '@mui/material/Box';
|
|
5
5
|
import { styled, alpha } from '@mui/material/styles';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { b as ThemeProvider, a as createTheme } from './chunk-
|
|
1
|
+
export { b as ThemeProvider, a as createTheme } from './chunk-KQPFHDQK.js';
|
|
2
2
|
import './chunk-SO64ZYQB.js';
|
|
3
3
|
export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-H7GUTAKH.js';
|
|
4
4
|
import './chunk-AIB3I5MO.js';
|
|
5
5
|
import './chunk-CFVUZ4S5.js';
|
|
6
6
|
export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from './chunk-HTXWJ57Q.js';
|
|
7
7
|
import './chunk-GUFT6XPG.js';
|
|
8
|
-
export { b as useThemeToggle } from './chunk-
|
|
9
|
-
export {
|
|
8
|
+
export { b as useThemeToggle } from './chunk-HXK3S7YV.js';
|
|
9
|
+
export { e as SettingsProvider, d as useSettingsContext } from './chunk-AWP4VFQW.js';
|
|
10
10
|
export { p as bgBlur, o as bgGradient, n as borderGradient, i as createPaletteChannel, g as hexToRgbChannel, h as hexToRgbaChannel, k as hideScrollX, l as hideScrollY, q as maxLine, b as mediaQueries, s as menuItem, r as paper, e as pxToRem, d as remToPx, f as responsiveFontSizes, c as setFont, a as stylesMode, m as textGradient, j as varAlpha } from './chunk-V2UHZWRE.js';
|
|
11
11
|
import './chunk-QQDMA4TE.js';
|
|
12
12
|
import './chunk-Z2TDWMRU.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { c as SettingsContext, e as default, d as useSettingsContext } from '../chunk-AWP4VFQW.js';
|
|
@@ -4,6 +4,21 @@ export { u as useSettingsContext } from '../settings-provider-c4e65b05.js';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../settings-28b04fd5.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Configuração do esquema de cores para MUI
|
|
9
|
+
* Usa as configurações padrão do MUI para gerenciamento de modo de cor
|
|
10
|
+
*/
|
|
11
|
+
declare const schemeConfig: {
|
|
12
|
+
modeStorageKey: string;
|
|
13
|
+
defaultMode: "light";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Script para inicialização do esquema de cores
|
|
17
|
+
* Este script deve ser executado antes da renderização do React
|
|
18
|
+
* para evitar flash de conteúdo não estilizado (FOUC)
|
|
19
|
+
*/
|
|
20
|
+
declare const colorSchemeScript: string;
|
|
21
|
+
|
|
7
22
|
declare const ThemeProvider: ({ children, cssVarPrefix, primaryColor, fontFamily, compactLayout, contrast, navColor, navLayout, colorScheme, }: ThemeProviderProps) => react_jsx_runtime.JSX.Element;
|
|
8
23
|
|
|
9
|
-
export { ThemeProvider as default };
|
|
24
|
+
export { colorSchemeScript, ThemeProvider as default, schemeConfig };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { b as default } from '../chunk-
|
|
1
|
+
export { b as default } from '../chunk-KQPFHDQK.js';
|
|
2
2
|
import '../chunk-SO64ZYQB.js';
|
|
3
3
|
import '../chunk-H7GUTAKH.js';
|
|
4
4
|
import '../chunk-AIB3I5MO.js';
|
|
5
5
|
import '../chunk-CFVUZ4S5.js';
|
|
6
6
|
import '../chunk-HTXWJ57Q.js';
|
|
7
7
|
import '../chunk-GUFT6XPG.js';
|
|
8
|
-
import '../chunk-
|
|
9
|
-
export { b as useSettingsContext } from '../chunk-
|
|
8
|
+
import '../chunk-HXK3S7YV.js';
|
|
9
|
+
export { b as colorSchemeScript, a as schemeConfig, d as useSettingsContext } from '../chunk-AWP4VFQW.js';
|
|
10
10
|
import '../chunk-V2UHZWRE.js';
|
|
11
11
|
import '../chunk-QQDMA4TE.js';
|
|
12
12
|
import '../chunk-Z2TDWMRU.js';
|
package/package.json
CHANGED
package/dist/chunk-C7MNFGMF.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-SO64ZYQB.js';
|
|
2
|
-
import { a as a$1, e } from './chunk-H7GUTAKH.js';
|
|
3
|
-
import { a as a$3, b } from './chunk-AIB3I5MO.js';
|
|
4
|
-
import { p, r, a as a$2 } from './chunk-HTXWJ57Q.js';
|
|
5
|
-
import { a as a$5 } from './chunk-GUFT6XPG.js';
|
|
6
|
-
import { a as a$6 } from './chunk-GHYF7BOH.js';
|
|
7
|
-
import { c as c$1, b as b$1 } from './chunk-HKDJJCVM.js';
|
|
8
|
-
import { c } from './chunk-V2UHZWRE.js';
|
|
9
|
-
import { a as a$4 } from './chunk-QQDMA4TE.js';
|
|
10
|
-
import { useMemo, useEffect } from 'react';
|
|
11
|
-
import _ from '@mui/material/CssBaseline';
|
|
12
|
-
import { experimental_extendTheme, lighten, darken, Experimental_CssVarsProvider } from '@mui/material/styles';
|
|
13
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
|
-
|
|
15
|
-
var s={modeStorageKey:"mui-mode",defaultMode:"light"};var F=o=>({lighter:lighten(o,.815),light:lighten(o,.225),main:o,dark:darken(o,.15),darker:darken(o,.35),contrastText:"#000"});function M(o,t,e$1=""){let m=F(t.primaryColor);a(p,"dark.palette.primary",m),a(p,"light.palette.primary",m);let i={colorSchemes:p,shadows:a$1(t.colorScheme),customShadows:r(t.colorScheme,m.main),shape:{borderRadius:8},components:a$2,typography:{...e,fontFamily:c(t.fontFamily)},cssVarPrefix:e$1,shouldSkipGeneratingVar:w},r$1=a$3(i,t),a$4={};return experimental_extendTheme(r$1,o,b(t),a$4)}function w(o,t){let e=["mixins","overlays","direction","breakpoints","cssVarPrefix","unstable_sxConfig","typography","colorSchemes"],m={global:["tonalOffset","dividerChannel","contrastThreshold"],grey:["A100","A200","A400","A700"],text:["icon"]};if(o[0]==="palette"){let r=o[1],a=m[r]||m.global;return o.some(n=>a?.includes(n))}return o.some(r=>e?.includes(r))}var G=({children:o,cssVarPrefix:t})=>{let{settings:e}=b$1(),m=useMemo(()=>{let r=M(a$5[1].systemValue,{primaryColor:e.primaryColor,colorScheme:e.colorScheme,contrast:e.contrast,navLayout:e.navLayout,navColor:e.navColor,compactLayout:e.compactLayout,fontFamily:e.fontFamily,setColorScheme:e.setColorScheme},t),a=r.colorSchemes?.[e.colorScheme]?.palette;return a&&(r.palette=a),r},[e,t]),i=useMemo(()=>({theme:m,mode:e.colorScheme,defaultMode:e.colorScheme,defaultColorScheme:e.colorScheme,modeStorageKey:s.modeStorageKey,colorSchemeStorageKey:s.modeStorageKey}),[m,e.colorScheme]);return useEffect(()=>{a$6(e.colorScheme);},[e.colorScheme]),jsxs(Experimental_CssVarsProvider,{...i,children:[jsx(_,{}),o]})},$=({children:o,cssVarPrefix:t="app",primaryColor:e="#4E5BEC",fontFamily:m="Public Sans",compactLayout:i=!0,contrast:r="default",navColor:a="integrate",navLayout:n="vertical",colorScheme:k="light"})=>{let[A,L]=a$4(s.modeStorageKey,k);return jsx(c$1,{primaryColor:e,fontFamily:m,compactLayout:i,contrast:r,navColor:a,navLayout:n,colorScheme:A,setColorScheme:L,children:jsx(G,{cssVarPrefix:t,children:o})})},ae=$;
|
|
16
|
-
|
|
17
|
-
export { M as a, ae as b };
|
package/dist/chunk-GHYF7BOH.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { b } from './chunk-HKDJJCVM.js';
|
|
2
|
-
import { useCallback, useEffect } from 'react';
|
|
3
|
-
import { useColorScheme } from '@mui/material/styles';
|
|
4
|
-
|
|
5
|
-
var i=e=>{typeof document<"u"&&document.documentElement.setAttribute("data-mui-color-scheme",e);};var S=()=>{let{mode:e,setMode:o}=useColorScheme(),{settings:{setColorScheme:m}}=b(),t=useCallback(r=>{o(r),m(r),window.location.reload();},[o,m]),n=useCallback(()=>{t(e==="light"?"dark":"light");},[e,t]);return useEffect(()=>{i(e);},[e]),{colorScheme:e,isDark:e==="dark",toggleTheme:n,setColorScheme:t}};
|
|
6
|
-
|
|
7
|
-
export { i as a, S as b };
|
package/dist/chunk-HKDJJCVM.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { createContext, memo, useContext, useMemo } from 'react';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
var u=createContext(void 0),l=()=>{let t=useContext(u);if(!t)throw new Error("useSettingsContext deve ser usado dentro de um SettingsProvider");return t},P=({children:t,primaryColor:e,fontFamily:n,compactLayout:i,colorScheme:r="light",contrast:s,navColor:o,navLayout:d,setColorScheme:g})=>{let S=useMemo(()=>({primaryColor:e,fontFamily:n,compactLayout:i,colorScheme:r,contrast:s,navColor:o,navLayout:d,setColorScheme:g}),[e,n,i,r,s,o,d,g]);return jsx(u.Provider,{value:{settings:S},children:t})},V=memo(P);
|
|
5
|
-
|
|
6
|
-
export { u as a, l as b, V as c };
|