@astryxdesign/core 0.7.8 → 0.7.9-canary.0200dfe
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/observeMainOverflow.d.ts.map +1 -1
- package/dist/AppShell/observeMainOverflow.js +9 -6
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +37 -3
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +40 -8
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +4 -3
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +61 -21
- package/dist/Calendar/Calendar.d.ts +14 -2
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +63 -74
- package/dist/Calendar/getInitialFocusDate.d.ts +4 -1
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
- package/dist/Calendar/getInitialFocusDate.js +7 -5
- package/dist/Calendar/hooks/useCalendarDays.d.ts +19 -2
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +57 -64
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts +28 -3
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +33 -22
- package/dist/Calendar/styles.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +74 -18
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts +2 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.js +20 -0
- package/dist/CheckboxList/CheckboxListItem.d.ts +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +40 -14
- package/dist/ClickableCard/ClickableCard.d.ts +1 -1
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +5 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +2 -0
- package/dist/DateInput/DateInput.d.ts +37 -6
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +97 -124
- package/dist/DateInput/MonthScroller.d.ts +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +26 -29
- package/dist/DateInput/MonthYearWheels.d.ts +10 -1
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -1
- package/dist/DateInput/MonthYearWheels.js +54 -42
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +7 -1
- package/dist/DateInput/TouchDateField.d.ts +1 -1
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +26 -21
- package/dist/DateInput/monthGeometry.d.ts +42 -8
- package/dist/DateInput/monthGeometry.d.ts.map +1 -1
- package/dist/DateInput/monthGeometry.js +81 -7
- package/dist/DateInput/useCalendarPresentation.d.ts +10 -0
- package/dist/DateInput/useCalendarPresentation.d.ts.map +1 -0
- package/dist/DateInput/useCalendarPresentation.js +32 -0
- package/dist/DateInput/useTypedDate.d.ts +92 -0
- package/dist/DateInput/useTypedDate.d.ts.map +1 -0
- package/dist/DateInput/useTypedDate.js +269 -0
- package/dist/DateInput/wheelStrip.js +2 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts +17 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +15 -8
- package/dist/DateTimeInput/DateTimeInput.d.ts +26 -3
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +92 -88
- package/dist/DateTimeInput/TouchDateTimeField.d.ts +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +26 -20
- package/dist/Dialog/Dialog.d.ts +2 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +14 -3
- package/dist/Drawer/useDrawerDialogPresence.d.ts +2 -1
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +11 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +11 -8
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -2
- package/dist/Field/inputDisabledFocus.d.ts +4 -4
- package/dist/Field/inputStyles.stylex.d.ts +1 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +16 -2
- package/dist/HoverCard/useHoverCard.d.ts +3 -1
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/InfoTip/InfoTip.d.ts +1 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +6 -18
- package/dist/InputGroup/InputGroup.d.ts +4 -3
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +2 -2
- package/dist/InputGroup/InputGroupText.d.ts +2 -1
- package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupText.js +2 -1
- package/dist/InputGroup/groupStyles.d.ts +1 -1
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +1 -1
- package/dist/Item/Item.d.ts +20 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +97 -29
- package/dist/Item/ItemListRowContext.d.ts +2 -0
- package/dist/Item/ItemListRowContext.d.ts.map +1 -0
- package/dist/Item/ItemListRowContext.js +16 -0
- package/dist/Layer/holdEntranceInput.d.ts +24 -0
- package/dist/Layer/holdEntranceInput.d.ts.map +1 -0
- package/dist/Layer/holdEntranceInput.js +65 -0
- package/dist/Layer/inputHold.d.ts +49 -0
- package/dist/Layer/inputHold.d.ts.map +1 -0
- package/dist/Layer/inputHold.js +636 -0
- package/dist/Layer/outsidePress.d.ts +4 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +18 -1
- package/dist/Layer/preserveAnimations.d.ts +1 -5
- package/dist/Layer/preserveAnimations.d.ts.map +1 -1
- package/dist/Layer/preserveAnimations.js +12 -214
- package/dist/Layer/useBackdropPress.d.ts +8 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -1
- package/dist/Layer/useBackdropPress.js +31 -2
- package/dist/Layer/useLayer.d.ts +3 -1
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +64 -4
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +4 -0
- package/dist/Layout/LayoutContent.d.ts +3 -1
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +12 -4
- package/dist/Layout/LayoutPanel.d.ts +13 -10
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +81 -11
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -0
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +1 -0
- package/dist/List/ListItem.d.ts +5 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +45 -9
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +56 -39
- package/dist/MetadataList/MetadataList.js +1 -1
- package/dist/MobileNav/MobileNav.d.ts +11 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +39 -1
- package/dist/MoreMenu/MoreMenu.d.ts +5 -3
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +6 -9
- package/dist/NumberInput/NumberInput.d.ts +4 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +244 -11
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +7 -2
- package/dist/Popover/usePopover.d.ts +1 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +12 -5
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +9 -3
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +14 -11
- package/dist/PowerSearch/formatTokenValue.d.ts +6 -2
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatTokenValue.js +6 -3
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +16 -3
- package/dist/Resizable/ResizeHandle.d.ts +5 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +44 -5
- package/dist/Resizable/resizablePane.d.ts +58 -0
- package/dist/Resizable/resizablePane.d.ts.map +1 -0
- package/dist/Resizable/resizablePane.js +137 -0
- package/dist/Resizable/useResizable.d.ts +7 -0
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +13 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SelectableCard/SelectableCard.d.ts +1 -1
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +5 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +51 -10
- package/dist/SideNav/SideNav.d.ts +9 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +45 -10
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +14 -71
- package/dist/Spinner/index.d.ts +1 -1
- package/dist/Spinner/index.d.ts.map +1 -1
- package/dist/Spinner/spinnerRotor.d.ts +28 -0
- package/dist/Spinner/spinnerRotor.d.ts.map +1 -0
- package/dist/Spinner/spinnerRotor.js +98 -0
- package/dist/Stack/StackItem.d.ts +8 -4
- package/dist/Stack/StackItem.d.ts.map +1 -1
- package/dist/Stack/StackItem.js +17 -4
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -10
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +14 -8
- package/dist/Timestamp/formatInstant.d.ts +10 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +13 -27
- package/dist/Timestamp/tooltipEntries.d.ts +5 -3
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +6 -4
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +9 -0
- package/dist/Token/TokenLink.d.ts +1 -1
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +4 -1
- package/dist/Tokenizer/Tokenizer.d.ts +14 -10
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +189 -89
- package/dist/Tooltip/useTooltip.d.ts +3 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +164 -59
- package/dist/TreeList/TreeListItem.d.ts +2 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +27 -3
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/dist/animator/createAnimator.js +2 -2
- package/dist/astryx.css +362 -325
- package/dist/gestures/GestureHost.d.ts +2 -2
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +21 -6
- package/dist/gestures/PanGestureRecognizer.d.ts +11 -1
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +15 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +6 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.d.ts +3 -6
- package/dist/gestures/nativeScroll.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.js +7 -52
- package/dist/gestures/wheelSegmenter.d.ts +68 -1
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +199 -10
- package/dist/hooks/StackItemScrollRegion.d.ts +31 -0
- package/dist/hooks/StackItemScrollRegion.d.ts.map +1 -0
- package/dist/hooks/StackItemScrollRegion.js +40 -0
- package/dist/hooks/computeOverflow.d.ts +2 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +1 -1
- package/dist/hooks/menuPressGesture.d.ts +133 -21
- package/dist/hooks/menuPressGesture.d.ts.map +1 -1
- package/dist/hooks/menuPressGesture.js +155 -30
- package/dist/hooks/menuPressValues.d.ts +16 -0
- package/dist/hooks/menuPressValues.d.ts.map +1 -0
- package/dist/hooks/menuPressValues.js +18 -0
- package/dist/hooks/useClickableContainer.d.ts +36 -7
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +63 -14
- package/dist/hooks/useFocusTrap.d.ts +10 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +225 -132
- package/dist/hooks/useKeyboardHighlight.d.ts +17 -0
- package/dist/hooks/useKeyboardHighlight.d.ts.map +1 -0
- package/dist/hooks/useKeyboardHighlight.js +38 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +37 -12
- package/dist/hooks/useMenuPress.d.ts +34 -1
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +93 -5
- package/dist/hooks/useOverflow.d.ts +10 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +214 -23
- package/dist/hooks/usePressFeedback.d.ts +6 -6
- package/dist/hooks/usePressFeedback.js +6 -6
- package/dist/hooks/useScrollRegionProps.d.ts +35 -0
- package/dist/hooks/useScrollRegionProps.d.ts.map +1 -0
- package/dist/hooks/useScrollRegionProps.js +51 -0
- package/dist/i18n/InternationalizationContext.d.ts +6 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.d.ts +23 -3
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +8 -3
- package/dist/i18n/generated-english/DateInput/DateInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateInput/DateInput.generated.js +0 -1
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.js +16 -0
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.js +0 -1
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts +8 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.js +12 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +5 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +5 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/useCalendarSystem.d.ts +19 -0
- package/dist/i18n/useCalendarSystem.d.ts.map +1 -0
- package/dist/i18n/useCalendarSystem.js +61 -0
- package/dist/internal/calendar-system.d.ts +18 -0
- package/dist/internal/calendar-system.d.ts.map +1 -0
- package/dist/internal/calendar-system.js +19 -0
- package/dist/internal/spinner-rotor.d.ts +16 -0
- package/dist/internal/spinner-rotor.d.ts.map +1 -0
- package/dist/internal/spinner-rotor.js +16 -0
- package/dist/internal/touch.d.ts +20 -2
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +29 -3
- package/dist/motion/animator.d.ts +5 -5
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +7 -6
- package/dist/motion/carryAnimations.d.ts +58 -0
- package/dist/motion/carryAnimations.d.ts.map +1 -0
- package/dist/motion/carryAnimations.js +305 -0
- package/dist/motion/transientCopy.d.ts +4 -2
- package/dist/motion/transientCopy.d.ts.map +1 -1
- package/dist/motion/transientCopy.js +34 -5
- package/dist/motion/uikit/gestures.d.ts +41 -0
- package/dist/motion/uikit/gestures.d.ts.map +1 -1
- package/dist/motion/uikit/gestures.js +25 -0
- package/dist/motion/uikit/index.d.ts +1 -1
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +1 -1
- package/dist/motion/uikit/timing.d.ts +14 -10
- package/dist/motion/uikit/timing.d.ts.map +1 -1
- package/dist/motion/uikit/timing.js +7 -5
- package/dist/privateAttributes/menuPressLit.stylex.d.ts +52 -0
- package/dist/privateAttributes/menuPressLit.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/menuPressLit.stylex.js +99 -0
- package/dist/privateAttributes/press.stylex.d.ts +142 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/press.stylex.js +101 -0
- package/dist/theme/themeMotion.d.ts +3 -2
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +3 -2
- package/dist/theme/tokens.stylex.d.ts +2 -2
- package/dist/theme/tokens.stylex.js +1 -1
- package/dist/utils/calendarDateParser.d.ts +110 -0
- package/dist/utils/calendarDateParser.d.ts.map +1 -0
- package/dist/utils/calendarDateParser.js +1225 -0
- package/dist/utils/calendarSystem.d.ts +176 -0
- package/dist/utils/calendarSystem.d.ts.map +1 -0
- package/dist/utils/calendarSystem.js +569 -0
- package/dist/utils/coarsePointer.d.ts +5 -0
- package/dist/utils/coarsePointer.d.ts.map +1 -1
- package/dist/utils/coarsePointer.js +22 -13
- package/dist/utils/flatTree.d.ts +6 -3
- package/dist/utils/flatTree.d.ts.map +1 -1
- package/dist/utils/flatTree.js +13 -3
- package/dist/utils/focusReturn.d.ts +34 -13
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +64 -17
- package/dist/utils/hitArea.d.ts +8 -1
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +99 -9
- package/dist/utils/inputPresentation.d.ts +9 -1
- package/dist/utils/inputPresentation.d.ts.map +1 -1
- package/dist/utils/inputPresentation.js +15 -1
- package/dist/utils/inputStream.d.ts +14 -1
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +40 -9
- package/dist/utils/interactionOverlay.stylex.d.ts +5 -9
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +29 -31
- package/dist/utils/plainDate.d.ts +38 -7
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +92 -18
- package/dist/utils/pressFeedback.d.ts +10 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +40 -15
- package/dist/utils/pressGesture.d.ts +12 -6
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +26 -8
- package/dist/utils/scrollView.d.ts +25 -0
- package/dist/utils/scrollView.d.ts.map +1 -0
- package/dist/utils/scrollView.js +108 -0
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +1 -10
- package/dist/utils/touchHitArea.d.ts +30 -0
- package/dist/utils/touchHitArea.d.ts.map +1 -0
- package/dist/utils/touchHitArea.js +167 -0
- package/dist/utils/touchHitArea.stylex.d.ts +38 -0
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -0
- package/dist/utils/touchHitArea.stylex.js +48 -0
- package/dist/utils/triggerFocus.d.ts +5 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -1
- package/dist/utils/triggerFocus.js +9 -2
- package/locales/en.json +21 -1
- package/locales/pseudo.json +15 -0
- package/package.json +15 -4
- package/src/AppShell/observeMainOverflow.ts +9 -6
- package/src/BottomSheet/BottomSheet.tsx +45 -3
- package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
- package/src/BottomSheet/bottomSheetStack.ts +4 -3
- package/src/BottomSheet/useSheetGestures.ts +83 -20
- package/src/Calendar/Calendar.doc.mjs +76 -6
- package/src/Calendar/Calendar.tsx +123 -104
- package/src/Calendar/getInitialFocusDate.ts +22 -8
- package/src/Calendar/hooks/useCalendarDays.ts +89 -63
- package/src/Calendar/hooks/useCalendarNavigation.ts +68 -26
- package/src/CheckboxInput/CheckboxInput.doc.mjs +5 -4
- package/src/CheckboxInput/CheckboxInput.tsx +105 -20
- package/src/CheckboxInput/CheckboxRowPressContext.ts +22 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/CheckboxList/CheckboxListItem.tsx +35 -14
- package/src/ClickableCard/ClickableCard.tsx +8 -1
- package/src/ContextMenu/ContextMenu.tsx +2 -0
- package/src/DateInput/DateInput.doc.mjs +45 -12
- package/src/DateInput/DateInput.tsx +165 -179
- package/src/DateInput/MonthScroller.tsx +39 -37
- package/src/DateInput/MonthYearWheels.tsx +68 -47
- package/src/DateInput/PickerWheel.tsx +7 -2
- package/src/DateInput/TouchDateField.tsx +45 -17
- package/src/DateInput/monthGeometry.ts +110 -8
- package/src/DateInput/useCalendarPresentation.ts +64 -0
- package/src/DateInput/useTypedDate.ts +469 -0
- package/src/DateInput/wheelStrip.ts +2 -2
- package/src/DateRangeInput/DateRangeInput.doc.mjs +9 -0
- package/src/DateRangeInput/DateRangeInput.tsx +43 -9
- package/src/DateTimeInput/DateTimeInput.doc.mjs +42 -9
- package/src/DateTimeInput/DateTimeInput.tsx +138 -148
- package/src/DateTimeInput/TouchDateTimeField.tsx +31 -16
- package/src/Dialog/Dialog.doc.mjs +1 -1
- package/src/Dialog/Dialog.tsx +14 -2
- package/src/Drawer/Drawer.doc.mjs +1 -1
- package/src/Drawer/useDrawerDialogPresence.ts +9 -2
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -2
- package/src/DropdownMenu/DropdownMenu.tsx +31 -7
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuItem.tsx +8 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -1
- package/src/FileInput/FileInput.tsx +16 -2
- package/src/HoverCard/useHoverCard.tsx +3 -1
- package/src/Icon/useIcon.doc.mjs +94 -0
- package/src/InfoTip/InfoTip.doc.mjs +26 -2
- package/src/InfoTip/InfoTip.tsx +6 -27
- package/src/InputGroup/InputGroup.doc.mjs +4 -3
- package/src/InputGroup/InputGroup.tsx +4 -3
- package/src/InputGroup/InputGroupText.doc.mjs +45 -3
- package/src/InputGroup/InputGroupText.tsx +2 -1
- package/src/InputGroup/groupStyles.ts +3 -1
- package/src/Item/Item.tsx +139 -35
- package/src/Item/ItemListRowContext.tsx +18 -0
- package/src/Layer/holdEntranceInput.ts +84 -0
- package/src/Layer/inputHold.ts +734 -0
- package/src/Layer/outsidePress.ts +18 -1
- package/src/Layer/preserveAnimations.ts +12 -275
- package/src/Layer/useBackdropPress.ts +41 -1
- package/src/Layer/useLayer.tsx +77 -4
- package/src/Layer/useTouchTrigger.ts +4 -0
- package/src/Layout/LayoutContent.doc.mjs +6 -3
- package/src/Layout/LayoutContent.tsx +10 -4
- package/src/Layout/LayoutPanel.doc.mjs +14 -11
- package/src/Layout/LayoutPanel.tsx +113 -16
- package/src/Lightbox/Lightbox.tsx +4 -0
- package/src/List/List.doc.mjs +10 -1
- package/src/List/List.tsx +5 -0
- package/src/List/ListItem.tsx +63 -8
- package/src/Markdown/parser.ts +65 -42
- package/src/MetadataList/MetadataList.tsx +1 -1
- package/src/MobileNav/MobileNav.doc.mjs +3 -3
- package/src/MobileNav/MobileNav.tsx +39 -1
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -4
- package/src/MoreMenu/MoreMenu.tsx +5 -3
- package/src/MultiSelector/MultiSelector.tsx +7 -17
- package/src/NumberInput/NumberInput.doc.mjs +1 -1
- package/src/NumberInput/NumberInput.tsx +259 -11
- package/src/OverflowList/OverflowList.tsx +15 -9
- package/src/Popover/usePopover.tsx +1 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
- package/src/PowerSearch/PowerSearch.tsx +20 -3
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +4 -1
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -11
- package/src/PowerSearch/formatTokenValue.ts +7 -1
- package/src/RadioList/RadioListItem.doc.mjs +3 -2
- package/src/RadioList/RadioListItem.tsx +16 -6
- package/src/Resizable/Resizable.doc.mjs +40 -12
- package/src/Resizable/ResizeHandle.tsx +68 -6
- package/src/Resizable/resizablePane.ts +179 -0
- package/src/Resizable/useResizable.ts +15 -0
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +3 -3
- package/src/SelectableCard/SelectableCard.tsx +8 -1
- package/src/Selector/Selector.tsx +83 -8
- package/src/SideNav/SideNav.doc.mjs +2 -2
- package/src/SideNav/SideNav.tsx +87 -12
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +7 -89
- package/src/Spinner/index.ts +1 -5
- package/src/Spinner/spinnerRotor.ts +113 -0
- package/src/Stack/Stack.doc.mjs +1 -1
- package/src/Stack/StackItem.tsx +27 -13
- package/src/Switch/Switch.tsx +7 -6
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/TabList/Tab.tsx +5 -1
- package/src/Table/plugins/sortable/useTableSortable.tsx +1 -1
- package/src/Timestamp/Timestamp.doc.mjs +3 -3
- package/src/Timestamp/Timestamp.tsx +13 -8
- package/src/Timestamp/formatInstant.ts +49 -28
- package/src/Timestamp/tooltipEntries.ts +7 -3
- package/src/Token/Token.tsx +18 -1
- package/src/Token/TokenLink.tsx +7 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +3 -3
- package/src/Tokenizer/Tokenizer.tsx +252 -115
- package/src/Tooltip/useTooltip.tsx +180 -80
- package/src/TreeList/TreeListItem.tsx +36 -2
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
- package/src/animator/createAnimator.ts +3 -3
- package/src/gestures/GestureHost.ts +21 -5
- package/src/gestures/PanGestureRecognizer.ts +19 -2
- package/src/gestures/README.md +14 -5
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +6 -1
- package/src/gestures/nativeScroll.ts +12 -68
- package/src/gestures/wheelSegmenter.ts +243 -10
- package/src/hooks/StackItemScrollRegion.tsx +57 -0
- package/src/hooks/computeOverflow.ts +1 -1
- package/src/hooks/menuPressGesture.ts +244 -38
- package/src/hooks/menuPressValues.ts +18 -0
- package/src/hooks/useClickableContainer.doc.mjs +8 -2
- package/src/hooks/useClickableContainer.ts +93 -15
- package/src/hooks/useFocusTrap.ts +268 -151
- package/src/hooks/useKeyboardHighlight.ts +71 -0
- package/src/hooks/useMediaQuery.ts +41 -12
- package/src/hooks/useMenuPress.ts +118 -11
- package/src/hooks/useOverflow.ts +321 -75
- package/src/hooks/usePressFeedback.doc.mjs +3 -3
- package/src/hooks/usePressFeedback.ts +6 -6
- package/src/hooks/useScrollRegionProps.ts +76 -0
- package/src/i18n/InternationalizationContext.ts +6 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +29 -1
- package/src/i18n/InternationalizationProvider.tsx +35 -3
- package/src/i18n/generated-english/DateInput/DateInput.generated.ts +0 -1
- package/src/i18n/generated-english/DateInput/useTypedDate.generated.ts +17 -0
- package/src/i18n/generated-english/DateTimeInput/DateTimeInput.generated.ts +0 -1
- package/src/i18n/generated-english/hooks/useScrollRegionProps.generated.ts +13 -0
- package/src/i18n/generated-locales/en.generated.ts +7 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +7 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/useCalendarSystem.ts +95 -0
- package/src/internal/calendar-system.ts +26 -0
- package/src/internal/spinner-rotor.ts +20 -0
- package/src/internal/touch.ts +43 -2
- package/src/motion/MEASUREMENTS.md +11 -0
- package/src/motion/README.md +3 -3
- package/src/motion/animator.ts +7 -7
- package/src/motion/carryAnimations.ts +389 -0
- package/src/motion/transientCopy.ts +45 -5
- package/src/motion/uikit/gestures.ts +22 -0
- package/src/motion/uikit/index.ts +1 -0
- package/src/motion/uikit/timing.ts +7 -5
- package/src/privateAttributes/menuPressLit.stylex.ts +104 -0
- package/src/privateAttributes/press.stylex.ts +261 -0
- package/src/theme/themeMotion.ts +3 -2
- package/src/theme/tokens.stylex.ts +1 -1
- package/src/utils/calendarDateParser.ts +1385 -0
- package/src/utils/calendarSystem.ts +832 -0
- package/src/utils/coarsePointer.ts +27 -14
- package/src/utils/flatTree.ts +15 -3
- package/src/utils/focusReturn.ts +78 -18
- package/src/utils/hitArea.ts +138 -9
- package/src/utils/inputPresentation.ts +21 -1
- package/src/utils/inputStream.ts +47 -10
- package/src/utils/interactionOverlay.stylex.ts +19 -22
- package/src/utils/plainDate.ts +130 -19
- package/src/utils/pressFeedback.ts +46 -14
- package/src/utils/pressGesture.ts +35 -9
- package/src/utils/scrollView.ts +135 -0
- package/src/utils/selectionLock.ts +5 -10
- package/src/utils/touchHitArea.stylex.ts +56 -0
- package/src/utils/touchHitArea.ts +177 -0
- package/src/utils/triggerFocus.ts +17 -4
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DateInput.tsx
|
|
7
|
-
* @input Uses React, useId,
|
|
7
|
+
* @input Uses React, useId, useCallback, useRef, useTypedDateField, Field, Icon, Calendar, usePopover, InputGroupContext
|
|
8
8
|
* @output Exports DateInput component, DateInputProps
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by DateInput.test.tsx
|
|
10
10
|
*
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
import {
|
|
20
20
|
use,
|
|
21
21
|
useId,
|
|
22
|
-
useState,
|
|
23
22
|
useCallback,
|
|
24
23
|
useRef,
|
|
25
24
|
useOptimistic,
|
|
@@ -66,24 +65,23 @@ import {usePopover} from '../Popover';
|
|
|
66
65
|
import {
|
|
67
66
|
isFocusInsideOwnedLayer,
|
|
68
67
|
isPressInsideOwnedLayer,
|
|
68
|
+
noteOutsideDismissal,
|
|
69
69
|
useOutsidePress,
|
|
70
70
|
} from '../Layer/outsidePress';
|
|
71
71
|
import {NativeDateField} from './NativeDateField';
|
|
72
72
|
import {TouchDateField} from './TouchDateField';
|
|
73
73
|
import {useTooltip} from '../Tooltip';
|
|
74
|
-
import {getInputARIA, isImeKeyEvent
|
|
74
|
+
import {getInputARIA, isImeKeyEvent} from '../utils';
|
|
75
75
|
import {chainEventHandlers} from '../utils/chainEventHandlers';
|
|
76
|
-
import {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
formatSharedDate,
|
|
80
|
-
} from '../utils/plainDate';
|
|
76
|
+
import type {CalendarSystem} from '../utils/calendarSystem';
|
|
77
|
+
import {isRenderable} from '../utils/isRenderable';
|
|
78
|
+
import {useTypedDateField} from './useTypedDate';
|
|
81
79
|
import type {TimestampFormat} from '../Timestamp';
|
|
82
80
|
import {
|
|
83
|
-
effectivePickerPresentation,
|
|
84
81
|
resolvePickerPresentation,
|
|
85
82
|
type PickerPresentation,
|
|
86
83
|
} from '../utils/inputPresentation';
|
|
84
|
+
import {useCalendarPresentation} from './useCalendarPresentation';
|
|
87
85
|
import {useDevWarning} from '../hooks/useDevWarning';
|
|
88
86
|
|
|
89
87
|
const styles = stylex.create({
|
|
@@ -204,7 +202,6 @@ import {
|
|
|
204
202
|
import type {SizeValue} from '../utils/types';
|
|
205
203
|
import {themeProps} from '../utils/themeProps';
|
|
206
204
|
import {focusOutlineStyles} from '../utils/focusOutline.stylex';
|
|
207
|
-
import {useLocale} from '../i18n';
|
|
208
205
|
|
|
209
206
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
210
207
|
import type {FieldStatusPlacement} from '../Field/fieldStatusPlacement';
|
|
@@ -318,7 +315,8 @@ export interface DateInputProps extends Omit<
|
|
|
318
315
|
dateConstraints?: ReadonlyArray<(date: Date) => boolean>;
|
|
319
316
|
|
|
320
317
|
/**
|
|
321
|
-
* Placeholder text shown when no date is selected.
|
|
318
|
+
* Placeholder text shown when no date is selected. A caller placeholder
|
|
319
|
+
* replaces the calendar format hint.
|
|
322
320
|
* @default "Select a date"
|
|
323
321
|
*/
|
|
324
322
|
placeholder?: string;
|
|
@@ -391,9 +389,10 @@ export interface DateInputProps extends Omit<
|
|
|
391
389
|
* - `(value: ISODateString) => string`: fully custom display string
|
|
392
390
|
*
|
|
393
391
|
* Formatting applies only to the committed value — never to text the user is
|
|
394
|
-
* actively typing.
|
|
395
|
-
*
|
|
396
|
-
*
|
|
392
|
+
* actively typing. Named formats write the date in the field's `calendar`;
|
|
393
|
+
* `'system_date'` stays the Gregorian ISO date. A custom function's output
|
|
394
|
+
* that the field cannot read back can't be re-committed after an edit;
|
|
395
|
+
* external `value` changes always recompute the display from the ISO value.
|
|
397
396
|
*
|
|
398
397
|
* @default 'date_long'
|
|
399
398
|
* @example
|
|
@@ -409,6 +408,29 @@ export interface DateInputProps extends Omit<
|
|
|
409
408
|
*/
|
|
410
409
|
format?: DateInputFormat | ((value: ISODateString) => string);
|
|
411
410
|
|
|
411
|
+
/**
|
|
412
|
+
* The calendar the field shows dates in, such as `'persian'`, `'hebrew'`, or
|
|
413
|
+
* `'buddhist'`: the text field, its calendar popover, and the bottom sheet's
|
|
414
|
+
* months and wheels. `value`, `onChange`, `min`, and `max` stay Gregorian
|
|
415
|
+
* ISO dates in every calendar. People type a date the way the locale writes
|
|
416
|
+
* it in this calendar, and the committed text uses it.
|
|
417
|
+
* Years are years of this calendar, so a Buddhist field reads `2026` as
|
|
418
|
+
* Buddhist year 2026; set `min` and `max` to catch a year typed in the
|
|
419
|
+
* wrong calendar. Calendars other than `gregory`, `iso8601`, `buddhist`,
|
|
420
|
+
* `roc`, and `japanese` need `Temporal`, native or a polyfill the
|
|
421
|
+
* application loads; without it the field uses the Gregorian calendar.
|
|
422
|
+
* The native date control is Gregorian, so with a calendar other than
|
|
423
|
+
* `gregory` or `iso8601` every presentation that would show it uses the
|
|
424
|
+
* popover on a fine pointer and the bottom sheet on a coarse pointer.
|
|
425
|
+
*
|
|
426
|
+
* @default the InternationalizationProvider's calendar, else `'gregory'`
|
|
427
|
+
* @example
|
|
428
|
+
* ```
|
|
429
|
+
* <DateInput label="Start date" calendar="persian" value={date} onChange={setDate} />
|
|
430
|
+
* ```
|
|
431
|
+
*/
|
|
432
|
+
calendar?: CalendarSystem;
|
|
433
|
+
|
|
412
434
|
/**
|
|
413
435
|
* When date picking is handed to the browser/OS instead of Astryx's own
|
|
414
436
|
* surfaces: the field becomes an `<input type="date">` and the platform
|
|
@@ -434,6 +456,9 @@ export interface DateInputProps extends Omit<
|
|
|
434
456
|
* picker. `dateConstraints` is enforced the same way, on commit, and is
|
|
435
457
|
* reason enough to prefer `'never'` on a field that uses it.
|
|
436
458
|
*
|
|
459
|
+
* In a calendar other than `gregory` or `iso8601`, `'touch'` and `'always'`
|
|
460
|
+
* use the calendar popover on a mouse and the touch picker on a finger.
|
|
461
|
+
*
|
|
437
462
|
* @default 'touch'
|
|
438
463
|
* @deprecated Use `presentation` (`spec:AST-043` FR3):
|
|
439
464
|
* `'touch'` → `'adaptive-native'`, `'always'` → `'native'`,
|
|
@@ -449,12 +474,15 @@ export interface DateInputProps extends Omit<
|
|
|
449
474
|
* - `'popover'`: Astryx's typed field + calendar popover on every pointer
|
|
450
475
|
* - `'bottom-sheet'`: Astryx's bottom-sheet calendar on every pointer
|
|
451
476
|
* - `'native'`: the browser/OS picker on every pointer, with no Astryx
|
|
452
|
-
* fallback (FR2)
|
|
477
|
+
* fallback (FR2), except in a calendar other than `gregory` or
|
|
478
|
+
* `iso8601`, where it is `'adaptive-bottom-sheet'` and warns in
|
|
479
|
+
* development
|
|
453
480
|
* - `'adaptive-bottom-sheet'`: popover on a fine pointer, bottom sheet on
|
|
454
481
|
* a coarse pointer
|
|
455
482
|
* - `'adaptive-native'` (default): popover on a fine pointer, browser/OS
|
|
456
483
|
* picker on a coarse pointer, keeping the released Astryx fallbacks
|
|
457
|
-
* where a native control cannot express the value (FR2)
|
|
484
|
+
* where a native control cannot express the value (FR2), and the bottom
|
|
485
|
+
* sheet in a calendar other than `gregory` or `iso8601`
|
|
458
486
|
*
|
|
459
487
|
* @default 'adaptive-native'
|
|
460
488
|
*/
|
|
@@ -523,6 +551,7 @@ function PointerDateField({
|
|
|
523
551
|
numberOfMonths = 1,
|
|
524
552
|
weekStartsOn,
|
|
525
553
|
format = 'date_long',
|
|
554
|
+
calendar,
|
|
526
555
|
width,
|
|
527
556
|
containerXstyle,
|
|
528
557
|
containerClassName,
|
|
@@ -544,11 +573,11 @@ function PointerDateField({
|
|
|
544
573
|
'aria-labelledby': ariaLabelledByProp,
|
|
545
574
|
onBlur: onBlurProp,
|
|
546
575
|
onClick: onClickProp,
|
|
576
|
+
onFocus: onFocusProp,
|
|
547
577
|
onKeyDown: onKeyDownProp,
|
|
548
578
|
...controlProps
|
|
549
579
|
} = rest;
|
|
550
580
|
const t = useComponentTranslator();
|
|
551
|
-
const locale = useLocale();
|
|
552
581
|
const isEffectivelyRequired = useResolvedRequired({isRequired, isOptional});
|
|
553
582
|
const placeholder =
|
|
554
583
|
placeholderFromProps ?? t('@astryx.dateInput.placeholder');
|
|
@@ -559,9 +588,9 @@ function PointerDateField({
|
|
|
559
588
|
const inputLabelID = useId();
|
|
560
589
|
const descriptionID = useId();
|
|
561
590
|
const statusMessageID = useId();
|
|
591
|
+
const calendarDescriptionID = useId();
|
|
562
592
|
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
563
593
|
const calendarRef = useRef<CalendarHandle | null>(null);
|
|
564
|
-
const lastFiredValueRef = useRef<ISODateString | undefined>(undefined);
|
|
565
594
|
const inputGroup = useInputGroup();
|
|
566
595
|
|
|
567
596
|
const [, startTransition] = useTransition();
|
|
@@ -591,9 +620,70 @@ function PointerDateField({
|
|
|
591
620
|
// Constraint checking for text input validation (reuses calendar logic)
|
|
592
621
|
const {isDateDisabled} = useCalendarConstraints({min, max, dateConstraints});
|
|
593
622
|
|
|
623
|
+
const fireChange = useCallback(
|
|
624
|
+
(newValue: ISODateString | undefined) => {
|
|
625
|
+
if (isEffectivelyDisabled) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
onChange?.(newValue);
|
|
629
|
+
if (changeAction) {
|
|
630
|
+
startTransition(async () => {
|
|
631
|
+
setOptimisticValue(newValue);
|
|
632
|
+
await changeAction(newValue);
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
[
|
|
637
|
+
isEffectivelyDisabled,
|
|
638
|
+
onChange,
|
|
639
|
+
changeAction,
|
|
640
|
+
startTransition,
|
|
641
|
+
setOptimisticValue,
|
|
642
|
+
],
|
|
643
|
+
);
|
|
644
|
+
|
|
645
|
+
const clearTypedDate = useCallback(() => {
|
|
646
|
+
if (value !== undefined) {
|
|
647
|
+
fireChange(undefined);
|
|
648
|
+
}
|
|
649
|
+
}, [value, fireChange]);
|
|
650
|
+
const navigateToTypedDate = useCallback((date: ISODateString) => {
|
|
651
|
+
calendarRef.current?.navigateTo(date);
|
|
652
|
+
}, []);
|
|
653
|
+
const {
|
|
654
|
+
typedDate,
|
|
655
|
+
displayValue,
|
|
656
|
+
formatHint,
|
|
657
|
+
isPending,
|
|
658
|
+
isInvalid,
|
|
659
|
+
fieldStatus,
|
|
660
|
+
alertMessage,
|
|
661
|
+
handleChange: handleTypedChange,
|
|
662
|
+
commit: commitPendingInput,
|
|
663
|
+
handleFocus,
|
|
664
|
+
handleBlur,
|
|
665
|
+
reset: resetTypedInput,
|
|
666
|
+
} = useTypedDateField({
|
|
667
|
+
source: 'DateInput',
|
|
668
|
+
calendar,
|
|
669
|
+
format,
|
|
670
|
+
min,
|
|
671
|
+
max,
|
|
672
|
+
isDateDisabled,
|
|
673
|
+
value,
|
|
674
|
+
shownValue: optimisticValue,
|
|
675
|
+
onChange: fireChange,
|
|
676
|
+
onClear: clearTypedDate,
|
|
677
|
+
onTypedDate: navigateToTypedDate,
|
|
678
|
+
isDisabled: isEffectivelyDisabled,
|
|
679
|
+
status,
|
|
680
|
+
isStatusAnnounced: !inputGroup,
|
|
681
|
+
hasPlaceholder: placeholderFromProps != null,
|
|
682
|
+
});
|
|
683
|
+
|
|
594
684
|
const {statusIcon, describedBy: statusTooltipDescribedBy} =
|
|
595
685
|
useInputStatusIcon({
|
|
596
|
-
status,
|
|
686
|
+
status: fieldStatus,
|
|
597
687
|
statusVariant,
|
|
598
688
|
isInGroup: !!inputGroup,
|
|
599
689
|
});
|
|
@@ -602,7 +692,10 @@ function PointerDateField({
|
|
|
602
692
|
inputLabelID,
|
|
603
693
|
[
|
|
604
694
|
description ? descriptionID : null,
|
|
605
|
-
|
|
695
|
+
typedDate.calendarDescription != null ? calendarDescriptionID : null,
|
|
696
|
+
statusVariant !== 'tooltip' && fieldStatus?.message
|
|
697
|
+
? statusMessageID
|
|
698
|
+
: null,
|
|
606
699
|
// The tooltip variant renders no message box; describe the input by the
|
|
607
700
|
// tooltip's content instead so the status is still announced.
|
|
608
701
|
statusTooltipDescribedBy,
|
|
@@ -612,50 +705,6 @@ function PointerDateField({
|
|
|
612
705
|
inputGroup,
|
|
613
706
|
);
|
|
614
707
|
|
|
615
|
-
// Pending input while user is typing (null = show formatted value)
|
|
616
|
-
const [pendingInput, setPendingInput] = useState<string | null>(null);
|
|
617
|
-
|
|
618
|
-
// Clear pending input when value changes externally (computed during render
|
|
619
|
-
// via prev-value ref instead of useEffect to avoid an extra render cycle)
|
|
620
|
-
const prevValueRef = useRef(value);
|
|
621
|
-
if (value !== prevValueRef.current) {
|
|
622
|
-
prevValueRef.current = value;
|
|
623
|
-
if (value !== lastFiredValueRef.current) {
|
|
624
|
-
lastFiredValueRef.current = undefined;
|
|
625
|
-
if (pendingInput !== null) {
|
|
626
|
-
setPendingInput(null);
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// Format a committed ISO value for display. The default `date_long` renders
|
|
632
|
-
// the long-month shape (byte-identical to the historical hardcoded
|
|
633
|
-
// DATE_FORMAT_LONG rendering, so still non-breaking); a function is called
|
|
634
|
-
// with the ISO value; every other named member reuses Timestamp's shared
|
|
635
|
-
// date mapping. Applies ONLY to the committed value, never to in-progress
|
|
636
|
-
// typed input.
|
|
637
|
-
const formatCommittedValue = useCallback(
|
|
638
|
-
(iso: ISODateString): string =>
|
|
639
|
-
typeof format === 'function'
|
|
640
|
-
? format(iso)
|
|
641
|
-
: formatSharedDate(plainDateFromISO(iso), format, locale),
|
|
642
|
-
[format, locale],
|
|
643
|
-
);
|
|
644
|
-
|
|
645
|
-
// Display value: pending input if typing, otherwise formatted value
|
|
646
|
-
const displayValue =
|
|
647
|
-
pendingInput !== null
|
|
648
|
-
? pendingInput
|
|
649
|
-
: optimisticValue && /^\d{4}-\d{2}-\d{2}$/.test(optimisticValue)
|
|
650
|
-
? formatCommittedValue(optimisticValue)
|
|
651
|
-
: '';
|
|
652
|
-
|
|
653
|
-
// Check if current input is valid (for styling purposes)
|
|
654
|
-
const isInputValid =
|
|
655
|
-
pendingInput === null || !pendingInput.trim()
|
|
656
|
-
? true
|
|
657
|
-
: parseDateInput(pendingInput, locale) !== null;
|
|
658
|
-
|
|
659
708
|
const fieldElementRef = useRef<HTMLDivElement | null>(null);
|
|
660
709
|
// Set just before a close that focus already left the field for, so onHide
|
|
661
710
|
// does not pull focus back to the input.
|
|
@@ -717,29 +766,6 @@ function PointerDateField({
|
|
|
717
766
|
}
|
|
718
767
|
}, [isEffectivelyDisabled, popover]);
|
|
719
768
|
|
|
720
|
-
// Unified change handler that fires both onChange and changeAction
|
|
721
|
-
const fireChange = useCallback(
|
|
722
|
-
(newValue: ISODateString | undefined) => {
|
|
723
|
-
if (isEffectivelyDisabled) {
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
onChange?.(newValue);
|
|
727
|
-
if (changeAction) {
|
|
728
|
-
startTransition(async () => {
|
|
729
|
-
setOptimisticValue(newValue);
|
|
730
|
-
await changeAction(newValue);
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
},
|
|
734
|
-
[
|
|
735
|
-
isEffectivelyDisabled,
|
|
736
|
-
onChange,
|
|
737
|
-
changeAction,
|
|
738
|
-
startTransition,
|
|
739
|
-
setOptimisticValue,
|
|
740
|
-
],
|
|
741
|
-
);
|
|
742
|
-
|
|
743
769
|
// Handle clear button click
|
|
744
770
|
const handleClear = useCallback(
|
|
745
771
|
(e?: React.MouseEvent<HTMLButtonElement>) => {
|
|
@@ -766,81 +792,19 @@ function PointerDateField({
|
|
|
766
792
|
return;
|
|
767
793
|
}
|
|
768
794
|
fireChange(selectedDate);
|
|
769
|
-
|
|
795
|
+
resetTypedInput();
|
|
770
796
|
popover.hide();
|
|
771
797
|
},
|
|
772
|
-
[isDisabled, fireChange, popover],
|
|
798
|
+
[isDisabled, fireChange, resetTypedInput, popover],
|
|
773
799
|
);
|
|
774
800
|
|
|
775
|
-
// Handle input text change - update immediately if valid and allowed
|
|
776
801
|
const handleInputChange = useCallback(
|
|
777
802
|
(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
778
|
-
|
|
779
|
-
// value mutation explicitly (readOnly also blocks typing).
|
|
780
|
-
if (isEffectivelyDisabled) {
|
|
781
|
-
return;
|
|
782
|
-
}
|
|
783
|
-
const newValue = e.target.value;
|
|
784
|
-
setPendingInput(newValue);
|
|
785
|
-
|
|
786
|
-
// If the input is valid and passes constraints, update immediately
|
|
787
|
-
const parsed = parseDateInput(newValue, locale);
|
|
788
|
-
if (
|
|
789
|
-
parsed &&
|
|
790
|
-
plainDateToISO(parsed) !== value &&
|
|
791
|
-
!isDateDisabled(parsed)
|
|
792
|
-
) {
|
|
793
|
-
const parsedISO = plainDateToISO(parsed);
|
|
794
|
-
lastFiredValueRef.current = parsedISO;
|
|
795
|
-
fireChange(parsedISO);
|
|
796
|
-
// Navigate calendar to show the parsed date's month
|
|
797
|
-
calendarRef.current?.navigateTo(parsedISO);
|
|
798
|
-
}
|
|
803
|
+
handleTypedChange(e.target.value);
|
|
799
804
|
},
|
|
800
|
-
[
|
|
805
|
+
[handleTypedChange],
|
|
801
806
|
);
|
|
802
807
|
|
|
803
|
-
// Commit pending input (shared by blur and Enter key)
|
|
804
|
-
const commitPendingInput = useCallback(() => {
|
|
805
|
-
if (pendingInput === null) {
|
|
806
|
-
return;
|
|
807
|
-
}
|
|
808
|
-
// Disabled or busy: keep the value, drop the draft (spec:AST-085 FR2).
|
|
809
|
-
if (isEffectivelyDisabled) {
|
|
810
|
-
setPendingInput(null);
|
|
811
|
-
return;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
if (!pendingInput.trim()) {
|
|
815
|
-
if (value !== undefined) {
|
|
816
|
-
fireChange(undefined);
|
|
817
|
-
}
|
|
818
|
-
setPendingInput(null);
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
const parsed = parseDateInput(pendingInput, locale);
|
|
823
|
-
if (parsed && !isDateDisabled(parsed)) {
|
|
824
|
-
const parsedISO = plainDateToISO(parsed);
|
|
825
|
-
if (parsedISO !== value) {
|
|
826
|
-
fireChange(parsedISO);
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
setPendingInput(null);
|
|
830
|
-
}, [
|
|
831
|
-
pendingInput,
|
|
832
|
-
isEffectivelyDisabled,
|
|
833
|
-
value,
|
|
834
|
-
fireChange,
|
|
835
|
-
isDateDisabled,
|
|
836
|
-
locale,
|
|
837
|
-
]);
|
|
838
|
-
|
|
839
|
-
// Handle blur - validate, check constraints, and clear pending input.
|
|
840
|
-
const handleBlur = useCallback(() => {
|
|
841
|
-
commitPendingInput();
|
|
842
|
-
}, [commitPendingInput]);
|
|
843
|
-
|
|
844
808
|
// A manual popover has no auto-popover exclusivity, so without this close
|
|
845
809
|
// the next field's calendar would open beside this one. Focus going nowhere
|
|
846
810
|
// (a window switch) leaves it open.
|
|
@@ -855,6 +819,7 @@ function PointerDateField({
|
|
|
855
819
|
return;
|
|
856
820
|
}
|
|
857
821
|
isFocusMovingAwayRef.current = true;
|
|
822
|
+
noteOutsideDismissal(e.currentTarget.ownerDocument);
|
|
858
823
|
popover.hide();
|
|
859
824
|
},
|
|
860
825
|
[popover],
|
|
@@ -884,10 +849,7 @@ function PointerDateField({
|
|
|
884
849
|
if (!isEffectivelyDisabled) {
|
|
885
850
|
popover.show({skipAutoFocus: true});
|
|
886
851
|
}
|
|
887
|
-
} else if (
|
|
888
|
-
e.key === 'Enter' &&
|
|
889
|
-
(pendingInput !== null || isEffectivelyDisabled)
|
|
890
|
-
) {
|
|
852
|
+
} else if (e.key === 'Enter' && (isPending || isEffectivelyDisabled)) {
|
|
891
853
|
// Typed text holds Enter back, or a form would submit the value from
|
|
892
854
|
// before the commit. A disabled or busy field must not submit its
|
|
893
855
|
// form either. Otherwise Enter keeps its default, as in any text field.
|
|
@@ -895,7 +857,7 @@ function PointerDateField({
|
|
|
895
857
|
commitPendingInput();
|
|
896
858
|
}
|
|
897
859
|
},
|
|
898
|
-
[popover, commitPendingInput, isEffectivelyDisabled,
|
|
860
|
+
[popover, commitPendingInput, isEffectivelyDisabled, isPending],
|
|
899
861
|
);
|
|
900
862
|
|
|
901
863
|
const inputWrapper = (
|
|
@@ -913,7 +875,7 @@ function PointerDateField({
|
|
|
913
875
|
{...mergeProps(
|
|
914
876
|
themeProps('date-input', {
|
|
915
877
|
size,
|
|
916
|
-
status:
|
|
878
|
+
status: fieldStatus?.type ?? null,
|
|
917
879
|
disabled: isDisabled ? 'disabled' : null,
|
|
918
880
|
}),
|
|
919
881
|
stylex.props(
|
|
@@ -924,11 +886,11 @@ function PointerDateField({
|
|
|
924
886
|
// FR6, family:buttons FR4).
|
|
925
887
|
isDisabled && inputWrapperStyles.disabled,
|
|
926
888
|
isEffectivelyDisabled && inputDisabledFocusStyles.inputFocusRing,
|
|
927
|
-
|
|
928
|
-
|
|
889
|
+
fieldStatus && inputStatusBorderStyles[fieldStatus.type],
|
|
890
|
+
fieldStatus &&
|
|
929
891
|
!isEffectivelyDisabled &&
|
|
930
|
-
inputStatusHoverShadowStyles[
|
|
931
|
-
|
|
892
|
+
inputStatusHoverShadowStyles[fieldStatus.type],
|
|
893
|
+
fieldStatus && inputStatusFocusWithinStyles[fieldStatus.type],
|
|
932
894
|
inputGroup && groupStyles.inGroup,
|
|
933
895
|
controlXstyle,
|
|
934
896
|
),
|
|
@@ -978,13 +940,14 @@ function PointerDateField({
|
|
|
978
940
|
value={displayValue}
|
|
979
941
|
onChange={handleInputChange}
|
|
980
942
|
onBlur={chainEventHandlers(handleBlur, onBlurProp)}
|
|
943
|
+
onFocus={chainEventHandlers(handleFocus, onFocusProp)}
|
|
981
944
|
onClick={
|
|
982
945
|
isEffectivelyDisabled
|
|
983
946
|
? undefined
|
|
984
947
|
: chainEventHandlers(handleInputClick, onClickProp)
|
|
985
948
|
}
|
|
986
949
|
onKeyDown={chainEventHandlers(handleInputKeyDown, onKeyDownProp)}
|
|
987
|
-
placeholder={placeholder}
|
|
950
|
+
placeholder={formatHint ?? placeholder}
|
|
988
951
|
aria-disabled={isEffectivelyDisabled ? 'true' : undefined}
|
|
989
952
|
readOnly={isEffectivelyDisabled || undefined}
|
|
990
953
|
aria-labelledby={
|
|
@@ -995,7 +958,7 @@ function PointerDateField({
|
|
|
995
958
|
aria-describedby={ariaDescribedBy}
|
|
996
959
|
aria-required={isEffectivelyRequired ? 'true' : undefined}
|
|
997
960
|
aria-invalid={
|
|
998
|
-
|
|
961
|
+
fieldStatus?.type === 'error' || isInvalid ? 'true' : undefined
|
|
999
962
|
}
|
|
1000
963
|
aria-busy={isBusy || undefined}
|
|
1001
964
|
aria-expanded={popover.isOpen}
|
|
@@ -1006,17 +969,21 @@ function PointerDateField({
|
|
|
1006
969
|
{...stylex.props(
|
|
1007
970
|
styles.input,
|
|
1008
971
|
isEffectivelyDisabled && styles.inputDisabled,
|
|
1009
|
-
|
|
972
|
+
isInvalid && styles.inputInvalid,
|
|
1010
973
|
)}
|
|
1011
974
|
/>
|
|
1012
975
|
{/*
|
|
1013
|
-
|
|
1014
|
-
The
|
|
1015
|
-
user would get no feedback that their entry was rejected (WCAG 3.3.1).
|
|
976
|
+
Announces a typed rejection that the field status does not announce.
|
|
977
|
+
The field status announces the rest.
|
|
1016
978
|
*/}
|
|
1017
979
|
<VisuallyHidden as="div" role="alert" aria-live="assertive">
|
|
1018
|
-
{
|
|
980
|
+
{alertMessage}
|
|
1019
981
|
</VisuallyHidden>
|
|
982
|
+
{isRenderable(typedDate.calendarDescription) && (
|
|
983
|
+
<VisuallyHidden id={calendarDescriptionID}>
|
|
984
|
+
{typedDate.calendarDescription}
|
|
985
|
+
</VisuallyHidden>
|
|
986
|
+
)}
|
|
1020
987
|
{hasClear && value !== undefined && !isEffectivelyDisabled && (
|
|
1021
988
|
<InputClearButton
|
|
1022
989
|
label={t('@astryx.dateInput.clear', {label})}
|
|
@@ -1031,6 +998,7 @@ function PointerDateField({
|
|
|
1031
998
|
!popover.isOpen ? null : (
|
|
1032
999
|
<Calendar
|
|
1033
1000
|
handleRef={calendarRef}
|
|
1001
|
+
calendar={typedDate.calendar}
|
|
1034
1002
|
mode="single"
|
|
1035
1003
|
value={optimisticValue ?? null}
|
|
1036
1004
|
onChange={handleDateSelect}
|
|
@@ -1065,11 +1033,11 @@ function PointerDateField({
|
|
|
1065
1033
|
isRequired={isRequired}
|
|
1066
1034
|
isDisabled={isDisabled}
|
|
1067
1035
|
status={
|
|
1068
|
-
|
|
1036
|
+
fieldStatus
|
|
1069
1037
|
? {
|
|
1070
|
-
type:
|
|
1071
|
-
message:
|
|
1072
|
-
messageID:
|
|
1038
|
+
type: fieldStatus.type,
|
|
1039
|
+
message: fieldStatus.message,
|
|
1040
|
+
messageID: fieldStatus.message ? statusMessageID : undefined,
|
|
1073
1041
|
}
|
|
1074
1042
|
: undefined
|
|
1075
1043
|
}
|
|
@@ -1138,22 +1106,40 @@ export function DateInput(props: DateInputProps) {
|
|
|
1138
1106
|
'`nativePicker` is deprecated; use `presentation` instead (`touch` → `adaptive-native`, `always` → `native`, `never` → `adaptive-bottom-sheet`). `presentation` wins when both are set.',
|
|
1139
1107
|
props.nativePicker !== undefined,
|
|
1140
1108
|
);
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
|
|
1109
|
+
const {calendar, presentation} = useCalendarPresentation(
|
|
1110
|
+
'DateInput',
|
|
1111
|
+
props.calendar,
|
|
1112
|
+
props.presentation,
|
|
1113
|
+
props.nativePicker,
|
|
1144
1114
|
);
|
|
1115
|
+
const surface = resolvePickerPresentation(presentation, isTouch);
|
|
1145
1116
|
const {
|
|
1146
1117
|
presentation: _presentation,
|
|
1147
1118
|
nativePicker: _nativePicker,
|
|
1119
|
+
calendar: _calendar,
|
|
1148
1120
|
...rest
|
|
1149
1121
|
} = props;
|
|
1150
1122
|
switch (surface) {
|
|
1151
1123
|
case 'native':
|
|
1152
1124
|
return <NativeDateField {...rest} isDisabled={isDisabled} />;
|
|
1153
1125
|
case 'sheet':
|
|
1154
|
-
return
|
|
1126
|
+
return (
|
|
1127
|
+
<TouchDateField
|
|
1128
|
+
// Month indexes depend on the calendar. A new calendar remounts the sheet.
|
|
1129
|
+
key={calendar}
|
|
1130
|
+
{...rest}
|
|
1131
|
+
calendar={calendar}
|
|
1132
|
+
isDisabled={isDisabled}
|
|
1133
|
+
/>
|
|
1134
|
+
);
|
|
1155
1135
|
case 'desktop':
|
|
1156
|
-
return
|
|
1136
|
+
return (
|
|
1137
|
+
<PointerDateField
|
|
1138
|
+
{...rest}
|
|
1139
|
+
calendar={calendar}
|
|
1140
|
+
isDisabled={isDisabled}
|
|
1141
|
+
/>
|
|
1142
|
+
);
|
|
1157
1143
|
}
|
|
1158
1144
|
}
|
|
1159
1145
|
|