@redocly/theme 0.54.0-next.2 → 0.54.0-next.3
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/{Catalog/Catalog.d.ts → CatalogLegacy/CatalogLegacy.d.ts} +2 -2
- package/lib/components/{Catalog/Catalog.js → CatalogLegacy/CatalogLegacy.js} +23 -23
- package/lib/components/{Catalog/CatalogActions.d.ts → CatalogLegacy/CatalogLegacyActions.d.ts} +2 -2
- package/lib/components/{Catalog/CatalogActions.js → CatalogLegacy/CatalogLegacyActions.js} +9 -8
- package/lib/components/CatalogLegacy/CatalogLegacyCard.d.ts +5 -0
- package/lib/components/{Catalog/CatalogCard.js → CatalogLegacy/CatalogLegacyCard.js} +33 -33
- package/lib/components/CatalogLegacy/CatalogLegacyHighlight.d.ts +4 -0
- package/lib/components/{Catalog/CatalogHighlight.js → CatalogLegacy/CatalogLegacyHighlight.js} +4 -4
- package/lib/components/{Catalog/CatalogInfoBlock.d.ts → CatalogLegacy/CatalogLegacyInfoBlock.d.ts} +2 -2
- package/lib/components/{Catalog/CatalogInfoBlock.js → CatalogLegacy/CatalogLegacyInfoBlock.js} +10 -10
- package/lib/components/{Catalog/CatalogVirtualizedGroups.d.ts → CatalogLegacy/CatalogLegacyVirtualizedGroups.d.ts} +2 -2
- package/lib/components/{Catalog/CatalogVirtualizedGroups.js → CatalogLegacy/CatalogLegacyVirtualizedGroups.js} +23 -23
- package/lib/components/CatalogLegacy/variables.js +109 -0
- package/lib/components/Menu/MenuItem.js +4 -1
- package/lib/components/Search/SearchDialog.js +2 -1
- package/lib/components/Search/variables.js +2 -0
- package/lib/components/Tag/variables.dark.js +9 -9
- package/lib/components/Tag/variables.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/styles/global.js +1 -1
- package/lib/core/types/hooks.d.ts +2 -1
- package/lib/icons/AiStarsGradientIcon/AiStarsGradientIcon.d.ts +11 -0
- package/lib/icons/AiStarsGradientIcon/AiStarsGradientIcon.js +58 -0
- package/lib/icons/AiStarsIcon/AiStarsIcon.d.ts +0 -1
- package/lib/icons/AiStarsIcon/AiStarsIcon.js +12 -20
- package/lib/icons/RabbitMQIcon/RabbitMQIcon.d.ts +9 -0
- package/lib/icons/RabbitMQIcon/RabbitMQIcon.js +26 -0
- package/lib/index.d.ts +9 -6
- package/lib/index.js +9 -6
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +5 -0
- package/package.json +3 -3
- package/src/components/{Catalog/Catalog.tsx → CatalogLegacy/CatalogLegacy.tsx} +28 -21
- package/src/components/{Catalog/CatalogActions.tsx → CatalogLegacy/CatalogLegacyActions.tsx} +8 -7
- package/src/components/{Catalog/CatalogCard.tsx → CatalogLegacy/CatalogLegacyCard.tsx} +34 -32
- package/src/components/{Catalog/CatalogHighlight.tsx → CatalogLegacy/CatalogLegacyHighlight.tsx} +3 -3
- package/src/components/{Catalog/CatalogInfoBlock.tsx → CatalogLegacy/CatalogLegacyInfoBlock.tsx} +9 -9
- package/src/components/{Catalog/CatalogVirtualizedGroups.tsx → CatalogLegacy/CatalogLegacyVirtualizedGroups.tsx} +23 -23
- package/src/components/CatalogLegacy/variables.ts +106 -0
- package/src/components/Menu/MenuItem.tsx +5 -1
- package/src/components/Search/SearchDialog.tsx +2 -1
- package/src/components/Search/variables.ts +2 -0
- package/src/components/Tag/variables.dark.ts +9 -9
- package/src/components/Tag/variables.ts +3 -3
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -1
- package/src/core/styles/global.ts +1 -1
- package/src/core/types/hooks.ts +2 -1
- package/src/icons/AiStarsGradientIcon/AiStarsGradientIcon.tsx +69 -0
- package/src/icons/AiStarsIcon/AiStarsIcon.tsx +13 -24
- package/src/icons/RabbitMQIcon/RabbitMQIcon.tsx +40 -0
- package/src/index.ts +9 -6
- package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +5 -0
- package/lib/components/Catalog/CatalogCard.d.ts +0 -5
- package/lib/components/Catalog/CatalogHighlight.d.ts +0 -4
- package/lib/components/Catalog/variables.js +0 -109
- package/src/components/Catalog/variables.ts +0 -106
- /package/lib/components/{Catalog → CatalogLegacy}/variables.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { CatalogConfig } from '../../config';
|
|
2
|
-
export type
|
|
2
|
+
export type CatalogLegacyProps = {
|
|
3
3
|
pageProps: {
|
|
4
4
|
catalogId: string;
|
|
5
5
|
catalogConfig: CatalogConfig;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
export default function
|
|
8
|
+
export default function CatalogLegacy(props: CatalogLegacyProps): JSX.Element;
|
|
9
9
|
export declare const CatalogPageContent: import("styled-components").StyledComponent<"main", any, {}, never>;
|
|
10
10
|
export declare const CatalogTitle: import("styled-components").StyledComponent<"h2", any, {}, never>;
|
|
11
11
|
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 = CatalogLegacy;
|
|
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 CatalogLegacyHighlight_1 = require("../../components/CatalogLegacy/CatalogLegacyHighlight");
|
|
16
|
+
const CatalogLegacyActions_1 = require("../../components/CatalogLegacy/CatalogLegacyActions");
|
|
17
17
|
const Sidebar_1 = require("../../components/Sidebar/Sidebar");
|
|
18
|
-
const
|
|
19
|
-
function
|
|
18
|
+
const CatalogLegacyVirtualizedGroups_1 = require("../../components/CatalogLegacy/CatalogLegacyVirtualizedGroups");
|
|
19
|
+
function CatalogLegacy(props) {
|
|
20
20
|
const { catalogConfig } = props.pageProps;
|
|
21
|
-
const { useTranslate,
|
|
22
|
-
const { filterTerm, setFilterTerm, groups, filters } =
|
|
21
|
+
const { useTranslate, useCatalogLegacy } = (0, hooks_1.useThemeHooks)();
|
|
22
|
+
const { filterTerm, setFilterTerm, groups, filters } = useCatalogLegacy(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(CatalogLegacyHighlight_1.HighlightContext.Provider, { value: [filterTerm] },
|
|
27
|
+
react_1.default.createElement(exports.CatalogPageWrapper, { "data-component-name": "CatalogLegacy/CatalogLegacy", 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(CatalogLegacyActions_1.CatalogLegacyActions, { 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 Catalog(props) {
|
|
|
38
38
|
' ',
|
|
39
39
|
translate(catalogConfig.descriptionTranslationKey, catalogConfig.description),
|
|
40
40
|
' ')) : null),
|
|
41
|
-
react_1.default.createElement(
|
|
41
|
+
react_1.default.createElement(CatalogLegacyVirtualizedGroups_1.CatalogLegacyVirtualizedGroups, { 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-page-padding);
|
|
50
|
+
padding: var(--catalog-legacy-page-padding);
|
|
51
51
|
}
|
|
52
52
|
`;
|
|
53
53
|
exports.CatalogTitle = (0, styled_components_1.default)(H2_1.H2) `
|
|
54
|
-
color: var(--catalog-title-text-color);
|
|
55
|
-
font-weight: var(--catalog-title-font-weight);
|
|
56
|
-
font-size: var(--catalog-title-font-size);
|
|
57
|
-
margin: var(--catalog-title-margin);
|
|
54
|
+
color: var(--catalog-legacy-title-text-color);
|
|
55
|
+
font-weight: var(--catalog-legacy-title-font-weight);
|
|
56
|
+
font-size: var(--catalog-legacy-title-font-size);
|
|
57
|
+
margin: var(--catalog-legacy-title-margin);
|
|
58
58
|
`;
|
|
59
59
|
exports.CatalogDescription = styled_components_1.default.p `
|
|
60
|
-
color: var(--catalog-description-text-color);
|
|
61
|
-
font-weight: var(--catalog-description-font-weight);
|
|
62
|
-
font-size: var(--catalog-description-font-size);
|
|
63
|
-
margin: var(--catalog-description-margin);
|
|
60
|
+
color: var(--catalog-legacy-description-text-color);
|
|
61
|
+
font-weight: var(--catalog-legacy-description-font-weight);
|
|
62
|
+
font-size: var(--catalog-legacy-description-font-size);
|
|
63
|
+
margin: var(--catalog-legacy-description-margin);
|
|
64
64
|
`;
|
|
65
65
|
exports.CatalogPageWrapper = styled_components_1.default.div `
|
|
66
|
-
--sidebar-width: var(--catalog-sidebar-width, 285px);
|
|
66
|
+
--sidebar-width: var(--catalog-legacy-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-heading-margin);
|
|
98
|
+
margin: var(--catalog-legacy-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=CatalogLegacy.js.map
|
package/lib/components/{Catalog/CatalogActions.d.ts → CatalogLegacy/CatalogLegacyActions.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResolvedFilter } from '../../core/types';
|
|
2
|
-
export type
|
|
2
|
+
export type CatalogLegacyActionsProps = {
|
|
3
3
|
onOpenFilter: () => void;
|
|
4
4
|
filters: ResolvedFilter[];
|
|
5
5
|
filterTerm: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function CatalogLegacyActions(props: CatalogLegacyActionsProps): 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.CatalogLegacyActions = CatalogLegacyActions;
|
|
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 CatalogLegacyActions(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) {
|
|
@@ -48,7 +48,7 @@ function CatalogActions(props) {
|
|
|
48
48
|
const { useTranslate, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
49
49
|
const { translate } = useTranslate();
|
|
50
50
|
const telemetry = useTelemetry();
|
|
51
|
-
return (React.createElement(CatalogActionsWrapper, { "data-component-name": "
|
|
51
|
+
return (React.createElement(CatalogActionsWrapper, { "data-component-name": "CatalogLegacy/CatalogLegacyActions" },
|
|
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
|
telemetry.send('catalog_actions_button_clicked', {});
|
|
@@ -58,13 +58,14 @@ function CatalogActions(props) {
|
|
|
58
58
|
const CatalogActionsWrapper = styled_components_1.default.div `
|
|
59
59
|
display: flex;
|
|
60
60
|
align-items: center;
|
|
61
|
-
gap: var(--catalog-actions-gap);
|
|
62
|
-
padding: var(--catalog-actions-padding-vertical)
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
gap: var(--catalog-legacy-actions-gap);
|
|
62
|
+
padding: var(--catalog-legacy-actions-padding-vertical)
|
|
63
|
+
var(--catalog-legacy-actions-padding-horizontal);
|
|
64
|
+
min-height: var(--catalog-legacy-actions-min-height);
|
|
65
|
+
background-color: var(--catalog-legacy-actions-bg-color);
|
|
65
66
|
|
|
66
67
|
@media screen and (min-width: ${utils_1.breakpoints.medium}) {
|
|
67
68
|
display: none;
|
|
68
69
|
}
|
|
69
70
|
`;
|
|
70
|
-
//# sourceMappingURL=
|
|
71
|
+
//# sourceMappingURL=CatalogLegacyActions.js.map
|
|
@@ -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.CatalogLegacyCard = CatalogLegacyCard;
|
|
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 CatalogLegacyHighlight_1 = require("../../components/CatalogLegacy/CatalogLegacyHighlight");
|
|
38
38
|
const Button_1 = require("../../components/Button/Button");
|
|
39
|
-
function
|
|
39
|
+
function CatalogLegacyCard({ item }) {
|
|
40
40
|
var _a, _b;
|
|
41
41
|
const { useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
42
42
|
const telemetry = useTelemetry();
|
|
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": "CatalogLegacy/CatalogLegacyCard", onClick: () => telemetry.send('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(CatalogLegacyHighlight_1.CatalogLegacyHighlight, null, item.title))),
|
|
49
49
|
React.createElement(CardDescription, null,
|
|
50
|
-
React.createElement(
|
|
50
|
+
React.createElement(CatalogLegacyHighlight_1.CatalogLegacyHighlight, 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(CatalogLegacyHighlight_1.CatalogLegacyHighlight, 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(CatalogLegacyHighlight_1.CatalogLegacyHighlight, 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,20 @@ 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-card-min-height);
|
|
65
|
+
min-height: var(--catalog-legacy-card-min-height);
|
|
66
66
|
height: 100%;
|
|
67
|
-
color: var(--catalog-card-text-color);
|
|
68
|
-
font-size: var(--catalog-card-font-size);
|
|
69
|
-
font-weight: var(--catalog-card-font-weight);
|
|
70
|
-
background-color: var(--catalog-card-bg-color);
|
|
71
|
-
border: var(--catalog-card-border-width) var(--catalog-card-border-style)
|
|
72
|
-
var(--catalog-card-border-color);
|
|
67
|
+
color: var(--catalog-legacy-card-text-color);
|
|
68
|
+
font-size: var(--catalog-legacy-card-font-size);
|
|
69
|
+
font-weight: var(--catalog-legacy-card-font-weight);
|
|
70
|
+
background-color: var(--catalog-legacy-card-bg-color);
|
|
71
|
+
border: var(--catalog-legacy-card-border-width) var(--catalog-legacy-card-border-style)
|
|
72
|
+
var(--catalog-legacy-card-border-color);
|
|
73
73
|
transition: all 0.2s ease-in-out;
|
|
74
|
-
border-radius: var(--catalog-card-border-radius);
|
|
74
|
+
border-radius: var(--catalog-legacy-card-border-radius);
|
|
75
75
|
cursor: pointer;
|
|
76
76
|
display: flex;
|
|
77
|
-
gap: var(--catalog-card-gap);
|
|
78
|
-
padding: var(--catalog-card-padding-vertical) var(--catalog-card-padding-horizontal);
|
|
77
|
+
gap: var(--catalog-legacy-card-gap);
|
|
78
|
+
padding: var(--catalog-legacy-card-padding-vertical) var(--catalog-legacy-card-padding-horizontal);
|
|
79
79
|
flex-direction: column;
|
|
80
80
|
|
|
81
81
|
&:hover ${SelectButton} {
|
|
@@ -85,37 +85,37 @@ const StyledCard = styled_components_1.default.div `
|
|
|
85
85
|
const CardTitleWrapper = styled_components_1.default.div `
|
|
86
86
|
display: flex;
|
|
87
87
|
align-items: center;
|
|
88
|
-
min-height: var(--catalog-card-title-min-height);
|
|
88
|
+
min-height: var(--catalog-legacy-card-title-min-height);
|
|
89
89
|
`;
|
|
90
90
|
const CardTitle = styled_components_1.default.div `
|
|
91
91
|
display: -webkit-box;
|
|
92
|
-
-webkit-line-clamp: var(--catalog-card-title-line-clamp);
|
|
92
|
+
-webkit-line-clamp: var(--catalog-legacy-card-title-line-clamp);
|
|
93
93
|
-webkit-box-orient: vertical;
|
|
94
94
|
overflow: hidden;
|
|
95
95
|
text-overflow: ellipsis;
|
|
96
96
|
|
|
97
|
-
color: var(--catalog-card-title-color);
|
|
98
|
-
font-size: var(--catalog-card-title-font-size);
|
|
99
|
-
font-weight: var(--catalog-card-title-font-weight);
|
|
100
|
-
line-height: var(--catalog-card-title-line-height);
|
|
97
|
+
color: var(--catalog-legacy-card-title-color);
|
|
98
|
+
font-size: var(--catalog-legacy-card-title-font-size);
|
|
99
|
+
font-weight: var(--catalog-legacy-card-title-font-weight);
|
|
100
|
+
line-height: var(--catalog-legacy-card-title-line-height);
|
|
101
101
|
margin: 0;
|
|
102
102
|
`;
|
|
103
103
|
const CardDescription = styled_components_1.default.div `
|
|
104
104
|
display: -webkit-box;
|
|
105
|
-
-webkit-line-clamp: var(--catalog-card-description-line-clamp);
|
|
105
|
+
-webkit-line-clamp: var(--catalog-legacy-card-description-line-clamp);
|
|
106
106
|
-webkit-box-orient: vertical;
|
|
107
107
|
overflow: hidden;
|
|
108
108
|
text-overflow: ellipsis;
|
|
109
|
-
color: var(--catalog-card-description-color);
|
|
110
|
-
font-size: var(--catalog-card-description-font-size);
|
|
111
|
-
font-weight: var(--catalog-card-description-font-weight);
|
|
112
|
-
line-height: var(--catalog-card-description-line-height);
|
|
113
|
-
height: var(--catalog-card-description-height);
|
|
109
|
+
color: var(--catalog-legacy-card-description-color);
|
|
110
|
+
font-size: var(--catalog-legacy-card-description-font-size);
|
|
111
|
+
font-weight: var(--catalog-legacy-card-description-font-weight);
|
|
112
|
+
line-height: var(--catalog-legacy-card-description-line-height);
|
|
113
|
+
height: var(--catalog-legacy-card-description-height);
|
|
114
114
|
`;
|
|
115
115
|
const CardContent = styled_components_1.default.div `
|
|
116
116
|
flex: 1;
|
|
117
117
|
display: flex;
|
|
118
|
-
gap: var(--catalog-card-content-gap);
|
|
118
|
+
gap: var(--catalog-legacy-card-content-gap);
|
|
119
119
|
flex-direction: column;
|
|
120
120
|
`;
|
|
121
121
|
const CardFooter = styled_components_1.default.div `
|
|
@@ -133,6 +133,6 @@ const CardTags = styled_components_1.default.div `
|
|
|
133
133
|
const CardTag = (0, styled_components_1.default)(Tag_1.Tag) `
|
|
134
134
|
text-transform: inherit;
|
|
135
135
|
margin: 0;
|
|
136
|
-
background-color: var(--catalog-card-tag-bg);
|
|
136
|
+
background-color: var(--catalog-legacy-card-tag-bg);
|
|
137
137
|
`;
|
|
138
|
-
//# sourceMappingURL=
|
|
138
|
+
//# sourceMappingURL=CatalogLegacyCard.js.map
|
package/lib/components/{Catalog/CatalogHighlight.js → CatalogLegacy/CatalogLegacyHighlight.js}
RENAMED
|
@@ -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.CatalogLegacyHighlight = CatalogLegacyHighlight;
|
|
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 CatalogLegacyHighlight(props) {
|
|
36
36
|
const { children } = props;
|
|
37
37
|
const searchWords = React.useContext(exports.HighlightContext);
|
|
38
38
|
if (!searchWords.length) {
|
|
@@ -43,7 +43,7 @@ function CatalogHighlight(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": "CatalogLegacy/CatalogLegacyHighlight", 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=CatalogLegacyHighlight.js.map
|
package/lib/components/{Catalog/CatalogInfoBlock.d.ts → CatalogLegacy/CatalogLegacyInfoBlock.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type CatalogLegacyInfoBlockProps = {
|
|
2
2
|
metadata?: {
|
|
3
3
|
scorecardLevel?: string;
|
|
4
4
|
scoreCardSlug?: string;
|
|
@@ -7,4 +7,4 @@ export type CatalogInfoBlockProps = {
|
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function CatalogLegacyInfoBlock(props: CatalogLegacyInfoBlockProps): JSX.Element;
|
package/lib/components/{Catalog/CatalogInfoBlock.js → CatalogLegacy/CatalogLegacyInfoBlock.js}
RENAMED
|
@@ -3,18 +3,18 @@ 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.CatalogLegacyInfoBlock = CatalogLegacyInfoBlock;
|
|
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 CatalogLegacyInfoBlock(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": "CatalogLegacy/CatalogLegacyInfoBlock" }, scorecardBadge)));
|
|
18
18
|
}
|
|
19
19
|
function ScorecardBadge(props) {
|
|
20
20
|
const { level, slug, colorVariable } = props;
|
|
@@ -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-page-badge-border-radius);
|
|
41
|
-
--badge-padding: var(--catalog-page-badge-padding);
|
|
42
|
-
--badge-font-size: var(--catalog-page-badge-font-size);
|
|
43
|
-
--badge-line-height: var(--catalog-page-badge-line-height);
|
|
44
|
-
--badge-dot-size: var(--catalog-page-badge-dot-size);
|
|
45
|
-
--badge-dot-border-color: var(--catalog-page-badge-dot-border-color);
|
|
40
|
+
--badge-border-radius: var(--catalog-legacy-page-badge-border-radius);
|
|
41
|
+
--badge-padding: var(--catalog-legacy-page-badge-padding);
|
|
42
|
+
--badge-font-size: var(--catalog-legacy-page-badge-font-size);
|
|
43
|
+
--badge-line-height: var(--catalog-legacy-page-badge-line-height);
|
|
44
|
+
--badge-dot-size: var(--catalog-legacy-page-badge-dot-size);
|
|
45
|
+
--badge-dot-border-color: var(--catalog-legacy-page-badge-dot-border-color);
|
|
46
46
|
`;
|
|
47
|
-
//# sourceMappingURL=
|
|
47
|
+
//# sourceMappingURL=CatalogLegacyInfoBlock.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 CatalogLegacyVirtualizedGroupsProps = {
|
|
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 CatalogLegacyVirtualizedGroups({ groups, filters, filterTerm, }: CatalogLegacyVirtualizedGroupsProps): React.JSX.Element;
|
|
@@ -26,19 +26,19 @@ 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.CatalogLegacyVirtualizedGroups = CatalogLegacyVirtualizedGroups;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
31
|
const react_virtual_1 = require("@tanstack/react-virtual");
|
|
32
32
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
33
33
|
const hooks_1 = require("../../core/hooks");
|
|
34
|
-
const
|
|
34
|
+
const CatalogLegacyCard_1 = require("../../components/CatalogLegacy/CatalogLegacyCard");
|
|
35
35
|
const CounterTag_1 = require("../../components/Tags/CounterTag");
|
|
36
36
|
const SpinnerLoader_1 = require("../../components/Loaders/SpinnerLoader");
|
|
37
37
|
const GAP_SIZE = 32;
|
|
38
38
|
const ESTIMATED_HEADER_HEIGHT = 43;
|
|
39
39
|
const ESTIMATED_CARD_HEIGHT = 194 + GAP_SIZE;
|
|
40
|
-
const CARD_MIN_WIDTH_VAR = '--catalog-card-min-width';
|
|
41
|
-
function
|
|
40
|
+
const CARD_MIN_WIDTH_VAR = '--catalog-legacy-card-min-width';
|
|
41
|
+
function CatalogLegacyVirtualizedGroups({ groups, filters, filterTerm, }) {
|
|
42
42
|
const [isClient, setIsClient] = (0, react_1.useState)(false);
|
|
43
43
|
const [size, parentRef] = (0, hooks_1.useElementSize)({ delay: 50, detectSizes: 'width' });
|
|
44
44
|
(0, react_1.useEffect)(() => {
|
|
@@ -107,7 +107,7 @@ function CatalogVirtualizedGroups({ groups, filters, filterTerm, }) {
|
|
|
107
107
|
overscan: 5,
|
|
108
108
|
});
|
|
109
109
|
if (!isClient) {
|
|
110
|
-
return (react_1.default.createElement("div", { ref: parentRef, "data-component-name": "
|
|
110
|
+
return (react_1.default.createElement("div", { ref: parentRef, "data-component-name": "CatalogLegacy/CatalogLegacyVirtualizedGroups" },
|
|
111
111
|
flatRows.slice(0, 15).map((rowData) => {
|
|
112
112
|
if (rowData.type === 'header') {
|
|
113
113
|
return (react_1.default.createElement(SSRHeaderRow, { key: rowData.key },
|
|
@@ -115,12 +115,12 @@ function CatalogVirtualizedGroups({ groups, filters, filterTerm, }) {
|
|
|
115
115
|
react_1.default.createElement(CounterTag_1.CounterTag, { borderless: true }, rowData.groupCount)));
|
|
116
116
|
}
|
|
117
117
|
return (react_1.default.createElement(SSRRow, { key: rowData.key }, rowData.items.map((item) => (react_1.default.createElement(CardWrapper, { key: item.link },
|
|
118
|
-
react_1.default.createElement(
|
|
118
|
+
react_1.default.createElement(CatalogLegacyCard_1.CatalogLegacyCard, { item: item }))))));
|
|
119
119
|
}),
|
|
120
120
|
react_1.default.createElement(LoadingWrapper, null,
|
|
121
|
-
react_1.default.createElement(SpinnerLoader_1.SpinnerLoader, { color: "var(--catalog-description-text-color)", size: "20px" }))));
|
|
121
|
+
react_1.default.createElement(SpinnerLoader_1.SpinnerLoader, { color: "var(--catalog-legacy-description-text-color)", size: "20px" }))));
|
|
122
122
|
}
|
|
123
|
-
return (react_1.default.createElement("div", { ref: parentRef, "data-component-name": "
|
|
123
|
+
return (react_1.default.createElement("div", { ref: parentRef, "data-component-name": "CatalogLegacy/CatalogLegacyVirtualizedGroups" },
|
|
124
124
|
react_1.default.createElement("div", { style: {
|
|
125
125
|
position: 'relative',
|
|
126
126
|
height: `${virtualizer.getTotalSize()}px`,
|
|
@@ -131,26 +131,26 @@ function CatalogVirtualizedGroups({ groups, filters, filterTerm, }) {
|
|
|
131
131
|
react_1.default.createElement(CatalogSeparatorLabel, null, rowData.groupTitle),
|
|
132
132
|
react_1.default.createElement(CounterTag_1.CounterTag, { borderless: true }, rowData.groupCount)));
|
|
133
133
|
}
|
|
134
|
-
return (react_1.default.createElement(GridRow, { key: rowData.key, ref: virtualizer.measureElement, "data-index": virtualRow.index, style: { transform: `translateY(${virtualRow.start}px)` } }, rowData.items.map((item) => (react_1.default.createElement(
|
|
134
|
+
return (react_1.default.createElement(GridRow, { key: rowData.key, ref: virtualizer.measureElement, "data-index": virtualRow.index, style: { transform: `translateY(${virtualRow.start}px)` } }, rowData.items.map((item) => (react_1.default.createElement(CatalogLegacyCard_1.CatalogLegacyCard, { key: item.link, item: item })))));
|
|
135
135
|
}))));
|
|
136
136
|
}
|
|
137
137
|
const SSRHeaderRow = styled_components_1.default.div `
|
|
138
138
|
width: 100%;
|
|
139
139
|
display: flex;
|
|
140
140
|
align-items: center;
|
|
141
|
-
padding: var(--catalog-separator-padding);
|
|
142
|
-
border-top: 1px solid var(--catalog-separator-border-color);
|
|
141
|
+
padding: var(--catalog-legacy-separator-padding);
|
|
142
|
+
border-top: 1px solid var(--catalog-legacy-separator-border-color);
|
|
143
143
|
padding-bottom: calc(4px * 4);
|
|
144
|
-
color: var(--catalog-separator-color);
|
|
145
|
-
font-size: var(--catalog-separator-font-size);
|
|
146
|
-
font-weight: var(--catalog-separator-font-weight);
|
|
144
|
+
color: var(--catalog-legacy-separator-color);
|
|
145
|
+
font-size: var(--catalog-legacy-separator-font-size);
|
|
146
|
+
font-weight: var(--catalog-legacy-separator-font-weight);
|
|
147
147
|
`;
|
|
148
148
|
const SSRRow = styled_components_1.default.div `
|
|
149
149
|
width: 100%;
|
|
150
150
|
display: flex;
|
|
151
151
|
flex-wrap: wrap;
|
|
152
|
-
gap: var(--catalog-cards-group-gap, 32px);
|
|
153
|
-
padding-bottom: var(--catalog-cards-group-gap, 32px);
|
|
152
|
+
gap: var(--catalog-legacy-cards-group-gap, 32px);
|
|
153
|
+
padding-bottom: var(--catalog-legacy-cards-group-gap, 32px);
|
|
154
154
|
`;
|
|
155
155
|
const HeaderRow = (0, styled_components_1.default)(SSRHeaderRow) `
|
|
156
156
|
position: absolute;
|
|
@@ -162,22 +162,22 @@ const GridRow = styled_components_1.default.div `
|
|
|
162
162
|
left: 0;
|
|
163
163
|
width: 100%;
|
|
164
164
|
display: grid;
|
|
165
|
-
grid-template-columns: repeat(auto-fill, minmax(var(--catalog-card-min-width), 1fr));
|
|
166
|
-
gap: var(--catalog-cards-group-gap, 32px);
|
|
167
|
-
padding-bottom: var(--catalog-cards-group-gap, 32px);
|
|
165
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--catalog-legacy-card-min-width), 1fr));
|
|
166
|
+
gap: var(--catalog-legacy-cards-group-gap, 32px);
|
|
167
|
+
padding-bottom: var(--catalog-legacy-cards-group-gap, 32px);
|
|
168
168
|
will-change: transform;
|
|
169
169
|
`;
|
|
170
170
|
const CardWrapper = styled_components_1.default.div `
|
|
171
|
-
flex: 1 0 var(--catalog-card-min-width);
|
|
171
|
+
flex: 1 0 var(--catalog-legacy-card-min-width);
|
|
172
172
|
max-width: 100%;
|
|
173
|
-
min-width: var(--catalog-card-min-width);
|
|
173
|
+
min-width: var(--catalog-legacy-card-min-width);
|
|
174
174
|
`;
|
|
175
175
|
const CatalogSeparatorLabel = styled_components_1.default.div `
|
|
176
|
-
margin: var(--catalog-separator-label-margin);
|
|
176
|
+
margin: var(--catalog-legacy-separator-label-margin);
|
|
177
177
|
`;
|
|
178
178
|
const LoadingWrapper = styled_components_1.default.div `
|
|
179
179
|
display: flex;
|
|
180
180
|
justify-content: center;
|
|
181
181
|
align-items: center;
|
|
182
182
|
`;
|
|
183
|
-
//# sourceMappingURL=
|
|
183
|
+
//# sourceMappingURL=CatalogLegacyVirtualizedGroups.js.map
|