@astryxdesign/core 0.1.4-canary.fd7ab46 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +18 -20
- package/dist/AlertDialog/useImperativeAlertDialog.js +3 -3
- package/dist/AppShell/AppShell.d.ts +1 -1
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +53 -55
- package/dist/AspectRatio/AspectRatio.d.ts +10 -48
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +12 -33
- package/dist/AspectRatio/index.d.ts +1 -1
- package/dist/AspectRatio/index.d.ts.map +1 -1
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +25 -27
- package/dist/Avatar/AvatarStatusDot.js +5 -5
- package/dist/AvatarGroup/AvatarGroup.js +5 -5
- package/dist/AvatarGroup/AvatarGroupOverflow.js +5 -5
- package/dist/Badge/Badge.js +3 -3
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +25 -32
- package/dist/Blockquote/Blockquote.js +7 -7
- package/dist/Breadcrumbs/BreadcrumbItem.js +17 -17
- package/dist/Breadcrumbs/Breadcrumbs.js +7 -7
- package/dist/Button/Button.js +19 -19
- package/dist/ButtonGroup/ButtonGroup.js +7 -7
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +48 -68
- package/dist/Calendar/dayCellUtils.d.ts.map +1 -1
- package/dist/Calendar/styles.d.ts +2 -2
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +2 -2
- package/dist/Card/Card.d.ts +2 -4
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +10 -18
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +21 -24
- package/dist/Carousel/carousel.markers.stylex.d.ts +7 -0
- package/dist/Carousel/carousel.markers.stylex.d.ts.map +1 -0
- package/dist/Carousel/carousel.markers.stylex.js +12 -0
- package/dist/Center/Center.js +3 -3
- package/dist/Chat/ChatComposer.js +23 -23
- package/dist/Chat/ChatComposerDrawer.js +14 -14
- package/dist/Chat/ChatComposerInput.d.ts +1 -1
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +15 -27
- package/dist/Chat/ChatDictationButton.d.ts +1 -1
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +11 -13
- package/dist/Chat/ChatLayout.js +17 -17
- package/dist/Chat/ChatLayoutScrollButton.d.ts +1 -1
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +10 -12
- package/dist/Chat/ChatMessage.js +12 -12
- package/dist/Chat/ChatMessageBubble.js +7 -7
- package/dist/Chat/ChatMessageList.js +14 -14
- package/dist/Chat/ChatMessageMetadata.d.ts +1 -1
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +12 -14
- package/dist/Chat/ChatPastedTextToken.js +13 -13
- package/dist/Chat/ChatSendButton.js +3 -3
- package/dist/Chat/ChatSystemMessage.d.ts +1 -1
- package/dist/Chat/ChatSystemMessage.d.ts.map +1 -1
- package/dist/Chat/ChatSystemMessage.js +17 -17
- package/dist/Chat/ChatTokenizedText.d.ts +1 -1
- package/dist/Chat/ChatTokenizedText.d.ts.map +1 -1
- package/dist/Chat/ChatTokenizedText.js +15 -24
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +74 -81
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +15 -15
- package/dist/CheckboxInput/CheckboxInput.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +23 -25
- package/dist/CheckboxList/CheckboxList.js +9 -9
- package/dist/CheckboxList/CheckboxListItem.d.ts +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +6 -8
- package/dist/Citation/Citation.js +10 -10
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +9 -32
- package/dist/Code/Code.js +3 -3
- package/dist/CodeBlock/CodeBlock.d.ts +1 -10
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +52 -88
- package/dist/Collapsible/Collapsible.d.ts +3 -9
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +22 -110
- package/dist/Collapsible/CollapsibleGroup.d.ts +7 -39
- package/dist/Collapsible/CollapsibleGroup.d.ts.map +1 -1
- package/dist/Collapsible/CollapsibleGroup.js +12 -73
- package/dist/Collapsible/CollapsibleGroupContext.d.ts +0 -31
- package/dist/Collapsible/CollapsibleGroupContext.d.ts.map +1 -1
- package/dist/Collapsible/CollapsibleGroupContext.js +3 -33
- package/dist/Collapsible/index.d.ts +0 -1
- package/dist/Collapsible/index.d.ts.map +1 -1
- package/dist/Collapsible/useCollapsible.d.ts +1 -4
- package/dist/Collapsible/useCollapsible.d.ts.map +1 -1
- package/dist/Collapsible/useCollapsible.js +6 -20
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +34 -36
- package/dist/CommandPalette/CommandPaletteEmpty.js +3 -3
- package/dist/CommandPalette/CommandPaletteFooter.js +16 -16
- package/dist/CommandPalette/CommandPaletteGroup.js +5 -5
- package/dist/CommandPalette/CommandPaletteInput.js +13 -13
- package/dist/CommandPalette/CommandPaletteItem.js +3 -3
- package/dist/CommandPalette/CommandPaletteList.js +3 -3
- package/dist/ContextMenu/ContextMenu.d.ts +2 -7
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +43 -76
- package/dist/DateInput/DateInput.js +18 -18
- package/dist/DateRangeInput/DateRangeInput.js +21 -21
- package/dist/DateTimeInput/DateTimeInput.d.ts +2 -5
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +26 -30
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +9 -9
- package/dist/Dialog/DialogHeader.js +16 -16
- package/dist/Dialog/useImperativeDialog.js +3 -3
- package/dist/Divider/Divider.js +7 -7
- package/dist/DropdownMenu/DropdownMenu.js +10 -10
- package/dist/DropdownMenu/DropdownMenuItem.d.ts +17 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -3
- package/dist/DropdownMenu/renderDropdownItems.js +10 -10
- package/dist/EmptyState/EmptyState.js +9 -9
- package/dist/Field/Field.js +17 -17
- package/dist/Field/FieldLabel.js +15 -15
- package/dist/Field/InputClearButton.js +5 -5
- package/dist/FieldStatus/FieldStatus.js +3 -3
- package/dist/FileInput/FileInput.js +29 -29
- package/dist/FormLayout/FormLayout.js +5 -5
- package/dist/Grid/Grid.d.ts +3 -4
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +12 -29
- package/dist/Grid/GridSpan.js +3 -3
- package/dist/HStack/HStack.js +3 -3
- package/dist/Heading/Heading.js +10 -10
- package/dist/HoverCard/HoverCard.js +9 -9
- package/dist/HoverCard/useHoverCard.d.ts +1 -5
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +3 -3
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +12 -16
- package/dist/Icon/defaultIcons.js +116 -116
- package/dist/IconButton/IconButton.js +3 -3
- package/dist/InputGroup/InputGroup.js +11 -11
- package/dist/InputGroup/InputGroupText.js +3 -3
- package/dist/Item/Item.js +18 -18
- package/dist/Kbd/Kbd.js +5 -5
- package/dist/Layer/LayerProvider.js +7 -7
- package/dist/Layer/useLayer.d.ts +2 -29
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +31 -44
- package/dist/Layout/Layout.js +21 -21
- package/dist/Layout/LayoutContent.js +3 -3
- package/dist/Layout/LayoutFooter.js +5 -5
- package/dist/Layout/LayoutHeader.js +5 -5
- package/dist/Layout/LayoutPanel.js +3 -3
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +31 -55
- package/dist/Lightbox/useLightbox.js +3 -3
- package/dist/Link/Link.js +15 -15
- package/dist/Link/LinkProvider.js +3 -3
- package/dist/Link/useLinkify.js +3 -3
- package/dist/List/List.js +11 -11
- package/dist/List/ListItem.js +11 -11
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +102 -102
- package/dist/MetadataList/MetadataList.js +10 -10
- package/dist/MetadataList/MetadataListItem.js +15 -15
- package/dist/MobileNav/MobileNav.js +15 -15
- package/dist/MobileNav/MobileNavToggle.js +5 -5
- package/dist/MoreMenu/MoreMenu.js +3 -3
- package/dist/MultiSelector/MultiSelector.js +56 -56
- package/dist/NavIcon/NavIcon.js +3 -3
- package/dist/NavMenu/NavHeadingMenu.js +5 -5
- package/dist/NavMenu/NavHeadingMenuItem.js +8 -8
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +32 -48
- package/dist/Outline/Outline.js +15 -15
- package/dist/OverflowList/OverflowList.js +8 -8
- package/dist/Overlay/Overlay.js +3 -3
- package/dist/Overlay/OverlayScrim.js +5 -5
- package/dist/Overlay/useOverlay.js +3 -3
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +72 -125
- package/dist/Popover/Popover.js +16 -16
- package/dist/Popover/usePopover.js +7 -7
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +92 -110
- package/dist/PowerSearch/PowerSearchEditPopover.js +84 -84
- package/dist/PowerSearch/PowerSearchFilterEditor.js +3 -3
- package/dist/PowerSearch/PowerSearchToken.js +5 -5
- package/dist/PowerSearch/PowerSearchValueEditor.js +54 -54
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +18 -25
- package/dist/RadioList/RadioList.js +7 -7
- package/dist/RadioList/RadioListItem.d.ts +1 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +21 -24
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +10 -28
- package/dist/Section/Section.js +5 -5
- package/dist/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +10 -32
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +12 -18
- package/dist/SelectableCard/SelectableCard.js +5 -5
- package/dist/Selector/Selector.js +46 -46
- package/dist/Selector/SelectorOption.js +3 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +34 -38
- package/dist/SideNav/SideNavCollapseButton.d.ts +1 -1
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +6 -8
- package/dist/SideNav/SideNavHeading.js +87 -87
- package/dist/SideNav/SideNavItem.js +42 -42
- package/dist/SideNav/SideNavSection.d.ts +1 -1
- package/dist/SideNav/SideNavSection.d.ts.map +1 -1
- package/dist/SideNav/SideNavSection.js +16 -18
- package/dist/Skeleton/Skeleton.js +3 -3
- package/dist/Slider/Slider.js +23 -23
- package/dist/Spinner/Spinner.js +9 -9
- package/dist/StatusDot/StatusDot.js +5 -5
- package/dist/Switch/Switch.d.ts +4 -8
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +29 -34
- package/dist/TabList/Tab.js +18 -18
- package/dist/TabList/TabList.js +5 -5
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +30 -57
- package/dist/TabList/tab.markers.stylex.d.ts +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +39 -50
- package/dist/Table/Table.js +7 -7
- package/dist/Table/TableBody.d.ts +1 -1
- package/dist/Table/TableBody.d.ts.map +1 -1
- package/dist/Table/TableBody.js +5 -9
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableFooter.d.ts +1 -1
- package/dist/Table/TableFooter.d.ts.map +1 -1
- package/dist/Table/TableFooter.js +5 -9
- package/dist/Table/TableHeader.d.ts +1 -1
- package/dist/Table/TableHeader.d.ts.map +1 -1
- package/dist/Table/TableHeader.js +5 -9
- package/dist/Table/TableHeaderCell.js +3 -3
- package/dist/Table/TableRow.js +5 -5
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +11 -14
- package/dist/Table/plugins/filtering/useTableFiltering.js +71 -71
- package/dist/Table/plugins/pagination/paginateData.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/paginateData.js +1 -5
- package/dist/Table/plugins/pagination/useTablePagination.js +7 -7
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +22 -22
- package/dist/Table/plugins/selection/useTableSelection.js +18 -18
- package/dist/Table/plugins/selection/useTableSelectionState.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelectionState.js +1 -11
- package/dist/Table/plugins/sortable/useTableSortable.js +17 -17
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +4 -8
- package/dist/Table/tableContextMenu.js +9 -9
- package/dist/Text/Text.js +10 -10
- package/dist/TextArea/TextArea.js +14 -14
- package/dist/TextInput/TextInput.js +15 -15
- package/dist/Thumbnail/Thumbnail.d.ts +2 -3
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +29 -30
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +21 -26
- package/dist/Timestamp/Timestamp.d.ts +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +26 -37
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +17 -25
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +11 -23
- package/dist/Toast/useToast.js +4 -4
- package/dist/ToggleButton/ToggleButton.js +12 -12
- package/dist/ToggleButton/ToggleButtonGroup.js +5 -5
- package/dist/Token/Token.js +21 -21
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +34 -36
- package/dist/Toolbar/Toolbar.js +18 -18
- package/dist/Tooltip/Tooltip.js +11 -11
- package/dist/Tooltip/useTooltip.d.ts +1 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +3 -3
- package/dist/TopNav/TopNav.js +32 -32
- package/dist/TopNav/TopNavHeading.js +67 -67
- package/dist/TopNav/TopNavItem.js +5 -5
- package/dist/TopNav/TopNavMegaMenu.js +30 -30
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts +1 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +14 -25
- package/dist/TopNav/TopNavMegaMenuItem.js +16 -16
- package/dist/TopNav/TopNavMenu.js +32 -32
- package/dist/TreeList/TreeList.js +8 -8
- package/dist/TreeList/TreeListBranches.js +11 -11
- package/dist/TreeList/TreeListItem.js +30 -30
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +20 -23
- package/dist/Typeahead/Typeahead.js +12 -12
- package/dist/Typeahead/TypeaheadItem.js +10 -10
- package/dist/VStack/VStack.js +3 -3
- package/dist/astryx.css +0 -7
- package/dist/astryx.umd.js +60 -60
- package/dist/astryx.umd.js.map +4 -4
- package/dist/docs-types.d.ts +2 -8
- package/dist/docs-types.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.d.ts +1 -1
- package/dist/hooks/focusableSelector.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.js +1 -1
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/useFocusTrap.d.ts +0 -3
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +1 -38
- package/dist/hooks/useInteractiveRole.d.ts +2 -6
- package/dist/hooks/useInteractiveRole.d.ts.map +1 -1
- package/dist/hooks/useInteractiveRole.js +2 -6
- package/dist/hooks/useKeyboardHint.js +9 -9
- package/dist/hooks/useStreamingText.d.ts +1 -3
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +5 -14
- package/dist/theme/MediaTheme.js +3 -3
- package/dist/theme/Theme.js +7 -7
- package/dist/theme/defineTheme.d.ts +1 -1
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/expandColorScale.d.ts.map +1 -1
- package/dist/theme/expandColorScale.js +3 -10
- package/dist/theme/hct.d.ts +15 -0
- package/dist/theme/hct.d.ts.map +1 -1
- package/dist/theme/hct.js +9 -9
- package/dist/theme/syntax/SyntaxTheme.js +5 -5
- package/dist/theme/tokens.d.ts +2 -10
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +4 -220
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -3
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +5 -8
- package/package.json +3 -3
- package/src/AlertDialog/AlertDialog.doc.mjs +0 -4
- package/src/AlertDialog/AlertDialog.tsx +0 -2
- package/src/AppShell/AppShell.tsx +0 -2
- package/src/AspectRatio/AspectRatio.doc.mjs +1 -28
- package/src/AspectRatio/AspectRatio.test.tsx +1 -142
- package/src/AspectRatio/AspectRatio.tsx +10 -70
- package/src/AspectRatio/index.ts +1 -5
- package/src/Avatar/Avatar.doc.mjs +0 -11
- package/src/Avatar/Avatar.test.tsx +1 -32
- package/src/Avatar/Avatar.tsx +20 -12
- package/src/Banner/Banner.doc.mjs +0 -8
- package/src/Banner/Banner.test.tsx +0 -38
- package/src/Banner/Banner.tsx +1 -8
- package/src/Calendar/Calendar.doc.mjs +1 -1
- package/src/Calendar/Calendar.test.tsx +17 -122
- package/src/Calendar/Calendar.tsx +5 -26
- package/src/Calendar/dayCellUtils.ts +1 -3
- package/src/Calendar/styles.ts +2 -12
- package/src/Card/Card.tsx +6 -16
- package/src/Carousel/Carousel.doc.mjs +12 -12
- package/src/Carousel/Carousel.test.tsx +0 -13
- package/src/Carousel/Carousel.tsx +2 -4
- package/src/Carousel/carousel.markers.stylex.ts +10 -0
- package/src/Chat/Chat.doc.mjs +1 -1
- package/src/Chat/ChatComposerInput.test.tsx +1 -27
- package/src/Chat/ChatComposerInput.tsx +15 -20
- package/src/Chat/ChatDictationButton.tsx +4 -4
- package/src/Chat/ChatLayoutScrollButton.tsx +1 -3
- package/src/Chat/ChatMessageMetadata.tsx +6 -4
- package/src/Chat/ChatSystemMessage.test.tsx +11 -26
- package/src/Chat/ChatSystemMessage.tsx +7 -7
- package/src/Chat/ChatTokenizedText.test.tsx +16 -29
- package/src/Chat/ChatTokenizedText.tsx +8 -15
- package/src/Chat/ChatToolCalls.test.tsx +0 -55
- package/src/Chat/ChatToolCalls.tsx +12 -10
- package/src/Chat/index.ts +4 -1
- package/src/Chat/useTriggerMenu.tsx +4 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +3 -3
- package/src/CheckboxInput/CheckboxInput.test.tsx +4 -71
- package/src/CheckboxInput/CheckboxInput.tsx +0 -2
- package/src/CheckboxList/CheckboxList.test.tsx +0 -19
- package/src/CheckboxList/CheckboxListItem.tsx +2 -11
- package/src/Citation/Citation.doc.mjs +0 -5
- package/src/ClickableCard/ClickableCard.tsx +2 -45
- package/src/CodeBlock/CodeBlock.doc.mjs +2 -7
- package/src/CodeBlock/CodeBlock.test.tsx +3 -122
- package/src/CodeBlock/CodeBlock.tsx +4 -62
- package/src/Collapsible/Collapsible.doc.mjs +4 -8
- package/src/Collapsible/Collapsible.tsx +10 -86
- package/src/Collapsible/CollapsibleGroup.doc.mjs +3 -27
- package/src/Collapsible/CollapsibleGroup.test.tsx +0 -318
- package/src/Collapsible/CollapsibleGroup.tsx +9 -107
- package/src/Collapsible/CollapsibleGroupContext.tsx +2 -42
- package/src/Collapsible/index.ts +0 -4
- package/src/Collapsible/useCollapsible.ts +6 -20
- package/src/CommandPalette/CommandPalette.doc.mjs +0 -4
- package/src/CommandPalette/CommandPalette.tsx +3 -5
- package/src/CommandPalette/CommandPaletteEmpty.doc.mjs +0 -5
- package/src/CommandPalette/CommandPaletteGroup.doc.mjs +0 -10
- package/src/CommandPalette/CommandPaletteInput.doc.mjs +0 -6
- package/src/CommandPalette/CommandPaletteItem.doc.mjs +0 -6
- package/src/CommandPalette/CommandPaletteList.doc.mjs +0 -9
- package/src/ContextMenu/ContextMenu.doc.mjs +0 -15
- package/src/ContextMenu/ContextMenu.test.tsx +0 -87
- package/src/ContextMenu/ContextMenu.tsx +28 -87
- package/src/ContextMenu/ContextMenuItem.doc.mjs +0 -6
- package/src/DateInput/DateInput.test.tsx +20 -11
- package/src/DateRangeInput/DateRangeInput.test.tsx +44 -31
- package/src/DateTimeInput/DateTimeInput.doc.mjs +2 -3
- package/src/DateTimeInput/DateTimeInput.test.tsx +16 -118
- package/src/DateTimeInput/DateTimeInput.tsx +2 -8
- package/src/DateTimeInput/index.ts +0 -1
- package/src/Dialog/Dialog.doc.mjs +0 -4
- package/src/Dialog/DialogHeader.doc.mjs +0 -45
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenu.test.tsx +2 -22
- package/src/DropdownMenu/DropdownMenuItem.tsx +17 -5
- package/src/Field/Field.test.tsx +4 -1
- package/src/Field/FieldLabel.test.tsx +2 -2
- package/src/FormLayout/__snapshots__/FormLayout.test.tsx.snap +3 -0
- package/src/Grid/Grid.test.tsx +18 -43
- package/src/Grid/Grid.tsx +9 -26
- package/src/HoverCard/HoverCard.doc.mjs +6 -6
- package/src/HoverCard/useHoverCard.doc.mjs +5 -5
- package/src/HoverCard/useHoverCard.tsx +2 -9
- package/src/Icon/Icon.test.tsx +29 -41
- package/src/Icon/Icon.tsx +2 -6
- package/src/InputGroup/InputGroup.tsx +2 -2
- package/src/Item/Item.tsx +1 -1
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Layer/useLayer.test.tsx +2 -221
- package/src/Layer/useLayer.tsx +30 -69
- package/src/Layout/LayoutContent.doc.mjs +0 -12
- package/src/Layout/LayoutPanel.doc.mjs +0 -40
- package/src/Lightbox/Lightbox.doc.mjs +0 -5
- package/src/Lightbox/Lightbox.test.tsx +2 -123
- package/src/Lightbox/Lightbox.tsx +1 -29
- package/src/Markdown/Markdown.tsx +7 -9
- package/src/Markdown/parser.perf.test.ts +12 -34
- package/src/NavMenu/NavMenu.doc.mjs +0 -15
- package/src/NumberInput/NumberInput.test.tsx +3 -48
- package/src/NumberInput/NumberInput.tsx +15 -32
- package/src/Overlay/Overlay.doc.mjs +0 -6
- package/src/Pagination/Pagination.test.tsx +0 -162
- package/src/Pagination/Pagination.tsx +26 -80
- package/src/Popover/Popover.doc.mjs +6 -6
- package/src/Popover/Popover.test.tsx +0 -65
- package/src/Popover/usePopover.doc.mjs +1 -1
- package/src/PowerSearch/PowerSearch.doc.mjs +2 -2
- package/src/PowerSearch/PowerSearch.test.tsx +1 -109
- package/src/PowerSearch/PowerSearch.tsx +16 -37
- package/src/ProgressBar/ProgressBar.test.tsx +0 -30
- package/src/ProgressBar/ProgressBar.tsx +5 -12
- package/src/RadioList/RadioList.test.tsx +0 -19
- package/src/RadioList/RadioListItem.tsx +4 -9
- package/src/Resizable/ResizeHandle.tsx +4 -22
- package/src/SegmentedControl/SegmentedControl.doc.mjs +1 -1
- package/src/SegmentedControl/SegmentedControl.test.tsx +0 -192
- package/src/SegmentedControl/SegmentedControl.tsx +5 -27
- package/src/SegmentedControl/SegmentedControlItem.tsx +4 -9
- package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
- package/src/Selector/Selector.test.tsx +1 -27
- package/src/SideNav/SideNav.doc.mjs +1 -7
- package/src/SideNav/SideNav.test.tsx +0 -66
- package/src/SideNav/SideNav.tsx +2 -6
- package/src/SideNav/SideNavCollapseButton.tsx +3 -4
- package/src/SideNav/SideNavSection.tsx +4 -6
- package/src/Switch/Switch.doc.mjs +7 -7
- package/src/Switch/Switch.test.tsx +3 -102
- package/src/Switch/Switch.tsx +7 -20
- package/src/TabList/TabList.test.tsx +1 -185
- package/src/TabList/TabMenu.tsx +9 -45
- package/src/Table/BaseTable.tsx +2 -13
- package/src/Table/Table.test.tsx +0 -87
- package/src/Table/TableBody.tsx +2 -15
- package/src/Table/TableFooter.tsx +2 -15
- package/src/Table/TableHeader.tsx +2 -15
- package/src/Table/plugins/columnResize/useTableColumnResize.test.tsx +0 -13
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +1 -3
- package/src/Table/plugins/pagination/paginateData.ts +1 -5
- package/src/Table/plugins/pagination/useTablePagination.test.tsx +0 -13
- package/src/Table/plugins/selection/useTableSelectionState.test.tsx +0 -23
- package/src/Table/plugins/selection/useTableSelectionState.tsx +6 -11
- package/src/Table/plugins/sortable/useTableSortableState.test.tsx +1 -35
- package/src/Table/plugins/sortable/useTableSortableState.tsx +4 -8
- package/src/TextArea/TextArea.test.tsx +3 -3
- package/src/TextInput/TextInput.test.tsx +3 -3
- package/src/Thumbnail/Thumbnail.test.tsx +2 -36
- package/src/Thumbnail/Thumbnail.tsx +2 -4
- package/src/TimeInput/TimeInput.test.tsx +0 -37
- package/src/TimeInput/TimeInput.tsx +1 -11
- package/src/Timestamp/Timestamp.doc.mjs +1 -1
- package/src/Timestamp/Timestamp.test.tsx +0 -52
- package/src/Timestamp/Timestamp.tsx +16 -30
- package/src/Toast/Toast.tsx +3 -11
- package/src/Toast/ToastViewport.test.tsx +0 -64
- package/src/Toast/ToastViewport.tsx +0 -12
- package/src/ToggleButton/ToggleButton.doc.mjs +0 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
- package/src/Tokenizer/Tokenizer.test.tsx +0 -54
- package/src/Tokenizer/Tokenizer.tsx +4 -5
- package/src/Tooltip/Tooltip.doc.mjs +6 -6
- package/src/Tooltip/useTooltip.doc.mjs +5 -5
- package/src/Tooltip/useTooltip.tsx +2 -12
- package/src/TopNav/TopNav.doc.mjs +1 -1
- package/src/TopNav/TopNav.test.tsx +7 -23
- package/src/TopNav/TopNavMegaMenuFeaturedCard.tsx +2 -9
- package/src/TreeList/TreeList.doc.mjs +2 -2
- package/src/Typeahead/BaseTypeahead.doc.mjs +0 -19
- package/src/Typeahead/BaseTypeahead.tsx +2 -5
- package/src/Typeahead/Typeahead.doc.mjs +1 -1
- package/src/Typeahead/Typeahead.test.tsx +1 -45
- package/src/docs-types.ts +1 -9
- package/src/hooks/focusableSelector.ts +1 -1
- package/src/hooks/index.ts +0 -3
- package/src/hooks/useFocusTrap.doc.mjs +2 -4
- package/src/hooks/useFocusTrap.test.tsx +1 -149
- package/src/hooks/useFocusTrap.ts +1 -50
- package/src/hooks/useInteractiveRole.ts +4 -12
- package/src/hooks/useStreamingText.test.ts +19 -54
- package/src/hooks/useStreamingText.ts +5 -16
- package/src/hooks/useTreeFocus.test.tsx +3 -1
- package/src/reset.css +0 -29
- package/src/theme/SyntaxTheme.doc.mjs +4 -4
- package/src/theme/defineTheme.ts +13 -4
- package/src/theme/derivedVarRegistry.test.ts +2 -2
- package/src/theme/expandColorScale.test.ts +0 -29
- package/src/theme/expandColorScale.ts +6 -11
- package/src/theme/hct.ts +17 -9
- package/src/theme/tokens.test.ts +9 -182
- package/src/theme/tokens.ts +4 -239
- package/src/theme/useTheme.test.tsx +0 -20
- package/src/utils/index.ts +0 -4
- package/src/utils/sharedResizeObserver.test.ts +2 -2
- package/src/utils/timeParser.test.ts +0 -13
- package/src/utils/timeParser.ts +5 -8
- package/dist/hooks/useHotkeys.d.ts +0 -51
- package/dist/hooks/useHotkeys.d.ts.map +0 -1
- package/dist/hooks/useHotkeys.js +0 -160
- package/dist/utils/color.d.ts +0 -42
- package/dist/utils/color.d.ts.map +0 -1
- package/dist/utils/color.js +0 -150
- package/dist/utils/composeEventHandlers.d.ts +0 -30
- package/dist/utils/composeEventHandlers.d.ts.map +0 -1
- package/dist/utils/composeEventHandlers.js +0 -40
- package/src/Chat/ChatDictationButton.test.tsx +0 -43
- package/src/Chat/ChatLayoutScrollButton.test.tsx +0 -33
- package/src/Chat/ChatMessageMetadata.test.tsx +0 -32
- package/src/Collapsible/Collapsible.test.tsx +0 -405
- package/src/FieldStatus/FieldStatus.test.tsx +0 -282
- package/src/InteractiveRoleContext/InteractiveRoleContext.test.tsx +0 -185
- package/src/Layout/Layout.test.tsx +0 -285
- package/src/Layout/LayoutSlots.test.tsx +0 -364
- package/src/Outline/parseOutlineFromMarkdown.test.ts +0 -80
- package/src/OverflowList/OverflowList.test.tsx +0 -416
- package/src/Overlay/Overlay.test.tsx +0 -356
- package/src/Resizable/ResizeHandle.test.tsx +0 -218
- package/src/SizeContext/SizeContext.test.tsx +0 -226
- package/src/__tests__/TestIcon.tsx +0 -26
- package/src/__tests__/fastRoleQueries.ts +0 -66
- package/src/docPropReferences.test.ts +0 -178
- package/src/hooks/useHotkeys.doc.mjs +0 -52
- package/src/hooks/useHotkeys.test.ts +0 -245
- package/src/hooks/useHotkeys.ts +0 -203
- package/src/utils/color.test.ts +0 -133
- package/src/utils/color.ts +0 -148
- package/src/utils/composeEventHandlers.test.ts +0 -71
- package/src/utils/composeEventHandlers.ts +0 -44
- package/src/utils/mergeProps.test.ts +0 -166
|
@@ -3,21 +3,15 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file useLayer.test.tsx
|
|
5
5
|
* @input Uses vitest, @testing-library/react, useLayer hook
|
|
6
|
-
* @output
|
|
6
|
+
* @output Unit tests for useLayer show/hide behavior and feature-detection guards
|
|
7
7
|
* @position Testing; validates useLayer.tsx implementation
|
|
8
8
|
*
|
|
9
|
-
* SYNC: When useLayer.tsx changes, update tests
|
|
9
|
+
* SYNC: When useLayer.tsx changes, update tests to match new behavior
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {describe, it, expect, vi, afterEach} from 'vitest';
|
|
13
13
|
import {render, act} from '@testing-library/react';
|
|
14
|
-
import userEvent from '@testing-library/user-event';
|
|
15
14
|
import {useLayer} from './useLayer';
|
|
16
|
-
import type {
|
|
17
|
-
LayerPlacement,
|
|
18
|
-
LayerAlignment,
|
|
19
|
-
ContextRenderProps,
|
|
20
|
-
} from './useLayer';
|
|
21
15
|
|
|
22
16
|
/**
|
|
23
17
|
* Minimal harness that exposes the imperative show/hide callbacks and renders
|
|
@@ -115,216 +109,3 @@ describe('useLayer', () => {
|
|
|
115
109
|
});
|
|
116
110
|
});
|
|
117
111
|
});
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Harness that owns the trigger element.
|
|
121
|
-
*/
|
|
122
|
-
function Harness({
|
|
123
|
-
placement,
|
|
124
|
-
alignment,
|
|
125
|
-
triggerStyle,
|
|
126
|
-
triggerDir,
|
|
127
|
-
}: {
|
|
128
|
-
placement: LayerPlacement;
|
|
129
|
-
alignment: LayerAlignment;
|
|
130
|
-
triggerStyle?: React.CSSProperties;
|
|
131
|
-
triggerDir?: string;
|
|
132
|
-
}) {
|
|
133
|
-
const layer = useLayer({mode: 'context'});
|
|
134
|
-
return (
|
|
135
|
-
<>
|
|
136
|
-
<button
|
|
137
|
-
type="button"
|
|
138
|
-
ref={layer.ref}
|
|
139
|
-
dir={triggerDir}
|
|
140
|
-
style={triggerStyle}
|
|
141
|
-
onClick={layer.isOpen ? layer.hide : layer.show}>
|
|
142
|
-
trigger
|
|
143
|
-
</button>
|
|
144
|
-
{layer.render(<span>content</span>, {placement, alignment})}
|
|
145
|
-
</>
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
async function openAndGetStyle(ui: React.ReactElement): Promise<string> {
|
|
150
|
-
const user = userEvent.setup();
|
|
151
|
-
const {container, getByRole} = render(ui);
|
|
152
|
-
await user.click(getByRole('button', {name: 'trigger'}));
|
|
153
|
-
const popover = container.querySelector('[popover]');
|
|
154
|
-
return popover?.getAttribute('style') ?? '';
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
describe('useLayer context positioning', () => {
|
|
158
|
-
// The mapping uses the self-* logical keyword family, so the emitted
|
|
159
|
-
// string is direction-independent by construction: the browser resolves
|
|
160
|
-
// the inline axis against the popover's own inherited direction, and RTL
|
|
161
|
-
// mirrors with no JS. jsdom has no layout engine, so these tests can only
|
|
162
|
-
// assert the emitted string — the actual RTL geometry is covered by the
|
|
163
|
-
// RTL Storybook story (and was verified against the full 12-cell matrix
|
|
164
|
-
// in a real browser).
|
|
165
|
-
describe('self-* position-area mapping', () => {
|
|
166
|
-
it.each([
|
|
167
|
-
// [placement, alignment, expected position-area]
|
|
168
|
-
['above', 'start', 'self-block-start span-self-inline-end'],
|
|
169
|
-
['above', 'center', 'self-block-start'],
|
|
170
|
-
['above', 'end', 'self-block-start span-self-inline-start'],
|
|
171
|
-
['below', 'start', 'self-block-end span-self-inline-end'],
|
|
172
|
-
['below', 'center', 'self-block-end'],
|
|
173
|
-
['below', 'end', 'self-block-end span-self-inline-start'],
|
|
174
|
-
['start', 'start', 'self-inline-start span-self-block-end'],
|
|
175
|
-
['start', 'center', 'self-inline-start'],
|
|
176
|
-
['start', 'end', 'self-inline-start span-self-block-start'],
|
|
177
|
-
['end', 'start', 'self-inline-end span-self-block-end'],
|
|
178
|
-
['end', 'center', 'self-inline-end'],
|
|
179
|
-
['end', 'end', 'self-inline-end span-self-block-start'],
|
|
180
|
-
] as const)(
|
|
181
|
-
'placement=%s alignment=%s emits position-area %s',
|
|
182
|
-
async (placement, alignment, expectedArea) => {
|
|
183
|
-
const style = await openAndGetStyle(
|
|
184
|
-
<Harness placement={placement} alignment={alignment} />,
|
|
185
|
-
);
|
|
186
|
-
expect(style).toMatch(
|
|
187
|
-
new RegExp(`position-area: ${expectedArea}(;|$)`),
|
|
188
|
-
);
|
|
189
|
-
expect(style).not.toContain('justify-self');
|
|
190
|
-
},
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
it('emits the same string regardless of trigger direction', async () => {
|
|
194
|
-
const user = userEvent.setup();
|
|
195
|
-
const first = render(<Harness placement="below" alignment="start" />);
|
|
196
|
-
await user.click(first.getByRole('button', {name: 'trigger'}));
|
|
197
|
-
const ltr =
|
|
198
|
-
first.container.querySelector('[popover]')?.getAttribute('style') ?? '';
|
|
199
|
-
first.unmount();
|
|
200
|
-
|
|
201
|
-
const second = render(
|
|
202
|
-
<Harness
|
|
203
|
-
placement="below"
|
|
204
|
-
alignment="start"
|
|
205
|
-
triggerDir="rtl"
|
|
206
|
-
triggerStyle={{direction: 'rtl'}}
|
|
207
|
-
/>,
|
|
208
|
-
);
|
|
209
|
-
await user.click(second.getByRole('button', {name: 'trigger'}));
|
|
210
|
-
const rtl =
|
|
211
|
-
second.container.querySelector('[popover]')?.getAttribute('style') ??
|
|
212
|
-
'';
|
|
213
|
-
// The unique position-anchor id differs per render; the placement
|
|
214
|
-
// mapping must not.
|
|
215
|
-
const positionArea = (s: string) => s.match(/position-area:[^;]*/)?.[0];
|
|
216
|
-
expect(positionArea(rtl)).toBeDefined();
|
|
217
|
-
expect(positionArea(rtl)).toBe(positionArea(ltr));
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
it('keeps position-try fallbacks intact', async () => {
|
|
221
|
-
const style = await openAndGetStyle(
|
|
222
|
-
<Harness placement="below" alignment="start" />,
|
|
223
|
-
);
|
|
224
|
-
expect(style).toContain(
|
|
225
|
-
'position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline',
|
|
226
|
-
);
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
describe("positioning='custom' (consumer-authored position styles)", () => {
|
|
231
|
-
// Consumers like Carousel and Tokenizer keep useLayer's popover behavior
|
|
232
|
-
// and anchor wiring but position the layer themselves. The opt-out must
|
|
233
|
-
// suppress every placement-derived style — position-area and the try
|
|
234
|
-
// fallbacks — so those consumers never need to know which properties
|
|
235
|
-
// the hook would have emitted.
|
|
236
|
-
function CustomHarness({
|
|
237
|
-
triggerStyle,
|
|
238
|
-
renderProps,
|
|
239
|
-
}: {
|
|
240
|
-
triggerStyle?: React.CSSProperties;
|
|
241
|
-
renderProps: ContextRenderProps;
|
|
242
|
-
}) {
|
|
243
|
-
const layer = useLayer({mode: 'context'});
|
|
244
|
-
return (
|
|
245
|
-
<>
|
|
246
|
-
<button
|
|
247
|
-
type="button"
|
|
248
|
-
ref={layer.ref}
|
|
249
|
-
style={triggerStyle}
|
|
250
|
-
onClick={layer.isOpen ? layer.hide : layer.show}>
|
|
251
|
-
trigger
|
|
252
|
-
</button>
|
|
253
|
-
{layer.render(<span>content</span>, renderProps)}
|
|
254
|
-
</>
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
it('keeps the anchor wiring but derives no placement styles', async () => {
|
|
259
|
-
const style = await openAndGetStyle(
|
|
260
|
-
<CustomHarness
|
|
261
|
-
renderProps={{
|
|
262
|
-
positioning: 'custom',
|
|
263
|
-
style: {positionArea: 'center'},
|
|
264
|
-
}}
|
|
265
|
-
/>,
|
|
266
|
-
);
|
|
267
|
-
expect(style).toContain('position-anchor');
|
|
268
|
-
// The consumer-authored area is the only one present…
|
|
269
|
-
expect(style).toContain('position-area: center');
|
|
270
|
-
// …and no placement-derived styles leak through.
|
|
271
|
-
expect(style).not.toContain('position-try-fallbacks');
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
it('ignores placement and alignment when positioning is custom', async () => {
|
|
275
|
-
// placement/alignment are documented as ignored under custom. Derived
|
|
276
|
-
// output would be position-area "self-block-end span-self-inline-end";
|
|
277
|
-
// none of it may appear.
|
|
278
|
-
const style = await openAndGetStyle(
|
|
279
|
-
<CustomHarness
|
|
280
|
-
renderProps={{
|
|
281
|
-
positioning: 'custom',
|
|
282
|
-
placement: 'below',
|
|
283
|
-
alignment: 'start',
|
|
284
|
-
style: {positionArea: 'center'},
|
|
285
|
-
}}
|
|
286
|
-
/>,
|
|
287
|
-
);
|
|
288
|
-
expect(style).toContain('position-anchor');
|
|
289
|
-
expect(style).toContain('position-area: center');
|
|
290
|
-
expect(style).not.toContain('self-block');
|
|
291
|
-
expect(style).not.toContain('position-try-fallbacks');
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
it('emits only the anchor wiring when custom positioning passes no style at all', async () => {
|
|
295
|
-
// The strongest suppression probe: with no consumer style in the merge
|
|
296
|
-
// (Tokenizer's insets-only shape reduces to this in jsdom), nothing can
|
|
297
|
-
// clobber a leaked derived value — any position-area or try-fallbacks
|
|
298
|
-
// in the output is a genuine leak.
|
|
299
|
-
const style = await openAndGetStyle(
|
|
300
|
-
<CustomHarness renderProps={{positioning: 'custom'}} />,
|
|
301
|
-
);
|
|
302
|
-
expect(style).toContain('position-anchor');
|
|
303
|
-
expect(style).not.toContain('position-area');
|
|
304
|
-
expect(style).not.toContain('position-try-fallbacks');
|
|
305
|
-
});
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
it('fixed mode emits no anchor-positioning styles', async () => {
|
|
309
|
-
function FixedHarness() {
|
|
310
|
-
const layer = useLayer({mode: 'fixed'});
|
|
311
|
-
return (
|
|
312
|
-
<>
|
|
313
|
-
<button type="button" onClick={layer.show}>
|
|
314
|
-
opener
|
|
315
|
-
</button>
|
|
316
|
-
{layer.render(<span>content</span>, {x: 10, y: 20})}
|
|
317
|
-
</>
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
const user = userEvent.setup();
|
|
322
|
-
const {container, getByRole} = render(<FixedHarness />);
|
|
323
|
-
await user.click(getByRole('button', {name: 'opener'}));
|
|
324
|
-
|
|
325
|
-
const style =
|
|
326
|
-
container.querySelector('[popover]')?.getAttribute('style') ?? '';
|
|
327
|
-
expect(style).not.toContain('position-area');
|
|
328
|
-
expect(style).not.toContain('position-anchor');
|
|
329
|
-
});
|
|
330
|
-
});
|
package/src/Layer/useLayer.tsx
CHANGED
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
* @position Core layer utility; used by useHoverCard, useTooltip, etc.
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update:
|
|
12
|
-
* - /packages/core/src/Layer/
|
|
13
|
-
* - /packages/core/src/Layer/useLayer.test.tsx
|
|
12
|
+
* - /packages/core/src/Layer/Layer.doc.mjs
|
|
14
13
|
* - /packages/core/src/Layer/index.ts
|
|
15
14
|
*/
|
|
16
15
|
|
|
@@ -53,9 +52,7 @@ const styles = stylex.create({
|
|
|
53
52
|
});
|
|
54
53
|
|
|
55
54
|
/**
|
|
56
|
-
* Position placement relative to anchor
|
|
57
|
-
* Logical: start/end resolve against the popover's own inherited direction
|
|
58
|
-
* via CSS (RTL contexts mirror automatically, no JS involved).
|
|
55
|
+
* Position placement relative to anchor
|
|
59
56
|
*/
|
|
60
57
|
export type LayerPlacement = 'above' | 'below' | 'start' | 'end';
|
|
61
58
|
|
|
@@ -68,31 +65,7 @@ export type LayerAlignment = 'start' | 'center' | 'end';
|
|
|
68
65
|
* Render props for context mode (anchor positioning)
|
|
69
66
|
*/
|
|
70
67
|
export interface ContextRenderProps {
|
|
71
|
-
/**
|
|
72
|
-
* Who authors the layer's position styles.
|
|
73
|
-
*
|
|
74
|
-
* `'anchor'` (default): the hook derives CSS anchor-positioning styles —
|
|
75
|
-
* `position-area` and `position-try-fallbacks` — from the logical
|
|
76
|
-
* `placement`/`alignment`.
|
|
77
|
-
*
|
|
78
|
-
* `'custom'`: the consumer authors its own position styles via `style`
|
|
79
|
-
* (e.g. explicit `anchor()` insets or an `anchor-size()` cover). The hook
|
|
80
|
-
* keeps the popover behavior and the `position-anchor` wiring but emits no
|
|
81
|
-
* placement-derived styles, so direction handling becomes the consumer's
|
|
82
|
-
* responsibility. `placement`/`alignment` are ignored.
|
|
83
|
-
*
|
|
84
|
-
* @default 'anchor'
|
|
85
|
-
*/
|
|
86
|
-
positioning?: 'anchor' | 'custom';
|
|
87
|
-
/**
|
|
88
|
-
* Logical placement relative to the anchor. Ignored when `positioning`
|
|
89
|
-
* is `'custom'`.
|
|
90
|
-
*/
|
|
91
68
|
placement?: LayerPlacement;
|
|
92
|
-
/**
|
|
93
|
-
* Alignment along the placement axis. Ignored when `positioning`
|
|
94
|
-
* is `'custom'`.
|
|
95
|
-
*/
|
|
96
69
|
alignment?: LayerAlignment;
|
|
97
70
|
/**
|
|
98
71
|
* ARIA role applied to the popover container (e.g. `'tooltip'`). Lets
|
|
@@ -279,45 +252,40 @@ export interface FixedLayerReturn {
|
|
|
279
252
|
}
|
|
280
253
|
|
|
281
254
|
/**
|
|
282
|
-
* Map
|
|
283
|
-
*
|
|
284
|
-
* Uses the self-* logical keyword family: the inline axis resolves against
|
|
285
|
-
* the popover's own inherited direction (the layer renders inside the
|
|
286
|
-
* trigger's subtree, so it inherits `direction` and mirrors in RTL with no
|
|
287
|
-
* JS). The block axis is direction-neutral but must come from the same
|
|
288
|
-
* keyword family — mixing physical `top` with `self-inline-*` produces an
|
|
289
|
-
* invalid position-area (computes to `none`, which pins the popover to the
|
|
290
|
-
* viewport corner because styles.base zeroes the UA margins).
|
|
291
|
-
*
|
|
292
|
-
* Note the plain logical family (`inline-start`, no `self-`) is NOT a
|
|
293
|
-
* substitute: it resolves against the containing block — the page root for
|
|
294
|
-
* a top-layer popover — so it ignores `direction` set on a subtree, which
|
|
295
|
-
* is exactly #3389's repro.
|
|
255
|
+
* Map placement and alignment to CSS position-area value.
|
|
296
256
|
*/
|
|
297
257
|
function getPositionArea(
|
|
298
258
|
placement: LayerPlacement = 'above',
|
|
299
259
|
alignment: LayerAlignment = 'center',
|
|
300
260
|
): string {
|
|
261
|
+
const placementMap: Record<LayerPlacement, string> = {
|
|
262
|
+
above: 'top',
|
|
263
|
+
below: 'bottom',
|
|
264
|
+
start: 'left',
|
|
265
|
+
end: 'right',
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
const cssPlacement = placementMap[placement];
|
|
269
|
+
|
|
270
|
+
// For above/below, alignment is horizontal
|
|
301
271
|
if (placement === 'above' || placement === 'below') {
|
|
302
|
-
const block = placement === 'above' ? 'self-block-start' : 'self-block-end';
|
|
303
272
|
if (alignment === 'start') {
|
|
304
|
-
return `${
|
|
273
|
+
return `${cssPlacement} span-right`;
|
|
305
274
|
}
|
|
306
275
|
if (alignment === 'end') {
|
|
307
|
-
return `${
|
|
276
|
+
return `${cssPlacement} span-left`;
|
|
308
277
|
}
|
|
309
|
-
return
|
|
278
|
+
return cssPlacement; // center
|
|
310
279
|
}
|
|
311
280
|
|
|
312
|
-
|
|
313
|
-
placement === 'start' ? 'self-inline-start' : 'self-inline-end';
|
|
281
|
+
// For start/end, alignment is vertical
|
|
314
282
|
if (alignment === 'start') {
|
|
315
|
-
return `${
|
|
283
|
+
return `${cssPlacement} span-bottom`;
|
|
316
284
|
}
|
|
317
285
|
if (alignment === 'end') {
|
|
318
|
-
return `${
|
|
286
|
+
return `${cssPlacement} span-top`;
|
|
319
287
|
}
|
|
320
|
-
return
|
|
288
|
+
return `${cssPlacement} center`;
|
|
321
289
|
}
|
|
322
290
|
|
|
323
291
|
/**
|
|
@@ -353,18 +321,18 @@ export function useLayer(
|
|
|
353
321
|
const isOpenRef = useRef(false);
|
|
354
322
|
|
|
355
323
|
const show = useCallback(() => {
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
324
|
+
const el = popoverRef.current;
|
|
325
|
+
if (el && !isOpenRef.current) {
|
|
358
326
|
// Finding infra-4: the Popover API is unsupported on Safari <17 and
|
|
359
327
|
// Firefox <125. On those browsers `showPopover` does not exist, so
|
|
360
328
|
// calling it unconditionally throws a TypeError and the layer never
|
|
361
329
|
// opens. Guard behind a feature check; when the API is missing, fall
|
|
362
330
|
// back to plain visibility (the [popover] attribute is inert there, so
|
|
363
331
|
// the element sits in normal flow) so the layer still becomes visible.
|
|
364
|
-
if (typeof
|
|
365
|
-
|
|
332
|
+
if (typeof el.showPopover === 'function') {
|
|
333
|
+
el.showPopover();
|
|
366
334
|
} else {
|
|
367
|
-
|
|
335
|
+
el.style.display = 'block';
|
|
368
336
|
}
|
|
369
337
|
isOpenRef.current = true;
|
|
370
338
|
setIsOpen(true);
|
|
@@ -493,7 +461,6 @@ export function useLayer(
|
|
|
493
461
|
const {
|
|
494
462
|
placement = 'above',
|
|
495
463
|
alignment = 'center',
|
|
496
|
-
positioning = 'anchor',
|
|
497
464
|
role,
|
|
498
465
|
xstyle,
|
|
499
466
|
className: extraClassName,
|
|
@@ -504,17 +471,11 @@ export function useLayer(
|
|
|
504
471
|
} = props || {};
|
|
505
472
|
|
|
506
473
|
// CSS anchor positioning (dynamic, not in StyleX)
|
|
507
|
-
const anchorStyle: React.CSSProperties =
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
: {
|
|
513
|
-
positionAnchor: anchorId,
|
|
514
|
-
positionArea: getPositionArea(placement, alignment),
|
|
515
|
-
positionTryFallbacks:
|
|
516
|
-
'flip-block, flip-inline, flip-block flip-inline',
|
|
517
|
-
};
|
|
474
|
+
const anchorStyle: React.CSSProperties = {
|
|
475
|
+
positionAnchor: anchorId,
|
|
476
|
+
positionArea: getPositionArea(placement, alignment),
|
|
477
|
+
positionTryFallbacks: 'flip-block, flip-inline, flip-block flip-inline',
|
|
478
|
+
};
|
|
518
479
|
|
|
519
480
|
const stylexResult = stylex.props(styles.base, xstyle);
|
|
520
481
|
const combinedClassName = extraClassName
|
|
@@ -14,12 +14,6 @@ export const docs = {
|
|
|
14
14
|
type: 'ReactNode',
|
|
15
15
|
description: 'Content.',
|
|
16
16
|
},
|
|
17
|
-
{
|
|
18
|
-
name: 'padding',
|
|
19
|
-
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
20
|
-
description:
|
|
21
|
-
'Internal padding using the spacing scale. Overrides the default padding from the layout container.',
|
|
22
|
-
},
|
|
23
17
|
{
|
|
24
18
|
name: 'isScrollable',
|
|
25
19
|
type: 'boolean',
|
|
@@ -50,11 +44,6 @@ export const docsZh = {
|
|
|
50
44
|
type: 'ReactNode',
|
|
51
45
|
description: '内容。',
|
|
52
46
|
},
|
|
53
|
-
{
|
|
54
|
-
name: 'padding',
|
|
55
|
-
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
56
|
-
description: '使用间距比例的内边距。覆盖布局容器的默认内边距。',
|
|
57
|
-
},
|
|
58
47
|
{
|
|
59
48
|
name: 'isScrollable',
|
|
60
49
|
type: 'boolean',
|
|
@@ -81,7 +70,6 @@ export const docsDense = {
|
|
|
81
70
|
description: 'Scrollable main content area.',
|
|
82
71
|
propDescriptions: {
|
|
83
72
|
children: 'Content.',
|
|
84
|
-
padding: 'Internal padding on spacing scale. Overrides layout container default.',
|
|
85
73
|
isScrollable: 'Enable scrollable overflow.',
|
|
86
74
|
label: 'Accessible label for landmark element.',
|
|
87
75
|
role: 'ARIA landmark role.',
|
|
@@ -20,12 +20,6 @@ export const docs = {
|
|
|
20
20
|
description: 'Border on the appropriate edge.',
|
|
21
21
|
default: 'false',
|
|
22
22
|
},
|
|
23
|
-
{
|
|
24
|
-
name: 'padding',
|
|
25
|
-
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
26
|
-
description:
|
|
27
|
-
'Internal padding using the spacing scale. Overrides the default padding from the layout container.',
|
|
28
|
-
},
|
|
29
23
|
{
|
|
30
24
|
name: 'isScrollable',
|
|
31
25
|
type: 'boolean',
|
|
@@ -42,18 +36,6 @@ export const docs = {
|
|
|
42
36
|
type: 'AriaRole',
|
|
43
37
|
description: 'ARIA landmark role.',
|
|
44
38
|
},
|
|
45
|
-
{
|
|
46
|
-
name: 'width',
|
|
47
|
-
type: 'number | string',
|
|
48
|
-
description:
|
|
49
|
-
'Width of the panel. Numbers are treated as pixels, strings are used as-is. Ignored when resizable is provided; the hook controls width.',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'resizable',
|
|
53
|
-
type: 'ResizableProps',
|
|
54
|
-
description:
|
|
55
|
-
'Resize props from useResizable(). When provided, the hook drives the panel width and a ResizeHandle should be placed adjacent to the panel.',
|
|
56
|
-
},
|
|
57
39
|
],
|
|
58
40
|
};
|
|
59
41
|
|
|
@@ -74,11 +56,6 @@ export const docsZh = {
|
|
|
74
56
|
description: '相应边缘的边框。',
|
|
75
57
|
default: 'false',
|
|
76
58
|
},
|
|
77
|
-
{
|
|
78
|
-
name: 'padding',
|
|
79
|
-
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
80
|
-
description: '使用间距比例的内边距。覆盖布局容器的默认内边距。',
|
|
81
|
-
},
|
|
82
59
|
{
|
|
83
60
|
name: 'isScrollable',
|
|
84
61
|
type: 'boolean',
|
|
@@ -95,18 +72,6 @@ export const docsZh = {
|
|
|
95
72
|
type: 'AriaRole',
|
|
96
73
|
description: 'ARIA 地标角色。',
|
|
97
74
|
},
|
|
98
|
-
{
|
|
99
|
-
name: 'width',
|
|
100
|
-
type: 'number | string',
|
|
101
|
-
description:
|
|
102
|
-
'面板宽度。数字按像素处理,字符串按原样使用。提供 resizable 时忽略,宽度由 hook 控制。',
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
name: 'resizable',
|
|
106
|
-
type: 'ResizableProps',
|
|
107
|
-
description:
|
|
108
|
-
'来自 useResizable() 的调整大小属性。提供时面板宽度由 hook 驱动,应在面板旁放置 ResizeHandle。',
|
|
109
|
-
},
|
|
110
75
|
],
|
|
111
76
|
};
|
|
112
77
|
|
|
@@ -118,13 +83,8 @@ export const docsDense = {
|
|
|
118
83
|
propDescriptions: {
|
|
119
84
|
children: 'Panel content.',
|
|
120
85
|
hasDivider: 'Border on appropriate edge.',
|
|
121
|
-
padding: 'Internal padding on spacing scale. Overrides layout container default.',
|
|
122
86
|
isScrollable: 'Enable scrollable overflow.',
|
|
123
87
|
label: 'Accessible label for landmark element.',
|
|
124
88
|
role: 'ARIA landmark role.',
|
|
125
|
-
width:
|
|
126
|
-
'Panel width. Numbers = pixels, strings as-is. Ignored when resizable provided; hook controls width.',
|
|
127
|
-
resizable:
|
|
128
|
-
'Resize props from useResizable(). Hook drives panel width; place ResizeHandle adjacent.',
|
|
129
89
|
},
|
|
130
90
|
};
|
|
@@ -64,13 +64,8 @@ export const docs = {
|
|
|
64
64
|
{ guidance: false, description: 'Nest interactive content inside captions; keep them plain text.' },
|
|
65
65
|
],
|
|
66
66
|
},
|
|
67
|
-
// The lightbox opens via showModal() and renders nothing while closed —
|
|
68
|
-
// overlay mode gives the Properties preview an open trigger instead of an
|
|
69
|
-
// empty stage, mirroring MobileNav (#3616).
|
|
70
67
|
playground: {
|
|
71
|
-
overlay: true,
|
|
72
68
|
defaults: {
|
|
73
|
-
isOpen: false,
|
|
74
69
|
media: {
|
|
75
70
|
src: 'https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png',
|
|
76
71
|
alt: 'Coastal shoreline with ocean waves',
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
-
import {describe, it, expect, vi, beforeEach
|
|
4
|
-
import {render, screen, fireEvent
|
|
3
|
+
import {describe, it, expect, vi, beforeEach} from 'vitest';
|
|
4
|
+
import {render, screen, fireEvent} from '@testing-library/react';
|
|
5
5
|
import {Lightbox} from './Lightbox';
|
|
6
|
-
import {__resetLiveRegionsForTest} from '../hooks/useAnnounce';
|
|
7
6
|
|
|
8
7
|
// Mock showModal/close for jsdom
|
|
9
8
|
beforeEach(() => {
|
|
@@ -17,16 +16,6 @@ beforeEach(() => {
|
|
|
17
16
|
});
|
|
18
17
|
});
|
|
19
18
|
|
|
20
|
-
// useAnnounce mounts singleton live regions on <body>; reset between tests so
|
|
21
|
-
// stale announcements from one test don't leak into the next.
|
|
22
|
-
afterEach(() => {
|
|
23
|
-
__resetLiveRegionsForTest();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
function politeRegion(): HTMLElement | null {
|
|
27
|
-
return document.querySelector('[data-astryx-live-region="polite"]');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
19
|
describe('Lightbox', () => {
|
|
31
20
|
it('renders as a dialog element', () => {
|
|
32
21
|
render(
|
|
@@ -311,116 +300,6 @@ describe('Lightbox', () => {
|
|
|
311
300
|
});
|
|
312
301
|
});
|
|
313
302
|
|
|
314
|
-
describe('screen-reader announcements', () => {
|
|
315
|
-
const media = [
|
|
316
|
-
{src: '/a.jpg', alt: 'Image A', caption: 'First'},
|
|
317
|
-
{src: '/b.jpg', alt: 'Image B', caption: 'Second'},
|
|
318
|
-
{src: '/c.jpg', alt: 'Image C'},
|
|
319
|
-
];
|
|
320
|
-
|
|
321
|
-
it('announces the new image and position when navigating next via button', async () => {
|
|
322
|
-
render(
|
|
323
|
-
<Lightbox
|
|
324
|
-
isOpen={true}
|
|
325
|
-
onOpenChange={() => {}}
|
|
326
|
-
media={media}
|
|
327
|
-
defaultIndex={0}
|
|
328
|
-
/>,
|
|
329
|
-
);
|
|
330
|
-
fireEvent.click(screen.getByLabelText('Next'));
|
|
331
|
-
await waitFor(() => {
|
|
332
|
-
expect(politeRegion()).toHaveTextContent('Image B, 2 of 3');
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
it('announces the new image and position when navigating via arrow keys', async () => {
|
|
337
|
-
render(
|
|
338
|
-
<Lightbox
|
|
339
|
-
isOpen={true}
|
|
340
|
-
onOpenChange={() => {}}
|
|
341
|
-
media={media}
|
|
342
|
-
defaultIndex={1}
|
|
343
|
-
/>,
|
|
344
|
-
);
|
|
345
|
-
const dialog = document.querySelector('dialog')!;
|
|
346
|
-
fireEvent.keyDown(dialog, {key: 'ArrowRight'});
|
|
347
|
-
await waitFor(() => {
|
|
348
|
-
expect(politeRegion()).toHaveTextContent('Image C, 3 of 3');
|
|
349
|
-
});
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
it('announces the new image and position when navigating prev', async () => {
|
|
353
|
-
render(
|
|
354
|
-
<Lightbox
|
|
355
|
-
isOpen={true}
|
|
356
|
-
onOpenChange={() => {}}
|
|
357
|
-
media={media}
|
|
358
|
-
defaultIndex={2}
|
|
359
|
-
/>,
|
|
360
|
-
);
|
|
361
|
-
fireEvent.click(screen.getByLabelText('Previous'));
|
|
362
|
-
await waitFor(() => {
|
|
363
|
-
expect(politeRegion()).toHaveTextContent('Image B, 2 of 3');
|
|
364
|
-
});
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
it('falls back to a positional label when the image has no alt', async () => {
|
|
368
|
-
const unlabeled = [
|
|
369
|
-
{src: '/a.jpg', alt: 'Image A'},
|
|
370
|
-
{src: '/b.jpg', alt: ''},
|
|
371
|
-
];
|
|
372
|
-
render(
|
|
373
|
-
<Lightbox
|
|
374
|
-
isOpen={true}
|
|
375
|
-
onOpenChange={() => {}}
|
|
376
|
-
media={unlabeled}
|
|
377
|
-
defaultIndex={0}
|
|
378
|
-
/>,
|
|
379
|
-
);
|
|
380
|
-
fireEvent.click(screen.getByLabelText('Next'));
|
|
381
|
-
await waitFor(() => {
|
|
382
|
-
expect(politeRegion()).toHaveTextContent('Image 2 of 2');
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
it('does not announce on initial open', async () => {
|
|
387
|
-
render(
|
|
388
|
-
<Lightbox
|
|
389
|
-
isOpen={true}
|
|
390
|
-
onOpenChange={() => {}}
|
|
391
|
-
media={media}
|
|
392
|
-
defaultIndex={1}
|
|
393
|
-
/>,
|
|
394
|
-
);
|
|
395
|
-
// Allow any scheduled rAF to flush; nothing should have been announced.
|
|
396
|
-
await new Promise(resolve => requestAnimationFrame(() => resolve(null)));
|
|
397
|
-
// The dialog's aria-label already names the current image on open, so no
|
|
398
|
-
// live region is created (announce is never called).
|
|
399
|
-
expect(politeRegion()).toBeNull();
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
it('does not announce when the lightbox opens at a new index', async () => {
|
|
403
|
-
const {rerender} = render(
|
|
404
|
-
<Lightbox
|
|
405
|
-
isOpen={false}
|
|
406
|
-
onOpenChange={() => {}}
|
|
407
|
-
media={media}
|
|
408
|
-
index={0}
|
|
409
|
-
/>,
|
|
410
|
-
);
|
|
411
|
-
rerender(
|
|
412
|
-
<Lightbox
|
|
413
|
-
isOpen={true}
|
|
414
|
-
onOpenChange={() => {}}
|
|
415
|
-
media={media}
|
|
416
|
-
index={2}
|
|
417
|
-
/>,
|
|
418
|
-
);
|
|
419
|
-
await new Promise(resolve => requestAnimationFrame(() => resolve(null)));
|
|
420
|
-
expect(politeRegion()).toBeNull();
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
|
|
424
303
|
describe('video support', () => {
|
|
425
304
|
it('renders a video element when type is video', () => {
|
|
426
305
|
const {container} = render(
|