@redocly/theme 0.4.6 → 0.4.8

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 (219) hide show
  1. package/Button/Button.d.ts +3 -3
  2. package/Button/Button.js +3 -7
  3. package/Cards/Card.d.ts +1 -1
  4. package/Cards/Card.js +14 -7
  5. package/ColorModeSwitcher/ColorModeSwitcher.js +13 -25
  6. package/CopyButton/CopyButton.js +13 -24
  7. package/CopyButton/CopyButtonWrapper.d.ts +4 -3
  8. package/CopyButton/CopyButtonWrapper.js +15 -26
  9. package/EditPageButton/EditPageButton.js +13 -4
  10. package/Footer/CustomFooter.d.ts +1 -1
  11. package/Footer/CustomFooter.js +15 -6
  12. package/Footer/CustomFooterNavItem.js +13 -4
  13. package/Footer/Footer.js +13 -4
  14. package/Footer/FooterColumn.js +18 -9
  15. package/Footer/FooterColumns.js +13 -3
  16. package/Footer/FooterCopyright.js +13 -2
  17. package/JsonViewer/JsonViewer.d.ts +4 -3
  18. package/JsonViewer/JsonViewer.js +17 -34
  19. package/LastUpdated/LastUpdated.js +13 -4
  20. package/Layout/PageLayout.d.ts +3 -3
  21. package/Layout/PageLayout.js +13 -4
  22. package/Layout/RootLayout.d.ts +4 -4
  23. package/Layout/RootLayout.js +13 -5
  24. package/Markdown/Admonition.d.ts +2 -2
  25. package/Markdown/Admonition.js +13 -5
  26. package/Markdown/CodeSample/CodeSample.js +14 -7
  27. package/Markdown/Details.d.ts +2 -2
  28. package/Markdown/Details.js +2 -4
  29. package/Markdown/Heading.d.ts +1 -1
  30. package/Markdown/Heading.js +15 -29
  31. package/Markdown/MarkdownLayout.d.ts +3 -3
  32. package/Markdown/MarkdownLayout.js +13 -9
  33. package/Markdown/MarkdownWrapper.d.ts +1 -1
  34. package/Markdown/Mermaid.js +2 -2
  35. package/Markdown/Sup.d.ts +1 -1
  36. package/Markdown/Sup.js +13 -2
  37. package/Markdown/Tabs/Tab.js +13 -2
  38. package/Markdown/Tabs/Tabs.d.ts +1 -1
  39. package/Markdown/Tabs/Tabs.js +21 -34
  40. package/Navbar/MobileNavbarDropdown.js +13 -3
  41. package/Navbar/MobileNavbarItem.js +14 -31
  42. package/Navbar/MobileNavbarMenu.js +15 -6
  43. package/Navbar/Navbar.d.ts +5 -5
  44. package/Navbar/Navbar.js +13 -10
  45. package/Navbar/NavbarDropdown.js +13 -3
  46. package/Navbar/NavbarItem.js +14 -8
  47. package/Navbar/NavbarMenu.js +15 -4
  48. package/NavbarLogo/NavbarLogo.d.ts +1 -1
  49. package/NavbarLogo/NavbarLogo.js +14 -3
  50. package/PageNavigation/NextPageLink.js +14 -3
  51. package/PageNavigation/PageNavigation.js +13 -4
  52. package/PageNavigation/PreviousPageLink.js +14 -3
  53. package/Panel/Panel.js +1 -1
  54. package/Panel/PanelComponent.d.ts +3 -3
  55. package/Panel/PanelComponent.js +15 -32
  56. package/Panel/PanelHeader.d.ts +1 -1
  57. package/Profile/Profile.d.ts +2 -2
  58. package/Profile/Profile.js +15 -9
  59. package/Search/Autocomplete.d.ts +1 -1
  60. package/Search/Autocomplete.js +3 -30
  61. package/Search/ClearIcon.d.ts +1 -1
  62. package/Search/ClearIcon.js +2 -3
  63. package/Search/Parameters.js +17 -17
  64. package/Search/Search.js +13 -3
  65. package/Search/SearchIcon.d.ts +1 -1
  66. package/Search/SearchIcon.js +2 -3
  67. package/Search/SearchItem.js +13 -30
  68. package/Search/utils.js +2 -28
  69. package/Sidebar/ApiCallItem.d.ts +1 -1
  70. package/Sidebar/ApiCallItem.js +13 -7
  71. package/Sidebar/ArrowBack.js +13 -5
  72. package/Sidebar/BackButton.d.ts +2 -2
  73. package/Sidebar/BackButton.js +13 -4
  74. package/Sidebar/Drilldown.d.ts +3 -3
  75. package/Sidebar/Drilldown.js +2 -6
  76. package/Sidebar/DrilldownMenu.d.ts +3 -3
  77. package/Sidebar/DrilldownMenu.js +13 -10
  78. package/Sidebar/DrilldownMenuItem.d.ts +1 -1
  79. package/Sidebar/DrilldownMenuItem.js +13 -6
  80. package/Sidebar/ExternalIcon.js +13 -7
  81. package/Sidebar/MenuGroup.d.ts +3 -3
  82. package/Sidebar/MenuGroup.js +13 -8
  83. package/Sidebar/MenuItem.d.ts +1 -1
  84. package/Sidebar/MenuItem.js +13 -7
  85. package/Sidebar/MenuLink.d.ts +1 -1
  86. package/Sidebar/MenuLinkItem.d.ts +3 -3
  87. package/Sidebar/MenuLinkItem.js +2 -2
  88. package/Sidebar/Separator.d.ts +1 -1
  89. package/Sidebar/Separator.js +13 -4
  90. package/Sidebar/SidebarLayout.d.ts +3 -3
  91. package/Sidebar/SidebarLayout.js +13 -7
  92. package/Sidebar/types/DrilldownMenuProps.d.ts +1 -1
  93. package/Sidebar/types/ItemState.d.ts +2 -2
  94. package/Sidebar/types/MenuItemProps.d.ts +1 -1
  95. package/Sidebar/types/NavItem.d.ts +1 -1
  96. package/SidebarLogo/SidebarLogo.js +14 -3
  97. package/SourceCode/SourceCode.d.ts +2 -1
  98. package/SourceCode/SourceCode.js +19 -32
  99. package/TableOfContent/TableOfContent.d.ts +1 -1
  100. package/TableOfContent/TableOfContent.js +21 -35
  101. package/TableOfContent/utils.d.ts +1 -1
  102. package/TableOfContent/utils.js +1 -4
  103. package/Tooltip/Tooltip.d.ts +1 -2
  104. package/Tooltip/Tooltip.js +3 -4
  105. package/globalStyle.js +7 -6
  106. package/hooks/useFullHeight.d.ts +1 -1
  107. package/hooks/useMobileMenu.d.ts +1 -1
  108. package/hooks/useOutsideClick.d.ts +1 -1
  109. package/icons/AlertIcon/AlertIcon.js +17 -20
  110. package/icons/ArrowIcon/ArrowIcon.js +13 -4
  111. package/icons/ColorModeIcon/ColorModeIcon.js +15 -7
  112. package/icons/ShelfIcon/ShelfIcon.d.ts +2 -2
  113. package/icons/ShelfIcon/ShelfIcon.js +13 -4
  114. package/mocks/Link.js +2 -5
  115. package/package.json +1 -1
  116. package/src/Button/Button.tsx +4 -3
  117. package/src/Cards/Card.tsx +3 -3
  118. package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
  119. package/src/CopyButton/CopyButton.tsx +1 -1
  120. package/src/CopyButton/CopyButtonWrapper.tsx +8 -2
  121. package/src/EditPageButton/EditPageButton.tsx +0 -1
  122. package/src/Footer/CustomFooter.tsx +2 -2
  123. package/src/Footer/CustomFooterNavItem.tsx +0 -1
  124. package/src/Footer/Footer.tsx +0 -1
  125. package/src/Footer/FooterColumn.tsx +0 -1
  126. package/src/Footer/FooterColumns.tsx +0 -1
  127. package/src/Footer/FooterCopyright.tsx +0 -1
  128. package/src/JsonViewer/JsonViewer.tsx +5 -2
  129. package/src/LastUpdated/LastUpdated.tsx +0 -1
  130. package/src/Layout/PageLayout.tsx +3 -6
  131. package/src/Layout/RootLayout.tsx +4 -4
  132. package/src/Markdown/Admonition.tsx +2 -2
  133. package/src/Markdown/CodeSample/CodeSample.tsx +1 -1
  134. package/src/Markdown/Details.tsx +2 -2
  135. package/src/Markdown/Heading.tsx +2 -1
  136. package/src/Markdown/MarkdownLayout.tsx +3 -3
  137. package/src/Markdown/MarkdownWrapper.tsx +2 -1
  138. package/src/Markdown/Mermaid.tsx +0 -1
  139. package/src/Markdown/Sup.tsx +1 -1
  140. package/src/Markdown/Tabs/Tab.tsx +0 -1
  141. package/src/Markdown/Tabs/Tabs.tsx +2 -2
  142. package/src/Navbar/MobileNavbarDropdown.tsx +0 -1
  143. package/src/Navbar/MobileNavbarItem.tsx +1 -1
  144. package/src/Navbar/MobileNavbarMenu.tsx +0 -1
  145. package/src/Navbar/Navbar.tsx +6 -5
  146. package/src/Navbar/NavbarDropdown.tsx +0 -1
  147. package/src/Navbar/NavbarItem.tsx +0 -1
  148. package/src/Navbar/NavbarMenu.tsx +0 -1
  149. package/src/NavbarLogo/NavbarLogo.tsx +2 -2
  150. package/src/PageNavigation/NextPageLink.tsx +0 -1
  151. package/src/PageNavigation/PageNavigation.tsx +0 -1
  152. package/src/PageNavigation/PreviousPageLink.tsx +0 -1
  153. package/src/Panel/Panel.ts +2 -2
  154. package/src/Panel/PanelComponent.tsx +10 -9
  155. package/src/Panel/PanelHeader.ts +1 -1
  156. package/src/Profile/Profile.tsx +1 -1
  157. package/src/Search/Autocomplete.tsx +2 -8
  158. package/src/Search/ClearIcon.tsx +1 -1
  159. package/src/Search/Parameters.tsx +0 -1
  160. package/src/Search/Search.tsx +0 -1
  161. package/src/Search/SearchIcon.tsx +1 -1
  162. package/src/Search/SearchItem.tsx +1 -1
  163. package/src/Search/utils.tsx +0 -1
  164. package/src/Sidebar/ApiCallItem.tsx +2 -2
  165. package/src/Sidebar/ArrowBack.tsx +0 -1
  166. package/src/Sidebar/BackButton.tsx +2 -5
  167. package/src/Sidebar/Drilldown.tsx +4 -3
  168. package/src/Sidebar/DrilldownMenu.tsx +4 -3
  169. package/src/Sidebar/DrilldownMenuItem.tsx +1 -2
  170. package/src/Sidebar/ExternalIcon.tsx +0 -1
  171. package/src/Sidebar/MenuGroup.tsx +4 -3
  172. package/src/Sidebar/MenuItem.tsx +2 -2
  173. package/src/Sidebar/MenuLink.tsx +3 -1
  174. package/src/Sidebar/MenuLinkItem.tsx +4 -6
  175. package/src/Sidebar/Separator.tsx +2 -2
  176. package/src/Sidebar/SidebarLayout.tsx +3 -3
  177. package/src/Sidebar/types/DrilldownMenuProps.ts +1 -1
  178. package/src/Sidebar/types/ItemState.ts +2 -2
  179. package/src/Sidebar/types/MenuItemProps.ts +1 -1
  180. package/src/Sidebar/types/NavItem.ts +1 -1
  181. package/src/SidebarLogo/SidebarLogo.tsx +0 -1
  182. package/src/SourceCode/SourceCode.tsx +8 -2
  183. package/src/TableOfContent/TableOfContent.tsx +4 -4
  184. package/src/TableOfContent/utils.ts +2 -5
  185. package/src/Tooltip/Tooltip.tsx +1 -1
  186. package/src/globalStyle.ts +12 -3
  187. package/src/hooks/useFullHeight.ts +2 -1
  188. package/src/hooks/useMobileMenu.ts +2 -1
  189. package/src/hooks/useOutsideClick.ts +2 -1
  190. package/src/icons/AlertIcon/AlertIcon.tsx +0 -1
  191. package/src/icons/ArrowIcon/ArrowIcon.tsx +0 -1
  192. package/src/icons/ColorModeIcon/ColorModeIcon.tsx +0 -1
  193. package/src/icons/ShelfIcon/ShelfIcon.tsx +2 -2
  194. package/src/mocks/Link.tsx +0 -1
  195. package/src/types/portal/src/shared/types.d.ts +2 -1
  196. package/src/ui/Box.tsx +2 -8
  197. package/src/ui/Burger.tsx +1 -1
  198. package/src/ui/Dropdown.tsx +3 -2
  199. package/src/ui/Flex.tsx +4 -3
  200. package/src/ui/Tiles/ThinTile.tsx +5 -4
  201. package/src/ui/Tiles/WideTile.tsx +6 -5
  202. package/src/ui/UniversalLink.tsx +11 -11
  203. package/src/ui/darkColors.tsx +56 -17
  204. package/src/ui/index.tsx +2 -3
  205. package/ui/Box.d.ts +1 -1
  206. package/ui/Burger.d.ts +1 -1
  207. package/ui/Burger.js +13 -5
  208. package/ui/Dropdown.d.ts +1 -1
  209. package/ui/Dropdown.js +14 -32
  210. package/ui/Flex.d.ts +3 -3
  211. package/ui/Flex.js +2 -2
  212. package/ui/Tiles/ThinTile.d.ts +2 -1
  213. package/ui/Tiles/ThinTile.js +15 -31
  214. package/ui/Tiles/WideTile.d.ts +1 -1
  215. package/ui/Tiles/WideTile.js +15 -31
  216. package/ui/UniversalLink.d.ts +5 -5
  217. package/ui/UniversalLink.js +3 -26
  218. package/ui/darkColors.js +1 -1
  219. package/ui/index.d.ts +3 -3
