@fragiola/primitives-vue 0.0.0-stage → 0.1.0

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 (544) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/LICENSE +21 -0
  3. package/README.md +41 -2
  4. package/dist/accordion-CmKuKHkK.js +278 -0
  5. package/dist/accordion-CmKuKHkK.js.map +1 -0
  6. package/dist/accordion.d.ts +4 -0
  7. package/dist/accordion.js +1 -0
  8. package/dist/alert-dialog-CPG51QOk.js +38 -0
  9. package/dist/alert-dialog-CPG51QOk.js.map +1 -0
  10. package/dist/alert-dialog.d.ts +9 -0
  11. package/dist/alert-dialog.js +1 -0
  12. package/dist/aspect-ratio-Ba7GaRnV.js +37 -0
  13. package/dist/aspect-ratio-Ba7GaRnV.js.map +1 -0
  14. package/dist/aspect-ratio.d.ts +3 -0
  15. package/dist/aspect-ratio.js +1 -0
  16. package/dist/async-list-Dc8wqcxe.js +39 -0
  17. package/dist/async-list-Dc8wqcxe.js.map +1 -0
  18. package/dist/async-list.d.ts +2 -0
  19. package/dist/async-list.js +1 -0
  20. package/dist/autocomplete-virtual-D_2Wuih7.js +55 -0
  21. package/dist/autocomplete-virtual-D_2Wuih7.js.map +1 -0
  22. package/dist/autocomplete-virtual.d.ts +2 -0
  23. package/dist/autocomplete-virtual.js +3 -0
  24. package/dist/autocomplete.d.ts +6 -0
  25. package/dist/autocomplete.js +1 -0
  26. package/dist/avatar-DdDGa6x7.js +166 -0
  27. package/dist/avatar-DdDGa6x7.js.map +1 -0
  28. package/dist/avatar.d.ts +3 -0
  29. package/dist/avatar.js +1 -0
  30. package/dist/breadcrumbs-BFAjlnC_.js +131 -0
  31. package/dist/breadcrumbs-BFAjlnC_.js.map +1 -0
  32. package/dist/breadcrumbs.d.ts +3 -0
  33. package/dist/breadcrumbs.js +1 -0
  34. package/dist/button-DVUcUCXc.js +56 -0
  35. package/dist/button-DVUcUCXc.js.map +1 -0
  36. package/dist/button-attributes-Ue6sUse5.js +83 -0
  37. package/dist/button-attributes-Ue6sUse5.js.map +1 -0
  38. package/dist/button.d.ts +3 -0
  39. package/dist/button.js +1 -0
  40. package/dist/calendar-preset-Bjc7rcNX.js +84 -0
  41. package/dist/calendar-preset-Bjc7rcNX.js.map +1 -0
  42. package/dist/calendar-preset.d.ts +3 -0
  43. package/dist/calendar-preset.js +3 -0
  44. package/dist/calendar-prev-button-jluYmM-3.js +307 -0
  45. package/dist/calendar-prev-button-jluYmM-3.js.map +1 -0
  46. package/dist/calendar-root-base-C9dfkl55.js +310 -0
  47. package/dist/calendar-root-base-C9dfkl55.js.map +1 -0
  48. package/dist/calendar-view-Djy5iHGK.js +160 -0
  49. package/dist/calendar-view-Djy5iHGK.js.map +1 -0
  50. package/dist/calendar-view.d.ts +4 -0
  51. package/dist/calendar-view.js +4 -0
  52. package/dist/calendar.d.ts +5 -0
  53. package/dist/calendar.js +1 -0
  54. package/dist/carousel-BOacnCmz.js +553 -0
  55. package/dist/carousel-BOacnCmz.js.map +1 -0
  56. package/dist/carousel.d.ts +4 -0
  57. package/dist/carousel.js +1 -0
  58. package/dist/cascade-select-B-Nf6eOA.js +697 -0
  59. package/dist/cascade-select-B-Nf6eOA.js.map +1 -0
  60. package/dist/cascade-select.d.ts +6 -0
  61. package/dist/cascade-select.js +1 -0
  62. package/dist/change-details-Bc4-Xzdm.d.ts +37 -0
  63. package/dist/checkbox-D5NvqFgS.js +230 -0
  64. package/dist/checkbox-D5NvqFgS.js.map +1 -0
  65. package/dist/checkbox-group-C3XftlZd.js +104 -0
  66. package/dist/checkbox-group-C3XftlZd.js.map +1 -0
  67. package/dist/checkbox-group-context-C0Z5sWM1.js +5 -0
  68. package/dist/checkbox-group-context-C0Z5sWM1.js.map +1 -0
  69. package/dist/checkbox-group.d.ts +4 -0
  70. package/dist/checkbox-group.js +1 -0
  71. package/dist/checkbox.d.ts +4 -0
  72. package/dist/checkbox.js +1 -0
  73. package/dist/clipboard-BM-4-lTv.js +195 -0
  74. package/dist/clipboard-BM-4-lTv.js.map +1 -0
  75. package/dist/clipboard.d.ts +4 -0
  76. package/dist/clipboard.js +1 -0
  77. package/dist/collapsible-DSCxhlQN.js +158 -0
  78. package/dist/collapsible-DSCxhlQN.js.map +1 -0
  79. package/dist/collapsible.d.ts +4 -0
  80. package/dist/collapsible.js +1 -0
  81. package/dist/color-area-uEHPo-Nq.js +350 -0
  82. package/dist/color-area-uEHPo-Nq.js.map +1 -0
  83. package/dist/color-area.d.ts +4 -0
  84. package/dist/color-area.js +1 -0
  85. package/dist/color-field-Di2IbTa3.js +384 -0
  86. package/dist/color-field-Di2IbTa3.js.map +1 -0
  87. package/dist/color-field.d.ts +4 -0
  88. package/dist/color-field.js +1 -0
  89. package/dist/color-picker-BgFgq5R0.js +311 -0
  90. package/dist/color-picker-BgFgq5R0.js.map +1 -0
  91. package/dist/color-picker-binding-CJ-Cbxbj.js +5 -0
  92. package/dist/color-picker-binding-CJ-Cbxbj.js.map +1 -0
  93. package/dist/color-picker-popover-Dx6LX0V3.js +233 -0
  94. package/dist/color-picker-popover-Dx6LX0V3.js.map +1 -0
  95. package/dist/color-picker-popover.d.ts +6 -0
  96. package/dist/color-picker-popover.js +1 -0
  97. package/dist/color-picker.d.ts +4 -0
  98. package/dist/color-picker.js +1 -0
  99. package/dist/color-slider-BCqoolnY.js +410 -0
  100. package/dist/color-slider-BCqoolnY.js.map +1 -0
  101. package/dist/color-slider.d.ts +4 -0
  102. package/dist/color-slider.js +1 -0
  103. package/dist/color-swatch-C-8IN28V.js +54 -0
  104. package/dist/color-swatch-C-8IN28V.js.map +1 -0
  105. package/dist/color-swatch-picker-CU1wrhjX.js +312 -0
  106. package/dist/color-swatch-picker-CU1wrhjX.js.map +1 -0
  107. package/dist/color-swatch-picker.d.ts +4 -0
  108. package/dist/color-swatch-picker.js +1 -0
  109. package/dist/color-swatch.d.ts +3 -0
  110. package/dist/color-swatch.js +1 -0
  111. package/dist/color-wheel-F_BoXKON.js +284 -0
  112. package/dist/color-wheel-F_BoXKON.js.map +1 -0
  113. package/dist/color-wheel.d.ts +4 -0
  114. package/dist/color-wheel.js +1 -0
  115. package/dist/combobox-virtual-DTRTVq5N.js +56 -0
  116. package/dist/combobox-virtual-DTRTVq5N.js.map +1 -0
  117. package/dist/combobox-virtual.d.ts +2 -0
  118. package/dist/combobox-virtual.js +3 -0
  119. package/dist/combobox.d.ts +6 -0
  120. package/dist/combobox.js +1 -0
  121. package/dist/command-virtual-LoTBDEY5.js +59 -0
  122. package/dist/command-virtual-LoTBDEY5.js.map +1 -0
  123. package/dist/command-virtual.d.ts +3 -0
  124. package/dist/command-virtual.js +3 -0
  125. package/dist/command.d.ts +4 -0
  126. package/dist/command.js +1 -0
  127. package/dist/context-menu-zdHIGS9E.js +151 -0
  128. package/dist/context-menu-zdHIGS9E.js.map +1 -0
  129. package/dist/context-menu.d.ts +7 -0
  130. package/dist/context-menu.js +1 -0
  131. package/dist/date-field-pgSTZiPb.js +78 -0
  132. package/dist/date-field-pgSTZiPb.js.map +1 -0
  133. package/dist/date-field-root-base-CYLuAykm.js +212 -0
  134. package/dist/date-field-root-base-CYLuAykm.js.map +1 -0
  135. package/dist/date-field.d.ts +4 -0
  136. package/dist/date-field.js +1 -0
  137. package/dist/date-picker-input-CiuuRiWZ.js +16 -0
  138. package/dist/date-picker-input-CiuuRiWZ.js.map +1 -0
  139. package/dist/date-picker-input-root-base-ExPSLeKw.js +318 -0
  140. package/dist/date-picker-input-root-base-ExPSLeKw.js.map +1 -0
  141. package/dist/date-picker-input.d.ts +4 -0
  142. package/dist/date-picker-input.js +3 -0
  143. package/dist/date-picker-trigger-C2BlzvfR.js +349 -0
  144. package/dist/date-picker-trigger-C2BlzvfR.js.map +1 -0
  145. package/dist/date-picker.d.ts +6 -0
  146. package/dist/date-picker.js +1 -0
  147. package/dist/date-range-field-Bygmkl5c.js +80 -0
  148. package/dist/date-range-field-Bygmkl5c.js.map +1 -0
  149. package/dist/date-range-field-input-CivpQMYd.js +69 -0
  150. package/dist/date-range-field-input-CivpQMYd.js.map +1 -0
  151. package/dist/date-range-field-root-base-BP26TSWz.js +267 -0
  152. package/dist/date-range-field-root-base-BP26TSWz.js.map +1 -0
  153. package/dist/date-range-field.d.ts +4 -0
  154. package/dist/date-range-field.js +1 -0
  155. package/dist/date-range-picker-input-BUNCCXUY.js +17 -0
  156. package/dist/date-range-picker-input-BUNCCXUY.js.map +1 -0
  157. package/dist/date-range-picker-input.d.ts +4 -0
  158. package/dist/date-range-picker-input.js +3 -0
  159. package/dist/date-range-picker.d.ts +7 -0
  160. package/dist/date-range-picker.js +1 -0
  161. package/dist/dialog-MNjIMCfA.js +38 -0
  162. package/dist/dialog-MNjIMCfA.js.map +1 -0
  163. package/dist/dialog-root-base-jbZipaoQ.js +329 -0
  164. package/dist/dialog-root-base-jbZipaoQ.js.map +1 -0
  165. package/dist/dialog-viewport-tYqWTs9Q.d.ts +54 -0
  166. package/dist/dialog.d.ts +9 -0
  167. package/dist/dialog.js +1 -0
  168. package/dist/direction-CN_deiZU.js +30 -0
  169. package/dist/direction-CN_deiZU.js.map +1 -0
  170. package/dist/direction-context-D-C_P6Lm.js +19 -0
  171. package/dist/direction-context-D-C_P6Lm.js.map +1 -0
  172. package/dist/direction.d.ts +2 -0
  173. package/dist/direction.js +1 -0
  174. package/dist/drawer-BcnuGtEt.js +357 -0
  175. package/dist/drawer-BcnuGtEt.js.map +1 -0
  176. package/dist/drawer.d.ts +9 -0
  177. package/dist/drawer.js +1 -0
  178. package/dist/drop-zone-vFJ5Kvsy.js +98 -0
  179. package/dist/drop-zone-vFJ5Kvsy.js.map +1 -0
  180. package/dist/drop-zone.d.ts +4 -0
  181. package/dist/drop-zone.js +1 -0
  182. package/dist/editable-CabzXgiN.js +436 -0
  183. package/dist/editable-CabzXgiN.js.map +1 -0
  184. package/dist/editable.d.ts +4 -0
  185. package/dist/editable.js +1 -0
  186. package/dist/field-DQ2d5nhC.js +397 -0
  187. package/dist/field-DQ2d5nhC.js.map +1 -0
  188. package/dist/field.d.ts +4 -0
  189. package/dist/field.js +1 -0
  190. package/dist/fieldset-CmmDzOPs.js +80 -0
  191. package/dist/fieldset-CmmDzOPs.js.map +1 -0
  192. package/dist/fieldset-context-DtEOoG6M.js +5 -0
  193. package/dist/fieldset-context-DtEOoG6M.js.map +1 -0
  194. package/dist/fieldset.d.ts +3 -0
  195. package/dist/fieldset.js +1 -0
  196. package/dist/file-upload-_Hh-STdv.js +644 -0
  197. package/dist/file-upload-_Hh-STdv.js.map +1 -0
  198. package/dist/file-upload.d.ts +4 -0
  199. package/dist/file-upload.js +1 -0
  200. package/dist/form-context-DBnVT1lw.js +5 -0
  201. package/dist/form-context-DBnVT1lw.js.map +1 -0
  202. package/dist/form-s9HijjTL.js +92 -0
  203. package/dist/form-s9HijjTL.js.map +1 -0
  204. package/dist/form.d.ts +3 -0
  205. package/dist/form.js +1 -0
  206. package/dist/hover-card-rmd0fD17.js +355 -0
  207. package/dist/hover-card-rmd0fD17.js.map +1 -0
  208. package/dist/hover-card.d.ts +9 -0
  209. package/dist/hover-card.js +1 -0
  210. package/dist/index-5WtjXdX9.d.ts +63 -0
  211. package/dist/index-5eBkkEtv.d.ts +36 -0
  212. package/dist/index-B-vqAG6g.d.ts +33 -0
  213. package/dist/index-B1uYYVtV.d.ts +18 -0
  214. package/dist/index-B8E3X1CK.d.ts +66 -0
  215. package/dist/index-B8Ufhgzu.d.ts +36 -0
  216. package/dist/index-BJz7OWbi.d.ts +88 -0
  217. package/dist/index-BMjRueuv.d.ts +40 -0
  218. package/dist/index-BP7Tmb0E.d.ts +95 -0
  219. package/dist/index-Bbb1Zgwo.d.ts +50 -0
  220. package/dist/index-BdJFU5tH.d.ts +28 -0
  221. package/dist/index-BdfnRo-h.d.ts +55 -0
  222. package/dist/index-BniQvFN-.d.ts +38 -0
  223. package/dist/index-Bt0B-8RV.d.ts +14 -0
  224. package/dist/index-BuWJcRPC.d.ts +18 -0
  225. package/dist/index-Byf0GNd9.d.ts +41 -0
  226. package/dist/index-BzHLkAWU.d.ts +35 -0
  227. package/dist/index-C-QYKtWy.d.ts +28 -0
  228. package/dist/index-C7nh2Oil.d.ts +40 -0
  229. package/dist/index-CDKebSlA.d.ts +41 -0
  230. package/dist/index-CFPqV6qJ.d.ts +72 -0
  231. package/dist/index-CRJv_zWm.d.ts +37 -0
  232. package/dist/index-CTzUalDO.d.ts +76 -0
  233. package/dist/index-CZHLD5cJ.d.ts +17 -0
  234. package/dist/index-Cgwn5qgy.d.ts +88 -0
  235. package/dist/index-Ch4h1DFC.d.ts +55 -0
  236. package/dist/index-Cj3B9gY_.d.ts +50 -0
  237. package/dist/index-Cj6NwCBD.d.ts +44 -0
  238. package/dist/index-CkDThwop.d.ts +21 -0
  239. package/dist/index-Cn-D14iz.d.ts +13 -0
  240. package/dist/index-CpTiLSql.d.ts +53 -0
  241. package/dist/index-CqP363e5.d.ts +118 -0
  242. package/dist/index-Cv4dRdEa.d.ts +72 -0
  243. package/dist/index-CyI637MF.d.ts +37 -0
  244. package/dist/index-D11YCkvR.d.ts +42 -0
  245. package/dist/index-D3yyJGzf.d.ts +74 -0
  246. package/dist/index-D5PbKxcs.d.ts +26 -0
  247. package/dist/index-DAYklR-H.d.ts +18 -0
  248. package/dist/index-DIZSgXHM.d.ts +79 -0
  249. package/dist/index-DZckp3H0.d.ts +37 -0
  250. package/dist/index-DaqoBvQf.d.ts +56 -0
  251. package/dist/index-Df9i45Gr.d.ts +65 -0
  252. package/dist/index-DqI6n06W.d.ts +59 -0
  253. package/dist/index-Drp7svmT.d.ts +30 -0
  254. package/dist/index-DxsUcSGT.d.ts +99 -0
  255. package/dist/index-Dyyi-1mv.d.ts +35 -0
  256. package/dist/index-I2ewgOGz.d.ts +76 -0
  257. package/dist/index-JGhlANKo.d.ts +24 -0
  258. package/dist/index-KASc7z5u.d.ts +38 -0
  259. package/dist/index-LTcmDERY.d.ts +65 -0
  260. package/dist/index-Mf2RPgmw.d.ts +38 -0
  261. package/dist/index-NdY27G_d.d.ts +58 -0
  262. package/dist/index-QO79pDtI.d.ts +70 -0
  263. package/dist/index-S0FIwOSw.d.ts +59 -0
  264. package/dist/index-UxsyZS_A.d.ts +23 -0
  265. package/dist/index-W8aOtVIu.d.ts +40 -0
  266. package/dist/index-WC9xwMaX.d.ts +34 -0
  267. package/dist/index-Xwb9OtVU.d.ts +7 -0
  268. package/dist/index-ZWJJ2V_J.d.ts +49 -0
  269. package/dist/index-_Q_N8ZbU.d.ts +35 -0
  270. package/dist/index-bC3hHzam.d.ts +101 -0
  271. package/dist/index-baY49J-s.d.ts +15 -0
  272. package/dist/index-dCTvA7uS.d.ts +20 -0
  273. package/dist/index-mhpoLESL.d.ts +77 -0
  274. package/dist/index-p3t0BKd4.d.ts +22 -0
  275. package/dist/index-sgaMj_3p.d.ts +69 -0
  276. package/dist/index-tSLNRqTo.d.ts +33 -0
  277. package/dist/index-t_lSQgLA.d.ts +1346 -0
  278. package/dist/index-uL1dEAhG.d.ts +28 -0
  279. package/dist/index.d.ts +79 -0
  280. package/dist/index.js +106 -0
  281. package/dist/label-Ce-gIayi.js +35 -0
  282. package/dist/label-Ce-gIayi.js.map +1 -0
  283. package/dist/label.d.ts +3 -0
  284. package/dist/label.js +1 -0
  285. package/dist/labelled-part-DB2rXJFG.js +56 -0
  286. package/dist/labelled-part-DB2rXJFG.js.map +1 -0
  287. package/dist/link-CZ3ISaPX.js +42 -0
  288. package/dist/link-CZ3ISaPX.js.map +1 -0
  289. package/dist/link-attributes-D9UusWws.js +29 -0
  290. package/dist/link-attributes-D9UusWws.js.map +1 -0
  291. package/dist/link.d.ts +3 -0
  292. package/dist/link.js +1 -0
  293. package/dist/listbox-virtual-He6BWlPj.js +291 -0
  294. package/dist/listbox-virtual-He6BWlPj.js.map +1 -0
  295. package/dist/listbox-virtual.d.ts +5 -0
  296. package/dist/listbox-virtual.js +3 -0
  297. package/dist/listbox.d.ts +4 -0
  298. package/dist/listbox.js +1 -0
  299. package/dist/live-region-style-9ofmajhO.js +46 -0
  300. package/dist/live-region-style-9ofmajhO.js.map +1 -0
  301. package/dist/menu-D7TVxPdb.js +144 -0
  302. package/dist/menu-D7TVxPdb.js.map +1 -0
  303. package/dist/menu-bar-context-k5vMlwmW.js +13 -0
  304. package/dist/menu-bar-context-k5vMlwmW.js.map +1 -0
  305. package/dist/menu-submenu-trigger-ClI2Pm4X.js +885 -0
  306. package/dist/menu-submenu-trigger-ClI2Pm4X.js.map +1 -0
  307. package/dist/menu-submenu-trigger-DNH8_uUB.d.ts +127 -0
  308. package/dist/menu.d.ts +10 -0
  309. package/dist/menu.js +1 -0
  310. package/dist/menubar-CQn3AOiQ.js +212 -0
  311. package/dist/menubar-CQn3AOiQ.js.map +1 -0
  312. package/dist/menubar.d.ts +3 -0
  313. package/dist/menubar.js +1 -0
  314. package/dist/meter-7Qd_WaUY.js +202 -0
  315. package/dist/meter-7Qd_WaUY.js.map +1 -0
  316. package/dist/meter.d.ts +3 -0
  317. package/dist/meter.js +1 -0
  318. package/dist/month-calendar-root-base-VcD8ZNW5.js +354 -0
  319. package/dist/month-calendar-root-base-VcD8ZNW5.js.map +1 -0
  320. package/dist/month-calendar.d.ts +5 -0
  321. package/dist/month-calendar.js +1 -0
  322. package/dist/month-picker-DzOYqW1S.js +15 -0
  323. package/dist/month-picker-DzOYqW1S.js.map +1 -0
  324. package/dist/month-picker-root-base-ByMK_Mfq.js +158 -0
  325. package/dist/month-picker-root-base-ByMK_Mfq.js.map +1 -0
  326. package/dist/month-picker.d.ts +7 -0
  327. package/dist/month-picker.js +3 -0
  328. package/dist/month-range-calendar-CJAWu1-Z.js +18 -0
  329. package/dist/month-range-calendar-CJAWu1-Z.js.map +1 -0
  330. package/dist/month-range-calendar.d.ts +5 -0
  331. package/dist/month-range-calendar.js +3 -0
  332. package/dist/month-range-picker-CRJDG2HG.js +15 -0
  333. package/dist/month-range-picker-CRJDG2HG.js.map +1 -0
  334. package/dist/month-range-picker.d.ts +8 -0
  335. package/dist/month-range-picker.js +3 -0
  336. package/dist/multiple-calendar-BIb2zfBH.js +176 -0
  337. package/dist/multiple-calendar-BIb2zfBH.js.map +1 -0
  338. package/dist/multiple-calendar.d.ts +5 -0
  339. package/dist/multiple-calendar.js +3 -0
  340. package/dist/navigation-menu-COTxGol_.js +727 -0
  341. package/dist/navigation-menu-COTxGol_.js.map +1 -0
  342. package/dist/navigation-menu.d.ts +5 -0
  343. package/dist/navigation-menu.js +1 -0
  344. package/dist/number-field-CqxEnwiS.js +581 -0
  345. package/dist/number-field-CqxEnwiS.js.map +1 -0
  346. package/dist/number-field.d.ts +4 -0
  347. package/dist/number-field.js +1 -0
  348. package/dist/otp-field-DIDuypLU.js +420 -0
  349. package/dist/otp-field-DIDuypLU.js.map +1 -0
  350. package/dist/otp-field.d.ts +4 -0
  351. package/dist/otp-field.js +1 -0
  352. package/dist/overlay-handle-DUptsQOb.js +42 -0
  353. package/dist/overlay-handle-DUptsQOb.js.map +1 -0
  354. package/dist/overlay-handle-DzC9LJQo.d.ts +16 -0
  355. package/dist/overlay-portal-Cmn7Dt7E.d.ts +30 -0
  356. package/dist/overlay-portal-ZNtXmoFd.js +32 -0
  357. package/dist/overlay-portal-ZNtXmoFd.js.map +1 -0
  358. package/dist/pagination-BNUjFYxK.js +264 -0
  359. package/dist/pagination-BNUjFYxK.js.map +1 -0
  360. package/dist/pagination.d.ts +4 -0
  361. package/dist/pagination.js +1 -0
  362. package/dist/parts--mC44S1N.js +1023 -0
  363. package/dist/parts--mC44S1N.js.map +1 -0
  364. package/dist/parts-BP00C3Q5.js +874 -0
  365. package/dist/parts-BP00C3Q5.js.map +1 -0
  366. package/dist/parts-CMh29O5y.js +14 -0
  367. package/dist/parts-CMh29O5y.js.map +1 -0
  368. package/dist/parts-CZqNGRqe.js +20 -0
  369. package/dist/parts-CZqNGRqe.js.map +1 -0
  370. package/dist/parts-DMy2yQZs.js +254 -0
  371. package/dist/parts-DMy2yQZs.js.map +1 -0
  372. package/dist/parts-DVv0aov9.js +14 -0
  373. package/dist/parts-DVv0aov9.js.map +1 -0
  374. package/dist/parts-M3ThgZzl.js +489 -0
  375. package/dist/parts-M3ThgZzl.js.map +1 -0
  376. package/dist/parts-stPOp8dr.js +451 -0
  377. package/dist/parts-stPOp8dr.js.map +1 -0
  378. package/dist/parts-uxRkRrFr.js +668 -0
  379. package/dist/parts-uxRkRrFr.js.map +1 -0
  380. package/dist/password-input-DC39W-do.js +231 -0
  381. package/dist/password-input-DC39W-do.js.map +1 -0
  382. package/dist/password-input.d.ts +4 -0
  383. package/dist/password-input.js +1 -0
  384. package/dist/popover-BaQTGAYJ.js +328 -0
  385. package/dist/popover-BaQTGAYJ.js.map +1 -0
  386. package/dist/popover.d.ts +9 -0
  387. package/dist/popover.js +1 -0
  388. package/dist/progress-DH1Xrj73.js +219 -0
  389. package/dist/progress-DH1Xrj73.js.map +1 -0
  390. package/dist/progress.d.ts +3 -0
  391. package/dist/progress.js +1 -0
  392. package/dist/public-component-AV8E7mGp.js +8 -0
  393. package/dist/public-component-AV8E7mGp.js.map +1 -0
  394. package/dist/public-component-DYpU9aDh.d.ts +33 -0
  395. package/dist/radio-B9YCSnFs.js +159 -0
  396. package/dist/radio-B9YCSnFs.js.map +1 -0
  397. package/dist/radio-group-CmSF4FTc.js +173 -0
  398. package/dist/radio-group-CmSF4FTc.js.map +1 -0
  399. package/dist/radio-group-context-C196JZ9D.js +5 -0
  400. package/dist/radio-group-context-C196JZ9D.js.map +1 -0
  401. package/dist/radio-group.d.ts +4 -0
  402. package/dist/radio-group.js +1 -0
  403. package/dist/radio.d.ts +3 -0
  404. package/dist/radio.js +1 -0
  405. package/dist/range-calendar-BDbNdL75.js +20 -0
  406. package/dist/range-calendar-BDbNdL75.js.map +1 -0
  407. package/dist/range-calendar.d.ts +5 -0
  408. package/dist/range-calendar.js +1 -0
  409. package/dist/rating-oC2t52av.js +351 -0
  410. package/dist/rating-oC2t52av.js.map +1 -0
  411. package/dist/rating.d.ts +4 -0
  412. package/dist/rating.js +1 -0
  413. package/dist/render-part-B5XVbHaS.js +36 -0
  414. package/dist/render-part-B5XVbHaS.js.map +1 -0
  415. package/dist/render-part-BaTKiWBp.d.ts +28 -0
  416. package/dist/render.d.ts +3 -0
  417. package/dist/render.js +3 -0
  418. package/dist/roving-context-LyHQFJqZ.js +32 -0
  419. package/dist/roving-context-LyHQFJqZ.js.map +1 -0
  420. package/dist/scroll-area-_EApTP33.js +328 -0
  421. package/dist/scroll-area-_EApTP33.js.map +1 -0
  422. package/dist/scroll-area.d.ts +3 -0
  423. package/dist/scroll-area.js +1 -0
  424. package/dist/search-field-DJIr926A.js +221 -0
  425. package/dist/search-field-DJIr926A.js.map +1 -0
  426. package/dist/search-field.d.ts +4 -0
  427. package/dist/search-field.js +1 -0
  428. package/dist/segmented-control-BMvmqBpR.js +389 -0
  429. package/dist/segmented-control-BMvmqBpR.js.map +1 -0
  430. package/dist/segmented-control.d.ts +4 -0
  431. package/dist/segmented-control.js +1 -0
  432. package/dist/select-virtual-BwZrX4bh.js +53 -0
  433. package/dist/select-virtual-BwZrX4bh.js.map +1 -0
  434. package/dist/select-virtual.d.ts +3 -0
  435. package/dist/select-virtual.js +3 -0
  436. package/dist/select.d.ts +6 -0
  437. package/dist/select.js +1 -0
  438. package/dist/separator-SgHyzEHB.js +42 -0
  439. package/dist/separator-SgHyzEHB.js.map +1 -0
  440. package/dist/separator.d.ts +3 -0
  441. package/dist/separator.js +1 -0
  442. package/dist/slider-DU5Cx7yj.js +539 -0
  443. package/dist/slider-DU5Cx7yj.js.map +1 -0
  444. package/dist/slider.d.ts +4 -0
  445. package/dist/slider.js +1 -0
  446. package/dist/state-attributes-DhboDeMS.js +14 -0
  447. package/dist/state-attributes-DhboDeMS.js.map +1 -0
  448. package/dist/steps-Dl_mMqRB.js +363 -0
  449. package/dist/steps-Dl_mMqRB.js.map +1 -0
  450. package/dist/steps.d.ts +4 -0
  451. package/dist/steps.js +1 -0
  452. package/dist/switch-CT9QBKOs.js +183 -0
  453. package/dist/switch-CT9QBKOs.js.map +1 -0
  454. package/dist/switch.d.ts +4 -0
  455. package/dist/switch.js +1 -0
  456. package/dist/tabs-BhVbQ7AV.js +369 -0
  457. package/dist/tabs-BhVbQ7AV.js.map +1 -0
  458. package/dist/tabs.d.ts +4 -0
  459. package/dist/tabs.js +1 -0
  460. package/dist/tag-group-DdpjWmzb.js +422 -0
  461. package/dist/tag-group-DdpjWmzb.js.map +1 -0
  462. package/dist/tag-group.d.ts +4 -0
  463. package/dist/tag-group.js +1 -0
  464. package/dist/tags-input-Iw3mST3A.js +627 -0
  465. package/dist/tags-input-Iw3mST3A.js.map +1 -0
  466. package/dist/tags-input.d.ts +4 -0
  467. package/dist/tags-input.js +1 -0
  468. package/dist/time-field-5Ghk_4SZ.js +76 -0
  469. package/dist/time-field-5Ghk_4SZ.js.map +1 -0
  470. package/dist/time-field.d.ts +4 -0
  471. package/dist/time-field.js +1 -0
  472. package/dist/time-range-field-DNOZQK4F.js +77 -0
  473. package/dist/time-range-field-DNOZQK4F.js.map +1 -0
  474. package/dist/time-range-field.d.ts +4 -0
  475. package/dist/time-range-field.js +1 -0
  476. package/dist/toast-DBKxX79M.js +426 -0
  477. package/dist/toast-DBKxX79M.js.map +1 -0
  478. package/dist/toast.d.ts +3 -0
  479. package/dist/toast.js +1 -0
  480. package/dist/toggle-Cca0PFQv.js +101 -0
  481. package/dist/toggle-Cca0PFQv.js.map +1 -0
  482. package/dist/toggle-group-DTUrLX_H.js +102 -0
  483. package/dist/toggle-group-DTUrLX_H.js.map +1 -0
  484. package/dist/toggle-group-context-gMEC8r-Z.js +5 -0
  485. package/dist/toggle-group-context-gMEC8r-Z.js.map +1 -0
  486. package/dist/toggle-group.d.ts +4 -0
  487. package/dist/toggle-group.js +1 -0
  488. package/dist/toggle.d.ts +4 -0
  489. package/dist/toggle.js +1 -0
  490. package/dist/toolbar-WU8JwFd0.js +272 -0
  491. package/dist/toolbar-WU8JwFd0.js.map +1 -0
  492. package/dist/toolbar.d.ts +3 -0
  493. package/dist/toolbar.js +1 -0
  494. package/dist/tooltip-C1kKsTSh.js +358 -0
  495. package/dist/tooltip-C1kKsTSh.js.map +1 -0
  496. package/dist/tooltip.d.ts +9 -0
  497. package/dist/tooltip.js +1 -0
  498. package/dist/use-color-picker-binding-BrG-whys.js +32 -0
  499. package/dist/use-color-picker-binding-BrG-whys.js.map +1 -0
  500. package/dist/use-controllable-B46G4v0A.js +30 -0
  501. package/dist/use-controllable-B46G4v0A.js.map +1 -0
  502. package/dist/use-field-control-CdYqr0dK.js +109 -0
  503. package/dist/use-field-control-CdYqr0dK.js.map +1 -0
  504. package/dist/use-overlay-root-BkyTQIsX.js +296 -0
  505. package/dist/use-overlay-root-BkyTQIsX.js.map +1 -0
  506. package/dist/use-overlay-trigger-D9OXZ_6K.d.ts +12 -0
  507. package/dist/use-overlay-trigger-KM35pX0a.js +61 -0
  508. package/dist/use-overlay-trigger-KM35pX0a.js.map +1 -0
  509. package/dist/use-panel-transition-DF7f1nmF.js +112 -0
  510. package/dist/use-panel-transition-DF7f1nmF.js.map +1 -0
  511. package/dist/use-panel-transition-r_BlVRob.d.ts +2 -0
  512. package/dist/use-positioner-BD24G6q1.js +73 -0
  513. package/dist/use-positioner-BD24G6q1.js.map +1 -0
  514. package/dist/use-positioner-D98pYl_K.d.ts +12 -0
  515. package/dist/use-presence-BcvBOTDI.d.ts +3 -0
  516. package/dist/use-required-context-CPpEkr4Q.js +11 -0
  517. package/dist/use-required-context-CPpEkr4Q.js.map +1 -0
  518. package/dist/use-roving-composite-CW0mE_VU.js +71 -0
  519. package/dist/use-roving-composite-CW0mE_VU.js.map +1 -0
  520. package/dist/use-roving-item-B9Cil5Rq.js +42 -0
  521. package/dist/use-roving-item-B9Cil5Rq.js.map +1 -0
  522. package/dist/use-segment-group-CAlwM3KP.js +304 -0
  523. package/dist/use-segment-group-CAlwM3KP.js.map +1 -0
  524. package/dist/use-virtual-rows-DesBexmk.js +142 -0
  525. package/dist/use-virtual-rows-DesBexmk.js.map +1 -0
  526. package/dist/virtual-list-BNvYqnFf.js +49 -0
  527. package/dist/virtual-list-BNvYqnFf.js.map +1 -0
  528. package/dist/year-calendar-cYl3WHEM.js +18 -0
  529. package/dist/year-calendar-cYl3WHEM.js.map +1 -0
  530. package/dist/year-calendar.d.ts +5 -0
  531. package/dist/year-calendar.js +3 -0
  532. package/dist/year-picker-DYQZbF1h.js +15 -0
  533. package/dist/year-picker-DYQZbF1h.js.map +1 -0
  534. package/dist/year-picker.d.ts +8 -0
  535. package/dist/year-picker.js +3 -0
  536. package/dist/year-range-calendar-ODgfmdiv.js +18 -0
  537. package/dist/year-range-calendar-ODgfmdiv.js.map +1 -0
  538. package/dist/year-range-calendar.d.ts +5 -0
  539. package/dist/year-range-calendar.js +3 -0
  540. package/dist/year-range-picker-DKXlcy7I.js +15 -0
  541. package/dist/year-range-picker-DKXlcy7I.js.map +1 -0
  542. package/dist/year-range-picker.d.ts +8 -0
  543. package/dist/year-range-picker.js +3 -0
  544. package/package.json +548 -3
