@redocly/theme 0.1.8 → 0.1.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/Footer/Footer.d.ts +1 -1
- package/Footer/Footer.js +5 -4
- package/Footer/FooterColumn.d.ts +1 -1
- package/Footer/FooterColumn.js +2 -1
- package/Footer/FooterColumns.d.ts +1 -1
- package/Footer/FooterColumns.js +4 -4
- package/Footer/FooterCopyright.d.ts +1 -1
- package/Footer/FooterCopyright.js +2 -1
- package/Footer/index.d.ts +4 -4
- package/Footer/index.js +17 -11
- package/Layout/PageLayout.d.ts +1 -1
- package/Layout/PageLayout.js +2 -1
- package/Layout/RootLayout.d.ts +1 -1
- package/Layout/RootLayout.js +2 -1
- package/Layout/index.d.ts +2 -2
- package/Layout/index.js +15 -7
- package/Logo/index.d.ts +1 -0
- package/Logo/index.js +17 -0
- package/Markdown/{Admonition/Admonition.d.ts → Admonition.d.ts} +0 -0
- package/Markdown/{Admonition/Admonition.js → Admonition.js} +1 -1
- package/Markdown/CodeSample/index.d.ts +3 -0
- package/Markdown/CodeSample/index.js +19 -0
- package/Markdown/{Heading/Heading.d.ts → Heading.d.ts} +0 -0
- package/Markdown/{Heading/Heading.js → Heading.js} +0 -0
- package/Markdown/{Mermaid/Mermaid.d.ts → Mermaid.d.ts} +0 -0
- package/Markdown/{Mermaid/Mermaid.js → Mermaid.js} +0 -0
- package/Markdown/Tabs/index.d.ts +2 -0
- package/Markdown/Tabs/index.js +18 -0
- package/Markdown/index.d.ts +9 -0
- package/Markdown/index.js +25 -0
- package/Navbar/Navbar.d.ts +1 -1
- package/Navbar/Navbar.js +2 -2
- package/Navbar/NavbarItem.d.ts +1 -1
- package/Navbar/NavbarItem.js +2 -2
- package/Navbar/NavbarMenu.d.ts +1 -1
- package/Navbar/NavbarMenu.js +4 -3
- package/Search/index.d.ts +9 -0
- package/Search/index.js +25 -0
- package/Sidebar/ApiCallItem.d.ts +2 -2
- package/Sidebar/ApiCallItem.js +6 -6
- package/Sidebar/ArrowBack.d.ts +1 -2
- package/Sidebar/ArrowBack.js +2 -1
- package/Sidebar/BackButton.d.ts +1 -1
- package/Sidebar/BackButton.js +4 -3
- package/Sidebar/Drilldown.d.ts +2 -2
- package/Sidebar/Drilldown.js +8 -7
- package/Sidebar/DrilldownMenu.d.ts +2 -2
- package/Sidebar/DrilldownMenu.js +5 -7
- package/Sidebar/DrilldownMenuItem.d.ts +2 -2
- package/Sidebar/DrilldownMenuItem.js +2 -1
- package/Sidebar/ExternalIcon.d.ts +1 -2
- package/Sidebar/ExternalIcon.js +2 -1
- package/Sidebar/Menu.d.ts +1 -2
- package/Sidebar/Menu.js +2 -1
- package/Sidebar/MenuContainer.d.ts +1 -2
- package/Sidebar/MenuContainer.js +2 -1
- package/Sidebar/MenuGroup.d.ts +1 -1
- package/Sidebar/MenuGroup.js +6 -6
- package/Sidebar/MenuItem.d.ts +2 -2
- package/Sidebar/MenuItem.js +7 -6
- package/Sidebar/MenuItemLabel.d.ts +1 -2
- package/Sidebar/MenuItemLabel.js +2 -1
- package/Sidebar/MenuLink.d.ts +1 -2
- package/Sidebar/MenuLink.js +2 -1
- package/Sidebar/MenuLinkItem.d.ts +2 -2
- package/Sidebar/MenuLinkItem.js +4 -3
- package/Sidebar/MobileSidebarButton.d.ts +1 -2
- package/Sidebar/MobileSidebarButton.js +2 -1
- package/Sidebar/Separator.d.ts +2 -2
- package/Sidebar/Separator.js +5 -4
- package/Sidebar/SeparatorItem.d.ts +1 -2
- package/Sidebar/SeparatorItem.js +3 -2
- package/Sidebar/SeparatorLine.d.ts +1 -2
- package/Sidebar/SeparatorLine.js +2 -1
- package/Sidebar/Sidebar.d.ts +2 -2
- package/Sidebar/Sidebar.js +2 -1
- package/Sidebar/SidebarLayout.d.ts +1 -1
- package/Sidebar/SidebarLayout.js +6 -5
- package/Sidebar/index.d.ts +19 -0
- package/Sidebar/index.js +35 -0
- package/Sidebar/types/DrilldownMenuProps.d.ts +2 -2
- package/Sidebar/types/ItemState.d.ts +2 -3
- package/Sidebar/types/MenuItemProps.d.ts +2 -2
- package/Sidebar/types/NavItem.d.ts +1 -1
- package/Sidebar/types/index.d.ts +5 -0
- package/Sidebar/types/index.js +21 -0
- package/TableOfContent/TableOfContent.d.ts +1 -1
- package/TableOfContent/TableOfContent.js +2 -1
- package/TableOfContent/index.d.ts +1 -0
- package/TableOfContent/index.js +17 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/src/Footer/Footer.tsx +3 -3
- package/src/Footer/FooterColumn.tsx +1 -1
- package/src/Footer/FooterColumns.tsx +2 -2
- package/src/Footer/FooterCopyright.tsx +1 -1
- package/src/Footer/index.ts +4 -0
- package/src/Layout/PageLayout.tsx +1 -1
- package/src/Layout/RootLayout.tsx +1 -1
- package/src/Layout/index.ts +2 -0
- package/src/Logo/index.ts +1 -0
- package/src/Markdown/{Admonition/Admonition.tsx → Admonition.tsx} +0 -0
- package/src/Markdown/CodeSample/index.ts +3 -0
- package/src/Markdown/{Heading/Heading.tsx → Heading.tsx} +0 -0
- package/src/Markdown/{Mermaid/Mermaid.tsx → Mermaid.tsx} +0 -0
- package/src/Markdown/Tabs/index.ts +2 -0
- package/src/Markdown/index.ts +9 -0
- package/src/Navbar/Navbar.stories.tsx +2 -2
- package/src/Navbar/Navbar.tsx +1 -1
- package/src/Navbar/NavbarItem.tsx +1 -1
- package/src/Navbar/NavbarMenu.tsx +2 -2
- package/src/Search/index.ts +9 -0
- package/src/Sidebar/ApiCallItem.tsx +5 -5
- package/src/Sidebar/ArrowBack.tsx +1 -1
- package/src/Sidebar/BackButton.tsx +2 -2
- package/src/Sidebar/Drilldown.tsx +6 -6
- package/src/Sidebar/DrilldownMenu.tsx +4 -4
- package/src/Sidebar/DrilldownMenuItem.tsx +2 -2
- package/src/Sidebar/ExternalIcon.tsx +1 -1
- package/src/Sidebar/Menu.tsx +1 -1
- package/src/Sidebar/MenuContainer.tsx +1 -1
- package/src/Sidebar/MenuGroup.tsx +5 -5
- package/src/Sidebar/MenuItem.tsx +6 -6
- package/src/Sidebar/MenuItemLabel.tsx +1 -1
- package/src/Sidebar/MenuLink.tsx +1 -1
- package/src/Sidebar/MenuLinkItem.tsx +3 -3
- package/src/Sidebar/MobileSidebarButton.tsx +1 -1
- package/src/Sidebar/Separator.tsx +4 -4
- package/src/Sidebar/SeparatorItem.tsx +2 -2
- package/src/Sidebar/SeparatorLine.tsx +1 -1
- package/src/Sidebar/Sidebar.tsx +1 -1
- package/src/Sidebar/SidebarLayout.tsx +4 -4
- package/src/Sidebar/index.ts +19 -0
- package/src/Sidebar/types/DrilldownMenuProps.ts +2 -2
- package/src/Sidebar/types/ItemState.ts +2 -4
- package/src/Sidebar/types/MenuItemProps.ts +2 -2
- package/src/Sidebar/types/NavItem.ts +1 -1
- package/src/Sidebar/types/index.ts +5 -0
- package/src/TableOfContent/TableOfContent.stories.tsx +39 -0
- package/src/TableOfContent/TableOfContent.tsx +1 -1
- package/src/TableOfContent/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/ui/{Arrow/Arrow.tsx → Arrow.tsx} +0 -0
- package/src/ui/Dropdown.tsx +1 -1
- package/src/ui/Tiles/index.ts +4 -0
- package/src/ui/UniversalLink.tsx +2 -2
- package/src/ui/index.tsx +8 -3
- package/src/utils/isUrl.ts +1 -1
- package/src/utils/replaceHashInColor.ts +1 -1
- package/ui/{Arrow/Arrow.d.ts → Arrow.d.ts} +0 -0
- package/ui/{Arrow/Arrow.js → Arrow.js} +0 -0
- package/ui/Dropdown.d.ts +1 -1
- package/ui/Dropdown.js +2 -1
- package/ui/Tiles/index.d.ts +4 -0
- package/ui/Tiles/index.js +20 -0
- package/ui/UniversalLink.js +4 -4
- package/ui/index.d.ts +7 -3
- package/ui/index.js +7 -3
- package/utils/isUrl.d.ts +1 -1
- package/utils/isUrl.js +2 -1
- package/utils/replaceHashInColor.d.ts +1 -1
- package/utils/replaceHashInColor.js +2 -1
- package/src/Footer/index.tsx +0 -4
- package/src/Layout/index.tsx +0 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DrilldownMenuProps"), exports);
|
|
18
|
+
__exportStar(require("./ItemState"), exports);
|
|
19
|
+
__exportStar(require("./MenuItemProps"), exports);
|
|
20
|
+
__exportStar(require("./MenuStyle"), exports);
|
|
21
|
+
__exportStar(require("./NavItem"), exports);
|
|
@@ -5,5 +5,5 @@ interface TableOfContentProps {
|
|
|
5
5
|
contentWrapper: HTMLDivElement | null;
|
|
6
6
|
tocMaxDepth: number;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export declare function TableOfContent(props: TableOfContentProps): JSX.Element | null;
|
|
9
9
|
export {};
|
|
@@ -18,6 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.TableOfContent = void 0;
|
|
21
22
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
23
|
var react_1 = require("react");
|
|
23
24
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
@@ -50,7 +51,7 @@ function TableOfContent(props) {
|
|
|
50
51
|
return ((0, jsx_runtime_1.jsx)(MenuItem, { depth: heading.depth || 0, href: href, className: activeHeadingId === heading.id ? 'active' : '', dangerouslySetInnerHTML: { __html: heading.value || '' }, "data-cy": "toc-".concat(heading.value) }, href));
|
|
51
52
|
})] })) }))) }));
|
|
52
53
|
}
|
|
53
|
-
exports.
|
|
54
|
+
exports.TableOfContent = TableOfContent;
|
|
54
55
|
var TocHeader = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 0.8em;\n padding: 10px 15px;\n font-weight: bold;\n text-transform: uppercase;\n"], ["\n font-size: 0.8em;\n padding: 10px 15px;\n font-weight: bold;\n text-transform: uppercase;\n"])));
|
|
55
56
|
var MenuItem = styled_components_1.default.a(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n color: var(--color-text-main);\n cursor: pointer;\n font-size: 0.8em;\n padding: 10px 15px;\n padding-left: ", "px;\n transition: background-color 0.3s, color 0.3s;\n text-decoration: none;\n word-break: break-word;\n font-family: var(--font-family-h);\n :hover,\n &.active {\n color: var(--sidebar-text-active-color);\n background-color: var(--sidebar-text-active-background-color);\n }\n :empty {\n padding: 0;\n }\n"], ["\n display: block;\n color: var(--color-text-main);\n cursor: pointer;\n font-size: 0.8em;\n padding: 10px 15px;\n padding-left: ", "px;\n transition: background-color 0.3s, color 0.3s;\n text-decoration: none;\n word-break: break-word;\n font-family: var(--font-family-h);\n :hover,\n &.active {\n color: var(--sidebar-text-active-color);\n background-color: var(--sidebar-text-active-background-color);\n }\n :empty {\n padding: 0;\n }\n"])), function (_a) {
|
|
56
57
|
var depth = _a.depth;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TableOfContent';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./TableOfContent"), exports);
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
package/src/Footer/Footer.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import FooterColumns from '@theme/Footer/FooterColumns';
|
|
5
|
-
import FooterCopyright from '@theme/Footer/FooterCopyright';
|
|
4
|
+
import { FooterColumns } from '@theme/Footer/FooterColumns';
|
|
5
|
+
import { FooterCopyright } from '@theme/Footer/FooterCopyright';
|
|
6
6
|
import type { FooterConfig } from '@theme/types/portal';
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export function Footer({
|
|
9
9
|
columns,
|
|
10
10
|
copyrightText,
|
|
11
11
|
}: React.PropsWithChildren<FooterConfig>): JSX.Element | null {
|
|
@@ -8,7 +8,7 @@ interface FooterColumnProps {
|
|
|
8
8
|
column: Column;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export function FooterColumn({ column }: FooterColumnProps): JSX.Element {
|
|
12
12
|
return (
|
|
13
13
|
<FooterColumnContainer data-component-name="Footer/FooterColumn">
|
|
14
14
|
<FooterColumnTitle>{column.group || column.label}</FooterColumnTitle>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import FooterColumn from '@theme/Footer/FooterColumn';
|
|
4
|
+
import { FooterColumn } from '@theme/Footer/FooterColumn';
|
|
5
5
|
import type { FooterConfig } from '@theme/types/portal';
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export function FooterColumns({
|
|
8
8
|
columns = [],
|
|
9
9
|
}: React.PropsWithChildren<{ columns?: FooterConfig['columns'] }>): JSX.Element | null {
|
|
10
10
|
if (!columns?.length) {
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { FooterConfig } from '@theme/types/portal';
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function FooterCopyright({
|
|
7
7
|
copyrightText = '',
|
|
8
8
|
}: React.PropsWithChildren<{ copyrightText?: FooterConfig['copyrightText'] }>): JSX.Element | null {
|
|
9
9
|
return copyrightText ? (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Logo';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './CodeSample';
|
|
2
|
+
export * from './Tabs';
|
|
3
|
+
export * from './Admonition';
|
|
4
|
+
export * from './ContentWrapper';
|
|
5
|
+
export * from './Heading';
|
|
6
|
+
export * from './MarkdownLayout';
|
|
7
|
+
export * from './Mermaid';
|
|
8
|
+
export * from './PageWrapper';
|
|
9
|
+
export * from './StyledMarkdown';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
import Navbar from './Navbar';
|
|
5
|
-
import NavbarMenu from './NavbarMenu';
|
|
4
|
+
import { Navbar } from './Navbar';
|
|
5
|
+
import { NavbarMenu } from './NavbarMenu';
|
|
6
6
|
|
|
7
7
|
import { Logo } from '@theme/Logo/Logo';
|
|
8
8
|
|
package/src/Navbar/Navbar.tsx
CHANGED
|
@@ -8,7 +8,7 @@ interface NavbarProps {
|
|
|
8
8
|
theme: any;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export function Navbar({ menu, logo, search }: NavbarProps): JSX.Element {
|
|
12
12
|
return (
|
|
13
13
|
<NavbarContainer data-component-name="Navbar/Navbar">
|
|
14
14
|
{logo}
|
|
@@ -51,7 +51,7 @@ interface NavbarItemProps {
|
|
|
51
51
|
navItem: ResolvedNavLinkItem;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export
|
|
54
|
+
export function NavbarItem({ navItem }: NavbarItemProps): JSX.Element {
|
|
55
55
|
const { pathname } = useLocation();
|
|
56
56
|
const isActive = pathname === withPathPrefix(navItem.link);
|
|
57
57
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import NavbarItem from '@theme/Navbar/NavbarItem';
|
|
4
|
+
import { NavbarItem } from '@theme/Navbar/NavbarItem';
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function NavbarMenu({ menuItems }: { menuItems: any[] }): JSX.Element | null {
|
|
7
7
|
if (!menuItems || !menuItems.length) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './Autocomplete';
|
|
2
|
+
export * from './ClearIcon';
|
|
3
|
+
export * from './Input';
|
|
4
|
+
export * from './Parameters';
|
|
5
|
+
export * from './Popover';
|
|
6
|
+
export * from './Search';
|
|
7
|
+
export * from './SearchIcon';
|
|
8
|
+
export * from './SearchItem';
|
|
9
|
+
export * from './utils';
|
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import { OperationBadge } from '@theme/OperationBadge';
|
|
5
|
-
import MenuItemProps from '@theme/Sidebar/types/MenuItemProps';
|
|
6
|
-
import MenuLinkItem from '@theme/Sidebar/MenuLinkItem';
|
|
7
|
-
import SeparatorLine from '@theme/Sidebar/SeparatorLine';
|
|
8
|
-
import MenuItemLabel from '@theme/Sidebar/MenuItemLabel';
|
|
5
|
+
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
6
|
+
import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
|
|
7
|
+
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
8
|
+
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export function ApiCallItem({ item }: MenuItemProps): JSX.Element {
|
|
11
11
|
return (
|
|
12
12
|
<Wrapper data-component-name="Sidebar/ApiCallItem">
|
|
13
13
|
<MenuLinkItem item={item}>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import ArrowBack from '@theme/Sidebar/ArrowBack';
|
|
4
|
+
import { ArrowBack } from '@theme/Sidebar/ArrowBack';
|
|
5
5
|
|
|
6
6
|
interface BackButtonProps {
|
|
7
7
|
back: () => void;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export function BackButton({
|
|
11
11
|
children,
|
|
12
12
|
back,
|
|
13
13
|
}: React.PropsWithChildren<BackButtonProps>): JSX.Element {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import MenuItemLabel from '@theme/Sidebar/MenuItemLabel';
|
|
5
|
-
import SeparatorLine from '@theme/Sidebar/SeparatorLine';
|
|
6
|
-
import DrilldownMenuItem from '@theme/Sidebar/DrilldownMenuItem';
|
|
7
|
-
import DrilldownMenu from '@theme/Sidebar/DrilldownMenu';
|
|
8
|
-
import DrilldownMenuProps from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
4
|
+
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
|
5
|
+
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
6
|
+
import { DrilldownMenuItem } from '@theme/Sidebar/DrilldownMenuItem';
|
|
7
|
+
import { DrilldownMenu } from '@theme/Sidebar/DrilldownMenu';
|
|
8
|
+
import { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
9
9
|
|
|
10
10
|
interface DrilldownProps extends DrilldownMenuProps {
|
|
11
11
|
isExpanded: boolean;
|
|
12
12
|
expand: () => void;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export function Drilldown({
|
|
16
16
|
isExpanded,
|
|
17
17
|
item,
|
|
18
18
|
expand,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled, { keyframes } from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import DrilldownMenuProps from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
5
|
-
import BackButton from '@theme/Sidebar/BackButton';
|
|
6
|
-
import DrilldownMenuItem from '@theme/Sidebar/DrilldownMenuItem';
|
|
4
|
+
import { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
5
|
+
import { BackButton } from '@theme/Sidebar/BackButton';
|
|
6
|
+
import { DrilldownMenuItem } from '@theme/Sidebar/DrilldownMenuItem';
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export function DrilldownMenu({
|
|
9
9
|
item,
|
|
10
10
|
back,
|
|
11
11
|
prevActiveItem,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import MenuItemProps from '@theme/Sidebar/types/MenuItemProps';
|
|
4
|
+
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function DrilldownMenuItem({ item }: MenuItemProps): JSX.Element {
|
|
7
7
|
return (
|
|
8
8
|
<Container data-component-name="Sidebar/DrilldownMenuItem">
|
|
9
9
|
{item.icon ? <Icon src={item.icon} /> : null}
|
package/src/Sidebar/Menu.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import { Arrow } from '@theme/ui/Arrow
|
|
5
|
-
import ItemState from '@theme/Sidebar/types/ItemState';
|
|
6
|
-
import MenuLinkItem from '@theme/Sidebar/MenuLinkItem';
|
|
7
|
-
import MenuItemLabel from '@theme/Sidebar/MenuItemLabel';
|
|
8
|
-
import SeparatorLine from '@theme/Sidebar/SeparatorLine';
|
|
4
|
+
import { Arrow } from '@theme/ui/Arrow';
|
|
5
|
+
import { ItemState } from '@theme/Sidebar/types/ItemState';
|
|
6
|
+
import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
|
|
7
|
+
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
|
8
|
+
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
9
9
|
|
|
10
10
|
interface MenuGroupProps {
|
|
11
11
|
item: ItemState;
|
package/src/Sidebar/MenuItem.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import MenuItemProps from '@theme/Sidebar/types/MenuItemProps';
|
|
5
|
-
import MenuLinkItem from '@theme/Sidebar/MenuLinkItem';
|
|
6
|
-
import ExternalIcon from '@theme/Sidebar/ExternalIcon';
|
|
7
|
-
import MenuItemLabel from '@theme/Sidebar/MenuItemLabel';
|
|
8
|
-
import SeparatorLine from '@theme/Sidebar/SeparatorLine';
|
|
4
|
+
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
5
|
+
import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
|
|
6
|
+
import { ExternalIcon } from '@theme/Sidebar/ExternalIcon';
|
|
7
|
+
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
|
8
|
+
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export function MenuItem({ item }: MenuItemProps): JSX.Element {
|
|
11
11
|
return (
|
|
12
12
|
<Wrapper data-component-name="Sidebar/MenuItem">
|
|
13
13
|
<MenuLinkItem item={item}>
|
package/src/Sidebar/MenuLink.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import styled from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
import { UniversalLink, UniversalLinkProps } from '@theme/ui/UniversalLink';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export const MenuLink = styled(UniversalLink).attrs(() => ({
|
|
6
6
|
'data-component-name': 'Sidebar/MenuLink',
|
|
7
7
|
}))<UniversalLinkProps>`
|
|
8
8
|
text-decoration: none;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import MenuLink from '@theme/Sidebar/MenuLink';
|
|
5
|
-
import MenuItemProps from '@theme/Sidebar/types/MenuItemProps';
|
|
4
|
+
import { MenuLink } from '@theme/Sidebar/MenuLink';
|
|
5
|
+
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export function MenuLinkItem({
|
|
8
8
|
item,
|
|
9
9
|
children,
|
|
10
10
|
}: React.PropsWithChildren<MenuItemProps>): JSX.Element {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export const MobileSidebarButton = styled.span.attrs(() => ({
|
|
4
4
|
'data-component-name': 'Sidebar/MobileSidebarButton',
|
|
5
5
|
}))<{ opened?: boolean }>`
|
|
6
6
|
background-color: var(--color-primary-500);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import MenuItemProps from '@theme/Sidebar/types/MenuItemProps';
|
|
5
|
-
import SeparatorLine from '@theme/Sidebar/SeparatorLine';
|
|
6
|
-
import SeparatorItem from '@theme/Sidebar/SeparatorItem';
|
|
4
|
+
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
5
|
+
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
6
|
+
import { SeparatorItem } from '@theme/Sidebar/SeparatorItem';
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export function Separator({ item }: MenuItemProps): JSX.Element {
|
|
9
9
|
return (
|
|
10
10
|
<Wrapper data-component-name="Sidebar/Separator">
|
|
11
11
|
<SeparatorItem>{item.label}</SeparatorItem>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
import MenuItemLabel from '@theme/Sidebar/MenuItemLabel';
|
|
3
|
+
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export const SeparatorItem = styled(MenuItemLabel)`
|
|
6
6
|
cursor: default;
|
|
7
7
|
font-weight: var(--font-weight-bold);
|
|
8
8
|
color: var(--sidebar-separator-label-color);
|
package/src/Sidebar/Sidebar.tsx
CHANGED
|
@@ -5,7 +5,7 @@ interface SidebarProps {
|
|
|
5
5
|
animate?: boolean;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export const Sidebar = styled.aside.attrs(() => ({
|
|
9
9
|
'data-component-name': 'Sidebar/Sidebar',
|
|
10
10
|
}))<SidebarProps>`
|
|
11
11
|
border-right: 1px solid var(--sidebar-right-line-color);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import Sidebar from '@theme/Sidebar/Sidebar';
|
|
4
|
+
import { Sidebar } from '@theme/Sidebar/Sidebar';
|
|
5
5
|
import { useMobileMenu } from '@theme/hooks/useMobileMenu';
|
|
6
|
-
import MobileSidebarButton from '@theme/Sidebar/MobileSidebarButton';
|
|
7
|
-
import MenuContainer from '@theme/Sidebar/MenuContainer';
|
|
6
|
+
import { MobileSidebarButton } from '@theme/Sidebar/MobileSidebarButton';
|
|
7
|
+
import { MenuContainer } from '@theme/Sidebar/MenuContainer';
|
|
8
8
|
|
|
9
9
|
interface SidebarLayoutProps {
|
|
10
10
|
versions: React.ReactNode;
|
|
11
11
|
menu: React.ReactNode;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export function SidebarLayout({ versions, menu }: SidebarLayoutProps): JSX.Element {
|
|
15
15
|
const [isOpen, setIsOpen] = useMobileMenu();
|
|
16
16
|
const toggleMenu = () => setIsOpen(!isOpen);
|
|
17
17
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './ApiCallItem';
|
|
2
|
+
export * from './ArrowBack';
|
|
3
|
+
export * from './BackButton';
|
|
4
|
+
export * from './Drilldown';
|
|
5
|
+
export * from './DrilldownMenu';
|
|
6
|
+
export * from './DrilldownMenuItem';
|
|
7
|
+
export * from './ExternalIcon';
|
|
8
|
+
export * from './Menu';
|
|
9
|
+
export * from './MenuContainer';
|
|
10
|
+
export * from './MenuGroup';
|
|
11
|
+
export * from './MenuItem';
|
|
12
|
+
export * from './MenuItemLabel';
|
|
13
|
+
export * from './MenuLink';
|
|
14
|
+
export * from './MenuLinkItem';
|
|
15
|
+
export * from './MobileSidebarButton';
|
|
16
|
+
export * from './Separator';
|
|
17
|
+
export * from './SeparatorItem';
|
|
18
|
+
export * from './Sidebar';
|
|
19
|
+
export * from './SidebarLayout';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ItemState from '@theme/Sidebar/types/ItemState';
|
|
1
|
+
import { ItemState } from '@theme/Sidebar/types/ItemState';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export interface DrilldownMenuProps {
|
|
4
4
|
back: () => void;
|
|
5
5
|
item: ItemState;
|
|
6
6
|
prevActiveItem?: ItemState;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import NavItem from '@theme/Sidebar/types/NavItem';
|
|
1
|
+
import { NavItem } from '@theme/Sidebar/types/NavItem';
|
|
2
2
|
import { MenuStyle } from '@theme/Sidebar/types/MenuStyle';
|
|
3
3
|
|
|
4
|
-
interface ItemState extends NavItem {
|
|
4
|
+
export interface ItemState extends NavItem {
|
|
5
5
|
items: ItemState[];
|
|
6
6
|
active: boolean;
|
|
7
7
|
hasActiveSubItem: boolean;
|
|
8
8
|
menuStyle?: MenuStyle;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
export default ItemState;
|