@redocly/theme 0.4.7 → 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 (215) 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/PanelComponent.d.ts +3 -3
  54. package/Panel/PanelComponent.js +14 -31
  55. package/Panel/PanelHeader.d.ts +1 -1
  56. package/Profile/Profile.d.ts +2 -2
  57. package/Profile/Profile.js +15 -9
  58. package/Search/Autocomplete.d.ts +1 -1
  59. package/Search/Autocomplete.js +3 -30
  60. package/Search/ClearIcon.d.ts +1 -1
  61. package/Search/ClearIcon.js +2 -3
  62. package/Search/Parameters.js +17 -17
  63. package/Search/Search.js +13 -3
  64. package/Search/SearchIcon.d.ts +1 -1
  65. package/Search/SearchIcon.js +2 -3
  66. package/Search/SearchItem.js +13 -30
  67. package/Search/utils.js +2 -28
  68. package/Sidebar/ApiCallItem.d.ts +1 -1
  69. package/Sidebar/ApiCallItem.js +13 -7
  70. package/Sidebar/ArrowBack.js +13 -5
  71. package/Sidebar/BackButton.d.ts +2 -2
  72. package/Sidebar/BackButton.js +13 -4
  73. package/Sidebar/Drilldown.d.ts +3 -3
  74. package/Sidebar/Drilldown.js +2 -6
  75. package/Sidebar/DrilldownMenu.d.ts +3 -3
  76. package/Sidebar/DrilldownMenu.js +13 -10
  77. package/Sidebar/DrilldownMenuItem.d.ts +1 -1
  78. package/Sidebar/DrilldownMenuItem.js +13 -6
  79. package/Sidebar/ExternalIcon.js +13 -7
  80. package/Sidebar/MenuGroup.d.ts +3 -3
  81. package/Sidebar/MenuGroup.js +13 -8
  82. package/Sidebar/MenuItem.d.ts +1 -1
  83. package/Sidebar/MenuItem.js +13 -7
  84. package/Sidebar/MenuLink.d.ts +1 -1
  85. package/Sidebar/MenuLinkItem.d.ts +3 -3
  86. package/Sidebar/MenuLinkItem.js +2 -2
  87. package/Sidebar/Separator.d.ts +1 -1
  88. package/Sidebar/Separator.js +13 -4
  89. package/Sidebar/SidebarLayout.d.ts +3 -3
  90. package/Sidebar/SidebarLayout.js +13 -7
  91. package/Sidebar/types/DrilldownMenuProps.d.ts +1 -1
  92. package/Sidebar/types/ItemState.d.ts +2 -2
  93. package/Sidebar/types/MenuItemProps.d.ts +1 -1
  94. package/Sidebar/types/NavItem.d.ts +1 -1
  95. package/SidebarLogo/SidebarLogo.js +14 -3
  96. package/SourceCode/SourceCode.d.ts +2 -1
  97. package/SourceCode/SourceCode.js +19 -32
  98. package/TableOfContent/TableOfContent.d.ts +1 -1
  99. package/TableOfContent/TableOfContent.js +21 -35
  100. package/TableOfContent/utils.d.ts +1 -1
  101. package/TableOfContent/utils.js +1 -4
  102. package/Tooltip/Tooltip.d.ts +1 -2
  103. package/Tooltip/Tooltip.js +3 -4
  104. package/hooks/useFullHeight.d.ts +1 -1
  105. package/hooks/useMobileMenu.d.ts +1 -1
  106. package/hooks/useOutsideClick.d.ts +1 -1
  107. package/icons/AlertIcon/AlertIcon.js +17 -20
  108. package/icons/ArrowIcon/ArrowIcon.js +13 -4
  109. package/icons/ColorModeIcon/ColorModeIcon.js +15 -7
  110. package/icons/ShelfIcon/ShelfIcon.d.ts +2 -2
  111. package/icons/ShelfIcon/ShelfIcon.js +13 -4
  112. package/mocks/Link.js +2 -5
  113. package/package.json +1 -1
  114. package/src/Button/Button.tsx +4 -3
  115. package/src/Cards/Card.tsx +3 -3
  116. package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
  117. package/src/CopyButton/CopyButton.tsx +1 -1
  118. package/src/CopyButton/CopyButtonWrapper.tsx +8 -2
  119. package/src/EditPageButton/EditPageButton.tsx +0 -1
  120. package/src/Footer/CustomFooter.tsx +2 -2
  121. package/src/Footer/CustomFooterNavItem.tsx +0 -1
  122. package/src/Footer/Footer.tsx +0 -1
  123. package/src/Footer/FooterColumn.tsx +0 -1
  124. package/src/Footer/FooterColumns.tsx +0 -1
  125. package/src/Footer/FooterCopyright.tsx +0 -1
  126. package/src/JsonViewer/JsonViewer.tsx +5 -2
  127. package/src/LastUpdated/LastUpdated.tsx +0 -1
  128. package/src/Layout/PageLayout.tsx +3 -6
  129. package/src/Layout/RootLayout.tsx +4 -4
  130. package/src/Markdown/Admonition.tsx +2 -2
  131. package/src/Markdown/CodeSample/CodeSample.tsx +1 -1
  132. package/src/Markdown/Details.tsx +2 -2
  133. package/src/Markdown/Heading.tsx +2 -1
  134. package/src/Markdown/MarkdownLayout.tsx +3 -3
  135. package/src/Markdown/MarkdownWrapper.tsx +2 -1
  136. package/src/Markdown/Mermaid.tsx +0 -1
  137. package/src/Markdown/Sup.tsx +1 -1
  138. package/src/Markdown/Tabs/Tab.tsx +0 -1
  139. package/src/Markdown/Tabs/Tabs.tsx +2 -2
  140. package/src/Navbar/MobileNavbarDropdown.tsx +0 -1
  141. package/src/Navbar/MobileNavbarItem.tsx +1 -1
  142. package/src/Navbar/MobileNavbarMenu.tsx +0 -1
  143. package/src/Navbar/Navbar.tsx +6 -5
  144. package/src/Navbar/NavbarDropdown.tsx +0 -1
  145. package/src/Navbar/NavbarItem.tsx +0 -1
  146. package/src/Navbar/NavbarMenu.tsx +0 -1
  147. package/src/NavbarLogo/NavbarLogo.tsx +2 -2
  148. package/src/PageNavigation/NextPageLink.tsx +0 -1
  149. package/src/PageNavigation/PageNavigation.tsx +0 -1
  150. package/src/PageNavigation/PreviousPageLink.tsx +0 -1
  151. package/src/Panel/PanelComponent.tsx +6 -9
  152. package/src/Panel/PanelHeader.ts +1 -1
  153. package/src/Profile/Profile.tsx +1 -1
  154. package/src/Search/Autocomplete.tsx +2 -8
  155. package/src/Search/ClearIcon.tsx +1 -1
  156. package/src/Search/Parameters.tsx +0 -1
  157. package/src/Search/Search.tsx +0 -1
  158. package/src/Search/SearchIcon.tsx +1 -1
  159. package/src/Search/SearchItem.tsx +1 -1
  160. package/src/Search/utils.tsx +0 -1
  161. package/src/Sidebar/ApiCallItem.tsx +2 -2
  162. package/src/Sidebar/ArrowBack.tsx +0 -1
  163. package/src/Sidebar/BackButton.tsx +2 -5
  164. package/src/Sidebar/Drilldown.tsx +4 -3
  165. package/src/Sidebar/DrilldownMenu.tsx +4 -3
  166. package/src/Sidebar/DrilldownMenuItem.tsx +1 -2
  167. package/src/Sidebar/ExternalIcon.tsx +0 -1
  168. package/src/Sidebar/MenuGroup.tsx +4 -3
  169. package/src/Sidebar/MenuItem.tsx +2 -2
  170. package/src/Sidebar/MenuLink.tsx +3 -1
  171. package/src/Sidebar/MenuLinkItem.tsx +4 -6
  172. package/src/Sidebar/Separator.tsx +2 -2
  173. package/src/Sidebar/SidebarLayout.tsx +3 -3
  174. package/src/Sidebar/types/DrilldownMenuProps.ts +1 -1
  175. package/src/Sidebar/types/ItemState.ts +2 -2
  176. package/src/Sidebar/types/MenuItemProps.ts +1 -1
  177. package/src/Sidebar/types/NavItem.ts +1 -1
  178. package/src/SidebarLogo/SidebarLogo.tsx +0 -1
  179. package/src/SourceCode/SourceCode.tsx +8 -2
  180. package/src/TableOfContent/TableOfContent.tsx +4 -4
  181. package/src/TableOfContent/utils.ts +2 -5
  182. package/src/Tooltip/Tooltip.tsx +1 -1
  183. package/src/hooks/useFullHeight.ts +2 -1
  184. package/src/hooks/useMobileMenu.ts +2 -1
  185. package/src/hooks/useOutsideClick.ts +2 -1
  186. package/src/icons/AlertIcon/AlertIcon.tsx +0 -1
  187. package/src/icons/ArrowIcon/ArrowIcon.tsx +0 -1
  188. package/src/icons/ColorModeIcon/ColorModeIcon.tsx +0 -1
  189. package/src/icons/ShelfIcon/ShelfIcon.tsx +2 -2
  190. package/src/mocks/Link.tsx +0 -1
  191. package/src/types/portal/src/shared/types.d.ts +2 -1
  192. package/src/ui/Box.tsx +2 -8
  193. package/src/ui/Burger.tsx +1 -1
  194. package/src/ui/Dropdown.tsx +3 -2
  195. package/src/ui/Flex.tsx +4 -3
  196. package/src/ui/Tiles/ThinTile.tsx +4 -3
  197. package/src/ui/Tiles/WideTile.tsx +5 -4
  198. package/src/ui/UniversalLink.tsx +11 -11
  199. package/src/ui/darkColors.tsx +9 -1
  200. package/src/ui/index.tsx +2 -3
  201. package/ui/Box.d.ts +1 -1
  202. package/ui/Burger.d.ts +1 -1
  203. package/ui/Burger.js +13 -5
  204. package/ui/Dropdown.d.ts +1 -1
  205. package/ui/Dropdown.js +14 -32
  206. package/ui/Flex.d.ts +3 -3
  207. package/ui/Flex.js +2 -2
  208. package/ui/Tiles/ThinTile.d.ts +2 -1
  209. package/ui/Tiles/ThinTile.js +14 -30
  210. package/ui/Tiles/WideTile.d.ts +1 -1
  211. package/ui/Tiles/WideTile.js +14 -30
  212. package/ui/UniversalLink.d.ts +5 -5
  213. package/ui/UniversalLink.js +3 -26
  214. package/ui/darkColors.js +1 -1
  215. package/ui/index.d.ts +3 -3
