@astryxdesign/core 0.7.7 → 0.7.8-canary.0b39b51

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 (581) 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 +46 -6
  4. package/dist/AppShell/AppShell.d.ts.map +1 -1
  5. package/dist/AppShell/AppShell.js +5 -0
  6. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  7. package/dist/BottomSheet/BottomSheet.js +1 -0
  8. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  9. package/dist/BottomSheet/BottomSheetPanel.js +25 -4
  10. package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
  11. package/dist/BottomSheet/BottomSheetSwitcher.js +5 -0
  12. package/dist/BottomSheet/useMobileKeyboard.d.ts.map +1 -1
  13. package/dist/BottomSheet/useMobileKeyboard.js +6 -0
  14. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  15. package/dist/BottomSheet/useSheetGestures.js +12 -1
  16. package/dist/Button/Button.d.ts.map +1 -1
  17. package/dist/Button/Button.js +17 -1
  18. package/dist/Calendar/Calendar.d.ts.map +1 -1
  19. package/dist/Calendar/Calendar.js +15 -16
  20. package/dist/Carousel/Carousel.d.ts.map +1 -1
  21. package/dist/Carousel/Carousel.js +2 -0
  22. package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
  23. package/dist/Chat/ChatComposerInput.js +4 -0
  24. package/dist/Chat/ChatMessageList.d.ts.map +1 -1
  25. package/dist/Chat/ChatMessageList.js +2 -1
  26. package/dist/Chat/useChatDictation.d.ts.map +1 -1
  27. package/dist/Chat/useChatDictation.js +2 -0
  28. package/dist/Chat/useChatNewMessages.js +1 -1
  29. package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
  30. package/dist/Chat/useChatStreamScroll.js +2 -0
  31. package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
  32. package/dist/Chat/useSpeechRecognition.js +3 -0
  33. package/dist/Chat/useTriggerMenu.js +1 -1
  34. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  35. package/dist/CheckboxInput/CheckboxInput.js +17 -12
  36. package/dist/CodeBlock/CodeBlock.d.ts +10 -1
  37. package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
  38. package/dist/CodeBlock/CodeBlock.js +28 -11
  39. package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
  40. package/dist/CommandPalette/CommandPalette.js +2 -0
  41. package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
  42. package/dist/CommandPalette/CommandPaletteItem.js +2 -0
  43. package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
  44. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  45. package/dist/ComplexSelector/ComplexSelector.js +14 -4
  46. package/dist/ContextMenu/ContextMenu.js +2 -2
  47. package/dist/DateInput/MonthScroller.d.ts.map +1 -1
  48. package/dist/DateInput/MonthScroller.js +5 -2
  49. package/dist/DateInput/PickerWheel.d.ts +19 -0
  50. package/dist/DateInput/PickerWheel.d.ts.map +1 -0
  51. package/dist/DateInput/PickerWheel.js +625 -0
  52. package/dist/DateInput/TouchDateField.d.ts.map +1 -1
  53. package/dist/DateInput/TouchDateField.js +1 -0
  54. package/dist/DateInput/Wheel.d.ts +18 -37
  55. package/dist/DateInput/Wheel.d.ts.map +1 -1
  56. package/dist/DateInput/Wheel.js +84 -113
  57. package/dist/DateInput/useOwnScrollGesture.d.ts +10 -0
  58. package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -1
  59. package/dist/DateInput/useOwnScrollGesture.js +16 -3
  60. package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
  61. package/dist/DateInput/usePointerDragScroll.js +2 -0
  62. package/dist/DateInput/useScrollSettle.d.ts.map +1 -1
  63. package/dist/DateInput/useScrollSettle.js +3 -0
  64. package/dist/DateInput/useWheelListbox.d.ts +59 -0
  65. package/dist/DateInput/useWheelListbox.d.ts.map +1 -0
  66. package/dist/DateInput/useWheelListbox.js +88 -0
  67. package/dist/DateInput/wheelOptions.d.ts +74 -0
  68. package/dist/DateInput/wheelOptions.d.ts.map +1 -0
  69. package/dist/DateInput/wheelOptions.js +98 -0
  70. package/dist/DateInput/wheelPhysics.d.ts +127 -0
  71. package/dist/DateInput/wheelPhysics.d.ts.map +1 -0
  72. package/dist/DateInput/wheelPhysics.js +341 -0
  73. package/dist/DateInput/wheelStrip.d.ts +92 -0
  74. package/dist/DateInput/wheelStrip.d.ts.map +1 -0
  75. package/dist/DateInput/wheelStrip.js +258 -0
  76. package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
  77. package/dist/DateTimeInput/TouchDateTimeField.js +2 -0
  78. package/dist/Dialog/Dialog.d.ts.map +1 -1
  79. package/dist/Dialog/Dialog.js +9 -32
  80. package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
  81. package/dist/Drawer/useDrawerDialogPresence.js +3 -0
  82. package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -1
  83. package/dist/DropdownMenu/useMenuOverflow.js +5 -0
  84. package/dist/Field/Field.js +2 -2
  85. package/dist/FieldStatus/useFieldStatusAnnouncement.d.ts.map +1 -1
  86. package/dist/FieldStatus/useFieldStatusAnnouncement.js +1 -0
  87. package/dist/FormLayout/FormLayout.d.ts +5 -1
  88. package/dist/FormLayout/FormLayout.d.ts.map +1 -1
  89. package/dist/HoverCard/HoverCard.d.ts +6 -4
  90. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  91. package/dist/HoverCard/HoverCard.js +48 -3
  92. package/dist/HoverCard/useHoverCard.d.ts +5 -4
  93. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  94. package/dist/HoverCard/useHoverCard.js +20 -33
  95. package/dist/Icon/Icon.d.ts +5 -1
  96. package/dist/Icon/Icon.d.ts.map +1 -1
  97. package/dist/Icon/Icon.js +5 -2
  98. package/dist/Item/useSwipeAction.d.ts.map +1 -1
  99. package/dist/Item/useSwipeAction.js +3 -0
  100. package/dist/Layer/modalOutlet.d.ts.map +1 -1
  101. package/dist/Layer/modalOutlet.js +2 -0
  102. package/dist/Layer/outsidePress.d.ts.map +1 -1
  103. package/dist/Layer/outsidePress.js +1 -0
  104. package/dist/Layer/useLayer.d.ts.map +1 -1
  105. package/dist/Layer/useLayer.js +3 -0
  106. package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
  107. package/dist/Layer/useLayerDismissal.js +3 -0
  108. package/dist/Layer/usePressPin.d.ts +17 -5
  109. package/dist/Layer/usePressPin.d.ts.map +1 -1
  110. package/dist/Layer/usePressPin.js +62 -12
  111. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  112. package/dist/Layer/useTouchTrigger.js +3 -0
  113. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  114. package/dist/Lightbox/Lightbox.js +19 -0
  115. package/dist/MobileNav/MobileNav.d.ts +3 -2
  116. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  117. package/dist/MobileNav/MobileNav.js +9 -25
  118. package/dist/Outline/useOutlineFromDOM.d.ts.map +1 -1
  119. package/dist/Outline/useOutlineFromDOM.js +3 -0
  120. package/dist/Outline/useScrollSpy.d.ts.map +1 -1
  121. package/dist/Outline/useScrollSpy.js +3 -0
  122. package/dist/OverflowList/OverflowList.d.ts.map +1 -1
  123. package/dist/OverflowList/OverflowList.js +3 -0
  124. package/dist/Popover/Popover.d.ts.map +1 -1
  125. package/dist/Popover/Popover.js +6 -0
  126. package/dist/PowerSearch/PowerSearch.d.ts +43 -4
  127. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  128. package/dist/PowerSearch/PowerSearch.js +445 -134
  129. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +102 -0
  130. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
  131. package/dist/PowerSearch/PowerSearchBottomSheet.js +1919 -0
  132. package/dist/PowerSearch/PowerSearchEditPopover.d.ts +35 -2
  133. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  134. package/dist/PowerSearch/PowerSearchEditPopover.js +25 -6
  135. package/dist/PowerSearch/PowerSearchFilterEditor.d.ts +1 -1
  136. package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
  137. package/dist/PowerSearch/PowerSearchFilterEditor.js +4 -2
  138. package/dist/PowerSearch/PowerSearchToken.d.ts +1 -1
  139. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  140. package/dist/PowerSearch/PowerSearchToken.js +7 -2
  141. package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
  142. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  143. package/dist/PowerSearch/PowerSearchValueEditor.js +193 -83
  144. package/dist/PowerSearch/formatFilterValue.d.ts +18 -6
  145. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  146. package/dist/PowerSearch/formatFilterValue.js +33 -12
  147. package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
  148. package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
  149. package/dist/PowerSearch/formatTokenValue.js +162 -0
  150. package/dist/PowerSearch/powerSearchDateZone.d.ts +21 -0
  151. package/dist/PowerSearch/powerSearchDateZone.d.ts.map +1 -0
  152. package/dist/PowerSearch/powerSearchDateZone.js +37 -0
  153. package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
  154. package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
  155. package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
  156. package/dist/PowerSearch/types.d.ts +2 -0
  157. package/dist/PowerSearch/types.d.ts.map +1 -1
  158. package/dist/ProgressBar/ProgressBarTouch.d.ts.map +1 -1
  159. package/dist/ProgressBar/ProgressBarTouch.js +2 -0
  160. package/dist/RadioList/RadioList.d.ts.map +1 -1
  161. package/dist/RadioList/RadioList.js +3 -2
  162. package/dist/RadioList/RadioListItem.d.ts +1 -1
  163. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  164. package/dist/RadioList/RadioListItem.js +5 -3
  165. package/dist/Resizable/ResizeHandle.d.ts +2 -1
  166. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  167. package/dist/Resizable/ResizeHandle.js +101 -77
  168. package/dist/Resizable/createResizable.d.ts +145 -0
  169. package/dist/Resizable/createResizable.d.ts.map +1 -0
  170. package/dist/Resizable/createResizable.js +575 -0
  171. package/dist/Resizable/useResizable.d.ts +3 -3
  172. package/dist/Resizable/useResizable.d.ts.map +1 -1
  173. package/dist/Resizable/useResizable.js +252 -459
  174. package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
  175. package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
  176. package/dist/SelectableCard/SelectableCard.d.ts +2 -0
  177. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  178. package/dist/SelectableCard/SelectableCard.js +36 -11
  179. package/dist/SelectableCard/selectableCardInput.d.ts +12 -0
  180. package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -0
  181. package/dist/SelectableCard/selectableCardInput.js +20 -0
  182. package/dist/Selector/Selector.d.ts.map +1 -1
  183. package/dist/Selector/Selector.js +5 -8
  184. package/dist/Slider/sliderTouchController.js +2 -2
  185. package/dist/Spinner/Spinner.d.ts +1 -1
  186. package/dist/Spinner/Spinner.d.ts.map +1 -1
  187. package/dist/Spinner/Spinner.js +60 -58
  188. package/dist/Switch/Switch.d.ts.map +1 -1
  189. package/dist/Switch/Switch.js +4 -10
  190. package/dist/Switch/useSwitchTouch.js +4 -4
  191. package/dist/Table/BaseTable.d.ts.map +1 -1
  192. package/dist/Table/BaseTable.js +29 -8
  193. package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
  194. package/dist/Table/plugins/columnResize/useTableColumnResize.js +3 -1
  195. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  196. package/dist/Table/plugins/filtering/useTableFiltering.js +2 -1
  197. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  198. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +4 -0
  199. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
  200. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -0
  201. package/dist/TextInput/TextInput.d.ts +2 -2
  202. package/dist/TextInput/TextInput.d.ts.map +1 -1
  203. package/dist/TextInput/TextInput.js +10 -7
  204. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  205. package/dist/TimeInput/TimeInput.js +2 -0
  206. package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
  207. package/dist/TimeInput/TouchTimeField.js +2 -0
  208. package/dist/Timer/Timer.d.ts.map +1 -1
  209. package/dist/Timer/Timer.js +2 -0
  210. package/dist/Timestamp/Timestamp.js +1 -1
  211. package/dist/Toast/Toast.d.ts +11 -1
  212. package/dist/Toast/Toast.d.ts.map +1 -1
  213. package/dist/Toast/Toast.js +25 -15
  214. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  215. package/dist/Toast/ToastViewport.js +97 -34
  216. package/dist/Toast/types.d.ts +9 -3
  217. package/dist/Toast/types.d.ts.map +1 -1
  218. package/dist/Toast/useToast.d.ts.map +1 -1
  219. package/dist/Toast/useToast.js +1 -0
  220. package/dist/Tokenizer/Tokenizer.d.ts +49 -37
  221. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  222. package/dist/Tokenizer/Tokenizer.js +22 -19
  223. package/dist/Tokenizer/TokenizerBottomSheet.d.ts +1 -1
  224. package/dist/Tokenizer/TokenizerBottomSheet.js +1 -1
  225. package/dist/Tokenizer/index.d.ts +1 -1
  226. package/dist/Tokenizer/index.d.ts.map +1 -1
  227. package/dist/Tooltip/useTooltip.d.ts +19 -1
  228. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  229. package/dist/Tooltip/useTooltip.js +34 -53
  230. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  231. package/dist/Typeahead/BaseTypeahead.js +27 -18
  232. package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
  233. package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
  234. package/dist/animator/createAnimator.d.ts +98 -0
  235. package/dist/animator/createAnimator.d.ts.map +1 -0
  236. package/dist/animator/createAnimator.js +259 -0
  237. package/dist/astryx.css +39 -6
  238. package/dist/gestures/GestureHost.d.ts +16 -1
  239. package/dist/gestures/GestureHost.d.ts.map +1 -1
  240. package/dist/gestures/GestureHost.js +1 -1
  241. package/dist/gestures/PressTracker.d.ts.map +1 -1
  242. package/dist/gestures/PressTracker.js +4 -3
  243. package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -1
  244. package/dist/hooks/ModalAnnounceProvider.js +1 -0
  245. package/dist/hooks/actionGroupTracker.d.ts +4 -1
  246. package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
  247. package/dist/hooks/actionGroupTracker.js +13 -3
  248. package/dist/hooks/index.d.ts +1 -0
  249. package/dist/hooks/index.d.ts.map +1 -1
  250. package/dist/hooks/index.js +1 -0
  251. package/dist/hooks/longPressDetector.d.ts +66 -0
  252. package/dist/hooks/longPressDetector.d.ts.map +1 -0
  253. package/dist/hooks/longPressDetector.js +200 -0
  254. package/dist/hooks/pressGroupContext.d.ts +6 -0
  255. package/dist/hooks/pressGroupContext.d.ts.map +1 -0
  256. package/dist/hooks/pressGroupContext.js +20 -0
  257. package/dist/hooks/rootScrollStyles.d.ts +48 -0
  258. package/dist/hooks/rootScrollStyles.d.ts.map +1 -0
  259. package/dist/hooks/rootScrollStyles.js +207 -0
  260. package/dist/hooks/scrollLockTouchGuard.d.ts +13 -0
  261. package/dist/hooks/scrollLockTouchGuard.d.ts.map +1 -0
  262. package/dist/hooks/scrollLockTouchGuard.js +134 -0
  263. package/dist/hooks/scrollbarGutter.d.ts +4 -4
  264. package/dist/hooks/scrollbarGutter.d.ts.map +1 -1
  265. package/dist/hooks/scrollbarGutter.js +36 -23
  266. package/dist/hooks/useActionGroupTracking.d.ts +53 -0
  267. package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
  268. package/dist/hooks/useActionGroupTracking.js +174 -0
  269. package/dist/hooks/useAnimator.d.ts +41 -0
  270. package/dist/hooks/useAnimator.d.ts.map +1 -0
  271. package/dist/hooks/useAnimator.js +70 -0
  272. package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
  273. package/dist/hooks/useAnnounceRenderedText.js +1 -0
  274. package/dist/hooks/useAttachment.d.ts +1 -1
  275. package/dist/hooks/useAttachment.js +1 -1
  276. package/dist/hooks/useAutoMediaMode.d.ts.map +1 -1
  277. package/dist/hooks/useAutoMediaMode.js +1 -0
  278. package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
  279. package/dist/hooks/useBusyAnnouncement.js +2 -0
  280. package/dist/hooks/useDevWarning.d.ts.map +1 -1
  281. package/dist/hooks/useDevWarning.js +2 -0
  282. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  283. package/dist/hooks/useFocusTrap.js +2 -0
  284. package/dist/hooks/useGridFocus.d.ts +8 -5
  285. package/dist/hooks/useGridFocus.d.ts.map +1 -1
  286. package/dist/hooks/useGridFocus.js +4 -3
  287. package/dist/hooks/useHotkeys.d.ts.map +1 -1
  288. package/dist/hooks/useHotkeys.js +3 -0
  289. package/dist/hooks/useImageMode.d.ts.map +1 -1
  290. package/dist/hooks/useImageMode.js +3 -0
  291. package/dist/hooks/useInputStatusIcon.d.ts +1 -1
  292. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  293. package/dist/hooks/useInputStatusIcon.js +2 -2
  294. package/dist/hooks/useKeyboardHint.js +1 -1
  295. package/dist/hooks/useLongPress.d.ts +8 -9
  296. package/dist/hooks/useLongPress.d.ts.map +1 -1
  297. package/dist/hooks/useLongPress.js +23 -106
  298. package/dist/hooks/useMenuHover.d.ts.map +1 -1
  299. package/dist/hooks/useMenuHover.js +2 -0
  300. package/dist/hooks/useMenuPress.d.ts.map +1 -1
  301. package/dist/hooks/useMenuPress.js +3 -0
  302. package/dist/hooks/useOverflow.d.ts.map +1 -1
  303. package/dist/hooks/useOverflow.js +2 -1
  304. package/dist/hooks/usePressFeedback.d.ts.map +1 -1
  305. package/dist/hooks/usePressFeedback.js +1 -0
  306. package/dist/hooks/useResolvedRequired.d.ts +3 -0
  307. package/dist/hooks/useResolvedRequired.d.ts.map +1 -1
  308. package/dist/hooks/useResolvedRequired.js +3 -0
  309. package/dist/hooks/useScrollLock.d.ts +7 -9
  310. package/dist/hooks/useScrollLock.d.ts.map +1 -1
  311. package/dist/hooks/useScrollLock.js +55 -48
  312. package/dist/hooks/useScrollableArea.d.ts.map +1 -1
  313. package/dist/hooks/useScrollableArea.js +5 -0
  314. package/dist/hooks/useStreamingText.d.ts.map +1 -1
  315. package/dist/hooks/useStreamingText.js +3 -0
  316. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
  317. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
  318. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
  319. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
  320. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
  321. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
  322. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
  323. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
  324. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  325. package/dist/i18n/generated-locales/en.generated.js +30 -0
  326. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  327. package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
  328. package/dist/index.d.ts +1 -0
  329. package/dist/index.d.ts.map +1 -1
  330. package/dist/index.js +4 -0
  331. package/dist/internal/indicatorPress.stylex.d.ts +20 -0
  332. package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
  333. package/dist/internal/indicatorPress.stylex.js +26 -0
  334. package/dist/internal/selectable-card.d.ts +21 -0
  335. package/dist/internal/selectable-card.d.ts.map +1 -0
  336. package/dist/internal/selectable-card.js +20 -0
  337. package/dist/internal/sheetDraft.d.ts +2 -2
  338. package/dist/internal/sheetDraft.js +2 -2
  339. package/dist/motion/animatedLayout.d.ts.map +1 -1
  340. package/dist/motion/animatedLayout.js +7 -7
  341. package/dist/motion/animator.d.ts +14 -14
  342. package/dist/motion/animator.d.ts.map +1 -1
  343. package/dist/motion/animator.js +45 -20
  344. package/dist/motion/progress.d.ts +88 -0
  345. package/dist/motion/progress.d.ts.map +1 -0
  346. package/dist/motion/progress.js +128 -0
  347. package/dist/motion/reducedMotion.d.ts.map +1 -1
  348. package/dist/motion/reducedMotion.js +3 -1
  349. package/dist/motion/uikit/alert.d.ts +41 -0
  350. package/dist/motion/uikit/alert.d.ts.map +1 -0
  351. package/dist/motion/uikit/alert.js +43 -0
  352. package/dist/motion/uikit/index.d.ts +4 -3
  353. package/dist/motion/uikit/index.d.ts.map +1 -1
  354. package/dist/motion/uikit/index.js +4 -3
  355. package/dist/motion/uikit/picker.d.ts +96 -0
  356. package/dist/motion/uikit/picker.d.ts.map +1 -0
  357. package/dist/motion/uikit/picker.js +117 -0
  358. package/dist/privateAttributes/pressGroupItem.stylex.d.ts +22 -0
  359. package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
  360. package/dist/privateAttributes/pressGroupItem.stylex.js +36 -0
  361. package/dist/privateAttributes/reducedMotion.stylex.d.ts +23 -0
  362. package/dist/privateAttributes/reducedMotion.stylex.d.ts.map +1 -0
  363. package/dist/privateAttributes/reducedMotion.stylex.js +40 -0
  364. package/dist/theme/Theme.d.ts.map +1 -1
  365. package/dist/theme/Theme.js +29 -4
  366. package/dist/theme/motionKnobs.d.ts +4 -3
  367. package/dist/theme/motionKnobs.d.ts.map +1 -1
  368. package/dist/theme/motionKnobs.js +3 -2
  369. package/dist/theme/themeMotion.d.ts +6 -0
  370. package/dist/theme/themeMotion.d.ts.map +1 -1
  371. package/dist/theme/themeMotion.js +7 -0
  372. package/dist/utils/dateParser.d.ts.map +1 -1
  373. package/dist/utils/dateParser.js +12 -0
  374. package/dist/utils/focusReturn.d.ts +15 -0
  375. package/dist/utils/focusReturn.d.ts.map +1 -1
  376. package/dist/utils/focusReturn.js +28 -0
  377. package/dist/utils/interactionModality.d.ts.map +1 -1
  378. package/dist/utils/interactionModality.js +4 -0
  379. package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
  380. package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
  381. package/dist/utils/interactionOverlay.stylex.js +3 -2
  382. package/dist/utils/plainDate.d.ts +8 -0
  383. package/dist/utils/plainDate.d.ts.map +1 -1
  384. package/dist/utils/plainDate.js +19 -0
  385. package/dist/utils/pressFeedback.d.ts.map +1 -1
  386. package/dist/utils/pressFeedback.js +20 -6
  387. package/dist/utils/triggerFocus.d.ts +36 -0
  388. package/dist/utils/triggerFocus.d.ts.map +1 -0
  389. package/dist/utils/triggerFocus.js +65 -0
  390. package/locales/en.json +120 -0
  391. package/locales/pseudo.json +90 -0
  392. package/package.json +14 -9
  393. package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
  394. package/src/AlertDialog/AlertDialog.tsx +46 -5
  395. package/src/AppShell/AppShell.tsx +4 -0
  396. package/src/BottomSheet/BottomSheet.tsx +1 -0
  397. package/src/BottomSheet/BottomSheetPanel.tsx +39 -3
  398. package/src/BottomSheet/BottomSheetSwitcher.tsx +5 -0
  399. package/src/BottomSheet/useMobileKeyboard.ts +4 -0
  400. package/src/BottomSheet/useSheetGestures.ts +10 -1
  401. package/src/Button/Button.tsx +26 -4
  402. package/src/Calendar/Calendar.tsx +36 -25
  403. package/src/Carousel/Carousel.tsx +1 -0
  404. package/src/Chat/ChatComposerInput.tsx +2 -0
  405. package/src/Chat/ChatMessageList.tsx +2 -1
  406. package/src/Chat/useChatDictation.ts +1 -0
  407. package/src/Chat/useChatNewMessages.ts +1 -1
  408. package/src/Chat/useChatStreamScroll.ts +2 -0
  409. package/src/Chat/useSpeechRecognition.ts +2 -0
  410. package/src/Chat/useTriggerMenu.tsx +1 -1
  411. package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
  412. package/src/CheckboxInput/CheckboxInput.tsx +38 -15
  413. package/src/CodeBlock/CodeBlock.doc.mjs +9 -1
  414. package/src/CodeBlock/CodeBlock.tsx +41 -4
  415. package/src/CommandPalette/CommandPalette.tsx +1 -0
  416. package/src/CommandPalette/CommandPaletteItem.tsx +1 -0
  417. package/src/ComplexSelector/ComplexSelector.tsx +20 -5
  418. package/src/ContextMenu/ContextMenu.tsx +2 -2
  419. package/src/DateInput/MonthScroller.tsx +8 -2
  420. package/src/DateInput/PickerWheel.tsx +765 -0
  421. package/src/DateInput/TouchDateField.tsx +1 -0
  422. package/src/DateInput/Wheel.tsx +94 -150
  423. package/src/DateInput/useOwnScrollGesture.ts +25 -3
  424. package/src/DateInput/usePointerDragScroll.ts +1 -0
  425. package/src/DateInput/useScrollSettle.ts +2 -0
  426. package/src/DateInput/useWheelListbox.ts +112 -0
  427. package/src/DateInput/wheelOptions.ts +155 -0
  428. package/src/DateInput/wheelPhysics.ts +406 -0
  429. package/src/DateInput/wheelStrip.ts +341 -0
  430. package/src/DateTimeInput/TouchDateTimeField.tsx +2 -0
  431. package/src/Dialog/Dialog.tsx +12 -32
  432. package/src/Drawer/useDrawerDialogPresence.ts +2 -0
  433. package/src/DropdownMenu/useMenuOverflow.ts +3 -0
  434. package/src/Field/Field.tsx +2 -2
  435. package/src/FieldStatus/useFieldStatusAnnouncement.ts +1 -0
  436. package/src/FormLayout/FormLayout.doc.mjs +181 -46
  437. package/src/FormLayout/FormLayout.tsx +5 -1
  438. package/src/HoverCard/HoverCard.doc.mjs +10 -8
  439. package/src/HoverCard/HoverCard.tsx +58 -6
  440. package/src/HoverCard/useHoverCard.doc.mjs +178 -36
  441. package/src/HoverCard/useHoverCard.tsx +49 -54
  442. package/src/Icon/Icon.doc.mjs +49 -8
  443. package/src/Icon/Icon.tsx +15 -7
  444. package/src/IconButton/IconButton.doc.mjs +141 -21
  445. package/src/Item/useSwipeAction.ts +2 -0
  446. package/src/Layer/modalOutlet.ts +2 -0
  447. package/src/Layer/outsidePress.ts +1 -0
  448. package/src/Layer/useLayer.tsx +2 -0
  449. package/src/Layer/useLayerDismissal.ts +2 -0
  450. package/src/Layer/usePressPin.ts +81 -15
  451. package/src/Layer/useTouchTrigger.ts +2 -0
  452. package/src/Lightbox/Lightbox.tsx +19 -0
  453. package/src/MobileNav/MobileNav.tsx +9 -30
  454. package/src/Outline/useOutlineFromDOM.ts +2 -0
  455. package/src/Outline/useScrollSpy.ts +2 -0
  456. package/src/OverflowList/OverflowList.tsx +2 -0
  457. package/src/Popover/Popover.tsx +4 -0
  458. package/src/PowerSearch/PowerSearch.doc.mjs +60 -8
  459. package/src/PowerSearch/PowerSearch.tsx +627 -157
  460. package/src/PowerSearch/PowerSearchBottomSheet.tsx +2525 -0
  461. package/src/PowerSearch/PowerSearchEditPopover.tsx +39 -6
  462. package/src/PowerSearch/PowerSearchFilterEditor.tsx +2 -0
  463. package/src/PowerSearch/PowerSearchToken.tsx +7 -0
  464. package/src/PowerSearch/PowerSearchValueEditor.tsx +244 -58
  465. package/src/PowerSearch/formatFilterValue.ts +55 -17
  466. package/src/PowerSearch/formatTokenValue.ts +222 -0
  467. package/src/PowerSearch/powerSearchDateZone.ts +64 -0
  468. package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
  469. package/src/PowerSearch/types.ts +2 -0
  470. package/src/ProgressBar/ProgressBarTouch.ts +2 -0
  471. package/src/RadioList/RadioList.tsx +3 -2
  472. package/src/RadioList/RadioListItem.tsx +5 -3
  473. package/src/Resizable/Resizable.doc.mjs +5 -4
  474. package/src/Resizable/ResizeHandle.tsx +169 -109
  475. package/src/Resizable/createResizable.ts +831 -0
  476. package/src/Resizable/useResizable.ts +292 -623
  477. package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
  478. package/src/SelectableCard/SelectableCard.tsx +39 -10
  479. package/src/SelectableCard/selectableCardInput.ts +30 -0
  480. package/src/Selector/Selector.tsx +5 -12
  481. package/src/Slider/sliderTouchController.ts +2 -2
  482. package/src/Spinner/Spinner.tsx +77 -63
  483. package/src/Switch/Switch.tsx +2 -6
  484. package/src/Switch/useSwitchTouch.ts +4 -4
  485. package/src/Table/BaseTable.tsx +46 -12
  486. package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
  487. package/src/Table/plugins/filtering/useTableFiltering.tsx +1 -0
  488. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +4 -0
  489. package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +2 -0
  490. package/src/TextInput/TextInput.tsx +11 -10
  491. package/src/TimeInput/TimeInput.tsx +2 -0
  492. package/src/TimeInput/TouchTimeField.tsx +2 -0
  493. package/src/Timer/Timer.tsx +1 -0
  494. package/src/Timestamp/Timestamp.tsx +1 -1
  495. package/src/Toast/Toast.doc.mjs +4 -3
  496. package/src/Toast/Toast.tsx +52 -32
  497. package/src/Toast/ToastViewport.tsx +123 -35
  498. package/src/Toast/types.ts +9 -3
  499. package/src/Toast/useToast.tsx +1 -0
  500. package/src/Tokenizer/Tokenizer.doc.mjs +19 -3
  501. package/src/Tokenizer/Tokenizer.tsx +73 -51
  502. package/src/Tokenizer/TokenizerBottomSheet.tsx +1 -1
  503. package/src/Tokenizer/index.ts +1 -0
  504. package/src/Tooltip/useTooltip.doc.mjs +24 -0
  505. package/src/Tooltip/useTooltip.tsx +61 -56
  506. package/src/Typeahead/BaseTypeahead.tsx +27 -17
  507. package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
  508. package/src/Typeahead/TypeaheadItem.tsx +2 -1
  509. package/src/animator/createAnimator.doc.mjs +153 -0
  510. package/src/animator/createAnimator.ts +324 -0
  511. package/src/gestures/GestureHost.ts +1 -1
  512. package/src/gestures/PressTracker.ts +4 -3
  513. package/src/gestures/README.md +10 -4
  514. package/src/hooks/ModalAnnounceProvider.tsx +1 -0
  515. package/src/hooks/actionGroupTracker.ts +20 -5
  516. package/src/hooks/index.ts +2 -0
  517. package/src/hooks/longPressDetector.ts +273 -0
  518. package/src/hooks/pressGroupContext.ts +21 -0
  519. package/src/hooks/rootScrollStyles.ts +247 -0
  520. package/src/hooks/scrollLockTouchGuard.ts +182 -0
  521. package/src/hooks/scrollbarGutter.ts +41 -26
  522. package/src/hooks/useActionGroupTracking.ts +224 -0
  523. package/src/hooks/useAnimator.doc.mjs +109 -0
  524. package/src/hooks/useAnimator.ts +67 -0
  525. package/src/hooks/useAnnounceRenderedText.ts +1 -0
  526. package/src/hooks/useAttachment.ts +1 -1
  527. package/src/hooks/useAutoMediaMode.ts +1 -0
  528. package/src/hooks/useBusyAnnouncement.ts +2 -0
  529. package/src/hooks/useDevWarning.ts +2 -0
  530. package/src/hooks/useFocusTrap.ts +2 -0
  531. package/src/hooks/useGridFocus.doc.mjs +6 -6
  532. package/src/hooks/useGridFocus.ts +10 -7
  533. package/src/hooks/useHotkeys.ts +2 -0
  534. package/src/hooks/useImageMode.ts +2 -0
  535. package/src/hooks/useInputStatusIcon.tsx +3 -2
  536. package/src/hooks/useKeyboardHint.tsx +1 -1
  537. package/src/hooks/useLongPress.doc.mjs +2 -2
  538. package/src/hooks/useLongPress.ts +32 -122
  539. package/src/hooks/useMenuHover.ts +1 -0
  540. package/src/hooks/useMenuPress.ts +2 -0
  541. package/src/hooks/useOverflow.ts +2 -1
  542. package/src/hooks/usePressFeedback.ts +1 -0
  543. package/src/hooks/useResolvedRequired.ts +3 -0
  544. package/src/hooks/useScrollLock.doc.mjs +51 -12
  545. package/src/hooks/useScrollLock.ts +57 -60
  546. package/src/hooks/useScrollableArea.ts +4 -0
  547. package/src/hooks/useStreamingText.ts +2 -0
  548. package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
  549. package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
  550. package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
  551. package/src/i18n/generated-locales/en.generated.ts +41 -0
  552. package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
  553. package/src/index.ts +13 -0
  554. package/src/internal/indicatorPress.stylex.ts +24 -0
  555. package/src/internal/selectable-card.ts +21 -0
  556. package/src/internal/sheetDraft.ts +2 -2
  557. package/src/motion/MEASUREMENTS.md +18 -0
  558. package/src/motion/README.md +10 -5
  559. package/src/motion/animatedLayout.ts +10 -5
  560. package/src/motion/animator.ts +66 -31
  561. package/src/motion/progress.ts +155 -0
  562. package/src/motion/reducedMotion.ts +3 -1
  563. package/src/motion/uikit/alert.ts +43 -0
  564. package/src/motion/uikit/index.ts +4 -3
  565. package/src/motion/uikit/picker.ts +116 -0
  566. package/src/privateAttributes/pressGroupItem.stylex.ts +44 -0
  567. package/src/privateAttributes/reducedMotion.stylex.ts +45 -0
  568. package/src/theme/Theme.tsx +37 -3
  569. package/src/theme/motionKnobs.ts +4 -3
  570. package/src/theme/themeMotion.ts +7 -0
  571. package/src/utils/dateParser.ts +16 -0
  572. package/src/utils/focusReturn.ts +30 -0
  573. package/src/utils/interactionModality.ts +4 -0
  574. package/src/utils/interactionOverlay.stylex.ts +3 -2
  575. package/src/utils/plainDate.ts +21 -0
  576. package/src/utils/pressFeedback.ts +24 -6
  577. package/src/utils/triggerFocus.ts +80 -0
  578. package/dist/internal/touch-sheet.d.ts +0 -21
  579. package/dist/internal/touch-sheet.d.ts.map +0 -1
  580. package/dist/internal/touch-sheet.js +0 -19
  581. package/src/internal/touch-sheet.ts +0 -21
