@fragiola/primitives-vue 0.0.0-stage → 0.0.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 (543) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -2
  3. package/dist/accordion-CmKuKHkK.js +278 -0
  4. package/dist/accordion-CmKuKHkK.js.map +1 -0
  5. package/dist/accordion.d.ts +4 -0
  6. package/dist/accordion.js +1 -0
  7. package/dist/alert-dialog-CPG51QOk.js +38 -0
  8. package/dist/alert-dialog-CPG51QOk.js.map +1 -0
  9. package/dist/alert-dialog.d.ts +9 -0
  10. package/dist/alert-dialog.js +1 -0
  11. package/dist/aspect-ratio-Ba7GaRnV.js +37 -0
  12. package/dist/aspect-ratio-Ba7GaRnV.js.map +1 -0
  13. package/dist/aspect-ratio.d.ts +3 -0
  14. package/dist/aspect-ratio.js +1 -0
  15. package/dist/async-list-Dc8wqcxe.js +39 -0
  16. package/dist/async-list-Dc8wqcxe.js.map +1 -0
  17. package/dist/async-list.d.ts +2 -0
  18. package/dist/async-list.js +1 -0
  19. package/dist/autocomplete-virtual-D_2Wuih7.js +55 -0
  20. package/dist/autocomplete-virtual-D_2Wuih7.js.map +1 -0
  21. package/dist/autocomplete-virtual.d.ts +2 -0
  22. package/dist/autocomplete-virtual.js +3 -0
  23. package/dist/autocomplete.d.ts +6 -0
  24. package/dist/autocomplete.js +1 -0
  25. package/dist/avatar-DdDGa6x7.js +166 -0
  26. package/dist/avatar-DdDGa6x7.js.map +1 -0
  27. package/dist/avatar.d.ts +3 -0
  28. package/dist/avatar.js +1 -0
  29. package/dist/breadcrumbs-BFAjlnC_.js +131 -0
  30. package/dist/breadcrumbs-BFAjlnC_.js.map +1 -0
  31. package/dist/breadcrumbs.d.ts +3 -0
  32. package/dist/breadcrumbs.js +1 -0
  33. package/dist/button-DVUcUCXc.js +56 -0
  34. package/dist/button-DVUcUCXc.js.map +1 -0
  35. package/dist/button-attributes-Ue6sUse5.js +83 -0
  36. package/dist/button-attributes-Ue6sUse5.js.map +1 -0
  37. package/dist/button.d.ts +3 -0
  38. package/dist/button.js +1 -0
  39. package/dist/calendar-preset-Bjc7rcNX.js +84 -0
  40. package/dist/calendar-preset-Bjc7rcNX.js.map +1 -0
  41. package/dist/calendar-preset.d.ts +3 -0
  42. package/dist/calendar-preset.js +3 -0
  43. package/dist/calendar-prev-button-jluYmM-3.js +307 -0
  44. package/dist/calendar-prev-button-jluYmM-3.js.map +1 -0
  45. package/dist/calendar-root-base-C9dfkl55.js +310 -0
  46. package/dist/calendar-root-base-C9dfkl55.js.map +1 -0
  47. package/dist/calendar-view-Djy5iHGK.js +160 -0
  48. package/dist/calendar-view-Djy5iHGK.js.map +1 -0
  49. package/dist/calendar-view.d.ts +4 -0
  50. package/dist/calendar-view.js +4 -0
  51. package/dist/calendar.d.ts +5 -0
  52. package/dist/calendar.js +1 -0
  53. package/dist/carousel-BOacnCmz.js +553 -0
  54. package/dist/carousel-BOacnCmz.js.map +1 -0
  55. package/dist/carousel.d.ts +4 -0
  56. package/dist/carousel.js +1 -0
  57. package/dist/cascade-select-B-Nf6eOA.js +697 -0
  58. package/dist/cascade-select-B-Nf6eOA.js.map +1 -0
  59. package/dist/cascade-select.d.ts +6 -0
  60. package/dist/cascade-select.js +1 -0
  61. package/dist/change-details-Bc4-Xzdm.d.ts +37 -0
  62. package/dist/checkbox-D5NvqFgS.js +230 -0
  63. package/dist/checkbox-D5NvqFgS.js.map +1 -0
  64. package/dist/checkbox-group-C3XftlZd.js +104 -0
  65. package/dist/checkbox-group-C3XftlZd.js.map +1 -0
  66. package/dist/checkbox-group-context-C0Z5sWM1.js +5 -0
  67. package/dist/checkbox-group-context-C0Z5sWM1.js.map +1 -0
  68. package/dist/checkbox-group.d.ts +4 -0
  69. package/dist/checkbox-group.js +1 -0
  70. package/dist/checkbox.d.ts +4 -0
  71. package/dist/checkbox.js +1 -0
  72. package/dist/clipboard-BM-4-lTv.js +195 -0
  73. package/dist/clipboard-BM-4-lTv.js.map +1 -0
  74. package/dist/clipboard.d.ts +4 -0
  75. package/dist/clipboard.js +1 -0
  76. package/dist/collapsible-DSCxhlQN.js +158 -0
  77. package/dist/collapsible-DSCxhlQN.js.map +1 -0
  78. package/dist/collapsible.d.ts +4 -0
  79. package/dist/collapsible.js +1 -0
  80. package/dist/color-area-uEHPo-Nq.js +350 -0
  81. package/dist/color-area-uEHPo-Nq.js.map +1 -0
  82. package/dist/color-area.d.ts +4 -0
  83. package/dist/color-area.js +1 -0
  84. package/dist/color-field-Di2IbTa3.js +384 -0
  85. package/dist/color-field-Di2IbTa3.js.map +1 -0
  86. package/dist/color-field.d.ts +4 -0
  87. package/dist/color-field.js +1 -0
  88. package/dist/color-picker-BgFgq5R0.js +311 -0
  89. package/dist/color-picker-BgFgq5R0.js.map +1 -0
  90. package/dist/color-picker-binding-CJ-Cbxbj.js +5 -0
  91. package/dist/color-picker-binding-CJ-Cbxbj.js.map +1 -0
  92. package/dist/color-picker-popover-Dx6LX0V3.js +233 -0
  93. package/dist/color-picker-popover-Dx6LX0V3.js.map +1 -0
  94. package/dist/color-picker-popover.d.ts +6 -0
  95. package/dist/color-picker-popover.js +1 -0
  96. package/dist/color-picker.d.ts +4 -0
  97. package/dist/color-picker.js +1 -0
  98. package/dist/color-slider-BCqoolnY.js +410 -0
  99. package/dist/color-slider-BCqoolnY.js.map +1 -0
  100. package/dist/color-slider.d.ts +4 -0
  101. package/dist/color-slider.js +1 -0
  102. package/dist/color-swatch-C-8IN28V.js +54 -0
  103. package/dist/color-swatch-C-8IN28V.js.map +1 -0
  104. package/dist/color-swatch-picker-CU1wrhjX.js +312 -0
  105. package/dist/color-swatch-picker-CU1wrhjX.js.map +1 -0
  106. package/dist/color-swatch-picker.d.ts +4 -0
  107. package/dist/color-swatch-picker.js +1 -0
  108. package/dist/color-swatch.d.ts +3 -0
  109. package/dist/color-swatch.js +1 -0
  110. package/dist/color-wheel-F_BoXKON.js +284 -0
  111. package/dist/color-wheel-F_BoXKON.js.map +1 -0
  112. package/dist/color-wheel.d.ts +4 -0
  113. package/dist/color-wheel.js +1 -0
  114. package/dist/combobox-virtual-DTRTVq5N.js +56 -0
  115. package/dist/combobox-virtual-DTRTVq5N.js.map +1 -0
  116. package/dist/combobox-virtual.d.ts +2 -0
  117. package/dist/combobox-virtual.js +3 -0
  118. package/dist/combobox.d.ts +6 -0
  119. package/dist/combobox.js +1 -0
  120. package/dist/command-virtual-LoTBDEY5.js +59 -0
  121. package/dist/command-virtual-LoTBDEY5.js.map +1 -0
  122. package/dist/command-virtual.d.ts +3 -0
  123. package/dist/command-virtual.js +3 -0
  124. package/dist/command.d.ts +4 -0
  125. package/dist/command.js +1 -0
  126. package/dist/context-menu-zdHIGS9E.js +151 -0
  127. package/dist/context-menu-zdHIGS9E.js.map +1 -0
  128. package/dist/context-menu.d.ts +7 -0
  129. package/dist/context-menu.js +1 -0
  130. package/dist/date-field-pgSTZiPb.js +78 -0
  131. package/dist/date-field-pgSTZiPb.js.map +1 -0
  132. package/dist/date-field-root-base-CYLuAykm.js +212 -0
  133. package/dist/date-field-root-base-CYLuAykm.js.map +1 -0
  134. package/dist/date-field.d.ts +4 -0
  135. package/dist/date-field.js +1 -0
  136. package/dist/date-picker-input-CiuuRiWZ.js +16 -0
  137. package/dist/date-picker-input-CiuuRiWZ.js.map +1 -0
  138. package/dist/date-picker-input-root-base-ExPSLeKw.js +318 -0
  139. package/dist/date-picker-input-root-base-ExPSLeKw.js.map +1 -0
  140. package/dist/date-picker-input.d.ts +4 -0
  141. package/dist/date-picker-input.js +3 -0
  142. package/dist/date-picker-trigger-C2BlzvfR.js +349 -0
  143. package/dist/date-picker-trigger-C2BlzvfR.js.map +1 -0
  144. package/dist/date-picker.d.ts +6 -0
  145. package/dist/date-picker.js +1 -0
  146. package/dist/date-range-field-Bygmkl5c.js +80 -0
  147. package/dist/date-range-field-Bygmkl5c.js.map +1 -0
  148. package/dist/date-range-field-input-CivpQMYd.js +69 -0
  149. package/dist/date-range-field-input-CivpQMYd.js.map +1 -0
  150. package/dist/date-range-field-root-base-BP26TSWz.js +267 -0
  151. package/dist/date-range-field-root-base-BP26TSWz.js.map +1 -0
  152. package/dist/date-range-field.d.ts +4 -0
  153. package/dist/date-range-field.js +1 -0
  154. package/dist/date-range-picker-input-BUNCCXUY.js +17 -0
  155. package/dist/date-range-picker-input-BUNCCXUY.js.map +1 -0
  156. package/dist/date-range-picker-input.d.ts +4 -0
  157. package/dist/date-range-picker-input.js +3 -0
  158. package/dist/date-range-picker.d.ts +7 -0
  159. package/dist/date-range-picker.js +1 -0
  160. package/dist/dialog-MNjIMCfA.js +38 -0
  161. package/dist/dialog-MNjIMCfA.js.map +1 -0
  162. package/dist/dialog-root-base-jbZipaoQ.js +329 -0
  163. package/dist/dialog-root-base-jbZipaoQ.js.map +1 -0
  164. package/dist/dialog-viewport-tYqWTs9Q.d.ts +54 -0
  165. package/dist/dialog.d.ts +9 -0
  166. package/dist/dialog.js +1 -0
  167. package/dist/direction-CN_deiZU.js +30 -0
  168. package/dist/direction-CN_deiZU.js.map +1 -0
  169. package/dist/direction-context-D-C_P6Lm.js +19 -0
  170. package/dist/direction-context-D-C_P6Lm.js.map +1 -0
  171. package/dist/direction.d.ts +2 -0
  172. package/dist/direction.js +1 -0
  173. package/dist/drawer-BcnuGtEt.js +357 -0
  174. package/dist/drawer-BcnuGtEt.js.map +1 -0
  175. package/dist/drawer.d.ts +9 -0
  176. package/dist/drawer.js +1 -0
  177. package/dist/drop-zone-vFJ5Kvsy.js +98 -0
  178. package/dist/drop-zone-vFJ5Kvsy.js.map +1 -0
  179. package/dist/drop-zone.d.ts +4 -0
  180. package/dist/drop-zone.js +1 -0
  181. package/dist/editable-CabzXgiN.js +436 -0
  182. package/dist/editable-CabzXgiN.js.map +1 -0
  183. package/dist/editable.d.ts +4 -0
  184. package/dist/editable.js +1 -0
  185. package/dist/field-DQ2d5nhC.js +397 -0
  186. package/dist/field-DQ2d5nhC.js.map +1 -0
  187. package/dist/field.d.ts +4 -0
  188. package/dist/field.js +1 -0
  189. package/dist/fieldset-CmmDzOPs.js +80 -0
  190. package/dist/fieldset-CmmDzOPs.js.map +1 -0
  191. package/dist/fieldset-context-DtEOoG6M.js +5 -0
  192. package/dist/fieldset-context-DtEOoG6M.js.map +1 -0
  193. package/dist/fieldset.d.ts +3 -0
  194. package/dist/fieldset.js +1 -0
  195. package/dist/file-upload-_Hh-STdv.js +644 -0
  196. package/dist/file-upload-_Hh-STdv.js.map +1 -0
  197. package/dist/file-upload.d.ts +4 -0
  198. package/dist/file-upload.js +1 -0
  199. package/dist/form-context-DBnVT1lw.js +5 -0
  200. package/dist/form-context-DBnVT1lw.js.map +1 -0
  201. package/dist/form-s9HijjTL.js +92 -0
  202. package/dist/form-s9HijjTL.js.map +1 -0
  203. package/dist/form.d.ts +3 -0
  204. package/dist/form.js +1 -0
  205. package/dist/hover-card-rmd0fD17.js +355 -0
  206. package/dist/hover-card-rmd0fD17.js.map +1 -0
  207. package/dist/hover-card.d.ts +9 -0
  208. package/dist/hover-card.js +1 -0
  209. package/dist/index-5WtjXdX9.d.ts +63 -0
  210. package/dist/index-5eBkkEtv.d.ts +36 -0
  211. package/dist/index-B-vqAG6g.d.ts +33 -0
  212. package/dist/index-B1uYYVtV.d.ts +18 -0
  213. package/dist/index-B8E3X1CK.d.ts +66 -0
  214. package/dist/index-B8Ufhgzu.d.ts +36 -0
  215. package/dist/index-BJz7OWbi.d.ts +88 -0
  216. package/dist/index-BMjRueuv.d.ts +40 -0
  217. package/dist/index-BP7Tmb0E.d.ts +95 -0
  218. package/dist/index-Bbb1Zgwo.d.ts +50 -0
  219. package/dist/index-BdJFU5tH.d.ts +28 -0
  220. package/dist/index-BdfnRo-h.d.ts +55 -0
  221. package/dist/index-BniQvFN-.d.ts +38 -0
  222. package/dist/index-Bt0B-8RV.d.ts +14 -0
  223. package/dist/index-BuWJcRPC.d.ts +18 -0
  224. package/dist/index-Byf0GNd9.d.ts +41 -0
  225. package/dist/index-BzHLkAWU.d.ts +35 -0
  226. package/dist/index-C-QYKtWy.d.ts +28 -0
  227. package/dist/index-C7nh2Oil.d.ts +40 -0
  228. package/dist/index-CDKebSlA.d.ts +41 -0
  229. package/dist/index-CFPqV6qJ.d.ts +72 -0
  230. package/dist/index-CRJv_zWm.d.ts +37 -0
  231. package/dist/index-CTzUalDO.d.ts +76 -0
  232. package/dist/index-CZHLD5cJ.d.ts +17 -0
  233. package/dist/index-Cgwn5qgy.d.ts +88 -0
  234. package/dist/index-Ch4h1DFC.d.ts +55 -0
  235. package/dist/index-Cj3B9gY_.d.ts +50 -0
  236. package/dist/index-Cj6NwCBD.d.ts +44 -0
  237. package/dist/index-CkDThwop.d.ts +21 -0
  238. package/dist/index-Cn-D14iz.d.ts +13 -0
  239. package/dist/index-CpTiLSql.d.ts +53 -0
  240. package/dist/index-CqP363e5.d.ts +118 -0
  241. package/dist/index-Cv4dRdEa.d.ts +72 -0
  242. package/dist/index-CyI637MF.d.ts +37 -0
  243. package/dist/index-D11YCkvR.d.ts +42 -0
  244. package/dist/index-D3yyJGzf.d.ts +74 -0
  245. package/dist/index-D5PbKxcs.d.ts +26 -0
  246. package/dist/index-DAYklR-H.d.ts +18 -0
  247. package/dist/index-DIZSgXHM.d.ts +79 -0
  248. package/dist/index-DZckp3H0.d.ts +37 -0
  249. package/dist/index-DaqoBvQf.d.ts +56 -0
  250. package/dist/index-Df9i45Gr.d.ts +65 -0
  251. package/dist/index-DqI6n06W.d.ts +59 -0
  252. package/dist/index-Drp7svmT.d.ts +30 -0
  253. package/dist/index-DxsUcSGT.d.ts +99 -0
  254. package/dist/index-Dyyi-1mv.d.ts +35 -0
  255. package/dist/index-I2ewgOGz.d.ts +76 -0
  256. package/dist/index-JGhlANKo.d.ts +24 -0
  257. package/dist/index-KASc7z5u.d.ts +38 -0
  258. package/dist/index-LTcmDERY.d.ts +65 -0
  259. package/dist/index-Mf2RPgmw.d.ts +38 -0
  260. package/dist/index-NdY27G_d.d.ts +58 -0
  261. package/dist/index-QO79pDtI.d.ts +70 -0
  262. package/dist/index-S0FIwOSw.d.ts +59 -0
  263. package/dist/index-UxsyZS_A.d.ts +23 -0
  264. package/dist/index-W8aOtVIu.d.ts +40 -0
  265. package/dist/index-WC9xwMaX.d.ts +34 -0
  266. package/dist/index-Xwb9OtVU.d.ts +7 -0
  267. package/dist/index-ZWJJ2V_J.d.ts +49 -0
  268. package/dist/index-_Q_N8ZbU.d.ts +35 -0
  269. package/dist/index-bC3hHzam.d.ts +101 -0
  270. package/dist/index-baY49J-s.d.ts +15 -0
  271. package/dist/index-dCTvA7uS.d.ts +20 -0
  272. package/dist/index-mhpoLESL.d.ts +77 -0
  273. package/dist/index-p3t0BKd4.d.ts +22 -0
  274. package/dist/index-sgaMj_3p.d.ts +69 -0
  275. package/dist/index-tSLNRqTo.d.ts +33 -0
  276. package/dist/index-t_lSQgLA.d.ts +1346 -0
  277. package/dist/index-uL1dEAhG.d.ts +28 -0
  278. package/dist/index.d.ts +79 -0
  279. package/dist/index.js +106 -0
  280. package/dist/label-Ce-gIayi.js +35 -0
  281. package/dist/label-Ce-gIayi.js.map +1 -0
  282. package/dist/label.d.ts +3 -0
  283. package/dist/label.js +1 -0
  284. package/dist/labelled-part-DB2rXJFG.js +56 -0
  285. package/dist/labelled-part-DB2rXJFG.js.map +1 -0
  286. package/dist/link-CZ3ISaPX.js +42 -0
  287. package/dist/link-CZ3ISaPX.js.map +1 -0
  288. package/dist/link-attributes-D9UusWws.js +29 -0
  289. package/dist/link-attributes-D9UusWws.js.map +1 -0
  290. package/dist/link.d.ts +3 -0
  291. package/dist/link.js +1 -0
  292. package/dist/listbox-virtual-He6BWlPj.js +291 -0
  293. package/dist/listbox-virtual-He6BWlPj.js.map +1 -0
  294. package/dist/listbox-virtual.d.ts +5 -0
  295. package/dist/listbox-virtual.js +3 -0
  296. package/dist/listbox.d.ts +4 -0
  297. package/dist/listbox.js +1 -0
  298. package/dist/live-region-style-9ofmajhO.js +46 -0
  299. package/dist/live-region-style-9ofmajhO.js.map +1 -0
  300. package/dist/menu-D7TVxPdb.js +144 -0
  301. package/dist/menu-D7TVxPdb.js.map +1 -0
  302. package/dist/menu-bar-context-k5vMlwmW.js +13 -0
  303. package/dist/menu-bar-context-k5vMlwmW.js.map +1 -0
  304. package/dist/menu-submenu-trigger-ClI2Pm4X.js +885 -0
  305. package/dist/menu-submenu-trigger-ClI2Pm4X.js.map +1 -0
  306. package/dist/menu-submenu-trigger-DNH8_uUB.d.ts +127 -0
  307. package/dist/menu.d.ts +10 -0
  308. package/dist/menu.js +1 -0
  309. package/dist/menubar-CQn3AOiQ.js +212 -0
  310. package/dist/menubar-CQn3AOiQ.js.map +1 -0
  311. package/dist/menubar.d.ts +3 -0
  312. package/dist/menubar.js +1 -0
  313. package/dist/meter-7Qd_WaUY.js +202 -0
  314. package/dist/meter-7Qd_WaUY.js.map +1 -0
  315. package/dist/meter.d.ts +3 -0
  316. package/dist/meter.js +1 -0
  317. package/dist/month-calendar-root-base-VcD8ZNW5.js +354 -0
  318. package/dist/month-calendar-root-base-VcD8ZNW5.js.map +1 -0
  319. package/dist/month-calendar.d.ts +5 -0
  320. package/dist/month-calendar.js +1 -0
  321. package/dist/month-picker-DzOYqW1S.js +15 -0
  322. package/dist/month-picker-DzOYqW1S.js.map +1 -0
  323. package/dist/month-picker-root-base-ByMK_Mfq.js +158 -0
  324. package/dist/month-picker-root-base-ByMK_Mfq.js.map +1 -0
  325. package/dist/month-picker.d.ts +7 -0
  326. package/dist/month-picker.js +3 -0
  327. package/dist/month-range-calendar-CJAWu1-Z.js +18 -0
  328. package/dist/month-range-calendar-CJAWu1-Z.js.map +1 -0
  329. package/dist/month-range-calendar.d.ts +5 -0
  330. package/dist/month-range-calendar.js +3 -0
  331. package/dist/month-range-picker-CRJDG2HG.js +15 -0
  332. package/dist/month-range-picker-CRJDG2HG.js.map +1 -0
  333. package/dist/month-range-picker.d.ts +8 -0
  334. package/dist/month-range-picker.js +3 -0
  335. package/dist/multiple-calendar-BIb2zfBH.js +176 -0
  336. package/dist/multiple-calendar-BIb2zfBH.js.map +1 -0
  337. package/dist/multiple-calendar.d.ts +5 -0
  338. package/dist/multiple-calendar.js +3 -0
  339. package/dist/navigation-menu-COTxGol_.js +727 -0
  340. package/dist/navigation-menu-COTxGol_.js.map +1 -0
  341. package/dist/navigation-menu.d.ts +5 -0
  342. package/dist/navigation-menu.js +1 -0
  343. package/dist/number-field-CqxEnwiS.js +581 -0
  344. package/dist/number-field-CqxEnwiS.js.map +1 -0
  345. package/dist/number-field.d.ts +4 -0
  346. package/dist/number-field.js +1 -0
  347. package/dist/otp-field-DIDuypLU.js +420 -0
  348. package/dist/otp-field-DIDuypLU.js.map +1 -0
  349. package/dist/otp-field.d.ts +4 -0
  350. package/dist/otp-field.js +1 -0
  351. package/dist/overlay-handle-DUptsQOb.js +42 -0
  352. package/dist/overlay-handle-DUptsQOb.js.map +1 -0
  353. package/dist/overlay-handle-DzC9LJQo.d.ts +16 -0
  354. package/dist/overlay-portal-Cmn7Dt7E.d.ts +30 -0
  355. package/dist/overlay-portal-ZNtXmoFd.js +32 -0
  356. package/dist/overlay-portal-ZNtXmoFd.js.map +1 -0
  357. package/dist/pagination-BNUjFYxK.js +264 -0
  358. package/dist/pagination-BNUjFYxK.js.map +1 -0
  359. package/dist/pagination.d.ts +4 -0
  360. package/dist/pagination.js +1 -0
  361. package/dist/parts--mC44S1N.js +1023 -0
  362. package/dist/parts--mC44S1N.js.map +1 -0
  363. package/dist/parts-BP00C3Q5.js +874 -0
  364. package/dist/parts-BP00C3Q5.js.map +1 -0
  365. package/dist/parts-CMh29O5y.js +14 -0
  366. package/dist/parts-CMh29O5y.js.map +1 -0
  367. package/dist/parts-CZqNGRqe.js +20 -0
  368. package/dist/parts-CZqNGRqe.js.map +1 -0
  369. package/dist/parts-DMy2yQZs.js +254 -0
  370. package/dist/parts-DMy2yQZs.js.map +1 -0
  371. package/dist/parts-DVv0aov9.js +14 -0
  372. package/dist/parts-DVv0aov9.js.map +1 -0
  373. package/dist/parts-M3ThgZzl.js +489 -0
  374. package/dist/parts-M3ThgZzl.js.map +1 -0
  375. package/dist/parts-stPOp8dr.js +451 -0
  376. package/dist/parts-stPOp8dr.js.map +1 -0
  377. package/dist/parts-uxRkRrFr.js +668 -0
  378. package/dist/parts-uxRkRrFr.js.map +1 -0
  379. package/dist/password-input-DC39W-do.js +231 -0
  380. package/dist/password-input-DC39W-do.js.map +1 -0
  381. package/dist/password-input.d.ts +4 -0
  382. package/dist/password-input.js +1 -0
  383. package/dist/popover-BaQTGAYJ.js +328 -0
  384. package/dist/popover-BaQTGAYJ.js.map +1 -0
  385. package/dist/popover.d.ts +9 -0
  386. package/dist/popover.js +1 -0
  387. package/dist/progress-DH1Xrj73.js +219 -0
  388. package/dist/progress-DH1Xrj73.js.map +1 -0
  389. package/dist/progress.d.ts +3 -0
  390. package/dist/progress.js +1 -0
  391. package/dist/public-component-AV8E7mGp.js +8 -0
  392. package/dist/public-component-AV8E7mGp.js.map +1 -0
  393. package/dist/public-component-DYpU9aDh.d.ts +33 -0
  394. package/dist/radio-B9YCSnFs.js +159 -0
  395. package/dist/radio-B9YCSnFs.js.map +1 -0
  396. package/dist/radio-group-CmSF4FTc.js +173 -0
  397. package/dist/radio-group-CmSF4FTc.js.map +1 -0
  398. package/dist/radio-group-context-C196JZ9D.js +5 -0
  399. package/dist/radio-group-context-C196JZ9D.js.map +1 -0
  400. package/dist/radio-group.d.ts +4 -0
  401. package/dist/radio-group.js +1 -0
  402. package/dist/radio.d.ts +3 -0
  403. package/dist/radio.js +1 -0
  404. package/dist/range-calendar-BDbNdL75.js +20 -0
  405. package/dist/range-calendar-BDbNdL75.js.map +1 -0
  406. package/dist/range-calendar.d.ts +5 -0
  407. package/dist/range-calendar.js +1 -0
  408. package/dist/rating-oC2t52av.js +351 -0
  409. package/dist/rating-oC2t52av.js.map +1 -0
  410. package/dist/rating.d.ts +4 -0
  411. package/dist/rating.js +1 -0
  412. package/dist/render-part-B5XVbHaS.js +36 -0
  413. package/dist/render-part-B5XVbHaS.js.map +1 -0
  414. package/dist/render-part-BaTKiWBp.d.ts +28 -0
  415. package/dist/render.d.ts +3 -0
  416. package/dist/render.js +3 -0
  417. package/dist/roving-context-LyHQFJqZ.js +32 -0
  418. package/dist/roving-context-LyHQFJqZ.js.map +1 -0
  419. package/dist/scroll-area-_EApTP33.js +328 -0
  420. package/dist/scroll-area-_EApTP33.js.map +1 -0
  421. package/dist/scroll-area.d.ts +3 -0
  422. package/dist/scroll-area.js +1 -0
  423. package/dist/search-field-DJIr926A.js +221 -0
  424. package/dist/search-field-DJIr926A.js.map +1 -0
  425. package/dist/search-field.d.ts +4 -0
  426. package/dist/search-field.js +1 -0
  427. package/dist/segmented-control-BMvmqBpR.js +389 -0
  428. package/dist/segmented-control-BMvmqBpR.js.map +1 -0
  429. package/dist/segmented-control.d.ts +4 -0
  430. package/dist/segmented-control.js +1 -0
  431. package/dist/select-virtual-BwZrX4bh.js +53 -0
  432. package/dist/select-virtual-BwZrX4bh.js.map +1 -0
  433. package/dist/select-virtual.d.ts +3 -0
  434. package/dist/select-virtual.js +3 -0
  435. package/dist/select.d.ts +6 -0
  436. package/dist/select.js +1 -0
  437. package/dist/separator-SgHyzEHB.js +42 -0
  438. package/dist/separator-SgHyzEHB.js.map +1 -0
  439. package/dist/separator.d.ts +3 -0
  440. package/dist/separator.js +1 -0
  441. package/dist/slider-DU5Cx7yj.js +539 -0
  442. package/dist/slider-DU5Cx7yj.js.map +1 -0
  443. package/dist/slider.d.ts +4 -0
  444. package/dist/slider.js +1 -0
  445. package/dist/state-attributes-DhboDeMS.js +14 -0
  446. package/dist/state-attributes-DhboDeMS.js.map +1 -0
  447. package/dist/steps-Dl_mMqRB.js +363 -0
  448. package/dist/steps-Dl_mMqRB.js.map +1 -0
  449. package/dist/steps.d.ts +4 -0
  450. package/dist/steps.js +1 -0
  451. package/dist/switch-CT9QBKOs.js +183 -0
  452. package/dist/switch-CT9QBKOs.js.map +1 -0
  453. package/dist/switch.d.ts +4 -0
  454. package/dist/switch.js +1 -0
  455. package/dist/tabs-BhVbQ7AV.js +369 -0
  456. package/dist/tabs-BhVbQ7AV.js.map +1 -0
  457. package/dist/tabs.d.ts +4 -0
  458. package/dist/tabs.js +1 -0
  459. package/dist/tag-group-DdpjWmzb.js +422 -0
  460. package/dist/tag-group-DdpjWmzb.js.map +1 -0
  461. package/dist/tag-group.d.ts +4 -0
  462. package/dist/tag-group.js +1 -0
  463. package/dist/tags-input-Iw3mST3A.js +627 -0
  464. package/dist/tags-input-Iw3mST3A.js.map +1 -0
  465. package/dist/tags-input.d.ts +4 -0
  466. package/dist/tags-input.js +1 -0
  467. package/dist/time-field-5Ghk_4SZ.js +76 -0
  468. package/dist/time-field-5Ghk_4SZ.js.map +1 -0
  469. package/dist/time-field.d.ts +4 -0
  470. package/dist/time-field.js +1 -0
  471. package/dist/time-range-field-DNOZQK4F.js +77 -0
  472. package/dist/time-range-field-DNOZQK4F.js.map +1 -0
  473. package/dist/time-range-field.d.ts +4 -0
  474. package/dist/time-range-field.js +1 -0
  475. package/dist/toast-DBKxX79M.js +426 -0
  476. package/dist/toast-DBKxX79M.js.map +1 -0
  477. package/dist/toast.d.ts +3 -0
  478. package/dist/toast.js +1 -0
  479. package/dist/toggle-Cca0PFQv.js +101 -0
  480. package/dist/toggle-Cca0PFQv.js.map +1 -0
  481. package/dist/toggle-group-DTUrLX_H.js +102 -0
  482. package/dist/toggle-group-DTUrLX_H.js.map +1 -0
  483. package/dist/toggle-group-context-gMEC8r-Z.js +5 -0
  484. package/dist/toggle-group-context-gMEC8r-Z.js.map +1 -0
  485. package/dist/toggle-group.d.ts +4 -0
  486. package/dist/toggle-group.js +1 -0
  487. package/dist/toggle.d.ts +4 -0
  488. package/dist/toggle.js +1 -0
  489. package/dist/toolbar-WU8JwFd0.js +272 -0
  490. package/dist/toolbar-WU8JwFd0.js.map +1 -0
  491. package/dist/toolbar.d.ts +3 -0
  492. package/dist/toolbar.js +1 -0
  493. package/dist/tooltip-C1kKsTSh.js +358 -0
  494. package/dist/tooltip-C1kKsTSh.js.map +1 -0
  495. package/dist/tooltip.d.ts +9 -0
  496. package/dist/tooltip.js +1 -0
  497. package/dist/use-color-picker-binding-BrG-whys.js +32 -0
  498. package/dist/use-color-picker-binding-BrG-whys.js.map +1 -0
  499. package/dist/use-controllable-B46G4v0A.js +30 -0
  500. package/dist/use-controllable-B46G4v0A.js.map +1 -0
  501. package/dist/use-field-control-CdYqr0dK.js +109 -0
  502. package/dist/use-field-control-CdYqr0dK.js.map +1 -0
  503. package/dist/use-overlay-root-BkyTQIsX.js +296 -0
  504. package/dist/use-overlay-root-BkyTQIsX.js.map +1 -0
  505. package/dist/use-overlay-trigger-D9OXZ_6K.d.ts +12 -0
  506. package/dist/use-overlay-trigger-KM35pX0a.js +61 -0
  507. package/dist/use-overlay-trigger-KM35pX0a.js.map +1 -0
  508. package/dist/use-panel-transition-DF7f1nmF.js +112 -0
  509. package/dist/use-panel-transition-DF7f1nmF.js.map +1 -0
  510. package/dist/use-panel-transition-r_BlVRob.d.ts +2 -0
  511. package/dist/use-positioner-BD24G6q1.js +73 -0
  512. package/dist/use-positioner-BD24G6q1.js.map +1 -0
  513. package/dist/use-positioner-D98pYl_K.d.ts +12 -0
  514. package/dist/use-presence-BcvBOTDI.d.ts +3 -0
  515. package/dist/use-required-context-CPpEkr4Q.js +11 -0
  516. package/dist/use-required-context-CPpEkr4Q.js.map +1 -0
  517. package/dist/use-roving-composite-CW0mE_VU.js +71 -0
  518. package/dist/use-roving-composite-CW0mE_VU.js.map +1 -0
  519. package/dist/use-roving-item-B9Cil5Rq.js +42 -0
  520. package/dist/use-roving-item-B9Cil5Rq.js.map +1 -0
  521. package/dist/use-segment-group-CAlwM3KP.js +304 -0
  522. package/dist/use-segment-group-CAlwM3KP.js.map +1 -0
  523. package/dist/use-virtual-rows-DesBexmk.js +142 -0
  524. package/dist/use-virtual-rows-DesBexmk.js.map +1 -0
  525. package/dist/virtual-list-BNvYqnFf.js +49 -0
  526. package/dist/virtual-list-BNvYqnFf.js.map +1 -0
  527. package/dist/year-calendar-cYl3WHEM.js +18 -0
  528. package/dist/year-calendar-cYl3WHEM.js.map +1 -0
  529. package/dist/year-calendar.d.ts +5 -0
  530. package/dist/year-calendar.js +3 -0
  531. package/dist/year-picker-DYQZbF1h.js +15 -0
  532. package/dist/year-picker-DYQZbF1h.js.map +1 -0
  533. package/dist/year-picker.d.ts +8 -0
  534. package/dist/year-picker.js +3 -0
  535. package/dist/year-range-calendar-ODgfmdiv.js +18 -0
  536. package/dist/year-range-calendar-ODgfmdiv.js.map +1 -0
  537. package/dist/year-range-calendar.d.ts +5 -0
  538. package/dist/year-range-calendar.js +3 -0
  539. package/dist/year-range-picker-DKXlcy7I.js +15 -0
  540. package/dist/year-range-picker-DKXlcy7I.js.map +1 -0
  541. package/dist/year-range-picker.d.ts +8 -0
  542. package/dist/year-range-picker.js +3 -0
  543. package/package.json +548 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-submenu-trigger-ClI2Pm4X.js","names":[],"sources":["../src/components/menu/menu-context.ts","../src/components/menu/use-checkable-item.ts","../src/components/menu/use-menu-item.ts","../src/components/menu/menu-checkbox-item.ts","../src/components/menu/menu-checkbox-item-indicator.ts","../src/components/menu/menu-group.ts","../src/components/menu/menu-group-label.ts","../src/components/menu/menu-item.ts","../src/components/menu/menu-popup.ts","../src/components/menu/menu-portal.ts","../src/components/menu/menu-positioner.ts","../src/components/menu/menu-radio-group.ts","../src/components/menu/menu-radio-item.ts","../src/components/menu/menu-radio-item-indicator.ts","../src/components/menu/use-menu-root.ts","../src/components/menu/menu-root.ts","../src/components/menu/menu-separator.ts","../src/components/menu/menu-submenu-trigger.ts"],"sourcesContent":["import type { createTypeahead } from \"@fragiola/primitives/collection\";\nimport type {\n Align,\n Side,\n VirtualAnchor,\n} from \"@fragiola/primitives/positioning\";\nimport type { ComputedRef, InjectionKey, Ref, ShallowRef } from \"vue\";\nimport type { OverlayRoot } from \"../../composables/use-overlay-root.ts\";\nimport type { MenuBarContext } from \"./menu-bar-context.ts\";\n\n/** Where the pointer left an open submenu's trigger, for the safe hover area (spec/menu.md). */\nexport interface SafeArea {\n x: number;\n y: number;\n submenu: HTMLElement;\n}\n\n/** The component a menu's parts belong to: their part attribute's prefix (spec/context-menu.md). */\nexport type MenuComponent = \"menu\" | \"context-menu\";\n\nexport interface MenuContext extends OverlayRoot {\n component: MenuComponent;\n /** What the positioner anchors to instead of the trigger (a context menu's point), or `null`. */\n anchor: Readonly<ShallowRef<Element | VirtualAnchor | null>>;\n /** Where focus returns on close, and where Tab moves on from: the trigger, for a Menu. */\n returnTarget: () => HTMLElement | null;\n parent: MenuContext | null;\n loopFocus: () => boolean;\n /** The root menu's `modal` (a submenu follows it; a menu of a bar follows the bar's). */\n modal: () => boolean;\n /** The bar the root menu belongs to (spec/menu.md, \"In a Menubar\"), at every level; or `null`. */\n bar: MenuBarContext | null;\n /**\n * The item to highlight when the popup opens: from the keyboard, the first or the last;\n * `keep` leaves the focus where it is (a bar moving to this menu); `null` focuses the popup.\n */\n pendingHighlight: { current: PendingHighlight };\n typeahead: ReturnType<typeof createTypeahead>;\n labels: Map<Element, string>;\n placed: Ref<{ side: Side; align: Align }>;\n closeAll: (\n reason: \"item-press\" | \"focus-out\" | \"outside-press\",\n event?: Event,\n ) => void;\n openSubmenu: { current: MenuContext | null };\n safeArea: { current: SafeArea | null };\n}\n\n/** What the popup focuses when it opens (spec/menu.md, \"Focus\" and \"In a Menubar\"). */\nexport type PendingHighlight = \"first\" | \"last\" | \"keep\" | null;\n\nexport const MenuKey: InjectionKey<MenuContext> = Symbol(\"Menu\");\n\n/** The state a CheckboxItem or a RadioItem gives its indicator. */\nexport interface MenuCheckableItemState {\n checked: boolean;\n highlighted: boolean;\n disabled: boolean;\n}\n\nexport const MenuCheckboxItemKey: InjectionKey<\n ComputedRef<MenuCheckableItemState>\n> = Symbol(\"MenuCheckboxItem\");\n\nexport const MenuRadioItemKey: InjectionKey<\n ComputedRef<MenuCheckableItemState>\n> = Symbol(\"MenuRadioItem\");\n\n/** What a RadioGroup gives its items. */\nexport interface MenuRadioGroupContext {\n value: ComputedRef<string | null>;\n setValue: (value: string, event: Event) => void;\n disabled: () => boolean;\n}\n\nexport const MenuRadioGroupKey: InjectionKey<MenuRadioGroupContext> =\n Symbol(\"MenuRadioGroup\");\n\n/** The `data-checked` / `data-unchecked` pair of a checkable item and its indicator. */\nexport function checkedAttributes(state: MenuCheckableItemState) {\n return {\n checked: state.checked,\n unchecked: !state.checked,\n highlighted: state.highlighted,\n disabled: state.disabled,\n };\n}\n","import type { MenuContext } from \"./menu-context.ts\";\n\n/**\n * The activation of a CheckboxItem or a RadioItem (spec/menu.md, \"Activating a checkable item\"):\n * Space and Enter fire its `click`; the click changes the state, then Enter closes every level,\n * Space keeps them open, and a pointer click closes them only with `closeOnClick`.\n */\nexport function useCheckableItem(\n context: MenuContext,\n options: {\n disabled: () => boolean;\n closeOnClick: () => boolean;\n change: (event: Event) => void;\n },\n) {\n let key: \"Enter\" | \" \" | null = null;\n return {\n onKeydown: (event: KeyboardEvent) => {\n if (event.key !== \"Enter\" && event.key !== \" \") {\n return;\n }\n // the popup's own activation stays out of it\n event.preventDefault();\n key = event.key;\n (event.currentTarget as HTMLElement).click();\n key = null;\n },\n onClick: (event: MouseEvent) => {\n if (options.disabled()) {\n return;\n }\n options.change(event);\n const pressed = key;\n if (\n pressed === \"Enter\" ||\n (pressed === null && options.closeOnClick())\n ) {\n context.closeAll(\"item-press\", event);\n }\n },\n };\n}\n","import { isInSafeArea } from \"@fragiola/primitives/pointer\";\nimport { onBeforeUnmount, ref, type ShallowRef, watch } from \"vue\";\nimport type { MenuContext } from \"./menu-context.ts\";\n\n/**\n * What every item of a menu level shares: highlight follows focus, the pointer highlights, the\n * typeahead label, and the safe area that protects an open submenu while the pointer travels to it.\n */\nexport function useMenuItem(\n context: MenuContext,\n element: ShallowRef<HTMLElement | null>,\n label: () => string | undefined,\n isSubmenuTrigger: boolean,\n) {\n const highlighted = ref(false);\n watch(\n () => [element.value, label()] as const,\n ([node, text], _, onCleanup) => {\n if (node === null || text === undefined) {\n return;\n }\n context.labels.set(node, text);\n onCleanup(() => context.labels.delete(node));\n },\n { immediate: true },\n );\n onBeforeUnmount(() => {\n if (element.value) {\n context.labels.delete(element.value);\n }\n });\n\n const onPointermove = (event: PointerEvent) => {\n const node = element.value;\n if (node === null) {\n return;\n }\n const submenu = context.openSubmenu.current;\n const area = context.safeArea.current;\n if (!isSubmenuTrigger || submenu?.trigger.value !== node) {\n if (\n submenu &&\n area &&\n isInSafeArea(\n { x: event.clientX, y: event.clientY },\n area,\n area.submenu,\n )\n ) {\n return;\n }\n if (submenu && submenu.trigger.value !== node) {\n submenu.setOpen(false, \"none\");\n }\n }\n if (node.ownerDocument.activeElement !== node) {\n node.focus({ preventScroll: true });\n }\n };\n const onPointerleave = () => {\n const node = element.value;\n const popup = context.popup.value;\n if (\n node &&\n popup &&\n node.ownerDocument.activeElement === node &&\n !isSubmenuTrigger\n ) {\n popup.focus({ preventScroll: true });\n }\n };\n return {\n highlighted,\n handlers: {\n onFocus: () => (highlighted.value = true),\n onBlur: () => (highlighted.value = false),\n onPointermove,\n onPointerleave,\n },\n };\n}\n","import { computed, defineComponent, provide, shallowRef } from \"vue\";\nimport { useControllable } from \"../../composables/use-controllable.ts\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n checkedAttributes,\n type MenuCheckableItemState,\n MenuCheckboxItemKey,\n MenuKey,\n} from \"./menu-context.ts\";\nimport { useCheckableItem } from \"./use-checkable-item.ts\";\nimport { useMenuItem } from \"./use-menu-item.ts\";\n\n/** A `menuitemcheckbox` (`v-model:checked`; spec/menu.md): toggles its checked state. */\nexport type MenuCheckboxItemState = MenuCheckableItemState;\n\nexport interface MenuCheckboxItemProps {\n checked?: boolean;\n defaultChecked?: boolean;\n disabled?: boolean;\n /** The text typeahead matches (default: the item's text). */\n label?: string;\n /** A click closes every menu level (default `false`; Enter always closes, Space never). */\n closeOnClick?: boolean;\n}\n\nexport type MenuCheckboxItemEmits = {\n \"update:checked\": (checked: boolean) => true;\n checkedChange: (checked: boolean, details: ChangeDetails) => true;\n};\n\nexport const MenuCheckboxItem: PartComponent<\n MenuCheckboxItemProps,\n MenuCheckboxItemState,\n MenuCheckboxItemEmits\n> = publicComponent(\n defineComponent({\n name: \"MenuCheckboxItem\",\n inheritAttrs: false,\n props: {\n ...asProp,\n checked: { type: Boolean, default: undefined },\n defaultChecked: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n /** The text typeahead matches (default: the item's text). */\n label: { type: String, default: undefined },\n /** A click closes every menu level (default `false`). */\n closeOnClick: { type: Boolean, default: false },\n },\n emits: {\n \"update:checked\": (_checked: boolean) => true,\n checkedChange: (_checked: boolean, _details: ChangeDetails) => true,\n },\n setup(props, { attrs, slots, emit }) {\n const context = useRequiredContext(MenuKey, \"Menu.CheckboxItem\");\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n const item = useMenuItem(\n context,\n element,\n () => props.label,\n false,\n );\n const checked = useControllable<boolean, ChangeDetails>(\n () => props.checked,\n props.defaultChecked,\n (next, details) => {\n emit(\"update:checked\", next);\n emit(\"checkedChange\", next, details);\n },\n );\n const activation = useCheckableItem(context, {\n disabled: () => props.disabled,\n closeOnClick: () => props.closeOnClick,\n change: (event) =>\n checked.set(!checked.value.value, {\n reason: \"item-press\",\n event,\n }),\n });\n const state = computed(() => ({\n checked: checked.value.value,\n highlighted: item.highlighted.value,\n disabled: props.disabled,\n }));\n provide(MenuCheckboxItemKey, state);\n return () => {\n const { onClick, ...rest } = attrs;\n const consumer = props.disabled ? rest : attrs;\n void onClick;\n return renderPart(\n \"div\",\n { attrs: consumer, slots },\n props.as,\n state.value,\n {\n role: \"menuitemcheckbox\",\n tabindex: -1,\n \"aria-checked\": state.value.checked ? \"true\" : \"false\",\n \"aria-disabled\": props.disabled ? \"true\" : undefined,\n \"data-primitives-part\": `${context.component}-checkbox-item`,\n ...stateAttributes(checkedAttributes(state.value)),\n ...item.handlers,\n ...activation,\n ref: setElement,\n },\n );\n };\n },\n }),\n);\n","import { defineComponent, inject } 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 { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n checkedAttributes,\n type MenuCheckableItemState,\n MenuCheckboxItemKey,\n MenuKey,\n} from \"./menu-context.ts\";\n\n/** Marks a checked CheckboxItem; hidden from assistive technologies (spec/menu.md). */\nexport interface MenuCheckboxItemIndicatorProps {\n /** Rendered while the item is unchecked too (default `false`). */\n keepMounted?: boolean;\n}\n\nexport const MenuCheckboxItemIndicator: PartComponent<\n MenuCheckboxItemIndicatorProps,\n MenuCheckableItemState\n> = publicComponent(\n defineComponent({\n name: \"MenuCheckboxItemIndicator\",\n inheritAttrs: false,\n props: { ...asProp, keepMounted: { type: Boolean, default: false } },\n setup(props, { attrs, slots }) {\n const state = useRequiredContext(\n MenuCheckboxItemKey,\n \"Menu.CheckboxItemIndicator\",\n );\n const component = inject(MenuKey, null)?.component ?? \"menu\";\n return () => {\n if (!state.value.checked && !props.keepMounted) {\n return null;\n }\n const { highlighted: _highlighted, ...attributes } =\n checkedAttributes(state.value);\n return renderPart(\n \"span\",\n { attrs, slots },\n props.as,\n state.value,\n {\n \"aria-hidden\": \"true\",\n \"data-primitives-part\": `${component}-checkbox-item-indicator`,\n ...stateAttributes(attributes),\n },\n );\n };\n },\n }),\n);\n","import {\n defineComponent,\n type InjectionKey,\n inject,\n provide,\n type Ref,\n ref,\n} from \"vue\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { MenuKey } from \"./menu-context.ts\";\n\nexport const MenuGroupKey: InjectionKey<Ref<string | undefined>> =\n Symbol(\"MenuGroup\");\n\n/** Groups items under its GroupLabel. */\nexport const MenuGroup: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"MenuGroup\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const component = inject(MenuKey, null)?.component ?? \"menu\";\n const labelId = ref<string>();\n provide(MenuGroupKey, labelId);\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n role: \"group\",\n \"aria-labelledby\": labelId.value,\n \"data-primitives-part\": `${component}-group`,\n },\n );\n },\n }),\n);\n","import {\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n useId,\n} from \"vue\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { MenuKey } from \"./menu-context.ts\";\nimport { MenuGroupKey } from \"./menu-group.ts\";\n\n/** Names its Group. */\nexport const MenuGroupLabel: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"MenuGroupLabel\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const labelId = inject(MenuGroupKey, null);\n const component = inject(MenuKey, null)?.component ?? \"menu\";\n const generated = useId();\n const id = () => (attrs.id as string | undefined) ?? generated;\n onMounted(() => {\n if (labelId) {\n labelId.value = id();\n }\n });\n onBeforeUnmount(() => {\n if (labelId) {\n labelId.value = undefined;\n }\n });\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n id: id(),\n \"data-primitives-part\": `${component}-group-label`,\n },\n );\n },\n }),\n);\n","import { defineComponent, shallowRef } 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 { MenuKey } from \"./menu-context.ts\";\nimport { useMenuItem } from \"./use-menu-item.ts\";\n\n/**\n * An action. Enter, Space and clicks fire its `click` (`@click`), then close every level\n * (spec/menu.md). A disabled item stays focusable but is never activated.\n */\nexport interface MenuItemState {\n highlighted: boolean;\n disabled: boolean;\n}\n\nexport interface MenuItemProps {\n disabled?: boolean;\n /** The text typeahead matches (default: the item's text). */\n label?: string;\n /** Activating the item closes every menu level (default `true`). */\n closeOnClick?: boolean;\n}\n\nexport const MenuItem: PartComponent<MenuItemProps, MenuItemState> =\n publicComponent(\n defineComponent({\n name: \"MenuItem\",\n inheritAttrs: false,\n props: {\n ...asProp,\n disabled: { type: Boolean, default: false },\n /** The text typeahead matches (default: the item's text). */\n label: { type: String, default: undefined },\n /** Activating the item closes every menu level (default `true`). */\n closeOnClick: { type: Boolean, default: true },\n },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(MenuKey, \"Menu.Item\");\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n const item = useMenuItem(\n context,\n element,\n () => props.label,\n false,\n );\n return () => {\n const highlighted = item.highlighted.value;\n const { onClick, ...rest } = attrs;\n const consumer = props.disabled ? rest : attrs;\n void onClick;\n return renderPart(\n \"div\",\n { attrs: consumer, slots },\n props.as,\n { highlighted, disabled: props.disabled },\n {\n role: \"menuitem\",\n tabindex: -1,\n \"aria-disabled\": props.disabled\n ? \"true\"\n : undefined,\n \"data-primitives-part\": `${context.component}-item`,\n ...stateAttributes({\n highlighted,\n disabled: props.disabled,\n }),\n ...item.handlers,\n onClick: (event: MouseEvent) => {\n if (!props.disabled && props.closeOnClick) {\n context.closeAll(\"item-press\", event);\n }\n },\n ref: setElement,\n },\n );\n };\n },\n }),\n );\n","import { menuKeyTarget, submenuKeys } from \"@fragiola/primitives/collection\";\nimport { getDirection } from \"@fragiola/primitives/direction\";\nimport {\n nextTabbableAfter,\n previousTabbableBefore,\n} from \"@fragiola/primitives/focus\";\nimport { blockOutsidePointer } from \"@fragiola/primitives/inert\";\nimport { openOverlaySession } from \"@fragiola/primitives/overlay\";\nimport type { Align, Side } from \"@fragiola/primitives/positioning\";\nimport { lockScroll } from \"@fragiola/primitives/scroll-lock\";\nimport { defineComponent, ref, 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 { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { type MenuContext, MenuKey } from \"./menu-context.ts\";\nimport { menuItems } from \"./menu-items.ts\";\n\nconst ROOT_RETURNS_FOCUS = new Set([\n \"escape-key\",\n \"item-press\",\n \"trigger-press\",\n]);\nconst SUBMENU_RETURNS_FOCUS = new Set([\"escape-key\", \"list-navigation\"]);\n// a modal menu's outside press reaches nothing, so focus goes back to the trigger\nconst MODAL_RETURNS_FOCUS_UNFOCUSED = new Set([\"outside-press\", \"none\"]);\n// a root menu closed through the controlled `open` (reason `none`) returns focus left inside it,\n// as Popover does; so does a handle's or the actions' close (`imperative-action`)\nconst RETURNS_FOCUS_UNFOCUSED = new Set([\"none\", \"imperative-action\"]);\n\nfunction rootOf(context: MenuContext): MenuContext {\n return context.parent ? rootOf(context.parent) : context;\n}\n\nfunction positioners(context: MenuContext): (HTMLElement | null)[] {\n const own = [context.positioner.value];\n return context.parent ? [...positioners(context.parent), ...own] : own;\n}\n\n/** One menu level: roving focus, typeahead, Escape per level (spec/menu.md). */\nexport interface MenuPopupState {\n open: boolean;\n side: Side;\n align: Align;\n}\n\nexport const MenuPopup: PartComponent<\n Record<never, never>,\n MenuPopupState\n> = publicComponent(\n defineComponent({\n name: \"MenuPopup\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const direction = useProvidedDirection();\n const context = useRequiredContext(MenuKey, \"Menu.Popup\");\n const nested = context.parent !== null;\n const setPopup = elementSetter(context.popup);\n // whether the layer is open: the opening focus waits for it, or a parent dialog's\n // focus trap (which accepts its child layers only) takes the focus back\n const layered = ref(false);\n\n watch(\n () =>\n [\n context.open.value,\n context.popup.value,\n context.positioner.value,\n ] as const,\n ([open, popup, positioner], _, onCleanup) => {\n if (!open || popup === null) {\n return;\n }\n const doc = popup.ownerDocument;\n // a context menu's area is no trigger that toggles it: a press on it is\n // outside the menu, but it is still what the menu was opened from\n // (spec/context-menu.md)\n const area =\n !nested && context.component === \"context-menu\";\n // Escape, an item and the trigger give focus back to this level's trigger; the\n // closing arrow of a submenu gives it back to its submenu trigger\n const session = openOverlaySession(doc, {\n elements: () => [positioner ?? popup],\n // read when the session needs them: the active trigger may move while\n // it is open\n ignore: () => (area ? [] : context.triggers.value),\n owner: () => context.triggers.value,\n dismiss: (reason, event) =>\n context.setOpen(false, reason, event),\n returnFocus: {\n when: nested\n ? SUBMENU_RETURNS_FOCUS\n : ROOT_RETURNS_FOCUS,\n whenUnfocused: () =>\n !nested && context.modal()\n ? MODAL_RETURNS_FOCUS_UNFOCUSED\n : RETURNS_FOCUS_UNFOCUSED,\n reason: () =>\n context.lastReason.current ??\n (nested ? null : \"none\"),\n to: () =>\n nested\n ? context.trigger.value\n : context.returnTarget(),\n },\n });\n layered.value = true;\n onCleanup(() => {\n session.end();\n layered.value = false;\n });\n },\n { flush: \"post\", immediate: true },\n );\n\n // on open, and when it moves to another trigger: the keyboard's item, else the popup\n // with no highlight (spec/menu.md, \"Focus\")\n watch(\n () =>\n [\n context.open.value,\n context.popup.value,\n context.trigger.value,\n layered.value,\n ] as const,\n ([open, popup, , isLayered]) => {\n if (!open || popup === null || !isLayered) {\n return;\n }\n const items = menuItems(popup);\n const highlight = context.pendingHighlight.current;\n context.pendingHighlight.current = null;\n // a bar moving to this menu keeps the focus on its item (spec/menu.md, \"In a\n // Menubar\")\n if (highlight === \"keep\") {\n return;\n }\n const target =\n highlight === \"first\"\n ? items[0]\n : highlight === \"last\"\n ? items.at(-1)\n : undefined;\n (target ?? popup).focus({ preventScroll: true });\n },\n { flush: \"post\", immediate: true },\n );\n\n // spec/menu.md, \"Modal\": the root level locks the scroll and blocks the outside pointer\n // while open; on its own, so toggling `modal` while open keeps the session as it is\n watch(\n () =>\n [\n context.open.value,\n context.popup.value,\n !nested && context.modal(),\n ] as const,\n ([open, popup, modal], _, onCleanup) => {\n if (!open || popup === null || !modal) {\n return;\n }\n const doc = popup.ownerDocument;\n const unlock = lockScroll(doc);\n const unblock = blockOutsidePointer(doc);\n onCleanup(() => {\n unblock();\n unlock();\n });\n },\n { flush: \"post\", immediate: true },\n );\n\n const onKeydown = (event: KeyboardEvent) => {\n const popup = context.popup.value;\n if (popup === null || event.defaultPrevented) {\n return;\n }\n const items = menuItems(popup);\n const active = popup.ownerDocument\n .activeElement as HTMLElement | null;\n const current = active ? items.indexOf(active) : -1;\n const focusAt = (index: number) =>\n items[index]?.focus({ preventScroll: true });\n const { close: closeKey } = submenuKeys(\n getDirection(popup, direction()) === \"rtl\",\n );\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n case \"Home\":\n case \"End\": {\n event.preventDefault();\n const target = menuKeyTarget(\n event.key,\n current,\n items.length,\n { loop: context.loopFocus() },\n );\n if (target !== null) {\n focusAt(target);\n }\n return;\n }\n case \"Enter\":\n case \" \":\n if (active && current !== -1) {\n event.preventDefault();\n active.click();\n }\n return;\n case \"Tab\": {\n event.preventDefault();\n const root = rootOf(context);\n const skip = positioners(context);\n // after the trigger (a context menu: the element focused when it opened)\n const from = root.returnTarget() ?? root.trigger.value;\n const target = from\n ? event.shiftKey\n ? previousTabbableBefore(from, skip)\n : nextTabbableAfter(from, skip)\n : null;\n context.closeAll(\"focus-out\", event);\n target?.focus();\n return;\n }\n default:\n if (nested && event.key === closeKey) {\n event.preventDefault();\n context.setOpen(false, \"list-navigation\", event);\n return;\n }\n // the keys a level leaves go to its bar first (spec/menu.md, \"In a\n // Menubar\"): a Teleport does not bubble them to the bar's element\n if (context.bar?.menuKeyDown(event, context)) {\n event.preventDefault();\n return;\n }\n if (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n ) {\n const labels = items.map(\n (item) =>\n context.labels.get(item) ??\n item.textContent ??\n \"\",\n );\n const index = context.typeahead.match(\n event.key,\n labels,\n current,\n );\n if (index !== -1) {\n event.preventDefault();\n focusAt(index);\n }\n }\n }\n };\n\n return () => {\n const open = context.open.value;\n const status = context.presence.status.value;\n const placed = context.placed.value;\n const contextMenu = context.component === \"context-menu\";\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { open, ...placed },\n {\n id: context.popupId,\n role: \"menu\",\n // the active trigger names the menu (a submenu's: its SubmenuTrigger); no\n // button names a context menu (spec/context-menu.md)\n \"aria-labelledby\":\n contextMenu && !nested\n ? undefined\n : (context.activeTriggerId.value ??\n context.triggerId),\n \"aria-orientation\": \"vertical\",\n tabindex: -1,\n \"data-primitives-part\": `${context.component}-popup`,\n ...stateAttributes({\n open,\n closed: !open,\n side: placed.side,\n align: placed.align,\n nested,\n \"starting-style\": status === \"starting\",\n \"ending-style\": status === \"ending\",\n }),\n onKeydown,\n // no browser menu over a context menu (spec/context-menu.md, \"Pointer\")\n onContextmenu: contextMenu\n ? (event: MouseEvent) => event.preventDefault()\n : undefined,\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 { MenuKey } from \"./menu-context.ts\";\n\nexport interface MenuPortalProps extends OverlayPortalProps {}\n\n/** Moves the content to `container` (default: the body) while mounted, or always with `keep-mounted`. */\nexport const MenuPortal: PublicComponent<MenuPortalProps, ContentSlots> =\n publicComponent(\n defineComponent({\n name: \"MenuPortal\",\n props: overlayPortalProps,\n setup(props, { slots }) {\n const context = useRequiredContext(MenuKey, \"Menu.Portal\");\n return useOverlayPortal(context.presence.mounted, props, slots);\n },\n }),\n );\n","import type { Align, Side } from \"@fragiola/primitives/positioning\";\nimport { computed, defineComponent, watch } from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport {\n type PositionerProps,\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 { MenuKey } from \"./menu-context.ts\";\n\n/** Places a menu level: below its trigger, or at the end side of its submenu trigger. */\nexport interface MenuPositionerState {\n open: boolean;\n side: Side;\n align: Align;\n}\n\nexport const MenuPositioner: PartComponent<\n PositionerProps,\n MenuPositionerState\n> = publicComponent(\n defineComponent({\n name: \"MenuPositioner\",\n inheritAttrs: false,\n props: { ...asProp, ...positionerProps },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(MenuKey, \"Menu.Positioner\");\n const nested = context.parent !== null;\n const setPositioner = elementSetter(context.positioner);\n const placed = usePositioner(\n props,\n // a vertical bar's menus open at its end side, as submenus (spec/menubar.md)\n nested || context.bar?.orientation() === \"vertical\"\n ? { side: \"inline-end\", align: \"start\" }\n : { side: \"bottom\", align: \"start\" },\n // a context menu's point, else the trigger\n computed(() => context.anchor.value ?? context.trigger.value),\n context.positioner,\n null,\n context.presence.mounted,\n );\n watch(placed, (value) => (context.placed.value = value), {\n 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 // a modal menu blocks the pointer outside; its levels take it back\n style: context.modal()\n ? { pointerEvents: \"auto\" }\n : undefined,\n \"data-primitives-part\": `${context.component}-positioner`,\n ...stateAttributes({\n open,\n closed: !open,\n side: placed.value.side,\n align: placed.value.align,\n nested,\n }),\n ref: setPositioner,\n },\n );\n };\n },\n }),\n);\n","import { defineComponent, inject, type PropType, provide } from \"vue\";\nimport { useControllable } from \"../../composables/use-controllable.ts\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { MenuKey, MenuRadioGroupKey } from \"./menu-context.ts\";\n\n/** A `group` of RadioItems holding their value (`v-model:value`; spec/menu.md). */\nexport interface MenuRadioGroupProps {\n /** The checked RadioItem's value; `null` for none. */\n value?: string | null;\n defaultValue?: string | null;\n /** Disables every RadioItem of the group. */\n disabled?: boolean;\n}\n\nexport type MenuRadioGroupEmits = {\n \"update:value\": (value: string | null) => true;\n valueChange: (value: string | null, details: ChangeDetails) => true;\n};\n\nexport const MenuRadioGroup: PartComponent<\n MenuRadioGroupProps,\n { disabled: boolean },\n MenuRadioGroupEmits\n> = publicComponent(\n defineComponent({\n name: \"MenuRadioGroup\",\n inheritAttrs: false,\n props: {\n ...asProp,\n value: {\n type: [String, null] as PropType<string | null>,\n default: undefined,\n },\n defaultValue: {\n type: [String, null] as PropType<string | null>,\n default: null,\n },\n /** Disables every RadioItem of the group. */\n disabled: { type: Boolean, default: false },\n },\n emits: {\n \"update:value\": (_value: string | null) => true,\n valueChange: (_value: string | null, _details: ChangeDetails) =>\n true,\n },\n setup(props, { attrs, slots, emit }) {\n const component = inject(MenuKey, null)?.component ?? \"menu\";\n const state = useControllable<string | null, ChangeDetails>(\n () => props.value,\n props.defaultValue,\n (next, details) => {\n emit(\"update:value\", next);\n emit(\"valueChange\", next, details);\n },\n );\n provide(MenuRadioGroupKey, {\n value: state.value,\n disabled: () => props.disabled,\n setValue: (next, event) =>\n state.set(next, { reason: \"item-press\", event }),\n });\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { disabled: props.disabled },\n {\n role: \"group\",\n \"data-primitives-part\": `${component}-radio-group`,\n ...stateAttributes({ disabled: props.disabled }),\n },\n );\n },\n }),\n);\n","import { computed, defineComponent, provide, shallowRef } 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 checkedAttributes,\n type MenuCheckableItemState,\n MenuKey,\n MenuRadioGroupKey,\n MenuRadioItemKey,\n} from \"./menu-context.ts\";\nimport { useCheckableItem } from \"./use-checkable-item.ts\";\nimport { useMenuItem } from \"./use-menu-item.ts\";\n\n/** A `menuitemradio` of its RadioGroup (spec/menu.md): checks its value. */\nexport type MenuRadioItemState = MenuCheckableItemState;\n\nexport interface MenuRadioItemProps {\n value: string;\n disabled?: boolean;\n /** The text typeahead matches (default: the item's text). */\n label?: string;\n /** A click closes every menu level (default `false`; Enter always closes, Space never). */\n closeOnClick?: boolean;\n}\n\nexport const MenuRadioItem: PartComponent<\n MenuRadioItemProps,\n MenuRadioItemState\n> = publicComponent(\n defineComponent({\n name: \"MenuRadioItem\",\n inheritAttrs: false,\n props: {\n ...asProp,\n value: { type: String, required: true },\n disabled: { type: Boolean, default: false },\n /** The text typeahead matches (default: the item's text). */\n label: { type: String, default: undefined },\n /** A click closes every menu level (default `false`). */\n closeOnClick: { type: Boolean, default: false },\n },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(MenuKey, \"Menu.RadioItem\");\n const group = useRequiredContext(\n MenuRadioGroupKey,\n \"Menu.RadioItem\",\n );\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n const item = useMenuItem(\n context,\n element,\n () => props.label,\n false,\n );\n const disabled = () => props.disabled || group.disabled();\n const activation = useCheckableItem(context, {\n disabled,\n closeOnClick: () => props.closeOnClick,\n change: (event) => group.setValue(props.value, event),\n });\n const state = computed(() => ({\n checked: group.value.value === props.value,\n highlighted: item.highlighted.value,\n disabled: disabled(),\n }));\n provide(MenuRadioItemKey, state);\n return () => {\n const { onClick, ...rest } = attrs;\n const consumer = state.value.disabled ? rest : attrs;\n void onClick;\n return renderPart(\n \"div\",\n { attrs: consumer, slots },\n props.as,\n state.value,\n {\n role: \"menuitemradio\",\n tabindex: -1,\n \"aria-checked\": state.value.checked ? \"true\" : \"false\",\n \"aria-disabled\": state.value.disabled\n ? \"true\"\n : undefined,\n \"data-primitives-part\": `${context.component}-radio-item`,\n ...stateAttributes(checkedAttributes(state.value)),\n ...item.handlers,\n ...activation,\n ref: setElement,\n },\n );\n };\n },\n }),\n);\n","import { defineComponent, inject } 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 { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n checkedAttributes,\n type MenuCheckableItemState,\n MenuKey,\n MenuRadioItemKey,\n} from \"./menu-context.ts\";\n\n/** Marks a checked RadioItem; hidden from assistive technologies (spec/menu.md). */\nexport interface MenuRadioItemIndicatorProps {\n /** Rendered while the item is unchecked too (default `false`). */\n keepMounted?: boolean;\n}\n\nexport const MenuRadioItemIndicator: PartComponent<\n MenuRadioItemIndicatorProps,\n MenuCheckableItemState\n> = publicComponent(\n defineComponent({\n name: \"MenuRadioItemIndicator\",\n inheritAttrs: false,\n props: { ...asProp, keepMounted: { type: Boolean, default: false } },\n setup(props, { attrs, slots }) {\n const state = useRequiredContext(\n MenuRadioItemKey,\n \"Menu.RadioItemIndicator\",\n );\n const component = inject(MenuKey, null)?.component ?? \"menu\";\n return () => {\n if (!state.value.checked && !props.keepMounted) {\n return null;\n }\n const { highlighted: _highlighted, ...attributes } =\n checkedAttributes(state.value);\n return renderPart(\n \"span\",\n { attrs, slots },\n props.as,\n state.value,\n {\n \"aria-hidden\": \"true\",\n \"data-primitives-part\": `${component}-radio-item-indicator`,\n ...stateAttributes(attributes),\n },\n );\n };\n },\n }),\n);\n","import { createTypeahead } from \"@fragiola/primitives/collection\";\nimport type {\n Align,\n Side,\n VirtualAnchor,\n} from \"@fragiola/primitives/positioning\";\nimport { inject, provide, ref, type ShallowRef, shallowRef, watch } from \"vue\";\nimport {\n type OverlayRootProps,\n type OverlayTriggerRootProps,\n useOverlayRoot,\n} from \"../../composables/use-overlay-root.ts\";\nimport { MenuBarKey } from \"./menu-bar-context.ts\";\nimport {\n type MenuComponent,\n type MenuContext,\n MenuKey,\n} from \"./menu-context.ts\";\n\n/** What a root menu level gets from the component it belongs to (a Menu or a ContextMenu). */\nexport interface MenuRootOptions {\n /** The part attributes' prefix (default: the parent level's, else `menu`). */\n component?: MenuComponent;\n /** What the positioner anchors to instead of the trigger (a context menu's point). */\n anchor?: Readonly<ShallowRef<Element | VirtualAnchor | null>>;\n /** Where focus returns, and where Tab moves on from (default: the trigger). */\n returnTarget?: () => HTMLElement | null;\n}\n\n/** The state of one menu level, a root or a submenu (spec/menu.md); provides it to its parts. */\nexport function useMenuRoot(\n props: OverlayRootProps &\n OverlayTriggerRootProps & {\n loopFocus: boolean;\n modal?: boolean;\n },\n emit: Parameters<typeof useOverlayRoot>[1],\n nested: boolean,\n options: MenuRootOptions = {},\n): MenuContext {\n const parent = nested ? inject(MenuKey, null) : null;\n const enclosingBar = inject(MenuBarKey, null);\n const root = useOverlayRoot(props, emit);\n const returnTarget = options.returnTarget;\n const component = options.component ?? parent?.component ?? \"menu\";\n // a root Menu inside a bar is one of its menus (spec/menu.md, \"In a Menubar\"); its levels\n // share the bar\n const bar = parent\n ? parent.bar\n : component === \"menu\"\n ? enclosingBar\n : null;\n const context: MenuContext = {\n ...root,\n component,\n anchor: options.anchor ?? shallowRef(null),\n returnTarget: returnTarget ?? (() => root.trigger.value),\n parent,\n loopFocus: () => props.loopFocus,\n // a submenu follows its root menu, a menu of a bar the bar\n modal: () =>\n parent\n ? parent.modal()\n : bar\n ? bar.modal()\n : (props.modal ?? false),\n bar,\n pendingHighlight: { current: null },\n typeahead: createTypeahead(),\n labels: new Map(),\n placed: ref<{ side: Side; align: Align }>(\n nested || bar?.orientation() === \"vertical\"\n ? { side: \"inline-end\", align: \"start\" }\n : { side: \"bottom\", align: \"start\" },\n ),\n closeAll(reason, event) {\n root.setOpen(false, reason, event);\n parent?.closeAll(reason, event);\n },\n openSubmenu: { current: null },\n safeArea: { current: null },\n };\n // a parent level knows its open submenu, so a hovered sibling can close it\n if (parent) {\n watch(\n root.open,\n (open) => {\n if (open) {\n parent.openSubmenu.current = context;\n } else if (parent.openSubmenu.current === context) {\n parent.openSubmenu.current = null;\n }\n },\n { immediate: true },\n );\n }\n provide(MenuKey, context);\n // a Menu opened from inside this one's content is no menu of the bar (spec/menu.md)\n provide(MenuBarKey, null);\n return context;\n}\n","import { defineComponent, type PropType } from \"vue\";\nimport {\n type OverlayRootEmits,\n type OverlayRootProps,\n type OverlayTriggerRootProps,\n overlayRootEmits,\n overlayRootProps,\n overlayTriggerRootProps,\n} from \"../../composables/use-overlay-root.ts\";\nimport { useAttachHandle } from \"../../composables/use-overlay-trigger.ts\";\nimport {\n type ContentSlots,\n type OverlayRootSlots,\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport type { MenuHandle } from \"./menu-handle.ts\";\nimport { useMenuRoot } from \"./use-menu-root.ts\";\n\n/**\n * A nested menu level's props (`v-model:open`). A template ref on a level's Root exposes its\n * actions, `close()` and `unmount()`.\n */\nexport interface MenuSubmenuRootProps extends OverlayRootProps {\n /** Arrow keys wrap at the ends (default `true`). */\n loopFocus?: boolean;\n}\n\nexport interface MenuRootProps\n extends MenuSubmenuRootProps,\n OverlayTriggerRootProps {\n /**\n * Locks the page's scroll and blocks the pointer outside the menu while it is open (default\n * `false`: the APG menu button is non-modal; spec/menu.md, \"Modal\").\n */\n modal?: boolean;\n /** Connects Triggers rendered outside the Root (spec/menu.md, \"Detached triggers\"). */\n handle?: MenuHandle;\n}\n\nexport type MenuRootEmits = OverlayRootEmits;\n\nexport const submenuProps = {\n ...overlayRootProps,\n /** Arrow keys wrap at the ends (default `true`). */\n loopFocus: { type: Boolean, default: true },\n};\n\nexport const menuProps = {\n ...submenuProps,\n ...overlayTriggerRootProps,\n handle: { type: Object as PropType<MenuHandle>, default: undefined },\n /** Locks the scroll and blocks the outside pointer while open (default `false`). */\n modal: { type: Boolean, default: false },\n};\n\n/** Holds the state of one menu level (`v-model:open`); renders no element (spec/menu.md). */\nexport const MenuRoot: PublicComponent<\n MenuRootProps,\n OverlayRootSlots,\n MenuRootEmits\n> = publicComponent(\n defineComponent({\n name: \"MenuRoot\",\n props: menuProps,\n emits: overlayRootEmits,\n setup(props, { emit, slots, expose }) {\n const context = useMenuRoot(props, emit, false);\n useAttachHandle(() => props.handle, context);\n expose(context.actions);\n return () => slots.default?.({ payload: context.payload.value });\n },\n }),\n);\n\n/** A nested menu level; its trigger is a `SubmenuTrigger` item of the parent menu. */\nexport const MenuSubmenuRoot: PublicComponent<\n MenuSubmenuRootProps,\n ContentSlots,\n MenuRootEmits\n> = publicComponent(\n defineComponent({\n name: \"MenuSubmenuRoot\",\n props: submenuProps,\n emits: overlayRootEmits,\n setup(props, { emit, slots, expose }) {\n const context = useMenuRoot(props, emit, true);\n expose(context.actions);\n return () => slots.default?.();\n },\n }),\n);\n","import { defineComponent, inject } from \"vue\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { MenuKey } from \"./menu-context.ts\";\n\nexport const MenuSeparator: PartComponent<\n Record<never, never>,\n Record<never, never>\n> = publicComponent(\n defineComponent({\n name: \"MenuSeparator\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const component = inject(MenuKey, null)?.component ?? \"menu\";\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n {},\n {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n \"data-primitives-part\": `${component}-separator`,\n },\n );\n },\n }),\n);\n","import { submenuKeys } from \"@fragiola/primitives/collection\";\nimport { getDirection } from \"@fragiola/primitives/direction\";\nimport { defineComponent, onBeforeUnmount, shallowRef } from \"vue\";\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 { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { MenuKey } from \"./menu-context.ts\";\nimport { useMenuItem } from \"./use-menu-item.ts\";\n\n/** An item of the parent menu that opens its submenu (spec/menu.md). */\nexport interface MenuSubmenuTriggerState {\n open: boolean;\n highlighted: boolean;\n disabled: boolean;\n}\n\nexport interface MenuSubmenuTriggerProps {\n disabled?: boolean;\n label?: string;\n /** Hovering opens the submenu (default `true`), after `delay` ms (default 100). */\n openOnHover?: boolean;\n delay?: number;\n}\n\nexport const MenuSubmenuTrigger: PartComponent<\n MenuSubmenuTriggerProps,\n MenuSubmenuTriggerState\n> = publicComponent(\n defineComponent({\n name: \"MenuSubmenuTrigger\",\n inheritAttrs: false,\n props: {\n ...asProp,\n disabled: { type: Boolean, default: false },\n label: { type: String, default: undefined },\n /** Hovering opens the submenu (default `true`), after `delay` ms (default 100). */\n openOnHover: { type: Boolean, default: true },\n delay: { type: Number, default: 100 },\n },\n setup(props, { attrs, slots }) {\n const direction = useProvidedDirection();\n const submenu = useRequiredContext(MenuKey, \"Menu.SubmenuTrigger\");\n const parent = submenu.parent;\n if (parent === null) {\n throw new Error(\n \"<Menu.SubmenuTrigger> must be inside <Menu.SubmenuRoot>.\",\n );\n }\n const element = shallowRef<HTMLElement | null>(null);\n const item = useMenuItem(parent, element, () => props.label, true);\n let timer: ReturnType<typeof setTimeout> | undefined;\n onBeforeUnmount(() => clearTimeout(timer));\n const setElement = (value: unknown) => {\n const node = value instanceof HTMLElement ? value : null;\n element.value = node;\n submenu.trigger.value = node;\n };\n const open = (\n highlight: \"first\" | null,\n reason: \"trigger-press\" | \"list-navigation\",\n event?: Event,\n ) => {\n if (props.disabled) {\n return;\n }\n submenu.pendingHighlight.current = highlight;\n submenu.setOpen(true, reason, event);\n };\n return () => {\n const isOpen = submenu.open.value;\n const highlighted = item.highlighted.value;\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { open: isOpen, highlighted, disabled: props.disabled },\n {\n id: submenu.triggerId,\n role: \"menuitem\",\n tabindex: -1,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": isOpen ? \"true\" : \"false\",\n \"aria-controls\": isOpen ? submenu.popupId : undefined,\n \"aria-disabled\": props.disabled ? \"true\" : undefined,\n \"data-primitives-part\": `${parent.component}-submenu-trigger`,\n ...stateAttributes({\n \"popup-open\": isOpen,\n highlighted,\n disabled: props.disabled,\n }),\n onFocus: item.handlers.onFocus,\n onBlur: item.handlers.onBlur,\n onClick: (event: MouseEvent) =>\n open(null, \"trigger-press\", event),\n onKeydown: (event: KeyboardEvent) => {\n const node = element.value;\n const { open: openKey } = submenuKeys(\n node !== null &&\n getDirection(node, direction()) === \"rtl\",\n );\n if (\n event.key === openKey ||\n event.key === \"Enter\" ||\n event.key === \" \"\n ) {\n event.preventDefault();\n event.stopPropagation();\n open(\n \"first\",\n event.key === openKey\n ? \"list-navigation\"\n : \"trigger-press\",\n event,\n );\n }\n },\n onPointermove: (event: PointerEvent) => {\n item.handlers.onPointermove(event);\n if (\n props.openOnHover &&\n !submenu.open.value &&\n timer === undefined\n ) {\n timer = setTimeout(() => {\n timer = undefined;\n open(null, \"trigger-press\");\n }, props.delay);\n }\n },\n onPointerleave: (event: PointerEvent) => {\n clearTimeout(timer);\n timer = undefined;\n const popup = submenu.popup.value;\n if (submenu.open.value && popup) {\n parent.safeArea.current = {\n x: event.clientX,\n y: event.clientY,\n submenu: popup,\n };\n }\n },\n ref: setElement,\n },\n );\n };\n },\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,UAAqC,OAAO,MAAM;AAS/D,MAAa,sBAET,OAAO,kBAAkB;AAE7B,MAAa,mBAET,OAAO,eAAe;AAS1B,MAAa,oBACT,OAAO,gBAAgB;;AAG3B,SAAgB,kBAAkB,OAA+B;CAC7D,OAAO;EACH,SAAS,MAAM;EACf,WAAW,CAAC,MAAM;EAClB,aAAa,MAAM;EACnB,UAAU,MAAM;CACpB;AACJ;;;;;;;AC/EA,SAAgB,iBACZ,SACA,SAKF;CACE,IAAI,MAA4B;CAChC,OAAO;EACH,YAAY,UAAyB;GACjC,IAAI,MAAM,QAAQ,WAAW,MAAM,QAAQ,KACvC;GAGJ,MAAM,eAAe;GACrB,MAAM,MAAM;GACX,MAAM,cAA8B,MAAM;GAC3C,MAAM;EACV;EACA,UAAU,UAAsB;GAC5B,IAAI,QAAQ,SAAS,GACjB;GAEJ,QAAQ,OAAO,KAAK;GACpB,MAAM,UAAU;GAChB,IACI,YAAY,WACX,YAAY,QAAQ,QAAQ,aAAa,GAE1C,QAAQ,SAAS,cAAc,KAAK;EAE5C;CACJ;AACJ;;;;;;ACjCA,SAAgB,YACZ,SACA,SACA,OACA,kBACF;CACE,MAAM,cAAc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;KACrC,aAAa,KAAK;KAClB,QAAQ,KAAA;KACR,MAAM,QAAQ,QAAQ,MAAM;KAC5B,IAAI,QAAQ,KAAK,SAAS,OACtB,OAAO,SAAS,UAAU;MACtB,GAAG,MAAM;MACT,GAAG,MAAM;MACT,SAAS;KACb;IAER;IACA,KAAK;GACT,CACJ;EACJ;CACJ;AACJ,CAAC,CACL"}