@@ -3,35 +3,24 @@ 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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
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);
28
16
  };
29
17
  var __importDefault = (this && this.__importDefault) || function (mod) {
30
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
31
19
  };
32
20
  Object.defineProperty(exports, "__esModule", { value: true });
33
21
  exports.TableOfContent = void 0;
34
- var react_1 = __importStar(require("react"));
22
+ var jsx_runtime_1 = require("react/jsx-runtime");
23
+ var react_1 = require("react");
35
24
  var styled_components_1 = __importDefault(require("styled-components"));
36
25
  var utils_1 = require("./utils");
37
26
  var useFullHeight_1 = require("../hooks/useFullHeight");
@@ -56,21 +45,18 @@ function TableOfContent(props) {
56
45
  if (!(headings === null || headings === void 0 ? void 0 : headings.length)) {
57
46
  return null;
58
47
  }
59
- return (react_1.default.createElement(react_1.default.Fragment, null, headings && (react_1.default.createElement(TableOfContentMenu, { "data-component-name": "TableOfContent/TableOfContent" },
60
- react_1.default.createElement(TableOfContentItems, { ref: sidebar },
61
- react_1.default.createElement(TocHeader, null, ((_a = toc === null || toc === void 0 ? void 0 : toc.header) === null || _a === void 0 ? void 0 : _a.label) || 'On this page'),
62
- displayedHeadings.map(function (heading, idx) {
63
- // TODO: not sure about !heading
64
- if (!heading) {
65
- return null;
66
- }
67
- var href = '#' + heading.id;
68
- return (react_1.default.createElement(MenuItem, { key: href + idx, href: href, depth: heading.depth - leastDepth + 1 || 0, className: activeHeadingId === heading.id ? 'active' : '', dangerouslySetInnerHTML: { __html: heading.value || '' }, "data-cy": "toc-".concat(heading.value) }));
69
- }))))));
48
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: headings && ((0, jsx_runtime_1.jsx)(TableOfContentMenu, __assign({ "data-component-name": "TableOfContent/TableOfContent" }, { children: (0, jsx_runtime_1.jsxs)(TableOfContentItems, __assign({ ref: sidebar }, { children: [(0, jsx_runtime_1.jsx)(TocHeader, { children: ((_a = toc === null || toc === void 0 ? void 0 : toc.header) === null || _a === void 0 ? void 0 : _a.label) || 'On this page' }), displayedHeadings.map(function (heading, idx) {
49
+ // TODO: not sure about !heading
50
+ if (!heading) {
51
+ return null;
52
+ }
53
+ var href = '#' + heading.id;
54
+ return ((0, jsx_runtime_1.jsx)(MenuItem, { href: href, depth: heading.depth - leastDepth + 1 || 0, className: activeHeadingId === heading.id ? 'active' : '', dangerouslySetInnerHTML: { __html: heading.value || '' }, "data-cy": "toc-".concat(heading.value) }, href + idx));
55
+ })] })) }))) }));
70
56
  }
