@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.
- package/lib/I18n/LanguagePicker.js +1 -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 +1 -1
- package/lib/components/Filter/Filter.d.ts +2 -1
- package/lib/components/Filter/Filter.js +12 -4
- 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/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.js +3 -4
- package/lib/components/Separator/SeparatorItem.js +1 -0
- package/lib/components/Sidebar/HeaderWrapper.js +2 -2
- package/lib/components/Tag/styledVariables.js +10 -9
- package/lib/config.d.ts +25 -2
- package/lib/config.js +12 -3
- 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 +17 -10
- package/src/components/Catalog/CatalogCard.tsx +26 -3
- package/src/components/CodeBlock/styledVariables.ts +1 -1
- package/src/components/Filter/Filter.tsx +19 -6
- 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/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 +3 -4
- package/src/components/Separator/SeparatorItem.tsx +1 -0
- package/src/components/Sidebar/HeaderWrapper.tsx +2 -2
- package/src/components/Tag/styledVariables.ts +10 -9
- package/src/config.ts +11 -1
- 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
|
@@ -8,13 +8,14 @@ import type { ResolvedFilter } from '@theme/types/portal/src/shared/types/catalo
|
|
|
8
8
|
import { useTranslate } from '@portal/hooks';
|
|
9
9
|
import { CheckboxIcon } from '@theme/icons';
|
|
10
10
|
import { Select } from '@theme/components/Select';
|
|
11
|
+
import type { ThemeConfig } from '@theme/config';
|
|
11
12
|
|
|
12
13
|
export function Filter({
|
|
13
14
|
filter,
|
|
14
15
|
filterValuesCasing,
|
|
15
16
|
}: {
|
|
16
17
|
filter: ResolvedFilter & { selectedOptions: any };
|
|
17
|
-
filterValuesCasing?: '
|
|
18
|
+
filterValuesCasing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'];
|
|
18
19
|
}) {
|
|
19
20
|
const { translate } = useTranslate();
|
|
20
21
|
const translationKeys = {
|
|
@@ -73,7 +74,6 @@ export function Filter({
|
|
|
73
74
|
<FilterTitle>{translate(filter.titleTranslationKey, filter.title)} </FilterTitle>
|
|
74
75
|
{filter.type === 'select' ? (
|
|
75
76
|
<StyledSelect
|
|
76
|
-
withArrow={true}
|
|
77
77
|
selected={selectedOptionComponent}
|
|
78
78
|
options={selectOptions.map((option) => option.component)}
|
|
79
79
|
/>
|
|
@@ -140,11 +140,24 @@ export function Filter({
|
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
function changeCasing(
|
|
144
|
-
|
|
143
|
+
function changeCasing(
|
|
144
|
+
str: string,
|
|
145
|
+
casing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'],
|
|
146
|
+
) {
|
|
147
|
+
if (!casing || casing === 'original' || !str) return str;
|
|
145
148
|
|
|
146
|
-
|
|
147
|
-
|
|
149
|
+
if (casing === 'lowercase') {
|
|
150
|
+
return str.toLowerCase();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (casing === 'uppercase') {
|
|
154
|
+
return str.toUpperCase();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (casing === 'sentence') {
|
|
158
|
+
const words = str.split(/[\s-_]+/);
|
|
159
|
+
return words.map((word) => word[0].toUpperCase() + word.slice(1).toLowerCase()).join(' ');
|
|
160
|
+
}
|
|
148
161
|
}
|
|
149
162
|
|
|
150
163
|
const FilterGroup = styled.div`
|
|
@@ -2,9 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Button } from '@theme';
|
|
4
4
|
|
|
5
|
+
import type { ThemeConfig } from '@theme';
|
|
6
|
+
|
|
5
7
|
import { useTranslate } from '@portal/hooks';
|
|
6
8
|
import { FilterControls } from '@theme/components/Catalog';
|
|
7
|
-
import { Filter } from '@theme/components/Filter
|
|
9
|
+
import { Filter } from '@theme/components/Filter';
|
|
10
|
+
import { Sidebar } from '@theme/components/Sidebar';
|
|
8
11
|
import type { ResolvedFilter } from '@theme/types/portal/src/shared/types/catalog';
|
|
9
12
|
import { StyledInput } from '@theme/components/Filter/FilterPopover';
|
|
10
13
|
|
|
@@ -13,7 +16,7 @@ interface FilterContentProps {
|
|
|
13
16
|
filters: ResolvedFilter[];
|
|
14
17
|
filterTerm: string;
|
|
15
18
|
isMobile: boolean;
|
|
16
|
-
filterValuesCasing?: '
|
|
19
|
+
filterValuesCasing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'];
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export function FilterContent({
|
|
@@ -68,7 +71,7 @@ export function FilterContent({
|
|
|
68
71
|
);
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
const FilterContentWrapper = styled
|
|
74
|
+
const FilterContentWrapper = styled(Sidebar)<{ isMobile?: boolean }>`
|
|
72
75
|
width: var(--sidebar-width);
|
|
73
76
|
display: none;
|
|
74
77
|
|
|
@@ -77,7 +80,7 @@ const FilterContentWrapper = styled.div<{ isMobile?: boolean }>`
|
|
|
77
80
|
margin: var(--filter-content-clear-button-margin);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
${({ theme, isMobile }) => !isMobile && theme.mediaQueries.
|
|
83
|
+
${({ theme, isMobile }) => !isMobile && theme.mediaQueries.medium} {
|
|
81
84
|
display: block;
|
|
82
85
|
border-right: 1px solid var(--filter-content-border-color);
|
|
83
86
|
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Filter, FilterControls } from '@theme';
|
|
4
4
|
|
|
5
|
+
import type { ThemeConfig } from '@theme';
|
|
6
|
+
|
|
5
7
|
import { FilterContent, FilterItems } from '@theme/components/Filter/FilterContent';
|
|
6
8
|
import { useTranslate } from '@portal/hooks';
|
|
7
9
|
import type { ResolvedFilter } from '@theme/types/portal/src/shared/types/catalog';
|
|
@@ -9,13 +11,20 @@ import type { ResolvedFilter } from '@theme/types/portal/src/shared/types/catalo
|
|
|
9
11
|
interface FilterPopoverProps {
|
|
10
12
|
setIsAddingFilter: (value: boolean) => void;
|
|
11
13
|
filters: ResolvedFilter[];
|
|
14
|
+
filterValuesCasing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'];
|
|
12
15
|
}
|
|
13
16
|
|
|
14
|
-
export function FilterPopover({
|
|
17
|
+
export function FilterPopover({
|
|
18
|
+
setIsAddingFilter,
|
|
19
|
+
filters,
|
|
20
|
+
filterValuesCasing,
|
|
21
|
+
}: FilterPopoverProps) {
|
|
15
22
|
const [filterTerm, setFilterTerm] = React.useState('');
|
|
16
23
|
const filteredFilters = filters
|
|
17
24
|
.map((filter) => {
|
|
18
|
-
const options = filter.options.filter((option) =>
|
|
25
|
+
const options = filter.options.filter((option) =>
|
|
26
|
+
option.value.toLowerCase().includes(filterTerm.toLowerCase()),
|
|
27
|
+
);
|
|
19
28
|
return options.length
|
|
20
29
|
? {
|
|
21
30
|
...filter,
|
|
@@ -43,6 +52,7 @@ export function FilterPopover({ setIsAddingFilter, filters }: FilterPopoverProps
|
|
|
43
52
|
setFilterTerm={setFilterTerm}
|
|
44
53
|
filters={filters}
|
|
45
54
|
filterTerm={filterTerm}
|
|
55
|
+
filterValuesCasing={filterValuesCasing}
|
|
46
56
|
isMobile
|
|
47
57
|
/>
|
|
48
58
|
<FilterControls>
|
|
@@ -72,7 +82,7 @@ const FilterPopoverWrapper = styled.aside<{ isActiveInMobileMode?: boolean }>`
|
|
|
72
82
|
background-color: var(--filter-popover-background-color);
|
|
73
83
|
display: block;
|
|
74
84
|
|
|
75
|
-
${({ theme }) => theme.mediaQueries.
|
|
85
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
76
86
|
display: none;
|
|
77
87
|
}
|
|
78
88
|
`;
|
|
@@ -30,7 +30,7 @@ export const filter = css`
|
|
|
30
30
|
--filter-option-count-background-color: var(--bg-raised);
|
|
31
31
|
|
|
32
32
|
--filter-content-border-color: var(--border-secondary);
|
|
33
|
-
--filter-content-items-padding: 0 var(--
|
|
33
|
+
--filter-content-items-padding: 0 var(--spacing-lg);
|
|
34
34
|
--filter-content-clear-button-margin: var(--spacing-base) auto 0 auto;
|
|
35
35
|
--filter-content-clear-button-width: calc(var(--spacing-unit) * 40);
|
|
36
36
|
--filter-controls-background-color: var(--bg-base);
|
|
@@ -83,6 +83,8 @@ const FooterColumnContainer = styled.div`
|
|
|
83
83
|
flex: 1;
|
|
84
84
|
margin: 0 0 var(--mobile-footer-column-margin-bottom) 0;
|
|
85
85
|
min-width: var(--footer-column-min-width);
|
|
86
|
+
align-content: center;
|
|
87
|
+
flex-wrap: wrap;
|
|
86
88
|
|
|
87
89
|
${({ theme }) => theme.mediaQueries.small} {
|
|
88
90
|
text-align: left;
|
|
@@ -42,7 +42,7 @@ export const footer = css`
|
|
|
42
42
|
--footer-copyright-text-align: start;
|
|
43
43
|
|
|
44
44
|
--footer-logo-display: block;
|
|
45
|
-
--footer-logo-margin-right:
|
|
45
|
+
--footer-logo-margin-right: 0; // @presenter Spacing
|
|
46
46
|
--footer-logo-margin-bottom: var(--spacing-xl); // @presenter Spacing
|
|
47
47
|
|
|
48
48
|
--footer-language-picker-display: block;
|
|
@@ -31,18 +31,20 @@ export function Admonition({
|
|
|
31
31
|
data-hash={dataHash}
|
|
32
32
|
>
|
|
33
33
|
<AlertIcon type={type} />
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
<TextContainer>
|
|
35
|
+
{name ? <Heading type={type}>{name}</Heading> : null}
|
|
36
|
+
<Content>{children}</Content>
|
|
37
|
+
</TextContainer>
|
|
36
38
|
</Wrapper>
|
|
37
39
|
);
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
const Wrapper = styled.div<AdmonitionTypeProps>`
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
gap: var(--spacing-base);
|
|
43
46
|
margin: var(--admonition-margin-vertical) var(--admonition-margin-horizontal);
|
|
44
47
|
padding: var(--admonition-padding-vertical) var(--admonition-padding-horizontal);
|
|
45
|
-
padding-left: calc(var(--admonition-padding-horizontal) * 2 + var(--admonition-icon-size));
|
|
46
48
|
border-radius: var(--admonition-border-radius);
|
|
47
49
|
font-size: var(--admonition-font-size);
|
|
48
50
|
font-weight: var(--admonition-font-weight);
|
|
@@ -58,10 +60,13 @@ const Wrapper = styled.div<AdmonitionTypeProps>`
|
|
|
58
60
|
`}
|
|
59
61
|
`;
|
|
60
62
|
|
|
61
|
-
const
|
|
62
|
-
display:
|
|
63
|
-
|
|
63
|
+
const TextContainer = styled.div`
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: var(--spacing-unit);
|
|
67
|
+
`;
|
|
64
68
|
|
|
69
|
+
const Heading = styled.div<AdmonitionTypeProps>`
|
|
65
70
|
letter-spacing: var(--admonition-heading-letter-spacing);
|
|
66
71
|
color: ${({ type }) => `var(--admonition-${type}-heading-text-color)`};
|
|
67
72
|
|
|
@@ -7,11 +7,11 @@ export const admonition = css`
|
|
|
7
7
|
* @tokens Admonition typography
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
--admonition-font-size: var(--font-size-
|
|
10
|
+
--admonition-font-size: var(--font-size-sm); // @presenter FontSize
|
|
11
11
|
--admonition-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
12
12
|
--admonition-line-height: var(--line-height-base); // @presenter LineHeight
|
|
13
13
|
--admonition-heading-font-size: var(--font-size-base); // @presenter FontSize
|
|
14
|
-
--admonition-heading-font-weight: var(--font-weight-
|
|
14
|
+
--admonition-heading-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
15
15
|
--admonition-heading-letter-spacing: 0.3px; // @presenter LetterSpacing
|
|
16
16
|
--admonition-heading-transform: uppercase;
|
|
17
17
|
|
|
@@ -21,16 +21,16 @@ export const admonition = css`
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
--admonition-margin-horizontal: 0;
|
|
24
|
-
--admonition-margin-vertical:
|
|
24
|
+
--admonition-margin-vertical: var(--spacing-lg);
|
|
25
25
|
--admonition-padding-horizontal: var(--spacing-base);
|
|
26
|
-
--admonition-padding-vertical:
|
|
26
|
+
--admonition-padding-vertical: var(--spacing-md);
|
|
27
27
|
--admonition-icon-size: 25px;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @tokens Admonition border
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
--admonition-border-radius:
|
|
33
|
+
--admonition-border-radius: 0; // @presenter BorderRadius
|
|
34
34
|
--admonition-border-style: var(--border-style);
|
|
35
35
|
--admonition-border-width: var(--border-width);
|
|
36
36
|
|
|
@@ -216,4 +216,15 @@ export const markdown = css`
|
|
|
216
216
|
--md-tabs-hover-tab-border-color: var(--border-secondary); // @presenter Color
|
|
217
217
|
|
|
218
218
|
// @tokens End
|
|
219
|
-
`;
|
|
219
|
+
`;
|
|
220
|
+
|
|
221
|
+
export const mermaid = css`
|
|
222
|
+
/**
|
|
223
|
+
* @tokens Mermaid
|
|
224
|
+
*/
|
|
225
|
+
|
|
226
|
+
--mermaid-background-color: var(--bg-raised-light); // @presenter Color
|
|
227
|
+
--mermaid-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
228
|
+
|
|
229
|
+
// @tokens End
|
|
230
|
+
`;
|
|
@@ -421,7 +421,7 @@ export const apiReferencePanels = css`
|
|
|
421
421
|
* @tokens Panel try-it tabs
|
|
422
422
|
*/
|
|
423
423
|
|
|
424
|
-
--panel-try-it-tabs-font-size:
|
|
424
|
+
--panel-try-it-tabs-font-size: var(--font-size-sm);
|
|
425
425
|
--panel-try-it-tabs-font-family: var(--panel-font-family); // @presenter FontFamily
|
|
426
426
|
--panel-try-it-tabs-font-weight: var(--panel-font-weight); // @presenter FontWeight
|
|
427
427
|
|
|
@@ -23,7 +23,7 @@ export const Select = ({
|
|
|
23
23
|
selected,
|
|
24
24
|
options,
|
|
25
25
|
dataAttributes,
|
|
26
|
-
withArrow,
|
|
26
|
+
withArrow = true,
|
|
27
27
|
triggerEvent = 'click',
|
|
28
28
|
onChange,
|
|
29
29
|
placement,
|
|
@@ -121,15 +121,14 @@ export const SelectInputValue = styled.div`
|
|
|
121
121
|
|
|
122
122
|
export const SelectList = styled.ul<{ placement?: string; alignment?: string }>`
|
|
123
123
|
position: absolute;
|
|
124
|
-
top: ${({ placement }) => (placement === 'top' ? 'auto' : '100%')};
|
|
125
|
-
bottom: ${({ placement }) => (placement === 'top' ? '100%' : 'auto')};
|
|
124
|
+
top: ${({ placement }) => (placement === 'top' ? 'auto' : 'calc(100% + 2px)')};
|
|
125
|
+
bottom: ${({ placement }) => (placement === 'top' ? 'calc(100% + 2px)' : 'auto')};
|
|
126
126
|
left: ${({ alignment }) => (alignment === 'start' ? '0' : 'auto')};
|
|
127
127
|
right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
|
|
128
128
|
margin: 0;
|
|
129
129
|
min-width: var(--select-list-min-width);
|
|
130
130
|
width: 100%;
|
|
131
131
|
max-width: var(--select-list-max-width);
|
|
132
|
-
${({ placement }) => (!placement || placement === 'bottom' ? 'margin-top: 2px' : '')};
|
|
133
132
|
padding: var(--select-list-padding);
|
|
134
133
|
background-color: var(--select-list-background-color);
|
|
135
134
|
border-radius: var(--select-list-border-radius);
|
|
@@ -4,7 +4,7 @@ export const HeaderWrapper = styled.div.attrs<{ className?: string }>(({ classNa
|
|
|
4
4
|
'data-component-name': 'Sidebar/HeaderWrapper',
|
|
5
5
|
className,
|
|
6
6
|
}))`
|
|
7
|
-
margin: var(--sidebar-offset-top) 0 0
|
|
8
|
-
padding
|
|
7
|
+
margin: var(--sidebar-offset-top) 0 0 0;
|
|
8
|
+
padding: 0 0 var(--sidebar-header-padding-bottom) var(--sidebar-offset-left);
|
|
9
9
|
border-bottom: solid 1px var(--border-secondary);
|
|
10
10
|
`;
|
|
@@ -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
|
|
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
|
|
|
@@ -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) {
|