@redocly/theme 0.18.3-patch.2 → 0.18.3-patch.6
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/I18n/LanguagePicker.js +17 -10
- package/lib/I18n/styledVariables.js +1 -0
- package/lib/components/Breadcrumbs/Breadcrumb.js +0 -4
- package/lib/components/Breadcrumbs/Breadcrumbs.js +5 -1
- package/lib/components/Breadcrumbs/styledVariables.js +2 -1
- package/lib/components/Catalog/Catalog.d.ts +5 -0
- package/lib/components/Catalog/Catalog.js +18 -16
- package/lib/components/Catalog/CatalogCard.js +22 -5
- package/lib/components/CodeBlock/styledVariables.js +2 -2
- package/lib/components/Filter/Filter.d.ts +2 -1
- package/lib/components/Filter/Filter.js +15 -14
- package/lib/components/Filter/FilterContent.d.ts +2 -1
- package/lib/components/Filter/FilterContent.js +5 -4
- package/lib/components/Filter/FilterPopover.d.ts +3 -1
- package/lib/components/Filter/FilterPopover.js +4 -4
- package/lib/components/Filter/styledVariables.js +1 -1
- package/lib/components/Footer/Footer.js +2 -1
- package/lib/components/Footer/FooterColumn.js +2 -0
- package/lib/components/Footer/styledVariables.js +1 -1
- package/lib/components/LastUpdated/LastUpdated.js +1 -0
- package/lib/components/Markdown/Admonition.js +12 -9
- package/lib/components/Markdown/Mermaid.js +3 -0
- package/lib/components/Markdown/styledVariables.d.ts +1 -0
- package/lib/components/Markdown/styledVariables.js +17 -7
- package/lib/components/Panel/PanelHeader.js +1 -0
- package/lib/components/Panel/styledVariables.js +1 -1
- package/lib/components/Product/ProductPicker.js +17 -5
- package/lib/components/Select/Select.d.ts +13 -6
- package/lib/components/Select/Select.js +20 -15
- package/lib/components/Select/styledVariables.js +2 -1
- package/lib/components/Separator/SeparatorItem.js +1 -0
- package/lib/components/Sidebar/HeaderWrapper.js +2 -2
- package/lib/components/Sidebar/VersionPicker.d.ts +3 -3
- package/lib/components/Sidebar/VersionPicker.js +5 -4
- package/lib/components/Sidebar/styledVariables.js +5 -4
- package/lib/components/Tag/styledVariables.js +10 -9
- package/lib/components/Tiles/TileHeader.js +1 -1
- package/lib/config.d.ts +25 -2
- package/lib/config.js +12 -3
- package/lib/globalStyle.js +35 -33
- package/lib/hooks/useMobileMenu.js +5 -6
- package/lib/hooks/useModalScrollLock.d.ts +1 -0
- package/lib/hooks/useModalScrollLock.js +16 -0
- package/lib/icons/AlertIcon/AlertIcon.js +0 -5
- package/lib/types/portal/src/shared/types/catalog.d.ts +5 -1
- package/lib/ui/Highlight.d.ts +1 -1
- package/lib/ui/Highlight.js +1 -1
- package/lib/ui/darkColors.js +26 -26
- package/lib/utils/css-variables.js +1 -1
- package/package.json +1 -1
- package/src/I18n/LanguagePicker.tsx +23 -21
- package/src/I18n/styledVariables.ts +1 -0
- package/src/components/Breadcrumbs/Breadcrumb.tsx +0 -4
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +5 -1
- package/src/components/Breadcrumbs/styledVariables.ts +2 -1
- package/src/components/Catalog/Catalog.tsx +17 -10
- package/src/components/Catalog/CatalogCard.tsx +26 -3
- package/src/components/CodeBlock/styledVariables.ts +2 -2
- package/src/components/Filter/Filter.tsx +28 -26
- package/src/components/Filter/FilterContent.tsx +7 -4
- package/src/components/Filter/FilterPopover.tsx +13 -3
- package/src/components/Filter/styledVariables.ts +1 -1
- package/src/components/Footer/Footer.tsx +1 -1
- package/src/components/Footer/FooterColumn.tsx +2 -0
- package/src/components/Footer/styledVariables.ts +1 -1
- package/src/components/LastUpdated/LastUpdated.tsx +1 -2
- package/src/components/Markdown/Admonition.tsx +13 -8
- package/src/components/Markdown/Mermaid.tsx +3 -0
- package/src/components/Markdown/styledVariables.ts +18 -7
- package/src/components/Panel/PanelHeader.ts +1 -0
- package/src/components/Panel/styledVariables.ts +1 -1
- package/src/components/Product/ProductPicker.tsx +18 -13
- package/src/components/Select/Select.tsx +47 -26
- package/src/components/Select/styledVariables.ts +2 -1
- package/src/components/Separator/SeparatorItem.tsx +1 -0
- package/src/components/Sidebar/HeaderWrapper.tsx +2 -2
- package/src/components/Sidebar/VersionPicker.tsx +5 -4
- package/src/components/Sidebar/styledVariables.ts +5 -4
- package/src/components/Tag/styledVariables.ts +10 -9
- package/src/components/Tiles/TileHeader.ts +1 -1
- package/src/config.ts +11 -1
- package/src/globalStyle.ts +36 -34
- package/src/hooks/useMobileMenu.ts +3 -4
- package/src/hooks/useModalScrollLock.ts +12 -0
- package/src/icons/AlertIcon/AlertIcon.tsx +0 -5
- package/src/types/portal/src/shared/types/catalog.ts +7 -1
- package/src/ui/Highlight.tsx +2 -2
- package/src/ui/darkColors.tsx +26 -26
- package/src/utils/css-variables.ts +4 -2
package/lib/globalStyle.js
CHANGED
|
@@ -88,16 +88,16 @@ const themeColors = (0, styled_components_1.css) `
|
|
|
88
88
|
--color-purple-9: #22075e;
|
|
89
89
|
--color-purple-10: #120338;
|
|
90
90
|
|
|
91
|
-
--color-
|
|
92
|
-
--color-
|
|
93
|
-
--color-
|
|
94
|
-
--color-
|
|
95
|
-
--color-
|
|
96
|
-
--color-
|
|
97
|
-
--color-
|
|
98
|
-
--color-
|
|
99
|
-
--color-
|
|
100
|
-
--color-
|
|
91
|
+
--color-magenta-1: #fff0f6;
|
|
92
|
+
--color-magenta-2: #ffd6e7;
|
|
93
|
+
--color-magenta-3: #ffadd2;
|
|
94
|
+
--color-magenta-4: #ff85c0;
|
|
95
|
+
--color-magenta-5: #f759ab;
|
|
96
|
+
--color-magenta-6: #eb2f96;
|
|
97
|
+
--color-magenta-7: #c41d7f;
|
|
98
|
+
--color-magenta-8: #9e1068;
|
|
99
|
+
--color-magenta-9: #780650;
|
|
100
|
+
--color-magenta-10: #520339;
|
|
101
101
|
|
|
102
102
|
--color-cyan-1: #e6fffb;
|
|
103
103
|
--color-cyan-2: #b5f5ec;
|
|
@@ -154,16 +154,16 @@ const themeColors = (0, styled_components_1.css) `
|
|
|
154
154
|
--color-primary-text: #161087;
|
|
155
155
|
--color-primary-text-active: #0d086e;
|
|
156
156
|
|
|
157
|
-
--color-success-bg: var(--color-
|
|
158
|
-
--color-success-bg-hover: var(--color-
|
|
159
|
-
--color-success-border: var(--color-
|
|
160
|
-
--color-success-border-hover: var(--color-
|
|
161
|
-
--color-success-hover: var(--color-
|
|
162
|
-
--color-success-base: var(--color-
|
|
163
|
-
--color-success-active: var(--color-
|
|
164
|
-
--color-success-text-hover: var(--color-
|
|
165
|
-
--color-success-text: var(--color-
|
|
166
|
-
--color-success-text-active: var(--color-
|
|
157
|
+
--color-success-bg: var(--color-cyan-1);
|
|
158
|
+
--color-success-bg-hover: var(--color-cyan-2);
|
|
159
|
+
--color-success-border: var(--color-cyan-3);
|
|
160
|
+
--color-success-border-hover: var(--color-cyan-4);
|
|
161
|
+
--color-success-hover: var(--color-cyan-5);
|
|
162
|
+
--color-success-base: var(--color-cyan-6);
|
|
163
|
+
--color-success-active: var(--color-cyan-7);
|
|
164
|
+
--color-success-text-hover: var(--color-cyan-8);
|
|
165
|
+
--color-success-text: var(--color-cyan-9);
|
|
166
|
+
--color-success-text-active: var(--color-cyan-10);
|
|
167
167
|
|
|
168
168
|
--color-warning-bg: var(--color-gold-1);
|
|
169
169
|
--color-warning-bg-hover: var(--color-gold-2);
|
|
@@ -178,7 +178,7 @@ const themeColors = (0, styled_components_1.css) `
|
|
|
178
178
|
|
|
179
179
|
--color-error-bg: var(--color-red-1);
|
|
180
180
|
--color-error-bg-hover: var(--color-red-2);
|
|
181
|
-
--color-error-border: var(--color-red-
|
|
181
|
+
--color-error-border: var(--color-red-7);
|
|
182
182
|
--color-error-border-hover: var(--color-red-4);
|
|
183
183
|
--color-error-hover: var(--color-red-5);
|
|
184
184
|
--color-error-base: var(--color-red-6);
|
|
@@ -217,6 +217,7 @@ const themeColors = (0, styled_components_1.css) `
|
|
|
217
217
|
--bg-base: #ffffff; // The default elevation is the baseline with respect to all other layers.
|
|
218
218
|
--bg-sunken: #f1f1f1; // Sunken is the lowest elevation available.
|
|
219
219
|
--bg-raised: #fafafa; // Cards, elements, inputs
|
|
220
|
+
--bg-raised-light: #fafafa; // Always light
|
|
220
221
|
--bg-overlay: #f2f2f2; // Overlay is the highest elevation available. Use for hovers
|
|
221
222
|
--bg-modal-overlay: #f2f2f2c2; // Overlay is the highest elevation available. Use for hovers
|
|
222
223
|
|
|
@@ -267,13 +268,13 @@ const typography = (0, styled_components_1.css) `
|
|
|
267
268
|
* @presenter LineHeight
|
|
268
269
|
*/
|
|
269
270
|
|
|
270
|
-
--line-height-base:
|
|
271
|
-
--line-height-xsm:
|
|
272
|
-
--line-height-sm:
|
|
273
|
-
--line-height-md:
|
|
274
|
-
--line-height-lg:
|
|
275
|
-
--line-height-xlg:
|
|
276
|
-
--line-height-xxlg:
|
|
271
|
+
--line-height-base: 24px;
|
|
272
|
+
--line-height-xsm: 20px;
|
|
273
|
+
--line-height-sm: 22px;
|
|
274
|
+
--line-height-md: 26px;
|
|
275
|
+
--line-height-lg: 28px;
|
|
276
|
+
--line-height-xlg: 30px;
|
|
277
|
+
--line-height-xxlg: 32px;
|
|
277
278
|
|
|
278
279
|
/**
|
|
279
280
|
* @tokens Font Sizes
|
|
@@ -416,7 +417,7 @@ const headingsTypography = (0, styled_components_1.css) `
|
|
|
416
417
|
--h3-font-family: var(--heading-font-family); // @presenter FontFamily
|
|
417
418
|
--h3-font-weight: var(--heading-font-weight); // @presenter FontWeight
|
|
418
419
|
--h3-font-size: 18px; // @presenter FontSize
|
|
419
|
-
--h3-line-height:
|
|
420
|
+
--h3-line-height: 22px; // @presenter LineHeight
|
|
420
421
|
--h3-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
421
422
|
--h3-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
422
423
|
--h3-text-color: var(--heading-text-color); // @presenter Color
|
|
@@ -588,9 +589,9 @@ const apiReferenceDocs = (0, styled_components_1.css) `
|
|
|
588
589
|
* @presenter Color
|
|
589
590
|
*/
|
|
590
591
|
|
|
591
|
-
--schema-recursive-text-color: var(--color-warning); // @presenter Color
|
|
592
|
+
--schema-recursive-text-color: var(--color-warning-active); // @presenter Color
|
|
592
593
|
--schema-recursive-background-color: var(--color-warning-bg); // @presenter Color
|
|
593
|
-
--schema-recursive-border-color: var(--color-warning-
|
|
594
|
+
--schema-recursive-border-color: var(--color-warning-active); // @presenter Color
|
|
594
595
|
|
|
595
596
|
/**
|
|
596
597
|
* @tokens GraphQL Docs Reference Schema Non null label
|
|
@@ -695,9 +696,9 @@ const badges = (0, styled_components_1.css) `
|
|
|
695
696
|
* @tokens Deprecated Badge
|
|
696
697
|
*/
|
|
697
698
|
|
|
698
|
-
--badge-deprecated-text-color: var(--color-warning); // @presenter Color
|
|
699
|
+
--badge-deprecated-text-color: var(--color-warning-active); // @presenter Color
|
|
699
700
|
--badge-deprecated-background-color: var(--color-warning-bg); // @presenter Color
|
|
700
|
-
--badge-deprecated-border-color: var(--color-warning-
|
|
701
|
+
--badge-deprecated-border-color: var(--color-warning-active); // @presenter Color
|
|
701
702
|
--badge-deprecated-border: 1px solid var(--badge-deprecated-border-color); // @presenter Border
|
|
702
703
|
--badge-deprecated-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
703
704
|
|
|
@@ -934,6 +935,7 @@ exports.styles = (0, styled_components_1.css) `
|
|
|
934
935
|
${loadProgressBar}
|
|
935
936
|
${NavbarLogo_1.logo}
|
|
936
937
|
${Markdown_1.markdown}
|
|
938
|
+
${Markdown_1.mermaid}
|
|
937
939
|
${Menu_1.menu}
|
|
938
940
|
${Menu_1.mobileMenu}
|
|
939
941
|
${modal}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.useMobileMenu = void 0;
|
|
4
7
|
const react_1 = require("react");
|
|
5
8
|
const react_router_dom_1 = require("react-router-dom");
|
|
9
|
+
const useModalScrollLock_1 = __importDefault(require("../hooks/useModalScrollLock"));
|
|
6
10
|
function useMobileMenu(initialState = false) {
|
|
7
11
|
const location = (0, react_router_dom_1.useLocation)();
|
|
8
12
|
const [isOpen, setIsOpen] = (0, react_1.useState)(initialState);
|
|
9
13
|
(0, react_1.useEffect)(() => setIsOpen(false), [location.pathname, location.hash]);
|
|
10
|
-
(0,
|
|
11
|
-
if (isOpen)
|
|
12
|
-
document.body.classList.add('overflow-hidden');
|
|
13
|
-
else
|
|
14
|
-
document.body.classList.remove('overflow-hidden');
|
|
15
|
-
}, [isOpen]);
|
|
14
|
+
(0, useModalScrollLock_1.default)(isOpen);
|
|
16
15
|
return [isOpen, setIsOpen];
|
|
17
16
|
}
|
|
18
17
|
exports.useMobileMenu = useMobileMenu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useModalScrollLock(isOpen: boolean): () => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
function useModalScrollLock(isOpen) {
|
|
5
|
+
(0, react_1.useEffect)(() => {
|
|
6
|
+
if (isOpen)
|
|
7
|
+
document.body.classList.add('overflow-hidden');
|
|
8
|
+
else
|
|
9
|
+
document.body.classList.remove('overflow-hidden');
|
|
10
|
+
}, [isOpen]);
|
|
11
|
+
return () => {
|
|
12
|
+
document.body.classList.remove('overflow-hidden');
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.default = useModalScrollLock;
|
|
16
|
+
//# sourceMappingURL=useModalScrollLock.js.map
|
|
@@ -37,13 +37,8 @@ function Icon({ type, className }) {
|
|
|
37
37
|
exports.AlertIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
38
38
|
'data-component-name': 'icons/AlertIcon/AlertIcon',
|
|
39
39
|
})) `
|
|
40
|
-
position: absolute;
|
|
41
|
-
left: var(--admonition-padding-horizontal);
|
|
42
|
-
top: 50%;
|
|
43
|
-
transform: translateY(-50%);
|
|
44
40
|
width: var(--admonition-icon-size);
|
|
45
41
|
height: var(--admonition-icon-size);
|
|
46
|
-
margin-right: var(--admonition-padding-horizontal);
|
|
47
42
|
flex-shrink: 0;
|
|
48
43
|
|
|
49
44
|
fill: ${({ type }) => `var(--admonition-${type}-icon-color)`};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CatalogFilterConfig } from
|
|
1
|
+
import { CatalogFilterConfig, ScorecardStatus } from '../../../../../index.js';
|
|
2
2
|
export type FilteredCatalog = {
|
|
3
3
|
groups: {
|
|
4
4
|
title: string;
|
|
@@ -31,5 +31,9 @@ export type CatalogItem = {
|
|
|
31
31
|
description?: string;
|
|
32
32
|
image?: string;
|
|
33
33
|
docsLink?: string;
|
|
34
|
+
scorecardStatus?: ScorecardStatus;
|
|
35
|
+
scorecardLevel?: string;
|
|
36
|
+
scoreCardSlug?: string;
|
|
37
|
+
tags?: unknown[];
|
|
34
38
|
[k: string]: unknown;
|
|
35
39
|
};
|
package/lib/ui/Highlight.d.ts
CHANGED
package/lib/ui/Highlight.js
CHANGED
|
@@ -31,7 +31,7 @@ function Highlight(props) {
|
|
|
31
31
|
const { children } = props;
|
|
32
32
|
const searchWords = React.useContext(exports.HighlightContext);
|
|
33
33
|
if (!searchWords.length) {
|
|
34
|
-
return React.createElement(React.Fragment, null,
|
|
34
|
+
return children ? React.createElement(React.Fragment, null, children) : null;
|
|
35
35
|
}
|
|
36
36
|
function highlight(str, childIdx = 0) {
|
|
37
37
|
const chunks = (0, highlight_words_core_1.findAll)({
|
package/lib/ui/darkColors.js
CHANGED
|
@@ -65,16 +65,16 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
65
65
|
--color-purple-9: #cda8f0;
|
|
66
66
|
--color-purple-10: #ebd7fa;
|
|
67
67
|
|
|
68
|
-
--color-
|
|
69
|
-
--color-
|
|
70
|
-
--color-
|
|
71
|
-
--color-
|
|
72
|
-
--color-
|
|
73
|
-
--color-
|
|
74
|
-
--color-
|
|
75
|
-
--color-
|
|
76
|
-
--color-
|
|
77
|
-
--color-
|
|
68
|
+
--color-magenta-1: #291321;
|
|
69
|
+
--color-magenta-2: #40162f;
|
|
70
|
+
--color-magenta-3: #551c3b;
|
|
71
|
+
--color-magenta-4: #75204f;
|
|
72
|
+
--color-magenta-5: #a02669;
|
|
73
|
+
--color-magenta-6: #cb2b83;
|
|
74
|
+
--color-magenta-7: #e0529c;
|
|
75
|
+
--color-magenta-8: #f37fb7;
|
|
76
|
+
--color-magenta-9: #f8a8cc;
|
|
77
|
+
--color-magenta-10: #fad2e3;
|
|
78
78
|
|
|
79
79
|
--color-cyan-1: #112123;
|
|
80
80
|
--color-cyan-2: #113536;
|
|
@@ -131,35 +131,35 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
131
131
|
--color-primary-text: #d6dfff;
|
|
132
132
|
--color-primary-text-active: #ebf0ff;
|
|
133
133
|
|
|
134
|
-
--color-success-bg: var(--color-
|
|
135
|
-
--color-success-bg-hover: var(--color-
|
|
136
|
-
--color-success-border: var(--color-
|
|
137
|
-
--color-success-border-hover: var(--color-
|
|
138
|
-
--color-success-hover: var(--color-
|
|
139
|
-
--color-success-base: var(--color-
|
|
140
|
-
--color-success-active: var(--color-
|
|
141
|
-
--color-success-text-hover: var(--color-
|
|
142
|
-
--color-success-text: var(--color-
|
|
143
|
-
--color-success-text-active: var(--color-
|
|
144
|
-
|
|
145
|
-
--color-warning-bg: var(--color-gold-
|
|
134
|
+
--color-success-bg: var(--color-cyan-3);
|
|
135
|
+
--color-success-bg-hover: var(--color-cyan-2);
|
|
136
|
+
--color-success-border: var(--color-cyan-3);
|
|
137
|
+
--color-success-border-hover: var(--color-cyan-4);
|
|
138
|
+
--color-success-hover: var(--color-cyan-7);
|
|
139
|
+
--color-success-base: var(--color-cyan-6);
|
|
140
|
+
--color-success-active: var(--color-cyan-7);
|
|
141
|
+
--color-success-text-hover: var(--color-cyan-8);
|
|
142
|
+
--color-success-text: var(--color-cyan-9);
|
|
143
|
+
--color-success-text-active: var(--color-cyan-10);
|
|
144
|
+
|
|
145
|
+
--color-warning-bg: var(--color-gold-3);
|
|
146
146
|
--color-warning-bg-hover: var(--color-gold-2);
|
|
147
147
|
--color-warning-border: var(--color-gold-3);
|
|
148
148
|
--color-warning-border-hover: var(--color-gold-4);
|
|
149
149
|
--color-warning-hover: var(--color-gold-7);
|
|
150
150
|
--color-warning-base: var(--color-gold-6);
|
|
151
|
-
--color-warning-active: var(--color-gold-
|
|
151
|
+
--color-warning-active: var(--color-gold-7);
|
|
152
152
|
--color-warning-text-hover: var(--color-gold-8);
|
|
153
153
|
--color-warning-text: var(--color-gold-9);
|
|
154
154
|
--color-warning-text-active: var(--color-gold-10);
|
|
155
155
|
|
|
156
|
-
--color-error-bg: var(--color-red-
|
|
156
|
+
--color-error-bg: var(--color-red-3);
|
|
157
157
|
--color-error-bg-hover: var(--color-red-2);
|
|
158
158
|
--color-error-border: var(--color-red-3);
|
|
159
159
|
--color-error-border-hover: var(--color-red-4);
|
|
160
160
|
--color-error-hover: var(--color-red-7);
|
|
161
161
|
--color-error-base: var(--color-red-6);
|
|
162
|
-
--color-error-active: var(--color-red-
|
|
162
|
+
--color-error-active: var(--color-red-7);
|
|
163
163
|
--color-error-text-hover: var(--color-red-8);
|
|
164
164
|
--color-error-text: var(--color-red-9);
|
|
165
165
|
--color-error-text-active: var(--color-red-10);
|
|
@@ -170,7 +170,7 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
170
170
|
--color-info-border-hover: var(--color-blue-4);
|
|
171
171
|
--color-info-hover: var(--color-blue-7);
|
|
172
172
|
--color-info-base: var(--color-blue-6);
|
|
173
|
-
--color-info-active: var(--color-blue-
|
|
173
|
+
--color-info-active: var(--color-blue-7);
|
|
174
174
|
--color-info-text-hover: var(--color-blue-8);
|
|
175
175
|
--color-info-text: var(--color-blue-9);
|
|
176
176
|
--color-info-text-active: var(--color-blue-10);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCssColorVariable = void 0;
|
|
4
|
-
const getCssColorVariable = (color, defaultValue = '
|
|
4
|
+
const getCssColorVariable = (color, defaultValue = 'currentColor') => ((color === null || color === void 0 ? void 0 : color.startsWith('--')) ? `var(${color})` : color || defaultValue);
|
|
5
5
|
exports.getCssColorVariable = getCssColorVariable;
|
|
6
6
|
//# sourceMappingURL=css-variables.js.map
|
package/package.json
CHANGED
|
@@ -27,33 +27,31 @@ export const LanguagePicker = (props: LanguagePickerProps) => {
|
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const
|
|
31
|
-
const languageItems = locales.map((locale) => (
|
|
32
|
-
<LanguageItem
|
|
33
|
-
|
|
30
|
+
const value = locale.code;
|
|
31
|
+
const languageItems = locales.map((locale) => ({
|
|
32
|
+
element: <LanguageItem role="link">{locale.name || locale.code || ''}</LanguageItem>,
|
|
33
|
+
value: locale.code,
|
|
34
|
+
title: locale.name || locale.code || '',
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<LanguageSelect
|
|
39
|
+
value={value}
|
|
40
|
+
options={languageItems}
|
|
41
|
+
onChange={(value: string) => {
|
|
34
42
|
const newLangPathname = withPathPrefix(
|
|
35
|
-
getPathnameForLocale(location.pathname, defaultLocale,
|
|
43
|
+
getPathnameForLocale(location.pathname, defaultLocale, value, locales),
|
|
36
44
|
);
|
|
37
45
|
const newUrlWithLanguage = `${newLangPathname}${location.search}${location.hash}`;
|
|
38
46
|
history.push(newUrlWithLanguage);
|
|
39
|
-
props.onChangeLanguage(
|
|
47
|
+
props.onChangeLanguage(value);
|
|
40
48
|
}}
|
|
41
|
-
key={locale.code}
|
|
42
|
-
role="link"
|
|
43
|
-
>
|
|
44
|
-
{locale.name || locale.code || ''}
|
|
45
|
-
</LanguageItem>
|
|
46
|
-
));
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<LanguageSelect
|
|
50
|
-
selected={selected}
|
|
51
|
-
options={languageItems}
|
|
52
49
|
triggerEvent="hover"
|
|
53
50
|
placement={props.placement}
|
|
54
51
|
alignment={props.alignment}
|
|
55
52
|
icon={<LanguageIcon />}
|
|
56
53
|
onlyIcon={props.onlyIcon}
|
|
54
|
+
withArrow={false}
|
|
57
55
|
/>
|
|
58
56
|
);
|
|
59
57
|
};
|
|
@@ -63,6 +61,13 @@ const LanguageSelect = styled(Select).attrs(() => ({
|
|
|
63
61
|
'data-component-name': 'I18n/LanguagePicker',
|
|
64
62
|
},
|
|
65
63
|
}))`
|
|
64
|
+
--select-list-item-active-background-color: var(
|
|
65
|
+
--language-picker-list-item-active-background-color
|
|
66
|
+
);
|
|
67
|
+
--select-list-item-hover-background-color: var(
|
|
68
|
+
--language-picker-list-item-hover-background-color
|
|
69
|
+
);
|
|
70
|
+
|
|
66
71
|
display: none;
|
|
67
72
|
font-size: var(--language-picker-font-size);
|
|
68
73
|
font-weight: var(--language-picker-font-weight);
|
|
@@ -100,10 +105,6 @@ const LanguageSelect = styled(Select).attrs(() => ({
|
|
|
100
105
|
padding: var(--language-picker-list-item-vertical-padding)
|
|
101
106
|
var(--language-picker-list-item-horizontal-padding);
|
|
102
107
|
}
|
|
103
|
-
|
|
104
|
-
:hover {
|
|
105
|
-
background-color: var(--language-picker-list-item-active-background-color);
|
|
106
|
-
}
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
${({ theme }) => theme.mediaQueries.medium} {
|
|
@@ -115,4 +116,5 @@ const LanguageSelect = styled(Select).attrs(() => ({
|
|
|
115
116
|
background: var(--language-picker-hover-background-color);
|
|
116
117
|
}
|
|
117
118
|
`;
|
|
119
|
+
|
|
118
120
|
const LanguageItem = styled.div``;
|
|
@@ -31,6 +31,7 @@ export const languagePicker = css`
|
|
|
31
31
|
--language-picker-list-item-vertical-padding: var(--select-list-item-vertical-padding); // @presenter Spacing
|
|
32
32
|
--language-picker-list-item-border-radius: var(--select-list-item-border-radius); // @presenter BorderRadius
|
|
33
33
|
--language-picker-list-item-active-background-color: var(--select-list-item-active-background-color); // @presenter Color
|
|
34
|
+
--language-picker-list-item-hover-background-color: var(--select-list-item-hover-background-color); // @presenter Color
|
|
34
35
|
|
|
35
36
|
// @tokens End
|
|
36
37
|
`
|
|
@@ -31,7 +31,7 @@ export const Breadcrumbs = (props: { className?: string }) => {
|
|
|
31
31
|
});
|
|
32
32
|
}}
|
|
33
33
|
/>
|
|
34
|
-
{isLast ? null : <
|
|
34
|
+
{isLast ? null : <span>/</span>}
|
|
35
35
|
</React.Fragment>
|
|
36
36
|
);
|
|
37
37
|
})}
|
|
@@ -51,6 +51,10 @@ const Container = styled.div`
|
|
|
51
51
|
padding: var(--breadcrumbs-padding);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
> span {
|
|
55
|
+
padding: var(--breadcrumbs-gap);
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
@media print {
|
|
55
59
|
display: none;
|
|
56
60
|
}
|
|
@@ -9,7 +9,8 @@ export const breadcrumbs = css`
|
|
|
9
9
|
--breadcrumbs-font-size: var(--font-size-base); // @presenter FontSize
|
|
10
10
|
--breadcrumbs-active-text-color: var(--text-primary); // @presenter Color
|
|
11
11
|
--breadcrumbs-hover-text-decoration: underline; // @presenter TextDecoration
|
|
12
|
-
--breadcrumbs-padding: 0
|
|
12
|
+
--breadcrumbs-padding: 0; // @presenter Spacing
|
|
13
|
+
--breadcrumbs-gap: var(--spacing-xs);
|
|
13
14
|
--breadcrumbs-margin-bottom: var(--spacing-lg); // @presenter Spacing
|
|
14
15
|
|
|
15
16
|
// @tokens End
|
|
@@ -12,6 +12,7 @@ import { FilterContent } from '@theme/components/Filter/FilterContent';
|
|
|
12
12
|
import { FilterPopover } from '@theme/components/Filter/FilterPopover';
|
|
13
13
|
import { Button } from '@theme/components/Button';
|
|
14
14
|
import { PlusIcon } from '@theme/icons/PlusIcon';
|
|
15
|
+
import useModalScrollLock from '@theme/hooks/useModalScrollLock';
|
|
15
16
|
|
|
16
17
|
import { useCatalog } from './useCatalog';
|
|
17
18
|
|
|
@@ -32,6 +33,8 @@ export default function Catalog(props: {
|
|
|
32
33
|
};
|
|
33
34
|
const { translate } = useTranslate();
|
|
34
35
|
|
|
36
|
+
useModalScrollLock(isAddingFilter);
|
|
37
|
+
|
|
35
38
|
return (
|
|
36
39
|
<HighlightContext.Provider value={[filterTerm]}>
|
|
37
40
|
<CatalogPageWrapper>
|
|
@@ -54,7 +57,11 @@ export default function Catalog(props: {
|
|
|
54
57
|
filterValuesCasing={catalogConfig.filterValuesCasing}
|
|
55
58
|
/>
|
|
56
59
|
{isAddingFilter && (
|
|
57
|
-
<FilterPopover
|
|
60
|
+
<FilterPopover
|
|
61
|
+
setIsAddingFilter={setIsAddingFilter}
|
|
62
|
+
filters={filters}
|
|
63
|
+
filterValuesCasing={catalogConfig.filterValuesCasing}
|
|
64
|
+
/>
|
|
58
65
|
)}
|
|
59
66
|
<CatalogPageContent>
|
|
60
67
|
<CatalogPageDescriptionWrapper>
|
|
@@ -124,11 +131,11 @@ export const FilterControls = styled.div`
|
|
|
124
131
|
background: var(--bg-raised);
|
|
125
132
|
`;
|
|
126
133
|
|
|
127
|
-
const CatalogPageContent = styled.main`
|
|
134
|
+
export const CatalogPageContent = styled.main`
|
|
128
135
|
flex: 1;
|
|
129
136
|
padding: var(--mobile-catalog-page-padding);
|
|
130
137
|
|
|
131
|
-
${({ theme }) => theme.mediaQueries.
|
|
138
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
132
139
|
padding: var(--catalog-page-padding);
|
|
133
140
|
}
|
|
134
141
|
`;
|
|
@@ -140,7 +147,7 @@ const CatalogCards = styled.div`
|
|
|
140
147
|
margin: var(--catalog-cards-group-margin);
|
|
141
148
|
`;
|
|
142
149
|
|
|
143
|
-
const CatalogTitle = styled(H2)`
|
|
150
|
+
export const CatalogTitle = styled(H2)`
|
|
144
151
|
color: var(--catalog-title-text-color);
|
|
145
152
|
font-weight: var(--catalog-title-font-weight);
|
|
146
153
|
font-size: var(--catalog-title-font-size);
|
|
@@ -150,14 +157,14 @@ const CatalogTitle = styled(H2)`
|
|
|
150
157
|
}
|
|
151
158
|
`;
|
|
152
159
|
|
|
153
|
-
const CatalogDescription = styled.p`
|
|
160
|
+
export const CatalogDescription = styled.p`
|
|
154
161
|
color: var(--catalog-description-text-color);
|
|
155
162
|
font-weight: var(--catalog-description-font-weight);
|
|
156
163
|
font-size: var(--catalog-description-font-size);
|
|
157
164
|
margin: var(--catalog-description-margin-top) 0 var(--catalog-description-margin-bottom) 0;
|
|
158
165
|
`;
|
|
159
166
|
|
|
160
|
-
const CatalogPageWrapper = styled.div`
|
|
167
|
+
export const CatalogPageWrapper = styled.div`
|
|
161
168
|
--sidebar-width: var(--catalog-sidebar-width, 285px);
|
|
162
169
|
|
|
163
170
|
display: flex;
|
|
@@ -183,7 +190,7 @@ const CatalogPageWrapper = styled.div`
|
|
|
183
190
|
font-weight: var(--link-font-weight);
|
|
184
191
|
}
|
|
185
192
|
|
|
186
|
-
${({ theme }) => theme.mediaQueries.
|
|
193
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
187
194
|
flex-direction: row;
|
|
188
195
|
}
|
|
189
196
|
`;
|
|
@@ -193,7 +200,7 @@ const FilterTagsWrapper = styled.div.attrs({ 'data-cy': 'Catalog/FilterTags' })`
|
|
|
193
200
|
display: flex;
|
|
194
201
|
overflow-x: scroll;
|
|
195
202
|
|
|
196
|
-
${({ theme }) => theme.mediaQueries.
|
|
203
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
197
204
|
display: none;
|
|
198
205
|
}
|
|
199
206
|
|
|
@@ -216,10 +223,10 @@ const FilterTagsWrapper = styled.div.attrs({ 'data-cy': 'Catalog/FilterTags' })`
|
|
|
216
223
|
}
|
|
217
224
|
`;
|
|
218
225
|
|
|
219
|
-
const CatalogPageDescriptionWrapper = styled.div`
|
|
226
|
+
export const CatalogPageDescriptionWrapper = styled.div`
|
|
220
227
|
display: none;
|
|
221
228
|
|
|
222
|
-
${({ theme }) => theme.mediaQueries.
|
|
229
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
223
230
|
display: block;
|
|
224
231
|
}
|
|
225
232
|
`;
|
|
@@ -10,6 +10,7 @@ import { telemetry } from '@portal/telemetry';
|
|
|
10
10
|
import { slug } from '@theme/utils';
|
|
11
11
|
|
|
12
12
|
export function CatalogCard({ item }: { item: CatalogItem }): JSX.Element {
|
|
13
|
+
const hasTags = item.scorecardStatus || item.tags?.length;
|
|
13
14
|
return (
|
|
14
15
|
<Link key={item.docsLink || item.link} to={item.docsLink || item.link}>
|
|
15
16
|
<StyledCard onClick={() => telemetry.send('catalog_item_clicked', {})}>
|
|
@@ -21,13 +22,22 @@ export function CatalogCard({ item }: { item: CatalogItem }): JSX.Element {
|
|
|
21
22
|
<Highlight>{item.description ?? ''}</Highlight>
|
|
22
23
|
</CardDescription>
|
|
23
24
|
<CardFooter>
|
|
24
|
-
{
|
|
25
|
+
{hasTags && (
|
|
25
26
|
<CardTags>
|
|
26
|
-
{(item.tags as string[]).map((tag, index) => (
|
|
27
|
+
{((item.tags as string[]) || []).map((tag, index) => (
|
|
27
28
|
<CardTag key={tag + index} color={slug(tag)}>
|
|
28
29
|
<Highlight>{tag}</Highlight>
|
|
29
30
|
</CardTag>
|
|
30
31
|
))}
|
|
32
|
+
{(item.scorecardLevel && item.scorecardStatus && (
|
|
33
|
+
<CardTag
|
|
34
|
+
color={statusToColor(item.scorecardStatus)}
|
|
35
|
+
className="tag-variant-scorecard-level"
|
|
36
|
+
>
|
|
37
|
+
<Highlight>{item.scorecardLevel}</Highlight>
|
|
38
|
+
</CardTag>
|
|
39
|
+
)) ||
|
|
40
|
+
null}
|
|
31
41
|
</CardTags>
|
|
32
42
|
)}
|
|
33
43
|
<SelectButton>
|
|
@@ -40,6 +50,19 @@ export function CatalogCard({ item }: { item: CatalogItem }): JSX.Element {
|
|
|
40
50
|
);
|
|
41
51
|
}
|
|
42
52
|
|
|
53
|
+
function statusToColor(status: string) {
|
|
54
|
+
switch (status) {
|
|
55
|
+
case 'Below minimum':
|
|
56
|
+
return 'error';
|
|
57
|
+
case 'Minimum':
|
|
58
|
+
return 'warning';
|
|
59
|
+
case 'Highest':
|
|
60
|
+
return 'success';
|
|
61
|
+
default:
|
|
62
|
+
return '';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
43
66
|
const SelectButton = styled.div`
|
|
44
67
|
border: 1px solid var(--catalog-card-button-border-color);
|
|
45
68
|
border-radius: 100%;
|
|
@@ -76,7 +99,7 @@ const StyledCard = styled.div.attrs({ 'data-cy': 'Catalog/CatalogCard' })`
|
|
|
76
99
|
transform: rotate(-45deg);
|
|
77
100
|
border-color: var(--catalog-card-hover-border-color);
|
|
78
101
|
background: var(--catalog-card-button-hover-background);
|
|
79
|
-
|
|
102
|
+
|
|
80
103
|
svg {
|
|
81
104
|
fill: var(--catalog-card-icon-hover-color);
|
|
82
105
|
}
|
|
@@ -48,7 +48,7 @@ export const code = css`
|
|
|
48
48
|
--code-block-controls-text-color: var(--text-secondary); // @presenter Color
|
|
49
49
|
--code-block-controls-background-color: var(--bg-overlay); // @presenter Color
|
|
50
50
|
--code-block-controls-border: 1px solid var(--border-primary); // @presenter Border
|
|
51
|
-
--code-block-controls-padding: 0
|
|
51
|
+
--code-block-controls-padding: 0 var(--spacing-xs); // @presenter Spacing
|
|
52
52
|
--code-block-icon-controls-background-color: var(--code-block-controls-background-color);
|
|
53
53
|
--code-block-text-controls-background-color: var(--code-block-controls-background-color);
|
|
54
54
|
|
|
@@ -66,7 +66,7 @@ export const code = css`
|
|
|
66
66
|
--code-block-tokens-constant-color: var(--code-block-tokens-default-color); // @presenter Color
|
|
67
67
|
--code-block-tokens-symbol-color: var(--code-block-tokens-default-color); // @presenter Color
|
|
68
68
|
--code-block-tokens-boolean-color: var(--color-geekblue-7); // @presenter Color
|
|
69
|
-
--code-block-tokens-string-color: var(--color-
|
|
69
|
+
--code-block-tokens-string-color: var(--color-cyan-6); // @presenter Color
|
|
70
70
|
--code-block-tokens-property-string-color: var(--text-secondary); // @presenter Color
|
|
71
71
|
--code-block-tokens-selector-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
72
72
|
--code-block-tokens-attr-name-color: var(--code-block-tokens-string-color); // @presenter Color
|