@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,6 +10,7 @@ import { telemetry } from '@portal/telemetry';
|
|
|
10
10
|
import { slug } from '@theme/utils';
|
|
11
11
|
|
|
12
12
|
export function CatalogCard({ item }: { item: CatalogItem }): JSX.Element {
|
|
13
|
+
const hasTags = item.scorecardStatus || item.tags?.length;
|
|
13
14
|
return (
|
|
14
15
|
<Link key={item.docsLink || item.link} to={item.docsLink || item.link}>
|
|
15
16
|
<StyledCard onClick={() => telemetry.send('catalog_item_clicked', {})}>
|
|
@@ -21,13 +22,22 @@ export function CatalogCard({ item }: { item: CatalogItem }): JSX.Element {
|
|
|
21
22
|
<Highlight>{item.description ?? ''}</Highlight>
|
|
22
23
|
</CardDescription>
|
|
23
24
|
<CardFooter>
|
|
24
|
-
{
|
|
25
|
+
{hasTags && (
|
|
25
26
|
<CardTags>
|
|
26
|
-
{(item.tags as string[]).map((tag, index) => (
|
|
27
|
+
{((item.tags as string[]) || []).map((tag, index) => (
|
|
27
28
|
<CardTag key={tag + index} color={slug(tag)}>
|
|
28
29
|
<Highlight>{tag}</Highlight>
|
|
29
30
|
</CardTag>
|
|
30
31
|
))}
|
|
32
|
+
{(item.scorecardLevel && item.scorecardStatus && (
|
|
33
|
+
<CardTag
|
|
34
|
+
color={statusToColor(item.scorecardStatus)}
|
|
35
|
+
className="tag-variant-scorecard-level"
|
|
36
|
+
>
|
|
37
|
+
<Highlight>{item.scorecardLevel}</Highlight>
|
|
38
|
+
</CardTag>
|
|
39
|
+
)) ||
|
|
40
|
+
null}
|
|
31
41
|
</CardTags>
|
|
32
42
|
)}
|
|
33
43
|
<SelectButton>
|
|
@@ -40,6 +50,19 @@ export function CatalogCard({ item }: { item: CatalogItem }): JSX.Element {
|
|
|
40
50
|
);
|
|
41
51
|
}
|
|
42
52
|
|
|
53
|
+
function statusToColor(status: string) {
|
|
54
|
+
switch (status) {
|
|
55
|
+
case 'Below minimum':
|
|
56
|
+
return 'error';
|
|
57
|
+
case 'Minimum':
|
|
58
|
+
return 'warning';
|
|
59
|
+
case 'Highest':
|
|
60
|
+
return 'success';
|
|
61
|
+
default:
|
|
62
|
+
return '';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
43
66
|
const SelectButton = styled.div`
|
|
44
67
|
border: 1px solid var(--catalog-card-button-border-color);
|
|
45
68
|
border-radius: 100%;
|
|
@@ -76,7 +99,7 @@ const StyledCard = styled.div.attrs({ 'data-cy': 'Catalog/CatalogCard' })`
|
|
|
76
99
|
transform: rotate(-45deg);
|
|
77
100
|
border-color: var(--catalog-card-hover-border-color);
|
|
78
101
|
background: var(--catalog-card-button-hover-background);
|
|
79
|
-
|
|
102
|
+
|
|
80
103
|
svg {
|
|
81
104
|
fill: var(--catalog-card-icon-hover-color);
|
|
82
105
|
}
|
|
@@ -66,7 +66,7 @@ export const code = css`
|
|
|
66
66
|
--code-block-tokens-constant-color: var(--code-block-tokens-default-color); // @presenter Color
|
|
67
67
|
--code-block-tokens-symbol-color: var(--code-block-tokens-default-color); // @presenter Color
|
|
68
68
|
--code-block-tokens-boolean-color: var(--color-geekblue-7); // @presenter Color
|
|
69
|
-
--code-block-tokens-string-color: var(--color-
|
|
69
|
+
--code-block-tokens-string-color: var(--color-cyan-6); // @presenter Color
|
|
70
70
|
--code-block-tokens-property-string-color: var(--text-secondary); // @presenter Color
|
|
71
71
|
--code-block-tokens-selector-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
72
72
|
--code-block-tokens-attr-name-color: var(--code-block-tokens-string-color); // @presenter Color
|
|
@@ -8,8 +8,15 @@ 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
|
-
export function Filter({
|
|
13
|
+
export function Filter({
|
|
14
|
+
filter,
|
|
15
|
+
filterValuesCasing,
|
|
16
|
+
}: {
|
|
17
|
+
filter: ResolvedFilter & { selectedOptions: any };
|
|
18
|
+
filterValuesCasing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'];
|
|
19
|
+
}) {
|
|
13
20
|
const { translate } = useTranslate();
|
|
14
21
|
const translationKeys = {
|
|
15
22
|
selectAll: 'theme.catalog.filters.select.all',
|
|
@@ -44,7 +51,9 @@ export function Filter({ filter }: { filter: ResolvedFilter & { selectedOptions:
|
|
|
44
51
|
role="link"
|
|
45
52
|
onClick={() => filter.selectOption(option.value)}
|
|
46
53
|
>
|
|
47
|
-
<FilterOptionLabel>
|
|
54
|
+
<FilterOptionLabel>
|
|
55
|
+
{changeCasing(translate(option.value), filterValuesCasing)}
|
|
56
|
+
</FilterOptionLabel>
|
|
48
57
|
<FilterOptionCount>{option.count}</FilterOptionCount>
|
|
49
58
|
</FilterOption>
|
|
50
59
|
),
|
|
@@ -119,7 +128,9 @@ export function Filter({ filter }: { filter: ResolvedFilter & { selectedOptions:
|
|
|
119
128
|
return (
|
|
120
129
|
<FilterOption key={id} role="link" onClick={() => filter.toggleOption(value.value)}>
|
|
121
130
|
<CheckboxIcon checked={filter.selectedOptions.has(value.value)} />
|
|
122
|
-
<FilterOptionLabel>
|
|
131
|
+
<FilterOptionLabel>
|
|
132
|
+
{changeCasing(translate(value.value), filterValuesCasing)}
|
|
133
|
+
</FilterOptionLabel>
|
|
123
134
|
<FilterOptionCount>{value.count}</FilterOptionCount>
|
|
124
135
|
</FilterOption>
|
|
125
136
|
);
|
|
@@ -129,6 +140,26 @@ export function Filter({ filter }: { filter: ResolvedFilter & { selectedOptions:
|
|
|
129
140
|
);
|
|
130
141
|
}
|
|
131
142
|
|
|
143
|
+
function changeCasing(
|
|
144
|
+
str: string,
|
|
145
|
+
casing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'],
|
|
146
|
+
) {
|
|
147
|
+
if (!casing || casing === 'original' || !str) return str;
|
|
148
|
+
|
|
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
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
132
163
|
const FilterGroup = styled.div`
|
|
133
164
|
padding: var(--filter-group-padding);
|
|
134
165
|
`;
|
|
@@ -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,6 +16,7 @@ interface FilterContentProps {
|
|
|
13
16
|
filters: ResolvedFilter[];
|
|
14
17
|
filterTerm: string;
|
|
15
18
|
isMobile: boolean;
|
|
19
|
+
filterValuesCasing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'];
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
export function FilterContent({
|
|
@@ -20,6 +24,7 @@ export function FilterContent({
|
|
|
20
24
|
filters,
|
|
21
25
|
filterTerm,
|
|
22
26
|
isMobile,
|
|
27
|
+
filterValuesCasing,
|
|
23
28
|
}: FilterContentProps) {
|
|
24
29
|
const { translate } = useTranslate();
|
|
25
30
|
const translationKeys = {
|
|
@@ -50,7 +55,11 @@ export function FilterContent({
|
|
|
50
55
|
</FilterControls>
|
|
51
56
|
<FilterItems>
|
|
52
57
|
{filters.map((filter, idx) => (
|
|
53
|
-
<Filter
|
|
58
|
+
<Filter
|
|
59
|
+
filter={filter}
|
|
60
|
+
key={filter.property + '-' + idx}
|
|
61
|
+
filterValuesCasing={filterValuesCasing}
|
|
62
|
+
/>
|
|
54
63
|
))}
|
|
55
64
|
</FilterItems>
|
|
56
65
|
{hasActiveFilters && (
|
|
@@ -62,7 +71,7 @@ export function FilterContent({
|
|
|
62
71
|
);
|
|
63
72
|
}
|
|
64
73
|
|
|
65
|
-
const FilterContentWrapper = styled
|
|
74
|
+
const FilterContentWrapper = styled(Sidebar)<{ isMobile?: boolean }>`
|
|
66
75
|
width: var(--sidebar-width);
|
|
67
76
|
display: none;
|
|
68
77
|
|
|
@@ -71,7 +80,7 @@ const FilterContentWrapper = styled.div<{ isMobile?: boolean }>`
|
|
|
71
80
|
margin: var(--filter-content-clear-button-margin);
|
|
72
81
|
}
|
|
73
82
|
|
|
74
|
-
${({ theme, isMobile }) => !isMobile && theme.mediaQueries.
|
|
83
|
+
${({ theme, isMobile }) => !isMobile && theme.mediaQueries.medium} {
|
|
75
84
|
display: block;
|
|
76
85
|
border-right: 1px solid var(--filter-content-border-color);
|
|
77
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,
|
|
@@ -72,9 +72,7 @@ export const Select = ({
|
|
|
72
72
|
onClick={triggerEvent === 'click' ? handleToggle : undefined}
|
|
73
73
|
>
|
|
74
74
|
<SelectInput>
|
|
75
|
-
{!onlyIcon &&
|
|
76
|
-
<SelectInputValue withIcon={withArrow || !!icon}>{_selected}</SelectInputValue>
|
|
77
|
-
)}
|
|
75
|
+
{!onlyIcon && <SelectInputValue>{_selected}</SelectInputValue>}
|
|
78
76
|
{icon}
|
|
79
77
|
{withArrow ? isOpen ? <ArrowIcon direction="up" /> : <ArrowIcon direction="down" /> : null}
|
|
80
78
|
</SelectInput>
|
|
@@ -113,21 +111,23 @@ export const SelectInput = styled.div`
|
|
|
113
111
|
border-radius: var(--select-input-border-radius);
|
|
114
112
|
padding: var(--select-input-padding-vertical) var(--select-input-padding-horizontal);
|
|
115
113
|
cursor: pointer;
|
|
114
|
+
gap: 8px;
|
|
116
115
|
`;
|
|
117
116
|
|
|
118
|
-
export const SelectInputValue = styled.div
|
|
117
|
+
export const SelectInputValue = styled.div`
|
|
119
118
|
pointer-events: none;
|
|
120
|
-
|
|
119
|
+
min-width: 0;
|
|
121
120
|
`;
|
|
122
121
|
|
|
123
122
|
export const SelectList = styled.ul<{ placement?: string; alignment?: string }>`
|
|
124
123
|
position: absolute;
|
|
125
|
-
top: ${({ placement }) => (placement === 'top' ? 'auto' : '100%')};
|
|
126
|
-
bottom: ${({ placement }) => (placement === 'top' ? '100%' : 'auto')};
|
|
124
|
+
top: ${({ placement }) => (placement === 'top' ? 'auto' : 'calc(100% + 2px)')};
|
|
125
|
+
bottom: ${({ placement }) => (placement === 'top' ? 'calc(100% + 2px)' : 'auto')};
|
|
127
126
|
left: ${({ alignment }) => (alignment === 'start' ? '0' : 'auto')};
|
|
128
127
|
right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
|
|
129
128
|
margin: 0;
|
|
130
129
|
min-width: var(--select-list-min-width);
|
|
130
|
+
width: 100%;
|
|
131
131
|
max-width: var(--select-list-max-width);
|
|
132
132
|
padding: var(--select-list-padding);
|
|
133
133
|
background-color: var(--select-list-background-color);
|
|
@@ -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
|
`;
|
|
@@ -24,22 +24,25 @@ interface TagProps {
|
|
|
24
24
|
children?: React.ReactNode;
|
|
25
25
|
closable?: boolean;
|
|
26
26
|
color?: StatusColor | Color | string;
|
|
27
|
+
size?: string;
|
|
27
28
|
icon?: React.ReactNode;
|
|
28
29
|
onClick?: () => void;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
export function Tag({ children, className, color, icon, onClick }: TagProps): JSX.Element {
|
|
32
|
+
export function Tag({ children, className, color, icon, onClick, size }: TagProps): JSX.Element {
|
|
32
33
|
return (
|
|
33
|
-
<TagContainer className={className} color={color} onClick={onClick}>
|
|
34
|
+
<TagContainer className={className} color={color} size={size} onClick={onClick}>
|
|
34
35
|
{icon ? icon : null}
|
|
35
36
|
{children}
|
|
36
37
|
</TagContainer>
|
|
37
38
|
);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
const TagContainer = styled.div.attrs(({ className, color }: TagProps) => ({
|
|
41
|
+
const TagContainer = styled.div.attrs(({ className, color, size }: TagProps) => ({
|
|
41
42
|
'data-component-name': 'Tag/Tag',
|
|
42
|
-
className:
|
|
43
|
+
className:
|
|
44
|
+
(className || '') +
|
|
45
|
+
` tag-default ${color ? `tag-${color}` : ''} ${size ? `tag-size-${size}` : ''}`,
|
|
43
46
|
}))<TagProps>`
|
|
44
47
|
display: inline-flex;
|
|
45
48
|
align-items: center;
|
|
@@ -48,6 +51,11 @@ const TagContainer = styled.div.attrs(({ className, color }: TagProps) => ({
|
|
|
48
51
|
|
|
49
52
|
padding: var(--tag-padding);
|
|
50
53
|
margin: var(--tag-margin);
|
|
54
|
+
|
|
55
|
+
&:last-child {
|
|
56
|
+
margin-right: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
gap: var(--tag-gap);
|
|
52
60
|
|
|
53
61
|
font-size: var(--tag-font-size);
|
|
@@ -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
|
|
|
@@ -38,6 +39,11 @@ export const tag = css`
|
|
|
38
39
|
* @tokens Tag colors
|
|
39
40
|
*/
|
|
40
41
|
|
|
42
|
+
.tag-size-large {
|
|
43
|
+
--tag-padding: var(--tag-large-padding);
|
|
44
|
+
--tag-font-size: var(--font-size-regular);
|
|
45
|
+
}
|
|
46
|
+
|
|
41
47
|
.tag-grey,
|
|
42
48
|
.tag-draft,
|
|
43
49
|
.tag-schema,
|
|
@@ -52,7 +58,7 @@ export const tag = css`
|
|
|
52
58
|
.tag-approved,
|
|
53
59
|
.tag-get {
|
|
54
60
|
--tag-color: var(--color-success-active); // @presenter Color
|
|
55
|
-
--tag-background-color:
|
|
61
|
+
--tag-background-color: var(--color-success-bg); // @presenter Color
|
|
56
62
|
--tag-border-color: var(--color-success-active); // @presenter Color
|
|
57
63
|
}
|
|
58
64
|
|
|
@@ -70,7 +76,7 @@ export const tag = css`
|
|
|
70
76
|
.tag-deprecated,
|
|
71
77
|
.tag-put {
|
|
72
78
|
--tag-color: var(--color-warning-active); // @presenter Color
|
|
73
|
-
--tag-background-color:
|
|
79
|
+
--tag-background-color: var(--color-warning-bg); // @presenter Color
|
|
74
80
|
--tag-border-color: var(--color-warning-active); // @presenter Color
|
|
75
81
|
}
|
|
76
82
|
|
|
@@ -78,42 +84,42 @@ export const tag = css`
|
|
|
78
84
|
.tag-processing,
|
|
79
85
|
.tag-post {
|
|
80
86
|
--tag-color: var(--color-info-active); // @presenter Color
|
|
81
|
-
--tag-background-color:
|
|
87
|
+
--tag-background-color: var(--color-info-bg); // @presenter Color
|
|
82
88
|
--tag-border-color: var(--color-info-active); // @presenter Color
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
.tag-purple,
|
|
86
92
|
.tag-head {
|
|
87
93
|
--tag-color: var(--color-purple-7); // @presenter Color
|
|
88
|
-
--tag-background-color:
|
|
94
|
+
--tag-background-color: var(--color-purple-1); // @presenter Color
|
|
89
95
|
--tag-border-color: var(--color-purple-7); // @presenter Color
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
.tag-cyan,
|
|
93
99
|
.tag-option {
|
|
94
100
|
--tag-color: var(--color-cyan-7); // @presenter Color
|
|
95
|
-
--tag-background-color:
|
|
101
|
+
--tag-background-color: var(--color-cyan-1); // @presenter Color
|
|
96
102
|
--tag-border-color: var(--color-cyan-7); // @presenter Color
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
.tag-yellow,
|
|
100
106
|
.tag-patch {
|
|
101
107
|
--tag-color: var(--color-yellow-7); // @presenter Color
|
|
102
|
-
--tag-background-color:
|
|
108
|
+
--tag-background-color: var(--color-yellow-1); // @presenter Color
|
|
103
109
|
--tag-border-color: var(--color-yellow-7); // @presenter Color
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
.tag-geekblue,
|
|
107
113
|
.tag-link {
|
|
108
114
|
--tag-color: var(--color-geekblue-7); // @presenter Color
|
|
109
|
-
--tag-background-color:
|
|
115
|
+
--tag-background-color: var(--color-geekblue-1); // @presenter Color
|
|
110
116
|
--tag-border-color: var(--color-geekblue-7); // @presenter Color
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
.tag-magneta,
|
|
114
120
|
.tag-hook {
|
|
115
121
|
--tag-color: var(--color-magneta-7); // @presenter Color
|
|
116
|
-
--tag-background-color:
|
|
122
|
+
--tag-background-color: var(--color-magneta-1); // @presenter Color
|
|
117
123
|
--tag-border-color: var(--color-magneta-7); // @presenter Color
|
|
118
124
|
}
|
|
119
125
|
|
package/src/config.ts
CHANGED
|
@@ -373,6 +373,10 @@ const catalogSchema = {
|
|
|
373
373
|
slug: { type: 'string' },
|
|
374
374
|
filters: { type: 'array', items: catalogFilterSchema },
|
|
375
375
|
groupByFirstFilter: { type: 'boolean' },
|
|
376
|
+
filterValuesCasing: {
|
|
377
|
+
type: 'string',
|
|
378
|
+
enum: ['sentence', 'original', 'lowercase', 'uppercase'],
|
|
379
|
+
},
|
|
376
380
|
items: navItemsSchema,
|
|
377
381
|
requiredPermission: { type: 'string' },
|
|
378
382
|
separateVersions: { type: 'boolean' },
|
|
@@ -416,6 +420,7 @@ export const themeConfigSchema = {
|
|
|
416
420
|
properties: {
|
|
417
421
|
items: navItemsSchema,
|
|
418
422
|
copyrightText: { type: 'string' },
|
|
423
|
+
logo: hideConfigSchema,
|
|
419
424
|
...hideConfigSchema.properties,
|
|
420
425
|
},
|
|
421
426
|
additionalProperties: false,
|
|
@@ -720,3 +725,9 @@ export type GoogleAnalyticsConfig = FromSchema<typeof googleAnalyticsConfigSchem
|
|
|
720
725
|
export type CatalogConfig = FromSchema<typeof catalogSchema>;
|
|
721
726
|
export type CatalogFilterConfig = FromSchema<typeof catalogFilterSchema>;
|
|
722
727
|
export type ScorecardConfig = FromSchema<typeof scorecardConfigSchema>;
|
|
728
|
+
|
|
729
|
+
export enum ScorecardStatus {
|
|
730
|
+
BelowMinimum = 'Below minimum',
|
|
731
|
+
Highest = 'Highest',
|
|
732
|
+
Minimum = 'Minimum',
|
|
733
|
+
}
|