@@ -0,0 +1,127 @@
1
+ import { t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
+ import "./public-component-DYpU9aDh.js";
3
+ import { i as OverlayTriggerRootProps, n as OverlayRootEmits, r as OverlayRootProps, t as OverlayPortalProps } from "./overlay-portal-Cmn7Dt7E.js";
4
+ import { t as OverlayHandle } from "./overlay-handle-DzC9LJQo.js";
5
+ import "./use-positioner-D98pYl_K.js";
6
+ import "vue";
7
+ import "@fragiola/primitives/collection";
8
+ import { Align, Side } from "@fragiola/primitives/positioning";
9
+ /** The state a CheckboxItem or a RadioItem gives its indicator. */
10
+ interface MenuCheckableItemState {
11
+ checked: boolean;
12
+ highlighted: boolean;
13
+ disabled: boolean;
14
+ }
15
+ /** A `menuitemcheckbox` (`v-model:checked`; spec/menu.md): toggles its checked state. */
16
+ type MenuCheckboxItemState = MenuCheckableItemState;
17
+ interface MenuCheckboxItemProps {
18
+ checked?: boolean;
19
+ defaultChecked?: boolean;
20
+ disabled?: boolean;
21
+ /** The text typeahead matches (default: the item's text). */
22
+ label?: string;
23
+ /** A click closes every menu level (default `false`; Enter always closes, Space never). */
24
+ closeOnClick?: boolean;
25
+ }
26
+ type MenuCheckboxItemEmits = {
27
+ "update:checked": (checked: boolean) => true;
28
+ checkedChange: (checked: boolean, details: ChangeDetails) => true;
29
+ };
30
+ /** Marks a checked CheckboxItem; hidden from assistive technologies (spec/menu.md). */
31
+ interface MenuCheckboxItemIndicatorProps {
32
+ /** Rendered while the item is unchecked too (default `false`). */
33
+ keepMounted?: boolean;
34
+ }
35
+ /**
36
+ * An action. Enter, Space and clicks fire its `click` (`@click`), then close every level
37
+ * (spec/menu.md). A disabled item stays focusable but is never activated.
38
+ */
39
+ interface MenuItemState {
40
+ highlighted: boolean;
41
+ disabled: boolean;
42
+ }
43
+ interface MenuItemProps {
44
+ disabled?: boolean;
45
+ /** The text typeahead matches (default: the item's text). */
46
+ label?: string;
47
+ /** Activating the item closes every menu level (default `true`). */
48
+ closeOnClick?: boolean;
49
+ }
50
+ /** One menu level: roving focus, typeahead, Escape per level (spec/menu.md). */
51
+ interface MenuPopupState {
52
+ open: boolean;
53
+ side: Side;
54
+ align: Align;
55
+ }
56
+ interface MenuPortalProps extends OverlayPortalProps {}
57
+ /** Places a menu level: below its trigger, or at the end side of its submenu trigger. */
58
+ interface MenuPositionerState {
59
+ open: boolean;
60
+ side: Side;
61
+ align: Align;
62
+ }
63
+ /** A `group` of RadioItems holding their value (`v-model:value`; spec/menu.md). */
64
+ interface MenuRadioGroupProps {
65
+ /** The checked RadioItem's value; `null` for none. */
66
+ value?: string | null;
67
+ defaultValue?: string | null;
68
+ /** Disables every RadioItem of the group. */
69
+ disabled?: boolean;
70
+ }
71
+ type MenuRadioGroupEmits = {
72
+ "update:value": (value: string | null) => true;
73
+ valueChange: (value: string | null, details: ChangeDetails) => true;
74
+ };
75
+ /** A `menuitemradio` of its RadioGroup (spec/menu.md): checks its value. */
76
+ type MenuRadioItemState = MenuCheckableItemState;
77
+ interface MenuRadioItemProps {
78
+ value: string;
79
+ disabled?: boolean;
80
+ /** The text typeahead matches (default: the item's text). */
81
+ label?: string;
82
+ /** A click closes every menu level (default `false`; Enter always closes, Space never). */
83
+ closeOnClick?: boolean;
84
+ }
85
+ /** Marks a checked RadioItem; hidden from assistive technologies (spec/menu.md). */
86
+ interface MenuRadioItemIndicatorProps {
87
+ /** Rendered while the item is unchecked too (default `false`). */
88
+ keepMounted?: boolean;
89
+ }
90
+ /** A Menu's handle: its detached Triggers and imperative opening (spec/menu.md). */
91
+ interface MenuHandle<Payload = unknown> extends OverlayHandle<Payload> {
92
+ readonly component: "menu";
93
+ }
94
+ /** Creates a Menu handle (`Menu.createHandle`), for Triggers outside the Root. */
95
+ declare const createMenuHandle: <Payload = unknown>() => MenuHandle<Payload>;
96
+ /**
97
+ * A nested menu level's props (`v-model:open`). A template ref on a level's Root exposes its
98
+ * actions, `close()` and `unmount()`.
99
+ */
100
+ interface MenuSubmenuRootProps extends OverlayRootProps {
101
+ /** Arrow keys wrap at the ends (default `true`). */
102
+ loopFocus?: boolean;
103
+ }
104
+ interface MenuRootProps extends MenuSubmenuRootProps, OverlayTriggerRootProps {
105
+ /**
106
+ * Locks the page's scroll and blocks the pointer outside the menu while it is open (default
107
+ * `false`: the APG menu button is non-modal; spec/menu.md, "Modal").
108
+ */
109
+ modal?: boolean;
110
+ /** Connects Triggers rendered outside the Root (spec/menu.md, "Detached triggers"). */
111
+ handle?: MenuHandle;
112
+ }
113
+ type MenuRootEmits = OverlayRootEmits;
114
+ /** An item of the parent menu that opens its submenu (spec/menu.md). */
115
+ interface MenuSubmenuTriggerState {
116
+ open: boolean;
117
+ highlighted: boolean;
118
+ disabled: boolean;
119
+ }
120
+ interface MenuSubmenuTriggerProps {
121
+ disabled?: boolean;
122
+ label?: string;
123
+ /** Hovering opens the submenu (default `true`), after `delay` ms (default 100). */
124
+ openOnHover?: boolean;
125
+ delay?: number;
126
+ }
127
+ export { MenuCheckableItemState as S, MenuItemState as _, MenuSubmenuRootProps as a, MenuCheckboxItemProps as b, MenuRadioItemIndicatorProps as c, MenuRadioGroupEmits as d, MenuRadioGroupProps as f, MenuItemProps as g, MenuPopupState as h, MenuRootProps as i, MenuRadioItemProps as l, MenuPortalProps as m, MenuSubmenuTriggerState as n, MenuHandle as o, MenuPositionerState as p, MenuRootEmits as r, createMenuHandle as s, MenuSubmenuTriggerProps as t, MenuRadioItemState as u, MenuCheckboxItemIndicatorProps as v, MenuCheckboxItemState as x, MenuCheckboxItemEmits as y };
package/dist/menu.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { a as OverlayActions, i as OpenChangeDetails, n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
+ import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
+ import { n as OverlayRootSlots } from "./public-component-DYpU9aDh.js";
4
+ import { i as OverlayTriggerRootProps, n as OverlayRootEmits, r as OverlayRootProps, t as OverlayPortalProps } from "./overlay-portal-Cmn7Dt7E.js";
5
+ import { t as OverlayHandle } from "./overlay-handle-DzC9LJQo.js";
6
+ import { t as OverlayTriggerProps } from "./use-overlay-trigger-D9OXZ_6K.js";
7
+ import { t as PositionerProps } from "./use-positioner-D98pYl_K.js";
8
+ import { S as MenuCheckableItemState, _ as MenuItemState, a as MenuSubmenuRootProps, b as MenuCheckboxItemProps, c as MenuRadioItemIndicatorProps, d as MenuRadioGroupEmits, f as MenuRadioGroupProps, g as MenuItemProps, h as MenuPopupState, i as MenuRootProps, l as MenuRadioItemProps, m as MenuPortalProps, n as MenuSubmenuTriggerState, o as MenuHandle, p as MenuPositionerState, r as MenuRootEmits, s as createMenuHandle, t as MenuSubmenuTriggerProps, u as MenuRadioItemState, v as MenuCheckboxItemIndicatorProps, x as MenuCheckboxItemState, y as MenuCheckboxItemEmits } from "./menu-submenu-trigger-DNH8_uUB.js";
9
+ import { a as MenuTriggerState, i as MenuTriggerProps, n as Side, r as Menu, t as Align } from "./index-D11YCkvR.js";
10
+ export { type Align, type ChangeDetails, type ChangeReason, Menu, type MenuCheckableItemState, type MenuCheckboxItemEmits, type MenuCheckboxItemIndicatorProps, type MenuCheckboxItemProps, type MenuCheckboxItemState, type MenuHandle, type MenuItemProps, type MenuItemState, type MenuPopupState, type MenuPortalProps, type MenuPositionerState, type MenuRadioGroupEmits, type MenuRadioGroupProps, type MenuRadioItemIndicatorProps, type MenuRadioItemProps, type MenuRadioItemState, type MenuRootEmits, type MenuRootProps, type MenuSubmenuRootProps, type MenuSubmenuTriggerProps, type MenuSubmenuTriggerState, type MenuTriggerProps, type MenuTriggerState, type OpenChangeDetails, type OverlayActions, type OverlayHandle, type OverlayPortalProps, type OverlayRootEmits, type OverlayRootProps, type OverlayRootSlots, type OverlayTriggerProps, type OverlayTriggerRootProps, type PositionerProps, type RenderSlotProps, type Side, createMenuHandle };
package/dist/menu.js ADDED
@@ -0,0 +1 @@
1
+ export { t as Menu, n as createMenuHandle } from "./menu-D7TVxPdb.js";
@@ -0,0 +1,212 @@
1
+ import { t as useRovingComposite } from "./use-roving-composite-CW0mE_VU.js";
2
+ import { n as useProvidedDirection } from "./direction-context-D-C_P6Lm.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 { n as menuItems, t as MenuBarKey } from "./menu-bar-context-k5vMlwmW.js";
7
+ import { defineComponent, provide } from "vue";
8
+ import { inDocumentOrder, rovingKeyTarget, rovingKeys, submenuKeys } from "@fragiola/primitives/collection";
9
+ import { getDirection } from "@fragiola/primitives/direction";
10
+ // src/components/menubar/menubar.ts
11
+ /** A press within this time after a hover opened a menu keeps it open (Base UI's patient click). */
12
+ const PATIENT_PRESS_MS = 500;
13
+ /** The open keys of an item: the item of its menu they focus (spec/menubar.md, "Keyboard"). */
14
+ function openKeyTarget(key, orientation, rtl) {
15
+ if (key === "Enter" || key === " ") return "first";
16
+ if (orientation === "vertical") return key === submenuKeys(rtl).open ? "first" : null;
17
+ return key === "ArrowDown" ? "first" : key === "ArrowUp" ? "last" : null;
18
+ }
19
+ function rootLevel(level) {
20
+ return level.parent ? rootLevel(level.parent) : level;
21
+ }
22
+ const hasModifier = (event) => event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
23
+ /**
24
+ * A bar of menus with one tab stop (spec/menubar.md, the APG menubar): the `Menu.Trigger`s of the
25
+ * `Menu.Root`s inside it are its items; it moves the focus between them and, while a menu is
26
+ * open, from that menu to the next, by the keys and by hovering.
27
+ */
28
+ const Menubar = publicComponent(defineComponent({
29
+ name: "MenubarRoot",
30
+ inheritAttrs: false,
31
+ props: {
32
+ ...asProp,
33
+ orientation: {
34
+ type: String,
35
+ default: "horizontal"
36
+ },
37
+ loopFocus: {
38
+ type: Boolean,
39
+ default: true
40
+ },
41
+ modal: {
42
+ type: Boolean,
43
+ default: false
44
+ },
45
+ disabled: {
46
+ type: Boolean,
47
+ default: false
48
+ }
49
+ },
50
+ setup(props, { attrs, slots }) {
51
+ const direction = useProvidedDirection();
52
+ const { scope, onKeydown: rovingKeydown, ref: rootRef } = useRovingComposite({
53
+ orientation: () => props.orientation,
54
+ loopFocus: () => props.loopFocus,
55
+ disabled: () => props.disabled
56
+ });
57
+ const entries = /* @__PURE__ */ new Map();
58
+ let hoverOpened = null;
59
+ const register = (trigger, entry) => {
60
+ entries.set(trigger, entry);
61
+ return () => {
62
+ if (entries.get(trigger) === entry) entries.delete(trigger);
63
+ };
64
+ };
65
+ /** The open menu of the bar and its Trigger, if any. */
66
+ const openOne = () => {
67
+ for (const [trigger, entry] of entries) if (entry.menu.open.value) return {
68
+ trigger,
69
+ menu: entry.menu
70
+ };
71
+ return null;
72
+ };
73
+ /** Opens a Trigger's menu, unless it is disabled. */
74
+ const openMenu = (trigger, reason, event, highlight) => {
75
+ const entry = entries.get(trigger);
76
+ if (entry === void 0 || entry.disabled()) return;
77
+ entry.menu.pendingHighlight.current = highlight;
78
+ if (!entry.menu.setOpen(true, reason, event, trigger)) entry.menu.pendingHighlight.current = null;
79
+ };
80
+ /**
81
+ * Moves from the open menu to another item (the keys): the focus first, then the
82
+ * open menu closes and the item's menu opens with the focus kept on it (APG).
83
+ */
84
+ const moveTo = (target, from, event) => {
85
+ target.focus();
86
+ from?.setOpen(false, "list-navigation", event);
87
+ openMenu(target, "list-navigation", event, "keep");
88
+ };
89
+ const menuKeyDown = (event, level) => {
90
+ if (hasModifier(event)) return false;
91
+ const root = rootLevel(level);
92
+ const trigger = root.trigger.value;
93
+ if (trigger === null || !entries.has(trigger)) return false;
94
+ const rtl = getDirection(level.popup.value ?? trigger, direction()) === "rtl";
95
+ const nested = level.parent !== null;
96
+ if (props.orientation === "vertical") {
97
+ if (!nested && event.key === submenuKeys(rtl).close) {
98
+ trigger.focus();
99
+ root.setOpen(false, "list-navigation", event);
100
+ return true;
101
+ }
102
+ return false;
103
+ }
104
+ const { next, previous } = rovingKeys("horizontal", rtl);
105
+ if (event.key !== next && !(event.key === previous && !nested)) return false;
106
+ const triggers = inDocumentOrder([...entries.keys()], (element) => element);
107
+ const index = rovingKeyTarget(event.key, triggers.indexOf(trigger), triggers.length, {
108
+ orientation: "horizontal",
109
+ rtl,
110
+ loop: props.loopFocus
111
+ });
112
+ const target = index === null ? void 0 : triggers[index];
113
+ if (target !== void 0 && target !== trigger) moveTo(target, root, event);
114
+ return true;
115
+ };
116
+ const press = (trigger, event) => {
117
+ const entry = entries.get(trigger);
118
+ if (entry === void 0 || entry.disabled()) return;
119
+ const { menu } = entry;
120
+ if (!menu.open.value) {
121
+ openMenu(trigger, "trigger-press", event, null);
122
+ return;
123
+ }
124
+ const hovered = hoverOpened;
125
+ hoverOpened = null;
126
+ if (hovered?.trigger === trigger && event.timeStamp - hovered.time < PATIENT_PRESS_MS) return;
127
+ menu.pendingHighlight.current = null;
128
+ menu.setOpen(false, "trigger-press", event, trigger);
129
+ };
130
+ const hover = (trigger, event) => {
131
+ const entry = entries.get(trigger);
132
+ if (event.pointerType === "touch" || entry === void 0 || entry.disabled() || entry.menu.open.value) return;
133
+ const open = openOne();
134
+ if (open === null) return;
135
+ open.menu.setOpen(false, "trigger-hover", event);
136
+ openMenu(trigger, "trigger-hover", event, null);
137
+ hoverOpened = {
138
+ trigger,
139
+ time: event.timeStamp
140
+ };
141
+ scope.focused(trigger);
142
+ };
143
+ const onKeydown = (event) => {
144
+ const trigger = event.target;
145
+ const entry = entries.get(trigger);
146
+ if (entry === void 0 || event.defaultPrevented) return;
147
+ const open = openOne();
148
+ if (event.key === "Tab") {
149
+ open?.menu.setOpen(false, "focus-out", event);
150
+ return;
151
+ }
152
+ rovingKeydown(event);
153
+ if (event.defaultPrevented) {
154
+ const target = trigger.ownerDocument.activeElement;
155
+ if (open !== null && target instanceof HTMLElement && target !== trigger && entries.has(target)) {
156
+ open.menu.setOpen(false, "list-navigation", event);
157
+ openMenu(target, "list-navigation", event, "keep");
158
+ }
159
+ return;
160
+ }
161
+ if (hasModifier(event)) return;
162
+ const rtl = getDirection(event.currentTarget, direction()) === "rtl";
163
+ const highlight = openKeyTarget(event.key, props.orientation, rtl);
164
+ if (highlight === null) return;
165
+ event.preventDefault();
166
+ if (entry.disabled()) return;
167
+ const { menu } = entry;
168
+ if (menu.open.value) {
169
+ const popup = menu.popup.value;
170
+ const items = popup ? menuItems(popup) : [];
171
+ (highlight === "first" ? items[0] : items.at(-1))?.focus({ preventScroll: true });
172
+ return;
173
+ }
174
+ openMenu(trigger, event.key === "Enter" || event.key === " " ? "trigger-press" : "list-navigation", event, highlight);
175
+ };
176
+ provide(MenuBarKey, {
177
+ scope,
178
+ orientation: () => props.orientation,
179
+ disabled: () => props.disabled,
180
+ modal: () => props.modal,
181
+ register,
182
+ press,
183
+ hover,
184
+ menuKeyDown
185
+ });
186
+ return () => {
187
+ const { orientation, disabled, modal } = props;
188
+ return renderPart("div", {
189
+ attrs,
190
+ slots
191
+ }, props.as, {
192
+ orientation,
193
+ disabled,
194
+ modal
195
+ }, {
196
+ role: "menubar",
197
+ "aria-orientation": orientation,
198
+ style: modal ? { pointerEvents: "auto" } : void 0,
199
+ "data-primitives-part": "menubar-root",
200
+ ...stateAttributes({
201
+ orientation,
202
+ disabled
203
+ }),
204
+ onKeydown,
205
+ ref: rootRef
206
+ });
207
+ };
208
+ }
209
+ }));
210
+ export { Menubar as t };
211
+
212
+ //# sourceMappingURL=menubar-CQn3AOiQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menubar-CQn3AOiQ.js","names":[],"sources":["../src/components/menubar/menubar.ts"],"sourcesContent":["import {\n inDocumentOrder,\n type RovingOrientation,\n rovingKeys,\n rovingKeyTarget,\n submenuKeys,\n} from \"@fragiola/primitives/collection\";\nimport { getDirection } from \"@fragiola/primitives/direction\";\nimport { defineComponent, type PropType, provide } from \"vue\";\nimport { useRovingComposite } from \"../../composables/use-roving-composite.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 { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n type MenuBarContext,\n type MenuBarEntry,\n MenuBarKey,\n} from \"../menu/menu-bar-context.ts\";\nimport type { MenuContext, PendingHighlight } from \"../menu/menu-context.ts\";\nimport { menuItems } from \"../menu/menu-items.ts\";\n\nexport interface MenubarState {\n orientation: RovingOrientation;\n disabled: boolean;\n modal: boolean;\n}\n\nexport interface MenubarProps {\n /** The arrow keys' axis, and where the menus open (default `\"horizontal\"`). */\n orientation?: RovingOrientation;\n /** The arrows wrap from the last item to the first and back (default `true`). */\n loopFocus?: boolean;\n /**\n * The menus lock the page's scroll and block the pointer outside while open (default `false`:\n * the APG menubar is non-modal; spec/menubar.md, \"Modal\").\n */\n modal?: boolean;\n /** Every item is disabled: focusable, opening nothing. */\n disabled?: boolean;\n}\n\n/** A press within this time after a hover opened a menu keeps it open (Base UI's patient click). */\nconst PATIENT_PRESS_MS = 500;\n\n/** The open keys of an item: the item of its menu they focus (spec/menubar.md, \"Keyboard\"). */\nfunction openKeyTarget(\n key: string,\n orientation: RovingOrientation,\n rtl: boolean,\n): \"first\" | \"last\" | null {\n if (key === \"Enter\" || key === \" \") {\n return \"first\";\n }\n if (orientation === \"vertical\") {\n return key === submenuKeys(rtl).open ? \"first\" : null;\n }\n return key === \"ArrowDown\" ? \"first\" : key === \"ArrowUp\" ? \"last\" : null;\n}\n\nfunction rootLevel(level: MenuContext): MenuContext {\n return level.parent ? rootLevel(level.parent) : level;\n}\n\nconst hasModifier = (event: KeyboardEvent) =>\n event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;\n\n/**\n * A bar of menus with one tab stop (spec/menubar.md, the APG menubar): the `Menu.Trigger`s of the\n * `Menu.Root`s inside it are its items; it moves the focus between them and, while a menu is\n * open, from that menu to the next, by the keys and by hovering.\n */\nexport const Menubar: PartComponent<MenubarProps, MenubarState> =\n publicComponent(\n defineComponent({\n name: \"MenubarRoot\",\n inheritAttrs: false,\n props: {\n ...asProp,\n orientation: {\n type: String as PropType<RovingOrientation>,\n default: \"horizontal\",\n },\n loopFocus: { type: Boolean, default: true },\n modal: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n },\n setup(props, { attrs, slots }) {\n const direction = useProvidedDirection();\n const {\n scope,\n onKeydown: rovingKeydown,\n ref: rootRef,\n } = useRovingComposite({\n orientation: () => props.orientation,\n loopFocus: () => props.loopFocus,\n disabled: () => props.disabled,\n });\n const entries = new Map<HTMLElement, MenuBarEntry>();\n let hoverOpened: { trigger: HTMLElement; time: number } | null =\n null;\n\n const register = (\n trigger: HTMLElement,\n entry: MenuBarEntry,\n ) => {\n entries.set(trigger, entry);\n return () => {\n if (entries.get(trigger) === entry) {\n entries.delete(trigger);\n }\n };\n };\n /** The open menu of the bar and its Trigger, if any. */\n const openOne = () => {\n for (const [trigger, entry] of entries) {\n if (entry.menu.open.value) {\n return { trigger, menu: entry.menu };\n }\n }\n return null;\n };\n /** Opens a Trigger's menu, unless it is disabled. */\n const openMenu = (\n trigger: HTMLElement,\n reason:\n | \"list-navigation\"\n | \"trigger-press\"\n | \"trigger-hover\",\n event: Event,\n highlight: PendingHighlight,\n ) => {\n const entry = entries.get(trigger);\n if (entry === undefined || entry.disabled()) {\n return;\n }\n entry.menu.pendingHighlight.current = highlight;\n if (!entry.menu.setOpen(true, reason, event, trigger)) {\n entry.menu.pendingHighlight.current = null;\n }\n };\n /**\n * Moves from the open menu to another item (the keys): the focus first, then the\n * open menu closes and the item's menu opens with the focus kept on it (APG).\n */\n const moveTo = (\n target: HTMLElement,\n from: MenuContext | null,\n event: Event,\n ) => {\n target.focus();\n from?.setOpen(false, \"list-navigation\", event);\n openMenu(target, \"list-navigation\", event, \"keep\");\n };\n\n const menuKeyDown = (\n event: KeyboardEvent,\n level: MenuContext,\n ): boolean => {\n if (hasModifier(event)) {\n return false;\n }\n const root = rootLevel(level);\n const trigger = root.trigger.value;\n if (trigger === null || !entries.has(trigger)) {\n return false;\n }\n const rtl =\n getDirection(\n level.popup.value ?? trigger,\n direction(),\n ) === \"rtl\";\n const nested = level.parent !== null;\n if (props.orientation === \"vertical\") {\n // the menu sits at the item's end side, as a submenu: its close key goes\n // back\n if (!nested && event.key === submenuKeys(rtl).close) {\n trigger.focus();\n root.setOpen(false, \"list-navigation\", event);\n return true;\n }\n return false;\n }\n const { next, previous } = rovingKeys(\"horizontal\", rtl);\n if (\n event.key !== next &&\n !(event.key === previous && !nested)\n ) {\n return false;\n }\n const triggers = inDocumentOrder(\n [...entries.keys()],\n (element) => element,\n );\n const index = rovingKeyTarget(\n event.key,\n triggers.indexOf(trigger),\n triggers.length,\n {\n orientation: \"horizontal\",\n rtl,\n loop: props.loopFocus,\n },\n );\n const target = index === null ? undefined : triggers[index];\n if (target !== undefined && target !== trigger) {\n moveTo(target, root, event);\n }\n return true;\n };\n\n const press = (trigger: HTMLElement, event: MouseEvent) => {\n const entry = entries.get(trigger);\n if (entry === undefined || entry.disabled()) {\n return;\n }\n const { menu } = entry;\n if (!menu.open.value) {\n openMenu(trigger, \"trigger-press\", event, null);\n return;\n }\n const hovered = hoverOpened;\n hoverOpened = null;\n if (\n hovered?.trigger === trigger &&\n event.timeStamp - hovered.time < PATIENT_PRESS_MS\n ) {\n return;\n }\n menu.pendingHighlight.current = null;\n menu.setOpen(false, \"trigger-press\", event, trigger);\n };\n\n const hover = (trigger: HTMLElement, event: PointerEvent) => {\n const entry = entries.get(trigger);\n // a tap's pointer entering an item is no hover (spec/menubar.md, \"Pointer\")\n if (\n event.pointerType === \"touch\" ||\n entry === undefined ||\n entry.disabled() ||\n entry.menu.open.value\n ) {\n return;\n }\n const open = openOne();\n if (open === null) {\n return;\n }\n open.menu.setOpen(false, \"trigger-hover\", event);\n openMenu(trigger, \"trigger-hover\", event, null);\n hoverOpened = { trigger, time: event.timeStamp };\n scope.focused(trigger);\n };\n\n // the keys of the bar's items (their keydown reaches the bar's element)\n const onKeydown = (event: KeyboardEvent) => {\n const trigger = event.target as HTMLElement;\n const entry = entries.get(trigger);\n if (entry === undefined || event.defaultPrevented) {\n return;\n }\n const open = openOne();\n if (event.key === \"Tab\") {\n open?.menu.setOpen(false, \"focus-out\", event);\n return;\n }\n rovingKeydown(event);\n if (event.defaultPrevented) {\n const target = trigger.ownerDocument.activeElement;\n if (\n open !== null &&\n target instanceof HTMLElement &&\n target !== trigger &&\n entries.has(target)\n ) {\n open.menu.setOpen(false, \"list-navigation\", event);\n openMenu(target, \"list-navigation\", event, \"keep\");\n }\n return;\n }\n if (hasModifier(event)) {\n return;\n }\n const rtl =\n getDirection(\n event.currentTarget as HTMLElement,\n direction(),\n ) === \"rtl\";\n const highlight = openKeyTarget(\n event.key,\n props.orientation,\n rtl,\n );\n if (highlight === null) {\n return;\n }\n event.preventDefault();\n if (entry.disabled()) {\n return;\n }\n const { menu } = entry;\n if (menu.open.value) {\n // the focus is on the item of an open menu: the open keys go into it\n const popup = menu.popup.value;\n const items = popup ? menuItems(popup) : [];\n (highlight === \"first\"\n ? items[0]\n : items.at(-1)\n )?.focus({ preventScroll: true });\n return;\n }\n openMenu(\n trigger,\n event.key === \"Enter\" || event.key === \" \"\n ? \"trigger-press\"\n : \"list-navigation\",\n event,\n highlight,\n );\n };\n\n const context: MenuBarContext = {\n scope,\n orientation: () => props.orientation,\n disabled: () => props.disabled,\n modal: () => props.modal,\n register,\n press,\n hover,\n menuKeyDown,\n };\n provide(MenuBarKey, context);\n return () => {\n const { orientation, disabled, modal } = props;\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n { orientation, disabled, modal },\n {\n role: \"menubar\",\n \"aria-orientation\": orientation,\n // a modal menu blocks the pointer outside; the bar takes it back\n // (spec/menubar.md)\n style: modal\n ? { pointerEvents: \"auto\" }\n : undefined,\n \"data-primitives-part\": \"menubar-root\",\n ...stateAttributes({ orientation, disabled }),\n onKeydown,\n ref: rootRef,\n },\n );\n };\n },\n }),\n );\n"],"mappings":";;;;;;;;;;;AA8CA,MAAM,mBAAmB;;AAGzB,SAAS,cACL,KACA,aACA,KACuB;CACvB,IAAI,QAAQ,WAAW,QAAQ,KAC3B,OAAO;CAEX,IAAI,gBAAgB,YAChB,OAAO,QAAQ,YAAY,GAAG,CAAC,CAAC,OAAO,UAAU;CAErD,OAAO,QAAQ,cAAc,UAAU,QAAQ,YAAY,SAAS;AACxE;AAEA,SAAS,UAAU,OAAiC;CAChD,OAAO,MAAM,SAAS,UAAU,MAAM,MAAM,IAAI;AACpD;AAEA,MAAM,eAAe,UACjB,MAAM,UAAU,MAAM,WAAW,MAAM,WAAW,MAAM;;;;;;AAO5D,MAAa,UACT,gBACI,gBAAgB;CACZ,MAAM;CACN,cAAc;CACd,OAAO;EACH,GAAG;EACH,aAAa;GACT,MAAM;GACN,SAAS;EACb;EACA,WAAW;GAAE,MAAM;GAAS,SAAS;EAAK;EAC1C,OAAO;GAAE,MAAM;GAAS,SAAS;EAAM;EACvC,UAAU;GAAE,MAAM;GAAS,SAAS;EAAM;CAC9C;CACA,MAAM,OAAO,EAAE,OAAO,SAAS;EAC3B,MAAM,YAAY,qBAAqB;EACvC,MAAM,EACF,OACA,WAAW,eACX,KAAK,YACL,mBAAmB;GACnB,mBAAmB,MAAM;GACzB,iBAAiB,MAAM;GACvB,gBAAgB,MAAM;EAC1B,CAAC;EACD,MAAM,0BAAU,IAAI,IAA+B;EACnD,IAAI,cACA;EAEJ,MAAM,YACF,SACA,UACC;GACD,QAAQ,IAAI,SAAS,KAAK;GAC1B,aAAa;IACT,IAAI,QAAQ,IAAI,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ACA,KAAK;GACT,CACJ;EACJ;CACJ;AACJ,CAAC,CACL"}
@@ -0,0 +1,3 @@
1
+ import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
2
+ import { i as MenubarState, n as Menubar, r as MenubarProps, t as RovingOrientation } from "./index-C-QYKtWy.js";
3
+ export { Menubar, type MenubarProps, type MenubarState, type RenderSlotProps, type RovingOrientation };
@@ -0,0 +1 @@
1
+ export { t as Menubar } from "./menubar-CQn3AOiQ.js";