@redocly/theme 0.18.3-patch.2 → 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.
Files changed (69) hide show
  1. package/lib/I18n/LanguagePicker.js +1 -1
  2. package/lib/components/Catalog/Catalog.d.ts +5 -0
  3. package/lib/components/Catalog/Catalog.js +18 -16
  4. package/lib/components/Catalog/CatalogCard.js +22 -5
  5. package/lib/components/CodeBlock/styledVariables.js +1 -1
  6. package/lib/components/Filter/Filter.d.ts +2 -1
  7. package/lib/components/Filter/Filter.js +12 -4
  8. package/lib/components/Filter/FilterContent.d.ts +2 -1
  9. package/lib/components/Filter/FilterContent.js +5 -4
  10. package/lib/components/Filter/FilterPopover.d.ts +3 -1
  11. package/lib/components/Filter/FilterPopover.js +4 -4
  12. package/lib/components/Filter/styledVariables.js +1 -1
  13. package/lib/components/Footer/Footer.js +2 -1
  14. package/lib/components/Footer/FooterColumn.js +2 -0
  15. package/lib/components/Footer/styledVariables.js +1 -1
  16. package/lib/components/Markdown/Admonition.js +12 -9
  17. package/lib/components/Markdown/Mermaid.js +3 -0
  18. package/lib/components/Markdown/styledVariables.d.ts +1 -0
  19. package/lib/components/Markdown/styledVariables.js +16 -6
  20. package/lib/components/Panel/PanelHeader.js +1 -0
  21. package/lib/components/Panel/styledVariables.js +1 -1
  22. package/lib/components/Product/ProductPicker.js +1 -1
  23. package/lib/components/Select/Select.js +3 -4
  24. package/lib/components/Separator/SeparatorItem.js +1 -0
  25. package/lib/components/Sidebar/HeaderWrapper.js +2 -2
  26. package/lib/components/Tag/styledVariables.js +10 -9
  27. package/lib/config.d.ts +25 -2
  28. package/lib/config.js +12 -3
  29. package/lib/globalStyle.js +23 -21
  30. package/lib/hooks/useMobileMenu.js +5 -6
  31. package/lib/hooks/useModalScrollLock.d.ts +1 -0
  32. package/lib/hooks/useModalScrollLock.js +16 -0
  33. package/lib/icons/AlertIcon/AlertIcon.js +0 -5
  34. package/lib/types/portal/src/shared/types/catalog.d.ts +5 -1
  35. package/lib/ui/Highlight.d.ts +1 -1
  36. package/lib/ui/Highlight.js +1 -1
  37. package/lib/ui/darkColors.js +26 -26
  38. package/lib/utils/css-variables.js +1 -1
  39. package/package.json +1 -1
  40. package/src/I18n/LanguagePicker.tsx +1 -0
  41. package/src/components/Catalog/Catalog.tsx +17 -10
  42. package/src/components/Catalog/CatalogCard.tsx +26 -3
  43. package/src/components/CodeBlock/styledVariables.ts +1 -1
  44. package/src/components/Filter/Filter.tsx +19 -6
  45. package/src/components/Filter/FilterContent.tsx +7 -4
  46. package/src/components/Filter/FilterPopover.tsx +13 -3
  47. package/src/components/Filter/styledVariables.ts +1 -1
  48. package/src/components/Footer/Footer.tsx +1 -1
  49. package/src/components/Footer/FooterColumn.tsx +2 -0
  50. package/src/components/Footer/styledVariables.ts +1 -1
  51. package/src/components/Markdown/Admonition.tsx +13 -8
  52. package/src/components/Markdown/Mermaid.tsx +3 -0
  53. package/src/components/Markdown/styledVariables.ts +17 -6
  54. package/src/components/Panel/PanelHeader.ts +1 -0
  55. package/src/components/Panel/styledVariables.ts +1 -1
  56. package/src/components/Product/ProductPicker.tsx +0 -1
  57. package/src/components/Select/Select.tsx +3 -4
  58. package/src/components/Separator/SeparatorItem.tsx +1 -0
  59. package/src/components/Sidebar/HeaderWrapper.tsx +2 -2
  60. package/src/components/Tag/styledVariables.ts +10 -9
  61. package/src/config.ts +11 -1
  62. package/src/globalStyle.ts +24 -22
  63. package/src/hooks/useMobileMenu.ts +3 -4
  64. package/src/hooks/useModalScrollLock.ts +12 -0
  65. package/src/icons/AlertIcon/AlertIcon.tsx +0 -5
  66. package/src/types/portal/src/shared/types/catalog.ts +7 -1
  67. package/src/ui/Highlight.tsx +2 -2
  68. package/src/ui/darkColors.tsx +26 -26
  69. package/src/utils/css-variables.ts +4 -2
@@ -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
 
@@ -41,7 +42,7 @@ exports.tag = (0, styled_components_1.css) `
41
42
  */
42
43
 
43
44
  .tag-size-large {
44
- --tag-padding: 4px 16px;
45
+ --tag-padding: var(--tag-large-padding);
45
46
  --tag-font-size: var(--font-size-regular);
46
47
  }
47
48
 
@@ -59,7 +60,7 @@ exports.tag = (0, styled_components_1.css) `
59
60
  .tag-approved,
