@zydon/common 2.5.97 → 2.5.99
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-L7SQAMJ6.js +15 -0
- package/dist/chunk-LCS5L4PW.js +7 -0
- package/dist/components/Common/index.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{settings-aa329cfb.d.ts → settings-5a31f5b8.d.ts} +2 -1
- package/dist/settings-provider-6d0238df.d.ts +18 -0
- package/dist/theme/settings-provider.d.ts +4 -26
- package/dist/theme/settings-provider.js +1 -1
- package/dist/theme/theme-provider.d.ts +8 -4
- package/dist/theme/theme-provider.js +2 -2
- package/dist/theme/with-settings/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-NRHDKX3V.js +0 -15
- package/dist/chunk-ZYXMPS3T.js +0 -8
- package/dist/theme-provider-3b94bc04.d.ts +0 -13
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a } from './chunk-SO64ZYQB.js';
|
|
2
|
+
import { a as a$3, b as b$1 } from './chunk-23D6RMEB.js';
|
|
3
|
+
import { a as a$4 } from './chunk-GUFT6XPG.js';
|
|
4
|
+
import { c as c$2, b as b$2 } from './chunk-LCS5L4PW.js';
|
|
5
|
+
import { a as a$1, e } from './chunk-IDDEVRZE.js';
|
|
6
|
+
import { p, r, a as a$2 } from './chunk-ZG4KB3ZH.js';
|
|
7
|
+
import { c as c$1 } from './chunk-SNZT4HH2.js';
|
|
8
|
+
import { useMemo } from 'react';
|
|
9
|
+
import V from '@mui/material/CssBaseline';
|
|
10
|
+
import { experimental_extendTheme, lighten, darken, Experimental_CssVarsProvider } from '@mui/material/styles';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
var c={modeStorageKey:"mui-mode",defaultMode:"light"};var A=t=>({lighter:lighten(t,.815),light:lighten(t,.225),main:t,dark:darken(t,.15),darker:darken(t,.35),contrastText:"#000"});function b(t,o,e$1=""){let m=A(o.primaryColor);a(p,"dark.palette.primary",m),a(p,"light.palette.primary",m);let i={colorSchemes:p,shadows:a$1(o.colorScheme),customShadows:r(o.colorScheme,m.main),shape:{borderRadius:8},components:a$2,typography:{...e,fontFamily:c$1(o.fontFamily)},cssVarPrefix:e$1,shouldSkipGeneratingVar:L},r$1=a$3(i,o),a$4={};return experimental_extendTheme(r$1,t,b$1(o),a$4)}function L(t,o){let e=["mixins","overlays","direction","breakpoints","cssVarPrefix","unstable_sxConfig","typography","colorSchemes"],m={global:["tonalOffset","dividerChannel","contrastThreshold"],grey:["A100","A200","A400","A700"],text:["icon"]};if(t[0]==="palette"){let r=t[1],a=m[r]||m.global;return t.some(s=>a?.includes(s))}return t.some(r=>e?.includes(r))}var E=({children:t,cssVarPrefix:o})=>{let{settings:e}=b$2(),m=useMemo(()=>{let r=b(a$4[1].systemValue,{primaryColor:e.primaryColor,colorScheme:e.colorScheme,contrast:e.contrast,navLayout:e.navLayout,navColor:e.navColor,compactLayout:e.compactLayout,fontFamily:e.fontFamily},o),a=r.colorSchemes?.[e.colorScheme]?.palette;return a&&(r.palette=a),r},[e,o]),i=useMemo(()=>({theme:m,defaultMode:e.colorScheme,defaultColorScheme:e.colorScheme,modeStorageKey:c.modeStorageKey}),[m,e.colorScheme]);return jsxs(Experimental_CssVarsProvider,{...i,children:[jsx(V,{}),t]})},w=({children:t,cssVarPrefix:o="app",primaryColor:e="#4E5BEC",fontFamily:m="Public Sans",compactLayout:i=!0,contrast:r="default",navColor:a="integrate",navLayout:s="vertical",colorScheme:M="light"})=>jsx(c$2,{primaryColor:e,fontFamily:m,compactLayout:i,contrast:r,navColor:a,navLayout:s,colorScheme:M,children:jsx(E,{cssVarPrefix:o,children:t})}),Y=w;
|
|
14
|
+
|
|
15
|
+
export { b as a, Y as b };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a } from './chunk-QQDMA4TE.js';
|
|
2
|
+
import { createContext, useContext, useMemo, useEffect } from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var d=createContext(void 0),V=()=>{let t=useContext(d);if(!t)throw new Error("useSettingsContext deve ser usado dentro de um SettingsProvider");return t},k=({children:t,primaryColor:r,fontFamily:n,compactLayout:s,colorScheme:i="light",contrast:c,navColor:S,navLayout:m})=>{let e=useMemo(()=>({primaryColor:r,fontFamily:n,compactLayout:s,colorScheme:i,contrast:c,navColor:S,navLayout:m}),[r,n,s,i,c,S,m]),[,g]=a("mui-mode",e.colorScheme),[,l]=a("mui-color-scheme-light",e.colorScheme),[,u]=a("mui-color-scheme-dark",e.colorScheme);return useEffect(()=>{g(e.colorScheme),l(e.colorScheme),u(e.colorScheme);},[e.colorScheme]),jsx(d.Provider,{value:{settings:e},children:t})};
|
|
6
|
+
|
|
7
|
+
export { d as a, V as b, k as c };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a } from '../../chunk-P26W2RT7.js';
|
|
2
2
|
import '../../chunk-QGFD5EQE.js';
|
|
3
|
-
import { b } from '../../chunk-
|
|
3
|
+
import { b } from '../../chunk-L7SQAMJ6.js';
|
|
4
4
|
import '../../chunk-SO64ZYQB.js';
|
|
5
5
|
import '../../chunk-23D6RMEB.js';
|
|
6
6
|
import '../../chunk-CFVUZ4S5.js';
|
|
7
7
|
import '../../chunk-GUFT6XPG.js';
|
|
8
|
-
import '../../chunk-
|
|
8
|
+
import '../../chunk-LCS5L4PW.js';
|
|
9
9
|
import '../../chunk-IDDEVRZE.js';
|
|
10
10
|
import '../../chunk-ZG4KB3ZH.js';
|
|
11
11
|
import { k } from '../../chunk-SNZT4HH2.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { C as CustomShadows } from './index-e650f573.js';
|
|
2
2
|
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-e650f573.js';
|
|
3
|
-
export { a as
|
|
4
|
-
export {
|
|
5
|
-
import { S as SettingsState } from './settings-
|
|
3
|
+
export { S as SettingsContextValue, a as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-6d0238df.js';
|
|
4
|
+
export { default as ThemeProvider } from './theme/theme-provider.js';
|
|
5
|
+
import { S as SettingsState } from './settings-5a31f5b8.js';
|
|
6
6
|
import { Theme as Theme$1 } from '@mui/material/styles';
|
|
7
7
|
import { a as ThemeLocaleComponents } from './types-2a4efc17.js';
|
|
8
8
|
export { BgBlurProps, BgGradientProps, BorderGradientProps, ColorWithAlpha, MaxLineProps, MediaFontSize, bgBlur, bgGradient, borderGradient, createPaletteChannel, createPaletteChannelWithAlpha, hexToRgbChannel, hexToRgbaChannel, hideScrollX, hideScrollY, maxLine, mediaQueries, menuItem, paper, pxToRem, remToPx, responsiveFontSizes, setFont, stylesMode, textGradient, varAlpha } from './theme/styles/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { b as ThemeProvider, a as createTheme } from './chunk-
|
|
1
|
+
export { b as ThemeProvider, a as createTheme } from './chunk-L7SQAMJ6.js';
|
|
2
2
|
import './chunk-SO64ZYQB.js';
|
|
3
3
|
import './chunk-23D6RMEB.js';
|
|
4
4
|
import './chunk-CFVUZ4S5.js';
|
|
5
5
|
import './chunk-GUFT6XPG.js';
|
|
6
|
-
export { c as SettingsProvider, b as useSettingsContext } from './chunk-
|
|
6
|
+
export { c as SettingsProvider, b as useSettingsContext } from './chunk-LCS5L4PW.js';
|
|
7
7
|
export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-IDDEVRZE.js';
|
|
8
8
|
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-ZG4KB3ZH.js';
|
|
9
9
|
export { q as bgBlur, p as bgGradient, o as borderGradient, i as createPaletteChannel, j as createPaletteChannelWithAlpha, g as hexToRgbChannel, h as hexToRgbaChannel, l as hideScrollX, m as hideScrollY, r as maxLine, b as mediaQueries, t as menuItem, s as paper, e as pxToRem, d as remToPx, f as responsiveFontSizes, c as setFont, a as stylesMode, n as textGradient, k as varAlpha } from './chunk-SNZT4HH2.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
type ColorScheme = 'light' | 'dark';
|
|
1
2
|
type SettingsState = {
|
|
2
3
|
primaryColor: string;
|
|
3
4
|
fontFamily: string;
|
|
4
5
|
compactLayout: boolean;
|
|
5
|
-
colorScheme:
|
|
6
|
+
colorScheme: ColorScheme;
|
|
6
7
|
contrast: 'default' | 'hight';
|
|
7
8
|
navColor: 'integrate' | 'apparent';
|
|
8
9
|
navLayout: 'vertical' | 'horizontal' | 'mini';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
4
|
+
import { S as SettingsState } from './settings-5a31f5b8.js';
|
|
5
|
+
|
|
6
|
+
interface ThemeProviderProps extends PropsWithChildren<Partial<SettingsState>> {
|
|
7
|
+
storageKey?: string;
|
|
8
|
+
cssVarPrefix?: string;
|
|
9
|
+
}
|
|
10
|
+
type SettingsContextValue = {
|
|
11
|
+
settings: SettingsState;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
declare const SettingsContext: react.Context<SettingsContextValue | undefined>;
|
|
15
|
+
declare const useSettingsContext: () => SettingsContextValue;
|
|
16
|
+
declare const SettingsProvider: ({ children, primaryColor, fontFamily, compactLayout, colorScheme, contrast, navColor, navLayout, }: PropsWithChildren<SettingsState>) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { SettingsContextValue as S, ThemeProviderProps as T, SettingsProvider as a, SettingsContext as b, useSettingsContext as u };
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type SettingsContextValue = {
|
|
7
|
-
settings: SettingsState;
|
|
8
|
-
onToggleMode: () => void;
|
|
9
|
-
onChangeMode: (mode: 'light' | 'dark') => void;
|
|
10
|
-
onChangePrimaryColor: (color: string) => void;
|
|
11
|
-
onChangeContrast: (contrast: 'default' | 'hight') => void;
|
|
12
|
-
onChangeFontFamily: (fontFamily: string) => void;
|
|
13
|
-
onChangeNavLayout: (layout: 'vertical' | 'horizontal' | 'mini') => void;
|
|
14
|
-
onChangeNavColor: (color: 'integrate' | 'apparent') => void;
|
|
15
|
-
onChangeCompactLayout: (compact: boolean) => void;
|
|
16
|
-
onResetSettings: () => void;
|
|
17
|
-
canReset: boolean;
|
|
18
|
-
};
|
|
19
|
-
declare const SettingsContext: react.Context<SettingsContextValue | undefined>;
|
|
20
|
-
declare const useSettingsContext: () => SettingsContextValue;
|
|
21
|
-
interface SettingsProviderProps extends PropsWithChildren<SettingsState> {
|
|
22
|
-
storageKey?: string;
|
|
23
|
-
}
|
|
24
|
-
declare const SettingsProvider: ({ children, storageKey, ...props }: SettingsProviderProps) => react_jsx_runtime.JSX.Element;
|
|
25
|
-
|
|
26
|
-
export { SettingsContext, SettingsContextValue, SettingsProvider, useSettingsContext };
|
|
1
|
+
import 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../settings-5a31f5b8.js';
|
|
4
|
+
export { b as SettingsContext, a as SettingsProvider, u as useSettingsContext } from '../settings-provider-6d0238df.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as SettingsContext, c as SettingsProvider, b as useSettingsContext } from '../chunk-
|
|
1
|
+
export { a as SettingsContext, c as SettingsProvider, b as useSettingsContext } from '../chunk-LCS5L4PW.js';
|
|
2
2
|
import '../chunk-QQDMA4TE.js';
|
|
3
3
|
import '../chunk-Z2TDWMRU.js';
|
|
4
4
|
import '../chunk-4INDXVIX.js';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
export { useSettingsContext } from '
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { T as ThemeProviderProps } from '../settings-provider-6d0238df.js';
|
|
3
|
+
export { u as useSettingsContext } from '../settings-provider-6d0238df.js';
|
|
4
4
|
import 'react';
|
|
5
|
-
import '../settings-
|
|
5
|
+
import '../settings-5a31f5b8.js';
|
|
6
|
+
|
|
7
|
+
declare const ThemeProvider: ({ children, cssVarPrefix, primaryColor, fontFamily, compactLayout, contrast, navColor, navLayout, colorScheme, }: ThemeProviderProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { ThemeProvider as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { b as default } from '../chunk-
|
|
1
|
+
export { b as default } from '../chunk-L7SQAMJ6.js';
|
|
2
2
|
import '../chunk-SO64ZYQB.js';
|
|
3
3
|
import '../chunk-23D6RMEB.js';
|
|
4
4
|
import '../chunk-CFVUZ4S5.js';
|
|
5
5
|
import '../chunk-GUFT6XPG.js';
|
|
6
|
-
export { b as useSettingsContext } from '../chunk-
|
|
6
|
+
export { b as useSettingsContext } from '../chunk-LCS5L4PW.js';
|
|
7
7
|
import '../chunk-IDDEVRZE.js';
|
|
8
8
|
import '../chunk-ZG4KB3ZH.js';
|
|
9
9
|
import '../chunk-SNZT4HH2.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _mui_material_styles from '@mui/material/styles';
|
|
2
2
|
import { Components, Theme } from '@mui/material/styles';
|
|
3
|
-
import { S as SettingsState } from '../../settings-
|
|
3
|
+
import { S as SettingsState } from '../../settings-5a31f5b8.js';
|
|
4
4
|
import { T as ThemeUpdateOptions } from '../../types-2a4efc17.js';
|
|
5
5
|
import '@mui/material/styles/createTypography';
|
|
6
6
|
|
package/package.json
CHANGED
package/dist/chunk-NRHDKX3V.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-SO64ZYQB.js';
|
|
2
|
-
import { a as a$3, b as b$1 } from './chunk-23D6RMEB.js';
|
|
3
|
-
import { a as a$4 } from './chunk-GUFT6XPG.js';
|
|
4
|
-
import { c as c$1, b as b$2 } from './chunk-ZYXMPS3T.js';
|
|
5
|
-
import { a as a$1, e } from './chunk-IDDEVRZE.js';
|
|
6
|
-
import { p, r, a as a$2 } from './chunk-ZG4KB3ZH.js';
|
|
7
|
-
import { c } from './chunk-SNZT4HH2.js';
|
|
8
|
-
import { useMemo } from 'react';
|
|
9
|
-
import K from '@mui/material/CssBaseline';
|
|
10
|
-
import { experimental_extendTheme, lighten, darken, Experimental_CssVarsProvider } from '@mui/material/styles';
|
|
11
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
var A=t=>({lighter:lighten(t,.815),light:lighten(t,.225),main:t,dark:darken(t,.15),darker:darken(t,.35),contrastText:"#000"});function b(t,o,e$1=""){let i=A(o.primaryColor);a(p,"dark.palette.primary",i),a(p,"light.palette.primary",i);let m={colorSchemes:p,shadows:a$1(o.colorScheme),customShadows:r(o.colorScheme,i.main),shape:{borderRadius:8},components:a$2,typography:{...e,fontFamily:c(o.fontFamily)},cssVarPrefix:e$1,shouldSkipGeneratingVar:F},r$1=a$3(m,o),a$4={};return experimental_extendTheme(r$1,t,b$1(o),a$4)}function F(t,o){let e=["mixins","overlays","direction","breakpoints","cssVarPrefix","unstable_sxConfig","typography","colorSchemes"],i={global:["tonalOffset","dividerChannel","contrastThreshold"],grey:["A100","A200","A400","A700"],text:["icon"]};if(t[0]==="palette"){let r=t[1],a=i[r]||i.global;return t.some(s=>a?.includes(s))}return t.some(r=>e?.includes(r))}var W=({children:t,cssVarPrefix:o})=>{let{settings:e}=b$2(),i=useMemo(()=>{let r=b(a$4[1].systemValue,{primaryColor:e.primaryColor,colorScheme:e.colorScheme,contrast:e.contrast,navLayout:e.navLayout,navColor:e.navColor,compactLayout:e.compactLayout,fontFamily:e.fontFamily},o),a=r.colorSchemes?.[e.colorScheme]?.palette;return a&&(r.palette=a),r},[e,o]),m=useMemo(()=>({theme:i,defaultMode:e.colorScheme,defaultColorScheme:e.colorScheme}),[i,e.colorScheme]);return jsxs(Experimental_CssVarsProvider,{...m,children:[jsx(K,{}),t]})},_=({children:t,storageKey:o="theme-settings",cssVarPrefix:e="app",primaryColor:i="#4E5BEC",fontFamily:m="Public Sans",compactLayout:r=!0,contrast:a="default",navColor:s="integrate",navLayout:L="vertical",colorScheme:h="light"})=>jsx(c$1,{primaryColor:i,fontFamily:m,compactLayout:r,contrast:a,navColor:s,navLayout:L,colorScheme:h,storageKey:`${o}-${h}`,children:jsx(W,{cssVarPrefix:e,children:t})}),Q=_;
|
|
14
|
-
|
|
15
|
-
export { b as a, Q as b };
|
package/dist/chunk-ZYXMPS3T.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-QQDMA4TE.js';
|
|
2
|
-
import { createContext, useContext, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
3
|
-
import x from 'react-fast-compare';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var y=createContext(void 0),z=()=>{let r=useContext(y);if(!r)throw new Error("useSettingsContext deve ser usado dentro de um SettingsProvider");return r},T=({children:r,storageKey:P="theme-settings",...n})=>{let[i,t]=a(P,n),L=useRef();useEffect(()=>{x(i,n)||(L.current=n,t(n));},[n,i,t]);let s=useCallback(()=>{let e=n.colorScheme==="light"?"dark":"light";t(o=>({...o,colorScheme:e}));},[n.colorScheme,t]),g=useCallback(e=>{t(o=>({...o,colorScheme:e}));},[t]),c=useCallback(e=>{t(o=>({...o,primaryColor:e}));},[t]),l=useCallback(e=>{t(o=>({...o,contrast:e}));},[t]),d=useCallback(e=>{t(o=>({...o,fontFamily:e}));},[t]),C=useCallback(e=>{t(o=>({...o,navLayout:e}));},[t]),h=useCallback(e=>{t(o=>({...o,navColor:e}));},[t]),S=useCallback(e=>{t(o=>({...o,compactLayout:e}));},[t]),u=useCallback(()=>{t(n);},[n,t]),m=useMemo(()=>x(i,n),[i,n]),R=useMemo(()=>({settings:i,onToggleMode:s,onChangeMode:g,onChangePrimaryColor:c,onChangeContrast:l,onChangeFontFamily:d,onChangeNavLayout:C,onChangeNavColor:h,onChangeCompactLayout:S,onResetSettings:u,canReset:m}),[i,s,g,c,l,d,C,h,S,u,m]);return jsx(y.Provider,{value:R,children:r})};
|
|
7
|
-
|
|
8
|
-
export { y as a, z as b, T as c };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { PropsWithChildren } from 'react';
|
|
3
|
-
import { S as SettingsState } from './settings-aa329cfb.js';
|
|
4
|
-
import './theme/settings-provider.js';
|
|
5
|
-
|
|
6
|
-
interface ThemeProviderProps extends PropsWithChildren<Partial<SettingsState>> {
|
|
7
|
-
storageKey?: string;
|
|
8
|
-
cssVarPrefix?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare const ThemeProvider: ({ children, storageKey, cssVarPrefix, primaryColor, fontFamily, compactLayout, contrast, navColor, navLayout, colorScheme, }: ThemeProviderProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { ThemeProviderProps as T, ThemeProvider as a };
|