@zydon/common 2.5.49 → 2.5.51

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.
@@ -3,9 +3,9 @@ import { memo } from 'react';
3
3
  import d from '@mui/material/Button';
4
4
  import o from '@mui/material/Stack';
5
5
  import { useTheme } from '@mui/material/styles';
6
- import g from '@mui/material/Typography';
6
+ import u from '@mui/material/Typography';
7
7
  import { jsxs, jsx } from 'react/jsx-runtime';
8
8
 
9
- var R=r=>{switch(r){case"success":return jsx(a,{"data-testid":"icon-SUCCESS",icon:"CHECK_CIRCLE",width:120,height:120});case"error":return jsx(a,{"data-testid":"icon-ERROR",icon:"CANCEL_CIRCLE",width:120,height:120});case"info":return jsx(a,{"data-testid":"icon-INFO",icon:"INFO_CIRCLE",width:120,height:120});case"empty":default:return jsx(a,{"data-testid":"icon-DEFAULT",icon:"PACKAGE",width:120,height:120})}},L=(r,e)=>{switch(r){case"success":return e.palette.success.main;case"error":return e.palette.error.main;case"info":return e.palette.primary.main;case"empty":default:return e.palette.text.disabled}},W=({icon:r,title:e,description:i,primaryAction:p,secondaryAction:h,primaryActionLabel:u,secondaryActionLabel:f,onPrimaryAction:n,onSecondaryAction:s,primaryActionProps:C,secondaryActionProps:y,variant:m="default",iconSize:l=120,maxWidth:x=768,sx:S,...w})=>{let E=useTheme(),T=typeof e=="string"?"h3":"div",v=typeof i=="string"?"p":"div",I=L(m,E);return jsxs(o,{alignItems:"center",justifyContent:"center",spacing:3,sx:{height:"100%",textAlign:"center",py:4,px:2,...S},...w,children:[jsx(o,{sx:{color:I,"& svg":{width:l,height:l}},children:r||R(m)}),jsxs(o,{spacing:1,sx:{maxWidth:x},children:[e&&jsx(g,{component:T,variant:"h5",fontWeight:"600",color:"text.primary",sx:{mb:.5},children:e}),i&&jsx(g,{component:v,variant:"body1",color:"text.secondary",sx:{lineHeight:1.6},children:i})]}),(p||h||n||s)&&jsxs(o,{direction:"row",spacing:2,flexWrap:"wrap",justifyContent:"center",children:[h||s&&jsx(d,{variant:"outlined",color:"inherit",onClick:s,sx:{minWidth:120},...y,children:f||"Cancelar"}),p||n&&jsx(d,{variant:"contained",color:"primary",onClick:n,sx:{minWidth:120},...C,children:u||"Confirmar"})]})]})},_=memo(W);
9
+ var R=r=>{switch(r){case"success":return jsx(a,{"data-testid":"icon-SUCCESS",icon:"CHECK_CIRCLE",width:120,height:120});case"error":return jsx(a,{"data-testid":"icon-ERROR",icon:"CANCEL_CIRCLE",width:120,height:120});case"info":return jsx(a,{"data-testid":"icon-INFO",icon:"INFO_CIRCLE",width:120,height:120});case"empty":default:return jsx(a,{"data-testid":"icon-DEFAULT",icon:"PACKAGE",width:120,height:120})}},L=(r,e)=>{switch(r){case"success":return e.palette.success.main;case"error":return e.palette.error.main;case"info":return e.palette.primary.main;case"empty":default:return e.palette.text.disabled}},b=({icon:r,title:e,description:i,primaryAction:p,secondaryAction:l,primaryActionLabel:g,secondaryActionLabel:f,onPrimaryAction:n,onSecondaryAction:s,primaryActionProps:C,secondaryActionProps:y,variant:m="default",iconSize:h=120,maxWidth:x=768,sx:S,...w})=>{let E=useTheme(),T=typeof e=="string"?"h3":"div",v=typeof i=="string"?"p":"div",I=L(m,E);return jsxs(o,{alignItems:"center",justifyContent:"center",spacing:3,sx:{height:"100%",textAlign:"center",py:4,px:2,...S},...w,children:[jsx(o,{sx:{color:I,"& svg":{width:h,height:h}},children:r||R(m)}),jsxs(o,{spacing:1,sx:{maxWidth:x},children:[e&&jsx(u,{component:T,variant:"subtitle1",fontWeight:"600",color:"text.primary",sx:{mb:.5},children:e}),i&&jsx(u,{component:v,variant:"body1",color:"text.secondary",sx:{lineHeight:1.6},children:i})]}),(p||l||n||s)&&jsxs(o,{direction:"row",spacing:2,flexWrap:"wrap",justifyContent:"center",children:[l||s&&jsx(d,{variant:"outlined",color:"inherit",onClick:s,sx:{minWidth:120},...y,children:f||"Cancelar"}),p||n&&jsx(d,{variant:"contained",color:"primary",onClick:n,sx:{minWidth:120},...C,children:g||"Confirmar"})]})]})},_=memo(b);
10
10
 
