@astryxdesign/core 0.7.7 → 0.7.8-canary.30b1896
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 +46 -6
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +5 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +1 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +25 -4
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +5 -0
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +1 -1
- package/dist/BottomSheet/useMobileKeyboard.js +6 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +12 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +17 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +15 -16
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +2 -0
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +4 -0
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +2 -1
- package/dist/Chat/useChatDictation.d.ts.map +1 -1
- package/dist/Chat/useChatDictation.js +2 -0
- package/dist/Chat/useChatNewMessages.js +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +2 -0
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +3 -0
- package/dist/Chat/useTriggerMenu.js +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +17 -12
- package/dist/CodeBlock/CodeBlock.d.ts +10 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +28 -11
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +2 -0
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +2 -0
- 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/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +5 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +1 -0
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +4 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -1
- package/dist/DateInput/useOwnScrollGesture.js +3 -0
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
- package/dist/DateInput/usePointerDragScroll.js +2 -0
- package/dist/DateInput/useScrollSettle.d.ts.map +1 -1
- package/dist/DateInput/useScrollSettle.js +3 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +9 -32
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +3 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -1
- package/dist/DropdownMenu/useMenuOverflow.js +5 -0
- package/dist/Field/Field.js +2 -2
- package/dist/FieldStatus/useFieldStatusAnnouncement.d.ts.map +1 -1
- package/dist/FieldStatus/useFieldStatusAnnouncement.js +1 -0
- package/dist/FormLayout/FormLayout.d.ts +5 -1
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.d.ts +6 -4
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +48 -3
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +20 -33
- 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/Item/useSwipeAction.d.ts.map +1 -1
- package/dist/Item/useSwipeAction.js +3 -0
- package/dist/Layer/modalOutlet.d.ts.map +1 -1
- package/dist/Layer/modalOutlet.js +2 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +1 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +3 -0
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
- package/dist/Layer/useLayerDismissal.js +3 -0
- package/dist/Layer/usePressPin.d.ts +17 -5
- package/dist/Layer/usePressPin.d.ts.map +1 -1
- package/dist/Layer/usePressPin.js +62 -12
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +3 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +19 -0
- package/dist/MobileNav/MobileNav.d.ts +3 -2
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +9 -25
- package/dist/Outline/useOutlineFromDOM.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromDOM.js +3 -0
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +3 -0
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +3 -0
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +6 -0
- package/dist/PowerSearch/PowerSearch.d.ts +43 -4
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +445 -134
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +102 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1919 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +35 -2
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +25 -6
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -2
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +193 -83
- package/dist/PowerSearch/formatFilterValue.d.ts +18 -6
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +33 -12
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +162 -0
- package/dist/PowerSearch/powerSearchDateZone.d.ts +21 -0
- package/dist/PowerSearch/powerSearchDateZone.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchDateZone.js +37 -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/PowerSearch/types.d.ts +2 -0
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBarTouch.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBarTouch.js +2 -0
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +3 -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 +2 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +101 -77
- package/dist/Resizable/createResizable.d.ts +145 -0
- package/dist/Resizable/createResizable.d.ts.map +1 -0
- package/dist/Resizable/createResizable.js +575 -0
- package/dist/Resizable/useResizable.d.ts +3 -3
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +252 -459
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SelectableCard/SelectableCard.d.ts +2 -0
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +36 -11
- package/dist/SelectableCard/selectableCardInput.d.ts +12 -0
- package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -0
- package/dist/SelectableCard/selectableCardInput.js +20 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -8
- 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/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +4 -10
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +3 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +2 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +4 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -0
- 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/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +2 -0
- package/dist/Timer/Timer.d.ts.map +1 -1
- package/dist/Timer/Timer.js +2 -0
- package/dist/Timestamp/Timestamp.js +1 -1
- package/dist/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +25 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +97 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +1 -0
- package/dist/Tokenizer/Tokenizer.d.ts +49 -37
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +22 -19
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +19 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +34 -53
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +27 -18
- 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 +36 -6
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -1
- package/dist/hooks/ModalAnnounceProvider.js +1 -0
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- 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/longPressDetector.d.ts +66 -0
- package/dist/hooks/longPressDetector.d.ts.map +1 -0
- package/dist/hooks/longPressDetector.js +200 -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/rootScrollStyles.d.ts +48 -0
- package/dist/hooks/rootScrollStyles.d.ts.map +1 -0
- package/dist/hooks/rootScrollStyles.js +207 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts +13 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts.map +1 -0
- package/dist/hooks/scrollLockTouchGuard.js +134 -0
- package/dist/hooks/scrollbarGutter.d.ts +4 -4
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -1
- package/dist/hooks/scrollbarGutter.js +36 -23
- 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/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +1 -0
- package/dist/hooks/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useAutoMediaMode.d.ts.map +1 -1
- package/dist/hooks/useAutoMediaMode.js +1 -0
- package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
- package/dist/hooks/useBusyAnnouncement.js +2 -0
- package/dist/hooks/useDevWarning.d.ts.map +1 -1
- package/dist/hooks/useDevWarning.js +2 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +2 -0
- package/dist/hooks/useGridFocus.d.ts +8 -5
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +4 -3
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +3 -0
- package/dist/hooks/useImageMode.d.ts.map +1 -1
- package/dist/hooks/useImageMode.js +3 -0
- 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/useKeyboardHint.js +1 -1
- package/dist/hooks/useLongPress.d.ts +8 -9
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +23 -106
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +2 -0
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +3 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +2 -1
- package/dist/hooks/usePressFeedback.d.ts.map +1 -1
- package/dist/hooks/usePressFeedback.js +1 -0
- package/dist/hooks/useResolvedRequired.d.ts +3 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -1
- package/dist/hooks/useResolvedRequired.js +3 -0
- package/dist/hooks/useScrollLock.d.ts +7 -9
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +55 -48
- package/dist/hooks/useScrollableArea.d.ts.map +1 -1
- package/dist/hooks/useScrollableArea.js +5 -0
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +3 -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-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +30 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -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/selectable-card.d.ts +21 -0
- package/dist/internal/selectable-card.d.ts.map +1 -0
- package/dist/internal/selectable-card.js +20 -0
- package/dist/internal/sheetDraft.d.ts +2 -2
- package/dist/internal/sheetDraft.js +2 -2
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +7 -7
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +45 -20
- package/dist/motion/progress.d.ts +88 -0
- package/dist/motion/progress.d.ts.map +1 -0
- package/dist/motion/progress.js +128 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +3 -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/privateAttributes/pressGroupItem.stylex.d.ts +22 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +36 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts +23 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/reducedMotion.stylex.js +40 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +29 -4
- package/dist/theme/motionKnobs.d.ts +4 -3
- package/dist/theme/motionKnobs.d.ts.map +1 -1
- package/dist/theme/motionKnobs.js +3 -2
- package/dist/theme/themeMotion.d.ts +6 -0
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +7 -0
- 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/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +4 -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/plainDate.d.ts +8 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +19 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +20 -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 +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +14 -9
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +46 -5
- package/src/AppShell/AppShell.tsx +4 -0
- package/src/BottomSheet/BottomSheet.tsx +1 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +39 -3
- package/src/BottomSheet/BottomSheetSwitcher.tsx +5 -0
- package/src/BottomSheet/useMobileKeyboard.ts +4 -0
- package/src/BottomSheet/useSheetGestures.ts +10 -1
- package/src/Button/Button.tsx +26 -4
- package/src/Calendar/Calendar.tsx +36 -25
- package/src/Carousel/Carousel.tsx +1 -0
- package/src/Chat/ChatComposerInput.tsx +2 -0
- package/src/Chat/ChatMessageList.tsx +2 -1
- package/src/Chat/useChatDictation.ts +1 -0
- package/src/Chat/useChatNewMessages.ts +1 -1
- package/src/Chat/useChatStreamScroll.ts +2 -0
- package/src/Chat/useSpeechRecognition.ts +2 -0
- package/src/Chat/useTriggerMenu.tsx +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +38 -15
- package/src/CodeBlock/CodeBlock.doc.mjs +9 -1
- package/src/CodeBlock/CodeBlock.tsx +41 -4
- package/src/CommandPalette/CommandPalette.tsx +1 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -0
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/DateInput/MonthScroller.tsx +8 -2
- package/src/DateInput/TouchDateField.tsx +1 -0
- package/src/DateInput/Wheel.tsx +4 -0
- package/src/DateInput/useOwnScrollGesture.ts +2 -0
- package/src/DateInput/usePointerDragScroll.ts +1 -0
- package/src/DateInput/useScrollSettle.ts +2 -0
- package/src/Dialog/Dialog.tsx +12 -32
- package/src/Drawer/useDrawerDialogPresence.ts +2 -0
- package/src/DropdownMenu/useMenuOverflow.ts +3 -0
- package/src/Field/Field.tsx +2 -2
- package/src/FieldStatus/useFieldStatusAnnouncement.ts +1 -0
- package/src/FormLayout/FormLayout.doc.mjs +181 -46
- package/src/FormLayout/FormLayout.tsx +5 -1
- package/src/HoverCard/HoverCard.doc.mjs +10 -8
- package/src/HoverCard/HoverCard.tsx +58 -6
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +49 -54
- package/src/Icon/Icon.doc.mjs +49 -8
- package/src/Icon/Icon.tsx +15 -7
- package/src/IconButton/IconButton.doc.mjs +141 -21
- package/src/Item/useSwipeAction.ts +2 -0
- package/src/Layer/modalOutlet.ts +2 -0
- package/src/Layer/outsidePress.ts +1 -0
- package/src/Layer/useLayer.tsx +2 -0
- package/src/Layer/useLayerDismissal.ts +2 -0
- package/src/Layer/usePressPin.ts +81 -15
- package/src/Layer/useTouchTrigger.ts +2 -0
- package/src/Lightbox/Lightbox.tsx +19 -0
- package/src/MobileNav/MobileNav.tsx +9 -30
- package/src/Outline/useOutlineFromDOM.ts +2 -0
- package/src/Outline/useScrollSpy.ts +2 -0
- package/src/OverflowList/OverflowList.tsx +2 -0
- package/src/Popover/Popover.tsx +4 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +60 -8
- package/src/PowerSearch/PowerSearch.tsx +627 -157
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2525 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +39 -6
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +2 -0
- package/src/PowerSearch/PowerSearchToken.tsx +7 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +244 -58
- package/src/PowerSearch/formatFilterValue.ts +55 -17
- package/src/PowerSearch/formatTokenValue.ts +222 -0
- package/src/PowerSearch/powerSearchDateZone.ts +64 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/PowerSearch/types.ts +2 -0
- package/src/ProgressBar/ProgressBarTouch.ts +2 -0
- package/src/RadioList/RadioList.tsx +3 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/Resizable.doc.mjs +5 -4
- package/src/Resizable/ResizeHandle.tsx +169 -109
- package/src/Resizable/createResizable.ts +831 -0
- package/src/Resizable/useResizable.ts +292 -623
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/SelectableCard/SelectableCard.tsx +39 -10
- package/src/SelectableCard/selectableCardInput.ts +30 -0
- package/src/Selector/Selector.tsx +5 -12
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Switch/Switch.tsx +2 -6
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +46 -12
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +1 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +4 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +2 -0
- package/src/TextInput/TextInput.tsx +11 -10
- package/src/TimeInput/TimeInput.tsx +2 -0
- package/src/Timer/Timer.tsx +1 -0
- package/src/Timestamp/Timestamp.tsx +1 -1
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +52 -32
- package/src/Toast/ToastViewport.tsx +123 -35
- package/src/Toast/types.ts +9 -3
- package/src/Toast/useToast.tsx +1 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +19 -3
- package/src/Tokenizer/Tokenizer.tsx +73 -51
- package/src/Tokenizer/TokenizerBottomSheet.tsx +1 -1
- package/src/Tokenizer/index.ts +1 -0
- package/src/Tooltip/useTooltip.doc.mjs +24 -0
- package/src/Tooltip/useTooltip.tsx +61 -56
- package/src/Typeahead/BaseTypeahead.tsx +27 -17
- 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/PressTracker.ts +4 -3
- package/src/gestures/README.md +10 -4
- package/src/hooks/ModalAnnounceProvider.tsx +1 -0
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/longPressDetector.ts +273 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/rootScrollStyles.ts +247 -0
- package/src/hooks/scrollLockTouchGuard.ts +182 -0
- package/src/hooks/scrollbarGutter.ts +41 -26
- 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/useAnnounceRenderedText.ts +1 -0
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useAutoMediaMode.ts +1 -0
- package/src/hooks/useBusyAnnouncement.ts +2 -0
- package/src/hooks/useDevWarning.ts +2 -0
- package/src/hooks/useFocusTrap.ts +2 -0
- package/src/hooks/useGridFocus.doc.mjs +6 -6
- package/src/hooks/useGridFocus.ts +10 -7
- package/src/hooks/useHotkeys.ts +2 -0
- package/src/hooks/useImageMode.ts +2 -0
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useKeyboardHint.tsx +1 -1
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +32 -122
- package/src/hooks/useMenuHover.ts +1 -0
- package/src/hooks/useMenuPress.ts +2 -0
- package/src/hooks/useOverflow.ts +2 -1
- package/src/hooks/usePressFeedback.ts +1 -0
- package/src/hooks/useResolvedRequired.ts +3 -0
- package/src/hooks/useScrollLock.doc.mjs +51 -12
- package/src/hooks/useScrollLock.ts +57 -60
- package/src/hooks/useScrollableArea.ts +4 -0
- package/src/hooks/useStreamingText.ts +2 -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-locales/en.generated.ts +41 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
- package/src/index.ts +13 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/internal/selectable-card.ts +21 -0
- package/src/internal/sheetDraft.ts +2 -2
- package/src/motion/README.md +9 -5
- package/src/motion/animatedLayout.ts +10 -5
- package/src/motion/animator.ts +66 -31
- package/src/motion/progress.ts +155 -0
- package/src/motion/reducedMotion.ts +3 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +44 -0
- package/src/privateAttributes/reducedMotion.stylex.ts +45 -0
- package/src/theme/Theme.tsx +37 -3
- package/src/theme/motionKnobs.ts +4 -3
- package/src/theme/themeMotion.ts +7 -0
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/focusReturn.ts +30 -0
- package/src/utils/interactionModality.ts +4 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/plainDate.ts +21 -0
- package/src/utils/pressFeedback.ts +24 -6
- package/src/utils/triggerFocus.ts +80 -0
- package/dist/internal/touch-sheet.d.ts +0 -21
- package/dist/internal/touch-sheet.d.ts.map +0 -1
- package/dist/internal/touch-sheet.js +0 -19
- package/src/internal/touch-sheet.ts +0 -21
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* useAdaptivePresentation, and TokenizerBottomSheet (lazy)
|
|
9
9
|
* @output Exports Tokenizer multi-select typeahead component
|
|
10
10
|
* @position Composed component; forwards DOM ref and exposes focus control via
|
|
11
|
-
* handleRef. The
|
|
12
|
-
*
|
|
11
|
+
* handleRef. The `presentation` prop swaps the inline combobox for a
|
|
12
|
+
* trigger that opens TokenizerBottomSheet.
|
|
13
13
|
*
|
|
14
14
|
* SYNC: When modified, update:
|
|
15
15
|
* - /packages/core/src/Tokenizer/index.ts
|
|
@@ -51,9 +51,13 @@ import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
|
51
51
|
import {TokenizerClearAllMessageContext} from './TokenizerClearAllMessageContext';
|
|
52
52
|
import {TokenizerItemRemovableContext} from './TokenizerItemRemovableContext';
|
|
53
53
|
import {useBusyAnnouncement} from '../hooks/useBusyAnnouncement';
|
|
54
|
-
import {
|
|
54
|
+
import {
|
|
55
|
+
type AdaptivePresentation,
|
|
56
|
+
useAdaptivePresentation,
|
|
57
|
+
} from '../hooks/useAdaptivePresentation';
|
|
55
58
|
import {useIsHydrating} from '../hooks/useIsHydrating';
|
|
56
59
|
import {VisuallyHidden} from '../VisuallyHidden';
|
|
60
|
+
import {useDevWarning} from '../hooks/useDevWarning';
|
|
57
61
|
import {warnOnce} from '../utils/devWarning';
|
|
58
62
|
import type {SizeValue} from '../utils/types';
|
|
59
63
|
import {BaseTypeahead} from '../Typeahead/BaseTypeahead';
|
|
@@ -296,62 +300,74 @@ export interface TokenizerProps<T extends SearchableItem> extends Omit<
|
|
|
296
300
|
onFocus?: (e: React.FocusEvent) => void;
|
|
297
301
|
/** Fires when focus leaves the tokenizer entirely. */
|
|
298
302
|
onBlur?: (e: React.FocusEvent) => void;
|
|
299
|
-
/**
|
|
303
|
+
/**
|
|
304
|
+
* How the field presents its choices.
|
|
305
|
+
* - `'popover'`: the inline combobox with its anchored suggestion menu, on
|
|
306
|
+
* every device.
|
|
307
|
+
* - `'bottom-sheet'`: a trigger showing the selected tokens that opens one
|
|
308
|
+
* tall modal sheet: a search row on top, full-width checkbox rows that
|
|
309
|
+
* keep their place while the sheet is open, a create row with
|
|
310
|
+
* `hasCreate`, and a footer pinned in every state with a confirmed Clear
|
|
311
|
+
* all and Save. The sheet edits a draft: `onChange` fires once, when Save
|
|
312
|
+
* commits it, and a swipe, scrim or Escape close of a changed draft asks
|
|
313
|
+
* before discarding. Suited to compact touch screens, where the inline
|
|
314
|
+
* combobox competes with the software keyboard.
|
|
315
|
+
* - `'adaptive'`: the bottom sheet on compact coarse-pointer screens,
|
|
316
|
+
* otherwise the popover — the same resolution Selector uses. The server
|
|
317
|
+
* render and the hydrating render are the popover.
|
|
318
|
+
*
|
|
319
|
+
* In the sheet presentation the trigger is the control: `ref`, `id`,
|
|
320
|
+
* `aria-*`, and `data-*` reach it. `renderItem`, `renderToken`,
|
|
321
|
+
* `endContent`, `hasClear`, `hasEntriesOnFocus`, `menuWidth`,
|
|
322
|
+
* `tokenOverflowBehavior`, and `hasAutoFocus` have no surface to act on
|
|
323
|
+
* and warn once in development. Pass `'popover'` to keep the inline field
|
|
324
|
+
* and those props on every device.
|
|
325
|
+
* @default 'adaptive'
|
|
326
|
+
*/
|
|
327
|
+
presentation?: TokenizerPresentation;
|
|
328
|
+
/**
|
|
329
|
+
* Ref forwarded to the control: the combobox input in the popover
|
|
330
|
+
* presentation, the trigger button in the sheet presentation. This type
|
|
331
|
+
* keeps its released input element; the component itself also accepts a
|
|
332
|
+
* `Ref<HTMLInputElement | HTMLButtonElement>`, the type to use where the
|
|
333
|
+
* sheet can present.
|
|
334
|
+
*/
|
|
300
335
|
ref?: React.Ref<HTMLInputElement>;
|
|
301
336
|
/** Imperative handle ref for focus/blur control. */
|
|
302
337
|
handleRef?: React.Ref<TokenizerHandle>;
|
|
303
338
|
/**
|
|
304
339
|
* Experimental options, outside the stable compatibility promise: anything
|
|
305
|
-
* in this object may change or be removed in a patch release.
|
|
306
|
-
* the stable behavior.
|
|
340
|
+
* in this object may change or be removed in a patch release.
|
|
307
341
|
* @experimental
|
|
308
342
|
*/
|
|
309
343
|
experimental?: {
|
|
310
344
|
/**
|
|
311
|
-
*
|
|
312
|
-
* - `
|
|
313
|
-
* the stable behavior.
|
|
314
|
-
* - `'bottom-sheet'`: a trigger showing the selected tokens that opens one
|
|
315
|
-
* tall modal sheet: a search row on top, full-width checkbox rows that
|
|
316
|
-
* keep their place while the sheet is open, a create row with
|
|
317
|
-
* `hasCreate`, and a footer pinned in every state with a confirmed Clear
|
|
318
|
-
* all and Save. The sheet edits a draft: `onChange` fires once, when Save
|
|
319
|
-
* commits it, and a swipe, scrim or Escape close of a changed draft asks
|
|
320
|
-
* before discarding. Suited to compact touch screens, where the inline
|
|
321
|
-
* combobox competes with the software keyboard.
|
|
322
|
-
* - `'adaptive'`: the bottom sheet on compact coarse-pointer screens,
|
|
323
|
-
* otherwise the popover — the same resolution Selector uses.
|
|
324
|
-
*
|
|
325
|
-
* In the sheet presentation the trigger is the control: `ref`, `id`,
|
|
326
|
-
* `aria-*`, and `data-*` reach it. `renderItem`, `renderToken`,
|
|
327
|
-
* `endContent`, `hasClear`, `hasEntriesOnFocus`, `menuWidth`,
|
|
328
|
-
* `tokenOverflowBehavior`, and `hasAutoFocus` have no surface to act on
|
|
329
|
-
* and warn once in development.
|
|
345
|
+
* The earlier spelling of `presentation`, with the same values. The
|
|
346
|
+
* top-level `presentation` wins when both are set.
|
|
330
347
|
* @experimental
|
|
331
|
-
* @
|
|
348
|
+
* @deprecated Use the stable `presentation` prop.
|
|
332
349
|
*/
|
|
333
|
-
presentation?:
|
|
350
|
+
presentation?: TokenizerPresentation;
|
|
334
351
|
};
|
|
335
352
|
}
|
|
336
353
|
|
|
354
|
+
/** How Tokenizer presents its choices; see `TokenizerProps.presentation`. */
|
|
355
|
+
export type TokenizerPresentation = AdaptivePresentation;
|
|
356
|
+
|
|
337
357
|
/**
|
|
338
|
-
* The props the
|
|
339
|
-
* `ref` also accepts the sheet
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* `
|
|
343
|
-
* `ComponentProps<typeof Tokenizer>` keep their released shapes.
|
|
358
|
+
* The props the component accepts: `TokenizerProps`, whose `ref` keeps its
|
|
359
|
+
* released input type, with a `ref` that also accepts the sheet
|
|
360
|
+
* presentation's trigger button. `TokenizerProps` stays the declared props
|
|
361
|
+
* type, so `interface X extends TokenizerProps<T>`, `Omit<TokenizerProps<T>,
|
|
362
|
+
* …>` and `ComponentProps<typeof Tokenizer>` keep their released shapes.
|
|
344
363
|
*/
|
|
345
|
-
type
|
|
364
|
+
type TokenizerAcceptedProps<T extends SearchableItem> = Omit<
|
|
346
365
|
TokenizerProps<T>,
|
|
347
|
-
'ref'
|
|
366
|
+
'ref'
|
|
348
367
|
> & {
|
|
349
|
-
/** @experimental */
|
|
350
|
-
experimental: NonNullable<TokenizerProps<T>['experimental']>;
|
|
351
368
|
/**
|
|
352
369
|
* Ref forwarded to the control: the combobox input in the popover
|
|
353
370
|
* presentation, the trigger button in the sheet presentation.
|
|
354
|
-
* @experimental
|
|
355
371
|
*/
|
|
356
372
|
ref?: React.Ref<HTMLInputElement | HTMLButtonElement>;
|
|
357
373
|
};
|
|
@@ -722,11 +738,11 @@ function EndLane({
|
|
|
722
738
|
}
|
|
723
739
|
|
|
724
740
|
// Keep this overload first. TypeScript resolves `ComponentProps<typeof
|
|
725
|
-
// Tokenizer>` against the last overload, so that type stays the
|
|
726
|
-
//
|
|
727
|
-
//
|
|
741
|
+
// Tokenizer>` against the last overload, so that type stays the released
|
|
742
|
+
// props. Every call matches this one, so a ref typed for both controls is
|
|
743
|
+
// accepted.
|
|
728
744
|
export function Tokenizer<T extends SearchableItem>(
|
|
729
|
-
props:
|
|
745
|
+
props: TokenizerAcceptedProps<T>,
|
|
730
746
|
): React.JSX.Element;
|
|
731
747
|
export function Tokenizer<T extends SearchableItem>(
|
|
732
748
|
props: TokenizerProps<T>,
|
|
@@ -776,12 +792,13 @@ export function Tokenizer<T extends SearchableItem>({
|
|
|
776
792
|
ref,
|
|
777
793
|
handleRef,
|
|
778
794
|
onKeyDown,
|
|
795
|
+
presentation: presentationProp,
|
|
779
796
|
experimental,
|
|
780
797
|
id: idProp,
|
|
781
798
|
'aria-describedby': ariaDescribedByProp,
|
|
782
799
|
'aria-labelledby': ariaLabelledByProp,
|
|
783
800
|
...restProps
|
|
784
|
-
}: TokenizerProps<T> |
|
|
801
|
+
}: TokenizerProps<T> | TokenizerAcceptedProps<T>): React.JSX.Element {
|
|
785
802
|
const isEffectivelyRequired = useResolvedRequired({isRequired, isOptional});
|
|
786
803
|
const {rest, container} = useFieldInputStyling('Tokenizer', restProps, {
|
|
787
804
|
containerXstyle,
|
|
@@ -807,11 +824,16 @@ export function Tokenizer<T extends SearchableItem>({
|
|
|
807
824
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
808
825
|
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
809
826
|
|
|
810
|
-
//
|
|
811
|
-
//
|
|
812
|
-
//
|
|
813
|
-
|
|
814
|
-
|
|
827
|
+
// `adaptive` resolves through the policy the selection controls share. An
|
|
828
|
+
// open sheet keeps its presentation until it closes. A resolution change
|
|
829
|
+
// during a task does not replace the open surface.
|
|
830
|
+
const presentation =
|
|
831
|
+
presentationProp ?? experimental?.presentation ?? 'adaptive';
|
|
832
|
+
useDevWarning(
|
|
833
|
+
'Tokenizer',
|
|
834
|
+
'`presentation` and `experimental.presentation` are both set; `presentation` wins. Remove `experimental.presentation`.',
|
|
835
|
+
presentationProp !== undefined && experimental?.presentation !== undefined,
|
|
836
|
+
);
|
|
815
837
|
const resolvedPresentation = useAdaptivePresentation(presentation);
|
|
816
838
|
const [isSheetOpen, setIsSheetOpen] = useState(false);
|
|
817
839
|
// Latched for the sheet's lifetime: a sheet stays presented after it closes
|
|
@@ -931,7 +953,7 @@ export function Tokenizer<T extends SearchableItem>({
|
|
|
931
953
|
inertSheetProps.length === 1 ? 'has' : 'have'
|
|
932
954
|
} no surface in the bottom-sheet presentation and ${
|
|
933
955
|
inertSheetProps.length === 1 ? 'is' : 'are'
|
|
934
|
-
} not rendered there.`,
|
|
956
|
+
} not rendered there. Pass \`presentation="popover"\` to keep the inline field on every device.`,
|
|
935
957
|
);
|
|
936
958
|
// eslint-disable-next-line @eslint-react/exhaustive-deps -- keyed by the joined names
|
|
937
959
|
}, [inertSheetPropsKey]);
|
|
@@ -1466,8 +1488,8 @@ export function Tokenizer<T extends SearchableItem>({
|
|
|
1466
1488
|
{...rest}
|
|
1467
1489
|
ref={useMergedRefs(
|
|
1468
1490
|
inputRef,
|
|
1469
|
-
//
|
|
1470
|
-
//
|
|
1491
|
+
// The ref type admits the sheet's trigger too; in this
|
|
1492
|
+
// presentation it receives the input.
|
|
1471
1493
|
ref as React.Ref<HTMLInputElement> | undefined,
|
|
1472
1494
|
handOffFocusRef,
|
|
1473
1495
|
)}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* EmptyState, AlertDialog, Icon, Spinner, Text, useBusyAnnouncement, and
|
|
9
9
|
* the i18n translator
|
|
10
10
|
* @output Exports TokenizerBottomSheet — the touch surface of
|
|
11
|
-
* `Tokenizer
|
|
11
|
+
* `Tokenizer presentation="bottom-sheet"`: one tall modal sheet
|
|
12
12
|
* with a search row on top, stable-order checkbox rows, progressive
|
|
13
13
|
* long-list rendering, an optional create row, and a confirmed Clear all
|
|
14
14
|
* @position Internal presentation surface of Tokenizer. Loaded on demand by
|
package/src/Tokenizer/index.ts
CHANGED
|
@@ -110,6 +110,18 @@ export const docs = {
|
|
|
110
110
|
description:
|
|
111
111
|
'Render function for the anchor-positioned tooltip content. The positioning opt-out is excluded: the tooltip always derives its position from placement/alignment.',
|
|
112
112
|
},
|
|
113
|
+
{
|
|
114
|
+
name: 'show',
|
|
115
|
+
type: '() => void',
|
|
116
|
+
description:
|
|
117
|
+
'Opens the tooltip now and keeps it open until hide(), Escape, a press outside, or focus leaving its trigger. Its text is announced once, and onShow fires. Under a controlled isOpen it only calls onShow. Does nothing while isEnabled is false.',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'hide',
|
|
121
|
+
type: '() => void',
|
|
122
|
+
description:
|
|
123
|
+
'Closes the tooltip now, and onHide fires. Under a controlled isOpen it only calls onHide.',
|
|
124
|
+
},
|
|
113
125
|
],
|
|
114
126
|
usage: {
|
|
115
127
|
description:
|
|
@@ -125,6 +137,11 @@ export const docs = {
|
|
|
125
137
|
description:
|
|
126
138
|
'Prefer the Tooltip component for standard wrapping; use the hook when the trigger is not a simple child.',
|
|
127
139
|
},
|
|
140
|
+
{
|
|
141
|
+
guidance: true,
|
|
142
|
+
description:
|
|
143
|
+
'For a toggle-style trigger, have your own button call show() and hide() on each press. Give it aria-describedby and aria-controls set to describedBy, and aria-expanded (true while show() holds the tooltip, false after hide() or onHide), and keep its own accessible name. For an info icon, use InfoTip instead.',
|
|
144
|
+
},
|
|
128
145
|
{
|
|
129
146
|
guidance: false,
|
|
130
147
|
description:
|
|
@@ -167,6 +184,8 @@ export const docsDense = {
|
|
|
167
184
|
anchorId: 'CSS anchor name.',
|
|
168
185
|
describedBy: 'ID for aria-describedby.',
|
|
169
186
|
renderTooltip: 'renders anchor-positioned tooltip content.',
|
|
187
|
+
show: 'opens + holds until hide()/Escape/outside press/focus leave; announces once; onShow. Controlled: onShow only. No-op when disabled.',
|
|
188
|
+
hide: 'closes; onHide. Controlled: onHide only.',
|
|
170
189
|
},
|
|
171
190
|
usage: {
|
|
172
191
|
description:
|
|
@@ -182,6 +201,11 @@ export const docsDense = {
|
|
|
182
201
|
description:
|
|
183
202
|
'Prefer Tooltip for standard wrapping; use hook when trigger is not simple child.',
|
|
184
203
|
},
|
|
204
|
+
{
|
|
205
|
+
guidance: true,
|
|
206
|
+
description:
|
|
207
|
+
'Toggle-style trigger: own button calls show()/hide() per press, sets aria-describedby + aria-controls={describedBy}, aria-expanded (true while held), keeps its own name. Info icon: use InfoTip.',
|
|
208
|
+
},
|
|
185
209
|
{
|
|
186
210
|
guidance: false,
|
|
187
211
|
description:
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useTooltip.tsx
|
|
7
7
|
* @input Uses useLayer, usePressPin, React hooks
|
|
8
|
-
* @output Exports useTooltip hook with stable trigger refs for hover/focus/tap tooltips
|
|
8
|
+
* @output Exports useTooltip hook with stable trigger refs for hover/focus/tap tooltips
|
|
9
|
+
* and imperative show() and hide() for an app-built toggle trigger,
|
|
9
10
|
* and the module-only useTooltipWithTriggerBehavior that InfoTip's press-to-pin uses
|
|
10
11
|
* @position Layer hook; builds on useLayer for tooltip behavior
|
|
11
12
|
*
|
|
@@ -17,9 +18,11 @@ import {
|
|
|
17
18
|
useCallback,
|
|
18
19
|
useEffect,
|
|
19
20
|
useRef,
|
|
21
|
+
useState,
|
|
20
22
|
type ReactNode,
|
|
21
23
|
type RefCallback,
|
|
22
24
|
} from 'react';
|
|
25
|
+
import {createTriggerFocusGate} from '../utils/triggerFocus';
|
|
23
26
|
import * as stylex from '@stylexjs/stylex';
|
|
24
27
|
import {
|
|
25
28
|
useLayerInternal,
|
|
@@ -216,29 +219,25 @@ export interface TooltipReturn {
|
|
|
216
219
|
children: ReactNode,
|
|
217
220
|
props?: Omit<ContextRenderProps, 'positioning'>,
|
|
218
221
|
) => ReactNode;
|
|
219
|
-
}
|
|
220
222
|
|
|
221
|
-
/**
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return false;
|
|
223
|
+
/**
|
|
224
|
+
* Opens the tooltip now and keeps it open until `hide()`, Escape, a press
|
|
225
|
+
* outside, or focus leaving its trigger, as a pinned tooltip does. Its text
|
|
226
|
+
* is announced once. Reports through `onShow`. Under a controlled `isOpen`,
|
|
227
|
+
* it calls `onShow` and does not change `isOpen`. Does nothing while
|
|
228
|
+
* `isEnabled` is false.
|
|
229
|
+
*
|
|
230
|
+
* Use `show()` and `hide()` to build a toggle-style trigger: your own button
|
|
231
|
+
* calls them, sets `aria-describedby` and `aria-controls` to `describedBy`
|
|
232
|
+
* and `aria-expanded` (true while shown), and keeps its own accessible name.
|
|
233
|
+
*/
|
|
234
|
+
show: () => void;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Closes the tooltip now. Reports through `onHide`. Under a controlled
|
|
238
|
+
* `isOpen`, it calls `onHide` and does not change `isOpen`.
|
|
239
|
+
*/
|
|
240
|
+
hide: () => void;
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
/**
|
|
@@ -375,6 +374,9 @@ export function useTooltipWithTriggerBehavior(
|
|
|
375
374
|
isHeldOpen: isPressHeldOpen,
|
|
376
375
|
attach: attachPressPin,
|
|
377
376
|
unpin: unpinPress,
|
|
377
|
+
hold: holdPress,
|
|
378
|
+
release: releasePress,
|
|
379
|
+
isAppHeld,
|
|
378
380
|
isPinShown,
|
|
379
381
|
touch: {
|
|
380
382
|
isTouchPointerRef,
|
|
@@ -485,32 +487,13 @@ export function useTooltipWithTriggerBehavior(
|
|
|
485
487
|
[isTouchPointerRef, layerId, scheduleHide],
|
|
486
488
|
);
|
|
487
489
|
|
|
488
|
-
// Under `auto`, whether focus counts is decided when it arrives,
|
|
489
|
-
//
|
|
490
|
-
|
|
491
|
-
// by definition; focus inside it counts only while the trigger is
|
|
492
|
-
// focusable too, so a plain wrapper still ignores its children's focus.
|
|
493
|
-
const isFocusForTrigger = useCallback(
|
|
494
|
-
(e: Event): boolean => {
|
|
495
|
-
if (focusTrigger === 'always') {
|
|
496
|
-
return true;
|
|
497
|
-
}
|
|
498
|
-
const triggerEl = e.currentTarget as HTMLElement | null;
|
|
499
|
-
return (
|
|
500
|
-
triggerEl != null && (e.target === triggerEl || isFocusable(triggerEl))
|
|
501
|
-
);
|
|
502
|
-
},
|
|
503
|
-
[focusTrigger],
|
|
504
|
-
);
|
|
505
|
-
|
|
506
|
-
// Whether the trigger's current focus counted when it arrived, so its blur
|
|
507
|
-
// hides the tooltip even if the trigger has since left the tab order.
|
|
508
|
-
const focusCountedRef = useRef(false);
|
|
490
|
+
// Under `auto`, whether focus counts is decided when it arrives, and a
|
|
491
|
+
// focus that counted still hides on blur (utils/triggerFocus.ts).
|
|
492
|
+
const [focusGate] = useState(createTriggerFocusGate);
|
|
509
493
|
|
|
510
494
|
const handleFocusIn = useCallback(
|
|
511
495
|
(e: Event) => {
|
|
512
|
-
|
|
513
|
-
if (!isEnabled || !focusCountedRef.current) {
|
|
496
|
+
if (!focusGate.focusIn(e, focusTrigger) || !isEnabled) {
|
|
514
497
|
return;
|
|
515
498
|
}
|
|
516
499
|
// A tap focuses the trigger it activates, and `:focus-visible` does not
|
|
@@ -531,8 +514,9 @@ export function useTooltipWithTriggerBehavior(
|
|
|
531
514
|
showLayer();
|
|
532
515
|
},
|
|
533
516
|
[
|
|
517
|
+
focusGate,
|
|
518
|
+
focusTrigger,
|
|
534
519
|
isEnabled,
|
|
535
|
-
isFocusForTrigger,
|
|
536
520
|
isTouchInteraction,
|
|
537
521
|
clearTimeouts,
|
|
538
522
|
showLayer,
|
|
@@ -544,13 +528,12 @@ export function useTooltipWithTriggerBehavior(
|
|
|
544
528
|
// which a held tooltip skips.
|
|
545
529
|
const handleFocusOut = useCallback(
|
|
546
530
|
(e: Event) => {
|
|
547
|
-
if (!
|
|
531
|
+
if (!focusGate.focusOut(e, focusTrigger)) {
|
|
548
532
|
return;
|
|
549
533
|
}
|
|
550
|
-
focusCountedRef.current = false;
|
|
551
534
|
scheduleHide();
|
|
552
535
|
},
|
|
553
|
-
[
|
|
536
|
+
[focusGate, focusTrigger, scheduleHide],
|
|
554
537
|
);
|
|
555
538
|
|
|
556
539
|
// Pressing the trigger hides its own tooltip: once the control is activated
|
|
@@ -562,9 +545,10 @@ export function useTooltipWithTriggerBehavior(
|
|
|
562
545
|
// tooltip at all), so the touch path answers it first.
|
|
563
546
|
const handlePointerDown = useCallback(
|
|
564
547
|
(event: PointerEvent) => {
|
|
565
|
-
// A
|
|
566
|
-
//
|
|
567
|
-
|
|
548
|
+
// A toggle trigger's press pins or closes through its click. The app's
|
|
549
|
+
// hide() closes a held tooltip. Neither path hides here or waits for a
|
|
550
|
+
// tap verdict.
|
|
551
|
+
if (isToggleTrigger(triggerRef.current) || isAppHeld()) {
|
|
568
552
|
return;
|
|
569
553
|
}
|
|
570
554
|
if (handleTouchPointerDown(event)) {
|
|
@@ -576,7 +560,14 @@ export function useTooltipWithTriggerBehavior(
|
|
|
576
560
|
clearTimeouts();
|
|
577
561
|
hideLayer();
|
|
578
562
|
},
|
|
579
|
-
[
|
|
563
|
+
[
|
|
564
|
+
isToggleTrigger,
|
|
565
|
+
isAppHeld,
|
|
566
|
+
handleTouchPointerDown,
|
|
567
|
+
isOpen,
|
|
568
|
+
clearTimeouts,
|
|
569
|
+
hideLayer,
|
|
570
|
+
],
|
|
580
571
|
);
|
|
581
572
|
|
|
582
573
|
// Interaction ref that handles event listeners only
|
|
@@ -609,7 +600,7 @@ export function useTooltipWithTriggerBehavior(
|
|
|
609
600
|
el.addEventListener('pointerdown', handlePointerDown);
|
|
610
601
|
|
|
611
602
|
// Focus listeners unless focus never opens the tooltip; `auto` decides
|
|
612
|
-
// per event (
|
|
603
|
+
// per event (utils/triggerFocus.ts).
|
|
613
604
|
if (focusTrigger !== 'never') {
|
|
614
605
|
el.addEventListener('focusin', handleFocusIn);
|
|
615
606
|
el.addEventListener('focusout', handleFocusOut);
|
|
@@ -665,9 +656,11 @@ export function useTooltipWithTriggerBehavior(
|
|
|
665
656
|
showLayer();
|
|
666
657
|
} else {
|
|
667
658
|
clearTimeouts();
|
|
659
|
+
// A pin or app hold ends when the consumer closes the tooltip.
|
|
660
|
+
unpinPress();
|
|
668
661
|
hideLayer();
|
|
669
662
|
}
|
|
670
|
-
}, [isOpen, clearTimeouts, showLayer, hideLayer]);
|
|
663
|
+
}, [isOpen, clearTimeouts, showLayer, hideLayer, unpinPress]);
|
|
671
664
|
|
|
672
665
|
// Dismiss on Escape (WCAG 1.4.13 — dismissible) through the shared layer
|
|
673
666
|
// stack. A visible tip is the top-most layer, so it takes the press and
|
|
@@ -763,6 +756,16 @@ export function useTooltipWithTriggerBehavior(
|
|
|
763
756
|
],
|
|
764
757
|
);
|
|
765
758
|
|
|
759
|
+
const show = useCallback(() => {
|
|
760
|
+
clearTimeouts();
|
|
761
|
+
holdPress();
|
|
762
|
+
}, [clearTimeouts, holdPress]);
|
|
763
|
+
|
|
764
|
+
const hide = useCallback(() => {
|
|
765
|
+
clearTimeouts();
|
|
766
|
+
releasePress();
|
|
767
|
+
}, [clearTimeouts, releasePress]);
|
|
768
|
+
|
|
766
769
|
return {
|
|
767
770
|
ref,
|
|
768
771
|
positionRef: layerRef,
|
|
@@ -770,5 +773,7 @@ export function useTooltipWithTriggerBehavior(
|
|
|
770
773
|
anchorId: layerAnchorId,
|
|
771
774
|
describedBy: layerId,
|
|
772
775
|
renderTooltip,
|
|
776
|
+
show,
|
|
777
|
+
hide,
|
|
773
778
|
};
|
|
774
779
|
}
|
|
@@ -24,6 +24,7 @@ import React, {
|
|
|
24
24
|
useCallback,
|
|
25
25
|
useEffect,
|
|
26
26
|
useId,
|
|
27
|
+
useInsertionEffect,
|
|
27
28
|
useMemo,
|
|
28
29
|
useRef,
|
|
29
30
|
useState,
|
|
@@ -775,15 +776,6 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
775
776
|
// source: they can never be re-shown, so focus bootstraps the new source.
|
|
776
777
|
const sourceGenRef = useRef(0);
|
|
777
778
|
|
|
778
|
-
// Results still arriving from a replaced source must not land in the new
|
|
779
|
-
// one's menu.
|
|
780
|
-
const prevSearchSourceRef = useRef(searchSource);
|
|
781
|
-
if (prevSearchSourceRef.current !== searchSource) {
|
|
782
|
-
prevSearchSourceRef.current.cancel?.();
|
|
783
|
-
prevSearchSourceRef.current = searchSource;
|
|
784
|
-
sourceGenRef.current = ++searchGenRef.current;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
779
|
// The previous source is remembered in state, not a ref, so a render React
|
|
788
780
|
// discards cannot consume the comparison without its state updates.
|
|
789
781
|
const [sourceOfState, setSourceOfState] = useState(searchSource);
|
|
@@ -793,7 +785,6 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
793
785
|
setIsLoading(false);
|
|
794
786
|
setHasSearched(false);
|
|
795
787
|
}
|
|
796
|
-
loadingRef.current = false;
|
|
797
788
|
}
|
|
798
789
|
// A field that becomes disabled stops showing a search as busy in the same
|
|
799
790
|
// render, and the dropped query shows no outcome, so no empty state; the
|
|
@@ -807,15 +798,34 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
807
798
|
}
|
|
808
799
|
}
|
|
809
800
|
|
|
810
|
-
//
|
|
811
|
-
// source
|
|
812
|
-
//
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
801
|
+
// Results that arrive from a replaced source must not land in the new
|
|
802
|
+
// source's menu, so the replacement starts a new generation. That happens
|
|
803
|
+
// when the replacement commits, not in render. React can render a
|
|
804
|
+
// replacement and then discard it, for example when a transition suspends
|
|
805
|
+
// and a newer update replaces it. The source that stays then keeps its read.
|
|
806
|
+
// An insertion effect runs before every layout effect and ref callback of
|
|
807
|
+
// its commit. A read that one of them starts against the replacement gets a
|
|
808
|
+
// later generation, after the replaced source stopped its requests.
|
|
809
|
+
const prevSearchSourceRef = useRef(searchSource);
|
|
810
|
+
const isSourceReplacedRef = useRef(false);
|
|
811
|
+
useInsertionEffect(() => {
|
|
812
|
+
if (prevSearchSourceRef.current === searchSource) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
prevSearchSourceRef.current.cancel?.();
|
|
816
|
+
prevSearchSourceRef.current = searchSource;
|
|
817
|
+
sourceGenRef.current = ++searchGenRef.current;
|
|
818
|
+
// The replacing render cleared the busy state.
|
|
819
|
+
loadingRef.current = false;
|
|
820
|
+
isSourceReplacedRef.current = true;
|
|
821
|
+
}, [searchSource]);
|
|
822
|
+
// Syncs the wrapper's busy lane. A read of the replacement that already
|
|
823
|
+
// started keeps the lane busy.
|
|
824
|
+
useIsomorphicLayoutEffect(() => {
|
|
825
|
+
if (!isSourceReplacedRef.current) {
|
|
817
826
|
return;
|
|
818
827
|
}
|
|
828
|
+
isSourceReplacedRef.current = false;
|
|
819
829
|
if (!loadingRef.current) {
|
|
820
830
|
onLoadingChangeRef.current?.(false);
|
|
821
831
|
}
|
|
@@ -43,7 +43,8 @@ export const docs = {
|
|
|
43
43
|
{
|
|
44
44
|
name: 'group',
|
|
45
45
|
type: 'string',
|
|
46
|
-
description:
|
|
46
|
+
description:
|
|
47
|
+
'This prop has no effect. Set `item.auxiliaryData.group` on search-source items to group results in Typeahead or BaseTypeahead.',
|
|
47
48
|
},
|
|
48
49
|
],
|
|
49
50
|
};
|
|
@@ -79,7 +80,8 @@ export const docsZh = {
|
|
|
79
80
|
{
|
|
80
81
|
name: 'group',
|
|
81
82
|
type: 'string',
|
|
82
|
-
description:
|
|
83
|
+
description:
|
|
84
|
+
'此属性不影响渲染。要在 Typeahead 或 BaseTypeahead 中分组,请在搜索源返回的结果项上设置 `item.auxiliaryData.group`。',
|
|
83
85
|
},
|
|
84
86
|
],
|
|
85
87
|
};
|
|
@@ -94,6 +96,7 @@ export const docsDense = {
|
|
|
94
96
|
icon: 'Icon/avatar before label.',
|
|
95
97
|
description: 'Text below label.',
|
|
96
98
|
isDisabled: 'Visually disabled.',
|
|
97
|
-
group:
|
|
99
|
+
group:
|
|
100
|
+
'No effect. Group results via `item.auxiliaryData.group` in the search source.',
|
|
98
101
|
},
|
|
99
102
|
};
|
|
@@ -54,7 +54,8 @@ export interface TypeaheadItemProps<
|
|
|
54
54
|
isDisabled?: boolean;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* This prop has no effect. Set `item.auxiliaryData.group` on search-source
|
|
58
|
+
* items to group results in Typeahead or BaseTypeahead.
|
|
58
59
|
*/
|
|
59
60
|
group?: string;
|
|
60
61
|
}
|