@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.
- package/Button/Button.d.ts +3 -3
- package/Button/Button.js +3 -7
- package/Cards/Card.d.ts +1 -1
- package/Cards/Card.js +14 -7
- package/ColorModeSwitcher/ColorModeSwitcher.js +13 -25
- package/CopyButton/CopyButton.js +13 -24
- package/CopyButton/CopyButtonWrapper.d.ts +4 -3
- package/CopyButton/CopyButtonWrapper.js +15 -26
- package/EditPageButton/EditPageButton.js +13 -4
- package/Footer/CustomFooter.d.ts +1 -1
- package/Footer/CustomFooter.js +15 -6
- package/Footer/CustomFooterNavItem.js +13 -4
- package/Footer/Footer.js +13 -4
- package/Footer/FooterColumn.js +18 -9
- package/Footer/FooterColumns.js +13 -3
- package/Footer/FooterCopyright.js +13 -2
- package/JsonViewer/JsonViewer.d.ts +4 -3
- package/JsonViewer/JsonViewer.js +17 -34
- package/LastUpdated/LastUpdated.js +13 -4
- package/Layout/PageLayout.d.ts +3 -3
- package/Layout/PageLayout.js +13 -4
- package/Layout/RootLayout.d.ts +4 -4
- package/Layout/RootLayout.js +13 -5
- package/Markdown/Admonition.d.ts +2 -2
- package/Markdown/Admonition.js +13 -5
- package/Markdown/CodeSample/CodeSample.js +14 -7
- package/Markdown/Details.d.ts +2 -2
- package/Markdown/Details.js +2 -4
- package/Markdown/Heading.d.ts +1 -1
- package/Markdown/Heading.js +15 -29
- package/Markdown/MarkdownLayout.d.ts +3 -3
- package/Markdown/MarkdownLayout.js +13 -9
- package/Markdown/MarkdownWrapper.d.ts +1 -1
- package/Markdown/Mermaid.js +2 -2
- package/Markdown/Sup.d.ts +1 -1
- package/Markdown/Sup.js +13 -2
- package/Markdown/Tabs/Tab.js +13 -2
- package/Markdown/Tabs/Tabs.d.ts +1 -1
- package/Markdown/Tabs/Tabs.js +21 -34
- package/Navbar/MobileNavbarDropdown.js +13 -3
- package/Navbar/MobileNavbarItem.js +14 -31
- package/Navbar/MobileNavbarMenu.js +15 -6
- package/Navbar/Navbar.d.ts +5 -5
- package/Navbar/Navbar.js +13 -10
- package/Navbar/NavbarDropdown.js +13 -3
- package/Navbar/NavbarItem.js +14 -8
- package/Navbar/NavbarMenu.js +15 -4
- package/NavbarLogo/NavbarLogo.d.ts +1 -1
- package/NavbarLogo/NavbarLogo.js +14 -3
- package/PageNavigation/NextPageLink.js +14 -3
- package/PageNavigation/PageNavigation.js +13 -4
- package/PageNavigation/PreviousPageLink.js +14 -3
- package/Panel/Panel.js +1 -1
- package/Panel/PanelComponent.d.ts +3 -3
- package/Panel/PanelComponent.js +15 -32
- package/Panel/PanelHeader.d.ts +1 -1
- package/Profile/Profile.d.ts +2 -2
- package/Profile/Profile.js +15 -9
- package/Search/Autocomplete.d.ts +1 -1
- package/Search/Autocomplete.js +3 -30
- package/Search/ClearIcon.d.ts +1 -1
- package/Search/ClearIcon.js +2 -3
- package/Search/Parameters.js +17 -17
- package/Search/Search.js +13 -3
- package/Search/SearchIcon.d.ts +1 -1
- package/Search/SearchIcon.js +2 -3
- package/Search/SearchItem.js +13 -30
- package/Search/utils.js +2 -28
- package/Sidebar/ApiCallItem.d.ts +1 -1
- package/Sidebar/ApiCallItem.js +13 -7
- package/Sidebar/ArrowBack.js +13 -5
- package/Sidebar/BackButton.d.ts +2 -2
- package/Sidebar/BackButton.js +13 -4
- package/Sidebar/Drilldown.d.ts +3 -3
- package/Sidebar/Drilldown.js +2 -6
- package/Sidebar/DrilldownMenu.d.ts +3 -3
- package/Sidebar/DrilldownMenu.js +13 -10
- package/Sidebar/DrilldownMenuItem.d.ts +1 -1
- package/Sidebar/DrilldownMenuItem.js +13 -6
- package/Sidebar/ExternalIcon.js +13 -7
- package/Sidebar/MenuGroup.d.ts +3 -3
- package/Sidebar/MenuGroup.js +13 -8
- package/Sidebar/MenuItem.d.ts +1 -1
- package/Sidebar/MenuItem.js +13 -7
- package/Sidebar/MenuLink.d.ts +1 -1
- package/Sidebar/MenuLinkItem.d.ts +3 -3
- package/Sidebar/MenuLinkItem.js +2 -2
- package/Sidebar/Separator.d.ts +1 -1
- package/Sidebar/Separator.js +13 -4
- package/Sidebar/SidebarLayout.d.ts +3 -3
- package/Sidebar/SidebarLayout.js +13 -7
- package/Sidebar/types/DrilldownMenuProps.d.ts +1 -1
- package/Sidebar/types/ItemState.d.ts +2 -2
- package/Sidebar/types/MenuItemProps.d.ts +1 -1
- package/Sidebar/types/NavItem.d.ts +1 -1
- package/SidebarLogo/SidebarLogo.js +14 -3
- package/SourceCode/SourceCode.d.ts +2 -1
- package/SourceCode/SourceCode.js +19 -32
- package/TableOfContent/TableOfContent.d.ts +1 -1
- package/TableOfContent/TableOfContent.js +21 -35
- package/TableOfContent/utils.d.ts +1 -1
- package/TableOfContent/utils.js +1 -4
- package/Tooltip/Tooltip.d.ts +1 -2
- package/Tooltip/Tooltip.js +3 -4
- package/globalStyle.js +7 -6
- package/hooks/useFullHeight.d.ts +1 -1
- package/hooks/useMobileMenu.d.ts +1 -1
- package/hooks/useOutsideClick.d.ts +1 -1
- package/icons/AlertIcon/AlertIcon.js +17 -20
- package/icons/ArrowIcon/ArrowIcon.js +13 -4
- package/icons/ColorModeIcon/ColorModeIcon.js +15 -7
- package/icons/ShelfIcon/ShelfIcon.d.ts +2 -2
- package/icons/ShelfIcon/ShelfIcon.js +13 -4
- package/mocks/Link.js +2 -5
- package/package.json +1 -1
- package/src/Button/Button.tsx +4 -3
- package/src/Cards/Card.tsx +3 -3
- package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
- package/src/CopyButton/CopyButton.tsx +1 -1
- package/src/CopyButton/CopyButtonWrapper.tsx +8 -2
- package/src/EditPageButton/EditPageButton.tsx +0 -1
- package/src/Footer/CustomFooter.tsx +2 -2
- package/src/Footer/CustomFooterNavItem.tsx +0 -1
- package/src/Footer/Footer.tsx +0 -1
- package/src/Footer/FooterColumn.tsx +0 -1
- package/src/Footer/FooterColumns.tsx +0 -1
- package/src/Footer/FooterCopyright.tsx +0 -1
- package/src/JsonViewer/JsonViewer.tsx +5 -2
- package/src/LastUpdated/LastUpdated.tsx +0 -1
- package/src/Layout/PageLayout.tsx +3 -6
- package/src/Layout/RootLayout.tsx +4 -4
- package/src/Markdown/Admonition.tsx +2 -2
- package/src/Markdown/CodeSample/CodeSample.tsx +1 -1
- package/src/Markdown/Details.tsx +2 -2
- package/src/Markdown/Heading.tsx +2 -1
- package/src/Markdown/MarkdownLayout.tsx +3 -3
- package/src/Markdown/MarkdownWrapper.tsx +2 -1
- package/src/Markdown/Mermaid.tsx +0 -1
- package/src/Markdown/Sup.tsx +1 -1
- package/src/Markdown/Tabs/Tab.tsx +0 -1
- package/src/Markdown/Tabs/Tabs.tsx +2 -2
- package/src/Navbar/MobileNavbarDropdown.tsx +0 -1
- package/src/Navbar/MobileNavbarItem.tsx +1 -1
- package/src/Navbar/MobileNavbarMenu.tsx +0 -1
- package/src/Navbar/Navbar.tsx +6 -5
- package/src/Navbar/NavbarDropdown.tsx +0 -1
- package/src/Navbar/NavbarItem.tsx +0 -1
- package/src/Navbar/NavbarMenu.tsx +0 -1
- package/src/NavbarLogo/NavbarLogo.tsx +2 -2
- package/src/PageNavigation/NextPageLink.tsx +0 -1
- package/src/PageNavigation/PageNavigation.tsx +0 -1
- package/src/PageNavigation/PreviousPageLink.tsx +0 -1
- package/src/Panel/Panel.ts +2 -2
- package/src/Panel/PanelComponent.tsx +10 -9
- package/src/Panel/PanelHeader.ts +1 -1
- package/src/Profile/Profile.tsx +1 -1
- package/src/Search/Autocomplete.tsx +2 -8
- package/src/Search/ClearIcon.tsx +1 -1
- package/src/Search/Parameters.tsx +0 -1
- package/src/Search/Search.tsx +0 -1
- package/src/Search/SearchIcon.tsx +1 -1
- package/src/Search/SearchItem.tsx +1 -1
- package/src/Search/utils.tsx +0 -1
- package/src/Sidebar/ApiCallItem.tsx +2 -2
- package/src/Sidebar/ArrowBack.tsx +0 -1
- package/src/Sidebar/BackButton.tsx +2 -5
- package/src/Sidebar/Drilldown.tsx +4 -3
- package/src/Sidebar/DrilldownMenu.tsx +4 -3
- package/src/Sidebar/DrilldownMenuItem.tsx +1 -2
- package/src/Sidebar/ExternalIcon.tsx +0 -1
- package/src/Sidebar/MenuGroup.tsx +4 -3
- package/src/Sidebar/MenuItem.tsx +2 -2
- package/src/Sidebar/MenuLink.tsx +3 -1
- package/src/Sidebar/MenuLinkItem.tsx +4 -6
- package/src/Sidebar/Separator.tsx +2 -2
- package/src/Sidebar/SidebarLayout.tsx +3 -3
- package/src/Sidebar/types/DrilldownMenuProps.ts +1 -1
- package/src/Sidebar/types/ItemState.ts +2 -2
- package/src/Sidebar/types/MenuItemProps.ts +1 -1
- package/src/Sidebar/types/NavItem.ts +1 -1
- package/src/SidebarLogo/SidebarLogo.tsx +0 -1
- package/src/SourceCode/SourceCode.tsx +8 -2
- package/src/TableOfContent/TableOfContent.tsx +4 -4
- package/src/TableOfContent/utils.ts +2 -5
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/globalStyle.ts +12 -3
- package/src/hooks/useFullHeight.ts +2 -1
- package/src/hooks/useMobileMenu.ts +2 -1
- package/src/hooks/useOutsideClick.ts +2 -1
- package/src/icons/AlertIcon/AlertIcon.tsx +0 -1
- package/src/icons/ArrowIcon/ArrowIcon.tsx +0 -1
- package/src/icons/ColorModeIcon/ColorModeIcon.tsx +0 -1
- package/src/icons/ShelfIcon/ShelfIcon.tsx +2 -2
- package/src/mocks/Link.tsx +0 -1
- package/src/types/portal/src/shared/types.d.ts +2 -1
- package/src/ui/Box.tsx +2 -8
- package/src/ui/Burger.tsx +1 -1
- package/src/ui/Dropdown.tsx +3 -2
- package/src/ui/Flex.tsx +4 -3
- package/src/ui/Tiles/ThinTile.tsx +5 -4
- package/src/ui/Tiles/WideTile.tsx +6 -5
- package/src/ui/UniversalLink.tsx +11 -11
- package/src/ui/darkColors.tsx +56 -17
- package/src/ui/index.tsx +2 -3
- package/ui/Box.d.ts +1 -1
- package/ui/Burger.d.ts +1 -1
- package/ui/Burger.js +13 -5
- package/ui/Dropdown.d.ts +1 -1
- package/ui/Dropdown.js +14 -32
- package/ui/Flex.d.ts +3 -3
- package/ui/Flex.js +2 -2
- package/ui/Tiles/ThinTile.d.ts +2 -1
- package/ui/Tiles/ThinTile.js +15 -31
- package/ui/Tiles/WideTile.d.ts +1 -1
- package/ui/Tiles/WideTile.js +15 -31
- package/ui/UniversalLink.d.ts +5 -5
- package/ui/UniversalLink.js +3 -26
- package/ui/darkColors.js +1 -1
- 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
|
|
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 (
|
|
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
|
|
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 (
|
|
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 (
|
|
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 (
|
|
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
|
|
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?:
|
|
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
|
|
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 (
|
|
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
|
|
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
|
|
22
|
+
return (0, jsx_runtime_1.jsx)("a", __assign({ href: filteredProps.to }, filteredProps));
|
|
26
23
|
}
|
|
27
24
|
exports.Link = Link;
|
package/package.json
CHANGED
package/src/Button/Button.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import styled, { css,
|
|
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:
|
|
143
|
+
const ButtonComponent: FC<ButtonProps> = (props) => {
|
|
143
144
|
if (props.to) {
|
|
144
145
|
return (
|
|
145
146
|
<Link to={props.to}>
|
package/src/Cards/Card.tsx
CHANGED
|
@@ -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:
|
|
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,7 +1,9 @@
|
|
|
1
|
-
import
|
|
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
|
|
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,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;
|
package/src/Footer/Footer.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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,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?:
|
|
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:
|
|
6
|
-
footer:
|
|
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
|
-
}:
|
|
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
|
-
}:
|
|
18
|
+
}: PropsWithChildren<AdmonitionProps>): JSX.Element {
|
|
19
19
|
return (
|
|
20
20
|
<Wrapper type={type} data-component-name="Markdown/Admonition">
|
|
21
21
|
<AlertIcon type={type} />
|
package/src/Markdown/Details.tsx
CHANGED
|
@@ -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 }:
|
|
8
|
+
export function Details({ summary, children }: PropsWithChildren<DetailsProps>): JSX.Element {
|
|
9
9
|
return (
|
|
10
10
|
<StyledDetails>
|
|
11
11
|
<summary>{summary}</summary>
|
package/src/Markdown/Heading.tsx
CHANGED
|
@@ -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:
|
|
12
|
-
markdownWrapper:
|
|
11
|
+
tableOfContent: ReactNode;
|
|
12
|
+
markdownWrapper: ReactNode;
|
|
13
13
|
showPrevButton?: boolean;
|
|
14
14
|
showNextButton?: boolean;
|
|
15
15
|
editPage?: {
|
package/src/Markdown/Mermaid.tsx
CHANGED
package/src/Markdown/Sup.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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;
|
package/src/Navbar/Navbar.tsx
CHANGED
|
@@ -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:
|
|
16
|
-
search:
|
|
17
|
-
profile?:
|
|
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,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
|
|
package/src/Panel/Panel.ts
CHANGED
|
@@ -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
|
|