71
57
  exports.TableOfContent = TableOfContent;
72
58
  var TocHeader = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: var(--toc-heading-font-family);\n font-size: var(--toc-heading-font-size);\n font-weight: var(--toc-heading-font-weight);\n padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);\n color: var(--toc-heading-text-color);\n text-transform: uppercase;\n"], ["\n font-family: var(--toc-heading-font-family);\n font-size: var(--toc-heading-font-size);\n font-weight: var(--toc-heading-font-weight);\n padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);\n color: var(--toc-heading-text-color);\n text-transform: uppercase;\n"])));
73
- var MenuItem = styled_components_1.default.a(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n color: var(--toc-item-text-color);\n background-color: var(--toc-item-background-color);\n cursor: pointer;\n font-size: var(--toc-item-font-size);\n font-family: var(--toc-item-font-family);\n padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);\n padding-left: calc(var(--toc-item-nested-offset) * ", ");\n transition: background-color 0.3s, color 0.3s;\n text-decoration: none;\n word-break: break-word;\n font-family: var(--heading-font-family);\n\n :hover,\n &.active {\n color: var(--toc-item-active-text-color);\n background-color: var(--toc-item-active-background-color);\n }\n\n :empty {\n padding: 0;\n }\n"], ["\n display: block;\n color: var(--toc-item-text-color);\n background-color: var(--toc-item-background-color);\n cursor: pointer;\n font-size: var(--toc-item-font-size);\n font-family: var(--toc-item-font-family);\n padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);\n padding-left: calc(var(--toc-item-nested-offset) * ", ");\n transition: background-color 0.3s, color 0.3s;\n text-decoration: none;\n word-break: break-word;\n font-family: var(--heading-font-family);\n\n :hover,\n &.active {\n color: var(--toc-item-active-text-color);\n background-color: var(--toc-item-active-background-color);\n }\n\n :empty {\n padding: 0;\n }\n"])), function (_a) {
59
+ var MenuItem = styled_components_1.default.a(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n color: var(--toc-item-text-color);\n background-color: var(--toc-item-background-color);\n cursor: pointer;\n font-size: var(--toc-item-font-size);\n padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);\n padding-left: calc(var(--toc-item-nested-offset) * ", ");\n transition: background-color 0.3s, color 0.3s;\n text-decoration: none;\n word-break: break-word;\n font-family: var(--heading-font-family, var(--toc-item-font-family));\n\n :hover,\n &.active {\n color: var(--toc-item-active-text-color);\n background-color: var(--toc-item-active-background-color);\n }\n\n :empty {\n padding: 0;\n }\n"], ["\n display: block;\n color: var(--toc-item-text-color);\n background-color: var(--toc-item-background-color);\n cursor: pointer;\n font-size: var(--toc-item-font-size);\n padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);\n padding-left: calc(var(--toc-item-nested-offset) * ", ");\n transition: background-color 0.3s, color 0.3s;\n text-decoration: none;\n word-break: break-word;\n font-family: var(--heading-font-family, var(--toc-item-font-family));\n\n :hover,\n &.active {\n color: var(--toc-item-active-text-color);\n background-color: var(--toc-item-active-background-color);\n }\n\n :empty {\n padding: 0;\n }\n"])), function (_a) {
74
60
  var depth = _a.depth;
