@astryxdesign/core 0.7.5-canary.fccd771 → 0.7.5

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 (1346) hide show
  1. package/CHANGELOG.md +211 -10
  2. package/README.md +15 -12
  3. package/dist/AlertDialog/AlertDialog.js +1 -1
  4. package/dist/AppShell/AppShell.d.ts +0 -22
  5. package/dist/AppShell/AppShell.d.ts.map +1 -1
  6. package/dist/AppShell/AppShell.js +155 -1
  7. package/dist/Avatar/AvatarStatusDot.js +2 -2
  8. package/dist/Badge/Badge.d.ts.map +1 -1
  9. package/dist/Badge/Badge.js +18 -2
  10. package/dist/Banner/Banner.d.ts +1 -0
  11. package/dist/Banner/Banner.d.ts.map +1 -1
  12. package/dist/Banner/Banner.js +64 -9
  13. package/dist/BottomSheet/BottomSheet.d.ts +53 -5
  14. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  15. package/dist/BottomSheet/BottomSheet.js +435 -198
  16. package/dist/BottomSheet/BottomSheetHostContext.d.ts +8 -0
  17. package/dist/BottomSheet/BottomSheetHostContext.d.ts.map +1 -0
  18. package/dist/BottomSheet/BottomSheetHostContext.js +35 -0
  19. package/dist/BottomSheet/BottomSheetPanel.d.ts +9 -1
  20. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  21. package/dist/BottomSheet/BottomSheetPanel.js +77 -23
  22. package/dist/BottomSheet/BottomSheetSwitcher.d.ts +53 -14
  23. package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
  24. package/dist/BottomSheet/BottomSheetSwitcher.js +229 -27
  25. package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +6 -0
  26. package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
  27. package/dist/BottomSheet/bottomSheetEscape.d.ts +3 -0
  28. package/dist/BottomSheet/bottomSheetEscape.d.ts.map +1 -0
  29. package/dist/BottomSheet/bottomSheetEscape.js +20 -0
  30. package/dist/BottomSheet/bottomSheetStack.d.ts +262 -0
  31. package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -0
  32. package/dist/BottomSheet/bottomSheetStack.js +1675 -0
  33. package/dist/BottomSheet/useSheetGestures.d.ts +19 -3
  34. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  35. package/dist/BottomSheet/useSheetGestures.js +43 -14
  36. package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
  37. package/dist/Breadcrumbs/BreadcrumbItem.js +36 -3
  38. package/dist/Button/Button.d.ts.map +1 -1
  39. package/dist/Button/Button.js +18 -7
  40. package/dist/Chat/ChatComposer.d.ts.map +1 -1
  41. package/dist/Chat/ChatComposer.js +25 -32
  42. package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
  43. package/dist/Chat/ChatComposerInput.js +55 -16
  44. package/dist/Chat/ChatMessageMetadata.js +2 -2
  45. package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
  46. package/dist/Chat/ChatPastedTextToken.js +7 -6
  47. package/dist/Chat/ChatToolCalls.js +4 -4
  48. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  49. package/dist/ClickableCard/ClickableCard.js +10 -6
  50. package/dist/CodeBlock/CodeBlock.d.ts +25 -2
  51. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  52. package/dist/CodeBlock/CodeBlock.js +58 -19
  53. package/dist/CodeBlock/grammar.d.ts +134 -0
  54. package/dist/CodeBlock/grammar.d.ts.map +1 -0
  55. package/dist/CodeBlock/grammar.js +219 -0
  56. package/dist/CodeBlock/index.d.ts +2 -0
  57. package/dist/CodeBlock/index.d.ts.map +1 -1
  58. package/dist/CodeBlock/index.js +1 -0
  59. package/dist/CodeBlock/languages/dockerfile.d.ts +3 -0
  60. package/dist/CodeBlock/languages/dockerfile.d.ts.map +1 -0
  61. package/dist/CodeBlock/languages/dockerfile.js +45 -0
  62. package/dist/CodeBlock/languages/graphql.d.ts +3 -0
  63. package/dist/CodeBlock/languages/graphql.d.ts.map +1 -0
  64. package/dist/CodeBlock/languages/graphql.js +27 -0
  65. package/dist/CodeBlock/languages/java.d.ts +3 -0
  66. package/dist/CodeBlock/languages/java.d.ts.map +1 -0
  67. package/dist/CodeBlock/languages/java.js +24 -0
  68. package/dist/CodeBlock/languages/lua.d.ts +3 -0
  69. package/dist/CodeBlock/languages/lua.d.ts.map +1 -0
  70. package/dist/CodeBlock/languages/lua.js +21 -0
  71. package/dist/CodeBlock/languages/objective-c.d.ts +3 -0
  72. package/dist/CodeBlock/languages/objective-c.d.ts.map +1 -0
  73. package/dist/CodeBlock/languages/objective-c.js +27 -0
  74. package/dist/CodeBlock/languages/powershell.d.ts +3 -0
  75. package/dist/CodeBlock/languages/powershell.d.ts.map +1 -0
  76. package/dist/CodeBlock/languages/powershell.js +30 -0
  77. package/dist/CodeBlock/languages/ruby.d.ts +3 -0
  78. package/dist/CodeBlock/languages/ruby.d.ts.map +1 -0
  79. package/dist/CodeBlock/languages/ruby.js +24 -0
  80. package/dist/CodeBlock/languages/thrift.d.ts +3 -0
  81. package/dist/CodeBlock/languages/thrift.d.ts.map +1 -0
  82. package/dist/CodeBlock/languages/thrift.js +18 -0
  83. package/dist/CodeBlock/languages/toml.d.ts +3 -0
  84. package/dist/CodeBlock/languages/toml.d.ts.map +1 -0
  85. package/dist/CodeBlock/languages/toml.js +53 -0
  86. package/dist/CodeBlock/tokenizer.d.ts +8 -4
  87. package/dist/CodeBlock/tokenizer.d.ts.map +1 -1
  88. package/dist/CodeBlock/tokenizer.js +158 -8
  89. package/dist/Collapsible/Collapsible.d.ts +8 -1
  90. package/dist/Collapsible/Collapsible.d.ts.map +1 -1
  91. package/dist/Collapsible/Collapsible.js +84 -2
  92. package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
  93. package/dist/CommandPalette/CommandPalette.js +15 -1
  94. package/dist/CommandPalette/CommandPaletteEmpty.d.ts.map +1 -1
  95. package/dist/CommandPalette/CommandPaletteEmpty.js +1 -0
  96. package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
  97. package/dist/CommandPalette/CommandPaletteInput.js +14 -2
  98. package/dist/CommandPalette/busyStartSettle.d.ts +4 -0
  99. package/dist/CommandPalette/busyStartSettle.d.ts.map +1 -0
  100. package/dist/CommandPalette/busyStartSettle.js +23 -0
  101. package/dist/ComplexSelector/ComplexSelector.d.ts +20 -2
  102. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  103. package/dist/ComplexSelector/ComplexSelector.js +42 -7
  104. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  105. package/dist/ContextMenu/ContextMenu.js +48 -13
  106. package/dist/DateInput/DateInput.d.ts.map +1 -1
  107. package/dist/DateInput/DateInput.js +12 -5
  108. package/dist/DateInput/NativeDateField.d.ts.map +1 -1
  109. package/dist/DateInput/NativeDateField.js +2 -1
  110. package/dist/DateInput/TouchDateField.d.ts.map +1 -1
  111. package/dist/DateInput/TouchDateField.js +2 -1
  112. package/dist/DateInput/Wheel.d.ts.map +1 -1
  113. package/dist/DateInput/Wheel.js +1 -1
  114. package/dist/Dialog/Dialog.d.ts +4 -0
  115. package/dist/Dialog/Dialog.d.ts.map +1 -1
  116. package/dist/Dialog/Dialog.js +20 -8
  117. package/dist/Drawer/Drawer.d.ts.map +1 -1
  118. package/dist/Drawer/Drawer.js +18 -13
  119. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  120. package/dist/DropdownMenu/DropdownMenu.js +34 -30
  121. package/dist/DropdownMenu/DropdownMenuGroup.d.ts +7 -4
  122. package/dist/DropdownMenu/DropdownMenuGroup.d.ts.map +1 -1
  123. package/dist/DropdownMenu/DropdownMenuGroup.js +10 -4
  124. package/dist/DropdownMenu/DropdownMenuItem.js +3 -3
  125. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +10 -5
  126. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
  127. package/dist/DropdownMenu/DropdownMenuRadioItem.js +13 -5
  128. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +6 -6
  129. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  130. package/dist/DropdownMenu/DropdownMenuSubMenu.js +0 -3
  131. package/dist/DropdownMenu/MenuBottomSheet.d.ts +11 -4
  132. package/dist/DropdownMenu/MenuBottomSheet.d.ts.map +1 -1
  133. package/dist/DropdownMenu/MenuBottomSheet.js +35 -9
  134. package/dist/DropdownMenu/MenuBottomSheetActionList.js +3 -3
  135. package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +2 -0
  136. package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
  137. package/dist/DropdownMenu/lazyMenuBottomSheet.js +25 -3
  138. package/dist/DropdownMenu/menuBottomSheet.stylex.d.ts +23 -0
  139. package/dist/DropdownMenu/menuBottomSheet.stylex.d.ts.map +1 -0
  140. package/dist/DropdownMenu/menuBottomSheet.stylex.js +29 -0
  141. package/dist/DropdownMenu/menuItemHover.d.ts +3 -0
  142. package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -1
  143. package/dist/DropdownMenu/menuItemHover.js +14 -1
  144. package/dist/DropdownMenu/menuTouchAction.stylex.d.ts +25 -0
  145. package/dist/DropdownMenu/menuTouchAction.stylex.d.ts.map +1 -0
  146. package/dist/DropdownMenu/menuTouchAction.stylex.js +29 -0
  147. package/dist/DropdownMenu/useMenuDrillIn.d.ts.map +1 -1
  148. package/dist/DropdownMenu/useMenuDrillIn.js +7 -5
  149. package/dist/EmptyState/EmptyState.d.ts +4 -2
  150. package/dist/EmptyState/EmptyState.d.ts.map +1 -1
  151. package/dist/EmptyState/EmptyState.js +6 -4
  152. package/dist/Field/Field.js +1 -1
  153. package/dist/Field/FieldLabel.js +1 -1
  154. package/dist/Field/PanelSearchInput.d.ts +9 -1
  155. package/dist/Field/PanelSearchInput.d.ts.map +1 -1
  156. package/dist/Field/PanelSearchInput.js +31 -22
  157. package/dist/Field/inputDisabledFocus.d.ts +14 -0
  158. package/dist/Field/inputDisabledFocus.d.ts.map +1 -0
  159. package/dist/Field/inputDisabledFocus.js +19 -0
  160. package/dist/Field/inputStyles.stylex.d.ts +9 -9
  161. package/dist/Field/inputStyles.stylex.js +9 -9
  162. package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
  163. package/dist/FieldStatus/FieldStatus.js +7 -3
  164. package/dist/FileInput/FileInput.d.ts.map +1 -1
  165. package/dist/FileInput/FileInput.js +22 -12
  166. package/dist/Icon/Icon.d.ts +37 -5
  167. package/dist/Icon/Icon.d.ts.map +1 -1
  168. package/dist/Icon/Icon.js +65 -11
  169. package/dist/Icon/IconSize.stylex.d.ts +16 -11
  170. package/dist/Icon/IconSize.stylex.d.ts.map +1 -1
  171. package/dist/Icon/IconSize.stylex.js +27 -11
  172. package/dist/Icon/globalIconRegistry.d.ts +71 -4
  173. package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
  174. package/dist/Icon/globalIconRegistry.js +163 -23
  175. package/dist/Icon/index.d.ts +26 -2
  176. package/dist/Icon/index.d.ts.map +1 -1
  177. package/dist/Icon/index.js +24 -1
  178. package/dist/Icon/useIcon.d.ts +5 -1
  179. package/dist/Icon/useIcon.d.ts.map +1 -1
  180. package/dist/Icon/useIcon.js +5 -1
  181. package/dist/InputGroup/InputGroup.d.ts +1 -1
  182. package/dist/InputGroup/InputGroup.d.ts.map +1 -1
  183. package/dist/InputGroup/InputGroup.js +46 -36
  184. package/dist/InputGroup/InputGroupInternalContext.d.ts +4 -0
  185. package/dist/InputGroup/InputGroupInternalContext.d.ts.map +1 -0
  186. package/dist/InputGroup/InputGroupInternalContext.js +15 -0
  187. package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
  188. package/dist/InputGroup/InputGroupText.js +2 -0
  189. package/dist/InputGroup/groupStyles.d.ts +9 -0
  190. package/dist/InputGroup/groupStyles.d.ts.map +1 -1
  191. package/dist/InputGroup/groupStyles.js +28 -14
  192. package/dist/Item/Item.d.ts +5 -1
  193. package/dist/Item/Item.d.ts.map +1 -1
  194. package/dist/Item/Item.js +23 -7
  195. package/dist/Item/ItemMarkerColumns.a11y.chromium.spec.d.ts +2 -0
  196. package/dist/Item/ItemMarkerColumns.a11y.chromium.spec.d.ts.map +1 -0
  197. package/dist/Item/ItemMarkerColumns.a11y.chromium.spec.js +132 -0
  198. package/dist/Item/ItemMarkerColumnsContext.d.ts +14 -0
  199. package/dist/Item/ItemMarkerColumnsContext.d.ts.map +1 -0
  200. package/dist/Item/ItemMarkerColumnsContext.js +18 -0
  201. package/dist/Item/ItemSwipeLayer.d.ts.map +1 -1
  202. package/dist/Item/ItemSwipeLayer.js +3 -0
  203. package/dist/Item/useSwipeAction.d.ts.map +1 -1
  204. package/dist/Item/useSwipeAction.js +60 -5
  205. package/dist/Kbd/Kbd.d.ts +2 -2
  206. package/dist/Kbd/Kbd.d.ts.map +1 -1
  207. package/dist/Kbd/Kbd.js +18 -11
  208. package/dist/Layer/layerAnimations.stylex.d.ts +9 -5
  209. package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
  210. package/dist/Layer/layerAnimations.stylex.js +23 -10
  211. package/dist/Layer/layerSlideRules.d.ts +62 -2
  212. package/dist/Layer/layerSlideRules.d.ts.map +1 -1
  213. package/dist/Layer/layerSlideRules.js +124 -3
  214. package/dist/Layer/layerStack.d.ts +12 -9
  215. package/dist/Layer/layerStack.d.ts.map +1 -1
  216. package/dist/Layer/layerStack.js +116 -53
  217. package/dist/Layer/modalOutlet.d.ts +44 -6
  218. package/dist/Layer/modalOutlet.d.ts.map +1 -1
  219. package/dist/Layer/modalOutlet.js +150 -14
  220. package/dist/Layer/preserveAnimations.d.ts +11 -0
  221. package/dist/Layer/preserveAnimations.d.ts.map +1 -0
  222. package/dist/Layer/preserveAnimations.js +245 -0
  223. package/dist/Layer/useLayer.d.ts +19 -2
  224. package/dist/Layer/useLayer.d.ts.map +1 -1
  225. package/dist/Layer/useLayer.js +531 -44
  226. package/dist/Layer/useLayerDismissal.d.ts +10 -7
  227. package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
  228. package/dist/Layer/useLayerDismissal.js +8 -8
  229. package/dist/Layer/useTouchTrigger.d.ts +14 -1
  230. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  231. package/dist/Layer/useTouchTrigger.js +72 -17
  232. package/dist/Layout/Layout.d.ts.map +1 -1
  233. package/dist/Layout/Layout.js +4 -0
  234. package/dist/Layout/LayoutContent.d.ts.map +1 -1
  235. package/dist/Layout/LayoutContent.js +2 -2
  236. package/dist/Layout/LayoutFooter.d.ts.map +1 -1
  237. package/dist/Layout/LayoutFooter.js +2 -1
  238. package/dist/Layout/LayoutHeader.d.ts.map +1 -1
  239. package/dist/Layout/LayoutHeader.js +2 -1
  240. package/dist/Layout/layoutEdges.stylex.d.ts +20 -0
  241. package/dist/Layout/layoutEdges.stylex.d.ts.map +1 -0
  242. package/dist/Layout/layoutEdges.stylex.js +28 -0
  243. package/dist/Lightbox/Lightbox.d.ts +5 -2
  244. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  245. package/dist/Lightbox/Lightbox.js +111 -89
  246. package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.d.ts +2 -0
  247. package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.d.ts.map +1 -0
  248. package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.js +78 -0
  249. package/dist/Lightbox/LightboxViewport.a11y.browser.spec.d.ts +2 -0
  250. package/dist/Lightbox/LightboxViewport.a11y.browser.spec.d.ts.map +1 -0
  251. package/dist/Lightbox/LightboxViewport.a11y.browser.spec.js +65 -0
  252. package/dist/List/List.d.ts +2 -1
  253. package/dist/List/List.d.ts.map +1 -1
  254. package/dist/List/List.js +9 -2
  255. package/dist/List/ListContext.d.ts +16 -4
  256. package/dist/List/ListContext.d.ts.map +1 -1
  257. package/dist/List/ListContext.js +10 -5
  258. package/dist/List/ListItem.d.ts +7 -1
  259. package/dist/List/ListItem.d.ts.map +1 -1
  260. package/dist/List/ListItem.js +52 -8
  261. package/dist/List/ListMarkers.a11y.chromium.spec.d.ts +2 -0
  262. package/dist/List/ListMarkers.a11y.chromium.spec.d.ts.map +1 -0
  263. package/dist/List/ListMarkers.a11y.chromium.spec.js +677 -0
  264. package/dist/Markdown/Markdown.d.ts +11 -1
  265. package/dist/Markdown/Markdown.d.ts.map +1 -1
  266. package/dist/Markdown/Markdown.fr23.bench.js +3 -1
  267. package/dist/Markdown/Markdown.fr23.sampling.d.ts +16 -0
  268. package/dist/Markdown/Markdown.fr23.sampling.d.ts.map +1 -1
  269. package/dist/Markdown/Markdown.fr23.sampling.js +13 -4
  270. package/dist/Markdown/Markdown.js +41 -14
  271. package/dist/Markdown/MarkdownTable.a11y.chromium.spec.js +1 -0
  272. package/dist/MobileNav/MobileNav.d.ts +2 -1
  273. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  274. package/dist/MobileNav/MobileNav.js +46 -37
  275. package/dist/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.js +1 -0
  276. package/dist/MobileNav/MobileNavToggle.d.ts +7 -3
  277. package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
  278. package/dist/MobileNav/MobileNavToggle.js +11 -3
  279. package/dist/MultiSelector/CreateRow.a11y.chromium.spec.js +53 -6
  280. package/dist/MultiSelector/MultiSelector.d.ts +1 -1
  281. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  282. package/dist/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.js +1 -0
  283. package/dist/MultiSelector/MultiSelector.js +21 -5
  284. package/dist/MultiSelector/OptionActions.a11y.chromium.spec.js +1 -0
  285. package/dist/NavMenu/NavHeadingMenu.d.ts +1 -1
  286. package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
  287. package/dist/NavMenu/NavHeadingMenu.js +29 -5
  288. package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
  289. package/dist/NavMenu/NavHeadingMenuItem.js +51 -7
  290. package/dist/NavMenu/NavMenuContext.d.ts +9 -0
  291. package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
  292. package/dist/NavMenu/NavMenuContext.js +9 -0
  293. package/dist/NumberInput/NumberInput.d.ts +4 -4
  294. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  295. package/dist/NumberInput/NumberInput.js +61 -24
  296. package/dist/Overlay/Overlay.d.ts +3 -3
  297. package/dist/Overlay/Overlay.d.ts.map +1 -1
  298. package/dist/Overlay/Overlay.js +12 -5
  299. package/dist/Popover/Popover.d.ts +41 -2
  300. package/dist/Popover/Popover.d.ts.map +1 -1
  301. package/dist/Popover/Popover.js +276 -44
  302. package/dist/Popover/index.d.ts +1 -1
  303. package/dist/Popover/index.d.ts.map +1 -1
  304. package/dist/Popover/lazyPopoverBottomSheet.d.ts +23 -0
  305. package/dist/Popover/lazyPopoverBottomSheet.d.ts.map +1 -0
  306. package/dist/Popover/lazyPopoverBottomSheet.js +40 -0
  307. package/dist/Popover/usePopover.d.ts.map +1 -1
  308. package/dist/Popover/usePopover.js +11 -5
  309. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  310. package/dist/PowerSearch/PowerSearch.js +7 -5
  311. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  312. package/dist/ProgressBar/ProgressBar.js +8 -0
  313. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  314. package/dist/RadioList/RadioListItem.js +10 -2
  315. package/dist/ScrollableArea/ScrollableArea.d.ts.map +1 -1
  316. package/dist/ScrollableArea/ScrollableArea.js +1 -1
  317. package/dist/SegmentedControl/SegmentedControl.d.ts +1 -1
  318. package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  319. package/dist/SegmentedControl/SegmentedControl.js +6 -2
  320. package/dist/SelectableCard/SelectableCard.d.ts +5 -5
  321. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  322. package/dist/SelectableCard/SelectableCard.js +15 -11
  323. package/dist/Selector/Selector.d.ts.map +1 -1
  324. package/dist/Selector/Selector.js +27 -8
  325. package/dist/Selector/hooks.d.ts +52 -6
  326. package/dist/Selector/hooks.d.ts.map +1 -1
  327. package/dist/Selector/hooks.js +145 -2
  328. package/dist/SideNav/SideNav.d.ts.map +1 -1
  329. package/dist/SideNav/SideNav.js +58 -2
  330. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  331. package/dist/SideNav/SideNavHeading.js +79 -3
  332. package/dist/SideNav/SideNavItem.d.ts +5 -1
  333. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  334. package/dist/SideNav/SideNavItem.js +36 -13
  335. package/dist/SideNav/railMotion.d.ts +54 -0
  336. package/dist/SideNav/railMotion.d.ts.map +1 -0
  337. package/dist/SideNav/railMotion.js +253 -0
  338. package/dist/Skeleton/Skeleton.d.ts.map +1 -1
  339. package/dist/Skeleton/Skeleton.js +12 -3
  340. package/dist/Slider/Slider.d.ts.map +1 -1
  341. package/dist/Slider/Slider.js +52 -15
  342. package/dist/StatusDot/StatusDot.d.ts.map +1 -1
  343. package/dist/StatusDot/StatusDot.js +12 -0
  344. package/dist/Stepper/Step.d.ts.map +1 -1
  345. package/dist/Stepper/Step.js +10 -6
  346. package/dist/Switch/Switch.d.ts.map +1 -1
  347. package/dist/Switch/Switch.js +5 -5
  348. package/dist/Switch/switch.markers.stylex.d.ts +7 -2
  349. package/dist/Switch/switch.markers.stylex.d.ts.map +1 -1
  350. package/dist/Switch/switch.markers.stylex.js +8 -3
  351. package/dist/TabList/Tab.d.ts.map +1 -1
  352. package/dist/TabList/Tab.js +5 -1
  353. package/dist/TabList/TabMenu.d.ts.map +1 -1
  354. package/dist/TabList/TabMenu.js +25 -3
  355. package/dist/Table/TableCell.d.ts.map +1 -1
  356. package/dist/Table/TableCell.js +5 -1
  357. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  358. package/dist/Table/TableHeaderCell.js +1 -0
  359. package/dist/Table/TableRow.d.ts.map +1 -1
  360. package/dist/Table/TableRow.js +3 -0
  361. package/dist/Table/glidingDivider.d.ts +96 -0
  362. package/dist/Table/glidingDivider.d.ts.map +1 -0
  363. package/dist/Table/glidingDivider.js +275 -0
  364. package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
  365. package/dist/Table/plugins/columnResize/useTableColumnResize.js +11 -2
  366. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +8 -0
  367. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  368. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +374 -13
  369. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
  370. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +244 -6
  371. package/dist/Table/rowDivider.d.ts +34 -0
  372. package/dist/Table/rowDivider.d.ts.map +1 -0
  373. package/dist/Table/rowDivider.js +118 -0
  374. package/dist/TextArea/TextArea.d.ts +6 -4
  375. package/dist/TextArea/TextArea.d.ts.map +1 -1
  376. package/dist/TextArea/TextArea.js +15 -12
  377. package/dist/TextInput/TextInput.d.ts +7 -5
  378. package/dist/TextInput/TextInput.d.ts.map +1 -1
  379. package/dist/TextInput/TextInput.js +43 -22
  380. package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
  381. package/dist/Thumbnail/Thumbnail.js +45 -11
  382. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  383. package/dist/TimeInput/TimeInput.js +12 -4
  384. package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
  385. package/dist/TimeInput/TouchTimeField.js +2 -1
  386. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  387. package/dist/Toast/ToastViewport.js +62 -6
  388. package/dist/Tokenizer/Tokenizer.d.ts +71 -4
  389. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  390. package/dist/Tokenizer/Tokenizer.js +430 -45
  391. package/dist/Tokenizer/TokenizerBottomSheet.d.ts +98 -0
  392. package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -0
  393. package/dist/Tokenizer/TokenizerBottomSheet.js +721 -0
  394. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  395. package/dist/Tooltip/useTooltip.js +9 -3
  396. package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
  397. package/dist/TopNav/TopNavHeading.js +26 -0
  398. package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
  399. package/dist/TopNav/TopNavMegaMenu.js +4 -4
  400. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  401. package/dist/TopNav/TopNavMenu.js +32 -4
  402. package/dist/TreeList/TreeList.d.ts +8 -23
  403. package/dist/TreeList/TreeList.d.ts.map +1 -1
  404. package/dist/TreeList/TreeList.js +175 -3
  405. package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
  406. package/dist/TreeList/TreeListBranches.js +7 -5
  407. package/dist/TreeList/TreeListItem.d.ts +7 -1
  408. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  409. package/dist/TreeList/TreeListItem.js +5 -3
  410. package/dist/Typeahead/BaseTypeahead.d.ts +1 -1
  411. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  412. package/dist/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.d.ts +2 -0
  413. package/dist/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.d.ts.map +1 -0
  414. package/dist/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.js +118 -0
  415. package/dist/Typeahead/BaseTypeahead.js +27 -11
  416. package/dist/Typeahead/Typeahead.d.ts +1 -1
  417. package/dist/Typeahead/Typeahead.d.ts.map +1 -1
  418. package/dist/Typeahead/Typeahead.js +31 -14
  419. package/dist/astryx.css +164 -41
  420. package/dist/gestures/GestureArena.d.ts +175 -0
  421. package/dist/gestures/GestureArena.d.ts.map +1 -0
  422. package/dist/gestures/GestureArena.js +816 -0
  423. package/dist/gestures/GestureRecognizer.d.ts +239 -0
  424. package/dist/gestures/GestureRecognizer.d.ts.map +1 -0
  425. package/dist/gestures/GestureRecognizer.js +487 -0
  426. package/dist/gestures/LongPressGestureRecognizer.d.ts +32 -0
  427. package/dist/gestures/LongPressGestureRecognizer.d.ts.map +1 -0
  428. package/dist/gestures/LongPressGestureRecognizer.js +135 -0
  429. package/dist/gestures/PanGestureRecognizer.d.ts +117 -0
  430. package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -0
  431. package/dist/gestures/PanGestureRecognizer.js +349 -0
  432. package/dist/gestures/TapGestureRecognizer.d.ts +39 -0
  433. package/dist/gestures/TapGestureRecognizer.d.ts.map +1 -0
  434. package/dist/gestures/TapGestureRecognizer.js +151 -0
  435. package/dist/gestures/VelocityTracker.d.ts +51 -0
  436. package/dist/gestures/VelocityTracker.d.ts.map +1 -0
  437. package/dist/gestures/VelocityTracker.js +186 -0
  438. package/dist/gestures/geometry.d.ts +17 -0
  439. package/dist/gestures/geometry.d.ts.map +1 -0
  440. package/dist/gestures/geometry.js +55 -0
  441. package/dist/gestures/types.d.ts +139 -0
  442. package/dist/gestures/types.d.ts.map +1 -0
  443. package/dist/gestures/types.js +67 -0
  444. package/dist/hooks/AnnounceRenderedText.d.ts +17 -0
  445. package/dist/hooks/AnnounceRenderedText.d.ts.map +1 -0
  446. package/dist/hooks/AnnounceRenderedText.js +32 -0
  447. package/dist/hooks/ModalAnnounceProvider.d.ts +41 -0
  448. package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -0
  449. package/dist/hooks/ModalAnnounceProvider.js +133 -0
  450. package/dist/hooks/actionGroupTracker.d.ts +98 -0
  451. package/dist/hooks/actionGroupTracker.d.ts.map +1 -0
  452. package/dist/hooks/actionGroupTracker.js +338 -0
  453. package/dist/hooks/index.d.ts +2 -0
  454. package/dist/hooks/index.d.ts.map +1 -1
  455. package/dist/hooks/index.js +1 -0
  456. package/dist/hooks/menuPressOnItems.d.ts +19 -0
  457. package/dist/hooks/menuPressOnItems.d.ts.map +1 -0
  458. package/dist/hooks/menuPressOnItems.js +32 -0
  459. package/dist/hooks/modalAnnounce.d.ts +18 -0
  460. package/dist/hooks/modalAnnounce.d.ts.map +1 -0
  461. package/dist/hooks/modalAnnounce.js +382 -0
  462. package/dist/hooks/scrollGeometry.d.ts +28 -0
  463. package/dist/hooks/scrollGeometry.d.ts.map +1 -1
  464. package/dist/hooks/scrollGeometry.js +36 -2
  465. package/dist/hooks/useAdaptivePresentation.d.ts +9 -1
  466. package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -1
  467. package/dist/hooks/useAdaptivePresentation.js +33 -8
  468. package/dist/hooks/useAnimatedLayout.d.ts +42 -0
  469. package/dist/hooks/useAnimatedLayout.d.ts.map +1 -0
  470. package/dist/hooks/useAnimatedLayout.js +46 -0
  471. package/dist/hooks/useAnnounce.d.ts +132 -1
  472. package/dist/hooks/useAnnounce.d.ts.map +1 -1
  473. package/dist/hooks/useAnnounce.js +356 -27
  474. package/dist/hooks/useAnnounceRenderedText.d.ts +19 -2
  475. package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
  476. package/dist/hooks/useAnnounceRenderedText.js +52 -11
  477. package/dist/hooks/useBusyAnnouncement.d.ts +9 -5
  478. package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
  479. package/dist/hooks/useBusyAnnouncement.js +58 -46
  480. package/dist/hooks/useFocusTrap.d.ts +1 -1
  481. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  482. package/dist/hooks/useFocusTrap.js +57 -26
  483. package/dist/hooks/useMenuHover.d.ts.map +1 -1
  484. package/dist/hooks/useMenuHover.js +6 -2
  485. package/dist/hooks/useMenuPress.d.ts +4 -2
  486. package/dist/hooks/useMenuPress.d.ts.map +1 -1
  487. package/dist/hooks/useMenuPress.js +58 -33
  488. package/dist/hooks/usePressFeedback.d.ts +5 -2
  489. package/dist/hooks/usePressFeedback.d.ts.map +1 -1
  490. package/dist/hooks/usePressFeedback.js +5 -2
  491. package/dist/hooks/useScrollableArea.d.ts +5 -0
  492. package/dist/hooks/useScrollableArea.d.ts.map +1 -1
  493. package/dist/hooks/useScrollableArea.js +104 -11
  494. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  495. package/dist/i18n/generated-locales/en.generated.js +33 -0
  496. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  497. package/dist/i18n/generated-locales/pseudo.generated.js +33 -0
  498. package/dist/internal/tokenizer-presentation.d.ts +21 -0
  499. package/dist/internal/tokenizer-presentation.d.ts.map +1 -0
  500. package/dist/internal/tokenizer-presentation.js +21 -0
  501. package/dist/internal/touch.d.ts +26 -0
  502. package/dist/internal/touch.d.ts.map +1 -0
  503. package/dist/internal/touch.js +28 -0
  504. package/dist/motion/LayoutChangeSnapshot.d.ts +33 -0
  505. package/dist/motion/LayoutChangeSnapshot.d.ts.map +1 -0
  506. package/dist/motion/LayoutChangeSnapshot.js +37 -0
  507. package/dist/motion/animatedLayout.d.ts +190 -0
  508. package/dist/motion/animatedLayout.d.ts.map +1 -0
  509. package/dist/motion/animatedLayout.js +1502 -0
  510. package/dist/motion/animator.d.ts +240 -0
  511. package/dist/motion/animator.d.ts.map +1 -0
  512. package/dist/motion/animator.js +2203 -0
  513. package/dist/motion/bezier.d.ts +18 -0
  514. package/dist/motion/bezier.d.ts.map +1 -0
  515. package/dist/motion/bezier.js +60 -0
  516. package/dist/motion/coast.d.ts +61 -0
  517. package/dist/motion/coast.d.ts.map +1 -0
  518. package/dist/motion/coast.js +107 -0
  519. package/dist/motion/decay.d.ts +41 -0
  520. package/dist/motion/decay.d.ts.map +1 -0
  521. package/dist/motion/decay.js +90 -0
  522. package/dist/motion/projection.d.ts +36 -0
  523. package/dist/motion/projection.d.ts.map +1 -0
  524. package/dist/motion/projection.js +92 -0
  525. package/dist/motion/reducedMotion.d.ts +25 -0
  526. package/dist/motion/reducedMotion.d.ts.map +1 -0
  527. package/dist/motion/reducedMotion.js +85 -0
  528. package/dist/motion/reducedMotion.stylex.d.ts +19 -0
  529. package/dist/motion/reducedMotion.stylex.d.ts.map +1 -0
  530. package/dist/motion/reducedMotion.stylex.js +37 -0
  531. package/dist/motion/reducedMotionPlan.d.ts +89 -0
  532. package/dist/motion/reducedMotionPlan.d.ts.map +1 -0
  533. package/dist/motion/reducedMotionPlan.js +194 -0
  534. package/dist/motion/resolveSnapPoint.d.ts +52 -0
  535. package/dist/motion/resolveSnapPoint.d.ts.map +1 -0
  536. package/dist/motion/resolveSnapPoint.js +135 -0
  537. package/dist/motion/roleValue.d.ts +33 -0
  538. package/dist/motion/roleValue.d.ts.map +1 -0
  539. package/dist/motion/roleValue.js +84 -0
  540. package/dist/motion/roles.d.ts +79 -0
  541. package/dist/motion/roles.d.ts.map +1 -0
  542. package/dist/motion/roles.js +199 -0
  543. package/dist/motion/rubberBand.d.ts +20 -0
  544. package/dist/motion/rubberBand.d.ts.map +1 -0
  545. package/dist/motion/rubberBand.js +91 -0
  546. package/dist/motion/selectPage.d.ts +26 -0
  547. package/dist/motion/selectPage.d.ts.map +1 -0
  548. package/dist/motion/selectPage.js +55 -0
  549. package/dist/motion/spring.d.ts +193 -0
  550. package/dist/motion/spring.d.ts.map +1 -0
  551. package/dist/motion/spring.js +442 -0
  552. package/dist/motion/transientCopy.d.ts +33 -0
  553. package/dist/motion/transientCopy.d.ts.map +1 -0
  554. package/dist/motion/transientCopy.js +314 -0
  555. package/dist/motion/uikit/gestures.d.ts +642 -0
  556. package/dist/motion/uikit/gestures.d.ts.map +1 -0
  557. package/dist/motion/uikit/gestures.js +428 -0
  558. package/dist/motion/uikit/index.d.ts +24 -0
  559. package/dist/motion/uikit/index.d.ts.map +1 -0
  560. package/dist/motion/uikit/index.js +26 -0
  561. package/dist/motion/uikit/navigation.d.ts +54 -0
  562. package/dist/motion/uikit/navigation.d.ts.map +1 -0
  563. package/dist/motion/uikit/navigation.js +83 -0
  564. package/dist/motion/uikit/scroll.d.ts +116 -0
  565. package/dist/motion/uikit/scroll.d.ts.map +1 -0
  566. package/dist/motion/uikit/scroll.js +146 -0
  567. package/dist/motion/uikit/springs.d.ts +545 -0
  568. package/dist/motion/uikit/springs.d.ts.map +1 -0
  569. package/dist/motion/uikit/springs.js +548 -0
  570. package/dist/motion/uikit/timing.d.ts +202 -0
  571. package/dist/motion/uikit/timing.d.ts.map +1 -0
  572. package/dist/motion/uikit/timing.js +201 -0
  573. package/dist/reset.a11y.chromium.spec.js +1 -0
  574. package/dist/reset.until-found.a11y.browser.spec.js +1 -0
  575. package/dist/theme/declarationBoundary.d.ts +13 -0
  576. package/dist/theme/declarationBoundary.d.ts.map +1 -1
  577. package/dist/theme/declarationBoundary.js +264 -1
  578. package/dist/theme/defineTheme.d.ts +111 -11
  579. package/dist/theme/defineTheme.d.ts.map +1 -1
  580. package/dist/theme/defineTheme.js +97 -7
  581. package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
  582. package/dist/theme/derivedVarRegistry.js +9 -0
  583. package/dist/theme/generateThemeRules.d.ts +6 -2
  584. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  585. package/dist/theme/generateThemeRules.js +468 -24
  586. package/dist/theme/index.d.ts +2 -2
  587. package/dist/theme/index.d.ts.map +1 -1
  588. package/dist/theme/index.js +1 -1
  589. package/dist/theme/statusColor.d.ts +48 -0
  590. package/dist/theme/statusColor.d.ts.map +1 -0
  591. package/dist/theme/statusColor.js +203 -0
  592. package/dist/theme/statusRoleDerivation.d.ts +11 -0
  593. package/dist/theme/statusRoleDerivation.d.ts.map +1 -0
  594. package/dist/theme/statusRoleDerivation.js +236 -0
  595. package/dist/theme/syntax/SyntaxTheme.d.ts +1 -1
  596. package/dist/theme/syntax/SyntaxTheme.js +1 -1
  597. package/dist/theme/syntax/defineSyntaxTheme.js +1 -1
  598. package/dist/theme/syntax/presets.d.ts +1 -1
  599. package/dist/theme/syntax/presets.js +1 -1
  600. package/dist/theme/syntax/tokens.d.ts +1 -1
  601. package/dist/theme/syntax/tokens.js +1 -1
  602. package/dist/theme/themeAdaptations.d.ts +25 -1
  603. package/dist/theme/themeAdaptations.d.ts.map +1 -1
  604. package/dist/theme/themeAdaptations.js +30 -1
  605. package/dist/theme/tokens.d.ts.map +1 -1
  606. package/dist/theme/tokens.js +16 -1
  607. package/dist/theme/tokens.stylex.d.ts +42 -2
  608. package/dist/theme/tokens.stylex.d.ts.map +1 -1
  609. package/dist/theme/tokens.stylex.js +54 -3
  610. package/dist/theme/useTheme.d.ts +4 -2
  611. package/dist/theme/useTheme.d.ts.map +1 -1
  612. package/dist/theme/useTheme.js +10 -4
  613. package/dist/utils/edgeAutoscroll.d.ts +53 -0
  614. package/dist/utils/edgeAutoscroll.d.ts.map +1 -0
  615. package/dist/utils/edgeAutoscroll.js +81 -0
  616. package/dist/utils/hitArea.d.ts +72 -0
  617. package/dist/utils/hitArea.d.ts.map +1 -0
  618. package/dist/utils/hitArea.js +681 -0
  619. package/dist/utils/interactionOverlay.stylex.d.ts +4 -1
  620. package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
  621. package/dist/utils/interactionOverlay.stylex.js +4 -1
  622. package/dist/utils/pressFeedback.d.ts +5 -1
  623. package/dist/utils/pressFeedback.d.ts.map +1 -1
  624. package/dist/utils/pressFeedback.js +285 -54
  625. package/dist/utils/pressGesture.d.ts +13 -1
  626. package/dist/utils/pressGesture.d.ts.map +1 -1
  627. package/dist/utils/pressGesture.js +40 -1
  628. package/dist/utils/touchPresentation.d.ts +48 -0
  629. package/dist/utils/touchPresentation.d.ts.map +1 -0
  630. package/dist/utils/touchPresentation.js +133 -0
  631. package/locales/af-ZA.json +1 -1
  632. package/locales/ar-SA.json +1 -1
  633. package/locales/ca-ES.json +1 -1
  634. package/locales/cs-CZ.json +1 -1
  635. package/locales/da-DK.json +1 -1
  636. package/locales/de-DE.json +1 -1
  637. package/locales/el-GR.json +1 -1
  638. package/locales/en.json +132 -0
  639. package/locales/es-ES.json +1 -1
  640. package/locales/fi-FI.json +1 -1
  641. package/locales/fr-FR.json +1 -1
  642. package/locales/he-IL.json +1 -1
  643. package/locales/hu-HU.json +1 -1
  644. package/locales/it-IT.json +1 -1
  645. package/locales/ja-JP.json +1 -1
  646. package/locales/ko-KR.json +1 -1
  647. package/locales/nl-NL.json +1 -1
  648. package/locales/no-NO.json +1 -1
  649. package/locales/pl-PL.json +1 -1
  650. package/locales/pseudo.json +99 -0
  651. package/locales/pt-BR.json +1 -1
  652. package/locales/pt-PT.json +1 -1
  653. package/locales/ro-RO.json +1 -1
  654. package/locales/ru-RU.json +1 -1
  655. package/locales/sr-SP.json +1 -1
  656. package/locales/sv-SE.json +1 -1
  657. package/locales/tr-TR.json +1 -1
  658. package/locales/uk-UA.json +1 -1
  659. package/locales/vi-VN.json +1 -1
  660. package/locales/zh-CN.json +1 -1
  661. package/locales/zh-TW.json +1 -1
  662. package/package.json +63 -8
  663. package/src/AlertDialog/AlertDialog.spec.md +85 -31
  664. package/src/AlertDialog/AlertDialog.tsx +1 -1
  665. package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +1 -0
  666. package/src/AppShell/AppShell.spec.md +334 -0
  667. package/src/AppShell/AppShell.tsx +170 -2
  668. package/src/AspectRatio/AspectRatio.spec.md +179 -0
  669. package/src/AspectRatio/__tests__/AspectRatioFitLayers.a11y.browser.spec.ts +1 -0
  670. package/src/Avatar/Avatar.spec.md +253 -0
  671. package/src/Avatar/AvatarStatusDot.spec.md +93 -79
  672. package/src/Avatar/AvatarStatusDot.test.tsx +22 -0
  673. package/src/Avatar/AvatarStatusDot.tsx +2 -2
  674. package/src/AvatarGroup/AvatarGroup.spec.md +205 -0
  675. package/src/AvatarGroup/AvatarGroupOverflow.spec.md +123 -120
  676. package/src/Badge/Badge.spec.md +207 -0
  677. package/src/Badge/Badge.test.tsx +13 -0
  678. package/src/Badge/Badge.tsx +38 -2
  679. package/src/Banner/Banner.spec.md +41 -28
  680. package/src/Banner/Banner.test.tsx +118 -16
  681. package/src/Banner/Banner.tsx +94 -7
  682. package/src/Blockquote/Blockquote.spec.md +171 -0
  683. package/src/BottomSheet/BottomSheet.doc.mjs +106 -24
  684. package/src/BottomSheet/BottomSheet.spec.md +271 -40
  685. package/src/BottomSheet/BottomSheet.test.tsx +491 -5
  686. package/src/BottomSheet/BottomSheet.tsx +544 -145
  687. package/src/BottomSheet/BottomSheetHostContext.ts +44 -0
  688. package/src/BottomSheet/BottomSheetPanel.test.tsx +73 -19
  689. package/src/BottomSheet/BottomSheetPanel.tsx +178 -63
  690. package/src/BottomSheet/BottomSheetReplace.test.tsx +1638 -0
  691. package/src/BottomSheet/BottomSheetStacking.announce.test.tsx +246 -0
  692. package/src/BottomSheet/BottomSheetStacking.test.tsx +3184 -0
  693. package/src/BottomSheet/BottomSheetSwitcher.doc.mjs +27 -31
  694. package/src/BottomSheet/BottomSheetSwitcher.spec.md +138 -43
  695. package/src/BottomSheet/BottomSheetSwitcher.tsx +275 -26
  696. package/src/BottomSheet/BottomSheetSwitcherContext.ts +6 -0
  697. package/src/BottomSheet/__tests__/BottomSheetDrag.a11y.chromium.spec.ts +1 -0
  698. package/src/BottomSheet/__tests__/BottomSheetFocusReturn.a11y.browser.spec.ts +1 -0
  699. package/src/BottomSheet/__tests__/BottomSheetKeyboard.a11y.browser.spec.ts +4 -1
  700. package/src/BottomSheet/__tests__/BottomSheetNativeModal.a11y.browser.spec.ts +1 -0
  701. package/src/BottomSheet/__tests__/BottomSheetPinchZoom.a11y.chromium.spec.ts +1 -0
  702. package/src/BottomSheet/__tests__/BottomSheetToastOutlet.a11y.chromium.spec.ts +83 -0
  703. package/src/BottomSheet/bottomSheetEscape.ts +21 -0
  704. package/src/BottomSheet/bottomSheetStack.ts +2054 -0
  705. package/src/BottomSheet/useSheetGestures.ts +68 -12
  706. package/src/Breadcrumbs/BreadcrumbItem.spec.md +104 -60
  707. package/src/Breadcrumbs/BreadcrumbItem.tsx +30 -1
  708. package/src/Breadcrumbs/Breadcrumbs.spec.md +165 -0
  709. package/src/Breadcrumbs/Breadcrumbs.test.tsx +90 -0
  710. package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts +1 -0
  711. package/src/Button/Button.spec.md +322 -0
  712. package/src/Button/Button.test.tsx +8 -1
  713. package/src/Button/Button.tsx +36 -7
  714. package/src/Button/__tests__/Button.a11y.chromium.spec.ts +1 -0
  715. package/src/ButtonGroup/ButtonGroup.spec.md +220 -0
  716. package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +1 -0
  717. package/src/Card/Card.spec.md +205 -0
  718. package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +1 -0
  719. package/src/Center/Center.spec.md +104 -124
  720. package/src/Chat/ChatComposer.test.tsx +54 -0
  721. package/src/Chat/ChatComposer.tsx +41 -27
  722. package/src/Chat/ChatComposerInput.test.tsx +165 -21
  723. package/src/Chat/ChatComposerInput.tsx +73 -16
  724. package/src/Chat/ChatMessageMetadata.tsx +1 -1
  725. package/src/Chat/ChatPastedTextToken.test.tsx +71 -0
  726. package/src/Chat/ChatPastedTextToken.tsx +8 -7
  727. package/src/Chat/ChatToolCalls.tsx +5 -5
  728. package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +22 -4
  729. package/src/Chat/__tests__/ChatLayoutScrollButtonSurface.a11y.chromium.spec.ts +1 -0
  730. package/src/Chat/__tests__/ChatMessageList.a11y.chromium.spec.ts +1 -0
  731. package/src/Chat/__tests__/ChatMessageMetadata.a11y.chromium.spec.ts +1 -0
  732. package/src/Chat/__tests__/ChatSendButton.a11y.chromium.spec.ts +1 -0
  733. package/src/Chat/__tests__/ChatSystemMessage.a11y.chromium.spec.ts +1 -0
  734. package/src/Chat/__tests__/ChatTokenizedText.a11y.chromium.spec.ts +1 -0
  735. package/src/Chat/__tests__/useChatStreamScroll.a11y.chromium.spec.ts +1 -0
  736. package/src/CheckboxInput/CheckboxInput.spec.md +97 -66
  737. package/src/CheckboxInput/__tests__/Checkbox.a11y.chromium.spec.ts +1 -0
  738. package/src/CheckboxList/CheckboxList.spec.md +92 -78
  739. package/src/CheckboxList/CheckboxListItem.spec.md +86 -60
  740. package/src/CheckboxList/__tests__/CheckboxList.a11y.chromium.spec.ts +1 -0
  741. package/src/ClickableCard/ClickableCard.doc.mjs +1 -2
  742. package/src/ClickableCard/ClickableCard.spec.md +124 -128
  743. package/src/ClickableCard/ClickableCard.test.tsx +14 -3
  744. package/src/ClickableCard/ClickableCard.tsx +44 -28
  745. package/src/Code/Code.spec.md +30 -32
  746. package/src/CodeBlock/CodeBlock.doc.mjs +21 -4
  747. package/src/CodeBlock/CodeBlock.spec.md +96 -61
  748. package/src/CodeBlock/CodeBlock.test.tsx +97 -1
  749. package/src/CodeBlock/CodeBlock.tsx +132 -22
  750. package/src/CodeBlock/CodeLanguage.test.tsx +173 -0
  751. package/src/CodeBlock/__tests__/CodeBlockCopyClearance.a11y.chromium.spec.ts +290 -0
  752. package/src/CodeBlock/__tests__/CodeBlockLanguages.a11y.chromium.spec.ts +64 -0
  753. package/src/CodeBlock/__tests__/CodeBlockOverflowStop.a11y.chromium.spec.ts +1 -0
  754. package/src/CodeBlock/__tests__/DiffRowPaint.a11y.chromium.spec.ts +1 -0
  755. package/src/CodeBlock/grammar.ts +291 -0
  756. package/src/CodeBlock/index.ts +7 -0
  757. package/src/CodeBlock/languages/dockerfile.ts +43 -0
  758. package/src/CodeBlock/languages/graphql.ts +30 -0
  759. package/src/CodeBlock/languages/java.ts +28 -0
  760. package/src/CodeBlock/languages/lua.ts +21 -0
  761. package/src/CodeBlock/languages/objective-c.ts +26 -0
  762. package/src/CodeBlock/languages/powershell.ts +31 -0
  763. package/src/CodeBlock/languages/ruby.ts +29 -0
  764. package/src/CodeBlock/languages/thrift.ts +32 -0
  765. package/src/CodeBlock/languages/toml.ts +36 -0
  766. package/src/CodeBlock/languages.test.ts +402 -0
  767. package/src/CodeBlock/tokenizer.ts +176 -16
  768. package/src/CodeBlock/tokenizerBudget.test.ts +112 -0
  769. package/src/Collapsible/Collapsible.doc.mjs +6 -0
  770. package/src/Collapsible/Collapsible.spec.md +26 -23
  771. package/src/Collapsible/Collapsible.tsx +121 -2
  772. package/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts +1 -0
  773. package/src/Collapsible/__tests__/CollapsibleGroup.a11y.chromium.spec.ts +1 -0
  774. package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +1 -0
  775. package/src/CommandPalette/CommandPalette.perf.test.ts +8 -4
  776. package/src/CommandPalette/CommandPalette.tsx +17 -1
  777. package/src/CommandPalette/CommandPaletteEmpty.doc.mjs +6 -3
  778. package/src/CommandPalette/CommandPaletteEmpty.spec.md +190 -0
  779. package/src/CommandPalette/CommandPaletteEmpty.tsx +4 -0
  780. package/src/CommandPalette/CommandPaletteInput.tsx +21 -2
  781. package/src/CommandPalette/__tests__/CommandPalette.a11y.chromium.spec.ts +1 -0
  782. package/src/CommandPalette/__tests__/CommandPaletteEmptyAudit.a11y.chromium.spec.ts +715 -0
  783. package/src/CommandPalette/__tests__/CommandPaletteFooter.a11y.chromium.spec.ts +3 -2
  784. package/src/CommandPalette/__tests__/CommandPaletteInputAudit.a11y.chromium.spec.ts +1 -0
  785. package/src/CommandPalette/__tests__/CommandPaletteItemAudit.a11y.chromium.spec.ts +1 -0
  786. package/src/CommandPalette/busyStartSettle.ts +26 -0
  787. package/src/ComplexSelector/ComplexSelector.doc.mjs +1 -1
  788. package/src/ComplexSelector/ComplexSelector.focusableDisabled.test.tsx +1 -1
  789. package/src/ComplexSelector/ComplexSelector.fr10.test.tsx +9 -9
  790. package/src/ComplexSelector/ComplexSelector.spec.md +161 -107
  791. package/src/ComplexSelector/ComplexSelector.test.tsx +236 -17
  792. package/src/ComplexSelector/ComplexSelector.tsx +69 -4
  793. package/src/ComplexSelector/__tests__/ComplexSelector.a11y.chromium.spec.ts +965 -0
  794. package/src/ContextMenu/ContextMenu.doc.mjs +1 -1
  795. package/src/ContextMenu/ContextMenu.spec.md +38 -30
  796. package/src/ContextMenu/ContextMenu.test.tsx +189 -11
  797. package/src/ContextMenu/ContextMenu.tsx +75 -17
  798. package/src/ContextMenu/__tests__/ContextMenuAudit.a11y.chromium.spec.ts +1 -0
  799. package/src/ContextMenu/__tests__/ContextMenuCursorAnchor.a11y.browser.spec.ts +1 -0
  800. package/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts +117 -0
  801. package/src/DateInput/DateInput.tsx +9 -4
  802. package/src/DateInput/DateInputTouch.test.tsx +10 -1
  803. package/src/DateInput/NativeDateField.tsx +2 -1
  804. package/src/DateInput/TouchDateField.tsx +2 -1
  805. package/src/DateInput/Wheel.tsx +4 -1
  806. package/src/DateInput/__tests__/DateInputAudit.a11y.chromium.spec.ts +1 -0
  807. package/src/DateInput/__tests__/WheelPinchZoom.a11y.chromium.spec.ts +171 -0
  808. package/src/Dialog/Dialog.doc.mjs +201 -47
  809. package/src/Dialog/Dialog.spec.md +20 -4
  810. package/src/Dialog/Dialog.tsx +37 -10
  811. package/src/Dialog/__tests__/Dialog.a11y.browser.spec.ts +1 -0
  812. package/src/Dialog/__tests__/Dialog.a11y.chromium.spec.ts +1 -0
  813. package/src/Dialog/__tests__/Dialog.reduced-motion.a11y.browser.spec.ts +252 -0
  814. package/src/Divider/Divider.spec.md +79 -70
  815. package/src/Drawer/Drawer.tsx +38 -35
  816. package/src/Drawer/__tests__/DrawerAudit.a11y.chromium.spec.ts +1 -0
  817. package/src/Drawer/__tests__/DrawerHeaderAudit.a11y.chromium.spec.ts +1 -0
  818. package/src/DropdownMenu/DropdownMenu.spec.md +14 -6
  819. package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +44 -8
  820. package/src/DropdownMenu/DropdownMenu.test.tsx +107 -5
  821. package/src/DropdownMenu/DropdownMenu.tsx +51 -34
  822. package/src/DropdownMenu/DropdownMenuGroup.doc.mjs +2 -2
  823. package/src/DropdownMenu/DropdownMenuGroup.tsx +12 -6
  824. package/src/DropdownMenu/DropdownMenuItem.tsx +5 -5
  825. package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +5 -2
  826. package/src/DropdownMenu/DropdownMenuRadioItem.spec.md +226 -0
  827. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +32 -16
  828. package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +158 -0
  829. package/src/DropdownMenu/DropdownMenuSheetFirstOpen.test.tsx +72 -0
  830. package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +9 -0
  831. package/src/DropdownMenu/DropdownMenuSubMenu.spec.md +225 -0
  832. package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +105 -0
  833. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +6 -6
  834. package/src/DropdownMenu/MenuBottomSheet.tsx +42 -7
  835. package/src/DropdownMenu/MenuBottomSheetActionList.tsx +3 -3
  836. package/src/DropdownMenu/__tests__/DropdownMenuDividerAudit.a11y.chromium.spec.ts +1 -0
  837. package/src/DropdownMenu/__tests__/DropdownMenuDrillIn.a11y.chromium.spec.ts +1 -0
  838. package/src/DropdownMenu/__tests__/DropdownMenuFocusReturn.a11y.browser.spec.ts +1 -0
  839. package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +1 -0
  840. package/src/DropdownMenu/__tests__/DropdownMenuItemAudit.a11y.chromium.spec.ts +1 -0
  841. package/src/DropdownMenu/__tests__/DropdownMenuRadioGroupAudit.a11y.chromium.spec.ts +1 -0
  842. package/src/DropdownMenu/__tests__/DropdownMenuRadioItemAudit.a11y.chromium.spec.ts +540 -0
  843. package/src/DropdownMenu/__tests__/DropdownMenuSubMenuAudit.a11y.chromium.spec.ts +671 -0
  844. package/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts +1 -0
  845. package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +1 -0
  846. package/src/DropdownMenu/__tests__/MenuHeaderFooter.a11y.chromium.spec.ts +1 -0
  847. package/src/DropdownMenu/__tests__/MenuHoverFocus.a11y.chromium.spec.ts +238 -0
  848. package/src/DropdownMenu/__tests__/MenuPinchZoom.a11y.chromium.spec.ts +1 -0
  849. package/src/DropdownMenu/__tests__/MenuPress.a11y.chromium.spec.ts +1 -0
  850. package/src/DropdownMenu/__tests__/SubMenuHeaderFooter.a11y.chromium.spec.ts +1 -0
  851. package/src/DropdownMenu/lazyMenuBottomSheet.ts +28 -2
  852. package/src/DropdownMenu/menuBottomSheet.stylex.ts +33 -0
  853. package/src/DropdownMenu/menuItemHover.ts +13 -1
  854. package/src/DropdownMenu/menuTouchAction.stylex.ts +28 -0
  855. package/src/DropdownMenu/modules/useMenuPress.spec.md +90 -62
  856. package/src/DropdownMenu/useMenuDrillIn.tsx +7 -5
  857. package/src/EmptyState/EmptyState.announce.test.tsx +227 -0
  858. package/src/EmptyState/EmptyState.doc.mjs +1 -1
  859. package/src/EmptyState/EmptyState.spec.md +22 -14
  860. package/src/EmptyState/EmptyState.test.tsx +8 -8
  861. package/src/EmptyState/EmptyState.tsx +7 -5
  862. package/src/Field/Field.spec.md +57 -48
  863. package/src/Field/Field.tsx +1 -1
  864. package/src/Field/FieldLabel.spec.md +70 -59
  865. package/src/Field/FieldLabel.tsx +1 -1
  866. package/src/Field/PanelSearchInput.tsx +23 -13
  867. package/src/Field/__tests__/FieldLabelAudit.a11y.chromium.spec.ts +1 -0
  868. package/src/Field/inputDisabledFocus.ts +28 -0
  869. package/src/Field/inputStyles.stylex.ts +15 -15
  870. package/src/FieldStatus/FieldStatus.test.tsx +12 -0
  871. package/src/FieldStatus/FieldStatus.tsx +12 -3
  872. package/src/FieldStatus/__tests__/StatusMessage.a11y.chromium.spec.ts +1 -0
  873. package/src/FileInput/FileInput.doc.mjs +1 -1
  874. package/src/FileInput/FileInput.test.tsx +102 -0
  875. package/src/FileInput/FileInput.tsx +18 -12
  876. package/src/FormLayout/FormLayout.spec.md +69 -51
  877. package/src/Grid/Grid.spec.md +72 -69
  878. package/src/Grid/GridSpan.spec.md +158 -0
  879. package/src/Heading/Heading.spec.md +198 -0
  880. package/src/HoverCard/HoverCard.spec.md +244 -0
  881. package/src/HoverCard/HoverCard.test.tsx +93 -3
  882. package/src/Icon/Icon.doc.mjs +67 -5
  883. package/src/Icon/Icon.test.tsx +548 -9
  884. package/src/Icon/Icon.tsx +79 -15
  885. package/src/Icon/IconSize.stylex.ts +27 -11
  886. package/src/Icon/globalIconRegistry.test.tsx +395 -3
  887. package/src/Icon/globalIconRegistry.tsx +184 -36
  888. package/src/Icon/index.ts +29 -1
  889. package/src/Icon/useIcon.ts +5 -1
  890. package/src/IconButton/IconButton.spec.md +197 -0
  891. package/src/IconButton/IconButton.test.tsx +5 -2
  892. package/src/InputGroup/InputGroup.spec.md +199 -0
  893. package/src/InputGroup/InputGroup.test.tsx +120 -0
  894. package/src/InputGroup/InputGroup.tsx +59 -52
  895. package/src/InputGroup/InputGroupInternalContext.ts +15 -0
  896. package/src/InputGroup/InputGroupText.spec.md +139 -0
  897. package/src/InputGroup/InputGroupText.tsx +2 -0
  898. package/src/InputGroup/groupStyles.ts +22 -11
  899. package/src/Item/Item.test.tsx +158 -1
  900. package/src/Item/Item.tsx +42 -7
  901. package/src/Item/ItemMarkerColumns.a11y.chromium.spec.ts +211 -0
  902. package/src/Item/ItemMarkerColumnsContext.tsx +20 -0
  903. package/src/Item/ItemSwipeLayer.tsx +9 -0
  904. package/src/Item/__tests__/ItemSwipeActions.a11y.chromium.spec.ts +1 -0
  905. package/src/Item/__tests__/ItemSwipePinchZoom.a11y.chromium.spec.ts +186 -0
  906. package/src/Item/useSwipeAction.ts +71 -5
  907. package/src/Kbd/Kbd.test.tsx +95 -0
  908. package/src/Kbd/Kbd.tsx +30 -23
  909. package/src/Layer/LayerProvider.spec.md +149 -0
  910. package/src/Layer/__tests__/LayerReducedMotion.a11y.chromium.spec.ts +176 -0
  911. package/src/Layer/__tests__/TouchTrigger.a11y.chromium.spec.ts +200 -0
  912. package/src/Layer/layerAnimations.stylex.ts +22 -2
  913. package/src/Layer/layerDismissalInvariants.test.tsx +9 -0
  914. package/src/Layer/layerSlideRules.ts +141 -8
  915. package/src/Layer/layerStack.ts +129 -62
  916. package/src/Layer/modalOutlet.ts +156 -15
  917. package/src/Layer/preserveAnimations.ts +304 -0
  918. package/src/Layer/useLayer.doc.mjs +1 -1
  919. package/src/Layer/useLayer.test.tsx +850 -0
  920. package/src/Layer/useLayer.tsx +644 -58
  921. package/src/Layer/useLayerDismissal.test.tsx +85 -2
  922. package/src/Layer/useLayerDismissal.ts +12 -9
  923. package/src/Layer/useTouchTrigger.ts +95 -41
  924. package/src/Layout/Layout.tsx +18 -0
  925. package/src/Layout/LayoutContent.tsx +5 -14
  926. package/src/Layout/LayoutFooter.tsx +2 -0
  927. package/src/Layout/LayoutHeader.tsx +2 -0
  928. package/src/Layout/__tests__/Layout.a11y.chromium.spec.ts +1 -0
  929. package/src/Layout/layoutEdges.stylex.ts +25 -0
  930. package/src/Lightbox/Lightbox.spec.md +9 -8
  931. package/src/Lightbox/Lightbox.test.tsx +83 -0
  932. package/src/Lightbox/Lightbox.tsx +149 -125
  933. package/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts +78 -0
  934. package/src/Lightbox/LightboxViewport.a11y.browser.spec.ts +70 -0
  935. package/src/Link/Link.spec.md +229 -0
  936. package/src/Link/LinkProvider.spec.md +167 -0
  937. package/src/Link/__tests__/Link.a11y.chromium.spec.ts +1 -0
  938. package/src/Link/__tests__/Link.navigation.a11y.chromium.spec.ts +1 -0
  939. package/src/List/List.spec.md +113 -34
  940. package/src/List/List.tsx +13 -1
  941. package/src/List/ListContext.tsx +19 -5
  942. package/src/List/ListItem.doc.mjs +3 -3
  943. package/src/List/ListItem.tsx +97 -28
  944. package/src/List/ListMarkers.a11y.chromium.spec.ts +904 -0
  945. package/src/Markdown/Markdown.codeLanguages.test.tsx +137 -0
  946. package/src/Markdown/Markdown.doc.mjs +12 -0
  947. package/src/Markdown/Markdown.fr23.bench.ts +3 -1
  948. package/src/Markdown/Markdown.fr23.perf.test.ts +45 -3
  949. package/src/Markdown/Markdown.fr23.sampling.ts +13 -4
  950. package/src/Markdown/Markdown.spec.md +71 -59
  951. package/src/Markdown/Markdown.test.tsx +50 -0
  952. package/src/Markdown/Markdown.tsx +61 -8
  953. package/src/Markdown/MarkdownTable.a11y.chromium.spec.ts +1 -0
  954. package/src/Markdown/__tests__/MarkdownNesting.a11y.chromium.spec.ts +1 -0
  955. package/src/MobileNav/MobileNav.doc.mjs +2 -2
  956. package/src/MobileNav/MobileNav.spec.md +161 -64
  957. package/src/MobileNav/MobileNav.test.tsx +27 -10
  958. package/src/MobileNav/MobileNav.tsx +51 -38
  959. package/src/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.ts +1 -0
  960. package/src/MobileNav/MobileNavToggle.test.tsx +63 -0
  961. package/src/MobileNav/MobileNavToggle.tsx +13 -5
  962. package/src/MobileNav/__tests__/MobileNavWidth.a11y.chromium.spec.ts +103 -0
  963. package/src/MoreMenu/MoreMenu.doc.mjs +2 -2
  964. package/src/MoreMenu/MoreMenu.spec.md +88 -53
  965. package/src/MultiSelector/CreateRow.a11y.chromium.spec.ts +67 -9
  966. package/src/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.ts +1 -0
  967. package/src/MultiSelector/MultiSelector.test.tsx +122 -10
  968. package/src/MultiSelector/MultiSelector.tsx +24 -4
  969. package/src/MultiSelector/OptionActions.a11y.chromium.spec.ts +1 -0
  970. package/src/MultiSelector/__tests__/MultiSelector.a11y.chromium.spec.ts +1 -0
  971. package/src/NavIcon/NavIcon.spec.md +66 -38
  972. package/src/NavMenu/NavHeadingMenu.spec.md +104 -46
  973. package/src/NavMenu/NavHeadingMenu.test.tsx +276 -2
  974. package/src/NavMenu/NavHeadingMenu.tsx +42 -4
  975. package/src/NavMenu/NavHeadingMenuItem.tsx +60 -6
  976. package/src/NavMenu/NavMenuContext.tsx +11 -0
  977. package/src/NavMenu/__tests__/NavMenusSlideSelection.a11y.chromium.spec.ts +137 -0
  978. package/src/NumberInput/NumberInput.doc.mjs +6 -6
  979. package/src/NumberInput/NumberInput.spec.md +248 -0
  980. package/src/NumberInput/NumberInput.test.tsx +187 -14
  981. package/src/NumberInput/NumberInput.tsx +86 -24
  982. package/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts +1 -0
  983. package/src/Overlay/Overlay.doc.mjs +2 -2
  984. package/src/Overlay/Overlay.test.tsx +72 -4
  985. package/src/Overlay/Overlay.tsx +18 -8
  986. package/src/Pagination/Pagination.test.tsx +2 -2
  987. package/src/Popover/Popover.doc.mjs +38 -2
  988. package/src/Popover/Popover.spec.md +90 -11
  989. package/src/Popover/Popover.test.tsx +340 -2
  990. package/src/Popover/Popover.tsx +401 -35
  991. package/src/Popover/PopoverPresentation.test.tsx +952 -0
  992. package/src/Popover/__tests__/PopoverSecondDocument.a11y.chromium.spec.ts +205 -0
  993. package/src/Popover/index.ts +5 -1
  994. package/src/Popover/lazyPopoverBottomSheet.ts +57 -0
  995. package/src/Popover/usePopover.tsx +11 -5
  996. package/src/PowerSearch/PowerSearch.spec.md +423 -53
  997. package/src/PowerSearch/PowerSearch.test.tsx +77 -1
  998. package/src/PowerSearch/PowerSearch.tsx +7 -5
  999. package/src/ProgressBar/ProgressBar.test.tsx +12 -0
  1000. package/src/ProgressBar/ProgressBar.tsx +18 -0
  1001. package/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts +1 -0
  1002. package/src/RadioList/RadioList.spec.md +227 -0
  1003. package/src/RadioList/RadioList.test.tsx +34 -7
  1004. package/src/RadioList/RadioListItem.press.source-build.test.mjs +80 -0
  1005. package/src/RadioList/RadioListItem.spec.md +223 -0
  1006. package/src/RadioList/RadioListItem.tsx +26 -12
  1007. package/src/RadioList/__tests__/RadioGroup.a11y.chromium.spec.ts +1 -0
  1008. package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +1 -0
  1009. package/src/ScrollableArea/ScrollableArea.spec.md +6 -5
  1010. package/src/ScrollableArea/ScrollableArea.test.tsx +5 -0
  1011. package/src/ScrollableArea/ScrollableArea.tsx +4 -0
  1012. package/src/Section/Section.spec.md +102 -44
  1013. package/src/SegmentedControl/SegmentedControl.spec.md +162 -53
  1014. package/src/SegmentedControl/SegmentedControl.test.tsx +46 -0
  1015. package/src/SegmentedControl/SegmentedControl.tsx +7 -3
  1016. package/src/SegmentedControl/SegmentedControlItem.spec.md +206 -0
  1017. package/src/SelectableCard/SelectableCard.doc.mjs +7 -6
  1018. package/src/SelectableCard/SelectableCard.spec.md +230 -0
  1019. package/src/SelectableCard/SelectableCard.test.tsx +11 -1
  1020. package/src/SelectableCard/SelectableCard.tsx +49 -33
  1021. package/src/Selector/Selector.sheetActiveDescendant.test.tsx +95 -0
  1022. package/src/Selector/Selector.spec.md +12 -4
  1023. package/src/Selector/Selector.test.tsx +114 -8
  1024. package/src/Selector/Selector.tsx +30 -6
  1025. package/src/Selector/__tests__/ComboboxField.a11y.chromium.spec.ts +458 -0
  1026. package/src/Selector/__tests__/EmptyStateAnnouncement.a11y.chromium.spec.ts +1 -0
  1027. package/src/Selector/__tests__/Listbox.a11y.chromium.spec.ts +1 -0
  1028. package/src/Selector/__tests__/Selector.a11y.chromium.spec.ts +1 -0
  1029. package/src/Selector/__tests__/Selector.combobox.a11y.chromium.spec.ts +1 -0
  1030. package/src/Selector/hooks.ts +234 -10
  1031. package/src/Selector/useCombobox.doc.mjs +156 -9
  1032. package/src/Selector/useCombobox.public.test.tsx +89 -0
  1033. package/src/Selector/useCombobox.test.tsx +444 -0
  1034. package/src/SideNav/SideNav.spec.md +50 -30
  1035. package/src/SideNav/SideNav.test.tsx +425 -25
  1036. package/src/SideNav/SideNav.tsx +85 -1
  1037. package/src/SideNav/SideNavCollapseButton.spec.md +161 -0
  1038. package/src/SideNav/SideNavHeading.spec.md +226 -0
  1039. package/src/SideNav/SideNavHeading.tsx +102 -6
  1040. package/src/SideNav/SideNavItem.spec.md +246 -0
  1041. package/src/SideNav/SideNavItem.tsx +40 -9
  1042. package/src/SideNav/SideNavRailMotion.test.tsx +620 -0
  1043. package/src/SideNav/SideNavSection.spec.md +153 -0
  1044. package/src/SideNav/__tests__/SideNavRailMotion.interaction.browser.spec.ts +417 -0
  1045. package/src/SideNav/railMotion.ts +315 -0
  1046. package/src/Skeleton/Skeleton.spec.md +99 -42
  1047. package/src/Skeleton/Skeleton.test.tsx +108 -1
  1048. package/src/Skeleton/Skeleton.tsx +30 -2
  1049. package/src/Slider/Slider.fr10.test.tsx +34 -0
  1050. package/src/Slider/Slider.test.tsx +172 -0
  1051. package/src/Slider/Slider.tsx +70 -14
  1052. package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +1 -0
  1053. package/src/Spinner/Spinner.spec.md +231 -0
  1054. package/src/Stack/Stack.spec.md +104 -56
  1055. package/src/StatusDot/StatusDot.spec.md +139 -51
  1056. package/src/StatusDot/StatusDot.test.tsx +13 -0
  1057. package/src/StatusDot/StatusDot.tsx +27 -0
  1058. package/src/Stepper/Step.spec.md +206 -0
  1059. package/src/Stepper/Step.tsx +19 -3
  1060. package/src/Stepper/Stepper.test.tsx +50 -0
  1061. package/src/Switch/Switch.focusRing.source-build.test.mjs +81 -0
  1062. package/src/Switch/Switch.spec.md +150 -66
  1063. package/src/Switch/Switch.tsx +11 -9
  1064. package/src/Switch/__tests__/Switch.a11y.chromium.spec.ts +1 -0
  1065. package/src/Switch/switch.markers.stylex.ts +7 -2
  1066. package/src/TabList/Tab.spec.md +201 -0
  1067. package/src/TabList/Tab.tsx +7 -1
  1068. package/src/TabList/TabList.doc.mjs +3 -3
  1069. package/src/TabList/TabList.test.tsx +27 -0
  1070. package/src/TabList/TabMenu.spec.md +198 -0
  1071. package/src/TabList/TabMenu.tsx +24 -1
  1072. package/src/TabList/__tests__/TabListOverflow.interaction.browser.spec.ts +99 -0
  1073. package/src/TabList/__tests__/Tabs.a11y.chromium.spec.ts +1 -0
  1074. package/src/Table/Table.spec.md +54 -30
  1075. package/src/Table/TableCell.tsx +9 -0
  1076. package/src/Table/TableHeaderCell.tsx +2 -0
  1077. package/src/Table/TableRow.tsx +3 -0
  1078. package/src/Table/__tests__/Table.a11y.chromium.spec.ts +129 -0
  1079. package/src/Table/__tests__/Table.a11y.contracts.ts +35 -0
  1080. package/src/Table/__tests__/Table.a11y.renders.tsx +112 -0
  1081. package/src/Table/__tests__/Table.a11y.states.ts +140 -0
  1082. package/src/Table/__tests__/Table.a11y.test.tsx +198 -0
  1083. package/src/Table/__tests__/TableMinWidth.a11y.chromium.spec.ts +1 -0
  1084. package/src/Table/__tests__/TableRowGlide.a11y.browser.spec.ts +382 -0
  1085. package/src/Table/__tests__/TableScroll.a11y.chromium.spec.ts +1 -0
  1086. package/src/Table/__tests__/TableStickyDividers.a11y.browser.spec.ts +560 -0
  1087. package/src/Table/glidingDivider.ts +336 -0
  1088. package/src/Table/plugins/columnResize/useTableColumnResize.tsx +23 -8
  1089. package/src/Table/plugins/rowExpansion/useTableRowExpansion.glide.test.tsx +280 -0
  1090. package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +91 -9
  1091. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +471 -10
  1092. package/src/Table/plugins/rowStatus/useTableRowStatus.spec.md +4 -4
  1093. package/src/Table/plugins/sortable/__tests__/useTableSortable.a11y.test.tsx +174 -0
  1094. package/src/Table/plugins/sortable/__tests__/useTableSortable.a11y.ts +86 -0
  1095. package/src/Table/plugins/sortable/useTableSortable.test.tsx +0 -12
  1096. package/src/Table/plugins/stickyColumns/useTableStickyColumns.test.tsx +51 -1
  1097. package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +312 -12
  1098. package/src/Table/rowDivider.ts +154 -0
  1099. package/src/Table/useTableRowExpansion.doc.mjs +8 -0
  1100. package/src/Text/Text.spec.md +114 -127
  1101. package/src/TextArea/TextArea.doc.mjs +6 -6
  1102. package/src/TextArea/TextArea.spec.md +164 -64
  1103. package/src/TextArea/TextArea.test.tsx +65 -6
  1104. package/src/TextArea/TextArea.tsx +27 -15
  1105. package/src/TextInput/TextInput.doc.mjs +8 -8
  1106. package/src/TextInput/TextInput.spec.md +260 -0
  1107. package/src/TextInput/TextInput.test.tsx +126 -10
  1108. package/src/TextInput/TextInput.tsx +57 -23
  1109. package/src/TextInput/__tests__/TextInput.a11y.chromium.spec.ts +1 -0
  1110. package/src/Thumbnail/Thumbnail.doc.mjs +1 -2
  1111. package/src/Thumbnail/Thumbnail.spec.md +244 -0
  1112. package/src/Thumbnail/Thumbnail.test.tsx +120 -7
  1113. package/src/Thumbnail/Thumbnail.tsx +77 -31
  1114. package/src/TimeInput/TimeInput.spec.md +273 -0
  1115. package/src/TimeInput/TimeInput.tsx +12 -4
  1116. package/src/TimeInput/TouchTimeField.tsx +2 -1
  1117. package/src/Timestamp/Timestamp.spec.md +252 -0
  1118. package/src/Toast/Toast.spec.md +300 -0
  1119. package/src/Toast/ToastViewport.modalHost.test.tsx +630 -5
  1120. package/src/Toast/ToastViewport.test.tsx +137 -0
  1121. package/src/Toast/ToastViewport.tsx +63 -6
  1122. package/src/ToggleButton/ToggleButton.spec.md +256 -0
  1123. package/src/ToggleButton/ToggleButtonGroup.spec.md +195 -0
  1124. package/src/ToggleButton/__tests__/ToggleButton.a11y.chromium.spec.ts +1 -0
  1125. package/src/Token/Token.spec.md +271 -0
  1126. package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +1 -0
  1127. package/src/Tokenizer/Tokenizer.props-type.test.tsx +126 -0
  1128. package/src/Tokenizer/Tokenizer.spec.md +313 -72
  1129. package/src/Tokenizer/Tokenizer.ssr.test.tsx +196 -0
  1130. package/src/Tokenizer/Tokenizer.test.tsx +44 -8
  1131. package/src/Tokenizer/Tokenizer.tsx +586 -41
  1132. package/src/Tokenizer/TokenizerBottomSheet.test.tsx +2719 -0
  1133. package/src/Tokenizer/TokenizerBottomSheet.tsx +957 -0
  1134. package/src/Tokenizer/__tests__/TokenizerEndLane.a11y.chromium.spec.ts +61 -27
  1135. package/src/Toolbar/Toolbar.spec.md +103 -49
  1136. package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +1 -0
  1137. package/src/Tooltip/Tooltip.spec.md +161 -36
  1138. package/src/Tooltip/Tooltip.test.tsx +171 -3
  1139. package/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts +1 -0
  1140. package/src/Tooltip/__tests__/Tooltip.a11y.states.ts +2 -2
  1141. package/src/Tooltip/__tests__/TooltipFocusReturn.a11y.chromium.spec.ts +1 -0
  1142. package/src/Tooltip/__tests__/TooltipHoverBridge.a11y.chromium.spec.ts +1 -0
  1143. package/src/Tooltip/__tests__/TooltipTallContent.a11y.browser.spec.ts +673 -0
  1144. package/src/Tooltip/__tests__/TooltipTallContentTracking.a11y.browser.spec.ts +1162 -0
  1145. package/src/Tooltip/useTooltip.tsx +7 -2
  1146. package/src/TopNav/TopNav.spec.md +190 -0
  1147. package/src/TopNav/TopNav.test.tsx +89 -0
  1148. package/src/TopNav/TopNavHeading.spec.md +211 -0
  1149. package/src/TopNav/TopNavHeading.tsx +35 -2
  1150. package/src/TopNav/TopNavItem.spec.md +189 -0
  1151. package/src/TopNav/TopNavMegaMenu.reduced-motion.source-build.test.mjs +83 -0
  1152. package/src/TopNav/TopNavMegaMenu.spec.md +190 -0
  1153. package/src/TopNav/TopNavMegaMenu.tsx +21 -4
  1154. package/src/TopNav/TopNavMegaMenuFeaturedCard.spec.md +150 -0
  1155. package/src/TopNav/TopNavMegaMenuItem.spec.md +155 -0
  1156. package/src/TopNav/TopNavMenu.spec.md +202 -0
  1157. package/src/TopNav/TopNavMenu.test.tsx +65 -1
  1158. package/src/TopNav/TopNavMenu.tsx +30 -1
  1159. package/src/TopNav/__tests__/TopNavMobileLongHeading.a11y.chromium.spec.ts +1 -0
  1160. package/src/TreeList/TreeList.doc.mjs +13 -0
  1161. package/src/TreeList/TreeList.spec.md +54 -35
  1162. package/src/TreeList/TreeList.tsx +234 -2
  1163. package/src/TreeList/TreeListBranches.tsx +8 -6
  1164. package/src/TreeList/TreeListItem.tsx +12 -6
  1165. package/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts +19 -6
  1166. package/src/TreeList/__tests__/TreeListGuideAlignment.interaction.browser.spec.ts +127 -0
  1167. package/src/TreeList/__tests__/TreeListRowNames.a11y.chromium.spec.ts +1 -0
  1168. package/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts +138 -0
  1169. package/src/Typeahead/BaseTypeahead.test.tsx +201 -4
  1170. package/src/Typeahead/BaseTypeahead.tsx +26 -10
  1171. package/src/Typeahead/Typeahead.test.tsx +114 -1
  1172. package/src/Typeahead/Typeahead.tsx +34 -16
  1173. package/src/VisuallyHidden/VisuallyHidden.spec.md +170 -0
  1174. package/src/__tests__/BusyOwnerAnnouncement.test.tsx +66 -5
  1175. package/src/__tests__/CardPress.a11y.chromium.spec.ts +353 -0
  1176. package/src/__tests__/DisabledTriggerFocus.a11y.chromium.spec.ts +2 -1
  1177. package/src/__tests__/PressModality.a11y.chromium.spec.ts +392 -0
  1178. package/src/__tests__/PressedState.a11y.chromium.spec.ts +1 -0
  1179. package/src/__tests__/pressState.ts +43 -1
  1180. package/src/__tests__/unthemedLength.ts +34 -0
  1181. package/src/gestures/GestureArena.ts +966 -0
  1182. package/src/gestures/GestureRecognizer.ts +626 -0
  1183. package/src/gestures/LongPressGestureRecognizer.ts +186 -0
  1184. package/src/gestures/PanGestureRecognizer.ts +410 -0
  1185. package/src/gestures/TapGestureRecognizer.ts +192 -0
  1186. package/src/gestures/VelocityTracker.ts +194 -0
  1187. package/src/gestures/__tests__/LongPressGestureRecognizer.test.ts +141 -0
  1188. package/src/gestures/__tests__/PanGestureRecognizer.test.ts +327 -0
  1189. package/src/gestures/__tests__/TapGestureRecognizer.test.ts +154 -0
  1190. package/src/gestures/__tests__/VelocityTracker.streams.test.ts +243 -0
  1191. package/src/gestures/__tests__/VelocityTracker.test.ts +261 -0
  1192. package/src/gestures/__tests__/arena.test.ts +824 -0
  1193. package/src/gestures/__tests__/arenaContinuous.test.ts +207 -0
  1194. package/src/gestures/__tests__/arenaTapLongPress.test.ts +211 -0
  1195. package/src/gestures/__tests__/fixtures/pointer-streams/README.md +82 -0
  1196. package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-fling.json +130 -0
  1197. package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-slow.json +860 -0
  1198. package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-stop-release.json +357 -0
  1199. package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-fling.json +66 -0
  1200. package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-slow.json +268 -0
  1201. package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-stop-release.json +128 -0
  1202. package/src/gestures/__tests__/fixtures/pointer-streams/capture.html +123 -0
  1203. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-fling.json +64 -0
  1204. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-slow.json +268 -0
  1205. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-stop-release.json +124 -0
  1206. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-fling.json +64 -0
  1207. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-slow.json +268 -0
  1208. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-stop-release.json +124 -0
  1209. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-fling.json +84 -0
  1210. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-slow.json +381 -0
  1211. package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-stop-release.json +171 -0
  1212. package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-fling.json +45 -0
  1213. package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-slow.json +101 -0
  1214. package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-stop-release.json +130 -0
  1215. package/src/gestures/__tests__/harness.ts +204 -0
  1216. package/src/gestures/geometry.ts +55 -0
  1217. package/src/gestures/types.ts +161 -0
  1218. package/src/hooks/AnnounceRenderedText.tsx +27 -0
  1219. package/src/hooks/ModalAnnounceProvider.tsx +155 -0
  1220. package/src/hooks/__tests__/MenuPressShadowRoot.a11y.chromium.spec.ts +98 -4
  1221. package/src/hooks/__tests__/menuLinkClicks.ts +71 -0
  1222. package/src/hooks/actionGroupTracker.exports.test.ts +28 -0
  1223. package/src/hooks/actionGroupTracker.test.ts +510 -0
  1224. package/src/hooks/actionGroupTracker.ts +449 -0
  1225. package/src/hooks/index.ts +6 -0
  1226. package/src/hooks/menuPressOnItems.ts +40 -0
  1227. package/src/hooks/modalAnnounce.ts +439 -0
  1228. package/src/hooks/scrollGeometry.ts +71 -4
  1229. package/src/hooks/useAdaptivePresentation.ts +46 -9
  1230. package/src/hooks/useAnimatedLayout.doc.mjs +101 -0
  1231. package/src/hooks/useAnimatedLayout.ts +61 -0
  1232. package/src/hooks/useAnnounce.doc.mjs +4 -4
  1233. package/src/hooks/useAnnounce.modal.test.tsx +1291 -0
  1234. package/src/hooks/useAnnounce.test.tsx +64 -4
  1235. package/src/hooks/useAnnounce.ts +452 -28
  1236. package/src/hooks/useAnnounceRenderedText.adopters.test.tsx +226 -0
  1237. package/src/hooks/useAnnounceRenderedText.ts +81 -11
  1238. package/src/hooks/useBusyAnnouncement.adopters.test.tsx +69 -0
  1239. package/src/hooks/useBusyAnnouncement.test.tsx +112 -0
  1240. package/src/hooks/useBusyAnnouncement.ts +64 -54
  1241. package/src/hooks/useFocusTrap.doc.mjs +3 -3
  1242. package/src/hooks/useFocusTrap.test.tsx +135 -2
  1243. package/src/hooks/useFocusTrap.ts +59 -27
  1244. package/src/hooks/useMenuHover.ts +6 -2
  1245. package/src/hooks/useMenuPress.doc.mjs +2 -2
  1246. package/src/hooks/useMenuPress.test.tsx +5 -2
  1247. package/src/hooks/useMenuPress.ts +72 -37
  1248. package/src/hooks/usePressFeedback.doc.mjs +4 -4
  1249. package/src/hooks/usePressFeedback.ts +5 -2
  1250. package/src/hooks/useScrollableArea.test.tsx +344 -3
  1251. package/src/hooks/useScrollableArea.ts +120 -12
  1252. package/src/i18n/generated-locales/en.generated.ts +35 -0
  1253. package/src/i18n/generated-locales/pseudo.generated.ts +37 -0
  1254. package/src/internal/tokenizer-presentation.test.ts +29 -0
  1255. package/src/internal/tokenizer-presentation.ts +25 -0
  1256. package/src/internal/touch.test.ts +44 -0
  1257. package/src/internal/touch.ts +41 -0
  1258. package/src/motion/LayoutChangeSnapshot.tsx +50 -0
  1259. package/src/motion/MEASUREMENTS.md +271 -0
  1260. package/src/motion/README.md +218 -0
  1261. package/src/motion/__tests__/animatedLayout.interaction.browser.spec.ts +1613 -0
  1262. package/src/motion/__tests__/animatedLayoutAdopters.interaction.browser.spec.ts +217 -0
  1263. package/src/motion/__tests__/animatedLayoutBundle.ts +17 -0
  1264. package/src/motion/animatedLayout.boundary.test.ts +155 -0
  1265. package/src/motion/animatedLayout.swap.test.ts +827 -0
  1266. package/src/motion/animatedLayout.test.ts +1154 -0
  1267. package/src/motion/animatedLayout.ts +1801 -0
  1268. package/src/motion/animatedLayoutAdopters.test.tsx +500 -0
  1269. package/src/motion/animator.test.ts +2653 -0
  1270. package/src/motion/animator.ts +2794 -0
  1271. package/src/motion/bezier.test.ts +52 -0
  1272. package/src/motion/bezier.ts +64 -0
  1273. package/src/motion/coast.test.ts +99 -0
  1274. package/src/motion/coast.ts +150 -0
  1275. package/src/motion/decay.test.ts +120 -0
  1276. package/src/motion/decay.ts +126 -0
  1277. package/src/motion/projection.test.ts +107 -0
  1278. package/src/motion/projection.ts +116 -0
  1279. package/src/motion/reducedMotion.stylex.ts +41 -0
  1280. package/src/motion/reducedMotion.test.ts +129 -0
  1281. package/src/motion/reducedMotion.ts +94 -0
  1282. package/src/motion/reducedMotionPlan.test.ts +182 -0
  1283. package/src/motion/reducedMotionPlan.ts +263 -0
  1284. package/src/motion/resolveSnapPoint.test.ts +189 -0
  1285. package/src/motion/resolveSnapPoint.ts +169 -0
  1286. package/src/motion/roleValue.ts +105 -0
  1287. package/src/motion/roles.test.ts +256 -0
  1288. package/src/motion/roles.ts +262 -0
  1289. package/src/motion/rubberBand.test.ts +88 -0
  1290. package/src/motion/rubberBand.ts +115 -0
  1291. package/src/motion/selectPage.test.ts +31 -0
  1292. package/src/motion/selectPage.ts +55 -0
  1293. package/src/motion/spring.test.ts +650 -0
  1294. package/src/motion/spring.ts +551 -0
  1295. package/src/motion/transientCopy.ts +374 -0
  1296. package/src/motion/uikit/gestures.test.ts +89 -0
  1297. package/src/motion/uikit/gestures.ts +359 -0
  1298. package/src/motion/uikit/index.ts +80 -0
  1299. package/src/motion/uikit/navigation.ts +83 -0
  1300. package/src/motion/uikit/scroll.ts +141 -0
  1301. package/src/motion/uikit/springRows.test.ts +71 -0
  1302. package/src/motion/uikit/springs.ts +514 -0
  1303. package/src/motion/uikit/timing.ts +210 -0
  1304. package/src/motion/uikit/uikit.test.ts +364 -0
  1305. package/src/motion/uikit/values.test.ts +110 -0
  1306. package/src/reset.a11y.chromium.spec.ts +1 -0
  1307. package/src/reset.until-found.a11y.browser.spec.ts +1 -0
  1308. package/src/serverSafeComponents.test.ts +10 -0
  1309. package/src/tailwind-theme.css +51 -1
  1310. package/src/tailwind-theme.test.ts +51 -0
  1311. package/src/theme/Theme.test.tsx +28 -0
  1312. package/src/theme/__tests__/SpacingRootFontSize.a11y.chromium.spec.ts +1 -0
  1313. package/src/theme/declarationBoundary.ts +282 -1
  1314. package/src/theme/defineTheme.test.ts +529 -12
  1315. package/src/theme/defineTheme.ts +231 -19
  1316. package/src/theme/derivedVarRegistry.test.ts +34 -5
  1317. package/src/theme/derivedVarRegistry.ts +4 -0
  1318. package/src/theme/expandMotionScale.test.ts +17 -0
  1319. package/src/theme/extensibleAxes.test.ts +74 -29
  1320. package/src/theme/generateThemeRules.ts +772 -35
  1321. package/src/theme/index.ts +3 -0
  1322. package/src/theme/onMediaTokens.test.ts +186 -0
  1323. package/src/theme/statusColor.ts +189 -0
  1324. package/src/theme/statusRoleDerivation.ts +289 -0
  1325. package/src/theme/syntax/SyntaxTheme.tsx +1 -1
  1326. package/src/theme/syntax/defineSyntaxTheme.ts +1 -1
  1327. package/src/theme/syntax/presets.ts +1 -1
  1328. package/src/theme/syntax/tokens.ts +1 -1
  1329. package/src/theme/themeAdaptations.test.ts +412 -0
  1330. package/src/theme/themeAdaptations.ts +43 -1
  1331. package/src/theme/tokens.stylex.ts +36 -2
  1332. package/src/theme/tokens.test.ts +111 -1
  1333. package/src/theme/tokens.ts +23 -1
  1334. package/src/theme/useTheme.ts +10 -4
  1335. package/src/utils/customPropertyArmLayering.test.ts +131 -0
  1336. package/src/utils/edgeAutoscroll.test.ts +192 -0
  1337. package/src/utils/edgeAutoscroll.ts +111 -0
  1338. package/src/utils/hitArea.test.ts +628 -0
  1339. package/src/utils/hitArea.ts +770 -0
  1340. package/src/utils/interactionOverlay.stylex.ts +4 -1
  1341. package/src/utils/pressFeedback.test.ts +310 -2
  1342. package/src/utils/pressFeedback.ts +306 -54
  1343. package/src/utils/pressGesture.test.ts +50 -0
  1344. package/src/utils/pressGesture.ts +40 -2
  1345. package/src/utils/touchPresentation.test.ts +323 -0
  1346. package/src/utils/touchPresentation.ts +153 -0