60
61
  .tag-get {
61
62
  --tag-color: var(--color-success-active); // @presenter Color
62
- --tag-background-color: none; // @presenter Color
63
+ --tag-background-color: var(--color-success-bg); // @presenter Color
63
64
  --tag-border-color: var(--color-success-active); // @presenter Color
64
65
  }
65
66
 
@@ -77,7 +78,7 @@ exports.tag = (0, styled_components_1.css) `
77
78
  .tag-deprecated,
78
79
  .tag-put {
79
80
  --tag-color: var(--color-warning-active); // @presenter Color
80
- --tag-background-color: none; // @presenter Color
81
+ --tag-background-color: var(--color-warning-bg); // @presenter Color
81
82
  --tag-border-color: var(--color-warning-active); // @presenter Color
82
83
  }
83
84
 
@@ -85,42 +86,42 @@ exports.tag = (0, styled_components_1.css) `
85
86
  .tag-processing,
86
87
  .tag-post {
87
88
  --tag-color: var(--color-info-active); // @presenter Color
88
- --tag-background-color: none; // @presenter Color
89
+ --tag-background-color: var(--color-info-bg); // @presenter Color
89
90
  --tag-border-color: var(--color-info-active); // @presenter Color
90
91
  }
91
92
 
92
93
  .tag-purple,
93
94
  .tag-head {
94
95
  --tag-color: var(--color-purple-7); // @presenter Color
95
- --tag-background-color: none; // @presenter Color
96
+ --tag-background-color: var(--color-purple-1); // @presenter Color
96
97
  --tag-border-color: var(--color-purple-7); // @presenter Color
97
98
  }
98
99
 
99
100
  .tag-cyan,
100
101
  .tag-option {
101
102
  --tag-color: var(--color-cyan-7); // @presenter Color
102
- --tag-background-color: none; // @presenter Color
103
+ --tag-background-color: var(--color-cyan-1); // @presenter Color
103
104
  --tag-border-color: var(--color-cyan-7); // @presenter Color
104
105
  }
105
106
 
106
107
  .tag-yellow,
107
108
  .tag-patch {
108
109
  --tag-color: var(--color-yellow-7); // @presenter Color
109
- --tag-background-color: none; // @presenter Color
110
+ --tag-background-color: var(--color-yellow-1); // @presenter Color
110
111
  --tag-border-color: var(--color-yellow-7); // @presenter Color
111
112
  }
112
113
 
113
114
  .tag-geekblue,
114
115
  .tag-link {
115
116
  --tag-color: var(--color-geekblue-7); // @presenter Color
116
- --tag-background-color: none; // @presenter Color
117
+ --tag-background-color: var(--color-geekblue-1); // @presenter Color
117
118
  --tag-border-color: var(--color-geekblue-7); // @presenter Color
118
119
  }
119
120
 
120
121
  .tag-magneta,
121
122
  .tag-hook {
122
123
  --tag-color: var(--color-magneta-7); // @presenter Color
123
- --tag-background-color: none; // @presenter Color
124
+ --tag-background-color: var(--color-magneta-1); // @presenter Color
124
125
  --tag-border-color: var(--color-magneta-7); // @presenter Color
125
126
  }
126
127
 
package/lib/config.d.ts CHANGED
@@ -460,7 +460,7 @@ declare const catalogSchema: {
460
460
  };
461
461
  readonly filterValuesCasing: {
462
462
  readonly type: "string";
463
- readonly enum: readonly ["sentence"];
463
+ readonly enum: readonly ["sentence", "original", "lowercase", "uppercase"];
464
464
  };
465
465
  readonly items: {
466
466
  readonly type: "array";
@@ -874,6 +874,15 @@ export declare const themeConfigSchema: {
874
874
  readonly copyrightText: {
875
875
  readonly type: "string";
876
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
+ };
877
886
  };
878
887
  readonly additionalProperties: false;
879
888
  };
@@ -1755,7 +1764,7 @@ export declare const themeConfigSchema: {
1755
1764
  };
1756
1765
  readonly filterValuesCasing: {
1757
1766
  readonly type: "string";
1758
- readonly enum: readonly ["sentence"];
1767
+ readonly enum: readonly ["sentence", "original", "lowercase", "uppercase"];
1759
1768
  };
1760
1769
  readonly items: {
1761
1770
  readonly type: "array";
@@ -2211,6 +2220,15 @@ export declare const productThemeOverrideSchema: {
2211
2220
  readonly copyrightText: {
2212
2221
  readonly type: "string";
2213
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
+ };
2214
2232
  };
2215
2233
  readonly additionalProperties: false;
2216
2234
  };
@@ -2402,4 +2420,9 @@ export type GoogleAnalyticsConfig = FromSchema<typeof googleAnalyticsConfigSchem
2402
2420
  export type CatalogConfig = FromSchema<typeof catalogSchema>;
