@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,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { ThemeProvider } from 'styled-components';
|
|
4
|
+
|
|
5
|
+
import { TableOfContent } from '@theme/TableOfContent';
|
|
6
|
+
import { generateMediaQueries } from '@theme/utils/media-css';
|
|
7
|
+
|
|
8
|
+
const breakpoints = { small: '1rem', medium: '1rem', large: '1rem' };
|
|
9
|
+
|
|
10
|
+
const theme = {
|
|
11
|
+
mediaQueries: generateMediaQueries(breakpoints),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Portal/TableOfContent',
|
|
16
|
+
component: TableOfContent,
|
|
17
|
+
decorators: [
|
|
18
|
+
(Story) => (
|
|
19
|
+
<ThemeProvider theme={theme}>
|
|
20
|
+
<Story />
|
|
21
|
+
</ThemeProvider>
|
|
22
|
+
),
|
|
23
|
+
],
|
|
24
|
+
} as ComponentMeta<typeof TableOfContent>;
|
|
25
|
+
|
|
26
|
+
const Template: ComponentStory<typeof TableOfContent> = (args) => (
|
|
27
|
+
<TableOfContent {...args}>Click</TableOfContent>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = {
|
|
32
|
+
headings: [
|
|
33
|
+
{ id: '1', value: 'test 1', depth: 1 },
|
|
34
|
+
{ id: '2', value: 'test 2', depth: 1 },
|
|
35
|
+
{ id: '3', value: 'test 3', depth: 2 },
|
|
36
|
+
{ id: '4', value: 'test 4', depth: 2 },
|
|
37
|
+
{ id: '5', value: 'test 5', depth: 1 },
|
|
38
|
+
],
|
|
39
|
+
};
|
|
@@ -11,7 +11,7 @@ interface TableOfContentProps {
|
|
|
11
11
|
tocMaxDepth: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export function TableOfContent(props: TableOfContentProps): JSX.Element | null {
|
|
15
15
|
const { headings, tocMaxDepth } = props;
|
|
16
16
|
|
|
17
17
|
const sidebar = useRef<HTMLDivElement | null>(null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TableOfContent';
|
package/src/index.ts
CHANGED
|
File without changes
|
package/src/ui/Dropdown.tsx
CHANGED
|
@@ -84,7 +84,7 @@ const DropDownLink = styled(Link)`
|
|
|
84
84
|
color: var(--color-text-main);
|
|
85
85
|
`;
|
|
86
86
|
|
|
87
|
-
export
|
|
87
|
+
export function Dropdown({ items, activeItem }: DropdownProps): JSX.Element {
|
|
88
88
|
const ref = useRef<HTMLDivElement>(null);
|
|
89
89
|
const [isOpen, setIsOpen] = useState(false);
|
|
90
90
|
const toggling = () => setIsOpen(!isOpen);
|
package/src/ui/UniversalLink.tsx
CHANGED
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { useLocation, LinkProps } from 'react-router-dom';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
|
-
import isUrl from '@theme/utils/isUrl';
|
|
6
|
-
import replaceHashInColor from '@theme/utils/replaceHashInColor';
|
|
5
|
+
import { isUrl } from '@theme/utils/isUrl';
|
|
6
|
+
import { replaceHashInColor } from '@theme/utils/replaceHashInColor';
|
|
7
7
|
import { Link } from '@portal/Link';
|
|
8
8
|
|
|
9
9
|
const StyledExternalLink = styled.a`
|
package/src/ui/index.tsx
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
export * from '@theme/ui/Tiles';
|
|
4
|
+
export * from '@theme/ui/AlertIcon';
|
|
5
|
+
export * from '@theme/ui/Arrow';
|
|
6
|
+
export * from '@theme/ui/Background';
|
|
3
7
|
export * from '@theme/ui/Box';
|
|
8
|
+
export * from '@theme/ui/Button';
|
|
9
|
+
export * from '@theme/ui/Dropdown';
|
|
4
10
|
export * from '@theme/ui/Flex';
|
|
5
11
|
export * from '@theme/ui/Jumbotron';
|
|
6
12
|
export * from '@theme/ui/Typography';
|
|
7
|
-
export * from '@theme/ui/
|
|
8
|
-
export * from '@theme/ui/Tiles/ThinTile';
|
|
13
|
+
export * from '@theme/ui/UniversalLink';
|
|
9
14
|
|
|
10
15
|
export const LandingLayout = ({ children }: React.PropsWithChildren<object>): React.ReactNode =>
|
|
11
16
|
children;
|
package/src/utils/isUrl.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/ui/Dropdown.d.ts
CHANGED
package/ui/Dropdown.js
CHANGED
|
@@ -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.Dropdown = 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,5 +51,5 @@ function Dropdown(_a) {
|
|
|
50
51
|
}, [isOpen]);
|
|
51
52
|
return ((0, jsx_runtime_1.jsxs)(DropDownContainer, __assign({ ref: ref, "data-component-name": "ui/Dropdown" }, { children: [(0, jsx_runtime_1.jsxs)(DropDownHeader, __assign({ onClick: toggling }, { children: [(activeItem === null || activeItem === void 0 ? void 0 : activeItem.label) || activeItem.version, (0, jsx_runtime_1.jsx)(IconWrapper, __assign({ className: isOpen ? 'active' : '' }, { children: (0, jsx_runtime_1.jsx)(Icon, {}) }))] })), isOpen && ((0, jsx_runtime_1.jsx)(DropDownList, { children: items.map(function (item) { return ((0, jsx_runtime_1.jsx)(ListItem, __assign({ className: activeItem.version === item.version ? 'active' : '', onClick: toggling }, { children: (0, jsx_runtime_1.jsx)(DropDownLink, __assign({ to: (item === null || item === void 0 ? void 0 : item.link) || '#' }, { children: (item === null || item === void 0 ? void 0 : item.label) || item.version })) }), (item === null || item === void 0 ? void 0 : item.link) + (item === null || item === void 0 ? void 0 : item.version))); }) }))] })));
|
|
52
53
|
}
|
|
53
|
-
exports.
|
|
54
|
+
exports.Dropdown = Dropdown;
|
|
54
55
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./ThinTile"), exports);
|
|
18
|
+
__exportStar(require("./TileHeader"), exports);
|
|
19
|
+
__exportStar(require("./TileText"), exports);
|
|
20
|
+
__exportStar(require("./WideTile"), exports);
|
package/ui/UniversalLink.js
CHANGED
|
@@ -22,12 +22,12 @@ exports.UniversalLink = exports.withPropsFilter = void 0;
|
|
|
22
22
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
23
23
|
var react_router_dom_1 = require("react-router-dom");
|
|
24
24
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
25
|
-
var isUrl_1 =
|
|
26
|
-
var replaceHashInColor_1 =
|
|
25
|
+
var isUrl_1 = require("../utils/isUrl");
|
|
26
|
+
var replaceHashInColor_1 = require("../utils/replaceHashInColor");
|
|
27
27
|
var Link_1 = require("../mocks/Link");
|
|
28
28
|
var StyledExternalLink = styled_components_1.default.a(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.external-url {\n position: relative;\n\n :after {\n content: '';\n display: inline-block;\n position: absolute;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' x='0' y='0' viewBox='0 0 100 125' enable-background='new 0 0 100 100' xml:space='preserve'%3E%3Cpath fill='", "' d='M-408.2-318.5 98.6 4.8c0-0.1 0-0.2-0.1-0.3 0-0.1-0.1-0.2-0.1-0.3 0-0.1 0-0.1-0.1-0.2 0 0 0-0.1 0-0.1 0-0.1-0.1-0.2-0.2-0.3 0-0.1-0.1-0.2-0.2-0.3 -0.1-0.1-0.1-0.2-0.2-0.3C97.7 2.9 97.6 2.8 97.5 2.7c-0.1-0.1-0.2-0.2-0.3-0.3 -0.1-0.1-0.1-0.1-0.2-0.2 -0.1-0.1-0.2-0.2-0.3-0.2 -0.1-0.1-0.2-0.1-0.2-0.2 -0.1-0.1-0.2-0.1-0.3-0.2 -0.1 0-0.2-0.1-0.3-0.1 0 0-0.1 0-0.1-0.1 -0.1 0-0.2 0-0.2-0.1 -0.1 0-0.2-0.1-0.3-0.1 -0.1 0-0.2-0.1-0.4-0.1 -0.1 0-0.2 0-0.3 0 -0.1 0-0.3 0-0.4 0 -0.1 0-0.1 0-0.2 0L63.8 1.3c-2.5 0-4.6 2.1-4.6 4.6 0 2.5 2.1 4.6 4.6 4.5l19.3-0.1 -29.8 30.2c-1.1 1.1-1.5 2.7-1.2 4.1 0.2 0.9 0.6 1.7 1.3 2.4 0.9 0.9 2.1 1.3 3.2 1.3 1.2 0 2.3-0.5 3.2-1.4l0 0 29.8-30.2 0.1 19.3c0 2.5 2.1 4.6 4.6 4.5 1.3 0 2.4-0.5 3.2-1.4 0.8-0.8 1.3-2 1.3-3.2L98.7 5.7c0-0.1 0-0.1 0-0.2 0-0.1 0-0.2 0-0.4C98.6 5 98.6 4.9 98.6 4.8zM6.5 83.3c0 5.7 4.6 10.4 10.4 10.4l55.6 0.1c5.7 0 10.4-4.6 10.4-10.4l-0.1-40.8h6.1v40.8c0 9-7.3 16.3-16.3 16.3l-56.4-0.1c-8.6 0-15.6-7-15.6-15.6L0.6 27.8c0-9 7.3-16.3 16.3-16.3l41.1-0.1v6.1L17 17.5c-5.7 0-10.4 4.6-10.4 10.4L6.5 83.3z'/%3E%3C/svg%3E\");\n width: 10px;\n height: 10px;\n background-repeat: no-repeat;\n top: 50%;\n right: -15px;\n transform: translateY(-50%);\n }\n }\n"], ["\n &.external-url {\n position: relative;\n\n :after {\n content: '';\n display: inline-block;\n position: absolute;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' x='0' y='0' viewBox='0 0 100 125' enable-background='new 0 0 100 100' xml:space='preserve'%3E%3Cpath fill='", "' d='M-408.2-318.5 98.6 4.8c0-0.1 0-0.2-0.1-0.3 0-0.1-0.1-0.2-0.1-0.3 0-0.1 0-0.1-0.1-0.2 0 0 0-0.1 0-0.1 0-0.1-0.1-0.2-0.2-0.3 0-0.1-0.1-0.2-0.2-0.3 -0.1-0.1-0.1-0.2-0.2-0.3C97.7 2.9 97.6 2.8 97.5 2.7c-0.1-0.1-0.2-0.2-0.3-0.3 -0.1-0.1-0.1-0.1-0.2-0.2 -0.1-0.1-0.2-0.2-0.3-0.2 -0.1-0.1-0.2-0.1-0.2-0.2 -0.1-0.1-0.2-0.1-0.3-0.2 -0.1 0-0.2-0.1-0.3-0.1 0 0-0.1 0-0.1-0.1 -0.1 0-0.2 0-0.2-0.1 -0.1 0-0.2-0.1-0.3-0.1 -0.1 0-0.2-0.1-0.4-0.1 -0.1 0-0.2 0-0.3 0 -0.1 0-0.3 0-0.4 0 -0.1 0-0.1 0-0.2 0L63.8 1.3c-2.5 0-4.6 2.1-4.6 4.6 0 2.5 2.1 4.6 4.6 4.5l19.3-0.1 -29.8 30.2c-1.1 1.1-1.5 2.7-1.2 4.1 0.2 0.9 0.6 1.7 1.3 2.4 0.9 0.9 2.1 1.3 3.2 1.3 1.2 0 2.3-0.5 3.2-1.4l0 0 29.8-30.2 0.1 19.3c0 2.5 2.1 4.6 4.6 4.5 1.3 0 2.4-0.5 3.2-1.4 0.8-0.8 1.3-2 1.3-3.2L98.7 5.7c0-0.1 0-0.1 0-0.2 0-0.1 0-0.2 0-0.4C98.6 5 98.6 4.9 98.6 4.8zM6.5 83.3c0 5.7 4.6 10.4 10.4 10.4l55.6 0.1c5.7 0 10.4-4.6 10.4-10.4l-0.1-40.8h6.1v40.8c0 9-7.3 16.3-16.3 16.3l-56.4-0.1c-8.6 0-15.6-7-15.6-15.6L0.6 27.8c0-9 7.3-16.3 16.3-16.3l41.1-0.1v6.1L17 17.5c-5.7 0-10.4 4.6-10.4 10.4L6.5 83.3z'/%3E%3C/svg%3E\");\n width: 10px;\n height: 10px;\n background-repeat: no-repeat;\n top: 50%;\n right: -15px;\n transform: translateY(-50%);\n }\n }\n"])), function (_a) {
|
|
29
29
|
var theme = _a.theme;
|
|
30
|
-
return (0, replaceHashInColor_1.
|
|
30
|
+
return (0, replaceHashInColor_1.replaceHashInColor)(theme.colors.text.primary);
|
|
31
31
|
});
|
|
32
32
|
// TODO: We're using our own Link component so probably filtering is not necessary here.
|
|
33
33
|
// filter out unnecessary props
|
|
@@ -56,7 +56,7 @@ var withPropsFilter = function (filterList) { return function (WrappedComponent)
|
|
|
56
56
|
exports.withPropsFilter = withPropsFilter;
|
|
57
57
|
exports.UniversalLink = (0, exports.withPropsFilter)(propsList)(function (props) {
|
|
58
58
|
var _a;
|
|
59
|
-
return (typeof props.to === 'string' && ((0, isUrl_1.
|
|
59
|
+
return (typeof props.to === 'string' && ((0, isUrl_1.isUrl)(props.to) || props.to.startsWith('mailto:'))) ||
|
|
60
60
|
props.external ? ((0, jsx_runtime_1.jsx)(StyledExternalLink, __assign({ style: props.style, href: props.to, target: props.target || (props.external && '_blank') || '_self', className: "".concat(props.external ? 'external-url' : '', " ").concat(props.className), rel: props.rel, "data-cy": "universalLink-".concat(typeof props.children === 'string' ? props.children : 'with-nested-jsx') }, { children: props.children }))) : props.to == null ? ((0, jsx_runtime_1.jsx)("a", __assign({ onClick: props.onClick, className: props.className, style: props.style }, { children: props.children }))) : ((0, jsx_runtime_1.jsx)(Link_1.Link, __assign({}, props, { to: props.to, state: __assign({ previousPath: (_a = (0, react_router_dom_1.useLocation)()) === null || _a === void 0 ? void 0 : _a.pathname }, props.state) })));
|
|
61
61
|
});
|
|
62
62
|
var templateObject_1;
|
package/ui/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export * from '../ui/
|
|
2
|
+
export * from '../ui/Tiles';
|
|
3
|
+
export * from '../ui/AlertIcon';
|
|
4
|
+
export * from '../ui/Arrow';
|
|
5
|
+
export * from '../ui/Background';
|
|
3
6
|
export * from '../ui/Box';
|
|
7
|
+
export * from '../ui/Button';
|
|
8
|
+
export * from '../ui/Dropdown';
|
|
4
9
|
export * from '../ui/Flex';
|
|
5
10
|
export * from '../ui/Jumbotron';
|
|
6
11
|
export * from '../ui/Typography';
|
|
7
|
-
export * from '../ui/
|
|
8
|
-
export * from '../ui/Tiles/ThinTile';
|
|
12
|
+
export * from '../ui/UniversalLink';
|
|
9
13
|
export declare const LandingLayout: ({ children }: React.PropsWithChildren<object>) => React.ReactNode;
|
|
10
14
|
export declare const EmptyLayout: ({ children }: React.PropsWithChildren<object>) => React.ReactNode;
|
package/ui/index.js
CHANGED
|
@@ -15,13 +15,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.EmptyLayout = exports.LandingLayout = void 0;
|
|
18
|
-
__exportStar(require("../ui/
|
|
18
|
+
__exportStar(require("../ui/Tiles"), exports);
|
|
19
|
+
__exportStar(require("../ui/AlertIcon"), exports);
|
|
20
|
+
__exportStar(require("../ui/Arrow"), exports);
|
|
21
|
+
__exportStar(require("../ui/Background"), exports);
|
|
19
22
|
__exportStar(require("../ui/Box"), exports);
|
|
23
|
+
__exportStar(require("../ui/Button"), exports);
|
|
24
|
+
__exportStar(require("../ui/Dropdown"), exports);
|
|
20
25
|
__exportStar(require("../ui/Flex"), exports);
|
|
21
26
|
__exportStar(require("../ui/Jumbotron"), exports);
|
|
22
27
|
__exportStar(require("../ui/Typography"), exports);
|
|
23
|
-
__exportStar(require("../ui/
|
|
24
|
-
__exportStar(require("../ui/Tiles/ThinTile"), exports);
|
|
28
|
+
__exportStar(require("../ui/UniversalLink"), exports);
|
|
25
29
|
var LandingLayout = function (_a) {
|
|
26
30
|
var children = _a.children;
|
|
27
31
|
return children;
|
package/utils/isUrl.d.ts
CHANGED
package/utils/isUrl.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Use two levels of REs to avoid REDOS.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.isUrl = void 0;
|
|
8
9
|
var protocolAndDomainRE = /^(?:\w+:)?\/\/(\S+)$/;
|
|
9
10
|
var localhostDomainRE = /^localhost[:?\d]*(?:[^:?\d]\S*)?$/;
|
|
10
11
|
var nonLocalhostDomainRE = /^[^\s.]+\.\S{2,}$/;
|
|
@@ -32,4 +33,4 @@ function isUrl(string) {
|
|
|
32
33
|
}
|
|
33
34
|
return false;
|
|
34
35
|
}
|
|
35
|
-
exports.
|
|
36
|
+
exports.isUrl = isUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function replaceHashInColor(color: string): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceHashInColor = void 0;
|
|
3
4
|
function replaceHashInColor(color) {
|
|
4
5
|
return color.replace('#', '%23');
|
|
5
6
|
}
|
|
6
|
-
exports.
|
|
7
|
+
exports.replaceHashInColor = replaceHashInColor;
|
package/src/Footer/index.tsx
DELETED
package/src/Layout/index.tsx
DELETED