@astryxdesign/core 0.7.8 → 0.7.9-canary.0236bb8

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 (560) 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 +7 -2
  5. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  6. package/dist/BottomSheet/BottomSheetPanel.js +40 -8
  7. package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
  8. package/dist/BottomSheet/bottomSheetStack.js +4 -3
  9. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  10. package/dist/BottomSheet/useSheetGestures.js +61 -21
  11. package/dist/Calendar/Calendar.d.ts +14 -2
  12. package/dist/Calendar/Calendar.d.ts.map +1 -1
  13. package/dist/Calendar/Calendar.js +63 -74
  14. package/dist/Calendar/getInitialFocusDate.d.ts +4 -1
  15. package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
  16. package/dist/Calendar/getInitialFocusDate.js +7 -5
  17. package/dist/Calendar/hooks/useCalendarDays.d.ts +19 -2
  18. package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
  19. package/dist/Calendar/hooks/useCalendarDays.js +57 -64
  20. package/dist/Calendar/hooks/useCalendarNavigation.d.ts +28 -3
  21. package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
  22. package/dist/Calendar/hooks/useCalendarNavigation.js +33 -22
  23. package/dist/Calendar/styles.d.ts +1 -1
  24. package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
  25. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  26. package/dist/CheckboxInput/CheckboxInput.js +74 -18
  27. package/dist/CheckboxInput/CheckboxRowPressContext.d.ts +2 -0
  28. package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -0
  29. package/dist/CheckboxInput/CheckboxRowPressContext.js +20 -0
  30. package/dist/CheckboxList/CheckboxListItem.d.ts +2 -1
  31. package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
  32. package/dist/CheckboxList/CheckboxListItem.js +40 -14
  33. package/dist/ClickableCard/ClickableCard.d.ts +1 -1
  34. package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
  35. package/dist/ClickableCard/ClickableCard.js +5 -1
  36. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  37. package/dist/ContextMenu/ContextMenu.js +2 -0
  38. package/dist/DateInput/DateInput.d.ts +37 -6
  39. package/dist/DateInput/DateInput.d.ts.map +1 -1
  40. package/dist/DateInput/DateInput.js +97 -124
  41. package/dist/DateInput/MonthScroller.d.ts +5 -2
  42. package/dist/DateInput/MonthScroller.d.ts.map +1 -1
  43. package/dist/DateInput/MonthScroller.js +26 -29
  44. package/dist/DateInput/MonthYearWheels.d.ts +10 -1
  45. package/dist/DateInput/MonthYearWheels.d.ts.map +1 -1
  46. package/dist/DateInput/MonthYearWheels.js +54 -42
  47. package/dist/DateInput/PickerWheel.d.ts.map +1 -1
  48. package/dist/DateInput/PickerWheel.js +7 -1
  49. package/dist/DateInput/TouchDateField.d.ts +1 -1
  50. package/dist/DateInput/TouchDateField.d.ts.map +1 -1
  51. package/dist/DateInput/TouchDateField.js +26 -21
  52. package/dist/DateInput/monthGeometry.d.ts +42 -8
  53. package/dist/DateInput/monthGeometry.d.ts.map +1 -1
  54. package/dist/DateInput/monthGeometry.js +81 -7
  55. package/dist/DateInput/useCalendarPresentation.d.ts +10 -0
  56. package/dist/DateInput/useCalendarPresentation.d.ts.map +1 -0
  57. package/dist/DateInput/useCalendarPresentation.js +32 -0
  58. package/dist/DateInput/useTypedDate.d.ts +92 -0
  59. package/dist/DateInput/useTypedDate.d.ts.map +1 -0
  60. package/dist/DateInput/useTypedDate.js +269 -0
  61. package/dist/DateRangeInput/DateRangeInput.d.ts +17 -1
  62. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  63. package/dist/DateRangeInput/DateRangeInput.js +15 -8
  64. package/dist/DateTimeInput/DateTimeInput.d.ts +26 -3
  65. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  66. package/dist/DateTimeInput/DateTimeInput.js +92 -88
  67. package/dist/DateTimeInput/TouchDateTimeField.d.ts +1 -1
  68. package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
  69. package/dist/DateTimeInput/TouchDateTimeField.js +26 -20
  70. package/dist/Dialog/Dialog.d.ts +2 -1
  71. package/dist/Dialog/Dialog.d.ts.map +1 -1
  72. package/dist/Dialog/Dialog.js +14 -3
  73. package/dist/Drawer/useDrawerDialogPresence.d.ts +2 -1
  74. package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
  75. package/dist/Drawer/useDrawerDialogPresence.js +11 -2
  76. package/dist/DropdownMenu/DropdownMenu.d.ts +9 -1
  77. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  78. package/dist/DropdownMenu/DropdownMenu.js +11 -8
  79. package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
  80. package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -2
  81. package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
  82. package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
  83. package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
  84. package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -2
  85. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  86. package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -2
  87. package/dist/Field/inputDisabledFocus.d.ts +4 -4
  88. package/dist/Field/inputStyles.stylex.d.ts +1 -1
  89. package/dist/FileInput/FileInput.d.ts.map +1 -1
  90. package/dist/FileInput/FileInput.js +16 -2
  91. package/dist/HoverCard/useHoverCard.d.ts +3 -1
  92. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  93. package/dist/Icon/Icon.d.ts +1 -1
  94. package/dist/InfoTip/InfoTip.d.ts +1 -0
  95. package/dist/InfoTip/InfoTip.d.ts.map +1 -1
  96. package/dist/InfoTip/InfoTip.js +6 -18
  97. package/dist/InputGroup/InputGroup.d.ts +4 -3
  98. package/dist/InputGroup/InputGroup.d.ts.map +1 -1
  99. package/dist/InputGroup/InputGroup.js +2 -2
  100. package/dist/InputGroup/groupStyles.d.ts +1 -1
  101. package/dist/InputGroup/groupStyles.d.ts.map +1 -1
  102. package/dist/InputGroup/groupStyles.js +1 -1
  103. package/dist/Item/Item.d.ts +20 -1
  104. package/dist/Item/Item.d.ts.map +1 -1
  105. package/dist/Item/Item.js +97 -29
  106. package/dist/Item/ItemListRowContext.d.ts +2 -0
  107. package/dist/Item/ItemListRowContext.d.ts.map +1 -0
  108. package/dist/Item/ItemListRowContext.js +16 -0
  109. package/dist/Layer/holdEntranceInput.d.ts +24 -0
  110. package/dist/Layer/holdEntranceInput.d.ts.map +1 -0
  111. package/dist/Layer/holdEntranceInput.js +65 -0
  112. package/dist/Layer/inputHold.d.ts +49 -0
  113. package/dist/Layer/inputHold.d.ts.map +1 -0
  114. package/dist/Layer/inputHold.js +636 -0
  115. package/dist/Layer/outsidePress.d.ts +4 -0
  116. package/dist/Layer/outsidePress.d.ts.map +1 -1
  117. package/dist/Layer/outsidePress.js +18 -1
  118. package/dist/Layer/preserveAnimations.d.ts +1 -5
  119. package/dist/Layer/preserveAnimations.d.ts.map +1 -1
  120. package/dist/Layer/preserveAnimations.js +12 -214
  121. package/dist/Layer/useBackdropPress.d.ts +8 -0
  122. package/dist/Layer/useBackdropPress.d.ts.map +1 -1
  123. package/dist/Layer/useBackdropPress.js +31 -2
  124. package/dist/Layer/useLayer.d.ts +3 -1
  125. package/dist/Layer/useLayer.d.ts.map +1 -1
  126. package/dist/Layer/useLayer.js +64 -4
  127. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  128. package/dist/Layer/useTouchTrigger.js +4 -0
  129. package/dist/Layout/LayoutContent.d.ts +3 -1
  130. package/dist/Layout/LayoutContent.d.ts.map +1 -1
  131. package/dist/Layout/LayoutContent.js +12 -4
  132. package/dist/Layout/LayoutPanel.d.ts +13 -10
  133. package/dist/Layout/LayoutPanel.d.ts.map +1 -1
  134. package/dist/Layout/LayoutPanel.js +70 -9
  135. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  136. package/dist/Lightbox/Lightbox.js +4 -0
  137. package/dist/List/List.d.ts.map +1 -1
  138. package/dist/List/List.js +1 -0
  139. package/dist/List/ListItem.d.ts +5 -4
  140. package/dist/List/ListItem.d.ts.map +1 -1
  141. package/dist/List/ListItem.js +45 -9
  142. package/dist/Markdown/parser.d.ts.map +1 -1
  143. package/dist/Markdown/parser.js +56 -39
  144. package/dist/MetadataList/MetadataList.js +1 -1
  145. package/dist/MobileNav/MobileNav.d.ts +11 -1
  146. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  147. package/dist/MobileNav/MobileNav.js +39 -1
  148. package/dist/MoreMenu/MoreMenu.d.ts +5 -3
  149. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  150. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  151. package/dist/MultiSelector/MultiSelector.js +6 -9
  152. package/dist/NumberInput/NumberInput.d.ts +4 -2
  153. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  154. package/dist/NumberInput/NumberInput.js +244 -11
  155. package/dist/Popover/usePopover.d.ts +1 -0
  156. package/dist/Popover/usePopover.d.ts.map +1 -1
  157. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  158. package/dist/PowerSearch/PowerSearch.js +12 -5
  159. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
  160. package/dist/PowerSearch/PowerSearchBottomSheet.js +4 -2
  161. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  162. package/dist/PowerSearch/PowerSearchToken.js +3 -1
  163. package/dist/PowerSearch/formatFilterValue.d.ts +9 -3
  164. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  165. package/dist/PowerSearch/formatFilterValue.js +14 -11
  166. package/dist/PowerSearch/formatTokenValue.d.ts +6 -2
  167. package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
  168. package/dist/PowerSearch/formatTokenValue.js +6 -3
  169. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  170. package/dist/RadioList/RadioListItem.js +16 -3
  171. package/dist/Resizable/ResizeHandle.d.ts +5 -5
  172. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  173. package/dist/Resizable/ResizeHandle.js +44 -5
  174. package/dist/Resizable/resizablePane.d.ts +58 -0
  175. package/dist/Resizable/resizablePane.d.ts.map +1 -0
  176. package/dist/Resizable/resizablePane.js +137 -0
  177. package/dist/Resizable/useResizable.d.ts +7 -0
  178. package/dist/Resizable/useResizable.d.ts.map +1 -1
  179. package/dist/Resizable/useResizable.js +13 -0
  180. package/dist/SelectableCard/SelectableCard.d.ts +1 -1
  181. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  182. package/dist/SelectableCard/SelectableCard.js +5 -1
  183. package/dist/Selector/Selector.d.ts.map +1 -1
  184. package/dist/Selector/Selector.js +51 -10
  185. package/dist/SideNav/SideNav.d.ts +9 -3
  186. package/dist/SideNav/SideNav.d.ts.map +1 -1
  187. package/dist/SideNav/SideNav.js +45 -10
  188. package/dist/Spinner/Spinner.d.ts.map +1 -1
  189. package/dist/Spinner/Spinner.js +14 -71
  190. package/dist/Spinner/index.d.ts +1 -1
  191. package/dist/Spinner/index.d.ts.map +1 -1
  192. package/dist/Spinner/spinnerRotor.d.ts +28 -0
  193. package/dist/Spinner/spinnerRotor.d.ts.map +1 -0
  194. package/dist/Spinner/spinnerRotor.js +98 -0
  195. package/dist/Stack/StackItem.d.ts +8 -4
  196. package/dist/Stack/StackItem.d.ts.map +1 -1
  197. package/dist/Stack/StackItem.js +17 -4
  198. package/dist/Switch/Switch.d.ts.map +1 -1
  199. package/dist/Switch/Switch.js +13 -10
  200. package/dist/TabList/Tab.d.ts.map +1 -1
  201. package/dist/TabList/Tab.js +5 -1
  202. package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
  203. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  204. package/dist/Timestamp/Timestamp.js +14 -8
  205. package/dist/Timestamp/formatInstant.d.ts +10 -1
  206. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  207. package/dist/Timestamp/formatInstant.js +13 -27
  208. package/dist/Timestamp/tooltipEntries.d.ts +5 -3
  209. package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
  210. package/dist/Timestamp/tooltipEntries.js +6 -4
  211. package/dist/Token/Token.d.ts.map +1 -1
  212. package/dist/Token/Token.js +9 -0
  213. package/dist/Token/TokenLink.d.ts +1 -1
  214. package/dist/Token/TokenLink.d.ts.map +1 -1
  215. package/dist/Token/TokenLink.js +4 -1
  216. package/dist/Tokenizer/Tokenizer.d.ts +14 -10
  217. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  218. package/dist/Tokenizer/Tokenizer.js +189 -89
  219. package/dist/Tooltip/useTooltip.d.ts +3 -1
  220. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  221. package/dist/Tooltip/useTooltip.js +164 -59
  222. package/dist/TreeList/TreeListItem.d.ts +2 -1
  223. package/dist/TreeList/TreeListItem.d.ts.map +1 -1
  224. package/dist/TreeList/TreeListItem.js +27 -3
  225. package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
  226. package/dist/Typeahead/BaseTypeahead.js +2 -1
  227. package/dist/astryx.css +362 -325
  228. package/dist/gestures/GestureHost.d.ts +2 -2
  229. package/dist/gestures/GestureHost.d.ts.map +1 -1
  230. package/dist/gestures/GestureHost.js +21 -6
  231. package/dist/gestures/PanGestureRecognizer.d.ts +11 -1
  232. package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
  233. package/dist/gestures/PanGestureRecognizer.js +15 -1
  234. package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +6 -1
  235. package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
  236. package/dist/gestures/nativeScroll.d.ts +3 -6
  237. package/dist/gestures/nativeScroll.d.ts.map +1 -1
  238. package/dist/gestures/nativeScroll.js +7 -52
  239. package/dist/gestures/wheelSegmenter.d.ts +68 -1
  240. package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
  241. package/dist/gestures/wheelSegmenter.js +199 -10
  242. package/dist/hooks/StackItemScrollRegion.d.ts +31 -0
  243. package/dist/hooks/StackItemScrollRegion.d.ts.map +1 -0
  244. package/dist/hooks/StackItemScrollRegion.js +40 -0
  245. package/dist/hooks/computeOverflow.d.ts +2 -0
  246. package/dist/hooks/computeOverflow.d.ts.map +1 -1
  247. package/dist/hooks/computeOverflow.js +1 -1
  248. package/dist/hooks/menuPressGesture.d.ts +133 -21
  249. package/dist/hooks/menuPressGesture.d.ts.map +1 -1
  250. package/dist/hooks/menuPressGesture.js +155 -30
  251. package/dist/hooks/menuPressValues.d.ts +16 -0
  252. package/dist/hooks/menuPressValues.d.ts.map +1 -0
  253. package/dist/hooks/menuPressValues.js +18 -0
  254. package/dist/hooks/useClickableContainer.d.ts +36 -7
  255. package/dist/hooks/useClickableContainer.d.ts.map +1 -1
  256. package/dist/hooks/useClickableContainer.js +63 -14
  257. package/dist/hooks/useFocusTrap.d.ts +10 -0
  258. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  259. package/dist/hooks/useFocusTrap.js +225 -132
  260. package/dist/hooks/useKeyboardHighlight.d.ts +17 -0
  261. package/dist/hooks/useKeyboardHighlight.d.ts.map +1 -0
  262. package/dist/hooks/useKeyboardHighlight.js +38 -0
  263. package/dist/hooks/useMediaQuery.d.ts +2 -1
  264. package/dist/hooks/useMediaQuery.d.ts.map +1 -1
  265. package/dist/hooks/useMediaQuery.js +37 -12
  266. package/dist/hooks/useMenuPress.d.ts +34 -1
  267. package/dist/hooks/useMenuPress.d.ts.map +1 -1
  268. package/dist/hooks/useMenuPress.js +93 -5
  269. package/dist/hooks/useOverflow.d.ts.map +1 -1
  270. package/dist/hooks/useOverflow.js +190 -21
  271. package/dist/hooks/usePressFeedback.d.ts +6 -6
  272. package/dist/hooks/usePressFeedback.js +6 -6
  273. package/dist/hooks/useScrollRegionProps.d.ts +35 -0
  274. package/dist/hooks/useScrollRegionProps.d.ts.map +1 -0
  275. package/dist/hooks/useScrollRegionProps.js +51 -0
  276. package/dist/i18n/InternationalizationContext.d.ts +6 -0
  277. package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
  278. package/dist/i18n/InternationalizationProvider.d.ts +23 -3
  279. package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
  280. package/dist/i18n/InternationalizationProvider.js +8 -3
  281. package/dist/i18n/generated-english/DateInput/DateInput.generated.d.ts.map +1 -1
  282. package/dist/i18n/generated-english/DateInput/DateInput.generated.js +0 -1
  283. package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts +8 -0
  284. package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts.map +1 -0
  285. package/dist/i18n/generated-english/DateInput/useTypedDate.generated.js +16 -0
  286. package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.d.ts.map +1 -1
  287. package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.js +0 -1
  288. package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts +8 -0
  289. package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts.map +1 -0
  290. package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.js +12 -0
  291. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  292. package/dist/i18n/generated-locales/en.generated.js +5 -0
  293. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  294. package/dist/i18n/generated-locales/pseudo.generated.js +5 -0
  295. package/dist/i18n/index.d.ts +2 -0
  296. package/dist/i18n/index.d.ts.map +1 -1
  297. package/dist/i18n/index.js +1 -0
  298. package/dist/i18n/useCalendarSystem.d.ts +19 -0
  299. package/dist/i18n/useCalendarSystem.d.ts.map +1 -0
  300. package/dist/i18n/useCalendarSystem.js +61 -0
  301. package/dist/internal/calendar-system.d.ts +18 -0
  302. package/dist/internal/calendar-system.d.ts.map +1 -0
  303. package/dist/internal/calendar-system.js +19 -0
  304. package/dist/internal/spinner-rotor.d.ts +16 -0
  305. package/dist/internal/spinner-rotor.d.ts.map +1 -0
  306. package/dist/internal/spinner-rotor.js +16 -0
  307. package/dist/internal/touch.d.ts +14 -1
  308. package/dist/internal/touch.d.ts.map +1 -1
  309. package/dist/internal/touch.js +20 -2
  310. package/dist/motion/carryAnimations.d.ts +58 -0
  311. package/dist/motion/carryAnimations.d.ts.map +1 -0
  312. package/dist/motion/carryAnimations.js +305 -0
  313. package/dist/motion/transientCopy.d.ts +4 -2
  314. package/dist/motion/transientCopy.d.ts.map +1 -1
  315. package/dist/motion/transientCopy.js +34 -5
  316. package/dist/motion/uikit/gestures.d.ts +41 -0
  317. package/dist/motion/uikit/gestures.d.ts.map +1 -1
  318. package/dist/motion/uikit/gestures.js +25 -0
  319. package/dist/motion/uikit/index.d.ts +1 -1
  320. package/dist/motion/uikit/index.d.ts.map +1 -1
  321. package/dist/motion/uikit/index.js +1 -1
  322. package/dist/motion/uikit/timing.d.ts +14 -10
  323. package/dist/motion/uikit/timing.d.ts.map +1 -1
  324. package/dist/motion/uikit/timing.js +7 -5
  325. package/dist/privateAttributes/menuPressLit.stylex.d.ts +52 -0
  326. package/dist/privateAttributes/menuPressLit.stylex.d.ts.map +1 -0
  327. package/dist/privateAttributes/menuPressLit.stylex.js +99 -0
  328. package/dist/privateAttributes/press.stylex.d.ts +142 -0
  329. package/dist/privateAttributes/press.stylex.d.ts.map +1 -0
  330. package/dist/privateAttributes/press.stylex.js +101 -0
  331. package/dist/theme/themeMotion.d.ts +3 -2
  332. package/dist/theme/themeMotion.d.ts.map +1 -1
  333. package/dist/theme/themeMotion.js +3 -2
  334. package/dist/theme/tokens.stylex.d.ts +2 -2
  335. package/dist/theme/tokens.stylex.js +1 -1
  336. package/dist/utils/calendarDateParser.d.ts +110 -0
  337. package/dist/utils/calendarDateParser.d.ts.map +1 -0
  338. package/dist/utils/calendarDateParser.js +1225 -0
  339. package/dist/utils/calendarSystem.d.ts +176 -0
  340. package/dist/utils/calendarSystem.d.ts.map +1 -0
  341. package/dist/utils/calendarSystem.js +569 -0
  342. package/dist/utils/coarsePointer.d.ts +5 -0
  343. package/dist/utils/coarsePointer.d.ts.map +1 -1
  344. package/dist/utils/coarsePointer.js +22 -13
  345. package/dist/utils/flatTree.d.ts +6 -3
  346. package/dist/utils/flatTree.d.ts.map +1 -1
  347. package/dist/utils/flatTree.js +13 -3
  348. package/dist/utils/focusReturn.d.ts +10 -2
  349. package/dist/utils/focusReturn.d.ts.map +1 -1
  350. package/dist/utils/focusReturn.js +16 -3
  351. package/dist/utils/hitArea.d.ts +8 -1
  352. package/dist/utils/hitArea.d.ts.map +1 -1
  353. package/dist/utils/hitArea.js +99 -9
  354. package/dist/utils/inputPresentation.d.ts +9 -1
  355. package/dist/utils/inputPresentation.d.ts.map +1 -1
  356. package/dist/utils/inputPresentation.js +15 -1
  357. package/dist/utils/inputStream.d.ts +14 -1
  358. package/dist/utils/inputStream.d.ts.map +1 -1
  359. package/dist/utils/inputStream.js +40 -9
  360. package/dist/utils/interactionOverlay.stylex.d.ts +5 -9
  361. package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
  362. package/dist/utils/interactionOverlay.stylex.js +29 -31
  363. package/dist/utils/plainDate.d.ts +38 -7
  364. package/dist/utils/plainDate.d.ts.map +1 -1
  365. package/dist/utils/plainDate.js +92 -18
  366. package/dist/utils/pressFeedback.d.ts +10 -2
  367. package/dist/utils/pressFeedback.d.ts.map +1 -1
  368. package/dist/utils/pressFeedback.js +40 -15
  369. package/dist/utils/pressGesture.d.ts +12 -6
  370. package/dist/utils/pressGesture.d.ts.map +1 -1
  371. package/dist/utils/pressGesture.js +26 -8
  372. package/dist/utils/scrollView.d.ts +25 -0
  373. package/dist/utils/scrollView.d.ts.map +1 -0
  374. package/dist/utils/scrollView.js +108 -0
  375. package/dist/utils/selectionLock.d.ts.map +1 -1
  376. package/dist/utils/selectionLock.js +1 -10
  377. package/dist/utils/touchHitArea.d.ts +30 -0
  378. package/dist/utils/touchHitArea.d.ts.map +1 -0
  379. package/dist/utils/touchHitArea.js +167 -0
  380. package/dist/utils/touchHitArea.stylex.d.ts +38 -0
  381. package/dist/utils/touchHitArea.stylex.d.ts.map +1 -0
  382. package/dist/utils/touchHitArea.stylex.js +48 -0
  383. package/dist/utils/triggerFocus.d.ts +5 -0
  384. package/dist/utils/triggerFocus.d.ts.map +1 -1
  385. package/dist/utils/triggerFocus.js +9 -2
  386. package/locales/en.json +21 -1
  387. package/locales/pseudo.json +15 -0
  388. package/package.json +15 -4
  389. package/src/AppShell/observeMainOverflow.ts +9 -6
  390. package/src/BottomSheet/BottomSheet.tsx +7 -2
  391. package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
  392. package/src/BottomSheet/bottomSheetStack.ts +4 -3
  393. package/src/BottomSheet/useSheetGestures.ts +83 -20
  394. package/src/Calendar/Calendar.doc.mjs +76 -6
  395. package/src/Calendar/Calendar.tsx +123 -104
  396. package/src/Calendar/getInitialFocusDate.ts +22 -8
  397. package/src/Calendar/hooks/useCalendarDays.ts +89 -63
  398. package/src/Calendar/hooks/useCalendarNavigation.ts +68 -26
  399. package/src/CheckboxInput/CheckboxInput.doc.mjs +5 -4
  400. package/src/CheckboxInput/CheckboxInput.tsx +105 -20
  401. package/src/CheckboxInput/CheckboxRowPressContext.ts +22 -0
  402. package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
  403. package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
  404. package/src/CheckboxList/CheckboxListItem.tsx +35 -14
  405. package/src/ClickableCard/ClickableCard.tsx +8 -1
  406. package/src/ContextMenu/ContextMenu.tsx +2 -0
  407. package/src/DateInput/DateInput.doc.mjs +45 -12
  408. package/src/DateInput/DateInput.tsx +165 -179
  409. package/src/DateInput/MonthScroller.tsx +39 -37
  410. package/src/DateInput/MonthYearWheels.tsx +68 -47
  411. package/src/DateInput/PickerWheel.tsx +7 -2
  412. package/src/DateInput/TouchDateField.tsx +45 -17
  413. package/src/DateInput/monthGeometry.ts +110 -8
  414. package/src/DateInput/useCalendarPresentation.ts +64 -0
  415. package/src/DateInput/useTypedDate.ts +469 -0
  416. package/src/DateRangeInput/DateRangeInput.doc.mjs +9 -0
  417. package/src/DateRangeInput/DateRangeInput.tsx +43 -9
  418. package/src/DateTimeInput/DateTimeInput.doc.mjs +42 -9
  419. package/src/DateTimeInput/DateTimeInput.tsx +138 -148
  420. package/src/DateTimeInput/TouchDateTimeField.tsx +31 -16
  421. package/src/Dialog/Dialog.doc.mjs +1 -1
  422. package/src/Dialog/Dialog.tsx +14 -2
  423. package/src/Drawer/Drawer.doc.mjs +1 -1
  424. package/src/Drawer/useDrawerDialogPresence.ts +9 -2
  425. package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -2
  426. package/src/DropdownMenu/DropdownMenu.tsx +31 -7
  427. package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -1
  428. package/src/DropdownMenu/DropdownMenuItem.tsx +8 -4
  429. package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -1
  430. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -1
  431. package/src/FileInput/FileInput.tsx +16 -2
  432. package/src/HoverCard/useHoverCard.tsx +3 -1
  433. package/src/InfoTip/InfoTip.doc.mjs +26 -2
  434. package/src/InfoTip/InfoTip.tsx +6 -27
  435. package/src/InputGroup/InputGroup.doc.mjs +4 -3
  436. package/src/InputGroup/InputGroup.tsx +4 -3
  437. package/src/InputGroup/groupStyles.ts +3 -1
  438. package/src/Item/Item.tsx +139 -35
  439. package/src/Item/ItemListRowContext.tsx +18 -0
  440. package/src/Layer/holdEntranceInput.ts +84 -0
  441. package/src/Layer/inputHold.ts +734 -0
  442. package/src/Layer/outsidePress.ts +18 -1
  443. package/src/Layer/preserveAnimations.ts +12 -275
  444. package/src/Layer/useBackdropPress.ts +41 -1
  445. package/src/Layer/useLayer.tsx +77 -4
  446. package/src/Layer/useTouchTrigger.ts +4 -0
  447. package/src/Layout/LayoutContent.doc.mjs +6 -3
  448. package/src/Layout/LayoutContent.tsx +10 -4
  449. package/src/Layout/LayoutPanel.doc.mjs +14 -11
  450. package/src/Layout/LayoutPanel.tsx +98 -15
  451. package/src/Lightbox/Lightbox.tsx +4 -0
  452. package/src/List/List.doc.mjs +10 -1
  453. package/src/List/List.tsx +5 -0
  454. package/src/List/ListItem.tsx +63 -8
  455. package/src/Markdown/parser.ts +65 -42
  456. package/src/MetadataList/MetadataList.tsx +1 -1
  457. package/src/MobileNav/MobileNav.doc.mjs +3 -3
  458. package/src/MobileNav/MobileNav.tsx +39 -1
  459. package/src/MoreMenu/MoreMenu.doc.mjs +2 -4
  460. package/src/MoreMenu/MoreMenu.tsx +5 -3
  461. package/src/MultiSelector/MultiSelector.tsx +7 -17
  462. package/src/NumberInput/NumberInput.doc.mjs +1 -1
  463. package/src/NumberInput/NumberInput.tsx +259 -11
  464. package/src/Popover/usePopover.tsx +1 -0
  465. package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
  466. package/src/PowerSearch/PowerSearch.tsx +20 -3
  467. package/src/PowerSearch/PowerSearchBottomSheet.tsx +4 -1
  468. package/src/PowerSearch/PowerSearchToken.tsx +3 -0
  469. package/src/PowerSearch/formatFilterValue.ts +21 -11
  470. package/src/PowerSearch/formatTokenValue.ts +7 -1
  471. package/src/RadioList/RadioListItem.doc.mjs +3 -2
  472. package/src/RadioList/RadioListItem.tsx +16 -6
  473. package/src/Resizable/Resizable.doc.mjs +40 -12
  474. package/src/Resizable/ResizeHandle.tsx +68 -6
  475. package/src/Resizable/resizablePane.ts +179 -0
  476. package/src/Resizable/useResizable.ts +15 -0
  477. package/src/SelectableCard/SelectableCard.tsx +8 -1
  478. package/src/Selector/Selector.tsx +83 -8
  479. package/src/SideNav/SideNav.doc.mjs +2 -2
  480. package/src/SideNav/SideNav.tsx +87 -12
  481. package/src/Spinner/Spinner.tsx +7 -89
  482. package/src/Spinner/index.ts +1 -5
  483. package/src/Spinner/spinnerRotor.ts +113 -0
  484. package/src/Stack/Stack.doc.mjs +1 -1
  485. package/src/Stack/StackItem.tsx +27 -13
  486. package/src/Switch/Switch.tsx +7 -6
  487. package/src/TabList/Tab.tsx +5 -1
  488. package/src/Table/plugins/sortable/useTableSortable.tsx +1 -1
  489. package/src/Timestamp/Timestamp.doc.mjs +3 -3
  490. package/src/Timestamp/Timestamp.tsx +13 -8
  491. package/src/Timestamp/formatInstant.ts +49 -28
  492. package/src/Timestamp/tooltipEntries.ts +7 -3
  493. package/src/Token/Token.tsx +18 -1
  494. package/src/Token/TokenLink.tsx +7 -1
  495. package/src/Tokenizer/Tokenizer.doc.mjs +3 -3
  496. package/src/Tokenizer/Tokenizer.tsx +252 -115
  497. package/src/Tooltip/useTooltip.tsx +180 -80
  498. package/src/TreeList/TreeListItem.tsx +36 -2
  499. package/src/Typeahead/BaseTypeahead.tsx +2 -0
  500. package/src/gestures/GestureHost.ts +21 -5
  501. package/src/gestures/PanGestureRecognizer.ts +19 -2
  502. package/src/gestures/README.md +14 -5
  503. package/src/gestures/ScreenEdgePanGestureRecognizer.ts +6 -1
  504. package/src/gestures/nativeScroll.ts +12 -68
  505. package/src/gestures/wheelSegmenter.ts +243 -10
  506. package/src/hooks/StackItemScrollRegion.tsx +57 -0
  507. package/src/hooks/computeOverflow.ts +1 -1
  508. package/src/hooks/menuPressGesture.ts +244 -38
  509. package/src/hooks/menuPressValues.ts +18 -0
  510. package/src/hooks/useClickableContainer.doc.mjs +8 -2
  511. package/src/hooks/useClickableContainer.ts +93 -15
  512. package/src/hooks/useFocusTrap.ts +268 -151
  513. package/src/hooks/useKeyboardHighlight.ts +71 -0
  514. package/src/hooks/useMediaQuery.ts +41 -12
  515. package/src/hooks/useMenuPress.ts +118 -11
  516. package/src/hooks/useOverflow.ts +297 -73
  517. package/src/hooks/usePressFeedback.doc.mjs +3 -3
  518. package/src/hooks/usePressFeedback.ts +6 -6
  519. package/src/hooks/useScrollRegionProps.ts +76 -0
  520. package/src/i18n/InternationalizationContext.ts +6 -0
  521. package/src/i18n/InternationalizationProvider.doc.mjs +29 -1
  522. package/src/i18n/InternationalizationProvider.tsx +35 -3
  523. package/src/i18n/generated-english/DateInput/DateInput.generated.ts +0 -1
  524. package/src/i18n/generated-english/DateInput/useTypedDate.generated.ts +17 -0
  525. package/src/i18n/generated-english/DateTimeInput/DateTimeInput.generated.ts +0 -1
  526. package/src/i18n/generated-english/hooks/useScrollRegionProps.generated.ts +13 -0
  527. package/src/i18n/generated-locales/en.generated.ts +7 -0
  528. package/src/i18n/generated-locales/pseudo.generated.ts +7 -0
  529. package/src/i18n/index.ts +2 -0
  530. package/src/i18n/useCalendarSystem.ts +95 -0
  531. package/src/internal/calendar-system.ts +26 -0
  532. package/src/internal/spinner-rotor.ts +20 -0
  533. package/src/internal/touch.ts +34 -1
  534. package/src/motion/MEASUREMENTS.md +11 -0
  535. package/src/motion/carryAnimations.ts +389 -0
  536. package/src/motion/transientCopy.ts +45 -5
  537. package/src/motion/uikit/gestures.ts +22 -0
  538. package/src/motion/uikit/index.ts +1 -0
  539. package/src/motion/uikit/timing.ts +7 -5
  540. package/src/privateAttributes/menuPressLit.stylex.ts +104 -0
  541. package/src/privateAttributes/press.stylex.ts +261 -0
  542. package/src/theme/themeMotion.ts +3 -2
  543. package/src/theme/tokens.stylex.ts +1 -1
  544. package/src/utils/calendarDateParser.ts +1385 -0
  545. package/src/utils/calendarSystem.ts +832 -0
  546. package/src/utils/coarsePointer.ts +27 -14
  547. package/src/utils/flatTree.ts +15 -3
  548. package/src/utils/focusReturn.ts +17 -3
  549. package/src/utils/hitArea.ts +138 -9
  550. package/src/utils/inputPresentation.ts +21 -1
  551. package/src/utils/inputStream.ts +47 -10
  552. package/src/utils/interactionOverlay.stylex.ts +19 -22
  553. package/src/utils/plainDate.ts +130 -19
  554. package/src/utils/pressFeedback.ts +46 -14
  555. package/src/utils/pressGesture.ts +35 -9
  556. package/src/utils/scrollView.ts +135 -0
  557. package/src/utils/selectionLock.ts +5 -10
  558. package/src/utils/touchHitArea.stylex.ts +56 -0
  559. package/src/utils/touchHitArea.ts +177 -0
  560. package/src/utils/triggerFocus.ts +17 -4
