cemtrik-dependencies 1.0.75 → 1.0.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/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ Check the top-level render call using <`+O+">.")}return S}}function gr(d,S){{if(
|
|
|
36
36
|
.bg-opacity-35 {
|
|
37
37
|
opacity: .35;
|
|
38
38
|
}
|
|
39
|
-
`}),f.jsx(Re,{show:o,as:a.Fragment,children:f.jsxs(Vn,{as:"div",className:"relative z-50 relative",onClose:l,"data-testid":"modal",children:[f.jsx(Re.Child,{as:a.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:f.jsx("div",{className:"fixed inset-0 bg-opacity-35 bg-gray-900 transition-opacity","data-testid":"window-close",onClick:()=>l(!1)})}),f.jsx("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:f.jsx("div",{className:"flex min-h-full items-center justify-center xs:p-2 p-4 text-center sm:items-center sm:p-0",children:f.jsx(Re.Child,{as:a.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:f.jsxs(Vn.Panel,{className:N("relative transform rounded-lg bg-white px-4 pb-3 pt-5 text-left shadow-xl transition-all sm:w-full sm:pt-3 sm:px-3",n!==""&&n),style:t,children:[i&&f.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:f.jsx(Ss,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})}),f.jsx("div",{className:N(r!==""&&r),"data-testid":"content",children:e}),s&&f.jsx("div",{className:"mt-5 sm:mt-6",children:f.jsx(xt,{id:"close-modal",onClick:()=>l(!1),children:"Cerrar"})}),f.jsx("button",{className:"opacity-0 absolute"})]})})})})]})})]})}const ks=({isOpenModalConfirmation:e,setIsOpenModalConfirmation:n,close:t,title:r="¿Estás seguro de abandonar la creación de la acción?",description:o="La información se perderá si no creas la acción",classNameTitle:l="",classNameDescription:i=""})=>{const s=()=>{n(!1),t()};return f.jsxs(lr,{isOpen:e,setIsOpen:()=>n(),showButton:!1,showIconSuccess:!1,children:[f.jsx("p",{className:N("text-center text-sm",l!==""&&l),children:r}),f.jsx("p",{className:N("text-center text-sm",i!==""&&i),children:o}),f.jsxs("div",{className:"flex w-full justify-center mt-5",children:[f.jsx(rr,{className:"rounded-md bg-white text-gray-500 text-sm shadow-sm ring-1 ring-inset ring-gray-300 bg-gray-50 w-24 h-9 mr-6",onClick:()=>n(),id:"cancel",children:"Cancelar"}),f.jsx(xt,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 focus-visible:outline-secondary-2 shadow-secondary-2 rounded py-1.5 text-white w-full px-5",outline:"0px 0px 0px 2px #3758F9, 0px 0px 0px 2px #243BBD, 0px 1px 2px 0px rgba(0, 0, 0, 0.05)",onClick:s,id:"confirmation",children:"Aceptar"})]})]})},Ps=({className:e="",style:n={}})=>f.jsx("div",{className:N("w-px",e!==""&&e),style:n}),Ms=({onClick:e,id:n="",className:t=""})=>f.jsxs("div",{className:N("flex items-center text-default-5",t!==""&&t),"data-testid":n,children:[f.jsx(ls,{className:"w-3 h-3 3xs:w-4 3xs:h-4 stroke-current cursor-pointer","data-testid":"chevron-left-icon",onClick:e}),f.jsx("span",{onClick:e,className:"text-sm cursor-pointer","data-testid":"go-back",children:"Volver"})]}),nn=({placeholder:e="",label:n="",htmlFor:t,type:r="text",name:o,handleChange:l,onClick:i=()=>{},value:s,isReadOnly:u=!1,isError:c=!1,helperText:m="",autocomplete:h="on",id:b,classNameLabel:p="",classNameContainerInput:v="",classNameContainer:g="",className:x="",icon:C=null,onKeyDown:y,onFocus:T,min:I,max:F})=>{const[P,R]=a.useState(!1),Y=Me({"ring-red-300 focus:ring-red-300 text-red-900":c||P,"focus:ring-indigo-600 text-gray-500":!c&&!P}),D=M=>{if(l&&l(M),r!=="email")return;const{value:B}=M.target,G=cn(B);R(!G)};return f.jsxs("div",{"data-testid":`container-input-${b}`,className:g,children:[n!==""&&f.jsx("label",{htmlFor:t,className:N("block text-sm font-medium leading-6",p!==""?p:"text-gray-700"),"data-testid":`label-${b}`,children:n}),f.jsxs("div",{className:N("relative mt-1 rounded-md",v!==""&&v),children:[f.jsx("input",{id:b,name:o,type:r,autoComplete:h,placeholder:e,onChange:D,onClick:i,onKeyDown:y,onFocus:T,value:s,readOnly:u,"data-testid":`input-${b}`,min:I,className:N("block w-full rounded-md border-0 py-1.5 shadow-sm placeholder-gray-300 ring-1 ring-gray-300 ring-inset focus:ring-1 focus:ring-inset text-sm sm:leading-6",Y,x!==""&&x)}),C!==null&&f.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:C}),c&&C===null&&f.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:f.jsx(er,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),m.length===0||!c?null:f.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${b}`,children:m})]})};function wt({className:e="w-6 h-6",color:n="#3730a3"}){return f.jsxs("svg",{className:N("fill-current animate-spin",e),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"4",fill:"none"}),f.jsx("path",{fill:n,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function As(){return f.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-full h-screen overflow-hidden bg-stone-600 opacity-75 flex flex-col items-center justify-center","data-testid":"spinner",style:{zIndex:60},children:[f.jsx("div",{className:"inline-block h-12 w-12 animate-[spinner-grow_0.75s_linear_infinite] rounded-full bg-current align-[-0.125em] opacity-0 motion-reduce:animate-[spinner-grow_1.5s_linear_infinite]",role:"status"}),f.jsx(wt,{className:"w-8 h-8 animate-spin"})]})}const ir=({height:e="36px",style:n={},label:t="",onChange:r,isReadOnly:o=!1,isError:l=!1,helperText:i="",name:s,id:u,className:c="",classNameLabel:m="",classNameInput:h="",options:b,value:p=-1,defaultValue:v={value:-1,label:"",iconStart:null,iconEnd:null},defaultLabel:g="label",defaultId:x="value",bgOptionSelect:C="bg-indigo-600",isSearch:y=!1,loading:T=!1,isTest:I=!1})=>{const[F,P]=a.useState(""),[R,Y]=a.useState(v),[D,M]=a.useState(!1);a.useEffect(()=>{if(p===-1||(b==null?void 0:b.length)===0)return;const w=b==null?void 0:b.find(L=>L[x]===p);w&&Y(w)},[p,b,x]),a.useEffect(()=>{p==="clear"&&(R.value!==v.value||R.label!==v.label||I)&&Y(v)},[v,I,R,p]);const B=F===""?b:b.filter(w=>w[g].toLowerCase().includes(F.toLowerCase())),G=Me({"ring-red-300 focus:ring-red-300 text-red-900":l&&!o,"text-gray-500":!l,"focus:ring-indigo-600":!l&&!o}),J=Me({"text-red-400":l&&!o,"text-gray-400":!l}),ae=w=>{Y(w),r({target:{value:w,checked:!1,name:s,type:void 0,id:w[x]}})};return f.jsxs(Ie,{as:"div",value:R,onChange:ae,children:[f.jsx(Ie.Label,{className:N("block text-sm font-medium leading-6 text-gray-500 mb-0.5",m!==""&&m),children:t}),f.jsxs("div",{className:N("relative",c!==""&&c),children:[f.jsxs(Ie.Button,{className:"w-full","data-testid":`listbox-button-${u}`,children:[R.iconStart&&f.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2",children:R.iconStart}),f.jsx(Ie.Input,{className:N("w-full rounded-md border-0 bg-white py-1.5 pr-10 text-gray-900 shadow-sm ring-1 ring-gray-300 sm:text-sm sm:leading-6 truncate block",!l&&!o&&"ring-inset focus:ring-inset focus:ring-2 focus:ring-indigo-600",o&&"focus:ring-gray-300",G,h!==""&&h),onChange:w=>P(w.target.value),displayValue:w=>{var L;return(L=w[g])==null?void 0:L.trim()},autoComplete:"false",readOnly:!y||o,style:{height:e,...n},"data-testid":"input-search",onClick:()=>M(o?!1:!D),onBlur:()=>M(!1)})]}),R.iconEnd&&f.jsx("span",{className:"absolute inset-y-0 right-4 flex items-center pr-4",children:R.iconEnd}),f.jsx(Ie.Button,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",onClick:()=>M(o?!1:!D),"data-testid":"arrow-button",children:D?f.jsx(Gi,{className:N("h-5 w-5",J),"aria-hidden":"true"}):f.jsx(qi,{className:N("h-5 w-5",J),"aria-hidden":"true"})}),!o&&f.jsx(f.Fragment,{children:T?f.jsx(Ie.Options,{className:"absolute z-10 mt-1 max-h-60 w-full rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none flex justify-center items-center py-2",children:f.jsx(wt,{})}):(B??[]).length>0?f.jsx(Ie.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden",children:B.map((w,L)=>f.jsx(Ie.Option,{value:w,className:N(w[x]===R[x]?`${C} text-white`:"text-gray-900",`relative cursor-default select-none p-2 hover:text-white hover:${C}`),"data-testid":`select-${u}-${w[x]}`,children:f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsxs("div",{className:"flex items-center",children:[w.iconStart&&f.jsx("span",{className:"mr-2","aria-hidden":"true",children:w.iconStart}),f.jsx("span",{className:"block font-normal break-all",children:w[g]})]}),w.iconEnd&&f.jsx("span",{className:"ml-2","aria-hidden":"true",children:w.iconEnd})]})},L))}):f.jsx(Ie.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden flex justify-center items-center py-2",children:f.jsx("p",{"data-testid":"empty-options",children:"Sin opciones"})})})]}),i.length>0&&l&&f.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${u}`,children:i})]})},Ds=({placeholder:e="",label:n="",htmlFor:t,name:r,handleChange:o,onClick:l=()=>{},value:i,valueSelect:s,isReadOnly:u=!1,isError:c=!1,helperText:m="",autocomplete:h="on",id:b,classNameLabel:p="",classNameContainer:v="",className:g="",onKeyDown:x,options:C,idSelect:y,isMarginLeft:T=!0,classNameSelect:I="w-20",type:F="text"})=>{const{width:P}=Tt(),R=Me({"ring-red-300 focus:ring-red-300 text-red-900":c,"focus:ring-indigo-600 text-gray-500":!c});return f.jsxs("div",{"data-testid":`container-input-${b}`,className:v,children:[n!==""&&f.jsx("label",{htmlFor:t,className:N("block text-sm font-medium leading-6",p!==""?p:"text-gray-700"),"data-testid":`label-${b}`,children:n}),f.jsxs("div",{className:"relative mt-1 rounded-md shadow-sm",children:[f.jsx("div",{className:"absolute inset-y-0 -top-0.5 flex items-center",style:{left:"2px"},children:f.jsx(ir,{name:y,onChange:Y=>o(Y),id:y,options:C,value:s,isReadOnly:u,className:I,height:P<=640?"28px":"32px",classNameInput:N(T&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},isDisabledFocus:!0})}),f.jsx("input",{id:b,name:r,type:F,autoComplete:h,placeholder:e,readOnly:u,"data-testid":`input-${b}`,onClick:l,onKeyDown:x,onChange:Y=>o(Y),value:i,className:N("block w-full rounded-md border-0 py-1.5 pl-20 shadow-sm placeholder-gray-300 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-1 focus:ring-inset text-sm sm:leading-6",R,g!==""&&g)}),c&&f.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:f.jsx(er,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),m.length===0||!c?null:f.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${b}`,children:m})]})},Ls=({setValuesDefault:e,status:n=!1,isReadOnly:t=!1})=>{const[r,o]=a.useState(!1);a.useEffect(()=>{o(n),e("status",n)},[n,e]);const l=()=>{o(!r),e("status",!r)};return f.jsxs("div",{className:"flex",children:[f.jsxs(Ci,{checked:r,onChange:l,className:N("group relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-success-1 focus:ring-offset-2 mt-1",r?"bg-success-1":"bg-gray-200"),"data-testid":"switch",disabled:t,children:[f.jsx("span",{className:"sr-only",children:"Use setting"}),f.jsx("span",{"aria-hidden":"true",className:N("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",r?"translate-x-full":"translate-x-0")})]}),f.jsx("p",{className:"text-sm font-medium text-gray-500 ml-2 self-end","data-testid":"text-switch",children:r?"Activo":"Inactivo"})]})};function _s({label:e="",id:n,htmlFor:t="",classNameLabel:r="",className:o="",rows:l=4,name:i,placeholder:s="",helperText:u="",isReadOnly:c=!1,isError:m=!1,onChange:h,value:b,idInput:p,nameInput:v,placeholderInput:g="",isReadOnlyInput:x=!1,valueInput:C,infoTop:y=null,infoBottom:T=null,classNameInfoTop:I="h-4",classNameInfoBottom:F="h-2",isInputTitle:P=!1,scrollHeightTest:R=!1,hiddenBorder:Y=!1}){const D=a.useRef(null),[M,B]=a.useState(0);a.useEffect(()=>{const{current:J}=D;J===null||R||B(J.scrollHeight)},[D,b,R]),a.useEffect(()=>{R&&B(800)},[R]);const G=Me({"ring-red-300 focus:ring-red-300 text-red-900":m,"focus:ring-indigo-600 text-gray-700":!m});return f.jsxs(f.Fragment,{children:[e!==""&&f.jsx("label",{htmlFor:t,className:N("leading-6 block text-sm",r!==""&&r),children:e}),f.jsxs("div",{className:"relative overflow-x-hidden",children:[y!==null&&f.jsx("div",{className:"absolute top-2 left-3 w-full",children:y}),f.jsxs("div",{className:N("overflow-hidden rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-indigo-600 placeholder:text-gray-400 bg-white",G),children:[y!==null&&f.jsx("div",{className:"py-2","aria-hidden":"true",children:f.jsx("div",{className:"py-px",children:f.jsx("div",{className:I})})}),P&&f.jsx("textarea",{name:v,id:p,className:"block w-full resize-none border-0 bg-transparent py-1.5 text-gray-400 placeholder:text-gray-400 focus:ring-0 text-sm",placeholder:g,value:C,onChange:h,rows:2,readOnly:x}),f.jsx("textarea",{style:{height:M>0?M:"auto"},placeholder:s,rows:l,name:i,id:n,className:N(P||Y?"block w-full resize-none border-0 bg-transparent py-1.5 placeholder:text-gray-400 focus:ring-0":"block w-full rounded-md border-0 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset sm:leading-6",G,o!==""&&o),readOnly:c,onChange:h,value:b,"data-testid":`textarea-${n}`,ref:D}),T!==null&&f.jsx("div",{className:"py-2","aria-hidden":"true",children:f.jsx("div",{className:"py-px",children:f.jsx("div",{className:F})})})]}),T!==null&&f.jsx("div",{className:"absolute bottom-2 left-3 w-full",children:T})]}),u.length>0&&m&&f.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${n}`,children:u})]})}const Rs=({className:e="",children:n,message:t=""})=>{const[r,o]=a.useState(!1),l=()=>{t!==""&&o(!0)},i=()=>{o(!1)};return f.jsx("div",{className:"relative",children:f.jsxs("div",{onMouseLeave:i.bind(null,r),"data-testid":"container-tooltip",children:[f.jsx("div",{className:`
|
|
39
|
+
`}),f.jsx(Re,{show:o,as:a.Fragment,children:f.jsxs(Vn,{as:"div",className:"relative z-50 relative",onClose:l,"data-testid":"modal",children:[f.jsx(Re.Child,{as:a.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:f.jsx("div",{className:"fixed inset-0 bg-opacity-35 bg-gray-900 transition-opacity","data-testid":"window-close",onClick:()=>l(!1)})}),f.jsx("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:f.jsx("div",{className:"flex min-h-full items-center justify-center xs:p-2 p-4 text-center sm:items-center sm:p-0",children:f.jsx(Re.Child,{as:a.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:f.jsxs(Vn.Panel,{className:N("relative transform rounded-lg bg-white px-4 pb-3 pt-5 text-left shadow-xl transition-all sm:w-full sm:pt-3 sm:px-3",n!==""&&n),style:t,children:[i&&f.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:f.jsx(Ss,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})}),f.jsx("div",{className:N(r!==""&&r),"data-testid":"content",children:e}),s&&f.jsx("div",{className:"mt-5 sm:mt-6",children:f.jsx(xt,{id:"close-modal",onClick:()=>l(!1),children:"Cerrar"})}),f.jsx("button",{className:"opacity-0 absolute"})]})})})})]})})]})}const ks=({isOpenModalConfirmation:e,setIsOpenModalConfirmation:n,close:t,title:r="¿Estás seguro de abandonar la creación de la acción?",description:o="La información se perderá si no creas la acción",classNameTitle:l="",classNameDescription:i=""})=>{const s=()=>{n(!1),t()};return f.jsxs(lr,{isOpen:e,setIsOpen:()=>n(),showButton:!1,showIconSuccess:!1,children:[f.jsx("p",{className:N("text-center text-sm",l!==""&&l),children:r}),f.jsx("p",{className:N("text-center text-sm",i!==""&&i),children:o}),f.jsxs("div",{className:"flex w-full justify-center mt-5",children:[f.jsx(rr,{className:"rounded-md bg-white text-gray-500 text-sm shadow-sm ring-1 ring-inset ring-gray-300 bg-gray-50 w-24 h-9 mr-6",onClick:()=>n(),id:"cancel",children:"Cancelar"}),f.jsx(xt,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 focus-visible:outline-secondary-2 shadow-secondary-2 rounded py-1.5 text-white w-full px-5",outline:"0px 0px 0px 2px #3758F9, 0px 0px 0px 2px #243BBD, 0px 1px 2px 0px rgba(0, 0, 0, 0.05)",onClick:s,id:"confirmation",children:"Aceptar"})]})]})},Ps=({className:e="",style:n={}})=>f.jsx("div",{className:N("w-px",e!==""&&e),style:n}),Ms=({onClick:e,id:n="",className:t=""})=>f.jsxs("div",{className:N("flex items-center text-default-5",t!==""&&t),"data-testid":n,children:[f.jsx(ls,{className:"w-3 h-3 3xs:w-4 3xs:h-4 stroke-current cursor-pointer","data-testid":"chevron-left-icon",onClick:e}),f.jsx("span",{onClick:e,className:"text-sm cursor-pointer","data-testid":"go-back",children:"Volver"})]}),nn=({placeholder:e="",label:n="",htmlFor:t,type:r="text",name:o,handleChange:l,onClick:i=()=>{},value:s,isReadOnly:u=!1,isError:c=!1,helperText:m="",autocomplete:h="on",id:b,classNameLabel:p="",classNameContainerInput:v="",classNameContainer:g="",className:x="",icon:C=null,onKeyDown:y,onFocus:T,min:I,max:F})=>{const[P,R]=a.useState(!1),Y=Me({"ring-red-300 focus:ring-red-300 text-red-900":c||P,"focus:ring-indigo-600 text-gray-500":!c&&!P}),D=M=>{if(l&&l(M),r!=="email")return;const{value:B}=M.target,G=cn(B);R(!G)};return f.jsxs("div",{"data-testid":`container-input-${b}`,className:g,children:[n!==""&&f.jsx("label",{htmlFor:t,className:N("block text-sm font-medium leading-6",p!==""?p:"text-gray-700"),"data-testid":`label-${b}`,children:n}),f.jsxs("div",{className:N("relative mt-1 rounded-md",v!==""&&v),children:[f.jsx("input",{id:b,name:o,type:r,autoComplete:h,placeholder:e,onChange:D,onClick:i,onKeyDown:y,onFocus:T,value:s,readOnly:u,"data-testid":`input-${b}`,min:I,className:N("block w-full rounded-md border-0 py-1.5 shadow-sm placeholder-gray-300 ring-1 ring-gray-300 ring-inset focus:ring-1 focus:ring-inset text-sm sm:leading-6",Y,x!==""&&x)}),C!==null&&f.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:C}),c&&C===null&&f.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:f.jsx(er,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),m.length===0||!c?null:f.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${b}`,children:m})]})};function wt({className:e="w-6 h-6",color:n="#3730a3"}){return f.jsxs("svg",{className:N("fill-current animate-spin",e),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"4",fill:"none"}),f.jsx("path",{fill:n,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function As(){return f.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-full h-screen overflow-hidden bg-stone-600 opacity-75 flex flex-col items-center justify-center","data-testid":"spinner",style:{zIndex:60},children:[f.jsx("div",{className:"inline-block h-12 w-12 animate-[spinner-grow_0.75s_linear_infinite] rounded-full bg-current align-[-0.125em] opacity-0 motion-reduce:animate-[spinner-grow_1.5s_linear_infinite]",role:"status"}),f.jsx(wt,{className:"w-8 h-8 animate-spin"})]})}const ir=({height:e="36px",style:n={},label:t="",onChange:r,isReadOnly:o=!1,isError:l=!1,helperText:i="",name:s,id:u,className:c="",classNameLabel:m="",classNameInput:h="",options:b,value:p=-1,defaultValue:v={value:-1,label:"",iconStart:null,iconEnd:null},defaultLabel:g="label",defaultId:x="value",bgOptionSelect:C="bg-indigo-600",isSearch:y=!1,loading:T=!1,isTest:I=!1})=>{const[F,P]=a.useState(""),[R,Y]=a.useState(v),[D,M]=a.useState(!1);a.useEffect(()=>{if(p===-1||(b==null?void 0:b.length)===0)return;const w=b==null?void 0:b.find(L=>L[x]===p);w&&Y(w)},[p,b,x]),a.useEffect(()=>{p==="clear"&&(R.value!==v.value||R.label!==v.label||I)&&Y(v)},[v,I,R,p]);const B=F===""?b:b.filter(w=>w[g].toLowerCase().includes(F.toLowerCase())),G=Me({"ring-red-300 focus:ring-red-300 text-red-900":l&&!o,"text-gray-500":!l,"focus:ring-indigo-600":!l&&!o}),J=Me({"text-red-400":l&&!o,"text-gray-400":!l}),ae=w=>{Y(w),r({target:{value:w,checked:!1,name:s,type:void 0,id:w[x]}})};return f.jsxs(Ie,{as:"div",value:R,onChange:ae,children:[f.jsx(Ie.Label,{className:N("block text-sm font-medium leading-6 text-gray-500 mb-0.5",m!==""&&m),children:t}),f.jsxs("div",{className:N("relative",c!==""&&c),children:[f.jsxs(Ie.Button,{className:"w-full","data-testid":`listbox-button-${u}`,children:[R.iconStart&&f.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2",children:R.iconStart}),f.jsx(Ie.Input,{className:N("w-full rounded-md border-0 bg-white py-1.5 pr-10 text-gray-900 shadow-sm ring-1 ring-gray-300 sm:text-sm sm:leading-6 truncate block",!l&&!o&&"ring-inset focus:ring-inset focus:ring-2 focus:ring-indigo-600",o&&"focus:ring-gray-300",G,h!==""&&h),onChange:w=>P(w.target.value),displayValue:w=>{var L;return(L=w[g])==null?void 0:L.trim()},autoComplete:"false",readOnly:!y||o,style:{height:e,...n},"data-testid":"input-search",onClick:()=>M(o?!1:!D),onBlur:()=>M(!1)})]}),R.iconEnd&&f.jsx("span",{className:"absolute inset-y-0 right-4 flex items-center pr-4",children:R.iconEnd}),f.jsx(Ie.Button,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",onClick:()=>M(o?!1:!D),"data-testid":"arrow-button",children:D?f.jsx(Gi,{className:N("h-5 w-5",J),"aria-hidden":"true"}):f.jsx(qi,{className:N("h-5 w-5",J),"aria-hidden":"true"})}),!o&&f.jsx(f.Fragment,{children:T?f.jsx(Ie.Options,{className:"absolute z-10 mt-1 max-h-60 w-full rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none flex justify-center items-center py-2",children:f.jsx(wt,{})}):(B??[]).length>0?f.jsx(Ie.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden",children:B.map((w,L)=>f.jsx(Ie.Option,{value:w,className:N(w[x]===R[x]?`${C} text-white`:"text-gray-900",`relative cursor-default select-none p-2 hover:text-white hover:${C}`),"data-testid":`select-${u}-${w[x]}`,children:f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsxs("div",{className:"flex items-center",children:[w.iconStart&&f.jsx("span",{className:"mr-2","aria-hidden":"true",children:w.iconStart}),f.jsx("span",{className:"block font-normal break-all",children:w[g]})]}),w.iconEnd&&f.jsx("span",{className:"ml-2","aria-hidden":"true",children:w.iconEnd})]})},L))}):f.jsx(Ie.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden flex justify-center items-center py-2",children:f.jsx("p",{"data-testid":"empty-options",children:"Sin opciones"})})})]}),i.length>0&&l&&f.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${u}`,children:i})]})},Ds=({placeholder:e="",label:n="",htmlFor:t,name:r,handleChange:o,onClick:l=()=>{},value:i,valueSelect:s,isReadOnly:u=!1,isError:c=!1,helperText:m="",autocomplete:h="on",id:b,classNameLabel:p="",classNameContainer:v="",className:g="",onKeyDown:x,options:C,idSelect:y,isMarginLeft:T=!0,classNameSelect:I="w-20",type:F="text"})=>{const{width:P}=Tt(),R=Me({"ring-red-300 focus:ring-red-300 text-red-900":c,"focus:ring-indigo-600 text-gray-500":!c});return f.jsxs("div",{"data-testid":`container-input-${b}`,className:v,children:[n!==""&&f.jsx("label",{htmlFor:t,className:N("block text-sm font-medium leading-6",p!==""?p:"text-gray-700"),"data-testid":`label-${b}`,children:n}),f.jsxs("div",{className:"relative mt-1 rounded-md shadow-sm",children:[f.jsx("div",{className:"absolute inset-y-0 -top-0.5 flex items-center",style:{left:"2px"},children:f.jsx(ir,{name:y,onChange:Y=>o(Y),id:y,options:C,value:s,isReadOnly:u,className:I,height:P<=640?"28px":"32px",classNameInput:N(T&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},isDisabledFocus:!0})}),f.jsx("input",{id:b,name:r,type:F,autoComplete:h,placeholder:e,readOnly:u,"data-testid":`input-${b}`,onClick:l,onKeyDown:x,onChange:Y=>o(Y),value:i,className:N("block w-full rounded-md border-0 py-1.5 pl-20 shadow-sm placeholder-gray-300 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-1 focus:ring-inset text-sm sm:leading-6",R,g!==""&&g)}),c&&f.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:f.jsx(er,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),m.length===0||!c?null:f.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${b}`,children:m})]})},Ls=({setValuesDefault:e,status:n=!1,isReadOnly:t=!1,handleClick:r,text:o=""})=>{const[l,i]=a.useState(!1);a.useEffect(()=>{i(n),e("status",n)},[n,e]);const s=()=>{i(!l),e("status",!l),r&&r()};return f.jsxs("div",{className:"flex",children:[f.jsxs(Ci,{checked:l,onChange:s,className:N("group relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-success-1 focus:ring-offset-2 mt-1",l?"bg-success-1":"bg-gray-200"),"data-testid":"switch",disabled:t,children:[f.jsx("span",{className:"sr-only",children:"Use setting"}),f.jsx("span",{"aria-hidden":"true",className:N("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",l?"translate-x-full":"translate-x-0")})]}),o!==""?f.jsx("p",{className:"text-sm font-medium text-gray-500 ml-2 self-end",children:"text"}):f.jsx("p",{className:"text-sm font-medium text-gray-500 ml-2 self-end","data-testid":"text-switch",children:l?"Activo":"Inactivo"})]})};function _s({label:e="",id:n,htmlFor:t="",classNameLabel:r="",className:o="",rows:l=4,name:i,placeholder:s="",helperText:u="",isReadOnly:c=!1,isError:m=!1,onChange:h,value:b,idInput:p,nameInput:v,placeholderInput:g="",isReadOnlyInput:x=!1,valueInput:C,infoTop:y=null,infoBottom:T=null,classNameInfoTop:I="h-4",classNameInfoBottom:F="h-2",isInputTitle:P=!1,scrollHeightTest:R=!1,hiddenBorder:Y=!1}){const D=a.useRef(null),[M,B]=a.useState(0);a.useEffect(()=>{const{current:J}=D;J===null||R||B(J.scrollHeight)},[D,b,R]),a.useEffect(()=>{R&&B(800)},[R]);const G=Me({"ring-red-300 focus:ring-red-300 text-red-900":m,"focus:ring-indigo-600 text-gray-700":!m});return f.jsxs(f.Fragment,{children:[e!==""&&f.jsx("label",{htmlFor:t,className:N("leading-6 block text-sm",r!==""&&r),children:e}),f.jsxs("div",{className:"relative overflow-x-hidden",children:[y!==null&&f.jsx("div",{className:"absolute top-2 left-3 w-full",children:y}),f.jsxs("div",{className:N("overflow-hidden rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-indigo-600 placeholder:text-gray-400 bg-white",G),children:[y!==null&&f.jsx("div",{className:"py-2","aria-hidden":"true",children:f.jsx("div",{className:"py-px",children:f.jsx("div",{className:I})})}),P&&f.jsx("textarea",{name:v,id:p,className:"block w-full resize-none border-0 bg-transparent py-1.5 text-gray-400 placeholder:text-gray-400 focus:ring-0 text-sm",placeholder:g,value:C,onChange:h,rows:2,readOnly:x}),f.jsx("textarea",{style:{height:M>0?M:"auto"},placeholder:s,rows:l,name:i,id:n,className:N(P||Y?"block w-full resize-none border-0 bg-transparent py-1.5 placeholder:text-gray-400 focus:ring-0":"block w-full rounded-md border-0 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset sm:leading-6",G,o!==""&&o),readOnly:c,onChange:h,value:b,"data-testid":`textarea-${n}`,ref:D}),T!==null&&f.jsx("div",{className:"py-2","aria-hidden":"true",children:f.jsx("div",{className:"py-px",children:f.jsx("div",{className:F})})})]}),T!==null&&f.jsx("div",{className:"absolute bottom-2 left-3 w-full",children:T})]}),u.length>0&&m&&f.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${n}`,children:u})]})}const Rs=({className:e="",children:n,message:t=""})=>{const[r,o]=a.useState(!1),l=()=>{t!==""&&o(!0)},i=()=>{o(!1)};return f.jsx("div",{className:"relative",children:f.jsxs("div",{onMouseLeave:i.bind(null,r),"data-testid":"container-tooltip",children:[f.jsx("div",{className:`
|
|
40
40
|
${r?"":"text-opacity-90"}
|
|
41
41
|
text-white group bg-orange-700 rounded-md inline-flex items-center text-base font-medium hover:text-opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,onMouseEnter:l.bind(null,r),onMouseLeave:i.bind(null,r),"data-testid":"open-tooltip",children:n}),f.jsx(Re,{as:a.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",show:r,children:f.jsx("div",{className:N("absolute z-20 px-4 mt-0 sm:px-0",e!==""&&e),children:f.jsx("div",{className:"bg-white p-2 text-center rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",onMouseEnter:l.bind(null,r),onMouseLeave:i.bind(null,r),"data-testid":"message",children:t})})})]})})},Bs=({children:e,data:n,className:t="",classNameTooltip:r="w-full",classNameMenu:o="",classNameMenuItems:l="",classNameContainerSearch:i="px-5",isSelectMultiple:s=!1,optionsSelect:u,propObject:c="name",propId:m="id",textNewItem:h="",defaultId:b=null,loading:p=!1,search:v=null,searchPlaceHolder:g="Buscar...",valueSearch:x=void 0,idsOptionSelect:C=null,isComponent:y,hiddenMenu:T=!1,id:I,onClick:F=()=>{},isRelative:P=!0,isMaxWidth:R=!1,isTag:Y=!1,isClear:D=!1,clear:M=null,applyButton:B=null,applyButtonText:G="Aplicar",tagsParent:J=[],isReadOnly:ae,isDisabledApplyButton:w=!0,isOpenMenu:L=void 0})=>{const[k,Q]=a.useState(new Set),[H,ne]=a.useState(new Map);a.useEffect(()=>{C!==null&&Q(new Set(new Set(C)))},[C]),a.useEffect(()=>{if(J.length===0)return;const $=new Map;J.forEach(U=>$.set(U.id,U)),ne($)},[J]),a.useEffect(()=>{D&&(Q(new Set),ne(new Map),M&&M())},[M,D]);const fe=$=>{let U=new Map(H),ie=new Set(k),A=null;if(b!==null&&($[m]===b&&(A=crypto.randomUUID()),A!==null&&($[m]=A),A!==null&&($[c]=$[c].replace(h,"").trim())),ie.has($[m])?ie.delete($[m]):ie.add($[m]),U.has($[m])?U.delete($[m]):U.set($[m],$),!s){const q=Array.from(ie),W=Array.from(U);q.shift(),W.shift(),ie=ie.size===2?new Set(q):ie,U=U.size===2?new Map(W):U}u($,Array.from(ie),A!==null),Q(ie),ne(U)},ge=$=>{F($===!0?-1:I)},Se=$=>{const U=new Set(k),ie=new Map(H);U.delete($[m]),ie.delete($[m]),u($,Array.from(U)),Q(U),ne(ie)},be=()=>{if(k.size===0)return;const $=new Set(k),U=new Map(H);$.clear(),U.clear(),u(null,Array.from($)),Q($),ne(U)};function Ae($){if(typeof $!="string")return $;const U=$.toLowerCase();return U.charAt(0).toUpperCase()+U.slice(1)}return f.jsxs(pt,{as:"div",className:N("inline-block text-left",P&&"relative",o!==""&&o),onClick:()=>ge(!0),"data-testid":`menu-${I}`,id:I,children:[f.jsx("style",{children:`
|
|
42
42
|
.blue {
|