@zydon/common 2.6.13 → 2.6.14

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,6 @@
1
+ import { useCallback, useEffect } from 'react';
2
+ import { useColorScheme } from '@mui/material/styles';
3
+
4
+ var i=t=>{typeof document<"u"&&document.documentElement.setAttribute("data-mui-color-scheme",t);},S=()=>{let{mode:t,setMode:m}=useColorScheme(),o=t||"light",r=o==="dark",e=useCallback(c=>{m(c),i(c);},[m]),h=useCallback(()=>{e(r?"light":"dark");},[r,e]);return useEffect(()=>{e(o);},[o,e]),{colorScheme:o,isDark:r,toggleTheme:h,setColorScheme:e}};
5
+
6
+ export { S as a };
@@ -8,14 +8,13 @@ import '../../chunk-QQDMA4TE.js';
8
8
  import '../../chunk-Z2TDWMRU.js';
9
9
  import '../../chunk-4INDXVIX.js';
10
10
  import '../../chunk-3APKMSVD.js';
11
- import j from '@mui/material/IconButton';
11
+ import O from '@mui/material/IconButton';
12
12
  import i from '@mui/material/Stack';
13
- import d from '@mui/material/Typography';
13
+ import p from '@mui/material/Typography';
14
14
  import P from '@mui/material/Button';
15
15
  import { styled } from '@mui/material/styles';
16
- import O from '@mui/material/styles/zIndex';
17
16
  import { jsxs, jsx } from 'react/jsx-runtime';
18
17
 
