@zydon/common 2.0.5 → 2.0.7

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.
Files changed (32) hide show
  1. package/dist/chunk-DCTTK6ND.mjs +10 -0
  2. package/dist/components/SeoPreview/index.d.ts +25 -0
  3. package/dist/components/SeoPreview/index.mjs +13 -0
  4. package/dist/components/SplashScreen/index.d.ts +7 -0
  5. package/dist/components/SplashScreen/index.mjs +8 -0
  6. package/dist/components/Steps/index.d.ts +12 -0
  7. package/dist/components/Steps/index.mjs +14 -0
  8. package/dist/components/StyledTab/index.d.ts +8 -2
  9. package/dist/components/StyledTabs/index.d.ts +6 -1
  10. package/dist/components/Summary/index.d.ts +15 -0
  11. package/dist/components/Summary/index.mjs +8 -0
  12. package/dist/components/SwapList/index.d.ts +21 -2
  13. package/dist/components/SwapList/index.mjs +9 -7
  14. package/dist/components/TextMaxLine/index.mjs +2 -10
  15. package/dist/components/form/DatePicker/index.d.ts +2 -1
  16. package/dist/components/form/DatePicker/index.mjs +2 -2
  17. package/dist/components/form/DateRangePicker/index.d.ts +7 -1
  18. package/dist/components/form/DateRangePicker/index.mjs +3 -3
  19. package/dist/components/form/DateTimePicker/index.d.ts +2 -1
  20. package/dist/components/form/DateTimePicker/index.mjs +2 -2
  21. package/dist/components/form/TimePicker/index.d.ts +2 -1
  22. package/dist/components/form/TimePicker/index.mjs +1 -1
  23. package/package.json +1 -1
  24. package/dist/chunk-MAKO5GLN.mjs +0 -7
  25. package/dist/components/StyledTab/props.d.ts +0 -10
  26. package/dist/components/StyledTab/props.mjs +0 -1
  27. package/dist/components/StyledTabs/props.d.ts +0 -8
  28. package/dist/components/StyledTabs/props.mjs +0 -1
  29. package/dist/components/SwapList/props.d.ts +0 -23
  30. package/dist/components/SwapList/props.mjs +0 -1
  31. package/dist/components/SwapList/styles.d.ts +0 -16
  32. package/dist/components/SwapList/styles.mjs +0 -1
