@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
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @file useTableRowIndex.tsx
7
- * @input React, StyleX, Table types + the rendered data array
7
+ * @input React, StyleX, Table types, and each body row's TableRowContext
8
8
  * @output Exports useTableRowIndex hook + config type
9
9
  * @position Row-index plugin; consumed by Table via plugins prop
10
10
  *
@@ -21,22 +21,20 @@ import type {TableColumn, TablePlugin} from '../../types';
21
21
  /**
22
22
  * Configuration for {@link useTableRowIndex}.
23
23
  *
24
- * Astryx's `renderCell` receives only the row item (not its position), so the
25
- * plugin needs the rendered `data` array — the same array passed to
26
- * `<Table data>` — to derive each row's 1-based ordinal. Pass `getRowKey` when
27
- * items don't have a stable identity by reference (e.g. new objects each
28
- * render); it must return a **unique** string per row (duplicate keys collapse
29
- * to a single ordinal).
24
+ * Without `data`, the plugin numbers each body row from the position Table
25
+ * gives it. With `data`, numbers follow that array, as before.
30
26
  */
31
27
  export interface UseTableRowIndexConfig<T extends Record<string, unknown>> {
32
- /** The data array currently rendered by the table (post sort/filter/page). */
33
- data: T[];
34
28
  /**
35
- * Optional key extractor returning a **unique** string per row. When
36
- * provided, index lookup is keyed by the returned string (stable across new
37
- * object identities); otherwise items are matched by reference identity.
38
- * For a stable plugin identity across renders, memoize this with
39
- * `useCallback`.
29
+ * Optional: the array whose order the numbers follow. Omit it to number
30
+ * rows from the positions Table gives them.
31
+ */
32
+ data?: T[];
33
+ /**
34
+ * Optional key extractor returning a **unique** string per row, used with
35
+ * `data`. When provided, rows match `data` by the returned string (stable
36
+ * across new object identities); otherwise by reference identity. For a
37
+ * stable plugin identity across renders, memoize this with `useCallback`.
40
38
  */
41
39
  getRowKey?: (item: T) => string;
42
40
  /** Header label for the index column. @default '#' */
@@ -45,6 +43,7 @@ export interface UseTableRowIndexConfig<T extends Record<string, unknown>> {
45
43
  startFrom?: number;
46
44
  }
47
45
 
46
+ const INDEX_COLUMN_KEY = '__rowIndex';
48
47
  const INDEX_COLUMN_WIDTH = {type: 'pixel' as const, value: 48};
49
48
 
50
49
  const styles = stylex.create({
@@ -58,24 +57,26 @@ const styles = stylex.create({
58
57
 
59
58
  /**
60
59
  * Returns a {@link TablePlugin} that prepends a right-aligned, monospaced
61
- * row-number column. Numbering follows the order of the rendered `data` array,
62
- * so it reflects the current sort / filter / pagination view.
60
+ * row-number column. Numbering follows the rows the table renders, so it
61
+ * reflects the current sort / filter / pagination view.
63
62
  *
64
63
  * @example
65
64
  * ```
66
- * const rowIndex = useTableRowIndex({data});
65
+ * const rowIndex = useTableRowIndex();
67
66
  * <Table data={data} columns={columns} idKey="id" plugins={{rowIndex}} />;
68
67
  * ```
69
68
  */
70
69
  export function useTableRowIndex<T extends Record<string, unknown>>(
71
- config: UseTableRowIndexConfig<T>,
70
+ config: UseTableRowIndexConfig<T> = {},
72
71
  ): TablePlugin<T> {
73
72
  const {data, getRowKey, label = '#', startFrom = 1} = config;
74
73
 
75
- // Single item → ordinal lookup, built in one pass and rebuilt only when the
76
- // data array or key extractor changes. Keyed by getRowKey when provided
74
+ // The lookup into a caller's `data`. Keyed by getRowKey when provided
77
75
  // (stable across new object identities), otherwise by object reference.
78
76
  const lookup = useMemo(() => {
77
+ if (data == null) {
78
+ return null;
79
+ }
79
80
  const map = new Map<unknown, number>();
80
81
  for (let i = 0; i < data.length; i++) {
81
82
  const item = data[i];
@@ -85,19 +86,28 @@ export function useTableRowIndex<T extends Record<string, unknown>>(
85
86
  map.get(getRowKey ? getRowKey(item) : item);
86
87
  }, [data, getRowKey]);
87
88
 
88
- // The plugin object depends only on the stable lookup and the presentational
89
- // props — not on data directly — so it stays as stable as its inputs allow.
90
- return useMemo(
91
- (): TablePlugin<T> => ({
89
+ return useMemo((): TablePlugin<T> => {
90
+ // Table runs each cell's transforms just before it renders that cell. So
91
+ // the index cell's renderer reads the position that its own transform
92
+ // stored.
93
+ const positions = new WeakMap<T, number>();
94
+ return {
95
+ rowModel: 'flat',
96
+ transformBodyCell(props, column, item, _columnIndex, _columns, context) {
97
+ if (lookup == null && column.key === INDEX_COLUMN_KEY && context) {
98
+ positions.set(item, context.logicalIndex);
99
+ }
100
+ return props;
101
+ },
92
102
  transformColumns(columns) {
93
103
  const indexColumn: TableColumn<T> = {
94
- key: '__rowIndex',
104
+ key: INDEX_COLUMN_KEY,
95
105
  header: label,
96
106
  width: INDEX_COLUMN_WIDTH,
97
107
  align: 'end',
98
108
  resizable: false,
99
109
  renderCell: (item: T) => {
100
- const idx = lookup(item);
110
+ const idx = lookup == null ? positions.get(item) : lookup(item);
101
111
  if (idx == null) {
102
112
  return null;
103
113
  }
@@ -108,7 +118,6 @@ export function useTableRowIndex<T extends Record<string, unknown>>(
108
118
  };
109
119
  return [indexColumn, ...columns];
110
120
  },
111
- }),
112
- [label, startFrom, lookup],
113
- );
121
+ };
122
+ }, [label, startFrom, lookup]);
114
123
  }
@@ -38,7 +38,6 @@
38
38
  */
39
39
 
40
40
  import {
41
- createContext,
42
41
  use,
43
42
  useCallback,
44
43
  useEffect,
@@ -58,6 +57,7 @@ import {
58
57
  useComponentTranslator,
59
58
  } from '../../../i18n/useComponentTranslator';
60
59
  import english from '../../../i18n/generated-english/Table/plugins/selection/useTableSelection.generated';
60
+ import {createSharedContext} from '../../../utils/sharedContext';
61
61
 
62
62
  registerEnglishFallback(english);
63
63
 
@@ -190,7 +190,11 @@ function applyRowSelectionStyle(
190
190
  // =============================================================================
191
191
 
192
192
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
193
- const SelectionStoreContext = createContext<SelectionStore<any> | null>(null);
193
+ const SelectionStoreContext = createSharedContext<SelectionStore<any> | null>(
194
+ 'SelectionStoreContext',
195
+ 1,
196
+ null,
197
+ );
194
198
  SelectionStoreContext.displayName = 'SelectionStoreContext';
195
199
 
196
200
  // =============================================================================
@@ -395,6 +399,7 @@ export function useTableSelection<T extends Record<string, unknown>>(
395
399
 
396
400
  return useMemo(
397
401
  (): TablePlugin<T> => ({
402
+ rowModel: 'flat',
398
403
  transformTableContext(children: ReactNode) {
399
404
  return (
400
405
  <SelectionStoreContext value={store}>
@@ -611,6 +611,7 @@ export function useTableStickyColumns<T extends Record<string, unknown>>(
611
611
 
612
612
  return useMemo(
613
613
  (): TablePlugin<T> => ({
614
+ rowModel: 'flat',
614
615
  transformTableContext(children: ReactNode): ReactNode {
615
616
  return (
616
617
  <>
@@ -30,7 +30,6 @@
30
30
  */
31
31
 
32
32
  import {
33
- createContext,
34
33
  use,
35
34
  useCallback,
36
35
  useEffect,
@@ -58,6 +57,7 @@ import {
58
57
  useComponentTranslator,
59
58
  } from '../../../i18n/useComponentTranslator';
60
59
  import english from '../../../i18n/generated-english/Table/plugins/tree/useTableTreeData.generated';
60
+ import {createSharedContext} from '../../../utils/sharedContext';
61
61
 
62
62
  registerEnglishFallback(english);
63
63
 
@@ -172,7 +172,11 @@ function createTreeStore<T extends Record<string, unknown>>(
172
172
  }
173
173
 
174
174
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
175
- const TreeStoreContext = createContext<TreeStore<any> | null>(null);
175
+ const TreeStoreContext = createSharedContext<TreeStore<any> | null>(
176
+ 'TreeStoreContext',
177
+ 1,
178
+ null,
179
+ );
176
180
  TreeStoreContext.displayName = 'TreeStoreContext';
177
181
 
178
182
  /** Indent token -> index, for the primitive row snapshot. */
@@ -0,0 +1,105 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file tableRowContextUsage.ts
5
+ * @input Immutable row contexts and the plugins whose transforms read them
6
+ * @output Per-plugin tracked contexts, and which plugins read the row index or
7
+ * the row count
8
+ * @position Private to BaseTable's row memoization; plugins never import it
9
+ */
10
+
11
+ import type {TablePlugin, TableRowContext} from './types';
12
+ import {warnOnce} from '../utils/devWarning';
13
+
14
+ const indexReadingPlugins = new WeakSet<object>();
15
+ const countReadingPlugins = new WeakSet<object>();
16
+ const trackedContexts = new WeakMap<
17
+ TableRowContext,
18
+ WeakMap<object, TableRowContext>
19
+ >();
20
+ let transformingPlugin: object | null = null;
21
+
22
+ /** Run one plugin transform; context reads inside it are in time. */
23
+ export function runPluginTransform<R>(plugin: object, transform: () => R): R {
24
+ const outer = transformingPlugin;
25
+ transformingPlugin = plugin;
26
+ try {
27
+ return transform();
28
+ } finally {
29
+ transformingPlugin = outer;
30
+ }
31
+ }
32
+
33
+ /**
34
+ * Tracking sees only reads made during the transform. A row that does not
35
+ * re-render keeps its old context, so a later read can return a stale index
36
+ * or count.
37
+ */
38
+ function warnIfLate(plugin: object, field: string): void {
39
+ if (transformingPlugin !== plugin) {
40
+ warnOnce(
41
+ `table-row-context-late-read-${field}`,
42
+ 'Table',
43
+ `A plugin read TableRowContext.${field} after its transform returned. ` +
44
+ 'Read context values during the transform and copy them into any callback it returns.',
45
+ );
46
+ }
47
+ }
48
+
49
+ /** Whether a transform of the plugin has read a row's `logicalIndex`. */
50
+ export function readsRowIndex<T extends Record<string, unknown>>(
51
+ plugin: TablePlugin<T>,
52
+ ): boolean {
53
+ return indexReadingPlugins.has(plugin);
54
+ }
55
+
56
+ /** Whether a transform of the plugin has read a row count. */
57
+ export function readsRowCount<T extends Record<string, unknown>>(
58
+ plugin: TablePlugin<T>,
59
+ ): boolean {
60
+ return countReadingPlugins.has(plugin);
61
+ }
62
+
63
+ /**
64
+ * The context as one plugin sees it. Its getters record which values the
65
+ * plugin reads, so a row re-renders for a moved index or a changed count only
66
+ * when a plugin can show it. The values stay the same as the context's.
67
+ */
68
+ export function trackRowContext<T extends Record<string, unknown>>(
69
+ plugin: TablePlugin<T>,
70
+ context: TableRowContext,
71
+ ): TableRowContext {
72
+ let byPlugin = trackedContexts.get(context);
73
+ if (byPlugin == null) {
74
+ byPlugin = new WeakMap();
75
+ trackedContexts.set(context, byPlugin);
76
+ }
77
+ const cached = byPlugin.get(plugin);
78
+ if (cached != null) {
79
+ return cached;
80
+ }
81
+ const render = Object.freeze({
82
+ ...context.render,
83
+ get logicalRowCount() {
84
+ warnIfLate(plugin, 'render.logicalRowCount');
85
+ countReadingPlugins.add(plugin);
86
+ return context.render.logicalRowCount;
87
+ },
88
+ });
89
+ const tracked: TableRowContext = Object.freeze({
90
+ ...context,
91
+ render,
92
+ get logicalIndex() {
93
+ warnIfLate(plugin, 'logicalIndex');
94
+ indexReadingPlugins.add(plugin);
95
+ return context.logicalIndex;
96
+ },
97
+ get logicalRowCount() {
98
+ warnIfLate(plugin, 'logicalRowCount');
99
+ countReadingPlugins.add(plugin);
100
+ return context.logicalRowCount;
101
+ },
102
+ });
103
+ byPlugin.set(plugin, tracked);
104
+ return tracked;
105
+ }
@@ -422,6 +422,51 @@ export type TableContextActions =
422
422
  // Plugin Interface
423
423
  // =============================================================================
424
424
 
425
+ /**
426
+ * Immutable facts about the table that Table passes to row, cell and
427
+ * scroll-wrapper transforms.
428
+ */
429
+ export interface TableRenderContext {
430
+ /** The branch Table renders: `data` rows from `data`, or caller `children`. */
431
+ readonly mode: 'data' | 'children';
432
+ /**
433
+ * The row model the plugins admit. `flat` unless a plugin declares another
434
+ * model, or has a body transform and declares none (`custom`).
435
+ */
436
+ readonly rowModel: 'flat' | 'tree' | 'grouped' | 'detail' | 'custom';
437
+ /** The number of product rows in the complete `data` input. */
438
+ readonly logicalRowCount: number;
439
+ /** The number of header rows: 1 when Table renders a header, else 0. */
440
+ readonly headerRowCount: number;
441
+ /** The scroll container around the `<table>`. Its reference is stable. */
442
+ readonly viewport: React.RefObject<HTMLDivElement | null>;
443
+ }
444
+
445
+ /**
446
+ * Immutable facts about one body row that Table passes to its transforms.
447
+ * Read its values during the transform, and copy what a returned callback
448
+ * needs: a row that does not re-render keeps its old context.
449
+ */
450
+ export interface TableRowContext {
451
+ /** The row's key: its `idKey` value, or its index when there is no `idKey`. */
452
+ readonly key: string | number | undefined;
453
+ /** Whether the key is a usable identity. */
454
+ readonly identityStatus: 'valid' | 'missing' | 'invalid' | 'duplicate';
455
+ /** `product` for a row of a flat dataset; `unknown` for another row model. */
456
+ readonly kind: 'product' | 'synthetic' | 'unknown';
457
+ /**
458
+ * The zero-based position of the row in the complete `data` input. A row
459
+ * keeps this index when only some rows are mounted.
460
+ */
461
+ readonly logicalIndex: number;
462
+ /** The number of product rows in the complete `data` input. */
463
+ readonly logicalRowCount: number;
464
+ /** The number of header rows: 1 when Table renders a header, else 0. */
465
+ readonly headerRowCount: number;
466
+ /** The table's render context. */
467
+ readonly render: TableRenderContext;
468
+ }
469
+
425
470
  /**
426
471
  * Table plugin — transforms render props at each structural level.
427
472
  * Plugins compose by sequential application (first plugin's output feeds next).
@@ -449,6 +494,12 @@ export type TableContextActions =
449
494
  export interface TablePlugin<
450
495
  T extends Record<string, unknown> = Record<string, unknown>,
451
496
  > {
497
+ /**
498
+ * The row model this plugin's body transforms keep. Declare `'flat'` when
499
+ * they keep one product row per data item. A body transform without a
500
+ * declaration makes the table's row model `custom`.
501
+ */
502
+ readonly rowModel?: TableRenderContext['rowModel'];
452
503
  /**
453
504
  * Transform the column definitions before rendering.
454
505
  * Runs before any element-level transforms. Use to filter, reorder,
@@ -471,14 +522,19 @@ export interface TablePlugin<
471
522
  columnIndex: number,
472
523
  columns: ReadonlyArray<TableColumn<T>>,
473
524
  ) => HeaderCellRenderProps;
474
- /** Transform each body `<tr>` props */
525
+ /**
526
+ * Transform each body `<tr>` props. Read `context` values during the
527
+ * transform, not later in a callback it returns.
528
+ */
475
529
  transformBodyRow?: (
476
530
  props: BodyRowRenderProps,
477
531
  item: T,
478
532
  index: number,
533
+ context?: TableRowContext,
479
534
  ) => BodyRowRenderProps;
480
535
  /**
481
- * Transform each body `<td>` props.
536
+ * Transform each body `<td>` props. Read `context` values during the
537
+ * transform, not later in a callback it returns.
482
538
  *
483
539
  * `columnIndex` and the full `columns` list are provided for plugins that
484
540
  * need to reason about column position (e.g. cumulative sticky offsets).
@@ -489,6 +545,7 @@ export interface TablePlugin<
489
545
  item: T,
490
546
  columnIndex: number,
491
547
  columns: ReadonlyArray<TableColumn<T>>,
548
+ context?: TableRowContext,
492
549
  ) => BodyCellRenderProps;
493
550
  /**
494
551
  * Transform the scroll-wrapper region — the `<div>` wrapping the `<table>`
@@ -498,6 +555,7 @@ export interface TablePlugin<
498
555
  */
499
556
  transformScrollWrapper?: (
500
557
  props: ScrollWrapperRenderProps,
558
+ context?: TableRenderContext,
501
559
  ) => ScrollWrapperRenderProps;
502
560
  /** Wrap the table output in context providers */
503
561
  transformTableContext?: (children: ReactNode) => ReactNode;
@@ -89,6 +89,9 @@ function sortPluginEntries<T extends Record<string, unknown>>(
89
89
  // ======================================================================
90
90
  // Plugin Validation (dev mode only)
91
91
  // ======================================================================
92
+ /** Known declaration fields on the TablePlugin interface. */
93
+ const VALID_DECLARATION_KEYS = new Set(['rowModel']);
94
+
92
95
  /** Known transform method names on the TablePlugin interface. */
93
96
  const VALID_TRANSFORM_KEYS = new Set([
94
97
  'transformColumns',
@@ -117,11 +120,11 @@ function validatePlugin<T extends Record<string, unknown>>(
117
120
 
118
121
  // Warn about unknown keys (likely misspelled transform names)
119
122
  for (const key of keys) {
120
- if (!VALID_TRANSFORM_KEYS.has(key)) {
123
+ if (!VALID_TRANSFORM_KEYS.has(key) && !VALID_DECLARATION_KEYS.has(key)) {
121
124
  devWarn(
122
125
  'Table',
123
126
  `Plugin "${name}" has unknown key "${key}". ` +
124
- `Valid keys: ${[...VALID_TRANSFORM_KEYS].join(', ')}. ` +
127
+ `Valid keys: ${[...VALID_DECLARATION_KEYS, ...VALID_TRANSFORM_KEYS].join(', ')}. ` +
125
128
  `This key will be ignored.`,
126
129
  );
127
130
  }
@@ -7,20 +7,19 @@ export const docs = {
7
7
  subComponentOf: 'Table',
8
8
  displayName: 'useTableRowIndex',
9
9
  description:
10
- 'Hook that returns a TablePlugin which prepends a right-aligned, monospaced row-number column. Numbering follows the rendered data order (reflecting the current sort / filter / pagination view) and starts at 1 by default. Astryx renderCell receives only the row item, so the plugin takes the rendered data array to derive each ordinal.',
10
+ 'Hook that returns a TablePlugin which prepends a right-aligned, monospaced row-number column. Numbering follows the rows the table renders (reflecting the current sort / filter / pagination view) and starts at 1 by default. Without data, Table gives each row its position; with data, numbers follow that array.',
11
11
  props: [
12
12
  {
13
13
  name: 'data',
14
14
  type: 'T[]',
15
15
  description:
16
- 'The data array currently rendered by the table (post sort/filter/page). Numbering follows this order.',
17
- required: true,
16
+ 'Optional: the array whose order the numbers follow. Omit it to number rows from the positions Table gives them.',
18
17
  },
19
18
  {
20
19
  name: 'getRowKey',
21
20
  type: '(item: T) => string',
22
21
  description:
23
- 'Optional key extractor returning a unique string per row. When provided, index lookup is keyed by the returned string; otherwise items are matched by reference identity. Memoize with useCallback for a stable plugin identity.',
22
+ 'Optional key extractor used with data, returning a unique string per row. When provided, rows match data by the returned string; otherwise by reference identity. Memoize with useCallback for a stable plugin identity.',
24
23
  },
25
24
  {
26
25
  name: 'label',
@@ -40,10 +39,10 @@ export const docs = {
40
39
  /** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
41
40
  export const docsDense = {
42
41
  description:
43
- 'Returns a TablePlugin that prepends a right-aligned monospaced row-number column. Numbering follows the rendered data order (current sort/filter/page view), 1-based by default. Pass the rendered data array; renderCell only receives the item so the plugin derives ordinals from it.',
42
+ 'Returns a TablePlugin that prepends a right-aligned monospaced row-number column. Numbering follows the rendered rows (current sort/filter/page view), 1-based by default. Without data, Table supplies each row position; with data, numbers follow it.',
44
43
  propDescriptions: {
45
- data: 'The rendered data array (post sort/filter/page). Numbering follows this order.',
46
- getRowKey: 'Optional key extractor returning a unique string per row; otherwise items match by reference.',
44
+ data: 'Optional array whose order the numbers follow; omit to use Table row positions.',
45
+ getRowKey: 'Optional key extractor used with data; otherwise items match by reference.',
47
46
  label: "Header label for the index column. Default '#'.",
48
47
  startFrom: 'First index value. Default 1.',
49
48
  },
package/src/Text/Text.tsx CHANGED
@@ -16,7 +16,7 @@
16
16
  * - /packages/cli/assets/templates/blocks/components/Text/ (showcase blocks)
17
17
  */
18
18
 
19
- import {lazy, Suspense, use, useRef, type ReactNode} from 'react';
19
+ import {use, useRef, type ReactNode} from 'react';
20
20
  import * as stylex from '@stylexjs/stylex';
21
21
  import type {
22
22
  TextType,
@@ -47,6 +47,11 @@ import {
47
47
  truncationTooltipStyles,
48
48
  } from './text.stylex';
49
49
  import {useTruncation} from './useTruncation';
50
+ import {
51
+ TruncationTooltip,
52
+ useTruncationTooltipInterest,
53
+ } from './TruncationTooltip';
54
+ import {composeEventHandlers} from '../utils/composeEventHandlers';
50
55
  import type {LayerPlacement} from '../Layer';
51
56
  import {mergeProps} from '../utils/mergeProps';
52
57
  import {useMergedRefs} from '../hooks/useMergedRefs';
@@ -54,10 +59,6 @@ import type {BaseProps} from '../BaseProps';
54
59
  import {themeProps} from '../utils/themeProps';
55
60
  import {TextClampContext} from './textClampContext';
56
61
 
57
- const LazyXDSTooltip = lazy(async () =>
58
- import('../Tooltip/Tooltip').then(mod => ({default: mod.Tooltip})),
59
- );
60
-
61
62
  export type {TextType, TextSize};
62
63
 
63
64
  export interface TextProps extends Omit<BaseProps, 'children'> {
@@ -273,6 +274,8 @@ export function Text({
273
274
  typeof hasTruncateTooltip === 'string' ? hasTruncateTooltip : 'above';
274
275
  const tooltipEnabled =
275
276
  maxLines > 0 && hasTruncateTooltip !== false && truncation.isTruncated;
277
+ // The tooltip mounts on the first hover, tap or focus, not with the text.
278
+ const tooltipInterest = useTruncationTooltipInterest(tooltipEnabled);
276
279
 
277
280
  // Ref for the text element (used as tooltip anchor)
278
281
  const textRef = useRef<HTMLElement>(null);
@@ -321,24 +324,37 @@ export function Text({
321
324
  className,
322
325
  {...style, ...inlineStyle},
323
326
  )}
324
- {...props}>
327
+ {...props}
328
+ onPointerEnter={composeEventHandlers(
329
+ tooltipInterest.onPointerEnter,
330
+ props.onPointerEnter,
331
+ )}
332
+ onPointerLeave={composeEventHandlers(
333
+ tooltipInterest.onPointerLeave,
334
+ props.onPointerLeave,
335
+ )}
336
+ onPointerDown={composeEventHandlers(
337
+ tooltipInterest.onPointerDown,
338
+ props.onPointerDown,
339
+ )}
340
+ onFocus={composeEventHandlers(tooltipInterest.onFocus, props.onFocus)}
341
+ onBlur={composeEventHandlers(tooltipInterest.onBlur, props.onBlur)}>
325
342
  {/* Always mounted, so a change of maxLines keeps every child mounted. */}
326
343
  <TextClampContext value={isClamped || isInClampedText}>
327
344
  {children}
328
345
  </TextClampContext>
329
346
  </Component>
330
- {tooltipEnabled && (
331
- <Suspense fallback={null}>
332
- <LazyXDSTooltip
333
- anchorRef={textRef}
334
- content={
335
- <span {...stylex.props(truncationTooltipStyles.content)}>
336
- {truncation.fullText}
337
- </span>
338
- }
339
- placement={tooltipPlacement}
340
- />
341
- </Suspense>
347
+ {tooltipEnabled && tooltipInterest.isWanted && (
348
+ <TruncationTooltip
349
+ anchorRef={textRef}
350
+ content={
351
+ <span {...stylex.props(truncationTooltipStyles.content)}>
352
+ {truncation.fullText}
353
+ </span>
354
+ }
355
+ placement={tooltipPlacement}
356
+ interest={tooltipInterest}
357
+ />
342
358
  )}
343
359
  </>
344
360
  );