@astryxdesign/core 0.1.5 → 0.1.6-canary.02f2602
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/CHANGELOG.md +24 -0
- package/README.md +2 -0
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +21 -18
- package/dist/AlertDialog/useImperativeAlertDialog.d.ts +0 -2
- package/dist/AlertDialog/useImperativeAlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/useImperativeAlertDialog.js +3 -5
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +55 -53
- package/dist/AspectRatio/AspectRatio.js +5 -5
- package/dist/Avatar/Avatar.js +19 -19
- package/dist/Avatar/AvatarStatusDot.js +5 -5
- package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +9 -6
- 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 +32 -30
- package/dist/Blockquote/Blockquote.js +7 -7
- package/dist/Breadcrumbs/BreadcrumbItem.js +17 -17
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +11 -8
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +53 -23
- package/dist/ButtonGroup/ButtonGroup.d.ts +20 -5
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +34 -18
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +51 -48
- package/dist/Card/Card.js +3 -3
- package/dist/Carousel/Carousel.d.ts +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +27 -24
- package/dist/Center/Center.js +3 -3
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +27 -24
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +23 -16
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +20 -16
- package/dist/Chat/ChatDictationButton.js +10 -10
- package/dist/Chat/ChatLayout.d.ts +1 -11
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +23 -21
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +13 -11
- package/dist/Chat/ChatMessage.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +20 -14
- package/dist/Chat/ChatMessageBubble.d.ts +1 -1
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +10 -8
- package/dist/Chat/ChatMessageList.d.ts +1 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +17 -15
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +24 -19
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +16 -14
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +6 -4
- package/dist/Chat/ChatSystemMessage.js +11 -11
- package/dist/Chat/ChatTokenizedText.js +8 -8
- package/dist/Chat/ChatToolCalls.js +73 -73
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +4 -2
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +19 -17
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +26 -24
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +12 -10
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +8 -6
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +20 -12
- package/dist/ClickableCard/ClickableCard.js +6 -6
- package/dist/Code/Code.js +3 -3
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +114 -96
- package/dist/Collapsible/Collapsible.js +11 -11
- package/dist/Collapsible/CollapsibleGroup.js +7 -7
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +39 -34
- 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.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +17 -14
- package/dist/CommandPalette/CommandPaletteItem.js +3 -3
- package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +7 -4
- package/dist/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +14 -11
- package/dist/DateInput/DateInput.d.ts +1 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +28 -23
- package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +32 -27
- package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +41 -33
- package/dist/Dialog/Dialog.js +9 -9
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +20 -18
- package/dist/Dialog/useImperativeDialog.js +3 -3
- package/dist/Divider/Divider.js +7 -7
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +21 -15
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -3
- package/dist/DropdownMenu/renderDropdownItems.js +10 -10
- package/dist/EmptyState/EmptyState.d.ts +4 -1
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +34 -30
- package/dist/FormLayout/FormLayout.js +5 -5
- package/dist/Grid/Grid.js +3 -3
- 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.js +3 -3
- package/dist/Icon/Icon.js +11 -11
- package/dist/Icon/defaultIcons.js +116 -116
- package/dist/IconButton/IconButton.js +3 -3
- package/dist/InputGroup/InputGroup.js +9 -9
- package/dist/InputGroup/InputGroupText.js +3 -3
- package/dist/Item/Item.js +17 -17
- package/dist/Kbd/Kbd.js +5 -5
- package/dist/Layer/LayerProvider.js +7 -7
- package/dist/Layer/useLayer.js +5 -5
- 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 +35 -33
- package/dist/Lightbox/useLightbox.d.ts +0 -1
- package/dist/Lightbox/useLightbox.d.ts.map +1 -1
- package/dist/Lightbox/useLightbox.js +3 -4
- package/dist/Link/Link.d.ts +5 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +47 -18
- 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 +111 -109
- package/dist/MetadataList/MetadataList.js +10 -10
- package/dist/MetadataList/MetadataListItem.js +15 -15
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +19 -17
- package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +9 -6
- package/dist/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +7 -4
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +69 -62
- 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 +21 -17
- package/dist/Outline/Outline.d.ts +1 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +19 -16
- 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.d.ts +0 -3
- package/dist/Overlay/useOverlay.d.ts.map +1 -1
- package/dist/Overlay/useOverlay.js +3 -6
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +73 -46
- package/dist/Popover/Popover.js +16 -16
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +11 -8
- package/dist/PowerSearch/PowerSearch.d.ts +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +95 -85
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +109 -103
- package/dist/PowerSearch/PowerSearchFilterEditor.js +3 -3
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +12 -8
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +88 -75
- package/dist/PowerSearch/formatFilterValue.d.ts +2 -1
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +19 -9
- package/dist/PowerSearch/index.d.ts +2 -1
- package/dist/PowerSearch/index.d.ts.map +1 -1
- package/dist/PowerSearch/index.js +1 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts +23 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts.map +1 -0
- package/dist/PowerSearch/resolveOperatorLabel.js +28 -0
- package/dist/PowerSearch/types.d.ts +28 -2
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.js +27 -27
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.js +15 -8
- package/dist/ProgressBar/ProgressBar.js +13 -13
- package/dist/RadioList/RadioList.js +7 -7
- package/dist/RadioList/RadioListItem.js +18 -18
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +10 -7
- package/dist/Section/Section.js +5 -5
- package/dist/SegmentedControl/SegmentedControl.js +5 -5
- package/dist/SegmentedControl/SegmentedControlItem.js +7 -7
- package/dist/SelectableCard/SelectableCard.js +5 -5
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +57 -51
- package/dist/Selector/SelectorOption.js +3 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +38 -36
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +8 -6
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +92 -90
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +49 -43
- package/dist/SideNav/SideNavSection.js +14 -14
- 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.map +1 -1
- package/dist/Switch/Switch.js +29 -27
- package/dist/TabList/Tab.js +18 -18
- package/dist/TabList/TabList.d.ts +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +9 -6
- package/dist/TabList/TabMenu.js +23 -23
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +39 -37
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +10 -8
- package/dist/Table/TableBody.js +3 -3
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableFooter.js +3 -3
- package/dist/Table/TableHeader.js +3 -3
- package/dist/Table/TableHeaderCell.js +3 -3
- package/dist/Table/TableRow.js +5 -5
- package/dist/Table/index.d.ts +4 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +2 -0
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +9 -9
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +127 -90
- package/dist/Table/plugins/groupedRows/index.d.ts +3 -0
- package/dist/Table/plugins/groupedRows/index.d.ts.map +1 -0
- package/dist/Table/plugins/groupedRows/index.js +3 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +78 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +257 -0
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +12 -9
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +30 -28
- package/dist/Table/plugins/rowIndex/index.d.ts +3 -0
- package/dist/Table/plugins/rowIndex/index.d.ts.map +1 -0
- package/dist/Table/plugins/rowIndex/index.js +3 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +50 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +91 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +23 -20
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +23 -21
- 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.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +20 -16
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +37 -31
- package/dist/TimeInput/TimeInput.d.ts +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +28 -23
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +29 -14
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +17 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +14 -12
- 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.d.ts.map +1 -1
- package/dist/Token/Token.js +29 -23
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +33 -31
- package/dist/Toolbar/Toolbar.js +18 -18
- package/dist/Tooltip/Tooltip.js +11 -11
- package/dist/Tooltip/useTooltip.js +3 -3
- package/dist/TopNav/TopNav.d.ts +2 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +36 -33
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +72 -70
- package/dist/TopNav/TopNavItem.js +5 -5
- package/dist/TopNav/TopNavMegaMenu.js +30 -30
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +10 -10
- package/dist/TopNav/TopNavMegaMenuItem.js +16 -16
- package/dist/TopNav/TopNavMenu.js +32 -32
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +13 -9
- package/dist/TreeList/TreeListBranches.js +11 -11
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +37 -31
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +26 -22
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +15 -13
- package/dist/Typeahead/TypeaheadItem.js +10 -10
- package/dist/VStack/VStack.js +3 -3
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -3
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -3
- package/dist/astryx.css +20 -2
- package/dist/astryx.umd.js +66 -64
- package/dist/astryx.umd.js.map +4 -4
- package/dist/authoring/doc.d.ts +145 -0
- package/dist/authoring/doc.d.ts.map +1 -0
- package/dist/authoring/doc.js +100 -0
- package/dist/authoring/index.d.ts +29 -0
- package/dist/authoring/index.d.ts.map +1 -0
- package/dist/authoring/index.js +28 -0
- package/dist/authoring/integration.d.ts +35 -0
- package/dist/authoring/integration.d.ts.map +1 -0
- package/dist/authoring/integration.js +30 -0
- package/dist/authoring/template.d.ts +66 -0
- package/dist/authoring/template.d.ts.map +1 -0
- package/dist/authoring/template.js +55 -0
- package/dist/config.d.ts +80 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +40 -0
- package/dist/hooks/useKeyboardHint.js +9 -9
- package/dist/i18n/InternationalizationContext.d.ts +12 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -0
- package/dist/i18n/InternationalizationContext.js +29 -0
- package/dist/i18n/InternationalizationProvider.d.ts +62 -0
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -0
- package/dist/i18n/InternationalizationProvider.js +44 -0
- package/dist/i18n/index.d.ts +24 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +21 -0
- package/dist/i18n/resolve.d.ts +22 -0
- package/dist/i18n/resolve.d.ts.map +1 -0
- package/dist/i18n/resolve.js +141 -0
- package/dist/i18n/translator.d.ts +25 -0
- package/dist/i18n/translator.d.ts.map +1 -0
- package/dist/i18n/translator.js +1 -0
- package/dist/i18n/types.d.ts +47 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +1 -0
- package/dist/i18n/useTranslator.d.ts +15 -0
- package/dist/i18n/useTranslator.d.ts.map +1 -0
- package/dist/i18n/useTranslator.js +39 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/theme/MediaTheme.js +3 -3
- package/dist/theme/Theme.js +7 -7
- package/dist/theme/syntax/SyntaxTheme.js +5 -5
- package/locales/en.json +746 -0
- package/locales/pseudo.json +560 -0
- package/package.json +24 -3
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -0
- package/src/AlertDialog/AlertDialog.tsx +4 -1
- package/src/AlertDialog/useImperativeAlertDialog.tsx +0 -2
- package/src/AppShell/AppShell.doc.mjs +8 -2
- package/src/AppShell/AppShell.tsx +3 -1
- package/src/AvatarGroup/AvatarGroup.tsx +4 -1
- package/src/Banner/Banner.tsx +10 -5
- package/src/Breadcrumbs/Breadcrumbs.tsx +4 -1
- package/src/Button/Button.tsx +34 -4
- package/src/ButtonGroup/ButtonGroup.test.tsx +386 -2
- package/src/ButtonGroup/ButtonGroup.tsx +27 -11
- package/src/Calendar/Calendar.tsx +8 -5
- package/src/Card/Card.doc.mjs +3 -3
- package/src/Carousel/Carousel.tsx +10 -7
- package/src/Chat/ChatComposer.tsx +5 -1
- package/src/Chat/ChatComposerDrawer.tsx +9 -2
- package/src/Chat/ChatComposerInput.tsx +10 -4
- package/src/Chat/ChatLayout.tsx +5 -12
- package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
- package/src/Chat/ChatMessage.tsx +5 -1
- package/src/Chat/ChatMessageBubble.tsx +2 -0
- package/src/Chat/ChatMessageList.doc.mjs +1 -1
- package/src/Chat/ChatMessageList.tsx +2 -0
- package/src/Chat/ChatMessageMetadata.tsx +15 -9
- package/src/Chat/ChatPastedTextToken.tsx +3 -1
- package/src/Chat/ChatSendButton.tsx +3 -1
- package/src/Chat/ChatToolCalls.doc.mjs +1 -1
- package/src/Chat/useSpeechRecognition.ts +11 -2
- package/src/Chat/useTriggerMenu.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.test.tsx +16 -0
- package/src/CheckboxInput/CheckboxInput.tsx +4 -2
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -1
- package/src/CheckboxList/CheckboxList.tsx +2 -0
- package/src/CheckboxList/CheckboxListItem.tsx +7 -1
- package/src/Citation/Citation.tsx +4 -2
- package/src/ClickableCard/ClickableCard.doc.mjs +1 -1
- package/src/CodeBlock/CodeBlock.tsx +91 -40
- package/src/Collapsible/Collapsible.doc.mjs +3 -3
- package/src/CommandPalette/CommandPalette.tsx +10 -3
- package/src/CommandPalette/CommandPaletteInput.test.tsx +1 -1
- package/src/CommandPalette/CommandPaletteInput.tsx +5 -1
- package/src/CommandPalette/CommandPaletteList.tsx +4 -1
- package/src/ContextMenu/ContextMenu.tsx +4 -1
- package/src/DateInput/DateInput.doc.mjs +2 -2
- package/src/DateInput/DateInput.tsx +13 -5
- package/src/DateRangeInput/DateRangeInput.doc.mjs +7 -7
- package/src/DateRangeInput/DateRangeInput.tsx +14 -6
- package/src/DateTimeInput/DateTimeInput.doc.mjs +2 -2
- package/src/DateTimeInput/DateTimeInput.tsx +17 -7
- package/src/Dialog/DialogHeader.tsx +4 -2
- package/src/DropdownMenu/DropdownMenu.tsx +12 -8
- package/src/EmptyState/EmptyState.doc.mjs +3 -3
- package/src/EmptyState/EmptyState.tsx +4 -1
- package/src/Field/Field.doc.mjs +2 -2
- package/src/FileInput/FileInput.tsx +3 -1
- package/src/Grid/Grid.doc.mjs +5 -5
- package/src/InputGroup/InputGroup.doc.mjs +1 -1
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Lightbox/Lightbox.doc.mjs +7 -2
- package/src/Lightbox/Lightbox.tsx +6 -4
- package/src/Lightbox/useLightbox.tsx +0 -1
- package/src/Link/Link.test.tsx +74 -2
- package/src/Link/Link.tsx +48 -3
- package/src/Markdown/Markdown.tsx +12 -4
- package/src/MobileNav/MobileNav.tsx +4 -2
- package/src/MobileNav/MobileNavToggle.tsx +5 -3
- package/src/MoreMenu/MoreMenu.tsx +4 -1
- package/src/MultiSelector/MultiSelector.tsx +14 -5
- package/src/NumberInput/NumberInput.tsx +3 -1
- package/src/Outline/Outline.tsx +4 -1
- package/src/OverflowList/OverflowList.doc.mjs +2 -2
- package/src/Overlay/useOverlay.tsx +0 -3
- package/src/Pagination/Pagination.tsx +35 -12
- package/src/Popover/usePopover.tsx +6 -1
- package/src/PowerSearch/PowerSearch.doc.mjs +9 -4
- package/src/PowerSearch/PowerSearch.tsx +22 -10
- package/src/PowerSearch/PowerSearchEditPopover.tsx +27 -20
- package/src/PowerSearch/PowerSearchToken.tsx +17 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +34 -21
- package/src/PowerSearch/formatFilterValue.test.ts +282 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -8
- package/src/PowerSearch/index.ts +5 -0
- package/src/PowerSearch/resolveOperatorLabel.ts +34 -0
- package/src/PowerSearch/types.ts +33 -9
- package/src/PowerSearch/usePowerSearchConfig.ts +59 -27
- package/src/PowerSearch/usePowerSearchSource.ts +17 -8
- package/src/RadioList/RadioList.doc.mjs +1 -1
- package/src/Resizable/ResizeHandle.tsx +4 -1
- package/src/Section/Section.doc.mjs +4 -4
- package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
- package/src/Selector/Selector.tsx +11 -6
- package/src/SideNav/SideNav.tsx +4 -2
- package/src/SideNav/SideNavCollapseButton.tsx +3 -1
- package/src/SideNav/SideNavHeading.tsx +5 -3
- package/src/SideNav/SideNavItem.tsx +3 -1
- package/src/Slider/Slider.doc.mjs +2 -2
- package/src/Stack/Stack.doc.mjs +10 -10
- package/src/Switch/Switch.doc.mjs +2 -2
- package/src/Switch/Switch.test.tsx +16 -0
- package/src/Switch/Switch.tsx +4 -2
- package/src/TabList/TabList.tsx +4 -1
- package/src/Table/BaseTable.tsx +8 -1
- package/src/Table/Table.doc.mjs +1 -1
- package/src/Table/Table.tsx +3 -1
- package/src/Table/index.ts +7 -0
- package/src/Table/plugins/filtering/useTableFiltering.tsx +31 -30
- package/src/Table/plugins/groupedRows/index.ts +7 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +231 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +351 -0
- package/src/Table/plugins/pagination/useTablePagination.tsx +4 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +8 -4
- package/src/Table/plugins/rowIndex/index.ts +4 -0
- package/src/Table/plugins/rowIndex/useTableRowIndex.test.tsx +132 -0
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +114 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +6 -7
- package/src/Table/plugins/sortable/useTableSortable.tsx +8 -5
- package/src/Table/useTableFiltering.doc.mjs +2 -2
- package/src/Table/useTableGroupedRows.doc.mjs +71 -0
- package/src/Table/useTableRowIndex.doc.mjs +50 -0
- package/src/Table/useTableSortable.doc.mjs +11 -11
- package/src/Text/Text.doc.mjs +2 -2
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/Thumbnail/Thumbnail.tsx +4 -2
- package/src/TimeInput/TimeInput.doc.mjs +2 -2
- package/src/TimeInput/TimeInput.tsx +6 -2
- package/src/Timestamp/Timestamp.doc.mjs +4 -4
- package/src/Timestamp/Timestamp.test.tsx +120 -7
- package/src/Timestamp/Timestamp.tsx +21 -1
- package/src/Toast/Toast.tsx +3 -1
- package/src/Toast/ToastViewport.tsx +3 -1
- package/src/Token/Token.tsx +4 -2
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
- package/src/Tokenizer/Tokenizer.tsx +4 -4
- package/src/Toolbar/Toolbar.doc.mjs +1 -1
- package/src/TopNav/TopNav.doc.mjs +1 -0
- package/src/TopNav/TopNav.test.tsx +30 -0
- package/src/TopNav/TopNav.tsx +6 -4
- package/src/TopNav/TopNavHeading.tsx +5 -3
- package/src/TreeList/TreeList.tsx +5 -1
- package/src/TreeList/TreeListItem.tsx +6 -1
- package/src/Typeahead/BaseTypeahead.tsx +11 -4
- package/src/Typeahead/Typeahead.doc.mjs +1 -1
- package/src/Typeahead/Typeahead.tsx +3 -1
- package/src/VisuallyHidden/VisuallyHidden.tsx +1 -3
- package/src/authoring/doc.ts +166 -0
- package/src/authoring/index.test.ts +52 -0
- package/src/authoring/index.ts +50 -0
- package/src/authoring/integration.ts +42 -0
- package/src/authoring/template.ts +74 -0
- package/src/config.test.ts +16 -0
- package/src/config.ts +92 -0
- package/src/docPropLiterals.test.ts +902 -0
- package/src/hooks/useHotkeys.doc.mjs +5 -5
- package/src/i18n/InternationalizationContext.ts +39 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +72 -0
- package/src/i18n/InternationalizationProvider.tsx +83 -0
- package/src/i18n/__tests__/e2e-pagination.test.tsx +172 -0
- package/src/i18n/__tests__/e2e-powersearch.test.tsx +130 -0
- package/src/i18n/__tests__/resolve.test.ts +284 -0
- package/src/i18n/index.ts +32 -0
- package/src/i18n/resolve.ts +165 -0
- package/src/i18n/translator.ts +31 -0
- package/src/i18n/types.ts +53 -0
- package/src/i18n/useTranslator.doc.mjs +46 -0
- package/src/i18n/useTranslator.ts +50 -0
- package/src/index.ts +3 -0
- package/dist/NavItem/index.d.ts +0 -9
- package/dist/NavItem/index.d.ts.map +0 -1
- package/dist/NavItem/index.js +0 -10
- package/src/NavItem/index.ts +0 -11
|
@@ -33,6 +33,7 @@ import { Citation } from "../Citation/Citation.js";
|
|
|
33
33
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
34
34
|
import { parseInline, parseMarkdown, parseMarkdownIncremental, createIncrementalState, trimStreamingArtifacts } from "./parser.js";
|
|
35
35
|
import { themeProps } from "../utils/themeProps.js";
|
|
36
|
+
import { useTranslator } from "../i18n/index.js";
|
|
36
37
|
|
|
37
38
|
// ---------------------------------------------------------------------------
|
|
38
39
|
// Props
|
|
@@ -54,7 +55,7 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
54
55
|
* When `sources` is provided, bracket content matching a source key is rendered
|
|
55
56
|
* as a compact superscript citation pill instead of plain text.
|
|
56
57
|
*/
|
|
57
|
-
import {
|
|
58
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
58
59
|
// ---------------------------------------------------------------------------
|
|
59
60
|
// Styles
|
|
60
61
|
// ---------------------------------------------------------------------------
|
|
@@ -533,17 +534,17 @@ function wrapTextWithFade(content, cursor, key) {
|
|
|
533
534
|
if (segments == null) {
|
|
534
535
|
return content;
|
|
535
536
|
}
|
|
536
|
-
const nodes = segments.map(seg => seg.fading ? /*#__PURE__*/
|
|
537
|
+
const nodes = segments.map(seg => seg.fading ? /*#__PURE__*/_jsx("span", {
|
|
537
538
|
...{
|
|
538
539
|
className: "x1hc1fzr x19991ni x80gvsz x12w9bfk xlr8y92 x4itv7f"
|
|
539
540
|
},
|
|
540
541
|
children: seg.text
|
|
541
|
-
}, seg.key
|
|
542
|
+
}, seg.key) : /*#__PURE__*/_jsx("span", {
|
|
542
543
|
children: seg.text
|
|
543
|
-
}, seg.key
|
|
544
|
-
return /*#__PURE__*/
|
|
544
|
+
}, seg.key));
|
|
545
|
+
return /*#__PURE__*/_jsx("span", {
|
|
545
546
|
children: nodes
|
|
546
|
-
}, `wrap-${key}
|
|
547
|
+
}, `wrap-${key}`);
|
|
547
548
|
}
|
|
548
549
|
|
|
549
550
|
/**
|
|
@@ -577,46 +578,46 @@ function renderInline(node, index, onLinkClick, cursor, citationCtx, linkCompone
|
|
|
577
578
|
} else {
|
|
578
579
|
// Plugin segment — advance cursor by matchLength
|
|
579
580
|
cursor.offset += seg.matchLength;
|
|
580
|
-
result.push(/*#__PURE__*/
|
|
581
|
+
result.push(/*#__PURE__*/_jsx(Fragment, {
|
|
581
582
|
children: seg.element
|
|
582
|
-
}, `plugin-${index}-${i}
|
|
583
|
+
}, `plugin-${index}-${i}`));
|
|
583
584
|
}
|
|
584
585
|
}
|
|
585
|
-
return /*#__PURE__*/
|
|
586
|
+
return /*#__PURE__*/_jsx(Fragment, {
|
|
586
587
|
children: result
|
|
587
|
-
}, index
|
|
588
|
+
}, index);
|
|
588
589
|
}
|
|
589
590
|
}
|
|
590
591
|
return wrapTextWithFade(node.content, cursor, index);
|
|
591
592
|
}
|
|
592
593
|
case 'bold':
|
|
593
|
-
return /*#__PURE__*/
|
|
594
|
+
return /*#__PURE__*/_jsx("strong", {
|
|
594
595
|
...{
|
|
595
596
|
className: "x2mo6ok"
|
|
596
597
|
},
|
|
597
598
|
children: node.children.map((c, i) => renderInline(c, i, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
598
|
-
}, index
|
|
599
|
+
}, index);
|
|
599
600
|
case 'italic':
|
|
600
|
-
return /*#__PURE__*/
|
|
601
|
+
return /*#__PURE__*/_jsx("em", {
|
|
601
602
|
children: node.children.map((c, i) => renderInline(c, i, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
602
|
-
}, index
|
|
603
|
+
}, index);
|
|
603
604
|
case 'strikethrough':
|
|
604
|
-
return /*#__PURE__*/
|
|
605
|
+
return /*#__PURE__*/_jsx("del", {
|
|
605
606
|
...{
|
|
606
607
|
className: "xv1l7n4"
|
|
607
608
|
},
|
|
608
609
|
children: node.children.map((c, i) => renderInline(c, i, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
609
|
-
}, index
|
|
610
|
+
}, index);
|
|
610
611
|
case 'code':
|
|
611
612
|
{
|
|
612
613
|
// Track code content length for cursor but don't split inside code
|
|
613
614
|
cursor.offset += node.content.length;
|
|
614
615
|
const InlineCodeComp = components?.inlineCode;
|
|
615
|
-
const codeEl = InlineCodeComp ? /*#__PURE__*/
|
|
616
|
+
const codeEl = InlineCodeComp ? /*#__PURE__*/_jsx(InlineCodeComp, {
|
|
616
617
|
children: node.content
|
|
617
|
-
}, index
|
|
618
|
+
}, index) : /*#__PURE__*/_jsx(Code, {
|
|
618
619
|
children: node.content
|
|
619
|
-
}, index
|
|
620
|
+
}, index);
|
|
620
621
|
return codeEl;
|
|
621
622
|
}
|
|
622
623
|
case 'link':
|
|
@@ -624,16 +625,16 @@ function renderInline(node, index, onLinkClick, cursor, citationCtx, linkCompone
|
|
|
624
625
|
const safeHref = sanitizeUrl(node.href);
|
|
625
626
|
if (safeHref == null) {
|
|
626
627
|
// Unsafe URL — render as plain text
|
|
627
|
-
return /*#__PURE__*/
|
|
628
|
+
return /*#__PURE__*/_jsx("span", {
|
|
628
629
|
children: node.children.map((c, i) => renderInline(c, i, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
629
|
-
}, index
|
|
630
|
+
}, index);
|
|
630
631
|
}
|
|
631
632
|
const LinkComp = components?.link;
|
|
632
633
|
if (LinkComp) {
|
|
633
|
-
return /*#__PURE__*/
|
|
634
|
+
return /*#__PURE__*/_jsx(LinkComp, {
|
|
634
635
|
href: safeHref,
|
|
635
636
|
children: node.children.map((c, i) => renderInline(c, i, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
636
|
-
}, index
|
|
637
|
+
}, index);
|
|
637
638
|
}
|
|
638
639
|
const isExternal = safeHref.startsWith('https://') || safeHref.startsWith('http://');
|
|
639
640
|
const handleClick = onLinkClick ? e => {
|
|
@@ -646,7 +647,7 @@ function renderInline(node, index, onLinkClick, cursor, citationCtx, linkCompone
|
|
|
646
647
|
// Framework routers (Next.js, React Router) handle internal navigation;
|
|
647
648
|
// external links with target="_blank" should use a plain anchor.
|
|
648
649
|
const LinkTag = isExternal ? 'a' : linkComponent;
|
|
649
|
-
return /*#__PURE__*/
|
|
650
|
+
return /*#__PURE__*/_jsx(LinkTag, {
|
|
650
651
|
href: safeHref,
|
|
651
652
|
onClick: handleClick,
|
|
652
653
|
...(isExternal ? {
|
|
@@ -657,42 +658,42 @@ function renderInline(node, index, onLinkClick, cursor, citationCtx, linkCompone
|
|
|
657
658
|
className: "xjse4m1 x1bvjpef"
|
|
658
659
|
},
|
|
659
660
|
children: node.children.map((c, i) => renderInline(c, i, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
660
|
-
}, index
|
|
661
|
+
}, index);
|
|
661
662
|
}
|
|
662
663
|
case 'image':
|
|
663
664
|
{
|
|
664
665
|
const safeSrc = sanitizeUrl(node.src);
|
|
665
666
|
if (safeSrc == null) {
|
|
666
|
-
return /*#__PURE__*/
|
|
667
|
+
return /*#__PURE__*/_jsxs("span", {
|
|
667
668
|
children: ["[", node.alt, "]"]
|
|
668
|
-
}, index
|
|
669
|
+
}, index);
|
|
669
670
|
}
|
|
670
671
|
const ImageComp = components?.image;
|
|
671
672
|
if (ImageComp) {
|
|
672
|
-
return /*#__PURE__*/
|
|
673
|
+
return /*#__PURE__*/_jsx(ImageComp, {
|
|
673
674
|
src: safeSrc,
|
|
674
675
|
alt: node.alt
|
|
675
|
-
}, index
|
|
676
|
+
}, index);
|
|
676
677
|
}
|
|
677
|
-
return /*#__PURE__*/
|
|
678
|
+
return /*#__PURE__*/_jsx("img", {
|
|
678
679
|
src: safeSrc,
|
|
679
680
|
alt: node.alt,
|
|
680
681
|
...{
|
|
681
682
|
className: "x193iq5w xh6dtrn"
|
|
682
683
|
}
|
|
683
|
-
}, index
|
|
684
|
+
}, index);
|
|
684
685
|
}
|
|
685
686
|
case 'break':
|
|
686
687
|
cursor.offset += 1;
|
|
687
|
-
return /*#__PURE__*/
|
|
688
|
+
return /*#__PURE__*/_jsx("br", {}, index);
|
|
688
689
|
case 'citation':
|
|
689
690
|
{
|
|
690
691
|
cursor.offset += 1;
|
|
691
692
|
if (!citationCtx) {
|
|
692
693
|
// No sources provided — render as plain text
|
|
693
|
-
return /*#__PURE__*/
|
|
694
|
+
return /*#__PURE__*/_jsxs("span", {
|
|
694
695
|
children: ["[", node.sourceId, "]"]
|
|
695
|
-
}, index
|
|
696
|
+
}, index);
|
|
696
697
|
}
|
|
697
698
|
const num = getCitationNumber(citationCtx, node.sourceId);
|
|
698
699
|
const source = citationCtx.sources[node.sourceId] ?? {
|
|
@@ -700,15 +701,15 @@ function renderInline(node, index, onLinkClick, cursor, citationCtx, linkCompone
|
|
|
700
701
|
};
|
|
701
702
|
const citVariant = citationCtx.style === 'number' ? 'number' : 'label';
|
|
702
703
|
const CitationComp = components?.citation;
|
|
703
|
-
const chip = CitationComp ? /*#__PURE__*/
|
|
704
|
+
const chip = CitationComp ? /*#__PURE__*/_jsx(CitationComp, {
|
|
704
705
|
source: source,
|
|
705
706
|
number: num,
|
|
706
707
|
variant: citVariant
|
|
707
|
-
}, index
|
|
708
|
+
}, index) : /*#__PURE__*/_jsx(Citation, {
|
|
708
709
|
source: source,
|
|
709
710
|
number: num,
|
|
710
711
|
variant: citVariant
|
|
711
|
-
}, index
|
|
712
|
+
}, index);
|
|
712
713
|
return chip;
|
|
713
714
|
}
|
|
714
715
|
}
|
|
@@ -762,7 +763,7 @@ function computeTableColumnMinWidths(node) {
|
|
|
762
763
|
return maxLen <= 6 ? 60 : maxLen <= 15 ? 80 : 120;
|
|
763
764
|
});
|
|
764
765
|
}
|
|
765
|
-
function renderBlock(node, index, blockCount, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent = 'a', inlinePlugins, components) {
|
|
766
|
+
function renderBlock(node, index, blockCount, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent = 'a', inlinePlugins, components, t) {
|
|
766
767
|
const blockAlignMargin = BLOCK_ALIGN_MARGIN[contentAlign];
|
|
767
768
|
const blockAlignStyle = blockAlignMargin != null ? dynamicStyles.blockAlign(blockAlignMargin) : null;
|
|
768
769
|
const spacing = getElementSpacing(node, density);
|
|
@@ -775,25 +776,25 @@ function renderBlock(node, index, blockCount, density, headingLevelStart, onLink
|
|
|
775
776
|
const headingChildren = node.children.map((c, i) => renderInline(c, i, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components));
|
|
776
777
|
const HeadingComp = components?.heading;
|
|
777
778
|
if (HeadingComp) {
|
|
778
|
-
return /*#__PURE__*/
|
|
779
|
+
return /*#__PURE__*/_jsx(HeadingComp, {
|
|
779
780
|
level: level,
|
|
780
781
|
children: headingChildren
|
|
781
|
-
}, index
|
|
782
|
+
}, index);
|
|
782
783
|
}
|
|
783
784
|
const Tag = `h${level}`;
|
|
784
|
-
return /*#__PURE__*/
|
|
785
|
+
return /*#__PURE__*/_jsx(Tag, {
|
|
785
786
|
...stylex.props(styles.headingBase, headingStyles[level], spacing, contentWidthValue != null ? dynamicStyles.proseWidth(contentWidthValue) : null, contentAlign !== 'start' ? dynamicStyles.proseAlign(ALIGN_MARGIN[contentAlign]) : null, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd),
|
|
786
787
|
children: headingChildren
|
|
787
|
-
}, index
|
|
788
|
+
}, index);
|
|
788
789
|
}
|
|
789
790
|
case 'paragraph':
|
|
790
791
|
{
|
|
791
792
|
const paraChildren = node.children.map((c, i) => renderInline(c, i, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components));
|
|
792
793
|
const ParagraphComp = components?.paragraph;
|
|
793
794
|
if (ParagraphComp) {
|
|
794
|
-
return /*#__PURE__*/
|
|
795
|
+
return /*#__PURE__*/_jsx(ParagraphComp, {
|
|
795
796
|
children: paraChildren
|
|
796
|
-
}, index
|
|
797
|
+
}, index);
|
|
797
798
|
}
|
|
798
799
|
// Markdown paragraphs render as <div>, not <p>: inline content can
|
|
799
800
|
// include block-level nodes (images, custom inline components), and a
|
|
@@ -804,11 +805,11 @@ function renderBlock(node, index, blockCount, density, headingLevelStart, onLink
|
|
|
804
805
|
// the parser's block-child reparenting) so prose semantics are preserved
|
|
805
806
|
// without the <p> composition hazard. Consumers who want a real <p>
|
|
806
807
|
// element can still pass components={{paragraph: 'p'}}.
|
|
807
|
-
return /*#__PURE__*/
|
|
808
|
+
return /*#__PURE__*/_jsx("div", {
|
|
808
809
|
role: "paragraph",
|
|
809
810
|
...stylex.props(spacing, contentWidthValue != null ? dynamicStyles.proseWidth(contentWidthValue) : null, contentAlign !== 'start' ? dynamicStyles.proseAlign(ALIGN_MARGIN[contentAlign]) : null, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd),
|
|
810
811
|
children: paraChildren
|
|
811
|
-
}, index
|
|
812
|
+
}, index);
|
|
812
813
|
}
|
|
813
814
|
case 'codeblock':
|
|
814
815
|
{
|
|
@@ -816,34 +817,34 @@ function renderBlock(node, index, blockCount, density, headingLevelStart, onLink
|
|
|
816
817
|
cursor.offset += node.content.length;
|
|
817
818
|
const CodeBlockComp = components?.code;
|
|
818
819
|
if (CodeBlockComp) {
|
|
819
|
-
return /*#__PURE__*/
|
|
820
|
+
return /*#__PURE__*/_jsx(CodeBlockComp, {
|
|
820
821
|
code: node.content,
|
|
821
822
|
language: node.language
|
|
822
|
-
}, index
|
|
823
|
+
}, index);
|
|
823
824
|
}
|
|
824
|
-
return /*#__PURE__*/
|
|
825
|
+
return /*#__PURE__*/_jsx("div", {
|
|
825
826
|
...stylex.props(spacing, styles.codeBlockWrapper, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd),
|
|
826
|
-
children: /*#__PURE__*/
|
|
827
|
+
children: /*#__PURE__*/_jsx(CodeBlock, {
|
|
827
828
|
code: node.content,
|
|
828
829
|
language: node.language,
|
|
829
830
|
isCollapsible: true,
|
|
830
831
|
xstyle: [contentWidthValue != null ? dynamicStyles.blockWidth(contentWidthValue) : undefined, blockAlignStyle]
|
|
831
|
-
}
|
|
832
|
-
}, index
|
|
832
|
+
})
|
|
833
|
+
}, index);
|
|
833
834
|
}
|
|
834
835
|
case 'blockquote':
|
|
835
836
|
{
|
|
836
837
|
const BlockquoteComp = components?.blockquote;
|
|
837
838
|
if (BlockquoteComp) {
|
|
838
|
-
const bqC = node.children.map((c, i) => renderBlock(c, i, node.children.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent, inlinePlugins, components));
|
|
839
|
-
return /*#__PURE__*/
|
|
839
|
+
const bqC = node.children.map((c, i) => renderBlock(c, i, node.children.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent, inlinePlugins, components, t));
|
|
840
|
+
return /*#__PURE__*/_jsx(BlockquoteComp, {
|
|
840
841
|
children: bqC
|
|
841
|
-
}, index
|
|
842
|
+
}, index);
|
|
842
843
|
}
|
|
843
|
-
return /*#__PURE__*/
|
|
844
|
+
return /*#__PURE__*/_jsx(Blockquote, {
|
|
844
845
|
xstyle: [spacing, contentWidthValue != null ? dynamicStyles.proseWidth(contentWidthValue) : undefined, contentAlign !== 'start' ? dynamicStyles.proseAlign(ALIGN_MARGIN[contentAlign]) : undefined, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd],
|
|
845
|
-
children: node.children.map((c, i) => renderBlock(c, i, node.children.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent, inlinePlugins, components))
|
|
846
|
-
}, index
|
|
846
|
+
children: node.children.map((c, i) => renderBlock(c, i, node.children.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent, inlinePlugins, components, t))
|
|
847
|
+
}, index);
|
|
847
848
|
}
|
|
848
849
|
case 'list':
|
|
849
850
|
{
|
|
@@ -859,10 +860,10 @@ function renderBlock(node, index, blockCount, density, headingLevelStart, onLink
|
|
|
859
860
|
}) => item.checked).map(({
|
|
860
861
|
key
|
|
861
862
|
}) => key);
|
|
862
|
-
return /*#__PURE__*/
|
|
863
|
+
return /*#__PURE__*/_jsx("div", {
|
|
863
864
|
...stylex.props(spacing, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd),
|
|
864
|
-
children: /*#__PURE__*/
|
|
865
|
-
label:
|
|
865
|
+
children: /*#__PURE__*/_jsx(CheckboxList, {
|
|
866
|
+
label: t('@astryx.markdown.taskList'),
|
|
866
867
|
isLabelHidden: true,
|
|
867
868
|
value: checkedValues,
|
|
868
869
|
xstyle: styles.blockIndent,
|
|
@@ -871,24 +872,24 @@ function renderBlock(node, index, blockCount, density, headingLevelStart, onLink
|
|
|
871
872
|
children: node.items.map((item, i) => {
|
|
872
873
|
const firstChild = item.children[0];
|
|
873
874
|
const isInline = item.children.length === 1 && firstChild?.type === 'paragraph';
|
|
874
|
-
const label = isInline ? /*#__PURE__*/
|
|
875
|
+
const label = isInline ? /*#__PURE__*/_jsx(_Fragment, {
|
|
875
876
|
children: firstChild.children.map((c, j) => renderInline(c, j, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
876
|
-
}
|
|
877
|
-
children: item.children.map((c, j) => renderBlock(c, j, item.children.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent, inlinePlugins, components))
|
|
878
|
-
}
|
|
879
|
-
return /*#__PURE__*/
|
|
877
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {
|
|
878
|
+
children: item.children.map((c, j) => renderBlock(c, j, item.children.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent, inlinePlugins, components, t))
|
|
879
|
+
});
|
|
880
|
+
return /*#__PURE__*/_jsx(CheckboxListItem
|
|
880
881
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- markdown task items are rendered from positional AST nodes
|
|
881
882
|
, {
|
|
882
883
|
value: `task-${i}`,
|
|
883
884
|
label: label
|
|
884
|
-
}, i
|
|
885
|
+
}, i);
|
|
885
886
|
})
|
|
886
|
-
}
|
|
887
|
-
}, index
|
|
887
|
+
})
|
|
888
|
+
}, index);
|
|
888
889
|
}
|
|
889
|
-
return /*#__PURE__*/
|
|
890
|
+
return /*#__PURE__*/_jsx("div", {
|
|
890
891
|
...stylex.props(spacing, contentWidthValue != null ? dynamicStyles.proseWidth(contentWidthValue) : null, contentAlign !== 'start' ? dynamicStyles.proseAlign(ALIGN_MARGIN[contentAlign]) : null, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd),
|
|
891
|
-
children: /*#__PURE__*/
|
|
892
|
+
children: /*#__PURE__*/_jsx(List, {
|
|
892
893
|
listStyle: node.ordered ? 'decimal' : 'disc',
|
|
893
894
|
density: "compact",
|
|
894
895
|
start: node.ordered ? node.start : undefined,
|
|
@@ -900,91 +901,91 @@ function renderBlock(node, index, blockCount, density, headingLevelStart, onLink
|
|
|
900
901
|
// Check if this entire list item is "new" — if so, fade the
|
|
901
902
|
// whole item as a block instead of fading individual text spans.
|
|
902
903
|
|
|
903
|
-
const label = isInline ? /*#__PURE__*/
|
|
904
|
+
const label = isInline ? /*#__PURE__*/_jsx(_Fragment, {
|
|
904
905
|
children: firstChild.children.map((c, j) => renderInline(c, j, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
905
|
-
}
|
|
906
|
-
children: item.children.map((c, j) => renderBlock(c, j, item.children.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent, inlinePlugins, components))
|
|
907
|
-
}
|
|
908
|
-
return /*#__PURE__*/
|
|
906
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {
|
|
907
|
+
children: item.children.map((c, j) => renderBlock(c, j, item.children.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidthValue, contentAlign, linkComponent, inlinePlugins, components, t))
|
|
908
|
+
});
|
|
909
|
+
return /*#__PURE__*/_jsx(ListItem
|
|
909
910
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- markdown list items are rendered from positional AST nodes
|
|
910
911
|
, {
|
|
911
912
|
label: label
|
|
912
|
-
}, i
|
|
913
|
+
}, i);
|
|
913
914
|
})
|
|
914
|
-
}
|
|
915
|
-
}, index
|
|
915
|
+
})
|
|
916
|
+
}, index);
|
|
916
917
|
}
|
|
917
918
|
case 'table':
|
|
918
919
|
{
|
|
919
920
|
const colMinWidths = computeTableColumnMinWidths(node);
|
|
920
|
-
return /*#__PURE__*/
|
|
921
|
+
return /*#__PURE__*/_jsx("div", {
|
|
921
922
|
// Keyboard-focusable so keyboard users can scroll a horizontally
|
|
922
923
|
// overflowing GFM table. Uses role="group" (not "region") so
|
|
923
924
|
// multiple tables don't create duplicate same-named landmarks
|
|
924
925
|
// (axe: landmark-unique).
|
|
925
926
|
tabIndex: 0,
|
|
926
927
|
role: "group",
|
|
927
|
-
"aria-label":
|
|
928
|
+
"aria-label": t('@astryx.markdown.table'),
|
|
928
929
|
...stylex.props(styles.tableWrapper, spacing, contentWidthValue != null ? dynamicStyles.blockWidth(contentWidthValue) : null, BLOCK_ALIGN_MARGIN[contentAlign] != null ? dynamicStyles.blockAlign(BLOCK_ALIGN_MARGIN[contentAlign]) : null, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd),
|
|
929
|
-
children: /*#__PURE__*/
|
|
930
|
+
children: /*#__PURE__*/_jsxs(Table, {
|
|
930
931
|
dividers: "rows",
|
|
931
932
|
textOverflow: "wrap",
|
|
932
|
-
children: [/*#__PURE__*/
|
|
933
|
-
children: /*#__PURE__*/
|
|
934
|
-
children: node.headers.map((h, i) => /*#__PURE__*/
|
|
933
|
+
children: [/*#__PURE__*/_jsx(TableHeader, {
|
|
934
|
+
children: /*#__PURE__*/_jsx(TableRow, {
|
|
935
|
+
children: node.headers.map((h, i) => /*#__PURE__*/_jsx(TableHeaderCell
|
|
935
936
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- markdown table columns are positional by definition
|
|
936
937
|
, {
|
|
937
938
|
xstyle: [dynamicStyles.cellMinWidth(`${colMinWidths[i]}px`), node.alignments[i] === 'center' && cellAlignStyles.center, node.alignments[i] === 'right' && cellAlignStyles.right],
|
|
938
939
|
children: h.children.map((c, j) => renderInline(c, j, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
939
|
-
}, i
|
|
940
|
-
}
|
|
941
|
-
}
|
|
940
|
+
}, i))
|
|
941
|
+
})
|
|
942
|
+
}), /*#__PURE__*/_jsx(TableBody, {
|
|
942
943
|
children: node.rows.map((row, i) => {
|
|
943
|
-
const cells = row.map((cell, j) => /*#__PURE__*/
|
|
944
|
+
const cells = row.map((cell, j) => /*#__PURE__*/_jsx(TableCell
|
|
944
945
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- markdown table cells are positional by row and column
|
|
945
946
|
, {
|
|
946
947
|
xstyle: [node.alignments[j] === 'center' && cellAlignStyles.center, node.alignments[j] === 'right' && cellAlignStyles.right],
|
|
947
948
|
children: cell.children.map((c, k) => renderInline(c, k, onLinkClick, cursor, citationCtx, linkComponent, inlinePlugins, components))
|
|
948
|
-
}, j
|
|
949
|
-
return /*#__PURE__*/
|
|
949
|
+
}, j));
|
|
950
|
+
return /*#__PURE__*/_jsx(TableRow
|
|
950
951
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- markdown table rows are rendered from positional AST nodes
|
|
951
952
|
, {
|
|
952
953
|
children: cells
|
|
953
|
-
}, i
|
|
954
|
+
}, i);
|
|
954
955
|
})
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}, index
|
|
956
|
+
})]
|
|
957
|
+
})
|
|
958
|
+
}, index);
|
|
958
959
|
}
|
|
959
960
|
case 'hr':
|
|
960
961
|
{
|
|
961
962
|
const HrComp = components?.hr;
|
|
962
963
|
if (HrComp) {
|
|
963
|
-
return /*#__PURE__*/
|
|
964
|
+
return /*#__PURE__*/_jsx(HrComp, {}, index);
|
|
964
965
|
}
|
|
965
|
-
return /*#__PURE__*/
|
|
966
|
+
return /*#__PURE__*/_jsx("hr", {
|
|
966
967
|
...stylex.props(styles.hr, spacing, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd)
|
|
967
|
-
}, index
|
|
968
|
+
}, index);
|
|
968
969
|
}
|
|
969
970
|
case 'image':
|
|
970
971
|
{
|
|
971
972
|
const safeSrc = sanitizeUrl(node.src);
|
|
972
973
|
if (safeSrc == null) {
|
|
973
|
-
return /*#__PURE__*/
|
|
974
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
974
975
|
...stylex.props(spacing, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd),
|
|
975
976
|
children: ["[", node.alt, "]"]
|
|
976
|
-
}, index
|
|
977
|
+
}, index);
|
|
977
978
|
}
|
|
978
|
-
return /*#__PURE__*/
|
|
979
|
+
return /*#__PURE__*/_jsx("div", {
|
|
979
980
|
...stylex.props(spacing, isFirst && styles.noMarginBlockStart, isLast && styles.noMarginBlockEnd),
|
|
980
|
-
children: /*#__PURE__*/
|
|
981
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
981
982
|
src: safeSrc,
|
|
982
983
|
alt: node.alt,
|
|
983
984
|
...{
|
|
984
985
|
className: "x193iq5w xh6dtrn"
|
|
985
986
|
}
|
|
986
|
-
}
|
|
987
|
-
}, index
|
|
987
|
+
})
|
|
988
|
+
}, index);
|
|
988
989
|
}
|
|
989
990
|
}
|
|
990
991
|
}
|
|
@@ -1024,6 +1025,7 @@ export function Markdown({
|
|
|
1024
1025
|
style,
|
|
1025
1026
|
'data-testid': testId
|
|
1026
1027
|
}) {
|
|
1028
|
+
const t = useTranslator();
|
|
1027
1029
|
const LinkComponent = useLinkComponent();
|
|
1028
1030
|
// Derive the set of source IDs for the parser (stable across renders when sources don't change)
|
|
1029
1031
|
const sourceIds = useMemo(() => sources ? new Set(Object.keys(sources)) : undefined, [sources]);
|
|
@@ -1106,29 +1108,29 @@ export function Markdown({
|
|
|
1106
1108
|
style: citationStyle
|
|
1107
1109
|
} : null;
|
|
1108
1110
|
if (display === 'inline') {
|
|
1109
|
-
const renderedInline = /*#__PURE__*/
|
|
1111
|
+
const renderedInline = /*#__PURE__*/_jsx("span", {
|
|
1110
1112
|
ref: ref,
|
|
1111
1113
|
"data-testid": testId,
|
|
1112
1114
|
...mergeProps(themeProps('markdown', {
|
|
1113
1115
|
density
|
|
1114
1116
|
}), stylex.props(styles.root, styles.inlineRoot, xstyle), className, style),
|
|
1115
1117
|
children: inlineNodes.map((node, i) => renderInline(node, i, onLinkClick, cursor, citationCtx, LinkComponent, inlinePlugins, components))
|
|
1116
|
-
}
|
|
1118
|
+
});
|
|
1117
1119
|
|
|
1118
1120
|
// Store current inline nodes for next render's boundary calculation.
|
|
1119
1121
|
prevInlineNodesRef.current = inlineNodes;
|
|
1120
1122
|
prevBlocksRef.current = [];
|
|
1121
1123
|
return renderedInline;
|
|
1122
1124
|
}
|
|
1123
|
-
const rendered = /*#__PURE__*/
|
|
1125
|
+
const rendered = /*#__PURE__*/_jsx("div", {
|
|
1124
1126
|
role: "document",
|
|
1125
1127
|
ref: ref,
|
|
1126
1128
|
"data-testid": testId,
|
|
1127
1129
|
...mergeProps(themeProps('markdown', {
|
|
1128
1130
|
density
|
|
1129
1131
|
}), stylex.props(styles.root, xstyle), className, style),
|
|
1130
|
-
children: blocks.map((block, i) => renderBlock(block, i, blocks.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidth ? typeof contentWidth === 'number' ? `${contentWidth}px` : contentWidth : null, contentAlign, LinkComponent, inlinePlugins, components))
|
|
1131
|
-
}
|
|
1132
|
+
children: blocks.map((block, i) => renderBlock(block, i, blocks.length, density, headingLevelStart, onLinkClick, cursor, citationCtx, contentWidth ? typeof contentWidth === 'number' ? `${contentWidth}px` : contentWidth : null, contentAlign, LinkComponent, inlinePlugins, components, t))
|
|
1133
|
+
});
|
|
1132
1134
|
|
|
1133
1135
|
// Store current blocks for next render's boundary calculation.
|
|
1134
1136
|
// This ref write is safe under StrictMode: both invocations produce the same
|
|
@@ -26,7 +26,7 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
26
26
|
// =============================================================================
|
|
27
27
|
// Types
|
|
28
28
|
// =============================================================================
|
|
29
|
-
import {
|
|
29
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
30
|
// =============================================================================
|
|
31
31
|
// Styles
|
|
32
32
|
// =============================================================================
|
|
@@ -130,12 +130,12 @@ export function MetadataList({
|
|
|
130
130
|
const effectiveMax = isHorizontal ? undefined : maxNumOfItems;
|
|
131
131
|
const isExceedMax = effectiveMax != null && childrenArray.length > effectiveMax;
|
|
132
132
|
const visibleChildren = isExceedMax && !isShowAll ? childrenArray.slice(0, effectiveMax) : childrenArray;
|
|
133
|
-
const titleContent = title != null ? /*#__PURE__*/
|
|
133
|
+
const titleContent = title != null ? /*#__PURE__*/_jsx("div", {
|
|
134
134
|
...{
|
|
135
135
|
className: "xep27e5"
|
|
136
136
|
},
|
|
137
137
|
children: title
|
|
138
|
-
}
|
|
138
|
+
}) : null;
|
|
139
139
|
|
|
140
140
|
// Determine grid style based on columns and label position
|
|
141
141
|
const getGridStyle = () => {
|
|
@@ -159,22 +159,22 @@ export function MetadataList({
|
|
|
159
159
|
} : !isHorizontal && labelConfig.position === 'start' && labelConfig.width != null ? {
|
|
160
160
|
gridTemplateColumns: `${typeof labelConfig.width === 'number' ? `${labelConfig.width}px` : labelConfig.width} 1fr`
|
|
161
161
|
} : undefined;
|
|
162
|
-
return /*#__PURE__*/
|
|
162
|
+
return /*#__PURE__*/_jsx(MetadataListContext, {
|
|
163
163
|
value: contextValue,
|
|
164
|
-
children: /*#__PURE__*/
|
|
164
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
165
165
|
ref: ref,
|
|
166
166
|
"data-testid": testId,
|
|
167
167
|
...mergeProps(themeProps('metadata-list', {
|
|
168
168
|
columns: String(columns),
|
|
169
169
|
orientation
|
|
170
170
|
}), stylex.props(styles.root, xstyle), className, style),
|
|
171
|
-
children: [titleContent, /*#__PURE__*/
|
|
171
|
+
children: [titleContent, /*#__PURE__*/_jsx("dl", {
|
|
172
172
|
id: contentId,
|
|
173
173
|
...mergeProps(stylex.props(styles.dl, getGridStyle()), {
|
|
174
174
|
style: dynamicGridStyle
|
|
175
175
|
}),
|
|
176
176
|
children: visibleChildren
|
|
177
|
-
}
|
|
177
|
+
}), isExceedMax && /*#__PURE__*/_jsx("button", {
|
|
178
178
|
type: "button",
|
|
179
179
|
"aria-controls": contentId,
|
|
180
180
|
"aria-expanded": isShowAll,
|
|
@@ -183,8 +183,8 @@ export function MetadataList({
|
|
|
183
183
|
className: "xjyslct x15nmkw0 x1ypdohk xqwr325 xjm74w1 xw6l6zx x1e4wzip xjb2p0i x1yc453h xqcrz7y"
|
|
184
184
|
},
|
|
185
185
|
children: isShowAll ? 'Show less' : 'Show more'
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
186
|
+
})]
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
189
|
}
|
|
190
190
|
MetadataList.displayName = 'MetadataList';
|
|
@@ -26,7 +26,7 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
26
26
|
// =============================================================================
|
|
27
27
|
// Types
|
|
28
28
|
// =============================================================================
|
|
29
|
-
import {
|
|
29
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
30
|
// =============================================================================
|
|
31
31
|
// Styles
|
|
32
32
|
// =============================================================================
|
|
@@ -85,49 +85,49 @@ export function MetadataListItem({
|
|
|
85
85
|
const ctx = use(MetadataListContext);
|
|
86
86
|
const labelPosition = ctx?.labelConfig.position ?? 'start';
|
|
87
87
|
const isStacked = labelPosition === 'top' || ctx?.orientation === 'horizontal';
|
|
88
|
-
const labelContent = /*#__PURE__*/
|
|
89
|
-
children: [icon != null && /*#__PURE__*/
|
|
88
|
+
const labelContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
89
|
+
children: [icon != null && /*#__PURE__*/_jsx("span", {
|
|
90
90
|
...{
|
|
91
91
|
className: "x3nfvp2 x6s0dn4 x2lah0s xv1l7n4"
|
|
92
92
|
},
|
|
93
93
|
children: icon
|
|
94
|
-
}
|
|
95
|
-
}
|
|
94
|
+
}), label]
|
|
95
|
+
});
|
|
96
96
|
|
|
97
97
|
// Stacked layout: label above content, wrapped in a div
|
|
98
98
|
if (isStacked) {
|
|
99
|
-
return /*#__PURE__*/
|
|
99
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
100
100
|
ref: ref,
|
|
101
101
|
"data-testid": testId,
|
|
102
102
|
...mergeProps(themeProps('metadata-list-item'), stylex.props(styles.stackedWrapper, xstyle), className, style),
|
|
103
|
-
children: [/*#__PURE__*/
|
|
103
|
+
children: [/*#__PURE__*/_jsx("dt", {
|
|
104
104
|
...{
|
|
105
105
|
className: "xv1l7n4 xjm74w1 xw6l6zx x1e4wzip x78zum5 x6s0dn4 x1txdalj x1ghz6dp x1717udv"
|
|
106
106
|
},
|
|
107
107
|
children: labelContent
|
|
108
|
-
}
|
|
108
|
+
}), /*#__PURE__*/_jsx("dd", {
|
|
109
109
|
...{
|
|
110
110
|
className: "x1tgivj0 xjm74w1 xw6l6zx x1ghz6dp x1717udv x13faqbe"
|
|
111
111
|
},
|
|
112
112
|
children: children
|
|
113
|
-
}
|
|
114
|
-
}
|
|
113
|
+
})]
|
|
114
|
+
});
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// Inline layout: dt and dd are direct grid children
|
|
118
|
-
return /*#__PURE__*/
|
|
119
|
-
children: [/*#__PURE__*/
|
|
118
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
119
|
+
children: [/*#__PURE__*/_jsx("dt", {
|
|
120
120
|
ref: ref,
|
|
121
121
|
"data-testid": testId ? `${testId}-label` : undefined,
|
|
122
122
|
...mergeProps(themeProps('metadata-list-item'), stylex.props(styles.label, xstyle), className, style),
|
|
123
123
|
children: labelContent
|
|
124
|
-
}
|
|
124
|
+
}), /*#__PURE__*/_jsx("dd", {
|
|
125
125
|
"data-testid": testId ? `${testId}-value` : undefined,
|
|
126
126
|
...{
|
|
127
127
|
className: "x1tgivj0 xjm74w1 xw6l6zx x1ghz6dp x1717udv xjwf9q1 x13faqbe"
|
|
128
128
|
},
|
|
129
129
|
children: children
|
|
130
|
-
}
|
|
131
|
-
}
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
132
132
|
}
|
|
133
133
|
MetadataListItem.displayName = 'MetadataListItem';
|