@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
|
@@ -109,7 +109,8 @@ export interface InputGroupProps extends Omit<
|
|
|
109
109
|
size?: InputGroupSize;
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
|
-
*
|
|
112
|
+
* Validation status. Its message shows below the group. The group border
|
|
113
|
+
* does not change; a theme can style the row from `data-status`.
|
|
113
114
|
*/
|
|
114
115
|
status?: InputStatus;
|
|
115
116
|
|
|
@@ -125,8 +126,8 @@ export interface InputGroupProps extends Omit<
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
/**
|
|
128
|
-
* Groups an input with prefix
|
|
129
|
-
*
|
|
129
|
+
* Groups an input with prefix and suffix addons in one connected row. A
|
|
130
|
+
* focused member stays above its neighbours, so its focus ring shows in full.
|
|
130
131
|
*
|
|
131
132
|
* @example
|
|
132
133
|
* ```
|
|
@@ -7,7 +7,42 @@ export const docs = {
|
|
|
7
7
|
subComponentOf: 'InputGroup',
|
|
8
8
|
displayName: 'Input Group Text',
|
|
9
9
|
isHiddenFromOverview: true,
|
|
10
|
-
description:
|
|
10
|
+
description:
|
|
11
|
+
'A prefix or suffix text element rendered inside InputGroup. Displays text or icons.',
|
|
12
|
+
usage: {
|
|
13
|
+
description:
|
|
14
|
+
"Use InputGroupText inside InputGroup for a short fixed prefix or suffix, such as a currency symbol, a protocol, or a unit, or for a decorative icon. It is plain text, not a control, and it is not part of the input's accessible name.",
|
|
15
|
+
bestPractices: [
|
|
16
|
+
{
|
|
17
|
+
guidance: true,
|
|
18
|
+
description:
|
|
19
|
+
'Keep the text short, such as $, https://, or kg. It stays on one line and does not shrink.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
guidance: true,
|
|
23
|
+
description:
|
|
24
|
+
'Put what a screen reader user needs in the input\'s own label, such as "Amount in USD" beside a $ prefix. The addon is read as plain text in reading order.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
guidance: false,
|
|
28
|
+
description:
|
|
29
|
+
'Put buttons, links, or other controls inside InputGroupText. Use a Button addon for an action.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
guidance: false,
|
|
33
|
+
description:
|
|
34
|
+
'Use InputGroupText outside InputGroup. Its borders and corners join an InputGroup row.',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
anatomy: [
|
|
38
|
+
{
|
|
39
|
+
name: 'Text cell',
|
|
40
|
+
required: true,
|
|
41
|
+
description:
|
|
42
|
+
'A non-interactive cell that holds text or an icon and joins the borders of its neighbours in the row.',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
11
46
|
props: [
|
|
12
47
|
{
|
|
13
48
|
name: 'children',
|
|
@@ -18,7 +53,8 @@ export const docs = {
|
|
|
18
53
|
{
|
|
19
54
|
name: 'xstyle',
|
|
20
55
|
type: 'StyleXStyles',
|
|
21
|
-
description:
|
|
56
|
+
description:
|
|
57
|
+
'StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value: not an inline style object like style={{}}.',
|
|
22
58
|
},
|
|
23
59
|
{
|
|
24
60
|
name: 'className',
|
|
@@ -30,6 +66,11 @@ export const docs = {
|
|
|
30
66
|
type: 'React.CSSProperties',
|
|
31
67
|
description: 'Inline styles.',
|
|
32
68
|
},
|
|
69
|
+
{
|
|
70
|
+
name: 'ref',
|
|
71
|
+
type: 'React.Ref<HTMLDivElement>',
|
|
72
|
+
description: 'Ref forwarded to the text cell element.',
|
|
73
|
+
},
|
|
33
74
|
],
|
|
34
75
|
};
|
|
35
76
|
|
|
@@ -40,8 +81,9 @@ export const docsDense = {
|
|
|
40
81
|
description: 'prefix/suffix text/icon element',
|
|
41
82
|
propDescriptions: {
|
|
42
83
|
children: 'text or icon content',
|
|
43
|
-
xstyle: 'StyleX styles',
|
|
84
|
+
xstyle: 'StyleX styles (stylex.create() value)',
|
|
44
85
|
className: 'CSS class name(s)',
|
|
45
86
|
style: 'inline styles',
|
|
87
|
+
ref: 'ref to the text cell',
|
|
46
88
|
},
|
|
47
89
|
};
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
12
12
|
* - /packages/core/src/InputGroup/InputGroup.doc.mjs
|
|
13
|
+
* - /packages/core/src/InputGroup/InputGroupText.doc.mjs
|
|
13
14
|
* - /packages/core/src/InputGroup/index.ts
|
|
14
15
|
* - /packages/cli/assets/templates/blocks/components/InputGroup/
|
|
15
16
|
*/
|
|
@@ -81,7 +82,7 @@ export interface InputGroupTextProps extends BaseProps<HTMLDivElement> {
|
|
|
81
82
|
*
|
|
82
83
|
* @example
|
|
83
84
|
* ```
|
|
84
|
-
* <InputGroup label="
|
|
85
|
+
* <InputGroup label="Website">
|
|
85
86
|
* <InputGroupText>https://</InputGroupText>
|
|
86
87
|
* <TextInput label="URL" isLabelHidden value={url} onChange={setUrl} />
|
|
87
88
|
* </InputGroup>
|
|
@@ -96,8 +96,10 @@ export const groupStyles = stylex.create({
|
|
|
96
96
|
default: 0,
|
|
97
97
|
[IS_LAST_ITEM]: radiusVars['--radius-element'],
|
|
98
98
|
},
|
|
99
|
+
// Input wrappers already sit at z-index 1. A focused member goes one
|
|
100
|
+
// higher, so an unfocused input beside it cannot cover its focus ring.
|
|
99
101
|
':focus-within': {
|
|
100
|
-
zIndex:
|
|
102
|
+
zIndex: 2,
|
|
101
103
|
},
|
|
102
104
|
},
|
|
103
105
|
});
|
package/src/Item/Item.tsx
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Item.tsx
|
|
7
|
-
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
7
|
+
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer,
|
|
8
|
+
* the shared press overlays and the compositor press layer
|
|
8
9
|
* @output Exports Item component, ItemProps type; publishes the shared inline inset.
|
|
9
10
|
* Only numbered composing rows keep their start/label/end slots in one flex
|
|
10
11
|
* group, through Item's private exact-marker scope; other marked rows keep
|
|
@@ -50,17 +51,25 @@ import {
|
|
|
50
51
|
import type {BaseProps} from '../BaseProps';
|
|
51
52
|
import {isRenderable} from '../utils/isRenderable';
|
|
52
53
|
import {mergeProps} from '../utils/mergeProps';
|
|
54
|
+
import {chainEventHandlers} from '../utils/chainEventHandlers';
|
|
53
55
|
import {useFocusAcrossSwap} from '../utils/useFocusAcrossSwap';
|
|
54
56
|
import {ItemDescriptionContext} from './ItemDescriptionContext';
|
|
57
|
+
import {ItemListRowContext} from './ItemListRowContext';
|
|
55
58
|
import {ItemMarkerColumnsContext} from './ItemMarkerColumnsContext';
|
|
56
59
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
57
60
|
import {computeTargetAndRel} from '../Link/computeTargetAndRel';
|
|
58
61
|
import {useLinkComponent} from '../Link/useLinkComponent';
|
|
59
|
-
import {
|
|
62
|
+
import {
|
|
63
|
+
cancelNestedTouchPress,
|
|
64
|
+
PRESSABLE_CONTAINER_ATTRIBUTE,
|
|
65
|
+
useClickableContainerProxy,
|
|
66
|
+
} from '../hooks/useClickableContainer';
|
|
60
67
|
import {useDevWarning} from '../hooks/useDevWarning';
|
|
61
68
|
import {themeProps} from '../utils/themeProps';
|
|
62
69
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
63
70
|
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
71
|
+
import {rowPressLayerStyles} from '../privateAttributes/press.stylex';
|
|
72
|
+
import {isCoarsePointer} from '../utils/coarsePointer';
|
|
64
73
|
import {usePressFeedback} from '../hooks/usePressFeedback';
|
|
65
74
|
import type {ItemSwipeBridge} from './ItemSwipeLayer';
|
|
66
75
|
|
|
@@ -334,6 +343,41 @@ const ARIA_SELECTED_ROLES = new Set([
|
|
|
334
343
|
*/
|
|
335
344
|
const SWIPE_ROLES = new Set(['listitem']);
|
|
336
345
|
|
|
346
|
+
/**
|
|
347
|
+
* Whether a row serves swipe actions, and so is a stacking context at rest:
|
|
348
|
+
* its root translates (`styles.swipeRoot`). Swipe actions need a
|
|
349
|
+
* role that permits interactive descendants, since a swipe panel holds
|
|
350
|
+
* buttons. That is a `listitem`, or no role at all. A root that is itself a
|
|
351
|
+
* link is not served, nor is a role that forbids interactive descendants. A
|
|
352
|
+
* disabled row, a row with no entry on either side, and the enlarged target of
|
|
353
|
+
* a nested control are not served either. Internal: under a finger,
|
|
354
|
+
* List/ListItem.tsx raises such a row, so its touch band stays above the rows
|
|
355
|
+
* after it.
|
|
356
|
+
*/
|
|
357
|
+
export function servesSwipeActions({
|
|
358
|
+
swipeActions,
|
|
359
|
+
isDisabled,
|
|
360
|
+
isDelegate,
|
|
361
|
+
isLinkRoot,
|
|
362
|
+
role,
|
|
363
|
+
}: {
|
|
364
|
+
readonly swipeActions: ItemSwipeActions | undefined;
|
|
365
|
+
readonly isDisabled: boolean;
|
|
366
|
+
readonly isDelegate: boolean;
|
|
367
|
+
readonly isLinkRoot: boolean;
|
|
368
|
+
readonly role: string | null | undefined;
|
|
369
|
+
}): boolean {
|
|
370
|
+
return (
|
|
371
|
+
swipeActions != null &&
|
|
372
|
+
((swipeActions.leading?.length ?? 0) > 0 ||
|
|
373
|
+
(swipeActions.trailing?.length ?? 0) > 0) &&
|
|
374
|
+
!isDisabled &&
|
|
375
|
+
!isDelegate &&
|
|
376
|
+
!isLinkRoot &&
|
|
377
|
+
(role == null || SWIPE_ROLES.has(role))
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
337
381
|
/** The travel a drag writes on the row root, in physical px (see useSwipeAction). */
|
|
338
382
|
const SWIPE_TRAVEL = 'var(--_item-swipe-travel, 0px)';
|
|
339
383
|
/** The settle clock, `0s` while the finger drives the row. */
|
|
@@ -532,7 +576,6 @@ const styles = stylex.create({
|
|
|
532
576
|
// zoomable (WCAG 1.4.4). The hover transition keeps its own clock beside
|
|
533
577
|
// the transform's.
|
|
534
578
|
swipeRoot: {
|
|
535
|
-
isolation: 'isolate',
|
|
536
579
|
touchAction: 'pan-y pinch-zoom',
|
|
537
580
|
transform: `translate3d(${SWIPE_TRAVEL}, 0, 0)`,
|
|
538
581
|
transitionProperty: 'background-color, transform',
|
|
@@ -611,6 +654,7 @@ export function Item({
|
|
|
611
654
|
}: ItemProps) {
|
|
612
655
|
const pressable = usePressFeedback();
|
|
613
656
|
const columnMarker = use(ItemMarkerColumnsContext);
|
|
657
|
+
const isListRow = use(ItemListRowContext);
|
|
614
658
|
const LinkComponent = useLinkComponent();
|
|
615
659
|
// A disabled row's anchor has no destination, so no activation path (a
|
|
616
660
|
// screen reader's click, Enter, a link context menu) can navigate
|
|
@@ -618,7 +662,11 @@ export function Item({
|
|
|
618
662
|
// the router link component, which may require a live href. The element type
|
|
619
663
|
// then changes with `isDisabled`, so focus follows the swap (FR4).
|
|
620
664
|
const RowAnchor = isDisabled ? 'a' : LinkComponent;
|
|
621
|
-
|
|
665
|
+
// The row's own action, its invisible link or button: a press on it
|
|
666
|
+
// activates the row.
|
|
667
|
+
const actionLinkRef = useRef<HTMLAnchorElement | null>(null);
|
|
668
|
+
const actionButtonRef = useRef<HTMLButtonElement | null>(null);
|
|
669
|
+
const anchorRef = useFocusAcrossSwap<HTMLAnchorElement>(actionLinkRef);
|
|
622
670
|
|
|
623
671
|
// Delegation mode: the row is an enlarged click/tap target for a nested
|
|
624
672
|
// control (e.g. a checkbox) that owns the keyboard access and action. The
|
|
@@ -626,12 +674,14 @@ export function Item({
|
|
|
626
674
|
const isDelegate = interactiveRef != null;
|
|
627
675
|
const containerRef = useRef<HTMLElement | null>(null);
|
|
628
676
|
// Only onClick is needed: onMouseUp handles middle-click href navigation,
|
|
629
|
-
// which delegation mode never has (href is ignored here).
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
677
|
+
// which delegation mode never has (href is ignored here). A List link row's
|
|
678
|
+
// surface click goes to its anchor through the same hook and its guards.
|
|
679
|
+
const {onClick: containerOnClick, onPointerDown: delegatedOnPointerDown} =
|
|
680
|
+
useClickableContainerProxy({
|
|
681
|
+
containerRef,
|
|
682
|
+
interactiveRef: interactiveRef ?? actionLinkRef,
|
|
683
|
+
disabled: isDisabled,
|
|
684
|
+
});
|
|
635
685
|
|
|
636
686
|
useDevWarning(
|
|
637
687
|
'Item',
|
|
@@ -651,20 +701,28 @@ export function Item({
|
|
|
651
701
|
// component means the root itself is the anchor, so the address rides it
|
|
652
702
|
// and the invisible anchor below is not rendered.
|
|
653
703
|
const isLinkRoot = typeof Component !== 'string' && href != null;
|
|
704
|
+
// A press on a nested control does not run this row's action, so the row
|
|
705
|
+
// shows no touch press. A row with a parent role or a link root runs it, so
|
|
706
|
+
// it keeps the press. Such a row is not a clickable container: an enclosing
|
|
707
|
+
// card still treats it as part of its own surface.
|
|
708
|
+
const hasOwnAction =
|
|
709
|
+
(onClick != null || href != null) && !hasParentRole && !isLinkRoot;
|
|
710
|
+
const pressOnRow = (event: React.PointerEvent<HTMLElement>) =>
|
|
711
|
+
cancelNestedTouchPress(
|
|
712
|
+
event,
|
|
713
|
+
event.currentTarget,
|
|
714
|
+
href != null ? actionLinkRef.current : actionButtonRef.current,
|
|
715
|
+
);
|
|
654
716
|
|
|
655
|
-
// Swipe actions exist where the row's role permits interactive descendants
|
|
656
|
-
// (a swipe panel's buttons are such descendants): a `listitem`, or no role
|
|
657
|
-
// at all. A root that is itself a link, a row whose role forbids them, and
|
|
658
|
-
// a row that is the enlarged target of a nested control are not served.
|
|
659
717
|
const leadingSwipe = swipeActions?.leading ?? [];
|
|
660
718
|
const trailingSwipe = swipeActions?.trailing ?? [];
|
|
661
|
-
const hasSwipe =
|
|
662
|
-
swipeActions
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
719
|
+
const hasSwipe = servesSwipeActions({
|
|
720
|
+
swipeActions,
|
|
721
|
+
isDisabled,
|
|
722
|
+
isDelegate,
|
|
723
|
+
isLinkRoot,
|
|
724
|
+
role,
|
|
725
|
+
});
|
|
668
726
|
useDevWarning(
|
|
669
727
|
'Item',
|
|
670
728
|
'`swipeBehavior="commit"` fires only the outermost entry of a side; the ' +
|
|
@@ -759,6 +817,8 @@ export function Item({
|
|
|
759
817
|
</>
|
|
760
818
|
);
|
|
761
819
|
|
|
820
|
+
const isLinkRow = isListRow && onClick == null && href != null && !isLinkRoot;
|
|
821
|
+
|
|
762
822
|
const handleContainerClick = (e: React.MouseEvent) => {
|
|
763
823
|
if (isDisabled) {
|
|
764
824
|
return;
|
|
@@ -767,6 +827,25 @@ export function Item({
|
|
|
767
827
|
if (target.closest('button, a, input, select, textarea')) {
|
|
768
828
|
return;
|
|
769
829
|
}
|
|
830
|
+
if (isLinkRow) {
|
|
831
|
+
// Under a coarse primary pointer, a tap in the row's padding or band
|
|
832
|
+
// follows its link, with the click's modifier keys. The primary pointer
|
|
833
|
+
// decides, as it decides the band, not the pointer that made the click.
|
|
834
|
+
const row = e.currentTarget as HTMLElement;
|
|
835
|
+
const box = row.getBoundingClientRect();
|
|
836
|
+
const isInBand =
|
|
837
|
+
e.clientX < box.left ||
|
|
838
|
+
e.clientX > box.right ||
|
|
839
|
+
e.clientY < box.top ||
|
|
840
|
+
e.clientY > box.bottom;
|
|
841
|
+
if (
|
|
842
|
+
e.detail > 0 &&
|
|
843
|
+
(isInBand || isCoarsePointer(row.ownerDocument.defaultView))
|
|
844
|
+
) {
|
|
845
|
+
containerOnClick(e as React.MouseEvent<HTMLElement>);
|
|
846
|
+
}
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
770
849
|
onClick?.(e);
|
|
771
850
|
};
|
|
772
851
|
|
|
@@ -809,6 +888,7 @@ export function Item({
|
|
|
809
888
|
</RowAnchor>
|
|
810
889
|
) : onClick != null ? (
|
|
811
890
|
<button
|
|
891
|
+
ref={actionButtonRef}
|
|
812
892
|
type="button"
|
|
813
893
|
onClick={onClick}
|
|
814
894
|
disabled={isDisabled}
|
|
@@ -845,14 +925,14 @@ export function Item({
|
|
|
845
925
|
|
|
846
926
|
const mergedRef = useMergedRefs(ref, containerRef);
|
|
847
927
|
const rootRef = useMergedRefs(
|
|
848
|
-
(isDelegate ? mergedRef : ref) as React.Ref<HTMLElement>,
|
|
928
|
+
(isDelegate || isLinkRow ? mergedRef : ref) as React.Ref<HTMLElement>,
|
|
849
929
|
hasSwipe ? swipeRootRef : undefined,
|
|
850
930
|
);
|
|
851
931
|
|
|
852
932
|
// The row's own primary, which the click the browser synthesizes after a
|
|
853
933
|
// drag must not fire.
|
|
854
934
|
const primaryOnClick = isDelegate
|
|
855
|
-
?
|
|
935
|
+
? containerOnClick
|
|
856
936
|
: hasParentRole
|
|
857
937
|
? onClick
|
|
858
938
|
: isInteractive
|
|
@@ -896,6 +976,24 @@ export function Item({
|
|
|
896
976
|
{...restProps}
|
|
897
977
|
{...swipeHandlers}
|
|
898
978
|
{...linkRootProps}
|
|
979
|
+
{...(isDelegate
|
|
980
|
+
? {
|
|
981
|
+
onPointerDown: chainEventHandlers(
|
|
982
|
+
restProps.onPointerDown,
|
|
983
|
+
delegatedOnPointerDown,
|
|
984
|
+
),
|
|
985
|
+
}
|
|
986
|
+
: hasOwnAction && !isDisabled
|
|
987
|
+
? {
|
|
988
|
+
onPointerDown: chainEventHandlers(
|
|
989
|
+
swipeHandlers?.onPointerDown ?? restProps.onPointerDown,
|
|
990
|
+
pressOnRow,
|
|
991
|
+
),
|
|
992
|
+
}
|
|
993
|
+
: null)}
|
|
994
|
+
// Only a delegate row is a pressable container. So a mouse click in a
|
|
995
|
+
// link row's padding still reaches a clickable container around it.
|
|
996
|
+
{...(isDelegate ? {[PRESSABLE_CONTAINER_ATTRIBUTE]: 'true'} : undefined)}
|
|
899
997
|
aria-selected={(allowsAriaSelected && isSelected) || undefined}
|
|
900
998
|
// aria-selected is invalid on roles that don't permit it (listitem, a
|
|
901
999
|
// bare div, etc.). For those, convey selection via aria-current — valid
|
|
@@ -916,6 +1014,10 @@ export function Item({
|
|
|
916
1014
|
align === 'first-line' && styles.alignFirstLine,
|
|
917
1015
|
isInteractive && styles.interactive,
|
|
918
1016
|
isInteractive && interactionOverlayStyles.backgroundColor,
|
|
1017
|
+
// The touch press on a compositor layer (after the overlay, whose
|
|
1018
|
+
// own touch paint it turns off): the release keeps fading while
|
|
1019
|
+
// script runs.
|
|
1020
|
+
isInteractive && rowPressLayerStyles.cell,
|
|
919
1021
|
isLinkRoot && styles.linkRoot,
|
|
920
1022
|
isHighlighted && styles.highlighted,
|
|
921
1023
|
isSelected && styles.selected,
|
|
@@ -930,18 +1032,20 @@ export function Item({
|
|
|
930
1032
|
onClick={rootOnClick}>
|
|
931
1033
|
<ItemDescriptionContext
|
|
932
1034
|
value={hasRenderableDescription ? descriptionID : null}>
|
|
933
|
-
{
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1035
|
+
<ItemListRowContext value={false}>
|
|
1036
|
+
{isRenderable(marker) && marker}
|
|
1037
|
+
{isRenderable(marker) && columnMarker === marker ? (
|
|
1038
|
+
<span
|
|
1039
|
+
{...stylex.props(
|
|
1040
|
+
styles.markerContent,
|
|
1041
|
+
align === 'first-line' && styles.markerContentFirstLine,
|
|
1042
|
+
)}>
|
|
1043
|
+
{content}
|
|
1044
|
+
</span>
|
|
1045
|
+
) : (
|
|
1046
|
+
content
|
|
1047
|
+
)}
|
|
1048
|
+
</ItemListRowContext>
|
|
945
1049
|
</ItemDescriptionContext>
|
|
946
1050
|
{hasSwipe && (
|
|
947
1051
|
// The panels: out-of-flow children of this root, so the DOM is the one
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file ItemListRowContext.tsx
|
|
7
|
+
* @input Uses React createContext
|
|
8
|
+
* @output Exports ItemListRowContext
|
|
9
|
+
* @position Internal seam between ListItem and the Item it renders. Under a
|
|
10
|
+
* coarse primary pointer a List row's whole touch target follows its link,
|
|
11
|
+
* so ListItem marks its Item as a List row. Item clears the mark for its own
|
|
12
|
+
* content, and a standalone Item has none.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {createContext} from 'react';
|
|
16
|
+
|
|
17
|
+
export const ItemListRowContext = createContext(false);
|
|
18
|
+
ItemListRowContext.displayName = 'ItemListRowContext';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file holdEntranceInput.ts
|
|
7
|
+
* @input A layer root whose CSS entrance has just started
|
|
8
|
+
* @output holdEntranceInput: under a coarse primary pointer, a finger's or a
|
|
9
|
+
* pen's input held away from the layer until its entrance ends
|
|
10
|
+
* @position The entrance hold for layers that enter through CSS (Dialog,
|
|
11
|
+
* Drawer, MobileNav), on the Layer module's input hold (inputHold.ts)
|
|
12
|
+
*
|
|
13
|
+
* SYNC: When modified, update holdEntranceInput.test.ts and its callers
|
|
14
|
+
* (Dialog.tsx, Drawer/useDrawerDialogPresence.ts, MobileNav/MobileNav.tsx).
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {isCoarsePointer} from '../utils/coarsePointer';
|
|
18
|
+
import {holdInput} from './inputHold';
|
|
19
|
+
|
|
20
|
+
/** Options for {@link holdEntranceInput}. */
|
|
21
|
+
export interface EntranceHoldOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Holds input anywhere while true. While false, only what lands on the layer
|
|
24
|
+
* is held, and the page stays live.
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
isModal?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The element whose animations are the entrance, when it is not the layer
|
|
30
|
+
* itself (a drawer inside its dialog).
|
|
31
|
+
* @default the layer
|
|
32
|
+
*/
|
|
33
|
+
entrance?: Element | null;
|
|
34
|
+
/** The longest the hold lasts, ms. An entrance that runs longer ends it. */
|
|
35
|
+
capMs?: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Holds a finger's and a pen's input away from `layer` until its entrance
|
|
40
|
+
* ends, or at most `capMs`. Returns the release, or `null` when nothing is
|
|
41
|
+
* held: no entrance runs, or the primary pointer is fine.
|
|
42
|
+
*/
|
|
43
|
+
export function holdEntranceInput(
|
|
44
|
+
layer: Element,
|
|
45
|
+
{isModal = true, entrance: animated = layer, capMs}: EntranceHoldOptions = {},
|
|
46
|
+
): (() => void) | null {
|
|
47
|
+
if (animated == null || typeof animated.getAnimations !== 'function') {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
// getAnimations() flushes styles, so it lists an entrance the open has just
|
|
51
|
+
// started. A theme's duration, a shorter reduced-motion entrance and a
|
|
52
|
+
// canceled entrance all end the hold when they end.
|
|
53
|
+
const entrance = animated.getAnimations().filter(isEntrance);
|
|
54
|
+
if (entrance.length === 0) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
// A touch presentation only, read as the layer opens. A finger on a device
|
|
58
|
+
// whose primary pointer is fine, such as a touchscreen laptop, is not held.
|
|
59
|
+
if (!isCoarsePointer(layer.ownerDocument.defaultView)) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const ended = Promise.all(
|
|
63
|
+
entrance.map(async animation => animation.finished),
|
|
64
|
+
);
|
|
65
|
+
return holdInput(layer, {
|
|
66
|
+
until: capMs == null ? ended : Promise.race([ended, after(capMs)]),
|
|
67
|
+
scope: isModal ? 'viewport' : 'surface',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function after(ms: number): Promise<void> {
|
|
72
|
+
await new Promise(resolve => {
|
|
73
|
+
setTimeout(resolve, ms);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** A running animation that ends on its own: an entrance, not a spin. */
|
|
78
|
+
function isEntrance(animation: Animation): boolean {
|
|
79
|
+
if (animation.playState !== 'running') {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const end = animation.effect?.getComputedTiming().endTime;
|
|
83
|
+
return typeof end === 'number' && Number.isFinite(end);
|
|
84
|
+
}
|