75
61
  return depth;
76
62
  });
@@ -1,4 +1,4 @@
1
- import { MdHeading } from '@theme/types/portal';
1
+ import type { MdHeading } from '@theme/types/portal';
2
2
  export declare function getDisplayedHeadings(headings: Array<MdHeading | null> | null | undefined, tocMaxDepth: number): Array<MdHeading | null>;
3
3
  export declare function getDisplayedHeadingsIds(headings: Array<MdHeading | null> | null | undefined): Array<string | undefined>;
4
4
  export declare function getLeastDepth(headings: Array<MdHeading | null> | null | undefined): number;
@@ -23,10 +23,7 @@ function getDisplayedHeadings(headings, tocMaxDepth) {
23
23
  if (idx === 0 && heading.depth === 1) {
24
24
  return false;
25
25
  }
26
- if (heading.depth && heading.depth > tocMaxDepth) {
27
- return false;
28
- }
29
- return true;
26
+ return !(heading.depth && heading.depth > tocMaxDepth);
30
27
  });
31
28
  }
32
29
  exports.getDisplayedHeadings = getDisplayedHeadings;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import type { PropsWithChildren, ReactNode } from 'react';
3
2
  export interface TooltipProps {
4
3
  tip: string | ReactNode;
@@ -10,4 +9,4 @@ export interface TooltipProps {
10
9
  dataTestId?: string;
11
10
  }
12
11
  export declare function TooltipComponent({ children, isOpen, tip, withArrow, placement, className, width, dataTestId, }: PropsWithChildren<TooltipProps>): JSX.Element;
13
- export declare const Tooltip: React.NamedExoticComponent<React.PropsWithChildren<TooltipProps>>;
12
+ export declare const Tooltip: import("react").NamedExoticComponent<PropsWithChildren<TooltipProps>>;
@@ -39,7 +39,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
39
39
  };
