@astryxdesign/core 0.1.4-canary.ff77e1c → 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.d.ts +1 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +23 -26
- 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.d.ts.map +1 -1
- package/dist/Toast/useToast.js +4 -44
- 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 +59 -59
- 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/theme/useTheme.d.ts +2 -3
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +6 -73
- 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/AvatarGroup/AvatarGroup.doc.mjs +0 -1
- 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.doc.mjs +1 -1
- 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 -5
- 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/EmptyState/EmptyState.doc.mjs +1 -1
- 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.doc.mjs +0 -1
- 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/MobileNav/MobileNav.test.tsx +0 -56
- package/src/MobileNav/MobileNav.tsx +8 -13
- 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/Outline/Outline.doc.mjs +0 -2
- 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.doc.mjs +0 -2
- 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.doc.mjs +0 -5
- 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/Toast/useToast.tsx +0 -41
- 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 +2 -126
- package/src/theme/useTheme.ts +6 -87
- 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/Toast/useToast.test.tsx +0 -258
- 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/theme/themingTargets.test.ts +0 -353
- 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
|
@@ -34,7 +34,7 @@ import { mergeProps } from "../utils/index.js";
|
|
|
34
34
|
import { themeProps } from "../utils/themeProps.js";
|
|
35
35
|
|
|
36
36
|
/** Sample the region behind the remove button (20px button, 4px inset, in 64px container). */
|
|
37
|
-
import {
|
|
37
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
38
|
const BUTTON_REGION = {
|
|
39
39
|
x: 0.5,
|
|
40
40
|
y: 0.06,
|
|
@@ -77,16 +77,16 @@ const styles = {
|
|
|
77
77
|
// =============================================================================
|
|
78
78
|
|
|
79
79
|
function ImagePlaceholder() {
|
|
80
|
-
return /*#__PURE__*/
|
|
80
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
81
81
|
width: 24,
|
|
82
82
|
height: 24,
|
|
83
83
|
viewBox: "0 0 24 24",
|
|
84
84
|
fill: "currentColor",
|
|
85
85
|
"aria-hidden": "true",
|
|
86
|
-
children: /*#__PURE__*/
|
|
86
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
87
87
|
d: "M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5l3.5-5.5z"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// =============================================================================
|
|
@@ -135,27 +135,27 @@ export function Thumbnail({
|
|
|
135
135
|
const showPlaceholder = !isLoading && !hasSrc;
|
|
136
136
|
const isInteractive = onClick != null && !isDisabled && !isLoading;
|
|
137
137
|
const accessibleName = label && alt ? `${label} — ${alt}` : label ?? alt ?? 'thumbnail';
|
|
138
|
-
const imageContent = /*#__PURE__*/
|
|
139
|
-
children: [showImage && /*#__PURE__*/
|
|
138
|
+
const imageContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
139
|
+
children: [showImage && /*#__PURE__*/_jsx("img", {
|
|
140
140
|
src: src,
|
|
141
141
|
alt: alt ?? '',
|
|
142
142
|
...{
|
|
143
143
|
className: "xh8yej3 x5yr21d xl1xv1r x1lliihq"
|
|
144
144
|
}
|
|
145
|
-
}
|
|
145
|
+
}), showSkeleton && /*#__PURE__*/_jsx(Skeleton, {
|
|
146
146
|
radius: 2
|
|
147
|
-
}
|
|
147
|
+
}), showPlaceholder && /*#__PURE__*/_jsx("div", {
|
|
148
148
|
...{
|
|
149
149
|
className: "x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xv9yike"
|
|
150
150
|
},
|
|
151
|
-
children: /*#__PURE__*/
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
const removeButtonEl = onRemove != null && !isDisabled ? /*#__PURE__*/
|
|
155
|
-
icon: /*#__PURE__*/
|
|
151
|
+
children: /*#__PURE__*/_jsx(ImagePlaceholder, {})
|
|
152
|
+
})]
|
|
153
|
+
});
|
|
154
|
+
const removeButtonEl = onRemove != null && !isDisabled ? /*#__PURE__*/_jsx(Button, {
|
|
155
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
156
156
|
icon: "close",
|
|
157
157
|
size: "xsm"
|
|
158
|
-
}
|
|
158
|
+
}),
|
|
159
159
|
label: `Remove ${accessibleName}`,
|
|
160
160
|
variant: "secondary",
|
|
161
161
|
size: "sm",
|
|
@@ -165,15 +165,14 @@ export function Thumbnail({
|
|
|
165
165
|
onRemove(e);
|
|
166
166
|
},
|
|
167
167
|
xstyle: styles.removeButtonOverrides
|
|
168
|
-
}
|
|
169
|
-
const thumbnail = /*#__PURE__*/
|
|
168
|
+
}) : null;
|
|
169
|
+
const thumbnail = /*#__PURE__*/_jsx("div", {
|
|
170
170
|
ref: ref,
|
|
171
171
|
"data-testid": testId,
|
|
172
|
-
role: "group",
|
|
173
172
|
"aria-label": accessibleName,
|
|
174
173
|
...mergeProps(themeProps('thumbnail'), stylex.props(styles.root, isDisabled && styles.disabled, xstyle), className, style),
|
|
175
174
|
...props,
|
|
176
|
-
children: /*#__PURE__*/
|
|
175
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
177
176
|
...{
|
|
178
177
|
0: {
|
|
179
178
|
className: "x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c"
|
|
@@ -182,7 +181,7 @@ export function Thumbnail({
|
|
|
182
181
|
className: "x1n2onr6 xh8yej3 x1plog1 xh6dtrn xb3r6kr x17x4s8c x1ypdohk x1kx2cm7 xuedmi6 xlr8y92 x1gnnqk1 xhouywz x1hc1fzr xzomjkg x1tmayz8 x1irc7jg x1wfwxd8 xdjuwb3"
|
|
183
182
|
}
|
|
184
183
|
}[!!isInteractive << 0],
|
|
185
|
-
children: [isInteractive ? /*#__PURE__*/
|
|
184
|
+
children: [isInteractive ? /*#__PURE__*/_jsx("button", {
|
|
186
185
|
type: "button",
|
|
187
186
|
onClick: onClick,
|
|
188
187
|
"aria-label": `Open ${accessibleName}`,
|
|
@@ -190,29 +189,29 @@ export function Thumbnail({
|
|
|
190
189
|
className: "x1ypdohk x1lliihq xh8yej3 x5yr21d xh6dtrn xb3r6kr"
|
|
191
190
|
},
|
|
192
191
|
children: imageContent
|
|
193
|
-
}
|
|
192
|
+
}) : imageContent, showImage && /*#__PURE__*/_jsx("div", {
|
|
194
193
|
...{
|
|
195
194
|
className: "x10l6tqk x10a8y8t x1pjcqnp x1er153n x47corl"
|
|
196
195
|
}
|
|
197
|
-
}
|
|
196
|
+
}), showUploadOverlay && /*#__PURE__*/_jsx("div", {
|
|
198
197
|
...{
|
|
199
198
|
className: "x10l6tqk x10a8y8t x78zum5 x6s0dn4 xl56j7k x1u4601x x1pjcqnp x1vjfegm x14ju556"
|
|
200
199
|
},
|
|
201
|
-
children: /*#__PURE__*/
|
|
200
|
+
children: /*#__PURE__*/_jsx(Spinner, {
|
|
202
201
|
size: "sm",
|
|
203
202
|
shade: "onMedia"
|
|
204
|
-
}
|
|
205
|
-
}
|
|
203
|
+
})
|
|
204
|
+
}), removeButtonEl != null && imageMode != null ? /*#__PURE__*/_jsx(MediaTheme, {
|
|
206
205
|
mode: imageMode,
|
|
207
206
|
children: removeButtonEl
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
207
|
+
}) : removeButtonEl]
|
|
208
|
+
})
|
|
209
|
+
});
|
|
211
210
|
if (label != null) {
|
|
212
|
-
return /*#__PURE__*/
|
|
211
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
213
212
|
content: label,
|
|
214
213
|
children: thumbnail
|
|
215
|
-
}
|
|
214
|
+
});
|
|
216
215
|
}
|
|
217
216
|
return thumbnail;
|
|
218
217
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput.d.ts","sourceRoot":"","sources":["../../src/TimeInput/TimeInput.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAU3C,OAAO,EAEL,KAAK,WAAW,EAMjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,KAAK,aAAa,EAUnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AA4D9C,QAAA,MAAM,UAAU;;;;;;;;;;;;;EAad,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC;AAEpD,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,KAAK,CAAC;AAIhD,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,SAAS,EACT,UAAU,GAAG,cAAc,CAC5B;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;O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B,GAAG,EACH,GAAG,EACH,UAAkB,EAClB,QAAgB,EAChB,YAAoB,EACpB,UAAkB,EAClB,SAAa,EACb,WAA6B,EAC7B,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,GACJ,EAAE,cAAc,+BA8VhB;yBA1Xe,SAAS"}
|
|
@@ -30,7 +30,7 @@ import { useInputGroup } from "../InputGroup/InputGroupContext.js";
|
|
|
30
30
|
import { groupStyles } from "../InputGroup/groupStyles.js";
|
|
31
31
|
import { useTooltip } from "../Tooltip/index.js";
|
|
32
32
|
import { themeProps } from "../utils/themeProps.js";
|
|
33
|
-
import {
|
|
33
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
34
34
|
const sizeStyles = {
|
|
35
35
|
sm: {
|
|
36
36
|
kZKoxP: "x6k0iem",
|
|
@@ -281,7 +281,7 @@ export function TimeInput({
|
|
|
281
281
|
inputRef,
|
|
282
282
|
disabled: isDisabled
|
|
283
283
|
});
|
|
284
|
-
const inputWrapper = /*#__PURE__*/
|
|
284
|
+
const inputWrapper = /*#__PURE__*/_jsxs("div", {
|
|
285
285
|
ref: el => {
|
|
286
286
|
containerRef.current = el;
|
|
287
287
|
// Anchor + hover/focus listeners for the disabled-message tooltip.
|
|
@@ -295,29 +295,29 @@ export function TimeInput({
|
|
|
295
295
|
size,
|
|
296
296
|
status: status?.type ?? null
|
|
297
297
|
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], inputGroup && groupStyles.inGroup, xstyle), className, style),
|
|
298
|
-
children: [/*#__PURE__*/
|
|
298
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
299
299
|
...{
|
|
300
300
|
className: "x78zum5 x6s0dn4 xl56j7k x2lah0s"
|
|
301
301
|
},
|
|
302
|
-
children: /*#__PURE__*/
|
|
302
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
303
303
|
icon: "clock",
|
|
304
304
|
size: "sm",
|
|
305
305
|
color: "secondary"
|
|
306
|
-
}
|
|
307
|
-
}
|
|
306
|
+
})
|
|
307
|
+
}), inputGroup && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
308
308
|
id: inputLabelID,
|
|
309
309
|
children: label
|
|
310
|
-
}
|
|
310
|
+
}), inputGroup && description && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
311
311
|
as: "div",
|
|
312
312
|
id: descriptionID,
|
|
313
313
|
children: description
|
|
314
|
-
}
|
|
314
|
+
}), inputGroup && status?.message && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
315
315
|
as: "div",
|
|
316
316
|
id: statusMessageID,
|
|
317
317
|
role: status.type === 'error' ? 'alert' : 'status',
|
|
318
318
|
"aria-live": status.type === 'error' ? 'assertive' : 'polite',
|
|
319
319
|
children: status.message
|
|
320
|
-
}
|
|
320
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
321
321
|
ref: mergeRefs(ref, inputRef),
|
|
322
322
|
id: id,
|
|
323
323
|
type: "text",
|
|
@@ -338,7 +338,7 @@ export function TimeInput({
|
|
|
338
338
|
"data-autofocus": hasAutoFocus || undefined,
|
|
339
339
|
"aria-describedby": ariaDescribedBy,
|
|
340
340
|
"aria-required": isRequired === true ? 'true' : undefined,
|
|
341
|
-
"aria-invalid": status?.type === 'error'
|
|
341
|
+
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
342
342
|
"aria-busy": isBusy || undefined,
|
|
343
343
|
"aria-labelledby": ariaLabelledBy,
|
|
344
344
|
...{
|
|
@@ -355,37 +355,32 @@ export function TimeInput({
|
|
|
355
355
|
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc xv1l7n4"
|
|
356
356
|
}
|
|
357
357
|
}[!!isDisabled << 1 | !!!isInputValid << 0]
|
|
358
|
-
},
|
|
359
|
-
as: "div",
|
|
360
|
-
role: "alert",
|
|
361
|
-
"aria-live": "assertive",
|
|
362
|
-
children: !isInputValid ? 'Invalid time' : ''
|
|
363
|
-
}, void 0, false), isBusy && /*#__PURE__*/_jsxDEV(Spinner, {
|
|
358
|
+
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
364
359
|
size: "sm"
|
|
365
|
-
}
|
|
360
|
+
}), hasClear && value && !isDisabled && /*#__PURE__*/_jsx("button", {
|
|
366
361
|
type: "button",
|
|
367
362
|
onClick: handleClear,
|
|
368
363
|
"aria-label": `Clear ${label}`,
|
|
369
364
|
...{
|
|
370
365
|
className: "x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto"
|
|
371
366
|
},
|
|
372
|
-
children: /*#__PURE__*/
|
|
367
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
373
368
|
icon: "close",
|
|
374
369
|
size: "sm",
|
|
375
370
|
color: "secondary"
|
|
376
|
-
}
|
|
377
|
-
}
|
|
371
|
+
})
|
|
372
|
+
}), status && !inputGroup && /*#__PURE__*/_jsx(Icon, {
|
|
378
373
|
icon: statusIconMap[status.type],
|
|
379
374
|
size: "md",
|
|
380
375
|
color: statusIconColorMap[status.type]
|
|
381
|
-
}
|
|
382
|
-
}
|
|
376
|
+
})]
|
|
377
|
+
});
|
|
383
378
|
if (inputGroup) {
|
|
384
|
-
return /*#__PURE__*/
|
|
379
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
385
380
|
children: [inputWrapper, showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
386
|
-
}
|
|
381
|
+
});
|
|
387
382
|
}
|
|
388
|
-
return /*#__PURE__*/
|
|
383
|
+
return /*#__PURE__*/_jsxs(Field, {
|
|
389
384
|
label: label,
|
|
390
385
|
isLabelHidden: isLabelHidden,
|
|
391
386
|
description: description,
|
|
@@ -402,6 +397,6 @@ export function TimeInput({
|
|
|
402
397
|
labelTooltip: labelTooltip,
|
|
403
398
|
width: width,
|
|
404
399
|
children: [inputWrapper, showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
405
|
-
}
|
|
400
|
+
});
|
|
406
401
|
}
|
|
407
402
|
TimeInput.displayName = 'TimeInput';
|
|
@@ -77,7 +77,7 @@ export interface TimestampProps extends BaseProps<HTMLTimeElement> {
|
|
|
77
77
|
* <Timestamp value={event.timestamp} format="system_date_time" />
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
export declare function Timestamp({ value, format, autoThreshold, hasTooltip, isTimezoneShown, isLive, type, size, color, weight, xstyle, className, style, ref, 'data-testid': testId, }: TimestampProps): import("react").JSX.Element
|
|
80
|
+
export declare function Timestamp({ value, format, autoThreshold, hasTooltip, isTimezoneShown, isLive, type, size, color, weight, xstyle, className, style, ref, 'data-testid': testId, }: TimestampProps): import("react").JSX.Element;
|
|
81
81
|
export declare namespace Timestamp {
|
|
82
82
|
var displayName: string;
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timestamp.d.ts","sourceRoot":"","sources":["../../src/Timestamp/Timestamp.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAE9E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAW5C,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,MAAM,GACN,MAAM,GACN,WAAW,GACX,MAAM,GACN,aAAa,GACb,kBAAkB,GAClB,aAAa,CAAC;AAElB,MAAM,WAAW,cAAe,SAAQ,SAAS,CAAC,eAAe,CAAC;IAChE,kDAAkD;IAClD,GAAG,CAA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ClB,aAAa,CAAC;AAElB,MAAM,WAAW,cAAe,SAAQ,SAAS,CAAC,eAAe,CAAC;IAChE,kDAAkD;IAClD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC,uFAAuF;IACvF,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA8ND;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,MAAe,EACf,aAAsC,EACtC,UAAiB,EACjB,eAAuB,EACvB,MAAc,EACd,IAAmB,EACnB,IAAI,EACJ,KAAmB,EACnB,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EAAE,MAAM,GACtB,EAAE,cAAc,+BAqFhB;yBArGe,SAAS"}
|
|
@@ -20,7 +20,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
20
20
|
import { Text } from "../Text/index.js";
|
|
21
21
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
22
22
|
import { themeProps } from "../utils/themeProps.js";
|
|
23
|
-
import {
|
|
23
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
const LazyXDSTooltip = /*#__PURE__*/lazy(async () => import('../Tooltip/Tooltip').then(mod => ({
|
|
25
25
|
default: mod.Tooltip
|
|
26
26
|
})));
|
|
@@ -90,47 +90,47 @@ function getRelativeTimeString(date, now) {
|
|
|
90
90
|
return 'in a few seconds';
|
|
91
91
|
}
|
|
92
92
|
if (absDiff < HOUR) {
|
|
93
|
-
const mins = Math.
|
|
93
|
+
const mins = Math.round(absDiff / MINUTE);
|
|
94
94
|
return `in ${mins} ${mins === 1 ? 'minute' : 'minutes'}`;
|
|
95
95
|
}
|
|
96
96
|
if (absDiff < DAY) {
|
|
97
|
-
const hours = Math.
|
|
97
|
+
const hours = Math.round(absDiff / HOUR);
|
|
98
98
|
return `in ${hours} ${hours === 1 ? 'hour' : 'hours'}`;
|
|
99
99
|
}
|
|
100
100
|
if (absDiff < MONTH) {
|
|
101
|
-
const days = Math.
|
|
101
|
+
const days = Math.round(absDiff / DAY);
|
|
102
102
|
return `in ${days} ${days === 1 ? 'day' : 'days'}`;
|
|
103
103
|
}
|
|
104
104
|
if (absDiff < YEAR) {
|
|
105
|
-
const months = Math.
|
|
105
|
+
const months = Math.round(absDiff / MONTH);
|
|
106
106
|
return `in ${months} ${months === 1 ? 'month' : 'months'}`;
|
|
107
107
|
}
|
|
108
|
-
const years = Math.
|
|
108
|
+
const years = Math.round(absDiff / YEAR);
|
|
109
109
|
return `in ${years} ${years === 1 ? 'year' : 'years'}`;
|
|
110
110
|
}
|
|
111
111
|
if (diffSeconds < MINUTE) {
|
|
112
112
|
return `${diffSeconds} seconds ago`;
|
|
113
113
|
}
|
|
114
114
|
if (diffSeconds < HOUR) {
|
|
115
|
-
const mins = Math.
|
|
115
|
+
const mins = Math.round(diffSeconds / MINUTE);
|
|
116
116
|
return `${mins} ${mins === 1 ? 'minute' : 'minutes'} ago`;
|
|
117
117
|
}
|
|
118
118
|
if (diffSeconds < DAY) {
|
|
119
|
-
const hours = Math.
|
|
119
|
+
const hours = Math.round(diffSeconds / HOUR);
|
|
120
120
|
return `${hours} ${hours === 1 ? 'hour' : 'hours'} ago`;
|
|
121
121
|
}
|
|
122
122
|
if (diffSeconds < 2 * DAY) {
|
|
123
123
|
return 'yesterday';
|
|
124
124
|
}
|
|
125
125
|
if (diffSeconds < MONTH) {
|
|
126
|
-
const days = Math.
|
|
126
|
+
const days = Math.round(diffSeconds / DAY);
|
|
127
127
|
return `${days} days ago`;
|
|
128
128
|
}
|
|
129
129
|
if (diffSeconds < YEAR) {
|
|
130
|
-
const months = Math.
|
|
130
|
+
const months = Math.round(diffSeconds / MONTH);
|
|
131
131
|
return `${months} ${months === 1 ? 'month' : 'months'} ago`;
|
|
132
132
|
}
|
|
133
|
-
const years = Math.
|
|
133
|
+
const years = Math.round(diffSeconds / YEAR);
|
|
134
134
|
return `${years} ${years === 1 ? 'year' : 'years'} ago`;
|
|
135
135
|
}
|
|
136
136
|
function pad(n) {
|
|
@@ -261,26 +261,21 @@ export function Timestamp({
|
|
|
261
261
|
const timeRef = useRef(null);
|
|
262
262
|
const [now, setNow] = useState(() => new Date());
|
|
263
263
|
const date = parseValue(value);
|
|
264
|
-
|
|
265
|
-
// missing data) yields an Invalid Date, and formatting one throws "Invalid
|
|
266
|
-
// time value" — crashing the whole tree. Compute nothing from it here and
|
|
267
|
-
// bail out below (after the hooks) instead.
|
|
268
|
-
const isValidDate = !Number.isNaN(date.getTime());
|
|
269
|
-
const isoString = isValidDate ? date.toISOString() : '';
|
|
264
|
+
const isoString = date.toISOString();
|
|
270
265
|
|
|
271
266
|
// Determine effective format
|
|
272
267
|
const diffSeconds = Math.round((now.getTime() - date.getTime()) / 1000);
|
|
273
268
|
const effectiveFormat = format === 'auto' ? Math.abs(diffSeconds) <= autoThreshold ? 'relative' : 'date_time' : format;
|
|
274
269
|
|
|
275
270
|
// Format the display text
|
|
276
|
-
const displayText =
|
|
271
|
+
const displayText = effectiveFormat === 'relative' ? getRelativeTimeString(date, now) : isAbsoluteFormat(effectiveFormat) ? formatTimestamp(date, effectiveFormat, isTimezoneShown) : '';
|
|
277
272
|
|
|
278
273
|
// Full absolute text for tooltip and aria-label
|
|
279
|
-
const fullAbsoluteText =
|
|
274
|
+
const fullAbsoluteText = getFullAbsoluteString(date);
|
|
280
275
|
|
|
281
276
|
// Live updates
|
|
282
277
|
useEffect(() => {
|
|
283
|
-
if (!isLive ||
|
|
278
|
+
if (!isLive || effectiveFormat !== 'relative') {
|
|
284
279
|
return;
|
|
285
280
|
}
|
|
286
281
|
const interval = getLiveInterval(diffSeconds);
|
|
@@ -288,13 +283,7 @@ export function Timestamp({
|
|
|
288
283
|
setNow(new Date());
|
|
289
284
|
}, interval);
|
|
290
285
|
return () => clearInterval(timer);
|
|
291
|
-
}, [isLive,
|
|
292
|
-
|
|
293
|
-
// Placed after all hooks so the hook order stays stable across renders.
|
|
294
|
-
if (!isValidDate) {
|
|
295
|
-
console.warn(`Timestamp: could not parse value ${JSON.stringify(value)} as a date. Rendering nothing.`);
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
286
|
+
}, [isLive, effectiveFormat, diffSeconds]);
|
|
298
287
|
const showTooltip = hasTooltip && effectiveFormat === 'relative';
|
|
299
288
|
const timestampProps = mergeProps(themeProps('timestamp', {
|
|
300
289
|
format: effectiveFormat
|
|
@@ -302,14 +291,14 @@ export function Timestamp({
|
|
|
302
291
|
className,
|
|
303
292
|
style
|
|
304
293
|
});
|
|
305
|
-
const timeElement = /*#__PURE__*/
|
|
294
|
+
const timeElement = /*#__PURE__*/_jsx(Text, {
|
|
306
295
|
type: type,
|
|
307
296
|
size: size,
|
|
308
297
|
color: color,
|
|
309
298
|
weight: weight,
|
|
310
299
|
xstyle: xstyle,
|
|
311
300
|
...timestampProps,
|
|
312
|
-
children: /*#__PURE__*/
|
|
301
|
+
children: /*#__PURE__*/_jsx("time", {
|
|
313
302
|
ref: mergeRefs(ref, timeRef),
|
|
314
303
|
dateTime: isoString,
|
|
315
304
|
"aria-label": effectiveFormat === 'relative' ? fullAbsoluteText : undefined,
|
|
@@ -318,19 +307,19 @@ export function Timestamp({
|
|
|
318
307
|
className: "xt0psk2 xjb2p0i x1j61x8r x1qlqyl8 x15bjb6t x1heor9g x1pd3egz"
|
|
319
308
|
},
|
|
320
309
|
children: displayText
|
|
321
|
-
}
|
|
322
|
-
}
|
|
310
|
+
})
|
|
311
|
+
});
|
|
323
312
|
if (showTooltip) {
|
|
324
|
-
return /*#__PURE__*/
|
|
325
|
-
children: [timeElement, /*#__PURE__*/
|
|
313
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
314
|
+
children: [timeElement, /*#__PURE__*/_jsx(Suspense, {
|
|
326
315
|
fallback: null,
|
|
327
|
-
children: /*#__PURE__*/
|
|
316
|
+
children: /*#__PURE__*/_jsx(LazyXDSTooltip, {
|
|
328
317
|
anchorRef: timeRef,
|
|
329
318
|
content: fullAbsoluteText,
|
|
330
319
|
placement: "above"
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
320
|
+
})
|
|
321
|
+
})]
|
|
322
|
+
});
|
|
334
323
|
}
|
|
335
324
|
return timeElement;
|
|
336
325
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/Toast/Toast.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAiBrC,OAAO,KAAK,EAAC,SAAS,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAyD3D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,SAAiB,EACjB,SAAS,GACV,EAAE,UAAU,+
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/Toast/Toast.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAiBrC,OAAO,KAAK,EAAC,SAAS,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAyD3D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,SAAiB,EACjB,SAAS,GACV,EAAE,UAAU,+BAiHZ;yBAzHe,KAAK"}
|
package/dist/Toast/Toast.js
CHANGED
|
@@ -12,7 +12,7 @@ import { mergeProps } from "../utils/index.js";
|
|
|
12
12
|
import { useTheme } from "../theme/index.js";
|
|
13
13
|
import { MediaTheme } from "../theme/MediaTheme.js";
|
|
14
14
|
import { themeProps } from "../utils/themeProps.js";
|
|
15
|
-
import {
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
/**
|
|
17
17
|
* Individual toast notification.
|
|
18
18
|
*
|
|
@@ -46,14 +46,8 @@ export function Toast({
|
|
|
46
46
|
const remainingRef = useRef(autoHideDuration);
|
|
47
47
|
// Will be initialized by startTimer when actually used
|
|
48
48
|
const startTimeRef = useRef(null);
|
|
49
|
-
|
|
50
|
-
// Read onDismiss through a ref: the viewport re-creates it on every render
|
|
51
|
-
// (another toast arriving/exiting), and a startTimer that depends on it
|
|
52
|
-
// would restart — and un-pause — this toast's timer on unrelated renders.
|
|
53
|
-
const onDismissRef = useRef(onDismiss);
|
|
54
|
-
onDismissRef.current = onDismiss;
|
|
55
49
|
const startTimer = useCallback(() => {
|
|
56
|
-
if (!isAutoHide
|
|
50
|
+
if (!isAutoHide) {
|
|
57
51
|
return;
|
|
58
52
|
}
|
|
59
53
|
if (timerRef.current) {
|
|
@@ -61,9 +55,9 @@ export function Toast({
|
|
|
61
55
|
}
|
|
62
56
|
startTimeRef.current = Date.now();
|
|
63
57
|
timerRef.current = setTimeout(() => {
|
|
64
|
-
|
|
58
|
+
onDismiss('auto');
|
|
65
59
|
}, remainingRef.current);
|
|
66
|
-
}, [isAutoHide]);
|
|
60
|
+
}, [isAutoHide, onDismiss]);
|
|
67
61
|
const pauseTimer = useCallback(() => {
|
|
68
62
|
if (!isAutoHide || isPausedRef.current) {
|
|
69
63
|
return;
|
|
@@ -93,8 +87,6 @@ export function Toast({
|
|
|
93
87
|
clearTimeout(timerRef.current);
|
|
94
88
|
}
|
|
95
89
|
};
|
|
96
|
-
// startTimer's identity is stable per isAutoHide, so this runs on mount
|
|
97
|
-
// and on a genuine duration change — not on unrelated viewport renders.
|
|
98
90
|
}, [autoHideDuration, startTimer]);
|
|
99
91
|
|
|
100
92
|
// Pause the auto-hide timer while the window is not focused, so a toast
|
|
@@ -120,7 +112,7 @@ export function Toast({
|
|
|
120
112
|
mode
|
|
121
113
|
} = useTheme();
|
|
122
114
|
const mediaMode = isError || mode === 'light' ? 'dark' : 'light';
|
|
123
|
-
return /*#__PURE__*/
|
|
115
|
+
return /*#__PURE__*/_jsx("div", {
|
|
124
116
|
role: isError ? 'alert' : 'status',
|
|
125
117
|
"aria-live": isError ? 'assertive' : 'polite',
|
|
126
118
|
"aria-atomic": "true",
|
|
@@ -144,36 +136,36 @@ export function Toast({
|
|
|
144
136
|
className: "x1na6nto x1pzlopt x1hviunn x1l2rt3b xxtfdz8 x14hfi27 x9ynric xjm74w1 xw6l6zx x6o7n8i xuedmi6 xsagj69 xlr8y92 x4itv7f x1tswlu5 x1l5t2a3 xg01cxk x1lm5u"
|
|
145
137
|
}
|
|
146
138
|
}[!!isError << 1 | !!isExiting << 0]),
|
|
147
|
-
children: /*#__PURE__*/
|
|
139
|
+
children: /*#__PURE__*/_jsx(MediaTheme, {
|
|
148
140
|
mode: mediaMode,
|
|
149
|
-
children: /*#__PURE__*/
|
|
141
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
150
142
|
...{
|
|
151
143
|
className: "x78zum5 x1cy8zhl xjcht0a xh8yej3"
|
|
152
144
|
},
|
|
153
|
-
children: [/*#__PURE__*/
|
|
145
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
154
146
|
...{
|
|
155
147
|
className: "x98rzlu xeuugli"
|
|
156
148
|
},
|
|
157
149
|
children: body
|
|
158
|
-
}
|
|
150
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
159
151
|
...{
|
|
160
152
|
className: "x2lah0s x78zum5 x6s0dn4 x1txdalj xacfrgf xmequkd"
|
|
161
153
|
},
|
|
162
|
-
children: [endContent, /*#__PURE__*/
|
|
154
|
+
children: [endContent, /*#__PURE__*/_jsx(Button, {
|
|
163
155
|
variant: "ghost",
|
|
164
156
|
size: "sm",
|
|
165
|
-
icon: /*#__PURE__*/
|
|
157
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
166
158
|
icon: "close",
|
|
167
159
|
size: "sm",
|
|
168
160
|
color: "inherit"
|
|
169
|
-
}
|
|
161
|
+
}),
|
|
170
162
|
label: "Dismiss notification",
|
|
171
163
|
onClick: handleDismiss,
|
|
172
164
|
isIconOnly: true
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
165
|
+
})]
|
|
166
|
+
})]
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
});
|
|
178
170
|
}
|
|
179
171
|
Toast.displayName = 'Toast';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastViewport.d.ts","sourceRoot":"","sources":["../../src/Toast/ToastViewport.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAa,aAAa,EAAqB,MAAM,SAAS,CAAC;AA2D3E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACtE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAsB,EACtB,UAAc,EACd,KAAK,EACL,UAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,+
|
|
1
|
+
{"version":3,"file":"ToastViewport.d.ts","sourceRoot":"","sources":["../../src/Toast/ToastViewport.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAa,aAAa,EAAqB,MAAM,SAAS,CAAC;AA2D3E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACtE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAsB,EACtB,UAAc,EACd,KAAK,EACL,UAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,+BAqSpB;yBA3Se,aAAa"}
|
|
@@ -10,7 +10,7 @@ import { mergeProps } from "../utils/index.js";
|
|
|
10
10
|
import { INTERACTIVE_SELECTORS } from "../hooks/useClickableContainer.js";
|
|
11
11
|
import { Toast } from "./Toast.js";
|
|
12
12
|
import { ToastContext } from "./ToastContext.js";
|
|
13
|
-
import {
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const styles = {
|
|
15
15
|
viewport: {
|
|
16
16
|
kVAEAm: "xixxii4",
|
|
@@ -78,9 +78,6 @@ export function ToastViewport({
|
|
|
78
78
|
|
|
79
79
|
// Show the popover on mount so it enters the top layer.
|
|
80
80
|
const viewportRef = useRef(null);
|
|
81
|
-
// Toast ids whose exit has begun — guards onHide from double-firing (see
|
|
82
|
-
// removeToast). Mirrors exitingIds state, readable synchronously.
|
|
83
|
-
const exitingIdsRef = useRef(new Set());
|
|
84
81
|
// The element that was focused before the user jumped into the viewport
|
|
85
82
|
// (via F6). Used to restore focus once all toasts are dismissed so focus
|
|
86
83
|
// never falls to <body>.
|
|
@@ -130,14 +127,6 @@ export function ToastViewport({
|
|
|
130
127
|
});
|
|
131
128
|
}, []);
|
|
132
129
|
const removeToast = useCallback((id, reason) => {
|
|
133
|
-
// An exiting toast stays in toastsRef until its exit transition ends, so
|
|
134
|
-
// a second dismissal inside that window (double-click, auto-timer plus
|
|
135
|
-
// manual dismiss()) would re-fire onHide. Track exiting ids in a ref —
|
|
136
|
-
// the exitingIds state dedupe below runs too late to protect onHide.
|
|
137
|
-
if (exitingIdsRef.current.has(id)) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
exitingIdsRef.current.add(id);
|
|
141
130
|
const entry = toastsRef.current.find(t => t.id === id);
|
|
142
131
|
if (entry) {
|
|
143
132
|
entry.options.onHide?.(reason);
|
|
@@ -169,7 +158,6 @@ export function ToastViewport({
|
|
|
169
158
|
});
|
|
170
159
|
}, []);
|
|
171
160
|
const handleExited = useCallback(id => {
|
|
172
|
-
exitingIdsRef.current.delete(id);
|
|
173
161
|
setExitingIds(prev => {
|
|
174
162
|
if (!prev.has(id)) {
|
|
175
163
|
return prev;
|
|
@@ -292,9 +280,9 @@ export function ToastViewport({
|
|
|
292
280
|
};
|
|
293
281
|
}, [hasToasts, getFocusable]);
|
|
294
282
|
const posStyle = position === 'topEnd' ? styles.topEnd : position === 'topStart' ? styles.topStart : position === 'bottomStart' ? styles.bottomStart : styles.bottomEnd;
|
|
295
|
-
return /*#__PURE__*/
|
|
283
|
+
return /*#__PURE__*/_jsxs(ToastContext, {
|
|
296
284
|
value: contextValue,
|
|
297
|
-
children: [children, /*#__PURE__*/
|
|
285
|
+
children: [children, /*#__PURE__*/_jsx("div", {
|
|
298
286
|
ref: viewportRef,
|
|
299
287
|
role: "region",
|
|
300
288
|
"aria-label": "Notifications",
|
|
@@ -312,7 +300,7 @@ export function ToastViewport({
|
|
|
312
300
|
const isAutoHide = o.isAutoHide ?? (type === 'error' ? false : true);
|
|
313
301
|
const dur = o.autoHideDuration ?? 5000;
|
|
314
302
|
const isExiting = exitingIds.has(entry.id);
|
|
315
|
-
return /*#__PURE__*/
|
|
303
|
+
return /*#__PURE__*/_jsx("div", {
|
|
316
304
|
"data-toast-id": entry.id,
|
|
317
305
|
...{
|
|
318
306
|
0: {
|
|
@@ -327,11 +315,11 @@ export function ToastViewport({
|
|
|
327
315
|
handleExited(entry.id);
|
|
328
316
|
}
|
|
329
317
|
} : undefined,
|
|
330
|
-
children: /*#__PURE__*/
|
|
318
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
331
319
|
...{
|
|
332
320
|
className: "xb3r6kr"
|
|
333
321
|
},
|
|
334
|
-
children: /*#__PURE__*/
|
|
322
|
+
children: /*#__PURE__*/_jsx(Toast, {
|
|
335
323
|
type: type,
|
|
336
324
|
body: o.body,
|
|
337
325
|
endContent: o.endContent,
|
|
@@ -339,11 +327,11 @@ export function ToastViewport({
|
|
|
339
327
|
autoHideDuration: dur,
|
|
340
328
|
isExiting: isExiting,
|
|
341
329
|
onDismiss: reason => removeToast(entry.id, reason)
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}, entry.id
|
|
330
|
+
})
|
|
331
|
+
})
|
|
332
|
+
}, entry.id);
|
|
345
333
|
})
|
|
346
|
-
}
|
|
347
|
-
}
|
|
334
|
+
})]
|
|
335
|
+
});
|
|
348
336
|
}
|
|
349
337
|
ToastViewport.displayName = 'ToastViewport';
|