@alkimi.org/ui-kit 0.12.7 → 0.13.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 (189) hide show
  1. package/dist/COMPONENTS.md +11 -2
  2. package/dist/{chunk-3TLCOZ5R.js → chunk-24EJLBGD.js} +2 -2
  3. package/dist/chunk-24EJLBGD.js.map +1 -0
  4. package/dist/chunk-372VUZFE.js.map +1 -1
  5. package/dist/chunk-3BVMHDYA.js.map +1 -1
  6. package/dist/{chunk-GRXC46JC.js → chunk-3DUPSGEY.js} +2 -2
  7. package/dist/chunk-3DUPSGEY.js.map +1 -0
  8. package/dist/{chunk-DMMKR6TY.js → chunk-3N5K4X23.js} +2 -2
  9. package/dist/chunk-3N5K4X23.js.map +1 -0
  10. package/dist/chunk-3PEPOFYU.js.map +1 -1
  11. package/dist/{chunk-DATWXRPT.mjs → chunk-4DRIPZWE.mjs} +2 -2
  12. package/dist/{chunk-BV7RXRSL.js → chunk-53P3PXF7.js} +2 -2
  13. package/dist/chunk-53P3PXF7.js.map +1 -0
  14. package/dist/chunk-5L5DM2X5.js.map +1 -1
  15. package/dist/chunk-5X26XR44.js.map +1 -1
  16. package/dist/{chunk-GTHJWD33.js → chunk-73MWZSJI.js} +2 -2
  17. package/dist/chunk-73MWZSJI.js.map +1 -0
  18. package/dist/chunk-7SOZ6MOV.js.map +1 -1
  19. package/dist/chunk-ALSJLUSL.js.map +1 -1
  20. package/dist/chunk-C4GUY2JQ.js.map +1 -1
  21. package/dist/chunk-CT2CRYC2.js.map +1 -1
  22. package/dist/chunk-DEWWZMYC.js.map +1 -1
  23. package/dist/chunk-EBNJXPHG.js.map +1 -1
  24. package/dist/{chunk-UAUSYTY4.mjs → chunk-EDOMXQSZ.mjs} +2 -2
  25. package/dist/{chunk-UAUSYTY4.mjs.map → chunk-EDOMXQSZ.mjs.map} +1 -1
  26. package/dist/chunk-EIM5R7AJ.js.map +1 -1
  27. package/dist/chunk-EJTY2ABY.js.map +1 -1
  28. package/dist/{chunk-QMJVRGPB.mjs → chunk-EOFZPG26.mjs} +2 -2
  29. package/dist/{chunk-QMJVRGPB.mjs.map → chunk-EOFZPG26.mjs.map} +1 -1
  30. package/dist/chunk-ETE5IUMO.js.map +1 -1
  31. package/dist/chunk-FUYXCJOQ.js.map +1 -1
  32. package/dist/chunk-I5INE4KG.js.map +1 -1
  33. package/dist/{chunk-RKRTEMMZ.js → chunk-IJRJBDSO.js} +2 -2
  34. package/dist/chunk-IJRJBDSO.js.map +1 -0
  35. package/dist/{chunk-XQILGD5B.js → chunk-IJVB2BVO.js} +2 -2
  36. package/dist/chunk-IJVB2BVO.js.map +1 -0
  37. package/dist/{chunk-DKMCJGI4.mjs → chunk-JD2CTTZW.mjs} +2 -2
  38. package/dist/chunk-JOEQLSHD.js.map +1 -1
  39. package/dist/{chunk-PD43W3YN.mjs → chunk-JYA3425I.mjs} +2 -2
  40. package/dist/chunk-KN2ZJ5E6.mjs +3 -0
  41. package/dist/chunk-KN2ZJ5E6.mjs.map +1 -0
  42. package/dist/{chunk-574USYNO.mjs → chunk-MKZJL4AD.mjs} +2 -2
  43. package/dist/{chunk-574USYNO.mjs.map → chunk-MKZJL4AD.mjs.map} +1 -1
  44. package/dist/{chunk-DHHZMQ72.js → chunk-NCBOTFZQ.js} +2 -2
  45. package/dist/chunk-NCBOTFZQ.js.map +1 -0
  46. package/dist/chunk-NU2US7UW.mjs +3 -0
  47. package/dist/chunk-NU2US7UW.mjs.map +1 -0
  48. package/dist/{chunk-AQZWRJVJ.mjs → chunk-OLF2HLRF.mjs} +2 -2
  49. package/dist/chunk-OLF2HLRF.mjs.map +1 -0
  50. package/dist/chunk-QOEM7ZRV.mjs +3 -0
  51. package/dist/chunk-QOEM7ZRV.mjs.map +1 -0
  52. package/dist/{chunk-BLHKJHNV.mjs → chunk-QZKQORLQ.mjs} +2 -2
  53. package/dist/chunk-QZKQORLQ.mjs.map +1 -0
  54. package/dist/chunk-RJMIOBXZ.js.map +1 -1
  55. package/dist/chunk-RRAIGAHU.js.map +1 -1
  56. package/dist/{chunk-KLU33CJI.mjs → chunk-RUEPYIWM.mjs} +2 -2
  57. package/dist/{chunk-7J2ETVGK.js → chunk-SPGHRCUD.js} +2 -2
  58. package/dist/chunk-SPGHRCUD.js.map +1 -0
  59. package/dist/chunk-TDMRUCR6.js.map +1 -1
  60. package/dist/chunk-UJZP6L4S.js.map +1 -1
  61. package/dist/chunk-ULIOO55I.js.map +1 -1
  62. package/dist/chunk-UNR6ATUH.js.map +1 -1
  63. package/dist/chunk-UW73WIQU.js +3 -0
  64. package/dist/chunk-UW73WIQU.js.map +1 -0
  65. package/dist/chunk-WFD523CV.js.map +1 -1
  66. package/dist/chunk-WKRZIVSX.js +3 -0
  67. package/dist/chunk-WKRZIVSX.js.map +1 -0
  68. package/dist/chunk-WYRD4UAK.js.map +1 -1
  69. package/dist/{chunk-USPGZYMV.js → chunk-XUVA7BXG.js} +2 -2
  70. package/dist/chunk-XUVA7BXG.js.map +1 -0
  71. package/dist/chunk-XVF3OJWZ.js +3 -0
  72. package/dist/chunk-XVF3OJWZ.js.map +1 -0
  73. package/dist/chunk-XYO4VLMF.js.map +1 -1
  74. package/dist/{chunk-LQMOWEA7.js → chunk-YE7OOLWB.js} +2 -2
  75. package/dist/chunk-YE7OOLWB.js.map +1 -0
  76. package/dist/{chunk-TYRJ7CQV.mjs → chunk-YIVVQTGD.mjs} +2 -2
  77. package/dist/chunk-YSIF7HA3.mjs +3 -0
  78. package/dist/chunk-YSIF7HA3.mjs.map +1 -0
  79. package/dist/chunk-Z5V4P3EC.js.map +1 -1
  80. package/dist/components/GeometricFluidGrid.js.map +1 -1
  81. package/dist/components/GlitchLink.js.map +1 -1
  82. package/dist/components/PixelLoad.js.map +1 -1
  83. package/dist/components/TextDecoder.js.map +1 -1
  84. package/dist/components/accordion.js.map +1 -1
  85. package/dist/components/avatar.js.map +1 -1
  86. package/dist/components/breadcrumb.js +1 -1
  87. package/dist/components/breadcrumb.js.map +1 -1
  88. package/dist/components/breadcrumb.mjs +1 -1
  89. package/dist/components/button.js +1 -1
  90. package/dist/components/button.js.map +1 -1
  91. package/dist/components/button.mjs +1 -1
  92. package/dist/components/calendar.js +1 -1
  93. package/dist/components/calendar.js.map +1 -1
  94. package/dist/components/calendar.mjs +1 -1
  95. package/dist/components/card.js.map +1 -1
  96. package/dist/components/checkbox.js.map +1 -1
  97. package/dist/components/combobox.d.mts +19 -2
  98. package/dist/components/combobox.d.ts +19 -2
  99. package/dist/components/combobox.js +1 -1
  100. package/dist/components/combobox.js.map +1 -1
  101. package/dist/components/combobox.mjs +1 -1
  102. package/dist/components/command.js +1 -1
  103. package/dist/components/command.js.map +1 -1
  104. package/dist/components/command.mjs +1 -1
  105. package/dist/components/date-picker.js +1 -1
  106. package/dist/components/date-picker.js.map +1 -1
  107. package/dist/components/date-picker.mjs +1 -1
  108. package/dist/components/date-range-picker.js +1 -1
  109. package/dist/components/date-range-picker.js.map +1 -1
  110. package/dist/components/date-range-picker.mjs +1 -1
  111. package/dist/components/dialog.js +1 -1
  112. package/dist/components/dialog.js.map +1 -1
  113. package/dist/components/dialog.mjs +1 -1
  114. package/dist/components/drawer.js +1 -1
  115. package/dist/components/drawer.js.map +1 -1
  116. package/dist/components/drawer.mjs +1 -1
  117. package/dist/components/dropdown-menu.js.map +1 -1
  118. package/dist/components/field.js.map +1 -1
  119. package/dist/components/file-upload.js +1 -1
  120. package/dist/components/file-upload.js.map +1 -1
  121. package/dist/components/file-upload.mjs +1 -1
  122. package/dist/components/input.js +1 -1
  123. package/dist/components/input.js.map +1 -1
  124. package/dist/components/input.mjs +1 -1
  125. package/dist/components/label.js.map +1 -1
  126. package/dist/components/popover.js.map +1 -1
  127. package/dist/components/progress.js.map +1 -1
  128. package/dist/components/radio-group.js.map +1 -1
  129. package/dist/components/scroll-area.js.map +1 -1
  130. package/dist/components/separator.js.map +1 -1
  131. package/dist/components/sheet.js.map +1 -1
  132. package/dist/components/sidebar.js +1 -1
  133. package/dist/components/sidebar.js.map +1 -1
  134. package/dist/components/sidebar.mjs +1 -1
  135. package/dist/components/skeleton.js.map +1 -1
  136. package/dist/components/slider.js.map +1 -1
  137. package/dist/components/switch.js.map +1 -1
  138. package/dist/components/table.js.map +1 -1
  139. package/dist/components/tabs.js +1 -1
  140. package/dist/components/tabs.js.map +1 -1
  141. package/dist/components/tabs.mjs +1 -1
  142. package/dist/components/textarea.js.map +1 -1
  143. package/dist/components/toast.js.map +1 -1
  144. package/dist/components/tooltip.js.map +1 -1
  145. package/dist/components/tree-select.js +1 -1
  146. package/dist/components/tree-select.js.map +1 -1
  147. package/dist/components/tree-select.mjs +1 -1
  148. package/dist/index.css +1 -1
  149. package/dist/index.css.map +1 -1
  150. package/dist/index.d.mts +1 -1
  151. package/dist/index.d.ts +1 -1
  152. package/dist/index.js +1 -1
  153. package/dist/index.js.map +1 -1
  154. package/dist/index.mjs +1 -1
  155. package/dist/styles.css +1 -1
  156. package/dist/styles.css.map +1 -1
  157. package/package.json +1 -1
  158. package/dist/chunk-3TLCOZ5R.js.map +0 -1
  159. package/dist/chunk-4UISHS25.mjs +0 -3
  160. package/dist/chunk-4UISHS25.mjs.map +0 -1
  161. package/dist/chunk-7FUNOEYE.mjs +0 -3
  162. package/dist/chunk-7FUNOEYE.mjs.map +0 -1
  163. package/dist/chunk-7J2ETVGK.js.map +0 -1
  164. package/dist/chunk-AQZWRJVJ.mjs.map +0 -1
  165. package/dist/chunk-BLHKJHNV.mjs.map +0 -1
  166. package/dist/chunk-BV7RXRSL.js.map +0 -1
  167. package/dist/chunk-DHHZMQ72.js.map +0 -1
  168. package/dist/chunk-DMMKR6TY.js.map +0 -1
  169. package/dist/chunk-GRXC46JC.js.map +0 -1
  170. package/dist/chunk-GTHJWD33.js.map +0 -1
  171. package/dist/chunk-K4GMCVHO.js +0 -3
  172. package/dist/chunk-K4GMCVHO.js.map +0 -1
  173. package/dist/chunk-LQMOWEA7.js.map +0 -1
  174. package/dist/chunk-NEOUFWZN.mjs +0 -3
  175. package/dist/chunk-NEOUFWZN.mjs.map +0 -1
  176. package/dist/chunk-ODXDXJ72.js +0 -3
  177. package/dist/chunk-ODXDXJ72.js.map +0 -1
  178. package/dist/chunk-RKRTEMMZ.js.map +0 -1
  179. package/dist/chunk-USPGZYMV.js.map +0 -1
  180. package/dist/chunk-VBPIXXIA.js +0 -3
  181. package/dist/chunk-VBPIXXIA.js.map +0 -1
  182. package/dist/chunk-WZ5F5VT3.mjs +0 -3
  183. package/dist/chunk-WZ5F5VT3.mjs.map +0 -1
  184. package/dist/chunk-XQILGD5B.js.map +0 -1
  185. /package/dist/{chunk-DATWXRPT.mjs.map → chunk-4DRIPZWE.mjs.map} +0 -0
  186. /package/dist/{chunk-DKMCJGI4.mjs.map → chunk-JD2CTTZW.mjs.map} +0 -0
  187. /package/dist/{chunk-PD43W3YN.mjs.map → chunk-JYA3425I.mjs.map} +0 -0
  188. /package/dist/{chunk-KLU33CJI.mjs.map → chunk-RUEPYIWM.mjs.map} +0 -0
  189. /package/dist/{chunk-TYRJ7CQV.mjs.map → chunk-YIVVQTGD.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-ETE5IUMO.js","../src/components/switch.tsx"],"names":["Switch","className","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,oGACW,+CAgB9B,IAZEA,CAAAA,CAAe,CAAA,CAAA,UAAA,CAGnB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BC,6BAAAA,CAAkB,CAAA,IAAA,CAAjB,CACC,SAAA,CAAWC,gCAAAA,qaACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACJ,GAAA,CAAKC,CAAAA,CAEL,QAAA,CAAAC,6BAAAA,CAAkB,CAAA,KAAA,CAAjB,CACC,SAAA,CAAWC,gCAAAA,sOAEX,CAAA,CACF,CAAA,CACF,CACD,CAAA,CACDL,CAAAA,CAAO,WAAA,CAA+B,CAAA,CAAA,IAAA,CAAK,WAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-ETE5IUMO.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=checked]:border-accent data-[state=unchecked]:bg-muted\",\n className\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform duration-400 ease-[cubic-bezier(0.85,0.05,0.18,1.35)] data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-0.5\"\n )}\n />\n </SwitchPrimitives.Root>\n))\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch }\n"]}
