@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
|
@@ -39,6 +39,11 @@ export const docs = {
|
|
|
39
39
|
description:
|
|
40
40
|
'Show two months side by side when the user frequently selects dates that span a month boundary.',
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
guidance: true,
|
|
44
|
+
description:
|
|
45
|
+
'For a custom month view, use useCalendarNavigation and useCalendarDays from @astryxdesign/core/Calendar. To show another calendar system, pass the same calendar to both and feed visibleCalendarMonths into useCalendarDays. The hooks default to gregory and never read the InternationalizationProvider calendar.',
|
|
46
|
+
},
|
|
42
47
|
{
|
|
43
48
|
guidance: false,
|
|
44
49
|
description:
|
|
@@ -169,13 +174,15 @@ export const docs = {
|
|
|
169
174
|
{
|
|
170
175
|
name: 'hasWeekNumbers',
|
|
171
176
|
type: 'boolean',
|
|
172
|
-
description:
|
|
177
|
+
description:
|
|
178
|
+
'Show ISO 8601 week numbers. They are ISO 8601 week numbers in every calendar system.',
|
|
173
179
|
default: 'false',
|
|
174
180
|
},
|
|
175
181
|
{
|
|
176
182
|
name: 'hasVariableRowCount',
|
|
177
183
|
type: 'boolean',
|
|
178
|
-
description:
|
|
184
|
+
description:
|
|
185
|
+
'Give each month only the rows it needs. The default fixed 6-row grid keeps the same height from month to month; a variable row count trades that fixed height for a more compact grid.',
|
|
179
186
|
default: 'false',
|
|
180
187
|
},
|
|
181
188
|
{
|
|
@@ -185,6 +192,48 @@ export const docs = {
|
|
|
185
192
|
'First day of week. Accepts a number (0=Sunday) or a three-letter day name (e.g. "mon").',
|
|
186
193
|
default: '0',
|
|
187
194
|
},
|
|
195
|
+
{
|
|
196
|
+
name: 'calendar',
|
|
197
|
+
type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'",
|
|
198
|
+
description:
|
|
199
|
+
"Calendar system the grid shows, such as 'persian', 'hebrew', or 'islamic-umalqura'. It sets the months, their names, and month and year navigation. value, min, max, focusDate, and every callback stay Gregorian ISO dates. Calendars other than gregory, iso8601, buddhist, roc, and japanese need Temporal; where the runtime lacks it, load a polyfill such as temporal-polyfill/full/global on the server and in the browser, or the grid shows Gregorian months. Month starts in the Chinese and Dangi calendars come from the runtime's Temporal, and some polyfills start a few months one day apart from native Temporal; when server and browser markup must match, use one implementation on both sides, such as installImplementation() from temporal-polyfill/full/shim, which replaces a native Temporal.",
|
|
200
|
+
default: 'the InternationalizationProvider calendar, else gregory',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
examples: [
|
|
204
|
+
{
|
|
205
|
+
label: 'A custom month view in the Persian calendar',
|
|
206
|
+
code: `import {Button} from '@astryxdesign/core/Button';
|
|
207
|
+
import {
|
|
208
|
+
useCalendarDays,
|
|
209
|
+
useCalendarNavigation,
|
|
210
|
+
} from '@astryxdesign/core/Calendar';
|
|
211
|
+
|
|
212
|
+
function PersianMonth() {
|
|
213
|
+
const {monthYearLabel, visibleCalendarMonths, navigateMonth} =
|
|
214
|
+
useCalendarNavigation({initialValue: '2026-10-30', calendar: 'persian'});
|
|
215
|
+
// visibleCalendarMonths[0] is {year: 1405, month: 8}: Aban 1405.
|
|
216
|
+
const {weeks} = useCalendarDays({
|
|
217
|
+
...visibleCalendarMonths[0],
|
|
218
|
+
calendar: 'persian',
|
|
219
|
+
});
|
|
220
|
+
return (
|
|
221
|
+
<section aria-label={monthYearLabel}>
|
|
222
|
+
<Button label="Previous month" onClick={() => navigateMonth(-1)} />
|
|
223
|
+
<Button label="Next month" onClick={() => navigateMonth(1)} />
|
|
224
|
+
{weeks.map(week => (
|
|
225
|
+
<div key={week[0].iso}>
|
|
226
|
+
{week.map(day => (
|
|
227
|
+
<span key={day.iso} data-date={day.iso}>
|
|
228
|
+
{day.isOutside ? '' : day.dayNumber}
|
|
229
|
+
</span>
|
|
230
|
+
))}
|
|
231
|
+
</div>
|
|
232
|
+
))}
|
|
233
|
+
</section>
|
|
234
|
+
);
|
|
235
|
+
}`,
|
|
236
|
+
},
|
|
188
237
|
],
|
|
189
238
|
theming: {
|
|
190
239
|
targets: [
|
|
@@ -230,6 +279,11 @@ export const docsZh = {
|
|
|
230
279
|
description:
|
|
231
280
|
'Show two months side by side when the user frequently selects dates that span a month boundary.',
|
|
232
281
|
},
|
|
282
|
+
{
|
|
283
|
+
guidance: true,
|
|
284
|
+
description:
|
|
285
|
+
'For a custom month view, use useCalendarNavigation and useCalendarDays from @astryxdesign/core/Calendar. To show another calendar system, pass the same calendar to both and feed visibleCalendarMonths into useCalendarDays. The hooks default to gregory and never read the InternationalizationProvider calendar.',
|
|
286
|
+
},
|
|
233
287
|
{
|
|
234
288
|
guidance: false,
|
|
235
289
|
description:
|
|
@@ -311,13 +365,14 @@ export const docsZh = {
|
|
|
311
365
|
{
|
|
312
366
|
name: 'hasWeekNumbers',
|
|
313
367
|
type: 'boolean',
|
|
314
|
-
description: '显示 ISO 周数。',
|
|
368
|
+
description: '显示 ISO 8601 周数。在任何历法中都是 ISO 8601 周数。',
|
|
315
369
|
default: 'false',
|
|
316
370
|
},
|
|
317
371
|
{
|
|
318
372
|
name: 'hasVariableRowCount',
|
|
319
373
|
type: 'boolean',
|
|
320
|
-
description:
|
|
374
|
+
description:
|
|
375
|
+
'每个月只显示所需的行数。默认的固定 6 行网格使每个月高度相同;可变行数以固定高度换取更紧凑的网格。',
|
|
321
376
|
default: 'false',
|
|
322
377
|
},
|
|
323
378
|
{
|
|
@@ -327,6 +382,13 @@ export const docsZh = {
|
|
|
327
382
|
'每周起始日。可为数字(0=周日)或三字母星期缩写(如 "mon")。',
|
|
328
383
|
default: '0',
|
|
329
384
|
},
|
|
385
|
+
{
|
|
386
|
+
name: 'calendar',
|
|
387
|
+
type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'",
|
|
388
|
+
description:
|
|
389
|
+
"网格显示的历法,如 'persian'、'hebrew' 或 'islamic-umalqura'。它决定月份、月份名称以及按月和按年的导航。value、min、max、focusDate 和所有回调仍为公历 ISO 日期。gregory、iso8601、buddhist、roc 和 japanese 以外的历法需要 Temporal;运行环境没有 Temporal 时,请在服务端和浏览器中加载 polyfill(如 temporal-polyfill/full/global),否则网格显示公历月份。农历(chinese)和檀纪历(dangi)的月初取自运行环境的 Temporal,部分 polyfill 与原生 Temporal 有少数月份的月初相差一天;服务端渲染且需要两端标记一致时,请在两端使用同一种实现,例如 temporal-polyfill/full/shim 的 installImplementation(),它会替换原生 Temporal。",
|
|
390
|
+
default: 'InternationalizationProvider 的历法,否则为 gregory',
|
|
391
|
+
},
|
|
330
392
|
],
|
|
331
393
|
theming: {
|
|
332
394
|
targets: [
|
|
@@ -374,6 +436,11 @@ export const docsDense = {
|
|
|
374
436
|
description:
|
|
375
437
|
'Show two months side by side when user frequently selects dates spanning a month boundary.',
|
|
376
438
|
},
|
|
439
|
+
{
|
|
440
|
+
guidance: true,
|
|
441
|
+
description:
|
|
442
|
+
'Custom month view: useCalendarNavigation + useCalendarDays; pass the same calendar to both, feed visibleCalendarMonths into useCalendarDays. Default gregory; never read the provider calendar.',
|
|
443
|
+
},
|
|
377
444
|
{
|
|
378
445
|
guidance: false,
|
|
379
446
|
description:
|
|
@@ -400,8 +467,11 @@ export const docsDense = {
|
|
|
400
467
|
onFocusDateChange: 'navigation callback',
|
|
401
468
|
handleRef: 'imperative navigation handle',
|
|
402
469
|
hasOutsideDays: 'show days from adjacent months',
|
|
403
|
-
hasWeekNumbers: 'show ISO week numbers',
|
|
404
|
-
hasVariableRowCount:
|
|
470
|
+
hasWeekNumbers: 'show ISO 8601 week numbers, in every calendar system',
|
|
471
|
+
hasVariableRowCount:
|
|
472
|
+
'only the rows each month needs; trades the fixed 6-row height for a compact grid',
|
|
405
473
|
weekStartsOn: 'first day of week (0=Sunday, or name e.g. "mon")',
|
|
474
|
+
calendar:
|
|
475
|
+
'calendar system shown (default: provider calendar, else gregory); values stay Gregorian ISO; non-Gregorian-aligned calendars need Temporal',
|
|
406
476
|
},
|
|
407
477
|
};
|
|
@@ -31,11 +31,8 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
31
31
|
import {Button} from '../Button';
|
|
32
32
|
import {Icon} from '../Icon';
|
|
33
33
|
import {useAnnounce, useGridFocus} from '../hooks';
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
useCalendarConstraints,
|
|
37
|
-
type CalendarDay,
|
|
38
|
-
} from './hooks';
|
|
34
|
+
import {useCalendarConstraints, type CalendarDay} from './hooks';
|
|
35
|
+
import {useCalendarDays} from './hooks/useCalendarDays';
|
|
39
36
|
import {
|
|
40
37
|
calendarStyles,
|
|
41
38
|
monthGridStyles,
|
|
@@ -48,23 +45,28 @@ import {
|
|
|
48
45
|
plainDateToISO,
|
|
49
46
|
plainDateToDate,
|
|
50
47
|
plainDateToday,
|
|
51
|
-
plainDateSetFirstOfMonth,
|
|
52
|
-
plainDateAddMonths,
|
|
53
48
|
plainDateAddDays,
|
|
54
49
|
plainDateDiffDays,
|
|
55
|
-
getDaysInMonth,
|
|
56
50
|
plainDateIsAfter,
|
|
57
51
|
plainDateIsBefore,
|
|
58
52
|
plainDateIsEqual,
|
|
59
53
|
plainDateGetWeekNumber,
|
|
60
|
-
plainDateFormat,
|
|
61
54
|
plainDateWeekFieldName,
|
|
55
|
+
plainDateFormatDayNumber,
|
|
62
56
|
DATE_FORMAT_WITH_WEEKDAY,
|
|
63
57
|
} from '../utils/plainDate';
|
|
64
58
|
import {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
type CalendarMonth,
|
|
60
|
+
type CalendarSystem,
|
|
61
|
+
calendarAddMonths,
|
|
62
|
+
calendarMonthOf,
|
|
63
|
+
calendarShiftMonths,
|
|
64
|
+
calendarShiftYears,
|
|
65
|
+
calendarYearMonthOf,
|
|
66
|
+
formatCalendarDate,
|
|
67
|
+
formatCalendarMonthLabel,
|
|
68
|
+
isInCalendarMonth,
|
|
69
|
+
} from '../utils/calendarSystem';
|
|
68
70
|
import {mergeProps, composeEventHandlers, rtlStyles} from '../utils';
|
|
69
71
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
70
72
|
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
@@ -99,6 +101,7 @@ import type {
|
|
|
99
101
|
import {normalizeDayOfWeek} from '../utils/dateTypes';
|
|
100
102
|
import {themeProps} from '../utils/themeProps';
|
|
101
103
|
import {useLocale} from '../i18n';
|
|
104
|
+
import {useCalendarSystem} from '../i18n/useCalendarSystem';
|
|
102
105
|
import {VisuallyHidden} from '../VisuallyHidden';
|
|
103
106
|
import {
|
|
104
107
|
registerEnglishFallback,
|
|
@@ -108,7 +111,7 @@ import english from '../i18n/generated-english/Calendar/Calendar.generated';
|
|
|
108
111
|
|
|
109
112
|
registerEnglishFallback(english);
|
|
110
113
|
|
|
111
|
-
/** How a month navigation moves the focused day: by its row offset in days, or by whole months or years. */
|
|
114
|
+
/** How a month navigation moves the focused day: by its row offset in days, or by whole calendar months or years. */
|
|
112
115
|
type NavigationUnit = 'days' | 'months' | 'years';
|
|
113
116
|
|
|
114
117
|
/** Imperative handle for Calendar handleRef */
|
|
@@ -181,13 +184,15 @@ interface CalendarBaseProps extends Omit<
|
|
|
181
184
|
hasOutsideDays?: boolean;
|
|
182
185
|
|
|
183
186
|
/**
|
|
184
|
-
* Show ISO week numbers in a side column.
|
|
187
|
+
* Show ISO 8601 week numbers in a side column. They are ISO 8601 week
|
|
188
|
+
* numbers in every calendar system.
|
|
185
189
|
* Default: false
|
|
186
190
|
*/
|
|
187
191
|
hasWeekNumbers?: boolean;
|
|
188
192
|
|
|
189
193
|
/**
|
|
190
|
-
*
|
|
194
|
+
* Give each month only the rows it needs instead of a fixed 6-row grid.
|
|
195
|
+
* The fixed grid keeps the same height from month to month.
|
|
191
196
|
* Default: false (fixed 6 rows for consistent height)
|
|
192
197
|
*/
|
|
193
198
|
hasVariableRowCount?: boolean;
|
|
@@ -198,6 +203,16 @@ interface CalendarBaseProps extends Omit<
|
|
|
198
203
|
* Default: 0 (Sunday)
|
|
199
204
|
*/
|
|
200
205
|
weekStartsOn?: DayOfWeek | DayOfWeekName;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* The calendar system the grid shows, such as `'persian'` or `'hebrew'`.
|
|
209
|
+
* It sets the months, their labels, and month and year navigation. `value`,
|
|
210
|
+
* `min`, `max`, `focusDate`, and every callback stay Gregorian ISO dates.
|
|
211
|
+
* Default: the `InternationalizationProvider` calendar, else Gregorian.
|
|
212
|
+
* Calendars other than `gregory`, `iso8601`, `buddhist`, `roc`, and
|
|
213
|
+
* `japanese` need `Temporal`; without it the grid shows Gregorian months.
|
|
214
|
+
*/
|
|
215
|
+
calendar?: CalendarSystem;
|
|
201
216
|
}
|
|
202
217
|
|
|
203
218
|
// ─── Mode-specific Props (discriminated union) ────────────────
|
|
@@ -232,14 +247,12 @@ interface CalendarRangeProps extends CalendarBaseProps {
|
|
|
232
247
|
|
|
233
248
|
export type CalendarProps = CalendarSingleProps | CalendarRangeProps;
|
|
234
249
|
|
|
235
|
-
/** The first day of `month`'s month that `isDisabled` allows, or null. */
|
|
236
250
|
function firstEnabledDayOfMonth(
|
|
237
|
-
month:
|
|
251
|
+
month: CalendarMonth,
|
|
238
252
|
isDisabled: (pd: PlainDate) => boolean,
|
|
239
253
|
): PlainDate | null {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const pd = {year: month.year, month: month.month, day};
|
|
254
|
+
for (let offset = 0; offset < month.length; offset += 1) {
|
|
255
|
+
const pd = plainDateAddDays(month.start, offset);
|
|
243
256
|
if (!isDisabled(pd)) {
|
|
244
257
|
return pd;
|
|
245
258
|
}
|
|
@@ -247,6 +260,15 @@ function firstEnabledDayOfMonth(
|
|
|
247
260
|
return null;
|
|
248
261
|
}
|
|
249
262
|
|
|
263
|
+
/** A day's full label, such as "Friday, Aban 8, 1405 AP", in the calendar. */
|
|
264
|
+
function formatDateLabel(
|
|
265
|
+
date: PlainDate,
|
|
266
|
+
calendar: CalendarSystem,
|
|
267
|
+
locale: string,
|
|
268
|
+
): string {
|
|
269
|
+
return formatCalendarDate(calendar, date, DATE_FORMAT_WITH_WEEKDAY, locale);
|
|
270
|
+
}
|
|
271
|
+
|
|
250
272
|
// =============================================================================
|
|
251
273
|
// Main Component
|
|
252
274
|
// =============================================================================
|
|
@@ -280,12 +302,14 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
280
302
|
hasWeekNumbers = false,
|
|
281
303
|
hasVariableRowCount = false,
|
|
282
304
|
weekStartsOn: weekStartsOnProp = 0,
|
|
305
|
+
calendar: calendarProp,
|
|
283
306
|
xstyle,
|
|
284
307
|
className,
|
|
285
308
|
style,
|
|
286
309
|
onKeyDown,
|
|
287
310
|
...rest
|
|
288
311
|
} = props;
|
|
312
|
+
const calendar = useCalendarSystem(calendarProp, 'Calendar');
|
|
289
313
|
|
|
290
314
|
// Normalize `weekStartsOn` (number or three-letter day name) to a numeric
|
|
291
315
|
// DayOfWeek so all downstream date math keeps working with an index.
|
|
@@ -329,6 +353,7 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
329
353
|
max,
|
|
330
354
|
numberOfMonths,
|
|
331
355
|
today,
|
|
356
|
+
calendar,
|
|
332
357
|
}),
|
|
333
358
|
);
|
|
334
359
|
|
|
@@ -354,17 +379,21 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
354
379
|
[isControlledFocus, onFocusDateChange],
|
|
355
380
|
);
|
|
356
381
|
|
|
357
|
-
//
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
382
|
+
// A controlled focus date is a new object on each render. Key the memo on
|
|
383
|
+
// its ISO string.
|
|
384
|
+
const focusIso = plainDateToISO(focusDate);
|
|
385
|
+
const baseMonth = useMemo(
|
|
386
|
+
() => calendarMonthOf(calendar, plainDateFromISO(focusIso)),
|
|
387
|
+
[calendar, focusIso],
|
|
388
|
+
);
|
|
361
389
|
|
|
362
390
|
// Generate visible months
|
|
363
391
|
const visibleMonths = useMemo(() => {
|
|
364
392
|
return Array.from({length: numberOfMonths}, (_, i) => {
|
|
365
|
-
return
|
|
393
|
+
return calendarAddMonths(calendar, baseMonth, i);
|
|
366
394
|
});
|
|
367
|
-
}, [baseMonth, numberOfMonths]);
|
|
395
|
+
}, [calendar, baseMonth, numberOfMonths]);
|
|
396
|
+
const lastVisibleMonth = visibleMonths[visibleMonths.length - 1];
|
|
368
397
|
|
|
369
398
|
// A pending target is claimed by the grid that shows its month, or dropped
|
|
370
399
|
// by the next focus move that is not onto the target day: when a controlled
|
|
@@ -378,9 +407,7 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
378
407
|
return null;
|
|
379
408
|
}
|
|
380
409
|
const target = plainDateFromISO(pendingFocus);
|
|
381
|
-
return visibleMonths.some(
|
|
382
|
-
pd => pd.year === target.year && pd.month === target.month,
|
|
383
|
-
)
|
|
410
|
+
return visibleMonths.some(month => isInCalendarMonth(target, month))
|
|
384
411
|
? pendingFocus
|
|
385
412
|
: null;
|
|
386
413
|
}, [pendingFocus, visibleMonths]);
|
|
@@ -405,9 +432,9 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
405
432
|
const monthYearLabel = useMemo(
|
|
406
433
|
() =>
|
|
407
434
|
visibleMonths
|
|
408
|
-
.map(m =>
|
|
435
|
+
.map(m => formatCalendarMonthLabel(calendar, m, locale))
|
|
409
436
|
.join(' – '),
|
|
410
|
-
[visibleMonths, locale],
|
|
437
|
+
[calendar, visibleMonths, locale],
|
|
411
438
|
);
|
|
412
439
|
|
|
413
440
|
// Announce the newly visible month to screen readers whenever it changes.
|
|
@@ -439,31 +466,13 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
439
466
|
[max],
|
|
440
467
|
);
|
|
441
468
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
minDate.year < baseMonth.year ||
|
|
450
|
-
(minDate.year === baseMonth.year && minDate.month < baseMonth.month)
|
|
451
|
-
);
|
|
452
|
-
}, [min, baseMonth]);
|
|
453
|
-
|
|
454
|
-
const canNavigateNext = useMemo(() => {
|
|
455
|
-
if (!max) {
|
|
456
|
-
return true;
|
|
457
|
-
}
|
|
458
|
-
const maxDate = plainDateFromISO(max);
|
|
459
|
-
// Check against the last visible month, not just baseMonth
|
|
460
|
-
const lastVisibleMonth = plainDateAddMonths(baseMonth, numberOfMonths - 1);
|
|
461
|
-
return (
|
|
462
|
-
maxDate.year > lastVisibleMonth.year ||
|
|
463
|
-
(maxDate.year === lastVisibleMonth.year &&
|
|
464
|
-
maxDate.month > lastVisibleMonth.month)
|
|
465
|
-
);
|
|
466
|
-
}, [max, baseMonth, numberOfMonths]);
|
|
469
|
+
// A month button is available while a day past the shown months is in range.
|
|
470
|
+
const canNavigatePrevious =
|
|
471
|
+
minDateForKeys == null ||
|
|
472
|
+
plainDateIsBefore(minDateForKeys, baseMonth.start);
|
|
473
|
+
const canNavigateNext =
|
|
474
|
+
maxDateForKeys == null ||
|
|
475
|
+
plainDateIsAfter(maxDateForKeys, lastVisibleMonth.end);
|
|
467
476
|
|
|
468
477
|
// Navigation handlers
|
|
469
478
|
// The same constraint view the grids use, so a key can resolve its target
|
|
@@ -491,10 +500,6 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
491
500
|
offset?: number,
|
|
492
501
|
unit: NavigationUnit = 'days',
|
|
493
502
|
) => {
|
|
494
|
-
const monthIndex = (pd: PlainDate) => pd.year * 12 + pd.month;
|
|
495
|
-
const firstShown = monthIndex(baseMonth);
|
|
496
|
-
const lastShown = firstShown + numberOfMonths - 1;
|
|
497
|
-
|
|
498
503
|
// The Previous/Next buttons move the month with no focused day.
|
|
499
504
|
if (!focusedDate) {
|
|
500
505
|
if (
|
|
@@ -503,7 +508,7 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
503
508
|
) {
|
|
504
509
|
return;
|
|
505
510
|
}
|
|
506
|
-
const newPd =
|
|
511
|
+
const newPd = calendarAddMonths(calendar, baseMonth, delta).start;
|
|
507
512
|
if (onFocusDateChange) {
|
|
508
513
|
onFocusDateChange(plainDateToISO(newPd));
|
|
509
514
|
} else {
|
|
@@ -523,19 +528,19 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
523
528
|
!(maxDateForKeys && plainDateIsAfter(pd, maxDateForKeys));
|
|
524
529
|
let targetPd: PlainDate;
|
|
525
530
|
if (unit === 'months' || unit === 'years') {
|
|
526
|
-
// A page or a year step keeps the day of the month and clamps
|
|
527
|
-
// target month's length. A month with no enabled day is no
|
|
528
|
-
// same as for an arrow.
|
|
529
|
-
const candidate =
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
531
|
+
// A page or a year step keeps the day of the calendar month and clamps
|
|
532
|
+
// it to the target month's length. A month with no enabled day is no
|
|
533
|
+
// target, the same as for an arrow.
|
|
534
|
+
const candidate =
|
|
535
|
+
unit === 'years'
|
|
536
|
+
? calendarShiftYears(calendar, currentPd, delta)
|
|
537
|
+
: calendarShiftMonths(calendar, currentPd, delta);
|
|
533
538
|
if (!inRange(candidate)) {
|
|
534
539
|
return;
|
|
535
540
|
}
|
|
536
541
|
if (isRootDateDisabled(candidate)) {
|
|
537
542
|
const firstEnabled = firstEnabledDayOfMonth(
|
|
538
|
-
candidate,
|
|
543
|
+
calendarMonthOf(calendar, candidate),
|
|
539
544
|
isRootDateDisabled,
|
|
540
545
|
);
|
|
541
546
|
if (firstEnabled == null) {
|
|
@@ -572,16 +577,15 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
572
577
|
// key's direction, so the target month becomes the first (backwards)
|
|
573
578
|
// or last (forwards) month shown.
|
|
574
579
|
const resolved: PlainDate = targetPd;
|
|
575
|
-
const targetMonth = monthIndex(resolved);
|
|
576
580
|
setPendingFocus(plainDateToISO(resolved));
|
|
577
|
-
|
|
581
|
+
const isBeforeShown = plainDateIsBefore(resolved, baseMonth.start);
|
|
582
|
+
if (!isBeforeShown && !plainDateIsAfter(resolved, lastVisibleMonth.end)) {
|
|
578
583
|
return;
|
|
579
584
|
}
|
|
580
|
-
const
|
|
581
|
-
const newPd =
|
|
582
|
-
targetMonth
|
|
583
|
-
|
|
584
|
-
: plainDateAddMonths(targetFirst, -(numberOfMonths - 1));
|
|
585
|
+
const targetMonth = calendarMonthOf(calendar, resolved);
|
|
586
|
+
const newPd = isBeforeShown
|
|
587
|
+
? targetMonth.start
|
|
588
|
+
: calendarAddMonths(calendar, targetMonth, -(numberOfMonths - 1)).start;
|
|
585
589
|
if (onFocusDateChange) {
|
|
586
590
|
onFocusDateChange(plainDateToISO(newPd));
|
|
587
591
|
} else {
|
|
@@ -590,9 +594,11 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
590
594
|
},
|
|
591
595
|
[
|
|
592
596
|
baseMonth,
|
|
597
|
+
calendar,
|
|
593
598
|
canNavigateNext,
|
|
594
599
|
canNavigatePrevious,
|
|
595
600
|
isRootDateDisabled,
|
|
601
|
+
lastVisibleMonth,
|
|
596
602
|
maxDateForKeys,
|
|
597
603
|
minDateForKeys,
|
|
598
604
|
numberOfMonths,
|
|
@@ -637,7 +643,7 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
637
643
|
setRangeSelectionStart(iso);
|
|
638
644
|
announce(
|
|
639
645
|
t('@astryx.calendar.rangeStartAnnounce', {
|
|
640
|
-
date:
|
|
646
|
+
date: formatDateLabel(date, calendar, locale),
|
|
641
647
|
}),
|
|
642
648
|
);
|
|
643
649
|
} else {
|
|
@@ -653,7 +659,7 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
653
659
|
setRangeSelectionStart(null);
|
|
654
660
|
announce(
|
|
655
661
|
t('@astryx.calendar.rangeClearedAnnounce', {
|
|
656
|
-
date:
|
|
662
|
+
date: formatDateLabel(date, calendar, locale),
|
|
657
663
|
}),
|
|
658
664
|
);
|
|
659
665
|
return;
|
|
@@ -679,22 +685,23 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
679
685
|
// swapped {start, end} above even for a reverse pick).
|
|
680
686
|
announce(
|
|
681
687
|
t('@astryx.calendar.rangeCompleteAnnounce', {
|
|
682
|
-
start:
|
|
683
|
-
|
|
684
|
-
DATE_FORMAT_WITH_WEEKDAY,
|
|
685
|
-
locale,
|
|
686
|
-
),
|
|
687
|
-
end: plainDateFormat(
|
|
688
|
-
plainDateFromISO(end),
|
|
689
|
-
DATE_FORMAT_WITH_WEEKDAY,
|
|
690
|
-
locale,
|
|
691
|
-
),
|
|
688
|
+
start: formatDateLabel(plainDateFromISO(start), calendar, locale),
|
|
689
|
+
end: formatDateLabel(plainDateFromISO(end), calendar, locale),
|
|
692
690
|
}),
|
|
693
691
|
);
|
|
694
692
|
}
|
|
695
693
|
}
|
|
696
694
|
},
|
|
697
|
-
[
|
|
695
|
+
[
|
|
696
|
+
mode,
|
|
697
|
+
onChange,
|
|
698
|
+
rangeSelectionStart,
|
|
699
|
+
minRangeSpan,
|
|
700
|
+
announce,
|
|
701
|
+
t,
|
|
702
|
+
locale,
|
|
703
|
+
calendar,
|
|
704
|
+
],
|
|
698
705
|
);
|
|
699
706
|
|
|
700
707
|
return (
|
|
@@ -756,8 +763,9 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
756
763
|
<div {...stylex.props(calendarStyles.monthsContainer)}>
|
|
757
764
|
{visibleMonths.map(month => (
|
|
758
765
|
<MonthGrid
|
|
759
|
-
key={
|
|
766
|
+
key={plainDateToISO(month.start)}
|
|
760
767
|
month={month}
|
|
768
|
+
calendar={calendar}
|
|
761
769
|
value={effectiveValue}
|
|
762
770
|
mode={mode}
|
|
763
771
|
rangeSelectionStart={rangeSelectionStart}
|
|
@@ -798,7 +806,8 @@ Calendar.displayName = 'Calendar';
|
|
|
798
806
|
// =============================================================================
|
|
799
807
|
|
|
800
808
|
interface MonthGridProps {
|
|
801
|
-
month:
|
|
809
|
+
month: CalendarMonth;
|
|
810
|
+
calendar: CalendarSystem;
|
|
802
811
|
value: ISODateString | DateRange | undefined;
|
|
803
812
|
mode: 'single' | 'range';
|
|
804
813
|
rangeSelectionStart: ISODateString | null;
|
|
@@ -831,6 +840,7 @@ interface MonthGridProps {
|
|
|
831
840
|
|
|
832
841
|
function MonthGrid({
|
|
833
842
|
month,
|
|
843
|
+
calendar,
|
|
834
844
|
value,
|
|
835
845
|
mode,
|
|
836
846
|
rangeSelectionStart,
|
|
@@ -853,12 +863,16 @@ function MonthGrid({
|
|
|
853
863
|
onPendingFocusHandled,
|
|
854
864
|
}: MonthGridProps) {
|
|
855
865
|
const locale = useLocale();
|
|
856
|
-
const year = month.year;
|
|
857
866
|
|
|
858
867
|
// Use hooks for days generation and constraints
|
|
868
|
+
const yearMonth = useMemo(
|
|
869
|
+
() => calendarYearMonthOf(calendar, month),
|
|
870
|
+
[calendar, month],
|
|
871
|
+
);
|
|
859
872
|
const {days, weeks} = useCalendarDays({
|
|
860
|
-
year,
|
|
861
|
-
month:
|
|
873
|
+
year: yearMonth.year,
|
|
874
|
+
month: yearMonth.month,
|
|
875
|
+
calendar,
|
|
862
876
|
weekStartsOn,
|
|
863
877
|
hasVariableRowCount,
|
|
864
878
|
});
|
|
@@ -899,15 +913,16 @@ function MonthGrid({
|
|
|
899
913
|
// enabled) > today (if visible and enabled) > first enabled in-month day.
|
|
900
914
|
const seedTabbableIso = useMemo((): ISODateString | null => {
|
|
901
915
|
if (selectedDateForTabindex) {
|
|
902
|
-
const isSelectedInMonth =
|
|
903
|
-
selectedDateForTabindex
|
|
904
|
-
|
|
916
|
+
const isSelectedInMonth = isInCalendarMonth(
|
|
917
|
+
selectedDateForTabindex,
|
|
918
|
+
month,
|
|
919
|
+
);
|
|
905
920
|
if (isSelectedInMonth && !isDateDisabled(selectedDateForTabindex)) {
|
|
906
921
|
return plainDateToISO(selectedDateForTabindex);
|
|
907
922
|
}
|
|
908
923
|
}
|
|
909
924
|
|
|
910
|
-
const isTodayInMonth = today
|
|
925
|
+
const isTodayInMonth = isInCalendarMonth(today, month);
|
|
911
926
|
if (isTodayInMonth && !isDateDisabled(today)) {
|
|
912
927
|
return plainDateToISO(today);
|
|
913
928
|
}
|
|
@@ -919,7 +934,7 @@ function MonthGrid({
|
|
|
919
934
|
}
|
|
920
935
|
|
|
921
936
|
return null;
|
|
922
|
-
}, [days, today,
|
|
937
|
+
}, [days, today, month, isDateDisabled, selectedDateForTabindex]);
|
|
923
938
|
|
|
924
939
|
// Helper to get the focused date from the currently focused element.
|
|
925
940
|
// Reads the machine-readable `data-date` (ISO) attribute rather than parsing
|
|
@@ -1028,7 +1043,7 @@ function MonthGrid({
|
|
|
1028
1043
|
}
|
|
1029
1044
|
|
|
1030
1045
|
const targetPd = plainDateFromISO(pendingFocus);
|
|
1031
|
-
if (targetPd
|
|
1046
|
+
if (!isInCalendarMonth(targetPd, month)) {
|
|
1032
1047
|
return;
|
|
1033
1048
|
}
|
|
1034
1049
|
const targetIso = plainDateToISO(targetPd);
|
|
@@ -1063,7 +1078,7 @@ function MonthGrid({
|
|
|
1063
1078
|
targetButton.focus();
|
|
1064
1079
|
}
|
|
1065
1080
|
onPendingFocusHandled?.();
|
|
1066
|
-
}, [pendingFocus, gridRef, month
|
|
1081
|
+
}, [pendingFocus, gridRef, month, onPendingFocusHandled]);
|
|
1067
1082
|
|
|
1068
1083
|
// Parse selection
|
|
1069
1084
|
let selectedDate: PlainDate | null = null;
|
|
@@ -1103,8 +1118,8 @@ function MonthGrid({
|
|
|
1103
1118
|
|
|
1104
1119
|
// Month label for announcements
|
|
1105
1120
|
const monthLabel = useMemo(() => {
|
|
1106
|
-
return
|
|
1107
|
-
}, [month, locale]);
|
|
1121
|
+
return formatCalendarMonthLabel(calendar, month, locale);
|
|
1122
|
+
}, [calendar, month, locale]);
|
|
1108
1123
|
|
|
1109
1124
|
return (
|
|
1110
1125
|
<div {...stylex.props(monthGridStyles.monthGrid)}>
|
|
@@ -1198,6 +1213,7 @@ function MonthGrid({
|
|
|
1198
1213
|
neighbors={neighbors}
|
|
1199
1214
|
isTabbable={day.iso === seedTabbableIso}
|
|
1200
1215
|
isRangeSelectionInProgress={rangeSelectionStart !== null}
|
|
1216
|
+
calendar={calendar}
|
|
1201
1217
|
onDayClick={onDayClick}
|
|
1202
1218
|
onDayHover={onDayHover}
|
|
1203
1219
|
/>
|
|
@@ -1246,6 +1262,8 @@ interface DayCellProps {
|
|
|
1246
1262
|
* "range start and range end" (rangeStart === rangeEnd in both cases).
|
|
1247
1263
|
*/
|
|
1248
1264
|
isRangeSelectionInProgress: boolean;
|
|
1265
|
+
/** The calendar system that writes the day's accessible name. */
|
|
1266
|
+
calendar: CalendarSystem;
|
|
1249
1267
|
onDayClick: (date: PlainDate) => void;
|
|
1250
1268
|
onDayHover: (date: PlainDate | null) => void;
|
|
1251
1269
|
}
|
|
@@ -1265,6 +1283,7 @@ function DayCell({
|
|
|
1265
1283
|
neighbors,
|
|
1266
1284
|
isTabbable: isTabbableDay,
|
|
1267
1285
|
isRangeSelectionInProgress,
|
|
1286
|
+
calendar,
|
|
1268
1287
|
onDayClick,
|
|
1269
1288
|
onDayHover,
|
|
1270
1289
|
}: DayCellProps) {
|
|
@@ -1316,7 +1335,7 @@ function DayCell({
|
|
|
1316
1335
|
// params rather than string concatenation. A mid-flight first pick (where
|
|
1317
1336
|
// rangeStart === rangeEnd) reads as "range start" only; a completed one-day
|
|
1318
1337
|
// range reads as both start and end.
|
|
1319
|
-
const dateLabel =
|
|
1338
|
+
const dateLabel = formatDateLabel(date, calendar, locale);
|
|
1320
1339
|
const dayLabel = state.isSelected
|
|
1321
1340
|
? t('@astryx.calendar.daySelected', {date: dateLabel})
|
|
1322
1341
|
: state.isRangeStart && state.isRangeEnd
|