11
11
  export { _ as a };
@@ -5,12 +5,13 @@ import { SectionProps } from '../../types/sectionProps.js';
5
5
  type FrameSkeletonProps = {
6
6
  title: ReactNode;
7
7
  subtitle?: ReactNode;
8
+ children?: ReactNode;
8
9
  sections: SectionProps[];
9
10
  headerLeftContent?: ReactNode;
10
11
  headerRightContent?: ReactNode;
11
12
  onClickBack: VoidFunction;
12
13
  };
13
14
 
14
- declare const FrameSkeleton: ({ title, subtitle, sections, headerLeftContent, headerRightContent, onClickBack, }: FrameSkeletonProps) => react_jsx_runtime.JSX.Element;
15
+ declare const FrameSkeleton: ({ title, subtitle, children, sections, headerLeftContent, headerRightContent, onClickBack, }: FrameSkeletonProps) => react_jsx_runtime.JSX.Element;
15
16
 
16
17
  export { FrameSkeleton as default };
@@ -2,13 +2,13 @@ import { a } from '../../chunk-CFD2VTQ3.js';
2
2
  import { a as a$1 } from '../../chunk-26GV7WKC.js';
3
3
  import { a as a$2 } from '../../chunk-24EPSBGG.js';
4
4
  import '../../chunk-WRWKHENK.js';
5
- import H from '@mui/material/IconButton';
6
- import r from '@mui/material/Stack';
5
+ import z from '@mui/material/IconButton';
6
+ import i from '@mui/material/Stack';
7
7
  import d from '@mui/material/Typography';
8
- import R from '@mui/material/Button';
8
+ import L from '@mui/material/Button';
9
9
  import { styled, alpha } from '@mui/material/styles';
10
10
  import { jsxs, jsx } from 'react/jsx-runtime';
11
11
 
