@redocly/theme 0.4.8 → 0.4.9
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 +2 -2
- package/Button/Button.js +7 -3
- package/Cards/Card.js +6 -13
- package/ColorModeSwitcher/ColorModeSwitcher.js +25 -13
- package/CopyButton/CopyButton.js +24 -13
- package/CopyButton/CopyButtonWrapper.d.ts +2 -2
- package/CopyButton/CopyButtonWrapper.js +25 -13
- package/EditPageButton/EditPageButton.js +4 -13
- package/Footer/CustomFooter.js +6 -15
- package/Footer/CustomFooterNavItem.js +4 -13
- package/Footer/Footer.js +4 -13
- package/Footer/FooterColumn.js +9 -18
- package/Footer/FooterColumns.js +3 -13
- package/Footer/FooterCopyright.js +2 -13
- package/JsonViewer/JsonViewer.d.ts +3 -3
- package/JsonViewer/JsonViewer.js +33 -16
- package/LastUpdated/LastUpdated.js +4 -13
- package/Layout/PageLayout.d.ts +3 -3
- package/Layout/PageLayout.js +4 -13
- package/Layout/RootLayout.d.ts +4 -4
- package/Layout/RootLayout.js +5 -13
- package/Markdown/Admonition.d.ts +2 -2
- package/Markdown/Admonition.js +5 -13
- package/Markdown/CodeSample/CodeSample.d.ts +10 -3
- package/Markdown/CodeSample/CodeSample.js +17 -5
- package/Markdown/Details.d.ts +2 -2
- package/Markdown/Details.js +4 -2
- package/Markdown/Heading.js +29 -15
- package/Markdown/MarkdownLayout.d.ts +3 -3
- package/Markdown/MarkdownLayout.js +9 -13
- package/Markdown/Mermaid.js +2 -2
- package/Markdown/Sup.js +2 -13
- package/Markdown/Tabs/Tab.js +2 -13
- package/Markdown/Tabs/Tabs.js +34 -21
- package/Navbar/MobileNavbarDropdown.js +3 -13
- package/Navbar/MobileNavbarItem.js +31 -14
- package/Navbar/MobileNavbarMenu.js +6 -15
- package/Navbar/Navbar.d.ts +4 -4
- package/Navbar/Navbar.js +10 -13
- package/Navbar/NavbarDropdown.js +3 -13
- package/Navbar/NavbarItem.js +8 -14
- package/Navbar/NavbarMenu.js +4 -15
- package/NavbarLogo/NavbarLogo.js +3 -14
- package/PageNavigation/NextPageLink.js +3 -14
- package/PageNavigation/PageNavigation.js +4 -13
- package/PageNavigation/PreviousPageLink.js +3 -14
- package/Panel/PanelComponent.d.ts +2 -1
- package/Panel/PanelComponent.js +31 -14
- package/Profile/Profile.d.ts +2 -2
- package/Profile/Profile.js +9 -15
- package/Search/Autocomplete.js +30 -3
- package/Search/ClearIcon.js +3 -2
- package/Search/Parameters.js +17 -17
- package/Search/Search.js +3 -13
- package/Search/SearchIcon.js +3 -2
- package/Search/SearchItem.js +30 -13
- package/Search/utils.js +28 -2
- package/Sidebar/ApiCallItem.js +7 -13
- package/Sidebar/ArrowBack.js +5 -13
- package/Sidebar/BackButton.d.ts +2 -2
- package/Sidebar/BackButton.js +4 -13
- package/Sidebar/Drilldown.d.ts +2 -2
- package/Sidebar/Drilldown.js +6 -2
- package/Sidebar/DrilldownMenu.d.ts +2 -2
- package/Sidebar/DrilldownMenu.js +10 -13
- package/Sidebar/DrilldownMenuItem.js +6 -13
- package/Sidebar/ExternalIcon.js +7 -13
- package/Sidebar/MenuGroup.d.ts +2 -2
- package/Sidebar/MenuGroup.js +8 -13
- package/Sidebar/MenuItem.js +7 -13
- package/Sidebar/MenuLinkItem.d.ts +2 -2
- package/Sidebar/MenuLinkItem.js +2 -2
- package/Sidebar/Separator.js +4 -13
- package/Sidebar/SidebarLayout.d.ts +3 -3
- package/Sidebar/SidebarLayout.js +7 -13
- package/SidebarLogo/SidebarLogo.js +3 -14
- package/SourceCode/SourceCode.js +31 -18
- package/TableOfContent/TableOfContent.js +34 -20
- package/Tooltip/Tooltip.d.ts +2 -1
- package/Tooltip/Tooltip.js +4 -3
- package/icons/AlertIcon/AlertIcon.js +20 -17
- package/icons/ArrowIcon/ArrowIcon.js +4 -13
- package/icons/ColorModeIcon/ColorModeIcon.js +7 -15
- package/icons/ShelfIcon/ShelfIcon.d.ts +2 -2
- package/icons/ShelfIcon/ShelfIcon.js +4 -13
- package/mocks/Link.js +5 -2
- package/package.json +1 -1
- package/src/Button/Button.tsx +2 -2
- package/src/Cards/Card.tsx +1 -0
- package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
- package/src/CopyButton/CopyButton.tsx +1 -1
- package/src/CopyButton/CopyButtonWrapper.tsx +1 -1
- package/src/EditPageButton/EditPageButton.tsx +1 -0
- package/src/Footer/CustomFooter.tsx +1 -0
- package/src/Footer/CustomFooterNavItem.tsx +1 -0
- package/src/Footer/Footer.tsx +1 -0
- package/src/Footer/FooterColumn.tsx +1 -0
- package/src/Footer/FooterColumns.tsx +1 -0
- package/src/Footer/FooterCopyright.tsx +1 -0
- package/src/JsonViewer/JsonViewer.tsx +1 -1
- package/src/LastUpdated/LastUpdated.tsx +1 -0
- package/src/Layout/PageLayout.tsx +6 -3
- package/src/Layout/RootLayout.tsx +4 -4
- package/src/Markdown/Admonition.tsx +2 -2
- package/src/Markdown/CodeSample/CodeSample.tsx +37 -8
- package/src/Markdown/Details.tsx +2 -2
- package/src/Markdown/Heading.tsx +1 -1
- package/src/Markdown/MarkdownLayout.tsx +3 -3
- package/src/Markdown/Mermaid.tsx +1 -0
- package/src/Markdown/Sup.tsx +1 -0
- package/src/Markdown/Tabs/Tab.tsx +1 -0
- package/src/Markdown/Tabs/Tabs.tsx +2 -1
- package/src/Navbar/MobileNavbarDropdown.tsx +1 -0
- package/src/Navbar/MobileNavbarItem.tsx +1 -1
- package/src/Navbar/MobileNavbarMenu.tsx +1 -0
- package/src/Navbar/Navbar.tsx +4 -4
- package/src/Navbar/NavbarDropdown.tsx +1 -0
- package/src/Navbar/NavbarItem.tsx +1 -0
- package/src/Navbar/NavbarMenu.tsx +1 -0
- package/src/NavbarLogo/NavbarLogo.tsx +1 -0
- package/src/PageNavigation/NextPageLink.tsx +1 -0
- package/src/PageNavigation/PageNavigation.tsx +1 -0
- package/src/PageNavigation/PreviousPageLink.tsx +1 -0
- package/src/Panel/PanelComponent.tsx +2 -2
- package/src/Profile/Profile.tsx +1 -1
- package/src/Search/Autocomplete.tsx +1 -1
- package/src/Search/ClearIcon.tsx +1 -0
- package/src/Search/Parameters.tsx +1 -0
- package/src/Search/Search.tsx +1 -0
- package/src/Search/SearchIcon.tsx +1 -0
- package/src/Search/SearchItem.tsx +1 -1
- package/src/Search/utils.tsx +1 -0
- package/src/Sidebar/ApiCallItem.tsx +1 -0
- package/src/Sidebar/ArrowBack.tsx +1 -0
- package/src/Sidebar/BackButton.tsx +5 -2
- package/src/Sidebar/Drilldown.tsx +2 -2
- package/src/Sidebar/DrilldownMenu.tsx +2 -2
- package/src/Sidebar/DrilldownMenuItem.tsx +1 -0
- package/src/Sidebar/ExternalIcon.tsx +1 -0
- package/src/Sidebar/MenuGroup.tsx +2 -2
- package/src/Sidebar/MenuItem.tsx +1 -0
- package/src/Sidebar/MenuLinkItem.tsx +5 -2
- package/src/Sidebar/Separator.tsx +1 -0
- package/src/Sidebar/SidebarLayout.tsx +3 -3
- package/src/SidebarLogo/SidebarLogo.tsx +1 -0
- package/src/SourceCode/SourceCode.tsx +1 -1
- package/src/TableOfContent/TableOfContent.tsx +1 -1
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/icons/AlertIcon/AlertIcon.tsx +1 -0
- package/src/icons/ArrowIcon/ArrowIcon.tsx +1 -0
- package/src/icons/ColorModeIcon/ColorModeIcon.tsx +1 -0
- package/src/icons/ShelfIcon/ShelfIcon.tsx +2 -2
- package/src/mocks/Link.tsx +1 -0
- package/src/types/portal/src/shared/types.d.ts +1 -2
- package/src/ui/Burger.tsx +1 -0
- package/src/ui/Dropdown.tsx +1 -1
- package/src/ui/Flex.tsx +2 -2
- package/src/ui/Tiles/ThinTile.tsx +1 -1
- package/src/ui/Tiles/WideTile.tsx +1 -1
- package/src/ui/UniversalLink.tsx +10 -9
- package/src/ui/index.tsx +3 -2
- package/ui/Burger.js +5 -13
- package/ui/Dropdown.js +32 -14
- package/ui/Flex.d.ts +2 -2
- package/ui/Flex.js +2 -2
- package/ui/Tiles/ThinTile.js +29 -13
- package/ui/Tiles/WideTile.js +29 -13
- package/ui/UniversalLink.d.ts +4 -4
- package/ui/UniversalLink.js +26 -3
- package/ui/index.d.ts +3 -3
|
@@ -3,17 +3,6 @@ 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
|
-
};
|
|
17
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
7
|
if (k2 === undefined) k2 = k;
|
|
19
8
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -39,7 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
39
28
|
};
|
|
40
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
30
|
exports.ShelfIcon = void 0;
|
|
42
|
-
var
|
|
31
|
+
var React = __importStar(require("react"));
|
|
43
32
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
44
33
|
var utils_1 = require("../../utils");
|
|
45
34
|
var directionMap = {
|
|
@@ -50,7 +39,9 @@ var directionMap = {
|
|
|
50
39
|
};
|
|
51
40
|
var IntShelfIcon = function (_a) {
|
|
52
41
|
var className = _a.className, style = _a.style;
|
|
53
|
-
return (
|
|
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" })));
|
|
54
45
|
};
|
|
55
46
|
exports.ShelfIcon = (0, styled_components_1.default)(IntShelfIcon).attrs(function () { return ({
|
|
56
47
|
'data-component-name': 'icons/ShelfIcon/ShelfIcon',
|
package/mocks/Link.js
CHANGED
|
@@ -10,15 +10,18 @@ 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
|
+
};
|
|
13
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
17
|
exports.Link = void 0;
|
|
15
|
-
var
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
16
19
|
var lodash_1 = require("lodash");
|
|
17
20
|
// TODO: use real typings here
|
|
18
21
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
19
22
|
function Link(props) {
|
|
20
23
|
// We omit "active" property to avoid "Warning: Received `false` for a non-boolean attribute `active`."
|
|
21
24
|
var filteredProps = (0, lodash_1.omit)(props, ['active', 'httpVerb', 'hasActiveSubItem']);
|
|
22
|
-
return
|
|
25
|
+
return react_1.default.createElement("a", __assign({ href: filteredProps.to }, filteredProps));
|
|
23
26
|
}
|
|
24
27
|
exports.Link = Link;
|
package/package.json
CHANGED
package/src/Button/Button.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { FlattenSimpleInterpolation, Keyframes } from 'styled-components';
|
|
2
3
|
import styled, { css, keyframes } from 'styled-components';
|
|
3
|
-
import type { FC } from 'react';
|
|
4
4
|
|
|
5
5
|
import { Link } from '@portal/Link';
|
|
6
6
|
|
|
@@ -140,7 +140,7 @@ const StyledButton = styled.button.attrs(({ color = 'default', extraClass }: But
|
|
|
140
140
|
`}
|
|
141
141
|
`;
|
|
142
142
|
|
|
143
|
-
const ButtonComponent: FC<ButtonProps> = (props) => {
|
|
143
|
+
const ButtonComponent: React.FC<ButtonProps> = (props) => {
|
|
144
144
|
if (props.to) {
|
|
145
145
|
return (
|
|
146
146
|
<Link to={props.to}>
|
package/src/Cards/Card.tsx
CHANGED
package/src/Footer/Footer.tsx
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import styled from 'styled-components';
|
|
2
|
-
import type { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
interface PageLayoutProps {
|
|
5
|
-
sidebar?: ReactNode;
|
|
5
|
+
sidebar?: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export function PageLayout({
|
|
8
|
+
export function PageLayout({
|
|
9
|
+
sidebar,
|
|
10
|
+
children,
|
|
11
|
+
}: React.PropsWithChildren<PageLayoutProps>): JSX.Element {
|
|
9
12
|
return (
|
|
10
13
|
<Container data-component-name="Layout/PageLayout">
|
|
11
14
|
{sidebar}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import styled from 'styled-components';
|
|
2
|
-
import type { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
interface LayoutConfig {
|
|
5
|
-
navbar: ReactNode;
|
|
6
|
-
footer: ReactNode;
|
|
5
|
+
navbar: React.ReactNode;
|
|
6
|
+
footer: React.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
|
-
}: PropsWithChildren<LayoutConfig>): JSX.Element {
|
|
15
|
+
}: React.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';
|
|
1
2
|
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
|
-
}: PropsWithChildren<AdmonitionProps>): JSX.Element {
|
|
18
|
+
}: React.PropsWithChildren<AdmonitionProps>): JSX.Element {
|
|
19
19
|
return (
|
|
20
20
|
<Wrapper type={type} data-component-name="Markdown/Admonition">
|
|
21
21
|
<AlertIcon type={type} />
|
|
@@ -1,31 +1,60 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import { ClipboardService } from '@theme/utils/ClipboardService';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export interface MdCopyCodeProps {
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
buttonText?: string;
|
|
9
|
+
tooltipText?: string;
|
|
10
|
+
toasterText?: string;
|
|
11
|
+
toasterDuration?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type CodeSampleProps = {
|
|
7
15
|
language: string;
|
|
8
16
|
highlighted: string;
|
|
9
17
|
rawContent: string;
|
|
18
|
+
copyCodeSnippet: MdCopyCodeProps;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const defaultCopyCodeSnippet = {
|
|
22
|
+
enabled: true,
|
|
23
|
+
buttonText: 'Copy',
|
|
24
|
+
tooltipText: 'Copy the code snippet',
|
|
25
|
+
toasterText: 'Copied',
|
|
26
|
+
toasterDuration: 1500,
|
|
10
27
|
};
|
|
11
28
|
|
|
12
|
-
export function CodeSample({
|
|
29
|
+
export function CodeSample({
|
|
30
|
+
rawContent,
|
|
31
|
+
highlighted,
|
|
32
|
+
language,
|
|
33
|
+
copyCodeSnippet,
|
|
34
|
+
}: CodeSampleProps): JSX.Element {
|
|
13
35
|
const langClassName = language ? `language-${language}` : '';
|
|
36
|
+
const copyCodeProps = { ...defaultCopyCodeSnippet, ...copyCodeSnippet };
|
|
14
37
|
|
|
15
38
|
const [isCopied, setIsCopied] = useState(false);
|
|
16
39
|
|
|
17
40
|
const copyCode = (code: string) => {
|
|
18
41
|
ClipboardService.copyCustom(code);
|
|
19
42
|
setIsCopied(true);
|
|
20
|
-
setTimeout(() => setIsCopied(false),
|
|
43
|
+
setTimeout(() => setIsCopied(false), copyCodeProps.toasterDuration);
|
|
21
44
|
};
|
|
22
45
|
|
|
23
46
|
return (
|
|
24
47
|
<Wrapper className="code-sample" data-component-name="Markdown/CodeSample/CodeSample">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
{copyCodeProps.enabled && (
|
|
49
|
+
<CodeSampleButtonContainer onClick={() => copyCode(rawContent)}>
|
|
50
|
+
{!isCopied && (
|
|
51
|
+
<CopyCodeButton title={copyCodeProps.tooltipText}>
|
|
52
|
+
{copyCodeProps.buttonText}
|
|
53
|
+
</CopyCodeButton>
|
|
54
|
+
)}
|
|
55
|
+
{isCopied && <DoneIndicator>{copyCodeProps.toasterText}</DoneIndicator>}
|
|
56
|
+
</CodeSampleButtonContainer>
|
|
57
|
+
)}
|
|
29
58
|
<pre className={langClassName}>
|
|
30
59
|
<code className={langClassName} dangerouslySetInnerHTML={{ __html: highlighted }} />
|
|
31
60
|
</pre>
|
package/src/Markdown/Details.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
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 }: PropsWithChildren<DetailsProps>): JSX.Element {
|
|
8
|
+
export function Details({ summary, children }: React.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';
|
|
1
2
|
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: ReactNode;
|
|
12
|
-
markdownWrapper: ReactNode;
|
|
11
|
+
tableOfContent: React.ReactNode;
|
|
12
|
+
markdownWrapper: React.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,5 +1,5 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
5
|
import { Tab } from '@theme/Markdown/Tabs/Tab';
|
|
@@ -39,6 +39,7 @@ const TabList = styled.ol`
|
|
|
39
39
|
`;
|
|
40
40
|
|
|
41
41
|
const TabContent = styled.div`
|
|
42
|
+
padding: 10px 5px;
|
|
42
43
|
border: 1px solid #ccc;
|
|
43
44
|
border-top: none;
|
|
44
45
|
padding: 1rem;
|
package/src/Navbar/Navbar.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import styled from 'styled-components';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import type { ResolvedConfigLinks } from '@theme/types/portal';
|
|
5
5
|
|
|
@@ -13,9 +13,9 @@ import { ColorModeSwitcher } from '@theme/ColorModeSwitcher/ColorModeSwitcher';
|
|
|
13
13
|
|
|
14
14
|
interface NavbarProps {
|
|
15
15
|
menu: ResolvedConfigLinks;
|
|
16
|
-
logo: ReactNode;
|
|
17
|
-
search: ReactNode;
|
|
18
|
-
profile?: ReactNode;
|
|
16
|
+
logo: React.ReactNode;
|
|
17
|
+
search: React.ReactNode;
|
|
18
|
+
profile?: React.ReactNode;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function Navbar({ menu, logo, search, profile }: NavbarProps): JSX.Element | null {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseSyntheticEvent, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
5
|
import type { PanelHeaderProps } from '@theme/Panel/PanelHeader';
|
|
@@ -15,7 +15,7 @@ export interface PanelComponentProps {
|
|
|
15
15
|
renderChildrenHidden?: boolean;
|
|
16
16
|
header?: ReactNode | ((props: PanelHeaderProps) => ReactNode);
|
|
17
17
|
onToggle?: (expanded: boolean) => void;
|
|
18
|
-
description?: ReactNode;
|
|
18
|
+
description?: React.ReactNode;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function PanelComponent({
|
package/src/Profile/Profile.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChangeEvent, KeyboardEvent, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { useLocation } from 'react-router-dom';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
|
package/src/Search/ClearIcon.tsx
CHANGED
package/src/Search/Search.tsx
CHANGED
package/src/Search/utils.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import styled from 'styled-components';
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
import { ArrowBack } from '@theme/Sidebar/ArrowBack';
|
|
5
5
|
|
|
@@ -7,7 +7,10 @@ interface BackButtonProps {
|
|
|
7
7
|
back: () => void;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function BackButton({
|
|
10
|
+
export function BackButton({
|
|
11
|
+
children,
|
|
12
|
+
back,
|
|
13
|
+
}: React.PropsWithChildren<BackButtonProps>): JSX.Element {
|
|
11
14
|
return (
|
|
12
15
|
<Button onClick={back} data-component-name="Sidebar/BackButton">
|
|
13
16
|
<ArrowBack />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import styled from 'styled-components';
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
import type { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ export function Drilldown({
|
|
|
18
18
|
item,
|
|
19
19
|
expand,
|
|
20
20
|
...props
|
|
21
|
-
}: PropsWithChildren<DrilldownProps>): JSX.Element {
|
|
21
|
+
}: React.PropsWithChildren<DrilldownProps>): JSX.Element {
|
|
22
22
|
return (
|
|
23
23
|
<Wrapper data-component-name="Sidebar/Drilldown">
|
|
24
24
|
<DrilldownLabel onClick={expand}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import styled, { keyframes } from 'styled-components';
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
import type { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ export function DrilldownMenu({
|
|
|
11
11
|
back,
|
|
12
12
|
prevActiveItem,
|
|
13
13
|
children,
|
|
14
|
-
}: PropsWithChildren<DrilldownMenuProps>): JSX.Element {
|
|
14
|
+
}: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element {
|
|
15
15
|
return (
|
|
16
16
|
<MenuContainer data-component-name="Sidebar/DrilldownMenu">
|
|
17
17
|
<MenuContent>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import styled from 'styled-components';
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
import type { ItemState } from '@theme/Sidebar/types/ItemState';
|
|
5
5
|
|
|
@@ -19,7 +19,7 @@ export function MenuGroup({
|
|
|
19
19
|
isExpanded,
|
|
20
20
|
toggleExpanded,
|
|
21
21
|
children,
|
|
22
|
-
}: PropsWithChildren<MenuGroupProps>): JSX.Element {
|
|
22
|
+
}: React.PropsWithChildren<MenuGroupProps>): JSX.Element {
|
|
23
23
|
return (
|
|
24
24
|
<Wrapper data-component-name="Sidebar/MenuGroup">
|
|
25
25
|
<MenuLinkItem item={item}>
|
package/src/Sidebar/MenuItem.tsx
CHANGED