@astryxdesign/core 0.7.11 → 0.7.12-canary.ccb4a6d

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 (533) hide show
  1. package/dist/AppShell/AppShellMobileContext.d.ts.map +1 -1
  2. package/dist/AppShell/AppShellMobileContext.js +4 -3
  3. package/dist/AppShell/useAppShellMainId.d.ts.map +1 -1
  4. package/dist/AppShell/useAppShellMainId.js +3 -2
  5. package/dist/Avatar/AvatarSizeContext.d.ts.map +1 -1
  6. package/dist/Avatar/AvatarSizeContext.js +2 -2
  7. package/dist/Avatar/AvatarStatusLabelContext.d.ts +2 -2
  8. package/dist/Avatar/AvatarStatusLabelContext.d.ts.map +1 -1
  9. package/dist/Avatar/AvatarStatusLabelContext.js +3 -3
  10. package/dist/AvatarGroup/AvatarGroupContext.d.ts.map +1 -1
  11. package/dist/AvatarGroup/AvatarGroupContext.js +2 -2
  12. package/dist/BottomSheet/BottomSheetHostContext.d.ts.map +1 -1
  13. package/dist/BottomSheet/BottomSheetHostContext.js +3 -2
  14. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  15. package/dist/BottomSheet/BottomSheetPanel.js +48 -4
  16. package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
  17. package/dist/BottomSheet/BottomSheetSwitcherContext.js +2 -2
  18. package/dist/BottomSheet/bottomSheetEscape.d.ts.map +1 -1
  19. package/dist/BottomSheet/bottomSheetEscape.js +2 -2
  20. package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
  21. package/dist/BottomSheet/bottomSheetStack.js +2 -13
  22. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  23. package/dist/BottomSheet/useSheetGestures.js +25 -42
  24. package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  25. package/dist/Breadcrumbs/Breadcrumbs.js +2 -2
  26. package/dist/Button/Button.d.ts.map +1 -1
  27. package/dist/Button/Button.js +12 -21
  28. package/dist/Button/buttonHitArea.d.ts.map +1 -1
  29. package/dist/Button/buttonHitArea.js +3 -3
  30. package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  31. package/dist/ButtonGroup/ButtonGroup.js +13 -7
  32. package/dist/ButtonGroup/ButtonGroupContext.d.ts.map +1 -1
  33. package/dist/ButtonGroup/ButtonGroupContext.js +2 -2
  34. package/dist/Carousel/Carousel.d.ts.map +1 -1
  35. package/dist/Carousel/Carousel.js +24 -15
  36. package/dist/Chat/ChatContext.d.ts.map +1 -1
  37. package/dist/Chat/ChatContext.js +6 -5
  38. package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
  39. package/dist/Chat/useChatStreamScroll.js +7 -22
  40. package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -1
  41. package/dist/CheckboxInput/CheckboxRowPressContext.js +1 -1
  42. package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
  43. package/dist/CheckboxList/CheckboxListContext.js +1 -1
  44. package/dist/Collapsible/CollapsibleGroupContext.d.ts.map +1 -1
  45. package/dist/Collapsible/CollapsibleGroupContext.js +3 -3
  46. package/dist/CommandPalette/CommandPaletteContext.d.ts.map +1 -1
  47. package/dist/CommandPalette/CommandPaletteContext.js +4 -3
  48. package/dist/CommandPalette/busyStartSettle.d.ts.map +1 -1
  49. package/dist/CommandPalette/busyStartSettle.js +2 -2
  50. package/dist/DateInput/TouchDateField.d.ts.map +1 -1
  51. package/dist/DateInput/TouchDateField.js +41 -4
  52. package/dist/Dialog/DialogContext.d.ts.map +1 -1
  53. package/dist/Dialog/DialogContext.js +3 -2
  54. package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
  55. package/dist/DropdownMenu/DropdownMenuContext.js +6 -5
  56. package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
  57. package/dist/DropdownMenu/lazyMenuBottomSheet.js +4 -15
  58. package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -1
  59. package/dist/DropdownMenu/menuRegionStops.js +2 -37
  60. package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
  61. package/dist/FormLayout/FormLayoutContext.js +2 -2
  62. package/dist/Heading/Heading.d.ts.map +1 -1
  63. package/dist/Heading/Heading.js +19 -16
  64. package/dist/HoverCard/HoverCard.d.ts +1 -2
  65. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  66. package/dist/HoverCard/useHoverCard.d.ts +1 -2
  67. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  68. package/dist/HoverCard/useHoverCard.js +5 -1
  69. package/dist/Icon/IconDefaultSizeContext.d.ts.map +1 -1
  70. package/dist/Icon/IconDefaultSizeContext.js +2 -2
  71. package/dist/InputGroup/InputGroupContext.d.ts.map +1 -1
  72. package/dist/InputGroup/InputGroupContext.js +2 -2
  73. package/dist/InputGroup/InputGroupInternalContext.d.ts.map +1 -1
  74. package/dist/InputGroup/InputGroupInternalContext.js +2 -2
  75. package/dist/InteractiveRoleContext/InteractiveRoleContext.d.ts.map +1 -1
  76. package/dist/InteractiveRoleContext/InteractiveRoleContext.js +5 -3
  77. package/dist/Item/ItemDescriptionContext.d.ts.map +1 -1
  78. package/dist/Item/ItemDescriptionContext.js +3 -3
  79. package/dist/Item/ItemListRowContext.d.ts.map +1 -1
  80. package/dist/Item/ItemListRowContext.js +3 -3
  81. package/dist/Item/ItemMarkerColumnsContext.d.ts +1 -1
  82. package/dist/Item/ItemMarkerColumnsContext.d.ts.map +1 -1
  83. package/dist/Item/ItemMarkerColumnsContext.js +2 -2
  84. package/dist/Layer/LayerContext.d.ts.map +1 -1
  85. package/dist/Layer/LayerContext.js +3 -2
  86. package/dist/Layer/LayerDepthContext.d.ts.map +1 -1
  87. package/dist/Layer/LayerDepthContext.js +3 -2
  88. package/dist/Layer/LayerTouch.d.ts +3 -2
  89. package/dist/Layer/LayerTouch.d.ts.map +1 -1
  90. package/dist/Layer/LayerTouch.js +3 -2
  91. package/dist/Layer/anchorName.d.ts.map +1 -1
  92. package/dist/Layer/anchorName.js +5 -1
  93. package/dist/Layer/inputHold.d.ts.map +1 -1
  94. package/dist/Layer/inputHold.js +115 -13
  95. package/dist/Layer/layerScopedContext.d.ts +5 -2
  96. package/dist/Layer/layerScopedContext.d.ts.map +1 -1
  97. package/dist/Layer/layerScopedContext.js +27 -10
  98. package/dist/Layer/layerSlideRules.d.ts +28 -26
  99. package/dist/Layer/layerSlideRules.d.ts.map +1 -1
  100. package/dist/Layer/layerSlideRules.js +41 -40
  101. package/dist/Layer/outsidePress.d.ts +21 -3
  102. package/dist/Layer/outsidePress.d.ts.map +1 -1
  103. package/dist/Layer/outsidePress.js +119 -29
  104. package/dist/Layer/settledBox.d.ts +9 -8
  105. package/dist/Layer/settledBox.d.ts.map +1 -1
  106. package/dist/Layer/settledBox.js +169 -49
  107. package/dist/Layer/toastHost.d.ts.map +1 -1
  108. package/dist/Layer/toastHost.js +3 -2
  109. package/dist/Layer/useLayer.d.ts.map +1 -1
  110. package/dist/Layer/useLayer.js +172 -60
  111. package/dist/Layer/useLayerKeyboardClearance.d.ts +14 -2
  112. package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -1
  113. package/dist/Layer/useLayerKeyboardClearance.js +83 -12
  114. package/dist/Layer/useTouchTrigger.d.ts +21 -1
  115. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  116. package/dist/Layer/useTouchTrigger.js +61 -37
  117. package/dist/Layout/Layout.d.ts +1 -1
  118. package/dist/Layout/Layout.d.ts.map +1 -1
  119. package/dist/Layout/Layout.js +10 -6
  120. package/dist/Layout/LayoutAreaContext.d.ts.map +1 -1
  121. package/dist/Layout/LayoutAreaContext.js +3 -3
  122. package/dist/Layout/LayoutContent.d.ts +6 -6
  123. package/dist/Layout/LayoutContent.js +9 -9
  124. package/dist/Layout/LayoutDividerContext.d.ts.map +1 -1
  125. package/dist/Layout/LayoutDividerContext.js +2 -2
  126. package/dist/Layout/LayoutSlotsContext.d.ts.map +1 -1
  127. package/dist/Layout/LayoutSlotsContext.js +2 -2
  128. package/dist/Link/LinkContext.d.ts +16 -0
  129. package/dist/Link/LinkContext.d.ts.map +1 -1
  130. package/dist/Link/LinkContext.js +3 -3
  131. package/dist/List/List.d.ts +12 -1
  132. package/dist/List/List.d.ts.map +1 -1
  133. package/dist/List/List.js +29 -10
  134. package/dist/List/ListContext.d.ts +18 -3
  135. package/dist/List/ListContext.d.ts.map +1 -1
  136. package/dist/List/ListContext.js +9 -6
  137. package/dist/List/ListItem.d.ts +13 -4
  138. package/dist/List/ListItem.d.ts.map +1 -1
  139. package/dist/List/ListItem.js +37 -10
  140. package/dist/List/listLayoutUpdates.d.ts +34 -0
  141. package/dist/List/listLayoutUpdates.d.ts.map +1 -0
  142. package/dist/List/listLayoutUpdates.js +539 -0
  143. package/dist/Markdown/Markdown.d.ts.map +1 -1
  144. package/dist/Markdown/Markdown.js +57 -10
  145. package/dist/Markdown/blockDirection.d.ts +26 -0
  146. package/dist/Markdown/blockDirection.d.ts.map +1 -0
  147. package/dist/Markdown/blockDirection.js +68 -0
  148. package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts +3 -1
  149. package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
  150. package/dist/Markdown/plugins/HeadingLinksRenderer.js +3 -1
  151. package/dist/MetadataList/MetadataListContext.d.ts.map +1 -1
  152. package/dist/MetadataList/MetadataListContext.js +2 -2
  153. package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
  154. package/dist/NavMenu/NavMenuContext.js +5 -4
  155. package/dist/Popover/Popover.d.ts.map +1 -1
  156. package/dist/Popover/Popover.js +9 -9
  157. package/dist/Popover/usePopover.d.ts.map +1 -1
  158. package/dist/Popover/usePopover.js +11 -8
  159. package/dist/RadioList/RadioList.d.ts.map +1 -1
  160. package/dist/RadioList/RadioList.js +2 -2
  161. package/dist/RadioList/RadioListReasonContext.d.ts.map +1 -1
  162. package/dist/RadioList/RadioListReasonContext.js +1 -1
  163. package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  164. package/dist/SegmentedControl/SegmentedControlContext.js +2 -2
  165. package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -1
  166. package/dist/SelectableCard/selectableCardInput.js +2 -2
  167. package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -1
  168. package/dist/Selector/SelectorRowLayoutContext.js +2 -2
  169. package/dist/SideNav/SideNavCollapseButton.d.ts +4 -3
  170. package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
  171. package/dist/SideNav/SideNavCollapseContext.d.ts.map +1 -1
  172. package/dist/SideNav/SideNavCollapseContext.js +4 -3
  173. package/dist/SideNav/SideNavFocusTargetsContext.d.ts.map +1 -1
  174. package/dist/SideNav/SideNavFocusTargetsContext.js +2 -2
  175. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  176. package/dist/SideNav/SideNavItem.js +3 -2
  177. package/dist/SideNav/SideNavRenderContext.d.ts.map +1 -1
  178. package/dist/SideNav/SideNavRenderContext.js +4 -3
  179. package/dist/SideNav/railMotion.d.ts +40 -0
  180. package/dist/SideNav/railMotion.d.ts.map +1 -1
  181. package/dist/SideNav/railMotion.js +2 -2
  182. package/dist/SizeContext/SizeContext.d.ts.map +1 -1
  183. package/dist/SizeContext/SizeContext.js +2 -2
  184. package/dist/SnapPaging/SnapPaging.d.ts.map +1 -1
  185. package/dist/SnapPaging/SnapPaging.js +162 -36
  186. package/dist/SnapPaging/snapPagingValue.d.ts +29 -3
  187. package/dist/SnapPaging/snapPagingValue.d.ts.map +1 -1
  188. package/dist/SnapPaging/snapPagingValue.js +38 -6
  189. package/dist/Spinner/SpinnerOwnerContext.d.ts.map +1 -1
  190. package/dist/Spinner/SpinnerOwnerContext.js +2 -2
  191. package/dist/Stepper/StepperContext.d.ts.map +1 -1
  192. package/dist/Stepper/StepperContext.js +3 -3
  193. package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
  194. package/dist/Switch/useSwitchTouch.js +8 -3
  195. package/dist/TabList/TabListContext.d.ts.map +1 -1
  196. package/dist/TabList/TabListContext.js +2 -2
  197. package/dist/Table/BaseTable.d.ts +3 -2
  198. package/dist/Table/BaseTable.d.ts.map +1 -1
  199. package/dist/Table/BaseTable.js +73 -16
  200. package/dist/Table/Table.d.ts.map +1 -1
  201. package/dist/Table/Table.js +3 -2
  202. package/dist/Table/TableContext.d.ts.map +1 -1
  203. package/dist/Table/TableContext.js +2 -2
  204. package/dist/Table/index.d.ts +1 -1
  205. package/dist/Table/index.d.ts.map +1 -1
  206. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  207. package/dist/Table/plugins/filtering/useTableFiltering.js +4 -3
  208. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  209. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +5 -3
  210. package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +16 -18
  211. package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
  212. package/dist/Table/plugins/rowIndex/useTableRowIndex.js +48 -39
  213. package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
  214. package/dist/Table/plugins/selection/useTableSelection.js +4 -2
  215. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
  216. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -0
  217. package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
  218. package/dist/Table/plugins/tree/useTableTreeData.js +3 -2
  219. package/dist/Table/tableRowContextUsage.d.ts +21 -0
  220. package/dist/Table/tableRowContextUsage.d.ts.map +1 -0
  221. package/dist/Table/tableRowContextUsage.js +88 -0
  222. package/dist/Table/types.d.ts +58 -5
  223. package/dist/Table/types.d.ts.map +1 -1
  224. package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
  225. package/dist/Table/useBaseTablePlugins.js +5 -2
  226. package/dist/Text/Text.d.ts.map +1 -1
  227. package/dist/Text/Text.js +18 -14
  228. package/dist/Text/TruncationTooltip.d.ts +45 -0
  229. package/dist/Text/TruncationTooltip.d.ts.map +1 -0
  230. package/dist/Text/TruncationTooltip.js +123 -0
  231. package/dist/Text/textClampContext.d.ts.map +1 -1
  232. package/dist/Text/textClampContext.js +1 -1
  233. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  234. package/dist/TimeInput/TimeInput.js +4 -0
  235. package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
  236. package/dist/ToggleButton/ToggleButtonGroup.js +2 -2
  237. package/dist/Token/TokenNamingContext.d.ts.map +1 -1
  238. package/dist/Token/TokenNamingContext.js +2 -2
  239. package/dist/Tokenizer/TokenizerClearAllMessageContext.d.ts.map +1 -1
  240. package/dist/Tokenizer/TokenizerClearAllMessageContext.js +2 -2
  241. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +12 -0
  242. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -1
  243. package/dist/Tokenizer/TokenizerItemRemovableContext.js +2 -2
  244. package/dist/Toolbar/Toolbar.d.ts.map +1 -1
  245. package/dist/Toolbar/Toolbar.js +12 -6
  246. package/dist/Tooltip/tooltipPresentInterest.d.ts +29 -0
  247. package/dist/Tooltip/tooltipPresentInterest.d.ts.map +1 -0
  248. package/dist/Tooltip/tooltipPresentInterest.js +29 -0
  249. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  250. package/dist/Tooltip/useTooltip.js +30 -4
  251. package/dist/TopNav/TopNavContext.d.ts.map +1 -1
  252. package/dist/TopNav/TopNavContext.js +2 -2
  253. package/dist/TopNav/TopNavMobileContentContext.d.ts +1 -1
  254. package/dist/TopNav/TopNavMobileContentContext.d.ts.map +1 -1
  255. package/dist/TopNav/TopNavMobileContentContext.js +4 -3
  256. package/dist/TopNav/TopNavRenderContext.d.ts.map +1 -1
  257. package/dist/TopNav/TopNavRenderContext.js +4 -3
  258. package/dist/Typeahead/busyIndicatorLane.d.ts.map +1 -1
  259. package/dist/Typeahead/busyIndicatorLane.js +3 -2
  260. package/dist/Typeahead/committedChoicesKey.d.ts.map +1 -1
  261. package/dist/Typeahead/committedChoicesKey.js +3 -2
  262. package/dist/Typeahead/trailingKeyDown.d.ts.map +1 -1
  263. package/dist/Typeahead/trailingKeyDown.js +3 -2
  264. package/dist/astryx.css +18 -8
  265. package/dist/gestures/GestureArena.d.ts +2 -0
  266. package/dist/gestures/GestureArena.d.ts.map +1 -1
  267. package/dist/gestures/GestureArena.js +8 -1
  268. package/dist/gestures/GestureRecognizer.d.ts +6 -0
  269. package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
  270. package/dist/gestures/GestureRecognizer.js +9 -0
  271. package/dist/gestures/PressTracker.d.ts.map +1 -1
  272. package/dist/gestures/PressTracker.js +9 -4
  273. package/dist/hooks/focusableSelector.d.ts +13 -1
  274. package/dist/hooks/focusableSelector.d.ts.map +1 -1
  275. package/dist/hooks/focusableSelector.js +22 -2
  276. package/dist/hooks/longPressDetector.d.ts.map +1 -1
  277. package/dist/hooks/longPressDetector.js +1 -25
  278. package/dist/hooks/pressGroupContext.d.ts.map +1 -1
  279. package/dist/hooks/pressGroupContext.js +1 -1
  280. package/dist/hooks/useActionGroupTracking.d.ts +18 -1
  281. package/dist/hooks/useActionGroupTracking.d.ts.map +1 -1
  282. package/dist/hooks/useActionGroupTracking.js +13 -2
  283. package/dist/hooks/useAnnounce.d.ts.map +1 -1
  284. package/dist/hooks/useAnnounce.js +3 -2
  285. package/dist/hooks/useFocusTrap.d.ts +11 -0
  286. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  287. package/dist/hooks/useFocusTrap.js +47 -2
  288. package/dist/hooks/useListFocus.d.ts +7 -0
  289. package/dist/hooks/useListFocus.d.ts.map +1 -1
  290. package/dist/hooks/useListFocus.js +20 -3
  291. package/dist/hooks/usePager.d.ts.map +1 -1
  292. package/dist/hooks/usePager.js +26 -3
  293. package/dist/hooks/useScrollOverflow.d.ts +22 -0
  294. package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
  295. package/dist/hooks/useScrollOverflow.js +67 -11
  296. package/dist/i18n/InternationalizationContext.d.ts +19 -0
  297. package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
  298. package/dist/i18n/InternationalizationContext.js +3 -3
  299. package/dist/i18n/englishFallback.d.ts.map +1 -1
  300. package/dist/i18n/englishFallback.js +5 -1
  301. package/dist/i18n/firstStrongDirection.d.ts +7 -0
  302. package/dist/i18n/firstStrongDirection.d.ts.map +1 -0
  303. package/dist/i18n/firstStrongDirection.js +65 -0
  304. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  305. package/dist/i18n/generated-locales/en.generated.js +1 -0
  306. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  307. package/dist/i18n/generated-locales/pseudo.generated.js +1 -0
  308. package/dist/internal/scroll-anchoring.d.ts +16 -0
  309. package/dist/internal/scroll-anchoring.d.ts.map +1 -0
  310. package/dist/internal/scroll-anchoring.js +16 -0
  311. package/dist/internal/touch.d.ts +2 -0
  312. package/dist/internal/touch.d.ts.map +1 -1
  313. package/dist/internal/touch.js +4 -1
  314. package/dist/motion/animatedLayout.d.ts +8 -0
  315. package/dist/motion/animatedLayout.d.ts.map +1 -1
  316. package/dist/motion/animatedLayout.js +51 -3
  317. package/dist/motion/animator.d.ts +19 -2
  318. package/dist/motion/animator.d.ts.map +1 -1
  319. package/dist/motion/animator.js +72 -7
  320. package/dist/privateAttributes/itemKey.stylex.d.ts +5 -0
  321. package/dist/privateAttributes/itemKey.stylex.d.ts.map +1 -0
  322. package/dist/privateAttributes/itemKey.stylex.js +25 -0
  323. package/dist/privateAttributes/leaving.stylex.d.ts +5 -0
  324. package/dist/privateAttributes/leaving.stylex.d.ts.map +1 -0
  325. package/dist/privateAttributes/leaving.stylex.js +23 -0
  326. package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
  327. package/dist/privateAttributes/press.stylex.js +13 -3
  328. package/dist/privateAttributes/scrollAnchoring.stylex.d.ts +7 -0
  329. package/dist/privateAttributes/scrollAnchoring.stylex.d.ts.map +1 -0
  330. package/dist/privateAttributes/scrollAnchoring.stylex.js +50 -0
  331. package/dist/privateAttributes/travelling.stylex.d.ts +27 -0
  332. package/dist/privateAttributes/travelling.stylex.d.ts.map +1 -0
  333. package/dist/privateAttributes/travelling.stylex.js +51 -0
  334. package/dist/theme/Theme.d.ts.map +1 -1
  335. package/dist/theme/Theme.js +95 -49
  336. package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
  337. package/dist/theme/syntax/SyntaxTheme.js +3 -2
  338. package/dist/theme/useTheme.d.ts.map +1 -1
  339. package/dist/theme/useTheme.js +3 -2
  340. package/dist/utils/calendarSystem.d.ts.map +1 -1
  341. package/dist/utils/calendarSystem.js +4 -1
  342. package/dist/utils/flatTree.d.ts +13 -0
  343. package/dist/utils/flatTree.d.ts.map +1 -1
  344. package/dist/utils/flatTree.js +28 -4
  345. package/dist/utils/inputAge.d.ts +22 -0
  346. package/dist/utils/inputAge.d.ts.map +1 -0
  347. package/dist/utils/inputAge.js +54 -0
  348. package/dist/utils/inputStream.d.ts +8 -0
  349. package/dist/utils/inputStream.d.ts.map +1 -1
  350. package/dist/utils/inputStream.js +53 -3
  351. package/dist/utils/moduleLoader.d.ts +23 -0
  352. package/dist/utils/moduleLoader.d.ts.map +1 -0
  353. package/dist/utils/moduleLoader.js +31 -0
  354. package/dist/utils/pressFeedback.d.ts.map +1 -1
  355. package/dist/utils/pressFeedback.js +13 -8
  356. package/dist/utils/selectionLock.d.ts.map +1 -1
  357. package/dist/utils/selectionLock.js +7 -14
  358. package/dist/utils/sharedContext.d.ts +18 -0
  359. package/dist/utils/sharedContext.d.ts.map +1 -0
  360. package/dist/utils/sharedContext.js +33 -0
  361. package/dist/utils/sharedRealm.d.ts +24 -0
  362. package/dist/utils/sharedRealm.d.ts.map +1 -0
  363. package/dist/utils/sharedRealm.js +38 -0
  364. package/locales/en.json +4 -0
  365. package/locales/pseudo.json +3 -0
  366. package/package.json +10 -5
  367. package/src/AppShell/AppShellMobileContext.tsx +8 -3
  368. package/src/AppShell/useAppShellMainId.ts +7 -2
  369. package/src/Avatar/AvatarSizeContext.ts +6 -2
  370. package/src/Avatar/AvatarStatusLabelContext.ts +8 -3
  371. package/src/AvatarGroup/AvatarGroupContext.ts +7 -4
  372. package/src/BottomSheet/BottomSheetHostContext.ts +7 -3
  373. package/src/BottomSheet/BottomSheetPanel.tsx +56 -7
  374. package/src/BottomSheet/BottomSheetSwitcherContext.ts +7 -2
  375. package/src/BottomSheet/bottomSheetEscape.ts +6 -2
  376. package/src/BottomSheet/bottomSheetStack.ts +6 -14
  377. package/src/BottomSheet/useSheetGestures.ts +28 -48
  378. package/src/Breadcrumbs/Breadcrumbs.tsx +6 -5
  379. package/src/Button/Button.doc.mjs +3 -3
  380. package/src/Button/Button.tsx +10 -22
  381. package/src/Button/buttonHitArea.ts +7 -4
  382. package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -3
  383. package/src/ButtonGroup/ButtonGroup.tsx +27 -16
  384. package/src/ButtonGroup/ButtonGroupContext.ts +7 -4
  385. package/src/Carousel/Carousel.tsx +33 -15
  386. package/src/Chat/ChatContext.tsx +23 -7
  387. package/src/Chat/useChatStreamScroll.ts +7 -26
  388. package/src/CheckboxInput/CheckboxRowPressContext.ts +5 -1
  389. package/src/CheckboxList/CheckboxListContext.tsx +5 -1
  390. package/src/Collapsible/CollapsibleGroupContext.tsx +11 -3
  391. package/src/CommandPalette/CommandPaletteContext.ts +8 -3
  392. package/src/CommandPalette/busyStartSettle.ts +6 -2
  393. package/src/DateInput/TouchDateField.tsx +62 -4
  394. package/src/Dialog/DialogContext.ts +7 -2
  395. package/src/DropdownMenu/DropdownMenuContext.tsx +18 -5
  396. package/src/DropdownMenu/lazyMenuBottomSheet.ts +6 -18
  397. package/src/DropdownMenu/menuRegionStops.ts +1 -49
  398. package/src/FormLayout/FormLayoutContext.ts +3 -3
  399. package/src/Heading/Heading.tsx +34 -18
  400. package/src/HoverCard/HoverCard.doc.mjs +3 -3
  401. package/src/HoverCard/HoverCard.tsx +1 -2
  402. package/src/HoverCard/useHoverCard.tsx +6 -2
  403. package/src/Icon/IconDefaultSizeContext.ts +6 -2
  404. package/src/IconButton/IconButton.doc.mjs +2 -2
  405. package/src/InputGroup/InputGroupContext.ts +7 -4
  406. package/src/InputGroup/InputGroupInternalContext.ts +6 -2
  407. package/src/InteractiveRoleContext/InteractiveRoleContext.ts +8 -3
  408. package/src/Item/ItemDescriptionContext.tsx +7 -3
  409. package/src/Item/ItemListRowContext.tsx +7 -3
  410. package/src/Item/ItemMarkerColumnsContext.tsx +7 -2
  411. package/src/Layer/LayerContext.ts +7 -2
  412. package/src/Layer/LayerDepthContext.tsx +3 -2
  413. package/src/Layer/LayerTouch.ts +6 -2
  414. package/src/Layer/anchorName.ts +8 -4
  415. package/src/Layer/inputHold.ts +138 -21
  416. package/src/Layer/layerScopedContext.tsx +34 -7
  417. package/src/Layer/layerSlideRules.ts +43 -40
  418. package/src/Layer/outsidePress.ts +144 -28
  419. package/src/Layer/settledBox.ts +216 -54
  420. package/src/Layer/toastHost.tsx +6 -2
  421. package/src/Layer/useLayer.tsx +200 -69
  422. package/src/Layer/useLayerKeyboardClearance.ts +90 -12
  423. package/src/Layer/useTouchTrigger.ts +89 -40
  424. package/src/Layout/Layout.doc.mjs +17 -0
  425. package/src/Layout/Layout.tsx +13 -9
  426. package/src/Layout/LayoutAreaContext.ts +8 -9
  427. package/src/Layout/LayoutContent.doc.mjs +11 -0
  428. package/src/Layout/LayoutContent.tsx +9 -9
  429. package/src/Layout/LayoutDividerContext.ts +6 -2
  430. package/src/Layout/LayoutSlotsContext.ts +6 -3
  431. package/src/Link/LinkContext.ts +7 -3
  432. package/src/List/List.doc.mjs +5 -0
  433. package/src/List/List.tsx +53 -5
  434. package/src/List/ListContext.tsx +28 -6
  435. package/src/List/ListItem.doc.mjs +11 -0
  436. package/src/List/ListItem.tsx +51 -14
  437. package/src/List/listLayoutUpdates.ts +603 -0
  438. package/src/Markdown/Markdown.tsx +93 -5
  439. package/src/Markdown/blockDirection.ts +100 -0
  440. package/src/Markdown/plugins/HeadingLinksRenderer.tsx +4 -0
  441. package/src/MetadataList/MetadataListContext.tsx +6 -2
  442. package/src/NavMenu/NavMenuContext.tsx +14 -5
  443. package/src/Popover/Popover.tsx +23 -16
  444. package/src/Popover/usePopover.tsx +21 -7
  445. package/src/RadioList/RadioList.tsx +7 -4
  446. package/src/RadioList/RadioListReasonContext.ts +1 -1
  447. package/src/Section/Section.doc.mjs +22 -0
  448. package/src/SegmentedControl/SegmentedControlContext.ts +6 -2
  449. package/src/SelectableCard/selectableCardInput.ts +6 -2
  450. package/src/Selector/SelectorRowLayoutContext.ts +6 -2
  451. package/src/SideNav/SideNavCollapseButton.doc.mjs +5 -5
  452. package/src/SideNav/SideNavCollapseButton.tsx +4 -3
  453. package/src/SideNav/SideNavCollapseContext.ts +12 -7
  454. package/src/SideNav/SideNavFocusTargetsContext.ts +6 -2
  455. package/src/SideNav/SideNavItem.tsx +6 -2
  456. package/src/SideNav/SideNavRenderContext.ts +9 -8
  457. package/src/SideNav/railMotion.ts +6 -2
  458. package/src/SizeContext/SizeContext.ts +6 -2
  459. package/src/SnapPaging/SnapPaging.ts +164 -39
  460. package/src/SnapPaging/snapPagingValue.ts +59 -12
  461. package/src/Spinner/SpinnerOwnerContext.ts +6 -2
  462. package/src/Stepper/StepperContext.ts +12 -3
  463. package/src/Switch/useSwitchTouch.ts +7 -5
  464. package/src/TabList/TabListContext.ts +7 -2
  465. package/src/Table/BaseTable.tsx +143 -19
  466. package/src/Table/Table.tsx +4 -3
  467. package/src/Table/TableContext.ts +6 -2
  468. package/src/Table/index.ts +2 -0
  469. package/src/Table/plugins/filtering/useTableFiltering.tsx +11 -3
  470. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +10 -3
  471. package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +38 -29
  472. package/src/Table/plugins/selection/useTableSelection.tsx +7 -2
  473. package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -0
  474. package/src/Table/plugins/tree/useTableTreeData.tsx +6 -2
  475. package/src/Table/tableRowContextUsage.ts +105 -0
  476. package/src/Table/types.ts +60 -2
  477. package/src/Table/useBaseTablePlugins.ts +5 -2
  478. package/src/Table/useTableRowIndex.doc.mjs +6 -7
  479. package/src/Text/Text.tsx +34 -18
  480. package/src/Text/TruncationTooltip.tsx +179 -0
  481. package/src/Text/textClampContext.ts +5 -1
  482. package/src/TimeInput/TimeInput.tsx +4 -0
  483. package/src/ToggleButton/ToggleButtonGroup.tsx +6 -2
  484. package/src/Token/TokenNamingContext.ts +6 -2
  485. package/src/Tokenizer/TokenizerClearAllMessageContext.ts +4 -4
  486. package/src/Tokenizer/TokenizerItemRemovableContext.ts +3 -3
  487. package/src/Toolbar/Toolbar.tsx +16 -9
  488. package/src/Tooltip/tooltipPresentInterest.ts +43 -0
  489. package/src/Tooltip/useTooltip.tsx +33 -0
  490. package/src/TopNav/TopNavContext.ts +6 -2
  491. package/src/TopNav/TopNavMobileContentContext.ts +8 -3
  492. package/src/TopNav/TopNavRenderContext.ts +8 -4
  493. package/src/Typeahead/busyIndicatorLane.tsx +7 -2
  494. package/src/Typeahead/committedChoicesKey.tsx +4 -3
  495. package/src/Typeahead/trailingKeyDown.tsx +7 -2
  496. package/src/gestures/GestureArena.ts +8 -1
  497. package/src/gestures/GestureRecognizer.ts +9 -0
  498. package/src/gestures/PressTracker.ts +13 -4
  499. package/src/hooks/focusableSelector.ts +29 -1
  500. package/src/hooks/longPressDetector.ts +1 -35
  501. package/src/hooks/pressGroupContext.ts +5 -1
  502. package/src/hooks/useActionGroupTracking.ts +29 -2
  503. package/src/hooks/useAnnounce.ts +8 -4
  504. package/src/hooks/useFocusTrap.ts +62 -2
  505. package/src/hooks/useListFocus.ts +34 -7
  506. package/src/hooks/usePager.ts +30 -3
  507. package/src/hooks/useScrollOverflow.ts +65 -7
  508. package/src/i18n/InternationalizationContext.ts +12 -8
  509. package/src/i18n/englishFallback.ts +7 -1
  510. package/src/i18n/firstStrongDirection.ts +69 -0
  511. package/src/i18n/generated-locales/en.generated.ts +1 -0
  512. package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
  513. package/src/internal/scroll-anchoring.ts +16 -0
  514. package/src/internal/touch.ts +4 -0
  515. package/src/motion/animatedLayout.ts +44 -3
  516. package/src/motion/animator.ts +97 -9
  517. package/src/privateAttributes/itemKey.stylex.ts +25 -0
  518. package/src/privateAttributes/leaving.stylex.ts +23 -0
  519. package/src/privateAttributes/press.stylex.ts +19 -7
  520. package/src/privateAttributes/scrollAnchoring.stylex.ts +50 -0
  521. package/src/privateAttributes/travelling.stylex.ts +88 -0
  522. package/src/theme/Theme.tsx +124 -60
  523. package/src/theme/syntax/SyntaxTheme.tsx +7 -2
  524. package/src/theme/useTheme.ts +7 -8
  525. package/src/utils/calendarSystem.ts +7 -1
  526. package/src/utils/flatTree.ts +31 -4
  527. package/src/utils/inputAge.ts +66 -0
  528. package/src/utils/inputStream.ts +52 -3
  529. package/src/utils/moduleLoader.ts +47 -0
  530. package/src/utils/pressFeedback.ts +16 -7
  531. package/src/utils/selectionLock.ts +8 -18
  532. package/src/utils/sharedContext.ts +42 -0
  533. package/src/utils/sharedRealm.ts +42 -0
