@alkimi.org/ui-kit 0.9.0 → 0.9.2

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.
Files changed (169) hide show
  1. package/dist/{chunk-VNF4HDJR.mjs → chunk-2CF4QASK.mjs} +2 -2
  2. package/dist/chunk-2CF4QASK.mjs.map +1 -0
  3. package/dist/chunk-3FBDNJG5.js +3 -0
  4. package/dist/chunk-3FBDNJG5.js.map +1 -0
  5. package/dist/{chunk-WIQVLJ4E.js → chunk-5D66A4ZC.js} +2 -2
  6. package/dist/{chunk-WIQVLJ4E.js.map → chunk-5D66A4ZC.js.map} +1 -1
  7. package/dist/chunk-5X26XR44.js +3 -0
  8. package/dist/chunk-5X26XR44.js.map +1 -0
  9. package/dist/{chunk-MO2LRV57.js → chunk-65YNHKNP.js} +2 -2
  10. package/dist/{chunk-MO2LRV57.js.map → chunk-65YNHKNP.js.map} +1 -1
  11. package/dist/{chunk-XNNZN4OY.mjs → chunk-7APORI4E.mjs} +2 -2
  12. package/dist/{chunk-7FX23JBQ.mjs → chunk-AL2CF5GT.mjs} +2 -2
  13. package/dist/{chunk-BWPUNSDD.js → chunk-ANKLITGS.js} +2 -2
  14. package/dist/{chunk-BWPUNSDD.js.map → chunk-ANKLITGS.js.map} +1 -1
  15. package/dist/chunk-C7GTPYMH.mjs +3 -0
  16. package/dist/chunk-C7GTPYMH.mjs.map +1 -0
  17. package/dist/chunk-CMV76O4U.mjs +3 -0
  18. package/dist/chunk-CMV76O4U.mjs.map +1 -0
  19. package/dist/{chunk-WPUW2XFI.js → chunk-CP7BC57S.js} +2 -2
  20. package/dist/{chunk-WPUW2XFI.js.map → chunk-CP7BC57S.js.map} +1 -1
  21. package/dist/chunk-EWRKHBIV.js +3 -0
  22. package/dist/chunk-EWRKHBIV.js.map +1 -0
  23. package/dist/{chunk-HKLR7AH3.js → chunk-GVSERRZX.js} +2 -2
  24. package/dist/{chunk-HKLR7AH3.js.map → chunk-GVSERRZX.js.map} +1 -1
  25. package/dist/chunk-HRYHWWL4.mjs +3 -0
  26. package/dist/chunk-HRYHWWL4.mjs.map +1 -0
  27. package/dist/{chunk-ZF6PO6PJ.js → chunk-I5INE4KG.js} +2 -2
  28. package/dist/{chunk-ZF6PO6PJ.js.map → chunk-I5INE4KG.js.map} +1 -1
  29. package/dist/chunk-IXP2VV7S.mjs +3 -0
  30. package/dist/chunk-IXP2VV7S.mjs.map +1 -0
  31. package/dist/chunk-KGNX6UST.mjs +3 -0
  32. package/dist/chunk-KGNX6UST.mjs.map +1 -0
  33. package/dist/chunk-LCKRYIEJ.js +3 -0
  34. package/dist/chunk-LCKRYIEJ.js.map +1 -0
  35. package/dist/chunk-MSYJFTUX.js +3 -0
  36. package/dist/chunk-MSYJFTUX.js.map +1 -0
  37. package/dist/{chunk-JKSXSLVB.mjs → chunk-NGEWZBAJ.mjs} +2 -2
  38. package/dist/{chunk-7T4BNCXL.js → chunk-OXMHA73F.js} +2 -2
  39. package/dist/chunk-OXMHA73F.js.map +1 -0
  40. package/dist/{chunk-25PBXFF5.js → chunk-QMGLM2OR.js} +2 -2
  41. package/dist/chunk-QMGLM2OR.js.map +1 -0
  42. package/dist/{chunk-RLO6XENU.js → chunk-RKONP3N6.js} +2 -2
  43. package/dist/{chunk-RLO6XENU.js.map → chunk-RKONP3N6.js.map} +1 -1
  44. package/dist/{chunk-TUQM7P2C.js → chunk-RTGC7LPL.js} +2 -2
  45. package/dist/{chunk-TUQM7P2C.js.map → chunk-RTGC7LPL.js.map} +1 -1
  46. package/dist/chunk-RYJZXDJ5.mjs +3 -0
  47. package/dist/chunk-RYJZXDJ5.mjs.map +1 -0
  48. package/dist/chunk-S2TENS3V.mjs +3 -0
  49. package/dist/chunk-S2TENS3V.mjs.map +1 -0
  50. package/dist/{chunk-RJKKQWP2.js → chunk-SBL3PCZC.js} +2 -2
  51. package/dist/{chunk-RJKKQWP2.js.map → chunk-SBL3PCZC.js.map} +1 -1
  52. package/dist/{chunk-FR56YJGL.mjs → chunk-TAMQA7LM.mjs} +2 -2
  53. package/dist/{chunk-FR56YJGL.mjs.map → chunk-TAMQA7LM.mjs.map} +1 -1
  54. package/dist/{chunk-TLWWS45Z.mjs → chunk-U6XL5TKL.mjs} +2 -2
  55. package/dist/{chunk-WBCFLFLW.mjs → chunk-VDRRSPND.mjs} +2 -2
  56. package/dist/chunk-VMOF3XI2.mjs +3 -0
  57. package/dist/chunk-VMOF3XI2.mjs.map +1 -0
  58. package/dist/chunk-WY4HCUAP.mjs +3 -0
  59. package/dist/chunk-WY4HCUAP.mjs.map +1 -0
  60. package/dist/{chunk-RFYGH7BH.mjs → chunk-YENXK5HF.mjs} +2 -2
  61. package/dist/chunk-YENXK5HF.mjs.map +1 -0
  62. package/dist/chunk-ZDWAY77K.js +3 -0
  63. package/dist/{chunk-2S3AGBKQ.js.map → chunk-ZDWAY77K.js.map} +1 -1
  64. package/dist/components/GeometricFluidGrid.js +1 -1
  65. package/dist/components/GeometricFluidGrid.mjs +1 -1
  66. package/dist/components/TextDecoder.d.mts +4 -2
  67. package/dist/components/TextDecoder.d.ts +4 -2
  68. package/dist/components/TextDecoder.js +1 -1
  69. package/dist/components/TextDecoder.mjs +1 -1
  70. package/dist/components/breadcrumb.js +1 -1
  71. package/dist/components/breadcrumb.js.map +1 -1
  72. package/dist/components/breadcrumb.mjs +1 -1
  73. package/dist/components/breadcrumb.mjs.map +1 -1
  74. package/dist/components/button.d.mts +2 -2
  75. package/dist/components/button.d.ts +2 -2
  76. package/dist/components/button.js +1 -1
  77. package/dist/components/button.mjs +1 -1
  78. package/dist/components/calendar.js +1 -1
  79. package/dist/components/calendar.mjs +1 -1
  80. package/dist/components/card.d.mts +1 -0
  81. package/dist/components/card.d.ts +1 -0
  82. package/dist/components/card.js +1 -1
  83. package/dist/components/card.js.map +1 -1
  84. package/dist/components/card.mjs +1 -1
  85. package/dist/components/card.mjs.map +1 -1
  86. package/dist/components/checkbox.js +1 -1
  87. package/dist/components/checkbox.mjs +1 -1
  88. package/dist/components/combobox.d.mts +8 -3
  89. package/dist/components/combobox.d.ts +8 -3
  90. package/dist/components/combobox.js +1 -1
  91. package/dist/components/combobox.mjs +1 -1
  92. package/dist/components/command.d.mts +2 -2
  93. package/dist/components/command.d.ts +2 -2
  94. package/dist/components/command.js +1 -1
  95. package/dist/components/command.mjs +1 -1
  96. package/dist/components/date-picker.js +1 -1
  97. package/dist/components/date-picker.mjs +1 -1
  98. package/dist/components/date-range-picker.js +1 -1
  99. package/dist/components/date-range-picker.mjs +1 -1
  100. package/dist/components/dialog.js +1 -1
  101. package/dist/components/dialog.mjs +1 -1
  102. package/dist/components/drawer.js +1 -1
  103. package/dist/components/drawer.mjs +1 -1
  104. package/dist/components/file-upload.js +1 -1
  105. package/dist/components/file-upload.mjs +1 -1
  106. package/dist/components/label.js +1 -1
  107. package/dist/components/label.mjs +1 -1
  108. package/dist/components/sidebar.js +1 -1
  109. package/dist/components/sidebar.mjs +1 -1
  110. package/dist/components/slider.js +1 -1
  111. package/dist/components/slider.js.map +1 -1
  112. package/dist/components/slider.mjs +1 -1
  113. package/dist/components/slider.mjs.map +1 -1
  114. package/dist/components/table.d.mts +2 -1
  115. package/dist/components/table.d.ts +2 -1
  116. package/dist/components/table.js +1 -1
  117. package/dist/components/table.mjs +1 -1
  118. package/dist/components/tabs.js +1 -1
  119. package/dist/components/tabs.mjs +1 -1
  120. package/dist/components/tree-select.d.mts +26 -0
  121. package/dist/components/tree-select.d.ts +26 -0
  122. package/dist/components/tree-select.js +3 -0
  123. package/dist/components/tree-select.js.map +1 -0
  124. package/dist/components/tree-select.mjs +3 -0
  125. package/dist/components/tree-select.mjs.map +1 -0
  126. package/dist/index.css +1 -1
  127. package/dist/index.css.map +1 -1
  128. package/dist/index.d.mts +2 -1
  129. package/dist/index.d.ts +2 -1
  130. package/dist/index.js +1 -1
  131. package/dist/index.js.map +1 -1
  132. package/dist/index.mjs +1 -1
  133. package/dist/styles.css +1 -1
  134. package/dist/styles.css.map +1 -1
  135. package/package.json +1 -1
  136. package/dist/chunk-24H4O2Z5.js +0 -3
  137. package/dist/chunk-24H4O2Z5.js.map +0 -1
  138. package/dist/chunk-25PBXFF5.js.map +0 -1
  139. package/dist/chunk-2S3AGBKQ.js +0 -3
  140. package/dist/chunk-7T4BNCXL.js.map +0 -1
  141. package/dist/chunk-A7NIT2PJ.mjs +0 -3
  142. package/dist/chunk-A7NIT2PJ.mjs.map +0 -1
  143. package/dist/chunk-BENG4LHZ.js +0 -3
  144. package/dist/chunk-BENG4LHZ.js.map +0 -1
  145. package/dist/chunk-CDWSOB6B.mjs +0 -3
  146. package/dist/chunk-CDWSOB6B.mjs.map +0 -1
  147. package/dist/chunk-EMGXHXG7.mjs +0 -3
  148. package/dist/chunk-EMGXHXG7.mjs.map +0 -1
  149. package/dist/chunk-ERWX5WSB.js +0 -3
  150. package/dist/chunk-ERWX5WSB.js.map +0 -1
  151. package/dist/chunk-GOZDJRUZ.mjs +0 -3
  152. package/dist/chunk-GOZDJRUZ.mjs.map +0 -1
  153. package/dist/chunk-KPMYIU6M.mjs +0 -3
  154. package/dist/chunk-KPMYIU6M.mjs.map +0 -1
  155. package/dist/chunk-M3DW2W2P.js +0 -3
  156. package/dist/chunk-M3DW2W2P.js.map +0 -1
  157. package/dist/chunk-MPAY33XW.mjs +0 -3
  158. package/dist/chunk-MPAY33XW.mjs.map +0 -1
  159. package/dist/chunk-RFYGH7BH.mjs.map +0 -1
  160. package/dist/chunk-TF36SKHU.mjs +0 -3
  161. package/dist/chunk-TF36SKHU.mjs.map +0 -1
  162. package/dist/chunk-VNF4HDJR.mjs.map +0 -1
  163. package/dist/chunk-W65OWFZY.mjs +0 -3
  164. package/dist/chunk-W65OWFZY.mjs.map +0 -1
  165. /package/dist/{chunk-XNNZN4OY.mjs.map → chunk-7APORI4E.mjs.map} +0 -0
  166. /package/dist/{chunk-7FX23JBQ.mjs.map → chunk-AL2CF5GT.mjs.map} +0 -0
  167. /package/dist/{chunk-JKSXSLVB.mjs.map → chunk-NGEWZBAJ.mjs.map} +0 -0
  168. /package/dist/{chunk-TLWWS45Z.mjs.map → chunk-U6XL5TKL.mjs.map} +0 -0
  169. /package/dist/{chunk-WBCFLFLW.mjs.map → chunk-VDRRSPND.mjs.map} +0 -0
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as c}from"./chunk-KPAOPUY2.mjs";import{useEffect as N,useRef as $}from"react";import{jsx as D}from"react/jsx-runtime";var m=14,B=1,P=5,q=(x,a)=>{if(x<a){let s=1-x/a;return s*s*(3-2*s)}return 0},v=class{constructor(a){c(this,"x",0);c(this,"y",0);c(this,"anchorX",0);c(this,"anchorY",0);c(this,"vx",0);c(this,"vy",0);c(this,"nodes",[]);c(this,"opacity",0);c(this,"glitchZones",[]);c(this,"maxReach",180);this.anchorX=a.x,this.anchorY=a.y,this.x=this.anchorX,this.y=this.anchorY,this.init()}init(){this.nodes=[];let a=3+Math.floor(Math.random()*3);for(let s=0;s<a;s++){let e=15+Math.random()*25,b=(Math.random()-.5)*60,u=(Math.random()-.5)*60;this.nodes.push({offsetX:b,offsetY:u,vx:(Math.random()-.5)*.1,vy:(Math.random()-.5)*.1,radius:e,t:Math.random()*100})}this.opacity=1}update(){let a=this.anchorX-this.x,s=this.anchorY-this.y,e=5e-4,b=a*e,u=s*e,g=(Math.random()-.5)*.01,r=(Math.random()-.5)*.01;if(this.vx+=b+g,this.vy+=u+r,this.vx*=.96,this.vy*=.96,this.x+=this.vx,this.y+=this.vy,this.nodes.forEach(n=>{n.t+=.005,n.offsetX+=Math.sin(n.t)*.1+n.vx,n.offsetY+=Math.cos(n.t*.9)*.1+n.vy;let d=70;(n.offsetX>d||n.offsetX<-d)&&(n.vx*=-1),(n.offsetY>d||n.offsetY<-d)&&(n.vy*=-1),n.radius+=Math.sin(n.t*2)*.1}),this.glitchZones=this.glitchZones.filter(n=>n.life>0),this.glitchZones.forEach(n=>n.life--),Math.random()<.03){let d=f=>Math.round((f-m/2)/m)*m+m/2,R=this.x+(Math.random()-.5)*80,X=this.y+(Math.random()-.5)*80,p=d(R),i=d(X);if((Math.random()>.6?"line":"dot")==="line"){let f=Math.random()>.5,y=40+Math.random()*80,t=2;this.glitchZones.push({x:f?p-t/2:p-y/2,y:f?i-y/2:i-t/2,w:f?t:y,h:f?y:t,life:8+Math.random()*12})}else this.glitchZones.push({x:p-4/2,y:i-4/2,w:4,h:4,life:6+Math.random()*10})}}},F=class{constructor(a,s){c(this,"x");c(this,"y");c(this,"opacity");c(this,"decay");c(this,"nodes");c(this,"maxReach",60);this.x=a,this.y=s,this.opacity=.8,this.decay=.03,this.nodes=[];let e=2;for(let b=0;b<e;b++)this.nodes.push({offsetX:(Math.random()-.5)*10,offsetY:(Math.random()-.5)*10,vx:(Math.random()-.5)*1,vy:(Math.random()-.5)*1,radius:5+Math.random()*10,t:0})}update(){this.opacity-=this.decay,this.nodes.forEach(a=>{a.offsetX+=a.vx,a.offsetY+=a.vy,a.radius*=.95})}},_=({variant:x="animated"})=>{let a=$(null);return N(()=>{let s=a.current;if(!s)return;let e=s.getContext("2d");if(!e)return;let b,u=[],g=[],r={x:-1e3,y:-1e3,lastX:-1e3,lastY:-1e3},n=()=>{u=[];let i=s.width,h=s.height;u.push(new v({x:i-i*.15,y:h*.15})),u.push(new v({x:i*.4,y:h*.4})),u.push(new v({x:i*.05+50,y:h-h*.15})),u.push(new v({x:i-i*.05-50,y:h-h*.05-50}))},d=()=>{let i=s.getBoundingClientRect();s.width=i.width,s.height=i.height,n()},R=i=>{let h=s.getBoundingClientRect();r.x=i.clientX-h.left,r.y=i.clientY-h.top,r.lastX===-1e3&&(r.lastX=r.x,r.lastY=r.y);let f=r.x-r.lastX,y=r.y-r.lastY;Math.sqrt(f*f+y*y)>20&&(g.push(new F(r.x,r.y)),r.lastX=r.x,r.lastY=r.y)},X=()=>{d()},p=()=>{let i=s.width,h=s.height;if(e.fillStyle="#050505",e.fillRect(0,0,i,h),x==="static"){for(let t=m/2;t<i;t+=m)for(let l=m/2;l<h;l+=m)e.fillStyle="rgba(255, 255, 255, 0.03)",e.fillRect(t-.5,l-.5,1,1);return}u.forEach(t=>t.update());for(let t=g.length-1;t>=0;t--)g[t].update(),g[t].opacity<=0&&g.splice(t,1);let f=[...u,...g],y=[];u.forEach(t=>y.push(...t.glitchZones));for(let t=m/2;t<i;t+=m)for(let l=m/2;l<h;l+=m){let C=!1;for(let o of y)if(t>=o.x&&t<=o.x+o.w&&l>=o.y&&l<=o.y+o.h){C=!0;break}if(C){if(e.fillStyle="rgba(182, 243, 191, 0.95)",Math.random()>.1){let o=Math.random()>.5?P*.7:B*2;e.beginPath(),e.arc(t,l,o/2,0,Math.PI*2),e.fill()}continue}let M=0,I=!1;for(let o of f)if(Math.abs(t-o.x)<o.maxReach&&Math.abs(l-o.y)<o.maxReach){I=!0;break}if(!I){e.fillStyle="rgba(255, 255, 255, 0.03)",e.fillRect(t-.5,l-.5,1,1);continue}for(let o of f){let E=t-o.x,z=l-o.y;if(Math.abs(E)>o.maxReach||Math.abs(z)>o.maxReach)continue;let w=0;for(let Y of o.nodes){let Z=E-Y.offsetX,G=z-Y.offsetY,S=Math.sqrt(Z*Z+G*G);w+=q(S,Y.radius)}w>1&&(w=1),M+=w*o.opacity}if(M>1&&(M=1),M>.01){let G=Math.floor(255+-73*M),S=Math.floor(255+-12*M),L=Math.floor(255+-64*M),A=M*.5,k=B+M*(P-B);e.fillStyle=`rgba(${G}, ${S}, ${L}, ${A})`,e.beginPath(),e.arc(t,l,k/2,0,Math.PI*2),e.fill()}else e.fillStyle="rgba(255, 255, 255, 0.03)",e.fillRect(t-.5,l-.5,1,1)}b=requestAnimationFrame(p)};return window.addEventListener("resize",X),x==="animated"&&window.addEventListener("mousemove",R),d(),p(),()=>{window.removeEventListener("resize",X),x==="animated"&&window.removeEventListener("mousemove",R),cancelAnimationFrame(b)}},[x]),D("canvas",{ref:a,className:"fixed inset-0 -z-999 w-full h-full pointer-events-none"})},V=_;export{V as a};
3
- //# sourceMappingURL=chunk-VNF4HDJR.mjs.map
2
+ import{a as c}from"./chunk-KPAOPUY2.mjs";import{useEffect as N,useRef as $}from"react";import{jsx as D}from"react/jsx-runtime";var m=17,B=1,P=5,q=(x,a)=>{if(x<a){let s=1-x/a;return s*s*(3-2*s)}return 0},v=class{constructor(a){c(this,"x",0);c(this,"y",0);c(this,"anchorX",0);c(this,"anchorY",0);c(this,"vx",0);c(this,"vy",0);c(this,"nodes",[]);c(this,"opacity",0);c(this,"glitchZones",[]);c(this,"maxReach",180);this.anchorX=a.x,this.anchorY=a.y,this.x=this.anchorX,this.y=this.anchorY,this.init()}init(){this.nodes=[];let a=3+Math.floor(Math.random()*3);for(let s=0;s<a;s++){let e=15+Math.random()*25,b=(Math.random()-.5)*60,u=(Math.random()-.5)*60;this.nodes.push({offsetX:b,offsetY:u,vx:(Math.random()-.5)*.1,vy:(Math.random()-.5)*.1,radius:e,t:Math.random()*100})}this.opacity=1}update(){let a=this.anchorX-this.x,s=this.anchorY-this.y,e=5e-4,b=a*e,u=s*e,g=(Math.random()-.5)*.01,r=(Math.random()-.5)*.01;if(this.vx+=b+g,this.vy+=u+r,this.vx*=.96,this.vy*=.96,this.x+=this.vx,this.y+=this.vy,this.nodes.forEach(n=>{n.t+=.005,n.offsetX+=Math.sin(n.t)*.1+n.vx,n.offsetY+=Math.cos(n.t*.9)*.1+n.vy;let d=70;(n.offsetX>d||n.offsetX<-d)&&(n.vx*=-1),(n.offsetY>d||n.offsetY<-d)&&(n.vy*=-1),n.radius+=Math.sin(n.t*2)*.1}),this.glitchZones=this.glitchZones.filter(n=>n.life>0),this.glitchZones.forEach(n=>n.life--),Math.random()<.03){let d=f=>Math.round((f-m/2)/m)*m+m/2,R=this.x+(Math.random()-.5)*80,X=this.y+(Math.random()-.5)*80,p=d(R),i=d(X);if((Math.random()>.6?"line":"dot")==="line"){let f=Math.random()>.5,y=40+Math.random()*80,t=2;this.glitchZones.push({x:f?p-t/2:p-y/2,y:f?i-y/2:i-t/2,w:f?t:y,h:f?y:t,life:8+Math.random()*12})}else this.glitchZones.push({x:p-4/2,y:i-4/2,w:4,h:4,life:6+Math.random()*10})}}},F=class{constructor(a,s){c(this,"x");c(this,"y");c(this,"opacity");c(this,"decay");c(this,"nodes");c(this,"maxReach",60);this.x=a,this.y=s,this.opacity=.8,this.decay=.03,this.nodes=[];let e=2;for(let b=0;b<e;b++)this.nodes.push({offsetX:(Math.random()-.5)*10,offsetY:(Math.random()-.5)*10,vx:(Math.random()-.5)*1,vy:(Math.random()-.5)*1,radius:5+Math.random()*10,t:0})}update(){this.opacity-=this.decay,this.nodes.forEach(a=>{a.offsetX+=a.vx,a.offsetY+=a.vy,a.radius*=.95})}},_=({variant:x="animated"})=>{let a=$(null);return N(()=>{let s=a.current;if(!s)return;let e=s.getContext("2d");if(!e)return;let b,u=[],g=[],r={x:-1e3,y:-1e3,lastX:-1e3,lastY:-1e3},n=()=>{u=[];let i=s.width,h=s.height;u.push(new v({x:i-i*.15,y:h*.15})),u.push(new v({x:i*.4,y:h*.4})),u.push(new v({x:i*.05+50,y:h-h*.15})),u.push(new v({x:i-i*.05-50,y:h-h*.05-50}))},d=()=>{let i=s.getBoundingClientRect();s.width=i.width,s.height=i.height,n()},R=i=>{let h=s.getBoundingClientRect();r.x=i.clientX-h.left,r.y=i.clientY-h.top,r.lastX===-1e3&&(r.lastX=r.x,r.lastY=r.y);let f=r.x-r.lastX,y=r.y-r.lastY;Math.sqrt(f*f+y*y)>20&&(g.push(new F(r.x,r.y)),r.lastX=r.x,r.lastY=r.y)},X=()=>{d()},p=()=>{let i=s.width,h=s.height;if(e.fillStyle="#050505",e.fillRect(0,0,i,h),x==="static"){for(let t=m/2;t<i;t+=m)for(let l=m/2;l<h;l+=m)e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1);return}u.forEach(t=>t.update());for(let t=g.length-1;t>=0;t--)g[t].update(),g[t].opacity<=0&&g.splice(t,1);let f=[...u,...g],y=[];u.forEach(t=>y.push(...t.glitchZones));for(let t=m/2;t<i;t+=m)for(let l=m/2;l<h;l+=m){let C=!1;for(let o of y)if(t>=o.x&&t<=o.x+o.w&&l>=o.y&&l<=o.y+o.h){C=!0;break}if(C){if(e.fillStyle="rgba(182, 243, 191, 0.95)",Math.random()>.1){let o=Math.random()>.5?P*.7:B*2;e.beginPath(),e.arc(t,l,o/2,0,Math.PI*2),e.fill()}continue}let M=0,I=!1;for(let o of f)if(Math.abs(t-o.x)<o.maxReach&&Math.abs(l-o.y)<o.maxReach){I=!0;break}if(!I){e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1);continue}for(let o of f){let E=t-o.x,z=l-o.y;if(Math.abs(E)>o.maxReach||Math.abs(z)>o.maxReach)continue;let w=0;for(let Y of o.nodes){let Z=E-Y.offsetX,G=z-Y.offsetY,S=Math.sqrt(Z*Z+G*G);w+=q(S,Y.radius)}w>1&&(w=1),M+=w*o.opacity}if(M>1&&(M=1),M>.01){let G=Math.floor(255+-73*M),S=Math.floor(255+-12*M),L=Math.floor(255+-64*M),A=M*.5,k=B+M*(P-B);e.fillStyle=`rgba(${G}, ${S}, ${L}, ${A})`,e.beginPath(),e.arc(t,l,k/2,0,Math.PI*2),e.fill()}else e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1)}b=requestAnimationFrame(p)};return window.addEventListener("resize",X),x==="animated"&&window.addEventListener("mousemove",R),d(),p(),()=>{window.removeEventListener("resize",X),x==="animated"&&window.removeEventListener("mousemove",R),cancelAnimationFrame(b)}},[x]),D("canvas",{ref:a,className:"fixed inset-0 -z-999 w-full h-full pointer-events-none"})},V=_;export{V as a};
3
+ //# sourceMappingURL=chunk-2CF4QASK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/GeometricFluidGrid.tsx"],"sourcesContent":["\"use client\"\nimport React, { useEffect, useRef } from \"react\"\n\n// --- CONFIGURATION ---\nconst GAP = 17\nconst BASE_SIZE = 1\nconst MAX_SIZE = 5\n\n// --- TYPES ---\ninterface Node {\n offsetX: number\n offsetY: number\n vx: number\n vy: number\n radius: number\n t: number\n}\n\ninterface GlitchZone {\n x: number\n y: number\n w: number\n h: number\n life: number\n}\n\ninterface MouseState {\n x: number\n y: number\n lastX: number\n lastY: number\n}\n\n// --- MATH HELPERS ---\nconst getFalloff = (dist: number, radius: number): number => {\n if (dist < radius) {\n const val = 1 - dist / radius\n return val * val * (3 - 2 * val)\n }\n return 0\n}\n\n// --- CLASSES ---\nclass AnchoredBlob {\n // Current Position\n x: number = 0\n y: number = 0\n\n // Anchor Position (Home base)\n anchorX: number = 0\n anchorY: number = 0\n\n // Movement\n vx: number = 0\n vy: number = 0\n\n // Appearance\n nodes: Node[] = []\n opacity: number = 0\n\n // Glitch State\n glitchZones: GlitchZone[] = []\n maxReach: number = 180\n\n constructor(anchorConfig: { x: number; y: number }) {\n this.anchorX = anchorConfig.x\n this.anchorY = anchorConfig.y\n this.x = this.anchorX\n this.y = this.anchorY\n this.init()\n }\n\n init() {\n // 1. Create Internal Nodes (The \"Blob\" composition)\n this.nodes = []\n const nodeCount = 3 + Math.floor(Math.random() * 3) // 3 to 5 nodes\n\n for (let i = 0; i < nodeCount; i++) {\n // Significantly smaller radius (15-40px) to reduce central bulk\n const r = 15 + Math.random() * 25\n // Wider initial spread\n const ox = (Math.random() - 0.5) * 60\n const oy = (Math.random() - 0.5) * 60\n\n this.nodes.push({\n offsetX: ox,\n offsetY: oy,\n vx: (Math.random() - 0.5) * 0.1, // Slower internal movement (was 0.4)\n vy: (Math.random() - 0.5) * 0.1,\n radius: r,\n t: Math.random() * 100,\n })\n }\n\n this.opacity = 1\n }\n\n update() {\n // --- 1. Tethered Movement Logic ---\n const dx = this.anchorX - this.x\n const dy = this.anchorY - this.y\n\n // Spring constant (very loose)\n const k = 0.0005\n const ax = dx * k\n const ay = dy * k\n\n // Random wandering force - Reduced significantly for slower drift\n const wx = (Math.random() - 0.5) * 0.01 // was 0.05\n const wy = (Math.random() - 0.5) * 0.01 // was 0.05\n\n this.vx += ax + wx\n this.vy += ay + wy\n\n this.vx *= 0.96\n this.vy *= 0.96\n\n this.x += this.vx\n this.y += this.vy\n\n // --- 2. Internal Node Animation ---\n this.nodes.forEach((node) => {\n // Slow down time step\n node.t += 0.005 // was 0.02\n\n // Slower oscillation and movement\n node.offsetX += Math.sin(node.t) * 0.1 + node.vx // amp was 0.4\n node.offsetY += Math.cos(node.t * 0.9) * 0.1 + node.vy\n\n // Constrain to \"nucleus\"\n const maxDist = 70\n if (node.offsetX > maxDist || node.offsetX < -maxDist) node.vx *= -1\n if (node.offsetY > maxDist || node.offsetY < -maxDist) node.vy *= -1\n\n // Pulse size\n node.radius += Math.sin(node.t * 2) * 0.1\n })\n\n // --- 3. Manage Glitch Zones ---\n // Remove dead glitches\n this.glitchZones = this.glitchZones.filter((g) => g.life > 0)\n this.glitchZones.forEach((g) => g.life--)\n\n // Randomly spawn new glitches\n if (Math.random() < 0.03) {\n // 3% chance per frame\n const spread = 80\n\n // Snap random positions to exact grid points to ensure clean lines\n const snap = (v: number) =>\n Math.round((v - GAP / 2) / GAP) * GAP + GAP / 2\n\n const rawCx = this.x + (Math.random() - 0.5) * spread\n const rawCy = this.y + (Math.random() - 0.5) * spread\n\n const cx = snap(rawCx)\n const cy = snap(rawCy)\n\n const type = Math.random() > 0.6 ? \"line\" : \"dot\"\n\n if (type === \"line\") {\n const isVert = Math.random() > 0.5\n // Medium length: 40-120px\n const len = 40 + Math.random() * 80\n\n // Thickness is essentially zero (just a sliver) centered on the grid line\n // to guarantee we only pick up exactly one row/column of dots\n const thickness = 2\n\n this.glitchZones.push({\n x: isVert ? cx - thickness / 2 : cx - len / 2,\n y: isVert ? cy - len / 2 : cy - thickness / 2,\n w: isVert ? thickness : len,\n h: isVert ? len : thickness,\n life: 8 + Math.random() * 12,\n })\n } else {\n // Single dot\n // Box just large enough to catch one grid point\n const size = 4\n\n this.glitchZones.push({\n x: cx - size / 2,\n y: cy - size / 2,\n w: size,\n h: size,\n life: 6 + Math.random() * 10,\n })\n }\n }\n }\n}\n\nclass TrailBlob {\n x: number\n y: number\n opacity: number\n decay: number\n nodes: Node[]\n maxReach: number = 60\n\n constructor(x: number, y: number) {\n this.x = x\n this.y = y\n this.opacity = 0.8\n this.decay = 0.03\n\n this.nodes = []\n const count = 2\n for (let i = 0; i < count; i++) {\n this.nodes.push({\n offsetX: (Math.random() - 0.5) * 10,\n offsetY: (Math.random() - 0.5) * 10,\n vx: (Math.random() - 0.5) * 1,\n vy: (Math.random() - 0.5) * 1,\n radius: 5 + Math.random() * 10,\n t: 0,\n })\n }\n }\n\n update() {\n this.opacity -= this.decay\n this.nodes.forEach((node) => {\n node.offsetX += node.vx\n node.offsetY += node.vy\n node.radius *= 0.95\n })\n }\n}\n\ninterface GeometricFluidGridProps {\n variant?: \"animated\" | \"static\"\n}\n\nconst GeometricFluidGrid: React.FC<GeometricFluidGridProps> = ({\n variant = \"animated\",\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n\n useEffect(() => {\n const canvas = canvasRef.current\n if (!canvas) return\n\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n let animationFrameId: number\n let orbs: AnchoredBlob[] = []\n let trail: TrailBlob[] = []\n let mouse: MouseState = { x: -1000, y: -1000, lastX: -1000, lastY: -1000 }\n\n const initWorld = () => {\n orbs = []\n const w = canvas.width\n const h = canvas.height\n\n // 1. Top Right\n orbs.push(\n new AnchoredBlob({\n x: w - w * 0.15,\n y: h * 0.15,\n })\n )\n\n // 2. ~40% from top and ~40% from left\n orbs.push(\n new AnchoredBlob({\n x: w * 0.4,\n y: h * 0.4,\n })\n )\n\n // 3. Bottom Left\n orbs.push(\n new AnchoredBlob({\n x: w * 0.05 + 50,\n y: h - h * 0.15,\n })\n )\n\n // 4. Bottom Right\n orbs.push(\n new AnchoredBlob({\n x: w - w * 0.05 - 50,\n y: h - h * 0.05 - 50,\n })\n )\n }\n\n const resize = () => {\n const rect = canvas.getBoundingClientRect()\n canvas.width = rect.width\n canvas.height = rect.height\n initWorld()\n }\n\n const handleMouseMove = (e: MouseEvent) => {\n const rect = canvas.getBoundingClientRect()\n mouse.x = e.clientX - rect.left\n mouse.y = e.clientY - rect.top\n\n if (mouse.lastX === -1000) {\n mouse.lastX = mouse.x\n mouse.lastY = mouse.y\n }\n\n const dx = mouse.x - mouse.lastX\n const dy = mouse.y - mouse.lastY\n const dist = Math.sqrt(dx * dx + dy * dy)\n\n if (dist > 20) {\n trail.push(new TrailBlob(mouse.x, mouse.y))\n mouse.lastX = mouse.x\n mouse.lastY = mouse.y\n }\n }\n\n const handleResize = () => {\n resize()\n }\n\n const draw = () => {\n const w = canvas.width\n const h = canvas.height\n\n // Clear Screen\n ctx.fillStyle = \"#050505\"\n ctx.fillRect(0, 0, w, h)\n\n // Static variant: just render uniform dots\n if (variant === \"static\") {\n for (let x = GAP / 2; x < w; x += GAP) {\n for (let y = GAP / 2; y < h; y += GAP) {\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n }\n }\n return // No animation loop for static variant\n }\n\n // Animated variant: update and render with animations\n // Update Logic\n orbs.forEach((orb) => orb.update())\n for (let i = trail.length - 1; i >= 0; i--) {\n trail[i].update()\n if (trail[i].opacity <= 0) trail.splice(i, 1)\n }\n\n const renderList = [...orbs, ...trail]\n\n // Collect all glitch zones for easier checking inside the loop\n // We flat map them to a simple array to iterate quickly\n const allGlitches: GlitchZone[] = []\n orbs.forEach((o) => allGlitches.push(...o.glitchZones))\n\n for (let x = GAP / 2; x < w; x += GAP) {\n for (let y = GAP / 2; y < h; y += GAP) {\n // --- GLITCH CHECK ---\n // Check if this specific grid dot is inside a glitch zone\n let isGlitching = false\n for (const g of allGlitches) {\n // Simple AABB check\n if (x >= g.x && x <= g.x + g.w && y >= g.y && y <= g.y + g.h) {\n isGlitching = true\n break\n }\n }\n\n if (isGlitching) {\n // Glitched Dot: Bright\n // We use the grid itself to manifest the glitch\n ctx.fillStyle = \"rgba(182, 243, 191, 0.95)\"\n\n // Randomly skip some dots in the glitch line for a \"broken\" look\n if (Math.random() > 0.1) {\n const size = Math.random() > 0.5 ? MAX_SIZE * 0.7 : BASE_SIZE * 2\n ctx.beginPath()\n ctx.arc(x, y, size / 2, 0, Math.PI * 2)\n ctx.fill()\n }\n continue // Skip standard influence calculation for this dot\n }\n\n // --- STANDARD INFLUENCE CHECK ---\n let totalInfluence = 0\n\n // Optimization: Is near blob?\n let nearby = false\n for (const entity of renderList) {\n if (\n Math.abs(x - entity.x) < entity.maxReach &&\n Math.abs(y - entity.y) < entity.maxReach\n ) {\n nearby = true\n break\n }\n }\n\n if (!nearby) {\n // Passive Background Dot\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n continue\n }\n\n // Calculate Influence\n for (const entity of renderList) {\n const dx = x - entity.x\n const dy = y - entity.y\n\n if (\n Math.abs(dx) > entity.maxReach ||\n Math.abs(dy) > entity.maxReach\n )\n continue\n\n let localInf = 0\n for (const node of entity.nodes) {\n const nx = dx - node.offsetX\n const ny = dy - node.offsetY\n const dist = Math.sqrt(nx * nx + ny * ny)\n localInf += getFalloff(dist, node.radius)\n }\n if (localInf > 1) localInf = 1\n totalInfluence += localInf * entity.opacity\n }\n\n if (totalInfluence > 1) totalInfluence = 1\n\n // Draw Cell\n if (totalInfluence > 0.01) {\n // Gradient: White (Edge) to Green (#B6F3BF - Center)\n const edgeR = 255,\n centerR = 182\n const edgeG = 255,\n centerG = 243\n const edgeB = 255,\n centerB = 191\n\n // Interpolate from White (0 influence) to Green (1 influence)\n const r = Math.floor(edgeR + (centerR - edgeR) * totalInfluence)\n const g = Math.floor(edgeG + (centerG - edgeG) * totalInfluence)\n const b = Math.floor(edgeB + (centerB - edgeB) * totalInfluence)\n\n const alpha = totalInfluence * 0.5\n const size = BASE_SIZE + totalInfluence * (MAX_SIZE - BASE_SIZE)\n\n ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${alpha})`\n ctx.beginPath()\n ctx.arc(x, y, size / 2, 0, Math.PI * 2)\n ctx.fill()\n } else {\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n }\n }\n }\n\n animationFrameId = requestAnimationFrame(draw)\n }\n\n window.addEventListener(\"resize\", handleResize)\n if (variant === \"animated\") {\n window.addEventListener(\"mousemove\", handleMouseMove)\n }\n\n resize()\n draw()\n\n return () => {\n window.removeEventListener(\"resize\", handleResize)\n if (variant === \"animated\") {\n window.removeEventListener(\"mousemove\", handleMouseMove)\n }\n cancelAnimationFrame(animationFrameId)\n }\n }, [variant])\n\n return (\n <canvas\n ref={canvasRef}\n className=\"fixed inset-0 -z-999 w-full h-full pointer-events-none\"\n />\n )\n}\n\nexport default GeometricFluidGrid\n"],"mappings":";yCACA,OAAgB,aAAAA,EAAW,UAAAC,MAAc,QA+drC,cAAAC,MAAA,oBA5dJ,IAAMC,EAAM,GACNC,EAAY,EACZC,EAAW,EA4BXC,EAAa,CAACC,EAAcC,IAA2B,CAC3D,GAAID,EAAOC,EAAQ,CACjB,IAAMC,EAAM,EAAIF,EAAOC,EACvB,OAAOC,EAAMA,GAAO,EAAI,EAAIA,EAC9B,CACA,MAAO,EACT,EAGMC,EAAN,KAAmB,CAqBjB,YAAYC,EAAwC,CAnBpDC,EAAA,SAAY,GACZA,EAAA,SAAY,GAGZA,EAAA,eAAkB,GAClBA,EAAA,eAAkB,GAGlBA,EAAA,UAAa,GACbA,EAAA,UAAa,GAGbA,EAAA,aAAgB,CAAC,GACjBA,EAAA,eAAkB,GAGlBA,EAAA,mBAA4B,CAAC,GAC7BA,EAAA,gBAAmB,KAGjB,KAAK,QAAUD,EAAa,EAC5B,KAAK,QAAUA,EAAa,EAC5B,KAAK,EAAI,KAAK,QACd,KAAK,EAAI,KAAK,QACd,KAAK,KAAK,CACZ,CAEA,M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B,IAAME,EAAKpD,EAAKO,EAAK,QACf8C,EAAKpD,EAAKM,EAAK,QACflB,EAAO,KAAK,KAAK+D,EAAKA,EAAKC,EAAKA,CAAE,EACxCF,GAAY/D,EAAWC,EAAMkB,EAAK,MAAM,CAC1C,CACI4C,EAAW,IAAGA,EAAW,GAC7BH,GAAkBG,EAAWD,EAAO,OACtC,CAKA,GAHIF,EAAiB,IAAGA,EAAiB,GAGrCA,EAAiB,IAAM,CAUzB,IAAMnD,EAAI,KAAK,MAAM,IAAS,IAAmBmD,CAAc,EACzDvC,EAAI,KAAK,MAAM,IAAS,IAAmBuC,CAAc,EACzDM,EAAI,KAAK,MAAM,IAAS,IAAmBN,CAAc,EAEzDO,EAAQP,EAAiB,GACzBD,EAAO7D,EAAY8D,GAAkB7D,EAAWD,GAEtD2C,EAAI,UAAY,QAAQhC,CAAC,KAAKY,CAAC,KAAK6C,CAAC,KAAKC,CAAK,IAC/C1B,EAAI,UAAU,EACdA,EAAI,IAAIT,EAAGC,EAAG0B,EAAO,EAAG,EAAG,KAAK,GAAK,CAAC,EACtClB,EAAI,KAAK,CACX,MACEA,EAAI,UAAY,sBAChBA,EAAI,SAAST,EAAI,GAAKC,EAAI,GAAK,EAAG,CAAC,CAEvC,CAGFS,EAAmB,sBAAsBW,CAAI,CAC/C,EAEA,cAAO,iBAAiB,SAAUD,CAAY,EAC1ChB,IAAY,YACd,OAAO,iBAAiB,YAAac,CAAe,EAGtDF,EAAO,EACPK,EAAK,EAEE,IAAM,CACX,OAAO,oBAAoB,SAAUD,CAAY,EAC7ChB,IAAY,YACd,OAAO,oBAAoB,YAAac,CAAe,EAEzD,qBAAqBR,CAAgB,CACvC,CACF,EAAG,CAACN,CAAO,CAAC,EAGVxC,EAAC,UACC,IAAKyC,EACL,UAAU,yDACZ,CAEJ,EAEO+B,EAAQjC","names":["useEffect","useRef","jsx","GAP","BASE_SIZE","MAX_SIZE","getFalloff","dist","radius","val","AnchoredBlob","anchorConfig","__publicField","nodeCount","i","r","ox","oy","dx","dy","k","ax","ay","wx","wy","node","maxDist","g","snap","v","rawCx","rawCy","cx","cy","isVert","len","thickness","TrailBlob","x","y","count","GeometricFluidGrid","variant","canvasRef","useRef","useEffect","canvas","ctx","animationFrameId","orbs","trail","mouse","initWorld","w","resize","rect","handleMouseMove","e","handleResize","draw","orb","renderList","allGlitches","o","isGlitching","size","totalInfluence","nearby","entity","localInf","nx","ny","b","alpha","GeometricFluidGrid_default"]}
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ var _chunkLCKRYIEJjs = require('./chunk-LCKRYIEJ.js');var _chunkULIOO55Ijs = require('./chunk-ULIOO55I.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var i = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');function M(e){let n=[e.value];if(e.children)for(let a of e.children)n.push(...M(a));return n}function $(e,n){if(!e.children||e.children.length===0)return n.has(e.value)?"checked":"unchecked";let a=M(e),r=a.filter(l=>n.has(l)).length;return r===0?"unchecked":r===a.length?"checked":"indeterminate"}function J(e,n){let a=n.toLowerCase().trim();if(!a)return e;let r=[];for(let l of e){let f=l.label.toLowerCase().includes(a);if(l.children&&l.children.length>0){let h=J(l.children,n);f?r.push(l):h&&h.length>0&&r.push({...l,children:h})}else f&&r.push(l)}return r.length>0?r:null}function le(e,n){let a=n.toLowerCase().trim(),r=new Set;function l(f){let h=!1;for(let g of f){let w=g.label.toLowerCase().includes(a),S=!1;g.children&&(S=l(g.children)),(w||S)&&(r.add(g.value),h=!0)}return h}return l(e),r}function N(e,n){for(let a of e){if(a.value===n)return a;if(a.children){let r=N(a.children,n);if(r)return r}}}function Q(e){let n=new Set;for(let a of e)if(a.children&&a.children.length>0){n.add(a.value);for(let r of Q(a.children))n.add(r)}return n}function oe(e,n){if(!n)return e;let a=n.toLowerCase().trim();if(!a)return e;let r=e.toLowerCase().indexOf(a);return r===-1?e:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e.slice(0,r),_jsxruntime.jsx.call(void 0, "span",{className:"font-semibold underline",children:e.slice(r,r+a.length)}),e.slice(r+a.length)]})}function W({node:e,depth:n,multiple:a,selectedSet:r,expandedValues:l,focusedValue:f,onToggleExpand:h,onSelect:g,onFocus:w,searchTerm:S}){let V=e.children&&e.children.length>0,y=l.has(e.value),b=a?$(e,r):r.has(e.value)?"checked":"unchecked",A=n*20;return _jsxruntime.jsxs.call(void 0, "div",{role:"treeitem","aria-expanded":V?y:void 0,"aria-selected":b==="checked",children:[_jsxruntime.jsxs.call(void 0, "div",{className:_chunkFUYXCJOQjs.a.call(void 0, "relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none","hover:bg-muted",b==="checked"&&!a&&"bg-muted"),style:{paddingLeft:`${8+A}px`},onClick:()=>g(e),onFocus:()=>w(e.value),"data-tree-value":e.value,tabIndex:f===e.value?0:-1,children:[V?_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary",onClick:m=>{m.stopPropagation(),h(e.value)},"aria-label":y?`Collapse ${e.label}`:`Expand ${e.label}`,tabIndex:-1,children:y?_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown,{className:"h-3.5 w-3.5"}):_jsxruntime.jsx.call(void 0, _lucidereact.ChevronRight,{className:"h-3.5 w-3.5"})}):_jsxruntime.jsx.call(void 0, "span",{className:"h-4 w-4 shrink-0"}),a?_jsxruntime.jsx.call(void 0, _chunkLCKRYIEJjs.a,{checked:b==="checked"?!0:b==="indeterminate"?"indeterminate":!1,onCheckedChange:()=>g(e),onClick:m=>m.stopPropagation(),className:"shrink-0","aria-label":e.label}):_jsxruntime.jsx.call(void 0, _lucidereact.Check,{className:_chunkFUYXCJOQjs.a.call(void 0, "h-4 w-4 shrink-0",b==="checked"?"opacity-100":"opacity-0")}),_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:oe(e.label,S)})]}),V&&y&&_jsxruntime.jsx.call(void 0, "div",{role:"group",children:e.children.map(m=>_jsxruntime.jsx.call(void 0, W,{node:m,depth:n+1,multiple:a,selectedSet:r,expandedValues:l,focusedValue:f,onToggleExpand:h,onSelect:g,onFocus:w,searchTerm:S},m.value))})]})}function ge({nodes:e,value:n,onValueChange:a,multiple:r=!1,values:l=[],onValuesChange:f,placeholder:h="Select...",searchPlaceholder:g="Search...",emptyMessage:w="No results found.",disabled:S=!1,className:V,error:y=!1,defaultExpandedValues:b,expandAll:A=!1}){let[m,B]=i.useState(!1),[v,K]=i.useState(""),[p,k]=i.useState(null),[D,L]=i.useState(()=>A?Q(e):b?new Set(b):new Set),P=i.useRef(null),I=i.useRef(null),C=i.useMemo(()=>new Set(r?l:n?[n]:[]),[r,l,n]),F=i.useMemo(()=>v?J(e,v):e,[e,v]);i.useEffect(()=>{if(v){P.current||(P.current=new Set(D));let t=le(e,v);L(t)}else P.current&&(L(P.current),P.current=null)},[v,e]);let Y=i.useCallback(t=>{B(t),t||(K(""),k(null))},[]),T=i.useCallback(t=>{L(s=>{let d=new Set(s);return d.has(t)?d.delete(t):d.add(t),d})},[]),H=i.useCallback(t=>{if(r){let s=M(t),d=$(t,C),c;if(d==="checked"){let u=new Set(s);c=l.filter(R=>!u.has(R))}else{let u=s.filter(R=>!C.has(R));c=[...l,...u]}_optionalChain([f, 'optionalCall', _2 => _2(c)])}else{if(t.children&&t.children.length>0){T(t.value);return}let d=t.value===n?"":t.value;_optionalChain([a, 'optionalCall', _3 => _3(d)]),B(!1)}},[r,l,n,C,f,a,T]),Z=i.useCallback((t,s)=>{s.preventDefault(),s.stopPropagation();let d=N(e,t);if(d){let c=new Set(M(d)),u=l.filter(R=>!c.has(R));_optionalChain([f, 'optionalCall', _4 => _4(u)])}},[e,l,f]),q=i.useMemo(()=>{if(!r)return[];let t=[];function s(d){for(let c of d){let u=$(c,C);u==="checked"?t.push(c.value):u==="indeterminate"&&c.children&&s(c.children)}}return s(e),t},[e,C,r]),O=i.useCallback(()=>I.current?Array.from(I.current.querySelectorAll("[data-tree-value]")):[],[]),_=i.useCallback(t=>{let s=O(),d=s.findIndex(c=>c.dataset.treeValue===p);switch(t.key){case"ArrowDown":{t.preventDefault();let c=Math.min(d+1,s.length-1),u=_optionalChain([s, 'access', _5 => _5[c], 'optionalAccess', _6 => _6.dataset, 'access', _7 => _7.treeValue]);u&&(k(u),_optionalChain([s, 'access', _8 => _8[c], 'optionalAccess', _9 => _9.focus, 'call', _10 => _10()]));break}case"ArrowUp":{t.preventDefault();let c=Math.max(d-1,0),u=_optionalChain([s, 'access', _11 => _11[c], 'optionalAccess', _12 => _12.dataset, 'access', _13 => _13.treeValue]);u&&(k(u),_optionalChain([s, 'access', _14 => _14[c], 'optionalAccess', _15 => _15.focus, 'call', _16 => _16()]));break}case"ArrowRight":{if(t.preventDefault(),p){let c=N(e,p);if(_optionalChain([c, 'optionalAccess', _17 => _17.children, 'optionalAccess', _18 => _18.length]))if(!D.has(p))T(p);else{let u=c.children[0].value;k(u),requestAnimationFrame(()=>{_optionalChain([O, 'call', _19 => _19(), 'access', _20 => _20.find, 'call', _21 => _21(re=>re.dataset.treeValue===u), 'optionalAccess', _22 => _22.focus, 'call', _23 => _23()])})}}break}case"ArrowLeft":{t.preventDefault(),p&&D.has(p)&&T(p);break}case"Enter":case" ":{if(t.preventDefault(),p){let c=N(e,p);c&&H(c)}break}case"Home":{t.preventDefault();let c=_optionalChain([s, 'access', _24 => _24[0], 'optionalAccess', _25 => _25.dataset, 'access', _26 => _26.treeValue]);c&&(k(c),_optionalChain([s, 'access', _27 => _27[0], 'optionalAccess', _28 => _28.focus, 'call', _29 => _29()]));break}case"End":{t.preventDefault();let c=_optionalChain([s, 'access', _30 => _30[s.length-1], 'optionalAccess', _31 => _31.dataset, 'access', _32 => _32.treeValue]);c&&(k(c),_optionalChain([s, 'access', _33 => _33[s.length-1], 'optionalAccess', _34 => _34.focus, 'call', _35 => _35()]));break}}},[p,e,D,O,T,H]),ee=()=>r?l.length===0?h:l.length===1?_nullishCoalesce(_optionalChain([N, 'call', _36 => _36(e,l[0]), 'optionalAccess', _37 => _37.label]), () => (l[0])):`${l.length} selected`:n?_nullishCoalesce(_optionalChain([N, 'call', _38 => _38(e,n), 'optionalAccess', _39 => _39.label]), () => (n)):h,te=()=>{if(!r||q.length===0)return null;let t=q.map(s=>N(e,s)).filter(Boolean);return _jsxruntime.jsx.call(void 0, "div",{className:"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-wrap gap-1",children:t.map(s=>_jsxruntime.jsxs.call(void 0, "div",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs",children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate max-w-[120px]",children:s.label}),_jsxruntime.jsx.call(void 0, _lucidereact.X,{className:"h-3 w-3 cursor-pointer shrink-0",onClick:d=>Z(s.value,d),"aria-label":`Remove ${s.label}`})]},s.value))})})};return _jsxruntime.jsxs.call(void 0, _chunkULIOO55Ijs.a,{open:m,onOpenChange:Y,children:[_jsxruntime.jsx.call(void 0, _chunkULIOO55Ijs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{type:"button",role:"combobox","aria-expanded":m,"aria-haspopup":"tree",disabled:S,className:_chunkFUYXCJOQjs.a.call(void 0, "cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!n&&!l.length&&"text-secondary-text",y&&"border-destructive-foreground focus-visible:ring-destructive-foreground",V),children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:ee()}),_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_jsxruntime.jsxs.call(void 0, _chunkULIOO55Ijs.c,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center border-b px-3",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),_jsxruntime.jsx.call(void 0, "input",{value:v,onChange:t=>K(t.target.value),placeholder:g,className:"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Search tree"})]}),te(),_jsxruntime.jsx.call(void 0, "div",{className:"max-h-[300px] overflow-y-auto",children:F&&F.length>0?_jsxruntime.jsx.call(void 0, "div",{ref:I,role:"tree","aria-label":"Options",className:"p-1",onKeyDown:_,children:F.map(t=>_jsxruntime.jsx.call(void 0, W,{node:t,depth:0,multiple:r,selectedSet:C,expandedValues:D,focusedValue:p,onToggleExpand:T,onSelect:H,onFocus:k,searchTerm:v},t.value))}):_jsxruntime.jsx.call(void 0, "div",{className:"py-6 text-center text-sm text-muted-foreground",children:w})})]})]})}exports.a = ge;
3
+ //# sourceMappingURL=chunk-3FBDNJG5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-3FBDNJG5.js","../src/components/tree-select.tsx"],"names":["getAllDescendantValues","node","values","child","getCheckState","selectedSet","descendants","selectedCount","v","filterTree","nodes","searchTerm","term","result","labelMatches","filteredChildren","getValuesOfMatchingNodes","walk","nodeList","hasMatch","childHasMatch","findNodeByValue","value","found","collectAllBranchValues","renderHighlightedLabel","label","index","jsxs","Fragment","jsx","TreeNodeItem","depth","multiple","expandedValues","focusedValue","onToggleExpand","onSelect","onFocus","hasChildren","isExpanded","checkState","indentPx","cn"],"mappings":"AAAA,+8BAAY;AACZ,sDAAuC,sDAAsD,sDAAwC,uECC9G,2CACqC,+CAgKxD,SA3HKA,CAAAA,CAAuBC,CAAAA,CAAgC,CAC9D,IAAMC,CAAAA,CAAmB,CAACD,CAAAA,CAAK,KAAK,CAAA,CACpC,EAAA,CAAIA,CAAAA,CAAK,QAAA,CACP,GAAA,CAAA,IAAWE,EAAAA,GAASF,CAAAA,CAAK,QAAA,CACvBC,CAAAA,CAAO,IAAA,CAAK,GAAGF,CAAAA,CAAuBG,CAAK,CAAC,CAAA,CAGhD,OAAOD,CACT,CAEA,SAASE,CAAAA,CACPH,CAAAA,CACAI,CAAAA,CACY,CACZ,EAAA,CAAI,CAACJ,CAAAA,CAAK,QAAA,EAAYA,CAAAA,CAAK,QAAA,CAAS,MAAA,GAAW,CAAA,CAC7C,OAAOI,CAAAA,CAAY,GAAA,CAAIJ,CAAAA,CAAK,KAAK,CAAA,CAAI,SAAA,CAAY,WAAA,CAGnD,IAAMK,CAAAA,CAAcN,CAAAA,CAAuBC,CAAI,CAAA,CACzCM,CAAAA,CAAgBD,CAAAA,CAAY,MAAA,CAAQE,CAAAA,EAAMH,CAAAA,CAAY,GAAA,CAAIG,CAAC,CAAC,CAAA,CAAE,MAAA,CAEpE,OAAID,CAAAA,GAAkB,CAAA,CA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,CACtDuC,CAAAA,CAAaN,CAAAA,CAAe,GAAA,CAAIjC,CAAAA,CAAK,KAAK,CAAA,CAC1CwC,CAAAA,CAAaR,CAAAA,CACf7B,CAAAA,CAAcH,CAAAA,CAAMI,CAAW,CAAA,CAC/BA,CAAAA,CAAY,GAAA,CAAIJ,CAAAA,CAAK,KAAK,CAAA,CACxB,SAAA,CACA,WAAA,CAEAyC,CAAAA,CAAWV,CAAAA,CAAQ,EAAA,CAEzB,OACEJ,8BAAAA,KAAC,CAAA,CACC,IAAA,CAAK,UAAA,CACL,eAAA,CAAeW,CAAAA,CAAcC,CAAAA,CAAa,KAAA,CAAA,CAC1C,eAAA,CAAeC,CAAAA,GAAe,SAAA,CAE9B,QAAA,CAAA,CAAAb,8BAAAA,KAAC,CAAA,CACC,SAAA,CAAWe,gCAAAA,gHACT,CACA,gBAAA,CACAF,CAAAA,GAAe,SAAA,EAAa,CAACR,CAAAA,EAAY,UAG3C,CAAA,CACA,KAAA,CAAO,CAAE,WAAA,CAAa,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-3FBDNJG5.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Check, ChevronDown, ChevronRight, Search, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Checkbox } from \"@/components/checkbox\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\n// --- Public types ---\n\nexport interface TreeSelectNode {\n value: string\n label: string\n children?: TreeSelectNode[]\n}\n\nexport interface TreeSelectProps {\n nodes: TreeSelectNode[]\n value?: string\n onValueChange?: (value: string) => void\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n defaultExpandedValues?: string[]\n expandAll?: boolean\n}\n\n// --- Internal types ---\n\ntype CheckState = \"checked\" | \"indeterminate\" | \"unchecked\"\n\n// --- Utility functions ---\n\nfunction getAllDescendantValues(node: TreeSelectNode): string[] {\n const values: string[] = [node.value]\n if (node.children) {\n for (const child of node.children) {\n values.push(...getAllDescendantValues(child))\n }\n }\n return values\n}\n\nfunction getCheckState(\n node: TreeSelectNode,\n selectedSet: Set<string>\n): CheckState {\n if (!node.children || node.children.length === 0) {\n return selectedSet.has(node.value) ? \"checked\" : \"unchecked\"\n }\n\n const descendants = getAllDescendantValues(node)\n const selectedCount = descendants.filter((v) => selectedSet.has(v)).length\n\n if (selectedCount === 0) return \"unchecked\"\n if (selectedCount === descendants.length) return \"checked\"\n return \"indeterminate\"\n}\n\nfunction filterTree(\n nodes: TreeSelectNode[],\n searchTerm: string\n): TreeSelectNode[] | null {\n const term = searchTerm.toLowerCase().trim()\n if (!term) return nodes\n\n const result: TreeSelectNode[] = []\n\n for (const node of nodes) {\n const labelMatches = node.label.toLowerCase().includes(term)\n\n if (node.children && node.children.length > 0) {\n const filteredChildren = filterTree(node.children, searchTerm)\n\n if (labelMatches) {\n result.push(node)\n } else if (filteredChildren && filteredChildren.length > 0) {\n result.push({ ...node, children: filteredChildren })\n }\n } else if (labelMatches) {\n result.push(node)\n }\n }\n\n return result.length > 0 ? result : null\n}\n\nfunction getValuesOfMatchingNodes(\n nodes: TreeSelectNode[],\n searchTerm: string\n): Set<string> {\n const term = searchTerm.toLowerCase().trim()\n const result = new Set<string>()\n\n function walk(nodeList: TreeSelectNode[]): boolean {\n let hasMatch = false\n for (const node of nodeList) {\n const labelMatches = node.label.toLowerCase().includes(term)\n let childHasMatch = false\n\n if (node.children) {\n childHasMatch = walk(node.children)\n }\n\n if (labelMatches || childHasMatch) {\n result.add(node.value)\n hasMatch = true\n }\n }\n return hasMatch\n }\n\n walk(nodes)\n return result\n}\n\nfunction findNodeByValue(\n nodes: TreeSelectNode[],\n value: string\n): TreeSelectNode | undefined {\n for (const node of nodes) {\n if (node.value === value) return node\n if (node.children) {\n const found = findNodeByValue(node.children, value)\n if (found) return found\n }\n }\n return undefined\n}\n\nfunction collectAllBranchValues(nodes: TreeSelectNode[]): Set<string> {\n const result = new Set<string>()\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n result.add(node.value)\n for (const v of collectAllBranchValues(node.children)) {\n result.add(v)\n }\n }\n }\n return result\n}\n\nfunction renderHighlightedLabel(\n label: string,\n searchTerm: string\n): React.ReactNode {\n if (!searchTerm) return label\n\n const term = searchTerm.toLowerCase().trim()\n if (!term) return label\n\n const index = label.toLowerCase().indexOf(term)\n if (index === -1) return label\n\n return (\n <>\n {label.slice(0, index)}\n <span className=\"font-semibold underline\">\n {label.slice(index, index + term.length)}\n </span>\n {label.slice(index + term.length)}\n </>\n )\n}\n\n// --- TreeNodeItem (internal) ---\n\ninterface TreeNodeItemProps {\n node: TreeSelectNode\n depth: number\n multiple: boolean\n selectedSet: Set<string>\n expandedValues: Set<string>\n focusedValue: string | null\n onToggleExpand: (value: string) => void\n onSelect: (node: TreeSelectNode) => void\n onFocus: (value: string) => void\n searchTerm: string\n}\n\nfunction TreeNodeItem({\n node,\n depth,\n multiple,\n selectedSet,\n expandedValues,\n focusedValue,\n onToggleExpand,\n onSelect,\n onFocus,\n searchTerm,\n}: TreeNodeItemProps) {\n const hasChildren = node.children && node.children.length > 0\n const isExpanded = expandedValues.has(node.value)\n const checkState = multiple\n ? getCheckState(node, selectedSet)\n : selectedSet.has(node.value)\n ? \"checked\"\n : \"unchecked\"\n\n const indentPx = depth * 20\n\n return (\n <div\n role=\"treeitem\"\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-selected={checkState === \"checked\"}\n >\n <div\n className={cn(\n \"relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none\",\n \"hover:bg-muted\",\n checkState === \"checked\" && !multiple && \"bg-muted\"\n // This adds a focus ring when the node is focused, but it's not needed for the tree-select component.\n // focusedValue === node.value && \"z-10 ring-2 ring-ring\"\n )}\n style={{ paddingLeft: `${8 + indentPx}px` }}\n onClick={() => onSelect(node)}\n onFocus={() => onFocus(node.value)}\n data-tree-value={node.value}\n tabIndex={focusedValue === node.value ? 0 : -1}\n >\n {hasChildren ? (\n <button\n type=\"button\"\n className=\"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary\"\n onClick={(e) => {\n e.stopPropagation()\n onToggleExpand(node.value)\n }}\n aria-label={\n isExpanded ? `Collapse ${node.label}` : `Expand ${node.label}`\n }\n tabIndex={-1}\n >\n {isExpanded ? (\n <ChevronDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronRight className=\"h-3.5 w-3.5\" />\n )}\n </button>\n ) : (\n <span className=\"h-4 w-4 shrink-0\" />\n )}\n\n {multiple ? (\n <Checkbox\n checked={\n checkState === \"checked\"\n ? true\n : checkState === \"indeterminate\"\n ? \"indeterminate\"\n : false\n }\n onCheckedChange={() => onSelect(node)}\n onClick={(e) => e.stopPropagation()}\n className=\"shrink-0\"\n aria-label={node.label}\n />\n ) : (\n <Check\n className={cn(\n \"h-4 w-4 shrink-0\",\n checkState === \"checked\" ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n )}\n\n <span className=\"truncate\">\n {renderHighlightedLabel(node.label, searchTerm)}\n </span>\n </div>\n\n {hasChildren && isExpanded && (\n <div role=\"group\">\n {node.children!.map((child) => (\n <TreeNodeItem\n key={child.value}\n node={child}\n depth={depth + 1}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={onToggleExpand}\n onSelect={onSelect}\n onFocus={onFocus}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\n\n// --- TreeSelect (main component) ---\n\nexport function TreeSelect({\n nodes,\n value,\n onValueChange,\n multiple = false,\n values = [],\n onValuesChange,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No results found.\",\n disabled = false,\n className,\n error = false,\n defaultExpandedValues,\n expandAll = false,\n}: TreeSelectProps) {\n const [open, setOpen] = React.useState(false)\n const [searchTerm, setSearchTerm] = React.useState(\"\")\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null)\n const [expandedValues, setExpandedValues] = React.useState<Set<string>>(\n () => {\n if (expandAll) return collectAllBranchValues(nodes)\n if (defaultExpandedValues) return new Set(defaultExpandedValues)\n return new Set<string>()\n }\n )\n\n const preSearchExpandedRef = React.useRef<Set<string> | null>(null)\n const treeRef = React.useRef<HTMLDivElement>(null)\n\n const selectedSet = React.useMemo(\n () => new Set(multiple ? values : value ? [value] : []),\n [multiple, values, value]\n )\n\n const filteredNodes = React.useMemo(\n () => (searchTerm ? filterTree(nodes, searchTerm) : nodes),\n [nodes, searchTerm]\n )\n\n // Auto-expand matching ancestors during search\n React.useEffect(() => {\n if (searchTerm) {\n if (!preSearchExpandedRef.current) {\n preSearchExpandedRef.current = new Set(expandedValues)\n }\n const matchingAncestors = getValuesOfMatchingNodes(nodes, searchTerm)\n setExpandedValues(matchingAncestors)\n } else if (preSearchExpandedRef.current) {\n setExpandedValues(preSearchExpandedRef.current)\n preSearchExpandedRef.current = null\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [searchTerm, nodes])\n\n const handleOpenChange = React.useCallback((isOpen: boolean) => {\n setOpen(isOpen)\n if (!isOpen) {\n setSearchTerm(\"\")\n setFocusedValue(null)\n }\n }, [])\n\n const handleToggleExpand = React.useCallback((nodeValue: string) => {\n setExpandedValues((prev) => {\n const next = new Set(prev)\n if (next.has(nodeValue)) {\n next.delete(nodeValue)\n } else {\n next.add(nodeValue)\n }\n return next\n })\n }, [])\n\n const handleSelect = React.useCallback(\n (node: TreeSelectNode) => {\n if (multiple) {\n const allDescendants = getAllDescendantValues(node)\n const currentState = getCheckState(node, selectedSet)\n\n let newValues: string[]\n if (currentState === \"checked\") {\n const toRemove = new Set(allDescendants)\n newValues = values.filter((v) => !toRemove.has(v))\n } else {\n const toAdd = allDescendants.filter((v) => !selectedSet.has(v))\n newValues = [...values, ...toAdd]\n }\n onValuesChange?.(newValues)\n } else {\n // Single-select: clicking a parent toggles expand instead of selecting\n const hasChildren = node.children && node.children.length > 0\n if (hasChildren) {\n handleToggleExpand(node.value)\n return\n }\n const newValue = node.value === value ? \"\" : node.value\n onValueChange?.(newValue)\n setOpen(false)\n }\n },\n [\n multiple,\n values,\n value,\n selectedSet,\n onValuesChange,\n onValueChange,\n handleToggleExpand,\n ]\n )\n\n const handleRemoveChip = React.useCallback(\n (chipValue: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const node = findNodeByValue(nodes, chipValue)\n if (node) {\n const toRemove = new Set(getAllDescendantValues(node))\n const newValues = values.filter((v) => !toRemove.has(v))\n onValuesChange?.(newValues)\n }\n },\n [nodes, values, onValuesChange]\n )\n\n // Smart chips: minimal set representing the selection\n const chipValues = React.useMemo(() => {\n if (!multiple) return []\n\n const chips: string[] = []\n\n function walk(nodeList: TreeSelectNode[]) {\n for (const node of nodeList) {\n const state = getCheckState(node, selectedSet)\n if (state === \"checked\") {\n chips.push(node.value)\n } else if (state === \"indeterminate\" && node.children) {\n walk(node.children)\n }\n }\n }\n\n walk(nodes)\n return chips\n }, [nodes, selectedSet, multiple])\n\n // Keyboard navigation\n const getVisibleNodes = React.useCallback((): HTMLElement[] => {\n if (!treeRef.current) return []\n return Array.from(treeRef.current.querySelectorAll(\"[data-tree-value]\"))\n }, [])\n\n const handleTreeKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n const visibleNodes = getVisibleNodes()\n const currentIndex = visibleNodes.findIndex(\n (el) => el.dataset.treeValue === focusedValue\n )\n\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault()\n const nextIndex = Math.min(currentIndex + 1, visibleNodes.length - 1)\n const nextValue = visibleNodes[nextIndex]?.dataset.treeValue\n if (nextValue) {\n setFocusedValue(nextValue)\n visibleNodes[nextIndex]?.focus()\n }\n break\n }\n case \"ArrowUp\": {\n e.preventDefault()\n const prevIndex = Math.max(currentIndex - 1, 0)\n const prevValue = visibleNodes[prevIndex]?.dataset.treeValue\n if (prevValue) {\n setFocusedValue(prevValue)\n visibleNodes[prevIndex]?.focus()\n }\n break\n }\n case \"ArrowRight\": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node?.children?.length) {\n if (!expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n } else {\n const firstChildValue = node.children[0].value\n setFocusedValue(firstChildValue)\n requestAnimationFrame(() => {\n const els = getVisibleNodes()\n const el = els.find(\n (n) => n.dataset.treeValue === firstChildValue\n )\n el?.focus()\n })\n }\n }\n }\n break\n }\n case \"ArrowLeft\": {\n e.preventDefault()\n if (focusedValue && expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n }\n break\n }\n case \"Enter\":\n case \" \": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node) handleSelect(node)\n }\n break\n }\n case \"Home\": {\n e.preventDefault()\n const firstValue = visibleNodes[0]?.dataset.treeValue\n if (firstValue) {\n setFocusedValue(firstValue)\n visibleNodes[0]?.focus()\n }\n break\n }\n case \"End\": {\n e.preventDefault()\n const lastValue =\n visibleNodes[visibleNodes.length - 1]?.dataset.treeValue\n if (lastValue) {\n setFocusedValue(lastValue)\n visibleNodes[visibleNodes.length - 1]?.focus()\n }\n break\n }\n }\n },\n [\n focusedValue,\n nodes,\n expandedValues,\n getVisibleNodes,\n handleToggleExpand,\n handleSelect,\n ]\n )\n\n const getDisplayText = () => {\n if (multiple) {\n if (values.length === 0) return placeholder\n if (values.length === 1) {\n const node = findNodeByValue(nodes, values[0])\n return node?.label ?? values[0]\n }\n return `${values.length} selected`\n }\n if (value) {\n const node = findNodeByValue(nodes, value)\n return node?.label ?? value\n }\n return placeholder\n }\n\n const renderSelectedChips = () => {\n if (!multiple || chipValues.length === 0) return null\n\n const chipNodes = chipValues\n .map((v) => findNodeByValue(nodes, v))\n .filter(Boolean) as TreeSelectNode[]\n\n return (\n <div className=\"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border\">\n <div className=\"flex flex-wrap gap-1\">\n {chipNodes.map((node) => (\n <div\n key={node.value}\n className=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"\n >\n <span className=\"truncate max-w-[120px]\">{node.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer shrink-0\"\n onClick={(e) => handleRemoveChip(node.value, e)}\n aria-label={`Remove ${node.label}`}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !value && !values.length && \"text-secondary-text\",\n error &&\n \"border-destructive-foreground focus-visible:ring-destructive-foreground\",\n className\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <div className=\"flex items-center border-b px-3\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <input\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n placeholder={searchPlaceholder}\n className=\"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Search tree\"\n />\n </div>\n\n {renderSelectedChips()}\n\n <div className=\"max-h-[300px] overflow-y-auto\">\n {filteredNodes && filteredNodes.length > 0 ? (\n <div\n ref={treeRef}\n role=\"tree\"\n aria-label=\"Options\"\n className=\"p-1\"\n onKeyDown={handleTreeKeyDown}\n >\n {filteredNodes.map((node) => (\n <TreeNodeItem\n key={node.value}\n node={node}\n depth={0}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={handleToggleExpand}\n onSelect={handleSelect}\n onFocus={setFocusedValue}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n ) : (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">\n {emptyMessage}\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
- var _chunkRJKKQWP2js = require('./chunk-RJKKQWP2.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var r = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _datefns = require('date-fns');var _reactpopover = require('@radix-ui/react-popover'); var e = _interopRequireWildcard(_reactpopover);var _jsxruntime = require('react/jsx-runtime');var y=e.Root,h=e.Trigger,c=r.forwardRef(({className:o,align:a="start",sideOffset:i=4,...n},s)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.Content,{ref:s,align:a,sideOffset:i,className:_chunkFUYXCJOQjs.a.call(void 0, "z-50 w-auto rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o),...n})}));c.displayName=e.Content.displayName;var R=r.forwardRef(({date:o,onDateChange:a,placeholder:i="Pick a date",disabled:n=!1,className:s,calendarProps:f,formatStr:P="PPP"},v)=>{let[u,p]=r.useState(!1);return _jsxruntime.jsxs.call(void 0, y,{open:u,onOpenChange:p,children:[_jsxruntime.jsx.call(void 0, h,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{ref:v,type:"button",className:_chunkFUYXCJOQjs.a.call(void 0, "flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!o&&"text-secondary-text",s),disabled:n,children:[_jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon,{className:"mr-2 h-4 w-4"}),o?_datefns.format.call(void 0, o,P):_jsxruntime.jsx.call(void 0, "span",{children:i})]})}),_jsxruntime.jsx.call(void 0, c,{className:"w-auto p-0 rounded-3xl",align:"start",children:_jsxruntime.jsx.call(void 0, _chunkRJKKQWP2js.a,{mode:"single",selected:o,onSelect:g=>{_optionalChain([a, 'optionalCall', _ => _(g)]),p(!1)},defaultMonth:o,...f})})]})});R.displayName="DatePicker";exports.a = R;
3
- //# sourceMappingURL=chunk-WIQVLJ4E.js.map
2
+ var _chunkSBL3PCZCjs = require('./chunk-SBL3PCZC.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var r = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _datefns = require('date-fns');var _reactpopover = require('@radix-ui/react-popover'); var e = _interopRequireWildcard(_reactpopover);var _jsxruntime = require('react/jsx-runtime');var y=e.Root,h=e.Trigger,c=r.forwardRef(({className:o,align:a="start",sideOffset:i=4,...n},s)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.Content,{ref:s,align:a,sideOffset:i,className:_chunkFUYXCJOQjs.a.call(void 0, "z-50 w-auto rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o),...n})}));c.displayName=e.Content.displayName;var R=r.forwardRef(({date:o,onDateChange:a,placeholder:i="Pick a date",disabled:n=!1,className:s,calendarProps:f,formatStr:P="PPP"},v)=>{let[u,p]=r.useState(!1);return _jsxruntime.jsxs.call(void 0, y,{open:u,onOpenChange:p,children:[_jsxruntime.jsx.call(void 0, h,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{ref:v,type:"button",className:_chunkFUYXCJOQjs.a.call(void 0, "flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!o&&"text-secondary-text",s),disabled:n,children:[_jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon,{className:"mr-2 h-4 w-4"}),o?_datefns.format.call(void 0, o,P):_jsxruntime.jsx.call(void 0, "span",{children:i})]})}),_jsxruntime.jsx.call(void 0, c,{className:"w-auto p-0 rounded-3xl",align:"start",children:_jsxruntime.jsx.call(void 0, _chunkSBL3PCZCjs.a,{mode:"single",selected:o,onSelect:g=>{_optionalChain([a, 'optionalCall', _ => _(g)]),p(!1)},defaultMonth:o,...f})})]})});R.displayName="DatePicker";exports.a = R;
3
+ //# sourceMappingURL=chunk-5D66A4ZC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-WIQVLJ4E.js","../src/components/date-picker.tsx"],"names":["Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","jsx","cn","DatePicker","date","onDateChange","placeholder","disabled","calendarProps","formatStr","open","setOpen","jsxs","CalendarIcon","format","Calendar","selectedDate"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,uECCxD,2CACM,mCACN,uGACW,+CAa9B,IAREA,CAAAA,CAA2B,CAAA,CAAA,IAAA,CAC3BC,CAAAA,CAAkC,CAAA,CAAA,OAAA,CAElCC,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAS,UAAA,CAAAC,CAAAA,CAAa,CAAA,CAAG,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC3DC,6BAAAA,CAAkB,CAAA,MAAA,CAAjB,CACC,QAAA,CAAAA,6BAAAA,CAAkB,CAAA,OAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,KAAA,CAAOH,CAAAA,CACP,UAAA,CAAYC,CAAAA,CACZ,SAAA,CAAWI,gCAAAA,8aACT,CACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAAA,CACF,CACD,CAAA,CACDJ,CAAAA,CAAe,WAAA,CAA+B,CAAA,CAAA,OAAA,CAAQ,WAAA,CAetD,IAAMQ,CAAAA,CAAmB,CAAA,CAAA,UAAA,CACvB,CACE,CACE,IAAA,CAAAC,CAAAA,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GAAGI,CAAAA,CACN,CAAA,CACF,CAAA,CAAA,CACF,CAEJ,CACF,CAAA,CAEAL,CAAAA,CAAW,WAAA,CAAc,YAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-WIQVLJ4E.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { CalendarIcon } from \"lucide-react\"\nimport { format } from \"date-fns\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Calendar } from \"@/components/calendar\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-auto rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport interface DatePickerProps {\n date?: Date\n onDateChange?: (date: Date | undefined) => void\n placeholder?: string\n disabled?: boolean\n className?: string\n calendarProps?: Omit<\n React.ComponentProps<typeof Calendar>,\n \"mode\" | \"selected\" | \"onSelect\"\n >\n formatStr?: string\n}\n\nconst DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n {\n date,\n onDateChange,\n placeholder = \"Pick a date\",\n disabled = false,\n className,\n calendarProps,\n formatStr = \"PPP\",\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false)\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !date && \"text-secondary-text\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {date ? format(date, formatStr) : <span>{placeholder}</span>}\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 rounded-3xl\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={(selectedDate) => {\n onDateChange?.(selectedDate)\n setOpen(false)\n }}\n defaultMonth={date}\n {...calendarProps}\n />\n </PopoverContent>\n </Popover>\n )\n }\n)\n\nDatePicker.displayName = \"DatePicker\"\n\nexport { DatePicker }\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-5D66A4ZC.js","../src/components/date-picker.tsx"],"names":["Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","jsx","cn","DatePicker","date","onDateChange","placeholder","disabled","calendarProps","formatStr","open","setOpen","jsxs","CalendarIcon","format","Calendar","selectedDate"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,uECCxD,2CACM,mCACN,uGACW,+CAa9B,IAREA,CAAAA,CAA2B,CAAA,CAAA,IAAA,CAC3BC,CAAAA,CAAkC,CAAA,CAAA,OAAA,CAElCC,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAS,UAAA,CAAAC,CAAAA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CAAA,CACtCT,CAAAA,CAAOU,6BAAAA,CAAOV,CAAMK,CAAS,CAAA,CAAIR,6BAAAA,MAAC,CAAA,CAAM,QAAA,CAAAK,CAAAA,CAAY,CAAA,CAAA,CACvD,CAAA,CACF,CAAA,CACAL,6BAAAA,CAACN,CAAA,CAAe,SAAA,CAAU,wBAAA,CAAyB,KAAA,CAAM,OAAA,CACvD,QAAA,CAAAM,6BAAAA,kBAACc,CAAA,CACC,IAAA,CAAK,QAAA,CACL,QAAA,CAAUX,CAAAA,CACV,QAAA,CAAWY,CAAAA,EAAiB,iBAC1BX,CAAAA,wBAAAA,CAAeW,CAAY,GAAA,CAC3BL,CAAAA,CAAQ,CAAA,CAAK,CACf,CAAA,CACA,YAAA,CAAcP,CAAAA,CACb,GAAGI,CAAAA,CACN,CAAA,CACF,CAAA,CAAA,CACF,CAEJ,CACF,CAAA,CAEAL,CAAAA,CAAW,WAAA,CAAc,YAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-5D66A4ZC.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { CalendarIcon } from \"lucide-react\"\nimport { format } from \"date-fns\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Calendar } from \"@/components/calendar\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-auto rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport interface DatePickerProps {\n date?: Date\n onDateChange?: (date: Date | undefined) => void\n placeholder?: string\n disabled?: boolean\n className?: string\n calendarProps?: Omit<\n React.ComponentProps<typeof Calendar>,\n \"mode\" | \"selected\" | \"onSelect\"\n >\n formatStr?: string\n}\n\nconst DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n {\n date,\n onDateChange,\n placeholder = \"Pick a date\",\n disabled = false,\n className,\n calendarProps,\n formatStr = \"PPP\",\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false)\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !date && \"text-secondary-text\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {date ? format(date, formatStr) : <span>{placeholder}</span>}\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 rounded-3xl\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={(selectedDate) => {\n onDateChange?.(selectedDate)\n setOpen(false)\n }}\n defaultMonth={date}\n {...calendarProps}\n />\n </PopoverContent>\n </Popover>\n )\n }\n)\n\nDatePicker.displayName = \"DatePicker\"\n\nexport { DatePicker }\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var r = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');var f=r.createContext({}),b={default:"rounded-3xl",sm:"rounded-2xl"},m="[&_tr:not([data-has-action-column])>th:first-child]:sticky [&_tr:not([data-has-action-column])>th:first-child]:left-0 [&_tr:not([data-has-action-column])>th:first-child]:z-10 [&_tr:not([data-has-action-column])>th:first-child]:bg-background [&_tr:not([data-has-action-column])>th:first-child]:after:absolute [&_tr:not([data-has-action-column])>th:first-child]:after:right-0 [&_tr:not([data-has-action-column])>th:first-child]:after:top-0 [&_tr:not([data-has-action-column])>th:first-child]:after:h-full [&_tr:not([data-has-action-column])>th:first-child]:after:w-px [&_tr:not([data-has-action-column])>th:first-child]:after:bg-border [&_tr:not([data-has-action-column])>td:first-child]:sticky [&_tr:not([data-has-action-column])>td:first-child]:left-0 [&_tr:not([data-has-action-column])>td:first-child]:z-10 [&_tr:not([data-has-action-column])>td:first-child]:bg-background [&_tr:not([data-has-action-column])>td:first-child]:after:absolute [&_tr:not([data-has-action-column])>td:first-child]:after:right-0 [&_tr:not([data-has-action-column])>td:first-child]:after:top-0 [&_tr:not([data-has-action-column])>td:first-child]:after:h-full [&_tr:not([data-has-action-column])>td:first-child]:after:w-px [&_tr:not([data-has-action-column])>td:first-child]:after:bg-border [&_tbody_tr:not([data-has-action-column]):hover>td:first-child]:bg-muted",p="[&_tr[data-has-action-column]>*:first-child]:sticky [&_tr[data-has-action-column]>*:first-child]:left-0 [&_tr[data-has-action-column]>*:first-child]:z-10 [&_tr[data-has-action-column]>*:first-child]:bg-background [&_tr[data-has-action-column]>*:first-child]:transition-colors [&_tr[data-has-action-column]>*:nth-child(2)]:sticky [&_tr[data-has-action-column]>*:nth-child(2)]:left-12 [&_tr[data-has-action-column]>*:nth-child(2)]:z-10 [&_tr[data-has-action-column]>*:nth-child(2)]:bg-background [&_tr[data-has-action-column]>*:nth-child(2)]:transition-colors [&_tr[data-has-action-column]>*:nth-child(2)]:after:absolute [&_tr[data-has-action-column]>*:nth-child(2)]:after:right-0 [&_tr[data-has-action-column]>*:nth-child(2)]:after:top-0 [&_tr[data-has-action-column]>*:nth-child(2)]:after:h-full [&_tr[data-has-action-column]>*:nth-child(2)]:after:w-px [&_tr[data-has-action-column]>*:nth-child(2)]:after:bg-border [&_tbody_tr[data-has-action-column]:hover>td:first-child]:bg-muted [&_tbody_tr[data-has-action-column]:hover>td:nth-child(2)]:bg-muted";function y({className:a,stickyFirstColumn:t,rounded:o="default",...l}){return _jsxruntime.jsx.call(void 0, f.Provider,{value:{stickyFirstColumn:t},children:_jsxruntime.jsx.call(void 0, "div",{"data-slot":"table-container",className:_chunkFUYXCJOQjs.a.call(void 0, "relative bg-background w-full overflow-x-auto border border-border",b[o],t&&m,t&&p),children:_jsxruntime.jsx.call(void 0, "table",{"data-slot":"table",className:_chunkFUYXCJOQjs.a.call(void 0, "w-full caption-bottom text-sm",a),...l})})})}function k({className:a,...t}){return _jsxruntime.jsx.call(void 0, "thead",{"data-slot":"table-header",className:_chunkFUYXCJOQjs.a.call(void 0, "[&_tr]:border-b text-secondary-text",a),...t})}function v({className:a,...t}){return _jsxruntime.jsx.call(void 0, "tbody",{"data-slot":"table-body",className:_chunkFUYXCJOQjs.a.call(void 0, "[&_tr:last-child]:border-0",a),...t})}function R({className:a,...t}){return _jsxruntime.jsx.call(void 0, "tfoot",{"data-slot":"table-footer",className:_chunkFUYXCJOQjs.a.call(void 0, "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",a),...t})}function T({className:a,isClickable:t,actionIcon:o,children:l,...i}){let s=o==="eye"?_jsxruntime.jsx.call(void 0, _lucidereact.Eye,{className:"h-4 w-4"}):o==="more"?_jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical,{className:"h-4 w-4"}):null;return _jsxruntime.jsxs.call(void 0, "tr",{"data-slot":"table-row","data-has-action-column":o!==void 0?"":void 0,className:_chunkFUYXCJOQjs.a.call(void 0, "border-b border-border/50 transition-colors",t&&"cursor-pointer hover:bg-muted/50",a),...i,children:[o!==void 0&&_jsxruntime.jsx.call(void 0, _,{className:"w-12",children:s}),l]})}function P({className:a,isSticky:t,...o}){return _jsxruntime.jsx.call(void 0, "th",{"data-slot":"table-head",className:_chunkFUYXCJOQjs.a.call(void 0, "text-secondary-text h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",t&&"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border",a),...o})}function _({className:a,isSticky:t,...o}){return _jsxruntime.jsx.call(void 0, "td",{"data-slot":"table-cell",className:_chunkFUYXCJOQjs.a.call(void 0, "p-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",t&&"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border",a),...o})}function w({className:a,onClick:t,children:o,asChild:l=!1,...i}){let s=c=>{c.stopPropagation(),_optionalChain([t, 'optionalCall', _2 => _2(c)])};return l&&r.isValidElement(o)?r.cloneElement(o,{onClick:c=>{c.stopPropagation();let d=o.props.onClick;_optionalChain([d, 'optionalCall', _3 => _3(c)])},className:_chunkFUYXCJOQjs.a.call(void 0, "inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:bg-muted/50 hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent",o.props.className,a)}):_jsxruntime.jsx.call(void 0, "button",{type:"button","data-slot":"table-cell-action",className:_chunkFUYXCJOQjs.a.call(void 0, "inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent",a),onClick:s,...i,children:o})}function N({className:a,...t}){return _jsxruntime.jsx.call(void 0, "caption",{"data-slot":"table-caption",className:_chunkFUYXCJOQjs.a.call(void 0, "text-muted-foreground mt-4 text-sm",a),...t})}exports.a = y; exports.b = k; exports.c = v; exports.d = R; exports.e = T; exports.f = P; exports.g = _; exports.h = w; exports.i = N;
3
+ //# sourceMappingURL=chunk-5X26XR44.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-5X26XR44.js","../src/components/table.tsx"],"names":["TableContext","roundedMap","stickyFirstColumnStyles","stickyActionColumnStyles","Table","className","stickyFirstColumn","rounded","props","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","isClickable","actionIcon","children","iconComponent","Eye","MoreVertical","jsxs","TableCell","TableHead","isSticky","TableCellAction","onClick","asChild","handleClick","e","childOnClick","TableCaption"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,uECChB,2CACW,+CAwC1B,IAhCFA,CAAAA,CAAqB,CAAA,CAAA,aAAA,CAAiC,CAAC,CAAC,CAAA,CAOxDC,CAAAA,CAAa,CACjB,OAAA,CAAS,aAAA,CACT,EAAA,CAAI,aACN,CAAA,CAGMC,CAAAA,CACJ,8zCAAA,CAGIC,CAAAA,CACJ,2hCAAA,CAEF,SAASC,CAAAA,CAAM,CAAE,SAAA,CAAAC,CAAAA,CAAW,iBAAA,CAAAC,CAAAA,CAAmB,OAAA,CAAAC,CAAAA,CAAU,SAAA,CAAW,GAAGC,CAAM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Content":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Eye, MoreVertical } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TableContextValue {\n stickyFirstColumn?: boolean\n}\n\nconst TableContext = React.createContext<TableContextValue>({})\n\nexport interface TableProps extends React.ComponentProps<\"table\"> {\n stickyFirstColumn?: boolean\n rounded?: \"default\" | \"sm\"\n}\n\nconst roundedMap = {\n default: \"rounded-3xl\",\n sm: \"rounded-2xl\",\n} as const\n\n// Sticky first column (rows without action icon)\nconst stickyFirstColumnStyles =\n \"[&_tr:not([data-has-action-column])>th:first-child]:sticky [&_tr:not([data-has-action-column])>th:first-child]:left-0 [&_tr:not([data-has-action-column])>th:first-child]:z-10 [&_tr:not([data-has-action-column])>th:first-child]:bg-background [&_tr:not([data-has-action-column])>th:first-child]:after:absolute [&_tr:not([data-has-action-column])>th:first-child]:after:right-0 [&_tr:not([data-has-action-column])>th:first-child]:after:top-0 [&_tr:not([data-has-action-column])>th:first-child]:after:h-full [&_tr:not([data-has-action-column])>th:first-child]:after:w-px [&_tr:not([data-has-action-column])>th:first-child]:after:bg-border [&_tr:not([data-has-action-column])>td:first-child]:sticky [&_tr:not([data-has-action-column])>td:first-child]:left-0 [&_tr:not([data-has-action-column])>td:first-child]:z-10 [&_tr:not([data-has-action-column])>td:first-child]:bg-background [&_tr:not([data-has-action-column])>td:first-child]:after:absolute [&_tr:not([data-has-action-column])>td:first-child]:after:right-0 [&_tr:not([data-has-action-column])>td:first-child]:after:top-0 [&_tr:not([data-has-action-column])>td:first-child]:after:h-full [&_tr:not([data-has-action-column])>td:first-child]:after:w-px [&_tr:not([data-has-action-column])>td:first-child]:after:bg-border [&_tbody_tr:not([data-has-action-column]):hover>td:first-child]:bg-muted\"\n\n// Sticky first two columns (rows with action icon): icon at left-0, data column at left-12\nconst stickyActionColumnStyles =\n \"[&_tr[data-has-action-column]>*:first-child]:sticky [&_tr[data-has-action-column]>*:first-child]:left-0 [&_tr[data-has-action-column]>*:first-child]:z-10 [&_tr[data-has-action-column]>*:first-child]:bg-background [&_tr[data-has-action-column]>*:first-child]:transition-colors [&_tr[data-has-action-column]>*:nth-child(2)]:sticky [&_tr[data-has-action-column]>*:nth-child(2)]:left-12 [&_tr[data-has-action-column]>*:nth-child(2)]:z-10 [&_tr[data-has-action-column]>*:nth-child(2)]:bg-background [&_tr[data-has-action-column]>*:nth-child(2)]:transition-colors [&_tr[data-has-action-column]>*:nth-child(2)]:after:absolute [&_tr[data-has-action-column]>*:nth-child(2)]:after:right-0 [&_tr[data-has-action-column]>*:nth-child(2)]:after:top-0 [&_tr[data-has-action-column]>*:nth-child(2)]:after:h-full [&_tr[data-has-action-column]>*:nth-child(2)]:after:w-px [&_tr[data-has-action-column]>*:nth-child(2)]:after:bg-border [&_tbody_tr[data-has-action-column]:hover>td:first-child]:bg-muted [&_tbody_tr[data-has-action-column]:hover>td:nth-child(2)]:bg-muted\"\n\nfunction Table({ className, stickyFirstColumn, rounded = \"default\", ...props }: TableProps) {\n return (\n <TableContext.Provider value={{ stickyFirstColumn }}>\n <div\n data-slot=\"table-container\"\n className={cn(\n \"relative bg-background w-full overflow-x-auto border border-border\",\n roundedMap[rounded],\n stickyFirstColumn && stickyFirstColumnStyles,\n stickyFirstColumn && stickyActionColumnStyles\n )}\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n </TableContext.Provider>\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b text-secondary-text\", className)}\n {...props}\n />\n )\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableRowProps extends React.ComponentProps<\"tr\"> {\n isClickable?: boolean\n actionIcon?: \"eye\" | \"more\" | null\n}\n\nfunction TableRow({\n className,\n isClickable,\n actionIcon,\n children,\n ...props\n}: TableRowProps) {\n const iconComponent =\n actionIcon === \"eye\" ? (\n <Eye className=\"h-4 w-4\" />\n ) : actionIcon === \"more\" ? (\n <MoreVertical className=\"h-4 w-4\" />\n ) : null\n\n return (\n <tr\n data-slot=\"table-row\"\n data-has-action-column={actionIcon !== undefined ? \"\" : undefined}\n className={cn(\n \"border-b border-border/50 transition-colors\",\n isClickable && \"cursor-pointer hover:bg-muted/50\",\n className\n )}\n {...props}\n >\n {actionIcon !== undefined && (\n <TableCell className=\"w-12\">{iconComponent}</TableCell>\n )}\n {children}\n </tr>\n )\n}\n\nexport interface TableHeadProps extends React.ComponentProps<\"th\"> {\n isSticky?: boolean\n}\n\nfunction TableHead({ className, isSticky, ...props }: TableHeadProps) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-secondary-text h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\n isSticky &&\n \"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableCellProps extends React.ComponentProps<\"td\"> {\n isSticky?: boolean\n}\n\nfunction TableCell({ className, isSticky, ...props }: TableCellProps) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\n isSticky &&\n \"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableCellActionProps extends React.ComponentProps<\"button\"> {\n asChild?: boolean\n}\n\nfunction TableCellAction({\n className,\n onClick,\n children,\n asChild = false,\n ...props\n}: TableCellActionProps) {\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onClick?.(e)\n }\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void\n className?: string\n }>,\n {\n onClick: (e: React.MouseEvent) => {\n e.stopPropagation()\n const childOnClick = (\n children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void\n }>\n ).props.onClick\n childOnClick?.(e)\n },\n className: cn(\n \"inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:bg-muted/50 hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent\",\n (children as React.ReactElement<{ className?: string }>).props\n .className,\n className\n ),\n }\n )\n }\n\n return (\n <button\n type=\"button\"\n data-slot=\"table-cell-action\"\n className={cn(\n \"inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent\",\n className\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n )\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCellAction,\n TableCaption,\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
- var _chunkRJKKQWP2js = require('./chunk-RJKKQWP2.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var r = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _datefns = require('date-fns');var _reactpopover = require('@radix-ui/react-popover'); var o = _interopRequireWildcard(_reactpopover);var _jsxruntime = require('react/jsx-runtime');var C=o.Root,x=o.Trigger,c=r.forwardRef(({className:e,align:a="start",sideOffset:n=4,...i},s)=>_jsxruntime.jsx.call(void 0, o.Portal,{children:_jsxruntime.jsx.call(void 0, o.Content,{ref:s,align:a,sideOffset:n,className:_chunkFUYXCJOQjs.a.call(void 0, "z-50 w-auto rounded-3xl border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));c.displayName=o.Content.displayName;var k=r.forwardRef(({dateRange:e,onDateRangeChange:a,placeholder:n="Pick a date range",disabled:i=!1,className:s,calendarProps:P,formatStr:d="LLL dd, y",numberOfMonths:u=2},v)=>{let[g,b]=r.useState(!1),y=()=>_optionalChain([e, 'optionalAccess', _ => _.from])?e.to?`${_datefns.format.call(void 0, e.from,d)} - ${_datefns.format.call(void 0, e.to,d)}`:_datefns.format.call(void 0, e.from,d):n;return _jsxruntime.jsxs.call(void 0, C,{open:g,onOpenChange:b,modal:!0,children:[_jsxruntime.jsx.call(void 0, x,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{ref:v,type:"button",className:_chunkFUYXCJOQjs.a.call(void 0, "flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!_optionalChain([e, 'optionalAccess', _2 => _2.from])&&"text-secondary-text",s),disabled:i,children:[_jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon,{className:"mr-2 h-4 w-4 shrink-0"}),_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:y()})]})}),_jsxruntime.jsx.call(void 0, c,{className:"w-auto p-0",align:"start",children:_jsxruntime.jsx.call(void 0, _chunkRJKKQWP2js.a,{mode:"range",selected:e,onSelect:h=>{_optionalChain([a, 'optionalCall', _3 => _3(h)])},defaultMonth:_optionalChain([e, 'optionalAccess', _4 => _4.from]),numberOfMonths:u,...P})})]})});k.displayName="DateRangePicker";exports.a = k;
3
- //# sourceMappingURL=chunk-MO2LRV57.js.map
2
+ var _chunkSBL3PCZCjs = require('./chunk-SBL3PCZC.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var r = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _datefns = require('date-fns');var _reactpopover = require('@radix-ui/react-popover'); var o = _interopRequireWildcard(_reactpopover);var _jsxruntime = require('react/jsx-runtime');var C=o.Root,x=o.Trigger,c=r.forwardRef(({className:e,align:a="start",sideOffset:n=4,...i},s)=>_jsxruntime.jsx.call(void 0, o.Portal,{children:_jsxruntime.jsx.call(void 0, o.Content,{ref:s,align:a,sideOffset:n,className:_chunkFUYXCJOQjs.a.call(void 0, "z-50 w-auto rounded-3xl border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));c.displayName=o.Content.displayName;var k=r.forwardRef(({dateRange:e,onDateRangeChange:a,placeholder:n="Pick a date range",disabled:i=!1,className:s,calendarProps:P,formatStr:d="LLL dd, y",numberOfMonths:u=2},v)=>{let[g,b]=r.useState(!1),y=()=>_optionalChain([e, 'optionalAccess', _ => _.from])?e.to?`${_datefns.format.call(void 0, e.from,d)} - ${_datefns.format.call(void 0, e.to,d)}`:_datefns.format.call(void 0, e.from,d):n;return _jsxruntime.jsxs.call(void 0, C,{open:g,onOpenChange:b,modal:!0,children:[_jsxruntime.jsx.call(void 0, x,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{ref:v,type:"button",className:_chunkFUYXCJOQjs.a.call(void 0, "flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!_optionalChain([e, 'optionalAccess', _2 => _2.from])&&"text-secondary-text",s),disabled:i,children:[_jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon,{className:"mr-2 h-4 w-4 shrink-0"}),_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:y()})]})}),_jsxruntime.jsx.call(void 0, c,{className:"w-auto p-0",align:"start",children:_jsxruntime.jsx.call(void 0, _chunkSBL3PCZCjs.a,{mode:"range",selected:e,onSelect:h=>{_optionalChain([a, 'optionalCall', _3 => _3(h)])},defaultMonth:_optionalChain([e, 'optionalAccess', _4 => _4.from]),numberOfMonths:u,...P})})]})});k.displayName="DateRangePicker";exports.a = k;
3
+ //# sourceMappingURL=chunk-65YNHKNP.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-MO2LRV57.js","../src/components/date-range-picker.tsx"],"names":["Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","jsx","cn","DateRangePicker","dateRange","onDateRangeChange","placeholder","disabled","calendarProps","formatStr","numberOfMonths","open","setOpen","formatDisplayValue"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,uECCxD,2CACM,mCACN,uGACW,+CAc9B,IAREA,CAAAA,CAA2B,CAAA,CAAA,IAAA,CAC3BC,CAAAA,CAAkC,CAAA,CAAA,OAAA,CAElCC,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAS,UAAA,CAAAC,CAAAA,CAAa,CAAA,CAAG,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC3DC,6BAAAA,CAAkB,CAAA,MAAA,CAAjB,CACC,QAAA,CAAAA,6BAAAA,CAAkB,CAAA,OAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,KAAA,CAAOH,CAAAA,CACP,UAAA,CAAYC,CAAAA,CACZ,SAAA,CAAWI,gCAAAA,6bACT,CACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAAA,CACF,CACD,CAAA,CACDJ,CAAAA,CAAe,WAAA,CAA+B,CAAA,CAAA,OAAA,CAAQ,WAAA,CAgBtD,IAAMQ,CAAAA,CAAwB,CAAA,CAAA,UAAA,CAI5B,CACE,CACE,SAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,mBAAA,CACd,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,SAAA,CAAAX,CAAAA,CACA,aAAA,CAAAY,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,WAAA,CACZ,cAAA,CAAAC,CAAAA,CAAiB,CACnB,CAAA,CACAV,CAAAA,CAAAA,EACG,CACH,GAAM,CAACW,CAAAA,CAAMC,CAAO,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,CAAA,CAAK,CAAA,CAEtCC,CAAAA,CAAqB,CAAA,CAAA,kBACpBT,CAAAA,2BAAW,MAAA,CAIZA,CAAAA,CAAU,EAAA,CACL,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-MO2LRV57.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { CalendarIcon } from \"lucide-react\"\nimport { format } from \"date-fns\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\nimport type { DateRange } from \"react-day-picker\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Calendar } from \"@/components/calendar\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-auto rounded-3xl border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport interface DateRangePickerProps {\n dateRange?: DateRange\n onDateRangeChange?: (dateRange: DateRange | undefined) => void\n placeholder?: string\n disabled?: boolean\n className?: string\n calendarProps?: Omit<\n React.ComponentProps<typeof Calendar>,\n \"mode\" | \"selected\" | \"onSelect\"\n >\n formatStr?: string\n numberOfMonths?: number\n}\n\nconst DateRangePicker = React.forwardRef<\n HTMLButtonElement,\n DateRangePickerProps\n>(\n (\n {\n dateRange,\n onDateRangeChange,\n placeholder = \"Pick a date range\",\n disabled = false,\n className,\n calendarProps,\n formatStr = \"LLL dd, y\",\n numberOfMonths = 2,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false)\n\n const formatDisplayValue = () => {\n if (!dateRange?.from) {\n return placeholder\n }\n\n if (dateRange.to) {\n return `${format(dateRange.from, formatStr)} - ${format(dateRange.to, formatStr)}`\n }\n\n return format(dateRange.from, formatStr)\n }\n\n return (\n <Popover open={open} onOpenChange={setOpen} modal>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !dateRange?.from && \"text-secondary-text\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4 shrink-0\" />\n <span className=\"truncate\">{formatDisplayValue()}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"range\"\n selected={dateRange}\n onSelect={(range) => {\n onDateRangeChange?.(range)\n }}\n defaultMonth={dateRange?.from}\n numberOfMonths={numberOfMonths}\n {...calendarProps}\n />\n </PopoverContent>\n </Popover>\n )\n }\n)\n\nDateRangePicker.displayName = \"DateRangePicker\"\n\nexport { DateRangePicker }\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-65YNHKNP.js","../src/components/date-range-picker.tsx"],"names":["Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","jsx","cn","DateRangePicker","dateRange","onDateRangeChange","placeholder","disabled","calendarProps","formatStr","numberOfMonths","open","setOpen","formatDisplayValue"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,uECCxD,2CACM,mCACN,uGACW,+CAc9B,IAREA,CAAAA,CAA2B,CAAA,CAAA,IAAA,CAC3BC,CAAAA,CAAkC,CAAA,CAAA,OAAA,CAElCC,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAS,UAAA,CAAAC,CAAAA,CAAa,CAAA,CAAG,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC3DC,6BAAAA,CAAkB,CAAA,MAAA,CAAjB,CACC,QAAA,CAAAA,6BAAAA,CAAkB,CAAA,OAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,KAAA,CAAOH,CAAAA,CACP,UAAA,CAAYC,CAAAA,CACZ,SAAA,CAAWI,gCAAAA,6bACT,CACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAAA,CACF,CACD,CAAA,CACDJ,CAAAA,CAAe,WAAA,CAA+B,CAAA,CAAA,OAAA,CAAQ,WAAA,CAgBtD,IAAMQ,CAAAA,CAAwB,CAAA,CAAA,UAAA,CAI5B,CACE,CACE,SAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,mBAAA,CACd,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,SAAA,CAAAX,CAAAA,CACA,aAAA,CAAAY,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,WAAA,CACZ,cAAA,CAAAC,CAAAA,CAAiB,CACnB,CAAA,CACAV,CAAAA,CAAAA,EACG,CACH,GAAM,CAACW,CAAAA,CAAMC,CAAO,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,CAAA,CAAK,CAAA,CAEtCC,CAAAA,CAAqB,CAAA,CAAA,kBACpBT,CAAAA,2BAAW,MAAA,CAIZA,CAAAA,CAAU,EAAA,CACL,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-65YNHKNP.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { CalendarIcon } from \"lucide-react\"\nimport { format } from \"date-fns\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\nimport type { DateRange } from \"react-day-picker\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Calendar } from \"@/components/calendar\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-auto rounded-3xl border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport interface DateRangePickerProps {\n dateRange?: DateRange\n onDateRangeChange?: (dateRange: DateRange | undefined) => void\n placeholder?: string\n disabled?: boolean\n className?: string\n calendarProps?: Omit<\n React.ComponentProps<typeof Calendar>,\n \"mode\" | \"selected\" | \"onSelect\"\n >\n formatStr?: string\n numberOfMonths?: number\n}\n\nconst DateRangePicker = React.forwardRef<\n HTMLButtonElement,\n DateRangePickerProps\n>(\n (\n {\n dateRange,\n onDateRangeChange,\n placeholder = \"Pick a date range\",\n disabled = false,\n className,\n calendarProps,\n formatStr = \"LLL dd, y\",\n numberOfMonths = 2,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false)\n\n const formatDisplayValue = () => {\n if (!dateRange?.from) {\n return placeholder\n }\n\n if (dateRange.to) {\n return `${format(dateRange.from, formatStr)} - ${format(dateRange.to, formatStr)}`\n }\n\n return format(dateRange.from, formatStr)\n }\n\n return (\n <Popover open={open} onOpenChange={setOpen} modal>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !dateRange?.from && \"text-secondary-text\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4 shrink-0\" />\n <span className=\"truncate\">{formatDisplayValue()}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"range\"\n selected={dateRange}\n onSelect={(range) => {\n onDateRangeChange?.(range)\n }}\n defaultMonth={dateRange?.from}\n numberOfMonths={numberOfMonths}\n {...calendarProps}\n />\n </PopoverContent>\n </Popover>\n )\n }\n)\n\nDateRangePicker.displayName = \"DateRangePicker\"\n\nexport { DateRangePicker }\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as l}from"./chunk-7FX23JBQ.mjs";import{a as m}from"./chunk-S5TKCF6T.mjs";import*as r from"react";import{CalendarIcon as R}from"lucide-react";import{format as p}from"date-fns";import*as o from"@radix-ui/react-popover";import{jsx as t,jsxs as f}from"react/jsx-runtime";var C=o.Root,x=o.Trigger,c=r.forwardRef(({className:e,align:a="start",sideOffset:n=4,...i},s)=>t(o.Portal,{children:t(o.Content,{ref:s,align:a,sideOffset:n,className:m("z-50 w-auto rounded-3xl border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));c.displayName=o.Content.displayName;var k=r.forwardRef(({dateRange:e,onDateRangeChange:a,placeholder:n="Pick a date range",disabled:i=!1,className:s,calendarProps:P,formatStr:d="LLL dd, y",numberOfMonths:u=2},v)=>{let[g,b]=r.useState(!1),y=()=>e?.from?e.to?`${p(e.from,d)} - ${p(e.to,d)}`:p(e.from,d):n;return f(C,{open:g,onOpenChange:b,modal:!0,children:[t(x,{asChild:!0,children:f("button",{ref:v,type:"button",className:m("flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!e?.from&&"text-secondary-text",s),disabled:i,children:[t(R,{className:"mr-2 h-4 w-4 shrink-0"}),t("span",{className:"truncate",children:y()})]})}),t(c,{className:"w-auto p-0",align:"start",children:t(l,{mode:"range",selected:e,onSelect:h=>{a?.(h)},defaultMonth:e?.from,numberOfMonths:u,...P})})]})});k.displayName="DateRangePicker";export{k as a};
3
- //# sourceMappingURL=chunk-XNNZN4OY.mjs.map
2
+ import{a as l}from"./chunk-AL2CF5GT.mjs";import{a as m}from"./chunk-S5TKCF6T.mjs";import*as r from"react";import{CalendarIcon as R}from"lucide-react";import{format as p}from"date-fns";import*as o from"@radix-ui/react-popover";import{jsx as t,jsxs as f}from"react/jsx-runtime";var C=o.Root,x=o.Trigger,c=r.forwardRef(({className:e,align:a="start",sideOffset:n=4,...i},s)=>t(o.Portal,{children:t(o.Content,{ref:s,align:a,sideOffset:n,className:m("z-50 w-auto rounded-3xl border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));c.displayName=o.Content.displayName;var k=r.forwardRef(({dateRange:e,onDateRangeChange:a,placeholder:n="Pick a date range",disabled:i=!1,className:s,calendarProps:P,formatStr:d="LLL dd, y",numberOfMonths:u=2},v)=>{let[g,b]=r.useState(!1),y=()=>e?.from?e.to?`${p(e.from,d)} - ${p(e.to,d)}`:p(e.from,d):n;return f(C,{open:g,onOpenChange:b,modal:!0,children:[t(x,{asChild:!0,children:f("button",{ref:v,type:"button",className:m("flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!e?.from&&"text-secondary-text",s),disabled:i,children:[t(R,{className:"mr-2 h-4 w-4 shrink-0"}),t("span",{className:"truncate",children:y()})]})}),t(c,{className:"w-auto p-0",align:"start",children:t(l,{mode:"range",selected:e,onSelect:h=>{a?.(h)},defaultMonth:e?.from,numberOfMonths:u,...P})})]})});k.displayName="DateRangePicker";export{k as a};
3
+ //# sourceMappingURL=chunk-7APORI4E.mjs.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as l,b as f}from"./chunk-W65OWFZY.mjs";import{a as e}from"./chunk-S5TKCF6T.mjs";import*as i from"react";import{DayPicker as w,getDefaultClassNames as p}from"react-day-picker";import{ChevronLeftIcon as h,ChevronRightIcon as _}from"lucide-react";import{jsx as n}from"react/jsx-runtime";function D({className:c,classNames:m,showOutsideDays:a=!0,captionLayout:d="label",buttonVariant:s="ghost",formatters:u,components:b,...y}){let t=p();return n(w,{showOutsideDays:a,className:e("p-3 text-primary-accent group/calendar rounded-sm",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,c),captionLayout:d,formatters:{formatMonthDropdown:r=>r.toLocaleString("default",{month:"short"}),...u},classNames:{root:e("w-fit",t.root),months:e("flex gap-4 flex-col md:flex-row relative",t.months),month:e("flex flex-col w-full gap-4",t.month),nav:e("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",t.nav),button_previous:e(l({variant:s}),"h-7 w-7 aria-disabled:opacity-50 p-0 select-none",t.button_previous),button_next:e(l({variant:s}),"h-7 w-7 aria-disabled:opacity-50 p-0 select-none",t.button_next),month_caption:e("flex items-center justify-center h-7 w-full",t.month_caption),dropdowns:e("w-full flex items-center text-sm font-medium justify-center h-7 gap-1.5",t.dropdowns),dropdown_root:e("relative cn-calendar-dropdown-root rounded-sm",t.dropdown_root),dropdown:e("absolute bg-popover inset-0 opacity-0",t.dropdown),caption_label:e("select-none font-medium",d==="label"?"text-sm":"cn-calendar-caption-label rounded-sm flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5",t.caption_label),table:"w-full border-collapse",weekdays:e("flex",t.weekdays),weekday:e("text-muted-foreground rounded-sm flex-1 font-normal text-[0.8rem] select-none",t.weekday),week:e("flex w-full mt-2",t.week),week_number_header:e("select-none w-9",t.week_number_header),week_number:e("text-[0.8rem] select-none text-muted-foreground",t.week_number),day:e("relative w-full rounded-sm h-full p-0 text-center group/day aspect-square select-none [&:first-child_button[data-range-start]]:!rounded-l-sm [&:first-child_button[data-range-middle]]:!rounded-l-sm [&:last-child_button[data-range-end]]:!rounded-r-sm [&:last-child_button[data-range-middle]]:!rounded-r-sm z-20 [&:has(button:not([data-range-start]):not([data-range-end]):hover)]:z-10 data-[focused=true]:z-30",t.day),range_start:e("rounded-l-sm bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate",t.range_start),range_middle:e("rounded-none bg-transparent",t.range_middle),range_end:e("rounded-r-sm bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate",t.range_end),today:e("bg-muted text-foreground rounded-sm data-[selected=true]:rounded-none",t.today),outside:e("text-muted-foreground opacity-20 aria-selected:text-muted-foreground aria-selected:opacity-20",t.outside),disabled:e("text-muted-foreground opacity-50",t.disabled),hidden:e("invisible",t.hidden),...m},components:{Root:({className:r,rootRef:o,...g})=>n("div",{"data-slot":"calendar",ref:o,className:e(r),...g}),Chevron:({className:r,orientation:o,...g})=>{let x=o==="left"?h:_;return n("span",{className:e(l({variant:"outline",size:"icon"}),"shrink-0 pointer-events-none"),children:n(x,{className:e("size-4 shrink-0",r),...g})})},DayButton:v,WeekNumber:({children:r,...o})=>n("td",{...o,children:n("div",{className:"flex h-9 w-9 items-center justify-center text-center",children:r})}),...b},...y})}function v({className:c,day:m,modifiers:a,...d}){let s=p(),u=i.useRef(null);return i.useEffect(()=>{a.focused&&u.current?.focus()},[a.focused]),n(f,{ref:u,variant:"ghost",size:"icon","data-day":m.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:e("rounded-sm data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 relative isolate z-10 flex aspect-square size-auto w-full min-w-9 flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-30 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-sm! data-[range-end=true]:rounded-r-sm! data-[range-middle=true]:rounded-none! data-[range-start=true]:rounded-sm! data-[range-start=true]:rounded-l-sm! [&>span]:text-xs [&>span]:opacity-70",s.day,c),...d})}export{D as a,v as b};
3
- //# sourceMappingURL=chunk-7FX23JBQ.mjs.map
2
+ import{a as l,b as f}from"./chunk-HRYHWWL4.mjs";import{a as e}from"./chunk-S5TKCF6T.mjs";import*as i from"react";import{DayPicker as w,getDefaultClassNames as p}from"react-day-picker";import{ChevronLeftIcon as h,ChevronRightIcon as _}from"lucide-react";import{jsx as n}from"react/jsx-runtime";function D({className:c,classNames:m,showOutsideDays:a=!0,captionLayout:d="label",buttonVariant:s="ghost",formatters:u,components:b,...y}){let t=p();return n(w,{showOutsideDays:a,className:e("p-3 text-primary-accent group/calendar rounded-sm",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,c),captionLayout:d,formatters:{formatMonthDropdown:r=>r.toLocaleString("default",{month:"short"}),...u},classNames:{root:e("w-fit",t.root),months:e("flex gap-4 flex-col md:flex-row relative",t.months),month:e("flex flex-col w-full gap-4",t.month),nav:e("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",t.nav),button_previous:e(l({variant:s}),"h-7 w-7 aria-disabled:opacity-50 p-0 select-none",t.button_previous),button_next:e(l({variant:s}),"h-7 w-7 aria-disabled:opacity-50 p-0 select-none",t.button_next),month_caption:e("flex items-center justify-center h-7 w-full",t.month_caption),dropdowns:e("w-full flex items-center text-sm font-medium justify-center h-7 gap-1.5",t.dropdowns),dropdown_root:e("relative cn-calendar-dropdown-root rounded-sm",t.dropdown_root),dropdown:e("absolute bg-popover inset-0 opacity-0",t.dropdown),caption_label:e("select-none font-medium",d==="label"?"text-sm":"cn-calendar-caption-label rounded-sm flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5",t.caption_label),table:"w-full border-collapse",weekdays:e("flex",t.weekdays),weekday:e("text-muted-foreground rounded-sm flex-1 font-normal text-[0.8rem] select-none",t.weekday),week:e("flex w-full mt-2",t.week),week_number_header:e("select-none w-9",t.week_number_header),week_number:e("text-[0.8rem] select-none text-muted-foreground",t.week_number),day:e("relative w-full rounded-sm h-full p-0 text-center group/day aspect-square select-none [&:first-child_button[data-range-start]]:!rounded-l-sm [&:first-child_button[data-range-middle]]:!rounded-l-sm [&:last-child_button[data-range-end]]:!rounded-r-sm [&:last-child_button[data-range-middle]]:!rounded-r-sm z-20 [&:has(button:not([data-range-start]):not([data-range-end]):hover)]:z-10 data-[focused=true]:z-30",t.day),range_start:e("rounded-l-sm bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate",t.range_start),range_middle:e("rounded-none bg-transparent",t.range_middle),range_end:e("rounded-r-sm bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate",t.range_end),today:e("bg-muted text-foreground rounded-sm data-[selected=true]:rounded-none",t.today),outside:e("text-muted-foreground opacity-20 aria-selected:text-muted-foreground aria-selected:opacity-20",t.outside),disabled:e("text-muted-foreground opacity-50",t.disabled),hidden:e("invisible",t.hidden),...m},components:{Root:({className:r,rootRef:o,...g})=>n("div",{"data-slot":"calendar",ref:o,className:e(r),...g}),Chevron:({className:r,orientation:o,...g})=>{let x=o==="left"?h:_;return n("span",{className:e(l({variant:"outline",size:"icon"}),"shrink-0 pointer-events-none"),children:n(x,{className:e("size-4 shrink-0",r),...g})})},DayButton:v,WeekNumber:({children:r,...o})=>n("td",{...o,children:n("div",{className:"flex h-9 w-9 items-center justify-center text-center",children:r})}),...b},...y})}function v({className:c,day:m,modifiers:a,...d}){let s=p(),u=i.useRef(null);return i.useEffect(()=>{a.focused&&u.current?.focus()},[a.focused]),n(f,{ref:u,variant:"ghost",size:"icon","data-day":m.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:e("rounded-sm data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 relative isolate z-10 flex aspect-square size-auto w-full min-w-9 flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-30 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-sm! data-[range-end=true]:rounded-r-sm! data-[range-middle=true]:rounded-none! data-[range-start=true]:rounded-sm! data-[range-start=true]:rounded-l-sm! [&>span]:text-xs [&>span]:opacity-70",s.day,c),...d})}export{D as a,v as b};
3
+ //# sourceMappingURL=chunk-AL2CF5GT.mjs.map
@@ -1,3 +1,3 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
2
- var _chunkRJMIOBXZjs = require('./chunk-RJMIOBXZ.js');var _chunk3BVMHDYAjs = require('./chunk-3BVMHDYA.js');var _chunk7T4BNCXLjs = require('./chunk-7T4BNCXL.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var a = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _vaul = require('vaul');var _jsxruntime = require('react/jsx-runtime');var R="24rem",v=a.createContext(null);function h(){let e=a.useContext(v);if(!e)throw new Error("useDrawer must be used within a Drawer component.");return e}var y=a.forwardRef(({isOpen:e,onClose:o,width:t=R,children:s,...n},c)=>{let u=a.useRef(null),m=_chunk3BVMHDYAjs.a.call(void 0, "lg"),b=a.useMemo(()=>({isOpen:e,onClose:o,width:t}),[e,o,t]);return _jsxruntime.jsxs.call(void 0, v.Provider,{value:b,children:[!m&&_jsxruntime.jsx.call(void 0, _vaul.Drawer.Root,{open:e,onOpenChange:D=>{D||o()},direction:"left",children:_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Portal,{children:[_jsxruntime.jsx.call(void 0, _vaul.Drawer.Overlay,{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm"}),_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Content,{className:"fixed inset-y-0 left-0 z-50 flex h-full w-[85vw] max-w-md flex-col bg-sidebar border-r border-sidebar-border text-primary-accent shadow-lg outline-none","aria-describedby":void 0,children:[_jsxruntime.jsx.call(void 0, _vaul.Drawer.Title,{className:"sr-only",children:"Drawer"}),s]})]})}),m&&_jsxruntime.jsxs.call(void 0, "div",{ref:c,className:"group/drawer peer","data-state":e?"open":"closed",...n,children:[_jsxruntime.jsx.call(void 0, "div",{className:_chunkFUYXCJOQjs.a.call(void 0, "relative bg-sidebar transition-[width] duration-200 ease-linear",e?"":"w-0"),style:{width:e?t:"0"}}),_jsxruntime.jsx.call(void 0, "div",{ref:u,className:_chunkFUYXCJOQjs.a.call(void 0, "fixed right-0 z-40 transition-[right,width,top,height] duration-200 ease-linear flex","top-(--sidebar-top,0px) h-[calc(100svh-var(--sidebar-top,0px))]",e?"right-0":"right-[calc(var(--drawer-width)*-1)]"),style:{"--drawer-width":t,width:t},children:_jsxruntime.jsx.call(void 0, "div",{"data-drawer":"drawer",className:"flex h-full w-full flex-col",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col my-2.5 mr-2.5 rounded-2xl border bg-sidebar border-sidebar-border h-[calc(100%-1.25rem)] shadow",children:s})})})]})]})});y.displayName="Drawer";var C=a.forwardRef(({className:e,showCloseButton:o=!0,children:t,...s},n)=>{let{onClose:c}=h();return _jsxruntime.jsxs.call(void 0, "div",{ref:n,"data-drawer":"header",className:_chunkFUYXCJOQjs.a.call(void 0, "flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border",e),...s,children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex-1",children:t}),o&&_jsxruntime.jsxs.call(void 0, _chunk7T4BNCXLjs.b,{variant:"secondary",size:"icon",onClick:c,className:"h-8 w-8 shrink-0 rounded-full",children:[_jsxruntime.jsx.call(void 0, _lucidereact.X,{size:16}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close drawer"})]})]})});C.displayName="DrawerHeader";var N=a.forwardRef(({className:e,...o},t)=>_jsxruntime.jsx.call(void 0, "h2",{ref:t,className:_chunkFUYXCJOQjs.a.call(void 0, "text-lg font-semibold text-primary-accent",e),...o}));N.displayName="DrawerTitle";var g=a.forwardRef(({className:e,children:o,...t},s)=>_jsxruntime.jsx.call(void 0, _chunkRJMIOBXZjs.a,{className:"flex-1",ref:s,children:_jsxruntime.jsx.call(void 0, "div",{"data-drawer":"body",className:_chunkFUYXCJOQjs.a.call(void 0, "p-4",e),...t,children:o})}));g.displayName="DrawerBody";var P=a.forwardRef(({className:e,...o},t)=>_jsxruntime.jsx.call(void 0, "div",{ref:t,"data-drawer":"footer",className:_chunkFUYXCJOQjs.a.call(void 0, "flex flex-col gap-2 p-4 border-t border-sidebar-border",e),...o}));P.displayName="DrawerFooter";exports.a = h; exports.b = y; exports.c = C; exports.d = N; exports.e = g; exports.f = P;
3
- //# sourceMappingURL=chunk-BWPUNSDD.js.map
2
+ var _chunkRJMIOBXZjs = require('./chunk-RJMIOBXZ.js');var _chunk3BVMHDYAjs = require('./chunk-3BVMHDYA.js');var _chunkOXMHA73Fjs = require('./chunk-OXMHA73F.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var a = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _vaul = require('vaul');var _jsxruntime = require('react/jsx-runtime');var R="24rem",v=a.createContext(null);function h(){let e=a.useContext(v);if(!e)throw new Error("useDrawer must be used within a Drawer component.");return e}var y=a.forwardRef(({isOpen:e,onClose:o,width:t=R,children:s,...n},c)=>{let u=a.useRef(null),m=_chunk3BVMHDYAjs.a.call(void 0, "lg"),b=a.useMemo(()=>({isOpen:e,onClose:o,width:t}),[e,o,t]);return _jsxruntime.jsxs.call(void 0, v.Provider,{value:b,children:[!m&&_jsxruntime.jsx.call(void 0, _vaul.Drawer.Root,{open:e,onOpenChange:D=>{D||o()},direction:"left",children:_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Portal,{children:[_jsxruntime.jsx.call(void 0, _vaul.Drawer.Overlay,{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm"}),_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Content,{className:"fixed inset-y-0 left-0 z-50 flex h-full w-[85vw] max-w-md flex-col bg-sidebar border-r border-sidebar-border text-primary-accent shadow-lg outline-none","aria-describedby":void 0,children:[_jsxruntime.jsx.call(void 0, _vaul.Drawer.Title,{className:"sr-only",children:"Drawer"}),s]})]})}),m&&_jsxruntime.jsxs.call(void 0, "div",{ref:c,className:"group/drawer peer","data-state":e?"open":"closed",...n,children:[_jsxruntime.jsx.call(void 0, "div",{className:_chunkFUYXCJOQjs.a.call(void 0, "relative bg-sidebar transition-[width] duration-200 ease-linear",e?"":"w-0"),style:{width:e?t:"0"}}),_jsxruntime.jsx.call(void 0, "div",{ref:u,className:_chunkFUYXCJOQjs.a.call(void 0, "fixed right-0 z-40 transition-[right,width,top,height] duration-200 ease-linear flex","top-(--sidebar-top,0px) h-[calc(100svh-var(--sidebar-top,0px))]",e?"right-0":"right-[calc(var(--drawer-width)*-1)]"),style:{"--drawer-width":t,width:t},children:_jsxruntime.jsx.call(void 0, "div",{"data-drawer":"drawer",className:"flex h-full w-full flex-col",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col my-2.5 mr-2.5 rounded-2xl border bg-sidebar border-sidebar-border h-[calc(100%-1.25rem)] shadow",children:s})})})]})]})});y.displayName="Drawer";var C=a.forwardRef(({className:e,showCloseButton:o=!0,children:t,...s},n)=>{let{onClose:c}=h();return _jsxruntime.jsxs.call(void 0, "div",{ref:n,"data-drawer":"header",className:_chunkFUYXCJOQjs.a.call(void 0, "flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border",e),...s,children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex-1",children:t}),o&&_jsxruntime.jsxs.call(void 0, _chunkOXMHA73Fjs.b,{variant:"secondary",size:"icon",onClick:c,className:"h-8 w-8 shrink-0 rounded-full",children:[_jsxruntime.jsx.call(void 0, _lucidereact.X,{size:16}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close drawer"})]})]})});C.displayName="DrawerHeader";var N=a.forwardRef(({className:e,...o},t)=>_jsxruntime.jsx.call(void 0, "h2",{ref:t,className:_chunkFUYXCJOQjs.a.call(void 0, "text-lg font-semibold text-primary-accent",e),...o}));N.displayName="DrawerTitle";var g=a.forwardRef(({className:e,children:o,...t},s)=>_jsxruntime.jsx.call(void 0, _chunkRJMIOBXZjs.a,{className:"flex-1",ref:s,children:_jsxruntime.jsx.call(void 0, "div",{"data-drawer":"body",className:_chunkFUYXCJOQjs.a.call(void 0, "p-4",e),...t,children:o})}));g.displayName="DrawerBody";var P=a.forwardRef(({className:e,...o},t)=>_jsxruntime.jsx.call(void 0, "div",{ref:t,"data-drawer":"footer",className:_chunkFUYXCJOQjs.a.call(void 0, "flex flex-col gap-2 p-4 border-t border-sidebar-border",e),...o}));P.displayName="DrawerFooter";exports.a = h; exports.b = y; exports.c = C; exports.d = N; exports.e = g; exports.f = P;
3
+ //# sourceMappingURL=chunk-ANKLITGS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-BWPUNSDD.js","../src/components/drawer.tsx"],"names":["DRAWER_WIDTH","DrawerContext","useDrawer","context","Drawer","isOpen","onClose","width","children","props","ref","drawerRef","isDesktop","useMediaQuery","contextValue","jsxs","jsx","DrawerPrimitive","open","cn","DrawerHeader","className","showCloseButton","Button","X","DrawerTitle","DrawerBody","ScrollArea","DrawerFooter"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,sDAAwC,sDAAwC,sDAAwC,uECCxI,2CACL,4BACwB,+CA2D9B,IApDNA,CAAAA,CAAe,OAAA,CASfC,CAAAA,CAAsB,CAAA,CAAA,aAAA,CAAyC,IAAI,CAAA,CAEzE,SAASC,CAAAA,CAAAA,CAAY,CACnB,IAAMC,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAAWF,CAAa,CAAA,CAC9C,EAAA,CAAI,CAACE,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,mDAAmD,CAAA,CAErE,OAAOA,CACT,CAGA,IAAMC,CAAAA,CAAe,CAAA,CAAA,UAAA,CAOnB,CAAC,CAAE,MAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAAC,CAAAA,CAAS,KAAA,CAAAC,CAAAA,CAAQP,CAAAA,CAAc,QAAA,CAAAQ,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAQ,CACxE,IAAMC,CAAAA,CAAkB,CAAA,CAAA,MAAA,CAAuB,IAAI,CAAA,CAC7CC,CAAAA,CAAYC,gCAAAA,IAAkB,CAAA,CAE9BC,CAAAA,CAAqB,CAAA,CAAA,OAAA,CACzB,CAAA,CAAA,EAAA,CAAO,CACL,MAAA,CAAAT,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CACF,CAAA,CAAA,CACA,CAACF,CAAAA,CAAQC,CAAAA,CAASC,CAAK,CACzB,CAAA,CAEA,OACEQ,8BAAAA,CAACd,CAAc,QAAA,CAAd,CAAuB,KAAA,CAAOa,CAAAA,CAE5B,QAAA,CAAA,CAAA,CAACF,CAAAA,EACAI,6BAAAA,YAACC,CAAgB,IAAA,CAAhB,CACC,IAAA,CAAMZ,CAAAA,CACN,YAAA,CAAea,CAAAA,EAAS,CACjBA,CAAAA,EA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BM,6BAAAA,IAAC,CAAA,CACC,GAAA,CAAKN,CAAAA,CACL,SAAA,CAAWS,gCAAAA,2CAAG,CAA6CE,CAAS,CAAA,CACnE,GAAGZ,CAAAA,CACN,CAEH,CAAA,CACDgB,CAAAA,CAAY,WAAA,CAAc,aAAA,CAG1B,IAAMC,CAAAA,CAAmB,CAAA,CAAA,UAAA,CAGvB,CAAC,CAAE,SAAA,CAAAL,CAAAA,CAAW,QAAA,CAAAb,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAElCM,6BAAAA,kBAACW,CAAA,CAAW,SAAA,CAAU,QAAA,CAAS,GAAA,CAAKjB,CAAAA,CAClC,QAAA,CAAAM,6BAAAA,KAAC,CAAA,CACC,aAAA,CAAY,MAAA,CACZ,SAAA,CAAWG,gCAAAA,KAAG,CAAOE,CAAS,CAAA,CAC7B,GAAGZ,CAAAA,CAEH,QAAA,CAAAD,CAAAA,CACH,CAAA,CACF,CAEH,CAAA,CACDkB,CAAAA,CAAW,WAAA,CAAc,YAAA,CAGzB,IAAME,CAAAA,CAAqB,CAAA,CAAA,UAAA,CAGzB,CAAC,CAAE,SAAA,CAAAP,CAAAA,CAAW,GAAGZ,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAExBM,6BAAAA,KAAC,CAAA,CACC,GAAA,CAAKN,CAAAA,CACL,aAAA,CAAY,QAAA,CACZ,SAAA,CAAWS,gCAAAA,wDACT,CACAE,CACF,CAAA,CACC,GAAGZ,CAAAA,CACN,CAEH,CAAA,CACDmB,CAAAA,CAAa,WAAA,CAAc,cAAA,CAAA,yFAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-BWPUNSDD.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { X } from \"lucide-react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/button\"\nimport { ScrollArea } from \"@/components/scroll-area\"\nimport { useMediaQuery } from \"@/lib/use-media-query\"\n\nconst DRAWER_WIDTH = \"24rem\"\n\n// Drawer Context\ntype DrawerContextProps = {\n isOpen: boolean\n onClose: () => void\n width?: string\n}\n\nconst DrawerContext = React.createContext<DrawerContextProps | null>(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer component.\")\n }\n return context\n}\n\n// Main Unified Drawer Component (Responsive)\nconst Drawer = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n isOpen: boolean\n onClose: () => void\n width?: string\n }\n>(({ isOpen, onClose, width = DRAWER_WIDTH, children, ...props }, ref) => {\n const drawerRef = React.useRef<HTMLDivElement>(null)\n const isDesktop = useMediaQuery(\"lg\")\n\n const contextValue = React.useMemo<DrawerContextProps>(\n () => ({\n isOpen,\n onClose,\n width,\n }),\n [isOpen, onClose, width]\n )\n\n return (\n <DrawerContext.Provider value={contextValue}>\n {/* Mobile Drawer: visible < md breakpoint */}\n {!isDesktop && (\n <DrawerPrimitive.Root\n open={isOpen}\n onOpenChange={(open) => {\n if (!open) onClose()\n }}\n direction=\"left\"\n >\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\" />\n <DrawerPrimitive.Content\n className=\"fixed inset-y-0 left-0 z-50 flex h-full w-[85vw] max-w-md flex-col bg-sidebar border-r border-sidebar-border text-primary-accent shadow-lg outline-none\"\n aria-describedby={undefined}\n >\n <DrawerPrimitive.Title className=\"sr-only\">\n Drawer\n </DrawerPrimitive.Title>\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n </DrawerPrimitive.Root>\n )}\n\n {/* Desktop Drawer: visible >= md breakpoint */}\n {isDesktop && (\n <div\n ref={ref}\n className=\"group/drawer peer\"\n data-state={isOpen ? \"open\" : \"closed\"}\n {...props}\n >\n {/* Spacer to push content */}\n <div\n className={cn(\n \"relative bg-sidebar transition-[width] duration-200 ease-linear\",\n isOpen ? \"\" : \"w-0\"\n )}\n style={\n {\n width: isOpen ? width : \"0\",\n } as React.CSSProperties\n }\n />\n\n {/* Fixed drawer panel */}\n <div\n ref={drawerRef}\n className={cn(\n \"fixed right-0 z-40 transition-[right,width,top,height] duration-200 ease-linear flex\",\n \"top-(--sidebar-top,0px) h-[calc(100svh-var(--sidebar-top,0px))]\",\n isOpen ? \"right-0\" : \"right-[calc(var(--drawer-width)*-1)]\"\n )}\n style={\n {\n \"--drawer-width\": width,\n width: width,\n } as React.CSSProperties\n }\n >\n <div data-drawer=\"drawer\" className=\"flex h-full w-full flex-col\">\n <div className=\"flex flex-col my-2.5 mr-2.5 rounded-2xl border bg-sidebar border-sidebar-border h-[calc(100%-1.25rem)] shadow\">\n {children}\n </div>\n </div>\n </div>\n </div>\n )}\n </DrawerContext.Provider>\n )\n})\nDrawer.displayName = \"Drawer\"\n\n// Drawer Header\nconst DrawerHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean\n }\n>(({ className, showCloseButton = true, children, ...props }, ref) => {\n const { onClose } = useDrawer()\n\n return (\n <div\n ref={ref}\n data-drawer=\"header\"\n className={cn(\n \"flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border\",\n className\n )}\n {...props}\n >\n <div className=\"flex-1\">{children}</div>\n {showCloseButton && (\n <Button\n variant=\"secondary\"\n size=\"icon\"\n onClick={onClose}\n className=\"h-8 w-8 shrink-0 rounded-full\"\n >\n <X size={16} />\n <span className=\"sr-only\">Close drawer</span>\n </Button>\n )}\n </div>\n )\n})\nDrawerHeader.displayName = \"DrawerHeader\"\n\n// Drawer Title\nconst DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<\"h2\">\n>(({ className, ...props }, ref) => {\n return (\n <h2\n ref={ref}\n className={cn(\"text-lg font-semibold text-primary-accent\", className)}\n {...props}\n />\n )\n})\nDrawerTitle.displayName = \"DrawerTitle\"\n\n// Drawer Body/Content\nconst DrawerBody = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, children, ...props }, ref) => {\n return (\n <ScrollArea className=\"flex-1\" ref={ref}>\n <div\n data-drawer=\"body\"\n className={cn(\"p-4\", className)}\n {...props}\n >\n {children}\n </div>\n </ScrollArea>\n )\n})\nDrawerBody.displayName = \"DrawerBody\"\n\n// Drawer Footer\nconst DrawerFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-drawer=\"footer\"\n className={cn(\n \"flex flex-col gap-2 p-4 border-t border-sidebar-border\",\n className\n )}\n {...props}\n />\n )\n})\nDrawerFooter.displayName = \"DrawerFooter\"\n\nexport {\n Drawer,\n DrawerHeader,\n DrawerTitle,\n DrawerBody,\n DrawerFooter,\n useDrawer,\n}\n"]}
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-ANKLITGS.js","../src/components/drawer.tsx"],"names":["DRAWER_WIDTH","DrawerContext","useDrawer","context","Drawer","isOpen","onClose","width","children","props","ref","drawerRef","isDesktop","useMediaQuery","contextValue","jsxs","jsx","DrawerPrimitive","open","cn","DrawerHeader","className","showCloseButton","Button","X","DrawerTitle","DrawerBody","ScrollArea","DrawerFooter"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,sDAAwC,sDAAwC,sDAAwC,uECCxI,2CACL,4BACwB,+CA2D9B,IApDNA,CAAAA,CAAe,OAAA,CASfC,CAAAA,CAAsB,CAAA,CAAA,aAAA,CAAyC,IAAI,CAAA,CAEzE,SAASC,CAAAA,CAAAA,CAAY,CACnB,IAAMC,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAAWF,CAAa,CAAA,CAC9C,EAAA,CAAI,CAACE,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,mDAAmD,CAAA,CAErE,OAAOA,CACT,CAGA,IAAMC,C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C,aAAA,CAAY,MAAA,CACZ,SAAA,CAAWG,gCAAAA,KAAG,CAAOE,CAAS,CAAA,CAC7B,GAAGZ,CAAAA,CAEH,QAAA,CAAAD,CAAAA,CACH,CAAA,CACF,CAEH,CAAA,CACDkB,CAAAA,CAAW,WAAA,CAAc,YAAA,CAGzB,IAAME,CAAAA,CAAqB,CAAA,CAAA,UAAA,CAGzB,CAAC,CAAE,SAAA,CAAAP,CAAAA,CAAW,GAAGZ,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAExBM,6BAAAA,KAAC,CAAA,CACC,GAAA,CAAKN,CAAAA,CACL,aAAA,CAAY,QAAA,CACZ,SAAA,CAAWS,gCAAAA,wDACT,CACAE,CACF,CAAA,CACC,GAAGZ,CAAAA,CACN,CAEH,CAAA,CACDmB,CAAAA,CAAa,WAAA,CAAc,cAAA,CAAA,yFAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-ANKLITGS.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { X } from \"lucide-react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/button\"\nimport { ScrollArea } from \"@/components/scroll-area\"\nimport { useMediaQuery } from \"@/lib/use-media-query\"\n\nconst DRAWER_WIDTH = \"24rem\"\n\n// Drawer Context\ntype DrawerContextProps = {\n isOpen: boolean\n onClose: () => void\n width?: string\n}\n\nconst DrawerContext = React.createContext<DrawerContextProps | null>(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer component.\")\n }\n return context\n}\n\n// Main Unified Drawer Component (Responsive)\nconst Drawer = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n isOpen: boolean\n onClose: () => void\n width?: string\n }\n>(({ isOpen, onClose, width = DRAWER_WIDTH, children, ...props }, ref) => {\n const drawerRef = React.useRef<HTMLDivElement>(null)\n const isDesktop = useMediaQuery(\"lg\")\n\n const contextValue = React.useMemo<DrawerContextProps>(\n () => ({\n isOpen,\n onClose,\n width,\n }),\n [isOpen, onClose, width]\n )\n\n return (\n <DrawerContext.Provider value={contextValue}>\n {/* Mobile Drawer: visible < md breakpoint */}\n {!isDesktop && (\n <DrawerPrimitive.Root\n open={isOpen}\n onOpenChange={(open) => {\n if (!open) onClose()\n }}\n direction=\"left\"\n >\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\" />\n <DrawerPrimitive.Content\n className=\"fixed inset-y-0 left-0 z-50 flex h-full w-[85vw] max-w-md flex-col bg-sidebar border-r border-sidebar-border text-primary-accent shadow-lg outline-none\"\n aria-describedby={undefined}\n >\n <DrawerPrimitive.Title className=\"sr-only\">\n Drawer\n </DrawerPrimitive.Title>\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n </DrawerPrimitive.Root>\n )}\n\n {/* Desktop Drawer: visible >= md breakpoint */}\n {isDesktop && (\n <div\n ref={ref}\n className=\"group/drawer peer\"\n data-state={isOpen ? \"open\" : \"closed\"}\n {...props}\n >\n {/* Spacer to push content */}\n <div\n className={cn(\n \"relative bg-sidebar transition-[width] duration-200 ease-linear\",\n isOpen ? \"\" : \"w-0\"\n )}\n style={\n {\n width: isOpen ? width : \"0\",\n } as React.CSSProperties\n }\n />\n\n {/* Fixed drawer panel */}\n <div\n ref={drawerRef}\n className={cn(\n \"fixed right-0 z-40 transition-[right,width,top,height] duration-200 ease-linear flex\",\n \"top-(--sidebar-top,0px) h-[calc(100svh-var(--sidebar-top,0px))]\",\n isOpen ? \"right-0\" : \"right-[calc(var(--drawer-width)*-1)]\"\n )}\n style={\n {\n \"--drawer-width\": width,\n width: width,\n } as React.CSSProperties\n }\n >\n <div data-drawer=\"drawer\" className=\"flex h-full w-full flex-col\">\n <div className=\"flex flex-col my-2.5 mr-2.5 rounded-2xl border bg-sidebar border-sidebar-border h-[calc(100%-1.25rem)] shadow\">\n {children}\n </div>\n </div>\n </div>\n </div>\n )}\n </DrawerContext.Provider>\n )\n})\nDrawer.displayName = \"Drawer\"\n\n// Drawer Header\nconst DrawerHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean\n }\n>(({ className, showCloseButton = true, children, ...props }, ref) => {\n const { onClose } = useDrawer()\n\n return (\n <div\n ref={ref}\n data-drawer=\"header\"\n className={cn(\n \"flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border\",\n className\n )}\n {...props}\n >\n <div className=\"flex-1\">{children}</div>\n {showCloseButton && (\n <Button\n variant=\"secondary\"\n size=\"icon\"\n onClick={onClose}\n className=\"h-8 w-8 shrink-0 rounded-full\"\n >\n <X size={16} />\n <span className=\"sr-only\">Close drawer</span>\n </Button>\n )}\n </div>\n )\n})\nDrawerHeader.displayName = \"DrawerHeader\"\n\n// Drawer Title\nconst DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<\"h2\">\n>(({ className, ...props }, ref) => {\n return (\n <h2\n ref={ref}\n className={cn(\"text-lg font-semibold text-primary-accent\", className)}\n {...props}\n />\n )\n})\nDrawerTitle.displayName = \"DrawerTitle\"\n\n// Drawer Body/Content\nconst DrawerBody = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, children, ...props }, ref) => {\n return (\n <ScrollArea className=\"flex-1\" ref={ref}>\n <div\n data-drawer=\"body\"\n className={cn(\"p-4\", className)}\n {...props}\n >\n {children}\n </div>\n </ScrollArea>\n )\n})\nDrawerBody.displayName = \"DrawerBody\"\n\n// Drawer Footer\nconst DrawerFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-drawer=\"footer\"\n className={cn(\n \"flex flex-col gap-2 p-4 border-t border-sidebar-border\",\n className\n )}\n {...props}\n />\n )\n})\nDrawerFooter.displayName = \"DrawerFooter\"\n\nexport {\n Drawer,\n DrawerHeader,\n DrawerTitle,\n DrawerBody,\n DrawerFooter,\n useDrawer,\n}\n"]}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as n}from"./chunk-S5TKCF6T.mjs";import*as r from"react";import{Eye as h,MoreVertical as u}from"lucide-react";import{jsx as e,jsxs as x}from"react/jsx-runtime";var f=r.createContext({}),b={default:"rounded-3xl",sm:"rounded-2xl"},m="[&_tr:not([data-has-action-column])>th:first-child]:sticky [&_tr:not([data-has-action-column])>th:first-child]:left-0 [&_tr:not([data-has-action-column])>th:first-child]:z-10 [&_tr:not([data-has-action-column])>th:first-child]:bg-background [&_tr:not([data-has-action-column])>th:first-child]:after:absolute [&_tr:not([data-has-action-column])>th:first-child]:after:right-0 [&_tr:not([data-has-action-column])>th:first-child]:after:top-0 [&_tr:not([data-has-action-column])>th:first-child]:after:h-full [&_tr:not([data-has-action-column])>th:first-child]:after:w-px [&_tr:not([data-has-action-column])>th:first-child]:after:bg-border [&_tr:not([data-has-action-column])>td:first-child]:sticky [&_tr:not([data-has-action-column])>td:first-child]:left-0 [&_tr:not([data-has-action-column])>td:first-child]:z-10 [&_tr:not([data-has-action-column])>td:first-child]:bg-background [&_tr:not([data-has-action-column])>td:first-child]:after:absolute [&_tr:not([data-has-action-column])>td:first-child]:after:right-0 [&_tr:not([data-has-action-column])>td:first-child]:after:top-0 [&_tr:not([data-has-action-column])>td:first-child]:after:h-full [&_tr:not([data-has-action-column])>td:first-child]:after:w-px [&_tr:not([data-has-action-column])>td:first-child]:after:bg-border [&_tbody_tr:not([data-has-action-column]):hover>td:first-child]:bg-muted",p="[&_tr[data-has-action-column]>*:first-child]:sticky [&_tr[data-has-action-column]>*:first-child]:left-0 [&_tr[data-has-action-column]>*:first-child]:z-10 [&_tr[data-has-action-column]>*:first-child]:bg-background [&_tr[data-has-action-column]>*:first-child]:transition-colors [&_tr[data-has-action-column]>*:nth-child(2)]:sticky [&_tr[data-has-action-column]>*:nth-child(2)]:left-12 [&_tr[data-has-action-column]>*:nth-child(2)]:z-10 [&_tr[data-has-action-column]>*:nth-child(2)]:bg-background [&_tr[data-has-action-column]>*:nth-child(2)]:transition-colors [&_tr[data-has-action-column]>*:nth-child(2)]:after:absolute [&_tr[data-has-action-column]>*:nth-child(2)]:after:right-0 [&_tr[data-has-action-column]>*:nth-child(2)]:after:top-0 [&_tr[data-has-action-column]>*:nth-child(2)]:after:h-full [&_tr[data-has-action-column]>*:nth-child(2)]:after:w-px [&_tr[data-has-action-column]>*:nth-child(2)]:after:bg-border [&_tbody_tr[data-has-action-column]:hover>td:first-child]:bg-muted [&_tbody_tr[data-has-action-column]:hover>td:nth-child(2)]:bg-muted";function y({className:a,stickyFirstColumn:t,rounded:o="default",...l}){return e(f.Provider,{value:{stickyFirstColumn:t},children:e("div",{"data-slot":"table-container",className:n("relative bg-background w-full overflow-x-auto border border-border",b[o],t&&m,t&&p),children:e("table",{"data-slot":"table",className:n("w-full caption-bottom text-sm",a),...l})})})}function k({className:a,...t}){return e("thead",{"data-slot":"table-header",className:n("[&_tr]:border-b text-secondary-text",a),...t})}function v({className:a,...t}){return e("tbody",{"data-slot":"table-body",className:n("[&_tr:last-child]:border-0",a),...t})}function R({className:a,...t}){return e("tfoot",{"data-slot":"table-footer",className:n("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",a),...t})}function T({className:a,isClickable:t,actionIcon:o,children:l,...i}){let s=o==="eye"?e(h,{className:"h-4 w-4"}):o==="more"?e(u,{className:"h-4 w-4"}):null;return x("tr",{"data-slot":"table-row","data-has-action-column":o!==void 0?"":void 0,className:n("border-b border-border/50 transition-colors",t&&"cursor-pointer hover:bg-muted/50",a),...i,children:[o!==void 0&&e(_,{className:"w-12",children:s}),l]})}function P({className:a,isSticky:t,...o}){return e("th",{"data-slot":"table-head",className:n("text-secondary-text h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",t&&"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border",a),...o})}function _({className:a,isSticky:t,...o}){return e("td",{"data-slot":"table-cell",className:n("p-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",t&&"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border",a),...o})}function w({className:a,onClick:t,children:o,asChild:l=!1,...i}){let s=c=>{c.stopPropagation(),t?.(c)};return l&&r.isValidElement(o)?r.cloneElement(o,{onClick:c=>{c.stopPropagation();let d=o.props.onClick;d?.(c)},className:n("inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:bg-muted/50 hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent",o.props.className,a)}):e("button",{type:"button","data-slot":"table-cell-action",className:n("inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent",a),onClick:s,...i,children:o})}function N({className:a,...t}){return e("caption",{"data-slot":"table-caption",className:n("text-muted-foreground mt-4 text-sm",a),...t})}export{y as a,k as b,v as c,R as d,T as e,P as f,_ as g,w as h,N as i};
3
+ //# sourceMappingURL=chunk-C7GTPYMH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/table.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Eye, MoreVertical } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TableContextValue {\n stickyFirstColumn?: boolean\n}\n\nconst TableContext = React.createContext<TableContextValue>({})\n\nexport interface TableProps extends React.ComponentProps<\"table\"> {\n stickyFirstColumn?: boolean\n rounded?: \"default\" | \"sm\"\n}\n\nconst roundedMap = {\n default: \"rounded-3xl\",\n sm: \"rounded-2xl\",\n} as const\n\n// Sticky first column (rows without action icon)\nconst stickyFirstColumnStyles =\n \"[&_tr:not([data-has-action-column])>th:first-child]:sticky [&_tr:not([data-has-action-column])>th:first-child]:left-0 [&_tr:not([data-has-action-column])>th:first-child]:z-10 [&_tr:not([data-has-action-column])>th:first-child]:bg-background [&_tr:not([data-has-action-column])>th:first-child]:after:absolute [&_tr:not([data-has-action-column])>th:first-child]:after:right-0 [&_tr:not([data-has-action-column])>th:first-child]:after:top-0 [&_tr:not([data-has-action-column])>th:first-child]:after:h-full [&_tr:not([data-has-action-column])>th:first-child]:after:w-px [&_tr:not([data-has-action-column])>th:first-child]:after:bg-border [&_tr:not([data-has-action-column])>td:first-child]:sticky [&_tr:not([data-has-action-column])>td:first-child]:left-0 [&_tr:not([data-has-action-column])>td:first-child]:z-10 [&_tr:not([data-has-action-column])>td:first-child]:bg-background [&_tr:not([data-has-action-column])>td:first-child]:after:absolute [&_tr:not([data-has-action-column])>td:first-child]:after:right-0 [&_tr:not([data-has-action-column])>td:first-child]:after:top-0 [&_tr:not([data-has-action-column])>td:first-child]:after:h-full [&_tr:not([data-has-action-column])>td:first-child]:after:w-px [&_tr:not([data-has-action-column])>td:first-child]:after:bg-border [&_tbody_tr:not([data-has-action-column]):hover>td:first-child]:bg-muted\"\n\n// Sticky first two columns (rows with action icon): icon at left-0, data column at left-12\nconst stickyActionColumnStyles =\n \"[&_tr[data-has-action-column]>*:first-child]:sticky [&_tr[data-has-action-column]>*:first-child]:left-0 [&_tr[data-has-action-column]>*:first-child]:z-10 [&_tr[data-has-action-column]>*:first-child]:bg-background [&_tr[data-has-action-column]>*:first-child]:transition-colors [&_tr[data-has-action-column]>*:nth-child(2)]:sticky [&_tr[data-has-action-column]>*:nth-child(2)]:left-12 [&_tr[data-has-action-column]>*:nth-child(2)]:z-10 [&_tr[data-has-action-column]>*:nth-child(2)]:bg-background [&_tr[data-has-action-column]>*:nth-child(2)]:transition-colors [&_tr[data-has-action-column]>*:nth-child(2)]:after:absolute [&_tr[data-has-action-column]>*:nth-child(2)]:after:right-0 [&_tr[data-has-action-column]>*:nth-child(2)]:after:top-0 [&_tr[data-has-action-column]>*:nth-child(2)]:after:h-full [&_tr[data-has-action-column]>*:nth-child(2)]:after:w-px [&_tr[data-has-action-column]>*:nth-child(2)]:after:bg-border [&_tbody_tr[data-has-action-column]:hover>td:first-child]:bg-muted [&_tbody_tr[data-has-action-column]:hover>td:nth-child(2)]:bg-muted\"\n\nfunction Table({ className, stickyFirstColumn, rounded = \"default\", ...props }: TableProps) {\n return (\n <TableContext.Provider value={{ stickyFirstColumn }}>\n <div\n data-slot=\"table-container\"\n className={cn(\n \"relative bg-background w-full overflow-x-auto border border-border\",\n roundedMap[rounded],\n stickyFirstColumn && stickyFirstColumnStyles,\n stickyFirstColumn && stickyActionColumnStyles\n )}\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n </TableContext.Provider>\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b text-secondary-text\", className)}\n {...props}\n />\n )\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableRowProps extends React.ComponentProps<\"tr\"> {\n isClickable?: boolean\n actionIcon?: \"eye\" | \"more\" | null\n}\n\nfunction TableRow({\n className,\n isClickable,\n actionIcon,\n children,\n ...props\n}: TableRowProps) {\n const iconComponent =\n actionIcon === \"eye\" ? (\n <Eye className=\"h-4 w-4\" />\n ) : actionIcon === \"more\" ? (\n <MoreVertical className=\"h-4 w-4\" />\n ) : null\n\n return (\n <tr\n data-slot=\"table-row\"\n data-has-action-column={actionIcon !== undefined ? \"\" : undefined}\n className={cn(\n \"border-b border-border/50 transition-colors\",\n isClickable && \"cursor-pointer hover:bg-muted/50\",\n className\n )}\n {...props}\n >\n {actionIcon !== undefined && (\n <TableCell className=\"w-12\">{iconComponent}</TableCell>\n )}\n {children}\n </tr>\n )\n}\n\nexport interface TableHeadProps extends React.ComponentProps<\"th\"> {\n isSticky?: boolean\n}\n\nfunction TableHead({ className, isSticky, ...props }: TableHeadProps) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-secondary-text h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\n isSticky &&\n \"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableCellProps extends React.ComponentProps<\"td\"> {\n isSticky?: boolean\n}\n\nfunction TableCell({ className, isSticky, ...props }: TableCellProps) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\n isSticky &&\n \"sticky left-0 z-10 bg-background after:absolute after:right-0 after:top-0 after:h-full after:w-px after:bg-border\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport interface TableCellActionProps extends React.ComponentProps<\"button\"> {\n asChild?: boolean\n}\n\nfunction TableCellAction({\n className,\n onClick,\n children,\n asChild = false,\n ...props\n}: TableCellActionProps) {\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onClick?.(e)\n }\n\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void\n className?: string\n }>,\n {\n onClick: (e: React.MouseEvent) => {\n e.stopPropagation()\n const childOnClick = (\n children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void\n }>\n ).props.onClick\n childOnClick?.(e)\n },\n className: cn(\n \"inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:bg-muted/50 hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent\",\n (children as React.ReactElement<{ className?: string }>).props\n .className,\n className\n ),\n }\n )\n }\n\n return (\n <button\n type=\"button\"\n data-slot=\"table-cell-action\"\n className={cn(\n \"inline-flex items-center justify-center rounded-full p-1 text-secondary-text transition-colors hover:text-primary-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-accent\",\n className\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n </button>\n )\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCellAction,\n TableCaption,\n}\n"],"mappings":";yCAEA,UAAYA,MAAW,QACvB,OAAS,OAAAC,EAAK,gBAAAC,MAAoB,eAwC1B,cAAAC,EA+DJ,QAAAC,MA/DI,oBAhCR,IAAMC,EAAqB,gBAAiC,CAAC,CAAC,EAOxDC,EAAa,CACjB,QAAS,cACT,GAAI,aACN,EAGMC,EACJ,+zCAGIC,EACJ,4hCAEF,SAASC,EAAM,CAAE,UAAAC,EAAW,kBAAAC,EAAmB,QAAAC,EAAU,UAAW,GAAGC,CAAM,EAAe,CAC1F,OACEV,EAACE,EAAa,SAAb,CAAsB,MAAO,CAAE,kBAAAM,CAAkB,EAChD,SAAAR,EAAC,OACC,YAAU,kBACV,UAAWW,EACT,qEACAR,EAAWM,CAAO,EAClBD,GAAqBJ,EACrBI,GAAqBH,CACvB,EAEA,SAAAL,EAAC,SACC,YAAU,QACV,UAAWW,EAAG,gCAAiCJ,CAAS,EACvD,GAAGG,EACN,EACF,EACF,CAEJ,CAEA,SAASE,EAAY,CAAE,UAAAL,EAAW,GAAGG,CAAM,EAAkC,CAC3E,OACEV,EAAC,SACC,YAAU,eAC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,GAA2C,CAC9DA,EAAE,gBAAgB,EAClBH,IAAUG,CAAC,CACb,EAEA,OAAIF,GAAiB,iBAAeT,CAAQ,EAC7B,eACXA,EAIA,CACE,QAAUW,GAAwB,CAChCA,EAAE,gBAAgB,EAClB,IAAMC,EACJZ,EAGA,MAAM,QACRY,IAAeD,CAAC,CAClB,EACA,UAAWlB,EACT,+NACCO,EAAwD,MACtD,UACHX,CACF,CACF,CACF,EAIAP,EAAC,UACC,KAAK,SACL,YAAU,oBACV,UAAWW,EACT,6MACAJ,CACF,EACA,QAASqB,EACR,GAAGlB,EAEH,SAAAQ,EACH,CAEJ,CAEA,SAASa,EAAa,CACpB,UAAAxB,EACA,GAAGG,CACL,EAAoC,CAClC,OACEV,EAAC,WACC,YAAU,gBACV,UAAWW,EAAG,qCAAsCJ,CAAS,EAC5D,GAAGG,EACN,CAEJ","names":["React","Eye","MoreVertical","jsx","jsxs","TableContext","roundedMap","stickyFirstColumnStyles","stickyActionColumnStyles","Table","className","stickyFirstColumn","rounded","props","cn","TableHeader","TableBody","TableFooter","TableRow","isClickable","actionIcon","children","iconComponent","Eye","MoreVertical","TableCell","TableHead","isSticky","TableCellAction","onClick","asChild","handleClick","e","childOnClick","TableCaption"]}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as w}from"./chunk-S5TKCF6T.mjs";import R,{useState as q,useEffect as E,useMemo as $,useRef as p}from"react";import{jsx as h,jsxs as I}from"react/jsx-runtime";var j="!<>-_\\/[]{}\u2014=+*^?#________",C=e=>e[Math.floor(Math.random()*e.length)],S=e=>{if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(S).join("");if(R.isValidElement(e)){let s=e.props;return(s.text||"")+(s.label||"")+(s.title||"")+S(s.children)}return""},N=(e,s,i)=>{if(typeof e=="string"||typeof e=="number"){let l=String(e),c=[];for(let m=0;m<l.length;m++)c.push(h(R.Fragment,{children:s[i.current]||""},`char-${i.current}`)),i.current++;return c}if(Array.isArray(e))return e.map((l,c)=>h(R.Fragment,{children:N(l,s,i)},`arr-${c}-${i.current}`));if(R.isValidElement(e)){let l=e.props,c={};return l.children&&(c.children=N(l.children,s,i)),R.cloneElement(e,c)}return e};function L({children:e,className:s,duration:i=40,symbols:l=j,delay:c=0,isLoading:m=!1,speed:T=.28}){let[D,_]=q(null),[P,y]=q(!1),A=p(null),g=p(0),b=p([]),t=p(null),F=p(!1),f=$(()=>S(e),[e]),k=()=>{let r=[];for(let u=0;u<f.length;u++){let n=f[u],o=Math.floor(Math.random()*(i*.5)),a=o+Math.floor(Math.random()*(i*.5));r.push({to:n,start:o,end:a})}b.current=r,g.current=0,y(!1)},d=p([]),v=()=>{let r=[];d.current.length!==f.length&&(d.current=new Array(f.length).fill(void 0));for(let n=0;n<f.length;n++){let o=f[n];o===" "?r.push(" "):((!d.current[n]||Math.random()<T)&&(d.current[n]=C(l)),r.push(I("span",{className:"relative inline-block",children:[h("span",{className:"invisible select-none","aria-hidden":"true",children:o}),h("span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none",children:d.current[n]})]},n)))}_(N(e,r,{current:0})),t.current=requestAnimationFrame(v)},x=()=>{let r=0,u=[];for(let o=0;o<b.current.length;o++){let a=b.current[o];g.current>=a.end?(r++,u.push(a.to)):(g.current>=a.start&&(!a.char||Math.random()<T)&&(a.char=C(l)),u.push(I("span",{className:"relative inline-block",children:[h("span",{className:"invisible select-none","aria-hidden":"true",children:a.to===" "?"\xA0":a.to}),g.current>=a.start&&h("span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none",children:a.char})]},o)))}_(N(e,u,{current:0})),r===b.current.length?y(!0):(g.current++,t.current=requestAnimationFrame(x))},M=p(!1);return E(()=>{if(m)return M.current=!0,F.current=!0,y(!1),t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(v),()=>{t.current&&cancelAnimationFrame(t.current)};if(M.current)return M.current=!1,k(),t.current=requestAnimationFrame(x),()=>{t.current&&cancelAnimationFrame(t.current)}},[m,f]),E(()=>{if(m)return;let r=new IntersectionObserver(u=>{if(u[0].isIntersecting&&!F.current){F.current=!0;let n=setTimeout(()=>{k(),t.current=requestAnimationFrame(x)},c);return()=>clearTimeout(n)}},{threshold:.1});return A.current&&r.observe(A.current),()=>{r.disconnect(),t.current&&cancelAnimationFrame(t.current)}},[f,c,m]),h("span",{ref:A,className:w("inline-block whitespace-pre-wrap",s),children:P?e:D})}export{L as a};
3
+ //# sourceMappingURL=chunk-CMV76O4U.mjs.map