@astryxdesign/core 0.7.8 → 0.7.9-canary.0200dfe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell/observeMainOverflow.d.ts.map +1 -1
- package/dist/AppShell/observeMainOverflow.js +9 -6
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +37 -3
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +40 -8
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +4 -3
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +61 -21
- package/dist/Calendar/Calendar.d.ts +14 -2
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +63 -74
- package/dist/Calendar/getInitialFocusDate.d.ts +4 -1
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
- package/dist/Calendar/getInitialFocusDate.js +7 -5
- package/dist/Calendar/hooks/useCalendarDays.d.ts +19 -2
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +57 -64
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts +28 -3
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +33 -22
- package/dist/Calendar/styles.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +74 -18
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts +2 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.js +20 -0
- package/dist/CheckboxList/CheckboxListItem.d.ts +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +40 -14
- package/dist/ClickableCard/ClickableCard.d.ts +1 -1
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +5 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +2 -0
- package/dist/DateInput/DateInput.d.ts +37 -6
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +97 -124
- package/dist/DateInput/MonthScroller.d.ts +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +26 -29
- package/dist/DateInput/MonthYearWheels.d.ts +10 -1
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -1
- package/dist/DateInput/MonthYearWheels.js +54 -42
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +7 -1
- package/dist/DateInput/TouchDateField.d.ts +1 -1
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +26 -21
- package/dist/DateInput/monthGeometry.d.ts +42 -8
- package/dist/DateInput/monthGeometry.d.ts.map +1 -1
- package/dist/DateInput/monthGeometry.js +81 -7
- package/dist/DateInput/useCalendarPresentation.d.ts +10 -0
- package/dist/DateInput/useCalendarPresentation.d.ts.map +1 -0
- package/dist/DateInput/useCalendarPresentation.js +32 -0
- package/dist/DateInput/useTypedDate.d.ts +92 -0
- package/dist/DateInput/useTypedDate.d.ts.map +1 -0
- package/dist/DateInput/useTypedDate.js +269 -0
- package/dist/DateInput/wheelStrip.js +2 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts +17 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +15 -8
- package/dist/DateTimeInput/DateTimeInput.d.ts +26 -3
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +92 -88
- package/dist/DateTimeInput/TouchDateTimeField.d.ts +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +26 -20
- package/dist/Dialog/Dialog.d.ts +2 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +14 -3
- package/dist/Drawer/useDrawerDialogPresence.d.ts +2 -1
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +11 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts +9 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +11 -8
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -2
- package/dist/Field/inputDisabledFocus.d.ts +4 -4
- package/dist/Field/inputStyles.stylex.d.ts +1 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +16 -2
- package/dist/HoverCard/useHoverCard.d.ts +3 -1
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/InfoTip/InfoTip.d.ts +1 -0
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +6 -18
- package/dist/InputGroup/InputGroup.d.ts +4 -3
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +2 -2
- package/dist/InputGroup/InputGroupText.d.ts +2 -1
- package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupText.js +2 -1
- package/dist/InputGroup/groupStyles.d.ts +1 -1
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +1 -1
- package/dist/Item/Item.d.ts +20 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +97 -29
- package/dist/Item/ItemListRowContext.d.ts +2 -0
- package/dist/Item/ItemListRowContext.d.ts.map +1 -0
- package/dist/Item/ItemListRowContext.js +16 -0
- package/dist/Layer/holdEntranceInput.d.ts +24 -0
- package/dist/Layer/holdEntranceInput.d.ts.map +1 -0
- package/dist/Layer/holdEntranceInput.js +65 -0
- package/dist/Layer/inputHold.d.ts +49 -0
- package/dist/Layer/inputHold.d.ts.map +1 -0
- package/dist/Layer/inputHold.js +636 -0
- package/dist/Layer/outsidePress.d.ts +4 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +18 -1
- package/dist/Layer/preserveAnimations.d.ts +1 -5
- package/dist/Layer/preserveAnimations.d.ts.map +1 -1
- package/dist/Layer/preserveAnimations.js +12 -214
- package/dist/Layer/useBackdropPress.d.ts +8 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -1
- package/dist/Layer/useBackdropPress.js +31 -2
- package/dist/Layer/useLayer.d.ts +3 -1
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +64 -4
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +4 -0
- package/dist/Layout/LayoutContent.d.ts +3 -1
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +12 -4
- package/dist/Layout/LayoutPanel.d.ts +13 -10
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +81 -11
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -0
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +1 -0
- package/dist/List/ListItem.d.ts +5 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +45 -9
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +56 -39
- package/dist/MetadataList/MetadataList.js +1 -1
- package/dist/MobileNav/MobileNav.d.ts +11 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +39 -1
- package/dist/MoreMenu/MoreMenu.d.ts +5 -3
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +6 -9
- package/dist/NumberInput/NumberInput.d.ts +4 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +244 -11
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +7 -2
- package/dist/Popover/usePopover.d.ts +1 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +12 -5
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +9 -3
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +14 -11
- package/dist/PowerSearch/formatTokenValue.d.ts +6 -2
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatTokenValue.js +6 -3
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +16 -3
- package/dist/Resizable/ResizeHandle.d.ts +5 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +44 -5
- package/dist/Resizable/resizablePane.d.ts +58 -0
- package/dist/Resizable/resizablePane.d.ts.map +1 -0
- package/dist/Resizable/resizablePane.js +137 -0
- package/dist/Resizable/useResizable.d.ts +7 -0
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +13 -0
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SelectableCard/SelectableCard.d.ts +1 -1
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +5 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +51 -10
- package/dist/SideNav/SideNav.d.ts +9 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +45 -10
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +14 -71
- package/dist/Spinner/index.d.ts +1 -1
- package/dist/Spinner/index.d.ts.map +1 -1
- package/dist/Spinner/spinnerRotor.d.ts +28 -0
- package/dist/Spinner/spinnerRotor.d.ts.map +1 -0
- package/dist/Spinner/spinnerRotor.js +98 -0
- package/dist/Stack/StackItem.d.ts +8 -4
- package/dist/Stack/StackItem.d.ts.map +1 -1
- package/dist/Stack/StackItem.js +17 -4
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -10
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +14 -8
- package/dist/Timestamp/formatInstant.d.ts +10 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +13 -27
- package/dist/Timestamp/tooltipEntries.d.ts +5 -3
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +6 -4
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +9 -0
- package/dist/Token/TokenLink.d.ts +1 -1
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +4 -1
- package/dist/Tokenizer/Tokenizer.d.ts +14 -10
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +189 -89
- package/dist/Tooltip/useTooltip.d.ts +3 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +164 -59
- package/dist/TreeList/TreeListItem.d.ts +2 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +27 -3
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/dist/animator/createAnimator.js +2 -2
- package/dist/astryx.css +362 -325
- package/dist/gestures/GestureHost.d.ts +2 -2
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +21 -6
- package/dist/gestures/PanGestureRecognizer.d.ts +11 -1
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +15 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +6 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.d.ts +3 -6
- package/dist/gestures/nativeScroll.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.js +7 -52
- package/dist/gestures/wheelSegmenter.d.ts +68 -1
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
- package/dist/gestures/wheelSegmenter.js +199 -10
- package/dist/hooks/StackItemScrollRegion.d.ts +31 -0
- package/dist/hooks/StackItemScrollRegion.d.ts.map +1 -0
- package/dist/hooks/StackItemScrollRegion.js +40 -0
- package/dist/hooks/computeOverflow.d.ts +2 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +1 -1
- package/dist/hooks/menuPressGesture.d.ts +133 -21
- package/dist/hooks/menuPressGesture.d.ts.map +1 -1
- package/dist/hooks/menuPressGesture.js +155 -30
- package/dist/hooks/menuPressValues.d.ts +16 -0
- package/dist/hooks/menuPressValues.d.ts.map +1 -0
- package/dist/hooks/menuPressValues.js +18 -0
- package/dist/hooks/useClickableContainer.d.ts +36 -7
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +63 -14
- package/dist/hooks/useFocusTrap.d.ts +10 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +225 -132
- package/dist/hooks/useKeyboardHighlight.d.ts +17 -0
- package/dist/hooks/useKeyboardHighlight.d.ts.map +1 -0
- package/dist/hooks/useKeyboardHighlight.js +38 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +37 -12
- package/dist/hooks/useMenuPress.d.ts +34 -1
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +93 -5
- package/dist/hooks/useOverflow.d.ts +10 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +214 -23
- package/dist/hooks/usePressFeedback.d.ts +6 -6
- package/dist/hooks/usePressFeedback.js +6 -6
- package/dist/hooks/useScrollRegionProps.d.ts +35 -0
- package/dist/hooks/useScrollRegionProps.d.ts.map +1 -0
- package/dist/hooks/useScrollRegionProps.js +51 -0
- package/dist/i18n/InternationalizationContext.d.ts +6 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.d.ts +23 -3
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +8 -3
- package/dist/i18n/generated-english/DateInput/DateInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateInput/DateInput.generated.js +0 -1
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.js +16 -0
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.js +0 -1
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts +8 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/hooks/useScrollRegionProps.generated.js +12 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +5 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +5 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/useCalendarSystem.d.ts +19 -0
- package/dist/i18n/useCalendarSystem.d.ts.map +1 -0
- package/dist/i18n/useCalendarSystem.js +61 -0
- package/dist/internal/calendar-system.d.ts +18 -0
- package/dist/internal/calendar-system.d.ts.map +1 -0
- package/dist/internal/calendar-system.js +19 -0
- package/dist/internal/spinner-rotor.d.ts +16 -0
- package/dist/internal/spinner-rotor.d.ts.map +1 -0
- package/dist/internal/spinner-rotor.js +16 -0
- package/dist/internal/touch.d.ts +20 -2
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +29 -3
- package/dist/motion/animator.d.ts +5 -5
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +7 -6
- package/dist/motion/carryAnimations.d.ts +58 -0
- package/dist/motion/carryAnimations.d.ts.map +1 -0
- package/dist/motion/carryAnimations.js +305 -0
- package/dist/motion/transientCopy.d.ts +4 -2
- package/dist/motion/transientCopy.d.ts.map +1 -1
- package/dist/motion/transientCopy.js +34 -5
- package/dist/motion/uikit/gestures.d.ts +41 -0
- package/dist/motion/uikit/gestures.d.ts.map +1 -1
- package/dist/motion/uikit/gestures.js +25 -0
- package/dist/motion/uikit/index.d.ts +1 -1
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +1 -1
- package/dist/motion/uikit/timing.d.ts +14 -10
- package/dist/motion/uikit/timing.d.ts.map +1 -1
- package/dist/motion/uikit/timing.js +7 -5
- package/dist/privateAttributes/menuPressLit.stylex.d.ts +52 -0
- package/dist/privateAttributes/menuPressLit.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/menuPressLit.stylex.js +99 -0
- package/dist/privateAttributes/press.stylex.d.ts +142 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/press.stylex.js +101 -0
- package/dist/theme/themeMotion.d.ts +3 -2
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +3 -2
- package/dist/theme/tokens.stylex.d.ts +2 -2
- package/dist/theme/tokens.stylex.js +1 -1
- package/dist/utils/calendarDateParser.d.ts +110 -0
- package/dist/utils/calendarDateParser.d.ts.map +1 -0
- package/dist/utils/calendarDateParser.js +1225 -0
- package/dist/utils/calendarSystem.d.ts +176 -0
- package/dist/utils/calendarSystem.d.ts.map +1 -0
- package/dist/utils/calendarSystem.js +569 -0
- package/dist/utils/coarsePointer.d.ts +5 -0
- package/dist/utils/coarsePointer.d.ts.map +1 -1
- package/dist/utils/coarsePointer.js +22 -13
- package/dist/utils/flatTree.d.ts +6 -3
- package/dist/utils/flatTree.d.ts.map +1 -1
- package/dist/utils/flatTree.js +13 -3
- package/dist/utils/focusReturn.d.ts +34 -13
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +64 -17
- package/dist/utils/hitArea.d.ts +8 -1
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +99 -9
- package/dist/utils/inputPresentation.d.ts +9 -1
- package/dist/utils/inputPresentation.d.ts.map +1 -1
- package/dist/utils/inputPresentation.js +15 -1
- package/dist/utils/inputStream.d.ts +14 -1
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +40 -9
- package/dist/utils/interactionOverlay.stylex.d.ts +5 -9
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +29 -31
- package/dist/utils/plainDate.d.ts +38 -7
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +92 -18
- package/dist/utils/pressFeedback.d.ts +10 -2
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +40 -15
- package/dist/utils/pressGesture.d.ts +12 -6
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +26 -8
- package/dist/utils/scrollView.d.ts +25 -0
- package/dist/utils/scrollView.d.ts.map +1 -0
- package/dist/utils/scrollView.js +108 -0
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +1 -10
- package/dist/utils/touchHitArea.d.ts +30 -0
- package/dist/utils/touchHitArea.d.ts.map +1 -0
- package/dist/utils/touchHitArea.js +167 -0
- package/dist/utils/touchHitArea.stylex.d.ts +38 -0
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -0
- package/dist/utils/touchHitArea.stylex.js +48 -0
- package/dist/utils/triggerFocus.d.ts +5 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -1
- package/dist/utils/triggerFocus.js +9 -2
- package/locales/en.json +21 -1
- package/locales/pseudo.json +15 -0
- package/package.json +15 -4
- package/src/AppShell/observeMainOverflow.ts +9 -6
- package/src/BottomSheet/BottomSheet.tsx +45 -3
- package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
- package/src/BottomSheet/bottomSheetStack.ts +4 -3
- package/src/BottomSheet/useSheetGestures.ts +83 -20
- package/src/Calendar/Calendar.doc.mjs +76 -6
- package/src/Calendar/Calendar.tsx +123 -104
- package/src/Calendar/getInitialFocusDate.ts +22 -8
- package/src/Calendar/hooks/useCalendarDays.ts +89 -63
- package/src/Calendar/hooks/useCalendarNavigation.ts +68 -26
- package/src/CheckboxInput/CheckboxInput.doc.mjs +5 -4
- package/src/CheckboxInput/CheckboxInput.tsx +105 -20
- package/src/CheckboxInput/CheckboxRowPressContext.ts +22 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/CheckboxList/CheckboxListItem.tsx +35 -14
- package/src/ClickableCard/ClickableCard.tsx +8 -1
- package/src/ContextMenu/ContextMenu.tsx +2 -0
- package/src/DateInput/DateInput.doc.mjs +45 -12
- package/src/DateInput/DateInput.tsx +165 -179
- package/src/DateInput/MonthScroller.tsx +39 -37
- package/src/DateInput/MonthYearWheels.tsx +68 -47
- package/src/DateInput/PickerWheel.tsx +7 -2
- package/src/DateInput/TouchDateField.tsx +45 -17
- package/src/DateInput/monthGeometry.ts +110 -8
- package/src/DateInput/useCalendarPresentation.ts +64 -0
- package/src/DateInput/useTypedDate.ts +469 -0
- package/src/DateInput/wheelStrip.ts +2 -2
- package/src/DateRangeInput/DateRangeInput.doc.mjs +9 -0
- package/src/DateRangeInput/DateRangeInput.tsx +43 -9
- package/src/DateTimeInput/DateTimeInput.doc.mjs +42 -9
- package/src/DateTimeInput/DateTimeInput.tsx +138 -148
- package/src/DateTimeInput/TouchDateTimeField.tsx +31 -16
- package/src/Dialog/Dialog.doc.mjs +1 -1
- package/src/Dialog/Dialog.tsx +14 -2
- package/src/Drawer/Drawer.doc.mjs +1 -1
- package/src/Drawer/useDrawerDialogPresence.ts +9 -2
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -2
- package/src/DropdownMenu/DropdownMenu.tsx +31 -7
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuItem.tsx +8 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -1
- package/src/FileInput/FileInput.tsx +16 -2
- package/src/HoverCard/useHoverCard.tsx +3 -1
- package/src/Icon/useIcon.doc.mjs +94 -0
- package/src/InfoTip/InfoTip.doc.mjs +26 -2
- package/src/InfoTip/InfoTip.tsx +6 -27
- package/src/InputGroup/InputGroup.doc.mjs +4 -3
- package/src/InputGroup/InputGroup.tsx +4 -3
- package/src/InputGroup/InputGroupText.doc.mjs +45 -3
- package/src/InputGroup/InputGroupText.tsx +2 -1
- package/src/InputGroup/groupStyles.ts +3 -1
- package/src/Item/Item.tsx +139 -35
- package/src/Item/ItemListRowContext.tsx +18 -0
- package/src/Layer/holdEntranceInput.ts +84 -0
- package/src/Layer/inputHold.ts +734 -0
- package/src/Layer/outsidePress.ts +18 -1
- package/src/Layer/preserveAnimations.ts +12 -275
- package/src/Layer/useBackdropPress.ts +41 -1
- package/src/Layer/useLayer.tsx +77 -4
- package/src/Layer/useTouchTrigger.ts +4 -0
- package/src/Layout/LayoutContent.doc.mjs +6 -3
- package/src/Layout/LayoutContent.tsx +10 -4
- package/src/Layout/LayoutPanel.doc.mjs +14 -11
- package/src/Layout/LayoutPanel.tsx +113 -16
- package/src/Lightbox/Lightbox.tsx +4 -0
- package/src/List/List.doc.mjs +10 -1
- package/src/List/List.tsx +5 -0
- package/src/List/ListItem.tsx +63 -8
- package/src/Markdown/parser.ts +65 -42
- package/src/MetadataList/MetadataList.tsx +1 -1
- package/src/MobileNav/MobileNav.doc.mjs +3 -3
- package/src/MobileNav/MobileNav.tsx +39 -1
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -4
- package/src/MoreMenu/MoreMenu.tsx +5 -3
- package/src/MultiSelector/MultiSelector.tsx +7 -17
- package/src/NumberInput/NumberInput.doc.mjs +1 -1
- package/src/NumberInput/NumberInput.tsx +259 -11
- package/src/OverflowList/OverflowList.tsx +15 -9
- package/src/Popover/usePopover.tsx +1 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
- package/src/PowerSearch/PowerSearch.tsx +20 -3
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +4 -1
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -11
- package/src/PowerSearch/formatTokenValue.ts +7 -1
- package/src/RadioList/RadioListItem.doc.mjs +3 -2
- package/src/RadioList/RadioListItem.tsx +16 -6
- package/src/Resizable/Resizable.doc.mjs +40 -12
- package/src/Resizable/ResizeHandle.tsx +68 -6
- package/src/Resizable/resizablePane.ts +179 -0
- package/src/Resizable/useResizable.ts +15 -0
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +3 -3
- package/src/SelectableCard/SelectableCard.tsx +8 -1
- package/src/Selector/Selector.tsx +83 -8
- package/src/SideNav/SideNav.doc.mjs +2 -2
- package/src/SideNav/SideNav.tsx +87 -12
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +7 -89
- package/src/Spinner/index.ts +1 -5
- package/src/Spinner/spinnerRotor.ts +113 -0
- package/src/Stack/Stack.doc.mjs +1 -1
- package/src/Stack/StackItem.tsx +27 -13
- package/src/Switch/Switch.tsx +7 -6
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/TabList/Tab.tsx +5 -1
- package/src/Table/plugins/sortable/useTableSortable.tsx +1 -1
- package/src/Timestamp/Timestamp.doc.mjs +3 -3
- package/src/Timestamp/Timestamp.tsx +13 -8
- package/src/Timestamp/formatInstant.ts +49 -28
- package/src/Timestamp/tooltipEntries.ts +7 -3
- package/src/Token/Token.tsx +18 -1
- package/src/Token/TokenLink.tsx +7 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +3 -3
- package/src/Tokenizer/Tokenizer.tsx +252 -115
- package/src/Tooltip/useTooltip.tsx +180 -80
- package/src/TreeList/TreeListItem.tsx +36 -2
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
- package/src/animator/createAnimator.ts +3 -3
- package/src/gestures/GestureHost.ts +21 -5
- package/src/gestures/PanGestureRecognizer.ts +19 -2
- package/src/gestures/README.md +14 -5
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +6 -1
- package/src/gestures/nativeScroll.ts +12 -68
- package/src/gestures/wheelSegmenter.ts +243 -10
- package/src/hooks/StackItemScrollRegion.tsx +57 -0
- package/src/hooks/computeOverflow.ts +1 -1
- package/src/hooks/menuPressGesture.ts +244 -38
- package/src/hooks/menuPressValues.ts +18 -0
- package/src/hooks/useClickableContainer.doc.mjs +8 -2
- package/src/hooks/useClickableContainer.ts +93 -15
- package/src/hooks/useFocusTrap.ts +268 -151
- package/src/hooks/useKeyboardHighlight.ts +71 -0
- package/src/hooks/useMediaQuery.ts +41 -12
- package/src/hooks/useMenuPress.ts +118 -11
- package/src/hooks/useOverflow.ts +321 -75
- package/src/hooks/usePressFeedback.doc.mjs +3 -3
- package/src/hooks/usePressFeedback.ts +6 -6
- package/src/hooks/useScrollRegionProps.ts +76 -0
- package/src/i18n/InternationalizationContext.ts +6 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +29 -1
- package/src/i18n/InternationalizationProvider.tsx +35 -3
- package/src/i18n/generated-english/DateInput/DateInput.generated.ts +0 -1
- package/src/i18n/generated-english/DateInput/useTypedDate.generated.ts +17 -0
- package/src/i18n/generated-english/DateTimeInput/DateTimeInput.generated.ts +0 -1
- package/src/i18n/generated-english/hooks/useScrollRegionProps.generated.ts +13 -0
- package/src/i18n/generated-locales/en.generated.ts +7 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +7 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/useCalendarSystem.ts +95 -0
- package/src/internal/calendar-system.ts +26 -0
- package/src/internal/spinner-rotor.ts +20 -0
- package/src/internal/touch.ts +43 -2
- package/src/motion/MEASUREMENTS.md +11 -0
- package/src/motion/README.md +3 -3
- package/src/motion/animator.ts +7 -7
- package/src/motion/carryAnimations.ts +389 -0
- package/src/motion/transientCopy.ts +45 -5
- package/src/motion/uikit/gestures.ts +22 -0
- package/src/motion/uikit/index.ts +1 -0
- package/src/motion/uikit/timing.ts +7 -5
- package/src/privateAttributes/menuPressLit.stylex.ts +104 -0
- package/src/privateAttributes/press.stylex.ts +261 -0
- package/src/theme/themeMotion.ts +3 -2
- package/src/theme/tokens.stylex.ts +1 -1
- package/src/utils/calendarDateParser.ts +1385 -0
- package/src/utils/calendarSystem.ts +832 -0
- package/src/utils/coarsePointer.ts +27 -14
- package/src/utils/flatTree.ts +15 -3
- package/src/utils/focusReturn.ts +78 -18
- package/src/utils/hitArea.ts +138 -9
- package/src/utils/inputPresentation.ts +21 -1
- package/src/utils/inputStream.ts +47 -10
- package/src/utils/interactionOverlay.stylex.ts +19 -22
- package/src/utils/plainDate.ts +130 -19
- package/src/utils/pressFeedback.ts +46 -14
- package/src/utils/pressGesture.ts +35 -9
- package/src/utils/scrollView.ts +135 -0
- package/src/utils/selectionLock.ts +5 -10
- package/src/utils/touchHitArea.stylex.ts +56 -0
- package/src/utils/touchHitArea.ts +177 -0
- package/src/utils/triggerFocus.ts +17 -4
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CheckboxInput.tsx
|
|
7
|
-
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip
|
|
7
|
+
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip,
|
|
8
|
+
* CheckboxRowPressContext (a row around the checkbox that owns its press)
|
|
8
9
|
* @output Exports CheckboxInput component, CheckboxInputProps
|
|
9
10
|
* @position Core implementation; consumed by index.ts, tested by CheckboxInput.test.tsx
|
|
10
11
|
*
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
import {
|
|
21
|
+
use,
|
|
20
22
|
useId,
|
|
21
23
|
useCallback,
|
|
22
24
|
useOptimistic,
|
|
@@ -24,6 +26,8 @@ import {
|
|
|
24
26
|
useTransition,
|
|
25
27
|
type ChangeEvent,
|
|
26
28
|
type FocusEvent,
|
|
29
|
+
type MouseEvent as ReactMouseEvent,
|
|
30
|
+
type PointerEvent as ReactPointerEvent,
|
|
27
31
|
type ReactNode,
|
|
28
32
|
} from 'react';
|
|
29
33
|
import * as stylex from '@stylexjs/stylex';
|
|
@@ -55,11 +59,14 @@ import {useIndicator} from '../Indicator/useIndicator';
|
|
|
55
59
|
import {themeProps} from '../utils/themeProps';
|
|
56
60
|
|
|
57
61
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
62
|
+
import {useTouchHitArea} from '../utils/touchHitArea';
|
|
63
|
+
import {touchHitAreaStyles} from '../utils/touchHitArea.stylex';
|
|
58
64
|
import {
|
|
59
65
|
registerEnglishFallback,
|
|
60
66
|
useComponentTranslator,
|
|
61
67
|
} from '../i18n/useComponentTranslator';
|
|
62
68
|
import english from '../i18n/generated-english/CheckboxInput/CheckboxInput.generated';
|
|
69
|
+
import {CheckboxRowPressContext} from './CheckboxRowPressContext';
|
|
63
70
|
|
|
64
71
|
registerEnglishFallback(english);
|
|
65
72
|
|
|
@@ -83,10 +90,14 @@ const styles = stylex.create({
|
|
|
83
90
|
containerLabelHidden: {
|
|
84
91
|
gap: 0,
|
|
85
92
|
},
|
|
93
|
+
// Under a coarse pointer the row contains its hit band.
|
|
94
|
+
hitAreaHost: {
|
|
95
|
+
position: {default: null, '@media (pointer: coarse)': 'relative'},
|
|
96
|
+
},
|
|
86
97
|
// An indicator in another package may not name this row's private press
|
|
87
98
|
// attribute. So the row hands its touch press image down to an indicator
|
|
88
99
|
// that paints its own press, but only in its own press states. A pressed
|
|
89
|
-
//
|
|
100
|
+
// outer row hands down nothing, as for the built-in box. The
|
|
90
101
|
// property has no default: a layered stylesheet ranks a default above the
|
|
91
102
|
// arms. Only this row declares it. A menu item paints its own press, so a
|
|
92
103
|
// mapped indicator there paints none.
|
|
@@ -97,6 +108,12 @@ const styles = stylex.create({
|
|
|
97
108
|
[PRESSED_FADING]: 'var(--_press-paint-image)',
|
|
98
109
|
},
|
|
99
110
|
},
|
|
111
|
+
// Under a row that owns the press (CheckboxRowPressContext), this row is
|
|
112
|
+
// never pressed. So it hands down that row's press paint, which the
|
|
113
|
+
// built-in box reads too.
|
|
114
|
+
indicatorRowPressImage: {
|
|
115
|
+
'--_indicator-press-image': 'var(--_checkbox-row-press-paint, none)',
|
|
116
|
+
},
|
|
100
117
|
checkboxWrapper: {
|
|
101
118
|
position: 'relative',
|
|
102
119
|
display: 'flex',
|
|
@@ -108,11 +125,12 @@ const styles = stylex.create({
|
|
|
108
125
|
// The owner paints this layer over the resolved indicator, so a plain theme
|
|
109
126
|
// replacement keeps the pressed feedback. An indicator with
|
|
110
127
|
// `indicatorPressScope` paints its own press from what the row hands down,
|
|
111
|
-
// so this layer stays off over it.
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
128
|
+
// so this layer stays off over it. A mouse keeps `:active` (see
|
|
129
|
+
// interactionOverlay.stylex.ts). Under a coarse pointer that arm is dropped.
|
|
130
|
+
// The touch press controller then writes the press attribute on the row.
|
|
131
|
+
// This layer reads it off the scope marker, as the hover tint does. Under a
|
|
132
|
+
// row that owns the press (CheckboxRowPressContext), the row's own checkbox
|
|
133
|
+
// paints that row's press paint instead (indicatorRowPressOverlay).
|
|
116
134
|
indicatorPressOverlay: {
|
|
117
135
|
'::after': {
|
|
118
136
|
// `when.descendant` takes a pseudo-class; `:is(*)` matches any marked
|
|
@@ -149,6 +167,15 @@ const styles = stylex.create({
|
|
|
149
167
|
},
|
|
150
168
|
},
|
|
151
169
|
},
|
|
170
|
+
// The row's own checkbox when its row owns the press
|
|
171
|
+
// (CheckboxRowPressContext). It paints only the paint that row declares
|
|
172
|
+
// (`--_checkbox-row-press-paint`). No outer row, card or fine pointer
|
|
173
|
+
// reaches it.
|
|
174
|
+
indicatorRowPressOverlay: {
|
|
175
|
+
'::after': {
|
|
176
|
+
backgroundImage: 'var(--_checkbox-row-press-paint, none)',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
152
179
|
// Holds only the indicator, so the focus ring has one unambiguous target.
|
|
153
180
|
// `display: contents` adds no box of its own — the indicator keeps whatever
|
|
154
181
|
// layout relationship it already had with the wrapper.
|
|
@@ -373,6 +400,13 @@ export function CheckboxInput({
|
|
|
373
400
|
// The row is the pressable: the overlay's pressed arm reads the row's
|
|
374
401
|
// scope marker, the way the indicator's hover tint does.
|
|
375
402
|
const pressable = usePressFeedback();
|
|
403
|
+
// A row around the checkbox that answers a press anywhere on it (a
|
|
404
|
+
// CheckboxListItem) owns the touch press instead. The checkbox then carries
|
|
405
|
+
// no press marker of its own. So the controller's innermost-wins rule finds
|
|
406
|
+
// the row for a finger on the label, the description or the box. The
|
|
407
|
+
// overlay below paints that row's press.
|
|
408
|
+
const isRowPressSurface = use(CheckboxRowPressContext);
|
|
409
|
+
const ownsPress = !isDisabled && !isRowPressSurface;
|
|
376
410
|
const generatedId = useId();
|
|
377
411
|
const id = idProp || generatedId;
|
|
378
412
|
const descriptionID = useId();
|
|
@@ -407,6 +441,55 @@ export function CheckboxInput({
|
|
|
407
441
|
useBusyAnnouncement(isBusy, t('@astryx.spinner.loading'), indicatorRef);
|
|
408
442
|
const {focusProps} = useIndicatorFocusRing(indicatorRef);
|
|
409
443
|
|
|
444
|
+
// Under a coarse pointer a labelled checkbox's row grows toward 44 px
|
|
445
|
+
// through an invisible band, and nothing changes size. A label-hidden
|
|
446
|
+
// checkbox is a marker in another component's row, which keeps its target.
|
|
447
|
+
const hasHitArea = !isLabelHidden && !isDisabled && !isReadOnly;
|
|
448
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
449
|
+
// The band's insets stay live while the row takes taps, and clear when it
|
|
450
|
+
// stops.
|
|
451
|
+
const watchRowHitArea = useTouchHitArea(hasHitArea);
|
|
452
|
+
// The disabled-message tooltip listens for hover and focus on the whole
|
|
453
|
+
// row, a larger trigger. It anchors on the checkbox itself (below), so it
|
|
454
|
+
// shows next to the control. Its handlers check isEnabled, so the row
|
|
455
|
+
// always attaches them.
|
|
456
|
+
const rowRef = useMergedRefs(
|
|
457
|
+
disabledMessageTooltip.interactionRef,
|
|
458
|
+
watchRowHitArea,
|
|
459
|
+
);
|
|
460
|
+
// Where a press on the row itself began. A browser can move a tap's click
|
|
461
|
+
// onto the row's edge, so the band is judged from the press.
|
|
462
|
+
const pressPointRef = useRef<{x: number; y: number} | null>(null);
|
|
463
|
+
const handleRowPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {
|
|
464
|
+
pressPointRef.current =
|
|
465
|
+
event.target === event.currentTarget
|
|
466
|
+
? {x: event.clientX, y: event.clientY}
|
|
467
|
+
: null;
|
|
468
|
+
};
|
|
469
|
+
// A press that began on the band, outside the row's box, toggles the
|
|
470
|
+
// checkbox, as a tap on the box does. A click from code has no press count
|
|
471
|
+
// (`detail` is 0), so it never toggles from here.
|
|
472
|
+
const handleRowClick = (event: ReactMouseEvent<HTMLDivElement>) => {
|
|
473
|
+
const press = pressPointRef.current;
|
|
474
|
+
pressPointRef.current = null;
|
|
475
|
+
if (
|
|
476
|
+
press == null ||
|
|
477
|
+
event.detail === 0 ||
|
|
478
|
+
event.target !== event.currentTarget
|
|
479
|
+
) {
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const box = event.currentTarget.getBoundingClientRect();
|
|
483
|
+
const isOnBand =
|
|
484
|
+
press.x < box.left ||
|
|
485
|
+
press.x > box.right ||
|
|
486
|
+
press.y < box.top ||
|
|
487
|
+
press.y > box.bottom;
|
|
488
|
+
if (isOnBand) {
|
|
489
|
+
inputRef.current?.click();
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
|
|
410
493
|
const isIndeterminate = optimisticValue === 'indeterminate';
|
|
411
494
|
const isChecked = optimisticValue === true;
|
|
412
495
|
|
|
@@ -455,33 +538,34 @@ export function CheckboxInput({
|
|
|
455
538
|
style,
|
|
456
539
|
)}>
|
|
457
540
|
<div
|
|
458
|
-
ref={
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
// appears next to the control, not the far edge of the row.
|
|
463
|
-
// Handlers are gated internally by isEnabled, so attaching
|
|
464
|
-
// unconditionally is safe.
|
|
465
|
-
disabledMessageTooltip.interactionRef(el);
|
|
466
|
-
}}
|
|
467
|
-
{...(isDisabled ? undefined : pressable)}
|
|
541
|
+
ref={rowRef}
|
|
542
|
+
onPointerDown={hasHitArea ? handleRowPointerDown : undefined}
|
|
543
|
+
onClick={hasHitArea ? handleRowClick : undefined}
|
|
544
|
+
{...(ownsPress ? pressable : undefined)}
|
|
468
545
|
{...stylex.props(
|
|
469
546
|
styles.container,
|
|
470
547
|
isLabelHidden && styles.containerLabelHidden,
|
|
548
|
+
hasHitArea && styles.hitAreaHost,
|
|
549
|
+
hasHitArea && touchHitAreaStyles.layer,
|
|
471
550
|
// Hover and focus reach the checkbox visual through this ancestor
|
|
472
551
|
// marker rather than props, so the whole row drives it.
|
|
473
552
|
!isDisabled && indicatorScope,
|
|
474
|
-
!isDisabled &&
|
|
553
|
+
!isDisabled &&
|
|
554
|
+
(isRowPressSurface
|
|
555
|
+
? styles.indicatorRowPressImage
|
|
556
|
+
: styles.indicatorPressImage),
|
|
475
557
|
// The touch press's strength and release live on the row the
|
|
476
558
|
// controller writes to; the layer over the checkbox box inherits
|
|
477
|
-
// and paints it.
|
|
478
|
-
|
|
559
|
+
// and paints it. Under a row that owns the press, the box inherits
|
|
560
|
+
// that row's strength instead.
|
|
561
|
+
ownsPress && interactionOverlayStyles.pressedAlpha,
|
|
479
562
|
)}>
|
|
480
563
|
<div
|
|
481
564
|
{...stylex.props(
|
|
482
565
|
styles.checkboxWrapper,
|
|
483
566
|
wrapperSizeStyles[size],
|
|
484
567
|
!isDisabled && styles.indicatorPressOverlay,
|
|
568
|
+
!isDisabled && isRowPressSurface && styles.indicatorRowPressOverlay,
|
|
485
569
|
)}
|
|
486
570
|
{...focusProps}>
|
|
487
571
|
<input
|
|
@@ -490,6 +574,7 @@ export function CheckboxInput({
|
|
|
490
574
|
ref,
|
|
491
575
|
indeterminateRef,
|
|
492
576
|
disabledMessageTooltip.positionRef,
|
|
577
|
+
inputRef,
|
|
493
578
|
)}
|
|
494
579
|
id={id}
|
|
495
580
|
type="checkbox"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file CheckboxRowPressContext.ts
|
|
7
|
+
* @input Uses the private layer-scoped context factory
|
|
8
|
+
* @output CheckboxRowPressContext: whether the row is its checkbox's press surface
|
|
9
|
+
* @position Internal; CheckboxListItem provides it, CheckboxInput reads it
|
|
10
|
+
*
|
|
11
|
+
* Such a row carries the shared press marker (utils/pressFeedback.ts). Its
|
|
12
|
+
* checkbox carries none, so a finger anywhere on the row presses the row.
|
|
13
|
+
* It is layer-scoped and wraps only the row's own checkbox.
|
|
14
|
+
*
|
|
15
|
+
* SYNC: When modified, update CheckboxInput.tsx and
|
|
16
|
+
* ../CheckboxList/CheckboxListItem.tsx.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
20
|
+
|
|
21
|
+
export const CheckboxRowPressContext = createLayerScopedContext(false);
|
|
22
|
+
CheckboxRowPressContext.displayName = 'CheckboxRowPressContext';
|
|
@@ -258,6 +258,15 @@ export const docs = {
|
|
|
258
258
|
},
|
|
259
259
|
theming: {
|
|
260
260
|
targets: [{className: 'astryx-checkbox-list'}],
|
|
261
|
+
vars: [
|
|
262
|
+
{
|
|
263
|
+
name: '--_checkbox-row-press-paint',
|
|
264
|
+
description:
|
|
265
|
+
"The touch press paint a row that owns its checkbox's press hands that checkbox's box: none at rest, and the press paint at the press's strength while the touch press controller presses that row under a coarse pointer. Set on the row by its own press arms; the box reads its nearest row's value, so a list placed in a row's content keeps its own rows' paint.",
|
|
266
|
+
default: 'none',
|
|
267
|
+
private: true,
|
|
268
|
+
},
|
|
269
|
+
],
|
|
261
270
|
},
|
|
262
271
|
};
|
|
263
272
|
|
|
@@ -8,7 +8,7 @@ export const docs = {
|
|
|
8
8
|
displayName: 'Checkbox List Item',
|
|
9
9
|
isHiddenFromOverview: true,
|
|
10
10
|
description:
|
|
11
|
-
'Individual checkbox item with label, description, and end content slot. Works in collection mode (inside a CheckboxList with a value array) or standalone mode (inside List, or inside a CheckboxList without value, such as a select-all item).',
|
|
11
|
+
'Individual checkbox item with label, description, and end content slot. Works in collection mode (inside a CheckboxList with a value array) or standalone mode (inside List, or inside a CheckboxList without value, such as a select-all item). On a touch screen (a coarse primary pointer), a toggleable row is one press target: a touch on the label, the description or the box itself shows the pressed state on the row and its checkbox together. Where the primary pointer is fine, the box keeps its own press.',
|
|
12
12
|
props: [
|
|
13
13
|
{
|
|
14
14
|
name: 'label',
|
|
@@ -105,7 +105,7 @@ export const docsZh = {
|
|
|
105
105
|
isHiddenFromOverview: true,
|
|
106
106
|
displayName: 'Checkbox List Item',
|
|
107
107
|
description:
|
|
108
|
-
'单个复选框选项,包含标签、描述和尾部内容插槽。可在集合模式(位于带 value 数组的 CheckboxList 内)或独立模式(位于 List 内,或位于不带 value 的 CheckboxList
|
|
108
|
+
'单个复选框选项,包含标签、描述和尾部内容插槽。可在集合模式(位于带 value 数组的 CheckboxList 内)或独立模式(位于 List 内,或位于不带 value 的 CheckboxList 内,例如“全选”选项)下使用。在触摸屏上,可切换的行是一个整体的按压目标:手指按在标签、描述或复选框本身上,行与其复选框会一起显示按下状态。主指针为精细指针时,复选框保留自己的按下效果。',
|
|
109
109
|
props: [
|
|
110
110
|
{
|
|
111
111
|
name: 'label',
|
|
@@ -177,7 +177,7 @@ export const docsDense = {
|
|
|
177
177
|
isHiddenFromOverview: true,
|
|
178
178
|
displayName: 'Checkbox List Item',
|
|
179
179
|
description:
|
|
180
|
-
'Individual checkbox item w/ label, description, end content slot. Collection mode inside CheckboxList with value; standalone inside List or CheckboxList without value.',
|
|
180
|
+
'Individual checkbox item w/ label, description, end content slot. Collection mode inside CheckboxList with value; standalone inside List or CheckboxList without value. On a touch screen a toggleable row presses as one target, box included; with a fine primary pointer the box keeps its own press.',
|
|
181
181
|
propDescriptions: {
|
|
182
182
|
align:
|
|
183
183
|
"Start/end content alignment, passed to Item: 'center' (default), 'start', or 'first-line' (centered on the label's first line).",
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CheckboxListItem.tsx
|
|
7
|
-
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext
|
|
7
|
+
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext,
|
|
8
|
+
* CheckboxRowPressContext, the touch presentation and the row press paint
|
|
8
9
|
* @output Exports CheckboxListItem component, CheckboxListItemProps
|
|
9
10
|
* @position Core implementation; consumed by index.ts, tested by CheckboxList.test.tsx
|
|
10
11
|
*
|
|
@@ -25,6 +26,10 @@ import type {BaseProps} from '../BaseProps';
|
|
|
25
26
|
import {CheckboxInput} from '../CheckboxInput/CheckboxInput';
|
|
26
27
|
import type {CheckboxInputProps} from '../CheckboxInput/CheckboxInput';
|
|
27
28
|
import type {InputStatus} from '../Field/types';
|
|
29
|
+
import {CheckboxRowPressContext} from '../CheckboxInput/CheckboxRowPressContext';
|
|
30
|
+
import {rowPressPaintStyles} from '../privateAttributes/press.stylex';
|
|
31
|
+
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
32
|
+
import {useTouchPresentation} from '../utils/touchPresentation';
|
|
28
33
|
import {ListItem} from '../List/ListItem';
|
|
29
34
|
import {ListContext} from '../List/ListContext';
|
|
30
35
|
import {CheckboxListContext} from './CheckboxListContext';
|
|
@@ -305,6 +310,12 @@ export function CheckboxListItem({
|
|
|
305
310
|
registerWithRequiredGroup,
|
|
306
311
|
);
|
|
307
312
|
|
|
313
|
+
// Under a finger, a delegating row is the option's only press surface. A
|
|
314
|
+
// touch anywhere on it presses the row. A fine pointer keeps the box's own
|
|
315
|
+
// press.
|
|
316
|
+
const {isTouch} = useTouchPresentation();
|
|
317
|
+
const rowOwnsPress = isTouch && hasRowInteraction && !effectiveDisabled;
|
|
318
|
+
|
|
308
319
|
// A read-only checkbox carries aria-readonly, which the row's clickable
|
|
309
320
|
// container treats as a non-interactive target, so a click on it would be
|
|
310
321
|
// delegated straight back to the checkbox without end. Stop that click at
|
|
@@ -359,6 +370,12 @@ export function CheckboxListItem({
|
|
|
359
370
|
aria-busy={isBusy || undefined}
|
|
360
371
|
xstyle={
|
|
361
372
|
[
|
|
373
|
+
// The row's own press paint, which the layer over its box reads.
|
|
374
|
+
rowOwnsPress && rowPressPaintStyles.checkboxRow,
|
|
375
|
+
// Item's row layer drops the strength's release, and the box paints
|
|
376
|
+
// at that strength. So the row brings the release back, and the box
|
|
377
|
+
// fades with the row.
|
|
378
|
+
rowOwnsPress && interactionOverlayStyles.pressedAlpha,
|
|
362
379
|
resolvedChecked === true &&
|
|
363
380
|
!effectiveDisabled &&
|
|
364
381
|
!effectiveReadOnly &&
|
|
@@ -369,19 +386,23 @@ export function CheckboxListItem({
|
|
|
369
386
|
className={className}
|
|
370
387
|
style={style}
|
|
371
388
|
startContent={
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
389
|
+
// Only the row's own checkbox: a checkbox placed in the row's content
|
|
390
|
+
// keeps its own press.
|
|
391
|
+
<CheckboxRowPressContext value={rowOwnsPress}>
|
|
392
|
+
<DescribedCheckboxInput
|
|
393
|
+
ref={checkboxInputRef}
|
|
394
|
+
label={checkboxLabel}
|
|
395
|
+
aria-labelledby={namesFromVisibleLabel ? labelID : undefined}
|
|
396
|
+
isLabelHidden
|
|
397
|
+
value={resolvedChecked}
|
|
398
|
+
onChange={() => handleToggle()}
|
|
399
|
+
onClick={handleCheckboxClick}
|
|
400
|
+
isDisabled={effectiveDisabled}
|
|
401
|
+
isReadOnly={effectiveReadOnly}
|
|
402
|
+
isLoading={isBusy}
|
|
403
|
+
size={checkboxSize}
|
|
404
|
+
/>
|
|
405
|
+
</CheckboxRowPressContext>
|
|
385
406
|
}
|
|
386
407
|
/>
|
|
387
408
|
);
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
} from '../theme/tokens.stylex';
|
|
47
47
|
import type {SizeValue, SpacingStep, Elevation} from '../utils/types';
|
|
48
48
|
import {mergeProps} from '../utils';
|
|
49
|
+
import {chainEventHandlers} from '../utils/chainEventHandlers';
|
|
49
50
|
import {Card} from '../Card/Card';
|
|
50
51
|
import type {CardVariant} from '../Card/Card';
|
|
51
52
|
import {useClickableContainer} from '../hooks/useClickableContainer';
|
|
@@ -314,6 +315,7 @@ export function ClickableCard({
|
|
|
314
315
|
label,
|
|
315
316
|
onClick: onClickProp,
|
|
316
317
|
onMouseUp: onMouseUpProp,
|
|
318
|
+
onPointerDown: onPointerDownProp,
|
|
317
319
|
href,
|
|
318
320
|
target,
|
|
319
321
|
isDisabled = false,
|
|
@@ -370,7 +372,7 @@ export function ClickableCard({
|
|
|
370
372
|
|
|
371
373
|
const LinkComponent = useLinkComponent();
|
|
372
374
|
|
|
373
|
-
const {onClick, onMouseUp} = useClickableContainer({
|
|
375
|
+
const {onClick, onMouseUp, onPointerDown} = useClickableContainer({
|
|
374
376
|
containerRef,
|
|
375
377
|
interactiveRef,
|
|
376
378
|
onClick: onClickProp,
|
|
@@ -427,6 +429,11 @@ export function ClickableCard({
|
|
|
427
429
|
}
|
|
428
430
|
onClick={!isDisabled ? onClick : undefined}
|
|
429
431
|
onMouseUp={!isDisabled ? handleMouseUp : undefined}
|
|
432
|
+
onPointerDown={
|
|
433
|
+
!isDisabled
|
|
434
|
+
? chainEventHandlers(onPointerDown, onPointerDownProp)
|
|
435
|
+
: onPointerDownProp
|
|
436
|
+
}
|
|
430
437
|
{...props}>
|
|
431
438
|
{isLink ? (
|
|
432
439
|
<LinkRoot
|
|
@@ -59,6 +59,7 @@ import {useLayerInternal} from '../Layer/useLayer';
|
|
|
59
59
|
import {LayerDepthProvider} from '../Layer/LayerDepthContext';
|
|
60
60
|
import {useLayerDismissal} from '../Layer/useLayerDismissal';
|
|
61
61
|
import {currentGesture} from '../Layer/gestureCounter';
|
|
62
|
+
import {noteOutsideDismissal} from '../Layer/outsidePress';
|
|
62
63
|
import {MenuBottomSheetActionList} from '../DropdownMenu/MenuBottomSheetActionList';
|
|
63
64
|
import {menuBottomSheetStyles} from '../DropdownMenu/menuBottomSheet.stylex';
|
|
64
65
|
import {renderDropdownItems} from '../DropdownMenu/renderDropdownItems';
|
|
@@ -531,6 +532,7 @@ export function ContextMenu({
|
|
|
531
532
|
return;
|
|
532
533
|
}
|
|
533
534
|
if (menu && !menu.contains(e.target as Node)) {
|
|
535
|
+
noteOutsideDismissal(menu.ownerDocument);
|
|
534
536
|
closeMenu();
|
|
535
537
|
}
|
|
536
538
|
};
|
|
@@ -101,7 +101,8 @@ export const docs = {
|
|
|
101
101
|
{
|
|
102
102
|
name: 'placeholder',
|
|
103
103
|
type: 'string',
|
|
104
|
-
description:
|
|
104
|
+
description:
|
|
105
|
+
'Placeholder text shown in the text input. A caller placeholder replaces the calendar format hint.',
|
|
105
106
|
default: "'Select a date'",
|
|
106
107
|
},
|
|
107
108
|
{
|
|
@@ -154,21 +155,28 @@ export const docs = {
|
|
|
154
155
|
name: 'format',
|
|
155
156
|
type: "'date' | 'date_long' | 'date_weekday' | 'system_date' | ((value: ISODateString) => string)",
|
|
156
157
|
description:
|
|
157
|
-
"How the committed date value is displayed. Named values are reused from Timestamp's format vocabulary: 'date' shows 'Mar 21, 2026', 'date_long' shows 'March 21, 2026', 'date_weekday' shows 'Wed, Mar 21, 2026', 'system_date' shows '2026-03-21'. A function receives the ISO value and returns a custom string. Applies only to the committed value, never to text being typed.",
|
|
158
|
+
"How the committed date value is displayed. Named values are reused from Timestamp's format vocabulary: 'date' shows 'Mar 21, 2026', 'date_long' shows 'March 21, 2026', 'date_weekday' shows 'Wed, Mar 21, 2026', 'system_date' shows '2026-03-21'. 'date', 'date_long', and 'date_weekday' write the date in the field's calendar; 'system_date' stays the Gregorian ISO date. A function receives the ISO value and returns a custom string; the field cannot re-commit text it cannot read back. Applies only to the committed value, never to text being typed.",
|
|
158
159
|
default: "'date_long'",
|
|
159
160
|
},
|
|
161
|
+
{
|
|
162
|
+
name: 'calendar',
|
|
163
|
+
type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'",
|
|
164
|
+
description:
|
|
165
|
+
'The calendar the text field reads and writes dates in, and the calendar its popover and bottom sheet show. value, onChange, min, and max stay Gregorian ISO dates. People type a date the way the locale writes it in this calendar, in any decimal digits; the field reports a date only once it is complete, and names a date the calendar does not have. Years are years of this calendar: a Buddhist field reads 2026 as Buddhist year 2026, so set min and max on Buddhist and Minguo calendar fields to catch a Gregorian year typed by mistake. Calendars other than gregory, iso8601, buddhist, roc, and japanese need Temporal, native or a polyfill the application loads; without it the field shows Gregorian dates. With a calendar other than gregory or iso8601, a presentation that would show the native date control shows the popover on a fine pointer and the bottom sheet on a coarse pointer, because the native control is Gregorian; the bottom sheet shows the months, leap months, and era years of the calendar. A year in which the era changes is labeled with the era of the shown month, such as 平成31 in January 2019 and 令和元 in July.',
|
|
166
|
+
default: "the InternationalizationProvider's calendar, else 'gregory'",
|
|
167
|
+
},
|
|
160
168
|
{
|
|
161
169
|
name: 'presentation',
|
|
162
170
|
type: "'popover' | 'bottom-sheet' | 'native' | 'adaptive-bottom-sheet' | 'adaptive-native'",
|
|
163
171
|
description:
|
|
164
|
-
"Which surface draws the date picker. 'adaptive-native' (the default) uses Astryx's calendar popover on a fine pointer and the browser/OS picker (input type=date) on a coarse pointer, keeping Astryx fallbacks where a native control cannot express the value; 'native' always uses the browser/OS picker with no fallback; 'adaptive-bottom-sheet' uses the popover on a fine pointer and Astryx's bottom-sheet picker on a coarse pointer; 'popover' and 'bottom-sheet' force that Astryx surface on every pointer. Every value opens a picker; a typed-only field is TimeInput's alone. Use a non-native presentation for a field that needs weekStartsOn, numberOfMonths or dateConstraints, none of which a native picker can express.",
|
|
172
|
+
"Which surface draws the date picker. 'adaptive-native' (the default) uses Astryx's calendar popover on a fine pointer and the browser/OS picker (input type=date) on a coarse pointer, keeping Astryx fallbacks where a native control cannot express the value; 'native' always uses the browser/OS picker with no fallback; 'adaptive-bottom-sheet' uses the popover on a fine pointer and Astryx's bottom-sheet picker on a coarse pointer; 'popover' and 'bottom-sheet' force that Astryx surface on every pointer. Every value opens a picker; a typed-only field is TimeInput's alone. Use a non-native presentation for a field that needs weekStartsOn, numberOfMonths or dateConstraints, none of which a native picker can express. With a calendar other than gregory or iso8601, 'native' and 'adaptive-native' use the popover on a fine pointer and the bottom sheet on a coarse pointer, and an explicit 'native' warns in development.",
|
|
165
173
|
default: "'adaptive-native'",
|
|
166
174
|
},
|
|
167
175
|
{
|
|
168
176
|
name: 'nativePicker',
|
|
169
177
|
type: "'touch' | 'always' | 'never'",
|
|
170
178
|
description:
|
|
171
|
-
"Deprecated: use presentation ('touch' = 'adaptive-native', 'always' = 'native', 'never' = 'adaptive-bottom-sheet'). Still works exactly as released; presentation wins when both are set.",
|
|
179
|
+
"Deprecated: use presentation ('touch' = 'adaptive-native', 'always' = 'native', 'never' = 'adaptive-bottom-sheet'). Still works exactly as released; presentation wins when both are set. With a calendar other than gregory or iso8601, 'touch' and 'always' use the popover on a fine pointer and the bottom sheet on a coarse pointer.",
|
|
172
180
|
default: "'touch'",
|
|
173
181
|
},
|
|
174
182
|
{
|
|
@@ -243,6 +251,11 @@ export const docs = {
|
|
|
243
251
|
description:
|
|
244
252
|
'Use min, max, and dateConstraints to restrict selectable dates to valid ranges.',
|
|
245
253
|
},
|
|
254
|
+
{
|
|
255
|
+
guidance: true,
|
|
256
|
+
description:
|
|
257
|
+
'Set min and max on a Buddhist or Minguo calendar field, so a Gregorian year typed by mistake shows an error instead of a date centuries away.',
|
|
258
|
+
},
|
|
246
259
|
{
|
|
247
260
|
guidance: true,
|
|
248
261
|
description:
|
|
@@ -294,7 +307,7 @@ export const docs = {
|
|
|
294
307
|
name: 'Text input',
|
|
295
308
|
required: true,
|
|
296
309
|
description:
|
|
297
|
-
|
|
310
|
+
"A field where the user can type a date directly, written the way the locale writes it in the field's calendar.",
|
|
298
311
|
},
|
|
299
312
|
{
|
|
300
313
|
name: 'Calendar icon',
|
|
@@ -346,6 +359,11 @@ export const docsZh = {
|
|
|
346
359
|
description:
|
|
347
360
|
'Use min, max, and dateConstraints to restrict selectable dates to valid ranges.',
|
|
348
361
|
},
|
|
362
|
+
{
|
|
363
|
+
guidance: true,
|
|
364
|
+
description:
|
|
365
|
+
'Set min and max on a Buddhist or Minguo calendar field, so a Gregorian year typed by mistake shows an error instead of a date centuries away.',
|
|
366
|
+
},
|
|
349
367
|
{
|
|
350
368
|
guidance: true,
|
|
351
369
|
description:
|
|
@@ -462,7 +480,8 @@ export const docsZh = {
|
|
|
462
480
|
{
|
|
463
481
|
name: 'placeholder',
|
|
464
482
|
type: 'string',
|
|
465
|
-
description:
|
|
483
|
+
description:
|
|
484
|
+
'文本输入框中显示的占位符文本。调用方提供的占位符会替代日历格式提示。',
|
|
466
485
|
default: "'Select a date'",
|
|
467
486
|
},
|
|
468
487
|
{
|
|
@@ -511,21 +530,28 @@ export const docsZh = {
|
|
|
511
530
|
name: 'format',
|
|
512
531
|
type: "'date' | 'date_long' | 'date_weekday' | 'system_date' | ((value: ISODateString) => string)",
|
|
513
532
|
description:
|
|
514
|
-
"已选日期的显示格式。命名值复用 Timestamp 的格式词汇:'date' 显示 'Mar 21, 2026','date_long' 显示 'March 21, 2026','date_weekday' 显示 'Wed, Mar 21, 2026','system_date' 显示 '2026-03-21'
|
|
533
|
+
"已选日期的显示格式。命名值复用 Timestamp 的格式词汇:'date' 显示 'Mar 21, 2026','date_long' 显示 'March 21, 2026','date_weekday' 显示 'Wed, Mar 21, 2026','system_date' 显示 '2026-03-21'。'date'、'date_long' 与 'date_weekday' 按字段的历法书写日期;'system_date' 始终为公历 ISO 日期。函数接收 ISO 值并返回自定义字符串;字段无法读回的文本在编辑后不能重新提交。仅作用于已提交的值,不影响正在输入的文本。",
|
|
515
534
|
default: "'date_long'",
|
|
516
535
|
},
|
|
536
|
+
{
|
|
537
|
+
name: 'calendar',
|
|
538
|
+
type: "'gregory' | 'iso8601' | 'buddhist' | 'roc' | 'japanese' | 'persian' | 'indian' | 'hebrew' | 'chinese' | 'dangi' | 'coptic' | 'ethiopic' | 'ethioaa' | 'islamic-civil' | 'islamic-tbla' | 'islamic-umalqura'",
|
|
539
|
+
description:
|
|
540
|
+
'文本字段读写日期所用的历法,也是其弹出日历和底部选择器显示的历法。value、onChange、min 和 max 始终为公历 ISO 日期。用户按当前语言区域在该历法中的写法输入日期,可使用任意十进制数字;只有输入完整时字段才会报告日期,并会指出该历法中不存在的日期。年份是该历法的年份:佛历字段把 2026 读作佛历 2026 年,因此请为佛历和民国纪年字段设置 min 和 max,以发现误输入的公历年份。gregory、iso8601、buddhist、roc 和 japanese 以外的历法需要 Temporal(原生或由应用加载的 polyfill);没有 Temporal 时字段显示公历日期。使用 gregory 或 iso8601 以外的历法时,原本显示原生日期控件的呈现会在精细指针上显示弹出层、在粗指针上显示底部选择器,因为原生控件只显示公历;底部选择器显示该历法的月份、闰月和带纪元的年份。年号更替的年份按所显示月份的年号标注,如 2019 年 1 月为“平成31”,7 月为“令和元”。',
|
|
541
|
+
default: "InternationalizationProvider 的历法,否则为 'gregory'",
|
|
542
|
+
},
|
|
517
543
|
{
|
|
518
544
|
name: 'presentation',
|
|
519
545
|
type: "'popover' | 'bottom-sheet' | 'native' | 'adaptive-bottom-sheet' | 'adaptive-native'",
|
|
520
546
|
description:
|
|
521
|
-
"由哪个界面绘制日期选择器。'adaptive-native'(默认)在精细指针上使用 Astryx 日历弹出层、在粗指针上使用浏览器/操作系统选择器(input type=date),且原生控件无法表达值时保留 Astryx 回退;'native' 始终使用浏览器/操作系统选择器且不回退;'adaptive-bottom-sheet' 在精细指针上用弹出层、在粗指针上用 Astryx 底部选择器;'popover' 与 'bottom-sheet' 在任何指针上强制使用对应 Astryx 界面。每个值都会打开选择器;仅输入字段的呈现只属于 TimeInput。需要 weekStartsOn、numberOfMonths 或 dateConstraints
|
|
547
|
+
"由哪个界面绘制日期选择器。'adaptive-native'(默认)在精细指针上使用 Astryx 日历弹出层、在粗指针上使用浏览器/操作系统选择器(input type=date),且原生控件无法表达值时保留 Astryx 回退;'native' 始终使用浏览器/操作系统选择器且不回退;'adaptive-bottom-sheet' 在精细指针上用弹出层、在粗指针上用 Astryx 底部选择器;'popover' 与 'bottom-sheet' 在任何指针上强制使用对应 Astryx 界面。每个值都会打开选择器;仅输入字段的呈现只属于 TimeInput。需要 weekStartsOn、numberOfMonths 或 dateConstraints 的字段应使用非原生呈现,原生选择器无法表达这些。使用 gregory 或 iso8601 以外的历法时,'native' 与 'adaptive-native' 在精细指针上使用弹出层、在粗指针上使用底部选择器,显式的 'native' 会在开发环境中发出警告。",
|
|
522
548
|
default: "'adaptive-native'",
|
|
523
549
|
},
|
|
524
550
|
{
|
|
525
551
|
name: 'nativePicker',
|
|
526
552
|
type: "'touch' | 'always' | 'never'",
|
|
527
553
|
description:
|
|
528
|
-
"已弃用:请使用 presentation('touch'='adaptive-native'、'always'='native'、'never'='adaptive-bottom-sheet')。仍按已发布行为工作;同时设置时以 presentation
|
|
554
|
+
"已弃用:请使用 presentation('touch'='adaptive-native'、'always'='native'、'never'='adaptive-bottom-sheet')。仍按已发布行为工作;同时设置时以 presentation 为准。使用 gregory 或 iso8601 以外的历法时,'touch' 与 'always' 在精细指针上使用弹出层、在粗指针上使用底部选择器。",
|
|
529
555
|
default: "'touch'",
|
|
530
556
|
},
|
|
531
557
|
{
|
|
@@ -601,6 +627,11 @@ export const docsDense = {
|
|
|
601
627
|
description:
|
|
602
628
|
'Use min, max, and dateConstraints to restrict selectable dates to valid ranges.',
|
|
603
629
|
},
|
|
630
|
+
{
|
|
631
|
+
guidance: true,
|
|
632
|
+
description:
|
|
633
|
+
'Set min and max on a Buddhist or Minguo calendar field, so a Gregorian year typed by mistake shows an error instead of a date centuries away.',
|
|
634
|
+
},
|
|
604
635
|
{
|
|
605
636
|
guidance: true,
|
|
606
637
|
description:
|
|
@@ -671,11 +702,13 @@ export const docsDense = {
|
|
|
671
702
|
weekStartsOn:
|
|
672
703
|
'first day of week in calendar (0=Sunday, or name e.g. "mon")',
|
|
673
704
|
format:
|
|
674
|
-
"committed-value display: 'date_long' (default, March 21, 2026), 'date' (Mar 21, 2026), 'date_weekday' (Wed, Mar 21, 2026), 'system_date' (2026-03-21), or (iso)=>string; reuses Timestamp vocabulary. Committed value only, not while typing.",
|
|
705
|
+
"committed-value display: 'date_long' (default, March 21, 2026), 'date' (Mar 21, 2026), 'date_weekday' (Wed, Mar 21, 2026), 'system_date' (2026-03-21, always Gregorian ISO), or (iso)=>string; reuses Timestamp vocabulary; named formats write the field's calendar. Committed value only, not while typing.",
|
|
706
|
+
calendar:
|
|
707
|
+
"calendar for typed + committed text, the popover, and the bottom sheet (months, leap months, era years; an era-change year follows the shown month, e.g. 平成31 in Jan 2019, 令和元 in Jul) (default: provider's, else 'gregory'); values stay Gregorian ISO; years are the calendar's, so set min/max on buddhist/roc fields; non-Gregorian-aligned calendars need Temporal (native or app-loaded polyfill), else Gregorian; non-gregory/iso8601 never shows the native control: popover fine / sheet coarse",
|
|
675
708
|
presentation:
|
|
676
|
-
"which surface draws the picker: 'adaptive-native' (default) = Astryx popover on fine, browser/OS on coarse w/ Astryx fallbacks; 'native' = browser/OS always, no fallback; 'adaptive-bottom-sheet' = popover fine / Astryx sheet coarse; 'popover'/'bottom-sheet' force Astryx. every value opens a picker (no text-only value; that is TimeInput's). use non-native for weekStartsOn/numberOfMonths/dateConstraints.",
|
|
709
|
+
"which surface draws the picker: 'adaptive-native' (default) = Astryx popover on fine, browser/OS on coarse w/ Astryx fallbacks; 'native' = browser/OS always, no fallback; 'adaptive-bottom-sheet' = popover fine / Astryx sheet coarse; 'popover'/'bottom-sheet' force Astryx. every value opens a picker (no text-only value; that is TimeInput's). use non-native for weekStartsOn/numberOfMonths/dateConstraints. non-gregory/iso8601 calendar: native + adaptive-native become popover fine / sheet coarse; explicit 'native' warns in dev.",
|
|
677
710
|
nativePicker:
|
|
678
|
-
"deprecated, use presentation: 'touch'='adaptive-native', 'always'='native', 'never'='adaptive-bottom-sheet'. still works as released; presentation wins if both set.",
|
|
711
|
+
"deprecated, use presentation: 'touch'='adaptive-native', 'always'='native', 'never'='adaptive-bottom-sheet'. still works as released, except that a calendar other than gregory or iso8601 never shows the native control; presentation wins if both set.",
|
|
679
712
|
containerXstyle:
|
|
680
713
|
'Field box (label+control+status); also containerClassName/containerStyle. no effect in InputGroup or horizontal-labels FormLayout',
|
|
681
714
|
containerClassName:
|