@@ -4,7 +4,8 @@
4
4
 
5
5
  /**
6
6
  * @file MonthScroller.tsx
7
- * @input Month bounds, selected value, constraints, week start
7
+ * @input A calendar's month model, month bounds, selected value, constraints,
8
+ * week start
8
9
  * @output Exports MonthScroller and MonthScrollerHandle
9
10
  * @position Internal component; consumed by TouchDateField.tsx
10
11
  *
@@ -36,12 +37,14 @@ import {
36
37
  useImperativeHandle,
37
38
  useLayoutEffect,
38
39
  useRef,
40
+ useMemo,
39
41
  useState,
40
42
  } from 'react';
41
43
  import {flushSync} from 'react-dom';
42
44
  import * as stylex from '@stylexjs/stylex';
43
- import {useCalendarDays} from '../Calendar';
44
- import {useDirection, useLocale} from '../i18n';
45
+ import {useCalendarDays} from '../Calendar/hooks/useCalendarDays';
46
+ import {useDirection} from '../i18n/useDirection';
47
+ import {useLocale} from '../i18n/useLocale';
45
48
  import {
46
49
  colorVars,
47
50
  radiusVars,
@@ -50,33 +53,32 @@ import {
50
53
  durationVars,
51
54
  borderVars,
52
55
  } from '../theme/tokens.stylex';
53
- import {focusOutlineStyles} from '../utils';
56
+ import {focusOutlineStyles} from '../utils/focusOutline.stylex';
57
+ import type {DayOfWeek, ISODateString, PlainDate} from '../utils/dateTypes';
54
58
  import {
55
- plainDateFormatDayNumber,
56
- plainDateFormatStandaloneMonthYear,
57
- } from '../utils/plainDate';
58
- import {
59
- type DayOfWeek,
60
- type ISODateString,
61
- type PlainDate,
62
59
  plainDateAddDays,
63
60
  plainDateDayOfWeek,
64
- plainDateFormat,
61
+ plainDateFormatDayNumber,
65
62
  plainDateIsEqual,
66
63
  plainDateToISO,
67
64
  DATE_FORMAT_WITH_WEEKDAY,
68
- } from '../utils';
65
+ } from '../utils/plainDate';
69
66
  import {
70
67
  playReducedMotionDip,
71
68
  reducedMotionFade,
72
69
  type ReducedMotionDip,
73
70
  } from '../motion/reducedMotion';
71
+ import {
72
+ calendarYearMonthOf,
73
+ formatCalendarDate,
74
+ formatCalendarMonthLabel,
75
+ isInCalendarMonth,
76
+ } from '../utils/calendarSystem';
74
77
  import {dateInputTouchSizes, dateInputTouchGeometry} from './tokens.stylex';
75
78
  import {useOwnScrollGesture} from './useOwnScrollGesture';
76
79
  import {useScrollSettle} from './useScrollSettle';
77
80
  import {
78
- fromMonthIndex,
79
- monthIndexOf,
81
+ type MonthModel,
80
82
  paneWindow,
81
83
  rowAtScrollOffset,
82
84
  rowsIn,
@@ -286,6 +288,8 @@ export interface MonthScrollerHandle {
286
288
  export interface MonthScrollerProps {
287
289
  /** Imperative handle for programmatic navigation (Today, the wheels). */
