@astryx-vue/core 0.19.1 → 0.20.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 (254) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-CNb0dkY9.js → AlertDialog-DYYA2LOe.js} +6 -6
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/{AppShell-NvIT99xw.js → AppShell-zEXmJb1h.js} +116 -9
  5. package/dist/AvatarGroup/index.d.ts +1 -1
  6. package/dist/Banner/index.d.ts +1 -1
  7. package/dist/Banner/index.js +1 -1
  8. package/dist/{Banner-BXITu2pn.js → Banner-C4ZICVvW.js} +1 -1
  9. package/dist/BottomSheet/index.d.ts +1 -1
  10. package/dist/BottomSheet/index.js +2 -2
  11. package/dist/{BottomSheet-CCW58Kl3.js → BottomSheet-DNuzJPfQ.js} +2 -2
  12. package/dist/{BottomSheet-HQpcSkPH.js → BottomSheet-DV7bboru.js} +1 -1
  13. package/dist/Breadcrumbs/index.d.ts +1 -1
  14. package/dist/Breadcrumbs/index.js +2 -2
  15. package/dist/{Breadcrumbs-DXzBkpkd.js → Breadcrumbs-C8nA3Ft9.js} +1 -1
  16. package/dist/Button/index.d.ts +1 -1
  17. package/dist/Button/index.js +1 -1
  18. package/dist/{Button-BZtim0B-.js → Button-DOfigN38.js} +1 -1
  19. package/dist/ButtonGroup/index.d.ts +1 -1
  20. package/dist/ButtonGroup/index.js +1 -1
  21. package/dist/{ButtonGroup-EpWZowJP.js → ButtonGroup-BzrDhbMP.js} +2 -2
  22. package/dist/Calendar/index.d.ts +1 -1
  23. package/dist/Carousel/index.d.ts +1 -1
  24. package/dist/Carousel/index.js +1 -1
  25. package/dist/{Carousel-BaCXqtKK.js → Carousel-CRaHAUsZ.js} +1 -1
  26. package/dist/Chat/index.d.ts +1 -1
  27. package/dist/Chat/index.js +1 -1
  28. package/dist/{Chat-CXwXzlZ0.js → Chat-DTs843Ta.js} +1 -1
  29. package/dist/CheckboxInput/index.d.ts +1 -1
  30. package/dist/CheckboxInput/index.js +1 -1
  31. package/dist/{CheckboxInput-3ONBl1AY.js → CheckboxInput-Ydl1GSBh.js} +33 -3
  32. package/dist/CheckboxList/index.d.ts +1 -1
  33. package/dist/CheckboxList/index.js +1 -1
  34. package/dist/{CheckboxList-CbRX5YDA.js → CheckboxList-Sn_ph-Xz.js} +64 -5
  35. package/dist/ClickableCard/index.d.ts +1 -1
  36. package/dist/Code/index.js +1 -1
  37. package/dist/{CodeBlock-CLVXVlB7.js → CodeBlock-DXBJEZS6.js} +1 -1
  38. package/dist/Collapsible/index.js +1 -1
  39. package/dist/{Collapsible-ExzU7vC0.js → Collapsible-BG-u5nEt.js} +2 -1
  40. package/dist/CommandPalette/index.js +1 -1
  41. package/dist/{CommandPalette-CECjNvGB.js → CommandPalette-CV7t0ouM.js} +1 -1
  42. package/dist/ComplexSelector/index.d.ts +1 -1
  43. package/dist/ComplexSelector/index.js +1 -1
  44. package/dist/{ComplexSelector-Dmaag1wm.js → ComplexSelector-BKjyFdHr.js} +2 -2
  45. package/dist/ContextMenu/index.d.ts +1 -1
  46. package/dist/ContextMenu/index.js +2 -2
  47. package/dist/{ContextMenu-CujLDt4e.js → ContextMenu-CwnY6hcJ.js} +2 -2
  48. package/dist/DateInput/index.d.ts +1 -1
  49. package/dist/DateInput/index.js +1 -1
  50. package/dist/{DateInput-CiIWOWXM.js → DateInput-BaX40vSs.js} +4 -4
  51. package/dist/DateRangeInput/index.d.ts +1 -1
  52. package/dist/DateRangeInput/index.js +1 -1
  53. package/dist/{DateRangeInput-CLVQ8E0Y.js → DateRangeInput-DplhXZqK.js} +3 -3
  54. package/dist/DateTimeInput/index.d.ts +1 -1
  55. package/dist/DateTimeInput/index.js +1 -1
  56. package/dist/{DateTimeInput-jHSN-Dzu.js → DateTimeInput-CrD1EEfs.js} +7 -7
  57. package/dist/Dialog/index.js +3 -3
  58. package/dist/{Dialog-BQ5OBB1d.js → Dialog-B2pOTrnQ.js} +1 -1
  59. package/dist/{Dialog-DgdbRn2l.js → Dialog-CztWmbf8.js} +1 -1
  60. package/dist/{DialogHeader-D8234o9F.js → DialogHeader-CjHTNccL.js} +2 -2
  61. package/dist/Divider/index.d.ts +1 -1
  62. package/dist/Drawer/index.d.ts +1 -1
  63. package/dist/Drawer/index.js +1 -1
  64. package/dist/{Drawer-Dqus7kUc.js → Drawer-DGIuMLms.js} +2 -2
  65. package/dist/DropdownMenu/index.js +3 -3
  66. package/dist/{DropdownMenu-BC_zB9le.js → DropdownMenu-l9c562oA.js} +31 -8
  67. package/dist/{DropdownMenu-LQsXd-_V.js → DropdownMenu-r93pI0mD.js} +4 -4
  68. package/dist/EmptyState/index.js +1 -1
  69. package/dist/{EmptyState-Bw0kWfMi.js → EmptyState-nyV5XxMA.js} +2 -2
  70. package/dist/Field/index.js +3 -3
  71. package/dist/{Field-BXkGR8H0.js → Field-CIZdFzXr.js} +1 -1
  72. package/dist/{FieldInfoTip-DzpUxMDh.js → FieldInfoTip-eJSORVbp.js} +1 -1
  73. package/dist/{FieldLabel-DI7Yqdhf.js → FieldLabel-BoMSIOLF.js} +1 -1
  74. package/dist/FileInput/index.d.ts +1 -1
  75. package/dist/FileInput/index.js +1 -1
  76. package/dist/{FileInput-BNHjbyQY.js → FileInput-DvGU92Sg.js} +2 -2
  77. package/dist/Heading/index.js +1 -1
  78. package/dist/{Heading-Oph-5DDq.js → Heading-Bo6A69fA.js} +1 -1
  79. package/dist/HoverCard/index.d.ts +1 -1
  80. package/dist/IconButton/index.js +1 -1
  81. package/dist/{IconButton-Du2XBBAX.js → IconButton-oKXLxgYb.js} +1 -1
  82. package/dist/InfoTip/index.d.ts +1 -1
  83. package/dist/InfoTip/index.js +1 -1
  84. package/dist/{InfoTip-Bjw1ithP.js → InfoTip-DWC-vnT5.js} +1 -1
  85. package/dist/{InputClearButton-CED-zP2y.js → InputClearButton-CAitWZTk.js} +1 -1
  86. package/dist/InputGroup/index.js +1 -1
  87. package/dist/{InputGroup-D5PoL4cU.js → InputGroup-CeTKqJQn.js} +1 -1
  88. package/dist/{Item-CNR22qzk.js → Item-BSHDEJyh.js} +18 -10
  89. package/dist/Lightbox/index.js +1 -1
  90. package/dist/{Lightbox-RN_f7zRw.js → Lightbox-CesmEisI.js} +3 -3
  91. package/dist/Link/index.d.ts +1 -1
  92. package/dist/List/index.d.ts +1 -1
  93. package/dist/List/index.js +2 -2
  94. package/dist/{ListItem-BJ6ZaKcj.js → ListItem-v1GFTbba.js} +1 -1
  95. package/dist/Markdown/index.d.ts +1 -1
  96. package/dist/Markdown/index.js +1 -1
  97. package/dist/{Markdown-DnnWjJGX.js → Markdown-CIA5ejYp.js} +2 -2
  98. package/dist/MobileNav/index.d.ts +1 -1
  99. package/dist/MobileNav/index.js +1 -1
  100. package/dist/{MobileNavToggle-DlQmYaBx.js → MobileNavToggle-CKEOroi0.js} +75 -32
  101. package/dist/MoreMenu/index.d.ts +1 -1
  102. package/dist/MoreMenu/index.js +1 -1
  103. package/dist/{MoreMenu-i80Ey9vR.js → MoreMenu-DcImQxyp.js} +3 -3
  104. package/dist/MultiSelector/index.d.ts +1 -1
  105. package/dist/MultiSelector/index.js +1 -1
  106. package/dist/{MultiSelector-BK6nZweN.js → MultiSelector-DedRF-RL.js} +3 -3
  107. package/dist/{NavHeadingSurface-C17cbKn9.js → NavHeadingSurface-DZPa2px5.js} +19 -5
  108. package/dist/NavItem/index.d.ts +2 -2
  109. package/dist/NavItem/index.js +1 -1
  110. package/dist/{NavItem-BAe-tUG9.js → NavItem-CcbOJNnY.js} +18 -5
  111. package/dist/NavMenu/index.d.ts +1 -1
  112. package/dist/NumberInput/index.d.ts +1 -1
  113. package/dist/NumberInput/index.js +1 -1
  114. package/dist/{NumberInput-BsWTXomE.js → NumberInput-q9HP5L_V.js} +3 -3
  115. package/dist/OverflowList/index.d.ts +1 -1
  116. package/dist/Pagination/index.d.ts +1 -1
  117. package/dist/Pagination/index.js +1 -1
  118. package/dist/{Pagination-DFQNX_Mb.js → Pagination-DfAHckUV.js} +1 -1
  119. package/dist/Popover/index.d.ts +1 -1
  120. package/dist/Popover/index.js +1 -1
  121. package/dist/{Popover-CmAEizH-.js → Popover-D0jAIXkw.js} +3 -2
  122. package/dist/PowerSearch/index.d.ts +1 -1
  123. package/dist/PowerSearch/index.js +1 -1
  124. package/dist/{PowerSearch-C2x4uuAM.js → PowerSearch-CU_MBQlC.js} +12 -12
  125. package/dist/ProgressBar/index.d.ts +1 -1
  126. package/dist/Radio/index.d.ts +1 -1
  127. package/dist/Radio/index.js +1 -1
  128. package/dist/{RadioGroup-FhoQMqg5.js → RadioGroup-Cm2n6M5C.js} +10 -2
  129. package/dist/RadioList/index.d.ts +1 -1
  130. package/dist/RadioList/index.js +1 -1
  131. package/dist/{RadioList-DK2uXQ5S.js → RadioList-B5MaynOw.js} +1 -1
  132. package/dist/Resizable/index.d.ts +1 -1
  133. package/dist/ScrollableArea/index.d.ts +1 -1
  134. package/dist/SegmentedControl/index.d.ts +1 -1
  135. package/dist/SegmentedControl/index.js +1 -1
  136. package/dist/{SegmentedControl-BCvscZM9.js → SegmentedControl-D--5X0eZ.js} +9 -2
  137. package/dist/SelectableCard/index.d.ts +1 -1
  138. package/dist/Selector/index.d.ts +1 -1
  139. package/dist/Selector/index.js +1 -1
  140. package/dist/{Selector-Bo7qkt1P.js → Selector-wcbEB7BC.js} +2 -2
  141. package/dist/SideNav/index.d.ts +1 -1
  142. package/dist/SideNav/index.js +2 -2
  143. package/dist/{SideNav-CcZLUd7G.js → SideNav-CYlAzvrT.js} +512 -58
  144. package/dist/Slider/index.js +1 -1
  145. package/dist/{Slider-DIgb8ogt.js → Slider-jgmpvIDe.js} +1 -1
  146. package/dist/Stepper/index.d.ts +1 -1
  147. package/dist/Switch/index.d.ts +1 -1
  148. package/dist/Switch/index.js +1 -1
  149. package/dist/{Switch-5toeiELX.js → Switch-YNk17Lct.js} +1 -1
  150. package/dist/TabList/index.d.ts +1 -1
  151. package/dist/Table/index.d.ts +1 -1
  152. package/dist/Table/index.js +1 -1
  153. package/dist/{Table-o3aGMDT1.js → Table-DcFujAPW.js} +12 -10
  154. package/dist/Text/index.js +2 -2
  155. package/dist/{Text-CiSw2pOi.js → Text-Bv4urzOW.js} +1 -1
  156. package/dist/TextArea/index.d.ts +1 -1
  157. package/dist/TextArea/index.js +1 -1
  158. package/dist/{TextArea-B82oXF-m.js → TextArea-CixgkV__.js} +4 -4
  159. package/dist/TextInput/index.d.ts +1 -1
  160. package/dist/TextInput/index.js +1 -1
  161. package/dist/{TextInput-_SIiqVOY.js → TextInput-Bpiq3FcP.js} +4 -4
  162. package/dist/Thumbnail/index.js +1 -1
  163. package/dist/{Thumbnail-BlueoqOH.js → Thumbnail-Bktyar_H.js} +1 -1
  164. package/dist/{TimeField-BM-rVFhC.js → TimeField-BtiLoHqW.js} +4 -4
  165. package/dist/TimeInput/index.d.ts +1 -1
  166. package/dist/TimeInput/index.js +1 -1
  167. package/dist/{TimeInput-CkZfhhAr.js → TimeInput-eyxw3KzD.js} +2 -2
  168. package/dist/Timer/index.d.ts +1 -1
  169. package/dist/Timer/index.js +1 -1
  170. package/dist/{Timer-DiIs5GLA.js → Timer-C-N-sElU.js} +2 -2
  171. package/dist/Timestamp/index.d.ts +1 -1
  172. package/dist/Timestamp/index.js +1 -1
  173. package/dist/{Timestamp-D9Jyk9sD.js → Timestamp-BTs10ZLD.js} +2 -2
  174. package/dist/Toast/index.js +1 -1
  175. package/dist/{Toast-D4Q6wvYu.js → Toast-DpMqZ72F.js} +1 -1
  176. package/dist/ToggleButton/index.d.ts +1 -1
  177. package/dist/ToggleButton/index.js +1 -1
  178. package/dist/{ToggleButton-CO0XWWc0.js → ToggleButton-W_tpgZ8k.js} +3 -3
  179. package/dist/Token/index.d.ts +1 -1
  180. package/dist/Tokenizer/index.js +1 -1
  181. package/dist/{Tokenizer-CsFiYUJ_.js → Tokenizer-Bs1VXinx.js} +2 -2
  182. package/dist/Toolbar/index.d.ts +1 -1
  183. package/dist/Tooltip/index.d.ts +1 -1
  184. package/dist/TopNav/index.d.ts +1 -1
  185. package/dist/TopNav/index.js +1 -1
  186. package/dist/{TopNav-CFkThrKq.js → TopNav-CSFUTuyI.js} +3 -3
  187. package/dist/TreeList/index.d.ts +1 -1
  188. package/dist/TreeList/index.js +1 -1
  189. package/dist/{TreeList-ugSF9DWj.js → TreeList-B8p_lI7a.js} +18 -9
  190. package/dist/Typeahead/index.js +1 -1
  191. package/dist/{Typeahead--kEp21ut.js → Typeahead-Bh0nap5Z.js} +2 -2
  192. package/dist/{landing-Bs0aMIsR.js → batch-BJD6Bt-O.js} +42 -740
  193. package/dist/composables/index.js +4 -4
  194. package/dist/{composables-BgfubKnk.js → composables-CDrwFX0l.js} +2 -19
  195. package/dist/context-Cj_zItu2.js +729 -0
  196. package/dist/{dateParser-DS_a8Ej8.js → dateParser-BKoaawL9.js} +46 -2
  197. package/dist/edge-DIlkB7vS.js +164 -0
  198. package/dist/edgeRide-D0oC2JEB.js +499 -0
  199. package/dist/focusAcrossSwap-Casww_IY.js +19 -0
  200. package/dist/focusRegion-CmDg7_4b.js +81 -0
  201. package/dist/{handle-BPXdHbkr.js → handle-ChN2TMKH.js} +1 -1
  202. package/dist/{index-C93nwgTW.d.ts → index-51CkIKnI.d.ts} +1 -1
  203. package/dist/{index--kbwaSXW.d.ts → index-5Hrxeq2J.d.ts} +4 -4
  204. package/dist/{index-D-giO0SA.d.ts → index-B63NOJRc.d.ts} +8 -8
  205. package/dist/{index-X4S7_dmq.d.ts → index-BA8exXNP.d.ts} +1 -1
  206. package/dist/{index-CryFtTT6.d.ts → index-BIQZa2BD.d.ts} +1 -1
  207. package/dist/{index-CUCgbqBB.d.ts → index-BNtSmuWg.d.ts} +5 -5
  208. package/dist/{index-BO9TY87G.d.ts → index-BOCb89V9.d.ts} +3 -3
  209. package/dist/{index-Djf0M7PH.d.ts → index-BP2SjZiM.d.ts} +2 -2
  210. package/dist/{index-CdvmnNMH.d.ts → index-BaFphczL.d.ts} +1 -1
  211. package/dist/{index-CKUfpmFL.d.ts → index-C3FgFPrM.d.ts} +3 -1
  212. package/dist/{index-BeR-1LgF.d.ts → index-C5fbwY7Y.d.ts} +4 -3
  213. package/dist/{index-C4S65SAW.d.ts → index-CKnr0JlT.d.ts} +1 -1
  214. package/dist/{index-ohw86wfM.d.ts → index-CaE2cqeG.d.ts} +59 -55
  215. package/dist/{index-Otl047R1.d.ts → index-Cb-rvc1W.d.ts} +1 -1
  216. package/dist/{index-C9ZssPUV.d.ts → index-CiVrhGUJ.d.ts} +1 -1
  217. package/dist/{index-C8wfe0Mr.d.ts → index-D05JGsT3.d.ts} +1 -1
  218. package/dist/{index-B449gOMC.d.ts → index-D1JXm7Et.d.ts} +3 -3
  219. package/dist/{index-BL4mH8aK.d.ts → index-DMN_JVEt.d.ts} +1 -1
  220. package/dist/{index-aE810PYg.d.ts → index-DmAEpn5E.d.ts} +1 -1
  221. package/dist/{index-CfXW4km8.d.ts → index-GgHVkJtB.d.ts} +1 -1
  222. package/dist/{index-DdT2wE_N.d.ts → index-LaQSu7ST.d.ts} +7 -7
  223. package/dist/{index-eCp-ElSp.d.ts → index-MvrDMqnQ.d.ts} +1 -1
  224. package/dist/{index-B-3EGjfQ.d.ts → index-Q1oG9yIT.d.ts} +2 -2
  225. package/dist/{index-DE1genab.d.ts → index-QnlWyUxN.d.ts} +2 -2
  226. package/dist/{index-Dg0JsBpI.d.ts → index-Y-AmNzkO.d.ts} +2 -2
  227. package/dist/{index-dWlCpnua.d.ts → index-mK1ICsVg.d.ts} +1 -1
  228. package/dist/{index-B3yTdknp.d.ts → index-vCRf5fyK.d.ts} +3 -2
  229. package/dist/index.d.ts +29 -29
  230. package/dist/index.js +77 -77
  231. package/dist/landing-C7nc9JHm.js +104 -0
  232. package/dist/quietFinished-CKZXgsPM.js +19 -0
  233. package/dist/sharedMutationObserver-Dvh3N1N2.js +41 -0
  234. package/dist/{timeFormat-CqrwFE42.js → timeFormat-Cnd5vu5t.js} +1 -1
  235. package/dist/{timeParser-D9tCF_b3.js → timeParser-nVL5sIwT.js} +34 -5
  236. package/dist/{types-BG23kC3S.d.ts → types-C2ZuV4jf.d.ts} +7 -1
  237. package/dist/{useActionGroupTracking-DGeOIv3K.js → useActionGroupTracking-fwmxDcU3.js} +1 -1
  238. package/dist/{useFocusTrap-BUd-fvUH.js → useFocusTrap-DsYtRdmV.js} +2 -81
  239. package/dist/{useInputStatusIcon-ne9V7ZQC.js → useInputStatusIcon-CVGsNTi_.js} +1 -1
  240. package/dist/{useMenuDrillIn-BaNYxWiS.js → useMenuDrillIn-DaH0nhPa.js} +1 -1
  241. package/dist/{useTimeValue-CcKrnO8z.js → useTimeValue-8YfPQffv.js} +2 -2
  242. package/dist/{useTouchHitArea-BI-CtI7e.js → useTouchHitArea-BKZL6tHX.js} +48 -5
  243. package/dist/{useTruncation-C4pdlaXa.js → useTruncation-BxYAhQtF.js} +1 -40
  244. package/dist/{useTruncationTooltip-DwUQN7fD.js → useTruncationTooltip-DeCGRmot.js} +1 -1
  245. package/dist/utils/index.d.ts +1 -1
  246. package/dist/utils/index.js +2 -2
  247. package/package.json +1 -1
  248. package/styles/mobile-nav.css +4 -2
  249. package/styles/nav-item.css +3 -3
  250. package/styles/side-nav.css +36 -8
  251. package/styles/touch-hit-area.css +28 -0
  252. package/styles/tree-list.css +9 -4
  253. package/dist/context-ZsDEkhSF.js +0 -24
  254. package/dist/{index-BqhgeAT4.d.ts → index-BJ9Wim6J.d.ts} +1 -1
