@astryxdesign/core 0.7.5 → 0.7.6-canary.bb18c81
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/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +12 -3
- 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/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +6 -5
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +4 -1
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +101 -15
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +4 -1
- 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.map +1 -1
- package/dist/Drawer/Drawer.js +5 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +4 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +6 -5
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +10 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +16 -2
- 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/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/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +5 -2
- 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/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/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +7 -1
- package/dist/Spinner/Spinner.js +2 -2
- 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/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +2 -2
- package/dist/Timestamp/TimestampHoverCard.js +4 -4
- 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/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 +14 -1
- package/dist/gestures/PinchGestureRecognizer.d.ts +30 -0
- package/dist/gestures/PinchGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/PinchGestureRecognizer.js +125 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +70 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.js +220 -0
- package/dist/gestures/SwipeGestureRecognizer.d.ts +36 -0
- package/dist/gestures/SwipeGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/SwipeGestureRecognizer.js +145 -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/types.d.ts +11 -7
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/types.js +22 -2
- package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -1
- package/dist/hooks/useAdaptivePresentation.js +4 -1
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +12 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +3 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +3 -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.js +1 -1
- 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/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/presentation.d.ts +50 -0
- package/dist/utils/presentation.d.ts.map +1 -0
- package/dist/utils/presentation.js +125 -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/locales/en.json +13 -1
- package/locales/pseudo.json +9 -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/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/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/__tests__/Carousel.a11y.chromium.spec.ts +21 -7
- package/src/CheckboxInput/CheckboxInput.tsx +6 -5
- 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/ContextMenu/ContextMenu.test.tsx +35 -0
- package/src/DateInput/DateInput.test.tsx +53 -2
- package/src/DateInput/DateInput.tsx +15 -11
- package/src/DateInput/MonthScroller.tsx +106 -20
- package/src/DateInput/MonthScrollerSettle.test.tsx +165 -0
- 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.spec.md +71 -48
- package/src/DateTimeInput/DateTimeInput.test.tsx +61 -0
- package/src/DateTimeInput/DateTimeInput.tsx +15 -11
- 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 +22 -0
- package/src/Drawer/Drawer.tsx +5 -0
- package/src/Drawer/DrawerHeader.spec.md +181 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +41 -0
- package/src/DropdownMenu/DropdownMenu.tsx +7 -1
- 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 +53 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +23 -6
- 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/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.tsx +3 -3
- 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/MultiSelector.spec.md +7 -4
- package/src/MultiSelector/MultiSelector.test.tsx +118 -1
- package/src/MultiSelector/MultiSelector.tsx +6 -2
- 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/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/Slider/Slider.test.tsx +12 -0
- package/src/Slider/Slider.tsx +4 -1
- package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +19 -7
- package/src/Spinner/Spinner.tsx +2 -2
- package/src/Stack/Stack.tsx +1 -1
- package/src/Stack/StackItem.tsx +1 -1
- package/src/TabList/TabList.test.tsx +52 -1
- 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/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 +7 -10
- package/src/Toast/ToastViewport.test.tsx +575 -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/Typeahead/Typeahead.test.tsx +40 -0
- package/src/Typeahead/Typeahead.tsx +12 -1
- package/src/gestures/PinchGestureRecognizer.ts +144 -0
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +252 -0
- package/src/gestures/SwipeGestureRecognizer.ts +193 -0
- package/src/gestures/VelocityTracker.ts +10 -3
- 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__/arenaPinchSwipeEdge.test.ts +188 -0
- package/src/gestures/__tests__/harness.ts +21 -2
- package/src/gestures/types.ts +23 -9
- package/src/hooks/useAdaptivePresentation.ts +4 -1
- package/src/hooks/useMenuHover.ts +15 -1
- package/src/i18n/generated-locales/en.generated.ts +4 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +4 -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/defineTheme.ts +1 -1
- 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/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/presentation.test.ts +380 -0
- package/src/utils/presentation.ts +180 -0
- package/src/utils/pressPaintPriority.test.ts +80 -0
- package/src/utils/touchPresentation.stylex.ts +43 -0
- package/src/utils/touchPresentation.test.ts +140 -1
- package/src/utils/touchPresentation.ts +5 -3
|
@@ -17,6 +17,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
17
17
|
import {colorVars} from '../theme/tokens.stylex';
|
|
18
18
|
import {TestIcon} from '../__tests__/TestIcon';
|
|
19
19
|
import {TextArea} from './TextArea';
|
|
20
|
+
import {InternationalizationProvider} from '../i18n';
|
|
20
21
|
import {__resetLiveRegionsForTest} from '../hooks/useAnnounce';
|
|
21
22
|
|
|
22
23
|
// jsdom cannot match `:focus-visible`: compare the ring's StyleX class hash.
|
|
@@ -521,6 +522,38 @@ describe('TextArea', () => {
|
|
|
521
522
|
expect(screen.getByText('5/20')).toBeInTheDocument();
|
|
522
523
|
});
|
|
523
524
|
|
|
525
|
+
it('formats the counter from the catalog with locale number formatting', () => {
|
|
526
|
+
render(
|
|
527
|
+
<InternationalizationProvider
|
|
528
|
+
locale="de-DE"
|
|
529
|
+
overrides={{
|
|
530
|
+
'de-DE': {
|
|
531
|
+
'@astryx.textArea.counter': '{count, number} von {limit, number}',
|
|
532
|
+
},
|
|
533
|
+
}}>
|
|
534
|
+
<TextArea
|
|
535
|
+
label="Bio"
|
|
536
|
+
value={'a'.repeat(62)}
|
|
537
|
+
onChange={() => {}}
|
|
538
|
+
maxLength={2000}
|
|
539
|
+
/>
|
|
540
|
+
</InternationalizationProvider>,
|
|
541
|
+
);
|
|
542
|
+
expect(screen.getByText('62 von 2.000')).toBeInTheDocument();
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
it('formats an English counter with grouped digits', () => {
|
|
546
|
+
render(
|
|
547
|
+
<TextArea
|
|
548
|
+
label="Bio"
|
|
549
|
+
value="hi"
|
|
550
|
+
onChange={() => {}}
|
|
551
|
+
maxLength={2000}
|
|
552
|
+
/>,
|
|
553
|
+
);
|
|
554
|
+
expect(screen.getByText('2/2,000')).toBeInTheDocument();
|
|
555
|
+
});
|
|
556
|
+
|
|
524
557
|
it('does not display counter when maxLength is not provided', () => {
|
|
525
558
|
render(
|
|
526
559
|
<TextArea label="Description" value="Hello" onChange={() => {}} />,
|
|
@@ -1255,3 +1288,30 @@ describe('TextArea theme target names', () => {
|
|
|
1255
1288
|
expect(root).not.toHaveClass('astryx-textarea');
|
|
1256
1289
|
});
|
|
1257
1290
|
});
|
|
1291
|
+
|
|
1292
|
+
describe('TextArea caller aria-labelledby', () => {
|
|
1293
|
+
it('names the textarea by its label and a caller aria-labelledby', () => {
|
|
1294
|
+
render(
|
|
1295
|
+
<>
|
|
1296
|
+
<span id="billing-heading">Billing</span>
|
|
1297
|
+
<TextArea
|
|
1298
|
+
label="Notes"
|
|
1299
|
+
value=""
|
|
1300
|
+
onChange={() => {}}
|
|
1301
|
+
aria-labelledby="billing-heading"
|
|
1302
|
+
/>
|
|
1303
|
+
</>,
|
|
1304
|
+
);
|
|
1305
|
+
const textarea = screen.getByRole('textbox', {name: 'Notes Billing'});
|
|
1306
|
+
expect(textarea.getAttribute('aria-labelledby')?.split(' ')).toContain(
|
|
1307
|
+
'billing-heading',
|
|
1308
|
+
);
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
it('leaves a textarea named by its label element without a caller aria-labelledby', () => {
|
|
1312
|
+
render(<TextArea label="Notes" value="" onChange={() => {}} />);
|
|
1313
|
+
expect(screen.getByRole('textbox', {name: 'Notes'})).not.toHaveAttribute(
|
|
1314
|
+
'aria-labelledby',
|
|
1315
|
+
);
|
|
1316
|
+
});
|
|
1317
|
+
});
|
|
@@ -47,6 +47,7 @@ import {Icon, renderIconSlot, type IconType} from '../Icon';
|
|
|
47
47
|
import {Spinner} from '../Spinner';
|
|
48
48
|
import {useTooltip} from '../Tooltip';
|
|
49
49
|
import {mergeProps} from '../utils';
|
|
50
|
+
import {joinAriaIDs} from '../utils/inputAria';
|
|
50
51
|
import type {BaseProps} from '../BaseProps';
|
|
51
52
|
import {
|
|
52
53
|
type FieldInputBaseProps,
|
|
@@ -417,6 +418,7 @@ export function TextArea({
|
|
|
417
418
|
ref,
|
|
418
419
|
id: idProp,
|
|
419
420
|
'aria-describedby': ariaDescribedByProp,
|
|
421
|
+
'aria-labelledby': ariaLabelledByProp,
|
|
420
422
|
...restProps
|
|
421
423
|
}: TextAreaProps) {
|
|
422
424
|
const {rest, container} = useFieldInputStyling('TextArea', restProps, {
|
|
@@ -430,6 +432,7 @@ export function TextArea({
|
|
|
430
432
|
const announce = useAnnounce();
|
|
431
433
|
const generatedID = useId();
|
|
432
434
|
const id = idProp ?? generatedID;
|
|
435
|
+
const fieldLabelID = useId();
|
|
433
436
|
const descriptionID = useId();
|
|
434
437
|
const statusMessageID = useId();
|
|
435
438
|
const counterID = useId();
|
|
@@ -572,6 +575,7 @@ export function TextArea({
|
|
|
572
575
|
isLabelHidden={isLabelHidden}
|
|
573
576
|
description={description}
|
|
574
577
|
inputID={id}
|
|
578
|
+
labelID={ariaLabelledByProp != null ? fieldLabelID : undefined}
|
|
575
579
|
descriptionID={description ? descriptionID : undefined}
|
|
576
580
|
isOptional={isOptional}
|
|
577
581
|
isRequired={isRequired}
|
|
@@ -644,6 +648,13 @@ export function TextArea({
|
|
|
644
648
|
spellCheck={hasSpellCheck}
|
|
645
649
|
autoFocus={hasAutoFocus}
|
|
646
650
|
data-autofocus={hasAutoFocus || undefined}
|
|
651
|
+
// A caller aria-labelledby names the textarea together with the
|
|
652
|
+
// field's own label, which it would otherwise replace.
|
|
653
|
+
aria-labelledby={
|
|
654
|
+
ariaLabelledByProp != null
|
|
655
|
+
? joinAriaIDs(fieldLabelID, ariaLabelledByProp)
|
|
656
|
+
: undefined
|
|
657
|
+
}
|
|
647
658
|
aria-describedby={
|
|
648
659
|
[ariaDescribedByProp, ariaDescribedBy].filter(Boolean).join(' ') ||
|
|
649
660
|
undefined
|
|
@@ -696,7 +707,10 @@ export function TextArea({
|
|
|
696
707
|
// live-region announcement carry the meaning.
|
|
697
708
|
<Icon icon="warning" size="sm" />
|
|
698
709
|
)}
|
|
699
|
-
{
|
|
710
|
+
{t('@astryx.textArea.counter', {
|
|
711
|
+
count: valueLength,
|
|
712
|
+
limit: maxLength,
|
|
713
|
+
})}
|
|
700
714
|
</div>
|
|
701
715
|
)}
|
|
702
716
|
</div>
|
|
@@ -823,6 +823,27 @@ describe('TextInput', () => {
|
|
|
823
823
|
});
|
|
824
824
|
});
|
|
825
825
|
|
|
826
|
+
it('keeps the clear button where it is when the field turns busy', () => {
|
|
827
|
+
// What follows the button in the lane (a `<template>` is not rendered).
|
|
828
|
+
const after = (button: HTMLElement) =>
|
|
829
|
+
Array.from(button.parentElement?.children ?? [])
|
|
830
|
+
.slice(Array.from(button.parentElement?.children ?? []).indexOf(button))
|
|
831
|
+
.filter(el => el !== button && el.tagName !== 'TEMPLATE');
|
|
832
|
+
const props = {label: 'Name', value: 'hello', onChange: () => {}};
|
|
833
|
+
const {rerender} = render(<TextInput {...props} hasClear />);
|
|
834
|
+
const idle = screen.getByRole('button', {name: 'Clear Name'});
|
|
835
|
+
const idleAfter = after(idle).length;
|
|
836
|
+
|
|
837
|
+
rerender(<TextInput {...props} hasClear isLoading />);
|
|
838
|
+
const busy = screen.getByRole('button', {name: 'Clear Name'});
|
|
839
|
+
// The Spinner joins on the inward side, before the button, so nothing new
|
|
840
|
+
// follows it and its distance from the end does not change.
|
|
841
|
+
expect(after(busy)).toHaveLength(idleAfter);
|
|
842
|
+
expect(busy.previousElementSibling?.getAttribute('aria-hidden')).toBe(
|
|
843
|
+
'true',
|
|
844
|
+
);
|
|
845
|
+
});
|
|
846
|
+
|
|
826
847
|
describe('click-to-focus', () => {
|
|
827
848
|
it('focuses input when clicking the start icon', () => {
|
|
828
849
|
render(
|
|
@@ -537,13 +537,15 @@ export function TextInput({
|
|
|
537
537
|
aria-labelledby={inputLabelledBy}
|
|
538
538
|
{...stylex.props(styles.input, isDisabled && styles.inputDisabled)}
|
|
539
539
|
/>
|
|
540
|
+
{/* The Spinner comes first so it appears inward of the clear button
|
|
541
|
+
and the button keeps its place when the field turns busy. */}
|
|
542
|
+
{isBusy && <Spinner size="sm" aria-hidden="true" />}
|
|
540
543
|
{hasClear && value !== '' && !isDisabled && !isReadOnly && (
|
|
541
544
|
<InputClearButton
|
|
542
545
|
label={t('@astryx.textInput.clearLabel', {label})}
|
|
543
546
|
onClick={handleClear}
|
|
544
547
|
/>
|
|
545
548
|
)}
|
|
546
|
-
{isBusy && <Spinner size="sm" aria-hidden="true" />}
|
|
547
549
|
{statusIcon}
|
|
548
550
|
</div>
|
|
549
551
|
);
|
|
@@ -44,7 +44,7 @@ system_specs: [spec:AST-009, spec:AST-085]
|
|
|
44
44
|
| Behavior | Relative output carries the full absolute date as its default accessible name; relative output, or configured `tooltipEntries`, attach a keyboard-reachable hover card of copyable rows. |
|
|
45
45
|
| End-user impact | Readers see compact or exact times in their locale; screen-reader users hear the full date and time zone; keyboard users can open and copy the exact time. |
|
|
46
46
|
| Builder impact | None; the record describes shipped behavior. |
|
|
47
|
-
| Compatibility/readiness | Released behavior recorded as current; no API, default, or output changes.
|
|
47
|
+
| Compatibility/readiness | Released behavior recorded as current; no API, default, or output changes. Three implementation gaps are listed under Current-state impact. |
|
|
48
48
|
| Review checks | Reject a relative timestamp without the full absolute name when the caller names nothing, a hover card without a tab stop, a change that makes more server markup depend on the server's zone, or a crash on an unparseable value. |
|
|
49
49
|
| Governing rules | `architecture:internationalization/INV4,INV8,INV10`; `architecture:react-component-runtime/INV1,INV3,INV5`; `architecture:public-component-api/INV5,INV6,INV8`. |
|
|
50
50
|
|
|
@@ -70,11 +70,6 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
70
70
|
|
|
71
71
|
## Current-state impact
|
|
72
72
|
|
|
73
|
-
- **Caller name and tab stop replaced (FR5, FR9).** On relative output the
|
|
74
|
-
full-date name replaces a caller `aria-label`, and while a card is attached
|
|
75
|
-
the component's `tabIndex={0}` replaces a caller `tabIndex`, where
|
|
76
|
-
`architecture:public-component-api` INV5 lets a caller's explicit input reach
|
|
77
|
-
the element.
|
|
78
73
|
- **Focus lost when the card attaches (FR6, AR3).** While the card module
|
|
79
74
|
loads, a fallback `time` with the tab stop renders; when the card attaches it
|
|
80
75
|
replaces that element, so keyboard focus placed on it falls to the page body
|
|
@@ -129,11 +124,11 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
129
124
|
| FR2 | `auto` shows `relative` when the instant is within `autoThreshold` seconds of now (default seven days) and `date_time` otherwise. `relative` uses the locale's long relative phrase and `relative_short` its narrow phrase; a value a few seconds in the future reads as "now". Absolute formats use the shared instant formatter in the provider locale with Gregorian years; `system_*` formats are machine-readable, and `unix_seconds` is zone-independent. `isTimezoneShown` appends the zone abbreviation to `date_time` and `time` only. | Current source and tests |
|
|
130
125
|
| FR3 | Server markup does not depend on the server's time zone and hydrates without a mismatch. A format that needs the clock renders `date_time` in UTC with the zone shown until the client can read the clock; the client then shows the resolved format without committing the UTC placeholder. Implementation gap: absolute formats other than `unix_seconds` render in the host's time zone, so their server markup depends on the server's zone and hydrating it in another zone produces a text mismatch (Current-state impact). | Current source and tests |
|
|
131
126
|
| FR4 | With `isLive` and relative output, the clock refreshes every second under a minute old, every 30 seconds under an hour, every minute under a day, and every five minutes beyond; the timer is cleared on unmount or when the inputs change. Locale changes update the output live. | Current source and tests |
|
|
132
|
-
| FR5 | Relative output is named by the full absolute date and the long time-zone name unless a caller names the element; absolute output adds no name. A caller's explicit `aria-label` reaches the element (`architecture:public-component-api` INV5).
|
|
127
|
+
| FR5 | Relative output is named by the full absolute date and the long time-zone name unless a caller names the element; absolute output adds no name. A caller's explicit `aria-label` reaches the element (`architecture:public-component-api` INV5). | Current source and tests |
|
|
133
128
|
| FR6 | When `hasTooltip` is true and the output is relative or `tooltipEntries` is non-empty, a lazily loaded HoverCard named "Timestamp details" attaches above the timestamp, opening on hover and on keyboard focus; the `time` element gains `tabIndex={0}`. Otherwise no card renders and no tab stop is added. Focus placed on the timestamp stays there when the card attaches (`spec:AST-085` FR4). Implementation gap: while the card module loads, a fallback `time` with the tab stop renders, and attaching the card replaces it, so focus placed on it falls to the page body and no card opens (Current-state impact). | Current source and tests |
|
|
134
129
|
| FR7 | The card is a description list in a grid: an optional label column (present when any row has a label), the value column, and a trailing action column (present when any row is copyable). Without entries it has one copyable row with the full absolute time in the viewer's zone. Each configured entry is one row in the given order, rendered in its own time zone and format, read-only unless `isCopyable`. An unknown time zone does not crash. A description list holds only name-value groups (WCAG 2.2 1.3.1). Implementation gaps: once any row is copyable, every row carries an action-cell `div` inside its row group (empty on read-only rows), so the open card fails the `definition-list` structure check, and a card with no labelled rows, the default card included, renders each row as a lone `dd` with no `dt` (Current-state impact). | Current source and tests |
|
|
135
130
|
| FR8 | A copy button is a small ghost IconButton on the `timestamp-copy-button` target, named "Copy {value}" with a "Copy" tooltip; activating it writes the row's value to the clipboard, switches to a check icon and the "Copied" name and tooltip for 1.5 seconds, and announces "Copied" politely. A clipboard rejection does nothing. | Current source and tests |
|
|
136
|
-
| FR9 | `ref`, `data-testid`, and other supported DOM, ARIA, data, and event props reach the `time` element; `xstyle`, `className`, and `style` reach the Text wrapper. A caller `aria-labelledby` names the element in place of FR5's name. A caller's explicit `tabIndex` reaches the element (`architecture:public-component-api` INV5).
|
|
131
|
+
| FR9 | `ref`, `data-testid`, and other supported DOM, ARIA, data, and event props reach the `time` element; `xstyle`, `className`, and `style` reach the Text wrapper. A caller `aria-labelledby` names the element in place of FR5's name. A caller's explicit `tabIndex` reaches the element (`architecture:public-component-api` INV5). | Current source and tests |
|
|
137
132
|
|
|
138
133
|
### Allowed variation
|
|
139
134
|
|
|
@@ -161,8 +156,7 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
161
156
|
- **ORD2 — Card rows.** Non-empty `tooltipEntries` → the default full-date row.
|
|
162
157
|
- **ORD3 — Time element attributes.** `datetime` and `data-testid` are set,
|
|
163
158
|
then caller props; the relative name and the card's tab stop apply only
|
|
164
|
-
where the caller sets no `aria-label` or `tabIndex
|
|
165
|
-
the caller's, the FR5 and FR9 gaps).
|
|
159
|
+
where the caller sets no `aria-label` or `tabIndex`.
|
|
166
160
|
|
|
167
161
|
### Performance and resources
|
|
168
162
|
|
|
@@ -230,10 +224,10 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
230
224
|
| FR1, FR2 | `Timestamp.test.tsx` format, auto, locale, and invalid-value tests; stable visual baseline `core-timestamp--default` | Every format; thresholds; locales; unparseable values; default | A wrong phrase, a crossed tier, a non-Gregorian year, a missing `time` element or `datetime`, a crash, or a missing development warning for an unparseable value fails; a changed default type or color comes back changed for review. Gap: no test asserts the `timestamp` target or its format reflection. | `audit:Timestamp/behavior` |
|
|
231
225
|
| FR3 | `Timestamp.test.tsx` server-rendering suite | Server zones; hydration | Zone-dependent markup, a hydration mismatch, or a committed placeholder fails. Gap: no test covers an absolute format rendered on a server in another zone. | `audit:Timestamp/behavior` |
|
|
232
226
|
| FR4, PR1 | `Timestamp.test.tsx` live-update and locale tests | Live relative output; locale change | A missing refresh or a stale locale fails. Gap: the per-tier refresh intervals and the timer cleanup on unmount or input change have no automated check. | `audit:Timestamp/behavior` |
|
|
233
|
-
| FR5, AR2 | `Timestamp.test.tsx` naming tests | Relative, absolute, time-zone spelling | A missing or short-zone name, or a name on absolute output, fails.
|
|
227
|
+
| FR5, AR2 | `Timestamp.test.tsx` naming tests | Relative, absolute, time-zone spelling | A missing or short-zone name, or a name on absolute output, fails. A caller `aria-label` replaced on relative output fails. | `audit:Timestamp/a11y` |
|
|
234
228
|
| FR6, AR3 | `Timestamp.test.tsx` keyboard-reachability suite | Relative, absolute, disabled, entries removed | A missing tab stop, `aria-expanded` on the trigger, or a stray tab stop fails. The aria-expanded test also pins `aria-haspopup` on the Text wrapper, which is current behavior, not contract. Gap: no test covers focus on the timestamp while the card module loads, or `aria-controls`. | `audit:Timestamp/a11y` |
|
|
235
229
|
| FR7, FR8, AR4 | `Timestamp.test.tsx` hover-card suites; `tooltipEntries.test.ts`; `useClipboard.test.tsx` | Default row, entries, copyable rows, unknown zone | A wrong row count or order, an unpaired label, a copy button on a read-only row, a wrong copied value, a missing copied state, or a missing announcement fails. Gap: no check runs the `definition-list` structure rule on the open card (the recorded gap); the grid columns and the 1.5-second reset have no automated check; `useClipboard.test.tsx` covers the clipboard-rejection no-op. The lone-`dd` rows of a label-less card are also unchecked. | `audit:Timestamp/behavior` |
|
|
236
|
-
| FR9 | `Timestamp.test.tsx` ref, test-id, and pass-through tests | Ref, test id, caller props | A ref, test id, or caller prop missing from the `time` element fails. Gap: no test asserts that `xstyle`, `className`, and `style` reach the Text wrapper, or covers a caller `aria-labelledby
|
|
230
|
+
| FR9 | `Timestamp.test.tsx` ref, test-id, and pass-through tests | Ref, test id, caller props | A ref, test id, or caller prop missing from the `time` element fails. A caller `tabIndex` replaced while a card is attached fails. Gap: no test asserts that `xstyle`, `className`, and `style` reach the Text wrapper, or covers a caller `aria-labelledby`. | `audit:Timestamp/behavior` |
|
|
237
231
|
| Theming anatomy map | `scripts/check-knowledge.mjs` | Consumer anatomy, targets, HoverCard delegate | Missing, extra, or stale mappings fail repository validation. | `audit:Timestamp/theming` |
|
|
238
232
|
| AR1 | `Timestamp.test.tsx` `datetime` tests | `date_time`; `date` | A missing or wrong ISO `datetime` on `date_time`, or a missing one on `date`, fails. Gap: no test asserts the exact `datetime` on relative or other absolute formats. | `audit:Timestamp/a11y` |
|
|
239
233
|
| AR2, AR4 | Accessibility-tree evidence (`spec:AST-009` FR3) | Relative output; copy buttons | Gap: no accessibility-tree check proves the computed name of relative output or the copy-button names; the unit tests query the DOM. | `audit:Timestamp/a11y` |
|
|
@@ -768,6 +768,20 @@ describe('Timestamp', () => {
|
|
|
768
768
|
HTMLElement.prototype.hidePopover = originalHidePopover;
|
|
769
769
|
});
|
|
770
770
|
|
|
771
|
+
it("keeps a caller's tabIndex while the hover card is attached (FR9)", async () => {
|
|
772
|
+
render(
|
|
773
|
+
<Timestamp
|
|
774
|
+
value={Date.now() / 1000 - 3600}
|
|
775
|
+
format="relative"
|
|
776
|
+
tabIndex={-1}
|
|
777
|
+
data-testid="ts"
|
|
778
|
+
/>,
|
|
779
|
+
);
|
|
780
|
+
expect(screen.getByTestId('ts')).toHaveAttribute('tabindex', '-1');
|
|
781
|
+
await openTimestampHoverCard();
|
|
782
|
+
expect(screen.getByTestId('ts')).toHaveAttribute('tabindex', '-1');
|
|
783
|
+
});
|
|
784
|
+
|
|
771
785
|
it('makes the <time> element focusable while the hover card is attached', () => {
|
|
772
786
|
render(
|
|
773
787
|
<Timestamp
|
|
@@ -1449,7 +1463,7 @@ describe('Timestamp pass-through props', () => {
|
|
|
1449
1463
|
expect(time).toHaveAttribute('data-source', 'cms');
|
|
1450
1464
|
});
|
|
1451
1465
|
|
|
1452
|
-
it(
|
|
1466
|
+
it("keeps a caller's aria-label on a relative timestamp (FR5)", () => {
|
|
1453
1467
|
render(
|
|
1454
1468
|
<Timestamp
|
|
1455
1469
|
value={Date.now()}
|
|
@@ -1463,10 +1477,21 @@ describe('Timestamp pass-through props', () => {
|
|
|
1463
1477
|
expect({
|
|
1464
1478
|
ariaLabel: stamp.getAttribute('aria-label'),
|
|
1465
1479
|
dataSource: stamp.getAttribute('data-source'),
|
|
1466
|
-
}).toEqual({
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1480
|
+
}).toEqual({ariaLabel: 'Caller label', dataSource: 'cms'});
|
|
1481
|
+
});
|
|
1482
|
+
|
|
1483
|
+
it('names a relative timestamp by the full date when the caller names nothing (FR5)', () => {
|
|
1484
|
+
render(
|
|
1485
|
+
<Timestamp
|
|
1486
|
+
value={Date.now()}
|
|
1487
|
+
format="relative"
|
|
1488
|
+
aria-label={undefined}
|
|
1489
|
+
data-testid="stamp"
|
|
1490
|
+
/>,
|
|
1491
|
+
);
|
|
1492
|
+
expect(screen.getByTestId('stamp').getAttribute('aria-label')).toMatch(
|
|
1493
|
+
/\d{4}/,
|
|
1494
|
+
);
|
|
1470
1495
|
});
|
|
1471
1496
|
});
|
|
1472
1497
|
|
|
@@ -443,7 +443,10 @@ export function Timestamp({
|
|
|
443
443
|
// before rendering — but keep the guard local: an empty aria-label
|
|
444
444
|
// must be omitted entirely (not rendered as aria-label="") so AT
|
|
445
445
|
// falls back to reading the visible <time> content.
|
|
446
|
-
|
|
446
|
+
// A caller's own name wins (`component:Timestamp` FR5).
|
|
447
|
+
{...(isRelativeFormat(effectiveFormat) &&
|
|
448
|
+
ariaLabelText !== '' &&
|
|
449
|
+
rest['aria-label'] == null
|
|
447
450
|
? {'aria-label': ariaLabelText}
|
|
448
451
|
: {})}
|
|
449
452
|
// The hover card is anchored here with focusTrigger="always", which
|
|
@@ -454,7 +457,8 @@ export function Timestamp({
|
|
|
454
457
|
// gratuitous tab stops otherwise. The card carries its own
|
|
455
458
|
// dashed-underline hover indication as the affordance, so the anchor
|
|
456
459
|
// needs no separate focus outline.
|
|
457
|
-
|
|
460
|
+
// A caller's own tabIndex wins (`component:Timestamp` FR9).
|
|
461
|
+
{...(showTooltip && rest.tabIndex == null ? {tabIndex: 0} : {})}>
|
|
458
462
|
{displayText}
|
|
459
463
|
</time>
|
|
460
464
|
</Text>
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
import type {ReactNode} from 'react';
|
|
27
27
|
import {useCallback} from 'react';
|
|
28
28
|
import * as stylex from '@stylexjs/stylex';
|
|
29
|
-
import {HoverCard} from '../HoverCard';
|
|
30
|
-
import {IconButton} from '../IconButton';
|
|
31
|
-
import {Icon} from '../Icon';
|
|
29
|
+
import {HoverCard} from '../HoverCard/HoverCard';
|
|
30
|
+
import {IconButton} from '../IconButton/IconButton';
|
|
31
|
+
import {Icon} from '../Icon/Icon';
|
|
32
32
|
import {useClipboard} from '../hooks/useClipboard';
|
|
33
|
-
import {useTranslator} from '../i18n';
|
|
33
|
+
import {useTranslator} from '../i18n/useTranslator';
|
|
34
34
|
import {themeProps} from '../utils/themeProps';
|
|
35
35
|
import {
|
|
36
36
|
colorVars,
|
package/src/Toast/Toast.spec.md
CHANGED
|
@@ -50,7 +50,7 @@ system_specs:
|
|
|
50
50
|
| Behavior | A stack of non-modal notification cards at one viewport corner. Each toast is announced once, can auto-hide (pausing while hovered, focused, touched, or the window is blurred), and dismisses by its button, a vertical swipe toward its edge, or code. F6 moves focus into the newest toast. |
|
|
51
51
|
| End-user impact | Users get brief notices without losing their place; screen-reader users hear each toast once; keyboard users reach toast controls with F6 and land somewhere sensible after dismissing; touch users swipe toasts away. |
|
|
52
52
|
| Builder impact | None. |
|
|
53
|
-
| Compatibility/readiness | Records shipped behavior; no public change. Twenty
|
|
53
|
+
| Compatibility/readiness | Records shipped behavior; no public change. Twenty implementation gaps, listed under Current-state impact. |
|
|
54
54
|
| Review checks | Reject a toast announced more than once per show, a dismissal that drops focus to the body, an auto-hide that runs while the user is reading or interacting, or a swipe as the only way to dismiss. |
|
|
55
55
|
| Governing rules | `spec:AST-086` FR1; `spec:AST-003` (modal rehosting); `spec:AST-094`; `spec:AST-100`; `spec:AST-059` FR6; `architecture:layer-runtime`; `design:bidirectionality`; `design:reduced-motion`. |
|
|
56
56
|
|
|
@@ -121,9 +121,9 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
121
121
|
- **Some modals supply no outlet.** A modal Drawer, Lightbox, or MobileNav
|
|
122
122
|
opens without supplying an outlet, so toasts stay behind it; `spec:AST-003`
|
|
123
123
|
FR18 rehosts globally hosted layers above every native modal.
|
|
124
|
-
- **A toast
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
- **A toast collapsing through an outlet move can linger.** A toast that is
|
|
125
|
+
still collapsing when its viewport moves into or out of any outlet FR12
|
|
126
|
+
names comes back as an invisible zero-height row that never unmounts: it
|
|
127
127
|
keeps the notifications landmark exposed and F6 focuses its hidden dismiss
|
|
128
128
|
button, and it holds one of the `maxVisible` places. With no provider
|
|
129
129
|
above the caller a dismissal called before the fallback viewport
|
|
@@ -143,9 +143,6 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
143
143
|
- **The action row does not track a held pointer.** A press that slides across
|
|
144
144
|
the row's sibling actions does not act on the action it lifts on;
|
|
145
145
|
`family:action-groups` has the row use the shared press tracking.
|
|
146
|
-
- **Same-handler `ignore` toasts both announce.** Two `ignore` toasts with one
|
|
147
|
-
`uniqueID` raised before the first renders are both announced, and the
|
|
148
|
-
second replaces the first (FR8, ORD1).
|
|
149
146
|
- **Nested viewports can show two landmarks.** An outer and an inner viewport
|
|
150
147
|
that each hold a toast expose two notifications landmarks (FR11).
|
|
151
148
|
- **Reduced motion is instant on every pointer.** Under reduced motion the
|
|
@@ -198,7 +195,7 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
198
195
|
| FR5 | A new card slides in from its edge and fades in; a dismissed card collapses and fades before it unmounts; both slide only along the block axis. A dismissal without a swipe uses theme timing; a swipe's commit and snap-back start at the release velocity (`spec:AST-094` FR38). Under reduced motion the entrance and dismissal are an opacity-only fade of 200 ms or less on a coarse pointer or after a touch release (`design:reduced-motion` DR2) and immediate otherwise (DR3), and the card still unmounts. Implementation gaps: a swipe's settle is a CSS transition at theme timing, and under reduced motion every transition, including the row collapse and the swipe's throw, runs for 0.01 ms on every pointer (Current-state impact). | Current source and tests |
|
|
199
196
|
| FR6 | The viewport stacks toasts at `position`, newest nearest the configured edge, with an 8 px gap and no extra space at the edge beyond the safe-area gutter it keeps; it spans the inline axis within its inset, honoring start and end insets in either direction. Each edge sits at the provider's `layerInset`, and a `toast.inset` edge, when set, replaces it (`spec:AST-059` FR6). Implementation gaps: a `toast.inset` edge set to 0 does not replace the provider's value, and an edge opposite the position, such as `top` for a bottom stack, moves the stack to that edge (Current-state impact). | Current source and tests |
|
|
200
197
|
| FR7 | With `maxVisible` of 1 or more, at most that many toasts show; when more are raised, the oldest wait hidden and return as visible toasts leave. `maxVisible={0}` shows every toast. | Current source and tests |
|
|
201
|
-
| FR8 | A toast whose `uniqueID` matches a toast the viewport holds, whether shown, hidden by the cap, or exiting, replaces it in place under `overwrite` (and is announced again; the card remounts, so focus inside it drops to the page body), and is dropped unshown and unannounced under `ignore
|
|
198
|
+
| FR8 | A toast whose `uniqueID` matches a toast the viewport holds, whether shown, hidden by the cap, or exiting, replaces it in place under `overwrite` (and is announced again; the card remounts, so focus inside it drops to the page body), and is dropped unshown and unannounced under `ignore`, even when both are raised before the first renders. Implementation gap: overwriting a toast hidden by the cap announces it while it is not shown, and nothing is announced when it surfaces (Current-state impact). | Current source and tests |
|
|
202
199
|
| FR9 | Each shown toast has one announcement owner (`spec:AST-086` FR1): the viewport announces it once, when it is shown, `error` assertively and `info` politely, using the toast's text content, through its own persistent polite and assertive containers, which move with it into a modal (`spec:AST-086` FR10). Unrelated renders do not re-announce. Implementation gaps: the viewport announces through the shared body-level channel, which a modal hides, and announces at dispatch rather than when a toast appears (Current-state impact). | `spec:AST-086`; tests |
|
|
203
200
|
| FR10 | F6 moves focus to the first control in the newest toast and remembers where focus was. Dismissing a toast that holds focus moves focus to a control in a remaining toast, or back to the remembered element when none remain. Implementation gap: with no control in the target toast, F6 leaves focus where it was and the handoff drops focus to the page, and dismissing the last toast after reaching it with Tab rather than F6 also drops focus to the page (Current-state impact). | Current source and tests |
|
|
204
201
|
| FR11 | While a toast is visible the viewport is a `region` landmark named by `@astryx.toast.viewport`, without `aria-modal`; it exposes no landmark when empty, so an empty nested viewport adds none. Implementation gap: nested viewports that each hold a toast expose two landmarks (Current-state impact). | Current source and tests |
|
|
@@ -221,8 +218,8 @@ Consumer migration instructions belong in consumer docs and release notes.
|
|
|
221
218
|
|
|
222
219
|
### Transformation and precedence order
|
|
223
220
|
|
|
224
|
-
- **ORD1 — Collision.** `ignore` drops a matching toast before announcement
|
|
225
|
-
|
|
221
|
+
- **ORD1 — Collision.** `ignore` drops a matching toast before announcement;
|
|
222
|
+
`overwrite` replaces it, then announces.
|
|
226
223
|
|
|
227
224
|
### Performance and resources
|
|
228
225
|
|