@@ -0,0 +1,179 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file TruncationTooltip.tsx
7
+ * @input A truncated element's ref, its full text and the tooltip placement
8
+ * @output Exports `useTruncationTooltipInterest`, which loads the Tooltip
9
+ * module once text is truncated and tracks the first hover, tap or focus on
10
+ * it, and `TruncationTooltip`, the Tooltip that mounts on that interaction
11
+ * @position Shared by Text and Heading. Until the first interaction a page of
12
+ * truncated text mounts no tooltip layers, and the tooltip that then mounts
13
+ * answers that interaction as it would once mounted.
14
+ */
15
+
16
+ import {
17
+ useCallback,
18
+ useEffect,
19
+ useRef,
20
+ useState,
21
+ type FocusEvent,
22
+ type PointerEvent,
23
+ type ReactNode,
24
+ type RefObject,
25
+ } from 'react';
26
+ import type {LayerPlacement} from '../Layer';
27
+ import {createModuleLoader} from '../utils/moduleLoader';
28
+ import type {Tooltip as TooltipType} from '../Tooltip/Tooltip';
29
+ import {useTapRecognizer} from '../Layer/useTouchTrigger';
30
+ import {
31
+ TooltipPresentInterestContext,
32
+ type TooltipPresentInterestState,
33
+ } from '../Tooltip/tooltipPresentInterest';
34
+
35
+ type TooltipComponent = typeof TooltipType;
36
+
37
+ // The Tooltip module. Once loaded, a tooltip renders from it at once: no
38
+ // boundary suspends, so the first hover's delay starts on the hover.
39
+ const tooltipModule = createModuleLoader(
40
+ async () => import('../Tooltip/Tooltip'),
41
+ );
42
+
43
+ export interface TruncationTooltipInterest {
44
+ /** Whether a hover, tap or focus has reached the element. It stays true. */
45
+ readonly isWanted: boolean;
46
+ /** The Tooltip component, once its module has loaded. */
47
+ readonly tooltip: TooltipComponent | null;
48
+ /** The interaction that mounted the tooltip, until the tooltip reads it. */
49
+ readonly interestRef: RefObject<TooltipPresentInterestState>;
50
+ readonly onPointerEnter: (event: PointerEvent<HTMLElement>) => void;
51
+ readonly onPointerLeave: (event: PointerEvent<HTMLElement>) => void;
52
+ readonly onPointerDown: (event: PointerEvent<HTMLElement>) => void;
53
+ readonly onFocus: (event: FocusEvent<HTMLElement>) => void;
54
+ readonly onBlur: (event: FocusEvent<HTMLElement>) => void;
55
+ }
56
+
57
+ /**
58
+ * Tracks the interaction that mounts a truncated element's tooltip, while
59
+ * `isEnabled`, until the mounted tooltip reads it. A finger's arrival does not
60
+ * count: only a press that the touch trigger's recognizer takes for a tap
61
+ * does. Once the tooltip has read the interaction, its own listeners take
62
+ * over.
63
+ */
64
+ export function useTruncationTooltipInterest(
65
+ isEnabled: boolean,
66
+ ): TruncationTooltipInterest {
67
+ const [isWanted, setIsWanted] = useState(false);
68
+ const [tooltip, setTooltip] = useState<TooltipComponent | null>(
69
+ () => tooltipModule.loaded()?.Tooltip ?? null,
70
+ );
71
+ // Syncs with the module loader: truncated text loads the Tooltip module, so
72
+ // the first interaction mounts the tooltip at once.
73
+ useEffect(() => {
74
+ if (!isEnabled || tooltip != null) {
75
+ return;
76
+ }
77
+ let isCurrent = true;
78
+ tooltipModule.load().then(
79
+ loaded => {
80
+ if (isCurrent) {
81
+ setTooltip(() => loaded.Tooltip);
82
+ }
83
+ },
84
+ () => {},
85
+ );
86
+ return () => {
87
+ isCurrent = false;
88
+ };
89
+ }, [isEnabled, tooltip]);
90
+ const interestRef = useRef<TooltipPresentInterestState>({
91
+ interest: null,
92
+ tapEvent: null,
93
+ isRead: false,
94
+ });
95
+ const tapRecognizer = useTapRecognizer();
96
+ const want = useCallback(
97
+ (interest: 'hover' | 'tap' | 'focus', tapEvent: Event | null = null) => {
98
+ const state = interestRef.current;
99
+ if (!isEnabled || state.isRead) {
100
+ return;
101
+ }
102
+ state.interest = interest;
103
+ state.tapEvent = tapEvent;
104
+ setIsWanted(true);
105
+ },
106
+ [isEnabled],
107
+ );
108
+ const forget = useCallback((interest: 'hover' | 'focus') => {
109
+ const state = interestRef.current;
110
+ if (!state.isRead && state.interest === interest) {
111
+ state.interest = null;
112
+ }
113
+ }, []);
114
+ const onPointerEnter = useCallback(
115
+ (event: PointerEvent<HTMLElement>) => {
116
+ if (event.pointerType !== 'touch') {
117
+ want('hover');
118
+ }
119
+ },
120
+ [want],
121
+ );
122
+ const onPointerLeave = useCallback(() => forget('hover'), [forget]);
123
+ const onPointerDown = useCallback(
124
+ (event: PointerEvent<HTMLElement>) => {
125
+ if (!isEnabled || interestRef.current.isRead) {
126
+ tapRecognizer.forget();
127
+ return;
128
+ }
129
+ const isTouch = tapRecognizer.press(
130
+ event.nativeEvent,
131
+ event.currentTarget,
132
+ tapEvent => want('tap', tapEvent),
133
+ );
134
+ // A mouse press cancels a hover show, as a mounted tooltip does. A pen
135
+ // press waits for its tap.
136
+ if (!isTouch) {
137
+ forget('hover');
138
+ }
139
+ },
140
+ [isEnabled, tapRecognizer, want, forget],
141
+ );
142
+ const onFocus = useCallback(() => want('focus'), [want]);
143
+ const onBlur = useCallback(() => forget('focus'), [forget]);
144
+ return {
145
+ isWanted,
146
+ tooltip,
147
+ interestRef,
148
+ onPointerEnter,
149
+ onPointerLeave,
150
+ onPointerDown,
151
+ onFocus,
152
+ onBlur,
153
+ };
154
+ }
155
+
156
+ /** The truncated element's Tooltip, given the interaction that mounted it. */
157
+ export function TruncationTooltip({
158
+ anchorRef,
159
+ content,
160
+ placement,
161
+ interest,
162
+ }: {
163
+ anchorRef: RefObject<HTMLElement | null>;
164
+ content: ReactNode;
165
+ placement: LayerPlacement;
166
+ interest: TruncationTooltipInterest;
167
+ }): ReactNode {
168
+ // A first interaction before the module loads mounts the tooltip once it
169
+ // has: the interaction is held until the tooltip reads it.
170
+ const Tooltip = interest.tooltip;
171
+ if (Tooltip == null) {
172
+ return null;
173
+ }
174
+ return (
175
+ <TooltipPresentInterestContext value={interest.interestRef}>
176
+ <Tooltip anchorRef={anchorRef} content={content} placement={placement} />
177
+ </TooltipPresentInterestContext>
178
+ );
179
+ }
@@ -14,4 +14,8 @@
14
14
 
