@astryxdesign/core 0.7.8 → 0.7.9-canary.0236bb8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +7 -2
- 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/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/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 +70 -9
- 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/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/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/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/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/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.map +1 -1
- package/dist/hooks/useOverflow.js +190 -21
- 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 +14 -1
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +20 -2
- 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 +10 -2
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +16 -3
- 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 +7 -2
- 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/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/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/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 +98 -15
- 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/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/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/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/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/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 +297 -73
- 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 +34 -1
- package/src/motion/MEASUREMENTS.md +11 -0
- 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 +17 -3
- 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,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useCalendarDays.ts
|
|
7
|
-
* @input Uses React useMemo, useLocale, PlainDate
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
7
|
+
* @input Uses React useMemo, useLocale, PlainDate and calendar-system
|
|
8
|
+
* utilities, generated CLDR weekday data
|
|
9
|
+
* @output Exports useCalendarDays, the day grid of one month of any calendar
|
|
10
|
+
* system (Gregorian by default)
|
|
11
|
+
* @position Calendar-specific hook; used by Calendar and MonthScroller
|
|
10
12
|
*
|
|
11
13
|
* SYNC: When modified, update:
|
|
12
14
|
* - /packages/core/src/Calendar/hooks/index.ts
|
|
@@ -17,12 +19,17 @@ import type {DayOfWeek, ISODateString} from '../../utils/dateTypes';
|
|
|
17
19
|
import {
|
|
18
20
|
type PlainDate,
|
|
19
21
|
plainDateToISO,
|
|
20
|
-
getDaysInMonth,
|
|
21
22
|
plainDateDayOfWeek,
|
|
22
23
|
plainDateAddDays,
|
|
23
24
|
} from '../../utils/plainDate';
|
|
24
25
|
import {useLocale} from '../../i18n';
|
|
25
26
|
import {getWeekdayHeaderNames} from '../getWeekdayHeaderNames';
|
|
27
|
+
import {
|
|
28
|
+
type CalendarSystem,
|
|
29
|
+
calendarDayOfMonth,
|
|
30
|
+
calendarMonthFromYearMonth,
|
|
31
|
+
} from '../../utils/calendarSystem';
|
|
32
|
+
import {resolveShownCalendar} from '../../i18n/useCalendarSystem';
|
|
26
33
|
|
|
27
34
|
/**
|
|
28
35
|
* Represents a single day in the calendar grid.
|
|
@@ -42,14 +49,27 @@ export interface CalendarDay {
|
|
|
42
49
|
* Configuration for calendar days generation
|
|
43
50
|
*/
|
|
44
51
|
export interface UseCalendarDaysOptions {
|
|
45
|
-
/** The year to generate days for */
|
|
52
|
+
/** The year to generate days for, in `calendar`'s numbering */
|
|
46
53
|
year: number;
|
|
47
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The month's position in its year (1-based). In the Gregorian calendar,
|
|
56
|
+
* 1 is January and 12 is December. In other calendars it is numbered as
|
|
57
|
+
* `Temporal.PlainDate` numbers it: 1 through 13 in a Hebrew leap year.
|
|
58
|
+
*/
|
|
48
59
|
month: number;
|
|
49
60
|
/** First day of week (0=Sunday through 6=Saturday) */
|
|
50
61
|
weekStartsOn?: DayOfWeek;
|
|
51
62
|
/** Use variable rows per month vs. fixed 6-row grid */
|
|
52
63
|
hasVariableRowCount?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The calendar system that numbers `year`, `month`, and each `dayNumber`.
|
|
66
|
+
* Each day keeps its Gregorian `date` and `iso`. The hook never reads the
|
|
67
|
+
* InternationalizationProvider calendar. Calendars other than gregory,
|
|
68
|
+
* iso8601, buddhist, roc, and japanese need Temporal; without it, the hook
|
|
69
|
+
* reads Gregorian numbers and warns once in development.
|
|
70
|
+
* @default 'gregory'
|
|
71
|
+
*/
|
|
72
|
+
calendar?: CalendarSystem;
|
|
53
73
|
}
|
|
54
74
|
|
|
55
75
|
/**
|
|
@@ -80,71 +100,82 @@ export interface UseCalendarDaysReturn {
|
|
|
80
100
|
* weekStartsOn: 0, // Sunday
|
|
81
101
|
* });
|
|
82
102
|
* // days[i].date is a PlainDate { year, month (1-based), day }
|
|
103
|
+
*
|
|
104
|
+
* // Aban 1405 in the Persian calendar; dates stay Gregorian
|
|
105
|
+
* useCalendarDays({year: 1405, month: 8, calendar: 'persian'});
|
|
83
106
|
* ```
|
|
84
107
|
*/
|
|
85
108
|
export function useCalendarDays(
|
|
86
109
|
options: UseCalendarDaysOptions,
|
|
87
110
|
): UseCalendarDaysReturn {
|
|
88
|
-
const {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
111
|
+
const {
|
|
112
|
+
year,
|
|
113
|
+
month,
|
|
114
|
+
weekStartsOn = 0,
|
|
115
|
+
hasVariableRowCount = false,
|
|
116
|
+
calendar: calendarOption = 'gregory',
|
|
117
|
+
} = options;
|
|
118
|
+
const calendar = resolveShownCalendar(calendarOption, 'useCalendarDays');
|
|
119
|
+
const days = useMemo(() => {
|
|
120
|
+
const calendarMonth = calendarMonthFromYearMonth(calendar, {year, month});
|
|
121
|
+
return layOutMonthDays({
|
|
122
|
+
first: calendarMonth.start,
|
|
123
|
+
length: calendarMonth.length,
|
|
124
|
+
weekStartsOn,
|
|
125
|
+
hasVariableRowCount,
|
|
126
|
+
dayNumberOf: (pd, offset) =>
|
|
127
|
+
offset >= 0 && offset < calendarMonth.length
|
|
128
|
+
? offset + 1
|
|
129
|
+
: calendarDayOfMonth(calendar, pd),
|
|
130
|
+
});
|
|
131
|
+
}, [year, month, calendar, weekStartsOn, hasVariableRowCount]);
|
|
132
|
+
return useMonthGrid(days, weekStartsOn);
|
|
133
|
+
}
|
|
94
134
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
135
|
+
interface MonthLayout {
|
|
136
|
+
first: PlainDate;
|
|
137
|
+
length: number;
|
|
138
|
+
weekStartsOn: DayOfWeek;
|
|
139
|
+
hasVariableRowCount: boolean;
|
|
140
|
+
/** The day number of a grid day, given its offset from the month's first day. */
|
|
141
|
+
dayNumberOf: (pd: PlainDate, offset: number) => number;
|
|
142
|
+
}
|
|
101
143
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
144
|
+
function layOutMonthDays(layout: MonthLayout): CalendarDay[] {
|
|
145
|
+
const {first, length, weekStartsOn, hasVariableRowCount, dayNumberOf} =
|
|
146
|
+
layout;
|
|
147
|
+
let startingDayOfWeek = plainDateDayOfWeek(first) - weekStartsOn;
|
|
148
|
+
if (startingDayOfWeek < 0) {
|
|
149
|
+
startingDayOfWeek += 7;
|
|
150
|
+
}
|
|
151
|
+
const totalRows = hasVariableRowCount
|
|
152
|
+
? Math.ceil((length + startingDayOfWeek) / 7)
|
|
153
|
+
: 6;
|
|
154
|
+
const result: CalendarDay[] = [];
|
|
155
|
+
for (let i = 0; i < totalRows * 7; i++) {
|
|
156
|
+
const offset = i - startingDayOfWeek;
|
|
157
|
+
const pd = plainDateAddDays(first, offset);
|
|
158
|
+
result.push({
|
|
159
|
+
date: pd,
|
|
160
|
+
iso: plainDateToISO(pd),
|
|
161
|
+
isOutside: offset < 0 || offset >= length,
|
|
162
|
+
dayNumber: dayNumberOf(pd, offset),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return result;
|
|
166
|
+
}
|
|
106
167
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}, [year, month, weekStartsOn, hasVariableRowCount]);
|
|
168
|
+
function useMonthGrid(
|
|
169
|
+
days: CalendarDay[],
|
|
170
|
+
weekStartsOn: DayOfWeek,
|
|
171
|
+
): UseCalendarDaysReturn {
|
|
172
|
+
const locale = useLocale();
|
|
113
173
|
|
|
114
174
|
const dayNames = useMemo(
|
|
115
175
|
() => getWeekdayHeaderNames(locale, weekStartsOn),
|
|
116
176
|
[locale, weekStartsOn],
|
|
117
177
|
);
|
|
118
178
|
|
|
119
|
-
// Generate days array
|
|
120
|
-
const days = useMemo(() => {
|
|
121
|
-
const {
|
|
122
|
-
daysInMonth: totalDaysInMonth,
|
|
123
|
-
startingDayOfWeek,
|
|
124
|
-
totalCells,
|
|
125
|
-
} = gridInfo;
|
|
126
|
-
const firstOfMonth: PlainDate = {year, month, day: 1};
|
|
127
|
-
const result: CalendarDay[] = [];
|
|
128
|
-
|
|
129
|
-
for (let i = 0; i < totalCells; i++) {
|
|
130
|
-
const dayOffset = i - startingDayOfWeek + 1;
|
|
131
|
-
const isOutside = dayOffset < 1 || dayOffset > totalDaysInMonth;
|
|
132
|
-
const pd: PlainDate = isOutside
|
|
133
|
-
? plainDateAddDays(firstOfMonth, dayOffset - 1)
|
|
134
|
-
: {year, month, day: dayOffset};
|
|
135
|
-
|
|
136
|
-
result.push({
|
|
137
|
-
date: pd,
|
|
138
|
-
iso: plainDateToISO(pd),
|
|
139
|
-
isOutside,
|
|
140
|
-
dayNumber: pd.day,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return result;
|
|
145
|
-
}, [year, month, gridInfo]);
|
|
146
|
-
|
|
147
|
-
// Group days into weeks
|
|
148
179
|
const weeks = useMemo(() => {
|
|
149
180
|
const result: CalendarDay[][] = [];
|
|
150
181
|
for (let i = 0; i < days.length; i += 7) {
|
|
@@ -153,10 +184,5 @@ export function useCalendarDays(
|
|
|
153
184
|
return result;
|
|
154
185
|
}, [days]);
|
|
155
186
|
|
|
156
|
-
return {
|
|
157
|
-
days,
|
|
158
|
-
weeks,
|
|
159
|
-
dayNames,
|
|
160
|
-
totalCells: gridInfo.totalCells,
|
|
161
|
-
};
|
|
187
|
+
return {days, weeks, dayNames, totalCells: days.length};
|
|
162
188
|
}
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useCalendarNavigation.ts
|
|
7
|
-
* @input Uses React useState, useMemo, useCallback, useLocale, PlainDate
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
7
|
+
* @input Uses React useState, useMemo, useCallback, useLocale, PlainDate and
|
|
8
|
+
* calendar-system utilities
|
|
9
|
+
* @output Exports useCalendarNavigation hook for month navigation in any
|
|
10
|
+
* calendar system (Gregorian by default)
|
|
11
|
+
* @position Calendar-specific public hook
|
|
10
12
|
*
|
|
11
13
|
* SYNC: When modified, update:
|
|
12
14
|
* - /packages/core/src/Calendar/hooks/index.ts
|
|
@@ -19,12 +21,17 @@ import {
|
|
|
19
21
|
plainDateFromISO,
|
|
20
22
|
plainDateToISO,
|
|
21
23
|
plainDateToday,
|
|
22
|
-
plainDateSetFirstOfMonth,
|
|
23
|
-
plainDateAddMonths,
|
|
24
24
|
plainDateAddDays,
|
|
25
25
|
} from '../../utils/plainDate';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
type CalendarSystem,
|
|
28
|
+
calendarAddMonths,
|
|
29
|
+
calendarMonthOf,
|
|
30
|
+
calendarYearMonthOf,
|
|
31
|
+
formatCalendarMonthLabel,
|
|
32
|
+
} from '../../utils/calendarSystem';
|
|
27
33
|
import {useLocale} from '../../i18n';
|
|
34
|
+
import {resolveShownCalendar} from '../../i18n/useCalendarSystem';
|
|
28
35
|
|
|
29
36
|
/**
|
|
30
37
|
* Configuration for calendar navigation
|
|
@@ -38,17 +45,31 @@ export interface UseCalendarNavigationOptions {
|
|
|
38
45
|
onFocusDateChange?: (focusDate: ISODateString) => void;
|
|
39
46
|
/** Number of months to display */
|
|
40
47
|
numberOfMonths?: 1 | 2;
|
|
48
|
+
/**
|
|
49
|
+
* The calendar system whose months the hook steps and labels. Dates stay
|
|
50
|
+
* Gregorian ISO. The hook never reads the InternationalizationProvider
|
|
51
|
+
* calendar. Calendars other than gregory, iso8601, buddhist, roc, and
|
|
52
|
+
* japanese need Temporal; without it, the hook steps Gregorian months and
|
|
53
|
+
* warns once in development.
|
|
54
|
+
* @default 'gregory'
|
|
55
|
+
*/
|
|
56
|
+
calendar?: CalendarSystem;
|
|
41
57
|
}
|
|
42
58
|
|
|
43
59
|
/**
|
|
44
60
|
* Return type for useCalendarNavigation hook
|
|
45
61
|
*/
|
|
46
62
|
export interface UseCalendarNavigationReturn {
|
|
47
|
-
/** The
|
|
63
|
+
/** The Gregorian first day of the focus month */
|
|
48
64
|
baseMonth: PlainDate;
|
|
49
|
-
/**
|
|
65
|
+
/** The Gregorian first day of each visible month */
|
|
50
66
|
visibleMonths: PlainDate[];
|
|
51
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* The year and month numbers of each visible month in `calendar`, as
|
|
69
|
+
* `useCalendarDays` reads them with the same `calendar`
|
|
70
|
+
*/
|
|
71
|
+
visibleCalendarMonths: {year: number; month: number}[];
|
|
72
|
+
/** Formatted label for the month header, in `calendar` */
|
|
52
73
|
monthYearLabel: string;
|
|
53
74
|
/** Navigate to previous/next month */
|
|
54
75
|
navigateMonth: (
|
|
@@ -87,6 +108,13 @@ export interface UseCalendarNavigationReturn {
|
|
|
87
108
|
* // Navigate from arrow key (with focus tracking)
|
|
88
109
|
* navigateMonth(1, focusedDate, 1); // horizontal offset
|
|
89
110
|
* navigateMonth(1, focusedDate, 7); // vertical offset
|
|
111
|
+
*
|
|
112
|
+
* // Persian months, laid out by useCalendarDays
|
|
113
|
+
* const nav = useCalendarNavigation({initialValue, calendar: 'persian'});
|
|
114
|
+
* const {weeks} = useCalendarDays({
|
|
115
|
+
* ...nav.visibleCalendarMonths[0],
|
|
116
|
+
* calendar: 'persian',
|
|
117
|
+
* });
|
|
90
118
|
* ```
|
|
91
119
|
*/
|
|
92
120
|
export function useCalendarNavigation(
|
|
@@ -97,8 +125,13 @@ export function useCalendarNavigation(
|
|
|
97
125
|
focusDate: focusDateProp,
|
|
98
126
|
onFocusDateChange,
|
|
99
127
|
numberOfMonths = 1,
|
|
128
|
+
calendar: calendarOption = 'gregory',
|
|
100
129
|
} = options;
|
|
101
130
|
const locale = useLocale();
|
|
131
|
+
const calendar = resolveShownCalendar(
|
|
132
|
+
calendarOption,
|
|
133
|
+
'useCalendarNavigation',
|
|
134
|
+
);
|
|
102
135
|
|
|
103
136
|
// Pending focus target after month navigation
|
|
104
137
|
const [pendingFocus, setPendingFocus] = useState<ISODateString | null>(null);
|
|
@@ -121,32 +154,40 @@ export function useCalendarNavigation(
|
|
|
121
154
|
? plainDateFromISO(focusDateProp)
|
|
122
155
|
: internalFocusDate;
|
|
123
156
|
|
|
124
|
-
//
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
157
|
+
// A controlled focus date is a new object on each render. Key the memo on
|
|
158
|
+
// its ISO string.
|
|
159
|
+
const focusIso = plainDateToISO(focusDate);
|
|
160
|
+
const shownMonths = useMemo(() => {
|
|
161
|
+
const first = calendarMonthOf(calendar, plainDateFromISO(focusIso));
|
|
162
|
+
return Array.from({length: numberOfMonths}, (_, i) =>
|
|
163
|
+
calendarAddMonths(calendar, first, i),
|
|
164
|
+
);
|
|
165
|
+
}, [calendar, focusIso, numberOfMonths]);
|
|
166
|
+
|
|
167
|
+
const visibleMonths = useMemo(
|
|
168
|
+
() => shownMonths.map(month => month.start),
|
|
169
|
+
[shownMonths],
|
|
170
|
+
);
|
|
171
|
+
const baseMonth = visibleMonths[0];
|
|
128
172
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
});
|
|
134
|
-
}, [baseMonth, numberOfMonths]);
|
|
173
|
+
const visibleCalendarMonths = useMemo(
|
|
174
|
+
() => shownMonths.map(month => calendarYearMonthOf(calendar, month)),
|
|
175
|
+
[calendar, shownMonths],
|
|
176
|
+
);
|
|
135
177
|
|
|
136
|
-
//
|
|
137
|
-
// Each month is its own stand-alone label (Calendar FR1).
|
|
178
|
+
// Each month is its own stand-alone label.
|
|
138
179
|
const monthYearLabel = useMemo(
|
|
139
180
|
() =>
|
|
140
|
-
|
|
141
|
-
.map(
|
|
181
|
+
shownMonths
|
|
182
|
+
.map(month => formatCalendarMonthLabel(calendar, month, locale))
|
|
142
183
|
.join(' – '),
|
|
143
|
-
[
|
|
184
|
+
[calendar, shownMonths, locale],
|
|
144
185
|
);
|
|
145
186
|
|
|
146
187
|
// Navigate to previous/next month
|
|
147
188
|
const navigateMonth = useCallback(
|
|
148
189
|
(delta: number, focusedDate?: ISODateString, offset?: number) => {
|
|
149
|
-
const newMonth =
|
|
190
|
+
const newMonth = calendarAddMonths(calendar, shownMonths[0], delta).start;
|
|
150
191
|
const newISO = plainDateToISO(newMonth);
|
|
151
192
|
|
|
152
193
|
// Calculate target focus date if provided
|
|
@@ -164,7 +205,7 @@ export function useCalendarNavigation(
|
|
|
164
205
|
setInternalFocusDate(newMonth);
|
|
165
206
|
}
|
|
166
207
|
},
|
|
167
|
-
[
|
|
208
|
+
[calendar, shownMonths, onFocusDateChange],
|
|
168
209
|
);
|
|
169
210
|
|
|
170
211
|
// Clear pending focus
|
|
@@ -175,6 +216,7 @@ export function useCalendarNavigation(
|
|
|
175
216
|
return {
|
|
176
217
|
baseMonth,
|
|
177
218
|
visibleMonths,
|
|
219
|
+
visibleCalendarMonths,
|
|
178
220
|
monthYearLabel,
|
|
179
221
|
navigateMonth,
|
|
180
222
|
pendingFocus,
|
|
@@ -109,7 +109,7 @@ export const docs = {
|
|
|
109
109
|
name: 'size',
|
|
110
110
|
type: "'sm' | 'md'",
|
|
111
111
|
description:
|
|
112
|
-
'The size of the checkbox. sm for compact layouts, md for default.',
|
|
112
|
+
'The size of the checkbox. sm for compact layouts, md for default. Under a coarse pointer a labelled checkbox’s target grows toward 44 px through an invisible hit area. It never shrinks below the row and stops at half the gap to a closer neighbour; nothing changes size.',
|
|
113
113
|
default: "'md'",
|
|
114
114
|
},
|
|
115
115
|
{
|
|
@@ -155,7 +155,7 @@ export const docs = {
|
|
|
155
155
|
{
|
|
156
156
|
name: '--_indicator-press-image',
|
|
157
157
|
description:
|
|
158
|
-
"The row's touch press image, handed down to a first-party indicator that paints its own press. Set from the press paint only while the row itself is pressed
|
|
158
|
+
"The row's touch press image, handed down to a first-party indicator that paints its own press. Set from the press paint only while the row itself is pressed, or, under a CheckboxList row that owns the press, from that row's press paint. Only this row declares it.",
|
|
159
159
|
default: 'none',
|
|
160
160
|
private: true,
|
|
161
161
|
},
|
|
@@ -361,7 +361,8 @@ export const docsZh = {
|
|
|
361
361
|
{
|
|
362
362
|
name: 'size',
|
|
363
363
|
type: "'sm' | 'md'",
|
|
364
|
-
description:
|
|
364
|
+
description:
|
|
365
|
+
'复选框尺寸。sm 用于紧凑布局,md 为默认。在粗指针(触摸)下,带可见标签的复选框的目标通过不可见的点击区域向 44 px 扩展。它不小于所在行,与相邻控件较近时止于间距的一半;尺寸不变。',
|
|
365
366
|
default: "'md'",
|
|
366
367
|
},
|
|
367
368
|
{
|
|
@@ -403,7 +404,7 @@ export const docsZh = {
|
|
|
403
404
|
{
|
|
404
405
|
name: '--_indicator-press-image',
|
|
405
406
|
description:
|
|
406
|
-
'
|
|
407
|
+
'复选框行的触摸按下图像,传递给自行绘制按下效果的第一方指示器。仅在该行自身被按下时根据按下涂层设置;在拥有按下效果的 CheckboxList 行中,取该行的按下涂层。只有该行声明它。',
|
|
407
408
|
default: 'none',
|
|
408
409
|
private: true,
|
|
409
410
|
},
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CheckboxInput.tsx
|
|
7
|
-
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip
|
|
7
|
+
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip,
|
|
8
|
+
* CheckboxRowPressContext (a row around the checkbox that owns its press)
|
|
8
9
|
* @output Exports CheckboxInput component, CheckboxInputProps
|
|
9
10
|
* @position Core implementation; consumed by index.ts, tested by CheckboxInput.test.tsx
|
|
10
11
|
*
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
import {
|
|
21
|
+
use,
|
|
20
22
|
useId,
|
|
21
23
|
useCallback,
|
|
22
24
|
useOptimistic,
|
|
@@ -24,6 +26,8 @@ import {
|
|
|
24
26
|
useTransition,
|
|
25
27
|
type ChangeEvent,
|
|
26
28
|
type FocusEvent,
|
|
29
|
+
type MouseEvent as ReactMouseEvent,
|
|
30
|
+
type PointerEvent as ReactPointerEvent,
|
|
27
31
|
type ReactNode,
|
|
28
32
|
} from 'react';
|
|
29
33
|
import * as stylex from '@stylexjs/stylex';
|
|
@@ -55,11 +59,14 @@ import {useIndicator} from '../Indicator/useIndicator';
|
|
|
55
59
|
import {themeProps} from '../utils/themeProps';
|
|
56
60
|
|
|
57
61
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
62
|
+
import {useTouchHitArea} from '../utils/touchHitArea';
|
|
63
|
+
import {touchHitAreaStyles} from '../utils/touchHitArea.stylex';
|
|
58
64
|
import {
|
|
59
65
|
registerEnglishFallback,
|
|
60
66
|
useComponentTranslator,
|
|
61
67
|
} from '../i18n/useComponentTranslator';
|
|
62
68
|
import english from '../i18n/generated-english/CheckboxInput/CheckboxInput.generated';
|
|
69
|
+
import {CheckboxRowPressContext} from './CheckboxRowPressContext';
|
|
63
70
|
|
|
64
71
|
registerEnglishFallback(english);
|
|
65
72
|
|
|
@@ -83,10 +90,14 @@ const styles = stylex.create({
|
|
|
83
90
|
containerLabelHidden: {
|
|
84
91
|
gap: 0,
|
|
85
92
|
},
|
|
93
|
+
// Under a coarse pointer the row contains its hit band.
|
|
94
|
+
hitAreaHost: {
|
|
95
|
+
position: {default: null, '@media (pointer: coarse)': 'relative'},
|
|
96
|
+
},
|
|
86
97
|
// An indicator in another package may not name this row's private press
|
|
87
98
|
// attribute. So the row hands its touch press image down to an indicator
|
|
88
99
|
// that paints its own press, but only in its own press states. A pressed
|
|
89
|
-
//
|
|
100
|
+
// outer row hands down nothing, as for the built-in box. The
|
|
90
101
|
// property has no default: a layered stylesheet ranks a default above the
|
|
91
102
|
// arms. Only this row declares it. A menu item paints its own press, so a
|
|
92
103
|
// mapped indicator there paints none.
|
|
@@ -97,6 +108,12 @@ const styles = stylex.create({
|
|
|
97
108
|
[PRESSED_FADING]: 'var(--_press-paint-image)',
|
|
98
109
|
},
|
|
99
110
|
},
|
|
111
|
+
// Under a row that owns the press (CheckboxRowPressContext), this row is
|
|
112
|
+
// never pressed. So it hands down that row's press paint, which the
|
|
113
|
+
// built-in box reads too.
|
|
114
|
+
indicatorRowPressImage: {
|
|
115
|
+
'--_indicator-press-image': 'var(--_checkbox-row-press-paint, none)',
|
|
116
|
+
},
|
|
100
117
|
checkboxWrapper: {
|
|
101
118
|
position: 'relative',
|
|
102
119
|
display: 'flex',
|
|
@@ -108,11 +125,12 @@ const styles = stylex.create({
|
|
|
108
125
|
// The owner paints this layer over the resolved indicator, so a plain theme
|
|
109
126
|
// replacement keeps the pressed feedback. An indicator with
|
|
110
127
|
// `indicatorPressScope` paints its own press from what the row hands down,
|
|
111
|
-
// so this layer stays off over it.
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
128
|
+
// so this layer stays off over it. A mouse keeps `:active` (see
|
|
129
|
+
// interactionOverlay.stylex.ts). Under a coarse pointer that arm is dropped.
|
|
130
|
+
// The touch press controller then writes the press attribute on the row.
|
|
131
|
+
// This layer reads it off the scope marker, as the hover tint does. Under a
|
|
132
|
+
// row that owns the press (CheckboxRowPressContext), the row's own checkbox
|
|
133
|
+
// paints that row's press paint instead (indicatorRowPressOverlay).
|
|
116
134
|
indicatorPressOverlay: {
|
|
117
135
|
'::after': {
|
|
118
136
|
// `when.descendant` takes a pseudo-class; `:is(*)` matches any marked
|
|
@@ -149,6 +167,15 @@ const styles = stylex.create({
|
|
|
149
167
|
},
|
|
150
168
|
},
|
|
151
169
|
},
|
|
170
|
+
// The row's own checkbox when its row owns the press
|
|
171
|
+
// (CheckboxRowPressContext). It paints only the paint that row declares
|
|
172
|
+
// (`--_checkbox-row-press-paint`). No outer row, card or fine pointer
|
|
173
|
+
// reaches it.
|
|
174
|
+
indicatorRowPressOverlay: {
|
|
175
|
+
'::after': {
|
|
176
|
+
backgroundImage: 'var(--_checkbox-row-press-paint, none)',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
152
179
|
// Holds only the indicator, so the focus ring has one unambiguous target.
|
|
153
180
|
// `display: contents` adds no box of its own — the indicator keeps whatever
|
|
154
181
|
// layout relationship it already had with the wrapper.
|
|
@@ -373,6 +400,13 @@ export function CheckboxInput({
|
|
|
373
400
|
// The row is the pressable: the overlay's pressed arm reads the row's
|
|
374
401
|
// scope marker, the way the indicator's hover tint does.
|
|
375
402
|
const pressable = usePressFeedback();
|
|
403
|
+
// A row around the checkbox that answers a press anywhere on it (a
|
|
404
|
+
// CheckboxListItem) owns the touch press instead. The checkbox then carries
|
|
405
|
+
// no press marker of its own. So the controller's innermost-wins rule finds
|
|
406
|
+
// the row for a finger on the label, the description or the box. The
|
|
407
|
+
// overlay below paints that row's press.
|
|
408
|
+
const isRowPressSurface = use(CheckboxRowPressContext);
|
|
409
|
+
const ownsPress = !isDisabled && !isRowPressSurface;
|
|
376
410
|
const generatedId = useId();
|
|
377
411
|
const id = idProp || generatedId;
|
|
378
412
|
const descriptionID = useId();
|
|
@@ -407,6 +441,55 @@ export function CheckboxInput({
|
|
|
407
441
|
useBusyAnnouncement(isBusy, t('@astryx.spinner.loading'), indicatorRef);
|
|
408
442
|
const {focusProps} = useIndicatorFocusRing(indicatorRef);
|
|
409
443
|
|
|
444
|
+
// Under a coarse pointer a labelled checkbox's row grows toward 44 px
|
|
445
|
+
// through an invisible band, and nothing changes size. A label-hidden
|
|
446
|
+
// checkbox is a marker in another component's row, which keeps its target.
|
|
447
|
+
const hasHitArea = !isLabelHidden && !isDisabled && !isReadOnly;
|
|
448
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
449
|
+
// The band's insets stay live while the row takes taps, and clear when it
|
|
450
|
+
// stops.
|
|
451
|
+
const watchRowHitArea = useTouchHitArea(hasHitArea);
|
|
452
|
+
// The disabled-message tooltip listens for hover and focus on the whole
|
|
453
|
+
// row, a larger trigger. It anchors on the checkbox itself (below), so it
|
|
454
|
+
// shows next to the control. Its handlers check isEnabled, so the row
|
|
455
|
+
// always attaches them.
|
|
456
|
+
const rowRef = useMergedRefs(
|
|
457
|
+
disabledMessageTooltip.interactionRef,
|
|
458
|
+
watchRowHitArea,
|
|
459
|
+
);
|
|
460
|
+
// Where a press on the row itself began. A browser can move a tap's click
|
|
461
|
+
// onto the row's edge, so the band is judged from the press.
|
|
462
|
+
const pressPointRef = useRef<{x: number; y: number} | null>(null);
|
|
463
|
+
const handleRowPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {
|
|
464
|
+
pressPointRef.current =
|
|
465
|
+
event.target === event.currentTarget
|
|
466
|
+
? {x: event.clientX, y: event.clientY}
|
|
467
|
+
: null;
|
|
468
|
+
};
|
|
469
|
+
// A press that began on the band, outside the row's box, toggles the
|
|
470
|
+
// checkbox, as a tap on the box does. A click from code has no press count
|
|
471
|
+
// (`detail` is 0), so it never toggles from here.
|
|
472
|
+
const handleRowClick = (event: ReactMouseEvent<HTMLDivElement>) => {
|
|
473
|
+
const press = pressPointRef.current;
|
|
474
|
+
pressPointRef.current = null;
|
|
475
|
+
if (
|
|
476
|
+
press == null ||
|
|
477
|
+
event.detail === 0 ||
|
|
478
|
+
event.target !== event.currentTarget
|
|
479
|
+
) {
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const box = event.currentTarget.getBoundingClientRect();
|
|
483
|
+
const isOnBand =
|
|
484
|
+
press.x < box.left ||
|
|
485
|
+
press.x > box.right ||
|
|
486
|
+
press.y < box.top ||
|
|
487
|
+
press.y > box.bottom;
|
|
488
|
+
if (isOnBand) {
|
|
489
|
+
inputRef.current?.click();
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
|
|
410
493
|
const isIndeterminate = optimisticValue === 'indeterminate';
|
|
411
494
|
const isChecked = optimisticValue === true;
|
|
412
495
|
|
|
@@ -455,33 +538,34 @@ export function CheckboxInput({
|
|
|
455
538
|
style,
|
|
456
539
|
)}>
|
|
457
540
|
<div
|
|
458
|
-
ref={
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
// appears next to the control, not the far edge of the row.
|
|
463
|
-
// Handlers are gated internally by isEnabled, so attaching
|
|
464
|
-
// unconditionally is safe.
|
|
465
|
-
disabledMessageTooltip.interactionRef(el);
|
|
466
|
-
}}
|
|
467
|
-
{...(isDisabled ? undefined : pressable)}
|
|
541
|
+
ref={rowRef}
|
|
542
|
+
onPointerDown={hasHitArea ? handleRowPointerDown : undefined}
|
|
543
|
+
onClick={hasHitArea ? handleRowClick : undefined}
|
|
544
|
+
{...(ownsPress ? pressable : undefined)}
|
|
468
545
|
{...stylex.props(
|
|
469
546
|
styles.container,
|
|
470
547
|
isLabelHidden && styles.containerLabelHidden,
|
|
548
|
+
hasHitArea && styles.hitAreaHost,
|
|
549
|
+
hasHitArea && touchHitAreaStyles.layer,
|
|
471
550
|
// Hover and focus reach the checkbox visual through this ancestor
|
|
472
551
|
// marker rather than props, so the whole row drives it.
|
|
473
552
|
!isDisabled && indicatorScope,
|
|
474
|
-
!isDisabled &&
|
|
553
|
+
!isDisabled &&
|
|
554
|
+
(isRowPressSurface
|
|
555
|
+
? styles.indicatorRowPressImage
|
|
556
|
+
: styles.indicatorPressImage),
|
|
475
557
|
// The touch press's strength and release live on the row the
|
|
476
558
|
// controller writes to; the layer over the checkbox box inherits
|
|
477
|
-
// and paints it.
|
|
478
|
-
|
|
559
|
+
// and paints it. Under a row that owns the press, the box inherits
|
|
560
|
+
// that row's strength instead.
|
|
561
|
+
ownsPress && interactionOverlayStyles.pressedAlpha,
|
|
479
562
|
)}>
|
|
480
563
|
<div
|
|
481
564
|
{...stylex.props(
|
|
482
565
|
styles.checkboxWrapper,
|
|
483
566
|
wrapperSizeStyles[size],
|
|
484
567
|
!isDisabled && styles.indicatorPressOverlay,
|
|
568
|
+
!isDisabled && isRowPressSurface && styles.indicatorRowPressOverlay,
|
|
485
569
|
)}
|
|
486
570
|
{...focusProps}>
|
|
487
571
|
<input
|
|
@@ -490,6 +574,7 @@ export function CheckboxInput({
|
|
|
490
574
|
ref,
|
|
491
575
|
indeterminateRef,
|
|
492
576
|
disabledMessageTooltip.positionRef,
|
|
577
|
+
inputRef,
|
|
493
578
|
)}
|
|
494
579
|
id={id}
|
|
495
580
|
type="checkbox"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file CheckboxRowPressContext.ts
|
|
7
|
+
* @input Uses the private layer-scoped context factory
|
|
8
|
+
* @output CheckboxRowPressContext: whether the row is its checkbox's press surface
|
|
9
|
+
* @position Internal; CheckboxListItem provides it, CheckboxInput reads it
|
|
10
|
+
*
|
|
11
|
+
* Such a row carries the shared press marker (utils/pressFeedback.ts). Its
|
|
12
|
+
* checkbox carries none, so a finger anywhere on the row presses the row.
|
|
13
|
+
* It is layer-scoped and wraps only the row's own checkbox.
|
|
14
|
+
*
|
|
15
|
+
* SYNC: When modified, update CheckboxInput.tsx and
|
|
16
|
+
* ../CheckboxList/CheckboxListItem.tsx.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
20
|
+
|
|
21
|
+
export const CheckboxRowPressContext = createLayerScopedContext(false);
|
|
22
|
+
CheckboxRowPressContext.displayName = 'CheckboxRowPressContext';
|