@reeverdev/ui 0.2.77 → 0.2.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ import*as $ from'react';import {createContext,useContext}from'react';import {cva
45
45
  0% { transform: rotate(0deg); }
46
46
  100% { transform: rotate(360deg); }
47
47
  }
48
- `}),jsx("circle",{className:i("stroke-muted",o),cx:m.size/2,cy:m.size/2,r:u,strokeWidth:m.strokeWidth,fill:"none"}),jsx("circle",{cx:m.size/2,cy:m.size/2,r:u,strokeWidth:m.strokeWidth,fill:"none",strokeLinecap:"round",stroke:op[r]||op.default,strokeDasharray:c?`${b} ${f-b}`:`${f} ${f}`,strokeDashoffset:c?0:p,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:c?void 0:"stroke-dashoffset 0.3s ease-in-out"}})]}),n&&!c&&jsxs("span",{className:i("absolute font-medium text-foreground",m.fontSize),children:[Math.round(d),"%"]})]})});lp.displayName="CircularProgress";var cp=$.createContext(null),Z0=()=>{let e=$.useContext(cp);if(!e)throw new Error("OTP components must be used within InputOTP");return e},dp=cva("flex items-center gap-2 has-[:disabled]:opacity-50",{variants:{size:{sm:"[&_[data-otp-slot]]:h-8 [&_[data-otp-slot]]:w-8 [&_[data-otp-slot]]:text-xs",md:"[&_[data-otp-slot]]:h-10 [&_[data-otp-slot]]:w-10 [&_[data-otp-slot]]:text-sm",lg:"[&_[data-otp-slot]]:h-12 [&_[data-otp-slot]]:w-12 [&_[data-otp-slot]]:text-base"}},defaultVariants:{size:"md"}}),up=$.forwardRef(({className:e,containerClassName:t,maxLength:r,value:a,defaultValue:n="",onChange:o,onComplete:s,pattern:l,disabled:c=false,size:d,children:m,...u},f)=>{let[p,b]=$.useState(n),[x,g]=$.useState(0),[v,w]=$.useState(false),y=$.useRef(null),h=a!==void 0?a:p;$.useImperativeHandle(f,()=>y.current),$.useEffect(()=>{g(Math.min(h.length,r-1));},[h,r]),$.useEffect(()=>{h.length===r&&s&&s(h);},[h,r,s]);let C=P=>{let E=P.target.value;if(l&&E){let D=new RegExp(l.replace("^","").replace("$","").replace("+",""));E=E.split("").filter(H=>D.test(H)).join("");}E=E.slice(0,r),a===void 0&&b(E),o?.(E);},R=P=>{P.key==="ArrowLeft"?g(E=>Math.max(0,E-1)):P.key==="ArrowRight"&&g(E=>Math.min(h.length,r-1,E+1));},T=()=>{y.current?.focus();},M=()=>{w(true),g(Math.min(h.length,r-1));},k=()=>{w(false);},N={value:h,activeIndex:v?x:-1,maxLength:r,disabled:c};return jsx(cp.Provider,{value:N,children:jsxs("div",{className:i(dp({size:d}),t),onClick:T,"data-otp-container":true,children:[jsx("input",{ref:y,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:h,onChange:C,onKeyDown:R,onFocus:M,onBlur:k,disabled:c,maxLength:r,className:i("absolute opacity-0 pointer-events-none w-0 h-0",e),...u}),m]})})});up.displayName="InputOTP";var mp=$.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:i("flex items-center",e),...t}));mp.displayName="InputOTPGroup";var pp=$.forwardRef(({index:e,className:t,...r},a)=>{let{value:n,activeIndex:o,disabled:s}=Z0(),l=n[e]||"",c=o===e,d=c&&n.length===e;return jsxs("div",{ref:a,"data-otp-slot":true,"data-active":c,"data-filled":!!l,className:i("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-all first:rounded-l-md first:border-l last:rounded-r-md",c&&"z-10 border-foreground",s&&"cursor-not-allowed opacity-50",t),...r,children:[l,d&&jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});pp.displayName="InputOTPSlot";var fp=$.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"separator",className:i("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));fp.displayName="InputOTPSeparator";var vp=cva("inline-flex items-center gap-1 rounded-full text-xs font-medium transition-colors",{variants:{variant:{solid:"bg-primary text-primary-foreground",outline:"border border-input bg-transparent",ghost:"bg-transparent text-foreground",soft:"bg-primary/15 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-xs",lg:"h-7 px-3 text-sm"}},defaultVariants:{variant:"soft",size:"md"}}),hp=$.forwardRef(({className:e,variant:t,size:r,value:a=[],onChange:n,placeholder:o="Add tag...",maxTags:s,minTagLength:l=1,maxTagLength:c=50,triggerKeys:d=["Enter",",","Tab"],allowDuplicates:m=false,disabled:u,readOnly:f,renderTag:p,...b},x)=>{let[g,v]=$.useState(""),w=$.useRef(null);$.useImperativeHandle(x,()=>w.current);let y=N=>{let P=N.trim();if(P.length<l||P.length>c||s&&a.length>=s||!m&&a.some(D=>D.text.toLowerCase()===P.toLowerCase()))return;let E={id:crypto.randomUUID(),text:P};n?.([...a,E]),v("");},h=N=>{u||f||n?.(a.filter(P=>P.id!==N));},C=N=>{if(d.includes(N.key)){if(N.key==="Tab"&&!g)return;N.preventDefault(),y(g);}N.key==="Backspace"&&!g&&a.length>0&&h(a[a.length-1].id);},R=N=>{let P=N.target.value;if(P.includes(",")){P.split(",").forEach(D=>{D.trim()&&y(D);});return}v(P);},T=N=>{N.preventDefault(),N.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(D=>{y(D);});},M=()=>{w.current?.focus();},k=s?a.length>=s:false;return jsxs("div",{className:i("flex min-h-10 w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",u&&"cursor-not-allowed opacity-50",e),onClick:M,children:[a.map(N=>p?p(N,()=>h(N.id)):jsxs("span",{className:i(vp({variant:t,size:r})),children:[N.text,!u&&!f&&jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),h(N.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${N.text}`,children:jsx(X,{className:"h-3 w-3"})})]},N.id)),!k&&!f&&jsx("input",{ref:w,type:"text",value:g,onChange:R,onKeyDown:C,onPaste:T,placeholder:a.length===0?o:"",disabled:u,className:i("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...b})]})});hp.displayName="TagInput";var yp=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-2 py-6",md:"gap-3 py-10",lg:"gap-4 py-16"}},defaultVariants:{size:"md"}}),Rp=$.forwardRef(({className:e,size:t,icon:r,title:a,description:n,action:o,children:s,...l},c)=>jsxs("div",{ref:c,className:i(yp({size:t,className:e})),...l,children:[r&&jsx("div",{className:"text-muted-foreground [&>svg]:h-10 [&>svg]:w-10",children:r}),a&&jsx("h3",{className:"text-lg font-semibold text-foreground",children:a}),n&&jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:n}),o&&jsx("div",{className:"mt-2",children:o}),s]}));Rp.displayName="EmptyState";var Cp=cva("rounded-lg border bg-card p-6 text-card-foreground shadow-sm",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",outline:"bg-transparent",ghost:"border-transparent shadow-none",soft:"bg-primary/10 border-primary/20",surface:"bg-muted border-muted"}},defaultVariants:{variant:"outline"}}),Np=$.forwardRef(({className:e,variant:t,label:r,value:a,icon:n,trend:o,trendValue:s,description:l,...c},d)=>{let m=o==="up"?TrendingUp:o==="down"?TrendingDown:Minus,u=o==="up"?"text-green-500":o==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:i(Cp({variant:t,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:"text-sm font-medium text-muted-foreground",children:r}),n&&jsx("div",{className:"text-muted-foreground [&>svg]:h-4 [&>svg]:w-4",children:n})]}),jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[jsx("p",{className:"text-2xl font-bold",children:a}),o&&s&&jsxs("span",{className:i("flex items-center gap-0.5 text-sm",u),children:[jsx(m,{className:"h-3 w-3"}),s]})]}),l&&jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:l})]})});Np.displayName="StatCard";var Wi=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",striped:"gap-2 [&>*:nth-child(odd)]:bg-muted/50",filled:"gap-2 bg-muted/30 rounded-lg p-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),Pp=cva("flex items-center gap-1 py-1.5 px-2 rounded-sm transition-colors",{variants:{size:{sm:"py-1 px-1.5 text-sm",md:"py-1.5 px-2 text-sm",lg:"py-2 px-3 text-base"},isSelected:{true:"bg-primary/10 text-primary",false:""},isDragging:{true:"opacity-50",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed",false:""},isHoverable:{true:"hover:bg-muted/50 cursor-pointer",false:""}},defaultVariants:{size:"md",isSelected:false,isDragging:false,isDisabled:false,isHoverable:true}}),kp=$.createContext(null),lw=()=>{let e=$.useContext(kp);if(!e)throw new Error("TreeNode must be used within List with treeData");return e},cw=({checked:e,indeterminate:t,disabled:r,onClick:a})=>jsx("button",{type:"button",role:"checkbox","aria-checked":t?"mixed":e,disabled:r,onClick:n=>{n.stopPropagation(),r||a(n);},className:i("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",(e||t)&&"bg-primary text-primary-foreground",r&&"cursor-not-allowed opacity-50"),children:(e||t)&&jsx("span",{className:"flex items-center justify-center text-current",children:t?jsx(Minus,{className:"h-3 w-3"}):jsx(Check,{className:"h-3 w-3"})})}),Ep=({node:e,level:t})=>{let{expandedKeys:r,toggleExpand:a,selectedKeys:n,handleSelect:o,selectable:s,checkedKeys:l,halfCheckedKeys:c,handleCheck:d,checkable:m,draggable:u,draggedNode:f,setDraggedNode:p,dragOverKey:b,dragOverPosition:x,setDragOver:g,handleDrop:v,allowDrop:w,onDragStart:y,onDragOver:h,onDragEnter:C,onDragLeave:R,onDragEnd:T,showLine:M,showIcon:k,showHandle:N,icon:P,blockNode:E,disabled:D,size:H,getAllKeys:S}=lw(),L=e.children&&e.children.length>0,I=e.isLeaf??!L,A=r.has(e.key),G=n.has(e.key),V=l.has(e.key),F=c.has(e.key),O=f?.key===e.key,te=b===e.key,Z=!!(D||e.disabled),z=s&&e.selectable!==false,K=m&&e.checkable!==false,W=$.useMemo(()=>Z?false:typeof u=="boolean"?u:typeof u=="function"?u(e):u&&typeof u=="object"?u.nodeDraggable?u.nodeDraggable(e):true:false,[u,e,Z]),B=$.useMemo(()=>typeof u=="object"&&u.icon!==void 0?u.icon:jsx(GripVertical,{className:"h-4 w-4"}),[u]),X=$.useMemo(()=>e.icon?e.icon:P?typeof P=="function"?P({expanded:A}):P:null,[e.icon,P,A]),j=oe=>{if(!W)return;oe.stopPropagation(),oe.dataTransfer.effectAllowed="move";let cr=oe.currentTarget,Rt=cr.cloneNode(true),Or=document.documentElement.classList.contains("dark"),gt=Or?"#0a0a0a":"#ffffff",_=Or?"#27272a":"#e4e4e7";Rt.style.cssText=`
48
+ `}),jsx("circle",{className:i("stroke-muted",o),cx:m.size/2,cy:m.size/2,r:u,strokeWidth:m.strokeWidth,fill:"none"}),jsx("circle",{cx:m.size/2,cy:m.size/2,r:u,strokeWidth:m.strokeWidth,fill:"none",strokeLinecap:"round",stroke:op[r]||op.default,strokeDasharray:c?`${b} ${f-b}`:`${f} ${f}`,strokeDashoffset:c?0:p,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:c?void 0:"stroke-dashoffset 0.3s ease-in-out"}})]}),n&&!c&&jsxs("span",{className:i("absolute font-medium text-foreground",m.fontSize),children:[Math.round(d),"%"]})]})});lp.displayName="CircularProgress";var cp=$.createContext(null),Z0=()=>{let e=$.useContext(cp);if(!e)throw new Error("OTP components must be used within InputOTP");return e},dp=cva("flex items-center gap-2 has-[:disabled]:opacity-50",{variants:{size:{sm:"[&_[data-otp-slot]]:h-8 [&_[data-otp-slot]]:w-8 [&_[data-otp-slot]]:text-xs",md:"[&_[data-otp-slot]]:h-10 [&_[data-otp-slot]]:w-10 [&_[data-otp-slot]]:text-sm",lg:"[&_[data-otp-slot]]:h-12 [&_[data-otp-slot]]:w-12 [&_[data-otp-slot]]:text-base"}},defaultVariants:{size:"md"}}),up=$.forwardRef(({className:e,containerClassName:t,maxLength:r,value:a,defaultValue:n="",onChange:o,onComplete:s,pattern:l,disabled:c=false,size:d,children:m,...u},f)=>{let[p,b]=$.useState(n),[x,g]=$.useState(0),[v,w]=$.useState(false),y=$.useRef(null),h=a!==void 0?a:p;$.useImperativeHandle(f,()=>y.current),$.useEffect(()=>{g(Math.min(h.length,r-1));},[h,r]),$.useEffect(()=>{h.length===r&&s&&s(h);},[h,r,s]);let C=P=>{let E=P.target.value;if(l&&E){let D=new RegExp(l.replace("^","").replace("$","").replace("+",""));E=E.split("").filter(H=>D.test(H)).join("");}E=E.slice(0,r),a===void 0&&b(E),o?.(E);},R=P=>{P.key==="ArrowLeft"?g(E=>Math.max(0,E-1)):P.key==="ArrowRight"&&g(E=>Math.min(h.length,r-1,E+1));},T=()=>{y.current?.focus();},M=()=>{w(true),g(Math.min(h.length,r-1));},k=()=>{w(false);},N={value:h,activeIndex:v?x:-1,maxLength:r,disabled:c};return jsx(cp.Provider,{value:N,children:jsxs("div",{className:i(dp({size:d}),t),onClick:T,"data-otp-container":true,children:[jsx("input",{ref:y,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:h,onChange:C,onKeyDown:R,onFocus:M,onBlur:k,disabled:c,maxLength:r,className:i("absolute opacity-0 pointer-events-none w-0 h-0",e),...u}),m]})})});up.displayName="InputOTP";var mp=$.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:i("flex items-center",e),...t}));mp.displayName="InputOTPGroup";var pp=$.forwardRef(({index:e,className:t,...r},a)=>{let{value:n,activeIndex:o,disabled:s}=Z0(),l=n[e]||"",c=o===e,d=c&&n.length===e;return jsxs("div",{ref:a,"data-otp-slot":true,"data-active":c,"data-filled":!!l,className:i("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-all first:rounded-l-md first:border-l last:rounded-r-md",c&&"z-10 border-foreground",s&&"cursor-not-allowed opacity-50",t),...r,children:[l,d&&jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});pp.displayName="InputOTPSlot";var fp=$.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"separator",className:i("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));fp.displayName="InputOTPSeparator";var vp=cva("inline-flex items-center gap-1 rounded-full text-xs font-medium transition-colors",{variants:{variant:{solid:"bg-primary text-primary-foreground",outline:"border border-input bg-transparent",ghost:"bg-transparent text-foreground",soft:"bg-primary/15 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-xs",lg:"h-7 px-3 text-sm"}},defaultVariants:{variant:"soft",size:"md"}}),hp=$.forwardRef(({className:e,variant:t,size:r,value:a=[],onChange:n,placeholder:o="Add tag...",maxTags:s,minTagLength:l=1,maxTagLength:c=50,triggerKeys:d=["Enter",",","Tab"],allowDuplicates:m=false,disabled:u,readOnly:f,renderTag:p,...b},x)=>{let[g,v]=$.useState(""),w=$.useRef(null);$.useImperativeHandle(x,()=>w.current);let y=N=>{let P=N.trim();if(P.length<l||P.length>c||s&&a.length>=s||!m&&a.some(D=>D.text.toLowerCase()===P.toLowerCase()))return;let E={id:crypto.randomUUID(),text:P};n?.([...a,E]),v("");},h=N=>{u||f||n?.(a.filter(P=>P.id!==N));},C=N=>{if(d.includes(N.key)){if(N.key==="Tab"&&!g)return;N.preventDefault(),y(g);}N.key==="Backspace"&&!g&&a.length>0&&h(a[a.length-1].id);},R=N=>{let P=N.target.value;if(P.includes(",")){P.split(",").forEach(D=>{D.trim()&&y(D);});return}v(P);},T=N=>{N.preventDefault(),N.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(D=>{y(D);});},M=()=>{w.current?.focus();},k=s?a.length>=s:false;return jsxs("div",{className:i("flex min-h-10 w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",u&&"cursor-not-allowed opacity-50",e),onClick:M,children:[a.map(N=>p?p(N,()=>h(N.id)):jsxs("span",{className:i(vp({variant:t,size:r})),children:[N.text,!u&&!f&&jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),h(N.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${N.text}`,children:jsx(X,{className:"h-3 w-3"})})]},N.id)),!k&&!f&&jsx("input",{ref:w,type:"text",value:g,onChange:R,onKeyDown:C,onPaste:T,placeholder:a.length===0?o:"",disabled:u,className:i("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...b})]})});hp.displayName="TagInput";var yp=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-2 py-6",md:"gap-3 py-10",lg:"gap-4 py-16"}},defaultVariants:{size:"md"}}),Rp=$.forwardRef(({className:e,size:t,icon:r,title:a,description:n,action:o,children:s,...l},c)=>jsxs("div",{ref:c,className:i(yp({size:t,className:e})),...l,children:[r&&jsx("div",{className:"text-muted-foreground [&>svg]:h-10 [&>svg]:w-10",children:r}),a&&jsx("h3",{className:"text-lg font-semibold text-foreground",children:a}),n&&jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:n}),o&&jsx("div",{className:"mt-2",children:o}),s]}));Rp.displayName="EmptyState";var Cp=cva("rounded-lg border bg-card p-6 text-card-foreground shadow-sm",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",outline:"bg-transparent",ghost:"border-transparent shadow-none",soft:"bg-primary/10 border-primary/20",surface:"bg-muted border-muted"}},defaultVariants:{variant:"outline"}}),Np=$.forwardRef(({className:e,variant:t,label:r,value:a,icon:n,trend:o,trendValue:s,description:l,...c},d)=>{let m=o==="up"?TrendingUp:o==="down"?TrendingDown:Minus,u=o==="up"?"text-green-500":o==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:i(Cp({variant:t,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:"text-sm font-medium text-muted-foreground",children:r}),n&&jsx("div",{className:"text-muted-foreground [&>svg]:h-4 [&>svg]:w-4",children:n})]}),jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[jsx("p",{className:"text-2xl font-bold",children:a}),o&&s&&jsxs("span",{className:i("flex items-center gap-0.5 text-sm",u),children:[jsx(m,{className:"h-3 w-3"}),s]})]}),l&&jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:l})]})});Np.displayName="StatCard";var Wi=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",striped:"gap-2 [&>*:nth-child(odd)]:bg-muted/50",filled:"gap-2 bg-muted/30 rounded-lg p-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),Pp=cva("flex items-center gap-0.5 py-1.5 px-2 rounded-sm transition-colors",{variants:{size:{sm:"py-1 px-1.5 text-sm",md:"py-1.5 px-2 text-sm",lg:"py-2 px-3 text-base"},isSelected:{true:"bg-primary/10 text-primary",false:""},isDragging:{true:"opacity-50",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed",false:""},isHoverable:{true:"hover:bg-muted/50 cursor-pointer",false:""}},defaultVariants:{size:"md",isSelected:false,isDragging:false,isDisabled:false,isHoverable:true}}),kp=$.createContext(null),lw=()=>{let e=$.useContext(kp);if(!e)throw new Error("TreeNode must be used within List with treeData");return e},cw=({checked:e,indeterminate:t,disabled:r,onClick:a})=>jsx("button",{type:"button",role:"checkbox","aria-checked":t?"mixed":e,disabled:r,onClick:n=>{n.stopPropagation(),r||a(n);},className:i("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",(e||t)&&"bg-primary text-primary-foreground",r&&"cursor-not-allowed opacity-50"),children:(e||t)&&jsx("span",{className:"flex items-center justify-center text-current",children:t?jsx(Minus,{className:"h-3 w-3"}):jsx(Check,{className:"h-3 w-3"})})}),Ep=({node:e,level:t})=>{let{expandedKeys:r,toggleExpand:a,selectedKeys:n,handleSelect:o,selectable:s,checkedKeys:l,halfCheckedKeys:c,handleCheck:d,checkable:m,draggable:u,draggedNode:f,setDraggedNode:p,dragOverKey:b,dragOverPosition:x,setDragOver:g,handleDrop:v,allowDrop:w,onDragStart:y,onDragOver:h,onDragEnter:C,onDragLeave:R,onDragEnd:T,showLine:M,showIcon:k,showHandle:N,icon:P,blockNode:E,disabled:D,size:H,getAllKeys:S}=lw(),L=e.children&&e.children.length>0,I=e.isLeaf??!L,A=r.has(e.key),G=n.has(e.key),V=l.has(e.key),F=c.has(e.key),O=f?.key===e.key,te=b===e.key,Z=!!(D||e.disabled),z=s&&e.selectable!==false,K=m&&e.checkable!==false,W=$.useMemo(()=>Z?false:typeof u=="boolean"?u:typeof u=="function"?u(e):u&&typeof u=="object"?u.nodeDraggable?u.nodeDraggable(e):true:false,[u,e,Z]),B=$.useMemo(()=>typeof u=="object"&&u.icon!==void 0?u.icon:jsx(GripVertical,{className:"h-4 w-4"}),[u]),X=$.useMemo(()=>e.icon?e.icon:P?typeof P=="function"?P({expanded:A}):P:null,[e.icon,P,A]),j=oe=>{if(!W)return;oe.stopPropagation(),oe.dataTransfer.effectAllowed="move";let cr=oe.currentTarget,Rt=cr.cloneNode(true),Or=document.documentElement.classList.contains("dark"),gt=Or?"#0a0a0a":"#ffffff",_=Or?"#27272a":"#e4e4e7";Rt.style.cssText=`
49
49
  position: fixed;
50
50
  top: -9999px;
51
51
  left: -9999px;