@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
|
@@ -75,7 +75,7 @@ export const sidebar = css`
|
|
|
75
75
|
*/
|
|
76
76
|
--sidebar-item-border-radius: 6px; // @presenter BorderRadius
|
|
77
77
|
|
|
78
|
-
/**
|
|
78
|
+
/**
|
|
79
79
|
* @tokens Sidebar item icon
|
|
80
80
|
*/
|
|
81
81
|
--sidebar-item-icon-size: var(--spacing-xl);
|
|
@@ -161,7 +161,7 @@ export const sidebar = css`
|
|
|
161
161
|
--sidebar-back-padding-left: var(--spacing-xs); // @presenter Spacing
|
|
162
162
|
--sidebar-back-button-icon: none;
|
|
163
163
|
|
|
164
|
-
/**
|
|
164
|
+
/**
|
|
165
165
|
* @tokens Sidebar footer
|
|
166
166
|
*/
|
|
167
167
|
--sidebar-footer-padding-vertical: var(--spacing-sm); // @presenter Spacing
|
|
@@ -175,7 +175,7 @@ export const sidebar = css`
|
|
|
175
175
|
--sidebar-controls-collapsed-gap: var(--spacing-xs); // @presenter Spacing
|
|
176
176
|
--sidebar-controls-collapsed-padding-vertical: var(--spacing-xs); // @presenter Spacing
|
|
177
177
|
--sidebar-controls-collapsed-padding-horizontal: var(--spacing-xxs); // @presenter Spacing
|
|
178
|
-
|
|
178
|
+
|
|
179
179
|
// @tokens End
|
|
180
180
|
`;
|
|
181
181
|
|
|
@@ -208,6 +208,7 @@ export const versionPicker = css`
|
|
|
208
208
|
--version-picker-list-item-vertical-padding: var(--select-list-item-vertical-padding); // @presenter Spacing
|
|
209
209
|
--version-picker-list-item-border-radius: var(--select-list-item-border-radius); // @presenter BorderRadius
|
|
210
210
|
--version-picker-list-item-active-background-color: var(--select-list-item-active-background-color); // @presenter Color
|
|
211
|
-
|
|
211
|
+
--version-picker-list-item-hover-background-color: var(--select-list-item-hover-background-color); // @presenter Color
|
|
212
|
+
|
|
212
213
|
// @tokens End
|
|
213
214
|
`;
|
|
@@ -15,6 +15,7 @@ export const tag = css`
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
--tag-padding: 1px 8px; //@presenter Spacing
|
|
18
|
+
--tag-large-padding: 4px 16px; //@presenter Spacing
|
|
18
19
|
--tag-margin: 0 5px 0 0; //@presenter Spacing
|
|
19
20
|
--tag-gap: 5px; //@presenter Spacing
|
|
20
21
|
|
|
@@ -39,7 +40,7 @@ export const tag = css`
|
|
|
39
40
|
*/
|
|
40
41
|
|
|
41
42
|
.tag-size-large {
|
|
42
|
-
--tag-padding:
|
|
43
|
+
--tag-padding: var(--tag-large-padding);
|
|
43
44
|
--tag-font-size: var(--font-size-regular);
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -57,7 +58,7 @@ export const tag = css`
|
|
|
57
58
|
.tag-approved,
|
|
58
59
|
.tag-get {
|
|
59
60
|
--tag-color: var(--color-success-active); // @presenter Color
|
|
60
|
-
--tag-background-color:
|
|
61
|
+
--tag-background-color: var(--color-success-bg); // @presenter Color
|
|
61
62
|
--tag-border-color: var(--color-success-active); // @presenter Color
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -75,7 +76,7 @@ export const tag = css`
|
|
|
75
76
|
.tag-deprecated,
|
|
76
77
|
.tag-put {
|
|
77
78
|
--tag-color: var(--color-warning-active); // @presenter Color
|
|
78
|
-
--tag-background-color:
|
|
79
|
+
--tag-background-color: var(--color-warning-bg); // @presenter Color
|
|
79
80
|
--tag-border-color: var(--color-warning-active); // @presenter Color
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -83,42 +84,42 @@ export const tag = css`
|
|
|
83
84
|
.tag-processing,
|
|
84
85
|
.tag-post {
|
|
85
86
|
--tag-color: var(--color-info-active); // @presenter Color
|
|
86
|
-
--tag-background-color:
|
|
87
|
+
--tag-background-color: var(--color-info-bg); // @presenter Color
|
|
87
88
|
--tag-border-color: var(--color-info-active); // @presenter Color
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
.tag-purple,
|
|
91
92
|
.tag-head {
|
|
92
93
|
--tag-color: var(--color-purple-7); // @presenter Color
|
|
93
|
-
--tag-background-color:
|
|
94
|
+
--tag-background-color: var(--color-purple-1); // @presenter Color
|
|
94
95
|
--tag-border-color: var(--color-purple-7); // @presenter Color
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
.tag-cyan,
|
|
98
99
|
.tag-option {
|
|
99
100
|
--tag-color: var(--color-cyan-7); // @presenter Color
|
|
100
|
-
--tag-background-color:
|
|
101
|
+
--tag-background-color: var(--color-cyan-1); // @presenter Color
|
|
101
102
|
--tag-border-color: var(--color-cyan-7); // @presenter Color
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
.tag-yellow,
|
|
105
106
|
.tag-patch {
|
|
106
107
|
--tag-color: var(--color-yellow-7); // @presenter Color
|
|
107
|
-
--tag-background-color:
|
|
108
|
+
--tag-background-color: var(--color-yellow-1); // @presenter Color
|
|
108
109
|
--tag-border-color: var(--color-yellow-7); // @presenter Color
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
.tag-geekblue,
|
|
112
113
|
.tag-link {
|
|
113
114
|
--tag-color: var(--color-geekblue-7); // @presenter Color
|
|
114
|
-
--tag-background-color:
|
|
115
|
+
--tag-background-color: var(--color-geekblue-1); // @presenter Color
|
|
115
116
|
--tag-border-color: var(--color-geekblue-7); // @presenter Color
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
.tag-magneta,
|
|
119
120
|
.tag-hook {
|
|
120
121
|
--tag-color: var(--color-magneta-7); // @presenter Color
|
|
121
|
-
--tag-background-color:
|
|
122
|
+
--tag-background-color: var(--color-magneta-1); // @presenter Color
|
|
122
123
|
--tag-border-color: var(--color-magneta-7); // @presenter Color
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -9,6 +9,6 @@ export const TileHeader = styled.h3.attrs<{ className?: string }>(({ className }
|
|
|
9
9
|
color: ${(props) => props.color || 'var(--h3-color)'};
|
|
10
10
|
font-family: var(--h3-font-family);
|
|
11
11
|
&& {
|
|
12
|
-
margin:
|
|
12
|
+
margin: 0 0 var(--h3-margin-bottom);
|
|
13
13
|
}
|
|
14
14
|
`;
|
package/src/config.ts
CHANGED
|
@@ -373,7 +373,10 @@ const catalogSchema = {
|
|
|
373
373
|
slug: { type: 'string' },
|
|
374
374
|
filters: { type: 'array', items: catalogFilterSchema },
|
|
375
375
|
groupByFirstFilter: { type: 'boolean' },
|
|
376
|
-
filterValuesCasing: {
|
|
376
|
+
filterValuesCasing: {
|
|
377
|
+
type: 'string',
|
|
378
|
+
enum: ['sentence', 'original', 'lowercase', 'uppercase'],
|
|
379
|
+
},
|
|
377
380
|
items: navItemsSchema,
|
|
378
381
|
requiredPermission: { type: 'string' },
|
|
379
382
|
separateVersions: { type: 'boolean' },
|
|
@@ -417,6 +420,7 @@ export const themeConfigSchema = {
|
|
|
417
420
|
properties: {
|
|
418
421
|
items: navItemsSchema,
|
|
419
422
|
copyrightText: { type: 'string' },
|
|
423
|
+
logo: hideConfigSchema,
|
|
420
424
|
...hideConfigSchema.properties,
|
|
421
425
|
},
|
|
422
426
|
additionalProperties: false,
|
|
@@ -721,3 +725,9 @@ export type GoogleAnalyticsConfig = FromSchema<typeof googleAnalyticsConfigSchem
|
|
|
721
725
|
export type CatalogConfig = FromSchema<typeof catalogSchema>;
|
|
722
726
|
export type CatalogFilterConfig = FromSchema<typeof catalogFilterSchema>;
|
|
723
727
|
export type ScorecardConfig = FromSchema<typeof scorecardConfigSchema>;
|
|
728
|
+
|
|
729
|
+
export enum ScorecardStatus {
|
|
730
|
+
BelowMinimum = 'Below minimum',
|
|
731
|
+
Highest = 'Highest',
|
|
732
|
+
Minimum = 'Minimum',
|
|
733
|
+
}
|
package/src/globalStyle.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { languagePicker } from '@theme/I18n';
|
|
|
20
20
|
import { select } from '@theme/components/Select';
|
|
21
21
|
import { userProfile, userProfileDropdown } from '@theme/components/Profile';
|
|
22
22
|
import { dropdown } from '@theme/components/Dropdown';
|
|
23
|
-
import { admonition, markdown } from '@theme/components/Markdown';
|
|
23
|
+
import { admonition, markdown, mermaid } from '@theme/components/Markdown';
|
|
24
24
|
import { tooltip } from '@theme/components/Tooltip';
|
|
25
25
|
import { lastUpdated } from '@theme/components/LastUpdated';
|
|
26
26
|
import { logo } from '@theme/components/NavbarLogo';
|
|
@@ -87,16 +87,16 @@ const themeColors = css`
|
|
|
87
87
|
--color-purple-9: #22075e;
|
|
88
88
|
--color-purple-10: #120338;
|
|
89
89
|
|
|
90
|
-
--color-
|
|
91
|
-
--color-
|
|
92
|
-
--color-
|
|
93
|
-
--color-
|
|
94
|
-
--color-
|
|
95
|
-
--color-
|
|
96
|
-
--color-
|
|
97
|
-
--color-
|
|
98
|
-
--color-
|
|
99
|
-
--color-
|
|
90
|
+
--color-magenta-1: #fff0f6;
|
|
91
|
+
--color-magenta-2: #ffd6e7;
|
|
92
|
+
--color-magenta-3: #ffadd2;
|
|
93
|
+
--color-magenta-4: #ff85c0;
|
|
94
|
+
--color-magenta-5: #f759ab;
|
|
95
|
+
--color-magenta-6: #eb2f96;
|
|
96
|
+
--color-magenta-7: #c41d7f;
|
|
97
|
+
--color-magenta-8: #9e1068;
|
|
98
|
+
--color-magenta-9: #780650;
|
|
99
|
+
--color-magenta-10: #520339;
|
|
100
100
|
|
|
101
101
|
--color-cyan-1: #e6fffb;
|
|
102
102
|
--color-cyan-2: #b5f5ec;
|
|
@@ -153,16 +153,16 @@ const themeColors = css`
|
|
|
153
153
|
--color-primary-text: #161087;
|
|
154
154
|
--color-primary-text-active: #0d086e;
|
|
155
155
|
|
|
156
|
-
--color-success-bg: var(--color-
|
|
157
|
-
--color-success-bg-hover: var(--color-
|
|
158
|
-
--color-success-border: var(--color-
|
|
159
|
-
--color-success-border-hover: var(--color-
|
|
160
|
-
--color-success-hover: var(--color-
|
|
161
|
-
--color-success-base: var(--color-
|
|
162
|
-
--color-success-active: var(--color-
|
|
163
|
-
--color-success-text-hover: var(--color-
|
|
164
|
-
--color-success-text: var(--color-
|
|
165
|
-
--color-success-text-active: var(--color-
|
|
156
|
+
--color-success-bg: var(--color-cyan-1);
|
|
157
|
+
--color-success-bg-hover: var(--color-cyan-2);
|
|
158
|
+
--color-success-border: var(--color-cyan-3);
|
|
159
|
+
--color-success-border-hover: var(--color-cyan-4);
|
|
160
|
+
--color-success-hover: var(--color-cyan-5);
|
|
161
|
+
--color-success-base: var(--color-cyan-6);
|
|
162
|
+
--color-success-active: var(--color-cyan-7);
|
|
163
|
+
--color-success-text-hover: var(--color-cyan-8);
|
|
164
|
+
--color-success-text: var(--color-cyan-9);
|
|
165
|
+
--color-success-text-active: var(--color-cyan-10);
|
|
166
166
|
|
|
167
167
|
--color-warning-bg: var(--color-gold-1);
|
|
168
168
|
--color-warning-bg-hover: var(--color-gold-2);
|
|
@@ -177,7 +177,7 @@ const themeColors = css`
|
|
|
177
177
|
|
|
178
178
|
--color-error-bg: var(--color-red-1);
|
|
179
179
|
--color-error-bg-hover: var(--color-red-2);
|
|
180
|
-
--color-error-border: var(--color-red-
|
|
180
|
+
--color-error-border: var(--color-red-7);
|
|
181
181
|
--color-error-border-hover: var(--color-red-4);
|
|
182
182
|
--color-error-hover: var(--color-red-5);
|
|
183
183
|
--color-error-base: var(--color-red-6);
|
|
@@ -216,6 +216,7 @@ const themeColors = css`
|
|
|
216
216
|
--bg-base: #ffffff; // The default elevation is the baseline with respect to all other layers.
|
|
217
217
|
--bg-sunken: #f1f1f1; // Sunken is the lowest elevation available.
|
|
218
218
|
--bg-raised: #fafafa; // Cards, elements, inputs
|
|
219
|
+
--bg-raised-light: #fafafa; // Always light
|
|
219
220
|
--bg-overlay: #f2f2f2; // Overlay is the highest elevation available. Use for hovers
|
|
220
221
|
--bg-modal-overlay: #f2f2f2c2; // Overlay is the highest elevation available. Use for hovers
|
|
221
222
|
|
|
@@ -267,13 +268,13 @@ const typography = 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
|
|
@@ -419,7 +420,7 @@ const headingsTypography = css`
|
|
|
419
420
|
--h3-font-family: var(--heading-font-family); // @presenter FontFamily
|
|
420
421
|
--h3-font-weight: var(--heading-font-weight); // @presenter FontWeight
|
|
421
422
|
--h3-font-size: 18px; // @presenter FontSize
|
|
422
|
-
--h3-line-height:
|
|
423
|
+
--h3-line-height: 22px; // @presenter LineHeight
|
|
423
424
|
--h3-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
424
425
|
--h3-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
425
426
|
--h3-text-color: var(--heading-text-color); // @presenter Color
|
|
@@ -593,9 +594,9 @@ const apiReferenceDocs = css`
|
|
|
593
594
|
* @presenter Color
|
|
594
595
|
*/
|
|
595
596
|
|
|
596
|
-
--schema-recursive-text-color: var(--color-warning); // @presenter Color
|
|
597
|
+
--schema-recursive-text-color: var(--color-warning-active); // @presenter Color
|
|
597
598
|
--schema-recursive-background-color: var(--color-warning-bg); // @presenter Color
|
|
598
|
-
--schema-recursive-border-color: var(--color-warning-
|
|
599
|
+
--schema-recursive-border-color: var(--color-warning-active); // @presenter Color
|
|
599
600
|
|
|
600
601
|
/**
|
|
601
602
|
* @tokens GraphQL Docs Reference Schema Non null label
|
|
@@ -701,9 +702,9 @@ const badges = css`
|
|
|
701
702
|
* @tokens Deprecated Badge
|
|
702
703
|
*/
|
|
703
704
|
|
|
704
|
-
--badge-deprecated-text-color: var(--color-warning); // @presenter Color
|
|
705
|
+
--badge-deprecated-text-color: var(--color-warning-active); // @presenter Color
|
|
705
706
|
--badge-deprecated-background-color: var(--color-warning-bg); // @presenter Color
|
|
706
|
-
--badge-deprecated-border-color: var(--color-warning-
|
|
707
|
+
--badge-deprecated-border-color: var(--color-warning-active); // @presenter Color
|
|
707
708
|
--badge-deprecated-border: 1px solid var(--badge-deprecated-border-color); // @presenter Border
|
|
708
709
|
--badge-deprecated-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
709
710
|
|
|
@@ -949,6 +950,7 @@ export const styles = css`
|
|
|
949
950
|
${loadProgressBar}
|
|
950
951
|
${logo}
|
|
951
952
|
${markdown}
|
|
953
|
+
${mermaid}
|
|
952
954
|
${menu}
|
|
953
955
|
${mobileMenu}
|
|
954
956
|
${modal}
|
|
@@ -3,15 +3,14 @@ import { useLocation } from 'react-router-dom';
|
|
|
3
3
|
|
|
4
4
|
import type { Dispatch, SetStateAction } from 'react';
|
|
5
5
|
|
|
6
|
+
import useModalScrollLock from '@theme/hooks/useModalScrollLock';
|
|
7
|
+
|
|
6
8
|
export function useMobileMenu(initialState = false): [boolean, Dispatch<SetStateAction<boolean>>] {
|
|
7
9
|
const location = useLocation();
|
|
8
10
|
const [isOpen, setIsOpen] = useState(initialState);
|
|
9
11
|
|
|
10
12
|
useEffect(() => setIsOpen(false), [location.pathname, location.hash]);
|
|
11
|
-
|
|
12
|
-
if (isOpen) document.body.classList.add('overflow-hidden');
|
|
13
|
-
else document.body.classList.remove('overflow-hidden');
|
|
14
|
-
}, [isOpen]);
|
|
13
|
+
useModalScrollLock(isOpen);
|
|
15
14
|
|
|
16
15
|
return [isOpen, setIsOpen];
|
|
17
16
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
export default function useModalScrollLock(isOpen: boolean) {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (isOpen) document.body.classList.add('overflow-hidden');
|
|
6
|
+
else document.body.classList.remove('overflow-hidden');
|
|
7
|
+
}, [isOpen]);
|
|
8
|
+
|
|
9
|
+
return () => {
|
|
10
|
+
document.body.classList.remove('overflow-hidden');
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -98,13 +98,8 @@ function Icon({ type, className }: AlertIconProps) {
|
|
|
98
98
|
export const AlertIcon = styled(Icon).attrs(() => ({
|
|
99
99
|
'data-component-name': 'icons/AlertIcon/AlertIcon',
|
|
100
100
|
}))`
|
|
101
|
-
position: absolute;
|
|
102
|
-
left: var(--admonition-padding-horizontal);
|
|
103
|
-
top: 50%;
|
|
104
|
-
transform: translateY(-50%);
|
|
105
101
|
width: var(--admonition-icon-size);
|
|
106
102
|
height: var(--admonition-icon-size);
|
|
107
|
-
margin-right: var(--admonition-padding-horizontal);
|
|
108
103
|
flex-shrink: 0;
|
|
109
104
|
|
|
110
105
|
fill: ${({ type }) => `var(--admonition-${type}-icon-color)`};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CatalogFilterConfig } from
|
|
1
|
+
import { CatalogFilterConfig, ScorecardStatus } from '@theme';
|
|
2
2
|
|
|
3
3
|
export type FilteredCatalog = {
|
|
4
4
|
groups: { title: string; items: CatalogItem[] }[];
|
|
@@ -33,5 +33,11 @@ export type CatalogItem = {
|
|
|
33
33
|
description?: string;
|
|
34
34
|
image?: string;
|
|
35
35
|
docsLink?: string;
|
|
36
|
+
|
|
37
|
+
scorecardStatus?: ScorecardStatus;
|
|
38
|
+
scorecardLevel?: string;
|
|
39
|
+
scoreCardSlug?: string;
|
|
40
|
+
tags?: unknown[];
|
|
41
|
+
|
|
36
42
|
[k: string]: unknown;
|
|
37
43
|
};
|
package/src/ui/Highlight.tsx
CHANGED
|
@@ -3,12 +3,12 @@ import { findAll } from 'highlight-words-core';
|
|
|
3
3
|
|
|
4
4
|
export const HighlightContext = React.createContext<string[]>([]);
|
|
5
5
|
|
|
6
|
-
export function Highlight(props: { children: React.ReactChildren | string }): JSX.Element {
|
|
6
|
+
export function Highlight(props: { children: React.ReactChildren | string }): JSX.Element | null {
|
|
7
7
|
const { children } = props;
|
|
8
8
|
const searchWords = React.useContext(HighlightContext);
|
|
9
9
|
|
|
10
10
|
if (!searchWords.length) {
|
|
11
|
-
return <>children</>
|
|
11
|
+
return children ? <>{children}</> : null;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function highlight(str: string, childIdx: number = 0) {
|
package/src/ui/darkColors.tsx
CHANGED
|
@@ -63,16 +63,16 @@ export const darkMode = css`
|
|
|
63
63
|
--color-purple-9: #cda8f0;
|
|
64
64
|
--color-purple-10: #ebd7fa;
|
|
65
65
|
|
|
66
|
-
--color-
|
|
67
|
-
--color-
|
|
68
|
-
--color-
|
|
69
|
-
--color-
|
|
70
|
-
--color-
|
|
71
|
-
--color-
|
|
72
|
-
--color-
|
|
73
|
-
--color-
|
|
74
|
-
--color-
|
|
75
|
-
--color-
|
|
66
|
+
--color-magenta-1: #291321;
|
|
67
|
+
--color-magenta-2: #40162f;
|
|
68
|
+
--color-magenta-3: #551c3b;
|
|
69
|
+
--color-magenta-4: #75204f;
|
|
70
|
+
--color-magenta-5: #a02669;
|
|
71
|
+
--color-magenta-6: #cb2b83;
|
|
72
|
+
--color-magenta-7: #e0529c;
|
|
73
|
+
--color-magenta-8: #f37fb7;
|
|
74
|
+
--color-magenta-9: #f8a8cc;
|
|
75
|
+
--color-magenta-10: #fad2e3;
|
|
76
76
|
|
|
77
77
|
--color-cyan-1: #112123;
|
|
78
78
|
--color-cyan-2: #113536;
|
|
@@ -129,35 +129,35 @@ export const darkMode = css`
|
|
|
129
129
|
--color-primary-text: #d6dfff;
|
|
130
130
|
--color-primary-text-active: #ebf0ff;
|
|
131
131
|
|
|
132
|
-
--color-success-bg: var(--color-
|
|
133
|
-
--color-success-bg-hover: var(--color-
|
|
134
|
-
--color-success-border: var(--color-
|
|
135
|
-
--color-success-border-hover: var(--color-
|
|
136
|
-
--color-success-hover: var(--color-
|
|
137
|
-
--color-success-base: var(--color-
|
|
138
|
-
--color-success-active: var(--color-
|
|
139
|
-
--color-success-text-hover: var(--color-
|
|
140
|
-
--color-success-text: var(--color-
|
|
141
|
-
--color-success-text-active: var(--color-
|
|
142
|
-
|
|
143
|
-
--color-warning-bg: var(--color-gold-
|
|
132
|
+
--color-success-bg: var(--color-cyan-3);
|
|
133
|
+
--color-success-bg-hover: var(--color-cyan-2);
|
|
134
|
+
--color-success-border: var(--color-cyan-3);
|
|
135
|
+
--color-success-border-hover: var(--color-cyan-4);
|
|
136
|
+
--color-success-hover: var(--color-cyan-7);
|
|
137
|
+
--color-success-base: var(--color-cyan-6);
|
|
138
|
+
--color-success-active: var(--color-cyan-7);
|
|
139
|
+
--color-success-text-hover: var(--color-cyan-8);
|
|
140
|
+
--color-success-text: var(--color-cyan-9);
|
|
141
|
+
--color-success-text-active: var(--color-cyan-10);
|
|
142
|
+
|
|
143
|
+
--color-warning-bg: var(--color-gold-3);
|
|
144
144
|
--color-warning-bg-hover: var(--color-gold-2);
|
|
145
145
|
--color-warning-border: var(--color-gold-3);
|
|
146
146
|
--color-warning-border-hover: var(--color-gold-4);
|
|
147
147
|
--color-warning-hover: var(--color-gold-7);
|
|
148
148
|
--color-warning-base: var(--color-gold-6);
|
|
149
|
-
--color-warning-active: var(--color-gold-
|
|
149
|
+
--color-warning-active: var(--color-gold-7);
|
|
150
150
|
--color-warning-text-hover: var(--color-gold-8);
|
|
151
151
|
--color-warning-text: var(--color-gold-9);
|
|
152
152
|
--color-warning-text-active: var(--color-gold-10);
|
|
153
153
|
|
|
154
|
-
--color-error-bg: var(--color-red-
|
|
154
|
+
--color-error-bg: var(--color-red-3);
|
|
155
155
|
--color-error-bg-hover: var(--color-red-2);
|
|
156
156
|
--color-error-border: var(--color-red-3);
|
|
157
157
|
--color-error-border-hover: var(--color-red-4);
|
|
158
158
|
--color-error-hover: var(--color-red-7);
|
|
159
159
|
--color-error-base: var(--color-red-6);
|
|
160
|
-
--color-error-active: var(--color-red-
|
|
160
|
+
--color-error-active: var(--color-red-7);
|
|
161
161
|
--color-error-text-hover: var(--color-red-8);
|
|
162
162
|
--color-error-text: var(--color-red-9);
|
|
163
163
|
--color-error-text-active: var(--color-red-10);
|
|
@@ -168,7 +168,7 @@ export const darkMode = css`
|
|
|
168
168
|
--color-info-border-hover: var(--color-blue-4);
|
|
169
169
|
--color-info-hover: var(--color-blue-7);
|
|
170
170
|
--color-info-base: var(--color-blue-6);
|
|
171
|
-
--color-info-active: var(--color-blue-
|
|
171
|
+
--color-info-active: var(--color-blue-7);
|
|
172
172
|
--color-info-text-hover: var(--color-blue-8);
|
|
173
173
|
--color-info-text: var(--color-blue-9);
|
|
174
174
|
--color-info-text-active: var(--color-blue-10);
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export const getCssColorVariable = (
|
|
2
|
-
color
|
|
1
|
+
export const getCssColorVariable = (
|
|
2
|
+
color: string | undefined,
|
|
3
|
+
defaultValue = 'currentColor',
|
|
4
|
+
): string => (color?.startsWith('--') ? `var(${color})` : color || defaultValue);
|