@astryxdesign/core 0.7.8 → 0.7.9-canary.07992bb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell/observeMainOverflow.d.ts.map +1 -1
- package/dist/AppShell/observeMainOverflow.js +9 -6
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +5 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +40 -8
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +61 -21
- package/dist/Calendar/Calendar.d.ts +14 -2
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +63 -74
- package/dist/Calendar/getInitialFocusDate.d.ts +4 -1
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
- package/dist/Calendar/getInitialFocusDate.js +7 -5
- package/dist/Calendar/hooks/useCalendarDays.d.ts +19 -2
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +57 -64
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts +28 -3
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +33 -22
- package/dist/Calendar/styles.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +54 -11
- package/dist/ClickableCard/ClickableCard.d.ts +1 -1
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +5 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +4 -1
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +7 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +5 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +4 -1
- package/dist/Dialog/Dialog.d.ts +2 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +12 -1
- package/dist/Drawer/useDrawerDialogPresence.d.ts +2 -1
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +11 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +9 -4
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -2
- package/dist/Field/inputDisabledFocus.d.ts +4 -4
- package/dist/Field/inputStyles.stylex.d.ts +1 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +16 -2
- package/dist/HoverCard/useHoverCard.d.ts +3 -1
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/InfoTip/InfoTip.d.ts +1 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +1 -0
- package/dist/InputGroup/InputGroup.d.ts +4 -3
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +2 -2
- package/dist/InputGroup/groupStyles.d.ts +1 -1
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +1 -1
- package/dist/Item/Item.d.ts +2 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +29 -6
- package/dist/Layer/holdEntranceInput.d.ts +24 -0
- package/dist/Layer/holdEntranceInput.d.ts.map +1 -0
- package/dist/Layer/holdEntranceInput.js +65 -0
- package/dist/Layer/inputHold.d.ts +49 -0
- package/dist/Layer/inputHold.d.ts.map +1 -0
- package/dist/Layer/inputHold.js +636 -0
- package/dist/Layer/preserveAnimations.d.ts +1 -5
- package/dist/Layer/preserveAnimations.d.ts.map +1 -1
- package/dist/Layer/preserveAnimations.js +12 -214
- package/dist/Layer/useLayer.d.ts +3 -1
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +64 -4
- package/dist/Layout/LayoutContent.d.ts +3 -1
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +12 -4
- package/dist/Layout/LayoutPanel.d.ts +4 -1
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +13 -4
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -0
- package/dist/MetadataList/MetadataList.js +1 -1
- package/dist/MobileNav/MobileNav.d.ts +11 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +39 -1
- package/dist/MoreMenu/MoreMenu.d.ts +5 -3
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.d.ts +4 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +244 -11
- package/dist/Popover/usePopover.d.ts +1 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +12 -5
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +9 -3
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +14 -11
- package/dist/PowerSearch/formatTokenValue.d.ts +6 -2
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatTokenValue.js +6 -3
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +22 -4
- package/dist/SelectableCard/SelectableCard.d.ts +1 -1
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +5 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +14 -71
- package/dist/Spinner/index.d.ts +1 -1
- package/dist/Spinner/index.d.ts.map +1 -1
- package/dist/Spinner/spinnerRotor.d.ts +28 -0
- package/dist/Spinner/spinnerRotor.d.ts.map +1 -0
- package/dist/Spinner/spinnerRotor.js +98 -0
- package/dist/Stack/StackItem.d.ts +8 -4
- package/dist/Stack/StackItem.d.ts.map +1 -1
- package/dist/Stack/StackItem.js +17 -4
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -10
- package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +14 -8
- package/dist/Timestamp/formatInstant.d.ts +10 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +13 -27
- package/dist/Timestamp/tooltipEntries.d.ts +5 -3
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +6 -4
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +9 -0
- package/dist/Token/TokenLink.d.ts +1 -1
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +4 -1
- package/dist/Tokenizer/Tokenizer.d.ts +14 -10
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +189 -89
- package/dist/Tooltip/useTooltip.d.ts +3 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +162 -59
- package/dist/TreeList/TreeListItem.d.ts +2 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +27 -3
- package/dist/astryx.css +45 -18
- package/dist/gestures/GestureHost.d.ts +2 -2
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +21 -6
- package/dist/gestures/PanGestureRecognizer.d.ts +11 -1
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +15 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +6 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.d.ts +3 -6
- package/dist/gestures/nativeScroll.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.js +7 -52
- package/dist/gestures/wheelSegmenter.d.ts +68 -1
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +199 -10
- package/dist/hooks/StackItemScrollRegion.d.ts +31 -0
- package/dist/hooks/StackItemScrollRegion.d.ts.map +1 -0
- package/dist/hooks/StackItemScrollRegion.js +40 -0
- package/dist/hooks/menuPressGesture.d.ts +133 -21
- package/dist/hooks/menuPressGesture.d.ts.map +1 -1
- package/dist/hooks/menuPressGesture.js +155 -30
- package/dist/hooks/menuPressValues.d.ts +16 -0
- package/dist/hooks/menuPressValues.d.ts.map +1 -0
- package/dist/hooks/menuPressValues.js +18 -0
- package/dist/hooks/useClickableContainer.d.ts +27 -5
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +41 -5
- package/dist/hooks/useFocusTrap.d.ts +10 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +225 -132
- package/dist/hooks/useMenuPress.d.ts +34 -1
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +93 -5
- package/dist/hooks/usePressFeedback.d.ts +6 -6
- package/dist/hooks/usePressFeedback.js +6 -6
- package/dist/hooks/useScrollRegionProps.d.ts +35 -0
- package/dist/hooks/useScrollRegionProps.d.ts.map +1 -0
- package/dist/hooks/useScrollRegionProps.js +51 -0
- package/dist/i18n/InternationalizationContext.d.ts +6 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.d.ts +21 -3
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +8 -3
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts +8 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.js +12 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +1 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +1 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/useCalendarSystem.d.ts +19 -0
- package/dist/i18n/useCalendarSystem.d.ts.map +1 -0
- package/dist/i18n/useCalendarSystem.js +61 -0
- package/dist/internal/spinner-rotor.d.ts +16 -0
- package/dist/internal/spinner-rotor.d.ts.map +1 -0
- package/dist/internal/spinner-rotor.js +16 -0
- package/dist/internal/touch.d.ts +14 -1
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +20 -2
- package/dist/motion/carryAnimations.d.ts +58 -0
- package/dist/motion/carryAnimations.d.ts.map +1 -0
- package/dist/motion/carryAnimations.js +305 -0
- package/dist/motion/transientCopy.d.ts +4 -2
- package/dist/motion/transientCopy.d.ts.map +1 -1
- package/dist/motion/transientCopy.js +34 -5
- package/dist/motion/uikit/gestures.d.ts +41 -0
- package/dist/motion/uikit/gestures.d.ts.map +1 -1
- package/dist/motion/uikit/gestures.js +25 -0
- package/dist/motion/uikit/index.d.ts +1 -1
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +1 -1
- package/dist/motion/uikit/timing.d.ts +14 -10
- package/dist/motion/uikit/timing.d.ts.map +1 -1
- package/dist/motion/uikit/timing.js +7 -5
- package/dist/privateAttributes/menuPressLit.stylex.d.ts +52 -0
- package/dist/privateAttributes/menuPressLit.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/menuPressLit.stylex.js +99 -0
- package/dist/privateAttributes/press.stylex.d.ts +139 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/press.stylex.js +97 -0
- package/dist/theme/themeMotion.d.ts +3 -2
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +3 -2
- package/dist/theme/tokens.stylex.d.ts +2 -2
- package/dist/theme/tokens.stylex.js +1 -1
- package/dist/utils/calendarSystem.d.ts +114 -0
- package/dist/utils/calendarSystem.d.ts.map +1 -0
- package/dist/utils/calendarSystem.js +386 -0
- package/dist/utils/flatTree.d.ts +6 -3
- package/dist/utils/flatTree.d.ts.map +1 -1
- package/dist/utils/flatTree.js +13 -3
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +82 -5
- package/dist/utils/inputStream.d.ts +14 -1
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +40 -9
- package/dist/utils/interactionOverlay.stylex.d.ts +5 -9
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +29 -31
- package/dist/utils/plainDate.d.ts +23 -7
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +57 -18
- package/dist/utils/pressFeedback.d.ts +10 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +40 -15
- package/dist/utils/pressGesture.d.ts +12 -6
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +26 -8
- package/dist/utils/scrollView.d.ts +25 -0
- package/dist/utils/scrollView.d.ts.map +1 -0
- package/dist/utils/scrollView.js +108 -0
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +1 -10
- package/dist/utils/touchHitArea.stylex.d.ts +35 -0
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -0
- package/dist/utils/touchHitArea.stylex.js +32 -0
- package/dist/utils/triggerFocus.d.ts +5 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -1
- package/dist/utils/triggerFocus.js +9 -2
- package/locales/en.json +4 -0
- package/locales/pseudo.json +3 -0
- package/package.json +10 -4
- package/src/AppShell/observeMainOverflow.ts +9 -6
- package/src/BottomSheet/BottomSheet.tsx +5 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
- package/src/BottomSheet/useSheetGestures.ts +83 -20
- package/src/Calendar/Calendar.doc.mjs +76 -6
- package/src/Calendar/Calendar.tsx +123 -104
- package/src/Calendar/getInitialFocusDate.ts +22 -8
- package/src/Calendar/hooks/useCalendarDays.ts +89 -63
- package/src/Calendar/hooks/useCalendarNavigation.ts +68 -26
- package/src/CheckboxInput/CheckboxInput.doc.mjs +3 -2
- package/src/CheckboxInput/CheckboxInput.tsx +71 -9
- package/src/ClickableCard/ClickableCard.tsx +8 -1
- package/src/DateInput/DateInput.tsx +2 -0
- package/src/DateInput/PickerWheel.tsx +7 -2
- package/src/DateRangeInput/DateRangeInput.tsx +3 -1
- package/src/DateTimeInput/DateTimeInput.tsx +2 -0
- package/src/Dialog/Dialog.doc.mjs +1 -1
- package/src/Dialog/Dialog.tsx +12 -1
- package/src/Drawer/Drawer.doc.mjs +1 -1
- package/src/Drawer/useDrawerDialogPresence.ts +9 -2
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -2
- package/src/DropdownMenu/DropdownMenu.tsx +29 -5
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuItem.tsx +8 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -1
- package/src/FileInput/FileInput.tsx +16 -2
- package/src/HoverCard/useHoverCard.tsx +3 -1
- package/src/InfoTip/InfoTip.doc.mjs +26 -2
- package/src/InfoTip/InfoTip.tsx +1 -0
- package/src/InputGroup/InputGroup.doc.mjs +4 -3
- package/src/InputGroup/InputGroup.tsx +4 -3
- package/src/InputGroup/groupStyles.ts +3 -1
- package/src/Item/Item.tsx +51 -9
- package/src/Layer/holdEntranceInput.ts +84 -0
- package/src/Layer/inputHold.ts +734 -0
- package/src/Layer/preserveAnimations.ts +12 -275
- package/src/Layer/useLayer.tsx +77 -4
- package/src/Layout/LayoutContent.doc.mjs +6 -3
- package/src/Layout/LayoutContent.tsx +10 -4
- package/src/Layout/LayoutPanel.doc.mjs +6 -3
- package/src/Layout/LayoutPanel.tsx +11 -4
- package/src/Lightbox/Lightbox.tsx +4 -0
- package/src/MetadataList/MetadataList.tsx +1 -1
- package/src/MobileNav/MobileNav.doc.mjs +3 -3
- package/src/MobileNav/MobileNav.tsx +39 -1
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -4
- package/src/MoreMenu/MoreMenu.tsx +5 -3
- package/src/NumberInput/NumberInput.doc.mjs +1 -1
- package/src/NumberInput/NumberInput.tsx +259 -11
- package/src/Popover/usePopover.tsx +1 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
- package/src/PowerSearch/PowerSearch.tsx +20 -3
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +4 -1
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -11
- package/src/PowerSearch/formatTokenValue.ts +7 -1
- package/src/RadioList/RadioListItem.doc.mjs +3 -2
- package/src/RadioList/RadioListItem.tsx +25 -7
- package/src/SelectableCard/SelectableCard.tsx +8 -1
- package/src/Spinner/Spinner.tsx +7 -89
- package/src/Spinner/index.ts +1 -5
- package/src/Spinner/spinnerRotor.ts +113 -0
- package/src/Stack/Stack.doc.mjs +1 -1
- package/src/Stack/StackItem.tsx +27 -13
- package/src/Switch/Switch.tsx +7 -6
- package/src/Table/plugins/sortable/useTableSortable.tsx +1 -1
- package/src/Timestamp/Timestamp.doc.mjs +3 -3
- package/src/Timestamp/Timestamp.tsx +13 -8
- package/src/Timestamp/formatInstant.ts +49 -28
- package/src/Timestamp/tooltipEntries.ts +7 -3
- package/src/Token/Token.tsx +18 -1
- package/src/Token/TokenLink.tsx +7 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +3 -3
- package/src/Tokenizer/Tokenizer.tsx +252 -115
- package/src/Tooltip/useTooltip.tsx +178 -80
- package/src/TreeList/TreeListItem.tsx +36 -2
- package/src/gestures/GestureHost.ts +21 -5
- package/src/gestures/PanGestureRecognizer.ts +19 -2
- package/src/gestures/README.md +14 -5
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +6 -1
- package/src/gestures/nativeScroll.ts +12 -68
- package/src/gestures/wheelSegmenter.ts +243 -10
- package/src/hooks/StackItemScrollRegion.tsx +57 -0
- package/src/hooks/menuPressGesture.ts +244 -38
- package/src/hooks/menuPressValues.ts +18 -0
- package/src/hooks/useClickableContainer.doc.mjs +8 -2
- package/src/hooks/useClickableContainer.ts +72 -6
- package/src/hooks/useFocusTrap.ts +268 -151
- package/src/hooks/useMenuPress.ts +118 -11
- package/src/hooks/usePressFeedback.doc.mjs +3 -3
- package/src/hooks/usePressFeedback.ts +6 -6
- package/src/hooks/useScrollRegionProps.ts +76 -0
- package/src/i18n/InternationalizationContext.ts +6 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +29 -1
- package/src/i18n/InternationalizationProvider.tsx +33 -3
- package/src/i18n/generated-english/hooks/useScrollRegionProps.generated.ts +13 -0
- package/src/i18n/generated-locales/en.generated.ts +1 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/useCalendarSystem.ts +95 -0
- package/src/internal/spinner-rotor.ts +20 -0
- package/src/internal/touch.ts +34 -1
- package/src/motion/MEASUREMENTS.md +11 -0
- package/src/motion/carryAnimations.ts +389 -0
- package/src/motion/transientCopy.ts +45 -5
- package/src/motion/uikit/gestures.ts +22 -0
- package/src/motion/uikit/index.ts +1 -0
- package/src/motion/uikit/timing.ts +7 -5
- package/src/privateAttributes/menuPressLit.stylex.ts +104 -0
- package/src/privateAttributes/press.stylex.ts +243 -0
- package/src/theme/themeMotion.ts +3 -2
- package/src/theme/tokens.stylex.ts +1 -1
- package/src/utils/calendarSystem.ts +548 -0
- package/src/utils/flatTree.ts +15 -3
- package/src/utils/hitArea.ts +107 -5
- package/src/utils/inputStream.ts +47 -10
- package/src/utils/interactionOverlay.stylex.ts +19 -22
- package/src/utils/plainDate.ts +84 -19
- package/src/utils/pressFeedback.ts +46 -14
- package/src/utils/pressGesture.ts +35 -9
- package/src/utils/scrollView.ts +135 -0
- package/src/utils/selectionLock.ts +5 -10
- package/src/utils/touchHitArea.stylex.ts +41 -0
- package/src/utils/triggerFocus.ts +17 -4
|
@@ -28,7 +28,7 @@ export const docs = {
|
|
|
28
28
|
name: 'format',
|
|
29
29
|
type: "'relative' | 'relative_short' | 'auto' | 'date' | 'date_long' | 'date_weekday' | 'date_time' | 'time' | 'system_date' | 'system_date_time' | 'system_time' | 'unix_seconds'",
|
|
30
30
|
description:
|
|
31
|
-
"Display format. 'relative' uses the locale's native long relative-time wording ('2 hours ago' in English), 'relative_short' uses its narrow pattern ('2h ago' in English) for compact surfaces, 'date' shows 'Mar 21, 2025', 'date_long' shows 'March 21, 2025', 'date_weekday' shows 'Wed, Mar 21, 2025', 'date_time' shows 'Mar 21, 2025, 2:51 PM', 'time' shows '2:51 PM', 'system_*' variants use ISO-style formatting, 'unix_seconds' shows the Unix time in whole seconds since the epoch (an absolute, zone-independent value), 'auto' switches from relative to date_time based on recency. Absolute formats never read the current time. 'relative', 'relative_short' and 'auto' read it on the client only: a server render or static prerender shows the full date and time in UTC, labelled, and the client switches to the format's normal output after hydration.",
|
|
31
|
+
"Display format. 'relative' uses the locale's native long relative-time wording ('2 hours ago' in English), 'relative_short' uses its narrow pattern ('2h ago' in English) for compact surfaces, 'date' shows 'Mar 21, 2025', 'date_long' shows 'March 21, 2025', 'date_weekday' shows 'Wed, Mar 21, 2025', 'date_time' shows 'Mar 21, 2025, 2:51 PM', 'time' shows '2:51 PM', 'system_*' variants use ISO-style formatting, 'unix_seconds' shows the Unix time in whole seconds since the epoch (an absolute, zone-independent value), 'auto' switches from relative to date_time based on recency. Absolute formats never read the current time. 'relative', 'relative_short' and 'auto' read it on the client only: a server render or static prerender shows the full date and time in UTC, labelled, and the client switches to the format's normal output after hydration. Date-bearing formats ('date', 'date_long', 'date_weekday', 'date_time', and the full date in the hover card and the accessible name) use the InternationalizationProvider calendar, such as calendar=\"persian\"; 'time', the relative formats, 'system_*', and 'unix_seconds' do not change.",
|
|
32
32
|
default: "'auto'",
|
|
33
33
|
},
|
|
34
34
|
{
|
|
@@ -124,7 +124,7 @@ export const docs = {
|
|
|
124
124
|
export const docsZh = {
|
|
125
125
|
propDescriptions: {
|
|
126
126
|
value: '\u8981\u663e\u793a\u7684\u65e5\u671f/\u65f6\u95f4\u3002\u63a5\u53d7 Unix \u65f6\u95f4\u6233\uff08\u79d2\uff09\u6216 ISO 8601 \u5b57\u7b26\u4e32\u3002',
|
|
127
|
-
format: "\u663e\u793a\u683c\u5f0f\u3002'relative' \u663e\u793a '2\u5c0f\u65f6\u524d'\uff0c'date' \u663e\u793a\u65e5\u671f\uff0c'date_long' \u663e\u793a\u957f\u6708\u4efd\u65e5\u671f\uff0c'date_weekday' \u663e\u793a\u661f\u671f+\u65e5\u671f\uff0c'auto' \u6839\u636e\u65f6\u95f4\u8fdc\u8fd1\u81ea\u52a8\u5207\u6362\u3002",
|
|
127
|
+
format: "\u663e\u793a\u683c\u5f0f\u3002'relative' \u663e\u793a '2\u5c0f\u65f6\u524d'\uff0c'date' \u663e\u793a\u65e5\u671f\uff0c'date_long' \u663e\u793a\u957f\u6708\u4efd\u65e5\u671f\uff0c'date_weekday' \u663e\u793a\u661f\u671f+\u65e5\u671f\uff0c'auto' \u6839\u636e\u65f6\u95f4\u8fdc\u8fd1\u81ea\u52a8\u5207\u6362\u3002\u5e26\u65e5\u671f\u7684\u683c\u5f0f\uff08'date'\u3001'date_long'\u3001'date_weekday'\u3001'date_time'\uff0c\u4ee5\u53ca\u60ac\u505c\u5361\u7247\u548c\u65e0\u969c\u788d\u540d\u79f0\u4e2d\u7684\u5b8c\u6574\u65e5\u671f\uff09\u4f7f\u7528 InternationalizationProvider \u7684\u5386\u6cd5\uff08\u5982 calendar=\"persian\"\uff09\uff1b'time'\u3001\u76f8\u5bf9\u683c\u5f0f\u3001'system_*' \u548c 'unix_seconds' \u4e0d\u53d8\u3002",
|
|
128
128
|
autoThreshold: "auto \u683c\u5f0f\u4ece\u76f8\u5bf9\u65f6\u95f4\u5207\u6362\u5230 date_time \u7684\u9608\u503c\u79d2\u6570\u3002",
|
|
129
129
|
hasTooltip: '\u60ac\u505c\u65f6\u662f\u5426\u663e\u793a\u5305\u542b\u5b8c\u6574\u65e5\u671f/\u65f6\u95f4\u7684\u53ef\u590d\u5236\u60ac\u505c\u5361\u7247\uff08\u76f8\u5bf9\u65f6\u95f4\u6a21\u5f0f\uff0c\u6216\u914d\u7f6e tooltipEntries \u7684\u4efb\u610f\u683c\u5f0f\uff09\u3002',
|
|
130
130
|
tooltipEntries:
|
|
@@ -186,7 +186,7 @@ export const docsDense = {
|
|
|
186
186
|
},
|
|
187
187
|
propDescriptions: {
|
|
188
188
|
value: 'date/time as unix seconds or ISO string',
|
|
189
|
-
format: "display mode: 'relative' (locale-native long wording), 'relative_short' (locale-native narrow wording), 'auto', 'date', 'date_long', 'date_weekday', 'date_time', 'time', 'system_date', 'system_date_time', 'system_time', 'unix_seconds'",
|
|
189
|
+
format: "display mode: 'relative' (locale-native long wording), 'relative_short' (locale-native narrow wording), 'auto', 'date', 'date_long', 'date_weekday', 'date_time', 'time', 'system_date', 'system_date_time', 'system_time', 'unix_seconds'; date-bearing formats use the provider calendar, system_* and time do not",
|
|
190
190
|
autoThreshold: 'seconds threshold for auto relative\u2192date_time switch',
|
|
191
191
|
hasTooltip: 'show copyable full-time hover card on hover (relative mode, or any format with tooltipEntries)',
|
|
192
192
|
tooltipEntries:
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Timestamp.tsx
|
|
7
|
-
* @input Uses React, Text, provider locale, and Timestamp formatters
|
|
7
|
+
* @input Uses React, Text, provider locale and calendar, and Timestamp formatters
|
|
8
8
|
* @output Exports Timestamp component and related types
|
|
9
9
|
* @position Core implementation; renders formatted timestamps
|
|
10
10
|
*
|
|
@@ -31,6 +31,7 @@ import type {TextType, TextSize, TextColor, TextWeight} from '../theme/types';
|
|
|
31
31
|
import {mergeProps} from '../utils';
|
|
32
32
|
import {useDevWarning} from '../hooks/useDevWarning';
|
|
33
33
|
import {useLocale} from '../i18n/useLocale';
|
|
34
|
+
import {useCalendarSystem} from '../i18n/useCalendarSystem';
|
|
34
35
|
import type {BaseProps} from '../BaseProps';
|
|
35
36
|
import {themeProps} from '../utils/themeProps';
|
|
36
37
|
import {formatInstant} from './formatInstant';
|
|
@@ -297,6 +298,7 @@ export function Timestamp({
|
|
|
297
298
|
}: TimestampProps) {
|
|
298
299
|
const t = useComponentTranslator();
|
|
299
300
|
const locale = useLocale();
|
|
301
|
+
const calendar = useCalendarSystem(undefined, 'Timestamp');
|
|
300
302
|
const timeRef = useRef<HTMLTimeElement>(null);
|
|
301
303
|
const mergedTimeRef = useMergedRefs(ref, timeRef);
|
|
302
304
|
// Only relative and auto formats depend on the current time. Absolute
|
|
@@ -358,12 +360,12 @@ export function Timestamp({
|
|
|
358
360
|
date,
|
|
359
361
|
effectiveFormat,
|
|
360
362
|
locale,
|
|
361
|
-
// The
|
|
362
|
-
//
|
|
363
|
-
//
|
|
363
|
+
// The placeholder before hydration is Gregorian and in UTC, with
|
|
364
|
+
// its zone. The server and the client then write the same text,
|
|
365
|
+
// with or without Temporal.
|
|
364
366
|
isClockPending
|
|
365
367
|
? {timeZone: 'UTC', isTimezoneShown: true}
|
|
366
|
-
: {isTimezoneShown},
|
|
368
|
+
: {isTimezoneShown, calendar},
|
|
367
369
|
)
|
|
368
370
|
: '';
|
|
369
371
|
|
|
@@ -372,10 +374,13 @@ export function Timestamp({
|
|
|
372
374
|
// out in full: abbreviations like "PST" or "GMT+2" are unexpanded
|
|
373
375
|
// abbreviations to a screen-reader user (WCAG 3.1.4).
|
|
374
376
|
const fullAbsoluteText = isValidDate
|
|
375
|
-
? formatInstant(date, 'full', locale)
|
|
377
|
+
? formatInstant(date, 'full', locale, {calendar})
|
|
376
378
|
: '';
|
|
377
379
|
const ariaLabelText = isValidDate
|
|
378
|
-
? formatInstant(date, 'full', locale, {
|
|
380
|
+
? formatInstant(date, 'full', locale, {
|
|
381
|
+
timeZoneNameStyle: 'long',
|
|
382
|
+
calendar,
|
|
383
|
+
})
|
|
379
384
|
: '';
|
|
380
385
|
|
|
381
386
|
// Syncs the relative time with an interval timer while the timestamp is live.
|
|
@@ -424,7 +429,7 @@ export function Timestamp({
|
|
|
424
429
|
const lines: ReadonlyArray<TimestampTooltipLine> =
|
|
425
430
|
entries === undefined
|
|
426
431
|
? [{value: fullAbsoluteText, isCopyable: true}]
|
|
427
|
-
: formatTooltipLines(date, entries, locale);
|
|
432
|
+
: formatTooltipLines(date, entries, locale, calendar);
|
|
428
433
|
|
|
429
434
|
const timestampProps = mergeProps(
|
|
430
435
|
themeProps('timestamp', {format: effectiveFormat}),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file formatInstant.ts
|
|
5
|
-
* @input A Date, one absolute format name,
|
|
5
|
+
* @input A Date, one absolute format name, an optional time zone and calendar
|
|
6
6
|
* @output That instant rendered as a string
|
|
7
7
|
* @position Leaf shared by Timestamp's visible text and each of its tooltip
|
|
8
8
|
* lines; owns every absolute format Timestamp can produce
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
import {SHARED_DATE_FORMAT_OPTIONS, getWallClock} from '../utils/plainDate';
|
|
33
|
+
import {
|
|
34
|
+
formatCalendarInstant,
|
|
35
|
+
type CalendarSystem,
|
|
36
|
+
} from '../utils/calendarSystem';
|
|
33
37
|
import type {Locale} from '../i18n/types';
|
|
34
38
|
import type {TimestampFormat} from './Timestamp';
|
|
35
39
|
|
|
@@ -80,6 +84,14 @@ export interface FormatInstantOptions {
|
|
|
80
84
|
* @default 'short'
|
|
81
85
|
*/
|
|
82
86
|
timeZoneNameStyle?: 'short' | 'long';
|
|
87
|
+
/**
|
|
88
|
+
* The calendar that date-bearing formats write the date in. Timestamp
|
|
89
|
+
* passes its resolved calendar. `time` has no date, and the `system_*`
|
|
90
|
+
* shapes and `unix_seconds` stay Gregorian ISO or calendar-neutral in every
|
|
91
|
+
* calendar.
|
|
92
|
+
* @default 'gregory'
|
|
93
|
+
*/
|
|
94
|
+
calendar?: CalendarSystem;
|
|
83
95
|
}
|
|
84
96
|
|
|
85
97
|
// =============================================================================
|
|
@@ -139,6 +151,7 @@ export function formatInstant(
|
|
|
139
151
|
timeZone,
|
|
140
152
|
isTimezoneShown = false,
|
|
141
153
|
timeZoneNameStyle = 'short',
|
|
154
|
+
calendar = 'gregory',
|
|
142
155
|
}: FormatInstantOptions = {},
|
|
143
156
|
): string {
|
|
144
157
|
const zone = timeZone === undefined ? {} : {timeZone};
|
|
@@ -146,41 +159,49 @@ export function formatInstant(
|
|
|
146
159
|
|
|
147
160
|
switch (format) {
|
|
148
161
|
case 'full':
|
|
149
|
-
return
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
...
|
|
153
|
-
|
|
154
|
-
|
|
162
|
+
return formatCalendarInstant(
|
|
163
|
+
calendar,
|
|
164
|
+
date,
|
|
165
|
+
{...FULL_OPTIONS, timeZoneName: timeZoneNameStyle},
|
|
166
|
+
locale,
|
|
167
|
+
timeZone,
|
|
168
|
+
);
|
|
155
169
|
|
|
156
170
|
case 'date':
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
171
|
+
return formatCalendarInstant(
|
|
172
|
+
calendar,
|
|
173
|
+
date,
|
|
174
|
+
SHARED_DATE_FORMAT_OPTIONS.date,
|
|
175
|
+
locale,
|
|
176
|
+
timeZone,
|
|
177
|
+
);
|
|
162
178
|
|
|
163
179
|
case 'date_long':
|
|
164
|
-
return
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
180
|
+
return formatCalendarInstant(
|
|
181
|
+
calendar,
|
|
182
|
+
date,
|
|
183
|
+
SHARED_DATE_FORMAT_OPTIONS.date_long,
|
|
184
|
+
locale,
|
|
185
|
+
timeZone,
|
|
186
|
+
);
|
|
169
187
|
|
|
170
188
|
case 'date_weekday':
|
|
171
|
-
return
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
189
|
+
return formatCalendarInstant(
|
|
190
|
+
calendar,
|
|
191
|
+
date,
|
|
192
|
+
SHARED_DATE_FORMAT_OPTIONS.date_weekday,
|
|
193
|
+
locale,
|
|
194
|
+
timeZone,
|
|
195
|
+
);
|
|
176
196
|
|
|
177
197
|
case 'date_time':
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
...
|
|
182
|
-
|
|
183
|
-
|
|
198
|
+
return formatCalendarInstant(
|
|
199
|
+
calendar,
|
|
200
|
+
date,
|
|
201
|
+
{...DATE_TIME_OPTIONS, ...zoneName},
|
|
202
|
+
locale,
|
|
203
|
+
timeZone,
|
|
204
|
+
);
|
|
184
205
|
|
|
185
206
|
case 'time':
|
|
186
207
|
return new Intl.DateTimeFormat(locale, {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file tooltipEntries.ts
|
|
5
|
-
* @input A Date
|
|
5
|
+
* @input A Date, the consumer's tooltip entry list, a locale and a calendar
|
|
6
6
|
* @output Pure formatting of one tooltip line per entry, plus the entry types
|
|
7
7
|
* @position Leaf module; owns which zone each tooltip line names and whether
|
|
8
8
|
* it needs a zone abbreviation, then defers to formatInstant to render it
|
|
@@ -25,6 +25,7 @@ import {devWarn} from '../utils/devWarning';
|
|
|
25
25
|
import {formatInstant} from './formatInstant';
|
|
26
26
|
import type {InstantFormat} from './formatInstant';
|
|
27
27
|
import type {Locale} from '../i18n/types';
|
|
28
|
+
import type {CalendarSystem} from '../utils/calendarSystem';
|
|
28
29
|
|
|
29
30
|
// =============================================================================
|
|
30
31
|
// Types
|
|
@@ -197,15 +198,17 @@ function shouldShowZoneName(
|
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
/**
|
|
200
|
-
* Renders one tooltip line per entry, in the order given
|
|
201
|
+
* Renders one tooltip line per entry, in the order given, with dates in
|
|
202
|
+
* `calendar`.
|
|
201
203
|
*
|
|
202
204
|
* Pure: the same `date` and `entries` always produce the same lines for a given
|
|
203
|
-
* host zone and
|
|
205
|
+
* host zone, locale, and calendar.
|
|
204
206
|
*/
|
|
205
207
|
export function formatTooltipLines(
|
|
206
208
|
date: Date,
|
|
207
209
|
entries: ReadonlyArray<TimestampTooltipEntry>,
|
|
208
210
|
locale: Locale,
|
|
211
|
+
calendar: CalendarSystem = 'gregory',
|
|
209
212
|
): ReadonlyArray<TimestampTooltipLine> {
|
|
210
213
|
const resolved = entries.map(entry => resolveTimezoneID(entry.timezoneID));
|
|
211
214
|
const hasMultipleZones = new Set(resolved.map(zoneKey)).size > 1;
|
|
@@ -219,6 +222,7 @@ export function formatTooltipLines(
|
|
|
219
222
|
isCopyable: entry.isCopyable ?? false,
|
|
220
223
|
value: formatInstant(date, format, locale, {
|
|
221
224
|
timeZone,
|
|
225
|
+
calendar,
|
|
222
226
|
isTimezoneShown: shouldShowZoneName(
|
|
223
227
|
format,
|
|
224
228
|
hasMultipleZones,
|
package/src/Token/Token.tsx
CHANGED
|
@@ -39,6 +39,7 @@ import {themeProps} from '../utils/themeProps';
|
|
|
39
39
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
40
40
|
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
41
41
|
import {usePressFeedback} from '../hooks/usePressFeedback';
|
|
42
|
+
import {cancelNestedTouchPress} from '../hooks/useClickableContainer';
|
|
42
43
|
import type {TokenColorMap} from './index';
|
|
43
44
|
import {disabledInteractionProps} from '../utils/disabledInteraction';
|
|
44
45
|
import {TokenNamingContext} from './TokenNamingContext';
|
|
@@ -510,6 +511,19 @@ export function Token({
|
|
|
510
511
|
}
|
|
511
512
|
effectiveOnClick(e);
|
|
512
513
|
};
|
|
514
|
+
// A finger press on Remove or a control in end content does not run the
|
|
515
|
+
// token's action, so the token shows no press for it. The inner button,
|
|
516
|
+
// the first button child, is the token's own action.
|
|
517
|
+
const handleContainerPointerDown = (
|
|
518
|
+
e: React.PointerEvent<HTMLSpanElement>,
|
|
519
|
+
) => {
|
|
520
|
+
rest.onPointerDown?.(e);
|
|
521
|
+
cancelNestedTouchPress(
|
|
522
|
+
e,
|
|
523
|
+
e.currentTarget,
|
|
524
|
+
e.currentTarget.querySelector(':scope > button'),
|
|
525
|
+
);
|
|
526
|
+
};
|
|
513
527
|
|
|
514
528
|
return (
|
|
515
529
|
<span
|
|
@@ -535,7 +549,10 @@ export function Token({
|
|
|
535
549
|
style,
|
|
536
550
|
)}
|
|
537
551
|
{...rest}
|
|
538
|
-
{...sharedProps}
|
|
552
|
+
{...sharedProps}
|
|
553
|
+
onPointerDown={
|
|
554
|
+
isDisabled ? rest.onPointerDown : handleContainerPointerDown
|
|
555
|
+
}>
|
|
539
556
|
{icon}
|
|
540
557
|
<button
|
|
541
558
|
type="button"
|
package/src/Token/TokenLink.tsx
CHANGED
|
@@ -90,12 +90,13 @@ export function TokenLink({
|
|
|
90
90
|
removeButton,
|
|
91
91
|
onClick: onClickProp,
|
|
92
92
|
onMouseUp: onMouseUpProp,
|
|
93
|
+
onPointerDown: onPointerDownProp,
|
|
93
94
|
...containerProps
|
|
94
95
|
}: TokenLinkProps) {
|
|
95
96
|
const containerRef = useRef<HTMLElement | null>(null);
|
|
96
97
|
const linkRef = useRef<HTMLElement | null>(null);
|
|
97
98
|
|
|
98
|
-
const {onClick, onMouseUp} = useClickableContainer({
|
|
99
|
+
const {onClick, onMouseUp, onPointerDown} = useClickableContainer({
|
|
99
100
|
containerRef,
|
|
100
101
|
interactiveRef: linkRef,
|
|
101
102
|
href,
|
|
@@ -113,6 +114,11 @@ export function TokenLink({
|
|
|
113
114
|
isDisabled
|
|
114
115
|
? onMouseUpProp
|
|
115
116
|
: composeEventHandlers(onMouseUpProp, onMouseUp)
|
|
117
|
+
}
|
|
118
|
+
onPointerDown={
|
|
119
|
+
isDisabled
|
|
120
|
+
? onPointerDownProp
|
|
121
|
+
: composeEventHandlers(onPointerDownProp, onPointerDown)
|
|
116
122
|
}>
|
|
117
123
|
{icon}
|
|
118
124
|
{isDisabled ? (
|
|
@@ -296,7 +296,7 @@ export const docs = {
|
|
|
296
296
|
name: 'presentation',
|
|
297
297
|
type: "'popover' | 'bottom-sheet' | 'adaptive'",
|
|
298
298
|
description:
|
|
299
|
-
'How the field presents its choices. adaptive (the default) uses the bottom sheet on compact touch screens and the popover otherwise, resolved the same way Selector resolves it; the server render and the hydrating render are the popover. popover is the inline combobox with its anchored suggestion menu on every device. bottom-sheet replaces it on every device with a
|
|
299
|
+
'How the field presents its choices. adaptive (the default) uses the bottom sheet on compact touch screens and the popover otherwise, resolved the same way Selector resolves it; the server render and the hydrating render are the popover. popover is the inline combobox with its anchored suggestion menu on every device. bottom-sheet replaces it on every device with a field showing the selected tokens, whose trigger opens one tall modal sheet: a search row on top, full-width checkbox rows that keep their place while the sheet is open, a Create row with hasCreate, and a footer pinned in every state with a confirmed Clear all and Save; the sheet edits a draft, so onChange fires once, when Save commits it, and a swipe, scrim or Escape close of a changed draft asks before discarding. In the sheet presentation the field box holds the trigger, the tokens and endContent, and keeps the box, theming target and focus ring of the inline field; the trigger is the control: ref, id, aria-* and data-* reach it, and ref receives the trigger button there, so type it Ref<HTMLInputElement | HTMLButtonElement>, which the component accepts (TokenizerProps keeps its released input ref type). endContent sits at the inline end of the field and renderToken renders its tokens, as in the inline field; their own controls act without opening the sheet. renderItem, hasClear (the sheet has its own Clear all), hasEntriesOnFocus, menuWidth, tokenOverflowBehavior (the field wraps its tokens) and hasAutoFocus have no surface in the sheet, and the field warns once in development when they are passed. Pass presentation="popover" to keep the inline field and those props on every device.',
|
|
300
300
|
default: "'adaptive'",
|
|
301
301
|
},
|
|
302
302
|
],
|
|
@@ -642,7 +642,7 @@ export const docsZh = {
|
|
|
642
642
|
name: 'presentation',
|
|
643
643
|
type: "'popover' | 'bottom-sheet' | 'adaptive'",
|
|
644
644
|
description:
|
|
645
|
-
'字段如何呈现选项。adaptive(默认)在紧凑触摸屏上使用底部面板,其他情况使用 popover,解析方式与 Selector 相同;服务端渲染和水合期间的渲染均为 popover。popover 在所有设备上为内联组合框及其锚定建议菜单。bottom-sheet
|
|
645
|
+
'字段如何呈现选项。adaptive(默认)在紧凑触摸屏上使用底部面板,其他情况使用 popover,解析方式与 Selector 相同;服务端渲染和水合期间的渲染均为 popover。popover 在所有设备上为内联组合框及其锚定建议菜单。bottom-sheet 在所有设备上改为一个显示已选标记的字段,点按其中的触发按钮后打开一个高的模态底部面板——顶部为搜索行,下方为整行复选框行(面板打开期间位置保持不变),hasCreate 时有「创建」行,底部固定显示需确认的「全部清除」和「保存」;面板编辑的是草稿,onChange 仅在「保存」提交时触发一次,草稿有改动时滑动、点击遮罩或按 Escape 关闭会先询问是否放弃。在底部面板呈现中,字段框包含触发按钮、标记和 endContent,并保留内联字段的外框、主题目标和焦点环;触发按钮即为控件:ref、id、aria-* 和 data-* 都作用于它,ref 在该呈现中收到的是触发按钮,因此请将其类型声明为组件所接受的 Ref<HTMLInputElement | HTMLButtonElement>(TokenizerProps 保留已发布的输入框 ref 类型)。endContent 位于字段的行内末端,renderToken 渲染字段中的标记,与内联字段相同;其中的控件可直接操作,不会打开底部面板。renderItem、hasClear(底部面板自带“全部清除”)、hasEntriesOnFocus、menuWidth、tokenOverflowBehavior(字段会换行显示标记)和 hasAutoFocus 在底部面板中没有作用对象,传入时开发模式下会警告一次。传入 presentation="popover" 可在所有设备上保留内联字段和这些属性。',
|
|
646
646
|
default: "'adaptive'",
|
|
647
647
|
},
|
|
648
648
|
],
|
|
@@ -845,6 +845,6 @@ export const docsDense = {
|
|
|
845
845
|
endContent: 'Content at input row end. For buttons, counts, controls.',
|
|
846
846
|
handleRef: 'Imperative handle for focus() and blur() control.',
|
|
847
847
|
presentation:
|
|
848
|
-
"'adaptive' (default: sheet on compact touch, else popover; SSR/hydration render popover) | 'popover' (inline combobox, every device) | 'bottom-sheet' (trigger + one searchable modal sheet of checkbox rows editing a draft that Save commits; onChange fires once, on Save). Sheet: ref reaches the trigger button; renderItem/
|
|
848
|
+
"'adaptive' (default: sheet on compact touch, else popover; SSR/hydration render popover) | 'popover' (inline combobox, every device) | 'bottom-sheet' (field box with trigger + one searchable modal sheet of checkbox rows editing a draft that Save commits; onChange fires once, on Save). Sheet: field box keeps the inline box, theming target and focus ring; ref reaches the trigger button; endContent (field end) and renderToken (field tokens) work as inline; renderItem/hasClear/hasEntriesOnFocus/menuWidth/tokenOverflowBehavior/hasAutoFocus inert (dev warning). presentation=\"popover\" keeps them on every device.",
|
|
849
849
|
},
|
|
850
850
|
};
|