@constructive-io/ui 0.4.1 → 0.6.1

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 (415) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -22
  3. package/dist/button-D4vqTxhp.d.cts +20 -0
  4. package/dist/button-D4vqTxhp.d.ts +20 -0
  5. package/dist/components/alert-dialog.cjs +129 -0
  6. package/dist/components/alert-dialog.cjs.map +1 -0
  7. package/dist/components/alert-dialog.d.cts +33 -0
  8. package/dist/components/alert-dialog.d.ts +23 -21
  9. package/dist/components/alert-dialog.js +98 -296
  10. package/dist/components/alert-dialog.js.map +1 -1
  11. package/dist/components/alert.cjs +62 -0
  12. package/dist/components/alert.cjs.map +1 -0
  13. package/dist/components/alert.d.cts +19 -0
  14. package/dist/components/alert.d.ts +18 -13
  15. package/dist/components/alert.js +49 -31
  16. package/dist/components/alert.js.map +1 -1
  17. package/dist/components/app-bar.cjs +81 -0
  18. package/dist/components/app-bar.cjs.map +1 -0
  19. package/dist/components/app-bar.d.cts +27 -0
  20. package/dist/components/app-bar.d.ts +27 -0
  21. package/dist/components/app-bar.js +77 -0
  22. package/dist/components/app-bar.js.map +1 -0
  23. package/dist/components/app-shell.cjs +267 -0
  24. package/dist/components/app-shell.cjs.map +1 -0
  25. package/dist/components/app-shell.d.cts +98 -0
  26. package/dist/components/app-shell.d.ts +98 -0
  27. package/dist/components/app-shell.js +264 -0
  28. package/dist/components/app-shell.js.map +1 -0
  29. package/dist/components/autocomplete.cjs +167 -0
  30. package/dist/components/autocomplete.cjs.map +1 -0
  31. package/dist/components/autocomplete.d.cts +28 -0
  32. package/dist/components/autocomplete.d.ts +24 -24
  33. package/dist/components/autocomplete.js +146 -397
  34. package/dist/components/autocomplete.js.map +1 -1
  35. package/dist/components/avatar.cjs +39 -0
  36. package/dist/components/avatar.cjs.map +1 -0
  37. package/dist/components/avatar.d.cts +13 -0
  38. package/dist/components/avatar.d.ts +11 -11
  39. package/dist/components/avatar.js +24 -27
  40. package/dist/components/avatar.js.map +1 -1
  41. package/dist/components/badge.cjs +48 -0
  42. package/dist/components/badge.cjs.map +1 -0
  43. package/dist/components/badge.d.cts +15 -0
  44. package/dist/components/badge.d.ts +13 -13
  45. package/dist/components/badge.js +39 -38
  46. package/dist/components/badge.js.map +1 -1
  47. package/dist/components/breadcrumb.cjs +89 -0
  48. package/dist/components/breadcrumb.cjs.map +1 -0
  49. package/dist/components/breadcrumb.d.cts +15 -0
  50. package/dist/components/breadcrumb.d.ts +14 -13
  51. package/dist/components/breadcrumb.js +63 -137
  52. package/dist/components/breadcrumb.js.map +1 -1
  53. package/dist/components/button.cjs +75 -0
  54. package/dist/components/button.cjs.map +1 -0
  55. package/dist/components/button.d.cts +2 -0
  56. package/dist/components/button.d.ts +2 -17
  57. package/dist/components/button.js +66 -57
  58. package/dist/components/button.js.map +1 -1
  59. package/dist/components/calendar-rac.cjs +72 -0
  60. package/dist/components/calendar-rac.cjs.map +1 -0
  61. package/dist/components/calendar-rac.d.cts +13 -0
  62. package/dist/components/calendar-rac.d.ts +8 -8
  63. package/dist/components/calendar-rac.js +49 -61
  64. package/dist/components/calendar-rac.js.map +1 -1
  65. package/dist/components/card.cjs +86 -0
  66. package/dist/components/card.cjs.map +1 -0
  67. package/dist/components/card.d.cts +17 -0
  68. package/dist/components/card.d.ts +15 -17
  69. package/dist/components/card.js +58 -57
  70. package/dist/components/card.js.map +1 -1
  71. package/dist/components/checkbox-group.cjs +19 -0
  72. package/dist/components/checkbox-group.cjs.map +1 -0
  73. package/dist/components/checkbox-group.d.cts +7 -0
  74. package/dist/components/checkbox-group.d.ts +5 -5
  75. package/dist/components/checkbox-group.js +12 -10
  76. package/dist/components/checkbox-group.js.map +1 -1
  77. package/dist/components/checkbox.cjs +67 -0
  78. package/dist/components/checkbox.cjs.map +1 -0
  79. package/dist/components/checkbox.d.cts +8 -0
  80. package/dist/components/checkbox.d.ts +6 -6
  81. package/dist/components/checkbox.js +58 -61
  82. package/dist/components/checkbox.js.map +1 -1
  83. package/dist/components/collapsible.cjs +90 -0
  84. package/dist/components/collapsible.cjs.map +1 -0
  85. package/dist/components/collapsible.d.cts +45 -0
  86. package/dist/components/collapsible.d.ts +19 -28
  87. package/dist/components/collapsible.js +74 -112
  88. package/dist/components/collapsible.js.map +1 -1
  89. package/dist/components/combobox.cjs +257 -0
  90. package/dist/components/combobox.cjs.map +1 -0
  91. package/dist/components/combobox.d.cts +44 -0
  92. package/dist/components/combobox.d.ts +36 -36
  93. package/dist/components/combobox.js +229 -515
  94. package/dist/components/combobox.js.map +1 -1
  95. package/dist/components/command.cjs +139 -0
  96. package/dist/components/command.cjs.map +1 -0
  97. package/dist/components/command.d.cts +24 -0
  98. package/dist/components/command.d.ts +22 -22
  99. package/dist/components/command.js +109 -240
  100. package/dist/components/command.js.map +1 -1
  101. package/dist/components/dialog.cjs +139 -0
  102. package/dist/components/dialog.cjs.map +1 -0
  103. package/dist/components/dialog.d.cts +31 -0
  104. package/dist/components/dialog.d.ts +27 -31
  105. package/dist/components/dialog.js +112 -429
  106. package/dist/components/dialog.js.map +1 -1
  107. package/dist/components/dock.cjs +90 -0
  108. package/dist/components/dock.cjs.map +1 -0
  109. package/dist/components/dock.d.cts +30 -0
  110. package/dist/components/dock.d.ts +25 -26
  111. package/dist/components/dock.js +78 -104
  112. package/dist/components/dock.js.map +1 -1
  113. package/dist/components/drawer.cjs +115 -0
  114. package/dist/components/drawer.cjs.map +1 -0
  115. package/dist/components/drawer.d.cts +16 -0
  116. package/dist/components/drawer.d.ts +15 -15
  117. package/dist/components/drawer.js +77 -121
  118. package/dist/components/drawer.js.map +1 -1
  119. package/dist/components/dropdown-menu.cjs +217 -0
  120. package/dist/components/dropdown-menu.cjs.map +1 -0
  121. package/dist/components/dropdown-menu.d.cts +53 -0
  122. package/dist/components/dropdown-menu.d.ts +49 -46
  123. package/dist/components/dropdown-menu.js +177 -357
  124. package/dist/components/dropdown-menu.js.map +1 -1
  125. package/dist/components/empty.cjs +72 -0
  126. package/dist/components/empty.cjs.map +1 -0
  127. package/dist/components/empty.d.cts +15 -0
  128. package/dist/components/empty.d.ts +15 -0
  129. package/dist/components/empty.js +64 -0
  130. package/dist/components/empty.js.map +1 -0
  131. package/dist/components/field.cjs +186 -0
  132. package/dist/components/field.cjs.map +1 -0
  133. package/dist/components/field.d.cts +46 -0
  134. package/dist/components/field.d.ts +44 -49
  135. package/dist/components/field.js +166 -108
  136. package/dist/components/field.js.map +1 -1
  137. package/dist/components/flickering-grid.cjs +153 -0
  138. package/dist/components/flickering-grid.cjs.map +1 -0
  139. package/dist/components/flickering-grid.d.cts +16 -0
  140. package/dist/components/flickering-grid.d.ts +14 -13
  141. package/dist/components/flickering-grid.js +144 -141
  142. package/dist/components/flickering-grid.js.map +1 -1
  143. package/dist/components/flow-zoom-panel.cjs +62 -0
  144. package/dist/components/flow-zoom-panel.cjs.map +1 -0
  145. package/dist/components/flow-zoom-panel.d.cts +12 -0
  146. package/dist/components/flow-zoom-panel.d.ts +12 -0
  147. package/dist/components/flow-zoom-panel.js +61 -0
  148. package/dist/components/flow-zoom-panel.js.map +1 -0
  149. package/dist/components/form-control.cjs +65 -0
  150. package/dist/components/form-control.cjs.map +1 -0
  151. package/dist/components/form-control.d.cts +15 -0
  152. package/dist/components/form-control.d.ts +11 -11
  153. package/dist/components/form-control.js +56 -167
  154. package/dist/components/form-control.js.map +1 -1
  155. package/dist/components/form.cjs +102 -0
  156. package/dist/components/form.cjs.map +1 -0
  157. package/dist/components/form.d.cts +2 -0
  158. package/dist/components/form.d.ts +2 -37
  159. package/dist/components/form.js +76 -163
  160. package/dist/components/form.js.map +1 -1
  161. package/dist/components/input-group.cjs +70 -0
  162. package/dist/components/input-group.cjs.map +1 -0
  163. package/dist/components/input-group.d.cts +16 -0
  164. package/dist/components/input-group.d.ts +14 -16
  165. package/dist/components/input-group.js +51 -163
  166. package/dist/components/input-group.js.map +1 -1
  167. package/dist/components/input.cjs +37 -0
  168. package/dist/components/input.cjs.map +1 -0
  169. package/dist/components/input.d.cts +2 -0
  170. package/dist/components/input.d.ts +2 -11
  171. package/dist/components/input.js +30 -54
  172. package/dist/components/input.js.map +1 -1
  173. package/dist/components/json-input.cjs +147 -0
  174. package/dist/components/json-input.cjs.map +1 -0
  175. package/dist/components/json-input.d.cts +26 -0
  176. package/dist/components/json-input.d.ts +20 -19
  177. package/dist/components/json-input.js +132 -340
  178. package/dist/components/json-input.js.map +1 -1
  179. package/dist/components/label.cjs +27 -0
  180. package/dist/components/label.cjs.map +1 -0
  181. package/dist/components/label.d.cts +11 -0
  182. package/dist/components/label.d.ts +6 -6
  183. package/dist/components/label.js +17 -20
  184. package/dist/components/label.js.map +1 -1
  185. package/dist/components/motion-grid.cjs +68 -0
  186. package/dist/components/motion-grid.cjs.map +1 -0
  187. package/dist/components/motion-grid.d.cts +20 -0
  188. package/dist/components/motion-grid.d.ts +15 -15
  189. package/dist/components/motion-grid.js +59 -75
  190. package/dist/components/motion-grid.js.map +1 -1
  191. package/dist/components/multi-select.cjs +573 -0
  192. package/dist/components/multi-select.cjs.map +1 -0
  193. package/dist/components/multi-select.d.cts +198 -0
  194. package/dist/components/multi-select.d.ts +173 -173
  195. package/dist/components/multi-select.js +562 -874
  196. package/dist/components/multi-select.js.map +1 -1
  197. package/dist/components/page-header.cjs +30 -0
  198. package/dist/components/page-header.cjs.map +1 -0
  199. package/dist/components/page-header.d.cts +17 -0
  200. package/dist/components/page-header.d.ts +11 -11
  201. package/dist/components/page-header.js +23 -11
  202. package/dist/components/page-header.js.map +1 -1
  203. package/dist/components/pagination.cjs +95 -0
  204. package/dist/components/pagination.cjs.map +1 -0
  205. package/dist/components/pagination.d.cts +17 -0
  206. package/dist/components/pagination.d.ts +15 -17
  207. package/dist/components/pagination.js +70 -128
  208. package/dist/components/pagination.js.map +1 -1
  209. package/dist/components/popover.cjs +97 -0
  210. package/dist/components/popover.cjs.map +1 -0
  211. package/dist/components/popover.d.cts +40 -0
  212. package/dist/components/popover.d.ts +33 -28
  213. package/dist/components/popover.js +78 -178
  214. package/dist/components/popover.js.map +1 -1
  215. package/dist/components/portal.cjs +156 -0
  216. package/dist/components/portal.cjs.map +1 -0
  217. package/dist/components/portal.d.cts +118 -0
  218. package/dist/components/portal.d.ts +33 -23
  219. package/dist/components/portal.js +128 -57
  220. package/dist/components/portal.js.map +1 -1
  221. package/dist/components/progress.cjs +30 -0
  222. package/dist/components/progress.cjs.map +1 -0
  223. package/dist/components/progress.d.cts +10 -0
  224. package/dist/components/progress.d.ts +8 -8
  225. package/dist/components/progress.js +21 -24
  226. package/dist/components/progress.js.map +1 -1
  227. package/dist/components/progressive-blur-scroll-container.cjs +76 -0
  228. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
  229. package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
  230. package/dist/components/progressive-blur-scroll-container.d.ts +19 -19
  231. package/dist/components/progressive-blur-scroll-container.js +70 -137
  232. package/dist/components/progressive-blur-scroll-container.js.map +1 -1
  233. package/dist/components/progressive-blur.cjs +46 -0
  234. package/dist/components/progressive-blur.cjs.map +1 -0
  235. package/dist/components/progressive-blur.d.cts +17 -0
  236. package/dist/components/progressive-blur.d.ts +15 -14
  237. package/dist/components/progressive-blur.js +38 -63
  238. package/dist/components/progressive-blur.js.map +1 -1
  239. package/dist/components/radio-group.cjs +38 -0
  240. package/dist/components/radio-group.cjs.map +1 -0
  241. package/dist/components/radio-group.d.cts +10 -0
  242. package/dist/components/radio-group.d.ts +8 -8
  243. package/dist/components/radio-group.js +28 -30
  244. package/dist/components/radio-group.js.map +1 -1
  245. package/dist/components/record-picker.cjs +8 -0
  246. package/dist/components/record-picker.d.cts +16 -0
  247. package/dist/components/record-picker.d.ts +13 -13
  248. package/dist/components/record-picker.js +5 -364
  249. package/dist/components/resizable.cjs +50 -0
  250. package/dist/components/resizable.cjs.map +1 -0
  251. package/dist/components/resizable.d.cts +11 -0
  252. package/dist/components/resizable.d.ts +10 -10
  253. package/dist/components/resizable.js +29 -37
  254. package/dist/components/resizable.js.map +1 -1
  255. package/dist/components/responsive-diagram.cjs +56 -0
  256. package/dist/components/responsive-diagram.cjs.map +1 -0
  257. package/dist/components/responsive-diagram.d.cts +10 -0
  258. package/dist/components/responsive-diagram.d.ts +7 -7
  259. package/dist/components/responsive-diagram.js +50 -60
  260. package/dist/components/responsive-diagram.js.map +1 -1
  261. package/dist/components/scroll-area.cjs +46 -0
  262. package/dist/components/scroll-area.cjs.map +1 -0
  263. package/dist/components/scroll-area.d.cts +12 -0
  264. package/dist/components/scroll-area.d.ts +11 -11
  265. package/dist/components/scroll-area.js +35 -62
  266. package/dist/components/scroll-area.js.map +1 -1
  267. package/dist/components/select.cjs +204 -0
  268. package/dist/components/select.cjs.map +1 -0
  269. package/dist/components/select.d.cts +47 -0
  270. package/dist/components/select.d.ts +38 -38
  271. package/dist/components/select.js +172 -269
  272. package/dist/components/select.js.map +1 -1
  273. package/dist/components/separator.cjs +23 -0
  274. package/dist/components/separator.cjs.map +1 -0
  275. package/dist/components/separator.d.cts +2 -0
  276. package/dist/components/separator.d.ts +2 -11
  277. package/dist/components/separator.js +14 -18
  278. package/dist/components/separator.js.map +1 -1
  279. package/dist/components/sheet.cjs +19 -0
  280. package/dist/components/sheet.d.cts +107 -0
  281. package/dist/components/sheet.d.ts +85 -90
  282. package/dist/components/sheet.js +3 -598
  283. package/dist/components/sidebar.cjs +29 -0
  284. package/dist/components/sidebar.d.cts +67 -0
  285. package/dist/components/sidebar.d.ts +63 -73
  286. package/dist/components/sidebar.js +3 -1215
  287. package/dist/components/skeleton.cjs +24 -0
  288. package/dist/components/skeleton.cjs.map +1 -0
  289. package/dist/components/skeleton.d.cts +11 -0
  290. package/dist/components/skeleton.d.ts +10 -6
  291. package/dist/components/skeleton.js +15 -10
  292. package/dist/components/skeleton.js.map +1 -1
  293. package/dist/components/sonner.cjs +23 -0
  294. package/dist/components/sonner.cjs.map +1 -0
  295. package/dist/components/sonner.d.cts +10 -0
  296. package/dist/components/sonner.d.ts +7 -7
  297. package/dist/components/sonner.js +17 -18
  298. package/dist/components/sonner.js.map +1 -1
  299. package/dist/components/stack/index.cjs +44 -0
  300. package/dist/components/stack/index.d.cts +2 -0
  301. package/dist/components/stack/index.d.ts +2 -674
  302. package/dist/components/stack/index.js +3 -1444
  303. package/dist/components/stepper.cjs +160 -0
  304. package/dist/components/stepper.cjs.map +1 -0
  305. package/dist/components/stepper.d.cts +32 -0
  306. package/dist/components/stepper.d.ts +27 -25
  307. package/dist/components/stepper.js +133 -261
  308. package/dist/components/stepper.js.map +1 -1
  309. package/dist/components/switch.cjs +35 -0
  310. package/dist/components/switch.cjs.map +1 -0
  311. package/dist/components/switch.d.cts +8 -0
  312. package/dist/components/switch.d.ts +7 -7
  313. package/dist/components/switch.js +26 -34
  314. package/dist/components/switch.js.map +1 -1
  315. package/dist/components/table.cjs +85 -0
  316. package/dist/components/table.cjs.map +1 -0
  317. package/dist/components/table.d.cts +23 -0
  318. package/dist/components/table.d.ts +23 -15
  319. package/dist/components/table.js +56 -46
  320. package/dist/components/table.js.map +1 -1
  321. package/dist/components/tabs.cjs +49 -0
  322. package/dist/components/tabs.cjs.map +1 -0
  323. package/dist/components/tabs.d.cts +10 -0
  324. package/dist/components/tabs.d.ts +9 -9
  325. package/dist/components/tabs.js +31 -36
  326. package/dist/components/tabs.js.map +1 -1
  327. package/dist/components/tags.cjs +132 -0
  328. package/dist/components/tags.cjs.map +1 -0
  329. package/dist/components/tags.d.cts +36 -0
  330. package/dist/components/tags.d.ts +24 -28
  331. package/dist/components/tags.js +114 -438
  332. package/dist/components/tags.js.map +1 -1
  333. package/dist/components/textarea.cjs +34 -0
  334. package/dist/components/textarea.cjs.map +1 -0
  335. package/dist/components/textarea.d.cts +10 -0
  336. package/dist/components/textarea.d.ts +8 -8
  337. package/dist/components/textarea.js +27 -48
  338. package/dist/components/textarea.js.map +1 -1
  339. package/dist/components/toast/index.cjs +9 -0
  340. package/dist/components/toast/index.d.cts +2 -0
  341. package/dist/components/toast/index.d.ts +2 -52
  342. package/dist/components/toast/index.js +3 -623
  343. package/dist/components/tooltip.cjs +67 -0
  344. package/dist/components/tooltip.cjs.map +1 -0
  345. package/dist/components/tooltip.d.cts +2 -0
  346. package/dist/components/tooltip.d.ts +2 -29
  347. package/dist/components/tooltip.js +53 -166
  348. package/dist/components/tooltip.js.map +1 -1
  349. package/dist/components/unlink-button.cjs +24 -0
  350. package/dist/components/unlink-button.cjs.map +1 -0
  351. package/dist/components/unlink-button.d.cts +14 -0
  352. package/dist/components/unlink-button.d.ts +11 -11
  353. package/dist/components/unlink-button.js +18 -86
  354. package/dist/components/unlink-button.js.map +1 -1
  355. package/dist/form-DgRTv7O7.d.ts +54 -0
  356. package/dist/form-DoZEWSzb.d.cts +54 -0
  357. package/dist/index-CjA4CENl.d.cts +684 -0
  358. package/dist/index-CjA4CENl.d.ts +684 -0
  359. package/dist/index-UnM04j0t.d.cts +58 -0
  360. package/dist/index-UnM04j0t.d.ts +58 -0
  361. package/dist/index.cjs +408 -9346
  362. package/dist/index.d.cts +224 -2548
  363. package/dist/index.d.ts +224 -2548
  364. package/dist/index.js +65 -9022
  365. package/dist/input-CBrCuMH8.d.cts +11 -0
  366. package/dist/input-CBrCuMH8.d.ts +11 -0
  367. package/dist/motion-config-COCFHq1L.cjs +271 -0
  368. package/dist/motion-config-COCFHq1L.cjs.map +1 -0
  369. package/dist/motion-config-COsZ6azM.js +241 -0
  370. package/dist/motion-config-COsZ6azM.js.map +1 -0
  371. package/dist/record-picker-BbxngCeV.js +162 -0
  372. package/dist/record-picker-BbxngCeV.js.map +1 -0
  373. package/dist/record-picker-Bz4FApxD.cjs +167 -0
  374. package/dist/record-picker-Bz4FApxD.cjs.map +1 -0
  375. package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
  376. package/dist/separator-BQEsr0Rc.d.cts +11 -0
  377. package/dist/separator-BQEsr0Rc.d.ts +11 -0
  378. package/dist/sheet-BLHnhLRH.js +425 -0
  379. package/dist/sheet-BLHnhLRH.js.map +1 -0
  380. package/dist/sheet-BdA0rfIz.cjs +515 -0
  381. package/dist/sheet-BdA0rfIz.cjs.map +1 -0
  382. package/dist/sidebar-CPy_fibW.cjs +608 -0
  383. package/dist/sidebar-CPy_fibW.cjs.map +1 -0
  384. package/dist/sidebar-Cfax0g0_.js +463 -0
  385. package/dist/sidebar-Cfax0g0_.js.map +1 -0
  386. package/dist/slot-C-jEfihz.cjs +122 -0
  387. package/dist/slot-C-jEfihz.cjs.map +1 -0
  388. package/dist/slot-EL8zfLG0.js +97 -0
  389. package/dist/slot-EL8zfLG0.js.map +1 -0
  390. package/dist/stack-DKdvlOM6.cjs +1771 -0
  391. package/dist/stack-DKdvlOM6.cjs.map +1 -0
  392. package/dist/stack-jMdxDrex.js +1531 -0
  393. package/dist/stack-jMdxDrex.js.map +1 -0
  394. package/dist/toast-D6MqijT2.cjs +316 -0
  395. package/dist/toast-D6MqijT2.cjs.map +1 -0
  396. package/dist/toast-D_BOLzm3.js +287 -0
  397. package/dist/toast-D_BOLzm3.js.map +1 -0
  398. package/dist/tooltip-CTRQoN1A.d.cts +29 -0
  399. package/dist/tooltip-CTRQoN1A.d.ts +29 -0
  400. package/dist/utils-BkMLyah9.js +12 -0
  401. package/dist/utils-BkMLyah9.js.map +1 -0
  402. package/dist/utils-CzTQ3-VI.cjs +17 -0
  403. package/dist/utils-CzTQ3-VI.cjs.map +1 -0
  404. package/package.json +288 -47
  405. package/src/styles/globals.css +155 -203
  406. package/dist/components/org-chart/index.d.ts +0 -54
  407. package/dist/components/org-chart/index.js +0 -861
  408. package/dist/components/org-chart/index.js.map +0 -1
  409. package/dist/components/record-picker.js.map +0 -1
  410. package/dist/components/sheet.js.map +0 -1
  411. package/dist/components/sidebar.js.map +0 -1
  412. package/dist/components/stack/index.js.map +0 -1
  413. package/dist/components/toast/index.js.map +0 -1
  414. package/dist/index.cjs.map +0 -1
  415. package/dist/index.js.map +0 -1
