@zydon/common 2.6.4 → 2.6.6
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.
|
@@ -5,13 +5,13 @@ import { a as a$2 } from '../../chunk-NF42ENKE.js';
|
|
|
5
5
|
import { a as a$1 } from '../../chunk-ORYAES3Q.js';
|
|
6
6
|
import _ from '@mui/material/Avatar';
|
|
7
7
|
import d from '@mui/material/Divider';
|
|
8
|
-
import
|
|
8
|
+
import c from '@mui/material/Stack';
|
|
9
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
9
10
|
import i from '@mui/material/Typography';
|
|
10
11
|
import P from '@mui/lab/LoadingButton';
|
|
11
12
|
import L from '@mui/material/Button';
|
|
12
|
-
import { styled, alpha } from '@mui/material/styles';
|
|
13
13
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var x=styled(c)({width:40,height:40,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid #1C1C1C",cursor:"pointer"}),S=styled(a)(({theme:o})=>({width:322,marginTop:20,"& .MuiPopover-paper":{width:540,padding:0,backgroundColor:o.palette.background.paper,borderRadius:o.spacing(1),backgroundImage:"none"}})),k=styled(c)(({theme:o})=>({alignItems:"center",justifyContent:"center",gap:o.spacing(1.5),padding:o.spacing(3),backgroundColor:alpha(o.palette.primary.main,.04)})),p=styled(c)(({theme:o})=>({marginLeft:o.spacing(1.75),marginRight:o.spacing(1.75),marginTop:o.spacing(2),marginBottom:o.spacing(2),gap:o.spacing(1)})),I=styled(L)(({theme:o})=>({width:"100%",alignItems:"flex-start",justifyContent:"flex-start",color:o.palette.text.primary})),h=styled(c)(({theme:o})=>({display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:o.spacing(2),cursor:"pointer"})),s=styled(c)(({theme:o})=>({alignItems:"center",gap:o.spacing(.5),color:o.palette.text.secondary,textAlign:"center","&:hover":{color:o.palette.primary.main}})),R=styled(P)(({theme:o})=>({width:"100%",alignItems:"flex-start",justifyContent:"flex-start",color:o.palette.error.main}));var j=({name:o="",email:T="",src:z,content:u,menuItems:g,subContent:y,logout:A,loadingLogout:f})=>{let m=a$1();return jsxs(Fragment,{children:[jsx(x,{"data-testid":"avatar-trigger-button",children:jsx(a$2,{alt:o,name:o,src:z,onClick:m.onOpen,"data-testid":"avatar-trigger",sx:{maxWidth:34,maxHeight:34}})}),jsxs(S,{open:m.open,onClose:m.onClose,arrow:"top-right",disableRestoreFocus:!0,"data-testid":"avatar-menu",children:[jsxs(k,{"data-testid":"avatar-account",children:[jsx(_,{sx:{bgcolor:r=>r.palette.mode==="dark"?alpha(r.palette.primary.main,.04):"success.lighter",border:r=>r.palette.mode==="dark"?"1px solid rgb(255, 252, 252)":"none",color:r=>r.palette.mode==="dark"?"primary.contrastText":"success.main",width:60,height:60},"data-testid":"avatar-initials",children:o.slice(0,2).toUpperCase()}),jsxs(c,{alignItems:"center",textAlign:"center",children:[jsx(i,{variant:"subtitle2",fontSize:"subtitle2.fontSize",color:"text.primary",children:o}),jsx(i,{variant:"body2",fontSize:"body2.fontSize",color:"text.secondary",children:T})]})]}),jsx(d,{}),u&&jsxs(Fragment,{children:[jsx(p,{"data-testid":"avatar-content",children:u}),jsx(d,{})]}),g&&jsxs(Fragment,{children:[jsx(p,{"data-testid":"avatar-menu-items",children:g.map(r=>jsx(I,{"data-testid":`avatar-menu-item-${r.label.toLowerCase().replace(/\s+/g,"-")}`,startIcon:jsx(a$3,{icon:r.icon,color:B=>B.palette.mode==="dark"?"text.secondary":"primary.main"}),...r.component&&{component:r.component,to:r.to},...r.onClick&&{onClick:r.onClick},children:jsxs(c,{direction:"row",alignItems:"center",justifyContent:"space-between",flex:1,gap:1,children:[jsx(i,{variant:"caption",fontSize:13,color:"text.secondary",children:r.label}),jsx(a$3,{icon:"ARROW_RIGHT_SIMPLE",color:"text.primary"})]})},r.label))}),jsx(d,{})]}),y&&jsxs(Fragment,{children:[jsx(p,{"data-testid":"avatar-subcontent",children:y}),jsx(d,{})]}),jsx(p,{"data-testid":"avatar-resources",children:jsxs(h,{children:[jsxs(s,{"data-testid":"resource-discord",onClick:()=>window.open("https://discord.gg/HMpBbABGVW","_blank"),children:[jsx(a$3,{icon:"DISCORD",color:"primary.main"}),jsx(i,{variant:"caption",fontSize:"caption.fontSize",children:"Comunidade"})]}),jsxs(s,{"data-testid":"resource-youtube",onClick:()=>window.open("https://youtube.com/playlist?list=PLqv8txNiT9o_LReCh5wKPiQaeBTg2Q1i3&si=3nGSAU3AdcPwoa-R","_blank","noopener noreferrer"),children:[jsx(a$3,{icon:"YOUTUBE",color:"primary.main"}),jsx(i,{variant:"caption",fontSize:"caption.fontSize",children:"Videos"})]}),jsxs(s,{"data-testid":"resource-ajuda",onClick:()=>window.open("https://ajuda.zydon.com.br","_blank","noopener noreferrer"),children:[jsx(a$3,{icon:"HELP_CIRCLE",color:"primary.main"}),jsx(i,{variant:"caption",fontSize:"caption.fontSize",children:"Ajuda"})]}),jsxs(s,{"data-testid":"resource-docs",onClick:()=>window.open("https://docs.zydon.com.br","_blank","noopener noreferrer"),children:[jsx(a$3,{icon:"CODE_FOLDER",color:"primary.main"}),jsx(i,{variant:"caption",fontSize:"caption.fontSize",children:"Docs"})]})]})}),jsx(d,{}),jsx(p,{children:jsx(R,{"data-testid":"logout-button",startIcon:jsx(a$3,{icon:"LOGOUT_02"}),size:"small",onClick:A,loading:f,children:f?"Saindo...":"Sair"})})]})]})},X=j;
|
|
16
16
|
|
|
17
|
-
export {
|
|
17
|
+
export { X as default };
|
|
@@ -16,6 +16,6 @@ import { styled } from '@mui/material/styles';
|
|
|
16
16
|
import P from '@mui/material/styles/zIndex';
|
|
17
17
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
18
18
|
|
|
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%",[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:P.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(O)(({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})),B=styled(d)(({theme:t})=>({color:t.vars.palette.text.secondary,fontSize:14,fontWeight:400,paddingBottom:24}));var D=({title:t,subtitle:l,children:I,sections:c,headerLeftContent:R,headerRightContent:z,showLeftContent:
|
|
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:P.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(O)(({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})),B=styled(d)(({theme:t})=>({color:t.vars.palette.text.secondary,fontSize:14,fontWeight:400,paddingBottom:24}));var D=({title:t,subtitle:l,children:I,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(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:x?"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:[I,c.map((o,L)=>{let m=o.id||`section-${L}`;return jsxs(w,{id:m,children:[o.title&&jsx(W,{ref:o.ref,children:o.title}),o.subTitle&&jsx(B,{children:o.subTitle}),jsx(T,{children:o.child})]},o.title||m)})]})]})]})),X=D;
|
|
20
20
|
|
|
21
21
|
export { X as default };
|