@@ -53,6 +53,7 @@ import {iconBoxSizeStyles, type IconSize} from '../Icon/IconSize.stylex';
53
53
  import {EDGE_COMP_ATTR} from '../Layout/edgeCompensation.stylex';
54
54
  import {useSize} from '../SizeContext/SizeContext';
55
55
  import {useButtonGroup} from '../ButtonGroup/ButtonGroupContext';
56
+ import {PressGroupContext} from '../hooks/pressGroupContext';
56
57
  import {useInputGroup} from '../InputGroup/InputGroupContext';
57
58
  import {InputGroupInternalContext} from '../InputGroup/InputGroupInternalContext';
58
59
  import {
@@ -77,6 +78,12 @@ import {isRenderable} from '../utils/isRenderable';
77
78
 
78
79
  registerEnglishFallback(english);
79
80
 
81
+ /**
82
+ * Written by the press controller or a group's tracker while a press is
83
+ * believed. Typed `string`, so StyleX reads it as a computed key.
84
+ */
85
+ const PRESSED_ON: string = '[data-astryx-press="on"]';
86
+
80
87
  /**
81
88
  * Base button styles
82
89
  * Pseudo-classes are nested within properties per StyleX recommendation:
@@ -138,7 +145,19 @@ const styles = stylex.create({
138
145
  default: 'scale(0.98)',
139
146
  '@media (pointer: coarse)': 'scale(1)',
140
147
  },
141
- '[data-astryx-press="on"]': 'scale(0.98)',
148
+ [PRESSED_ON]: 'scale(0.98)',
149
+ },
150
+ },
151
+ // A tracked action's own `:active` image paints nothing: the tracker paints
152
+ // the action under the pointer, which need not be the one pressed first.
153
+ trackedOverlay: {
154
+ backgroundSize: {default: null, [`:active:not(${PRESSED_ON})`]: '0 0'},
155
+ },
156
+ // A tracked action's press is painted by its group's tracker alone.
157
+ pressableTracked: {
158
+ transform: {
159
+ default: 'scale(1)',
160
+ [PRESSED_ON]: 'scale(0.98)',
142
161
  },
143
162
  },
144
163
  inactive: {
@@ -147,7 +166,7 @@ const styles = stylex.create({
147
166
  transform: {
148
167
  default: 'none',
149
168
  ':active': 'none',
150
- '[data-astryx-press="on"]': 'none',
169
+ [PRESSED_ON]: 'none',
151
170
  },
152
171
  },
153
172
  disabled: {
@@ -160,7 +179,7 @@ const styles = stylex.create({
160
179
  backgroundImage: {
161
180
  default: 'none',
162
181
  ':active': 'none',
163
- '[data-astryx-press="on"]': 'none',
182
+ [PRESSED_ON]: 'none',
164
183
  },
165
184
  },
166
185
  iconOnly: {
@@ -632,6 +651,7 @@ export function Button({
632
651
  const t = useComponentTranslator();
633
652
  const size = useSize(sizeProp, 'md');
634
653
  const buttonGroup = useButtonGroup();
654
+ const isGroupTracked = use(PressGroupContext);
635
655
  const inputGroup = useInputGroup();
636
656
 
637
657
  const [isPending, startTransition] = useTransition();
@@ -760,11 +780,13 @@ export function Button({
760
780
  sizeStyles[size],
761
781
  isIconOnly && styles.iconOnly,
762
782
  interactionOverlayStyles.backgroundImage,
783
+ isGroupTracked && styles.trackedOverlay,
763
784
  buttonDisabled && styles.inactive,
764
785
  isTrueDisabled && styles.disabled,
765
786
  useAriaDisabled && styles.ariaDisabled,
766
787
  renderAsLink && styles.link,
767
- !buttonGroup && styles.pressable,
788
+ !buttonGroup &&
789
+ (isGroupTracked ? styles.pressableTracked : styles.pressable),
768
790
  buttonGroup &&
769
791
  (buttonGroup.orientation === 'horizontal'
770
792
  ? groupStyles.horizontal
@@ -61,7 +61,10 @@ import {
61
61
  plainDateWeekFieldName,
62
62
  DATE_FORMAT_WITH_WEEKDAY,
63
63
  } from '../utils/plainDate';
64
- import {plainDateFormatStandaloneMonthYear} from '../utils/plainDate';
64
+ import {
65
+ plainDateFormatDayNumber,
66
+ plainDateFormatStandaloneMonthYear,
67
+ } from '../utils/plainDate';
65
68
  import {mergeProps, composeEventHandlers, rtlStyles} from '../utils';
66
69
  import {focusOutlineProps} from '../utils/focusOutline.stylex';
67
70
  import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
@@ -104,8 +107,8 @@ import english from '../i18n/generated-english/Calendar/Calendar.generated';
104
107
 
105
108
  registerEnglishFallback(english);
106
109
 
107
- /** How a month navigation moves the focused day: by its row offset in days, or by whole months. */
108
- type NavigationUnit = 'days' | 'months';
110
+ /** How a month navigation moves the focused day: by its row offset in days, or by whole months or years. */
111
+ type NavigationUnit = 'days' | 'months' | 'years';
109
112
 
110
113
  /** Imperative handle for Calendar handleRef */
111
114
  export interface CalendarHandle {
@@ -518,13 +521,14 @@ export function Calendar({ref, ...props}: CalendarProps) {
518
521
  !(minDateForKeys && plainDateIsBefore(pd, minDateForKeys)) &&
519
522
  !(maxDateForKeys && plainDateIsAfter(pd, maxDateForKeys));
520
523
  let targetPd: PlainDate;
521
- if (unit === 'months') {
522
- // A page targets the same day of the month a month away (clamped to
523
- // that month's length). Past `min`/`max` nothing moves; a month with
524
- // no enabled day is no destination either, the same as an arrow with
525
- // no enabled day in its direction; a target disabled by a constraint
526
- // lands on that month's first enabled day instead.
527
- const candidate = plainDateAddMonths(currentPd, delta);
524
+ if (unit === 'months' || unit === 'years') {
525
+ // A page or a year step keeps the day of the month and clamps it to the
526
+ // target month's length. A month with no enabled day is no target, the
527
+ // same as for an arrow.
528
+ const candidate = plainDateAddMonths(
529
+ currentPd,
530
+ unit === 'years' ? delta * 12 : delta,
531
+ );
528
532
  if (!inRange(candidate)) {
529
533
  return;
530
534
  }
@@ -961,20 +965,27 @@ function MonthGrid({
961
965
  [getFocusedDate, onNavigateNext],
962
966
  );
963
967
 
964
- // Handle PageUp/PageDown
965
- const handlePageUp = useCallback(() => {
966
- const focusedDate = getFocusedDate();
967
- if (focusedDate) {
968
- onNavigatePrevious?.(focusedDate, 1, 'months');
969
- }
970
- }, [getFocusedDate, onNavigatePrevious]);
968
+ // PageUp/PageDown move by a month, and with Shift by a year (APG date
969
+ // picker dialog).
970
+ const handlePageUp = useCallback(
971
+ (e: React.KeyboardEvent) => {
972
+ const focusedDate = getFocusedDate();
973
+ if (focusedDate) {
974
+ onNavigatePrevious?.(focusedDate, 1, e.shiftKey ? 'years' : 'months');
975
+ }
976
+ },
977
+ [getFocusedDate, onNavigatePrevious],
978
+ );
971
979
 
972
- const handlePageDown = useCallback(() => {
973
- const focusedDate = getFocusedDate();
974
- if (focusedDate) {
975
- onNavigateNext?.(focusedDate, 1, 'months');
976
- }
977
- }, [getFocusedDate, onNavigateNext]);
980
+ const handlePageDown = useCallback(
981
+ (e: React.KeyboardEvent) => {
982
+ const focusedDate = getFocusedDate();
983
+ if (focusedDate) {
984
+ onNavigateNext?.(focusedDate, 1, e.shiftKey ? 'years' : 'months');
985
+ }
986
+ },
987
+ [getFocusedDate, onNavigateNext],
988
+ );
978
989
 
979
990
  // Grid focus navigation.
980
991
  //
@@ -1155,7 +1166,7 @@ function MonthGrid({
1155
1166
  <div
1156
1167
  role="rowheader"
1157
1168
  {...stylex.props(monthGridStyles.weekNumber)}>
1158
- {weekNum}
1169
+ {plainDateFormatDayNumber(weekNum, locale)}
1159
1170
  </div>
1160
1171
  )}
1161
1172
  {week.map((day, dayIndex) => {
@@ -1422,7 +1433,7 @@ function DayCell({
1422
1433
  state.effectivelyDisabled && dayCellTheme.dayDisabled,
1423
1434
  ),
1424
1435
  )}>
1425
- {dayNumber}
1436
+ {plainDateFormatDayNumber(dayNumber, locale)}
1426
1437
  </button>
1427
1438
  </div>
1428
1439
  );
@@ -369,6 +369,7 @@ export function Carousel({
369
369
  lightDismiss: false,
370
370
  });
371
371
 
372
+ // Syncs the layer with `hasButtons`.
372
373
  useEffect(() => {
373
374
  if (hasButtons) {
374
375
  layer.show();
@@ -529,6 +529,7 @@ export function ChatComposerInput(props: ChatComposerInputProps) {
529
529
  };
530
530
  }, [inputControlRef, focusEditableAtEnd]);
531
531
 
532
+ // Syncs the contentEditable DOM with the controlled `value`.
532
533
  useEffect(() => {
533
534
  if (controlledValue === undefined || !editableRef.current) {
534
535
  return;
@@ -650,6 +651,7 @@ export function ChatComposerInput(props: ChatComposerInputProps) {
650
651
  }
651
652
  : triggerMenu.ariaProps;
652
653
 
654
+ // Syncs the trigger menu's pending searches with `isDisabled`.
653
655
  useEffect(() => {
654
656
  if (isDisabled && triggerMenu.state.isActive) {
655
657
  // Reset also cancels pending searches, so late results cannot reopen
@@ -265,7 +265,8 @@ export function ChatMessageList({
265
265
  children !== false &&
266
266
  !(Array.isArray(children) && children.length === 0);
267
267
 
268
- // IntersectionObserver for scroll-to-top infinite scroll
268
+ // Syncs an IntersectionObserver on the top sentinel with `scrollToTopAction`.
269
+ // The action runs when the sentinel comes into view.
269
270
  useEffect(() => {
270
271
  const scrollContainer = layoutContext?.scrollContainerRef?.current;
271
272
  if (!scrollToTopAction || !sentinelRef.current) {
@@ -395,6 +395,7 @@ export function useChatDictation(
395
395
  [userTransform],
396
396
  );
397
397
 
398
+ // Releases the audio analyser and the animation frame on unmount.
398
399
  useEffect(() => {
399
400
  return () => {
400
401
  analyserRef.current?.cleanup();
@@ -121,7 +121,7 @@ export function useChatNewMessages({
121
121
  [attach, detach],
122
122
  );
123
123
 
124
- // Cleanup on unmount
124
+ // Releases the new-message tracking on unmount.
125
125
  useEffect(() => {
126
126
  return () => detach();
127
127
  }, [detach]);
@@ -358,6 +358,8 @@ export function useChatStreamScroll({
358
358
 
359
359
  // --- Event listeners ---
360
360
 
361
+ // Syncs scroll and scrollend listeners on the stream container with
362
+ // `enabled`.
361
363
  useEffect(() => {
362
364
  const el = scrollRef.current;
363
365
  if (!el || !enabled) {
@@ -317,6 +317,8 @@ export function useSpeechRecognition(
317
317
  transformTranscript,
318
318
  };
319
319
 
320
+ // Releases speech recognition, the audio analyser and the animation frame on
321
+ // unmount.
320
322
  useEffect(() => {
321
323
  return () => {
322
324
  recognitionRef.current?.abort();
@@ -452,7 +452,7 @@ export function useTriggerMenu(
452
452
  });
453
453
  const {show: showPopover, hide: hidePopover} = popover;
454
454
 
455
- // Cleanup on unmount
455
+ // Releases the search timer and the anchor span on unmount.
456
456
  useEffect(() => {
457
457
  return () => {
458
458
  if (searchTimeoutRef.current) {
@@ -151,6 +151,15 @@ export const docs = {
151
151
  },
152
152
  {className: 'astryx-checkbox-label'},
153
153
  ],
154
+ vars: [
155
+ {
156
+ name: '--_indicator-press-image',
157
+ description:
158
+ "The row's touch press image, handed down to a first-party indicator that paints its own press. Set from the press paint only while the row itself is pressed; only this row declares it.",
159
+ default: 'none',
160
+ private: true,
161
+ },
162
+ ],
154
163
  },
155
164
  usage: {
156
165
  accessibility: [
@@ -390,6 +399,15 @@ export const docsZh = {
390
399
  },
391
400
  {className: 'astryx-checkbox-label'},
392
401
  ],
402
+ vars: [
403
+ {
404
+ name: '--_indicator-press-image',
405
+ description:
406
+ '复选框行的触摸按下图像,传递给自行绘制按下效果的第一方指示器。仅在该行自身被按下时根据按下涂层设置,只有该行声明它。',
407
+ default: 'none',
408
+ private: true,
409
+ },
410
+ ],
393
411
  },
394
412
  };
395
413
 
@@ -46,11 +46,11 @@ import {useTooltip} from '../Tooltip/useTooltip';
46
46
  import {mergeProps} from '../utils/mergeProps';
47
47
  import {rtlStyles} from '../utils/rtlStyles';
48
48
  import {indicatorScope} from '../Indicator/indicator.markers.stylex';
49
+ import {indicatorPressScope} from '../internal/indicatorPress.stylex';
49
50
  import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
50
51
  import {useIndicatorFocusRing} from '../hooks/useIndicatorFocusRing';
51
52
  import {useBusyAnnouncement} from '../hooks/useBusyAnnouncement';
52
53
  import {usePressFeedback} from '../hooks/usePressFeedback';
53
- import {useResolvedRequired} from '../hooks/useResolvedRequired';
54
54
  import {useIndicator} from '../Indicator/useIndicator';
55
55
  import {themeProps} from '../utils/themeProps';
56
56
 
@@ -63,6 +63,11 @@ import english from '../i18n/generated-english/CheckboxInput/CheckboxInput.gener
63
63
 
64
64
  registerEnglishFallback(english);
65
65
 
66
+ /** Written by the touch press controller while the row is pressed. */
67
+ const PRESSED_ON = '[data-astryx-press="on"]';
68
+ /** Written by the touch press controller for the press's release. */
69
+ const PRESSED_FADING = '[data-astryx-press="fading"]';
70
+
66
71
  // The touch press's paint, declared by the shared overlay styles on the
67
72
  // element the controller writes to (`pressedAlpha`) at the press's strength,
68
73
  // 1 while on and 1 → 0 over the release, and inherited resolved by the layer
@@ -78,6 +83,20 @@ const styles = stylex.create({
78
83
  containerLabelHidden: {
79
84
  gap: 0,
80
85
  },
86
+ // An indicator in another package may not name this row's private press
87
+ // attribute. So the row hands its touch press image down to an indicator
88
+ // that paints its own press, but only in its own press states. A pressed
89
+ // ancestor row reaches it no more than it reaches the built-in box. The
90
+ // property has no default: a layered stylesheet ranks a default above the
91
+ // arms. Only this row declares it. A menu item paints its own press, so a
92
+ // mapped indicator there paints none.
93
+ indicatorPressImage: {
94
+ '--_indicator-press-image': {
95
+ default: null,
96
+ [PRESSED_ON]: 'var(--_press-paint-image)',
97
+ [PRESSED_FADING]: 'var(--_press-paint-image)',
98
+ },
99
+ },
81
100
  checkboxWrapper: {
82
101
  position: 'relative',
83
102
  display: 'flex',
@@ -86,15 +105,22 @@ const styles = stylex.create({
86
105
  flexShrink: 0,
87
106
  isolation: 'isolate',
88
107
  },
89
- // The owner paints this layer over the resolved indicator, so a theme
90
- // replacement cannot accidentally drop the component's pressed contract.
108
+ // The owner paints this layer over the resolved indicator, so a plain theme
109
+ // replacement keeps the pressed feedback. An indicator with
110
+ // `indicatorPressScope` paints its own press from what the row hands down,
111
+ // so this layer stays off over it.
91
112
  // Two pointers, two press models (see interactionOverlay.stylex.ts): a
92
113
  // mouse keeps `:active`; under a coarse pointer that arm is dropped and the
93
114
  // touch press controller writes `data-astryx-press` on the row, which this layer
94
115
  // reads off the same scope marker as the hover tint.
95
116
  indicatorPressOverlay: {
96
117
  '::after': {
97
- content: '""',
118
+ // `when.descendant` takes a pseudo-class; `:is(*)` matches any marked
119
+ // indicator.
120
+ content: {
121
+ default: '""',
122
+ [stylex.when.descendant(':is(*)', indicatorPressScope)]: 'none',
123
+ },
98
124
  position: 'absolute',
99
125
  inset: 0,
100
126
  borderRadius: radiusVars['--radius-inner'],
@@ -112,15 +138,14 @@ const styles = stylex.create({
112
138
  // what moves. Coarse pointers only, like the drop above.
113
139
  backgroundImage: {
114
140
  default: null,
115
- [stylex.when.ancestor('[data-astryx-press="on"]', indicatorScope)]: {
141
+ [stylex.when.ancestor(PRESSED_ON, indicatorScope)]: {
142
+ default: null,
143
+ '@media (pointer: coarse)': pressedOverlayImage,
144
+ },
145
+ [stylex.when.ancestor(PRESSED_FADING, indicatorScope)]: {
116
146
  default: null,
117
147
  '@media (pointer: coarse)': pressedOverlayImage,
118
148
  },
119
- [stylex.when.ancestor('[data-astryx-press="fading"]', indicatorScope)]:
120
- {
121
- default: null,
122
- '@media (pointer: coarse)': pressedOverlayImage,
123
- },
124
149
  },
125
150
  },
126
151
  },
@@ -352,10 +377,6 @@ export function CheckboxInput({
352
377
  const id = idProp || generatedId;
353
378
  const descriptionID = useId();
354
379
  const statusMessageID = useId();
355
- // Announce the effective required state (form default included) while the
356
- // native `required` stays bound to the explicit `isRequired` so a layout
357
- // default never switches on browser validation.
358
- const isEffectivelyRequired = useResolvedRequired({isRequired, isOptional});
359
380
 
360
381
  const [, startTransition] = useTransition();
361
382
  const [optimisticValue, setOptimisticValue] = useOptimistic(value);
@@ -450,6 +471,7 @@ export function CheckboxInput({
450
471
  // Hover and focus reach the checkbox visual through this ancestor
451
472
  // marker rather than props, so the whole row drives it.
452
473
  !isDisabled && indicatorScope,
474
+ !isDisabled && styles.indicatorPressImage,
453
475
  // The touch press's strength and release live on the row the
454
476
  // controller writes to; the layer over the checkbox box inherits
455
477
  // and paints it.
@@ -484,7 +506,8 @@ export function CheckboxInput({
484
506
  onClick={isDisabled ? undefined : rest.onClick}
485
507
  readOnly={isReadOnly}
486
508
  required={isRequired}
487
- aria-required={isEffectivelyRequired ? 'true' : undefined}
509
+ // A form's required default sets nothing here: an unchecked box is an answer.
510
+ aria-required={isRequired ? 'true' : undefined}
488
511
  onChange={e => {
489
512
  if (isDisabled || isBusy || isReadOnly) {
490
513
  // Activation clears the native mixed state; React restores
@@ -51,10 +51,18 @@ export const docs = {
51
51
  description: 'Show a line number gutter.',
52
52
  default: 'false',
53
53
  },
54
+ {
55
+ name: 'startLineNumber',
56
+ type: 'number',
57
+ description:
58
+ 'First line number shown in the gutter. The gutter shows file coordinates (startLineNumber + index) so a code excerpt reads with its real line numbers. highlightLines uses the same file coordinates. Values below 1 clamp to 1.',
59
+ default: '1',
60
+ },
54
61
  {
55
62
  name: 'highlightLines',
56
63
  type: 'number[]',
57
- description: '1-indexed line numbers to highlight.',
64
+ description:
65
+ '1-indexed line numbers to highlight, in the same file coordinates as the gutter (see startLineNumber). Out-of-range entries render no highlight.',
58
66
  },
59
67
  {
60
68
  name: 'isDiff',
@@ -456,6 +456,7 @@ const LINE_CHUNK_THRESHOLD = 100;
456
456
  const CodeChunk = React.memo(function CodeChunk({
457
457
  lines,
458
458
  startIndex,
459
+ startLineNumber,
459
460
  highlightSet,
460
461
  diffKinds,
461
462
  renderLineContent,
@@ -463,6 +464,7 @@ const CodeChunk = React.memo(function CodeChunk({
463
464
  }: {
464
465
  lines: string[];
465
466
  startIndex: number;
467
+ startLineNumber: number;
466
468
  highlightSet: Set<number> | null;
467
469
  diffKinds: ReadonlyArray<DiffLineKind> | null;
468
470
  renderLineContent: (line: string, lineIndex: number) => React.ReactNode;
@@ -472,11 +474,12 @@ const CodeChunk = React.memo(function CodeChunk({
472
474
  <>
473
475
  {lines.map((line, j) => {
474
476
  const i = startIndex + j;
477
+ const lineNumber = startLineNumber + i;
475
478
  const diffKind = diffKinds?.[i];
476
479
  return (
477
480
  <div
478
481
  key={i}
479
- data-line={i + 1}
482
+ data-line={lineNumber}
480
483
  data-diff={diffKind === 'context' ? undefined : diffKind}
481
484
  {...stylex.props(
482
485
  styles.line,
@@ -488,7 +491,8 @@ const CodeChunk = React.memo(function CodeChunk({
488
491
  diffKind === 'header' && styles.lineDiffHeader,
489
492
  // Last on purpose: a highlight replaces a diff tint rather than
490
493
  // stacking on it, so tokens keep their single-paint contrast.
491
- (highlightSet?.has(i + 1) ?? false) && styles.lineHighlighted,
494
+ (highlightSet?.has(lineNumber) ?? false) &&
495
+ styles.lineHighlighted,
492
496
  )}>
493
497
  {renderLineContent(line, i)}
494
498
  </div>
@@ -504,6 +508,7 @@ function renderLines(
504
508
  diffKinds: ReadonlyArray<DiffLineKind> | null,
505
509
  renderLineContent: (line: string, lineIndex: number) => React.ReactNode,
506
510
  lineNumbers: boolean,
511
+ startLineNumber: number,
507
512
  chunkSize: number = LINE_CHUNK_SIZE,
508
513
  ): React.ReactNode {
509
514
  chunkSize = Math.max(1, Math.floor(chunkSize));
@@ -513,6 +518,7 @@ function renderLines(
513
518
  <CodeChunk
514
519
  lines={lines}
515
520
  startIndex={0}
521
+ startLineNumber={startLineNumber}
516
522
  highlightSet={highlightSet}
517
523
  diffKinds={diffKinds}
518
524
  renderLineContent={renderLineContent}
@@ -536,6 +542,7 @@ function renderLines(
536
542
  <CodeChunk
537
543
  lines={chunkLines}
538
544
  startIndex={start}
545
+ startLineNumber={startLineNumber}
539
546
  highlightSet={highlightSet}
540
547
  diffKinds={diffKinds}
541
548
  renderLineContent={renderLineContent}
@@ -566,6 +573,15 @@ export interface CodeBlockProps extends BaseProps<HTMLPreElement> {
566
573
  title?: string;
567
574
  hasLanguageLabel?: boolean;
568
575
  hasLineNumbers?: boolean;
576
+ /**
577
+ * First line's number in the source file. The gutter shows file
578
+ * coordinates (`startLineNumber + index`) instead of starting at 1, so a
579
+ * code excerpt reads with its real line numbers. `highlightLines` uses the
580
+ * same file coordinates. Values below 1 clamp to 1.
581
+ * @default 1
582
+ */
583
+ startLineNumber?: number;
584
+ /** 1-indexed line numbers to highlight, in the same file coordinates as the gutter (see `startLineNumber`). Out-of-range entries render no highlight. */
569
585
  highlightLines?: number[];
570
586
  /**
571
587
  * Render the code as a unified diff over `language`: lines starting with
@@ -792,6 +808,7 @@ function SpanCodeContent({
792
808
  sizeStyle,
793
809
  hasLineNumbers,
794
810
  maxDigits,
811
+ startLineNumber,
795
812
  }: {
796
813
  lines: string[];
797
814
  tokenLines: TokenLine[];
@@ -802,7 +819,10 @@ function SpanCodeContent({
802
819
  sizeStyle: stylex.StyleXStyles;
803
820
  hasLineNumbers: boolean;
804
821
  maxDigits: number;
822
+ startLineNumber: number;
805
823
  }) {
824
+ // Syncs the document's ::highlight() stylesheet. The rules go in one time,
825
+ // before layout reads.
806
826
  useInsertionEffect(() => {
807
827
  ensureHighlightStyles();
808
828
  }, []);
@@ -861,6 +881,7 @@ function SpanCodeContent({
861
881
  diffKinds,
862
882
  renderLineContent,
863
883
  hasLineNumbers,
884
+ startLineNumber,
864
885
  )}
865
886
  </code>
866
887
  );
@@ -879,6 +900,7 @@ function RangeCodeContent({
879
900
  sizeStyle,
880
901
  hasLineNumbers,
881
902
  maxDigits,
903
+ startLineNumber,
882
904
  }: {
883
905
  lines: string[];
884
906
  tokenLines: TokenLine[];
@@ -888,6 +910,7 @@ function RangeCodeContent({
888
910
  sizeStyle: stylex.StyleXStyles;
889
911
  hasLineNumbers: boolean;
890
912
  maxDigits: number;
913
+ startLineNumber: number;
891
914
  }) {
892
915
  const codeRef = useRef<HTMLElement>(null);
893
916
 
@@ -902,6 +925,8 @@ function RangeCodeContent({
902
925
  }
903
926
  }, []);
904
927
 
928
+ // Syncs the CSS.highlights registry with the token ranges. It applies them in
929
+ // chunks.
905
930
  useEffect(() => {
906
931
  if (!hasHighlightAPI()) {
907
932
  return;
@@ -939,6 +964,7 @@ function RangeCodeContent({
939
964
  diffKinds,
940
965
  renderLineContent,
941
966
  hasLineNumbers,
967
+ startLineNumber,
942
968
  )}
943
969
  </code>
944
970
  );
@@ -963,6 +989,7 @@ export function CodeBlock({
963
989
  title,
964
990
  hasLanguageLabel = true,
965
991
  hasLineNumbers = false,
992
+ startLineNumber = 1,
966
993
  highlightLines,
967
994
  isDiff = false,
968
995
  hasCopyButton = true,
@@ -1019,6 +1046,12 @@ export function CodeBlock({
1019
1046
  customTokenizer,
1020
1047
  );
1021
1048
  const diffKinds = diff?.kinds ?? null;
1049
+ // File coordinates for the gutter and highlights. Values below 1 clamp to
1050
+ // 1 so the gutter never shows a 0 or negative line number.
1051
+ const effectiveStartLineNumber =
1052
+ Number.isFinite(startLineNumber) && startLineNumber > 1
1053
+ ? Math.floor(startLineNumber)
1054
+ : 1;
1022
1055
  const highlightSet = useMemo(
1023
1056
  () => (highlightLines ? new Set(highlightLines) : null),
1024
1057
  [highlightLines],
@@ -1032,8 +1065,10 @@ export function CodeBlock({
1032
1065
  }, [code, copy, onCopy]);
1033
1066
 
1034
1067
  const sizeStyle = size === 'sm' ? styles.sizeSm : styles.sizeMd;
1035
- // Digits in the largest line number — sizes the gutter column width.
1036
- const maxLineDigits = String(lines.length).length;
1068
+ // Digits in the largest visible line number — sizes the gutter column width.
1069
+ const maxLineDigits = String(
1070
+ effectiveStartLineNumber + lines.length - 1,
1071
+ ).length;
1037
1072
  // With the diff layer on, the label and viewport name say so: `diff` over
1038
1073
  // plaintext, `tsx diff` over a language — so a diff keeps its header,
1039
1074
  // collapse control, and a name that still matches a `diff` fence.
@@ -1219,6 +1254,7 @@ export function CodeBlock({
1219
1254
  sizeStyle={sizeStyle}
1220
1255
  hasLineNumbers={hasLineNumbers}
1221
1256
  maxDigits={maxLineDigits}
1257
+ startLineNumber={effectiveStartLineNumber}
1222
1258
  />
1223
1259
  ) : (
1224
1260
  <RangeCodeContent
@@ -1230,6 +1266,7 @@ export function CodeBlock({
1230
1266
  sizeStyle={sizeStyle}
1231
1267
  hasLineNumbers={hasLineNumbers}
1232
1268
  maxDigits={maxLineDigits}
1269
+ startLineNumber={effectiveStartLineNumber}
1233
1270
  />
1234
1271
  )}
1235
1272
  </div>
@@ -509,6 +509,7 @@ export function CommandPalette<T extends SearchableItem = SearchableItem>({
509
509
  const runSearchRef = useRef(runSearch);
510
510
  runSearchRef.current = runSearch;
511
511
 
512
+ // Syncs the search source with `isOpen`. An open runs the empty-query search.
512
513
  useEffect(() => {
513
514
  if (isOpen) {
514
515
  runSearchRef.current('');
@@ -155,6 +155,7 @@ export function CommandPaletteItem({
155
155
  (ctx ? ctx.highlightedIndex === itemIndex && itemIndex >= 0 : false);
156
156
  const isSelected = controlledSelected ?? (ctx ? ctx.value === value : false);
157
157
 
158
+ // Syncs the scroll position of a standalone item with `isHighlighted`.
158
159
  useEffect(() => {
159
160
  // Inside CommandPalette the shared useHighlightedOptionScroll (via
160
161
  // useCombobox) is the single scrollIntoView owner (#6077); a second owner