@zydon/common 2.2.61 → 2.2.63
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.
|
@@ -6,8 +6,9 @@ interface CommonProps {
|
|
|
6
6
|
colorScheme?: 'light' | 'dark';
|
|
7
7
|
contrast?: 'default' | 'hight';
|
|
8
8
|
cssVarPrefix?: string;
|
|
9
|
+
snackbar?: boolean;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
declare const Common: ({ primaryColor, colorScheme, contrast, children, cssVarPrefix, }: PropsWithChildren<CommonProps>) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare const Common: ({ primaryColor, colorScheme, contrast, children, cssVarPrefix, snackbar, }: PropsWithChildren<CommonProps>) => react_jsx_runtime.JSX.Element;
|
|
12
13
|
|
|
13
14
|
export { Common as default };
|
|
@@ -9,14 +9,14 @@ import { a as a$1 } from '../../chunk-HBAYVRRP.js';
|
|
|
9
9
|
import '../../chunk-FCALE575.js';
|
|
10
10
|
import { LazyMotion, domMax } from 'framer-motion';
|
|
11
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
-
import
|
|
12
|
+
import h from '@mui/material/Portal';
|
|
13
13
|
import { styled } from '@mui/material/styles';
|
|
14
14
|
import { Toaster } from 'sonner';
|
|
15
15
|
import 'dayjs/locale/pt-br';
|
|
16
|
-
import
|
|
16
|
+
import $ from 'dayjs';
|
|
17
17
|
import { AdapterDayjs } from '@mui/x-date-pickers-pro/AdapterDayjs';
|
|
18
18
|
import { LocalizationProvider } from '@mui/x-date-pickers-pro/LocalizationProvider';
|
|
19
19
|
|
|
20
|
-
var c=({children:t})=>jsx(LazyMotion,{strict:!0,features:domMax,children:t});var o={root:"toaster__root",toast:"toaster__toast",title:"toaster__title",icon:"toaster__icon",iconSvg:"toaster__icon__svg",content:"toaster__content",description:"toaster__description",actionButton:"toaster__action__button",cancelButton:"toaster__cancel__button",closeButton:"toaster__close_button",loadingIcon:"toaster__loading_icon",default:"toaster__default",error:"toaster__error",success:"toaster__success",warning:"toaster__warning",info:"toaster__info",loader:"sonner-loader",loaderVisible:'&[data-visible="true"]',closeBtnVisible:'[data-close-button="true"]'};var d=styled(Toaster)(({theme:t})=>{let a={toastDefault:{padding:t.spacing(1,1,1,1.5),boxShadow:t.customShadows.z8,color:t.vars.palette.background.paper,backgroundColor:t.vars.palette.text.primary},toastColor:{padding:t.spacing(.5,1,.5,.5),boxShadow:t.customShadows.z8,color:t.vars.palette.text.primary,backgroundColor:t.vars.palette.background.paper},toastLoader:{padding:t.spacing(.5,1,.5,.5),boxShadow:t.customShadows.z8,color:t.vars.palette.text.primary,backgroundColor:t.vars.palette.background.paper}},i$1={top:0,left:0,width:"100%",height:"100%",display:"none",transform:"none",overflow:"hidden",alignItems:"center",position:"relative",borderRadius:"inherit",justifyContent:"center",background:t.vars.palette.background.neutral,[`& .${o.loadingIcon}`]:{zIndex:9,width:24,height:24,borderRadius:"50%",animation:"rotate 3s infinite linear",background:`conic-gradient(${i(t.vars.palette.text.primaryChannel,0)}, ${i(t.vars.palette.text.disabledChannel,.64)})`},[o.loaderVisible]:{display:"flex"}};return {width:300,[`& .${o.toast}`]:{gap:12,width:"100%",minHeight:52,display:"flex",borderRadius:12,alignItems:"center"},[`& .${o.content}`]:{gap:0,flex:"1 1 auto"},[`& .${o.title}`]:{fontSize:t.typography.subtitle2.fontSize},[`& .${o.description}`]:{...t.typography.caption,opacity:.64},[`& .${o.actionButton}`]:{},[`& .${o.cancelButton}`]:{},[`& .${o.closeButton}`]:{top:0,right:0,left:"auto",color:"currentColor",backgroundColor:"transparent",transform:"translate(-6px, 6px)",borderColor:i(t.vars.palette.grey["500Channel"],.16),transition:t.transitions.create(["background-color","border-color"]),"&:hover":{borderColor:i(t.vars.palette.grey["500Channel"],.24),backgroundColor:i(t.vars.palette.grey["500Channel"],.08)}},[`& .${o.icon}`]:{margin:0,width:48,height:48,alignItems:"center",borderRadius:"inherit",justifyContent:"center",alignSelf:"flex-start",[`& .${o.iconSvg}`]:{width:24,height:24,fontSize:0}},"@keyframes rotate":{to:{transform:"rotate(1turn)"}},[`& .${o.default}`]:{...a.toastDefault,[`&:has(${o.closeBtnVisible})`]:{[`& .${o.content}`]:{paddingRight:32}},[`&:has(.${o.loader})`]:a.toastLoader,[`&:has(.${o.loader})`]:a.toastLoader,[`& .${o.loader}`]:i$1},[`& .${o.error}`]:{...a.toastColor,[`& .${o.icon}`]:{color:t.vars.palette.error.main,backgroundColor:i(t.vars.palette.error.mainChannel,.08)}},[`& .${o.success}`]:{...a.toastColor,[`& .${o.icon}`]:{color:t.vars.palette.success.main,backgroundColor:i(t.vars.palette.success.mainChannel,.08)}},[`& .${o.warning}`]:{...a.toastColor,[`& .${o.icon}`]:{color:t.vars.palette.warning.main,backgroundColor:i(t.vars.palette.warning.mainChannel,.08)}},[`& .${o.info}`]:{...a.toastColor,[`& .${o.icon}`]:{color:t.vars.palette.info.main,backgroundColor:i(t.vars.palette.info.mainChannel,.08)}}}});var p=()=>jsx(
|
|
20
|
+
var c=({children:t})=>jsx(LazyMotion,{strict:!0,features:domMax,children:t});var o={root:"toaster__root",toast:"toaster__toast",title:"toaster__title",icon:"toaster__icon",iconSvg:"toaster__icon__svg",content:"toaster__content",description:"toaster__description",actionButton:"toaster__action__button",cancelButton:"toaster__cancel__button",closeButton:"toaster__close_button",loadingIcon:"toaster__loading_icon",default:"toaster__default",error:"toaster__error",success:"toaster__success",warning:"toaster__warning",info:"toaster__info",loader:"sonner-loader",loaderVisible:'&[data-visible="true"]',closeBtnVisible:'[data-close-button="true"]'};var d=styled(Toaster)(({theme:t})=>{let a={toastDefault:{padding:t.spacing(1,1,1,1.5),boxShadow:t.customShadows.z8,color:t.vars.palette.background.paper,backgroundColor:t.vars.palette.text.primary},toastColor:{padding:t.spacing(.5,1,.5,.5),boxShadow:t.customShadows.z8,color:t.vars.palette.text.primary,backgroundColor:t.vars.palette.background.paper},toastLoader:{padding:t.spacing(.5,1,.5,.5),boxShadow:t.customShadows.z8,color:t.vars.palette.text.primary,backgroundColor:t.vars.palette.background.paper}},i$1={top:0,left:0,width:"100%",height:"100%",display:"none",transform:"none",overflow:"hidden",alignItems:"center",position:"relative",borderRadius:"inherit",justifyContent:"center",background:t.vars.palette.background.neutral,[`& .${o.loadingIcon}`]:{zIndex:9,width:24,height:24,borderRadius:"50%",animation:"rotate 3s infinite linear",background:`conic-gradient(${i(t.vars.palette.text.primaryChannel,0)}, ${i(t.vars.palette.text.disabledChannel,.64)})`},[o.loaderVisible]:{display:"flex"}};return {width:300,[`& .${o.toast}`]:{gap:12,width:"100%",minHeight:52,display:"flex",borderRadius:12,alignItems:"center"},[`& .${o.content}`]:{gap:0,flex:"1 1 auto"},[`& .${o.title}`]:{fontSize:t.typography.subtitle2.fontSize},[`& .${o.description}`]:{...t.typography.caption,opacity:.64},[`& .${o.actionButton}`]:{},[`& .${o.cancelButton}`]:{},[`& .${o.closeButton}`]:{top:0,right:0,left:"auto",color:"currentColor",backgroundColor:"transparent",transform:"translate(-6px, 6px)",borderColor:i(t.vars.palette.grey["500Channel"],.16),transition:t.transitions.create(["background-color","border-color"]),"&:hover":{borderColor:i(t.vars.palette.grey["500Channel"],.24),backgroundColor:i(t.vars.palette.grey["500Channel"],.08)}},[`& .${o.icon}`]:{margin:0,width:48,height:48,alignItems:"center",borderRadius:"inherit",justifyContent:"center",alignSelf:"flex-start",[`& .${o.iconSvg}`]:{width:24,height:24,fontSize:0}},"@keyframes rotate":{to:{transform:"rotate(1turn)"}},[`& .${o.default}`]:{...a.toastDefault,[`&:has(${o.closeBtnVisible})`]:{[`& .${o.content}`]:{paddingRight:32}},[`&:has(.${o.loader})`]:a.toastLoader,[`&:has(.${o.loader})`]:a.toastLoader,[`& .${o.loader}`]:i$1},[`& .${o.error}`]:{...a.toastColor,[`& .${o.icon}`]:{color:t.vars.palette.error.main,backgroundColor:i(t.vars.palette.error.mainChannel,.08)}},[`& .${o.success}`]:{...a.toastColor,[`& .${o.icon}`]:{color:t.vars.palette.success.main,backgroundColor:i(t.vars.palette.success.mainChannel,.08)}},[`& .${o.warning}`]:{...a.toastColor,[`& .${o.icon}`]:{color:t.vars.palette.warning.main,backgroundColor:i(t.vars.palette.warning.mainChannel,.08)}},[`& .${o.info}`]:{...a.toastColor,[`& .${o.icon}`]:{color:t.vars.palette.info.main,backgroundColor:i(t.vars.palette.info.mainChannel,.08)}}}});var p=()=>jsx(h,{container:typeof window<"u"?document.getElementById("snackbar-container-provider"):null,children:jsx(d,{expand:!0,gap:12,closeButton:!0,offset:16,visibleToasts:4,position:"top-right",className:o.root,toastOptions:{unstyled:!0,classNames:{toast:o.toast,icon:o.icon,content:o.content,title:o.title,description:o.description,actionButton:o.actionButton,cancelButton:o.cancelButton,closeButton:o.closeButton,default:o.default,info:o.info,error:o.error,success:o.success,warning:o.warning}},icons:{loading:jsx("span",{className:o.loadingIcon}),info:jsx(a$1,{className:o.iconSvg,icon:"INFO_CIRCLE"}),success:jsx(a$1,{className:o.iconSvg,icon:"CHECK_CIRCLE"}),warning:jsx(a$1,{className:o.iconSvg,icon:"WARNING_TRIANGULE"}),error:jsx(a$1,{className:o.iconSvg,icon:"ALERT_CIRCLE"})}})});var k=({children:t})=>($.locale("pt-br"),jsx(LocalizationProvider,{dateAdapter:AdapterDayjs,adapterLocale:"pt-br",children:t})),u=k;var P=({primaryColor:t,colorScheme:a$1,contrast:i,children:g,cssVarPrefix:f,snackbar:m=!0})=>jsx(u,{children:jsx(a,{primaryColor:t,colorScheme:a$1,contrast:i,cssVarPrefix:f,children:jsxs(c,{children:[g,m&&jsx(p,{})]})})}),oo=P;
|
|
21
21
|
|
|
22
|
-
export {
|
|
22
|
+
export { oo as default };
|
|
@@ -11,6 +11,6 @@ import C from '@mui/material/Button';
|
|
|
11
11
|
import { styled } from '@mui/material/styles';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var s=styled(n)(({theme:t})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${t.palette.grey[300]}`,[t.breakpoints.down("sm")]:{display:"none"}})),S=styled(n)(({theme:t})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${t.palette.grey[300]}`})),h=styled(n)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),x=styled(n)(({theme:t})=>({height:"100%",width:"50%",flex:1,[t.breakpoints.down(1680)]:{width:"70%"}})),b=styled(g)(({theme:t})=>({color:t.palette.grey[800],fontSize:18,fontWeight:700})),y=styled(g)(({theme:t})=>({color:t.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),k=styled(C)(({theme:t})=>({paddingTop:6,paddingBottom:6,paddingLeft:0,margin:0,marginBottom:4,marginTop:4,width:"100%",display:"block",cursor:"pointer",color:t.palette.grey[600],textAlign:"left",fontWeight:400,fontSize:14,"> span":{color:t.palette.error.main}})),B=styled(a)(()=>({height:1,"& .simplebar-content":{height:1}})),T=styled(n)(()=>({position:"fixed",width:"202px"}));var H=({title:t,sections:l,headerLeftContent:w,headerRightContent:I,onClickBack:W})=>jsx(n,{children:jsxs(n,{direction:"row",children:[jsx(s,{id:"frame-skeleton-left-box",children:jsx(B,{children:jsxs(T,{children:[jsx(g,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO R\xC1PIDO"}),l.map((e,p)=>jsxs(n,{children:[jsxs(k,{onClick:()=>{e.ref.current&&e.ref.current.scrollIntoView({block:"start",behavior:"smooth"});},children:[e.title,e.isRequired&&jsx("span",{children:"*"})]}),p<l.length-1&&jsx(v,{})]},p))]})})}),jsxs(n,{width:"100%",alignItems:"center",mb:8,children:[jsx(S,{children:jsxs(h,{children:[jsxs(n,{flexDirection:"row",gap:2,alignItems:"center",children:[jsx(F,{color:"primary",onClick:()=>W(),children:jsx(a$1,{icon:"CHEVRON_LEFT"})}),jsx(g,{variant:"h4",children:t}),w]}),jsxs(n,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[jsx(a$2,{sx:{display:{xs:"none",sm:"flex"}},disabled:!0}),I]})]})}),jsx(x,{children:l.map((e,p)=>jsxs(n,{paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",id:`section-${p}`,children:[jsx(b,{ref:e.ref,children:e.title}),jsx(y,{children:e.subTitle}),jsx(a$3,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:e.child})]},e.title))})]})]})}),_=H;
|
|
15
15
|
|
|
16
16
|
export { _ as default };
|