@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.
Files changed (73) 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 +19 -17
  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 +3 -1
  7. package/lib/components/Filter/Filter.js +17 -3
  8. package/lib/components/Filter/FilterContent.d.ts +3 -1
  9. package/lib/components/Filter/FilterContent.js +6 -5
  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.d.ts +1 -3
  24. package/lib/components/Select/Select.js +7 -5
  25. package/lib/components/Separator/SeparatorItem.js +1 -0
  26. package/lib/components/Sidebar/HeaderWrapper.js +2 -2
  27. package/lib/components/Tag/Tag.d.ts +2 -1
  28. package/lib/components/Tag/Tag.js +10 -4
  29. package/lib/components/Tag/styledVariables.js +14 -8
  30. package/lib/config.d.ts +31 -0
  31. package/lib/config.js +12 -2
  32. package/lib/globalStyle.js +23 -21
  33. package/lib/hooks/useMobileMenu.js +5 -6
  34. package/lib/hooks/useModalScrollLock.d.ts +1 -0
  35. package/lib/hooks/useModalScrollLock.js +16 -0
  36. package/lib/icons/AlertIcon/AlertIcon.js +0 -5
  37. package/lib/types/portal/src/shared/types/catalog.d.ts +5 -1
  38. package/lib/ui/Highlight.d.ts +1 -1
  39. package/lib/ui/Highlight.js +1 -1
  40. package/lib/ui/darkColors.js +26 -26
  41. package/lib/utils/css-variables.js +1 -1
  42. package/package.json +1 -1
  43. package/src/I18n/LanguagePicker.tsx +1 -0
  44. package/src/components/Catalog/Catalog.tsx +18 -10
  45. package/src/components/Catalog/CatalogCard.tsx +26 -3
  46. package/src/components/CodeBlock/styledVariables.ts +1 -1
  47. package/src/components/Filter/Filter.tsx +34 -3
  48. package/src/components/Filter/FilterContent.tsx +13 -4
  49. package/src/components/Filter/FilterPopover.tsx +13 -3
  50. package/src/components/Filter/styledVariables.ts +1 -1
  51. package/src/components/Footer/Footer.tsx +1 -1
  52. package/src/components/Footer/FooterColumn.tsx +2 -0
  53. package/src/components/Footer/styledVariables.ts +1 -1
  54. package/src/components/Markdown/Admonition.tsx +13 -8
  55. package/src/components/Markdown/Mermaid.tsx +3 -0
  56. package/src/components/Markdown/styledVariables.ts +17 -6
  57. package/src/components/Panel/PanelHeader.ts +1 -0
  58. package/src/components/Panel/styledVariables.ts +1 -1
  59. package/src/components/Product/ProductPicker.tsx +0 -1
  60. package/src/components/Select/Select.tsx +8 -8
  61. package/src/components/Separator/SeparatorItem.tsx +1 -0
  62. package/src/components/Sidebar/HeaderWrapper.tsx +2 -2
  63. package/src/components/Tag/Tag.tsx +12 -4
  64. package/src/components/Tag/styledVariables.ts +14 -8
  65. package/src/config.ts +11 -0
  66. package/src/globalStyle.ts +24 -22
  67. package/src/hooks/useMobileMenu.ts +3 -4
  68. package/src/hooks/useModalScrollLock.ts +12 -0
  69. package/src/icons/AlertIcon/AlertIcon.tsx +0 -5
  70. package/src/types/portal/src/shared/types/catalog.ts +7 -1
  71. package/src/ui/Highlight.tsx +2 -2
  72. package/src/ui/darkColors.tsx +26 -26
  73. 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
- {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
@@ -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({ filter }: { filter: ResolvedFilter & { selectedOptions: any } }) {
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>{translate(option.value)}</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>{translate(value.value)}</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/index';
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 filter={filter} key={filter.property + '-' + idx} />
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.div<{ isMobile?: boolean }>`
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.small} {
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({ setIsAddingFilter, filters }: FilterPopoverProps) {
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) => option.value.includes(filterTerm));
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.small} {
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(--mobile-catalog-filter-padding-horizontal);
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);
@@ -21,7 +21,7 @@ export function Footer(): JSX.Element | null {
21
21
  <FooterPresentationalComponent
22
22
  items={items as ResolvedNavItem[]}
23
23
  copyrightText={copyrightText}
24
- logo={logo}
24
+ logo={footer?.logo?.hide ? undefined : logo}
25
25
  />
26
26
  );
27
27
  }
@@ -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: 86px; // @presenter Spacing
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
- {name ? <Heading type={type}>{name}</Heading> : null}
35
- <Content>{children}</Content>
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
- position: relative;
42
- align-items: center;
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 Heading = styled.h5<AdmonitionTypeProps>`
62
- display: block;
63
- margin: 0 0 10px;
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
 
@@ -28,6 +28,9 @@ export function Mermaid({
28
28
  }
29
29
 
30
30
  const Wrapper = styled.div`
31
+ background-color: var(--mermaid-background-color);
32
+ border-radius: var(--mermaid-border-radius);
33
+
31
34
  .mermaid > svg {
32
35
  font-size: var(--font-size-base) !important;
33
36
  max-width: 100%;
@@ -7,11 +7,11 @@ export const admonition = css`
7
7
  * @tokens Admonition typography
8
8
  */
9
9
 
10
- --admonition-font-size: var(--font-size-base); // @presenter FontSize
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-bold); // @presenter FontWeight
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: var(--spacing-xs);
24
+ --admonition-margin-vertical: var(--spacing-lg);
25
25
  --admonition-padding-horizontal: var(--spacing-base);
26
- --admonition-padding-vertical: var(--spacing-base);
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: var(--border-radius-lg); // @presenter BorderRadius
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
+ `;
@@ -18,6 +18,7 @@ export const PanelHeader = styled.div.attrs<{ className?: string }>(({ className
18
18
  justify-content: space-between;
19
19
  min-height: 40px;
20
20
  white-space: var(--panel-heading-white-space-local);
21
+ color: var(--panel-heading-text-color);
21
22
 
22
23
  cursor: pointer;
23
24
 
@@ -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: 12px; // @presenter FontSize
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
 
@@ -31,7 +31,6 @@ export const ProductPicker = () => {
31
31
  <ProductSelect
32
32
  selected={currentProductComponent}
33
33
  options={productComponents}
34
- withArrow={true}
35
34
  triggerEvent="hover"
36
35
  />
37
36
  ) : null;
@@ -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<{ withIcon?: boolean }>`
117
+ export const SelectInputValue = styled.div`
119
118
  pointer-events: none;
120
- ${({ withIcon }) => (withIcon ? 'margin-right: 8px;' : '')}
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);
@@ -23,5 +23,6 @@ export const SeparatorItem = styled(MenuItemLabel).attrs<{ className?: string }>
23
23
 
24
24
  :hover {
25
25
  color: var(--sidebar-item-separator-text-color);
26
+ background: none;
26
27
  }
27
28
  `;
@@ -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 var(--sidebar-offset-left);
8
- padding-bottom: var(--sidebar-header-padding-bottom);
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: (className || '') + ` tag-default ${color ? `tag-${color}` : ''}`,
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: none; // @presenter 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: none; // @presenter 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: none; // @presenter 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: none; // @presenter 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: none; // @presenter 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: none; // @presenter 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: none; // @presenter 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: none; // @presenter 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
+ }