@redocly/theme 0.54.0-next.5 → 0.54.0-next.7
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/Breadcrumbs/Breadcrumbs.js +9 -6
- package/lib/components/Buttons/EditPageButton.js +3 -3
- package/lib/components/{CatalogLegacy/CatalogLegacy.d.ts → CatalogClassic/CatalogClassic.d.ts} +2 -2
- package/lib/components/{CatalogLegacy/CatalogLegacy.js → CatalogClassic/CatalogClassic.js} +23 -23
- package/lib/components/{CatalogLegacy/CatalogLegacyActions.d.ts → CatalogClassic/CatalogClassicActions.d.ts} +2 -2
- package/lib/components/{CatalogLegacy/CatalogLegacyActions.js → CatalogClassic/CatalogClassicActions.js} +12 -12
- package/lib/components/CatalogClassic/CatalogClassicCard.d.ts +6 -0
- package/lib/components/{CatalogLegacy/CatalogLegacyCard.js → CatalogClassic/CatalogClassicCard.js} +36 -35
- package/lib/components/CatalogClassic/CatalogClassicHighlight.d.ts +5 -0
- package/lib/components/{CatalogLegacy/CatalogLegacyHighlight.js → CatalogClassic/CatalogClassicHighlight.js} +4 -4
- package/lib/components/{CatalogLegacy/CatalogLegacyInfoBlock.d.ts → CatalogClassic/CatalogClassicInfoBlock.d.ts} +2 -2
- package/lib/components/{CatalogLegacy/CatalogLegacyInfoBlock.js → CatalogClassic/CatalogClassicInfoBlock.js} +13 -13
- package/lib/components/{CatalogLegacy/CatalogLegacyVirtualizedGroups.d.ts → CatalogClassic/CatalogClassicVirtualizedGroups.d.ts} +2 -2
- package/lib/components/{CatalogLegacy/CatalogLegacyVirtualizedGroups.js → CatalogClassic/CatalogClassicVirtualizedGroups.js} +36 -42
- package/lib/components/CatalogClassic/variables.d.ts +1 -0
- package/lib/components/CatalogClassic/variables.js +109 -0
- package/lib/components/CodeBlock/CodeBlockControls.js +3 -2
- package/lib/components/ColorModeSwitcher/ColorModeSwitcher.js +1 -1
- package/lib/components/Feedback/Feedback.js +1 -1
- package/lib/components/Feedback/ReportDialog.js +3 -3
- package/lib/components/Filter/FilterCheckboxes.js +3 -3
- package/lib/components/Filter/FilterDateRange.js +2 -2
- package/lib/components/Footer/FooterItem.js +3 -3
- package/lib/components/LanguagePicker/LanguagePicker.js +6 -3
- package/lib/components/Logo/Logo.js +3 -3
- package/lib/components/Menu/MenuItem.js +9 -4
- package/lib/components/Navbar/Navbar.js +5 -5
- package/lib/components/Navbar/NavbarItem.js +3 -3
- package/lib/components/Search/SearchDialog.js +19 -8
- package/lib/components/Search/SearchInput.js +3 -3
- package/lib/components/Search/SearchRecent.d.ts +1 -1
- package/lib/components/Search/SearchRecent.js +6 -6
- package/lib/components/SidebarActions/SidebarActions.js +5 -7
- package/lib/components/TableOfContent/TableOfContent.js +3 -3
- package/lib/components/UserMenu/LoginButton.js +3 -3
- package/lib/components/UserMenu/LogoutMenuItem.js +3 -3
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +1 -1
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +1 -1
- package/lib/core/hooks/search/use-search-dialog.js +4 -4
- package/lib/core/hooks/use-color-switcher.js +6 -3
- package/lib/core/hooks/use-product-picker.js +3 -3
- package/lib/core/hooks/use-tabs.d.ts +7 -2
- package/lib/core/hooks/use-tabs.js +232 -7
- package/lib/core/styles/global.js +4 -4
- package/lib/core/types/hooks.d.ts +4 -4
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/index.js +6 -6
- package/lib/markdoc/components/Tabs/Tab.d.ts +7 -6
- package/lib/markdoc/components/Tabs/Tab.js +5 -87
- package/lib/markdoc/components/Tabs/TabList.d.ts +33 -0
- package/lib/markdoc/components/Tabs/TabList.js +240 -0
- package/lib/markdoc/components/Tabs/Tabs.d.ts +8 -3
- package/lib/markdoc/components/Tabs/Tabs.js +133 -34
- package/lib/markdoc/components/Tabs/variables.js +53 -20
- package/lib/markdoc/components/default.d.ts +1 -0
- package/lib/markdoc/components/default.js +1 -0
- package/lib/markdoc/tags/tab.js +1 -0
- package/lib/markdoc/tags/tabs.js +3 -0
- package/package.json +5 -4
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -6
- package/src/components/Buttons/EditPageButton.tsx +3 -3
- package/src/components/{CatalogLegacy/CatalogLegacy.tsx → CatalogClassic/CatalogClassic.tsx} +21 -21
- package/src/components/{CatalogLegacy/CatalogLegacyActions.tsx → CatalogClassic/CatalogClassicActions.tsx} +11 -11
- package/src/components/{CatalogLegacy/CatalogLegacyCard.tsx → CatalogClassic/CatalogClassicCard.tsx} +37 -36
- package/src/components/{CatalogLegacy/CatalogLegacyHighlight.tsx → CatalogClassic/CatalogClassicHighlight.tsx} +3 -3
- package/src/components/{CatalogLegacy/CatalogLegacyInfoBlock.tsx → CatalogClassic/CatalogClassicInfoBlock.tsx} +14 -12
- package/src/components/{CatalogLegacy/CatalogLegacyVirtualizedGroups.tsx → CatalogClassic/CatalogClassicVirtualizedGroups.tsx} +40 -46
- package/src/components/CatalogClassic/variables.ts +106 -0
- package/src/components/CodeBlock/CodeBlockControls.tsx +3 -2
- package/src/components/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -0
- package/src/components/Feedback/Feedback.tsx +1 -1
- package/src/components/Feedback/ReportDialog.tsx +3 -3
- package/src/components/Filter/FilterCheckboxes.tsx +3 -3
- package/src/components/Filter/FilterDateRange.tsx +0 -2
- package/src/components/Footer/FooterItem.tsx +3 -3
- package/src/components/LanguagePicker/LanguagePicker.tsx +6 -3
- package/src/components/Logo/Logo.tsx +3 -3
- package/src/components/Menu/MenuItem.tsx +9 -3
- package/src/components/Navbar/Navbar.tsx +5 -5
- package/src/components/Navbar/NavbarItem.tsx +5 -3
- package/src/components/Search/SearchDialog.tsx +19 -8
- package/src/components/Search/SearchInput.tsx +3 -3
- package/src/components/Search/SearchRecent.tsx +9 -9
- package/src/components/SidebarActions/SidebarActions.tsx +5 -5
- package/src/components/TableOfContent/TableOfContent.tsx +3 -3
- package/src/components/UserMenu/LoginButton.tsx +3 -3
- package/src/components/UserMenu/LogoutMenuItem.tsx +3 -3
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -1
- package/src/core/hooks/search/use-search-dialog.ts +4 -4
- package/src/core/hooks/use-color-switcher.ts +6 -3
- package/src/core/hooks/use-product-picker.ts +3 -3
- package/src/core/hooks/use-tabs.ts +274 -8
- package/src/core/styles/global.ts +2 -2
- package/src/core/types/hooks.ts +7 -64
- package/src/core/types/l10n.ts +3 -1
- package/src/index.ts +6 -6
- package/src/markdoc/components/Tabs/Tab.tsx +23 -74
- package/src/markdoc/components/Tabs/TabList.tsx +309 -0
- package/src/markdoc/components/Tabs/Tabs.tsx +149 -46
- package/src/markdoc/components/Tabs/variables.ts +54 -21
- package/src/markdoc/components/default.ts +1 -0
- package/src/markdoc/tags/tab.ts +1 -0
- package/src/markdoc/tags/tabs.ts +3 -0
- package/lib/components/CatalogLegacy/CatalogLegacyCard.d.ts +0 -6
- package/lib/components/CatalogLegacy/CatalogLegacyHighlight.d.ts +0 -5
- package/lib/components/CatalogLegacy/variables.d.ts +0 -1
- package/lib/components/CatalogLegacy/variables.js +0 -109
- package/src/components/CatalogLegacy/variables.ts +0 -106
|
@@ -9,8 +9,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
|
-
const { useBreadcrumbs,
|
|
13
|
-
const
|
|
12
|
+
const { useBreadcrumbs, useOtelTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
13
|
+
const otelTelemetry = useOtelTelemetry();
|
|
14
14
|
const breadcrumbs = useBreadcrumbs();
|
|
15
15
|
if (breadcrumbs.length === 0) {
|
|
16
16
|
return null;
|
|
@@ -19,10 +19,13 @@ function Breadcrumbs(props) {
|
|
|
19
19
|
const isLast = idx === breadcrumbs.length - 1;
|
|
20
20
|
return (react_1.default.createElement(react_1.default.Fragment, { key: idx },
|
|
21
21
|
react_1.default.createElement(Breadcrumb_1.Breadcrumb, { link: breadcrumb.link, label: breadcrumb.label, isActive: isLast, onClick: () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
otelTelemetry.send({
|
|
23
|
+
type: 'breadcrumb.clicked',
|
|
24
|
+
payload: {
|
|
25
|
+
link: breadcrumb.link,
|
|
26
|
+
position: idx + 1,
|
|
27
|
+
total_breadcrumbs: breadcrumbs.length,
|
|
28
|
+
},
|
|
26
29
|
});
|
|
27
30
|
} }),
|
|
28
31
|
isLast ? null : react_1.default.createElement("span", null, "/")));
|
|
@@ -10,10 +10,10 @@ 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
|
-
const { useTranslate,
|
|
13
|
+
const { useTranslate, useOtelTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
14
14
|
const { translate } = useTranslate();
|
|
15
|
-
const
|
|
16
|
-
return (react_1.default.createElement(EditPageButtonWrapper, { "data-component-name": "Buttons/EditPageButton", target: "_blank", to: to, onClick: () =>
|
|
15
|
+
const otelTelemetry = useOtelTelemetry();
|
|
16
|
+
return (react_1.default.createElement(EditPageButtonWrapper, { "data-component-name": "Buttons/EditPageButton", target: "_blank", to: to, onClick: () => otelTelemetry.send({ type: 'edit_page_link.clicked' }) },
|
|
17
17
|
react_1.default.createElement(ButtonIcon, null),
|
|
18
18
|
react_1.default.createElement(ButtonText, { "data-translation-key": "markdown.editPage.text" }, translate('markdown.editPage.text', 'Edit'))));
|
|
19
19
|
}
|
package/lib/components/{CatalogLegacy/CatalogLegacy.d.ts → CatalogClassic/CatalogClassic.d.ts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
2
|
import type { CatalogConfig } from '../../config';
|
|
3
|
-
export type
|
|
3
|
+
export type CatalogClassicProps = {
|
|
4
4
|
pageProps: {
|
|
5
5
|
catalogId: string;
|
|
6
6
|
catalogConfig: CatalogConfig;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
export default function
|
|
9
|
+
export default function CatalogClassic(props: CatalogClassicProps): JSX.Element;
|
|
10
10
|
export declare const CatalogPageContent: import("styled-components").StyledComponent<"main", any, {}, never>;
|
|
11
11
|
export declare const CatalogTitle: import("styled-components").StyledComponent<"h2", any, {}, never>;
|
|
12
12
|
export declare const CatalogDescription: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CatalogPageDescriptionWrapper = exports.CatalogPageWrapper = exports.CatalogDescription = exports.CatalogTitle = exports.CatalogPageContent = void 0;
|
|
7
|
-
exports.default =
|
|
7
|
+
exports.default = CatalogClassic;
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
10
|
const utils_1 = require("../../core/utils");
|
|
@@ -12,22 +12,22 @@ const hooks_1 = require("../../core/hooks");
|
|
|
12
12
|
const H2_1 = require("../../components/Typography/H2");
|
|
13
13
|
const FilterContent_1 = require("../../components/Filter/FilterContent");
|
|
14
14
|
const FilterPopover_1 = require("../../components/Filter/FilterPopover");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const CatalogClassicHighlight_1 = require("../../components/CatalogClassic/CatalogClassicHighlight");
|
|
16
|
+
const CatalogClassicActions_1 = require("../../components/CatalogClassic/CatalogClassicActions");
|
|
17
17
|
const Sidebar_1 = require("../../components/Sidebar/Sidebar");
|
|
18
|
-
const
|
|
19
|
-
function
|
|
18
|
+
const CatalogClassicVirtualizedGroups_1 = require("../../components/CatalogClassic/CatalogClassicVirtualizedGroups");
|
|
19
|
+
function CatalogClassic(props) {
|
|
20
20
|
const { catalogConfig } = props.pageProps;
|
|
21
|
-
const { useTranslate,
|
|
22
|
-
const { filterTerm, setFilterTerm, groups, filters } =
|
|
21
|
+
const { useTranslate, useCatalogClassic } = (0, hooks_1.useThemeHooks)();
|
|
22
|
+
const { filterTerm, setFilterTerm, groups, filters } = useCatalogClassic(catalogConfig);
|
|
23
23
|
const [filterPopoverVisible, setFilterPopoverVisible] = react_1.default.useState(false);
|
|
24
24
|
const { translate } = useTranslate();
|
|
25
25
|
(0, hooks_1.useModalScrollLock)(filterPopoverVisible);
|
|
26
|
-
return (react_1.default.createElement(
|
|
27
|
-
react_1.default.createElement(exports.CatalogPageWrapper, { "data-component-name": "
|
|
26
|
+
return (react_1.default.createElement(CatalogClassicHighlight_1.HighlightContext.Provider, { value: [filterTerm] },
|
|
27
|
+
react_1.default.createElement(exports.CatalogPageWrapper, { "data-component-name": "CatalogClassic/CatalogClassic", withoutFilters: !filters.length },
|
|
28
28
|
react_1.default.createElement(FiltersSidebar, { menu: react_1.default.createElement(FilterContent_1.FilterContent, { setFilterTerm: setFilterTerm, filters: filters, filterTerm: filterTerm, filterValuesCasing: catalogConfig.filterValuesCasing }) }),
|
|
29
29
|
filterPopoverVisible && (react_1.default.createElement(FilterPopover_1.FilterPopover, { onClose: () => setFilterPopoverVisible(false), setFilterTerm: setFilterTerm, filterTerm: filterTerm, filters: filters, filterValuesCasing: catalogConfig.filterValuesCasing })),
|
|
30
|
-
react_1.default.createElement(
|
|
30
|
+
react_1.default.createElement(CatalogClassicActions_1.CatalogClassicActions, { onOpenFilter: () => setFilterPopoverVisible(true), filters: filters, filterTerm: filterTerm }),
|
|
31
31
|
react_1.default.createElement(exports.CatalogPageContent, null,
|
|
32
32
|
react_1.default.createElement(exports.CatalogPageDescriptionWrapper, null,
|
|
33
33
|
catalogConfig.title ? (react_1.default.createElement(exports.CatalogTitle, { "data-translation-key": catalogConfig.titleTranslationKey },
|
|
@@ -38,7 +38,7 @@ function CatalogLegacy(props) {
|
|
|
38
38
|
' ',
|
|
39
39
|
translate(catalogConfig.descriptionTranslationKey, catalogConfig.description),
|
|
40
40
|
' ')) : null),
|
|
41
|
-
react_1.default.createElement(
|
|
41
|
+
react_1.default.createElement(CatalogClassicVirtualizedGroups_1.CatalogClassicVirtualizedGroups, { groups: groups, filters: filters, filterTerm: filterTerm })))));
|
|
42
42
|
}
|
|
43
43
|
exports.CatalogPageContent = styled_components_1.default.main `
|
|
44
44
|
flex: 1;
|
|
@@ -47,23 +47,23 @@ exports.CatalogPageContent = styled_components_1.default.main `
|
|
|
47
47
|
|
|
48
48
|
@media screen and (min-width: ${utils_1.breakpoints.medium}) {
|
|
49
49
|
width: 100%;
|
|
50
|
-
padding: var(--catalog-
|
|
50
|
+
padding: var(--catalog-classic-page-padding);
|
|
51
51
|
}
|
|
52
52
|
`;
|
|
53
53
|
exports.CatalogTitle = (0, styled_components_1.default)(H2_1.H2) `
|
|
54
|
-
color: var(--catalog-
|
|
55
|
-
font-weight: var(--catalog-
|
|
56
|
-
font-size: var(--catalog-
|
|
57
|
-
margin: var(--catalog-
|
|
54
|
+
color: var(--catalog-classic-title-text-color);
|
|
55
|
+
font-weight: var(--catalog-classic-title-font-weight);
|
|
56
|
+
font-size: var(--catalog-classic-title-font-size);
|
|
57
|
+
margin: var(--catalog-classic-title-margin);
|
|
58
58
|
`;
|
|
59
59
|
exports.CatalogDescription = styled_components_1.default.p `
|
|
60
|
-
color: var(--catalog-
|
|
61
|
-
font-weight: var(--catalog-
|
|
62
|
-
font-size: var(--catalog-
|
|
63
|
-
margin: var(--catalog-
|
|
60
|
+
color: var(--catalog-classic-description-text-color);
|
|
61
|
+
font-weight: var(--catalog-classic-description-font-weight);
|
|
62
|
+
font-size: var(--catalog-classic-description-font-size);
|
|
63
|
+
margin: var(--catalog-classic-description-margin);
|
|
64
64
|
`;
|
|
65
65
|
exports.CatalogPageWrapper = styled_components_1.default.div `
|
|
66
|
-
--sidebar-width: var(--catalog-
|
|
66
|
+
--sidebar-width: var(--catalog-classic-sidebar-width, 285px);
|
|
67
67
|
|
|
68
68
|
display: flex;
|
|
69
69
|
flex-direction: column;
|
|
@@ -95,7 +95,7 @@ exports.CatalogPageWrapper = styled_components_1.default.div `
|
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
97
|
exports.CatalogPageDescriptionWrapper = styled_components_1.default.div `
|
|
98
|
-
margin: var(--catalog-
|
|
98
|
+
margin: var(--catalog-classic-heading-margin);
|
|
99
99
|
display: none;
|
|
100
100
|
|
|
101
101
|
@media screen and (min-width: ${utils_1.breakpoints.medium}) {
|
|
@@ -110,4 +110,4 @@ const FiltersSidebar = (0, styled_components_1.default)(Sidebar_1.Sidebar) `
|
|
|
110
110
|
}
|
|
111
111
|
--menu-container-padding-top: 0;
|
|
112
112
|
`;
|
|
113
|
-
//# sourceMappingURL=
|
|
113
|
+
//# sourceMappingURL=CatalogClassic.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
2
|
import type { ResolvedFilter } from '../../core/types';
|
|
3
|
-
export type
|
|
3
|
+
export type CatalogClassicActionsProps = {
|
|
4
4
|
onOpenFilter: () => void;
|
|
5
5
|
filters: ResolvedFilter[];
|
|
6
6
|
filterTerm: string;
|
|
7
7
|
};
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function CatalogClassicActions(props: CatalogClassicActionsProps): JSX.Element;
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.CatalogClassicActions = CatalogClassicActions;
|
|
30
30
|
const React = __importStar(require("react"));
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const utils_1 = require("../../core/utils");
|
|
@@ -34,7 +34,7 @@ const hooks_1 = require("../../core/hooks");
|
|
|
34
34
|
const Button_1 = require("../../components/Button/Button");
|
|
35
35
|
const FilterIcon_1 = require("../../icons/FilterIcon/FilterIcon");
|
|
36
36
|
const CounterTag_1 = require("../../components/Tags/CounterTag");
|
|
37
|
-
function
|
|
37
|
+
function CatalogClassicActions(props) {
|
|
38
38
|
const { onOpenFilter, filterTerm, filters } = props;
|
|
39
39
|
let activeFilters = filterTerm.trim().length > 0 ? 1 : 0;
|
|
40
40
|
for (const filter of filters) {
|
|
@@ -45,27 +45,27 @@ function CatalogLegacyActions(props) {
|
|
|
45
45
|
activeFilters++;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
const { useTranslate,
|
|
48
|
+
const { useTranslate, useOtelTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
49
49
|
const { translate } = useTranslate();
|
|
50
|
-
const
|
|
51
|
-
return (React.createElement(CatalogActionsWrapper, { "data-component-name": "
|
|
50
|
+
const otelTelemetry = useOtelTelemetry();
|
|
51
|
+
return (React.createElement(CatalogActionsWrapper, { "data-component-name": "CatalogClassic/CatalogClassicActions" },
|
|
52
52
|
React.createElement(Button_1.Button, { variant: "ghost", size: "small", icon: React.createElement(FilterIcon_1.FilterIcon, null), iconPosition: "left", onClick: () => {
|
|
53
53
|
onOpenFilter();
|
|
54
|
-
|
|
54
|
+
otelTelemetry.send({ type: 'catalog_actions_button.clicked' });
|
|
55
55
|
}, "data-translation-key": "catalog.filters.title" }, translate('catalog.filters.title', 'Filters')),
|
|
56
56
|
activeFilters > 0 ? React.createElement(CounterTag_1.CounterTag, { borderless: true }, activeFilters) : null));
|
|
57
57
|
}
|
|
58
58
|
const CatalogActionsWrapper = styled_components_1.default.div `
|
|
59
59
|
display: flex;
|
|
60
60
|
align-items: center;
|
|
61
|
-
gap: var(--catalog-
|
|
62
|
-
padding: var(--catalog-
|
|
63
|
-
var(--catalog-
|
|
64
|
-
min-height: var(--catalog-
|
|
65
|
-
background-color: var(--catalog-
|
|
61
|
+
gap: var(--catalog-classic-actions-gap);
|
|
62
|
+
padding: var(--catalog-classic-actions-padding-vertical)
|
|
63
|
+
var(--catalog-classic-actions-padding-horizontal);
|
|
64
|
+
min-height: var(--catalog-classic-actions-min-height);
|
|
65
|
+
background-color: var(--catalog-classic-actions-bg-color);
|
|
66
66
|
|
|
67
67
|
@media screen and (min-width: ${utils_1.breakpoints.medium}) {
|
|
68
68
|
display: none;
|
|
69
69
|
}
|
|
70
70
|
`;
|
|
71
|
-
//# sourceMappingURL=
|
|
71
|
+
//# sourceMappingURL=CatalogClassicActions.js.map
|
package/lib/components/{CatalogLegacy/CatalogLegacyCard.js → CatalogClassic/CatalogClassicCard.js}
RENAMED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.CatalogClassicCard = CatalogClassicCard;
|
|
30
30
|
const React = __importStar(require("react"));
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const utils_1 = require("../../core/utils");
|
|
@@ -34,26 +34,26 @@ const hooks_1 = require("../../core/hooks");
|
|
|
34
34
|
const ArrowRightIcon_1 = require("../../icons/ArrowRightIcon/ArrowRightIcon");
|
|
35
35
|
const Link_1 = require("../../components/Link/Link");
|
|
36
36
|
const Tag_1 = require("../../components/Tag/Tag");
|
|
37
|
-
const
|
|
37
|
+
const CatalogClassicHighlight_1 = require("../../components/CatalogClassic/CatalogClassicHighlight");
|
|
38
38
|
const Button_1 = require("../../components/Button/Button");
|
|
39
|
-
function
|
|
39
|
+
function CatalogClassicCard({ item }) {
|
|
40
40
|
var _a, _b;
|
|
41
|
-
const {
|
|
42
|
-
const
|
|
41
|
+
const { useOtelTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
42
|
+
const otelTelemetry = useOtelTelemetry();
|
|
43
43
|
return (React.createElement(Link_1.Link, { key: item.docsLink || item.link, to: item.docsLink || item.link },
|
|
44
|
-
React.createElement(StyledCard, { "data-component-name": "
|
|
44
|
+
React.createElement(StyledCard, { "data-component-name": "CatalogClassic/CatalogClassicCard", onClick: () => otelTelemetry.send({ type: 'catalog_item.clicked' }) },
|
|
45
45
|
React.createElement(CardContent, null,
|
|
46
46
|
React.createElement(CardTitleWrapper, null,
|
|
47
47
|
React.createElement(CardTitle, null,
|
|
48
|
-
React.createElement(
|
|
48
|
+
React.createElement(CatalogClassicHighlight_1.CatalogClassicHighlight, null, item.title))),
|
|
49
49
|
React.createElement(CardDescription, null,
|
|
50
|
-
React.createElement(
|
|
50
|
+
React.createElement(CatalogClassicHighlight_1.CatalogClassicHighlight, null, (_b = (_a = item.summary) !== null && _a !== void 0 ? _a : item.description) !== null && _b !== void 0 ? _b : ''))),
|
|
51
51
|
React.createElement(CardFooter, null,
|
|
52
52
|
React.createElement(CardTags, null,
|
|
53
53
|
(item.tags || []).map((tag, index) => (React.createElement(CardTag, { key: tag + index, color: (0, utils_1.slug)(tag) },
|
|
54
|
-
React.createElement(
|
|
54
|
+
React.createElement(CatalogClassicHighlight_1.CatalogClassicHighlight, null, (0, utils_1.capitalize)(tag))))),
|
|
55
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)})` },
|
|
56
|
-
React.createElement(
|
|
56
|
+
React.createElement(CatalogClassicHighlight_1.CatalogClassicHighlight, null, item.scorecardLevel)))) ||
|
|
57
57
|
null),
|
|
58
58
|
React.createElement(SelectButton, { size: "medium", variant: "secondary", icon: React.createElement(ArrowRightIcon_1.ArrowRightIcon, null) })))));
|
|
59
59
|
}
|
|
@@ -62,20 +62,21 @@ const SelectButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
|
62
62
|
transition: all 0.2s ease-in-out;
|
|
63
63
|
`;
|
|
64
64
|
const StyledCard = styled_components_1.default.div `
|
|
65
|
-
min-height: var(--catalog-
|
|
65
|
+
min-height: var(--catalog-classic-card-min-height);
|
|
66
66
|
height: 100%;
|
|
67
|
-
color: var(--catalog-
|
|
68
|
-
font-size: var(--catalog-
|
|
69
|
-
font-weight: var(--catalog-
|
|
70
|
-
background-color: var(--catalog-
|
|
71
|
-
border: var(--catalog-
|
|
72
|
-
var(--catalog-
|
|
67
|
+
color: var(--catalog-classic-card-text-color);
|
|
68
|
+
font-size: var(--catalog-classic-card-font-size);
|
|
69
|
+
font-weight: var(--catalog-classic-card-font-weight);
|
|
70
|
+
background-color: var(--catalog-classic-card-bg-color);
|
|
71
|
+
border: var(--catalog-classic-card-border-width) var(--catalog-classic-card-border-style)
|
|
72
|
+
var(--catalog-classic-card-border-color);
|
|
73
73
|
transition: all 0.2s ease-in-out;
|
|
74
|
-
border-radius: var(--catalog-
|
|
74
|
+
border-radius: var(--catalog-classic-card-border-radius);
|
|
75
75
|
cursor: pointer;
|
|
76
76
|
display: flex;
|
|
77
|
-
gap: var(--catalog-
|
|
78
|
-
padding: var(--catalog-
|
|
77
|
+
gap: var(--catalog-classic-card-gap);
|
|
78
|
+
padding: var(--catalog-classic-card-padding-vertical)
|
|
79
|
+
var(--catalog-classic-card-padding-horizontal);
|
|
79
80
|
flex-direction: column;
|
|
80
81
|
|
|
81
82
|
&:hover ${SelectButton} {
|
|
@@ -85,37 +86,37 @@ const StyledCard = styled_components_1.default.div `
|
|
|
85
86
|
const CardTitleWrapper = styled_components_1.default.div `
|
|
86
87
|
display: flex;
|
|
87
88
|
align-items: center;
|
|
88
|
-
min-height: var(--catalog-
|
|
89
|
+
min-height: var(--catalog-classic-card-title-min-height);
|
|
89
90
|
`;
|
|
90
91
|
const CardTitle = styled_components_1.default.div `
|
|
91
92
|
display: -webkit-box;
|
|
92
|
-
-webkit-line-clamp: var(--catalog-
|
|
93
|
+
-webkit-line-clamp: var(--catalog-classic-card-title-line-clamp);
|
|
93
94
|
-webkit-box-orient: vertical;
|
|
94
95
|
overflow: hidden;
|
|
95
96
|
text-overflow: ellipsis;
|
|
96
97
|
|
|
97
|
-
color: var(--catalog-
|
|
98
|
-
font-size: var(--catalog-
|
|
99
|
-
font-weight: var(--catalog-
|
|
100
|
-
line-height: var(--catalog-
|
|
98
|
+
color: var(--catalog-classic-card-title-color);
|
|
99
|
+
font-size: var(--catalog-classic-card-title-font-size);
|
|
100
|
+
font-weight: var(--catalog-classic-card-title-font-weight);
|
|
101
|
+
line-height: var(--catalog-classic-card-title-line-height);
|
|
101
102
|
margin: 0;
|
|
102
103
|
`;
|
|
103
104
|
const CardDescription = styled_components_1.default.div `
|
|
104
105
|
display: -webkit-box;
|
|
105
|
-
-webkit-line-clamp: var(--catalog-
|
|
106
|
+
-webkit-line-clamp: var(--catalog-classic-card-description-line-clamp);
|
|
106
107
|
-webkit-box-orient: vertical;
|
|
107
108
|
overflow: hidden;
|
|
108
109
|
text-overflow: ellipsis;
|
|
109
|
-
color: var(--catalog-
|
|
110
|
-
font-size: var(--catalog-
|
|
111
|
-
font-weight: var(--catalog-
|
|
112
|
-
line-height: var(--catalog-
|
|
113
|
-
height: var(--catalog-
|
|
110
|
+
color: var(--catalog-classic-card-description-color);
|
|
111
|
+
font-size: var(--catalog-classic-card-description-font-size);
|
|
112
|
+
font-weight: var(--catalog-classic-card-description-font-weight);
|
|
113
|
+
line-height: var(--catalog-classic-card-description-line-height);
|
|
114
|
+
height: var(--catalog-classic-card-description-height);
|
|
114
115
|
`;
|
|
115
116
|
const CardContent = styled_components_1.default.div `
|
|
116
117
|
flex: 1;
|
|
117
118
|
display: flex;
|
|
118
|
-
gap: var(--catalog-
|
|
119
|
+
gap: var(--catalog-classic-card-content-gap);
|
|
119
120
|
flex-direction: column;
|
|
120
121
|
`;
|
|
121
122
|
const CardFooter = styled_components_1.default.div `
|
|
@@ -133,6 +134,6 @@ const CardTags = styled_components_1.default.div `
|
|
|
133
134
|
const CardTag = (0, styled_components_1.default)(Tag_1.Tag) `
|
|
134
135
|
text-transform: inherit;
|
|
135
136
|
margin: 0;
|
|
136
|
-
background-color: var(--catalog-
|
|
137
|
+
background-color: var(--catalog-classic-card-tag-bg);
|
|
137
138
|
`;
|
|
138
|
-
//# sourceMappingURL=
|
|
139
|
+
//# sourceMappingURL=CatalogClassicCard.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { JSX } from 'react';
|
|
3
|
+
export declare const HighlightContext: React.Context<string[]>;
|
|
4
|
+
export type CatalogClassicHighlightProps = React.PropsWithChildren;
|
|
5
|
+
export declare function CatalogClassicHighlight(props: CatalogClassicHighlightProps): JSX.Element | null;
|
|
@@ -27,12 +27,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.HighlightContext = void 0;
|
|
30
|
-
exports.
|
|
30
|
+
exports.CatalogClassicHighlight = CatalogClassicHighlight;
|
|
31
31
|
const React = __importStar(require("react"));
|
|
32
32
|
const highlight_words_core_1 = require("highlight-words-core");
|
|
33
33
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
34
34
|
exports.HighlightContext = React.createContext([]);
|
|
35
|
-
function
|
|
35
|
+
function CatalogClassicHighlight(props) {
|
|
36
36
|
const { children } = props;
|
|
37
37
|
const searchWords = React.useContext(exports.HighlightContext);
|
|
38
38
|
if (!searchWords.length) {
|
|
@@ -43,7 +43,7 @@ function CatalogLegacyHighlight(props) {
|
|
|
43
43
|
searchWords,
|
|
44
44
|
textToHighlight: str,
|
|
45
45
|
});
|
|
46
|
-
return (React.createElement("span", { "data-component-name": "
|
|
46
|
+
return (React.createElement("span", { "data-component-name": "CatalogClassic/CatalogClassicHighlight", key: childIdx }, chunks.map((chunk, idx) => {
|
|
47
47
|
const { end, highlight, start } = chunk;
|
|
48
48
|
const text = str.substr(start, end - start);
|
|
49
49
|
if (highlight) {
|
|
@@ -68,4 +68,4 @@ const HighlightedText = styled_components_1.default.span `
|
|
|
68
68
|
background-color: var(--search-highlight-bg-color);
|
|
69
69
|
color: var(--search-highlight-text-color);
|
|
70
70
|
`;
|
|
71
|
-
//# sourceMappingURL=
|
|
71
|
+
//# sourceMappingURL=CatalogClassicHighlight.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
|
-
export type
|
|
2
|
+
export type CatalogClassicInfoBlockProps = {
|
|
3
3
|
metadata?: {
|
|
4
4
|
scorecardLevel?: string;
|
|
5
5
|
scoreCardSlug?: string;
|
|
@@ -8,4 +8,4 @@ export type CatalogLegacyInfoBlockProps = {
|
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function CatalogClassicInfoBlock(props: CatalogClassicInfoBlockProps): JSX.Element;
|
|
@@ -3,25 +3,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.CatalogClassicInfoBlock = CatalogClassicInfoBlock;
|
|
7
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 utils_1 = require("../../core/utils");
|
|
11
11
|
const Tag_1 = require("../../components/Tag/Tag");
|
|
12
12
|
const Link_1 = require("../../components/Link/Link");
|
|
13
|
-
function
|
|
13
|
+
function CatalogClassicInfoBlock(props) {
|
|
14
14
|
var _a, _b, _c, _d;
|
|
15
15
|
const scorecardBadge = ((_a = props.metadata) === null || _a === void 0 ? void 0 : _a.scorecardLevel) ? (react_1.default.createElement(ScorecardBadge, { level: props.metadata.scorecardLevel, slug: (_b = props.metadata) === null || _b === void 0 ? void 0 : _b.scoreCardSlug, colorVariable: (0, utils_1.getScorecardColorVariable)(((_c = props.metadata) === null || _c === void 0 ? void 0 : _c.scorecardLevelIdx) || 0, Object.keys(((_d = props.metadata) === null || _d === void 0 ? void 0 : _d.scorecardLevels) || {}).length) })) : null;
|
|
16
16
|
return (react_1.default.createElement(CatalogInfoBlockWrapper, null,
|
|
17
|
-
react_1.default.createElement(CatalogBadgesWrapper, { "data-component-name": "
|
|
17
|
+
react_1.default.createElement(CatalogBadgesWrapper, { "data-component-name": "CatalogClassic/CatalogClassicInfoBlock" }, scorecardBadge)));
|
|
18
18
|
}
|
|
19
19
|
function ScorecardBadge(props) {
|
|
20
20
|
const { level, slug, colorVariable } = props;
|
|
21
|
-
const {
|
|
22
|
-
const
|
|
21
|
+
const { useOtelTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
22
|
+
const otelTelemetry = useOtelTelemetry();
|
|
23
23
|
return (react_1.default.createElement(Link_1.Link, { to: slug },
|
|
24
|
-
react_1.default.createElement(Tag_1.Tag, { onClick: () =>
|
|
24
|
+
react_1.default.createElement(Tag_1.Tag, { onClick: () => otelTelemetry.send({ type: 'scorecard_link.clicked', payload: { action: 'click' } }), withStatusDot: true, statusDotColor: `var(${colorVariable})` }, level)));
|
|
25
25
|
}
|
|
26
26
|
const CatalogInfoBlockWrapper = styled_components_1.default.div `
|
|
27
27
|
position: relative;
|
|
@@ -37,11 +37,11 @@ const CatalogBadgesWrapper = styled_components_1.default.div `
|
|
|
37
37
|
right: 0;
|
|
38
38
|
margin-top: var(--panel-gap-vertical);
|
|
39
39
|
|
|
40
|
-
--badge-border-radius: var(--catalog-
|
|
41
|
-
--badge-padding: var(--catalog-
|
|
42
|
-
--badge-font-size: var(--catalog-
|
|
43
|
-
--badge-line-height: var(--catalog-
|
|
44
|
-
--badge-dot-size: var(--catalog-
|
|
45
|
-
--badge-dot-border-color: var(--catalog-
|
|
40
|
+
--badge-border-radius: var(--catalog-classic-page-badge-border-radius);
|
|
41
|
+
--badge-padding: var(--catalog-classic-page-badge-padding);
|
|
42
|
+
--badge-font-size: var(--catalog-classic-page-badge-font-size);
|
|
43
|
+
--badge-line-height: var(--catalog-classic-page-badge-line-height);
|
|
44
|
+
--badge-dot-size: var(--catalog-classic-page-badge-dot-size);
|
|
45
|
+
--badge-dot-border-color: var(--catalog-classic-page-badge-dot-border-color);
|
|
46
46
|
`;
|
|
47
|
-
//# sourceMappingURL=
|
|
47
|
+
//# sourceMappingURL=CatalogClassicInfoBlock.js.map
|
|
@@ -15,11 +15,11 @@ export type VirtualRowData = {
|
|
|
15
15
|
items: CatalogItem[];
|
|
16
16
|
key: string;
|
|
17
17
|
};
|
|
18
|
-
export type
|
|
18
|
+
export type CatalogClassicVirtualizedGroupsProps = {
|
|
19
19
|
groups: Group[];
|
|
20
20
|
filters: (ResolvedFilter & {
|
|
21
21
|
isFilterUsed?: boolean;
|
|
22
22
|
})[];
|
|
23
23
|
filterTerm: string;
|
|
24
24
|
};
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function CatalogClassicVirtualizedGroups({ groups, filters, filterTerm, }: CatalogClassicVirtualizedGroupsProps): React.JSX.Element;
|