@astryx-vue/core 0.25.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-Cub9_aPC.js → AlertDialog-CGGkPG4T.js} +192 -6
  3. package/dist/AppShell/index.d.ts +1 -1
  4. package/dist/AppShell/index.js +1 -1
  5. package/dist/{AppShell-D62A7lqZ.js → AppShell-DGJgCvS6.js} +6 -6
  6. package/dist/Avatar/index.js +1 -1
  7. package/dist/{Avatar-BKoSK75s.js → Avatar-DpFHPRlE.js} +1 -1
  8. package/dist/AvatarGroup/index.d.ts +1 -1
  9. package/dist/Badge/index.d.ts +1 -2
  10. package/dist/Banner/index.d.ts +1 -1
  11. package/dist/Banner/index.js +1 -1
  12. package/dist/{Banner-cg2nXT_4.js → Banner-DVU5-fWC.js} +1 -1
  13. package/dist/BottomSheet/index.js +2 -2
  14. package/dist/{BottomSheet-DGhRZLw4.js → BottomSheet-Dn8gpT4m.js} +9 -6
  15. package/dist/{BottomSheet-CpLYy3vb.js → BottomSheet-gctYQ3sV.js} +2 -2
  16. package/dist/Breadcrumbs/index.js +2 -2
  17. package/dist/{Breadcrumbs-D-nHDHV8.js → Breadcrumbs-BZsjHn_5.js} +1 -1
  18. package/dist/Button/index.d.ts +1 -1
  19. package/dist/Button/index.js +1 -1
  20. package/dist/{Button-D8AGK5oT.js → Button-yJiHoWps.js} +1 -1
  21. package/dist/ButtonGroup/index.d.ts +1 -1
  22. package/dist/Calendar/index.d.ts +1 -1
  23. package/dist/Card/index.d.ts +1 -1
  24. package/dist/Carousel/index.d.ts +1 -1
  25. package/dist/Carousel/index.js +1 -1
  26. package/dist/{Carousel-DrCG9wbP.js → Carousel-DPhwOTjx.js} +1 -1
  27. package/dist/Center/index.d.ts +1 -1
  28. package/dist/Chat/index.d.ts +1 -1
  29. package/dist/Chat/index.js +1 -1
  30. package/dist/{Chat-U1qq8gkF.js → Chat-RE_6Ez79.js} +206 -44
  31. package/dist/CheckboxInput/index.d.ts +1 -1
  32. package/dist/CheckboxInput/index.js +1 -1
  33. package/dist/{CheckboxInput-qm6lkjAw.js → CheckboxInput-C-UseBJo.js} +5 -5
  34. package/dist/CheckboxList/index.d.ts +1 -1
  35. package/dist/CheckboxList/index.js +1 -1
  36. package/dist/{CheckboxList-DuCKhJHJ.js → CheckboxList-CWHlG8Jq.js} +4 -4
  37. package/dist/ClickableCard/index.d.ts +1 -1
  38. package/dist/Code/index.d.ts +1 -1
  39. package/dist/Code/index.js +1 -1
  40. package/dist/{CodeBlock-PMZd9dQ9.js → CodeBlock-3QLhu3jZ.js} +1 -1
  41. package/dist/Collapsible/index.d.ts +1 -1
  42. package/dist/Collapsible/index.js +1 -1
  43. package/dist/{Collapsible-BmUloCSR.js → Collapsible-BSRdsb6w.js} +3 -3
  44. package/dist/CommandPalette/index.d.ts +1 -1
  45. package/dist/CommandPalette/index.js +1 -1
  46. package/dist/{CommandPalette-Cy7trpD3.js → CommandPalette-CtY5ZCR7.js} +50 -20
  47. package/dist/ComplexSelector/index.d.ts +1 -1
  48. package/dist/ComplexSelector/index.js +1 -1
  49. package/dist/{ComplexSelector-DMBiVQWp.js → ComplexSelector-DI3J30Ho.js} +4 -4
  50. package/dist/ContextMenu/index.d.ts +1 -1
  51. package/dist/ContextMenu/index.js +2 -2
  52. package/dist/{ContextMenu-63ay7EE-.js → ContextMenu-CVf4OqJP.js} +4 -4
  53. package/dist/DateInput/index.d.ts +1 -1
  54. package/dist/DateInput/index.js +1 -1
  55. package/dist/{DateInput-B3Q91FDT.js → DateInput-DK-FI37x.js} +14 -33
  56. package/dist/DateRangeInput/index.d.ts +1 -1
  57. package/dist/DateRangeInput/index.js +1 -1
  58. package/dist/{DateRangeInput-B6Z66OsH.js → DateRangeInput-ClriBc4F.js} +6 -6
  59. package/dist/DateTimeInput/index.d.ts +1 -1
  60. package/dist/DateTimeInput/index.js +1 -1
  61. package/dist/{DateTimeInput-B_7cn7ze.js → DateTimeInput-BdXkBBYi.js} +7 -7
  62. package/dist/Dialog/index.d.ts +1 -1
  63. package/dist/Dialog/index.js +3 -3
  64. package/dist/{Dialog-CBPD5b-S.js → Dialog-CKDlXonX.js} +1 -1
  65. package/dist/{Dialog-C4FZ7p7Q.js → Dialog-DjhG_vpE.js} +3 -3
  66. package/dist/{DialogHeader-CQ3pnLYi.js → DialogHeader-C1Bz4Knk.js} +2 -2
  67. package/dist/Divider/index.d.ts +1 -1
  68. package/dist/Drawer/index.d.ts +1 -1
  69. package/dist/Drawer/index.js +1 -1
  70. package/dist/{Drawer-BOwQLKm9.js → Drawer-BqcPP0z7.js} +2 -2
  71. package/dist/DropdownMenu/index.js +3 -3
  72. package/dist/{DropdownMenu-9CR9TiKG.js → DropdownMenu-CdwEvDld.js} +3 -3
  73. package/dist/{DropdownMenu-DwIfoTnV.js → DropdownMenu-q5euMYv-.js} +40 -11
  74. package/dist/EmptyState/index.js +1 -1
  75. package/dist/{EmptyState-BG5g2jwJ.js → EmptyState-DNjqNAT3.js} +4 -50
  76. package/dist/Field/index.d.ts +3 -3
  77. package/dist/Field/index.js +3 -3
  78. package/dist/{Field-eAowUUMX.js → Field-DrUMz0oj.js} +2 -2
  79. package/dist/{FieldInfoTip-Dwl9HNp1.js → FieldInfoTip-DmDOcxU1.js} +1 -1
  80. package/dist/{FieldLabel-CgYk-ORu.js → FieldLabel-DsFZnW1l.js} +3 -3
  81. package/dist/FieldStatus/index.d.ts +1 -1
  82. package/dist/FileInput/index.d.ts +1 -1
  83. package/dist/FileInput/index.js +1 -1
  84. package/dist/{FileInput-B7zeePbM.js → FileInput-0u4zjJfx.js} +135 -85
  85. package/dist/FormLayout/index.js +1 -1
  86. package/dist/{FormLayout-CGJVeNsL.js → FormLayout-0_X9o-L4.js} +1 -1
  87. package/dist/Heading/index.js +1 -1
  88. package/dist/{Heading-B1dNZQtu.js → Heading-BG1PBVkf.js} +1 -1
  89. package/dist/HoverCard/index.d.ts +1 -1
  90. package/dist/HoverCard/index.js +1 -1
  91. package/dist/{HoverCard-CZhfsvP4.js → HoverCard-Fr6RLRR8.js} +2 -2
  92. package/dist/IconButton/index.js +1 -1
  93. package/dist/{IconButton-D9ZRJ7vD.js → IconButton-CEjiXpUg.js} +1 -1
  94. package/dist/Indicator/index.d.ts +2 -2
  95. package/dist/InfoTip/index.d.ts +1 -1
  96. package/dist/InfoTip/index.js +1 -1
  97. package/dist/{InfoTip-LJi9llxi.js → InfoTip-CKRaCO6I.js} +1 -1
  98. package/dist/{InputClearButton-C-j9Nf1s.js → InputClearButton-ByUJXRmY.js} +1 -1
  99. package/dist/InputGroup/index.d.ts +1 -1
  100. package/dist/InputGroup/index.js +1 -1
  101. package/dist/{InputGroup-B8PGJZKH.js → InputGroup-H8DP0TAG.js} +6 -6
  102. package/dist/InternationalizationProvider/index.d.ts +1 -1
  103. package/dist/InternationalizationProvider/index.js +1 -1
  104. package/dist/{InternationalizationProvider-DaZS5Dch.js → InternationalizationProvider-8qllKdVk.js} +1 -1
  105. package/dist/Layout/index.js +2 -2
  106. package/dist/{Layout-DOIeCgs4.js → Layout-094k14rN.js} +1 -1
  107. package/dist/{LayoutPanel-C7Wsid2W.js → LayoutPanel-BPboQAJj.js} +1 -1
  108. package/dist/Lightbox/index.js +1 -1
  109. package/dist/{Lightbox-BOWTHnTb.js → Lightbox-LI6h7LFn.js} +3 -3
  110. package/dist/Link/index.d.ts +1 -1
  111. package/dist/Link/index.js +1 -1
  112. package/dist/{Link-B75ygGzG.js → Link-Dx2ql41g.js} +1 -1
  113. package/dist/List/index.d.ts +1 -1
  114. package/dist/Markdown/index.d.ts +1 -1
  115. package/dist/Markdown/index.js +1 -1
  116. package/dist/{Markdown-Cqrcj-ct.js → Markdown-BHWf2IOO.js} +3 -3
  117. package/dist/MetadataList/index.d.ts +1 -1
  118. package/dist/MobileNav/index.js +1 -1
  119. package/dist/{MobileNavToggle-DLpEONfs.js → MobileNavToggle-Dx7rmb-V.js} +3 -3
  120. package/dist/MoreMenu/index.d.ts +1 -1
  121. package/dist/MoreMenu/index.js +1 -1
  122. package/dist/{MoreMenu-aR88r9xp.js → MoreMenu-DAq29azZ.js} +3 -3
  123. package/dist/MultiSelector/index.d.ts +1 -1
  124. package/dist/MultiSelector/index.js +1 -1
  125. package/dist/{MultiSelector-UTaDe-YT.js → MultiSelector-BUXFzIla.js} +8 -8
  126. package/dist/NavItem/index.d.ts +1 -1
  127. package/dist/NavMenu/index.js +2 -2
  128. package/dist/{NavMenu-DS6y8ZAY.js → NavMenu-BoKuJq-K.js} +1 -1
  129. package/dist/{NavMenuItem-BqIi3o3D.js → NavMenuItem-Ez3_K8iI.js} +1 -1
  130. package/dist/NumberInput/index.d.ts +2 -2
  131. package/dist/NumberInput/index.js +1 -1
  132. package/dist/{NumberInput-ClkOGF5j.js → NumberInput-lqUmTsqB.js} +386 -99
  133. package/dist/OverflowList/index.d.ts +1 -1
  134. package/dist/OverflowList/index.js +1 -1
  135. package/dist/{OverflowList-UnVXBDIW.js → OverflowList-B6En7wIj.js} +1 -1
  136. package/dist/Overlay/index.d.ts +1 -1
  137. package/dist/Pagination/index.d.ts +1 -1
  138. package/dist/Pagination/index.js +1 -1
  139. package/dist/{Pagination-CTCLE02h.js → Pagination-CRrou1P-.js} +60 -49
  140. package/dist/Popover/index.d.ts +3 -3
  141. package/dist/Popover/index.js +1 -1
  142. package/dist/Popover-sERt08TR.js +1247 -0
  143. package/dist/PowerSearch/index.d.ts +1 -1
  144. package/dist/PowerSearch/index.js +1 -1
  145. package/dist/{PowerSearch-BBOum0TP.js → PowerSearch-CiVIW13b.js} +230 -143
  146. package/dist/ProgressBar/index.d.ts +1 -1
  147. package/dist/ProgressBar/index.js +1 -1
  148. package/dist/{ProgressBar-Bgg6zsKR.js → ProgressBar-yw2BCtB_.js} +1 -1
  149. package/dist/Radio/index.d.ts +1 -1
  150. package/dist/Radio/index.js +1 -1
  151. package/dist/{RadioGroup-DPy5JQhm.js → RadioGroup-B8QoJyJu.js} +5 -5
  152. package/dist/RadioList/index.d.ts +1 -1
  153. package/dist/RadioList/index.js +1 -1
  154. package/dist/{RadioList-UN7IxQg8.js → RadioList-BEv82wbs.js} +1 -1
  155. package/dist/ScrollableArea/index.d.ts +1 -1
  156. package/dist/SelectableCard/index.d.ts +1 -1
  157. package/dist/Selector/index.d.ts +1 -1
  158. package/dist/Selector/index.js +1 -1
  159. package/dist/{Selector-CCtsUveZ.js → Selector-Bj4q6aT5.js} +6 -6
  160. package/dist/SideNav/index.d.ts +1 -1
  161. package/dist/SideNav/index.js +2 -2
  162. package/dist/{SideNav-COl5ApOz.js → SideNav-CHSwzwTt.js} +7 -7
  163. package/dist/Slider/index.d.ts +1 -1
  164. package/dist/Slider/index.js +1 -1
  165. package/dist/{Slider-CYie9hWm.js → Slider-Bmksx8ng.js} +4 -4
  166. package/dist/Stack/index.d.ts +1 -1
  167. package/dist/StatusDot/index.js +1 -1
  168. package/dist/{StatusDot-CHfgSYmv.js → StatusDot-Bz4l43St.js} +1 -1
  169. package/dist/Stepper/index.d.ts +1 -1
  170. package/dist/Switch/index.d.ts +1 -1
  171. package/dist/Switch/index.js +1 -1
  172. package/dist/{Switch-D24CvhDS.js → Switch-CeNEvvTn.js} +5 -5
  173. package/dist/TabList/index.d.ts +1 -1
  174. package/dist/TabList/index.js +1 -1
  175. package/dist/{TabList-DToCh5JW.js → TabList-BLLxHXwu.js} +1 -1
  176. package/dist/Table/index.d.ts +1 -1
  177. package/dist/Table/index.js +1 -1
  178. package/dist/{Table-D3mzxBr0.js → Table-DEqfIA3q.js} +16 -16
  179. package/dist/Text/index.js +1 -1
  180. package/dist/{Text-5p-eZodt.js → Text-DkSHitKh.js} +1 -1
  181. package/dist/TextArea/index.d.ts +1 -1
  182. package/dist/TextArea/index.js +1 -1
  183. package/dist/{TextArea-Bp6D-riO.js → TextArea-CAcjMvls.js} +56 -22
  184. package/dist/TextInput/index.d.ts +1 -1
  185. package/dist/TextInput/index.js +1 -1
  186. package/dist/{TextInput-BYslwBDZ.js → TextInput-BvQQTG75.js} +78 -34
  187. package/dist/Theme/index.d.ts +2 -2
  188. package/dist/Thumbnail/index.js +1 -1
  189. package/dist/{Thumbnail-B_a8tOS7.js → Thumbnail-Bv-M13fy.js} +2 -2
  190. package/dist/{TimeField-MDSJny9m.js → TimeField-hB88chlQ.js} +13 -32
  191. package/dist/TimeInput/index.d.ts +1 -1
  192. package/dist/TimeInput/index.js +1 -1
  193. package/dist/{TimeInput-B19amuxi.js → TimeInput-JrTs9r66.js} +3 -3
  194. package/dist/Timer/index.js +1 -1
  195. package/dist/{Timer-BD3tfzrF.js → Timer-qjI_QrCz.js} +1 -1
  196. package/dist/Timestamp/index.d.ts +1 -1
  197. package/dist/Timestamp/index.js +1 -1
  198. package/dist/{Timestamp-CqWoZUKM.js → Timestamp-CJ_HUcek.js} +3 -3
  199. package/dist/Toast/index.js +1 -1
  200. package/dist/{Toast-BKPl8iIr.js → Toast-CFpOSuAr.js} +1 -1
  201. package/dist/ToggleButton/index.d.ts +1 -1
  202. package/dist/ToggleButton/index.js +1 -1
  203. package/dist/{ToggleButton-DfpsuhMa.js → ToggleButton-BtXMvoOA.js} +1 -1
  204. package/dist/Token/index.d.ts +1 -1
  205. package/dist/Tokenizer/index.d.ts +1 -1
  206. package/dist/Tokenizer/index.js +1 -1
  207. package/dist/{Tokenizer-C-eorFsF.js → Tokenizer-2zj57yDt.js} +4 -4
  208. package/dist/Toolbar/index.d.ts +1 -1
  209. package/dist/Tooltip/index.d.ts +1 -1
  210. package/dist/Tooltip/index.js +2 -2
  211. package/dist/{Tooltip-88zhGfzF.js → Tooltip-ByLqPCP7.js} +1 -1
  212. package/dist/TopNav/index.d.ts +1 -1
  213. package/dist/TopNav/index.js +1 -1
  214. package/dist/{TopNav-DMFIsFwy.js → TopNav-Ce79A3zT.js} +3 -3
  215. package/dist/TreeList/index.d.ts +1 -1
  216. package/dist/TreeList/index.js +1 -1
  217. package/dist/{TreeList-nU2gSmQm.js → TreeList-BEPHdVYu.js} +2 -2
  218. package/dist/Typeahead/index.d.ts +2 -2
  219. package/dist/Typeahead/index.js +1 -1
  220. package/dist/{Typeahead-DUQfmy_r.js → Typeahead-CBrUdbHv.js} +4 -4
  221. package/dist/{types-fRasDCe4.d.ts → adaptationTypes-Cn_pfrsw.d.ts} +155 -155
  222. package/dist/animator-BooLoGyI.js +3164 -0
  223. package/dist/announceRenderedText-CslZ0cev.js +50 -0
  224. package/dist/{assertOptions-DVRsfCk1.js → assertOptions-CJgNig1l.js} +2 -2
  225. package/dist/{batch-DR5SgbnX.js → batch-CM-vJhQg.js} +2 -278
  226. package/dist/{handle-ma1yF_B_.js → bezier-Cts7gENO.js} +1 -21
  227. package/dist/composables/index.d.ts +2 -2
  228. package/dist/composables/index.js +7 -7
  229. package/dist/{composables-Do86VAmM.js → composables-BtqijTIO.js} +5 -3163
  230. package/dist/{context-DsNhYm5O.js → context-CrVCeUUK.js} +1 -1
  231. package/dist/context-DH8E-qjm.js +173 -0
  232. package/dist/{edge-qfeek_VV.js → edge-BYXwSggM.js} +1 -1
  233. package/dist/{edgeRide-iWUNdlxe.js → edgeRide-B5mlN2Q4.js} +3 -3
  234. package/dist/escape-DzSxSmez.js +10 -0
  235. package/dist/{field-CehUqCe0.js → field-BaUBjqf5.js} +4 -2
  236. package/dist/{fieldParts-CbWvZLhH.js → fieldParts-CuE5V12i.js} +1 -1
  237. package/dist/{focusLeaving-Dqm8Yj4T.js → focusLeaving-DMkbxFkF.js} +1 -1
  238. package/dist/{focusReturn-C1cFL3WM.js → focusReturn-DfZS7TCp.js} +1 -1
  239. package/dist/handle-BazRxHwq.js +22 -0
  240. package/dist/holdEntranceInput-DMCOeRqu.js +37 -0
  241. package/dist/{index-CsYDrQ9R.d.ts → index-668zPVsH.d.ts} +1 -1
  242. package/dist/{index-CnVjgLP5.d.ts → index-B5aHF0Ml.d.ts} +1 -2
  243. package/dist/{index-CuW4AQ7M.d.ts → index-BD-Pxni9.d.ts} +3 -3
  244. package/dist/{index-DDAcxZAP.d.ts → index-BZUVNr2c.d.ts} +1 -1
  245. package/dist/{index-B52PMrO7.d.ts → index-BdhQpERn.d.ts} +7 -7
  246. package/dist/{index-CEjvYAUZ.d.ts → index-BenG-F5d.d.ts} +1 -1
  247. package/dist/{index-CTjkJP4x.d.ts → index-Bgk1Rj2A.d.ts} +1 -1
  248. package/dist/{index-Qdbssopn.d.ts → index-BjqoHLMq.d.ts} +4 -1
  249. package/dist/{index-BDZCJ9ri.d.ts → index-BuubzuE8.d.ts} +2 -2
  250. package/dist/{index-ChqMaV6N.d.ts → index-Bzi3A980.d.ts} +1 -1
  251. package/dist/{index-0RIgvtdm.d.ts → index-C2zWUiJ1.d.ts} +2 -2
  252. package/dist/{index-CKnr0JlT.d.ts → index-C4S65SAW.d.ts} +1 -1
  253. package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
  254. package/dist/{index-CiVrhGUJ.d.ts → index-C9ZssPUV.d.ts} +1 -1
  255. package/dist/{index-ZKBj_1nu.d.ts → index-CB6VQETg.d.ts} +2 -2
  256. package/dist/{index-BfoazhEu.d.ts → index-CTXG-KKT.d.ts} +1 -1
  257. package/dist/{index-mK1ICsVg.d.ts → index-Cm36VS1A.d.ts} +2 -2
  258. package/dist/{index-_FjbcSgD.d.ts → index-CnOH43-f.d.ts} +1 -2
  259. package/dist/index-CuFLztiI.d.ts +49 -0
  260. package/dist/{index-QnlWyUxN.d.ts → index-D14kSf-g.d.ts} +4 -4
  261. package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
  262. package/dist/index-DHUCHxn2.d.ts +69 -0
  263. package/dist/{index-GmoeIuhl.d.ts → index-DMZ5SKJJ.d.ts} +35 -3
  264. package/dist/{index-CO9GW-ik.d.ts → index-DPklTi3o.d.ts} +1 -1
  265. package/dist/{index-Dcxqzk_d.d.ts → index-DSMv6W8s.d.ts} +8 -8
  266. package/dist/{index-BjmMJ_4E.d.ts → index-DY1kpap1.d.ts} +1657 -275
  267. package/dist/{index-DxR6cZBf.d.ts → index-DZCpswvp.d.ts} +1 -1
  268. package/dist/{index-BhdxP-OG.d.ts → index-DeZ11MNP.d.ts} +2 -2
  269. package/dist/{index-lmd9LZKB.d.ts → index-DlKz3dB1.d.ts} +6 -3
  270. package/dist/{index-CbA8rR_b.d.ts → index-FeZXsFO-.d.ts} +2 -2
  271. package/dist/{index-CH-xSiJz.d.ts → index-LqFjvL4C.d.ts} +4 -4
  272. package/dist/{index-utZGF4GR.d.ts → index-NOXYEdOI.d.ts} +1 -1
  273. package/dist/{index-DofC9Rll.d.ts → index-Otl047R1.d.ts} +1 -1
  274. package/dist/{index-DCyYldjP.d.ts → index-T5bzxQ30.d.ts} +1 -1
  275. package/dist/{index-COgrQZIL.d.ts → index-YKCx03zD.d.ts} +2 -2
  276. package/dist/{index-BKnyTWPM.d.ts → index-ZbNwGVkS.d.ts} +1 -1
  277. package/dist/{index-DGXCnzOL.d.ts → index-aHC2C89h.d.ts} +1 -1
  278. package/dist/{index-DYabo8TI.d.ts → index-eCp-ElSp.d.ts} +1 -1
  279. package/dist/{index-yQc-te9a.d.ts → index-ql9ApSTF.d.ts} +2 -2
  280. package/dist/{index-0pBqcQXV.d.ts → index-tpkJfk6X.d.ts} +6 -1
  281. package/dist/index.d.ts +49 -52
  282. package/dist/index.js +90 -90
  283. package/dist/{holdEntranceInput-DjEzfGRU.js → inputHold-BmChuR9x.js} +87 -85
  284. package/dist/inputHoldState-pblUT4oh.js +39 -0
  285. package/dist/{interactionModality-CedLz5PC.js → interactionModality-4Km2ibsq.js} +4 -3
  286. package/dist/{landing-qVsYAZ-v.js → landing-B9Uvex6x.js} +3 -2
  287. package/dist/{layerFocusReturn-KvH6DMFT.js → layerFocusReturn-CEvrMbxH.js} +1 -1
  288. package/dist/lazyBottomSheet-CxEu25bK.js +16 -0
  289. package/dist/{loadCatalog-BeQt6Uq-.js → loadCatalog-BRd5XCbW.js} +24 -1
  290. package/dist/{loadCatalog-C8mRnC0E.d.ts → loadCatalog-CLm4V7mm.d.ts} +100 -2
  291. package/dist/locale/index.d.ts +2 -3
  292. package/dist/locale/index.js +3 -3
  293. package/dist/{locale-B4FpGKpc.js → locale-BkAezFog.js} +1 -1
  294. package/dist/{useHeldPresentation-fQsuYFhz.js → presentationHold-7IkbR4d8.js} +14 -22
  295. package/dist/progress-FQfSgLZC.js +38 -0
  296. package/dist/renderedText-BwJdmps3.js +32 -0
  297. package/dist/textEntryTraits-cb0LZSNl.js +11 -0
  298. package/dist/themeTiming-CWEvdh31.js +287 -0
  299. package/dist/{tooltipFocusRules-CFNKWzYn.js → tooltipFocusRules-DvVDuqZI.js} +1 -1
  300. package/dist/{context-WY1ippwe.js → transientCopy-VAsg2a46.js} +1 -172
  301. package/dist/{types-OGMYGejX.d.ts → types-BA1veIoa.d.ts} +25 -2
  302. package/dist/{types-bAQk3F8G.d.ts → types-Cvh2VwQZ.d.ts} +4 -2
  303. package/dist/{types-C1ydeFiu.d.ts → types-DL-hRibg.d.ts} +1 -1
  304. package/dist/{useChatStreamScroll-BIMKffDA.js → useChatStreamScroll-Cv51kRT0.js} +91 -30
  305. package/dist/useEntryErrorReport-Wee3N8IA.js +51 -0
  306. package/dist/{useFocusTrap-DTz_d7IP.js → useFocusTrap-BD9POtMp.js} +2 -2
  307. package/dist/useHeldPresentation-7MH-RlSF.js +24 -0
  308. package/dist/{useInputStatusIcon-B6m_t8cK.d.ts → useInputStatusIcon-CFkOmDS4.d.ts} +1 -1
  309. package/dist/{useInputStatusIcon-BFw-EXjJ.js → useInputStatusIcon-CGj9gMj8.js} +1 -1
  310. package/dist/{useMenuDrillIn-CDn2na4X.js → useMenuDrillIn-CP0P49ej.js} +1 -1
  311. package/dist/{useMenuPress-CxUqSUZ9.js → useMenuPress-DU6pAIHy.js} +4 -2
  312. package/dist/{useRestoreFocus-BxooFhas.js → useRestoreFocus-AeZABFZN.js} +2 -2
  313. package/dist/{useTooltip-CJHbG8Pv.js → useTooltip-Bsm43vbi.js} +5 -35
  314. package/dist/{useTouchTriggerInternal-Bdm_M4aa.js → useTouchTriggerInternal-Bl602PtA.js} +1 -1
  315. package/dist/{useTruncationTooltip-BTcr1LCR.js → useTruncationTooltip-wc6Lzz34.js} +3 -3
  316. package/package.json +1 -1
  317. package/styles/alert-dialog.css +5 -0
  318. package/styles/chat.css +45 -17
  319. package/styles/command-palette.css +9 -6
  320. package/styles/dropdown-menu.css +47 -38
  321. package/styles/file-input.css +8 -1
  322. package/styles/input-group.css +0 -15
  323. package/styles/number-input.css +49 -4
  324. package/styles/pagination.css +0 -22
  325. package/styles/popover.css +13 -0
  326. package/styles/text-area.css +16 -1
  327. package/styles/text-input.css +26 -5
  328. package/dist/Popover-CZvRSqqD.js +0 -374
  329. package/dist/index-B63NOJRc.d.ts +0 -957
  330. package/dist/index-B9WzWqzk.d.ts +0 -18
  331. package/dist/index-BtgkNd0Q.d.ts +0 -446
  332. package/dist/power-search-CuMzfLwW.d.ts +0 -87
  333. package/dist/types-DIYwbkpe.d.ts +0 -33
  334. package/dist/{index-CHx33xGa.d.ts → index-J6YRJ7Ul.d.ts} +1 -1
