@astryxdesign/core 0.7.7 → 0.7.8-canary.07ee4b5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/AlertDialog.d.ts +4 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +46 -6
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +11 -3
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +1 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +25 -4
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +5 -0
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +1 -1
- package/dist/BottomSheet/useMobileKeyboard.js +6 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +12 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +17 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +18 -22
- package/dist/Calendar/getWeekdayHeaderNames.d.ts +16 -0
- package/dist/Calendar/getWeekdayHeaderNames.d.ts.map +1 -0
- package/dist/Calendar/getWeekdayHeaderNames.js +70 -0
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +2 -10
- package/dist/Calendar/{standaloneShortWeekdayNames.generated.d.ts → weekdayHeaderNames.generated.d.ts} +14 -14
- package/dist/Calendar/weekdayHeaderNames.generated.d.ts.map +1 -0
- package/dist/Calendar/{standaloneShortWeekdayNames.generated.js → weekdayHeaderNames.generated.js} +12 -12
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +2 -0
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +6 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +2 -1
- package/dist/Chat/useChatDictation.d.ts.map +1 -1
- package/dist/Chat/useChatDictation.js +2 -0
- package/dist/Chat/useChatNewMessages.js +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +2 -0
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +3 -0
- package/dist/Chat/useTriggerMenu.js +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +17 -12
- package/dist/CheckboxList/CheckboxList.d.ts +8 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +2 -0
- package/dist/CodeBlock/CodeBlock.d.ts +10 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +28 -11
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +2 -0
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +2 -0
- package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +14 -4
- package/dist/ContextMenu/ContextMenu.js +2 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +5 -2
- package/dist/DateInput/PickerWheel.d.ts +19 -0
- package/dist/DateInput/PickerWheel.d.ts.map +1 -0
- package/dist/DateInput/PickerWheel.js +625 -0
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +9 -30
- package/dist/DateInput/Wheel.d.ts +18 -37
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +84 -113
- package/dist/DateInput/useOwnScrollGesture.d.ts +10 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -1
- package/dist/DateInput/useOwnScrollGesture.js +16 -3
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
- package/dist/DateInput/usePointerDragScroll.js +2 -0
- package/dist/DateInput/useScrollSettle.d.ts.map +1 -1
- package/dist/DateInput/useScrollSettle.js +3 -0
- package/dist/DateInput/useWheelListbox.d.ts +59 -0
- package/dist/DateInput/useWheelListbox.d.ts.map +1 -0
- package/dist/DateInput/useWheelListbox.js +88 -0
- package/dist/DateInput/wheelOptions.d.ts +74 -0
- package/dist/DateInput/wheelOptions.d.ts.map +1 -0
- package/dist/DateInput/wheelOptions.js +98 -0
- package/dist/DateInput/wheelPhysics.d.ts +127 -0
- package/dist/DateInput/wheelPhysics.d.ts.map +1 -0
- package/dist/DateInput/wheelPhysics.js +341 -0
- package/dist/DateInput/wheelStrip.d.ts +92 -0
- package/dist/DateInput/wheelStrip.d.ts.map +1 -0
- package/dist/DateInput/wheelStrip.js +258 -0
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +10 -10
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +9 -32
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
- package/dist/Drawer/useDrawerDialogPresence.js +3 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -1
- package/dist/DropdownMenu/useMenuOverflow.js +5 -0
- package/dist/Field/Field.js +2 -2
- package/dist/FieldStatus/useFieldStatusAnnouncement.d.ts.map +1 -1
- package/dist/FieldStatus/useFieldStatusAnnouncement.js +1 -0
- package/dist/FormLayout/FormLayout.d.ts +5 -1
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.d.ts +6 -4
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +48 -3
- package/dist/HoverCard/useHoverCard.d.ts +5 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +20 -33
- package/dist/Icon/Icon.d.ts +5 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +5 -2
- package/dist/InfoTip/InfoTip.d.ts +5 -5
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +58 -19
- package/dist/Item/useSwipeAction.d.ts.map +1 -1
- package/dist/Item/useSwipeAction.js +3 -0
- package/dist/Layer/modalOutlet.d.ts.map +1 -1
- package/dist/Layer/modalOutlet.js +2 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +1 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +4 -1
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
- package/dist/Layer/useLayerDismissal.js +3 -0
- package/dist/Layer/useTouchTrigger.d.ts +13 -7
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +20 -6
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.d.ts.map +1 -1
- package/dist/Layout/index.js +1 -1
- package/dist/Layout/layoutReset.js +1 -1
- package/dist/Layout/overlayPaddingReset.stylex.d.ts +68 -0
- package/dist/Layout/overlayPaddingReset.stylex.d.ts.map +1 -0
- package/dist/Layout/overlayPaddingReset.stylex.js +72 -0
- package/dist/Layout/padding.stylex.d.ts +5 -129
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +9 -143
- package/dist/Layout/paddingStyles.stylex.d.ts +83 -0
- package/dist/Layout/paddingStyles.stylex.d.ts.map +1 -0
- package/dist/Layout/paddingStyles.stylex.js +99 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +20 -1
- package/dist/MobileNav/MobileNav.d.ts +3 -2
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +10 -26
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +2 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +2 -1
- package/dist/Outline/useOutlineFromDOM.d.ts.map +1 -1
- package/dist/Outline/useOutlineFromDOM.js +3 -0
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +3 -0
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +3 -0
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +6 -0
- package/dist/Popover/usePopover.js +2 -2
- package/dist/PowerSearch/PowerSearch.d.ts +39 -4
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +441 -134
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +102 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
- package/dist/PowerSearch/PowerSearchBottomSheet.js +1919 -0
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +35 -2
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +43 -10
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -2
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +273 -86
- package/dist/PowerSearch/formatFilterValue.d.ts +14 -7
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +31 -23
- package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
- package/dist/PowerSearch/formatTokenValue.js +161 -0
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.d.ts.map +1 -1
- package/dist/PowerSearch/powerSearchDateZone.d.ts +25 -0
- package/dist/PowerSearch/powerSearchDateZone.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchDateZone.js +57 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
- package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
- package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
- package/dist/PowerSearch/types.d.ts +8 -1
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBarTouch.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBarTouch.js +2 -0
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +3 -2
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -3
- package/dist/Resizable/ResizeHandle.d.ts +2 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +101 -77
- package/dist/Resizable/createResizable.d.ts +145 -0
- package/dist/Resizable/createResizable.d.ts.map +1 -0
- package/dist/Resizable/createResizable.js +575 -0
- package/dist/Resizable/useResizable.d.ts +3 -3
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +252 -459
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
- package/dist/SelectableCard/SelectableCard.d.ts +2 -0
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +36 -11
- package/dist/SelectableCard/selectableCardInput.d.ts +12 -0
- package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -0
- package/dist/SelectableCard/selectableCardInput.js +20 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +7 -9
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +36 -5
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +16 -11
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +60 -58
- package/dist/Stepper/Stepper.d.ts.map +1 -1
- package/dist/Stepper/Stepper.js +10 -15
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +4 -10
- package/dist/Switch/useSwitchTouch.js +4 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -8
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +3 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +2 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +4 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -0
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +2 -1
- package/dist/TextInput/TextInput.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +12 -8
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +2 -0
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +2 -0
- package/dist/Timer/Timer.d.ts.map +1 -1
- package/dist/Timer/Timer.js +2 -0
- package/dist/Timestamp/Timestamp.js +1 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +1 -23
- package/dist/Toast/Toast.d.ts +11 -1
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +25 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +97 -34
- package/dist/Toast/types.d.ts +9 -3
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +1 -0
- package/dist/Tokenizer/Tokenizer.d.ts +44 -46
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +20 -21
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +1 -1
- package/dist/Tokenizer/TokenizerBottomSheet.js +4 -6
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.d.ts +2 -23
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +5 -29
- package/dist/Tooltip/useTooltip.d.ts +23 -30
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +194 -108
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +27 -18
- package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/animator/createAnimator.d.ts +98 -0
- package/dist/animator/createAnimator.d.ts.map +1 -0
- package/dist/animator/createAnimator.js +259 -0
- package/dist/astryx.css +41 -7
- package/dist/gestures/GestureHost.d.ts +16 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +1 -1
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +4 -3
- package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -1
- package/dist/hooks/ModalAnnounceProvider.js +1 -0
- package/dist/hooks/actionGroupTracker.d.ts +4 -1
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +13 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/longPressDetector.d.ts +66 -0
- package/dist/hooks/longPressDetector.d.ts.map +1 -0
- package/dist/hooks/longPressDetector.js +200 -0
- package/dist/hooks/pressGroupContext.d.ts +6 -0
- package/dist/hooks/pressGroupContext.d.ts.map +1 -0
- package/dist/hooks/pressGroupContext.js +20 -0
- package/dist/hooks/rootScrollStyles.d.ts +48 -0
- package/dist/hooks/rootScrollStyles.d.ts.map +1 -0
- package/dist/hooks/rootScrollStyles.js +207 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts +13 -0
- package/dist/hooks/scrollLockTouchGuard.d.ts.map +1 -0
- package/dist/hooks/scrollLockTouchGuard.js +117 -0
- package/dist/hooks/scrollbarGutter.d.ts +4 -4
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -1
- package/dist/hooks/scrollbarGutter.js +36 -23
- package/dist/hooks/useActionGroupTracking.d.ts +53 -0
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
- package/dist/hooks/useActionGroupTracking.js +174 -0
- package/dist/hooks/useAnimator.d.ts +41 -0
- package/dist/hooks/useAnimator.d.ts.map +1 -0
- package/dist/hooks/useAnimator.js +70 -0
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +1 -0
- package/dist/hooks/useAttachment.d.ts +1 -1
- package/dist/hooks/useAttachment.js +1 -1
- package/dist/hooks/useAutoMediaMode.d.ts.map +1 -1
- package/dist/hooks/useAutoMediaMode.js +1 -0
- package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
- package/dist/hooks/useBusyAnnouncement.js +2 -0
- package/dist/hooks/useDevWarning.d.ts.map +1 -1
- package/dist/hooks/useDevWarning.js +2 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +2 -0
- package/dist/hooks/useGridFocus.d.ts +8 -5
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +4 -3
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +3 -0
- package/dist/hooks/useImageMode.d.ts.map +1 -1
- package/dist/hooks/useImageMode.js +3 -0
- package/dist/hooks/useInputStatusIcon.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -2
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -1
- package/dist/hooks/useKeyboardHint.js +1 -1
- package/dist/hooks/useLongPress.d.ts +8 -9
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +23 -106
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +2 -0
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +3 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +2 -1
- package/dist/hooks/usePressFeedback.d.ts.map +1 -1
- package/dist/hooks/usePressFeedback.js +1 -0
- package/dist/hooks/useResolvedRequired.d.ts +3 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -1
- package/dist/hooks/useResolvedRequired.js +3 -0
- package/dist/hooks/useScrollLock.d.ts +8 -9
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +50 -48
- package/dist/hooks/useScrollableArea.d.ts.map +1 -1
- package/dist/hooks/useScrollableArea.js +5 -0
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +3 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +30 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/internal/indicatorPress.stylex.d.ts +20 -0
- package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
- package/dist/internal/indicatorPress.stylex.js +26 -0
- package/dist/internal/selectable-card.d.ts +21 -0
- package/dist/internal/selectable-card.d.ts.map +1 -0
- package/dist/internal/selectable-card.js +20 -0
- package/dist/internal/sheetDraft.d.ts +2 -2
- package/dist/internal/sheetDraft.js +2 -2
- package/dist/motion/animatedLayout.d.ts +8 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +246 -53
- package/dist/motion/animator.d.ts +14 -14
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +45 -26
- package/dist/motion/frameBlock.d.ts +14 -0
- package/dist/motion/frameBlock.d.ts.map +1 -0
- package/dist/motion/frameBlock.js +16 -0
- package/dist/motion/progress.d.ts +88 -0
- package/dist/motion/progress.d.ts.map +1 -0
- package/dist/motion/progress.js +128 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +3 -1
- package/dist/motion/uikit/alert.d.ts +41 -0
- package/dist/motion/uikit/alert.d.ts.map +1 -0
- package/dist/motion/uikit/alert.js +43 -0
- package/dist/motion/uikit/index.d.ts +4 -3
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +4 -3
- package/dist/motion/uikit/picker.d.ts +96 -0
- package/dist/motion/uikit/picker.d.ts.map +1 -0
- package/dist/motion/uikit/picker.js +117 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +22 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/pressGroupItem.stylex.js +36 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts +23 -0
- package/dist/privateAttributes/reducedMotion.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/reducedMotion.stylex.js +40 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +29 -4
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +14 -13
- package/dist/theme/motionKnobs.d.ts +4 -3
- package/dist/theme/motionKnobs.d.ts.map +1 -1
- package/dist/theme/motionKnobs.js +3 -2
- package/dist/theme/themeMotion.d.ts +6 -0
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +15 -2
- package/dist/theme/tokens.stylex.d.ts +3 -0
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +4 -1
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +12 -0
- package/dist/utils/disabledInteraction.d.ts +10 -2
- package/dist/utils/disabledInteraction.d.ts.map +1 -1
- package/dist/utils/disabledInteraction.js +16 -2
- package/dist/utils/focusReturn.d.ts +22 -25
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +36 -29
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +4 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/isFocusDetached.d.ts +27 -0
- package/dist/utils/isFocusDetached.d.ts.map +1 -0
- package/dist/utils/isFocusDetached.js +32 -0
- package/dist/utils/plainDate.d.ts +31 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +68 -4
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +20 -6
- package/dist/utils/triggerFocus.d.ts +36 -0
- package/dist/utils/triggerFocus.d.ts.map +1 -0
- package/dist/utils/triggerFocus.js +65 -0
- package/locales/en.json +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +14 -9
- package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
- package/src/AlertDialog/AlertDialog.tsx +46 -5
- package/src/AppShell/AppShell.tsx +13 -4
- package/src/BottomSheet/BottomSheet.tsx +1 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +39 -3
- package/src/BottomSheet/BottomSheetSwitcher.tsx +5 -0
- package/src/BottomSheet/useMobileKeyboard.ts +4 -0
- package/src/BottomSheet/useSheetGestures.ts +10 -1
- package/src/Button/Button.tsx +26 -4
- package/src/Calendar/Calendar.tsx +40 -32
- package/src/Calendar/getWeekdayHeaderNames.ts +88 -0
- package/src/Calendar/hooks/useCalendarDays.ts +5 -10
- package/src/Calendar/{standaloneShortWeekdayNames.generated.ts → weekdayHeaderNames.generated.ts} +14 -14
- package/src/Carousel/Carousel.tsx +1 -0
- package/src/Chat/ChatComposerInput.tsx +4 -7
- package/src/Chat/ChatMessageList.tsx +2 -1
- package/src/Chat/useChatDictation.ts +1 -0
- package/src/Chat/useChatNewMessages.ts +1 -1
- package/src/Chat/useChatStreamScroll.ts +2 -0
- package/src/Chat/useSpeechRecognition.ts +2 -0
- package/src/Chat/useTriggerMenu.tsx +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
- package/src/CheckboxInput/CheckboxInput.tsx +38 -15
- package/src/CheckboxList/CheckboxList.doc.mjs +7 -0
- package/src/CheckboxList/CheckboxList.tsx +9 -0
- package/src/CodeBlock/CodeBlock.doc.mjs +9 -1
- package/src/CodeBlock/CodeBlock.tsx +41 -4
- package/src/CommandPalette/CommandPalette.tsx +1 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -0
- package/src/ComplexSelector/ComplexSelector.tsx +20 -5
- package/src/ContextMenu/ContextMenu.tsx +2 -2
- package/src/DateInput/MonthScroller.tsx +8 -2
- package/src/DateInput/PickerWheel.tsx +765 -0
- package/src/DateInput/TouchDateField.tsx +6 -32
- package/src/DateInput/Wheel.tsx +94 -150
- package/src/DateInput/useOwnScrollGesture.ts +25 -3
- package/src/DateInput/usePointerDragScroll.ts +1 -0
- package/src/DateInput/useScrollSettle.ts +2 -0
- package/src/DateInput/useWheelListbox.ts +112 -0
- package/src/DateInput/wheelOptions.ts +155 -0
- package/src/DateInput/wheelPhysics.ts +406 -0
- package/src/DateInput/wheelStrip.ts +341 -0
- package/src/DateTimeInput/TouchDateTimeField.tsx +8 -13
- package/src/Dialog/Dialog.tsx +12 -32
- package/src/Drawer/useDrawerDialogPresence.ts +2 -0
- package/src/DropdownMenu/useMenuOverflow.ts +3 -0
- package/src/Field/Field.tsx +2 -2
- package/src/FieldStatus/useFieldStatusAnnouncement.ts +1 -0
- package/src/FormLayout/FormLayout.doc.mjs +181 -46
- package/src/FormLayout/FormLayout.tsx +5 -1
- package/src/HoverCard/HoverCard.doc.mjs +10 -8
- package/src/HoverCard/HoverCard.tsx +58 -6
- package/src/HoverCard/useHoverCard.doc.mjs +178 -36
- package/src/HoverCard/useHoverCard.tsx +49 -54
- package/src/Icon/Icon.doc.mjs +51 -10
- package/src/Icon/Icon.tsx +15 -7
- package/src/IconButton/IconButton.doc.mjs +141 -21
- package/src/InfoTip/InfoTip.tsx +72 -16
- package/src/Item/useSwipeAction.ts +2 -0
- package/src/Layer/modalOutlet.ts +2 -0
- package/src/Layer/outsidePress.ts +1 -0
- package/src/Layer/useLayer.tsx +3 -1
- package/src/Layer/useLayerDismissal.ts +2 -0
- package/src/Layer/useTouchTrigger.ts +19 -6
- package/src/Layout/index.ts +1 -1
- package/src/Layout/layoutReset.ts +1 -1
- package/src/Layout/overlayPaddingReset.stylex.ts +73 -0
- package/src/Layout/padding.stylex.ts +9 -133
- package/src/Layout/paddingStyles.stylex.ts +87 -0
- package/src/Lightbox/Lightbox.tsx +20 -1
- package/src/Lightbox/useLightbox.doc.mjs +167 -0
- package/src/MobileNav/MobileNav.tsx +10 -31
- package/src/MultiSelector/MultiSelector.tsx +2 -7
- package/src/NumberInput/NumberInput.tsx +2 -7
- package/src/Outline/useOutlineFromDOM.ts +2 -0
- package/src/Outline/useScrollSpy.ts +2 -0
- package/src/OverflowList/OverflowList.tsx +2 -0
- package/src/Popover/Popover.tsx +4 -0
- package/src/Popover/usePopover.tsx +2 -2
- package/src/PowerSearch/PowerSearch.doc.mjs +60 -8
- package/src/PowerSearch/PowerSearch.tsx +620 -157
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +2525 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +65 -9
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +2 -0
- package/src/PowerSearch/PowerSearchToken.tsx +2 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +340 -59
- package/src/PowerSearch/formatFilterValue.ts +49 -27
- package/src/PowerSearch/formatTokenValue.ts +220 -0
- package/src/PowerSearch/index.ts +5 -1
- package/src/PowerSearch/powerSearchDateZone.ts +95 -0
- package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
- package/src/PowerSearch/types.ts +8 -1
- package/src/ProgressBar/ProgressBarTouch.ts +2 -0
- package/src/RadioList/RadioList.tsx +3 -2
- package/src/RadioList/RadioListItem.tsx +5 -3
- package/src/Resizable/Resizable.doc.mjs +5 -4
- package/src/Resizable/ResizeHandle.tsx +169 -109
- package/src/Resizable/createResizable.ts +831 -0
- package/src/Resizable/useResizable.ts +292 -623
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
- package/src/SelectableCard/SelectableCard.tsx +39 -10
- package/src/SelectableCard/selectableCardInput.ts +30 -0
- package/src/Selector/Selector.tsx +7 -19
- package/src/SideNav/SideNav.tsx +41 -5
- package/src/Slider/Slider.tsx +20 -11
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.tsx +77 -63
- package/src/Stepper/Stepper.tsx +10 -27
- package/src/Switch/Switch.tsx +2 -6
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/Table/BaseTable.tsx +46 -12
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +1 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +4 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +2 -0
- package/src/TextArea/TextArea.tsx +2 -7
- package/src/TextInput/TextInput.tsx +13 -17
- package/src/TimeInput/TimeInput.tsx +2 -0
- package/src/TimeInput/TouchTimeField.tsx +2 -0
- package/src/Timer/Timer.tsx +1 -0
- package/src/Timestamp/Timestamp.tsx +1 -1
- package/src/Timestamp/formatInstant.ts +1 -33
- package/src/Toast/Toast.doc.mjs +4 -3
- package/src/Toast/Toast.tsx +52 -32
- package/src/Toast/ToastViewport.tsx +123 -35
- package/src/Toast/types.ts +9 -3
- package/src/Toast/useToast.tsx +1 -0
- package/src/Tokenizer/Tokenizer.doc.mjs +10 -10
- package/src/Tokenizer/Tokenizer.tsx +61 -62
- package/src/Tokenizer/TokenizerBottomSheet.tsx +9 -11
- package/src/Tokenizer/index.ts +1 -0
- package/src/Tooltip/Tooltip.tsx +6 -42
- package/src/Tooltip/useTooltip.doc.mjs +24 -0
- package/src/Tooltip/useTooltip.tsx +237 -134
- package/src/Typeahead/BaseTypeahead.tsx +27 -17
- package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/animator/createAnimator.doc.mjs +153 -0
- package/src/animator/createAnimator.ts +324 -0
- package/src/gestures/GestureHost.ts +1 -1
- package/src/gestures/PressTracker.ts +4 -3
- package/src/gestures/README.md +10 -4
- package/src/hooks/ModalAnnounceProvider.tsx +1 -0
- package/src/hooks/actionGroupTracker.ts +20 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/longPressDetector.ts +273 -0
- package/src/hooks/pressGroupContext.ts +21 -0
- package/src/hooks/rootScrollStyles.ts +247 -0
- package/src/hooks/scrollLockTouchGuard.ts +149 -0
- package/src/hooks/scrollbarGutter.ts +41 -26
- package/src/hooks/useActionGroupTracking.ts +224 -0
- package/src/hooks/useAnimator.doc.mjs +109 -0
- package/src/hooks/useAnimator.ts +67 -0
- package/src/hooks/useAnnounceRenderedText.ts +1 -0
- package/src/hooks/useAttachment.ts +1 -1
- package/src/hooks/useAutoMediaMode.ts +1 -0
- package/src/hooks/useBusyAnnouncement.ts +2 -0
- package/src/hooks/useDevWarning.ts +2 -0
- package/src/hooks/useFocusTrap.ts +2 -0
- package/src/hooks/useGridFocus.doc.mjs +6 -6
- package/src/hooks/useGridFocus.ts +10 -7
- package/src/hooks/useHotkeys.ts +2 -0
- package/src/hooks/useImageMode.ts +2 -0
- package/src/hooks/useInputStatusIcon.tsx +3 -2
- package/src/hooks/useKeyboardHint.tsx +1 -1
- package/src/hooks/useLongPress.doc.mjs +2 -2
- package/src/hooks/useLongPress.ts +32 -122
- package/src/hooks/useMenuHover.ts +1 -0
- package/src/hooks/useMenuPress.ts +2 -0
- package/src/hooks/useOverflow.ts +2 -1
- package/src/hooks/usePressFeedback.ts +1 -0
- package/src/hooks/useResolvedRequired.ts +3 -0
- package/src/hooks/useScrollLock.doc.mjs +51 -12
- package/src/hooks/useScrollLock.ts +53 -60
- package/src/hooks/useScrollableArea.ts +4 -0
- package/src/hooks/useStreamingText.ts +2 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
- package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
- package/src/i18n/generated-locales/en.generated.ts +41 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
- package/src/index.ts +13 -0
- package/src/internal/indicatorPress.stylex.ts +24 -0
- package/src/internal/selectable-card.ts +21 -0
- package/src/internal/sheetDraft.ts +2 -2
- package/src/motion/MEASUREMENTS.md +18 -0
- package/src/motion/README.md +10 -5
- package/src/motion/animatedLayout.ts +323 -60
- package/src/motion/animator.ts +66 -37
- package/src/motion/frameBlock.ts +16 -0
- package/src/motion/progress.ts +155 -0
- package/src/motion/reducedMotion.ts +3 -1
- package/src/motion/uikit/alert.ts +43 -0
- package/src/motion/uikit/index.ts +4 -3
- package/src/motion/uikit/picker.ts +116 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +44 -0
- package/src/privateAttributes/reducedMotion.stylex.ts +45 -0
- package/src/theme/Theme.tsx +37 -3
- package/src/theme/generateThemeRules.ts +14 -12
- package/src/theme/motionKnobs.ts +4 -3
- package/src/theme/themeMotion.ts +17 -2
- package/src/theme/tokens.stylex.ts +2 -0
- package/src/utils/dateParser.ts +16 -0
- package/src/utils/disabledInteraction.ts +23 -2
- package/src/utils/focusReturn.ts +38 -31
- package/src/utils/index.ts +1 -1
- package/src/utils/interactionModality.ts +4 -0
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/isFocusDetached.ts +34 -0
- package/src/utils/plainDate.ts +80 -4
- package/src/utils/pressFeedback.ts +24 -6
- package/src/utils/triggerFocus.ts +80 -0
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts +0 -14
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts.map +0 -1
- package/dist/Calendar/getStandaloneShortWeekdayNames.js +0 -26
- package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts.map +0 -1
- package/dist/Layer/usePressPin.d.ts +0 -93
- package/dist/Layer/usePressPin.d.ts.map +0 -1
- package/dist/Layer/usePressPin.js +0 -363
- package/dist/internal/touch-sheet.d.ts +0 -21
- package/dist/internal/touch-sheet.d.ts.map +0 -1
- package/dist/internal/touch-sheet.js +0 -19
- package/src/Calendar/getStandaloneShortWeekdayNames.ts +0 -38
- package/src/Layer/usePressPin.ts +0 -510
- package/src/internal/touch-sheet.ts +0 -21
|
@@ -20,7 +20,8 @@ export const docs = {
|
|
|
20
20
|
{
|
|
21
21
|
name: 'icon',
|
|
22
22
|
type: 'ReactNode',
|
|
23
|
-
description:
|
|
23
|
+
description:
|
|
24
|
+
'Icon element rendered inside the button. An Astryx Icon with no explicit size defaults to sm for sm/md buttons and md for lg buttons.',
|
|
24
25
|
required: true,
|
|
25
26
|
slotElements: [{__element: 'Icon', props: {icon: 'check'}}],
|
|
26
27
|
},
|
|
@@ -46,19 +47,22 @@ export const docs = {
|
|
|
46
47
|
{
|
|
47
48
|
name: 'isLoading',
|
|
48
49
|
type: 'boolean',
|
|
49
|
-
description:
|
|
50
|
+
description:
|
|
51
|
+
'Shows a loading spinner and blocks re-activation while staying focusable (aria-busy + aria-disabled, not native disabled).',
|
|
50
52
|
default: 'false',
|
|
51
53
|
},
|
|
52
54
|
{
|
|
53
55
|
name: 'isDisabled',
|
|
54
56
|
type: 'boolean',
|
|
55
|
-
description:
|
|
57
|
+
description:
|
|
58
|
+
'Disables the button. When a tooltip is present, uses aria-disabled instead of native disabled so the button stays focusable.',
|
|
56
59
|
default: 'false',
|
|
57
60
|
},
|
|
58
61
|
{
|
|
59
62
|
name: 'tooltip',
|
|
60
63
|
type: 'string',
|
|
61
|
-
description:
|
|
64
|
+
description:
|
|
65
|
+
"Tooltip text shown on hover and keyboard focus. It also describes the button, unless it repeats the button's accessible name.",
|
|
62
66
|
},
|
|
63
67
|
{
|
|
64
68
|
name: 'onClick',
|
|
@@ -70,10 +74,69 @@ export const docs = {
|
|
|
70
74
|
type: '(e: MouseEvent) => void | Promise<void>',
|
|
71
75
|
description: 'Async click handler with automatic loading state.',
|
|
72
76
|
},
|
|
77
|
+
{
|
|
78
|
+
name: 'isInterruptible',
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
description:
|
|
81
|
+
'Keep the button clickable while a clickAction is pending: the spinner and aria-busy still show, but the button is not disabled and the action is not deduped, so a re-click lands and interrupts the in-flight action with a fresh one. Use it for interruptible actions, not fire-once actions (submit, save, pay).',
|
|
82
|
+
default: 'false',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'width',
|
|
86
|
+
type: 'SizeValue',
|
|
87
|
+
description:
|
|
88
|
+
'Width of the button. Numbers are treated as pixels, strings are used as-is. Without it the button keeps its icon-only aspect, square by default; with it the button takes that width.',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'type',
|
|
92
|
+
type: "'button' | 'submit' | 'reset'",
|
|
93
|
+
description: 'HTML button type attribute.',
|
|
94
|
+
default: "'button'",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'name',
|
|
98
|
+
type: 'string',
|
|
99
|
+
description: 'HTML name attribute for form submission.',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'value',
|
|
103
|
+
type: 'string | number | readonly string[]',
|
|
104
|
+
description: 'HTML value attribute for form submission.',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'form',
|
|
108
|
+
type: 'string',
|
|
109
|
+
description: 'Associates the button with a form element by ID.',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'href',
|
|
113
|
+
type: 'string',
|
|
114
|
+
description:
|
|
115
|
+
'When provided, renders the button as a link element (<a> or custom link component). A disabled IconButton still renders a <button>.',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'as',
|
|
119
|
+
type: 'ComponentType',
|
|
120
|
+
description:
|
|
121
|
+
'Custom link component to use when href is provided (e.g. Next.js Link).',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'target',
|
|
125
|
+
type: 'string',
|
|
126
|
+
description:
|
|
127
|
+
'HTML target attribute when rendered as a link (e.g. "_blank").',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'rel',
|
|
131
|
+
type: 'string',
|
|
132
|
+
description:
|
|
133
|
+
'HTML rel attribute when rendered as a link (e.g. "noopener noreferrer").',
|
|
134
|
+
},
|
|
73
135
|
],
|
|
74
136
|
|
|
75
137
|
usage: {
|
|
76
|
-
description:
|
|
138
|
+
description:
|
|
139
|
+
'A button that shows only an icon with no visible text. Use IconButton in toolbars, table rows, and compact UI where space is tight and the icon is universally understood.',
|
|
77
140
|
accessibility: [
|
|
78
141
|
{
|
|
79
142
|
name: 'Essential icon or spinner arc',
|
|
@@ -113,26 +176,68 @@ export const docs = {
|
|
|
113
176
|
},
|
|
114
177
|
],
|
|
115
178
|
bestPractices: [
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
179
|
+
{
|
|
180
|
+
guidance: true,
|
|
181
|
+
description:
|
|
182
|
+
'Make the aria-label specific: a trash icon labeled "Delete conversation" is clearer than just "Delete" for screen readers.',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
guidance: true,
|
|
186
|
+
description:
|
|
187
|
+
'Add a tooltip: even a gear icon can mean Settings, Preferences, or Configure.',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
guidance: true,
|
|
191
|
+
description:
|
|
192
|
+
'Use ghost in toolbars and dense areas to reduce visual clutter.',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
guidance: false,
|
|
196
|
+
description:
|
|
197
|
+
"Use IconButton if the action isn't obvious from the icon alone; use Button with text.",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
guidance: false,
|
|
201
|
+
description:
|
|
202
|
+
'Skip the tooltip; label only reaches screen readers, sighted users need the hover hint.',
|
|
203
|
+
},
|
|
121
204
|
],
|
|
122
205
|
},
|
|
123
206
|
};
|
|
124
207
|
|
|
125
208
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
126
209
|
export const docsDense = {
|
|
127
|
-
description:
|
|
210
|
+
description:
|
|
211
|
+
'Button showing only an icon, no visible text. Use in toolbars, table rows, compact UI where space is tight + icon universally understood.',
|
|
128
212
|
usage: {
|
|
129
|
-
description:
|
|
213
|
+
description:
|
|
214
|
+
'Button showing only an icon, no visible text. Use in toolbars, table rows, compact UI where space is tight + icon universally understood.',
|
|
130
215
|
bestPractices: [
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
216
|
+
{
|
|
217
|
+
guidance: true,
|
|
218
|
+
description:
|
|
219
|
+
'Make aria-label specific: trash icon labeled "Delete conversation" > just "Delete" for screen readers.',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
guidance: true,
|
|
223
|
+
description:
|
|
224
|
+
'Add tooltip: even gear icon can mean Settings/Preferences/Configure.',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
guidance: true,
|
|
228
|
+
description:
|
|
229
|
+
'Use ghost in toolbars + dense areas to reduce visual clutter.',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
guidance: false,
|
|
233
|
+
description:
|
|
234
|
+
"Use IconButton if action isn't obvious from icon alone; use Button w/ text instead.",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
guidance: false,
|
|
238
|
+
description:
|
|
239
|
+
'Skip tooltip: label only reaches screen readers; sighted users need hover hint.',
|
|
240
|
+
},
|
|
136
241
|
],
|
|
137
242
|
},
|
|
138
243
|
propDescriptions: {
|
|
@@ -140,11 +245,26 @@ export const docsDense = {
|
|
|
140
245
|
icon: 'icon element rendered inside button; unsized Astryx Icon defaults to sm for sm/md buttons and md for lg',
|
|
141
246
|
variant: 'visual style variant',
|
|
142
247
|
size: 'size variant',
|
|
143
|
-
elevation:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
248
|
+
elevation:
|
|
249
|
+
'resting shadow depth: none|low|med|high; raise for a floating action button (FAB)',
|
|
250
|
+
isLoading:
|
|
251
|
+
'shows loading spinner, blocks re-activation but stays focusable (aria-disabled, not native disabled)',
|
|
252
|
+
isDisabled: 'disables button; uses aria-disabled when tooltip present',
|
|
253
|
+
tooltip:
|
|
254
|
+
'tooltip on hover + keyboard focus; also describes the button unless it repeats the accessible name',
|
|
147
255
|
onClick: 'standard click handler',
|
|
148
256
|
clickAction: 'async click handler w/ automatic loading state',
|
|
257
|
+
isInterruptible:
|
|
258
|
+
'keeps button clickable while clickAction pending; a re-click interrupts it. Not for fire-once actions (submit/save/pay)',
|
|
259
|
+
width:
|
|
260
|
+
'button width; numbers=pixels, strings=as-is; without it keeps the icon-only aspect (square by default)',
|
|
261
|
+
type: 'HTML button type; defaults to "button"',
|
|
262
|
+
name: 'HTML name for form submission',
|
|
263
|
+
value: 'HTML value for form submission',
|
|
264
|
+
form: 'associates button with form element by ID',
|
|
265
|
+
href: 'renders as a link; a disabled IconButton stays a <button>',
|
|
266
|
+
as: 'custom link component used with href',
|
|
267
|
+
target: 'HTML target when rendered as a link',
|
|
268
|
+
rel: 'HTML rel when rendered as a link',
|
|
149
269
|
},
|
|
150
270
|
};
|
package/src/InfoTip/InfoTip.tsx
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file InfoTip.tsx
|
|
7
|
-
* @input Uses React, StyleX,
|
|
8
|
-
* touch hit area, color/spacing/radius/duration/ease tokens
|
|
7
|
+
* @input Uses React, StyleX, useTooltip, Icon, useComponentTranslator, the
|
|
8
|
+
* shared touch hit area, color/spacing/radius/duration/ease tokens
|
|
9
9
|
* @output Exports InfoTip component, InfoTipProps, InfoTipSize types
|
|
10
10
|
* @position Core implementation; consumed by index.ts, tested by
|
|
11
11
|
* InfoTip.test.tsx; `@astryxdesign/lab` re-exports it, deprecated
|
|
@@ -17,13 +17,21 @@
|
|
|
17
17
|
* - /packages/core/src/InfoTip/index.ts (exports if types change)
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
useCallback,
|
|
22
|
+
useState,
|
|
23
|
+
type MouseEvent,
|
|
24
|
+
type PointerEvent,
|
|
25
|
+
type ReactNode,
|
|
26
|
+
type Ref,
|
|
27
|
+
} from 'react';
|
|
21
28
|
import * as stylex from '@stylexjs/stylex';
|
|
22
29
|
|
|
23
30
|
import type {BaseProps} from '../BaseProps';
|
|
24
31
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
25
32
|
import {Icon, type IconSize} from '../Icon/Icon';
|
|
26
|
-
import {
|
|
33
|
+
import {stopInReactTree} from '../Layer/layerClickBoundary';
|
|
34
|
+
import {useTooltip} from '../Tooltip/useTooltip';
|
|
27
35
|
import {
|
|
28
36
|
registerEnglishFallback,
|
|
29
37
|
useComponentTranslator,
|
|
@@ -122,9 +130,9 @@ const styles = stylex.create({
|
|
|
122
130
|
* labels, values, and metrics for permission notes, metric definitions, and
|
|
123
131
|
* field help.
|
|
124
132
|
*
|
|
125
|
-
* InfoTip is a
|
|
126
|
-
* announces, and closes the help. The info icon
|
|
127
|
-
* the icon registry, so themes can replace it.
|
|
133
|
+
* InfoTip is a named button that toggles `useTooltip`'s `show()` and `hide()`:
|
|
134
|
+
* the hook previews, holds, announces, and closes the help. The info icon
|
|
135
|
+
* resolves from the icon registry, so themes can replace it.
|
|
128
136
|
*
|
|
129
137
|
* @example
|
|
130
138
|
* ```
|
|
@@ -151,22 +159,69 @@ export function InfoTip({
|
|
|
151
159
|
}
|
|
152
160
|
return watchHitArea(button, insets => writeHitInsets(button, insets));
|
|
153
161
|
}, []);
|
|
154
|
-
|
|
162
|
+
// Whether a press pinned the help. A hover or focus preview is not pinned.
|
|
163
|
+
const [isPinned, setIsPinned] = useState(false);
|
|
164
|
+
// Whether the help shows, pinned or previewed: the button names it in
|
|
165
|
+
// `aria-controls` only then.
|
|
166
|
+
const [isShown, setIsShown] = useState(false);
|
|
167
|
+
const handleShow = useCallback(() => setIsShown(true), []);
|
|
168
|
+
// Every close ends the pin: a second press, Escape, a press outside, or
|
|
169
|
+
// focus leaving.
|
|
170
|
+
const handleHide = useCallback(() => {
|
|
171
|
+
setIsShown(false);
|
|
172
|
+
setIsPinned(false);
|
|
173
|
+
}, []);
|
|
174
|
+
const tooltip = useTooltip({onShow: handleShow, onHide: handleHide});
|
|
175
|
+
const mergedRef = useMergedRefs(ref, watchButtonHitArea, tooltip.ref);
|
|
176
|
+
|
|
177
|
+
// A primary mouse or pen press on a preview calls show() first. The hook's
|
|
178
|
+
// press-to-close then leaves it open. The click pins it.
|
|
179
|
+
const handlePointerDownCapture = useCallback(
|
|
180
|
+
(event: PointerEvent<HTMLButtonElement>) => {
|
|
181
|
+
if (
|
|
182
|
+
event.button !== 0 ||
|
|
183
|
+
event.pointerType === 'touch' ||
|
|
184
|
+
isPinned ||
|
|
185
|
+
!isShown
|
|
186
|
+
) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
tooltip.show();
|
|
190
|
+
},
|
|
191
|
+
[isPinned, isShown, tooltip],
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
// A click, tap, Enter, or Space pins the help, and the next one closes it.
|
|
195
|
+
// The press stops at the button: a clickable row, card, or label around it
|
|
196
|
+
// does nothing, and document listeners still see it.
|
|
197
|
+
const handleClick = useCallback(
|
|
198
|
+
(event: MouseEvent<HTMLButtonElement>) => {
|
|
199
|
+
stopInReactTree(event);
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
if (isPinned) {
|
|
202
|
+
tooltip.hide();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
tooltip.show();
|
|
206
|
+
setIsPinned(true);
|
|
207
|
+
},
|
|
208
|
+
[isPinned, tooltip],
|
|
209
|
+
);
|
|
155
210
|
|
|
156
|
-
// No Escape handler of its own.
|
|
211
|
+
// No Escape handler of its own. The tooltip's entry in the shared dismissal
|
|
157
212
|
// stack takes Escape, so one press never closes both the help and an
|
|
158
213
|
// enclosing Dialog.
|
|
159
214
|
return (
|
|
160
|
-
|
|
161
|
-
content={content}
|
|
162
|
-
// The tooltip is the button's only purpose. A click, a tap, Enter, or
|
|
163
|
-
// Space pins it open, and the press stops at the button. So an InfoTip's
|
|
164
|
-
// content is reachable on a phone and from the keyboard alike.
|
|
165
|
-
triggerBehavior="toggle">
|
|
215
|
+
<>
|
|
166
216
|
<button
|
|
167
217
|
ref={mergedRef}
|
|
168
218
|
type="button"
|
|
169
219
|
aria-label={label ?? t('@astryx.infoTip.label')}
|
|
220
|
+
aria-describedby={tooltip.describedBy}
|
|
221
|
+
aria-expanded={isPinned}
|
|
222
|
+
aria-controls={isShown ? tooltip.describedBy : undefined}
|
|
223
|
+
onPointerDownCapture={handlePointerDownCapture}
|
|
224
|
+
onClick={handleClick}
|
|
170
225
|
{...mergeProps(
|
|
171
226
|
stylex.props(
|
|
172
227
|
focusOutlineStyles.focusVisible,
|
|
@@ -179,7 +234,8 @@ export function InfoTip({
|
|
|
179
234
|
)}>
|
|
180
235
|
<Icon icon="info" size={size} />
|
|
181
236
|
</button>
|
|
182
|
-
|
|
237
|
+
{tooltip.renderTooltip(content)}
|
|
238
|
+
</>
|
|
183
239
|
);
|
|
184
240
|
}
|
|
185
241
|
|
|
@@ -237,6 +237,8 @@ export function useSwipeAction({
|
|
|
237
237
|
reducedMotionRef.current = isReducedMotion;
|
|
238
238
|
});
|
|
239
239
|
|
|
240
|
+
// Releases the settle timer, the animation frame and the pinch watch on
|
|
241
|
+
// unmount.
|
|
240
242
|
useEffect(
|
|
241
243
|
() => () => {
|
|
242
244
|
if (settleTimerRef.current != null) {
|
package/src/Layer/modalOutlet.ts
CHANGED
|
@@ -188,6 +188,8 @@ export function useModalOutlet(
|
|
|
188
188
|
const isLatestRef = useRef(isLatest);
|
|
189
189
|
isLatestRef.current = isLatest;
|
|
190
190
|
const suppliedRef = useRef<HTMLDialogElement | null>(null);
|
|
191
|
+
// Syncs the module registry of modal outlets with this dialog while it is
|
|
192
|
+
// active. It also follows the dialog's native `close` event.
|
|
191
193
|
useEffect(() => {
|
|
192
194
|
const element = ref.current;
|
|
193
195
|
if (!isActive || element == null) {
|
package/src/Layer/useLayer.tsx
CHANGED
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
import {preserveAnimations} from './preserveAnimations';
|
|
58
58
|
import {useLayerContext} from './LayerContext';
|
|
59
59
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
60
|
-
import {overlayPaddingReset} from '../Layout/
|
|
60
|
+
import {overlayPaddingReset} from '../Layout/overlayPaddingReset.stylex';
|
|
61
61
|
|
|
62
62
|
const styles = stylex.create({
|
|
63
63
|
// Base reset for all layers
|
|
@@ -1560,6 +1560,8 @@ function useLayerImplementation(
|
|
|
1560
1560
|
forgetDismissalRef.current = forget;
|
|
1561
1561
|
}, []);
|
|
1562
1562
|
|
|
1563
|
+
// Syncs the document's capture-phase gesture tracking with this mount.
|
|
1564
|
+
// Unmount forgets the layer's dismissal.
|
|
1563
1565
|
useEffect(() => {
|
|
1564
1566
|
// Install capture-phase gesture tracking before the first interaction.
|
|
1565
1567
|
currentGesture();
|
|
@@ -155,6 +155,8 @@ export function useLayerDismissal(
|
|
|
155
155
|
|
|
156
156
|
const isRegistered = isActive && isEnabled;
|
|
157
157
|
|
|
158
|
+
// Syncs the shared dismissal stack with `isRegistered`. A registered layer
|
|
159
|
+
// gets Escape and outside presses in stack order.
|
|
158
160
|
useEffect(() => {
|
|
159
161
|
if (!isRegistered) {
|
|
160
162
|
wasRegisteredRef.current = false;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @output Exports useTouchTrigger hook, isActionTrigger, LayerTouchTrigger type,
|
|
9
9
|
* tapLandsOnDisabledControl, TOUCH_POINTER_TYPES and useTapStop (internal:
|
|
10
10
|
* not re-exported from index). Also useTouchTriggerInternal, with the
|
|
11
|
-
* outside dismissal's arm for
|
|
11
|
+
* outside dismissal's arm for useTooltip's hold (Core-internal).
|
|
12
12
|
* @position Layer hook; shared touch behavior for useTooltip and useHoverCard
|
|
13
13
|
*
|
|
14
14
|
* SYNC: When modified, update:
|
|
@@ -283,8 +283,8 @@ export interface UseTouchTriggerReturn {
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
|
-
* useTouchTrigger's return plus the outside dismissal's arm, for
|
|
287
|
-
*
|
|
286
|
+
* useTouchTrigger's return plus the outside dismissal's arm, for useTooltip's
|
|
287
|
+
* hold behind show() and hide(). Not exported from the Layer entry point.
|
|
288
288
|
*
|
|
289
289
|
* @internal
|
|
290
290
|
*/
|
|
@@ -292,7 +292,7 @@ export interface UseTouchTriggerInternalReturn extends UseTouchTriggerReturn {
|
|
|
292
292
|
/**
|
|
293
293
|
* Arms the outside dismissal a tap-open gets: a press that lifts outside
|
|
294
294
|
* the trigger and the layer, or a scroll that starts there, hides it. A
|
|
295
|
-
*
|
|
295
|
+
* hold arms it too.
|
|
296
296
|
*/
|
|
297
297
|
armOutsideDismiss: () => void;
|
|
298
298
|
}
|
|
@@ -328,13 +328,19 @@ export function useTouchTrigger(
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/**
|
|
331
|
-
* useTouchTrigger, plus the outside dismissal's arm that
|
|
332
|
-
* close on a press or scroll outside.
|
|
331
|
+
* useTouchTrigger, plus the outside dismissal's arm that useTooltip's hold
|
|
332
|
+
* uses to close on a press or scroll outside.
|
|
333
333
|
*
|
|
334
334
|
* @internal
|
|
335
335
|
*/
|
|
336
336
|
export function useTouchTriggerInternal(
|
|
337
337
|
options: UseTouchTriggerOptions,
|
|
338
|
+
/**
|
|
339
|
+
* Called when a press that the outside dismissal watches ends with its
|
|
340
|
+
* pointer lifted inside the layer: the layer stays open, and useTooltip
|
|
341
|
+
* ends a hold that the press started.
|
|
342
|
+
*/
|
|
343
|
+
onReleaseInLayer?: () => void,
|
|
338
344
|
): UseTouchTriggerInternalReturn {
|
|
339
345
|
const {
|
|
340
346
|
touchTrigger,
|
|
@@ -359,6 +365,8 @@ export function useTouchTriggerInternal(
|
|
|
359
365
|
hideRef.current = hide;
|
|
360
366
|
const layerIdRef = useRef(layerId);
|
|
361
367
|
layerIdRef.current = layerId;
|
|
368
|
+
const onReleaseInLayerRef = useRef(onReleaseInLayer);
|
|
369
|
+
onReleaseInLayerRef.current = onReleaseInLayer;
|
|
362
370
|
|
|
363
371
|
// Whether a tap is what opened the layer. Only a tap-open owes the user an
|
|
364
372
|
// outside-tap dismissal: a hover-opened layer already closes on
|
|
@@ -421,6 +429,9 @@ export function useTouchTriggerInternal(
|
|
|
421
429
|
doc.getElementById(layerIdRef.current)?.contains(target) === true,
|
|
422
430
|
)
|
|
423
431
|
) {
|
|
432
|
+
if (event.type === 'pointerup') {
|
|
433
|
+
onReleaseInLayerRef.current?.();
|
|
434
|
+
}
|
|
424
435
|
return;
|
|
425
436
|
}
|
|
426
437
|
}
|
|
@@ -436,7 +447,9 @@ export function useTouchTriggerInternal(
|
|
|
436
447
|
}
|
|
437
448
|
}, [triggerRef, disarmOutsideDismiss]);
|
|
438
449
|
|
|
450
|
+
// Releases the outside-dismiss listener on unmount.
|
|
439
451
|
useEffect(() => disarmOutsideDismiss, [disarmOutsideDismiss]);
|
|
452
|
+
// Releases a pending tap on unmount.
|
|
440
453
|
useEffect(() => () => forgetPendingTapRef.current?.(), []);
|
|
441
454
|
|
|
442
455
|
const isTouchInteraction = useCallback(
|
package/src/Layout/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type {
|
|
|
21
21
|
|
|
22
22
|
// Overlay padding-variable reset (applied on overlay roots so the container
|
|
23
23
|
// padding system does not cross a fixed/top-layer boundary)
|
|
24
|
-
export {overlayPaddingReset} from './
|
|
24
|
+
export {overlayPaddingReset} from './overlayPaddingReset.stylex';
|
|
25
25
|
|
|
26
26
|
// Edge compensation utility
|
|
27
27
|
export {edgeCompSlot, EDGE_COMP_ATTR} from './edgeCompensation.stylex';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file overlayPaddingReset.stylex.ts
|
|
5
|
+
* @input Uses @stylexjs/stylex
|
|
6
|
+
* @output overlayPaddingReset: the container padding boundary at an overlay's root
|
|
7
|
+
* @position Layout utility, re-exported by padding.stylex.ts and Layout/index.ts.
|
|
8
|
+
* Its own module so an overlay's eager code (useLayer) imports it without
|
|
9
|
+
* padding.stylex.ts: a lazily loaded overlay that uses the container padding
|
|
10
|
+
* styles there then keeps them out of the eager chunk it shares with this
|
|
11
|
+
* module.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import * as stylex from '@stylexjs/stylex';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Padding-variable reset for overlay roots (Dialog, BottomSheet, Drawer,
|
|
18
|
+
* MobileNav, Lightbox, and every layer surface).
|
|
19
|
+
*
|
|
20
|
+
* ## Why an overlay needs this
|
|
21
|
+
*
|
|
22
|
+
* The container padding system talks to descendants through inherited custom
|
|
23
|
+
* properties: a padded container announces its padding, and children read the
|
|
24
|
+
* value either to apply it or to cancel it with a negative margin
|
|
25
|
+
* (`Section`, `Divider`, `Layout`, `Table`).
|
|
26
|
+
*
|
|
27
|
+
* Inheritance follows the DOM, but an overlay leaves its parent's visual box —
|
|
28
|
+
* a fixed/top-layer `<dialog>` is a DOM descendant of the padded page while
|
|
29
|
+
* being nowhere near it on screen. It inherits values describing padding that
|
|
30
|
+
* is not there, and its content compensates against phantom space: a `Section`
|
|
31
|
+
* inside a 640px sheet rendered 672px wide and hung off both edges.
|
|
32
|
+
*
|
|
33
|
+
* Two families leak, and they need opposite treatments:
|
|
34
|
+
*
|
|
35
|
+
* - `--container-padding-*` -> `0px`. Descendants SUBTRACT these (bleed
|
|
36
|
+
* margins). The overlay root has no padding of its own to escape, so the
|
|
37
|
+
* honest answer is zero. Nested containers that do set padding (a Dialog's
|
|
38
|
+
* content wrapper) re-announce their own values below this point, so
|
|
39
|
+
* legitimate edge-to-edge bleed inside the overlay is unaffected.
|
|
40
|
+
* - `--layout-padding-*` and `--_section-padding-propagated` -> `initial`.
|
|
41
|
+
* Descendants ADD these, so zeroing them would strip padding rather than
|
|
42
|
+
* restore it. `initial` makes each guaranteed-invalid, so readers fall
|
|
43
|
+
* through their own `var(…, fallback)` chain and land on the theme default —
|
|
44
|
+
* which is what an overlay at the top of the tree should show.
|
|
45
|
+
*
|
|
46
|
+
* `initial` is also why propagation moved off `--astryx-section-padding`: that
|
|
47
|
+
* name is public theme surface, set at the theme root, and making it invalid
|
|
48
|
+
* here would blank the theme's own section padding inside every overlay.
|
|
49
|
+
*
|
|
50
|
+
* Apply on the overlay's outermost styled element.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```
|
|
54
|
+
* <dialog {...stylex.props(styles.dialog, overlayPaddingReset.reset)} />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export const overlayPaddingReset = stylex.create({
|
|
58
|
+
reset: {
|
|
59
|
+
// Subtracted by descendants — the overlay root has no padding to escape.
|
|
60
|
+
'--container-padding-inline-start': '0px',
|
|
61
|
+
'--container-padding-inline-end': '0px',
|
|
62
|
+
'--container-padding-block-start': '0px',
|
|
63
|
+
'--container-padding-block-end': '0px',
|
|
64
|
+
// Added by descendants — fall through to each reader's own default.
|
|
65
|
+
'--layout-padding-outer-x': 'initial',
|
|
66
|
+
'--layout-padding-outer-y': 'initial',
|
|
67
|
+
'--layout-padding-own-outer-x': 'initial',
|
|
68
|
+
'--layout-padding-own-outer-y': 'initial',
|
|
69
|
+
'--layout-padding-inner-x': 'initial',
|
|
70
|
+
'--layout-padding-inner-y': 'initial',
|
|
71
|
+
'--_section-padding-propagated': 'initial',
|
|
72
|
+
},
|
|
73
|
+
});
|