19
- var S=styled(i)(({theme:t})=>({backgroundColor:t.palette.background.paper,maxWidth:300,flex:1,borderRight:`1px solid ${t.palette.divider}`,[t.breakpoints.down("md")]:{display:"none"}})),u=styled(i)({position:"sticky",top:"calc(var(--sticky-header-height, 64px))",height:"calc(100vh - var(--sticky-header-height, 64px))"}),k=styled(i)(({theme:t})=>({flex:1,width:"100%",maxWidth:"100%",[t.breakpoints.up("md")]:{"&.with-left-box":{maxWidth:"calc(100% - 300px)"}}})),y=styled(i)(({theme:t})=>({position:"sticky",top:"var(--sticky-header-height, 64px)",flexDirection:"row",alignItems:"center",backgroundColor:t.palette.background.paper,zIndex:O.appBar,width:"100%",padding:"12px 24px",height:64,gap:12,[t.breakpoints.down("md")]:{padding:"14px 16px",gap:6},borderBottom:`1px solid ${t.palette.divider}`})),C=styled(P)(({theme:t})=>({height:50,background:"none",fontSize:13,fontWeight:400,justifyContent:"flex-start",padding:"12px 8px",color:t.palette.text.secondary,borderBottom:`1px dashed ${t.palette.divider}`,borderRadius:0,gap:4,"&:hover":{backgroundColor:"transparent"},"& .required":{color:t.palette.error.main}})),p=styled(i)(({theme:t})=>({flex:1,flexDirection:"row",alignItems:"center",gap:24,"&.header-left-content":{justifyContent:"flex-start",marginLeft:12},[t.breakpoints.down("md")]:{gap:8,flex:"initial","& button, & a":{display:"flex",textIndent:"-9999em",fontSize:0,minWidth:36,maxWidth:36,height:36,width:36,overflow:"hidden","& .MuiButton-icon":{margin:"auto"}},"&.header-left-content":{justifyContent:"flex-end",marginLeft:"auto",marginRight:-6,"& label":{marginRight:0},"& .MuiTypography-root":{display:"none"}}}})),v=styled(i)(({theme:t})=>({flex:1,width:"100%",padding:24,gap:24,alignItems:"center",overflow:"hidden",[t.breakpoints.down("md")]:{padding:"24px 16px"}})),w=styled(i)(({theme:t})=>({alignItems:"start",width:"100%",maxWidth:900,[t.breakpoints.down("md")]:{maxWidth:"100%"}})),T=styled(a)(({theme:t})=>({width:"100%",borderRadius:12,gap:12,[t.breakpoints.down("md")]:{padding:"24px 16px"}})),W=styled(d)(({theme:t})=>({color:t.vars.palette.text.primary,fontSize:18,fontWeight:900})),I=styled(d)(({theme:t})=>({color:t.vars.palette.text.secondary,fontSize:14,fontWeight:400,paddingBottom:24}));var D=({title:t,subtitle:l,children:B,sections:c,headerLeftContent:R,headerRightContent:z,showLeftContent:m=!0,onClickBack:H})=>(a$1(!0),jsxs(i,{direction:"row",flex:1,children:[m&&jsx(S,{id:"frame-skeleton-left-box",children:jsx(u,{children:jsx(a$2,{fillContent:!0,sx:{p:3},children:jsxs(i,{gap:1.5,children:[jsx(d,{variant:"overline",color:"text.disabled",fontWeight:700,pl:1,children:"ACESSO R\xC1PIDO"}),jsx(i,{children:c.map(o=>jsxs(C,{onClick:()=>{o.ref.current&&o.ref.current.scrollIntoView({block:"center",behavior:"smooth"});},children:[o.title,o.isRequired&&jsx("span",{className:"required",children:"*"})]},o.title))})]})})})}),jsxs(k,{className:m?"with-left-box":"",children:[jsxs(y,{children:[jsx(j,{color:"inherit",onClick:()=>H(),"data-testid":"backToPreviousPage","aria-label":"Voltar",children:jsx(a$3,{icon:"CHEVRON_LEFT"})}),jsxs(i,{overflow:"hidden",children:[jsx(d,{variant:"subtitle1",noWrap:!0,component:"div",children:t}),l&&jsx(d,{variant:"caption",color:"text.secondary",noWrap:!0,component:"div",children:l})]}),jsx(p,{className:"header-left-content",children:R}),jsx(p,{justifyContent:"flex-end",color:"text.secondary",children:z})]}),jsxs(v,{children:[B,c.map((o,L)=>{let s=o.id||`section-${L}`;return jsxs(w,{id:s,children:[o.title&&jsx(W,{ref:o.ref,children:o.title}),o.subTitle&&jsx(I,{children:o.subTitle}),jsx(T,{children:o.child})]},o.title||s)})]})]})]})),X=D;
18
+ var S=styled(i)(({theme:t})=>({backgroundColor:t.palette.background.paper,maxWidth:300,flex:1,borderRight:`1px solid ${t.palette.divider}`,[t.breakpoints.down("md")]:{display:"none"}})),u=styled(i)({position:"sticky",top:"calc(var(--sticky-header-height, 64px))",height:"calc(100vh - var(--sticky-header-height, 64px))"}),k=styled(i)(({theme:t})=>({flex:1,width:"100%",maxWidth:"100%",[t.breakpoints.up("md")]:{"&.with-left-box":{maxWidth:"calc(100% - 300px)"}}})),y=styled(i)(({theme:t})=>({position:"sticky",top:"var(--sticky-header-height, 64px)",flexDirection:"row",alignItems:"center",backgroundColor:t.palette.background.paper,zIndex:t.zIndex.appBar,width:"100%",padding:"12px 24px",height:64,gap:12,[t.breakpoints.down("md")]:{padding:"14px 16px",gap:6},borderBottom:`1px solid ${t.palette.divider}`})),C=styled(P)(({theme:t})=>({height:50,background:"none",fontSize:13,fontWeight:400,justifyContent:"flex-start",padding:"12px 8px",color:t.palette.text.secondary,borderBottom:`1px dashed ${t.palette.divider}`,borderRadius:0,gap:4,"&:hover":{backgroundColor:"transparent"},"& .required":{color:t.palette.error.main}})),d=styled(i)(({theme:t})=>({flex:1,flexDirection:"row",alignItems:"center",gap:24,"&.header-left-content":{justifyContent:"flex-start",marginLeft:12},[t.breakpoints.down("md")]:{gap:8,flex:"initial","& button, & a":{display:"flex",textIndent:"-9999em",fontSize:0,minWidth:36,maxWidth:36,height:36,width:36,overflow:"hidden","& .MuiButton-icon":{margin:"auto"}},"&.header-left-content":{justifyContent:"flex-end",marginLeft:"auto",marginRight:-6,"& label":{marginRight:0},"& .MuiTypography-root":{display:"none"}}}})),v=styled(i)(({theme:t})=>({flex:1,width:"100%",padding:24,gap:24,alignItems:"center",overflow:"hidden",[t.breakpoints.down("md")]:{padding:"24px 16px"}})),w=styled(i)(({theme:t})=>({alignItems:"start",width:"100%",maxWidth:900,[t.breakpoints.down("md")]:{maxWidth:"100%"}})),T=styled(a)(({theme:t})=>({width:"100%",borderRadius:12,gap:12,[t.breakpoints.down("md")]:{padding:"24px 16px"}})),W=styled(p)(({theme:t})=>({color:t.palette.text.primary,fontSize:18,fontWeight:900})),I=styled(p)(({theme:t})=>({color:t.palette.text.secondary,fontSize:14,fontWeight:400,paddingBottom:24}));var j=({title:t,subtitle:l,children:B,sections:c,headerLeftContent:R,headerRightContent:z,showLeftContent:x=!0,onClickBack:H})=>(a$1(!0),jsxs(i,{direction:"row",flex:1,children:[x&&jsx(S,{id:"frame-skeleton-left-box",children:jsx(u,{children:jsx(a$2,{fillContent:!0,sx:{p:3},children:jsxs(i,{gap:1.5,children:[jsx(p,{variant:"overline",color:"text.disabled",fontWeight:700,pl:1,children:"ACESSO R\xC1PIDO"}),jsx(i,{children:c.map(o=>jsxs(C,{onClick:()=>{o.ref.current&&o.ref.current.scrollIntoView({block:"center",behavior:"smooth"});},children:[o.title,o.isRequired&&jsx("span",{className:"required",children:"*"})]},o.title))})]})})})}),jsxs(k,{className:x?"with-left-box":"",children:[jsxs(y,{children:[jsx(O,{color:"inherit",onClick:()=>H(),"data-testid":"backToPreviousPage","aria-label":"Voltar",children:jsx(a$3,{icon:"CHEVRON_LEFT"})}),jsxs(i,{overflow:"hidden",children:[jsx(p,{variant:"subtitle1",noWrap:!0,component:"div",children:t}),l&&jsx(p,{variant:"caption",color:"text.secondary",noWrap:!0,component:"div",children:l})]}),jsx(d,{className:"header-left-content",children:R}),jsx(d,{justifyContent:"flex-end",color:"text.secondary",children:z})]}),jsxs(v,{children:[B,c.map((o,L)=>{let s=o.id||`section-${L}`;return jsxs(w,{id:s,children:[o.title&&jsx(W,{ref:o.ref,children:o.title}),o.subTitle&&jsx(I,{children:o.subTitle}),jsx(T,{children:o.child})]},o.title||s)})]})]})]})),Q=j;
20
19
 
