@redocly/theme 0.1.9 → 0.1.10
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/index.d.ts +1 -1
- package/Button/index.js +1 -1
- package/CodeBlock/index.d.ts +1 -1
- package/CodeBlock/index.js +1 -1
- package/CopyButton/index.d.ts +2 -2
- package/CopyButton/index.js +2 -2
- package/Footer/Footer.d.ts +2 -2
- package/Footer/Footer.js +1 -1
- package/Footer/FooterColumn.js +6 -6
- package/Footer/FooterColumns.d.ts +3 -3
- package/Footer/FooterCopyright.d.ts +3 -3
- package/Footer/FooterCopyright.js +1 -1
- package/Footer/index.d.ts +4 -4
- package/Footer/index.js +4 -4
- package/Headings/index.d.ts +1 -1
- package/Headings/index.js +1 -1
- package/JsonViewer/index.d.ts +2 -2
- package/JsonViewer/index.js +2 -2
- package/Layout/index.d.ts +2 -2
- package/Layout/index.js +2 -2
- package/Markdown/Admonition.js +4 -4
- package/Markdown/CodeSample/index.d.ts +3 -3
- package/Markdown/CodeSample/index.js +3 -3
- package/Markdown/Heading.js +1 -1
- package/Markdown/MarkdownLayout.d.ts +2 -2
- package/Markdown/StyledMarkdown.js +2 -2
- package/Markdown/Tabs/index.d.ts +2 -2
- package/Markdown/Tabs/index.js +2 -2
- package/Markdown/index.d.ts +9 -9
- package/Markdown/index.js +9 -9
- package/Navbar/Navbar.d.ts +0 -1
- package/Navbar/Navbar.js +1 -1
- package/Navbar/NavbarItem.js +1 -1
- package/Navbar/index.d.ts +3 -0
- package/Navbar/index.js +19 -0
- package/NavbarLogo/NavbarLogo.d.ts +6 -0
- package/{Logo/Logo.js → NavbarLogo/NavbarLogo.js} +8 -5
- package/NavbarLogo/index.d.ts +1 -0
- package/{Logo → NavbarLogo}/index.js +1 -1
- package/OperationBadge/index.d.ts +1 -1
- package/OperationBadge/index.js +1 -1
- package/PageNavigation/index.d.ts +3 -0
- package/PageNavigation/index.js +19 -0
- package/Panel/index.d.ts +8 -8
- package/Panel/index.js +8 -8
- package/REAMDE.md +1 -0
- package/SamplesPanelControls/index.d.ts +1 -1
- package/SamplesPanelControls/index.js +1 -1
- package/Search/Autocomplete.js +1 -1
- package/Search/Parameters.js +2 -2
- package/Search/SearchItem.js +2 -2
- package/Search/index.d.ts +9 -9
- package/Search/index.js +9 -9
- package/Search/utils.js +1 -1
- package/Sidebar/BackButton.js +1 -1
- package/Sidebar/DrilldownMenuItem.js +3 -3
- package/Sidebar/Menu.js +1 -1
- package/Sidebar/MenuItemLabel.js +2 -2
- package/Sidebar/MenuLink.js +1 -1
- package/Sidebar/MobileSidebarButton.js +1 -1
- package/Sidebar/Sidebar.js +1 -1
- package/Sidebar/index.d.ts +19 -19
- package/Sidebar/index.js +19 -19
- package/Sidebar/types/index.d.ts +5 -5
- package/Sidebar/types/index.js +5 -5
- package/SidebarLogo/index.d.ts +1 -1
- package/SidebarLogo/index.js +1 -1
- package/SourceCode/index.d.ts +1 -1
- package/SourceCode/index.js +1 -1
- package/TableOfContent/TableOfContent.js +3 -3
- package/TableOfContent/index.d.ts +1 -1
- package/TableOfContent/index.js +1 -1
- package/Tooltip/index.d.ts +1 -1
- package/Tooltip/index.js +1 -1
- package/globalStyle.js +1 -1
- package/hooks/index.d.ts +7 -7
- package/hooks/index.js +7 -7
- package/hooks/useActiveSectionId.d.ts +2 -2
- package/hooks/useActiveSectionId.js +1 -0
- package/icons/ShelfIcon/index.d.ts +2 -2
- package/icons/ShelfIcon/index.js +1 -1
- package/icons/index.d.ts +1 -1
- package/icons/index.js +1 -1
- package/package.json +1 -1
- package/src/Button/Button.stories.tsx +1 -1
- package/src/Button/index.ts +1 -1
- package/src/CodeBlock/index.ts +1 -1
- package/src/CopyButton/CopyButton.stories.tsx +1 -1
- package/src/CopyButton/index.ts +2 -2
- package/src/Footer/Footer.stories.tsx +57 -0
- package/src/Footer/Footer.tsx +5 -8
- package/src/Footer/FooterColumn.tsx +7 -7
- package/src/Footer/FooterColumns.tsx +3 -1
- package/src/Footer/FooterCopyright.tsx +5 -3
- package/src/Footer/__tests__/Footer.test.tsx +55 -0
- package/src/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +253 -0
- package/src/Footer/index.ts +4 -4
- package/src/Headings/index.ts +1 -1
- package/src/JsonViewer/JsonViewer.stories.tsx +1 -1
- package/src/JsonViewer/index.ts +2 -2
- package/src/Layout/__tests__/PageLayout.test.tsx +17 -0
- package/src/Layout/__tests__/RootLayout.test.tsx +17 -0
- package/src/Layout/__tests__/__snapshots__/PageLayout.test.tsx.snap +38 -0
- package/src/Layout/__tests__/__snapshots__/RootLayout.test.tsx.snap +18 -0
- package/src/Layout/index.ts +2 -2
- package/src/Markdown/Admonition.tsx +15 -15
- package/src/Markdown/CodeSample/index.ts +3 -3
- package/src/Markdown/Heading.tsx +4 -1
- package/src/Markdown/MarkdownLayout.tsx +2 -2
- package/src/Markdown/StyledMarkdown.tsx +27 -27
- package/src/Markdown/Tabs/index.ts +2 -2
- package/src/Markdown/index.ts +9 -9
- package/src/Navbar/Navbar.stories.tsx +7 -3
- package/src/Navbar/Navbar.tsx +2 -3
- package/src/Navbar/NavbarItem.tsx +1 -1
- package/src/Navbar/index.ts +3 -0
- package/src/NavbarLogo/NavbarLogo.stories.tsx +20 -0
- package/src/NavbarLogo/NavbarLogo.tsx +24 -0
- package/src/NavbarLogo/__tests__/NavbarLogo.test.tsx +47 -0
- package/src/NavbarLogo/__tests__/__snapshots__/NavbarLogo.test.tsx.snap +38 -0
- package/src/NavbarLogo/index.ts +1 -0
- package/src/OperationBadge/OperationBadge.stories.tsx +1 -1
- package/src/OperationBadge/index.ts +1 -1
- package/src/PageNavigation/index.ts +3 -0
- package/src/Panel/index.ts +8 -8
- package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +1 -1
- package/src/SamplesPanelControls/index.ts +1 -1
- package/src/Search/Autocomplete.tsx +1 -1
- package/src/Search/Parameters.tsx +2 -2
- package/src/Search/SearchItem.tsx +2 -2
- package/src/Search/index.ts +9 -9
- package/src/Search/utils.tsx +1 -1
- package/src/Sidebar/BackButton.tsx +2 -2
- package/src/Sidebar/DrilldownMenuItem.tsx +4 -4
- package/src/Sidebar/Menu.tsx +1 -1
- package/src/Sidebar/MenuItemLabel.tsx +4 -4
- package/src/Sidebar/MenuLink.tsx +1 -1
- package/src/Sidebar/MobileSidebarButton.tsx +2 -2
- package/src/Sidebar/Sidebar.tsx +1 -1
- package/src/Sidebar/index.ts +19 -19
- package/src/Sidebar/types/index.ts +5 -5
- package/src/SidebarLogo/SidebarLogo.stories.tsx +1 -1
- package/src/SidebarLogo/index.ts +1 -1
- package/src/SourceCode/SourceCode.stories.tsx +1 -1
- package/src/SourceCode/index.ts +1 -1
- package/src/TableOfContent/TableOfContent.tsx +6 -6
- package/src/TableOfContent/index.ts +1 -1
- package/src/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/Tooltip/index.ts +1 -1
- package/src/Welcome.stories.mdx +7 -0
- package/src/globalStyle.ts +102 -7
- package/src/hooks/index.ts +7 -7
- package/src/hooks/useActiveSectionId.ts +3 -3
- package/src/icons/ShelfIcon/index.ts +2 -2
- package/src/icons/index.ts +1 -1
- package/src/types/portal/index.d.ts +0 -1
- package/src/types/portal/src/client/app/Sidebar/types.d.ts +32 -41
- package/src/types/portal/src/client/app/media-css.d.ts +4 -4
- package/src/types/portal/src/client/styling/default.d.ts +585 -391
- package/src/types/portal/src/client/styling/index.d.ts +2 -6
- package/src/types/portal/src/server/constants.d.ts +5 -9
- package/src/types/portal/src/server/plugins/markdown/types.d.ts +14 -19
- package/src/types/portal/src/server/plugins/portal-config/types.d.ts +12 -12
- package/src/types/portal/src/server/plugins/types.d.ts +55 -0
- package/src/types/portal/src/server/store.d.ts +49 -97
- package/src/types/portal/src/server/utils/async.d.ts +1 -5
- package/src/types/portal/src/server/utils/content-provider.d.ts +51 -0
- package/src/types/portal/src/server/utils/index.d.ts +1 -1
- package/src/types/portal/src/server/utils/paths.d.ts +10 -13
- package/src/types/portal/src/server/utils/reporter/formatter.d.ts +8 -8
- package/src/types/portal/src/server/utils/reporter/reporter.d.ts +15 -15
- package/src/types/portal/src/server/version-store.d.ts +35 -0
- package/src/types/portal/src/shared/constants.d.ts +6 -6
- package/src/types/portal/src/shared/types.d.ts +97 -58
- package/src/types/portal/src/shared/urls.d.ts +2 -1
- package/src/ui/AlertIcon.tsx +8 -7
- package/src/ui/Background.tsx +3 -3
- package/src/ui/Dropdown.tsx +4 -4
- package/src/ui/Jumbotron.tsx +3 -3
- package/src/ui/Tiles/TileHeader.ts +1 -1
- package/src/ui/Tiles/TileText.tsx +2 -2
- package/src/ui/Tiles/index.ts +4 -4
- package/src/ui/Typography.tsx +22 -22
- package/ui/AlertIcon.d.ts +3 -2
- package/ui/AlertIcon.js +2 -2
- package/ui/Background.js +1 -1
- package/ui/Dropdown.js +3 -3
- package/ui/Jumbotron.js +3 -3
- package/ui/Tiles/TileHeader.js +1 -1
- package/ui/Tiles/TileText.js +1 -1
- package/ui/Tiles/index.d.ts +4 -4
- package/ui/Tiles/index.js +4 -4
- package/ui/Typography.js +20 -20
- package/Logo/Logo.d.ts +0 -5
- package/Logo/index.d.ts +0 -1
- package/src/Introduction.stories.mdx +0 -7
- package/src/Logo/Logo.tsx +0 -17
- package/src/Logo/index.ts +0 -1
- package/src/types/portal/src/server/plugins/nav-utils.d.ts +0 -19
- package/src/types/portal/src/server/plugins/sidebars/index.d.ts +0 -16
- package/src/types/portal/src/server/plugins/versions/index.d.ts +0 -15
- package/src/types/portal/src/server/plugins/versions/types.d.ts +0 -23
- package/src/types/portal/src/server/plugins/versions/utils.d.ts +0 -10
- package/src/types/portal/src/server/utils/watcher.d.ts +0 -16
package/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
1
|
+
export * from '../hooks/useControl';
|
|
2
|
+
export * from '../hooks/useMount';
|
|
3
|
+
export * from '../hooks/useUnmount';
|
|
4
|
+
export * from '../hooks/useActiveHeading';
|
|
5
|
+
export * from '../hooks/useActiveSectionId';
|
|
6
|
+
export * from '../hooks/useFullHeight';
|
|
7
|
+
export * from '../hooks/useNavbarHeight';
|
package/hooks/index.js
CHANGED
|
@@ -14,10 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("
|
|
18
|
-
__exportStar(require("
|
|
19
|
-
__exportStar(require("
|
|
20
|
-
__exportStar(require("
|
|
21
|
-
__exportStar(require("
|
|
22
|
-
__exportStar(require("
|
|
23
|
-
__exportStar(require("
|
|
17
|
+
__exportStar(require("../hooks/useControl"), exports);
|
|
18
|
+
__exportStar(require("../hooks/useMount"), exports);
|
|
19
|
+
__exportStar(require("../hooks/useUnmount"), exports);
|
|
20
|
+
__exportStar(require("../hooks/useActiveHeading"), exports);
|
|
21
|
+
__exportStar(require("../hooks/useActiveSectionId"), exports);
|
|
22
|
+
__exportStar(require("../hooks/useFullHeight"), exports);
|
|
23
|
+
__exportStar(require("../hooks/useNavbarHeight"), exports);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Location } from 'history';
|
|
2
2
|
export declare type UseActiveSectionIdReturnType = string;
|
|
3
|
-
export declare function useActiveSectionId(location:
|
|
3
|
+
export declare function useActiveSectionId(location: Location, hasOverviewPage?: boolean): UseActiveSectionIdReturnType;
|
|
@@ -8,6 +8,7 @@ var react_1 = require("react");
|
|
|
8
8
|
var lodash_throttle_1 = __importDefault(require("lodash.throttle"));
|
|
9
9
|
var useNavbarHeight_1 = require("../hooks/useNavbarHeight");
|
|
10
10
|
function useActiveSectionId(location, hasOverviewPage) {
|
|
11
|
+
if (hasOverviewPage === void 0) { hasOverviewPage = false; }
|
|
11
12
|
var _a = (0, react_1.useState)(''), itemId = _a[0], setItemId = _a[1];
|
|
12
13
|
var navbarHeight = (0, useNavbarHeight_1.useNavbarHeight)(location);
|
|
13
14
|
var scrollListener = (0, react_1.useMemo)(function () {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ShelfIcon } from '
|
|
2
|
-
export type { ShelfIconProps } from '
|
|
1
|
+
export { ShelfIcon } from '../../icons/ShelfIcon/ShelfIcon';
|
|
2
|
+
export type { ShelfIconProps } from '../../icons/ShelfIcon/ShelfIcon';
|
package/icons/ShelfIcon/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ShelfIcon = void 0;
|
|
4
|
-
var ShelfIcon_1 = require("
|
|
4
|
+
var ShelfIcon_1 = require("../../icons/ShelfIcon/ShelfIcon");
|
|
5
5
|
Object.defineProperty(exports, "ShelfIcon", { enumerable: true, get: function () { return ShelfIcon_1.ShelfIcon; } });
|
package/icons/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '../icons/ShelfIcon';
|
package/icons/index.js
CHANGED
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("
|
|
17
|
+
__exportStar(require("../icons/ShelfIcon"), exports);
|
package/package.json
CHANGED
package/src/Button/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '@theme/Button/Button';
|
package/src/CodeBlock/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '@theme/CodeBlock/CodeBlock';
|
package/src/CopyButton/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
1
|
+
export * from '@theme/CopyButton/CopyButtonWrapper';
|
|
2
|
+
export * from '@theme/CopyButton/CopyButton';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Footer } from '@theme/Footer';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Portal/Footer',
|
|
8
|
+
component: Footer,
|
|
9
|
+
} as ComponentMeta<typeof Footer>;
|
|
10
|
+
|
|
11
|
+
const Template: ComponentStory<typeof Footer> = (args) => <Footer {...args} />;
|
|
12
|
+
|
|
13
|
+
export const WithCopyrightOnly = Template.bind({});
|
|
14
|
+
WithCopyrightOnly.args = {
|
|
15
|
+
copyrightText: 'Redocly ®',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const WithColumns = Template.bind({});
|
|
19
|
+
WithColumns.args = {
|
|
20
|
+
copyrightText: 'Redocly ®',
|
|
21
|
+
columns: [
|
|
22
|
+
{
|
|
23
|
+
group: 'Products',
|
|
24
|
+
items: [
|
|
25
|
+
{ label: 'Portal', active: true, type: 'link', link: 'https://redocly.com/portals/' },
|
|
26
|
+
{ label: 'Workflows', type: 'link', link: 'https://redocly.com/workflows/' },
|
|
27
|
+
{ label: 'Redocly CLI', type: 'link', link: 'https://redocly.com/redocly-cli/' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
group: 'Explore',
|
|
32
|
+
items: [
|
|
33
|
+
{ label: 'Pricing', type: 'link', link: 'https://redocly.com/pricing/' },
|
|
34
|
+
{ label: 'Enterprise', type: 'link', link: 'https://redocly.com/enterprise/' },
|
|
35
|
+
{ label: 'Customers', type: 'link', link: 'https://redocly.com/customers/' },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
group: 'Resources',
|
|
40
|
+
items: [
|
|
41
|
+
{ label: 'Docs', type: 'link', link: 'https://redocly.com/docs/' },
|
|
42
|
+
{ label: 'Blog', type: 'link', link: 'https://redocly.com/blog/' },
|
|
43
|
+
{ label: 'Webinars', type: 'link', link: 'https://redocly.com/webinars/' },
|
|
44
|
+
{ label: 'Error link', type: 'error' },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
group: 'Other',
|
|
49
|
+
items: [
|
|
50
|
+
{ label: 'External', type: 'link', link: 'https://google.com/', external: true },
|
|
51
|
+
{ type: 'separator', separatorLine: true },
|
|
52
|
+
{ label: 'Twitter', type: 'link', link: 'https://twitter.com/' },
|
|
53
|
+
{ label: 'Error link', type: 'error' },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
package/src/Footer/Footer.tsx
CHANGED
|
@@ -5,10 +5,7 @@ import { FooterColumns } from '@theme/Footer/FooterColumns';
|
|
|
5
5
|
import { FooterCopyright } from '@theme/Footer/FooterCopyright';
|
|
6
6
|
import type { FooterConfig } from '@theme/types/portal';
|
|
7
7
|
|
|
8
|
-
export function Footer({
|
|
9
|
-
columns,
|
|
10
|
-
copyrightText,
|
|
11
|
-
}: React.PropsWithChildren<FooterConfig>): JSX.Element | null {
|
|
8
|
+
export function Footer({ columns, copyrightText }: FooterConfig): JSX.Element | null {
|
|
12
9
|
if (!(columns?.length || copyrightText)) {
|
|
13
10
|
return null;
|
|
14
11
|
}
|
|
@@ -24,11 +21,11 @@ export function Footer({
|
|
|
24
21
|
const FooterContainer = styled.footer`
|
|
25
22
|
font-size: 1rem;
|
|
26
23
|
flex-shrink: 0;
|
|
27
|
-
background-color: var(--footer-color
|
|
28
|
-
color: var(--footer-color
|
|
29
|
-
font-family: var(--font-family-
|
|
24
|
+
background-color: var(--footer-background-color);
|
|
25
|
+
color: var(--footer-text-color);
|
|
26
|
+
font-family: var(--font-family-base);
|
|
30
27
|
a,
|
|
31
28
|
a:hover {
|
|
32
|
-
color: var(--footer-color
|
|
29
|
+
color: var(--footer-text-color);
|
|
33
30
|
}
|
|
34
31
|
`;
|
|
@@ -12,17 +12,17 @@ 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>
|
|
15
|
-
{column.items.map((columnItem,
|
|
15
|
+
{column.items.map((columnItem, columnItemIndex) => {
|
|
16
16
|
if (columnItem.type === 'error') {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
return columnItem.type === 'separator' ? (
|
|
21
|
-
<FooterSeparator key={columnItem.label + '_' +
|
|
21
|
+
<FooterSeparator key={columnItem.label + '_' + columnItemIndex}>
|
|
22
22
|
{columnItem.label}
|
|
23
23
|
</FooterSeparator>
|
|
24
24
|
) : (
|
|
25
|
-
<FooterLink key={
|
|
25
|
+
<FooterLink key={columnItemIndex} to={columnItem.link} data-cy={columnItem.label}>
|
|
26
26
|
{columnItem.label}
|
|
27
27
|
</FooterLink>
|
|
28
28
|
);
|
|
@@ -36,7 +36,7 @@ const FooterColumnTitle = styled.p`
|
|
|
36
36
|
font-weight: var(--font-weight-regular);
|
|
37
37
|
font-size: 24px;
|
|
38
38
|
margin-bottom: 1.5em;
|
|
39
|
-
font-family: var(--font-family
|
|
39
|
+
font-family: var(--h-font-family);
|
|
40
40
|
`;
|
|
41
41
|
|
|
42
42
|
const FooterSeparator = styled.div`
|
|
@@ -44,19 +44,19 @@ const FooterSeparator = styled.div`
|
|
|
44
44
|
margin: 10px 0 5px 0;
|
|
45
45
|
font-size: 0.75em;
|
|
46
46
|
text-transform: uppercase;
|
|
47
|
-
font-family: var(--font-family
|
|
47
|
+
font-family: var(--h-font-family);
|
|
48
48
|
`;
|
|
49
49
|
|
|
50
50
|
const FooterColumnContainer = styled.div`
|
|
51
51
|
display: flex;
|
|
52
52
|
flex-direction: column;
|
|
53
53
|
text-align: left;
|
|
54
|
-
margin:
|
|
54
|
+
margin: 0 30px;
|
|
55
55
|
`;
|
|
56
56
|
|
|
57
57
|
const FooterLink = styled(Link)`
|
|
58
58
|
font-weight: var(--font-weight-bold);
|
|
59
59
|
padding-bottom: 0.75em;
|
|
60
|
-
color: var(--footer-color
|
|
60
|
+
color: var(--footer-text-color);
|
|
61
61
|
text-decoration: none;
|
|
62
62
|
`;
|
|
@@ -6,7 +6,9 @@ import type { FooterConfig } from '@theme/types/portal';
|
|
|
6
6
|
|
|
7
7
|
export function FooterColumns({
|
|
8
8
|
columns = [],
|
|
9
|
-
}:
|
|
9
|
+
}: {
|
|
10
|
+
columns?: FooterConfig['columns'];
|
|
11
|
+
}): JSX.Element | null {
|
|
10
12
|
if (!columns?.length) {
|
|
11
13
|
return null;
|
|
12
14
|
}
|
|
@@ -5,7 +5,9 @@ import type { FooterConfig } from '@theme/types/portal';
|
|
|
5
5
|
|
|
6
6
|
export function FooterCopyright({
|
|
7
7
|
copyrightText = '',
|
|
8
|
-
}:
|
|
8
|
+
}: {
|
|
9
|
+
copyrightText?: FooterConfig['copyrightText'];
|
|
10
|
+
}): JSX.Element | null {
|
|
9
11
|
return copyrightText ? (
|
|
10
12
|
<Wrapper data-component-name="Footer/FooterCopyright">{copyrightText}</Wrapper>
|
|
11
13
|
) : null;
|
|
@@ -17,8 +19,8 @@ const Wrapper = styled.section`
|
|
|
17
19
|
font-size: 0.875em;
|
|
18
20
|
padding: 1.5em 3em;
|
|
19
21
|
font-weight: var(--font-weight-bold);
|
|
20
|
-
background-color: var(--footer-color
|
|
21
|
-
color: var(--footer-color
|
|
22
|
+
background-color: var(--footer-background-color);
|
|
23
|
+
color: var(--footer-text-color);
|
|
22
24
|
text-align: center;
|
|
23
25
|
span {
|
|
24
26
|
max-width: 1200px;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { renderWithTheme } from '../../../tests/utils';
|
|
4
|
+
|
|
5
|
+
import { Footer } from '@theme/Footer';
|
|
6
|
+
|
|
7
|
+
describe('Footer', () => {
|
|
8
|
+
it('renders columns with copyright and columns', () => {
|
|
9
|
+
const { container } = renderWithTheme(
|
|
10
|
+
<Footer
|
|
11
|
+
columns={[
|
|
12
|
+
{
|
|
13
|
+
group: 'Other',
|
|
14
|
+
items: [
|
|
15
|
+
{ label: 'External', type: 'link', link: 'https://google.com/' },
|
|
16
|
+
{ type: 'separator', separatorLine: true },
|
|
17
|
+
{ label: 'Twitter', type: 'link', link: 'https://twitter.com/' },
|
|
18
|
+
{ label: 'Error link', type: 'error' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
group: '',
|
|
23
|
+
label: 'Another',
|
|
24
|
+
items: [
|
|
25
|
+
{ type: 'separator', separatorLine: true },
|
|
26
|
+
{ label: 'Twitter', type: 'link', link: 'https://twitter.com/' },
|
|
27
|
+
{ label: 'Error link', type: 'error' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
]}
|
|
31
|
+
copyrightText="Copyright®"
|
|
32
|
+
/>,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('renders columns with copyright only', () => {
|
|
39
|
+
const { container } = renderWithTheme(<Footer copyrightText="Copyright®" />);
|
|
40
|
+
|
|
41
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('renders nothing, if no columns and copyright provided', () => {
|
|
45
|
+
const { container } = renderWithTheme(<Footer />);
|
|
46
|
+
|
|
47
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('renders nothing, if empty columns and copyright provided', () => {
|
|
51
|
+
const { container } = renderWithTheme(<Footer columns={[]} />);
|
|
52
|
+
|
|
53
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Footer renders columns with copyright and columns 1`] = `
|
|
4
|
+
.c4 {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
font-weight: var(--font-weight-regular);
|
|
7
|
+
font-size: 24px;
|
|
8
|
+
margin-bottom: 1.5em;
|
|
9
|
+
font-family: var(--h-font-family);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.c6 {
|
|
13
|
+
opacity: 0.75;
|
|
14
|
+
margin: 10px 0 5px 0;
|
|
15
|
+
font-size: 0.75em;
|
|
16
|
+
text-transform: uppercase;
|
|
17
|
+
font-family: var(--h-font-family);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.c3 {
|
|
21
|
+
display: -webkit-box;
|
|
22
|
+
display: -webkit-flex;
|
|
23
|
+
display: -ms-flexbox;
|
|
24
|
+
display: flex;
|
|
25
|
+
-webkit-flex-direction: column;
|
|
26
|
+
-ms-flex-direction: column;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
text-align: left;
|
|
29
|
+
margin: 0 30px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.c5 {
|
|
33
|
+
font-weight: var(--font-weight-bold);
|
|
34
|
+
padding-bottom: 0.75em;
|
|
35
|
+
color: var(--footer-text-color);
|
|
36
|
+
-webkit-text-decoration: none;
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.c1 {
|
|
41
|
+
padding: 3em 20px 1em 20px;
|
|
42
|
+
display: -webkit-box;
|
|
43
|
+
display: -webkit-flex;
|
|
44
|
+
display: -ms-flexbox;
|
|
45
|
+
display: flex;
|
|
46
|
+
-webkit-flex-direction: column;
|
|
47
|
+
-ms-flex-direction: column;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
-webkit-box-pack: center;
|
|
50
|
+
-webkit-justify-content: center;
|
|
51
|
+
-ms-flex-pack: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
max-width: 1200px;
|
|
54
|
+
margin: 0 auto;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.c2 {
|
|
58
|
+
display: -webkit-box;
|
|
59
|
+
display: -webkit-flex;
|
|
60
|
+
display: -ms-flexbox;
|
|
61
|
+
display: flex;
|
|
62
|
+
-webkit-flex-wrap: wrap;
|
|
63
|
+
-ms-flex-wrap: wrap;
|
|
64
|
+
flex-wrap: wrap;
|
|
65
|
+
-webkit-box-pack: start;
|
|
66
|
+
-webkit-justify-content: flex-start;
|
|
67
|
+
-ms-flex-pack: start;
|
|
68
|
+
justify-content: flex-start;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.c7 {
|
|
72
|
+
display: -webkit-box;
|
|
73
|
+
display: -webkit-flex;
|
|
74
|
+
display: -ms-flexbox;
|
|
75
|
+
display: flex;
|
|
76
|
+
-webkit-box-pack: center;
|
|
77
|
+
-webkit-justify-content: center;
|
|
78
|
+
-ms-flex-pack: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
font-size: 0.875em;
|
|
81
|
+
padding: 1.5em 3em;
|
|
82
|
+
font-weight: var(--font-weight-bold);
|
|
83
|
+
background-color: var(--footer-background-color);
|
|
84
|
+
color: var(--footer-text-color);
|
|
85
|
+
text-align: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.c7 span {
|
|
89
|
+
max-width: 1200px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.c0 {
|
|
93
|
+
font-size: 1rem;
|
|
94
|
+
-webkit-flex-shrink: 0;
|
|
95
|
+
-ms-flex-negative: 0;
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
background-color: var(--footer-background-color);
|
|
98
|
+
color: var(--footer-text-color);
|
|
99
|
+
font-family: var(--font-family-base);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.c0 a,
|
|
103
|
+
.c0 a:hover {
|
|
104
|
+
color: var(--footer-text-color);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@media screen and (min-width:50rem) {
|
|
108
|
+
.c1 {
|
|
109
|
+
padding: 5.625em 20px 3.9375em 20px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media print {
|
|
114
|
+
.c1 {
|
|
115
|
+
color: black;
|
|
116
|
+
display: none;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@media screen and (min-width:50rem) {
|
|
121
|
+
.c2 {
|
|
122
|
+
-webkit-box-pack: space-evenly;
|
|
123
|
+
-webkit-justify-content: space-evenly;
|
|
124
|
+
-ms-flex-pack: space-evenly;
|
|
125
|
+
justify-content: space-evenly;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
<footer
|
|
130
|
+
class="c0"
|
|
131
|
+
data-component-name="Footer/Footer"
|
|
132
|
+
>
|
|
133
|
+
<div
|
|
134
|
+
class="c1"
|
|
135
|
+
data-component-name="Footer/FooterColumns"
|
|
136
|
+
>
|
|
137
|
+
<div
|
|
138
|
+
class="c2"
|
|
139
|
+
>
|
|
140
|
+
<div
|
|
141
|
+
class="c3"
|
|
142
|
+
data-component-name="Footer/FooterColumn"
|
|
143
|
+
>
|
|
144
|
+
<p
|
|
145
|
+
class="c4"
|
|
146
|
+
>
|
|
147
|
+
Other
|
|
148
|
+
</p>
|
|
149
|
+
<a
|
|
150
|
+
class="c5"
|
|
151
|
+
data-cy="External"
|
|
152
|
+
href="https://google.com/"
|
|
153
|
+
to="https://google.com/"
|
|
154
|
+
>
|
|
155
|
+
External
|
|
156
|
+
</a>
|
|
157
|
+
<div
|
|
158
|
+
class="c6"
|
|
159
|
+
/>
|
|
160
|
+
<a
|
|
161
|
+
class="c5"
|
|
162
|
+
data-cy="Twitter"
|
|
163
|
+
href="https://twitter.com/"
|
|
164
|
+
to="https://twitter.com/"
|
|
165
|
+
>
|
|
166
|
+
Twitter
|
|
167
|
+
</a>
|
|
168
|
+
</div>
|
|
169
|
+
<div
|
|
170
|
+
class="c3"
|
|
171
|
+
data-component-name="Footer/FooterColumn"
|
|
172
|
+
>
|
|
173
|
+
<p
|
|
174
|
+
class="c4"
|
|
175
|
+
>
|
|
176
|
+
Another
|
|
177
|
+
</p>
|
|
178
|
+
<div
|
|
179
|
+
class="c6"
|
|
180
|
+
/>
|
|
181
|
+
<a
|
|
182
|
+
class="c5"
|
|
183
|
+
data-cy="Twitter"
|
|
184
|
+
href="https://twitter.com/"
|
|
185
|
+
to="https://twitter.com/"
|
|
186
|
+
>
|
|
187
|
+
Twitter
|
|
188
|
+
</a>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
<section
|
|
193
|
+
class="c7"
|
|
194
|
+
data-component-name="Footer/FooterCopyright"
|
|
195
|
+
>
|
|
196
|
+
Copyright®
|
|
197
|
+
</section>
|
|
198
|
+
</footer>
|
|
199
|
+
`;
|
|
200
|
+
|
|
201
|
+
exports[`Footer renders columns with copyright only 1`] = `
|
|
202
|
+
.c1 {
|
|
203
|
+
display: -webkit-box;
|
|
204
|
+
display: -webkit-flex;
|
|
205
|
+
display: -ms-flexbox;
|
|
206
|
+
display: flex;
|
|
207
|
+
-webkit-box-pack: center;
|
|
208
|
+
-webkit-justify-content: center;
|
|
209
|
+
-ms-flex-pack: center;
|
|
210
|
+
justify-content: center;
|
|
211
|
+
font-size: 0.875em;
|
|
212
|
+
padding: 1.5em 3em;
|
|
213
|
+
font-weight: var(--font-weight-bold);
|
|
214
|
+
background-color: var(--footer-background-color);
|
|
215
|
+
color: var(--footer-text-color);
|
|
216
|
+
text-align: center;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.c1 span {
|
|
220
|
+
max-width: 1200px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.c0 {
|
|
224
|
+
font-size: 1rem;
|
|
225
|
+
-webkit-flex-shrink: 0;
|
|
226
|
+
-ms-flex-negative: 0;
|
|
227
|
+
flex-shrink: 0;
|
|
228
|
+
background-color: var(--footer-background-color);
|
|
229
|
+
color: var(--footer-text-color);
|
|
230
|
+
font-family: var(--font-family-base);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.c0 a,
|
|
234
|
+
.c0 a:hover {
|
|
235
|
+
color: var(--footer-text-color);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
<footer
|
|
239
|
+
class="c0"
|
|
240
|
+
data-component-name="Footer/Footer"
|
|
241
|
+
>
|
|
242
|
+
<section
|
|
243
|
+
class="c1"
|
|
244
|
+
data-component-name="Footer/FooterCopyright"
|
|
245
|
+
>
|
|
246
|
+
Copyright®
|
|
247
|
+
</section>
|
|
248
|
+
</footer>
|
|
249
|
+
`;
|
|
250
|
+
|
|
251
|
+
exports[`Footer renders nothing, if empty columns and copyright provided 1`] = `null`;
|
|
252
|
+
|
|
253
|
+
exports[`Footer renders nothing, if no columns and copyright provided 1`] = `null`;
|
package/src/Footer/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
1
|
+
export * from '@theme/Footer/Footer';
|
|
2
|
+
export * from '@theme/Footer/FooterColumn';
|
|
3
|
+
export * from '@theme/Footer/FooterColumns';
|
|
4
|
+
export * from '@theme/Footer/FooterCopyright';
|
package/src/Headings/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '@theme/Headings/Headings';
|
package/src/JsonViewer/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
1
|
+
export * from '@theme/JsonViewer/JsonViewer';
|
|
2
|
+
export * from '@theme/JsonViewer/styled';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { renderWithTheme } from '../../../tests/utils';
|
|
4
|
+
|
|
5
|
+
import { PageLayout } from '@theme/Layout/PageLayout';
|
|
6
|
+
|
|
7
|
+
describe('PageLayout', () => {
|
|
8
|
+
it('renders', () => {
|
|
9
|
+
const { container } = renderWithTheme(
|
|
10
|
+
<PageLayout sidebar={<div>sidebar</div>}>
|
|
11
|
+
<div>test content</div>
|
|
12
|
+
</PageLayout>,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { renderWithTheme } from '../../../tests/utils';
|
|
4
|
+
|
|
5
|
+
import { RootLayout } from '@theme/Layout/RootLayout';
|
|
6
|
+
|
|
7
|
+
describe('RootLayout', () => {
|
|
8
|
+
it('renders', () => {
|
|
9
|
+
const { container } = renderWithTheme(
|
|
10
|
+
<RootLayout footer={<div>footer</div>} navbar={<div>navbar</div>}>
|
|
11
|
+
<div>content</div>
|
|
12
|
+
</RootLayout>,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
});
|