@astryxdesign/core 0.7.8 → 0.7.9-canary.07992bb

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 (403) hide show
  1. package/dist/AppShell/observeMainOverflow.d.ts.map +1 -1
  2. package/dist/AppShell/observeMainOverflow.js +9 -6
  3. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  4. package/dist/BottomSheet/BottomSheet.js +5 -0
  5. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  6. package/dist/BottomSheet/BottomSheetPanel.js +40 -8
  7. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  8. package/dist/BottomSheet/useSheetGestures.js +61 -21
  9. package/dist/Calendar/Calendar.d.ts +14 -2
  10. package/dist/Calendar/Calendar.d.ts.map +1 -1
  11. package/dist/Calendar/Calendar.js +63 -74
  12. package/dist/Calendar/getInitialFocusDate.d.ts +4 -1
  13. package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
  14. package/dist/Calendar/getInitialFocusDate.js +7 -5
  15. package/dist/Calendar/hooks/useCalendarDays.d.ts +19 -2
  16. package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
  17. package/dist/Calendar/hooks/useCalendarDays.js +57 -64
  18. package/dist/Calendar/hooks/useCalendarNavigation.d.ts +28 -3
  19. package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
  20. package/dist/Calendar/hooks/useCalendarNavigation.js +33 -22
  21. package/dist/Calendar/styles.d.ts +1 -1
  22. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  23. package/dist/CheckboxInput/CheckboxInput.js +54 -11
  24. package/dist/ClickableCard/ClickableCard.d.ts +1 -1
  25. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  26. package/dist/ClickableCard/ClickableCard.js +5 -1
  27. package/dist/DateInput/DateInput.d.ts.map +1 -1
  28. package/dist/DateInput/DateInput.js +4 -1
  29. package/dist/DateInput/PickerWheel.d.ts.map +1 -1
  30. package/dist/DateInput/PickerWheel.js +7 -1
  31. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  32. package/dist/DateRangeInput/DateRangeInput.js +5 -2
  33. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  34. package/dist/DateTimeInput/DateTimeInput.js +4 -1
  35. package/dist/Dialog/Dialog.d.ts +2 -1
  36. package/dist/Dialog/Dialog.d.ts.map +1 -1
  37. package/dist/Dialog/Dialog.js +12 -1
  38. package/dist/Drawer/useDrawerDialogPresence.d.ts +2 -1
  39. package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
  40. package/dist/Drawer/useDrawerDialogPresence.js +11 -2
  41. package/dist/DropdownMenu/DropdownMenu.d.ts +9 -1
  42. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  43. package/dist/DropdownMenu/DropdownMenu.js +9 -4
  44. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
  45. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -2
  46. package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
  47. package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
  48. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
  49. package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -2
  50. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  51. package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -2
  52. package/dist/Field/inputDisabledFocus.d.ts +4 -4
  53. package/dist/Field/inputStyles.stylex.d.ts +1 -1
  54. package/dist/FileInput/FileInput.d.ts.map +1 -1
  55. package/dist/FileInput/FileInput.js +16 -2
  56. package/dist/HoverCard/useHoverCard.d.ts +3 -1
  57. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  58. package/dist/Icon/Icon.d.ts +1 -1
  59. package/dist/InfoTip/InfoTip.d.ts +1 -0
  60. package/dist/InfoTip/InfoTip.d.ts.map +1 -1
  61. package/dist/InfoTip/InfoTip.js +1 -0
  62. package/dist/InputGroup/InputGroup.d.ts +4 -3
  63. package/dist/InputGroup/InputGroup.d.ts.map +1 -1
  64. package/dist/InputGroup/InputGroup.js +2 -2
  65. package/dist/InputGroup/groupStyles.d.ts +1 -1
  66. package/dist/InputGroup/groupStyles.d.ts.map +1 -1
  67. package/dist/InputGroup/groupStyles.js +1 -1
  68. package/dist/Item/Item.d.ts +2 -1
  69. package/dist/Item/Item.d.ts.map +1 -1
  70. package/dist/Item/Item.js +29 -6
  71. package/dist/Layer/holdEntranceInput.d.ts +24 -0
  72. package/dist/Layer/holdEntranceInput.d.ts.map +1 -0
  73. package/dist/Layer/holdEntranceInput.js +65 -0
  74. package/dist/Layer/inputHold.d.ts +49 -0
  75. package/dist/Layer/inputHold.d.ts.map +1 -0
  76. package/dist/Layer/inputHold.js +636 -0
  77. package/dist/Layer/preserveAnimations.d.ts +1 -5
  78. package/dist/Layer/preserveAnimations.d.ts.map +1 -1
  79. package/dist/Layer/preserveAnimations.js +12 -214
  80. package/dist/Layer/useLayer.d.ts +3 -1
  81. package/dist/Layer/useLayer.d.ts.map +1 -1
  82. package/dist/Layer/useLayer.js +64 -4
  83. package/dist/Layout/LayoutContent.d.ts +3 -1
  84. package/dist/Layout/LayoutContent.d.ts.map +1 -1
  85. package/dist/Layout/LayoutContent.js +12 -4
  86. package/dist/Layout/LayoutPanel.d.ts +4 -1
  87. package/dist/Layout/LayoutPanel.d.ts.map +1 -1
  88. package/dist/Layout/LayoutPanel.js +13 -4
  89. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  90. package/dist/Lightbox/Lightbox.js +4 -0
  91. package/dist/MetadataList/MetadataList.js +1 -1
  92. package/dist/MobileNav/MobileNav.d.ts +11 -1
  93. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  94. package/dist/MobileNav/MobileNav.js +39 -1
  95. package/dist/MoreMenu/MoreMenu.d.ts +5 -3
  96. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  97. package/dist/NumberInput/NumberInput.d.ts +4 -2
  98. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  99. package/dist/NumberInput/NumberInput.js +244 -11
  100. package/dist/Popover/usePopover.d.ts +1 -0
  101. package/dist/Popover/usePopover.d.ts.map +1 -1
  102. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  103. package/dist/PowerSearch/PowerSearch.js +12 -5
  104. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
  105. package/dist/PowerSearch/PowerSearchBottomSheet.js +4 -2
  106. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  107. package/dist/PowerSearch/PowerSearchToken.js +3 -1
  108. package/dist/PowerSearch/formatFilterValue.d.ts +9 -3
  109. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  110. package/dist/PowerSearch/formatFilterValue.js +14 -11
  111. package/dist/PowerSearch/formatTokenValue.d.ts +6 -2
  112. package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
  113. package/dist/PowerSearch/formatTokenValue.js +6 -3
  114. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  115. package/dist/RadioList/RadioListItem.js +22 -4
  116. package/dist/SelectableCard/SelectableCard.d.ts +1 -1
  117. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  118. package/dist/SelectableCard/SelectableCard.js +5 -1
  119. package/dist/Spinner/Spinner.d.ts.map +1 -1
  120. package/dist/Spinner/Spinner.js +14 -71
  121. package/dist/Spinner/index.d.ts +1 -1
  122. package/dist/Spinner/index.d.ts.map +1 -1
  123. package/dist/Spinner/spinnerRotor.d.ts +28 -0
  124. package/dist/Spinner/spinnerRotor.d.ts.map +1 -0
  125. package/dist/Spinner/spinnerRotor.js +98 -0
  126. package/dist/Stack/StackItem.d.ts +8 -4
  127. package/dist/Stack/StackItem.d.ts.map +1 -1
  128. package/dist/Stack/StackItem.js +17 -4
  129. package/dist/Switch/Switch.d.ts.map +1 -1
  130. package/dist/Switch/Switch.js +13 -10
  131. package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
  132. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  133. package/dist/Timestamp/Timestamp.js +14 -8
  134. package/dist/Timestamp/formatInstant.d.ts +10 -1
  135. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  136. package/dist/Timestamp/formatInstant.js +13 -27
  137. package/dist/Timestamp/tooltipEntries.d.ts +5 -3
  138. package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
  139. package/dist/Timestamp/tooltipEntries.js +6 -4
  140. package/dist/Token/Token.d.ts.map +1 -1
  141. package/dist/Token/Token.js +9 -0
  142. package/dist/Token/TokenLink.d.ts +1 -1
  143. package/dist/Token/TokenLink.d.ts.map +1 -1
  144. package/dist/Token/TokenLink.js +4 -1
  145. package/dist/Tokenizer/Tokenizer.d.ts +14 -10
  146. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  147. package/dist/Tokenizer/Tokenizer.js +189 -89
  148. package/dist/Tooltip/useTooltip.d.ts +3 -1
  149. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  150. package/dist/Tooltip/useTooltip.js +162 -59
  151. package/dist/TreeList/TreeListItem.d.ts +2 -1
  152. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  153. package/dist/TreeList/TreeListItem.js +27 -3
  154. package/dist/astryx.css +45 -18
  155. package/dist/gestures/GestureHost.d.ts +2 -2
  156. package/dist/gestures/GestureHost.d.ts.map +1 -1
  157. package/dist/gestures/GestureHost.js +21 -6
  158. package/dist/gestures/PanGestureRecognizer.d.ts +11 -1
  159. package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
  160. package/dist/gestures/PanGestureRecognizer.js +15 -1
  161. package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +6 -1
  162. package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
  163. package/dist/gestures/nativeScroll.d.ts +3 -6
  164. package/dist/gestures/nativeScroll.d.ts.map +1 -1
  165. package/dist/gestures/nativeScroll.js +7 -52
  166. package/dist/gestures/wheelSegmenter.d.ts +68 -1
  167. package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
  168. package/dist/gestures/wheelSegmenter.js +199 -10
  169. package/dist/hooks/StackItemScrollRegion.d.ts +31 -0
  170. package/dist/hooks/StackItemScrollRegion.d.ts.map +1 -0
  171. package/dist/hooks/StackItemScrollRegion.js +40 -0
  172. package/dist/hooks/menuPressGesture.d.ts +133 -21
  173. package/dist/hooks/menuPressGesture.d.ts.map +1 -1
  174. package/dist/hooks/menuPressGesture.js +155 -30
  175. package/dist/hooks/menuPressValues.d.ts +16 -0
  176. package/dist/hooks/menuPressValues.d.ts.map +1 -0
  177. package/dist/hooks/menuPressValues.js +18 -0
  178. package/dist/hooks/useClickableContainer.d.ts +27 -5
  179. package/dist/hooks/useClickableContainer.d.ts.map +1 -1
  180. package/dist/hooks/useClickableContainer.js +41 -5
  181. package/dist/hooks/useFocusTrap.d.ts +10 -0
  182. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  183. package/dist/hooks/useFocusTrap.js +225 -132
  184. package/dist/hooks/useMenuPress.d.ts +34 -1
  185. package/dist/hooks/useMenuPress.d.ts.map +1 -1
  186. package/dist/hooks/useMenuPress.js +93 -5
  187. package/dist/hooks/usePressFeedback.d.ts +6 -6
  188. package/dist/hooks/usePressFeedback.js +6 -6
  189. package/dist/hooks/useScrollRegionProps.d.ts +35 -0
  190. package/dist/hooks/useScrollRegionProps.d.ts.map +1 -0
  191. package/dist/hooks/useScrollRegionProps.js +51 -0
  192. package/dist/i18n/InternationalizationContext.d.ts +6 -0
  193. package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
  194. package/dist/i18n/InternationalizationProvider.d.ts +21 -3
  195. package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
  196. package/dist/i18n/InternationalizationProvider.js +8 -3
  197. package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts +8 -0
  198. package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts.map +1 -0
  199. package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.js +12 -0
  200. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  201. package/dist/i18n/generated-locales/en.generated.js +1 -0
  202. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  203. package/dist/i18n/generated-locales/pseudo.generated.js +1 -0
  204. package/dist/i18n/index.d.ts +2 -0
  205. package/dist/i18n/index.d.ts.map +1 -1
  206. package/dist/i18n/index.js +1 -0
  207. package/dist/i18n/useCalendarSystem.d.ts +19 -0
  208. package/dist/i18n/useCalendarSystem.d.ts.map +1 -0
  209. package/dist/i18n/useCalendarSystem.js +61 -0
  210. package/dist/internal/spinner-rotor.d.ts +16 -0
  211. package/dist/internal/spinner-rotor.d.ts.map +1 -0
  212. package/dist/internal/spinner-rotor.js +16 -0
  213. package/dist/internal/touch.d.ts +14 -1
  214. package/dist/internal/touch.d.ts.map +1 -1
  215. package/dist/internal/touch.js +20 -2
  216. package/dist/motion/carryAnimations.d.ts +58 -0
  217. package/dist/motion/carryAnimations.d.ts.map +1 -0
  218. package/dist/motion/carryAnimations.js +305 -0
  219. package/dist/motion/transientCopy.d.ts +4 -2
  220. package/dist/motion/transientCopy.d.ts.map +1 -1
  221. package/dist/motion/transientCopy.js +34 -5
  222. package/dist/motion/uikit/gestures.d.ts +41 -0
  223. package/dist/motion/uikit/gestures.d.ts.map +1 -1
  224. package/dist/motion/uikit/gestures.js +25 -0
  225. package/dist/motion/uikit/index.d.ts +1 -1
  226. package/dist/motion/uikit/index.d.ts.map +1 -1
  227. package/dist/motion/uikit/index.js +1 -1
  228. package/dist/motion/uikit/timing.d.ts +14 -10
  229. package/dist/motion/uikit/timing.d.ts.map +1 -1
  230. package/dist/motion/uikit/timing.js +7 -5
  231. package/dist/privateAttributes/menuPressLit.stylex.d.ts +52 -0
  232. package/dist/privateAttributes/menuPressLit.stylex.d.ts.map +1 -0
  233. package/dist/privateAttributes/menuPressLit.stylex.js +99 -0
  234. package/dist/privateAttributes/press.stylex.d.ts +139 -0
  235. package/dist/privateAttributes/press.stylex.d.ts.map +1 -0
  236. package/dist/privateAttributes/press.stylex.js +97 -0
  237. package/dist/theme/themeMotion.d.ts +3 -2
  238. package/dist/theme/themeMotion.d.ts.map +1 -1
  239. package/dist/theme/themeMotion.js +3 -2
  240. package/dist/theme/tokens.stylex.d.ts +2 -2
  241. package/dist/theme/tokens.stylex.js +1 -1
  242. package/dist/utils/calendarSystem.d.ts +114 -0
  243. package/dist/utils/calendarSystem.d.ts.map +1 -0
  244. package/dist/utils/calendarSystem.js +386 -0
  245. package/dist/utils/flatTree.d.ts +6 -3
  246. package/dist/utils/flatTree.d.ts.map +1 -1
  247. package/dist/utils/flatTree.js +13 -3
  248. package/dist/utils/hitArea.d.ts.map +1 -1
  249. package/dist/utils/hitArea.js +82 -5
  250. package/dist/utils/inputStream.d.ts +14 -1
  251. package/dist/utils/inputStream.d.ts.map +1 -1
  252. package/dist/utils/inputStream.js +40 -9
  253. package/dist/utils/interactionOverlay.stylex.d.ts +5 -9
  254. package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
  255. package/dist/utils/interactionOverlay.stylex.js +29 -31
  256. package/dist/utils/plainDate.d.ts +23 -7
  257. package/dist/utils/plainDate.d.ts.map +1 -1
  258. package/dist/utils/plainDate.js +57 -18
  259. package/dist/utils/pressFeedback.d.ts +10 -2
  260. package/dist/utils/pressFeedback.d.ts.map +1 -1
  261. package/dist/utils/pressFeedback.js +40 -15
  262. package/dist/utils/pressGesture.d.ts +12 -6
  263. package/dist/utils/pressGesture.d.ts.map +1 -1
  264. package/dist/utils/pressGesture.js +26 -8
  265. package/dist/utils/scrollView.d.ts +25 -0
  266. package/dist/utils/scrollView.d.ts.map +1 -0
  267. package/dist/utils/scrollView.js +108 -0
  268. package/dist/utils/selectionLock.d.ts.map +1 -1
  269. package/dist/utils/selectionLock.js +1 -10
  270. package/dist/utils/touchHitArea.stylex.d.ts +35 -0
  271. package/dist/utils/touchHitArea.stylex.d.ts.map +1 -0
  272. package/dist/utils/touchHitArea.stylex.js +32 -0
  273. package/dist/utils/triggerFocus.d.ts +5 -0
  274. package/dist/utils/triggerFocus.d.ts.map +1 -1
  275. package/dist/utils/triggerFocus.js +9 -2
  276. package/locales/en.json +4 -0
  277. package/locales/pseudo.json +3 -0
  278. package/package.json +10 -4
  279. package/src/AppShell/observeMainOverflow.ts +9 -6
  280. package/src/BottomSheet/BottomSheet.tsx +5 -0
  281. package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
  282. package/src/BottomSheet/useSheetGestures.ts +83 -20
  283. package/src/Calendar/Calendar.doc.mjs +76 -6
  284. package/src/Calendar/Calendar.tsx +123 -104
  285. package/src/Calendar/getInitialFocusDate.ts +22 -8
  286. package/src/Calendar/hooks/useCalendarDays.ts +89 -63
  287. package/src/Calendar/hooks/useCalendarNavigation.ts +68 -26
  288. package/src/CheckboxInput/CheckboxInput.doc.mjs +3 -2
  289. package/src/CheckboxInput/CheckboxInput.tsx +71 -9
  290. package/src/ClickableCard/ClickableCard.tsx +8 -1
  291. package/src/DateInput/DateInput.tsx +2 -0
  292. package/src/DateInput/PickerWheel.tsx +7 -2
  293. package/src/DateRangeInput/DateRangeInput.tsx +3 -1
  294. package/src/DateTimeInput/DateTimeInput.tsx +2 -0
  295. package/src/Dialog/Dialog.doc.mjs +1 -1
  296. package/src/Dialog/Dialog.tsx +12 -1
  297. package/src/Drawer/Drawer.doc.mjs +1 -1
  298. package/src/Drawer/useDrawerDialogPresence.ts +9 -2
  299. package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -2
  300. package/src/DropdownMenu/DropdownMenu.tsx +29 -5
  301. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -1
  302. package/src/DropdownMenu/DropdownMenuItem.tsx +8 -4
  303. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -1
  304. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -1
  305. package/src/FileInput/FileInput.tsx +16 -2
  306. package/src/HoverCard/useHoverCard.tsx +3 -1
  307. package/src/InfoTip/InfoTip.doc.mjs +26 -2
  308. package/src/InfoTip/InfoTip.tsx +1 -0
  309. package/src/InputGroup/InputGroup.doc.mjs +4 -3
  310. package/src/InputGroup/InputGroup.tsx +4 -3
  311. package/src/InputGroup/groupStyles.ts +3 -1
  312. package/src/Item/Item.tsx +51 -9
  313. package/src/Layer/holdEntranceInput.ts +84 -0
  314. package/src/Layer/inputHold.ts +734 -0
  315. package/src/Layer/preserveAnimations.ts +12 -275
  316. package/src/Layer/useLayer.tsx +77 -4
  317. package/src/Layout/LayoutContent.doc.mjs +6 -3
  318. package/src/Layout/LayoutContent.tsx +10 -4
  319. package/src/Layout/LayoutPanel.doc.mjs +6 -3
  320. package/src/Layout/LayoutPanel.tsx +11 -4
  321. package/src/Lightbox/Lightbox.tsx +4 -0
  322. package/src/MetadataList/MetadataList.tsx +1 -1
  323. package/src/MobileNav/MobileNav.doc.mjs +3 -3
  324. package/src/MobileNav/MobileNav.tsx +39 -1
  325. package/src/MoreMenu/MoreMenu.doc.mjs +2 -4
  326. package/src/MoreMenu/MoreMenu.tsx +5 -3
  327. package/src/NumberInput/NumberInput.doc.mjs +1 -1
  328. package/src/NumberInput/NumberInput.tsx +259 -11
  329. package/src/Popover/usePopover.tsx +1 -0
  330. package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
  331. package/src/PowerSearch/PowerSearch.tsx +20 -3
  332. package/src/PowerSearch/PowerSearchBottomSheet.tsx +4 -1
  333. package/src/PowerSearch/PowerSearchToken.tsx +3 -0
  334. package/src/PowerSearch/formatFilterValue.ts +21 -11
  335. package/src/PowerSearch/formatTokenValue.ts +7 -1
  336. package/src/RadioList/RadioListItem.doc.mjs +3 -2
  337. package/src/RadioList/RadioListItem.tsx +25 -7
  338. package/src/SelectableCard/SelectableCard.tsx +8 -1
  339. package/src/Spinner/Spinner.tsx +7 -89
  340. package/src/Spinner/index.ts +1 -5
  341. package/src/Spinner/spinnerRotor.ts +113 -0
  342. package/src/Stack/Stack.doc.mjs +1 -1
  343. package/src/Stack/StackItem.tsx +27 -13
  344. package/src/Switch/Switch.tsx +7 -6
  345. package/src/Table/plugins/sortable/useTableSortable.tsx +1 -1
  346. package/src/Timestamp/Timestamp.doc.mjs +3 -3
  347. package/src/Timestamp/Timestamp.tsx +13 -8
  348. package/src/Timestamp/formatInstant.ts +49 -28
  349. package/src/Timestamp/tooltipEntries.ts +7 -3
  350. package/src/Token/Token.tsx +18 -1
  351. package/src/Token/TokenLink.tsx +7 -1
  352. package/src/Tokenizer/Tokenizer.doc.mjs +3 -3
  353. package/src/Tokenizer/Tokenizer.tsx +252 -115
  354. package/src/Tooltip/useTooltip.tsx +178 -80
  355. package/src/TreeList/TreeListItem.tsx +36 -2
  356. package/src/gestures/GestureHost.ts +21 -5
  357. package/src/gestures/PanGestureRecognizer.ts +19 -2
  358. package/src/gestures/README.md +14 -5
  359. package/src/gestures/ScreenEdgePanGestureRecognizer.ts +6 -1
  360. package/src/gestures/nativeScroll.ts +12 -68
  361. package/src/gestures/wheelSegmenter.ts +243 -10
  362. package/src/hooks/StackItemScrollRegion.tsx +57 -0
  363. package/src/hooks/menuPressGesture.ts +244 -38
  364. package/src/hooks/menuPressValues.ts +18 -0
  365. package/src/hooks/useClickableContainer.doc.mjs +8 -2
  366. package/src/hooks/useClickableContainer.ts +72 -6
  367. package/src/hooks/useFocusTrap.ts +268 -151
  368. package/src/hooks/useMenuPress.ts +118 -11
  369. package/src/hooks/usePressFeedback.doc.mjs +3 -3
  370. package/src/hooks/usePressFeedback.ts +6 -6
  371. package/src/hooks/useScrollRegionProps.ts +76 -0
  372. package/src/i18n/InternationalizationContext.ts +6 -0
  373. package/src/i18n/InternationalizationProvider.doc.mjs +29 -1
  374. package/src/i18n/InternationalizationProvider.tsx +33 -3
  375. package/src/i18n/generated-english/hooks/useScrollRegionProps.generated.ts +13 -0
  376. package/src/i18n/generated-locales/en.generated.ts +1 -0
  377. package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
  378. package/src/i18n/index.ts +2 -0
  379. package/src/i18n/useCalendarSystem.ts +95 -0
  380. package/src/internal/spinner-rotor.ts +20 -0
  381. package/src/internal/touch.ts +34 -1
  382. package/src/motion/MEASUREMENTS.md +11 -0
  383. package/src/motion/carryAnimations.ts +389 -0
  384. package/src/motion/transientCopy.ts +45 -5
  385. package/src/motion/uikit/gestures.ts +22 -0
  386. package/src/motion/uikit/index.ts +1 -0
  387. package/src/motion/uikit/timing.ts +7 -5
  388. package/src/privateAttributes/menuPressLit.stylex.ts +104 -0
  389. package/src/privateAttributes/press.stylex.ts +243 -0
  390. package/src/theme/themeMotion.ts +3 -2
  391. package/src/theme/tokens.stylex.ts +1 -1
  392. package/src/utils/calendarSystem.ts +548 -0
  393. package/src/utils/flatTree.ts +15 -3
  394. package/src/utils/hitArea.ts +107 -5
  395. package/src/utils/inputStream.ts +47 -10
  396. package/src/utils/interactionOverlay.stylex.ts +19 -22
  397. package/src/utils/plainDate.ts +84 -19
  398. package/src/utils/pressFeedback.ts +46 -14
  399. package/src/utils/pressGesture.ts +35 -9
  400. package/src/utils/scrollView.ts +135 -0
  401. package/src/utils/selectionLock.ts +5 -10
  402. package/src/utils/touchHitArea.stylex.ts +41 -0
  403. package/src/utils/triggerFocus.ts +17 -4
