@zydon/common 2.3.75 → 2.3.77
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.
- package/dist/chunk-7KPKMP7S.js +7 -0
- package/dist/chunk-OQ3EUAKX.js +19 -0
- package/dist/components/MoreMenu/index.d.ts +2 -1
- package/dist/components/MoreMenu/index.js +6 -5
- package/dist/components/form/Address/index.js +1 -1
- package/dist/components/form/Field/index.d.ts +1 -1
- package/dist/components/form/Field/index.js +1 -1
- package/dist/components/form/Password/index.js +1 -1
- package/dist/components/form/UploadAvatarWithCrop/index.js +1 -1
- package/dist/components/form/Webhook/index.js +1 -1
- package/dist/components/upload/index.d.ts +1 -1
- package/dist/components/upload/index.js +1 -1
- package/dist/theme/styles/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-VTHBHXM2.js +0 -7
- package/dist/chunk-WWK537HP.js +0 -18
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
+
import c from '@mui/material/TextField';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var g=({name:o,helperText:s,rules:a,onChange:e,tabIndex:d,className:f,id:r,...t})=>{let{control:m}=useFormContext();return jsx(Controller,{name:o,control:m,rules:a,render:({field:{ref:u,...l},fieldState:{error:p}})=>jsx(c,{...l,onChange:n=>{l.onChange(n),e&&e(n);},inputRef:u,fullWidth:!0,error:!!p,helperText:p?.message||s,"data-intercom-target":o,...t,InputLabelProps:{...t.InputLabelProps,htmlFor:r},inputProps:{...t.inputProps,tabIndex:d,id:r},className:`field-${o} ${f}`})})},b=g;
|
|
6
|
+
|
|
7
|
+
export { b as a };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { p, f } from './chunk-4VAXJ4XM.js';
|
|
2
|
+
import { a as a$3 } from './chunk-WB44OSQ3.js';
|
|
3
|
+
import { e } from './chunk-ANAHA3L6.js';
|
|
4
|
+
import { i } from './chunk-D27ND54J.js';
|
|
5
|
+
import { a } from './chunk-JAXAPLBP.js';
|
|
6
|
+
import { a as a$2 } from './chunk-KFZEM7KS.js';
|
|
7
|
+
import { a as a$1 } from './chunk-X24QANPC.js';
|
|
8
|
+
import { useState, useEffect } from 'react';
|
|
9
|
+
import { useDropzone } from 'react-dropzone';
|
|
10
|
+
import U from '@mui/material/Box';
|
|
11
|
+
import T from '@mui/material/CircularProgress';
|
|
12
|
+
import _ from '@mui/material/Typography';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
|
+
import J from '@mui/material/Dialog';
|
|
15
|
+
import K from '@mui/material/Stack';
|
|
16
|
+
|
|
17
|
+
function k({sx:n,error:s,file:r,disabled:m,uploading:u,helperText:p$1,...y}){let{getRootProps:C,getInputProps:b,isDragActive:f,isDragReject:g,fileRejections:w}=useDropzone({multiple:!1,disabled:m,accept:{"image/*":[]},...y}),e=!!r,l=g||!!s,[R,h]=useState();useEffect(()=>{typeof r=="string"?h(r):r instanceof File&&h(URL.createObjectURL(r));},[r]);let P=u&&jsx(T,{size:30,color:"primary"}),x=e&&jsx("img",{alt:"avatar",src:R,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}),I=jsxs(U,{className:"upload-placeholder",sx:{top:0,gap:1,left:0,width:1,height:1,zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:"text.disabled",flexDirection:"column",justifyContent:"center",bgcolor:o=>i(o.vars.palette.grey["500Channel"],.08),transition:o=>o.transitions.create(["opacity"],{duration:o.transitions.duration.shorter}),"&:hover":{opacity:.72},...l&&{color:"error.main",bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},...e&&{zIndex:9,opacity:0,color:"common.white",bgcolor:o=>i(o.vars.palette.grey["900Channel"],.64)}},children:[jsx(a,{icon:"ADD_IMAGE",width:32}),jsx(_,{variant:"caption",children:e?"Atualizar foto":"Enviar foto"})]}),D=jsxs(U,{sx:{width:1,height:1,overflow:"hidden",borderRadius:"50%",position:"relative"},children:[P,x,I]});return jsxs(Fragment,{children:[jsxs(U,{...C(),sx:{p:1,m:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:o=>`1px dashed ${i(o.vars.palette.grey["500Channel"],.2)}`,...f&&{opacity:.72},...m&&{opacity:.48,pointerEvents:"none"},...l&&{borderColor:"error.main"},...e&&{...l&&{bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},"&:hover .upload-placeholder":{opacity:1}},...n},children:[jsx("input",{...b()}),D]}),p$1&&p$1,jsx(p,{files:w})]})}var Q=({onFileCropped:n,onImageUploaded:s,onCancel:r,aspect:m,label:u,image:p="",uploading:y,file:C,tabIndex:b,maxSize:f$1,onDropRejected:g,...w})=>{let{id:e$1,setCropModalOpen:l,handleRemove:R,cropModalOpen:h,cancelChanges:P,saveChanges:x,previewImage:I,setCropper:D,preview:o,closePreviewImage:O,saving:W}=a$1({onFileCropped:n,onImageUploaded:s,onCancel:r}),{error:$}=a$2();return jsxs(Fragment,{children:[jsxs(K,{position:"relative",alignItems:"center",justifyContent:"center",children:[y&&jsx(f,{}),jsx(k,{...w,maxSize:f$1,id:e$1,file:C,onDrop:t=>{if(t.length>0){l(!0);let c=new FileReader;c.addEventListener("load",()=>{let A=c.result?.toString()||"";s(A),n(t[0]);}),c.readAsDataURL(t[0]);}},image:p,tabIndex:b,onDropRejected:(t,c)=>{let A=t[0]?.errors[0]?.code;s(void 0),n(void 0),$(A==="file-too-large"?`Imagem n\xE3o pode ser maior que ${e(f$1)}`:"Erro ao enviar imagem"),g&&g(t,c);}})]}),jsx(a$3,{id:e$1,open:h,onClose:P,label:u,aspectRatio:m,imageSrc:p,onRemove:R,onSave:x,onPreview:I,onInitialized:D,loading:W}),jsx(J,{open:!!o,onClose:O,scroll:"body",PaperProps:{sx:{p:2}},children:o&&jsx("img",{src:o,alt:"Preview"})})]})},uo=Q;
|
|
18
|
+
|
|
19
|
+
export { k as a, uo as b };
|
|
@@ -5,8 +5,9 @@ import { IconButtonProps } from '@mui/material/IconButton';
|
|
|
5
5
|
interface MoreMenuProps extends IconButtonProps {
|
|
6
6
|
actions: ReactNode;
|
|
7
7
|
disablePortal?: boolean;
|
|
8
|
+
actionLabel?: string;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
declare const MoreMenu: ({ actions, disablePortal, ...other }: MoreMenuProps) => react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare const MoreMenu: ({ actions, disablePortal, actionLabel, ...other }: MoreMenuProps) => react_jsx_runtime.JSX.Element;
|
|
11
12
|
|
|
12
13
|
export { MoreMenu as default };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { a as a$
|
|
2
|
-
import { a as a$
|
|
1
|
+
import { a as a$3 } from '../../chunk-HOMGLSVS.js';
|
|
2
|
+
import { a as a$2 } from '../../chunk-JAXAPLBP.js';
|
|
3
3
|
import '../../chunk-224DGQSM.js';
|
|
4
4
|
import { a } from '../../chunk-ORYAES3Q.js';
|
|
5
|
-
import
|
|
5
|
+
import f from '@mui/material/IconButton';
|
|
6
6
|
import M from '@mui/material/Stack';
|
|
7
|
+
import a$1 from '@mui/material/Tooltip';
|
|
7
8
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
+
var s=({actions:i,disablePortal:m,actionLabel:r="A\xE7\xF5es",...l})=>{let{open:t,onClose:u,onOpen:c}=a();return jsxs(Fragment,{children:[jsx(a$1,{title:r,children:jsx(f,{...l,"aria-label":r,color:t?"inherit":"default",onClick:c,children:jsx(a$2,{icon:"MORE_BOLD"})})}),jsx(a$3,{open:t,onClose:u,arrow:"right-top",disablePortal:m,children:jsx(M,{component:"ul",gap:.5,minWidth:160,children:i})})]})},O=s;
|
|
10
11
|
|
|
11
|
-
export {
|
|
12
|
+
export { O as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as a$1 } from '../../../chunk-2NMLQNWC.js';
|
|
2
|
-
import { a as a$2 } from '../../../chunk-
|
|
2
|
+
import { a as a$2 } from '../../../chunk-7KPKMP7S.js';
|
|
3
3
|
import { a as a$3 } from '../../../chunk-SQ6BPK55.js';
|
|
4
4
|
import '../../../chunk-ORLVNXTG.js';
|
|
5
5
|
import '../../../chunk-GXFOLM7Q.js';
|
|
@@ -4,6 +4,6 @@ import '@mui/material/TextField';
|
|
|
4
4
|
import '../../../types/baseField.js';
|
|
5
5
|
import 'react-hook-form';
|
|
6
6
|
|
|
7
|
-
declare const Field: ({ name, helperText, rules, onChange, tabIndex, className, ...other }: FieldProps) => react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare const Field: ({ name, helperText, rules, onChange, tabIndex, className, id, ...other }: FieldProps) => react_jsx_runtime.JSX.Element;
|
|
8
8
|
|
|
9
9
|
export { Field as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as default } from '../../../chunk-
|
|
1
|
+
export { a as default } from '../../../chunk-7KPKMP7S.js';
|
|
@@ -59,7 +59,7 @@ declare function RejectionFiles({ files }: Props): react_jsx_runtime.JSX.Element
|
|
|
59
59
|
|
|
60
60
|
declare const Upload: ({ id, disabled, multiple, error, helperText, file, onDelete, files, thumbnail, onRemove, onHandleMainImage, mainUrl, sx, dropZoneProps, placeholderProps, placeholderAlt, uploading, image, tabIndex, preview, onRemoveAll, onUpload, onReorder, ...other }: UploadProps) => react_jsx_runtime.JSX.Element;
|
|
61
61
|
|
|
62
|
-
declare function UploadAvatar({ sx, error, file: value, disabled, helperText, ...other }: UploadProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
declare function UploadAvatar({ sx, error, file: value, disabled, uploading, helperText, ...other }: UploadProps): react_jsx_runtime.JSX.Element;
|
|
63
63
|
|
|
64
64
|
declare const UploadAvatarWithCrop: ({ onFileCropped, onImageUploaded, onCancel, aspect, label, image, uploading, file, tabIndex, maxSize, onDropRejected, ...other }: UploadWithCropProps) => react_jsx_runtime.JSX.Element;
|
|
65
65
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-
|
|
1
|
+
export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-OQ3EUAKX.js';
|
|
2
2
|
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload, e as UploadWithCrop } from '../../chunk-MMTDVFNL.js';
|
|
3
3
|
import { o } from '../../chunk-4VAXJ4XM.js';
|
|
4
4
|
export { p as RejectionFiles } from '../../chunk-4VAXJ4XM.js';
|
|
@@ -443,7 +443,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
443
443
|
wordWrap?: csstype.Property.WordWrap | readonly NonNullable<csstype.Property.WordWrap | undefined>[] | readonly csstype.Property.WordWrap[] | undefined;
|
|
444
444
|
writingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
|
|
445
445
|
zIndex?: csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto")[] | undefined;
|
|
446
|
-
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly (
|
|
446
|
+
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
|
|
447
447
|
all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
|
|
448
448
|
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "linear" | "none" | "auto" | "both" | "alternate" | "alternate-reverse" | "backwards" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start")[] | undefined;
|
|
449
449
|
animationRange?: csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
|
package/package.json
CHANGED
package/dist/chunk-VTHBHXM2.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
-
import F from '@mui/material/TextField';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
var P=({name:e,helperText:p,rules:s,onChange:o,tabIndex:d,className:f,...t})=>{let{control:m}=useFormContext();return jsx(Controller,{name:e,control:m,rules:s,render:({field:{ref:a,...r},fieldState:{error:l}})=>jsx(F,{...r,onChange:i=>{r.onChange(i),o&&o(i);},inputRef:a,fullWidth:!0,error:!!l,helperText:l?.message||p,"data-intercom-target":e,...t,inputProps:{...t.inputProps,tabIndex:d},className:`field-${e} ${f}`})})},C=P;
|
|
6
|
-
|
|
7
|
-
export { C as a };
|
package/dist/chunk-WWK537HP.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { p, f } from './chunk-4VAXJ4XM.js';
|
|
2
|
-
import { a as a$3 } from './chunk-WB44OSQ3.js';
|
|
3
|
-
import { e } from './chunk-ANAHA3L6.js';
|
|
4
|
-
import { i } from './chunk-D27ND54J.js';
|
|
5
|
-
import { a } from './chunk-JAXAPLBP.js';
|
|
6
|
-
import { a as a$2 } from './chunk-KFZEM7KS.js';
|
|
7
|
-
import { a as a$1 } from './chunk-X24QANPC.js';
|
|
8
|
-
import { useState, useEffect } from 'react';
|
|
9
|
-
import { useDropzone } from 'react-dropzone';
|
|
10
|
-
import A from '@mui/material/Box';
|
|
11
|
-
import T from '@mui/material/Typography';
|
|
12
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
-
import H from '@mui/material/Dialog';
|
|
14
|
-
import J from '@mui/material/Stack';
|
|
15
|
-
|
|
16
|
-
function M({sx:n,error:s,file:e,disabled:d,helperText:m,...f}){let{getRootProps:y,getInputProps:C,isDragActive:b,isDragReject:g,fileRejections:h}=useDropzone({multiple:!1,disabled:d,accept:{"image/*":[]},...f}),r=!!e,t=g||!!s,[w,v]=useState();useEffect(()=>{typeof e=="string"?v(e):e instanceof File&&v(URL.createObjectURL(e));},[e]);let R=r&&jsx("img",{alt:"avatar",src:w,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}),x=jsxs(A,{className:"upload-placeholder",sx:{top:0,gap:1,left:0,width:1,height:1,zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:"text.disabled",flexDirection:"column",justifyContent:"center",bgcolor:o=>i(o.vars.palette.grey["500Channel"],.08),transition:o=>o.transitions.create(["opacity"],{duration:o.transitions.duration.shorter}),"&:hover":{opacity:.72},...t&&{color:"error.main",bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},...r&&{zIndex:9,opacity:0,color:"common.white",bgcolor:o=>i(o.vars.palette.grey["900Channel"],.64)}},children:[jsx(a,{icon:"ADD_IMAGE",width:32}),jsx(T,{variant:"caption",children:r?"Atualizar foto":"Enviar foto"})]}),P=jsxs(A,{sx:{width:1,height:1,overflow:"hidden",borderRadius:"50%",position:"relative"},children:[R,x]});return jsxs(Fragment,{children:[jsxs(A,{...y(),sx:{p:1,m:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:o=>`1px dashed ${i(o.vars.palette.grey["500Channel"],.2)}`,...b&&{opacity:.72},...d&&{opacity:.48,pointerEvents:"none"},...t&&{borderColor:"error.main"},...r&&{...t&&{bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},"&:hover .upload-placeholder":{opacity:1}},...n},children:[jsx("input",{...C()}),P]}),m&&m,jsx(p,{files:h})]})}var K=({onFileCropped:n,onImageUploaded:s,onCancel:e$1,aspect:d,label:m,image:f$1="",uploading:y,file:C,tabIndex:b,maxSize:g,onDropRejected:h,...r})=>{let{id:t,setCropModalOpen:w,handleRemove:v,cropModalOpen:R,cancelChanges:x,saveChanges:P,previewImage:o,setCropper:F,preview:I,closePreviewImage:O,saving:W}=a$1({onFileCropped:n,onImageUploaded:s,onCancel:e$1}),{error:$}=a$2();return jsxs(Fragment,{children:[jsxs(J,{position:"relative",alignItems:"center",justifyContent:"center",children:[y&&jsx(f,{}),jsx(M,{...r,maxSize:g,id:t,file:C,onDrop:i=>{if(i.length>0){w(!0);let p=new FileReader;p.addEventListener("load",()=>{let D=p.result?.toString()||"";s(D),n(i[0]);}),p.readAsDataURL(i[0]);}},image:f$1,tabIndex:b,onDropRejected:(i,p)=>{let D=i[0]?.errors[0]?.code;s(void 0),n(void 0),$(D==="file-too-large"?`Imagem n\xE3o pode ser maior que ${e(g)}`:"Erro ao enviar imagem"),h&&h(i,p);}})]}),jsx(a$3,{id:t,open:R,onClose:x,label:m,aspectRatio:d,imageSrc:f$1,onRemove:v,onSave:P,onPreview:o,onInitialized:F,loading:W}),jsx(H,{open:!!I,onClose:O,scroll:"body",PaperProps:{sx:{p:2}},children:I&&jsx("img",{src:I,alt:"Preview"})})]})},ho=K;
|
|
17
|
-
|
|
18
|
-
export { M as a, ho as b };
|