@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 @@
1
+ {"version":3,"file":"parts-BP00C3Q5.js","names":[],"sources":["../src/components/autocomplete/autocomplete-context.ts","../src/components/autocomplete/autocomplete-clear.ts","../src/components/autocomplete/autocomplete-empty.ts","../src/components/autocomplete/autocomplete-group.ts","../src/components/autocomplete/autocomplete-group-label.ts","../src/components/autocomplete/autocomplete-input.ts","../src/components/autocomplete/autocomplete-input-group.ts","../src/components/autocomplete/autocomplete-item.ts","../src/components/autocomplete/autocomplete-list.ts","../src/components/autocomplete/autocomplete-popup.ts","../src/components/autocomplete/autocomplete-portal.ts","../src/components/autocomplete/autocomplete-positioner.ts","../src/components/autocomplete/autocomplete-root.ts","../src/components/autocomplete/autocomplete-separator.ts","../src/components/autocomplete/autocomplete-status.ts","../src/components/autocomplete/autocomplete-trigger.ts","../src/components/autocomplete/autocomplete-value.ts","../src/components/autocomplete/parts.ts"],"sourcesContent":["import type { Align, Side } from \"@fragiola/primitives/positioning\";\nimport type { ComputedRef, InjectionKey, Ref, ShallowRef } from \"vue\";\nimport type { FieldControlBinding } from \"../../composables/use-field-control.ts\";\nimport type { OverlayRoot } from \"../../composables/use-overlay-root.ts\";\nimport type { ChangeReason } from \"../../utils/change-details.ts\";\n\n/** How the autocomplete completes the text (spec/autocomplete.md, \"API\"). */\nexport type AutocompleteMode = \"list\" | \"both\" | \"inline\" | \"none\";\n\n/** A rendered Item, as the Root knows it. */\nexport interface AutocompleteItemInfo {\n value: unknown;\n disabled: boolean;\n id: string;\n}\n\n/**\n * What the keyboard highlights once the list renders: the first or last suggestion, the first one\n * after typing (`autoHighlight`), or the inline completion of the typed text.\n */\nexport type AutocompletePending = \"first\" | \"last\" | \"complete\" | null;\n\n/** The text a highlight shows in the input (`both`, `inline`), and the suggestion it comes from. */\nexport interface AutocompleteShown {\n item: unknown;\n text: string;\n /** Where the completion string starts: it is selected (`null`: the caret at the end). */\n selectFrom: number | null;\n /** A disabled suggestion is shown, never accepted. */\n disabled: boolean;\n}\n\nexport interface AutocompleteContext extends OverlayRoot {\n field: FieldControlBinding;\n mode: () => AutocompleteMode;\n /** The value: the typed or chosen text. */\n value: ComputedRef<string>;\n /** The text a highlight shows instead of the value, or `null`. */\n shown: ShallowRef<AutocompleteShown | null>;\n /** The text the input shows: the highlight's, else the value. */\n text: () => string;\n /** Types `text` (spec/autocomplete.md, \"Keyboard\": typing). */\n type: (text: string, addition: boolean, event: Event) => void;\n /** Opens or closes; closing drops the highlight (and accepts an inline completion on leave). */\n setOpen: (open: boolean, reason: ChangeReason, event?: Event) => boolean;\n disabled: () => boolean;\n /** The Input's form name (the field's, else the Root's). */\n name: () => string | undefined;\n required: () => boolean;\n openOnInputClick: () => boolean;\n /** The highlighted item's id. */\n highlighted: Ref<string | null>;\n /** Highlights an item (or none); the keyboard's highlight shows its text inline. */\n highlight: (id: string | null, from: \"keyboard\" | \"pointer\") => void;\n /** Highlights a suggestion and completes the typed text with it, the rest selected. */\n complete: (item: AutocompleteItemInfo) => void;\n /** Chooses a suggestion: its text becomes the value, the list closes. */\n choose: (item: unknown, event?: Event) => void;\n /** Empties the text. */\n clear: (reason: ChangeReason, event?: Event) => void;\n /** A suggestion's text (`itemToStringValue`). */\n label: (item: unknown) => string;\n hasItems: () => boolean;\n /** The matching entries: items, or groups with their matching items. */\n entries: ComputedRef<readonly unknown[]>;\n items: Map<HTMLElement, AutocompleteItemInfo>;\n list: ShallowRef<HTMLElement | null>;\n button: ShallowRef<HTMLElement | null>;\n inputGroup: ShallowRef<HTMLElement | null>;\n clearButton: ShallowRef<HTMLElement | null>;\n listId: string;\n pending: { current: AutocompletePending };\n /** Bumped when a pending highlight is asked for, so the List applies it. */\n pendingTick: Ref<number>;\n requestHighlight: (pending: AutocompletePending) => void;\n placed: Ref<{ side: Side; align: Align }>;\n /** Bumped when items register, so `data-empty` and the pending highlight follow. */\n itemCount: Ref<number>;\n}\n\nexport const AutocompleteKey: InjectionKey<AutocompleteContext> =\n Symbol(\"Autocomplete\");\n\nexport const AutocompleteGroupKey: InjectionKey<{ labelId: string }> =\n Symbol(\"AutocompleteGroup\");\n\n/** Whether the list holds no item: no matching entry, or no rendered Item. */\nexport function isEmpty(context: AutocompleteContext): boolean {\n return context.hasItems()\n ? context.entries.value.length === 0\n : context.itemCount.value === 0;\n}\n\n/** The rendered items of the list, in order. */\nexport function orderedItems(\n context: AutocompleteContext,\n): AutocompleteItemInfo[] {\n const list = context.list.value;\n if (list === null) {\n return [];\n }\n return [...list.querySelectorAll<HTMLElement>('[role=\"option\"]')]\n .map((element) => context.items.get(element))\n .filter((item): item is AutocompleteItemInfo => item !== undefined);\n}\n\n/** The highlighted item, as registered. */\nexport function highlightedItem(\n context: AutocompleteContext,\n): AutocompleteItemInfo | undefined {\n const id = context.highlighted.value;\n if (id === null) {\n return undefined;\n }\n for (const item of context.items.values()) {\n if (item.id === id) {\n return item;\n }\n }\n return undefined;\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 { AutocompleteKey } from \"./autocomplete-context.ts\";\n\nexport interface AutocompleteDisabledState {\n disabled: boolean;\n}\n\n/** Empties the text; rendered only while there is text (spec/autocomplete.md). */\nexport const AutocompleteClear: PartComponent<\n Record<never, never>,\n AutocompleteDisabledState\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteClear\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Clear\",\n );\n const setClearButton = elementSetter(context.clearButton);\n return () => {\n if (context.value.value === \"\") {\n return null;\n }\n const disabled = context.disabled();\n return renderPart(\n \"button\",\n { attrs, slots },\n props.as,\n { disabled },\n {\n type: \"button\",\n tabindex: -1,\n disabled,\n \"data-primitives-part\": \"autocomplete-clear\",\n ...stateAttributes({ disabled }),\n onPointerdown: (event: PointerEvent) =>\n event.preventDefault(),\n onClick: (event: MouseEvent) => {\n context.clear(\"clear-press\", event);\n if (\n context.open.value &&\n !context.openOnInputClick()\n ) {\n context.setOpen(false, \"input-clear\", event);\n }\n context.trigger.value?.focus();\n },\n ref: setClearButton,\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 { AutocompleteKey, isEmpty } from \"./autocomplete-context.ts\";\n\n/**\n * A polite live region, always rendered; its children are shown only while the list is empty\n * (spec/autocomplete.md).\n */\nexport const AutocompleteEmpty: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteEmpty\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Empty\",\n );\n return () => {\n const empty = isEmpty(context);\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\": \"autocomplete-empty\",\n },\n () => (empty ? slots.default?.({ state: {} }) : []),\n );\n };\n },\n }),\n);\n","import { defineComponent, provide, useId } from \"vue\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { AutocompleteGroupKey } from \"./autocomplete-context.ts\";\n\n/** A `group` of items, named by its GroupLabel (spec/autocomplete.md). */\nexport const AutocompleteGroup: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteGroup\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const labelId = `${useId()}-label`;\n provide(AutocompleteGroupKey, { labelId });\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n role: \"group\",\n \"aria-labelledby\": labelId,\n \"data-primitives-part\": \"autocomplete-group\",\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 { AutocompleteGroupKey } from \"./autocomplete-context.ts\";\n\n/** Names its Group. */\nexport const AutocompleteGroupLabel: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteGroupLabel\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const group = useRequiredContext(\n AutocompleteGroupKey,\n \"Autocomplete.GroupLabel\",\n );\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n id: group.labelId,\n \"data-primitives-part\": \"autocomplete-group-label\",\n },\n );\n },\n }),\n);\n","import { stepThroughNone } from \"@fragiola/primitives/collection\";\nimport { defineComponent, nextTick, 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 { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n AutocompleteKey,\n type AutocompletePending,\n highlightedItem,\n orderedItems,\n} from \"./autocomplete-context.ts\";\n\nexport interface AutocompleteOpenState {\n open: boolean;\n disabled: boolean;\n}\n\n/**\n * The `combobox` and the form control: keeps DOM focus while the list is open; the highlighted\n * suggestion is announced with `aria-activedescendant` (spec/autocomplete.md, \"Keyboard\").\n */\nexport const AutocompleteInput: PartComponent<\n Record<never, never>,\n AutocompleteOpenState\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteInput\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Input\",\n );\n const setInput = elementSetter(context.trigger);\n const inline = () =>\n context.mode() === \"both\" || context.mode() === \"inline\";\n\n // the shown text, written onto the input and its completion string selected, so the\n // next character replaces it (APG)\n watch(\n () => [context.shown.value, context.trigger.value] as const,\n ([shown, element]) => {\n if (!(element instanceof HTMLInputElement)) {\n return;\n }\n const text = context.text();\n if (element.value !== text) {\n element.value = text;\n }\n if (\n shown === null ||\n element.ownerDocument.activeElement !== element\n ) {\n return;\n }\n const end = shown.text.length;\n element.setSelectionRange(shown.selectFrom ?? end, end);\n },\n { flush: \"post\" },\n );\n\n const openWith = (pending: AutocompletePending, event?: Event) => {\n context.requestHighlight(pending);\n // an opening the consumer refused asks for no highlight later\n if (!context.setOpen(true, \"list-navigation\", event)) {\n context.requestHighlight(null);\n }\n };\n const move = (delta: 1 | -1) => {\n // past an end, the visual focus goes back to the input; from the input, to the near end\n const items = orderedItems(context);\n const index = items.findIndex(\n (item) => item.id === context.highlighted.value,\n );\n context.highlight(\n items[stepThroughNone(items.length, index, delta)]?.id ??\n null,\n \"keyboard\",\n );\n };\n\n const onKeydown = (event: KeyboardEvent) => {\n const open = context.open.value;\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\": {\n event.preventDefault();\n if (event.altKey) {\n if (event.key === \"ArrowDown\" && !open) {\n openWith(null, event);\n } else if (event.key === \"ArrowUp\" && open) {\n context.setOpen(\n false,\n \"list-navigation\",\n event,\n );\n }\n return;\n }\n if (!open) {\n openWith(\n event.key === \"ArrowDown\" ? \"first\" : \"last\",\n event,\n );\n return;\n }\n move(event.key === \"ArrowDown\" ? 1 : -1);\n return;\n }\n case \"Enter\": {\n if (!open) {\n return;\n }\n const active = highlightedItem(context);\n if (active === undefined) {\n // no highlight: the list closes and the form may submit\n context.setOpen(false, \"none\", event);\n return;\n }\n event.preventDefault();\n if (!active.disabled) {\n context.choose(active.value, event);\n }\n return;\n }\n case \"Escape\":\n // the open list's layer takes Escape first; here the list is closed\n if (!open && context.value.value !== \"\") {\n event.preventDefault();\n context.clear(\"escape-key\", event);\n }\n return;\n case \"Tab\":\n if (open) {\n context.setOpen(false, \"focus-out\", event);\n }\n return;\n default:\n }\n };\n\n const onInput = (event: Event) => {\n const element = event.target as HTMLInputElement;\n const inputType = (event as InputEvent).inputType ?? \"\";\n context.type(\n element.value,\n inline() && inputType.startsWith(\"insert\"),\n event,\n );\n // a controlled value the consumer kept does not re-render the input: re-assert\n // it 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.text();\n if (element.value !== text) {\n element.value = text;\n }\n });\n };\n\n return () => {\n const open = context.open.value;\n const disabled = context.disabled();\n const highlighted = context.highlighted.value;\n // a rendered option's id only, never a stale one (the item count tracks the options)\n void context.itemCount.value;\n const active =\n highlighted === null\n ? undefined\n : orderedItems(context).find(\n (item) => item.id === highlighted,\n );\n const { field } = context;\n return renderPart(\n \"input\",\n { attrs, slots },\n props.as,\n { open, disabled },\n {\n type: \"text\",\n id: context.triggerId,\n role: \"combobox\",\n autocomplete: \"off\",\n name: context.name(),\n required: context.required(),\n disabled,\n value: context.text(),\n \"aria-autocomplete\": context.mode(),\n \"aria-expanded\": open ? \"true\" : \"false\",\n \"aria-controls\": context.listId,\n \"aria-activedescendant\":\n open && active ? active.id : undefined,\n ...field.aria(),\n \"data-primitives-part\": \"autocomplete-input\",\n ...field.attributes(),\n ...stateAttributes({ \"popup-open\": open, disabled }),\n onInput,\n onClick: (event: MouseEvent) => {\n if (\n context.openOnInputClick() &&\n !context.open.value &&\n !disabled\n ) {\n context.setOpen(true, \"input-press\", event);\n }\n },\n onKeydown,\n onFocus: field.onFocus,\n onBlur: field.onBlur,\n ref: setInput,\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 { AutocompleteKey } from \"./autocomplete-context.ts\";\nimport type { AutocompleteOpenState } from \"./autocomplete-input.ts\";\n\n/**\n * Holds the Input and its buttons; anchors the list. A press on it, outside its buttons and the\n * input, focuses the input (and opens the list with `open-on-input-click`).\n */\nexport const AutocompleteInputGroup: PartComponent<\n Record<never, never>,\n AutocompleteOpenState\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteInputGroup\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.InputGroup\",\n );\n const setInputGroup = elementSetter(context.inputGroup);\n const onMousedown = (event: MouseEvent) => {\n const target = event.target as Element | null;\n if (\n target === null ||\n target === context.trigger.value ||\n target.closest(\"button\") !== null\n ) {\n return;\n }\n event.preventDefault();\n if (context.disabled()) {\n return;\n }\n context.trigger.value?.focus();\n if (context.openOnInputClick() && !context.open.value) {\n context.setOpen(true, \"input-press\", event);\n }\n };\n return () => {\n const open = context.open.value;\n const disabled = context.disabled();\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { open, disabled },\n {\n role: \"group\",\n \"data-primitives-part\": \"autocomplete-input-group\",\n ...stateAttributes({ \"popup-open\": open, disabled }),\n onMousedown,\n ref: setInputGroup,\n },\n );\n };\n },\n }),\n);\n","import { scrollIntoViewWithin } from \"@fragiola/primitives/collection\";\nimport { computed, defineComponent, 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 { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { AutocompleteKey } from \"./autocomplete-context.ts\";\n\nexport interface AutocompleteItemState {\n highlighted: boolean;\n disabled: boolean;\n}\n\nexport interface AutocompleteItemProps {\n /** The suggestion: its `itemToStringValue` becomes the value when chosen. */\n value: unknown;\n /** Can be highlighted, never chosen. */\n disabled?: boolean;\n}\n\n/** An `option`: a suggestion, never selected (spec/autocomplete.md). */\nexport const AutocompleteItem: PartComponent<\n AutocompleteItemProps,\n AutocompleteItemState\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteItem\",\n inheritAttrs: false,\n props: {\n ...asProp,\n /** The suggestion: its `itemToStringValue` becomes the value when chosen. */\n value: { type: null, required: true },\n /** Can be highlighted, never chosen. */\n disabled: { type: Boolean, default: false },\n },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Item\",\n );\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n const id = useId();\n const { items, itemCount } = context;\n watch(\n () => [element.value, props.value, props.disabled] as const,\n ([node, value, disabled], _, onCleanup) => {\n if (node === null) {\n return;\n }\n items.set(node, { value, disabled, id });\n itemCount.value = items.size;\n onCleanup(() => {\n items.delete(node);\n itemCount.value = items.size;\n });\n },\n { flush: \"post\", immediate: true },\n );\n const state = computed(() => ({\n highlighted: context.highlighted.value === id,\n disabled: props.disabled,\n }));\n watch(\n () =>\n [\n state.value.highlighted,\n element.value,\n context.positioner.value,\n ] as const,\n ([highlighted]) => {\n // within the popup only: a list that mounts before it is placed never\n // scrolls the page\n if (highlighted && element.value) {\n scrollIntoViewWithin(\n element.value,\n context.positioner.value,\n );\n }\n },\n { flush: \"post\", immediate: true },\n );\n return () => {\n const { highlighted, disabled } = state.value;\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n state.value,\n {\n role: \"option\",\n id,\n \"aria-disabled\": disabled ? \"true\" : undefined,\n \"data-primitives-part\": \"autocomplete-item\",\n ...stateAttributes({ highlighted, disabled }),\n onPointermove: () => {\n if (!state.value.highlighted) {\n context.highlight(id, \"pointer\");\n }\n },\n // the input keeps DOM focus\n onPointerdown: (event: PointerEvent) =>\n event.preventDefault(),\n onClick: (event: MouseEvent) => {\n if (!props.disabled) {\n context.choose(props.value, event);\n }\n },\n ref: setElement,\n },\n );\n };\n },\n }),\n);\n","import type { VNode } from \"vue\";\nimport { defineComponent, watch } from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport type { AsProp, RenderSlotProps } from \"../../utils/render-part.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n AutocompleteKey,\n isEmpty,\n orderedItems,\n} from \"./autocomplete-context.ts\";\n\nexport interface AutocompleteListState {\n empty: boolean;\n}\n\n/**\n * With the Root's `items`, the default slot renders each matching entry (a suggestion, or a group\n * whose `items` are its matching suggestions); without them, it renders once with the state.\n * `entry` is the consumer's own type, named by the slot's annotation\n * (`v-slot=\"{ entry }: { entry: Fruit }\"`): `never` until annotated, so any annotation binds.\n */\nexport interface AutocompleteListSlots {\n default?: (scope: {\n entry: never;\n index: number;\n state: AutocompleteListState;\n }) => VNode[];\n render?: (scope: RenderSlotProps<AutocompleteListState>) => VNode[];\n}\n\n/**\n * The `listbox`. Applies the highlight the keyboard or the typing asked for once its suggestions\n * render, and drops a highlight whose suggestion is gone (new `items`).\n */\nexport const AutocompleteList: PublicComponent<\n { as?: AsProp },\n AutocompleteListSlots\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteList\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.List\",\n );\n const setList = elementSetter(context.list);\n watch(\n () =>\n [\n context.list.value,\n context.itemCount.value,\n context.open.value,\n context.pendingTick.value,\n context.entries.value,\n ] as const,\n ([list, , open]) => {\n if (list === null) {\n return;\n }\n const items = orderedItems(context);\n // the items register after the list renders them: wait for every one\n if (\n items.length <\n list.querySelectorAll('[role=\"option\"]').length\n ) {\n return;\n }\n const asked = context.pending.current;\n if (asked !== null && open) {\n context.pending.current = null;\n if (asked === \"complete\") {\n const typed = context.value.value.toLowerCase();\n const match = items.find(\n (item) =>\n !item.disabled &&\n context\n .label(item.value)\n .toLowerCase()\n .startsWith(typed),\n );\n if (match !== undefined) {\n context.complete(match);\n }\n return;\n }\n const target =\n asked === \"first\" ? items[0] : items.at(-1);\n context.highlight(target?.id ?? null, \"keyboard\");\n return;\n }\n const id = context.highlighted.value;\n if (id !== null && !items.some((item) => item.id === id)) {\n context.highlight(null, \"keyboard\");\n }\n },\n { flush: \"post\", immediate: true },\n );\n return () => {\n const empty = isEmpty(context);\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { empty },\n {\n role: \"listbox\",\n id: context.listId,\n \"data-primitives-part\": \"autocomplete-list\",\n ...stateAttributes({ empty }),\n ref: setList,\n },\n () =>\n context.hasItems()\n ? context.entries.value.flatMap(\n (entry, index) =>\n slots.default?.({\n entry,\n index,\n state: { empty },\n }) ?? [],\n )\n : slots.default?.({ state: { empty } }),\n );\n };\n },\n }),\n);\n","import type { Align, Side } from \"@fragiola/primitives/positioning\";\nimport { 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 { AutocompleteKey } from \"./autocomplete-context.ts\";\n\nexport interface AutocompletePopupState {\n open: boolean;\n side: Side;\n align: Align;\n}\n\n/** The floating container of the list (no role of its own). */\nexport const AutocompletePopup: PartComponent<\n Record<never, never>,\n AutocompletePopupState\n> = publicComponent(\n defineComponent({\n name: \"AutocompletePopup\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Popup\",\n );\n const setPopup = elementSetter(context.popup);\n return () => {\n const open = context.open.value;\n const status = context.presence.status.value;\n const placed = context.placed.value;\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { open, ...placed },\n {\n \"data-primitives-part\": \"autocomplete-popup\",\n ...stateAttributes({\n open,\n closed: !open,\n side: placed.side,\n align: placed.align,\n \"starting-style\": status === \"starting\",\n \"ending-style\": status === \"ending\",\n }),\n ref: setPopup,\n },\n );\n };\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type OverlayPortalProps,\n overlayPortalProps,\n useOverlayPortal,\n} from \"../../utils/overlay-portal.ts\";\nimport {\n type ContentSlots,\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { AutocompleteKey } from \"./autocomplete-context.ts\";\n\nexport interface AutocompletePortalProps extends OverlayPortalProps {}\n\n/** Moves the content to `container` (default: the body) while mounted, or always with `keep-mounted`. */\nexport const AutocompletePortal: PublicComponent<\n AutocompletePortalProps,\n ContentSlots\n> = publicComponent(\n defineComponent({\n name: \"AutocompletePortal\",\n props: overlayPortalProps,\n setup(props, { slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Portal\",\n );\n return useOverlayPortal(context.presence.mounted, props, slots);\n },\n }),\n);\n","import { openOverlaySession } from \"@fragiola/primitives/overlay\";\nimport type { Align, Side } from \"@fragiola/primitives/positioning\";\nimport { computed, defineComponent, watch } from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport type { PositionerProps } from \"../../composables/use-positioner.ts\";\nimport {\n positionerProps,\n usePositioner,\n} from \"../../composables/use-positioner.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 { AutocompleteKey } from \"./autocomplete-context.ts\";\n\nexport interface AutocompletePositionerState {\n open: boolean;\n side: Side;\n align: Align;\n}\n\n/**\n * Places the list under the InputGroup (else the Input); the open list is a layer\n * (Escape, outside press).\n */\nexport const AutocompletePositioner: PartComponent<\n PositionerProps,\n AutocompletePositionerState\n> = publicComponent(\n defineComponent({\n name: \"AutocompletePositioner\",\n inheritAttrs: false,\n props: { ...asProp, ...positionerProps },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Positioner\",\n );\n const setPositioner = elementSetter(context.positioner);\n const anchor = computed(\n () => context.inputGroup.value ?? context.trigger.value,\n );\n const placed = usePositioner(\n props,\n { side: \"bottom\", align: \"start\" },\n anchor,\n context.positioner,\n null,\n context.presence.mounted,\n );\n watch(placed, (value) => (context.placed.value = value), {\n immediate: true,\n });\n watch(\n () => [context.open.value, context.positioner.value] as const,\n ([open, positioner], _, onCleanup) => {\n if (!open || positioner === null) {\n return;\n }\n const session = openOverlaySession(\n positioner.ownerDocument,\n {\n elements: () => [positioner],\n ignore: () => [\n context.trigger.value,\n context.button.value,\n context.inputGroup.value,\n context.clearButton.value,\n ],\n dismiss: (reason, event) =>\n context.setOpen(false, reason, event),\n },\n );\n onCleanup(session.end);\n },\n { flush: \"post\", immediate: true },\n );\n return () => {\n const open = context.open.value;\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { open, ...placed.value },\n {\n role: \"presentation\",\n hidden: context.presence.mounted.value\n ? undefined\n : true,\n \"data-primitives-part\": \"autocomplete-positioner\",\n ...stateAttributes({\n open,\n closed: !open,\n side: placed.value.side,\n align: placed.value.align,\n }),\n ref: setPositioner,\n },\n );\n };\n },\n }),\n);\n","import {\n containsFilter,\n filterItems,\n type ItemFilter,\n type ItemGroup,\n itemLabel,\n} from \"@fragiola/primitives/collection\";\nimport { bridgeForm } from \"@fragiola/primitives/form\";\nimport type { Align, Side } from \"@fragiola/primitives/positioning\";\nimport {\n computed,\n defineComponent,\n nextTick,\n type PropType,\n provide,\n ref,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\nimport { useControllable } from \"../../composables/use-controllable.ts\";\nimport { useFieldControl } from \"../../composables/use-field-control.ts\";\nimport {\n overlayRootEmits,\n overlayRootProps,\n useOverlayRoot,\n} from \"../../composables/use-overlay-root.ts\";\nimport type {\n ChangeDetails,\n ChangeReason,\n OpenChangeDetails,\n} from \"../../utils/change-details.ts\";\nimport {\n type ContentSlots,\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type AutocompleteContext,\n type AutocompleteItemInfo,\n AutocompleteKey,\n type AutocompleteMode,\n type AutocompleteShown,\n} from \"./autocomplete-context.ts\";\n\nconst NONE: readonly unknown[] = [];\n\n/**\n * `filter` over the consumer's own items: `never` for the item and `unknown` for what\n * `itemToString` takes, so a filter typed for them binds with no cast (as Combobox's).\n */\nexport type AutocompleteFilter = (\n item: never,\n query: string,\n itemToString: (item: unknown) => string,\n) => boolean;\n\n/** `itemToStringValue` over the consumer's own items. */\nexport type AutocompleteItemToString = (item: never) => string;\n\nexport interface AutocompleteRootProps {\n open?: boolean;\n defaultOpen?: boolean;\n /** The text (controlled). */\n value?: string;\n /** The text at first (default `\"\"`). */\n defaultValue?: string;\n /** The suggestions, or groups of them: the autocomplete filters them (`list`, `both`). */\n items?: readonly unknown[];\n /** `list` (default), `both`, `inline` or `none` (spec/autocomplete.md). */\n mode?: AutocompleteMode;\n /** Whether a suggestion matches the query; `null` turns filtering off. */\n filter?: AutocompleteFilter | null;\n /** The most suggestions the list renders; `-1` for no limit. */\n limit?: number;\n locale?: string;\n /** A suggestion's text, written into the input when chosen. */\n itemToStringValue?: AutocompleteItemToString;\n /** A press on the input opens the list (default `false`). */\n openOnInputClick?: boolean;\n /** Typing highlights the first suggestion (`list`, `none`; default `false`). */\n autoHighlight?: boolean;\n name?: string;\n required?: boolean;\n disabled?: boolean;\n}\n\nexport type AutocompleteRootEmits = {\n \"update:open\": (open: boolean) => true;\n openChange: (open: boolean, details: OpenChangeDetails) => true;\n openChangeComplete: (open: boolean) => true;\n \"update:value\": (value: string) => true;\n valueChange: (value: string, details: ChangeDetails) => true;\n};\n\n/**\n * Holds the autocomplete's state (`v-model:value`, the text; `v-model:open`), spec/autocomplete.md.\n */\nexport const AutocompleteRoot: PublicComponent<\n AutocompleteRootProps,\n ContentSlots,\n AutocompleteRootEmits\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteRoot\",\n props: {\n ...overlayRootProps,\n /** The text (controlled). */\n value: { type: String, default: undefined },\n /** The text at first (default `\"\"`). */\n defaultValue: { type: String, default: undefined },\n /** The suggestions, or groups of them. */\n items: {\n type: Array as PropType<\n readonly (unknown | ItemGroup<unknown>)[]\n >,\n default: undefined,\n },\n mode: {\n type: String as PropType<AutocompleteMode>,\n default: \"list\",\n },\n filter: {\n type: Function as PropType<AutocompleteFilter | null>,\n default: undefined,\n },\n limit: { type: Number, default: -1 },\n locale: { type: String, default: undefined },\n itemToStringValue: {\n type: Function as PropType<AutocompleteItemToString>,\n default: undefined,\n },\n openOnInputClick: { type: Boolean, default: false },\n autoHighlight: { type: Boolean, default: false },\n name: { type: String, default: undefined },\n required: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n },\n emits: {\n ...overlayRootEmits,\n \"update:value\": (_value: string) => true,\n valueChange: (_value: string, _details: ChangeDetails) => true,\n },\n setup(props, { emit, slots, expose }) {\n const root = useOverlayRoot(props, emit);\n // a template ref on the Root: `close()` and `unmount()` (spec/README.md, \"Lifecycle\")\n expose(root.actions);\n const label = (item: unknown) =>\n itemLabel(\n item,\n props.itemToStringValue as\n | ((item: unknown) => string)\n | undefined,\n );\n const valueState = useControllable<string, ChangeDetails>(\n () => props.value,\n props.defaultValue ?? \"\",\n (next, details) => {\n emit(\"update:value\", next);\n emit(\"valueChange\", next, details);\n },\n );\n const value = computed(() => valueState.value.value);\n const setValue = (next: string, details: ChangeDetails) =>\n valueState.set(next, details);\n const inline = () =>\n props.mode === \"both\" || props.mode === \"inline\";\n const filters = () =>\n props.mode === \"list\" || props.mode === \"both\";\n\n const field = useFieldControl({\n id: () => root.trigger.value?.id || root.triggerId,\n labelable: true,\n value: () => value.value,\n filled: () => value.value !== \"\",\n input: () => root.trigger.value as HTMLInputElement | null,\n focusTarget: () => root.trigger.value,\n });\n const disabled = () => props.disabled || field.disabled();\n const highlighted = ref<string | null>(null);\n const shown = shallowRef<AutocompleteShown | null>(null);\n const items = new Map<HTMLElement, AutocompleteItemInfo>();\n const pending: AutocompleteContext[\"pending\"] = { current: null };\n const pendingTick = ref(0);\n const requestHighlight: AutocompleteContext[\"requestHighlight\"] = (\n next,\n ) => {\n pending.current = next;\n pendingTick.value++;\n };\n\n const setOpen = (\n next: boolean,\n reason: ChangeReason,\n event?: Event,\n ): boolean => {\n const completion = shown.value;\n const changed = root.setOpen(next, reason, event);\n if (next || !changed) {\n return changed;\n }\n // leaving the input accepts the inline completion (APG, spec/autocomplete.md)\n if (\n inline() &&\n completion !== null &&\n !completion.disabled &&\n (reason === \"focus-out\" || reason === \"outside-press\")\n ) {\n setValue(label(completion.item), {\n reason: \"input-blur\",\n event,\n });\n }\n shown.value = null;\n highlighted.value = null;\n pending.current = null;\n return changed;\n };\n\n const filter = computed<ItemFilter<unknown> | null>(() =>\n props.filter === undefined\n ? containsFilter<unknown>(props.locale)\n : (props.filter as ItemFilter<unknown> | null),\n );\n const entries = computed<readonly unknown[]>(() => {\n const list = props.items;\n if (list === undefined) {\n return NONE;\n }\n return filterItems(list, filters() ? value.value.trim() : \"\", {\n filter: filters() ? filter.value : null,\n limit: props.limit,\n itemToString: label,\n });\n });\n\n const context: AutocompleteContext = {\n ...root,\n setOpen,\n field,\n mode: () => props.mode,\n value,\n shown,\n text: () => shown.value?.text ?? value.value,\n type(text, addition, event) {\n setValue(text, { reason: \"input-change\", event });\n shown.value = null;\n highlighted.value = null;\n pending.current = null;\n const filled = text.trim() !== \"\";\n if (filled && !root.open.value) {\n // an opening the consumer refused asks for no highlight later\n if (!setOpen(true, \"input-change\", event)) {\n return;\n }\n } else if (\n !filled &&\n root.open.value &&\n !props.openOnInputClick\n ) {\n setOpen(false, \"input-clear\", event);\n return;\n }\n if (!filled) {\n return;\n }\n if (inline()) {\n if (addition) {\n requestHighlight(\"complete\");\n }\n } else if (props.autoHighlight) {\n requestHighlight(\"first\");\n }\n },\n disabled,\n name: () => field.name() ?? props.name,\n required: () => props.required,\n openOnInputClick: () => props.openOnInputClick,\n highlighted,\n highlight(id, from) {\n highlighted.value = id;\n if (!inline()) {\n return;\n }\n // a hover completes nothing: the input shows the value again\n if (from === \"pointer\") {\n shown.value = null;\n return;\n }\n const item = [...items.values()].find(\n (entry) => entry.id === id,\n );\n shown.value =\n item === undefined\n ? null\n : {\n item: item.value,\n text: label(item.value),\n selectFrom: null,\n disabled: item.disabled,\n };\n },\n complete(item) {\n // the suggestion's whole text, the part after the typed characters selected (APG)\n highlighted.value = item.id;\n shown.value = {\n item: item.value,\n text: label(item.value),\n selectFrom: value.value.length,\n disabled: item.disabled,\n };\n },\n choose(item, event) {\n shown.value = null;\n highlighted.value = null;\n setValue(label(item), { reason: \"item-press\", event });\n setOpen(false, \"item-press\", event);\n },\n clear(reason, event) {\n shown.value = null;\n highlighted.value = null;\n setValue(\"\", { reason, event });\n },\n label,\n hasItems: () => props.items !== undefined,\n entries,\n items,\n list: shallowRef(null),\n button: shallowRef(null),\n inputGroup: shallowRef(null),\n clearButton: shallowRef(null),\n listId: `${useId()}-list`,\n pending,\n pendingTick,\n requestHighlight,\n placed: ref<{ side: Side; align: Align }>({\n side: \"bottom\",\n align: \"start\",\n }),\n itemCount: ref(0),\n };\n provide(AutocompleteKey, context);\n\n watch(\n root.trigger,\n (element, _, onCleanup) => {\n if (!(element instanceof HTMLInputElement)) {\n return;\n }\n onCleanup(\n bridgeForm(element, {\n reset: () => {\n field.reset();\n shown.value = null;\n highlighted.value = null;\n setValue(props.defaultValue ?? \"\", {\n reason: \"none\",\n });\n setOpen(false, \"none\");\n // the browser reset the input: write the text back once rendered\n void nextTick().then(() => {\n if (element.value !== context.text()) {\n element.value = context.text();\n }\n });\n },\n }),\n );\n },\n { flush: \"post\", immediate: true },\n );\n\n return () => slots.default?.();\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\n\n/** Between groups; no role of its own (a `listbox` owns only groups and options). */\nexport const AutocompleteSeparator: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteSeparator\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n role: \"presentation\",\n \"data-orientation\": \"horizontal\",\n \"data-primitives-part\": \"autocomplete-separator\",\n },\n );\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\n\n/** A polite live region for the consumer's text (spec/autocomplete.md). */\nexport const AutocompleteStatus: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteStatus\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n return () =>\n 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\": \"autocomplete-status\",\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 { AutocompleteKey } from \"./autocomplete-context.ts\";\nimport type { AutocompleteOpenState } from \"./autocomplete-input.ts\";\n\n/** Toggles the list; not in the tab order, keeps focus in the input. */\nexport const AutocompleteTrigger: PartComponent<\n Record<never, never>,\n AutocompleteOpenState\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteTrigger\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Trigger\",\n );\n const setButton = elementSetter(context.button);\n return () => {\n const open = context.open.value;\n const disabled = context.disabled();\n return renderPart(\n \"button\",\n { attrs, slots },\n props.as,\n { open, disabled },\n {\n type: \"button\",\n tabindex: -1,\n disabled,\n \"aria-expanded\": open ? \"true\" : \"false\",\n \"aria-controls\": context.listId,\n \"data-primitives-part\": \"autocomplete-trigger\",\n ...stateAttributes({ \"popup-open\": open, disabled }),\n onPointerdown: (event: PointerEvent) =>\n event.preventDefault(),\n onClick: (event: MouseEvent) => {\n context.pending.current = null;\n context.setOpen(\n !context.open.value,\n \"trigger-press\",\n event,\n );\n context.trigger.value?.focus();\n },\n ref: setButton,\n },\n );\n };\n },\n }),\n);\n","import type { VNode } from \"vue\";\nimport { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { AutocompleteKey } from \"./autocomplete-context.ts\";\n\n/** The default slot renders the value, the text (`v-slot=\"{ value }\"`). */\nexport interface AutocompleteValueSlots {\n default?: (scope: { value: string }) => VNode[];\n}\n\n/** Renders the value: the text, or the default scoped slot of it. */\nexport const AutocompleteValue: PublicComponent<\n Record<never, never>,\n AutocompleteValueSlots\n> = publicComponent(\n defineComponent({\n name: \"AutocompleteValue\",\n setup(_, { slots }) {\n const context = useRequiredContext(\n AutocompleteKey,\n \"Autocomplete.Value\",\n );\n return () =>\n slots.default?.({ value: context.value.value }) ??\n context.value.value;\n },\n }),\n);\n","import { AutocompleteClear } from \"./autocomplete-clear.ts\";\nimport { AutocompleteEmpty } from \"./autocomplete-empty.ts\";\nimport { AutocompleteGroup } from \"./autocomplete-group.ts\";\nimport { AutocompleteGroupLabel } from \"./autocomplete-group-label.ts\";\nimport { AutocompleteInput } from \"./autocomplete-input.ts\";\nimport { AutocompleteInputGroup } from \"./autocomplete-input-group.ts\";\nimport { AutocompleteItem } from \"./autocomplete-item.ts\";\nimport { AutocompleteList } from \"./autocomplete-list.ts\";\nimport { AutocompletePopup } from \"./autocomplete-popup.ts\";\nimport { AutocompletePortal } from \"./autocomplete-portal.ts\";\nimport { AutocompletePositioner } from \"./autocomplete-positioner.ts\";\nimport { AutocompleteRoot } from \"./autocomplete-root.ts\";\nimport { AutocompleteSeparator } from \"./autocomplete-separator.ts\";\nimport { AutocompleteStatus } from \"./autocomplete-status.ts\";\nimport { AutocompleteTrigger } from \"./autocomplete-trigger.ts\";\nimport { AutocompleteValue } from \"./autocomplete-value.ts\";\n\n/** spec/autocomplete.md */\nexport const Autocomplete = {\n Root: AutocompleteRoot,\n InputGroup: AutocompleteInputGroup,\n Input: AutocompleteInput,\n Trigger: AutocompleteTrigger,\n Clear: AutocompleteClear,\n Value: AutocompleteValue,\n Status: AutocompleteStatus,\n Portal: AutocompletePortal,\n Positioner: AutocompletePositioner,\n Popup: AutocompletePopup,\n Empty: AutocompleteEmpty,\n List: AutocompleteList,\n Group: AutocompleteGroup,\n GroupLabel: AutocompleteGroupLabel,\n Separator: AutocompleteSeparator,\n Item: AutocompleteItem,\n};\n"],"mappings":";;;;;;;;;;;;;;AAgFA,MAAa,kBACT,OAAO,cAAc;AAEzB,MAAa,uBACT,OAAO,mBAAmB;;AAG9B,SAAgB,QAAQ,SAAuC;CAC3D,OAAO,QAAQ,SAAS,IAClB,QAAQ,QAAQ,MAAM,WAAW,IACjC,QAAQ,UAAU,UAAU;AACtC;;AAGA,SAAgB,aACZ,SACsB;CACtB,MAAM,OAAO,QAAQ,KAAK;CAC1B,IAAI,SAAS,MACT,OAAO,CAAC;CAEZ,OAAO,CAAC,GAAG,KAAK,iBAA8B,mBAAiB,CAAC,CAAC,CAC5D,KAAK,YAAY,QAAQ,MAAM,IAAI,OAAO,CAAC,CAAC,CAC5C,QAAQ,SAAuC,SAAS,KAAA,CAAS;AAC1E;;AAGA,SAAgB,gBACZ,SACgC;CAChC,MAAM,KAAK,QAAQ,YAAY;CAC/B,IAAI,OAAO,MACP;CAEJ,KAAK,MAAM,QAAQ,QAAQ,MAAM,OAAO,GACpC,IAAI,KAAK,OAAO,IACZ,OAAO;AAInB;;;ACxGA,MAAa,oBAGT,gBACA,gBAAgB;CACZ,MAAM;CACN,cAAc;CACd,OAAO;CACP,MAAM,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KACzB,wBAAwB;KACxB,GAAG,gBAAgB;MAAE,cAAc;MAAM;KAAS,CAAC;KACnD,gBAAgB,UACZ,MAAM,eAAe;KACzB,UAAU,UAAsB;MAC5B,QAAQ,QAAQ,UAAU;MAC1B,QAAQ,QACJ,CAAC,QAAQ,KAAK,OACd,iBACA,KACJ;MACA,QAAQ,QAAQ,OAAO,MAAM;KACjC;KACA,KAAK;IACT,CACJ;GACJ;EACJ;CACJ,CAAC,CErCQ;CACT,OAAO;CACP,ODNA,gBACA,gBAAgB;EACZ,MAAM;EACN,MAAM,GAAG,EAAE,SAAS;GAChB,MAAM,UAAU,mBACZ,iBACA,oBACJ;GACA,aACI,MAAM,UAAU,EAAE,OAAO,QAAQ,MAAM,MAAM,CAAC,KAC9C,QAAQ,MAAM;EACtB;CACJ,CAAC,CCNM;CACP,QAAQ;CACR,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,OAAO;CACP,MAAM;CACN,OAAO;CACP,YAAY;CACZ,WAAW;CACX,MAAM;AACV"}
@@ -0,0 +1,14 @@
1
+ import { a as DatePickerPositioner, i as defineDatePickerRoot, o as DatePickerPortal, s as DatePickerPopup, t as DatePickerTrigger } from "./date-picker-trigger-C2BlzvfR.js";
2
+ import { t as publicComponent } from "./public-component-AV8E7mGp.js";
3
+ // src/components/date-range-picker/parts.ts
4
+ /** spec/calendar.md: a trigger and a popup holding a bound RangeCalendar, with the DatePicker's parts */
5
+ const DateRangePicker = {
6
+ Root: publicComponent(defineDatePickerRoot("DateRangePickerRoot", "date-range-picker", "range")),
7
+ Trigger: DatePickerTrigger,
8
+ Portal: DatePickerPortal,
9
+ Positioner: DatePickerPositioner,
10
+ Popup: DatePickerPopup
11
+ };
12
+ export { DateRangePicker as t };
13
+
14
+ //# sourceMappingURL=parts-CMh29O5y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts-CMh29O5y.js","names":[],"sources":["../src/components/date-range-picker/date-range-picker-root.ts","../src/components/date-range-picker/parts.ts"],"sourcesContent":["import type { DateRange } from \"@fragiola/primitives/date\";\nimport type {\n ChangeDetails,\n OpenChangeDetails,\n} from \"../../utils/change-details.ts\";\nimport {\n type ContentSlots,\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type DatePickerRootSharedProps,\n defineDatePickerRoot,\n} from \"../date-picker/date-picker-root-base.ts\";\n\nexport interface DateRangePickerRootProps extends DatePickerRootSharedProps {\n value?: DateRange | null;\n defaultValue?: DateRange | null;\n}\n\nexport type DateRangePickerRootEmits = {\n \"update:open\": (open: boolean) => true;\n openChange: (open: boolean, details: OpenChangeDetails) => true;\n openChangeComplete: (open: boolean) => true;\n \"update:value\": (value: DateRange | null) => true;\n valueChange: (value: DateRange | null, details: ChangeDetails) => true;\n};\n\n/** A trigger and a popup holding a bound `RangeCalendar.Root` (spec/calendar.md). */\nexport const DateRangePickerRoot: PublicComponent<\n DateRangePickerRootProps,\n ContentSlots,\n DateRangePickerRootEmits\n> = publicComponent(\n defineDatePickerRoot(\"DateRangePickerRoot\", \"date-range-picker\", \"range\"),\n);\n","import { DatePickerPopup } from \"../date-picker/date-picker-popup.ts\";\nimport { DatePickerPortal } from \"../date-picker/date-picker-portal.ts\";\nimport { DatePickerPositioner } from \"../date-picker/date-picker-positioner.ts\";\nimport { DatePickerTrigger } from \"../date-picker/date-picker-trigger.ts\";\nimport { DateRangePickerRoot } from \"./date-range-picker-root.ts\";\n\n/** spec/calendar.md: a trigger and a popup holding a bound RangeCalendar, with the DatePicker's parts */\nexport const DateRangePicker = {\n Root: DateRangePickerRoot,\n Trigger: DatePickerTrigger,\n Portal: DatePickerPortal,\n Positioner: DatePickerPositioner,\n Popup: DatePickerPopup,\n};\n"],"mappings":";;;;ACOA,MAAa,kBAAkB;CAC3B,MDyBA,gBACA,qBAAqB,uBAAuB,qBAAqB,OAAO,CC1BlE;CACN,SAAS;CACT,QAAQ;CACR,YAAY;CACZ,OAAO;AACX"}
@@ -0,0 +1,20 @@
1
+ import { a as CalendarHeaderCell, c as CalendarGrid, i as CalendarGridHeader, l as CalendarCell, n as CalendarNextButton, o as CalendarGridBody, r as CalendarHeading, s as CalendarRow, t as CalendarPrevButton } from "./calendar-prev-button-jluYmM-3.js";
2
+ import { t as publicComponent } from "./public-component-AV8E7mGp.js";
3
+ import { n as defineCalendarRoot } from "./calendar-root-base-C9dfkl55.js";
4
+ // src/components/calendar/parts.ts
5
+ /** spec/calendar.md: one date */
6
+ const Calendar = {
7
+ Root: publicComponent(defineCalendarRoot("CalendarRoot", "calendar", "single")),
8
+ Heading: CalendarHeading,
9
+ PrevButton: CalendarPrevButton,
10
+ NextButton: CalendarNextButton,
11
+ Grid: CalendarGrid,
12
+ GridHeader: CalendarGridHeader,
13
+ HeaderCell: CalendarHeaderCell,
14
+ GridBody: CalendarGridBody,
15
+ Row: CalendarRow,
16
+ Cell: CalendarCell
17
+ };
18
+ export { Calendar as t };
19
+
20
+ //# sourceMappingURL=parts-CZqNGRqe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts-CZqNGRqe.js","names":[],"sources":["../src/components/calendar/calendar-root.ts","../src/components/calendar/parts.ts"],"sourcesContent":["import type { PlainDate } from \"@fragiola/primitives/date\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type CalendarRootSharedProps,\n type CalendarRootState,\n defineCalendarRoot,\n} from \"./calendar-root-base.ts\";\n\nexport interface CalendarRootProps extends CalendarRootSharedProps {\n value?: PlainDate | null;\n defaultValue?: PlainDate | null;\n}\n\nexport type CalendarRootEmits = {\n \"update:value\": (value: PlainDate | null) => true;\n valueChange: (value: PlainDate | null, details: ChangeDetails) => true;\n};\n\n/**\n * One date (spec/calendar.md, `v-model:value`). Inside a DatePicker with no value of its own, it\n * binds to it.\n */\nexport const CalendarRoot: PartComponent<\n CalendarRootProps,\n CalendarRootState,\n CalendarRootEmits\n> = publicComponent(defineCalendarRoot(\"CalendarRoot\", \"calendar\", \"single\"));\n","import { CalendarCell } from \"./calendar-cell.ts\";\nimport { CalendarGrid } from \"./calendar-grid.ts\";\nimport { CalendarGridBody } from \"./calendar-grid-body.ts\";\nimport { CalendarGridHeader } from \"./calendar-grid-header.ts\";\nimport { CalendarHeaderCell } from \"./calendar-header-cell.ts\";\nimport { CalendarHeading } from \"./calendar-heading.ts\";\nimport { CalendarNextButton } from \"./calendar-next-button.ts\";\nimport { CalendarPrevButton } from \"./calendar-prev-button.ts\";\nimport { CalendarRoot } from \"./calendar-root.ts\";\nimport { CalendarRow } from \"./calendar-row.ts\";\n\n/** spec/calendar.md: one date */\nexport const Calendar = {\n Root: CalendarRoot,\n Heading: CalendarHeading,\n PrevButton: CalendarPrevButton,\n NextButton: CalendarNextButton,\n Grid: CalendarGrid,\n GridHeader: CalendarGridHeader,\n HeaderCell: CalendarHeaderCell,\n GridBody: CalendarGridBody,\n Row: CalendarRow,\n Cell: CalendarCell,\n};\n"],"mappings":";;;;;ACYA,MAAa,WAAW;CACpB,MDiBA,gBAAgB,mBAAmB,gBAAgB,YAAY,QAAQ,CCjBjE;CACN,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,KAAK;CACL,MAAM;AACV"}
@@ -0,0 +1,254 @@
1
+ import { t as elementSetter } from "./use-overlay-root-BkyTQIsX.js";
2
+ import { t as useRequiredContext } from "./use-required-context-CPpEkr4Q.js";
3
+ import { t as publicComponent } from "./public-component-AV8E7mGp.js";
4
+ import { n as renderPart, t as asProp } from "./render-part-B5XVbHaS.js";
5
+ import { t as stateAttributes } from "./state-attributes-DhboDeMS.js";
6
+ import { a as MonthCalendarKey, t as defineMonthCalendarRoot } from "./month-calendar-root-base-VcD8ZNW5.js";
7
+ import { n as useProvidedDirection } from "./direction-context-D-C_P6Lm.js";
8
+ import { defineComponent, h, mergeProps, shallowRef, watch } from "vue";
9
+ import { getDirection } from "@fragiola/primitives/direction";
10
+ import { interceptEscape } from "@fragiola/primitives/layers";
11
+ // src/components/month-calendar/month-calendar-cell.ts
12
+ /** One month or year. Its name and content come from `Intl` (the locale exception). */
13
+ const MonthCalendarCell = publicComponent(defineComponent({
14
+ name: "MonthCalendarCell",
15
+ inheritAttrs: false,
16
+ props: {
17
+ ...asProp,
18
+ value: {
19
+ type: Object,
20
+ required: true
21
+ }
22
+ },
23
+ setup(props, { attrs, slots }) {
24
+ const context = useRequiredContext(MonthCalendarKey, "MonthCalendar.Cell");
25
+ const element = shallowRef(null);
26
+ const setElement = elementSetter(element);
27
+ const index = () => context.units().index(props.value);
28
+ const state = () => context.cellState(index());
29
+ watch(() => [
30
+ element.value,
31
+ index(),
32
+ state().focused
33
+ ], ([node, key, focused], _, onCleanup) => {
34
+ if (node === null) return;
35
+ context.cells.set(key, node);
36
+ if (context.focusPending.current && focused) {
37
+ context.focusPending.current = false;
38
+ node.focus({ preventScroll: true });
39
+ }
40
+ onCleanup(() => {
41
+ if (context.cells.get(key) === node) context.cells.delete(key);
42
+ });
43
+ }, {
44
+ flush: "post",
45
+ immediate: true
46
+ });
47
+ return () => {
48
+ const cell = state();
49
+ const key = index();
50
+ const locale = context.locale();
51
+ const units = context.units();
52
+ const consumer = mergeProps({ "aria-label": units.name(locale, key) }, attrs);
53
+ return renderPart("td", {
54
+ attrs: consumer,
55
+ slots
56
+ }, props.as, cell, {
57
+ role: "gridcell",
58
+ tabindex: cell.focused && !cell.disabled ? 0 : -1,
59
+ "aria-selected": cell.selected ? "true" : void 0,
60
+ "aria-disabled": cell.disabled || cell.unavailable ? "true" : void 0,
61
+ "aria-current": cell.today ? "date" : void 0,
62
+ "data-primitives-part": `${context.component}-cell`,
63
+ ...stateAttributes({
64
+ today: cell.today,
65
+ selected: cell.selected,
66
+ disabled: cell.disabled,
67
+ unavailable: cell.unavailable,
68
+ "range-start": cell.rangeStart,
69
+ "range-end": cell.rangeEnd,
70
+ "in-range": cell.inRange,
71
+ "range-preview": cell.rangePreview
72
+ }),
73
+ onMousedown: (event) => {
74
+ if (cell.disabled) event.preventDefault();
75
+ },
76
+ onClick: () => {
77
+ if (!cell.disabled) {
78
+ context.select(key);
79
+ context.requestFocus();
80
+ }
81
+ },
82
+ onPointerenter: () => {
83
+ if (context.anchor.value !== null) context.setHovered(key);
84
+ },
85
+ onFocus: () => {
86
+ if (!cell.focused) context.moveFocus(key);
87
+ },
88
+ ref: setElement
89
+ }, () => slots.default?.({ state: cell }) ?? units.text(locale, key));
90
+ };
91
+ }
92
+ }));
93
+ // src/components/month-calendar/month-calendar-grid.ts
94
+ /** The page, as an ARIA grid with the calendar's keys mapped to items (spec/month-calendar.md). */
95
+ const MonthCalendarGrid = publicComponent(defineComponent({
96
+ name: "MonthCalendarGrid",
97
+ inheritAttrs: false,
98
+ props: asProp,
99
+ setup(props, { attrs, slots }) {
100
+ const direction = useProvidedDirection();
101
+ const context = useRequiredContext(MonthCalendarKey, "MonthCalendar.Grid");
102
+ const element = shallowRef(null);
103
+ const setElement = elementSetter(element);
104
+ watch(element, (grid, _, onCleanup) => {
105
+ if (grid === null) return;
106
+ onCleanup(interceptEscape(grid.ownerDocument, () => context.cancelRange(), { when: (event) => context.anchor.value !== null && event.target instanceof Node && grid.contains(event.target) }));
107
+ }, { immediate: true });
108
+ const onKeydown = (event) => {
109
+ if (event.key === "Enter" || event.key === " ") {
110
+ event.preventDefault();
111
+ context.select(context.focused.value);
112
+ return;
113
+ }
114
+ const target = context.units().keyTarget(event.key, context.focused.value, {
115
+ rtl: getDirection(event.currentTarget, direction()) === "rtl",
116
+ columns: context.columns()
117
+ });
118
+ if (target === null) return;
119
+ event.preventDefault();
120
+ if (context.moveFocus(target)) context.requestFocus();
121
+ };
122
+ return () => renderPart("table", {
123
+ attrs,
124
+ slots
125
+ }, props.as, {}, {
126
+ role: "grid",
127
+ id: context.gridId,
128
+ "aria-labelledby": context.headingId,
129
+ "aria-multiselectable": context.mode === "range" ? "true" : void 0,
130
+ "aria-readonly": context.readOnly() ? "true" : void 0,
131
+ "aria-disabled": context.disabled() ? "true" : void 0,
132
+ "data-primitives-part": `${context.component}-grid`,
133
+ ref: setElement,
134
+ onKeydown
135
+ });
136
+ }
137
+ }));
138
+ // src/components/month-calendar/month-calendar-row.ts
139
+ /** One row of items (`tr`); the default scoped slot gets `{ item }`. */
140
+ const MonthCalendarRow = publicComponent(defineComponent({
141
+ name: "MonthCalendarRow",
142
+ inheritAttrs: false,
143
+ props: {
144
+ ...asProp,
145
+ row: {
146
+ type: Array,
147
+ required: true
148
+ }
149
+ },
150
+ setup(props, { attrs, slots }) {
151
+ const context = useRequiredContext(MonthCalendarKey, "MonthCalendar.Row");
152
+ return () => renderPart("tr", {
153
+ attrs,
154
+ slots
155
+ }, props.as, {}, { "data-primitives-part": `${context.component}-row` }, () => props.row.flatMap((item) => slots.default ? slots.default({ item }) : [h(MonthCalendarCell, {
156
+ key: context.units().index(item),
157
+ value: item
158
+ })]));
159
+ }
160
+ }));
161
+ // src/components/month-calendar/month-calendar-grid-body.ts
162
+ /** The rows of the page (`tbody`); the default scoped slot gets `{ row }`. */
163
+ const MonthCalendarGridBody = publicComponent(defineComponent({
164
+ name: "MonthCalendarGridBody",
165
+ inheritAttrs: false,
166
+ props: asProp,
167
+ setup(props, { attrs, slots }) {
168
+ const context = useRequiredContext(MonthCalendarKey, "MonthCalendar.GridBody");
169
+ return () => {
170
+ const units = context.units();
171
+ const rows = units.rows(context.pageStart.value, context.columns()).map((row) => row.map(context.itemOf));
172
+ return renderPart("tbody", {
173
+ attrs,
174
+ slots
175
+ }, props.as, {}, { "data-primitives-part": `${context.component}-grid-body` }, () => rows.flatMap((row) => slots.default ? slots.default({ row }) : [h(MonthCalendarRow, {
176
+ key: units.index(row[0]),
177
+ row
178
+ })]));
179
+ };
180
+ }
181
+ }));
182
+ // src/components/month-calendar/month-calendar-heading.ts
183
+ /** The year or the page of years shown, from `Intl` unless the default slot gives content. */
184
+ const MonthCalendarHeading = publicComponent(defineComponent({
185
+ name: "MonthCalendarHeading",
186
+ inheritAttrs: false,
187
+ props: asProp,
188
+ setup(props, { attrs, slots }) {
189
+ const context = useRequiredContext(MonthCalendarKey, "MonthCalendar.Heading");
190
+ return () => {
191
+ const label = context.units().heading(context.locale(), context.pageStart.value);
192
+ const state = { label };
193
+ return renderPart("h2", {
194
+ attrs,
195
+ slots
196
+ }, props.as, state, {
197
+ id: context.headingId,
198
+ "aria-live": "polite",
199
+ "data-primitives-part": `${context.component}-heading`
200
+ }, () => slots.default?.({ state }) ?? label);
201
+ };
202
+ }
203
+ }));
204
+ // src/components/month-calendar/month-calendar-page-button.ts
205
+ /** A button that shows the previous or next page (a year; 12 years); the consumer names it. */
206
+ function defineMonthPageButton(name, delta) {
207
+ const part = delta < 0 ? "prev-button" : "next-button";
208
+ return defineComponent({
209
+ name,
210
+ inheritAttrs: false,
211
+ props: asProp,
212
+ setup(props, { attrs, slots }) {
213
+ const context = useRequiredContext(MonthCalendarKey, `MonthCalendar.${delta < 0 ? "PrevButton" : "NextButton"}`);
214
+ return () => {
215
+ const disabled = context.disabled() || !context.canPage(delta);
216
+ return renderPart("button", {
217
+ attrs,
218
+ slots
219
+ }, props.as, { disabled }, {
220
+ type: "button",
221
+ disabled,
222
+ "aria-controls": context.gridId,
223
+ "data-primitives-part": `${context.component}-${part}`,
224
+ ...stateAttributes({ disabled }),
225
+ onClick: () => {
226
+ context.focusPending.current = false;
227
+ context.page(delta);
228
+ }
229
+ });
230
+ };
231
+ }
232
+ });
233
+ }
234
+ // src/components/month-calendar/month-calendar-next-button.ts
235
+ /** Shows the next page (a year; 12 years); the consumer names it. */
236
+ const MonthCalendarNextButton = publicComponent(defineMonthPageButton("MonthCalendarNextButton", 1));
237
+ // src/components/month-calendar/month-calendar-prev-button.ts
238
+ /** Shows the previous page (a year; 12 years); the consumer names it. */
239
+ const MonthCalendarPrevButton = publicComponent(defineMonthPageButton("MonthCalendarPrevButton", -1));
240
+ // src/components/month-calendar/parts.ts
241
+ /** spec/month-calendar.md: one month, in a grid of the 12 months of a year */
242
+ const MonthCalendar = {
243
+ Root: publicComponent(defineMonthCalendarRoot("MonthCalendarRoot", "month-calendar", "month", "single")),
244
+ Heading: MonthCalendarHeading,
245
+ PrevButton: MonthCalendarPrevButton,
246
+ NextButton: MonthCalendarNextButton,
247
+ Grid: MonthCalendarGrid,
248
+ GridBody: MonthCalendarGridBody,
249
+ Row: MonthCalendarRow,
250
+ Cell: MonthCalendarCell
251
+ };
252
+ export { MonthCalendarGridBody as a, MonthCalendarCell as c, MonthCalendarHeading as i, MonthCalendarPrevButton as n, MonthCalendarRow as o, MonthCalendarNextButton as r, MonthCalendarGrid as s, MonthCalendar as t };
253
+
254
+ //# sourceMappingURL=parts-DMy2yQZs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts-DMy2yQZs.js","names":[],"sources":["../src/components/month-calendar/month-calendar-cell.ts","../src/components/month-calendar/month-calendar-grid.ts","../src/components/month-calendar/month-calendar-row.ts","../src/components/month-calendar/month-calendar-grid-body.ts","../src/components/month-calendar/month-calendar-heading.ts","../src/components/month-calendar/month-calendar-page-button.ts","../src/components/month-calendar/month-calendar-next-button.ts","../src/components/month-calendar/month-calendar-prev-button.ts","../src/components/month-calendar/month-calendar-root.ts","../src/components/month-calendar/parts.ts"],"sourcesContent":["import {\n defineComponent,\n mergeProps,\n type PropType,\n shallowRef,\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 {\n type MonthCalendarCellState,\n MonthCalendarKey,\n} from \"./month-calendar-context.ts\";\nimport type { MonthCalendarItem } from \"./month-calendar-value.ts\";\n\nexport interface MonthCalendarCellProps {\n /** The month or year. */\n value: MonthCalendarItem;\n}\n\n/** One month or year. Its name and content come from `Intl` (the locale exception). */\nexport const MonthCalendarCell: PartComponent<\n MonthCalendarCellProps,\n MonthCalendarCellState\n> = publicComponent(\n defineComponent({\n name: \"MonthCalendarCell\",\n inheritAttrs: false,\n props: {\n ...asProp,\n value: {\n type: Object as PropType<MonthCalendarItem>,\n required: true,\n },\n },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n MonthCalendarKey,\n \"MonthCalendar.Cell\",\n );\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n const index = () => context.units().index(props.value);\n const state = () => context.cellState(index());\n watch(\n () => [element.value, index(), state().focused] as const,\n ([node, key, focused], _, onCleanup) => {\n if (node === null) {\n return;\n }\n context.cells.set(key, node);\n // a cell of a page just shown mounts after the keyboard moved the focus to it\n if (context.focusPending.current && focused) {\n context.focusPending.current = false;\n node.focus({ preventScroll: true });\n }\n onCleanup(() => {\n if (context.cells.get(key) === node) {\n context.cells.delete(key);\n }\n });\n },\n { flush: \"post\", immediate: true },\n );\n return () => {\n const cell = state();\n const key = index();\n const locale = context.locale();\n const units = context.units();\n const consumer = mergeProps(\n { \"aria-label\": units.name(locale, key) },\n attrs,\n );\n return renderPart(\n \"td\",\n { attrs: consumer, slots },\n props.as,\n cell,\n {\n role: \"gridcell\",\n tabindex: cell.focused && !cell.disabled ? 0 : -1,\n \"aria-selected\": cell.selected ? \"true\" : undefined,\n \"aria-disabled\":\n cell.disabled || cell.unavailable\n ? \"true\"\n : undefined,\n \"aria-current\": cell.today ? \"date\" : undefined,\n \"data-primitives-part\": `${context.component}-cell`,\n ...stateAttributes({\n today: cell.today,\n selected: cell.selected,\n disabled: cell.disabled,\n unavailable: cell.unavailable,\n \"range-start\": cell.rangeStart,\n \"range-end\": cell.rangeEnd,\n \"in-range\": cell.inRange,\n \"range-preview\": cell.rangePreview,\n }),\n // a disabled item never takes the focus, not even from a press\n onMousedown: (event: MouseEvent) => {\n if (cell.disabled) {\n event.preventDefault();\n }\n },\n onClick: () => {\n if (!cell.disabled) {\n context.select(key);\n context.requestFocus();\n }\n },\n onPointerenter: () => {\n if (context.anchor.value !== null) {\n context.setHovered(key);\n }\n },\n onFocus: () => {\n if (!cell.focused) {\n context.moveFocus(key);\n }\n },\n ref: setElement,\n },\n () =>\n slots.default?.({ state: cell }) ??\n units.text(locale, key),\n );\n };\n },\n }),\n);\n","import { getDirection } from \"@fragiola/primitives/direction\";\nimport { interceptEscape } from \"@fragiola/primitives/layers\";\nimport { defineComponent, shallowRef, watch } from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport { useProvidedDirection } from \"../../direction/direction-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { MonthCalendarKey } from \"./month-calendar-context.ts\";\n\nexport type MonthCalendarGridProps = Record<never, never>;\n\n/** The page, as an ARIA grid with the calendar's keys mapped to items (spec/month-calendar.md). */\nexport const MonthCalendarGrid: PartComponent<\n MonthCalendarGridProps,\n Record<string, never>\n> = publicComponent(\n defineComponent({\n name: \"MonthCalendarGrid\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const direction = useProvidedDirection();\n const context = useRequiredContext(\n MonthCalendarKey,\n \"MonthCalendar.Grid\",\n );\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n // a started range takes Escape before an enclosing overlay's layer (a picker) closes\n // it; the started range is read when the key comes, never after a render\n watch(\n element,\n (grid, _, onCleanup) => {\n if (grid === null) {\n return;\n }\n onCleanup(\n interceptEscape(\n grid.ownerDocument,\n () => context.cancelRange(),\n {\n when: (event) =>\n context.anchor.value !== null &&\n event.target instanceof Node &&\n grid.contains(event.target),\n },\n ),\n );\n },\n { immediate: true },\n );\n const onKeydown = (event: KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n context.select(context.focused.value);\n return;\n }\n const target = context\n .units()\n .keyTarget(event.key, context.focused.value, {\n rtl:\n getDirection(\n event.currentTarget as Element,\n direction(),\n ) === \"rtl\",\n columns: context.columns(),\n });\n if (target === null) {\n return;\n }\n event.preventDefault();\n if (context.moveFocus(target)) {\n context.requestFocus();\n }\n };\n return () =>\n renderPart(\n \"table\",\n { attrs, slots },\n props.as,\n {},\n {\n role: \"grid\",\n id: context.gridId,\n \"aria-labelledby\": context.headingId,\n \"aria-multiselectable\":\n context.mode === \"range\" ? \"true\" : undefined,\n \"aria-readonly\": context.readOnly()\n ? \"true\"\n : undefined,\n \"aria-disabled\": context.disabled()\n ? \"true\"\n : undefined,\n \"data-primitives-part\": `${context.component}-grid`,\n ref: setElement,\n onKeydown,\n },\n );\n },\n }),\n);\n","import { defineComponent, h, type PropType, type VNode } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type AsProp,\n asProp,\n type RenderSlotProps,\n renderPart,\n} from \"../../utils/render-part.ts\";\nimport { MonthCalendarCell } from \"./month-calendar-cell.ts\";\nimport { MonthCalendarKey } from \"./month-calendar-context.ts\";\nimport type { MonthCalendarItem } from \"./month-calendar-value.ts\";\n\nexport interface MonthCalendarRowProps {\n row: MonthCalendarItem[];\n}\n\n/** The default slot renders each item of the row (default: a Cell each). */\nexport interface MonthCalendarRowSlots {\n default?: (scope: { item: MonthCalendarItem }) => VNode[];\n render?: (scope: RenderSlotProps<Record<string, never>>) => VNode[];\n}\n\n/** One row of items (`tr`); the default scoped slot gets `{ item }`. */\nexport const MonthCalendarRow: PublicComponent<\n MonthCalendarRowProps & { as?: AsProp },\n MonthCalendarRowSlots\n> = publicComponent(\n defineComponent({\n name: \"MonthCalendarRow\",\n inheritAttrs: false,\n props: {\n ...asProp,\n row: {\n type: Array as PropType<MonthCalendarItem[]>,\n required: true,\n },\n },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n MonthCalendarKey,\n \"MonthCalendar.Row\",\n );\n return () =>\n renderPart(\n \"tr\",\n { attrs, slots },\n props.as,\n {},\n { \"data-primitives-part\": `${context.component}-row` },\n () =>\n props.row.flatMap((item) =>\n slots.default\n ? slots.default({ item })\n : [\n h(MonthCalendarCell, {\n key: context.units().index(item),\n value: item,\n }),\n ],\n ),\n );\n },\n }),\n);\n","import { defineComponent, h, type VNode } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type AsProp,\n asProp,\n type RenderSlotProps,\n renderPart,\n} from \"../../utils/render-part.ts\";\nimport { MonthCalendarKey } from \"./month-calendar-context.ts\";\nimport { MonthCalendarRow } from \"./month-calendar-row.ts\";\nimport type { MonthCalendarItem } from \"./month-calendar-value.ts\";\n\n/** The default slot renders each row of `columns` items (default: a Row each). */\nexport interface MonthCalendarGridBodySlots {\n default?: (scope: { row: MonthCalendarItem[] }) => VNode[];\n render?: (scope: RenderSlotProps<Record<string, never>>) => VNode[];\n}\n\n/** The rows of the page (`tbody`); the default scoped slot gets `{ row }`. */\nexport const MonthCalendarGridBody: PublicComponent<\n { as?: AsProp },\n MonthCalendarGridBodySlots\n> = publicComponent(\n defineComponent({\n name: \"MonthCalendarGridBody\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n MonthCalendarKey,\n \"MonthCalendar.GridBody\",\n );\n return () => {\n const units = context.units();\n const rows = units\n .rows(context.pageStart.value, context.columns())\n .map((row) => row.map(context.itemOf));\n return renderPart(\n \"tbody\",\n { attrs, slots },\n props.as,\n {},\n {\n \"data-primitives-part\": `${context.component}-grid-body`,\n },\n () =>\n rows.flatMap((row) =>\n slots.default\n ? slots.default({ row })\n : [\n h(MonthCalendarRow, {\n key: units.index(\n row[0] as MonthCalendarItem,\n ),\n row,\n }),\n ],\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 { MonthCalendarKey } from \"./month-calendar-context.ts\";\n\nexport interface MonthCalendarHeadingState {\n /** The year (a month calendar) or the page of years it names, from `Intl`. */\n label: string;\n}\n\nexport type MonthCalendarHeadingProps = Record<never, never>;\n\n/** The year or the page of years shown, from `Intl` unless the default slot gives content. */\nexport const MonthCalendarHeading: PartComponent<\n MonthCalendarHeadingProps,\n MonthCalendarHeadingState\n> = publicComponent(\n defineComponent({\n name: \"MonthCalendarHeading\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n MonthCalendarKey,\n \"MonthCalendar.Heading\",\n );\n return () => {\n const label = context\n .units()\n .heading(context.locale(), context.pageStart.value);\n const state = { label };\n return renderPart(\n \"h2\",\n { attrs, slots },\n props.as,\n state,\n {\n id: context.headingId,\n \"aria-live\": \"polite\",\n \"data-primitives-part\": `${context.component}-heading`,\n },\n () => slots.default?.({ state }) ?? label,\n );\n };\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { MonthCalendarKey } from \"./month-calendar-context.ts\";\n\nexport interface MonthCalendarPageButtonState {\n disabled: boolean;\n}\n\n/** A button that shows the previous or next page (a year; 12 years); the consumer names it. */\nexport function defineMonthPageButton(name: string, delta: 1 | -1) {\n const part = delta < 0 ? \"prev-button\" : \"next-button\";\n return defineComponent({\n name,\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n MonthCalendarKey,\n `MonthCalendar.${delta < 0 ? \"PrevButton\" : \"NextButton\"}`,\n );\n return () => {\n const disabled = context.disabled() || !context.canPage(delta);\n return renderPart(\n \"button\",\n { attrs, slots },\n props.as,\n { disabled },\n {\n type: \"button\",\n disabled,\n \"aria-controls\": context.gridId,\n \"data-primitives-part\": `${context.component}-${part}`,\n ...stateAttributes({ disabled }),\n onClick: () => {\n // the button keeps the focus\n context.focusPending.current = false;\n context.page(delta);\n },\n },\n );\n };\n },\n });\n}\n","import {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n defineMonthPageButton,\n type MonthCalendarPageButtonState,\n} from \"./month-calendar-page-button.ts\";\n\nexport type MonthCalendarNextButtonProps = Record<never, never>;\n\n/** Shows the next page (a year; 12 years); the consumer names it. */\nexport const MonthCalendarNextButton: PartComponent<\n MonthCalendarNextButtonProps,\n MonthCalendarPageButtonState\n> = publicComponent(defineMonthPageButton(\"MonthCalendarNextButton\", 1));\n","import {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n defineMonthPageButton,\n type MonthCalendarPageButtonState,\n} from \"./month-calendar-page-button.ts\";\n\nexport type MonthCalendarPrevButtonProps = Record<never, never>;\n\n/** Shows the previous page (a year; 12 years); the consumer names it. */\nexport const MonthCalendarPrevButton: PartComponent<\n MonthCalendarPrevButtonProps,\n MonthCalendarPageButtonState\n> = publicComponent(defineMonthPageButton(\"MonthCalendarPrevButton\", -1));\n","import type { PlainYearMonth } from \"@fragiola/primitives/month-year\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n defineMonthCalendarRoot,\n type MonthCalendarRootSharedProps,\n type MonthCalendarRootState,\n} from \"./month-calendar-root-base.ts\";\n\nexport interface MonthCalendarRootProps extends MonthCalendarRootSharedProps {\n value?: PlainYearMonth | null;\n defaultValue?: PlainYearMonth | null;\n /** Months before it are disabled. */\n min?: PlainYearMonth | null;\n /** Months after it are disabled. */\n max?: PlainYearMonth | null;\n /** Unavailable months can be focused but not chosen. */\n isUnavailable?: (month: PlainYearMonth) => boolean;\n}\n\nexport type MonthCalendarRootEmits = {\n \"update:value\": (value: PlainYearMonth | null) => true;\n valueChange: (value: PlainYearMonth | null, details: ChangeDetails) => true;\n};\n\n/**\n * One month (spec/month-calendar.md, `v-model:value`). Inside a MonthPicker, or a calendar's month\n * view, with no value of its own, it binds to it.\n */\nexport const MonthCalendarRoot: PartComponent<\n MonthCalendarRootProps,\n MonthCalendarRootState,\n MonthCalendarRootEmits\n> = publicComponent(\n defineMonthCalendarRoot(\n \"MonthCalendarRoot\",\n \"month-calendar\",\n \"month\",\n \"single\",\n ),\n);\n","import { MonthCalendarCell } from \"./month-calendar-cell.ts\";\nimport { MonthCalendarGrid } from \"./month-calendar-grid.ts\";\nimport { MonthCalendarGridBody } from \"./month-calendar-grid-body.ts\";\nimport { MonthCalendarHeading } from \"./month-calendar-heading.ts\";\nimport { MonthCalendarNextButton } from \"./month-calendar-next-button.ts\";\nimport { MonthCalendarPrevButton } from \"./month-calendar-prev-button.ts\";\nimport { MonthCalendarRoot } from \"./month-calendar-root.ts\";\nimport { MonthCalendarRow } from \"./month-calendar-row.ts\";\n\n/** spec/month-calendar.md: one month, in a grid of the 12 months of a year */\nexport const MonthCalendar = {\n Root: MonthCalendarRoot,\n Heading: MonthCalendarHeading,\n PrevButton: MonthCalendarPrevButton,\n NextButton: MonthCalendarNextButton,\n Grid: MonthCalendarGrid,\n GridBody: MonthCalendarGridBody,\n Row: MonthCalendarRow,\n Cell: MonthCalendarCell,\n};\n"],"mappings":";;;;;;;;;;;;AA2BA,MAAa,oBAGT,gBACA,gBAAgB;CACZ,MAAM;CACN,cAAc;CACd,OAAO;EACH,GAAG;EACH,OAAO;GACH,MAAM;GACN,UAAU;EACd;CACJ;CACA,MAAM,OAAO,EAAE,OAAO,SAAS;EAC3B,MAAM,UAAU,mBACZ,kBACA,oBACJ;EACA,MAAM,UAAU,WAA+B,IAAI;EACnD,MAAM,aAAa,cAAc,OAAO;EACxC,MAAM,cAAc,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,aAAa,UAAU;MAC/B,QAAQ,KAAK,KAAK;KACtB;IACJ,CACJ;GACJ;EACJ;CACJ,CAAC;AACL;;;ACjCA,MAAa,0BAGT,gBAAgB,sBAAsB,2BAA2B,CAAC,CAAC;;;ACHvE,MAAa,0BAGT,gBAAgB,sBAAsB,2BAA2B,EAAE,CAAC;;;AELxE,MAAa,gBAAgB;CACzB,MDyBA,gBACA,wBACI,qBACA,kBACA,SACA,QACJ,CC/BM;CACN,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,UAAU;CACV,KAAK;CACL,MAAM;AACV"}
@@ -0,0 +1,14 @@
1
+ import { a as DatePickerPositioner, i as defineDatePickerRoot, o as DatePickerPortal, s as DatePickerPopup, t as DatePickerTrigger } from "./date-picker-trigger-C2BlzvfR.js";
2
+ import { t as publicComponent } from "./public-component-AV8E7mGp.js";
3
+ // src/components/date-picker/parts.ts
4
+ /** spec/calendar.md: a trigger and a popup holding a bound Calendar */
5
+ const DatePicker = {
6
+ Root: publicComponent(defineDatePickerRoot("DatePickerRoot", "date-picker", "single")),
7
+ Trigger: DatePickerTrigger,
8
+ Portal: DatePickerPortal,
9
+ Positioner: DatePickerPositioner,
10
+ Popup: DatePickerPopup
11
+ };
12
+ export { DatePicker as t };
13
+
14
+ //# sourceMappingURL=parts-DVv0aov9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts-DVv0aov9.js","names":[],"sources":["../src/components/date-picker/date-picker-root.ts","../src/components/date-picker/parts.ts"],"sourcesContent":["import type { PlainDate } from \"@fragiola/primitives/date\";\nimport type {\n ChangeDetails,\n OpenChangeDetails,\n} from \"../../utils/change-details.ts\";\nimport {\n type ContentSlots,\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type DatePickerRootSharedProps,\n defineDatePickerRoot,\n} from \"./date-picker-root-base.ts\";\n\nexport interface DatePickerRootProps extends DatePickerRootSharedProps {\n value?: PlainDate | null;\n defaultValue?: PlainDate | null;\n}\n\nexport type DatePickerRootEmits = {\n \"update:open\": (open: boolean) => true;\n openChange: (open: boolean, details: OpenChangeDetails) => true;\n openChangeComplete: (open: boolean) => true;\n \"update:value\": (value: PlainDate | null) => true;\n valueChange: (value: PlainDate | null, details: ChangeDetails) => true;\n};\n\n/** A trigger and a popup holding a bound `Calendar.Root` (spec/calendar.md). */\nexport const DatePickerRoot: PublicComponent<\n DatePickerRootProps,\n ContentSlots,\n DatePickerRootEmits\n> = publicComponent(\n defineDatePickerRoot(\"DatePickerRoot\", \"date-picker\", \"single\"),\n);\n","import { DatePickerPopup } from \"./date-picker-popup.ts\";\nimport { DatePickerPortal } from \"./date-picker-portal.ts\";\nimport { DatePickerPositioner } from \"./date-picker-positioner.ts\";\nimport { DatePickerRoot } from \"./date-picker-root.ts\";\nimport { DatePickerTrigger } from \"./date-picker-trigger.ts\";\n\n/** spec/calendar.md: a trigger and a popup holding a bound Calendar */\nexport const DatePicker = {\n Root: DatePickerRoot,\n Trigger: DatePickerTrigger,\n Portal: DatePickerPortal,\n Positioner: DatePickerPositioner,\n Popup: DatePickerPopup,\n};\n"],"mappings":";;;;ACOA,MAAa,aAAa;CACtB,MDyBA,gBACA,qBAAqB,kBAAkB,eAAe,QAAQ,CC1BxD;CACN,SAAS;CACT,QAAQ;CACR,YAAY;CACZ,OAAO;AACX"}