@astryxdesign/core 0.7.5 → 0.7.6-canary.00507ba
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 +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +5 -5
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +183 -5
- package/dist/AppShell/observeMainOverflow.d.ts +9 -0
- package/dist/AppShell/observeMainOverflow.d.ts.map +1 -0
- package/dist/AppShell/observeMainOverflow.js +125 -0
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +12 -3
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +7 -1
- package/dist/BottomSheet/BottomSheet.js +1 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +2 -1
- package/dist/BottomSheet/useSheetGestures.d.ts +12 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +30 -3
- package/dist/Button/Button.js +4 -4
- package/dist/Carousel/Carousel.d.ts +3 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +12 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +6 -5
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +37 -4
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +12 -4
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +101 -15
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +8 -3
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts +5 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +23 -12
- package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeTimeSegment.js +5 -4
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +4 -3
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +34 -9
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +5 -4
- package/dist/Divider/Divider.d.ts.map +1 -1
- package/dist/Divider/Divider.js +2 -1
- package/dist/Drawer/Drawer.d.ts +1 -0
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +7 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +7 -3
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +6 -5
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +20 -2
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +31 -3
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +21 -16
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +2 -1
- package/dist/Field/FieldLabel.d.ts +1 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +4 -4
- package/dist/Field/InputClearButton.js +3 -3
- package/dist/Field/PanelSearchInput.js +2 -2
- package/dist/FieldStatus/FieldStatus.js +2 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +7 -1
- package/dist/Heading/Heading.js +1 -1
- package/dist/Icon/Icon.js +1 -1
- package/dist/Indicator/CheckIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckIndicator.js +2 -1
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckboxIndicator.js +3 -1
- package/dist/Indicator/RadioIndicator.d.ts.map +1 -1
- package/dist/Indicator/RadioIndicator.js +3 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +2 -1
- package/dist/Item/ItemSwipeLayer.js +1 -1
- package/dist/Layer/popoverOperations.d.ts +27 -0
- package/dist/Layer/popoverOperations.d.ts.map +1 -0
- package/dist/Layer/popoverOperations.js +159 -0
- package/dist/Layer/useLayer.d.ts +1 -1
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +93 -59
- package/dist/Layout/Layout.js +1 -1
- package/dist/Layout/LayoutContent.js +1 -1
- package/dist/Layout/LayoutFooter.js +1 -1
- package/dist/Layout/LayoutHeader.js +1 -1
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +5 -0
- package/dist/Lightbox/LightboxViewport.a11y.browser.spec.js +5 -4
- package/dist/List/List.js +1 -1
- package/dist/List/ListItem.js +3 -3
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +7 -2
- package/dist/MultiSelector/CreateRow.a11y.chromium.spec.js +7 -6
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +26 -10
- package/dist/NumberInput/NumberInput.d.ts +3 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +3 -3
- package/dist/NumberInput/numberParser.d.ts +3 -0
- package/dist/NumberInput/numberParser.d.ts.map +1 -1
- package/dist/NumberInput/numberParser.js +7 -44
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +16 -12
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +28 -2
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +4 -1
- package/dist/Selector/useSelectorPresentation.d.ts +8 -1
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
- package/dist/Selector/useSelectorPresentation.js +20 -4
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +10 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +3 -3
- package/dist/Stack/Stack.js +1 -1
- package/dist/Stack/StackItem.js +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +16 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +9 -1
- package/dist/Text/Text.js +1 -1
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +23 -5
- package/dist/TextArea/TextArea.d.ts +1 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +13 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +3 -3
- package/dist/TimeInput/TimeInput.d.ts +6 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +21 -14
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +5 -4
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +2 -2
- package/dist/Timestamp/TimestampHoverCard.js +4 -4
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +60 -20
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +82 -51
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +13 -2
- package/dist/Tokenizer/TokenizerBottomSheet.js +3 -3
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +2 -1
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +3 -0
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +1 -0
- package/dist/Typeahead/Typeahead.d.ts +1 -1
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +9 -1
- package/dist/astryx.css +21 -4
- package/dist/gestures/GestureArena.d.ts +6 -0
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +39 -0
- package/dist/gestures/GestureHost.d.ts +352 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -0
- package/dist/gestures/GestureHost.js +1773 -0
- package/dist/gestures/GestureRecognizer.d.ts +10 -0
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +16 -0
- package/dist/gestures/LongPressGestureRecognizer.d.ts +1 -0
- package/dist/gestures/LongPressGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/LongPressGestureRecognizer.js +3 -0
- package/dist/gestures/PanGestureRecognizer.d.ts +1 -0
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +3 -0
- package/dist/gestures/PinchGestureRecognizer.d.ts +31 -0
- package/dist/gestures/PinchGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/PinchGestureRecognizer.js +128 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +71 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.js +223 -0
- package/dist/gestures/SwipeGestureRecognizer.d.ts +37 -0
- package/dist/gestures/SwipeGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/SwipeGestureRecognizer.js +148 -0
- package/dist/gestures/TapGestureRecognizer.d.ts +1 -0
- package/dist/gestures/TapGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/TapGestureRecognizer.js +3 -0
- package/dist/gestures/VelocityTracker.d.ts +6 -2
- package/dist/gestures/VelocityTracker.d.ts.map +1 -1
- package/dist/gestures/VelocityTracker.js +7 -3
- package/dist/gestures/haptics.d.ts +65 -0
- package/dist/gestures/haptics.d.ts.map +1 -0
- package/dist/gestures/haptics.js +182 -0
- package/dist/gestures/nativeScroll.d.ts +42 -0
- package/dist/gestures/nativeScroll.d.ts.map +1 -0
- package/dist/gestures/nativeScroll.js +228 -0
- package/dist/gestures/touchAction.d.ts +60 -0
- package/dist/gestures/touchAction.d.ts.map +1 -0
- package/dist/gestures/touchAction.js +157 -0
- package/dist/gestures/touchActionRule.d.ts +34 -0
- package/dist/gestures/touchActionRule.d.ts.map +1 -0
- package/dist/gestures/touchActionRule.js +140 -0
- package/dist/gestures/types.d.ts +18 -7
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/types.js +22 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/modalAnnounce.d.ts.map +1 -1
- package/dist/hooks/modalAnnounce.js +107 -61
- package/dist/hooks/scrollKeyboardDelegation.d.ts.map +1 -1
- package/dist/hooks/scrollKeyboardDelegation.js +7 -3
- package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -1
- package/dist/hooks/useAdaptivePresentation.js +4 -1
- package/dist/hooks/useAnnounce.d.ts +101 -42
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +161 -75
- package/dist/hooks/useAnnounceRenderedText.d.ts +11 -3
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +5 -3
- package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
- package/dist/hooks/useBusyAnnouncement.js +6 -12
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +12 -1
- package/dist/hooks/useScrollOverflow.d.ts +2 -1
- package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
- package/dist/hooks/useScrollOverflow.js +56 -10
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +6 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +6 -0
- package/dist/motion/animator.d.ts +7 -1
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +119 -27
- package/dist/theme/defineTheme.d.ts +19 -5
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +64 -4
- package/dist/theme/domainTokens/domainTokenDefaults.d.ts +3 -0
- package/dist/theme/domainTokens/domainTokenDefaults.d.ts.map +1 -0
- package/dist/theme/domainTokens/domainTokenDefaults.js +19 -0
- package/dist/theme/domainTokens/index.d.ts +5 -4
- package/dist/theme/domainTokens/index.d.ts.map +1 -1
- package/dist/theme/domainTokens/index.js +5 -9
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/motionKnobs.d.ts +56 -0
- package/dist/theme/motionKnobs.d.ts.map +1 -0
- package/dist/theme/motionKnobs.js +48 -0
- package/dist/theme/resolveThemeValues.d.ts +11 -4
- package/dist/theme/resolveThemeValues.d.ts.map +1 -1
- package/dist/theme/resolveThemeValues.js +40 -4
- package/dist/theme/themeAdaptations.d.ts +7 -3
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +36 -7
- package/dist/theme/themeMotion.d.ts +96 -0
- package/dist/theme/themeMotion.d.ts.map +1 -0
- package/dist/theme/themeMotion.js +177 -0
- package/dist/theme/tokenReferences.d.ts +31 -0
- package/dist/theme/tokenReferences.d.ts.map +1 -0
- package/dist/theme/tokenReferences.js +132 -0
- package/dist/theme/tokens.d.ts +1 -0
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +9 -129
- package/dist/theme/tokens.stylex.d.ts +12 -0
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +12 -0
- package/dist/utils/focusReturn.d.ts +17 -1
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +11 -4
- package/dist/utils/getNodeText.d.ts +8 -0
- package/dist/utils/getNodeText.d.ts.map +1 -0
- package/dist/utils/getNodeText.js +37 -0
- package/dist/utils/interactionModality.d.ts +11 -2
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +58 -5
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +17 -8
- package/dist/utils/plainDate.d.ts +2 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +46 -3
- package/dist/utils/presentation.d.ts +50 -0
- package/dist/utils/presentation.d.ts.map +1 -0
- package/dist/utils/presentation.js +125 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +20 -1
- package/dist/utils/primaryClick.d.ts +11 -0
- package/dist/utils/primaryClick.d.ts.map +1 -0
- package/dist/utils/primaryClick.js +25 -0
- package/dist/utils/sharedMutationObserver.d.ts +19 -11
- package/dist/utils/sharedMutationObserver.d.ts.map +1 -1
- package/dist/utils/sharedMutationObserver.js +66 -26
- package/dist/utils/timeFormat.d.ts +47 -0
- package/dist/utils/timeFormat.d.ts.map +1 -0
- package/dist/utils/timeFormat.js +240 -0
- package/dist/utils/touchPresentation.d.ts.map +1 -1
- package/dist/utils/touchPresentation.js +5 -3
- package/dist/utils/touchPresentation.stylex.d.ts +15 -0
- package/dist/utils/touchPresentation.stylex.d.ts.map +1 -0
- package/dist/utils/touchPresentation.stylex.js +33 -0
- package/dist/utils/unicodeDigits.d.ts +20 -0
- package/dist/utils/unicodeDigits.d.ts.map +1 -0
- package/dist/utils/unicodeDigits.js +70 -0
- package/locales/en.json +27 -3
- package/locales/pseudo.json +18 -0
- package/package.json +5 -4
- package/src/AlertDialog/AlertDialog.tsx +6 -5
- package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +18 -6
- package/src/AppShell/AppShell.doc.mjs +1 -1
- package/src/AppShell/AppShell.spec.md +9 -12
- package/src/AppShell/AppShell.test.tsx +164 -2
- package/src/AppShell/AppShell.tsx +225 -5
- package/src/AppShell/__tests__/AppShellMainKeyboard.a11y.browser.spec.ts +534 -0
- package/src/AppShell/observeMainOverflow.test.ts +173 -0
- package/src/AppShell/observeMainOverflow.ts +143 -0
- package/src/Avatar/Avatar.spec.md +22 -22
- package/src/Avatar/Avatar.tsx +18 -1
- package/src/Avatar/__tests__/AvatarForcedColors.a11y.chromium.spec.ts +126 -0
- package/src/Badge/Badge.doc.mjs +1 -1
- package/src/Badge/Badge.tsx +19 -2
- package/src/Badge/__tests__/BadgeLargerText.a11y.chromium.spec.ts +260 -0
- package/src/BottomSheet/BottomSheet.test.tsx +46 -0
- package/src/BottomSheet/BottomSheet.tsx +1 -1
- package/src/BottomSheet/BottomSheetPanel.tsx +2 -1
- package/src/BottomSheet/useSheetGestures.test.ts +52 -0
- package/src/BottomSheet/useSheetGestures.ts +37 -6
- package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts +18 -6
- package/src/Button/Button.tsx +4 -4
- package/src/Calendar/Calendar.spec.md +87 -48
- package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +21 -7
- package/src/Carousel/Carousel.doc.mjs +1 -1
- package/src/Carousel/Carousel.spec.md +9 -9
- package/src/Carousel/Carousel.test.tsx +124 -3
- package/src/Carousel/Carousel.tsx +10 -2
- package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +21 -7
- package/src/Carousel/__tests__/Carousel.a11y.known-failures.ts +1 -16
- package/src/Chat/ChatComposerTokenElement.spec.md +45 -33
- package/src/CheckboxInput/CheckboxInput.tsx +6 -5
- package/src/ClickableCard/ClickableCard.test.tsx +96 -0
- package/src/ClickableCard/ClickableCard.tsx +48 -4
- package/src/Collapsible/Collapsible.spec.md +2 -0
- package/src/Collapsible/CollapsibleGroup.spec.md +57 -29
- package/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts +18 -7
- package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +18 -6
- package/src/ComplexSelector/ComplexSelector.test.tsx +37 -0
- package/src/ContextMenu/ContextMenu.test.tsx +35 -0
- package/src/DateInput/DateInput.test.tsx +115 -3
- package/src/DateInput/DateInput.tsx +29 -14
- package/src/DateInput/DateInputTouch.test.tsx +76 -0
- package/src/DateInput/MonthScroller.tsx +106 -20
- package/src/DateInput/MonthScrollerSettle.test.tsx +165 -0
- package/src/DateInput/TouchDateField.tsx +14 -3
- package/src/DateInput/__tests__/MonthScrollerSteps.interaction.browser.spec.ts +312 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +46 -3
- package/src/DateRangeInput/DateRangeInput.tsx +16 -12
- package/src/DateTimeInput/DateTimeInput.doc.mjs +10 -8
- package/src/DateTimeInput/DateTimeInput.spec.md +75 -51
- package/src/DateTimeInput/DateTimeInput.test.tsx +81 -0
- package/src/DateTimeInput/DateTimeInput.tsx +46 -24
- package/src/DateTimeInput/NativeTimeSegment.tsx +4 -6
- package/src/DateTimeInput/TouchDateTimeField.tsx +3 -7
- package/src/Dialog/Dialog.test.tsx +216 -2
- package/src/Dialog/Dialog.tsx +42 -9
- package/src/Dialog/DialogHeader.tsx +5 -4
- package/src/Dialog/__tests__/DialogSecondDocument.a11y.browser.spec.ts +202 -0
- package/src/Divider/Divider.tsx +2 -1
- package/src/Drawer/Drawer.spec.md +111 -80
- package/src/Drawer/Drawer.test.tsx +35 -0
- package/src/Drawer/Drawer.tsx +13 -2
- package/src/Drawer/DrawerHeader.spec.md +181 -0
- package/src/Drawer/__tests__/DrawerNonModalPageScroll.a11y.chromium.spec.ts +267 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +41 -0
- package/src/DropdownMenu/DropdownMenu.tsx +10 -3
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +34 -0
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +6 -5
- package/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts +19 -7
- package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +21 -9
- package/src/DropdownMenu/lazyMenuBottomSheet.test.ts +60 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +36 -7
- package/src/DropdownMenu/renderDropdownItems.tsx +24 -19
- package/src/EmptyState/EmptyState.tsx +2 -1
- package/src/Field/FieldLabel.tsx +5 -4
- package/src/Field/InputClearButton.tsx +3 -3
- package/src/Field/PanelSearchInput.tsx +2 -2
- package/src/FieldStatus/FieldStatus.tsx +2 -2
- package/src/FileInput/FileInput.test.tsx +21 -0
- package/src/FileInput/FileInput.tsx +4 -1
- package/src/FormLayout/FormLayout.spec.md +7 -8
- package/src/Heading/Heading.tsx +1 -1
- package/src/Icon/Icon.tsx +1 -1
- package/src/Indicator/CheckIndicator.spec.md +47 -42
- package/src/Indicator/CheckIndicator.tsx +2 -1
- package/src/Indicator/CheckboxIndicator.spec.md +40 -37
- package/src/Indicator/CheckboxIndicator.tsx +3 -1
- package/src/Indicator/Indicator.spec.md +188 -0
- package/src/Indicator/RadioIndicator.tsx +3 -1
- package/src/Item/Item.tsx +2 -1
- package/src/Item/ItemSwipeLayer.tsx +1 -1
- package/src/Kbd/Kbd.spec.md +81 -38
- package/src/Layer/__tests__/LayerBrowserHide.a11y.chromium.spec.ts +126 -0
- package/src/Layer/popoverOperations.test.ts +205 -0
- package/src/Layer/popoverOperations.ts +172 -0
- package/src/Layer/useLayer.test.tsx +348 -1
- package/src/Layer/useLayer.tsx +118 -71
- package/src/Layout/Layout.spec.md +127 -131
- package/src/Layout/Layout.tsx +1 -1
- package/src/Layout/LayoutContent.spec.md +205 -0
- package/src/Layout/LayoutContent.tsx +1 -1
- package/src/Layout/LayoutFooter.spec.md +190 -0
- package/src/Layout/LayoutFooter.tsx +1 -1
- package/src/Layout/LayoutHeader.spec.md +193 -0
- package/src/Layout/LayoutHeader.tsx +1 -1
- package/src/Layout/LayoutPanel.spec.md +194 -0
- package/src/Layout/__tests__/Layout.a11y.chromium.spec.ts +18 -6
- package/src/Lightbox/Lightbox.test.tsx +18 -0
- package/src/Lightbox/Lightbox.tsx +5 -0
- package/src/Lightbox/LightboxViewport.a11y.browser.spec.ts +8 -4
- package/src/Link/__tests__/Link.a11y.chromium.spec.ts +18 -8
- package/src/List/List.tsx +1 -1
- package/src/List/ListItem.spec.md +205 -0
- package/src/List/ListItem.tsx +3 -3
- package/src/MetadataList/MetadataList.spec.md +187 -0
- package/src/MetadataList/MetadataListItem.spec.md +165 -0
- package/src/MobileNav/MobileNav.test.tsx +15 -0
- package/src/MobileNav/MobileNav.tsx +9 -1
- package/src/MobileNav/__tests__/MobileNavHeader.a11y.chromium.spec.ts +89 -0
- package/src/MoreMenu/MoreMenu.test.tsx +11 -0
- package/src/MultiSelector/CreateRow.a11y.chromium.spec.ts +7 -8
- package/src/MultiSelector/MultiSelector.spec.md +7 -4
- package/src/MultiSelector/MultiSelector.test.tsx +270 -1
- package/src/MultiSelector/MultiSelector.tsx +25 -10
- package/src/MultiSelector/__tests__/MultiSelector.listbox.a11y.test.tsx +8 -1
- package/src/NavMenu/NavHeadingMenu.spec.md +1 -5
- package/src/NumberInput/NumberInput.doc.mjs +13 -7
- package/src/NumberInput/NumberInput.spec.md +59 -37
- package/src/NumberInput/NumberInput.tsx +13 -3
- package/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts +102 -0
- package/src/NumberInput/numberParser.ts +7 -45
- package/src/ProgressBar/ProgressBar.test.tsx +108 -32
- package/src/ProgressBar/ProgressBar.tsx +58 -10
- package/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts +21 -9
- package/src/ProgressBar/__tests__/ProgressBarMotion.a11y.chromium.spec.ts +831 -0
- package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +21 -14
- package/src/Resizable/useResizable.test.ts +43 -0
- package/src/Resizable/useResizable.ts +32 -9
- package/src/SegmentedControl/SegmentedControl.test.tsx +84 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +11 -5
- package/src/Selector/Selector.test.tsx +90 -1
- package/src/Selector/__tests__/Selector.combobox.a11y.test.tsx +8 -1
- package/src/Selector/__tests__/Selector.listbox.a11y.test.tsx +8 -1
- package/src/Selector/useSelectorPresentation.ts +31 -3
- package/src/SideNav/SideNav.test.tsx +27 -0
- package/src/SideNav/__tests__/SideNavRailMotion.interaction.browser.spec.ts +176 -51
- package/src/Skeleton/Skeleton.tsx +3 -1
- package/src/Slider/Slider.test.tsx +31 -0
- package/src/Slider/Slider.tsx +8 -3
- package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +19 -7
- package/src/Spinner/Spinner.tsx +5 -3
- package/src/Stack/Stack.tsx +1 -1
- package/src/Stack/StackItem.tsx +1 -1
- package/src/TabList/TabList.test.tsx +58 -4
- package/src/TabList/TabList.tsx +16 -1
- package/src/TabList/__tests__/TabPressPointer.interaction.browser.spec.ts +163 -0
- package/src/Table/__tests__/Table.a11y.chromium.spec.ts +18 -6
- package/src/Table/plugins/columnResize/useTableColumnResize.test.tsx +22 -0
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +8 -4
- package/src/Text/Text.tsx +1 -1
- package/src/Text/useTruncation.test.tsx +128 -1
- package/src/Text/useTruncation.ts +23 -5
- package/src/TextArea/TextArea.spec.md +10 -13
- package/src/TextArea/TextArea.test.tsx +60 -0
- package/src/TextArea/TextArea.tsx +15 -1
- package/src/TextInput/TextInput.test.tsx +21 -0
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/TimeInput/NativeTimeInput.test.tsx +17 -0
- package/src/TimeInput/Presentation.test.tsx +21 -0
- package/src/TimeInput/TimeInput.doc.mjs +8 -8
- package/src/TimeInput/TimeInput.spec.md +45 -48
- package/src/TimeInput/TimeInput.test.tsx +76 -0
- package/src/TimeInput/TimeInput.tsx +36 -18
- package/src/TimeInput/TouchTimeField.tsx +4 -6
- package/src/Timestamp/Timestamp.spec.md +6 -12
- package/src/Timestamp/Timestamp.test.tsx +30 -5
- package/src/Timestamp/Timestamp.tsx +6 -2
- package/src/Timestamp/TimestampHoverCard.tsx +4 -4
- package/src/Toast/Toast.spec.md +14 -20
- package/src/Toast/Toast.tsx +104 -36
- package/src/Toast/ToastViewport.test.tsx +719 -1
- package/src/Toast/ToastViewport.tsx +100 -50
- package/src/Tokenizer/Tokenizer.spec.md +5 -3
- package/src/Tokenizer/Tokenizer.test.tsx +68 -0
- package/src/Tokenizer/Tokenizer.tsx +14 -2
- package/src/Tokenizer/TokenizerBottomSheet.test.tsx +15 -4
- package/src/Tokenizer/TokenizerBottomSheet.tsx +3 -3
- package/src/Toolbar/Toolbar.spec.md +5 -6
- package/src/Toolbar/Toolbar.test.tsx +30 -0
- package/src/Toolbar/Toolbar.tsx +2 -1
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +18 -6
- package/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts +18 -7
- package/src/TopNav/TopNav.test.tsx +27 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +21 -0
- package/src/TopNav/TopNavMegaMenu.tsx +4 -1
- package/src/TopNav/TopNavMenu.test.tsx +17 -0
- package/src/TopNav/TopNavMenu.tsx +1 -0
- package/src/Typeahead/Typeahead.test.tsx +40 -0
- package/src/Typeahead/Typeahead.tsx +12 -1
- package/src/__tests__/pressState.ts +8 -4
- package/src/gestures/GestureArena.ts +35 -0
- package/src/gestures/GestureHost.ts +2065 -0
- package/src/gestures/GestureRecognizer.ts +18 -0
- package/src/gestures/LongPressGestureRecognizer.ts +4 -0
- package/src/gestures/PanGestureRecognizer.ts +4 -0
- package/src/gestures/PinchGestureRecognizer.ts +148 -0
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +256 -0
- package/src/gestures/SwipeGestureRecognizer.ts +197 -0
- package/src/gestures/TapGestureRecognizer.ts +4 -0
- package/src/gestures/VelocityTracker.ts +10 -3
- package/src/gestures/__tests__/GestureHost.test.ts +2087 -0
- package/src/gestures/__tests__/PanGestureRecognizer.test.ts +4 -4
- package/src/gestures/__tests__/PinchGestureRecognizer.test.ts +74 -0
- package/src/gestures/__tests__/ScreenEdgePanGestureRecognizer.test.ts +498 -0
- package/src/gestures/__tests__/SwipeGestureRecognizer.test.ts +108 -0
- package/src/gestures/__tests__/arena.test.ts +5 -0
- package/src/gestures/__tests__/arenaPinchSwipeEdge.test.ts +193 -0
- package/src/gestures/__tests__/browser/build-fixture.mjs +46 -0
- package/src/gestures/__tests__/browser/fixture.ts +307 -0
- package/src/gestures/__tests__/browser/gestures.interaction.browser.spec.ts +1137 -0
- package/src/gestures/__tests__/browserNegotiation.test.ts +293 -0
- package/src/gestures/__tests__/haptics.test.ts +187 -0
- package/src/gestures/__tests__/harness.ts +21 -2
- package/src/gestures/__tests__/recognizerKind.test.ts +78 -0
- package/src/gestures/__tests__/touchActionRule.test.ts +54 -0
- package/src/gestures/haptics.ts +203 -0
- package/src/gestures/nativeScroll.ts +277 -0
- package/src/gestures/touchAction.ts +191 -0
- package/src/gestures/touchActionRule.ts +157 -0
- package/src/gestures/types.ts +30 -9
- package/src/hooks/index.ts +5 -1
- package/src/hooks/modalAnnounce.ts +129 -72
- package/src/hooks/scrollKeyboardDelegation.test.ts +33 -0
- package/src/hooks/scrollKeyboardDelegation.ts +9 -3
- package/src/hooks/useAdaptivePresentation.ts +4 -1
- package/src/hooks/useAnnounce.doc.mjs +35 -3
- package/src/hooks/useAnnounce.replace.test.tsx +516 -0
- package/src/hooks/useAnnounce.ts +209 -102
- package/src/hooks/useAnnounceRenderedText.adopters.test.tsx +10 -1
- package/src/hooks/useAnnounceRenderedText.ts +17 -3
- package/src/hooks/useBusyAnnouncement.ts +7 -10
- package/src/hooks/useMenuHover.ts +15 -1
- package/src/hooks/useScrollOverflow.doc.mjs +1 -1
- package/src/hooks/useScrollOverflow.test.tsx +102 -1
- package/src/hooks/useScrollOverflow.ts +59 -10
- package/src/i18n/generated-locales/en.generated.ts +7 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +7 -0
- package/src/motion/README.md +11 -1
- package/src/motion/animator.test.ts +151 -3
- package/src/motion/animator.ts +149 -33
- package/src/theme/Theme.doc.mjs +1 -1
- package/src/theme/defineTheme.ts +117 -8
- package/src/theme/derivedVarRegistry.test.ts +4 -0
- package/src/theme/domainTokens/domainTokenDefaults.ts +19 -0
- package/src/theme/domainTokens/index.ts +6 -10
- package/src/theme/expandMotionScale.test.ts +1 -1
- package/src/theme/index.ts +5 -0
- package/src/theme/motionKnobs.ts +82 -0
- package/src/theme/resolveThemeValues.ts +68 -6
- package/src/theme/themeAdaptations.ts +52 -12
- package/src/theme/themeMotion.test.ts +620 -0
- package/src/theme/themeMotion.ts +221 -0
- package/src/theme/tokenReferences.ts +149 -0
- package/src/theme/tokens.stylex.ts +10 -0
- package/src/theme/tokens.ts +15 -158
- package/src/utils/focusReturn.ts +17 -6
- package/src/utils/getNodeText.test.ts +24 -0
- package/src/utils/getNodeText.ts +37 -0
- package/src/utils/interactionModality.test.ts +45 -1
- package/src/utils/interactionModality.ts +64 -5
- package/src/utils/interactionOverlay.stylex.ts +12 -3
- package/src/utils/plainDate.test.ts +90 -0
- package/src/utils/plainDate.ts +58 -3
- package/src/utils/presentation.test.ts +380 -0
- package/src/utils/presentation.ts +180 -0
- package/src/utils/pressFeedback.test.ts +138 -0
- package/src/utils/pressFeedback.ts +34 -11
- package/src/utils/pressPaintPriority.test.ts +80 -0
- package/src/utils/primaryClick.test.ts +38 -0
- package/src/utils/primaryClick.ts +28 -0
- package/src/utils/sharedMutationObserver.test.ts +54 -1
- package/src/utils/sharedMutationObserver.ts +87 -29
- package/src/utils/timeFormat.test.ts +204 -0
- package/src/utils/timeFormat.ts +314 -0
- package/src/utils/touchPresentation.stylex.ts +43 -0
- package/src/utils/touchPresentation.test.ts +140 -1
- package/src/utils/touchPresentation.ts +5 -3
- package/src/utils/unicodeDigits.test.ts +44 -0
- package/src/utils/unicodeDigits.ts +71 -0
package/locales/en.json
CHANGED
|
@@ -791,6 +791,14 @@
|
|
|
791
791
|
"defaultMessage": "Open menu",
|
|
792
792
|
"description": "Screen-reader-only label on the `⋯` overflow-menu button embedded in a SideNav section heading. Same string as `topNav.heading.openMenu` — translations may share."
|
|
793
793
|
},
|
|
794
|
+
"@astryx.slider.minimumThumb": {
|
|
795
|
+
"defaultMessage": "Minimum value",
|
|
796
|
+
"description": "Accessible name of the lower thumb of a range Slider (two thumbs), announced together with the Slider's own label, for example \"Price range, Minimum value, 20\". Never shown on screen."
|
|
797
|
+
},
|
|
798
|
+
"@astryx.slider.maximumThumb": {
|
|
799
|
+
"defaultMessage": "Maximum value",
|
|
800
|
+
"description": "Accessible name of the upper thumb of a range Slider (two thumbs), announced together with the Slider's own label, for example \"Price range, Maximum value, 80\". Never shown on screen."
|
|
801
|
+
},
|
|
794
802
|
"@astryx.tabList.label": {
|
|
795
803
|
"defaultMessage": "Tabs",
|
|
796
804
|
"description": "Screen-reader-only fallback name for a horizontal tab bar. Plural noun; \"Tabs\" here = UI tab panels, not browser tabs or the Tab key."
|
|
@@ -803,6 +811,10 @@
|
|
|
803
811
|
"defaultMessage": "No data",
|
|
804
812
|
"description": "Fallback empty-state text in the table body when there are zero rows. Neutral tone (not error-y); consumers commonly override with something specific like \"No results\"."
|
|
805
813
|
},
|
|
814
|
+
"@astryx.table.columnResize.resizeColumn": {
|
|
815
|
+
"defaultMessage": "Resize column {label}",
|
|
816
|
+
"description": "Accessible name for a Table column-resize handle (a vertical separator between header cells). `label` is the column header's visible text, or the column key when the header has no text."
|
|
817
|
+
},
|
|
806
818
|
"@astryx.table.filter.allPlaceholder": {
|
|
807
819
|
"defaultMessage": "All",
|
|
808
820
|
"description": "Placeholder on a per-column filter dropdown when nothing is selected, meaning \"no filter — all rows match\". Determiner form (as in \"all values\"), not the pronoun."
|
|
@@ -1009,11 +1021,11 @@
|
|
|
1009
1021
|
},
|
|
1010
1022
|
"@astryx.dateTimeInput.timeHint12h": {
|
|
1011
1023
|
"defaultMessage": "e.g., 2:30 PM",
|
|
1012
|
-
"description": "Placeholder hint shown in the DateTimeInput time
|
|
1024
|
+
"description": "Placeholder hint shown in the TimeInput and DateTimeInput time fields when focused and empty with 12-hour format. Gives an example of expected input format; write the example time as your locale writes 12-hour time."
|
|
1013
1025
|
},
|
|
1014
1026
|
"@astryx.dateTimeInput.timeHint24h": {
|
|
1015
1027
|
"defaultMessage": "e.g., 14:30",
|
|
1016
|
-
"description": "Placeholder hint shown in the DateTimeInput time
|
|
1028
|
+
"description": "Placeholder hint shown in the TimeInput and DateTimeInput time fields when focused and empty with 24-hour format. Gives an example of expected input format; write the example time as your locale writes 24-hour time."
|
|
1017
1029
|
},
|
|
1018
1030
|
"@astryx.dateTimeInput.timeSuffix": {
|
|
1019
1031
|
"defaultMessage": "{label} time",
|
|
@@ -1567,6 +1579,10 @@
|
|
|
1567
1579
|
"defaultMessage": "Expand all rows",
|
|
1568
1580
|
"description": "Aria label for the Table tree-data header toggle when rows are collapsed and clicking it expands them."
|
|
1569
1581
|
},
|
|
1582
|
+
"@astryx.textArea.counter": {
|
|
1583
|
+
"defaultMessage": "{count, number}/{limit, number}",
|
|
1584
|
+
"description": "Visible character counter at the bottom of a TextArea that has a character limit, for example `62/2,000`. `{count}` is the characters typed so far and `{limit}` the limit; keep both numbers and reorder or change the separator if your language needs to."
|
|
1585
|
+
},
|
|
1570
1586
|
"@astryx.textArea.charactersRemaining": {
|
|
1571
1587
|
"defaultMessage": "{count, number} {count, plural, one {character} other {characters}} remaining",
|
|
1572
1588
|
"description": "Screen-reader-only announcement of how many characters the user can still type before hitting a TextArea's maxLength. Announced politely as the count nears the limit. `{count}` is the number remaining — example: `12 characters remaining`."
|
|
@@ -1643,6 +1659,10 @@
|
|
|
1643
1659
|
"defaultMessage": "{count, number} of {total, number} selected",
|
|
1644
1660
|
"description": "Polite screen-reader announcement of how many MultiSelector options are selected out of the total, spoken after each toggle. Live-region text, never shown on screen; example: `3 of 12 selected`."
|
|
1645
1661
|
},
|
|
1662
|
+
"@astryx.multiSelector.selectedCount": {
|
|
1663
|
+
"defaultMessage": "{count, plural, one {# selected} other {# selected}}",
|
|
1664
|
+
"description": "Visible text on a closed MultiSelector's trigger when it shows a count of the chosen options (`triggerDisplay=\"count\"`), for example `2 selected`. `{count}` is the number of chosen options; use a plural form if your language needs one."
|
|
1665
|
+
},
|
|
1646
1666
|
"@astryx.multiSelector.createOption": {
|
|
1647
1667
|
"defaultMessage": "Create \"{query}\"",
|
|
1648
1668
|
"description": "Label of the first row in a MultiSelector's search panel when `hasCreate` is set and the typed text matches no option. Picking it reports a creation to the caller. `{query}` is the trimmed text the person typed, shown in quotes."
|
|
@@ -1693,7 +1713,7 @@
|
|
|
1693
1713
|
},
|
|
1694
1714
|
"@astryx.tokenizer.create": {
|
|
1695
1715
|
"defaultMessage": "Create \"{value}\"",
|
|
1696
|
-
"description": "Label of
|
|
1716
|
+
"description": "Label of a Tokenizer's create row, in the inline menu and the bottom sheet, when `hasCreate` is set and the typed text matches no existing item. `{value}` is the typed text, e.g. `Create \"Marketing\"`."
|
|
1697
1717
|
},
|
|
1698
1718
|
"@astryx.tokenizer.add": {
|
|
1699
1719
|
"defaultMessage": "Add",
|
|
@@ -2151,6 +2171,10 @@
|
|
|
2151
2171
|
"defaultMessage": "Resolved by {name}",
|
|
2152
2172
|
"description": "Tooltip of the Resolved text on a comment thread in a lab Comments panel. `name` is the person who resolved it."
|
|
2153
2173
|
},
|
|
2174
|
+
"@astryx.comments.errorAnnouncement": {
|
|
2175
|
+
"defaultMessage": "{title} {description}",
|
|
2176
|
+
"description": "Screen-reader announcement for an error Banner in a lab Comments panel that has a title and a description, read once when the Banner appears. `title` is the Banner's title (for example `Couldn't send this comment.`) and `description` its description (for example `Retrying didn't work.`). Reorder or punctuate as the language needs."
|
|
2177
|
+
},
|
|
2154
2178
|
"@astryx.comments.retryFailed": {
|
|
2155
2179
|
"defaultMessage": "Retrying didn't work.",
|
|
2156
2180
|
"description": "Error shown on a comment in a lab Comments panel that failed to post when retrying it failed too."
|
package/locales/pseudo.json
CHANGED
|
@@ -593,6 +593,12 @@
|
|
|
593
593
|
"@astryx.sideNav.heading.openMenu": {
|
|
594
594
|
"defaultMessage": "⟦Óþéñ ɱéñú⟧"
|
|
595
595
|
},
|
|
596
|
+
"@astryx.slider.minimumThumb": {
|
|
597
|
+
"defaultMessage": "⟦Ṁíñíɱúɱ ṽàłúé⟧"
|
|
598
|
+
},
|
|
599
|
+
"@astryx.slider.maximumThumb": {
|
|
600
|
+
"defaultMessage": "⟦Ṁàẋíɱúɱ ṽàłúé⟧"
|
|
601
|
+
},
|
|
596
602
|
"@astryx.tabList.label": {
|
|
597
603
|
"defaultMessage": "⟦Ţàƀš⟧"
|
|
598
604
|
},
|
|
@@ -602,6 +608,9 @@
|
|
|
602
608
|
"@astryx.table.noData": {
|
|
603
609
|
"defaultMessage": "⟦Ñó ðàţà⟧"
|
|
604
610
|
},
|
|
611
|
+
"@astryx.table.columnResize.resizeColumn": {
|
|
612
|
+
"defaultMessage": "⟦Řéšížé çółúɱñ {label}⟧"
|
|
613
|
+
},
|
|
605
614
|
"@astryx.table.filter.allPlaceholder": {
|
|
606
615
|
"defaultMessage": "⟦Àłł⟧"
|
|
607
616
|
},
|
|
@@ -1175,6 +1184,9 @@
|
|
|
1175
1184
|
"@astryx.tableTree.expandAllRows": {
|
|
1176
1185
|
"defaultMessage": "⟦Éẋþàñð àłł řóŵš⟧"
|
|
1177
1186
|
},
|
|
1187
|
+
"@astryx.textArea.counter": {
|
|
1188
|
+
"defaultMessage": "⟦{count, number}/{limit, number}⟧"
|
|
1189
|
+
},
|
|
1178
1190
|
"@astryx.textArea.charactersRemaining": {
|
|
1179
1191
|
"defaultMessage": "⟦{count, number} {count, plural, one {character} other {characters}} řéɱàíñíñĝ⟧"
|
|
1180
1192
|
},
|
|
@@ -1232,6 +1244,9 @@
|
|
|
1232
1244
|
"@astryx.multiSelector.selectionCount": {
|
|
1233
1245
|
"defaultMessage": "⟦{count, number} óƒ {total, number} šéłéçţéð⟧"
|
|
1234
1246
|
},
|
|
1247
|
+
"@astryx.multiSelector.selectedCount": {
|
|
1248
|
+
"defaultMessage": "⟦{count, plural, one {# selected} other {# selected}}⟧"
|
|
1249
|
+
},
|
|
1235
1250
|
"@astryx.multiSelector.createOption": {
|
|
1236
1251
|
"defaultMessage": "⟦Çřéàţé \"{query}\"⟧"
|
|
1237
1252
|
},
|
|
@@ -1613,6 +1628,9 @@
|
|
|
1613
1628
|
"@astryx.comments.resolvedBy": {
|
|
1614
1629
|
"defaultMessage": "⟦Řéšółṽéð ƀý {name}⟧"
|
|
1615
1630
|
},
|
|
1631
|
+
"@astryx.comments.errorAnnouncement": {
|
|
1632
|
+
"defaultMessage": "⟦{title} {description}⟧"
|
|
1633
|
+
},
|
|
1616
1634
|
"@astryx.comments.retryFailed": {
|
|
1617
1635
|
"defaultMessage": "⟦Řéţřýíñĝ ðíðñ'ţ ŵóřķ.⟧"
|
|
1618
1636
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6-canary.00507ba",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -847,6 +847,9 @@
|
|
|
847
847
|
"react-dom": ">=19.0.0"
|
|
848
848
|
},
|
|
849
849
|
"devDependencies": {
|
|
850
|
+
"@astryxdesign/a11y-spec": "0.7.6-canary.00507ba",
|
|
851
|
+
"@astryxdesign/cli": "0.7.6-canary.00507ba",
|
|
852
|
+
"@astryxdesign/interaction-harness": "0.7.6-canary.00507ba",
|
|
850
853
|
"@babel/cli": "^7.29.7",
|
|
851
854
|
"@babel/core": "^7.29.7",
|
|
852
855
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -857,9 +860,7 @@
|
|
|
857
860
|
"@testing-library/jest-dom": "^6.6.0",
|
|
858
861
|
"@testing-library/react": "^16.3.2",
|
|
859
862
|
"@types/babel__core": "^7.20.5",
|
|
860
|
-
"tailwindcss": "^4.3.2"
|
|
861
|
-
"@astryxdesign/cli": "0.7.5",
|
|
862
|
-
"@astryxdesign/a11y-spec": "0.0.0"
|
|
863
|
+
"tailwindcss": "^4.3.2"
|
|
863
864
|
},
|
|
864
865
|
"dependencies": {
|
|
865
866
|
"intl-messageformat": "^11.2.9"
|
|
@@ -18,18 +18,19 @@
|
|
|
18
18
|
|
|
19
19
|
import React, {useId, useCallback} from 'react';
|
|
20
20
|
import * as stylex from '@stylexjs/stylex';
|
|
21
|
-
import {Dialog} from '../Dialog';
|
|
21
|
+
import {Dialog} from '../Dialog/Dialog';
|
|
22
22
|
import {Layout} from '../Layout/Layout';
|
|
23
23
|
import {LayoutContent} from '../Layout/LayoutContent';
|
|
24
24
|
import {LayoutFooter} from '../Layout/LayoutFooter';
|
|
25
|
-
import {Stack} from '../Stack';
|
|
25
|
+
import {Stack} from '../Stack/Stack';
|
|
26
26
|
import {Heading} from '../Heading/Heading';
|
|
27
27
|
import {Text} from '../Text/Text';
|
|
28
|
-
import {Button
|
|
28
|
+
import {Button} from '../Button/Button';
|
|
29
|
+
import type {ButtonVariant} from '../Button';
|
|
29
30
|
import type {BaseProps} from '../BaseProps';
|
|
30
|
-
import {mergeProps} from '../utils';
|
|
31
|
+
import {mergeProps} from '../utils/mergeProps';
|
|
31
32
|
import {themeProps} from '../utils/themeProps';
|
|
32
|
-
import {useTranslator} from '../i18n';
|
|
33
|
+
import {useTranslator} from '../i18n/useTranslator';
|
|
33
34
|
import {useMediaQuery} from '../hooks/useMediaQuery';
|
|
34
35
|
|
|
35
36
|
const SMALL_SCREEN_QUERY = '(max-width: 640px)';
|
|
@@ -91,15 +91,27 @@ async function runState(
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
// Checking coverage runs every state again, which on a loaded runner nears
|
|
95
|
+
// the per-test timeout as one test. It runs as one serial part per state,
|
|
96
|
+
// sharing their results, then one check over all of them.
|
|
97
|
+
test.describe('every alert-dialog expectation is exercised by an AlertDialog state', () => {
|
|
98
|
+
test.describe.configure({mode: 'serial'});
|
|
98
99
|
const results: BindingResult[] = [];
|
|
100
|
+
|
|
99
101
|
for (const state of ALERT_DIALOG_BINDING_STATES) {
|
|
100
|
-
|
|
102
|
+
test(`runs ${state.id}`, async ({page}) => {
|
|
103
|
+
const cdp = await page.context().newCDPSession(page);
|
|
104
|
+
results.push(await runState(page, cdp, state));
|
|
105
|
+
});
|
|
101
106
|
}
|
|
102
|
-
|
|
107
|
+
|
|
108
|
+
test('no expectation is left unexercised', () => {
|
|
109
|
+
// Every part ran in this worker; this test alone proves nothing.
|
|
110
|
+
expect(results.map(result => result.state).sort()).toEqual(
|
|
111
|
+
ALERT_DIALOG_BINDING_STATES.map(state => state.id).sort(),
|
|
112
|
+
);
|
|
113
|
+
expect(neverExercised(results)).toEqual([]);
|
|
114
|
+
});
|
|
103
115
|
});
|
|
104
116
|
|
|
105
117
|
for (const state of ALERT_DIALOG_BINDING_STATES) {
|
|
@@ -96,7 +96,7 @@ export const docs = {
|
|
|
96
96
|
name: 'Main content',
|
|
97
97
|
required: true,
|
|
98
98
|
description:
|
|
99
|
-
'children, rendered in the main landmark. Scrolls internally when height is fill, and with the page when it is auto.',
|
|
99
|
+
'children, rendered in the main landmark. Scrolls internally when height is fill, and with the page when it is auto. While it scrolls content that overflows, it is a stop in the tab order; Tab entry moves on when its first focusable element is a plain link or button, and otherwise main is one stop before it.',
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
name: 'Mobile nav drawer',
|
|
@@ -36,7 +36,7 @@ system_specs: [spec:AST-012, spec:AST-027]
|
|
|
36
36
|
| Behavior | One page frame: skip link, then a header region, an inline side region, and one `main` region. Below the mobile breakpoint the side nav leaves the page and AppShell composes a mobile drawer from the nav slots, unless `mobileNav` disables or replaces it. |
|
|
37
37
|
| End-user impact | Keyboard users get a skip link to the main region; screen-reader users get one banner and one main landmark; phone-width users reach the side nav through a toggle and drawer while page content, its input values, and focus survive the layout switch. When the side nav collapses or expands, the content's old and new wrap swap on the rail's clock instead of re-wrapping in one frame (FR17). |
|
|
38
38
|
| Builder impact | None. Callers fill slots and choose height, variant, content padding, and mobile behavior. |
|
|
39
|
-
| Compatibility/readiness | Records shipped behavior; no prop, default, or export changes.
|
|
39
|
+
| Compatibility/readiness | Records shipped behavior; no prop, default, or export changes. Four current-state gaps, listed under Current-state impact: page-level stacking values, a banner pinned against its docs, an unmeasured late header, and a raw `content` drawer the toggle cannot reach. |
|
|
40
40
|
| Review checks | Reject a second `main` or banner landmark from AppShell, a skip link that is not the first focusable element or does not move focus to `main`, a breakpoint that treats equality as mobile, or remounting page content when the breakpoint changes. Also reject a content area that animates its width during a side nav collapse or expand (FR17). |
|
|
41
41
|
| Governing rules | `spec:AST-012` FR8 (width points), `family:layout-regions` FR9, `architecture:theme-application` INV10, `spec:AST-027` FR1–FR5 (local stacking), `architecture:component-theming-surface`; `component:SideNav` FR6 and `spec:AST-105` FR8 (the content swap). |
|
|
42
42
|
|
|
@@ -86,11 +86,6 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
86
86
|
the auto toggle still renders, so its `aria-controls` names no element and its
|
|
87
87
|
presses open nothing. WCAG 4.1.2 requires a control's relationships and state
|
|
88
88
|
to be programmatically correct.
|
|
89
|
-
- **The fill-height main region is not a tab stop while it overflows.** In
|
|
90
|
-
`height="fill"` the main region is a scroll container, but it is never a
|
|
91
|
-
sequential tab stop, so keyboard users reach overflowing content only through
|
|
92
|
-
the skip link or focusable content inside it. `spec:AST-025` FR12 requires
|
|
93
|
-
effective scroll content to stay keyboard reachable.
|
|
94
89
|
|
|
95
90
|
## Ownership boundary
|
|
96
91
|
|
|
@@ -155,7 +150,7 @@ the only component record in the AppShell root.
|
|
|
155
150
|
| FR1 | The root element carries `app-shell`, the forwarded `ref`, `data-testid`, and other DOM props, and contains, in order: the skip link, the Layout frame (header region, inline side region, content region), then any mobile drawer. | Current source and tests |
|
|
156
151
|
| FR2 | A slot is present when its value is renderable: not `null`, `undefined`, a boolean, or an empty string. A component that renders nothing still counts as present. | Current source and public types |
|
|
157
152
|
| FR3 | The header region renders only when `topNav` or `banner` is present; it carries `app-shell-header` and `role="banner"`, places `banner` above `topNav`, and is never inside another landmark. The sidenav-only mobile top bar (FR9) also carries `app-shell-header` and takes `role="banner"` only when no header region renders. AppShell renders at most one banner landmark. | Current source and tests |
|
|
158
|
-
| FR4 | `children` render in one region with `role="main"` and `id="astryx-app-shell-main"`, programmatically focusable so the skip link can move focus to it; programmatic focus on it draws no focus ring. Its padding is `contentPadding`, default `0`. Whether it is a sequential tab stop is keyboard access to a scroll region (`spec:AST-025` FR12).
|
|
153
|
+
| FR4 | `children` render in one region with `role="main"` and `id="astryx-app-shell-main"`, programmatically focusable so the skip link can move focus to it; programmatic focus on it draws no focus ring. Its padding is `contentPadding`, default `0`. Whether it is a sequential tab stop is keyboard access to a scroll region (`spec:AST-025` FR12). Focus that Tab moves onto it while it is a stop draws the standard focus ring, inset, until focus leaves it; in `elevated` with both navs the region takes the surface's rounded top-start corner while that ring shows. | Current source and tests |
|
|
159
154
|
| FR5 | The skip link is the first focusable element in the shell. It links to `#astryx-app-shell-main`, shows the translated `@astryx.appShell.skipToContent` text, is visually hidden until focused, and on activation moves focus to the main region. | WCAG 2.4.1; current source and tests |
|
|
160
155
|
| FR6 | `fill` sizes the root to `100dvh` and the inline side region and main region scroll on their own. `auto` gives the root a `100dvh` minimum, makes the header sticky at the block start, keeps the inline side region sticky below the measured height of a header present when the shell mounts in `auto`, with its own scrolling, and lets the page scroll. Header height is measured only in `auto`. | Current source and tests |
|
|
161
156
|
| FR7 | Variant backgrounds: `wash` paints body background on the frame, nav areas, and content; `surface` paints surface on all three; `section` paints surface on the frame and divides the nav areas from content, and in `auto` the header paints surface itself; `elevated` paints body background on the frame and nav areas and surface on content (FR16 for the corner). | Current source and tests |
|
|
@@ -202,8 +197,10 @@ the only component record in the AppShell root.
|
|
|
202
197
|
|
|
203
198
|
### Performance and resources
|
|
204
199
|
|
|
205
|
-
- **PR1 —
|
|
206
|
-
`
|
|
200
|
+
- **PR1 — Measurement.** AppShell observes the header's size only in `auto`.
|
|
201
|
+
In `fill` it observes only whether the main region overflows (main's size,
|
|
202
|
+
its direct children's sizes, and its content), which decides whether main is
|
|
203
|
+
a sequential tab stop (FR4).
|
|
207
204
|
- **PR2 — One media query.** The breakpoint switch uses one media query
|
|
208
205
|
subscription per shell.
|
|
209
206
|
|
|
@@ -280,9 +277,9 @@ reachability, not a decision that it must stay unthemeable.
|
|
|
280
277
|
|
|
281
278
|
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
282
279
|
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
|
|
283
|
-
| FR1–FR4, AR1 | `AppShell.test.tsx` slot, landmark, banner, and ref suites
|
|
280
|
+
| FR1–FR4, AR1 | `AppShell.test.tsx` slot, landmark, banner, and ref suites; `AppShellMainKeyboard.a11y.browser.spec.ts` for main as a tab stop and its focus ring | Content only; each slot; mobile top bar with banner; Tab, Shift+Tab, click and skip link onto an overflowing main | A missing or duplicate landmark, or a nested banner, fails role queries. | `audit:AppShell/anatomy` |
|
|
284
281
|
| FR5, AR2 | `AppShell.test.tsx` skip-link and keyboard suites | First Tab; Enter; click; translated text | Losing the href, the focus move, or tab order fails. | `audit:AppShell/accessibility` |
|
|
285
|
-
| FR6, PR1 | `AppShell.test.tsx` height-mode suites
|
|
282
|
+
| FR6, PR1 | `AppShell.test.tsx` height-mode and main keyboard access suites; `observeMainOverflow.test.ts` | `fill`, `auto`, section header in `auto`; main fitting and overflowing in `fill` | Dropping the header's sticky placement, measuring the header in `fill`, or not measuring main, fails. | `audit:AppShell/behavior` |
|
|
286
283
|
| FR8 | `AppShell.test.tsx` breakpoint suites | `lg`, `xl`, `2xl`, explicit `md`, `none`; nearest, root, and built themes; SSR hint | Wrong map, inclusive edge, or `none` entering mobile fails. | `audit:AppShell/behavior` |
|
|
287
284
|
| FR9–FR12 | `AppShell.test.tsx` mobile suites; `MobileNavCloseEdgeCases.test.tsx` AppShell drawer suites | Sidenav only; both navs; heading-only TopNav; custom node | A missing toggle, duplicated items, a stale drawer, or an early hide fails. | `audit:AppShell/behavior` |
|
|
288
285
|
| FR13, AR3 | `AppShell.test.tsx` keyboard drawer and `useAppShellMobile` suites | Outside a shell; inside, closed and open | A wrong id link or stale state fails. | `audit:AppShell/accessibility` |
|
|
@@ -298,7 +295,7 @@ Read from source, with no focused test or baseline yet:
|
|
|
298
295
|
- FR2: `null`, `true`, `false`, and `''` slots counting as absent, and a slot that renders
|
|
299
296
|
nothing counting as present.
|
|
300
297
|
- FR3: `banner` above `topNav`, and no header region with only `sideNav`.
|
|
301
|
-
- FR4: the `contentPadding` value and its `0` default
|
|
298
|
+
- FR4: the `contentPadding` value and its `0` default.
|
|
302
299
|
- FR5: the skip link's visual hiding until focus; AR2: its shared focus outline.
|
|
303
300
|
- FR6: root sizing and region scrolling in each height mode, and the sticky side
|
|
304
301
|
region in `auto`.
|
|
@@ -860,7 +860,7 @@ describe('AppShell', () => {
|
|
|
860
860
|
expect(observeSpy).toHaveBeenCalled();
|
|
861
861
|
});
|
|
862
862
|
|
|
863
|
-
it('does not
|
|
863
|
+
it('does not observe the header in fill mode', () => {
|
|
864
864
|
const observeSpy = vi.fn();
|
|
865
865
|
vi.stubGlobal(
|
|
866
866
|
'ResizeObserver',
|
|
@@ -878,7 +878,13 @@ describe('AppShell', () => {
|
|
|
878
878
|
</AppShell>,
|
|
879
879
|
);
|
|
880
880
|
|
|
881
|
-
|
|
881
|
+
// Only the header offset needs measuring for sticky positioning, which
|
|
882
|
+
// fill mode does not use. (Main is measured for keyboard access.)
|
|
883
|
+
const observed = new Set<unknown>();
|
|
884
|
+
for (const call of observeSpy.mock.calls) {
|
|
885
|
+
observed.add(call[0]);
|
|
886
|
+
}
|
|
887
|
+
expect(observed.has(screen.getByRole('banner'))).toBe(false);
|
|
882
888
|
});
|
|
883
889
|
|
|
884
890
|
// ===========================================================================
|
|
@@ -1146,3 +1152,159 @@ describe('AppShell', () => {
|
|
|
1146
1152
|
).toBe(true);
|
|
1147
1153
|
});
|
|
1148
1154
|
});
|
|
1155
|
+
|
|
1156
|
+
describe('AppShell main keyboard access', () => {
|
|
1157
|
+
let frames: FrameRequestCallback[];
|
|
1158
|
+
|
|
1159
|
+
beforeEach(() => {
|
|
1160
|
+
frames = [];
|
|
1161
|
+
vi.stubGlobal(
|
|
1162
|
+
'requestAnimationFrame',
|
|
1163
|
+
vi.fn((callback: FrameRequestCallback) => {
|
|
1164
|
+
frames.push(callback);
|
|
1165
|
+
return frames.length;
|
|
1166
|
+
}),
|
|
1167
|
+
);
|
|
1168
|
+
vi.stubGlobal('cancelAnimationFrame', vi.fn());
|
|
1169
|
+
// jsdom does not expand LayoutContent's `overflow` into its longhands.
|
|
1170
|
+
const nativeGetComputedStyle = window.getComputedStyle.bind(window);
|
|
1171
|
+
vi.spyOn(window, 'getComputedStyle').mockImplementation(
|
|
1172
|
+
(element, pseudo) => {
|
|
1173
|
+
const computed = nativeGetComputedStyle(element, pseudo);
|
|
1174
|
+
return new Proxy(computed, {
|
|
1175
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async -- Proxy traps must remain synchronous
|
|
1176
|
+
get(target, property) {
|
|
1177
|
+
if (property === 'overflowX' || property === 'overflowY') {
|
|
1178
|
+
return target.overflow || 'visible';
|
|
1179
|
+
}
|
|
1180
|
+
return Reflect.get(target, property, target);
|
|
1181
|
+
},
|
|
1182
|
+
});
|
|
1183
|
+
},
|
|
1184
|
+
);
|
|
1185
|
+
});
|
|
1186
|
+
|
|
1187
|
+
afterEach(() => {
|
|
1188
|
+
vi.unstubAllGlobals();
|
|
1189
|
+
vi.stubGlobal('ResizeObserver', MockResizeObserver);
|
|
1190
|
+
});
|
|
1191
|
+
|
|
1192
|
+
function setMainGeometry(main: HTMLElement, scrollHeight: number) {
|
|
1193
|
+
for (const [key, value] of [
|
|
1194
|
+
['clientWidth', 800],
|
|
1195
|
+
['scrollWidth', 800],
|
|
1196
|
+
['clientHeight', 300],
|
|
1197
|
+
['scrollHeight', scrollHeight],
|
|
1198
|
+
['scrollTop', 0],
|
|
1199
|
+
['scrollLeft', 0],
|
|
1200
|
+
] as const) {
|
|
1201
|
+
Object.defineProperty(main, key, {
|
|
1202
|
+
configurable: true,
|
|
1203
|
+
value,
|
|
1204
|
+
writable: true,
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
function remeasure() {
|
|
1210
|
+
act(() => {
|
|
1211
|
+
window.dispatchEvent(new Event('resize'));
|
|
1212
|
+
});
|
|
1213
|
+
act(() => {
|
|
1214
|
+
const pending = frames.splice(0);
|
|
1215
|
+
pending.forEach(callback => callback(performance.now()));
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
it('makes main a keyboard stop while it scrolls overflowing content, and a skip target again once it fits', () => {
|
|
1220
|
+
render(
|
|
1221
|
+
<AppShell topNav={<div>Nav</div>}>
|
|
1222
|
+
<p>Long content</p>
|
|
1223
|
+
</AppShell>,
|
|
1224
|
+
);
|
|
1225
|
+
const main = screen.getByRole('main');
|
|
1226
|
+
expect(main).toHaveAttribute('tabindex', '-1');
|
|
1227
|
+
|
|
1228
|
+
setMainGeometry(main, 1200);
|
|
1229
|
+
remeasure();
|
|
1230
|
+
expect(main).toHaveAttribute('tabindex', '0');
|
|
1231
|
+
|
|
1232
|
+
setMainGeometry(main, 300);
|
|
1233
|
+
remeasure();
|
|
1234
|
+
expect(main).toHaveAttribute('tabindex', '-1');
|
|
1235
|
+
});
|
|
1236
|
+
|
|
1237
|
+
it('observes main only with fill, where it can become a keyboard stop', () => {
|
|
1238
|
+
const observed: Element[] = [];
|
|
1239
|
+
vi.stubGlobal(
|
|
1240
|
+
'ResizeObserver',
|
|
1241
|
+
class {
|
|
1242
|
+
constructor(public callback: ResizeObserverCallback) {}
|
|
1243
|
+
observe(target: Element) {
|
|
1244
|
+
observed.push(target);
|
|
1245
|
+
}
|
|
1246
|
+
unobserve() {}
|
|
1247
|
+
disconnect() {}
|
|
1248
|
+
},
|
|
1249
|
+
);
|
|
1250
|
+
const inMain = (main: HTMLElement) =>
|
|
1251
|
+
observed.filter(target => target === main || main.contains(target));
|
|
1252
|
+
|
|
1253
|
+
const {unmount} = render(
|
|
1254
|
+
<AppShell height="auto" topNav={<div>Nav</div>}>
|
|
1255
|
+
<p>Long content</p>
|
|
1256
|
+
</AppShell>,
|
|
1257
|
+
);
|
|
1258
|
+
expect(inMain(screen.getByRole('main'))).toEqual([]);
|
|
1259
|
+
unmount();
|
|
1260
|
+
|
|
1261
|
+
render(
|
|
1262
|
+
<AppShell topNav={<div>Nav</div>}>
|
|
1263
|
+
<p>Long content</p>
|
|
1264
|
+
</AppShell>,
|
|
1265
|
+
);
|
|
1266
|
+
expect(inMain(screen.getByRole('main')).length).toBeGreaterThan(0);
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
it('stops observing main when the shell switches to auto, and measures it again back in fill', () => {
|
|
1270
|
+
const {rerender} = render(
|
|
1271
|
+
<AppShell topNav={<div>Nav</div>}>
|
|
1272
|
+
<p>Long content</p>
|
|
1273
|
+
</AppShell>,
|
|
1274
|
+
);
|
|
1275
|
+
const main = screen.getByRole('main');
|
|
1276
|
+
setMainGeometry(main, 1200);
|
|
1277
|
+
remeasure();
|
|
1278
|
+
expect(main).toHaveAttribute('tabindex', '0');
|
|
1279
|
+
|
|
1280
|
+
rerender(
|
|
1281
|
+
<AppShell height="auto" topNav={<div>Nav</div>}>
|
|
1282
|
+
<p>Long content</p>
|
|
1283
|
+
</AppShell>,
|
|
1284
|
+
);
|
|
1285
|
+
expect(screen.getByRole('main')).toHaveAttribute('tabindex', '-1');
|
|
1286
|
+
remeasure();
|
|
1287
|
+
expect(screen.getByRole('main')).toHaveAttribute('tabindex', '-1');
|
|
1288
|
+
|
|
1289
|
+
// Back in fill, main is measured as it attaches, with no other signal.
|
|
1290
|
+
rerender(
|
|
1291
|
+
<AppShell topNav={<div>Nav</div>}>
|
|
1292
|
+
<p>Long content</p>
|
|
1293
|
+
</AppShell>,
|
|
1294
|
+
);
|
|
1295
|
+
expect(screen.getByRole('main')).toHaveAttribute('tabindex', '0');
|
|
1296
|
+
});
|
|
1297
|
+
|
|
1298
|
+
it('never makes main a keyboard stop when the page scrolls instead (auto)', () => {
|
|
1299
|
+
render(
|
|
1300
|
+
<AppShell height="auto" topNav={<div>Nav</div>}>
|
|
1301
|
+
<p>Long content</p>
|
|
1302
|
+
</AppShell>,
|
|
1303
|
+
);
|
|
1304
|
+
const main = screen.getByRole('main');
|
|
1305
|
+
|
|
1306
|
+
setMainGeometry(main, 1200);
|
|
1307
|
+
remeasure();
|
|
1308
|
+
expect(main).toHaveAttribute('tabindex', '-1');
|
|
1309
|
+
});
|
|
1310
|
+
});
|