@redocly/theme 0.18.3-patch.1 → 0.18.3-patch.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/I18n/LanguagePicker.js +1 -1
- package/lib/components/Catalog/Catalog.d.ts +5 -0
- package/lib/components/Catalog/Catalog.js +19 -17
- package/lib/components/Catalog/CatalogCard.js +22 -5
- package/lib/components/CodeBlock/styledVariables.js +1 -1
- package/lib/components/Filter/Filter.d.ts +3 -1
- package/lib/components/Filter/Filter.js +17 -3
- package/lib/components/Filter/FilterContent.d.ts +3 -1
- package/lib/components/Filter/FilterContent.js +6 -5
- 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/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 +16 -6
- package/lib/components/Panel/PanelHeader.js +1 -0
- package/lib/components/Panel/styledVariables.js +1 -1
- package/lib/components/Product/ProductPicker.js +1 -1
- package/lib/components/Select/Select.d.ts +1 -3
- package/lib/components/Select/Select.js +7 -5
- package/lib/components/Separator/SeparatorItem.js +1 -0
- package/lib/components/Sidebar/HeaderWrapper.js +2 -2
- package/lib/components/Tag/Tag.d.ts +2 -1
- package/lib/components/Tag/Tag.js +10 -4
- package/lib/components/Tag/styledVariables.js +14 -8
- package/lib/config.d.ts +31 -0
- package/lib/config.js +12 -2
- package/lib/globalStyle.js +23 -21
- 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 +1 -0
- package/src/components/Catalog/Catalog.tsx +18 -10
- package/src/components/Catalog/CatalogCard.tsx +26 -3
- package/src/components/CodeBlock/styledVariables.ts +1 -1
- package/src/components/Filter/Filter.tsx +34 -3
- package/src/components/Filter/FilterContent.tsx +13 -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/Markdown/Admonition.tsx +13 -8
- package/src/components/Markdown/Mermaid.tsx +3 -0
- package/src/components/Markdown/styledVariables.ts +17 -6
- package/src/components/Panel/PanelHeader.ts +1 -0
- package/src/components/Panel/styledVariables.ts +1 -1
- package/src/components/Product/ProductPicker.tsx +0 -1
- package/src/components/Select/Select.tsx +8 -8
- package/src/components/Separator/SeparatorItem.tsx +1 -0
- package/src/components/Sidebar/HeaderWrapper.tsx +2 -2
- package/src/components/Tag/Tag.tsx +12 -4
- package/src/components/Tag/styledVariables.ts +14 -8
- package/src/config.ts +11 -0
- package/src/globalStyle.ts +24 -22
- 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
|
@@ -10,8 +10,9 @@ interface TagProps {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
closable?: boolean;
|
|
12
12
|
color?: StatusColor | Color | string;
|
|
13
|
+
size?: string;
|
|
13
14
|
icon?: React.ReactNode;
|
|
14
15
|
onClick?: () => void;
|
|
15
16
|
}
|
|
16
|
-
export declare function Tag({ children, className, color, icon, onClick }: TagProps): JSX.Element;
|
|
17
|
+
export declare function Tag({ children, className, color, icon, onClick, size }: TagProps): JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -6,15 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Tag = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
function Tag({ children, className, color, icon, onClick }) {
|
|
10
|
-
return (react_1.default.createElement(TagContainer, { className: className, color: color, onClick: onClick },
|
|
9
|
+
function Tag({ children, className, color, icon, onClick, size }) {
|
|
10
|
+
return (react_1.default.createElement(TagContainer, { className: className, color: color, size: size, onClick: onClick },
|
|
11
11
|
icon ? icon : null,
|
|
12
12
|
children));
|
|
13
13
|
}
|
|
14
14
|
exports.Tag = Tag;
|
|
15
|
-
const TagContainer = styled_components_1.default.div.attrs(({ className, color }) => ({
|
|
15
|
+
const TagContainer = styled_components_1.default.div.attrs(({ className, color, size }) => ({
|
|
16
16
|
'data-component-name': 'Tag/Tag',
|
|
17
|
-
className: (className || '') +
|
|
17
|
+
className: (className || '') +
|
|
18
|
+
` tag-default ${color ? `tag-${color}` : ''} ${size ? `tag-size-${size}` : ''}`,
|
|
18
19
|
})) `
|
|
19
20
|
display: inline-flex;
|
|
20
21
|
align-items: center;
|
|
@@ -23,6 +24,11 @@ const TagContainer = styled_components_1.default.div.attrs(({ className, color }
|
|
|
23
24
|
|
|
24
25
|
padding: var(--tag-padding);
|
|
25
26
|
margin: var(--tag-margin);
|
|
27
|
+
|
|
28
|
+
&:last-child {
|
|
29
|
+
margin-right: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
gap: var(--tag-gap);
|
|
27
33
|
|
|
28
34
|
font-size: var(--tag-font-size);
|
|
@@ -17,6 +17,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
--tag-padding: 1px 8px; //@presenter Spacing
|
|
20
|
+
--tag-large-padding: 4px 16px; //@presenter Spacing
|
|
20
21
|
--tag-margin: 0 5px 0 0; //@presenter Spacing
|
|
21
22
|
--tag-gap: 5px; //@presenter Spacing
|
|
22
23
|
|
|
@@ -40,6 +41,11 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
40
41
|
* @tokens Tag colors
|
|
41
42
|
*/
|
|
42
43
|
|
|
44
|
+
.tag-size-large {
|
|
45
|
+
--tag-padding: var(--tag-large-padding);
|
|
46
|
+
--tag-font-size: var(--font-size-regular);
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
.tag-grey,
|
|
44
50
|
.tag-draft,
|
|
45
51
|
.tag-schema,
|
|
@@ -54,7 +60,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
54
60
|
.tag-approved,
|
|
55
61
|
.tag-get {
|
|
56
62
|
--tag-color: var(--color-success-active); // @presenter Color
|
|
57
|
-
--tag-background-color:
|
|
63
|
+
--tag-background-color: var(--color-success-bg); // @presenter Color
|
|
58
64
|
--tag-border-color: var(--color-success-active); // @presenter Color
|
|
59
65
|
}
|
|
60
66
|
|
|
@@ -72,7 +78,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
72
78
|
.tag-deprecated,
|
|
73
79
|
.tag-put {
|
|
74
80
|
--tag-color: var(--color-warning-active); // @presenter Color
|
|
75
|
-
--tag-background-color:
|
|
81
|
+
--tag-background-color: var(--color-warning-bg); // @presenter Color
|
|
76
82
|
--tag-border-color: var(--color-warning-active); // @presenter Color
|
|
77
83
|
}
|
|
78
84
|
|
|
@@ -80,42 +86,42 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
80
86
|
.tag-processing,
|
|
81
87
|
.tag-post {
|
|
82
88
|
--tag-color: var(--color-info-active); // @presenter Color
|
|
83
|
-
--tag-background-color:
|
|
89
|
+
--tag-background-color: var(--color-info-bg); // @presenter Color
|
|
84
90
|
--tag-border-color: var(--color-info-active); // @presenter Color
|
|
85
91
|
}
|
|
86
92
|
|
|
87
93
|
.tag-purple,
|
|
88
94
|
.tag-head {
|
|
89
95
|
--tag-color: var(--color-purple-7); // @presenter Color
|
|
90
|
-
--tag-background-color:
|
|
96
|
+
--tag-background-color: var(--color-purple-1); // @presenter Color
|
|
91
97
|
--tag-border-color: var(--color-purple-7); // @presenter Color
|
|
92
98
|
}
|
|
93
99
|
|
|
94
100
|
.tag-cyan,
|
|
95
101
|
.tag-option {
|
|
96
102
|
--tag-color: var(--color-cyan-7); // @presenter Color
|
|
97
|
-
--tag-background-color:
|
|
103
|
+
--tag-background-color: var(--color-cyan-1); // @presenter Color
|
|
98
104
|
--tag-border-color: var(--color-cyan-7); // @presenter Color
|
|
99
105
|
}
|
|
100
106
|
|
|
101
107
|
.tag-yellow,
|
|
102
108
|
.tag-patch {
|
|
103
109
|
--tag-color: var(--color-yellow-7); // @presenter Color
|
|
104
|
-
--tag-background-color:
|
|
110
|
+
--tag-background-color: var(--color-yellow-1); // @presenter Color
|
|
105
111
|
--tag-border-color: var(--color-yellow-7); // @presenter Color
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
.tag-geekblue,
|
|
109
115
|
.tag-link {
|
|
110
116
|
--tag-color: var(--color-geekblue-7); // @presenter Color
|
|
111
|
-
--tag-background-color:
|
|
117
|
+
--tag-background-color: var(--color-geekblue-1); // @presenter Color
|
|
112
118
|
--tag-border-color: var(--color-geekblue-7); // @presenter Color
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
.tag-magneta,
|
|
116
122
|
.tag-hook {
|
|
117
123
|
--tag-color: var(--color-magneta-7); // @presenter Color
|
|
118
|
-
--tag-background-color:
|
|
124
|
+
--tag-background-color: var(--color-magneta-1); // @presenter Color
|
|
119
125
|
--tag-border-color: var(--color-magneta-7); // @presenter Color
|
|
120
126
|
}
|
|
121
127
|
|
package/lib/config.d.ts
CHANGED
|
@@ -458,6 +458,10 @@ declare const catalogSchema: {
|
|
|
458
458
|
readonly groupByFirstFilter: {
|
|
459
459
|
readonly type: "boolean";
|
|
460
460
|
};
|
|
461
|
+
readonly filterValuesCasing: {
|
|
462
|
+
readonly type: "string";
|
|
463
|
+
readonly enum: readonly ["sentence", "original", "lowercase", "uppercase"];
|
|
464
|
+
};
|
|
461
465
|
readonly items: {
|
|
462
466
|
readonly type: "array";
|
|
463
467
|
readonly items: {
|
|
@@ -870,6 +874,15 @@ export declare const themeConfigSchema: {
|
|
|
870
874
|
readonly copyrightText: {
|
|
871
875
|
readonly type: "string";
|
|
872
876
|
};
|
|
877
|
+
readonly logo: {
|
|
878
|
+
readonly type: "object";
|
|
879
|
+
readonly properties: {
|
|
880
|
+
readonly hide: {
|
|
881
|
+
readonly type: "boolean";
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
readonly additionalProperties: false;
|
|
885
|
+
};
|
|
873
886
|
};
|
|
874
887
|
readonly additionalProperties: false;
|
|
875
888
|
};
|
|
@@ -1749,6 +1762,10 @@ export declare const themeConfigSchema: {
|
|
|
1749
1762
|
readonly groupByFirstFilter: {
|
|
1750
1763
|
readonly type: "boolean";
|
|
1751
1764
|
};
|
|
1765
|
+
readonly filterValuesCasing: {
|
|
1766
|
+
readonly type: "string";
|
|
1767
|
+
readonly enum: readonly ["sentence", "original", "lowercase", "uppercase"];
|
|
1768
|
+
};
|
|
1752
1769
|
readonly items: {
|
|
1753
1770
|
readonly type: "array";
|
|
1754
1771
|
readonly items: {
|
|
@@ -2203,6 +2220,15 @@ export declare const productThemeOverrideSchema: {
|
|
|
2203
2220
|
readonly copyrightText: {
|
|
2204
2221
|
readonly type: "string";
|
|
2205
2222
|
};
|
|
2223
|
+
readonly logo: {
|
|
2224
|
+
readonly type: "object";
|
|
2225
|
+
readonly properties: {
|
|
2226
|
+
readonly hide: {
|
|
2227
|
+
readonly type: "boolean";
|
|
2228
|
+
};
|
|
2229
|
+
};
|
|
2230
|
+
readonly additionalProperties: false;
|
|
2231
|
+
};
|
|
2206
2232
|
};
|
|
2207
2233
|
readonly additionalProperties: false;
|
|
2208
2234
|
};
|
|
@@ -2394,4 +2420,9 @@ export type GoogleAnalyticsConfig = FromSchema<typeof googleAnalyticsConfigSchem
|
|
|
2394
2420
|
export type CatalogConfig = FromSchema<typeof catalogSchema>;
|
|
2395
2421
|
export type CatalogFilterConfig = FromSchema<typeof catalogFilterSchema>;
|
|
2396
2422
|
export type ScorecardConfig = FromSchema<typeof scorecardConfigSchema>;
|
|
2423
|
+
export declare enum ScorecardStatus {
|
|
2424
|
+
BelowMinimum = "Below minimum",
|
|
2425
|
+
Highest = "Highest",
|
|
2426
|
+
Minimum = "Minimum"
|
|
2427
|
+
}
|
|
2397
2428
|
export {};
|
package/lib/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.productThemeOverrideSchema = exports.themeConfigSchema = void 0;
|
|
3
|
+
exports.ScorecardStatus = exports.productThemeOverrideSchema = exports.themeConfigSchema = void 0;
|
|
4
4
|
const logoConfigSchema = {
|
|
5
5
|
type: 'object',
|
|
6
6
|
properties: {
|
|
@@ -332,6 +332,10 @@ const catalogSchema = {
|
|
|
332
332
|
slug: { type: 'string' },
|
|
333
333
|
filters: { type: 'array', items: catalogFilterSchema },
|
|
334
334
|
groupByFirstFilter: { type: 'boolean' },
|
|
335
|
+
filterValuesCasing: {
|
|
336
|
+
type: 'string',
|
|
337
|
+
enum: ['sentence', 'original', 'lowercase', 'uppercase'],
|
|
338
|
+
},
|
|
335
339
|
items: navItemsSchema,
|
|
336
340
|
requiredPermission: { type: 'string' },
|
|
337
341
|
separateVersions: { type: 'boolean' },
|
|
@@ -367,7 +371,7 @@ exports.themeConfigSchema = {
|
|
|
367
371
|
},
|
|
368
372
|
footer: {
|
|
369
373
|
type: 'object',
|
|
370
|
-
properties: Object.assign({ items: navItemsSchema, copyrightText: { type: 'string' } }, hideConfigSchema.properties),
|
|
374
|
+
properties: Object.assign({ items: navItemsSchema, copyrightText: { type: 'string' }, logo: hideConfigSchema }, hideConfigSchema.properties),
|
|
371
375
|
additionalProperties: false,
|
|
372
376
|
},
|
|
373
377
|
sidebar: {
|
|
@@ -585,4 +589,10 @@ exports.productThemeOverrideSchema = {
|
|
|
585
589
|
additionalProperties: true,
|
|
586
590
|
default: {},
|
|
587
591
|
};
|
|
592
|
+
var ScorecardStatus;
|
|
593
|
+
(function (ScorecardStatus) {
|
|
594
|
+
ScorecardStatus["BelowMinimum"] = "Below minimum";
|
|
595
|
+
ScorecardStatus["Highest"] = "Highest";
|
|
596
|
+
ScorecardStatus["Minimum"] = "Minimum";
|
|
597
|
+
})(ScorecardStatus = exports.ScorecardStatus || (exports.ScorecardStatus = {}));
|
|
588
598
|
//# sourceMappingURL=config.js.map
|
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
|
|
|
@@ -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
|
@@ -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>
|
|
@@ -51,9 +54,14 @@ export default function Catalog(props: {
|
|
|
51
54
|
filters={filters}
|
|
52
55
|
filterTerm={filterTerm}
|
|
53
56
|
isMobile={false}
|
|
57
|
+
filterValuesCasing={catalogConfig.filterValuesCasing}
|
|
54
58
|
/>
|
|
55
59
|
{isAddingFilter && (
|
|
56
|
-
<FilterPopover
|
|
60
|
+
<FilterPopover
|
|
61
|
+
setIsAddingFilter={setIsAddingFilter}
|
|
62
|
+
filters={filters}
|
|
63
|
+
filterValuesCasing={catalogConfig.filterValuesCasing}
|
|
64
|
+
/>
|
|
57
65
|
)}
|
|
58
66
|
<CatalogPageContent>
|
|
59
67
|
<CatalogPageDescriptionWrapper>
|
|
@@ -123,11 +131,11 @@ export const FilterControls = styled.div`
|
|
|
123
131
|
background: var(--bg-raised);
|
|
124
132
|
`;
|
|
125
133
|
|
|
126
|
-
const CatalogPageContent = styled.main`
|
|
134
|
+
export const CatalogPageContent = styled.main`
|
|
127
135
|
flex: 1;
|
|
128
136
|
padding: var(--mobile-catalog-page-padding);
|
|
129
137
|
|
|
130
|
-
${({ theme }) => theme.mediaQueries.
|
|
138
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
131
139
|
padding: var(--catalog-page-padding);
|
|
132
140
|
}
|
|
133
141
|
`;
|
|
@@ -139,7 +147,7 @@ const CatalogCards = styled.div`
|
|
|
139
147
|
margin: var(--catalog-cards-group-margin);
|
|
140
148
|
`;
|
|
141
149
|
|
|
142
|
-
const CatalogTitle = styled(H2)`
|
|
150
|
+
export const CatalogTitle = styled(H2)`
|
|
143
151
|
color: var(--catalog-title-text-color);
|
|
144
152
|
font-weight: var(--catalog-title-font-weight);
|
|
145
153
|
font-size: var(--catalog-title-font-size);
|
|
@@ -149,14 +157,14 @@ const CatalogTitle = styled(H2)`
|
|
|
149
157
|
}
|
|
150
158
|
`;
|
|
151
159
|
|
|
152
|
-
const CatalogDescription = styled.p`
|
|
160
|
+
export const CatalogDescription = styled.p`
|
|
153
161
|
color: var(--catalog-description-text-color);
|
|
154
162
|
font-weight: var(--catalog-description-font-weight);
|
|
155
163
|
font-size: var(--catalog-description-font-size);
|
|
156
164
|
margin: var(--catalog-description-margin-top) 0 var(--catalog-description-margin-bottom) 0;
|
|
157
165
|
`;
|
|
158
166
|
|
|
159
|
-
const CatalogPageWrapper = styled.div`
|
|
167
|
+
export const CatalogPageWrapper = styled.div`
|
|
160
168
|
--sidebar-width: var(--catalog-sidebar-width, 285px);
|
|
161
169
|
|
|
162
170
|
display: flex;
|
|
@@ -182,7 +190,7 @@ const CatalogPageWrapper = styled.div`
|
|
|
182
190
|
font-weight: var(--link-font-weight);
|
|
183
191
|
}
|
|
184
192
|
|
|
185
|
-
${({ theme }) => theme.mediaQueries.
|
|
193
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
186
194
|
flex-direction: row;
|
|
187
195
|
}
|
|
188
196
|
`;
|
|
@@ -192,7 +200,7 @@ const FilterTagsWrapper = styled.div.attrs({ 'data-cy': 'Catalog/FilterTags' })`
|
|
|
192
200
|
display: flex;
|
|
193
201
|
overflow-x: scroll;
|
|
194
202
|
|
|
195
|
-
${({ theme }) => theme.mediaQueries.
|
|
203
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
196
204
|
display: none;
|
|
197
205
|
}
|
|
198
206
|
|
|
@@ -215,10 +223,10 @@ const FilterTagsWrapper = styled.div.attrs({ 'data-cy': 'Catalog/FilterTags' })`
|
|
|
215
223
|
}
|
|
216
224
|
`;
|
|
217
225
|
|
|
218
|
-
const CatalogPageDescriptionWrapper = styled.div`
|
|
226
|
+
export const CatalogPageDescriptionWrapper = styled.div`
|
|
219
227
|
display: none;
|
|
220
228
|
|
|
221
|
-
${({ theme }) => theme.mediaQueries.
|
|
229
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
222
230
|
display: block;
|
|
223
231
|
}
|
|
224
232
|
`;
|