@redocly/theme 0.2.3 → 0.4.1

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 (173) hide show
  1. package/Button/Button.js +3 -3
  2. package/CodeBlock/CodeBlock.js +1 -1
  3. package/ColorModeSwitcher/ColorModeSwitcher.js +4 -3
  4. package/CopyButton/CopyButtonWrapper.d.ts +2 -1
  5. package/CopyButton/CopyButtonWrapper.js +3 -2
  6. package/Footer/Footer.js +1 -1
  7. package/Footer/FooterColumn.js +4 -4
  8. package/Footer/FooterColumns.js +1 -1
  9. package/Footer/FooterCopyright.js +1 -1
  10. package/JsonViewer/JsonViewer.js +1 -1
  11. package/Markdown/Admonition.js +3 -3
  12. package/Markdown/CodeSample/CodeSample.js +3 -3
  13. package/Markdown/ContainerWrapper.d.ts +5 -0
  14. package/Markdown/ContainerWrapper.js +21 -0
  15. package/Markdown/Details.d.ts +6 -0
  16. package/Markdown/Details.js +22 -0
  17. package/Markdown/MarkdownLayout.d.ts +3 -1
  18. package/Markdown/MarkdownLayout.js +4 -4
  19. package/Markdown/MarkdownWrapper.js +3 -3
  20. package/Markdown/index.d.ts +1 -1
  21. package/Markdown/index.js +1 -1
  22. package/Navbar/MobileNavbarItem.js +1 -1
  23. package/Navbar/MobileNavbarMenu.js +6 -6
  24. package/Navbar/Navbar.d.ts +1 -0
  25. package/Navbar/Navbar.js +10 -8
  26. package/Navbar/NavbarDropdown.js +1 -1
  27. package/Navbar/NavbarItem.d.ts +3 -3
  28. package/Navbar/NavbarItem.js +17 -14
  29. package/Navbar/NavbarMenu.js +2 -2
  30. package/NavbarLogo/NavbarLogo.js +1 -1
  31. package/OperationBadge/OperationBadge.js +1 -1
  32. package/PageNavigation/PageNavigation.d.ts +6 -1
  33. package/PageNavigation/PageNavigation.js +4 -3
  34. package/Panel/Panel.d.ts +2 -1
  35. package/Panel/Panel.js +8 -3
  36. package/Panel/PanelBody.js +1 -1
  37. package/Panel/PanelComponent.d.ts +3 -2
  38. package/Panel/PanelComponent.js +3 -2
  39. package/Panel/PanelHeader.d.ts +1 -1
  40. package/Panel/PanelHeader.js +3 -3
  41. package/Panel/PanelHeaderTitle.js +1 -1
  42. package/Panel/index.d.ts +0 -3
  43. package/Panel/index.js +0 -3
  44. package/Profile/Profile.js +1 -1
  45. package/SamplesPanelControls/SamplesPanelControls.js +6 -4
  46. package/Search/Autocomplete.js +1 -1
  47. package/Search/Input.js +1 -1
  48. package/Search/Parameters.js +1 -1
  49. package/Search/Popover.js +1 -1
  50. package/Search/Search.js +1 -1
  51. package/Search/SearchItem.js +3 -3
  52. package/Search/utils.js +1 -1
  53. package/Sidebar/ApiCallItem.js +1 -1
  54. package/Sidebar/ArrowBack.js +1 -1
  55. package/Sidebar/BackButton.js +1 -1
  56. package/Sidebar/Drilldown.js +1 -1
  57. package/Sidebar/DrilldownMenu.js +2 -2
  58. package/Sidebar/DrilldownMenuItem.js +3 -3
  59. package/Sidebar/ExternalIcon.js +1 -1
  60. package/Sidebar/Menu.js +1 -1
  61. package/Sidebar/MenuContainer.js +1 -1
  62. package/Sidebar/MenuGroup.js +6 -2
  63. package/Sidebar/MenuItemLabel.js +1 -1
  64. package/Sidebar/MenuLink.js +1 -1
  65. package/Sidebar/SeparatorItem.js +1 -1
  66. package/Sidebar/SeparatorLine.js +1 -1
  67. package/Sidebar/Sidebar.js +1 -1
  68. package/SidebarLogo/SidebarLogo.js +1 -1
  69. package/SourceCode/SourceCode.js +5 -5
  70. package/TableOfContent/TableOfContent.js +5 -5
  71. package/Tooltip/Tooltip.js +1 -1
  72. package/Typography/H1.js +1 -1
  73. package/Typography/H2.js +1 -1
  74. package/Typography/H3.js +1 -1
  75. package/Typography/SectionHeader.js +1 -1
  76. package/Typography/Typography.js +1 -1
  77. package/globalStyle.d.ts +0 -1
  78. package/globalStyle.js +29 -28
  79. package/hooks/useActiveHeading.js +6 -5
  80. package/icons/ArrowIcon/ArrowIcon.js +1 -1
  81. package/package.json +1 -1
  82. package/src/Button/Button.tsx +14 -6
  83. package/src/CodeBlock/CodeBlock.ts +2 -4
  84. package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +5 -4
  85. package/src/CopyButton/CopyButtonWrapper.tsx +6 -3
  86. package/src/Footer/Footer.tsx +3 -2
  87. package/src/Footer/FooterColumn.tsx +13 -9
  88. package/src/Footer/FooterColumns.tsx +2 -2
  89. package/src/Footer/FooterCopyright.tsx +1 -1
  90. package/src/JsonViewer/JsonViewer.tsx +5 -5
  91. package/src/Markdown/Admonition.tsx +3 -2
  92. package/src/Markdown/CodeSample/CodeSample.tsx +18 -17
  93. package/src/Markdown/{ContentWrapper.tsx → ContainerWrapper.tsx} +4 -4
  94. package/src/Markdown/Details.tsx +19 -0
  95. package/src/Markdown/MarkdownLayout.tsx +8 -4
  96. package/src/Markdown/MarkdownWrapper.tsx +87 -47
  97. package/src/Markdown/index.ts +1 -1
  98. package/src/Navbar/MobileNavbarItem.tsx +1 -3
  99. package/src/Navbar/MobileNavbarMenu.tsx +19 -17
  100. package/src/Navbar/Navbar.tsx +19 -10
  101. package/src/Navbar/NavbarDropdown.tsx +2 -1
  102. package/src/Navbar/NavbarItem.tsx +41 -24
  103. package/src/Navbar/NavbarMenu.tsx +3 -3
  104. package/src/NavbarLogo/NavbarLogo.tsx +4 -4
  105. package/src/OperationBadge/OperationBadge.ts +8 -9
  106. package/src/PageNavigation/PageNavigation.tsx +11 -3
  107. package/src/Panel/Panel.ts +17 -3
  108. package/src/Panel/PanelBody.ts +13 -5
  109. package/src/Panel/PanelComponent.tsx +3 -0
  110. package/src/Panel/PanelHeader.ts +13 -6
  111. package/src/Panel/PanelHeaderTitle.ts +6 -4
  112. package/src/Panel/index.ts +0 -3
  113. package/src/Profile/Profile.tsx +1 -1
  114. package/src/SamplesPanelControls/SamplesPanelControls.ts +9 -9
  115. package/src/Search/Autocomplete.tsx +1 -1
  116. package/src/Search/Input.tsx +7 -2
  117. package/src/Search/Parameters.tsx +1 -1
  118. package/src/Search/Popover.tsx +3 -3
  119. package/src/Search/Search.tsx +3 -1
  120. package/src/Search/SearchItem.tsx +14 -9
  121. package/src/Search/utils.tsx +1 -1
  122. package/src/Sidebar/ApiCallItem.tsx +7 -0
  123. package/src/Sidebar/ArrowBack.tsx +1 -1
  124. package/src/Sidebar/BackButton.tsx +10 -5
  125. package/src/Sidebar/Drilldown.tsx +1 -3
  126. package/src/Sidebar/DrilldownMenu.tsx +2 -2
  127. package/src/Sidebar/DrilldownMenuItem.tsx +12 -8
  128. package/src/Sidebar/ExternalIcon.tsx +1 -1
  129. package/src/Sidebar/Menu.tsx +1 -1
  130. package/src/Sidebar/MenuContainer.tsx +1 -1
  131. package/src/Sidebar/MenuGroup.tsx +12 -2
  132. package/src/Sidebar/MenuItemLabel.tsx +7 -7
  133. package/src/Sidebar/MenuLink.tsx +1 -1
  134. package/src/Sidebar/SeparatorItem.tsx +5 -1
  135. package/src/Sidebar/SeparatorLine.tsx +2 -2
  136. package/src/Sidebar/Sidebar.tsx +4 -4
  137. package/src/SidebarLogo/SidebarLogo.tsx +3 -3
  138. package/src/SourceCode/SourceCode.tsx +4 -4
  139. package/src/TableOfContent/TableOfContent.tsx +18 -16
  140. package/src/Tooltip/Tooltip.tsx +2 -2
  141. package/src/Typography/H1.ts +2 -2
  142. package/src/Typography/H2.ts +2 -2
  143. package/src/Typography/H3.ts +2 -1
  144. package/src/Typography/SectionHeader.ts +4 -4
  145. package/src/Typography/Typography.ts +1 -1
  146. package/src/globalStyle.ts +1358 -344
  147. package/src/hooks/useActiveHeading.ts +41 -34
  148. package/src/icons/ArrowIcon/ArrowIcon.tsx +3 -3
  149. package/src/ui/Background.tsx +1 -1
  150. package/src/ui/Dropdown.tsx +6 -6
  151. package/src/ui/Jumbotron.tsx +1 -1
  152. package/src/ui/Tiles/TileHeader.ts +5 -5
  153. package/src/ui/Tiles/TileText.tsx +1 -1
  154. package/src/ui/UniversalLink.tsx +1 -1
  155. package/src/utils/theme-helpers.ts +1 -1
  156. package/ui/Background.js +1 -1
  157. package/ui/Dropdown.js +4 -4
  158. package/ui/Jumbotron.js +1 -1
  159. package/ui/Tiles/TileHeader.js +1 -1
  160. package/ui/Tiles/TileText.js +1 -1
  161. package/ui/UniversalLink.js +1 -1
  162. package/utils/theme-helpers.js +1 -1
  163. package/Markdown/ContentWrapper.d.ts +0 -5
  164. package/Markdown/ContentWrapper.js +0 -21
  165. package/Panel/CodePanel.d.ts +0 -5
  166. package/Panel/CodePanel.js +0 -21
  167. package/Panel/ContentPanel.d.ts +0 -5
  168. package/Panel/ContentPanel.js +0 -20
  169. package/Panel/DarkHeader.d.ts +0 -1
  170. package/Panel/DarkHeader.js +0 -10
  171. package/src/Panel/CodePanel.ts +0 -34
  172. package/src/Panel/ContentPanel.ts +0 -44
  173. package/src/Panel/DarkHeader.ts +0 -8