1
+ {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-ETE5IUMO.js","../src/components/switch.tsx"],"names":["Switch","className","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,oGACW,+CAgB9B,IAZEA,CAAAA,CAAe,CAAA,CAAA,UAAA,CAGnB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BC,6BAAAA,CAAkB,CAAA,IAAA,CAAjB,CACC,SAAA,CAAWC,gCAAAA,qaACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACJ,GAAA,CAAKC,CAAAA,CAEL,QAAA,CAAAC,6BAAAA,CAAkB,CAAA,KAAA,CAAjB,CACC,SAAA,CAAWC,gCAAAA,sOAEX,CAAA,CACF,CAAA,CACF,CACD,CAAA,CACDL,CAAAA,CAAO,WAAA,CAA+B,CAAA,CAAA,IAAA,CAAK,WAAA,CAAA,cAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-ETE5IUMO.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=checked]:border-accent data-[state=unchecked]:bg-muted\",\n className\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform duration-400 ease-[cubic-bezier(0.85,0.05,0.18,1.35)] data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-0.5\"\n )}\n />\n </SwitchPrimitives.Root>\n))\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch }\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-FUYXCJOQ.js","../src/lib/utils.ts"],"names":["cn","inputs","twMerge","clsx"],"mappings":"AAAA,qFAAY;ACAZ,4BAAsC,+CACd,SAERA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,oCAAAA,wBAAQC,CAAW,CAAC,CAC7B,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-FUYXCJOQ.js","sourcesContent":[null,"import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
1
+ {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-FUYXCJOQ.js","../src/lib/utils.ts"],"names":["cn","inputs","twMerge","clsx"],"mappings":"AAAA,qFAAY;ACAZ,4BAAsC,+CACd,SAERA,CAAAA,CAAAA,GAAMC,CAAAA,CAAsB,CAC1C,OAAOC,oCAAAA,wBAAQC,CAAW,CAAC,CAC7B,CAAA,cAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-FUYXCJOQ.js","sourcesContent":[null,"import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-I5INE4KG.js","../src/components/label.tsx"],"names":["Label","className","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,+CAOnB,IAFEA,CAAAA,CAAc,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBC,6BAAAA,OAAC,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,yFACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAEJ,CAAA,CACAF,CAAAA,CAAM,WAAA,CAAc,OAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-I5INE4KG.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className\n )}\n {...props}\n />\n )\n)\nLabel.displayName = \"Label\"\n\nexport { Label }\n"]}
1
+ {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-I5INE4KG.js","../src/components/label.tsx"],"names":["Label","className","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,+CAOnB,IAFEA,CAAAA,CAAc,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBC,6BAAAA,OAAC,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,yFACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAEJ,CAAA,CACAF,CAAAA,CAAM,WAAA,CAAc,OAAA,CAAA,cAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-I5INE4KG.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className\n )}\n {...props}\n />\n )\n)\nLabel.displayName = \"Label\"\n\nexport { Label }\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; } }"use client";
2
- var _chunkRJMIOBXZjs = require('./chunk-RJMIOBXZ.js');var _chunk3BVMHDYAjs = require('./chunk-3BVMHDYA.js');var _chunkXQILGD5Bjs = require('./chunk-XQILGD5B.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, _chunkXQILGD5Bjs.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-RKRTEMMZ.js.map
2
+ var _chunkRJMIOBXZjs = require('./chunk-RJMIOBXZ.js');var _chunk3BVMHDYAjs = require('./chunk-3BVMHDYA.js');var _chunkIJVB2BVOjs = require('./chunk-IJVB2BVO.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, _chunkIJVB2BVOjs.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-IJRJBDSO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-IJRJBDSO.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,m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AA,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/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-IJRJBDSO.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,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 _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var o = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _classvarianceauthority = require('class-variance-authority');var _jsxruntime = require('react/jsx-runtime');var m=_classvarianceauthority.cva.call(void 0, "inline-flex items-center cursor-pointer justify-center whitespace-nowrap rounded-4xl font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary-accent text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive hover:bg-destructive/90",outline:"border border-input hover:bg-base-accent text-primary-accent",secondary:"bg-muted text-primary-accent hover:bg-muted/20",ghost:"hover:bg-base-accent text-primary-accent",link:"text-primary-accent underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 text-sm",sm:"h-8 text-xs px-3 py-2",lg:"h-10 px-8 py-2 text-sm",icon:"h-9 w-9",none:""}},defaultVariants:{variant:"default",size:"default"}}),f= exports.b =o.forwardRef(({className:i,variant:s,size:c,asChild:d=!1,loading:e=!1,icon:r,...t},u)=>_jsxruntime.jsxs.call(void 0, d?_reactslot.Slot:"button",{className:_chunkFUYXCJOQjs.a.call(void 0, m({variant:s,size:c,className:i})),ref:u,disabled:e||t.disabled,...t,children:[e&&_jsxruntime.jsx.call(void 0, "div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),!e&&r&&_jsxruntime.jsx.call(void 0, "span",{className:"mr-2",children:r}),t.children]}));f.displayName="Button";exports.a = m; exports.b = f;
3
- //# sourceMappingURL=chunk-XQILGD5B.js.map
2
+ var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var o = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _classvarianceauthority = require('class-variance-authority');var _jsxruntime = require('react/jsx-runtime');var m=_classvarianceauthority.cva.call(void 0, "inline-flex items-center cursor-pointer justify-center whitespace-nowrap rounded-4xl font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary-accent text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive hover:bg-destructive/90",outline:"border border-input hover:bg-base-accent text-primary-accent",secondary:"bg-muted text-primary-accent hover:bg-muted/20",ghost:"hover:bg-base-accent text-primary-accent",link:"text-primary-accent underline-offset-4 hover:underline"},size:{default:"h-8 lg:h-9 px-4 py-2 text-sm",sm:"h-8 text-xs px-3 py-2",lg:"h-10 px-8 py-2 text-sm",icon:"h-8 lg:h-9 w-8 lg:w-9",none:""}},defaultVariants:{variant:"default",size:"default"}}),f= exports.b =o.forwardRef(({className:i,variant:s,size:c,asChild:l=!1,loading:e=!1,icon:r,...t},d)=>_jsxruntime.jsxs.call(void 0, l?_reactslot.Slot:"button",{className:_chunkFUYXCJOQjs.a.call(void 0, m({variant:s,size:c,className:i})),ref:d,disabled:e||t.disabled,...t,children:[e&&_jsxruntime.jsx.call(void 0, "div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),!e&&r&&_jsxruntime.jsx.call(void 0, "span",{className:"mr-2",children:r}),t.children]}));f.displayName="Button";exports.a = m; exports.b = f;
3
+ //# sourceMappingURL=chunk-IJVB2BVO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-IJVB2BVO.js","../src/components/button.tsx"],"names":["buttonVariants","cva","Button","className","variant","size","asChild","loading","icon","props","ref","jsxs","Slot","cn","jsx"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECDhB,iDACF,kEACkB,+CAwDjC,IApDAA,CAAAA,CAAiBC,yCAAAA,+SACrB,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CACE,+DAAA,CACF,WAAA,CAAa,wCAAA,CACb,OAAA,CAAS,8DAAA,CACT,SAAA,CAAW,gDAAA,CACX,KAAA,CAAO,0CAAA,CACP,IAAA,CAAM,wDACR,CAAA,CACA,IAAA,CAAM,CACJ,OAAA,CAAS,8BAAA,CACT,EAAA,CAAI,uBAAA,CACJ,EAAA,CAAI,wBAAA,CACJ,IAAA,CAAM,uBAAA,CACN,IAAA,CAAM,EACR,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,SAAA,CACT,IAAA,CAAM,SACR,CACF,CACF,CAAA,CAWMC,CAAAA,aAAe,CAAA,CAAA,UAAA,CACnB,CACE,CACE,SAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAU,CAAA,CAAA,CACV,OAAA,CAAAC,CAAAA,CAAU,CAAA,CAAA,CACV,IAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CACAC,CAAAA,CAAAA,EAIEC,8BAAAA,CAFWL,CAAUM,eAAAA,CAAO,QAAA,CAE3B,CACC,SAAA,CAAWC,gCAAAA,CAAGb,CAAe,CAAE,OAAA,CAAAI,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,SAAA,CAAAF,CAAU,CAAC,CAAC,CAAA,CAC1D,GAAA,CAAKO,CAAAA,CACL,QAAA,CAAUH,CAAAA,EAAWE,CAAAA,CAAM,QAAA,CAC1B,GAAGA,CAAAA,CAEH,QAAA,CAAA,CAAAF,CAAAA,EACCO,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAU,qFAAA,CAAsF,CAAA,CAEtG,CAACP,CAAAA,EAAWC,CAAAA,EAAQM,6BAAAA,MAAC,CAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,QAAA,CAAAN,CAAAA,CAAK,CAAA,CACjDC,CAAAA,CAAM,QAAA,CAAA,CACT,CAGN,CAAA,CACAP,CAAAA,CAAO,WAAA,CAAc,QAAA,CAAA,6BAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-IJVB2BVO.js","sourcesContent":[null,"import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center cursor-pointer justify-center whitespace-nowrap rounded-4xl font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary-accent text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive hover:bg-destructive/90\",\n outline: \"border border-input hover:bg-base-accent text-primary-accent\",\n secondary: \"bg-muted text-primary-accent hover:bg-muted/20\",\n ghost: \"hover:bg-base-accent text-primary-accent\",\n link: \"text-primary-accent underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-8 lg:h-9 px-4 py-2 text-sm\",\n sm: \"h-8 text-xs px-3 py-2\",\n lg: \"h-10 px-8 py-2 text-sm\",\n icon: \"h-8 lg:h-9 w-8 lg:w-9\",\n none: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n icon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n icon,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || props.disabled}\n {...props}\n >\n {loading && (\n <div className=\"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n )}\n {!loading && icon && <span className=\"mr-2\">{icon}</span>}\n {props.children}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as f}from"./chunk-5TVDBV74.mjs";import{a as p}from"./chunk-4LR7SOCY.mjs";import{b as w}from"./chunk-BLHKJHNV.mjs";import{a as i}from"./chunk-S5TKCF6T.mjs";import*as a from"react";import{X as x}from"lucide-react";import{Drawer as l}from"vaul";import{jsx as r,jsxs as d}from"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=p("lg"),b=a.useMemo(()=>({isOpen:e,onClose:o,width:t}),[e,o,t]);return d(v.Provider,{value:b,children:[!m&&r(l.Root,{open:e,onOpenChange:D=>{D||o()},direction:"left",children:d(l.Portal,{children:[r(l.Overlay,{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm"}),d(l.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:[r(l.Title,{className:"sr-only",children:"Drawer"}),s]})]})}),m&&d("div",{ref:c,className:"group/drawer peer","data-state":e?"open":"closed",...n,children:[r("div",{className:i("relative bg-sidebar transition-[width] duration-200 ease-linear",e?"":"w-0"),style:{width:e?t:"0"}}),r("div",{ref:u,className:i("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:r("div",{"data-drawer":"drawer",className:"flex h-full w-full flex-col",children:r("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 d("div",{ref:n,"data-drawer":"header",className:i("flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border",e),...s,children:[r("div",{className:"flex-1",children:t}),o&&d(w,{variant:"secondary",size:"icon",onClick:c,className:"h-8 w-8 shrink-0 rounded-full",children:[r(x,{size:16}),r("span",{className:"sr-only",children:"Close drawer"})]})]})});C.displayName="DrawerHeader";var N=a.forwardRef(({className:e,...o},t)=>r("h2",{ref:t,className:i("text-lg font-semibold text-primary-accent",e),...o}));N.displayName="DrawerTitle";var g=a.forwardRef(({className:e,children:o,...t},s)=>r(f,{className:"flex-1",ref:s,children:r("div",{"data-drawer":"body",className:i("p-4",e),...t,children:o})}));g.displayName="DrawerBody";var P=a.forwardRef(({className:e,...o},t)=>r("div",{ref:t,"data-drawer":"footer",className:i("flex flex-col gap-2 p-4 border-t border-sidebar-border",e),...o}));P.displayName="DrawerFooter";export{h as a,y as b,C as c,N as d,g as e,P as f};
3
- //# sourceMappingURL=chunk-DKMCJGI4.mjs.map
2
+ import{a as f}from"./chunk-5TVDBV74.mjs";import{a as p}from"./chunk-4LR7SOCY.mjs";import{b as w}from"./chunk-QZKQORLQ.mjs";import{a as i}from"./chunk-S5TKCF6T.mjs";import*as a from"react";import{X as x}from"lucide-react";import{Drawer as l}from"vaul";import{jsx as r,jsxs as d}from"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=p("lg"),b=a.useMemo(()=>({isOpen:e,onClose:o,width:t}),[e,o,t]);return d(v.Provider,{value:b,children:[!m&&r(l.Root,{open:e,onOpenChange:D=>{D||o()},direction:"left",children:d(l.Portal,{children:[r(l.Overlay,{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm"}),d(l.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:[r(l.Title,{className:"sr-only",children:"Drawer"}),s]})]})}),m&&d("div",{ref:c,className:"group/drawer peer","data-state":e?"open":"closed",...n,children:[r("div",{className:i("relative bg-sidebar transition-[width] duration-200 ease-linear",e?"":"w-0"),style:{width:e?t:"0"}}),r("div",{ref:u,className:i("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:r("div",{"data-drawer":"drawer",className:"flex h-full w-full flex-col",children:r("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 d("div",{ref:n,"data-drawer":"header",className:i("flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border",e),...s,children:[r("div",{className:"flex-1",children:t}),o&&d(w,{variant:"secondary",size:"icon",onClick:c,className:"h-8 w-8 shrink-0 rounded-full",children:[r(x,{size:16}),r("span",{className:"sr-only",children:"Close drawer"})]})]})});C.displayName="DrawerHeader";var N=a.forwardRef(({className:e,...o},t)=>r("h2",{ref:t,className:i("text-lg font-semibold text-primary-accent",e),...o}));N.displayName="DrawerTitle";var g=a.forwardRef(({className:e,children:o,...t},s)=>r(f,{className:"flex-1",ref:s,children:r("div",{"data-drawer":"body",className:i("p-4",e),...t,children:o})}));g.displayName="DrawerBody";var P=a.forwardRef(({className:e,...o},t)=>r("div",{ref:t,"data-drawer":"footer",className:i("flex flex-col gap-2 p-4 border-t border-sidebar-border",e),...o}));P.displayName="DrawerFooter";export{h as a,y as b,C as c,N as d,g as e,P as f};
3
+ //# sourceMappingURL=chunk-JD2CTTZW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-JOEQLSHD.js","../src/components/card.tsx"],"names":["roundedMap","blobKeyframes","Card","className","hoverable","rounded","isAnimated","children","props","ref","jsxs","cn","Fragment","jsx","CardHeader","CardTitle","CardDescription","CardContent","CardFooter"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECDhB,+CAsEf,IA5DFA,CAAAA,CAAa,CACjB,OAAA,CAAS,aAAA,CACT,EAAA,CAAI,aACN,CAAA,CAEMC,CAAAA,CAAgB,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CA+BhBC,CAAAA,aAAa,CAAA,CAAA,UAAA,CACjB,CACE,CACE,SAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,CAAA,CAAA,CACZ,OAAA,CAAAC,CAAAA,CAAU,SAAA,CACV,UAAA,CAAAC,CAAAA,CAAa,CAAA,CAAA,CACb,QAAA,CAAAC,CAAAA,CACA,G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Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-JOEQLSHD.js","sourcesContent":[null,"import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverable?: boolean\n rounded?: \"default\" | \"sm\"\n isAnimated?: boolean\n}\n\nconst roundedMap = {\n default: \"rounded-3xl\",\n sm: \"rounded-2xl\",\n} as const\n\nconst blobKeyframes = `\n@keyframes blob-float {\n 0%, 100% {\n transform: translate(0%, 0%) scale(1);\n }\n 25% {\n transform: translate(30%, -20%) scale(1.1);\n }\n 50% {\n transform: translate(10%, 20%) scale(0.95);\n }\n 75% {\n transform: translate(-20%, -10%) scale(1.05);\n }\n}\n@keyframes blob-float-reverse {\n 0%, 100% {\n transform: translate(0%, 0%) scale(1);\n }\n 25% {\n transform: translate(-30%, 20%) scale(0.95);\n }\n 50% {\n transform: translate(-10%, -20%) scale(1.1);\n }\n 75% {\n transform: translate(20%, 10%) scale(1.05);\n }\n}\n`\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n hoverable = false,\n rounded = \"default\",\n isAnimated = false,\n children,\n ...props\n },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(\n \"border border-border bg-card text-primary-accent shadow-sm transition-colors\",\n roundedMap[rounded],\n hoverable && \"cursor-pointer hover:bg-secondary\",\n isAnimated && \"relative overflow-hidden\",\n className\n )}\n {...props}\n >\n {isAnimated && (\n <>\n <style>{blobKeyframes}</style>\n <div\n className=\"absolute left-0 top-1/2 -translate-y-1/2 h-40 w-40 rounded-full blur-2xl\"\n style={{\n background: \"rgba(255, 255, 255, 0.2)\",\n animation: \"blob-float 8s ease-in-out infinite\",\n }}\n />\n <div\n className=\"absolute right-0 top-1/2 -translate-y-1/2 h-40 w-40 rounded-full blur-2xl\"\n style={{\n background: \"rgba(255, 255, 255, 0.2)\",\n animation: \"blob-float-reverse 10s ease-in-out infinite\",\n }}\n />\n </>\n )}\n {isAnimated ? <div className=\"relative z-10\">{children}</div> : children}\n </div>\n )\n)\nCard.displayName = \"Card\"\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-3.5\", className)}\n {...props}\n />\n))\nCardHeader.displayName = \"CardHeader\"\n\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\n \"text-2xl font-semibold leading-none tracking-tight\",\n className\n )}\n {...props}\n />\n))\nCardTitle.displayName = \"CardTitle\"\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nCardDescription.displayName = \"CardDescription\"\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-3.5\", className)} {...props} />\n))\nCardContent.displayName = \"CardContent\"\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-3.5\", className)}\n {...props}\n />\n))\nCardFooter.displayName = \"CardFooter\"\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n"]}
1
+ {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-JOEQLSHD.js","../src/components/card.tsx"],"names":["roundedMap","blobKeyframes","Card","className","hoverable","rounded","isAnimated","children","props","ref","jsxs","cn","Fragment","jsx","CardHeader","CardTitle","CardDescription","CardContent","CardFooter"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECDhB,+CA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,6BAAAA,KAAC,CAAA,CAAI,GAAA,CAAKJ,CAAAA,CAAK,SAAA,CAAWE,gCAAAA,OAAG,CAASR,CAAS,CAAA,CAAI,GAAGK,CAAAA,CAAO,CAC9D,CAAA,CACDS,CAAAA,CAAY,WAAA,CAAc,aAAA,CAE1B,IAAMC,CAAAA,CAAmB,CAAA,CAAA,UAAA,CAGvB,CAAC,CAAE,SAAA,CAAAf,CAAAA,CAAW,GAAGK,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BI,6BAAAA,KAAC,CAAA,CACC,GAAA,CAAKJ,CAAAA,CACL,SAAA,CAAWE,gCAAAA,yBAAG,CAA2BR,CAAS,CAAA,CACjD,GAAGK,CAAAA,CACN,CACD,CAAA,CACDU,CAAAA,CAAW,WAAA,CAAc,YAAA,CAAA,yFAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-JOEQLSHD.js","sourcesContent":[null,"import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverable?: boolean\n rounded?: \"default\" | \"sm\"\n isAnimated?: boolean\n}\n\nconst roundedMap = {\n default: \"rounded-3xl\",\n sm: \"rounded-2xl\",\n} as const\n\nconst blobKeyframes = `\n@keyframes blob-float {\n 0%, 100% {\n transform: translate(0%, 0%) scale(1);\n }\n 25% {\n transform: translate(30%, -20%) scale(1.1);\n }\n 50% {\n transform: translate(10%, 20%) scale(0.95);\n }\n 75% {\n transform: translate(-20%, -10%) scale(1.05);\n }\n}\n@keyframes blob-float-reverse {\n 0%, 100% {\n transform: translate(0%, 0%) scale(1);\n }\n 25% {\n transform: translate(-30%, 20%) scale(0.95);\n }\n 50% {\n transform: translate(-10%, -20%) scale(1.1);\n }\n 75% {\n transform: translate(20%, 10%) scale(1.05);\n }\n}\n`\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n hoverable = false,\n rounded = \"default\",\n isAnimated = false,\n children,\n ...props\n },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(\n \"border border-border bg-card text-primary-accent shadow-sm transition-colors\",\n roundedMap[rounded],\n hoverable && \"cursor-pointer hover:bg-secondary\",\n isAnimated && \"relative overflow-hidden\",\n className\n )}\n {...props}\n >\n {isAnimated && (\n <>\n <style>{blobKeyframes}</style>\n <div\n className=\"absolute left-0 top-1/2 -translate-y-1/2 h-40 w-40 rounded-full blur-2xl\"\n style={{\n background: \"rgba(255, 255, 255, 0.2)\",\n animation: \"blob-float 8s ease-in-out infinite\",\n }}\n />\n <div\n className=\"absolute right-0 top-1/2 -translate-y-1/2 h-40 w-40 rounded-full blur-2xl\"\n style={{\n background: \"rgba(255, 255, 255, 0.2)\",\n animation: \"blob-float-reverse 10s ease-in-out infinite\",\n }}\n />\n </>\n )}\n {isAnimated ? <div className=\"relative z-10\">{children}</div> : children}\n </div>\n )\n)\nCard.displayName = \"Card\"\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-3.5\", className)}\n {...props}\n />\n))\nCardHeader.displayName = \"CardHeader\"\n\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\n \"text-2xl font-semibold leading-none tracking-tight\",\n className\n )}\n {...props}\n />\n))\nCardTitle.displayName = \"CardTitle\"\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nCardDescription.displayName = \"CardDescription\"\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-3.5\", className)} {...props} />\n))\nCardContent.displayName = \"CardContent\"\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-3.5\", className)}\n {...props}\n />\n))\nCardFooter.displayName = \"CardFooter\"\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as N}from"./chunk-BLHKJHNV.mjs";import{a as p}from"./chunk-S5TKCF6T.mjs";import*as n from"react";import{Upload as T,X as I,File as B}from"lucide-react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var H=n.forwardRef(({accept:o,maxSize:s,multiple:f=!1,onFilesChange:m,error:h,disabled:l,className:D,description:g},y)=>{let[F,d]=n.useState(!1),[i,v]=n.useState([]),c=n.useRef(null),R=e=>{e.preventDefault(),e.stopPropagation(),l||d(!0)},C=e=>{e.preventDefault(),e.stopPropagation(),d(!1)},E=e=>{e.preventDefault(),e.stopPropagation()},U=e=>!(s&&e.size>s),x=e=>{if(!e)return;let t=Array.from(e).filter(U),u=f?[...i,...t]:t.slice(0,1);v(u),m?.(u)},k=e=>{e.preventDefault(),e.stopPropagation(),d(!1),!l&&x(e.dataTransfer.files)},w=()=>{l||c.current?.click()},L=e=>{x(e.target.files),c.current&&(c.current.value="")},M=e=>{let t=i.filter((u,$)=>$!==e);v(t),m?.(t)},b=e=>e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${Math.round(e/(1024*1024))} MB`,P=e=>e.split(",").map(t=>t.trim()).map(t=>t.includes("/*")?t.replace("/*","").toUpperCase():t.startsWith(".")?t.slice(1).toUpperCase():t.includes("/")?t.split("/")[1].toUpperCase():t.toUpperCase());return r("div",{ref:y,className:p("w-full",D),children:[r("div",{onClick:w,onDragEnter:R,onDragLeave:C,onDragOver:E,onDrop:k,className:p("flex my-2 flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background px-6 py-4 text-center transition-all cursor-pointer active:opacity-50",F&&"bg-secondary",h?"border-destructive-foreground":"border-border hover:bg-secondary",l&&"cursor-not-allowed opacity-50"),children:[a("span",{className:N({variant:"outline",size:"icon"}),children:a(T,{size:16,className:p("text-primary-accent")})}),r("div",{className:"flex flex-col gap-1",children:[r("p",{className:"text-sm text-secondary-text",children:[a("span",{className:"text-primary-accent",children:"Click to upload"})," or drag and drop"]}),(o||s)&&r("p",{className:"text-xs text-secondary-text",children:[o&&P(o).join(", "),o&&s&&" ",s&&`up to ${b(s)}`]}),g&&a("p",{className:"text-xs text-secondary-text",children:g})]})]}),a("input",{ref:c,type:"file",accept:o,multiple:f,onChange:L,disabled:l,className:"hidden"}),i.length>0&&a("div",{className:"mt-3 space-y-2",children:i.map((e,t)=>r("div",{className:"flex items-center justify-between rounded-2xl border border-border bg-background px-4 py-2",children:[r("div",{className:"flex items-center gap-3",children:[a(B,{className:"h-5 w-5 text-secondary-text"}),r("div",{className:"flex flex-col",children:[a("span",{className:"text-sm text-primary-accent truncate max-w-[200px]",children:e.name}),a("span",{className:"text-xs text-secondary-text",children:b(e.size)})]})]}),a("button",{type:"button",onClick:()=>M(t),className:"rounded-full p-1 hover:bg-secondary active:opacity-50 transition-colors",children:a(I,{className:"h-4 w-4 text-secondary-text"})})]},`${e.name}-${t}`))})]})});H.displayName="FileUpload";export{H as a};
3
- //# sourceMappingURL=chunk-PD43W3YN.mjs.map
2
+ import{a as N}from"./chunk-QZKQORLQ.mjs";import{a as p}from"./chunk-S5TKCF6T.mjs";import*as n from"react";import{Upload as T,X as I,File as B}from"lucide-react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var H=n.forwardRef(({accept:o,maxSize:s,multiple:f=!1,onFilesChange:m,error:h,disabled:l,className:D,description:g},y)=>{let[F,d]=n.useState(!1),[i,v]=n.useState([]),c=n.useRef(null),R=e=>{e.preventDefault(),e.stopPropagation(),l||d(!0)},C=e=>{e.preventDefault(),e.stopPropagation(),d(!1)},E=e=>{e.preventDefault(),e.stopPropagation()},U=e=>!(s&&e.size>s),x=e=>{if(!e)return;let t=Array.from(e).filter(U),u=f?[...i,...t]:t.slice(0,1);v(u),m?.(u)},k=e=>{e.preventDefault(),e.stopPropagation(),d(!1),!l&&x(e.dataTransfer.files)},w=()=>{l||c.current?.click()},L=e=>{x(e.target.files),c.current&&(c.current.value="")},M=e=>{let t=i.filter((u,$)=>$!==e);v(t),m?.(t)},b=e=>e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${Math.round(e/(1024*1024))} MB`,P=e=>e.split(",").map(t=>t.trim()).map(t=>t.includes("/*")?t.replace("/*","").toUpperCase():t.startsWith(".")?t.slice(1).toUpperCase():t.includes("/")?t.split("/")[1].toUpperCase():t.toUpperCase());return r("div",{ref:y,className:p("w-full",D),children:[r("div",{onClick:w,onDragEnter:R,onDragLeave:C,onDragOver:E,onDrop:k,className:p("flex my-2 flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background px-6 py-4 text-center transition-all cursor-pointer active:opacity-50",F&&"bg-secondary",h?"border-destructive-foreground":"border-border hover:bg-secondary",l&&"cursor-not-allowed opacity-50"),children:[a("span",{className:N({variant:"outline",size:"icon"}),children:a(T,{size:16,className:p("text-primary-accent")})}),r("div",{className:"flex flex-col gap-1",children:[r("p",{className:"text-sm text-secondary-text",children:[a("span",{className:"text-primary-accent",children:"Click to upload"})," or drag and drop"]}),(o||s)&&r("p",{className:"text-xs text-secondary-text",children:[o&&P(o).join(", "),o&&s&&" ",s&&`up to ${b(s)}`]}),g&&a("p",{className:"text-xs text-secondary-text",children:g})]})]}),a("input",{ref:c,type:"file",accept:o,multiple:f,onChange:L,disabled:l,className:"hidden"}),i.length>0&&a("div",{className:"mt-3 space-y-2",children:i.map((e,t)=>r("div",{className:"flex items-center justify-between rounded-2xl border border-border bg-background px-4 py-2",children:[r("div",{className:"flex items-center gap-3",children:[a(B,{className:"h-5 w-5 text-secondary-text"}),r("div",{className:"flex flex-col",children:[a("span",{className:"text-sm text-primary-accent truncate max-w-[200px]",children:e.name}),a("span",{className:"text-xs text-secondary-text",children:b(e.size)})]})]}),a("button",{type:"button",onClick:()=>M(t),className:"rounded-full p-1 hover:bg-secondary active:opacity-50 transition-colors",children:a(I,{className:"h-4 w-4 text-secondary-text"})})]},`${e.name}-${t}`))})]})});H.displayName="FileUpload";export{H as a};
3
+ //# sourceMappingURL=chunk-JYA3425I.mjs.map
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as p}from"./chunk-EOFZPG26.mjs";import{a as d}from"./chunk-S5TKCF6T.mjs";import*as r from"react";import{CalendarIcon as b}from"lucide-react";import{format as C}from"date-fns";import*as e from"@radix-ui/react-popover";import{jsx as t,jsxs as m}from"react/jsx-runtime";var h=e.Root,y=e.Trigger,c=r.forwardRef(({className:o,align:a="start",sideOffset:i=4,...n},s)=>t(e.Portal,{children:t(e.Content,{ref:s,align:a,sideOffset:i,className:d("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[g,l]=r.useState(!1);return m(h,{open:g,onOpenChange:l,children:[t(y,{asChild:!0,children:m("button",{ref:v,type:"button",className:d("flex my-2 h-8 lg: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:[t(b,{className:"mr-2 h-4 w-4"}),o?C(o,P):t("span",{children:i})]})}),t(c,{className:"w-auto p-0 rounded-3xl",align:"start",children:t(p,{mode:"single",selected:o,onSelect:u=>{a?.(u),l(!1)},defaultMonth:o,...f})})]})});R.displayName="DatePicker";export{R as a};
3
+ //# sourceMappingURL=chunk-KN2ZJ5E6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/date-picker.tsx"],"sourcesContent":["\"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-8 lg: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"],"mappings":";kFAEA,UAAYA,MAAW,QACvB,OAAS,gBAAAC,MAAoB,eAC7B,OAAS,UAAAC,MAAc,WACvB,UAAYC,MAAsB,0BAa9B,cAAAC,EA6CM,QAAAC,MA7CN,oBARJ,IAAMC,EAA2B,OAC3BC,EAAkC,UAElCC,EAAuB,aAG3B,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAQ,QAAS,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAC3DT,EAAkB,SAAjB,CACC,SAAAA,EAAkB,UAAjB,CACC,IAAKS,EACL,MAAOH,EACP,WAAYC,EACZ,UAAWG,EACT,+aACAL,CACF,EACC,GAAGG,EACN,EACF,CACD,EACDJ,EAAe,YAA+B,UAAQ,YAetD,IAAMO,EAAmB,aACvB,CACE,CACE,KAAAC,EACA,aAAAC,EACA,YAAAC,EAAc,cACd,SAAAC,EAAW,GACX,UAAAV,EACA,cAAAW,EACA,UAAAC,EAAY,KACd,EACAR,IACG,CACH,GAAM,CAACS,EAAMC,CAAO,EAAU,WAAS,EAAK,EAE5C,OACElB,EAACC,EAAA,CAAQ,KAAMgB,EAAM,aAAcC,EACjC,UAAAnB,EAACG,EAAA,CAAe,QAAO,GACrB,SAAAF,EAAC,UACC,IAAKQ,EACL,KAAK,SACL,UAAWC,EACT,8TACA,CAACE,GAAQ,sBACTP,CACF,EACA,SAAUU,EAEV,UAAAf,EAACoB,EAAA,CAAa,UAAU,eAAe,EACtCR,EAAOS,EAAOT,EAAMK,CAAS,EAAIjB,EAAC,QAAM,SAAAc,EAAY,GACvD,EACF,EACAd,EAACI,EAAA,CAAe,UAAU,yBAAyB,MAAM,QACvD,SAAAJ,EAACsB,EAAA,CACC,KAAK,SACL,SAAUV,EACV,SAAWW,GAAiB,CAC1BV,IAAeU,CAAY,EAC3BJ,EAAQ,EAAK,CACf,EACA,aAAcP,EACb,GAAGI,EACN,EACF,GACF,CAEJ,CACF,EAEAL,EAAW,YAAc","names":["React","CalendarIcon","format","PopoverPrimitive","jsx","jsxs","Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","cn","DatePicker","date","onDateChange","placeholder","disabled","calendarProps","formatStr","open","setOpen","CalendarIcon","format","Calendar","selectedDate"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as z}from"./chunk-NKELJSLY.mjs";import{a as j,b as U,c as X}from"./chunk-FZ3NXOFK.mjs";import{a as E}from"./chunk-S5TKCF6T.mjs";import*as i from"react";import{Check as ne,ChevronDown as G,ChevronRight as ae,Search as se,X as ce}from"lucide-react";import{Fragment as ie,jsx as o,jsxs as x}from"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:x(ie,{children:[e.slice(0,r),o("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),v=a?$(e,r):r.has(e.value)?"checked":"unchecked",A=n*20;return x("div",{role:"treeitem","aria-expanded":V?y:void 0,"aria-selected":v==="checked",children:[x("div",{className:E("relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50","hover:bg-muted",v==="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?o("button",{type:"button",className:"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50",onClick:m=>{m.stopPropagation(),h(e.value)},"aria-label":y?`Collapse ${e.label}`:`Expand ${e.label}`,tabIndex:-1,children:y?o(G,{className:"h-3.5 w-3.5"}):o(ae,{className:"h-3.5 w-3.5"})}):o("span",{className:"h-4 w-4 shrink-0"}),a?o(z,{checked:v==="checked"?!0:v==="indeterminate"?"indeterminate":!1,onCheckedChange:()=>g(e),onClick:m=>m.stopPropagation(),className:"shrink-0","aria-label":e.label}):o(ne,{className:E("h-4 w-4 shrink-0",v==="checked"?"opacity-100":"opacity-0")}),o("span",{className:"truncate",children:oe(e.label,S)})]}),V&&y&&o("div",{role:"group",children:e.children.map(m=>o(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:v,expandAll:A=!1}){let[m,B]=i.useState(!1),[b,K]=i.useState(""),[p,k]=i.useState(null),[D,L]=i.useState(()=>A?Q(e):v?new Set(v):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(()=>b?J(e,b):e,[e,b]);i.useEffect(()=>{if(b){P.current||(P.current=new Set(D));let t=le(e,b);L(t)}else P.current&&(L(P.current),P.current=null)},[b,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]}f?.(c)}else{if(t.children&&t.children.length>0){T(t.value);return}let d=t.value===n?"":t.value;a?.(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));f?.(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=s[c]?.dataset.treeValue;u&&(k(u),s[c]?.focus());break}case"ArrowUp":{t.preventDefault();let c=Math.max(d-1,0),u=s[c]?.dataset.treeValue;u&&(k(u),s[c]?.focus());break}case"ArrowRight":{if(t.preventDefault(),p){let c=N(e,p);if(c?.children?.length)if(!D.has(p))T(p);else{let u=c.children[0].value;k(u),requestAnimationFrame(()=>{O().find(re=>re.dataset.treeValue===u)?.focus()})}}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=s[0]?.dataset.treeValue;c&&(k(c),s[0]?.focus());break}case"End":{t.preventDefault();let c=s[s.length-1]?.dataset.treeValue;c&&(k(c),s[s.length-1]?.focus());break}}},[p,e,D,O,T,H]),ee=()=>r?l.length===0?h:l.length===1?N(e,l[0])?.label??l[0]:`${l.length} selected`:n?N(e,n)?.label??n:h,te=()=>{if(!r||q.length===0)return null;let t=q.map(s=>N(e,s)).filter(Boolean);return o("div",{className:"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border",children:o("div",{className:"flex flex-wrap gap-1",children:t.map(s=>x("div",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs",children:[o("span",{className:"truncate max-w-[120px]",children:s.label}),o(ce,{className:"h-3 w-3 cursor-pointer shrink-0",onClick:d=>Z(s.value,d),"aria-label":`Remove ${s.label}`})]},s.value))})})};return x(j,{open:m,onOpenChange:Y,children:[o(U,{asChild:!0,children:x("button",{type:"button",role:"combobox","aria-expanded":m,"aria-haspopup":"tree",disabled:S,className:E("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 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50",!n&&!l.length&&"text-secondary-text",y&&"border-destructive-foreground focus-visible:ring-destructive-foreground",V),children:[o("span",{className:"truncate",children:ee()}),o(G,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),x(X,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:[x("div",{className:"flex items-center border-b px-3",children:[o(se,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o("input",{value:b,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(),o("div",{className:"max-h-[300px] overflow-y-auto",children:F&&F.length>0?o("div",{ref:I,role:"tree","aria-label":"Options",className:"p-1",onKeyDown:_,children:F.map(t=>o(W,{node:t,depth:0,multiple:r,selectedSet:C,expandedValues:D,focusedValue:p,onToggleExpand:T,onSelect:H,onFocus:k,searchTerm:b},t.value))}):o("div",{className:"py-6 text-center text-sm text-muted-foreground",children:w})})]})]})}export{ge as a};
3
- //# sourceMappingURL=chunk-574USYNO.mjs.map
2
+ import{a as z}from"./chunk-NKELJSLY.mjs";import{a as j,b as U,c as X}from"./chunk-FZ3NXOFK.mjs";import{a as E}from"./chunk-S5TKCF6T.mjs";import*as i from"react";import{Check as ne,ChevronDown as G,ChevronRight as ae,Search as se,X as ce}from"lucide-react";import{Fragment as ie,jsx as o,jsxs as x}from"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:x(ie,{children:[e.slice(0,r),o("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),v=a?$(e,r):r.has(e.value)?"checked":"unchecked",A=n*20;return x("div",{role:"treeitem","aria-expanded":V?y:void 0,"aria-selected":v==="checked",children:[x("div",{className:E("relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50","hover:bg-muted",v==="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?o("button",{type:"button",className:"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50",onClick:m=>{m.stopPropagation(),h(e.value)},"aria-label":y?`Collapse ${e.label}`:`Expand ${e.label}`,tabIndex:-1,children:y?o(G,{className:"h-3.5 w-3.5"}):o(ae,{className:"h-3.5 w-3.5"})}):o("span",{className:"h-4 w-4 shrink-0"}),a?o(z,{checked:v==="checked"?!0:v==="indeterminate"?"indeterminate":!1,onCheckedChange:()=>g(e),onClick:m=>m.stopPropagation(),className:"shrink-0","aria-label":e.label}):o(ne,{className:E("h-4 w-4 shrink-0",v==="checked"?"opacity-100":"opacity-0")}),o("span",{className:"truncate",children:oe(e.label,S)})]}),V&&y&&o("div",{role:"group",children:e.children.map(m=>o(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:v,expandAll:A=!1}){let[m,B]=i.useState(!1),[b,K]=i.useState(""),[p,k]=i.useState(null),[D,L]=i.useState(()=>A?Q(e):v?new Set(v):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(()=>b?J(e,b):e,[e,b]);i.useEffect(()=>{if(b){P.current||(P.current=new Set(D));let t=le(e,b);L(t)}else P.current&&(L(P.current),P.current=null)},[b,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]}f?.(c)}else{if(t.children&&t.children.length>0){T(t.value);return}let d=t.value===n?"":t.value;a?.(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));f?.(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=s[c]?.dataset.treeValue;u&&(k(u),s[c]?.focus());break}case"ArrowUp":{t.preventDefault();let c=Math.max(d-1,0),u=s[c]?.dataset.treeValue;u&&(k(u),s[c]?.focus());break}case"ArrowRight":{if(t.preventDefault(),p){let c=N(e,p);if(c?.children?.length)if(!D.has(p))T(p);else{let u=c.children[0].value;k(u),requestAnimationFrame(()=>{O().find(re=>re.dataset.treeValue===u)?.focus()})}}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=s[0]?.dataset.treeValue;c&&(k(c),s[0]?.focus());break}case"End":{t.preventDefault();let c=s[s.length-1]?.dataset.treeValue;c&&(k(c),s[s.length-1]?.focus());break}}},[p,e,D,O,T,H]),ee=()=>r?l.length===0?h:l.length===1?N(e,l[0])?.label??l[0]:`${l.length} selected`:n?N(e,n)?.label??n:h,te=()=>{if(!r||q.length===0)return null;let t=q.map(s=>N(e,s)).filter(Boolean);return o("div",{className:"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border",children:o("div",{className:"flex flex-wrap gap-1",children:t.map(s=>x("div",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs",children:[o("span",{className:"truncate max-w-[120px]",children:s.label}),o(ce,{className:"h-3 w-3 cursor-pointer shrink-0",onClick:d=>Z(s.value,d),"aria-label":`Remove ${s.label}`})]},s.value))})})};return x(j,{open:m,onOpenChange:Y,children:[o(U,{asChild:!0,children:x("button",{type:"button",role:"combobox","aria-expanded":m,"aria-haspopup":"tree",disabled:S,className:E("cursor-pointer flex my-2 h-8 lg: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 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50",!n&&!l.length&&"text-secondary-text",y&&"border-destructive-foreground focus-visible:ring-destructive-foreground",V),children:[o("span",{className:"truncate",children:ee()}),o(G,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),x(X,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:[x("div",{className:"flex items-center border-b px-3",children:[o(se,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o("input",{value:b,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(),o("div",{className:"max-h-[300px] overflow-y-auto",children:F&&F.length>0?o("div",{ref:I,role:"tree","aria-label":"Options",className:"p-1",onKeyDown:_,children:F.map(t=>o(W,{node:t,depth:0,multiple:r,selectedSet:C,expandedValues:D,focusedValue:p,onToggleExpand:T,onSelect:H,onFocus:k,searchTerm:b},t.value))}):o("div",{className:"py-6 text-center text-sm text-muted-foreground",children:w})})]})]})}export{ge as a};
3
+ //# sourceMappingURL=chunk-MKZJL4AD.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/tree-select.tsx"],"sourcesContent":["\"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 active:opacity-50\",\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 active:opacity-50\"\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 active:opacity-50 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"],"mappings":";yIAEA,UAAYA,MAAW,QACvB,OAAS,SAAAC,GAAO,eAAAC,EAAa,gBAAAC,GAAc,UAAAC,GAAQ,KAAAC,OAAS,eAgKxD,mBAAAC,GAEE,OAAAC,EAFF,QAAAC,MAAA,oBA3HJ,SAASC,EAAuBC,EAAgC,CAC9D,IAAMC,EAAmB,CAACD,EAAK,KAAK,EACpC,GAAI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CAAO,UAAU,mCAAmC,EACrD1G,EAAC,SACC,MAAOa,EACP,SAAW8B,GAAMkB,EAAclB,EAAE,OAAO,KAAK,EAC7C,YAAaS,EACb,UAAU,yJACV,aAAW,cACb,GACF,EAECgD,GAAoB,EAErBpG,EAAC,OAAI,UAAU,gCACZ,SAAAkE,GAAiBA,EAAc,OAAS,EACvClE,EAAC,OACC,IAAKiE,EACL,KAAK,OACL,aAAW,UACX,UAAU,MACV,UAAWsB,EAEV,SAAArB,EAAc,IAAK/D,GAClBH,EAAC8B,EAAA,CAEC,KAAM3B,EACN,MAAO,EACP,SAAU6B,EACV,YAAazB,EACb,eAAgB0B,EAChB,aAAcC,EACd,eAAgBoC,EAChB,SAAUI,EACV,QAASZ,EACT,WAAYjD,GAVPV,EAAK,KAWZ,CACD,EACH,EAEAH,EAAC,OAAI,UAAU,iDACZ,SAAAqD,EACH,EAEJ,GACF,GACF,CAEJ","names":["React","Check","ChevronDown","ChevronRight","Search","X","Fragment","jsx","jsxs","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","TreeNodeItem","depth","multiple","expandedValues","focusedValue","onToggleExpand","onSelect","onFocus","hasChildren","isExpanded","checkState","indentPx","cn","e","ChevronDown","ChevronRight","Checkbox","Check","TreeSelect","onValueChange","onValuesChange","placeholder","searchPlaceholder","emptyMessage","disabled","className","error","defaultExpandedValues","expandAll","open","setOpen","setSearchTerm","setFocusedValue","setExpandedValues","preSearchExpandedRef","treeRef","filteredNodes","matchingAncestors","handleOpenChange","isOpen","handleToggleExpand","nodeValue","prev","next","handleSelect","allDescendants","currentState","newValues","toRemove","toAdd","newValue","handleRemoveChip","chipValue","chipValues","chips","state","getVisibleNodes","handleTreeKeyDown","visibleNodes","currentIndex","el","nextIndex","nextValue","prevIndex","prevValue","firstChildValue","n","firstValue","lastValue","getDisplayText","renderSelectedChips","chipNodes","X","Popover","PopoverTrigger","PopoverContent","Search"]}
1
+ {"version":3,"sources":["../src/components/tree-select.tsx"],"sourcesContent":["\"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 active:opacity-50\",\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 active:opacity-50\"\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-8 lg: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 active:opacity-50 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"],"mappings":";yIAEA,UAAYA,MAAW,QACvB,OAAS,SAAAC,GAAO,eAAAC,EAAa,gBAAAC,GAAc,UAAAC,GAAQ,KAAAC,OAAS,eAgKxD,mBAAAC,GAEE,OAAA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,MACV,MAAM,QACN,MAAO,CAAE,MAAO,oCAAqC,EAErD,UAAAxG,EAAC,OAAI,UAAU,kCACb,UAAAD,EAAC0G,GAAA,CAAO,UAAU,mCAAmC,EACrD1G,EAAC,SACC,MAAOa,EACP,SAAW8B,GAAMkB,EAAclB,EAAE,OAAO,KAAK,EAC7C,YAAaS,EACb,UAAU,yJACV,aAAW,cACb,GACF,EAECgD,GAAoB,EAErBpG,EAAC,OAAI,UAAU,gCACZ,SAAAkE,GAAiBA,EAAc,OAAS,EACvClE,EAAC,OACC,IAAKiE,EACL,KAAK,OACL,aAAW,UACX,UAAU,MACV,UAAWsB,EAEV,SAAArB,EAAc,IAAK/D,GAClBH,EAAC8B,EAAA,CAEC,KAAM3B,EACN,MAAO,EACP,SAAU6B,EACV,YAAazB,EACb,eAAgB0B,EAChB,aAAcC,EACd,eAAgBoC,EAChB,SAAUI,EACV,QAASZ,EACT,WAAYjD,GAVPV,EAAK,KAWZ,CACD,EACH,EAEAH,EAAC,OAAI,UAAU,iDACZ,SAAAqD,EACH,EAEJ,GACF,GACF,CAEJ","names":["React","Check","ChevronDown","ChevronRight","Search","X","Fragment","jsx","jsxs","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","TreeNodeItem","depth","multiple","expandedValues","focusedValue","onToggleExpand","onSelect","onFocus","hasChildren","isExpanded","checkState","indentPx","cn","e","ChevronDown","ChevronRight","Checkbox","Check","TreeSelect","onValueChange","onValuesChange","placeholder","searchPlaceholder","emptyMessage","disabled","className","error","defaultExpandedValues","expandAll","open","setOpen","setSearchTerm","setFocusedValue","setExpandedValues","preSearchExpandedRef","treeRef","filteredNodes","matchingAncestors","handleOpenChange","isOpen","handleToggleExpand","nodeValue","prev","next","handleSelect","allDescendants","currentState","newValues","toRemove","toAdd","newValue","handleRemoveChip","chipValue","chipValues","chips","state","getVisibleNodes","handleTreeKeyDown","visibleNodes","currentIndex","el","nextIndex","nextValue","prevIndex","prevValue","firstChildValue","n","firstValue","lastValue","getDisplayText","renderSelectedChips","chipNodes","X","Popover","PopoverTrigger","PopoverContent","Search"]}
@@ -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 _chunkGRXC46JCjs = require('./chunk-GRXC46JC.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, _chunkGRXC46JCjs.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-DHHZMQ72.js.map
2
+ var _chunk3DUPSGEYjs = require('./chunk-3DUPSGEY.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 h=e.Root,y=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[g,l]=r.useState(!1);return _jsxruntime.jsxs.call(void 0, h,{open:g,onOpenChange:l,children:[_jsxruntime.jsx.call(void 0, y,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{ref:v,type:"button",className:_chunkFUYXCJOQjs.a.call(void 0, "flex my-2 h-8 lg: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, _chunk3DUPSGEYjs.a,{mode:"single",selected:o,onSelect:u=>{_optionalChain([a, 'optionalCall', _ => _(u)]),l(!1)},defaultMonth:o,...f})})]})});R.displayName="DatePicker";exports.a = R;
3
+ //# sourceMappingURL=chunk-NCBOTFZQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-NCBOTFZQ.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,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,aAAA,CACd,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,SAAA,CAAAX,CAAAA,CACA,aAAA,CAAAY,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,KACd,CAAA,CACAT,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\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-8 lg: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 client";
2
+ import{a}from"./chunk-S5TKCF6T.mjs";import*as e from"@radix-ui/react-tabs";import{forwardRef as o,useCallback as g,useEffect as p,useRef as T,useState as R}from"react";import{jsx as l,jsxs as w}from"react/jsx-runtime";var C=e.Root,y=o(({className:r,...s},t)=>{let[c,d]=R({left:0,width:0}),n=T(null);p(()=>{let i=()=>{if(!n.current)return;let f=n.current.querySelector('[data-state="active"]');if(f){let v=n.current.getBoundingClientRect(),m=f.getBoundingClientRect();d({left:m.left-v.left,width:m.width})}};i();let u=new MutationObserver(i);return n.current&&u.observe(n.current,{attributes:!0,attributeFilter:["data-state"],subtree:!0}),window.addEventListener("resize",i),()=>{u.disconnect(),window.removeEventListener("resize",i)}},[]);let b=g(i=>{n.current=i,typeof t=="function"?t(i):t&&(t.current=i)},[t]);return w(e.List,{ref:b,className:a("relative inline-flex h-8 lg:h-9 items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground ",r),...s,children:[l("span",{className:"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out",style:{left:`${c.left}px`,width:`${c.width}px`}}),s.children]})});y.displayName=e.List.displayName;var P=o(({className:r,...s},t)=>l(e.Trigger,{ref:t,className:a("cursor-pointer relative inline-flex h-6 lg:h-7 items-center justify-center whitespace-nowrap data-[state=inactive]:not-disabled:hover:bg-secondary rounded-4xl px-3 text-sm font-medium ring-offset-background transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=active]:text-foreground z-10",r),...s}));P.displayName=e.Trigger.displayName;var h=o(({className:r,...s},t)=>l(e.Content,{ref:t,className:a("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...s}));h.displayName=e.Content.displayName;export{C as a,y as b,P as c,h as d};
3
+ //# sourceMappingURL=chunk-NU2US7UW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/tabs.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\nimport { forwardRef, useCallback, useEffect, useRef, useState } from \"react\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const [indicatorStyle, setIndicatorStyle] = useState({\n left: 0,\n width: 0,\n })\n const listRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const updateIndicator = () => {\n if (!listRef.current) return\n\n const activeTab = listRef.current.querySelector(\n '[data-state=\"active\"]'\n ) as HTMLElement\n\n if (activeTab) {\n const listRect = listRef.current.getBoundingClientRect()\n const tabRect = activeTab.getBoundingClientRect()\n\n setIndicatorStyle({\n left: tabRect.left - listRect.left,\n width: tabRect.width,\n })\n }\n }\n\n updateIndicator()\n\n // Use MutationObserver to detect when data-state changes\n const observer = new MutationObserver(updateIndicator)\n\n if (listRef.current) {\n observer.observe(listRef.current, {\n attributes: true,\n attributeFilter: [\"data-state\"],\n subtree: true,\n })\n }\n\n // Also update on window resize\n window.addEventListener(\"resize\", updateIndicator)\n\n return () => {\n observer.disconnect()\n window.removeEventListener(\"resize\", updateIndicator)\n }\n }, [])\n\n // Combine refs\n const combinedRef = useCallback(\n (node: HTMLDivElement | null) => {\n ;(listRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n\n if (typeof ref === \"function\") {\n ref(node)\n } else if (ref) {\n ;(ref as React.MutableRefObject<HTMLDivElement | null>).current = node\n }\n },\n [ref]\n )\n\n return (\n <TabsPrimitive.List\n ref={combinedRef}\n className={cn(\n \"relative inline-flex h-8 lg:h-9 items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground \",\n className\n )}\n {...props}\n >\n {/* Animated indicator */}\n <span\n className=\"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out\"\n style={{\n left: `${indicatorStyle.left}px`,\n width: `${indicatorStyle.width}px`,\n }}\n />\n {props.children}\n </TabsPrimitive.List>\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"cursor-pointer relative inline-flex h-6 lg:h-7 items-center justify-center whitespace-nowrap data-[state=inactive]:not-disabled:hover:bg-secondary rounded-4xl px-3 text-sm font-medium ring-offset-background transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=active]:text-foreground z-10\",\n className\n )}\n {...props}\n />\n))\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n )}\n {...props}\n />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],"mappings":";oCAAA,UAAYA,MAAmB,uBAG/B,OAAS,cAAAC,EAAY,eAAAC,EAAa,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QAsEjE,OASE,OAAAC,EATF,QAAAC,MAAA,oBApEJ,IAAMC,EAAqB,OAErBC,EAAWR,EAGf,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAAQ,CAClC,GAAM,CAACC,EAAgBC,CAAiB,EAAIT,EAAS,CACnD,KAAM,EACN,MAAO,CACT,CAAC,EACKU,EAAUX,EAAuB,IAAI,EAE3CD,EAAU,IAAM,CACd,IAAMa,EAAkB,IAAM,CAC5B,GAAI,CAACD,EAAQ,QAAS,OAEtB,IAAME,EAAYF,EAAQ,QAAQ,cAChC,uBACF,EAEA,GAAIE,EAAW,CACb,IAAMC,EAAWH,EAAQ,QAAQ,sBAAsB,EACjDI,EAAUF,EAAU,sBAAsB,EAEhDH,EAAkB,CAChB,KAAMK,EAAQ,KAAOD,EAAS,KAC9B,MAAOC,EAAQ,KACjB,CAAC,CACH,CACF,EAEAH,EAAgB,EAGhB,IAAMI,EAAW,IAAI,iBAAiBJ,CAAe,EAErD,OAAID,EAAQ,SACVK,EAAS,QAAQL,EAAQ,QAAS,CAChC,WAAY,GACZ,gBAAiB,CAAC,YAAY,EAC9B,QAAS,EACX,CAAC,EAIH,OAAO,iBAAiB,SAAUC,CAAe,EAE1C,IAAM,CACXI,EAAS,WAAW,EACpB,OAAO,oBAAoB,SAAUJ,CAAe,CACtD,CACF,EAAG,CAAC,CAAC,EAGL,IAAMK,EAAcnB,EACjBoB,GAAgC,CAC7BP,EAA0D,QAAUO,EAElE,OAAOV,GAAQ,WACjBA,EAAIU,CAAI,EACCV,IACPA,EAAsD,QAAUU,EAEtE,EACA,CAACV,CAAG,CACN,EAEA,OACEL,EAAe,OAAd,CACC,IAAKc,EACL,UAAWE,EACT,oHACAb,CACF,EACC,GAAGC,EAGJ,UAAAL,EAAC,QACC,UAAU,0GACV,MAAO,CACL,KAAM,GAAGO,EAAe,IAAI,KAC5B,MAAO,GAAGA,EAAe,KAAK,IAChC,EACF,EACCF,EAAM,UACT,CAEJ,CAAC,EACDF,EAAS,YAA4B,OAAK,YAE1C,IAAMe,EAAcvB,EAGlB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1BN,EAAe,UAAd,CACC,IAAKM,EACL,UAAWW,EACT,+bACAb,CACF,EACC,GAAGC,EACN,CACD,EACDa,EAAY,YAA4B,UAAQ,YAEhD,IAAMC,EAAcxB,EAGlB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1BN,EAAe,UAAd,CACC,IAAKM,EACL,UAAWW,EACT,kIACAb,CACF,EACC,GAAGC,EACN,CACD,EACDc,EAAY,YAA4B,UAAQ","names":["TabsPrimitive","forwardRef","useCallback","useEffect","useRef","useState","jsx","jsxs","Tabs","TabsList","className","props","ref","indicatorStyle","setIndicatorStyle","listRef","updateIndicator","activeTab","listRect","tabRect","observer","combinedRef","node","cn","TabsTrigger","TabsContent"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as o}from"./chunk-S5TKCF6T.mjs";import*as s from"react";import{ChevronRight as c,MoreHorizontal as m}from"lucide-react";import{jsx as t,jsxs as b}from"react/jsx-runtime";var i=s.forwardRef(({...a},e)=>t("nav",{ref:e,"aria-label":"breadcrumb",...a}));i.displayName="Breadcrumb";var l=s.forwardRef(({className:a,...e},r)=>t("ol",{ref:r,className:o("flex flex-wrap items-center gap-1.5 break-words text-sm text-secondary-text sm:gap-2.5",a),...e}));l.displayName="BreadcrumbList";var p=s.forwardRef(({className:a,...e},r)=>t("li",{ref:r,className:o("inline-flex items-center gap-1.5",a),...e}));p.displayName="BreadcrumbItem";var d=s.forwardRef(({asChild:a,className:e,...r},n)=>t("a",{ref:n,className:o("transition-colors hover:text-hover-link active:opacity-50",e),...r}));d.displayName="BreadcrumbLink";var f=s.forwardRef(({className:a,...e},r)=>t("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:o("font-normal text-primary-accent",a),...e}));f.displayName="BreadcrumbPage";var R=({children:a,className:e,...r})=>t("li",{role:"presentation","aria-hidden":"true",className:o("[&>svg]:size-3.5",e),...r,children:a??t(c,{})});R.displayName="BreadcrumbSeparator";var u=({className:a,...e})=>b("span",{role:"presentation","aria-hidden":"true",className:o("flex h-9 w-9 items-center justify-center",a),...e,children:[t(m,{className:"h-4 w-4"}),t("span",{className:"sr-only",children:"More"})]});u.displayName="BreadcrumbEllipsis";export{i as a,l as b,p as c,d,f as e,R as f,u as g};
3
- //# sourceMappingURL=chunk-AQZWRJVJ.mjs.map
2
+ import{a as o}from"./chunk-S5TKCF6T.mjs";import*as s from"react";import{ChevronRight as c,MoreHorizontal as m}from"lucide-react";import{jsx as t,jsxs as b}from"react/jsx-runtime";var i=s.forwardRef(({...a},e)=>t("nav",{ref:e,"aria-label":"breadcrumb",...a}));i.displayName="Breadcrumb";var l=s.forwardRef(({className:a,...e},r)=>t("ol",{ref:r,className:o("flex flex-wrap items-center gap-1.5 break-words text-sm text-secondary-text sm:gap-2.5",a),...e}));l.displayName="BreadcrumbList";var p=s.forwardRef(({className:a,...e},r)=>t("li",{ref:r,className:o("inline-flex items-center gap-1.5",a),...e}));p.displayName="BreadcrumbItem";var d=s.forwardRef(({asChild:a,className:e,...r},n)=>t("a",{ref:n,className:o("transition-colors hover:text-hover-link active:opacity-50",e),...r}));d.displayName="BreadcrumbLink";var f=s.forwardRef(({className:a,...e},r)=>t("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:o("font-normal text-primary-accent",a),...e}));f.displayName="BreadcrumbPage";var R=({children:a,className:e,...r})=>t("li",{role:"presentation","aria-hidden":"true",className:o("[&>svg]:size-3.5",e),...r,children:a??t(c,{})});R.displayName="BreadcrumbSeparator";var u=({className:a,...e})=>b("span",{role:"presentation","aria-hidden":"true",className:o("flex h-8 lg:h-9 w-8 lg:w-9 items-center justify-center",a),...e,children:[t(m,{className:"h-4 w-4"}),t("span",{className:"sr-only",children:"More"})]});u.displayName="BreadcrumbEllipsis";export{i as a,l as b,p as c,d,f as e,R as f,u as g};
3
+ //# sourceMappingURL=chunk-OLF2HLRF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />)\nBreadcrumb.displayName = \"Breadcrumb\"\n\nconst BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-secondary-text sm:gap-2.5\",\n className\n )}\n {...props}\n />\n))\nBreadcrumbList.displayName = \"BreadcrumbList\"\n\nconst BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n))\nBreadcrumbItem.displayName = \"BreadcrumbItem\"\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = \"a\"\n\n return (\n <Comp\n ref={ref}\n className={cn(\n \"transition-colors hover:text-hover-link active:opacity-50\",\n className\n )}\n {...props}\n />\n )\n})\nBreadcrumbLink.displayName = \"BreadcrumbLink\"\n\nconst BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-primary-accent\", className)}\n {...props}\n />\n))\nBreadcrumbPage.displayName = \"BreadcrumbPage\"\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n)\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\"\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"flex h-8 lg:h-9 w-8 lg:w-9 items-center justify-center\",\n className\n )}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n)\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\"\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n}\n"],"mappings":";yCAAA,UAAYA,MAAW,QACvB,OAAS,gBAAAC,EAAc,kBAAAC,MAAsB,eASpB,cAAAC,EAsFvB,QAAAC,MAtFuB,oBALzB,IAAMC,EAAmB,aAKvB,CAAC,CAAE,GAAGC,CAAM,EAAGC,IAAQJ,EAAC,OAAI,IAAKI,EAAK,aAAW,aAAc,GAAGD,EAAO,CAAE,EAC7ED,EA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ChevronRight","MoreHorizontal","jsx","jsxs","Breadcrumb","props","ref","BreadcrumbList","className","cn","BreadcrumbItem","BreadcrumbLink","asChild","BreadcrumbPage","BreadcrumbSeparator","children","ChevronRight","BreadcrumbEllipsis","MoreHorizontal"]}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as E,b as I,c as D}from"./chunk-FZ3NXOFK.mjs";import{a as G,c as T,d as L,e as B,f as y,h as H}from"./chunk-4DRIPZWE.mjs";import{a as g}from"./chunk-S5TKCF6T.mjs";import*as v from"react";import{Check as ee,ChevronDown as oe,Plus as te,X as z}from"lucide-react";import{Fragment as A,jsx as o,jsxs as a}from"react/jsx-runtime";function ne({selectedOptions:m,onRemove:s,showRemoveIcon:p=!0,disabled:b=!1,className:d,chipClassName:x}){if(m.length===0)return null;let h=(t,c)=>{c.preventDefault(),c.stopPropagation(),s?.(t)};return o(A,{children:m.map(t=>a("div",{className:g("inline-flex items-center gap-2 rounded-3xl border bg-transparent px-2 lg:px-3 py-1.5 text-sm",b&&"opacity-50 cursor-not-allowed pointer-events-none",d,x),style:{borderColor:t.color||"var(--border)"},children:[o("span",{className:"truncate text-xs font-medium",style:{color:t.color},children:t.label}),p&&!b&&s&&o("button",{type:"button",onClick:c=>h(t.value,c),children:o(z,{className:"size-3.5 cursor-pointer opacity-70 hover:opacity-100",style:{color:t.color}})})]},t.value))})}function ie({options:m=[],groups:s,value:p,onValueChange:b,placeholder:d="Select option...",searchPlaceholder:x="Search...",emptyMessage:h="No option found.",disabled:t=!1,disableLabelControls:c=!1,className:W,error:X=!1,multiple:$=!1,values:l=[],onValuesChange:C,variant:j="default",searchable:q=!0,onTriggerClick:w,showChipRemoveIcon:F=!0,triggerProps:J,externalChipsOnly:K=!1}){let[N,P]=v.useState(!1),n=j==="metrics",f=n?!0:$,R=v.useMemo(()=>s?s.flatMap(e=>e.options):m,[s,m]),k=R.find(e=>e.value===p),i=R.filter(e=>l.includes(e.value)),Q=e=>{if(f){let r=l.includes(e)?l.filter(u=>u!==e):[...l,e];C?.(r)}else b?.(e===p?"":e),P(!1)},U=(e,r)=>{r.preventDefault(),r.stopPropagation();let u=l.filter(_=>_!==e);C?.(u)},V=()=>n?d:f?i.length===0?d:i.length===1?i[0].label:`${i.length} selected`:k?k.label:d,O=e=>{let r=f?l.includes(e.value):p===e.value;return a(H,{value:e.value,onSelect:Q,className:"rounded-[12px]",children:[o("span",{className:"truncate",children:e.label}),o(ee,{className:g("ml-auto h-4 w-4 shrink-0",r?"opacity-100":"opacity-0")})]},e.value)},M=()=>n||!f||i.length===0?null:o("div",{className:"px-2 py-1.5",children:o("div",{className:"flex flex-wrap gap-1",children:i.map(e=>a("div",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs",children:[o("span",{className:"truncate",children:e.label}),o(z,{className:"h-3 w-3 cursor-pointer",onClick:r=>U(e.value,r)})]},e.value))})}),Y=()=>{if(!n||K||i.length===0)return null;let e=F&&!t&&!c;return o(ne,{selectedOptions:i,onRemove:e?Z:void 0,showRemoveIcon:e,disabled:t||c})},Z=e=>{let r=l.filter(u=>u!==e);C?.(r)},S=a(E,{open:N,onOpenChange:P,children:[o(I,{asChild:!0,children:a("button",{type:"button",role:"combobox","aria-expanded":N,disabled:t,...J,onClick:w?e=>{e.preventDefault(),w()}:void 0,className:g("cursor-pointer flex h-8 lg:h-9 items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-2 lg: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 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50",!n&&"my-2 w-full",n&&"w-auto gap-2",!p&&!l.length&&"text-secondary-text",X&&"border-destructive-foreground focus-visible:ring-destructive-foreground",n&&"bg-muted text-primary-accent hover:bg-muted/20 border-muted text-xs font-medium",W),children:[n&&o(te,{className:"h-4 w-4 shrink-0"}),o("span",{className:"truncate",children:V()}),!n&&o(oe,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o(D,{className:"overflow-hidden rounded-xl p-0",align:"start",style:n?{minWidth:200}:{width:"var(--radix-popover-trigger-width)"},children:a(G,{children:[q&&o(T,{placeholder:x}),a(L,{children:[o(B,{children:h}),s?a(A,{children:[M(),s.map(e=>o(y,{heading:e.label,children:e.options.map(O)},e.label))]}):a(y,{children:[M(),m.map(O)]})]})]})})]});return n?a("div",{className:"flex flex-wrap items-center gap-2",children:[S,Y()]}):S}export{ne as a,ie as b};
3
+ //# sourceMappingURL=chunk-QOEM7ZRV.mjs.map