@astryxdesign/core 0.7.4 → 0.7.5-canary.04434e7
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/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +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 +12 -7
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +13 -5
- 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/Layer/useTouchTrigger.d.ts +14 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +72 -17
- 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 +8 -8
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +46 -20
- 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/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +12 -3
- 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 +27 -17
- 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 +8 -16
- 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/DateInput/DateInputTouch.test.tsx +9 -0
- package/src/DateInput/Wheel.tsx +4 -1
- package/src/DateInput/__tests__/WheelPinchZoom.a11y.chromium.spec.ts +158 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +5 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.spec.md +226 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +32 -16
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +158 -0
- package/src/DropdownMenu/__tests__/DropdownMenuRadioItemAudit.a11y.chromium.spec.ts +539 -0
- package/src/Field/inputDisabledFocus.ts +28 -0
- package/src/HoverCard/HoverCard.test.tsx +93 -3
- package/src/Icon/Icon.spec.md +40 -29
- package/src/Layer/__tests__/TouchTrigger.a11y.chromium.spec.ts +199 -0
- package/src/Layer/modalOutlet.ts +1 -1
- package/src/Layer/useTouchTrigger.ts +95 -41
- package/src/NumberInput/NumberInput.doc.mjs +6 -6
- package/src/NumberInput/NumberInput.test.tsx +144 -14
- package/src/NumberInput/NumberInput.tsx +68 -21
- package/src/Pagination/Pagination.test.tsx +2 -2
- package/src/SideNav/SideNav.test.tsx +15 -6
- package/src/SideNav/SideNavHeading.tsx +41 -0
- package/src/Skeleton/Skeleton.test.tsx +108 -1
- package/src/Skeleton/Skeleton.tsx +30 -2
- 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 +83 -10
- package/src/TextInput/TextInput.tsx +38 -19
- 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/Tooltip/Tooltip.test.tsx +148 -3
- package/src/Tooltip/__tests__/Tooltip.a11y.states.ts +2 -2
- package/src/VisuallyHidden/VisuallyHidden.doc.mjs +1 -1
- package/src/VisuallyHidden/VisuallyHidden.test.tsx +39 -0
- package/src/VisuallyHidden/VisuallyHidden.tsx +38 -5
- package/src/theme/tokens.test.ts +60 -0
|
@@ -113,6 +113,7 @@ import {
|
|
|
113
113
|
type FieldInputBaseProps,
|
|
114
114
|
useFieldInputStyling,
|
|
115
115
|
} from '../Field/fieldParts';
|
|
116
|
+
import {inputDisabledFocusStyles} from '../Field/inputDisabledFocus';
|
|
116
117
|
import type {SizeValue} from '../utils/types';
|
|
117
118
|
import {themeProps} from '../utils/themeProps';
|
|
118
119
|
import {useTranslator} from '../i18n';
|
|
@@ -156,7 +157,9 @@ export interface TextInputProps extends Omit<
|
|
|
156
157
|
*/
|
|
157
158
|
isRequired?: boolean;
|
|
158
159
|
/**
|
|
159
|
-
* Whether the input is disabled.
|
|
160
|
+
* Whether the input is disabled. A disabled input is dimmed, cannot be
|
|
161
|
+
* edited, and is left out of form submission, but it stays in the tab order
|
|
162
|
+
* (`aria-disabled`, not the native attribute).
|
|
160
163
|
* @default false
|
|
161
164
|
*/
|
|
162
165
|
isDisabled?: boolean;
|
|
@@ -164,7 +167,7 @@ export interface TextInputProps extends Omit<
|
|
|
164
167
|
* Whether the input is read-only.
|
|
165
168
|
* The value is shown at full opacity and still submits with the form, but
|
|
166
169
|
* cannot be edited. Unlike `isDisabled`, a read-only input is not dimmed and
|
|
167
|
-
*
|
|
170
|
+
* keeps its form value — use it for a value the user should see and send
|
|
168
171
|
* but not change. `isDisabled` takes precedence when both are set.
|
|
169
172
|
* @default false
|
|
170
173
|
*/
|
|
@@ -176,8 +179,8 @@ export interface TextInputProps extends Omit<
|
|
|
176
179
|
* keyboard and assistive technology. The field cannot be edited (it becomes
|
|
177
180
|
* read-only) while disabled.
|
|
178
181
|
*
|
|
179
|
-
* Use this instead of wrapping a disabled input in `Tooltip
|
|
180
|
-
*
|
|
182
|
+
* Use this instead of wrapping a disabled input in `Tooltip`, so the reason
|
|
183
|
+
* is attached to the field itself.
|
|
181
184
|
*
|
|
182
185
|
* @example
|
|
183
186
|
* ```
|
|
@@ -331,6 +334,15 @@ export function TextInput({
|
|
|
331
334
|
});
|
|
332
335
|
const t = useTranslator();
|
|
333
336
|
const isEffectivelyRequired = useResolvedRequired({isRequired, isOptional});
|
|
337
|
+
// A disabled field keeps its tab stop but, like a natively disabled one,
|
|
338
|
+
// runs no caller event handler other than focus and blur (`spec:AST-085` FR2).
|
|
339
|
+
const fieldProps = isDisabled
|
|
340
|
+
? Object.fromEntries(
|
|
341
|
+
Object.entries(rest).filter(
|
|
342
|
+
([key]) => !/^on[A-Z]/.test(key) || /^on(Focus|Blur)/.test(key),
|
|
343
|
+
),
|
|
344
|
+
)
|
|
345
|
+
: rest;
|
|
334
346
|
const size = useSize(sizeProp, 'md');
|
|
335
347
|
|
|
336
348
|
const generatedID = useId();
|
|
@@ -349,8 +361,7 @@ export function TextInput({
|
|
|
349
361
|
// (spec:AST-086 FR8).
|
|
350
362
|
useBusyAnnouncement(isBusy, t('@astryx.spinner.loading'), containerRef);
|
|
351
363
|
|
|
352
|
-
// Disabled-reason tooltip.
|
|
353
|
-
// tooltip listeners attach to the input container (which already exists) and
|
|
364
|
+
// Disabled-reason tooltip. The tooltip listeners attach to the input container (which already exists) and
|
|
354
365
|
// the input stays perceivable via aria-disabled instead of the native
|
|
355
366
|
// disabled attribute. The field is made read-only so it can't be typed into,
|
|
356
367
|
// and value mutation is blocked by the isDisabled guard in handleChange.
|
|
@@ -411,11 +422,12 @@ export function TextInput({
|
|
|
411
422
|
if (!e || e.detail === 0) {
|
|
412
423
|
inputRef.current?.focus();
|
|
413
424
|
} else {
|
|
414
|
-
//
|
|
415
|
-
//
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
425
|
+
// Focus inside the tap: iOS Safari brings up its keyboard only for a
|
|
426
|
+
// focus made while handling the touch, so a field the tap reaches
|
|
427
|
+
// unfocused gets its keyboard, as UIKit's clear button makes the
|
|
428
|
+
// field first responder. `preventScroll` keeps a scrolled page where
|
|
429
|
+
// it is.
|
|
430
|
+
inputRef.current?.focus({preventScroll: true});
|
|
419
431
|
}
|
|
420
432
|
},
|
|
421
433
|
[onChange],
|
|
@@ -451,6 +463,7 @@ export function TextInput({
|
|
|
451
463
|
inputWrapperStyles.base,
|
|
452
464
|
sizeStyles[size],
|
|
453
465
|
isDisabled && inputWrapperStyles.disabled,
|
|
466
|
+
isDisabled && inputDisabledFocusStyles.ring,
|
|
454
467
|
status && inputStatusBorderStyles[status.type],
|
|
455
468
|
status && !isDisabled && inputStatusHoverShadowStyles[status.type],
|
|
456
469
|
status && inputStatusFocusWithinStyles[status.type],
|
|
@@ -463,7 +476,7 @@ export function TextInput({
|
|
|
463
476
|
{startIcon && renderIconSlot(startIcon, {size: 'sm', color: 'secondary'})}
|
|
464
477
|
{inputGroup && <VisuallyHidden id={inputLabelID}>{label}</VisuallyHidden>}
|
|
465
478
|
<input
|
|
466
|
-
{...
|
|
479
|
+
{...fieldProps}
|
|
467
480
|
ref={useMergedRefs(ref, inputRef)}
|
|
468
481
|
id={id}
|
|
469
482
|
name={isDisabled ? undefined : htmlName}
|
|
@@ -471,8 +484,15 @@ export function TextInput({
|
|
|
471
484
|
value={optimisticValue}
|
|
472
485
|
onChange={handleChange}
|
|
473
486
|
onKeyDown={
|
|
474
|
-
onEnter || onKeyDown
|
|
487
|
+
isDisabled || onEnter || onKeyDown
|
|
475
488
|
? e => {
|
|
489
|
+
if (isDisabled) {
|
|
490
|
+
// A read-only field still submits its form on Enter.
|
|
491
|
+
if (e.key === 'Enter') {
|
|
492
|
+
e.preventDefault();
|
|
493
|
+
}
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
476
496
|
// The composing keydown fires before compositionend, so without
|
|
477
497
|
// this guard pressing Enter to commit a Japanese/Chinese/Korean
|
|
478
498
|
// IME conversion would trigger onEnter (submit/save actions)
|
|
@@ -486,12 +506,11 @@ export function TextInput({
|
|
|
486
506
|
: undefined
|
|
487
507
|
}
|
|
488
508
|
placeholder={placeholder}
|
|
489
|
-
//
|
|
490
|
-
//
|
|
491
|
-
//
|
|
492
|
-
disabled={isDisabled
|
|
493
|
-
|
|
494
|
-
readOnly={isReadOnly || showsDisabledMessage || undefined}
|
|
509
|
+
// A disabled input keeps its place in the tab order (spec:AST-085):
|
|
510
|
+
// aria-disabled instead of the native attribute, with readOnly + the
|
|
511
|
+
// handleChange guard keeping the value from changing.
|
|
512
|
+
aria-disabled={isDisabled ? 'true' : undefined}
|
|
513
|
+
readOnly={isReadOnly || isDisabled || undefined}
|
|
495
514
|
autoFocus={hasAutoFocus}
|
|
496
515
|
data-autofocus={hasAutoFocus || undefined}
|
|
497
516
|
aria-describedby={
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file ToastViewport.modalHost.test.tsx
|
|
5
|
-
* @input Uses vitest, @testing-library/react, ToastViewport, useToast, Dialog
|
|
5
|
+
* @input Uses vitest, @testing-library/react, ToastViewport, useToast, Dialog,
|
|
6
|
+
* BottomSheet
|
|
6
7
|
* @output Tests that a top-layer ToastViewport moves into the latest open
|
|
7
|
-
* native modal and back without remounting
|
|
8
|
+
* native modal (a Dialog or a scrim BottomSheet) and back without remounting
|
|
9
|
+
* its toasts
|
|
8
10
|
* @position Testing; validates ToastViewport.tsx with Layer/modalOutlet.ts
|
|
9
11
|
*
|
|
10
12
|
* SYNC: When ToastViewport hosting or Layer/modalOutlet.ts changes, update
|
|
11
13
|
* these tests. jsdom has no top layer: paint order and hit testing above the
|
|
12
|
-
* modal need a real browser (see the Core/Toast AppToastOverDialog story
|
|
14
|
+
* modal need a real browser (see the Core/Toast AppToastOverDialog story and
|
|
15
|
+
* BottomSheet/__tests__/BottomSheetToastOutlet.a11y.chromium.spec.ts).
|
|
13
16
|
*/
|
|
14
17
|
|
|
15
18
|
import {useState, type ReactNode} from 'react';
|
|
@@ -17,16 +20,20 @@ import {describe, it, expect, vi, afterEach, beforeEach} from 'vitest';
|
|
|
17
20
|
import {act, fireEvent, render, screen} from '@testing-library/react';
|
|
18
21
|
import {ToastViewport} from './ToastViewport';
|
|
19
22
|
import {useToast} from './useToast';
|
|
23
|
+
import {BottomSheet} from '../BottomSheet';
|
|
20
24
|
import {Dialog} from '../Dialog';
|
|
21
25
|
import type {ToastDismissReason} from './types';
|
|
22
26
|
|
|
23
|
-
// jsdom does not implement the native
|
|
27
|
+
// jsdom does not implement the native dialog methods.
|
|
24
28
|
beforeEach(() => {
|
|
25
29
|
HTMLDialogElement.prototype.showModal = vi.fn(function (
|
|
26
30
|
this: HTMLDialogElement,
|
|
27
31
|
) {
|
|
28
32
|
this.setAttribute('open', '');
|
|
29
33
|
});
|
|
34
|
+
HTMLDialogElement.prototype.show = vi.fn(function (this: HTMLDialogElement) {
|
|
35
|
+
this.setAttribute('open', '');
|
|
36
|
+
});
|
|
30
37
|
HTMLDialogElement.prototype.close = vi.fn(function (this: HTMLDialogElement) {
|
|
31
38
|
this.removeAttribute('open');
|
|
32
39
|
});
|
|
@@ -78,6 +85,19 @@ function getViewport(): HTMLElement {
|
|
|
78
85
|
return document.querySelector<HTMLElement>('[popover="manual"]')!;
|
|
79
86
|
}
|
|
80
87
|
|
|
88
|
+
/** Call order of `fn`'s latest call on `context`, or -1 if it has none. */
|
|
89
|
+
function lastCallOrder(
|
|
90
|
+
fn: {mock: {contexts: unknown[]; invocationCallOrder: number[]}},
|
|
91
|
+
context: unknown,
|
|
92
|
+
): number {
|
|
93
|
+
return Math.max(
|
|
94
|
+
-1,
|
|
95
|
+
...fn.mock.invocationCallOrder.filter(
|
|
96
|
+
(_, index) => fn.mock.contexts[index] === context,
|
|
97
|
+
),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
81
101
|
function TimedToastButton({
|
|
82
102
|
onHide,
|
|
83
103
|
}: {
|
|
@@ -109,6 +129,26 @@ function UnmountFixture() {
|
|
|
109
129
|
);
|
|
110
130
|
}
|
|
111
131
|
|
|
132
|
+
function SheetFixture({label, hasScrim}: {label: string; hasScrim?: boolean}) {
|
|
133
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
134
|
+
return (
|
|
135
|
+
<>
|
|
136
|
+
<button type="button" onClick={() => setIsOpen(true)}>
|
|
137
|
+
{`Open ${label}`}
|
|
138
|
+
</button>
|
|
139
|
+
<BottomSheet
|
|
140
|
+
isOpen={isOpen}
|
|
141
|
+
onOpenChange={setIsOpen}
|
|
142
|
+
label={label}
|
|
143
|
+
hasScrim={hasScrim}>
|
|
144
|
+
<button type="button" onClick={() => setIsOpen(false)}>
|
|
145
|
+
{`Close ${label}`}
|
|
146
|
+
</button>
|
|
147
|
+
</BottomSheet>
|
|
148
|
+
</>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
112
152
|
describe('ToastViewport modal hosting', () => {
|
|
113
153
|
it('moves into an open Dialog and back when it closes, keeping the toast', () => {
|
|
114
154
|
const {container} = render(
|
|
@@ -264,3 +304,98 @@ describe('ToastViewport modal hosting', () => {
|
|
|
264
304
|
expect(container.contains(viewport)).toBe(true);
|
|
265
305
|
});
|
|
266
306
|
});
|
|
307
|
+
|
|
308
|
+
describe('ToastViewport above a BottomSheet', () => {
|
|
309
|
+
beforeEach(() => {
|
|
310
|
+
// Closing the sheet releases its scroll lock, which restores the scroll
|
|
311
|
+
// position; jsdom does not implement scrolling.
|
|
312
|
+
vi.spyOn(window, 'scrollTo').mockImplementation(() => {});
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
it('moves into an open scrim sheet and back to its place when it closes', () => {
|
|
316
|
+
const {container} = render(
|
|
317
|
+
<ToastViewport>
|
|
318
|
+
<ToastButton />
|
|
319
|
+
<SheetFixture label="Filters" />
|
|
320
|
+
</ToastViewport>,
|
|
321
|
+
);
|
|
322
|
+
fireEvent.click(screen.getByRole('button', {name: 'Show toast'}));
|
|
323
|
+
const toast = screen.getByText('Saved');
|
|
324
|
+
|
|
325
|
+
fireEvent.click(screen.getByRole('button', {name: 'Open Filters'}));
|
|
326
|
+
expect(getViewport().closest('dialog')).toBe(getDialog('Filters'));
|
|
327
|
+
expect(screen.getByText('Saved')).toBe(toast);
|
|
328
|
+
|
|
329
|
+
fireEvent.click(screen.getByRole('button', {name: 'Close Filters'}));
|
|
330
|
+
expect(getViewport().closest('dialog')).toBeNull();
|
|
331
|
+
expect(container.contains(getViewport())).toBe(true);
|
|
332
|
+
expect(screen.getByText('Saved')).toBe(toast);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it('follows a sheet opened over a Dialog, above it in the top layer', () => {
|
|
336
|
+
const showPopover = vi.spyOn(HTMLElement.prototype, 'showPopover');
|
|
337
|
+
render(
|
|
338
|
+
<ToastViewport>
|
|
339
|
+
<DialogFixture label="Edit">
|
|
340
|
+
<SheetFixture label="Filters" />
|
|
341
|
+
</DialogFixture>
|
|
342
|
+
</ToastViewport>,
|
|
343
|
+
);
|
|
344
|
+
const viewport = getViewport();
|
|
345
|
+
const showsOnViewport = () =>
|
|
346
|
+
showPopover.mock.contexts.filter(context => context === viewport).length;
|
|
347
|
+
|
|
348
|
+
fireEvent.click(screen.getByRole('button', {name: 'Toggle Edit'}));
|
|
349
|
+
expect(viewport.closest('dialog')).toBe(getDialog('Edit'));
|
|
350
|
+
const showsInDialog = showsOnViewport();
|
|
351
|
+
|
|
352
|
+
fireEvent.click(screen.getByRole('button', {name: 'Open Filters'}));
|
|
353
|
+
// The sheet's modal makes everything outside it inert, the Dialog
|
|
354
|
+
// included, so the viewport has to be inside the sheet.
|
|
355
|
+
expect(viewport.closest('dialog')).toBe(getDialog('Filters'));
|
|
356
|
+
expect(viewport.closest('[inert]')).toBeNull();
|
|
357
|
+
// Shown again once the sheet is in the top layer, so it paints above it.
|
|
358
|
+
expect(showsOnViewport()).toBe(showsInDialog + 1);
|
|
359
|
+
expect(lastCallOrder(showPopover, viewport)).toBeGreaterThan(
|
|
360
|
+
lastCallOrder(
|
|
361
|
+
vi.mocked(HTMLDialogElement.prototype.showModal),
|
|
362
|
+
getDialog('Filters'),
|
|
363
|
+
),
|
|
364
|
+
);
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
it('returns to the Dialog as soon as the sheet starts closing', () => {
|
|
368
|
+
render(
|
|
369
|
+
<ToastViewport>
|
|
370
|
+
<DialogFixture label="Edit">
|
|
371
|
+
<SheetFixture label="Filters" />
|
|
372
|
+
</DialogFixture>
|
|
373
|
+
</ToastViewport>,
|
|
374
|
+
);
|
|
375
|
+
fireEvent.click(screen.getByRole('button', {name: 'Toggle Edit'}));
|
|
376
|
+
fireEvent.click(screen.getByRole('button', {name: 'Open Filters'}));
|
|
377
|
+
const viewport = getViewport();
|
|
378
|
+
expect(viewport.closest('dialog')).toBe(getDialog('Filters'));
|
|
379
|
+
|
|
380
|
+
fireEvent.click(screen.getByRole('button', {name: 'Close Filters'}));
|
|
381
|
+
// The sheet stays an open modal through its exit animation, but inert and
|
|
382
|
+
// hidden; toasts must not go down with it.
|
|
383
|
+
expect(getDialog('Filters')).toHaveAttribute('open');
|
|
384
|
+
expect(getDialog('Filters')).toHaveAttribute('inert');
|
|
385
|
+
expect(viewport.closest('dialog')).toBe(getDialog('Edit'));
|
|
386
|
+
expect(viewport.closest('[inert], [aria-hidden="true"]')).toBeNull();
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
it('stays in place when a sheet without a scrim opens', () => {
|
|
390
|
+
const {container} = render(
|
|
391
|
+
<ToastViewport>
|
|
392
|
+
<SheetFixture label="Filters" hasScrim={false} />
|
|
393
|
+
</ToastViewport>,
|
|
394
|
+
);
|
|
395
|
+
fireEvent.click(screen.getByRole('button', {name: 'Open Filters'}));
|
|
396
|
+
// A non-modal sheet leaves the page operable, so the viewport stays put.
|
|
397
|
+
expect(getDialog('Filters')).toHaveAttribute('open');
|
|
398
|
+
expect(getViewport().closest('dialog')).toBeNull();
|
|
399
|
+
expect(container.contains(getViewport())).toBe(true);
|
|
400
|
+
});
|
|
401
|
+
});
|
|
@@ -1692,6 +1692,27 @@ describe('Tokenizer end-lane reserve', () => {
|
|
|
1692
1692
|
);
|
|
1693
1693
|
});
|
|
1694
1694
|
|
|
1695
|
+
it('keeps token rows, not only the input, short of the lane', () => {
|
|
1696
|
+
// The lane is out of flow, so a token reaching the end of the first row
|
|
1697
|
+
// ran under the clear button. The field's own inline-end padding spends
|
|
1698
|
+
// the reserve, and every row of tokens wraps inside it. Real geometry is
|
|
1699
|
+
// proved in TokenizerEndLane.a11y.chromium.spec.ts.
|
|
1700
|
+
const {container} = render(
|
|
1701
|
+
<Tokenizer
|
|
1702
|
+
label="Users"
|
|
1703
|
+
searchSource={userSource}
|
|
1704
|
+
value={[users[0]]}
|
|
1705
|
+
onChange={() => {}}
|
|
1706
|
+
hasClear
|
|
1707
|
+
/>,
|
|
1708
|
+
);
|
|
1709
|
+
const field = laneHost(container);
|
|
1710
|
+
expect(field).not.toBeNull();
|
|
1711
|
+
expect(getComputedStyle(field!).paddingInlineEnd).toContain(
|
|
1712
|
+
'--_tokenizer-end-lane-reserve',
|
|
1713
|
+
);
|
|
1714
|
+
});
|
|
1715
|
+
|
|
1695
1716
|
it('does not pad the input on the collapsed paths', () => {
|
|
1696
1717
|
// Collapsed: with tokens truncated the input is given no width to pad —
|
|
1697
1718
|
// `inputAtMax` zeroes its padding outright — so a reserve there would be
|
|
@@ -1707,16 +1728,13 @@ describe('Tokenizer end-lane reserve', () => {
|
|
|
1707
1728
|
tokenOverflowBehavior="unfocusedInline"
|
|
1708
1729
|
/>,
|
|
1709
1730
|
);
|
|
1731
|
+
// The collapsed row keeps the Spinner's slot, so the lane is up and
|
|
1732
|
+
// publishing; the input still must not spend the reserve.
|
|
1733
|
+
expect(reserveOf(container)).toBeTruthy();
|
|
1710
1734
|
const input = screen.getByRole('combobox');
|
|
1711
|
-
expect(input.
|
|
1712
|
-
|
|
1713
|
-
// collapsed input must not carry it.
|
|
1714
|
-
const reserveClasses = new Set(
|
|
1715
|
-
(laneHost(container)?.className ?? '').split(' '),
|
|
1735
|
+
expect(getComputedStyle(input).paddingInlineEnd).not.toContain(
|
|
1736
|
+
'--_tokenizer-end-lane-reserve',
|
|
1716
1737
|
);
|
|
1717
|
-
expect(
|
|
1718
|
-
[...input.classList].some(c => reserveClasses.has(c) && c !== ''),
|
|
1719
|
-
).toBe(false);
|
|
1720
1738
|
});
|
|
1721
1739
|
|
|
1722
1740
|
it('costs no commit of its own across a whole search', async () => {
|
|
@@ -272,11 +272,8 @@ export interface TokenizerProps<T extends SearchableItem> extends Omit<
|
|
|
272
272
|
// because the input's reserve is derived from the same value.
|
|
273
273
|
const END_LANE_INSET = spacingVars['--spacing-2'];
|
|
274
274
|
const TOKEN_ROW_INSET = `calc(${spacingVars['--spacing-1']} - 1px)`;
|
|
275
|
-
//
|
|
276
|
-
//
|
|
277
|
-
const INPUT_CLEAR_COARSE_POINTER_OUTSET = '2px';
|
|
278
|
-
// Kept in sync with useEndLaneReserve: inputCompact reads the custom property
|
|
279
|
-
// directly so its empty-query pseudo-class can suppress the inner reserve.
|
|
275
|
+
// Kept in sync with useEndLaneReserve: wrapperWithTokens reads the custom
|
|
276
|
+
// property directly, to keep token rows and the input short of the lane.
|
|
280
277
|
const END_LANE_RESERVE_VAR = '--_tokenizer-end-lane-reserve';
|
|
281
278
|
|
|
282
279
|
const styles = stylex.create({
|
|
@@ -297,6 +294,10 @@ const styles = stylex.create({
|
|
|
297
294
|
// = 8 - 4 - 1 = 3px.
|
|
298
295
|
paddingBlock: TOKEN_ROW_INSET,
|
|
299
296
|
paddingInline: TOKEN_ROW_INSET,
|
|
297
|
+
// The end lane is out of flow, so tokens would wrap under it. Every row
|
|
298
|
+
// stops short of the measured lane instead; with no lane up the variable
|
|
299
|
+
// is absent and this is the ordinary inset.
|
|
300
|
+
paddingInlineEnd: `calc(${TOKEN_ROW_INSET} + var(${END_LANE_RESERVE_VAR}, 0px))`,
|
|
300
301
|
// Row gap must match paddingBlock so wrapped rows look evenly spaced.
|
|
301
302
|
rowGap: TOKEN_ROW_INSET,
|
|
302
303
|
},
|
|
@@ -310,6 +311,9 @@ const styles = stylex.create({
|
|
|
310
311
|
token: {
|
|
311
312
|
display: 'flex',
|
|
312
313
|
flexShrink: 0,
|
|
314
|
+
// A renderToken wrapper sizes to its content; cap it at the row so the
|
|
315
|
+
// pill inside truncates instead of running past the field.
|
|
316
|
+
maxWidth: '100%',
|
|
313
317
|
position: 'relative',
|
|
314
318
|
zIndex: 1,
|
|
315
319
|
},
|
|
@@ -325,6 +329,14 @@ const styles = stylex.create({
|
|
|
325
329
|
flexShrink: 0,
|
|
326
330
|
zIndex: 1,
|
|
327
331
|
},
|
|
332
|
+
idleSpinner: {
|
|
333
|
+
// Hides the Spinner's own box too, which a theme may paint, and covers
|
|
334
|
+
// engines without content-visibility. Both keep the box's size.
|
|
335
|
+
visibility: 'hidden',
|
|
336
|
+
// Skips the ring's rendering, and with it the infinite arc animation,
|
|
337
|
+
// while the root keeps its own explicit, themed width and height.
|
|
338
|
+
contentVisibility: 'hidden',
|
|
339
|
+
},
|
|
328
340
|
inputAtMax: {
|
|
329
341
|
width: 0,
|
|
330
342
|
minWidth: 0,
|
|
@@ -334,46 +346,36 @@ const styles = stylex.create({
|
|
|
334
346
|
position: 'absolute',
|
|
335
347
|
},
|
|
336
348
|
inputCompact: {
|
|
337
|
-
position:
|
|
338
|
-
default: 'relative',
|
|
339
|
-
':placeholder-shown': 'absolute',
|
|
340
|
-
},
|
|
349
|
+
position: 'relative',
|
|
341
350
|
boxSizing: 'border-box',
|
|
342
|
-
insetInlineStart: {
|
|
343
|
-
default: 'auto',
|
|
344
|
-
':placeholder-shown': TOKEN_ROW_INSET,
|
|
345
|
-
},
|
|
346
351
|
zIndex: 0,
|
|
352
|
+
// The input follows the last token in flow, so a focused empty input's
|
|
353
|
+
// caret sits where typed text will start. Empty, it asks only for that
|
|
354
|
+
// inset, and only while focused and editable: blurred or read-only (a
|
|
355
|
+
// disabled field with a disabledMessage stays focusable), it claims no
|
|
356
|
+
// room at all, not even the column gap, so it never grows the field a
|
|
357
|
+
// blank row. Typing restores the full editing width, which may wrap.
|
|
347
358
|
minWidth: {
|
|
348
359
|
default: '40px',
|
|
349
|
-
':placeholder-shown':
|
|
360
|
+
':placeholder-shown': 0,
|
|
350
361
|
},
|
|
351
362
|
flex: {
|
|
352
363
|
default: '1 1 40px',
|
|
353
|
-
':placeholder-shown': '
|
|
364
|
+
':placeholder-shown': '1 1 0px',
|
|
354
365
|
},
|
|
355
|
-
width:
|
|
366
|
+
width: 0,
|
|
367
|
+
marginInlineStart: {
|
|
356
368
|
default: 0,
|
|
357
|
-
':placeholder-shown': `calc(
|
|
369
|
+
':placeholder-shown:is(:not(:focus), :read-only)': `calc(-1 * ${spacingVars['--spacing-1']})`,
|
|
358
370
|
},
|
|
359
|
-
//
|
|
360
|
-
//
|
|
361
|
-
// with the pills for width. Logical insets stop it before the measured end
|
|
362
|
-
// lane plus InputClearButton's maximum invisible pointer outset; tokens and
|
|
363
|
-
// controls sit above it, leaving only genuine whitespace clickable as
|
|
364
|
-
// search. Typing restores the ordinary in-flow input.
|
|
371
|
+
// Restore normal text inset when input follows tokens, since the
|
|
372
|
+
// wrapper padding is reduced for border concentricity.
|
|
365
373
|
paddingInlineStart: {
|
|
366
374
|
default: `calc(${spacingVars['--spacing-2']} - ${spacingVars['--spacing-1']} + 1px)`,
|
|
367
|
-
':placeholder-shown': 0,
|
|
368
|
-
},
|
|
369
|
-
paddingInlineEnd: {
|
|
370
|
-
default: `var(${END_LANE_RESERVE_VAR}, 0px)`,
|
|
371
|
-
':placeholder-shown': spacingVars['--spacing-1'],
|
|
372
|
-
},
|
|
373
|
-
textAlign: {
|
|
374
|
-
default: 'start',
|
|
375
|
-
':placeholder-shown': 'end',
|
|
375
|
+
':placeholder-shown:is(:not(:focus), :read-only)': 0,
|
|
376
376
|
},
|
|
377
|
+
// wrapperWithTokens already keeps the in-flow input short of the lane.
|
|
378
|
+
paddingInlineEnd: 0,
|
|
377
379
|
},
|
|
378
380
|
truncatedWrapper: {
|
|
379
381
|
flexWrap: 'nowrap',
|
|
@@ -415,39 +417,6 @@ const endSectionSizeStyles = stylex.create({
|
|
|
415
417
|
},
|
|
416
418
|
});
|
|
417
419
|
|
|
418
|
-
const compactInputSizeStyles = stylex.create({
|
|
419
|
-
sm: {
|
|
420
|
-
insetBlockStart: {
|
|
421
|
-
default: 'auto',
|
|
422
|
-
':placeholder-shown': `calc(${sizeVars['--size-element-sm']} / 2 - 1px)`,
|
|
423
|
-
},
|
|
424
|
-
transform: {
|
|
425
|
-
default: 'none',
|
|
426
|
-
':placeholder-shown': 'translateY(-50%)',
|
|
427
|
-
},
|
|
428
|
-
},
|
|
429
|
-
md: {
|
|
430
|
-
insetBlockStart: {
|
|
431
|
-
default: 'auto',
|
|
432
|
-
':placeholder-shown': `calc(${sizeVars['--size-element-md']} / 2 - 1px)`,
|
|
433
|
-
},
|
|
434
|
-
transform: {
|
|
435
|
-
default: 'none',
|
|
436
|
-
':placeholder-shown': 'translateY(-50%)',
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
lg: {
|
|
440
|
-
insetBlockStart: {
|
|
441
|
-
default: 'auto',
|
|
442
|
-
':placeholder-shown': `calc(${sizeVars['--size-element-lg']} / 2 - 1px)`,
|
|
443
|
-
},
|
|
444
|
-
transform: {
|
|
445
|
-
default: 'none',
|
|
446
|
-
':placeholder-shown': 'translateY(-50%)',
|
|
447
|
-
},
|
|
448
|
-
},
|
|
449
|
-
});
|
|
450
|
-
|
|
451
420
|
const truncatedSizeStyles = stylex.create({
|
|
452
421
|
sm: {height: sizeVars['--size-element-sm']},
|
|
453
422
|
md: {height: sizeVars['--size-element-md']},
|
|
@@ -517,6 +486,13 @@ const CREATABLE_ID_PREFIX = '__xds_create__';
|
|
|
517
486
|
*
|
|
518
487
|
* Renders nothing when the lane would be empty, so `useEndLaneReserve` sees no
|
|
519
488
|
* element, publishes no width, and the input keeps its full content box.
|
|
489
|
+
*
|
|
490
|
+
* With `hasBusySlot` the Spinner stays mounted while idle, unrendered, not
|
|
491
|
+
* animating and out of the accessibility tree, so its box keeps the themed
|
|
492
|
+
* Spinner's own size.
|
|
493
|
+
* Token rows reserve the lane's measured width, so a Spinner that came and
|
|
494
|
+
* went with the search would re-wrap them, and widen a content-sized field,
|
|
495
|
+
* on every search.
|
|
520
496
|
*/
|
|
521
497
|
function EndLane({
|
|
522
498
|
lane,
|
|
@@ -525,6 +501,7 @@ function EndLane({
|
|
|
525
501
|
loadingLabel,
|
|
526
502
|
anchorRef,
|
|
527
503
|
hasStaticContent,
|
|
504
|
+
hasBusySlot,
|
|
528
505
|
children,
|
|
529
506
|
}: {
|
|
530
507
|
lane: BusyIndicatorLane;
|
|
@@ -533,6 +510,7 @@ function EndLane({
|
|
|
533
510
|
loadingLabel: string;
|
|
534
511
|
anchorRef: RefObject<Element | null>;
|
|
535
512
|
hasStaticContent: boolean;
|
|
513
|
+
hasBusySlot: boolean;
|
|
536
514
|
children: ReactNode;
|
|
537
515
|
}) {
|
|
538
516
|
const isBusy = useIsBusy(lane);
|
|
@@ -540,12 +518,23 @@ function EndLane({
|
|
|
540
518
|
// live region; the field announces each search's busy start instead
|
|
541
519
|
// (spec:AST-086 FR8).
|
|
542
520
|
useBusyAnnouncement(isBusy, loadingLabel, anchorRef);
|
|
543
|
-
if (!isBusy && !hasStaticContent) {
|
|
521
|
+
if (!isBusy && !hasStaticContent && !hasBusySlot) {
|
|
544
522
|
return null;
|
|
545
523
|
}
|
|
546
524
|
return (
|
|
547
525
|
<div ref={laneRef} {...stylex.props(laneXStyle)}>
|
|
548
|
-
{isBusy
|
|
526
|
+
{(isBusy || hasBusySlot) && (
|
|
527
|
+
<Spinner
|
|
528
|
+
// Remounts when a search starts, so the ring syncs its phase on
|
|
529
|
+
// mount exactly as a newly shown Spinner did before.
|
|
530
|
+
key={isBusy ? 'busy' : 'idle'}
|
|
531
|
+
size="sm"
|
|
532
|
+
aria-label={loadingLabel}
|
|
533
|
+
role="img"
|
|
534
|
+
aria-hidden={isBusy ? undefined : true}
|
|
535
|
+
xstyle={isBusy ? undefined : styles.idleSpinner}
|
|
536
|
+
/>
|
|
537
|
+
)}
|
|
549
538
|
{children}
|
|
550
539
|
</div>
|
|
551
540
|
);
|
|
@@ -1065,11 +1054,11 @@ export function Tokenizer<T extends SearchableItem>({
|
|
|
1065
1054
|
isAtMax || isTruncated
|
|
1066
1055
|
? styles.inputAtMax
|
|
1067
1056
|
: value.length > 0
|
|
1068
|
-
?
|
|
1057
|
+
? styles.inputCompact
|
|
1069
1058
|
: undefined,
|
|
1070
|
-
//
|
|
1071
|
-
//
|
|
1072
|
-
//
|
|
1059
|
+
// With tokens, wrapperWithTokens reserves the lane for every row.
|
|
1060
|
+
// This rule is only for an empty Tokenizer; it still resolves to
|
|
1061
|
+
// zero until the lane publishes a width.
|
|
1073
1062
|
!(isAtMax || isTruncated || value.length > 0) && laneReserve,
|
|
1074
1063
|
]}
|
|
1075
1064
|
/>
|
|
@@ -1093,7 +1082,11 @@ export function Tokenizer<T extends SearchableItem>({
|
|
|
1093
1082
|
laneXStyle={[styles.endSection, endSectionSizeStyles[size]]}
|
|
1094
1083
|
loadingLabel={t('@astryx.typeahead.loading')}
|
|
1095
1084
|
anchorRef={wrapperRef}
|
|
1096
|
-
hasStaticContent={hasStaticEndLane}
|
|
1085
|
+
hasStaticContent={hasStaticEndLane}
|
|
1086
|
+
// Wherever a search can run beside tokens: enabled and below
|
|
1087
|
+
// maxEntries. A collapsed overflow row keeps it too, since a search
|
|
1088
|
+
// started while focused can settle after focus leaves.
|
|
1089
|
+
hasBusySlot={value.length > 0 && !isDisabled && !isAtMax}>
|
|
1097
1090
|
{endContent}
|
|
1098
1091
|
{hasClearButton && (
|
|
1099
1092
|
<InputClearButton
|