@@ -3,18 +3,32 @@ import styled from 'styled-components';
3
3
  import { PanelHeader } from '@theme/Panel/PanelHeader';
4
4
  import { PanelBody } from '@theme/Panel/PanelBody';
5
5
  import { PanelComponent } from '@theme/Panel/PanelComponent';
6
+ import { ShelfIcon } from '@theme/icons/ShelfIcon';
6
7
 
7
- export const Panel = styled(PanelComponent).attrs(() => ({
8
+ export const Panel = styled(PanelComponent).attrs(({ className }) => ({
8
9
  'data-component-name': 'Panel/Panel',
10
+ className: className || 'panel-default',
9
11
  }))`
10
- border-radius: var(--panels-border-radius);
12
+ background-color: var(--panel-background-color);
13
+ color: var(--panel-text-color);
14
+ font-family: var(--panel-font-family-local);
15
+ font-size: var(--panel-font-size-local);
16
+ font-weight: var(--panel-font-weight-local);
17
+ border: var(--panel-border-local);
18
+ border-radius: var(--panel-border-radius);
11
19
 
12
20
  ${PanelHeader} + ${PanelBody} {
13
21
  border-top-left-radius: 0;
14
22
  border-top-right-radius: 0;
15
23
  }
16
24
 
25
+ ${PanelHeader} {
26
+ ${ShelfIcon} {
27
+ fill: var(--panel-chevron-icon-color); // ?????
28
+ }
29
+ }
30
+
17
31
  &:not(:last-child) {
18
- margin-bottom: 10px;
32
+ margin-bottom: var(--panel-gap-vertical);
19
33
  }
20
34
  `;
@@ -24,9 +24,17 @@ export const PanelBody = styled.div.attrs(() => ({
24
24
  ${({ animate }) => animate && showPanelAnimation};
25
25
  ${({ hidden }) => hidden && 'visibility: hidden'};
26
26
 
27
- border-top-left-radius: var(--panels-border-radius);
28
- border-top-right-radius: var(--panels-border-radius);
29
- border-bottom-right-radius: var(--panels-border-radius);
30
- border-bottom-left-radius: var(--panels-border-radius);
31
- background-color: var(--panels-background-color);
27
+ background-color: var(--panel-body-background-color);
28
+
29
+ font-family: var(--panel-body-font-family-local);
30
+ font-size: var(--panel-body-font-size-local);
31
+ font-weight: var(--panel-body-font-weight-local);
32
+ border: var(--panel-body-border-local);
33
+ padding: var(--panel-body-padding-local);
34
+ color: var(--panel-body-text-color);
35
+
36
+ border-top-left-radius: var(--panel-border-radius);
37
+ border-top-right-radius: var(--panel-border-radius);
38
+ border-bottom-right-radius: var(--panel-border-radius);
39
+ border-bottom-left-radius: var(--panel-border-radius);
32
40
  `;
@@ -17,6 +17,7 @@ export interface PanelComponentProps {
17
17
  className?: string;
18
18
  header?: ReactNode | ((props: PanelHeaderProps) => ReactNode);
19
19
  onToggle?: (expanded: boolean) => void;
20
+ description?: React.ReactNode;
20
21
  }
21
22
 
22
23
  export function PanelComponent({
@@ -25,6 +26,7 @@ export function PanelComponent({
25
26
  className,
26
27
  children,
27
28
  onToggle,
29
+ description,
28
30
  }: PropsWithChildren<PanelComponentProps>): JSX.Element {
29
31
  const [isExpanded, setExpanded] = useState(expanded);
30
32
  const [animate, setAnimate] = useState(false);
@@ -54,6 +56,7 @@ export function PanelComponent({
54
56
  <InlineBox>
55
57
  <PanelHeaderTitle data-cy="title">{header}</PanelHeaderTitle>
56
58
  <ShelfIcon direction={isExpanded ? 'down' : 'right'} />
59
+ {description}
57
60
  </InlineBox>
58
61
  </PanelHeader>
59
62
  ))}
@@ -2,7 +2,7 @@ import { BaseSyntheticEvent } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  export interface PanelHeaderProps {
5
- expanded: boolean;
5
+ expanded?: boolean;
6
6
  disabled?: boolean;
7
7
  toggle?: (e: BaseSyntheticEvent) => void;
8
8
  }
@@ -15,13 +15,20 @@ export const PanelHeader = styled.div.attrs(() => ({
15
15
  display: flex;
16
16
  align-items: center;
17
17
  justify-content: space-between;
18
- white-space: nowrap;
18
+ white-space: var(--panel-heading-white-space-local);
19
+
19
20
  cursor: pointer;
20
21
 
21
- border-top-left-radius: var(--panels-border-radius);
22
- border-top-right-radius: var(--panels-border-radius);
23
- border-bottom-right-radius: ${({ expanded }) => (expanded ? '0' : 'var(--panels-border-radius)')};
24
- border-bottom-left-radius: ${({ expanded }) => (expanded ? '0' : 'var(--panels-border-radius)')};
22
+ line-height: var(--panel-heading-line-height-local);
23
+ font-size: var(--panel-heading-font-size-local);
24
+ padding: var(--panel-heading-padding-local);
25
+ border: var(--panel-heading-border);
26
+ background-color: var(--panel-heading-background-color);
27
+
28
+ border-top-left-radius: var(--panel-border-radius);
29
+ border-top-right-radius: var(--panel-border-radius);
30
+ border-bottom-right-radius: ${({ expanded }) => (expanded ? '0' : 'var(--panel-border-radius)')};
31
+ border-bottom-left-radius: ${({ expanded }) => (expanded ? '0' : 'var(--panel-border-radius)')};
25
32
 
26
33
  pointer-events: ${({ disabled }) => (disabled ? 'none' : 'auto')};
27
34
  `;
@@ -3,11 +3,13 @@ import styled from 'styled-components';
3
3
  export const PanelHeaderTitle = styled.span.attrs(() => ({
4
4
  'data-component-name': 'Panel/PanelHeaderTitle',
5
5
  }))`
6
- line-height: 1;
7
6
  margin-right: 5px;
8
- font-weight: 700;
9
- /* changed from var(--color-content-inverse) to var(--color-content)
7
+ font-weight: var(--panel-heading-font-weight-local);
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+
11
+ /* changed from var(--text-color-inverse) to var(--text-color)
10
12
  should change several components in openapi/graphql reference-docs to use inverse color
11
13
  */
12
- color: var(--color-content);
14
+ color: var(--panel-heading-text-color);
13
15
  `;
@@ -1,6 +1,3 @@
1
- export * from '@theme/Panel/CodePanel';
2
- export * from '@theme/Panel/ContentPanel';
3
- export * from '@theme/Panel/DarkHeader';
4
1
  export * from '@theme/Panel/Panel';
5
2
  export * from '@theme/Panel/PanelBody';
6
3
  export * from '@theme/Panel/PanelComponent';
@@ -49,7 +49,7 @@ const ProfileWrapper = styled.div`
49
49
  align-items: center;
50
50
  cursor: pointer;
51
51
  width: auto;
52
- padding-left: calc(var(--sidebar-spacing-horizontal) * 2);
52
+ padding: 0 var(--navbar-item-padding-horizontal);
53
53
  `;
54
54
 
55
55
  const StyledUserName = styled.span`
@@ -5,25 +5,25 @@ import { CodeBlock } from '@theme/CodeBlock';
5
5
  export const SamplesControlButton = styled.button.attrs(() => ({
6
6
  'data-component-name': 'SamplesPanelControls/SamplesPanelControls',
7
7
  }))`
8
- background-color: var(--samples-panel-controls-background-color);
8
+ background-color: var(--panel-samples-controls-background-color);
9
9
  border: 0;
10
10
  outline: 0;
11
- border-radius: var(--global-border-radius);
11
+ border-radius: var(--border-radius);
12
12
  height: 20px;
13
- color: var(--color-content-inverse);
13
+ color: var(--panel-samples-controls-text-color);
14
14
  font-size: 12px;
15
15
  line-height: 12px;
16
16
  cursor: pointer;
17
17
  padding: 1px 6px;
18
18
  min-width: 90px;
19
19
 
20
- ${({ theme }) => theme.mediaQueries.small} {
20
+ ${({ theme }) => theme.mediaQueries?.small} {
21
21
  padding: 2px 20px;
22
22
  }
23
23
 
24
24
  :hover,
25
25
  :focus {
26
- background-color: var(--samples-panel-controls-hover-background-color);
26
+ background-color: var(--panel-samples-controls-hover-background-color);
27
27
  }
28
28
  `;
29
29
 
@@ -43,7 +43,7 @@ export const SampleControls = styled.div`
43
43
  margin-top: 5px;
44
44
  margin-left: 10px;
45
45
 
46
- ${({ theme }) => theme.mediaQueries.small} {
46
+ ${({ theme }) => theme.mediaQueries?.small} {
47
47
  margin-top: 0;
48
48
  }
49
49
 
@@ -64,9 +64,9 @@ export const PreformattedCodeBlock = styled(CodeBlock.withComponent('pre'))`
64
64
  margin: 0;
65
65
  font-family: var(--code-font-family);
66
66
  padding: 20px;
67
- border-radius: var(--global-border-radius);
68
- background-color: var(--samples-panel-controls-background-color);
69
- color: var(--color-content-inverse);
67
+ border-radius: var(--border-radius);
68
+ background-color: var(--panel-samples-controls-background-color);
69
+ color: var(--text-color-inverse);
70
70
  font-size: var(--code-font-size);
71
71
  white-space: var(--code-wrap, pre);
72
72
  `;
@@ -125,5 +125,5 @@ const Overlay = styled.div`
125
125
 
126
126
  const Message = styled.div`
127
127
  padding: 24px;
128
- color: var(--color-content);
128
+ color: var(--text-color);
129
129
  `;
@@ -6,7 +6,7 @@ export const FormInput = styled.input.attrs(() => ({
6
6
  padding: 1em 2.5em 1em 1em;
7
7
  background-color: var(--search-input-background-color);
8
8
  border-radius: var(--search-input-border-radius);
9
- border: none;
9
+ border: var(--search-input-border);
10
10
  outline: none;
11
11
  color: var(--search-input-text-color);
12
12
  font-size: var(--search-input-font-size);
@@ -14,6 +14,11 @@ export const FormInput = styled.input.attrs(() => ({
14
14
  line-height: var(--search-input-line-height);
15
15
 
16
16
  ::placeholder {
17
- color: var(--search-input-text-color);
17
+ color: var(--search-input-placeholder-color);
18
+ }
19
+
20
+ &:hover {
21
+ background-color: var(--search-input-hover-background-color);
22
+ border: var(--search-input-hover-border);
18
23
  }
19
24
  `;
@@ -39,7 +39,7 @@ export function Parameters({ parameters = [] }: ParametersProps): JSX.Element {
39
39
  }
40
40
 
41
41
  const Wrapper = styled.div`
42
- border-left: 1px solid var(--global-border-color);
42
+ border-left: 1px solid var(--border-color);
43
43
  padding: 0 12px;
44
44
  margin-top: 8px;
45
45
  margin-bottom: 4px;
@@ -12,9 +12,9 @@ export const Popover = styled.div.attrs(() => ({
12
12
  max-width: 90vw;
13
13
  max-height: 400px;
14
14
  overflow-y: auto;
15
- box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12),
16
- 0 8px 10px -5px rgba(0, 0, 0, 0.4);
17
- background: var(--search-popover-backgrond-color);
15
+ box-shadow: var(--search-popover-shadow);
16
+ background: var(--search-popover-background-color);
18
17
  list-style: none;
19
18
  border-radius: var(--search-popover-border-radius);
19
+ border: var(--search-popover-border);
20
20
  `;
@@ -49,4 +49,6 @@ export function Search(): JSX.Element {
49
49
  );
50
50
  }
51
51
 
52
- const Wrapper = styled.div``;
52
+ const Wrapper = styled.div`
53
+ margin: 0 auto;
54
+ `;
@@ -41,18 +41,31 @@ export function SearchItem({ item }: SearchItemProps): JSX.Element {
41
41
  );
42
42
  }
43
43
 
44
+ const Title = styled.div`
45
+ font-weight: var(--font-weight-bold);
46
+ color: var(--search-item-title-text-color);
47
+ overflow: hidden;
48
+ text-overflow: ellipsis;
49
+ line-height: var(--line-height-base);
50
+ `;
51
+
44
52
  const SearchLink = styled(Link)`
45
53
  display: block;
46
54
  text-decoration: none;
47
- padding: 8px 24px;
55
+ padding: var(--search-item-padding);
48
56
  transition: background-color 0.3s ease;
49
57
  outline: none;
50
58
  white-space: nowrap;
51
59
  color: var(--search-item-text-color);
60
+ background-color: var(--search-item-background-color);
52
61
 
53
62
  &:hover,
54
63
  &:focus {
64
+ color: var(--search-item-active-text-color);
55
65
  background-color: var(--search-item-active-background-color);
66
+ ${Title} {
67
+ color: var(--search-item-active-title-text-color);
68
+ }
56
69
  }
57
70
  `;
58
71
 
@@ -64,14 +77,6 @@ const Operation = styled.div`
64
77
  text-overflow: ellipsis;
65
78
  `;
66
79
 
67
- const Title = styled.div`
68
- font-weight: var(--font-weight-bold);
69
- color: var(--search-item-title-text-color);
70
- overflow: hidden;
71
- text-overflow: ellipsis;
72
- line-height: var(--line-height-base);
73
- `;
74
-
75
80
  const Description = styled.div`
76
81
  font-size: var(--font-size-base);
77
82
  overflow: hidden;
@@ -15,5 +15,5 @@ export const highlight = (text: string | string[]): JSX.Element | string => {
15
15
  };
16
16
 
17
17
  const Strong = styled.strong`
18
- color: var(--color-content);
18
+ color: var(--search-highlight-text-color);
19
19
  `;
@@ -29,4 +29,11 @@ const Wrapper = styled.div``;
29
29
  export const Badge = styled(OperationBadge)`
30
30
  flex-shrink: 0;
31
31
  margin-top: 0;
32
+ width: 36px;
33
+ height: 14px;
34
+ font-size: var(--sidebar-item-badge-http-font-size);
35
+ font-family: var(--sidebar-item-badge-http-font-family);
36
+ font-weight: var(--sidebar-item-badge-http-font-weight);
37
+ border-radius: var(--sidebar-item-badge-http-border-radius);
38
+ color: var(--sidebar-item-badge-http-text-color);
32
39
  `;
@@ -18,5 +18,5 @@ const Arrow = ({ className }: { className?: string }): JSX.Element => (
18
18
  );
19
19
 
20
20
  export const ArrowBack = styled(Arrow)`
21
- fill: var(--sidebar-chevron-color);
21
+ fill: var(--sidebar-group-item-chevron-color);
22
22
  `;
@@ -21,24 +21,29 @@ export function BackButton({
21
21
 
22
22
  const Button = styled.button`
23
23
  width: 100%;
24
- background-color: transparent;
24
+ background-color: var(--sidebar-back-button-background-color);
25
25
  padding: 0;
26
26
  border: 0;
27
27
  outline: 0;
28
- color: var(--color-content);
29
28
  display: flex;
30
29
  align-items: center;
31
30
  cursor: pointer;
32
- font-size: var(--sidebar-font-size);
31
+ color: var(--sidebar-back-button-text-color);
32
+ font-size: var(--sidebar-back-button-font-size);
33
+ font-family: var(--sidebar-back-button-font-family);
34
+ text-transform: var(--sidebar-back-button-transform);
35
+
33
36
  transition: color 0.25s ease;
34
37
  text-align: left;
35
- margin-bottom: calc(var(--sidebar-spacing-padding-vertical) * 3);
38
+ margin: var(--sidebar-back-button-margin);
36
39
 
37
40
  svg {
38
41
  margin-right: calc(var(--sidebar-spacing-unit) * 1.5);
42
+ fill: var(--sidebar-back-button-icon-color);
39
43
  }
40
44
 
41
45
  &:hover {
42
- color: var(--sidebar-item-color);
46
+ color: var(--sidebar-back-button-hover-text-color);
47
+ background: var(--sidebar-back-button-hover-background-color);
43
48
  }
44
49
  `;
@@ -34,9 +34,7 @@ export function Drilldown({
34
34
  const Wrapper = styled.div``;
35
35
 
36
36
  const DrilldownLabel = styled(MenuItemLabel)`
37
- padding-top: calc(var(--sidebar-spacing-padding-vertical) * 2);
38
- padding-bottom: calc(var(--sidebar-spacing-padding-vertical) * 2);
39
- padding-left: var(--sidebar-spacing-padding-horizontal);
37
+ padding: var(--sidebar-item-nested-offset) var(--sidebar-item-padding-horizontal);
40
38
  font-weight: var(--font-weight-bold);
41
39
 
42
40
  &:hover {
@@ -31,7 +31,7 @@ const MenuContainer = styled.div`
31
31
  bottom: 0;
32
32
  width: 100%;
33
33
  z-index: 100;
34
- background-color: var(--sidebar-background-color);
34
+ background-color: var(--sidebar-item-drilldown-background-color);
35
35
  `;
36
36
 
37
37
  const slideInAnimation = keyframes`
@@ -52,7 +52,7 @@ const MenuContent = styled.div`
52
52
  `;
53
53
 
54
54
  const MenuWrapper = styled.div`
55
- padding: var(--sidebar-spacing-padding-vertical) var(--sidebar-spacing-padding-horizontal);
55
+ padding: var(--sidebar-item-padding-vertical) var(--sidebar-item-padding-horizontal);
56
56
  margin-bottom: calc(var(--sidebar-spacing-unit) * 3);
57
57
  word-break: break-word;
58
58
  `;
@@ -18,23 +18,27 @@ export function DrilldownMenuItem({ item }: MenuItemProps): JSX.Element {
18
18
  const Container = styled.div`
19
19
  display: flex;
20
20
  align-items: center;
21
- color: var(--sidebar-item-color);
22
- font-size: var(--sidebar-font-size);
21
+ color: var(--sidebar-item-drilldown-text-color);
23
22
  font-weight: var(--font-weight-bold);
23
+ font-size: var(--sidebar-item-drilldown-font-size);
24
+ font-family: var(--sidebar-item-drilldown-font-family);
25
+ text-transform: var(--sidebar-text-drilldown-transform);
26
+ background: var(--sidebar-item-drilldown-background-color);
24
27
  `;
25
28
 
26
29
  const Icon = styled.img`
27
- width: calc(var(--sidebar-spacing-unit) * 4);
28
- height: calc(var(--sidebar-spacing-unit) * 4);
30
+ width: var(--sidebar-item-icon-size);
31
+ height: var(--sidebar-item-icon-size);
29
32
  margin-right: var(--sidebar-spacing-unit);
30
- border-radius: 50%;
33
+ border-radius: var(--sidebar-item-icon-border-radius);
31
34
  flex-shrink: 0;
32
35
  overflow: hidden;
33
36
  `;
34
37
 
35
38
  const SubLabel = styled.div`
36
39
  margin-top: 2px;
37
- font-size: 0.85rem;
38
- color: var(--color-content);
39
- font-weight: var(--font-weight-regular);
40
+ color: var(--sidebar-item-sublabel-text-color);
41
+ font-weight: var(-sidebar-item-sublabel-font-weight);
42
+ font-size: var(--sidebar-item-sublabel-font-size);
43
+ font-family: var(--sidebar-item-sublabel-font-family);
40
44
  `;
@@ -33,5 +33,5 @@ export const ExternalIcon = styled(Icon)`
33
33
  width: 10px;
34
34
  height: 10px;
35
35
  margin-left: 5px;
36
- fill: var(--sidebar-chevron-color);
36
+ fill: var(--sidebar-group-item-chevron-color);
37
37
  `;
@@ -6,6 +6,6 @@ export const Menu = styled.ul.attrs(() => ({
6
6
  padding: 0;
7
7
  margin: 0;
8
8
  list-style: none;
9
- color: var(--sidebar-item-color);
9
+ color: var(--sidebar-item-text-color);
10
10
  position: relative;
11
11
  `;
@@ -6,5 +6,5 @@ export const MenuContainer = styled.div.attrs(() => ({
6
6
  position: relative;
7
7
  overflow-y: auto;
8
8
  flex-grow: 1;
9
- padding-top: var(--sidebar-spacing-offset-top);
9
+ padding-top: var(--sidebar-offset-top);
10
10
  `;
@@ -42,12 +42,22 @@ export function MenuGroup({
42
42
  const Wrapper = styled.div``;
43
43
 
44
44
  const MenuWrapper = styled.div`
45
- padding-left: var(--sidebar-spacing-offset-nesting);
45
+ padding-left: var(--sidebar-item-nested-offset);
46
46
  `;
47
47
 
48
48
  const MenuGroupLabel = styled(MenuItemLabel)<{ isAlwaysExpanded?: boolean }>`
49
- padding-left: var(--sidebar-spacing-padding-horizontal);
49
+ padding-left: var(--sidebar-item-padding-horizontal);
50
50
  cursor: ${(props) => (props.isAlwaysExpanded ? 'default' : 'pointer')};
51
+ font-family: var(--sidebar-item-group-font-family);
52
+ font-size: var(--sidebar-item-group-font-size);
53
+ text-transform: var(--sidebar-text-group-transform);
54
+ color: var(--sidebar-item-group-text-color);
55
+ background: var(--sidebar-item-group-background-color);
56
+ ${(props) =>
57
+ props.active
58
+ ? `color: var(--sidebar-item-group-active-text-color);
59
+ background-color: var(--sidebar-item-group-active-background-color);`
60
+ : null};
51
61
  `;
52
62
 
53
63
  const MenuGroupArrow = styled(ArrowIcon)`
@@ -10,17 +10,17 @@ export const MenuItemLabel = styled.li.attrs(() => ({
10
10
  word-break: break-word;
11
11
  margin-bottom: 1px;
12
12
 
13
- font-family: var(--sidebar-font-family);
14
- font-size: var(--sidebar-font-size);
13
+ background-color: var(--sidebar-item-background-color);
14
+ font-family: var(--sidebar-item-font-family);
15
+ font-size: var(--sidebar-item-font-size);
15
16
  font-weight: var(--font-weight-regular);
16
- margin-left: var(--sidebar-spacing-offset-left);
17
- padding: var(--sidebar-spacing-padding-vertical) var(--sidebar-spacing-padding-horizontal);
17
+ margin-left: var(--sidebar-offset-left);
18
+ padding: var(--sidebar-item-padding-vertical) var(--sidebar-item-padding-horizontal);
18
19
  padding-left: calc(
19
- var(--sidebar-spacing-padding-horizontal) + var(--sidebar-chevron-size) +
20
+ var(--sidebar-item-padding-horizontal) + var(--sidebar-group-item-chevron-size) +
20
21
  var(--sidebar-spacing-unit) * 0.5
21
22
  );
22
- border-top-left-radius: var(--sidebar-border-radius);
23
- border-bottom-left-radius: var(--sidebar-border-radius);
23
+ border-radius: var(--sidebar-item-border-radius);
24
24
 
25
25
  ${(props) =>
26
26
  props.active
@@ -6,7 +6,7 @@ export const MenuLink = styled(UniversalLink).attrs(() => ({
6
6
  'data-component-name': 'Sidebar/MenuLink',
7
7
  }))<UniversalLinkProps>`
8
8
  text-decoration: none;
9
- color: var(--sidebar-item-color);
9
+ color: var(--sidebar-item-text-color);
10
10
 
11
11
  &&.external-url:after {
12
12
  content: none;
@@ -7,7 +7,11 @@ export const SeparatorItem = styled(MenuItemLabel).attrs(() => ({
7
7
  }))`
8
8
  cursor: default;
9
9
  font-weight: var(--font-weight-bold);
10
- color: var(--sidebar-separator-label-color);
10
+ color: var(--sidebar-separator-item-color);
11
+ font-family: var(--sidebar-item-separator-font-family);
12
+ font-size: var(--sidebar-item-separator-font-size);
13
+ text-transform: var(--sidebar-item-separator-text-transform);
14
+ background: var(--sidebar-item-separator-background-color);
11
15
 
12
16
  :hover {
13
17
  color: inherit;
@@ -4,6 +4,6 @@ export const SeparatorLine = styled.div.attrs(() => ({
4
4
  'data-component-name': 'Sidebar/SeparatorLine',
5
5
  }))`
6
6
  height: 1px;
7
- background-color: var(--sidebar-separator-line-color);
8
- margin: var(--sidebar-spacing-padding-vertical) 0;
7
+ background-color: var(--sidebar-item-separator-line-color);
8
+ margin: var(--sidebar-item-padding-vertical) 0;
9
9
  `;
@@ -8,16 +8,16 @@ interface SidebarProps {
8
8
  export const Sidebar = styled.aside.attrs(() => ({
9
9
  'data-component-name': 'Sidebar/Sidebar',
10
10
  }))<SidebarProps>`
11
- border-right: 1px solid var(--sidebar-right-line-color);
11
+ border-right: 1px solid var(--sidebar-border-color);
12
12
  position: fixed;
13
13
  left: 0;
14
14
  right: 0;
15
15
  bottom: 0;
16
16
  z-index: 2;
17
17
  background: var(--sidebar-background-color);
18
- font-size: var(--sidebar-font-size);
19
- font-family: var(--sidebar-font-family);
20
- color: var(--sidebar-item-color);
18
+ font-size: var(--sidebar-item-font-size);
19
+ font-family: var(--sidebar-item-font-family);
20
+ color: var(--sidebar-item-text-color);
21
21
  top: var(--navbar-height);
22
22
  height: calc(100vh - var(--navbar-height));
23
23
  display: flex;
@@ -34,9 +34,9 @@ export function SidebarLogo({
34
34
  }
35
35
 
36
36
  const LogoImgEl = styled.img`
37
- max-height: var(--logo-max-height);
38
- max-width: var(--logo-max-width);
39
- padding: var(--logo-padding);
37
+ max-height: var(--sidebar-logo-max-height);
38
+ max-width: var(--sidebar-logo-max-width);
39
+ padding: var(--sidebar-logo-padding);
40
40
  width: 100%;
41
41
  display: block;
42
42
  `;
@@ -78,11 +78,11 @@ export function SourceCode({
78
78
  // Because we don't have session storage in ssr and can't get the security details there
79
79
  // Issue for more details https://github.com/Redocly/reference-docs/issues/888
80
80
  useEffect(() => {
81
- const _externalSource = externalSource?.sample?.get?.(externalSource) ?? '';
82
- if (_externalSource) {
83
- setSourceCode(_externalSource);
81
+ const _source = source || externalSource?.sample?.get?.(externalSource);
82
+ if (_source) {
83
+ setSourceCode(_source);
84
84
  }
85
- }, [externalSource]);
85
+ }, [source, externalSource]);
86
86
 
87
87
  if (withCopyButton) {
88
88
  return (