@astryxdesign/core 0.7.7-canary.c0929c8 → 0.7.7-canary.c19ca12

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 (472) hide show
  1. package/dist/AlertDialog/AlertDialog.d.ts +4 -1
  2. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  3. package/dist/AlertDialog/AlertDialog.js +36 -6
  4. package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +13 -0
  5. package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -0
  6. package/dist/AppShell/useCloseMobileDrawerOnActivate.js +45 -0
  7. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  8. package/dist/BottomSheet/BottomSheet.js +79 -9
  9. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  10. package/dist/BottomSheet/BottomSheetPanel.js +23 -4
  11. package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
  12. package/dist/BottomSheet/bottomSheetStack.js +5 -4
  13. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  14. package/dist/BottomSheet/useSheetGestures.js +3 -1
  15. package/dist/Breadcrumbs/BreadcrumbItem.d.ts +2 -1
  16. package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
  17. package/dist/Breadcrumbs/BreadcrumbItem.js +7 -3
  18. package/dist/Button/Button.d.ts.map +1 -1
  19. package/dist/Button/Button.js +47 -3
  20. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  21. package/dist/CheckboxInput/CheckboxInput.js +13 -2
  22. package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
  23. package/dist/CheckboxList/CheckboxList.js +7 -1
  24. package/dist/CheckboxList/CheckboxListContext.d.ts +6 -0
  25. package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
  26. package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
  27. package/dist/CheckboxList/CheckboxListItem.js +10 -2
  28. package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
  29. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  30. package/dist/ComplexSelector/ComplexSelector.js +14 -4
  31. package/dist/ContextMenu/ContextMenu.js +2 -2
  32. package/dist/DateInput/DateInput.d.ts.map +1 -1
  33. package/dist/DateInput/DateInput.js +5 -2
  34. package/dist/DateInput/MonthScroller.d.ts.map +1 -1
  35. package/dist/DateInput/MonthScroller.js +13 -27
  36. package/dist/DateInput/Wheel.d.ts.map +1 -1
  37. package/dist/DateInput/Wheel.js +22 -41
  38. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  39. package/dist/DateTimeInput/DateTimeInput.js +5 -2
  40. package/dist/Dialog/Dialog.d.ts.map +1 -1
  41. package/dist/Dialog/Dialog.js +23 -45
  42. package/dist/Drawer/Drawer.d.ts.map +1 -1
  43. package/dist/Drawer/Drawer.js +15 -11
  44. package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
  45. package/dist/Drawer/useDrawerDialogPresence.js +5 -1
  46. package/dist/Field/Field.js +2 -2
  47. package/dist/Field/PanelSearchInput.d.ts +9 -1
  48. package/dist/Field/PanelSearchInput.d.ts.map +1 -1
  49. package/dist/Field/PanelSearchInput.js +3 -1
  50. package/dist/HoverCard/HoverCard.d.ts +4 -3
  51. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  52. package/dist/HoverCard/HoverCard.js +27 -2
  53. package/dist/HoverCard/useHoverCard.d.ts +5 -4
  54. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  55. package/dist/HoverCard/useHoverCard.js +17 -31
  56. package/dist/Icon/Icon.d.ts +5 -1
  57. package/dist/Icon/Icon.d.ts.map +1 -1
  58. package/dist/Icon/Icon.js +5 -2
  59. package/dist/InfoTip/InfoTip.d.ts +63 -0
  60. package/dist/InfoTip/InfoTip.d.ts.map +1 -0
  61. package/dist/InfoTip/InfoTip.js +126 -0
  62. package/dist/InfoTip/index.d.ts +10 -0
  63. package/dist/InfoTip/index.d.ts.map +1 -0
  64. package/dist/InfoTip/index.js +12 -0
  65. package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
  66. package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
  67. package/dist/Layer/layerAnimations.stylex.js +25 -20
  68. package/dist/Layer/useBackdropPress.d.ts +27 -0
  69. package/dist/Layer/useBackdropPress.d.ts.map +1 -0
  70. package/dist/Layer/useBackdropPress.js +53 -0
  71. package/dist/Layer/usePressPin.d.ts +20 -10
  72. package/dist/Layer/usePressPin.d.ts.map +1 -1
  73. package/dist/Layer/usePressPin.js +66 -18
  74. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  75. package/dist/Lightbox/Lightbox.js +18 -0
  76. package/dist/MobileNav/MobileNav.js +0 -1
  77. package/dist/MultiSelector/hooks.d.ts.map +1 -1
  78. package/dist/MultiSelector/hooks.js +2 -4
  79. package/dist/Outline/Outline.d.ts +2 -4
  80. package/dist/Outline/Outline.d.ts.map +1 -1
  81. package/dist/Outline/Outline.js +4 -52
  82. package/dist/Outline/useOutlineFromMarkdown.d.ts.map +1 -1
  83. package/dist/Outline/useOutlineFromMarkdown.js +1 -0
  84. package/dist/Outline/useScrollSpy.js +3 -3
  85. package/dist/PowerSearch/PowerSearch.d.ts +36 -3
  86. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  87. package/dist/PowerSearch/PowerSearch.js +571 -302
  88. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
  89. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
  90. package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
  91. package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
  92. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  93. package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
  94. package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
  95. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  96. package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
  97. package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
  98. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  99. package/dist/PowerSearch/formatFilterValue.js +11 -1
  100. package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
  101. package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
  102. package/dist/PowerSearch/formatTokenValue.js +160 -0
  103. package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
  104. package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
  105. package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
  106. package/dist/RadioList/RadioList.d.ts.map +1 -1
  107. package/dist/RadioList/RadioList.js +8 -2
  108. package/dist/RadioList/RadioListItem.d.ts +1 -1
  109. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  110. package/dist/RadioList/RadioListItem.js +5 -3
  111. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  112. package/dist/Resizable/ResizeHandle.js +118 -260
  113. package/dist/Resizable/resizeGesture.d.ts +91 -0
  114. package/dist/Resizable/resizeGesture.d.ts.map +1 -0
  115. package/dist/Resizable/resizeGesture.js +251 -0
  116. package/dist/SegmentedControl/SegmentedControl.d.ts +3 -1
  117. package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  118. package/dist/SegmentedControl/SegmentedControl.js +115 -8
  119. package/dist/SegmentedControl/SegmentedControlContext.d.ts +6 -0
  120. package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  121. package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -0
  122. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  123. package/dist/SegmentedControl/SegmentedControlItem.js +8 -1
  124. package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +357 -0
  125. package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -0
  126. package/dist/SegmentedControl/useSegmentedSelectionMotion.js +1349 -0
  127. package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +70 -0
  128. package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -0
  129. package/dist/SegmentedControl/useSegmentedTouchTracking.js +264 -0
  130. package/dist/Selector/Selector.d.ts.map +1 -1
  131. package/dist/Selector/Selector.js +96 -67
  132. package/dist/Selector/optionShape.d.ts +24 -0
  133. package/dist/Selector/optionShape.d.ts.map +1 -0
  134. package/dist/Selector/optionShape.js +48 -0
  135. package/dist/Selector/selectableOptionEntries.d.ts +20 -0
  136. package/dist/Selector/selectableOptionEntries.d.ts.map +1 -0
  137. package/dist/Selector/selectableOptionEntries.js +38 -0
  138. package/dist/Selector/utils.d.ts +2 -17
  139. package/dist/Selector/utils.d.ts.map +1 -1
  140. package/dist/Selector/utils.js +3 -51
  141. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  142. package/dist/SideNav/SideNavItem.js +3 -9
  143. package/dist/Slider/sliderTouchController.js +2 -2
  144. package/dist/Spinner/Spinner.d.ts +1 -1
  145. package/dist/Spinner/Spinner.d.ts.map +1 -1
  146. package/dist/Spinner/Spinner.js +60 -58
  147. package/dist/Switch/switchTouch.d.ts +0 -7
  148. package/dist/Switch/switchTouch.d.ts.map +1 -1
  149. package/dist/Switch/switchTouch.js +2 -10
  150. package/dist/Switch/useSwitchTouch.d.ts +2 -11
  151. package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
  152. package/dist/Switch/useSwitchTouch.js +35 -93
  153. package/dist/Table/BaseTable.d.ts.map +1 -1
  154. package/dist/Table/BaseTable.js +29 -8
  155. package/dist/TextInput/TextInput.d.ts +2 -2
  156. package/dist/TextInput/TextInput.d.ts.map +1 -1
  157. package/dist/TextInput/TextInput.js +10 -7
  158. package/dist/Toast/Toast.d.ts +11 -1
  159. package/dist/Toast/Toast.d.ts.map +1 -1
  160. package/dist/Toast/Toast.js +30 -15
  161. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  162. package/dist/Toast/ToastViewport.js +94 -34
  163. package/dist/Toast/types.d.ts +9 -3
  164. package/dist/Toast/types.d.ts.map +1 -1
  165. package/dist/Token/Token.d.ts +2 -2
  166. package/dist/Token/Token.d.ts.map +1 -1
  167. package/dist/Token/Token.js +13 -4
  168. package/dist/Token/TokenNamingContext.d.ts +14 -0
  169. package/dist/Token/TokenNamingContext.d.ts.map +1 -0
  170. package/dist/Token/TokenNamingContext.js +23 -0
  171. package/dist/Tokenizer/Tokenizer.d.ts +46 -59
  172. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  173. package/dist/Tokenizer/Tokenizer.js +40 -57
  174. package/dist/Tokenizer/TokenizerBottomSheet.d.ts +25 -28
  175. package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -1
  176. package/dist/Tokenizer/TokenizerBottomSheet.js +157 -54
  177. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +3 -0
  178. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
  179. package/dist/Tokenizer/TokenizerItemRemovableContext.js +19 -0
  180. package/dist/Tooltip/Tooltip.d.ts +25 -30
  181. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  182. package/dist/Tooltip/Tooltip.js +24 -5
  183. package/dist/Tooltip/index.d.ts +1 -1
  184. package/dist/Tooltip/index.d.ts.map +1 -1
  185. package/dist/Tooltip/useTooltip.d.ts +45 -28
  186. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  187. package/dist/Tooltip/useTooltip.js +52 -59
  188. package/dist/TopNav/TopNavItem.d.ts.map +1 -1
  189. package/dist/TopNav/TopNavItem.js +4 -7
  190. package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
  191. package/dist/TopNav/TopNavMegaMenuItem.js +4 -7
  192. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  193. package/dist/TopNav/TopNavMenu.js +4 -7
  194. package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
  195. package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
  196. package/dist/animator/createAnimator.d.ts +98 -0
  197. package/dist/animator/createAnimator.d.ts.map +1 -0
  198. package/dist/animator/createAnimator.js +259 -0
  199. package/dist/astryx.css +96 -7
  200. package/dist/gestures/GestureHost.d.ts +27 -1
  201. package/dist/gestures/GestureHost.d.ts.map +1 -1
  202. package/dist/gestures/GestureHost.js +157 -21
  203. package/dist/gestures/PressTracker.d.ts.map +1 -1
  204. package/dist/gestures/PressTracker.js +4 -3
  205. package/dist/hooks/actionGroupTracker.d.ts +7 -4
  206. package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
  207. package/dist/hooks/actionGroupTracker.js +19 -56
  208. package/dist/hooks/index.d.ts +1 -0
  209. package/dist/hooks/index.d.ts.map +1 -1
  210. package/dist/hooks/index.js +1 -0
  211. package/dist/hooks/pressGroupContext.d.ts +6 -0
  212. package/dist/hooks/pressGroupContext.d.ts.map +1 -0
  213. package/dist/hooks/pressGroupContext.js +20 -0
  214. package/dist/hooks/useActionGroupTracking.d.ts +53 -0
  215. package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
  216. package/dist/hooks/useActionGroupTracking.js +174 -0
  217. package/dist/hooks/useAnimator.d.ts +41 -0
  218. package/dist/hooks/useAnimator.d.ts.map +1 -0
  219. package/dist/hooks/useAnimator.js +70 -0
  220. package/dist/hooks/useAttachment.d.ts +1 -1
  221. package/dist/hooks/useAttachment.js +1 -1
  222. package/dist/hooks/useHighlightedOptionScroll.d.ts +11 -1
  223. package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
  224. package/dist/hooks/useHighlightedOptionScroll.js +112 -11
  225. package/dist/hooks/useInputStatusIcon.d.ts +1 -1
  226. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  227. package/dist/hooks/useInputStatusIcon.js +2 -2
  228. package/dist/hooks/useLongPress.d.ts +6 -2
  229. package/dist/hooks/useLongPress.d.ts.map +1 -1
  230. package/dist/hooks/useLongPress.js +95 -15
  231. package/dist/hooks/useMediaQuery.d.ts +2 -1
  232. package/dist/hooks/useMediaQuery.d.ts.map +1 -1
  233. package/dist/hooks/useMediaQuery.js +7 -4
  234. package/dist/hooks/useMenuPress.d.ts.map +1 -1
  235. package/dist/hooks/useMenuPress.js +4 -2
  236. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts +8 -0
  237. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts.map +1 -0
  238. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.js +12 -0
  239. package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts.map +1 -1
  240. package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.js +1 -0
  241. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
  242. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
  243. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
  244. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
  245. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
  246. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
  247. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
  248. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
  249. package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.d.ts.map +1 -1
  250. package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.js +7 -1
  251. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  252. package/dist/i18n/generated-locales/en.generated.js +33 -1
  253. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  254. package/dist/i18n/generated-locales/pseudo.generated.js +33 -1
  255. package/dist/index.d.ts +2 -0
  256. package/dist/index.d.ts.map +1 -1
  257. package/dist/index.js +5 -0
  258. package/dist/internal/SheetConfirmation.d.ts +11 -0
  259. package/dist/internal/SheetConfirmation.d.ts.map +1 -0
  260. package/dist/internal/SheetConfirmation.js +92 -0
  261. package/dist/internal/indicatorPress.stylex.d.ts +20 -0
  262. package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
  263. package/dist/internal/indicatorPress.stylex.js +26 -0
  264. package/dist/internal/sheetDraft.d.ts +35 -0
  265. package/dist/internal/sheetDraft.d.ts.map +1 -0
  266. package/dist/internal/sheetDraft.js +65 -0
  267. package/dist/internal/touch-sheet.d.ts +21 -0
  268. package/dist/internal/touch-sheet.d.ts.map +1 -0
  269. package/dist/internal/touch-sheet.js +19 -0
  270. package/dist/internal/useDismissSearchOnTouchDrag.d.ts +24 -0
  271. package/dist/internal/useDismissSearchOnTouchDrag.d.ts.map +1 -0
  272. package/dist/internal/useDismissSearchOnTouchDrag.js +56 -0
  273. package/dist/motion/animator.d.ts +14 -14
  274. package/dist/motion/animator.d.ts.map +1 -1
  275. package/dist/motion/animator.js +41 -18
  276. package/dist/motion/reducedMotion.d.ts +24 -0
  277. package/dist/motion/reducedMotion.d.ts.map +1 -1
  278. package/dist/motion/reducedMotion.js +78 -1
  279. package/dist/motion/roles.d.ts +7 -1
  280. package/dist/motion/roles.d.ts.map +1 -1
  281. package/dist/motion/roles.js +20 -1
  282. package/dist/motion/uikit/alert.d.ts +41 -0
  283. package/dist/motion/uikit/alert.d.ts.map +1 -0
  284. package/dist/motion/uikit/alert.js +43 -0
  285. package/dist/motion/uikit/index.d.ts +6 -5
  286. package/dist/motion/uikit/index.d.ts.map +1 -1
  287. package/dist/motion/uikit/index.js +6 -5
  288. package/dist/motion/uikit/segmented.d.ts +55 -0
  289. package/dist/motion/uikit/segmented.d.ts.map +1 -0
  290. package/dist/motion/uikit/segmented.js +77 -0
  291. package/dist/motion/uikit/springs.d.ts +0 -18
  292. package/dist/motion/uikit/springs.d.ts.map +1 -1
  293. package/dist/motion/uikit/springs.js +5 -21
  294. package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
  295. package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
  296. package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
  297. package/dist/privateAttributes/segmentTitle.stylex.d.ts +5 -0
  298. package/dist/privateAttributes/segmentTitle.stylex.d.ts.map +1 -0
  299. package/dist/privateAttributes/segmentTitle.stylex.js +22 -0
  300. package/dist/utils/browserClickWait.d.ts +35 -0
  301. package/dist/utils/browserClickWait.d.ts.map +1 -0
  302. package/dist/utils/browserClickWait.js +123 -0
  303. package/dist/utils/clickGuard.d.ts +14 -1
  304. package/dist/utils/clickGuard.d.ts.map +1 -1
  305. package/dist/utils/clickGuard.js +46 -1
  306. package/dist/utils/dateParser.d.ts.map +1 -1
  307. package/dist/utils/dateParser.js +12 -0
  308. package/dist/utils/focusReturn.d.ts +15 -0
  309. package/dist/utils/focusReturn.d.ts.map +1 -1
  310. package/dist/utils/focusReturn.js +28 -0
  311. package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
  312. package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
  313. package/dist/utils/interactionOverlay.stylex.js +3 -2
  314. package/dist/utils/pressFeedback.d.ts.map +1 -1
  315. package/dist/utils/pressFeedback.js +19 -6
  316. package/dist/utils/triggerFocus.d.ts +36 -0
  317. package/dist/utils/triggerFocus.d.ts.map +1 -0
  318. package/dist/utils/triggerFocus.js +65 -0
  319. package/locales/en.json +128 -0
  320. package/locales/pseudo.json +96 -0
  321. package/package.json +18 -8
  322. package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
  323. package/src/AlertDialog/AlertDialog.tsx +37 -5
  324. package/src/AppShell/useCloseMobileDrawerOnActivate.ts +52 -0
  325. package/src/BottomSheet/BottomSheet.tsx +95 -10
  326. package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
  327. package/src/BottomSheet/bottomSheetStack.ts +8 -4
  328. package/src/BottomSheet/useSheetGestures.ts +3 -1
  329. package/src/Breadcrumbs/BreadcrumbItem.tsx +13 -3
  330. package/src/Button/Button.tsx +63 -5
  331. package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
  332. package/src/CheckboxInput/CheckboxInput.tsx +36 -9
  333. package/src/CheckboxList/CheckboxList.doc.mjs +4 -2
  334. package/src/CheckboxList/CheckboxList.tsx +6 -0
  335. package/src/CheckboxList/CheckboxListContext.tsx +6 -0
  336. package/src/CheckboxList/CheckboxListItem.tsx +11 -2
  337. package/src/ComplexSelector/ComplexSelector.tsx +20 -5
  338. package/src/ContextMenu/ContextMenu.tsx +2 -2
  339. package/src/DateInput/DateInput.tsx +8 -2
  340. package/src/DateInput/MonthScroller.tsx +18 -22
  341. package/src/DateInput/Wheel.tsx +30 -32
  342. package/src/DateTimeInput/DateTimeInput.tsx +8 -2
  343. package/src/Dialog/Dialog.tsx +54 -45
  344. package/src/Drawer/Drawer.tsx +28 -11
  345. package/src/Drawer/useDrawerDialogPresence.ts +5 -1
  346. package/src/Field/Field.tsx +2 -2
  347. package/src/Field/PanelSearchInput.tsx +11 -0
  348. package/src/HoverCard/HoverCard.doc.mjs +4 -2
  349. package/src/HoverCard/HoverCard.tsx +35 -4
  350. package/src/HoverCard/useHoverCard.doc.mjs +178 -36
  351. package/src/HoverCard/useHoverCard.tsx +46 -52
  352. package/src/Icon/Icon.doc.mjs +49 -8
  353. package/src/Icon/Icon.tsx +15 -7
  354. package/src/InfoTip/InfoTip.doc.mjs +192 -0
  355. package/src/InfoTip/InfoTip.tsx +186 -0
  356. package/src/InfoTip/index.ts +14 -0
  357. package/src/Layer/layerAnimations.stylex.ts +24 -16
  358. package/src/Layer/useBackdropPress.ts +81 -0
  359. package/src/Layer/usePressPin.ts +86 -26
  360. package/src/Lightbox/Lightbox.tsx +18 -0
  361. package/src/MobileNav/MobileNav.tsx +1 -1
  362. package/src/MultiSelector/hooks.ts +2 -4
  363. package/src/Outline/Outline.doc.mjs +177 -51
  364. package/src/Outline/Outline.tsx +5 -57
  365. package/src/Outline/useOutlineFromMarkdown.doc.mjs +157 -0
  366. package/src/Outline/useOutlineFromMarkdown.ts +1 -0
  367. package/src/Outline/useScrollSpy.ts +3 -3
  368. package/src/PowerSearch/PowerSearch.doc.mjs +55 -6
  369. package/src/PowerSearch/PowerSearch.tsx +798 -324
  370. package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
  371. package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
  372. package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
  373. package/src/PowerSearch/formatFilterValue.ts +18 -1
  374. package/src/PowerSearch/formatTokenValue.ts +215 -0
  375. package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
  376. package/src/RadioList/RadioList.doc.mjs +4 -2
  377. package/src/RadioList/RadioList.tsx +7 -2
  378. package/src/RadioList/RadioListItem.tsx +5 -3
  379. package/src/Resizable/ResizeHandle.tsx +133 -328
  380. package/src/Resizable/resizeGesture.ts +368 -0
  381. package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
  382. package/src/SegmentedControl/SegmentedControl.tsx +179 -5
  383. package/src/SegmentedControl/SegmentedControlContext.ts +6 -0
  384. package/src/SegmentedControl/SegmentedControlItem.tsx +12 -1
  385. package/src/SegmentedControl/useSegmentedSelectionMotion.ts +1640 -0
  386. package/src/SegmentedControl/useSegmentedTouchTracking.ts +308 -0
  387. package/src/Selector/Selector.tsx +136 -89
  388. package/src/Selector/optionShape.ts +64 -0
  389. package/src/Selector/selectableOptionEntries.ts +39 -0
  390. package/src/Selector/utils.ts +9 -68
  391. package/src/SideNav/SideNavItem.tsx +3 -7
  392. package/src/Slider/sliderTouchController.ts +2 -2
  393. package/src/Spinner/Spinner.tsx +77 -63
  394. package/src/Switch/switchTouch.ts +2 -10
  395. package/src/Switch/useSwitchTouch.ts +38 -104
  396. package/src/Table/BaseTable.tsx +46 -12
  397. package/src/TextInput/TextInput.tsx +11 -10
  398. package/src/Toast/Toast.doc.mjs +4 -3
  399. package/src/Toast/Toast.tsx +57 -32
  400. package/src/Toast/ToastViewport.tsx +121 -35
  401. package/src/Toast/types.ts +9 -3
  402. package/src/Token/Token.tsx +15 -4
  403. package/src/Token/TokenNamingContext.ts +28 -0
  404. package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
  405. package/src/Tokenizer/Tokenizer.tsx +89 -85
  406. package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
  407. package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
  408. package/src/Tooltip/Tooltip.doc.mjs +123 -54
  409. package/src/Tooltip/Tooltip.tsx +36 -39
  410. package/src/Tooltip/index.ts +0 -1
  411. package/src/Tooltip/useTooltip.doc.mjs +171 -33
  412. package/src/Tooltip/useTooltip.tsx +98 -86
  413. package/src/TopNav/TopNavItem.tsx +6 -5
  414. package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
  415. package/src/TopNav/TopNavMenu.tsx +6 -5
  416. package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
  417. package/src/Typeahead/TypeaheadItem.tsx +2 -1
  418. package/src/animator/createAnimator.doc.mjs +153 -0
  419. package/src/animator/createAnimator.ts +324 -0
  420. package/src/gestures/GestureHost.ts +198 -20
  421. package/src/gestures/PressTracker.ts +4 -3
  422. package/src/gestures/README.md +7 -1
  423. package/src/hooks/actionGroupTracker.ts +32 -61
  424. package/src/hooks/index.ts +2 -0
  425. package/src/hooks/pressGroupContext.ts +21 -0
  426. package/src/hooks/useActionGroupTracking.ts +224 -0
  427. package/src/hooks/useAnimator.doc.mjs +109 -0
  428. package/src/hooks/useAnimator.ts +67 -0
  429. package/src/hooks/useAttachment.ts +1 -1
  430. package/src/hooks/useHighlightedOptionScroll.ts +123 -15
  431. package/src/hooks/useInputStatusIcon.tsx +3 -2
  432. package/src/hooks/useLongPress.doc.mjs +2 -2
  433. package/src/hooks/useLongPress.ts +136 -15
  434. package/src/hooks/useMediaQuery.doc.mjs +2 -2
  435. package/src/hooks/useMediaQuery.ts +13 -4
  436. package/src/hooks/useMenuPress.ts +8 -2
  437. package/src/i18n/generated-english/InfoTip/InfoTip.generated.ts +13 -0
  438. package/src/i18n/generated-english/PowerSearch/PowerSearch.generated.ts +1 -0
  439. package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
  440. package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
  441. package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
  442. package/src/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.ts +7 -1
  443. package/src/i18n/generated-locales/en.generated.ts +43 -0
  444. package/src/i18n/generated-locales/pseudo.generated.ts +44 -0
  445. package/src/index.ts +14 -0
  446. package/src/internal/SheetConfirmation.tsx +101 -0
  447. package/src/internal/indicatorPress.stylex.ts +24 -0
  448. package/src/internal/sheetDraft.ts +80 -0
  449. package/src/internal/touch-sheet.ts +21 -0
  450. package/src/internal/useDismissSearchOnTouchDrag.ts +69 -0
  451. package/src/motion/MEASUREMENTS.md +7 -0
  452. package/src/motion/README.md +9 -5
  453. package/src/motion/animator.ts +61 -29
  454. package/src/motion/reducedMotion.ts +79 -1
  455. package/src/motion/roles.ts +20 -1
  456. package/src/motion/uikit/alert.ts +43 -0
  457. package/src/motion/uikit/index.ts +5 -5
  458. package/src/motion/uikit/segmented.ts +74 -0
  459. package/src/motion/uikit/springs.ts +5 -21
  460. package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
  461. package/src/privateAttributes/segmentTitle.stylex.ts +22 -0
  462. package/src/utils/browserClickWait.ts +133 -0
  463. package/src/utils/clickGuard.ts +64 -1
  464. package/src/utils/dateParser.ts +16 -0
  465. package/src/utils/focusReturn.ts +30 -0
  466. package/src/utils/interactionOverlay.stylex.ts +3 -2
  467. package/src/utils/pressFeedback.ts +19 -6
  468. package/src/utils/triggerFocus.ts +80 -0
  469. package/dist/internal/tokenizer-presentation.d.ts +0 -21
  470. package/dist/internal/tokenizer-presentation.d.ts.map +0 -1
  471. package/dist/internal/tokenizer-presentation.js +0 -21
  472. package/src/internal/tokenizer-presentation.ts +0 -25
