@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.
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +8 -2
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +2 -1
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -1
- package/dist/AppShell/useCloseMobileDrawerOnActivate.js +15 -2
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +11 -6
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +52 -35
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +4 -7
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +1 -1
- package/dist/DateInput/DateInput.d.ts +27 -3
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +24 -6
- package/dist/DateInput/NativeDateField.d.ts +1 -1
- package/dist/DateInput/NativeDateField.d.ts.map +1 -1
- package/dist/DateInput/NativeDateField.js +48 -31
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.d.ts +75 -8
- package/dist/DateInput/useTypedDate.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.js +188 -133
- package/dist/DateTimeInput/DateTimeInput.d.ts +32 -3
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +99 -62
- package/dist/DateTimeInput/NativeDateSegment.d.ts +8 -1
- package/dist/DateTimeInput/NativeDateSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeDateSegment.js +20 -14
- package/dist/DateTimeInput/NativeTimeSegment.d.ts +13 -1
- package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeTimeSegment.js +21 -18
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +10 -3
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +4 -2
- package/dist/Field/useEntryErrorBehavior.d.ts +8 -0
- package/dist/Field/useEntryErrorBehavior.d.ts.map +1 -0
- package/dist/Field/useEntryErrorBehavior.js +30 -0
- package/dist/Field/useEntryErrorReport.d.ts +40 -0
- package/dist/Field/useEntryErrorReport.d.ts.map +1 -0
- package/dist/Field/useEntryErrorReport.js +157 -0
- package/dist/Field/useValueReplacesEntry.d.ts +11 -0
- package/dist/Field/useValueReplacesEntry.d.ts.map +1 -0
- package/dist/Field/useValueReplacesEntry.js +46 -0
- package/dist/FormLayout/FormLayout.d.ts +21 -2
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +5 -2
- package/dist/FormLayout/FormLayoutContext.d.ts +18 -2
- package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.js +22 -4
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.d.ts +1 -1
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +4 -1
- package/dist/Layer/gestureCounter.d.ts +14 -0
- package/dist/Layer/gestureCounter.d.ts.map +1 -1
- package/dist/Layer/gestureCounter.js +123 -4
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +17 -13
- package/dist/Layer/layerEntranceSide.d.ts +24 -10
- package/dist/Layer/layerEntranceSide.d.ts.map +1 -1
- package/dist/Layer/layerEntranceSide.js +28 -13
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +76 -15
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +14 -20
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +625 -180
- package/dist/List/ListItem.d.ts +3 -2
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListReorderHandle.d.ts +7 -0
- package/dist/List/ListReorderHandle.d.ts.map +1 -1
- package/dist/List/ListReorderHandle.js +42 -58
- package/dist/List/listReorderContext.d.ts.map +1 -1
- package/dist/List/listReorderContext.js +4 -4
- package/dist/List/listReorderEngine.d.ts +50 -2
- package/dist/List/listReorderEngine.d.ts.map +1 -1
- package/dist/List/listReorderEngine.js +205 -10
- package/dist/Markdown/plugins/textTransform.d.ts.map +1 -1
- package/dist/Markdown/plugins/textTransform.js +31 -10
- package/dist/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +4 -1
- package/dist/NumberInput/NumberInput.d.ts +60 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +141 -40
- package/dist/NumberInput/index.d.ts +2 -2
- package/dist/NumberInput/index.d.ts.map +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput/numberInputCommit.d.ts +18 -1
- package/dist/NumberInput/numberInputCommit.d.ts.map +1 -1
- package/dist/NumberInput/numberInputCommit.js +57 -3
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +12 -3
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +23 -15
- package/dist/PowerSearch/PowerSearch.d.ts +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +8 -4
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +4 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +4 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.js +7 -3
- package/dist/PowerSearch/PowerSearchToken.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +4 -1
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +4 -0
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
- package/dist/Selector/useSelectorPresentation.js +13 -12
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +6 -8
- package/dist/Table/BaseTable.d.ts +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +276 -198
- package/dist/Table/Table.d.ts +5 -1
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/index.d.ts +5 -3
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +2 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +2 -0
- package/dist/Table/plugins/infiniteScroll/TableInfiniteScrollWide.a11y.chromium.spec.d.ts.map +1 -0
- package/dist/Table/plugins/infiniteScroll/index.d.ts +9 -0
- package/dist/Table/plugins/infiniteScroll/index.d.ts.map +1 -0
- package/dist/Table/plugins/infiniteScroll/index.js +9 -0
- package/dist/Table/plugins/infiniteScroll/useTableInfiniteScroll.d.ts +29 -0
- package/dist/Table/plugins/infiniteScroll/useTableInfiniteScroll.d.ts.map +1 -0
- package/dist/Table/plugins/infiniteScroll/useTableInfiniteScroll.js +394 -0
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +4 -4
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +21 -1
- package/dist/Table/plugins/virtualization/TableColumnWindow.d.ts +4 -0
- package/dist/Table/plugins/virtualization/TableColumnWindow.d.ts.map +1 -0
- package/dist/Table/plugins/virtualization/TableColumnWindow.js +114 -0
- package/dist/Table/plugins/virtualization/index.d.ts +3 -1
- package/dist/Table/plugins/virtualization/index.d.ts.map +1 -1
- package/dist/Table/plugins/virtualization/index.js +3 -2
- package/dist/Table/plugins/virtualization/useTableColumnWindow.d.ts +39 -0
- package/dist/Table/plugins/virtualization/useTableColumnWindow.d.ts.map +1 -0
- package/dist/Table/plugins/virtualization/useTableColumnWindow.js +215 -0
- package/dist/Table/plugins/virtualization/useTableColumnsVirtualization.d.ts +23 -0
- package/dist/Table/plugins/virtualization/useTableColumnsVirtualization.d.ts.map +1 -0
- package/dist/Table/plugins/virtualization/useTableColumnsVirtualization.js +37 -0
- package/dist/Table/plugins/virtualization/useTableWindow.d.ts +2 -1
- package/dist/Table/plugins/virtualization/useTableWindow.d.ts.map +1 -1
- package/dist/Table/plugins/virtualization/useTableWindow.js +43 -13
- package/dist/Table/tableColumnWindowing.d.ts +107 -0
- package/dist/Table/tableColumnWindowing.d.ts.map +1 -0
- package/dist/Table/tableColumnWindowing.js +72 -0
- package/dist/Table/tablePinnedColumnRuns.d.ts +23 -0
- package/dist/Table/tablePinnedColumnRuns.d.ts.map +1 -0
- package/dist/Table/tablePinnedColumnRuns.js +41 -0
- package/dist/Table/tableRuntime.d.ts +14 -2
- package/dist/Table/tableRuntime.d.ts.map +1 -1
- package/dist/Table/tableRuntime.js +32 -11
- package/dist/Table/types.d.ts +28 -2
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +2 -2
- package/dist/Text/useTruncation.d.ts +6 -1
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +53 -35
- package/dist/TextArea/TextArea.d.ts +10 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +2 -0
- package/dist/TimeInput/TimeInput.d.ts +61 -0
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +97 -84
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.d.ts.map +1 -1
- package/dist/TimeInput/useTypedTime.d.ts +76 -0
- package/dist/TimeInput/useTypedTime.d.ts.map +1 -0
- package/dist/TimeInput/useTypedTime.js +258 -0
- package/dist/Toast/Toast.d.ts +1 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +4 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +46 -53
- package/dist/astryx.css +22 -11
- package/dist/dragToSnapPoints/createDragToSnapPoints.d.ts +156 -0
- package/dist/dragToSnapPoints/createDragToSnapPoints.d.ts.map +1 -1
- package/dist/dragToSnapPoints/createDragToSnapPoints.js +313 -97
- package/dist/gestures/createPanGesture.d.ts +41 -0
- package/dist/gestures/createPanGesture.d.ts.map +1 -1
- package/dist/gestures/createPanGesture.js +66 -22
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +36 -2
- package/dist/i18n/generated-english/DateInput/NativeDateField.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateInput/NativeDateField.generated.js +0 -1
- package/dist/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.js +0 -1
- package/dist/i18n/generated-english/Lightbox/Lightbox.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Lightbox/Lightbox.generated.js +2 -0
- package/dist/i18n/generated-english/{DateTimeInput/NativeTimeSegment.generated.d.ts → Table/plugins/infiniteScroll/useTableInfiniteScroll.generated.d.ts} +2 -2
- package/dist/i18n/generated-english/Table/plugins/infiniteScroll/useTableInfiniteScroll.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/{DateTimeInput/NativeTimeSegment.generated.js → Table/plugins/infiniteScroll/useTableInfiniteScroll.generated.js} +2 -2
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +32 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +32 -0
- package/dist/internal/touch.d.ts +1 -1
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +1 -1
- package/dist/motion/animator.d.ts +28 -1
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +99 -19
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +14 -3
- package/dist/theme/tokenReferences.d.ts +7 -15
- package/dist/theme/tokenReferences.d.ts.map +1 -1
- package/dist/theme/tokenReferences.js +49 -7
- package/dist/utils/clickGuard.d.ts +8 -1
- package/dist/utils/clickGuard.d.ts.map +1 -1
- package/dist/utils/clickGuard.js +27 -4
- package/dist/utils/sharedResizeObserver.d.ts +18 -2
- package/dist/utils/sharedResizeObserver.d.ts.map +1 -1
- package/dist/utils/sharedResizeObserver.js +43 -2
- package/dist/utils/themeProps.d.ts +8 -0
- package/dist/utils/themeProps.d.ts.map +1 -1
- package/dist/utils/themeProps.js +17 -0
- package/dist/utils/timeFormat.d.ts +9 -1
- package/dist/utils/timeFormat.d.ts.map +1 -1
- package/dist/utils/timeFormat.js +46 -6
- package/dist/utils/timeParser.d.ts +3 -1
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +7 -3
- package/dist/utils/touchEndMark.d.ts +7 -0
- package/dist/utils/touchEndMark.d.ts.map +1 -0
- package/dist/utils/touchEndMark.js +33 -0
- package/dist/virtualization/listWindow.d.ts +28 -2
- package/dist/virtualization/listWindow.d.ts.map +1 -1
- package/dist/virtualization/listWindow.js +71 -3
- package/dist/virtualization/useInlineListWindow.d.ts +64 -0
- package/dist/virtualization/useInlineListWindow.d.ts.map +1 -0
- package/dist/virtualization/useInlineListWindow.js +135 -0
- package/dist/virtualization/useListFocusIsland.d.ts +28 -0
- package/dist/virtualization/useListFocusIsland.d.ts.map +1 -0
- package/dist/virtualization/useListFocusIsland.js +53 -0
- package/dist/virtualization/useListWindow.d.ts +6 -4
- package/dist/virtualization/useListWindow.d.ts.map +1 -1
- package/dist/virtualization/useListWindow.js +17 -29
- package/locales/en.json +131 -3
- package/locales/pseudo.json +96 -0
- package/package.json +5 -5
- package/src/AppShell/AppShell.tsx +12 -3
- package/src/AppShell/useCloseMobileDrawerOnActivate.ts +19 -2
- package/src/BottomSheet/BottomSheet.tsx +12 -8
- package/src/BottomSheet/BottomSheetPanel.tsx +53 -40
- package/src/BottomSheet/useSheetGestures.ts +18 -18
- package/src/ButtonGroup/ButtonGroup.doc.mjs +5 -0
- package/src/Chat/ChatComposerInput.tsx +4 -0
- package/src/CheckboxInput/CheckboxInput.doc.mjs +3 -0
- package/src/DateInput/DateInput.doc.mjs +21 -3
- package/src/DateInput/DateInput.tsx +61 -7
- package/src/DateInput/NativeDateField.tsx +58 -36
- package/src/DateInput/index.ts +1 -0
- package/src/DateInput/useTypedDate.ts +293 -196
- package/src/DateTimeInput/DateTimeInput.doc.mjs +21 -3
- package/src/DateTimeInput/DateTimeInput.tsx +158 -86
- package/src/DateTimeInput/NativeDateSegment.tsx +35 -13
- package/src/DateTimeInput/NativeTimeSegment.tsx +45 -22
- package/src/DateTimeInput/index.ts +1 -0
- package/src/DropdownMenu/DropdownMenu.tsx +10 -3
- package/src/Field/InputClearButton.tsx +3 -1
- package/src/Field/useEntryErrorBehavior.ts +34 -0
- package/src/Field/useEntryErrorReport.ts +210 -0
- package/src/Field/useValueReplacesEntry.ts +44 -0
- package/src/FormLayout/FormLayout.doc.mjs +14 -0
- package/src/FormLayout/FormLayout.tsx +24 -2
- package/src/FormLayout/FormLayoutContext.ts +24 -4
- package/src/FormLayout/index.ts +5 -1
- package/src/InfoTip/InfoTip.doc.mjs +2 -2
- package/src/InfoTip/InfoTip.tsx +3 -0
- package/src/Layer/gestureCounter.ts +136 -4
- package/src/Layer/layerAnimations.stylex.ts +13 -9
- package/src/Layer/layerEntranceSide.ts +48 -11
- package/src/Layer/useLayer.tsx +89 -15
- package/src/Layer/useTouchTrigger.ts +21 -21
- package/src/Lightbox/Lightbox.doc.mjs +2 -1
- package/src/Lightbox/Lightbox.tsx +864 -257
- package/src/List/ListItem.tsx +3 -2
- package/src/List/ListReorderHandle.tsx +59 -77
- package/src/List/listReorderContext.ts +3 -4
- package/src/List/listReorderEngine.tsx +246 -11
- package/src/Markdown/plugins/textTransform.ts +46 -12
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -2
- package/src/MoreMenu/MoreMenu.tsx +3 -0
- package/src/NumberInput/NumberInput.doc.mjs +29 -6
- package/src/NumberInput/NumberInput.tsx +224 -52
- package/src/NumberInput/index.ts +2 -1
- package/src/NumberInput/numberInputCommit.ts +57 -13
- package/src/Pagination/Pagination.tsx +14 -4
- package/src/Popover/usePopover.tsx +30 -22
- package/src/PowerSearch/PowerSearch.doc.mjs +2 -2
- package/src/PowerSearch/PowerSearch.tsx +7 -3
- package/src/PowerSearch/PowerSearchEditPopover.tsx +12 -2
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +3 -0
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +4 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +3 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +5 -0
- package/src/Selector/useSelectorPresentation.ts +16 -12
- package/src/Slider/Slider.tsx +6 -8
- package/src/StatusDot/StatusDot.doc.mjs +3 -0
- package/src/Switch/Switch.doc.mjs +3 -0
- package/src/TabList/TabList.doc.mjs +4 -0
- package/src/Table/BaseTable.tsx +440 -289
- package/src/Table/Table.doc.mjs +2 -2
- package/src/Table/Table.tsx +5 -1
- package/src/Table/index.ts +8 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +2 -0
- package/src/Table/plugins/infiniteScroll/index.ts +10 -0
- package/src/Table/plugins/infiniteScroll/useTableInfiniteScroll.tsx +523 -0
- package/src/Table/plugins/sortable/useTableSortableState.tsx +4 -4
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +31 -1
- package/src/Table/plugins/virtualization/TableColumnWindow.tsx +160 -0
- package/src/Table/plugins/virtualization/index.ts +3 -1
- package/src/Table/plugins/virtualization/useTableColumnWindow.ts +284 -0
- package/src/Table/plugins/virtualization/useTableColumnsVirtualization.ts +53 -0
- package/src/Table/plugins/virtualization/useTableWindow.ts +49 -17
- package/src/Table/tableColumnWindowing.ts +181 -0
- package/src/Table/tablePinnedColumnRuns.ts +55 -0
- package/src/Table/tableRuntime.ts +44 -11
- package/src/Table/types.ts +25 -2
- package/src/Table/useBaseTablePlugins.ts +2 -2
- package/src/Table/useTableColumnsVirtualization.doc.mjs +29 -0
- package/src/Table/useTableInfiniteScroll.doc.mjs +58 -0
- package/src/Text/Heading.doc.mjs +3 -0
- package/src/Text/useTruncation.doc.mjs +10 -0
- package/src/Text/useTruncation.ts +53 -35
- package/src/TextArea/TextArea.doc.mjs +15 -0
- package/src/TextArea/TextArea.tsx +11 -0
- package/src/TextInput/TextInput.doc.mjs +3 -0
- package/src/TimeInput/TimeInput.doc.mjs +38 -4
- package/src/TimeInput/TimeInput.tsx +176 -99
- package/src/TimeInput/index.ts +2 -0
- package/src/TimeInput/useTypedTime.ts +341 -0
- package/src/Toast/Toast.doc.mjs +2 -2
- package/src/Toast/Toast.tsx +3 -1
- package/src/Tooltip/useTooltip.tsx +147 -136
- package/src/TopNav/TopNav.doc.mjs +4 -0
- package/src/dragToSnapPoints/createDragToSnapPoints.ts +437 -119
- package/src/gestures/createPanGesture.ts +112 -39
- package/src/hooks/useMenuPress.ts +39 -0
- package/src/i18n/generated-english/DateInput/NativeDateField.generated.ts +0 -1
- package/src/i18n/generated-english/DateTimeInput/NativeDateSegment.generated.ts +0 -1
- package/src/i18n/generated-english/Lightbox/Lightbox.generated.ts +2 -0
- package/src/i18n/generated-english/{DateTimeInput/NativeTimeSegment.generated.ts → Table/plugins/infiniteScroll/useTableInfiniteScroll.generated.ts} +2 -2
- package/src/i18n/generated-locales/en.generated.ts +34 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +34 -0
- package/src/internal/touch.ts +5 -1
- package/src/motion/animator.ts +181 -23
- package/src/theme/generateThemeRules.ts +14 -3
- package/src/theme/tokenReferences.ts +48 -7
- package/src/utils/clickGuard.ts +33 -3
- package/src/utils/sharedResizeObserver.ts +46 -2
- package/src/utils/themeProps.ts +17 -0
- package/src/utils/timeFormat.ts +55 -10
- package/src/utils/timeParser.ts +7 -9
- package/src/utils/touchEndMark.ts +33 -0
- package/src/virtualization/listWindow.ts +105 -3
- package/src/virtualization/useInlineListWindow.ts +261 -0
- package/src/virtualization/useListFocusIsland.ts +87 -0
- package/src/virtualization/useListWindow.ts +14 -51
- package/dist/i18n/generated-english/DateTimeInput/NativeTimeSegment.generated.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA0Cf,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,C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AEhD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAuQD,wBAAgB,QAAQ,CAAC,EACvB,OAAoB,EACpB,MAAM,EACN,QAAQ,EACR,cAAc,EACd,aAAa,EAAE,UAAU,EACzB,MAAe,EACf,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,aAAa,qBAizBf;yBAh0Be,QAAQ"}
|
|
@@ -20,7 +20,7 @@ import React from 'react';
|
|
|
20
20
|
* - /packages/cli/assets/templates/blocks/components/AppShell/ (showcase blocks)
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import { isValidElement, useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
23
|
+
import { isValidElement, useCallback, useDeferredValue, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
24
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
25
|
import "../theme/tokens.stylex.js";
|
|
26
26
|
import { colorVars, focusVars, fontWeightVars, radiusVars, spacingVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
@@ -319,7 +319,13 @@ export function AppShell({
|
|
|
319
319
|
// =========================================================================
|
|
320
320
|
const activeWidthBreakpoints = activeTheme?.__adaptations?.widthBreakpoints;
|
|
321
321
|
const breakpointQuery = sideNavBreakpoint === 'none' ? '(width < 0px)' : `(width < ${activeWidthBreakpoints?.[sideNavBreakpoint] ?? DEFAULT_WIDTH_BREAKPOINTS[sideNavBreakpoint]}px)`;
|
|
322
|
-
|
|
322
|
+
// The client's first answer can differ from the server's. That correction
|
|
323
|
+
// is an urgent update, and it changes the mobile context above the page.
|
|
324
|
+
// React answers an urgent update above content it has not hydrated by
|
|
325
|
+
// rendering that content again in place of its server HTML. A deferred
|
|
326
|
+
// value takes the client's answer in a transition, which waits for that
|
|
327
|
+
// content to hydrate.
|
|
328
|
+
const isBelowBreakpoint = useDeferredValue(useMediaQuery(breakpointQuery, sideNavBreakpoint === 'none' ? false : mobileNavConfig?.defaultIsMobile));
|
|
323
329
|
const [uncontrolledMobileOpen, setUncontrolledMobileOpen] = useState(false);
|
|
324
330
|
const isMobileNavOpen = mobileNavConfig?.isOpen ?? uncontrolledMobileOpen;
|
|
325
331
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Returns a function that wraps a row's click handler. While
|
|
3
3
|
* `isInMobileDrawer` is true, the wrapped handler calls the row's handler and
|
|
4
4
|
* then closes the AppShell mobile drawer. Otherwise the row's handler comes
|
|
5
|
-
* back unchanged. Every drawer row closes the drawer through this one rule
|
|
5
|
+
* back unchanged. Every drawer row closes the drawer through this one rule,
|
|
6
|
+
* except that a modified click on a link leaves it open.
|
|
6
7
|
*/
|
|
7
8
|
export declare function useCloseMobileDrawerOnActivate(isInMobileDrawer: boolean): <Args extends unknown[]>(onClick: ((...args: Args) => void) | undefined) => ((...args: Args) => void) | undefined;
|
|
8
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCloseMobileDrawerOnActivate.d.ts","sourceRoot":"","sources":["../../src/AppShell/useCloseMobileDrawerOnActivate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCloseMobileDrawerOnActivate.d.ts","sourceRoot":"","sources":["../../src/AppShell/useCloseMobileDrawerOnActivate.ts"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,OAAO,GACxB,CAAC,IAAI,SAAS,OAAO,EAAE,EACxB,OAAO,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,KAC3C,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAazC;AAeD;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAQrD"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* exported from the package.
|
|
11
11
|
*/
|
|
12
12
|
import { useAppShellMobile } from "./AppShellMobileContext.js";
|
|
13
|
+
import { isModifiedClick } from "../DropdownMenu/menuItemRoles.js";
|
|
13
14
|
import { useSideNavRenderMode } from "../SideNav/SideNavRenderContext.js";
|
|
14
15
|
import { useTopNavRenderMode } from "../TopNav/TopNavRenderContext.js";
|
|
15
16
|
|
|
@@ -17,7 +18,8 @@ import { useTopNavRenderMode } from "../TopNav/TopNavRenderContext.js";
|
|
|
17
18
|
* Returns a function that wraps a row's click handler. While
|
|
18
19
|
* `isInMobileDrawer` is true, the wrapped handler calls the row's handler and
|
|
19
20
|
* then closes the AppShell mobile drawer. Otherwise the row's handler comes
|
|
20
|
-
* back unchanged. Every drawer row closes the drawer through this one rule
|
|
21
|
+
* back unchanged. Every drawer row closes the drawer through this one rule,
|
|
22
|
+
* except that a modified click on a link leaves it open.
|
|
21
23
|
*/
|
|
22
24
|
export function useCloseMobileDrawerOnActivate(isInMobileDrawer) {
|
|
23
25
|
const {
|
|
@@ -29,11 +31,22 @@ export function useCloseMobileDrawerOnActivate(isInMobileDrawer) {
|
|
|
29
31
|
}
|
|
30
32
|
return (...args) => {
|
|
31
33
|
onClick?.(...args);
|
|
32
|
-
|
|
34
|
+
if (!isModifiedLinkClick(args[0])) {
|
|
35
|
+
closeMobileNav();
|
|
36
|
+
}
|
|
33
37
|
};
|
|
34
38
|
};
|
|
35
39
|
}
|
|
36
40
|
|
|
41
|
+
// A modified click on a link is the browser's (a new tab), so the drawer stays
|
|
42
|
+
// open for the next one. The clicked element decides whether it is a link, so
|
|
43
|
+
// a row whose blocked `href` renders no address still closes. A row whose
|
|
44
|
+
// `onClick` cancels the click opens nothing elsewhere, so it still closes.
|
|
45
|
+
function isModifiedLinkClick(event) {
|
|
46
|
+
const click = event;
|
|
47
|
+
return click?.currentTarget?.hasAttribute?.('href') === true && isModifiedClick(click) && !click.defaultPrevented;
|
|
48
|
+
}
|
|
49
|
+
|
|
37
50
|
/**
|
|
38
51
|
* Whether the caller renders inside the AppShell mobile drawer: in TopNav
|
|
39
52
|
* content or SideNav content shown there.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAuBH,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAuBH,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AA4DhD,YAAY,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAkNhF,UAAU,sBAAuB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,qDAAqD;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IAEd,0EAA0E;IAC1E,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,wGAAwG;IACxG,MAAM,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;IAE7C;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAEjD;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,0BAA2B,SAAQ,sBAAsB;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,wBAAyB,SAAQ,sBAAsB;IAC/D;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAC1B,0BAA0B,GAAG,wBAAwB,CAAC;AA69BxD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA6BlD;yBA7Be,WAAW"}
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
// stack, but they replace each other. Each open modal sheet is an outlet for
|
|
51
51
|
// toasts (Layer/modalOutlet.ts), in stack order.
|
|
52
52
|
import { use, useCallback, useEffect, useInsertionEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
53
|
+
import { useCommittedRef } from "../hooks/useCommittedRef.js";
|
|
53
54
|
import { useIsHydrating } from "../hooks/useIsHydrating.js";
|
|
54
55
|
import { useSettledOpen } from "../hooks/useSettledOpen.js";
|
|
55
56
|
import * as stylex from '@stylexjs/stylex';
|
|
@@ -294,8 +295,9 @@ function StandaloneBottomSheet({
|
|
|
294
295
|
// sheet leaves the page interactive, so it returns focus to its opener
|
|
295
296
|
// only if the person was still in the sheet; a modal sheet always does.
|
|
296
297
|
const hadFocusAtCloseRef = useRef(false);
|
|
297
|
-
|
|
298
|
-
|
|
298
|
+
// The committed `finalFocusRef`. The stack reads it when it closes the
|
|
299
|
+
// sheet, which can happen in a layout effect.
|
|
300
|
+
const finalFocusRefRef = useCommittedRef(finalFocusRef);
|
|
299
301
|
// A sheet rendered in another sheet's content is presented only while that
|
|
300
302
|
// sheet is open: it leaves with its host and, if its own state is still
|
|
301
303
|
// open, comes back when the host does (see BottomSheetHostContext). Its
|
|
@@ -391,8 +393,9 @@ function StandaloneBottomSheet({
|
|
|
391
393
|
const handlePanelElementChange = useCallback(element => {
|
|
392
394
|
panelRef.current = element;
|
|
393
395
|
}, []);
|
|
396
|
+
// The stack's view for the handlers. The registry's `onView` writes it with
|
|
397
|
+
// each view it reports, together with the state.
|
|
394
398
|
const stackViewRef = useRef(stackView);
|
|
395
|
-
stackViewRef.current = stackView;
|
|
396
399
|
const scrimWriteRef = useRef({
|
|
397
400
|
frame: null
|
|
398
401
|
});
|
|
@@ -436,6 +439,8 @@ function StandaloneBottomSheet({
|
|
|
436
439
|
const repairOnRemoval = dialog == null ? null : prepareFocusRepairOnRemoval(dialog, {
|
|
437
440
|
keepRestingFocus: true
|
|
438
441
|
});
|
|
442
|
+
// Where focus returns when the sheet leaves, read when it leaves.
|
|
443
|
+
const getReturnTarget = () => finalFocusRefRef.current?.current ?? triggerRef.current;
|
|
439
444
|
const leave = registerBottomSheet({
|
|
440
445
|
key,
|
|
441
446
|
getElement: () => dialogRef.current,
|
|
@@ -456,7 +461,7 @@ function StandaloneBottomSheet({
|
|
|
456
461
|
},
|
|
457
462
|
hide: () => closeDialogKeepingFocus(dialogRef.current),
|
|
458
463
|
focus: reason => focusSheetPanel(panelRef.current, reason, hasScrim),
|
|
459
|
-
getReturnTarget
|
|
464
|
+
getReturnTarget,
|
|
460
465
|
onView: view => {
|
|
461
466
|
stackViewRef.current = view;
|
|
462
467
|
setStackView(view);
|
|
@@ -491,7 +496,7 @@ function StandaloneBottomSheet({
|
|
|
491
496
|
// person had already moved out of the sheet to the page body stays
|
|
492
497
|
// there: the removal did not lose it.
|
|
493
498
|
if (repairOnRemoval != null && isSheetHostPresented(dialog)) {
|
|
494
|
-
const returnTarget =
|
|
499
|
+
const returnTarget = getReturnTarget();
|
|
495
500
|
const revealed = hasScrim ? getBottomSheetBeneath(key) : null;
|
|
496
501
|
repairOnRemoval(() => {
|
|
497
502
|
// The sheet beneath left too. Its own repair returns focus for the
|
|
@@ -508,7 +513,7 @@ function StandaloneBottomSheet({
|
|
|
508
513
|
}
|
|
509
514
|
leave();
|
|
510
515
|
};
|
|
511
|
-
}, [hasScrim, shouldPresent, writeScrim]);
|
|
516
|
+
}, [finalFocusRefRef, hasScrim, shouldPresent, writeScrim]);
|
|
512
517
|
useLayoutEffect(() => {
|
|
513
518
|
if (!isOpen) {
|
|
514
519
|
// Where focus was when the person closed the sheet. The closing sheet
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EASL,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA+B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAYvB,QAAA,MAAM,cAAc;;;;CAIV,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,cAAc,C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K,IAAI,CAAC;IAC1C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACtE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D;;;OAGG;IACH,SAAS,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAC7D;AAyJD,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,KAAK,EACL,eAAe,EACf,MAAM,EACN,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,cAAsB,EACtB,cAAc,EACd,eAAe,EACf,qBAA4B,EAC5B,kBAA0B,EAC1B,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,qBAAqB,+BA2iBvB;yBArkBe,gBAAgB"}
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* - /packages/core/src/BottomSheet/useSheetGestures.ts
|
|
19
19
|
* - /packages/core/src/Layout/container.stylex.ts (bottom-sheet padding chain)
|
|
20
20
|
*/
|
|
21
|
-
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from 'react';
|
|
21
|
+
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
|
|
22
|
+
import { useCommittedRef } from "../hooks/useCommittedRef.js";
|
|
22
23
|
import * as stylex from '@stylexjs/stylex';
|
|
23
24
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
24
25
|
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
@@ -493,27 +494,27 @@ export function BottomSheetPanel({
|
|
|
493
494
|
}) {
|
|
494
495
|
const elementRef = useRef(null);
|
|
495
496
|
const dismissKeyboardRef = useRef(null);
|
|
496
|
-
const
|
|
497
|
-
const
|
|
498
|
-
const
|
|
499
|
-
const onMotionCompleteRef = useRef(onMotionComplete);
|
|
500
|
-
const onScrimFadeDurationRef = useRef(onScrimFadeDuration);
|
|
497
|
+
const onMotionStartRef = useCommittedRef(onMotionStart);
|
|
498
|
+
const onMotionCompleteRef = useCommittedRef(onMotionComplete);
|
|
499
|
+
const onScrimFadeDurationRef = useCommittedRef(onScrimFadeDuration);
|
|
501
500
|
const startedMotionRef = useRef(null);
|
|
502
501
|
const pendingMotionCompleteRef = useRef(null);
|
|
503
502
|
const isEntering = state.kind === 'open' && state.entering;
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
503
|
+
// This is state, not a ref: a ref written during render keeps the values
|
|
504
|
+
// of a render React discards.
|
|
505
|
+
const [entrance, setEntrance] = useState({
|
|
506
|
+
kind: state.kind,
|
|
507
|
+
isEntering,
|
|
508
|
+
isReactivated: false
|
|
509
|
+
});
|
|
510
|
+
if (entrance.kind !== state.kind || entrance.isEntering !== isEntering) {
|
|
511
|
+
setEntrance({
|
|
512
|
+
kind: state.kind,
|
|
513
|
+
isEntering,
|
|
514
|
+
isReactivated: isEntering && entrance.kind === 'retained'
|
|
515
|
+
});
|
|
510
516
|
}
|
|
511
|
-
|
|
512
|
-
previousStateRef.current = state;
|
|
513
|
-
onMotionStartRef.current = onMotionStart;
|
|
514
|
-
onMotionCompleteRef.current = onMotionComplete;
|
|
515
|
-
onScrimFadeDurationRef.current = onScrimFadeDuration;
|
|
516
|
-
}, [onMotionComplete, onMotionStart, onScrimFadeDuration, state]);
|
|
517
|
+
const isReactivatedEntrance = entrance.isReactivated;
|
|
517
518
|
const isInteractive = state.kind === 'open';
|
|
518
519
|
const isPresented = state.kind !== 'hidden';
|
|
519
520
|
const isRetained = state.kind === 'retained';
|
|
@@ -526,30 +527,42 @@ export function BottomSheetPanel({
|
|
|
526
527
|
const alignmentOffset = isRetained && !isReducedMotion ? state.alignmentOffset : 0;
|
|
527
528
|
|
|
528
529
|
// Everything derived from the snap points keys off their identity, not the
|
|
529
|
-
// array's
|
|
530
|
-
// changed, so it must not churn on a re-render the drag caused.
|
|
531
|
-
//
|
|
532
|
-
// against whatever the viewport is then, not
|
|
530
|
+
// array's. The resolver's identity is the hook's signal that the stops
|
|
531
|
+
// changed, so it must not churn on a re-render the drag caused. In state, a
|
|
532
|
+
// render React discards cannot leave its points behind. The resolver
|
|
533
|
+
// resolves them at call time — against whatever the viewport is then, not
|
|
534
|
+
// what it was at memo time.
|
|
533
535
|
const snapPointsKey = snapPointsKeyFor(snapPoints);
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
+
const [keyedSnapPoints, setKeyedSnapPoints] = useState({
|
|
537
|
+
key: snapPointsKey,
|
|
538
|
+
points: snapPoints
|
|
539
|
+
});
|
|
540
|
+
if (keyedSnapPoints.key !== snapPointsKey) {
|
|
541
|
+
setKeyedSnapPoints({
|
|
542
|
+
key: snapPointsKey,
|
|
543
|
+
points: snapPoints
|
|
544
|
+
});
|
|
545
|
+
}
|
|
536
546
|
const {
|
|
537
547
|
snapHeights,
|
|
538
548
|
ignoredSnapPointsMessage
|
|
539
549
|
} = useMemo(() => {
|
|
540
|
-
|
|
550
|
+
const {
|
|
551
|
+
key,
|
|
552
|
+
points
|
|
553
|
+
} = keyedSnapPoints;
|
|
554
|
+
if (key === '') {
|
|
541
555
|
return {
|
|
542
556
|
snapHeights: undefined,
|
|
543
557
|
ignoredSnapPointsMessage: ''
|
|
544
558
|
};
|
|
545
559
|
}
|
|
546
|
-
const ignored = (
|
|
560
|
+
const ignored = (points ?? []).filter(point => !isValidSnapPoint(point));
|
|
547
561
|
return {
|
|
548
|
-
snapHeights: () => resolveSnapPoints(
|
|
562
|
+
snapHeights: () => resolveSnapPoints(points ?? [], layoutViewportHeight()),
|
|
549
563
|
ignoredSnapPointsMessage: ignored.length === 0 ? '' : `snapPoints ignored ${JSON.stringify(ignored)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`
|
|
550
564
|
};
|
|
551
|
-
|
|
552
|
-
}, [snapPointsKey]);
|
|
565
|
+
}, [keyedSnapPoints]);
|
|
553
566
|
useDevWarning('BottomSheet', ignoredSnapPointsMessage, ignoredSnapPointsMessage !== '');
|
|
554
567
|
|
|
555
568
|
// A caller's height owns the element's height: the drag never writes it.
|
|
@@ -673,11 +686,15 @@ export function BottomSheetPanel({
|
|
|
673
686
|
if (playedDragExit == null || element == null) {
|
|
674
687
|
return;
|
|
675
688
|
}
|
|
676
|
-
|
|
689
|
+
// The host's current callback hears the fade end, as it heard its start.
|
|
690
|
+
const reportFade = durationMs => {
|
|
691
|
+
onScrimFadeDurationRef.current?.(element, durationMs);
|
|
692
|
+
};
|
|
693
|
+
reportFade(dragExitMs(element, playedDragExit));
|
|
677
694
|
return () => {
|
|
678
|
-
|
|
695
|
+
reportFade(null);
|
|
679
696
|
};
|
|
680
|
-
}, [playedDragExit]);
|
|
697
|
+
}, [onScrimFadeDurationRef, playedDragExit]);
|
|
681
698
|
// Syncs the motion with the panel's CSS transition, or a drag's exit with
|
|
682
699
|
// the shared animator. The motion completes when that one ends.
|
|
683
700
|
useLayoutEffect(() => {
|
|
@@ -699,7 +716,7 @@ export function BottomSheetPanel({
|
|
|
699
716
|
pendingMotionCompleteRef.current = motion;
|
|
700
717
|
}
|
|
701
718
|
};
|
|
702
|
-
if (motion === 'entering' &&
|
|
719
|
+
if (motion === 'entering' && isReactivatedEntrance) {
|
|
703
720
|
complete();
|
|
704
721
|
return;
|
|
705
722
|
}
|
|
@@ -762,7 +779,7 @@ export function BottomSheetPanel({
|
|
|
762
779
|
// retained sheet's fade starts at once and the two fades cross.
|
|
763
780
|
const crossFadeMotion = isCrossFade && motion === 'exiting';
|
|
764
781
|
return waitForTransition(elementRef.current, motion === 'fading' || crossFadeMotion ? 'opacity' : 'transform', complete);
|
|
765
|
-
}, [motion, isCrossFade, playedDragExit]);
|
|
782
|
+
}, [motion, isCrossFade, playedDragExit, isReactivatedEntrance, onMotionCompleteRef, onScrimFadeDurationRef]);
|
|
766
783
|
// The snap is transform-only; the layout height reconciles when it lands.
|
|
767
784
|
// waitForTransition — the same helper the motion states use — resolves that
|
|
768
785
|
// even when no `transitionend` is coming: inline or computed
|
|
@@ -791,7 +808,7 @@ export function BottomSheetPanel({
|
|
|
791
808
|
pendingMotionCompleteRef.current = null;
|
|
792
809
|
}
|
|
793
810
|
};
|
|
794
|
-
}, [motion]);
|
|
811
|
+
}, [motion, onMotionCompleteRef, onMotionStartRef]);
|
|
795
812
|
|
|
796
813
|
// Same lowering as Dialog: with no padding prop the content box reads the
|
|
797
814
|
// theme's --astryx-bottom-sheet-padding chain (--spacing-4 when unset), else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB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B,GAAG,sBAAsB,CA6+ClD"}
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
// finger ends any drag (yieldToPinch). There is no module-scope DOM access,
|
|
50
50
|
// so the hook is SSR-safe. Reduced motion skips the settle transition.
|
|
51
51
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
52
|
+
import { useCommittedRef } from "../hooks/useCommittedRef.js";
|
|
52
53
|
import { TAP_WOBBLE } from "../gestures/tapWobble.js";
|
|
53
54
|
import { VelocityTracker } from "../gestures/VelocityTracker.js";
|
|
54
55
|
import { resolveSnapPoint } from "../motion/resolveSnapPoint.js";
|
|
@@ -444,12 +445,8 @@ export function useSheetGestures({
|
|
|
444
445
|
const isOpenRef = useRef(isOpen);
|
|
445
446
|
isOpenRef.current = isOpen;
|
|
446
447
|
|
|
447
|
-
//
|
|
448
|
-
|
|
449
|
-
// effects, so a resolver parked in one would still be the previous set of
|
|
450
|
-
// stops by the time the re-anchor read it.
|
|
451
|
-
const snapHeightsRef = useRef(snapHeights);
|
|
452
|
-
snapHeightsRef.current = snapHeights;
|
|
448
|
+
// It is current before any layout effect, so the re-anchor reads the new stops.
|
|
449
|
+
const snapHeightsRef = useCommittedRef(snapHeights);
|
|
453
450
|
const onTravelStartRef = useRef(onTravelStart);
|
|
454
451
|
onTravelStartRef.current = onTravelStart;
|
|
455
452
|
const onDismissRef = useRef(onDismiss);
|
|
@@ -596,7 +593,7 @@ export function useSheetGestures({
|
|
|
596
593
|
offsets,
|
|
597
594
|
peekOffset: peekOffsetFor(offsets, visibleSheetHeight)
|
|
598
595
|
};
|
|
599
|
-
}, []);
|
|
596
|
+
}, [snapHeightsRef]);
|
|
600
597
|
|
|
601
598
|
// The fully open height right now. At a resizing detent the element has a
|
|
602
599
|
// stale pixel height. So drop the inline height, measure, and put it back in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposerInput.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerInput.ts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;IACjB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0IAA0I;IAC1I,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,EACrC,IAAI,EAAE,MAAM,KACT,OAAO,GAAG,IAAI,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,yBAAyB,GAAG,KAAK,CAAC;IACjD,8BAA8B;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AA4GD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BA8lB9D;yBA9lBe,iBAAiB;;;AAsmBjC,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,+BAkB5E;yBAlBe,wBAAwB"}
|
|
@@ -636,7 +636,7 @@ export function ChatComposerInput(props) {
|
|
|
636
636
|
...editorAriaProps,
|
|
637
637
|
"aria-disabled": isDisabled || undefined,
|
|
638
638
|
...mergeProps({
|
|
639
|
-
className: "x1a2a7pz x126k92a x13faqbe x1odjw0f xjm74w1 xf9zqsd x19v9tvf x9ynric x1tgivj0 xxugrtn x7a5moj"
|
|
639
|
+
className: "xe0957l x1a2a7pz x126k92a x13faqbe x1odjw0f xjm74w1 xf9zqsd x19v9tvf x9ynric x1tgivj0 xxugrtn x7a5moj"
|
|
640
640
|
}, {
|
|
641
641
|
style: {
|
|
642
642
|
maxHeight: `${maxHeight}px`
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as stylex from '@stylexjs/stylex';
|
|
2
|
+
import type { EntryErrorBehavior } from '../FormLayout/FormLayoutContext.js';
|
|
2
3
|
import { type InputStatus } from '../Field/index.js';
|
|
3
4
|
import { type ISODateString, type DayOfWeek, type DayOfWeekName } from '../Calendar/index.js';
|
|
4
5
|
import type { CalendarSystem } from '../utils/calendarSystem.js';
|
|
@@ -50,6 +51,7 @@ export type DateInputPresentation = PickerPresentation;
|
|
|
50
51
|
export type DateInputFormat = Extract<TimestampFormat, 'date' | 'date_long' | 'date_weekday' | 'system_date'>;
|
|
51
52
|
export type { InputStatus as DateInputStatus, InputStatusType as DateInputStatusType, } from '../Field/index.js';
|
|
52
53
|
export type { DateInputEntryError } from './useTypedDate.js';
|
|
54
|
+
export type { EntryErrorBehavior } from '../FormLayout/FormLayoutContext.js';
|
|
53
55
|
import { type FieldInputBaseProps } from '../Field/fieldParts.js';
|
|
54
56
|
import type { SizeValue } from '../utils/types.js';
|
|
55
57
|
import type { FieldStatusPlacement } from '../Field/fieldStatusPlacement.js';
|
|
@@ -156,9 +158,9 @@ export interface DateInputProps extends Omit<FieldInputBaseProps<HTMLInputElemen
|
|
|
156
158
|
* When set, displays a colored border and status icon.
|
|
157
159
|
* If message is provided, displays below the input.
|
|
158
160
|
*
|
|
159
|
-
* For a
|
|
160
|
-
*
|
|
161
|
-
*
|
|
161
|
+
* For a date the field rejects, typed or picked in the native control, and
|
|
162
|
+
* for unreadable or unfinished text that Enter or blur keeps, the field
|
|
163
|
+
* shows its own error message in place of `status`. With `onEntryErrorChange`, an
|
|
162
164
|
* `error` status with a message shows instead, and the field's own message
|
|
163
165
|
* applies only without one. A `warning` or `success` status never replaces
|
|
164
166
|
* a rejection.
|
|
@@ -199,6 +201,28 @@ export interface DateInputProps extends Omit<FieldInputBaseProps<HTMLInputElemen
|
|
|
199
201
|
* ```
|
|
200
202
|
*/
|
|
201
203
|
onEntryErrorChange?: (error: DateInputEntryError | null) => void;
|
|
204
|
+
/**
|
|
205
|
+
* When the field shows its own entry error: a typed date that it rejects,
|
|
206
|
+
* which `onEntryErrorChange` reports. It sets when the error shows, not when
|
|
207
|
+
* validation runs, so it is not React Aria's `validationBehavior` (native
|
|
208
|
+
* versus ARIA validation). It does not change a caller's `status`.
|
|
209
|
+
*
|
|
210
|
+
* - `'complete'` — a date the calendar does not have, or one outside `min`,
|
|
211
|
+
* `max`, or `dateConstraints`, shows as soon as the typed date is
|
|
212
|
+
* complete. Unreadable or unfinished text shows at Enter or blur.
|
|
213
|
+
* - `'blur-or-enter'` — every rejection waits for Enter or blur. The
|
|
214
|
+
* message, `aria-invalid`, the invalid styling, the announcement, and the
|
|
215
|
+
* `onEntryErrorChange` report then appear together. An edit that makes
|
|
216
|
+
* the text a date or empties it clears the error at once. An edit that
|
|
217
|
+
* leaves the text wrong keeps the shown error until the next Enter or
|
|
218
|
+
* blur.
|
|
219
|
+
*
|
|
220
|
+
* A date that the native control refuses shows at Enter or blur under both
|
|
221
|
+
* values.
|
|
222
|
+
*
|
|
223
|
+
* @default the nearest FormLayout's `defaultEntryErrorBehavior`, else `'complete'`
|
|
224
|
+
*/
|
|
225
|
+
entryErrorBehavior?: EntryErrorBehavior;
|
|
202
226
|
/**
|
|
203
227
|
* How the status message is placed relative to the input.
|
|
204
228
|
* - 'attached': message overlaps directly below the input (bordered treatment)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],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Field, Field, Icon, Calendar, usePopover, InputGroupContext
|
|
8
|
-
* @output Exports DateInput component, DateInputProps, and
|
|
7
|
+
* @input Uses React, useId, useCallback, useRef, useTypedDateField, useEntryErrorBehavior, Field, Icon, Calendar, usePopover, InputGroupContext
|
|
8
|
+
* @output Exports DateInput component, DateInputProps, DateInputEntryError, and EntryErrorBehavior
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by DateInput.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { use, useId, useCallback, useRef, useOptimistic, useTransition } from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import { inputDisabledFocusStyles } from "../Field/inputDisabledFocus.js";
|
|
21
|
+
import { useEntryErrorBehavior } from "../Field/useEntryErrorBehavior.js";
|
|
21
22
|
import "../theme/tokens.stylex.js";
|
|
22
23
|
import { colorVars, sizeVars, radiusVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
23
24
|
import { Field, InputClearButton, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputStatusFocusWithinStyles } from "../Field/index.js";
|
|
@@ -174,6 +175,7 @@ function PointerDateField({
|
|
|
174
175
|
size: sizeProp,
|
|
175
176
|
status,
|
|
176
177
|
onEntryErrorChange,
|
|
178
|
+
entryErrorBehavior,
|
|
177
179
|
statusVariant = 'attached',
|
|
178
180
|
labelTooltip,
|
|
179
181
|
hasClear = false,
|
|
@@ -209,6 +211,8 @@ function PointerDateField({
|
|
|
209
211
|
onKeyDown: onKeyDownProp,
|
|
210
212
|
...controlProps
|
|
211
213
|
} = rest;
|
|
214
|
+
// Form attributes pass through untyped, as other input attributes do.
|
|
215
|
+
const formControl = controlProps;
|
|
212
216
|
const t = useComponentTranslator();
|
|
213
217
|
const isEffectivelyRequired = useResolvedRequired({
|
|
214
218
|
isRequired,
|
|
@@ -278,11 +282,13 @@ function PointerDateField({
|
|
|
278
282
|
const navigateToTypedDate = useCallback(date => {
|
|
279
283
|
calendarRef.current?.navigateTo(date);
|
|
280
284
|
}, []);
|
|
285
|
+
const resolvedEntryErrorBehavior = useEntryErrorBehavior(entryErrorBehavior);
|
|
281
286
|
const {
|
|
282
287
|
typedDate,
|
|
283
288
|
displayValue,
|
|
284
289
|
formatHint,
|
|
285
290
|
isPending,
|
|
291
|
+
hiddenFormValue,
|
|
286
292
|
isInvalid,
|
|
287
293
|
fieldStatus,
|
|
288
294
|
alertMessage,
|
|
@@ -307,7 +313,8 @@ function PointerDateField({
|
|
|
307
313
|
status,
|
|
308
314
|
isStatusAnnounced: !inputGroup,
|
|
309
315
|
onEntryErrorChange,
|
|
310
|
-
hasPlaceholder: placeholderFromProps != null
|
|
316
|
+
hasPlaceholder: placeholderFromProps != null,
|
|
317
|
+
entryErrorBehavior: resolvedEntryErrorBehavior
|
|
311
318
|
});
|
|
312
319
|
const {
|
|
313
320
|
statusIcon,
|
|
@@ -506,6 +513,7 @@ function PointerDateField({
|
|
|
506
513
|
})
|
|
507
514
|
}), /*#__PURE__*/_jsx("input", {
|
|
508
515
|
...controlProps,
|
|
516
|
+
name: hiddenFormValue === null ? formControl.name : undefined,
|
|
509
517
|
ref: useMergedRefs(ref, inputRef),
|
|
510
518
|
id: id,
|
|
511
519
|
type: "text",
|
|
@@ -543,6 +551,11 @@ function PointerDateField({
|
|
|
543
551
|
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 xt0e3qv xv1l7n4"
|
|
544
552
|
}
|
|
545
553
|
}[!!isEffectivelyDisabled << 1 | !!isInvalid << 0]
|
|
554
|
+
}), hiddenFormValue !== null && formControl.name != null && /*#__PURE__*/_jsx("input", {
|
|
555
|
+
type: "hidden",
|
|
556
|
+
name: formControl.name,
|
|
557
|
+
form: formControl.form,
|
|
558
|
+
value: hiddenFormValue
|
|
546
559
|
}), /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
547
560
|
as: "div",
|
|
548
561
|
role: "alert",
|
|
@@ -665,15 +678,19 @@ export function DateInput(props) {
|
|
|
665
678
|
presentation: _presentation,
|
|
666
679
|
nativePicker: _nativePicker,
|
|
667
680
|
calendar: _calendar,
|
|
668
|
-
// Only the pointer field takes typed text.
|
|
681
|
+
// Only the pointer field takes typed text. The native field reads only
|
|
682
|
+
// whether the callback is set. Its refused dates wait for Enter or blur
|
|
683
|
+
// under every entry error behavior.
|
|
669
684
|
onEntryErrorChange,
|
|
685
|
+
entryErrorBehavior,
|
|
670
686
|
...rest
|
|
671
687
|
} = props;
|
|
672
688
|
switch (surface) {
|
|
673
689
|
case 'native':
|
|
674
690
|
return /*#__PURE__*/_jsx(NativeDateField, {
|
|
675
691
|
...rest,
|
|
676
|
-
isDisabled: isDisabled
|
|
692
|
+
isDisabled: isDisabled,
|
|
693
|
+
onEntryErrorChange: onEntryErrorChange
|
|
677
694
|
});
|
|
678
695
|
case 'sheet':
|
|
679
696
|
return /*#__PURE__*/_jsx(TouchDateField
|
|
@@ -688,7 +705,8 @@ export function DateInput(props) {
|
|
|
688
705
|
...rest,
|
|
689
706
|
calendar: calendar,
|
|
690
707
|
isDisabled: isDisabled,
|
|
691
|
-
onEntryErrorChange: onEntryErrorChange
|
|
708
|
+
onEntryErrorChange: onEntryErrorChange,
|
|
709
|
+
entryErrorBehavior: entryErrorBehavior
|
|
692
710
|
});
|
|
693
711
|
}
|
|
694
712
|
}
|
|
@@ -3,7 +3,7 @@ import type { DateInputProps } from './DateInput.js';
|
|
|
3
3
|
* The OS-picker surface. Takes `DateInput`'s props verbatim; see
|
|
4
4
|
* {@link DateInput} for when it is chosen over the other two.
|
|
5
5
|
*/
|
|
6
|
-
export declare function NativeDateField({ label, isLabelHidden, description, isOptional, isRequired, isDisabled, disabledMessage, value, onChange, changeAction, isLoading, min, max, dateConstraints, placeholder: placeholderFromProps, size: sizeProp, status, statusVariant, labelTooltip, hasClear, numberOfMonths: _numberOfMonths, weekStartsOn: _weekStartsOn, format, width, containerXstyle, containerClassName, containerStyle, controlXstyle, controlClassName, controlStyle, ref, ...restProps }: DateInputProps): import("react").JSX.Element;
|
|
6
|
+
export declare function NativeDateField({ label, isLabelHidden, description, isOptional, isRequired, isDisabled, disabledMessage, value, onChange, changeAction, isLoading, min, max, dateConstraints, placeholder: placeholderFromProps, size: sizeProp, status, onEntryErrorChange, statusVariant, labelTooltip, hasClear, numberOfMonths: _numberOfMonths, weekStartsOn: _weekStartsOn, format, width, containerXstyle, containerClassName, containerStyle, controlXstyle, controlClassName, controlStyle, ref, ...restProps }: DateInputProps): import("react").JSX.Element;
|
|
7
7
|
export declare namespace NativeDateField {
|
|
8
8
|
var displayName: string;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeDateField.d.ts","sourceRoot":"","sources":["../../src/DateInput/NativeDateField.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeDateField.d.ts","sourceRoot":"","sources":["../../src/DateInput/NativeDateField.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAsNhD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EAGN,kBAAkB,EAClB,aAA0B,EAC1B,YAAY,EACZ,QAAgB,EAGhB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,aAAa,EAC3B,MAAoB,EACpB,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,GAAG,SAAS,EACb,EAAE,cAAc,+BA6dhB;yBAngBe,eAAe"}
|