@astryxdesign/core 0.7.15 → 0.7.16-canary.g3aa244b

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 (373) hide show
  1. package/dist/AppShell/AppShell.d.ts.map +1 -1
  2. package/dist/AppShell/AppShell.js +8 -2
  3. package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +2 -1
  4. package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -1
  5. package/dist/AppShell/useCloseMobileDrawerOnActivate.js +15 -2
  6. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  7. package/dist/BottomSheet/BottomSheet.js +11 -6
  8. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  9. package/dist/BottomSheet/BottomSheetPanel.js +52 -35
  10. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  11. package/dist/BottomSheet/useSheetGestures.js +4 -7
  12. package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
  13. package/dist/Chat/ChatComposerInput.js +1 -1
  14. package/dist/DateInput/DateInput.d.ts +27 -3
  15. package/dist/DateInput/DateInput.d.ts.map +1 -1
  16. package/dist/DateInput/DateInput.js +24 -6
  17. package/dist/DateInput/NativeDateField.d.ts +1 -1
  18. package/dist/DateInput/NativeDateField.d.ts.map +1 -1
  19. package/dist/DateInput/NativeDateField.js +48 -31
  20. package/dist/DateInput/index.d.ts +1 -1
  21. package/dist/DateInput/index.d.ts.map +1 -1
  22. package/dist/DateInput/useTypedDate.d.ts +75 -8
  23. package/dist/DateInput/useTypedDate.d.ts.map +1 -1
  24. package/dist/DateInput/useTypedDate.js +188 -133
  25. package/dist/DateTimeInput/DateTimeInput.d.ts +32 -3
  26. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  27. package/dist/DateTimeInput/DateTimeInput.js +99 -62
  28. package/dist/DateTimeInput/NativeDateSegment.d.ts +8 -1
  29. package/dist/DateTimeInput/NativeDateSegment.d.ts.map +1 -1
  30. package/dist/DateTimeInput/NativeDateSegment.js +20 -14
  31. package/dist/DateTimeInput/NativeTimeSegment.d.ts +13 -1
  32. package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
  33. package/dist/DateTimeInput/NativeTimeSegment.js +21 -18
  34. package/dist/DateTimeInput/index.d.ts +1 -1
  35. package/dist/DateTimeInput/index.d.ts.map +1 -1
  36. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  37. package/dist/DropdownMenu/DropdownMenu.js +10 -3
  38. package/dist/Field/InputClearButton.d.ts.map +1 -1
  39. package/dist/Field/InputClearButton.js +4 -2
  40. package/dist/Field/useEntryErrorBehavior.d.ts +8 -0
  41. package/dist/Field/useEntryErrorBehavior.d.ts.map +1 -0
  42. package/dist/Field/useEntryErrorBehavior.js +30 -0
  43. package/dist/Field/useEntryErrorReport.d.ts +40 -0
  44. package/dist/Field/useEntryErrorReport.d.ts.map +1 -0
  45. package/dist/Field/useEntryErrorReport.js +157 -0
  46. package/dist/Field/useValueReplacesEntry.d.ts +11 -0
  47. package/dist/Field/useValueReplacesEntry.d.ts.map +1 -0
  48. package/dist/Field/useValueReplacesEntry.js +46 -0
  49. package/dist/FormLayout/FormLayout.d.ts +21 -2
  50. package/dist/FormLayout/FormLayout.d.ts.map +1 -1
  51. package/dist/FormLayout/FormLayout.js +5 -2
  52. package/dist/FormLayout/FormLayoutContext.d.ts +18 -2
  53. package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
  54. package/dist/FormLayout/FormLayoutContext.js +22 -4
  55. package/dist/FormLayout/index.d.ts +1 -1
  56. package/dist/FormLayout/index.d.ts.map +1 -1
  57. package/dist/InfoTip/InfoTip.d.ts +1 -1
  58. package/dist/InfoTip/InfoTip.d.ts.map +1 -1
  59. package/dist/InfoTip/InfoTip.js +4 -1
  60. package/dist/Layer/gestureCounter.d.ts +14 -0
  61. package/dist/Layer/gestureCounter.d.ts.map +1 -1
  62. package/dist/Layer/gestureCounter.js +123 -4
  63. package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
  64. package/dist/Layer/layerAnimations.stylex.js +17 -13
  65. package/dist/Layer/layerEntranceSide.d.ts +24 -10
  66. package/dist/Layer/layerEntranceSide.d.ts.map +1 -1
  67. package/dist/Layer/layerEntranceSide.js +28 -13
  68. package/dist/Layer/useLayer.d.ts.map +1 -1
  69. package/dist/Layer/useLayer.js +76 -15
  70. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  71. package/dist/Layer/useTouchTrigger.js +14 -20
  72. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  73. package/dist/Lightbox/Lightbox.js +625 -180
  74. package/dist/List/ListItem.d.ts +3 -2
  75. package/dist/List/ListItem.d.ts.map +1 -1
  76. package/dist/List/ListReorderHandle.d.ts +7 -0
  77. package/dist/List/ListReorderHandle.d.ts.map +1 -1
  78. package/dist/List/ListReorderHandle.js +42 -58
  79. package/dist/List/listReorderContext.d.ts.map +1 -1
  80. package/dist/List/listReorderContext.js +4 -4
  81. package/dist/List/listReorderEngine.d.ts +50 -2
  82. package/dist/List/listReorderEngine.d.ts.map +1 -1
  83. package/dist/List/listReorderEngine.js +205 -10
  84. package/dist/Markdown/plugins/textTransform.d.ts.map +1 -1
  85. package/dist/Markdown/plugins/textTransform.js +31 -10
  86. package/dist/MoreMenu/MoreMenu.d.ts +1 -1
  87. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  88. package/dist/MoreMenu/MoreMenu.js +4 -1
  89. package/dist/NumberInput/NumberInput.d.ts +60 -2
  90. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  91. package/dist/NumberInput/NumberInput.js +141 -40
  92. package/dist/NumberInput/index.d.ts +2 -2
  93. package/dist/NumberInput/index.d.ts.map +1 -1
  94. package/dist/NumberInput/index.js +1 -1
  95. package/dist/NumberInput/numberInputCommit.d.ts +18 -1
  96. package/dist/NumberInput/numberInputCommit.d.ts.map +1 -1
  97. package/dist/NumberInput/numberInputCommit.js +57 -3
  98. package/dist/Pagination/Pagination.d.ts.map +1 -1
  99. package/dist/Pagination/Pagination.js +12 -3
  100. package/dist/Popover/usePopover.d.ts.map +1 -1
  101. package/dist/Popover/usePopover.js +23 -15
  102. package/dist/PowerSearch/PowerSearch.d.ts +1 -1
  103. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  104. package/dist/PowerSearch/PowerSearch.js +8 -4
  105. package/dist/PowerSearch/PowerSearchEditPopover.d.ts +4 -1
  106. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  107. package/dist/PowerSearch/PowerSearchEditPopover.js +4 -1
  108. package/dist/PowerSearch/PowerSearchFilterEditor.d.ts +1 -1
  109. package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
  110. package/dist/PowerSearch/PowerSearchFilterEditor.js +7 -3
  111. package/dist/PowerSearch/PowerSearchToken.d.ts +1 -1
  112. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  113. package/dist/PowerSearch/PowerSearchToken.js +4 -1
  114. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  115. package/dist/PowerSearch/PowerSearchValueEditor.js +4 -0
  116. package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
  117. package/dist/Selector/useSelectorPresentation.js +13 -12
  118. package/dist/Slider/Slider.d.ts.map +1 -1
  119. package/dist/Slider/Slider.js +6 -8
  120. package/dist/Table/BaseTable.d.ts +1 -1
  121. package/dist/Table/BaseTable.d.ts.map +1 -1
  122. package/dist/Table/BaseTable.js +276 -198
  123. package/dist/Table/Table.d.ts +5 -1
  124. package/dist/Table/Table.d.ts.map +1 -1
  125. package/dist/Table/index.d.ts +5 -3
  126. package/dist/Table/index.d.ts.map +1 -1
  127. package/dist/Table/index.js +2 -1
  128. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  129. package/dist/Table/plugins/filtering/useTableFiltering.js +2 -0
  130. package/dist/Table/plugins/infiniteScroll/TableInfiniteScrollWide.a11y.chromium.spec.d.ts.map +1 -0
  131. package/dist/Table/plugins/infiniteScroll/index.d.ts +9 -0
  132. package/dist/Table/plugins/infiniteScroll/index.d.ts.map +1 -0
  133. package/dist/Table/plugins/infiniteScroll/index.js +9 -0
  134. package/dist/Table/plugins/infiniteScroll/useTableInfiniteScroll.d.ts +29 -0
  135. package/dist/Table/plugins/infiniteScroll/useTableInfiniteScroll.d.ts.map +1 -0
  136. package/dist/Table/plugins/infiniteScroll/useTableInfiniteScroll.js +394 -0
  137. package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
  138. package/dist/Table/plugins/sortable/useTableSortableState.js +4 -4
  139. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
  140. package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +21 -1
  141. package/dist/Table/plugins/virtualization/TableColumnWindow.d.ts +4 -0
  142. package/dist/Table/plugins/virtualization/TableColumnWindow.d.ts.map +1 -0
  143. package/dist/Table/plugins/virtualization/TableColumnWindow.js +114 -0
  144. package/dist/Table/plugins/virtualization/index.d.ts +3 -1
  145. package/dist/Table/plugins/virtualization/index.d.ts.map +1 -1
  146. package/dist/Table/plugins/virtualization/index.js +3 -2
  147. package/dist/Table/plugins/virtualization/useTableColumnWindow.d.ts +39 -0
  148. package/dist/Table/plugins/virtualization/useTableColumnWindow.d.ts.map +1 -0
  149. package/dist/Table/plugins/virtualization/useTableColumnWindow.js +215 -0
  150. package/dist/Table/plugins/virtualization/useTableColumnsVirtualization.d.ts +23 -0
  151. package/dist/Table/plugins/virtualization/useTableColumnsVirtualization.d.ts.map +1 -0
  152. package/dist/Table/plugins/virtualization/useTableColumnsVirtualization.js +37 -0
  153. package/dist/Table/plugins/virtualization/useTableWindow.d.ts +2 -1
  154. package/dist/Table/plugins/virtualization/useTableWindow.d.ts.map +1 -1
  155. package/dist/Table/plugins/virtualization/useTableWindow.js +43 -13
  156. package/dist/Table/tableColumnWindowing.d.ts +107 -0
  157. package/dist/Table/tableColumnWindowing.d.ts.map +1 -0
  158. package/dist/Table/tableColumnWindowing.js +72 -0
  159. package/dist/Table/tablePinnedColumnRuns.d.ts +23 -0
  160. package/dist/Table/tablePinnedColumnRuns.d.ts.map +1 -0
  161. package/dist/Table/tablePinnedColumnRuns.js +41 -0
  162. package/dist/Table/tableRuntime.d.ts +14 -2
  163. package/dist/Table/tableRuntime.d.ts.map +1 -1
  164. package/dist/Table/tableRuntime.js +32 -11
  165. package/dist/Table/types.d.ts +28 -2
  166. package/dist/Table/types.d.ts.map +1 -1
  167. package/dist/Table/useBaseTablePlugins.js +2 -2
  168. package/dist/Text/useTruncation.d.ts +6 -1
  169. package/dist/Text/useTruncation.d.ts.map +1 -1
  170. package/dist/Text/useTruncation.js +53 -35
  171. package/dist/TextArea/TextArea.d.ts +10 -1
  172. package/dist/TextArea/TextArea.d.ts.map +1 -1
  173. package/dist/TextArea/TextArea.js +2 -0
  174. package/dist/TimeInput/TimeInput.d.ts +61 -0
  175. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  176. package/dist/TimeInput/TimeInput.js +97 -84
  177. package/dist/TimeInput/index.d.ts +1 -1
  178. package/dist/TimeInput/index.d.ts.map +1 -1
  179. package/dist/TimeInput/useTypedTime.d.ts +76 -0
  180. package/dist/TimeInput/useTypedTime.d.ts.map +1 -0
  181. package/dist/TimeInput/useTypedTime.js +258 -0
  182. package/dist/Toast/Toast.d.ts +1 -1
  183. package/dist/Toast/Toast.d.ts.map +1 -1
  184. package/dist/Toast/Toast.js +4 -2
  185. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  186. package/dist/Tooltip/useTooltip.js +46 -53
  187. package/dist/astryx.css +22 -11
  188. package/dist/dragToSnapPoints/createDragToSnapPoints.d.ts +156 -0
  189. package/dist/dragToSnapPoints/createDragToSnapPoints.d.ts.map +1 -1
  190. package/dist/dragToSnapPoints/createDragToSnapPoints.js +313 -97
  191. package/dist/gestures/createPanGesture.d.ts +41 -0
  192. package/dist/gestures/createPanGesture.d.ts.map +1 -1
  193. package/dist/gestures/createPanGesture.js +66 -22
  194. package/dist/hooks/useMenuPress.d.ts.map +1 -1
  195. package/dist/hooks/useMenuPress.js +36 -2
  196. package/dist/i18n/generated-english/DateInput/NativeDateField.generated.d.ts.map +1 -1
  197. package/dist/i18n/generated-english/DateInput/NativeDateField.generated.js +0 -1
  198. package/dist/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.d.ts.map +1 -1
  199. package/dist/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.js +0 -1
  200. package/dist/i18n/generated-english/Lightbox/Lightbox.generated.d.ts.map +1 -1
  201. package/dist/i18n/generated-english/Lightbox/Lightbox.generated.js +2 -0
  202. package/dist/i18n/generated-english/{DateTimeInput/NativeTimeSegment.generated.d.ts → Table/plugins/infiniteScroll/useTableInfiniteScroll.generated.d.ts} +2 -2
  203. package/dist/i18n/generated-english/Table/plugins/infiniteScroll/useTableInfiniteScroll.generated.d.ts.map +1 -0
  204. package/dist/i18n/generated-english/{DateTimeInput/NativeTimeSegment.generated.js → Table/plugins/infiniteScroll/useTableInfiniteScroll.generated.js} +2 -2
  205. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  206. package/dist/i18n/generated-locales/en.generated.js +32 -0
  207. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  208. package/dist/i18n/generated-locales/pseudo.generated.js +32 -0
  209. package/dist/internal/touch.d.ts +1 -1
  210. package/dist/internal/touch.d.ts.map +1 -1
  211. package/dist/internal/touch.js +1 -1
  212. package/dist/motion/animator.d.ts +28 -1
  213. package/dist/motion/animator.d.ts.map +1 -1
  214. package/dist/motion/animator.js +99 -19
  215. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  216. package/dist/theme/generateThemeRules.js +14 -3
  217. package/dist/theme/tokenReferences.d.ts +7 -15
  218. package/dist/theme/tokenReferences.d.ts.map +1 -1
  219. package/dist/theme/tokenReferences.js +49 -7
  220. package/dist/utils/clickGuard.d.ts +8 -1
  221. package/dist/utils/clickGuard.d.ts.map +1 -1
  222. package/dist/utils/clickGuard.js +27 -4
  223. package/dist/utils/sharedResizeObserver.d.ts +18 -2
  224. package/dist/utils/sharedResizeObserver.d.ts.map +1 -1
  225. package/dist/utils/sharedResizeObserver.js +43 -2
  226. package/dist/utils/themeProps.d.ts +8 -0
  227. package/dist/utils/themeProps.d.ts.map +1 -1
  228. package/dist/utils/themeProps.js +17 -0
  229. package/dist/utils/timeFormat.d.ts +9 -1
  230. package/dist/utils/timeFormat.d.ts.map +1 -1
  231. package/dist/utils/timeFormat.js +46 -6
  232. package/dist/utils/timeParser.d.ts +3 -1
  233. package/dist/utils/timeParser.d.ts.map +1 -1
  234. package/dist/utils/timeParser.js +7 -3
  235. package/dist/utils/touchEndMark.d.ts +7 -0
  236. package/dist/utils/touchEndMark.d.ts.map +1 -0
  237. package/dist/utils/touchEndMark.js +33 -0
  238. package/dist/virtualization/listWindow.d.ts +28 -2
  239. package/dist/virtualization/listWindow.d.ts.map +1 -1
  240. package/dist/virtualization/listWindow.js +71 -3
  241. package/dist/virtualization/useInlineListWindow.d.ts +64 -0
  242. package/dist/virtualization/useInlineListWindow.d.ts.map +1 -0
  243. package/dist/virtualization/useInlineListWindow.js +135 -0
  244. package/dist/virtualization/useListFocusIsland.d.ts +28 -0
  245. package/dist/virtualization/useListFocusIsland.d.ts.map +1 -0
  246. package/dist/virtualization/useListFocusIsland.js +53 -0
  247. package/dist/virtualization/useListWindow.d.ts +6 -4
  248. package/dist/virtualization/useListWindow.d.ts.map +1 -1
  249. package/dist/virtualization/useListWindow.js +17 -29
  250. package/locales/en.json +131 -3
  251. package/locales/pseudo.json +96 -0
  252. package/package.json +5 -5
  253. package/src/AppShell/AppShell.tsx +12 -3
  254. package/src/AppShell/useCloseMobileDrawerOnActivate.ts +19 -2
  255. package/src/BottomSheet/BottomSheet.tsx +12 -8
  256. package/src/BottomSheet/BottomSheetPanel.tsx +53 -40
  257. package/src/BottomSheet/useSheetGestures.ts +18 -18
  258. package/src/ButtonGroup/ButtonGroup.doc.mjs +5 -0
  259. package/src/Chat/ChatComposerInput.tsx +4 -0
  260. package/src/CheckboxInput/CheckboxInput.doc.mjs +3 -0
  261. package/src/DateInput/DateInput.doc.mjs +21 -3
  262. package/src/DateInput/DateInput.tsx +61 -7
  263. package/src/DateInput/NativeDateField.tsx +58 -36
  264. package/src/DateInput/index.ts +1 -0
  265. package/src/DateInput/useTypedDate.ts +293 -196
  266. package/src/DateTimeInput/DateTimeInput.doc.mjs +21 -3
  267. package/src/DateTimeInput/DateTimeInput.tsx +158 -86
  268. package/src/DateTimeInput/NativeDateSegment.tsx +35 -13
  269. package/src/DateTimeInput/NativeTimeSegment.tsx +45 -22
  270. package/src/DateTimeInput/index.ts +1 -0
  271. package/src/DropdownMenu/DropdownMenu.tsx +10 -3
  272. package/src/Field/InputClearButton.tsx +3 -1
  273. package/src/Field/useEntryErrorBehavior.ts +34 -0
  274. package/src/Field/useEntryErrorReport.ts +210 -0
  275. package/src/Field/useValueReplacesEntry.ts +44 -0
  276. package/src/FormLayout/FormLayout.doc.mjs +14 -0
  277. package/src/FormLayout/FormLayout.tsx +24 -2
  278. package/src/FormLayout/FormLayoutContext.ts +24 -4
  279. package/src/FormLayout/index.ts +5 -1
  280. package/src/InfoTip/InfoTip.doc.mjs +2 -2
  281. package/src/InfoTip/InfoTip.tsx +3 -0
  282. package/src/Layer/gestureCounter.ts +136 -4
  283. package/src/Layer/layerAnimations.stylex.ts +13 -9
  284. package/src/Layer/layerEntranceSide.ts +48 -11
  285. package/src/Layer/useLayer.tsx +89 -15
  286. package/src/Layer/useTouchTrigger.ts +21 -21
  287. package/src/Lightbox/Lightbox.doc.mjs +2 -1
  288. package/src/Lightbox/Lightbox.tsx +864 -257
  289. package/src/List/ListItem.tsx +3 -2
  290. package/src/List/ListReorderHandle.tsx +59 -77
  291. package/src/List/listReorderContext.ts +3 -4
  292. package/src/List/listReorderEngine.tsx +246 -11
  293. package/src/Markdown/plugins/textTransform.ts +46 -12
  294. package/src/MoreMenu/MoreMenu.doc.mjs +2 -2
  295. package/src/MoreMenu/MoreMenu.tsx +3 -0
  296. package/src/NumberInput/NumberInput.doc.mjs +29 -6
  297. package/src/NumberInput/NumberInput.tsx +224 -52
  298. package/src/NumberInput/index.ts +2 -1
  299. package/src/NumberInput/numberInputCommit.ts +57 -13
  300. package/src/Pagination/Pagination.tsx +14 -4
  301. package/src/Popover/usePopover.tsx +30 -22
  302. package/src/PowerSearch/PowerSearch.doc.mjs +2 -2
  303. package/src/PowerSearch/PowerSearch.tsx +7 -3
  304. package/src/PowerSearch/PowerSearchEditPopover.tsx +12 -2
  305. package/src/PowerSearch/PowerSearchFilterEditor.tsx +3 -0
  306. package/src/PowerSearch/PowerSearchToken.tsx +3 -0
  307. package/src/PowerSearch/PowerSearchValueEditor.tsx +4 -0
  308. package/src/ProgressBar/ProgressBar.doc.mjs +3 -0
  309. package/src/SegmentedControl/SegmentedControl.doc.mjs +5 -0
  310. package/src/Selector/useSelectorPresentation.ts +16 -12
  311. package/src/Slider/Slider.tsx +6 -8
  312. package/src/StatusDot/StatusDot.doc.mjs +3 -0
  313. package/src/Switch/Switch.doc.mjs +3 -0
  314. package/src/TabList/TabList.doc.mjs +4 -0
  315. package/src/Table/BaseTable.tsx +440 -289
  316. package/src/Table/Table.doc.mjs +2 -2
  317. package/src/Table/Table.tsx +5 -1
  318. package/src/Table/index.ts +8 -1
  319. package/src/Table/plugins/filtering/useTableFiltering.tsx +2 -0
  320. package/src/Table/plugins/infiniteScroll/index.ts +10 -0
  321. package/src/Table/plugins/infiniteScroll/useTableInfiniteScroll.tsx +523 -0
  322. package/src/Table/plugins/sortable/useTableSortableState.tsx +4 -4
  323. package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +31 -1
  324. package/src/Table/plugins/virtualization/TableColumnWindow.tsx +160 -0
  325. package/src/Table/plugins/virtualization/index.ts +3 -1
  326. package/src/Table/plugins/virtualization/useTableColumnWindow.ts +284 -0
  327. package/src/Table/plugins/virtualization/useTableColumnsVirtualization.ts +53 -0
  328. package/src/Table/plugins/virtualization/useTableWindow.ts +49 -17
  329. package/src/Table/tableColumnWindowing.ts +181 -0
  330. package/src/Table/tablePinnedColumnRuns.ts +55 -0
  331. package/src/Table/tableRuntime.ts +44 -11
  332. package/src/Table/types.ts +25 -2
  333. package/src/Table/useBaseTablePlugins.ts +2 -2
  334. package/src/Table/useTableColumnsVirtualization.doc.mjs +29 -0
  335. package/src/Table/useTableInfiniteScroll.doc.mjs +58 -0
  336. package/src/Text/Heading.doc.mjs +3 -0
  337. package/src/Text/useTruncation.doc.mjs +10 -0
  338. package/src/Text/useTruncation.ts +53 -35
  339. package/src/TextArea/TextArea.doc.mjs +15 -0
  340. package/src/TextArea/TextArea.tsx +11 -0
  341. package/src/TextInput/TextInput.doc.mjs +3 -0
  342. package/src/TimeInput/TimeInput.doc.mjs +38 -4
  343. package/src/TimeInput/TimeInput.tsx +176 -99
  344. package/src/TimeInput/index.ts +2 -0
  345. package/src/TimeInput/useTypedTime.ts +341 -0
  346. package/src/Toast/Toast.doc.mjs +2 -2
  347. package/src/Toast/Toast.tsx +3 -1
  348. package/src/Tooltip/useTooltip.tsx +147 -136
  349. package/src/TopNav/TopNav.doc.mjs +4 -0
  350. package/src/dragToSnapPoints/createDragToSnapPoints.ts +437 -119
  351. package/src/gestures/createPanGesture.ts +112 -39
  352. package/src/hooks/useMenuPress.ts +39 -0
  353. package/src/i18n/generated-english/DateInput/NativeDateField.generated.ts +0 -1
  354. package/src/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.ts +0 -1
  355. package/src/i18n/generated-english/Lightbox/Lightbox.generated.ts +2 -0
  356. package/src/i18n/generated-english/{DateTimeInput/NativeTimeSegment.generated.ts → Table/plugins/infiniteScroll/useTableInfiniteScroll.generated.ts} +2 -2
  357. package/src/i18n/generated-locales/en.generated.ts +34 -0
  358. package/src/i18n/generated-locales/pseudo.generated.ts +34 -0
  359. package/src/internal/touch.ts +5 -1
  360. package/src/motion/animator.ts +181 -23
  361. package/src/theme/generateThemeRules.ts +14 -3
  362. package/src/theme/tokenReferences.ts +48 -7
  363. package/src/utils/clickGuard.ts +33 -3
  364. package/src/utils/sharedResizeObserver.ts +46 -2
  365. package/src/utils/themeProps.ts +17 -0
  366. package/src/utils/timeFormat.ts +55 -10
  367. package/src/utils/timeParser.ts +7 -9
  368. package/src/utils/touchEndMark.ts +33 -0
  369. package/src/virtualization/listWindow.ts +105 -3
  370. package/src/virtualization/useInlineListWindow.ts +261 -0
  371. package/src/virtualization/useListFocusIsland.ts +87 -0
  372. package/src/virtualization/useListWindow.ts +14 -51
  373. package/dist/i18n/generated-english/DateTimeInput/NativeTimeSegment.generated.d.ts.map +0 -1
