@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
@@ -3,12 +3,23 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
4
  return cooked;
5
5
  };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
6
17
  var __importDefault = (this && this.__importDefault) || function (mod) {
7
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
8
19
  };
9
20
  Object.defineProperty(exports, "__esModule", { value: true });
10
21
  exports.ArrowIcon = void 0;
11
- var react_1 = __importDefault(require("react"));
22
+ var jsx_runtime_1 = require("react/jsx-runtime");
12
23
  var styled_components_1 = __importDefault(require("styled-components"));
13
24
  function directionToTransform(_a) {
14
25
  var direction = _a.direction;
@@ -25,9 +36,7 @@ function directionToTransform(_a) {
25
36
  }
26
37
  var Icon = function (_a) {
27
38
  var className = _a.className;
28
- return (react_1.default.createElement("span", { "data-component-name": "icons/ArrowIcon/ArrowIcon" },
29
- react_1.default.createElement("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 7 5", className: className },
30
- react_1.default.createElement("path", { d: "M3.5 2.51L5.806.205a.7.7 0 01.99.99l-2.8 2.8a.698.698 0 01-.99 0l-2.8-2.8a.7.7 0 11.99-.99L3.5 2.51z" }))));
39
+ return ((0, jsx_runtime_1.jsx)("span", __assign({ "data-component-name": "icons/ArrowIcon/ArrowIcon" }, { children: (0, jsx_runtime_1.jsx)("svg", __assign({ fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 7 5", className: className }, { children: (0, jsx_runtime_1.jsx)("path", { d: "M3.5 2.51L5.806.205a.7.7 0 01.99.99l-2.8 2.8a.698.698 0 01-.99 0l-2.8-2.8a.7.7 0 11.99-.99L3.5 2.51z" }) })) })));
31
40
  };
32
41
  exports.ArrowIcon = (0, styled_components_1.default)(Icon)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: var(--sidebar-group-item-chevron-size);\n height: var(--sidebar-group-item-chevron-size);\n fill: var(--sidebar-group-item-chevron-color);\n transform: rotate(", "deg);\n\n vertical-align: middle;\n"], ["\n width: var(--sidebar-group-item-chevron-size);\n height: var(--sidebar-group-item-chevron-size);\n fill: var(--sidebar-group-item-chevron-color);\n transform: rotate(", "deg);\n\n vertical-align: middle;\n"])), directionToTransform);
33
42
  var templateObject_1;
@@ -3,25 +3,33 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
4
  return cooked;
5
5
  };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
6
17
  var __importDefault = (this && this.__importDefault) || function (mod) {
7
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
8
19
  };
9
20
  Object.defineProperty(exports, "__esModule", { value: true });
10
21
  exports.ColorModeIcon = void 0;
11
- var react_1 = __importDefault(require("react"));
22
+ var jsx_runtime_1 = require("react/jsx-runtime");
12
23
  var styled_components_1 = __importDefault(require("styled-components"));
13
24
  function Icon(_a) {
14
25
  var mode = _a.mode, className = _a.className;
15
26
  switch (mode) {
16
27
  case 'dark':
17
- return (react_1.default.createElement("svg", { className: className, "data-testid": "dark", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" },
18
- react_1.default.createElement("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" })));
28
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ className: className, "data-testid": "dark", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" }, { children: (0, jsx_runtime_1.jsx)("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" }) })));
19
29
  case 'light':
20
- return (react_1.default.createElement("svg", { "data-testid": "light", className: className, viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" },
21
- react_1.default.createElement("path", { d: "M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" })));
30
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ "data-testid": "light", className: className, viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" }, { children: (0, jsx_runtime_1.jsx)("path", { d: "M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" }) })));
22
31
  default:
23
- return (react_1.default.createElement("svg", { "data-testid": "custom", className: className, viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" },
24
- react_1.default.createElement("path", { d: "M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 13V2a6 6 0 1 1 0 12z" })));
32
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ "data-testid": "custom", className: className, viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" }, { children: (0, jsx_runtime_1.jsx)("path", { d: "M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 13V2a6 6 0 1 1 0 12z" }) })));
25
33
  }
26
34
  }
27
35
  exports.ColorModeIcon = (0, styled_components_1.default)(Icon).attrs(function () { return ({
@@ -1,11 +1,11 @@
1
- import * as React from 'react';
1
+ import type { CSSProperties } from 'react';
2
2
  export interface ShelfIconProps {
3
3
  className?: string;
4
4
  float?: 'left' | 'right';
5
5
  size?: string;
6
6
  color?: string;
7
7
  direction: 'left' | 'right' | 'up' | 'down';
8
- style?: React.CSSProperties;
8
+ style?: CSSProperties;
9
9
  }
10
10
  export declare const ShelfIcon: import("styled-components").StyledComponent<({ className, style }: ShelfIconProps) => JSX.Element, any, {
11
11
  'data-component-name': string;
@@ -3,6 +3,17 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
4
  return cooked;
5
5
  };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
6
17
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
18
  if (k2 === undefined) k2 = k;
8
19
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -28,7 +39,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
39
  };
29
40
  Object.defineProperty(exports, "__esModule", { value: true });
30
41
  exports.ShelfIcon = void 0;
31
- var React = __importStar(require("react"));
42
+ var jsx_runtime_1 = require("react/jsx-runtime");
32
43
  var styled_components_1 = __importStar(require("styled-components"));
33
44
  var utils_1 = require("../../utils");
34
45
  var directionMap = {
@@ -39,9 +50,7 @@ var directionMap = {
39
50
  };
40
51
  var IntShelfIcon = function (_a) {
41
52
  var className = _a.className, style = _a.style;
42
- return (React.createElement("svg", { className: className, style: style, viewBox: "0 0 4.25 7", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" },
43
- React.createElement("path", { d: "M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z" }),
44
- React.createElement("path", { d: "M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z" })));
53
+ return ((0, jsx_runtime_1.jsxs)("svg", __assign({ className: className, style: style, viewBox: "0 0 4.25 7", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z" })] })));
45
54
  };
46
55
  exports.ShelfIcon = (0, styled_components_1.default)(IntShelfIcon).attrs(function () { return ({
47
56
  'data-component-name': 'icons/ShelfIcon/ShelfIcon',
package/mocks/Link.js CHANGED
@@ -10,18 +10,15 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  Object.defineProperty(exports, "__esModule", { value: true });
17
14
  exports.Link = void 0;
18
- var react_1 = __importDefault(require("react"));
15
+ var jsx_runtime_1 = require("react/jsx-runtime");
19
16
  var lodash_1 = require("lodash");
20
17
  // TODO: use real typings here
21
18
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
22
19
  function Link(props) {
23
20
  // We omit "active" property to avoid "Warning: Received `false` for a non-boolean attribute `active`."
24
21
  var filteredProps = (0, lodash_1.omit)(props, ['active', 'httpVerb', 'hasActiveSubItem']);
25
- return react_1.default.createElement("a", __assign({ href: filteredProps.to }, filteredProps));
22
+ return (0, jsx_runtime_1.jsx)("a", __assign({ href: filteredProps.to }, filteredProps));
26
23
  }
27
24
  exports.Link = Link;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Shared UI components",
5
5
  "author": "team@redocly.com",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
- import styled, { css, FlattenSimpleInterpolation, keyframes, Keyframes } from 'styled-components';
1
+ import type { FlattenSimpleInterpolation, Keyframes } from 'styled-components';
2
+ import styled, { css, keyframes } from 'styled-components';
3
+ import type { FC } from 'react';
3
4
 
4
5
  import { Link } from '@portal/Link';
5
6
 
@@ -139,7 +140,7 @@ const StyledButton = styled.button.attrs(({ color = 'default', extraClass }: But
139
140
  `}
140
141
  `;
141
142
 
142
- const ButtonComponent: React.FC<ButtonProps> = (props) => {
143
+ const ButtonComponent: FC<ButtonProps> = (props) => {
143
144
  if (props.to) {
144
145
  return (
145
146
  <Link to={props.to}>
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
3
+ import type { ResolvedNavItem } from '@theme/types/portal';
4
+
4
5
  import { Link } from '@portal/Link';
5
6
  import { H3 } from '@theme/Typography';
6
- import { ResolvedNavItem } from '@theme/types/portal';
7
7
 
8
8
  export interface CardProps {
9
9
  title?: string;
@@ -31,7 +31,7 @@ export function Card(props: CardProps): JSX.Element {
31
31
 
32
32
  const CardWrapper = styled.div`
33
33
  border-radius: 10px;
34
- box-shadow: 0px 10px 30px 0px rgba(35, 35, 35, 0.1);
34
+ box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.1);
35
35
  padding: 20px;
36
36
  margin: 0 20px 20px 0;
37
37
  min-width: 25%;
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import { useState } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import { useThemeSettings } from '@portal/hooks';
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import { useState } from 'react';
2
2
 
3
3
  import { Button } from '@theme/Button';
4
4
 
@@ -1,7 +1,9 @@
1
- import React, { memo } from 'react';
1
+ import { memo } from 'react';
2
+
3
+ import type { TooltipProps } from '@theme/Tooltip';
2
4
 
3
5
  import { SamplesControlButton } from '@theme/SamplesPanelControls';
4
- import { Tooltip, TooltipProps } from '@theme/Tooltip';
6
+ import { Tooltip } from '@theme/Tooltip';
5
7
  import { useControl } from '@theme/hooks';
6
8
  import { ClipboardService } from '@theme/utils';
7
9
 
@@ -10,12 +12,14 @@ export interface CopyButtonWrapperProps {
10
12
  children: (props: {
11
13
  renderCopyButton: (placement?: TooltipProps['placement']) => JSX.Element;
12
14
  }) => JSX.Element;
15
+ onCopyClick?: () => void;
13
16
  dataTestId?: string;
14
17
  }
15
18
 
16
19
  function CopyButtonWrapperComponent({
17
20
  data,
18
21
  children,
22
+ onCopyClick,
19
23
  dataTestId = 'copy-button',
20
24
  }: CopyButtonWrapperProps): JSX.Element {
21
25
  const tooltip = useControl();
@@ -32,6 +36,8 @@ function CopyButtonWrapperComponent({
32
36
  const content = typeof data === 'string' ? data : JSON.stringify(data, null, 2);
33
37
  ClipboardService.copyCustom(content);
34
38
  showTooltip();
39
+
40
+ onCopyClick?.();
35
41
  };
36
42
 
37
43
  const renderCopyButton = (placement: TooltipProps['placement'] = 'top'): JSX.Element => {
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import { Link } from '@portal/Link';
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
3
+ import type { NavGroupRecord, ResolvedNavItem } from '@theme/types/portal';
4
+
4
5
  import { CustomFooterNavItem } from '@theme/Footer/CustomFooterNavItem';
5
6
  import { FooterCopyright } from '@theme/Footer/FooterCopyright';
6
- import { NavGroupRecord, ResolvedNavItem } from '@theme/types/portal';
7
7
 
8
8
  interface FooterProps {
9
9
  data: NavGroupRecord;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedNavItem, ResolvedNavLinkItem } from '@theme/types/portal';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { NavGroupRecord, ResolvedNavItem } from '@theme/types/portal';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedNavItem } from '@theme/types/portal';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedNavItem } from '@theme/types/portal';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { NavGroup } from '@theme/types/portal';
@@ -1,4 +1,5 @@
1
- import React, { memo, useRef, ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
+ import { memo, useRef } from 'react';
2
3
  import styled from 'styled-components';
3
4
 
4
5
  import { CopyButtonWrapper } from '@theme/CopyButton';
@@ -13,6 +14,7 @@ export interface JsonProps {
13
14
  jsonSampleExpandLevel: number;
14
15
  withLineNumbers?: boolean;
15
16
  startLineNumber?: number;
17
+ onCopyClick?: () => void;
16
18
  }
17
19
 
18
20
  function JsonComponent({
@@ -21,6 +23,7 @@ function JsonComponent({
21
23
  className,
22
24
  withLineNumbers,
23
25
  startLineNumber,
26
+ onCopyClick,
24
27
  }: JsonProps): JSX.Element {
25
28
  const node = useRef<HTMLDivElement | null>(null);
26
29
 
@@ -103,7 +106,7 @@ function JsonComponent({
103
106
  };
104
107
 
105
108
  return (
106
- <CopyButtonWrapper data-cy="copy-button" data={data}>
109
+ <CopyButtonWrapper data-cy="copy-button" data={data} onCopyClick={onCopyClick}>
107
110
  {renderInner}
108
111
  </CopyButtonWrapper>
109
112
  );
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
  import { format } from 'timeago.js';
4
3
 
@@ -1,14 +1,11 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { PropsWithChildren, ReactNode } from 'react';
3
3
 
4
4
  interface PageLayoutProps {
5
- sidebar?: React.ReactNode;
5
+ sidebar?: ReactNode;
6
6
  }
7
7
 
8
- export function PageLayout({
9
- sidebar,
10
- children,
11
- }: React.PropsWithChildren<PageLayoutProps>): JSX.Element {
8
+ export function PageLayout({ sidebar, children }: PropsWithChildren<PageLayoutProps>): JSX.Element {
12
9
  return (
13
10
  <Container data-component-name="Layout/PageLayout">
14
11
  {sidebar}
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { PropsWithChildren, ReactNode } from 'react';
3
3
 
4
4
  interface LayoutConfig {
5
- navbar: React.ReactNode;
6
- footer: React.ReactNode;
5
+ navbar: ReactNode;
6
+ footer: ReactNode;
7
7
  }
8
8
 
9
9
  const Wrapper = styled.div``;
@@ -12,7 +12,7 @@ export function RootLayout({
12
12
  navbar,
13
13
  footer,
14
14
  children,
15
- }: React.PropsWithChildren<LayoutConfig>): JSX.Element {
15
+ }: PropsWithChildren<LayoutConfig>): JSX.Element {
16
16
  return (
17
17
  // TODO: rewrite it to avoid passing components as props
18
18
  <Wrapper data-component-name="Layout/RootLayout">
@@ -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 { AlertIcon } from '@theme/icons/AlertIcon/AlertIcon';
5
5
 
@@ -15,7 +15,7 @@ export function Admonition({
15
15
  type = 'info',
16
16
  name,
17
17
  children,
18
- }: React.PropsWithChildren<AdmonitionProps>): JSX.Element {
18
+ }: PropsWithChildren<AdmonitionProps>): JSX.Element {
19
19
  return (
20
20
  <Wrapper type={type} data-component-name="Markdown/Admonition">
21
21
  <AlertIcon type={type} />
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import { useState } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
 
4
4
  import { ClipboardService } from '@theme/utils/ClipboardService';
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { PropsWithChildren } from 'react';
3
3
 
4
4
  type DetailsProps = {
5
5
  summary: string;
6
6
  };
7
7
 
8
- export function Details({ summary, children }: React.PropsWithChildren<DetailsProps>): JSX.Element {
8
+ export function Details({ summary, children }: PropsWithChildren<DetailsProps>): JSX.Element {
9
9
  return (
10
10
  <StyledDetails>
11
11
  <summary>{summary}</summary>
@@ -1,4 +1,5 @@
1
- import React, { createElement, PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ import { createElement } from 'react';
2
3
 
3
4
  import { concatClassNames } from '@theme/utils';
4
5
 
@@ -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 { PageWrapper } from '@theme/Markdown/PageWrapper';
5
5
  import { ContainerWrapper } from '@theme/Markdown/ContainerWrapper';
@@ -8,8 +8,8 @@ import { EditPageButton } from '@theme/EditPageButton';
8
8
  import { LastUpdated } from '@theme/LastUpdated/LastUpdated';
9
9
 
10
10
  type MarkdownLayoutProps = {
11
- tableOfContent: React.ReactNode;
12
- markdownWrapper: React.ReactNode;
11
+ tableOfContent: ReactNode;
12
+ markdownWrapper: ReactNode;
13
13
  showPrevButton?: boolean;
14
14
  showNextButton?: boolean;
15
15
  editPage?: {
@@ -1,4 +1,5 @@
1
- import styled, { css, FlattenSimpleInterpolation } from 'styled-components';
1
+ import type { FlattenSimpleInterpolation } from 'styled-components';
2
+ import styled, { css } from 'styled-components';
2
3
 
3
4
  import { typography } from '@theme/utils';
4
5
 
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  type MermaidProps = {
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  export function Sup({ children }: PropsWithChildren<unknown>): JSX.Element {
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  type TabProps = {
@@ -1,4 +1,5 @@
1
- import React, { useState, PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ import { useState } from 'react';
2
3
  import styled from 'styled-components';
3
4
 
4
5
  import { Tab } from '@theme/Markdown/Tabs/Tab';
@@ -38,7 +39,6 @@ const TabList = styled.ol`
38
39
  `;
39
40
 
40
41
  const TabContent = styled.div`
41
- padding: 10px 5px;
42
42
  border: 1px solid #ccc;
43
43
  border-top: none;
44
44
  padding: 1rem;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedNavLinkItem } from '@theme/types/portal';
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import { useState } from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { useLocation } from 'react-router-dom';
4
4
 
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedConfigLinks, ResolvedNavItem } from '@theme/types/portal';
@@ -1,9 +1,10 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
2
+ import type { ReactNode } from 'react';
3
+
4
+ import type { ResolvedConfigLinks } from '@theme/types/portal';
3
5
 
4
6
  import { useThemeSettings } from '@portal/hooks';
5
7
  import { DEFAULT_THEME_NAME } from '@portal/constants';
6
- import { ResolvedConfigLinks } from '@theme/types/portal';
7
8
  import { NavbarMenu } from '@theme/Navbar';
8
9
  import { useMobileMenu } from '@theme/hooks/useMobileMenu';
9
10
  import { MobileNavbarMenuButton } from '@theme/Navbar/MobileNavbarMenuButton';
@@ -12,9 +13,9 @@ import { ColorModeSwitcher } from '@theme/ColorModeSwitcher/ColorModeSwitcher';
12
13
 
13
14
  interface NavbarProps {
14
15
  menu: ResolvedConfigLinks;
15
- logo: React.ReactNode;
16
- search: React.ReactNode;
17
- profile?: React.ReactNode;
16
+ logo: ReactNode;
17
+ search: ReactNode;
18
+ profile?: ReactNode;
18
19
  }
19
20
 
20
21
  export function Navbar({ menu, logo, search, profile }: NavbarProps): JSX.Element | null {
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedNavLinkItem } from '@theme/types/portal';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
  import { useLocation } from 'react-router-dom';
4
3
 
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedConfigLinks, ResolvedNavItem } from '@theme/types/portal';
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
3
+ import type { LogoConfig } from '@theme/types/portal';
4
+
4
5
  import { Link } from '@portal/Link';
5
- import { LogoConfig } from '@theme/types/portal';
6
6
 
7
7
  export type NavbarLogoProps = { logo: Pick<LogoConfig, 'image' | 'link' | 'altText'> };
8
8
 
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedNavItemWithLink } from '@theme/types/portal';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import { PreviousPageLink } from '@theme/PageNavigation/PreviousPageLink';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import styled from 'styled-components';
3
2
 
4
3
  import type { ResolvedNavItemWithLink } from '@theme/types/portal';
@@ -14,8 +14,8 @@ export const Panel = styled(PanelComponent).attrs(({ className }) => ({
14
14
  font-family: var(--panel-font-family-local);
15
15
  font-size: var(--panel-font-size-local);
16
16
  font-weight: var(--panel-font-weight-local);
17
+ border-radius: var(--panel-border-radius-local);
17
18
  border: var(--panel-border-local);
18
- border-radius: var(--panel-border-radius);
19
19
 
20
20
  ${PanelHeader} + ${PanelBody} {
21
21
  border-top-left-radius: 0;
@@ -24,7 +24,7 @@ export const Panel = styled(PanelComponent).attrs(({ className }) => ({
24
24
 
25
25
  ${PanelHeader} {
26
26
  ${ShelfIcon} {
27
- fill: var(--panel-chevron-icon-color); // ?????
27
+ fill: var(--panel-chevron-icon-color);
28
28
  }
29
29
  }
30
30