@@ -0,0 +1,489 @@
1
+ import { t as useRequiredContext } from "./use-required-context-CPpEkr4Q.js";
2
+ import { t as publicComponent } from "./public-component-AV8E7mGp.js";
3
+ import { n as renderPart, t as asProp } from "./render-part-B5XVbHaS.js";
4
+ import { t as elementSetter } from "./use-overlay-root-BkyTQIsX.js";
5
+ import { t as stateAttributes } from "./state-attributes-DhboDeMS.js";
6
+ import { t as useControllable } from "./use-controllable-B46G4v0A.js";
7
+ import { computed, defineComponent, nextTick, provide, ref, shallowRef, useId, watch } from "vue";
8
+ import { scrollIntoViewWithin } from "@fragiola/primitives/collection";
9
+ import { bestMatch, commandItemScore, commandKeyTarget, commandScore } from "@fragiola/primitives/command";
10
+ // src/components/command/command-context.ts
11
+ const CommandKey = Symbol("Command");
12
+ const CommandGroupKey = Symbol("CommandGroup");
13
+ /** The shown Items, in the list's order. */
14
+ function shownItems(context) {
15
+ const list = context.list.value;
16
+ if (list === null) return [];
17
+ return [...list.querySelectorAll("[role=\"option\"]:not([hidden])")].flatMap((element) => {
18
+ const info = context.items.get(element);
19
+ return info === void 0 ? [] : [{
20
+ element,
21
+ info
22
+ }];
23
+ });
24
+ }
25
+ // src/components/command/command-empty.ts
26
+ /**
27
+ * A polite live region, always rendered; its children only while no Item is shown and nothing
28
+ * loads, once mounted (spec/command.md).
29
+ */
30
+ const CommandEmpty = publicComponent(defineComponent({
31
+ name: "CommandEmpty",
32
+ inheritAttrs: false,
33
+ props: asProp,
34
+ setup(props, { attrs, slots }) {
35
+ const context = useRequiredContext(CommandKey, "Command.Empty");
36
+ return () => {
37
+ const shown = context.shownCount.value === 0 && !context.loading();
38
+ return renderPart("div", {
39
+ attrs,
40
+ slots
41
+ }, props.as, {}, {
42
+ role: "status",
43
+ "aria-live": "polite",
44
+ "aria-atomic": "true",
45
+ "data-primitives-part": "command-empty"
46
+ }, () => shown ? slots.default?.({ state: {} }) : void 0);
47
+ };
48
+ }
49
+ }));
50
+ // src/components/command/command-group.ts
51
+ /** A `group` of Items, named by its GroupLabel, hidden while it shows none (spec/command.md). */
52
+ const CommandGroup = publicComponent(defineComponent({
53
+ name: "CommandGroup",
54
+ inheritAttrs: false,
55
+ props: asProp,
56
+ setup(props, { attrs, slots }) {
57
+ const context = useRequiredContext(CommandKey, "Command.Group");
58
+ const labelId = `${useId()}-label`;
59
+ provide(CommandGroupKey, { labelId });
60
+ const element = shallowRef(null);
61
+ const setElement = elementSetter(element);
62
+ const hidden = ref(false);
63
+ watch(() => [
64
+ element.value,
65
+ context.search.value,
66
+ context.filter(),
67
+ context.version.value
68
+ ], ([node]) => {
69
+ if (node !== null) hidden.value = node.querySelector("[role=\"option\"]:not([hidden])") === null;
70
+ }, {
71
+ flush: "post",
72
+ immediate: true
73
+ });
74
+ return () => renderPart("div", {
75
+ attrs,
76
+ slots
77
+ }, props.as, { hidden: hidden.value }, {
78
+ role: "group",
79
+ "aria-labelledby": labelId,
80
+ hidden: hidden.value || void 0,
81
+ "data-primitives-part": "command-group",
82
+ ref: setElement
83
+ });
84
+ }
85
+ }));
86
+ // src/components/command/command-group-label.ts
87
+ /** Names its Group. */
88
+ const CommandGroupLabel = publicComponent(defineComponent({
89
+ name: "CommandGroupLabel",
90
+ inheritAttrs: false,
91
+ props: asProp,
92
+ setup(props, { attrs, slots }) {
93
+ const group = useRequiredContext(CommandGroupKey, "Command.GroupLabel");
94
+ return () => renderPart("div", {
95
+ attrs,
96
+ slots
97
+ }, props.as, {}, {
98
+ id: group.labelId,
99
+ "data-primitives-part": "command-group-label"
100
+ });
101
+ }
102
+ }));
103
+ // src/components/command/command-input.ts
104
+ /**
105
+ * The `combobox`: it keeps DOM focus, filters the Items as it is typed in and moves the
106
+ * highlight, announced with `aria-activedescendant` (spec/command.md, "Keyboard").
107
+ */
108
+ const CommandInput = publicComponent(defineComponent({
109
+ name: "CommandInput",
110
+ inheritAttrs: false,
111
+ props: asProp,
112
+ setup(props, { attrs, slots }) {
113
+ const context = useRequiredContext(CommandKey, "Command.Input");
114
+ const onInput = (event) => {
115
+ const element = event.target;
116
+ context.setSearch(element.value, {
117
+ reason: "input-change",
118
+ event
119
+ });
120
+ nextTick().then(() => {
121
+ const text = context.search.value;
122
+ if (element.value !== text) element.value = text;
123
+ });
124
+ };
125
+ const onKeydown = (event) => {
126
+ if (event.isComposing) return;
127
+ const shown = shownItems(context);
128
+ const highlighted = context.highlighted.value;
129
+ const current = shown.findIndex(({ info }) => info.value === highlighted);
130
+ const target = commandKeyTarget(event, current, shown.length, context.loopFocus());
131
+ if (target !== null) {
132
+ event.preventDefault();
133
+ context.highlighted.value = shown[target]?.info.value ?? null;
134
+ return;
135
+ }
136
+ if (event.key === "Enter") {
137
+ const item = shown[current]?.info;
138
+ if (item !== void 0) {
139
+ event.preventDefault();
140
+ if (!item.disabled) item.select(event);
141
+ }
142
+ return;
143
+ }
144
+ const pages = context.pages.value;
145
+ if (event.key === "Backspace" && event.currentTarget.value === "" && pages.length > 0) {
146
+ event.preventDefault();
147
+ context.setPages(pages.slice(0, -1), {
148
+ reason: "backspace-key",
149
+ event
150
+ });
151
+ }
152
+ };
153
+ return () => {
154
+ const highlighted = context.highlighted.value;
155
+ context.version.value;
156
+ let active;
157
+ for (const info of context.items.values()) if (info.value === highlighted) active = info.id;
158
+ return renderPart("input", {
159
+ attrs,
160
+ slots
161
+ }, props.as, {}, {
162
+ type: "text",
163
+ role: "combobox",
164
+ "aria-expanded": "true",
165
+ "aria-controls": context.listId,
166
+ "aria-autocomplete": "list",
167
+ "aria-activedescendant": active,
168
+ autocomplete: "off",
169
+ spellcheck: "false",
170
+ value: context.search.value,
171
+ "data-primitives-part": "command-input",
172
+ onInput,
173
+ onKeydown
174
+ });
175
+ };
176
+ }
177
+ }));
178
+ // src/components/command/command-item.ts
179
+ const NO_KEYWORDS = [];
180
+ /** An `option`: an action, hidden while it does not match the text (spec/command.md). */
181
+ const CommandItem = publicComponent(defineComponent({
182
+ name: "CommandItem",
183
+ inheritAttrs: false,
184
+ props: {
185
+ ...asProp,
186
+ value: {
187
+ type: String,
188
+ required: true
189
+ },
190
+ keywords: {
191
+ type: Array,
192
+ default: () => NO_KEYWORDS
193
+ },
194
+ disabled: {
195
+ type: Boolean,
196
+ default: false
197
+ },
198
+ forceMount: {
199
+ type: Boolean,
200
+ default: false
201
+ }
202
+ },
203
+ emits: { select: (_value, _event) => true },
204
+ setup(props, { attrs, slots, emit }) {
205
+ const context = useRequiredContext(CommandKey, "Command.Item");
206
+ const element = shallowRef(null);
207
+ const setElement = elementSetter(element);
208
+ const id = useId();
209
+ const info = {
210
+ get value() {
211
+ return props.value;
212
+ },
213
+ get keywords() {
214
+ return props.keywords;
215
+ },
216
+ get disabled() {
217
+ return props.disabled;
218
+ },
219
+ get forceMount() {
220
+ return props.forceMount;
221
+ },
222
+ id,
223
+ select: (event) => emit("select", props.value, event)
224
+ };
225
+ const { items, version } = context;
226
+ watch(element, (node, _, onCleanup) => {
227
+ if (node === null) return;
228
+ items.set(node, info);
229
+ version.value += 1;
230
+ onCleanup(() => {
231
+ items.delete(node);
232
+ version.value += 1;
233
+ });
234
+ }, {
235
+ flush: "post",
236
+ immediate: true
237
+ });
238
+ const state = computed(() => {
239
+ const hidden = commandItemScore(props.value, context.search.value, props.keywords, context.filter(), props.forceMount) === 0;
240
+ return {
241
+ highlighted: !hidden && context.highlighted.value === props.value,
242
+ disabled: props.disabled,
243
+ hidden
244
+ };
245
+ });
246
+ watch(() => [state.value.highlighted, element.value], ([highlighted, node]) => {
247
+ if (highlighted && node !== null) scrollIntoViewWithin(node, context.root.value);
248
+ }, {
249
+ flush: "post",
250
+ immediate: true
251
+ });
252
+ return () => {
253
+ const { highlighted, disabled, hidden } = state.value;
254
+ return renderPart("div", {
255
+ attrs,
256
+ slots
257
+ }, props.as, state.value, {
258
+ role: "option",
259
+ id,
260
+ hidden: hidden || void 0,
261
+ "aria-selected": highlighted ? "true" : "false",
262
+ "aria-disabled": disabled ? "true" : void 0,
263
+ "data-primitives-part": "command-item",
264
+ ...stateAttributes({
265
+ highlighted,
266
+ disabled
267
+ }),
268
+ onPointermove: () => {
269
+ if (!state.value.highlighted) context.highlighted.value = props.value;
270
+ },
271
+ onPointerdown: (event) => event.preventDefault(),
272
+ onClick: (event) => {
273
+ if (!props.disabled) emit("select", props.value, event);
274
+ },
275
+ ref: setElement
276
+ });
277
+ };
278
+ }
279
+ }));
280
+ // src/components/command/command-list.ts
281
+ /** The `listbox` of Items, always displayed (spec/command.md). */
282
+ const CommandList = publicComponent(defineComponent({
283
+ name: "CommandList",
284
+ inheritAttrs: false,
285
+ props: asProp,
286
+ setup(props, { attrs, slots }) {
287
+ const context = useRequiredContext(CommandKey, "Command.List");
288
+ const setList = elementSetter(context.list);
289
+ return () => {
290
+ const empty = context.shownCount.value === 0;
291
+ const loading = context.loading();
292
+ return renderPart("div", {
293
+ attrs,
294
+ slots
295
+ }, props.as, {
296
+ empty,
297
+ loading
298
+ }, {
299
+ role: "listbox",
300
+ id: context.listId,
301
+ tabindex: -1,
302
+ "aria-busy": loading ? "true" : void 0,
303
+ "data-primitives-part": "command-list",
304
+ ...stateAttributes({
305
+ empty,
306
+ loading
307
+ }),
308
+ ref: setList
309
+ });
310
+ };
311
+ }
312
+ }));
313
+ // src/components/command/command-loading.ts
314
+ /** A polite live region, always rendered; its children only while the Root is `loading`. */
315
+ const CommandLoading = publicComponent(defineComponent({
316
+ name: "CommandLoading",
317
+ inheritAttrs: false,
318
+ props: asProp,
319
+ setup(props, { attrs, slots }) {
320
+ const context = useRequiredContext(CommandKey, "Command.Loading");
321
+ return () => {
322
+ const shown = context.loading();
323
+ return renderPart("div", {
324
+ attrs,
325
+ slots
326
+ }, props.as, {}, {
327
+ role: "status",
328
+ "aria-live": "polite",
329
+ "aria-atomic": "true",
330
+ "data-primitives-part": "command-loading"
331
+ }, () => shown ? slots.default?.({ state: {} }) : void 0);
332
+ };
333
+ }
334
+ }));
335
+ // src/components/command/parts.ts
336
+ /** spec/command.md */
337
+ const Command = {
338
+ Root: publicComponent(defineComponent({
339
+ name: "CommandRoot",
340
+ inheritAttrs: false,
341
+ props: {
342
+ ...asProp,
343
+ inputValue: {
344
+ type: String,
345
+ default: void 0
346
+ },
347
+ defaultInputValue: {
348
+ type: String,
349
+ default: ""
350
+ },
351
+ filter: {
352
+ type: Function,
353
+ default: void 0
354
+ },
355
+ pages: {
356
+ type: Array,
357
+ default: void 0
358
+ },
359
+ defaultPages: {
360
+ type: Array,
361
+ default: () => []
362
+ },
363
+ loading: {
364
+ type: Boolean,
365
+ default: false
366
+ },
367
+ loopFocus: {
368
+ type: Boolean,
369
+ default: true
370
+ }
371
+ },
372
+ emits: {
373
+ "update:inputValue": (_value) => true,
374
+ inputValueChange: (_value, _details) => true,
375
+ "update:pages": (_pages) => true,
376
+ pagesChange: (_pages, _details) => true
377
+ },
378
+ setup(props, { attrs, slots, emit }) {
379
+ const searchState = useControllable(() => props.inputValue, props.defaultInputValue, (next, details) => {
380
+ emit("update:inputValue", next);
381
+ emit("inputValueChange", next, details);
382
+ });
383
+ const pagesState = useControllable(() => props.pages, props.defaultPages, (next, details) => {
384
+ emit("update:pages", next);
385
+ emit("pagesChange", next, details);
386
+ });
387
+ const filter = () => props.filter === void 0 ? commandScore : props.filter;
388
+ const search = computed(() => searchState.value.value);
389
+ const pages = computed(() => pagesState.value.value);
390
+ const root = shallowRef(null);
391
+ const setRoot = elementSetter(root);
392
+ const context = {
393
+ search,
394
+ setSearch: (value, details) => searchState.set(value, details),
395
+ filter,
396
+ pages,
397
+ setPages: (next, details) => pagesState.set(next, details),
398
+ loading: () => props.loading,
399
+ loopFocus: () => props.loopFocus,
400
+ highlighted: ref(null),
401
+ items: /* @__PURE__ */ new Map(),
402
+ version: ref(0),
403
+ shownCount: ref(null),
404
+ root,
405
+ list: shallowRef(null),
406
+ listId: `${useId()}-list`
407
+ };
408
+ provide(CommandKey, context);
409
+ let seen = null;
410
+ watch(() => [
411
+ search.value,
412
+ pages.value.join("\0"),
413
+ context.version.value,
414
+ context.list.value,
415
+ filter(),
416
+ context.highlighted.value
417
+ ], ([text, pageKey, , , currentFilter, highlighted]) => {
418
+ const previous = seen;
419
+ seen = {
420
+ search: text,
421
+ pageKey
422
+ };
423
+ if (previous !== null && previous.pageKey !== pageKey && text !== "") {
424
+ context.setSearch("", { reason: "page-change" });
425
+ return;
426
+ }
427
+ const shown = shownItems(context);
428
+ context.shownCount.value = shown.length;
429
+ if (!(previous === null || previous.search !== text || previous.pageKey !== pageKey) && shown.some(({ info }) => info.value === highlighted)) return;
430
+ const scores = shown.map(({ info }) => commandItemScore(info.value, text, info.keywords, currentFilter, info.forceMount));
431
+ const best = bestMatch(scores, (index) => shown[index]?.info.disabled ?? true);
432
+ context.highlighted.value = best === -1 ? null : shown[best]?.info.value ?? null;
433
+ }, {
434
+ flush: "post",
435
+ immediate: true
436
+ });
437
+ return () => {
438
+ const current = pages.value;
439
+ const state = {
440
+ loading: props.loading,
441
+ page: current.length > 0 ? current[current.length - 1] ?? null : null
442
+ };
443
+ return renderPart("div", {
444
+ attrs,
445
+ slots
446
+ }, props.as, state, {
447
+ "data-primitives-part": "command-root",
448
+ ref: setRoot
449
+ });
450
+ };
451
+ }
452
+ })),
453
+ Input: CommandInput,
454
+ List: CommandList,
455
+ Group: CommandGroup,
456
+ GroupLabel: CommandGroupLabel,
457
+ Separator: publicComponent(defineComponent({
458
+ name: "CommandSeparator",
459
+ inheritAttrs: false,
460
+ props: {
461
+ ...asProp,
462
+ forceMount: {
463
+ type: Boolean,
464
+ default: false
465
+ }
466
+ },
467
+ setup(props, { attrs, slots }) {
468
+ const context = useRequiredContext(CommandKey, "Command.Separator");
469
+ return () => {
470
+ const hidden = !props.forceMount && context.search.value.trim() !== "";
471
+ return renderPart("div", {
472
+ attrs,
473
+ slots
474
+ }, props.as, { hidden }, {
475
+ role: "presentation",
476
+ hidden: hidden || void 0,
477
+ "data-orientation": "horizontal",
478
+ "data-primitives-part": "command-separator"
479
+ });
480
+ };
481
+ }
482
+ })),
483
+ Item: CommandItem,
484
+ Empty: CommandEmpty,
485
+ Loading: CommandLoading
486
+ };
487
+ export { CommandList as n, CommandKey as r, Command as t };
488
+
489
+ //# sourceMappingURL=parts-M3ThgZzl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts-M3ThgZzl.js","names":[],"sources":["../src/components/command/command-context.ts","../src/components/command/command-empty.ts","../src/components/command/command-group.ts","../src/components/command/command-group-label.ts","../src/components/command/command-input.ts","../src/components/command/command-item.ts","../src/components/command/command-list.ts","../src/components/command/command-loading.ts","../src/components/command/command-root.ts","../src/components/command/command-separator.ts","../src/components/command/parts.ts"],"sourcesContent":["import type { CommandFilter } from \"@fragiola/primitives/command\";\nimport type { ComputedRef, InjectionKey, Ref, ShallowRef } from \"vue\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\n\n/** A rendered Item, as the Root knows it: its getters read the Item's latest props. */\nexport interface CommandItemInfo {\n readonly value: string;\n readonly keywords: readonly string[];\n readonly disabled: boolean;\n readonly forceMount: boolean;\n readonly id: string;\n /** Runs the action (the Item's `select` event). */\n select: (event: Event) => void;\n}\n\nexport interface CommandContext {\n /** The text. */\n search: ComputedRef<string>;\n setSearch: (value: string, details: ChangeDetails) => void;\n filter: () => CommandFilter | null;\n pages: ComputedRef<readonly string[]>;\n setPages: (pages: string[], details: ChangeDetails) => void;\n loading: () => boolean;\n loopFocus: () => boolean;\n /** The highlighted Item's value. */\n highlighted: Ref<string | null>;\n /** The rendered Items, by element. */\n items: Map<HTMLElement, CommandItemInfo>;\n /** Bumped when an Item mounts or unmounts: the Root sets the highlight again. */\n version: Ref<number>;\n /** The shown Items, `null` before the Root mounted. */\n shownCount: Ref<number | null>;\n root: ShallowRef<HTMLElement | null>;\n list: ShallowRef<HTMLElement | null>;\n listId: string;\n}\n\nexport const CommandKey: InjectionKey<CommandContext> = Symbol(\"Command\");\n\nexport const CommandGroupKey: InjectionKey<{ labelId: string }> =\n Symbol(\"CommandGroup\");\n\n/** The shown Items, in the list's order. */\nexport function shownItems(\n context: CommandContext,\n): { element: HTMLElement; info: CommandItemInfo }[] {\n const list = context.list.value;\n if (list === null) {\n return [];\n }\n return [\n ...list.querySelectorAll<HTMLElement>('[role=\"option\"]:not([hidden])'),\n ].flatMap((element) => {\n const info = context.items.get(element);\n return info === undefined ? [] : [{ element, info }];\n });\n}\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { CommandKey } from \"./command-context.ts\";\n\n/**\n * A polite live region, always rendered; its children only while no Item is shown and nothing\n * loads, once mounted (spec/command.md).\n */\nexport const CommandEmpty: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"CommandEmpty\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(CommandKey, \"Command.Empty\");\n return () => {\n const shown =\n context.shownCount.value === 0 && !context.loading();\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n role: \"status\",\n \"aria-live\": \"polite\",\n \"aria-atomic\": \"true\",\n \"data-primitives-part\": \"command-empty\",\n },\n () => (shown ? slots.default?.({ state: {} }) : undefined),\n );\n };\n },\n }),\n);\n","import { defineComponent, provide, ref, shallowRef, useId, watch } from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { CommandGroupKey, CommandKey } from \"./command-context.ts\";\n\n/** A `group` of Items, named by its GroupLabel, hidden while it shows none (spec/command.md). */\nexport const CommandGroup: PartComponent<\n Record<never, never>,\n { hidden: boolean }\n> = publicComponent(\n defineComponent({\n name: \"CommandGroup\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(CommandKey, \"Command.Group\");\n const labelId = `${useId()}-label`;\n provide(CommandGroupKey, { labelId });\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n const hidden = ref(false);\n // hidden while it shows no Item: checked once its Items rendered for a new text, a\n // new filter or Items mounting and unmounting\n watch(\n () =>\n [\n element.value,\n context.search.value,\n context.filter(),\n context.version.value,\n ] as const,\n ([node]) => {\n if (node !== null) {\n hidden.value =\n node.querySelector(\n '[role=\"option\"]:not([hidden])',\n ) === null;\n }\n },\n { flush: \"post\", immediate: true },\n );\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { hidden: hidden.value },\n {\n role: \"group\",\n \"aria-labelledby\": labelId,\n hidden: hidden.value || undefined,\n \"data-primitives-part\": \"command-group\",\n ref: setElement,\n },\n );\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { CommandGroupKey } from \"./command-context.ts\";\n\n/** Names its Group. */\nexport const CommandGroupLabel: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"CommandGroupLabel\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const group = useRequiredContext(\n CommandGroupKey,\n \"Command.GroupLabel\",\n );\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n id: group.labelId,\n \"data-primitives-part\": \"command-group-label\",\n },\n );\n },\n }),\n);\n","import { commandKeyTarget } from \"@fragiola/primitives/command\";\nimport { defineComponent, nextTick } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { CommandKey, shownItems } from \"./command-context.ts\";\n\n/**\n * The `combobox`: it keeps DOM focus, filters the Items as it is typed in and moves the\n * highlight, announced with `aria-activedescendant` (spec/command.md, \"Keyboard\").\n */\nexport const CommandInput: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"CommandInput\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(CommandKey, \"Command.Input\");\n\n const onInput = (event: Event) => {\n const element = event.target as HTMLInputElement;\n context.setSearch(element.value, {\n reason: \"input-change\",\n event,\n });\n // a controlled text the consumer kept does not re-render the input: re-assert it\n // once the consumer's update has rendered (spec/README.md, \"A controlled value\n // the consumer rejects\")\n void nextTick().then(() => {\n const text = context.search.value;\n if (element.value !== text) {\n element.value = text;\n }\n });\n };\n\n const onKeydown = (event: KeyboardEvent) => {\n if (event.isComposing) {\n return;\n }\n const shown = shownItems(context);\n const highlighted = context.highlighted.value;\n const current = shown.findIndex(\n ({ info }) => info.value === highlighted,\n );\n const target = commandKeyTarget(\n event,\n current,\n shown.length,\n context.loopFocus(),\n );\n if (target !== null) {\n event.preventDefault();\n context.highlighted.value =\n shown[target]?.info.value ?? null;\n return;\n }\n if (event.key === \"Enter\") {\n const item = shown[current]?.info;\n if (item !== undefined) {\n event.preventDefault();\n if (!item.disabled) {\n item.select(event);\n }\n }\n return;\n }\n const pages = context.pages.value;\n if (\n event.key === \"Backspace\" &&\n (event.currentTarget as HTMLInputElement).value === \"\" &&\n pages.length > 0\n ) {\n event.preventDefault();\n context.setPages(pages.slice(0, -1), {\n reason: \"backspace-key\",\n event,\n });\n }\n };\n\n return () => {\n const highlighted = context.highlighted.value;\n // the Items registered so far (bumped as they mount and unmount)\n void context.version.value;\n let active: string | undefined;\n for (const info of context.items.values()) {\n if (info.value === highlighted) {\n active = info.id;\n }\n }\n return renderPart(\n \"input\",\n { attrs, slots },\n props.as,\n {},\n {\n type: \"text\",\n role: \"combobox\",\n \"aria-expanded\": \"true\",\n \"aria-controls\": context.listId,\n \"aria-autocomplete\": \"list\",\n \"aria-activedescendant\": active,\n autocomplete: \"off\",\n spellcheck: \"false\",\n value: context.search.value,\n \"data-primitives-part\": \"command-input\",\n onInput,\n onKeydown,\n },\n );\n };\n },\n }),\n);\n","import { scrollIntoViewWithin } from \"@fragiola/primitives/collection\";\nimport { commandItemScore } from \"@fragiola/primitives/command\";\nimport {\n computed,\n defineComponent,\n type PropType,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { type CommandItemInfo, CommandKey } from \"./command-context.ts\";\n\nexport interface CommandItemState {\n highlighted: boolean;\n disabled: boolean;\n /** It does not match the text: rendered `hidden`. */\n hidden: boolean;\n}\n\nexport interface CommandItemProps {\n /** The text the filter scores, and the Item's identity in the Command. */\n value: string;\n /** More texts the filter scores. */\n keywords?: readonly string[];\n /** Highlighted by the arrows, never run. */\n disabled?: boolean;\n /** Always shown, whatever the text. */\n forceMount?: boolean;\n}\n\nexport type CommandItemEmits = {\n /** Runs the action (Enter, a press). */\n select: (value: string, event: Event) => true;\n};\n\nconst NO_KEYWORDS: readonly string[] = [];\n\n/** An `option`: an action, hidden while it does not match the text (spec/command.md). */\nexport const CommandItem: PartComponent<\n CommandItemProps,\n CommandItemState,\n CommandItemEmits\n> = publicComponent(\n defineComponent({\n name: \"CommandItem\",\n inheritAttrs: false,\n props: {\n ...asProp,\n value: { type: String, required: true },\n keywords: {\n type: Array as PropType<readonly string[]>,\n default: () => NO_KEYWORDS,\n },\n disabled: { type: Boolean, default: false },\n forceMount: { type: Boolean, default: false },\n },\n emits: {\n select: (_value: string, _event: Event) => true,\n },\n setup(props, { attrs, slots, emit }) {\n const context = useRequiredContext(CommandKey, \"Command.Item\");\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n const id = useId();\n // the Root reads the Item's latest props through these getters; it is told only when\n // the Item mounts or unmounts\n const info: CommandItemInfo = {\n get value() {\n return props.value;\n },\n get keywords() {\n return props.keywords;\n },\n get disabled() {\n return props.disabled;\n },\n get forceMount() {\n return props.forceMount;\n },\n id,\n select: (event) => emit(\"select\", props.value, event),\n };\n const { items, version } = context;\n watch(\n element,\n (node, _, onCleanup) => {\n if (node === null) {\n return;\n }\n items.set(node, info);\n version.value += 1;\n onCleanup(() => {\n items.delete(node);\n version.value += 1;\n });\n },\n { flush: \"post\", immediate: true },\n );\n\n const state = computed<CommandItemState>(() => {\n const hidden =\n commandItemScore(\n props.value,\n context.search.value,\n props.keywords,\n context.filter(),\n props.forceMount,\n ) === 0;\n return {\n highlighted:\n !hidden && context.highlighted.value === props.value,\n disabled: props.disabled,\n hidden,\n };\n });\n watch(\n () => [state.value.highlighted, element.value] as const,\n ([highlighted, node]) => {\n if (highlighted && node !== null) {\n scrollIntoViewWithin(node, context.root.value);\n }\n },\n { flush: \"post\", immediate: true },\n );\n\n return () => {\n const { highlighted, disabled, hidden } = state.value;\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n state.value,\n {\n role: \"option\",\n id,\n hidden: hidden || undefined,\n \"aria-selected\": highlighted ? \"true\" : \"false\",\n \"aria-disabled\": disabled ? \"true\" : undefined,\n \"data-primitives-part\": \"command-item\",\n ...stateAttributes({ highlighted, disabled }),\n onPointermove: () => {\n if (!state.value.highlighted) {\n context.highlighted.value = props.value;\n }\n },\n // the Input keeps DOM focus\n onPointerdown: (event: PointerEvent) =>\n event.preventDefault(),\n onClick: (event: MouseEvent) => {\n if (!props.disabled) {\n emit(\"select\", props.value, event);\n }\n },\n ref: setElement,\n },\n );\n };\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { CommandKey } from \"./command-context.ts\";\n\nexport interface CommandListState {\n empty: boolean;\n loading: boolean;\n}\n\n/** The `listbox` of Items, always displayed (spec/command.md). */\nexport const CommandList: PartComponent<\n Record<never, never>,\n CommandListState\n> = publicComponent(\n defineComponent({\n name: \"CommandList\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(CommandKey, \"Command.List\");\n const setList = elementSetter(context.list);\n return () => {\n const empty = context.shownCount.value === 0;\n const loading = context.loading();\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { empty, loading },\n {\n role: \"listbox\",\n id: context.listId,\n // a scrolling list is no Tab stop of its own (Chromium's focusable\n // scrollers): the Input keeps the focus\n tabindex: -1,\n \"aria-busy\": loading ? \"true\" : undefined,\n \"data-primitives-part\": \"command-list\",\n ...stateAttributes({ empty, loading }),\n ref: setList,\n },\n );\n };\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { CommandKey } from \"./command-context.ts\";\n\n/** A polite live region, always rendered; its children only while the Root is `loading`. */\nexport const CommandLoading: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"CommandLoading\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(CommandKey, \"Command.Loading\");\n return () => {\n const shown = context.loading();\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n role: \"status\",\n \"aria-live\": \"polite\",\n \"aria-atomic\": \"true\",\n \"data-primitives-part\": \"command-loading\",\n },\n () => (shown ? slots.default?.({ state: {} }) : undefined),\n );\n };\n },\n }),\n);\n","import {\n bestMatch,\n type CommandFilter,\n commandItemScore,\n commandScore,\n} from \"@fragiola/primitives/command\";\nimport {\n computed,\n defineComponent,\n type PropType,\n provide,\n ref,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\nimport { useControllable } from \"../../composables/use-controllable.ts\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport {\n type CommandContext,\n CommandKey,\n shownItems,\n} from \"./command-context.ts\";\n\nexport interface CommandRootState {\n loading: boolean;\n /** The current page (the last of `pages`), `null` on the root page. */\n page: string | null;\n}\n\nexport interface CommandRootProps {\n /** The text (controlled). */\n inputValue?: string;\n /** The text at first (default `\"\"`). */\n defaultInputValue?: string;\n /** An Item's score for the text (default `commandScore`); `null` turns filtering off. */\n filter?: CommandFilter | null;\n /** The stack of page keys, the last the current page (controlled). */\n pages?: string[];\n /** The pages at first (default `[]`). */\n defaultPages?: string[];\n /** Results are loading (default `false`). */\n loading?: boolean;\n /** The arrow keys wrap (default `true`). */\n loopFocus?: boolean;\n}\n\nexport type CommandRootEmits = {\n \"update:inputValue\": (value: string) => true;\n inputValueChange: (value: string, details: ChangeDetails) => true;\n \"update:pages\": (pages: string[]) => true;\n pagesChange: (pages: string[], details: ChangeDetails) => true;\n};\n\n/**\n * A command palette (spec/command.md): the text (`v-model:input-value`), the highlight and the\n * pages (`v-model:pages`).\n */\nexport const CommandRoot: PartComponent<\n CommandRootProps,\n CommandRootState,\n CommandRootEmits\n> = publicComponent(\n defineComponent({\n name: \"CommandRoot\",\n inheritAttrs: false,\n props: {\n ...asProp,\n inputValue: { type: String, default: undefined },\n defaultInputValue: { type: String, default: \"\" },\n filter: {\n type: Function as PropType<CommandFilter | null>,\n default: undefined,\n },\n pages: {\n type: Array as PropType<string[]>,\n default: undefined,\n },\n defaultPages: {\n type: Array as PropType<string[]>,\n default: () => [],\n },\n loading: { type: Boolean, default: false },\n loopFocus: { type: Boolean, default: true },\n },\n emits: {\n \"update:inputValue\": (_value: string) => true,\n inputValueChange: (_value: string, _details: ChangeDetails) => true,\n \"update:pages\": (_pages: string[]) => true,\n pagesChange: (_pages: string[], _details: ChangeDetails) => true,\n },\n setup(props, { attrs, slots, emit }) {\n const searchState = useControllable<string, ChangeDetails>(\n () => props.inputValue,\n props.defaultInputValue,\n (next, details) => {\n emit(\"update:inputValue\", next);\n emit(\"inputValueChange\", next, details);\n },\n );\n const pagesState = useControllable<string[], ChangeDetails>(\n () => props.pages,\n props.defaultPages,\n (next, details) => {\n emit(\"update:pages\", next);\n emit(\"pagesChange\", next, details);\n },\n );\n const filter = (): CommandFilter | null =>\n props.filter === undefined ? commandScore : props.filter;\n const search = computed(() => searchState.value.value);\n const pages = computed(() => pagesState.value.value);\n const root = shallowRef<HTMLElement | null>(null);\n const setRoot = elementSetter(root);\n const context: CommandContext = {\n search,\n setSearch: (value, details) => searchState.set(value, details),\n filter,\n pages,\n setPages: (next, details) => pagesState.set(next, details),\n loading: () => props.loading,\n loopFocus: () => props.loopFocus,\n highlighted: ref<string | null>(null),\n items: new Map(),\n version: ref(0),\n shownCount: ref<number | null>(null),\n root,\n list: shallowRef<HTMLElement | null>(null),\n listId: `${useId()}-list`,\n };\n provide(CommandKey, context);\n\n // the highlight follows the shown Items (spec/command.md, \"Keyboard\"): a new text or\n // page highlights the best match, a highlight whose Item is gone the best one left\n let seen: { search: string; pageKey: string } | null = null;\n watch(\n () =>\n [\n search.value,\n pages.value.join(\"\\u0000\"),\n context.version.value,\n context.list.value,\n filter(),\n context.highlighted.value,\n ] as const,\n ([text, pageKey, , , currentFilter, highlighted]) => {\n const previous = seen;\n seen = { search: text, pageKey };\n if (\n previous !== null &&\n previous.pageKey !== pageKey &&\n text !== \"\"\n ) {\n // a new page starts with no text; the next run highlights its best Item\n context.setSearch(\"\", { reason: \"page-change\" });\n return;\n }\n const shown = shownItems(context);\n context.shownCount.value = shown.length;\n const changed =\n previous === null ||\n previous.search !== text ||\n previous.pageKey !== pageKey;\n if (\n !changed &&\n shown.some(({ info }) => info.value === highlighted)\n ) {\n return;\n }\n const scores = shown.map(({ info }) =>\n commandItemScore(\n info.value,\n text,\n info.keywords,\n currentFilter,\n info.forceMount,\n ),\n );\n const best = bestMatch(\n scores,\n (index) => shown[index]?.info.disabled ?? true,\n );\n context.highlighted.value =\n best === -1 ? null : (shown[best]?.info.value ?? null);\n },\n { flush: \"post\", immediate: true },\n );\n\n return () => {\n const current = pages.value;\n const state: CommandRootState = {\n loading: props.loading,\n page:\n current.length > 0\n ? (current[current.length - 1] ?? null)\n : null,\n };\n return renderPart(\"div\", { attrs, slots }, props.as, state, {\n \"data-primitives-part\": \"command-root\",\n ref: setRoot,\n });\n };\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { CommandKey } from \"./command-context.ts\";\n\nexport interface CommandSeparatorProps {\n /** Shown while there is text too. */\n forceMount?: boolean;\n}\n\n/**\n * Between groups, hidden while there is text (the groups it separates may be hidden); no role of\n * its own (a `listbox` owns only groups and options).\n */\nexport const CommandSeparator: PartComponent<\n CommandSeparatorProps,\n { hidden: boolean }\n> = publicComponent(\n defineComponent({\n name: \"CommandSeparator\",\n inheritAttrs: false,\n props: {\n ...asProp,\n forceMount: { type: Boolean, default: false },\n },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(CommandKey, \"Command.Separator\");\n return () => {\n const hidden =\n !props.forceMount && context.search.value.trim() !== \"\";\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { hidden },\n {\n role: \"presentation\",\n hidden: hidden || undefined,\n \"data-orientation\": \"horizontal\",\n \"data-primitives-part\": \"command-separator\",\n },\n );\n };\n },\n }),\n);\n","import { CommandEmpty } from \"./command-empty.ts\";\nimport { CommandGroup } from \"./command-group.ts\";\nimport { CommandGroupLabel } from \"./command-group-label.ts\";\nimport { CommandInput } from \"./command-input.ts\";\nimport { CommandItem } from \"./command-item.ts\";\nimport { CommandList } from \"./command-list.ts\";\nimport { CommandLoading } from \"./command-loading.ts\";\nimport { CommandRoot } from \"./command-root.ts\";\nimport { CommandSeparator } from \"./command-separator.ts\";\n\n/** spec/command.md */\nexport const Command = {\n Root: CommandRoot,\n Input: CommandInput,\n List: CommandList,\n Group: CommandGroup,\n GroupLabel: CommandGroupLabel,\n Separator: CommandSeparator,\n Item: CommandItem,\n Empty: CommandEmpty,\n Loading: CommandLoading,\n};\n"],"mappings":";;;;;;;;;;AAqCA,MAAa,aAA2C,OAAO,SAAS;AAExE,MAAa,kBACT,OAAO,cAAc;;AAGzB,SAAgB,WACZ,S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