@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
@@ -65,11 +65,17 @@ import {
65
65
  } from './parser';
66
66
  import type {IncrementalState, MathParseOptions, ParseOptions} from './parser';
67
67
  import {getMarkdownAstLegacyCodeLanguage, markdownAstText} from './ast';
68
+ import {
69
+ blockDirection,
70
+ innerDirectionScope,
71
+ type BlockDirectionScope,
72
+ } from './blockDirection';
68
73
  import type {
69
74
  MarkdownAstBlockContent,
70
75
  MarkdownAstPhrasingContent,
71
76
  MarkdownAstPosition,
72
77
  MarkdownAstTable,
78
+ MarkdownAstTableAlignment,
73
79
  } from './ast';
74
80
  import {
75
81
  applyMarkdownTransforms,
@@ -103,6 +109,7 @@ import {
103
109
  registerEnglishFallback,
104
110
  useComponentTranslator,
105
111
  } from '../i18n/useComponentTranslator';
112
+ import {useDirection} from '../i18n/useDirection';
106
113
  import english from '../i18n/generated-english/Markdown/Markdown.generated';
107
114
 
108
115
  registerEnglishFallback(english);
@@ -376,6 +383,7 @@ const dynamicStyles = stylex.create({
376
383
  });
377
384
 
378
385
  const cellAlignStyles = stylex.create({
386
+ start: {textAlign: 'start'},
379
387
  center: {textAlign: 'center'},
380
388
  end: {textAlign: 'end'},
381
389
  });
@@ -428,6 +436,17 @@ const markdownTableCellStyles = stylex.create({
428
436
  code: {
429
437
  wordBreak: 'normal',
430
438
  },
439
+ // A cell that reads against its table draws the column rule on the table's
440
+ // inline-end side, which is the cell's own inline-start.
441
+ ruleOnTableEnd: {
442
+ borderInlineEndWidth: 0,
443
+ borderInlineStartWidth: {
444
+ default: borderVars['--border-width'],
445
+ ':last-child': '0',
446
+ },
447
+ borderInlineStartStyle: 'solid',
448
+ borderInlineStartColor: colorVars['--color-border'],
449
+ },
431
450
  // The grid's outer edge. `dividers="grid"` draws the lines *between* cells
432
451
  // and stops at the table's rim, so without this the top, bottom, and sides
433
452
  // stay open and the grid reads as unfinished. On the table element, not the
@@ -1344,6 +1363,24 @@ function computeTableColumnMinWidths(node: RenderTable): number[] {
1344
1363
  });
1345
1364
  }
1346
1365
 
1366
+ /**
1367
+ * The alignment and column-rule styles for a Markdown table cell. For a cell
1368
+ * that reads against its table, the table's start is the cell's end, so an
1369
+ * explicit alignment and the rule swap logical sides.
1370
+ */
1371
+ function tableCellSideStyles(
1372
+ align: MarkdownAstTableAlignment | undefined,
1373
+ isAgainstTable: boolean,
1374
+ ): ReadonlyArray<StyleXStyles | false> {
1375
+ return [
1376
+ align === 'center' && cellAlignStyles.center,
1377
+ align === 'right' &&
1378
+ (isAgainstTable ? cellAlignStyles.start : cellAlignStyles.end),
1379
+ align === 'left' && isAgainstTable && cellAlignStyles.end,
1380
+ isAgainstTable && markdownTableCellStyles.ruleOnTableEnd,
1381
+ ];
1382
+ }
1383
+
1347
1384
  function renderBlock(
1348
1385
  node: RenderBlockNode,
1349
1386
  index: number,
@@ -1365,6 +1402,7 @@ function renderBlock(
1365
1402
  headingProjection?: MarkdownHeadingProjection,
1366
1403
  // How many lists enclose this block (spec:AST-061 DEC-6).
1367
1404
  listDepth = 0,
1405
+ directionScope?: BlockDirectionScope,
1368
1406
  ): SyncReactNode {
1369
1407
  const blockAlignMargin = BLOCK_ALIGN_MARGIN[contentAlign];
1370
1408
  const blockAlignStyle =
@@ -1415,6 +1453,7 @@ function renderBlock(
1415
1453
  <Tag
1416
1454
  key={index}
1417
1455
  id={headingId}
1456
+ dir={blockDirection(node, directionScope)}
1418
1457
  {...mergeProps(
1419
1458
  themeProps('markdown-heading', {density, level}),
1420
1459
  stylex.props(
@@ -1439,6 +1478,7 @@ function renderBlock(
1439
1478
  return (
1440
1479
  <HeadingLinksRenderer
1441
1480
  key={index}
1481
+ dir={blockDirection(node, directionScope)}
1442
1482
  headingId={headingId}
1443
1483
  headingLabel={headingLabel}
1444
1484
  permalinkUrl={permalinkUrl}
@@ -1501,6 +1541,7 @@ function renderBlock(
1501
1541
  <div
1502
1542
  key={index}
1503
1543
  role="paragraph"
1544
+ dir={blockDirection(node, directionScope)}
1504
1545
  {...mergeProps(
1505
1546
  themeProps('markdown-paragraph', {density}),
1506
1547
  stylex.props(
@@ -1660,6 +1701,7 @@ function renderBlock(
1660
1701
  codeLanguages,
1661
1702
  headingProjection,
1662
1703
  listDepth,
1704
+ directionScope,
1663
1705
  ),
1664
1706
  );
1665
1707
  return (
@@ -1671,6 +1713,7 @@ function renderBlock(
1671
1713
  return (
1672
1714
  <Blockquote
1673
1715
  key={index}
1716
+ dir={blockDirection(node, directionScope)}
1674
1717
  {...themeProps('markdown-blockquote', {density})}
1675
1718
  {...lineStamps}
1676
1719
  xstyle={[
@@ -1704,6 +1747,7 @@ function renderBlock(
1704
1747
  codeLanguages,
1705
1748
  headingProjection,
1706
1749
  listDepth,
1750
+ innerDirectionScope(node, directionScope),
1707
1751
  ),
1708
1752
  )}
1709
1753
  </Blockquote>
@@ -1735,6 +1779,12 @@ function renderBlock(
1735
1779
  themeProps('markdown-list', {density}),
1736
1780
  stylex.props(
1737
1781
  spacing,
1782
+ contentWidthValue != null
1783
+ ? dynamicStyles.proseWidth(contentWidthValue)
1784
+ : null,
1785
+ contentAlign !== 'start'
1786
+ ? dynamicStyles.proseAlign(ALIGN_MARGIN[contentAlign])
1787
+ : null,
1738
1788
  isFirst && styles.noMarginBlockStart,
1739
1789
  isLast && styles.noMarginBlockEnd,
1740
1790
  ),
@@ -1790,6 +1840,7 @@ function renderBlock(
1790
1840
  codeLanguages,
1791
1841
  headingProjection,
1792
1842
  listDepth + 1,
1843
+ innerDirectionScope(item, directionScope),
1793
1844
  ),
1794
1845
  )}
1795
1846
  </>
@@ -1801,6 +1852,7 @@ function renderBlock(
1801
1852
  key={i}
1802
1853
  value={`task-${i}`}
1803
1854
  label={label}
1855
+ dir={blockDirection(item, directionScope)}
1804
1856
  {...(recordsSourceLines
1805
1857
  ? sourceLineAttributes(blockSourceLines(item))
1806
1858
  : undefined)}
@@ -1880,6 +1932,7 @@ function renderBlock(
1880
1932
  codeLanguages,
1881
1933
  headingProjection,
1882
1934
  listDepth + 1,
1935
+ innerDirectionScope(item, directionScope),
1883
1936
  ),
1884
1937
  )}
1885
1938
  </>
@@ -1909,6 +1962,16 @@ function renderBlock(
1909
1962
  : t('@astryx.markdown.taskList'),
1910
1963
  };
1911
1964
 
1965
+ const itemDirection = blockDirection(item, directionScope);
1966
+ // A numbered item that reads against its list keeps its counter
1967
+ // beside its own text, so its text never widens the counter
1968
+ // column that the other rows share.
1969
+ const readsAgainstList =
1970
+ node.ordered &&
1971
+ itemDirection != null &&
1972
+ directionScope != null &&
1973
+ itemDirection !== directionScope.around;
1974
+
1912
1975
  return (
1913
1976
  <ListMarkerScope
1914
1977
  // eslint-disable-next-line @eslint-react/no-array-index-key -- markdown list items are rendered from positional AST nodes
@@ -1919,9 +1982,11 @@ function renderBlock(
1919
1982
  ]
1920
1983
  }
1921
1984
  task={task}
1922
- hasMarkerGutter={node.ordered}>
1985
+ hasMarkerGutter={node.ordered}
1986
+ isOutsideNumberColumns={readsAgainstList}>
1923
1987
  <ListItem
1924
1988
  label={label}
1989
+ dir={itemDirection}
1925
1990
  {...(recordsSourceLines
1926
1991
  ? sourceLineAttributes(blockSourceLines(item))
1927
1992
  : undefined)}
@@ -1935,6 +2000,19 @@ function renderBlock(
1935
2000
  }
1936
2001
  case 'table': {
1937
2002
  const colMinWidths = computeTableColumnMinWidths(node);
2003
+ // A cell whose text reads against its table keeps the table's sides: the
2004
+ // column rule and an explicit alignment resolve in the table's
2005
+ // direction, not the cell's.
2006
+ const readsAgainstTable = (
2007
+ cell: Parameters<typeof blockDirection>[0],
2008
+ ): boolean => {
2009
+ const cellDirection = blockDirection(cell, directionScope);
2010
+ return (
2011
+ cellDirection != null &&
2012
+ directionScope != null &&
2013
+ cellDirection !== directionScope.around
2014
+ );
2015
+ };
1938
2016
  const [header, ...rows] = node.children;
1939
2017
  // Inline code inside a cell keeps its token whole, through the same
1940
2018
  // `components` seam consumers use. A supplied renderer owns its own
@@ -1977,11 +2055,14 @@ function renderBlock(
1977
2055
  <TableHeaderCell
1978
2056
  // eslint-disable-next-line @eslint-react/no-array-index-key -- markdown table columns are positional by definition
1979
2057
  key={i}
2058
+ dir={blockDirection(h, directionScope)}
1980
2059
  xstyle={[
1981
2060
  markdownTableCellStyles.headerCell,
1982
2061
  dynamicStyles.cellMinWidth(`${colMinWidths[i]}ch`),
1983
- node.align[i] === 'center' && cellAlignStyles.center,
1984
- node.align[i] === 'right' && cellAlignStyles.end,
2062
+ ...tableCellSideStyles(
2063
+ node.align[i],
2064
+ readsAgainstTable(h),
2065
+ ),
1985
2066
  ]}>
1986
2067
  {h.children.map((c, j) =>
1987
2068
  renderInline(
@@ -2006,10 +2087,13 @@ function renderBlock(
2006
2087
  <TableCell
2007
2088
  // eslint-disable-next-line @eslint-react/no-array-index-key -- markdown table cells are positional by row and column
2008
2089
  key={j}
2090
+ dir={blockDirection(cell, directionScope)}
2009
2091
  xstyle={[
2010
2092
  markdownTableCellStyles.cell,
2011
- node.align[j] === 'center' && cellAlignStyles.center,
2012
- node.align[j] === 'right' && cellAlignStyles.end,
2093
+ ...tableCellSideStyles(
2094
+ node.align[j],
2095
+ readsAgainstTable(cell),
2096
+ ),
2013
2097
  ]}>
2014
2098
  {cell.children.map((c, k) =>
2015
2099
  renderInline(
@@ -2174,6 +2258,7 @@ export function Markdown<
2174
2258
  ...props
2175
2259
  }: MarkdownProps<Plugins>): React.ReactElement {
2176
2260
  const t = useComponentTranslator();
2261
+ const direction = useDirection();
2177
2262
  // Keep one list while it names the same values, so an inline
2178
2263
  // `codeLanguages={[…]}` does not re-render every block on each parent
2179
2264
  // render (adjusting state during render, not in an Effect).
@@ -2445,6 +2530,8 @@ export function Markdown<
2445
2530
  t,
2446
2531
  codeLanguages,
2447
2532
  headingProjection,
2533
+ undefined,
2534
+ {provider: direction, around: direction},
2448
2535
  ),
2449
2536
  );
2450
2537
  }, [
@@ -2466,6 +2553,7 @@ export function Markdown<
2466
2553
  t,
2467
2554
  headingProjection,
2468
2555
  codeLanguages,
2556
+ direction,
2469
2557
  ]);
2470
2558
 
2471
2559
  if (display === 'inline') {
@@ -0,0 +1,100 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file blockDirection.ts
5
+ * @input A Markdown AST prose block (a paragraph, heading, blockquote or list
6
+ * item) or a table cell
7
+ * @output The `dir` for the block: its own text's direction, or the
8
+ * provider's for a block whose text has no strongly directional character
9
+ * @position Read by Markdown.tsx to set each block's `dir`.
10
+ */
11
+
12
+ import {firstStrongDirection} from '../i18n/firstStrongDirection';
13
+
14
+ interface DirectionalNode {
15
+ readonly type: string;
16
+ readonly value?: unknown;
17
+ readonly children?: ReadonlyArray<DirectionalNode>;
18
+ }
19
+
20
+ /**
21
+ * Nodes whose text does not count. An image, a code block, math and a table
22
+ * read on their own terms. An extension node or a citation shows text that is
23
+ * not in the tree.
24
+ */
25
+ const SKIPPED_TYPES = new Set([
26
+ 'image',
27
+ 'code',
28
+ 'math',
29
+ 'inlineMath',
30
+ 'table',
31
+ 'thematicBreak',
32
+ 'citation',
33
+ 'break',
34
+ 'extension',
35
+ ]);
36
+
37
+ function nodeDirection(node: DirectionalNode): 'ltr' | 'rtl' | null {
38
+ if (SKIPPED_TYPES.has(node.type)) {
39
+ return null;
40
+ }
41
+ if (typeof node.value === 'string') {
42
+ return firstStrongDirection(node.value);
43
+ }
44
+ for (const child of node.children ?? []) {
45
+ const direction = nodeDirection(child);
46
+ if (direction != null) {
47
+ return direction;
48
+ }
49
+ }
50
+ return null;
51
+ }
52
+
53
+ /**
54
+ * The direction of a prose block's own text. A list item and a blockquote read
55
+ * everything under them, nested lists included, so a nested step resolves
56
+ * against the item that holds it.
57
+ */
58
+ export function markdownBlockDirection(
59
+ node: DirectionalNode,
60
+ ): 'ltr' | 'rtl' | undefined {
61
+ return nodeDirection(node) ?? undefined;
62
+ }
63
+
64
+ /** The provider's direction, and the direction of the block around this one. */
65
+ export interface BlockDirectionScope {
66
+ readonly provider: 'ltr' | 'rtl';
67
+ readonly around: 'ltr' | 'rtl';
68
+ }
69
+
70
+ /**
71
+ * The `dir` for a prose block or a table cell. A block with no direction of
72
+ * its own takes the provider's. It needs the attribute only where the block
73
+ * around it reads the other way; elsewhere it inherits the same direction.
74
+ */
75
+ export function blockDirection(
76
+ node: DirectionalNode,
77
+ scope: BlockDirectionScope | undefined,
78
+ ): 'ltr' | 'rtl' | undefined {
79
+ const own = markdownBlockDirection(node);
80
+ if (own != null) {
81
+ return own;
82
+ }
83
+ return scope != null && scope.around !== scope.provider
84
+ ? scope.provider
85
+ : undefined;
86
+ }
87
+
88
+ /** The scope for the blocks inside a quote or a list item. */
89
+ export function innerDirectionScope(
90
+ node: DirectionalNode,
91
+ scope: BlockDirectionScope | undefined,
92
+ ): BlockDirectionScope | undefined {
93
+ if (scope == null) {
94
+ return undefined;
95
+ }
96
+ return {
97
+ provider: scope.provider,
98
+ around: markdownBlockDirection(node) ?? scope.provider,
99
+ };
100
+ }
@@ -113,6 +113,8 @@ interface HeadingLinksRendererProps {
113
113
  readonly contentAlign: 'start' | 'center';
114
114
  readonly headingTextStyle: StyleXStyles;
115
115
  readonly blockSpacingStyle: StyleXStyles;
116
+ /** The heading's own direction; the copy control follows its inline end. */
117
+ readonly dir?: 'ltr' | 'rtl';
116
118
  }
117
119
 
118
120
  function isUnmodifiedPrimaryActivation(
@@ -137,6 +139,7 @@ export function HeadingLinksRenderer({
137
139
  contentAlign,
138
140
  headingTextStyle,
139
141
  blockSpacingStyle,
142
+ dir,
140
143
  }: HeadingLinksRendererProps): ReactElement {
141
144
  const t = useComponentTranslator();
142
145
  const copiedLabel = t('@astryx.markdownHeadingLinks.copied');
@@ -163,6 +166,7 @@ export function HeadingLinksRenderer({
163
166
 
164
167
  return (
165
168
  <div
169
+ dir={dir}
166
170
  {...mergeProps(
167
171
  getContainerProps(),
168
172
  stylex.props(
@@ -9,7 +9,7 @@
9
9
  * @position Internal context; consumed by MetadataList.tsx and MetadataListItem.tsx
10
10
  */
11
11
 
12
- import {createLayerScopedContext as createContext} from '../Layer/layerScopedContext';
12
+ import {createLayerScopedContext} from '../Layer/layerScopedContext';
13
13
 
14
14
  export interface MetadataListLabelConfig {
15
15
  position?: 'start' | 'top';
@@ -22,5 +22,9 @@ export interface MetadataListContextValue {
22
22
  }
23
23
 
24
24
  export const MetadataListContext =
25
- createContext<MetadataListContextValue | null>(null);
25
+ createLayerScopedContext<MetadataListContextValue | null>(
26
+ 'MetadataListContext',
27
+ 1,
28
+ null,
29
+ );
26
30
  MetadataListContext.displayName = 'MetadataListContext';
@@ -12,8 +12,9 @@
12
12
  * - /packages/core/src/NavMenu/index.ts
13
13
  */
14
14
 
15
- import {createContext, use} from 'react';
15
+ import {use} from 'react';
16
16
  import {createLayerScopedContext} from '../Layer/layerScopedContext';
17
+ import {createSharedContext} from '../utils/sharedContext';
17
18
 
18
19
  export type NavHeadingMenuSize = 'sm' | 'md' | 'lg';
19
20
 
@@ -27,7 +28,11 @@ export interface NavHeadingCloseContextValue {
27
28
  }
28
29
 
29
30
  export const NavHeadingCloseContext =
30
- createContext<NavHeadingCloseContextValue | null>(null);
31
+ createSharedContext<NavHeadingCloseContextValue | null>(
32
+ 'NavHeadingCloseContext',
33
+ 1,
34
+ null,
35
+ );
31
36
  NavHeadingCloseContext.displayName = 'NavHeadingCloseContext';
32
37
 
33
38
  export function useNavHeadingCloseContext(): NavHeadingCloseContextValue | null {
@@ -40,9 +45,9 @@ export function useNavHeadingCloseContext(): NavHeadingCloseContextValue | null
40
45
  * expanded SideNavHeading, FR7). NavHeadingMenu calls it for a mouse released
41
46
  * outside, never on an item's selection.
42
47
  */
43
- export const NavHeadingDismissContext = createContext<{
48
+ export const NavHeadingDismissContext = createSharedContext<{
44
49
  dismiss: () => void;
45
- } | null>(null);
50
+ } | null>('NavHeadingDismissContext', 1, null);
46
51
  NavHeadingDismissContext.displayName = 'NavHeadingDismissContext';
47
52
 
48
53
  /**
@@ -55,7 +60,11 @@ export interface NavHeadingMenuContextValue {
55
60
  }
56
61
 
57
62
  export const NavHeadingMenuContext =
58
- createLayerScopedContext<NavHeadingMenuContextValue | null>(null);
63
+ createLayerScopedContext<NavHeadingMenuContextValue | null>(
64
+ 'NavHeadingMenuContext',
65
+ 1,
66
+ null,
67
+ );
59
68
  NavHeadingMenuContext.displayName = 'NavHeadingMenuContext';
60
69
 
61
70
  export function useNavHeadingMenuContext(): NavHeadingMenuContextValue | null {
@@ -61,7 +61,11 @@ import {matchesMediaQuery, watchMediaQuery} from '../utils/coarsePointer';
61
61
  import type {BaseProps} from '../BaseProps';
62
62
  import {FALLBACK_CLOSE_SELECTOR, usePopoverInternal} from './usePopover';
63
63
  import {usePopoverSurfaceMotion} from './PopoverTouch';
64
- import {FOCUSABLE_SELECTOR} from '../hooks/focusableSelector';
64
+ import {
65
+ FOCUSABLE_SELECTOR,
66
+ isDisabledWithin,
67
+ preferTabStops,
68
+ } from '../hooks/focusableSelector';
65
69
  import type {LayerAlignment, LayerPlacement} from '../Layer/useLayer';
66
70
  import {layerAnimations} from '../Layer/layerAnimations.stylex';
67
71
  import {layerViewportInset} from '../Layer/layerViewportInset.stylex';
@@ -645,12 +649,12 @@ export function Popover({
645
649
  sheetPanelRef.current = panel;
646
650
  setSheetPanelAttached(panel != null);
647
651
  }, []);
648
- // Focus enters the sheet at each opening as it enters the anchored popover
649
- // (FR2): a caller's `[data-autofocus]`, else the first genuine content
650
- // control (never the injected fallback close, never BottomSheet's own
651
- // scroll area), else that scroll area: the sheet's labelled surface, which
652
- // paints the shared focus ring under the keyboard. It runs a frame after
653
- // BottomSheet presents the dialog; BottomSheet is unchanged.
652
+ // Focus enters the sheet at each opening, as in the anchored popover (FR2).
653
+ // A caller's `[data-autofocus]` wins. Else the first enabled tab stop in the
654
+ // content takes focus: never the injected fallback close or BottomSheet's
655
+ // own scroll area. Else the scroll area does: it is the sheet's labelled
656
+ // surface and shows the keyboard focus ring. This runs a frame after
657
+ // BottomSheet presents the dialog.
654
658
  useEffect(() => {
655
659
  if (!isSheetOpen || !isSheetPanelAttached) {
656
660
  return;
@@ -675,15 +679,18 @@ export function Popover({
675
679
  }
676
680
  const target =
677
681
  sheetPanel.querySelector<HTMLElement>('[data-autofocus]') ??
678
- Array.from(
679
- sheetPanel.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
680
- ).find(
681
- element =>
682
- // BottomSheet's scroll area is the panel's own child; content
683
- // sits inside it.
684
- element.parentElement !== sheetPanel &&
685
- element.closest(FALLBACK_CLOSE_SELECTOR) == null,
686
- );
682
+ preferTabStops(
683
+ Array.from(
684
+ sheetPanel.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
685
+ ).filter(
686
+ element =>
687
+ // BottomSheet's scroll area is the panel's own child; content
688
+ // sits inside it.
689
+ element.parentElement !== sheetPanel &&
690
+ element.closest(FALLBACK_CLOSE_SELECTOR) == null &&
691
+ !isDisabledWithin(element, sheetPanel),
692
+ ),
693
+ )[0];
687
694
  if (target != null) {
688
695
  target.focus({preventScroll: true});
689
696
  return;
@@ -30,7 +30,11 @@ import {
30
30
  shadowVars,
31
31
  } from '../theme/tokens.stylex';
32
32
  import {Button} from '../Button';
33
- import {FOCUSABLE_SELECTOR} from '../hooks/focusableSelector';
33
+ import {
34
+ FOCUSABLE_SELECTOR,
35
+ isDisabledWithin,
36
+ preferTabStops,
37
+ } from '../hooks/focusableSelector';
34
38
  import {rtlStyles} from '../utils';
35
39
  import {useDevWarning} from '../hooks/useDevWarning';
36
40
  import {focusOutlineProps} from '../utils/focusOutline.stylex';
@@ -66,9 +70,15 @@ function attemptFocus(element: HTMLElement): boolean {
66
70
  }
67
71
 
68
72
  function focusFirstContentControl(container: HTMLElement): boolean {
69
- const focusable = Array.from(
70
- container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
71
- ).filter(element => element.closest(FALLBACK_CLOSE_SELECTOR) == null);
73
+ const focusable = preferTabStops(
74
+ Array.from(
75
+ container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
76
+ ).filter(
77
+ element =>
78
+ element.closest(FALLBACK_CLOSE_SELECTOR) == null &&
79
+ !isDisabledWithin(element, container),
80
+ ),
81
+ );
72
82
  for (const element of focusable) {
73
83
  if (attemptFocus(element)) {
74
84
  return true;
@@ -600,6 +610,7 @@ function usePopoverImplementation(
600
610
  role === 'dialog' && !dialogLabel,
601
611
  );
602
612
 
613
+ const isDialogShown = role === 'dialog' && layer.isOpen;
603
614
  // Wrapped render function that includes surface styles and optional hidden close button
604
615
  const render = useCallback(
605
616
  (children: ReactNode, props?: ContextRenderProps): ReactNode => {
@@ -616,9 +627,11 @@ function usePopoverImplementation(
616
627
  <LayerDepthProvider>
617
628
  <div
618
629
  ref={contentRef}
619
- role={role === 'dialog' ? 'dialog' : undefined}
620
- aria-modal={role === 'dialog' && isModal ? true : undefined}
621
- aria-label={role === 'dialog' ? dialogLabel : undefined}
630
+ // A closed surface stays mounted but hidden. It carries no dialog
631
+ // role or name, so selectors find no hidden dialog.
632
+ role={isDialogShown ? 'dialog' : undefined}
633
+ aria-modal={isDialogShown && isModal ? true : undefined}
634
+ aria-label={isDialogShown ? dialogLabel : undefined}
622
635
  tabIndex={role === 'dialog' ? -1 : undefined}
623
636
  {...mergeProps(
624
637
  {...surfaceProps, className: surfaceClassName},
@@ -662,6 +675,7 @@ function usePopoverImplementation(
662
675
  closeButtonLabel,
663
676
  contentRef,
664
677
  dialogLabel,
678
+ isDialogShown,
665
679
  role,
666
680
  isModal,
667
681
  xstyle,
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import {RadioListReasonContext} from './RadioListReasonContext';
20
- import {createLayerScopedContext as createContext} from '../Layer/layerScopedContext';
20
+ import {createLayerScopedContext} from '../Layer/layerScopedContext';
21
21
  import React, {
22
22
  useCallback,
23
23
  useId,
@@ -63,9 +63,12 @@ export interface RadioListContextValue {
63
63
  status?: InputStatus;
64
64
  }
65
65
 
66
- export const RadioListContext = createContext<RadioListContextValue | null>(
67
- null,
68
- );
66
+ export const RadioListContext =
67
+ createLayerScopedContext<RadioListContextValue | null>(
68
+ 'RadioListContext',
69
+ 1,
70
+ null,
71
+ );
69
72
  RadioListContext.displayName = 'RadioListContext';
70
73
 
71
74
  const styles = stylex.create({
@@ -21,5 +21,5 @@ import {createLayerScopedContext} from '../Layer/layerScopedContext';
21
21
  // group is not a radio of it.
22
22
  export const RadioListReasonContext = createLayerScopedContext<
23
23
  string | undefined
24
- >(undefined);
24
+ >('RadioListReasonContext', 1, undefined);
25
25
  RadioListReasonContext.displayName = 'RadioListReasonContext';
@@ -122,8 +122,28 @@ export const docs = {
122
122
  { guidance: true, description: 'Add dividers between same-background sections that need separation.' },
123
123
  { guidance: true, description: 'Combine with a heading + Stack for a typical page section pattern.' },
124
124
  { guidance: false, description: 'Use Card when you mean Section. Cards are for discrete items (one notification, one profile). Sections are for page regions.' },
125
+ { guidance: true, description: "To center a Section, set marginInlineStart and marginInlineEnd to 'auto' in xstyle. If Astryx source is compiled in your app's own StyleX pass, the marginInline shorthand loses to Section's own inline margins." },
125
126
  ],
126
127
  },
128
+ examples: [
129
+ {
130
+ label: 'Center a Section with a maximum width',
131
+ code: `import * as stylex from '@stylexjs/stylex';
132
+ import {Section} from '@astryxdesign/core/Section';
133
+
134
+ const styles = stylex.create({
135
+ centered: {marginInlineStart: 'auto', marginInlineEnd: 'auto'},
136
+ });
137
+
138
+ function Page({children}: {children: React.ReactNode}) {
139
+ return (
140
+ <Section maxWidth={1280} xstyle={styles.centered}>
141
+ {children}
142
+ </Section>
143
+ );
144
+ }`,
145
+ },
146
+ ],
127
147
  };
128
148
 
129
149
  /** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
@@ -230,6 +250,7 @@ export const docsZh = {
230
250
  { guidance: true, description: 'Add dividers between same-background sections that need separation.' },
231
251
  { guidance: true, description: 'Combine with a heading + Stack for a typical page section pattern.' },
232
252
  { guidance: false, description: 'Use Card when you mean Section. Cards are for discrete items (one notification, one profile). Sections are for page regions.' },
253
+ { guidance: true, description: '要让 Section 居中,在 xstyle 中把 marginInlineStart 和 marginInlineEnd 设为 \'auto\'。如果 Astryx 源码在你的应用自己的 StyleX 编译中处理,marginInline 简写会输给 Section 自身的行内外边距。' },
233
254
  ],
234
255
  },
235
256
  };
@@ -248,6 +269,7 @@ export const docsDense = {
248
269
  { guidance: true, description: 'Add dividers between same-background sections that need separation.' },
249
270
  { guidance: true, description: 'Combine w/ heading + Stack for typical page section pattern.' },
250
271
  { guidance: false, description: 'Use Card when you mean Section. Cards = discrete items (one notification, one profile). Sections = page regions.' },
272
+ { guidance: true, description: "Center: xstyle marginInlineStart + marginInlineEnd 'auto'. If Astryx source goes through your app's StyleX pass, marginInline shorthand loses to Section's inline margins." },
251
273
  ],
252
274
  },
253
275
  propDescriptions: {