@@ -6,8 +6,9 @@
6
6
  * @file usePressPin.ts
7
7
  * @input A hover layer's trigger, open state, show and hide, and its
8
8
  * `triggerBehavior` and `touchTrigger` options
9
- * @output usePressPin, the press toggle that pins a hover layer open;
10
- * isPressPinTrigger; stopPressPinClick; the LayerTriggerBehavior type
9
+ * @output usePressPin, the press toggle that pins a hover layer open, and
10
+ * the app hold behind useTooltip's show() and hide(); isPressPinTrigger;
11
+ * stopPressPinClick; the LayerTriggerBehavior type
11
12
  * @position Core-internal: one call per hover layer, useTooltip's. It owns
12
13
  * the layer's touch trigger, so the host makes no second touch-trigger call.
13
14
  *
@@ -35,12 +36,10 @@ import {
35
36
 
36
37
  /**
37
38
  * How the trigger opens the layer. `adaptive`, the default, previews it on
38
- * hover and focus, and a tap opens it unless the trigger acts. While
39
- * `touchTrigger` remains, it decides those taps. `hover` previews it on hover
40
- * and focus, and no touch or pen tap opens it. `toggle` pins it on every
41
- * press of a button trigger.
39
+ * hover and focus, and `touchTrigger` decides taps. `toggle` pins it on every
40
+ * press of a button trigger. Internal: InfoTip's press-to-pin uses `toggle`.
42
41
  */
43
- export type LayerTriggerBehavior = 'adaptive' | 'hover' | 'toggle';
42
+ export type LayerTriggerBehavior = 'adaptive' | 'toggle';
44
43
 
45
44
  /** The clicks a press pin answered, so the wrapper can stop them (`stopPressPinClick`). */
46
45
  const pressPinClicks = new WeakSet<Event>();
@@ -105,8 +104,18 @@ export interface UsePressPinReturn {
105
104
  isHeldOpen: () => boolean;
106
105
  /** Wires the trigger element, or unwires it with `null`. */
107
106
  attach: (element: HTMLElement | null) => void;
108
- /** Drops the pin: Escape, or a hide that came from elsewhere. */
107
+ /** Drops the pin and the app hold: Escape, or a hide from elsewhere. */
109
108
  unpin: () => void;
109
+ /**
110
+ * The app's `show()`: shows the layer and holds it open, as a pin does,
111
+ * until `release`, Escape, a press outside, or focus leaving the trigger
112
+ * and the layer. A controlled layer reports the request instead.
113
+ */
114
+ hold: () => void;
115
+ /** The app's `hide()`: drops the hold and hides the layer. */
116
+ release: () => void;
117
+ /** Whether the app's `show()` holds the layer open now. */
118
+ isAppHeld: () => boolean;
110
119
  /**
111
120
  * While pinned, focus moving onto an element outside the trigger and the
112
121
  * layer closes it. Returns whether the pin decided. The pin calls it for its
@@ -114,8 +123,9 @@ export interface UsePressPinReturn {
114
123
  */
115
124
  handleFocusLeave: (event: FocusEvent) => boolean;
116
125
  /**
117
- * Whether the layer shows pinned on a wired trigger. The host then announces
118
- * its rendered text, unless the layer has a `label`.
126
+ * Whether the layer shows pinned on a wired trigger, or held by the app's
127
+ * `show()`. The host then announces its rendered text, unless the layer has
128
+ * a `label`.
119
129
  */
120
130
  isPinShown: boolean;
121
131
  /** The layer's touch trigger (useTouchTriggerInternal), wired to the pin. */
@@ -177,8 +187,19 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
177
187
  setIsPinnedState(next);
178
188
  }, []);
