@redocly/theme 0.82.2-rc.2 → 0.82.4-rc.1
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/Badge/Badge.d.ts +8 -5
- package/lib/components/Badge/Badge.js +9 -3
- package/lib/components/Breadcrumbs/Breadcrumb.d.ts +1 -1
- package/lib/components/Breadcrumbs/Breadcrumb.js +2 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/lib/components/Breadcrumbs/Breadcrumbs.js +2 -2
- package/lib/components/Button/Button.js +1 -1
- package/lib/components/Buttons/CopyButton.d.ts +2 -2
- package/lib/components/Buttons/CopyButton.js +3 -3
- package/lib/components/Buttons/EditPageButton.d.ts +2 -3
- package/lib/components/Buttons/EditPageButton.js +2 -2
- package/lib/components/Buttons/EmailButton.d.ts +4 -5
- package/lib/components/Buttons/EmailButton.js +2 -2
- package/lib/components/Buttons/NewTabButton.d.ts +4 -5
- package/lib/components/Buttons/NewTabButton.js +2 -2
- package/lib/components/Catalog/Catalog.d.ts +3 -2
- package/lib/components/Catalog/Catalog.js +1 -5
- package/lib/components/Catalog/CatalogActions.d.ts +1 -2
- package/lib/components/Catalog/CatalogCard.d.ts +1 -2
- package/lib/components/Catalog/CatalogCard.js +4 -5
- package/lib/components/Catalog/CatalogHighlight.d.ts +1 -2
- package/lib/components/Catalog/CatalogInfoBlock.d.ts +1 -2
- package/lib/components/CodeBlock/CodeBlock.js +1 -1
- package/lib/components/CodeBlock/CodeBlockContainer.d.ts +14 -5
- package/lib/components/CodeBlock/CodeBlockContainer.js +9 -4
- package/lib/components/CodeBlock/CodeBlockControls.js +2 -0
- package/lib/components/CodeBlock/CodeBlockTabs.d.ts +1 -2
- package/lib/components/CodeBlock/variables.js +2 -2
- package/lib/components/ColorModeSwitcher/ColorModeIcon.d.ts +4 -8
- package/lib/components/ColorModeSwitcher/ColorModeIcon.js +5 -3
- package/lib/components/ColorModeSwitcher/ColorModeSwitcher.d.ts +1 -2
- package/lib/components/DatePicker/DatePicker.d.ts +2 -3
- package/lib/components/Dropdown/Dropdown.d.ts +2 -3
- package/lib/components/Dropdown/Dropdown.js +10 -5
- package/lib/components/Dropdown/DropdownMenu.d.ts +1 -2
- package/lib/components/Dropdown/DropdownMenuItem.d.ts +1 -2
- package/lib/components/Dropdown/DropdownMenuItem.js +22 -5
- package/lib/components/Dropdown/variables.js +5 -1
- package/lib/components/Feedback/Comment.d.ts +2 -1
- package/lib/components/Feedback/Comment.js +3 -3
- package/lib/components/Feedback/Mood.js +4 -4
- package/lib/components/Feedback/Rating.js +1 -1
- package/lib/components/Feedback/ReportDialog.js +1 -1
- package/lib/components/Feedback/Scale.js +1 -1
- package/lib/components/Feedback/Sentiment.js +3 -3
- package/lib/components/Filter/FilterContent.d.ts +1 -3
- package/lib/components/Filter/FilterContent.js +4 -4
- package/lib/components/Filter/FilterInput.d.ts +1 -2
- package/lib/components/Filter/FilterOption.d.ts +8 -4
- package/lib/components/Filter/FilterOption.js +7 -4
- package/lib/components/Filter/FilterOptionLabel.d.ts +5 -3
- package/lib/components/Filter/FilterOptionLabel.js +6 -3
- package/lib/components/Filter/FilterOptions.d.ts +5 -3
- package/lib/components/Filter/FilterOptions.js +6 -3
- package/lib/components/Filter/FilterPopover.d.ts +1 -2
- package/lib/components/Filter/FilterSelect.js +1 -4
- package/lib/components/Filter/FilterTitle.d.ts +5 -3
- package/lib/components/Filter/FilterTitle.js +6 -3
- package/lib/components/Filter/variables.js +2 -1
- package/lib/components/Footer/Footer.d.ts +1 -2
- package/lib/components/Footer/FooterColumn.d.ts +1 -2
- package/lib/components/Footer/FooterCopyright.d.ts +1 -2
- package/lib/components/Footer/FooterItem.d.ts +1 -2
- package/lib/components/Footer/FooterLogo.d.ts +3 -4
- package/lib/components/Footer/FooterLogo.js +6 -1
- package/lib/components/Image/Image.d.ts +2 -2
- package/lib/components/JsonViewer/JsonViewer.d.ts +2 -2
- package/lib/components/LanguagePicker/LanguagePicker.d.ts +1 -2
- package/lib/components/LanguagePicker/LanguagePicker.js +5 -2
- package/lib/components/LanguagePicker/variables.js +4 -1
- package/lib/components/LastUpdated/LastUpdated.d.ts +1 -1
- package/lib/components/Link/Link.d.ts +1 -1
- package/lib/components/Loading/Loading.d.ts +2 -2
- package/lib/components/Logo/Logo.d.ts +1 -2
- package/lib/components/Markdown/Markdown.d.ts +12 -0
- package/lib/components/Markdown/Markdown.js +12 -13
- package/lib/components/Markdown/variables.js +10 -5
- package/lib/components/Menu/Menu.d.ts +1 -2
- package/lib/components/Menu/MenuContainer.d.ts +4 -4
- package/lib/components/Menu/MenuContainer.js +10 -3
- package/lib/components/Menu/MenuMobile.d.ts +1 -2
- package/lib/components/Menu/variables.js +2 -0
- package/lib/components/Navbar/NavbarItem.d.ts +1 -2
- package/lib/components/Navbar/NavbarItem.js +1 -1
- package/lib/components/Navbar/NavbarLogo.d.ts +3 -4
- package/lib/components/Navbar/NavbarLogo.js +6 -3
- package/lib/components/Navbar/NavbarMenu.d.ts +1 -2
- package/lib/components/PageNavigation/NextButton.d.ts +1 -2
- package/lib/components/PageNavigation/PageNavigation.d.ts +1 -2
- package/lib/components/PageNavigation/PreviousButton.d.ts +1 -2
- package/lib/components/Panel/Panel.d.ts +1 -2
- package/lib/components/Panel/PanelBody.d.ts +2 -3
- package/lib/components/Portal/Portal.d.ts +2 -3
- package/lib/components/Portal/Portal.js +2 -2
- package/lib/components/Product/Product.d.ts +1 -2
- package/lib/components/Product/ProductPicker.js +4 -1
- package/lib/components/Product/variables.js +4 -1
- package/lib/components/Search/Search.d.ts +1 -2
- package/lib/components/Search/SearchDialog.d.ts +1 -2
- package/lib/components/Search/SearchInput.d.ts +1 -2
- package/lib/components/Search/SearchItem.d.ts +1 -1
- package/lib/components/Search/SearchRecent.d.ts +1 -2
- package/lib/components/Search/SearchShortcut.d.ts +1 -2
- package/lib/components/Search/SearchSuggestedPages.d.ts +1 -2
- package/lib/components/Search/SearchTrigger.d.ts +1 -2
- package/lib/components/Search/variables.js +2 -2
- package/lib/components/Segmented/Segmented.d.ts +1 -1
- package/lib/components/Select/Select.d.ts +3 -3
- package/lib/components/Sidebar/Sidebar.d.ts +1 -2
- package/lib/components/SidebarActions/ChangeViewButton.d.ts +2 -3
- package/lib/components/SidebarActions/SidebarActions.d.ts +2 -2
- package/lib/components/SidebarLogo/SidebarLogo.d.ts +3 -3
- package/lib/components/TableOfContent/TableOfContent.d.ts +1 -2
- package/lib/components/Tag/Tag.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +2 -2
- package/lib/components/Tooltip/variables.js +4 -0
- package/lib/components/Typography/H1.js +1 -1
- package/lib/components/Typography/H2.js +1 -1
- package/lib/components/Typography/H3.js +1 -1
- package/lib/components/Typography/H4.js +1 -1
- package/lib/components/UserMenu/UserAvatar.d.ts +1 -2
- package/lib/components/UserMenu/UserInfoMenuItem.d.ts +1 -2
- package/lib/components/UserMenu/UserMenu.d.ts +1 -2
- package/lib/components/UserMenu/UserMenu.js +4 -1
- package/lib/components/UserMenu/UserMenuMobile.d.ts +1 -2
- package/lib/components/UserMenu/variables.js +4 -1
- package/lib/components/VersionPicker/VersionPicker.d.ts +1 -1
- package/lib/core/types/catalog.d.ts +3 -0
- package/lib/core/types/hooks.d.ts +3 -1
- package/lib/layouts/DocumentationLayout.js +7 -0
- package/lib/layouts/NotFound.js +2 -2
- package/lib/layouts/RootLayout.d.ts +2 -3
- package/lib/markdoc/components/InlineSvg/InlineSvg.d.ts +2 -1
- package/lib/markdoc/components/InlineSvg/InlineSvg.js +2 -2
- package/lib/markdoc/components/Tabs/variables.js +5 -5
- package/package.json +4 -4
- package/src/components/Badge/Badge.tsx +13 -3
- package/src/components/Breadcrumbs/Breadcrumb.tsx +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +2 -2
- package/src/components/Button/Button.tsx +5 -1
- package/src/components/Buttons/CopyButton.tsx +7 -5
- package/src/components/Buttons/EditPageButton.tsx +3 -3
- package/src/components/Buttons/EmailButton.tsx +4 -4
- package/src/components/Buttons/NewTabButton.tsx +7 -4
- package/src/components/Catalog/Catalog.tsx +5 -7
- package/src/components/Catalog/CatalogActions.tsx +1 -1
- package/src/components/Catalog/CatalogCard.tsx +23 -24
- package/src/components/Catalog/CatalogHighlight.tsx +1 -1
- package/src/components/Catalog/CatalogInfoBlock.tsx +1 -1
- package/src/components/CodeBlock/CodeBlock.tsx +1 -1
- package/src/components/CodeBlock/CodeBlockContainer.tsx +19 -6
- package/src/components/CodeBlock/CodeBlockControls.tsx +2 -0
- package/src/components/CodeBlock/CodeBlockTabs.tsx +1 -1
- package/src/components/CodeBlock/variables.ts +2 -2
- package/src/components/ColorModeSwitcher/ColorModeIcon.tsx +8 -4
- package/src/components/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +2 -2
- package/src/components/Dropdown/Dropdown.tsx +14 -8
- package/src/components/Dropdown/DropdownMenu.tsx +1 -1
- package/src/components/Dropdown/DropdownMenuItem.tsx +25 -6
- package/src/components/Dropdown/variables.ts +5 -1
- package/src/components/Feedback/Comment.tsx +4 -2
- package/src/components/Feedback/Mood.tsx +5 -4
- package/src/components/Feedback/Rating.tsx +1 -1
- package/src/components/Feedback/ReportDialog.tsx +1 -0
- package/src/components/Feedback/Scale.tsx +1 -1
- package/src/components/Feedback/Sentiment.tsx +4 -3
- package/src/components/Filter/FilterContent.tsx +3 -3
- package/src/components/Filter/FilterInput.tsx +1 -1
- package/src/components/Filter/FilterOption.tsx +20 -4
- package/src/components/Filter/FilterOptionLabel.tsx +10 -3
- package/src/components/Filter/FilterOptions.tsx +10 -3
- package/src/components/Filter/FilterPopover.tsx +1 -1
- package/src/components/Filter/FilterSelect.tsx +1 -4
- package/src/components/Filter/FilterTitle.tsx +10 -3
- package/src/components/Filter/variables.ts +2 -1
- package/src/components/Footer/Footer.tsx +1 -1
- package/src/components/Footer/FooterColumn.tsx +1 -1
- package/src/components/Footer/FooterCopyright.tsx +1 -1
- package/src/components/Footer/FooterItem.tsx +1 -1
- package/src/components/Footer/FooterLogo.tsx +8 -1
- package/src/components/Image/Image.tsx +1 -1
- package/src/components/JsonViewer/JsonViewer.tsx +2 -2
- package/src/components/LanguagePicker/LanguagePicker.tsx +6 -3
- package/src/components/LanguagePicker/variables.ts +4 -1
- package/src/components/LastUpdated/LastUpdated.tsx +1 -1
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/Loading/Loading.tsx +2 -2
- package/src/components/Logo/Logo.tsx +1 -1
- package/src/components/Markdown/Markdown.tsx +23 -14
- package/src/components/Markdown/variables.ts +10 -5
- package/src/components/Menu/Menu.tsx +1 -1
- package/src/components/Menu/MenuContainer.tsx +9 -5
- package/src/components/Menu/MenuMobile.tsx +1 -1
- package/src/components/Menu/variables.ts +2 -0
- package/src/components/Navbar/Navbar.tsx +1 -0
- package/src/components/Navbar/NavbarItem.tsx +2 -2
- package/src/components/Navbar/NavbarLogo.tsx +8 -3
- package/src/components/Navbar/NavbarMenu.tsx +1 -1
- package/src/components/PageNavigation/NextButton.tsx +1 -1
- package/src/components/PageNavigation/PageNavigation.tsx +1 -1
- package/src/components/PageNavigation/PreviousButton.tsx +1 -1
- package/src/components/Panel/Panel.tsx +1 -1
- package/src/components/Panel/PanelBody.ts +2 -2
- package/src/components/Portal/Portal.tsx +6 -3
- package/src/components/Product/Product.tsx +1 -1
- package/src/components/Product/ProductPicker.tsx +4 -1
- package/src/components/Product/variables.ts +4 -1
- package/src/components/Search/Search.tsx +1 -1
- package/src/components/Search/SearchDialog.tsx +1 -1
- package/src/components/Search/SearchInput.tsx +1 -1
- package/src/components/Search/SearchItem.tsx +1 -1
- package/src/components/Search/SearchRecent.tsx +1 -1
- package/src/components/Search/SearchShortcut.tsx +1 -1
- package/src/components/Search/SearchSuggestedPages.tsx +1 -1
- package/src/components/Search/SearchTrigger.tsx +1 -1
- package/src/components/Search/variables.ts +2 -2
- package/src/components/Segmented/Segmented.tsx +1 -1
- package/src/components/Select/Select.tsx +3 -3
- package/src/components/Sidebar/Sidebar.tsx +1 -1
- package/src/components/SidebarActions/ChangeViewButton.tsx +2 -2
- package/src/components/SidebarActions/SidebarActions.tsx +2 -2
- package/src/components/SidebarLogo/SidebarLogo.tsx +3 -3
- package/src/components/TableOfContent/TableOfContent.tsx +1 -1
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -2
- package/src/components/Tooltip/variables.ts +4 -0
- package/src/components/Typography/H1.ts +1 -1
- package/src/components/Typography/H2.ts +1 -1
- package/src/components/Typography/H3.ts +1 -1
- package/src/components/Typography/H4.ts +1 -1
- package/src/components/UserMenu/UserAvatar.tsx +1 -1
- package/src/components/UserMenu/UserInfoMenuItem.tsx +1 -1
- package/src/components/UserMenu/UserMenu.tsx +5 -2
- package/src/components/UserMenu/UserMenuMobile.tsx +1 -1
- package/src/components/UserMenu/variables.ts +4 -1
- package/src/core/types/catalog.ts +3 -1
- package/src/core/types/hooks.ts +3 -1
- package/src/layouts/DocumentationLayout.tsx +7 -0
- package/src/layouts/NotFound.tsx +3 -3
- package/src/layouts/RootLayout.tsx +2 -2
- package/src/markdoc/components/InlineSvg/InlineSvg.tsx +8 -1
- package/src/markdoc/components/Tabs/variables.ts +5 -5
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
export type BadgeProps = PropsWithChildren<{
|
|
3
|
+
deprecated?: boolean;
|
|
4
|
+
color?: string;
|
|
5
|
+
key?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function Badge(props: BadgeProps): JSX.Element;
|
|
@@ -22,12 +22,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.Badge = void 0;
|
|
30
|
+
const react_1 = __importDefault(require("react"));
|
|
27
31
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
32
|
+
function Badge(props) {
|
|
33
|
+
return react_1.default.createElement(BadgeComponent, Object.assign({}, props, { "data-component-name": "Badge/Badge" }));
|
|
34
|
+
}
|
|
35
|
+
exports.Badge = Badge;
|
|
36
|
+
const BadgeComponent = styled_components_1.default.span `
|
|
31
37
|
display: inline-block;
|
|
32
38
|
padding: 0 var(--spacing-xs);
|
|
33
39
|
vertical-align: middle;
|
|
@@ -5,5 +5,5 @@ type BreadcrumbProps = {
|
|
|
5
5
|
isActive: boolean;
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
};
|
|
8
|
-
export declare
|
|
8
|
+
export declare function Breadcrumb({ label, link, isActive, onClick }: BreadcrumbProps): JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -7,9 +7,9 @@ exports.Breadcrumb = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Link_1 = require("../../components/Link/Link");
|
|
10
|
-
|
|
10
|
+
function Breadcrumb({ label, link, isActive, onClick }) {
|
|
11
11
|
return (react_1.default.createElement(BreadcrumbWrapper, { "data-component-name": "Breadcrumbs/Breadcrumb", isLink: link != null, isActive: isActive, onClick: onClick }, link ? (react_1.default.createElement(BreadcrumbLink, { to: link }, label)) : (react_1.default.createElement(BreadcrumbText, null, label))));
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
exports.Breadcrumb = Breadcrumb;
|
|
14
14
|
const BreadcrumbText = styled_components_1.default.div `
|
|
15
15
|
cursor: default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function Breadcrumbs(props: {
|
|
3
3
|
className?: string;
|
|
4
|
-
})
|
|
4
|
+
}): JSX.Element | null;
|
|
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const hooks_1 = require("../../core/hooks");
|
|
10
10
|
const Breadcrumb_1 = require("../../components/Breadcrumbs/Breadcrumb");
|
|
11
|
-
|
|
11
|
+
function Breadcrumbs(props) {
|
|
12
12
|
const { useBreadcrumbs, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
13
13
|
const telemetry = useTelemetry();
|
|
14
14
|
const breadcrumbs = useBreadcrumbs();
|
|
@@ -27,7 +27,7 @@ const Breadcrumbs = (props) => {
|
|
|
27
27
|
} }),
|
|
28
28
|
isLast ? null : react_1.default.createElement("span", null, "/")));
|
|
29
29
|
})));
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
exports.Breadcrumbs = Breadcrumbs;
|
|
32
32
|
const BreadcrumbsWrapper = styled_components_1.default.div `
|
|
33
33
|
display: flex;
|
|
@@ -166,7 +166,7 @@ const ButtonComponent = (props) => {
|
|
|
166
166
|
props.children,
|
|
167
167
|
props.icon && props.iconPosition === 'right' && props.icon));
|
|
168
168
|
if (props.to) {
|
|
169
|
-
return react_1.default.createElement(StyledButtonLink, { to: props.to }, button);
|
|
169
|
+
return (react_1.default.createElement(StyledButtonLink, { to: props.to, onClick: props.onClick }, button));
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
172
172
|
return button;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TooltipProps } from '../../components/Tooltip/Tooltip';
|
|
3
3
|
import type { ControlItemType } from '../../components/CodeBlock/CodeBlockControls';
|
|
4
|
-
type CopyButtonProps = {
|
|
4
|
+
export type CopyButtonProps = {
|
|
5
5
|
data: unknown;
|
|
6
6
|
type?: ControlItemType;
|
|
7
7
|
toasterPlacement?: TooltipProps['placement'];
|
|
@@ -11,6 +11,6 @@ type CopyButtonProps = {
|
|
|
11
11
|
onCopyClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
12
12
|
dataTestId?: string;
|
|
13
13
|
className?: string;
|
|
14
|
+
variant?: string;
|
|
14
15
|
};
|
|
15
16
|
export declare const CopyButton: React.NamedExoticComponent<CopyButtonProps>;
|
|
16
|
-
export {};
|
|
@@ -30,7 +30,7 @@ const hooks_1 = require("../../core/hooks");
|
|
|
30
30
|
const Button_1 = require("../../components/Button/Button");
|
|
31
31
|
const CopyIcon_1 = require("../../icons/CopyIcon/CopyIcon");
|
|
32
32
|
const Tooltip_1 = require("../../components/Tooltip/Tooltip");
|
|
33
|
-
|
|
33
|
+
function CopyButtonComponent({ data, type = 'icon', toasterPlacement = 'top', toasterText, toasterDuration, buttonText, onCopyClick, dataTestId = 'copy-button', className, variant = 'text', }) {
|
|
34
34
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
35
35
|
const tooltip = (0, hooks_1.useControl)();
|
|
36
36
|
const { translate } = useTranslate();
|
|
@@ -47,7 +47,7 @@ const CopyButtonComponent = ({ data, type = 'icon', toasterPlacement = 'top', to
|
|
|
47
47
|
onCopyClick === null || onCopyClick === void 0 ? void 0 : onCopyClick(e);
|
|
48
48
|
};
|
|
49
49
|
return (react_1.default.createElement(Tooltip_1.Tooltip, { className: `copy-button ${className ? className : ''}`, tip: translate('theme.codeSnippet.copy.buttonText', toasterText || 'Copied!'), isOpen: tooltip.isOpened, placement: toasterPlacement },
|
|
50
|
-
react_1.default.createElement(Button_1.Button, { "data-component-name": "Buttons/CopyButton", onClick: (e) => copy(e, toasterDuration), "data-testid": dataTestId, icon: type === 'icon' ? react_1.default.createElement(CopyIcon_1.CopyIcon, null) : undefined, size: "small", variant:
|
|
51
|
-
}
|
|
50
|
+
react_1.default.createElement(Button_1.Button, { "data-component-name": "Buttons/CopyButton", onClick: (e) => copy(e, toasterDuration), "data-testid": dataTestId, icon: type === 'icon' ? react_1.default.createElement(CopyIcon_1.CopyIcon, null) : undefined, size: "small", variant: variant }, type !== 'icon' && translate('theme.codeSnippet.copy.toasterText', buttonText || 'Copy'))));
|
|
51
|
+
}
|
|
52
52
|
exports.CopyButton = (0, react_1.memo)(CopyButtonComponent);
|
|
53
53
|
//# sourceMappingURL=CopyButton.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
type EditPageButtonProps = {
|
|
2
|
+
export type EditPageButtonProps = {
|
|
3
3
|
to: string;
|
|
4
4
|
};
|
|
5
|
-
export declare
|
|
6
|
-
export {};
|
|
5
|
+
export declare function EditPageButton({ to }: EditPageButtonProps): JSX.Element;
|
|
@@ -9,14 +9,14 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const hooks_1 = require("../../core/hooks");
|
|
10
10
|
const EditIcon_1 = require("../../icons/EditIcon/EditIcon");
|
|
11
11
|
const Link_1 = require("../../components/Link/Link");
|
|
12
|
-
|
|
12
|
+
function EditPageButton({ to }) {
|
|
13
13
|
const { useTranslate, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
14
14
|
const { translate } = useTranslate();
|
|
15
15
|
const telemetry = useTelemetry();
|
|
16
16
|
return (react_1.default.createElement(EditPageButtonWrapper, { "data-component-name": "Buttons/EditPageButton", to: to, onClick: () => telemetry.send('edit_page_link_clicked', {}) },
|
|
17
17
|
react_1.default.createElement(ButtonIcon, null),
|
|
18
18
|
react_1.default.createElement(ButtonText, { "data-translation-key": "theme.markdown.editPage.text" }, translate('theme.markdown.editPage.text', 'Edit'))));
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
20
|
exports.EditPageButton = EditPageButton;
|
|
21
21
|
const EditPageButtonWrapper = (0, styled_components_1.default)(Link_1.Link) `
|
|
22
22
|
height: fit-content;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type EmailButtonProps = {
|
|
3
3
|
data: string;
|
|
4
4
|
dataTestId?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare
|
|
7
|
-
export {};
|
|
5
|
+
};
|
|
6
|
+
export declare function EmailButton({ data, dataTestId }: EmailButtonProps): JSX.Element;
|
|
@@ -7,12 +7,12 @@ exports.EmailButton = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Button_1 = require("../../components/Button/Button");
|
|
9
9
|
const EmailIcon_1 = require("../../icons/EmailIcon/EmailIcon");
|
|
10
|
-
|
|
10
|
+
function EmailButton({ data, dataTestId = 'email-button' }) {
|
|
11
11
|
const onClick = () => {
|
|
12
12
|
window.location.href = `mailto:${data}`;
|
|
13
13
|
};
|
|
14
14
|
return (react_1.default.createElement("div", { "data-component-name": "Buttons/EmailButton" },
|
|
15
15
|
react_1.default.createElement(Button_1.Button, { onClick: onClick, icon: react_1.default.createElement(EmailIcon_1.EmailIcon, null), size: "small", variant: "text", "data-testid": dataTestId, "aria-label": "Email" })));
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
exports.EmailButton = EmailButton;
|
|
18
18
|
//# sourceMappingURL=EmailButton.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type NewTabButtonProps = {
|
|
3
3
|
data: string;
|
|
4
4
|
dataTestId?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare
|
|
7
|
-
export {};
|
|
5
|
+
};
|
|
6
|
+
export declare function NewTabButton({ data, dataTestId, }: NewTabButtonProps): JSX.Element;
|
|
@@ -7,12 +7,12 @@ exports.NewTabButton = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Button_1 = require("../../components/Button/Button");
|
|
9
9
|
const ArrowUpRightIcon_1 = require("../../icons/ArrowUpRightIcon/ArrowUpRightIcon");
|
|
10
|
-
|
|
10
|
+
function NewTabButton({ data, dataTestId = 'new-tab-button', }) {
|
|
11
11
|
const onClick = () => {
|
|
12
12
|
window.open(data, '_blank');
|
|
13
13
|
};
|
|
14
14
|
return (react_1.default.createElement("div", { "data-component-name": "Buttons/NewTabButton" },
|
|
15
15
|
react_1.default.createElement(Button_1.Button, { onClick: onClick, icon: react_1.default.createElement(ArrowUpRightIcon_1.ArrowUpRightIcon, null), "data-testid": dataTestId, "aria-label": "Open in new tab", size: "small", variant: "text" })));
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
exports.NewTabButton = NewTabButton;
|
|
18
18
|
//# sourceMappingURL=NewTabButton.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CatalogConfig } from '../../config';
|
|
3
|
-
export
|
|
3
|
+
export type CatalogProps = {
|
|
4
4
|
pageProps: {
|
|
5
5
|
catalogId: string;
|
|
6
6
|
catalogConfig: CatalogConfig;
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
export default function Catalog(props: CatalogProps): JSX.Element;
|
|
9
10
|
export declare const CatalogPageContent: import("styled-components").StyledComponent<"main", any, {}, never>;
|
|
10
11
|
export declare const CatalogTitle: import("styled-components").StyledComponent<"h2", any, {}, never>;
|
|
11
12
|
export declare const CatalogDescription: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
@@ -15,7 +15,6 @@ const FilterPopover_1 = require("../../components/Filter/FilterPopover");
|
|
|
15
15
|
const CatalogHighlight_1 = require("../../components/Catalog/CatalogHighlight");
|
|
16
16
|
const CatalogActions_1 = require("../../components/Catalog/CatalogActions");
|
|
17
17
|
const Sidebar_1 = require("../../components/Sidebar/Sidebar");
|
|
18
|
-
const MenuContainer_1 = require("../../components/Menu/MenuContainer");
|
|
19
18
|
const CounterTag_1 = require("../../components/Tags/CounterTag");
|
|
20
19
|
function Catalog(props) {
|
|
21
20
|
const { catalogConfig } = props.pageProps;
|
|
@@ -133,9 +132,6 @@ const FiltersSidebar = (0, styled_components_1.default)(Sidebar_1.Sidebar) `
|
|
|
133
132
|
@media screen and (min-width: ${utils_1.breakpoints.medium}) {
|
|
134
133
|
display: flex;
|
|
135
134
|
}
|
|
136
|
-
|
|
137
|
-
${MenuContainer_1.MenuContainer} {
|
|
138
|
-
padding: 0;
|
|
139
|
-
}
|
|
135
|
+
--menu-container-padding-top: 0;
|
|
140
136
|
`;
|
|
141
137
|
//# sourceMappingURL=Catalog.js.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ResolvedFilter } from '../../core/types';
|
|
3
|
-
type CatalogActionsProps = {
|
|
3
|
+
export type CatalogActionsProps = {
|
|
4
4
|
onOpenFilter: () => void;
|
|
5
5
|
filters: ResolvedFilter[];
|
|
6
6
|
filterTerm: string;
|
|
7
7
|
};
|
|
8
8
|
export declare function CatalogActions(props: CatalogActionsProps): JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CatalogItem } from '../../core/types';
|
|
3
|
-
type CatalogCardProps = {
|
|
3
|
+
export type CatalogCardProps = {
|
|
4
4
|
item: CatalogItem;
|
|
5
5
|
};
|
|
6
6
|
export declare function CatalogCard({ item }: CatalogCardProps): JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -37,10 +37,9 @@ const Tag_1 = require("../../components/Tag/Tag");
|
|
|
37
37
|
const CatalogHighlight_1 = require("../../components/Catalog/CatalogHighlight");
|
|
38
38
|
const Button_1 = require("../../components/Button/Button");
|
|
39
39
|
function CatalogCard({ item }) {
|
|
40
|
-
var _a
|
|
40
|
+
var _a;
|
|
41
41
|
const { useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
42
42
|
const telemetry = useTelemetry();
|
|
43
|
-
const hasTags = item.scorecardLevel || ((_a = item.tags) === null || _a === void 0 ? void 0 : _a.length);
|
|
44
43
|
return (React.createElement(Link_1.Link, { key: item.docsLink || item.link, to: item.docsLink || item.link },
|
|
45
44
|
React.createElement(StyledCard, { "data-component-name": "Catalog/CatalogCard", onClick: () => telemetry.send('catalog_item_clicked', {}) },
|
|
46
45
|
React.createElement(CardContent, null,
|
|
@@ -48,14 +47,14 @@ function CatalogCard({ item }) {
|
|
|
48
47
|
React.createElement(CardTitle, null,
|
|
49
48
|
React.createElement(CatalogHighlight_1.CatalogHighlight, null, item.title))),
|
|
50
49
|
React.createElement(CardDescription, null,
|
|
51
|
-
React.createElement(CatalogHighlight_1.CatalogHighlight, null, (
|
|
50
|
+
React.createElement(CatalogHighlight_1.CatalogHighlight, null, (_a = item.description) !== null && _a !== void 0 ? _a : ''))),
|
|
52
51
|
React.createElement(CardFooter, null,
|
|
53
|
-
|
|
52
|
+
React.createElement(CardTags, null,
|
|
54
53
|
(item.tags || []).map((tag, index) => (React.createElement(CardTag, { key: tag + index, color: (0, utils_1.slug)(tag) },
|
|
55
54
|
React.createElement(CatalogHighlight_1.CatalogHighlight, null, (0, utils_1.capitalize)(tag))))),
|
|
56
55
|
(item.scorecardLevel && (React.createElement(Tag_1.Tag, { borderless: true, withStatusDot: true, statusDotColor: `var(${(0, utils_1.getScorecardColorVariable)(item.scorecardLevelIdx || 0, Object.keys(item.scorecardLevels || {}).length)})` },
|
|
57
56
|
React.createElement(CatalogHighlight_1.CatalogHighlight, null, item.scorecardLevel)))) ||
|
|
58
|
-
null)
|
|
57
|
+
null),
|
|
59
58
|
React.createElement(SelectButton, { size: "medium", variant: "secondary", icon: React.createElement(ArrowRightIcon_1.ArrowRightIcon, null) })))));
|
|
60
59
|
}
|
|
61
60
|
exports.CatalogCard = CatalogCard;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const HighlightContext: React.Context<string[]>;
|
|
3
|
-
type CatalogHighlightProps = React.PropsWithChildren;
|
|
3
|
+
export type CatalogHighlightProps = React.PropsWithChildren;
|
|
4
4
|
export declare function CatalogHighlight(props: CatalogHighlightProps): JSX.Element | null;
|
|
5
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
type CatalogInfoBlockProps = {
|
|
2
|
+
export type CatalogInfoBlockProps = {
|
|
3
3
|
metadata?: {
|
|
4
4
|
scorecardLevel?: string;
|
|
5
5
|
scoreCardSlug?: string;
|
|
@@ -9,4 +9,3 @@ type CatalogInfoBlockProps = {
|
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export declare function CatalogInfoBlock(props: CatalogInfoBlockProps): JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -37,7 +37,7 @@ const CodeBlockControls_1 = require("../../components/CodeBlock/CodeBlockControl
|
|
|
37
37
|
function CodeBlock({ lang, source, externalSource, header, dataTestId = 'source-code', codeBlockRef, highlightedHtml, withLineNumbers, startLineNumber, className, codeBlockMaxHeight, tabs, hideCodeColors, wrapContents = false, children, }) {
|
|
38
38
|
var _a, _b, _c, _d, _e, _f;
|
|
39
39
|
const [sourceCode, setSourceCode] = (0, react_1.useState)((_c = (source || ((_b = (_a = externalSource === null || externalSource === void 0 ? void 0 : externalSource.sample) === null || _a === void 0 ? void 0 : _a.get) === null || _b === void 0 ? void 0 : _b.call(_a, externalSource)))) !== null && _c !== void 0 ? _c : '');
|
|
40
|
-
const highlightedCode = highlightedHtml || children ? null : (0, utils_1.highlight)(sourceCode, lang);
|
|
40
|
+
const highlightedCode = highlightedHtml || (children ? null : (0, utils_1.highlight)(sourceCode, lang));
|
|
41
41
|
// The same initial value should be returned for ssr and frontend to avoid issues
|
|
42
42
|
// Because we don't have session storage in ssr and can't get the security details there
|
|
43
43
|
// Issue for more details https://github.com/Redocly/reference-docs/issues/888
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
hideCodeColors?: boolean
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
export type CodeBlockContainerProps = PropsWithChildren<{
|
|
3
|
+
hideCodeColors?: boolean;
|
|
4
|
+
maxHeight?: string;
|
|
5
|
+
wrapContents?: boolean;
|
|
6
|
+
ref?: (instance: HTMLPreElement | null) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
dangerouslySetInnerHTML?: {
|
|
9
|
+
__html: string;
|
|
10
|
+
};
|
|
11
|
+
suppressHydrationWarning?: boolean;
|
|
12
|
+
tabIndex?: number;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function CodeBlockContainer(props: CodeBlockContainerProps): JSX.Element;
|
|
@@ -22,14 +22,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.CodeBlockContainer = void 0;
|
|
30
|
+
const react_1 = __importDefault(require("react"));
|
|
27
31
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
28
32
|
const utils_1 = require("../../core/utils");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
function CodeBlockContainer(props) {
|
|
34
|
+
return (react_1.default.createElement(CodeBlockContainerComponent, Object.assign({}, props, { "data-component-name": "CodeBlock/CodeBlockContainer" })));
|
|
35
|
+
}
|
|
36
|
+
exports.CodeBlockContainer = CodeBlockContainer;
|
|
37
|
+
const CodeBlockContainerComponent = styled_components_1.default.pre `
|
|
33
38
|
&& {
|
|
34
39
|
overflow-x: auto;
|
|
35
40
|
font-family: var(--code-block-font-family);
|
|
@@ -48,6 +48,8 @@ exports.CodeBlockControls = CodeBlockControls;
|
|
|
48
48
|
const ContainerWrapper = styled_components_1.default.div `
|
|
49
49
|
display: grid;
|
|
50
50
|
justify-content: end;
|
|
51
|
+
font-size: var(--code-block-controls-font-size);
|
|
52
|
+
font-family: var(--code-block-controls-font-family);
|
|
51
53
|
background-color: var(--code-block-controls-bg-color);
|
|
52
54
|
padding: var(--code-block-controls-padding);
|
|
53
55
|
border-bottom: var(--code-block-controls-border);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FileTabs } from '../../components/CodeBlock/CodeBlock';
|
|
3
|
-
type CodeBlockTabsProps = {
|
|
3
|
+
export type CodeBlockTabsProps = {
|
|
4
4
|
tabs: FileTabs;
|
|
5
5
|
};
|
|
6
6
|
export declare function CodeBlockTabs({ tabs }: CodeBlockTabsProps): JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -49,8 +49,8 @@ exports.code = (0, styled_components_1.css) `
|
|
|
49
49
|
--code-block-controls-font-weight: var(--font-weight-medium); // @presenter Color
|
|
50
50
|
--code-block-controls-bg-color: transparent; // @presenter Color
|
|
51
51
|
--code-block-controls-border: 1px solid var(--border-color-secondary); // @presenter Border
|
|
52
|
-
--code-block-icon-controls-
|
|
53
|
-
--code-block-text-controls-
|
|
52
|
+
--code-block-icon-controls-bg-color: var(--code-block-controls-bg-color);
|
|
53
|
+
--code-block-text-controls-bg-color: var(--code-block-controls-bg-color);
|
|
54
54
|
--code-block-controls-padding: var(--spacing-unit) var(--spacing-unit) var(--spacing-unit) var(--spacing-base);
|
|
55
55
|
--code-block-controls-height: 20px;
|
|
56
56
|
--code-block-controls-width: 20px;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ColorModeIconProps = {
|
|
3
3
|
mode?: 'dark' | 'light' | string;
|
|
4
4
|
className?: string;
|
|
5
|
-
}
|
|
6
|
-
declare function
|
|
7
|
-
export declare const ColorModeIcon: import("styled-components").StyledComponent<typeof Icon, any, {
|
|
8
|
-
'data-component-name': string;
|
|
9
|
-
}, "data-component-name">;
|
|
10
|
-
export {};
|
|
5
|
+
};
|
|
6
|
+
export declare function ColorModeIcon(props: ColorModeIconProps): JSX.Element;
|
|
@@ -9,6 +9,10 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const ContrastIcon_1 = require("../../icons/ContrastIcon/ContrastIcon");
|
|
10
10
|
const MoonIcon_1 = require("../../icons/MoonIcon/MoonIcon");
|
|
11
11
|
const SunIcon_1 = require("../../icons/SunIcon/SunIcon");
|
|
12
|
+
function ColorModeIcon(props) {
|
|
13
|
+
return (react_1.default.createElement(ColorModeIconComponent, Object.assign({}, props, { "data-component-name": "ColorModeSwitcher/ColorModeIcon" })));
|
|
14
|
+
}
|
|
15
|
+
exports.ColorModeIcon = ColorModeIcon;
|
|
12
16
|
function Icon({ mode, className }) {
|
|
13
17
|
switch (mode) {
|
|
14
18
|
case 'dark':
|
|
@@ -19,9 +23,7 @@ function Icon({ mode, className }) {
|
|
|
19
23
|
return react_1.default.createElement(ContrastIcon_1.ContrastIcon, { "data-testid": "custom", className: className + (mode ? ' ' + mode : '') });
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
|
-
|
|
23
|
-
'data-component-name': 'ColorModeSwitcher/ColorModeIcon',
|
|
24
|
-
})) `
|
|
26
|
+
const ColorModeIconComponent = (0, styled_components_1.default)(Icon) `
|
|
25
27
|
box-sizing: border-box;
|
|
26
28
|
`;
|
|
27
29
|
//# sourceMappingURL=ColorModeIcon.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DatePicker as DatePickerComponent } from 'react-date-picker';
|
|
3
|
-
type
|
|
4
|
-
export declare const DatePicker: (props:
|
|
5
|
-
export {};
|
|
3
|
+
export type DatePickerProps = React.ComponentProps<typeof DatePickerComponent>;
|
|
4
|
+
export declare const DatePicker: (props: DatePickerProps) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
|
-
type DropdownProps = PropsWithChildren<{
|
|
3
|
+
export type DropdownProps = PropsWithChildren<{
|
|
4
4
|
trigger: React.ReactNode;
|
|
5
5
|
triggerEvent?: 'click' | 'hover';
|
|
6
6
|
placement?: 'top' | 'bottom';
|
|
@@ -11,5 +11,4 @@ type DropdownProps = PropsWithChildren<{
|
|
|
11
11
|
className?: string;
|
|
12
12
|
withArrow?: boolean;
|
|
13
13
|
}>;
|
|
14
|
-
export declare function Dropdown({ children, className, active, trigger, triggerEvent, closeOnClick, withArrow, dataAttributes, placement, alignment, }: DropdownProps):
|
|
15
|
-
export {};
|
|
14
|
+
export declare function Dropdown({ children, className, active, trigger, triggerEvent, closeOnClick, withArrow, dataAttributes, placement, alignment, }: DropdownProps): JSX.Element;
|
|
@@ -41,14 +41,19 @@ function Dropdown({ children, className, active, trigger, triggerEvent = 'click'
|
|
|
41
41
|
const handleClose = () => {
|
|
42
42
|
setIsOpen(false);
|
|
43
43
|
};
|
|
44
|
-
const
|
|
44
|
+
const handleChildClick = (event) => {
|
|
45
|
+
event.stopPropagation();
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
handleClose();
|
|
48
|
+
};
|
|
49
|
+
const handleToggle = (event) => {
|
|
50
|
+
event.stopPropagation();
|
|
51
|
+
event.preventDefault();
|
|
45
52
|
setIsOpen(!isOpen);
|
|
46
53
|
};
|
|
47
54
|
const handleKeyDown = (event) => {
|
|
48
55
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
49
|
-
handleToggle();
|
|
50
|
-
event.stopPropagation();
|
|
51
|
-
event.preventDefault();
|
|
56
|
+
handleToggle(event);
|
|
52
57
|
}
|
|
53
58
|
};
|
|
54
59
|
(0, hooks_1.useOutsideClick)(dropdownRef, handleClose);
|
|
@@ -56,7 +61,7 @@ function Dropdown({ children, className, active, trigger, triggerEvent = 'click'
|
|
|
56
61
|
const dropdownTrigger = (0, react_1.cloneElement)(triggerChild, Object.assign(Object.assign(Object.assign(Object.assign({ onClick: triggerEvent === 'click' ? handleToggle : undefined, icon: withArrow ? isOpen ? react_1.default.createElement(ChevronUpIcon_1.ChevronUpIcon, null) : react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, null) : undefined }, (withArrow ? { iconPosition: 'right' } : {})), { tabIndex: 0 }), triggerChild.props), { onKeyDown: triggerEvent === 'click' ? handleKeyDown : undefined }));
|
|
57
62
|
return (react_1.default.createElement(DropdownWrapper, Object.assign({ "data-component-name": "Dropdown/Dropdown", "data-testid": "dropdown" }, dataAttributes, { className: className, ref: dropdownRef, onPointerEnter: triggerEvent === 'hover' ? handleOpen : undefined, onPointerLeave: triggerEvent === 'hover' ? handleClose : undefined }),
|
|
58
63
|
dropdownTrigger,
|
|
59
|
-
isOpen && (react_1.default.createElement(ChildrenWrapper, { placement: placement, alignment: alignment, onClick: closeOnClick ?
|
|
64
|
+
isOpen && (react_1.default.createElement(ChildrenWrapper, { placement: placement, alignment: alignment, onClick: closeOnClick ? handleChildClick : undefined }, children))));
|
|
60
65
|
}
|
|
61
66
|
exports.Dropdown = Dropdown;
|
|
62
67
|
const DropdownWrapper = styled_components_1.default.div `
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { ReactNode } from 'react';
|
|
3
2
|
import type { DropdownMenuItemProps } from '../../components/Dropdown/DropdownMenuItem';
|
|
4
3
|
export type DropdownMenuProps = {
|
|
@@ -9,4 +8,4 @@ export type DropdownMenuProps = {
|
|
|
9
8
|
} | {
|
|
10
9
|
children?: ReactNode;
|
|
11
10
|
});
|
|
12
|
-
export declare function DropdownMenu(props: DropdownMenuProps):
|
|
11
|
+
export declare function DropdownMenu(props: DropdownMenuProps): JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { CSSProperties, ReactNode, PropsWithChildren } from 'react';
|
|
3
2
|
import type { LinkProps } from '../../components/Link/Link';
|
|
4
3
|
export type DropdownMenuItemProps = Partial<Pick<LinkProps, 'to' | 'target' | 'external'>> & {
|
|
@@ -16,4 +15,4 @@ export type DropdownMenuItemProps = Partial<Pick<LinkProps, 'to' | 'target' | 'e
|
|
|
16
15
|
onAction?: () => void;
|
|
17
16
|
active?: boolean;
|
|
18
17
|
};
|
|
19
|
-
export declare function DropdownMenuItem({ children, content, active, onAction, to, dangerous, prefix, suffix, disabled, separator, dataAttributes, className, separatorLine, style, role, ...otherProps }: PropsWithChildren<DropdownMenuItemProps>):
|
|
18
|
+
export declare function DropdownMenuItem({ children, content, active, onAction, to, dangerous, prefix, suffix, disabled, separator, dataAttributes, className, separatorLine, style, role, ...otherProps }: PropsWithChildren<DropdownMenuItemProps>): JSX.Element;
|
|
@@ -51,6 +51,7 @@ function DropdownMenuItem(_a) {
|
|
|
51
51
|
onAction === null || onAction === void 0 ? void 0 : onAction();
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
+
className = className || '' + (active ? ' active' : '');
|
|
54
55
|
if (to) {
|
|
55
56
|
return (react_1.default.createElement(DropdownMenuItemWrapper, Object.assign({ as: Link_1.Link, "data-component-name": "Dropdown/DropdownMenuItem", className: className, separatorLine: separatorLine, to: to, style: style, role: role }, dataAttributes, otherProps),
|
|
56
57
|
prefix,
|
|
@@ -99,17 +100,30 @@ const DropdownMenuItemWrapper = styled_components_1.default.li `
|
|
|
99
100
|
`}
|
|
100
101
|
|
|
101
102
|
background-color: var(--dropdown-menu-item-bg-color);
|
|
103
|
+
color: var(--dropdown-menu-item-color);
|
|
104
|
+
|
|
105
|
+
${({ active }) => active &&
|
|
106
|
+
(0, styled_components_1.css) `
|
|
107
|
+
background-color: var(--dropdown-menu-item-bg-color-active);
|
|
108
|
+
color: var(--dropdown-menu-item-color-active);
|
|
109
|
+
svg {
|
|
110
|
+
fill: var(--dropdown-menu-item-color-active);
|
|
111
|
+
}
|
|
112
|
+
`}
|
|
113
|
+
|
|
102
114
|
&:hover {
|
|
103
115
|
background-color: var(--dropdown-menu-item-bg-color-hover);
|
|
116
|
+
color: var(--dropdown-menu-item-color-hover);
|
|
104
117
|
}
|
|
105
118
|
|
|
106
119
|
${({ disabled }) => disabled &&
|
|
107
120
|
(0, styled_components_1.css) `
|
|
108
121
|
cursor: default;
|
|
109
122
|
pointer-events: none;
|
|
110
|
-
color: var(--dropdown-menu-color-disabled);
|
|
123
|
+
background-color: var(--dropdown-menu-item-bg-color-disabled);
|
|
124
|
+
color: var(--dropdown-menu-item-color-disabled);
|
|
111
125
|
svg {
|
|
112
|
-
fill: var(--dropdown-menu-color-disabled);
|
|
126
|
+
fill: var(--dropdown-menu-item-color-disabled);
|
|
113
127
|
}
|
|
114
128
|
`}
|
|
115
129
|
|
|
@@ -128,9 +142,12 @@ const DropdownMenuItemWrapper = styled_components_1.default.li `
|
|
|
128
142
|
|
|
129
143
|
${({ dangerous }) => dangerous &&
|
|
130
144
|
(0, styled_components_1.css) `
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
&:hover,
|
|
146
|
+
& {
|
|
147
|
+
color: var(--dropdown-menu-item-color-dangerous);
|
|
148
|
+
svg {
|
|
149
|
+
fill: var(--dropdown-menu-item-color-dangerous);
|
|
150
|
+
}
|
|
134
151
|
}
|
|
135
152
|
`}
|
|
136
153
|
`;
|