2403
2421
  export type CatalogFilterConfig = FromSchema<typeof catalogFilterSchema>;
2404
2422
  export type ScorecardConfig = FromSchema<typeof scorecardConfigSchema>;
2423
+ export declare enum ScorecardStatus {
2424
+ BelowMinimum = "Below minimum",
2425
+ Highest = "Highest",
2426
+ Minimum = "Minimum"
2427
+ }
2405
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,7 +332,10 @@ const catalogSchema = {
332
332
  slug: { type: 'string' },
333
333
  filters: { type: 'array', items: catalogFilterSchema },
334
334
  groupByFirstFilter: { type: 'boolean' },
335
- filterValuesCasing: { type: 'string', enum: ['sentence'] },
335
+ filterValuesCasing: {
336
+ type: 'string',
337
+ enum: ['sentence', 'original', 'lowercase', 'uppercase'],
338
+ },
336
339
  items: navItemsSchema,
337
340
  requiredPermission: { type: 'string' },
338
341
  separateVersions: { type: 'boolean' },
@@ -368,7 +371,7 @@ exports.themeConfigSchema = {
368
371
  },
369
372
  footer: {
370
373
  type: 'object',
371
- properties: Object.assign({ items: navItemsSchema, copyrightText: { type: 'string' } }, hideConfigSchema.properties),
374
+ properties: Object.assign({ items: navItemsSchema, copyrightText: { type: 'string' }, logo: hideConfigSchema }, hideConfigSchema.properties),
372
375
  additionalProperties: false,
373
376
  },
374
377
  sidebar: {
@@ -586,4 +589,10 @@ exports.productThemeOverrideSchema = {
586
589
  additionalProperties: true,
587
590
  default: {},
588
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 = {}));
589
598
  //# sourceMappingURL=config.js.map
@@ -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-magneta-1: #fff0f6;
92
- --color-magneta-2: #ffd6e7;
93
- --color-magneta-3: #ffadd2;
94
- --color-magneta-4: #ff85c0;
95
- --color-magneta-5: #f759ab;
96
- --color-magneta-6: #eb2f96;
97
- --color-magneta-7: #c41d7f;
98
- --color-magneta-8: #9e1068;
99
- --color-magneta-9: #780650;
100
- --color-magneta-10: #520339;
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-green-1);
158
- --color-success-bg-hover: var(--color-green-2);
159
- --color-success-border: var(--color-green-3);
160
- --color-success-border-hover: var(--color-green-4);
161
- --color-success-hover: var(--color-green-5);
162
- --color-success-base: var(--color-green-6);
163
- --color-success-active: var(--color-green-7);
164
- --color-success-text-hover: var(--color-green-8);
165
- --color-success-text: var(--color-green-9);
166
- --color-success-text-active: var(--color-green-10);
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-3);
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, react_1.useEffect)(() => {
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 "../../../../../config";
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
  };
@@ -2,4 +2,4 @@ import * as React from 'react';
2
2
  export declare const HighlightContext: React.Context<string[]>;
3
3
  export declare function Highlight(props: {
4
4
  children: React.ReactChildren | string;
5
- }): JSX.Element;
5
+ }): JSX.Element | null;
@@ -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, "children") || 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)({
@@ -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-magneta-1: #291321;
69
- --color-magneta-2: #40162f;
70
- --color-magneta-3: #551c3b;
71
- --color-magneta-4: #75204f;
72
- --color-magneta-5: #a02669;
73
- --color-magneta-6: #cb2b83;
74
- --color-magneta-7: #e0529c;
75
- --color-magneta-8: #f37fb7;
76
- --color-magneta-9: #f8a8cc;
77
- --color-magneta-10: #fad2e3;
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-green-1);
135
- --color-success-bg-hover: var(--color-green-2);
136
- --color-success-border: var(--color-green-3);
137
- --color-success-border-hover: var(--color-green-4);
138
- --color-success-hover: var(--color-green-7);
139
- --color-success-base: var(--color-green-6);
140
- --color-success-active: var(--color-green-5);
141
- --color-success-text-hover: var(--color-green-8);
142
- --color-success-text: var(--color-green-9);
143
- --color-success-text-active: var(--color-green-10);
144
-
145
- --color-warning-bg: var(--color-gold-1);
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-5);
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-1);
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-5);
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-5);
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 = 'inherit') => (color === null || color === void 0 ? void 0 : color.startsWith('--')) ? `var(${color})` : 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.18.3-patch.2",
3
+ "version": "0.18.3-patch.5",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -54,6 +54,7 @@ export const LanguagePicker = (props: LanguagePickerProps) => {
54
54
  alignment={props.alignment}
55
55
  icon={<LanguageIcon />}
56
56
  onlyIcon={props.onlyIcon}
57
+ withArrow={false}
57
58
  />
58
59
  );
59
60
  };
@@ -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 setIsAddingFilter={setIsAddingFilter} filters={filters} />
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.small} {
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.small} {
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.small} {
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.small} {
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
- {item.tags && (
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
  }
@@ -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-green-6); // @presenter 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