@@ -4,9 +4,11 @@
4
4
 
5
5
  /**
6
6
  * @file useCalendarDays.ts
7
- * @input Uses React useMemo, useLocale, PlainDate utilities, generated CLDR weekday data
8
- * @output Exports useCalendarDays hook for generating calendar day grids
9
- * @position Calendar-specific hook; used by Calendar
7
+ * @input Uses React useMemo, useLocale, PlainDate and calendar-system
8
+ * utilities, generated CLDR weekday data
9
+ * @output Exports useCalendarDays, the day grid of one month of any calendar
10
+ * system (Gregorian by default)
11
+ * @position Calendar-specific hook; used by Calendar and MonthScroller
10
12
  *
11
13
  * SYNC: When modified, update:
12
14
  * - /packages/core/src/Calendar/hooks/index.ts
@@ -17,12 +19,17 @@ import type {DayOfWeek, ISODateString} from '../../utils/dateTypes';
17
19
  import {
18
20
  type PlainDate,
19
21
  plainDateToISO,
20
- getDaysInMonth,
21
22
  plainDateDayOfWeek,
22
23
  plainDateAddDays,
23
24
  } from '../../utils/plainDate';
24
25
  import {useLocale} from '../../i18n';
25
26
  import {getWeekdayHeaderNames} from '../getWeekdayHeaderNames';
27
+ import {
28
+ type CalendarSystem,
29
+ calendarDayOfMonth,
30
+ calendarMonthFromYearMonth,
31
+ } from '../../utils/calendarSystem';
32
+ import {resolveShownCalendar} from '../../i18n/useCalendarSystem';
26
33
 
27
34
  /**
28
35
  * Represents a single day in the calendar grid.
@@ -42,14 +49,27 @@ export interface CalendarDay {
42
49
  * Configuration for calendar days generation
43
50
  */