40
40
  Object.defineProperty(exports, "__esModule", { value: true });
41
41
  exports.Tooltip = exports.TooltipComponent = void 0;
42
- var react_1 = __importStar(require("react"));
42
+ var jsx_runtime_1 = require("react/jsx-runtime");
43
+ var react_1 = require("react");
43
44
  var styled_components_1 = __importStar(require("styled-components"));
44
45
  var hooks_1 = require("../hooks");
45
46
  function TooltipComponent(_a) {
@@ -63,9 +64,7 @@ function TooltipComponent(_a) {
63
64
  onMouseLeave: handleClose,
64
65
  onClick: handleClose,
65
66
  };
66
- return (react_1.default.createElement(TooltipWrapper, __assign({ ref: ref }, controllers, { className: "tooltip-".concat(className), "data-component-name": "Tooltip/Tooltip" }),
67
- children,
68
- isOpened && (react_1.default.createElement(TooltipBody, { "data-cy": dataTestId || (typeof tip === 'string' ? tip : ''), placement: placement, width: width, withArrow: withArrow }, tip))));
67
+ return ((0, jsx_runtime_1.jsxs)(TooltipWrapper, __assign({ ref: ref }, controllers, { className: "tooltip-".concat(className), "data-component-name": "Tooltip/Tooltip" }, { children: [children, isOpened && ((0, jsx_runtime_1.jsx)(TooltipBody, __assign({ "data-cy": dataTestId || (typeof tip === 'string' ? tip : ''), placement: placement, width: width, withArrow: withArrow }, { children: tip })))] })));
69
68
  }
