@astryxdesign/core 0.7.7-canary.550ff21 → 0.7.7-canary.58c5b8a
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/AlertDialog/AlertDialog.d.ts +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +36 -6
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts +13 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.d.ts.map +1 -0
- package/dist/AppShell/useCloseMobileDrawerOnActivate.js +45 -0
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +1 -1
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +79 -9
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +23 -4
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +5 -4
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +2 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +9 -4
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +50 -5
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +7 -1
- package/dist/CheckboxList/CheckboxListContext.d.ts +6 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +10 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +13 -27
- package/dist/DateInput/Wheel.d.ts +17 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +161 -20
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +63 -49
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +53 -15
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +15 -11
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +20 -4
- package/dist/Field/Field.js +2 -2
- package/dist/Field/PanelSearchInput.d.ts +9 -1
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +3 -1
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +27 -2
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/InfoTip/InfoTip.d.ts +63 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -0
- package/dist/InfoTip/InfoTip.js +126 -0
- package/dist/InfoTip/index.d.ts +10 -0
- package/dist/InfoTip/index.d.ts.map +1 -0
- package/dist/InfoTip/index.js +12 -0
- package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +25 -20
- package/dist/Layer/layerClickBoundary.d.ts +7 -1
- package/dist/Layer/layerClickBoundary.d.ts.map +1 -1
- package/dist/Layer/layerClickBoundary.js +2 -2
- package/dist/Layer/useBackdropPress.d.ts +27 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -0
- package/dist/Layer/useBackdropPress.js +53 -0
- package/dist/Layer/usePressPin.d.ts +105 -0
- package/dist/Layer/usePressPin.d.ts.map +1 -0
- package/dist/Layer/usePressPin.js +413 -0
- package/dist/Layer/useTouchTrigger.d.ts +23 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +45 -7
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +2 -1
- package/dist/MobileNav/MobileNav.js +0 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +2 -4
- package/dist/Outline/Outline.d.ts +2 -4
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -52
- package/dist/Outline/useOutlineFromMarkdown.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromMarkdown.js +1 -0
- package/dist/Outline/useScrollSpy.js +3 -3
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +56 -7
- package/dist/PowerSearch/PowerSearch.d.ts +36 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +571 -302
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
- package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +11 -1
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +160 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +33 -6
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +8 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +118 -260
- package/dist/Resizable/resizeGesture.d.ts +91 -0
- package/dist/Resizable/resizeGesture.d.ts.map +1 -0
- package/dist/Resizable/resizeGesture.js +251 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +3 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +115 -8
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +6 -0
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -0
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +10 -2
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +357 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +1349 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +70 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +264 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +96 -67
- package/dist/Selector/optionShape.d.ts +24 -0
- package/dist/Selector/optionShape.d.ts.map +1 -0
- package/dist/Selector/optionShape.js +48 -0
- package/dist/Selector/selectableOptionEntries.d.ts +20 -0
- package/dist/Selector/selectableOptionEntries.d.ts.map +1 -0
- package/dist/Selector/selectableOptionEntries.js +38 -0
- package/dist/Selector/utils.d.ts +2 -17
- package/dist/Selector/utils.d.ts.map +1 -1
- package/dist/Selector/utils.js +3 -51
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -9
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +200 -46
- package/dist/Switch/switchFill.d.ts +31 -0
- package/dist/Switch/switchFill.d.ts.map +1 -0
- package/dist/Switch/switchFill.js +88 -0
- package/dist/Switch/switchTouch.d.ts +74 -0
- package/dist/Switch/switchTouch.d.ts.map +1 -0
- package/dist/Switch/switchTouch.js +125 -0
- package/dist/Switch/useSwitchTouch.d.ts +276 -0
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -0
- package/dist/Switch/useSwitchTouch.js +939 -0
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +4 -3
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +10 -7
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +5 -0
- package/dist/Token/Token.d.ts +2 -2
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +13 -4
- package/dist/Token/TokenNamingContext.d.ts +14 -0
- package/dist/Token/TokenNamingContext.d.ts.map +1 -0
- package/dist/Token/TokenNamingContext.js +23 -0
- package/dist/Tokenizer/Tokenizer.d.ts +46 -59
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +44 -60
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +25 -28
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +157 -54
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +3 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +19 -0
- package/dist/Tooltip/Tooltip.d.ts +24 -5
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +29 -5
- package/dist/Tooltip/useTooltip.d.ts +48 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +90 -20
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +4 -7
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +4 -7
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -7
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +26 -15
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +142 -7
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +161 -22
- package/dist/gestures/PressTracker.d.ts +6 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +3 -0
- package/dist/gestures/types.d.ts +6 -0
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.d.ts.map +1 -1
- package/dist/gestures/usePressTracker.js +1 -0
- package/dist/gestures/wheelSegmenter.d.ts +14 -3
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +32 -8
- package/dist/hooks/actionGroupTracker.d.ts +7 -4
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +19 -56
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -0
- package/dist/hooks/useAttachment.d.ts +16 -8
- package/dist/hooks/useAttachment.d.ts.map +1 -1
- package/dist/hooks/useAttachment.js +35 -15
- package/dist/hooks/useFocusTrap.d.ts +15 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +13 -2
- package/dist/hooks/useHighlightedOptionScroll.d.ts +11 -1
- package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
- package/dist/hooks/useHighlightedOptionScroll.js +112 -11
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +7 -4
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +4 -2
- package/dist/hooks/usePager.d.ts +261 -0
- package/dist/hooks/usePager.d.ts.map +1 -0
- package/dist/hooks/usePager.js +1169 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts +8 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/InfoTip/InfoTip.generated.js +12 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearch.generated.js +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.js +7 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +33 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +33 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/internal/SheetConfirmation.d.ts +11 -0
- package/dist/internal/SheetConfirmation.d.ts.map +1 -0
- package/dist/internal/SheetConfirmation.js +92 -0
- package/dist/internal/sheetDraft.d.ts +35 -0
- package/dist/internal/sheetDraft.d.ts.map +1 -0
- package/dist/internal/sheetDraft.js +65 -0
- package/dist/internal/touch-sheet.d.ts +21 -0
- package/dist/internal/touch-sheet.d.ts.map +1 -0
- package/dist/internal/touch-sheet.js +19 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts +24 -0
- package/dist/internal/useDismissSearchOnTouchDrag.d.ts.map +1 -0
- package/dist/internal/useDismissSearchOnTouchDrag.js +56 -0
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +41 -18
- package/dist/motion/paging.d.ts +16 -5
- package/dist/motion/paging.d.ts.map +1 -1
- package/dist/motion/paging.js +34 -14
- package/dist/motion/reducedMotion.d.ts +24 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +78 -1
- package/dist/motion/roles.d.ts +7 -1
- package/dist/motion/roles.d.ts.map +1 -1
- package/dist/motion/roles.js +20 -1
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/motion/uikit/index.d.ts +7 -4
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +7 -4
- package/dist/motion/uikit/paging.d.ts +31 -20
- package/dist/motion/uikit/paging.d.ts.map +1 -1
- package/dist/motion/uikit/paging.js +41 -11
- package/dist/motion/uikit/progressBar.d.ts +27 -7
- package/dist/motion/uikit/progressBar.d.ts.map +1 -1
- package/dist/motion/uikit/progressBar.js +31 -11
- package/dist/motion/uikit/segmented.d.ts +55 -0
- package/dist/motion/uikit/segmented.d.ts.map +1 -0
- package/dist/motion/uikit/segmented.js +77 -0
- package/dist/motion/uikit/springs.d.ts +8 -42
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +12 -42
- package/dist/motion/uikit/switch.d.ts +166 -0
- package/dist/motion/uikit/switch.d.ts.map +1 -0
- package/dist/motion/uikit/switch.js +186 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts +18 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressHoldsDrag.stylex.js +28 -0
- package/dist/privateAttributes/segmentTitle.stylex.d.ts +5 -0
- package/dist/privateAttributes/segmentTitle.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/segmentTitle.stylex.js +22 -0
- package/dist/utils/browserClickWait.d.ts +35 -0
- package/dist/utils/browserClickWait.d.ts.map +1 -0
- package/dist/utils/browserClickWait.js +123 -0
- package/dist/utils/clickGuard.d.ts +14 -1
- package/dist/utils/clickGuard.d.ts.map +1 -1
- package/dist/utils/clickGuard.js +46 -1
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +12 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +24 -6
- package/locales/en.json +128 -0
- package/locales/pseudo.json +96 -0
- package/package.json +13 -8
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +37 -5
- package/src/AppShell/useCloseMobileDrawerOnActivate.ts +52 -0
- package/src/Avatar/Avatar.tsx +3 -1
- package/src/BottomSheet/BottomSheet.tsx +95 -10
- package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
- package/src/BottomSheet/bottomSheetStack.ts +8 -4
- package/src/BottomSheet/useSheetGestures.ts +3 -1
- package/src/Breadcrumbs/BreadcrumbItem.tsx +17 -4
- package/src/Button/Button.tsx +66 -7
- package/src/CheckboxList/CheckboxList.doc.mjs +4 -2
- package/src/CheckboxList/CheckboxList.tsx +6 -0
- package/src/CheckboxList/CheckboxListContext.tsx +6 -0
- package/src/CheckboxList/CheckboxListItem.tsx +11 -2
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/DateInput/DateInput.tsx +8 -2
- package/src/DateInput/MonthScroller.tsx +18 -22
- package/src/DateInput/Wheel.tsx +172 -14
- package/src/DateRangeInput/DateRangeInput.doc.mjs +3 -2
- package/src/DateRangeInput/DateRangeInput.tsx +117 -71
- package/src/DateTimeInput/DateTimeInput.tsx +8 -2
- package/src/Dialog/Dialog.tsx +81 -15
- package/src/Drawer/Drawer.tsx +28 -11
- package/src/Drawer/useDrawerDialogPresence.ts +9 -1
- package/src/DropdownMenu/DropdownMenu.tsx +28 -6
- package/src/Field/Field.tsx +2 -2
- package/src/Field/PanelSearchInput.tsx +11 -0
- package/src/HoverCard/HoverCard.tsx +31 -1
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/InfoTip/InfoTip.doc.mjs +192 -0
- package/src/InfoTip/InfoTip.tsx +186 -0
- package/src/InfoTip/index.ts +14 -0
- package/src/Layer/layerAnimations.stylex.ts +24 -16
- package/src/Layer/layerClickBoundary.ts +2 -2
- package/src/Layer/useBackdropPress.ts +81 -0
- package/src/Layer/usePressPin.ts +576 -0
- package/src/Layer/useTouchTrigger.ts +56 -6
- package/src/Lightbox/Lightbox.tsx +2 -1
- package/src/MobileNav/MobileNav.tsx +1 -1
- package/src/MultiSelector/hooks.ts +2 -4
- package/src/Outline/Outline.doc.mjs +177 -51
- package/src/Outline/Outline.tsx +5 -57
- package/src/Outline/useOutlineFromMarkdown.doc.mjs +157 -0
- package/src/Outline/useOutlineFromMarkdown.ts +1 -0
- package/src/Outline/useScrollSpy.ts +3 -3
- package/src/Popover/usePopover.tsx +71 -9
- package/src/PowerSearch/PowerSearch.doc.mjs +55 -6
- package/src/PowerSearch/PowerSearch.tsx +798 -324
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
- package/src/PowerSearch/formatFilterValue.ts +18 -1
- package/src/PowerSearch/formatTokenValue.ts +215 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +4 -2
- package/src/ProgressBar/ProgressBar.tsx +67 -7
- package/src/RadioList/RadioList.doc.mjs +4 -2
- package/src/RadioList/RadioList.tsx +7 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/ResizeHandle.tsx +133 -328
- package/src/Resizable/resizeGesture.ts +368 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
- package/src/SegmentedControl/SegmentedControl.tsx +179 -5
- package/src/SegmentedControl/SegmentedControlContext.ts +6 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +14 -2
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +1640 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +308 -0
- package/src/Selector/Selector.tsx +136 -89
- package/src/Selector/optionShape.ts +64 -0
- package/src/Selector/selectableOptionEntries.ts +39 -0
- package/src/Selector/utils.ts +9 -68
- package/src/SideNav/SideNavItem.tsx +3 -7
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Switch/Switch.doc.mjs +3 -3
- package/src/Switch/Switch.tsx +412 -86
- package/src/Switch/switchFill.ts +106 -0
- package/src/Switch/switchTouch.ts +186 -0
- package/src/Switch/useSwitchTouch.ts +1051 -0
- package/src/TabList/Tab.tsx +5 -3
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.tsx +5 -0
- package/src/Token/Token.tsx +15 -4
- package/src/Token/TokenNamingContext.ts +28 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +16 -0
- package/src/Tokenizer/Tokenizer.tsx +93 -88
- package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
- package/src/Tooltip/Tooltip.doc.mjs +123 -39
- package/src/Tooltip/Tooltip.tsx +43 -9
- package/src/Tooltip/useTooltip.doc.mjs +171 -31
- package/src/Tooltip/useTooltip.tsx +137 -22
- package/src/TopNav/TopNavItem.tsx +6 -5
- package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
- package/src/TopNav/TopNavMenu.tsx +6 -5
- package/src/Typeahead/Typeahead.tsx +29 -15
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/GestureHost.ts +205 -21
- package/src/gestures/PressTracker.ts +10 -0
- package/src/gestures/types.ts +6 -0
- package/src/gestures/usePressTracker.ts +2 -0
- package/src/gestures/wheelSegmenter.ts +36 -7
- package/src/hooks/actionGroupTracker.ts +32 -61
- package/src/hooks/index.ts +2 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAttachment.ts +56 -14
- package/src/hooks/useFocusTrap.ts +26 -2
- package/src/hooks/useHighlightedOptionScroll.ts +123 -15
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useMediaQuery.doc.mjs +2 -2
- package/src/hooks/useMediaQuery.ts +13 -4
- package/src/hooks/useMenuPress.ts +8 -2
- package/src/hooks/usePager.ts +1446 -0
- package/src/i18n/generated-english/InfoTip/InfoTip.generated.ts +13 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearch.generated.ts +1 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-english/Tokenizer/TokenizerBottomSheet.generated.ts +7 -1
- package/src/i18n/generated-locales/en.generated.ts +43 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +44 -0
- package/src/index.ts +14 -0
- package/src/internal/SheetConfirmation.tsx +101 -0
- package/src/internal/sheetDraft.ts +80 -0
- package/src/internal/touch-sheet.ts +21 -0
- package/src/internal/useDismissSearchOnTouchDrag.ts +69 -0
- package/src/motion/MEASUREMENTS.md +36 -27
- package/src/motion/README.md +11 -6
- package/src/motion/animator.ts +61 -29
- package/src/motion/paging.ts +37 -14
- package/src/motion/reducedMotion.ts +79 -1
- package/src/motion/roles.ts +20 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/motion/uikit/index.ts +6 -5
- package/src/motion/uikit/paging.ts +41 -10
- package/src/motion/uikit/progressBar.ts +31 -11
- package/src/motion/uikit/segmented.ts +74 -0
- package/src/motion/uikit/springs.ts +12 -42
- package/src/motion/uikit/switch.ts +174 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
- package/src/privateAttributes/pressHoldsDrag.stylex.ts +28 -0
- package/src/privateAttributes/segmentTitle.stylex.ts +22 -0
- package/src/utils/browserClickWait.ts +133 -0
- package/src/utils/clickGuard.ts +64 -1
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +24 -6
- package/dist/internal/tokenizer-presentation.d.ts +0 -21
- package/dist/internal/tokenizer-presentation.d.ts.map +0 -1
- package/dist/internal/tokenizer-presentation.js +0 -21
- package/src/internal/tokenizer-presentation.ts +0 -25
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* @input Uses React use/useRef/useEffect, stylex, theme tokens, BreadcrumbContext,
|
|
8
8
|
* rtlStyles for the contextual default slash, and (for the menu trigger)
|
|
9
9
|
* usePopover + the shared DropdownMenu item API (renderDropdownItems,
|
|
10
|
-
* DropdownMenuContext, MENU_ITEM_SELECTOR, useListFocus)
|
|
10
|
+
* DropdownMenuContext, MENU_ITEM_SELECTOR, useListFocus), and
|
|
11
|
+
* the AppShell mobile drawer helpers
|
|
11
12
|
* @output Exports BreadcrumbItem component and BreadcrumbItemProps
|
|
12
13
|
* @position Individual breadcrumb item; used inside Breadcrumbs
|
|
13
14
|
*
|
|
@@ -72,7 +73,12 @@ import {
|
|
|
72
73
|
import type {DropdownMenuOption} from '../DropdownMenu/DropdownMenu';
|
|
73
74
|
|
|
74
75
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
76
|
+
import {
|
|
77
|
+
useCloseMobileDrawerOnActivate,
|
|
78
|
+
useIsInAppShellMobileDrawer,
|
|
79
|
+
} from '../AppShell/useCloseMobileDrawerOnActivate';
|
|
75
80
|
import {useInteractionModalityTracking} from '../utils/interactionModality';
|
|
81
|
+
import {isRenderable} from '../utils/isRenderable';
|
|
76
82
|
// =============================================================================
|
|
77
83
|
// Props
|
|
78
84
|
// =============================================================================
|
|
@@ -305,6 +311,11 @@ export function BreadcrumbItem({
|
|
|
305
311
|
// aria-current on this instead of guessing the <li>'s last child.
|
|
306
312
|
const contentRef = useRef<HTMLElement>(null);
|
|
307
313
|
|
|
314
|
+
const closeDrawerAfter = useCloseMobileDrawerOnActivate(
|
|
315
|
+
useIsInAppShellMobileDrawer(),
|
|
316
|
+
);
|
|
317
|
+
const handleActivate = closeDrawerAfter(onClick);
|
|
318
|
+
|
|
308
319
|
const isCurrent = isCurrentProp === true;
|
|
309
320
|
const isAutoCandidate = isCurrentProp == null;
|
|
310
321
|
const hasMenu = menu != null;
|
|
@@ -373,7 +384,9 @@ export function BreadcrumbItem({
|
|
|
373
384
|
|
|
374
385
|
const content = (
|
|
375
386
|
<>
|
|
376
|
-
{startIcon &&
|
|
387
|
+
{isRenderable(startIcon) && (
|
|
388
|
+
<span {...stylex.props(itemStyles.icon)}>{startIcon}</span>
|
|
389
|
+
)}
|
|
377
390
|
{children}
|
|
378
391
|
</>
|
|
379
392
|
);
|
|
@@ -453,7 +466,7 @@ export function BreadcrumbItem({
|
|
|
453
466
|
<LinkComponent
|
|
454
467
|
ref={contentRef}
|
|
455
468
|
href={href}
|
|
456
|
-
onClick={
|
|
469
|
+
onClick={handleActivate}
|
|
457
470
|
{...focusOutlineProps.focusVisible(
|
|
458
471
|
itemStyles.link,
|
|
459
472
|
isSupporting ? itemStyles.supportingLink : itemStyles.defaultLink,
|
|
@@ -464,7 +477,7 @@ export function BreadcrumbItem({
|
|
|
464
477
|
<button
|
|
465
478
|
ref={contentRef as React.RefObject<HTMLButtonElement | null>}
|
|
466
479
|
type="button"
|
|
467
|
-
onClick={
|
|
480
|
+
onClick={handleActivate}
|
|
468
481
|
{...focusOutlineProps.focusVisible(
|
|
469
482
|
itemStyles.link,
|
|
470
483
|
itemStyles.buttonReset,
|
package/src/Button/Button.tsx
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import {
|
|
22
|
+
isValidElement,
|
|
22
23
|
use,
|
|
23
24
|
useEffect,
|
|
24
25
|
useRef,
|
|
@@ -44,6 +45,7 @@ import {
|
|
|
44
45
|
focusVars,
|
|
45
46
|
} from '../theme/tokens.stylex';
|
|
46
47
|
import {Spinner} from '../Spinner/Spinner';
|
|
48
|
+
import {Icon} from '../Icon/Icon';
|
|
47
49
|
import {VisuallyHidden} from '../VisuallyHidden/VisuallyHidden';
|
|
48
50
|
import {IconDefaultSizeProvider} from '../Icon/IconDefaultSizeContext';
|
|
49
51
|
import {iconBoxSizeStyles, type IconSize} from '../Icon/IconSize.stylex';
|
|
@@ -51,6 +53,7 @@ import {iconBoxSizeStyles, type IconSize} from '../Icon/IconSize.stylex';
|
|
|
51
53
|
import {EDGE_COMP_ATTR} from '../Layout/edgeCompensation.stylex';
|
|
52
54
|
import {useSize} from '../SizeContext/SizeContext';
|
|
53
55
|
import {useButtonGroup} from '../ButtonGroup/ButtonGroupContext';
|
|
56
|
+
import {PressGroupContext} from '../hooks/pressGroupContext';
|
|
54
57
|
import {useInputGroup} from '../InputGroup/InputGroupContext';
|
|
55
58
|
import {InputGroupInternalContext} from '../InputGroup/InputGroupInternalContext';
|
|
56
59
|
import {
|
|
@@ -71,9 +74,16 @@ import {
|
|
|
71
74
|
useComponentTranslator,
|
|
72
75
|
} from '../i18n/useComponentTranslator';
|
|
73
76
|
import english from '../i18n/generated-english/Button/Button.generated';
|
|
77
|
+
import {isRenderable} from '../utils/isRenderable';
|
|
74
78
|
|
|
75
79
|
registerEnglishFallback(english);
|
|
76
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Written by the press controller or a group's tracker while a press is
|
|
83
|
+
* believed. Typed `string`, so StyleX reads it as a computed key.
|
|
84
|
+
*/
|
|
85
|
+
const PRESSED_ON: string = '[data-astryx-press="on"]';
|
|
86
|
+
|
|
77
87
|
/**
|
|
78
88
|
* Base button styles
|
|
79
89
|
* Pseudo-classes are nested within properties per StyleX recommendation:
|
|
@@ -135,7 +145,19 @@ const styles = stylex.create({
|
|
|
135
145
|
default: 'scale(0.98)',
|
|
136
146
|
'@media (pointer: coarse)': 'scale(1)',
|
|
137
147
|
},
|
|
138
|
-
|
|
148
|
+
[PRESSED_ON]: 'scale(0.98)',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
// A tracked action's own `:active` image paints nothing: the tracker paints
|
|
152
|
+
// the action under the pointer, which need not be the one pressed first.
|
|
153
|
+
trackedOverlay: {
|
|
154
|
+
backgroundSize: {default: null, [`:active:not(${PRESSED_ON})`]: '0 0'},
|
|
155
|
+
},
|
|
156
|
+
// A tracked action's press is painted by its group's tracker alone.
|
|
157
|
+
pressableTracked: {
|
|
158
|
+
transform: {
|
|
159
|
+
default: 'scale(1)',
|
|
160
|
+
[PRESSED_ON]: 'scale(0.98)',
|
|
139
161
|
},
|
|
140
162
|
},
|
|
141
163
|
inactive: {
|
|
@@ -144,7 +166,7 @@ const styles = stylex.create({
|
|
|
144
166
|
transform: {
|
|
145
167
|
default: 'none',
|
|
146
168
|
':active': 'none',
|
|
147
|
-
|
|
169
|
+
[PRESSED_ON]: 'none',
|
|
148
170
|
},
|
|
149
171
|
},
|
|
150
172
|
disabled: {
|
|
@@ -157,7 +179,7 @@ const styles = stylex.create({
|
|
|
157
179
|
backgroundImage: {
|
|
158
180
|
default: 'none',
|
|
159
181
|
':active': 'none',
|
|
160
|
-
|
|
182
|
+
[PRESSED_ON]: 'none',
|
|
161
183
|
},
|
|
162
184
|
},
|
|
163
185
|
iconOnly: {
|
|
@@ -558,6 +580,21 @@ const groupStyles = stylex.create({
|
|
|
558
580
|
},
|
|
559
581
|
});
|
|
560
582
|
|
|
583
|
+
/**
|
|
584
|
+
* Whether `node` adds nothing to a content name: nothing renders, or an Icon
|
|
585
|
+
* with no label. Any other node can add text.
|
|
586
|
+
*/
|
|
587
|
+
function addsNoName(node: ReactNode): boolean {
|
|
588
|
+
if (!isRenderable(node)) {
|
|
589
|
+
return true;
|
|
590
|
+
}
|
|
591
|
+
if (!isValidElement<{label?: unknown}>(node) || node.type !== Icon) {
|
|
592
|
+
return false;
|
|
593
|
+
}
|
|
594
|
+
const {label} = node.props;
|
|
595
|
+
return typeof label !== 'string' || label.trim() === '';
|
|
596
|
+
}
|
|
597
|
+
|
|
561
598
|
/**
|
|
562
599
|
* A versatile button component with multiple variants.
|
|
563
600
|
*
|
|
@@ -614,6 +651,7 @@ export function Button({
|
|
|
614
651
|
const t = useComponentTranslator();
|
|
615
652
|
const size = useSize(sizeProp, 'md');
|
|
616
653
|
const buttonGroup = useButtonGroup();
|
|
654
|
+
const isGroupTracked = use(PressGroupContext);
|
|
617
655
|
const inputGroup = useInputGroup();
|
|
618
656
|
|
|
619
657
|
const [isPending, startTransition] = useTransition();
|
|
@@ -742,11 +780,13 @@ export function Button({
|
|
|
742
780
|
sizeStyles[size],
|
|
743
781
|
isIconOnly && styles.iconOnly,
|
|
744
782
|
interactionOverlayStyles.backgroundImage,
|
|
783
|
+
isGroupTracked && styles.trackedOverlay,
|
|
745
784
|
buttonDisabled && styles.inactive,
|
|
746
785
|
isTrueDisabled && styles.disabled,
|
|
747
786
|
useAriaDisabled && styles.ariaDisabled,
|
|
748
787
|
renderAsLink && styles.link,
|
|
749
|
-
!buttonGroup &&
|
|
788
|
+
!buttonGroup &&
|
|
789
|
+
(isGroupTracked ? styles.pressableTracked : styles.pressable),
|
|
750
790
|
buttonGroup &&
|
|
751
791
|
(buttonGroup.orientation === 'horizontal'
|
|
752
792
|
? groupStyles.horizontal
|
|
@@ -803,7 +843,7 @@ export function Button({
|
|
|
803
843
|
: loadingStyles.hiddenContent),
|
|
804
844
|
)}
|
|
805
845
|
aria-hidden={isLoadingState || undefined}>
|
|
806
|
-
{icon && (
|
|
846
|
+
{isRenderable(icon) && (
|
|
807
847
|
<span
|
|
808
848
|
{...stylex.props(styles.iconWrapper, iconBoxSizeStyles[iconSize])}>
|
|
809
849
|
<IconDefaultSizeProvider value={iconSize}>
|
|
@@ -814,7 +854,7 @@ export function Button({
|
|
|
814
854
|
{isIconOnly ? null : (
|
|
815
855
|
<span {...stylex.props(styles.labelText)}>{children ?? label}</span>
|
|
816
856
|
)}
|
|
817
|
-
{!isIconOnly && endContent && (
|
|
857
|
+
{!isIconOnly && isRenderable(endContent) && (
|
|
818
858
|
<span {...stylex.props(styles.endContentWrapper)}>{endContent}</span>
|
|
819
859
|
)}
|
|
820
860
|
</span>
|
|
@@ -835,10 +875,29 @@ export function Button({
|
|
|
835
875
|
(children != null && children !== label);
|
|
836
876
|
const ariaLabelProp = needsAriaLabel ? {'aria-label': label} : null;
|
|
837
877
|
|
|
878
|
+
// The Button's accessible name when props decide it: the derived
|
|
879
|
+
// aria-label, else a caller aria-label, else the label text alone. It is
|
|
880
|
+
// not known here when a caller aria-labelledby names the Button from other
|
|
881
|
+
// elements, or when `icon` or `endContent` can add text to its content
|
|
882
|
+
// name (a count, for example). A decorative Icon in either slot adds none.
|
|
883
|
+
const accessibleName =
|
|
884
|
+
props['aria-labelledby'] != null
|
|
885
|
+
? undefined
|
|
886
|
+
: needsAriaLabel
|
|
887
|
+
? label
|
|
888
|
+
: (props['aria-label'] ??
|
|
889
|
+
(addsNoName(icon) && addsNoName(endContent) ? label : undefined));
|
|
890
|
+
// A tooltip that repeats the name adds nothing to the description, so a
|
|
891
|
+
// screen reader does not read the same words twice.
|
|
892
|
+
const isTooltipName =
|
|
893
|
+
tooltip != null &&
|
|
894
|
+
accessibleName != null &&
|
|
895
|
+
tooltip.trim() === accessibleName.trim();
|
|
896
|
+
|
|
838
897
|
// When a tooltip is attached via the hook, point aria-describedby at the
|
|
839
898
|
// tooltip content (composing with any consumer-provided value).
|
|
840
899
|
const describedByProp =
|
|
841
|
-
tooltip != null
|
|
900
|
+
tooltip != null && !isTooltipName
|
|
842
901
|
? {
|
|
843
902
|
'aria-describedby':
|
|
844
903
|
[props['aria-describedby'], tooltipHook.describedBy]
|
|
@@ -178,12 +178,14 @@ export const docs = {
|
|
|
178
178
|
{
|
|
179
179
|
name: 'containerClassName',
|
|
180
180
|
type: 'string',
|
|
181
|
-
description:
|
|
181
|
+
description:
|
|
182
|
+
'Class name for the field container. Same targeting as `containerXstyle`.',
|
|
182
183
|
},
|
|
183
184
|
{
|
|
184
185
|
name: 'containerStyle',
|
|
185
186
|
type: 'CSSProperties',
|
|
186
|
-
description:
|
|
187
|
+
description:
|
|
188
|
+
'Inline styles for the field container. Same targeting as `containerXstyle`.',
|
|
187
189
|
},
|
|
188
190
|
{
|
|
189
191
|
name: 'controlXstyle',
|
|
@@ -246,6 +246,7 @@ export function CheckboxList({
|
|
|
246
246
|
? disabledMessageTooltip.describedBy
|
|
247
247
|
: undefined,
|
|
248
248
|
isReadOnly,
|
|
249
|
+
isInvalid: status?.type === 'error',
|
|
249
250
|
loadingValues,
|
|
250
251
|
}),
|
|
251
252
|
[
|
|
@@ -256,6 +257,7 @@ export function CheckboxList({
|
|
|
256
257
|
showsDisabledMessage,
|
|
257
258
|
disabledMessageTooltip.describedBy,
|
|
258
259
|
isReadOnly,
|
|
260
|
+
status?.type,
|
|
259
261
|
loadingValues,
|
|
260
262
|
],
|
|
261
263
|
);
|
|
@@ -298,6 +300,10 @@ export function CheckboxList({
|
|
|
298
300
|
controlStyle,
|
|
299
301
|
)}
|
|
300
302
|
role="group"
|
|
303
|
+
// Screen readers announce the whole group as unavailable. Its dimmed
|
|
304
|
+
// label then labels a disabled control. An enabled list keeps a
|
|
305
|
+
// caller's own value.
|
|
306
|
+
aria-disabled={isDisabled || rest['aria-disabled']}
|
|
301
307
|
// A caller aria-labelledby names the group together with its label.
|
|
302
308
|
aria-labelledby={joinAriaIDs(labelID, ariaLabelledByProp)}
|
|
303
309
|
aria-describedby={
|
|
@@ -37,6 +37,12 @@ export interface CheckboxListContextValue {
|
|
|
37
37
|
*/
|
|
38
38
|
disabledMessageID?: string;
|
|
39
39
|
isReadOnly: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* True when the list has an error `status`. Each checkbox is then
|
|
42
|
+
* `aria-invalid`. Some screen readers skip a group's invalid state when a
|
|
43
|
+
* checkbox takes focus.
|
|
44
|
+
*/
|
|
45
|
+
isInvalid?: boolean;
|
|
40
46
|
/**
|
|
41
47
|
* Values of the items whose `changeAction` is pending. Each matching item
|
|
42
48
|
* renders an in-checkbox spinner and blocks re-toggling; the list is empty
|
|
@@ -24,6 +24,7 @@ import {colorVars} from '../theme/tokens.stylex';
|
|
|
24
24
|
import type {BaseProps} from '../BaseProps';
|
|
25
25
|
import {CheckboxInput} from '../CheckboxInput/CheckboxInput';
|
|
26
26
|
import type {CheckboxInputProps} from '../CheckboxInput/CheckboxInput';
|
|
27
|
+
import type {InputStatus} from '../Field/types';
|
|
27
28
|
import {ListItem} from '../List/ListItem';
|
|
28
29
|
import {ListContext} from '../List/ListContext';
|
|
29
30
|
import {CheckboxListContext} from './CheckboxListContext';
|
|
@@ -149,6 +150,8 @@ export interface CheckboxListItemProps extends BaseProps<HTMLLIElement> {
|
|
|
149
150
|
// Component
|
|
150
151
|
// =============================================================================
|
|
151
152
|
|
|
153
|
+
const ERROR_STATUS: InputStatus = {type: 'error'};
|
|
154
|
+
|
|
152
155
|
/**
|
|
153
156
|
* The row's visible description is the checkbox's accessible description. Item
|
|
154
157
|
* renders that element and owns its id, and publishes the id through
|
|
@@ -167,11 +170,17 @@ function DescribedCheckboxInput(
|
|
|
167
170
|
props: Omit<CheckboxInputProps, 'aria-describedby'>,
|
|
168
171
|
) {
|
|
169
172
|
const describedBy = use(ItemDescriptionContext);
|
|
170
|
-
const
|
|
173
|
+
const listContext = use(CheckboxListContext);
|
|
171
174
|
return (
|
|
172
175
|
<CheckboxInput
|
|
173
176
|
{...props}
|
|
174
|
-
aria-describedby={joinAriaIDs(
|
|
177
|
+
aria-describedby={joinAriaIDs(
|
|
178
|
+
describedBy ?? undefined,
|
|
179
|
+
listContext?.disabledMessageID,
|
|
180
|
+
)}
|
|
181
|
+
// The status has no message, so CheckboxInput renders nothing. The list
|
|
182
|
+
// renders the message.
|
|
183
|
+
status={listContext?.isInvalid ? ERROR_STATUS : undefined}
|
|
175
184
|
/>
|
|
176
185
|
);
|
|
177
186
|
}
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
} from '../Field/fieldParts';
|
|
36
36
|
import {useDevWarning} from '../hooks/useDevWarning';
|
|
37
37
|
import {mergeRefs} from '../utils/mergeRefs';
|
|
38
|
+
import {isFocusLost} from '../utils/focusReturn';
|
|
38
39
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
39
40
|
import {useBusyAnnouncement} from '../hooks/useBusyAnnouncement';
|
|
40
41
|
import {Field, inputWrapperStyles} from '../Field';
|
|
@@ -347,7 +348,10 @@ export interface ComplexSelectorRenderState {
|
|
|
347
348
|
export interface ComplexSelectorHandle {
|
|
348
349
|
/** Open the selector surface. No-op when disabled or already open. */
|
|
349
350
|
open(): void;
|
|
350
|
-
/**
|
|
351
|
+
/**
|
|
352
|
+
* Close the selector surface. Focus returns to the trigger only when it
|
|
353
|
+
* would otherwise be lost; a caller-rendered trigger always gets it back.
|
|
354
|
+
*/
|
|
351
355
|
close(): void;
|
|
352
356
|
/** Toggle the selector surface open or closed. */
|
|
353
357
|
toggle(): void;
|
|
@@ -630,12 +634,22 @@ export function ComplexSelector<Value>({
|
|
|
630
634
|
onOpenChange?.(true);
|
|
631
635
|
}, [onOpenChange]);
|
|
632
636
|
|
|
637
|
+
// The popup's content element, read when it closes.
|
|
638
|
+
const popupContentRef = useRef<HTMLElement | null>(null);
|
|
639
|
+
const hasCallerTrigger = renderTrigger != null;
|
|
633
640
|
const handlePopoverHide = useCallback(() => {
|
|
634
|
-
|
|
635
|
-
//
|
|
636
|
-
|
|
641
|
+
const trigger = triggerRef.current;
|
|
642
|
+
// A press that moved focus to another control keeps it there. A caller's
|
|
643
|
+
// control always gets focus back. Focus moves before the callback, so a
|
|
644
|
+
// consumer that moves it from the callback wins.
|
|
645
|
+
if (
|
|
646
|
+
hasCallerTrigger ||
|
|
647
|
+
isFocusLost(popupContentRef.current, trigger?.ownerDocument)
|
|
648
|
+
) {
|
|
649
|
+
trigger?.focus();
|
|
650
|
+
}
|
|
637
651
|
onOpenChange?.(false);
|
|
638
|
-
}, [onOpenChange]);
|
|
652
|
+
}, [hasCallerTrigger, onOpenChange]);
|
|
639
653
|
|
|
640
654
|
const popover = usePopover({
|
|
641
655
|
dialogLabel: label,
|
|
@@ -645,6 +659,7 @@ export function ComplexSelector<Value>({
|
|
|
645
659
|
onShow: handlePopoverShow,
|
|
646
660
|
onHide: handlePopoverHide,
|
|
647
661
|
});
|
|
662
|
+
popupContentRef.current = popover.contentRef.current;
|
|
648
663
|
|
|
649
664
|
const isOpen = popover.isOpen;
|
|
650
665
|
|
|
@@ -884,12 +884,18 @@ function PointerDateField({
|
|
|
884
884
|
if (!isEffectivelyDisabled) {
|
|
885
885
|
popover.show({skipAutoFocus: true});
|
|
886
886
|
}
|
|
887
|
-
} else if (
|
|
887
|
+
} else if (
|
|
888
|
+
e.key === 'Enter' &&
|
|
889
|
+
(pendingInput !== null || isEffectivelyDisabled)
|
|
890
|
+
) {
|
|
891
|
+
// Typed text holds Enter back, or a form would submit the value from
|
|
892
|
+
// before the commit. A disabled or busy field must not submit its
|
|
893
|
+
// form either. Otherwise Enter keeps its default, as in any text field.
|
|
888
894
|
e.preventDefault();
|
|
889
895
|
commitPendingInput();
|
|
890
896
|
}
|
|
891
897
|
},
|
|
892
|
-
[popover, commitPendingInput, isEffectivelyDisabled],
|
|
898
|
+
[popover, commitPendingInput, isEffectivelyDisabled, pendingInput],
|
|
893
899
|
);
|
|
894
900
|
|
|
895
901
|
const inputWrapper = (
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
useRef,
|
|
39
39
|
useState,
|
|
40
40
|
} from 'react';
|
|
41
|
+
import {flushSync} from 'react-dom';
|
|
41
42
|
import * as stylex from '@stylexjs/stylex';
|
|
42
43
|
import {useCalendarDays} from '../Calendar';
|
|
43
44
|
import {useDirection, useLocale} from '../i18n';
|
|
@@ -62,7 +63,11 @@ import {
|
|
|
62
63
|
plainDateToISO,
|
|
63
64
|
DATE_FORMAT_WITH_WEEKDAY,
|
|
64
65
|
} from '../utils';
|
|
65
|
-
import {
|
|
66
|
+
import {
|
|
67
|
+
playReducedMotionDip,
|
|
68
|
+
reducedMotionFade,
|
|
69
|
+
type ReducedMotionDip,
|
|
70
|
+
} from '../motion/reducedMotion';
|
|
66
71
|
import {dateInputTouchSizes, dateInputTouchGeometry} from './tokens.stylex';
|
|
67
72
|
import {useOwnScrollGesture} from './useOwnScrollGesture';
|
|
68
73
|
import {useScrollSettle} from './useScrollSettle';
|
|
@@ -434,17 +439,12 @@ export function MonthScroller({
|
|
|
434
439
|
|
|
435
440
|
// The Reduced Motion dip of a step on a touch screen, owned here so a
|
|
436
441
|
// second step or the unmount clears it.
|
|
437
|
-
const dipRef = useRef<
|
|
442
|
+
const dipRef = useRef<ReducedMotionDip | null>(null);
|
|
438
443
|
const stopDip = useCallback(() => {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
window.clearTimeout(dip.timer);
|
|
442
|
-
dip.animation.cancel();
|
|
443
|
-
dipRef.current = null;
|
|
444
|
-
}
|
|
444
|
+
dipRef.current?.cancel();
|
|
445
|
+
dipRef.current = null;
|
|
445
446
|
}, []);
|
|
446
|
-
// Synchronizes with the dip's
|
|
447
|
-
// scroller.
|
|
447
|
+
// Synchronizes with the dip's animations: they do not outlive the scroller.
|
|
448
448
|
useEffect(() => stopDip, [stopDip]);
|
|
449
449
|
|
|
450
450
|
const scrollToMonth = useCallback(
|
|
@@ -505,18 +505,14 @@ export function MonthScroller({
|
|
|
505
505
|
land();
|
|
506
506
|
return;
|
|
507
507
|
}
|
|
508
|
-
// A
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
)
|
|
515
|
-
|
|
516
|
-
dipRef.current = null;
|
|
517
|
-
land();
|
|
518
|
-
}, fade.duration / 2),
|
|
519
|
-
};
|
|
508
|
+
// A newer step replaces this one: only its scroll lands.
|
|
509
|
+
dipRef.current = playReducedMotionDip(scroller, fade, () => {
|
|
510
|
+
dipRef.current = null;
|
|
511
|
+
// The fade-in starts as soon as this returns. So render now: the
|
|
512
|
+
// scroll lands in the layout effect, before the fade-in.
|
|
513
|
+
// eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the month must change before the dip's fade-in starts
|
|
514
|
+
flushSync(land);
|
|
515
|
+
});
|
|
520
516
|
return;
|
|
521
517
|
}
|
|
522
518
|
steeredRowRef.current = row;
|