@wirekyt/dom 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/dist/anatomy-DMuSMbOP.d.cts +18 -0
  2. package/dist/anatomy-DMuSMbOP.d.ts +18 -0
  3. package/dist/anatomy.cjs +3 -0
  4. package/dist/anatomy.d.cts +2 -0
  5. package/dist/anatomy.d.ts +2 -0
  6. package/dist/anatomy.js +2 -0
  7. package/dist/angle-3hqP0Mp5.cjs +13 -0
  8. package/dist/angle-oNt8uGHQ.js +8 -0
  9. package/dist/aria-hidden-CEXexb2I.js +127 -0
  10. package/dist/aria-hidden-Y7iJHPMr.cjs +132 -0
  11. package/dist/aria-hidden.cjs +3 -0
  12. package/dist/aria-hidden.d.cts +10 -0
  13. package/dist/aria-hidden.d.ts +10 -0
  14. package/dist/aria-hidden.js +2 -0
  15. package/dist/array-BGtygd0o.cjs +198 -0
  16. package/dist/array-C4KbHsha.js +73 -0
  17. package/dist/auto-resize-5F5iiKZb.cjs +106 -0
  18. package/dist/auto-resize-KkNfCcBt.js +95 -0
  19. package/dist/auto-resize.cjs +4 -0
  20. package/dist/auto-resize.d.cts +7 -0
  21. package/dist/auto-resize.d.ts +7 -0
  22. package/dist/auto-resize.js +2 -0
  23. package/dist/caret-CHqaP4XG.cjs +30 -0
  24. package/dist/caret-aiDJ6mAS.js +19 -0
  25. package/dist/closest-Clo6ODcK.js +117 -0
  26. package/dist/closest-IiRz1GIJ.cjs +176 -0
  27. package/dist/collection-CJU0oDtX.js +1295 -0
  28. package/dist/collection-CwzUJwBJ.cjs +1342 -0
  29. package/dist/collection.cjs +15 -0
  30. package/dist/collection.d.cts +34 -0
  31. package/dist/collection.d.ts +34 -0
  32. package/dist/collection.js +3 -0
  33. package/dist/color-CsugZjq6.d.cts +60 -0
  34. package/dist/color-CsugZjq6.d.ts +60 -0
  35. package/dist/color-utils-DzeOVYlL.cjs +662 -0
  36. package/dist/color-utils-lDDg9FEh.js +639 -0
  37. package/dist/color-utils.cjs +6 -0
  38. package/dist/color-utils.d.cts +18 -0
  39. package/dist/color-utils.d.ts +18 -0
  40. package/dist/color-utils.js +2 -0
  41. package/dist/computed-style-B1MKlCoo.js +9 -0
  42. package/dist/computed-style-DLArEFNw.cjs +14 -0
  43. package/dist/controller-B8E8ZJCI.cjs +133 -0
  44. package/dist/controller-Dv7lWHDr.js +92 -0
  45. package/dist/core-BF6G2RiC.d.cts +1 -0
  46. package/dist/core-BNMw-JId.cjs +372 -0
  47. package/dist/core-BdeZuSX6.d.ts +1 -0
  48. package/dist/core-CJ0MZr3D.js +289 -0
  49. package/dist/core.cjs +19 -0
  50. package/dist/core.d.cts +3 -0
  51. package/dist/core.d.ts +3 -0
  52. package/dist/core.js +3 -0
  53. package/dist/create-anatomy-B2q3wiaw.js +22 -0
  54. package/dist/create-anatomy-BwDn25ph.cjs +27 -0
  55. package/dist/create-props-CgtcN_Qu.js +4 -0
  56. package/dist/create-props-CjLx2oS8.cjs +9 -0
  57. package/dist/data-url-C-Uk31Q9.cjs +42 -0
  58. package/dist/data-url-DHUHj7UF.js +37 -0
  59. package/dist/data-url-Gx_SWG-k.d.cts +10 -0
  60. package/dist/data-url-Gx_SWG-k.d.ts +10 -0
  61. package/dist/date-utils-D-JJHedx.cjs +868 -0
  62. package/dist/date-utils-D5zXW-Cs.js +569 -0
  63. package/dist/date-utils.cjs +52 -0
  64. package/dist/date-utils.d.cts +7 -0
  65. package/dist/date-utils.d.ts +7 -0
  66. package/dist/date-utils.js +2 -0
  67. package/dist/dismissable-C0bixtzl.cjs +348 -0
  68. package/dist/dismissable-KM1jPtNQ.js +337 -0
  69. package/dist/dismissable-layer-BTX5EvXw.d.ts +40 -0
  70. package/dist/dismissable-layer-Ch5niVaq.d.cts +40 -0
  71. package/dist/dismissable.cjs +4 -0
  72. package/dist/dismissable.d.cts +3 -0
  73. package/dist/dismissable.d.ts +3 -0
  74. package/dist/dismissable.js +2 -0
  75. package/dist/dom-query-CQzY93XU.cjs +488 -0
  76. package/dist/dom-query-e7fh0TEH.js +243 -0
  77. package/dist/dom-query.cjs +180 -0
  78. package/dist/dom-query.d.cts +142 -0
  79. package/dist/dom-query.d.ts +142 -0
  80. package/dist/dom-query.js +43 -0
  81. package/dist/equal-C927y7MN.cjs +30 -0
  82. package/dist/equal-DtrP8DPh.js +25 -0
  83. package/dist/event-DDz-mMhM.cjs +242 -0
  84. package/dist/event-bTItRgiw.js +117 -0
  85. package/dist/file-utils-6EXCdfHx.js +116 -0
  86. package/dist/file-utils-B7OJigQq.cjs +151 -0
  87. package/dist/file-utils.cjs +92 -0
  88. package/dist/file-utils.d.cts +40 -0
  89. package/dist/file-utils.d.ts +40 -0
  90. package/dist/file-utils.js +82 -0
  91. package/dist/focus-trap-89E5I9nm.js +487 -0
  92. package/dist/focus-trap-D7jKsfHW.cjs +498 -0
  93. package/dist/focus-trap.cjs +4 -0
  94. package/dist/focus-trap.d.cts +89 -0
  95. package/dist/focus-trap.d.ts +89 -0
  96. package/dist/focus-trap.js +2 -0
  97. package/dist/focus-visible-DWdQf__4.js +176 -0
  98. package/dist/focus-visible-G4cmlWqq.cjs +217 -0
  99. package/dist/focus-visible.cjs +9 -0
  100. package/dist/focus-visible.d.cts +32 -0
  101. package/dist/focus-visible.d.ts +32 -0
  102. package/dist/focus-visible.js +2 -0
  103. package/dist/form-B1DW_w_3.js +89 -0
  104. package/dist/form-CoupKpuP.cjs +130 -0
  105. package/dist/from-window-5ZhzSURC.js +68 -0
  106. package/dist/from-window-B9DKtaoR.cjs +115 -0
  107. package/dist/functions-isw5Ovcx.d.cts +16 -0
  108. package/dist/functions-isw5Ovcx.d.ts +16 -0
  109. package/dist/highlight-word.cjs +95 -0
  110. package/dist/highlight-word.d.cts +24 -0
  111. package/dist/highlight-word.d.ts +24 -0
  112. package/dist/highlight-word.js +94 -0
  113. package/dist/hotkeys.cjs +1183 -0
  114. package/dist/hotkeys.d.cts +199 -0
  115. package/dist/hotkeys.d.ts +199 -0
  116. package/dist/hotkeys.js +1173 -0
  117. package/dist/i18n-utils-BD4VtonY.cjs +345 -0
  118. package/dist/i18n-utils-C4FQZ39m.js +280 -0
  119. package/dist/i18n-utils.cjs +216 -0
  120. package/dist/i18n-utils.d.cts +71 -0
  121. package/dist/i18n-utils.d.ts +71 -0
  122. package/dist/i18n-utils.js +204 -0
  123. package/dist/index-3tNJficI.d.cts +117 -0
  124. package/dist/index-3tNJficI.d.ts +117 -0
  125. package/dist/index-BEfvdGE2.d.cts +116 -0
  126. package/dist/index-BEfvdGE2.d.ts +116 -0
  127. package/dist/index-BF6G2RiC.d.cts +1 -0
  128. package/dist/index-BKgxIVbE.d.cts +285 -0
  129. package/dist/index-BMtpmaRD.d.cts +16 -0
  130. package/dist/index-BMtpmaRD.d.ts +16 -0
  131. package/dist/index-BWiYePx8.d.cts +216 -0
  132. package/dist/index-BXfunVyD.d.cts +1342 -0
  133. package/dist/index-BXfunVyD.d.ts +1342 -0
  134. package/dist/index-BdeZuSX6.d.ts +1 -0
  135. package/dist/index-C2865AJq.d.cts +25 -0
  136. package/dist/index-C2865AJq.d.ts +25 -0
  137. package/dist/index-CFoN0L3C.d.ts +285 -0
  138. package/dist/index-vPrqYDHu.d.ts +216 -0
  139. package/dist/index.cjs +19 -0
  140. package/dist/index.d.cts +3 -0
  141. package/dist/index.d.ts +3 -0
  142. package/dist/index.js +3 -0
  143. package/dist/initial-focus-BQxRRFPa.cjs +37 -0
  144. package/dist/initial-focus-BrN5tT2X.js +26 -0
  145. package/dist/interact-outside-BjqIunFx.js +211 -0
  146. package/dist/interact-outside-Dphjr2Zh.cjs +216 -0
  147. package/dist/interact-outside.cjs +3 -0
  148. package/dist/interact-outside.d.cts +2 -0
  149. package/dist/interact-outside.d.ts +2 -0
  150. package/dist/interact-outside.js +2 -0
  151. package/dist/json-tree-utils.cjs +1518 -0
  152. package/dist/json-tree-utils.d.cts +117 -0
  153. package/dist/json-tree-utils.d.ts +117 -0
  154. package/dist/json-tree-utils.js +1469 -0
  155. package/dist/list-collection-D_eNKrot.d.cts +60 -0
  156. package/dist/list-collection-RqYEWHb4.d.ts +60 -0
  157. package/dist/live-region-BD0OgmrH.cjs +68 -0
  158. package/dist/live-region-F8YMmbrY.js +63 -0
  159. package/dist/live-region.cjs +3 -0
  160. package/dist/live-region.d.cts +2 -0
  161. package/dist/live-region.d.ts +2 -0
  162. package/dist/live-region.js +2 -0
  163. package/dist/machines/accordion/index.cjs +328 -0
  164. package/dist/machines/accordion/index.d.cts +83 -0
  165. package/dist/machines/accordion/index.d.ts +83 -0
  166. package/dist/machines/accordion/index.js +321 -0
  167. package/dist/machines/angle-slider/index.cjs +420 -0
  168. package/dist/machines/angle-slider/index.d.cts +84 -0
  169. package/dist/machines/angle-slider/index.d.ts +84 -0
  170. package/dist/machines/angle-slider/index.js +415 -0
  171. package/dist/machines/async-list/index.cjs +310 -0
  172. package/dist/machines/async-list/index.d.cts +90 -0
  173. package/dist/machines/async-list/index.d.ts +90 -0
  174. package/dist/machines/async-list/index.js +308 -0
  175. package/dist/machines/avatar/index.cjs +165 -0
  176. package/dist/machines/avatar/index.d.cts +63 -0
  177. package/dist/machines/avatar/index.d.ts +63 -0
  178. package/dist/machines/avatar/index.js +160 -0
  179. package/dist/machines/carousel/index.cjs +929 -0
  180. package/dist/machines/carousel/index.d.cts +146 -0
  181. package/dist/machines/carousel/index.d.ts +146 -0
  182. package/dist/machines/carousel/index.js +920 -0
  183. package/dist/machines/cascade-select/index.cjs +1426 -0
  184. package/dist/machines/cascade-select/index.d.cts +167 -0
  185. package/dist/machines/cascade-select/index.d.ts +167 -0
  186. package/dist/machines/cascade-select/index.js +1419 -0
  187. package/dist/machines/checkbox/index.cjs +316 -0
  188. package/dist/machines/checkbox/index.d.cts +81 -0
  189. package/dist/machines/checkbox/index.d.ts +81 -0
  190. package/dist/machines/checkbox/index.js +311 -0
  191. package/dist/machines/clipboard/index.cjs +228 -0
  192. package/dist/machines/clipboard/index.d.cts +72 -0
  193. package/dist/machines/clipboard/index.d.ts +72 -0
  194. package/dist/machines/clipboard/index.js +221 -0
  195. package/dist/machines/collapsible/index.cjs +363 -0
  196. package/dist/machines/collapsible/index.d.cts +82 -0
  197. package/dist/machines/collapsible/index.d.ts +82 -0
  198. package/dist/machines/collapsible/index.js +358 -0
  199. package/dist/machines/color-picker/index.cjs +1534 -0
  200. package/dist/machines/color-picker/index.d.cts +207 -0
  201. package/dist/machines/color-picker/index.d.ts +207 -0
  202. package/dist/machines/color-picker/index.js +1518 -0
  203. package/dist/machines/combobox/index.cjs +1554 -0
  204. package/dist/machines/combobox/index.d.cts +219 -0
  205. package/dist/machines/combobox/index.d.ts +219 -0
  206. package/dist/machines/combobox/index.js +1542 -0
  207. package/dist/machines/date-input/index.cjs +1974 -0
  208. package/dist/machines/date-input/index.d.cts +230 -0
  209. package/dist/machines/date-input/index.d.ts +230 -0
  210. package/dist/machines/date-input/index.js +1958 -0
  211. package/dist/machines/date-picker/index.cjs +2424 -0
  212. package/dist/machines/date-picker/index.d.cts +378 -0
  213. package/dist/machines/date-picker/index.d.ts +378 -0
  214. package/dist/machines/date-picker/index.js +2408 -0
  215. package/dist/machines/dialog/index.cjs +378 -0
  216. package/dist/machines/dialog/index.d.cts +94 -0
  217. package/dist/machines/dialog/index.d.ts +94 -0
  218. package/dist/machines/dialog/index.js +373 -0
  219. package/dist/machines/drawer/index.cjs +2066 -0
  220. package/dist/machines/drawer/index.d.cts +334 -0
  221. package/dist/machines/drawer/index.d.ts +334 -0
  222. package/dist/machines/drawer/index.js +2059 -0
  223. package/dist/machines/editable/index.cjs +550 -0
  224. package/dist/machines/editable/index.d.cts +114 -0
  225. package/dist/machines/editable/index.d.ts +114 -0
  226. package/dist/machines/editable/index.js +545 -0
  227. package/dist/machines/file-upload/index.cjs +648 -0
  228. package/dist/machines/file-upload/index.d.cts +150 -0
  229. package/dist/machines/file-upload/index.d.ts +150 -0
  230. package/dist/machines/file-upload/index.js +641 -0
  231. package/dist/machines/floating-panel/index.cjs +1020 -0
  232. package/dist/machines/floating-panel/index.d.cts +149 -0
  233. package/dist/machines/floating-panel/index.d.ts +149 -0
  234. package/dist/machines/floating-panel/index.js +1012 -0
  235. package/dist/machines/hover-card/index.cjs +441 -0
  236. package/dist/machines/hover-card/index.d.cts +82 -0
  237. package/dist/machines/hover-card/index.d.ts +82 -0
  238. package/dist/machines/hover-card/index.js +436 -0
  239. package/dist/machines/image-cropper/index.cjs +2082 -0
  240. package/dist/machines/image-cropper/index.d.cts +182 -0
  241. package/dist/machines/image-cropper/index.d.ts +182 -0
  242. package/dist/machines/image-cropper/index.js +2076 -0
  243. package/dist/machines/listbox/index.cjs +873 -0
  244. package/dist/machines/listbox/index.d.cts +175 -0
  245. package/dist/machines/listbox/index.d.ts +175 -0
  246. package/dist/machines/listbox/index.js +860 -0
  247. package/dist/machines/marquee/index.cjs +387 -0
  248. package/dist/machines/marquee/index.d.cts +102 -0
  249. package/dist/machines/marquee/index.d.ts +102 -0
  250. package/dist/machines/marquee/index.js +382 -0
  251. package/dist/machines/menu/index.cjs +1562 -0
  252. package/dist/machines/menu/index.d.cts +188 -0
  253. package/dist/machines/menu/index.d.ts +188 -0
  254. package/dist/machines/menu/index.js +1549 -0
  255. package/dist/machines/navigation-menu/index.cjs +860 -0
  256. package/dist/machines/navigation-menu/index.d.cts +131 -0
  257. package/dist/machines/navigation-menu/index.d.ts +131 -0
  258. package/dist/machines/navigation-menu/index.js +855 -0
  259. package/dist/machines/number-input/index.cjs +1014 -0
  260. package/dist/machines/number-input/index.d.cts +136 -0
  261. package/dist/machines/number-input/index.d.ts +136 -0
  262. package/dist/machines/number-input/index.js +1009 -0
  263. package/dist/machines/pagination/index.cjs +413 -0
  264. package/dist/machines/pagination/index.d.cts +139 -0
  265. package/dist/machines/pagination/index.d.ts +139 -0
  266. package/dist/machines/pagination/index.js +404 -0
  267. package/dist/machines/password-input/index.cjs +224 -0
  268. package/dist/machines/password-input/index.d.cts +71 -0
  269. package/dist/machines/password-input/index.d.ts +71 -0
  270. package/dist/machines/password-input/index.js +219 -0
  271. package/dist/machines/pin-input/index.cjs +595 -0
  272. package/dist/machines/pin-input/index.d.cts +107 -0
  273. package/dist/machines/pin-input/index.d.ts +107 -0
  274. package/dist/machines/pin-input/index.js +590 -0
  275. package/dist/machines/popover/index.cjs +516 -0
  276. package/dist/machines/popover/index.d.cts +107 -0
  277. package/dist/machines/popover/index.d.ts +107 -0
  278. package/dist/machines/popover/index.js +511 -0
  279. package/dist/machines/presence/index.cjs +193 -0
  280. package/dist/machines/presence/index.d.cts +44 -0
  281. package/dist/machines/presence/index.d.ts +44 -0
  282. package/dist/machines/presence/index.js +190 -0
  283. package/dist/machines/progress/index.cjs +282 -0
  284. package/dist/machines/progress/index.d.cts +96 -0
  285. package/dist/machines/progress/index.d.ts +96 -0
  286. package/dist/machines/progress/index.js +277 -0
  287. package/dist/machines/qr-code/index.cjs +167 -0
  288. package/dist/machines/qr-code/index.d.cts +71 -0
  289. package/dist/machines/qr-code/index.d.ts +71 -0
  290. package/dist/machines/qr-code/index.js +162 -0
  291. package/dist/machines/radio-group/index.cjs +465 -0
  292. package/dist/machines/radio-group/index.d.cts +218 -0
  293. package/dist/machines/radio-group/index.d.ts +218 -0
  294. package/dist/machines/radio-group/index.js +458 -0
  295. package/dist/machines/rating-group/index.cjs +405 -0
  296. package/dist/machines/rating-group/index.d.cts +101 -0
  297. package/dist/machines/rating-group/index.d.ts +101 -0
  298. package/dist/machines/rating-group/index.js +398 -0
  299. package/dist/machines/scroll-area/index.cjs +865 -0
  300. package/dist/machines/scroll-area/index.d.cts +126 -0
  301. package/dist/machines/scroll-area/index.d.ts +126 -0
  302. package/dist/machines/scroll-area/index.js +860 -0
  303. package/dist/machines/select/index.cjs +1226 -0
  304. package/dist/machines/select/index.d.cts +190 -0
  305. package/dist/machines/select/index.d.ts +190 -0
  306. package/dist/machines/select/index.js +1214 -0
  307. package/dist/machines/signature-pad/index.cjs +337 -0
  308. package/dist/machines/signature-pad/index.d.cts +108 -0
  309. package/dist/machines/signature-pad/index.d.ts +108 -0
  310. package/dist/machines/signature-pad/index.js +330 -0
  311. package/dist/machines/slider/index.cjs +1103 -0
  312. package/dist/machines/slider/index.d.cts +154 -0
  313. package/dist/machines/slider/index.d.ts +154 -0
  314. package/dist/machines/slider/index.js +1094 -0
  315. package/dist/machines/splitter/index.cjs +1686 -0
  316. package/dist/machines/splitter/index.d.cts +282 -0
  317. package/dist/machines/splitter/index.d.ts +282 -0
  318. package/dist/machines/splitter/index.js +1675 -0
  319. package/dist/machines/steps/index.cjs +330 -0
  320. package/dist/machines/steps/index.d.cts +109 -0
  321. package/dist/machines/steps/index.d.ts +109 -0
  322. package/dist/machines/steps/index.js +325 -0
  323. package/dist/machines/switch/index.cjs +307 -0
  324. package/dist/machines/switch/index.d.cts +80 -0
  325. package/dist/machines/switch/index.d.ts +80 -0
  326. package/dist/machines/switch/index.js +302 -0
  327. package/dist/machines/tabs/index.cjs +542 -0
  328. package/dist/machines/tabs/index.d.cts +113 -0
  329. package/dist/machines/tabs/index.d.ts +113 -0
  330. package/dist/machines/tabs/index.js +533 -0
  331. package/dist/machines/tags-input/index.cjs +1151 -0
  332. package/dist/machines/tags-input/index.d.cts +182 -0
  333. package/dist/machines/tags-input/index.d.ts +182 -0
  334. package/dist/machines/tags-input/index.js +1144 -0
  335. package/dist/machines/timer/index.cjs +329 -0
  336. package/dist/machines/timer/index.d.cts +102 -0
  337. package/dist/machines/timer/index.d.ts +102 -0
  338. package/dist/machines/timer/index.js +323 -0
  339. package/dist/machines/toast/index.cjs +1185 -0
  340. package/dist/machines/toast/index.d.cts +204 -0
  341. package/dist/machines/toast/index.d.ts +204 -0
  342. package/dist/machines/toast/index.js +1180 -0
  343. package/dist/machines/toc/index.cjs +358 -0
  344. package/dist/machines/toc/index.d.cts +98 -0
  345. package/dist/machines/toc/index.d.ts +98 -0
  346. package/dist/machines/toc/index.js +351 -0
  347. package/dist/machines/toggle/index.cjs +99 -0
  348. package/dist/machines/toggle/index.d.cts +46 -0
  349. package/dist/machines/toggle/index.d.ts +46 -0
  350. package/dist/machines/toggle/index.js +94 -0
  351. package/dist/machines/toggle-group/index.cjs +329 -0
  352. package/dist/machines/toggle-group/index.d.cts +81 -0
  353. package/dist/machines/toggle-group/index.d.ts +81 -0
  354. package/dist/machines/toggle-group/index.js +322 -0
  355. package/dist/machines/tooltip/index.cjs +638 -0
  356. package/dist/machines/tooltip/index.d.cts +84 -0
  357. package/dist/machines/tooltip/index.d.ts +84 -0
  358. package/dist/machines/tooltip/index.js +633 -0
  359. package/dist/machines/tour/index.cjs +1123 -0
  360. package/dist/machines/tour/index.d.cts +207 -0
  361. package/dist/machines/tour/index.d.ts +207 -0
  362. package/dist/machines/tour/index.js +1115 -0
  363. package/dist/machines/tree-view/index.cjs +1288 -0
  364. package/dist/machines/tree-view/index.d.cts +221 -0
  365. package/dist/machines/tree-view/index.d.ts +221 -0
  366. package/dist/machines/tree-view/index.js +1279 -0
  367. package/dist/mutation-observer-_LbwtN3W.cjs +61 -0
  368. package/dist/mutation-observer-qObPUo3D.js +50 -0
  369. package/dist/navigate-CJOaL3vx.js +31 -0
  370. package/dist/navigate-uJG-006f.cjs +42 -0
  371. package/dist/overflow-BBihfMxX.cjs +67 -0
  372. package/dist/overflow-C-zO1CWA.js +44 -0
  373. package/dist/platform-BDB0wXUk.js +26 -0
  374. package/dist/platform-BZS-dkZN.cjs +109 -0
  375. package/dist/point-C9A4dk1i.js +27 -0
  376. package/dist/point-DxnCrJBy.cjs +32 -0
  377. package/dist/pointer-lock-BvfSjt_s.cjs +31 -0
  378. package/dist/pointer-lock-WezxTqu-.js +26 -0
  379. package/dist/pointer-move-CGzan38r.cjs +42 -0
  380. package/dist/pointer-move-Tijb8Ptk.js +37 -0
  381. package/dist/polygon-BvdwYRBw.js +76 -0
  382. package/dist/polygon-CTR1kEoU.cjs +93 -0
  383. package/dist/popper-DkAAS9VE.cjs +487 -0
  384. package/dist/popper-DzBZzAe4.js +464 -0
  385. package/dist/popper.cjs +6 -0
  386. package/dist/popper.d.cts +2 -0
  387. package/dist/popper.d.ts +2 -0
  388. package/dist/popper.js +2 -0
  389. package/dist/press-B7XLrLGR.js +65 -0
  390. package/dist/press-BdD5suLQ.cjs +70 -0
  391. package/dist/proxy-tab-focus-DWMXvAfO.js +54 -0
  392. package/dist/proxy-tab-focus-NthYgHdY.cjs +59 -0
  393. package/dist/raf-BSDcY4UD.cjs +85 -0
  394. package/dist/raf-DgINgykK.d.cts +15 -0
  395. package/dist/raf-DgINgykK.d.ts +15 -0
  396. package/dist/raf-Dhvm7f1e.js +62 -0
  397. package/dist/rect-utils-DiT4k3jS.cjs +548 -0
  398. package/dist/rect-utils-d_3gZVsc.js +459 -0
  399. package/dist/rect-utils.cjs +165 -0
  400. package/dist/rect-utils.d.cts +197 -0
  401. package/dist/rect-utils.d.ts +197 -0
  402. package/dist/rect-utils.js +116 -0
  403. package/dist/remove-scroll-DTVA5f4w.cjs +86 -0
  404. package/dist/remove-scroll-WEheFCiq.js +81 -0
  405. package/dist/remove-scroll.cjs +3 -0
  406. package/dist/remove-scroll.d.cts +4 -0
  407. package/dist/remove-scroll.d.ts +4 -0
  408. package/dist/remove-scroll.js +2 -0
  409. package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
  410. package/dist/scale-C5BBHVgH.js +17 -0
  411. package/dist/scale-C7iiUGhS.cjs +22 -0
  412. package/dist/scope-CysKlKe9.cjs +28 -0
  413. package/dist/scope-D1873Mzi.js +23 -0
  414. package/dist/scroll-CVJ40w2e.js +46 -0
  415. package/dist/scroll-Dyd1QLrc.cjs +63 -0
  416. package/dist/scroll-snap-Cuaqdevf.cjs +224 -0
  417. package/dist/scroll-snap-DqMiFASa.js +201 -0
  418. package/dist/scroll-snap.cjs +6 -0
  419. package/dist/scroll-snap.d.cts +14 -0
  420. package/dist/scroll-snap.d.ts +14 -0
  421. package/dist/scroll-snap.js +2 -0
  422. package/dist/selection-ClKhnWit.d.cts +49 -0
  423. package/dist/selection-DzLiSVkg.d.ts +49 -0
  424. package/dist/selection-map-962WvX2k.js +45 -0
  425. package/dist/selection-map-BwlZr1LH.cjs +68 -0
  426. package/dist/set-CFNGOW5W.js +50 -0
  427. package/dist/set-DrtWCLFb.cjs +73 -0
  428. package/dist/store-BLpJlMxz.js +257 -0
  429. package/dist/store-Btfrm2bs.cjs +47 -0
  430. package/dist/store-C5HvdLyc.js +42 -0
  431. package/dist/store-Wg8KVwNv.cjs +298 -0
  432. package/dist/store.cjs +9 -0
  433. package/dist/store.d.cts +26 -0
  434. package/dist/store.d.ts +26 -0
  435. package/dist/store.js +2 -0
  436. package/dist/stringify-state.cjs +48 -0
  437. package/dist/stringify-state.d.cts +8 -0
  438. package/dist/stringify-state.d.ts +8 -0
  439. package/dist/stringify-state.js +44 -0
  440. package/dist/tabbable-Bz1-1GAY.cjs +206 -0
  441. package/dist/tabbable-CDA1YMjZ.js +147 -0
  442. package/dist/text-selection-B3OQpQGy.cjs +75 -0
  443. package/dist/text-selection-DXvWvm6k.js +64 -0
  444. package/dist/timers-BRyPrXIX.js +82 -0
  445. package/dist/timers-Beu4SfAj.cjs +99 -0
  446. package/dist/tree-collection-3QX3EIhq.d.ts +77 -0
  447. package/dist/tree-collection-C6oDQGUJ.d.cts +77 -0
  448. package/dist/typeahead-DremEgML.d.cts +45 -0
  449. package/dist/typeahead-DremEgML.d.ts +45 -0
  450. package/dist/types-BFuHIo7S.js +10 -0
  451. package/dist/types-CczqoQLL.d.cts +57 -0
  452. package/dist/types-CczqoQLL.d.ts +57 -0
  453. package/dist/types-CjocssbC.d.cts +13 -0
  454. package/dist/types-CjocssbC.d.ts +13 -0
  455. package/dist/types-D7oF7eWh.d.cts +54 -0
  456. package/dist/types-D7oF7eWh.d.ts +54 -0
  457. package/dist/types-HCvp3Bhv.cjs +21 -0
  458. package/dist/types.cjs +14 -0
  459. package/dist/types.d.cts +6 -0
  460. package/dist/types.d.ts +6 -0
  461. package/dist/types.js +12 -0
  462. package/dist/utils-BH-oBBz2.cjs +614 -0
  463. package/dist/utils-Cht5XaHf.js +267 -0
  464. package/dist/utils.cjs +95 -0
  465. package/dist/utils.d.cts +144 -0
  466. package/dist/utils.d.ts +144 -0
  467. package/dist/utils.js +7 -0
  468. package/dist/visually-hidden-BgSCFLz_.cjs +29 -0
  469. package/dist/visually-hidden-yDJ517KZ.js +18 -0
  470. package/dist/wait-for-3n85JcCU.d.cts +15 -0
  471. package/dist/wait-for-3n85JcCU.d.ts +15 -0
  472. package/dist/wait-for-CI5Ye-Lo.js +69 -0
  473. package/dist/wait-for-Db73VpZQ.cjs +86 -0
  474. package/dist/warning-CrzBpWT1.js +19 -0
  475. package/dist/warning-HAmFXLHm.cjs +42 -0
  476. package/package.json +349 -6
