@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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`PageLayout renders 1`] = `
|
|
4
|
+
.c0 {
|
|
5
|
+
display: -webkit-box;
|
|
6
|
+
display: -webkit-flex;
|
|
7
|
+
display: -ms-flexbox;
|
|
8
|
+
display: flex;
|
|
9
|
+
-webkit-flex-direction: row;
|
|
10
|
+
-ms-flex-direction: row;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
min-height: calc(100vh - var(--navbar-height));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.c1 {
|
|
16
|
+
-webkit-flex: 1 0 0;
|
|
17
|
+
-ms-flex: 1 0 0;
|
|
18
|
+
flex: 1 0 0;
|
|
19
|
+
width: 0;
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
class="c0"
|
|
25
|
+
data-component-name="Layout/PageLayout"
|
|
26
|
+
>
|
|
27
|
+
<div>
|
|
28
|
+
sidebar
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
class="c1"
|
|
32
|
+
>
|
|
33
|
+
<div>
|
|
34
|
+
test content
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`RootLayout renders 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class=""
|
|
6
|
+
data-component-name="Layout/RootLayout"
|
|
7
|
+
>
|
|
8
|
+
<div>
|
|
9
|
+
navbar
|
|
10
|
+
</div>
|
|
11
|
+
<div>
|
|
12
|
+
content
|
|
13
|
+
</div>
|
|
14
|
+
<div>
|
|
15
|
+
footer
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
`;
|
package/src/Layout/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
1
|
+
export * from '@theme/Layout/RootLayout';
|
|
2
|
+
export * from '@theme/Layout/PageLayout';
|
|
@@ -28,17 +28,17 @@ export function Admonition({
|
|
|
28
28
|
const Wrapper = styled.div<AdmonitionTypeProps>`
|
|
29
29
|
position: relative;
|
|
30
30
|
align-items: center;
|
|
31
|
-
margin: var(--
|
|
32
|
-
padding: var(--
|
|
33
|
-
padding-left: calc(var(--
|
|
34
|
-
border-radius: var(--
|
|
35
|
-
font-size: var(--
|
|
36
|
-
font-weight: var(--
|
|
37
|
-
line-height: var(--
|
|
31
|
+
margin: var(--admonition-margin-vertical) var(--admonition-margin-horizontal);
|
|
32
|
+
padding: var(--admonition-padding-vertical) var(--admonition-padding-horizontal);
|
|
33
|
+
padding-left: calc(var(--admonition-padding-horizontal) * 2 + var(--admonition-icon-size));
|
|
34
|
+
border-radius: var(--admonition-border-radius);
|
|
35
|
+
font-size: var(--admonition-font-size);
|
|
36
|
+
font-weight: var(--admonition-font-weight);
|
|
37
|
+
line-height: var(--admonition-line-height);
|
|
38
38
|
|
|
39
39
|
${({ type }) => `
|
|
40
|
-
background-color: var(--
|
|
41
|
-
color: var(--
|
|
40
|
+
background-color: var(--admonition-${type}-background-color);
|
|
41
|
+
color: var(--admonition-${type}-text-color);
|
|
42
42
|
`}
|
|
43
43
|
`;
|
|
44
44
|
|
|
@@ -46,14 +46,14 @@ const Heading = styled.h5<AdmonitionTypeProps>`
|
|
|
46
46
|
display: block;
|
|
47
47
|
margin: 0 0 10px;
|
|
48
48
|
|
|
49
|
-
letter-spacing: var(--
|
|
50
|
-
color: ${({ type }) => `var(--
|
|
49
|
+
letter-spacing: var(--admonition-heading-letter-spacing);
|
|
50
|
+
color: ${({ type }) => `var(--admonition-${type}-text-color)`};
|
|
51
51
|
|
|
52
52
|
&& {
|
|
53
|
-
font-size: var(--
|
|
54
|
-
font-weight: var(--
|
|
55
|
-
line-height: var(--
|
|
56
|
-
transform: var(--
|
|
53
|
+
font-size: var(--admonition-heading-font-size);
|
|
54
|
+
font-weight: var(--admonition-heading-font-weight);
|
|
55
|
+
line-height: var(--admonition-line-height);
|
|
56
|
+
transform: var(--admonition-heading-transform);
|
|
57
57
|
}
|
|
58
58
|
`;
|
|
59
59
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
1
|
+
export * from '@theme/Markdown/CodeSample/CodeSample';
|
|
2
|
+
export * from '@theme/Markdown/CodeSample/styled';
|
|
3
|
+
export * from '@theme/Markdown/CodeSample/types';
|
package/src/Markdown/Heading.tsx
CHANGED
|
@@ -5,8 +5,8 @@ import { ContentWrapper } from '@theme/Markdown/ContentWrapper';
|
|
|
5
5
|
import { PageNavigation } from '@theme/PageNavigation/PageNavigation';
|
|
6
6
|
|
|
7
7
|
type MarkdownLayoutProps = {
|
|
8
|
-
tableOfContent: React.
|
|
9
|
-
markdownWrapper: React.
|
|
8
|
+
tableOfContent: React.ReactNode;
|
|
9
|
+
markdownWrapper: React.ReactNode;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export function MarkdownLayout({
|
|
@@ -18,7 +18,7 @@ export const baseTable = css`
|
|
|
18
18
|
table th,
|
|
19
19
|
table td {
|
|
20
20
|
padding: 12px;
|
|
21
|
-
border-bottom: 1px solid var(--
|
|
21
|
+
border-bottom: 1px solid var(--global-border-color);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
table th {
|
|
@@ -29,42 +29,42 @@ export const baseTable = css`
|
|
|
29
29
|
|
|
30
30
|
table tr th:first-child,
|
|
31
31
|
table tr td:first-child {
|
|
32
|
-
border-left: 1px solid var(--
|
|
32
|
+
border-left: 1px solid var(--global-border-color);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
table tr td:last-child,
|
|
36
36
|
table tr th:last-child {
|
|
37
|
-
border-right: 1px solid var(--
|
|
37
|
+
border-right: 1px solid var(--global-border-color);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
table thead td,
|
|
41
41
|
table thead th {
|
|
42
|
-
border-top: 1px solid var(--
|
|
42
|
+
border-top: 1px solid var(--global-border-color);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/* top-left border */
|
|
46
46
|
|
|
47
47
|
table thead tr:first-child th:first-child {
|
|
48
|
-
border-top-left-radius: var(--
|
|
48
|
+
border-top-left-radius: var(--panels-border-radius);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/* top-right border */
|
|
52
52
|
|
|
53
53
|
table thead tr:first-child th:last-child {
|
|
54
|
-
border-top-right-radius: var(--
|
|
55
|
-
border-top: 1px solid var(--
|
|
54
|
+
border-top-right-radius: var(--panels-border-radius);
|
|
55
|
+
border-top: 1px solid var(--global-border-color);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/* bottom-left border */
|
|
59
59
|
|
|
60
60
|
table tbody tr:last-child td:first-child {
|
|
61
|
-
border-bottom-left-radius: var(--
|
|
61
|
+
border-bottom-left-radius: var(--panels-border-radius);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/* bottom-right border */
|
|
65
65
|
|
|
66
66
|
table tbody tr:last-child td:last-child {
|
|
67
|
-
border-bottom-right-radius: var(--
|
|
67
|
+
border-bottom-right-radius: var(--panels-border-radius);
|
|
68
68
|
}
|
|
69
69
|
`;
|
|
70
70
|
|
|
@@ -114,21 +114,21 @@ export const StyledMarkdown = styled.main.attrs(() => ({
|
|
|
114
114
|
font-weight: var(--font-weight-regular);
|
|
115
115
|
padding: 0;
|
|
116
116
|
|
|
117
|
-
color: var(--color-
|
|
117
|
+
color: var(--color-content);
|
|
118
118
|
font-size: var(--font-size-base);
|
|
119
|
-
font-family: var(--font-family-
|
|
120
|
-
line-height: var(--line-height-
|
|
119
|
+
font-family: var(--font-family-base);
|
|
120
|
+
line-height: var(--line-height-base);
|
|
121
121
|
|
|
122
122
|
a:not([role='button']) {
|
|
123
|
-
text-decoration: var(--
|
|
124
|
-
color: var(--
|
|
123
|
+
text-decoration: var(--link-decoration);
|
|
124
|
+
color: var(--link-color);
|
|
125
125
|
|
|
126
126
|
&:visited {
|
|
127
|
-
color: var(--
|
|
127
|
+
color: var(--link-color);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
&:hover {
|
|
131
|
-
color: var(--
|
|
131
|
+
color: var(--link-color-hover);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -142,8 +142,8 @@ export const StyledMarkdown = styled.main.attrs(() => ({
|
|
|
142
142
|
h4,
|
|
143
143
|
h5,
|
|
144
144
|
h6 {
|
|
145
|
-
font-weight: var(--font-weight
|
|
146
|
-
font-family: var(--font-family
|
|
145
|
+
font-weight: var(--h-font-weight);
|
|
146
|
+
font-family: var(--h-font-family);
|
|
147
147
|
position: relative;
|
|
148
148
|
|
|
149
149
|
scroll-margin-top: 60px;
|
|
@@ -154,14 +154,14 @@ export const StyledMarkdown = styled.main.attrs(() => ({
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
hr {
|
|
157
|
-
border-top: 1px solid var(--
|
|
157
|
+
border-top: 1px solid var(--global-border-color);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
details {
|
|
161
161
|
margin: 1.125em 0;
|
|
162
162
|
|
|
163
163
|
summary {
|
|
164
|
-
color: var(--color-
|
|
164
|
+
color: var(--color-content);
|
|
165
165
|
font-weight: var(--font-weight-regular);
|
|
166
166
|
outline: 0;
|
|
167
167
|
padding: 0;
|
|
@@ -183,17 +183,17 @@ export const StyledMarkdown = styled.main.attrs(() => ({
|
|
|
183
183
|
.snippets-tabs-headers {
|
|
184
184
|
font-size: 0.9em;
|
|
185
185
|
|
|
186
|
-
font-family: var(--font-family
|
|
186
|
+
font-family: var(--h-font-family);
|
|
187
187
|
|
|
188
188
|
.tab-header {
|
|
189
189
|
text-align: center;
|
|
190
190
|
padding: 0.2em 0.5em;
|
|
191
191
|
display: inline-block;
|
|
192
192
|
cursor: pointer;
|
|
193
|
-
color: var(--color-
|
|
193
|
+
color: var(--color-content-secondary);
|
|
194
194
|
|
|
195
195
|
&.active {
|
|
196
|
-
color: var(--color
|
|
196
|
+
color: var(--h-color);
|
|
197
197
|
font-weight: var(--font-weight-bold);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
@@ -260,11 +260,11 @@ export const StyledMarkdown = styled.main.attrs(() => ({
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
code {
|
|
263
|
-
color: var(--code-color);
|
|
264
|
-
background-color: var(--code-background-color);
|
|
263
|
+
color: var(--inline-code-color);
|
|
264
|
+
background-color: var(--inline-code-background-color);
|
|
265
265
|
|
|
266
266
|
border-radius: 2px;
|
|
267
|
-
border: 1px solid var(--
|
|
267
|
+
border: 1px solid var(--global-border-color);
|
|
268
268
|
padding: 0.1em 0.25em 0.2em;
|
|
269
269
|
font-weight: var(--code-font-weight);
|
|
270
270
|
word-break: break-word;
|
|
@@ -275,7 +275,7 @@ export const StyledMarkdown = styled.main.attrs(() => ({
|
|
|
275
275
|
blockquote {
|
|
276
276
|
margin: var(--bloquote-margin-vertical) var(--bloquote-margin-horizontal);
|
|
277
277
|
padding: var(--bloquote-padding-vertical) var(--bloquote-padding-horizontal);
|
|
278
|
-
border-left: 4px solid var(--
|
|
278
|
+
border-left: 4px solid var(--global-border-color);
|
|
279
279
|
background-color: var(--bloquote-background-color);
|
|
280
280
|
|
|
281
281
|
${typography(typographyTokens.blockquote)};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
1
|
+
export * from '@theme/Markdown/Tabs/Tab';
|
|
2
|
+
export * from '@theme/Markdown/Tabs/Tabs';
|
package/src/Markdown/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
1
|
+
export * from '@theme/Markdown/CodeSample';
|
|
2
|
+
export * from '@theme/Markdown/Tabs';
|
|
3
|
+
export * from '@theme/Markdown/Admonition';
|
|
4
|
+
export * from '@theme/Markdown/ContentWrapper';
|
|
5
|
+
export * from '@theme/Markdown/Heading';
|
|
6
|
+
export * from '@theme/Markdown/MarkdownLayout';
|
|
7
|
+
export * from '@theme/Markdown/Mermaid';
|
|
8
|
+
export * from '@theme/Markdown/PageWrapper';
|
|
9
|
+
export * from '@theme/Markdown/StyledMarkdown';
|
|
@@ -4,10 +4,10 @@ import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
|
4
4
|
import { Navbar } from './Navbar';
|
|
5
5
|
import { NavbarMenu } from './NavbarMenu';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { NavbarLogo } from '@theme/NavbarLogo/NavbarLogo';
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
|
-
title: 'Navbar',
|
|
10
|
+
title: 'Components/Navbar',
|
|
11
11
|
component: Navbar,
|
|
12
12
|
} as ComponentMeta<typeof Navbar>;
|
|
13
13
|
|
|
@@ -15,7 +15,11 @@ const Template: ComponentStory<typeof Navbar> = (args) => <Navbar {...args}>Clic
|
|
|
15
15
|
|
|
16
16
|
export const Main = Template.bind({});
|
|
17
17
|
Main.args = {
|
|
18
|
-
logo:
|
|
18
|
+
logo: (
|
|
19
|
+
<NavbarLogo
|
|
20
|
+
logo={{ link: '/test/', image: 'https://picsum.photos/id/2/400/100', altText: 'test' }}
|
|
21
|
+
/>
|
|
22
|
+
),
|
|
19
23
|
menu: (
|
|
20
24
|
<NavbarMenu
|
|
21
25
|
menuItems={[
|
package/src/Navbar/Navbar.tsx
CHANGED
|
@@ -5,7 +5,6 @@ interface NavbarProps {
|
|
|
5
5
|
menu: React.ReactNode;
|
|
6
6
|
logo: React.ReactNode;
|
|
7
7
|
search: React.ReactNode;
|
|
8
|
-
theme: any;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export function Navbar({ menu, logo, search }: NavbarProps): JSX.Element {
|
|
@@ -22,7 +21,7 @@ export const NavbarContainer = styled.nav`
|
|
|
22
21
|
height: var(--navbar-height);
|
|
23
22
|
box-sizing: border-box;
|
|
24
23
|
display: flex;
|
|
25
|
-
color: var(--navbar-color
|
|
24
|
+
color: var(--navbar-text-color);
|
|
26
25
|
align-items: center;
|
|
27
26
|
justify-content: space-between;
|
|
28
27
|
flex-shrink: 0;
|
|
@@ -32,7 +31,7 @@ export const NavbarContainer = styled.nav`
|
|
|
32
31
|
top: 0;
|
|
33
32
|
z-index: 200;
|
|
34
33
|
padding: 10px var(--sidebar-margin-left);
|
|
35
|
-
background: var(--navbar-color
|
|
34
|
+
background: var(--navbar-background-color);
|
|
36
35
|
font-family: var(--h-font-family);
|
|
37
36
|
|
|
38
37
|
${({ theme }) => theme.mediaQueries.medium} {
|
|
@@ -79,7 +79,7 @@ const NavMenuItem = styled.li<{ active?: boolean }>`
|
|
|
79
79
|
|
|
80
80
|
const NavLink = styled(Link)`
|
|
81
81
|
color: ${({ active }) =>
|
|
82
|
-
active ? 'var(--navbar-item-active-text-color)' : 'var(--navbar-color
|
|
82
|
+
active ? 'var(--navbar-item-active-text-color)' : 'var(--navbar-text-color)'};
|
|
83
83
|
text-decoration: ${({ active }) =>
|
|
84
84
|
active ? 'var(--navbar-item-active-text-decoration)' : 'none'};
|
|
85
85
|
`;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { NavbarLogo } from '@theme/NavbarLogo/NavbarLogo';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/NavbarLogo',
|
|
8
|
+
component: NavbarLogo,
|
|
9
|
+
} as ComponentMeta<typeof NavbarLogo>;
|
|
10
|
+
|
|
11
|
+
const Template: ComponentStory<typeof NavbarLogo> = (args) => <NavbarLogo {...args} />;
|
|
12
|
+
|
|
13
|
+
export const Default = Template.bind({});
|
|
14
|
+
Default.args = {
|
|
15
|
+
logo: {
|
|
16
|
+
image: 'https://redocly.github.io/redoc/petstore-logo.png',
|
|
17
|
+
link: 'http://redocly.com/',
|
|
18
|
+
altText: 'Pet Store',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { Link } from '@portal/Link';
|
|
5
|
+
import { LogoConfig } from '@theme/types/portal';
|
|
6
|
+
|
|
7
|
+
export type NavbarLogoProps = { logo: Pick<LogoConfig, 'image' | 'link' | 'altText'> };
|
|
8
|
+
|
|
9
|
+
export function NavbarLogo({ logo }: NavbarLogoProps): JSX.Element | null {
|
|
10
|
+
if (!logo.image) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const img = (
|
|
14
|
+
<NavLogo src={logo.image} alt={logo.altText} data-component-name="NavbarLogo/NavbarLogo" />
|
|
15
|
+
);
|
|
16
|
+
return logo.link ? <Link to={logo.link}>{img}</Link> : img;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const NavLogo = styled.img`
|
|
20
|
+
max-width: var(--logo-max-width);
|
|
21
|
+
max-height: var(--logo-max-height);
|
|
22
|
+
height: var(--logo-height);
|
|
23
|
+
margin: var(--logo-margin);
|
|
24
|
+
`;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { renderWithTheme } from '../../../tests/utils';
|
|
4
|
+
|
|
5
|
+
import { NavbarLogo } from '@theme/NavbarLogo';
|
|
6
|
+
|
|
7
|
+
describe('NavbarLogo', () => {
|
|
8
|
+
it('renders', () => {
|
|
9
|
+
const { container } = renderWithTheme(
|
|
10
|
+
<NavbarLogo
|
|
11
|
+
logo={{
|
|
12
|
+
image: 'https://test.com/logo.png',
|
|
13
|
+
altText: 'Navbar Logo',
|
|
14
|
+
link: 'https://test.com/',
|
|
15
|
+
}}
|
|
16
|
+
/>,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('renders without link', () => {
|
|
23
|
+
const { container } = renderWithTheme(
|
|
24
|
+
<NavbarLogo
|
|
25
|
+
logo={{
|
|
26
|
+
image: 'https://test.com/logo.png',
|
|
27
|
+
altText: 'Navbar Logo',
|
|
28
|
+
}}
|
|
29
|
+
/>,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
expect(container.firstChild).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('renders nothing, if no image provided', () => {
|
|
36
|
+
const { container } = renderWithTheme(
|
|
37
|
+
<NavbarLogo
|
|
38
|
+
logo={{
|
|
39
|
+
altText: 'Navbar Logo',
|
|
40
|
+
link: 'https://test.com/',
|
|
41
|
+
}}
|
|
42
|
+
/>,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
expect(container.firstChild).toBeNull();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`NavbarLogo renders 1`] = `
|
|
4
|
+
.c0 {
|
|
5
|
+
max-width: var(--logo-max-width);
|
|
6
|
+
max-height: var(--logo-max-height);
|
|
7
|
+
height: var(--logo-height);
|
|
8
|
+
margin: var(--logo-margin);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
<a
|
|
12
|
+
href="https://test.com/"
|
|
13
|
+
to="https://test.com/"
|
|
14
|
+
>
|
|
15
|
+
<img
|
|
16
|
+
alt="Navbar Logo"
|
|
17
|
+
class="c0"
|
|
18
|
+
data-component-name="NavbarLogo/NavbarLogo"
|
|
19
|
+
src="https://test.com/logo.png"
|
|
20
|
+
/>
|
|
21
|
+
</a>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
exports[`NavbarLogo renders without link 1`] = `
|
|
25
|
+
.c0 {
|
|
26
|
+
max-width: var(--logo-max-width);
|
|
27
|
+
max-height: var(--logo-max-height);
|
|
28
|
+
height: var(--logo-height);
|
|
29
|
+
margin: var(--logo-margin);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
<img
|
|
33
|
+
alt="Navbar Logo"
|
|
34
|
+
class="c0"
|
|
35
|
+
data-component-name="NavbarLogo/NavbarLogo"
|
|
36
|
+
src="https://test.com/logo.png"
|
|
37
|
+
/>
|
|
38
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@theme/NavbarLogo/NavbarLogo';
|
|
@@ -4,7 +4,7 @@ import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
|
4
4
|
import { OperationBadge } from '@theme/OperationBadge';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title: 'OperationBadge',
|
|
7
|
+
title: 'Components/OperationBadge',
|
|
8
8
|
component: OperationBadge,
|
|
9
9
|
argTypes: {},
|
|
10
10
|
} as ComponentMeta<typeof OperationBadge>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '@theme/OperationBadge/OperationBadge';
|
package/src/Panel/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
1
|
+
export * from '@theme/Panel/CodePanel';
|
|
2
|
+
export * from '@theme/Panel/ContentPanel';
|
|
3
|
+
export * from '@theme/Panel/DarkHeader';
|
|
4
|
+
export * from '@theme/Panel/Panel';
|
|
5
|
+
export * from '@theme/Panel/PanelBody';
|
|
6
|
+
export * from '@theme/Panel/PanelComponent';
|
|
7
|
+
export * from '@theme/Panel/PanelHeader';
|
|
8
|
+
export * from '@theme/Panel/PanelHeaderTitle';
|
|
@@ -4,7 +4,7 @@ import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
|
4
4
|
import { SampleControls, SamplesControlButton } from '@theme/SamplesPanelControls';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title: 'Samples Control Button',
|
|
7
|
+
title: 'Components/Samples Control Button',
|
|
8
8
|
component: SamplesControlButton,
|
|
9
9
|
} as ComponentMeta<typeof SamplesControlButton>;
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '@theme/SamplesPanelControls/SamplesPanelControls';
|
|
@@ -38,7 +38,7 @@ export function Parameters({ parameters = [] }: ParametersProps): JSX.Element {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const Wrapper = styled.div`
|
|
41
|
-
border-left: 1px solid var(--
|
|
41
|
+
border-left: 1px solid var(--global-border-color);
|
|
42
42
|
padding: 0 12px;
|
|
43
43
|
margin-top: 8px;
|
|
44
44
|
margin-bottom: 4px;
|
|
@@ -57,6 +57,6 @@ const Place = styled.div`
|
|
|
57
57
|
|
|
58
58
|
const MoreText = styled.div`
|
|
59
59
|
font-size: var(--font-size-small);
|
|
60
|
-
font-weight: var(--font-weight-
|
|
60
|
+
font-weight: var(--font-weight-regular);
|
|
61
61
|
padding-top: 4px;
|
|
62
62
|
`;
|
|
@@ -56,7 +56,7 @@ const SearchLink = styled(Link)`
|
|
|
56
56
|
`;
|
|
57
57
|
|
|
58
58
|
const Operation = styled.div`
|
|
59
|
-
font-weight: var(--font-weight-
|
|
59
|
+
font-weight: var(--font-weight-regular);
|
|
60
60
|
font-size: var(--font-size-small);
|
|
61
61
|
color: var(--search-item-title-text-color);
|
|
62
62
|
overflow: hidden;
|
|
@@ -68,7 +68,7 @@ const Title = styled.div`
|
|
|
68
68
|
color: var(--search-item-title-text-color);
|
|
69
69
|
overflow: hidden;
|
|
70
70
|
text-overflow: ellipsis;
|
|
71
|
-
line-height: var(--line-height-
|
|
71
|
+
line-height: var(--line-height-base);
|
|
72
72
|
`;
|
|
73
73
|
|
|
74
74
|
const Description = styled.div`
|
package/src/Search/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
1
|
+
export * from '@theme/Search/Autocomplete';
|
|
2
|
+
export * from '@theme/Search/ClearIcon';
|
|
3
|
+
export * from '@theme/Search/Input';
|
|
4
|
+
export * from '@theme/Search/Parameters';
|
|
5
|
+
export * from '@theme/Search/Popover';
|
|
6
|
+
export * from '@theme/Search/Search';
|
|
7
|
+
export * from '@theme/Search/SearchIcon';
|
|
8
|
+
export * from '@theme/Search/SearchItem';
|
|
9
|
+
export * from '@theme/Search/utils';
|
package/src/Search/utils.tsx
CHANGED