@astryxdesign/core 0.7.7-canary.c0929c8 → 0.7.7-canary.c19ca12
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/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 +7 -3
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +47 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +13 -2
- 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/ContextMenu/ContextMenu.js +2 -2
- 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.map +1 -1
- package/dist/DateInput/Wheel.js +22 -41
- 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 +23 -45
- 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 +5 -1
- 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 +4 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +27 -2
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +17 -31
- 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/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 +20 -10
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +66 -18
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +18 -0
- 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/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/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 +8 -1
- 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/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +60 -58
- package/dist/Switch/switchTouch.d.ts +0 -7
- package/dist/Switch/switchTouch.d.ts.map +1 -1
- package/dist/Switch/switchTouch.js +2 -10
- package/dist/Switch/useSwitchTouch.d.ts +2 -11
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +35 -93
- 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 +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +30 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +94 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- 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 +40 -57
- 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 +25 -30
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +24 -5
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +45 -28
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +52 -59
- 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/TypeaheadItem.d.ts +2 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- 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 +96 -7
- package/dist/gestures/GestureHost.d.ts +27 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +157 -21
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- 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 +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- 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/useLongPress.d.ts +6 -2
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +95 -15
- 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/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/indicatorPress.stylex.d.ts +20 -0
- package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
- package/dist/internal/indicatorPress.stylex.js +26 -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/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 +6 -5
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +6 -5
- 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 +0 -18
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +5 -21
- 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/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/focusReturn.d.ts +15 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +28 -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 +19 -6
- package/dist/utils/triggerFocus.d.ts +36 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -0
- package/dist/utils/triggerFocus.js +65 -0
- package/locales/en.json +128 -0
- package/locales/pseudo.json +96 -0
- package/package.json +18 -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/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 +13 -3
- package/src/Button/Button.tsx +63 -5
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +36 -9
- 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/ContextMenu/ContextMenu.tsx +2 -2
- package/src/DateInput/DateInput.tsx +8 -2
- package/src/DateInput/MonthScroller.tsx +18 -22
- package/src/DateInput/Wheel.tsx +30 -32
- package/src/DateTimeInput/DateTimeInput.tsx +8 -2
- package/src/Dialog/Dialog.tsx +54 -45
- package/src/Drawer/Drawer.tsx +28 -11
- package/src/Drawer/useDrawerDialogPresence.ts +5 -1
- package/src/Field/Field.tsx +2 -2
- package/src/Field/PanelSearchInput.tsx +11 -0
- package/src/HoverCard/HoverCard.doc.mjs +4 -2
- package/src/HoverCard/HoverCard.tsx +35 -4
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +46 -52
- 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/useBackdropPress.ts +81 -0
- package/src/Layer/usePressPin.ts +86 -26
- package/src/Lightbox/Lightbox.tsx +18 -0
- 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/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/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 +12 -1
- 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/Spinner/Spinner.tsx +77 -63
- package/src/Switch/switchTouch.ts +2 -10
- package/src/Switch/useSwitchTouch.ts +38 -104
- package/src/Table/BaseTable.tsx +46 -12
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +57 -32
- package/src/Toast/ToastViewport.tsx +121 -35
- package/src/Toast/types.ts +9 -3
- 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 +89 -85
- package/src/Tokenizer/TokenizerBottomSheet.tsx +219 -93
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +24 -0
- package/src/Tooltip/Tooltip.doc.mjs +123 -54
- package/src/Tooltip/Tooltip.tsx +36 -39
- package/src/Tooltip/index.ts +0 -1
- package/src/Tooltip/useTooltip.doc.mjs +171 -33
- package/src/Tooltip/useTooltip.tsx +98 -86
- package/src/TopNav/TopNavItem.tsx +6 -5
- package/src/TopNav/TopNavMegaMenuItem.tsx +6 -5
- package/src/TopNav/TopNavMenu.tsx +6 -5
- package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/GestureHost.ts +198 -20
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +7 -1
- 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 +1 -1
- package/src/hooks/useHighlightedOptionScroll.ts +123 -15
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +136 -15
- package/src/hooks/useMediaQuery.doc.mjs +2 -2
- package/src/hooks/useMediaQuery.ts +13 -4
- package/src/hooks/useMenuPress.ts +8 -2
- 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/indicatorPress.stylex.ts +24 -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 +7 -0
- package/src/motion/README.md +9 -5
- package/src/motion/animator.ts +61 -29
- 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 +5 -5
- package/src/motion/uikit/segmented.ts +74 -0
- package/src/motion/uikit/springs.ts +5 -21
- package/src/privateAttributes/pressGroupItem.stylex.ts +23 -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/focusReturn.ts +30 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/pressFeedback.ts +19 -6
- package/src/utils/triggerFocus.ts +80 -0
- 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
package/src/Layer/usePressPin.ts
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* @file usePressPin.ts
|
|
7
7
|
* @input A hover layer's trigger, open state, show and hide, and its
|
|
8
8
|
* `triggerBehavior` and `touchTrigger` options
|
|
9
|
-
* @output usePressPin, the press toggle that pins a hover layer open
|
|
10
|
-
*
|
|
9
|
+
* @output usePressPin, the press toggle that pins a hover layer open, and
|
|
10
|
+
* the app hold behind useTooltip's show() and hide(); isPressPinTrigger;
|
|
11
|
+
* stopPressPinClick; the LayerTriggerBehavior type
|
|
11
12
|
* @position Core-internal: one call per hover layer, useTooltip's. It owns
|
|
12
13
|
* the layer's touch trigger, so the host makes no second touch-trigger call.
|
|
13
14
|
*
|
|
@@ -35,12 +36,10 @@ import {
|
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* How the trigger opens the layer. `adaptive`, the default, previews it on
|
|
38
|
-
* hover and focus, and
|
|
39
|
-
*
|
|
40
|
-
* and focus, and no touch or pen tap opens it. `toggle` pins it on every
|
|
41
|
-
* press of a button trigger.
|
|
39
|
+
* hover and focus, and `touchTrigger` decides taps. `toggle` pins it on every
|
|
40
|
+
* press of a button trigger. Internal: InfoTip's press-to-pin uses `toggle`.
|
|
42
41
|
*/
|
|
43
|
-
export type LayerTriggerBehavior = 'adaptive' | '
|
|
42
|
+
export type LayerTriggerBehavior = 'adaptive' | 'toggle';
|
|
44
43
|
|
|
45
44
|
/** The clicks a press pin answered, so the wrapper can stop them (`stopPressPinClick`). */
|
|
46
45
|
const pressPinClicks = new WeakSet<Event>();
|
|
@@ -105,8 +104,18 @@ export interface UsePressPinReturn {
|
|
|
105
104
|
isHeldOpen: () => boolean;
|
|
106
105
|
/** Wires the trigger element, or unwires it with `null`. */
|
|
107
106
|
attach: (element: HTMLElement | null) => void;
|
|
108
|
-
/** Drops the pin: Escape, or a hide
|
|
107
|
+
/** Drops the pin and the app hold: Escape, or a hide from elsewhere. */
|
|
109
108
|
unpin: () => void;
|
|
109
|
+
/**
|
|
110
|
+
* The app's `show()`: shows the layer and holds it open, as a pin does,
|
|
111
|
+
* until `release`, Escape, a press outside, or focus leaving the trigger
|
|
112
|
+
* and the layer. A controlled layer reports the request instead.
|
|
113
|
+
*/
|
|
114
|
+
hold: () => void;
|
|
115
|
+
/** The app's `hide()`: drops the hold and hides the layer. */
|
|
116
|
+
release: () => void;
|
|
117
|
+
/** Whether the app's `show()` holds the layer open now. */
|
|
118
|
+
isAppHeld: () => boolean;
|
|
110
119
|
/**
|
|
111
120
|
* While pinned, focus moving onto an element outside the trigger and the
|
|
112
121
|
* layer closes it. Returns whether the pin decided. The pin calls it for its
|
|
@@ -114,8 +123,9 @@ export interface UsePressPinReturn {
|
|
|
114
123
|
*/
|
|
115
124
|
handleFocusLeave: (event: FocusEvent) => boolean;
|
|
116
125
|
/**
|
|
117
|
-
* Whether the layer shows pinned on a wired trigger
|
|
118
|
-
* its rendered text, unless the layer has
|
|
126
|
+
* Whether the layer shows pinned on a wired trigger, or held by the app's
|
|
127
|
+
* `show()`. The host then announces its rendered text, unless the layer has
|
|
128
|
+
* a `label`.
|
|
119
129
|
*/
|
|
120
130
|
isPinShown: boolean;
|
|
121
131
|
/** The layer's touch trigger (useTouchTriggerInternal), wired to the pin. */
|
|
@@ -177,8 +187,19 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
177
187
|
setIsPinnedState(next);
|
|
178
188
|
}, []);
|
|
179
189
|
|
|
190
|
+
// The app's show() holds the layer on any trigger, in any mode.
|
|
191
|
+
const isAppHeldRef = useRef(false);
|
|
192
|
+
const [isAppHeldState, setIsAppHeldState] = useState(false);
|
|
193
|
+
const setAppHeld = useCallback((next: boolean) => {
|
|
194
|
+
isAppHeldRef.current = next;
|
|
195
|
+
setIsAppHeldState(next);
|
|
196
|
+
}, []);
|
|
197
|
+
|
|
180
198
|
// The last offered element lets a `triggerBehavior` change rewire it.
|
|
181
199
|
const triggerRef = useRef<HTMLElement | null>(null);
|
|
200
|
+
// Every offered trigger, in any mode, so focus leaving ends a pin or an
|
|
201
|
+
// app hold.
|
|
202
|
+
const focusTargetRef = useRef<HTMLElement | null>(null);
|
|
182
203
|
const offeredRef = useRef<HTMLElement | null>(null);
|
|
183
204
|
// A primitive: re-attaching the same trigger renders nothing.
|
|
184
205
|
const [offeredKind, setOfferedKind] = useState<'none' | 'other' | 'button'>(
|
|
@@ -194,6 +215,13 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
194
215
|
// a pinned layer through the pin, so the pin drops with it.
|
|
195
216
|
const hideFromTouch = useCallback(() => {
|
|
196
217
|
const current = optionsRef.current;
|
|
218
|
+
if (isAppHeldRef.current) {
|
|
219
|
+
setAppHeld(false);
|
|
220
|
+
if (current.isOpen !== undefined) {
|
|
221
|
+
current.report(false);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
197
225
|
if (current.triggerBehavior === 'toggle' && triggerRef.current != null) {
|
|
198
226
|
if (current.isOpen !== undefined) {
|
|
199
227
|
current.report(false);
|
|
@@ -204,7 +232,7 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
204
232
|
}
|
|
205
233
|
}
|
|
206
234
|
current.hide();
|
|
207
|
-
}, [setPinned]);
|
|
235
|
+
}, [setPinned, setAppHeld]);
|
|
208
236
|
|
|
209
237
|
const {
|
|
210
238
|
isTouchPointerRef,
|
|
@@ -214,11 +242,7 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
214
242
|
clearTapOpen,
|
|
215
243
|
armOutsideDismiss,
|
|
216
244
|
} = useTouchTriggerInternal({
|
|
217
|
-
touchTrigger: isToggleMode
|
|
218
|
-
? 'tap'
|
|
219
|
-
: triggerBehavior === 'hover'
|
|
220
|
-
? 'none'
|
|
221
|
-
: options.touchTrigger,
|
|
245
|
+
touchTrigger: isToggleMode ? 'tap' : options.touchTrigger,
|
|
222
246
|
isEnabled: options.isEnabled,
|
|
223
247
|
isControlled: isOpen !== undefined,
|
|
224
248
|
isOpen: isLayerOpen,
|
|
@@ -239,13 +263,14 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
239
263
|
const close = useCallback(() => {
|
|
240
264
|
const current = optionsRef.current;
|
|
241
265
|
clearTapOpen();
|
|
266
|
+
setAppHeld(false);
|
|
242
267
|
if (current.isOpen !== undefined) {
|
|
243
268
|
current.report(false);
|
|
244
269
|
return;
|
|
245
270
|
}
|
|
246
271
|
setPinned(false);
|
|
247
272
|
current.hide();
|
|
248
|
-
}, [setPinned, clearTapOpen]);
|
|
273
|
+
}, [setPinned, setAppHeld, clearTapOpen]);
|
|
249
274
|
|
|
250
275
|
const announceName = useCallback(() => {
|
|
251
276
|
const current = optionsRef.current;
|
|
@@ -354,6 +379,9 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
354
379
|
|
|
355
380
|
const isHeldOpen = useCallback(() => {
|
|
356
381
|
const current = optionsRef.current;
|
|
382
|
+
if (isAppHeldRef.current && current.isLayerOpen) {
|
|
383
|
+
return current.isOpen !== false;
|
|
384
|
+
}
|
|
357
385
|
if (current.triggerBehavior !== 'toggle' || triggerRef.current == null) {
|
|
358
386
|
return false;
|
|
359
387
|
}
|
|
@@ -370,7 +398,7 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
370
398
|
return false;
|
|
371
399
|
}
|
|
372
400
|
const next = event.relatedTarget;
|
|
373
|
-
const trigger =
|
|
401
|
+
const trigger = focusTargetRef.current;
|
|
374
402
|
// Focus that leaves for no element is a press's to decide. The trigger
|
|
375
403
|
// can sit in another document, so the check uses its own window.
|
|
376
404
|
const view = trigger?.ownerDocument.defaultView;
|
|
@@ -393,6 +421,8 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
393
421
|
);
|
|
394
422
|
|
|
395
423
|
const unwire = useCallback(() => {
|
|
424
|
+
focusTargetRef.current?.removeEventListener('focusout', handleFocusLeave);
|
|
425
|
+
focusTargetRef.current = null;
|
|
396
426
|
const previous = triggerRef.current;
|
|
397
427
|
if (previous == null) {
|
|
398
428
|
return;
|
|
@@ -400,7 +430,6 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
400
430
|
previous.removeEventListener('click', handlePress);
|
|
401
431
|
previous.removeEventListener('keydown', handleKeyDown);
|
|
402
432
|
previous.removeEventListener('keyup', handleKeyUp);
|
|
403
|
-
previous.removeEventListener('focusout', handleFocusLeave);
|
|
404
433
|
const own = ownStateRef.current;
|
|
405
434
|
if (own != null) {
|
|
406
435
|
restoreAttribute(previous, 'aria-expanded', own.expanded);
|
|
@@ -429,10 +458,14 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
429
458
|
}
|
|
430
459
|
settledRef.current = {element, mode: current.triggerBehavior};
|
|
431
460
|
unwire();
|
|
432
|
-
if (element == null
|
|
461
|
+
if (element == null) {
|
|
433
462
|
return;
|
|
434
463
|
}
|
|
435
|
-
|
|
464
|
+
// Its own focus-leave listener, in any mode: `focusTrigger="never"`
|
|
465
|
+
// attaches none, and an app hold needs it on any trigger.
|
|
466
|
+
element.addEventListener('focusout', handleFocusLeave);
|
|
467
|
+
focusTargetRef.current = element;
|
|
468
|
+
if (current.triggerBehavior !== 'toggle' || !isPressPinTrigger(element)) {
|
|
436
469
|
return;
|
|
437
470
|
}
|
|
438
471
|
element.addEventListener('click', handlePress);
|
|
@@ -440,8 +473,6 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
440
473
|
element.addEventListener('keydown', handleKeyDown);
|
|
441
474
|
element.addEventListener('keyup', handleKeyUp);
|
|
442
475
|
}
|
|
443
|
-
// Its own focus-leave listener: `focusTrigger="never"` attaches none.
|
|
444
|
-
element.addEventListener('focusout', handleFocusLeave);
|
|
445
476
|
ownStateRef.current = {
|
|
446
477
|
expanded: element.getAttribute('aria-expanded'),
|
|
447
478
|
controls: element.getAttribute('aria-controls'),
|
|
@@ -466,7 +497,7 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
466
497
|
const isWired = isToggleMode && offeredKind === 'button';
|
|
467
498
|
useDevWarning(
|
|
468
499
|
options.component,
|
|
469
|
-
'
|
|
500
|
+
'A press-to-pin tooltip pins only a button trigger (a <button> or role="button"); this trigger keeps tap-only opening.',
|
|
470
501
|
isToggleMode && offeredKind === 'other',
|
|
471
502
|
);
|
|
472
503
|
|
|
@@ -479,7 +510,31 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
479
510
|
if (isPinnedRef.current) {
|
|
480
511
|
setPinned(false);
|
|
481
512
|
}
|
|
482
|
-
|
|
513
|
+
if (isAppHeldRef.current) {
|
|
514
|
+
setAppHeld(false);
|
|
515
|
+
}
|
|
516
|
+
}, [setPinned, setAppHeld]);
|
|
517
|
+
|
|
518
|
+
const hold = useCallback(() => {
|
|
519
|
+
const current = optionsRef.current;
|
|
520
|
+
if (!current.isEnabled) {
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
setAppHeld(true);
|
|
524
|
+
armOutsideDismiss();
|
|
525
|
+
announceName();
|
|
526
|
+
if (current.isOpen !== undefined) {
|
|
527
|
+
current.report(true);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
current.show();
|
|
531
|
+
}, [setAppHeld, armOutsideDismiss, announceName]);
|
|
532
|
+
|
|
533
|
+
const release = useCallback(() => {
|
|
534
|
+
close();
|
|
535
|
+
}, [close]);
|
|
536
|
+
|
|
537
|
+
const isAppHeld = useCallback(() => isAppHeldRef.current, []);
|
|
483
538
|
|
|
484
539
|
// Each path that hides a pinned layer drops the pin itself, so a layer that
|
|
485
540
|
// does not show is never reported expanded.
|
|
@@ -496,13 +551,18 @@ export function usePressPin(options: UsePressPinOptions): UsePressPinReturn {
|
|
|
496
551
|
writeAttribute(trigger, 'aria-controls', isLayerOpen ? layerId : null);
|
|
497
552
|
});
|
|
498
553
|
|
|
499
|
-
const isPinShown =
|
|
554
|
+
const isPinShown =
|
|
555
|
+
(isToggleMode && isWired && isExpanded) ||
|
|
556
|
+
(isAppHeldState && isLayerOpen && isOpen !== false);
|
|
500
557
|
|
|
501
558
|
return {
|
|
502
559
|
isToggleTrigger,
|
|
503
560
|
isHeldOpen,
|
|
504
561
|
attach,
|
|
505
562
|
unpin,
|
|
563
|
+
hold,
|
|
564
|
+
release,
|
|
565
|
+
isAppHeld,
|
|
506
566
|
handleFocusLeave,
|
|
507
567
|
isPinShown,
|
|
508
568
|
touch: {
|
|
@@ -55,6 +55,7 @@ import {
|
|
|
55
55
|
} from '../i18n/useComponentTranslator';
|
|
56
56
|
import english from '../i18n/generated-english/Lightbox/Lightbox.generated';
|
|
57
57
|
import {isRenderable} from '../utils/isRenderable';
|
|
58
|
+
import {prepareFocusReturnOnRemoval} from '../utils/focusReturn';
|
|
58
59
|
|
|
59
60
|
registerEnglishFallback(english);
|
|
60
61
|
/**
|
|
@@ -445,6 +446,23 @@ export function Lightbox({
|
|
|
445
446
|
}
|
|
446
447
|
}, [isOpen, hasItem]);
|
|
447
448
|
|
|
449
|
+
// A viewer that unmounts while open (rendered only while open, or removed
|
|
450
|
+
// with the rest of a view) never runs the close branch above. Focus the
|
|
451
|
+
// removal lost goes back to the opener while the opener is still on the
|
|
452
|
+
// page.
|
|
453
|
+
useEffect(() => {
|
|
454
|
+
const dialog = dialogRef.current;
|
|
455
|
+
if (dialog == null) {
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
const returnFocusOnRemoval = prepareFocusReturnOnRemoval(dialog);
|
|
459
|
+
return () => {
|
|
460
|
+
if (dialog.open) {
|
|
461
|
+
returnFocusOnRemoval(triggerElementRef.current);
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
}, [hasItem]);
|
|
465
|
+
|
|
448
466
|
const handleClose = useCallback(() => {
|
|
449
467
|
onOpenChange(false);
|
|
450
468
|
}, [onOpenChange]);
|
|
@@ -143,8 +143,8 @@ const styles = stylex.create({
|
|
|
143
143
|
// ::backdrop is provided by the browser's top layer
|
|
144
144
|
backdrop: {
|
|
145
145
|
'::backdrop': {
|
|
146
|
+
// No backdrop-filter: a full-viewport blur is costly to repaint.
|
|
146
147
|
backgroundColor: colorVars['--color-overlay'],
|
|
147
|
-
backdropFilter: 'blur(2px)',
|
|
148
148
|
opacity: 0,
|
|
149
149
|
transitionProperty: 'opacity',
|
|
150
150
|
transitionDuration: durationVars['--duration-medium'],
|
|
@@ -174,13 +174,11 @@ export function useMultiCombobox({
|
|
|
174
174
|
// The action cell is the caller's control, usable whether or not the
|
|
175
175
|
// option itself is disabled (spec:AST-058 FR4).
|
|
176
176
|
if (cell === 'action') {
|
|
177
|
-
highlightOnHover(index);
|
|
178
|
-
setHighlightedCell('action');
|
|
177
|
+
highlightOnHover(index, () => setHighlightedCell('action'));
|
|
179
178
|
return;
|
|
180
179
|
}
|
|
181
180
|
if (!item.disabled) {
|
|
182
|
-
highlightOnHover(index);
|
|
183
|
-
setHighlightedCell('option');
|
|
181
|
+
highlightOnHover(index, () => setHighlightedCell('option'));
|
|
184
182
|
}
|
|
185
183
|
},
|
|
186
184
|
[highlightOnHover],
|
|
@@ -63,7 +63,11 @@ export const docs = {
|
|
|
63
63
|
targets: [
|
|
64
64
|
{className: 'astryx-outline', visualProps: ['density']},
|
|
65
65
|
{className: 'astryx-outline-indicator'},
|
|
66
|
-
{
|
|
66
|
+
{
|
|
67
|
+
className: 'astryx-outline-item',
|
|
68
|
+
visualProps: ['level'],
|
|
69
|
+
states: ['active'],
|
|
70
|
+
},
|
|
67
71
|
],
|
|
68
72
|
},
|
|
69
73
|
components: [
|
|
@@ -101,7 +105,8 @@ export const docs = {
|
|
|
101
105
|
{
|
|
102
106
|
name: 'density',
|
|
103
107
|
type: "'default' | 'compact'",
|
|
104
|
-
description:
|
|
108
|
+
description:
|
|
109
|
+
"Density variant controlling item padding. 'compact' for dense UIs, 'default' for standard spacing.",
|
|
105
110
|
default: "'default'",
|
|
106
111
|
},
|
|
107
112
|
{
|
|
@@ -271,17 +276,53 @@ function FlashOnArrival() {
|
|
|
271
276
|
usage: {
|
|
272
277
|
anatomy,
|
|
273
278
|
description:
|
|
274
|
-
'A table-of-contents sidebar for documentation pages, help centers, wikis, and long settings pages. Use it for navigation within a single page, not for app routes. Features a sliding indicator track that animates to the active heading.
|
|
279
|
+
'A table-of-contents sidebar for documentation pages, help centers, wikis, and long settings pages. Use it for navigation within a single page, not for app routes. Features a sliding indicator track that animates to the active heading. Each link is in the normal Tab order, and Enter/Space activate.',
|
|
275
280
|
bestPractices: [
|
|
276
|
-
{
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
{
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
281
|
+
{
|
|
282
|
+
guidance: true,
|
|
283
|
+
description:
|
|
284
|
+
'Pass a flat ordered list of headings and let level control indentation.',
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
guidance: true,
|
|
288
|
+
description:
|
|
289
|
+
'Use activeId when custom scroll logic owns the active section.',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
guidance: true,
|
|
293
|
+
description:
|
|
294
|
+
'Use density="compact" in dense sidebars where vertical space is tight.',
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
guidance: true,
|
|
298
|
+
description:
|
|
299
|
+
'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.',
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
guidance: true,
|
|
303
|
+
description:
|
|
304
|
+
'Pass scrollContainerRef when the content scrolls in a split pane, modal, or panel instead of the viewport.',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
guidance: true,
|
|
308
|
+
description:
|
|
309
|
+
'Set offset to the height of a fixed header that overlays the content, so headings land below it instead of underneath it.',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
guidance: false,
|
|
313
|
+
description:
|
|
314
|
+
'Use Outline for application navigation - use SideNav or TopNav for routes.',
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
guidance: false,
|
|
318
|
+
description:
|
|
319
|
+
'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.',
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
guidance: false,
|
|
323
|
+
description:
|
|
324
|
+
'Rely on onNavigateEnd to mean "arrived" - it also fires when the user interrupts the scroll.',
|
|
325
|
+
},
|
|
285
326
|
],
|
|
286
327
|
},
|
|
287
328
|
};
|
|
@@ -295,7 +336,11 @@ export const docsZh = {
|
|
|
295
336
|
targets: [
|
|
296
337
|
{className: 'astryx-outline', visualProps: ['density']},
|
|
297
338
|
{className: 'astryx-outline-indicator'},
|
|
298
|
-
{
|
|
339
|
+
{
|
|
340
|
+
className: 'astryx-outline-item',
|
|
341
|
+
visualProps: ['level'],
|
|
342
|
+
states: ['active'],
|
|
343
|
+
},
|
|
299
344
|
],
|
|
300
345
|
},
|
|
301
346
|
components: [
|
|
@@ -332,40 +377,47 @@ export const docsZh = {
|
|
|
332
377
|
{
|
|
333
378
|
name: 'density',
|
|
334
379
|
type: "'default' | 'compact'",
|
|
335
|
-
description:
|
|
380
|
+
description:
|
|
381
|
+
"控制项目内边距的密度变体。'compact' 用于紧凑界面,'default' 为标准间距。",
|
|
336
382
|
default: "'default'",
|
|
337
383
|
},
|
|
338
384
|
{
|
|
339
385
|
name: 'onNavigateStart',
|
|
340
386
|
type: '(id: string) => void',
|
|
341
|
-
description:
|
|
387
|
+
description:
|
|
388
|
+
'导航开始时(滚动前)调用,传入项目 id。与 onNavigateEnd 搭配可在目标标题上实现到达效果(闪烁、描边、脉冲)。',
|
|
342
389
|
},
|
|
343
390
|
{
|
|
344
391
|
name: 'onNavigateEnd',
|
|
345
392
|
type: '(id: string) => void',
|
|
346
|
-
description:
|
|
393
|
+
description:
|
|
394
|
+
'导航结束时调用(平滑滚动停止,或减弱动效将其变为瞬时跳转)。每次 onNavigateStart 必定对应一次调用,包括用户中途手动滚动打断的情况,因此“导航中”状态不会泄漏。',
|
|
347
395
|
},
|
|
348
396
|
{
|
|
349
397
|
name: 'offset',
|
|
350
398
|
type: 'number',
|
|
351
|
-
description:
|
|
399
|
+
description:
|
|
400
|
+
'覆盖滚动根顶部的固定顶栏高度(px)。同时位移激活线与滚动落点,因此标题被激活的位置正是点击后停留的位置——落在顶栏下方,而非被顶栏遮住。它与每个标题自身的 scroll-margin-top 叠加(先顶栏,再留白),而非取代它。若没有元素覆盖内容,保持 0,交给 scroll-margin-top 处理。',
|
|
352
401
|
default: '0',
|
|
353
402
|
},
|
|
354
403
|
{
|
|
355
404
|
name: 'scrollContainerRef',
|
|
356
405
|
type: 'React.RefObject<HTMLElement | null>',
|
|
357
|
-
description:
|
|
406
|
+
description:
|
|
407
|
+
'要跟踪的滚动容器,替代自动探测最近的可滚动祖先。当内容在分栏、弹窗或面板中滚动而非视口时使用。',
|
|
358
408
|
},
|
|
359
409
|
{
|
|
360
410
|
name: 'hasScrollOnClick',
|
|
361
411
|
type: 'boolean',
|
|
362
|
-
description:
|
|
412
|
+
description:
|
|
413
|
+
'激活项目时是否平滑滚动。设为 false 可自行接管滚动(虚拟列表、路由):Outline 仍会更新激活项、hash 和导航回调,但不执行滚动。',
|
|
363
414
|
default: 'true',
|
|
364
415
|
},
|
|
365
416
|
{
|
|
366
417
|
name: 'xstyle',
|
|
367
418
|
type: 'StyleXStyles',
|
|
368
|
-
description:
|
|
419
|
+
description:
|
|
420
|
+
'用于布局自定义的 StyleX 样式。必须是 stylex.create() 值。',
|
|
369
421
|
},
|
|
370
422
|
],
|
|
371
423
|
},
|
|
@@ -375,12 +427,36 @@ export const docsZh = {
|
|
|
375
427
|
description:
|
|
376
428
|
'A table-of-contents sidebar for documentation pages, help centers, wikis, and long settings pages. Use it for navigation within a single page, not for app routes.',
|
|
377
429
|
bestPractices: [
|
|
378
|
-
{
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
{
|
|
430
|
+
{
|
|
431
|
+
guidance: true,
|
|
432
|
+
description:
|
|
433
|
+
'Pass a flat ordered list of headings and let level control indentation.',
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
guidance: true,
|
|
437
|
+
description:
|
|
438
|
+
'Use activeId when custom scroll logic owns the active section.',
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
guidance: true,
|
|
442
|
+
description:
|
|
443
|
+
'Use density="compact" in dense sidebars where vertical space is tight.',
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
guidance: true,
|
|
447
|
+
description:
|
|
448
|
+
'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.',
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
guidance: false,
|
|
452
|
+
description:
|
|
453
|
+
'Use Outline for application navigation - use SideNav or TopNav for routes.',
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
guidance: false,
|
|
457
|
+
description:
|
|
458
|
+
'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.',
|
|
459
|
+
},
|
|
384
460
|
],
|
|
385
461
|
},
|
|
386
462
|
};
|
|
@@ -388,34 +464,77 @@ export const docsZh = {
|
|
|
388
464
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
389
465
|
export const docsDense = {
|
|
390
466
|
description:
|
|
391
|
-
'Document outline/table-of-contents nav with sliding indicator track. Flat items array {id,label,level}; anchor links; density variant (default/compact); uncontrolled scroll-spy by scroll position (last heading past its resting line = offset + its own scroll-margin-top; first item at top, last at bottom); controlled with activeId; smooth-scroll on click that pins the active item until the next manual scroll.
|
|
467
|
+
'Document outline/table-of-contents nav with sliding indicator track. Flat items array {id,label,level}; anchor links; density variant (default/compact); uncontrolled scroll-spy by scroll position (last heading past its resting line = offset + its own scroll-margin-top; first item at top, last at bottom); controlled with activeId; smooth-scroll on click that pins the active item until the next manual scroll. Each link is a Tab stop; Enter/Space activate; no arrow/Home/End movement. onNavigateStart/onNavigateEnd fire around the scroll. Scroll scoping via offset / scrollContainerRef / hasScrollOnClick.',
|
|
392
468
|
usage: {
|
|
393
469
|
anatomy,
|
|
394
470
|
description:
|
|
395
471
|
'A table-of-contents sidebar for documentation pages, help centers, wikis, and long settings pages. Use it for navigation within a single page, not for app routes.',
|
|
396
472
|
bestPractices: [
|
|
397
|
-
{
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
{
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
473
|
+
{
|
|
474
|
+
guidance: true,
|
|
475
|
+
description:
|
|
476
|
+
'Pass a flat ordered list of headings and let level control indentation.',
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
guidance: true,
|
|
480
|
+
description:
|
|
481
|
+
'Use activeId when custom scroll logic owns the active section.',
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
guidance: true,
|
|
485
|
+
description:
|
|
486
|
+
'Use density="compact" in dense sidebars where vertical space is tight.',
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
guidance: true,
|
|
490
|
+
description:
|
|
491
|
+
'Use useOutlineFromMarkdown or useOutlineFromDOM when headings are generated from content. For linkable Markdown headings, pass the same createMarkdownHeadingLinks() entry to Markdown and Outline; configure headingIdPrefix on that plugin for multiple roots.',
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
guidance: true,
|
|
495
|
+
description:
|
|
496
|
+
'Pass scrollContainerRef when the content scrolls in a split pane, modal, or panel instead of the viewport.',
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
guidance: true,
|
|
500
|
+
description:
|
|
501
|
+
'Set offset to the height of a fixed header that overlays the content, so headings land below it instead of underneath it.',
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
guidance: false,
|
|
505
|
+
description:
|
|
506
|
+
'Use Outline for application navigation - use SideNav or TopNav for routes.',
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
guidance: false,
|
|
510
|
+
description:
|
|
511
|
+
'Use Outline for expandable hierarchy - use TreeList when nodes need expand and collapse.',
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
guidance: false,
|
|
515
|
+
description:
|
|
516
|
+
'Rely on onNavigateEnd to mean "arrived" - it also fires when the user interrupts the scroll.',
|
|
517
|
+
},
|
|
406
518
|
],
|
|
407
519
|
},
|
|
408
520
|
propDescriptions: {
|
|
409
|
-
items:
|
|
521
|
+
items:
|
|
522
|
+
'Ordered OutlineItem[]: {id,label,level}. id should match target heading DOM id.',
|
|
410
523
|
activeId: 'Controlled active heading id. Disables built-in scroll-spy.',
|
|
411
524
|
onActiveIdChange: 'Called when active id changes from scroll-spy or click.',
|
|
412
525
|
label: "Accessible nav label. Default: 'Table of contents'.",
|
|
413
|
-
density:
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
526
|
+
density:
|
|
527
|
+
"Density variant: 'default' (standard) or 'compact'. Default: 'default'.",
|
|
528
|
+
onNavigateStart:
|
|
529
|
+
'Called with the id when navigation begins, before the scroll.',
|
|
530
|
+
onNavigateEnd:
|
|
531
|
+
'Called with the id once the scroll settles. Fires exactly once per onNavigateStart, including on user interruption.',
|
|
532
|
+
offset:
|
|
533
|
+
'Height in px of a fixed header overlaying the scroll root. Shifts BOTH the activation line and the scroll landing, so a heading activates where navigating to it lands it. Composes with (does not replace) each heading scroll-margin-top. Default: 0.',
|
|
534
|
+
scrollContainerRef:
|
|
535
|
+
'RefObject of the scroll container to track, instead of the nearest scrollable ancestor. For split panes, modals, panels.',
|
|
536
|
+
hasScrollOnClick:
|
|
537
|
+
'Whether activating an item smooth-scrolls to it. false = you own scrolling; active id, hash and callbacks still update. Default: true.',
|
|
419
538
|
xstyle: 'StyleX styles for layout. Must be stylex.create() value.',
|
|
420
539
|
},
|
|
421
540
|
components: [
|
|
@@ -423,18 +542,25 @@ export const docsDense = {
|
|
|
423
542
|
name: 'Outline',
|
|
424
543
|
displayName: 'Outline',
|
|
425
544
|
description:
|
|
426
|
-
'Document outline nav with sliding indicator. Renders heading anchors with a density variant,
|
|
545
|
+
'Document outline nav with sliding indicator. Renders heading anchors with a density variant, links in the normal Tab order, navigate callbacks, and scroll-spy active state when uncontrolled.',
|
|
427
546
|
propDescriptions: {
|
|
428
|
-
items:
|
|
547
|
+
items:
|
|
548
|
+
'Ordered OutlineItem[]: {id,label,level}. id should match target heading DOM id.',
|
|
429
549
|
activeId: 'Controlled active heading id. Disables built-in scroll-spy.',
|
|
430
|
-
onActiveIdChange:
|
|
550
|
+
onActiveIdChange:
|
|
551
|
+
'Called when active id changes from scroll-spy or click.',
|
|
431
552
|
label: "Accessible nav label. Default: 'Table of contents'.",
|
|
432
553
|
density: "Density variant: 'default' | 'compact'. Default: 'default'.",
|
|
433
|
-
onNavigateStart:
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
554
|
+
onNavigateStart:
|
|
555
|
+
'Called with the id when navigation begins, before the scroll.',
|
|
556
|
+
onNavigateEnd:
|
|
557
|
+
'Called with the id once the scroll settles. Fires exactly once per onNavigateStart, including on user interruption.',
|
|
558
|
+
offset:
|
|
559
|
+
'Height in px of a fixed header overlaying the scroll root. Shifts both the activation line and the scroll landing. Composes with scroll-margin-top. Default: 0.',
|
|
560
|
+
scrollContainerRef:
|
|
561
|
+
'RefObject of the scroll container to track, instead of the nearest scrollable ancestor.',
|
|
562
|
+
hasScrollOnClick:
|
|
563
|
+
'Whether activating an item smooth-scrolls to it. Default: true.',
|
|
438
564
|
xstyle: 'StyleX styles for layout. Must be stylex.create() value.',
|
|
439
565
|
},
|
|
440
566
|
},
|