@@ -5,14 +5,20 @@
5
5
  /**
6
6
  * @file useTypedDate.ts
7
7
  * @input Provider locale and calendar, a field's format, bounds and constraints;
8
- * calendarDateParser, and parseDateInput for other Gregorian text
8
+ * calendarDateParser, parseDateInput for other Gregorian text,
9
+ * Field/useEntryErrorReport for the rejection status, alert and report,
10
+ * Field/useValueReplacesEntry for when a new value replaces a kept entry, and
11
+ * the field's resolved entry error behavior
9
12
  * @output Typed-date reading, committed text, the format hint, the calendar
10
13
  * description and rejection messages for a date text field, the typed
11
- * entry state that DateInput and DateTimeInput share, and the
12
- * DateInputEntryError that the field reports to its caller
14
+ * entry state that DateInput and DateTimeInput share, the
15
+ * DateInputEntryError that the field reports to its caller, and the
16
+ * rejection state of a native date control
13
17
  * @position DateInput helper hook; used by DateInput and DateTimeInput
14
18
  */
15
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
19
+ import { useCallback, useMemo, useState } from 'react';
20
+ import { useEntryErrorReport } from "../Field/useEntryErrorReport.js";
21
+ import { useValueReplacesEntry } from "../Field/useValueReplacesEntry.js";
16
22
  import { useLocale } from "../i18n/useLocale.js";