44
51
  export interface UseCalendarDaysOptions {
45
- /** The year to generate days for */
52
+ /** The year to generate days for, in `calendar`'s numbering */
46
53
  year: number;
47
- /** The month (1-based: 1 = January, 12 = December) */
54
+ /**
55
+ * The month's position in its year (1-based). In the Gregorian calendar,
56
+ * 1 is January and 12 is December. In other calendars it is numbered as
57
+ * `Temporal.PlainDate` numbers it: 1 through 13 in a Hebrew leap year.
58
+ */
48
59
  month: number;
49
60
  /** First day of week (0=Sunday through 6=Saturday) */
50
61
  weekStartsOn?: DayOfWeek;
51
62
  /** Use variable rows per month vs. fixed 6-row grid */
52
63
  hasVariableRowCount?: boolean;
64
+ /**
65
+ * The calendar system that numbers `year`, `month`, and each `dayNumber`.
66
+ * Each day keeps its Gregorian `date` and `iso`. The hook never reads the
67
+ * InternationalizationProvider calendar. Calendars other than gregory,
68
+ * iso8601, buddhist, roc, and japanese need Temporal; without it, the hook
69
+ * reads Gregorian numbers and warns once in development.
70
+ * @default 'gregory'
71
+ */
72
+ calendar?: CalendarSystem;
53
73
  }