179
189
 
190
+ // The app's show() holds the layer on any trigger, in any mode.
191
+ const isAppHeldRef = useRef(false);
192
+ const [isAppHeldState, setIsAppHeldState] = useState(false);
193
+ const setAppHeld = useCallback((next: boolean) => {
194
+ isAppHeldRef.current = next;
195
+ setIsAppHeldState(next);
196
+ }, []);
197
+
180
198
  // The last offered element lets a `triggerBehavior` change rewire it.
181
199
  const triggerRef = useRef<HTMLElement | null>(null);
200
+ // Every offered trigger, in any mode, so focus leaving ends a pin or an
201
+ // app hold.
202
+ const focusTargetRef = useRef<HTMLElement | null>(null);
182
203
  const offeredRef = useRef<HTMLElement | null>(null);
183
204
  // A primitive: re-attaching the same trigger renders nothing.
184
205
  const [offeredKind, setOfferedKind] = useState<'none' | 'other' | 'button'>(
@@ -194,6 +215,13 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
194
215
  // a pinned layer through the pin, so the pin drops with it.
195
216
  const hideFromTouch = useCallback(() => {
196
217
  const current = optionsRef.current;
218
+ if (isAppHeldRef.current) {
219
+ setAppHeld(false);
220
+ if (current.isOpen !== undefined) {
221
+ current.report(false);
222
+ return;
223
+ }
224
+ }
197
225
  if (current.triggerBehavior === 'toggle' && triggerRef.current != null) {
198
226
  if (current.isOpen !== undefined) {
199
227
  current.report(false);
@@ -204,7 +232,7 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
204
232
  }
205
233
  }
206
234
  current.hide();
207
- }, [setPinned]);
235
+ }, [setPinned, setAppHeld]);
208
236
 