70
69
  exports.TooltipComponent = TooltipComponent;
71
70
  exports.Tooltip = (0, react_1.memo)(TooltipComponent);
@@ -1,2 +1,2 @@
1
- import { MutableRefObject } from 'react';
1
+ import type { MutableRefObject } from 'react';
2
2
  export declare function useFullHeight(element: MutableRefObject<HTMLElement | null>): void;
@@ -1,2 +1,2 @@
1
- import { Dispatch, SetStateAction } from 'react';
1
+ import type { Dispatch, SetStateAction } from 'react';
2
2
  export declare function useMobileMenu(initialState?: boolean): [boolean, Dispatch<SetStateAction<boolean>>];
@@ -1,2 +1,2 @@
1
- import { MutableRefObject } from 'react';
1
+ import type { MutableRefObject } from 'react';
2
2
  export declare function useOutsideClick(ref: MutableRefObject<HTMLElement | null>, handler: (event: MouseEvent | TouchEvent) => void): void;
@@ -3,40 +3,37 @@ 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.AlertIcon = 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 type = _a.type, className = _a.className;
15
26
  switch (type) {
16
27
  case 'warning':
17
- return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
18
- react_1.default.createElement("path", { d: "M250.3 15.1c-132.5 0-239.8 107.2-239.8 239.8 0 132.5 107.2 239.8 239.8 239.8 132.5 0 239.8-107.2 239.8-239.8C490.1 122.3 382.8 15.1 250.3 15.1zM250.3 457.1C138.5 457.1 48 366.7 48 254.8 48 143 138.5 52.5 250.3 52.5c111.8 0 202.3 90.5 202.3 202.3C452.6 366.7 362.1 457.1 250.3 457.1z" }),
19
- react_1.default.createElement("path", { d: "M250.3 135.8c-10.3 0-18.7 8.4-18.7 18.7v120.6c0 10.3 8.4 18.7 18.7 18.7s18.7-8.4 18.7-18.7V154.5C269 144.2 260.7 135.8 250.3 135.8z" }),
20
- react_1.default.createElement("circle", { cx: "250.3", cy: "342.1", r: "25.3" })));
28
+ return ((0, jsx_runtime_1.jsxs)("svg", __assign({ className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M250.3 15.1c-132.5 0-239.8 107.2-239.8 239.8 0 132.5 107.2 239.8 239.8 239.8 132.5 0 239.8-107.2 239.8-239.8C490.1 122.3 382.8 15.1 250.3 15.1zM250.3 457.1C138.5 457.1 48 366.7 48 254.8 48 143 138.5 52.5 250.3 52.5c111.8 0 202.3 90.5 202.3 202.3C452.6 366.7 362.1 457.1 250.3 457.1z" }), (0, jsx_runtime_1.jsx)("path", { d: "M250.3 135.8c-10.3 0-18.7 8.4-18.7 18.7v120.6c0 10.3 8.4 18.7 18.7 18.7s18.7-8.4 18.7-18.7V154.5C269 144.2 260.7 135.8 250.3 135.8z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "250.3", cy: "342.1", r: "25.3" })] })));
21
29
  case 'success':