@@ -0,0 +1,855 @@
1
+ import { t as createAnatomy } from "../../create-anatomy-B2q3wiaw.js";
2
+ import { S as getWindow, f as queryAll, p as contains, z as dataAttr } from "../../dom-query-e7fh0TEH.js";
3
+ import { t as addDomEvent, v as isSelfTarget } from "../../event-bTItRgiw.js";
4
+ import { c as getTabbables } from "../../tabbable-CDA1YMjZ.js";
5
+ import { i as raf } from "../../raf-Dhvm7f1e.js";
6
+ import { n as navigate } from "../../navigate-CJOaL3vx.js";
7
+ import { n as visuallyHiddenStyle } from "../../visually-hidden-yDJ517KZ.js";
8
+ import { F as toPx, L as callAll, n as createSplitProps } from "../../utils-Cht5XaHf.js";
9
+ import { n as ensureProps } from "../../warning-CrzBpWT1.js";
10
+ import { i as setup } from "../../core-CJ0MZr3D.js";
11
+ import { n as trackDismissableElement } from "../../dismissable-KM1jPtNQ.js";
12
+ import { t as createProps } from "../../create-props-CgtcN_Qu.js";
13
+ //#region src/machines/navigation-menu/anatomy.ts
14
+ const anatomy = createAnatomy("navigation-menu").parts("root", "viewportPositioner", "viewport", "trigger", "content", "list", "item", "link", "indicator", "itemIndicator", "arrow");
15
+ const parts = anatomy.build();
16
+ //#endregion
17
+ //#region src/machines/navigation-menu/dom.ts
18
+ const getRootId = (ctx) => ctx.ids?.root ?? `navigation-menu:${ctx.id}`;
19
+ const getTriggerId = (ctx, value) => ctx.ids?.trigger?.(value) ?? `navigation-menu:${ctx.id}:trigger:${value}`;
20
+ const getTriggerProxyId = (ctx, value) => ctx.ids?.triggerProxy?.(value) ?? `navigation-menu:${ctx.id}:trigger-proxy:${value}`;
21
+ const getContentId = (ctx, value) => ctx.ids?.content?.(value) ?? `navigation-menu:${ctx.id}:content:${value}`;
22
+ const getViewportId = (ctx) => ctx.ids?.viewport ?? `navigation-menu:${ctx.id}:viewport`;
23
+ const getListId = (ctx) => ctx.ids?.list ?? `navigation-menu:${ctx.id}:list`;
24
+ const getItemId = (ctx, value) => ctx.ids?.item?.(value) ?? `navigation-menu:${ctx.id}:item:${value}`;
25
+ const getRootEl = (ctx) => ctx.getById(getRootId(ctx));
26
+ const getViewportEl = (ctx) => ctx.getById(getViewportId(ctx));
27
+ const getTriggerEl = (ctx, value) => {
28
+ if (!value) return null;
29
+ return ctx.getById(getTriggerId(ctx, value));
30
+ };
31
+ const getTriggerProxyEl = (ctx, value) => {
32
+ if (!value) return null;
33
+ return ctx.getById(getTriggerProxyId(ctx, value));
34
+ };
35
+ const getListEl = (ctx) => ctx.getById(getListId(ctx));
36
+ const getContentEl = (ctx, value) => {
37
+ if (!value) return null;
38
+ return ctx.getById(getContentId(ctx, value));
39
+ };
40
+ const getContentEls = (ctx) => queryAll(ctx.getDoc(), `[data-scope=navigation-menu][data-part=content][data-uid='${ctx.id}']`);
41
+ const getTabbableEls = (ctx, value) => {
42
+ return getTabbables(getContentEl(ctx, value));
43
+ };
44
+ const getTriggerEls = (ctx) => queryAll(getListEl(ctx), `[data-part=trigger][data-uid='${ctx.id}']`);
45
+ const getLinkEls = (ctx, value) => {
46
+ return queryAll(getContentEl(ctx, value), `[data-part=link][data-ownedby="${getContentId(ctx, value)}"]`);
47
+ };
48
+ const getElements = (ctx) => {
49
+ const topLevelTriggerSelector = `[data-part=trigger][data-uid='${ctx.id}']:not([data-disabled])`;
50
+ return queryAll(getListEl(ctx), `${topLevelTriggerSelector}, [data-part=item] > [data-part=link]`);
51
+ };
52
+ function trackResizeObserver(element, onResize) {
53
+ if (!element.length) return;
54
+ let frame = 0;
55
+ const obs = new (getWindow(element[0])).ResizeObserver(() => {
56
+ cancelAnimationFrame(frame);
57
+ frame = requestAnimationFrame(onResize);
58
+ });
59
+ element.forEach((el) => {
60
+ if (el) obs.observe(el);
61
+ });
62
+ return () => {
63
+ cancelAnimationFrame(frame);
64
+ element.forEach((el) => {
65
+ if (el) obs.unobserve(el);
66
+ });
67
+ };
68
+ }
69
+ function setMotionAttr(scope, value, previousValue) {
70
+ const triggers = getTriggerEls(scope);
71
+ const dir = triggers[0].dir;
72
+ let values = triggers.map((trigger) => trigger.getAttribute("data-value"));
73
+ if (dir === "rtl") values.reverse();
74
+ const index = values.indexOf(value);
75
+ const prevIndex = values.indexOf(previousValue);
76
+ getContentEls(scope).forEach((contentEl) => {
77
+ const itemValue = contentEl.dataset.value;
78
+ const selected = value === itemValue;
79
+ const prevSelected = prevIndex === values.indexOf(itemValue);
80
+ if (!selected && !prevSelected) {
81
+ delete contentEl.dataset.motion;
82
+ return;
83
+ }
84
+ const attribute = (() => {
85
+ if (index !== prevIndex) {
86
+ if (selected && prevIndex !== -1) return index > prevIndex ? "from-end" : "from-start";
87
+ if (prevSelected && index !== -1) return index > prevIndex ? "to-start" : "to-end";
88
+ }
89
+ return null;
90
+ })();
91
+ if (attribute) contentEl.dataset.motion = attribute;
92
+ else delete contentEl.dataset.motion;
93
+ });
94
+ }
95
+ function focusFirst(scope, candidates) {
96
+ const previouslyFocusedElement = scope.getActiveElement();
97
+ return candidates.some((candidate) => {
98
+ if (candidate === previouslyFocusedElement) return true;
99
+ candidate.focus();
100
+ return scope.getActiveElement() !== previouslyFocusedElement;
101
+ });
102
+ }
103
+ function removeFromTabOrder(candidates) {
104
+ candidates.forEach((candidate) => {
105
+ candidate.dataset.tabindex = candidate.getAttribute("tabindex") || "";
106
+ candidate.setAttribute("tabindex", "-1");
107
+ });
108
+ return () => {
109
+ candidates.forEach((candidate) => {
110
+ const prevTabIndex = candidate.dataset.tabindex;
111
+ candidate.setAttribute("tabindex", prevTabIndex);
112
+ });
113
+ };
114
+ }
115
+ //#endregion
116
+ //#region src/machines/navigation-menu/connect.ts
117
+ function connect(service, normalize) {
118
+ const { context, send, prop, scope } = service;
119
+ const translations = prop("translations");
120
+ const triggerRect = context.get("triggerRect");
121
+ const viewportSize = context.get("viewportSize");
122
+ const viewportPosition = context.get("viewportPosition");
123
+ const value = context.get("value");
124
+ const previousValue = context.get("previousValue");
125
+ const open = Boolean(value);
126
+ const isViewportRendered = context.get("isViewportRendered");
127
+ const preventTransition = value && !previousValue;
128
+ function getItemState(props) {
129
+ const selected = value === props.value;
130
+ const wasSelected = !value && previousValue === props.value;
131
+ return {
132
+ itemId: getItemId(scope, props.value),
133
+ triggerId: getTriggerId(scope, props.value),
134
+ triggerProxyId: getTriggerProxyId(scope, props.value),
135
+ contentId: getContentId(scope, props.value),
136
+ selected,
137
+ wasSelected,
138
+ open: selected || wasSelected,
139
+ disabled: !!props.disabled
140
+ };
141
+ }
142
+ return {
143
+ open,
144
+ value,
145
+ orientation: prop("orientation"),
146
+ isViewportRendered,
147
+ getViewportNode() {
148
+ return getViewportEl(scope);
149
+ },
150
+ setValue(value) {
151
+ send({
152
+ type: "VALUE.SET",
153
+ value
154
+ });
155
+ },
156
+ reposition() {
157
+ send({ type: "VIEWPORT.POSITION" });
158
+ },
159
+ getRootProps() {
160
+ return normalize.element({
161
+ ...parts.root.attrs,
162
+ id: getRootId(scope),
163
+ "aria-label": translations?.rootLabel,
164
+ "data-orientation": prop("orientation"),
165
+ dir: prop("dir"),
166
+ style: {
167
+ "--trigger-width": toPx(triggerRect?.width),
168
+ "--trigger-height": toPx(triggerRect?.height),
169
+ "--trigger-x": toPx(triggerRect?.x),
170
+ "--trigger-y": toPx(triggerRect?.y),
171
+ "--viewport-width": toPx(viewportSize?.width),
172
+ "--viewport-height": toPx(viewportSize?.height),
173
+ "--viewport-x": toPx(viewportPosition?.x),
174
+ "--viewport-y": toPx(viewportPosition?.y)
175
+ }
176
+ });
177
+ },
178
+ getListProps() {
179
+ return normalize.element({
180
+ ...parts.list.attrs,
181
+ id: getListId(scope),
182
+ dir: prop("dir"),
183
+ "data-orientation": prop("orientation"),
184
+ style: { position: "relative" }
185
+ });
186
+ },
187
+ getItemProps(props) {
188
+ const itemState = getItemState(props);
189
+ return normalize.element({
190
+ ...parts.item.attrs,
191
+ id: itemState.itemId,
192
+ dir: prop("dir"),
193
+ "data-value": props.value,
194
+ "data-state": itemState.open ? "open" : "closed",
195
+ "data-orientation": prop("orientation"),
196
+ "data-disabled": dataAttr(itemState.disabled),
197
+ onKeyDown(event) {
198
+ switch (event.key) {
199
+ case "ArrowDown":
200
+ case "ArrowUp":
201
+ case "ArrowLeft":
202
+ case "ArrowRight":
203
+ case "Home":
204
+ case "End":
205
+ send({
206
+ type: "ITEM.NAVIGATE",
207
+ value: props.value,
208
+ key: event.key
209
+ });
210
+ event.preventDefault();
211
+ event.stopPropagation();
212
+ break;
213
+ default: break;
214
+ }
215
+ }
216
+ });
217
+ },
218
+ getIndicatorProps() {
219
+ return normalize.element({
220
+ ...parts.indicator.attrs,
221
+ "aria-hidden": true,
222
+ dir: prop("dir"),
223
+ hidden: !open,
224
+ "data-state": open ? "open" : "closed",
225
+ "data-orientation": prop("orientation"),
226
+ style: {
227
+ position: "absolute",
228
+ transition: preventTransition ? "none" : void 0
229
+ }
230
+ });
231
+ },
232
+ getArrowProps() {
233
+ return normalize.element({
234
+ ...parts.arrow.attrs,
235
+ "aria-hidden": true,
236
+ dir: prop("dir"),
237
+ "data-orientation": prop("orientation")
238
+ });
239
+ },
240
+ getTriggerProps(props) {
241
+ const itemState = getItemState(props);
242
+ return normalize.button({
243
+ ...parts.trigger.attrs,
244
+ id: itemState.triggerId,
245
+ "data-uid": prop("id"),
246
+ "data-trigger-proxy-id": getTriggerProxyId(scope, props.value),
247
+ dir: prop("dir"),
248
+ disabled: itemState.disabled,
249
+ "data-value": props.value,
250
+ "data-state": itemState.selected ? "open" : "closed",
251
+ "data-disabled": dataAttr(itemState.disabled),
252
+ "aria-controls": itemState.contentId,
253
+ "aria-expanded": itemState.selected,
254
+ onPointerEnter(event) {
255
+ if (prop("disableHoverTrigger")) return;
256
+ if (event.pointerType !== "mouse") return;
257
+ if (itemState.disabled) return;
258
+ send({
259
+ type: "TRIGGER.POINTERENTER",
260
+ value: props.value
261
+ });
262
+ },
263
+ onPointerLeave(event) {
264
+ if (prop("disableHoverTrigger")) return;
265
+ if (event.pointerType !== "mouse") return;
266
+ if (itemState.disabled) return;
267
+ send({
268
+ type: "TRIGGER.POINTERLEAVE",
269
+ value: props.value
270
+ });
271
+ },
272
+ onClick() {
273
+ if (prop("disableClickTrigger")) return;
274
+ send({
275
+ type: "TRIGGER.CLICK",
276
+ value: props.value
277
+ });
278
+ },
279
+ onKeyDown(event) {
280
+ const entryKey = {
281
+ horizontal: "ArrowDown",
282
+ vertical: prop("dir") === "rtl" ? "ArrowLeft" : "ArrowRight"
283
+ }[prop("orientation")];
284
+ if (open && event.key === entryKey) {
285
+ send({
286
+ type: "CONTENT.FOCUS",
287
+ side: "start"
288
+ });
289
+ event.preventDefault();
290
+ event.stopPropagation();
291
+ return;
292
+ }
293
+ const elements = getElements(scope);
294
+ const currentElement = event.currentTarget;
295
+ const nextElement = navigate(elements, currentElement, {
296
+ key: event.key,
297
+ orientation: prop("orientation"),
298
+ dir: prop("dir"),
299
+ loop: false
300
+ });
301
+ if (nextElement) {
302
+ nextElement.focus();
303
+ event.preventDefault();
304
+ event.stopPropagation();
305
+ }
306
+ }
307
+ });
308
+ },
309
+ getTriggerProxyProps(props) {
310
+ const itemState = getItemState(props);
311
+ return normalize.element({
312
+ "aria-hidden": true,
313
+ tabIndex: 0,
314
+ "data-trigger-proxy": "",
315
+ id: itemState.triggerProxyId,
316
+ "data-trigger-id": itemState.triggerId,
317
+ hidden: !itemState.selected,
318
+ style: visuallyHiddenStyle,
319
+ onFocus(event) {
320
+ const contentEl = getContentEl(scope, props.value);
321
+ if (!contentEl) return;
322
+ const prevFocusedEl = event.relatedTarget;
323
+ const wasTriggerFocused = prevFocusedEl === getTriggerEl(scope, props.value);
324
+ const wasFocusFromContent = contains(contentEl, prevFocusedEl);
325
+ if (wasTriggerFocused || !wasFocusFromContent) send({
326
+ type: "CONTENT.FOCUS",
327
+ side: wasTriggerFocused ? "start" : "end"
328
+ });
329
+ }
330
+ });
331
+ },
332
+ getViewportProxyProps(props) {
333
+ if (!getItemState(props).selected || !isViewportRendered) return { hidden: true };
334
+ return normalize.element({ "aria-owns": getContentId(scope, props.value) });
335
+ },
336
+ getLinkProps(props) {
337
+ const { closeOnClick = true } = props;
338
+ return normalize.element({
339
+ ...parts.link.attrs,
340
+ dir: prop("dir"),
341
+ "data-value": props.value,
342
+ "data-current": dataAttr(props.current),
343
+ "aria-current": props.current ? "page" : void 0,
344
+ "data-ownedby": getContentId(scope, props.value),
345
+ onClick(event) {
346
+ const target = event.currentTarget;
347
+ const win = getWindow(target);
348
+ const onSelect = props.onSelect;
349
+ target.addEventListener("link.select", onSelect, { once: true });
350
+ const linkSelectEvent = new win.CustomEvent("link.select", {
351
+ bubbles: true,
352
+ cancelable: true,
353
+ detail: { originalEvent: event }
354
+ });
355
+ target.dispatchEvent(linkSelectEvent);
356
+ if (closeOnClick && !linkSelectEvent.defaultPrevented && !event.metaKey) send({ type: "CLOSE" });
357
+ },
358
+ onKeyDown(event) {
359
+ const currentElement = event.currentTarget;
360
+ const nextElement = navigate(currentElement.closest("[data-scope=\"navigation-menu\"][data-part=\"content\"]") ? getLinkEls(scope, props.value) : getElements(scope), currentElement, {
361
+ key: event.key,
362
+ orientation: prop("orientation"),
363
+ dir: prop("dir"),
364
+ loop: false
365
+ });
366
+ if (nextElement) {
367
+ nextElement.focus();
368
+ event.preventDefault();
369
+ event.stopPropagation();
370
+ }
371
+ }
372
+ });
373
+ },
374
+ getContentProps(props) {
375
+ const itemState = getItemState(props);
376
+ const currentValue = context.get("value") || context.get("previousValue");
377
+ const selected = isViewportRendered ? currentValue === props.value : itemState.selected;
378
+ return normalize.element({
379
+ ...parts.content.attrs,
380
+ id: itemState.contentId,
381
+ dir: prop("dir"),
382
+ hidden: !selected,
383
+ "aria-labelledby": itemState.triggerId,
384
+ "data-uid": prop("id"),
385
+ "data-state": selected ? "open" : "closed",
386
+ "data-orientation": prop("orientation"),
387
+ "data-value": props.value,
388
+ onPointerEnter(event) {
389
+ if (event.pointerType !== "mouse") return;
390
+ send({
391
+ type: "CONTENT.POINTERENTER",
392
+ value: props.value
393
+ });
394
+ },
395
+ onPointerLeave(event) {
396
+ if (event.pointerType !== "mouse") return;
397
+ send({
398
+ type: "CONTENT.POINTERLEAVE",
399
+ value: props.value
400
+ });
401
+ },
402
+ onKeyDown(event) {
403
+ if (event.defaultPrevented) return;
404
+ if (event.currentTarget.closest("[data-scope=navigation-menu][data-part=root]") !== getRootEl(scope)) return;
405
+ const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
406
+ const isTabKey = event.key === "Tab" && !isMetaKey;
407
+ const candidates = getTabbables(event.currentTarget);
408
+ if (isTabKey) {
409
+ const focusedElement = scope.getActiveElement();
410
+ const index = candidates.findIndex((candidate) => candidate === focusedElement);
411
+ const nextCandidates = event.shiftKey ? candidates.slice(0, index).reverse() : candidates.slice(index + 1, candidates.length);
412
+ if (focusFirst(scope, nextCandidates)) event.preventDefault();
413
+ else {
414
+ getTriggerProxyEl(scope, props.value)?.focus();
415
+ return;
416
+ }
417
+ }
418
+ if (!isSelfTarget(event)) return;
419
+ const el = navigate(candidates, scope.getActiveElement(), {
420
+ key: event.key,
421
+ dir: prop("dir"),
422
+ loop: false
423
+ });
424
+ if (el) {
425
+ el.focus();
426
+ event.preventDefault();
427
+ event.stopPropagation();
428
+ }
429
+ }
430
+ });
431
+ },
432
+ getViewportPositionerProps(props = {}) {
433
+ const { align = "center" } = props;
434
+ return normalize.element({
435
+ ...parts.viewportPositioner.attrs,
436
+ dir: prop("dir"),
437
+ "data-orientation": prop("orientation"),
438
+ "data-align": align
439
+ });
440
+ },
441
+ getViewportProps(props = {}) {
442
+ const { align = "center" } = props;
443
+ const open = Boolean(value);
444
+ return normalize.element({
445
+ ...parts.viewport.attrs,
446
+ id: getViewportId(scope),
447
+ dir: prop("dir"),
448
+ hidden: !open,
449
+ "data-state": open ? "open" : "closed",
450
+ "data-orientation": prop("orientation"),
451
+ "data-align": align,
452
+ style: {
453
+ transition: preventTransition ? "none" : void 0,
454
+ pointerEvents: !open ? "none" : void 0,
455
+ "--viewport-width": toPx(viewportSize?.width),
456
+ "--viewport-height": toPx(viewportSize?.height),
457
+ "--viewport-x": toPx(viewportPosition?.x),
458
+ "--viewport-y": toPx(viewportPosition?.y)
459
+ },
460
+ onPointerEnter() {
461
+ send({ type: "CONTENT.POINTERENTER" });
462
+ },
463
+ onPointerLeave(event) {
464
+ if (prop("disablePointerLeaveClose")) return;
465
+ if (event.pointerType !== "mouse") return;
466
+ send({ type: "CONTENT.POINTERLEAVE" });
467
+ }
468
+ });
469
+ },
470
+ getItemState,
471
+ getItemIndicatorProps(props) {
472
+ const itemState = getItemState(props);
473
+ return normalize.element({
474
+ ...parts.itemIndicator.attrs,
475
+ "aria-hidden": true,
476
+ dir: prop("dir"),
477
+ hidden: !itemState.selected,
478
+ "data-state": itemState.selected ? "open" : "closed",
479
+ "data-orientation": prop("orientation"),
480
+ "data-value": props.value
481
+ });
482
+ }
483
+ };
484
+ }
485
+ //#endregion
486
+ //#region src/machines/navigation-menu/utils.ts
487
+ function setCloseTimeout(refs, context, prop) {
488
+ clearCloseTimeout(refs);
489
+ const closeTimeoutId = window.setTimeout(() => {
490
+ context.set("value", "");
491
+ }, prop("closeDelay"));
492
+ refs.set("closeTimeoutId", closeTimeoutId);
493
+ }
494
+ function clearCloseTimeout(refs) {
495
+ const closeTimeoutId = refs.get("closeTimeoutId");
496
+ if (closeTimeoutId) {
497
+ clearTimeout(closeTimeoutId);
498
+ refs.set("closeTimeoutId", null);
499
+ }
500
+ }
501
+ function setOpenTimeout(refs, value, timeoutId) {
502
+ const openTimeoutIds = refs.get("openTimeoutIds");
503
+ refs.set("openTimeoutIds", {
504
+ ...openTimeoutIds,
505
+ [value]: timeoutId
506
+ });
507
+ }
508
+ function clearOpenTimeout(refs, value) {
509
+ const openTimeoutIds = refs.get("openTimeoutIds");
510
+ const timeoutId = openTimeoutIds[value];
511
+ if (timeoutId) {
512
+ clearTimeout(timeoutId);
513
+ const { [value]: _, ...rest } = openTimeoutIds;
514
+ refs.set("openTimeoutIds", rest);
515
+ }
516
+ }
517
+ function clearAllOpenTimeouts(refs) {
518
+ const openTimeoutIds = refs.get("openTimeoutIds");
519
+ Object.values(openTimeoutIds).forEach((timeoutId) => {
520
+ if (timeoutId) clearTimeout(timeoutId);
521
+ });
522
+ refs.set("openTimeoutIds", {});
523
+ }
524
+ //#endregion
525
+ //#region src/machines/navigation-menu/machine.ts
526
+ const { createMachine } = setup();
527
+ const machine = createMachine({
528
+ props({ props }) {
529
+ ensureProps(props, ["id"]);
530
+ return {
531
+ dir: "ltr",
532
+ openDelay: 200,
533
+ closeDelay: 300,
534
+ orientation: "horizontal",
535
+ defaultValue: "",
536
+ ...props
537
+ };
538
+ },
539
+ context({ prop, bindable }) {
540
+ return {
541
+ value: bindable(() => ({
542
+ defaultValue: prop("defaultValue"),
543
+ value: prop("value"),
544
+ sync: true,
545
+ onChange(value) {
546
+ prop("onValueChange")?.({ value });
547
+ }
548
+ })),
549
+ previousValue: bindable(() => ({
550
+ defaultValue: "",
551
+ sync: true
552
+ })),
553
+ viewportSize: bindable(() => ({
554
+ defaultValue: null,
555
+ sync: true
556
+ })),
557
+ isViewportRendered: bindable(() => ({ defaultValue: false })),
558
+ viewportPosition: bindable(() => ({ defaultValue: null })),
559
+ contentNode: bindable(() => ({ defaultValue: null })),
560
+ triggerRect: bindable(() => ({
561
+ defaultValue: null,
562
+ sync: true
563
+ })),
564
+ triggerNode: bindable(() => ({ defaultValue: null }))
565
+ };
566
+ },
567
+ computed: { open: ({ context }) => context.get("value") != null },
568
+ watch({ track, action, context }) {
569
+ track([() => context.get("value")], () => {
570
+ action([
571
+ "restoreTabOrder",
572
+ "setTriggerNode",
573
+ "syncContentNode",
574
+ "syncMotionAttribute"
575
+ ]);
576
+ });
577
+ },
578
+ refs() {
579
+ return {
580
+ restoreContentTabOrder: void 0,
581
+ contentResizeObserverCleanup: void 0,
582
+ contentDismissableCleanup: void 0,
583
+ contentExitCompleteCleanup: void 0,
584
+ triggerResizeObserverCleanup: void 0,
585
+ closeTimeoutId: null,
586
+ openTimeoutIds: {}
587
+ };
588
+ },
589
+ entry: ["checkViewportNode"],
590
+ exit: ["cleanupObservers"],
591
+ effects: ["trackDocumentResize"],
592
+ initialState() {
593
+ return "idle";
594
+ },
595
+ on: {
596
+ "VALUE.SET": { actions: ["setValue"] },
597
+ "VIEWPORT.POSITION": { actions: ["setViewportPosition"] },
598
+ "TRIGGER.POINTERENTER": { actions: ["clearCloseTimeout", "setValueWithDelay"] },
599
+ "TRIGGER.POINTERLEAVE": [{ actions: ["setCloseTimeout", "resetValueWithDelay"] }],
600
+ "TRIGGER.CLICK": [{
601
+ guard: "isItemOpen",
602
+ actions: ["deselectValue"]
603
+ }, { actions: ["selectValue"] }],
604
+ "CONTENT.FOCUS": { actions: ["restoreTabOrder", "focusFirstTabbableEl"] },
605
+ "CONTENT.BLUR": { actions: ["removeFromTabOrder"] },
606
+ "CONTENT.POINTERENTER": { actions: ["clearCloseTimeout"] },
607
+ "CONTENT.POINTERLEAVE": { actions: ["setCloseTimeout"] },
608
+ "ITEM.NAVIGATE": { actions: ["focusNextLink"] },
609
+ "ITEM.CLOSE": { actions: ["focusTrigger", "deselectValue"] },
610
+ CLOSE: { actions: [
611
+ "clearAllOpenTimeouts",
612
+ "deselectValue",
613
+ "focusTriggerIfNeeded",
614
+ "removeFromTabOrder"
615
+ ] }
616
+ },
617
+ states: { idle: {} },
618
+ implementations: {
619
+ guards: { isItemOpen: ({ context, event }) => context.get("value") === event.value },
620
+ effects: { trackDocumentResize({ scope, send }) {
621
+ return trackResizeObserver([scope.getDoc().body, getRootEl(scope)], () => {
622
+ send({ type: "VIEWPORT.POSITION" });
623
+ });
624
+ } },
625
+ actions: {
626
+ setValue({ context, event }) {
627
+ context.set("value", event.value);
628
+ },
629
+ clearCloseTimeout({ refs }) {
630
+ clearCloseTimeout(refs);
631
+ },
632
+ clearAllOpenTimeouts({ refs }) {
633
+ clearAllOpenTimeouts(refs);
634
+ },
635
+ setCloseTimeout({ refs, context, prop }) {
636
+ setCloseTimeout(refs, context, prop);
637
+ },
638
+ resetValueWithDelay({ event, refs }) {
639
+ clearOpenTimeout(refs, event.value);
640
+ },
641
+ setValueWithDelay({ event, prop, context, refs }) {
642
+ const shouldSkipDelay = context.get("value") !== "";
643
+ const openTimeoutId = window.setTimeout(() => {
644
+ setTimeout(() => {
645
+ context.set("previousValue", context.get("value"));
646
+ context.set("value", event.value);
647
+ });
648
+ }, shouldSkipDelay ? 0 : prop("openDelay"));
649
+ setOpenTimeout(refs, event.value, openTimeoutId);
650
+ },
651
+ selectValue: ({ context, event }) => {
652
+ context.set("previousValue", context.get("value"));
653
+ context.set("value", event.value);
654
+ },
655
+ deselectValue: ({ context }) => {
656
+ context.set("value", "");
657
+ context.set("previousValue", "");
658
+ },
659
+ syncContentNode({ context, scope, refs, send }) {
660
+ refs.get("contentResizeObserverCleanup")?.();
661
+ refs.get("contentDismissableCleanup")?.();
662
+ refs.get("contentExitCompleteCleanup")?.();
663
+ const previousValue = context.get("previousValue");
664
+ if (previousValue) {
665
+ const previousContentEl = getContentEl(scope, previousValue);
666
+ const viewportEl = getViewportEl(scope);
667
+ if (previousContentEl) {
668
+ const onExitComplete = () => context.set("previousValue", "");
669
+ refs.set("contentExitCompleteCleanup", callAll(addDomEvent(previousContentEl, "exitcomplete", onExitComplete), addDomEvent(viewportEl, "exitcomplete", onExitComplete)));
670
+ }
671
+ }
672
+ const contentEl = getContentEl(scope, context.get("value"));
673
+ if (!contentEl) return;
674
+ context.set("contentNode", contentEl);
675
+ if (context.get("isViewportRendered")) {
676
+ const contentResizeObserver = trackResizeObserver([contentEl], () => {
677
+ const contentEl = getContentEl(scope, context.get("value"));
678
+ if (!contentEl) return;
679
+ context.set("viewportSize", {
680
+ width: contentEl.offsetWidth,
681
+ height: contentEl.offsetHeight
682
+ });
683
+ send({ type: "VIEWPORT.POSITION" });
684
+ });
685
+ refs.set("contentResizeObserverCleanup", contentResizeObserver);
686
+ }
687
+ const getContentEl$1 = () => {
688
+ return getViewportEl(scope) || getContentEl(scope, context.get("value"));
689
+ };
690
+ const contentDismissable = trackDismissableElement(getContentEl$1, {
691
+ defer: true,
692
+ onFocusOutside(event) {
693
+ const target = event.detail.target;
694
+ if (target.matches("[data-scope=navigation-menu][data-part=trigger]") || target.matches("[data-trigger-proxy]")) event.preventDefault();
695
+ if (!event.defaultPrevented) {
696
+ send({ type: "CONTENT.BLUR" });
697
+ if (contains(getRootEl(scope), target)) event.preventDefault();
698
+ }
699
+ },
700
+ onPointerDownOutside(event) {
701
+ const target = event.detail.target;
702
+ if (!event.defaultPrevented) {
703
+ const isTrigger = getTriggerEls(scope).some((node) => node.contains(target));
704
+ const isRootViewport = contains(getViewportEl(scope), target);
705
+ if (isTrigger || isRootViewport) event.preventDefault();
706
+ }
707
+ },
708
+ onDismiss() {
709
+ send({
710
+ type: "CLOSE",
711
+ value: context.get("value")
712
+ });
713
+ }
714
+ });
715
+ refs.set("contentDismissableCleanup", contentDismissable);
716
+ },
717
+ setTriggerNode({ context, scope, refs }) {
718
+ refs.get("triggerResizeObserverCleanup")?.();
719
+ const node = getTriggerEl(scope, context.get("value"));
720
+ if (!node) return;
721
+ context.set("triggerNode", node);
722
+ const exec = () => {
723
+ const rect = {
724
+ x: node.offsetLeft,
725
+ y: node.offsetTop,
726
+ width: node.offsetWidth,
727
+ height: node.offsetHeight
728
+ };
729
+ context.set("triggerRect", rect);
730
+ };
731
+ const triggerResizeObserver = trackResizeObserver([node, getListEl(scope)], exec);
732
+ refs.set("triggerResizeObserverCleanup", triggerResizeObserver);
733
+ },
734
+ syncMotionAttribute({ context, scope }) {
735
+ if (!context.get("isViewportRendered")) return;
736
+ setMotionAttr(scope, context.get("value"), context.get("previousValue"));
737
+ },
738
+ focusFirstTabbableEl({ event, scope, context }) {
739
+ raf(() => {
740
+ const value = event.value || context.get("value");
741
+ const candidates = getTabbableEls(scope, value);
742
+ const elements = event.side === "start" ? candidates : candidates.reverse();
743
+ if (elements.length) focusFirst(scope, elements);
744
+ });
745
+ },
746
+ focusNextLink({ event, scope }) {
747
+ const activeEl = scope.getActiveElement();
748
+ const linkEls = getLinkEls(scope, event.value);
749
+ if (activeEl == null || !linkEls.includes(activeEl)) return;
750
+ navigate(linkEls, activeEl, {
751
+ key: event.key,
752
+ loop: false
753
+ })?.focus();
754
+ },
755
+ focusTrigger({ scope, event, context }) {
756
+ const value = event.value ?? context.get("value");
757
+ getTriggerEl(scope, value)?.focus();
758
+ },
759
+ focusTriggerIfNeeded({ event, scope }) {
760
+ const value = event.value;
761
+ if (!contains(getContentEl(scope, value), scope.getActiveElement())) return;
762
+ getTriggerEl(scope, value)?.focus();
763
+ },
764
+ removeFromTabOrder({ event, scope, refs, context }) {
765
+ const value = event.value ?? context.get("value");
766
+ const candidates = getTabbableEls(scope, value);
767
+ if (candidates.length) refs.set("restoreContentTabOrder", removeFromTabOrder(candidates));
768
+ },
769
+ restoreTabOrder({ refs }) {
770
+ refs.get("restoreContentTabOrder")?.();
771
+ },
772
+ cleanupObservers({ refs }) {
773
+ refs.get("contentResizeObserverCleanup")?.();
774
+ refs.get("contentDismissableCleanup")?.();
775
+ refs.get("triggerResizeObserverCleanup")?.();
776
+ refs.get("restoreContentTabOrder")?.();
777
+ refs.get("contentExitCompleteCleanup")?.();
778
+ },
779
+ checkViewportNode({ context, scope }) {
780
+ context.set("isViewportRendered", !!getViewportEl(scope));
781
+ },
782
+ setViewportPosition({ context, scope }) {
783
+ const triggerNode = context.get("triggerNode");
784
+ const contentNode = context.get("contentNode");
785
+ const rootEl = getRootEl(scope);
786
+ const doc = scope.getDoc();
787
+ const align = getViewportEl(scope)?.dataset.align || "center";
788
+ if (contentNode && triggerNode && rootEl) {
789
+ const bodyWidth = doc.documentElement.offsetWidth;
790
+ const bodyHeight = doc.documentElement.offsetHeight;
791
+ const rootRect = rootEl.getBoundingClientRect();
792
+ const triggerRect = triggerNode.getBoundingClientRect();
793
+ const { offsetWidth, offsetHeight } = contentNode;
794
+ const startPositionLeft = triggerRect.left - rootRect.left;
795
+ const startPositionTop = triggerRect.top - rootRect.top;
796
+ let x = null;
797
+ let y = null;
798
+ switch (align) {
799
+ case "start":
800
+ x = startPositionLeft;
801
+ y = startPositionTop;
802
+ break;
803
+ case "end":
804
+ x = startPositionLeft - offsetWidth + triggerRect.width;
805
+ y = startPositionTop - offsetHeight + triggerRect.height;
806
+ break;
807
+ default:
808
+ x = startPositionLeft - offsetWidth / 2 + triggerRect.width / 2;
809
+ y = startPositionTop - offsetHeight / 2 + triggerRect.height / 2;
810
+ }
811
+ const screenOffset = 10;
812
+ if (x + rootRect.left < screenOffset) x = screenOffset - rootRect.left;
813
+ const rightOffset = x + rootRect.left + offsetWidth;
814
+ if (rightOffset > bodyWidth - screenOffset) {
815
+ x -= rightOffset - bodyWidth + screenOffset;
816
+ if (x < screenOffset - rootRect.left) x = screenOffset - rootRect.left;
817
+ }
818
+ if (y + rootRect.top < screenOffset) y = screenOffset - rootRect.top;
819
+ const bottomOffset = y + rootRect.top + offsetHeight;
820
+ if (bottomOffset > bodyHeight - screenOffset) {
821
+ y -= bottomOffset - bodyHeight + screenOffset;
822
+ if (y < screenOffset - rootRect.top) y = screenOffset - rootRect.top;
823
+ }
824
+ x = Math.round(x);
825
+ y = Math.round(y);
826
+ context.set("viewportPosition", {
827
+ x,
828
+ y
829
+ });
830
+ }
831
+ }
832
+ }
833
+ }
834
+ });
835
+ //#endregion
836
+ //#region src/machines/navigation-menu/props.ts
837
+ const props = createProps()([
838
+ "id",
839
+ "dir",
840
+ "getRootNode",
841
+ "value",
842
+ "defaultValue",
843
+ "onValueChange",
844
+ "openDelay",
845
+ "closeDelay",
846
+ "orientation",
847
+ "ids",
848
+ "disableClickTrigger",
849
+ "disableHoverTrigger",
850
+ "disablePointerLeaveClose",
851
+ "translations"
852
+ ]);
853
+ const splitProps = createSplitProps(props);
854
+ //#endregion
855
+ export { anatomy, connect, machine, props, splitProps };