@astryxdesign/core 0.7.4 → 0.7.5-canary.0026f37
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 +2 -2
- package/dist/AlertDialog/index.d.ts +4 -4
- package/dist/AlertDialog/useImperativeAlertDialog.d.ts +1 -1
- package/dist/AppShell/AppShell.d.ts +4 -4
- package/dist/AppShell/index.d.ts +4 -4
- package/dist/AspectRatio/AspectRatio.d.ts +1 -1
- package/dist/AspectRatio/index.d.ts +2 -2
- package/dist/Avatar/Avatar.d.ts +2 -2
- package/dist/Avatar/AvatarStatusDot.d.ts +2 -2
- package/dist/Avatar/index.d.ts +4 -4
- package/dist/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/dist/AvatarGroup/AvatarGroupContext.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/index.d.ts +6 -6
- package/dist/Badge/Badge.d.ts +2 -2
- package/dist/Badge/index.d.ts +2 -2
- package/dist/Banner/Banner.d.ts +4 -4
- package/dist/Banner/index.d.ts +2 -2
- package/dist/Blockquote/Blockquote.d.ts +1 -1
- package/dist/Blockquote/index.d.ts +2 -2
- package/dist/BottomSheet/BottomSheet.d.ts +10 -6
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +12 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts +3 -3
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts +1 -1
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +2 -2
- package/dist/BottomSheet/index.d.ts +4 -4
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/Breadcrumbs/index.d.ts +12 -12
- package/dist/Button/Button.d.ts +4 -4
- package/dist/Button/index.d.ts +2 -2
- package/dist/ButtonGroup/ButtonGroup.d.ts +4 -4
- package/dist/ButtonGroup/index.d.ts +4 -4
- package/dist/Calendar/Calendar.d.ts +3 -3
- package/dist/Calendar/dayCellUtils.d.ts +1 -1
- package/dist/Calendar/getInitialFocusDate.d.ts +2 -2
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts +1 -1
- package/dist/Calendar/hooks/index.d.ts +6 -6
- package/dist/Calendar/hooks/useCalendarConstraints.d.ts +2 -2
- package/dist/Calendar/hooks/useCalendarDays.d.ts +2 -2
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts +2 -2
- package/dist/Calendar/index.d.ts +5 -5
- package/dist/Calendar/utils.d.ts +1 -1
- package/dist/Card/Card.d.ts +4 -4
- package/dist/Card/index.d.ts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/Carousel/index.d.ts +2 -2
- package/dist/Center/Center.d.ts +2 -2
- package/dist/Center/index.d.ts +2 -2
- package/dist/Chat/ChatComposer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerInput.d.ts +4 -4
- package/dist/Chat/ChatDictationButton.d.ts +2 -2
- package/dist/Chat/ChatLayout.d.ts +1 -1
- package/dist/Chat/ChatLayoutScrollButton.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts +2 -2
- package/dist/Chat/ChatMessageBubble.d.ts +2 -2
- package/dist/Chat/ChatMessageList.d.ts +3 -3
- package/dist/Chat/ChatMessageMetadata.d.ts +1 -1
- package/dist/Chat/ChatSendButton.d.ts +1 -1
- package/dist/Chat/ChatSystemMessage.d.ts +1 -1
- package/dist/Chat/ChatTokenizedText.d.ts +2 -2
- package/dist/Chat/ChatToolCalls.d.ts +1 -1
- package/dist/Chat/index.d.ts +43 -43
- package/dist/Chat/useChatComposerTokens.d.ts +1 -1
- package/dist/Chat/useChatDictation.d.ts +1 -1
- package/dist/Chat/useChatPasteAsToken.d.ts +1 -1
- package/dist/Chat/useTriggerMenu.d.ts +2 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts +4 -4
- package/dist/CheckboxInput/index.d.ts +2 -2
- package/dist/CheckboxList/CheckboxList.d.ts +4 -4
- package/dist/CheckboxList/CheckboxListItem.d.ts +2 -2
- package/dist/CheckboxList/index.d.ts +4 -4
- package/dist/Citation/Citation.d.ts +1 -1
- package/dist/Citation/index.d.ts +2 -2
- package/dist/ClickableCard/ClickableCard.d.ts +3 -3
- package/dist/ClickableCard/index.d.ts +2 -2
- package/dist/Code/Code.d.ts +1 -1
- package/dist/Code/index.d.ts +1 -1
- package/dist/CodeBlock/CodeBlock.d.ts +2 -2
- package/dist/CodeBlock/highlightRanges.d.ts +1 -1
- package/dist/CodeBlock/index.d.ts +8 -8
- package/dist/Collapsible/Collapsible.d.ts +2 -2
- package/dist/Collapsible/CollapsibleGroup.d.ts +2 -2
- package/dist/Collapsible/index.d.ts +7 -7
- package/dist/CommandPalette/CommandPalette.d.ts +2 -2
- package/dist/CommandPalette/CommandPaletteContext.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteEmpty.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteFooter.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteGroup.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteItem.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
- package/dist/CommandPalette/index.d.ts +16 -16
- package/dist/ComplexSelector/ComplexSelector.d.ts +5 -5
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts +4 -4
- package/dist/ContextMenu/index.d.ts +9 -9
- package/dist/DateInput/DateInput.d.ts +7 -7
- package/dist/DateInput/MonthScroller.d.ts +1 -1
- package/dist/DateInput/NativeDateField.d.ts +1 -1
- package/dist/DateInput/TouchDateField.d.ts +1 -1
- package/dist/DateInput/index.d.ts +2 -2
- package/dist/DateInput/monthGeometry.d.ts +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts +6 -6
- package/dist/DateRangeInput/index.d.ts +2 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts +6 -6
- package/dist/DateTimeInput/NativeDateSegment.d.ts +3 -3
- package/dist/DateTimeInput/NativeTimeSegment.d.ts +4 -4
- package/dist/DateTimeInput/TouchDateTimeField.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts +2 -2
- package/dist/Dialog/Dialog.d.ts +3 -3
- package/dist/Dialog/DialogHeader.d.ts +1 -1
- package/dist/Dialog/index.d.ts +6 -6
- package/dist/Dialog/useImperativeDialog.d.ts +1 -1
- package/dist/Divider/Divider.d.ts +2 -2
- package/dist/Divider/index.d.ts +2 -2
- package/dist/Drawer/Drawer.d.ts +3 -3
- package/dist/Drawer/DrawerHeader.d.ts +1 -1
- package/dist/Drawer/index.d.ts +4 -4
- package/dist/DropdownMenu/DropdownMenu.d.ts +5 -5
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +2 -2
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.d.ts +2 -2
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +2 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +2 -2
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +10 -10
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +2 -2
- package/dist/DropdownMenu/renderDropdownItems.d.ts +1 -1
- package/dist/DropdownMenu/useMenuDrillIn.d.ts +1 -1
- package/dist/EmptyState/EmptyState.d.ts +1 -1
- package/dist/EmptyState/index.d.ts +2 -2
- package/dist/Field/Field.d.ts +5 -5
- package/dist/Field/FieldLabel.d.ts +2 -2
- package/dist/Field/PanelSearchInput.d.ts +1 -1
- package/dist/Field/fieldInputFamily.testing.d.ts +1 -1
- package/dist/Field/fieldParts.d.ts +1 -1
- package/dist/Field/index.d.ts +10 -10
- package/dist/Field/inputDisabledFocus.d.ts +14 -0
- package/dist/Field/inputDisabledFocus.d.ts.map +1 -0
- package/dist/Field/inputDisabledFocus.js +19 -0
- package/dist/FieldStatus/FieldStatus.d.ts +3 -3
- package/dist/FieldStatus/index.d.ts +2 -2
- package/dist/FieldStatus/useFieldStatusAnnouncement.d.ts +1 -1
- package/dist/FileInput/FileInput.d.ts +4 -4
- package/dist/FileInput/index.d.ts +2 -2
- package/dist/FormLayout/FormLayout.d.ts +2 -2
- package/dist/FormLayout/index.d.ts +4 -4
- package/dist/Grid/Grid.d.ts +3 -3
- package/dist/Grid/GridSpan.d.ts +1 -1
- package/dist/Grid/index.d.ts +4 -4
- package/dist/HStack/HStack.d.ts +2 -2
- package/dist/HStack/index.d.ts +1 -1
- package/dist/Heading/Heading.d.ts +4 -4
- package/dist/Heading/index.d.ts +1 -1
- package/dist/HoverCard/HoverCard.d.ts +4 -4
- package/dist/HoverCard/index.d.ts +4 -4
- package/dist/HoverCard/useHoverCard.d.ts +2 -2
- package/dist/Icon/Icon.d.ts +3 -3
- package/dist/Icon/IconDefaultSizeContext.d.ts +1 -1
- package/dist/Icon/defaultIcons.d.ts +1 -1
- package/dist/Icon/globalIconRegistry.d.ts +1 -1
- package/dist/Icon/index.d.ts +5 -5
- package/dist/Icon/useIcon.d.ts +1 -1
- package/dist/IconButton/IconButton.d.ts +1 -1
- package/dist/IconButton/index.d.ts +2 -2
- package/dist/Indicator/CheckIndicator.d.ts +1 -1
- package/dist/Indicator/CheckboxIndicator.d.ts +1 -1
- package/dist/Indicator/RadioIndicator.d.ts +1 -1
- package/dist/Indicator/index.d.ts +8 -8
- package/dist/Indicator/indicatorRegistry.d.ts +2 -2
- package/dist/Indicator/types.d.ts +1 -1
- package/dist/Indicator/useIndicator.d.ts +2 -2
- package/dist/InputGroup/InputGroup.d.ts +2 -2
- package/dist/InputGroup/InputGroupText.d.ts +1 -1
- package/dist/InputGroup/index.d.ts +6 -6
- package/dist/InteractiveRoleContext/InteractiveRoleContext.d.ts +1 -1
- package/dist/InteractiveRoleContext/index.d.ts +1 -1
- package/dist/Item/Item.d.ts +1 -1
- package/dist/Item/ItemSwipeLayer.d.ts +2 -2
- package/dist/Item/index.d.ts +2 -2
- package/dist/Kbd/Kbd.d.ts +1 -1
- package/dist/Kbd/index.d.ts +2 -2
- package/dist/Layer/LayerProvider.d.ts +1 -1
- package/dist/Layer/index.d.ts +18 -18
- package/dist/Layer/layerInset.d.ts +1 -1
- package/dist/Layer/layerSlideRules.d.ts +1 -1
- package/dist/Layer/modalOutlet.d.ts +1 -1
- package/dist/Layer/modalOutlet.js +1 -1
- package/dist/Layer/useLayerDismissal.d.ts +1 -1
- package/dist/Layout/Layout.d.ts +2 -2
- package/dist/Layout/LayoutContent.d.ts +2 -2
- package/dist/Layout/LayoutFooter.d.ts +2 -2
- package/dist/Layout/LayoutHeader.d.ts +2 -2
- package/dist/Layout/LayoutPanel.d.ts +3 -3
- package/dist/Layout/index.d.ts +29 -29
- package/dist/Layout/padding.stylex.d.ts +1 -1
- package/dist/Lightbox/Lightbox.d.ts +1 -1
- package/dist/Lightbox/index.d.ts +4 -4
- package/dist/Lightbox/useLightbox.d.ts +1 -1
- package/dist/Link/Link.d.ts +3 -3
- package/dist/Link/LinkContext.d.ts +1 -1
- package/dist/Link/LinkProvider.d.ts +1 -1
- package/dist/Link/index.d.ts +8 -8
- package/dist/Link/useLinkComponent.d.ts +1 -1
- package/dist/List/List.d.ts +3 -3
- package/dist/List/ListItem.d.ts +2 -2
- package/dist/List/index.d.ts +4 -4
- package/dist/Markdown/Markdown.d.ts +4 -4
- package/dist/Markdown/headingProjection.d.ts +3 -3
- package/dist/Markdown/index.d.ts +7 -7
- package/dist/Markdown/parser/index.d.ts +3 -3
- package/dist/Markdown/parser.d.ts +3 -3
- package/dist/Markdown/plugin-renderer/MarkdownPluginNodeRenderer.d.ts +1 -1
- package/dist/Markdown/plugin-renderer/index.d.ts +2 -2
- package/dist/Markdown/plugins/frontmatter.d.ts +2 -2
- package/dist/Markdown/plugins/headingLinks.d.ts +2 -2
- package/dist/Markdown/plugins/index.d.ts +14 -14
- package/dist/Markdown/plugins/protocol.d.ts +1 -1
- package/dist/Markdown/plugins/semanticFence.d.ts +2 -2
- package/dist/Markdown/plugins/softBreaks.d.ts +1 -1
- package/dist/Markdown/plugins/sourceDecoration.d.ts +2 -2
- package/dist/Markdown/plugins/sourceLines.d.ts +1 -1
- package/dist/Markdown/plugins/textTransform.d.ts +2 -2
- package/dist/Markdown/remark.d.ts +1 -1
- package/dist/Markdown/utils.d.ts +4 -4
- package/dist/MetadataList/MetadataList.d.ts +2 -2
- package/dist/MetadataList/MetadataListItem.d.ts +1 -1
- package/dist/MetadataList/index.d.ts +5 -5
- package/dist/MobileNav/MobileNav.d.ts +1 -1
- package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
- package/dist/MobileNav/index.d.ts +4 -4
- package/dist/MoreMenu/MoreMenu.d.ts +4 -4
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts +7 -7
- package/dist/MultiSelector/hooks.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts +3 -3
- package/dist/MultiSelector/types.d.ts +1 -1
- package/dist/NavIcon/NavIcon.d.ts +1 -1
- package/dist/NavIcon/index.d.ts +2 -2
- package/dist/NavMenu/NavHeadingMenu.d.ts +2 -2
- package/dist/NavMenu/NavHeadingMenuItem.d.ts +2 -2
- package/dist/NavMenu/index.d.ts +6 -6
- package/dist/NumberInput/NumberInput.d.ts +5 -5
- package/dist/NumberInput/index.d.ts +2 -2
- package/dist/NumberInput/numberInputCommit.d.ts +1 -1
- package/dist/NumberInput/numberParser.d.ts +1 -1
- package/dist/Outline/Outline.d.ts +3 -3
- package/dist/Outline/index.d.ts +7 -7
- package/dist/Outline/parseOutlineFromMarkdown.d.ts +2 -2
- package/dist/Outline/useOutlineFromDOM.d.ts +1 -1
- package/dist/Outline/useOutlineFromMarkdown.d.ts +3 -3
- package/dist/Outline/useScrollSpy.d.ts +1 -1
- package/dist/OverflowList/OverflowList.d.ts +2 -2
- package/dist/OverflowList/index.d.ts +2 -2
- package/dist/Overlay/Overlay.d.ts +2 -2
- package/dist/Overlay/index.d.ts +5 -5
- package/dist/Overlay/useOverlay.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts +2 -2
- package/dist/Pagination/index.d.ts +2 -2
- package/dist/Popover/Popover.d.ts +3 -3
- package/dist/Popover/index.d.ts +4 -4
- package/dist/Popover/usePopover.d.ts +2 -2
- package/dist/PowerSearch/PowerSearch.d.ts +5 -5
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +2 -2
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +2 -2
- package/dist/PowerSearch/formatFilterValue.d.ts +3 -3
- package/dist/PowerSearch/index.d.ts +8 -8
- package/dist/PowerSearch/resolveDateTimeRangePart.d.ts +1 -1
- package/dist/PowerSearch/resolveOperatorLabel.d.ts +2 -2
- package/dist/PowerSearch/types.d.ts +1 -1
- package/dist/PowerSearch/useInternalConfig.d.ts +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.d.ts +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts +3 -3
- package/dist/PowerSearch/utils.d.ts +3 -3
- package/dist/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/ProgressBar/index.d.ts +2 -2
- package/dist/RadioList/RadioList.d.ts +3 -3
- package/dist/RadioList/RadioListItem.d.ts +2 -2
- package/dist/RadioList/index.d.ts +4 -4
- package/dist/Resizable/ResizeHandle.d.ts +2 -2
- package/dist/Resizable/index.d.ts +6 -6
- package/dist/Resizable/useResizable.d.ts +2 -2
- package/dist/Resizable/utils.d.ts +3 -3
- package/dist/ScrollableArea/ScrollableArea.d.ts +3 -3
- package/dist/ScrollableArea/index.d.ts +4 -4
- package/dist/Section/Section.d.ts +3 -3
- package/dist/Section/index.d.ts +2 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts +2 -2
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/dist/SegmentedControl/index.d.ts +5 -5
- package/dist/SelectableCard/SelectableCard.d.ts +3 -3
- package/dist/SelectableCard/index.d.ts +2 -2
- package/dist/Selector/Selector.d.ts +8 -8
- package/dist/Selector/SelectorOption.d.ts +1 -1
- package/dist/Selector/hooks.d.ts +1 -1
- package/dist/Selector/index.d.ts +4 -4
- package/dist/Selector/types.d.ts +1 -1
- package/dist/Selector/useSelectorPresentation.d.ts +2 -2
- package/dist/Selector/utils.d.ts +1 -1
- package/dist/SideNav/SideNav.d.ts +3 -3
- package/dist/SideNav/SideNavCollapseButton.d.ts +3 -3
- package/dist/SideNav/SideNavHeading.d.ts +2 -2
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +34 -0
- package/dist/SideNav/SideNavItem.d.ts +4 -4
- package/dist/SideNav/SideNavSection.d.ts +1 -1
- package/dist/SideNav/index.d.ts +14 -14
- package/dist/SizeContext/index.d.ts +1 -1
- package/dist/Skeleton/Skeleton.d.ts +1 -1
- package/dist/Skeleton/index.d.ts +2 -2
- package/dist/Slider/Slider.d.ts +3 -3
- package/dist/Slider/index.d.ts +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/index.d.ts +2 -2
- package/dist/Stack/Stack.d.ts +3 -3
- package/dist/Stack/StackItem.d.ts +2 -2
- package/dist/Stack/index.d.ts +6 -6
- package/dist/Stack/stack.stylex.d.ts +1 -1
- package/dist/StatusDot/StatusDot.d.ts +2 -2
- package/dist/StatusDot/index.d.ts +2 -2
- package/dist/Stepper/Step.d.ts +2 -2
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +3 -3
- package/dist/Stepper/Stepper.d.ts +2 -2
- package/dist/Stepper/index.d.ts +7 -7
- package/dist/Switch/Switch.d.ts +4 -4
- package/dist/Switch/index.d.ts +2 -2
- package/dist/TabList/Tab.d.ts +2 -2
- package/dist/TabList/TabList.d.ts +3 -3
- package/dist/TabList/TabMenu.d.ts +2 -2
- package/dist/TabList/index.d.ts +8 -8
- package/dist/Table/BaseTable.d.ts +1 -1
- package/dist/Table/Table.d.ts +1 -1
- package/dist/Table/TableBody.d.ts +1 -1
- package/dist/Table/TableCell.d.ts +3 -3
- package/dist/Table/TableContext.d.ts +1 -1
- package/dist/Table/TableFooter.d.ts +1 -1
- package/dist/Table/TableHeader.d.ts +1 -1
- package/dist/Table/TableHeaderCell.d.ts +3 -3
- package/dist/Table/TableRow.d.ts +2 -2
- package/dist/Table/TableSelectionToolbar.d.ts +2 -2
- package/dist/Table/columnUtils.d.ts +1 -1
- package/dist/Table/index.d.ts +54 -54
- package/dist/Table/plugins/columnResize/index.d.ts +2 -2
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts +1 -1
- package/dist/Table/plugins/columnSettings/index.d.ts +4 -4
- package/dist/Table/plugins/columnSettings/useTableColumnSettings.d.ts +2 -2
- package/dist/Table/plugins/columnSettings/useTableColumnSettingsState.d.ts +1 -1
- package/dist/Table/plugins/filtering/index.d.ts +4 -4
- package/dist/Table/plugins/filtering/useTableFilterState.d.ts +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts +2 -2
- package/dist/Table/plugins/groupedRows/index.d.ts +2 -2
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
- package/dist/Table/plugins/pagination/index.d.ts +3 -3
- package/dist/Table/plugins/pagination/useTablePagination.d.ts +1 -1
- package/dist/Table/plugins/rowExpansion/index.d.ts +2 -2
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +1 -1
- package/dist/Table/plugins/rowIndex/index.d.ts +2 -2
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +1 -1
- package/dist/Table/plugins/rowStatus/index.d.ts +2 -2
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts +2 -2
- package/dist/Table/plugins/selection/index.d.ts +4 -4
- package/dist/Table/plugins/selection/useTableSelection.d.ts +1 -1
- package/dist/Table/plugins/selection/useTableSelectionState.d.ts +1 -1
- package/dist/Table/plugins/sortable/index.d.ts +4 -4
- package/dist/Table/plugins/sortable/useTableSortable.d.ts +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts +1 -1
- package/dist/Table/plugins/stickyColumns/index.d.ts +2 -2
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts +1 -1
- package/dist/Table/plugins/tree/index.d.ts +4 -4
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +1 -1
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +1 -1
- package/dist/Table/tableContextMenu.d.ts +2 -2
- package/dist/Table/types.d.ts +3 -3
- package/dist/Table/useBaseTablePlugins.d.ts +1 -1
- package/dist/Table/useTableCellStyles.d.ts +2 -2
- package/dist/Table/utils.d.ts +2 -2
- package/dist/Text/Text.d.ts +3 -3
- package/dist/Text/index.d.ts +4 -4
- package/dist/TextArea/TextArea.d.ts +10 -8
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +14 -11
- package/dist/TextArea/index.d.ts +2 -2
- package/dist/TextInput/TextInput.d.ts +11 -9
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +20 -11
- package/dist/TextInput/index.d.ts +2 -2
- package/dist/Thumbnail/Thumbnail.d.ts +1 -1
- package/dist/Thumbnail/index.d.ts +2 -2
- package/dist/TimeInput/TimeInput.d.ts +6 -6
- package/dist/TimeInput/TouchTimeField.d.ts +1 -1
- package/dist/TimeInput/index.d.ts +3 -3
- package/dist/Timer/Timer.d.ts +2 -2
- package/dist/Timer/index.d.ts +2 -2
- package/dist/Timestamp/Timestamp.d.ts +3 -3
- package/dist/Timestamp/TimestampHoverCard.d.ts +1 -1
- package/dist/Timestamp/formatInstant.d.ts +2 -2
- package/dist/Timestamp/formatRelativeTime.d.ts +1 -1
- package/dist/Timestamp/index.d.ts +3 -3
- package/dist/Timestamp/tooltipEntries.d.ts +2 -2
- package/dist/Toast/Toast.d.ts +2 -2
- package/dist/Toast/ToastContext.d.ts +1 -1
- package/dist/Toast/ToastViewport.d.ts +2 -2
- package/dist/Toast/index.d.ts +6 -6
- package/dist/Toast/useToast.d.ts +1 -1
- package/dist/ToggleButton/ToggleButton.d.ts +3 -3
- package/dist/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/dist/ToggleButton/index.d.ts +4 -4
- package/dist/Token/Token.d.ts +2 -2
- package/dist/Token/TokenLink.d.ts +1 -1
- package/dist/Token/index.d.ts +2 -2
- package/dist/Tokenizer/Tokenizer.d.ts +6 -6
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +44 -40
- package/dist/Tokenizer/index.d.ts +2 -2
- package/dist/Tokenizer/useEndLaneReserve.d.ts +3 -2
- package/dist/Tokenizer/useEndLaneReserve.d.ts.map +1 -1
- package/dist/Tokenizer/useEndLaneReserve.js +3 -2
- package/dist/Toolbar/Toolbar.d.ts +4 -4
- package/dist/Toolbar/index.d.ts +2 -2
- package/dist/Tooltip/Tooltip.d.ts +3 -3
- package/dist/Tooltip/index.d.ts +4 -4
- package/dist/Tooltip/useTooltip.d.ts +2 -2
- package/dist/TopNav/TopNav.d.ts +1 -1
- package/dist/TopNav/TopNavHeading.d.ts +2 -2
- package/dist/TopNav/TopNavItem.d.ts +3 -3
- package/dist/TopNav/TopNavMegaMenu.d.ts +1 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.d.ts +2 -2
- package/dist/TopNav/TopNavMenu.d.ts +1 -1
- package/dist/TopNav/index.d.ts +16 -16
- package/dist/TreeList/TreeList.d.ts +3 -3
- package/dist/TreeList/TreeListItem.d.ts +1 -1
- package/dist/TreeList/TreeListTypes.d.ts +1 -1
- package/dist/TreeList/index.d.ts +3 -3
- package/dist/Typeahead/BaseTypeahead.d.ts +2 -2
- package/dist/Typeahead/Typeahead.d.ts +6 -6
- package/dist/Typeahead/TypeaheadItem.d.ts +2 -2
- package/dist/Typeahead/createStaticSource.d.ts +1 -1
- package/dist/Typeahead/index.d.ts +9 -9
- package/dist/Typeahead/utils.d.ts +3 -3
- package/dist/VStack/VStack.d.ts +2 -2
- package/dist/VStack/index.d.ts +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +24 -6
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +24 -5
- package/dist/VisuallyHidden/index.d.ts +2 -2
- package/dist/astryx.css +6 -13
- package/dist/hooks/index.d.ts +52 -52
- package/dist/hooks/useAutoMediaMode.d.ts +1 -1
- package/dist/hooks/useInputContainer.d.ts +1 -1
- package/dist/hooks/useInputStatusIcon.d.ts +3 -3
- package/dist/hooks/useMenuPress.d.ts +1 -1
- package/dist/hooks/usePressFeedback.d.ts +1 -1
- package/dist/hooks/useScrollableArea.d.ts +1 -1
- package/dist/i18n/InternationalizationContext.d.ts +2 -2
- package/dist/i18n/InternationalizationProvider.d.ts +1 -1
- package/dist/i18n/index.d.ts +12 -12
- package/dist/i18n/resolve.d.ts +1 -1
- package/dist/i18n/useLocale.d.ts +1 -1
- package/dist/index.d.ts +111 -111
- package/dist/theme/Theme.d.ts +2 -2
- package/dist/theme/contrast.d.ts +1 -1
- package/dist/theme/defineTheme.d.ts +12 -12
- package/dist/theme/domainTokens/index.d.ts +6 -6
- package/dist/theme/generateThemeRules.d.ts +1 -1
- package/dist/theme/index.d.ts +31 -31
- package/dist/theme/localTokens.d.ts +1 -1
- package/dist/theme/mergeComponents.d.ts +1 -1
- package/dist/theme/onMediaTokens.d.ts +1 -1
- package/dist/theme/resolveThemeValues.d.ts +7 -7
- package/dist/theme/syntax/SyntaxTheme.d.ts +1 -1
- package/dist/theme/syntax/index.d.ts +7 -7
- package/dist/theme/syntax/presets.d.ts +1 -1
- package/dist/theme/themeAdaptations.d.ts +5 -5
- package/dist/theme/themeRegistry.d.ts +1 -1
- package/dist/theme/tokens.d.ts +1 -1
- package/dist/theme/types.d.ts +1 -1
- package/dist/theme/useTheme.d.ts +2 -2
- package/dist/utils/dateParser.d.ts +3 -3
- package/dist/utils/groupItems.d.ts +1 -1
- package/dist/utils/index.d.ts +29 -29
- package/dist/utils/plainDate.d.ts +3 -3
- package/package.json +5 -5
- package/src/Badge/Badge.doc.mjs +2 -1
- package/src/BottomSheet/BottomSheet.tsx +12 -1
- package/src/BottomSheet/__tests__/BottomSheetToastOutlet.a11y.chromium.spec.ts +82 -0
- package/src/Field/inputDisabledFocus.ts +28 -0
- package/src/Icon/Icon.spec.md +40 -29
- package/src/Layer/modalOutlet.ts +1 -1
- package/src/SideNav/SideNav.test.tsx +15 -6
- package/src/SideNav/SideNavHeading.tsx +41 -0
- package/src/Stepper/Step.tsx +7 -0
- package/src/Stepper/Stepper.test.tsx +33 -0
- package/src/TextArea/TextArea.doc.mjs +6 -6
- package/src/TextArea/TextArea.test.tsx +65 -6
- package/src/TextArea/TextArea.tsx +26 -14
- package/src/TextInput/TextInput.doc.mjs +8 -8
- package/src/TextInput/TextInput.test.tsx +72 -6
- package/src/TextInput/TextInput.tsx +32 -14
- package/src/Toast/ToastViewport.modalHost.test.tsx +139 -4
- package/src/Tokenizer/Tokenizer.test.tsx +26 -8
- package/src/Tokenizer/Tokenizer.tsx +65 -72
- package/src/Tokenizer/__tests__/TokenizerEndLane.a11y.chromium.spec.ts +471 -0
- package/src/Tokenizer/useEndLaneReserve.ts +3 -2
- package/src/VisuallyHidden/VisuallyHidden.doc.mjs +1 -1
- package/src/VisuallyHidden/VisuallyHidden.test.tsx +39 -0
- package/src/VisuallyHidden/VisuallyHidden.tsx +38 -5
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file TokenizerEndLane.a11y.chromium.spec.ts
|
|
5
|
+
* @input `Core/Tokenizer` and `Core/PowerSearch` stories in a built Storybook.
|
|
6
|
+
* @output Real-engine proof that tokens, the overflow count and the input's
|
|
7
|
+
* text box never paint under the end lane (clear-all and busy indicator),
|
|
8
|
+
* across field widths, both writing directions and both overflow modes.
|
|
9
|
+
* @position Run with `pnpm test:a11y-contract`. The lane is absolutely
|
|
10
|
+
* positioned, so whether a token reaches it depends on how rows wrap at a
|
|
11
|
+
* given width, which only a shipping layout engine can show.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import {expect, test, type Page} from '@playwright/test';
|
|
15
|
+
import {
|
|
16
|
+
DEFAULT_STORYBOOK_DIR,
|
|
17
|
+
serveStorybook,
|
|
18
|
+
type StaticServer,
|
|
19
|
+
} from '@astryxdesign/a11y-spec/storybook';
|
|
20
|
+
|
|
21
|
+
let storybook: StaticServer;
|
|
22
|
+
|
|
23
|
+
test.beforeAll(async () => {
|
|
24
|
+
storybook = await serveStorybook(
|
|
25
|
+
process.env.ASTRYX_STORYBOOK_DIR ?? DEFAULT_STORYBOOK_DIR,
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test.afterAll(async () => {
|
|
30
|
+
await storybook?.close();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
type Direction = 'ltr' | 'rtl';
|
|
34
|
+
|
|
35
|
+
async function open(
|
|
36
|
+
page: Page,
|
|
37
|
+
id: string,
|
|
38
|
+
direction: Direction,
|
|
39
|
+
args = '',
|
|
40
|
+
): Promise<void> {
|
|
41
|
+
await page.goto(
|
|
42
|
+
`${storybook.origin}/iframe.html?id=${id}&viewMode=story&globals=direction:${direction}${args ? `&args=${args}` : ''}`,
|
|
43
|
+
{waitUntil: 'load'},
|
|
44
|
+
);
|
|
45
|
+
await page
|
|
46
|
+
.locator('button[aria-label="Clear all"]')
|
|
47
|
+
.first()
|
|
48
|
+
.waitFor({state: 'attached'});
|
|
49
|
+
await page.evaluate(async () => {
|
|
50
|
+
await document.fonts.ready;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Sets the story's sizing container to `width` and, for every field with a
|
|
56
|
+
* visible clear-all lane, returns each visible box that intersects the lane:
|
|
57
|
+
* tokens, the "+N more" count, and the input's content box (where its text
|
|
58
|
+
* and caret paint).
|
|
59
|
+
*/
|
|
60
|
+
async function overlapsAt(page: Page, width: number): Promise<string[]> {
|
|
61
|
+
return page.evaluate(async width => {
|
|
62
|
+
// The story decorator's fixed-width box; the layer mode's popover takes
|
|
63
|
+
// its width from the in-flow field inside it.
|
|
64
|
+
const host = document.querySelector<HTMLElement>(
|
|
65
|
+
'#storybook-root [style*="width"]',
|
|
66
|
+
);
|
|
67
|
+
if (!host) {
|
|
68
|
+
throw new Error('No sizing container in the story');
|
|
69
|
+
}
|
|
70
|
+
host.style.width = `${width}px`;
|
|
71
|
+
for (let frame = 0; frame < 4; frame++) {
|
|
72
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const isShown = (el: Element) =>
|
|
76
|
+
el.checkVisibility({visibilityProperty: true}) &&
|
|
77
|
+
!el.closest('[aria-hidden="true"]');
|
|
78
|
+
const lanes = [
|
|
79
|
+
...document.querySelectorAll('button[aria-label="Clear all"]'),
|
|
80
|
+
]
|
|
81
|
+
.filter(isShown)
|
|
82
|
+
.map(clear => clear.parentElement)
|
|
83
|
+
.filter(lane => lane?.parentElement != null) as HTMLElement[];
|
|
84
|
+
if (lanes.length === 0) {
|
|
85
|
+
throw new Error('No clear-all lane is visible');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return lanes.flatMap((lane, fieldIndex) => {
|
|
89
|
+
const field = lane.parentElement as HTMLElement;
|
|
90
|
+
const boxes: {name: string; rect: DOMRect}[] = [];
|
|
91
|
+
field.querySelectorAll('.astryx-token').forEach((token, index) => {
|
|
92
|
+
if (isShown(token)) {
|
|
93
|
+
boxes.push({
|
|
94
|
+
name: `token ${index}`,
|
|
95
|
+
rect: token.getBoundingClientRect(),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
field.querySelectorAll('span').forEach(span => {
|
|
100
|
+
if (/^\+\d+ more$/.test(span.textContent ?? '') && isShown(span)) {
|
|
101
|
+
boxes.push({
|
|
102
|
+
name: 'overflow count',
|
|
103
|
+
rect: span.getBoundingClientRect(),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const input = field.querySelector<HTMLInputElement>('[role="combobox"]');
|
|
108
|
+
if (input && isShown(input) && getComputedStyle(input).opacity !== '0') {
|
|
109
|
+
const style = getComputedStyle(input);
|
|
110
|
+
const rect = input.getBoundingClientRect();
|
|
111
|
+
const left = rect.left + parseFloat(style.paddingLeft);
|
|
112
|
+
const right = rect.right - parseFloat(style.paddingRight);
|
|
113
|
+
if (right > left) {
|
|
114
|
+
boxes.push({
|
|
115
|
+
name: 'input text box',
|
|
116
|
+
rect: new DOMRect(left, rect.top, right - left, rect.height),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const laneRect = lane.getBoundingClientRect();
|
|
122
|
+
return boxes.flatMap(({name, rect}) => {
|
|
123
|
+
const x =
|
|
124
|
+
Math.min(rect.right, laneRect.right) -
|
|
125
|
+
Math.max(rect.left, laneRect.left);
|
|
126
|
+
const y =
|
|
127
|
+
Math.min(rect.bottom, laneRect.bottom) -
|
|
128
|
+
Math.max(rect.top, laneRect.top);
|
|
129
|
+
return x > 0.5 && y > 0.5
|
|
130
|
+
? [
|
|
131
|
+
`${width}px field ${fieldIndex}: ${name} overlaps the end lane by ${x.toFixed(1)}px`,
|
|
132
|
+
]
|
|
133
|
+
: [];
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}, width);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function sweep(page: Page, from: number, to: number): Promise<string[]> {
|
|
140
|
+
const found: string[] = [];
|
|
141
|
+
for (let width = from; width <= to; width += 4) {
|
|
142
|
+
found.push(...(await overlapsAt(page, width)));
|
|
143
|
+
}
|
|
144
|
+
return found;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The same sweep with a search in flight at every width. The busy Spinner joins
|
|
149
|
+
* the lane only while a search runs, so each width is measured while the
|
|
150
|
+
* combobox reports `aria-busy`, typing again whenever the last search settled.
|
|
151
|
+
*/
|
|
152
|
+
async function sweepWhileBusy(
|
|
153
|
+
page: Page,
|
|
154
|
+
from: number,
|
|
155
|
+
to: number,
|
|
156
|
+
): Promise<string[]> {
|
|
157
|
+
const search = page.getByRole('combobox');
|
|
158
|
+
const found: string[] = [];
|
|
159
|
+
for (let width = from; width <= to; width += 4) {
|
|
160
|
+
for (;;) {
|
|
161
|
+
if ((await search.getAttribute('aria-busy')) !== 'true') {
|
|
162
|
+
await search.press('a');
|
|
163
|
+
await expect(search).toHaveAttribute('aria-busy', 'true');
|
|
164
|
+
}
|
|
165
|
+
const overlaps = await overlapsAt(page, width);
|
|
166
|
+
if ((await search.getAttribute('aria-busy')) === 'true') {
|
|
167
|
+
found.push(...overlaps);
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return found;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Sizes the story container (a pixel width, or `max-content` for a
|
|
177
|
+
* content-sized field) and returns the field's border box.
|
|
178
|
+
*/
|
|
179
|
+
async function fieldBoxAt(
|
|
180
|
+
page: Page,
|
|
181
|
+
width: string,
|
|
182
|
+
): Promise<{width: number; height: number}> {
|
|
183
|
+
return page.evaluate(async width => {
|
|
184
|
+
const host = document.querySelector<HTMLElement>(
|
|
185
|
+
'#storybook-root [style*="width"]',
|
|
186
|
+
);
|
|
187
|
+
const field = document.querySelector('button[aria-label="Clear all"]')
|
|
188
|
+
?.parentElement?.parentElement;
|
|
189
|
+
if (!host || !field) {
|
|
190
|
+
throw new Error('Field or sizing container did not render');
|
|
191
|
+
}
|
|
192
|
+
host.style.width = width;
|
|
193
|
+
for (let frame = 0; frame < 4; frame++) {
|
|
194
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
195
|
+
}
|
|
196
|
+
const {width: w, height: h} = field.getBoundingClientRect();
|
|
197
|
+
return {
|
|
198
|
+
width: Math.round(w * 100) / 100,
|
|
199
|
+
height: Math.round(h * 100) / 100,
|
|
200
|
+
};
|
|
201
|
+
}, width);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** Adds tokens through the menu, as a person would. */
|
|
205
|
+
async function addTokens(page: Page, names: string[]): Promise<void> {
|
|
206
|
+
const search = page.getByRole('combobox');
|
|
207
|
+
for (const name of names) {
|
|
208
|
+
await search.fill(name.split(' ')[0]);
|
|
209
|
+
await page.getByRole('option', {name}).click();
|
|
210
|
+
await expect(search).not.toHaveAttribute('aria-busy', 'true');
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* The field's box with a search settled and again with one in flight. The
|
|
216
|
+
* query is non-empty both times, so only the busy state differs.
|
|
217
|
+
*/
|
|
218
|
+
async function settledAndBusy(
|
|
219
|
+
page: Page,
|
|
220
|
+
width: string,
|
|
221
|
+
): Promise<string | null> {
|
|
222
|
+
const search = page.getByRole('combobox');
|
|
223
|
+
await search.fill('a');
|
|
224
|
+
await expect(search).not.toHaveAttribute('aria-busy', 'true');
|
|
225
|
+
const settled = await fieldBoxAt(page, width);
|
|
226
|
+
await search.press('b');
|
|
227
|
+
await expect(search).toHaveAttribute('aria-busy', 'true');
|
|
228
|
+
const busy = await fieldBoxAt(page, width);
|
|
229
|
+
const stillBusy = (await search.getAttribute('aria-busy')) === 'true';
|
|
230
|
+
if (!stillBusy) {
|
|
231
|
+
throw new Error(`The search settled before ${width} was measured`);
|
|
232
|
+
}
|
|
233
|
+
return settled.width === busy.width && settled.height === busy.height
|
|
234
|
+
? null
|
|
235
|
+
: `${width}: settled ${settled.width}x${settled.height}, busy ${busy.width}x${busy.height}`;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* With four tokens on the Loading story, every width from 200px to 400px and a
|
|
240
|
+
* content-sized container where the field's box differs settled vs busy.
|
|
241
|
+
*/
|
|
242
|
+
async function busyLayoutChanges(page: Page, step: number): Promise<string[]> {
|
|
243
|
+
await addTokens(page, ['Bob Smith', 'Charlie Brown', 'Diana Prince']);
|
|
244
|
+
await expect(page.locator('.astryx-token')).toHaveCount(4);
|
|
245
|
+
const changed: string[] = [];
|
|
246
|
+
for (let width = 200; width <= 400; width += step) {
|
|
247
|
+
const change = await settledAndBusy(page, `${width}px`);
|
|
248
|
+
if (change) {
|
|
249
|
+
changed.push(change);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
// Content-sized: the field may not widen while busy (input-fields FR1).
|
|
253
|
+
const contentSized = await settledAndBusy(page, 'max-content');
|
|
254
|
+
if (contentSized) {
|
|
255
|
+
changed.push(contentSized);
|
|
256
|
+
}
|
|
257
|
+
return changed;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* The blurred, collapsed field at `width`: its border box, how many tokens
|
|
262
|
+
* show, and the "+N more" count.
|
|
263
|
+
*/
|
|
264
|
+
async function collapsedRowAt(page: Page, width: string): Promise<string> {
|
|
265
|
+
const box = await fieldBoxAt(page, width);
|
|
266
|
+
const row = await page.evaluate(() => {
|
|
267
|
+
const field = document.querySelector('button[aria-label="Clear all"]')
|
|
268
|
+
?.parentElement?.parentElement;
|
|
269
|
+
if (!field) {
|
|
270
|
+
throw new Error('Field did not render');
|
|
271
|
+
}
|
|
272
|
+
const shown = [...field.querySelectorAll('.astryx-token')].filter(
|
|
273
|
+
token =>
|
|
274
|
+
token.checkVisibility({visibilityProperty: true}) &&
|
|
275
|
+
!token.closest('[aria-hidden="true"]'),
|
|
276
|
+
).length;
|
|
277
|
+
const count = [...field.querySelectorAll('span')].find(span =>
|
|
278
|
+
/^\+\d+ more$/.test(span.textContent ?? ''),
|
|
279
|
+
);
|
|
280
|
+
return `${shown} tokens, ${count?.textContent ?? 'no count'}`;
|
|
281
|
+
});
|
|
282
|
+
return `${box.width}x${box.height}, ${row}`;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
for (const direction of ['ltr', 'rtl'] as const) {
|
|
286
|
+
test.describe(direction, () => {
|
|
287
|
+
test('PowerSearch tokens (custom renderToken) wrap before the end lane', async ({
|
|
288
|
+
page,
|
|
289
|
+
}) => {
|
|
290
|
+
await open(page, 'core-powersearch--near-full-token-row', direction);
|
|
291
|
+
expect(await sweep(page, 160, 640)).toEqual([]);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
test('a token wider than the row truncates short of the end lane', async ({
|
|
295
|
+
page,
|
|
296
|
+
}) => {
|
|
297
|
+
await open(page, 'core-tokenizer--long-token-end-lane', direction);
|
|
298
|
+
expect(await sweep(page, 160, 400)).toEqual([]);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
test('default Tokenizer tokens wrap before the end lane', async ({
|
|
302
|
+
page,
|
|
303
|
+
}) => {
|
|
304
|
+
await open(
|
|
305
|
+
page,
|
|
306
|
+
'core-tokenizer--with-preselected',
|
|
307
|
+
direction,
|
|
308
|
+
'hasClear:!true',
|
|
309
|
+
);
|
|
310
|
+
expect(await sweep(page, 160, 400)).toEqual([]);
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
test('tokens stay clear of the lane while a search is busy', async ({
|
|
314
|
+
page,
|
|
315
|
+
}) => {
|
|
316
|
+
await open(page, 'core-tokenizer--loading', direction);
|
|
317
|
+
await page.getByRole('combobox').focus();
|
|
318
|
+
expect(await sweepWhileBusy(page, 200, 400)).toEqual([]);
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
test('a search starting does not move the field or its token rows', async ({
|
|
322
|
+
page,
|
|
323
|
+
}) => {
|
|
324
|
+
test.setTimeout(240_000);
|
|
325
|
+
await open(page, 'core-tokenizer--loading', direction);
|
|
326
|
+
expect(await busyLayoutChanges(page, 4)).toEqual([]);
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
test('the reserved Spinner costs no frames and stays silent while idle', async ({
|
|
330
|
+
page,
|
|
331
|
+
}) => {
|
|
332
|
+
await open(page, 'core-tokenizer--loading', direction);
|
|
333
|
+
const search = page.getByRole('combobox');
|
|
334
|
+
const cdp = await page.context().newCDPSession(page);
|
|
335
|
+
await cdp.send('Performance.enable');
|
|
336
|
+
// Style recalculations over a short window: a ticking ring animation
|
|
337
|
+
// recalculates every frame (about 30 in 500ms), an unrendered one does
|
|
338
|
+
// not. The idle allowance absorbs a stray one-off recalculation.
|
|
339
|
+
const recalcsOver = async (ms: number) => {
|
|
340
|
+
const count = async () => {
|
|
341
|
+
const {metrics} = await cdp.send('Performance.getMetrics');
|
|
342
|
+
return metrics.find(m => m.name === 'RecalcStyleCount')?.value ?? 0;
|
|
343
|
+
};
|
|
344
|
+
const before = await count();
|
|
345
|
+
await page.waitForTimeout(ms);
|
|
346
|
+
return (await count()) - before;
|
|
347
|
+
};
|
|
348
|
+
const spinnerState = async () =>
|
|
349
|
+
page.evaluate(() => {
|
|
350
|
+
const spinner = document
|
|
351
|
+
.querySelector('button[aria-label="Clear all"]')
|
|
352
|
+
?.parentElement?.querySelector('.astryx-spinner');
|
|
353
|
+
if (!spinner) {
|
|
354
|
+
throw new Error('The lane holds no Spinner');
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
hidden: spinner.getAttribute('aria-hidden') === 'true',
|
|
358
|
+
width: spinner.getBoundingClientRect().width,
|
|
359
|
+
};
|
|
360
|
+
});
|
|
361
|
+
const idle = await spinnerState();
|
|
362
|
+
expect(idle.hidden).toBe(true);
|
|
363
|
+
expect(await recalcsOver(500)).toBeLessThanOrEqual(2);
|
|
364
|
+
await search.focus();
|
|
365
|
+
await search.press('a');
|
|
366
|
+
await expect(search).toHaveAttribute('aria-busy', 'true');
|
|
367
|
+
const busy = await spinnerState();
|
|
368
|
+
expect(busy.hidden).toBe(false);
|
|
369
|
+
expect(await recalcsOver(500)).toBeGreaterThanOrEqual(10);
|
|
370
|
+
expect(busy.width).toBe(idle.width);
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
test('the idle Spinner paints nothing, even when a theme styles its box', async ({
|
|
374
|
+
page,
|
|
375
|
+
}) => {
|
|
376
|
+
await page.goto(
|
|
377
|
+
`${storybook.origin}/iframe.html?id=core-tokenizer--loading&viewMode=story&globals=direction:${direction};astryxTheme:probe`,
|
|
378
|
+
{waitUntil: 'load'},
|
|
379
|
+
);
|
|
380
|
+
await page
|
|
381
|
+
.locator('button[aria-label="Clear all"]')
|
|
382
|
+
.waitFor({state: 'attached'});
|
|
383
|
+
const search = page.getByRole('combobox');
|
|
384
|
+
const spinnerPaint = async () =>
|
|
385
|
+
page.evaluate(() => {
|
|
386
|
+
const spinner = document
|
|
387
|
+
.querySelector('button[aria-label="Clear all"]')
|
|
388
|
+
?.parentElement?.querySelector('.astryx-spinner');
|
|
389
|
+
if (!spinner) {
|
|
390
|
+
throw new Error('The lane holds no Spinner');
|
|
391
|
+
}
|
|
392
|
+
const style = getComputedStyle(spinner);
|
|
393
|
+
return {
|
|
394
|
+
visible: spinner.checkVisibility({visibilityProperty: true}),
|
|
395
|
+
visibility: style.visibility,
|
|
396
|
+
background: style.backgroundColor,
|
|
397
|
+
};
|
|
398
|
+
});
|
|
399
|
+
const idle = await spinnerPaint();
|
|
400
|
+
// The probe theme paints the Spinner's own box, so a box that is only
|
|
401
|
+
// content-skipped would still show beside Clear all.
|
|
402
|
+
expect(idle.background).not.toBe('rgba(0, 0, 0, 0)');
|
|
403
|
+
expect(idle.visibility).toBe('hidden');
|
|
404
|
+
expect(idle.visible).toBe(false);
|
|
405
|
+
await search.focus();
|
|
406
|
+
await search.press('a');
|
|
407
|
+
await expect(search).toHaveAttribute('aria-busy', 'true');
|
|
408
|
+
expect((await spinnerPaint()).visible).toBe(true);
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
test('a themed, larger Spinner keeps its space too', async ({page}) => {
|
|
412
|
+
test.setTimeout(240_000);
|
|
413
|
+
await open(page, 'core-tokenizer--loading', direction);
|
|
414
|
+
// The public size var a theme sets for a named Spinner size.
|
|
415
|
+
await page.addStyleTag({
|
|
416
|
+
content: '.astryx-spinner { --spinner-diameter: 24px !important; }',
|
|
417
|
+
});
|
|
418
|
+
expect(await busyLayoutChanges(page, 8)).toEqual([]);
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
test('a search settling after blur does not change the collapsed row', async ({
|
|
422
|
+
page,
|
|
423
|
+
}) => {
|
|
424
|
+
test.setTimeout(240_000);
|
|
425
|
+
await open(
|
|
426
|
+
page,
|
|
427
|
+
'core-tokenizer--loading',
|
|
428
|
+
direction,
|
|
429
|
+
'tokenOverflowBehavior:unfocusedInline',
|
|
430
|
+
);
|
|
431
|
+
const search = page.getByRole('combobox');
|
|
432
|
+
await search.focus();
|
|
433
|
+
await addTokens(page, ['Bob Smith', 'Charlie Brown', 'Diana Prince']);
|
|
434
|
+
const changed: string[] = [];
|
|
435
|
+
for (let width = 200; width <= 400; width += 8) {
|
|
436
|
+
await search.focus();
|
|
437
|
+
await search.fill('');
|
|
438
|
+
await search.press('a');
|
|
439
|
+
await expect(search).toHaveAttribute('aria-busy', 'true');
|
|
440
|
+
await search.blur();
|
|
441
|
+
const busy = await collapsedRowAt(page, `${width}px`);
|
|
442
|
+
await expect(search).not.toHaveAttribute('aria-busy', 'true');
|
|
443
|
+
const settled = await collapsedRowAt(page, `${width}px`);
|
|
444
|
+
if (busy !== settled) {
|
|
445
|
+
changed.push(`${width}px: busy ${busy}, settled ${settled}`);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
expect(changed).toEqual([]);
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
for (const mode of ['overflow-inline', 'overflow-layer']) {
|
|
452
|
+
test(`${mode}: blurred and focused tokens stay clear of the end lane`, async ({
|
|
453
|
+
page,
|
|
454
|
+
}) => {
|
|
455
|
+
await open(page, `core-powersearch--${mode}`, direction);
|
|
456
|
+
// Blurred: only the inline mode keeps its lane on the page.
|
|
457
|
+
if (mode === 'overflow-inline') {
|
|
458
|
+
expect(await sweep(page, 320, 640)).toEqual([]);
|
|
459
|
+
}
|
|
460
|
+
// The field's own corner, clear of every token: the click a person
|
|
461
|
+
// makes to start typing, which expands both modes.
|
|
462
|
+
await page
|
|
463
|
+
.locator('.astryx-tokenizer')
|
|
464
|
+
.first()
|
|
465
|
+
.click({position: {x: 1, y: 1}});
|
|
466
|
+
await expect(page.getByRole('combobox')).toBeFocused();
|
|
467
|
+
expect(await sweep(page, 320, 640)).toEqual([]);
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}
|
|
@@ -81,8 +81,9 @@ const reserveStyles = stylex.create({
|
|
|
81
81
|
*
|
|
82
82
|
* Takes the lane's inset from the field's inline-end border, as the CSS
|
|
83
83
|
* expression that positions it. Returns a ref callback for the lane, and the
|
|
84
|
-
* ordinary input reserve style. Tokenizer's
|
|
85
|
-
* property directly so
|
|
84
|
+
* ordinary input reserve style. With tokens, Tokenizer's field wrapper reads the
|
|
85
|
+
* same custom property directly so every token row, and the input after the
|
|
86
|
+
* last token, stops before the lane.
|
|
86
87
|
* With no lane mounted the variable is absent and either rule resolves to its
|
|
87
88
|
* no-lane fallback, so neither path needs to know whether a search is running.
|
|
88
89
|
*/
|
|
@@ -23,7 +23,7 @@ export const docs = {
|
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
usage: {
|
|
26
|
-
description: 'Renders content in the accessibility tree while hiding it visually. Use for accessible names on icon-only controls, aria-live announcement regions, and supplementary screen-reader context. Deliberately has no styling props; the whole point is to stay invisible.',
|
|
26
|
+
description: 'Renders content in the accessibility tree while hiding it visually. Use for accessible names on icon-only controls, aria-live announcement regions, and supplementary screen-reader context. Deliberately has no styling props; the whole point is to stay invisible. `xstyle` is still accepted and ignored, only so code written against 0.7.2 keeps compiling; a planned minor removes it.',
|
|
27
27
|
bestPractices: [
|
|
28
28
|
{ guidance: true, description: 'Use to give icon-only buttons and controls an accessible name that screen readers announce.' },
|
|
29
29
|
{ guidance: true, description: 'Render as a block element (as="div") with aria-live to announce dynamic updates like drag-and-drop or result counts.' },
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import {describe, it, expect} from 'vitest';
|
|
13
13
|
import {render, screen} from '@testing-library/react';
|
|
14
14
|
import {createRef} from 'react';
|
|
15
|
+
import * as stylex from '@stylexjs/stylex';
|
|
15
16
|
import {VisuallyHidden} from './VisuallyHidden';
|
|
16
17
|
|
|
17
18
|
describe('VisuallyHidden', () => {
|
|
@@ -64,6 +65,44 @@ describe('VisuallyHidden', () => {
|
|
|
64
65
|
expect(el).toHaveAttribute('role', 'status');
|
|
65
66
|
});
|
|
66
67
|
|
|
68
|
+
it('does not forward the styling props its own contract omits', () => {
|
|
69
|
+
// `className` and `style` are off the interface, and they are reached here
|
|
70
|
+
// through an untyped spread, which is how they get past the `Omit` in
|
|
71
|
+
// practice: a cast, a `{...consumerProps}` object, or plain JavaScript. The
|
|
72
|
+
// type is only the first line of defence here.
|
|
73
|
+
const stylingProps: Record<string, unknown> = {
|
|
74
|
+
xstyle: {color: 'red'},
|
|
75
|
+
className: 'consumer-track',
|
|
76
|
+
style: {position: 'static'},
|
|
77
|
+
};
|
|
78
|
+
render(<VisuallyHidden {...stylingProps}>Hidden</VisuallyHidden>);
|
|
79
|
+
const el = screen.getByText('Hidden');
|
|
80
|
+
|
|
81
|
+
// VisuallyHidden documents itself as styling-free and its clip block as
|
|
82
|
+
// non-overridable, but the implementation spreads leftover props onto the
|
|
83
|
+
// element: `xstyle` reaches the DOM as the literal string "[object Object]",
|
|
84
|
+
// and a cast `style` wins the last-word race for `position`, un-hiding the
|
|
85
|
+
// node (or clipping real content) while keeping the a11y semantics.
|
|
86
|
+
expect(el).not.toHaveAttribute('xstyle');
|
|
87
|
+
expect(el.getAttribute('class') ?? '').not.toContain('consumer-track');
|
|
88
|
+
expect(el.getAttribute('style') ?? '').not.toContain('static');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('still accepts a typed xstyle, and ignores it', () => {
|
|
92
|
+
// Released 0.7.2 accepted `xstyle` through `BaseProps`, so narrowing it out
|
|
93
|
+
// of `VisuallyHiddenProps` would make code that compiles today stop
|
|
94
|
+
// compiling. It stays declared and documented as ignored, and the runtime
|
|
95
|
+
// drop is what keeps the stray attribute off the element. Written as a typed
|
|
96
|
+
// prop on purpose: this line is the tripwire if the interface is ever
|
|
97
|
+
// narrowed early.
|
|
98
|
+
const overrides = stylex.create({tint: {color: 'red'}});
|
|
99
|
+
render(<VisuallyHidden xstyle={overrides.tint}>Hidden</VisuallyHidden>);
|
|
100
|
+
const el = screen.getByText('Hidden');
|
|
101
|
+
|
|
102
|
+
expect(el).not.toHaveAttribute('xstyle');
|
|
103
|
+
expect(el.getAttribute('style') ?? '').not.toContain('color');
|
|
104
|
+
});
|
|
105
|
+
|
|
67
106
|
it('gives an icon-only control an accessible name', () => {
|
|
68
107
|
render(
|
|
69
108
|
<button type="button">
|
|
@@ -16,14 +16,23 @@
|
|
|
16
16
|
|
|
17
17
|
import {createElement, type ElementType, type ReactNode, type Ref} from 'react';
|
|
18
18
|
import type {BaseProps} from '../BaseProps';
|
|
19
|
+
import type {StyleXStyles} from '@stylexjs/stylex';
|
|
19
20
|
import * as stylex from '@stylexjs/stylex';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* VisuallyHidden is deliberately styling-free: it exists to *not* be seen, so it
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* omits `className`/`style` and applies a fixed, non-overridable clip block —
|
|
25
|
+
* styling a visually-hidden node is always a mistake. The accessibility
|
|
26
|
+
* pass-throughs from `BaseProps` (`aria-*`, `role`, `id`, `data-*`, event
|
|
27
|
+
* handlers) remain, since the live-region use case needs them.
|
|
28
|
+
*
|
|
29
|
+
* `xstyle` stays declared and documented as ignored, because released 0.7.2
|
|
30
|
+
* accepted it through `BaseProps`: narrowing the interface would force every
|
|
31
|
+
* consumer to edit code, which is a `[breaking]` change for a planned minor
|
|
32
|
+
* (`spec:AST-017/FR53`). It carries no `@deprecated` marker either — under
|
|
33
|
+
* `spec:AST-017/FR28` a patch may only deprecate a surface it ships an exact
|
|
34
|
+
* migration for, and this fix ships none. Dropping the prop from the interface,
|
|
35
|
+
* with the migration being to delete it, belongs to a planned minor.
|
|
27
36
|
*/
|
|
28
37
|
export interface VisuallyHiddenProps extends Omit<
|
|
29
38
|
BaseProps<HTMLElement>,
|
|
@@ -44,6 +53,16 @@ export interface VisuallyHiddenProps extends Omit<
|
|
|
44
53
|
* @default 'span'
|
|
45
54
|
*/
|
|
46
55
|
as?: ElementType;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Ignored: VisuallyHidden has no styling surface. The clip block is the only
|
|
59
|
+
* style applied, and nothing a caller passes can displace it.
|
|
60
|
+
*
|
|
61
|
+
* Accepted only so that code written against 0.7.2 keeps compiling. It is not
|
|
62
|
+
* applied to the element, and a planned minor removes it — the migration is to
|
|
63
|
+
* delete the prop.
|
|
64
|
+
*/
|
|
65
|
+
xstyle?: StyleXStyles;
|
|
47
66
|
}
|
|
48
67
|
|
|
49
68
|
const styles = stylex.create({
|
|
@@ -90,8 +109,22 @@ export function VisuallyHidden({
|
|
|
90
109
|
children,
|
|
91
110
|
as: element = 'span',
|
|
92
111
|
ref,
|
|
93
|
-
...
|
|
112
|
+
...rest
|
|
94
113
|
}: VisuallyHiddenProps) {
|
|
114
|
+
// `className` and `style` are off the interface, and the ignored `xstyle`
|
|
115
|
+
// is off by intent. Take all three back off at runtime so a cast cannot reach
|
|
116
|
+
// the element either: `xstyle` is not a valid attribute, so spreading it writes
|
|
117
|
+
// xstyle="[object Object]" into the DOM, and a cast `style` keeps the last word
|
|
118
|
+
// on `position` and un-hides the node.
|
|
119
|
+
const {
|
|
120
|
+
xstyle: _xstyle,
|
|
121
|
+
className: _className,
|
|
122
|
+
style: _style,
|
|
123
|
+
...props
|
|
124
|
+
} = rest as typeof rest & {
|
|
125
|
+
className?: unknown;
|
|
126
|
+
style?: unknown;
|
|
127
|
+
};
|
|
95
128
|
return createElement(
|
|
96
129
|
element,
|
|
97
130
|
{
|