22
- return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
23
- react_1.default.createElement("path", { d: "M250.3 490.1c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 382.8 117.8 490.1 250.3 490.1zM250.3 48c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 452.6 48 362.1 48 250.3 48 138.5 138.5 48 250.3 48z" }),
24
- react_1.default.createElement("path", { d: "M224.7 349.6c8.5 5.9 20.2 3.8 26.1-4.6L355 195.7c5.9-8.5 3.8-20.2-4.6-26.1s-20.2-3.8-26.1 4.6L220 323.5C214.1 332 216.2 343.7 224.7 349.6z" }),
25
- react_1.default.createElement("path", { d: "M247.1 346.2c7.3-7.3 7.3-19.2 0-26.5l-55.9-55.9c-7.3-7.3-19.2-7.3-26.5 0s-7.3 19.2 0 26.5l55.9 55.9C228 353.5 239.8 353.5 247.1 346.2z" })));
30
+ return ((0, jsx_runtime_1.jsxs)("svg", __assign({ className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M250.3 490.1c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 382.8 117.8 490.1 250.3 490.1zM250.3 48c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 452.6 48 362.1 48 250.3 48 138.5 138.5 48 250.3 48z" }), (0, jsx_runtime_1.jsx)("path", { d: "M224.7 349.6c8.5 5.9 20.2 3.8 26.1-4.6L355 195.7c5.9-8.5 3.8-20.2-4.6-26.1s-20.2-3.8-26.1 4.6L220 323.5C214.1 332 216.2 343.7 224.7 349.6z" }), (0, jsx_runtime_1.jsx)("path", { d: "M247.1 346.2c7.3-7.3 7.3-19.2 0-26.5l-55.9-55.9c-7.3-7.3-19.2-7.3-26.5 0s-7.3 19.2 0 26.5l55.9 55.9C228 353.5 239.8 353.5 247.1 346.2z" })] })));
26
31
  case 'danger':
27
- return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
28
- react_1.default.createElement("path", { d: "M250.3 490.1c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 382.8 117.8 490.1 250.3 490.1zM250.3 48c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 452.6 48 362.1 48 250.3 48 138.5 138.5 48 250.3 48z" }),
29
- react_1.default.createElement("path", { d: "M168.4 332.2c7.3 7.3 19.2 7.3 26.5 0l137.3-137.3c7.3-7.3 7.3-19.2 0-26.5 -7.3-7.3-19.2-7.3-26.5 0L168.4 305.7C161.1 313 161.1 324.9 168.4 332.2z" }),
30
- react_1.default.createElement("path", { d: "M168.4 168.4c-7.3 7.3-7.3 19.2 0 26.5l137.3 137.3c7.3 7.3 19.2 7.3 26.5 0 7.3-7.3 7.3-19.2 0-26.5L194.9 168.4C187.6 161.1 175.7 161.1 168.4 168.4z" })));
32
+ return ((0, jsx_runtime_1.jsxs)("svg", __assign({ className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M250.3 490.1c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 382.8 117.8 490.1 250.3 490.1zM250.3 48c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 452.6 48 362.1 48 250.3 48 138.5 138.5 48 250.3 48z" }), (0, jsx_runtime_1.jsx)("path", { d: "M168.4 332.2c7.3 7.3 19.2 7.3 26.5 0l137.3-137.3c7.3-7.3 7.3-19.2 0-26.5 -7.3-7.3-19.2-7.3-26.5 0L168.4 305.7C161.1 313 161.1 324.9 168.4 332.2z" }), (0, jsx_runtime_1.jsx)("path", { d: "M168.4 168.4c-7.3 7.3-7.3 19.2 0 26.5l137.3 137.3c7.3 7.3 19.2 7.3 26.5 0 7.3-7.3 7.3-19.2 0-26.5L194.9 168.4C187.6 161.1 175.7 161.1 168.4 168.4z" })] })));
31
33
  case 'attention':
32
- return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
33
- react_1.default.createElement("path", { d: "M250.3 301.8c-8.3 0-15-6.7-15-15V181.9c0-8.3 6.7-15 15-15 8.3 0 15 6.7 15 15v104.9C265.3 295.1 258.6 301.8 250.3 301.8zM483.7 377L297.2 66.1c-21.2-35.3-72.6-35.4-93.8 0L16.9 377c-17.6 29.4 3.6 67.1 38 67.1h390.8C480.1 444.1 501.4 406.4 483.7 377L483.7 377zM445.7 414.1H54.9c-11.2 0-18-12.2-12.3-21.7L229.1 81.5c9.6-16 32.8-16 42.4 0L458 392.4C463.7 401.9 456.9 414.1 445.7 414.1z" }),
34
- react_1.default.createElement("circle", { cx: "250.3", cy: "339.2", r: "22.5" })));
34
+ return ((0, jsx_runtime_1.jsxs)("svg", __assign({ className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M250.3 301.8c-8.3 0-15-6.7-15-15V181.9c0-8.3 6.7-15 15-15 8.3 0 15 6.7 15 15v104.9C265.3 295.1 258.6 301.8 250.3 301.8zM483.7 377L297.2 66.1c-21.2-35.3-72.6-35.4-93.8 0L16.9 377c-17.6 29.4 3.6 67.1 38 67.1h390.8C480.1 444.1 501.4 406.4 483.7 377L483.7 377zM445.7 414.1H54.9c-11.2 0-18-12.2-12.3-21.7L229.1 81.5c9.6-16 32.8-16 42.4 0L458 392.4C463.7 401.9 456.9 414.1 445.7 414.1z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "250.3", cy: "339.2", r: "22.5" })] })));
35
35
  default:
36
- return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
37
- react_1.default.createElement("path", { d: "M250.3 490.7c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 383.5 117.8 490.7 250.3 490.7zM250.3 48.6c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 453.2 48 362.7 48 250.9 48 139.1 138.5 48.6 250.3 48.6z" }),
38
- react_1.default.createElement("path", { d: "M250.3 370c10.3 0 18.7-8.4 18.7-18.7V230.6c0-10.3-8.4-18.7-18.7-18.7 -10.3 0-18.7 8.4-18.7 18.7v120.6C231.6 361.6 240 370 250.3 370z" }),
39
- react_1.default.createElement("circle", { cx: "250.3", cy: "163.7", r: "25.3" })));
36
+ return ((0, jsx_runtime_1.jsxs)("svg", __assign({ className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M250.3 490.7c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 383.5 117.8 490.7 250.3 490.7zM250.3 48.6c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 453.2 48 362.7 48 250.9 48 139.1 138.5 48.6 250.3 48.6z" }), (0, jsx_runtime_1.jsx)("path", { d: "M250.3 370c10.3 0 18.7-8.4 18.7-18.7V230.6c0-10.3-8.4-18.7-18.7-18.7 -10.3 0-18.7 8.4-18.7 18.7v120.6C231.6 361.6 240 370 250.3 370z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "250.3", cy: "163.7", r: "25.3" })] })));
40
37
  }
41
38
  }
42
39
  exports.AlertIcon = (0, styled_components_1.default)(Icon).attrs(function () { return ({
@@ -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.7",
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">