288
290
  handleRef?: React.RefObject<MonthScrollerHandle | null>;
291
+ /** The calendar's months, by index. */
292
+ monthModel: MonthModel;
289
293
  /** First reachable month, as a month index. */
290
294
  minMonthIndex: number;
291
295
  /** Last reachable month, as a month index. */
@@ -311,6 +315,7 @@ export interface MonthScrollerProps {
311
315
  */
312
316
  export function MonthScroller({
313
317
  handleRef,
318
+ monthModel,
314
319
  minMonthIndex,
315
320
  maxMonthIndex,
316
321
  initialMonthIndex,
@@ -763,17 +768,17 @@ export function MonthScroller({
763
768
  const moveFocus = useCallback(
764
769
  (from: PlainDate, deltaDays: number) => {
765
770
  const next = plainDateAddDays(from, deltaDays);
766
- const nextIndex = monthIndexOf(next);
771
+ const nextIndex = monthModel.indexOf(next);
767
772
  if (nextIndex < minMonthIndex || nextIndex > maxMonthIndex) {
768
773
  return;
769
774
  }
770
775
  shouldRestoreFocusRef.current = true;
771
776
  setFocusedDate(next);
772
- if (nextIndex !== monthIndexOf(from)) {
777
+ if (nextIndex !== monthModel.indexOf(from)) {
773
778
  scrollToMonth(nextIndex, 'smooth');
774
779
  }
775
780
  },
776
- [minMonthIndex, maxMonthIndex, scrollToMonth],
781
+ [monthModel, minMonthIndex, maxMonthIndex, scrollToMonth],
777
782
  );
778
783
 
779
784
  const handleKeyDown = useCallback(
@@ -861,6 +866,7 @@ export function MonthScroller({
861
866
  rowsIn(visibleRows).map(row => (
862
867
  <MonthPane
863
868
  key={row}
869
+ monthModel={monthModel}
864
870
  monthIndex={minMonthIndex + row}
865
871
  insetInlineStart={row * paneSize}
866
872
  inlineSize={paneSize}
@@ -882,6 +888,7 @@ export function MonthScroller({
882
888
  MonthScroller.displayName = 'MonthScroller';
883
889
 
884
890
  interface MonthPaneProps {
891
+ monthModel: MonthModel;
885
892
  monthIndex: number;
886
893
  insetInlineStart: number;
887
894
  inlineSize: number;
@@ -903,6 +910,7 @@ interface MonthPaneProps {
903
910
  * so each day instead carries its weekday in its accessible name.
904
911
  */
905
912
  function MonthPane({
913
+ monthModel,
906
914
  monthIndex,
907
915
  insetInlineStart,
908
916
  inlineSize,
@@ -916,40 +924,33 @@ function MonthPane({
916
924
  onDayFocus,
917
925
  }: MonthPaneProps) {
918
926
  const locale = useLocale();
919
- const {year, month} = fromMonthIndex(monthIndex);
927
+ const {calendar} = monthModel;
928
+ const month = useMemo(
929
+ () => monthModel.monthAt(monthIndex),
930
+ [monthModel, monthIndex],
931
+ );
920
932
  const {weeks} = useCalendarDays({
921
- year,
922
- month,
933
+ ...calendarYearMonthOf(calendar, month),
934
+ calendar,
923
935
  weekStartsOn,
924
936
  // Always six rows: a variable grid would make pane heights differ, and
925
937
  // with them every snap offset below this month.
926
938
  hasVariableRowCount: false,
927
939
  });
928
940
 
929
- const monthLabel = plainDateFormatStandaloneMonthYear(
930
- {year, month, day: 1},
931
- locale,
932
- );
941
+ const monthLabel = formatCalendarMonthLabel(calendar, month, locale);
933
942
 
934
943
  // Exactly one day per pane is tab-reachable, so Tab moves through the
935
944
  // picker rather than through 42 buttons: the focused day if the keyboard
936
945
  // owns one, else the selection, else the first of the month.
937
946
  const tabbableISO = (() => {
938
- if (
939
- focusedDate != null &&
940
- focusedDate.year === year &&
941
- focusedDate.month === month
942
- ) {
947
+ if (focusedDate != null && isInCalendarMonth(focusedDate, month)) {
943
948
  return plainDateToISO(focusedDate);
944
949
  }
945
- if (
946
- selectedDate != null &&
947
- selectedDate.year === year &&
948
- selectedDate.month === month
949
- ) {
950
+ if (selectedDate != null && isInCalendarMonth(selectedDate, month)) {
950
951
  return plainDateToISO(selectedDate);
951
952
  }
952
- return plainDateToISO({year, month, day: 1});
953
+ return plainDateToISO(month.start);
953
954
  })();
954
955
 
955
956
  return (
@@ -987,7 +988,8 @@ function MonthPane({
987
988
  data-date={day.iso}
988
989
  data-outside={day.isOutside ? '' : undefined}
989
990
  tabIndex={day.iso === tabbableISO ? 0 : -1}
990
- aria-label={plainDateFormat(
991
+ aria-label={formatCalendarDate(
992
+ calendar,
991
993
  day.date,
992
994
  DATE_FORMAT_WITH_WEEKDAY,
993
995
  locale,
@@ -4,8 +4,10 @@
4
4
 
5
5
  /**
6
6
  * @file MonthYearWheels.tsx
7
- * @input A month index, the reachable month bounds, a change callback
8
- * @output Exports MonthYearWheels — the month + year wheel pair
7
+ * @input A calendar's month model, a month index, the reachable month bounds,
8
+ * a change callback
9
+ * @output Exports MonthYearWheels — the month wheel of a calendar year and the
10
+ * year wheel with era labels
9
11
  * @position Internal component; consumed by TouchDateField.tsx
10
12
  *
11
13
  * The shortcut out of continuous scrolling. Scrolling is the right gesture for
@@ -24,12 +26,16 @@
24
26
 
25
27
  import {useMemo} from 'react';
26
28
  import * as stylex from '@stylexjs/stylex';
27
- import {useLocale} from '../i18n';
28
- import {DATE_FORMAT_MONTH_ONLY, plainDateFormat} from '../utils';
29
+ import {useLocale} from '../i18n/useLocale';
30
+ import {
31
+ calendarYearSpansEras,
32
+ formatCalendarMonthName,
33
+ formatCalendarYearLabel,
34
+ } from '../utils/calendarSystem';
29
35
  import {spacingVars} from '../theme/tokens.stylex';
30
36
  import {dateInputTouchGeometry} from './tokens.stylex';
31
37
  import {Wheel, type WheelOption} from './Wheel';
32
- import {fromMonthIndex, toMonthIndex} from './monthGeometry';
38
+ import {clampIndex, type MonthModel} from './monthGeometry';
33
39
 
34
40
  const styles = stylex.create({
35
41
  wheels: {
@@ -40,6 +46,8 @@ const styles = stylex.create({
40
46
  });
41
47
 
42
48
  export interface MonthYearWheelsProps {
49
+ /** The calendar's months, by index. */
50
+ monthModel: MonthModel;
43
51
  /** The month the wheels currently show. */
44
52
  monthIndex: number;
45
53
  /** First reachable month. */
@@ -54,12 +62,19 @@ export interface MonthYearWheelsProps {
54
62
  yearLabel: string;
55
63
  /** False while the panel is hidden. */
56
64
  isActive?: boolean;
65
+ /**
66
+ * The day of the month the picker keeps, such as the selected date's. A year
67
+ * that spans an era change is labeled with the era of this day in the
68
+ * selected month. The first day of the month applies when it is absent.
69
+ */
70
+ keptDay?: number;
57
71
  }
58
72
 
59
73
  /**
60
74
  * Month and year wheels, bounded by the same range as the scroller.
61
75
  */
62
76
  export function MonthYearWheels({
77
+ monthModel,
63
78
  monthIndex,
64
79
  minMonthIndex,
65
80
  maxMonthIndex,
@@ -67,60 +82,63 @@ export function MonthYearWheels({
67
82
  monthLabel,
68
83
  yearLabel,
69
84
  isActive = true,
85
+ keptDay = 1,
70
86
  }: MonthYearWheelsProps) {
71
87
  const locale = useLocale();
72
- const {year, month} = fromMonthIndex(monthIndex);
73
-
74
- // Day 15 of a fixed year: no timezone can push it into an adjacent month
75
- // the way day 1 or day 31 can.
76
- //
77
- // `plainDateFormat` rather than a raw `Intl.DateTimeFormat`, which the
78
- // shared lint rule forbids and which would duplicate the format vocabulary
79
- // besides. Recompute when the provider locale changes so the wheel labels
80
- // stay in sync with the field and calendar.
81
- const monthNames = useMemo(
82
- () =>
83
- Array.from({length: 12}, (_, index) =>
84
- plainDateFormat(
85
- {year: 2021, month: index + 1, day: 15},
86
- DATE_FORMAT_MONTH_ONLY,
87
- locale,
88
- ),
89
- ),
90
- [locale],
91
- );
88
+ const {calendar} = monthModel;
89
+ const {year, month} = monthModel.yearMonthAt(monthIndex);
92
90
 
93
91
  // Months outside the range stay on the wheel rather than vanishing: a list
94
- // whose length changes with the year would jump under the finger.
92
+ // whose length changed with the range would jump under the finger. Only the
93
+ // calendar changes its length, for a year with a leap month.
95
94
  const monthOptions: WheelOption[] = useMemo(
96
95
  () =>
97
- monthNames.map((name, index) => {
98
- const candidate = toMonthIndex(year, index + 1);
96
+ Array.from({length: monthModel.monthsInYear(year)}, (_, index) => {
97
+ const candidate = monthModel.indexOfYearMonth(year, index + 1);
99
98
  return {
100
99
  value: index + 1,
101
- label: name,
100
+ label: formatCalendarMonthName(
101
+ calendar,
102
+ monthModel.monthAt(candidate),
103
+ locale,
104
+ ),
102
105
  isDisabled: candidate < minMonthIndex || candidate > maxMonthIndex,
103
106
  };
104
107
  }),
105
- [monthNames, year, minMonthIndex, maxMonthIndex],
108
+ [monthModel, calendar, year, locale, minMonthIndex, maxMonthIndex],
106
109
  );
107
110
 
108
- const yearOptions: WheelOption[] = useMemo(() => {
109
- const first = fromMonthIndex(minMonthIndex).year;
110
- const last = fromMonthIndex(maxMonthIndex).year;
111
- const options: WheelOption[] = [];
111
+ // Every listed year holds a reachable month: the list runs from the year of
112
+ // the first reachable month to the year of the last.
113
+ const years = useMemo(() => {
114
+ const first = monthModel.yearMonthAt(minMonthIndex).year;
115
+ const last = monthModel.yearMonthAt(maxMonthIndex).year;
116
+ const result: {value: number; label: string; spansEras: boolean}[] = [];
112
117
  for (let candidate = first; candidate <= last; candidate++) {
113
- options.push({
118
+ result.push({
114
119
  value: candidate,
115
- label: String(candidate),
116
- // A year is reachable when any of its months is.
117
- isDisabled:
118
- toMonthIndex(candidate, 12) < minMonthIndex ||
119
- toMonthIndex(candidate, 1) > maxMonthIndex,
120
+ label: formatCalendarYearLabel(calendar, candidate, locale),
121
+ spansEras: calendarYearSpansEras(calendar, candidate, locale),
120
122
  });
121
123
  }
122
- return options;
123
- }, [minMonthIndex, maxMonthIndex]);
124
+ return result;
125
+ }, [monthModel, calendar, locale, minMonthIndex, maxMonthIndex]);
126
+
127
+ // A year with an era change takes the era of the shown date, as iOS does.
128
+ // Its row text changes as the month turns. Each row keeps one fixed size.
129
+ const yearOptions: WheelOption[] = useMemo(
130
+ () =>
131
+ years.map(({value, label, spansEras}) => ({
132
+ value,
133
+ label: spansEras
134
+ ? formatCalendarYearLabel(calendar, value, locale, {
135
+ month,
136
+ day: keptDay,
137
+ })
138
+ : label,
139
+ })),
140
+ [years, calendar, locale, month, keptDay],
141
+ );
124
142
 
125
143
  return (
126
144
  <div {...stylex.props(styles.wheels)}>
@@ -129,7 +147,9 @@ export function MonthYearWheels({
129
147
  options={monthOptions}
130
148
  value={month}
131
149
  isActive={isActive}
132
- onChange={nextMonth => onChange(toMonthIndex(year, nextMonth))}
150
+ onChange={nextMonth =>
151
+ onChange(monthModel.indexOfYearMonth(year, nextMonth))
152
+ }
133
153
  />
134
154
  <Wheel
135
155
  label={yearLabel}
@@ -137,10 +157,11 @@ export function MonthYearWheels({
137
157
  value={year}
138
158
  isActive={isActive}
139
159
  onChange={nextYear => {
140
- // Jan 31 -> Feb has no equivalent here (months carry no day), but a
141
- // year change can still land outside the range; clamp to it.
142
- const candidate = toMonthIndex(nextYear, month);
143
- onChange(Math.min(Math.max(candidate, minMonthIndex), maxMonthIndex));
160
+ // The same month of the new year, or its common counterpart when
161
+ // the new year lacks a leap month (Adar I becomes Adar). A year
162
+ // change can still land outside the range; clamp to it.
163
+ const candidate = monthModel.shiftYears(monthIndex, nextYear - year);
164
+ onChange(clampIndex(candidate, minMonthIndex, maxMonthIndex));
144
165
  }}
145
166
  />
146
167
  </div>
@@ -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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @file TouchDateField.tsx
7
- * @input Uses React, Field, BottomSheet, Button, Icon, Calendar hooks, MonthScroller, MonthYearWheels
7
+ * @input Uses React, Field, BottomSheet, Button, Icon, Calendar hooks, the resolved calendar, MonthScroller, MonthYearWheels
8
8
  * @output Exports TouchDateField — the touch surface behind DateInput
9
9
  * @position Internal component; consumed by DateInput.tsx
10
10
  *
@@ -105,12 +105,16 @@ import {
105
105
  mergeProps,
106
106
  rtlStyles,
107
107
  themeProps,
108
- formatSharedDate,
109
108
  plainDateFromISO,
110
109
  plainDateToday,
111
110
  type ISODateString,
112
111
  } from '../utils';
113
- import {plainDateFormatStandaloneMonthYear} from '../utils/plainDate';
112
+ import {useCalendarSystem} from '../i18n/useCalendarSystem';
113
+ import {
114
+ calendarDayOfMonth,
115
+ formatCalendarMonthLabel,
116
+ } from '../utils/calendarSystem';
117
+ import {formatCalendarDateText} from '../utils/calendarDateParser';
114
118
  import {chainEventHandlers} from '../utils/chainEventHandlers';
115
119
  import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
116
120
  import {usePressFeedback} from '../hooks/usePressFeedback';
@@ -121,8 +125,7 @@ import {MonthYearWheels} from './MonthYearWheels';
121
125
  import {
122
126
  DEFAULT_MONTH_REACH,
123
127
  clampIndex,
124
- fromMonthIndex,
125
- monthIndexOf,
128
+ createMonthModel,
126
129
  } from './monthGeometry';
127
130
  import {dateInputTouchSizes, dateInputTouchGeometry} from './tokens.stylex';
128
131
  import {
@@ -581,6 +584,7 @@ export function TouchDateField({
581
584
  numberOfMonths: _numberOfMonths,
582
585
  weekStartsOn: weekStartsOnProp = 0,
583
586
  format = 'date_long',
587
+ calendar: calendarProp,
584
588
  width,
585
589
  containerXstyle,
586
590
  containerClassName,
@@ -612,6 +616,8 @@ export function TouchDateField({
612
616
  placeholderFromProps ?? t('@astryx.dateInput.placeholder');
613
617
  const size = useSize(sizeProp, 'md');
614
618
  const weekStartsOn = normalizeDayOfWeek(weekStartsOnProp);
619
+ const calendar = useCalendarSystem(calendarProp, 'DateInput');
620
+ const monthModel = useMemo(() => createMonthModel(calendar), [calendar]);
615
621
 
616
622
  const generatedID = useId();
617
623
  const id = idProp ?? generatedID;
@@ -698,8 +704,10 @@ export function TouchDateField({
698
704
  // century in each direction from wherever it opened. Anchored once, in a
699
705
  // state initializer: recomputing it as the selection moves would shift every
700
706
  // pane's scroll offset under the user mid-gesture.
707
+ // Indexes belong to the calendar, so DateInput remounts this surface when
708
+ // the calendar changes.
701
709
  const [anchorMonthIndex] = useState(() =>
702
- monthIndexOf(
710
+ monthModel.indexOf(
703
711
  value != null && /^\d{4}-\d{2}-\d{2}$/.test(value)
704
712
  ? plainDateFromISO(value)
705
713
  : plainDateToday(),
@@ -707,36 +715,45 @@ export function TouchDateField({
707
715
  );
708
716
  const minMonthIndex =
709
717
  min != null
710
- ? monthIndexOf(plainDateFromISO(min))
718
+ ? monthModel.indexOf(plainDateFromISO(min))
711
719
  : anchorMonthIndex - DEFAULT_MONTH_REACH;
712
720
  const maxMonthIndex =
713
721
  max != null
714
- ? monthIndexOf(plainDateFromISO(max))
722
+ ? monthModel.indexOf(plainDateFromISO(max))
715
723
  : anchorMonthIndex + DEFAULT_MONTH_REACH;
716
724
 
717
725
  const [monthIndex, setMonthIndex] = useState(() =>
718
726
  clampIndex(anchorMonthIndex, minMonthIndex, maxMonthIndex),
719
727
  );
720
728
 
721
- const {year, month} = fromMonthIndex(monthIndex);
722
-
723
729
  const weekdayHeaders = useMemo(
724
730
  () => getWeekdayHeaders(locale, weekStartsOn),
725
731
  [locale, weekStartsOn],
726
732
  );
727
- const monthYearLabel = plainDateFormatStandaloneMonthYear(
728
- {year, month, day: 1},
733
+ // The day the picker keeps: the selected date's day of its month. A month
734
+ // with an era change takes its heading era from this day.
735
+ const keptDay =
736
+ selectedDate == null ? 1 : calendarDayOfMonth(calendar, selectedDate);
737
+ const monthYearLabel = formatCalendarMonthLabel(
738
+ calendar,
739
+ monthModel.monthAt(monthIndex),
729
740
  locale,
741
+ keptDay,
730
742
  );
731
743
 
732
744
  // Formats the committed value only. A function format is called with the ISO
733
- // value; a named one reuses Timestamp's shared date mapping, so the same
734
- // literal renders the same shape here and on the desktop control.
745
+ // value; a named one writes the date in the calendar exactly as the desktop
746
+ // control commits it.
735
747
  const displayValue =
736
748
  optimisticValue != null && /^\d{4}-\d{2}-\d{2}$/.test(optimisticValue)
737
749
  ? typeof format === 'function'
738
750
  ? format(optimisticValue)
739
- : formatSharedDate(plainDateFromISO(optimisticValue), format, locale)
751
+ : formatCalendarDateText(
752
+ plainDateFromISO(optimisticValue),
753
+ format,
754
+ locale,
755
+ calendar,
756
+ )
740
757
  : '';
741
758
 
742
759
  const fireChange = useCallback(
@@ -822,7 +839,7 @@ export function TouchDateField({
822
839
  return;
823
840
  }
824
841
  fireChange(undefined);
825
- const currentMonth = monthIndexOf(today);
842
+ const currentMonth = monthModel.indexOf(today);
826
843
  if (currentMonth < minMonthIndex || currentMonth > maxMonthIndex) {
827
844
  return;
828
845
  }
@@ -831,7 +848,15 @@ export function TouchDateField({
831
848
  }
832
849
  setMonthIndex(currentMonth);
833
850
  scrollerHandleRef.current?.scrollToMonth(currentMonth, 'smooth');
834
- }, [isDisabled, fireChange, today, monthIndex, minMonthIndex, maxMonthIndex]);
851
+ }, [
852
+ isDisabled,
853
+ fireChange,
854
+ monthModel,
855
+ today,
856
+ monthIndex,
857
+ minMonthIndex,
858
+ maxMonthIndex,
859
+ ]);
835
860
 
836
861
  // Selection commits on the tap and leaves the sheet up, so a mistake can be
837
862
  // corrected in place and a nearby date reconsidered without reopening.
@@ -1104,6 +1129,7 @@ export function TouchDateField({
1104
1129
  <MonthScroller
1105
1130
  key={`${minMonthIndex}:${maxMonthIndex}`}
1106
1131
  handleRef={scrollerHandleRef}
1132
+ monthModel={monthModel}
1107
1133
  minMonthIndex={minMonthIndex}
1108
1134
  maxMonthIndex={maxMonthIndex}
1109
1135
  initialMonthIndex={monthIndex}
@@ -1124,7 +1150,9 @@ export function TouchDateField({
1124
1150
  !isWheelOpen && styles.panelOverlayHidden,
1125
1151
  )}>
1126
1152
  <MonthYearWheels
1153
+ monthModel={monthModel}
1127
1154
  monthIndex={monthIndex}
1155
+ keptDay={keptDay}
1128
1156
  minMonthIndex={minMonthIndex}
1129
1157
  maxMonthIndex={maxMonthIndex}
1130
1158
  onChange={handleWheelChange}