rharuow-ds 1.5.3 → 1.5.4
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/rharuow-ds.cjs.js +1 -1
- package/dist/rharuow-ds.es.js +103 -105
- package/package.json +1 -1
package/dist/rharuow-ds.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),G=require("react-hook-form");function _e(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const e=_e(y);function ye(t){var o,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var f=t.length;for(o=0;o<f;o++)t[o]&&(r=ye(t[o]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Te(){for(var t,o,r=0,n="",f=arguments.length;r<f;r++)(t=arguments[r])&&(o=ye(t))&&(n&&(n+=" "),n+=o);return n}function u(...t){return Te(...t)}const Pe=({children:t,variant:o="default",className:r="",...n})=>{const f="px-4 py-2 rounded font-medium transition",E={default:"bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",outline:"border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",secondary:"bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"};return y.createElement("button",{className:u(f,E[o],r),...n},t)},Ee=e.forwardRef(({name:t,className:o,type:r="text",label:n,onFocus:f,onBlur:E,Icon:m,iconClassName:P,iconAction:z,containerClassName:C,...v},w)=>{var J,V,I;const[p,M]=e.useState(!1),[h,R]=e.useState(!1),c=G.useFormContext(),i=c==null?void 0:c.control,x=c==null?void 0:c.register,L=i&&t?G.useWatch({control:i,name:t}):void 0,k=v.value??L??"",g=(I=(V=(J=c==null?void 0:c.formState)==null?void 0:J.errors)==null?void 0:V[t])==null?void 0:I.message,H=["date","datetime-local","time","month","week"].includes(r),b=p||!!k||H,$=r==="password"?h?"text":"password":r,D=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:"currentColor"})),N=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",fill:"currentColor"})),q=()=>{R(!h)};return e.createElement("div",{className:u("relative",C)},e.createElement("input",{id:v.id||t,type:$,className:u("peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",r==="password"||m?"pr-12":"",o),onFocus:S=>{M(!0),f&&f(S)},...c&&t?(()=>{const S=x(t),Q=S.onBlur;return{...S,ref:O=>{typeof w=="function"?w(O):w&&(w.current=O),S.ref&&S.ref(O)},onBlur:O=>{M(!1),E&&E(O),Q&&Q(O)}}})():{ref:w,onBlur:S=>{M(!1),E&&E(S)}},...v}),n&&e.createElement("label",{htmlFor:v.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",b?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},n),r==="password"&&e.createElement("button",{type:"button",className:"absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-[var(--primary,#2563eb)] transition-colors duration-200 focus:outline-none focus:text-[var(--primary,#2563eb)]",onClick:q,"aria-label":h?"Esconder senha":"Mostrar senha",tabIndex:-1},h?e.createElement(N,null):e.createElement(D,null)),m&&r!=="password"&&e.createElement("div",{className:u("absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",P),onClick:z},e.createElement(m,null)),g&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},g))});Ee.displayName="Input";const Ce=e.forwardRef(({name:t,label:o,options:r,className:n,containerClassName:f,isClearable:E,searchable:m=!1,filterPlaceholder:P="Digite para filtrar...",caseSensitive:z=!1,filterFunction:C,onFocus:v,onBlur:w,...p},M)=>{var te,ae,l,_;const[h,R]=e.useState(!1),[c,i]=e.useState(!1),[x,L]=e.useState(""),[k,g]=e.useState({top:0,left:0,width:0}),F=e.useRef(null),H=e.useRef(null),b=G.useFormContext(),$=b==null?void 0:b.control,D=$&&t?G.useWatch({control:$,name:t}):void 0,N=p.value??D??"",q=(l=(ae=(te=b==null?void 0:b.formState)==null?void 0:te.errors)==null?void 0:ae[t])==null?void 0:l.message,V=C||((a,T)=>{const j=z?a.label:a.label.toLowerCase(),U=z?T:T.toLowerCase();return j.includes(U)}),I=x.trim()?r.filter(a=>V(a,x.trim())):r,S=r.find(a=>a.value===N),Q=m&&c?x:(S==null?void 0:S.label)||"",O=h||!!N||m&&!!x,A=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),X=e.useCallback(()=>{if(F.current&&c){const a=F.current.getBoundingClientRect(),T=A(),j=window.innerHeight,U=window.innerWidth,Y=152;let d=a.bottom+4,W=a.left;if(T){const re=j-a.bottom,s=a.top;re<Y&&s>Y&&(d=a.top-Y-4);const B=16,K=U-a.width-B;W=Math.min(Math.max(W,B),K)}else j-a.bottom<Y&&(d=a.top-Y-4);g({top:d,left:W,width:a.width})}},[c,A]);e.useEffect(()=>{if(X(),c){const a=()=>X(),T=()=>X();return window.addEventListener("resize",a),window.addEventListener("scroll",T,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",T,!0)}}},[c,X]),e.useEffect(()=>{const a=T=>{F.current&&!F.current.contains(T.target)&&(i(!1),R(!1))};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]);const ne=()=>{i(a=>!a),R(!0)},Z=a=>{R(!0),v&&v(a)},ee=a=>{w&&w(a)},le=a=>{L(a.target.value)},oe=a=>{if(b&&t&&b.setValue(t,a),p.onChange){const T={target:{value:a}};p.onChange(T)}i(!1),R(!1),L("")};return e.createElement("div",{className:u("relative",f),ref:F},e.createElement("div",{id:p.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":c,className:u("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:m?void 0:ne,onFocus:m?void 0:Z,onBlur:m?void 0:ee,ref:M},m?e.createElement("input",{ref:H,type:"text",value:Q,onChange:le,onFocus:m?a=>{R(!0),i(!0),v&&v(a)}:void 0,onBlur:m?a=>{w&&w(a)}:void 0,placeholder:o?"":P||"Selecione...",className:u("w-full bg-transparent border-none outline-none text-sm",!N&&!x&&"text-gray-400")}):e.createElement("span",{className:u("block truncate",!N&&"text-gray-400")},((_=r.find(a=>a.value===N))==null?void 0:_.label)||!o&&"Selecione..."),E&&N&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:a=>{if(a.stopPropagation(),b&&t&&b.setValue(t,""),p.onChange){const T={target:{value:""}};p.onChange(T)}i(!1),R(!1)}},"✕")),o&&e.createElement("label",{htmlFor:p.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",O?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},o),e.createElement("div",{className:u("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",c?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:c?"9.5rem":"0",overflowY:r.length>3?"auto":"hidden",position:"fixed",top:c?`${k.top}px`:"auto",left:c?`${k.left}px`:"auto",width:c?`${k.width}px`:"auto",zIndex:9999,boxShadow:c?"var(--select-dropdown-shadow)":"none"}},I.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},"Nenhuma opção encontrada"):I.map(a=>e.createElement("div",{key:a.value,className:u("px-3 py-2 cursor-pointer text-sm transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",N===a.value&&"bg-[var(--select-dropdown-selected)]"),onMouseDown:()=>oe(a.value)},a.label))),q&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},q))});Ce.displayName="Select";const Ne=e.forwardRef(({name:t,className:o,label:r,onFocus:n,onBlur:f,Icon:E,iconClassName:m,iconAction:P,containerClassName:z,rows:C=4,...v},w)=>{var g,F,H;const[p,M]=e.useState(!1),h=G.useFormContext(),R=h==null?void 0:h.control,c=h==null?void 0:h.register,i=R&&t?G.useWatch({control:R,name:t}):void 0,x=v.value??i??"",L=(H=(F=(g=h==null?void 0:h.formState)==null?void 0:g.errors)==null?void 0:F[t])==null?void 0:H.message,k=p||!!x;return e.createElement("div",{className:u("relative",z)},e.createElement("textarea",{id:v.id||t,rows:C,className:u("peer flex min-h-[80px] w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 resize-vertical",E?"pr-12":"",o),onFocus:b=>{M(!0),n&&n(b)},...h&&t?(()=>{const b=c(t),$=b.onBlur;return{...b,ref:D=>{typeof w=="function"?w(D):w&&(w.current=D),b.ref&&b.ref(D)},onBlur:D=>{M(!1),f&&f(D),$&&$(D)}}})():{ref:w,onBlur:b=>{M(!1),f&&f(b)}},...v}),r&&e.createElement("label",{htmlFor:v.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",k?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),E&&e.createElement("div",{className:u("absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",m),onClick:P},e.createElement(E,null)),L&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},L))});Ne.displayName="Textarea";const Se=e.forwardRef(({name:t,label:o,loadOptions:r,className:n,containerClassName:f,isClearable:E,defaultOptions:m=!1,loadingMessage:P="Carregando...",noOptionsMessage:z="Nenhuma opção encontrada",searchable:C=!1,debounceMs:v=300,onFocus:w,onBlur:p,...M},h)=>{var j,U,Y;const[R,c]=e.useState(!1),[i,x]=e.useState(!1),[L,k]=e.useState([]),[g,F]=e.useState(!1),[H,b]=e.useState(""),[$,D]=e.useState(""),[N,q]=e.useState({top:0,left:0,width:0}),J=e.useRef(null),V=e.useRef(null),I=G.useFormContext(),S=I==null?void 0:I.control,Q=S&&t?G.useWatch({control:S,name:t}):void 0,O=M.value??Q??"",A=(Y=(U=(j=I==null?void 0:I.formState)==null?void 0:j.errors)==null?void 0:U[t])==null?void 0:Y.message,X=R||!!O,ne=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),Z=e.useCallback(()=>{if(J.current&&i){const d=J.current.getBoundingClientRect(),W=ne(),re=window.innerHeight,s=window.innerWidth,B=152;let K=d.bottom+4,ie=d.left;if(W){const se=re-d.bottom,de=d.top;se<B&&de>B&&(K=d.top-B-4);const ce=16,ue=s-d.width-ce;ie=Math.min(Math.max(ie,ce),ue)}else re-d.bottom<B&&(K=d.top-B-4);q({top:K,left:ie,width:d.width})}},[i,ne]);e.useEffect(()=>{if(Z(),i){const d=()=>Z(),W=()=>Z();return window.addEventListener("resize",d),window.addEventListener("scroll",W,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",W,!0)}}},[i,Z]),e.useEffect(()=>{const d=setTimeout(()=>{D(H)},v);return()=>clearTimeout(d)},[H,v]),e.useEffect(()=>{(i||m&&L.length===0)&&ee(C?$:void 0)},[$,i]),e.useEffect(()=>{m===!0?ee():Array.isArray(m)&&k(m)},[]);const ee=async d=>{try{F(!0);const W=await r(d);k(W)}catch(W){console.error("Error loading options:",W),k([])}finally{F(!1)}};e.useEffect(()=>{const d=W=>{J.current&&!J.current.contains(W.target)&&(x(!1),c(!1),b(""))};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[]);const le=()=>{i||(x(!0),c(!0),C&&V.current&&setTimeout(()=>{var d;return(d=V.current)==null?void 0:d.focus()},0))},oe=d=>{c(!0),w&&w(d)},te=d=>{p&&p(d)},ae=d=>{b(d.target.value)},l=d=>{if(I&&t&&I.setValue(t,d),M.onChange){const W={target:{value:d}};M.onChange(W)}x(!1),c(!1),b("")},_=d=>{if(d.stopPropagation(),I&&t&&I.setValue(t,""),M.onChange){const W={target:{value:""}};M.onChange(W)}x(!1),c(!1),b("")},a=L.find(d=>d.value===O),T=C&&i?H:(a==null?void 0:a.label)||"";return e.createElement("div",{className:u("relative",f),ref:J},e.createElement("div",{id:M.id||t,tabIndex:C?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":i,className:u("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:le,onFocus:C?void 0:oe,onBlur:C?void 0:te,ref:h},C?e.createElement("input",{ref:V,type:"text",value:T,onChange:ae,onFocus:oe,onBlur:te,placeholder:o?"":"Selecione...",className:u("w-full bg-transparent border-none outline-none text-sm",!O&&!H&&"text-gray-400")}):e.createElement("span",{className:u("block truncate",!O&&"text-gray-400")},(a==null?void 0:a.label)||!o&&"Selecione..."),g&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),E&&O&&!g&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:_},"✕")),o&&e.createElement("label",{htmlFor:M.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",X?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},o),e.createElement("div",{className:u("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",i?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:i?"9.5rem":"0",overflowY:L.length>3?"auto":"hidden",position:"fixed",top:i?`${N.top}px`:"auto",left:i?`${N.left}px`:"auto",width:i?`${N.width}px`:"auto",zIndex:9999,boxShadow:i?"var(--select-dropdown-shadow)":"none"}},g?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},P):L.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},z):L.map(d=>e.createElement("div",{key:d.value,className:u("px-3 py-2 cursor-pointer text-sm transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",O===d.value&&"bg-[var(--select-dropdown-selected)]"),onMouseDown:()=>l(d.value)},d.label))),A&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},A))});Se.displayName="AsyncSelect";const ke=e.forwardRef(({name:t,label:o,options:r,className:n,containerClassName:f,isClearable:E,searchable:m=!1,filterPlaceholder:P="Digite para filtrar...",caseSensitive:z=!1,filterFunction:C,onFocus:v,onBlur:w,...p},M)=>{var oe,te,ae;const[h,R]=e.useState(!1),[c,i]=e.useState(!1),[x,L]=e.useState(""),[k,g]=e.useState({top:0,left:0,width:0}),F=e.useRef(null),H=e.useRef(null),b=G.useFormContext(),$=b==null?void 0:b.control,D=$&&t?G.useWatch({control:$,name:t}):void 0,N=p.value??D??[],q=(ae=(te=(oe=b==null?void 0:b.formState)==null?void 0:oe.errors)==null?void 0:te[t])==null?void 0:ae.message,V=C||((l,_)=>{const a=z?l.label:l.label.toLowerCase(),T=z?_:_.toLowerCase();return a.includes(T)}),I=x.trim()?r.filter(l=>V(l,x.trim())):r,S=h||N&&N.length>0||m&&!!x,Q=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),O=e.useCallback(()=>{if(F.current&&c){const l=F.current.getBoundingClientRect(),_=Q(),a=window.innerHeight,T=window.innerWidth,j=152;let U=l.bottom+4,Y=l.left;if(_){const d=a-l.bottom,W=l.top;d<j&&W>j&&(U=l.top-j-4);const re=16,s=T-l.width-re;Y=Math.min(Math.max(Y,re),s)}else a-l.bottom<j&&(U=l.top-j-4);g({top:U,left:Y,width:l.width})}},[c,Q]);e.useEffect(()=>{if(O(),c){const l=()=>O(),_=()=>O();return window.addEventListener("resize",l),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",_,!0)}}},[c,O]),e.useEffect(()=>{const l=_=>{F.current&&!F.current.contains(_.target)&&(i(!1),R(!1))};return document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[]);const A=()=>{i(l=>!l),R(!0)},X=l=>{R(!0),v&&v(l)},ne=l=>{w&&w(l)},Z=l=>{var a;let _;N.includes(l)?_=N.filter(T=>T!==l):_=[...N,l],b&&t&&b.setValue(t,_),p.onChange&&((a=p.onChange)==null||a.call(p,{target:{value:_}})),R(!0)},ee=l=>{var _;l.stopPropagation(),b&&t&&b.setValue(t,[]),p.onChange&&((_=p.onChange)==null||_.call(p,{target:{value:[]}})),i(!1),R(!1)},le=l=>{L(l.target.value)};return e.createElement("div",{className:u("relative",f),ref:F},e.createElement("div",{id:p.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":c,className:u("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:m?void 0:A,onFocus:m?void 0:X,onBlur:m?void 0:ne,ref:M},e.createElement("div",{className:"flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",style:{scrollbarWidth:"none"}},N&&N.length>0?r.filter(l=>N.includes(l.value)).map(l=>e.createElement("span",{key:l.value,className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:l.label},l.label),e.createElement("button",{type:"button",className:"ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${l.label}`,tabIndex:-1,onClick:_=>{_.stopPropagation();const a=N.filter(T=>T!==l.value);b&&t&&b.setValue(t,a),p.onChange&&p.onChange({target:{value:a}})}},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))):!o&&!m&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione..."),m&&e.createElement("input",{ref:H,type:"text",value:x,onChange:le,onFocus:l=>{R(!0),i(!0),v&&v(l)},onBlur:l=>{w&&w(l)},placeholder:o?N&&N.length>0?"":P:P||"Selecione...",className:"flex-1 bg-transparent border-none outline-none text-sm min-w-[100px]"})),E&&N&&N.length>0&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:ee},"✕")),o&&e.createElement("label",{htmlFor:p.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",S?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},o),e.createElement("div",{className:u("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",c?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:c?"9.5rem":"0",overflowY:r.length>3?"auto":"hidden",position:"fixed",top:c?`${k.top}px`:"auto",left:c?`${k.left}px`:"auto",width:c?`${k.width}px`:"auto",zIndex:9999,boxShadow:c?"var(--select-dropdown-shadow)":"none"}},I.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},"Nenhuma opção encontrada"):I.map(l=>e.createElement("div",{key:l.value,className:u("px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",N.includes(l.value)&&"bg-[var(--select-dropdown-selected)] font-semibold"),onMouseDown:()=>Z(l.value)},e.createElement("input",{type:"checkbox",checked:N.includes(l.value),readOnly:!0,className:"accent-blue-500"}),l.label))),q&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},q))});ke.displayName="MultiSelect";const Re=e.forwardRef(({name:t,label:o,loadOptions:r,className:n,containerClassName:f,isClearable:E,defaultOptions:m=!1,loadingMessage:P="Carregando...",noOptionsMessage:z="Nenhuma opção encontrada",searchable:C=!1,debounceMs:v=300,maxSelectedDisplay:w=3,onFocus:p,onBlur:M,...h},R)=>{var d,W,re;const[c,i]=e.useState(!1),[x,L]=e.useState(!1),[k,g]=e.useState([]),[F,H]=e.useState(!1),[b,$]=e.useState(""),[D,N]=e.useState(""),[q,J]=e.useState({top:0,left:0,width:0}),V=e.useRef(null),I=e.useRef(null),S=G.useFormContext(),Q=S==null?void 0:S.control,O=Q&&t?G.useWatch({control:Q,name:t}):void 0,A=h.value??O??[],X=(re=(W=(d=S==null?void 0:S.formState)==null?void 0:d.errors)==null?void 0:W[t])==null?void 0:re.message,ne=c||A&&A.length>0,Z=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),ee=e.useCallback(()=>{if(V.current&&x){const s=V.current.getBoundingClientRect(),B=Z(),K=window.innerHeight,ie=window.innerWidth,se=152;let de=s.bottom+4,ce=s.left;if(B){const ue=K-s.bottom,Me=s.top;ue<se&&Me>se&&(de=s.top-se-4);const we=16,Le=ie-s.width-we;ce=Math.min(Math.max(ce,we),Le)}else K-s.bottom<se&&(de=s.top-se-4);J({top:de,left:ce,width:s.width})}},[x,Z]);e.useEffect(()=>{if(ee(),x){const s=()=>ee(),B=()=>ee();return window.addEventListener("resize",s),window.addEventListener("scroll",B,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",B,!0)}}},[x,ee]),e.useEffect(()=>{const s=setTimeout(()=>{N(b)},v);return()=>clearTimeout(s)},[b,v]),e.useEffect(()=>{(x||m&&k.length===0)&&le(C?D:void 0)},[D,x]),e.useEffect(()=>{m===!0?le():Array.isArray(m)&&g(m)},[]);const le=async s=>{try{H(!0);const B=await r(s);g(B)}catch(B){console.error("Error loading options:",B),g([])}finally{H(!1)}};e.useEffect(()=>{const s=B=>{V.current&&!V.current.contains(B.target)&&(L(!1),i(!1),$(""))};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[]);const oe=()=>{x||(L(!0),i(!0),C&&I.current&&setTimeout(()=>{var s;return(s=I.current)==null?void 0:s.focus()},0))},te=s=>{i(!0),p&&p(s)},ae=s=>{M&&M(s)},l=s=>{$(s.target.value)},_=s=>{let B;A.includes(s)?B=A.filter(K=>K!==s):B=[...A,s],S&&t&&S.setValue(t,B),h.onChange&&h.onChange({target:{value:B}}),i(!0)},a=(s,B)=>{B.stopPropagation();const K=A.filter(ie=>ie!==s);S&&t&&S.setValue(t,K),h.onChange&&h.onChange({target:{value:K}})},T=s=>{s.stopPropagation(),S&&t&&S.setValue(t,[]),h.onChange&&h.onChange({target:{value:[]}}),L(!1),i(!1),$("")},j=k.filter(s=>A.includes(s.value)),U=j.slice(0,w),Y=j.length-w;return e.createElement("div",{className:u("relative",f),ref:V},e.createElement("div",{id:h.id||t,tabIndex:C?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":x,className:u("peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:oe,onFocus:C?void 0:te,onBlur:C?void 0:ae,ref:R},e.createElement("div",{className:"flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full"},U.map(s=>e.createElement("span",{key:s.value,className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:s.label},s.label),e.createElement("button",{type:"button",className:"ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${s.label}`,tabIndex:-1,onClick:B=>a(s.value,B)},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))),Y>0&&e.createElement("span",{className:"flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs"},"+",Y," mais"),C?e.createElement("input",{ref:I,type:"text",value:b,onChange:l,onFocus:te,onBlur:ae,placeholder:A.length===0&&!o?"Selecione...":"",className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"}):A.length===0&&!o&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione...")),F&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),E&&A&&A.length>0&&!F&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:T},"✕")),o&&e.createElement("label",{htmlFor:h.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",ne?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},o),e.createElement("div",{className:u("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",x?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:x?"9.5rem":"0",overflowY:k.length>3?"auto":"hidden",position:"fixed",top:x?`${q.top}px`:"auto",left:x?`${q.left}px`:"auto",width:x?`${q.width}px`:"auto",zIndex:9999,boxShadow:x?"var(--select-dropdown-shadow)":"none"}},F?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},P):k.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},z):k.map(s=>e.createElement("div",{key:s.value,className:u("px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",A.includes(s.value)&&"bg-[var(--select-dropdown-selected)] font-semibold"),onMouseDown:()=>_(s.value)},e.createElement("input",{type:"checkbox",checked:A.includes(s.value),readOnly:!0,className:"accent-blue-500"}),s.label))),X&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},X))});Re.displayName="MultiAsyncSelect";const ze={sm:"h-10 text-sm px-3",md:"h-12 text-base px-4",lg:"h-16 text-lg px-6"},Fe=e.forwardRef(({name:t,label:o,options:r,className:n,containerClassName:f,optionClassName:E,direction:m="row",size:P="md",onFocus:z,onBlur:C,...v},w)=>{var x,L,k;const p=G.useFormContext(),M=p==null?void 0:p.control,h=M&&t?G.useWatch({control:M,name:t}):void 0,R=v.value??h??"",c=(k=(L=(x=p==null?void 0:p.formState)==null?void 0:x.errors)==null?void 0:L[t])==null?void 0:k.message,i=g=>{p&&t&&p.setValue(t,g),v.onChange&&v.onChange({target:{value:g}})};return e.createElement("div",{className:u("relative",f),ref:w},o&&e.createElement("label",{htmlFor:t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200","top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white")},o),e.createElement("div",{className:u("flex gap-2 w-full pt-6",m==="row"?"flex-row":"flex-col",n),"aria-label":o,tabIndex:-1,onFocus:z,onBlur:C},r.map(g=>e.createElement("button",{key:g.value,type:"button",className:u("relative flex items-center justify-center border rounded-lg transition-all duration-200 shadow-sm px-4 focus:outline-none focus:ring-2 focus:ring-[var(--primary-hover,#dbeafe)]",ze[P],R===g.value?"border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]":"border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",E),"aria-pressed":R===g.value,"data-selected":R===g.value,tabIndex:0,onClick:()=>i(g.value),onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),i(g.value))}},g.icon&&e.createElement("span",{className:"mr-2 text-lg flex items-center"},g.icon),e.createElement("span",{className:"truncate font-medium"},g.label)))),c&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},c))});Fe.displayName="RadioGroup";const fe=y.forwardRef(({children:t,className:o,as:r="div",...n},f)=>y.createElement(r,{ref:f,className:u("px-6 py-4 border-b","bg-[var(--card-header-bg,rgba(249,250,251,0.5))]","border-[var(--card-header-border,#e5e7eb)]","text-[var(--card-text,#111827)]",o),...n},t));fe.displayName="CardHeader";const me=y.forwardRef(({children:t,className:o,as:r="div",...n},f)=>y.createElement(r,{ref:f,className:u("px-6 py-4","flex-1","bg-[var(--card-bg,#ffffff)]","text-[var(--card-text,#111827)]",o),...n},t));me.displayName="CardBody";const pe=y.forwardRef(({children:t,className:o,as:r="div",...n},f)=>y.createElement(r,{ref:f,className:u("px-6 py-4 border-t","bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]","border-[var(--card-footer-border,#e5e7eb)]","text-[var(--card-text,#111827)]",o),...n},t));pe.displayName="CardFooter";const Ie=y.forwardRef(({children:t,className:o,variant:r="default",size:n="md",padding:f="none",rounded:E="lg",constrainWidth:m=!1,...P},z)=>{const C={default:"bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-sm,0_1px_2px_0_rgb(0_0_0_/_0.05))]",outlined:"bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",elevated:"bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-lg,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",flat:"bg-[var(--card-bg,#ffffff)] border-0"},v={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},w={none:"",sm:"p-3",md:"p-4",lg:"p-6"},p={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"};return y.createElement("div",{ref:z,className:u("flex flex-col","overflow-hidden",C[r],m&&v[n],w[f],p[E],o),...P},t)}),We=Object.assign(Ie,{Header:fe,Body:me,Footer:pe}),Be=y.forwardRef(({children:t,className:o,variant:r="default",size:n="md",responsive:f=!1,stickyHeader:E=!1,...m},P)=>{const z=u("w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",{"border border-[var(--table-border)]":r==="bordered"},{"text-sm":n==="sm","text-base":n==="md","text-lg":n==="lg"},o),C=u({"overflow-x-auto":f,"max-h-96 overflow-y-auto":E}),v=y.createElement("table",{ref:P,className:z,...m},t);return f||E?y.createElement("div",{className:C},v):v}),be=y.forwardRef(({children:t,className:o,as:r="thead",...n},f)=>y.createElement(r,{ref:f,className:u("border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",{"sticky top-0 z-10":r==="thead"},o),...n},t)),ve=y.forwardRef(({children:t,className:o,as:r="tbody",...n},f)=>y.createElement(r,{ref:f,className:u("[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]","[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",o),...n},t)),xe=y.forwardRef(({children:t,className:o,as:r="tfoot",...n},f)=>y.createElement(r,{ref:f,className:u("border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",o),...n},t)),ge=y.forwardRef(({children:t,className:o,variant:r="default",...n},f)=>y.createElement("tr",{ref:f,className:u("border-b border-[var(--table-border)] transition-colors",{"hover:bg-[var(--table-row-hover)]":r==="hover","bg-[var(--table-row-selected)]":r==="selected"},o),...n},t)),he=y.forwardRef(({children:t,className:o,as:r="td",align:n="left",scope:f,colSpan:E,rowSpan:m,...P},z)=>y.createElement(r,{ref:z,scope:r==="th"?f:void 0,colSpan:E,rowSpan:m,className:u("px-4 py-3 text-left",{"font-semibold":r==="th","text-sm":r==="td","text-center":n==="center","text-right":n==="right"},o),...P},t));Be.displayName="Table";be.displayName="TableHeader";ve.displayName="TableBody";xe.displayName="TableFooter";ge.displayName="TableRow";he.displayName="TableCell";const Oe=Object.assign(Be,{Header:be,Body:ve,Footer:xe,Row:ge,Cell:he}),Ae=({content:t,children:o,position:r="top",className:n="",disabled:f=!1})=>{const[E,m]=y.useState(!1),[P,z]=y.useState(r),C=y.useRef(null),v=y.useRef(null);y.useEffect(()=>{if(!E||!C.current||!v.current)return;const i=C.current,L=v.current.getBoundingClientRect(),k=i.getBoundingClientRect();let g=r;const F=window.innerWidth,H=window.innerHeight;r==="top"&&L.top<k.height+10?g="bottom":r==="bottom"&&L.bottom+k.height+10>H?g="top":r==="left"&&L.left<k.width+10?g="right":r==="right"&&L.right+k.width+10>F&&(g="left"),z(g)},[E,r]);const w=()=>{f||m(!0)},p=()=>{m(!1)},M=()=>{f||m(!0)},h=()=>{m(!1)},R=()=>{const i="absolute z-[9999] pointer-events-none";switch(P){case"top":return`${i} bottom-full left-1/2 transform -translate-x-1/2 mb-2`;case"bottom":return`${i} top-full left-1/2 transform -translate-x-1/2 mt-2`;case"left":return`${i} right-full top-1/2 transform -translate-y-1/2 mr-2`;case"right":return`${i} left-full top-1/2 transform -translate-y-1/2 ml-2`;default:return`${i} bottom-full left-1/2 transform -translate-x-1/2 mb-2`}},c=()=>{const i="absolute w-2 h-2 bg-[var(--tooltip-bg,#374151)] transform rotate-45";switch(P){case"top":return`${i} top-full left-1/2 transform -translate-x-1/2 -translate-y-1/2`;case"bottom":return`${i} bottom-full left-1/2 transform -translate-x-1/2 translate-y-1/2`;case"left":return`${i} left-full top-1/2 transform -translate-y-1/2 -translate-x-1/2`;case"right":return`${i} right-full top-1/2 transform -translate-y-1/2 translate-x-1/2`;default:return`${i} top-full left-1/2 transform -translate-x-1/2 -translate-y-1/2`}};return f||!t?y.createElement(y.Fragment,null,o):y.createElement("div",{className:"relative inline-block",ref:v,onMouseEnter:w,onMouseLeave:p,onFocus:M,onBlur:h},o,E&&y.createElement("div",{ref:C,className:u(R(),"px-2 py-1 text-sm rounded whitespace-nowrap","bg-[var(--tooltip-bg,#374151)] text-[var(--tooltip-text,#fff)]","shadow-[var(--tooltip-shadow,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]","transition-opacity duration-200 ease-in-out",n),style:{zIndex:999999},role:"tooltip","aria-hidden":!E},t,y.createElement("div",{className:c()})))};exports.AsyncSelect=Se;exports.Button=Pe;exports.Card=We;exports.CardBody=me;exports.CardFooter=pe;exports.CardHeader=fe;exports.Input=Ee;exports.MultiAsyncSelect=Re;exports.MultiSelect=ke;exports.RadioGroup=Fe;exports.Select=Ce;exports.Table=Oe;exports.TableBody=ve;exports.TableCell=he;exports.TableFooter=xe;exports.TableHeader=be;exports.TableRow=ge;exports.Textarea=Ne;exports.Tooltip=Ae;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),G=require("react-hook-form");function _e(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const e=_e(y);function ye(t){var o,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var f=t.length;for(o=0;o<f;o++)t[o]&&(r=ye(t[o]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Te(){for(var t,o,r=0,n="",f=arguments.length;r<f;r++)(t=arguments[r])&&(o=ye(t))&&(n&&(n+=" "),n+=o);return n}function u(...t){return Te(...t)}const Pe=({children:t,variant:o="default",className:r="",...n})=>{const f="px-4 py-2 rounded font-medium transition",E={default:"bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",outline:"border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",secondary:"bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"};return y.createElement("button",{className:u(f,E[o],r),...n},t)},Ee=e.forwardRef(({name:t,className:o,type:r="text",label:n,onFocus:f,onBlur:E,Icon:m,iconClassName:P,iconAction:z,containerClassName:C,...v},w)=>{var J,V,I;const[p,M]=e.useState(!1),[h,R]=e.useState(!1),c=G.useFormContext(),i=c==null?void 0:c.control,x=c==null?void 0:c.register,L=i&&t?G.useWatch({control:i,name:t}):void 0,k=v.value??L??"",g=(I=(V=(J=c==null?void 0:c.formState)==null?void 0:J.errors)==null?void 0:V[t])==null?void 0:I.message,H=["date","datetime-local","time","month","week"].includes(r),b=p||!!k||H,$=r==="password"?h?"text":"password":r,D=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:"currentColor"})),N=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",fill:"currentColor"})),q=()=>{R(!h)};return e.createElement("div",{className:u("relative",C)},e.createElement("input",{id:v.id||t,type:$,className:u("peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",r==="password"||m?"pr-12":"",o),onFocus:S=>{M(!0),f&&f(S)},...c&&t?(()=>{const S=x(t),Q=S.onBlur;return{...S,ref:O=>{typeof w=="function"?w(O):w&&(w.current=O),S.ref&&S.ref(O)},onBlur:O=>{M(!1),E&&E(O),Q&&Q(O)}}})():{ref:w,onBlur:S=>{M(!1),E&&E(S)}},...v}),n&&e.createElement("label",{htmlFor:v.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",b?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},n),r==="password"&&e.createElement("button",{type:"button",className:"absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-[var(--primary,#2563eb)] transition-colors duration-200 focus:outline-none focus:text-[var(--primary,#2563eb)]",onClick:q,"aria-label":h?"Esconder senha":"Mostrar senha",tabIndex:-1},h?e.createElement(N,null):e.createElement(D,null)),m&&r!=="password"&&e.createElement("div",{className:u("absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",P),onClick:z},e.createElement(m,null)),g&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},g))});Ee.displayName="Input";const Ce=e.forwardRef(({name:t,label:o,options:r,className:n,containerClassName:f,isClearable:E,searchable:m=!1,filterPlaceholder:P="Digite para filtrar...",caseSensitive:z=!1,filterFunction:C,onFocus:v,onBlur:w,...p},M)=>{var te,ae,l,_;const[h,R]=e.useState(!1),[c,i]=e.useState(!1),[x,L]=e.useState(""),[k,g]=e.useState({top:0,left:0,width:0}),F=e.useRef(null),H=e.useRef(null),b=G.useFormContext(),$=b==null?void 0:b.control,D=$&&t?G.useWatch({control:$,name:t}):void 0,N=p.value??D??"",q=(l=(ae=(te=b==null?void 0:b.formState)==null?void 0:te.errors)==null?void 0:ae[t])==null?void 0:l.message,V=C||((a,T)=>{const j=z?a.label:a.label.toLowerCase(),U=z?T:T.toLowerCase();return j.includes(U)}),I=x.trim()?r.filter(a=>V(a,x.trim())):r,S=r.find(a=>a.value===N),Q=m&&c?x:(S==null?void 0:S.label)||"",O=h||!!N||m&&!!x,A=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),X=e.useCallback(()=>{if(F.current&&c){const a=F.current.getBoundingClientRect(),T=A(),j=window.innerHeight,U=window.innerWidth,Y=152;let d=a.bottom+4,W=a.left;if(T){const re=j-a.bottom,s=a.top;re<Y&&s>Y&&(d=a.top-Y-4);const B=16,K=U-a.width-B;W=Math.min(Math.max(W,B),K)}else j-a.bottom<Y&&(d=a.top-Y-4);g({top:d,left:W,width:a.width})}},[c,A]);e.useEffect(()=>{if(X(),c){const a=()=>X(),T=()=>X();return window.addEventListener("resize",a),window.addEventListener("scroll",T,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",T,!0)}}},[c,X]),e.useEffect(()=>{const a=T=>{F.current&&!F.current.contains(T.target)&&(i(!1),R(!1))};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]);const ne=()=>{i(a=>!a),R(!0)},Z=a=>{R(!0),v&&v(a)},ee=a=>{w&&w(a)},le=a=>{L(a.target.value)},oe=a=>{if(b&&t&&b.setValue(t,a),p.onChange){const T={target:{value:a}};p.onChange(T)}i(!1),R(!1),L("")};return e.createElement("div",{className:u("relative",f),ref:F},e.createElement("div",{id:p.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":c,className:u("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:m?void 0:ne,onFocus:m?void 0:Z,onBlur:m?void 0:ee,ref:M},m?e.createElement("input",{ref:H,type:"text",value:Q,onChange:le,onFocus:m?a=>{R(!0),i(!0),v&&v(a)}:void 0,onBlur:m?a=>{w&&w(a)}:void 0,placeholder:o?"":P||"Selecione...",className:u("w-full bg-transparent border-none outline-none text-sm",!N&&!x&&"text-gray-400")}):e.createElement("span",{className:u("block truncate",!N&&"text-gray-400")},((_=r.find(a=>a.value===N))==null?void 0:_.label)||!o&&"Selecione..."),E&&N&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:a=>{if(a.stopPropagation(),b&&t&&b.setValue(t,""),p.onChange){const T={target:{value:""}};p.onChange(T)}i(!1),R(!1)}},"✕")),o&&e.createElement("label",{htmlFor:p.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",O?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},o),e.createElement("div",{className:u("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",c?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:c?"9.5rem":"0",overflowY:r.length>3?"auto":"hidden",position:"fixed",top:c?`${k.top}px`:"auto",left:c?`${k.left}px`:"auto",width:c?`${k.width}px`:"auto",zIndex:9999,boxShadow:c?"var(--select-dropdown-shadow)":"none"}},I.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},"Nenhuma opção encontrada"):I.map(a=>e.createElement("div",{key:a.value,className:u("px-3 py-2 cursor-pointer text-sm transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",N===a.value&&"bg-[var(--select-dropdown-selected)]"),onMouseDown:()=>oe(a.value)},a.label))),q&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},q))});Ce.displayName="Select";const Ne=e.forwardRef(({name:t,className:o,label:r,onFocus:n,onBlur:f,Icon:E,iconClassName:m,iconAction:P,containerClassName:z,rows:C=4,...v},w)=>{var g,F,H;const[p,M]=e.useState(!1),h=G.useFormContext(),R=h==null?void 0:h.control,c=h==null?void 0:h.register,i=R&&t?G.useWatch({control:R,name:t}):void 0,x=v.value??i??"",L=(H=(F=(g=h==null?void 0:h.formState)==null?void 0:g.errors)==null?void 0:F[t])==null?void 0:H.message,k=p||!!x;return e.createElement("div",{className:u("relative",z)},e.createElement("textarea",{id:v.id||t,rows:C,className:u("peer flex min-h-[80px] w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 resize-vertical",E?"pr-12":"",o),onFocus:b=>{M(!0),n&&n(b)},...h&&t?(()=>{const b=c(t),$=b.onBlur;return{...b,ref:D=>{typeof w=="function"?w(D):w&&(w.current=D),b.ref&&b.ref(D)},onBlur:D=>{M(!1),f&&f(D),$&&$(D)}}})():{ref:w,onBlur:b=>{M(!1),f&&f(b)}},...v}),r&&e.createElement("label",{htmlFor:v.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",k?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),E&&e.createElement("div",{className:u("absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",m),onClick:P},e.createElement(E,null)),L&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},L))});Ne.displayName="Textarea";const Se=e.forwardRef(({name:t,label:o,loadOptions:r,className:n,containerClassName:f,isClearable:E,defaultOptions:m=!1,loadingMessage:P="Carregando...",noOptionsMessage:z="Nenhuma opção encontrada",searchable:C=!1,debounceMs:v=300,onFocus:w,onBlur:p,...M},h)=>{var j,U,Y;const[R,c]=e.useState(!1),[i,x]=e.useState(!1),[L,k]=e.useState([]),[g,F]=e.useState(!1),[H,b]=e.useState(""),[$,D]=e.useState(""),[N,q]=e.useState({top:0,left:0,width:0}),J=e.useRef(null),V=e.useRef(null),I=G.useFormContext(),S=I==null?void 0:I.control,Q=S&&t?G.useWatch({control:S,name:t}):void 0,O=M.value??Q??"",A=(Y=(U=(j=I==null?void 0:I.formState)==null?void 0:j.errors)==null?void 0:U[t])==null?void 0:Y.message,X=R||!!O,ne=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),Z=e.useCallback(()=>{if(J.current&&i){const d=J.current.getBoundingClientRect(),W=ne(),re=window.innerHeight,s=window.innerWidth,B=152;let K=d.bottom+4,ie=d.left;if(W){const se=re-d.bottom,de=d.top;se<B&&de>B&&(K=d.top-B-4);const ce=16,ue=s-d.width-ce;ie=Math.min(Math.max(ie,ce),ue)}else re-d.bottom<B&&(K=d.top-B-4);q({top:K,left:ie,width:d.width})}},[i,ne]);e.useEffect(()=>{if(Z(),i){const d=()=>Z(),W=()=>Z();return window.addEventListener("resize",d),window.addEventListener("scroll",W,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",W,!0)}}},[i,Z]),e.useEffect(()=>{const d=setTimeout(()=>{D(H)},v);return()=>clearTimeout(d)},[H,v]),e.useEffect(()=>{(i||m&&L.length===0)&&ee(C?$:void 0)},[$,i]),e.useEffect(()=>{m===!0?ee():Array.isArray(m)&&k(m)},[]);const ee=async d=>{try{F(!0);const W=await r(d);k(W)}catch(W){console.error("Error loading options:",W),k([])}finally{F(!1)}};e.useEffect(()=>{const d=W=>{J.current&&!J.current.contains(W.target)&&(x(!1),c(!1),b(""))};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[]);const le=()=>{i||(x(!0),c(!0),C&&V.current&&setTimeout(()=>{var d;return(d=V.current)==null?void 0:d.focus()},0))},oe=d=>{c(!0),w&&w(d)},te=d=>{p&&p(d)},ae=d=>{b(d.target.value)},l=d=>{if(I&&t&&I.setValue(t,d),M.onChange){const W={target:{value:d}};M.onChange(W)}x(!1),c(!1),b("")},_=d=>{if(d.stopPropagation(),I&&t&&I.setValue(t,""),M.onChange){const W={target:{value:""}};M.onChange(W)}x(!1),c(!1),b("")},a=L.find(d=>d.value===O),T=C&&i?H:(a==null?void 0:a.label)||"";return e.createElement("div",{className:u("relative",f),ref:J},e.createElement("div",{id:M.id||t,tabIndex:C?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":i,className:u("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:le,onFocus:C?void 0:oe,onBlur:C?void 0:te,ref:h},C?e.createElement("input",{ref:V,type:"text",value:T,onChange:ae,onFocus:oe,onBlur:te,placeholder:o?"":"Selecione...",className:u("w-full bg-transparent border-none outline-none text-sm",!O&&!H&&"text-gray-400")}):e.createElement("span",{className:u("block truncate",!O&&"text-gray-400")},(a==null?void 0:a.label)||!o&&"Selecione..."),g&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),E&&O&&!g&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:_},"✕")),o&&e.createElement("label",{htmlFor:M.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",X?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},o),e.createElement("div",{className:u("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",i?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:i?"9.5rem":"0",overflowY:L.length>3?"auto":"hidden",position:"fixed",top:i?`${N.top}px`:"auto",left:i?`${N.left}px`:"auto",width:i?`${N.width}px`:"auto",zIndex:9999,boxShadow:i?"var(--select-dropdown-shadow)":"none"}},g?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},P):L.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},z):L.map(d=>e.createElement("div",{key:d.value,className:u("px-3 py-2 cursor-pointer text-sm transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",O===d.value&&"bg-[var(--select-dropdown-selected)]"),onMouseDown:()=>l(d.value)},d.label))),A&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},A))});Se.displayName="AsyncSelect";const ke=e.forwardRef(({name:t,label:o,options:r,className:n,containerClassName:f,isClearable:E,searchable:m=!1,filterPlaceholder:P="Digite para filtrar...",caseSensitive:z=!1,filterFunction:C,onFocus:v,onBlur:w,...p},M)=>{var oe,te,ae;const[h,R]=e.useState(!1),[c,i]=e.useState(!1),[x,L]=e.useState(""),[k,g]=e.useState({top:0,left:0,width:0}),F=e.useRef(null),H=e.useRef(null),b=G.useFormContext(),$=b==null?void 0:b.control,D=$&&t?G.useWatch({control:$,name:t}):void 0,N=p.value??D??[],q=(ae=(te=(oe=b==null?void 0:b.formState)==null?void 0:oe.errors)==null?void 0:te[t])==null?void 0:ae.message,V=C||((l,_)=>{const a=z?l.label:l.label.toLowerCase(),T=z?_:_.toLowerCase();return a.includes(T)}),I=x.trim()?r.filter(l=>V(l,x.trim())):r,S=h||N&&N.length>0||m&&!!x,Q=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),O=e.useCallback(()=>{if(F.current&&c){const l=F.current.getBoundingClientRect(),_=Q(),a=window.innerHeight,T=window.innerWidth,j=152;let U=l.bottom+4,Y=l.left;if(_){const d=a-l.bottom,W=l.top;d<j&&W>j&&(U=l.top-j-4);const re=16,s=T-l.width-re;Y=Math.min(Math.max(Y,re),s)}else a-l.bottom<j&&(U=l.top-j-4);g({top:U,left:Y,width:l.width})}},[c,Q]);e.useEffect(()=>{if(O(),c){const l=()=>O(),_=()=>O();return window.addEventListener("resize",l),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",_,!0)}}},[c,O]),e.useEffect(()=>{const l=_=>{F.current&&!F.current.contains(_.target)&&(i(!1),R(!1))};return document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[]);const A=()=>{i(l=>!l),R(!0)},X=l=>{R(!0),v&&v(l)},ne=l=>{w&&w(l)},Z=l=>{var a;let _;N.includes(l)?_=N.filter(T=>T!==l):_=[...N,l],b&&t&&b.setValue(t,_),p.onChange&&((a=p.onChange)==null||a.call(p,{target:{value:_}})),R(!0)},ee=l=>{var _;l.stopPropagation(),b&&t&&b.setValue(t,[]),p.onChange&&((_=p.onChange)==null||_.call(p,{target:{value:[]}})),i(!1),R(!1)},le=l=>{L(l.target.value)};return e.createElement("div",{className:u("relative",f),ref:F},e.createElement("div",{id:p.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":c,className:u("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:m?void 0:A,onFocus:m?void 0:X,onBlur:m?void 0:ne,ref:M},e.createElement("div",{className:"flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",style:{scrollbarWidth:"none"}},N&&N.length>0?r.filter(l=>N.includes(l.value)).map(l=>e.createElement("span",{key:l.value,className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:l.label},l.label),e.createElement("button",{type:"button",className:"ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${l.label}`,tabIndex:-1,onClick:_=>{_.stopPropagation();const a=N.filter(T=>T!==l.value);b&&t&&b.setValue(t,a),p.onChange&&p.onChange({target:{value:a}})}},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))):!o&&!m&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione..."),m&&e.createElement("input",{ref:H,type:"text",value:x,onChange:le,onFocus:l=>{R(!0),i(!0),v&&v(l)},onBlur:l=>{w&&w(l)},placeholder:o?N&&N.length>0?"":P:P||"Selecione...",className:"flex-1 bg-transparent border-none outline-none text-sm min-w-[100px]"})),E&&N&&N.length>0&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:ee},"✕")),o&&e.createElement("label",{htmlFor:p.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",S?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},o),e.createElement("div",{className:u("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",c?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:c?"9.5rem":"0",overflowY:r.length>3?"auto":"hidden",position:"fixed",top:c?`${k.top}px`:"auto",left:c?`${k.left}px`:"auto",width:c?`${k.width}px`:"auto",zIndex:9999,boxShadow:c?"var(--select-dropdown-shadow)":"none"}},I.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},"Nenhuma opção encontrada"):I.map(l=>e.createElement("div",{key:l.value,className:u("px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",N.includes(l.value)&&"bg-[var(--select-dropdown-selected)] font-semibold"),onMouseDown:()=>Z(l.value)},e.createElement("input",{type:"checkbox",checked:N.includes(l.value),readOnly:!0,className:"accent-blue-500"}),l.label))),q&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},q))});ke.displayName="MultiSelect";const Re=e.forwardRef(({name:t,label:o,loadOptions:r,className:n,containerClassName:f,isClearable:E,defaultOptions:m=!1,loadingMessage:P="Carregando...",noOptionsMessage:z="Nenhuma opção encontrada",searchable:C=!1,debounceMs:v=300,maxSelectedDisplay:w=3,onFocus:p,onBlur:M,...h},R)=>{var d,W,re;const[c,i]=e.useState(!1),[x,L]=e.useState(!1),[k,g]=e.useState([]),[F,H]=e.useState(!1),[b,$]=e.useState(""),[D,N]=e.useState(""),[q,J]=e.useState({top:0,left:0,width:0}),V=e.useRef(null),I=e.useRef(null),S=G.useFormContext(),Q=S==null?void 0:S.control,O=Q&&t?G.useWatch({control:Q,name:t}):void 0,A=h.value??O??[],X=(re=(W=(d=S==null?void 0:S.formState)==null?void 0:d.errors)==null?void 0:W[t])==null?void 0:re.message,ne=c||A&&A.length>0,Z=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),ee=e.useCallback(()=>{if(V.current&&x){const s=V.current.getBoundingClientRect(),B=Z(),K=window.innerHeight,ie=window.innerWidth,se=152;let de=s.bottom+4,ce=s.left;if(B){const ue=K-s.bottom,Me=s.top;ue<se&&Me>se&&(de=s.top-se-4);const we=16,Le=ie-s.width-we;ce=Math.min(Math.max(ce,we),Le)}else K-s.bottom<se&&(de=s.top-se-4);J({top:de,left:ce,width:s.width})}},[x,Z]);e.useEffect(()=>{if(ee(),x){const s=()=>ee(),B=()=>ee();return window.addEventListener("resize",s),window.addEventListener("scroll",B,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",B,!0)}}},[x,ee]),e.useEffect(()=>{const s=setTimeout(()=>{N(b)},v);return()=>clearTimeout(s)},[b,v]),e.useEffect(()=>{(x||m&&k.length===0)&&le(C?D:void 0)},[D,x]),e.useEffect(()=>{m===!0?le():Array.isArray(m)&&g(m)},[]);const le=async s=>{try{H(!0);const B=await r(s);g(B)}catch(B){console.error("Error loading options:",B),g([])}finally{H(!1)}};e.useEffect(()=>{const s=B=>{V.current&&!V.current.contains(B.target)&&(L(!1),i(!1),$(""))};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[]);const oe=()=>{x||(L(!0),i(!0),C&&I.current&&setTimeout(()=>{var s;return(s=I.current)==null?void 0:s.focus()},0))},te=s=>{i(!0),p&&p(s)},ae=s=>{M&&M(s)},l=s=>{$(s.target.value)},_=s=>{let B;A.includes(s)?B=A.filter(K=>K!==s):B=[...A,s],S&&t&&S.setValue(t,B),h.onChange&&h.onChange({target:{value:B}}),i(!0)},a=(s,B)=>{B.stopPropagation();const K=A.filter(ie=>ie!==s);S&&t&&S.setValue(t,K),h.onChange&&h.onChange({target:{value:K}})},T=s=>{s.stopPropagation(),S&&t&&S.setValue(t,[]),h.onChange&&h.onChange({target:{value:[]}}),L(!1),i(!1),$("")},j=k.filter(s=>A.includes(s.value)),U=j.slice(0,w),Y=j.length-w;return e.createElement("div",{className:u("relative",f),ref:V},e.createElement("div",{id:h.id||t,tabIndex:C?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":x,className:u("peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:oe,onFocus:C?void 0:te,onBlur:C?void 0:ae,ref:R},e.createElement("div",{className:"flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full"},U.map(s=>e.createElement("span",{key:s.value,className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:s.label},s.label),e.createElement("button",{type:"button",className:"ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${s.label}`,tabIndex:-1,onClick:B=>a(s.value,B)},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))),Y>0&&e.createElement("span",{className:"flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs"},"+",Y," mais"),C?e.createElement("input",{ref:I,type:"text",value:b,onChange:l,onFocus:te,onBlur:ae,placeholder:A.length===0&&!o?"Selecione...":"",className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"}):A.length===0&&!o&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione...")),F&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),E&&A&&A.length>0&&!F&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:T},"✕")),o&&e.createElement("label",{htmlFor:h.id||t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",ne?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},o),e.createElement("div",{className:u("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",x?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:x?"9.5rem":"0",overflowY:k.length>3?"auto":"hidden",position:"fixed",top:x?`${q.top}px`:"auto",left:x?`${q.left}px`:"auto",width:x?`${q.width}px`:"auto",zIndex:9999,boxShadow:x?"var(--select-dropdown-shadow)":"none"}},F?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},P):k.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},z):k.map(s=>e.createElement("div",{key:s.value,className:u("px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",A.includes(s.value)&&"bg-[var(--select-dropdown-selected)] font-semibold"),onMouseDown:()=>_(s.value)},e.createElement("input",{type:"checkbox",checked:A.includes(s.value),readOnly:!0,className:"accent-blue-500"}),s.label))),X&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},X))});Re.displayName="MultiAsyncSelect";const ze={sm:"h-10 text-sm px-3",md:"h-12 text-base px-4",lg:"h-16 text-lg px-6"},Fe=e.forwardRef(({name:t,label:o,options:r,className:n,containerClassName:f,optionClassName:E,direction:m="row",size:P="md",onFocus:z,onBlur:C,...v},w)=>{var x,L,k;const p=G.useFormContext(),M=p==null?void 0:p.control,h=M&&t?G.useWatch({control:M,name:t}):void 0,R=v.value??h??"",c=(k=(L=(x=p==null?void 0:p.formState)==null?void 0:x.errors)==null?void 0:L[t])==null?void 0:k.message,i=g=>{p&&t&&p.setValue(t,g),v.onChange&&v.onChange({target:{value:g}})};return e.createElement("div",{className:u("relative",f),ref:w},o&&e.createElement("label",{htmlFor:t,className:u("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200","top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white")},o),e.createElement("div",{className:u("flex gap-2 w-full pt-6",m==="row"?"flex-row":"flex-col",n),"aria-label":o,tabIndex:-1,onFocus:z,onBlur:C},r.map(g=>e.createElement("button",{key:g.value,type:"button",className:u("relative flex items-center justify-center border rounded-lg transition-all duration-200 shadow-sm px-4 focus:outline-none focus:ring-2 focus:ring-[var(--primary-hover,#dbeafe)]",ze[P],R===g.value?"border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]":"border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",E),"aria-pressed":R===g.value,"data-selected":R===g.value,tabIndex:0,onClick:()=>i(g.value),onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),i(g.value))}},g.icon&&e.createElement("span",{className:"mr-2 text-lg flex items-center"},g.icon),e.createElement("span",{className:"truncate font-medium"},g.label)))),c&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},c))});Fe.displayName="RadioGroup";const fe=y.forwardRef(({children:t,className:o,as:r="div",...n},f)=>y.createElement(r,{ref:f,className:u("px-6 py-4 border-b","bg-[var(--card-header-bg,rgba(249,250,251,0.5))]","border-[var(--card-header-border,#e5e7eb)]","text-[var(--card-text,#111827)]",o),...n},t));fe.displayName="CardHeader";const me=y.forwardRef(({children:t,className:o,as:r="div",...n},f)=>y.createElement(r,{ref:f,className:u("px-6 py-4","flex-1","bg-[var(--card-bg,#ffffff)]","text-[var(--card-text,#111827)]",o),...n},t));me.displayName="CardBody";const pe=y.forwardRef(({children:t,className:o,as:r="div",...n},f)=>y.createElement(r,{ref:f,className:u("px-6 py-4 border-t","bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]","border-[var(--card-footer-border,#e5e7eb)]","text-[var(--card-text,#111827)]",o),...n},t));pe.displayName="CardFooter";const Ie=y.forwardRef(({children:t,className:o,variant:r="default",size:n="md",padding:f="none",rounded:E="lg",constrainWidth:m=!1,...P},z)=>{const C={default:"bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-sm,0_1px_2px_0_rgb(0_0_0_/_0.05))]",outlined:"bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",elevated:"bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-lg,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",flat:"bg-[var(--card-bg,#ffffff)] border-0"},v={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},w={none:"",sm:"p-3",md:"p-4",lg:"p-6"},p={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"};return y.createElement("div",{ref:z,className:u("flex flex-col",C[r],m&&v[n],w[f],p[E],o),...P},t)}),We=Object.assign(Ie,{Header:fe,Body:me,Footer:pe}),Be=y.forwardRef(({children:t,className:o,variant:r="default",size:n="md",responsive:f=!1,stickyHeader:E=!1,...m},P)=>{const z=u("w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",{"border border-[var(--table-border)]":r==="bordered"},{"text-sm":n==="sm","text-base":n==="md","text-lg":n==="lg"},o),C=u({"overflow-x-auto":f,"max-h-96 overflow-y-auto":E}),v=y.createElement("table",{ref:P,className:z,...m},t);return f||E?y.createElement("div",{className:C},v):v}),be=y.forwardRef(({children:t,className:o,as:r="thead",...n},f)=>y.createElement(r,{ref:f,className:u("border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",{"sticky top-0 z-10":r==="thead"},o),...n},t)),ve=y.forwardRef(({children:t,className:o,as:r="tbody",...n},f)=>y.createElement(r,{ref:f,className:u("[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]","[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",o),...n},t)),xe=y.forwardRef(({children:t,className:o,as:r="tfoot",...n},f)=>y.createElement(r,{ref:f,className:u("border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",o),...n},t)),ge=y.forwardRef(({children:t,className:o,variant:r="default",...n},f)=>y.createElement("tr",{ref:f,className:u("border-b border-[var(--table-border)] transition-colors",{"hover:bg-[var(--table-row-hover)]":r==="hover","bg-[var(--table-row-selected)]":r==="selected"},o),...n},t)),he=y.forwardRef(({children:t,className:o,as:r="td",align:n="left",scope:f,colSpan:E,rowSpan:m,...P},z)=>y.createElement(r,{ref:z,scope:r==="th"?f:void 0,colSpan:E,rowSpan:m,className:u("px-4 py-3 text-left",{"font-semibold":r==="th","text-sm":r==="td","text-center":n==="center","text-right":n==="right"},o),...P},t));Be.displayName="Table";be.displayName="TableHeader";ve.displayName="TableBody";xe.displayName="TableFooter";ge.displayName="TableRow";he.displayName="TableCell";const Oe=Object.assign(Be,{Header:be,Body:ve,Footer:xe,Row:ge,Cell:he}),Ae=({content:t,children:o,position:r="top",className:n="",disabled:f=!1})=>{const[E,m]=y.useState(!1),[P,z]=y.useState(r),C=y.useRef(null),v=y.useRef(null);y.useEffect(()=>{if(!E||!C.current||!v.current)return;const i=C.current,L=v.current.getBoundingClientRect(),k=i.getBoundingClientRect();let g=r;const F=window.innerWidth,H=window.innerHeight;r==="top"&&L.top<k.height+10?g="bottom":r==="bottom"&&L.bottom+k.height+10>H?g="top":r==="left"&&L.left<k.width+10?g="right":r==="right"&&L.right+k.width+10>F&&(g="left"),z(g)},[E,r]);const w=()=>{f||m(!0)},p=()=>{m(!1)},M=()=>{f||m(!0)},h=()=>{m(!1)},R=()=>{const i="absolute z-[9999] pointer-events-none";switch(P){case"top":return`${i} bottom-full left-1/2 transform -translate-x-1/2 mb-2`;case"bottom":return`${i} top-full left-1/2 transform -translate-x-1/2 mt-2`;case"left":return`${i} right-full top-1/2 transform -translate-y-1/2 mr-2`;case"right":return`${i} left-full top-1/2 transform -translate-y-1/2 ml-2`;default:return`${i} bottom-full left-1/2 transform -translate-x-1/2 mb-2`}},c=()=>{const i="absolute w-2 h-2 bg-[var(--tooltip-bg,#374151)] transform rotate-45";switch(P){case"top":return`${i} top-full left-1/2 transform -translate-x-1/2 -translate-y-1/2`;case"bottom":return`${i} bottom-full left-1/2 transform -translate-x-1/2 translate-y-1/2`;case"left":return`${i} left-full top-1/2 transform -translate-y-1/2 -translate-x-1/2`;case"right":return`${i} right-full top-1/2 transform -translate-y-1/2 translate-x-1/2`;default:return`${i} top-full left-1/2 transform -translate-x-1/2 -translate-y-1/2`}};return f||!t?y.createElement(y.Fragment,null,o):y.createElement("div",{className:"relative inline-block",ref:v,onMouseEnter:w,onMouseLeave:p,onFocus:M,onBlur:h},o,E&&y.createElement("div",{ref:C,className:u(R(),"px-2 py-1 text-sm rounded whitespace-nowrap","bg-[var(--tooltip-bg,#374151)] text-[var(--tooltip-text,#fff)]","shadow-[var(--tooltip-shadow,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]","transition-opacity duration-200 ease-in-out",n),style:{zIndex:999999},role:"tooltip","aria-hidden":!E},t,y.createElement("div",{className:c()})))};exports.AsyncSelect=Se;exports.Button=Pe;exports.Card=We;exports.CardBody=me;exports.CardFooter=pe;exports.CardHeader=fe;exports.Input=Ee;exports.MultiAsyncSelect=Re;exports.MultiSelect=ke;exports.RadioGroup=Fe;exports.Select=Ce;exports.Table=Oe;exports.TableBody=ve;exports.TableCell=he;exports.TableFooter=xe;exports.TableHeader=be;exports.TableRow=ge;exports.Textarea=Ne;exports.Tooltip=Ae;
|
package/dist/rharuow-ds.es.js
CHANGED
|
@@ -2,17 +2,17 @@ import * as e from "react";
|
|
|
2
2
|
import M, { useState as pe, useRef as be, useEffect as Le } from "react";
|
|
3
3
|
import { useFormContext as ie, useWatch as ce } from "react-hook-form";
|
|
4
4
|
function ve(t) {
|
|
5
|
-
var o, r,
|
|
6
|
-
if (typeof t == "string" || typeof t == "number")
|
|
5
|
+
var o, r, s = "";
|
|
6
|
+
if (typeof t == "string" || typeof t == "number") s += t;
|
|
7
7
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
8
8
|
var f = t.length;
|
|
9
|
-
for (o = 0; o < f; o++) t[o] && (r = ve(t[o])) && (
|
|
10
|
-
} else for (r in t) t[r] && (
|
|
11
|
-
return
|
|
9
|
+
for (o = 0; o < f; o++) t[o] && (r = ve(t[o])) && (s && (s += " "), s += r);
|
|
10
|
+
} else for (r in t) t[r] && (s && (s += " "), s += r);
|
|
11
|
+
return s;
|
|
12
12
|
}
|
|
13
13
|
function Be() {
|
|
14
|
-
for (var t, o, r = 0,
|
|
15
|
-
return
|
|
14
|
+
for (var t, o, r = 0, s = "", f = arguments.length; r < f; r++) (t = arguments[r]) && (o = ve(t)) && (s && (s += " "), s += o);
|
|
15
|
+
return s;
|
|
16
16
|
}
|
|
17
17
|
function u(...t) {
|
|
18
18
|
return Be(...t);
|
|
@@ -21,20 +21,20 @@ const He = ({
|
|
|
21
21
|
children: t,
|
|
22
22
|
variant: o = "default",
|
|
23
23
|
className: r = "",
|
|
24
|
-
...
|
|
24
|
+
...s
|
|
25
25
|
}) => {
|
|
26
26
|
const f = "px-4 py-2 rounded font-medium transition", y = {
|
|
27
27
|
default: "bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",
|
|
28
28
|
outline: "border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",
|
|
29
29
|
secondary: "bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"
|
|
30
30
|
};
|
|
31
|
-
return /* @__PURE__ */ M.createElement("button", { className: u(f, y[o], r), ...
|
|
31
|
+
return /* @__PURE__ */ M.createElement("button", { className: u(f, y[o], r), ...s }, t);
|
|
32
32
|
}, _e = e.forwardRef(
|
|
33
33
|
({
|
|
34
34
|
name: t,
|
|
35
35
|
className: o,
|
|
36
36
|
type: r = "text",
|
|
37
|
-
label:
|
|
37
|
+
label: s,
|
|
38
38
|
onFocus: f,
|
|
39
39
|
onBlur: y,
|
|
40
40
|
Icon: m,
|
|
@@ -92,7 +92,7 @@ const He = ({
|
|
|
92
92
|
},
|
|
93
93
|
...v
|
|
94
94
|
}
|
|
95
|
-
),
|
|
95
|
+
), s && /* @__PURE__ */ e.createElement(
|
|
96
96
|
"label",
|
|
97
97
|
{
|
|
98
98
|
htmlFor: v.id || t,
|
|
@@ -101,7 +101,7 @@ const He = ({
|
|
|
101
101
|
b ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
102
102
|
)
|
|
103
103
|
},
|
|
104
|
-
|
|
104
|
+
s
|
|
105
105
|
), r === "password" && /* @__PURE__ */ e.createElement(
|
|
106
106
|
"button",
|
|
107
107
|
{
|
|
@@ -131,7 +131,7 @@ const Me = e.forwardRef(
|
|
|
131
131
|
name: t,
|
|
132
132
|
label: o,
|
|
133
133
|
options: r,
|
|
134
|
-
className:
|
|
134
|
+
className: s,
|
|
135
135
|
containerClassName: f,
|
|
136
136
|
isClearable: y,
|
|
137
137
|
searchable: m = !1,
|
|
@@ -155,8 +155,8 @@ const Me = e.forwardRef(
|
|
|
155
155
|
const a = R.current.getBoundingClientRect(), P = O(), j = window.innerHeight, Q = window.innerWidth, Y = 152;
|
|
156
156
|
let d = a.bottom + 4, W = a.left;
|
|
157
157
|
if (P) {
|
|
158
|
-
const te = j - a.bottom,
|
|
159
|
-
te < Y &&
|
|
158
|
+
const te = j - a.bottom, l = a.top;
|
|
159
|
+
te < Y && l > Y && (d = a.top - Y - 4);
|
|
160
160
|
const L = 16, K = Q - a.width - L;
|
|
161
161
|
W = Math.min(Math.max(W, L), K);
|
|
162
162
|
} else
|
|
@@ -210,7 +210,7 @@ const Me = e.forwardRef(
|
|
|
210
210
|
"aria-expanded": c,
|
|
211
211
|
className: u(
|
|
212
212
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
213
|
-
|
|
213
|
+
s
|
|
214
214
|
),
|
|
215
215
|
onClick: m ? void 0 : oe,
|
|
216
216
|
onFocus: m ? void 0 : X,
|
|
@@ -309,7 +309,7 @@ const Fe = e.forwardRef(
|
|
|
309
309
|
name: t,
|
|
310
310
|
className: o,
|
|
311
311
|
label: r,
|
|
312
|
-
onFocus:
|
|
312
|
+
onFocus: s,
|
|
313
313
|
onBlur: f,
|
|
314
314
|
Icon: y,
|
|
315
315
|
iconClassName: m,
|
|
@@ -332,7 +332,7 @@ const Fe = e.forwardRef(
|
|
|
332
332
|
o
|
|
333
333
|
),
|
|
334
334
|
onFocus: (b) => {
|
|
335
|
-
B(!0),
|
|
335
|
+
B(!0), s && s(b);
|
|
336
336
|
},
|
|
337
337
|
...h && t ? (() => {
|
|
338
338
|
const b = c(t), H = b.onBlur;
|
|
@@ -382,7 +382,7 @@ const Pe = e.forwardRef(
|
|
|
382
382
|
name: t,
|
|
383
383
|
label: o,
|
|
384
384
|
loadOptions: r,
|
|
385
|
-
className:
|
|
385
|
+
className: s,
|
|
386
386
|
containerClassName: f,
|
|
387
387
|
isClearable: y,
|
|
388
388
|
defaultOptions: m = !1,
|
|
@@ -401,18 +401,18 @@ const Pe = e.forwardRef(
|
|
|
401
401
|
width: 0
|
|
402
402
|
}), q = e.useRef(null), D = e.useRef(null), I = ie(), N = I == null ? void 0 : I.control, J = N && t ? ce({ control: N, name: t }) : void 0, A = B.value ?? J ?? "", O = (Y = (Q = (j = I == null ? void 0 : I.formState) == null ? void 0 : j.errors) == null ? void 0 : Q[t]) == null ? void 0 : Y.message, U = S || !!A, oe = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), X = e.useCallback(() => {
|
|
403
403
|
if (q.current && i) {
|
|
404
|
-
const d = q.current.getBoundingClientRect(), W = oe(), te = window.innerHeight,
|
|
405
|
-
let K = d.bottom + 4,
|
|
404
|
+
const d = q.current.getBoundingClientRect(), W = oe(), te = window.innerHeight, l = window.innerWidth, L = 152;
|
|
405
|
+
let K = d.bottom + 4, le = d.left;
|
|
406
406
|
if (W) {
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
const de = 16, fe =
|
|
410
|
-
|
|
407
|
+
const se = te - d.bottom, ue = d.top;
|
|
408
|
+
se < L && ue > L && (K = d.top - L - 4);
|
|
409
|
+
const de = 16, fe = l - d.width - de;
|
|
410
|
+
le = Math.min(Math.max(le, de), fe);
|
|
411
411
|
} else
|
|
412
412
|
te - d.bottom < L && (K = d.top - L - 4);
|
|
413
413
|
G({
|
|
414
414
|
top: K,
|
|
415
|
-
left:
|
|
415
|
+
left: le,
|
|
416
416
|
width: d.width
|
|
417
417
|
});
|
|
418
418
|
}
|
|
@@ -491,7 +491,7 @@ const Pe = e.forwardRef(
|
|
|
491
491
|
"aria-expanded": i,
|
|
492
492
|
className: u(
|
|
493
493
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
494
|
-
|
|
494
|
+
s
|
|
495
495
|
),
|
|
496
496
|
onClick: ne,
|
|
497
497
|
onFocus: E ? void 0 : ae,
|
|
@@ -578,7 +578,7 @@ const ze = e.forwardRef(
|
|
|
578
578
|
name: t,
|
|
579
579
|
label: o,
|
|
580
580
|
options: r,
|
|
581
|
-
className:
|
|
581
|
+
className: s,
|
|
582
582
|
containerClassName: f,
|
|
583
583
|
isClearable: y,
|
|
584
584
|
searchable: m = !1,
|
|
@@ -604,8 +604,8 @@ const ze = e.forwardRef(
|
|
|
604
604
|
if (F) {
|
|
605
605
|
const d = a - n.bottom, W = n.top;
|
|
606
606
|
d < j && W > j && (Q = n.top - j - 4);
|
|
607
|
-
const te = 16,
|
|
608
|
-
Y = Math.min(Math.max(Y, te),
|
|
607
|
+
const te = 16, l = P - n.width - te;
|
|
608
|
+
Y = Math.min(Math.max(Y, te), l);
|
|
609
609
|
} else
|
|
610
610
|
a - n.bottom < j && (Q = n.top - j - 4);
|
|
611
611
|
g({
|
|
@@ -660,7 +660,7 @@ const ze = e.forwardRef(
|
|
|
660
660
|
"aria-expanded": c,
|
|
661
661
|
className: u(
|
|
662
662
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
663
|
-
|
|
663
|
+
s
|
|
664
664
|
),
|
|
665
665
|
onClick: m ? void 0 : O,
|
|
666
666
|
onFocus: m ? void 0 : U,
|
|
@@ -807,7 +807,7 @@ const Te = e.forwardRef(
|
|
|
807
807
|
name: t,
|
|
808
808
|
label: o,
|
|
809
809
|
loadOptions: r,
|
|
810
|
-
className:
|
|
810
|
+
className: s,
|
|
811
811
|
containerClassName: f,
|
|
812
812
|
isClearable: y,
|
|
813
813
|
defaultOptions: m = !1,
|
|
@@ -827,43 +827,43 @@ const Te = e.forwardRef(
|
|
|
827
827
|
width: 0
|
|
828
828
|
}), D = e.useRef(null), I = e.useRef(null), N = ie(), J = N == null ? void 0 : N.control, A = J && t ? ce({ control: J, name: t }) : void 0, O = h.value ?? A ?? [], U = (te = (W = (d = N == null ? void 0 : N.formState) == null ? void 0 : d.errors) == null ? void 0 : W[t]) == null ? void 0 : te.message, oe = c || O && O.length > 0, X = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), Z = e.useCallback(() => {
|
|
829
829
|
if (D.current && x) {
|
|
830
|
-
const
|
|
831
|
-
let ue =
|
|
830
|
+
const l = D.current.getBoundingClientRect(), L = X(), K = window.innerHeight, le = window.innerWidth, se = 152;
|
|
831
|
+
let ue = l.bottom + 4, de = l.left;
|
|
832
832
|
if (L) {
|
|
833
|
-
const fe = K -
|
|
834
|
-
fe <
|
|
835
|
-
const me = 16, Re =
|
|
833
|
+
const fe = K - l.bottom, Se = l.top;
|
|
834
|
+
fe < se && Se > se && (ue = l.top - se - 4);
|
|
835
|
+
const me = 16, Re = le - l.width - me;
|
|
836
836
|
de = Math.min(Math.max(de, me), Re);
|
|
837
837
|
} else
|
|
838
|
-
K -
|
|
838
|
+
K - l.bottom < se && (ue = l.top - se - 4);
|
|
839
839
|
q({
|
|
840
840
|
top: ue,
|
|
841
841
|
left: de,
|
|
842
|
-
width:
|
|
842
|
+
width: l.width
|
|
843
843
|
});
|
|
844
844
|
}
|
|
845
845
|
}, [x, X]);
|
|
846
846
|
e.useEffect(() => {
|
|
847
847
|
if (Z(), x) {
|
|
848
|
-
const
|
|
849
|
-
return window.addEventListener("resize",
|
|
850
|
-
window.removeEventListener("resize",
|
|
848
|
+
const l = () => Z(), L = () => Z();
|
|
849
|
+
return window.addEventListener("resize", l), window.addEventListener("scroll", L, !0), () => {
|
|
850
|
+
window.removeEventListener("resize", l), window.removeEventListener("scroll", L, !0);
|
|
851
851
|
};
|
|
852
852
|
}
|
|
853
853
|
}, [x, Z]), e.useEffect(() => {
|
|
854
|
-
const
|
|
854
|
+
const l = setTimeout(() => {
|
|
855
855
|
C(b);
|
|
856
856
|
}, v);
|
|
857
|
-
return () => clearTimeout(
|
|
857
|
+
return () => clearTimeout(l);
|
|
858
858
|
}, [b, v]), e.useEffect(() => {
|
|
859
859
|
(x || m && k.length === 0) && ne(E ? V : void 0);
|
|
860
860
|
}, [V, x]), e.useEffect(() => {
|
|
861
861
|
m === !0 ? ne() : Array.isArray(m) && g(m);
|
|
862
862
|
}, []);
|
|
863
|
-
const ne = async (
|
|
863
|
+
const ne = async (l) => {
|
|
864
864
|
try {
|
|
865
865
|
$(!0);
|
|
866
|
-
const L = await r(
|
|
866
|
+
const L = await r(l);
|
|
867
867
|
g(L);
|
|
868
868
|
} catch (L) {
|
|
869
869
|
console.error("Error loading options:", L), g([]);
|
|
@@ -872,40 +872,40 @@ const Te = e.forwardRef(
|
|
|
872
872
|
}
|
|
873
873
|
};
|
|
874
874
|
e.useEffect(() => {
|
|
875
|
-
const
|
|
875
|
+
const l = (L) => {
|
|
876
876
|
D.current && !D.current.contains(L.target) && (_(!1), i(!1), H(""));
|
|
877
877
|
};
|
|
878
|
-
return document.addEventListener("mousedown",
|
|
879
|
-
document.removeEventListener("mousedown",
|
|
878
|
+
return document.addEventListener("mousedown", l), () => {
|
|
879
|
+
document.removeEventListener("mousedown", l);
|
|
880
880
|
};
|
|
881
881
|
}, []);
|
|
882
882
|
const ae = () => {
|
|
883
883
|
x || (_(!0), i(!0), E && I.current && setTimeout(() => {
|
|
884
|
-
var
|
|
885
|
-
return (
|
|
884
|
+
var l;
|
|
885
|
+
return (l = I.current) == null ? void 0 : l.focus();
|
|
886
886
|
}, 0));
|
|
887
|
-
}, ee = (
|
|
888
|
-
i(!0), p && p(
|
|
889
|
-
}, re = (
|
|
890
|
-
B && B(
|
|
891
|
-
}, n = (
|
|
892
|
-
H(
|
|
893
|
-
}, F = (
|
|
887
|
+
}, ee = (l) => {
|
|
888
|
+
i(!0), p && p(l);
|
|
889
|
+
}, re = (l) => {
|
|
890
|
+
B && B(l);
|
|
891
|
+
}, n = (l) => {
|
|
892
|
+
H(l.target.value);
|
|
893
|
+
}, F = (l) => {
|
|
894
894
|
let L;
|
|
895
|
-
O.includes(
|
|
895
|
+
O.includes(l) ? L = O.filter((K) => K !== l) : L = [...O, l], N && t && N.setValue(t, L), h.onChange && h.onChange({
|
|
896
896
|
target: { value: L }
|
|
897
897
|
}), i(!0);
|
|
898
|
-
}, a = (
|
|
898
|
+
}, a = (l, L) => {
|
|
899
899
|
L.stopPropagation();
|
|
900
|
-
const K = O.filter((
|
|
900
|
+
const K = O.filter((le) => le !== l);
|
|
901
901
|
N && t && N.setValue(t, K), h.onChange && h.onChange({
|
|
902
902
|
target: { value: K }
|
|
903
903
|
});
|
|
904
|
-
}, P = (
|
|
905
|
-
|
|
904
|
+
}, P = (l) => {
|
|
905
|
+
l.stopPropagation(), N && t && N.setValue(t, []), h.onChange && h.onChange({
|
|
906
906
|
target: { value: [] }
|
|
907
907
|
}), _(!1), i(!1), H("");
|
|
908
|
-
}, j = k.filter((
|
|
908
|
+
}, j = k.filter((l) => O.includes(l.value)), Q = j.slice(0, w), Y = j.length - w;
|
|
909
909
|
return /* @__PURE__ */ e.createElement("div", { className: u("relative", f), ref: D }, /* @__PURE__ */ e.createElement(
|
|
910
910
|
"div",
|
|
911
911
|
{
|
|
@@ -916,29 +916,29 @@ const Te = e.forwardRef(
|
|
|
916
916
|
"aria-expanded": x,
|
|
917
917
|
className: u(
|
|
918
918
|
"peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
919
|
-
|
|
919
|
+
s
|
|
920
920
|
),
|
|
921
921
|
onClick: ae,
|
|
922
922
|
onFocus: E ? void 0 : ee,
|
|
923
923
|
onBlur: E ? void 0 : re,
|
|
924
924
|
ref: S
|
|
925
925
|
},
|
|
926
|
-
/* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, Q.map((
|
|
926
|
+
/* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, Q.map((l) => /* @__PURE__ */ e.createElement(
|
|
927
927
|
"span",
|
|
928
928
|
{
|
|
929
|
-
key:
|
|
929
|
+
key: l.value,
|
|
930
930
|
className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",
|
|
931
931
|
style: { maxWidth: "140px" }
|
|
932
932
|
},
|
|
933
|
-
/* @__PURE__ */ e.createElement("span", { className: "truncate", title:
|
|
933
|
+
/* @__PURE__ */ e.createElement("span", { className: "truncate", title: l.label }, l.label),
|
|
934
934
|
/* @__PURE__ */ e.createElement(
|
|
935
935
|
"button",
|
|
936
936
|
{
|
|
937
937
|
type: "button",
|
|
938
938
|
className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
|
|
939
|
-
"aria-label": `Remover ${
|
|
939
|
+
"aria-label": `Remover ${l.label}`,
|
|
940
940
|
tabIndex: -1,
|
|
941
|
-
onClick: (L) => a(
|
|
941
|
+
onClick: (L) => a(l.value, L)
|
|
942
942
|
},
|
|
943
943
|
/* @__PURE__ */ e.createElement(
|
|
944
944
|
"svg",
|
|
@@ -1015,27 +1015,27 @@ const Te = e.forwardRef(
|
|
|
1015
1015
|
boxShadow: x ? "var(--select-dropdown-shadow)" : "none"
|
|
1016
1016
|
}
|
|
1017
1017
|
},
|
|
1018
|
-
R ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, z) : k.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, T) : k.map((
|
|
1018
|
+
R ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, z) : k.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, T) : k.map((l) => /* @__PURE__ */ e.createElement(
|
|
1019
1019
|
"div",
|
|
1020
1020
|
{
|
|
1021
|
-
key:
|
|
1021
|
+
key: l.value,
|
|
1022
1022
|
className: u(
|
|
1023
1023
|
"px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
|
|
1024
1024
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
1025
|
-
O.includes(
|
|
1025
|
+
O.includes(l.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
|
|
1026
1026
|
),
|
|
1027
|
-
onMouseDown: () => F(
|
|
1027
|
+
onMouseDown: () => F(l.value)
|
|
1028
1028
|
},
|
|
1029
1029
|
/* @__PURE__ */ e.createElement(
|
|
1030
1030
|
"input",
|
|
1031
1031
|
{
|
|
1032
1032
|
type: "checkbox",
|
|
1033
|
-
checked: O.includes(
|
|
1033
|
+
checked: O.includes(l.value),
|
|
1034
1034
|
readOnly: !0,
|
|
1035
1035
|
className: "accent-blue-500"
|
|
1036
1036
|
}
|
|
1037
1037
|
),
|
|
1038
|
-
|
|
1038
|
+
l.label
|
|
1039
1039
|
))
|
|
1040
1040
|
), U && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, U));
|
|
1041
1041
|
}
|
|
@@ -1050,7 +1050,7 @@ const Ie = {
|
|
|
1050
1050
|
name: t,
|
|
1051
1051
|
label: o,
|
|
1052
1052
|
options: r,
|
|
1053
|
-
className:
|
|
1053
|
+
className: s,
|
|
1054
1054
|
containerClassName: f,
|
|
1055
1055
|
optionClassName: y,
|
|
1056
1056
|
direction: m = "row",
|
|
@@ -1080,7 +1080,7 @@ const Ie = {
|
|
|
1080
1080
|
"flex gap-2 w-full pt-6",
|
|
1081
1081
|
// espaço para label flutuante
|
|
1082
1082
|
m === "row" ? "flex-row" : "flex-col",
|
|
1083
|
-
|
|
1083
|
+
s
|
|
1084
1084
|
),
|
|
1085
1085
|
"aria-label": o,
|
|
1086
1086
|
tabIndex: -1,
|
|
@@ -1114,7 +1114,7 @@ const Ie = {
|
|
|
1114
1114
|
);
|
|
1115
1115
|
We.displayName = "RadioGroup";
|
|
1116
1116
|
const xe = M.forwardRef(
|
|
1117
|
-
({ children: t, className: o, as: r = "div", ...
|
|
1117
|
+
({ children: t, className: o, as: r = "div", ...s }, f) => /* @__PURE__ */ M.createElement(
|
|
1118
1118
|
r,
|
|
1119
1119
|
{
|
|
1120
1120
|
ref: f,
|
|
@@ -1125,14 +1125,14 @@ const xe = M.forwardRef(
|
|
|
1125
1125
|
"text-[var(--card-text,#111827)]",
|
|
1126
1126
|
o
|
|
1127
1127
|
),
|
|
1128
|
-
...
|
|
1128
|
+
...s
|
|
1129
1129
|
},
|
|
1130
1130
|
t
|
|
1131
1131
|
)
|
|
1132
1132
|
);
|
|
1133
1133
|
xe.displayName = "CardHeader";
|
|
1134
1134
|
const ge = M.forwardRef(
|
|
1135
|
-
({ children: t, className: o, as: r = "div", ...
|
|
1135
|
+
({ children: t, className: o, as: r = "div", ...s }, f) => /* @__PURE__ */ M.createElement(
|
|
1136
1136
|
r,
|
|
1137
1137
|
{
|
|
1138
1138
|
ref: f,
|
|
@@ -1144,14 +1144,14 @@ const ge = M.forwardRef(
|
|
|
1144
1144
|
"text-[var(--card-text,#111827)]",
|
|
1145
1145
|
o
|
|
1146
1146
|
),
|
|
1147
|
-
...
|
|
1147
|
+
...s
|
|
1148
1148
|
},
|
|
1149
1149
|
t
|
|
1150
1150
|
)
|
|
1151
1151
|
);
|
|
1152
1152
|
ge.displayName = "CardBody";
|
|
1153
1153
|
const he = M.forwardRef(
|
|
1154
|
-
({ children: t, className: o, as: r = "div", ...
|
|
1154
|
+
({ children: t, className: o, as: r = "div", ...s }, f) => /* @__PURE__ */ M.createElement(
|
|
1155
1155
|
r,
|
|
1156
1156
|
{
|
|
1157
1157
|
ref: f,
|
|
@@ -1162,7 +1162,7 @@ const he = M.forwardRef(
|
|
|
1162
1162
|
"text-[var(--card-text,#111827)]",
|
|
1163
1163
|
o
|
|
1164
1164
|
),
|
|
1165
|
-
...
|
|
1165
|
+
...s
|
|
1166
1166
|
},
|
|
1167
1167
|
t
|
|
1168
1168
|
)
|
|
@@ -1173,7 +1173,7 @@ const Ae = M.forwardRef(
|
|
|
1173
1173
|
children: t,
|
|
1174
1174
|
className: o,
|
|
1175
1175
|
variant: r = "default",
|
|
1176
|
-
size:
|
|
1176
|
+
size: s = "md",
|
|
1177
1177
|
padding: f = "none",
|
|
1178
1178
|
// none pois cada seção tem seu próprio padding
|
|
1179
1179
|
rounded: y = "lg",
|
|
@@ -1209,10 +1209,8 @@ const Ae = M.forwardRef(
|
|
|
1209
1209
|
className: u(
|
|
1210
1210
|
"flex flex-col",
|
|
1211
1211
|
// Flex column para organizar header, body, footer
|
|
1212
|
-
"overflow-hidden",
|
|
1213
|
-
// Para manter os borders radius das seções
|
|
1214
1212
|
E[r],
|
|
1215
|
-
m && v[
|
|
1213
|
+
m && v[s],
|
|
1216
1214
|
// Aplicar max-width apenas se constrainWidth for true
|
|
1217
1215
|
w[f],
|
|
1218
1216
|
p[y],
|
|
@@ -1232,7 +1230,7 @@ const Ae = M.forwardRef(
|
|
|
1232
1230
|
children: t,
|
|
1233
1231
|
className: o,
|
|
1234
1232
|
variant: r = "default",
|
|
1235
|
-
size:
|
|
1233
|
+
size: s = "md",
|
|
1236
1234
|
responsive: f = !1,
|
|
1237
1235
|
stickyHeader: y = !1,
|
|
1238
1236
|
...m
|
|
@@ -1246,9 +1244,9 @@ const Ae = M.forwardRef(
|
|
|
1246
1244
|
},
|
|
1247
1245
|
// Size styles
|
|
1248
1246
|
{
|
|
1249
|
-
"text-sm":
|
|
1250
|
-
"text-base":
|
|
1251
|
-
"text-lg":
|
|
1247
|
+
"text-sm": s === "sm",
|
|
1248
|
+
"text-base": s === "md",
|
|
1249
|
+
"text-lg": s === "lg"
|
|
1252
1250
|
},
|
|
1253
1251
|
o
|
|
1254
1252
|
), E = u(
|
|
@@ -1268,7 +1266,7 @@ const Ae = M.forwardRef(
|
|
|
1268
1266
|
return f || y ? /* @__PURE__ */ M.createElement("div", { className: E }, v) : v;
|
|
1269
1267
|
}
|
|
1270
1268
|
), ye = M.forwardRef(
|
|
1271
|
-
({ children: t, className: o, as: r = "thead", ...
|
|
1269
|
+
({ children: t, className: o, as: r = "thead", ...s }, f) => /* @__PURE__ */ M.createElement(
|
|
1272
1270
|
r,
|
|
1273
1271
|
{
|
|
1274
1272
|
ref: f,
|
|
@@ -1279,12 +1277,12 @@ const Ae = M.forwardRef(
|
|
|
1279
1277
|
},
|
|
1280
1278
|
o
|
|
1281
1279
|
),
|
|
1282
|
-
...
|
|
1280
|
+
...s
|
|
1283
1281
|
},
|
|
1284
1282
|
t
|
|
1285
1283
|
)
|
|
1286
1284
|
), Ee = M.forwardRef(
|
|
1287
|
-
({ children: t, className: o, as: r = "tbody", ...
|
|
1285
|
+
({ children: t, className: o, as: r = "tbody", ...s }, f) => /* @__PURE__ */ M.createElement(
|
|
1288
1286
|
r,
|
|
1289
1287
|
{
|
|
1290
1288
|
ref: f,
|
|
@@ -1293,12 +1291,12 @@ const Ae = M.forwardRef(
|
|
|
1293
1291
|
"[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",
|
|
1294
1292
|
o
|
|
1295
1293
|
),
|
|
1296
|
-
...
|
|
1294
|
+
...s
|
|
1297
1295
|
},
|
|
1298
1296
|
t
|
|
1299
1297
|
)
|
|
1300
1298
|
), Ce = M.forwardRef(
|
|
1301
|
-
({ children: t, className: o, as: r = "tfoot", ...
|
|
1299
|
+
({ children: t, className: o, as: r = "tfoot", ...s }, f) => /* @__PURE__ */ M.createElement(
|
|
1302
1300
|
r,
|
|
1303
1301
|
{
|
|
1304
1302
|
ref: f,
|
|
@@ -1306,12 +1304,12 @@ const Ae = M.forwardRef(
|
|
|
1306
1304
|
"border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",
|
|
1307
1305
|
o
|
|
1308
1306
|
),
|
|
1309
|
-
...
|
|
1307
|
+
...s
|
|
1310
1308
|
},
|
|
1311
1309
|
t
|
|
1312
1310
|
)
|
|
1313
1311
|
), Ne = M.forwardRef(
|
|
1314
|
-
({ children: t, className: o, variant: r = "default", ...
|
|
1312
|
+
({ children: t, className: o, variant: r = "default", ...s }, f) => /* @__PURE__ */ M.createElement(
|
|
1315
1313
|
"tr",
|
|
1316
1314
|
{
|
|
1317
1315
|
ref: f,
|
|
@@ -1323,7 +1321,7 @@ const Ae = M.forwardRef(
|
|
|
1323
1321
|
},
|
|
1324
1322
|
o
|
|
1325
1323
|
),
|
|
1326
|
-
...
|
|
1324
|
+
...s
|
|
1327
1325
|
},
|
|
1328
1326
|
t
|
|
1329
1327
|
)
|
|
@@ -1332,7 +1330,7 @@ const Ae = M.forwardRef(
|
|
|
1332
1330
|
children: t,
|
|
1333
1331
|
className: o,
|
|
1334
1332
|
as: r = "td",
|
|
1335
|
-
align:
|
|
1333
|
+
align: s = "left",
|
|
1336
1334
|
scope: f,
|
|
1337
1335
|
colSpan: y,
|
|
1338
1336
|
rowSpan: m,
|
|
@@ -1349,8 +1347,8 @@ const Ae = M.forwardRef(
|
|
|
1349
1347
|
{
|
|
1350
1348
|
"font-semibold": r === "th",
|
|
1351
1349
|
"text-sm": r === "td",
|
|
1352
|
-
"text-center":
|
|
1353
|
-
"text-right":
|
|
1350
|
+
"text-center": s === "center",
|
|
1351
|
+
"text-right": s === "right"
|
|
1354
1352
|
},
|
|
1355
1353
|
o
|
|
1356
1354
|
),
|
|
@@ -1375,7 +1373,7 @@ const De = Object.assign(we, {
|
|
|
1375
1373
|
content: t,
|
|
1376
1374
|
children: o,
|
|
1377
1375
|
position: r = "top",
|
|
1378
|
-
className:
|
|
1376
|
+
className: s = "",
|
|
1379
1377
|
disabled: f = !1
|
|
1380
1378
|
}) => {
|
|
1381
1379
|
const [y, m] = pe(!1), [z, T] = pe(r), E = be(null), v = be(null);
|
|
@@ -1444,7 +1442,7 @@ const De = Object.assign(we, {
|
|
|
1444
1442
|
"bg-[var(--tooltip-bg,#374151)] text-[var(--tooltip-text,#fff)]",
|
|
1445
1443
|
"shadow-[var(--tooltip-shadow,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",
|
|
1446
1444
|
"transition-opacity duration-200 ease-in-out",
|
|
1447
|
-
|
|
1445
|
+
s
|
|
1448
1446
|
),
|
|
1449
1447
|
style: { zIndex: 999999 },
|
|
1450
1448
|
role: "tooltip",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rharuow-ds",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "Modern React Design System with 11 components: Table (Header, Body, Footer, Row, Cell), Card (Header, Body, Footer), Button, Input (with password support), Textarea, Select, AsyncSelect, MultiSelect, MultiAsyncSelect, RadioGroup, and Tooltip. Full React Hook Form integration, Tailwind CSS styling, CSS Variables for theme customization and dark mode support.",
|
|
5
5
|
"main": "dist/rharuow-ds.cjs.js",
|
|
6
6
|
"module": "dist/rharuow-ds.es.js",
|