@astryxdesign/core 0.7.6-canary.ec128c4 → 0.7.6-canary.f73623d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell/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/Carousel/Carousel.d.ts +3 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +12 -3
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +41 -4
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +11 -7
- package/dist/DateInput/usePointerDragScroll.d.ts +10 -1
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
- package/dist/DateInput/usePointerDragScroll.js +25 -9
- package/dist/DateInput/useScrollSettle.d.ts +3 -1
- package/dist/DateInput/useScrollSettle.d.ts.map +1 -1
- package/dist/DateInput/useScrollSettle.js +37 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +28 -19
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +19 -6
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +27 -6
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +8 -3
- package/dist/Markdown/plugins/headingLinks.a11y.chromium.spec.js +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +5 -29
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +23 -2
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +27 -0
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +32 -12
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +10 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +37 -30
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +11 -3
- package/dist/SideNav/SideNavItem.d.ts +2 -2
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +18 -7
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +1 -1
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +26 -6
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +10 -3
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +36 -10
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +46 -58
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +19 -3
- package/dist/ToggleButton/ToggleButtonGroup.d.ts +7 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.js +16 -2
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +37 -5
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +14 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +15 -4
- package/dist/Tokenizer/TokenizerClearAllMessageContext.d.ts +2 -0
- package/dist/Tokenizer/TokenizerClearAllMessageContext.d.ts.map +1 -0
- package/dist/Tokenizer/TokenizerClearAllMessageContext.js +17 -0
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +27 -4
- package/dist/Typeahead/BaseTypeahead.d.ts +4 -4
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +43 -7
- package/dist/astryx.css +10 -3
- package/dist/gestures/GestureArena.d.ts +26 -1
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +71 -9
- package/dist/gestures/GestureHost.d.ts +2 -3
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +7 -7
- package/dist/gestures/GestureRecognizer.d.ts +3 -1
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +3 -1
- package/dist/gestures/PressTracker.d.ts +112 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -0
- package/dist/gestures/PressTracker.js +267 -0
- package/dist/gestures/index.d.ts +37 -0
- package/dist/gestures/index.d.ts.map +1 -0
- package/dist/gestures/index.js +25 -0
- package/dist/gestures/useGestureRecognizer.d.ts +56 -0
- package/dist/gestures/useGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/useGestureRecognizer.js +226 -0
- package/dist/hooks/scrollKeyboardDelegation.d.ts.map +1 -1
- package/dist/hooks/scrollKeyboardDelegation.js +7 -3
- 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/af-ZA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/af-ZA.generated.js +0 -5
- package/dist/i18n/generated-locales/ar-SA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ar-SA.generated.js +0 -5
- package/dist/i18n/generated-locales/ca-ES.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ca-ES.generated.js +0 -5
- package/dist/i18n/generated-locales/cs-CZ.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/cs-CZ.generated.js +0 -5
- package/dist/i18n/generated-locales/da-DK.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/da-DK.generated.js +0 -5
- package/dist/i18n/generated-locales/de-DE.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/de-DE.generated.js +0 -5
- package/dist/i18n/generated-locales/el-GR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/el-GR.generated.js +0 -5
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +3 -5
- package/dist/i18n/generated-locales/es-ES.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/es-ES.generated.js +0 -5
- package/dist/i18n/generated-locales/fi-FI.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/fi-FI.generated.js +0 -5
- package/dist/i18n/generated-locales/fr-FR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/fr-FR.generated.js +0 -5
- package/dist/i18n/generated-locales/he-IL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/he-IL.generated.js +0 -5
- package/dist/i18n/generated-locales/hu-HU.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/hu-HU.generated.js +0 -5
- package/dist/i18n/generated-locales/it-IT.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/it-IT.generated.js +0 -5
- package/dist/i18n/generated-locales/ja-JP.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ja-JP.generated.js +0 -5
- package/dist/i18n/generated-locales/ko-KR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ko-KR.generated.js +0 -5
- package/dist/i18n/generated-locales/nl-NL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/nl-NL.generated.js +0 -5
- package/dist/i18n/generated-locales/no-NO.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/no-NO.generated.js +0 -5
- package/dist/i18n/generated-locales/pl-PL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pl-PL.generated.js +0 -5
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +3 -5
- package/dist/i18n/generated-locales/pt-BR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pt-BR.generated.js +0 -5
- package/dist/i18n/generated-locales/pt-PT.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pt-PT.generated.js +0 -5
- package/dist/i18n/generated-locales/ro-RO.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ro-RO.generated.js +0 -5
- package/dist/i18n/generated-locales/ru-RU.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ru-RU.generated.js +0 -5
- package/dist/i18n/generated-locales/sr-SP.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/sr-SP.generated.js +0 -5
- package/dist/i18n/generated-locales/sv-SE.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/sv-SE.generated.js +0 -5
- package/dist/i18n/generated-locales/tr-TR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/tr-TR.generated.js +0 -5
- package/dist/i18n/generated-locales/uk-UA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/uk-UA.generated.js +0 -5
- package/dist/i18n/generated-locales/vi-VN.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/vi-VN.generated.js +0 -5
- package/dist/i18n/generated-locales/zh-CN.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/zh-CN.generated.js +0 -5
- package/dist/i18n/generated-locales/zh-TW.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/zh-TW.generated.js +0 -5
- package/dist/motion/animator.d.ts +76 -7
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +589 -99
- package/dist/motion/coast.d.ts +4 -1
- package/dist/motion/coast.d.ts.map +1 -1
- package/dist/motion/coast.js +4 -2
- package/dist/motion/reducedMotion.d.ts.map +1 -1
- package/dist/motion/reducedMotion.js +6 -2
- package/dist/motion/reducedMotionPlan.d.ts +7 -0
- package/dist/motion/reducedMotionPlan.d.ts.map +1 -1
- package/dist/motion/reducedMotionPlan.js +14 -1
- package/dist/motion/resolveMotion.d.ts +42 -0
- package/dist/motion/resolveMotion.d.ts.map +1 -0
- package/dist/motion/resolveMotion.js +43 -0
- package/dist/motion/roleValue.d.ts +2 -1
- package/dist/motion/roleValue.d.ts.map +1 -1
- package/dist/motion/roleValue.js +2 -1
- package/dist/motion/uikit/timing.d.ts +7 -1
- package/dist/motion/uikit/timing.d.ts.map +1 -1
- package/dist/motion/uikit/timing.js +19 -1
- package/dist/theme/defineTheme.d.ts +19 -5
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +63 -3
- 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/focusOutline.stylex.d.ts +6 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +7 -0
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +17 -8
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +20 -1
- 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/touchPresentation.d.ts +2 -2
- package/dist/utils/touchPresentation.d.ts.map +1 -1
- package/dist/utils/touchPresentation.js +8 -5
- package/dist/utils/touchQueries.d.ts +13 -0
- package/dist/utils/touchQueries.d.ts.map +1 -0
- package/dist/utils/touchQueries.js +15 -0
- package/dist/utils/useFocusAcrossSwap.d.ts +19 -0
- package/dist/utils/useFocusAcrossSwap.d.ts.map +1 -0
- package/dist/utils/useFocusAcrossSwap.js +41 -0
- package/locales/af-ZA.json +0 -21
- package/locales/ar-SA.json +0 -21
- package/locales/ca-ES.json +0 -21
- package/locales/cs-CZ.json +0 -21
- package/locales/da-DK.json +0 -21
- package/locales/de-DE.json +0 -21
- package/locales/el-GR.json +0 -21
- package/locales/en.json +12 -20
- package/locales/es-ES.json +0 -21
- package/locales/fi-FI.json +0 -21
- package/locales/fr-FR.json +0 -21
- package/locales/he-IL.json +0 -21
- package/locales/hu-HU.json +0 -21
- package/locales/it-IT.json +0 -21
- package/locales/ja-JP.json +0 -21
- package/locales/ko-KR.json +0 -21
- package/locales/nl-NL.json +0 -21
- package/locales/no-NO.json +0 -21
- package/locales/pl-PL.json +0 -21
- package/locales/pseudo.json +8 -14
- package/locales/pt-BR.json +0 -21
- package/locales/pt-PT.json +0 -21
- package/locales/ro-RO.json +0 -21
- package/locales/ru-RU.json +0 -21
- package/locales/sr-SP.json +0 -21
- package/locales/sv-SE.json +0 -21
- package/locales/tr-TR.json +0 -21
- package/locales/uk-UA.json +0 -21
- package/locales/vi-VN.json +0 -21
- package/locales/zh-CN.json +0 -21
- package/locales/zh-TW.json +0 -21
- package/package.json +4 -4
- 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/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.known-failures.ts +1 -16
- package/src/Chat/ChatComposer.spec.md +75 -59
- package/src/Chat/ChatComposerTokenElement.spec.md +45 -33
- package/src/Chat/ChatDictationButton.spec.md +126 -81
- package/src/Chat/ChatLayout.spec.md +41 -36
- package/src/Chat/ChatLayoutScrollButton.spec.md +87 -103
- package/src/Chat/ChatSendButton.spec.md +78 -67
- package/src/CodeBlock/__tests__/CodeBlockCopyClearance.a11y.chromium.spec.ts +38 -3
- package/src/ComplexSelector/ComplexSelector.test.tsx +111 -0
- package/src/ComplexSelector/ComplexSelector.tsx +41 -4
- package/src/ContextMenu/ContextMenu.spec.md +84 -56
- package/src/ContextMenu/ContextMenuItem.spec.md +132 -0
- package/src/DateInput/DateInputTouch.test.tsx +44 -0
- package/src/DateInput/Wheel.tsx +9 -6
- package/src/DateInput/usePointerDragScroll.ts +34 -10
- package/src/DateInput/useScrollSettle.ts +38 -7
- package/src/DropdownMenu/DropdownMenu.spec.md +198 -218
- package/src/DropdownMenu/DropdownMenu.test.tsx +117 -0
- package/src/DropdownMenu/DropdownMenu.tsx +33 -18
- package/src/DropdownMenu/DropdownMenuCheckboxItem.spec.md +192 -0
- package/src/DropdownMenu/DropdownMenuDivider.spec.md +25 -31
- package/src/DropdownMenu/DropdownMenuGroup.spec.md +145 -0
- package/src/DropdownMenu/DropdownMenuItem.spec.md +48 -42
- package/src/DropdownMenu/DropdownMenuRadioGroup.spec.md +34 -37
- package/src/DropdownMenu/DropdownMenuRadioItem.spec.md +54 -53
- package/src/DropdownMenu/DropdownMenuSubMenu.spec.md +47 -41
- package/src/EmptyState/EmptyState.spec.md +35 -29
- package/src/Item/Item.test.tsx +60 -0
- package/src/Item/Item.tsx +14 -7
- package/src/Layer/useLayer.test.tsx +78 -3
- package/src/Layer/useLayer.tsx +27 -6
- package/src/Link/Link.spec.md +3 -2
- package/src/Link/Link.tsx +11 -0
- package/src/Link/__tests__/Link.truncation.a11y.chromium.spec.ts +58 -0
- package/src/Markdown/plugins/headingLinks.a11y.chromium.spec.ts +1 -1
- package/src/NavMenu/NavHeadingMenuItem.tsx +5 -39
- package/src/NumberInput/NumberInput.test.tsx +68 -7
- package/src/NumberInput/NumberInput.tsx +31 -1
- package/src/Outline/Outline.spec.md +165 -69
- package/src/Outline/Outline.test.tsx +67 -2
- package/src/Outline/Outline.tsx +23 -0
- package/src/Outline/modules/parseOutlineFromMarkdown.spec.md +3 -4
- package/src/OverflowList/OverflowList.spec.md +102 -55
- package/src/Pagination/Pagination.spec.md +158 -84
- package/src/Popover/Popover.test.tsx +84 -0
- package/src/Popover/Popover.tsx +34 -14
- package/src/Popover/__tests__/PopoverSecondDocument.a11y.chromium.spec.ts +70 -8
- package/src/Popover/usePopover.tsx +10 -3
- package/src/PowerSearch/PowerSearch.test.tsx +24 -0
- package/src/PowerSearch/PowerSearch.tsx +42 -31
- package/src/RadioList/RadioList.spec.md +1 -1
- package/src/RadioList/RadioList.test.tsx +84 -0
- package/src/RadioList/RadioListItem.tsx +11 -2
- package/src/Resizable/Resizable.spec.md +144 -124
- package/src/SideNav/SideNav.test.tsx +124 -4
- package/src/SideNav/SideNavItem.spec.md +14 -24
- package/src/SideNav/SideNavItem.tsx +27 -10
- package/src/Skeleton/Skeleton.tsx +3 -1
- package/src/Spinner/Spinner.tsx +3 -1
- package/src/Stepper/Step.spec.md +36 -42
- package/src/Stepper/Step.tsx +33 -6
- package/src/Stepper/Stepper.doc.mjs +1 -1
- package/src/Stepper/Stepper.test.tsx +69 -7
- package/src/Switch/Switch.spec.md +1 -1
- package/src/Switch/Switch.test.tsx +66 -1
- package/src/Switch/Switch.tsx +11 -3
- package/src/Table/Table.spec.md +1 -1
- package/src/Table/Table.test.tsx +32 -0
- package/src/Table/Table.tsx +43 -11
- package/src/Table/__tests__/Table.a11y.states.ts +1 -5
- package/src/Table/plugins/sortable/useTableSortable.test.tsx +73 -144
- package/src/Table/plugins/sortable/useTableSortable.tsx +44 -73
- package/src/Table/plugins/sortable/useTableSortableState.test.tsx +9 -21
- package/src/TimeInput/TimeInput.spec.md +13 -13
- package/src/Toast/Toast.spec.md +2 -5
- package/src/Toast/ToastViewport.test.tsx +79 -0
- package/src/Toast/ToastViewport.tsx +21 -3
- package/src/ToggleButton/ToggleButton.test.tsx +27 -0
- package/src/ToggleButton/ToggleButtonGroup.tsx +20 -1
- package/src/Token/Token.doc.mjs +2 -2
- package/src/Token/Token.spec.md +41 -51
- package/src/Token/Token.test.tsx +67 -0
- package/src/Token/Token.tsx +60 -5
- package/src/Token/TokenLink.tsx +21 -7
- package/src/Tokenizer/Tokenizer.spec.md +13 -1
- package/src/Tokenizer/Tokenizer.test.tsx +27 -0
- package/src/Tokenizer/Tokenizer.tsx +24 -10
- package/src/Tokenizer/TokenizerBottomSheet.test.tsx +8 -0
- package/src/Tokenizer/TokenizerClearAllMessageContext.ts +21 -0
- package/src/TreeList/TreeList.test.tsx +26 -0
- package/src/TreeList/TreeListItem.tsx +26 -4
- package/src/Typeahead/BaseTypeahead.doc.mjs +3 -3
- package/src/Typeahead/BaseTypeahead.spec.md +45 -45
- package/src/Typeahead/BaseTypeahead.tsx +48 -9
- package/src/Typeahead/Typeahead.test.tsx +120 -0
- package/src/__tests__/internalModulesNotExperimental.test.ts +88 -0
- package/src/__tests__/pressState.ts +8 -4
- package/src/gestures/GestureArena.ts +76 -11
- package/src/gestures/GestureHost.ts +6 -7
- package/src/gestures/GestureRecognizer.ts +3 -1
- package/src/gestures/PressTracker.ts +386 -0
- package/src/gestures/README.md +420 -0
- package/src/gestures/__tests__/GestureHost.test.ts +50 -1
- package/src/gestures/__tests__/PressTracker.test.ts +275 -0
- package/src/gestures/__tests__/arena.test.ts +35 -0
- package/src/gestures/__tests__/harness.ts +31 -2
- package/src/gestures/__tests__/pressTrackerFactory.test.ts +59 -0
- package/src/gestures/__tests__/useGestureRecognizer.test.tsx +570 -0
- package/src/gestures/index.ts +79 -0
- package/src/gestures/useGestureRecognizer.ts +305 -0
- package/src/hooks/scrollKeyboardDelegation.test.ts +33 -0
- package/src/hooks/scrollKeyboardDelegation.ts +9 -3
- 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/af-ZA.generated.ts +0 -7
- package/src/i18n/generated-locales/ar-SA.generated.ts +0 -6
- package/src/i18n/generated-locales/ca-ES.generated.ts +0 -7
- package/src/i18n/generated-locales/cs-CZ.generated.ts +0 -6
- package/src/i18n/generated-locales/da-DK.generated.ts +0 -6
- package/src/i18n/generated-locales/de-DE.generated.ts +0 -6
- package/src/i18n/generated-locales/el-GR.generated.ts +0 -7
- package/src/i18n/generated-locales/en.generated.ts +3 -6
- package/src/i18n/generated-locales/es-ES.generated.ts +0 -7
- package/src/i18n/generated-locales/fi-FI.generated.ts +0 -6
- package/src/i18n/generated-locales/fr-FR.generated.ts +0 -7
- package/src/i18n/generated-locales/he-IL.generated.ts +0 -6
- package/src/i18n/generated-locales/hu-HU.generated.ts +0 -6
- package/src/i18n/generated-locales/it-IT.generated.ts +0 -7
- package/src/i18n/generated-locales/ja-JP.generated.ts +0 -6
- package/src/i18n/generated-locales/ko-KR.generated.ts +0 -6
- package/src/i18n/generated-locales/nl-NL.generated.ts +0 -6
- package/src/i18n/generated-locales/no-NO.generated.ts +0 -6
- package/src/i18n/generated-locales/pl-PL.generated.ts +0 -7
- package/src/i18n/generated-locales/pseudo.generated.ts +3 -6
- package/src/i18n/generated-locales/pt-BR.generated.ts +0 -7
- package/src/i18n/generated-locales/pt-PT.generated.ts +0 -7
- package/src/i18n/generated-locales/ro-RO.generated.ts +0 -6
- package/src/i18n/generated-locales/ru-RU.generated.ts +0 -7
- package/src/i18n/generated-locales/sr-SP.generated.ts +0 -6
- package/src/i18n/generated-locales/sv-SE.generated.ts +0 -6
- package/src/i18n/generated-locales/tr-TR.generated.ts +0 -7
- package/src/i18n/generated-locales/uk-UA.generated.ts +0 -7
- package/src/i18n/generated-locales/vi-VN.generated.ts +0 -6
- package/src/i18n/generated-locales/zh-CN.generated.ts +0 -6
- package/src/i18n/generated-locales/zh-TW.generated.ts +0 -6
- package/src/motion/MEASUREMENTS.md +2 -1
- package/src/motion/README.md +102 -32
- package/src/motion/__tests__/animator.interaction.browser.spec.ts +843 -0
- package/src/motion/__tests__/motionBundle.ts +14 -0
- package/src/motion/animator.test.ts +978 -33
- package/src/motion/animator.ts +790 -104
- package/src/motion/coast.ts +10 -3
- package/src/motion/reducedMotion.ts +12 -2
- package/src/motion/reducedMotionPlan.test.ts +26 -0
- package/src/motion/reducedMotionPlan.ts +20 -1
- package/src/motion/resolveMotion.test.ts +123 -0
- package/src/motion/resolveMotion.ts +68 -0
- package/src/motion/roleValue.ts +2 -1
- package/src/motion/roles.test.ts +21 -4
- package/src/motion/uikit/tableImports.test.ts +293 -0
- package/src/motion/uikit/timing.ts +15 -1
- package/src/motion/uikit/values.test.ts +23 -12
- package/src/theme/Theme.doc.mjs +1 -1
- package/src/theme/defineTheme.ts +116 -7
- 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/focusOutline.stylex.ts +28 -0
- package/src/utils/interactionOverlay.stylex.ts +12 -3
- package/src/utils/pressFeedback.test.ts +138 -0
- package/src/utils/pressFeedback.ts +34 -11
- package/src/utils/pressGesture.test.ts +9 -0
- package/src/utils/sharedMutationObserver.test.ts +54 -1
- package/src/utils/sharedMutationObserver.ts +87 -29
- package/src/utils/touchPresentation.ts +8 -5
- package/src/utils/touchQueries.ts +15 -0
- package/src/utils/useFocusAcrossSwap.ts +55 -0
|
@@ -964,10 +964,71 @@ describe('SideNavItem', () => {
|
|
|
964
964
|
expect(button).not.toHaveAttribute('aria-current');
|
|
965
965
|
});
|
|
966
966
|
|
|
967
|
-
|
|
967
|
+
// spec:AST-085 FR1, FR2: a disabled item stays focusable but is inert.
|
|
968
|
+
it('keeps a disabled item focusable and exposes aria-disabled', () => {
|
|
968
969
|
render(<SideNavItem label="Dashboard" isDisabled />);
|
|
969
|
-
const button = screen.getByRole('button');
|
|
970
|
-
expect(button).
|
|
970
|
+
const button = screen.getByRole('button', {name: 'Dashboard'});
|
|
971
|
+
expect(button).not.toHaveAttribute('disabled');
|
|
972
|
+
expect(button).toHaveAttribute('aria-disabled', 'true');
|
|
973
|
+
button.focus();
|
|
974
|
+
expect(button).toHaveFocus();
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
it('does not run onClick on a disabled item from a click, Enter or Space', async () => {
|
|
978
|
+
const user = userEvent.setup();
|
|
979
|
+
const handleClick = vi.fn();
|
|
980
|
+
render(<SideNavItem label="Dashboard" onClick={handleClick} isDisabled />);
|
|
981
|
+
const button = screen.getByRole('button', {name: 'Dashboard'});
|
|
982
|
+
fireEvent.click(button);
|
|
983
|
+
button.focus();
|
|
984
|
+
await user.keyboard('{Enter}');
|
|
985
|
+
await user.keyboard(' ');
|
|
986
|
+
expect(handleClick).not.toHaveBeenCalled();
|
|
987
|
+
});
|
|
988
|
+
|
|
989
|
+
it('renders a disabled item with href as a focusable button that does not navigate', () => {
|
|
990
|
+
const handleClick = vi.fn();
|
|
991
|
+
render(
|
|
992
|
+
<SideNavItem
|
|
993
|
+
label="Dashboard"
|
|
994
|
+
href="/dashboard"
|
|
995
|
+
onClick={handleClick}
|
|
996
|
+
isDisabled
|
|
997
|
+
/>,
|
|
998
|
+
);
|
|
999
|
+
expect(screen.queryByRole('link')).toBeNull();
|
|
1000
|
+
const button = screen.getByRole('button', {name: 'Dashboard'});
|
|
1001
|
+
expect(button).not.toHaveAttribute('disabled');
|
|
1002
|
+
expect(button).not.toHaveAttribute('href');
|
|
1003
|
+
expect(button).toHaveAttribute('aria-disabled', 'true');
|
|
1004
|
+
fireEvent.click(button);
|
|
1005
|
+
expect(handleClick).not.toHaveBeenCalled();
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
it('exposes aria-disabled on the primary of a disabled split row', () => {
|
|
1009
|
+
render(
|
|
1010
|
+
<SideNavItem label="Settings" href="/settings" collapsible isDisabled>
|
|
1011
|
+
<SideNavItem label="General" href="/settings/general" />
|
|
1012
|
+
</SideNavItem>,
|
|
1013
|
+
);
|
|
1014
|
+
const primary = screen.getByRole('button', {name: 'Settings'});
|
|
1015
|
+
expect(primary).not.toHaveAttribute('disabled');
|
|
1016
|
+
expect(primary).toHaveAttribute('aria-disabled', 'true');
|
|
1017
|
+
});
|
|
1018
|
+
|
|
1019
|
+
it('keeps focus on an item that becomes disabled while focused', () => {
|
|
1020
|
+
const item = (isDisabled: boolean) => (
|
|
1021
|
+
<SideNavItem
|
|
1022
|
+
label="Dashboard"
|
|
1023
|
+
onClick={() => {}}
|
|
1024
|
+
isDisabled={isDisabled}
|
|
1025
|
+
/>
|
|
1026
|
+
);
|
|
1027
|
+
const {rerender} = render(item(false));
|
|
1028
|
+
const button = screen.getByRole('button', {name: 'Dashboard'});
|
|
1029
|
+
button.focus();
|
|
1030
|
+
rerender(item(true));
|
|
1031
|
+
expect(screen.getByRole('button', {name: 'Dashboard'})).toHaveFocus();
|
|
971
1032
|
});
|
|
972
1033
|
|
|
973
1034
|
it('calls onClick handler', async () => {
|
|
@@ -2447,6 +2508,18 @@ describe('SideNavItem — mobile drawer close-on-activate', () => {
|
|
|
2447
2508
|
expect(closeMobileNav).not.toHaveBeenCalled();
|
|
2448
2509
|
});
|
|
2449
2510
|
|
|
2511
|
+
it('does not close the mobile nav when a disabled item is activated', async () => {
|
|
2512
|
+
const user = userEvent.setup();
|
|
2513
|
+
const {closeMobileNav} = renderInDrawer(
|
|
2514
|
+
<SideNavItem label="Home" href="/" isDisabled data-testid="item" />,
|
|
2515
|
+
);
|
|
2516
|
+
const item = screen.getByTestId('item');
|
|
2517
|
+
fireEvent.click(item);
|
|
2518
|
+
item.focus();
|
|
2519
|
+
await user.keyboard('{Enter}');
|
|
2520
|
+
expect(closeMobileNav).not.toHaveBeenCalled();
|
|
2521
|
+
});
|
|
2522
|
+
|
|
2450
2523
|
it('does not close the mobile nav when a row action is clicked', async () => {
|
|
2451
2524
|
const user = userEvent.setup();
|
|
2452
2525
|
const onActionClick = vi.fn();
|
|
@@ -2495,7 +2568,7 @@ describe('SideNav keyboard operation', () => {
|
|
|
2495
2568
|
expect(screen.getByRole('button', {name: 'Settings'})).toHaveFocus();
|
|
2496
2569
|
});
|
|
2497
2570
|
|
|
2498
|
-
it('
|
|
2571
|
+
it('keeps a disabled item in the tab order', async () => {
|
|
2499
2572
|
const user = userEvent.setup();
|
|
2500
2573
|
render(
|
|
2501
2574
|
<SideNav>
|
|
@@ -2508,6 +2581,8 @@ describe('SideNav keyboard operation', () => {
|
|
|
2508
2581
|
await user.tab();
|
|
2509
2582
|
expect(screen.getByRole('button', {name: 'Dashboard'})).toHaveFocus();
|
|
2510
2583
|
await user.tab();
|
|
2584
|
+
expect(screen.getByRole('button', {name: 'Archived'})).toHaveFocus();
|
|
2585
|
+
await user.tab();
|
|
2511
2586
|
expect(screen.getByRole('button', {name: 'Settings'})).toHaveFocus();
|
|
2512
2587
|
});
|
|
2513
2588
|
|
|
@@ -4001,6 +4076,51 @@ describe('SideNavItem collapsed-from-mount rail tooltip', () => {
|
|
|
4001
4076
|
expect(spy.mock.contexts).toContain(layer);
|
|
4002
4077
|
});
|
|
4003
4078
|
|
|
4079
|
+
it('describes a disabled rail item on the control that takes focus', async () => {
|
|
4080
|
+
// spec:AST-085 FR5: the disabled control keeps its tab stop, so the label
|
|
4081
|
+
// tooltip has to describe it, not the row around it.
|
|
4082
|
+
renderRail(
|
|
4083
|
+
<SideNavItem
|
|
4084
|
+
label="Analytics (Coming Soon)"
|
|
4085
|
+
icon={StubIcon}
|
|
4086
|
+
href="/analytics"
|
|
4087
|
+
isDisabled
|
|
4088
|
+
/>,
|
|
4089
|
+
);
|
|
4090
|
+
await act(async () => {});
|
|
4091
|
+
const button = screen.getByRole('button', {
|
|
4092
|
+
name: 'Analytics (Coming Soon)',
|
|
4093
|
+
});
|
|
4094
|
+
expect(button).not.toHaveAttribute('disabled');
|
|
4095
|
+
expect(button).toHaveAttribute('aria-disabled', 'true');
|
|
4096
|
+
expect(railTooltipFor(button)).toHaveTextContent('Analytics (Coming Soon)');
|
|
4097
|
+
expect(button.parentElement).not.toHaveAttribute('aria-describedby');
|
|
4098
|
+
});
|
|
4099
|
+
|
|
4100
|
+
it('shows a disabled rail item its label when Tab focuses it', async () => {
|
|
4101
|
+
// The row listens for the tooltip, but it is not focusable itself, so it
|
|
4102
|
+
// has to hear the focus that bubbles up from the control.
|
|
4103
|
+
const user = userEvent.setup();
|
|
4104
|
+
const spy = vi.spyOn(HTMLElement.prototype, 'showPopover');
|
|
4105
|
+
showPopover = spy;
|
|
4106
|
+
renderRail(
|
|
4107
|
+
<SideNavItem
|
|
4108
|
+
label="Analytics (Coming Soon)"
|
|
4109
|
+
icon={StubIcon}
|
|
4110
|
+
href="/analytics"
|
|
4111
|
+
isDisabled
|
|
4112
|
+
/>,
|
|
4113
|
+
);
|
|
4114
|
+
await act(async () => {});
|
|
4115
|
+
const button = screen.getByRole('button', {
|
|
4116
|
+
name: 'Analytics (Coming Soon)',
|
|
4117
|
+
});
|
|
4118
|
+
|
|
4119
|
+
await user.tab();
|
|
4120
|
+
expect(button).toHaveFocus();
|
|
4121
|
+
expect(spy.mock.contexts).toContain(railTooltipFor(button));
|
|
4122
|
+
});
|
|
4123
|
+
|
|
4004
4124
|
it('describes the link once a disabled item is enabled in the rail', () => {
|
|
4005
4125
|
const item = (isDisabled: boolean) => (
|
|
4006
4126
|
<SideNavItem
|
|
@@ -39,7 +39,7 @@ system_specs: [spec:AST-085]
|
|
|
39
39
|
| Behavior | One SideNav row: a link or button with optional icon and passive end content, optional row-level actions beside it, and optional nested children that can expand and collapse. In a collapsed rail it is icon-only with a tooltip or a flyout. |
|
|
40
40
|
| End-user impact | Users see and hear the current page, reach row actions before nested items, expand or collapse groups without navigating, and return to the page after choosing a destination in the mobile drawer. |
|
|
41
41
|
| Builder impact | None. |
|
|
42
|
-
| Compatibility/readiness | Records shipped behavior; no public change.
|
|
42
|
+
| Compatibility/readiness | Records shipped behavior; no public change. Three implementation gaps (see Current-state impact). |
|
|
43
43
|
| Review checks | Reject an interactive control rendered inside the primary element, a link that also toggles collapse, a toggle or action that activates the row, collapsed children that stay reachable, or a drawer activation that leaves the drawer open after navigating. |
|
|
44
44
|
| Governing rules | `component:SideNav` FR1–FR5, DD1 (nesting and row geometry); `family:navigation-destinations`; `architecture:interaction-modality`; `architecture:public-component-api`. |
|
|
45
45
|
|
|
@@ -68,10 +68,6 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
68
68
|
|
|
69
69
|
## Current-state impact
|
|
70
70
|
|
|
71
|
-
- **A disabled item leaves the tab order.** A disabled item renders a
|
|
72
|
-
`<button>` with the native `disabled` attribute, so it is skipped by Tab and
|
|
73
|
-
exposes no focusable disabled state. `spec:AST-085` FR1 has a disabled control
|
|
74
|
-
expose `aria-disabled="true"` and keep its tab stop.
|
|
75
71
|
- **A disabled parent stays operable in a collapsed rail.** In a collapsed rail,
|
|
76
72
|
a disabled item with children renders its flyout trigger with neither
|
|
77
73
|
`disabled` nor `aria-disabled`, so it keeps its tab stop and announces no
|
|
@@ -125,7 +121,7 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
125
121
|
|
|
126
122
|
| ID | Invariant | Basis |
|
|
127
123
|
| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
|
|
128
|
-
| FR1 | The primary element is the `as` component, else the `LinkProvider` link, else `<a>`, when `href` is set and the item is enabled; otherwise a `<button type="button">`. A disabled item
|
|
124
|
+
| FR1 | The primary element is the `as` component, else the `LinkProvider` link, else `<a>`, when `href` is set and the item is enabled; otherwise a `<button type="button">`. A disabled item stays focusable with `aria-disabled="true"`, keeps its tab stop, and keeps focus when it becomes disabled (`spec:AST-085` FR1, FR4). It shows the icon (`selectedIcon` when selected and given), the label, `endContent`, and, for a whole-row collapsible item, a chevron. `endContent` is passive and renders inside the primary element. | Current source and tests |
|
|
129
125
|
| FR2 | In an expanded rail and on a collapsed leaf, `isSelected` sets `aria-current="page"` on the primary element, never on a row wrapper. A collapsed parent's flyout trigger carries no `aria-current`. | Current source and tests |
|
|
130
126
|
| FR3 | A disabled item does not fire `onClick` or navigate. Its row actions stay operable. | Current source and tests |
|
|
131
127
|
| FR4 | `actions` render as siblings of the primary element at the row's trailing edge, after the toggle and before nested children in DOM and focus order, at the row's control size (`sm`) unless a control sets its own (`architecture:component-size-cascade`). Clicking an action neither activates nor toggles the row. A row wrapper exists only when there are actions or an independent toggle; a falsy `actions` adds none. | Current source and tests |
|
|
@@ -146,16 +142,16 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
146
142
|
|
|
147
143
|
### Representative states
|
|
148
144
|
|
|
149
|
-
| State | Required invariant
|
|
150
|
-
| -------------------------- |
|
|
151
|
-
| Link, selected | `aria-current="page"` on the link; selected icon if given.
|
|
152
|
-
| Disabled button | `aria-disabled`; focusable; no `onClick`.
|
|
153
|
-
| Collapsible without action | Whole row toggles; chevron turns.
|
|
154
|
-
| Collapsible with `href` | Link navigates; separate toggle button collapses.
|
|
155
|
-
| Actions | Actions after toggle, before children; never activate the row.
|
|
156
|
-
| Collapsed rail leaf | Icon-only; tooltip with label.
|
|
157
|
-
| Collapsed rail parent | Icon-only trigger; flyout with header and children.
|
|
158
|
-
| Mobile drawer | Activation closes the drawer.
|
|
145
|
+
| State | Required invariant | Allowed variation |
|
|
146
|
+
| -------------------------- | -------------------------------------------------------------- | ----------------- |
|
|
147
|
+
| Link, selected | `aria-current="page"` on the link; selected icon if given. | Fill. |
|
|
148
|
+
| Disabled button | `aria-disabled`; focusable; no `onClick`. | Muted styling. |
|
|
149
|
+
| Collapsible without action | Whole row toggles; chevron turns. | — |
|
|
150
|
+
| Collapsible with `href` | Link navigates; separate toggle button collapses. | — |
|
|
151
|
+
| Actions | Actions after toggle, before children; never activate the row. | Action content. |
|
|
152
|
+
| Collapsed rail leaf | Icon-only; tooltip with label. | — |
|
|
153
|
+
| Collapsed rail parent | Icon-only trigger; flyout with header and children. | Delay. |
|
|
154
|
+
| Mobile drawer | Activation closes the drawer. | — |
|
|
159
155
|
|
|
160
156
|
### Transformation and precedence order
|
|
161
157
|
|
|
@@ -211,16 +207,10 @@ is recorded. Row geometry visual intent is `component:SideNav` DD1.
|
|
|
211
207
|
| FR11 | `SideNav.test.tsx` focus ring suite | Plain, split, actions rows | Missing shared ring classes fail. | `audit:SideNavItem/accessibility` |
|
|
212
208
|
| FR3, FR7, FR9 | `SideNav.test.tsx` keyboard operation and focus management suites | Tab order, Enter/Space toggle, flyout Escape | Lost order, a stranded focus, or no focus return fails. | `audit:SideNavItem/accessibility` |
|
|
213
209
|
|
|
214
|
-
Pending conformance: the SideNavItem suite's native-`disabled` assertion and
|
|
215
|
-
the keyboard suite's disabled Tab-skip assertion pin FR1's implementation gap;
|
|
216
|
-
they change when disabled items follow `spec:AST-085`.
|
|
217
|
-
|
|
218
210
|
Read from source, with no focused test yet:
|
|
219
211
|
|
|
220
|
-
- FR1 and ORD1–ORD2:
|
|
221
|
-
|
|
222
|
-
button's `type="button"`, the icon, the selected-icon swap, and the whole-row
|
|
223
|
-
chevron.
|
|
212
|
+
- FR1 and ORD1–ORD2: the button's `type="button"`, the icon, the
|
|
213
|
+
selected-icon swap, and the whole-row chevron.
|
|
224
214
|
- FR4: the actions' trailing-edge placement and the wrapper for an independent
|
|
225
215
|
toggle without actions.
|
|
226
216
|
- FR5: the forwarded `ref` and `xstyle` on the outer box.
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* provided and fall back to `label` when it is missing or blank. Their label
|
|
14
14
|
* tooltip binds to the interactive control through a callback ref, so hover,
|
|
15
15
|
* keyboard focus, and `aria-describedby` follow the control from the first
|
|
16
|
-
* collapsed render. A disabled control takes
|
|
17
|
-
*
|
|
16
|
+
* collapsed render. A disabled control takes no pointer, so its row listens
|
|
17
|
+
* for the tooltip instead, while the control keeps focus and the description.
|
|
18
18
|
*
|
|
19
19
|
* Collapsed items with children open their submenu flyout through
|
|
20
20
|
* `useMenuHover`, the shared hover-intent hook (same one `SideNavHeading` and
|
|
@@ -74,6 +74,7 @@ import {
|
|
|
74
74
|
import {useSideNavRenderMode} from './SideNavRenderContext';
|
|
75
75
|
import {useAppShellMobile} from '../AppShell/AppShellMobileContext';
|
|
76
76
|
import {themeProps} from '../utils/themeProps';
|
|
77
|
+
import {disabledInteractionProps} from '../utils/disabledInteraction';
|
|
77
78
|
import {useTranslator} from '../i18n';
|
|
78
79
|
|
|
79
80
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
@@ -324,6 +325,8 @@ interface NavItemElementProps {
|
|
|
324
325
|
/**
|
|
325
326
|
* Renders `<a>` (via LinkComponent) when `href` is set, otherwise `<button>`.
|
|
326
327
|
* Centralizes the link-vs-button decision used across all SideNavItem paths.
|
|
328
|
+
* A disabled item is a `<button>` that keeps its tab stop and exposes
|
|
329
|
+
* `aria-disabled`, but is inert (spec:AST-085 FR1, FR2).
|
|
327
330
|
*/
|
|
328
331
|
function NavItemElement({
|
|
329
332
|
href,
|
|
@@ -351,8 +354,16 @@ function NavItemElement({
|
|
|
351
354
|
ref={ref as React.Ref<HTMLButtonElement>}
|
|
352
355
|
type="button"
|
|
353
356
|
onClick={onClick}
|
|
354
|
-
|
|
355
|
-
{...
|
|
357
|
+
{...rest}
|
|
358
|
+
{...(isDisabled
|
|
359
|
+
? {
|
|
360
|
+
'aria-disabled': true,
|
|
361
|
+
...disabledInteractionProps(
|
|
362
|
+
rest.onKeyDown as
|
|
363
|
+
React.KeyboardEventHandler<HTMLButtonElement> | undefined,
|
|
364
|
+
),
|
|
365
|
+
}
|
|
366
|
+
: null)}>
|
|
356
367
|
{children}
|
|
357
368
|
</button>
|
|
358
369
|
);
|
|
@@ -539,6 +550,10 @@ export function SideNavItem({
|
|
|
539
550
|
const isRailLeaf = isCollapsed && !hasChildren;
|
|
540
551
|
const railTooltip = useTooltip({
|
|
541
552
|
placement: 'end',
|
|
553
|
+
// A disabled leaf's row is the trigger (see the collapsed path). It is not
|
|
554
|
+
// focusable itself, so `auto` would never hear the focus that bubbles up
|
|
555
|
+
// from its control.
|
|
556
|
+
focusTrigger: 'always',
|
|
542
557
|
isEnabled: isRailLeaf,
|
|
543
558
|
isOpen: isRailLeaf ? undefined : false,
|
|
544
559
|
});
|
|
@@ -702,14 +717,17 @@ export function SideNavItem({
|
|
|
702
717
|
|
|
703
718
|
// Items without children: icon-only link or button, its label in a
|
|
704
719
|
// tooltip. The control is the trigger, so the element that takes focus is
|
|
705
|
-
// the one described. A disabled control takes
|
|
706
|
-
// (`navItemStyles.disabled`)
|
|
720
|
+
// the one described. A disabled control takes no pointer
|
|
721
|
+
// (`navItemStyles.disabled`), so its row listens for the tooltip instead;
|
|
722
|
+
// the control still takes focus (focusin reaches the row) and stays the
|
|
723
|
+
// element described (spec:AST-085 FR5).
|
|
707
724
|
const isRowTrigger = isDisabled;
|
|
708
725
|
const collapsedAriaProps = {
|
|
709
726
|
'aria-current': isSelected ? ('page' as const) : undefined,
|
|
710
|
-
'aria-describedby':
|
|
711
|
-
|
|
712
|
-
|
|
727
|
+
'aria-describedby': joinIds(
|
|
728
|
+
rest['aria-describedby'],
|
|
729
|
+
railTooltip.describedBy,
|
|
730
|
+
),
|
|
713
731
|
'aria-disabled': isDisabled || undefined,
|
|
714
732
|
'aria-label': collapsedAccessibleLabel,
|
|
715
733
|
'data-testid': testId,
|
|
@@ -732,7 +750,6 @@ export function SideNavItem({
|
|
|
732
750
|
return (
|
|
733
751
|
<div
|
|
734
752
|
ref={isRowTrigger ? railTooltip.ref : undefined}
|
|
735
|
-
aria-describedby={isRowTrigger ? railTooltip.describedBy : undefined}
|
|
736
753
|
{...stylex.props(styles.root, xstyle)}>
|
|
737
754
|
{collapsedElement}
|
|
738
755
|
{railTooltip.renderTooltip(label)}
|
|
@@ -97,7 +97,9 @@ const styles = stylex.create({
|
|
|
97
97
|
},
|
|
98
98
|
animate: {
|
|
99
99
|
animationDirection: 'alternate',
|
|
100
|
-
|
|
100
|
+
// The loop reads the duration before a theme's tempo scales it
|
|
101
|
+
// (spec:AST-108 FR4).
|
|
102
|
+
animationDuration: `var(--_astryx-pre-tempo-duration-medium-max, ${durationVars['--duration-medium-max']})`,
|
|
101
103
|
animationIterationCount: 'infinite',
|
|
102
104
|
// Disable the pulse under reduced-motion; the static placeholder still
|
|
103
105
|
// reads as loading (complex-20).
|
package/src/Spinner/Spinner.tsx
CHANGED
|
@@ -334,7 +334,9 @@ const styles = stylex.create({
|
|
|
334
334
|
// it (a frozen spinner reads as broken), matching ProgressBar's approach.
|
|
335
335
|
// The role="status" + "Loading" label still convey busy state (obs-6).
|
|
336
336
|
animationDuration: {
|
|
337
|
-
|
|
337
|
+
// The loop reads the duration before a theme's tempo scales it
|
|
338
|
+
// (spec:AST-108 FR4).
|
|
339
|
+
default: `var(--_astryx-pre-tempo-duration-slow-min, ${durationVars['--duration-slow-min']})`,
|
|
338
340
|
'@media (prefers-reduced-motion: reduce)': '3s',
|
|
339
341
|
},
|
|
340
342
|
animationIterationCount: 'infinite',
|
package/src/Stepper/Step.spec.md
CHANGED
|
@@ -28,15 +28,15 @@ system_specs: [spec:AST-085]
|
|
|
28
28
|
|
|
29
29
|
## Contract at a glance
|
|
30
30
|
|
|
31
|
-
| Area | Contract
|
|
32
|
-
| ----------------------- |
|
|
33
|
-
| Public contract | `Step` with `step`, `label`, `description`, `children`, `status`, `indicator` (`auto`, `number`, `none`, or a node; default `auto`), `isDisabled`, `isOptional`, `endContent`, and `density`.
|
|
34
|
-
| Behavior | One list item of a Stepper. Its progress (completed, in progress, not started) comes from its `step` index against the Stepper's active step; it is a button that asks to go to that step when the Stepper has `onStepClick
|
|
35
|
-
| End-user impact | Users see each step's progress (number, ring, or check) and its status cue where one applies; screen-reader users hear the current step, a status word,
|
|
36
|
-
| Builder impact | None.
|
|
37
|
-
| Compatibility/readiness | Records shipped behavior; no public change.
|
|
38
|
-
| Review checks | Reject status conveyed only by color under `indicator="auto"`, an indicator exposed to assistive technology, a disabled step that activates, or `aria-current` on anything but the in-progress step.
|
|
39
|
-
| Governing rules | `component:Stepper` (targets, connector, label paint, compact layout); `architecture:interaction-modality`.
|
|
31
|
+
| Area | Contract |
|
|
32
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
33
|
+
| Public contract | `Step` with `step`, `label`, `description`, `children`, `status`, `indicator` (`auto`, `number`, `none`, or a node; default `auto`), `isDisabled`, `isOptional`, `endContent`, and `density`. |
|
|
34
|
+
| Behavior | One list item of a Stepper. Its progress (completed, in progress, not started) comes from its `step` index against the Stepper's active step; it is a button that asks to go to that step when the Stepper has `onStepClick` and is not compact; a disabled step keeps its button, `aria-disabled`, and never activates. |
|
|
35
|
+
| End-user impact | Users see each step's progress (number, ring, or check) and its status cue where one applies; screen-reader users hear the current step, a status word, a "Go to step N" name and the step's description on clickable steps; keyboard users Tab between clickable steps, disabled ones included. |
|
|
36
|
+
| Builder impact | None. |
|
|
37
|
+
| Compatibility/readiness | Records shipped behavior; no public change. Two implementation gaps (see Current-state impact). |
|
|
38
|
+
| Review checks | Reject status conveyed only by color under `indicator="auto"`, an indicator exposed to assistive technology, a disabled step that activates, or `aria-current` on anything but the in-progress step. |
|
|
39
|
+
| Governing rules | `component:Stepper` (targets, connector, label paint, compact layout); `architecture:interaction-modality`. |
|
|
40
40
|
|
|
41
41
|
This table is a review projection; the body below is authoritative.
|
|
42
42
|
|
|
@@ -56,12 +56,6 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
56
56
|
|
|
57
57
|
## Current-state impact
|
|
58
58
|
|
|
59
|
-
- **A disabled step leaves the tab order.** In a clickable Stepper outside
|
|
60
|
-
compact mode a disabled Step renders no button, so keyboard users cannot reach
|
|
61
|
-
it or learn that it is disabled, and a focused step that becomes disabled
|
|
62
|
-
loses its button, dropping focus to the page. `spec:AST-085` FR1, FR4, and FR5
|
|
63
|
-
have a disabled control stay focusable, keep focus, and expose
|
|
64
|
-
`aria-disabled="true"`.
|
|
65
59
|
- **Other indicator modes show status by color alone, or not at all.** With
|
|
66
60
|
`indicator="number"`, a reached step shows status only through badge color
|
|
67
61
|
and a not-started step shows none. A custom node shows status only through
|
|
@@ -70,9 +64,9 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
70
64
|
its `status`, so in both cases status shows only in the visually hidden word. WCAG 1.4.1 requires information
|
|
71
65
|
not to be conveyed by color alone.
|
|
72
66
|
- **A clickable step's name hides its other text.** The button's name is the
|
|
73
|
-
step number, label, and status word, and
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
step number, label, and status word, and only the description describes it,
|
|
68
|
+
so the "Optional" cue and `endContent` never reach assistive technology on a
|
|
69
|
+
clickable step. WCAG 1.3.1 requires information shown to be
|
|
76
70
|
available programmatically.
|
|
77
71
|
|
|
78
72
|
## Ownership boundary
|
|
@@ -105,17 +99,17 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
105
99
|
|
|
106
100
|
## Behavioral and layout contract
|
|
107
101
|
|
|
108
|
-
| ID | Invariant
|
|
109
|
-
| --- |
|
|
110
|
-
| FR1 | A Step renders one `<li>`. Its progress is `in-progress` when `step` equals the Stepper's active step, `completed` when it is lower, and `not-started` when higher; only the in-progress step carries `aria-current="step"`. It registers its index and a live disabled check with the Stepper.
|
|
111
|
-
| FR2 | With `onStepClick` on the Stepper, an enabled Step outside compact mode wraps its indicator, label, and description in a `<button>` (the content slot stays outside it) named by `@astryx.step.goToStep` ("Go to step N: label") or `.goToStepWithStatus` when a status word applies; activation (click, Enter, Space) calls `onStepClick(step)`. Completed, in-progress, and upcoming steps are all clickable. Any Step without `onStepClick` renders no button. A disabled Step in a clickable Stepper outside compact mode
|
|
112
|
-
| FR3 | `indicator="auto"` shows the number while not started, the ring while in progress, and a check once completed; `number` always shows the number; `none` shows nothing; a non-string node renders as given; any other string falls back to the ring while not started or in progress and the check once completed, with no number, status glyph, or status color. Indicators are `aria-hidden`.
|
|
113
|
-
| FR4 | `status` never recolors the progress bar. Under `indicator="auto"` it recolors a non-current step with `success`, `warning`, or `error` and shows a distinct status glyph (replacing the number on not-started steps); the current step's ring and `accent` keep progress color. Under `number` it recolors reached badges only.
|
|
114
|
-
| FR5 | Each Step exposes a visually hidden status word: `error` or `warning` for those statuses, `completed` when completed or `success`, in every layout.
|
|
115
|
-
| FR6 | `isDisabled` dims the indicator with fixed paint and no theme state (the label's disabled paint and its `disabled` selector are `component:Stepper` FR10) and blocks activation (FR2
|
|
116
|
-
| FR7 | `density` sets the Step's padding: block padding in every layout, plus inline padding for spacious separated steps and both axes for vertical on-track steps; it falls back to the Stepper's density.
|
|
117
|
-
| FR8 | `children` render below the label and description; in a compact horizontal Stepper they stay mounted, hidden with the expanded details, so local state survives. The label stays on one line and ellipsizes; its full text remains in the accessible name.
|
|
118
|
-
| FR9 | The step button paints the shared focus outline.
|
|
102
|
+
| ID | Invariant | Basis |
|
|
103
|
+
| --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
|
|
104
|
+
| FR1 | A Step renders one `<li>`. Its progress is `in-progress` when `step` equals the Stepper's active step, `completed` when it is lower, and `not-started` when higher; only the in-progress step carries `aria-current="step"`. It registers its index and a live disabled check with the Stepper. | Current source and tests |
|
|
105
|
+
| FR2 | With `onStepClick` on the Stepper, an enabled Step outside compact mode wraps its indicator, label, and description in a `<button>` (the content slot stays outside it) named by `@astryx.step.goToStep` ("Go to step N: label") or `.goToStepWithStatus` when a status word applies; activation (click, Enter, Space) calls `onStepClick(step)`. Completed, in-progress, and upcoming steps are all clickable. Any Step without `onStepClick` renders no button. A disabled Step in a clickable Stepper outside compact mode keeps its button, focusable with `aria-disabled="true"` and the same name, keeps its tab stop and its focus when it becomes disabled while focused, and does not activate (`spec:AST-085` FR1, FR4). A clickable Step's description describes its button, so a disabled step's reason reaches assistive technology (`spec:AST-085` FR5). | Current source and tests |
|
|
106
|
+
| FR3 | `indicator="auto"` shows the number while not started, the ring while in progress, and a check once completed; `number` always shows the number; `none` shows nothing; a non-string node renders as given; any other string falls back to the ring while not started or in progress and the check once completed, with no number, status glyph, or status color. Indicators are `aria-hidden`. | Current source and tests |
|
|
107
|
+
| FR4 | `status` never recolors the progress bar. Under `indicator="auto"` it recolors a non-current step with `success`, `warning`, or `error` and shows a distinct status glyph (replacing the number on not-started steps); the current step's ring and `accent` keep progress color. Under `number` it recolors reached badges only. | Current source and tests |
|
|
108
|
+
| FR5 | Each Step exposes a visually hidden status word: `error` or `warning` for those statuses, `completed` when completed or `success`, in every layout. | Current source and tests |
|
|
109
|
+
| FR6 | `isDisabled` dims the indicator with fixed paint and no theme state (the label's disabled paint and its `disabled` selector are `component:Stepper` FR10) and blocks activation (FR2). `isOptional` appends the translated `@astryx.step.optional` ("Optional") after the label. `endContent` sits at the end of the label row. | Current source and tests |
|
|
110
|
+
| FR7 | `density` sets the Step's padding: block padding in every layout, plus inline padding for spacious separated steps and both axes for vertical on-track steps; it falls back to the Stepper's density. | Current source |
|
|
111
|
+
| FR8 | `children` render below the label and description; in a compact horizontal Stepper they stay mounted, hidden with the expanded details, so local state survives. The label stays on one line and ellipsizes; its full text remains in the accessible name. | Current source, docs, and tests |
|
|
112
|
+
| FR9 | The step button paints the shared focus outline. | Current source |
|
|
119
113
|
|
|
120
114
|
### Allowed variation
|
|
121
115
|
|
|
@@ -129,7 +123,7 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
129
123
|
| Completed, clickable | Check indicator; "completed" text; named button. | Status color. |
|
|
130
124
|
| In progress | `aria-current="step"`; ring indicator. | — |
|
|
131
125
|
| Not started with error | Error glyph replaces the number; "error" text. | — |
|
|
132
|
-
| Disabled | Dimmed;
|
|
126
|
+
| Disabled | Dimmed; focusable and `aria-disabled`; no activation (FR2). | — |
|
|
133
127
|
| Compact horizontal | No button; content mounted but hidden. | — |
|
|
134
128
|
|
|
135
129
|
### Transformation and precedence order
|
|
@@ -152,11 +146,11 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
152
146
|
hidden word (Current-state
|
|
153
147
|
impact).
|
|
154
148
|
- **AR3 — Clickable name.** FR2's button name includes the step number, label,
|
|
155
|
-
and status word
|
|
156
|
-
cue
|
|
157
|
-
-
|
|
158
|
-
|
|
159
|
-
|
|
149
|
+
and status word, and the step's description describes it. Implementation gap:
|
|
150
|
+
a clickable step's optional cue and `endContent` are not exposed
|
|
151
|
+
(Current-state impact).
|
|
152
|
+
- **AR4 — Keyboard.** Clickable steps, disabled ones included, are reached with
|
|
153
|
+
Tab in document order; enabled ones activate with Enter or Space.
|
|
160
154
|
|
|
161
155
|
## Design relationships
|
|
162
156
|
|
|
@@ -175,13 +169,13 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
175
169
|
|
|
176
170
|
## Verification map
|
|
177
171
|
|
|
178
|
-
| Contract | Verification | Representative states | Mutation or failure expectation
|
|
179
|
-
| ------------ | ------------------------------------------------------------------- | ------------------------------------- |
|
|
180
|
-
| FR1 | `Stepper.test.tsx` list and aria-current tests | Each progress | Wrong current step fails.
|
|
181
|
-
| FR2, AR3–AR4 | `Stepper.test.tsx` onStepClick, keyboard, and accessible-name tests | Completed, active, upcoming, disabled | A missing button or wrong name fails
|
|
182
|
-
| FR3, FR4 | `Stepper.test.tsx` step-number, indicator, and status glyph tests | Each indicator mode and status | Wrong glyph or recolored bar fails.
|
|
183
|
-
| FR8 | `Stepper.test.tsx` compact content-mount tests | Both indicator positions | Step content that loses its state while hidden in a compact Stepper fails.
|
|
184
|
-
| FR5, AR2 | `Stepper.test.tsx` hidden status text tests | Separated and on-track | Missing status text fails.
|
|
172
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
173
|
+
| ------------ | ------------------------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
|
|
174
|
+
| FR1 | `Stepper.test.tsx` list and aria-current tests | Each progress | Wrong current step fails. | `audit:Step/accessibility` |
|
|
175
|
+
| FR2, AR3–AR4 | `Stepper.test.tsx` onStepClick, keyboard, and accessible-name tests | Completed, active, upcoming, disabled | A missing button or wrong name fails, and so does a disabled step that leaves the tab order, loses focus when it becomes disabled, lacks `aria-disabled`, or activates. | `audit:Step/behavior` |
|
|
176
|
+
| FR3, FR4 | `Stepper.test.tsx` step-number, indicator, and status glyph tests | Each indicator mode and status | Wrong glyph or recolored bar fails. | `audit:Step/behavior` |
|
|
177
|
+
| FR8 | `Stepper.test.tsx` compact content-mount tests | Both indicator positions | Step content that loses its state while hidden in a compact Stepper fails. | `audit:Step/behavior` |
|
|
178
|
+
| FR5, AR2 | `Stepper.test.tsx` hidden status text tests | Separated and on-track | Missing status text fails. | `audit:Step/accessibility` |
|
|
185
179
|
|
|
186
180
|
Read from source, with no focused test yet:
|
|
187
181
|
|