@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
|
@@ -120,16 +120,30 @@ function bindingState(id: string): CarouselBindingRow {
|
|
|
120
120
|
return state;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
// Checking coverage runs every state again, which on a loaded runner nears
|
|
124
|
+
// the per-test timeout as one test. It runs as one serial part per state,
|
|
125
|
+
// sharing their results, then one check over all of them.
|
|
126
|
+
test.describe('every expectation is exercised by at least one Carousel state', () => {
|
|
127
|
+
test.describe.configure({mode: 'serial'});
|
|
127
128
|
const results: BindingResult[] = [];
|
|
129
|
+
|
|
128
130
|
for (const state of CAROUSEL_BINDING_STATES) {
|
|
129
|
-
|
|
131
|
+
test(`runs ${state.id}`, async ({page}) => {
|
|
132
|
+
const cdp = await page.context().newCDPSession(page);
|
|
133
|
+
results.push(await runState(page, cdp, state));
|
|
134
|
+
});
|
|
130
135
|
}
|
|
131
|
-
|
|
132
|
-
|
|
136
|
+
|
|
137
|
+
test('no expectation is left unexercised', () => {
|
|
138
|
+
// Every part ran in this worker; this test alone proves nothing.
|
|
139
|
+
expect(results.map(result => result.state).sort()).toEqual(
|
|
140
|
+
CAROUSEL_BINDING_STATES.map(state => state.id).sort(),
|
|
141
|
+
);
|
|
142
|
+
expect(neverExercised(results)).toEqual([]);
|
|
143
|
+
expect(unmatchedKnownFailures(CAROUSEL_KNOWN_FAILURES, results)).toEqual(
|
|
144
|
+
[],
|
|
145
|
+
);
|
|
146
|
+
});
|
|
133
147
|
});
|
|
134
148
|
|
|
135
149
|
for (const state of CAROUSEL_BINDING_STATES) {
|
|
@@ -9,19 +9,4 @@
|
|
|
9
9
|
|
|
10
10
|
import type {KnownFailure} from '@astryxdesign/a11y-spec';
|
|
11
11
|
|
|
12
|
-
export const CAROUSEL_KNOWN_FAILURES: ReadonlyArray<KnownFailure> = [
|
|
13
|
-
{
|
|
14
|
-
expectation: 'carousel.scroller.role-and-name',
|
|
15
|
-
binding: 'Carousel',
|
|
16
|
-
state: 'scroller-keyboard',
|
|
17
|
-
evidenceLayer: 'accessibility-tree',
|
|
18
|
-
failureEquals:
|
|
19
|
-
'the browser exposes the focusable scroll container with no role',
|
|
20
|
-
standardsReference:
|
|
21
|
-
'WCAG 2.2 4.1.2 Name, Role, Value; Astryx spec:AST-025 FR12 — a viewport that takes keyboard scrolling must provide an appropriate role and accessible name',
|
|
22
|
-
userImpact:
|
|
23
|
-
'A keyboard user who tabs onto the scroll container hears nothing about where they are or what the arrow keys will do; the named region around it is the only clue.',
|
|
24
|
-
reason:
|
|
25
|
-
'This test-only binding records the gap; naming the scroll container is a Carousel markup change that ships as its own spec-backed fix.',
|
|
26
|
-
},
|
|
27
|
-
];
|
|
12
|
+
export const CAROUSEL_KNOWN_FAILURES: ReadonlyArray<KnownFailure> = [];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
schema_version: 3
|
|
3
|
-
template_version:
|
|
3
|
+
template_version: 7
|
|
4
4
|
kind: component
|
|
5
5
|
id: component:ChatComposerTokenElement
|
|
6
|
-
authority:
|
|
6
|
+
authority: current
|
|
7
7
|
archive_reason: null
|
|
8
8
|
superseded_by: null
|
|
9
|
-
approved_by:
|
|
10
|
-
approved_at:
|
|
9
|
+
approved_by: cixzhang
|
|
10
|
+
approved_at: 2026-10-31
|
|
11
11
|
owners: [cixzhang]
|
|
12
12
|
review_triggers: [public-api, behavior, accessibility, theming, testing]
|
|
13
13
|
verified_by:
|
|
@@ -33,15 +33,15 @@ system_specs: [spec:AST-002, spec:AST-029]
|
|
|
33
33
|
|
|
34
34
|
## Contract at a glance
|
|
35
35
|
|
|
36
|
-
| Area | Contract
|
|
37
|
-
| ----------------------- |
|
|
38
|
-
| Public contract |
|
|
39
|
-
| Behavior | A structured token renders Badge content; a custom token renders caller content. Both retain the serialized value marker and stay non-editable when placed inside a contenteditable composer.
|
|
40
|
-
| End-user impact | Token labels and caller content remain visible without becoming editable text.
|
|
41
|
-
| Builder impact |
|
|
42
|
-
| Compatibility/readiness |
|
|
43
|
-
| Review checks | Reject a token wrapper that loses its serialized value, becomes editable, drops accepted span props, or changes the structured/custom rendering split.
|
|
44
|
-
| Governing rules | `architecture:public-component-api/INV1, INV5–INV6, INV8–INV9, INV12`; `architecture:component-test-sufficiency/INV1–INV8, INV10–INV11`; `spec:AST-029/FR3–FR5, FR7`.
|
|
36
|
+
| Area | Contract |
|
|
37
|
+
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
|
+
| Public contract | `ChatComposerTokenElement` with a required `token`: structured, which is `value` plus Badge props, of which only `label`, `variant`, and `icon` render and the rest are accepted and ignored; or custom `{value, render}`, `ref`, `xstyle`, `className`, `style`, and neutral span props. |
|
|
39
|
+
| Behavior | A structured token renders Badge content; a custom token renders caller content. Both retain the serialized value marker and stay non-editable when placed inside a contenteditable composer. |
|
|
40
|
+
| End-user impact | Token labels and caller content remain visible without becoming editable text. |
|
|
41
|
+
| Builder impact | None. |
|
|
42
|
+
| Compatibility/readiness | Records shipped behavior; no public change. Evidence still pending for AR1 and parts of FR1, FR2, and FR4 (read from source; see the verification map). |
|
|
43
|
+
| Review checks | Reject a token wrapper that loses its serialized value, becomes editable, drops accepted span props, or changes the structured/custom rendering split. |
|
|
44
|
+
| Governing rules | `architecture:public-component-api/INV1, INV5–INV6, INV8–INV9, INV12`; `architecture:component-test-sufficiency/INV1–INV8, INV10–INV11`; `spec:AST-029/FR3–FR5, FR7`. |
|
|
45
45
|
|
|
46
46
|
This table is a review projection; the body below is authoritative.
|
|
47
47
|
|
|
@@ -54,11 +54,13 @@ their existing owners.
|
|
|
54
54
|
|
|
55
55
|
## Compatibility and migration
|
|
56
56
|
|
|
57
|
-
- Released default preserved: yes
|
|
58
|
-
- Compatibility class:
|
|
59
|
-
-
|
|
57
|
+
- Released default preserved: `yes`
|
|
58
|
+
- Compatibility class: records shipped behavior; no public change
|
|
59
|
+
- Controlled/uncontrolled behavior: not applicable
|
|
60
60
|
- Migration decision: none
|
|
61
61
|
|
|
62
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
63
|
+
|
|
62
64
|
## Ownership boundary
|
|
63
65
|
|
|
64
66
|
**Owns**
|
|
@@ -85,12 +87,12 @@ their existing owners.
|
|
|
85
87
|
|
|
86
88
|
## Behavioral and layout contract
|
|
87
89
|
|
|
88
|
-
| ID |
|
|
89
|
-
| --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
90
|
-
| FR1 | The root MUST expose `data-astryx-token` and the exact supplied `token.value`, and MUST remain `contentEditable={false}`. |
|
|
91
|
-
| FR2 | Structured tokens MUST delegate label, variant, and icon rendering to Badge without changing the token value. | shipped implementation and public token type
|
|
92
|
-
| FR3 | Custom tokens MUST render the caller function result without adding component-owned semantics or interaction. | shipped implementation and public token type
|
|
93
|
-
| FR4 | Accepted ref, DOM/data/ARIA, className, style, and xstyle inputs MUST reach and compose on the root span while component-owned serialization attributes retain precedence. | `architecture:public-component-api/INV5–INV6, INV8`
|
|
90
|
+
| ID | Invariant | Basis |
|
|
91
|
+
| --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
92
|
+
| FR1 | The root MUST expose `data-astryx-token` and the exact supplied `token.value`, and MUST remain `contentEditable={false}`. | Current source, docs, and tests |
|
|
93
|
+
| FR2 | Structured tokens MUST delegate label, variant, and icon rendering to Badge without changing the token value. | shipped implementation and public token type |
|
|
94
|
+
| FR3 | Custom tokens MUST render the caller function result without adding component-owned semantics or interaction. | shipped implementation and public token type |
|
|
95
|
+
| FR4 | Accepted ref, DOM/data/ARIA, className, style, and xstyle inputs MUST reach and compose on the root span while component-owned serialization attributes retain precedence. | `architecture:public-component-api/INV5–INV6, INV8` |
|
|
94
96
|
|
|
95
97
|
### Allowed variation
|
|
96
98
|
|
|
@@ -108,15 +110,18 @@ their existing owners.
|
|
|
108
110
|
|
|
109
111
|
## Accessibility contract
|
|
110
112
|
|
|
111
|
-
- The wrapper owns no interactive role or
|
|
112
|
-
|
|
113
|
-
-
|
|
113
|
+
- **AR1 — No owned semantics.** The wrapper owns no interactive role or
|
|
114
|
+
accessible name beyond accepted caller props.
|
|
115
|
+
- **AR2 — Visible content.** Structured Badge text remains visible content;
|
|
116
|
+
custom content semantics remain caller owned.
|
|
117
|
+
- **AR3 — Atomic token.** `contentEditable={false}` keeps the token atomically
|
|
118
|
+
non-editable when nested in an editor.
|
|
114
119
|
|
|
115
120
|
## Design relationships
|
|
116
121
|
|
|
117
122
|
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
118
123
|
| ------------------ | ------------------------- | ------------------------ | -------------- | ------------------ |
|
|
119
|
-
| token wrapper | Inline alignment only |
|
|
124
|
+
| token wrapper | Inline alignment only | Current source | supporting | FR1, FR4 |
|
|
120
125
|
| structured content | Badge presentation | `component:Badge` | supporting | FR2 |
|
|
121
126
|
| custom content | caller-owned presentation | caller | supporting | FR3 |
|
|
122
127
|
|
|
@@ -128,19 +133,26 @@ target. Badge theming remains owned by Badge, and custom content remains caller
|
|
|
128
133
|
- `component:ChatComposerInput` owns insertion, serialization traversal, deletion, and selection behavior.
|
|
129
134
|
- `architecture:public-component-api` owns the public props type, ref, and BaseProps composition.
|
|
130
135
|
- `architecture:component-test-sufficiency` owns direct evidence for the established public serialization seam.
|
|
131
|
-
- `spec:AST-029` owns
|
|
136
|
+
- `spec:AST-029` owns the audit evidence inventory this record's verification map follows.
|
|
132
137
|
|
|
133
138
|
## Verification map
|
|
134
139
|
|
|
135
|
-
| Contract
|
|
136
|
-
|
|
|
137
|
-
| FR1–FR3
|
|
138
|
-
| FR4
|
|
139
|
-
| rendered states
|
|
140
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
141
|
+
| ---------------- | ------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------- |
|
|
142
|
+
| FR1–FR3, AR2–AR3 | `ChatComposerTokenElement.test.tsx`; direct Storybook stories | structured and custom tokens | A marker/value disappears, the wrapper becomes editable, or the wrong rendering branch appears. | `audit:ChatComposerTokenElement/behavior` |
|
|
143
|
+
| FR4 | focused ref and DOM-passthrough test; public typecheck | ref, ARIA/data props, styling seams | An accepted input is dropped or an owned serialization marker is replaced. | `audit:ChatComposerTokenElement/api` |
|
|
144
|
+
| rendered states | direct Storybook stories | Badge and custom content in supported themes | An unreachable story fails the story checks. | `audit:ChatComposerTokenElement/rendered` |
|
|
145
|
+
|
|
146
|
+
Read from source, with no focused test yet:
|
|
147
|
+
|
|
148
|
+
- AR1: the wrapper adding no role or accessible name of its own.
|
|
149
|
+
- FR1: `contentEditable` staying `false` when a caller passes it.
|
|
150
|
+
- FR2: `variant` and `icon` reaching the Badge.
|
|
151
|
+
- FR4: `className`, `style`, and `xstyle` composing on the span.
|
|
140
152
|
|
|
141
153
|
## Decision log
|
|
142
154
|
|
|
143
|
-
No component-local
|
|
155
|
+
No component-local decision is recorded.
|
|
144
156
|
|
|
145
157
|
## Open questions
|
|
146
158
|
|
|
@@ -41,17 +41,18 @@ import {FieldLabel} from '../Field/FieldLabel';
|
|
|
41
41
|
import {FieldStatus} from '../FieldStatus/FieldStatus';
|
|
42
42
|
import type {IconType} from '../Icon';
|
|
43
43
|
import type {InputStatus} from '../Field/types';
|
|
44
|
-
import {Spinner} from '../Spinner';
|
|
45
|
-
import {useTooltip} from '../Tooltip';
|
|
46
|
-
import {mergeProps
|
|
44
|
+
import {Spinner} from '../Spinner/Spinner';
|
|
45
|
+
import {useTooltip} from '../Tooltip/useTooltip';
|
|
46
|
+
import {mergeProps} from '../utils/mergeProps';
|
|
47
|
+
import {rtlStyles} from '../utils/rtlStyles';
|
|
47
48
|
import {indicatorScope} from '../Indicator/indicator.markers.stylex';
|
|
48
49
|
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
49
|
-
import {useTranslator} from '../i18n';
|
|
50
|
+
import {useTranslator} from '../i18n/useTranslator';
|
|
50
51
|
import {useIndicatorFocusRing} from '../hooks/useIndicatorFocusRing';
|
|
51
52
|
import {useBusyAnnouncement} from '../hooks/useBusyAnnouncement';
|
|
52
53
|
import {usePressFeedback} from '../hooks/usePressFeedback';
|
|
53
54
|
import {useResolvedRequired} from '../hooks/useResolvedRequired';
|
|
54
|
-
import {useIndicator} from '../Indicator';
|
|
55
|
+
import {useIndicator} from '../Indicator/useIndicator';
|
|
55
56
|
import {themeProps} from '../utils/themeProps';
|
|
56
57
|
|
|
57
58
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
import {Activity, type ReactNode} from 'react';
|
|
3
4
|
import {describe, it, expect, vi} from 'vitest';
|
|
4
5
|
import {render, screen, fireEvent} from '@testing-library/react';
|
|
5
6
|
import userEvent from '@testing-library/user-event';
|
|
6
7
|
import {ClickableCard} from './ClickableCard';
|
|
8
|
+
import {LinkProvider} from '../Link';
|
|
7
9
|
import {
|
|
8
10
|
afterPaintsPress,
|
|
9
11
|
hasReleaseFade,
|
|
@@ -171,6 +173,100 @@ describe('ClickableCard', () => {
|
|
|
171
173
|
expect(handleClick).not.toHaveBeenCalled();
|
|
172
174
|
});
|
|
173
175
|
|
|
176
|
+
it('does not render a disabled link through the router link component', () => {
|
|
177
|
+
function RouterLink({
|
|
178
|
+
href,
|
|
179
|
+
children,
|
|
180
|
+
}: {
|
|
181
|
+
href?: string;
|
|
182
|
+
children?: ReactNode;
|
|
183
|
+
}) {
|
|
184
|
+
if (href == null) {
|
|
185
|
+
throw new Error('Router link requires an href');
|
|
186
|
+
}
|
|
187
|
+
return <a href={href}>{children}</a>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
render(
|
|
191
|
+
<LinkProvider component={RouterLink}>
|
|
192
|
+
<ClickableCard label="Disabled link" href="/settings" isDisabled>
|
|
193
|
+
<span>Content</span>
|
|
194
|
+
</ClickableCard>
|
|
195
|
+
</LinkProvider>,
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
const link = screen.getByRole('link', {name: 'Disabled link'});
|
|
199
|
+
expect(link).toHaveAttribute('aria-disabled', 'true');
|
|
200
|
+
expect(link).not.toHaveAttribute('href');
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('keeps focus when a focused link card toggles its disabled state', async () => {
|
|
204
|
+
const user = userEvent.setup();
|
|
205
|
+
const {rerender} = render(
|
|
206
|
+
<ClickableCard label="Focus card" href="/settings">
|
|
207
|
+
<span>Content</span>
|
|
208
|
+
</ClickableCard>,
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
await user.tab();
|
|
212
|
+
expect(screen.getByRole('link', {name: 'Focus card'})).toHaveFocus();
|
|
213
|
+
|
|
214
|
+
rerender(
|
|
215
|
+
<ClickableCard label="Focus card" href="/settings" isDisabled>
|
|
216
|
+
<span>Content</span>
|
|
217
|
+
</ClickableCard>,
|
|
218
|
+
);
|
|
219
|
+
expect(screen.getByRole('link', {name: 'Focus card'})).toHaveFocus();
|
|
220
|
+
|
|
221
|
+
rerender(
|
|
222
|
+
<ClickableCard label="Focus card" href="/settings">
|
|
223
|
+
<span>Content</span>
|
|
224
|
+
</ClickableCard>,
|
|
225
|
+
);
|
|
226
|
+
expect(screen.getByRole('link', {name: 'Focus card'})).toHaveFocus();
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it('leaves focus where the person put it when a hidden card is revealed', async () => {
|
|
230
|
+
const user = userEvent.setup();
|
|
231
|
+
function Harness({isHidden}: {isHidden: boolean}) {
|
|
232
|
+
return (
|
|
233
|
+
<>
|
|
234
|
+
<Activity mode={isHidden ? 'hidden' : 'visible'}>
|
|
235
|
+
<ClickableCard label="Hidden card" href="/settings">
|
|
236
|
+
<span>Content</span>
|
|
237
|
+
</ClickableCard>
|
|
238
|
+
</Activity>
|
|
239
|
+
<button type="button">Elsewhere</button>
|
|
240
|
+
</>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
const {rerender} = render(<Harness isHidden={false} />);
|
|
244
|
+
await user.tab();
|
|
245
|
+
expect(screen.getByRole('link', {name: 'Hidden card'})).toHaveFocus();
|
|
246
|
+
rerender(<Harness isHidden />);
|
|
247
|
+
screen.getByRole('button', {name: 'Elsewhere'}).focus();
|
|
248
|
+
rerender(<Harness isHidden={false} />);
|
|
249
|
+
expect(screen.getByRole('button', {name: 'Elsewhere'})).toHaveFocus();
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it('takes focus back without scrolling the page', async () => {
|
|
253
|
+
const user = userEvent.setup();
|
|
254
|
+
const {rerender} = render(
|
|
255
|
+
<ClickableCard label="Scroll card" href="/settings">
|
|
256
|
+
<span>Content</span>
|
|
257
|
+
</ClickableCard>,
|
|
258
|
+
);
|
|
259
|
+
await user.tab();
|
|
260
|
+
const focus = vi.spyOn(HTMLElement.prototype, 'focus');
|
|
261
|
+
rerender(
|
|
262
|
+
<ClickableCard label="Scroll card" href="/settings" isDisabled>
|
|
263
|
+
<span>Content</span>
|
|
264
|
+
</ClickableCard>,
|
|
265
|
+
);
|
|
266
|
+
expect(focus).toHaveBeenCalledWith({preventScroll: true});
|
|
267
|
+
focus.mockRestore();
|
|
268
|
+
});
|
|
269
|
+
|
|
174
270
|
it('runs onClick once from the keyboard via the hidden button', async () => {
|
|
175
271
|
const user = userEvent.setup();
|
|
176
272
|
const handleClick = vi.fn();
|
|
@@ -29,7 +29,13 @@
|
|
|
29
29
|
* For toggle selection, use SelectableCard.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
type ReactNode,
|
|
34
|
+
type MouseEvent,
|
|
35
|
+
useCallback,
|
|
36
|
+
useRef,
|
|
37
|
+
type Ref,
|
|
38
|
+
} from 'react';
|
|
33
39
|
import * as stylex from '@stylexjs/stylex';
|
|
34
40
|
import type {StyleXStyles} from '@stylexjs/stylex';
|
|
35
41
|
import {
|
|
@@ -327,6 +333,41 @@ export function ClickableCard({
|
|
|
327
333
|
const pressable = usePressFeedback();
|
|
328
334
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
329
335
|
const interactiveRef = useRef<HTMLElement | null>(null);
|
|
336
|
+
const restoreFocusRef = useRef(false);
|
|
337
|
+
// The isDisabled value of the link that just detached: a link card that
|
|
338
|
+
// flips it replaces its hidden link (router component and plain anchor),
|
|
339
|
+
// and only that replacement takes focus back.
|
|
340
|
+
const detachedDisabledRef = useRef<boolean | null>(null);
|
|
341
|
+
|
|
342
|
+
// A focused link remounts when isDisabled changes: the replacement takes
|
|
343
|
+
// focus back, without scrolling, if focus fell to the page. Any other
|
|
344
|
+
// detach and attach (a hidden Activity or Suspense boundary revealed
|
|
345
|
+
// again) leaves focus where the person put it.
|
|
346
|
+
const setInteractiveRef = useCallback(
|
|
347
|
+
(node: HTMLElement | null) => {
|
|
348
|
+
if (node == null) {
|
|
349
|
+
const previous = interactiveRef.current;
|
|
350
|
+
restoreFocusRef.current =
|
|
351
|
+
previous != null && previous === previous.ownerDocument.activeElement;
|
|
352
|
+
detachedDisabledRef.current = isDisabled;
|
|
353
|
+
interactiveRef.current = null;
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
interactiveRef.current = node;
|
|
357
|
+
const isFlip =
|
|
358
|
+
detachedDisabledRef.current != null &&
|
|
359
|
+
detachedDisabledRef.current !== isDisabled;
|
|
360
|
+
const active = node.ownerDocument.activeElement;
|
|
361
|
+
const hasFallen = active == null || active === node.ownerDocument.body;
|
|
362
|
+
if (restoreFocusRef.current && isFlip && hasFallen) {
|
|
363
|
+
node.focus({preventScroll: true});
|
|
364
|
+
}
|
|
365
|
+
restoreFocusRef.current = false;
|
|
366
|
+
detachedDisabledRef.current = null;
|
|
367
|
+
},
|
|
368
|
+
[isDisabled],
|
|
369
|
+
);
|
|
370
|
+
|
|
330
371
|
const LinkComponent = useLinkComponent();
|
|
331
372
|
|
|
332
373
|
const {onClick, onMouseUp} = useClickableContainer({
|
|
@@ -347,6 +388,9 @@ export function ClickableCard({
|
|
|
347
388
|
|
|
348
389
|
const isLink = href != null;
|
|
349
390
|
|
|
391
|
+
// Disabled links have no href, so bypass the router and render an anchor.
|
|
392
|
+
const LinkRoot = isDisabled ? 'a' : LinkComponent;
|
|
393
|
+
|
|
350
394
|
// Only the `default` variant has a visible border. Card draws a transparent
|
|
351
395
|
// 1px border on every other variant purely to avoid layout jitter; we drop
|
|
352
396
|
// it here so the hover overlay covers the full box with no untinted ring.
|
|
@@ -385,8 +429,8 @@ export function ClickableCard({
|
|
|
385
429
|
onMouseUp={!isDisabled ? handleMouseUp : undefined}
|
|
386
430
|
{...props}>
|
|
387
431
|
{isLink ? (
|
|
388
|
-
<
|
|
389
|
-
ref={
|
|
432
|
+
<LinkRoot
|
|
433
|
+
ref={setInteractiveRef}
|
|
390
434
|
href={isDisabled ? undefined : href}
|
|
391
435
|
target={isDisabled ? undefined : target}
|
|
392
436
|
role={isDisabled ? 'link' : undefined}
|
|
@@ -399,7 +443,7 @@ export function ClickableCard({
|
|
|
399
443
|
/>
|
|
400
444
|
) : (
|
|
401
445
|
<button
|
|
402
|
-
ref={
|
|
446
|
+
ref={setInteractiveRef}
|
|
403
447
|
type="button"
|
|
404
448
|
aria-label={label}
|
|
405
449
|
aria-disabled={isDisabled || undefined}
|
|
@@ -69,6 +69,8 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
69
69
|
- caller-provided chevron, cue, icon, or render-function escape hatches;
|
|
70
70
|
- TreeList, Table, or another component's disclosure indicator;
|
|
71
71
|
- generic icon resolution or artwork customization;
|
|
72
|
+
- sibling open-value coordination, group state, and the divided group wrapper
|
|
73
|
+
— owned by `component:CollapsibleGroup`;
|
|
72
74
|
- a shared responsive or directional API; or
|
|
73
75
|
- new content-reveal motion behavior. Existing behavior outside this decision stays
|
|
74
76
|
unchanged until its own current authority changes it.
|