chiperos-ai-components-library 0.1.3 → 0.1.5
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/chiperos-ai-components-library.cjs +1 -1
- package/dist/chiperos-ai-components-library.cjs.map +1 -1
- package/dist/chiperos-ai-components-library.js +296 -295
- package/dist/chiperos-ai-components-library.js.map +1 -1
- package/dist/components/Table/Table.stories.d.ts +7 -0
- package/package.json +1 -1
|
@@ -42,5 +42,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
42
42
|
`)},Io=function(){var e=parseInt(document.body.getAttribute(tt)||"0",10);return isFinite(e)?e:0},L2=function(){h.useEffect(function(){return document.body.setAttribute(tt,(Io()+1).toString()),function(){var e=Io()-1;e<=0?document.body.removeAttribute(tt):document.body.setAttribute(tt,e.toString())}},[])},M2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;L2();var i=h.useMemo(function(){return k2(o)},[o]);return h.createElement(j2,{styles:F2(i,!t,o,n?"":"!important")})},zn=!1;if(typeof window<"u")try{var Ot=Object.defineProperty({},"passive",{get:function(){return zn=!0,!0}});window.addEventListener("test",Ot,Ot),window.removeEventListener("test",Ot,Ot)}catch{zn=!1}var Ke=zn?{passive:!1}:!1,D2=function(e){return e.tagName==="TEXTAREA"},is=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!D2(e)&&n[t]==="visible")},z2=function(e){return is(e,"overflowY")},Z2=function(e){return is(e,"overflowX")},Oo=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ss(e,r);if(o){var i=as(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},B2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},U2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ss=function(e,t){return e==="v"?z2(t):Z2(t)},as=function(e,t){return e==="v"?B2(t):U2(t)},W2=function(e,t){return e==="h"&&t==="rtl"?-1:1},V2=function(e,t,n,r,o){var i=W2(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,d=t.contains(a),c=!1,u=s>0,f=0,$=0;do{if(!a)break;var m=as(e,a),v=m[0],p=m[1],g=m[2],b=p-g-i*v;(v||b)&&ss(e,a)&&(f+=b,$+=v);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!d&&a!==document.body||d&&(t.contains(a)||t===a));return(u&&Math.abs(f)<1||!u&&Math.abs($)<1)&&(c=!0),c},Tt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},To=function(e){return[e.deltaX,e.deltaY]},ko=function(e){return e&&"current"in e?e.current:e},G2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},H2=function(e){return`
|
|
43
43
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
44
44
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
45
|
-
`)},K2=0,Xe=[];function X2(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(K2++)[0],i=h.useState(os)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=m2([e.lockRef.current],(e.shards||[]).map(ko),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var b=Tt(p),y=n.current,x="deltaX"in p?p.deltaX:y[0]-b[0],w="deltaY"in p?p.deltaY:y[1]-b[1],S,P=p.target,_=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in p&&_==="h"&&P.type==="range")return!1;var O=Oo(_,P);if(!O)return!0;if(O?S=_:(S=_==="v"?"h":"v",O=Oo(_,P)),!O)return!1;if(!r.current&&"changedTouches"in p&&(x||w)&&(r.current=S),!S)return!0;var L=r.current||S;return V2(L,g,p,L==="h"?x:w)},[]),d=h.useCallback(function(p){var g=p;if(!(!Xe.length||Xe[Xe.length-1]!==i)){var b="deltaY"in g?To(g):Tt(g),y=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&G2(S.delta,b)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(ko).filter(Boolean).filter(function(S){return S.contains(g.target)}),w=x.length>0?a(g,x[0]):!s.current.noIsolation;w&&g.cancelable&&g.preventDefault()}}},[]),c=h.useCallback(function(p,g,b,y){var x={name:p,delta:g,target:b,should:y,shadowParent:Y2(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(w){return w!==x})},1)},[]),u=h.useCallback(function(p){n.current=Tt(p),r.current=void 0},[]),f=h.useCallback(function(p){c(p.type,To(p),p.target,a(p,e.lockRef.current))},[]),$=h.useCallback(function(p){c(p.type,Tt(p),p.target,a(p,e.lockRef.current))},[]);h.useEffect(function(){return Xe.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:$}),document.addEventListener("wheel",d,Ke),document.addEventListener("touchmove",d,Ke),document.addEventListener("touchstart",u,Ke),function(){Xe=Xe.filter(function(p){return p!==i}),document.removeEventListener("wheel",d,Ke),document.removeEventListener("touchmove",d,Ke),document.removeEventListener("touchstart",u,Ke)}},[]);var m=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(i,{styles:H2(o)}):null,m?h.createElement(M2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Y2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const q2=_2(rs,X2);var ds=h.forwardRef(function(e,t){return h.createElement(sn,ge({},e,{ref:t,sideCar:q2}))});ds.classNames=sn.classNames;var J2=[" ","Enter","ArrowUp","ArrowDown"],Q2=[" ","Enter"],Ue="Select",[an,dn,e3]=f1(Ue),[dt]=cr(Ue,[e3,Ui]),cn=Ui(),[t3,ke]=dt(Ue),[n3,r3]=dt(Ue),cs=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:d,dir:c,name:u,autoComplete:f,disabled:$,required:m,form:v}=e,p=cn(t),[g,b]=h.useState(null),[y,x]=h.useState(null),[w,S]=h.useState(!1),P=p1(c),[_,O]=Ro({prop:r,defaultProp:o??!1,onChange:i,caller:Ue}),[L,F]=Ro({prop:s,defaultProp:a,onChange:d,caller:Ue}),z=h.useRef(null),N=g?v||!!g.closest("form"):!0,[M,I]=h.useState(new Set),Z=Array.from(M).map(T=>T.props.value).join(";");return l.jsx(t2,{...p,children:l.jsxs(t3,{required:m,scope:t,trigger:g,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:lr(),value:L,onValueChange:F,open:_,onOpenChange:O,dir:P,triggerPointerDownPosRef:z,disabled:$,children:[l.jsx(an.Provider,{scope:t,children:l.jsx(n3,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(T=>{I(D=>new Set(D).add(T))},[]),onNativeOptionRemove:h.useCallback(T=>{I(D=>{const E=new Set(D);return E.delete(T),E})},[]),children:n})}),N?l.jsxs(Es,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:f,value:L,onChange:T=>F(T.target.value),disabled:$,form:v,children:[L===void 0?l.jsx("option",{value:""}):null,Array.from(M)]},Z):null]})})};cs.displayName=Ue;var ls="SelectTrigger",us=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=cn(n),s=ke(ls,n),a=s.disabled||r,d=ne(t,s.onTriggerChange),c=dn(n),u=h.useRef("touch"),[f,$,m]=As(p=>{const g=c().filter(x=>!x.disabled),b=g.find(x=>x.value===s.value),y=Is(g,p,b);y!==void 0&&s.onValueChange(y.value)}),v=p=>{a||(s.onOpenChange(!0),m()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(n2,{asChild:!0,...i,children:l.jsx(Y.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Rs(s.value)?"":void 0,...o,ref:d,onClick:J(o.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&v(p)}),onPointerDown:J(o.onPointerDown,p=>{u.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(v(p),p.preventDefault())}),onKeyDown:J(o.onKeyDown,p=>{const g=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&$(p.key),!(g&&p.key===" ")&&J2.includes(p.key)&&(v(),p.preventDefault())})})})});us.displayName=ls;var fs="SelectValue",$s=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,d=ke(fs,n),{onValueNodeHasChildrenChange:c}=d,u=i!==void 0,f=ne(t,d.onValueNodeChange);return ae(()=>{c(u)},[c,u]),l.jsx(Y.span,{...a,ref:f,style:{pointerEvents:"none"},children:Rs(d.value)?l.jsx(l.Fragment,{children:s}):i})});$s.displayName=fs;var o3="SelectIcon",ps=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(Y.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ps.displayName=o3;var i3="SelectPortal",hs=e=>l.jsx(Ji,{asChild:!0,...e});hs.displayName=i3;var We="SelectContent",ms=h.forwardRef((e,t)=>{const n=ke(We,e.__scopeSelect),[r,o]=h.useState();if(ae(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Gt.createPortal(l.jsx(gs,{scope:e.__scopeSelect,children:l.jsx(an.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),i):null}return l.jsx(vs,{...e,ref:t})});ms.displayName=We;var $e=10,[gs,je]=dt(We),s3="SelectContentImpl",a3=pt.createSlot("SelectContent.RemoveScroll"),vs=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:d,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:$,collisionPadding:m,sticky:v,hideWhenDetached:p,avoidCollisions:g,...b}=e,y=ke(We,n),[x,w]=h.useState(null),[S,P]=h.useState(null),_=ne(t,R=>w(R)),[O,L]=h.useState(null),[F,z]=h.useState(null),N=dn(n),[M,I]=h.useState(!1),Z=h.useRef(!1);h.useEffect(()=>{if(x)return h2(x)},[x]),_1();const T=h.useCallback(R=>{const[X,...ie]=N().map(q=>q.ref.current),[U]=ie.slice(-1),V=document.activeElement;for(const q of R)if(q===V||(q?.scrollIntoView({block:"nearest"}),q===X&&S&&(S.scrollTop=0),q===U&&S&&(S.scrollTop=S.scrollHeight),q?.focus(),document.activeElement!==V))return},[N,S]),D=h.useCallback(()=>T([O,x]),[T,O,x]);h.useEffect(()=>{M&&D()},[M,D]);const{onOpenChange:E,triggerPointerDownPosRef:B}=y;h.useEffect(()=>{if(x){let R={x:0,y:0};const X=U=>{R={x:Math.abs(Math.round(U.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(U.pageY)-(B.current?.y??0))}},ie=U=>{R.x<=10&&R.y<=10?U.preventDefault():x.contains(U.target)||E(!1),document.removeEventListener("pointermove",X),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",X),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",ie,{capture:!0})}}},[x,E,B]),h.useEffect(()=>{const R=()=>E(!1);return window.addEventListener("blur",R),window.addEventListener("resize",R),()=>{window.removeEventListener("blur",R),window.removeEventListener("resize",R)}},[E]);const[Q,ee]=As(R=>{const X=N().filter(V=>!V.disabled),ie=X.find(V=>V.ref.current===document.activeElement),U=Is(X,R,ie);U&&setTimeout(()=>U.ref.current.focus())}),ct=h.useCallback((R,X,ie)=>{const U=!Z.current&&!ie;(y.value!==void 0&&y.value===X||U)&&(L(R),U&&(Z.current=!0))},[y.value]),lt=h.useCallback(()=>x?.focus(),[x]),Ne=h.useCallback((R,X,ie)=>{const U=!Z.current&&!ie;(y.value!==void 0&&y.value===X||U)&&z(R)},[y.value]),Ve=r==="popper"?Zn:bs,Fe=Ve===Zn?{side:a,sideOffset:d,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:$,collisionPadding:m,sticky:v,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(gs,{scope:n,content:x,viewport:S,onViewportChange:P,itemRefCallback:ct,selectedItem:O,onItemLeave:lt,itemTextRefCallback:Ne,focusSelectedItem:D,selectedItemText:F,position:r,isPositioned:M,searchRef:Q,children:l.jsx(ds,{as:a3,allowPinchZoom:!0,children:l.jsx(Ei,{asChild:!0,trapped:y.open,onMountAutoFocus:R=>{R.preventDefault()},onUnmountAutoFocus:J(o,R=>{y.trigger?.focus({preventScroll:!0}),R.preventDefault()}),children:l.jsx(Pi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:R=>R.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(Ve,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:R=>R.preventDefault(),...b,...Fe,onPlaced:()=>I(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:J(b.onKeyDown,R=>{const X=R.ctrlKey||R.altKey||R.metaKey;if(R.key==="Tab"&&R.preventDefault(),!X&&R.key.length===1&&ee(R.key),["ArrowUp","ArrowDown","Home","End"].includes(R.key)){let U=N().filter(V=>!V.disabled).map(V=>V.ref.current);if(["ArrowUp","End"].includes(R.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes(R.key)){const V=R.target,q=U.indexOf(V);U=U.slice(q+1)}setTimeout(()=>T(U)),R.preventDefault()}})})})})})})});vs.displayName=s3;var d3="SelectItemAlignedPosition",bs=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=ke(We,n),s=je(We,n),[a,d]=h.useState(null),[c,u]=h.useState(null),f=ne(t,_=>u(_)),$=dn(n),m=h.useRef(!1),v=h.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:b,focusSelectedItem:y}=s,x=h.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&p&&g&&b){const _=i.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),F=b.getBoundingClientRect();if(i.dir!=="rtl"){const V=F.left-O.left,q=L.left-V,ue=_.left-q,Le=_.width+ue,ln=Math.max(Le,O.width),un=window.innerWidth-$e,fn=co(q,[$e,Math.max($e,un-ln)]);a.style.minWidth=Le+"px",a.style.left=fn+"px"}else{const V=O.right-F.right,q=window.innerWidth-L.right-V,ue=window.innerWidth-_.right-q,Le=_.width+ue,ln=Math.max(Le,O.width),un=window.innerWidth-$e,fn=co(q,[$e,Math.max($e,un-ln)]);a.style.minWidth=Le+"px",a.style.right=fn+"px"}const z=$(),N=window.innerHeight-$e*2,M=p.scrollHeight,I=window.getComputedStyle(c),Z=parseInt(I.borderTopWidth,10),T=parseInt(I.paddingTop,10),D=parseInt(I.borderBottomWidth,10),E=parseInt(I.paddingBottom,10),B=Z+T+M+E+D,Q=Math.min(g.offsetHeight*5,B),ee=window.getComputedStyle(p),ct=parseInt(ee.paddingTop,10),lt=parseInt(ee.paddingBottom,10),Ne=_.top+_.height/2-$e,Ve=N-Ne,Fe=g.offsetHeight/2,R=g.offsetTop+Fe,X=Z+T+R,ie=B-X;if(X<=Ne){const V=z.length>0&&g===z[z.length-1].ref.current;a.style.bottom="0px";const q=c.clientHeight-p.offsetTop-p.offsetHeight,ue=Math.max(Ve,Fe+(V?lt:0)+q+D),Le=X+ue;a.style.height=Le+"px"}else{const V=z.length>0&&g===z[0].ref.current;a.style.top="0px";const ue=Math.max(Ne,Z+p.offsetTop+(V?ct:0)+Fe)+ie;a.style.height=ue+"px",p.scrollTop=X-Ne+p.offsetTop}a.style.margin=`${$e}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=N+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[$,i.trigger,i.valueNode,a,c,p,g,b,i.dir,r]);ae(()=>x(),[x]);const[w,S]=h.useState();ae(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const P=h.useCallback(_=>{_&&v.current===!0&&(x(),y?.(),v.current=!1)},[x,y]);return l.jsx(l3,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:P,children:l.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:l.jsx(Y.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});bs.displayName=d3;var c3="SelectPopperPosition",Zn=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=$e,...i}=e,s=cn(n);return l.jsx(r2,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=c3;var[l3,br]=dt(We,{}),Bn="SelectViewport",ys=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=je(Bn,n),s=br(Bn,n),a=ne(t,i.onViewportChange),d=h.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(an.Slot,{scope:n,children:l.jsx(Y.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:$}=s;if($?.current&&f){const m=Math.abs(d.current-u.scrollTop);if(m>0){const v=window.innerHeight-$e*2,p=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),b=Math.max(p,g);if(b<v){const y=b+m,x=Math.min(v,y),w=y-x;f.style.height=x+"px",f.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,f.style.justifyContent="flex-end")}}}d.current=u.scrollTop})})})]})});ys.displayName=Bn;var xs="SelectGroup",[u3,f3]=dt(xs),$3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=lr();return l.jsx(u3,{scope:n,id:o,children:l.jsx(Y.div,{role:"group","aria-labelledby":o,...r,ref:t})})});$3.displayName=xs;var ws="SelectLabel",p3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=f3(ws,n);return l.jsx(Y.div,{id:o.id,...r,ref:t})});p3.displayName=ws;var Wt="SelectItem",[h3,Cs]=dt(Wt),Ss=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=ke(Wt,n),d=je(Wt,n),c=a.value===r,[u,f]=h.useState(i??""),[$,m]=h.useState(!1),v=ne(t,y=>d.itemRefCallback?.(y,r,o)),p=lr(),g=h.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(h3,{scope:n,value:r,disabled:o,textId:p,isSelected:c,onItemTextChange:h.useCallback(y=>{f(x=>x||(y?.textContent??"").trim())},[]),children:l.jsx(an.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:l.jsx(Y.div,{role:"option","aria-labelledby":p,"data-highlighted":$?"":void 0,"aria-selected":c&&$,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:v,onFocus:J(s.onFocus,()=>m(!0)),onBlur:J(s.onBlur,()=>m(!1)),onClick:J(s.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:J(s.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:J(s.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:J(s.onPointerMove,y=>{g.current=y.pointerType,o?d.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:J(s.onKeyDown,y=>{d.searchRef?.current!==""&&y.key===" "||(Q2.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});Ss.displayName=Wt;var $t="SelectItemText",_s=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=ke($t,n),a=je($t,n),d=Cs($t,n),c=r3($t,n),[u,f]=h.useState(null),$=ne(t,b=>f(b),d.onItemTextChange,b=>a.itemTextRefCallback?.(b,d.value,d.disabled)),m=u?.textContent,v=h.useMemo(()=>l.jsx("option",{value:d.value,disabled:d.disabled,children:m},d.value),[d.disabled,d.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=c;return ae(()=>(p(v),()=>g(v)),[p,g,v]),l.jsxs(l.Fragment,{children:[l.jsx(Y.span,{id:d.textId,...i,ref:$}),d.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Gt.createPortal(i.children,s.valueNode):null]})});_s.displayName=$t;var Ps="SelectItemIndicator",m3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Cs(Ps,n).isSelected?l.jsx(Y.span,{"aria-hidden":!0,...r,ref:t}):null});m3.displayName=Ps;var Un="SelectScrollUpButton",g3=h.forwardRef((e,t)=>{const n=je(Un,e.__scopeSelect),r=br(Un,e.__scopeSelect),[o,i]=h.useState(!1),s=ne(t,r.onScrollButtonChange);return ae(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=d.scrollTop>0;i(c)};const d=n.viewport;return a(),d.addEventListener("scroll",a),()=>d.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Ns,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:d}=n;a&&d&&(a.scrollTop=a.scrollTop-d.offsetHeight)}}):null});g3.displayName=Un;var Wn="SelectScrollDownButton",v3=h.forwardRef((e,t)=>{const n=je(Wn,e.__scopeSelect),r=br(Wn,e.__scopeSelect),[o,i]=h.useState(!1),s=ne(t,r.onScrollButtonChange);return ae(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=d.scrollHeight-d.clientHeight,u=Math.ceil(d.scrollTop)<c;i(u)};const d=n.viewport;return a(),d.addEventListener("scroll",a),()=>d.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Ns,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:d}=n;a&&d&&(a.scrollTop=a.scrollTop+d.offsetHeight)}}):null});v3.displayName=Wn;var Ns=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=je("SelectScrollButton",n),s=h.useRef(null),a=dn(n),d=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>d(),[d]),ae(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),l.jsx(Y.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{d()})})}),b3="SelectSeparator",y3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Y.div,{"aria-hidden":!0,...r,ref:t})});y3.displayName=b3;var Vn="SelectArrow",x3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=cn(n),i=ke(Vn,n),s=je(Vn,n);return i.open&&s.position==="popper"?l.jsx(o2,{...o,...r,ref:t}):null});x3.displayName=Vn;var w3="SelectBubbleInput",Es=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),i=ne(r,o),s=c2(t);return h.useEffect(()=>{const a=o.current;if(!a)return;const d=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(d,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),l.jsx(Y.select,{...n,style:{...Qi,...n.style},ref:i,defaultValue:t})});Es.displayName=w3;function Rs(e){return e===""||e===void 0}function As(e){const t=Ze(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const a=n.current+s;t(a),(function d(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(a)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Is(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=C3(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const d=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function C3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var S3=cs,_3=us,jo=$s,P3=ps,N3=hs,E3=ms,R3=ys,A3=Ss,I3=_s;const Vt=te.forwardRef(({value:e,onChange:t,disabled:n=!1,options:r=[],placeholder:o="Select an option",label:i,variant:s="default",className:a},d)=>{const c=r.find(m=>m.id===e),u=c?.text||o,f=s==="primary",$=m=>{t&&t(m)};return l.jsxs(S3,{value:e,onValueChange:$,disabled:n,children:[l.jsxs(_3,{ref:d,className:A("flex items-center justify-center gap-2","px-4 py-3","rounded","font-semibold","text-left","transition-all","focus:outline-none focus:ring-0",!f&&["w-full","border border-[#ecebf0]","bg-white","hover:border-[#a29fba]","focus:border-[#a29fba]","data-[state=open]:border-[#a29fba]",n&&"opacity-50 cursor-not-allowed bg-[#f4f4f4]"],f&&["bg-[#00b56b] text-white","border border-[#00b56b]","hover:bg-[#00995a] hover:border-[#00995a]","active:bg-[#007a48] active:border-[#007a48]","data-[state=open]:bg-[#00995a] data-[state=open]:border-[#00995a]",n&&"bg-[#e0e0e0] border-[#e0e0e0] text-[#9e9e9e] cursor-not-allowed"],a),"data-testid":"select-trigger","aria-label":i||o,children:[!f&&l.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[(c||i)&&l.jsx("span",{className:"text-xs leading-normal font-medium text-[#575385]","data-testid":"select-label",children:i||o}),l.jsx(jo,{asChild:!0,children:l.jsx("span",{className:A("text-sm leading-4","text-[#312e4d]",!c&&!i&&"text-base leading-5"),"data-testid":"select-value",children:u})})]}),f&&l.jsxs("div",{className:"flex flex-col min-w-0",children:[i&&l.jsx("span",{className:"text-xs leading-normal text-white","data-testid":"select-label",children:i}),l.jsx(jo,{asChild:!0,children:l.jsx("span",{className:"text-sm leading-4 whitespace-nowrap","data-testid":"select-value",children:u})})]}),l.jsx(P3,{asChild:!0,children:l.jsx(re.ChevronDown,{size:16,className:A("shrink-0",f?"text-white":"text-[#312e4d]"),"data-testid":"select-icon"})})]}),l.jsx(N3,{children:l.jsx(E3,{className:A("overflow-hidden","bg-white","rounded","border border-[#ecebf0]","shadow-lg","z-50",f?"min-w-[var(--radix-select-trigger-width)]":"w-[var(--radix-select-trigger-width)]"),position:"popper",sideOffset:4,align:f?"end":"start","data-testid":"select-content",children:l.jsx(R3,{className:"p-1",children:r.map(m=>l.jsx(A3,{value:m.id,className:A("relative flex items-center","px-4 py-2","text-sm leading-4 text-[#312e4d]","rounded","cursor-pointer","select-none","outline-none","transition-colors","hover:bg-[#f4f4f4]","focus:bg-[#f4f4f4]","data-[state=checked]:bg-[#ecebf0]","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",f&&"whitespace-nowrap"),"data-testid":`select-option-${m.id}`,children:l.jsx(I3,{children:m.text})},m.id))})})})]})});Vt.displayName="Select";const Os=h.forwardRef(({status:e=!1,disabled:t=!1,onChange:n,className:r,...o},i)=>l.jsx(yr.Root,{ref:i,checked:e,onCheckedChange:n,disabled:t,className:A("relative inline-flex h-5 w-10 shrink-0 cursor-pointer items-center rounded-full p-0.5 transition-colors duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#00995a] focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",e?"bg-[#00995a]":"bg-[#e0e0e0]",r),...o,children:l.jsx(yr.Thumb,{className:A("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg transition-transform duration-200 ease-in-out",e?"translate-x-5":"translate-x-0")})}));Os.displayName="Switcher";function O3({columns:e,data:t,rowsPerPage:n=10,showPagination:r=!0,className:o,rowClassName:i,onPageChange:s,currentPage:a,loading:d=!1,emptyMessage:c="No data available"}){const[u,f]=te.useState(1),$=a!==void 0?a:u,m=w=>{a===void 0&&f(w),s?.(w)},v=Math.ceil(t.length/n),p=($-1)*n,g=p+n,b=t.slice(p,g),y=(w,S,P)=>{if(w.render)return w.render(S,P);const _=S[w.key];return _==null?"-":typeof _=="object"&&"primary"in _?l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"text-sm leading-[18px] text-[#312e4d]",children:_.primary}),_.secondary&&l.jsx("span",{className:"text-xs leading-normal text-[#575385]",children:_.secondary})]}):l.jsx("span",{className:"text-sm leading-[18px] text-[#312e4d]",children:String(_)})},x=(w,S)=>typeof i=="function"?i(w,S):i;return l.jsxs("div",{className:A("bg-white rounded-xl p-8","flex flex-col gap-4",o),"data-testid":"table-container",children:[l.jsxs("div",{className:"w-full","data-testid":"table-body",children:[l.jsx("div",{className:A("flex gap-3 items-center","px-4 py-3","border-b border-[#ecebf0]","font-semibold text-sm leading-[18px] text-[#312e4d]"),"data-testid":"table-header",children:e.map(w=>l.jsx("div",{className:A("flex-1 min-w-0",w.className),"data-testid":`table-header-${w.key}`,children:w.label},w.key))}),d?l.jsx("div",{className:"flex items-center justify-center py-12","data-testid":"table-loading",children:l.jsx("span",{className:"text-[#a29fba]",children:"Loading..."})}):b.length===0?l.jsx("div",{className:"flex items-center justify-center py-12","data-testid":"table-empty",children:l.jsx("span",{className:"text-[#a29fba]",children:c})}):b.map((w,S)=>l.jsx("div",{className:A("flex gap-3 items-center","px-4 py-3","border-b border-[#ecebf0]",x(w,S)),"data-testid":`table-row-${S}`,children:e.map(P=>l.jsx("div",{className:A("flex-1 min-w-0",P.className),"data-testid":`table-cell-${S}-${P.key}`,children:y(P,w,S)},P.key))},S))]}),r&&v>1&&!d&&l.jsx("div",{className:"flex justify-end","data-testid":"table-pagination",children:l.jsx(Si,{currentPage:$,totalPages:v,onPageChange:m})})]})}const T3=({title:e="Table Header",showTitle:t=!1,searchPlaceholder:n="Search by...",searchValue:r="",onSearchChange:o,filters:i=[],showFilters:s=!0,buttons:a=[],showButtons:d=!0,cards:c=[],showCards:u=!1,className:f})=>l.jsxs("div",{className:A("bg-white rounded-xl p-8","flex flex-col gap-4",f),"data-testid":"table-header",children:[t&&e&&l.jsx("h2",{className:"text-xl font-semibold text-[#312e4d]","data-testid":"table-header-title",children:e}),u&&c.length>0&&l.jsx("div",{className:"flex gap-4 w-full","data-testid":"table-header-cards",children:c.map(($,m)=>l.jsxs("div",{className:"bg-white border border-[#ecebf0] rounded-xl p-4 flex-1 flex gap-2","data-testid":`table-header-card-${m}`,children:[$.icon&&l.jsx("div",{className:"shrink-0","data-testid":`table-header-card-icon-${m}`,children:$.icon}),l.jsxs("div",{className:"flex flex-col gap-1 flex-1",children:[l.jsx("span",{className:"text-base font-medium text-[#575385] leading-5",children:$.label}),l.jsx("span",{className:"text-xl font-semibold text-[#312e4d] leading-[22px]",children:$.value})]})]},m))}),l.jsxs("div",{className:"flex gap-4 items-center w-full",children:[l.jsxs("div",{className:"relative flex-1","data-testid":"table-header-search",children:[l.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none",children:l.jsx(re.Search,{size:16,className:"text-[#312e4d]"})}),l.jsx("input",{type:"text",value:r,onChange:$=>o?.($.target.value),placeholder:n,className:A("w-full h-11 pl-10 pr-4 py-3","border border-[#ecebf0] rounded","text-base leading-5","placeholder:text-[#a29fba]","focus:outline-none focus:border-[#a29fba]","transition-colors"),"data-testid":"table-header-search-input"})]}),d&&a.length>0&&l.jsx("div",{className:"flex gap-4 items-center shrink-0","data-testid":"table-header-buttons",children:a.map(($,m)=>l.jsx("div",{"data-testid":`table-header-button-${m}`,children:$.isDropdown&&$.dropdownOptions?l.jsx("div",{className:"relative",children:l.jsx(Vt,{variant:$.variant==="primary"?"primary":"default",options:$.dropdownOptions,value:$.dropdownValue,onChange:v=>$.onDropdownChange?.(v),placeholder:$.label,label:$.dropdownLabel,className:A("h-11",$.variant==="outline"?"border-[#00b56b]":"")})}):l.jsx(Kn,{variant:$.variant==="outline"?"secondary":"primary",onClick:$.onClick,className:"h-11",children:$.label})},m))})]}),s&&i.length>0&&l.jsxs("div",{className:"flex gap-4 items-center","data-testid":"table-header-filters",children:[l.jsxs("div",{className:"flex items-center gap-2 py-3",children:[l.jsx(re.ListFilter,{size:16,className:"text-[#312e4d]"}),l.jsx("span",{className:"text-base leading-5 text-[#312e4d]",children:"Filter by"})]}),i.map(($,m)=>l.jsx("div",{className:"min-w-[120px]","data-testid":`table-header-filter-${m}`,children:$.options&&$.options.length>0?l.jsx(Vt,{options:$.options,value:$.value,onChange:v=>$.onChange?.(v),placeholder:$.placeholder||$.label,className:"h-11"}):l.jsxs("button",{className:A("flex items-center gap-2","border border-[#ecebf0] rounded","px-4 py-3 h-11","text-base leading-5 text-[#312e4d]","hover:border-[#a29fba] transition-colors"),onClick:()=>$.onChange?.(""),children:[l.jsx("span",{children:$.placeholder||$.label}),l.jsx(re.ChevronDown,{size:16})]})},$.key))]})]}),Ts=h.forwardRef(({type:e="light",text:t,icon:n,onClose:r,className:o,...i},s)=>{const d={light:{container:"bg-[#ecebf0]",text:"text-[#575385]",iconColor:"text-[#312e4d]",closeColor:"text-[#312e4d]"},dark:{container:"bg-[#3f3c5e]",text:"text-white",iconColor:"text-white",closeColor:"text-white"}}[e],c=l.jsx(re.CheckCircle,{size:16,className:d.iconColor});return l.jsxs("div",{ref:s,className:A("flex items-center gap-3 p-3 rounded",d.container,o),role:"status","aria-live":"polite",...i,children:[l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l.jsx("div",{className:"flex-shrink-0",children:n||c}),l.jsx("div",{className:A("text-base leading-5 whitespace-nowrap",d.text),children:t})]}),r&&l.jsx("button",{type:"button",onClick:r,className:A("flex-shrink-0 opacity-99 hover:opacity-100 transition-opacity",d.closeColor),"aria-label":"Cerrar notificación",children:l.jsx(re.X,{size:12})})]})});Ts.displayName="Toasts";exports.ActionCard=Wo;exports.BannerAlerts=Vo;exports.BrandIcons=Go;exports.Button=Kn;exports.CardsGrid=Ho;exports.FeatureCard=Ko;exports.Input=mi;exports.KPICard=bi;exports.KPICardCustom=vi;exports.KPIComparison=dr;exports.KPIComparisonCustom=gi;exports.LOGO_ASSETS=Me;exports.Loader=yi;exports.OptionCard=xi;exports.OrderCard=Ci;exports.OrderCardCustom=wi;exports.PaginationLib=Si;exports.Select=Vt;exports.Switcher=Os;exports.Table=O3;exports.TableHeader=T3;exports.Toasts=Ts;exports.buttonVariants=Nn;
|
|
45
|
+
`)},K2=0,Xe=[];function X2(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(K2++)[0],i=h.useState(os)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=m2([e.lockRef.current],(e.shards||[]).map(ko),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var b=Tt(p),y=n.current,x="deltaX"in p?p.deltaX:y[0]-b[0],w="deltaY"in p?p.deltaY:y[1]-b[1],S,P=p.target,_=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in p&&_==="h"&&P.type==="range")return!1;var O=Oo(_,P);if(!O)return!0;if(O?S=_:(S=_==="v"?"h":"v",O=Oo(_,P)),!O)return!1;if(!r.current&&"changedTouches"in p&&(x||w)&&(r.current=S),!S)return!0;var L=r.current||S;return V2(L,g,p,L==="h"?x:w)},[]),d=h.useCallback(function(p){var g=p;if(!(!Xe.length||Xe[Xe.length-1]!==i)){var b="deltaY"in g?To(g):Tt(g),y=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&G2(S.delta,b)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(ko).filter(Boolean).filter(function(S){return S.contains(g.target)}),w=x.length>0?a(g,x[0]):!s.current.noIsolation;w&&g.cancelable&&g.preventDefault()}}},[]),c=h.useCallback(function(p,g,b,y){var x={name:p,delta:g,target:b,should:y,shadowParent:Y2(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(w){return w!==x})},1)},[]),u=h.useCallback(function(p){n.current=Tt(p),r.current=void 0},[]),f=h.useCallback(function(p){c(p.type,To(p),p.target,a(p,e.lockRef.current))},[]),$=h.useCallback(function(p){c(p.type,Tt(p),p.target,a(p,e.lockRef.current))},[]);h.useEffect(function(){return Xe.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:$}),document.addEventListener("wheel",d,Ke),document.addEventListener("touchmove",d,Ke),document.addEventListener("touchstart",u,Ke),function(){Xe=Xe.filter(function(p){return p!==i}),document.removeEventListener("wheel",d,Ke),document.removeEventListener("touchmove",d,Ke),document.removeEventListener("touchstart",u,Ke)}},[]);var m=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(i,{styles:H2(o)}):null,m?h.createElement(M2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Y2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const q2=_2(rs,X2);var ds=h.forwardRef(function(e,t){return h.createElement(sn,ge({},e,{ref:t,sideCar:q2}))});ds.classNames=sn.classNames;var J2=[" ","Enter","ArrowUp","ArrowDown"],Q2=[" ","Enter"],Ue="Select",[an,dn,e3]=f1(Ue),[dt]=cr(Ue,[e3,Ui]),cn=Ui(),[t3,ke]=dt(Ue),[n3,r3]=dt(Ue),cs=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:d,dir:c,name:u,autoComplete:f,disabled:$,required:m,form:v}=e,p=cn(t),[g,b]=h.useState(null),[y,x]=h.useState(null),[w,S]=h.useState(!1),P=p1(c),[_,O]=Ro({prop:r,defaultProp:o??!1,onChange:i,caller:Ue}),[L,F]=Ro({prop:s,defaultProp:a,onChange:d,caller:Ue}),z=h.useRef(null),N=g?v||!!g.closest("form"):!0,[M,I]=h.useState(new Set),Z=Array.from(M).map(T=>T.props.value).join(";");return l.jsx(t2,{...p,children:l.jsxs(t3,{required:m,scope:t,trigger:g,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:lr(),value:L,onValueChange:F,open:_,onOpenChange:O,dir:P,triggerPointerDownPosRef:z,disabled:$,children:[l.jsx(an.Provider,{scope:t,children:l.jsx(n3,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(T=>{I(D=>new Set(D).add(T))},[]),onNativeOptionRemove:h.useCallback(T=>{I(D=>{const E=new Set(D);return E.delete(T),E})},[]),children:n})}),N?l.jsxs(Es,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:f,value:L,onChange:T=>F(T.target.value),disabled:$,form:v,children:[L===void 0?l.jsx("option",{value:""}):null,Array.from(M)]},Z):null]})})};cs.displayName=Ue;var ls="SelectTrigger",us=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=cn(n),s=ke(ls,n),a=s.disabled||r,d=ne(t,s.onTriggerChange),c=dn(n),u=h.useRef("touch"),[f,$,m]=As(p=>{const g=c().filter(x=>!x.disabled),b=g.find(x=>x.value===s.value),y=Is(g,p,b);y!==void 0&&s.onValueChange(y.value)}),v=p=>{a||(s.onOpenChange(!0),m()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return l.jsx(n2,{asChild:!0,...i,children:l.jsx(Y.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Rs(s.value)?"":void 0,...o,ref:d,onClick:J(o.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&v(p)}),onPointerDown:J(o.onPointerDown,p=>{u.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(v(p),p.preventDefault())}),onKeyDown:J(o.onKeyDown,p=>{const g=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&$(p.key),!(g&&p.key===" ")&&J2.includes(p.key)&&(v(),p.preventDefault())})})})});us.displayName=ls;var fs="SelectValue",$s=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,d=ke(fs,n),{onValueNodeHasChildrenChange:c}=d,u=i!==void 0,f=ne(t,d.onValueNodeChange);return ae(()=>{c(u)},[c,u]),l.jsx(Y.span,{...a,ref:f,style:{pointerEvents:"none"},children:Rs(d.value)?l.jsx(l.Fragment,{children:s}):i})});$s.displayName=fs;var o3="SelectIcon",ps=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(Y.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ps.displayName=o3;var i3="SelectPortal",hs=e=>l.jsx(Ji,{asChild:!0,...e});hs.displayName=i3;var We="SelectContent",ms=h.forwardRef((e,t)=>{const n=ke(We,e.__scopeSelect),[r,o]=h.useState();if(ae(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Gt.createPortal(l.jsx(gs,{scope:e.__scopeSelect,children:l.jsx(an.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),i):null}return l.jsx(vs,{...e,ref:t})});ms.displayName=We;var $e=10,[gs,je]=dt(We),s3="SelectContentImpl",a3=pt.createSlot("SelectContent.RemoveScroll"),vs=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:d,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:$,collisionPadding:m,sticky:v,hideWhenDetached:p,avoidCollisions:g,...b}=e,y=ke(We,n),[x,w]=h.useState(null),[S,P]=h.useState(null),_=ne(t,R=>w(R)),[O,L]=h.useState(null),[F,z]=h.useState(null),N=dn(n),[M,I]=h.useState(!1),Z=h.useRef(!1);h.useEffect(()=>{if(x)return h2(x)},[x]),_1();const T=h.useCallback(R=>{const[X,...ie]=N().map(q=>q.ref.current),[U]=ie.slice(-1),V=document.activeElement;for(const q of R)if(q===V||(q?.scrollIntoView({block:"nearest"}),q===X&&S&&(S.scrollTop=0),q===U&&S&&(S.scrollTop=S.scrollHeight),q?.focus(),document.activeElement!==V))return},[N,S]),D=h.useCallback(()=>T([O,x]),[T,O,x]);h.useEffect(()=>{M&&D()},[M,D]);const{onOpenChange:E,triggerPointerDownPosRef:B}=y;h.useEffect(()=>{if(x){let R={x:0,y:0};const X=U=>{R={x:Math.abs(Math.round(U.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(U.pageY)-(B.current?.y??0))}},ie=U=>{R.x<=10&&R.y<=10?U.preventDefault():x.contains(U.target)||E(!1),document.removeEventListener("pointermove",X),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",X),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",ie,{capture:!0})}}},[x,E,B]),h.useEffect(()=>{const R=()=>E(!1);return window.addEventListener("blur",R),window.addEventListener("resize",R),()=>{window.removeEventListener("blur",R),window.removeEventListener("resize",R)}},[E]);const[Q,ee]=As(R=>{const X=N().filter(V=>!V.disabled),ie=X.find(V=>V.ref.current===document.activeElement),U=Is(X,R,ie);U&&setTimeout(()=>U.ref.current.focus())}),ct=h.useCallback((R,X,ie)=>{const U=!Z.current&&!ie;(y.value!==void 0&&y.value===X||U)&&(L(R),U&&(Z.current=!0))},[y.value]),lt=h.useCallback(()=>x?.focus(),[x]),Ne=h.useCallback((R,X,ie)=>{const U=!Z.current&&!ie;(y.value!==void 0&&y.value===X||U)&&z(R)},[y.value]),Ve=r==="popper"?Zn:bs,Fe=Ve===Zn?{side:a,sideOffset:d,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:$,collisionPadding:m,sticky:v,hideWhenDetached:p,avoidCollisions:g}:{};return l.jsx(gs,{scope:n,content:x,viewport:S,onViewportChange:P,itemRefCallback:ct,selectedItem:O,onItemLeave:lt,itemTextRefCallback:Ne,focusSelectedItem:D,selectedItemText:F,position:r,isPositioned:M,searchRef:Q,children:l.jsx(ds,{as:a3,allowPinchZoom:!0,children:l.jsx(Ei,{asChild:!0,trapped:y.open,onMountAutoFocus:R=>{R.preventDefault()},onUnmountAutoFocus:J(o,R=>{y.trigger?.focus({preventScroll:!0}),R.preventDefault()}),children:l.jsx(Pi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:R=>R.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(Ve,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:R=>R.preventDefault(),...b,...Fe,onPlaced:()=>I(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:J(b.onKeyDown,R=>{const X=R.ctrlKey||R.altKey||R.metaKey;if(R.key==="Tab"&&R.preventDefault(),!X&&R.key.length===1&&ee(R.key),["ArrowUp","ArrowDown","Home","End"].includes(R.key)){let U=N().filter(V=>!V.disabled).map(V=>V.ref.current);if(["ArrowUp","End"].includes(R.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes(R.key)){const V=R.target,q=U.indexOf(V);U=U.slice(q+1)}setTimeout(()=>T(U)),R.preventDefault()}})})})})})})});vs.displayName=s3;var d3="SelectItemAlignedPosition",bs=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=ke(We,n),s=je(We,n),[a,d]=h.useState(null),[c,u]=h.useState(null),f=ne(t,_=>u(_)),$=dn(n),m=h.useRef(!1),v=h.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:b,focusSelectedItem:y}=s,x=h.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&p&&g&&b){const _=i.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),F=b.getBoundingClientRect();if(i.dir!=="rtl"){const V=F.left-O.left,q=L.left-V,ue=_.left-q,Le=_.width+ue,ln=Math.max(Le,O.width),un=window.innerWidth-$e,fn=co(q,[$e,Math.max($e,un-ln)]);a.style.minWidth=Le+"px",a.style.left=fn+"px"}else{const V=O.right-F.right,q=window.innerWidth-L.right-V,ue=window.innerWidth-_.right-q,Le=_.width+ue,ln=Math.max(Le,O.width),un=window.innerWidth-$e,fn=co(q,[$e,Math.max($e,un-ln)]);a.style.minWidth=Le+"px",a.style.right=fn+"px"}const z=$(),N=window.innerHeight-$e*2,M=p.scrollHeight,I=window.getComputedStyle(c),Z=parseInt(I.borderTopWidth,10),T=parseInt(I.paddingTop,10),D=parseInt(I.borderBottomWidth,10),E=parseInt(I.paddingBottom,10),B=Z+T+M+E+D,Q=Math.min(g.offsetHeight*5,B),ee=window.getComputedStyle(p),ct=parseInt(ee.paddingTop,10),lt=parseInt(ee.paddingBottom,10),Ne=_.top+_.height/2-$e,Ve=N-Ne,Fe=g.offsetHeight/2,R=g.offsetTop+Fe,X=Z+T+R,ie=B-X;if(X<=Ne){const V=z.length>0&&g===z[z.length-1].ref.current;a.style.bottom="0px";const q=c.clientHeight-p.offsetTop-p.offsetHeight,ue=Math.max(Ve,Fe+(V?lt:0)+q+D),Le=X+ue;a.style.height=Le+"px"}else{const V=z.length>0&&g===z[0].ref.current;a.style.top="0px";const ue=Math.max(Ne,Z+p.offsetTop+(V?ct:0)+Fe)+ie;a.style.height=ue+"px",p.scrollTop=X-Ne+p.offsetTop}a.style.margin=`${$e}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=N+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[$,i.trigger,i.valueNode,a,c,p,g,b,i.dir,r]);ae(()=>x(),[x]);const[w,S]=h.useState();ae(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const P=h.useCallback(_=>{_&&v.current===!0&&(x(),y?.(),v.current=!1)},[x,y]);return l.jsx(l3,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:P,children:l.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:l.jsx(Y.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});bs.displayName=d3;var c3="SelectPopperPosition",Zn=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=$e,...i}=e,s=cn(n);return l.jsx(r2,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=c3;var[l3,br]=dt(We,{}),Bn="SelectViewport",ys=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=je(Bn,n),s=br(Bn,n),a=ne(t,i.onViewportChange),d=h.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(an.Slot,{scope:n,children:l.jsx(Y.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:$}=s;if($?.current&&f){const m=Math.abs(d.current-u.scrollTop);if(m>0){const v=window.innerHeight-$e*2,p=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),b=Math.max(p,g);if(b<v){const y=b+m,x=Math.min(v,y),w=y-x;f.style.height=x+"px",f.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,f.style.justifyContent="flex-end")}}}d.current=u.scrollTop})})})]})});ys.displayName=Bn;var xs="SelectGroup",[u3,f3]=dt(xs),$3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=lr();return l.jsx(u3,{scope:n,id:o,children:l.jsx(Y.div,{role:"group","aria-labelledby":o,...r,ref:t})})});$3.displayName=xs;var ws="SelectLabel",p3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=f3(ws,n);return l.jsx(Y.div,{id:o.id,...r,ref:t})});p3.displayName=ws;var Wt="SelectItem",[h3,Cs]=dt(Wt),Ss=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=ke(Wt,n),d=je(Wt,n),c=a.value===r,[u,f]=h.useState(i??""),[$,m]=h.useState(!1),v=ne(t,y=>d.itemRefCallback?.(y,r,o)),p=lr(),g=h.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(h3,{scope:n,value:r,disabled:o,textId:p,isSelected:c,onItemTextChange:h.useCallback(y=>{f(x=>x||(y?.textContent??"").trim())},[]),children:l.jsx(an.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:l.jsx(Y.div,{role:"option","aria-labelledby":p,"data-highlighted":$?"":void 0,"aria-selected":c&&$,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:v,onFocus:J(s.onFocus,()=>m(!0)),onBlur:J(s.onBlur,()=>m(!1)),onClick:J(s.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:J(s.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:J(s.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:J(s.onPointerMove,y=>{g.current=y.pointerType,o?d.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:J(s.onKeyDown,y=>{d.searchRef?.current!==""&&y.key===" "||(Q2.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});Ss.displayName=Wt;var $t="SelectItemText",_s=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=ke($t,n),a=je($t,n),d=Cs($t,n),c=r3($t,n),[u,f]=h.useState(null),$=ne(t,b=>f(b),d.onItemTextChange,b=>a.itemTextRefCallback?.(b,d.value,d.disabled)),m=u?.textContent,v=h.useMemo(()=>l.jsx("option",{value:d.value,disabled:d.disabled,children:m},d.value),[d.disabled,d.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=c;return ae(()=>(p(v),()=>g(v)),[p,g,v]),l.jsxs(l.Fragment,{children:[l.jsx(Y.span,{id:d.textId,...i,ref:$}),d.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Gt.createPortal(i.children,s.valueNode):null]})});_s.displayName=$t;var Ps="SelectItemIndicator",m3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Cs(Ps,n).isSelected?l.jsx(Y.span,{"aria-hidden":!0,...r,ref:t}):null});m3.displayName=Ps;var Un="SelectScrollUpButton",g3=h.forwardRef((e,t)=>{const n=je(Un,e.__scopeSelect),r=br(Un,e.__scopeSelect),[o,i]=h.useState(!1),s=ne(t,r.onScrollButtonChange);return ae(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=d.scrollTop>0;i(c)};const d=n.viewport;return a(),d.addEventListener("scroll",a),()=>d.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Ns,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:d}=n;a&&d&&(a.scrollTop=a.scrollTop-d.offsetHeight)}}):null});g3.displayName=Un;var Wn="SelectScrollDownButton",v3=h.forwardRef((e,t)=>{const n=je(Wn,e.__scopeSelect),r=br(Wn,e.__scopeSelect),[o,i]=h.useState(!1),s=ne(t,r.onScrollButtonChange);return ae(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=d.scrollHeight-d.clientHeight,u=Math.ceil(d.scrollTop)<c;i(u)};const d=n.viewport;return a(),d.addEventListener("scroll",a),()=>d.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Ns,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:d}=n;a&&d&&(a.scrollTop=a.scrollTop+d.offsetHeight)}}):null});v3.displayName=Wn;var Ns=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=je("SelectScrollButton",n),s=h.useRef(null),a=dn(n),d=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>d(),[d]),ae(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),l.jsx(Y.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{d()})})}),b3="SelectSeparator",y3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Y.div,{"aria-hidden":!0,...r,ref:t})});y3.displayName=b3;var Vn="SelectArrow",x3=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=cn(n),i=ke(Vn,n),s=je(Vn,n);return i.open&&s.position==="popper"?l.jsx(o2,{...o,...r,ref:t}):null});x3.displayName=Vn;var w3="SelectBubbleInput",Es=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),i=ne(r,o),s=c2(t);return h.useEffect(()=>{const a=o.current;if(!a)return;const d=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(d,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),l.jsx(Y.select,{...n,style:{...Qi,...n.style},ref:i,defaultValue:t})});Es.displayName=w3;function Rs(e){return e===""||e===void 0}function As(e){const t=Ze(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const a=n.current+s;t(a),(function d(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(a)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Is(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=C3(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const d=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function C3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var S3=cs,_3=us,jo=$s,P3=ps,N3=hs,E3=ms,R3=ys,A3=Ss,I3=_s;const Vt=te.forwardRef(({value:e,onChange:t,disabled:n=!1,options:r=[],placeholder:o="Select an option",label:i,variant:s="default",className:a},d)=>{const c=r.find(m=>m.id===e),u=c?.text||o,f=s==="primary",$=m=>{t&&t(m)};return l.jsxs(S3,{value:e,onValueChange:$,disabled:n,children:[l.jsxs(_3,{ref:d,className:A("flex items-center justify-center gap-2","px-4 py-3","rounded","font-semibold","text-left","transition-all","focus:outline-none focus:ring-0",!f&&["w-full","border border-[#ecebf0]","bg-white","hover:border-[#a29fba]","focus:border-[#a29fba]","data-[state=open]:border-[#a29fba]",n&&"opacity-50 cursor-not-allowed bg-[#f4f4f4]"],f&&["bg-[#00b56b] text-white","border border-[#00b56b]","hover:bg-[#00995a] hover:border-[#00995a]","active:bg-[#007a48] active:border-[#007a48]","data-[state=open]:bg-[#00995a] data-[state=open]:border-[#00995a]",n&&"bg-[#e0e0e0] border-[#e0e0e0] text-[#9e9e9e] cursor-not-allowed"],a),"data-testid":"select-trigger","aria-label":i||o,children:[!f&&l.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[(c||i)&&l.jsx("span",{className:"text-xs leading-normal font-medium text-[#575385]","data-testid":"select-label",children:i||o}),l.jsx(jo,{asChild:!0,children:l.jsx("span",{className:A("text-sm leading-4","text-[#312e4d]",!c&&!i&&"text-base leading-5"),"data-testid":"select-value",children:u})})]}),f&&l.jsxs("div",{className:"flex flex-col min-w-0",children:[i&&l.jsx("span",{className:"text-xs leading-normal text-white","data-testid":"select-label",children:i}),l.jsx(jo,{asChild:!0,children:l.jsx("span",{className:"text-sm leading-4 whitespace-nowrap","data-testid":"select-value",children:u})})]}),l.jsx(P3,{asChild:!0,children:l.jsx(re.ChevronDown,{size:16,className:A("shrink-0",f?"text-white":"text-[#312e4d]"),"data-testid":"select-icon"})})]}),l.jsx(N3,{children:l.jsx(E3,{className:A("overflow-hidden","bg-white","rounded","border border-[#ecebf0]","shadow-lg","z-50",f?"min-w-[var(--radix-select-trigger-width)]":"w-[var(--radix-select-trigger-width)]"),position:"popper",sideOffset:4,align:f?"end":"start","data-testid":"select-content",children:l.jsx(R3,{className:"p-1",children:r.map(m=>l.jsx(A3,{value:m.id,className:A("relative flex items-center","px-4 py-2","text-sm leading-4 text-[#312e4d]","rounded","cursor-pointer","select-none","outline-none","transition-colors","hover:bg-[#f4f4f4]","focus:bg-[#f4f4f4]","data-[state=checked]:bg-[#ecebf0]","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",f&&"whitespace-nowrap"),"data-testid":`select-option-${m.id}`,children:l.jsx(I3,{children:m.text})},m.id))})})})]})});Vt.displayName="Select";const Os=h.forwardRef(({status:e=!1,disabled:t=!1,onChange:n,className:r,...o},i)=>l.jsx(yr.Root,{ref:i,checked:e,onCheckedChange:n,disabled:t,className:A("relative inline-flex h-5 w-10 shrink-0 cursor-pointer items-center rounded-full p-0.5 transition-colors duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#00995a] focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",e?"bg-[#00995a]":"bg-[#e0e0e0]",r),...o,children:l.jsx(yr.Thumb,{className:A("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg transition-transform duration-200 ease-in-out",e?"translate-x-5":"translate-x-0")})}));Os.displayName="Switcher";function O3({columns:e,data:t,rowsPerPage:n=10,showPagination:r=!0,className:o,rowClassName:i,onPageChange:s,currentPage:a,loading:d=!1,emptyMessage:c="No data available"}){const[u,f]=te.useState(1),$=a!==void 0?a:u,m=w=>{a===void 0&&f(w),s?.(w)},v=Math.ceil(t.length/n),p=($-1)*n,g=p+n,b=t.slice(p,g),y=(w,S,P)=>{if(w.render)return w.render(S,P);const _=S[w.key];return _==null?"-":typeof _=="object"&&"primary"in _?l.jsxs("div",{className:"flex flex-col min-w-0",children:[l.jsx("span",{className:"text-sm leading-[18px] text-[#312e4d] truncate",children:_.primary}),_.secondary&&l.jsx("span",{className:"text-xs leading-normal text-[#575385] truncate",children:_.secondary})]}):l.jsx("span",{className:"text-sm leading-[18px] text-[#312e4d] truncate block",children:String(_)})},x=(w,S)=>typeof i=="function"?i(w,S):i;return l.jsxs("div",{className:A("bg-white rounded-xl p-8","flex flex-col gap-4",o),"data-testid":"table-container",children:[l.jsxs("div",{className:"w-full","data-testid":"table-body",children:[l.jsx("div",{className:A("flex gap-3 items-center","px-4 py-3","border-b border-[#ecebf0]","font-semibold text-sm leading-[18px] text-[#312e4d]"),"data-testid":"table-header",children:e.map(w=>l.jsx("div",{className:A("flex-1 min-w-0",w.className),"data-testid":`table-header-${w.key}`,children:w.label},w.key))}),d?l.jsx("div",{className:"flex items-center justify-center py-12","data-testid":"table-loading",children:l.jsx("span",{className:"text-[#a29fba]",children:"Loading..."})}):b.length===0?l.jsx("div",{className:"flex items-center justify-center py-12","data-testid":"table-empty",children:l.jsx("span",{className:"text-[#a29fba]",children:c})}):b.map((w,S)=>l.jsx("div",{className:A("flex gap-3 items-center","px-4 py-3","border-b border-[#ecebf0]",x(w,S)),"data-testid":`table-row-${S}`,children:e.map(P=>l.jsx("div",{className:A("flex-1 min-w-0 overflow-hidden",P.className),"data-testid":`table-cell-${S}-${P.key}`,children:y(P,w,S)},P.key))},S))]}),r&&v>1&&!d&&l.jsx("div",{className:"flex justify-end","data-testid":"table-pagination",children:l.jsx(Si,{currentPage:$,totalPages:v,onPageChange:m})})]})}const T3=({title:e="Table Header",showTitle:t=!1,searchPlaceholder:n="Search by...",searchValue:r="",onSearchChange:o,filters:i=[],showFilters:s=!0,buttons:a=[],showButtons:d=!0,cards:c=[],showCards:u=!1,className:f})=>l.jsxs("div",{className:A("bg-white rounded-xl p-8","flex flex-col gap-4",f),"data-testid":"table-header",children:[t&&e&&l.jsx("h2",{className:"text-xl font-semibold text-[#312e4d]","data-testid":"table-header-title",children:e}),u&&c.length>0&&l.jsx("div",{className:"flex gap-4 w-full","data-testid":"table-header-cards",children:c.map(($,m)=>l.jsxs("div",{className:"bg-white border border-[#ecebf0] rounded-xl p-4 flex-1 flex gap-2","data-testid":`table-header-card-${m}`,children:[$.icon&&l.jsx("div",{className:"shrink-0","data-testid":`table-header-card-icon-${m}`,children:$.icon}),l.jsxs("div",{className:"flex flex-col gap-1 flex-1",children:[l.jsx("span",{className:"text-base font-medium text-[#575385] leading-5",children:$.label}),l.jsx("span",{className:"text-xl font-semibold text-[#312e4d] leading-[22px]",children:$.value})]})]},m))}),l.jsxs("div",{className:"flex gap-4 items-center w-full",children:[l.jsxs("div",{className:"relative flex-1","data-testid":"table-header-search",children:[l.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none",children:l.jsx(re.Search,{size:16,className:"text-[#312e4d]"})}),l.jsx("input",{type:"text",value:r,onChange:$=>o?.($.target.value),placeholder:n,className:A("w-full h-11 pl-10 pr-4 py-3","border border-[#ecebf0] rounded","text-base leading-5","placeholder:text-[#a29fba]","focus:outline-none focus:border-[#a29fba]","transition-colors"),"data-testid":"table-header-search-input"})]}),d&&a.length>0&&l.jsx("div",{className:"flex gap-4 items-center shrink-0","data-testid":"table-header-buttons",children:a.map(($,m)=>l.jsx("div",{"data-testid":`table-header-button-${m}`,children:$.isDropdown&&$.dropdownOptions?l.jsx("div",{className:"relative",children:l.jsx(Vt,{variant:$.variant==="primary"?"primary":"default",options:$.dropdownOptions,value:$.dropdownValue,onChange:v=>$.onDropdownChange?.(v),placeholder:$.label,label:$.dropdownLabel,className:A("h-11",$.variant==="outline"?"border-[#00b56b]":"")})}):l.jsx(Kn,{variant:$.variant==="outline"?"secondary":"primary",onClick:$.onClick,className:"h-11",children:$.label})},m))})]}),s&&i.length>0&&l.jsxs("div",{className:"flex gap-4 items-center","data-testid":"table-header-filters",children:[l.jsxs("div",{className:"flex items-center gap-2 py-3",children:[l.jsx(re.ListFilter,{size:16,className:"text-[#312e4d]"}),l.jsx("span",{className:"text-base leading-5 text-[#312e4d]",children:"Filter by"})]}),i.map(($,m)=>l.jsx("div",{className:"min-w-[120px]","data-testid":`table-header-filter-${m}`,children:$.options&&$.options.length>0?l.jsx(Vt,{options:$.options,value:$.value,onChange:v=>$.onChange?.(v),placeholder:$.placeholder||$.label,label:$.label,className:"h-11"}):l.jsxs("button",{className:A("flex items-center gap-2","border border-[#ecebf0] rounded","px-4 py-3 h-11","text-base leading-5 text-[#312e4d]","hover:border-[#a29fba] transition-colors"),onClick:()=>$.onChange?.(""),children:[l.jsx("span",{children:$.placeholder||$.label}),l.jsx(re.ChevronDown,{size:16})]})},$.key))]})]}),Ts=h.forwardRef(({type:e="light",text:t,icon:n,onClose:r,className:o,...i},s)=>{const d={light:{container:"bg-[#ecebf0]",text:"text-[#575385]",iconColor:"text-[#312e4d]",closeColor:"text-[#312e4d]"},dark:{container:"bg-[#3f3c5e]",text:"text-white",iconColor:"text-white",closeColor:"text-white"}}[e],c=l.jsx(re.CheckCircle,{size:16,className:d.iconColor});return l.jsxs("div",{ref:s,className:A("flex items-center gap-3 p-3 rounded",d.container,o),role:"status","aria-live":"polite",...i,children:[l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l.jsx("div",{className:"flex-shrink-0",children:n||c}),l.jsx("div",{className:A("text-base leading-5 whitespace-nowrap",d.text),children:t})]}),r&&l.jsx("button",{type:"button",onClick:r,className:A("flex-shrink-0 opacity-99 hover:opacity-100 transition-opacity",d.closeColor),"aria-label":"Cerrar notificación",children:l.jsx(re.X,{size:12})})]})});Ts.displayName="Toasts";exports.ActionCard=Wo;exports.BannerAlerts=Vo;exports.BrandIcons=Go;exports.Button=Kn;exports.CardsGrid=Ho;exports.FeatureCard=Ko;exports.Input=mi;exports.KPICard=bi;exports.KPICardCustom=vi;exports.KPIComparison=dr;exports.KPIComparisonCustom=gi;exports.LOGO_ASSETS=Me;exports.Loader=yi;exports.OptionCard=xi;exports.OrderCard=Ci;exports.OrderCardCustom=wi;exports.PaginationLib=Si;exports.Select=Vt;exports.Switcher=Os;exports.Table=O3;exports.TableHeader=T3;exports.Toasts=Ts;exports.buttonVariants=Nn;
|
|
46
46
|
//# sourceMappingURL=chiperos-ai-components-library.cjs.map
|