@@ -0,0 +1,1247 @@
1
+ import { t as createMotionEngine } from "./animator-BooLoGyI.js";
2
+ import { t as _sfc_main$2 } from "./Button-yJiHoWps.js";
3
+ import { r as useResolvedLayerTeleport } from "./useLayerMountTarget-BmZyeKWE.js";
4
+ import { r as layerEntranceSide, t as useDismiss } from "./useDismiss-C7_S7qUA.js";
5
+ import { n as useLayer } from "./tooltipTriggerRules-DyPyWOdP.js";
6
+ import { t as _sfc_main$3 } from "./LayerContentBoundary-LCQLyxBT.js";
7
+ import { t as isCoarsePointer } from "./coarsePointer-BfMx3H23.js";
8
+ import { n as readThemeTimingOrInstant } from "./themeTiming-CWEvdh31.js";
9
+ import { a as restoreScrollOffsets, n as isCopyable, r as keepInherited, t as inertCopy } from "./transientCopy-VAsg2a46.js";
10
+ import { n as focusElement, r as getFocusables } from "./focus-x7mxEqjR.js";
11
+ import { a as inDocumentOrder } from "./focusRegion-CmDg7_4b.js";
12
+ import { t as useFocusTrap } from "./useFocusTrap-BD9POtMp.js";
13
+ import { o as useComponentMessages } from "./context-B8IEFCDR.js";
14
+ import { t as useMergedRefs } from "./useMergedRefs-DTGo1cEU.js";
15
+ import { t as holdInput } from "./inputHold-BmChuR9x.js";
16
+ import { n as restoreLayerFocus, r as trackLayerFocus, t as isLayerFocusStranded } from "./layerFocusReturn-CEvrMbxH.js";
17
+ import { t as useScrollbars } from "./useScrollbars-Ch0xqJWO.js";
18
+ import { n as mapRange, t as mapProgress } from "./progress-FQfSgLZC.js";
19
+ import { t as bottomSheetEscapeKey } from "./escape-DzSxSmez.js";
20
+ import { n as clampInlineSize, t as LAYER_MAX_INLINE_SIZE } from "./inlineSize-BNe8wggI.js";
21
+ import { i as useAdaptivePresentation, t as createPresentationHold } from "./presentationHold-7IkbR4d8.js";
22
+ import { n as preloadBottomSheet, t as LazyBottomSheet } from "./lazyBottomSheet-CxEu25bK.js";
23
+ import { t as popoverMessages } from "./popover-DxCyd_Ua.js";
24
+ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUpdated, openBlock, provide, ref, renderSlot, shallowRef, toValue, unref, useId, vShow, watch, withCtx, withDirectives } from "vue";
25
+ import "../styles/popover.css";
26
+ //#region src/Popover/initialFocus.ts
27
+ /** `element` 或它到 `container` 之间的某个祖先带着 `aria-disabled="true"`。 */
28
+ function isDisabledWithin(element, container) {
29
+ const disabled = element.closest("[aria-disabled=\"true\"]");
30
+ return disabled != null && container.contains(disabled);
31
+ }
32
+ /**
33
+ * 把 Tab 停靠点排在前面,各组内保持文档顺序。带漫游 tabindex 的复合控件(网格、工具栏)里,
34
+ * 拿着 `tabindex="0"` 的那个成员排在 `-1` 的成员前面。
35
+ */
36
+ function preferTabStops(elements) {
37
+ const isTabStop = (element) => element.getAttribute("tabindex") !== "-1";
38
+ return [...elements.filter(isTabStop), ...elements.filter((element) => !isTabStop(element))];
39
+ }
40
+ /**
41
+ * 弹层打开时初始焦点可以落的元素,按优先顺序排。
42
+ * 跳过组件自带的后备关闭按钮和禁用(`aria-disabled`)的控件:禁用的控件仍能用 Tab 走到,
43
+ * 但不该一打开就停在它上面。
44
+ */
45
+ function initialFocusCandidates(surface, skipSelector) {
46
+ return preferTabStops(inDocumentOrder(getFocusables(surface)).filter((element) => (skipSelector == null || element.closest(skipSelector) == null) && !isDisabledWithin(element, surface)));
47
+ }
48
+ //#endregion
49
+ //#region src/Popover/PopoverSheet.vue
50
+ const FALLBACK_CLOSE = "[data-astryx-popover-fallback-close]";
51
+ /** 底部弹层按需加载:第一次打开时面板可能晚几帧才挂上,最多等这么多帧。 */
52
+ const MAX_FOCUS_FRAMES = 30;
53
+ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
54
+ name: "AstryxPopoverSheet",
55
+ __name: "PopoverSheet",
56
+ props: {
57
+ id: {},
58
+ isOpen: { type: Boolean },
59
+ label: {},
60
+ padding: {},
61
+ hasEscapeDismiss: { type: Boolean },
62
+ hasCloseButton: { type: Boolean },
63
+ closeLabel: {}
64
+ },
65
+ emits: ["openChange", "motionComplete"],
66
+ setup(__props, { emit: __emit }) {
67
+ const props = __props;
68
+ const emit = __emit;
69
+ provide(bottomSheetEscapeKey, () => props.hasEscapeDismiss);
70
+ let frame = null;
71
+ function cancelFocus() {
72
+ if (frame != null) cancelAnimationFrame(frame);
73
+ frame = null;
74
+ }
75
+ /**
76
+ * 每次打开都把焦点送进内容,和锚定浮层一样:调用方的 `[data-autofocus]`,否则第一个
77
+ * 真正的内容控件(跳过后备关闭按钮),都没有就留在弹层自己的面板上。
78
+ */
79
+ function focusContent(framesLeft) {
80
+ frame = requestAnimationFrame(() => {
81
+ frame = null;
82
+ if (!props.isOpen) return;
83
+ const panel = document.getElementById(props.id);
84
+ const dialog = panel?.closest("dialog");
85
+ if (panel == null || dialog == null || !dialog.open) {
86
+ if (framesLeft > 0) focusContent(framesLeft - 1);
87
+ return;
88
+ }
89
+ const active = panel.ownerDocument.activeElement;
90
+ if (active != null && active !== panel && panel.contains(active) && active.closest(FALLBACK_CLOSE) == null) return;
91
+ const box = panel.querySelector(".astryx-bottom-sheet__content") ?? panel;
92
+ const autofocus = box.querySelector("[data-autofocus]");
93
+ if (autofocus != null && focusElement(autofocus)) return;
94
+ for (const candidate of initialFocusCandidates(box, FALLBACK_CLOSE)) if (focusElement(candidate)) return;
95
+ if (active !== panel) focusElement(panel);
96
+ });
97
+ }
98
+ watch(() => props.isOpen, (open) => {
99
+ cancelFocus();
100
+ if (open) nextTick(() => focusContent(MAX_FOCUS_FRAMES));
101
+ }, { immediate: true });
102
+ onBeforeUnmount(cancelFocus);
103
+ return (_ctx, _cache) => {
104
+ return openBlock(), createBlock(unref(LazyBottomSheet), {
105
+ id: __props.id,
106
+ "is-open": __props.isOpen,
107
+ label: __props.label,
108
+ height: "tall",
109
+ padding: __props.padding,
110
+ onOpenChange: _cache[1] || (_cache[1] = ($event) => emit("openChange", $event)),
111
+ onMotionComplete: _cache[2] || (_cache[2] = ($event) => emit("motionComplete", $event))
112
+ }, {
113
+ default: withCtx(() => [createVNode(_sfc_main$3, null, {
114
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
115
+ _: 3
116
+ }), __props.hasCloseButton ? (openBlock(), createBlock(unref(_sfc_main$2), {
117
+ key: 0,
118
+ class: "astryx-popover__sheet-close",
119
+ "data-astryx-popover-fallback-close": "",
120
+ variant: "secondary",
121
+ label: __props.closeLabel,
122
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("openChange", false))
123
+ }, null, 8, ["label"])) : createCommentVNode("v-if", true)]),
124
+ _: 3
125
+ }, 8, [
126
+ "id",
127
+ "is-open",
128
+ "label",
129
+ "padding"
130
+ ]);
131
+ };
132
+ }
133
+ });
134
+ //#endregion
135
+ //#region src/Popover/usePopover.ts
136
+ const GAP = 4;
137
+ /**
138
+ * 对应原版 Astryx 的 `hooks/usePopover`:点击触发、能把焦点管起来的浮层。
139
+ * 在 `useLayer` 之上叠了焦点陷阱、自动聚焦、点击外部 / Escape 关闭和 ARIA 关系,
140
+ * `Popover` 组件内部也用它。
141
+ *
142
+ * ```ts
143
+ * const { triggerRef, contentRef, contentStyle, surfaceProps } = usePopover({ dialogLabel: 'Actions' })
144
+ * ```
145
+ */
146
+ function usePopover(options = {}) {
147
+ return usePopoverSurface(options);
148
+ }
149
+ /** `usePopover` 加上 Popover 组件自己的扩展点(见 `PopoverSurfaceInternals`)。 */
150
+ function usePopoverSurface(options, internals = {}) {
151
+ const triggerRef = shallowRef(null);
152
+ const anchorRef = shallowRef(null);
153
+ const layer = useLayer({
154
+ mode: "context",
155
+ isDefaultOpen: toValue(options.isOpen) === true,
156
+ anchor: computed(() => anchorRef.value ?? triggerRef.value),
157
+ placement: () => toValue(options.placement) ?? "below",
158
+ alignment: () => toValue(options.alignment) ?? "start",
159
+ gap: GAP,
160
+ onShow: () => options.onShow?.(),
161
+ onHide: () => options.onHide?.()
162
+ });
163
+ const isOpen = layer.isOpen;
164
+ function role() {
165
+ return toValue(options.role) ?? "dialog";
166
+ }
167
+ function isModalDialog() {
168
+ return role() === "dialog" && (toValue(options.isModal) ?? true);
169
+ }
170
+ function isEnabled() {
171
+ return toValue(options.isEnabled) ?? true;
172
+ }
173
+ useFocusTrap({
174
+ container: layer.contentRef,
175
+ isEnabled: computed(() => isOpen.value && isModalDialog()),
176
+ initialFocus: () => {
177
+ const surface = layer.contentRef.value;
178
+ if (surface == null) return null;
179
+ if (!(toValue(options.hasAutoFocus) ?? true)) return surface.ownerDocument.activeElement;
180
+ return initialFocusCandidates(surface, options.closeButtonSelector)[0] ?? surface;
181
+ }
182
+ });
183
+ useDismiss({
184
+ container: layer.contentRef,
185
+ trigger: triggerRef,
186
+ isEnabled: computed(() => isOpen.value && ((toValue(options.hasLightDismiss) ?? true) || (toValue(options.hasEscapeDismiss) ?? true))),
187
+ dismissOnPointerOutside: () => toValue(options.hasLightDismiss) ?? true,
188
+ dismissOnOutsidePan: false,
189
+ dismissOnEscape: computed(() => toValue(options.hasEscapeDismiss) ?? true ? "close" : "block"),
190
+ onDismiss: () => layer.hide()
191
+ });
192
+ function setOpen(next) {
193
+ if (next) layer.show();
194
+ else layer.hide();
195
+ }
196
+ function toggle() {
197
+ setOpen(!isOpen.value);
198
+ }
199
+ function focusInitialTarget() {
200
+ const surface = layer.contentRef.value;
201
+ if (!surface || !isOpen.value) return;
202
+ const active = surface.ownerDocument.activeElement;
203
+ if (active != null && active !== surface && surface.contains(active)) return;
204
+ for (const candidate of initialFocusCandidates(surface, options.closeButtonSelector)) if (focusElement(candidate)) return;
205
+ if (role() === "dialog") focusElement(surface);
206
+ }
207
+ function onTriggerClick(event) {
208
+ if (!isEnabled()) return;
209
+ const target = event?.currentTarget;
210
+ if (target instanceof Element && target.getAttribute("aria-disabled") === "true") return;
211
+ if (internals.onTriggerPress?.(target instanceof HTMLElement ? target : triggerRef.value) === true) return;
212
+ toggle();
213
+ }
214
+ function onTriggerKeydown(event) {
215
+ if (event.key !== "Enter" && event.key !== " ") return;
216
+ event.preventDefault();
217
+ onTriggerClick(event);
218
+ }
219
+ let bound = null;
220
+ let haspopupBefore = null;
221
+ let expandedBefore = null;
222
+ let controlsBefore = null;
223
+ function applyTriggerAttributes() {
224
+ const element = triggerRef.value;
225
+ if (!element) return;
226
+ const sheet = internals.sheetTrigger?.() ?? null;
227
+ if (sheet != null) {
228
+ element.setAttribute("aria-haspopup", "dialog");
229
+ element.setAttribute("aria-expanded", String(sheet.expanded));
230
+ element.setAttribute("aria-controls", sheet.controls);
231
+ return;
232
+ }
233
+ element.setAttribute("aria-haspopup", role() === "dialog" ? "dialog" : "true");
234
+ element.setAttribute("aria-expanded", String(isOpen.value));
235
+ if (isOpen.value) element.setAttribute("aria-controls", layer.id);
236
+ else if (element === bound && controlsBefore) element.setAttribute("aria-controls", controlsBefore);
237
+ else element.removeAttribute("aria-controls");
238
+ }
239
+ function restoreTriggerAttributes() {
240
+ const element = bound;
241
+ if (!element) return;
242
+ if (haspopupBefore) element.setAttribute("aria-haspopup", haspopupBefore);
243
+ else element.removeAttribute("aria-haspopup");
244
+ if (expandedBefore) element.setAttribute("aria-expanded", expandedBefore);
245
+ else element.removeAttribute("aria-expanded");
246
+ if (controlsBefore) element.setAttribute("aria-controls", controlsBefore);
247
+ else element.removeAttribute("aria-controls");
248
+ }
249
+ function bind(element) {
250
+ if (bound === element) return;
251
+ unbind();
252
+ bound = element;
253
+ haspopupBefore = element.getAttribute("aria-haspopup");
254
+ expandedBefore = element.getAttribute("aria-expanded");
255
+ controlsBefore = element.getAttribute("aria-controls");
256
+ element.addEventListener("click", onTriggerClick);
257
+ if (element.tagName !== "BUTTON" && element.getAttribute("role") === "button") element.addEventListener("keydown", onTriggerKeydown);
258
+ applyTriggerAttributes();
259
+ }
260
+ function unbind() {
261
+ if (bound == null) return;
262
+ bound.removeEventListener("click", onTriggerClick);
263
+ bound.removeEventListener("keydown", onTriggerKeydown);
264
+ restoreTriggerAttributes();
265
+ bound = null;
266
+ haspopupBefore = null;
267
+ expandedBefore = null;
268
+ controlsBefore = null;
269
+ }
270
+ watch(triggerRef, (element) => {
271
+ if (element == null) unbind();
272
+ else bind(element);
273
+ }, { flush: "sync" });
274
+ let focusRecord = null;
275
+ function stopFocusRecord() {
276
+ focusRecord?.stop();
277
+ focusRecord = null;
278
+ }
279
+ watch(isOpen, (open) => {
280
+ if (open) {
281
+ stopFocusRecord();
282
+ focusRecord = trackLayerFocus({ getLayer: () => layer.contentRef.value });
283
+ return;
284
+ }
285
+ const record = focusRecord;
286
+ focusRecord = null;
287
+ if (record == null) return;
288
+ const surface = layer.contentRef.value;
289
+ if (isLayerFocusStranded(record, surface)) restoreLayerFocus(record, {
290
+ layer: surface,
291
+ trigger: triggerRef.value,
292
+ layerId: layer.id,
293
+ anchor: anchorRef.value,
294
+ name: "usePopover"
295
+ });
296
+ record.stop();
297
+ }, { flush: "sync" });
298
+ watch(isOpen, (open) => {
299
+ applyTriggerAttributes();
300
+ if (open && (toValue(options.hasAutoFocus) ?? true) && role() === "dialog") nextTick(focusInitialTarget);
301
+ }, { immediate: true });
302
+ if (internals.sheetTrigger != null) watch(internals.sheetTrigger, applyTriggerAttributes, { deep: true });
303
+ watch(() => toValue(options.isOpen), (open) => {
304
+ if (open === void 0) return;
305
+ layer.isOpen.value = open;
306
+ }, { immediate: true });
307
+ watch(() => toValue(options.isEnabled), (enabled) => {
308
+ if (!enabled && isOpen.value) setOpen(false);
309
+ });
310
+ onScopeDispose(() => {
311
+ unbind();
312
+ stopFocusRecord();
313
+ });
314
+ const surfaceProps = computed(() => {
315
+ const props = { id: layer.id };
316
+ if (role() !== "dialog") return props;
317
+ props.tabindex = -1;
318
+ if (isOpen.value) {
319
+ props.role = "dialog";
320
+ props["aria-label"] = toValue(options.dialogLabel);
321
+ if (toValue(options.isModal) ?? true) props["aria-modal"] = "true";
322
+ }
323
+ return props;
324
+ });
325
+ const triggerProps = computed(() => ({
326
+ "aria-haspopup": role() === "dialog" ? "dialog" : "true",
327
+ "aria-expanded": String(isOpen.value),
328
+ "aria-controls": isOpen.value ? layer.id : void 0
329
+ }));
330
+ return {
331
+ isOpen,
332
+ triggerRef,
333
+ anchorRef,
334
+ contentRef: layer.contentRef,
335
+ id: layer.id,
336
+ anchorId: layer.anchorId,
337
+ contentStyle: layer.contentStyle,
338
+ resolvedPlacement: layer.resolvedPlacement,
339
+ surfaceProps,
340
+ triggerProps,
341
+ show: () => setOpen(true),
342
+ hide: () => setOpen(false),
343
+ toggle
344
+ };
345
+ }
346
+ //#endregion
347
+ //#region src/Popover/usePopoverSheet.ts
348
+ /** 触发器自己的名字:`aria-label`,没有就用它的文字。 */
349
+ function readTriggerText(trigger) {
350
+ return trigger.getAttribute("aria-label")?.trim() || trigger.textContent?.trim() || "";
351
+ }
352
+ function usePopoverSheet(options) {
353
+ const live = useAdaptivePresentation(options.presentation);
354
+ const openState = shallowRef(false);
355
+ const controlledSurface = shallowRef(null);
356
+ const hasBeenOpen = shallowRef(false);
357
+ const triggerText = shallowRef("");
358
+ const isControlled = () => options.controlledOpen() !== void 0;
359
+ watch(options.controlledOpen, (open) => {
360
+ if (open !== true) controlledSurface.value = null;
361
+ else controlledSurface.value ??= options.isPopoverOpen() ? "popover" : live.value;
362
+ }, {
363
+ immediate: true,
364
+ flush: "sync"
365
+ });
366
+ const isOpen = computed(() => isControlled() ? options.controlledOpen() === true && controlledSurface.value === "bottom-sheet" : openState.value);
367
+ watch(isOpen, (open) => {
368
+ if (open) hasBeenOpen.value = true;
369
+ }, {
370
+ immediate: true,
371
+ flush: "sync"
372
+ });
373
+ const isMounted = computed(() => isOpen.value || hasBeenOpen.value || live.value === "bottom-sheet" && !options.isPopoverOpen());
374
+ watch(live, (surface) => {
375
+ if (surface === "bottom-sheet") preloadBottomSheet();
376
+ }, { immediate: true });
377
+ function setOpen(open) {
378
+ if (!isControlled()) openState.value = open;
379
+ options.onOpenChange(open);
380
+ }
381
+ return {
382
+ isOpen,
383
+ isMounted,
384
+ triggerText,
385
+ popoverControlledOpen: () => {
386
+ const open = options.controlledOpen();
387
+ return open === void 0 ? void 0 : open && controlledSurface.value === "popover";
388
+ },
389
+ setOpen,
390
+ onTriggerPress(trigger) {
391
+ if (!isOpen.value && (options.isPopoverOpen() || live.value !== "bottom-sheet")) return false;
392
+ if (trigger != null) triggerText.value = readTriggerText(trigger);
393
+ setOpen(!isOpen.value);
394
+ return true;
395
+ },
396
+ onMotionComplete(motion) {
397
+ if (motion === "exiting" && !isOpen.value) hasBeenOpen.value = false;
398
+ }
399
+ };
400
+ }
401
+ //#endregion
402
+ //#region src/motion/opacityFloor.ts
403
+ /**
404
+ * @file opacityFloor.ts
405
+ * @input None
406
+ * @output Exports `ENTRANCE_OPACITY_FLOOR`
407
+ * @position A motion constant for entrances that fade in from transparent as
408
+ * Web Animations
409
+ *
410
+ * Chromium skips drawing a layer at exactly opacity 0 as its animation starts.
411
+ * It rasterizes the layer again once the fade makes it visible, so the first
412
+ * frames show the layer without its content. An entrance that fades in from
413
+ * this floor draws its start frame. The floor is a quarter of one step of an
414
+ * 8-bit channel, so it changes no pixel.
415
+ */
416
+ /** The lowest opacity a compositor entrance fades in from. */
417
+ const ENTRANCE_OPACITY_FLOOR = .001;
418
+ //#endregion
419
+ //#region src/layer/settledBox.ts
420
+ const IDENTITY = [
421
+ 1,
422
+ 0,
423
+ 0,
424
+ 1,
425
+ 0,
426
+ 0
427
+ ];
428
+ const isSet = (value) => value !== "" && value !== "none";
429
+ function multiply(m, n) {
430
+ return [
431
+ m[0] * n[0] + m[2] * n[1],
432
+ m[1] * n[0] + m[3] * n[1],
433
+ m[0] * n[2] + m[2] * n[3],
434
+ m[1] * n[2] + m[3] * n[3],
435
+ m[0] * n[4] + m[2] * n[5] + m[4],
436
+ m[1] * n[4] + m[3] * n[5] + m[5]
437
+ ];
438
+ }
439
+ /** 元素自己的变换,按 translate、scale、transform 的顺序合成;算不了时为 null。 */
440
+ function ownTransform(style) {
441
+ let matrix = IDENTITY;
442
+ const translate = style.getPropertyValue("translate");
443
+ if (isSet(translate)) {
444
+ const parts = translate.trim().split(/\s+/);
445
+ if (parts.length > 2 || !parts.every((part) => part.endsWith("px"))) return null;
446
+ matrix = multiply(matrix, [
447
+ 1,
448
+ 0,
449
+ 0,
450
+ 1,
451
+ Number.parseFloat(parts[0]),
452
+ Number.parseFloat(parts[1] ?? "0")
453
+ ]);
454
+ }
455
+ if (isSet(style.getPropertyValue("rotate"))) return null;
456
+ const scale = style.getPropertyValue("scale");
457
+ if (isSet(scale)) {
458
+ const parts = scale.trim().split(/\s+/);
459
+ if (parts.length > 2) return null;
460
+ const x = Number.parseFloat(parts[0]);
461
+ const y = Number.parseFloat(parts[1] ?? parts[0]);
462
+ matrix = multiply(matrix, [
463
+ x,
464
+ 0,
465
+ 0,
466
+ y,
467
+ 0,
468
+ 0
469
+ ]);
470
+ }
471
+ const transform = style.getPropertyValue("transform");
472
+ if (isSet(transform)) {
473
+ const values = /^matrix\(([^)]*)\)$/.exec(transform)?.[1].split(",").map(Number.parseFloat);
474
+ if (values?.length !== 6 || values.some(Number.isNaN)) return null;
475
+ matrix = multiply(matrix, values);
476
+ }
477
+ const [a, b, c, d] = matrix;
478
+ return b === 0 && c === 0 && a !== 0 && d !== 0 ? matrix : null;
479
+ }
480
+ function originOf(style) {
481
+ const parts = style.getPropertyValue("transform-origin").trim().split(/\s+/);
482
+ if (parts.length < 2 || !parts.slice(0, 2).every((part) => part.endsWith("px"))) return null;
483
+ return [Number.parseFloat(parts[0]), Number.parseFloat(parts[1])];
484
+ }
485
+ /** `element` 排版时的边框盒,视口 px,不含它自己正在画的变换。 */
486
+ function settledBox(element) {
487
+ const rect = element.getBoundingClientRect();
488
+ const style = element.ownerDocument.defaultView?.getComputedStyle(element);
489
+ const matrix = style == null ? IDENTITY : ownTransform(style);
490
+ if (matrix === IDENTITY) return {
491
+ left: rect.left,
492
+ top: rect.top,
493
+ width: rect.width,
494
+ height: rect.height
495
+ };
496
+ const origin = style == null ? null : originOf(style);
497
+ if (matrix != null && origin != null) {
498
+ const [sx, , , sy, tx, ty] = matrix;
499
+ const [ox, oy] = origin;
500
+ return {
501
+ left: rect.left - ox - tx + ox * sx,
502
+ top: rect.top - oy - ty + oy * sy,
503
+ width: rect.width / sx,
504
+ height: rect.height / sy
505
+ };
506
+ }
507
+ const width = element.offsetWidth;
508
+ const height = element.offsetHeight;
509
+ return {
510
+ left: rect.left + (rect.width - width) / 2,
511
+ top: rect.top + (rect.height - height) / 2,
512
+ width,
513
+ height
514
+ };
515
+ }
516
+ //#endregion
517
+ //#region src/layer/layerExitCopy.ts
518
+ /**
519
+ * 浮层的退场副本(上游 Layer/layerExitCopy.ts)。
520
+ *
521
+ * 浮层一关就藏起来了(选中一项、Escape、点外面)。触屏呈现要把关闭的动效播完,
522
+ * 就在关闭那一刻拍一份静态、惰性的副本,在副本上播,播完由调用方移除。
523
+ *
524
+ * - 副本是 Core 共用的惰性副本(motion/transientCopy.ts 的 `inertCopy`):没有
525
+ * id、表单名和标签指向,`inert`,读屏器看不到,指针点不到。
526
+ * - 它落在浮层排版的盒子上(`settledBox`),带着浮层画的变换:正在进行的动画
527
+ * 此刻呈现的值(缩放、透明度等)写进副本,所以进场到一半时关闭,副本停在
528
+ * 当时画出的地方。子元素的关键帧和过渡不重播。
529
+ * - 保留浮层自己的 overflow、每处滚动位置,以及内边距、边框和颜色:放进顶层
530
+ * 时浏览器给 popover 的默认样式会把它们换掉。
531
+ * - 有 Popover API 时副本作为手动 popover 进顶层,被裁切、变换的祖先既裁不到
532
+ * 也挪不动它;浏览器在关闭中的 popover 自己的切换里拒绝显示时,等脚本跑完或
533
+ * 下一帧再显示。没有 Popover API 时副本是浮层后面的固定定位兄弟节点,带着
534
+ * 浮层自己的层级。
535
+ * - 一个浮层只有一份副本:再拍一份会把上一份拿走。
536
+ */
537
+ /** 正在进行的动画可能占着的属性:副本取浮层此刻呈现的值。 */
538
+ const PRESENTED_PROPERTIES = [
539
+ "translate",
540
+ "rotate",
541
+ "scale",
542
+ "transform",
543
+ "transform-origin",
544
+ "opacity"
545
+ ];
546
+ /** 副本不能从活浮层带走的行内属性。 */
547
+ const LIVE_ONLY_PROPERTIES = [
548
+ "position-anchor",
549
+ "position-try-fallbacks",
550
+ "inset",
551
+ "right",
552
+ "bottom",
553
+ "transition"
554
+ ];
555
+ /**
556
+ * 浏览器给 popover 的默认样式会改的属性:副本从被拍的元素上取,被拍的元素
557
+ * 不一定是 popover。
558
+ */
559
+ const POPOVER_STYLE_PROPERTIES = [
560
+ "padding-top",
561
+ "padding-right",
562
+ "padding-bottom",
563
+ "padding-left",
564
+ "border-top-width",
565
+ "border-right-width",
566
+ "border-bottom-width",
567
+ "border-left-width",
568
+ "border-top-style",
569
+ "border-right-style",
570
+ "border-bottom-style",
571
+ "border-left-style",
572
+ "border-top-color",
573
+ "border-right-color",
574
+ "border-bottom-color",
575
+ "border-left-color",
576
+ "color",
577
+ "background-color"
578
+ ];
579
+ const LAYER_SELECTOR = "[popover], dialog";
580
+ /** 每个浮层的副本:给同一个浮层再拍一份时替换掉。 */
581
+ const copies = /* @__PURE__ */ new WeakMap();
582
+ function hasDuration(value) {
583
+ return value.split(",").some((part) => Number.parseFloat(part) > 0);
584
+ }
585
+ /** 把 `element` 和子树里正在进行的动画此刻呈现的值写到副本对应的节点上。 */
586
+ function commitPresented(element, copy, view) {
587
+ if (typeof element.getAnimations !== "function") return;
588
+ const animated = /* @__PURE__ */ new Set();
589
+ for (const animation of element.getAnimations({ subtree: true })) {
590
+ const effect = animation.effect;
591
+ if (effect?.target != null && effect.pseudoElement == null) animated.add(effect.target);
592
+ }
593
+ if (animated.size === 0) return;
594
+ const sources = [element, ...element.querySelectorAll("*")];
595
+ const targets = [copy, ...copy.querySelectorAll("*")];
596
+ sources.forEach((source, index) => {
597
+ const target = targets[index];
598
+ if (!animated.has(source) || target?.style == null) return;
599
+ const computed = view.getComputedStyle(source);
600
+ for (const property of PRESENTED_PROPERTIES) target.style.setProperty(property, computed.getPropertyValue(property));
601
+ });
602
+ }
603
+ /** 副本子树里的关键帧和过渡不重播:活节点在跑的,副本上关掉。 */
604
+ function stopReplays(element, copy, view) {
605
+ const liveNodes = element.querySelectorAll("*");
606
+ copy.querySelectorAll("*").forEach((node, index) => {
607
+ const live = liveNodes[index];
608
+ const style = node.style;
609
+ if (live == null || style == null) return;
610
+ const liveStyle = view.getComputedStyle(live);
611
+ const name = liveStyle.getPropertyValue("animation-name");
612
+ if (name !== "" && name !== "none") style.setProperty("animation-name", "none");
613
+ if (hasDuration(liveStyle.getPropertyValue("transition-duration"))) style.setProperty("transition", "none");
614
+ });
615
+ }
616
+ /** `element` 外面最外层的浮层(popover 或 dialog),没有时为 null。 */
617
+ function outermostLayer(element) {
618
+ let outer = null;
619
+ for (let node = element.parentElement; node != null; node = node.parentElement) if (node.matches(LAYER_SELECTOR)) outer = node;
620
+ return outer;
621
+ }
622
+ /** 让 `element` 里面那些浮层的副本重新显示,留在刚显示的这份上面。 */
623
+ function raiseInnerCopies(element) {
624
+ const inner = [];
625
+ for (const layer of element.querySelectorAll(LAYER_SELECTOR)) {
626
+ const copy = copies.get(layer);
627
+ if (copy?.isConnected === true && copy.matches(":popover-open")) inner.push(layer);
628
+ }
629
+ inner.sort((a, b) => a.contains(b) ? -1 : b.contains(a) ? 1 : 0);
630
+ for (const layer of inner) {
631
+ const copy = copies.get(layer);
632
+ copy.hidePopover();
633
+ copy.showPopover();
634
+ restoreScrollOffsets(copy);
635
+ }
636
+ }
637
+ function insertCopy(element, copy) {
638
+ const outer = outermostLayer(element);
639
+ if (outer?.parentElement == null) {
640
+ element.after(copy);
641
+ return;
642
+ }
643
+ keepInherited(copy, outer.parentElement);
644
+ outer.after(copy);
645
+ }
646
+ function showInTopLayer(element, copy, view) {
647
+ const show = () => {
648
+ try {
649
+ copy.showPopover();
650
+ } catch {
651
+ return false;
652
+ }
653
+ restoreScrollOffsets(copy);
654
+ raiseInnerCopies(element);
655
+ return true;
656
+ };
657
+ if (show()) return;
658
+ view.queueMicrotask(() => {
659
+ if (!copy.isConnected || show()) return;
660
+ view.requestAnimationFrame(() => {
661
+ if (copy.isConnected && !show()) {
662
+ copy.remove();
663
+ if (copies.get(element) === copy) copies.delete(element);
664
+ }
665
+ });
666
+ });
667
+ }
668
+ /**
669
+ * 在 `element` 画着的地方放一份静态副本,标上 `attribute`。内容超过副本上限、
670
+ * 或者没有窗口时返回 null,关闭就是立即的。调用方在副本上播退场,播完移除。
671
+ */
672
+ function placeLayerExitCopy(element, attribute) {
673
+ const view = element.ownerDocument.defaultView;
674
+ if (view == null) return null;
675
+ copies.get(element)?.remove();
676
+ copies.delete(element);
677
+ if (!isCopyable(element)) return null;
678
+ const box = settledBox(element);
679
+ const copy = inertCopy(element);
680
+ if (copy == null) return null;
681
+ const topLayer = typeof copy.showPopover === "function";
682
+ copy.setAttribute(attribute, "");
683
+ if (topLayer) copy.setAttribute("popover", "manual");
684
+ const { style } = copy;
685
+ for (const property of LIVE_ONLY_PROPERTIES) style.removeProperty(property);
686
+ commitPresented(element, copy, view);
687
+ style.setProperty("position", "fixed");
688
+ style.setProperty("margin", "0");
689
+ style.setProperty("left", `${box.left}px`);
690
+ style.setProperty("top", `${box.top}px`);
691
+ style.setProperty("right", "auto");
692
+ style.setProperty("bottom", "auto");
693
+ style.setProperty("width", `${box.width}px`);
694
+ style.setProperty("height", `${box.height}px`);
695
+ style.setProperty("box-sizing", "border-box");
696
+ style.setProperty("animation-name", "none");
697
+ style.setProperty("pointer-events", "none");
698
+ const layerStyle = view.getComputedStyle(element);
699
+ if (hasDuration(layerStyle.getPropertyValue("transition-duration"))) style.setProperty("transition", "none");
700
+ stopReplays(element, copy, view);
701
+ style.setProperty("overflow-x", layerStyle.getPropertyValue("overflow-x"));
702
+ style.setProperty("overflow-y", layerStyle.getPropertyValue("overflow-y"));
703
+ for (const property of POPOVER_STYLE_PROPERTIES) {
704
+ const value = layerStyle.getPropertyValue(property);
705
+ if (value !== "") style.setProperty(property, value);
706
+ }
707
+ insertCopy(element, copy);
708
+ copies.set(element, copy);
709
+ if (topLayer) showInTopLayer(element, copy, view);
710
+ else restoreScrollOffsets(copy);
711
+ return copy;
712
+ }
713
+ //#endregion
714
+ //#region src/Popover/popoverExitCopy.ts
715
+ /**
716
+ * Popover 退场副本的私有标记:触屏关闭播在这份副本上。只有这个文件写标记名。
717
+ */
718
+ const POPOVER_EXIT = "data-astryx-popover-exit";
719
+ /** 给正在关闭的浮层放一份标成 Popover 的退场副本;返回 null 时关闭是立即的。 */
720
+ function placePopoverExitCopy(element) {
721
+ return placeLayerExitCopy(element, POPOVER_EXIT);
722
+ }
723
+ //#endregion
724
+ //#region src/motion/uikit/popover.ts
725
+ /**
726
+ * @file popover.ts
727
+ * @input Nothing; data only
728
+ * @output Exports `popover`: the shape a popover grows out of and shrinks
729
+ * back into as it is presented and dismissed, and how long each takes
730
+ * @position The popover domain of the UIKit constants table (motion/uikit).
731
+ * These are internal constants, not motion roles.
732
+ *
733
+ * UIPopoverPresentationController with its adaptation turned off (`.none`,
734
+ * so it stays a popover on iPhone), read from UIKit on the iOS 26.2
735
+ * simulator. The popover view grows out of the point where it meets its
736
+ * source (the bottom centre of the source for a popover below it). Its scale,
737
+ * its length away from the source and its opacity move together, with the
738
+ * edge that meets the source held in place. Lengths are in pt (CSS px).
739
+ *
740
+ * Every leaf carries one or more `@source`; GUESS values also carry the
741
+ * `@measure` task that will confirm or replace them. uikit.test.ts enforces
742
+ * both.
743
+ */
744
+ const popover = {
745
+ /**
746
+ * The uniform scale the popover grows from and shrinks back to, about the
747
+ * point where it meets its source.
748
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
749
+ * iPhone 17 Pro, CASpringAnimation dump on the popover view, Oct 23
750
+ * 2026: an additive `transform` animation from scale 0.01 to identity on
751
+ * the present spring, and from identity back to 0.01 on the dismiss
752
+ * spring; per-frame presentation frames keep the popover's top edge on
753
+ * the source's bottom edge and its centre on the source's centre line
754
+ * (scale 0.02, 0.32, 0.67, 0.88, 0.98, 1.01, 1 at 50 ms steps)
755
+ */
756
+ collapsedScale: .01,
757
+ /**
758
+ * The popover's length away from its source when it starts to grow and
759
+ * when it has shrunk back. For a popover below its source, it is the
760
+ * height. The box grows from this length to its own together with the
761
+ * scale, whatever its size.
762
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
763
+ * iPhone 17 Pro, CASpringAnimation dump on the popover view, Oct 23
764
+ * 2026: an additive `bounds.size` animation from height −153 for a
765
+ * 253 pt popover and from −433 for a 533 pt one, both starting at 100 pt,
766
+ * with `position` moving by half of it so the top edge stays put; the
767
+ * dismiss animates back to the same 100 pt
768
+ */
769
+ collapsedLengthPx: 100,
770
+ /**
771
+ * How long the growth takes to come within 2% of its end: the reference
772
+ * the growth's duration token is chosen against.
773
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
774
+ * iPhone 17 Pro, CASpringAnimation dump on the popover view, Oct 23
775
+ * 2026: the present spring (mass 1, stiffness 331.901, damping 29.149,
776
+ * bounce 0.2, CA duration 0.4937 s) is 98% of the way at 206 ms and stays
777
+ * within 2% after it; the frames read scale 0.98 at 200 ms
778
+ */
779
+ growMs: 206,
780
+ /**
781
+ * How long the shrink takes to come within 2% of its end. It is a
782
+ * reference only: the shrink plays the exit every overlay shares.
783
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
784
+ * iPhone 17 Pro, CASpringAnimation dump on the popover view, Oct 23
785
+ * 2026: the dismiss spring (mass 1, stiffness 283.973, damping 28.648,
786
+ * bounce 0.15, CA duration 0.51566 s) is 98% of the way at 249 ms and
787
+ * stays within 2% after it
788
+ */
789
+ shrinkMs: 249
790
+ };
791
+ //#endregion
792
+ //#region src/Popover/popoverSurfaceFrame.ts
793
+ /**
794
+ * 长出用 `--duration-medium-min`(默认主题里最接近 iOS 实测长出时长的一档)和
795
+ * 进场曲线。打开是一次轻点,轻点没有速度,所以不放弹簧。
796
+ */
797
+ const POPOVER_ENTRANCE_TOKENS = {
798
+ duration: "--duration-medium-min",
799
+ easing: "--ease-entrance"
800
+ };
801
+ /** 缩回用所有浮层共用的退场时长和曲线。 */
802
+ const POPOVER_EXIT_TOKENS = {
803
+ duration: "--duration-exit",
804
+ easing: "--ease-exit"
805
+ };
806
+ const PRESENTED = {
807
+ scale: 1,
808
+ length: 1,
809
+ opacity: 1
810
+ };
811
+ /**
812
+ * 浮层和触发器相接的点,以及长出的起始形状。这个点在浮层朝向触发器的那条边上、
813
+ * 正对触发器中心(箭头尖的位置)。鼠标进场按同一规则找原点,所以手指和鼠标从
814
+ * 同一处长出。盖住触发器中心的浮层没有侧,只从那个中心缩放。
815
+ */
816
+ function popoverCollapsedState({ surface, source }) {
817
+ const side = layerEntranceSide(surface, source);
818
+ const horizontal = side != null && side.x !== 0;
819
+ const overSource = side != null && side.x === 0 && side.y === 0;
820
+ const fullLength = horizontal ? surface.width : surface.height;
821
+ return {
822
+ originX: side?.originX ?? 0,
823
+ originY: side?.originY ?? 0,
824
+ axis: horizontal ? "x" : "y",
825
+ scale: popover.collapsedScale,
826
+ length: !overSource && fullLength > 0 ? Math.min(1, popover.collapsedLengthPx / fullLength) : 1
827
+ };
828
+ }
829
+ function frameOf(state, axis) {
830
+ const along = state.scale * state.length;
831
+ return {
832
+ scaleX: axis === "x" ? along : state.scale,
833
+ scaleY: axis === "y" ? along : state.scale,
834
+ opacity: state.opacity
835
+ };
836
+ }
837
+ //#endregion
838
+ //#region src/Popover/popoverSurfaceMotion.ts
839
+ /** 进度从 0 到 1 时从 `from` 到 `to` 的曲线;沿轴的缩放是缩放和长度的乘积。 */
840
+ function surfaceCurves(from, to, axis, progress, opacityFloor = 0) {
841
+ const lerp = (a, b) => mapRange([0, 1], [a, b], { clamp: false });
842
+ const scale = lerp(from.scale, to.scale);
843
+ const length = lerp(from.length, to.length);
844
+ const opacity = lerp(from.opacity, to.opacity);
845
+ const across = mapProgress(progress, scale);
846
+ const along = mapProgress(progress, (p) => scale(p) * length(p));
847
+ return {
848
+ scaleX: axis === "x" ? along : across,
849
+ scaleY: axis === "y" ? along : across,
850
+ opacity: mapProgress(progress, (p) => Math.max(opacityFloor, opacity(p)))
851
+ };
852
+ }
853
+ /** 动画器此刻画的样子,拆回缩放和长度。 */
854
+ function readState(animator, axis) {
855
+ const across = animator.get(axis === "x" ? "scaleY" : "scaleX");
856
+ const along = animator.get(axis === "x" ? "scaleX" : "scaleY");
857
+ return {
858
+ scale: across,
859
+ length: across > 0 ? along / across : 1,
860
+ opacity: animator.get("opacity")
861
+ };
862
+ }
863
+ const MOTION_STYLE_PROPERTIES = [
864
+ "scale",
865
+ "opacity",
866
+ "transform-origin",
867
+ "animation-name"
868
+ ];
869
+ function createPopoverSurfaceMotion(element, { requestFrame, cancelFrame, ...animatorOptions } = {}) {
870
+ const animator = createMotionEngine(element, animatorOptions);
871
+ const view = element.ownerDocument.defaultView;
872
+ const scheduleFrame = requestFrame ?? ((callback) => {
873
+ if (typeof view?.requestAnimationFrame === "function") return view.requestAnimationFrame(() => callback());
874
+ callback();
875
+ return 0;
876
+ });
877
+ const unscheduleFrame = cancelFrame ?? ((handle) => {
878
+ view?.cancelAnimationFrame?.(handle);
879
+ });
880
+ let pendingFrame = null;
881
+ let collapsed = null;
882
+ let measured = null;
883
+ let presentHandle = null;
884
+ let exiting = null;
885
+ let releaseHold = null;
886
+ const cancelPending = () => {
887
+ if (pendingFrame != null) unscheduleFrame(pendingFrame);
888
+ pendingFrame = null;
889
+ };
890
+ const endHold = () => {
891
+ releaseHold?.();
892
+ releaseHold = null;
893
+ };
894
+ const endExit = () => {
895
+ if (exiting == null) return;
896
+ exiting.animator.dispose();
897
+ exiting.copy.remove();
898
+ exiting = null;
899
+ };
900
+ const holdEntrance = () => {
901
+ element.style.setProperty("animation-name", "none");
902
+ };
903
+ const restoreElement = (promote) => {
904
+ animator.set({
905
+ scaleX: 1,
906
+ scaleY: 1,
907
+ opacity: 1
908
+ }, promote === false ? { promote } : void 0);
909
+ for (const property of MOTION_STYLE_PROPERTIES) element.style.removeProperty(property);
910
+ };
911
+ const present = (from, geometry, timing) => {
912
+ const next = from != null && collapsed != null ? collapsed : popoverCollapsedState(geometry);
913
+ collapsed = next;
914
+ measured = geometry;
915
+ const start = from ?? {
916
+ scale: next.scale,
917
+ length: next.length,
918
+ opacity: 0
919
+ };
920
+ animator.set(frameOf(start, next.axis));
921
+ holdEntrance();
922
+ element.style.setProperty("transform-origin", `${next.originX}px ${next.originY}px`);
923
+ const handle = animator.play(surfaceCurves(start, PRESENTED, next.axis, timing, ENTRANCE_OPACITY_FLOOR));
924
+ presentHandle = handle;
925
+ endHold();
926
+ releaseHold = holdInput(element, {
927
+ until: handle,
928
+ scope: "viewport"
929
+ });
930
+ handle.finished.then(() => {
931
+ if (presentHandle === handle) {
932
+ presentHandle = null;
933
+ endHold();
934
+ }
935
+ });
936
+ };
937
+ const enter = (measure) => {
938
+ cancelPending();
939
+ if (exiting != null && collapsed != null && measured != null) {
940
+ const from = readState(exiting.animator, collapsed.axis);
941
+ const timing = readThemeTimingOrInstant(element, POPOVER_ENTRANCE_TOKENS);
942
+ animator.attach(element);
943
+ endExit();
944
+ present(from, measured, timing);
945
+ return;
946
+ }
947
+ animator.attach(element);
948
+ endExit();
949
+ let presented = false;
950
+ const frame = scheduleFrame(() => {
951
+ presented = true;
952
+ pendingFrame = null;
953
+ const geometry = measure();
954
+ present(null, geometry, readThemeTimingOrInstant(element, POPOVER_ENTRANCE_TOKENS));
955
+ });
956
+ if (presented) return;
957
+ pendingFrame = frame;
958
+ queueMicrotask(() => {
959
+ if (pendingFrame === frame) holdEntrance();
960
+ });
961
+ };
962
+ const exit = () => {
963
+ endHold();
964
+ if (pendingFrame != null) {
965
+ cancelPending();
966
+ collapsed = null;
967
+ measured = null;
968
+ presentHandle = null;
969
+ restoreElement(false);
970
+ return;
971
+ }
972
+ const target = collapsed;
973
+ if (target == null || exiting != null) return;
974
+ const from = readState(animator, target.axis);
975
+ const timing = readThemeTimingOrInstant(element, POPOVER_EXIT_TOKENS);
976
+ presentHandle = null;
977
+ const copy = placePopoverExitCopy(element);
978
+ if (copy == null) {
979
+ restoreElement();
980
+ return;
981
+ }
982
+ copy.style.setProperty("transform-origin", `${target.originX}px ${target.originY}px`);
983
+ const closing = createMotionEngine(copy, animatorOptions);
984
+ closing.set(frameOf(from, target.axis));
985
+ const handle = closing.play(surfaceCurves(from, {
986
+ scale: target.scale,
987
+ length: target.length,
988
+ opacity: 0
989
+ }, target.axis, timing));
990
+ exiting = {
991
+ copy,
992
+ animator: closing
993
+ };
994
+ restoreElement(false);
995
+ animator.attach(null);
996
+ handle.finished.then((finished) => {
997
+ if (finished && exiting?.copy === copy) endExit();
998
+ });
999
+ };
1000
+ return {
1001
+ enter,
1002
+ exit,
1003
+ dispose() {
1004
+ cancelPending();
1005
+ endHold();
1006
+ endExit();
1007
+ restoreElement();
1008
+ animator.dispose();
1009
+ collapsed = null;
1010
+ measured = null;
1011
+ presentHandle = null;
1012
+ }
1013
+ };
1014
+ }
1015
+ //#endregion
1016
+ //#region src/Popover/usePopoverSurfaceMotion.ts
1017
+ function boxOf(element) {
1018
+ const { left, top, width, height } = element.getBoundingClientRect();
1019
+ return {
1020
+ left,
1021
+ top,
1022
+ width,
1023
+ height
1024
+ };
1025
+ }
1026
+ function usePopoverSurfaceMotion() {
1027
+ let current = null;
1028
+ const touchHold = createPresentationHold();
1029
+ const release = () => {
1030
+ current?.motion.dispose();
1031
+ current = null;
1032
+ };
1033
+ const motionFor = (element) => {
1034
+ if (current?.element === element) return current.motion;
1035
+ release();
1036
+ current = {
1037
+ element,
1038
+ motion: createPopoverSurfaceMotion(element)
1039
+ };
1040
+ return current.motion;
1041
+ };
1042
+ onBeforeUnmount(release);
1043
+ return {
1044
+ present(layer, source) {
1045
+ if (layer == null) return;
1046
+ const isTouch = source != null && isCoarsePointer(layer.ownerDocument.defaultView);
1047
+ touchHold.take(isTouch);
1048
+ if (!isTouch || source == null) {
1049
+ release();
1050
+ return;
1051
+ }
1052
+ motionFor(layer).enter(() => ({
1053
+ surface: boxOf(layer),
1054
+ source: boxOf(source)
1055
+ }));
1056
+ },
1057
+ closeStart() {
1058
+ if (touchHold.current() === true) current?.motion.exit();
1059
+ touchHold.release();
1060
+ }
1061
+ };
1062
+ }
1063
+ //#endregion
1064
+ //#region src/Popover/Popover.vue
1065
+ const _hoisted_1 = ["data-placement"];
1066
+ const _hoisted_2 = {
1067
+ key: 0,
1068
+ class: "astryx-popover__close"
1069
+ };
1070
+ const DEFAULT_MAX_WIDTH = 320;
1071
+ const _sfc_main = /*@__PURE__*/ defineComponent({
1072
+ name: "AstryxPopover",
1073
+ __name: "Popover",
1074
+ props: {
1075
+ placement: { default: "below" },
1076
+ alignment: { default: "start" },
1077
+ isOpen: {
1078
+ type: Boolean,
1079
+ default: void 0
1080
+ },
1081
+ isEnabled: {
1082
+ type: Boolean,
1083
+ default: true
1084
+ },
1085
+ width: { default: void 0 },
1086
+ padding: { default: 3 },
1087
+ label: { default: void 0 },
1088
+ role: { default: "dialog" },
1089
+ isModal: {
1090
+ type: Boolean,
1091
+ default: true
1092
+ },
1093
+ hasCloseButton: {
1094
+ type: Boolean,
1095
+ default: true
1096
+ },
1097
+ closeButtonLabel: { default: void 0 },
1098
+ hasAutoFocus: {
1099
+ type: Boolean,
1100
+ default: true
1101
+ },
1102
+ hasLightDismiss: {
1103
+ type: Boolean,
1104
+ default: true
1105
+ },
1106
+ hasEscapeDismiss: {
1107
+ type: Boolean,
1108
+ default: true
1109
+ },
1110
+ anchor: { default: void 0 },
1111
+ presentation: { default: "popover" }
1112
+ },
1113
+ emits: ["openChange"],
1114
+ setup(__props, { emit: __emit }) {
1115
+ const props = __props;
1116
+ const emit = __emit;
1117
+ const messages = useComponentMessages({ popover: popoverMessages });
1118
+ const closeLabel = computed(() => props.closeButtonLabel ?? messages.value.popover.close);
1119
+ let popover = null;
1120
+ const sheet = usePopoverSheet({
1121
+ presentation: () => props.presentation,
1122
+ controlledOpen: () => props.isOpen,
1123
+ isPopoverOpen: () => popover?.isOpen.value ?? false,
1124
+ onOpenChange: (open) => emit("openChange", open)
1125
+ });
1126
+ const sheetId = useId();
1127
+ popover = usePopoverSurface({
1128
+ placement: () => props.placement,
1129
+ alignment: () => props.alignment,
1130
+ isOpen: sheet.popoverControlledOpen,
1131
+ isEnabled: () => props.isEnabled,
1132
+ hasLightDismiss: () => props.hasLightDismiss,
1133
+ hasEscapeDismiss: () => props.hasEscapeDismiss,
1134
+ hasAutoFocus: () => props.hasAutoFocus,
1135
+ closeButtonSelector: ".astryx-popover__close",
1136
+ dialogLabel: () => props.label,
1137
+ role: () => props.role,
1138
+ isModal: () => props.isModal,
1139
+ onShow: () => emit("openChange", true),
1140
+ onHide: () => emit("openChange", false)
1141
+ }, {
1142
+ onTriggerPress: sheet.onTriggerPress,
1143
+ sheetTrigger: () => sheet.isMounted.value ? {
1144
+ expanded: sheet.isOpen.value || (popover?.isOpen.value ?? false),
1145
+ controls: sheetId
1146
+ } : null
1147
+ });
1148
+ const { triggerRef, anchorRef, contentRef, isOpen: isOpenState, contentStyle: layerStyle, resolvedPlacement, surfaceProps, hide: hidePopover } = popover;
1149
+ const setContentRef = useMergedRefs([contentRef]);
1150
+ const wrapperRef = ref(null);
1151
+ const teleportTarget = useResolvedLayerTeleport(computed(() => props.anchor ?? wrapperRef.value));
1152
+ const bodyRef = ref(null);
1153
+ useScrollbars(bodyRef);
1154
+ const anchorWidth = ref(0);
1155
+ const surfaceStyle = computed(() => {
1156
+ const style = {
1157
+ "--_popover-padding": `var(--astryx-spacing-${String(props.padding).replace(".", "-")})`,
1158
+ "top": layerStyle.value.top,
1159
+ "left": layerStyle.value.left,
1160
+ "maxWidth": props.width == null ? clampInlineSize(`${DEFAULT_MAX_WIDTH}px`) : LAYER_MAX_INLINE_SIZE
1161
+ };
1162
+ if (props.width != null) style.width = typeof props.width === "number" ? `${props.width}px` : props.width;
1163
+ else style.minWidth = clampInlineSize(`min(${anchorWidth.value}px, ${DEFAULT_MAX_WIDTH}px)`);
1164
+ return style;
1165
+ });
1166
+ function triggerHost() {
1167
+ return props.anchor ?? wrapperRef.value;
1168
+ }
1169
+ function findTriggerButton(element) {
1170
+ if (!element) return null;
1171
+ if (element.matches("button, [role=\"button\"]")) return element;
1172
+ return element.querySelector("button, [role=\"button\"]");
1173
+ }
1174
+ function syncTrigger() {
1175
+ anchorRef.value = triggerHost();
1176
+ triggerRef.value = findTriggerButton(triggerHost());
1177
+ }
1178
+ const surfaceMotion = usePopoverSurfaceMotion();
1179
+ watch(isOpenState, (open) => {
1180
+ if (open) surfaceMotion.present(contentRef.value, anchorRef.value ?? triggerRef.value);
1181
+ else surfaceMotion.closeStart();
1182
+ }, { flush: "sync" });
1183
+ watch(isOpenState, (open) => {
1184
+ if (!open) return;
1185
+ anchorWidth.value = triggerHost()?.getBoundingClientRect().width ?? 0;
1186
+ });
1187
+ watch(() => props.anchor, () => {
1188
+ nextTick(syncTrigger);
1189
+ });
1190
+ onMounted(syncTrigger);
1191
+ onUpdated(syncTrigger);
1192
+ return (_ctx, _cache) => {
1193
+ return openBlock(), createElementBlock(Fragment, null, [
1194
+ !__props.anchor ? (openBlock(), createElementBlock("span", {
1195
+ key: 0,
1196
+ ref_key: "wrapperRef",
1197
+ ref: wrapperRef,
1198
+ class: "astryx-popover-trigger"
1199
+ }, [renderSlot(_ctx.$slots, "default")], 512)) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1),
1200
+ (openBlock(), createBlock(Teleport, { to: unref(teleportTarget) }, [withDirectives(createElementVNode("div", mergeProps({
1201
+ ref: unref(setContentRef),
1202
+ class: "astryx-popover",
1203
+ "data-placement": unref(resolvedPlacement),
1204
+ style: surfaceStyle.value
1205
+ }, unref(surfaceProps)), [createElementVNode("div", {
1206
+ ref_key: "bodyRef",
1207
+ ref: bodyRef,
1208
+ class: "astryx-popover__body"
1209
+ }, [!unref(sheet).isMounted.value ? (openBlock(), createBlock(_sfc_main$3, { key: 0 }, {
1210
+ default: withCtx(() => [renderSlot(_ctx.$slots, "content")]),
1211
+ _: 3
1212
+ })) : createCommentVNode("v-if", true)], 512), __props.hasCloseButton ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(_sfc_main$2), {
1213
+ variant: "secondary",
1214
+ label: closeLabel.value,
1215
+ onClick: unref(hidePopover)
1216
+ }, null, 8, ["label", "onClick"])])) : createCommentVNode("v-if", true)], 16, _hoisted_1), [[vShow, unref(isOpenState)]])], 8, ["to"])),
1217
+ unref(sheet).isMounted.value ? (openBlock(), createBlock(_sfc_main$1, {
1218
+ key: 2,
1219
+ id: unref(sheetId),
1220
+ "is-open": unref(sheet).isOpen.value,
1221
+ label: __props.label ?? unref(sheet).triggerText.value,
1222
+ padding: __props.padding,
1223
+ "has-escape-dismiss": __props.hasEscapeDismiss,
1224
+ "has-close-button": __props.hasCloseButton,
1225
+ "close-label": closeLabel.value,
1226
+ onOpenChange: unref(sheet).setOpen,
1227
+ onMotionComplete: unref(sheet).onMotionComplete
1228
+ }, {
1229
+ default: withCtx(() => [renderSlot(_ctx.$slots, "content")]),
1230
+ _: 3
1231
+ }, 8, [
1232
+ "id",
1233
+ "is-open",
1234
+ "label",
1235
+ "padding",
1236
+ "has-escape-dismiss",
1237
+ "has-close-button",
1238
+ "close-label",
1239
+ "onOpenChange",
1240
+ "onMotionComplete"
1241
+ ])) : createCommentVNode("v-if", true)
1242
+ ], 64);
1243
+ };
1244
+ }
1245
+ });
1246
+ //#endregion
1247
+ export { usePopover as n, _sfc_main as t };