@redocly/theme 0.54.0-next.3 → 0.54.0-next.5
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/Admonition/Admonition.d.ts +1 -0
- package/lib/components/Badge/Badge.d.ts +1 -1
- package/lib/components/Breadcrumbs/Breadcrumb.d.ts +1 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +1 -0
- package/lib/components/Button/Button.d.ts +1 -0
- package/lib/components/Buttons/EditPageButton.d.ts +1 -0
- package/lib/components/Buttons/EmailButton.d.ts +1 -0
- package/lib/components/Buttons/NewTabButton.d.ts +1 -0
- package/lib/components/CatalogLegacy/CatalogLegacy.d.ts +1 -0
- package/lib/components/CatalogLegacy/CatalogLegacyActions.d.ts +1 -0
- package/lib/components/CatalogLegacy/CatalogLegacyCard.d.ts +1 -0
- package/lib/components/CatalogLegacy/CatalogLegacyHighlight.d.ts +1 -0
- package/lib/components/CatalogLegacy/CatalogLegacyInfoBlock.d.ts +1 -0
- package/lib/components/CodeBlock/CodeBlock.d.ts +1 -0
- package/lib/components/CodeBlock/CodeBlockContainer.d.ts +1 -1
- package/lib/components/CodeBlock/CodeBlockControls.d.ts +1 -0
- package/lib/components/CodeBlock/CodeBlockControls.js +14 -7
- package/lib/components/CodeBlock/CodeBlockTabs.d.ts +1 -0
- package/lib/components/CodeBlock/CodeBlockTabs.js +3 -1
- package/lib/components/ColorModeSwitcher/ColorModeIcon.d.ts +1 -0
- package/lib/components/ColorModeSwitcher/ColorModeSwitcher.d.ts +1 -0
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/DropdownMenu.d.ts +1 -1
- package/lib/components/Dropdown/DropdownMenuItem.d.ts +1 -1
- package/lib/components/Feedback/Comment.d.ts +1 -0
- package/lib/components/Feedback/Feedback.js +3 -3
- package/lib/components/Feedback/Mood.d.ts +1 -0
- package/lib/components/Feedback/Rating.d.ts +1 -0
- package/lib/components/Feedback/Reasons.d.ts +1 -0
- package/lib/components/Feedback/ReportDialog.d.ts +1 -0
- package/lib/components/Feedback/Scale.d.ts +1 -0
- package/lib/components/Feedback/Scale.js +1 -1
- package/lib/components/Feedback/Sentiment.d.ts +1 -0
- package/lib/components/Feedback/Sentiment.js +4 -4
- package/lib/components/Feedback/Stars.d.ts +1 -0
- package/lib/components/Filter/Filter.d.ts +1 -0
- package/lib/components/Filter/FilterCheckboxes.d.ts +1 -0
- package/lib/components/Filter/FilterContent.d.ts +1 -0
- package/lib/components/Filter/FilterDateRange.d.ts +1 -0
- package/lib/components/Filter/FilterInput.d.ts +1 -0
- package/lib/components/Filter/FilterOption.d.ts +1 -1
- package/lib/components/Filter/FilterOptionLabel.d.ts +1 -1
- package/lib/components/Filter/FilterOptions.d.ts +1 -1
- package/lib/components/Filter/FilterPopover.d.ts +1 -0
- package/lib/components/Filter/FilterPopover.js +1 -1
- package/lib/components/Filter/FilterSelect.d.ts +1 -0
- package/lib/components/Filter/FilterTitle.d.ts +1 -1
- package/lib/components/Footer/Footer.d.ts +1 -0
- package/lib/components/Footer/FooterColumn.d.ts +1 -0
- package/lib/components/Footer/FooterCopyright.d.ts +1 -0
- package/lib/components/Footer/FooterItem.d.ts +1 -0
- package/lib/components/Image/Image.d.ts +1 -0
- package/lib/components/LanguagePicker/LanguagePicker.d.ts +1 -0
- package/lib/components/LastUpdated/LastUpdated.d.ts +1 -0
- package/lib/components/Link/Link.d.ts +1 -0
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/Loaders/Loading.d.ts +1 -0
- package/lib/components/Loaders/SpinnerLoader.d.ts +1 -0
- package/lib/components/Logo/Logo.d.ts +1 -0
- package/lib/components/Menu/Menu.d.ts +1 -0
- package/lib/components/Menu/MenuContainer.d.ts +1 -1
- package/lib/components/Menu/MenuItem.d.ts +1 -0
- package/lib/components/Menu/MenuItem.js +5 -4
- package/lib/components/Menu/MenuMobile.d.ts +1 -0
- package/lib/components/Menu/variables.js +2 -1
- package/lib/components/Navbar/Navbar.d.ts +1 -0
- package/lib/components/Navbar/NavbarItem.d.ts +1 -0
- package/lib/components/Navbar/NavbarMenu.d.ts +1 -0
- package/lib/components/PageNavigation/NextButton.d.ts +1 -0
- package/lib/components/PageNavigation/PageNavigation.d.ts +1 -0
- package/lib/components/PageNavigation/PreviousButton.d.ts +1 -0
- package/lib/components/Panel/Panel.d.ts +1 -1
- package/lib/components/Portal/Portal.d.ts +1 -1
- package/lib/components/Product/Product.d.ts +1 -0
- package/lib/components/Product/ProductPicker.d.ts +1 -0
- package/lib/components/Search/Search.d.ts +1 -0
- package/lib/components/Search/SearchAiConversationInput.d.ts +1 -0
- package/lib/components/Search/SearchAiDialog.d.ts +1 -0
- package/lib/components/Search/SearchAiMessage.d.ts +1 -0
- package/lib/components/Search/SearchAiResponse.d.ts +1 -0
- package/lib/components/Search/SearchDialog.d.ts +1 -0
- package/lib/components/Search/SearchFilter.d.ts +1 -0
- package/lib/components/Search/SearchFilterField.d.ts +1 -0
- package/lib/components/Search/SearchGroups.d.ts +1 -0
- package/lib/components/Search/SearchHighlight.d.ts +1 -0
- package/lib/components/Search/SearchInput.d.ts +2 -1
- package/lib/components/Search/SearchItem.d.ts +1 -0
- package/lib/components/Search/SearchItem.js +1 -1
- package/lib/components/Search/SearchRecent.d.ts +1 -0
- package/lib/components/Search/SearchShortcut.d.ts +1 -0
- package/lib/components/Search/SearchSuggestedPages.d.ts +1 -0
- package/lib/components/Search/SearchTrigger.d.ts +1 -0
- package/lib/components/Select/Select.d.ts +1 -0
- package/lib/components/Sidebar/Sidebar.d.ts +1 -0
- package/lib/components/SidebarActions/ChangeViewButton.d.ts +1 -0
- package/lib/components/SidebarLogo/SidebarLogo.d.ts +1 -0
- package/lib/components/Switch/Switch.d.ts +1 -0
- package/lib/components/TableOfContent/TableOfContent.d.ts +1 -0
- package/lib/components/Tag/Tag.d.ts +1 -0
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/TooltipWrapper.d.ts +3 -3
- package/lib/components/Tooltip/TooltipWrapper.js +2 -2
- package/lib/components/UserMenu/LoginButton.d.ts +1 -0
- package/lib/components/UserMenu/LogoutMenuItem.d.ts +1 -0
- package/lib/components/UserMenu/UserAvatar.d.ts +1 -0
- package/lib/components/UserMenu/UserInfoMenuItem.d.ts +1 -0
- package/lib/components/UserMenu/UserMenuMobile.d.ts +1 -0
- package/lib/core/contexts/ThemeDataContext.d.ts +1 -0
- package/lib/core/hooks/__mocks__/use-element-size.d.ts +1 -1
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +3 -0
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +3 -0
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +2 -2
- package/lib/core/hooks/menu/use-collapse.d.ts +2 -2
- package/lib/core/hooks/menu/use-collapse.js +2 -2
- package/lib/core/hooks/menu/use-mobile-menu-levels.js +1 -1
- package/lib/core/hooks/menu/use-nested-menu.d.ts +2 -2
- package/lib/core/hooks/use-codeblock-tabs-controls.d.ts +1 -1
- package/lib/core/hooks/use-dialog-hotkeys.d.ts +2 -2
- package/lib/core/hooks/use-dialog-hotkeys.js +2 -2
- package/lib/core/hooks/use-element-size.d.ts +2 -2
- package/lib/core/hooks/use-focus-trap.d.ts +1 -1
- package/lib/core/hooks/use-full-height.d.ts +2 -2
- package/lib/core/hooks/use-outside-click.d.ts +2 -2
- package/lib/core/hooks/use-time-ago.js +4 -5
- package/lib/core/types/hooks.d.ts +2 -2
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/index.js +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/open-api-server.d.ts +9 -0
- package/lib/core/types/open-api-server.js +3 -0
- package/lib/core/types/select.d.ts +1 -0
- package/lib/ext/configure.d.ts +7 -2
- package/lib/ext/configure.js +50 -6
- package/lib/icons/MobileSidebarIcon/MobileSidebarIcon.d.ts +1 -0
- package/lib/layouts/CodeWalkthroughLayout.d.ts +1 -0
- package/lib/layouts/DocumentationLayout.d.ts +1 -0
- package/lib/layouts/Forbidden.d.ts +1 -0
- package/lib/layouts/InternalServerErrorLayout.d.ts +1 -0
- package/lib/layouts/NotFound.d.ts +1 -0
- package/lib/layouts/OIDCForbidden.d.ts +1 -0
- package/lib/layouts/PageLayout.d.ts +1 -0
- package/lib/layouts/RootLayout.d.ts +1 -0
- package/lib/layouts/ThreePanelLayout.d.ts +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeContainer.d.ts +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.d.ts +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.d.ts +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +3 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.d.ts +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.d.ts +1 -0
- package/lib/markdoc/components/Heading/Heading.d.ts +1 -1
- package/lib/markdoc/components/MarkdocExample/MarkdocExample.d.ts +1 -1
- package/lib/markdoc/components/MarkdocExample/MarkdocExample.js +1 -1
- package/lib/markdoc/components/Mermaid/Mermaid.d.ts +1 -0
- package/lib/markdoc/components/Tabs/Tab.d.ts +1 -0
- package/lib/markdoc/components/Tabs/Tabs.d.ts +8 -7
- package/package.json +8 -8
- package/src/components/Admonition/Admonition.tsx +1 -1
- package/src/components/Badge/Badge.tsx +3 -1
- package/src/components/Breadcrumbs/Breadcrumb.tsx +2 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +2 -0
- package/src/components/Button/Button.tsx +1 -0
- package/src/components/Buttons/CopyButton.tsx +1 -0
- package/src/components/Buttons/EditPageButton.tsx +2 -0
- package/src/components/Buttons/EmailButton.tsx +2 -0
- package/src/components/Buttons/NewTabButton.tsx +2 -0
- package/src/components/CatalogLegacy/CatalogLegacy.tsx +1 -0
- package/src/components/CatalogLegacy/CatalogLegacyActions.tsx +1 -0
- package/src/components/CatalogLegacy/CatalogLegacyCard.tsx +1 -0
- package/src/components/CatalogLegacy/CatalogLegacyHighlight.tsx +2 -0
- package/src/components/CatalogLegacy/CatalogLegacyInfoBlock.tsx +2 -0
- package/src/components/CodeBlock/CodeBlock.tsx +1 -0
- package/src/components/CodeBlock/CodeBlockContainer.tsx +3 -1
- package/src/components/CodeBlock/CodeBlockControls.tsx +13 -6
- package/src/components/CodeBlock/CodeBlockTabs.tsx +4 -1
- package/src/components/ColorModeSwitcher/ColorModeIcon.tsx +2 -0
- package/src/components/ColorModeSwitcher/ColorModeSwitcher.tsx +2 -0
- package/src/components/Dropdown/Dropdown.tsx +10 -2
- package/src/components/Dropdown/DropdownMenu.tsx +1 -1
- package/src/components/Dropdown/DropdownMenuItem.tsx +1 -1
- package/src/components/Feedback/Comment.tsx +2 -0
- package/src/components/Feedback/Feedback.tsx +3 -3
- package/src/components/Feedback/Mood.tsx +1 -0
- package/src/components/Feedback/Rating.tsx +1 -0
- package/src/components/Feedback/Reasons.tsx +2 -0
- package/src/components/Feedback/ReportDialog.tsx +1 -0
- package/src/components/Feedback/Scale.tsx +3 -2
- package/src/components/Feedback/Sentiment.tsx +5 -4
- package/src/components/Feedback/Stars.tsx +2 -0
- package/src/components/Filter/Filter.tsx +1 -0
- package/src/components/Filter/FilterCheckboxes.tsx +1 -0
- package/src/components/Filter/FilterContent.tsx +1 -0
- package/src/components/Filter/FilterDateRange.tsx +1 -0
- package/src/components/Filter/FilterInput.tsx +2 -0
- package/src/components/Filter/FilterOption.tsx +3 -1
- package/src/components/Filter/FilterOptionLabel.tsx +1 -1
- package/src/components/Filter/FilterOptions.tsx +3 -1
- package/src/components/Filter/FilterPopover.tsx +2 -1
- package/src/components/Filter/FilterSelect.tsx +1 -0
- package/src/components/Filter/FilterTitle.tsx +3 -1
- package/src/components/Footer/Footer.tsx +1 -0
- package/src/components/Footer/FooterColumn.tsx +1 -0
- package/src/components/Footer/FooterCopyright.tsx +2 -0
- package/src/components/Footer/FooterItem.tsx +1 -0
- package/src/components/Image/Image.tsx +3 -8
- package/src/components/JsonViewer/JsonViewer.tsx +1 -0
- package/src/components/JsonViewer/helpers.tsx +2 -0
- package/src/components/LanguagePicker/LanguagePicker.tsx +2 -0
- package/src/components/LastUpdated/LastUpdated.tsx +2 -0
- package/src/components/Link/Link.tsx +5 -1
- package/src/components/Loaders/Loading.tsx +2 -0
- package/src/components/Loaders/SpinnerLoader.tsx +2 -0
- package/src/components/Logo/Logo.tsx +1 -0
- package/src/components/Menu/Menu.tsx +1 -0
- package/src/components/Menu/MenuContainer.tsx +2 -1
- package/src/components/Menu/MenuItem.tsx +7 -3
- package/src/components/Menu/MenuMobile.tsx +2 -0
- package/src/components/Menu/variables.ts +2 -1
- package/src/components/Navbar/Navbar.tsx +1 -0
- package/src/components/Navbar/NavbarItem.tsx +1 -0
- package/src/components/Navbar/NavbarMenu.tsx +1 -0
- package/src/components/PageNavigation/NextButton.tsx +1 -0
- package/src/components/PageNavigation/PageNavigation.tsx +1 -0
- package/src/components/PageNavigation/PreviousButton.tsx +1 -0
- package/src/components/Panel/Panel.tsx +1 -1
- package/src/components/Portal/Portal.tsx +1 -1
- package/src/components/Product/Product.tsx +1 -0
- package/src/components/Product/ProductPicker.tsx +2 -0
- package/src/components/Search/Search.tsx +2 -0
- package/src/components/Search/SearchAiConversationInput.tsx +2 -0
- package/src/components/Search/SearchAiDialog.tsx +2 -0
- package/src/components/Search/SearchAiMessage.tsx +2 -0
- package/src/components/Search/SearchAiResponse.tsx +2 -0
- package/src/components/Search/SearchDialog.tsx +1 -1
- package/src/components/Search/SearchFilter.tsx +1 -0
- package/src/components/Search/SearchFilterField.tsx +1 -0
- package/src/components/Search/SearchGroups.tsx +2 -0
- package/src/components/Search/SearchHighlight.tsx +1 -0
- package/src/components/Search/SearchInput.tsx +2 -2
- package/src/components/Search/SearchItem.tsx +2 -1
- package/src/components/Search/SearchRecent.tsx +2 -0
- package/src/components/Search/SearchShortcut.tsx +2 -0
- package/src/components/Search/SearchSuggestedPages.tsx +2 -0
- package/src/components/Search/SearchTrigger.tsx +2 -0
- package/src/components/Select/Select.tsx +1 -0
- package/src/components/Sidebar/Sidebar.tsx +1 -0
- package/src/components/SidebarActions/ChangeViewButton.tsx +2 -0
- package/src/components/SidebarLogo/SidebarLogo.tsx +2 -0
- package/src/components/Switch/Switch.tsx +2 -0
- package/src/components/TableOfContent/TableOfContent.tsx +1 -0
- package/src/components/Tag/Tag.tsx +2 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/Tooltip/TooltipWrapper.tsx +5 -4
- package/src/components/UserMenu/LoginButton.tsx +2 -0
- package/src/components/UserMenu/LogoutMenuItem.tsx +2 -0
- package/src/components/UserMenu/UserAvatar.tsx +2 -0
- package/src/components/UserMenu/UserInfoMenuItem.tsx +2 -0
- package/src/components/UserMenu/UserMenuMobile.tsx +2 -0
- package/src/core/contexts/ThemeDataContext.tsx +1 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +3 -0
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +2 -2
- package/src/core/hooks/menu/use-collapse.ts +4 -4
- package/src/core/hooks/menu/use-mobile-menu-levels.ts +1 -1
- package/src/core/hooks/menu/use-nested-menu.ts +2 -2
- package/src/core/hooks/use-codeblock-tabs-controls.ts +1 -1
- package/src/core/hooks/use-dialog-hotkeys.ts +4 -7
- package/src/core/hooks/use-element-size.ts +3 -3
- package/src/core/hooks/use-focus-trap.ts +1 -1
- package/src/core/hooks/use-full-height.ts +2 -2
- package/src/core/hooks/use-outside-click.ts +2 -2
- package/src/core/hooks/use-time-ago.ts +4 -4
- package/src/core/types/hooks.ts +1 -1
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +9 -3
- package/src/core/types/open-api-server.ts +12 -0
- package/src/core/types/select.ts +1 -0
- package/src/ext/configure.ts +64 -8
- package/src/icons/MobileSidebarIcon/MobileSidebarIcon.tsx +1 -0
- package/src/layouts/CodeWalkthroughLayout.tsx +2 -0
- package/src/layouts/DocumentationLayout.tsx +1 -0
- package/src/layouts/Forbidden.tsx +2 -0
- package/src/layouts/InternalServerErrorLayout.tsx +2 -0
- package/src/layouts/NotFound.tsx +2 -0
- package/src/layouts/OIDCForbidden.tsx +2 -0
- package/src/layouts/PageLayout.tsx +2 -0
- package/src/layouts/RootLayout.tsx +2 -0
- package/src/layouts/ThreePanelLayout.tsx +2 -0
- package/src/markdoc/components/CodeWalkthrough/CodeContainer.tsx +2 -0
- package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -0
- package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +4 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanelPreview.tsx +2 -0
- package/src/markdoc/components/CodeWalkthrough/CodePanelToolbar.tsx +1 -0
- package/src/markdoc/components/Heading/Heading.tsx +1 -1
- package/src/markdoc/components/MarkdocExample/MarkdocExample.tsx +2 -2
- package/src/markdoc/components/Mermaid/Mermaid.tsx +2 -0
- package/src/markdoc/components/Tabs/Tab.tsx +2 -0
- package/src/markdoc/components/Tabs/Tabs.tsx +13 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { JSX } from 'react';
|
|
2
3
|
export type ButtonSize = 'small' | 'medium' | 'large' | string;
|
|
3
4
|
export type ButtonVariant = 'primary' | 'secondary' | 'outlined' | 'text' | 'link' | 'ghost' | string;
|
|
4
5
|
type ButtonTone = 'default' | 'danger';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { JSX } from 'react';
|
|
2
3
|
export declare const HighlightContext: React.Context<string[]>;
|
|
3
4
|
export type CatalogLegacyHighlightProps = React.PropsWithChildren;
|
|
4
5
|
export declare function CatalogLegacyHighlight(props: CatalogLegacyHighlightProps): JSX.Element | null;
|
|
@@ -19,8 +19,8 @@ const Button_1 = require("../../components/Button/Button");
|
|
|
19
19
|
function CodeBlockControls({ children, className, title, controls, tabs, }) {
|
|
20
20
|
var _a, _b, _c, _d, _e;
|
|
21
21
|
const { codeSnippet } = (0, hooks_1.useThemeConfig)();
|
|
22
|
-
const {
|
|
23
|
-
const
|
|
22
|
+
const { useOtelTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
23
|
+
const otelTelemetry = useOtelTelemetry();
|
|
24
24
|
const controlsType = (codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.elementFormat) || 'icon';
|
|
25
25
|
const { copy, expand, collapse, select, deselect, report } = controls || {
|
|
26
26
|
copy: null,
|
|
@@ -34,17 +34,24 @@ function CodeBlockControls({ children, className, title, controls, tabs, }) {
|
|
|
34
34
|
title && react_1.default.createElement(Title, null, title),
|
|
35
35
|
tabs && react_1.default.createElement(CodeBlockTabs_1.CodeBlockTabs, { tabs: tabs }),
|
|
36
36
|
react_1.default.createElement(ControlsWrapper, null,
|
|
37
|
-
report && !((_a = report === null || report === void 0 ? void 0 : report.props) === null || _a === void 0 ? void 0 : _a.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, {
|
|
37
|
+
report && !((_a = report === null || report === void 0 ? void 0 : report.props) === null || _a === void 0 ? void 0 : _a.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, { tooltipTranslationKey: "codeSnippet.report.tooltipText", placement: "top" },
|
|
38
38
|
react_1.default.createElement(ControlButton, Object.assign({ variant: "text", size: "small", "data-testid": "report-button", icon: controlsType === 'icon' ? react_1.default.createElement(WarningSquareIcon_1.WarningSquareIcon, { size: "18px" }) : undefined }, report.props), controlsType != 'icon' && (((_b = report.props) === null || _b === void 0 ? void 0 : _b.buttonText) || 'Report')))) : null,
|
|
39
39
|
expand && !((_c = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.expand) === null || _c === void 0 ? void 0 : _c.hide) ? (react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "expand-all", icon: controlsType === 'icon' ? react_1.default.createElement(MaximizeIcon_1.MaximizeIcon, null) : undefined, onClick: expand === null || expand === void 0 ? void 0 : expand.onClick }, controlsType !== 'icon' && ((expand === null || expand === void 0 ? void 0 : expand.label) || 'Expand all'))) : null,
|
|
40
40
|
collapse && !((_d = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.collapse) === null || _d === void 0 ? void 0 : _d.hide) ? (react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "collapse-all", icon: controlsType === 'icon' ? react_1.default.createElement(MinimizeIcon_1.MinimizeIcon, null) : undefined, onClick: collapse === null || collapse === void 0 ? void 0 : collapse.onClick }, controlsType !== 'icon' && ((expand === null || expand === void 0 ? void 0 : expand.label) || 'Collapse all'))) : null,
|
|
41
41
|
select ? (react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "select-all", icon: controlsType === 'icon' ? react_1.default.createElement(SelectIcon_1.SelectIcon, null) : undefined, onClick: select === null || select === void 0 ? void 0 : select.onClick }, controlsType !== 'icon' && (select === null || select === void 0 ? void 0 : select.label) ? select.label : 'Select all')) : null,
|
|
42
42
|
deselect ? (react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "clear-all", icon: controlsType === 'icon' ? react_1.default.createElement(DeselectIcon_1.DeselectIcon, null) : undefined, onClick: deselect === null || deselect === void 0 ? void 0 : deselect.onClick }, controlsType !== 'icon' && (deselect === null || deselect === void 0 ? void 0 : deselect.label) ? deselect.label : 'Clear all')) : null,
|
|
43
|
-
copy && !((_e = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.copy) === null || _e === void 0 ? void 0 : _e.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, {
|
|
43
|
+
copy && !((_e = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.copy) === null || _e === void 0 ? void 0 : _e.hide) ? (react_1.default.createElement(TooltipWrapper_1.TooltipWrapper, { tooltipTranslationKey: "codeSnippet.copy.tooltipText", placement: "top" },
|
|
44
44
|
react_1.default.createElement(CopyButton_1.CopyButton, { data: copy.data, "data-source": copy.dataSource, "data-hash": copy.dataHash, type: controlsType, toasterPlacement: copy.toasterPlacement, toasterDuration: copy.toasterDuration, buttonText: copy.label, onCopyClick: () => {
|
|
45
|
-
var _a
|
|
46
|
-
|
|
47
|
-
(
|
|
45
|
+
var _a;
|
|
46
|
+
// If there already is a click handler, events should be handled there, cause they pass additional data
|
|
47
|
+
if (copy === null || copy === void 0 ? void 0 : copy.onClick) {
|
|
48
|
+
(_a = copy === null || copy === void 0 ? void 0 : copy.onClick) === null || _a === void 0 ? void 0 : _a.call(copy);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
otelTelemetry.send('openapi_docs.copy_code_snippet.clicked', {
|
|
52
|
+
type: 'code',
|
|
53
|
+
});
|
|
54
|
+
}
|
|
48
55
|
} }))) : null))) : null;
|
|
49
56
|
return children || controls ? (react_1.default.createElement(ContainerWrapper, { "data-component-name": "CodeBlock/CodeBlockControls", className: className }, children ? children : defaultControls)) : null;
|
|
50
57
|
}
|
|
@@ -47,7 +47,9 @@ function CodeBlockTabs({ tabs }) {
|
|
|
47
47
|
}, [tabs.activeTabName]);
|
|
48
48
|
return (react_1.default.createElement(CodeBlockTabsWrapper, { ref: containerRef, "data-component-name": "CodeBlock/CodeBlockTabs" },
|
|
49
49
|
react_1.default.createElement(ShadowWrapper, null,
|
|
50
|
-
react_1.default.createElement(Tabs, null, tabs.files.map(({ name }, i) => (react_1.default.createElement(Tab, { ref: (el) =>
|
|
50
|
+
react_1.default.createElement(Tabs, null, tabs.files.map(({ name }, i) => (react_1.default.createElement(Tab, { ref: (el) => {
|
|
51
|
+
tabRefs.current[i] = el;
|
|
52
|
+
}, "data-name": name, active: name === tabs.activeTabName, key: name, onClick: () => tabs.handleTabSwitch(name) },
|
|
51
53
|
react_1.default.createElement(DocumentBlankIcon_1.DocumentBlankIcon, null),
|
|
52
54
|
name))))),
|
|
53
55
|
showControls && (react_1.default.createElement(Controls, null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode, PropsWithChildren } from 'react';
|
|
1
|
+
import type { CSSProperties, ReactNode, PropsWithChildren, JSX } from 'react';
|
|
2
2
|
import type { LinkProps } from '../../components/Link/Link';
|
|
3
3
|
export type DropdownMenuItemProps = Partial<Pick<LinkProps, 'to' | 'target' | 'external'>> & {
|
|
4
4
|
prefix?: ReactNode;
|
|
@@ -46,9 +46,9 @@ const feedbackComponents = {
|
|
|
46
46
|
};
|
|
47
47
|
function Feedback(props) {
|
|
48
48
|
var _a;
|
|
49
|
-
const { useSubmitFeedback,
|
|
49
|
+
const { useSubmitFeedback, useOtelTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
50
50
|
const { submitFeedback } = useSubmitFeedback();
|
|
51
|
-
const
|
|
51
|
+
const otelTelemetry = useOtelTelemetry();
|
|
52
52
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
53
53
|
const { feedback: themeFeedbackConf } = (0, hooks_1.useThemeConfig)();
|
|
54
54
|
const feedbackConf = Object.assign(Object.assign({}, themeFeedbackConf), { path: props === null || props === void 0 ? void 0 : props.path, type: (props === null || props === void 0 ? void 0 : props.type) || (themeFeedbackConf === null || themeFeedbackConf === void 0 ? void 0 : themeFeedbackConf.type) || constants_1.DEFAULT_FEEDBACK_TYPE, settings: (props === null || props === void 0 ? void 0 : props.settings) || (themeFeedbackConf === null || themeFeedbackConf === void 0 ? void 0 : themeFeedbackConf.settings) || {}, hide: (_a = props.hide) !== null && _a !== void 0 ? _a : themeFeedbackConf === null || themeFeedbackConf === void 0 ? void 0 : themeFeedbackConf.hide });
|
|
@@ -64,7 +64,7 @@ function Feedback(props) {
|
|
|
64
64
|
return (React.createElement(FeedbackWrapper, { "data-component-name": "Feedback/Feedback" },
|
|
65
65
|
React.createElement(FeedbackComponent, { settings: settings, onSubmit: (values) => {
|
|
66
66
|
submitFeedback({ type, values, path });
|
|
67
|
-
|
|
67
|
+
otelTelemetry.send('feedback.sent', { type });
|
|
68
68
|
} })));
|
|
69
69
|
};
|
|
70
70
|
return React.createElement(React.Fragment, { key: pathname }, renderFeedbackComponent());
|
|
@@ -120,7 +120,7 @@ function Scale({ settings, onSubmit, className }) {
|
|
|
120
120
|
} }))),
|
|
121
121
|
displaySubmitBnt && (React.createElement(ButtonsContainer, null,
|
|
122
122
|
React.createElement(Button_1.Button, { "data-translation-key": "feedback.settings.comment.cancel", onClick: handleCancel, variant: "text", size: "small" }, translate('feedback.settings.comment.cancel', 'Cancel')),
|
|
123
|
-
React.createElement(Button_1.Button, { "data-translation-key": "feedback.
|
|
123
|
+
React.createElement(Button_1.Button, { "data-translation-key": "feedback.submit", type: "submit", variant: "secondary", size: "small" }, translate('feedback.submit', 'Submit')))))));
|
|
124
124
|
}
|
|
125
125
|
const ScaleWrapper = styled_components_1.default.div `
|
|
126
126
|
font-family: var(--feedback-font-family);
|
|
@@ -129,10 +129,10 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
129
129
|
React.createElement(StyledMandatoryFieldContainer, null,
|
|
130
130
|
React.createElement(Button_1.Button, { type: "button", size: "medium", variant: score === 1 ? 'primary' : 'secondary', onClick: () => {
|
|
131
131
|
setScore(1);
|
|
132
|
-
}, "aria-label":
|
|
132
|
+
}, "aria-label": translate('feedback.sentiment.thumbUp', 'Like'), icon: React.createElement(ThumbUpIcon_1.ThumbUpIcon, null) }),
|
|
133
133
|
React.createElement(Button_1.Button, { size: "medium", type: "button", variant: score === -1 ? 'primary' : 'secondary', tone: score === -1 ? 'danger' : 'default', onClick: () => {
|
|
134
134
|
setScore(-1);
|
|
135
|
-
}, "aria-label":
|
|
135
|
+
}, "aria-label": translate('feedback.sentiment.thumbDown', 'Dislike'), icon: React.createElement(ThumbDownIcon_1.ThumbDownIcon, null) }))),
|
|
136
136
|
(displayReasons || displayComment) && (React.createElement(StyledFormOptionalFields, null,
|
|
137
137
|
displayReasons && (React.createElement(Reasons_1.Reasons, { settings: {
|
|
138
138
|
label: renderReasonsLabel(score),
|
|
@@ -151,8 +151,8 @@ function Sentiment({ settings, onSubmit, className }) {
|
|
|
151
151
|
}
|
|
152
152
|
} }))),
|
|
153
153
|
displaySubmitBnt && (React.createElement(ButtonsContainer, null,
|
|
154
|
-
React.createElement(Button_1.Button, { onClick: onCancelSentimentForm, variant: "text", size: "small" },
|
|
155
|
-
React.createElement(Button_1.Button, { onClick: onSubmitSentimentForm, variant: "secondary", size: "small" },
|
|
154
|
+
React.createElement(Button_1.Button, { onClick: onCancelSentimentForm, variant: "text", size: "small" }, translate('feedback.cancel', 'Cancel')),
|
|
155
|
+
React.createElement(Button_1.Button, { onClick: onSubmitSentimentForm, variant: "secondary", size: "small" }, translate('feedback.submit', 'Submit')))))));
|
|
156
156
|
}
|
|
157
157
|
const SentimentWrapper = styled_components_1.default.div `
|
|
158
158
|
font-family: var(--font-family-base);
|
|
@@ -14,7 +14,7 @@ function FilterPopover({ onClose, filters, filterValuesCasing, filterTerm, setFi
|
|
|
14
14
|
const { translate } = useTranslate();
|
|
15
15
|
return (react_1.default.createElement(FilterPopoverWrapper, { "data-component-name": "Filter/FilterPopover" },
|
|
16
16
|
react_1.default.createElement(FilterPopoverHeader, null,
|
|
17
|
-
react_1.default.createElement(FilterPopoverHeaderLabel, { "data-translation-key": "catalog.filters.add" }, translate('catalog.filters.add', 'Add
|
|
17
|
+
react_1.default.createElement(FilterPopoverHeaderLabel, { "data-translation-key": "catalog.filters.add" }, translate('catalog.filters.add', 'Add filter')),
|
|
18
18
|
react_1.default.createElement(FilterPopoverHeaderButton, { onClick: onClose }, translate('catalog.filters.done', 'Done'))),
|
|
19
19
|
react_1.default.createElement(FilterContent_1.FilterContent, { setFilterTerm: setFilterTerm, filters: filters, filterTerm: filterTerm, filterValuesCasing: filterValuesCasing })));
|
|
20
20
|
}
|
|
@@ -46,8 +46,8 @@ function Link(props) {
|
|
|
46
46
|
return React.createElement(LinkComponent, Object.assign({}, props));
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
const { active: _, httpVerb: _1, hasActiveSubItem: _2, routeSlug: _3, external: _4, innerRef } = props, filteredProps = __rest(props, ["active", "httpVerb", "hasActiveSubItem", "routeSlug", "external", "innerRef"]);
|
|
50
|
-
// We omit
|
|
49
|
+
const { active: _, httpVerb: _1, hasActiveSubItem: _2, routeSlug: _3, external: _4, languageInsensitive: _5, iconPosition: _6, innerRef } = props, filteredProps = __rest(props, ["active", "httpVerb", "hasActiveSubItem", "routeSlug", "external", "languageInsensitive", "iconPosition", "innerRef"]);
|
|
50
|
+
// We omit properties to avoid "Warning: Received value for a non-boolean attribute"
|
|
51
51
|
return React.createElement(react_router_dom_1.Link, Object.assign({ ref: innerRef }, filteredProps));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -49,6 +49,7 @@ function MenuItem(props) {
|
|
|
49
49
|
nestedMenuRef }));
|
|
50
50
|
const telemetry = useTelemetry();
|
|
51
51
|
const isDrilldown = type === constants_1.MenuItemType.DrillDown;
|
|
52
|
+
const isSeparator = type === constants_1.MenuItemType.Separator;
|
|
52
53
|
const isNested = type === constants_1.MenuItemType.Group;
|
|
53
54
|
const hasChevron = isNested && !isDrilldown;
|
|
54
55
|
const hasHttpTag = !!item.httpVerb || type === constants_1.MenuItemType.Operation;
|
|
@@ -62,8 +63,8 @@ function MenuItem(props) {
|
|
|
62
63
|
};
|
|
63
64
|
const chevron = hasChevron ? (isExpanded ? (react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, { size: "var(--menu-item-label-chevron-size)", color: "--tree-content-color-default" })) : (react_1.default.createElement(ChevronRightIcon_1.ChevronRightIcon, { size: "var(--menu-item-label-chevron-size)", color: "--tree-content-color-default" }))) : null;
|
|
64
65
|
const httpColor = item.deprecated ? 'http-deprecated' : item.httpVerb;
|
|
65
|
-
const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { active: item.active, deprecated: item.deprecated, depth: depth, withChevron: hasChevron, onClick: handleOnClick, ref: labelRef, role: item.link ? 'none' : 'link', "data-testid": "menu-item-label" },
|
|
66
|
-
react_1.default.createElement(ChevronWrapper, null, chevron),
|
|
66
|
+
const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { active: item.active, deprecated: item.deprecated, depth: depth, withChevron: hasChevron, isSeparator: isSeparator, onClick: handleOnClick, ref: labelRef, role: item.link ? 'none' : 'link', "data-testid": "menu-item-label" },
|
|
67
|
+
hasChevron ? react_1.default.createElement(ChevronWrapper, null, chevron) : null,
|
|
67
68
|
item.icon ? react_1.default.createElement(MenuItemIcon, { src: item.icon }) : null,
|
|
68
69
|
react_1.default.createElement(MenuItemLabelTextWrapper, null,
|
|
69
70
|
react_1.default.createElement(MenuItemLabel, null,
|
|
@@ -158,9 +159,9 @@ const MenuItemLabelWrapper = styled_components_1.default.li `
|
|
|
158
159
|
padding: var(--menu-item-label-padding);
|
|
159
160
|
gap: var(--menu-item-label-gap);
|
|
160
161
|
|
|
161
|
-
padding-left: ${({ withChevron, depth }) => `calc(
|
|
162
|
+
padding-left: ${({ withChevron, depth, isSeparator }) => `calc(
|
|
162
163
|
var(--menu-item-padding-horizontal) +
|
|
163
|
-
${!withChevron ? 'var(--menu-item-label-chevron-offset)' : '0px'} +
|
|
164
|
+
${!withChevron ? 'var(--menu-item-label-chevron-offset) + ' + (isSeparator ? 'var(--menu-item-separator-offest)' : '0px') : '0px'} +
|
|
164
165
|
${depth ? 'var(--menu-item-nested-offset) * ' + depth : '0px'}
|
|
165
166
|
)`};
|
|
166
167
|
|
|
@@ -53,7 +53,7 @@ exports.menu = (0, styled_components_1.css) `
|
|
|
53
53
|
--menu-item-label-margin-vertical: 0;
|
|
54
54
|
--menu-item-label-margin: var(--menu-item-label-margin-vertical) var(--menu-item-label-margin-horizontal);
|
|
55
55
|
--menu-item-label-padding: var(--menu-item-padding-vertical) var(--menu-item-padding-horizontal);
|
|
56
|
-
--menu-item-label-gap: var(--spacing-
|
|
56
|
+
--menu-item-label-gap: var(--spacing-xxs);
|
|
57
57
|
--menu-item-label-border-radius: 6px;
|
|
58
58
|
--menu-item-label-chevron-size: 12px;
|
|
59
59
|
--menu-item-label-chevron-offset: calc(var(--menu-item-label-gap) + var(--menu-item-label-chevron-size));
|
|
@@ -81,6 +81,7 @@ exports.menu = (0, styled_components_1.css) `
|
|
|
81
81
|
*/
|
|
82
82
|
--menu-item-separator-line-height: 1px;
|
|
83
83
|
--menu-item-separator-line-bg-color: var(--border-color-secondary);
|
|
84
|
+
--menu-item-separator-offest: var(--spacing-xxs);
|
|
84
85
|
|
|
85
86
|
/**
|
|
86
87
|
* @tokens Menu back button
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import type { PropsWithChildren, ReactNode, JSX } from 'react';
|
|
3
3
|
import type { PanelHeaderProps } from '../../components/Panel/PanelHeader';
|
|
4
4
|
export type PanelProps = {
|
|
5
5
|
expanded?: boolean;
|