@@ -0,0 +1,10 @@
1
+ import { a } from './chunk-D7XCMUMB.mjs';
2
+ import { forwardRef } from 'react';
3
+ import u from '@mui/material/Link';
4
+ import T from '@mui/material/Typography';
5
+ import { useTheme } from '@mui/material/styles';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ function x(o){return Math.round(parseFloat(o)*16)}function y(o){let e=useTheme(),t=a(),p=e.breakpoints.up(t==="xl"?"lg":t),h=(o==="h1"||o==="h2"||o==="h3"||o==="h4"||o==="h5"||o==="h6")&&e.typography[o][p]?e.typography[o][p]:e.typography[o],r=x(h.fontSize),i=Number(e.typography[o].lineHeight)*r,{fontWeight:f,letterSpacing:n}=e.typography[o];return {fontSize:r,lineHeight:i,fontWeight:f,letterSpacing:n}}var g=forwardRef(({asLink:o,variant:e="body1",line:t=2,persistent:p=!1,children:s,sx:h,...r},i)=>{let{lineHeight:f}=y(e),n={overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:t,WebkitBoxOrient:"vertical",...p&&{height:f*t},...h};return o?jsx(u,{color:"inherit",ref:i,variant:e,sx:{...n},...r,children:s}):jsx(T,{ref:i,variant:e,sx:{...n},...r,children:s})});g.displayName="TextMaxLine";var W=g;
9
+
10
+ export { W as a };
@@ -0,0 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface CustomTitles {
5
+ title: string;
6
+ description?: string;
7
+ }
8
+ interface SeoPreviewProps {
9
+ titlePreview?: string;
10
+ logoImage?: string;
11
+ brandingName?: string;
12
+ url?: string;
13
+ title?: string;
14
+ description?: string;
15
+ keyWords?: string[];
16
+ customTitles?: CustomTitles[];
17
+ productImage?: string;
18
+ child?: ReactNode;
19
+ hasPreviewLink?: boolean;
20
+ previewLinkImage?: string;
21
+ }
22
+
23
+ declare const SeoPreview: ({ titlePreview, logoImage, brandingName, url, title, description, keyWords, customTitles, productImage, child, previewLinkImage, hasPreviewLink, }: SeoPreviewProps) => react_jsx_runtime.JSX.Element;
24
+
25
+ export { SeoPreview as default };
@@ -0,0 +1,13 @@
1
+ import { a as a$1 } from '../../chunk-DCTTK6ND.mjs';
2
+ import { a } from '../../chunk-QHCGLZFD.mjs';
3
+ import '../../chunk-KLIYANST.mjs';
4
+ import '../../chunk-D7XCMUMB.mjs';
5
+ import p from '@mui/material/Box';
6
+ import t from '@mui/material/Stack';
7
+ import i from '@mui/material/Typography';
8
+ import { styled } from '@mui/material/styles';
9
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
+
11
+ var k=styled(p)(({theme:a})=>({padding:24,borderRadius:8,height:"auto",maxWidth:800,backgroundColor:a.palette.background.default,border:`1px solid ${a.palette.grey[300]}`})),P=styled(t)(({theme:a})=>({minHeight:180,maxWidth:700,border:`4px dotted ${a.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff",padding:24})),I=styled(p)(()=>({maxWidth:70,maxHeight:40,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),B=styled(p)(({theme:a})=>({backgroundColor:a.palette.background.default,maxWidth:90,maxHeight:80,alignItems:"center","&, img":{flex:1,display:"flex",objectFit:"cover",borderRadius:8}})),v=styled(t)(({theme:a})=>({border:`4px dotted ${a.palette.grey[300]}`,borderRadius:8,backgroundColor:"#fff"})),S=styled(p)(({theme:a})=>({width:"auto",height:120,overflow:"hidden",padding:2,borderBottom:`4px dotted ${a.palette.grey[300]}`}));var E=({titlePreview:a$2,logoImage:l,brandingName:L,url:g,title:m,description:x,keyWords:h,customTitles:y,productImage:u,child:C,previewLinkImage:b,hasPreviewLink:T})=>jsx(k,{children:jsxs(t,{gap:3,display:"flex",flex:1,children:[jsx(i,{variant:"overline",color:"text.disabled",children:a$2??"PR\xC9-VISUALIZA\xC7\xC3O"}),jsxs(P,{children:[jsxs(t,{direction:"row",pb:3,gap:.5,children:[jsx(p,{height:0,width:10,children:jsx(a,{icon:"CIRCLE",width:30,color:"error.main"})}),jsx(p,{height:0,width:10,children:jsx(a,{icon:"CIRCLE",width:30,color:"warning.main"})}),jsx(p,{height:0,width:10,children:jsx(a,{icon:"CIRCLE",width:30,color:"success.main"})})]}),jsxs(t,{flexDirection:"row",gap:2,justifyContent:"space-between",children:[jsxs(t,{gap:1,width:"100%",children:[jsxs(t,{direction:"row",gap:1.5,pb:.5,children:[l&&jsx(I,{children:jsx("img",{alt:"Logo",src:l})}),jsxs(t,{children:[jsx(i,{variant:"overline",color:"grey.600",pb:.5,children:L??"SUAEMPRESA"}),jsxs(t,{direction:"row",gap:2,children:[jsx(i,{variant:"caption",color:"grey.600",children:g??"https://www.exemplo.com"}),jsx(a,{icon:"MORE_OPTIONS_VERTICAL",width:15,color:"grey.500"})]})]})]}),jsx(a$1,{variant:"subtitle1",color:"#4E5BEC",overflow:"hidden",textOverflow:"ellipsis",line:5,children:m??"Suampresa | P\xE1scoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),jsx(a$1,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:5,children:x??"A P\xE1scoa chegou e a Sua Empresa est\xE1 com ofertas chocantes em tecnologia! Descontos de at\xE9 50% em notebooks, smartphones, tablets e muito mais!"}),h&&jsx(t,{direction:"row",gap:1,alignItems:"center",children:h.map((s,w)=>jsxs(Fragment,{children:[jsx(i,{variant:"caption",color:"text.disabled",children:s}),w<h.length-1&&jsx(p,{width:4,height:16,children:jsx(a,{icon:"CIRCLE",color:"text.disabled",width:10})})]}))}),y&&jsx(t,{pt:2,children:y.map((s,w)=>jsxs(t,{gap:1,children:[jsx(i,{variant:"subtitle1",color:"#4E5BEC",children:s.title}),jsx(a$1,{variant:"caption",color:"text.disabled",overflow:"hidden",textOverflow:"ellipsis",line:1,children:s.description??"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys stansince the 1500"})]},w))}),C]}),u&&jsx(B,{children:jsx("img",{alt:"ProductImage",src:u})})]})]}),T&&jsxs(t,{gap:3,display:"flex",flex:1,width:"100%",children:[jsx(i,{variant:"overline",color:"text.disabled",children:"pr\xE9-visualiza\xE7\xE3o link de compartilhamento".toUpperCase()}),jsxs(v,{children:[b&&jsx(S,{children:jsx("img",{alt:"PreviewLinkImage",src:b,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:8}})}),jsxs(t,{gap:.2,p:2,width:"100%",children:[jsx(i,{variant:"caption",children:m??"Suampresa | P\xE1scoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),jsx(i,{variant:"caption",color:"grey.600",children:x??"A P\xE1scoa chegou e a Sua Empresa est\xE1 com ofertas chocantes em tecnologia! Descontos de at\xE9 50% em notebooks, smartphones, tablets e muito mais!"}),jsx(i,{variant:"caption",color:"grey.500",children:g??"https://www.exemplo.com"})]})]}),jsx(v,{children:jsxs(t,{direction:"row",gap:1,alignItems:"center",children:[jsx(p,{width:100,height:95,bgcolor:"grey.100",p:.5,alignItems:"center",children:jsx("img",{alt:"Logo",src:l,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:8}})}),jsxs(t,{padding:1,gap:.2,width:"80%",children:[jsx(a$1,{variant:"caption",children:m??"Suampresa | P\xE1scoa 2024: Ovos de chocolate? Que nada! Descontos em tecnologia!"}),jsx(a$1,{variant:"caption",color:"grey.600",children:x??"A P\xE1scoa chegou e a Sua Empresa est\xE1 com ofertas chocantes em tecnologia! Descontos de at\xE9 50% em notebooks, smartphones, tablets e muito mais!"}),jsx(a$1,{variant:"caption",color:"grey.500",line:1,children:g??"https://www.exemplo.com"})]})]})})]})]})}),V=E;
12
+
13
+ export { V as default };
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PropsWithChildren } from 'react';
3
+ import { BoxProps } from '@mui/material/Box';
4
+
5
+ declare const SplashScreen: ({ children, sx, ...other }: PropsWithChildren<BoxProps>) => react_jsx_runtime.JSX.Element;
6
+
7
+ export { SplashScreen as default };
@@ -0,0 +1,8 @@
1
+ import { i } from '../../chunk-S6AXG7VS.mjs';
2
+ import e from '@mui/material/Box';
3
+ import { m } from 'framer-motion';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ var p=({children:s,sx:r,...n})=>jsx(e,{sx:{overflow:"hidden"},children:jsx(e,{sx:{right:0,width:1,bottom:0,height:1,zIndex:9998,display:"flex",position:"fixed",alignItems:"center",justifyContent:"center",bgcolor:"background.default",...r},...n,children:jsxs(e,{sx:{width:120,height:120,alignItems:"center",position:"relative",display:"inline-flex",justifyContent:"center",...r},...n,children:[jsx(e,{component:m.div,animate:{scale:[1,.9,.9,1,1],opacity:[1,.48,.48,1,1]},transition:{duration:2,repeatDelay:1,repeat:1/0,ease:"easeInOut"},sx:{display:"inline-flex"},children:s}),jsx(e,{component:m.div,animate:{scale:[1.6,1,1,1.6,1.6],rotate:[270,0,0,270,270],opacity:[.25,1,1,1,.25],borderRadius:["25%","25%","50%","50%","25%"]},transition:{ease:"linear",duration:3.2,repeat:1/0},sx:{position:"absolute",width:"calc(100% - 20px)",height:"calc(100% - 20px)",border:i$1=>`solid 3px ${i(i$1.vars.palette.primary.darkChannel,.24)}`}}),jsx(e,{component:m.div,animate:{scale:[1,1.2,1.2,1,1],rotate:[0,270,270,0,0],opacity:[1,.25,.25,.25,1],borderRadius:["25%","25%","50%","50%","25%"]},transition:{ease:"linear",duration:3.2,repeat:1/0},sx:{width:1,height:1,position:"absolute",border:i$1=>`solid 8px ${i(i$1.vars.palette.primary.darkChannel,.24)}`}})]})})}),h=p;
7
+
8
+ export { h as default };
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { StepperProps } from '@mui/material/Stepper';
3
+
4
+ interface StepsProps extends StepperProps {
5
+ activeStep: number;
6
+ steps: string[];
7
+ showLabels?: boolean;
8
+ }
9
+
10
+ declare const Steps: ({ steps, activeStep, showLabels, sx, ...other }: StepsProps) => react_jsx_runtime.JSX.Element;
11
+
12
+ export { Steps as default };
@@ -0,0 +1,14 @@
1
+ import { a } from '../../chunk-QHCGLZFD.mjs';
2
+ import '../../chunk-KLIYANST.mjs';
3
+ import s from '@mui/material/Box';
4
+ import S from '@mui/material/Stack';
5
+ import d from '@mui/material/Step';
6
+ import f from '@mui/material/StepLabel';
7
+ import u from '@mui/material/Stepper';
8
+ import l from '@mui/material/StepConnector';
9
+ import { styled } from '@mui/material/styles';
10
+ import { jsx } from 'react/jsx-runtime';
11
+
12
+ var i=styled(l)(({theme:o})=>({top:10,left:"calc(-50% + 20px)",right:"calc(50% + 20px)","& .MuiStepConnector-line":{borderTopWidth:2,borderColor:o.palette.divider},"&.Mui-active, &.Mui-completed":{"& .MuiStepConnector-line":{borderColor:o.palette.primary.main}}}));var C=({active:o,completed:e})=>jsx(S,{alignItems:"center",justifyContent:"center",sx:{width:24,height:24,color:"text.disabled",...o&&{color:"primary.main"}},children:e?jsx(a,{icon:"SIMPLE_CHECK",color:"primary.main"}):jsx(s,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:"currentColor"}})}),b=({steps:o,activeStep:e,showLabels:n=!0,sx:c,...a})=>jsx(u,{alternativeLabel:!0,activeStep:e,connector:jsx(i,{}),sx:c,...a,children:o.map(r=>jsx(d,{children:jsx(f,{StepIconComponent:C,sx:{"& .MuiStepLabel-label":{typography:"subtitle2"}},children:n&&r})},r))}),w=b;
13
+
14
+ export { w as default };
@@ -1,8 +1,14 @@
1
1
  import * as _emotion_styled from '@emotion/styled';
2
2
  import * as _mui_system from '@mui/system';
3
3
  import * as _mui_material_styles from '@mui/material/styles';
4
- import { StyledTabProps } from './props.js';
5
- import 'react';
4
+ import { ReactNode } from 'react';
5
+
6
+ interface StyledTabProps {
7
+ hasChanges?: boolean;
8
+ icon: ReactNode;
9
+ label: ReactNode;
10
+ onClose: VoidFunction;
11
+ }
6
12
 
7
13
  declare const StyledTab: _emotion_styled.StyledComponent<StyledTabProps & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
8
14
 
@@ -2,7 +2,12 @@ import * as _emotion_styled from '@emotion/styled';
2
2
  import * as _mui_system from '@mui/system';
3
3
  import * as _mui_material_styles from '@mui/material/styles';
4
4
  import * as react from 'react';
5
- import { StyledTabsProps } from './props.js';
5
+ import { SyntheticEvent } from 'react';
6
+
7
+ interface StyledTabsProps {
8
+ value: number;
9
+ onChange: (event: SyntheticEvent, newValue: number) => void;
10
+ }
6
11
 
7
12
  declare const StyledTabs: _emotion_styled.StyledComponent<StyledTabsProps & {
8
13
  children?: react.ReactNode;
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import { StackProps } from '@mui/material/Stack';
4
+
5
+ interface SummaryProps extends StackProps {
6
+ data: {
7
+ id: string;
8
+ label: ReactNode;
9
+ value?: ReactNode;
10
+ }[];
11
+ }
12
+
13
+ declare const Summary: ({ data, ...other }: SummaryProps) => react_jsx_runtime.JSX.Element | null;
14
+
15
+ export { Summary as default };
@@ -0,0 +1,8 @@
1
+ import n from '@mui/material/Stack';
2
+ import { styled } from '@mui/material/styles';
3
+ import a from '@mui/material/Typography';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ var l=styled(n)({display:"grid",gridTemplateColumns:"auto auto"}),p=styled(a)(({theme:e})=>({color:e.palette.grey[600],display:"flex",gap:"8px",alignItems:"center"})),i=styled(a)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]}));var u=({data:e,...m})=>e.length===0?null:jsx(l,{gap:1,...m,children:e.map(r=>[jsx(p,{variant:"body2",children:r.label},`label:${r.id}`),jsx(i,{variant:"body2",children:r.value},`value:${r.id}`)])}),c=u;
7
+
8
+ export { c as default };
@@ -1,6 +1,25 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { SwapListProps } from './props.js';
3
- import 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface Item {
5
+ id: string;
6
+ name: string;
7
+ label: ReactNode;
8
+ }
9
+ interface SwapListProps {
10
+ selectedItems: Item[];
11
+ items: Item[];
12
+ loading: boolean;
13
+ searchText: string;
14
+ onAdd(list: Item[]): void;
15
+ onRemove(list: Item[]): void;
16
+ search: string | undefined;
17
+ onSearch(value: string | undefined): void;
18
+ itemsTitle: ReactNode;
19
+ selectedItemsTitle: ReactNode;
20
+ additionalContent?: ReactNode;
21
+ enableSearchInSelectedItems?: boolean;
22
+ }
4
23
 
5
24
  declare const SwapList: ({ selectedItems, items, loading, searchText, onAdd, onRemove, search, itemsTitle, selectedItemsTitle, additionalContent, enableSearchInSelectedItems, onSearch, }: SwapListProps) => react_jsx_runtime.JSX.Element;
6
25
 
@@ -1,20 +1,22 @@
1
- import { b, a as a$4 } from '../../chunk-MAKO5GLN.mjs';
2
1
  import { a } from '../../chunk-OUPUY4L2.mjs';
3
2
  import { a as a$1 } from '../../chunk-2ZLS7IUJ.mjs';
4
3
  import { a as a$2 } from '../../chunk-WHA7HOMZ.mjs';
5
4
  import { a as a$3 } from '../../chunk-SXVKHA6L.mjs';
6
5
  import '../../chunk-MUAMRRNL.mjs';
7
- import { a as a$5 } from '../../chunk-QHCGLZFD.mjs';
6
+ import { a as a$4 } from '../../chunk-QHCGLZFD.mjs';
8
7
  import '../../chunk-KLIYANST.mjs';
9
8
  import { useState } from 'react';
10
- import m from '@mui/material/Checkbox';
11
- import F from '@mui/material/CircularProgress';
12
- import h from '@mui/material/Divider';
9
+ import h from '@mui/material/Checkbox';
10
+ import T from '@mui/material/CircularProgress';
11
+ import f from '@mui/material/Divider';
13
12
  import o from '@mui/material/Stack';
14
13
  import S from '@mui/material/Typography';
15
14
  import { debounce } from '@mui/material/utils';
15
+ import Q from '@mui/material/Box';
16
+ import U from '@mui/material/Button';
17
+ import { styled } from '@mui/material/styles';
16
18
  import { jsx, jsxs } from 'react/jsx-runtime';
17
19
 
18
- var Q=({selectedItems:f,items:R,loading:L,searchText:g,onAdd:T,onRemove:D,search:P,itemsTitle:z,selectedItemsTitle:B,additionalContent:W,enableSearchInSelectedItems:$,onSearch:H})=>{let[A,K]=useState(""),N=debounce(H,400),c=R.filter(e=>!f.some(n=>n.id===e.id)),_=f.filter(e=>e.name?.toLowerCase().includes(A.toLowerCase())),s=$?_:R.filter(e=>f.some(n=>n.id===e.id)),[r,d]=useState([]),[i,p]=useState([]),M=()=>{T(r),d([]);},O=()=>{D(i),p([]);},j=e=>{p(e?s:[]);},G=e=>{d(e?c:[]);},V=(e,n)=>{p(n?l=>[...l,e]:l=>l.filter(k=>k.id!==e.id));},q=(e,n)=>{d(n?l=>[...l,e]:l=>l.filter(k=>k.id!==e.id));},E=e=>{e.key==="Enter"&&e.preventDefault();};return jsx(o,{children:jsxs(o,{direction:"row",alignItems:"center",gap:3,children:[jsx(b,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(m,{size:"small",indeterminate:r.length>0&&r.length!==c.length,checked:r.length>0&&r.length===c.length,onChange:e=>G(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${z} cadastrados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${r.length}/${c.length} selecionados`})]})]}),jsx(h,{}),jsxs(o,{p:2,flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,children:[jsx(a,{iconPosition:"start",placeholder:"Buscar",onKeyDown:E,size:"small",fullWidth:!0,trigger:"change",onSearch:e=>N(e)}),W]}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(F,{})}),isEmpty:c.length===0,empty:jsx(a$2,{text:P?`Nenhum ${g} encontrado`:`Nenhum ${g} dispon\xEDvel`,sx:{svg:{height:140}}}),children:jsx(a$3,{sx:{maxHeight:280},children:c.map(e=>jsxs(o,{gap:1,marginTop:"8px",children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(m,{size:"small",checked:r.includes(e),onChange:n=>q(e,n.target.checked)}),e.label]}),jsx(h,{})]},e.id))})})]})]})}),jsxs(o,{gap:3,children:[jsx(a$4,{variant:"outlined",onClick:M,children:jsx(a$5,{icon:"ARROW_RIGHT_SIMPLE"})}),jsx(a$4,{variant:"outlined",onClick:O,children:jsx(a$5,{icon:"ARROW_LEFT_SIMPLE"})})]}),jsx(b,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(m,{size:"small",indeterminate:i.length>0&&i.length!==s.length,checked:i.length>0&&i.length===s.length,onChange:e=>j(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${B} selecionados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${i.length}/${s.length} selecionados`})]})]}),jsx(h,{}),jsxs(o,{p:2,gap:1,overflow:"hidden",children:[$&&jsx(a,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:e=>K(e??""),onKeyDown:E}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(F,{})}),isEmpty:s.length===0,empty:jsx(a$2,{text:A?`Nenhum ${g} encontrado`:`Nenhum ${g} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:jsx(a$3,{sx:{maxHeight:280},children:s.map(e=>jsxs(o,{gap:1,children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(m,{size:"small",checked:i.includes(e),onChange:n=>V(e,n.target.checked)}),e.label]}),jsx(h,{})]},e.id))})})]})]})})]})})},de=Q;
20
+ var b=styled(U)(({theme:n})=>({borderColor:n.palette.grey[300]})),C=styled(Q)(({theme:n})=>({display:"flex",border:`1.5px solid ${n.palette.grey[300]}`,height:450,borderRadius:8,flex:1,overflow:"hidden"}));var Y=({selectedItems:n,items:R,loading:L,searchText:g,onAdd:B,onRemove:D,search:P,itemsTitle:z,selectedItemsTitle:W,additionalContent:H,enableSearchInSelectedItems:$,onSearch:K})=>{let[A,N]=useState(""),_=debounce(K,400),d=R.filter(e=>!n.some(a=>a.id===e.id)),M=n.filter(e=>e.name?.toLowerCase().includes(A.toLowerCase())),s=$?M:R.filter(e=>n.some(a=>a.id===e.id)),[i,p]=useState([]),[l,m]=useState([]),O=()=>{B(i),p([]);},j=()=>{D(l),m([]);},G=e=>{m(e?s:[]);},V=e=>{p(e?d:[]);},q=(e,a)=>{m(a?c=>[...c,e]:c=>c.filter(k=>k.id!==e.id));},J=(e,a)=>{p(a?c=>[...c,e]:c=>c.filter(k=>k.id!==e.id));},E=e=>{e.key==="Enter"&&e.preventDefault();};return jsx(o,{children:jsxs(o,{direction:"row",alignItems:"center",gap:3,children:[jsx(C,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(h,{size:"small",indeterminate:i.length>0&&i.length!==d.length,checked:i.length>0&&i.length===d.length,onChange:e=>V(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${z} cadastrados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${i.length}/${d.length} selecionados`})]})]}),jsx(f,{}),jsxs(o,{p:2,flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,children:[jsx(a,{iconPosition:"start",placeholder:"Buscar",onKeyDown:E,size:"small",fullWidth:!0,trigger:"change",onSearch:e=>_(e)}),H]}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(T,{})}),isEmpty:d.length===0,empty:jsx(a$2,{text:P?`Nenhum ${g} encontrado`:`Nenhum ${g} dispon\xEDvel`,sx:{svg:{height:140}}}),children:jsx(a$3,{sx:{maxHeight:280},children:d.map(e=>jsxs(o,{gap:1,marginTop:"8px",children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(h,{size:"small",checked:i.includes(e),onChange:a=>J(e,a.target.checked)}),e.label]}),jsx(f,{})]},e.id))})})]})]})}),jsxs(o,{gap:3,children:[jsx(b,{variant:"outlined",onClick:O,children:jsx(a$4,{icon:"ARROW_RIGHT_SIMPLE"})}),jsx(b,{variant:"outlined",onClick:j,children:jsx(a$4,{icon:"ARROW_LEFT_SIMPLE"})})]}),jsx(C,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(h,{size:"small",indeterminate:l.length>0&&l.length!==s.length,checked:l.length>0&&l.length===s.length,onChange:e=>G(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${W} selecionados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${l.length}/${s.length} selecionados`})]})]}),jsx(f,{}),jsxs(o,{p:2,gap:1,overflow:"hidden",children:[$&&jsx(a,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:e=>N(e??""),onKeyDown:E}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(T,{})}),isEmpty:s.length===0,empty:jsx(a$2,{text:A?`Nenhum ${g} encontrado`:`Nenhum ${g} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:jsx(a$3,{sx:{maxHeight:280},children:s.map(e=>jsxs(o,{gap:1,children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(h,{size:"small",checked:l.includes(e),onChange:a=>q(e,a.target.checked)}),e.label]}),jsx(f,{})]},e.id))})})]})]})})]})})},ke=Y;
19
21
 
20
- export { de as default };
22
+ export { ke as default };
@@ -1,10 +1,2 @@
1
- import { a } from '../../chunk-D7XCMUMB.mjs';
2
- import { forwardRef } from 'react';
3
- import u from '@mui/material/Link';
4
- import T from '@mui/material/Typography';
5
- import { useTheme } from '@mui/material/styles';
6
- import { jsx } from 'react/jsx-runtime';
7
-
8
- function x(o){return Math.round(parseFloat(o)*16)}function y(o){let e=useTheme(),t=a(),p=e.breakpoints.up(t==="xl"?"lg":t),h=(o==="h1"||o==="h2"||o==="h3"||o==="h4"||o==="h5"||o==="h6")&&e.typography[o][p]?e.typography[o][p]:e.typography[o],r=x(h.fontSize),i=Number(e.typography[o].lineHeight)*r,{fontWeight:f,letterSpacing:n}=e.typography[o];return {fontSize:r,lineHeight:i,fontWeight:f,letterSpacing:n}}var g=forwardRef(({asLink:o,variant:e="body1",line:t=2,persistent:p=!1,children:s,sx:h,...r},i)=>{let{lineHeight:f}=y(e),n={overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:t,WebkitBoxOrient:"vertical",...p&&{height:f*t},...h};return o?jsx(u,{color:"inherit",ref:i,variant:e,sx:{...n},...r,children:s}):jsx(T,{ref:i,variant:e,sx:{...n},...r,children:s})});g.displayName="TextMaxLine";var W=g;
9
-
10
- export { W as default };
1
+ export { a as default } from '../../chunk-DCTTK6ND.mjs';
2
+ import '../../chunk-D7XCMUMB.mjs';
@@ -5,11 +5,12 @@ import { Dayjs } from 'dayjs';
5
5
  import { BaseField } from '../../../types/baseField.js';
6
6
  import 'react-hook-form';
7
7
 
8
- type DatePickerProps = BaseField<Omit<DatePickerProps$1<Dayjs>, 'value'>> & {
8
+ type DatePickerProps = BaseField<Omit<DatePickerProps$1<Dayjs>, 'value' | 'onChange'>> & {
9
9
  tabIndex?: number;
10
10
  helperText?: ReactNode;
11
11
  required?: boolean;
12
12
  value?: Date | null | undefined;
13
+ onChange(value: Date | null | undefined): void;
13
14
  };
14
15
 
15
16
  declare const DatePicker: ({ name, rules, tabIndex, helperText, required, ...other }: DatePickerProps) => react_jsx_runtime.JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
2
  import { DatePicker } from '@mui/x-date-pickers-pro';
3
- import k from 'dayjs';
3
+ import C from 'dayjs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var d=({name:p,rules:s,tabIndex:t,helperText:i,required:n,...o})=>{let{control:u}=useFormContext();return jsx(Controller,{name:p,control:u,rules:s,render:({field:{ref:m,onChange:f,...e},fieldState:{error:r}})=>jsx(DatePicker,{inputRef:m,format:"DD/MM/YYYY",...e,...o,value:e.value?k(e.value):null,onChange:l=>f(l?l.toDate():null),slotProps:{textField:{...o.slotProps?.textField,required:n,error:!!r,helperText:r?.message||i,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:t}},openPickerButton:{tabIndex:t}}})})},x=d;
6
+ var d=({name:s,rules:p,tabIndex:o,helperText:u,required:i,...e})=>{let{control:m}=useFormContext();return jsx(Controller,{name:s,control:m,rules:p,render:({field:{ref:c,onChange:f,...t},fieldState:{error:r}})=>jsx(DatePicker,{inputRef:c,format:"DD/MM/YYYY",...t,...e,value:t.value?C(t.value):null,onChange:l=>{let a=l?l.toDate():null;f(a),e.onChange(a);},slotProps:{textField:{...e.slotProps?.textField,required:i,error:!!r,helperText:r?.message||u,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:o}},openPickerButton:{tabIndex:o}}})})},x=d;
7
7
 
8
8
  export { x as default };
@@ -5,7 +5,13 @@ import { Dayjs } from 'dayjs';
5
5
  import { BaseField } from '../../../types/baseField.js';
6
6
  import 'react-hook-form';
7
7
 
8
- type DateRangePickerProps = BaseField<DateRangePickerProps$1<Dayjs>> & {
8
+ type DateRange = {
9
+ startDate?: Date | null | undefined;
10
+ endDate?: Date | null | undefined;
11
+ };
12
+ type DateRangePickerProps = BaseField<Omit<DateRangePickerProps$1<Dayjs>, 'value' | 'onChange'>> & {
13
+ value?: DateRange;
14
+ onChange(value?: DateRange): void;
9
15
  tabIndex?: number;
10
16
  helperText?: ReactNode;
11
17
  required?: boolean;
@@ -1,8 +1,8 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
2
  import { DateRangePicker } from '@mui/x-date-pickers-pro';
3
- import l from 'dayjs';
3
+ import s from 'dayjs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var k=({name:r,label:o,rules:i,tabIndex:D,helperText:d,required:p,...a})=>{let{control:f,setError:m}=useFormContext();return jsx(Controller,{name:r,control:f,rules:i,render:({field:{value:t,onChange:u},fieldState:{error:n}})=>jsx(DateRangePicker,{format:"DD/MM/YYYY",value:[t?.startDate?l(t.startDate):null,t?.endDate?l(t.endDate):null],onChange:e=>u({startDate:e[0]?e[0].toDate():null,endDate:e[1]?e[1].toDate():null}),onError:e=>{m(r,{message:e[0]||e[1]||void 0});},...a,slotProps:{textField:({position:e})=>({...a.slotProps?.textField,required:p,error:!!n,helperText:n?.message||d,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:e==="start"?`${o} (Dt. In\xEDcio)`:`${o} (Dt. Fim)`,inputProps:{tabIndex:D}})},sx:{width:1}})})},h=k;
6
+ var C=({name:o,label:a,rules:D,tabIndex:d,helperText:p,required:f,...r})=>{let{control:m,setError:u}=useFormContext();return jsx(Controller,{name:o,control:m,rules:D,render:({field:{value:t,onChange:c},fieldState:{error:n}})=>jsx(DateRangePicker,{...r,format:"DD/MM/YYYY",value:[t?.startDate?s(t.startDate):null,t?.endDate?s(t.endDate):null],onChange:e=>{let l={startDate:e[0]?e[0].toDate():null,endDate:e[1]?e[1].toDate():null};c(l),r.onChange(l);},onError:e=>{u(o,{message:e[0]||e[1]||void 0});},slotProps:{textField:({position:e})=>({...r.slotProps?.textField,required:f,error:!!n,helperText:n?.message||p,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:e==="start"?`${a} (Dt. In\xEDcio)`:`${a} (Dt. Fim)`,inputProps:{tabIndex:d}})},sx:{width:1}})})},F=C;
7
7
 
8
- export { h as default };
8
+ export { F as default };
@@ -5,11 +5,12 @@ import { Dayjs } from 'dayjs';
5
5
  import { BaseField } from '../../../types/baseField.js';
6
6
  import 'react-hook-form';
7
7
 
8
- type DateTimePickerProps = BaseField<Omit<DateTimePickerProps$1<Dayjs>, 'value'>> & {
8
+ type DateTimePickerProps = BaseField<Omit<DateTimePickerProps$1<Dayjs>, 'value' | 'onChange'>> & {
9
9
  tabIndex?: number;
10
10
  helperText?: ReactNode;
11
11
  required?: boolean;
12
12
  value?: Date | null | undefined;
13
+ onChange(value: Date | null | undefined): void;
13
14
  };
14
15
 
15
16
  declare const DateTimePicker: ({ name, rules, tabIndex, helperText, required, ...other }: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
2
  import { DateTimePicker } from '@mui/x-date-pickers-pro';
3
- import k from 'dayjs';
3
+ import C from 'dayjs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var T=({name:m,rules:a,tabIndex:t,helperText:p,required:s,...o})=>{let{control:n}=useFormContext();return jsx(Controller,{name:m,control:n,rules:a,render:({field:{ref:u,onChange:f,...e},fieldState:{error:r}})=>jsx(DateTimePicker,{format:"DD/MM/YYYY HH:mm",inputRef:u,...e,...o,value:e.value?k(e.value):null,onChange:l=>f(l?l.toDate():null),slotProps:{textField:{...o.slotProps?.textField,required:s,error:!!r,helperText:r?.message||p,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:t}},openPickerButton:{tabIndex:t}}})})},h=T;
6
+ var T=({name:m,rules:n,tabIndex:o,helperText:s,required:p,...e})=>{let{control:u}=useFormContext();return jsx(Controller,{name:m,control:u,rules:n,render:({field:{ref:c,onChange:f,...t},fieldState:{error:r}})=>jsx(DateTimePicker,{format:"DD/MM/YYYY HH:mm",inputRef:c,...t,...e,value:t.value?C(t.value):null,onChange:l=>{let i=l?l.toDate():null;f(i),e.onChange(i);},slotProps:{textField:{...e.slotProps?.textField,required:p,error:!!r,helperText:r?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:o}},openPickerButton:{tabIndex:o}}})})},h=T;
7
7
 
8
8
  export { h as default };
@@ -5,11 +5,12 @@ import { Dayjs } from 'dayjs';
5
5
  import { BaseField } from '../../../types/baseField.js';
6
6
  import 'react-hook-form';
7
7
 
8
- type TimePickerProps = BaseField<Omit<TimePickerProps$1<Dayjs>, 'components' | 'value'>> & {
8
+ type TimePickerProps = BaseField<Omit<TimePickerProps$1<Dayjs>, 'components' | 'value' | 'onChange'>> & {
9
9
  tabIndex?: number;
10
10
  helperText?: ReactNode;
11
11
  required?: boolean;
12
12
  value?: Date | null | undefined;
13
+ onChange(value: Date | null | undefined): void;
13
14
  };
14
15
 
15
16
  declare const TimePicker: ({ name, rules, tabIndex, helperText, required, ...other }: TimePickerProps) => react_jsx_runtime.JSX.Element;
@@ -3,6 +3,6 @@ import { TimePicker } from '@mui/x-date-pickers-pro';
3
3
  import T from 'dayjs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var d=({name:i,rules:p,tabIndex:o,helperText:s,required:n,...r})=>{let{control:u}=useFormContext();return jsx(Controller,{name:i,control:u,rules:p,render:({field:{ref:a,onChange:f,...e},fieldState:{error:t}})=>jsx(TimePicker,{ampm:!1,format:"HH:mm",inputRef:a,...e,...r,value:e.value?T(e.value):null,onChange:l=>f(l?l.toDate():null),slotProps:{textField:{...r.slotProps?.textField,error:!!t,required:n,helperText:t?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:o}},openPickerButton:{tabIndex:o}}})})},F=d;
6
+ var d=({name:n,rules:s,tabIndex:t,helperText:p,required:a,...e})=>{let{control:u}=useFormContext();return jsx(Controller,{name:n,control:u,rules:s,render:({field:{ref:f,onChange:c,...o},fieldState:{error:r}})=>jsx(TimePicker,{ampm:!1,format:"HH:mm",inputRef:f,...o,...e,value:o.value?T(o.value):null,onChange:l=>{let m=l?l.toDate():null;c(m),e.onChange(m);},slotProps:{textField:{...e.slotProps?.textField,error:!!r,required:a,helperText:r?.message||p,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:t}},openPickerButton:{tabIndex:t}}})})},F=d;
7
7
 
8
8
  export { F as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import e from '@mui/material/Box';
2
- import t from '@mui/material/Button';
3
- import { styled } from '@mui/material/styles';
4
-
5
- var i=styled(t)(({theme:o})=>({borderColor:o.palette.grey[300]})),a=styled(e)(({theme:o})=>({display:"flex",border:`1.5px solid ${o.palette.grey[300]}`,height:450,borderRadius:8,flex:1,overflow:"hidden"}));
6
-
7
- export { i as a, a as b };
@@ -1,10 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- interface StyledTabProps {
4
- hasChanges?: boolean;
5
- icon: ReactNode;
6
- label: ReactNode;
7
- onClose: VoidFunction;
8
- }
9
-
10
- export { StyledTabProps };
@@ -1 +0,0 @@
1
-
@@ -1,8 +0,0 @@
1
- import { SyntheticEvent } from 'react';
2
-
3
- interface StyledTabsProps {
4
- value: number;
5
- onChange: (event: SyntheticEvent, newValue: number) => void;
6
- }
7
-
8
- export { StyledTabsProps };
@@ -1 +0,0 @@
1
-
@@ -1,23 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- interface Item {
4
- id: string;
5
- name: string;
6
- label: ReactNode;
7
- }
8
- interface SwapListProps {
9
- selectedItems: Item[];
10
- items: Item[];
11
- loading: boolean;
12
- searchText: string;
13
- onAdd(list: Item[]): void;
14
- onRemove(list: Item[]): void;
15
- search: string | undefined;
16
- onSearch(value: string | undefined): void;
17
- itemsTitle: ReactNode;
18
- selectedItemsTitle: ReactNode;
19
- additionalContent?: ReactNode;
20
- enableSearchInSelectedItems?: boolean;
21
- }
22
-
23
- export { Item, SwapListProps };
@@ -1 +0,0 @@
1
-
@@ -1,16 +0,0 @@
1
- import * as _emotion_styled from '@emotion/styled';
2
- import * as _mui_system from '@mui/system';
3
- import * as _mui_material_styles from '@mui/material/styles';
4
- import * as react from 'react';
5
- import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
6
- import * as _mui_material from '@mui/material';
7
- import * as _mui_material_Button from '@mui/material/Button';
8
-
9
- declare const StyledSwapButton: _emotion_styled.StyledComponent<_mui_material_Button.ButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
10
- ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
11
- }, "className" | "children" | "style" | "tabIndex" | "sx" | "color" | "classes" | "href" | "disabled" | "size" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon" | "variant"> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
12
- declare const Card: _emotion_styled.StyledComponent<_mui_system.BoxOwnProps<_mui_material_styles.Theme> & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
13
- ref?: react.RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
14
- }, keyof _mui_system.BoxOwnProps<_mui_material_styles.Theme>> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
15
-
16
- export { Card, StyledSwapButton };
@@ -1 +0,0 @@
1
- export { b as Card, a as StyledSwapButton } from '../../chunk-MAKO5GLN.mjs';