@@ -0,0 +1,1502 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file animatedLayout.ts
5
+ * @input The DOM (layout rectangles, computed style), Web Animations, the
6
+ * internal `springs.settle` motion role (motion/roles.ts) and the Reduce Motion
7
+ * cross-fade clock (uikit/timing.ts)
8
+ * @output Exports `createAnimatedLayout` and the opaque `AnimatedLayout`
9
+ * handle, `reportLayoutChange`, `playLayoutChange`, `holdLayoutExit` /
10
+ * `releaseLayoutExit`, the in-place swap (`holdLayoutSwap` /
11
+ * `playLayoutSwap`), `playLayoutFrames` and `applyLayoutChangeTransition`:
12
+ * the one module
13
+ * that produces the
14
+ * size-change glide `spec:AST-105` defines
15
+ * (`architecture:react-component-runtime` INV12)
16
+ * @position Motion foundation, internal to core. A handle comes from the
17
+ * public `useAnimatedLayout` hook; a component that takes it reports its
18
+ * size changes through this module.
19
+ *
20
+ * How it works:
21
+ * - `measureBefore()` runs before the change commits: from the changed
22
+ * element it walks up to the handle's container and, at each level,
23
+ * records the rectangles of the element siblings after it and before it (a
24
+ * centered, end-aligned or space-between row, or `order`, moves those too),
25
+ * through `parentElement`, `nextElementSibling` and
26
+ * `previousElementSibling`, descending only into an element with
27
+ * `display: contents` (it has no box). Each level's walk stops at the first
28
+ * sibling outside the band a change can move content into view from: the
29
+ * area's visible part plus one viewport, or the changed element's size if
30
+ * larger, above and below. So its cost grows with depth plus the siblings
31
+ * near the visible part, never with a list's length.
32
+ * - `animate()` runs after the commit (a layout effect). Every change in the
33
+ * same area reported in one frame is measured together after the commit,
34
+ * once, in a microtask, so each element moves once, by its total change.
35
+ * - An element moves only when its rectangle changed and it is in the area's
36
+ * visible part, before or after. Absolute, fixed, top-layer, hidden and
37
+ * zero-size elements are skipped (an absolute child rides with its moving
38
+ * parent); a stuck sticky element does not change rectangle, so it stays.
39
+ * - The move is a compositor-only `translate` (replace composition) from the
40
+ * old place to the new one, sampled from `springs.settle` into linear
41
+ * keyframes and corrected for a scaled ancestor. An element already gliding
42
+ * keeps that motion and adds the new move: the rest of its curve and the
43
+ * new move are summed into one new glide, velocity included. Nothing
44
+ * animates height, and nothing scrolls the area.
45
+ * - A measurement no commit claims by the next frame is dropped.
46
+ * - The changed element plays its own entrance on the same spring, started in
47
+ * the same frame (`playLayoutChange`), or its exit: kept where it is while
48
+ * it gives up its space and conceals (`holdLayoutExit`). A disclosure's
49
+ * indicator turns on the same motion (`applyLayoutChangeTransition`).
50
+ * - A swap holds old content as one transient copy, inert and hidden from
51
+ * assistive technology, while new content enters in its place, on the same
52
+ * motion, and removes it when the swap ends (`holdLayoutSwap`,
53
+ * `playLayoutSwap`; `spec:AST-105` FR8). The caller shapes the frames over
54
+ * the swap's progress and, riding a gliding element, how far it has moved,
55
+ * so every part keeps to that glide; under Reduce Motion with a coarse
56
+ * pointer only opacity changes.
57
+ * - Frames on elements the page renders can play on the same motion with no
58
+ * copy (`playLayoutFrames`), such as a surface reaching over a gap a glide
59
+ * opens, and are released when the motion ends.
60
+ * - Every pointer (`spec:AST-105` FR5). Under Reduce Motion nothing travels
61
+ * (`design:reduced-motion` DR1–DR3): a cross-fade under a coarse primary
62
+ * pointer, an immediate change otherwise.
63
+ * - Without a handle nothing happens: the component keeps its jump
64
+ * (`spec:AST-105` FR2).
65
+ */
66
+
67
+ import { motionRole } from "./roles.js";
68
+ import { inertCopy, isCopyable, paintedBackground, placeOver, visiblePartCopy, wrapText } from "./transientCopy.js";
69
+ import { isSpring } from "./roleValue.js";
70
+ import { solveSpring, toSpring } from "./spring.js";
71
+ import { registerSpringsTable, SETTLE_SPRING } from "./uikit/springs.js";
72
+ import { reducedMotionCrossFade } from "./uikit/timing.js";
73
+
74
+ /** The shared motion role (`spec:AST-105` FR4). */
75
+ const ROLE_ID = 'springs.settle';
76
+ /** Below this many pixels a shift is not worth a move. */
77
+ const MIN_SHIFT_PX = 0.5;
78
+ /** The touch cross-fade's cap (`design:reduced-motion` DR2). */
79
+ const CROSS_FADE_CAP_MS = 200;
80
+ /** Keyframes per second the spring is sampled at. */
81
+ const SAMPLES_PER_SECOND = 60;
82
+
83
+ // ---------------------------------------------------------------------------
84
+ // Motion
85
+ // ---------------------------------------------------------------------------
86
+
87
+ /** How a change plays under the reader's settings. */
88
+
89
+ /** The settle spring as remaining distance (1 → 0) over its duration. */
90
+
91
+ function matches(element, query) {
92
+ const view = element.ownerDocument.defaultView;
93
+ return typeof view?.matchMedia === 'function' && view.matchMedia(query).matches;
94
+ }
95
+
96
+ /**
97
+ * `springs.settle` from the internal role registry: one shared value for the
98
+ * glide, the changed element and the indicator. Motion roles are internal
99
+ * (`spec:AST-094` DEC-11): no theme, scope or custom property changes it.
100
+ */
101
+ function settleSpring() {
102
+ registerSpringsTable();
103
+ const value = motionRole(ROLE_ID)?.value;
104
+ return isSpring(value) ? value : SETTLE_SPRING;
105
+ }
106
+ function springProgress(description) {
107
+ const curve = solveSpring(toSpring(description), {
108
+ from: 1,
109
+ to: 0
110
+ });
111
+ const durationMs = Math.max(1, curve.settleTime(0.001) * 1000);
112
+ return {
113
+ durationMs,
114
+ remaining: t => t >= durationMs ? 0 : curve.value(t / 1000)
115
+ };
116
+ }
117
+
118
+ /** The motion a change in `area` plays now. */
119
+ function layoutMotion(area) {
120
+ if (matches(area, '(prefers-reduced-motion: reduce)')) {
121
+ if (!matches(area, '(pointer: coarse)')) {
122
+ return {
123
+ kind: 'instant'
124
+ };
125
+ }
126
+ const [x1, y1, x2, y2] = reducedMotionCrossFade.curve;
127
+ return {
128
+ kind: 'fade',
129
+ durationMs: Math.min(CROSS_FADE_CAP_MS, reducedMotionCrossFade.durationMs),
130
+ easing: `cubic-bezier(${x1}, ${y1}, ${x2}, ${y2})`
131
+ };
132
+ }
133
+ return {
134
+ kind: 'spring',
135
+ progress: springProgress(settleSpring())
136
+ };
137
+ }
138
+
139
+ /** Linear keyframes over `durationMs`, one per frame, from `frame(t ms)`. */
140
+ function sampleOver(durationMs, frame) {
141
+ const count = Math.max(2, Math.ceil(durationMs / 1000 * SAMPLES_PER_SECOND) + 1);
142
+ const keyframes = [];
143
+ for (let i = 0; i < count; i++) {
144
+ const offset = i / (count - 1);
145
+ keyframes.push({
146
+ ...frame(offset * durationMs),
147
+ offset
148
+ });
149
+ }
150
+ return keyframes;
151
+ }
152
+
153
+ /** Linear keyframes sampled from the spring, one per frame. */
154
+ function sampleKeyframes(progress, frame) {
155
+ return sampleOver(progress.durationMs, t => frame(progress.remaining(t)));
156
+ }
157
+
158
+ /** The spring as a CSS `linear()` easing, for a CSS transition. */
159
+ function linearEasing(progress) {
160
+ const stops = [];
161
+ const count = 24;
162
+ for (let i = 0; i <= count; i++) {
163
+ const fraction = i / count;
164
+ const value = 1 - progress.remaining(fraction * progress.durationMs);
165
+ stops.push(`${round(value)} ${round(fraction * 100)}%`);
166
+ }
167
+ return `linear(${stops.join(', ')})`;
168
+ }
169
+ function round(value) {
170
+ return Math.round(value * 1000) / 1000;
171
+ }
172
+
173
+ // ---------------------------------------------------------------------------
174
+ // Playing
175
+ // ---------------------------------------------------------------------------
176
+
177
+ /**
178
+ * Play `keyframes` on `element`. Every option here (linear easing over sampled
179
+ * keyframes, replace composition) is one any Web Animations engine takes, so
180
+ * a failure means no Web Animations at all: the change then lands at once.
181
+ */
182
+ function safeAnimate(element, keyframes, options) {
183
+ if (typeof element.animate !== 'function') {
184
+ return null;
185
+ }
186
+ let animation;
187
+ try {
188
+ animation = element.animate(keyframes, options);
189
+ } catch {
190
+ return null;
191
+ }
192
+ ours.add(animation);
193
+ // Started on the document timeline's current time, not on the next frame:
194
+ // a retargeted glide keeps moving through the frame it is replaced in, and
195
+ // every animation of one change shares the same start.
196
+ const now = element.ownerDocument.timeline?.currentTime;
197
+ if (now != null) {
198
+ animation.startTime = now;
199
+ }
200
+ return animation;
201
+ }
202
+
203
+ /** Every animation this module started, so it can tell the app's apart. */
204
+ const ours = new WeakSet();
205
+ const TRANSFORM_PROPERTIES = ['transform', 'translate', 'rotate', 'scale'];
206
+
207
+ /** The numbers in a CSS value, units dropped. */
208
+ function numbersIn(value) {
209
+ return (value.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi) ?? []).map(Number);
210
+ }
211
+
212
+ /**
213
+ * Whether a transform value leaves the element where it is: nothing at all
214
+ * (a swipe's `translate3d(0, 0, 0)` at rest, a button's `scale(1)`, computed
215
+ * as `matrix(1, 0, 0, 1, 0, 0)`), or a scale in place (a pressed button's
216
+ * `scale(0.98)`). A glide's `translate` composes with either; a translation,
217
+ * rotation or skew of its own is the app moving the element.
218
+ */
219
+ function staysInPlace(property, value) {
220
+ if (value === 'none') {
221
+ // No transform at all (a keyframe a press's own transition starts from).
222
+ return true;
223
+ }
224
+ if (property === 'scale') {
225
+ return true;
226
+ }
227
+ if (value.includes('var(')) {
228
+ // An unresolved custom property in an app's own keyframes: its value is
229
+ // unknown here, so the app moves the element.
230
+ return false;
231
+ }
232
+ if (property === 'translate') {
233
+ return numbersIn(value).every(n => n === 0);
234
+ }
235
+ if (property === 'rotate') {
236
+ // An angle, after an optional axis: only the angle matters.
237
+ const numbers = numbersIn(value);
238
+ return numbers.length > 0 && numbers[numbers.length - 1] === 0;
239
+ }
240
+ // A list of transform functions, as computed (`matrix()`, `matrix3d()`)
241
+ // or as written.
242
+ const functions = [...value.matchAll(/([a-z0-9]+)\(([^)]*)\)/gi)];
243
+ return functions.length > 0 && functions.every(([, name, args]) => {
244
+ const numbers = numbersIn(args);
245
+ const fn = name.toLowerCase();
246
+ if (fn === 'matrix') {
247
+ // a b c d e f: no skew, rotation or translation.
248
+ return numbers.length === 6 && [1, 2, 4, 5].every(index => numbers[index] === 0);
249
+ }
250
+ if (fn === 'matrix3d') {
251
+ // Only the diagonal: a scale, nothing else.
252
+ return numbers.length === 16 && numbers.every((n, index) => index % 5 === 0 || n === 0);
253
+ }
254
+ if (fn === 'rotate3d') {
255
+ return numbers[3] === 0;
256
+ }
257
+ if (fn.startsWith('scale')) {
258
+ return true;
259
+ }
260
+ if (fn.startsWith('translate') || fn.startsWith('rotate') || fn.startsWith('skew')) {
261
+ return numbers.every(n => n === 0);
262
+ }
263
+ return false;
264
+ });
265
+ }
266
+
267
+ /**
268
+ * Whether the app moves `element` itself: its own `transform`, `translate`
269
+ * or `rotate`, or a running animation of one this module did not start. A
270
+ * value that leaves it in place (nothing, or a scale) is not a move.
271
+ */
272
+ function movedByApp(element) {
273
+ const style = element.ownerDocument.defaultView?.getComputedStyle(element);
274
+ if (style != null && TRANSFORM_PROPERTIES.some(property => {
275
+ const value = style.getPropertyValue(property);
276
+ return value !== '' && value !== 'none' && !staysInPlace(property, value);
277
+ })) {
278
+ return true;
279
+ }
280
+ if (typeof element.getAnimations !== 'function') {
281
+ return false;
282
+ }
283
+ return element.getAnimations().some(animation => {
284
+ if (ours.has(animation)) {
285
+ return false;
286
+ }
287
+ const effect = animation.effect;
288
+ if (!(effect instanceof KeyframeEffect)) {
289
+ return false;
290
+ }
291
+ return effect.getKeyframes().some(frame => TRANSFORM_PROPERTIES.some(property => property in frame && !staysInPlace(property, String(frame[property]))));
292
+ });
293
+ }
294
+
295
+ /** An offset in the element's own px, as a function of ms into a glide. */
296
+
297
+ const AT_REST = () => ({
298
+ x: 0,
299
+ y: 0
300
+ });
301
+
302
+ /** A glide an element is playing, so a new change can retarget it. */
303
+
304
+ const glides = new WeakMap();
305
+
306
+ /**
307
+ * The glide `element` is playing now, if any. For an adopter that draws
308
+ * something with each moving element (a table row's divider): it finds what
309
+ * moves without reading the DOM.
310
+ */
311
+ export function glideOf(element) {
312
+ return glides.get(element)?.animation ?? null;
313
+ }
314
+
315
+ // ---------------------------------------------------------------------------
316
+ // Handles
317
+ // ---------------------------------------------------------------------------
318
+
319
+ const AREA = Symbol('astryx.animatedLayout.area');
320
+
321
+ /**
322
+ * The opaque handle `useAnimatedLayout` returns (`spec:AST-105` FR1): no
323
+ * public members. A component that receives it reports its size changes to
324
+ * the handle's container, the area the glide stays inside.
325
+ */
326
+
327
+ /** A handle over `area` (the container element, read when a change runs). */
328
+ export function createAnimatedLayout(area) {
329
+ // Not enumerable and frozen: the handle shows no fields to a caller.
330
+ return Object.freeze(Object.defineProperty({}, AREA, {
331
+ value: area
332
+ }));
333
+ }
334
+ function areaOf(handle, element) {
335
+ const area = handle[AREA]();
336
+ return area != null && area !== element && area.contains(element) ? area : null;
337
+ }
338
+
339
+ // ---------------------------------------------------------------------------
340
+ // The walk
341
+ // ---------------------------------------------------------------------------
342
+
343
+ /**
344
+ * Whether `element` takes part: in flow, rendered, not in the top layer.
345
+ * `display: contents` is handled by the caller.
346
+ */
347
+ function takesPart(element, style) {
348
+ if (style.display === 'none' || style.visibility === 'hidden' || style.position === 'absolute' || style.position === 'fixed') {
349
+ return false;
350
+ }
351
+ try {
352
+ if (element.matches(':popover-open, :modal')) {
353
+ return false;
354
+ }
355
+ } catch {
356
+ // An engine without these pseudo-classes has no top layer to skip.
357
+ }
358
+ return true;
359
+ }
360
+
361
+ /**
362
+ * The band of the page a change can move content into or out of view: the
363
+ * area's visible part, extended above and below by one viewport or by the
364
+ * size of every element changing in the frame, whichever is larger (a
365
+ * collapse pulls content up by at most its size, and changes in one frame
366
+ * add up). Content outside it before the change stays outside it, so the
367
+ * walk stops there.
368
+ */
369
+
370
+ function bandFor(visible, reach) {
371
+ return {
372
+ start: visible.top - reach,
373
+ end: visible.bottom + reach
374
+ };
375
+ }
376
+
377
+ /**
378
+ * What one frame's walks read, kept so a level two changes share, or a walk
379
+ * repeated when the band grows, reads each element once.
380
+ */
381
+
382
+ function partOf(element, cache) {
383
+ let part = cache.parts.get(element);
384
+ if (part === undefined) {
385
+ const style = element.ownerDocument.defaultView?.getComputedStyle(element);
386
+ part = style == null ? false : style.display === 'contents' ? 'contents' : takesPart(element, style);
387
+ cache.parts.set(element, part);
388
+ }
389
+ return part;
390
+ }
391
+
392
+ /**
393
+ * Whether a container lays its children out across the block direction, so
394
+ * DOM order does not run down the page: multi-column, a wrapping column flex
395
+ * box, or a grid that flows by column. The band says nothing about where its
396
+ * later children sit, so a walk there runs through the level.
397
+ */
398
+ function flowsAcross(container) {
399
+ if (container == null) {
400
+ return false;
401
+ }
402
+ const style = container.ownerDocument.defaultView?.getComputedStyle(container);
403
+ if (style == null) {
404
+ return false;
405
+ }
406
+ const count = style.getPropertyValue('column-count');
407
+ const width = style.getPropertyValue('column-width');
408
+ return count !== '' && count !== 'auto' || width !== '' && width !== 'auto' || style.display.includes('flex') && style.flexDirection.startsWith('column') && style.flexWrap.startsWith('wrap') || style.display.includes('grid') && style.getPropertyValue('grid-auto-flow').startsWith('column');
409
+ }
410
+
411
+ /**
412
+ * The box a sticky element sticks to: its nearest scrolling ancestor's, or
413
+ * the viewport.
414
+ */
415
+ function scrollportOf(element) {
416
+ const view = element.ownerDocument.defaultView;
417
+ for (let node = element.parentElement; node != null && node !== element.ownerDocument.documentElement; node = node.parentElement) {
418
+ const overflow = view?.getComputedStyle(node).overflowY ?? 'visible';
419
+ if (node === element.ownerDocument.body && view?.getComputedStyle(element.ownerDocument.documentElement).overflowY === 'visible') {
420
+ // The body's overflow applies to the viewport while the root's is
421
+ // visible: the body is no scroller of its own.
422
+ continue;
423
+ }
424
+ if (overflow !== 'visible' && overflow !== 'clip') {
425
+ const box = node.getBoundingClientRect();
426
+ return {
427
+ start: box.top + node.clientTop,
428
+ end: box.top + node.clientTop + node.clientHeight
429
+ };
430
+ }
431
+ }
432
+ return {
433
+ start: 0,
434
+ end: view?.innerHeight ?? 0
435
+ };
436
+ }
437
+
438
+ /**
439
+ * Whether a sticky element is stuck: resting against its scrollport's edge
440
+ * at its inset. A stuck element takes its final place; an unstuck one is in
441
+ * flow.
442
+ */
443
+ function isStuck(element, cache) {
444
+ const style = element.ownerDocument.defaultView?.getComputedStyle(element);
445
+ if (style?.position !== 'sticky') {
446
+ return false;
447
+ }
448
+ const rect = rectOf(element, cache);
449
+ const edge = scrollportOf(element);
450
+ const top = Number.parseFloat(style.top);
451
+ const bottom = Number.parseFloat(style.bottom);
452
+ return Number.isFinite(top) && Math.abs(rect.top - (edge.start + top)) < 1 || Number.isFinite(bottom) && Math.abs(rect.bottom - (edge.end - bottom)) < 1;
453
+ }
454
+ function rectOf(element, cache) {
455
+ let rect = cache.rects.get(element);
456
+ if (rect === undefined) {
457
+ rect = element.getBoundingClientRect();
458
+ cache.rects.set(element, rect);
459
+ }
460
+ return rect;
461
+ }
462
+
463
+ /**
464
+ * The elements a change can move, each with its rectangle before the change:
465
+ * the changed element's ancestors up to the area (a centered column moves
466
+ * the card around the change), and at each of their levels the siblings
467
+ * after and before (a centered, end-aligned or space-between row, or
468
+ * `order`, moves those too). A `display: contents` element has no box: its
469
+ * children stand in its place, walked in the same direction. At each level
470
+ * the walk stops at the first sibling outside `band`, so its cost grows with
471
+ * depth plus the siblings near the visible part, never with the length of a
472
+ * list; where the area opts out of scroll anchoring (`walksToBand`), the walk
473
+ * after a change above the band goes on to the band, a cost that grows with
474
+ * that distance. Inside a positioned, stuck sticky or top-layer ancestor only the
475
+ * content after the change is taken.
476
+ */
477
+ function collectCandidates(changed, area, band, cache, walksToBand, ancestors, befores) {
478
+ const out = new Map();
479
+ /** Takes `element`; returns false once it lies outside the band. */
480
+ /** The current level runs through its siblings, ignoring the band. */
481
+ let runsThrough = false;
482
+ const take = (element, isAfter) => {
483
+ const part = partOf(element, cache);
484
+ if (part === 'contents') {
485
+ for (let child = isAfter ? element.firstElementChild : element.lastElementChild; child != null; child = isAfter ? child.nextElementSibling : child.previousElementSibling) {
486
+ if (!take(child, isAfter)) {
487
+ return false;
488
+ }
489
+ }
490
+ return true;
491
+ }
492
+ if (!part) {
493
+ return true;
494
+ }
495
+ const rect = rectOf(element, cache);
496
+ if (runsThrough) {
497
+ out.set(element, rect);
498
+ return true;
499
+ }
500
+ if (rect.top > band.end) {
501
+ return false;
502
+ }
503
+ if (rect.bottom < band.start) {
504
+ // Above the band. Where the scroller opts out of scroll anchoring, the
505
+ // content after a change above the band shifts the rows in view, so
506
+ // the walk after it goes on to the band; with anchoring, it stops.
507
+ return isAfter && walksToBand;
508
+ }
509
+ out.set(element, rect);
510
+ if (!isAfter) {
511
+ befores.add(element);
512
+ }
513
+ return true;
514
+ };
515
+ // The change's chain up to the area, and from where it is inside a
516
+ // positioned, stuck sticky or top-layer ancestor: that ancestor takes its final
517
+ // place, so inside it only the content after the change moves; the
518
+ // ancestors and the siblings before the change stay with it.
519
+ const chain = [];
520
+ for (let node = changed; node != null && node !== area; node = node.parentElement) {
521
+ chain.push(node);
522
+ }
523
+ // The levels below this index are inside a positioned ancestor.
524
+ let positionedFrom = 0;
525
+ for (let index = chain.length - 1; index > 0; index -= 1) {
526
+ if (partOf(chain[index], cache) === false || isStuck(chain[index], cache)) {
527
+ positionedFrom = index;
528
+ break;
529
+ }
530
+ }
531
+ for (const [level, node] of chain.entries()) {
532
+ runsThrough = flowsAcross(node.parentElement);
533
+ if (node !== changed && level > positionedFrom && partOf(node, cache) === true) {
534
+ // An ancestor of the change in flow: where its layout moves it (a
535
+ // centered column), it glides, and what is inside moves only by its own
536
+ // change. A positioned, stuck sticky or top-layer ancestor, and every
537
+ // ancestor inside it, takes its final place.
538
+ out.set(node, rectOf(node, cache));
539
+ ancestors.add(node);
540
+ }
541
+ for (let sibling = node.nextElementSibling; sibling != null && take(sibling, true); sibling = sibling.nextElementSibling) {
542
+ // The siblings after it, until one lies past the band.
543
+ }
544
+ if (level < positionedFrom) {
545
+ continue;
546
+ }
547
+ for (let sibling = node.previousElementSibling; sibling != null && take(sibling, false); sibling = sibling.previousElementSibling) {
548
+ // The siblings before it, until one lies before the band.
549
+ }
550
+ }
551
+ return out;
552
+ }
553
+
554
+ // ---------------------------------------------------------------------------
555
+ // Batches: every change in one area in one frame moves together
556
+ // ---------------------------------------------------------------------------
557
+
558
+ const batches = new Map();
559
+ function batchFor(area) {
560
+ let batch = batches.get(area);
561
+ if (batch == null) {
562
+ const created = {
563
+ area,
564
+ changed: new Set(),
565
+ before: new Map(),
566
+ candidates: new Map(),
567
+ changedSize: 0,
568
+ reach: 0,
569
+ visible: null,
570
+ walksToBand: null,
571
+ ancestors: new Set(),
572
+ befores: new Set(),
573
+ originBefore: null,
574
+ cache: {
575
+ rects: new Map(),
576
+ parts: new Map()
577
+ },
578
+ scheduled: false,
579
+ beforeMove: []
580
+ };
581
+ batches.set(area, created);
582
+ // A measurement no commit claims by the next frame (a controlled owner
583
+ // refused the change) is dropped, so it never moves rows later and holds
584
+ // no elements.
585
+ const view = area.ownerDocument.defaultView;
586
+ const drop = () => {
587
+ if (batches.get(area) === created && !created.scheduled) {
588
+ batches.delete(area);
589
+ }
590
+ };
591
+ if (typeof view?.requestAnimationFrame === 'function') {
592
+ view.requestAnimationFrame(drop);
593
+ } else {
594
+ setTimeout(drop, 16);
595
+ }
596
+ batch = created;
597
+ }
598
+ return batch;
599
+ }
600
+ function intersects(a, b) {
601
+ return a.width > 0 && a.height > 0 && a.right > b.left && a.left < b.right && a.bottom > b.top && a.top < b.bottom;
602
+ }
603
+
604
+ /** The part of the area the person can see: its box within the viewport. */
605
+ /** Where the area's scrolled content starts, in client px. */
606
+ function originOf(area) {
607
+ const box = area.getBoundingClientRect();
608
+ return {
609
+ x: box.left - area.scrollLeft,
610
+ y: box.top - area.scrollTop
611
+ };
612
+ }
613
+ function visibleRect(area) {
614
+ const box = area.getBoundingClientRect();
615
+ const view = area.ownerDocument.defaultView;
616
+ const width = view?.innerWidth ?? box.right;
617
+ const height = view?.innerHeight ?? box.bottom;
618
+ const left = Math.max(box.left, 0);
619
+ const top = Math.max(box.top, 0);
620
+ return new DOMRect(left, top, Math.max(0, Math.min(box.right, width) - left), Math.max(0, Math.min(box.bottom, height) - top));
621
+ }
622
+
623
+ /** The element's rendered scale against its layout size (a scaled ancestor). */
624
+ function scaleOf(element, rect, own = {
625
+ x: 1,
626
+ y: 1
627
+ }) {
628
+ const html = element;
629
+ const x = html.offsetWidth > 0 && rect.width > 0 ? rect.width / html.offsetWidth / own.x : 1;
630
+ const y = html.offsetHeight > 0 && rect.height > 0 ? rect.height / html.offsetHeight / own.y : 1;
631
+ // Subpixel rounding makes an unscaled element read a hair off 1; only a
632
+ // real scale is corrected.
633
+ return {
634
+ x: Math.abs(x - 1) < 0.01 ? 1 : x || 1,
635
+ y: Math.abs(y - 1) < 0.01 ? 1 : y || 1
636
+ };
637
+ }
638
+
639
+ /**
640
+ * The scale an element's own `scale` and `transform` give it, on each axis
641
+ * (a follower that keeps one in place, `staysInPlace`). A glide's `translate`
642
+ * does not go through them: the individual transform properties apply
643
+ * `translate` first, in the parent's space.
644
+ */
645
+ function ownScaleOf(element) {
646
+ const style = element.ownerDocument.defaultView?.getComputedStyle(element);
647
+ if (style == null) {
648
+ return {
649
+ x: 1,
650
+ y: 1
651
+ };
652
+ }
653
+ let x = 1;
654
+ let y = 1;
655
+ const scale = style.getPropertyValue('scale');
656
+ if (scale !== '' && scale !== 'none') {
657
+ const [sx = 1, sy = sx] = numbersIn(scale);
658
+ // Its size, not its direction: a negative scale flips the element in
659
+ // place, and its measured box stays positive.
660
+ x *= Math.abs(sx);
661
+ y *= Math.abs(sy);
662
+ }
663
+ // The computed transform is a matrix: its first column's length is the
664
+ // scale on x, its second's on y.
665
+ const matrix = /^matrix(3d)?\(([^)]*)\)/.exec(style.getPropertyValue('transform'));
666
+ if (matrix != null) {
667
+ const m = numbersIn(matrix[2]);
668
+ const [a = 1, b = 0, c = 0, d = 1] = matrix[1] == null ? m : [m[0], m[1], m[4], m[5]];
669
+ x *= Math.hypot(a, b);
670
+ y *= Math.hypot(c, d);
671
+ }
672
+ return {
673
+ x: x || 1,
674
+ y: y || 1
675
+ };
676
+ }
677
+ function flush(batch) {
678
+ batches.delete(batch.area);
679
+ const notify = candidates => {
680
+ for (const callback of batch.beforeMove) {
681
+ callback(candidates);
682
+ }
683
+ };
684
+ // What each change's walk measured before it: an element added by the
685
+ // change has no old place, and one it removed is gone.
686
+ const followers = new Set();
687
+ for (const changed of batch.changed) {
688
+ for (const element of batch.candidates.get(changed) ?? []) {
689
+ if (element.isConnected) {
690
+ followers.add(element);
691
+ }
692
+ }
693
+ }
694
+ if (followers.size === 0) {
695
+ notify([]);
696
+ return;
697
+ }
698
+ const motion = layoutMotion(batch.area);
699
+ if (motion.kind === 'instant') {
700
+ notify([]);
701
+ return;
702
+ }
703
+ const visible = visibleRect(batch.area);
704
+ // Every running glide stops first and every new place is read before any
705
+ // glide starts, so no reading includes another's new motion.
706
+ const entries = [];
707
+ for (const element of followers) {
708
+ const before = batch.before.get(element);
709
+ if (before == null || before.width === 0 && before.height === 0) {
710
+ // Added by the change, or not rendered before it: it has no old place.
711
+ // A changed element an earlier change displaced does have one, and
712
+ // moves with its row while it plays its own entrance or exit.
713
+ continue;
714
+ }
715
+ // An element already gliding keeps that motion and adds the new move: the
716
+ // running glide stops (so its rectangle is its new layout place) and the
717
+ // rest of its curve carries into the one new glide, velocity included,
718
+ // summed with the new move.
719
+ const running = glides.get(element);
720
+ let carried = AT_REST;
721
+ let carriedMs = 0;
722
+ if (running != null) {
723
+ const time = Number(running.animation.currentTime);
724
+ const elapsed = Number.isFinite(time) ? Math.max(0, time) : 0;
725
+ if (elapsed < running.durationMs) {
726
+ carried = t => running.offsetAt(elapsed + t);
727
+ carriedMs = running.durationMs - elapsed;
728
+ }
729
+ running.animation.cancel();
730
+ glides.delete(element);
731
+ }
732
+ entries.push({
733
+ element,
734
+ before,
735
+ carried,
736
+ carriedMs
737
+ });
738
+ }
739
+ // Every reading (places, transforms, scales) before any glide starts: a
740
+ // glide started between two readings would make the next one lay the page
741
+ // out again, once per element (on a long page, the whole cost).
742
+ const byElement = new Map();
743
+ // An ancestor of the change, and a sibling before it, move by their layout
744
+ // change alone: when scroll anchoring re-scrolls the area, an outer
745
+ // scroller or the page (a change above the visible part), or the area
746
+ // itself moves as its content grows (a dialog re-centered), their place in
747
+ // view shifts by that while their place in the area stays.
748
+ const origin = originOf(batch.area);
749
+ const scrolledX = origin.x - (batch.originBefore?.x ?? origin.x);
750
+ const scrolledY = origin.y - (batch.originBefore?.y ?? origin.y);
751
+ // Netted only where that makes the move smaller: an element the browser
752
+ // kept in place (scroll anchoring for another change in the same frame)
753
+ // stays where it is.
754
+ const nearer = (raw, shift) => Math.abs(raw + shift) < Math.abs(raw) ? raw + shift : raw;
755
+ for (const entry of entries) {
756
+ entry.after = entry.element.getBoundingClientRect();
757
+ // The move is the inline-start edge's, by the container's direction (it
758
+ // decides where the element sits): in a right-to-left container an
759
+ // element that narrows keeps its left edge and moves its right one.
760
+ const container = entry.element.parentElement ?? entry.element;
761
+ const isRtl = container.ownerDocument.defaultView?.getComputedStyle(container).direction === 'rtl';
762
+ const rawX = isRtl ? entry.before.right - entry.after.right : entry.before.left - entry.after.left;
763
+ const rawY = entry.before.top - entry.after.top;
764
+ // The siblings before the change stay with the ancestors around them.
765
+ const isAncestor = batch.ancestors.has(entry.element) || batch.befores.has(entry.element);
766
+ entry.rawX = isAncestor ? nearer(rawX, scrolledX) : rawX;
767
+ entry.rawY = isAncestor ? nearer(rawY, scrolledY) : rawY;
768
+ byElement.set(entry.element, entry);
769
+ }
770
+ for (const entry of entries) {
771
+ const after = entry.after;
772
+ if (intersects(entry.before, visible) || intersects(after, visible)) {
773
+ entry.isMovedByApp = movedByApp(entry.element);
774
+ // Only its ancestors' scale is corrected: its own scale or transform
775
+ // (a press's scale) does not apply to the glide's `translate`.
776
+ entry.scale = scaleOf(entry.element, after, ownScaleOf(entry.element));
777
+ }
778
+ }
779
+ // An adopter's own readings join them here, before any glide starts.
780
+ notify(entries.map(entry => entry.element));
781
+ for (const entry of entries) {
782
+ const {
783
+ element,
784
+ before,
785
+ carried,
786
+ carriedMs
787
+ } = entry;
788
+ const after = entry.after;
789
+ // Nested changes compose: an element inside another moving element moves
790
+ // only by its own change, whatever order the changes were reported in.
791
+ let dx = entry.rawX ?? 0;
792
+ let dy = entry.rawY ?? 0;
793
+ for (let ancestor = element.parentElement; ancestor != null && ancestor !== batch.area; ancestor = ancestor.parentElement) {
794
+ const moving = byElement.get(ancestor);
795
+ if (moving != null) {
796
+ dx -= moving.rawX ?? 0;
797
+ dy -= moving.rawY ?? 0;
798
+ break;
799
+ }
800
+ }
801
+ if (Math.abs(dx) < MIN_SHIFT_PX && Math.abs(dy) < MIN_SHIFT_PX) {
802
+ continue;
803
+ }
804
+ if (!intersects(before, visible) && !intersects(after, visible)) {
805
+ // Outside the visible part before and after: it lands silently.
806
+ continue;
807
+ }
808
+ if (motion.kind === 'fade') {
809
+ safeAnimate(element, [{
810
+ opacity: 0
811
+ }, {
812
+ opacity: 1
813
+ }], {
814
+ duration: motion.durationMs,
815
+ easing: motion.easing
816
+ });
817
+ continue;
818
+ }
819
+ if (entry.isMovedByApp === true) {
820
+ // The app moves it itself: it takes its final place at once
821
+ // (`spec:AST-105` Coverage).
822
+ continue;
823
+ }
824
+ // Where it shows now, against its new place, in its own px; the part the
825
+ // carried glide does not cover is the new move.
826
+ const scale = entry.scale ?? {
827
+ x: 1,
828
+ y: 1
829
+ };
830
+ const now = carried(0);
831
+ const moveX = dx / scale.x - now.x;
832
+ const moveY = dy / scale.y - now.y;
833
+ const {
834
+ progress
835
+ } = motion;
836
+ const offsetAt = t => {
837
+ const remaining = progress.remaining(t);
838
+ const carry = carried(t);
839
+ return {
840
+ x: carry.x + moveX * remaining,
841
+ y: carry.y + moveY * remaining
842
+ };
843
+ };
844
+ const durationMs = Math.max(progress.durationMs, carriedMs);
845
+ // One replace-composited `translate`: the compositor runs it (INV12).
846
+ const animation = safeAnimate(element, sampleOver(durationMs, t => {
847
+ const offset = offsetAt(t);
848
+ return {
849
+ translate: `${offset.x}px ${offset.y}px`
850
+ };
851
+ }), {
852
+ duration: durationMs,
853
+ easing: 'linear'
854
+ });
855
+ if (animation != null) {
856
+ const glide = {
857
+ animation,
858
+ offsetAt,
859
+ durationMs
860
+ };
861
+ glides.set(element, glide);
862
+ animation.addEventListener?.('finish', () => {
863
+ if (glides.get(element) === glide) {
864
+ glides.delete(element);
865
+ }
866
+ });
867
+ }
868
+ }
869
+ }
870
+ function resolve(target) {
871
+ return typeof target === 'function' ? target() : target.current;
872
+ }
873
+ /**
874
+ * Report a size change of `target` to the handle's area. Call
875
+ * `measureBefore()` before the change commits and `animate()` after it; the
876
+ * content after `target`, up to the area, glides from its old place.
877
+ * Changes in one area in one frame move together. Without a handle, or
878
+ * outside its container, nothing moves.
879
+ */
880
+ export function reportLayoutChange(handle, target) {
881
+ return {
882
+ measureBefore() {
883
+ const element = resolve(target);
884
+ if (element == null || handle == null) {
885
+ return;
886
+ }
887
+ const area = areaOf(handle, element);
888
+ if (area == null) {
889
+ return;
890
+ }
891
+ const batch = batchFor(area);
892
+ if (batch.changed.has(element)) {
893
+ return;
894
+ }
895
+ batch.changed.add(element);
896
+ batch.changedSize += rectOf(element, batch.cache).height;
897
+ batch.visible ??= visibleRect(area);
898
+ batch.originBefore ??= originOf(area);
899
+ batch.walksToBand ??= area.ownerDocument.defaultView?.getComputedStyle(area).getPropertyValue('overflow-anchor') === 'none';
900
+ // Changes in one frame add up: every change's walk reaches the band
901
+ // their summed size can pull into view. When that outgrows the band
902
+ // walked so far, the band at least doubles and every change is walked
903
+ // again (from the cache), so a frame of many changes re-walks a few
904
+ // times, not once per change.
905
+ const needed = Math.max(batch.visible.height, batch.changedSize);
906
+ const walks = needed > batch.reach ? [...batch.changed] : [element];
907
+ if (needed > batch.reach) {
908
+ batch.reach = Math.max(needed, batch.reach * 2);
909
+ }
910
+ const band = bandFor(batch.visible, batch.reach);
911
+ for (const changed of walks) {
912
+ const candidates = collectCandidates(changed, area, band, batch.cache, batch.walksToBand, batch.ancestors, batch.befores);
913
+ for (const [candidate, rect] of candidates) {
914
+ if (!batch.before.has(candidate)) {
915
+ batch.before.set(candidate, rect);
916
+ }
917
+ }
918
+ batch.candidates.set(changed, [...candidates.keys()]);
919
+ }
920
+ },
921
+ animate(beforeMove) {
922
+ const element = resolve(target);
923
+ if (element == null || handle == null) {
924
+ return false;
925
+ }
926
+ const area = areaOf(handle, element);
927
+ const batch = area == null ? undefined : batches.get(area);
928
+ if (batch == null || !batch.changed.has(element)) {
929
+ return false;
930
+ }
931
+ if (beforeMove != null) {
932
+ batch.beforeMove.push(beforeMove);
933
+ }
934
+ if (!batch.scheduled) {
935
+ batch.scheduled = true;
936
+ // After every layout effect of this commit, before paint.
937
+ queueMicrotask(() => flush(batch));
938
+ }
939
+ return true;
940
+ }
941
+ };
942
+ }
943
+
944
+ /**
945
+ * The changed element's own animation, on the same motion as the content
946
+ * after it: content that appears reveals downward from its top edge. Plays
947
+ * only with a handle, inside its area and in the area's visible part.
948
+ * Returns the entrance it started, or null when it played none.
949
+ */
950
+ export function playLayoutChange(handle, element) {
951
+ if (handle == null) {
952
+ return null;
953
+ }
954
+ const area = areaOf(handle, element);
955
+ if (area == null) {
956
+ return null;
957
+ }
958
+ if (!intersects(element.getBoundingClientRect(), visibleRect(area))) {
959
+ return null;
960
+ }
961
+ const motion = layoutMotion(area);
962
+ if (motion.kind === 'instant') {
963
+ return null;
964
+ }
965
+ if (motion.kind === 'fade') {
966
+ return safeAnimate(element, [{
967
+ opacity: 0
968
+ }, {
969
+ opacity: 1
970
+ }], {
971
+ duration: motion.durationMs,
972
+ easing: motion.easing
973
+ });
974
+ }
975
+ return safeAnimate(element, sampleKeyframes(motion.progress, remaining => ({
976
+ opacity: 1 - remaining,
977
+ clipPath: `inset(0 0 ${round(remaining * 100)}% 0)`
978
+ })), {
979
+ duration: motion.progress.durationMs,
980
+ easing: 'linear'
981
+ });
982
+ }
983
+
984
+ /** The inline properties an exit sets, so a release removes exactly them. */
985
+ const EXIT_PROPERTIES = ['margin-block-end', 'margin-inline-end', 'pointer-events'];
986
+
987
+ /**
988
+ * The first element after `element` in the area that takes part in layout:
989
+ * its next sibling, or its nearest ancestor's below the area. A wrapper's
990
+ * edge is not used: a negative end margin can collapse through it.
991
+ */
992
+ function nextInFlow(element, area) {
993
+ const view = element.ownerDocument.defaultView;
994
+ // The first box at or inside `from` (a `display: contents` element has
995
+ // none of its own: its children stand in its place).
996
+ const firstBox = from => {
997
+ const style = view?.getComputedStyle(from);
998
+ if (style == null) {
999
+ return from;
1000
+ }
1001
+ if (style.display === 'contents') {
1002
+ for (let child = from.firstElementChild; child != null; child = child.nextElementSibling) {
1003
+ const box = firstBox(child);
1004
+ if (box != null) {
1005
+ return box;
1006
+ }
1007
+ }
1008
+ return null;
1009
+ }
1010
+ return takesPart(from, style) ? from : null;
1011
+ };
1012
+ let node = element;
1013
+ while (node != null && node !== area) {
1014
+ for (let sibling = node.nextElementSibling; sibling != null; sibling = sibling.nextElementSibling) {
1015
+ const box = firstBox(sibling);
1016
+ if (box != null) {
1017
+ return box;
1018
+ }
1019
+ }
1020
+ node = node.parentElement;
1021
+ }
1022
+ return null;
1023
+ }
1024
+
1025
+ /**
1026
+ * An element's place: its block start, and its inline start (RTL read right
1027
+ * to left).
1028
+ */
1029
+ function placeOf(element, rtl) {
1030
+ const rect = element.getBoundingClientRect();
1031
+ return {
1032
+ block: rect.top,
1033
+ inline: rtl ? -rect.right : rect.left
1034
+ };
1035
+ }
1036
+
1037
+ /**
1038
+ * Keeps `element` where it is, in flow (so it scrolls and clips with its
1039
+ * container), while the content after it takes the place it takes once the
1040
+ * element is hidden: a negative end margin measured against that content,
1041
+ * so a gap or collapsing margins come out exact. Returns false, setting
1042
+ * nothing, when no margin reaches that place.
1043
+ */
1044
+ function giveUpSpace(element, area) {
1045
+ const view = element.ownerDocument.defaultView;
1046
+ const parent = element.parentElement == null ? undefined : view?.getComputedStyle(element.parentElement);
1047
+ const isRow = parent != null && parent.display.includes('flex') && parent.flexDirection.startsWith('row');
1048
+ const rtl = view?.getComputedStyle(element).direction === 'rtl';
1049
+ const property = isRow ? 'margin-inline-end' : 'margin-block-end';
1050
+ const size = isRow ? element.offsetWidth : element.offsetHeight;
1051
+ const next = nextInFlow(element, area);
1052
+ if (next == null) {
1053
+ // Nothing after it in the area to land anywhere.
1054
+ element.style.setProperty(property, `${-size}px`);
1055
+ return true;
1056
+ }
1057
+ const own = element.style.getPropertyValue(property);
1058
+ const ownPriority = element.style.getPropertyPriority(property);
1059
+ const axis = isRow ? 'inline' : 'block';
1060
+ // The content after its container must land too: a flex-row item that
1061
+ // sets its row's height moves what follows the row.
1062
+ const afterParent = element.parentElement == null || element.parentElement === area ? null : nextInFlow(element.parentElement, area);
1063
+ const checked = afterParent == null ? [next] : [next, afterParent];
1064
+ // The element's scale, read in the layout the caller's visibility check
1065
+ // already laid out.
1066
+ const scale = scaleOf(element, element.getBoundingClientRect());
1067
+ // Where the content after it goes once it is hidden, read with it taken
1068
+ // out of flow (not `display: none`, which would restart the CSS animations
1069
+ // inside it).
1070
+ const position = element.style.getPropertyValue('position');
1071
+ const positionPriority = element.style.getPropertyPriority('position');
1072
+ element.style.setProperty('position', 'absolute', 'important');
1073
+ const targets = checked.map(box => placeOf(box, rtl));
1074
+ const target = targets[0];
1075
+ if (position === '') {
1076
+ element.style.removeProperty('position');
1077
+ } else {
1078
+ element.style.setProperty('position', position, positionPriority);
1079
+ }
1080
+ // The reading is in screen px, the margin in the element's own: under a
1081
+ // scaled ancestor a distance is divided by the scale on this axis.
1082
+ const perPx = isRow ? scale.x : scale.y;
1083
+ // A first guess (its box), then one correction from the measured result:
1084
+ // a gap, a collapsed margin or the element's own margins.
1085
+ element.style.setProperty(property, `${-size}px`);
1086
+ const guess = placeOf(next, rtl)[axis];
1087
+ const correction = (target[axis] - guess) / perPx;
1088
+ element.style.setProperty(property, `${-size + correction}px`);
1089
+ // Everything checked must land on both axes: a flex-row item that sets
1090
+ // its row's height frees no block space with an inline margin.
1091
+ const missed = checked.some((box, index) => {
1092
+ const landed = placeOf(box, rtl);
1093
+ return Math.abs(landed.block - targets[index].block) > 1 || Math.abs(landed.inline - targets[index].inline) > 1;
1094
+ });
1095
+ if (missed) {
1096
+ if (own === '') {
1097
+ element.style.removeProperty(property);
1098
+ } else {
1099
+ element.style.setProperty(property, own, ownPriority);
1100
+ }
1101
+ return false;
1102
+ }
1103
+ return true;
1104
+ }
1105
+
1106
+ /** Exits holding an element back, so a release can stop one. */
1107
+ const exits = new WeakMap();
1108
+
1109
+ /** What an exit replaced on its element, so a release puts back exactly it. */
1110
+
1111
+ const replaced = new WeakMap();
1112
+
1113
+ /**
1114
+ * The changed element's exit (`spec:AST-105` FR4): content that disappears
1115
+ * keeps its place on screen but gives up its space (a negative end margin
1116
+ * measured against the layout without it, so the content after it glides up
1117
+ * at once to exactly where it ends, and it still scrolls and clips with its
1118
+ * container), is inert (no focus, no pointer, nothing read), conceals upward
1119
+ * from its bottom edge on the same motion, and then `done` runs, when the
1120
+ * component hides or unmounts it. Under Reduce Motion with a coarse primary pointer it
1121
+ * fades instead. Call it in the layout effect of the commit that closes the
1122
+ * element, after the change's `animate()` reported it measured, in the same
1123
+ * task: the glide reads the layout once the element has given up its space.
1124
+ *
1125
+ * Returns false, holding nothing, when the exit lands at once: no handle, a
1126
+ * close no change in the area measured, outside the area or its visible part,
1127
+ * Reduce Motion with a fine pointer, or a layout no end margin can free (a
1128
+ * grid track and its gap, a flex-row item that sets its row's height); in
1129
+ * that last case the content after it takes its final place at once too.
1130
+ * The component then hides the element itself.
1131
+ */
1132
+ export function holdLayoutExit(handle, element, done) {
1133
+ if (handle == null) {
1134
+ return false;
1135
+ }
1136
+ const area = areaOf(handle, element);
1137
+ if (area == null || !intersects(element.getBoundingClientRect(), visibleRect(area))) {
1138
+ return false;
1139
+ }
1140
+ // Only a measured close exits: the content after it glides into its place.
1141
+ const batch = batches.get(area);
1142
+ if (batch == null || ![...batch.changed].some(changed => changed === element || changed.contains(element))) {
1143
+ return false;
1144
+ }
1145
+ const motion = layoutMotion(area);
1146
+ if (motion.kind === 'instant') {
1147
+ return false;
1148
+ }
1149
+ releaseLayoutExit(element);
1150
+ const prior = {
1151
+ inert: element.hasAttribute('inert'),
1152
+ styles: EXIT_PROPERTIES.map(property => [property, element.style.getPropertyValue(property), element.style.getPropertyPriority(property)])
1153
+ };
1154
+ if (!giveUpSpace(element, area)) {
1155
+ // A layout no end margin can free (a grid track and its gap, a flex-row
1156
+ // item that sets its row's height): it hides at once, and the content
1157
+ // after it takes its final place at once (`spec:AST-105` out of
1158
+ // coverage).
1159
+ for (const changed of [...batch.changed]) {
1160
+ if (changed === element || changed.contains(element)) {
1161
+ batch.changed.delete(changed);
1162
+ }
1163
+ }
1164
+ return false;
1165
+ }
1166
+ replaced.set(element, prior);
1167
+ // Out of reach while it conceals: no focus, no pointer, nothing read.
1168
+ element.setAttribute('inert', '');
1169
+ element.style.setProperty('pointer-events', 'none');
1170
+ const animation = motion.kind === 'fade' ? safeAnimate(element, [{
1171
+ opacity: 1
1172
+ }, {
1173
+ opacity: 0
1174
+ }], {
1175
+ duration: motion.durationMs,
1176
+ easing: motion.easing,
1177
+ fill: 'forwards'
1178
+ }) : safeAnimate(element, sampleKeyframes(motion.progress, remaining => ({
1179
+ opacity: remaining,
1180
+ clipPath: `inset(0 0 ${round((1 - remaining) * 100)}% 0)`
1181
+ })), {
1182
+ duration: motion.progress.durationMs,
1183
+ easing: 'linear',
1184
+ fill: 'forwards'
1185
+ });
1186
+ exits.set(element, animation);
1187
+ if (animation == null) {
1188
+ // No Web Animations: nothing to wait for.
1189
+ done();
1190
+ return true;
1191
+ }
1192
+ animation.addEventListener?.('finish', () => {
1193
+ if (exits.get(element) === animation) {
1194
+ done();
1195
+ }
1196
+ });
1197
+ return true;
1198
+ }
1199
+
1200
+ /**
1201
+ * Puts an element `holdLayoutExit` held back: stops its exit and puts back
1202
+ * what the exit replaced (its `inert` and inline values as they were). Called
1203
+ * once the component has hidden the element, or when the element opens again
1204
+ * mid-exit.
1205
+ */
1206
+ export function releaseLayoutExit(element) {
1207
+ if (!exits.has(element)) {
1208
+ return;
1209
+ }
1210
+ exits.get(element)?.cancel();
1211
+ exits.delete(element);
1212
+ const prior = replaced.get(element);
1213
+ replaced.delete(element);
1214
+ if (prior?.inert !== true) {
1215
+ element.removeAttribute('inert');
1216
+ }
1217
+ for (const [property, value, priority] of prior?.styles ?? []) {
1218
+ if (value === '') {
1219
+ element.style.removeProperty(property);
1220
+ } else {
1221
+ element.style.setProperty(property, value, priority);
1222
+ }
1223
+ }
1224
+ }
1225
+
1226
+ // ---------------------------------------------------------------------------
1227
+ // The in-place swap
1228
+ // ---------------------------------------------------------------------------
1229
+
1230
+ /**
1231
+ * Old content held as one transient copy while new content enters in its
1232
+ * place (`spec:AST-105` FR8): inert, hidden from assistive technology, and
1233
+ * removed when the swap ends (`architecture:component-style-authoring` INV7).
1234
+ */
1235
+
1236
+ /** How far a ridden element has moved since the swap began. */
1237
+
1238
+ /**
1239
+ * How a swap plays, as frames over its progress (0 → 1) and, with
1240
+ * `rideWith`, the ridden element's travel so far.
1241
+ */
1242
+
1243
+ const NO_RIDE = {
1244
+ x: 0,
1245
+ y: 0
1246
+ };
1247
+
1248
+ /**
1249
+ * Before a change commits: hold `element`'s old content as one transient copy
1250
+ * (`spec:AST-105` FR8). With `isVisiblePart`, the copy is the element's
1251
+ * visible part, its content scrolled as it was (a scroll container). Returns
1252
+ * null without a handle, outside its area, under an immediate change, or for
1253
+ * content too large to copy.
1254
+ */
1255
+ export function holdLayoutSwap(handle, element, {
1256
+ isVisiblePart = false
1257
+ } = {}) {
1258
+ if (handle == null || typeof element.animate !== 'function') {
1259
+ return null;
1260
+ }
1261
+ const area = areaOf(handle, element);
1262
+ if (area == null || layoutMotion(area).kind === 'instant' || !isCopyable(element)) {
1263
+ return null;
1264
+ }
1265
+ const box = element.getBoundingClientRect();
1266
+ if (!isVisiblePart) {
1267
+ const copy = inertCopy(element);
1268
+ return copy == null ? null : {
1269
+ area,
1270
+ copy,
1271
+ rect: box
1272
+ };
1273
+ }
1274
+ const part = visiblePartCopy(element);
1275
+ return part == null ? null : {
1276
+ area,
1277
+ ...part
1278
+ };
1279
+ }
1280
+
1281
+ /**
1282
+ * After the change commits, before paint: the copy leaves while the incoming
1283
+ * elements enter, on FR4's one motion, every part started on the same
1284
+ * timeline time. Under Reduce Motion with a coarse pointer, only opacity
1285
+ * changes (`design:reduced-motion` DR2). Returns what ends the swap at once;
1286
+ * it also ends when its motion does, and the copy is removed.
1287
+ */
1288
+ export function playLayoutSwap(swap, how) {
1289
+ const motion = layoutMotion(swap.area);
1290
+ if (motion.kind === 'instant') {
1291
+ return () => {};
1292
+ }
1293
+ const {
1294
+ copy
1295
+ } = swap;
1296
+ placeOver(copy, how.host, swap.rect);
1297
+ if (how.isOpaque === true) {
1298
+ copy.style.zIndex = '1';
1299
+ copy.style.backgroundColor = paintedBackground(copy);
1300
+ }
1301
+ const animations = [];
1302
+ let isDone = false;
1303
+ const end = () => {
1304
+ if (isDone) {
1305
+ return;
1306
+ }
1307
+ isDone = true;
1308
+ animations.forEach(animation => animation.cancel());
1309
+ copy.remove();
1310
+ how.onEnd?.();
1311
+ };
1312
+ const {
1313
+ copyText,
1314
+ rideWith
1315
+ } = how;
1316
+ const fadedText = copyText != null && motion.kind === 'spring' ? wrapText(copy) : [];
1317
+ // Each part as a function of time: its frame, or the copy's with its ride.
1318
+ const parts = [];
1319
+ if (motion.kind === 'spring') {
1320
+ const moves = rideWith != null && rideWith.isCopyMoved !== false;
1321
+ parts.push([copy, (p, ride) => ({
1322
+ ...how.copy(p, ride),
1323
+ ...(moves ? {
1324
+ translate: `${ride.x}px ${ride.y}px`
1325
+ } : null)
1326
+ })]);
1327
+ for (const span of fadedText) {
1328
+ parts.push([span, p => ({
1329
+ opacity: copyText?.(p) ?? 1
1330
+ })]);
1331
+ }
1332
+ for (const {
1333
+ element,
1334
+ frames
1335
+ } of how.incoming) {
1336
+ parts.push([element, frames]);
1337
+ }
1338
+ } else {
1339
+ // Reduce Motion with a coarse pointer: only opacity changes.
1340
+ parts.push([copy, p => ({
1341
+ opacity: 1 - p
1342
+ })]);
1343
+ for (const {
1344
+ element
1345
+ } of how.incoming) {
1346
+ parts.push([element, p => ({
1347
+ opacity: p
1348
+ })]);
1349
+ }
1350
+ }
1351
+ const playAll = (durationMs, progressAt, rideAt, options, sample) => {
1352
+ for (const [element, shape] of parts) {
1353
+ const animation = safeAnimate(element, sample(t => shape(progressAt(t), rideAt(t))), {
1354
+ duration: durationMs,
1355
+ fill: 'both',
1356
+ ...options
1357
+ });
1358
+ if (animation != null) {
1359
+ animations.push(animation);
1360
+ }
1361
+ }
1362
+ if (animations.length === 0) {
1363
+ end();
1364
+ } else {
1365
+ // Every part runs on one clock, so the first to finish ends them all.
1366
+ animations[0].addEventListener?.('finish', end);
1367
+ }
1368
+ };
1369
+ if (motion.kind === 'fade') {
1370
+ playAll(motion.durationMs, t => t <= 0 ? 0 : 1, () => NO_RIDE, {
1371
+ easing: motion.easing
1372
+ }, shape => [shape(0), shape(motion.durationMs)]);
1373
+ return end;
1374
+ }
1375
+ const {
1376
+ progress
1377
+ } = motion;
1378
+ const progressAt = t => 1 - progress.remaining(t);
1379
+ if (rideWith == null) {
1380
+ playAll(progress.durationMs, progressAt, () => NO_RIDE, {
1381
+ easing: 'linear'
1382
+ }, shape => sampleOver(progress.durationMs, shape));
1383
+ return end;
1384
+ }
1385
+ // After this commit's glides start (the batch flushes in a microtask queued
1386
+ // before this one), before the frame paints: every part plays over the
1387
+ // ridden element's glide, told how far it has moved from where it showed.
1388
+ queueMicrotask(() => {
1389
+ if (isDone) {
1390
+ return;
1391
+ }
1392
+ const glide = glides.get(rideWith.element);
1393
+ const durationMs = glide?.durationMs ?? progress.durationMs;
1394
+ const rideAt = t => {
1395
+ if (glide == null) {
1396
+ return {
1397
+ x: -rideWith.travel.x,
1398
+ y: -rideWith.travel.y
1399
+ };
1400
+ }
1401
+ const now = glide.offsetAt(t);
1402
+ const start = glide.offsetAt(0);
1403
+ return {
1404
+ x: now.x - start.x,
1405
+ y: now.y - start.y
1406
+ };
1407
+ };
1408
+ playAll(durationMs, progressAt, rideAt, {
1409
+ easing: 'linear'
1410
+ }, shape => sampleOver(durationMs, shape));
1411
+ });
1412
+ return end;
1413
+ }
1414
+
1415
+ /**
1416
+ * After a change commits, before paint: elements the page already renders
1417
+ * play frames over the change's progress on FR4's one motion, with no copy,
1418
+ * such as a surface reaching over a gap a glide opens. Under Reduce Motion
1419
+ * with a coarse pointer, only opacity changes; under an immediate change,
1420
+ * nothing plays. Returns what ends them at once.
1421
+ */
1422
+ export function playLayoutFrames(handle, parts) {
1423
+ const area = handle?.[AREA]() ?? null;
1424
+ const motion = area == null ? null : layoutMotion(area);
1425
+ if (motion == null || motion.kind === 'instant') {
1426
+ return () => {};
1427
+ }
1428
+ const animations = [];
1429
+ for (const {
1430
+ element,
1431
+ frames: shape
1432
+ } of parts) {
1433
+ const animation = motion.kind === 'spring' ? safeAnimate(element, sampleKeyframes(motion.progress, remaining => shape(1 - remaining, NO_RIDE)), {
1434
+ duration: motion.progress.durationMs,
1435
+ easing: 'linear',
1436
+ fill: 'both'
1437
+ }) : safeAnimate(element, [{
1438
+ opacity: 0
1439
+ }, {
1440
+ opacity: 1
1441
+ }], {
1442
+ duration: motion.durationMs,
1443
+ easing: motion.easing
1444
+ });
1445
+ if (animation != null) {
1446
+ animations.push(animation);
1447
+ }
1448
+ }
1449
+ // Held through the motion, then released: every part shares one clock, so
1450
+ // the first to finish ends them all and each element shows its own styles.
1451
+ const end = () => animations.forEach(animation => animation.cancel());
1452
+ animations[0]?.addEventListener?.('finish', end);
1453
+ return end;
1454
+ }
1455
+
1456
+ /**
1457
+ * A disclosure's indicator (its chevron) turns on the same motion as the
1458
+ * glide: its CSS transition takes the spring as a `linear()` easing, and an
1459
+ * immediate change under Reduce Motion. Without a handle the inline values are
1460
+ * cleared, so the component's own transition applies. An engine without
1461
+ * `linear()` drops that value and keeps the component's easing.
1462
+ */
1463
+ export function applyLayoutChangeTransition(handle, element) {
1464
+ if (element == null) {
1465
+ return;
1466
+ }
1467
+ const area = handle == null ? null : areaOf(handle, element);
1468
+ if (area == null) {
1469
+ element.style.removeProperty('transition-duration');
1470
+ element.style.removeProperty('transition-timing-function');
1471
+ return;
1472
+ }
1473
+ const motion = layoutMotion(area);
1474
+ if (motion.kind !== 'spring') {
1475
+ element.style.setProperty('transition-duration', '0s');
1476
+ element.style.removeProperty('transition-timing-function');
1477
+ return;
1478
+ }
1479
+ element.style.setProperty('transition-duration', `${Math.round(motion.progress.durationMs)}ms`);
1480
+ element.style.setProperty('transition-timing-function', linearEasing(motion.progress));
1481
+ }
1482
+
1483
+ /**
1484
+ * Lands `element`'s running glide at once: it takes its layout place, and a
1485
+ * later change starts from there (a change its caller lands rather than
1486
+ * animates, such as a rail that snaps).
1487
+ */
1488
+ export function landLayoutGlide(element) {
1489
+ const glide = glides.get(element);
1490
+ if (glide != null) {
1491
+ glides.delete(element);
1492
+ glide.animation.cancel();
1493
+ }
1494
+ }
1495
+
1496
+ /**
1497
+ * @internal The motion a change in `area` plays, for tests and for SideNav's
1498
+ * rail motion, which plays on the same clock (`component:SideNav` FR6).
1499
+ */
1500
+ export function layoutMotionFor(area) {
1501
+ return layoutMotion(area);
1502
+ }