12
- var h=styled(r)(({theme:t})=>({backgroundColor:"#fff",maxWidth:300,flex:1,borderRight:`1px solid ${t.palette.grey[200]}`,[t.breakpoints.down("md")]:{display:"none"}})),g=styled(r)({position:"sticky",top:"calc(var(--sticky-header-height, 64px))",height:"calc(100vh - var(--sticky-header-height, 64px))"}),S=styled(r)(({theme:t})=>({flex:1,width:"100%",[t.breakpoints.up("md")]:{maxWidth:"calc(100% - 300px)"}})),b=styled(r)(({theme:t})=>({position:"sticky",top:"var(--sticky-header-height, 64px)",flexDirection:"row",alignItems:"center",backgroundColor:"#fff",zIndex:999,width:"100%",padding:"12px 24px",height:64,gap:12,borderBottom:`1px solid ${t.palette.grey[200]}`,[t.breakpoints.down("md")]:{padding:"14px 16px",gap:6}})),k=styled(R)(({theme:t})=>({height:50,background:"none",fontSize:13,fontWeight:400,justifyContent:"flex-start",padding:"12px 8px",color:t.palette.text.secondary,borderBottom:`1px dashed ${alpha(t.palette.grey[500],.2)}`,borderRadius:0,gap:4,"&:hover":{backgroundColor:"transparent"},"& .required":{color:t.palette.error.main}})),p=styled(r)(({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"}}}})),y=styled(r)(({theme:t})=>({flex:1,width:"100%",padding:24,gap:24,alignItems:"center",overflow:"hidden",[t.breakpoints.down("md")]:{padding:"24px 16px"}})),u=styled(r)(({theme:t})=>({alignItems:"start",width:"100%",maxWidth:700,[t.breakpoints.down("md")]:{maxWidth:"100%"}})),C=styled(a)(({theme:t})=>({width:"100%",borderRadius:12,gap:12,[t.breakpoints.down("md")]:{padding:"24px 16px"}})),w=styled(d)(({theme:t})=>({color:t.palette.grey[800],fontSize:18,fontWeight:700})),v=styled(d)(({theme:t})=>({color:t.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24}));var z=({title:t,subtitle:l,sections:c,headerLeftContent:T,headerRightContent:W,onClickBack:B})=>jsxs(r,{direction:"row",flex:1,children:[jsx(h,{id:"frame-skeleton-left-box",children:jsx(g,{children:jsx(a$1,{fillContent:!0,sx:{p:3},children:jsxs(r,{gap:1.5,children:[jsx(d,{variant:"overline",color:"text.disabled",fontWeight:700,pl:1,children:"ACESSO R\xC1PIDO"}),jsx(r,{children:c.map(o=>jsxs(k,{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(S,{children:[jsxs(b,{children:[jsx(H,{color:"inherit",onClick:()=>B(),"data-testid":"backToPreviousPage","aria-label":"Voltar",children:jsx(a$2,{icon:"CHEVRON_LEFT"})}),jsxs(r,{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:T}),jsx(p,{justifyContent:"flex-end",color:"text.secondary",children:W})]}),jsx(y,{children:c.map((o,I)=>jsxs(u,{id:`section-${I}`,children:[jsx(w,{ref:o.ref,children:o.title}),jsx(v,{children:o.subTitle}),jsx(C,{children:o.child})]},o.title))})]})]}),_=z;
12
+ var h=styled(i)(({theme:t})=>({backgroundColor:"#fff",maxWidth:300,flex:1,borderRight:`1px solid ${t.palette.grey[200]}`,[t.breakpoints.down("md")]:{display:"none"}})),g=styled(i)({position:"sticky",top:"calc(var(--sticky-header-height, 64px))",height:"calc(100vh - var(--sticky-header-height, 64px))"}),S=styled(i)(({theme:t})=>({flex:1,width:"100%",[t.breakpoints.up("md")]:{maxWidth:"calc(100% - 300px)"}})),b=styled(i)(({theme:t})=>({position:"sticky",top:"var(--sticky-header-height, 64px)",flexDirection:"row",alignItems:"center",backgroundColor:"#fff",zIndex:999,width:"100%",padding:"12px 24px",height:64,gap:12,borderBottom:`1px solid ${t.palette.grey[200]}`,[t.breakpoints.down("md")]:{padding:"14px 16px",gap:6}})),k=styled(L)(({theme:t})=>({height:50,background:"none",fontSize:13,fontWeight:400,justifyContent:"flex-start",padding:"12px 8px",color:t.palette.text.secondary,borderBottom:`1px dashed ${alpha(t.palette.grey[500],.2)}`,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"}}}})),y=styled(i)(({theme:t})=>({flex:1,width:"100%",padding:24,gap:24,alignItems:"center",overflow:"hidden",[t.breakpoints.down("md")]:{padding:"24px 16px"}})),u=styled(i)(({theme:t})=>({alignItems:"start",width:"100%",maxWidth:700,[t.breakpoints.down("md")]:{maxWidth:"100%"}})),C=styled(a)(({theme:t})=>({width:"100%",borderRadius:12,gap:12,[t.breakpoints.down("md")]:{padding:"24px 16px"}})),w=styled(d)(({theme:t})=>({color:t.palette.grey[800],fontSize:18,fontWeight:700})),v=styled(d)(({theme:t})=>({color:t.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24}));var P=({title:t,subtitle:l,children:T,sections:c,headerLeftContent:W,headerRightContent:B,onClickBack:I})=>jsxs(i,{direction:"row",flex:1,children:[jsx(h,{id:"frame-skeleton-left-box",children:jsx(g,{children:jsx(a$1,{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(k,{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(S,{children:[jsxs(b,{children:[jsx(z,{color:"inherit",onClick:()=>I(),"data-testid":"backToPreviousPage","aria-label":"Voltar",children:jsx(a$2,{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:W}),jsx(p,{justifyContent:"flex-end",color:"text.secondary",children:B})]}),jsxs(y,{children:[T,c.map((o,R)=>jsxs(u,{id:`section-${R}`,children:[jsx(w,{ref:o.ref,children:o.title}),jsx(v,{children:o.subTitle}),jsx(C,{children:o.child})]},o.title))]})]})]}),G=P;
13
13
 
14
- export { _ as default };
14
+ export { G as default };
@@ -1,3 +1,3 @@
1
- export { a as default } from '../../chunk-TYJ3WV4I.js';
1
+ export { a as default } from '../../chunk-NRILCEDT.js';
2
2
  import '../../chunk-24EPSBGG.js';
3
3
  import '../../chunk-WRWKHENK.js';
@@ -1,4 +1,4 @@
1
- import { a } from '../../chunk-TYJ3WV4I.js';
1
+ import { a } from '../../chunk-NRILCEDT.js';
2
2
  import '../../chunk-24EPSBGG.js';
3
3
  import '../../chunk-WRWKHENK.js';
4
4
  import S from '@mui/material/TableCell';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.5.49",
3
+ "version": "2.5.51",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",