@@ -0,0 +1,499 @@
1
+ import { b as sharedWeakMap, t as areaOf } from "./handle-ChN2TMKH.js";
2
+ import { D as glides, O as numbersIn, T as visibleRect, _ as safeAnimate, d as layoutMotion, i as changeStartOf, m as sampleOver, n as batches, p as sampleKeyframes, u as takesPart, v as retimeSettle, w as scaleOf, x as intersects } from "./batch-BJD6Bt-O.js";
3
+ import { a as isRtl, c as slideFrame, i as holdSlideClip, l as slidingParts, n as fractionClip, o as previousInFlow, r as glideMoving, s as pxClip, t as extentOf } from "./edge-DIlkB7vS.js";
4
+ //#region src/motion/layout/playChange.ts
5
+ /** Each part's slide, by its motion: a stopped slide is no glide. */
6
+ const slideTargets = sharedWeakMap("motion/animated-layout/slide-targets", 1);
7
+ /**
8
+ * The changed element's own animation, on the same motion as the content
9
+ * after it (`spec:AST-105` FR4): content that appears reveals from its
10
+ * block-end edge downward, or from the `edge` it is given (FR9), and its edge
11
+ * rides the glide of the content on that side once it starts. A reveal that
12
+ * reverses a running conceal (an adopter opens it again mid-exit, after
13
+ * `releaseLayoutExit`) starts from what the element shows. Plays only with a
14
+ * handle, inside its area and in the area's visible part. Returns the
15
+ * entrance it started, or null when it played none.
16
+ */
17
+ function playLayoutChange(handle, element, { edge = "block-end" } = {}) {
18
+ if (handle == null) return null;
19
+ const area = areaOf(handle, element);
20
+ if (area == null) return null;
21
+ if (!intersects(element.getBoundingClientRect(), visibleRect(area))) return null;
22
+ const motion = layoutMotion(area);
23
+ if (motion.kind === "instant") return null;
24
+ const from = shownAtStart(element, 0);
25
+ const batch = batches.get(area);
26
+ const change = batch != null && [...batch.changed].some((changed) => changed === element || changed.contains(element)) ? changeStartOf(batch) : void 0;
27
+ if (motion.kind === "fade") return safeAnimate(element, [{ opacity: from }, { opacity: 1 }], {
28
+ duration: motion.durationMs,
29
+ easing: motion.easing
30
+ }, change);
31
+ const { progress } = motion;
32
+ const rtl = edge.startsWith("inline") && isRtl(element);
33
+ const extent = edge.startsWith("block") ? extentOf(element, edge) : 0;
34
+ const sliding = slidingParts(element, edge, area, extent);
35
+ const partMotions = slideParts(sliding, progress, change, (remaining) => slideFrame(edge, (1 - from) * remaining * extent));
36
+ const animation = safeAnimate(element, sampleKeyframes(progress, (remaining) => {
37
+ const hidden = (1 - from) * remaining;
38
+ return partMotions.length > 0 ? { opacity: 1 - hidden } : {
39
+ opacity: 1 - hidden,
40
+ clipPath: fractionClip(edge, hidden, rtl)
41
+ };
42
+ }), {
43
+ duration: progress.durationMs,
44
+ easing: "linear"
45
+ }, change);
46
+ if (animation == null) for (const part of partMotions) part.cancel();
47
+ else rideEdge(element, area, edge, rtl, trackEdgeMotion(element, animation, (t) => 1 - (1 - from) * progress.remaining(t), partMotions, partMotions.length > 0 && sliding != null ? holdSlideClip(element, sliding.clip) : void 0), false);
48
+ return animation;
49
+ }
50
+ /**
51
+ * Plays each part's slide on the change's start, sampled like the glide.
52
+ * `frame` turns the share of the motion still to come into a keyframe.
53
+ */
54
+ function slideParts(sliding, progress, change, frame, fill) {
55
+ const motions = [];
56
+ for (const [index, part] of (sliding?.parts ?? []).entries()) {
57
+ const motion = safeAnimate(part, sampleKeyframes(progress, frame), {
58
+ duration: progress.durationMs,
59
+ easing: "linear",
60
+ fill
61
+ }, change);
62
+ if (motion != null) {
63
+ motions.push(motion);
64
+ const glide = {
65
+ animation: motion,
66
+ offsetAt: (t) => drawnOffset(motion, t),
67
+ get durationMs() {
68
+ return liveDuration(motion, progress.durationMs);
69
+ },
70
+ shownBefore: {
71
+ x: 0,
72
+ y: 0
73
+ },
74
+ scale: sliding?.scales[index] ?? {
75
+ x: 1,
76
+ y: 1
77
+ }
78
+ };
79
+ glides.set(part, glide);
80
+ slideTargets.set(motion, part);
81
+ motion.addEventListener?.("finish", () => {
82
+ if (glides.get(part) === glide) glides.delete(part);
83
+ });
84
+ }
85
+ }
86
+ return motions;
87
+ }
88
+ /**
89
+ * The offset `animation` draws `t` ms in, read off its keyframes, a straight
90
+ * line between each two. A slide that rides another glide reads that glide's
91
+ * frames, so this follows it.
92
+ */
93
+ function drawnOffset(animation, t) {
94
+ const effect = animation.effect;
95
+ if (effect == null || typeof effect.getKeyframes !== "function") return {
96
+ x: 0,
97
+ y: 0
98
+ };
99
+ const frames = effect.getKeyframes();
100
+ const duration = Number(effect.getTiming().duration);
101
+ const at = duration > 0 ? Math.min(1, Math.max(0, t / duration)) : 1;
102
+ const offsetOf = (frame) => {
103
+ const [x = 0, y = 0] = numbersIn(String(frame?.translate ?? ""));
104
+ return {
105
+ x,
106
+ y,
107
+ offset: frame?.computedOffset ?? 0
108
+ };
109
+ };
110
+ let from = offsetOf(frames[0]);
111
+ let to = offsetOf(frames[frames.length - 1]);
112
+ for (const frame of frames) {
113
+ const point = offsetOf(frame);
114
+ if (point.offset <= at) from = point;
115
+ if (point.offset >= at) {
116
+ to = point;
117
+ break;
118
+ }
119
+ }
120
+ const span = to.offset - from.offset;
121
+ const k = span > 0 ? (at - from.offset) / span : 0;
122
+ return {
123
+ x: from.x + (to.x - from.x) * k,
124
+ y: from.y + (to.y - from.y) * k
125
+ };
126
+ }
127
+ /** How many ms before `animation` started `glide` started: 0 in one change. */
128
+ function startedBefore(glide, animation) {
129
+ const shift = Number(animation.startTime) - Number(glide.animation.startTime);
130
+ return Number.isFinite(shift) ? Math.max(0, shift) : 0;
131
+ }
132
+ /** `animation`'s length now, in ms, or `fallback` if it has none. */
133
+ function liveDuration(animation, fallback) {
134
+ const effect = animation.effect;
135
+ const duration = Number(effect?.getTiming?.().duration);
136
+ return duration > 0 ? duration : fallback;
137
+ }
138
+ /** Cancels a part's slide, and forgets it as the part's glide. */
139
+ function stopGlideOf(animation) {
140
+ const part = slideTargets.get(animation);
141
+ if (part != null && glides.get(part)?.animation === animation) glides.delete(part);
142
+ animation.cancel();
143
+ }
144
+ //#endregion
145
+ //#region src/motion/layout/exit.ts
146
+ /** The inline properties an exit sets, so a release removes exactly them. */
147
+ const EXIT_PROPERTIES = [
148
+ "margin-block-end",
149
+ "margin-inline-end",
150
+ "margin-block-start",
151
+ "margin-inline-start",
152
+ "pointer-events"
153
+ ];
154
+ /**
155
+ * The first element after `element` in the area that takes part in layout:
156
+ * its next sibling, or its nearest ancestor's below the area. A wrapper's
157
+ * edge is not used: a negative end margin can collapse through it.
158
+ */
159
+ function nextInFlow(element, area) {
160
+ const view = element.ownerDocument.defaultView;
161
+ const firstBox = (from) => {
162
+ const style = view?.getComputedStyle(from);
163
+ if (style == null) return from;
164
+ if (style.display === "contents") {
165
+ for (let child = from.firstElementChild; child != null; child = child.nextElementSibling) {
166
+ const box = firstBox(child);
167
+ if (box != null) return box;
168
+ }
169
+ return null;
170
+ }
171
+ return takesPart(from, style) ? from : null;
172
+ };
173
+ let node = element;
174
+ while (node != null && node !== area) {
175
+ for (let sibling = node.nextElementSibling; sibling != null; sibling = sibling.nextElementSibling) {
176
+ const box = firstBox(sibling);
177
+ if (box != null) return box;
178
+ }
179
+ node = node.parentElement;
180
+ }
181
+ return null;
182
+ }
183
+ /**
184
+ * An element's place: its block start, and its inline start (RTL read right
185
+ * to left).
186
+ */
187
+ function placeOf(element, rtl) {
188
+ const rect = element.getBoundingClientRect();
189
+ return {
190
+ block: rect.top,
191
+ inline: rtl ? -rect.right : rect.left
192
+ };
193
+ }
194
+ /**
195
+ * Keeps `element` where it is, in flow (so it scrolls and clips with its
196
+ * container), while the content after it takes the place it takes once the
197
+ * element is hidden: a negative end margin measured against that content,
198
+ * so a gap or collapsing margins come out exact. Returns false, setting
199
+ * nothing, when no margin reaches that place.
200
+ */
201
+ function giveUpSpace(element, area, edge = "block-end") {
202
+ const view = element.ownerDocument.defaultView;
203
+ const parent = element.parentElement == null ? void 0 : view?.getComputedStyle(element.parentElement);
204
+ const isRow = parent != null && parent.display.includes("flex") && parent.flexDirection.startsWith("row");
205
+ const rtl = view?.getComputedStyle(element).direction === "rtl";
206
+ const isStart = edge.endsWith("start");
207
+ const property = edge === "block-end" ? isRow ? "margin-inline-end" : "margin-block-end" : `margin-${edge}`;
208
+ const isInline = property.includes("inline");
209
+ const size = isInline ? element.offsetWidth : element.offsetHeight;
210
+ const next = nextInFlow(element, area);
211
+ if (next == null && !isStart) {
212
+ element.style.setProperty(property, `${-size}px`);
213
+ return true;
214
+ }
215
+ const own = element.style.getPropertyValue(property);
216
+ const ownPriority = element.style.getPropertyPriority(property);
217
+ const axis = isInline ? "inline" : "block";
218
+ const checked = [
219
+ next,
220
+ element.parentElement == null || element.parentElement === area ? null : nextInFlow(element.parentElement, area),
221
+ isStart ? previousInFlow(element, area) : null,
222
+ isStart ? element : null
223
+ ].filter((box) => box != null);
224
+ if (checked.length === 0) return false;
225
+ const scale = scaleOf(element, element.getBoundingClientRect());
226
+ const position = element.style.getPropertyValue("position");
227
+ const positionPriority = element.style.getPropertyPriority("position");
228
+ const shown = isStart ? placeOf(element, rtl) : null;
229
+ element.style.setProperty("position", "absolute", "important");
230
+ const targets = checked.map((box) => box === element && shown != null ? shown : placeOf(box, rtl));
231
+ const target = targets[0];
232
+ if (position === "") element.style.removeProperty("position");
233
+ else element.style.setProperty("position", position, positionPriority);
234
+ const perPx = isRow ? scale.x : scale.y;
235
+ element.style.setProperty(property, `${-size}px`);
236
+ const guess = placeOf(checked[0], rtl)[axis];
237
+ const correction = (target[axis] - guess) / perPx;
238
+ element.style.setProperty(property, `${-size + correction}px`);
239
+ if (checked.some((box, index) => {
240
+ const landed = placeOf(box, rtl);
241
+ return Math.abs(landed.block - targets[index].block) > 1 || Math.abs(landed.inline - targets[index].inline) > 1;
242
+ })) {
243
+ if (own === "") element.style.removeProperty(property);
244
+ else element.style.setProperty(property, own, ownPriority);
245
+ return false;
246
+ }
247
+ return true;
248
+ }
249
+ /** Exits holding an element back, so a release can stop one. */
250
+ const exits = sharedWeakMap("motion/animated-layout/exits", 1);
251
+ const replaced = sharedWeakMap("motion/animated-layout/replaced", 1);
252
+ /**
253
+ * The changed element's exit (`spec:AST-105` FR4): content that disappears
254
+ * keeps its place on screen but gives up its space (a negative end margin
255
+ * measured against the layout without it, so the content after it glides up
256
+ * at once to exactly where it ends, and it still scrolls and clips with its
257
+ * container), is inert (no focus, no pointer, nothing read), conceals upward
258
+ * from its bottom edge on the same motion, and then `done` runs, when the
259
+ * component hides or unmounts it. Under Reduce Motion with a coarse primary pointer it
260
+ * fades instead. Call it in the layout effect of the commit that closes the
261
+ * element, after the change's `animate()` reported it measured, in the same
262
+ * task: the glide reads the layout once the element has given up its space.
263
+ *
264
+ * It conceals to its block-end edge by default, or to the `edge` it is given
265
+ * (`spec:AST-105` FR9), and its edge rides the glide of the content on that
266
+ * side once it starts; a conceal that reverses a running reveal (a close
267
+ * while it opens) starts from what the element shows.
268
+ *
269
+ * Returns false, holding nothing, when the exit lands at once: no handle, a
270
+ * close no change in the area measured, outside the area or its visible part,
271
+ * Reduce Motion with a fine pointer, or a layout no end margin can free (a
272
+ * grid track and its gap, a flex-row item that sets its row's height); in
273
+ * that last case the content after it takes its final place at once too.
274
+ * The component then hides the element itself.
275
+ */
276
+ function holdLayoutExit(handle, element, done, { edge = "block-end" } = {}) {
277
+ if (handle == null) return false;
278
+ const area = areaOf(handle, element);
279
+ if (area == null || !intersects(element.getBoundingClientRect(), visibleRect(area))) return false;
280
+ const batch = batches.get(area);
281
+ if (batch == null || ![...batch.changed].some((changed) => changed === element || changed.contains(element))) return false;
282
+ const motion = layoutMotion(area);
283
+ if (motion.kind === "instant") return false;
284
+ releaseLayoutExit(element);
285
+ const prior = {
286
+ inert: element.hasAttribute("inert"),
287
+ styles: EXIT_PROPERTIES.map((property) => [
288
+ property,
289
+ element.style.getPropertyValue(property),
290
+ element.style.getPropertyPriority(property)
291
+ ])
292
+ };
293
+ if (!giveUpSpace(element, area, edge)) {
294
+ for (const changed of [...batch.changed]) if (changed === element || changed.contains(element)) batch.changed.delete(changed);
295
+ return false;
296
+ }
297
+ replaced.set(element, prior);
298
+ element.setAttribute("inert", "");
299
+ element.style.setProperty("pointer-events", "none");
300
+ const from = shownAtStart(element, 1);
301
+ const rtl = edge.startsWith("inline") && isRtl(element);
302
+ const change = changeStartOf(batch);
303
+ let animation;
304
+ if (motion.kind === "fade") animation = safeAnimate(element, [{ opacity: from }, { opacity: 0 }], {
305
+ duration: motion.durationMs,
306
+ easing: motion.easing,
307
+ fill: "forwards"
308
+ }, change);
309
+ else {
310
+ const { progress } = motion;
311
+ const extent = edge.startsWith("block") ? extentOf(element, edge) : 0;
312
+ const sliding = slidingParts(element, edge, area, extent);
313
+ const partMotions = slideParts(sliding, progress, change, (remaining) => slideFrame(edge, (1 - from * remaining) * extent), "forwards");
314
+ animation = safeAnimate(element, sampleKeyframes(progress, (remaining) => {
315
+ const shown = from * remaining;
316
+ return partMotions.length > 0 ? { opacity: shown } : {
317
+ opacity: shown,
318
+ clipPath: fractionClip(edge, 1 - shown, rtl)
319
+ };
320
+ }), {
321
+ duration: progress.durationMs,
322
+ easing: "linear",
323
+ fill: "forwards"
324
+ }, change);
325
+ if (animation == null) for (const part of partMotions) part.cancel();
326
+ else rideEdge(element, area, edge, rtl, trackEdgeMotion(element, animation, (t) => from * progress.remaining(t), partMotions, partMotions.length > 0 && sliding != null ? holdSlideClip(element, sliding.clip) : void 0, true), true);
327
+ }
328
+ exits.set(element, animation);
329
+ if (animation == null) {
330
+ done();
331
+ return true;
332
+ }
333
+ animation.addEventListener?.("finish", () => {
334
+ if (exits.get(element) === animation) done();
335
+ });
336
+ return true;
337
+ }
338
+ /**
339
+ * Puts an element `holdLayoutExit` held back: stops its exit and puts back
340
+ * what the exit replaced (its `inert` and inline values as they were). Called
341
+ * once the component has hidden the element, or when the element opens again
342
+ * mid-exit.
343
+ */
344
+ function releaseLayoutExit(element) {
345
+ if (!exits.has(element)) return;
346
+ const running = edgeMotions.get(element);
347
+ if (running != null) {
348
+ edgeMotions.delete(element);
349
+ stoppedShown.set(element, {
350
+ fraction: shownNow(running),
351
+ at: timelineNow(element)
352
+ });
353
+ stopSlides(running);
354
+ }
355
+ const held = heldSlides.get(element);
356
+ heldSlides.delete(element);
357
+ if (held != null) stopSlides(held);
358
+ exits.get(element)?.cancel();
359
+ exits.delete(element);
360
+ const prior = replaced.get(element);
361
+ replaced.delete(element);
362
+ if (prior?.inert !== true) element.removeAttribute("inert");
363
+ for (const [property, value, priority] of prior?.styles ?? []) if (value === "") element.style.removeProperty(property);
364
+ else element.style.setProperty(property, value, priority);
365
+ }
366
+ //#endregion
367
+ //#region src/motion/layout/edgeRide.ts
368
+ /** Each exit's motion, whose parts hold their slides until its release. */
369
+ const heldSlides = sharedWeakMap("motion/animated-layout/held-slides", 1);
370
+ /** Each element's running one-state reveal or conceal. */
371
+ const edgeMotions = sharedWeakMap("motion/animated-layout/edge-motions", 1);
372
+ /**
373
+ * What a one-state motion an adopter stopped (`releaseLayoutExit`) showed,
374
+ * and the timeline time it stopped at: a reveal started in the same frame,
375
+ * the reversal that stopped it, starts there.
376
+ */
377
+ const stoppedShown = sharedWeakMap("motion/animated-layout/stopped-shown", 1);
378
+ function timelineNow(element) {
379
+ return Number(element.ownerDocument.timeline?.currentTime ?? NaN);
380
+ }
381
+ /** What `motion` shows now, by its animation's own clock. */
382
+ function shownNow(motion) {
383
+ const time = Number(motion.animation.currentTime);
384
+ return motion.shownAt(Number.isFinite(time) ? Math.max(0, time) : 0);
385
+ }
386
+ /**
387
+ * What `element` shows as a reveal or conceal starts: where the one-state
388
+ * motion this one reverses had got to (it stops there), or `atRest`, all of
389
+ * it for a conceal and nothing for a reveal.
390
+ */
391
+ function shownAtStart(element, atRest) {
392
+ const running = edgeMotions.get(element);
393
+ if (running != null) {
394
+ edgeMotions.delete(element);
395
+ const fraction = shownNow(running);
396
+ running.animation.cancel();
397
+ stopSlides(running);
398
+ return fraction;
399
+ }
400
+ const stopped = stoppedShown.get(element);
401
+ stoppedShown.delete(element);
402
+ if (stopped != null && stopped.at === timelineNow(element)) return stopped.fraction;
403
+ return atRest;
404
+ }
405
+ /** Stops `motion`'s sliding parts and puts back the element's clip, once. */
406
+ function stopSlides(motion) {
407
+ motion.release();
408
+ }
409
+ /** Records `animation` as `element`'s running one-state motion. */
410
+ function trackEdgeMotion(element, animation, shownAt, slides = [], release = () => {}, isHeldToRelease = false) {
411
+ let isReleased = false;
412
+ const motion = {
413
+ animation,
414
+ shownAt,
415
+ slides,
416
+ release: () => {
417
+ if (!isReleased) {
418
+ isReleased = true;
419
+ for (const slide of slides) stopGlideOf(slide);
420
+ release();
421
+ }
422
+ }
423
+ };
424
+ edgeMotions.set(element, motion);
425
+ if (isHeldToRelease) heldSlides.set(element, motion);
426
+ animation.addEventListener?.("finish", () => {
427
+ if (edgeMotions.get(element) === motion) {
428
+ edgeMotions.delete(element);
429
+ if (!isHeldToRelease) motion.release();
430
+ }
431
+ });
432
+ return motion;
433
+ }
434
+ /**
435
+ * After this commit's glides start (the batch flushes in a microtask queued
436
+ * before this one), before the frame paints: once the content on `edge`'s
437
+ * side glides, the moving edge rides that glide, frame by frame, so the two
438
+ * never part, a reversal included (the glide carries its running motion).
439
+ * `hiddenAt` turns that content's offset towards the edge's side into the
440
+ * length the element hides; `frame` turns that length into a keyframe.
441
+ * Without that glide (nothing on that side in the area, or nothing that
442
+ * moves) the motion keeps its own curve. The animation is kept, its frames
443
+ * replaced; `onRide` hears the ridden hidden length over time.
444
+ */
445
+ function rideNeighbour(element, area, edge, rtl, animation, isCurrent, hiddenAt, frame, onRide) {
446
+ const effect = animation.effect;
447
+ if (effect == null || typeof effect.setKeyframes !== "function") return;
448
+ queueMicrotask(() => {
449
+ if (!isCurrent()) return;
450
+ const isEnd = edge.endsWith("end");
451
+ const neighbour = isEnd ? nextInFlow(element, area) : previousInFlow(element, area);
452
+ const glide = neighbour == null ? null : glideMoving(neighbour, element, area);
453
+ if (neighbour == null || glide == null) return;
454
+ const own = glideMoving(element, neighbour, area);
455
+ const glideAt = startedBefore(glide, animation);
456
+ const ownAt = own == null ? 0 : startedBefore(own, animation);
457
+ const durationMs = Math.max(glide.durationMs - glideAt, own == null ? 0 : own.durationMs - ownAt);
458
+ const sign = isEnd ? 1 : -1;
459
+ const hidden = (t) => {
460
+ const offset = glide.offsetAt(glideAt + t);
461
+ const moved = own?.offsetAt(ownAt + t) ?? {
462
+ x: 0,
463
+ y: 0
464
+ };
465
+ return hiddenAt(sign * (edge.startsWith("inline") ? (rtl ? -1 : 1) * (offset.x - moved.x) : offset.y - moved.y));
466
+ };
467
+ const frames = sampleOver(durationMs, (t) => frame(hidden(t)));
468
+ effect.setKeyframes(frames);
469
+ effect.updateTiming?.({ duration: durationMs });
470
+ retimeSettle(animation, frames, durationMs);
471
+ onRide(hidden, durationMs);
472
+ });
473
+ }
474
+ /**
475
+ * The one-state reveal or conceal rides the content on its edge's side: the
476
+ * element shows what lies between its fixed edge and that content, a reveal
477
+ * less by however far the content still is from its place towards it, a
478
+ * conceal all of it less however far the content has come, fading with what
479
+ * it hides.
480
+ */
481
+ function rideEdge(element, area, edge, rtl, motion, isConceal) {
482
+ const extent = extentOf(element, edge);
483
+ if (!(extent > 0)) return;
484
+ rideNeighbour(element, area, edge, rtl, motion.animation, () => edgeMotions.get(element) === motion, (towards) => Math.min(extent, Math.max(0, isConceal ? extent - towards : -towards)), (hidden) => motion.slides.length > 0 ? { opacity: 1 - hidden / extent } : {
485
+ opacity: 1 - hidden / extent,
486
+ clipPath: pxClip(edge, hidden, rtl)
487
+ }, (hiddenAt, durationMs) => {
488
+ motion.shownAt = (t) => 1 - hiddenAt(t) / extent;
489
+ for (const slide of motion.slides) {
490
+ const effect = slide.effect;
491
+ const frames = sampleOver(durationMs, (t) => slideFrame(edge, hiddenAt(t)));
492
+ effect?.setKeyframes?.(frames);
493
+ effect?.updateTiming?.({ duration: durationMs });
494
+ retimeSettle(slide, frames, durationMs);
495
+ }
496
+ });
497
+ }
498
+ //#endregion
499
+ export { releaseLayoutExit as n, playLayoutChange as r, holdLayoutExit as t };
@@ -0,0 +1,19 @@
1
+ import { nextTick, watch } from "vue";
2
+ //#region src/composables/internal/focusAcrossSwap.ts
3
+ /**
4
+ * 切换 `swapped` 会让 `root` 里某个元素被换成另一个元素(比如禁用后用普通
5
+ * `<a>` 代替路由链接组件)。切换前焦点就在它身上的话,换完后把焦点交给新元素,
6
+ * 不让它掉回页面;焦点本来在别处则不去抢。
7
+ */
8
+ function useFocusAcrossSwap(root, selector, swapped) {
9
+ watch(swapped, () => {
10
+ const before = root()?.querySelector(selector) ?? null;
11
+ if (before == null || before.ownerDocument.activeElement !== before) return;
12
+ nextTick(() => {
13
+ const after = root()?.querySelector(selector);
14
+ if (after != null && after !== before) after.focus({ preventScroll: true });
15
+ });
16
+ }, { flush: "pre" });
17
+ }
18
+ //#endregion
19
+ export { useFocusAcrossSwap as t };
@@ -0,0 +1,81 @@
1
+ import { r as getFocusables } from "./focus-x7mxEqjR.js";
2
+ //#region src/composables/internal/focusRegion.ts
3
+ /**
4
+ * 焦点区域(useFocusTrap)找 Tab 落脚点、判断谁来接这次 Tab 用的几个小工具。
5
+ * 对应原版 Astryx `hooks/useFocusTrap` 和 `hooks/focusableSelector` 里的同名逻辑。
6
+ */
7
+ /** `a` 在文档顺序上是否排在 `b` 前面。 */
8
+ function precedes(a, b) {
9
+ return (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0;
10
+ }
11
+ /** 按文档顺序排好。浏览器的 querySelectorAll 本来就是文档顺序,jsdom 可能按选择器分组返回。 */
12
+ function inDocumentOrder(nodes) {
13
+ return [...nodes].sort((a, b) => precedes(a, b) ? -1 : 1);
14
+ }
15
+ function isShownAsPopover(element) {
16
+ try {
17
+ return element.matches(":popover-open");
18
+ } catch {
19
+ return false;
20
+ }
21
+ }
22
+ /** 对话框在顶层里:打开了,或者作为 popover 显示着。 */
23
+ function isDialogShown(dialog) {
24
+ return dialog.open || isShownAsPopover(dialog);
25
+ }
26
+ /**
27
+ * 元素是否在一个页面不显示的、关着的 `<dialog>` 里。这样的对话框什么都不画,里面也不能聚焦。
28
+ * 关着但页面把它按普通流显示出来的对话框有盒子,里面的控件照样是 Tab 落脚点。
29
+ */
30
+ function isInHiddenClosedDialog(element) {
31
+ for (let dialog = element.closest("dialog"); dialog != null; dialog = dialog.parentElement?.closest("dialog") ?? null) if (!isDialogShown(dialog) && dialog.ownerDocument.defaultView?.getComputedStyle(dialog).display === "none") return true;
32
+ return false;
33
+ }
34
+ function radioNameOf(element) {
35
+ if (!element.matches("input[type=\"radio\"][name]")) return null;
36
+ return element.name || null;
37
+ }
38
+ function isSameRadioGroup(a, b) {
39
+ const name = radioNameOf(a);
40
+ return name != null && name === radioNameOf(b) && a.form === b.form;
41
+ }
42
+ /**
43
+ * 去掉浏览器按 Tab 时会跳过的单选框,其余元素原样保留。
44
+ * 同名单选组只停一站:有焦点的那个,否则选中的那个;一个都没选时整组都留着,
45
+ * 正向进入落在第一个,反向进入落在最后一个。
46
+ */
47
+ function collapseRadioGroups(elements, active) {
48
+ return elements.filter((element) => {
49
+ if (radioNameOf(element) == null) return true;
50
+ if (active != null && isSameRadioGroup(element, active)) return element === active;
51
+ return element.checked || !elements.some((other) => isSameRadioGroup(element, other) && other.checked);
52
+ });
53
+ }
54
+ /** 容器里能被 Tab 走到的元素,按文档顺序,不含藏在关着的对话框里的。 */
55
+ function focusablesIn(container) {
56
+ return inDocumentOrder(getFocusables(container)).filter((element) => !isInHiddenClosedDialog(element));
57
+ }
58
+ /** 试着聚焦,返回焦点是否真的过去了。被模态层盖住(inert)的元素会拒绝。 */
59
+ function attemptFocus(element) {
60
+ try {
61
+ element.focus();
62
+ } catch {
63
+ return false;
64
+ }
65
+ return element.ownerDocument.activeElement === element;
66
+ }
67
+ /** 当前启用的焦点区域容器。区域嵌套时,握着焦点的最里层那个接 Tab。 */
68
+ const activeRegions = /* @__PURE__ */ new Set();
69
+ function registerRegion(container) {
70
+ activeRegions.add(container);
71
+ return () => activeRegions.delete(container);
72
+ }
73
+ /** 焦点是否握在嵌套在 `container` 里的另一个区域(或另一个打开的 `<dialog>`)手里。那时由它接 Tab。 */
74
+ function hasInnerRegionHolding(container, active) {
75
+ const dialog = active.closest("dialog[open]");
76
+ if (dialog != null && dialog !== container && container.contains(dialog)) return true;
77
+ for (const other of activeRegions) if (other !== container && container.contains(other) && other.contains(active)) return true;
78
+ return false;
79
+ }
80
+ //#endregion
81
+ export { inDocumentOrder as a, hasInnerRegionHolding as i, collapseRadioGroups as n, precedes as o, focusablesIn as r, registerRegion as s, attemptFocus as t };
@@ -455,4 +455,4 @@ function areaOf(handle, element) {
455
455
  return area != null && area !== element && area.contains(element) ? area : null;
456
456
  }
457
457
  //#endregion
458
- export { sharedMap as _, registerReducedMotionCrossFade as a, sharedWeakSet as b, parseCssEasing as c, registerSpringRole as d, isSpring as f, writePresentedResolve as g, registerPresentedOffset as h, reducedMotionCrossFade as i, parseMotionRoleValue as l, clearPresentedResolve as m, createAnimatedLayout as n, motionRoleIn as o, batchPresented as p, cubicBezier as r, motionRoleOf as s, areaOf as t, registerMotionTable as u, sharedState as v, themeReducesMotion as x, sharedWeakMap as y };
458
+ export { themeReducesMotion as S, writePresentedResolve as _, reducedMotionCrossFade as a, sharedWeakMap as b, motionRoleOf as c, registerMotionTable as d, registerSpringRole as f, registerPresentedOffset as g, clearPresentedResolve as h, cubicBezier as i, parseCssEasing as l, batchPresented as m, createAnimatedLayout as n, registerReducedMotionCrossFade as o, isSpring as p, readArea as r, motionRoleIn as s, areaOf as t, parseMotionRoleValue as u, sharedMap as v, sharedWeakSet as x, sharedState as y };
@@ -123,8 +123,8 @@ declare const __VLS_base$1: import("vue").DefineComponent<__VLS_PublicProps, {
123
123
  onChange?: ((value: string) => any) | undefined;
124
124
  "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
125
125
  }>, {
126
- isDisabled: boolean;
127
126
  layout: SegmentedControlLayout;
127
+ isDisabled: boolean;
128
128
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
129
129
  declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
130
130
  declare const _default$1: typeof __VLS_export$1;
@@ -8,12 +8,12 @@ declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {
8
8
  }, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{
9
9
  onClick?: ((event: MouseEvent) => any) | undefined;
10
10
  }>, {
11
- type: "button" | "reset" | "submit";
12
- isDisabled: boolean;
13
- elevation: ButtonElevation;
14
- isLoading: boolean;
11
+ type: "button" | "submit" | "reset";
15
12
  isIconOnly: boolean;
13
+ elevation: ButtonElevation;
14
+ isDisabled: boolean;
16
15
  isInterruptible: boolean;
16
+ isLoading: boolean;
17
17
  loadingLabel: string;
18
18
  variant: ButtonVariant;
19
19
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;