54
74
 
55
75
  /**
@@ -80,71 +100,82 @@ export interface UseCalendarDaysReturn {
80
100
  * weekStartsOn: 0, // Sunday
81
101
  * });
82
102
  * // days[i].date is a PlainDate { year, month (1-based), day }
103
+ *
104
+ * // Aban 1405 in the Persian calendar; dates stay Gregorian
105
+ * useCalendarDays({year: 1405, month: 8, calendar: 'persian'});
83
106
  * ```
84
107
  */
85
108
  export function useCalendarDays(
86
109
  options: UseCalendarDaysOptions,
87
110
  ): UseCalendarDaysReturn {
88
- const {year, month, weekStartsOn = 0, hasVariableRowCount = false} = options;
89
- const locale = useLocale();
90
-
91
- // Calculate grid structure
92
- const gridInfo = useMemo(() => {
93
- const totalDaysInMonth = getDaysInMonth(year, month);
111
+ const {
112
+ year,
113
+ month,
114
+ weekStartsOn = 0,
115
+ hasVariableRowCount = false,
116
+ calendar: calendarOption = 'gregory',
117
+ } = options;
118
+ const calendar = resolveShownCalendar(calendarOption, 'useCalendarDays');
119
+ const days = useMemo(() => {
120
+ const calendarMonth = calendarMonthFromYearMonth(calendar, {year, month});
121
+ return layOutMonthDays({
122
+ first: calendarMonth.start,
123
+ length: calendarMonth.length,
124
+ weekStartsOn,
125
+ hasVariableRowCount,
126
+ dayNumberOf: (pd, offset) =>
127
+ offset >= 0 && offset < calendarMonth.length
128
+ ? offset + 1
129
+ : calendarDayOfMonth(calendar, pd),
130
+ });
131
+ }, [year, month, calendar, weekStartsOn, hasVariableRowCount]);
132
+ return useMonthGrid(days, weekStartsOn);
133
+ }
94
134
 
95
- // Calculate starting offset based on weekStartsOn
96
- let startingDayOfWeek =
97
- plainDateDayOfWeek({year, month, day: 1}) - weekStartsOn;
98
- if (startingDayOfWeek < 0) {
99
- startingDayOfWeek += 7;
100
- }
135
+ interface MonthLayout {
136
+ first: PlainDate;
137
+ length: number;
138
+ weekStartsOn: DayOfWeek;
139
+ hasVariableRowCount: boolean;
140
+ /** The day number of a grid day, given its offset from the month's first day. */
141
+ dayNumberOf: (pd: PlainDate, offset: number) => number;
142
+ }
101
143
 
102
- // Calculate total cells
103
- const totalDays = totalDaysInMonth + startingDayOfWeek;
104
- const totalRows = hasVariableRowCount ? Math.ceil(totalDays / 7) : 6;
105
- const totalCells = totalRows * 7;
144
+ function layOutMonthDays(layout: MonthLayout): CalendarDay[] {
145
+ const {first, length, weekStartsOn, hasVariableRowCount, dayNumberOf} =
146
+ layout;
147
+ let startingDayOfWeek = plainDateDayOfWeek(first) - weekStartsOn;
148
+ if (startingDayOfWeek < 0) {
149
+ startingDayOfWeek += 7;
150
+ }
151
+ const totalRows = hasVariableRowCount
152
+ ? Math.ceil((length + startingDayOfWeek) / 7)
153
+ : 6;
154
+ const result: CalendarDay[] = [];
155
+ for (let i = 0; i < totalRows * 7; i++) {
156
+ const offset = i - startingDayOfWeek;
157
+ const pd = plainDateAddDays(first, offset);
158
+ result.push({
159
+ date: pd,
160
+ iso: plainDateToISO(pd),
161
+ isOutside: offset < 0 || offset >= length,
162
+ dayNumber: dayNumberOf(pd, offset),
163
+ });
164
+ }
165
+ return result;
166
+ }
106
167
 
107
- return {
108
- daysInMonth: totalDaysInMonth,
109
- startingDayOfWeek,
110
- totalCells,
111
- };
112
- }, [year, month, weekStartsOn, hasVariableRowCount]);
168
+ function useMonthGrid(
169
+ days: CalendarDay[],
170
+ weekStartsOn: DayOfWeek,
171
+ ): UseCalendarDaysReturn {
172
+ const locale = useLocale();
113
173
 
114
174
  const dayNames = useMemo(
115
175
  () => getWeekdayHeaderNames(locale, weekStartsOn),
116
176
  [locale, weekStartsOn],
117
177
  );
118
178
 
119
- // Generate days array
120
- const days = useMemo(() => {
121
- const {
122
- daysInMonth: totalDaysInMonth,
123
- startingDayOfWeek,
124
- totalCells,
125
- } = gridInfo;
126
- const firstOfMonth: PlainDate = {year, month, day: 1};
127
- const result: CalendarDay[] = [];
128
-
129
- for (let i = 0; i < totalCells; i++) {
130
- const dayOffset = i - startingDayOfWeek + 1;
131
- const isOutside = dayOffset < 1 || dayOffset > totalDaysInMonth;
132
- const pd: PlainDate = isOutside
133
- ? plainDateAddDays(firstOfMonth, dayOffset - 1)
134
- : {year, month, day: dayOffset};
135
-
136
- result.push({
137
- date: pd,
138
- iso: plainDateToISO(pd),
139
- isOutside,
140
- dayNumber: pd.day,
141
- });
142
- }
143
-
144
- return result;
145
- }, [year, month, gridInfo]);
146
-
147
- // Group days into weeks
148
179
  const weeks = useMemo(() => {
149
180
  const result: CalendarDay[][] = [];
150
181
  for (let i = 0; i < days.length; i += 7) {
@@ -153,10 +184,5 @@ export function useCalendarDays(
153
184
  return result;
154
185
  }, [days]);
155
186
 
156
- return {
157
- days,
158
- weeks,
159
- dayNames,
160
- totalCells: gridInfo.totalCells,
161
- };
187
+ return {days, weeks, dayNames, totalCells: days.length};
162
188
  }
@@ -4,9 +4,11 @@
4
4
 
5
5
  /**
6
6
  * @file useCalendarNavigation.ts
7
- * @input Uses React useState, useMemo, useCallback, useLocale, PlainDate utilities
8
- * @output Exports useCalendarNavigation hook for month navigation
9
- * @position Calendar-specific hook; used by Calendar
7
+ * @input Uses React useState, useMemo, useCallback, useLocale, PlainDate and
8
+ * calendar-system utilities
9
+ * @output Exports useCalendarNavigation hook for month navigation in any
10
+ * calendar system (Gregorian by default)
11
+ * @position Calendar-specific public hook
10
12
  *
11
13
  * SYNC: When modified, update:
12
14
  * - /packages/core/src/Calendar/hooks/index.ts
@@ -19,12 +21,17 @@ import {
19
21
  plainDateFromISO,
20
22
  plainDateToISO,
21
23
  plainDateToday,
22
- plainDateSetFirstOfMonth,
23
- plainDateAddMonths,
24
24
  plainDateAddDays,
25
25
  } from '../../utils/plainDate';
26
- import {plainDateFormatStandaloneMonthYear} from '../../utils/plainDate';
26
+ import {
27
+ type CalendarSystem,
28
+ calendarAddMonths,
29
+ calendarMonthOf,
30
+ calendarYearMonthOf,
31
+ formatCalendarMonthLabel,
32
+ } from '../../utils/calendarSystem';
27
33
  import {useLocale} from '../../i18n';
34
+ import {resolveShownCalendar} from '../../i18n/useCalendarSystem';
28
35
 
29
36
  /**
30
37
  * Configuration for calendar navigation
@@ -38,17 +45,31 @@ export interface UseCalendarNavigationOptions {
38
45
  onFocusDateChange?: (focusDate: ISODateString) => void;
39
46
  /** Number of months to display */
40
47
  numberOfMonths?: 1 | 2;
48
+ /**
49
+ * The calendar system whose months the hook steps and labels. Dates stay
50
+ * Gregorian ISO. The hook never reads the InternationalizationProvider
51
+ * calendar. Calendars other than gregory, iso8601, buddhist, roc, and
52
+ * japanese need Temporal; without it, the hook steps Gregorian months and
53
+ * warns once in development.
54
+ * @default 'gregory'
55
+ */
56
+ calendar?: CalendarSystem;
41
57
  }
42
58
 
43
59
  /**
44
60
  * Return type for useCalendarNavigation hook
45
61
  */
46
62
  export interface UseCalendarNavigationReturn {
47
- /** The base month (first day of the focus month) as a PlainDate */
63
+ /** The Gregorian first day of the focus month */
48
64
  baseMonth: PlainDate;
49
- /** Array of visible months to render as PlainDates */
65
+ /** The Gregorian first day of each visible month */
50
66
  visibleMonths: PlainDate[];
51
- /** Formatted label for the month header */
67
+ /**
68
+ * The year and month numbers of each visible month in `calendar`, as
69
+ * `useCalendarDays` reads them with the same `calendar`
70
+ */
71
+ visibleCalendarMonths: {year: number; month: number}[];
72
+ /** Formatted label for the month header, in `calendar` */
52
73
  monthYearLabel: string;
53
74
  /** Navigate to previous/next month */
54
75
  navigateMonth: (
@@ -87,6 +108,13 @@ export interface UseCalendarNavigationReturn {
87
108
  * // Navigate from arrow key (with focus tracking)
88
109
  * navigateMonth(1, focusedDate, 1); // horizontal offset
89
110
  * navigateMonth(1, focusedDate, 7); // vertical offset
111
+ *
112
+ * // Persian months, laid out by useCalendarDays
113
+ * const nav = useCalendarNavigation({initialValue, calendar: 'persian'});
114
+ * const {weeks} = useCalendarDays({
115
+ * ...nav.visibleCalendarMonths[0],
116
+ * calendar: 'persian',
117
+ * });
90
118
  * ```
91
119
  */
92
120
  export function useCalendarNavigation(
@@ -97,8 +125,13 @@ export function useCalendarNavigation(
97
125
  focusDate: focusDateProp,
98
126
  onFocusDateChange,
99
127
  numberOfMonths = 1,
128
+ calendar: calendarOption = 'gregory',
100
129
  } = options;
101
130
  const locale = useLocale();
131
+ const calendar = resolveShownCalendar(
132
+ calendarOption,
133
+ 'useCalendarNavigation',
134
+ );
102
135
 
103
136
  // Pending focus target after month navigation
104
137
  const [pendingFocus, setPendingFocus] = useState<ISODateString | null>(null);
@@ -121,32 +154,40 @@ export function useCalendarNavigation(
121
154
  ? plainDateFromISO(focusDateProp)
122
155
  : internalFocusDate;
123
156
 
124
- // Base month (first day of focus month)
125
- const baseMonth = useMemo(() => {
126
- return plainDateSetFirstOfMonth(focusDate);
127
- }, [focusDate]);
157
+ // A controlled focus date is a new object on each render. Key the memo on
158
+ // its ISO string.
159
+ const focusIso = plainDateToISO(focusDate);
160
+ const shownMonths = useMemo(() => {
161
+ const first = calendarMonthOf(calendar, plainDateFromISO(focusIso));
162
+ return Array.from({length: numberOfMonths}, (_, i) =>
163
+ calendarAddMonths(calendar, first, i),
164
+ );
165
+ }, [calendar, focusIso, numberOfMonths]);
166
+
167
+ const visibleMonths = useMemo(
168
+ () => shownMonths.map(month => month.start),
169
+ [shownMonths],
170
+ );
171
+ const baseMonth = visibleMonths[0];
128
172
 
129
- // Generate visible months
130
- const visibleMonths = useMemo(() => {
131
- return Array.from({length: numberOfMonths}, (_, i) => {
132
- return plainDateAddMonths(baseMonth, i);
133
- });
134
- }, [baseMonth, numberOfMonths]);
173
+ const visibleCalendarMonths = useMemo(
174
+ () => shownMonths.map(month => calendarYearMonthOf(calendar, month)),
175
+ [calendar, shownMonths],
176
+ );
135
177
 
136
- // Format month header
137
- // Each month is its own stand-alone label (Calendar FR1).
178
+ // Each month is its own stand-alone label.
138
179
  const monthYearLabel = useMemo(
139
180
  () =>
140
- visibleMonths
141
- .map(m => plainDateFormatStandaloneMonthYear(m, locale))
181
+ shownMonths
182
+ .map(month => formatCalendarMonthLabel(calendar, month, locale))
142
183
  .join(' – '),
143
- [visibleMonths, locale],
184
+ [calendar, shownMonths, locale],
144
185
  );
145
186
 
146
187
  // Navigate to previous/next month
147
188
  const navigateMonth = useCallback(
148
189
  (delta: number, focusedDate?: ISODateString, offset?: number) => {
149
- const newMonth = plainDateAddMonths(baseMonth, delta);
190
+ const newMonth = calendarAddMonths(calendar, shownMonths[0], delta).start;
150
191
  const newISO = plainDateToISO(newMonth);
151
192
 
152
193
  // Calculate target focus date if provided
@@ -164,7 +205,7 @@ export function useCalendarNavigation(
164
205
  setInternalFocusDate(newMonth);
165
206
  }
166
207
  },
167
- [baseMonth, onFocusDateChange],
208
+ [calendar, shownMonths, onFocusDateChange],
168
209
  );
169
210
 
170
211
  // Clear pending focus
@@ -175,6 +216,7 @@ export function useCalendarNavigation(
175
216
  return {
176
217
  baseMonth,
177
218
  visibleMonths,
219
+ visibleCalendarMonths,
178
220
  monthYearLabel,
179
221
  navigateMonth,
180
222
  pendingFocus,
@@ -109,7 +109,7 @@ export const docs = {
109
109
  name: 'size',
110
110
  type: "'sm' | 'md'",
111
111
  description:
112
- 'The size of the checkbox. sm for compact layouts, md for default.',
112
+ 'The size of the checkbox. sm for compact layouts, md for default. Under a coarse pointer a labelled checkbox’s target grows toward 44 px through an invisible hit area. It never shrinks below the row and stops at half the gap to a closer neighbour; nothing changes size.',
113
113
  default: "'md'",
114
114
  },
115
115
  {
@@ -361,7 +361,8 @@ export const docsZh = {
361
361
  {
362
362
  name: 'size',
363
363
  type: "'sm' | 'md'",
364
- description: '复选框尺寸。sm 用于紧凑布局,md 为默认。',
364
+ description:
365
+ '复选框尺寸。sm 用于紧凑布局,md 为默认。在粗指针(触摸)下,带可见标签的复选框的目标通过不可见的点击区域向 44 px 扩展。它不小于所在行,与相邻控件较近时止于间距的一半;尺寸不变。',
365
366
  default: "'md'",
366
367
  },
367
368
  {
@@ -24,6 +24,8 @@ import {
24
24
  useTransition,
25
25
  type ChangeEvent,
26
26
  type FocusEvent,
27
+ type MouseEvent as ReactMouseEvent,
28
+ type PointerEvent as ReactPointerEvent,
27
29
  type ReactNode,
28
30
  } from 'react';
29
31
  import * as stylex from '@stylexjs/stylex';
@@ -55,6 +57,8 @@ import {useIndicator} from '../Indicator/useIndicator';
55
57
  import {themeProps} from '../utils/themeProps';
56
58
 
57
59
  import {useMergedRefs} from '../hooks/useMergedRefs';
60
+ import {watchHitArea, writeHitInsets} from '../utils/hitArea';
61
+ import {touchHitAreaStyles} from '../utils/touchHitArea.stylex';
58
62
  import {
59
63
  registerEnglishFallback,
60
64
  useComponentTranslator,
@@ -83,6 +87,10 @@ const styles = stylex.create({
83
87
  containerLabelHidden: {
84
88
  gap: 0,
85
89
  },
90
+ // Under a coarse pointer the row contains its hit band.
91
+ hitAreaHost: {
92
+ position: {default: null, '@media (pointer: coarse)': 'relative'},
93
+ },
86
94
  // An indicator in another package may not name this row's private press
87
95
  // attribute. So the row hands its touch press image down to an indicator
88
96
  // that paints its own press, but only in its own press states. A pressed
@@ -407,6 +415,63 @@ export function CheckboxInput({
407
415
  useBusyAnnouncement(isBusy, t('@astryx.spinner.loading'), indicatorRef);
408
416
  const {focusProps} = useIndicatorFocusRing(indicatorRef);
409
417
 
418
+ // Under a coarse pointer a labelled checkbox's row grows toward 44 px
419
+ // through an invisible band, and nothing changes size. A label-hidden
420
+ // checkbox is a marker in another component's row, which keeps its target.
421
+ const hasHitArea = !isLabelHidden && !isDisabled && !isReadOnly;
422
+ const inputRef = useRef<HTMLInputElement>(null);
423
+ // The watch lives as long as the row is attached: the ref's cleanup stops
424
+ // it, and a replaced row starts its own.
425
+ const watchRowHitArea = useCallback(
426
+ (row: HTMLDivElement | null) => {
427
+ if (row == null || !hasHitArea) {
428
+ return;
429
+ }
430
+ return watchHitArea(row, insets => writeHitInsets(row, insets));
431
+ },
432
+ [hasHitArea],
433
+ );
434
+ // The disabled-message tooltip listens for hover and focus on the whole
435
+ // row, a larger trigger. It anchors on the checkbox itself (below), so it
436
+ // shows next to the control. Its handlers check isEnabled, so the row
437
+ // always attaches them.
438
+ const rowRef = useMergedRefs(
439
+ disabledMessageTooltip.interactionRef,
440
+ watchRowHitArea,
441
+ );
442
+ // Where a press on the row itself began. A browser can move a tap's click
443
+ // onto the row's edge, so the band is judged from the press.
444
+ const pressPointRef = useRef<{x: number; y: number} | null>(null);
445
+ const handleRowPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {
446
+ pressPointRef.current =
447
+ event.target === event.currentTarget
448
+ ? {x: event.clientX, y: event.clientY}
449
+ : null;
450
+ };
451
+ // A press that began on the band, outside the row's box, toggles the
452
+ // checkbox, as a tap on the box does. A click from code has no press count
453
+ // (`detail` is 0), so it never toggles from here.
454
+ const handleRowClick = (event: ReactMouseEvent<HTMLDivElement>) => {
455
+ const press = pressPointRef.current;
456
+ pressPointRef.current = null;
457
+ if (
458
+ press == null ||
459
+ event.detail === 0 ||
460
+ event.target !== event.currentTarget
461
+ ) {
462
+ return;
463
+ }
464
+ const box = event.currentTarget.getBoundingClientRect();
465
+ const isOnBand =
466
+ press.x < box.left ||
467
+ press.x > box.right ||
468
+ press.y < box.top ||
469
+ press.y > box.bottom;
470
+ if (isOnBand) {
471
+ inputRef.current?.click();
472
+ }
473
+ };
474
+
410
475
  const isIndeterminate = optimisticValue === 'indeterminate';
411
476
  const isChecked = optimisticValue === true;
412
477
 
@@ -455,19 +520,15 @@ export function CheckboxInput({
455
520
  style,
456
521
  )}>
457
522
  <div
458
- ref={el => {
459
- // Interaction (hover/focus) listeners for the disabled-message
460
- // tooltip attach to the whole row for a larger trigger target;
461
- // positioning anchors on the checkbox itself (below) so the tooltip
462
- // appears next to the control, not the far edge of the row.
463
- // Handlers are gated internally by isEnabled, so attaching
464
- // unconditionally is safe.
465
- disabledMessageTooltip.interactionRef(el);
466
- }}
523
+ ref={rowRef}
524
+ onPointerDown={hasHitArea ? handleRowPointerDown : undefined}
525
+ onClick={hasHitArea ? handleRowClick : undefined}
467
526
  {...(isDisabled ? undefined : pressable)}
468
527
  {...stylex.props(
469
528
  styles.container,
470
529
  isLabelHidden && styles.containerLabelHidden,
530
+ hasHitArea && styles.hitAreaHost,
531
+ hasHitArea && touchHitAreaStyles.layer,
471
532
  // Hover and focus reach the checkbox visual through this ancestor
472
533
  // marker rather than props, so the whole row drives it.
473
534
  !isDisabled && indicatorScope,
@@ -490,6 +551,7 @@ export function CheckboxInput({
490
551
  ref,
491
552
  indeterminateRef,
492
553
  disabledMessageTooltip.positionRef,
554
+ inputRef,
493
555
  )}
494
556
  id={id}
495
557
  type="checkbox"
@@ -46,6 +46,7 @@ import {
46
46
  } from '../theme/tokens.stylex';
47
47
  import type {SizeValue, SpacingStep, Elevation} from '../utils/types';
48
48
  import {mergeProps} from '../utils';
49
+ import {chainEventHandlers} from '../utils/chainEventHandlers';
49
50
  import {Card} from '../Card/Card';
50
51
  import type {CardVariant} from '../Card/Card';
51
52
  import {useClickableContainer} from '../hooks/useClickableContainer';
@@ -314,6 +315,7 @@ export function ClickableCard({
314
315
  label,
315
316
  onClick: onClickProp,
316
317
  onMouseUp: onMouseUpProp,
318
+ onPointerDown: onPointerDownProp,
317
319
  href,
318
320
  target,
319
321
  isDisabled = false,
@@ -370,7 +372,7 @@ export function ClickableCard({
370
372
 
371
373
  const LinkComponent = useLinkComponent();
372
374
 
373
- const {onClick, onMouseUp} = useClickableContainer({
375
+ const {onClick, onMouseUp, onPointerDown} = useClickableContainer({
374
376
  containerRef,
375
377
  interactiveRef,
376
378
  onClick: onClickProp,
@@ -427,6 +429,11 @@ export function ClickableCard({
427
429
  }
428
430
  onClick={!isDisabled ? onClick : undefined}
429
431
  onMouseUp={!isDisabled ? handleMouseUp : undefined}
432
+ onPointerDown={
433
+ !isDisabled
434
+ ? chainEventHandlers(onPointerDown, onPointerDownProp)
435
+ : onPointerDownProp
436
+ }
430
437
  {...props}>
431
438
  {isLink ? (
432
439
  <LinkRoot
@@ -1030,6 +1030,8 @@ function PointerDateField({
1030
1030
  // calendar only while it is open; it opens on the current value.
1031
1031
  !popover.isOpen ? null : (
1032
1032
  <Calendar
1033
+ // The field text is Gregorian, so the popover calendar is too.
1034
+ calendar="gregory"
1033
1035
  handleRef={calendarRef}
1034
1036
  mode="single"
1035
1037
  value={optimisticValue ?? null}
@@ -73,6 +73,12 @@ const UIKIT_SCALE = ROW_HEIGHT / picker.geometry.rowHeight;
73
73
  /** UIKit's rubber band dimension for the picker's table, at that pitch. */
74
74
  const RUBBER_BAND_DIMENSION = picker.geometry.rubberBandDimension * UIKIT_SCALE;
75
75
 
76
+ /**
77
+ * The rows' opacity at the column's edges. At 0.7 the row four from the band
78
+ * keeps 5:1 or more in every shipped theme, a margin over WCAG AA's 4.5:1.
79
+ */
80
+ const FADE_FLOOR = 0.7;
81
+
76
82
  const styles = stylex.create({
77
83
  // The scrolling column's box, band and rows (Wheel.tsx), moved by the
78
84
  // gesture system and the compositor instead of a native scroller.
@@ -92,8 +98,7 @@ const styles = stylex.create({
92
98
  position: 'absolute',
93
99
  inset: 0,
94
100
  pointerEvents: 'none',
95
- maskImage:
96
- 'linear-gradient(to bottom, rgb(0 0 0 / 0.3), rgb(0 0 0) 50%, rgb(0 0 0 / 0.3))',
101
+ maskImage: `linear-gradient(to bottom, rgb(0 0 0 / ${FADE_FLOOR}), rgb(0 0 0) 50%, rgb(0 0 0 / ${FADE_FLOOR}))`,
97
102
  },
98
103
  /**
99
104
  * The selection band: a centred row-height plate behind the rows.
@@ -238,7 +238,7 @@ const styles = stylex.create({
238
238
  },
239
239
  presetButtonActive: {
240
240
  backgroundColor: colorVars['--color-accent-muted'],
241
- color: colorVars['--color-accent'],
241
+ color: colorVars['--color-text-accent'],
242
242
  },
243
243
  presetButtonDisabled: {
244
244
  color: colorVars['--color-text-disabled'],
@@ -910,6 +910,8 @@ export function DateRangeInput({
910
910
  calendar only while it is open. */}
911
911
  {popover.isOpen && (
912
912
  <Calendar
913
+ // The field text is Gregorian, so the popover calendar is too.
914
+ calendar="gregory"
913
915
  mode="range"
914
916
  value={optimisticValue}
915
917
  onChange={handleRangeSelect}
@@ -1976,6 +1976,8 @@ function PointerDateTimeField({
1976
1976
  // opens on the current value.
1977
1977
  !popover.isOpen ? null : (
1978
1978
  <Calendar
1979
+ // The field text is Gregorian, so the popover calendar is too.
1980
+ calendar="gregory"
1979
1981
  handleRef={calendarRef}
1980
1982
  mode="single"
1981
1983
  value={valueParts.date ?? null}
@@ -69,7 +69,7 @@ export const docs = {
69
69
  ],
70
70
  },
71
71
  description:
72
- 'Modal dialog using the native <dialog> element. Modal and inline content starts with theme body text defaults. Ancestor surface/group membership ends as a whole, including group-owned state. Explicit props and unrelated contexts remain unchanged. Place intentional groups and complete required providers inside the dialog. With reduced motion the dialog never slides or scales in: on a touch screen it fades in, in 200 ms or less, and with a mouse it appears at once.',
72
+ 'Modal dialog using the native <dialog> element. Modal and inline content starts with theme body text defaults. Ancestor surface/group membership ends as a whole, including group-owned state. Explicit props and unrelated contexts remain unchanged. Place intentional groups and complete required providers inside the dialog. With reduced motion the dialog never slides or scales in: on a touch screen it fades in, in 200 ms or less, and with a mouse it appears at once. On a phone or tablet (a coarse primary pointer), a tap or a drag that lands while the dialog is still entering reaches nothing, and the dialog finishes entering; keys and assistive technology stay live, and a mouse or a trackpad still clicks: at once when it was the last pointer used, otherwise once it moves.',
73
73
  props: [
74
74
  {
75
75
  name: 'isOpen',