@@ -1,15 +1,12 @@
1
- import React, {
2
- BaseSyntheticEvent,
3
- PropsWithChildren,
4
- ReactNode,
5
- useEffect,
6
- useState,
7
- } from 'react';
1
+ import type { BaseSyntheticEvent, PropsWithChildren, ReactNode } from 'react';
2
+ import { useEffect, useState } from 'react';
8
3
  import styled from 'styled-components';
9
4
 
5
+ import type { PanelHeaderProps } from '@theme/Panel/PanelHeader';
6
+
10
7
  import { ShelfIcon } from '@theme/icons';
11
8
  import { PanelBody } from '@theme/Panel/PanelBody';
12
- import { PanelHeader, PanelHeaderProps } from '@theme/Panel/PanelHeader';
9
+ import { PanelHeader } from '@theme/Panel/PanelHeader';
13
10
  import { PanelHeaderTitle } from '@theme/Panel/PanelHeaderTitle';
14
11
 
15
12
  export interface PanelComponentProps {
@@ -18,7 +15,7 @@ export interface PanelComponentProps {
18
15
  renderChildrenHidden?: boolean;
19
16
  header?: ReactNode | ((props: PanelHeaderProps) => ReactNode);
20
17
  onToggle?: (expanded: boolean) => void;
21
- description?: React.ReactNode;
18
+ description?: ReactNode;
22
19
  }
23
20
 
24
21
  export function PanelComponent({
@@ -75,4 +72,8 @@ export function PanelComponent({
75
72
  export const InlineBox = styled.div`
76
73
  display: inline-flex;
77
74
  align-items: center;
75
+
76
+ > span:last-child {
77
+ margin-left: 8px;
78
+ }
78
79
  `;
@@ -1,4 +1,4 @@
1
- import { BaseSyntheticEvent } from 'react';
1
+ import type { BaseSyntheticEvent } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  export interface PanelHeaderProps {
@@ -1,4 +1,4 @@
1
- import React, { memo } from 'react';
1
+ import { memo } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
 
4
4
  import { stringToHslColor } from '@theme/utils';
@@ -1,11 +1,5 @@
1
- import React, {
2
- ChangeEvent,
3
- KeyboardEvent,
4
- ReactNode,
5
- SyntheticEvent,
6
- useEffect,
7
- useState,
8
- } from 'react';
1
+ import type { ChangeEvent, KeyboardEvent, ReactNode, SyntheticEvent } from 'react';
2
+ import { useEffect, useState } from 'react';
9
3
  import { useLocation } from 'react-router-dom';
10
4
  import styled from 'styled-components';
11
5
 
@@ -1,4 +1,4 @@
1
- import React, { SVGProps } from 'react';
1
+ import type { SVGProps } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  const Icon = (props: SVGProps<SVGSVGElement>) => (
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { OperationParameter } from '@portal/types';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import { usePreloadHistory } from '@portal/usePreloadHistory';
@@ -1,4 +1,4 @@
1
- import React, { SVGProps } from 'react';
1
+ import type { SVGProps } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  const Icon = (props: SVGProps<SVGSVGElement>) => (
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef } from 'react';
1
+ import { useEffect, useRef } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import type { ActiveItem, SearchDocument } from '@portal/types';
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  export const highlight = (text: string | string[]): JSX.Element | string => {
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
3
+ import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
4
+
4
5
  import { OperationBadge } from '@theme/OperationBadge';
5
- import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
6
6
  import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
7
7
  import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
8
8
  import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  const Arrow = ({ className }: { className?: string }): JSX.Element => (
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { PropsWithChildren } from 'react';
3
3
 
4
4
  import { ArrowBack } from '@theme/Sidebar/ArrowBack';
5
5
 
@@ -7,10 +7,7 @@ interface BackButtonProps {
7
7
  back: () => void;
8
8
  }
9
9
 
10
- export function BackButton({
11
- children,
12
- back,
13
- }: React.PropsWithChildren<BackButtonProps>): JSX.Element {
10
+ export function BackButton({ children, back }: PropsWithChildren<BackButtonProps>): JSX.Element {
14
11
  return (
15
12
  <Button onClick={back} data-component-name="Sidebar/BackButton">
16
13
  <ArrowBack />
@@ -1,11 +1,12 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { PropsWithChildren } from 'react';
3
+
4
+ import type { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
3
5
 
4
6
  import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
5
7
  import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
6
8
  import { DrilldownMenuItem } from '@theme/Sidebar/DrilldownMenuItem';
7
9
  import { DrilldownMenu } from '@theme/Sidebar/DrilldownMenu';
8
- import { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
9
10
 
10
11
  interface DrilldownProps extends DrilldownMenuProps {
11
12
  isExpanded: boolean;
@@ -17,7 +18,7 @@ export function Drilldown({
17
18
  item,
18
19
  expand,
19
20
  ...props
20
- }: React.PropsWithChildren<DrilldownProps>): JSX.Element {
21
+ }: PropsWithChildren<DrilldownProps>): JSX.Element {
21
22
  return (
22
23
  <Wrapper data-component-name="Sidebar/Drilldown">
23
24
  <DrilldownLabel onClick={expand}>
@@ -1,7 +1,8 @@
1
- import React from 'react';
2
1
  import styled, { keyframes } from 'styled-components';
2
+ import type { PropsWithChildren } from 'react';
3
+
4
+ import type { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
3
5
 
4
- import { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
5
6
  import { BackButton } from '@theme/Sidebar/BackButton';
6
7
  import { DrilldownMenuItem } from '@theme/Sidebar/DrilldownMenuItem';
7
8
 
@@ -10,7 +11,7 @@ export function DrilldownMenu({
10
11
  back,
11
12
  prevActiveItem,
12
13
  children,
13
- }: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element {
14
+ }: PropsWithChildren<DrilldownMenuProps>): JSX.Element {
14
15
  return (
15
16
  <MenuContainer data-component-name="Sidebar/DrilldownMenu">
16
17
  <MenuContent>
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
- import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
3
+ import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
5
4
 
6
5
  export function DrilldownMenuItem({ item }: MenuItemProps): JSX.Element {
7
6
  return (
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  const Icon = ({ className }: { className?: string }): JSX.Element => (
@@ -1,8 +1,9 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { PropsWithChildren } from 'react';
3
+
4
+ import type { ItemState } from '@theme/Sidebar/types/ItemState';
3
5
 
4
6
  import { ArrowIcon } from '@theme/icons/ArrowIcon/ArrowIcon';
5
- import { ItemState } from '@theme/Sidebar/types/ItemState';
6
7
  import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
7
8
  import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
8
9
  import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
@@ -18,7 +19,7 @@ export function MenuGroup({
18
19
  isExpanded,
19
20
  toggleExpanded,
20
21
  children,
21
- }: React.PropsWithChildren<MenuGroupProps>): JSX.Element {
22
+ }: PropsWithChildren<MenuGroupProps>): JSX.Element {
22
23
  return (
23
24
  <Wrapper data-component-name="Sidebar/MenuGroup">
24
25
  <MenuLinkItem item={item}>
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
- import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
3
+ import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
4
+
5
5
  import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
6
6
  import { ExternalIcon } from '@theme/Sidebar/ExternalIcon';
7
7
  import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
@@ -1,6 +1,8 @@
1
1
  import styled from 'styled-components';
2
2
 
3
- import { UniversalLink, UniversalLinkProps } from '@theme/ui/UniversalLink';
3
+ import type { UniversalLinkProps } from '@theme/ui/UniversalLink';
4
+
5
+ import { UniversalLink } from '@theme/ui/UniversalLink';
4
6
 
5
7
  export const MenuLink = styled(UniversalLink).attrs(() => ({
6
8
  'data-component-name': 'Sidebar/MenuLink',
@@ -1,13 +1,11 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { PropsWithChildren } from 'react';
3
+
4
+ import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
3
5
 
4
6
  import { MenuLink } from '@theme/Sidebar/MenuLink';
5
- import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
6
7
 
7
- export function MenuLinkItem({
8
- item,
9
- children,
10
- }: React.PropsWithChildren<MenuItemProps>): JSX.Element {
8
+ export function MenuLinkItem({ item, children }: PropsWithChildren<MenuItemProps>): JSX.Element {
11
9
  return (
12
10
  <Wrapper data-component-name="Sidebar/MenuLinkItem">
13
11
  {item.link ? (
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
- import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
3
+ import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
4
+
5
5
  import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
6
6
  import { SeparatorItem } from '@theme/Sidebar/SeparatorItem';
7
7
 
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { ReactNode } from 'react';
3
3
 
4
4
  import { Sidebar } from '@theme/Sidebar/Sidebar';
5
5
  import { useMobileMenu } from '@theme/hooks/useMobileMenu';
@@ -10,8 +10,8 @@ import { DEFAULT_THEME_NAME } from '@portal/constants';
10
10
  import { SidebarSearch } from '@theme/Search/SidebarSearch';
11
11
 
12
12
  interface SidebarLayoutProps {
13
- versions: React.ReactNode;
14
- menu: React.ReactNode;
13
+ versions: ReactNode;
14
+ menu: ReactNode;
15
15
  }
16
16
 
17
17
  export function SidebarLayout({ versions, menu }: SidebarLayoutProps): JSX.Element | null {
@@ -1,4 +1,4 @@
1
- import { ItemState } from '@theme/Sidebar/types/ItemState';
1
+ import type { ItemState } from '@theme/Sidebar/types/ItemState';
2
2
 
3
3
  export interface DrilldownMenuProps {
4
4
  back: () => void;
@@ -1,5 +1,5 @@
1
- import { NavItem } from '@theme/Sidebar/types/NavItem';
2
- import { MenuStyle } from '@theme/Sidebar/types/MenuStyle';
1
+ import type { NavItem } from '@theme/Sidebar/types/NavItem';
2
+ import type { MenuStyle } from '@theme/Sidebar/types/MenuStyle';
3
3
 
4
4
  export interface ItemState extends NavItem {
5
5
  items: ItemState[];
@@ -1,4 +1,4 @@
1
- import { ItemState } from '@theme/Sidebar/types/ItemState';
1
+ import type { ItemState } from '@theme/Sidebar/types/ItemState';
2
2
 
3
3
  export interface MenuItemProps {
4
4
  item: ItemState;
@@ -1,4 +1,4 @@
1
- import { MenuStyle } from '@theme/Sidebar/types/MenuStyle';
1
+ import type { MenuStyle } from '@theme/Sidebar/types/MenuStyle';
2
2
 
3
3
  export interface NavItem {
4
4
  label?: string;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  export interface LogoProps {
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import { useEffect, useState } from 'react';
2
2
 
3
3
  import { highlight, addLineNumbers } from '@theme/utils';
4
4
  import {
@@ -17,6 +17,7 @@ export interface SourceCodeProps extends CommonCodeProps {
17
17
  lang: string;
18
18
  source?: string;
19
19
  externalSource?: ExternalSource;
20
+ onCopyClick?: () => void;
20
21
  withCopyButton?: boolean;
21
22
  dataTestId?: string;
22
23
  }
@@ -67,6 +68,7 @@ export function SourceCode({
67
68
  lang,
68
69
  source,
69
70
  externalSource,
71
+ onCopyClick,
70
72
  withCopyButton,
71
73
  dataTestId = 'source-code',
72
74
  withLineNumbers,
@@ -86,7 +88,11 @@ export function SourceCode({
86
88
 
87
89
  if (withCopyButton) {
88
90
  return (
89
- <CopyButtonWrapper data={sourceCode} data-component-name="SourceCode/SourceCode">
91
+ <CopyButtonWrapper
92
+ data={sourceCode}
93
+ onCopyClick={onCopyClick}
94
+ data-component-name="SourceCode/SourceCode"
95
+ >
90
96
  {({ renderCopyButton }) => (
91
97
  <SampleControlsWrap>
92
98
  <SampleControls data-cy="copy-button">{renderCopyButton()}</SampleControls>
@@ -1,12 +1,13 @@
1
- import React, { useRef } from 'react';
1
+ import { useRef } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
+ import type { MdHeading } from '@theme/types/portal';
5
+
4
6
  import { getDisplayedHeadingsIds, getDisplayedHeadings, getLeastDepth } from './utils';
5
7
 
6
8
  import { useFullHeight } from '@theme/hooks/useFullHeight';
7
9
  import { useThemeSettings } from '@portal/hooks';
8
10
  import { useActiveHeading } from '@theme/hooks/useActiveHeading';
9
- import { MdHeading } from '@theme/types/portal';
10
11
  import { DEFAULT_THEME_NAME } from '@portal/constants';
11
12
 
12
13
  interface TableOfContentProps {
@@ -85,13 +86,12 @@ const MenuItem = styled.a<{ depth: number }>`
85
86
  background-color: var(--toc-item-background-color);
86
87
  cursor: pointer;
87
88
  font-size: var(--toc-item-font-size);
88
- font-family: var(--toc-item-font-family);
89
89
  padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);
90
90
  padding-left: calc(var(--toc-item-nested-offset) * ${({ depth }) => depth});
91
91
  transition: background-color 0.3s, color 0.3s;
92
92
  text-decoration: none;
93
93
  word-break: break-word;
94
- font-family: var(--heading-font-family);
94
+ font-family: var(--heading-font-family, var(--toc-item-font-family));
95
95
 
96
96
  :hover,
97
97
  &.active {
@@ -1,4 +1,4 @@
1
- import { MdHeading } from '@theme/types/portal';
1
+ import type { MdHeading } from '@theme/types/portal';
2
2
 
3
3
  export function getDisplayedHeadings(
4
4
  headings: Array<MdHeading | null> | null | undefined,
@@ -14,10 +14,7 @@ export function getDisplayedHeadings(
14
14
  if (idx === 0 && heading.depth === 1) {
15
15
  return false;
16
16
  }
17
- if (heading.depth && heading.depth > tocMaxDepth) {
18
- return false;
19
- }
20
- return true;
17
+ return !(heading.depth && heading.depth > tocMaxDepth);
21
18
  });
22
19
  }
23
20
 
@@ -1,4 +1,4 @@
1
- import React, { useEffect, memo, useRef } from 'react';
1
+ import { useEffect, memo, useRef } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
  import type { PropsWithChildren, ReactNode } from 'react';
4
4
 
@@ -656,7 +656,7 @@ const responsePanelColors = css`
656
656
  --panel-response-heading-line-height: 20px;
657
657
  --panel-response-heading-font-weight: var(--font-weight-bold);
658
658
  --panel-response-heading-text-color: var(--text-color);
659
-
659
+
660
660
  --panel-response-body-text-color: var(--text-color);
661
661
 
662
662
  /**
@@ -815,6 +815,7 @@ const apiReferencePanels = css`
815
815
  --panel-font-weight-local: var(--panel-schemas-font-weight);
816
816
  --panel-background-color: var(--panel-schemas-background-color); // @presenter Color
817
817
  --panel-border-local: var(--panel-schemas-border);
818
+ --panel-border-radius-local: calc(1px + var(--panel-border-radius));
818
819
  --panel-chevron-icon-color: var(--panel-schemas-chevron-icon-color); // @presenter Color
819
820
 
820
821
  --panel-body-text-color: var(--panel-schemas-body-text-color); // @presenter Color
@@ -890,6 +891,7 @@ const apiReferencePanels = css`
890
891
  --panel-font-weight-local: var(--panel-samples-font-weight);
891
892
  --panel-background-color: var(--panel-samples-background-color); // @presenter Color
892
893
  --panel-border-local: var(--panel-samples-border);
894
+ --panel-border-radius-local: calc(1px + var(--panel-border-radius));
893
895
  --panel-chevron-icon-color: var(--panel-samples-chevron-icon-color); // @presenter Color
894
896
 
895
897
  --panel-body-text-color: var(--panel-samples-body-text-color); // @presenter Color
@@ -923,6 +925,7 @@ const apiReferencePanels = css`
923
925
  .panel-response-redirect,
924
926
  .panel-response-callback {
925
927
  --panel-body-text-color: var(--panel-response-body-text-color); // @presenter Color
928
+ --panel-border-radius-local: calc(1px + var(--panel-border-radius));
926
929
 
927
930
  --panel-heading-text-color: var(--panel-response-heading-text-color); // @presenter Color
928
931
  --panel-heading-font-size-local: var(--panel-response-heading-font-size);
@@ -1088,7 +1091,7 @@ const apiReferencePanels = css`
1088
1091
  --panel-try-it-tabs-disabled-background-color: var(--color-secondary-500); // @presenter Color
1089
1092
 
1090
1093
  --panel-try-it-tabs-border-color: transparent; // @presenter Color
1091
- --panel-try-it-tabs-hover-border-color: var(--panel-try-it-tabs-active-background-color); // @presenter Color
1094
+ --panel-try-it-tabs-hover-border-color: var(--panel-try-it-tabs-active-border-color); // @presenter Color
1092
1095
  --panel-try-it-tabs-active-border-color: var(--color-accent-500); // @presenter Color
1093
1096
  --panel-try-it-tabs-disabled-border-color: transparent; // @presenter Color
1094
1097
 
@@ -1323,7 +1326,7 @@ const apiReferenceDocs = css`
1323
1326
 
1324
1327
  --schema-type-title-text-color: var(--text-color-secondary); // @presenter Color
1325
1328
  --schema-type-text-color: var(--text-color-secondary); // @presenter Color
1326
- --schema-labels-font-size: 0.8em; // @presenter FontSize
1329
+ --schema-labels-font-size: 1em; // @presenter FontSize
1327
1330
 
1328
1331
  /**
1329
1332
  * @tokens API Reference Schemas Lines Color
@@ -1844,6 +1847,11 @@ const lastUpdated = css`
1844
1847
  --last-updated-line-height: var(--line-height-base);
1845
1848
  `;
1846
1849
 
1850
+ const tile = css`
1851
+ --wide-tile-background-color: var(--color-secondary-50);
1852
+ --thin-tile-background-color: var(--color-secondary-50);
1853
+ `
1854
+
1847
1855
  export const styles = css`
1848
1856
  :root {
1849
1857
  ${baseColors}
@@ -1870,6 +1878,7 @@ export const styles = css`
1870
1878
  ${apiReferencePanels}
1871
1879
  ${apiReferenceDocs}
1872
1880
  ${lastUpdated}
1881
+ ${tile}
1873
1882
  }
1874
1883
 
1875
1884
  :root.dark {
@@ -1,4 +1,5 @@
1
- import { useCallback, useEffect, MutableRefObject, useMemo } from 'react';
1
+ import type { MutableRefObject } from 'react';
2
+ import { useCallback, useEffect, useMemo } from 'react';
2
3
  import throttle from 'lodash.throttle';
3
4
 
4
5
  export function useFullHeight(element: MutableRefObject<HTMLElement | null>): void {
@@ -1,4 +1,5 @@
1
- import { Dispatch, SetStateAction, useEffect, useState } from 'react';
1
+ import type { Dispatch, SetStateAction } from 'react';
2
+ import { useEffect, useState } from 'react';
2
3
  import { useHistory } from 'react-router-dom';
3
4
 
4
5
  export function useMobileMenu(initialState = false): [boolean, Dispatch<SetStateAction<boolean>>] {
@@ -1,4 +1,5 @@
1
- import { MutableRefObject, useEffect } from 'react';
1
+ import type { MutableRefObject } from 'react';
2
+ import { useEffect } from 'react';
2
3
 
3
4
  export function useOutsideClick(
4
5
  ref: MutableRefObject<HTMLElement | null>,
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  export interface AlertIconProps {
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  export interface ArrowIconProps {
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  export interface ColorModeIconProps {
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
1
  import styled, { css } from 'styled-components';
2
+ import type { CSSProperties } from 'react';
3
3
 
4
4
  import { getCssColorVariable } from '@theme/utils';
5
5
 
@@ -16,7 +16,7 @@ export interface ShelfIconProps {
16
16
  size?: string;
17
17
  color?: string;
18
18
  direction: 'left' | 'right' | 'up' | 'down';
19
- style?: React.CSSProperties;
19
+ style?: CSSProperties;
20
20
  }
21
21
 
22
22
  const IntShelfIcon = ({ className, style }: ShelfIconProps): JSX.Element => (
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { omit } from 'lodash';
3
2
 
4
3
  // TODO: use real typings here
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { PERMISSION_PROP_NAME } from './constants';
3
+ import type { ComponentType } from 'react';
3
4
  export declare type ResolvedNavLinkItem = {
4
5
  type: 'link';
5
6
  link: string;
@@ -73,7 +74,7 @@ export interface PageData {
73
74
  versions?: Version[];
74
75
  }
75
76
  export interface CachedPageData extends PageData {
76
- Template: React.ComponentType<{
77
+ Template: ComponentType<{
77
78
  pageProps: PageProps;
78
79
  }>;
79
80
  }
package/src/ui/Box.tsx CHANGED
@@ -1,11 +1,4 @@
1
- import {
2
- space,
3
- position,
4
- flex,
5
- textAlign,
6
- color,
7
- border,
8
- layout,
1
+ import type {
9
2
  SpaceProps,
10
3
  LayoutProps,
11
4
  TextAlignProps,
@@ -14,6 +7,7 @@ import {
14
7
  FlexProps,
15
8
  BordersProps,
16
9
  } from 'styled-system';
10
+ import { space, position, flex, textAlign, color, border, layout } from 'styled-system';
17
11
  import styled from 'styled-components';
18
12
 
19
13
  export interface BoxProps
package/src/ui/Burger.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import React, { MouseEventHandler } from 'react';
1
+ import type { MouseEventHandler } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  export interface BurgerProps {
@@ -1,8 +1,9 @@
1
- import React, { useState, useRef, useEffect } from 'react';
1
+ import { useState, useRef, useEffect } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
+ import type { Version } from '@theme/types/portal';
5
+
4
6
  import { Link } from '@portal/Link';
5
- import { Version } from '@theme/types/portal';
6
7
 
7
8
  type DropdownProps = {
8
9
  items: Version[];
package/src/ui/Flex.tsx CHANGED
@@ -1,6 +1,7 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
- import { flexbox, FlexboxProps, width, WidthProps } from 'styled-system';
2
+ import type { FlexboxProps, WidthProps } from 'styled-system';
3
+ import { flexbox, width } from 'styled-system';
4
+ import type { PropsWithChildren } from 'react';
4
5
 
5
6
  import { Box } from '@theme/ui/Box';
6
7
 
@@ -13,7 +14,7 @@ export const Flex = styled(Box).attrs({ 'data-component-name': 'ui/Flex' })<Flex
13
14
  ${width}
14
15
  `;
15
16
 
16
- export function FlexSection(props: React.PropsWithChildren<FlexProps>): JSX.Element {
17
+ export function FlexSection(props: PropsWithChildren<FlexProps>): JSX.Element {
17
18
  return (
18
19
  <Flex {...props} width={props.width || { xs: '90%', large: 910 }}>
19
20
  {props.children}