15
15
  import {createLayerScopedContext} from '../Layer/layerScopedContext';
16
16
 
17
- export const TextClampContext = createLayerScopedContext(false);
17
+ export const TextClampContext = createLayerScopedContext(
18
+ 'TextClampContext',
19
+ 1,
20
+ false,
21
+ );
@@ -711,6 +711,10 @@ function TimeField({
711
711
 
712
712
  // Check if within range
713
713
  if (isTimeInRange(newTime, min, max)) {
714
+ // The step is the committed value now: drop any typed draft so the
715
+ // box shows the stepped time and blur cannot re-commit stale text
716
+ // over it.
717
+ setPendingInput(null);
714
718
  fireChange(newTime);
715
719
  // Stepping programmatically rewrites a plain textbox's value, and
716
720
  // screen readers do not announce programmatic textbox changes — the
@@ -19,7 +19,7 @@
19
19
  */
20
20
 
21
21
  import {useCallback, use, useMemo, type ReactNode} from 'react';
22
- import {createLayerScopedContext as createContext} from '../Layer/layerScopedContext';
22
+ import {createLayerScopedContext} from '../Layer/layerScopedContext';
23
23
  import * as stylex from '@stylexjs/stylex';
24
24
  import {spacingVars} from '../theme/tokens.stylex';
25
25
  import type {ButtonSize} from '../Button';
@@ -44,7 +44,11 @@ interface ToggleButtonGroupContextValue {
44
44
  }
45
45
 
46
46
  const ToggleButtonGroupContext =
47
- createContext<ToggleButtonGroupContextValue | null>(null);
47
+ createLayerScopedContext<ToggleButtonGroupContextValue | null>(
48
+ 'ToggleButtonGroupContext',
49
+ 1,
50
+ null,
51
+ );
48
52
  ToggleButtonGroupContext.displayName = 'ToggleButtonGroupContext';
49
53
 
50
54
  /**
@@ -9,7 +9,7 @@
9
9
  * @position Internal to Core; not exported from the Token entry point
10
10
  */
11
11
 
12
- import {createContext} from 'react';
12
+ import {createSharedContext} from '../utils/sharedContext';
13
13
 
14
14
  /**
15
15
  * Names for a Token whose visible text runs past its label. PowerSearch
@@ -24,5 +24,9 @@ export interface TokenNaming {
24
24
  removeName?: string;
25
25
  }
26
26
 
27
- export const TokenNamingContext = createContext<TokenNaming | null>(null);
27
+ export const TokenNamingContext = createSharedContext<TokenNaming | null>(
28
+ 'TokenNamingContext',
29
+ 1,
30
+ null,
31
+ );
28
32
  TokenNamingContext.displayName = 'TokenNamingContext';
@@ -13,9 +13,9 @@
13
13
  * words (component:Tokenizer AR7).
14
14
  */
15
15
 
16
- import {createContext} from 'react';
16
+ import {createSharedContext} from '../utils/sharedContext';
17
17
 
18
- export const TokenizerClearAllMessageContext = createContext<string | null>(
19
- null,
20
- );
18
+ export const TokenizerClearAllMessageContext = createSharedContext<
19
+ string | null
20
+ >('TokenizerClearAllMessageContext', 1, null);
21
21
  TokenizerClearAllMessageContext.displayName = 'TokenizerClearAllMessageContext';
@@ -15,10 +15,10 @@
15
15
  * while a removable token remains. Without it, every token is removable.
16
16
  */
17
17
 
18
- import {createContext} from 'react';
19
18
  import type {SearchableItem} from '../Typeahead/types';
19
+ import {createSharedContext} from '../utils/sharedContext';
20
20
 
21
- export const TokenizerItemRemovableContext = createContext<
21
+ export const TokenizerItemRemovableContext = createSharedContext<
22
22
  ((item: SearchableItem) => boolean) | null
23
- >(null);
23
+ >('TokenizerItemRemovableContext', 1, null);
24
24
  TokenizerItemRemovableContext.displayName = 'TokenizerItemRemovableContext';
@@ -26,7 +26,7 @@ import * as stylex from '@stylexjs/stylex';
26
26
  import {spacingVars, sizeVars} from '../theme/tokens.stylex';
27
27
  import {mergeProps} from '../utils';
28
28
  import {Section} from '../Section/Section';
29
- import {useListFocus} from '../hooks/useListFocus';
29
+ import {oneTabStopAmong, useInternalListFocus} from '../hooks/useListFocus';
30
30
  import {useKeyboardHint} from '../hooks/useKeyboardHint';
31
31
  import {SizeProvider} from '../SizeContext/SizeContext';
32
32
  import {edgeCompSlot} from '../Layout/edgeCompensation.stylex';
@@ -202,6 +202,11 @@ export interface ToolbarProps extends BaseProps<HTMLDivElement> {
202
202
  dividers?: ('top' | 'bottom' | 'start' | 'end')[];
203
203
  }
204
204
 
205
+ // `a[href]` catches a Button rendered with `href`.
206
+ const TOOLBAR_ITEMS = 'button, input, a[href], [tabindex]';
207
+ const TOOLBAR_BOUNDARY = '[role="toolbar"], [popover]';
208
+ const toolbarTabStop = oneTabStopAmong(TOOLBAR_ITEMS, TOOLBAR_BOUNDARY);
209
+
205
210
  /**
206
211
  * General-purpose toolbar with start, center, and end content slots.
207
212
  *
@@ -247,14 +252,16 @@ export function Toolbar({
247
252
 
248
253
  const gapVar = spacingVars[spacingStepToVar[gap]] as string;
249
254
 
250
- const {listRef, handleKeyDown, handleFocus} = useListFocus<HTMLDivElement>({
251
- // `a[href]` catches a Button rendered with `href`.
252
- itemSelector: 'button, input, a[href], [tabindex]',
253
- boundarySelector: '[role="toolbar"], [popover]',
254
- orientation,
255
- hasRovingTabIndex: true,
256
- hasCaretGuard: true,
257
- });
255
+ const {listRef, handleKeyDown, handleFocus} =
256
+ useInternalListFocus<HTMLDivElement>({
257
+ itemSelector: TOOLBAR_ITEMS,
258
+ boundarySelector: TOOLBAR_BOUNDARY,
259
+ orientation,
260
+ hasRovingTabIndex: true,
261
+ hasCaretGuard: true,
262
+ // A read-only toolbar of disabled controls stays one Tab stop.
263
+ tabStopOrder: toolbarTabStop,
264
+ });
258
265
 
259
266
  const {
260
267
  hintElement,
@@ -0,0 +1,43 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file tooltipPresentInterest.ts
7
+ * @input createSharedContext
8
+ * @output Exports `TooltipPresentInterestContext` and its value types: the
9
+ * interaction on a tooltip's anchor that mounted the tooltip
10
+ * @position Internal to Core, not exported from the Tooltip entry. A
11
+ * truncated Text or Heading mounts its tooltip on the first hover, tap or
12
+ * focus, and provides that interaction here, so the tooltip answers it when
13
+ * its trigger attaches, as its own listeners would have.
14
+ */
15
+
16
+ import type {RefObject} from 'react';
17
+ import {createSharedContext} from '../utils/sharedContext';
18
+
19
+ /**
20
+ * The interaction on the anchor that mounted the tooltip: a hover from a
21
+ * mouse or pen still over it, a completed tap, or focus inside it. `null`
22
+ * when there is none.
23
+ */
24
+ export type TooltipPresentInterest = 'hover' | 'tap' | 'focus' | null;
25
+
26
+ /**
27
+ * Holds the interaction until the tooltip's trigger attaches. The tooltip
28
+ * reads it once and marks it read, so a later remount opens nothing by itself.
29
+ */
30
+ export interface TooltipPresentInterestState {
31
+ interest: TooltipPresentInterest;
32
+ /** The `click` that completed the tap, for the touch trigger's rules. */
33
+ tapEvent: Event | null;
34
+ isRead: boolean;
35
+ }
36
+
37
+ export const TooltipPresentInterestContext =
38
+ createSharedContext<RefObject<TooltipPresentInterestState> | null>(
39
+ 'TooltipPresentInterestContext',
40
+ 1,
41
+ null,
42
+ );
43
+ TooltipPresentInterestContext.displayName = 'TooltipPresentInterestContext';
@@ -14,6 +14,7 @@
14
14
  */
15
15
 
16
16
  import {
17
+ use,
17
18
  useCallback,
18
19
  useEffect,
19
20
  useRef,
@@ -21,6 +22,7 @@ import {
21
22
  type ReactNode,
22
23
  type RefCallback,
23
24
  } from 'react';
25
+ import {TooltipPresentInterestContext} from './tooltipPresentInterest';
24
26
  import {createTriggerFocusGate, isFocusOnTrigger} from '../utils/triggerFocus';
25
27
  import * as stylex from '@stylexjs/stylex';
26
28
  import {
@@ -311,6 +313,8 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
311
313
  const showTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
312
314
  const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
313
315
  const triggerRef = useRef<HTMLElement | null>(null);
316
+ // Set only by a Core component that mounts the tooltip on interaction.
317
+ const presentInterest = use(TooltipPresentInterestContext);
314
318
  // Whether the tooltip is enabled now, for a show that runs after a render
315
319
  // (a pending hover show) and for the trigger ref callback.
316
320
  const isEnabledRef = useRef(isEnabled);
@@ -394,6 +398,7 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
394
398
  handlePointerDown: handleTouchPointerDown,
395
399
  clearTapOpen,
396
400
  armOutsideDismiss,
401
+ answerTap,
397
402
  } = useTouchTriggerInternal(
398
403
  {
399
404
  touchTrigger,
@@ -683,6 +688,8 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
683
688
  hideNow,
684
689
  showNow,
685
690
  opensOnFocus,
691
+ presentInterest,
692
+ answerTap,
686
693
  });
687
694
  handlersRef.current = {
688
695
  handleMouseEnter,
@@ -698,6 +705,8 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
698
705
  hideNow,
699
706
  showNow,
700
707
  opensOnFocus,
708
+ presentInterest,
709
+ answerTap,
701
710
  };
702
711
 
703
712
  // Removes the attached trigger's listeners (the trigger ref callback's
@@ -775,6 +784,30 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
775
784
  latest().showNow();
776
785
  }
777
786
 
787
+ // This tooltip mounted after the interaction that wants it. It answers
788
+ // that interaction once, by the same rules as its listeners.
789
+ const state = latest().presentInterest?.current;
790
+ const interest = state == null || state.isRead ? null : state.interest;
791
+ const tapEvent = state?.tapEvent ?? null;
792
+ if (state != null) {
793
+ state.isRead = true;
794
+ }
795
+ if (isEnabledRef.current && latest().isOpen === undefined) {
796
+ if (interest === 'hover') {
797
+ latest().handleMouseEnter();
798
+ } else if (interest === 'tap') {
799
+ latest().answerTap(tapEvent);
800
+ } else if (
801
+ interest === 'focus' &&
802
+ latest().focusTrigger !== 'never' &&
803
+ focused instanceof HTMLElement &&
804
+ el.contains(focused) &&
805
+ latest().opensOnFocus(focused, el)
806
+ ) {
807
+ latest().showNow();
808
+ }
809
+ }
810
+
778
811
  const detach = () => {
779
812
  if (detachTriggerRef.current === detach) {
780
813
  detachTriggerRef.current = null;
@@ -10,11 +10,15 @@
10
10
  */
11
11
 
12
12
  import {use} from 'react';
13
- import {createLayerScopedContext as createContext} from '../Layer/layerScopedContext';
13
+ import {createLayerScopedContext} from '../Layer/layerScopedContext';
14
14
 
15
15
  export type TopNavSlot = 'start' | 'center' | 'end';
16
16
 
17
- export const TopNavSlotContext = createContext<TopNavSlot>('start');
17
+ export const TopNavSlotContext = createLayerScopedContext<TopNavSlot>(
18
+ 'TopNavSlotContext',
19
+ 1,
20
+ 'start',
21
+ );
18
22
  TopNavSlotContext.displayName = 'TopNavSlotContext';
19
23
 
20
24
  export function useTopNavSlot(): TopNavSlot {
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @file TopNavMobileContentContext.ts
7
- * @input React createContext, use
7
+ * @input createSharedContext, use
8
8
  * @output Exports TopNavMobileContentContext and useTopNavMobileContent
9
9
  * @position Internal context for passing additional drawer content to TopNav
10
10
  *
@@ -13,9 +13,14 @@
13
13
  * mobile drawer, producing a single combined drawer.
14
14
  */
15
15
 
16
- import {createContext, use, type ReactNode} from 'react';
16
+ import {use, type ReactNode} from 'react';
17
+ import {createSharedContext} from '../utils/sharedContext';
17
18
 
18
- export const TopNavMobileContentContext = createContext<ReactNode>(null);
19
+ export const TopNavMobileContentContext = createSharedContext<ReactNode>(
20
+ 'TopNavMobileContentContext',
21
+ 1,
22
+ null,
23
+ );
19
24
  TopNavMobileContentContext.displayName = 'TopNavMobileContentContext';
20
25
 
21
26
  /**
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @file TopNavRenderContext.ts
7
- * @input React createContext, use
7
+ * @input createSharedContext, use
8
8
  * @output Exports TopNavRenderContext and useTopNavRenderMode hook
9
9
  * @position Internal context for controlling TopNav rendering mode
10
10
  *
@@ -15,12 +15,16 @@
15
15
  * - 'drawer': nav items as vertical list elements (mobile drawer)
16
16
  */
17
17
 
18
- import {createContext, use} from 'react';
18
+ import {use} from 'react';
19
+ import {createSharedContext} from '../utils/sharedContext';
19
20
 
20
21
  export type TopNavRenderMode = 'default' | 'mobile-bar' | 'drawer';
21
22
 
22
- export const TopNavRenderContext =
23
- createContext<TopNavRenderMode>('default');
23
+ export const TopNavRenderContext = createSharedContext<TopNavRenderMode>(
24
+ 'TopNavRenderContext',
25
+ 1,
26
+ 'default',
27
+ );
24
28
  TopNavRenderContext.displayName = 'TopNavRenderContext';
25
29
 
26
30
  /**
@@ -9,7 +9,8 @@
9
9
  * @position Package-internal; not exported from the package entry point
10
10
  */
11
11
 
12
- import {createContext, use, useSyncExternalStore} from 'react';
12
+ import {use, useSyncExternalStore} from 'react';
13
+ import {createSharedContext} from '../utils/sharedContext';
13
14
 
14
15
  /**
15
16
  * How the base hands its busy state to a wrapper that owns the inline-end lane.
@@ -92,7 +93,11 @@ export function useIsBusy(lane: BusyIndicatorLane): boolean {
92
93
  return useSyncExternalStore(lane.subscribe, lane.getIsBusy, lane.getIsBusy);
93
94
  }
94
95
 
95
- const BusyIndicatorLaneContext = createContext<BusyIndicatorLane | null>(null);
96
+ const BusyIndicatorLaneContext = createSharedContext<BusyIndicatorLane | null>(
97
+ 'BusyIndicatorLaneContext',
98
+ 1,
99
+ null,
100
+ );
96
101
  BusyIndicatorLaneContext.displayName = 'BusyIndicatorLaneContext';
97
102
 
98
103
  export const BusyIndicatorLaneProvider = BusyIndicatorLaneContext.Provider;
@@ -15,7 +15,8 @@
15
15
  * render does not change the key and reloads nothing.
16
16
  */
17
17
 
18
- import {createContext, use} from 'react';
18
+ import {use} from 'react';
19
+ import {createSharedContext} from '../utils/sharedContext';
19
20
 
20
21
  export type CommittedChoices = {
21
22
  /** Changes exactly when the committed values change. */
@@ -26,9 +27,9 @@ export type CommittedChoices = {
26
27
  isAtLimit: boolean;
27
28
  };
28
29
 
29
- export const CommittedChoicesKeyContext = createContext<
30
+ export const CommittedChoicesKeyContext = createSharedContext<
30
31
  CommittedChoices | undefined
31
- >(undefined);
32
+ >('CommittedChoicesKeyContext', 1, undefined);
32
33
  CommittedChoicesKeyContext.displayName = 'CommittedChoicesKeyContext';
33
34
 
34
35
  /** The caller's committed values, if a caller provides them. */
@@ -13,12 +13,17 @@
13
13
  * navigation, selection, or token editing (family:input-fields FR10).
14
14
  */
15
15
 
16
- import {createContext, use, type KeyboardEvent} from 'react';
16
+ import {use, type KeyboardEvent} from 'react';
17
+ import {createSharedContext} from '../utils/sharedContext';
17
18
 
18
19
  export type TrailingKeyDown =
19
20
  ((event: KeyboardEvent<HTMLInputElement>) => void) | undefined;
20
21
 
21
- export const TrailingKeyDownContext = createContext<TrailingKeyDown>(undefined);
22
+ export const TrailingKeyDownContext = createSharedContext<TrailingKeyDown>(
23
+ 'TrailingKeyDownContext',
24
+ 1,
25
+ undefined,
26
+ );
22
27
  TrailingKeyDownContext.displayName = 'TrailingKeyDownContext';
23
28
 
24
29
  /** The consumer key handler BaseTypeahead runs after its own, if any. */
@@ -513,6 +513,11 @@ export class GestureArena {
513
513
  }
514
514
  }
515
515
 
516
+ /** @internal A recognizer takes its touches from the view, unclaimed. */
517
+ cancelTouchesInViewOf(recognizer: GestureRecognizer): void {
518
+ this.cancelViewTouchesOf(recognizer);
519
+ }
520
+
516
521
  /**
517
522
  * Runs `body`, code outside input that stops recognizers (an Effect that
518
523
  * turns one off or detaches it), without resolving what those stops
@@ -629,7 +634,9 @@ export class GestureArena {
629
634
  }
630
635
  this.claim(recognizer);
631
636
  // A watcher takes nothing from the view either: the press and the click
632
- // under it stay (spec:AST-094 FR11, FR19; FR15 exempts watchers).
637
+ // under it stay (spec:AST-094 FR11, FR19; FR15 exempts watchers). Only
638
+ // `cancelTouchesInView` takes them, as a pager's catch on a release's settle
639
+ // does.
633
640
  if (recognizer.claimsTouches && recognizer.cancelsTouchesInView) {
634
641
  this.cancelViewTouchesOf(recognizer);
635
642
  }
@@ -559,6 +559,15 @@ export abstract class GestureRecognizer {
559
559
  return this.arena?.now() ?? 0;
560
560
  }
561
561
 
562
+ /**
563
+ * Takes this recognizer's touches from the view, as a claiming winner does
564
+ * under `cancelsTouchesInView`: the view's press ends and no click follows.
565
+ * The touches stay unclaimed, so the page still scrolls.
566
+ */
567
+ protected cancelTouchesInView(): void {
568
+ this.arena?.cancelTouchesInViewOf(this);
569
+ }
570
+
562
571
  // --- Arena hooks (internal) ----------------------------------------------
563
572
 
564
573
  /** @internal Whether this recognizer takes `touch` right now. */
@@ -14,9 +14,9 @@
14
14
  * UIControl semantics, event for event:
15
15
  *
16
16
  * - `touchDown` when the finger lands; the highlight comes on in the same
17
- * frame, unless the control sits in a scroller, where it waits
18
- * `contentTouchDelay` (UIScrollView.delaysContentTouches) so a flick
19
- * paints nothing.
17
+ * frame, unless the control sits in a scroller. There it waits
18
+ * `contentTouchDelay` (UIScrollView.delaysContentTouches) from the touch's
19
+ * own time, so a flick paints nothing.
20
20
  * - `touchDragInside` / `touchDragOutside` on every move, `touchDragExit` /
21
21
  * `touchDragEnter` when the finger crosses the control's bounds EXPANDED
22
22
  * by `trackingExpansion` (a fingertip dragged a little off a button is
@@ -49,6 +49,7 @@
49
49
  import {UIKIT_CONTROL, UIKIT_PAN, UIKIT_PRESS} from '../motion/uikit/gestures';
50
50
  // Importing the whole table bundles its curves into each press-tracking control.
51
51
  import {press as pressClocks} from '../motion/uikit/timing';
52
+ import {msSinceInput} from '../utils/inputAge';
52
53
  import {travel} from './geometry';
53
54
  import type {GestureRecognizer, SelectionLock} from './GestureRecognizer';
54
55
  import type {TapGestureRecognizer} from './TapGestureRecognizer';
@@ -345,12 +346,20 @@ export function createPressTracker(options: PressTrackerOptions): PressTracker {
345
346
  (delay === 'always' ||
346
347
  (delay === 'inScrollers' && touch.scroll?.isInsideScroller === true));
347
348
  if (delays) {
349
+ // The delay counts from the touch, so the time a busy main thread
350
+ // took to deliver it comes off the wait. The touch's time is on the
351
+ // clock of its own window, which can be an iframe's.
352
+ const wait = Math.max(
353
+ 0,
354
+ PRESS.contentTouchDelay.value -
355
+ msSinceInput(touch.time, touch.target),
356
+ );
348
357
  highlightTimer = setTimeout(() => {
349
358
  highlightTimer = null;
350
359
  if (state.isTouchInside) {
351
360
  setHighlighted(true);
352
361
  }
353
- }, PRESS.contentTouchDelay.value);
362
+ }, wait);
354
363
  } else {
355
364
  setHighlighted(true);
356
365
  }