@redocly/theme 0.70.0-next.1 → 0.70.0-next.11
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/lib/components/Buttons/ConnectMCPButton.js +19 -14
- package/lib/components/Buttons/variables.d.ts +1 -0
- package/lib/components/Buttons/variables.js +4 -1
- package/lib/components/Catalog/Catalog.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +30 -11
- package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.js +2 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.js +1 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.js +2 -2
- package/lib/components/CodeBlock/CodeBlockControls.js +3 -5
- package/lib/components/Consent/Consent.d.ts +2 -0
- package/lib/components/Consent/Consent.js +17 -0
- package/lib/components/Consent/ConsentBanner.d.ts +2 -0
- package/lib/components/Consent/ConsentBanner.js +120 -0
- package/lib/components/Consent/ConsentDialog.d.ts +2 -0
- package/lib/components/Consent/ConsentDialog.js +128 -0
- package/lib/components/Consent/ConsentSettingsLink.d.ts +2 -0
- package/lib/components/Consent/ConsentSettingsLink.js +35 -0
- package/lib/components/Consent/variables.d.ts +1 -0
- package/lib/components/Consent/variables.js +31 -0
- package/lib/components/Dropdown/Dropdown.d.ts +4 -2
- package/lib/components/Dropdown/Dropdown.js +31 -9
- package/lib/components/Dropdown/DropdownMenu.d.ts +1 -0
- package/lib/components/Dropdown/DropdownMenu.js +1 -1
- package/lib/components/Feedback/Reasons.js +3 -2
- package/lib/components/Filter/FilterCheckboxes.js +30 -11
- package/lib/components/Filter/FilterDateRange.js +36 -2
- package/lib/components/Footer/Footer.js +4 -1
- package/lib/components/Image/Image.js +24 -4
- package/lib/components/JsonViewer/Helpers.d.ts +10 -2
- package/lib/components/JsonViewer/Helpers.js +32 -36
- package/lib/components/JsonViewer/JsonViewer.js +15 -18
- package/lib/components/LoadProgressBar/LoadProgressBar.d.ts +8 -0
- package/lib/components/LoadProgressBar/LoadProgressBar.js +122 -0
- package/lib/components/MCP/McpConnectionTabs.js +9 -2
- package/lib/components/Markdown/Markdown.js +3 -2
- package/lib/components/Markdown/styles/base-table.js +14 -1
- package/lib/components/Markdown/variables.js +1 -0
- package/lib/components/Menu/Menu.js +4 -0
- package/lib/components/Menu/MenuSelect.d.ts +7 -0
- package/lib/components/Menu/MenuSelect.js +129 -0
- package/lib/components/Menu/variables.js +43 -4
- package/lib/components/Navbar/Navbar.js +44 -5
- package/lib/components/Navbar/variables.js +3 -0
- package/lib/components/NavigationTabs/NavigationTab.d.ts +7 -0
- package/lib/components/NavigationTabs/NavigationTab.js +93 -0
- package/lib/components/NavigationTabs/NavigationTabContent.d.ts +7 -0
- package/lib/components/NavigationTabs/NavigationTabContent.js +50 -0
- package/lib/components/NavigationTabs/NavigationTabMenu.d.ts +7 -0
- package/lib/components/NavigationTabs/NavigationTabMenu.js +18 -0
- package/lib/components/NavigationTabs/NavigationTabs.d.ts +7 -0
- package/lib/components/NavigationTabs/NavigationTabs.js +97 -0
- package/lib/components/NavigationTabs/variables.d.ts +1 -0
- package/lib/components/NavigationTabs/variables.js +37 -0
- package/lib/components/Portal/Portal.js +37 -5
- package/lib/components/Product/utils.js +1 -1
- package/lib/components/Search/SearchAiActionButtons.js +8 -3
- package/lib/components/Search/SearchAiActivity.d.ts +10 -0
- package/lib/components/Search/SearchAiActivity.js +278 -0
- package/lib/components/Search/SearchAiConversationInput.js +10 -6
- package/lib/components/Search/SearchAiDialog.js +13 -2
- package/lib/components/Search/SearchAiMessage.d.ts +2 -1
- package/lib/components/Search/SearchAiMessage.js +21 -109
- package/lib/components/Search/SearchAiResponse.js +1 -0
- package/lib/components/Search/SearchDialog.js +10 -0
- package/lib/components/Search/SearchItem.js +11 -10
- package/lib/components/Search/SearchTrigger.js +37 -6
- package/lib/components/Search/variables.js +17 -2
- package/lib/components/Segmented/Segmented.js +23 -3
- package/lib/components/Select/Select.js +10 -3
- package/lib/components/Select/SelectInput.d.ts +1 -0
- package/lib/components/Select/SelectInput.js +5 -11
- package/lib/components/Sidebar/Sidebar.js +2 -2
- package/lib/components/SplitButton/SplitButton.js +37 -3
- package/lib/components/TableOfContent/TableOfContent.js +2 -2
- package/lib/core/constants/common.d.ts +1 -0
- package/lib/core/constants/common.js +1 -0
- package/lib/core/constants/consent.d.ts +2 -0
- package/lib/core/constants/consent.js +30 -0
- package/lib/core/constants/index.d.ts +2 -0
- package/lib/core/constants/index.js +2 -0
- package/lib/core/constants/mcp.d.ts +2 -2
- package/lib/core/constants/mcp.js +3 -8
- package/lib/core/constants/prompt.d.ts +9 -0
- package/lib/core/constants/prompt.js +33 -0
- package/lib/core/constants/search.d.ts +1 -1
- package/lib/core/constants/search.js +6 -2
- package/lib/core/contexts/PortalContainerContext.d.ts +2 -0
- package/lib/core/contexts/PortalContainerContext.js +7 -0
- package/lib/core/hooks/code-walkthrough/use-code-panel.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +1 -2
- package/lib/core/hooks/code-walkthrough/use-renderable-files.d.ts +1 -1
- package/lib/core/hooks/index.d.ts +9 -0
- package/lib/core/hooks/index.js +9 -0
- package/lib/core/hooks/menu/use-collapse.js +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-items.js +75 -51
- package/lib/core/hooks/menu/use-mobile-menu-levels.js +12 -7
- package/lib/core/hooks/prompt/use-prompt-actions.d.ts +7 -0
- package/lib/core/hooks/prompt/use-prompt-actions.js +19 -0
- package/lib/core/hooks/prompt/use-prompt-text-limit.d.ts +19 -0
- package/lib/core/hooks/prompt/use-prompt-text-limit.js +35 -0
- package/lib/core/hooks/search/use-persisted-quick-filter.d.ts +21 -0
- package/lib/core/hooks/search/use-persisted-quick-filter.js +92 -0
- package/lib/core/hooks/search/use-search-ai-activity.d.ts +11 -0
- package/lib/core/hooks/search/use-search-ai-activity.js +15 -0
- package/lib/core/hooks/use-connect-mcp-button.js +3 -1
- package/lib/core/hooks/use-consent-dialog.d.ts +12 -0
- package/lib/core/hooks/use-consent-dialog.js +36 -0
- package/lib/core/hooks/use-consent-telemetry.d.ts +1 -0
- package/lib/core/hooks/use-consent-telemetry.js +42 -0
- package/lib/core/hooks/use-dialog-hotkeys.js +4 -2
- package/lib/core/hooks/use-full-height.d.ts +1 -1
- package/lib/core/hooks/use-full-height.js +8 -8
- package/lib/core/hooks/use-page-actions.d.ts +1 -1
- package/lib/core/hooks/use-page-actions.js +10 -8
- package/lib/core/hooks/use-pointer-border-highlight.d.ts +7 -0
- package/lib/core/hooks/use-pointer-border-highlight.js +29 -0
- package/lib/core/hooks/use-scroll-item-into-view.d.ts +2 -0
- package/lib/core/hooks/use-scroll-item-into-view.js +16 -0
- package/lib/core/hooks/use-tab-list.d.ts +31 -0
- package/lib/core/hooks/use-tab-list.js +49 -0
- package/lib/core/hooks/use-telemetry-fallback.d.ts +2 -0
- package/lib/core/hooks/use-telemetry-fallback.js +2 -0
- package/lib/core/hooks/use-theme-hooks.js +16 -0
- package/lib/core/styles/dark.js +14 -12
- package/lib/core/styles/global.d.ts +2 -0
- package/lib/core/styles/global.js +115 -136
- package/lib/core/styles/index.d.ts +1 -0
- package/lib/core/styles/index.js +3 -1
- package/lib/core/styles/search-ai-appear.d.ts +1 -0
- package/lib/core/styles/search-ai-appear.js +18 -0
- package/lib/core/types/code-walkthrough.d.ts +84 -0
- package/lib/core/types/consent.d.ts +54 -0
- package/lib/core/types/consent.js +3 -0
- package/lib/core/types/dropdown.d.ts +1 -0
- package/lib/core/types/dropdown.js +3 -0
- package/lib/core/types/hooks.d.ts +8 -1
- package/lib/core/types/index.d.ts +4 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/mcp.d.ts +3 -2
- package/lib/core/types/navigation-tabs.d.ts +49 -0
- package/lib/core/types/navigation-tabs.js +3 -0
- package/lib/core/types/prompt.d.ts +9 -0
- package/lib/core/types/prompt.js +3 -0
- package/lib/core/types/search.d.ts +25 -0
- package/lib/core/utils/Dynamic.d.ts +8 -1
- package/lib/core/utils/Dynamic.js +34 -3
- package/lib/core/utils/assign-ref.d.ts +2 -0
- package/lib/core/utils/assign-ref.js +12 -0
- package/lib/core/utils/consent-settings-link-placement.d.ts +3 -0
- package/lib/core/utils/consent-settings-link-placement.js +15 -0
- package/lib/core/utils/content-segments.d.ts +12 -1
- package/lib/core/utils/content-segments.js +90 -5
- package/lib/core/utils/download-code-walkthrough.d.ts +1 -1
- package/lib/core/utils/dropdown.d.ts +2 -0
- package/lib/core/utils/dropdown.js +12 -0
- package/lib/core/utils/get-ai-prompt-link.d.ts +15 -0
- package/lib/core/utils/get-ai-prompt-link.js +29 -0
- package/lib/core/utils/get-code-walkthrough-file-text.d.ts +1 -1
- package/lib/core/utils/index.d.ts +5 -0
- package/lib/core/utils/index.js +5 -0
- package/lib/core/utils/match-code-walkthrough-conditions.d.ts +1 -1
- package/lib/core/utils/mcp.d.ts +2 -1
- package/lib/core/utils/mcp.js +13 -3
- package/lib/core/utils/menu.d.ts +4 -0
- package/lib/core/utils/menu.js +48 -8
- package/lib/core/utils/navigation-tabs.d.ts +8 -0
- package/lib/core/utils/navigation-tabs.js +71 -0
- package/lib/core/utils/search-ai-activity.d.ts +4 -0
- package/lib/core/utils/search-ai-activity.js +83 -0
- package/lib/core/utils/urls.js +3 -1
- package/lib/core/utils/with-load-progress.d.ts +3 -0
- package/lib/core/utils/with-load-progress.js +24 -19
- package/lib/ext/configure.d.ts +1 -1
- package/lib/ext/configure.js +0 -1
- package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.d.ts +29 -0
- package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.js +81 -0
- package/lib/icons/LinkIcon/LinkIconSymbol.d.ts +12 -0
- package/lib/icons/LinkIcon/LinkIconSymbol.js +41 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +9 -1
- package/lib/layouts/PageLayout.js +1 -1
- package/lib/layouts/RootLayout.js +2 -2
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +3 -3
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +1 -1
- package/lib/markdoc/components/Prompt/Prompt.d.ts +15 -0
- package/lib/markdoc/components/Prompt/Prompt.js +163 -0
- package/lib/markdoc/components/Prompt/PromptActions.d.ts +13 -0
- package/lib/markdoc/components/Prompt/PromptActions.js +43 -0
- package/lib/markdoc/components/Prompt/PromptBody.d.ts +14 -0
- package/lib/markdoc/components/Prompt/PromptBody.js +99 -0
- package/lib/markdoc/components/Prompt/PromptCopyButton.d.ts +10 -0
- package/lib/markdoc/components/Prompt/PromptCopyButton.js +28 -0
- package/lib/markdoc/components/Prompt/PromptHeader.d.ts +9 -0
- package/lib/markdoc/components/Prompt/PromptHeader.js +57 -0
- package/lib/markdoc/components/Prompt/PromptShowHideButton.d.ts +7 -0
- package/lib/markdoc/components/Prompt/PromptShowHideButton.js +21 -0
- package/lib/markdoc/components/Prompt/PromptToggleLabel.d.ts +7 -0
- package/lib/markdoc/components/Prompt/PromptToggleLabel.js +28 -0
- package/lib/markdoc/components/Prompt/variables.d.ts +1 -0
- package/lib/markdoc/components/Prompt/variables.dark.d.ts +1 -0
- package/lib/markdoc/components/Prompt/variables.dark.js +8 -0
- package/lib/markdoc/components/Prompt/variables.js +44 -0
- package/lib/markdoc/components/Tabs/TabList.js +8 -6
- package/lib/markdoc/components/default.d.ts +1 -0
- package/lib/markdoc/components/default.js +1 -0
- package/lib/markdoc/default.d.ts +2 -0
- package/lib/markdoc/default.js +2 -0
- package/lib/markdoc/tags/code-walkthrough.d.ts +1 -1
- package/lib/markdoc/tags/connect-mcp.js +15 -0
- package/lib/markdoc/tags/prompt.d.ts +2 -0
- package/lib/markdoc/tags/prompt.js +56 -0
- package/package.json +4 -8
- package/src/components/Buttons/ConnectMCPButton.tsx +21 -16
- package/src/components/Buttons/variables.ts +4 -0
- package/src/components/Catalog/Catalog.tsx +6 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.tsx +3 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +2 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +37 -22
- package/src/components/Catalog/CatalogFilter/CatalogFilterDateRange.tsx +3 -2
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.tsx +1 -1
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.tsx +2 -2
- package/src/components/CodeBlock/CodeBlockControls.tsx +4 -7
- package/src/components/Consent/Consent.tsx +18 -0
- package/src/components/Consent/ConsentBanner.tsx +110 -0
- package/src/components/Consent/ConsentDialog.tsx +210 -0
- package/src/components/Consent/ConsentSettingsLink.tsx +44 -0
- package/src/components/Consent/variables.ts +28 -0
- package/src/components/Dropdown/Dropdown.tsx +32 -7
- package/src/components/Dropdown/DropdownMenu.tsx +7 -1
- package/src/components/Feedback/Reasons.tsx +3 -2
- package/src/components/Filter/FilterCheckboxes.tsx +33 -18
- package/src/components/Filter/FilterDateRange.tsx +3 -2
- package/src/components/Footer/Footer.tsx +2 -0
- package/src/components/Image/Image.tsx +26 -5
- package/src/components/JsonViewer/Helpers.tsx +51 -54
- package/src/components/JsonViewer/JsonViewer.tsx +23 -25
- package/src/components/LoadProgressBar/LoadProgressBar.tsx +113 -0
- package/src/components/MCP/McpConnectionTabs.tsx +22 -5
- package/src/components/Markdown/Markdown.tsx +3 -2
- package/src/components/Markdown/styles/base-table.ts +14 -1
- package/src/components/Markdown/variables.ts +1 -0
- package/src/components/Menu/Menu.tsx +5 -0
- package/src/components/Menu/MenuSelect.tsx +198 -0
- package/src/components/Menu/variables.ts +43 -4
- package/src/components/Navbar/Navbar.tsx +22 -5
- package/src/components/Navbar/variables.ts +3 -0
- package/src/components/NavigationTabs/NavigationTab.tsx +148 -0
- package/src/components/NavigationTabs/NavigationTabContent.tsx +66 -0
- package/src/components/NavigationTabs/NavigationTabMenu.tsx +40 -0
- package/src/components/NavigationTabs/NavigationTabs.tsx +83 -0
- package/src/components/NavigationTabs/variables.ts +34 -0
- package/src/components/Portal/Portal.tsx +4 -2
- package/src/components/Product/utils.ts +1 -1
- package/src/components/Search/SearchAiActionButtons.tsx +31 -19
- package/src/components/Search/SearchAiActivity.tsx +318 -0
- package/src/components/Search/SearchAiConversationInput.tsx +13 -7
- package/src/components/Search/SearchAiDialog.tsx +20 -4
- package/src/components/Search/SearchAiMessage.tsx +28 -136
- package/src/components/Search/SearchAiResponse.tsx +1 -0
- package/src/components/Search/SearchDialog.tsx +11 -0
- package/src/components/Search/SearchItem.tsx +19 -10
- package/src/components/Search/SearchTrigger.tsx +47 -3
- package/src/components/Search/variables.ts +17 -2
- package/src/components/Segmented/Segmented.tsx +25 -16
- package/src/components/Select/Select.tsx +12 -6
- package/src/components/Select/SelectInput.tsx +10 -18
- package/src/components/Sidebar/Sidebar.tsx +2 -2
- package/src/components/SplitButton/SplitButton.tsx +8 -2
- package/src/components/TableOfContent/TableOfContent.tsx +2 -2
- package/src/core/constants/common.ts +1 -0
- package/src/core/constants/consent.ts +29 -0
- package/src/core/constants/index.ts +2 -0
- package/src/core/constants/mcp.ts +3 -9
- package/src/core/constants/prompt.ts +34 -0
- package/src/core/constants/search.ts +6 -2
- package/src/core/contexts/PortalContainerContext.tsx +4 -0
- package/src/core/hooks/__mocks__/index.ts +5 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +20 -0
- package/src/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.ts +1 -2
- package/src/core/hooks/code-walkthrough/__mocks__/mock-intersection-observer.ts +1 -2
- package/src/core/hooks/code-walkthrough/use-code-panel.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +2 -2
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
- package/src/core/hooks/code-walkthrough/use-renderable-files.ts +1 -1
- package/src/core/hooks/index.ts +9 -0
- package/src/core/hooks/menu/use-collapse.ts +1 -1
- package/src/core/hooks/menu/use-mobile-menu-items.ts +91 -56
- package/src/core/hooks/menu/use-mobile-menu-levels.ts +14 -6
- package/src/core/hooks/prompt/use-prompt-actions.ts +28 -0
- package/src/core/hooks/prompt/use-prompt-text-limit.ts +59 -0
- package/src/core/hooks/search/use-persisted-quick-filter.ts +125 -0
- package/src/core/hooks/search/use-search-ai-activity.ts +31 -0
- package/src/core/hooks/use-connect-mcp-button.ts +13 -2
- package/src/core/hooks/use-consent-dialog.ts +51 -0
- package/src/core/hooks/use-consent-telemetry.ts +56 -0
- package/src/core/hooks/use-dialog-hotkeys.ts +11 -5
- package/src/core/hooks/use-full-height.ts +8 -8
- package/src/core/hooks/use-page-actions.ts +21 -9
- package/src/core/hooks/use-pointer-border-highlight.ts +46 -0
- package/src/core/hooks/use-scroll-item-into-view.ts +18 -0
- package/src/core/hooks/use-tab-list.ts +63 -0
- package/src/core/hooks/use-telemetry-fallback.ts +2 -0
- package/src/core/hooks/use-theme-hooks.ts +16 -0
- package/src/core/styles/dark.ts +2 -0
- package/src/core/styles/global.ts +96 -116
- package/src/core/styles/index.ts +2 -1
- package/src/core/styles/search-ai-appear.ts +16 -0
- package/src/core/types/code-walkthrough.ts +103 -0
- package/src/core/types/consent.ts +51 -0
- package/src/core/types/dropdown.ts +1 -0
- package/src/core/types/hooks.ts +8 -0
- package/src/core/types/index.ts +4 -0
- package/src/core/types/l10n.ts +46 -2
- package/src/core/types/mcp.ts +4 -2
- package/src/core/types/navigation-tabs.ts +54 -0
- package/src/core/types/prompt.ts +11 -0
- package/src/core/types/search.ts +23 -0
- package/src/core/utils/Dynamic.tsx +67 -35
- package/src/core/utils/assign-ref.ts +9 -0
- package/src/core/utils/consent-settings-link-placement.ts +18 -0
- package/src/core/utils/content-segments.ts +98 -6
- package/src/core/utils/download-code-walkthrough.ts +1 -1
- package/src/core/utils/dropdown.ts +14 -0
- package/src/core/utils/get-ai-prompt-link.ts +30 -0
- package/src/core/utils/get-code-walkthrough-file-text.ts +1 -1
- package/src/core/utils/index.ts +5 -0
- package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
- package/src/core/utils/mcp.ts +16 -4
- package/src/core/utils/menu.ts +54 -9
- package/src/core/utils/navigation-tabs.ts +99 -0
- package/src/core/utils/search-ai-activity.ts +110 -0
- package/src/core/utils/urls.ts +3 -1
- package/src/core/utils/with-load-progress.ts +23 -18
- package/src/ext/configure.ts +1 -1
- package/src/icons/CheckboxIcon/CheckboxIcon.tsx +1 -0
- package/src/icons/ChevronSortIcon/ChevronSortIcon.tsx +1 -0
- package/src/icons/ExpandCollapseIcon/ExpandCollapseIcon.tsx +56 -0
- package/src/icons/LinkIcon/LinkIconSymbol.tsx +51 -0
- package/src/index.ts +8 -0
- package/src/layouts/PageLayout.tsx +1 -1
- package/src/layouts/RootLayout.tsx +2 -2
- package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +2 -2
- package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +4 -4
- package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanelToolbar.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +2 -2
- package/src/markdoc/components/Prompt/Prompt.tsx +219 -0
- package/src/markdoc/components/Prompt/PromptActions.tsx +104 -0
- package/src/markdoc/components/Prompt/PromptBody.tsx +107 -0
- package/src/markdoc/components/Prompt/PromptCopyButton.tsx +73 -0
- package/src/markdoc/components/Prompt/PromptHeader.tsx +81 -0
- package/src/markdoc/components/Prompt/PromptShowHideButton.tsx +43 -0
- package/src/markdoc/components/Prompt/PromptToggleLabel.tsx +41 -0
- package/src/markdoc/components/Prompt/variables.dark.ts +5 -0
- package/src/markdoc/components/Prompt/variables.ts +41 -0
- package/src/markdoc/components/Tabs/TabList.tsx +9 -12
- package/src/markdoc/components/default.ts +1 -0
- package/src/markdoc/default.ts +2 -0
- package/src/markdoc/tags/code-walkthrough.ts +1 -1
- package/src/markdoc/tags/connect-mcp.ts +16 -1
- package/src/markdoc/tags/prompt.ts +58 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.LoadProgressBar = LoadProgressBar;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
|
+
const utils_1 = require("../../core/utils");
|
|
43
|
+
const START = 0.08;
|
|
44
|
+
const MAX_PENDING = 0.994;
|
|
45
|
+
const TRICKLE_MS = 100;
|
|
46
|
+
const SETTLE_MS = 200;
|
|
47
|
+
// [below, step]: large steps at first, smaller ones near the end.
|
|
48
|
+
const TRICKLE_STEPS = [
|
|
49
|
+
[0.2, 0.1],
|
|
50
|
+
[0.5, 0.04],
|
|
51
|
+
[0.8, 0.02],
|
|
52
|
+
[0.99, 0.005],
|
|
53
|
+
];
|
|
54
|
+
function trickle(progress) {
|
|
55
|
+
var _a;
|
|
56
|
+
var _b;
|
|
57
|
+
const step = (_b = (_a = TRICKLE_STEPS.find(([below]) => progress < below)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : 0;
|
|
58
|
+
return Math.min(progress + step, MAX_PENDING);
|
|
59
|
+
}
|
|
60
|
+
/** A top-of-page bar while a page load is pending. */
|
|
61
|
+
function LoadProgressBar({ pending = false, className, }) {
|
|
62
|
+
const loading = (0, react_1.useSyncExternalStore)(utils_1.subscribeToLoadProgress, utils_1.isLoadInProgress, () => false);
|
|
63
|
+
const active = pending || loading;
|
|
64
|
+
const [progress, setProgress] = (0, react_1.useState)(null);
|
|
65
|
+
const [fading, setFading] = (0, react_1.useState)(false);
|
|
66
|
+
const shown = (0, react_1.useRef)(false);
|
|
67
|
+
(0, react_1.useEffect)(() => {
|
|
68
|
+
if (active) {
|
|
69
|
+
shown.current = true;
|
|
70
|
+
setFading(false);
|
|
71
|
+
setProgress((current) => (current === null || current === 1 ? START : current));
|
|
72
|
+
const timer = setInterval(() => setProgress((current) => trickle(current !== null && current !== void 0 ? current : START)), TRICKLE_MS);
|
|
73
|
+
return () => clearInterval(timer);
|
|
74
|
+
}
|
|
75
|
+
if (!shown.current)
|
|
76
|
+
return undefined;
|
|
77
|
+
setProgress(1);
|
|
78
|
+
const fade = setTimeout(() => setFading(true), SETTLE_MS);
|
|
79
|
+
const hide = setTimeout(() => {
|
|
80
|
+
shown.current = false;
|
|
81
|
+
setProgress(null);
|
|
82
|
+
setFading(false);
|
|
83
|
+
}, SETTLE_MS * 2);
|
|
84
|
+
return () => {
|
|
85
|
+
clearTimeout(fade);
|
|
86
|
+
clearTimeout(hide);
|
|
87
|
+
};
|
|
88
|
+
}, [active]);
|
|
89
|
+
if (progress === null)
|
|
90
|
+
return null;
|
|
91
|
+
// The id and class names come from the replaced nprogress library: custom styles target them.
|
|
92
|
+
return (react_1.default.createElement(LoadProgressBarWrapper, { id: "nprogress", "data-component-name": "LoadProgressBar/LoadProgressBar", className: className, "aria-hidden": "true", $fading: fading },
|
|
93
|
+
react_1.default.createElement(Bar, { className: "bar", $progress: progress },
|
|
94
|
+
react_1.default.createElement(Peg, { className: "peg" }))));
|
|
95
|
+
}
|
|
96
|
+
const LoadProgressBarWrapper = styled_components_1.default.div `
|
|
97
|
+
pointer-events: none;
|
|
98
|
+
opacity: ${({ $fading }) => ($fading ? 0 : 1)};
|
|
99
|
+
transition: opacity ${SETTLE_MS}ms linear;
|
|
100
|
+
`;
|
|
101
|
+
// The offset changes on each tick: as a styled rule, each value would add a class.
|
|
102
|
+
const Bar = styled_components_1.default.div.attrs(({ $progress }) => ({
|
|
103
|
+
style: { transform: `translate3d(${($progress - 1) * 100}%, 0, 0)` },
|
|
104
|
+
})) `
|
|
105
|
+
position: fixed;
|
|
106
|
+
z-index: var(--z-index-popover);
|
|
107
|
+
top: 0;
|
|
108
|
+
left: 0;
|
|
109
|
+
width: 100%;
|
|
110
|
+
height: var(--load-progress-bar-height);
|
|
111
|
+
background: var(--load-progress-bar-color);
|
|
112
|
+
transition: transform ${SETTLE_MS}ms ease;
|
|
113
|
+
`;
|
|
114
|
+
const Peg = styled_components_1.default.div `
|
|
115
|
+
position: absolute;
|
|
116
|
+
right: 0;
|
|
117
|
+
width: 100px;
|
|
118
|
+
height: 100%;
|
|
119
|
+
box-shadow: var(--load-progress-bar-shadow);
|
|
120
|
+
transform: rotate(3deg) translate(0, -4px);
|
|
121
|
+
`;
|
|
122
|
+
//# sourceMappingURL=LoadProgressBar.js.map
|
|
@@ -41,6 +41,7 @@ const react_1 = __importStar(require("react"));
|
|
|
41
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
42
|
const hooks_1 = require("../../core/hooks");
|
|
43
43
|
const utils_1 = require("../../core/utils");
|
|
44
|
+
const Button_1 = require("../../components/Button/Button");
|
|
44
45
|
const CodeBlock_1 = require("../../components/CodeBlock/CodeBlock");
|
|
45
46
|
const ClaudeIcon_1 = require("../../icons/ClaudeIcon/ClaudeIcon");
|
|
46
47
|
const ChatGptIcon_1 = require("../../icons/ChatGptIcon/ChatGptIcon");
|
|
@@ -111,9 +112,11 @@ function renderTabContent(option, connection, translate, snippetHeader) {
|
|
|
111
112
|
react_1.default.createElement(CodeBlock_1.CodeBlock, { lang: "shell", source: (0, utils_1.generateClaudeCodeCommand)(connection), header: snippetHeader(option, 'claude-code'), wrapContents: true }))),
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
|
-
headline: translate('page.mcpNotAllowed.snippets.claudeDesktop.headline', 'Claude
|
|
115
|
+
headline: translate('page.mcpNotAllowed.snippets.claudeDesktop.headline', 'Claude app'),
|
|
115
116
|
content: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
116
|
-
react_1.default.createElement(TabHint, null, translate('page.mcpNotAllowed.snippets.claudeDesktop.
|
|
117
|
+
react_1.default.createElement(TabHint, null, translate('page.mcpNotAllowed.snippets.claudeDesktop.accountHint', 'Claude adds the connector to your account and syncs it between Claude on the web and Claude Desktop.')),
|
|
118
|
+
react_1.default.createElement(ConnectButton, { variant: "secondary", icon: react_1.default.createElement(ClaudeIcon_1.ClaudeIcon, null), onClick: () => window.open((0, utils_1.generateMCPDeepLink)('claude', connection), '_blank') }, translate('page.actions.connectMcp.claude', 'Connect to Claude')),
|
|
119
|
+
react_1.default.createElement(TabHint, null, translate('page.mcpNotAllowed.snippets.claudeDesktop.instruction', 'Or open Customize → Connectors → Add custom connector and paste this server URL:')),
|
|
117
120
|
react_1.default.createElement(CodeBlock_1.CodeBlock, { lang: "text", source: connection.url, header: snippetHeader(option, 'claude-desktop') }))),
|
|
118
121
|
},
|
|
119
122
|
]);
|
|
@@ -154,6 +157,10 @@ const McpConnectionTabsWrapper = styled_components_1.default.div `
|
|
|
154
157
|
padding-right: var(--page-mcp-405-snippets-code-padding-right);
|
|
155
158
|
}
|
|
156
159
|
`;
|
|
160
|
+
const ConnectButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
161
|
+
align-self: flex-start;
|
|
162
|
+
margin-bottom: var(--spacing-sm);
|
|
163
|
+
`;
|
|
157
164
|
const TabHint = styled_components_1.default.p `
|
|
158
165
|
margin: 0 0 var(--spacing-xs);
|
|
159
166
|
color: var(--page-mcp-405-snippets-hint-text-color);
|
|
@@ -82,7 +82,7 @@ exports.Markdown = styled_components_1.default.main
|
|
|
82
82
|
${links_1.markdownLinksCss}
|
|
83
83
|
|
|
84
84
|
a[name], [id] {
|
|
85
|
-
scroll-margin-top:
|
|
85
|
+
scroll-margin-top: var(--navbar-offset);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
img,
|
|
@@ -95,7 +95,7 @@ exports.Markdown = styled_components_1.default.main
|
|
|
95
95
|
font-family: var(--heading-font-family);
|
|
96
96
|
position: relative;
|
|
97
97
|
|
|
98
|
-
scroll-margin-top:
|
|
98
|
+
scroll-margin-top: var(--navbar-offset);
|
|
99
99
|
${(0, heading_anchor_1.headingAnchorCss)(constants_1.ANCHOR_CLASS)};
|
|
100
100
|
|
|
101
101
|
h1,
|
|
@@ -306,6 +306,7 @@ exports.Markdown = styled_components_1.default.main
|
|
|
306
306
|
font-size: inherit;
|
|
307
307
|
font-family: inherit;
|
|
308
308
|
border: none;
|
|
309
|
+
padding: 0;
|
|
309
310
|
}
|
|
310
311
|
}
|
|
311
312
|
|
|
@@ -23,7 +23,7 @@ exports.markdownBaseTableCss = (0, styled_components_1.css) `
|
|
|
23
23
|
color: var(--md-table-cell-text-color);
|
|
24
24
|
font-size: var(--md-table-font-size);
|
|
25
25
|
line-height: var(--md-table-line-height);
|
|
26
|
-
vertical-align:
|
|
26
|
+
vertical-align: var(--md-table-cell-vertical-align);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
thead td,
|
|
@@ -72,6 +72,19 @@ exports.markdownBaseTableCss = (0, styled_components_1.css) `
|
|
|
72
72
|
th[align='right'] {
|
|
73
73
|
text-align: right;
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
th[valign='top'],
|
|
77
|
+
td[valign='top'] {
|
|
78
|
+
vertical-align: top;
|
|
79
|
+
}
|
|
80
|
+
th[valign='middle'],
|
|
81
|
+
td[valign='middle'] {
|
|
82
|
+
vertical-align: middle;
|
|
83
|
+
}
|
|
84
|
+
th[valign='bottom'],
|
|
85
|
+
td[valign='bottom'] {
|
|
86
|
+
vertical-align: bottom;
|
|
87
|
+
}
|
|
75
88
|
}
|
|
76
89
|
`;
|
|
77
90
|
//# sourceMappingURL=base-table.js.map
|
|
@@ -53,6 +53,7 @@ exports.markdown = (0, styled_components_1.css) `
|
|
|
53
53
|
--md-table-cell-text-color: var(--text-color-secondary); // @presenter Color
|
|
54
54
|
--md-table-cell-padding: var(--spacing-xs) var(--spacing-sm); // @presenter Spacing
|
|
55
55
|
--md-table-footer-cell-padding: var(--spacing-xxs) var(--spacing-sm); // @presenter Spacing
|
|
56
|
+
--md-table-cell-vertical-align: top;
|
|
56
57
|
|
|
57
58
|
--md-table-head-bg-color: var(--md-table-bg-color); // @presenter Color
|
|
58
59
|
--md-table-head-text-color: var(--text-color-primary); // @presenter Color
|
|
@@ -7,12 +7,16 @@ exports.Menu = Menu;
|
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const MenuItem_1 = require("../../components/Menu/MenuItem");
|
|
10
|
+
const MenuSelect_1 = require("../../components/Menu/MenuSelect");
|
|
10
11
|
const constants_1 = require("../../core/constants");
|
|
11
12
|
const utils_1 = require("../../core/utils");
|
|
12
13
|
function Menu({ depth = 0, items, className, isMobile, onDrilldownOpen, }) {
|
|
13
14
|
const activeItem = items.find(({ active }) => active);
|
|
14
15
|
return (react_1.default.createElement(MenuWrapper, { className: className, "data-component-name": "Menu/Menu" }, items.map((item, index) => {
|
|
15
16
|
var _a;
|
|
17
|
+
if ((0, utils_1.getMenuItemType)(item) === constants_1.MenuItemType.Select) {
|
|
18
|
+
return react_1.default.createElement(MenuSelect_1.MenuSelect, { item: item, key: `${item.label}-${index}` });
|
|
19
|
+
}
|
|
16
20
|
return (react_1.default.createElement(MenuItem_1.MenuItem, { item: item, key: `${item.link || item.label}-${index}`, activeItem: activeItem, isMobile: isMobile, depth: depth, onClick: () => {
|
|
17
21
|
if ((0, utils_1.getMenuItemType)(item) === constants_1.MenuItemType.DrillDown) {
|
|
18
22
|
onDrilldownOpen === null || onDrilldownOpen === void 0 ? void 0 : onDrilldownOpen({ previousLink: activeItem === null || activeItem === void 0 ? void 0 : activeItem.link, item });
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MenuSelect = MenuSelect;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const utils_1 = require("../../core/utils");
|
|
10
|
+
const hooks_1 = require("../../core/hooks");
|
|
11
|
+
const Dropdown_1 = require("../../components/Dropdown/Dropdown");
|
|
12
|
+
const DropdownMenu_1 = require("../../components/Dropdown/DropdownMenu");
|
|
13
|
+
const DropdownMenuItem_1 = require("../../components/Dropdown/DropdownMenuItem");
|
|
14
|
+
const GenericIcon_1 = require("../../icons/GenericIcon/GenericIcon");
|
|
15
|
+
const LaunchIcon_1 = require("../../icons/LaunchIcon/LaunchIcon");
|
|
16
|
+
const ChevronDownIcon_1 = require("../../icons/ChevronDownIcon/ChevronDownIcon");
|
|
17
|
+
const CheckmarkIcon_1 = require("../../icons/CheckmarkIcon/CheckmarkIcon");
|
|
18
|
+
function MenuSelect({ item, className }) {
|
|
19
|
+
const { useTranslate, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
20
|
+
const { translate } = useTranslate();
|
|
21
|
+
const telemetry = useTelemetry();
|
|
22
|
+
return (react_1.default.createElement(MenuSelectWrapper, { "data-component-name": "Menu/MenuSelect", className: className, role: "listitem" },
|
|
23
|
+
react_1.default.createElement(MenuSelectDropdown, { alignment: "start", trigger: react_1.default.createElement(MenuSelectTrigger, { type: "button" },
|
|
24
|
+
react_1.default.createElement(MenuSelectLabel, null, translate(item.labelTranslationKey, item.label)),
|
|
25
|
+
react_1.default.createElement(MenuSelectChevron, { size: "var(--menu-select-icon-size)", color: "--menu-select-icon-color" })) },
|
|
26
|
+
react_1.default.createElement(MenuSelectMenu, null, item.items.map((option, index) => {
|
|
27
|
+
const key = `${option.link || option.label}-${index}`;
|
|
28
|
+
const checkmark = option.active ? (react_1.default.createElement(MenuSelectCheckmark, { size: "var(--menu-select-option-checkmark-size)" })) : null;
|
|
29
|
+
const content = (react_1.default.createElement(MenuSelectOptionContent, { $active: option.active },
|
|
30
|
+
option.icon || option.srcSet ? (react_1.default.createElement(MenuSelectOptionIcon, { icon: option.icon, srcSet: option.srcSet })) : null,
|
|
31
|
+
translate(option.labelTranslationKey, option.label),
|
|
32
|
+
option.external ? (react_1.default.createElement(LaunchIcon_1.LaunchIcon, { size: "var(--menu-select-option-external-icon-size)" })) : null));
|
|
33
|
+
if (!option.link) {
|
|
34
|
+
return (react_1.default.createElement(MenuSelectOption, { key: key, active: option.active, prefix: checkmark, dataAttributes: { 'aria-disabled': 'true' } }, content));
|
|
35
|
+
}
|
|
36
|
+
return (react_1.default.createElement(MenuSelectOption, { key: key, to: option.link, external: option.external, target: option.target === '_blank' ? '_blank' : undefined, active: option.active, "aria-current": option.active ? 'page' : undefined, prefix: checkmark, onAction: () => telemetry.sendSidebarItemClickedMessage([
|
|
37
|
+
Object.assign(Object.assign({}, (0, utils_1.getBaseDataAttributes)('sidebarItem', 'sidebar')), { label: option.label, type: 'link' }),
|
|
38
|
+
]) }, content));
|
|
39
|
+
})))));
|
|
40
|
+
}
|
|
41
|
+
const MenuSelectWrapper = styled_components_1.default.div `
|
|
42
|
+
margin: var(--menu-select-margin);
|
|
43
|
+
`;
|
|
44
|
+
const MenuSelectDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown) `
|
|
45
|
+
--dropdown-menu-padding-top: var(--menu-select-menu-offset);
|
|
46
|
+
--dropdown-menu-padding: var(--menu-select-menu-padding);
|
|
47
|
+
--dropdown-menu-border-radius: var(--menu-select-menu-border-radius);
|
|
48
|
+
--dropdown-menu-item-gap: var(--menu-select-option-gap);
|
|
49
|
+
--dropdown-menu-item-border-radius: var(--menu-select-option-border-radius);
|
|
50
|
+
--dropdown-menu-item-bg-color-active: var(--menu-select-option-bg-color-active);
|
|
51
|
+
--dropdown-menu-item-color-active: var(--menu-select-option-text-color-active);
|
|
52
|
+
|
|
53
|
+
width: 100%;
|
|
54
|
+
|
|
55
|
+
> * {
|
|
56
|
+
min-width: 100%;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
const MenuSelectChevron = (0, styled_components_1.default)(ChevronDownIcon_1.ChevronDownIcon) `
|
|
60
|
+
transition: var(--menu-select-transition);
|
|
61
|
+
`;
|
|
62
|
+
const MenuSelectTrigger = styled_components_1.default.button `
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: var(--menu-select-gap);
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: var(--menu-select-height);
|
|
69
|
+
padding: 0 var(--menu-select-padding-horizontal);
|
|
70
|
+
border: var(--menu-select-border);
|
|
71
|
+
border-radius: var(--menu-select-border-radius);
|
|
72
|
+
background-color: var(--menu-select-bg-color);
|
|
73
|
+
color: var(--menu-select-text-color);
|
|
74
|
+
font-family: inherit;
|
|
75
|
+
font-size: var(--menu-select-font-size);
|
|
76
|
+
line-height: var(--menu-select-line-height);
|
|
77
|
+
text-align: left;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
|
|
80
|
+
&:focus-visible {
|
|
81
|
+
outline: 1px solid var(--menu-select-border-color-focused);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&[aria-expanded='true'] ${MenuSelectChevron} {
|
|
85
|
+
transform: rotate(180deg);
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
const MenuSelectLabel = styled_components_1.default.span `
|
|
89
|
+
flex: 1;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
`;
|
|
95
|
+
const MenuSelectMenu = (0, styled_components_1.default)(DropdownMenu_1.DropdownMenu) `
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
width: 100%;
|
|
98
|
+
max-width: 100%;
|
|
99
|
+
`;
|
|
100
|
+
const MenuSelectOption = (0, styled_components_1.default)(DropdownMenuItem_1.DropdownMenuItem) `
|
|
101
|
+
position: relative;
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
padding: var(--menu-select-option-padding);
|
|
104
|
+
|
|
105
|
+
&[aria-disabled='true'] {
|
|
106
|
+
cursor: default;
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
const MenuSelectCheckmark = (0, styled_components_1.default)(CheckmarkIcon_1.CheckmarkIcon) `
|
|
111
|
+
position: absolute;
|
|
112
|
+
top: 50%;
|
|
113
|
+
left: var(--menu-select-option-checkmark-offset);
|
|
114
|
+
transform: translateY(-50%);
|
|
115
|
+
`;
|
|
116
|
+
const MenuSelectOptionContent = styled_components_1.default.span `
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
gap: var(--menu-select-option-content-gap);
|
|
120
|
+
font-weight: ${({ $active }) => $active
|
|
121
|
+
? 'var(--menu-select-option-font-weight-active)'
|
|
122
|
+
: 'var(--menu-select-option-font-weight)'};
|
|
123
|
+
`;
|
|
124
|
+
const MenuSelectOptionIcon = (0, styled_components_1.default)(GenericIcon_1.GenericIcon) `
|
|
125
|
+
--icon-width: var(--menu-select-option-icon-size);
|
|
126
|
+
--icon-height: var(--menu-select-option-icon-size);
|
|
127
|
+
flex-shrink: 0;
|
|
128
|
+
`;
|
|
129
|
+
//# sourceMappingURL=MenuSelect.js.map
|
|
@@ -104,6 +104,45 @@ exports.menu = (0, styled_components_1.css) `
|
|
|
104
104
|
--menu-back-button-gap: var(--spacing-xs);
|
|
105
105
|
--menu-back-button-icon: none;
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* @tokens Menu select
|
|
109
|
+
*/
|
|
110
|
+
--menu-select-margin-top: 0;
|
|
111
|
+
--menu-select-margin-bottom: var(--spacing-xs);
|
|
112
|
+
--menu-select-margin-horizontal: var(--menu-item-label-margin-horizontal);
|
|
113
|
+
--menu-select-margin: var(--menu-select-margin-top) var(--menu-select-margin-horizontal) var(--menu-select-margin-bottom); // @presenter Spacing
|
|
114
|
+
--menu-select-height: 32px; // @presenter Spacing
|
|
115
|
+
--menu-select-padding-horizontal: calc(var(--spacing-sm) - var(--border-width)); // @presenter Spacing
|
|
116
|
+
--menu-select-gap: var(--spacing-xxs); // @presenter Spacing
|
|
117
|
+
--menu-select-font-size: var(--font-size-base); // @presenter FontSize
|
|
118
|
+
--menu-select-line-height: var(--line-height-base); // @presenter LineHeight
|
|
119
|
+
--menu-select-text-color: var(--input-content-color-active); // @presenter Color
|
|
120
|
+
--menu-select-bg-color: var(--input-bg-color); // @presenter Color
|
|
121
|
+
--menu-select-border: var(--input-border); // @presenter Border
|
|
122
|
+
--menu-select-border-color-focused: var(--input-border-color-focused); // @presenter Color
|
|
123
|
+
--menu-select-border-radius: var(--input-border-radius); // @presenter BorderRadius
|
|
124
|
+
--menu-select-icon-size: 16px;
|
|
125
|
+
--menu-select-icon-color: var(--icon-color-secondary); // @presenter Color
|
|
126
|
+
--menu-select-transition: transform 150ms ease-in-out;
|
|
127
|
+
--menu-select-menu-offset: var(--spacing-xs); // @presenter Spacing
|
|
128
|
+
--menu-select-menu-padding: calc(var(--dropdown-menu-padding) - var(--border-width)); // @presenter Spacing
|
|
129
|
+
--menu-select-menu-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
130
|
+
--menu-select-option-gap: calc(var(--spacing-unit) / 2); // @presenter Spacing
|
|
131
|
+
--menu-select-option-content-gap: var(--spacing-xs); // @presenter Spacing
|
|
132
|
+
--menu-select-option-padding-vertical: var(--dropdown-menu-item-padding-vertical);
|
|
133
|
+
--menu-select-option-padding-left: var(--spacing-md);
|
|
134
|
+
--menu-select-option-padding-right: var(--spacing-sm);
|
|
135
|
+
--menu-select-option-padding: var(--menu-select-option-padding-vertical) var(--menu-select-option-padding-right) var(--menu-select-option-padding-vertical) var(--menu-select-option-padding-left); // @presenter Spacing
|
|
136
|
+
--menu-select-option-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
137
|
+
--menu-select-option-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
138
|
+
--menu-select-option-font-weight-active: var(--font-weight-medium); // @presenter FontWeight
|
|
139
|
+
--menu-select-option-text-color-active: var(--text-color-primary); // @presenter Color
|
|
140
|
+
--menu-select-option-bg-color-active: transparent; // @presenter Color
|
|
141
|
+
--menu-select-option-icon-size: var(--menu-item-icon-size);
|
|
142
|
+
--menu-select-option-external-icon-size: var(--menu-item-external-icon-size);
|
|
143
|
+
--menu-select-option-checkmark-size: 14px;
|
|
144
|
+
--menu-select-option-checkmark-offset: calc((var(--menu-select-option-padding-left) - var(--menu-select-option-checkmark-size)) / 2);
|
|
145
|
+
|
|
107
146
|
/**
|
|
108
147
|
* @tokens Menu items
|
|
109
148
|
*/
|
|
@@ -134,18 +173,18 @@ exports.mobileMenu = (0, styled_components_1.css) `
|
|
|
134
173
|
* @tokens Mobile Menu
|
|
135
174
|
* */
|
|
136
175
|
/* Fallback for older browsers. dvh accounts for dynamic UI elements like mobile address bars */
|
|
137
|
-
--menu-mobile-height: calc(100vh - var(--navbar-
|
|
138
|
-
--menu-mobile-height: calc(100dvh - var(--navbar-
|
|
176
|
+
--menu-mobile-height: calc(100vh - var(--navbar-offset));
|
|
177
|
+
--menu-mobile-height: calc(100dvh - var(--navbar-offset));
|
|
139
178
|
--menu-mobile-width: 100%;
|
|
140
179
|
--menu-mobile-z-index: var(--z-index-raised);
|
|
141
180
|
--menu-mobile-left: 0;
|
|
142
|
-
--menu-mobile-top:
|
|
181
|
+
--menu-mobile-top: var(--navbar-offset);
|
|
143
182
|
--menu-mobile-transition: 0.5s;
|
|
144
183
|
--menu-mobile-bg: var(--bg-color); // @presenter Color
|
|
145
184
|
--menu-mobile-margin: var(--menu-mobile-items-margin-top) var(--menu-mobile-margin-horizontal) 0 var(--menu-mobile-margin-horizontal);
|
|
146
185
|
--menu-mobile-line-height: var(--line-height-base); // @presenter LineHeight
|
|
147
186
|
--menu-mobile-padding-top: var(--spacing-sm); // @presenter Spacing
|
|
148
|
-
--menu-mobile-margin-horizontal:
|
|
187
|
+
--menu-mobile-margin-horizontal: 0; // @presenter Spacing
|
|
149
188
|
--menu-mobile-items-margin-top: var(--spacing-xxs); // @presenter Spacing
|
|
150
189
|
|
|
151
190
|
--menu-mobile-profile-bg-color: var(--bg-color); // @presenter Color
|
|
@@ -1,15 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.Navbar = Navbar;
|
|
7
|
-
const react_1 =
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
8
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
42
|
const utils_1 = require("../../core/utils");
|
|
10
43
|
const hooks_1 = require("../../core/hooks");
|
|
11
44
|
const NavbarLogo_1 = require("../../components/Navbar/NavbarLogo");
|
|
12
45
|
const NavbarMenu_1 = require("../../components/Navbar/NavbarMenu");
|
|
46
|
+
const NavigationTabs_1 = require("../../components/NavigationTabs/NavigationTabs");
|
|
13
47
|
const MenuMobile_1 = require("../../components/Menu/MenuMobile");
|
|
14
48
|
const ColorModeSwitcher_1 = require("../../components/ColorModeSwitcher/ColorModeSwitcher");
|
|
15
49
|
const Search_1 = require("../../components/Search/Search");
|
|
@@ -24,9 +58,12 @@ function Navbar({ className }) {
|
|
|
24
58
|
var _a;
|
|
25
59
|
const { isOpen, closeMobileMenu, openMobileMenu } = (0, hooks_1.useMobileMenu)(false);
|
|
26
60
|
const themeConfig = (0, hooks_1.useThemeConfig)();
|
|
27
|
-
const { useL10n, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
61
|
+
const { useL10n, useTelemetry, useTranslate, useNavigationTabs } = (0, hooks_1.useThemeHooks)();
|
|
28
62
|
const { changeLanguage } = useL10n();
|
|
63
|
+
const { translate } = useTranslate();
|
|
29
64
|
const telemetry = useTelemetry();
|
|
65
|
+
const navigationTabs = useNavigationTabs();
|
|
66
|
+
const navigationTabsConfig = (0, react_1.useMemo)(() => (0, utils_1.toNavigationTabsConfig)({ state: navigationTabs }), [navigationTabs]);
|
|
30
67
|
const menu = (_a = themeConfig.navbar) === null || _a === void 0 ? void 0 : _a.items;
|
|
31
68
|
const { search: searchSettings, navbar, userMenu: userMenuSettings, logo } = themeConfig;
|
|
32
69
|
if (navbar === null || navbar === void 0 ? void 0 : navbar.hide) {
|
|
@@ -34,7 +71,7 @@ function Navbar({ className }) {
|
|
|
34
71
|
}
|
|
35
72
|
const hideSearch = (searchSettings === null || searchSettings === void 0 ? void 0 : searchSettings.hide) || ((searchSettings === null || searchSettings === void 0 ? void 0 : searchSettings.placement) && (searchSettings === null || searchSettings === void 0 ? void 0 : searchSettings.placement) !== 'navbar');
|
|
36
73
|
const hideUserMenu = userMenuSettings === null || userMenuSettings === void 0 ? void 0 : userMenuSettings.hide;
|
|
37
|
-
return (react_1.default.createElement(NavbarWrapper, { "data-component-name": "Navbar/Navbar", className: className },
|
|
74
|
+
return (react_1.default.createElement(NavbarWrapper, { "data-component-name": "Navbar/Navbar", className: className, "aria-label": translate('navbar.label', 'Main navigation') },
|
|
38
75
|
react_1.default.createElement(Banner_1.Banner, null),
|
|
39
76
|
isOpen && react_1.default.createElement(MenuMobile_1.MenuMobile, { hideUserProfile: !!hideUserMenu }),
|
|
40
77
|
react_1.default.createElement(NavbarRow, null,
|
|
@@ -57,11 +94,12 @@ function Navbar({ className }) {
|
|
|
57
94
|
(0, utils_1.getBaseDataAttributes)('mobileMenuOpen', 'button'),
|
|
58
95
|
]);
|
|
59
96
|
}, icon: isOpen ? react_1.default.createElement(CloseIcon_1.CloseIcon, null) : react_1.default.createElement(MenuIcon_1.MenuIcon, null), "aria-label": isOpen ? 'Close menu button' : 'Open menu button' }),
|
|
60
|
-
hideUserMenu ? null : react_1.default.createElement(UserMenu_1.UserMenu, null))
|
|
97
|
+
hideUserMenu ? null : react_1.default.createElement(UserMenu_1.UserMenu, null)),
|
|
98
|
+
navigationTabsConfig && react_1.default.createElement(NavigationTabs_1.NavigationTabs, { config: navigationTabsConfig })));
|
|
61
99
|
}
|
|
62
100
|
const NavbarWrapper = styled_components_1.default.nav `
|
|
63
101
|
--text-color: var(--navbar-text-color);
|
|
64
|
-
height: calc(var(--navbar-height) + var(--banner-height));
|
|
102
|
+
height: var(--navbar-offset, calc(var(--navbar-height) + var(--banner-height)));
|
|
65
103
|
transition: height 0.4s ease-out;
|
|
66
104
|
|
|
67
105
|
position: sticky;
|
|
@@ -101,6 +139,7 @@ const NavbarRow = styled_components_1.default.div `
|
|
|
101
139
|
box-sizing: border-box;
|
|
102
140
|
margin-top: var(--banner-height);
|
|
103
141
|
transition: margin-top 0.5s ease-out;
|
|
142
|
+
border-bottom-color: var(--navbar-row-bottom-border-color, var(--navbar-border-color));
|
|
104
143
|
|
|
105
144
|
@media screen and (min-width: ${utils_1.breakpoints.max}) {
|
|
106
145
|
max-width: var(--container-max-width);
|
|
@@ -6,9 +6,12 @@ exports.navbar = (0, styled_components_1.css) `
|
|
|
6
6
|
--navbar-bg-color: var(--bg-color); // @presenter Color
|
|
7
7
|
--navbar-border-color: var(--border-color-secondary);
|
|
8
8
|
--navbar-border: 1px solid var(--navbar-border-color);
|
|
9
|
+
--navbar-row-bottom-border-color: var(--navbar-border-color);
|
|
9
10
|
|
|
10
11
|
--navbar-text-color: var(--text-color-secondary); // @presenter Color
|
|
11
12
|
--navbar-height: 64px; // @presenter Spacing
|
|
13
|
+
--navbar-stack-height: var(--navbar-height);
|
|
14
|
+
--navbar-offset: calc(var(--navbar-stack-height) + var(--banner-height));
|
|
12
15
|
--navbar-font-size: var(--font-size-base);
|
|
13
16
|
--navbar-padding: 0 var(--spacing-xl); // @presenter Spacing
|
|
14
17
|
--navbar-font-family: var(--font-family-base);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { NavigationTabRowItem } from '../../core/types';
|
|
3
|
+
export type NavigationTabProps = {
|
|
4
|
+
tab: NavigationTabRowItem;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function NavigationTab({ tab, className }: NavigationTabProps): JSX.Element | null;
|