209
237
  const {
210
238
  isTouchPointerRef,
@@ -214,11 +242,7 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
214
242
  clearTapOpen,
215
243
  armOutsideDismiss,
216
244
  } = useTouchTriggerInternal({
217
- touchTrigger: isToggleMode
218
- ? 'tap'
219
- : triggerBehavior === 'hover'
220
- ? 'none'
221
- : options.touchTrigger,
245
+ touchTrigger: isToggleMode ? 'tap' : options.touchTrigger,
222
246
  isEnabled: options.isEnabled,
223
247
  isControlled: isOpen !== undefined,
224
248
  isOpen: isLayerOpen,
@@ -239,13 +263,14 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
239
263
  const close = useCallback(() => {
240
264
  const current = optionsRef.current;
241
265
  clearTapOpen();
266
+ setAppHeld(false);
242
267
  if (current.isOpen !== undefined) {
243
268
  current.report(false);
244
269
  return;
245
270
  }
246
271
  setPinned(false);
247
272
  current.hide();
248
- }, [setPinned, clearTapOpen]);
273
+ }, [setPinned, setAppHeld, clearTapOpen]);
249
274
 
250
275
  const announceName = useCallback(() => {
251
276
  const current = optionsRef.current;
@@ -354,6 +379,9 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
354
379
 
355
380
  const isHeldOpen = useCallback(() => {
356
381
  const current = optionsRef.current;
382
+ if (isAppHeldRef.current && current.isLayerOpen) {
383
+ return current.isOpen !== false;
384
+ }
357
385
  if (current.triggerBehavior !== 'toggle' || triggerRef.current == null) {
358
386
  return false;
359
387
  }
@@ -370,7 +398,7 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
370
398
  return false;
371
399
  }
372
400
  const next = event.relatedTarget;
373
- const trigger = triggerRef.current;
401
+ const trigger = focusTargetRef.current;
374
402
  // Focus that leaves for no element is a press's to decide. The trigger
375
403
  // can sit in another document, so the check uses its own window.
376
404
  const view = trigger?.ownerDocument.defaultView;
@@ -393,6 +421,8 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
393
421
  );
394
422
 
395
423
  const unwire = useCallback(() => {
424
+ focusTargetRef.current?.removeEventListener('focusout', handleFocusLeave);
425
+ focusTargetRef.current = null;
396
426
  const previous = triggerRef.current;
397
427
  if (previous == null) {
398
428
  return;
@@ -400,7 +430,6 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
400
430
  previous.removeEventListener('click', handlePress);
401
431
  previous.removeEventListener('keydown', handleKeyDown);
402
432
  previous.removeEventListener('keyup', handleKeyUp);
403
- previous.removeEventListener('focusout', handleFocusLeave);
404
433
  const own = ownStateRef.current;
405
434
  if (own != null) {
406
435
  restoreAttribute(previous, 'aria-expanded', own.expanded);
@@ -429,10 +458,14 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
429
458
  }
430
459
  settledRef.current = {element, mode: current.triggerBehavior};
431
460
  unwire();
432
- if (element == null || current.triggerBehavior !== 'toggle') {
461
+ if (element == null) {
433
462
  return;
434
463
  }
435
- if (!isPressPinTrigger(element)) {
464
+ // Its own focus-leave listener, in any mode: `focusTrigger="never"`
465
+ // attaches none, and an app hold needs it on any trigger.
466
+ element.addEventListener('focusout', handleFocusLeave);
467
+ focusTargetRef.current = element;
468
+ if (current.triggerBehavior !== 'toggle' || !isPressPinTrigger(element)) {
436
469
  return;
437
470
  }
438
471
  element.addEventListener('click', handlePress);
@@ -440,8 +473,6 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
440
473
  element.addEventListener('keydown', handleKeyDown);
441
474
  element.addEventListener('keyup', handleKeyUp);
442
475
  }
443
- // Its own focus-leave listener: `focusTrigger="never"` attaches none.
444
- element.addEventListener('focusout', handleFocusLeave);
445
476
  ownStateRef.current = {
446
477
  expanded: element.getAttribute('aria-expanded'),
447
478
  controls: element.getAttribute('aria-controls'),
@@ -466,7 +497,7 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
466
497
  const isWired = isToggleMode && offeredKind === 'button';
467
498
  useDevWarning(
468
499
  options.component,
469
- '`triggerBehavior="toggle"` pins only a button trigger (a <button> or role="button"); this trigger keeps tap-only opening.',
500
+ 'A press-to-pin tooltip pins only a button trigger (a <button> or role="button"); this trigger keeps tap-only opening.',
470
501
  isToggleMode && offeredKind === 'other',
471
502
  );
472
503
 
@@ -479,7 +510,31 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
479
510
  if (isPinnedRef.current) {
480
511
  setPinned(false);
481
512
  }
482
- }, [setPinned]);
513
+ if (isAppHeldRef.current) {
514
+ setAppHeld(false);
515
+ }
516
+ }, [setPinned, setAppHeld]);
517
+
518
+ const hold = useCallback(() => {
519
+ const current = optionsRef.current;
520
+ if (!current.isEnabled) {
521
+ return;
522
+ }
523
+ setAppHeld(true);
524
+ armOutsideDismiss();
525
+ announceName();
526
+ if (current.isOpen !== undefined) {
527
+ current.report(true);
528
+ return;
529
+ }
530
+ current.show();
531
+ }, [setAppHeld, armOutsideDismiss, announceName]);
532
+
533
+ const release = useCallback(() => {
534
+ close();
535
+ }, [close]);
536
+
537
+ const isAppHeld = useCallback(() => isAppHeldRef.current, []);
483
538
 
484
539
  // Each path that hides a pinned layer drops the pin itself, so a layer that
485
540
  // does not show is never reported expanded.
@@ -496,13 +551,18 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
496
551
  writeAttribute(trigger, 'aria-controls', isLayerOpen ? layerId : null);
497
552
  });
498
553
 
499
- const isPinShown = isToggleMode && isWired && isExpanded;
554
+ const isPinShown =
555
+ (isToggleMode && isWired && isExpanded) ||
556
+ (isAppHeldState && isLayerOpen && isOpen !== false);
500
557
 
501
558
  return {
502
559
  isToggleTrigger,
503
560
  isHeldOpen,
504
561
  attach,
505
562
  unpin,
563
+ hold,
564
+ release,
565
+ isAppHeld,
506
566
  handleFocusLeave,
507
567
  isPinShown,
508
568
  touch: {
@@ -55,6 +55,7 @@ import {
55
55
  } from '../i18n/useComponentTranslator';
56
56
  import english from '../i18n/generated-english/Lightbox/Lightbox.generated';
57
57
  import {isRenderable} from '../utils/isRenderable';
58
+ import {prepareFocusReturnOnRemoval} from '../utils/focusReturn';
58
59
 
59
60
  registerEnglishFallback(english);
60
61
  /**
@@ -445,6 +446,23 @@ export function Lightbox({
445
446
  }
446
447
  }, [isOpen, hasItem]);
447
448
 
449
+ // A viewer that unmounts while open (rendered only while open, or removed
450
+ // with the rest of a view) never runs the close branch above. Focus the
451
+ // removal lost goes back to the opener while the opener is still on the
452
+ // page.
453
+ useEffect(() => {
454
+ const dialog = dialogRef.current;
455
+ if (dialog == null) {
456
+ return;
457
+ }
458
+ const returnFocusOnRemoval = prepareFocusReturnOnRemoval(dialog);
459
+ return () => {
460
+ if (dialog.open) {
461
+ returnFocusOnRemoval(triggerElementRef.current);
462
+ }
463
+ };
464
+ }, [hasItem]);
465
+
448
466
  const handleClose = useCallback(() => {
449
467
  onOpenChange(false);
450
468
  }, [onOpenChange]);
@@ -143,8 +143,8 @@ const styles = stylex.create({
143
143
  // ::backdrop is provided by the browser's top layer
144
144
  backdrop: {
145
145
  '::backdrop': {
146
+ // No backdrop-filter: a full-viewport blur is costly to repaint.
146
147
  backgroundColor: colorVars['--color-overlay'],
147
- backdropFilter: 'blur(2px)',
148
148
  opacity: 0,
149
149
  transitionProperty: 'opacity',
150
150
  transitionDuration: durationVars['--duration-medium'],
@@ -174,13 +174,11 @@ export function useMultiCombobox({
174
174
  // The action cell is the caller's control, usable whether or not the
175
175
  // option itself is disabled (spec:AST-058 FR4).
176
176
  if (cell === 'action') {
177
- highlightOnHover(index);
178
- setHighlightedCell('action');
177
+ highlightOnHover(index, () => setHighlightedCell('action'));
179
178
  return;
180
179
  }
181
180
  if (!item.disabled) {
182
- highlightOnHover(index);
183
- setHighlightedCell('option');
181
+ highlightOnHover(index, () => setHighlightedCell('option'));
184
182
  }
185
183
  },
186
184
  [highlightOnHover],
@@ -63,7 +63,11 @@ export const docs = {
63
63
  targets: [
64
64
  {className: 'astryx-outline', visualProps: ['density']},
65
65
  {className: 'astryx-outline-indicator'},
66
- {className: 'astryx-outline-item', visualProps: ['level'], states: ['active']},
66
+ {
67
+ className: 'astryx-outline-item',
68
+ visualProps: ['level'],
69
+ states: ['active'],
70
+ },
67
71
  ],
68
72
  },
69
73
  components: [
@@ -101,7 +105,8 @@ export const docs = {
101
105
  {
102
106
  name: 'density',
103
107
  type: "'default' | 'compact'",
104
- description: "Density variant controlling item padding. 'compact' for dense UIs, 'default' for standard spacing.",
108
+ description:
109
+ "Density variant controlling item padding. 'compact' for dense UIs, 'default' for standard spacing.",
105
110
  default: "'default'",
106
111
  },
107
112
  {
@@ -271,17 +276,53 @@ function FlashOnArrival() {
271
276
  usage: {
272
277
  anatomy,
273
278
  description:
274
- 'A table-of-contents sidebar for documentation pages, help centers, wikis, and long settings pages. Use it for navigation within a single page, not for app routes. Features a sliding indicator track that animates to the active heading. The list is a single tab stop: arrow keys move between headings, Home/End jump to the ends, and Enter/Space activate.',
279
+ 'A table-of-contents sidebar for documentation pages, help centers, wikis, and long settings pages. Use it for navigation within a single page, not for app routes. Features a sliding indicator track that animates to the active heading. Each link is in the normal Tab order, and Enter/Space activate.',
275
280
  bestPractices: [
276
- {guidance: true, description: 'Pass a flat ordered list of headings and let level control indentation.'},
277
- {guidance: true, description: 'Use activeId when custom scroll logic owns the active section.'},
278
- {guidance: true, description: 'Use density="compact" in dense sidebars where vertical space is tight.'},
279
- {guidance: true, description: 'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.'},
280
- {guidance: true, description: 'Pass scrollContainerRef when the content scrolls in a split pane, modal, or panel instead of the viewport.'},
281
- {guidance: true, description: 'Set offset to the height of a fixed header that overlays the content, so headings land below it instead of underneath it.'},
282
- {guidance: false, description: 'Use Outline for application navigation - use SideNav or TopNav for routes.'},
283
- {guidance: false, description: 'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.'},
284
- {guidance: false, description: 'Rely on onNavigateEnd to mean "arrived" - it also fires when the user interrupts the scroll.'},
281
+ {
282
+ guidance: true,
283
+ description:
284
+ 'Pass a flat ordered list of headings and let level control indentation.',
285
+ },
286
+ {
287
+ guidance: true,
288
+ description:
289
+ 'Use activeId when custom scroll logic owns the active section.',
290
+ },
291
+ {
292
+ guidance: true,
293
+ description:
294
+ 'Use density="compact" in dense sidebars where vertical space is tight.',
295
+ },
296
+ {
297
+ guidance: true,
298
+ description:
299
+ 'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.',
300
+ },
301
+ {
302
+ guidance: true,
303
+ description:
304
+ 'Pass scrollContainerRef when the content scrolls in a split pane, modal, or panel instead of the viewport.',
305
+ },
306
+ {
307
+ guidance: true,
308
+ description:
309
+ 'Set offset to the height of a fixed header that overlays the content, so headings land below it instead of underneath it.',
310
+ },
311
+ {
312
+ guidance: false,
313
+ description:
314
+ 'Use Outline for application navigation - use SideNav or TopNav for routes.',
315
+ },
316
+ {
317
+ guidance: false,
318
+ description:
319
+ 'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.',
320
+ },
321
+ {
322
+ guidance: false,
323
+ description:
324
+ 'Rely on onNavigateEnd to mean "arrived" - it also fires when the user interrupts the scroll.',
325
+ },
285
326
  ],
286
327
  },
287
328
  };
@@ -295,7 +336,11 @@ export const docsZh = {
295
336
  targets: [
296
337
  {className: 'astryx-outline', visualProps: ['density']},
297
338
  {className: 'astryx-outline-indicator'},
298
- {className: 'astryx-outline-item', visualProps: ['level'], states: ['active']},
339
+ {
340
+ className: 'astryx-outline-item',
341
+ visualProps: ['level'],
342
+ states: ['active'],
343
+ },
299
344
  ],
300
345
  },
301
346
  components: [
@@ -332,40 +377,47 @@ export const docsZh = {
332
377
  {
333
378
  name: 'density',
334
379
  type: "'default' | 'compact'",
335
- description: "控制项目内边距的密度变体。'compact' 用于紧凑界面,'default' 为标准间距。",
380
+ description:
381
+ "控制项目内边距的密度变体。'compact' 用于紧凑界面,'default' 为标准间距。",
336
382
  default: "'default'",
337
383
  },
338
384
  {
339
385
  name: 'onNavigateStart',
340
386
  type: '(id: string) => void',
341
- description: '导航开始时(滚动前)调用,传入项目 id。与 onNavigateEnd 搭配可在目标标题上实现到达效果(闪烁、描边、脉冲)。',
387
+ description:
388
+ '导航开始时(滚动前)调用,传入项目 id。与 onNavigateEnd 搭配可在目标标题上实现到达效果(闪烁、描边、脉冲)。',
342
389
  },
343
390
  {
344
391
  name: 'onNavigateEnd',
345
392
  type: '(id: string) => void',
346
- description: '导航结束时调用(平滑滚动停止,或减弱动效将其变为瞬时跳转)。每次 onNavigateStart 必定对应一次调用,包括用户中途手动滚动打断的情况,因此“导航中”状态不会泄漏。',
393
+ description:
394
+ '导航结束时调用(平滑滚动停止,或减弱动效将其变为瞬时跳转)。每次 onNavigateStart 必定对应一次调用,包括用户中途手动滚动打断的情况,因此“导航中”状态不会泄漏。',
347
395
  },
348
396
  {
349
397
  name: 'offset',
350
398
  type: 'number',
351
- description: '覆盖滚动根顶部的固定顶栏高度(px)。同时位移激活线与滚动落点,因此标题被激活的位置正是点击后停留的位置——落在顶栏下方,而非被顶栏遮住。它与每个标题自身的 scroll-margin-top 叠加(先顶栏,再留白),而非取代它。若没有元素覆盖内容,保持 0,交给 scroll-margin-top 处理。',
399
+ description:
400
+ '覆盖滚动根顶部的固定顶栏高度(px)。同时位移激活线与滚动落点,因此标题被激活的位置正是点击后停留的位置——落在顶栏下方,而非被顶栏遮住。它与每个标题自身的 scroll-margin-top 叠加(先顶栏,再留白),而非取代它。若没有元素覆盖内容,保持 0,交给 scroll-margin-top 处理。',
352
401
  default: '0',
353
402
  },
354
403
  {
355
404
  name: 'scrollContainerRef',
356
405
  type: 'React.RefObject<HTMLElement | null>',
357
- description: '要跟踪的滚动容器,替代自动探测最近的可滚动祖先。当内容在分栏、弹窗或面板中滚动而非视口时使用。',
406
+ description:
407
+ '要跟踪的滚动容器,替代自动探测最近的可滚动祖先。当内容在分栏、弹窗或面板中滚动而非视口时使用。',
358
408
  },
359
409
  {
360
410
  name: 'hasScrollOnClick',
361
411
  type: 'boolean',
362
- description: '激活项目时是否平滑滚动。设为 false 可自行接管滚动(虚拟列表、路由):Outline 仍会更新激活项、hash 和导航回调,但不执行滚动。',
412
+ description:
413
+ '激活项目时是否平滑滚动。设为 false 可自行接管滚动(虚拟列表、路由):Outline 仍会更新激活项、hash 和导航回调,但不执行滚动。',
363
414
  default: 'true',
364
415
  },
365
416
  {
366
417
  name: 'xstyle',
367
418
  type: 'StyleXStyles',
368
- description: '用于布局自定义的 StyleX 样式。必须是 stylex.create() 值。',
419
+ description:
420
+ '用于布局自定义的 StyleX 样式。必须是 stylex.create() 值。',
369
421
  },
370
422
  ],
371
423
  },
@@ -375,12 +427,36 @@ export const docsZh = {
375
427
  description:
376
428
  'A table-of-contents sidebar for documentation pages, help centers, wikis, and long settings pages. Use it for navigation within a single page, not for app routes.',
377
429
  bestPractices: [
378
- {guidance: true, description: 'Pass a flat ordered list of headings and let level control indentation.'},
379
- {guidance: true, description: 'Use activeId when custom scroll logic owns the active section.'},
380
- {guidance: true, description: 'Use density="compact" in dense sidebars where vertical space is tight.'},
381
- {guidance: true, description: 'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.'},
382
- {guidance: false, description: 'Use Outline for application navigation - use SideNav or TopNav for routes.'},
383
- {guidance: false, description: 'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.'},
430
+ {
431
+ guidance: true,
432
+ description:
433
+ 'Pass a flat ordered list of headings and let level control indentation.',
434
+ },
435
+ {
436
+ guidance: true,
437
+ description:
438
+ 'Use activeId when custom scroll logic owns the active section.',
439
+ },
440
+ {
441
+ guidance: true,
442
+ description:
443
+ 'Use density="compact" in dense sidebars where vertical space is tight.',
444
+ },
445
+ {
446
+ guidance: true,
447
+ description:
448
+ 'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.',
449
+ },
450
+ {
451
+ guidance: false,
452
+ description:
453
+ 'Use Outline for application navigation - use SideNav or TopNav for routes.',
454
+ },
455
+ {
456
+ guidance: false,
457
+ description:
458
+ 'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.',
459
+ },
384
460
  ],
385
461
  },
386
462
  };
@@ -388,34 +464,77 @@ export const docsZh = {
388
464
  /** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
389
465
  export const docsDense = {
390
466
  description:
391
- 'Document outline/table-of-contents nav with sliding indicator track. Flat items array {id,label,level}; anchor links; density variant (default/compact); uncontrolled scroll-spy by scroll position (last heading past its resting line = offset + its own scroll-margin-top; first item at top, last at bottom); controlled with activeId; smooth-scroll on click that pins the active item until the next manual scroll. Single tab stop (roving tabindex): Arrow keys move, Home/End jump, Enter/Space activate. onNavigateStart/onNavigateEnd fire around the scroll. Scroll scoping via offset / scrollContainerRef / hasScrollOnClick.',
467
+ 'Document outline/table-of-contents nav with sliding indicator track. Flat items array {id,label,level}; anchor links; density variant (default/compact); uncontrolled scroll-spy by scroll position (last heading past its resting line = offset + its own scroll-margin-top; first item at top, last at bottom); controlled with activeId; smooth-scroll on click that pins the active item until the next manual scroll. Each link is a Tab stop; Enter/Space activate; no arrow/Home/End movement. onNavigateStart/onNavigateEnd fire around the scroll. Scroll scoping via offset / scrollContainerRef / hasScrollOnClick.',
392
468
  usage: {
393
469
  anatomy,
394
470
  description:
395
471
  'A table-of-contents sidebar for documentation pages, help centers, wikis, and long settings pages. Use it for navigation within a single page, not for app routes.',
396
472
  bestPractices: [
397
- {guidance: true, description: 'Pass a flat ordered list of headings and let level control indentation.'},
398
- {guidance: true, description: 'Use activeId when custom scroll logic owns the active section.'},
399
- {guidance: true, description: 'Use density="compact" in dense sidebars where vertical space is tight.'},
400
- {guidance: true, description: 'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.'},
401
- {guidance: true, description: 'Pass scrollContainerRef when the content scrolls in a split pane, modal, or panel instead of the viewport.'},
402
- {guidance: true, description: 'Set offset to the height of a fixed header that overlays the content, so headings land below it instead of underneath it.'},
403
- {guidance: false, description: 'Use Outline for application navigation - use SideNav or TopNav for routes.'},
404
- {guidance: false, description: 'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.'},
405
- {guidance: false, description: 'Rely on onNavigateEnd to mean "arrived" - it also fires when the user interrupts the scroll.'},
473
+ {
474
+ guidance: true,
475
+ description:
476
+ 'Pass a flat ordered list of headings and let level control indentation.',
477
+ },
478
+ {
479
+ guidance: true,
480
+ description:
481
+ 'Use activeId when custom scroll logic owns the active section.',
482
+ },
483
+ {
484
+ guidance: true,
485
+ description:
486
+ 'Use density="compact" in dense sidebars where vertical space is tight.',
487
+ },
488
+ {
489
+ guidance: true,
490
+ description:
491
+ 'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.',
492
+ },
493
+ {
494
+ guidance: true,
495
+ description:
496
+ 'Pass scrollContainerRef when the content scrolls in a split pane, modal, or panel instead of the viewport.',
497
+ },
498
+ {
499
+ guidance: true,
500
+ description:
501
+ 'Set offset to the height of a fixed header that overlays the content, so headings land below it instead of underneath it.',
502
+ },
503
+ {
504
+ guidance: false,
505
+ description:
506
+ 'Use Outline for application navigation - use SideNav or TopNav for routes.',
507
+ },
508
+ {
509
+ guidance: false,
510
+ description:
511
+ 'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.',
512
+ },
513
+ {
514
+ guidance: false,
515
+ description:
516
+ 'Rely on onNavigateEnd to mean "arrived" - it also fires when the user interrupts the scroll.',
517
+ },
406
518
  ],
407
519
  },
408
520
  propDescriptions: {
409
- items: 'Ordered OutlineItem[]: {id,label,level}. id should match target heading DOM id.',
521
+ items:
522
+ 'Ordered OutlineItem[]: {id,label,level}. id should match target heading DOM id.',
410
523
  activeId: 'Controlled active heading id. Disables built-in scroll-spy.',
411
524
  onActiveIdChange: 'Called when active id changes from scroll-spy or click.',
412
525
  label: "Accessible nav label. Default: 'Table of contents'.",
413
- density: "Density variant: 'default' (standard) or 'compact'. Default: 'default'.",
414
- onNavigateStart: 'Called with the id when navigation begins, before the scroll.',
415
- onNavigateEnd: 'Called with the id once the scroll settles. Fires exactly once per onNavigateStart, including on user interruption.',
416
- offset: 'Height in px of a fixed header overlaying the scroll root. Shifts BOTH the activation line and the scroll landing, so a heading activates where navigating to it lands it. Composes with (does not replace) each heading scroll-margin-top. Default: 0.',
417
- scrollContainerRef: 'RefObject of the scroll container to track, instead of the nearest scrollable ancestor. For split panes, modals, panels.',
418
- hasScrollOnClick: 'Whether activating an item smooth-scrolls to it. false = you own scrolling; active id, hash and callbacks still update. Default: true.',
526
+ density:
527
+ "Density variant: 'default' (standard) or 'compact'. Default: 'default'.",
528
+ onNavigateStart:
529
+ 'Called with the id when navigation begins, before the scroll.',
530
+ onNavigateEnd:
531
+ 'Called with the id once the scroll settles. Fires exactly once per onNavigateStart, including on user interruption.',
532
+ offset:
533
+ 'Height in px of a fixed header overlaying the scroll root. Shifts BOTH the activation line and the scroll landing, so a heading activates where navigating to it lands it. Composes with (does not replace) each heading scroll-margin-top. Default: 0.',
534
+ scrollContainerRef:
535
+ 'RefObject of the scroll container to track, instead of the nearest scrollable ancestor. For split panes, modals, panels.',
536
+ hasScrollOnClick:
537
+ 'Whether activating an item smooth-scrolls to it. false = you own scrolling; active id, hash and callbacks still update. Default: true.',
419
538
  xstyle: 'StyleX styles for layout. Must be stylex.create() value.',
420
539
  },
421
540
  components: [
@@ -423,18 +542,25 @@ export const docsDense = {
423
542
  name: 'Outline',
424
543
  displayName: 'Outline',
425
544
  description:
426
- 'Document outline nav with sliding indicator. Renders heading anchors with a density variant, roving-tabindex keyboard nav, navigate callbacks, and scroll-spy active state when uncontrolled.',
545
+ 'Document outline nav with sliding indicator. Renders heading anchors with a density variant, links in the normal Tab order, navigate callbacks, and scroll-spy active state when uncontrolled.',
427
546
  propDescriptions: {
428
- items: 'Ordered OutlineItem[]: {id,label,level}. id should match target heading DOM id.',
547
+ items:
548
+ 'Ordered OutlineItem[]: {id,label,level}. id should match target heading DOM id.',
429
549
  activeId: 'Controlled active heading id. Disables built-in scroll-spy.',
430
- onActiveIdChange: 'Called when active id changes from scroll-spy or click.',
550
+ onActiveIdChange:
551
+ 'Called when active id changes from scroll-spy or click.',
431
552
  label: "Accessible nav label. Default: 'Table of contents'.",
432
553
  density: "Density variant: 'default' | 'compact'. Default: 'default'.",
433
- onNavigateStart: 'Called with the id when navigation begins, before the scroll.',
434
- onNavigateEnd: 'Called with the id once the scroll settles. Fires exactly once per onNavigateStart, including on user interruption.',
435
- offset: 'Height in px of a fixed header overlaying the scroll root. Shifts both the activation line and the scroll landing. Composes with scroll-margin-top. Default: 0.',
436
- scrollContainerRef: 'RefObject of the scroll container to track, instead of the nearest scrollable ancestor.',
437
- hasScrollOnClick: 'Whether activating an item smooth-scrolls to it. Default: true.',
554
+ onNavigateStart:
555
+ 'Called with the id when navigation begins, before the scroll.',
556
+ onNavigateEnd:
557
+ 'Called with the id once the scroll settles. Fires exactly once per onNavigateStart, including on user interruption.',
558
+ offset:
559
+ 'Height in px of a fixed header overlaying the scroll root. Shifts both the activation line and the scroll landing. Composes with scroll-margin-top. Default: 0.',
560
+ scrollContainerRef:
561
+ 'RefObject of the scroll container to track, instead of the nearest scrollable ancestor.',
562
+ hasScrollOnClick:
563
+ 'Whether activating an item smooth-scrolls to it. Default: true.',
438
564
  xstyle: 'StyleX styles for layout. Must be stylex.create() value.',
439
565
  },
440
566
  },