@@ -1,522 +1,236 @@
1
1
  "use client";
2
- import { Combobox as Combobox$1 } from '@base-ui/react/combobox';
3
- import { ChevronsUpDownIcon, XIcon } from 'lucide-react';
4
- import * as React3 from 'react';
5
- import { clsx } from 'clsx';
6
- import { twMerge } from 'tailwind-merge';
7
- import { jsxs, jsx } from 'react/jsx-runtime';
8
- import { Input as Input$1 } from '@base-ui/react/input';
9
- import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
10
2
 
11
- function cn(...inputs) {
12
- return twMerge(clsx(inputs));
13
- }
14
- var PORTAL_ROOT_ID = "portal-root";
15
- var PortalContext = React3.createContext({
16
- layer: "base",
17
- depth: 0,
18
- floatingPortalStrategy: "root",
19
- floatingZIndex: "default"
20
- });
21
- function useRootPortalContainer() {
22
- const [container, setContainer] = React3.useState(null);
23
- React3.useLayoutEffect(() => {
24
- const el = document.getElementById(PORTAL_ROOT_ID);
25
- setContainer(el);
26
- }, []);
27
- return container;
28
- }
29
- function useFloatingOverlayPortalProps() {
30
- const rootContainer = useRootPortalContainer();
31
- const { floatingPortalStrategy, floatingZIndex } = React3.useContext(PortalContext);
32
- const container = floatingPortalStrategy === "nested" ? void 0 : rootContainer ?? null;
33
- const zIndexClass = floatingZIndex === "elevated" ? "z-[var(--z-layer-floating-elevated)]" : "z-[var(--z-layer-floating)]";
34
- return { container, zIndexClass };
35
- }
36
- function Input({ className, size = "default", unstyled = false, ...props }) {
37
- const isFloating = props.placeholder === " ";
38
- return /* @__PURE__ */ jsx(
39
- "span",
40
- {
41
- className: cn(
42
- !unstyled && [
43
- // Base layout
44
- "relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow",
45
- // Inner shadow highlight
46
- "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]",
47
- "not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]",
48
- // Focus state - use primary brand color
49
- "has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35",
50
- // Invalid state
51
- "has-aria-invalid:border-destructive/36",
52
- "has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16",
53
- // Disabled state
54
- "has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none",
55
- // Dark mode
56
- "sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border",
57
- "dark:has-aria-invalid:ring-destructive/24",
58
- "dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]"
59
- ],
60
- className
61
- ) || void 0,
62
- "data-size": size,
63
- "data-slot": "input-control",
64
- children: /* @__PURE__ */ jsx(
65
- Input$1,
66
- {
67
- className: cn(
68
- "w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none",
69
- isFloating ? "h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10" : "h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5",
70
- size === "sm" && (isFloating ? "h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9" : "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5"),
71
- size === "lg" && (isFloating ? "h-12 pt-5 pb-1.5 sm:h-11" : "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5"),
72
- props.type === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",
73
- props.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm"
74
- ),
75
- "data-slot": "input",
76
- size: typeof size === "number" ? size : void 0,
77
- ...props
78
- }
79
- )
80
- }
81
- );
82
- }
83
- var ScrollArea = React3.forwardRef(
84
- ({ className, children, scrollFade = false, scrollbarGutter = false, ...props }, ref) => {
85
- return /* @__PURE__ */ jsxs(
86
- ScrollArea$1.Root,
87
- {
88
- ref,
89
- className: cn("size-full min-h-0", className),
90
- ...props,
91
- children: [
92
- /* @__PURE__ */ jsx(
93
- ScrollArea$1.Viewport,
94
- {
95
- className: cn(
96
- "h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
97
- scrollFade && "mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",
98
- scrollbarGutter && "data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"
99
- ),
100
- "data-slot": "scroll-area-viewport",
101
- children
102
- }
103
- ),
104
- /* @__PURE__ */ jsx(ScrollBar, { orientation: "vertical" }),
105
- /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }),
106
- /* @__PURE__ */ jsx(ScrollArea$1.Corner, { "data-slot": "scroll-area-corner" })
107
- ]
108
- }
109
- );
110
- }
111
- );
112
- ScrollArea.displayName = "ScrollArea";
113
- function ScrollBar({
114
- className,
115
- orientation = "vertical",
116
- ...props
117
- }) {
118
- return /* @__PURE__ */ jsx(
119
- ScrollArea$1.Scrollbar,
120
- {
121
- className: cn(
122
- "m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100",
123
- className
124
- ),
125
- "data-slot": "scroll-area-scrollbar",
126
- orientation,
127
- ...props,
128
- children: /* @__PURE__ */ jsx(
129
- ScrollArea$1.Thumb,
130
- {
131
- className: "relative flex-1 rounded-full bg-foreground/20",
132
- "data-slot": "scroll-area-thumb"
133
- }
134
- )
135
- }
136
- );
137
- }
138
- var ComboboxContext = React3.createContext({
139
- chipsRef: null,
140
- multiple: false
3
+ import { t as cn } from "../utils-BkMLyah9.js";
4
+ import { Input } from "./input.js";
5
+ import { ScrollArea } from "./scroll-area.js";
6
+ import * as React$1 from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { ChevronsUpDownIcon, XIcon } from "lucide-react";
9
+ import { useFloatingOverlayPortalProps } from "@constructive-io/ui/portal";
10
+ import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
11
+
12
+ //#region src/components/combobox.tsx
13
+ const ComboboxContext = React$1.createContext({
14
+ chipsRef: null,
15
+ multiple: false
141
16
  });
142
17
  function Combobox(props) {
143
- const chipsRef = React3.useRef(null);
144
- return /* @__PURE__ */ jsx(ComboboxContext.Provider, { value: { chipsRef, multiple: !!props.multiple }, children: /* @__PURE__ */ jsx(
145
- Combobox$1.Root,
146
- {
147
- ...props
148
- }
149
- ) });
150
- }
151
- function ComboboxInput({
152
- className,
153
- showTrigger = true,
154
- showClear = false,
155
- startAddon,
156
- size,
157
- ...props
158
- }) {
159
- const { multiple } = React3.useContext(ComboboxContext);
160
- const sizeValue = size ?? "default";
161
- if (multiple) {
162
- return /* @__PURE__ */ jsx(
163
- Combobox$1.Input,
164
- {
165
- className: cn(
166
- "min-w-12 flex-1 text-base outline-none sm:text-sm [[data-slot=combobox-chip]+&]:ps-0.5",
167
- sizeValue === "sm" ? "ps-1.5" : "ps-2",
168
- className
169
- ),
170
- "data-size": typeof sizeValue === "string" ? sizeValue : void 0,
171
- "data-slot": "combobox-input",
172
- size: typeof sizeValue === "number" ? sizeValue : void 0,
173
- ...props
174
- }
175
- );
176
- }
177
- return /* @__PURE__ */ jsxs("div", { className: "relative not-has-[>*.w-full]:w-fit w-full has-disabled:opacity-64", children: [
178
- startAddon && /* @__PURE__ */ jsx(
179
- "div",
180
- {
181
- "aria-hidden": "true",
182
- className: "[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:opacity-80",
183
- "data-slot": "combobox-start-addon",
184
- children: startAddon
185
- }
186
- ),
187
- /* @__PURE__ */ jsx(
188
- Combobox$1.Input,
189
- {
190
- className: cn(
191
- startAddon && "data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]",
192
- sizeValue === "sm" ? "has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-6.5" : "has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-7",
193
- className
194
- ),
195
- "data-slot": "combobox-input",
196
- render: /* @__PURE__ */ jsx(Input, { className: "has-disabled:opacity-100", size: sizeValue }),
197
- ...props
198
- }
199
- ),
200
- showTrigger && /* @__PURE__ */ jsx(
201
- ComboboxTrigger,
202
- {
203
- className: cn(
204
- "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
205
- sizeValue === "sm" ? "end-0" : "end-0.5"
206
- ),
207
- children: /* @__PURE__ */ jsx(ChevronsUpDownIcon, {})
208
- }
209
- ),
210
- showClear && /* @__PURE__ */ jsx(
211
- ComboboxClear,
212
- {
213
- className: cn(
214
- "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
215
- sizeValue === "sm" ? "end-0" : "end-0.5"
216
- ),
217
- children: /* @__PURE__ */ jsx(XIcon, {})
218
- }
219
- )
220
- ] });
221
- }
222
- function ComboboxTrigger({
223
- className,
224
- ...props
225
- }) {
226
- return /* @__PURE__ */ jsx(
227
- Combobox$1.Trigger,
228
- {
229
- className,
230
- "data-slot": "combobox-trigger",
231
- ...props
232
- }
233
- );
234
- }
235
- function ComboboxPopup({
236
- className,
237
- children,
238
- sideOffset = 4,
239
- ...props
240
- }) {
241
- const { chipsRef, multiple } = React3.useContext(ComboboxContext);
242
- const { container, zIndexClass } = useFloatingOverlayPortalProps();
243
- return /* @__PURE__ */ jsx(Combobox$1.Portal, { container, children: /* @__PURE__ */ jsx(
244
- Combobox$1.Positioner,
245
- {
246
- ...multiple ? { anchor: chipsRef } : {},
247
- className: cn("select-none", zIndexClass),
248
- "data-slot": "combobox-positioner",
249
- sideOffset,
250
- children: /* @__PURE__ */ jsx(
251
- "span",
252
- {
253
- className: cn(
254
- "relative flex max-h-full origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/6%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",
255
- className
256
- ),
257
- children: /* @__PURE__ */ jsx(
258
- Combobox$1.Popup,
259
- {
260
- className: "flex max-h-[min(var(--available-height),23rem)] w-(--anchor-width) max-w-(--available-width) flex-col",
261
- "data-slot": "combobox-popup",
262
- ...props,
263
- children
264
- }
265
- )
266
- }
267
- )
268
- }
269
- ) });
270
- }
271
- function ComboboxItem({
272
- className,
273
- children,
274
- ...props
275
- }) {
276
- return /* @__PURE__ */ jsxs(
277
- Combobox$1.Item,
278
- {
279
- className: cn(
280
- "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
281
- className
282
- ),
283
- "data-slot": "combobox-item",
284
- ...props,
285
- children: [
286
- /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, { className: "col-start-1", children: /* @__PURE__ */ jsx(
287
- "svg",
288
- {
289
- fill: "none",
290
- height: "24",
291
- stroke: "currentColor",
292
- strokeLinecap: "round",
293
- strokeLinejoin: "round",
294
- strokeWidth: "2",
295
- viewBox: "0 0 24 24",
296
- width: "24",
297
- xmlns: "http://www.w3.org/1500/svg",
298
- children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
299
- }
300
- ) }),
301
- /* @__PURE__ */ jsx("div", { className: "col-start-2", children })
302
- ]
303
- }
304
- );
305
- }
306
- function ComboboxSeparator({
307
- className,
308
- ...props
309
- }) {
310
- return /* @__PURE__ */ jsx(
311
- Combobox$1.Separator,
312
- {
313
- className: cn("mx-2 my-1 h-px bg-border last:hidden", className),
314
- "data-slot": "combobox-separator",
315
- ...props
316
- }
317
- );
318
- }
319
- function ComboboxGroup({
320
- className,
321
- ...props
322
- }) {
323
- return /* @__PURE__ */ jsx(
324
- Combobox$1.Group,
325
- {
326
- className: cn("[[role=group]+&]:mt-1.5", className),
327
- "data-slot": "combobox-group",
328
- ...props
329
- }
330
- );
331
- }
332
- function ComboboxGroupLabel({
333
- className,
334
- ...props
335
- }) {
336
- return /* @__PURE__ */ jsx(
337
- Combobox$1.GroupLabel,
338
- {
339
- className: cn(
340
- "px-2 py-1.5 font-medium text-muted-foreground text-xs",
341
- className
342
- ),
343
- "data-slot": "combobox-group-label",
344
- ...props
345
- }
346
- );
347
- }
348
- function ComboboxEmpty({
349
- className,
350
- ...props
351
- }) {
352
- return /* @__PURE__ */ jsx(
353
- Combobox$1.Empty,
354
- {
355
- className: cn(
356
- "not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm",
357
- className
358
- ),
359
- "data-slot": "combobox-empty",
360
- ...props
361
- }
362
- );
363
- }
364
- function ComboboxRow({
365
- className,
366
- ...props
367
- }) {
368
- return /* @__PURE__ */ jsx(
369
- Combobox$1.Row,
370
- {
371
- className,
372
- "data-slot": "combobox-row",
373
- ...props
374
- }
375
- );
376
- }
377
- function ComboboxValue({
378
- ...props
379
- }) {
380
- return /* @__PURE__ */ jsx(
381
- Combobox$1.Value,
382
- {
383
- "data-slot": "combobox-value",
384
- ...props
385
- }
386
- );
387
- }
388
- function ComboboxList({
389
- className,
390
- ...props
391
- }) {
392
- return /* @__PURE__ */ jsx(ScrollArea, { scrollbarGutter: true, scrollFade: true, children: /* @__PURE__ */ jsx(
393
- Combobox$1.List,
394
- {
395
- className: cn(
396
- "not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1 in-data-has-overflow-y:pe-3",
397
- className
398
- ),
399
- "data-slot": "combobox-list",
400
- ...props
401
- }
402
- ) });
403
- }
404
- function ComboboxClear({
405
- className,
406
- ...props
407
- }) {
408
- return /* @__PURE__ */ jsx(
409
- Combobox$1.Clear,
410
- {
411
- className,
412
- "data-slot": "combobox-clear",
413
- ...props
414
- }
415
- );
416
- }
417
- function ComboboxStatus({
418
- className,
419
- ...props
420
- }) {
421
- return /* @__PURE__ */ jsx(
422
- Combobox$1.Status,
423
- {
424
- className: cn(
425
- "px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0",
426
- className
427
- ),
428
- "data-slot": "combobox-status",
429
- ...props
430
- }
431
- );
432
- }
433
- function ComboboxCollection({
434
- ...props
435
- }) {
436
- return /* @__PURE__ */ jsx(
437
- Combobox$1.Collection,
438
- {
439
- "data-slot": "combobox-collection",
440
- ...props
441
- }
442
- );
443
- }
444
- function ComboboxChips({
445
- className,
446
- children,
447
- startAddon,
448
- ...props
449
- }) {
450
- const { chipsRef } = React3.useContext(ComboboxContext);
451
- return /* @__PURE__ */ jsxs(
452
- Combobox$1.Chips,
453
- {
454
- className: cn(
455
- "relative inline-flex min-h-9 w-full flex-wrap gap-1 rounded-lg border border-input bg-background not-dark:bg-clip-padding p-[calc(--spacing(1)-1px)] text-base outline-none ring-ring/24 transition-shadow *:min-h-7 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/6%)] focus-within:border-ring focus-within:ring-[3px] has-disabled:pointer-events-none has-data-[size=lg]:min-h-10 has-data-[size=sm]:min-h-8 has-aria-invalid:border-destructive/36 has-disabled:opacity-64 has-[:disabled,:focus-within,[aria-invalid]]:shadow-none focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/16 has-data-[size=lg]:*:min-h-8 has-data-[size=sm]:*:min-h-6 sm:min-h-8 sm:text-sm sm:has-data-[size=lg]:min-h-9 sm:has-data-[size=sm]:min-h-7 sm:*:min-h-6 sm:has-data-[size=lg]:*:min-h-7 sm:has-data-[size=sm]:*:min-h-5 dark:not-has-disabled:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]",
456
- className
457
- ),
458
- "data-slot": "combobox-chips",
459
- onMouseDown: (e) => {
460
- const target = e.target;
461
- const isChip = target.closest('[data-slot="combobox-chip"]');
462
- if (isChip || !chipsRef?.current) return;
463
- e.preventDefault();
464
- const input = chipsRef.current.querySelector("input");
465
- if (input && !chipsRef.current.querySelector("input:focus")) {
466
- input.focus();
467
- }
468
- },
469
- ref: chipsRef,
470
- ...props,
471
- children: [
472
- startAddon && /* @__PURE__ */ jsx(
473
- "div",
474
- {
475
- "aria-hidden": "true",
476
- className: "[&_svg]:-ms-0.5 [&_svg]:-me-1.5 flex shrink-0 items-center ps-2 opacity-80 has-[~[data-size=sm]]:has-[+[data-slot=combobox-chip]]:pe-1.5 has-[~[data-size=sm]]:ps-1.5 has-[+[data-slot=combobox-chip]]:pe-2 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
477
- "data-slot": "combobox-start-addon",
478
- children: startAddon
479
- }
480
- ),
481
- children
482
- ]
483
- }
484
- );
485
- }
486
- function ComboboxChip({
487
- children,
488
- ...props
489
- }) {
490
- return /* @__PURE__ */ jsxs(
491
- Combobox$1.Chip,
492
- {
493
- className: "flex items-center rounded-[calc(var(--radius-md)-1px)] bg-accent ps-2 font-medium text-accent-foreground text-sm outline-none sm:text-xs/(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5",
494
- "data-slot": "combobox-chip",
495
- ...props,
496
- children: [
497
- children,
498
- /* @__PURE__ */ jsx(ComboboxChipRemove, {})
499
- ]
500
- }
501
- );
502
- }
503
- function ComboboxChipRemove({
504
- ...props
505
- }) {
506
- return /* @__PURE__ */ jsx(
507
- Combobox$1.ChipRemove,
508
- {
509
- "aria-label": "Remove",
510
- className: "h-full shrink-0 cursor-pointer px-1.5 opacity-80 hover:opacity-100 [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5",
511
- "data-slot": "combobox-chip-remove",
512
- ...props,
513
- children: /* @__PURE__ */ jsx(XIcon, {})
514
- }
515
- );
516
- }
517
- var useComboboxFilter = Combobox$1.useFilter;
518
- var ComboboxContent = ComboboxPopup;
18
+ const chipsRef = React$1.useRef(null);
19
+ return /* @__PURE__ */ jsx(ComboboxContext.Provider, {
20
+ value: {
21
+ chipsRef,
22
+ multiple: !!props.multiple
23
+ },
24
+ children: /* @__PURE__ */ jsx(Combobox$1.Root, { ...props })
25
+ });
26
+ }
27
+ function ComboboxInput({ className, showTrigger = true, showClear = false, startAddon, size, ...props }) {
28
+ const { multiple } = React$1.useContext(ComboboxContext);
29
+ const sizeValue = size ?? "default";
30
+ if (multiple) return /* @__PURE__ */ jsx(Combobox$1.Input, {
31
+ className: cn("min-w-12 flex-1 text-base outline-none sm:text-sm [[data-slot=combobox-chip]+&]:ps-0.5", sizeValue === "sm" ? "ps-1.5" : "ps-2", className),
32
+ "data-size": typeof sizeValue === "string" ? sizeValue : void 0,
33
+ "data-slot": "combobox-input",
34
+ size: typeof sizeValue === "number" ? sizeValue : void 0,
35
+ ...props
36
+ });
37
+ return /* @__PURE__ */ jsxs("div", {
38
+ className: "relative not-has-[>*.w-full]:w-fit w-full has-disabled:opacity-64",
39
+ children: [
40
+ startAddon && /* @__PURE__ */ jsx("div", {
41
+ "aria-hidden": "true",
42
+ className: "[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:opacity-80",
43
+ "data-slot": "combobox-start-addon",
44
+ children: startAddon
45
+ }),
46
+ /* @__PURE__ */ jsx(Combobox$1.Input, {
47
+ className: cn(startAddon && "data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]", sizeValue === "sm" ? "has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-6.5 pointer-coarse:has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-11" : "has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-7 pointer-coarse:has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-11", className),
48
+ "data-slot": "combobox-input",
49
+ render: /* @__PURE__ */ jsx(Input, {
50
+ className: "has-disabled:opacity-100",
51
+ size: sizeValue
52
+ }),
53
+ ...props
54
+ }),
55
+ showTrigger && /* @__PURE__ */ jsx(ComboboxTrigger, {
56
+ className: cn("-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:size-11 sm:pointer-coarse:size-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", sizeValue === "sm" ? "end-0" : "end-0.5"),
57
+ children: /* @__PURE__ */ jsx(ChevronsUpDownIcon, {})
58
+ }),
59
+ showClear && /* @__PURE__ */ jsx(ComboboxClear, {
60
+ className: cn("-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:size-11 sm:pointer-coarse:size-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", sizeValue === "sm" ? "end-0" : "end-0.5"),
61
+ children: /* @__PURE__ */ jsx(XIcon, {})
62
+ })
63
+ ]
64
+ });
65
+ }
66
+ function ComboboxTrigger({ className, ...props }) {
67
+ return /* @__PURE__ */ jsx(Combobox$1.Trigger, {
68
+ className,
69
+ "data-slot": "combobox-trigger",
70
+ ...props
71
+ });
72
+ }
73
+ function ComboboxPopup({ className, children, sideOffset = 4, ...props }) {
74
+ const { chipsRef, multiple } = React$1.useContext(ComboboxContext);
75
+ const { container, zIndexClass } = useFloatingOverlayPortalProps();
76
+ return /* @__PURE__ */ jsx(Combobox$1.Portal, {
77
+ container,
78
+ children: /* @__PURE__ */ jsx(Combobox$1.Positioner, {
79
+ ...multiple ? { anchor: chipsRef } : {},
80
+ className: cn("select-none", zIndexClass),
81
+ "data-slot": "combobox-positioner",
82
+ sideOffset,
83
+ children: /* @__PURE__ */ jsx("span", {
84
+ className: cn("relative flex max-h-full origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/6%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", className),
85
+ children: /* @__PURE__ */ jsx(Combobox$1.Popup, {
86
+ className: "flex max-h-[min(var(--available-height),23rem)] w-(--anchor-width) max-w-(--available-width) flex-col",
87
+ "data-slot": "combobox-popup",
88
+ ...props,
89
+ children
90
+ })
91
+ })
92
+ })
93
+ });
94
+ }
95
+ function ComboboxItem({ className, children, ...props }) {
96
+ return /* @__PURE__ */ jsxs(Combobox$1.Item, {
97
+ className: cn("grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none pointer-coarse:min-h-11 sm:pointer-coarse:min-h-11 data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
98
+ "data-slot": "combobox-item",
99
+ ...props,
100
+ children: [/* @__PURE__ */ jsx(Combobox$1.ItemIndicator, {
101
+ keepMounted: true,
102
+ className: (state) => cn("col-start-1 transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none", state.selected ? "scale-100 opacity-100 blur-0" : "scale-[0.25] opacity-0 blur-[4px]"),
103
+ children: /* @__PURE__ */ jsx("svg", {
104
+ fill: "none",
105
+ height: "24",
106
+ stroke: "currentColor",
107
+ strokeLinecap: "round",
108
+ strokeLinejoin: "round",
109
+ strokeWidth: "2",
110
+ viewBox: "0 0 24 24",
111
+ width: "24",
112
+ xmlns: "http://www.w3.org/1500/svg",
113
+ children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
114
+ })
115
+ }), /* @__PURE__ */ jsx("div", {
116
+ className: "col-start-2",
117
+ children
118
+ })]
119
+ });
120
+ }
121
+ function ComboboxSeparator({ className, ...props }) {
122
+ return /* @__PURE__ */ jsx(Combobox$1.Separator, {
123
+ className: cn("mx-2 my-1 h-px bg-border last:hidden", className),
124
+ "data-slot": "combobox-separator",
125
+ ...props
126
+ });
127
+ }
128
+ function ComboboxGroup({ className, ...props }) {
129
+ return /* @__PURE__ */ jsx(Combobox$1.Group, {
130
+ className: cn("[[role=group]+&]:mt-1.5", className),
131
+ "data-slot": "combobox-group",
132
+ ...props
133
+ });
134
+ }
135
+ function ComboboxGroupLabel({ className, ...props }) {
136
+ return /* @__PURE__ */ jsx(Combobox$1.GroupLabel, {
137
+ className: cn("px-2 py-1.5 font-medium text-muted-foreground text-xs", className),
138
+ "data-slot": "combobox-group-label",
139
+ ...props
140
+ });
141
+ }
142
+ function ComboboxEmpty({ className, ...props }) {
143
+ return /* @__PURE__ */ jsx(Combobox$1.Empty, {
144
+ className: cn("not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm", className),
145
+ "data-slot": "combobox-empty",
146
+ ...props
147
+ });
148
+ }
149
+ function ComboboxRow({ className, ...props }) {
150
+ return /* @__PURE__ */ jsx(Combobox$1.Row, {
151
+ className,
152
+ "data-slot": "combobox-row",
153
+ ...props
154
+ });
155
+ }
156
+ function ComboboxValue({ ...props }) {
157
+ return /* @__PURE__ */ jsx(Combobox$1.Value, {
158
+ "data-slot": "combobox-value",
159
+ ...props
160
+ });
161
+ }
162
+ function ComboboxList({ className, ...props }) {
163
+ return /* @__PURE__ */ jsx(ScrollArea, {
164
+ scrollbarGutter: true,
165
+ scrollFade: true,
166
+ children: /* @__PURE__ */ jsx(Combobox$1.List, {
167
+ className: cn("not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1 in-data-has-overflow-y:pe-3", className),
168
+ "data-slot": "combobox-list",
169
+ ...props
170
+ })
171
+ });
172
+ }
173
+ function ComboboxClear({ className, ...props }) {
174
+ return /* @__PURE__ */ jsx(Combobox$1.Clear, {
175
+ className,
176
+ "data-slot": "combobox-clear",
177
+ ...props
178
+ });
179
+ }
180
+ function ComboboxStatus({ className, ...props }) {
181
+ return /* @__PURE__ */ jsx(Combobox$1.Status, {
182
+ className: cn("px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0", className),
183
+ "data-slot": "combobox-status",
184
+ ...props
185
+ });
186
+ }
187
+ function ComboboxCollection({ ...props }) {
188
+ return /* @__PURE__ */ jsx(Combobox$1.Collection, {
189
+ "data-slot": "combobox-collection",
190
+ ...props
191
+ });
192
+ }
193
+ function ComboboxChips({ className, children, startAddon, ...props }) {
194
+ const { chipsRef } = React$1.useContext(ComboboxContext);
195
+ return /* @__PURE__ */ jsxs(Combobox$1.Chips, {
196
+ className: cn("relative inline-flex min-h-9 w-full flex-wrap gap-1 rounded-lg border border-input bg-background not-dark:bg-clip-padding p-[calc(--spacing(1)-1px)] text-base outline-none ring-ring/24 transition-shadow *:min-h-7 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/6%)] focus-within:border-ring focus-within:ring-[3px] has-disabled:pointer-events-none has-data-[size=lg]:min-h-10 has-data-[size=sm]:min-h-8 has-aria-invalid:border-destructive/36 has-disabled:opacity-64 has-[:disabled,:focus-within,[aria-invalid]]:shadow-none focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/16 has-data-[size=lg]:*:min-h-8 has-data-[size=sm]:*:min-h-6 sm:min-h-8 sm:text-sm sm:has-data-[size=lg]:min-h-9 sm:has-data-[size=sm]:min-h-7 sm:*:min-h-6 sm:has-data-[size=lg]:*:min-h-7 sm:has-data-[size=sm]:*:min-h-5 dark:not-has-disabled:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", className),
197
+ "data-slot": "combobox-chips",
198
+ onMouseDown: (e) => {
199
+ if (e.target.closest("[data-slot=\"combobox-chip\"]") || !chipsRef?.current) return;
200
+ e.preventDefault();
201
+ const input = chipsRef.current.querySelector("input");
202
+ if (input && !chipsRef.current.querySelector("input:focus")) input.focus();
203
+ },
204
+ ref: chipsRef,
205
+ ...props,
206
+ children: [startAddon && /* @__PURE__ */ jsx("div", {
207
+ "aria-hidden": "true",
208
+ className: "[&_svg]:-ms-0.5 [&_svg]:-me-1.5 flex shrink-0 items-center ps-2 opacity-80 has-[~[data-size=sm]]:has-[+[data-slot=combobox-chip]]:pe-1.5 has-[~[data-size=sm]]:ps-1.5 has-[+[data-slot=combobox-chip]]:pe-2 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
209
+ "data-slot": "combobox-start-addon",
210
+ children: startAddon
211
+ }), children]
212
+ });
213
+ }
214
+ function ComboboxChip({ children, ...props }) {
215
+ return /* @__PURE__ */ jsxs(Combobox$1.Chip, {
216
+ className: "flex items-center rounded-[calc(var(--radius-md)-1px)] bg-accent ps-2 font-medium text-accent-foreground text-sm outline-none sm:text-xs/(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5",
217
+ "data-slot": "combobox-chip",
218
+ ...props,
219
+ children: [children, /* @__PURE__ */ jsx(ComboboxChipRemove, {})]
220
+ });
221
+ }
222
+ function ComboboxChipRemove({ ...props }) {
223
+ return /* @__PURE__ */ jsx(Combobox$1.ChipRemove, {
224
+ "aria-label": "Remove",
225
+ className: "h-full shrink-0 cursor-pointer px-1.5 opacity-80 hover:opacity-100 [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5",
226
+ "data-slot": "combobox-chip-remove",
227
+ ...props,
228
+ children: /* @__PURE__ */ jsx(XIcon, {})
229
+ });
230
+ }
231
+ const useComboboxFilter = Combobox$1.useFilter;
232
+ const ComboboxContent = ComboboxPopup;
519
233
 
234
+ //#endregion
520
235
  export { Combobox, ComboboxChip, ComboboxChips, ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, useComboboxFilter };
521
- //# sourceMappingURL=combobox.js.map
522
236
  //# sourceMappingURL=combobox.js.map