21
- export { X as default };
20
+ export { Q as default };
@@ -1,4 +1,4 @@
1
- import { a } from '../../chunk-GMX3F5ON.js';
1
+ import { a } from '../../chunk-M5VWPQ7M.js';
2
2
  import { forwardRef } from 'react';
3
3
  import r from '@mui/material/Box';
4
4
  import { styled } from '@mui/material/styles';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { a as useThemeToggle } from './chunk-GMX3F5ON.js';
1
+ export { a as useThemeToggle } from './chunk-M5VWPQ7M.js';
2
2
  export { b as ThemeProvider, a as createTheme } from './chunk-MBU4AOTJ.js';
3
3
  import './chunk-SO64ZYQB.js';
4
4
  export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-WZDEMKEC.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.6.13",
3
+ "version": "2.6.14",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -1,6 +0,0 @@
1
- import { useCallback } from 'react';
2
- import { useColorScheme } from '@mui/material/styles';
3
-
4
- var g=()=>{let{mode:t,setMode:e}=useColorScheme(),r=t||"light",o=r==="dark",h=useCallback(()=>{e(o?"light":"dark");},[o,e]),l=useCallback(c=>{e(c);},[e]);return {colorScheme:r,isDark:o,toggleTheme:h,setColorScheme:l}};
5
-
6
- export { g as a };