17
23
  import { useCalendarSystem } from "../i18n/useCalendarSystem.js";
18
24
  import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
@@ -30,29 +36,35 @@ registerEnglishFallback(english);
30
36
  * through `onEntryErrorChange`, so the app can word its own message.
31
37
  */
32
38
 
33
- function isSameEntryError(a, b) {
34
- return a === b || a != null && b != null && a.kind === b.kind && a.text === b.text && a.date === b.date;
35
- }
36
39
  function isOutsideBounds(date, min, max) {
37
40
  return min != null && plainDateIsBefore(date, plainDateFromISO(min)) || max != null && plainDateIsAfter(date, plainDateFromISO(max));
38
41
  }
39
- /** The rejection a result shows: errors of complete text, or of committed text. */
40
- export function typedDateError(result, isCommitted) {
42
+ /**
43
+ * The rejection a result shows: the error of text that Enter or blur
44
+ * committed, or, under `'complete'`, of a complete date. Text that is not a
45
+ * date is never complete, so its error waits for the commit.
46
+ */
47
+ export function typedDateError(result, isCommitted, entryErrorBehavior) {
41
48
  if (result == null) {
42
49
  return null;
43
50
  }
44
- if (result.kind === 'unreadable' || result.kind === 'incomplete' && isCommitted) {
51
+ if ((result.kind === 'unreadable' || result.kind === 'incomplete') && isCommitted) {
45
52
  return 'unreadable';
46
53
  }
47
- if ((result.kind === 'nonexistent' || result.kind === 'outOfRange') && (result.isComplete || isCommitted)) {
54
+ if ((result.kind === 'nonexistent' || result.kind === 'outOfRange') && (isCommitted || result.isComplete && entryErrorBehavior === 'complete')) {
48
55
  return result.kind;
49
56
  }
50
57
  return null;
51
58
  }
52
59
 
60
+ /** Whether a result is a date that typing commits, which ends a rejection. */
61
+ function isAcceptedDate(result) {
62
+ return result.kind === 'value' && result.isComplete;
63
+ }
64
+
53
65
  /** The rejection a result shows, as the field reports it to its caller. */
54
- function dateEntryError(result, isCommitted, text, min, max) {
55
- const error = typedDateError(result, isCommitted);
66
+ function dateEntryError(result, isCommitted, text, min, max, entryErrorBehavior) {
67
+ const error = typedDateError(result, isCommitted, entryErrorBehavior);
56
68
  if (error == null || result == null) {
57
69
  return null;
58
70
  }
@@ -180,6 +192,7 @@ export function useTypedDateField({
180
192
  isStatusAnnounced,
181
193
  onEntryErrorChange,
182
194
  hasPlaceholder,
195
+ entryErrorBehavior,
183
196
  ...options
184
197
  }) {
185
198
  const typedDate = useTypedDate(options);
@@ -187,6 +200,11 @@ export function useTypedDateField({
187
200
  const [pendingInput, setPendingInput] = useState(null);
188
201
  // Set when Enter or blur keeps rejected text so the person can correct it.
189
202
  const [isRejectionCommitted, setIsRejectionCommitted] = useState(false);
203
+ // Counts each Enter or blur that keeps rejected text.
204
+ const [keptCommits, setKeptCommits] = useState(0);
205
+ // Rejected text whose rejection stays shown while an edit leaves the entry
206
+ // rejected or unfinished.
207
+ const [keptText, setKeptText] = useState(null);
190
208
  const [isFocused, setIsFocused] = useState(false);
191
209
  // The date that typing last reported, so one typing session reports each
192
210
  // date once. Only the handlers write it. A value from outside and a
@@ -199,130 +217,58 @@ export function useTypedDateField({
199
217
  const [firedEpoch, setFiredEpoch] = useState(0);
200
218
  const lastFiredDate = lastFired.epoch === firedEpoch ? lastFired.date : undefined;
201
219
  const typedResult = pendingInput !== null && pendingInput.trim() ? typedDate.parse(pendingInput) : null;
202
- // A locked field hides the rejection but keeps its state, so the rejection
203
- // shows again once the field is editable.
204
- const typedError = isDisabled ? null : typedDateError(typedResult, isRejectionCommitted);
205
- const errorMessage = typedError != null && typedResult != null ? typedDate.errorMessage(typedResult) : null;
206
- // Text that stays in the field shows its reason as well as announcing it.
207
- const isErrorShown = typedError === 'nonexistent' || typedError === 'outOfRange' || typedError === 'unreadable' && isRejectionCommitted;
208
- const typedStatus = isErrorShown && errorMessage != null ? {
209
- type: 'error',
210
- message: errorMessage
211
- } : undefined;
212
- const entryError = isDisabled ? null : dateEntryError(typedResult, isRejectionCommitted, pendingInput ?? '', options.min, options.max);
213
-
214
- // The rejection that the caller last received. Handlers report a rejection
215
- // that they cause in the same update. A rejection that a prop change causes
216
- // reaches the caller only after the render. Until then the field keeps the
217
- // caller's status, so it never shows and announces its own message just
218
- // before the caller's message replaces it.
219
- const [heardEntryError, setHeardEntryError] = useState(null);
220
- const reportedEntryErrorRef = useRef(null);
221
- // The callback of the latest commit, for the report at unmount.
222
- const latestEntryErrorCallbackRef = useRef(onEntryErrorChange);
223
- const hasEntryErrorCallback = onEntryErrorChange != null;
224
- const isCallerBehind = hasEntryErrorCallback && !isSameEntryError(entryError, heardEntryError);
225
- // A caller that receives rejections words them: its error message replaces
226
- // the field's own message. A warning or a success never hides a rejection.
227
- const callerErrorMessage = hasEntryErrorCallback && status?.type === 'error' && status.message ? status.message : null;
228
- const fieldStatus = isCallerBehind || callerErrorMessage != null ? status : typedStatus ?? status;
229
-
230
- // Field announces its status when the status appears or changes. A
231
- // rejection that starts under the caller's error message changes no status,
232
- // so the field's alert announces that message once for it. This record
233
- // holds the error message that the status showed while no rejection stood.
234
- // A change of the shown message during the rejection ends the repeat,
235
- // because Field announces that change.
236
- const shownErrorMessage = fieldStatus?.type === 'error' ? fieldStatus.message ?? null : null;
237
- const [statusRecord, setStatusRecord] = useState({
238
- message: shownErrorMessage,
239
- isRepeatable: true
220
+ const ownError = typedDateError(typedResult, isRejectionCommitted, entryErrorBehavior);
221
+ const keptResult = ownError == null && keptText !== null && typedResult != null && !isAcceptedDate(typedResult) ? typedDate.parse(keptText) : null;
222
+ // The rejection the field shows. A locked field hides it but keeps its
223
+ // state, so the rejection shows again once the field is editable.
224
+ const shown = isDisabled ? null : ownError != null && typedResult != null && pendingInput !== null ? {
225
+ text: pendingInput,
226
+ result: typedResult
227
+ } : keptResult != null && keptText !== null && typedDateError(keptResult, true, entryErrorBehavior) != null ? {
228
+ text: keptText,
229
+ result: keptResult
230
+ } : null;
231
+ const errorMessage = shown != null ? typedDate.errorMessage(shown.result) : null;
232
+ const entryError = shown != null ? dateEntryError(shown.result, true, shown.text, options.min, options.max, entryErrorBehavior) : null;
233
+ const shownText = shown?.text ?? null;
234
+ // Unreadable text that Enter or blur kept: the form posts the committed
235
+ // date, as it does where the text gives way to it.
236
+ const isKeptUnreadable = isRejectionCommitted && typedResult?.kind === 'unreadable';
237
+ const {
238
+ fieldStatus,
239
+ alertMessage,
240
+ reportEntryError
241
+ } = useEntryErrorReport({
242
+ entryError,
243
+ rejectionMessage: errorMessage,
244
+ status,
245
+ isStatusAnnounced,
246
+ callerErrorPrecedence: 'withCallback',
247
+ onEntryErrorChange
240
248
  });
241
- // The alert and the status change in the same render.
242
- const statusRecordInput = `${entryError != null}:${shownErrorMessage}`;
243
- const prevStatusRecordInputRef = useRef(statusRecordInput);
244
- if (hasEntryErrorCallback && statusRecordInput !== prevStatusRecordInputRef.current) {
245
- prevStatusRecordInputRef.current = statusRecordInput;
246
- if (entryError == null) {
247
- if (statusRecord.message !== shownErrorMessage || !statusRecord.isRepeatable) {
248
- setStatusRecord({
249
- message: shownErrorMessage,
250
- isRepeatable: true
251
- });
252
- }
253
- } else if (statusRecord.isRepeatable && statusRecord.message !== shownErrorMessage) {
254
- setStatusRecord({
255
- message: statusRecord.message,
256
- isRepeatable: false
257
- });
258
- }
259
- }
260
- let alertMessage = '';
261
- if (errorMessage != null && !isCallerBehind) {
262
- if (callerErrorMessage != null) {
263
- const isStatusRepeated = statusRecord.isRepeatable && statusRecord.message === callerErrorMessage;
264
- // Inside an InputGroup no Field announces the caller's status.
265
- alertMessage = !isStatusAnnounced || isStatusRepeated ? callerErrorMessage : '';
266
- } else {
267
- alertMessage = isStatusAnnounced && typedStatus != null ? '' : errorMessage;
268
- }
269
- }
270
- const reportEntryError = useCallback(error => {
271
- if (onEntryErrorChange == null) {
272
- return;
273
- }
274
- setHeardEntryError(error);
275
- if (!isSameEntryError(error, reportedEntryErrorRef.current)) {
276
- reportedEntryErrorRef.current = error;
277
- onEntryErrorChange(error);
278
- }
279
- }, [onEntryErrorChange]);
280
-
281
- // Syncs the caller's entry error with a rejection that a new `min`, `max`,
282
- // `dateConstraints`, `value`, or disabled state starts, changes, or ends.
283
- useEffect(() => {
284
- latestEntryErrorCallbackRef.current = onEntryErrorChange;
285
- if (onEntryErrorChange == null) {
286
- return;
287
- }
288
- if (!isSameEntryError(entryError, reportedEntryErrorRef.current)) {
289
- reportedEntryErrorRef.current = entryError;
290
- // Called through the ref: the set-state-in-effect rule takes a call to a
291
- // hook parameter for the whole hook's body.
292
- latestEntryErrorCallbackRef.current?.(entryError);
293
- }
294
- if (!isSameEntryError(entryError, heardEntryError)) {
295
- // eslint-disable-next-line @eslint-react/set-state-in-effect -- shows the field's own message once the caller has the rejection
296
- setHeardEntryError(entryError);
297
- }
298
- }, [entryError, heardEntryError, onEntryErrorChange]);
299
-
300
- // Syncs the caller's entry error at unmount. A presentation or pointer
301
- // change can replace the field while its reported rejection stands, and
302
- // the rejection ends with the field.
303
- useEffect(() => () => {
304
- if (reportedEntryErrorRef.current != null) {
305
- reportedEntryErrorRef.current = null;
306
- latestEntryErrorCallbackRef.current?.(null);
307
- }
308
- }, []);
309
249
  const reset = useCallback(() => {
310
250
  setPendingInput(null);
311
251
  setIsRejectionCommitted(false);
252
+ setKeptText(null);
312
253
  reportEntryError(null);
313
254
  }, [reportEntryError]);
314
255
 
315
- // A value from outside drops typed text. Adjusted during render, so it
316
- // takes no extra commit; state, so a render React discards takes its
317
- // adjustment with it.
256
+ // A new value drops typed text. A value that arrives with an Enter or blur
257
+ // that keeps rejected text does not drop it. A caller can restore its own
258
+ // value there.
259
+ const isEntryReplaced = useValueReplacesEntry(value, keptCommits);
260
+ // A value from outside also retires the date that typing last reported, so
261
+ // a retyped date reports again. Adjusted during render, so it takes no extra
262
+ // commit; state, so a render React discards takes its adjustment with it.
318
263
  const [prevValue, setPrevValue] = useState(value);
319
264
  if (value !== prevValue) {
320
265
  setPrevValue(value);
321
266
  if (value !== lastFiredDate) {
322
267
  setFiredEpoch(epoch => epoch + 1);
323
- if (pendingInput !== null) {
268
+ if (pendingInput !== null && isEntryReplaced) {
324
269
  setPendingInput(null);
325
270
  setIsRejectionCommitted(false);
271
+ setKeptText(null);
326
272
  }
327
273
  }
328
274
  }
@@ -337,6 +283,7 @@ export function useTypedDateField({
337
283
  setFiredEpoch(epoch => epoch + 1);
338
284
  setPendingInput(null);
339
285
  setIsRejectionCommitted(false);
286
+ setKeptText(null);
340
287
  }
341
288
  }
342
289
  const report = useCallback(date => {
@@ -354,18 +301,24 @@ export function useTypedDateField({
354
301
  if (isDisabled) {
355
302
  return;
356
303
  }
357
- setPendingInput(text);
358
- setIsRejectionCommitted(false);
359
304
  // Report a date only once more typing cannot change it.
360
305
  const result = typedDate.parse(text);
361
- reportEntryError(dateEntryError(text.trim() ? result : null, false, text, options.min, options.max));
306
+ const isEmpty = !text.trim();
307
+ const error = isEmpty ? null : dateEntryError(result, false, text, options.min, options.max, entryErrorBehavior);
308
+ // An edit that leaves the entry rejected or unfinished keeps the shown
309
+ // rejection.
310
+ const nextKeptText = error != null || isEmpty || isAcceptedDate(result) ? null : shownText;
311
+ setPendingInput(text);
312
+ setIsRejectionCommitted(false);
313
+ setKeptText(nextKeptText);
314
+ reportEntryError(error ?? (nextKeptText !== null ? entryError : null));
362
315
  if (result.kind === 'value' && result.isComplete) {
363
316
  const date = plainDateToISO(result.date);
364
317
  if (report(date)) {
365
318
  onTypedDate?.(date);
366
319
  }
367
320
  }
368
- }, [isDisabled, typedDate, reportEntryError, options.min, options.max, report, onTypedDate]);
321
+ }, [isDisabled, typedDate, shownText, entryError, reportEntryError, options.min, options.max, entryErrorBehavior, report, onTypedDate]);
369
322
  const commit = useCallback(() => {
370
323
  if (pendingInput === null || isDisabled) {
371
324
  return;
@@ -376,11 +329,13 @@ export function useTypedDateField({
376
329
  return;
377
330
  }
378
331
  const result = typedDate.parse(pendingInput);
379
- if (result.kind === 'incomplete' || result.kind === 'nonexistent' || result.kind === 'outOfRange') {
332
+ if (result.kind === 'unreadable' || result.kind === 'incomplete' || result.kind === 'nonexistent' || result.kind === 'outOfRange') {
380
333
  // Keep the text and show why it cannot commit; never finish or adjust
381
334
  // the date.
382
335
  setIsRejectionCommitted(true);
383
- reportEntryError(dateEntryError(result, true, pendingInput, options.min, options.max));
336
+ setKeptCommits(count => count + 1);
337
+ setKeptText(null);
338
+ reportEntryError(dateEntryError(result, true, pendingInput, options.min, options.max, entryErrorBehavior));
384
339
  return;
385
340
  }
386
341
  if (result.kind === 'value') {
@@ -392,7 +347,7 @@ export function useTypedDateField({
392
347
  epoch: firedEpoch
393
348
  });
394
349
  reset();
395
- }, [pendingInput, isDisabled, onClear, typedDate, reportEntryError, options.min, options.max, report, reset, firedEpoch]);
350
+ }, [pendingInput, isDisabled, onClear, typedDate, reportEntryError, options.min, options.max, entryErrorBehavior, report, reset, firedEpoch]);
396
351
  const handleFocus = useCallback(() => {
397
352
  setIsFocused(true);
398
353
  typedDate.prepare();
@@ -401,13 +356,15 @@ export function useTypedDateField({
401
356
  setIsFocused(false);
402
357
  commit();
403
358
  }, [commit]);
404
- const displayValue = pendingInput !== null ? pendingInput : shownValue != null && /^\d{4}-\d{2}-\d{2}$/.test(shownValue) ? typedDate.formatCommitted(shownValue) : '';
359
+ const committedText = shownValue != null && /^\d{4}-\d{2}-\d{2}$/.test(shownValue) ? typedDate.formatCommitted(shownValue) : '';
360
+ const displayValue = pendingInput ?? committedText;
405
361
  return {
406
362
  typedDate,
407
363
  displayValue,
408
364
  formatHint: !hasPlaceholder && isFocused && !displayValue ? typedDate.getFormatHint() : null,
409
- isPending: pendingInput !== null,
410
- isInvalid: typedError != null,
365
+ isPending: pendingInput !== null && !isKeptUnreadable,
366
+ hiddenFormValue: isKeptUnreadable ? committedText : null,
367
+ isInvalid: shown != null,
411
368
  fieldStatus,
412
369
  alertMessage,
413
370
  handleChange,
@@ -416,4 +373,102 @@ export function useTypedDateField({
416
373
  handleBlur,
417
374
  reset
418
375
  };
376
+ }
377
+ const NO_REFUSAL = {
378
+ held: null,
379
+ shown: null
380
+ };
381
+
382
+ /**
383
+ * The rejection of a native date control. While a person types the year, the
384
+ * control reports each partial year as a date, so a refused date waits for
385
+ * Enter or blur. The rejection then stays after the control restores the
386
+ * committed date, until the control reports a date the field accepts or
387
+ * nothing.
388
+ */
389
+ export function useNativeDateRejection({
390
+ value,
391
+ isLocked,
392
+ status,
393
+ hasEntryErrorCallback,
394
+ isStatusAnnounced,
395
+ ...options
396
+ }) {
397
+ const typedDate = useTypedDate({
398
+ ...options,
399
+ calendar: 'gregory'
400
+ });
401
+ const [refusal, setRefusal] = useState(NO_REFUSAL);
402
+ // Counts each Enter or blur, which shows a refused date that stands.
403
+ const [commits, setCommits] = useState(0);
404
+ // A new value ends the rejection. A value that arrives with an Enter or blur
405
+ // that shows the rejection does not end it. A caller can restore its own
406
+ // value there.
407
+ const isRefusalReplaced = useValueReplacesEntry(value, commits);
408
+ if (isRefusalReplaced && refusal !== NO_REFUSAL) {
409
+ setRefusal(NO_REFUSAL);
410
+ }
411
+ const refuse = useCallback(date => {
412
+ const held = plainDateToISO(date);
413
+ setRefusal(prev => prev.held === held ? prev : {
414
+ ...prev,
415
+ held
416
+ });
417
+ }, []);
418
+ const clear = useCallback(() => setRefusal(NO_REFUSAL), []);
419
+ const commit = useCallback(() => {
420
+ if (!isLocked) {
421
+ setCommits(count => count + 1);
422
+ setRefusal(prev => prev.held === null ? prev : {
423
+ held: null,
424
+ shown: prev.held
425
+ });
426
+ }
427
+ }, [isLocked]);
428
+ const message = !isLocked && refusal.shown !== null ? typedDate.errorMessage({
429
+ kind: 'outOfRange',
430
+ date: plainDateFromISO(refusal.shown),
431
+ isComplete: true
432
+ }) : null;
433
+ const callerErrorMessage = hasEntryErrorCallback && status?.type === 'error' && status.message ? status.message : null;
434
+
435
+ // A rejection that starts under the caller's error message changes no
436
+ // status, so the alert announces that message once. A later change of the
437
+ // caller's message ends the repeat, because Field announces the change.
438
+ const isRejected = message != null;
439
+ const [repeat, setRepeat] = useState({
440
+ isRejected: false,
441
+ message: null
442
+ });
443
+ if (repeat.isRejected !== isRejected) {
444
+ setRepeat({
445
+ isRejected,
446
+ message: isRejected ? callerErrorMessage : null
447
+ });
448
+ } else if (repeat.message !== null && repeat.message !== callerErrorMessage) {
449
+ setRepeat({
450
+ isRejected,
451
+ message: null
452
+ });
453
+ }
454
+ let alertMessage = '';
455
+ if (message != null) {
456
+ if (!isStatusAnnounced) {
457
+ alertMessage = callerErrorMessage ?? message;
458
+ } else if (callerErrorMessage != null && callerErrorMessage === repeat.message) {
459
+ alertMessage = callerErrorMessage;
460
+ }
461
+ }
462
+ return {
463
+ message,
464
+ fieldStatus: message != null && callerErrorMessage == null ? {
465
+ type: 'error',
466
+ message
467
+ } : status,
468
+ alertMessage,
469
+ isRefused: refusal !== NO_REFUSAL,
470
+ refuse,
471
+ clear,
472
+ commit
473
+ };
419
474
  }
@@ -1,3 +1,4 @@
1
+ import type { EntryErrorBehavior } from '../FormLayout/FormLayoutContext.js';
1
2
  import { type InputStatus } from '../Field/index.js';
2
3
  import { type DayOfWeek, type DayOfWeekName } from '../Calendar/index.js';
3
4
  import type { CalendarSystem } from '../utils/calendarSystem.js';
@@ -6,6 +7,7 @@ import { type FieldInputBaseProps } from '../Field/fieldParts.js';
6
7
  import type { SizeValue } from '../utils/types.js';
7
8
  import { type PickerPresentation } from '../utils/inputPresentation.js';
8
9
  export type { DateInputEntryError } from '../DateInput/useTypedDate.js';
10
+ export type { EntryErrorBehavior } from '../FormLayout/FormLayoutContext.js';
9
11
  export type ISODateTimeString = string & {
10
12
  readonly __brand: 'ISODateTimeString';
11
13
  };
@@ -192,12 +194,16 @@ export interface DateTimeInputProps extends Omit<FieldInputBaseProps<HTMLInputEl
192
194
  /**
193
195
  * Status indicator for the input.
194
196
  *
195
- * For a typed date the date segment rejects, and for unfinished date text
196
- * that Enter or blur keeps, the field shows its own error message in place
197
- * of `status`. Unreadable date text is announced, not shown. With
197
+ * For a date the date segment rejects, typed or picked in the native
198
+ * control, and for unreadable or unfinished date text that Enter or blur
199
+ * keeps, the field shows its own error message in place of `status`. With
198
200
  * `onEntryErrorChange`, an `error` status with a message shows instead, and
199
201
  * the field's own message applies only without one. A `warning` or
200
202
  * `success` status never replaces a rejection.
203
+ *
204
+ * A typed time the time segment rejects shows its own error message once
205
+ * the time is complete, or at Enter or blur, unless the date segment holds
206
+ * a rejection or an `error` status with a message shows in its place.
201
207
  */
202
208
  status?: InputStatus;
203
209
  /**
@@ -219,6 +225,29 @@ export interface DateTimeInputProps extends Omit<FieldInputBaseProps<HTMLInputEl
219
225
  * native and touch pickers take no typed text, so they report no rejection.
220
226
  */
221
227
  onEntryErrorChange?: (error: DateInputEntryError | null) => void;
228
+ /**
229
+ * When both segments show their own entry errors: a typed date or time that
230
+ * the field rejects. It sets when the error shows, not when validation
231
+ * runs, so it is not React Aria's `validationBehavior` (native versus ARIA
232
+ * validation). It does not change a caller's `status`.
233
+ *
234
+ * - `'complete'` — a complete typed date the calendar does not have or that
235
+ * is out of range, and a complete typed time outside the range, show at
236
+ * once. A time the native control reports outside the range shows at
237
+ * once. Other rejected text shows at Enter or blur.
238
+ * - `'blur-or-enter'` — every rejection waits for Enter or blur in its
239
+ * segment. The message, `aria-invalid`, the invalid styling, the
240
+ * announcement, and the date segment's `onEntryErrorChange` report then
241
+ * appear together. An edit that the field accepts or that empties the
242
+ * segment clears the error at once. An edit that leaves the entry wrong
243
+ * keeps the shown error until the next Enter or blur.
244
+ *
245
+ * A date that the native control refuses shows at Enter or blur under both
246
+ * values.
247
+ *
248
+ * @default the nearest FormLayout's `defaultEntryErrorBehavior`, else `'complete'`
249
+ */
250
+ entryErrorBehavior?: EntryErrorBehavior;
222
251
  /**
223
252
  * Width of the field. Numbers are treated as pixels, strings are used as-is
224
253
  * (e.g. `'100%'`). Sizes the whole field (label, control, and status) so they
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AA6CA,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAyBrB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CA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