@redocly/theme 0.2.3 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Button/Button.js +3 -3
- package/CodeBlock/CodeBlock.js +1 -1
- package/ColorModeSwitcher/ColorModeSwitcher.js +4 -3
- package/CopyButton/CopyButtonWrapper.d.ts +2 -1
- package/CopyButton/CopyButtonWrapper.js +3 -2
- package/Footer/Footer.js +1 -1
- package/Footer/FooterColumn.js +4 -4
- package/Footer/FooterColumns.js +1 -1
- package/Footer/FooterCopyright.js +1 -1
- package/JsonViewer/JsonViewer.js +1 -1
- package/Markdown/Admonition.js +3 -3
- package/Markdown/CodeSample/CodeSample.js +3 -3
- package/Markdown/ContainerWrapper.d.ts +5 -0
- package/Markdown/ContainerWrapper.js +21 -0
- package/Markdown/Details.d.ts +6 -0
- package/Markdown/Details.js +22 -0
- package/Markdown/MarkdownLayout.d.ts +3 -1
- package/Markdown/MarkdownLayout.js +4 -4
- package/Markdown/MarkdownWrapper.js +3 -3
- package/Markdown/index.d.ts +1 -1
- package/Markdown/index.js +1 -1
- package/Navbar/MobileNavbarItem.js +1 -1
- package/Navbar/MobileNavbarMenu.js +6 -6
- package/Navbar/Navbar.d.ts +1 -0
- package/Navbar/Navbar.js +10 -8
- package/Navbar/NavbarDropdown.js +1 -1
- package/Navbar/NavbarItem.d.ts +3 -3
- package/Navbar/NavbarItem.js +17 -14
- package/Navbar/NavbarMenu.js +2 -2
- package/NavbarLogo/NavbarLogo.js +1 -1
- package/OperationBadge/OperationBadge.js +1 -1
- package/PageNavigation/PageNavigation.d.ts +6 -1
- package/PageNavigation/PageNavigation.js +4 -3
- package/Panel/Panel.d.ts +2 -1
- package/Panel/Panel.js +8 -3
- package/Panel/PanelBody.js +1 -1
- package/Panel/PanelComponent.d.ts +3 -2
- package/Panel/PanelComponent.js +3 -2
- package/Panel/PanelHeader.d.ts +1 -1
- package/Panel/PanelHeader.js +3 -3
- package/Panel/PanelHeaderTitle.js +1 -1
- package/Panel/index.d.ts +0 -3
- package/Panel/index.js +0 -3
- package/Profile/Profile.js +1 -1
- package/SamplesPanelControls/SamplesPanelControls.js +6 -4
- package/Search/Autocomplete.js +1 -1
- package/Search/Input.js +1 -1
- package/Search/Parameters.js +1 -1
- package/Search/Popover.js +1 -1
- package/Search/Search.js +1 -1
- package/Search/SearchItem.js +3 -3
- package/Search/utils.js +1 -1
- package/Sidebar/ApiCallItem.js +1 -1
- package/Sidebar/ArrowBack.js +1 -1
- package/Sidebar/BackButton.js +1 -1
- package/Sidebar/Drilldown.js +1 -1
- package/Sidebar/DrilldownMenu.js +2 -2
- package/Sidebar/DrilldownMenuItem.js +3 -3
- package/Sidebar/ExternalIcon.js +1 -1
- package/Sidebar/Menu.js +1 -1
- package/Sidebar/MenuContainer.js +1 -1
- package/Sidebar/MenuGroup.js +6 -2
- package/Sidebar/MenuItemLabel.js +1 -1
- package/Sidebar/MenuLink.js +1 -1
- package/Sidebar/SeparatorItem.js +1 -1
- package/Sidebar/SeparatorLine.js +1 -1
- package/Sidebar/Sidebar.js +1 -1
- package/SidebarLogo/SidebarLogo.js +1 -1
- package/SourceCode/SourceCode.js +5 -5
- package/TableOfContent/TableOfContent.js +5 -5
- package/Tooltip/Tooltip.js +1 -1
- package/Typography/H1.js +1 -1
- package/Typography/H2.js +1 -1
- package/Typography/H3.js +1 -1
- package/Typography/SectionHeader.js +1 -1
- package/Typography/Typography.js +1 -1
- package/globalStyle.d.ts +0 -1
- package/globalStyle.js +29 -28
- package/hooks/useActiveHeading.js +6 -5
- package/icons/ArrowIcon/ArrowIcon.js +1 -1
- package/package.json +1 -1
- package/src/Button/Button.tsx +14 -6
- package/src/CodeBlock/CodeBlock.ts +2 -4
- package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +5 -4
- package/src/CopyButton/CopyButtonWrapper.tsx +6 -3
- package/src/Footer/Footer.tsx +3 -2
- package/src/Footer/FooterColumn.tsx +13 -9
- package/src/Footer/FooterColumns.tsx +2 -2
- package/src/Footer/FooterCopyright.tsx +1 -1
- package/src/JsonViewer/JsonViewer.tsx +5 -5
- package/src/Markdown/Admonition.tsx +3 -2
- package/src/Markdown/CodeSample/CodeSample.tsx +18 -17
- package/src/Markdown/{ContentWrapper.tsx → ContainerWrapper.tsx} +4 -4
- package/src/Markdown/Details.tsx +19 -0
- package/src/Markdown/MarkdownLayout.tsx +8 -4
- package/src/Markdown/MarkdownWrapper.tsx +87 -47
- package/src/Markdown/index.ts +1 -1
- package/src/Navbar/MobileNavbarItem.tsx +1 -3
- package/src/Navbar/MobileNavbarMenu.tsx +19 -17
- package/src/Navbar/Navbar.tsx +19 -10
- package/src/Navbar/NavbarDropdown.tsx +2 -1
- package/src/Navbar/NavbarItem.tsx +41 -24
- package/src/Navbar/NavbarMenu.tsx +3 -3
- package/src/NavbarLogo/NavbarLogo.tsx +4 -4
- package/src/OperationBadge/OperationBadge.ts +8 -9
- package/src/PageNavigation/PageNavigation.tsx +11 -3
- package/src/Panel/Panel.ts +17 -3
- package/src/Panel/PanelBody.ts +13 -5
- package/src/Panel/PanelComponent.tsx +3 -0
- package/src/Panel/PanelHeader.ts +13 -6
- package/src/Panel/PanelHeaderTitle.ts +6 -4
- package/src/Panel/index.ts +0 -3
- package/src/Profile/Profile.tsx +1 -1
- package/src/SamplesPanelControls/SamplesPanelControls.ts +9 -9
- package/src/Search/Autocomplete.tsx +1 -1
- package/src/Search/Input.tsx +7 -2
- package/src/Search/Parameters.tsx +1 -1
- package/src/Search/Popover.tsx +3 -3
- package/src/Search/Search.tsx +3 -1
- package/src/Search/SearchItem.tsx +14 -9
- package/src/Search/utils.tsx +1 -1
- package/src/Sidebar/ApiCallItem.tsx +7 -0
- package/src/Sidebar/ArrowBack.tsx +1 -1
- package/src/Sidebar/BackButton.tsx +10 -5
- package/src/Sidebar/Drilldown.tsx +1 -3
- package/src/Sidebar/DrilldownMenu.tsx +2 -2
- package/src/Sidebar/DrilldownMenuItem.tsx +12 -8
- 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 +12 -2
- package/src/Sidebar/MenuItemLabel.tsx +7 -7
- package/src/Sidebar/MenuLink.tsx +1 -1
- package/src/Sidebar/SeparatorItem.tsx +5 -1
- package/src/Sidebar/SeparatorLine.tsx +2 -2
- package/src/Sidebar/Sidebar.tsx +4 -4
- package/src/SidebarLogo/SidebarLogo.tsx +3 -3
- package/src/SourceCode/SourceCode.tsx +4 -4
- package/src/TableOfContent/TableOfContent.tsx +18 -16
- package/src/Tooltip/Tooltip.tsx +2 -2
- package/src/Typography/H1.ts +2 -2
- package/src/Typography/H2.ts +2 -2
- package/src/Typography/H3.ts +2 -1
- package/src/Typography/SectionHeader.ts +4 -4
- package/src/Typography/Typography.ts +1 -1
- package/src/globalStyle.ts +1358 -344
- package/src/hooks/useActiveHeading.ts +41 -34
- package/src/icons/ArrowIcon/ArrowIcon.tsx +3 -3
- package/src/ui/Background.tsx +1 -1
- package/src/ui/Dropdown.tsx +6 -6
- package/src/ui/Jumbotron.tsx +1 -1
- package/src/ui/Tiles/TileHeader.ts +5 -5
- package/src/ui/Tiles/TileText.tsx +1 -1
- package/src/ui/UniversalLink.tsx +1 -1
- package/src/utils/theme-helpers.ts +1 -1
- package/ui/Background.js +1 -1
- package/ui/Dropdown.js +4 -4
- package/ui/Jumbotron.js +1 -1
- package/ui/Tiles/TileHeader.js +1 -1
- package/ui/Tiles/TileText.js +1 -1
- package/ui/UniversalLink.js +1 -1
- package/utils/theme-helpers.js +1 -1
- package/Markdown/ContentWrapper.d.ts +0 -5
- package/Markdown/ContentWrapper.js +0 -21
- package/Panel/CodePanel.d.ts +0 -5
- package/Panel/CodePanel.js +0 -21
- package/Panel/ContentPanel.d.ts +0 -5
- package/Panel/ContentPanel.js +0 -20
- package/Panel/DarkHeader.d.ts +0 -1
- package/Panel/DarkHeader.js +0 -10
- package/src/Panel/CodePanel.ts +0 -34
- package/src/Panel/ContentPanel.ts +0 -44
- package/src/Panel/DarkHeader.ts +0 -8
|
@@ -10,60 +10,65 @@ export const baseTable = css`
|
|
|
10
10
|
word-break: keep-all;
|
|
11
11
|
border-collapse: separate;
|
|
12
12
|
border-spacing: 0;
|
|
13
|
-
margin-top:
|
|
14
|
-
margin-bottom:
|
|
15
|
-
font-size:
|
|
13
|
+
margin-top: var(--md-table-margin-vertical);
|
|
14
|
+
margin-bottom: var(--md-table-margin-vertical);
|
|
15
|
+
font-size: var(--md-table-font-size);
|
|
16
16
|
|
|
17
17
|
th,
|
|
18
18
|
td {
|
|
19
|
-
padding:
|
|
20
|
-
border-bottom: 1px solid var(--
|
|
19
|
+
padding: var(--md-table-cell-padding);
|
|
20
|
+
border-bottom: 1px solid var(--md-table-border-color);
|
|
21
|
+
color: var(--md-table-cell-text-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
tr {
|
|
25
|
+
background-color: var(--md-table-stripe-background-color);
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
th {
|
|
24
29
|
text-align: left;
|
|
25
|
-
font-weight:
|
|
26
|
-
|
|
30
|
+
font-weight: var(--md-table-head-font-weight);
|
|
31
|
+
color: var(--md-table-head-text-color);
|
|
32
|
+
background-color: var(--md-table-head-background-color);
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
tr th:first-child,
|
|
30
36
|
tr td:first-child {
|
|
31
|
-
border-left: 1px solid var(--
|
|
37
|
+
border-left: 1px solid var(--md-table-border-color);
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
tr td:last-child,
|
|
35
41
|
tr th:last-child {
|
|
36
|
-
border-right: 1px solid var(--
|
|
42
|
+
border-right: 1px solid var(--md-table-border-color);
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
thead td,
|
|
40
46
|
thead th {
|
|
41
|
-
border-top: 1px solid var(--
|
|
47
|
+
border-top: 1px solid var(--md-table-border-color);
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
/* top-left border */
|
|
45
51
|
|
|
46
52
|
thead tr:first-child th:first-child {
|
|
47
|
-
border-top-left-radius: var(--
|
|
53
|
+
border-top-left-radius: var(--md-table-border-radius);
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
/* top-right border */
|
|
51
57
|
|
|
52
58
|
thead tr:first-child th:last-child {
|
|
53
|
-
border-top-right-radius: var(--
|
|
54
|
-
border-top: 1px solid var(--global-border-color);
|
|
59
|
+
border-top-right-radius: var(--md-table-border-radius);
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
/* bottom-left border */
|
|
58
63
|
|
|
59
64
|
tbody tr:last-child td:first-child {
|
|
60
|
-
border-bottom-left-radius: var(--
|
|
65
|
+
border-bottom-left-radius: var(--md-table-border-radius);
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
/* bottom-right border */
|
|
64
69
|
|
|
65
70
|
tbody tr:last-child td:last-child {
|
|
66
|
-
border-bottom-right-radius: var(--
|
|
71
|
+
border-bottom-right-radius: var(--md-table-border-radius);
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
`;
|
|
@@ -75,7 +80,7 @@ export function headingAnchor(className = 'anchor'): FlattenSimpleInterpolation
|
|
|
75
80
|
position: absolute;
|
|
76
81
|
left: 0;
|
|
77
82
|
transform: translateX(-100%);
|
|
78
|
-
padding-right:
|
|
83
|
+
padding-right: var(--heading-anchor-offset-right);
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
.${className}.after {
|
|
@@ -85,6 +90,7 @@ export function headingAnchor(className = 'anchor'): FlattenSimpleInterpolation
|
|
|
85
90
|
|
|
86
91
|
svg,
|
|
87
92
|
.${className} svg {
|
|
93
|
+
fill: var(--heading-anchor-color);
|
|
88
94
|
visibility: hidden;
|
|
89
95
|
}
|
|
90
96
|
|
|
@@ -101,21 +107,29 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
101
107
|
font-weight: var(--font-weight-regular);
|
|
102
108
|
padding: 0;
|
|
103
109
|
|
|
104
|
-
color: var(--color
|
|
110
|
+
color: var(--text-color);
|
|
105
111
|
font-size: var(--font-size-base);
|
|
106
112
|
font-family: var(--font-family-base);
|
|
107
113
|
line-height: var(--line-height-base);
|
|
108
114
|
|
|
109
115
|
a:not([role='button']) {
|
|
110
116
|
text-decoration: var(--link-decoration);
|
|
111
|
-
color: var(--link-color);
|
|
117
|
+
color: var(--link-text-color);
|
|
118
|
+
font-weight: var(--link-font-weight);
|
|
112
119
|
|
|
113
120
|
&:visited {
|
|
114
|
-
color: var(--link-color);
|
|
121
|
+
color: var(--link-visited-text-color);
|
|
122
|
+
text-decoration: var(--link-visited-decoration);
|
|
115
123
|
}
|
|
116
124
|
|
|
117
125
|
&:hover {
|
|
118
|
-
|
|
126
|
+
text-decoration: var(--link-hover-decoration);
|
|
127
|
+
color: var(--link-hover-text-color);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:focus {
|
|
131
|
+
color: var(--link-active-text-color);
|
|
132
|
+
text-decoration: var(--link-active-decoration);
|
|
119
133
|
}
|
|
120
134
|
}
|
|
121
135
|
|
|
@@ -129,8 +143,8 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
129
143
|
h4.md,
|
|
130
144
|
h5.md,
|
|
131
145
|
h6.md {
|
|
132
|
-
font-weight: var(--
|
|
133
|
-
font-family: var(--
|
|
146
|
+
font-weight: var(--heading-font-weight);
|
|
147
|
+
font-family: var(--heading-font-family);
|
|
134
148
|
position: relative;
|
|
135
149
|
|
|
136
150
|
scroll-margin-top: 60px;
|
|
@@ -141,14 +155,17 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
141
155
|
}
|
|
142
156
|
|
|
143
157
|
hr {
|
|
144
|
-
border-top: 1px solid var(--
|
|
158
|
+
border-top: 1px solid var(--md-hr-border-color);
|
|
159
|
+
background-color: var(--md-hr-background-color);
|
|
160
|
+
height: var(--md-hr-height);
|
|
161
|
+
margin: var(--md-hr-margin-vertical) 0;
|
|
145
162
|
}
|
|
146
163
|
|
|
147
164
|
details {
|
|
148
165
|
margin: 1.125em 0;
|
|
149
166
|
|
|
150
167
|
summary {
|
|
151
|
-
color: var(--color
|
|
168
|
+
color: var(--text-color);
|
|
152
169
|
font-weight: var(--font-weight-regular);
|
|
153
170
|
outline: 0;
|
|
154
171
|
padding: 0;
|
|
@@ -170,17 +187,17 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
170
187
|
.snippets-tabs-headers {
|
|
171
188
|
font-size: 0.9em;
|
|
172
189
|
|
|
173
|
-
font-family: var(--
|
|
190
|
+
font-family: var(--heading-font-family);
|
|
174
191
|
|
|
175
192
|
.tab-header {
|
|
176
193
|
text-align: center;
|
|
177
194
|
padding: 0.2em 0.5em;
|
|
178
195
|
display: inline-block;
|
|
179
196
|
cursor: pointer;
|
|
180
|
-
color: var(--color-
|
|
197
|
+
color: var(--text-color-secondary);
|
|
181
198
|
|
|
182
199
|
&.active {
|
|
183
|
-
color: var(--
|
|
200
|
+
color: var(--heading-text-color);
|
|
184
201
|
font-weight: var(--font-weight-bold);
|
|
185
202
|
}
|
|
186
203
|
}
|
|
@@ -201,6 +218,8 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
201
218
|
}
|
|
202
219
|
|
|
203
220
|
p {
|
|
221
|
+
margin: var(--md-paragraph-margin-vertical) var(--md-paragraph-margin-horizontal);
|
|
222
|
+
|
|
204
223
|
&:last-child {
|
|
205
224
|
margin-bottom: 0;
|
|
206
225
|
}
|
|
@@ -271,24 +290,25 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
271
290
|
}
|
|
272
291
|
|
|
273
292
|
code {
|
|
274
|
-
color: var(--inline-code-color);
|
|
293
|
+
color: var(--inline-code-text-color);
|
|
275
294
|
background-color: var(--inline-code-background-color);
|
|
276
295
|
|
|
277
|
-
border-radius:
|
|
278
|
-
border: 1px solid var(--
|
|
296
|
+
border-radius: var(--inline-code-border-radius);
|
|
297
|
+
border: 1px solid var(--inline-code-border-color);
|
|
279
298
|
padding: 0.1em 0.25em 0.2em;
|
|
280
299
|
font-weight: var(--code-font-weight);
|
|
281
300
|
word-break: break-word;
|
|
282
|
-
font-size: var(--code-font-size);
|
|
301
|
+
font-size: var(--inline-code-font-size);
|
|
283
302
|
font-family: var(--code-font-family);
|
|
284
303
|
}
|
|
285
304
|
|
|
286
305
|
blockquote {
|
|
287
|
-
margin: var(--
|
|
288
|
-
padding: var(--
|
|
289
|
-
border-left:
|
|
290
|
-
background-color: var(--
|
|
291
|
-
color: var(--color
|
|
306
|
+
margin: var(--md-blockquote-margin-vertical) var(--md-blockquote-margin-horizontal);
|
|
307
|
+
padding: var(--md-blockquote-padding-vertical) var(--md-blockquote-padding-horizontal);
|
|
308
|
+
border-left: var(--md-blockquote-border-left);
|
|
309
|
+
background-color: var(--md-blockquote-background-color);
|
|
310
|
+
color: var(--md-blockquote-text-color);
|
|
311
|
+
box-shadow: var(--md-blockquote-box-shadow);
|
|
292
312
|
|
|
293
313
|
& > p:first-child {
|
|
294
314
|
margin-top: 0;
|
|
@@ -305,18 +325,38 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
305
325
|
}
|
|
306
326
|
}
|
|
307
327
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
padding-left: 2em;
|
|
313
|
-
margin: 0 0 1em;
|
|
328
|
+
ul,
|
|
329
|
+
ol {
|
|
330
|
+
padding-left: var(--md-list-left-padding);
|
|
331
|
+
margin: 0 0 var(--md-list-margin);
|
|
314
332
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
333
|
+
ul,
|
|
334
|
+
ol {
|
|
335
|
+
margin-bottom: 0;
|
|
336
|
+
margin-top: 0;
|
|
320
337
|
}
|
|
321
338
|
}
|
|
339
|
+
|
|
340
|
+
li {
|
|
341
|
+
margin: var(--md-list-item-margin);
|
|
342
|
+
list-style: var(--md-list-item-style);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
ol > li {
|
|
346
|
+
list-style: var(--md-numbered-list-item-style);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
ol > li:before {
|
|
350
|
+
content: counter(list-item);
|
|
351
|
+
display: var(--md-numbered-list-number-display);
|
|
352
|
+
color: var(--md-numbered-list-number-text-color);
|
|
353
|
+
font-size: var(--md-numbered-list-number-font-size);
|
|
354
|
+
font-family: var(--md-numbered-list-number-font-family);
|
|
355
|
+
font-weight: var(--md-numbered-list-number-font-weight);
|
|
356
|
+
background-color: var(--md-numbered-list-number-background-color);
|
|
357
|
+
border-radius: var(--md-numbered-list-number-border-radius);
|
|
358
|
+
border: var(--md-numbered-list-number-border);
|
|
359
|
+
margin-right: var(--md-numbered-list-number-margin-right);
|
|
360
|
+
padding: var(--md-numbered-list-number-padding);
|
|
361
|
+
}
|
|
322
362
|
`;
|
package/src/Markdown/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@theme/Markdown/Admonition';
|
|
2
2
|
export * from '@theme/Markdown/CodeSample';
|
|
3
|
-
export * from '@theme/Markdown/
|
|
3
|
+
export * from '@theme/Markdown/ContainerWrapper';
|
|
4
4
|
export * from '@theme/Markdown/Heading';
|
|
5
5
|
export * from '@theme/Markdown/MarkdownLayout';
|
|
6
6
|
export * from '@theme/Markdown/MarkdownWrapper';
|
|
@@ -72,12 +72,10 @@ export const NavMenuItem = styled.li<{ active?: boolean }>`
|
|
|
72
72
|
display: flex;
|
|
73
73
|
justify-content: space-between;
|
|
74
74
|
align-items: center;
|
|
75
|
-
padding:
|
|
75
|
+
padding: var(--navbar-item-padding-horizontal);
|
|
76
76
|
text-align: left;
|
|
77
77
|
line-height: 1;
|
|
78
78
|
font-size: var(--navbar-item-font-size);
|
|
79
|
-
margin-left: var(--navbar-item-margin-horizontal);
|
|
80
|
-
margin-right: var(--navbar-item-margin-horizontal);
|
|
81
79
|
font-weight: var(--navbar-item-font-weight);
|
|
82
80
|
background: ${({ active }) => (active ? 'var(--navbar-item-active-background-color)' : 'none')};
|
|
83
81
|
&:not(:last-child) {
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { ResolvedConfigLinks, ResolvedNavItem } from '@theme/types/portal';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { NavbarMenuItem, NavbarMenuItemWithDropdownWrapper } from '@theme/Navbar/NavbarItem';
|
|
7
7
|
import { MobileNavbarItem } from '@theme/Navbar/MobileNavbarItem';
|
|
8
8
|
import { DropdownWrapper } from '@theme/Navbar/NavbarDropdown';
|
|
9
9
|
import { isPrimitive, isEmptyArray } from '@theme/utils';
|
|
@@ -20,8 +20,8 @@ export function MobileNavbarMenu({
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<
|
|
24
|
-
<
|
|
23
|
+
<NavbarItemsWrapper data-component-name="Navbar/MobileNavbarMenu">
|
|
24
|
+
<NavbarItemsContainer>
|
|
25
25
|
{(menuItems as ResolvedNavItem[]).map((navItem, index) => {
|
|
26
26
|
return (
|
|
27
27
|
<MobileNavbarItem
|
|
@@ -31,13 +31,13 @@ export function MobileNavbarMenu({
|
|
|
31
31
|
/>
|
|
32
32
|
);
|
|
33
33
|
})}
|
|
34
|
-
</
|
|
35
|
-
<
|
|
36
|
-
</
|
|
34
|
+
</NavbarItemsContainer>
|
|
35
|
+
<NavbarItemsClosableArea onClick={closeMenu} />
|
|
36
|
+
</NavbarItemsWrapper>
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const
|
|
40
|
+
const NavbarItemsWrapper = styled.div`
|
|
41
41
|
height: 100%;
|
|
42
42
|
width: 100%;
|
|
43
43
|
position: fixed;
|
|
@@ -63,7 +63,7 @@ const NavItemsWrapper = styled.div`
|
|
|
63
63
|
}
|
|
64
64
|
`;
|
|
65
65
|
|
|
66
|
-
const
|
|
66
|
+
const NavbarItemsClosableArea = styled.div`
|
|
67
67
|
display: flex;
|
|
68
68
|
flex: 1;
|
|
69
69
|
min-width: 50px;
|
|
@@ -71,7 +71,7 @@ const NavItemsClosableArea = styled.div`
|
|
|
71
71
|
background-color: rgba(255, 255, 255, 0.4);
|
|
72
72
|
`;
|
|
73
73
|
|
|
74
|
-
const
|
|
74
|
+
const NavbarItemsContainer = styled.ul`
|
|
75
75
|
width: 70%;
|
|
76
76
|
list-style: none;
|
|
77
77
|
margin: 0;
|
|
@@ -80,26 +80,28 @@ const NavItemsContainer = styled.ul`
|
|
|
80
80
|
flex-direction: column;
|
|
81
81
|
background: var(--navbar-background-color);
|
|
82
82
|
|
|
83
|
-
${
|
|
84
|
-
&:not(:last-child){
|
|
83
|
+
${NavbarMenuItem} {
|
|
84
|
+
&:not(:last-child) {
|
|
85
85
|
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
86
86
|
}
|
|
87
87
|
border-radius: 0;
|
|
88
88
|
padding: 1em 0;
|
|
89
|
-
width: 100%;
|
|
89
|
+
width: 100%;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
${
|
|
91
|
+
|
|
92
|
+
${NavbarMenuItemWithDropdownWrapper} {
|
|
93
93
|
display: block;
|
|
94
|
-
&:not(:last-child){
|
|
94
|
+
&:not(:last-child) {
|
|
95
95
|
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
96
96
|
border-radius: 0;
|
|
97
97
|
}
|
|
98
|
-
${
|
|
98
|
+
${NavbarMenuItem} {
|
|
99
99
|
border-bottom: none;
|
|
100
100
|
}
|
|
101
|
+
}
|
|
102
|
+
|
|
101
103
|
${DropdownWrapper} {
|
|
102
|
-
background-color: var(--navbar-background-color);
|
|
104
|
+
background-color: var(--navbar-background-color);
|
|
103
105
|
width: 100%;
|
|
104
106
|
padding: 0;
|
|
105
107
|
position: relative;
|
package/src/Navbar/Navbar.tsx
CHANGED
|
@@ -34,11 +34,13 @@ export function Navbar({ menu, logo, search, profile }: NavbarProps): JSX.Elemen
|
|
|
34
34
|
<NavbarContainer data-component-name="Navbar/Navbar">
|
|
35
35
|
<MobileNavbarMenuButton onClick={openMobileMenu} />
|
|
36
36
|
{isOpen && <MobileNavbarMenu closeMenu={closeMobileMenu} menuItems={menu} />}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
<NavbarRow>
|
|
38
|
+
{logo}
|
|
39
|
+
<NavbarMenu menuItems={menu} />
|
|
40
|
+
{hideSearch ? null : search}
|
|
41
|
+
{profile}
|
|
42
|
+
<ColorModeSwitcher />
|
|
43
|
+
</NavbarRow>
|
|
42
44
|
</NavbarContainer>
|
|
43
45
|
);
|
|
44
46
|
}
|
|
@@ -47,21 +49,18 @@ export const NavbarContainer = styled.nav`
|
|
|
47
49
|
height: var(--navbar-height);
|
|
48
50
|
box-sizing: border-box;
|
|
49
51
|
display: flex;
|
|
50
|
-
color: var(--navbar-text-color);
|
|
51
52
|
align-items: center;
|
|
52
|
-
justify-content: space-between;
|
|
53
53
|
flex-shrink: 0;
|
|
54
54
|
|
|
55
55
|
font-size: 0.875rem;
|
|
56
56
|
position: sticky;
|
|
57
57
|
top: 0;
|
|
58
58
|
z-index: 200;
|
|
59
|
-
padding:
|
|
59
|
+
padding: var(--navbar-item-paddin-vertical) var(--navbar-item-padding-horizontal);
|
|
60
60
|
background: var(--navbar-background-color);
|
|
61
|
-
font-family: var(--
|
|
61
|
+
font-family: var(--navbar-item-font-family);
|
|
62
62
|
|
|
63
63
|
${({ theme }) => theme.mediaQueries.medium} {
|
|
64
|
-
padding: 10px var(--sidebar-margin-left);
|
|
65
64
|
font-size: 1rem;
|
|
66
65
|
}
|
|
67
66
|
|
|
@@ -77,3 +76,13 @@ export const NavbarContainer = styled.nav`
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
`;
|
|
79
|
+
|
|
80
|
+
export const NavbarRow = styled.div`
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
margin: 0 auto;
|
|
85
|
+
width: 100%;
|
|
86
|
+
|
|
87
|
+
max-width: var(--navbar-container-max-width);
|
|
88
|
+
`;
|
|
@@ -24,7 +24,8 @@ export function NavbarDropdown({ items }: NavbarDropdownProps): JSX.Element {
|
|
|
24
24
|
export const DropdownWrapper = styled.div`
|
|
25
25
|
display: none;
|
|
26
26
|
position: absolute;
|
|
27
|
-
background: var(--navbar-
|
|
27
|
+
background: var(--navbar-dropdown-background);
|
|
28
|
+
border: var(--navbar-item-border);
|
|
28
29
|
border-radius: var(--navbar-item-border-radius);
|
|
29
30
|
padding: 10px 15px;
|
|
30
31
|
width: max-content;
|
|
@@ -24,30 +24,38 @@ export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element
|
|
|
24
24
|
const item = navItem as ResolvedNavLinkItem;
|
|
25
25
|
const isActive = pathname === withPathPrefix(item.link);
|
|
26
26
|
return (
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
<NavbarMenuItem
|
|
28
|
+
active={isActive}
|
|
29
|
+
data-component-name="Navbar/NavbarItem"
|
|
30
|
+
className={className}
|
|
31
|
+
>
|
|
32
|
+
<NavbarLink to={item.link} active={isActive}>
|
|
33
|
+
<NavbarLabel>{item.label}</NavbarLabel>
|
|
34
|
+
</NavbarLink>
|
|
35
|
+
</NavbarMenuItem>
|
|
32
36
|
);
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
if ((navItem as ResolvedNavGroupItem).items) {
|
|
36
40
|
const item = navItem as ResolvedNavGroupItem;
|
|
37
41
|
return (
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
<NavbarMenuItemWithDropdownWrapper>
|
|
43
|
+
<NavbarMenuItem
|
|
44
|
+
active={false}
|
|
45
|
+
data-component-name="Navbar/NavbarItem"
|
|
46
|
+
className={className}
|
|
47
|
+
>
|
|
48
|
+
<NavbarLabel>{item.label}</NavbarLabel>
|
|
49
|
+
</NavbarMenuItem>
|
|
42
50
|
<NavbarDropdown items={item.items as ResolvedNavLinkItem[]} />
|
|
43
|
-
</
|
|
51
|
+
</NavbarMenuItemWithDropdownWrapper>
|
|
44
52
|
);
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
return null;
|
|
48
56
|
}
|
|
49
57
|
|
|
50
|
-
export const
|
|
58
|
+
export const NavbarMenuItemWithDropdownWrapper = styled.div`
|
|
51
59
|
display: inline-block;
|
|
52
60
|
position: relative;
|
|
53
61
|
border-radius: var(--navbar-item-border-radius);
|
|
@@ -59,27 +67,36 @@ export const NavMenuItemWithDropdownWrapper = styled.div`
|
|
|
59
67
|
}
|
|
60
68
|
`;
|
|
61
69
|
|
|
62
|
-
export const
|
|
70
|
+
export const NavbarLink = styled(Link)`
|
|
71
|
+
color: ${({ active }) =>
|
|
72
|
+
active ? 'var(--navbar-item-active-text-color)' : 'var(--navbar-text-color)'};
|
|
73
|
+
text-decoration: ${({ active }) =>
|
|
74
|
+
active ? 'var(--navbar-item-active-text-decoration)' : 'none'};
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
export const NavbarMenuItem = styled.li<{ active?: boolean }>`
|
|
63
78
|
display: inline-block;
|
|
64
|
-
padding:
|
|
79
|
+
padding: var(--navbar-item-paddin-vertical) var(--navbar-item-padding-horizontal);
|
|
80
|
+
margin-left: var(--navbar-item-margin-horizontal);
|
|
65
81
|
text-align: center;
|
|
66
82
|
line-height: 1;
|
|
67
83
|
font-size: var(--navbar-item-font-size);
|
|
68
|
-
margin-left: var(--navbar-item-margin-horizontal);
|
|
69
|
-
margin-right: var(--navbar-item-margin-horizontal);
|
|
70
84
|
border-radius: var(--navbar-item-border-radius);
|
|
71
85
|
font-weight: var(--navbar-item-font-weight);
|
|
72
|
-
background: ${({ active }) =>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
background: ${({ active }) => active && 'var(--navbar-item-active-background-color)'};
|
|
87
|
+
color: ${({ active }) => active && 'var(--navbar-item-active-text-color)'};
|
|
88
|
+
&:hover {
|
|
89
|
+
color: var(--navbar-item-hover-text-color);
|
|
90
|
+
text-decoration: var(--navbar-item-hover-text-decoration);
|
|
91
|
+
background: var(--navbar-item-hover-background-color);
|
|
92
|
+
${NavbarLink} {
|
|
93
|
+
color: var(--navbar-item-hover-text-color);
|
|
94
|
+
text-decoration: var(--navbar-item-hover-text-decoration);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
80
97
|
`;
|
|
81
98
|
|
|
82
|
-
const
|
|
99
|
+
const NavbarLabel = styled.span`
|
|
83
100
|
cursor: pointer;
|
|
84
101
|
vertical-align: middle;
|
|
85
102
|
`;
|
|
@@ -4,10 +4,10 @@ import styled from 'styled-components';
|
|
|
4
4
|
import type { ResolvedConfigLinks, ResolvedNavItem } from '@theme/types/portal';
|
|
5
5
|
|
|
6
6
|
import { NavbarItem } from '@theme/Navbar/NavbarItem';
|
|
7
|
-
import { isPrimitive
|
|
7
|
+
import { isPrimitive } from '@theme/utils';
|
|
8
8
|
|
|
9
9
|
export function NavbarMenu({ menuItems }: { menuItems: ResolvedConfigLinks }): JSX.Element | null {
|
|
10
|
-
if (isPrimitive(menuItems)
|
|
10
|
+
if (isPrimitive(menuItems)) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -24,7 +24,7 @@ export function NavbarMenu({ menuItems }: { menuItems: ResolvedConfigLinks }): J
|
|
|
24
24
|
|
|
25
25
|
const NavItemsContainer = styled.ul`
|
|
26
26
|
list-style: none;
|
|
27
|
-
margin: 0
|
|
27
|
+
margin: 0 var(--navbar-item-margin-horizontal);
|
|
28
28
|
padding: 0;
|
|
29
29
|
display: none;
|
|
30
30
|
flex-wrap: nowrap;
|
|
@@ -17,8 +17,8 @@ export function NavbarLogo({ logo }: NavbarLogoProps): JSX.Element | null {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
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);
|
|
20
|
+
max-width: var(--navbar-logo-max-width);
|
|
21
|
+
max-height: var(--navbar-logo-max-height);
|
|
22
|
+
height: var(--navbar-logo-height);
|
|
23
|
+
margin: var(--navbar-logo-margin);
|
|
24
24
|
`;
|
|
@@ -7,15 +7,14 @@ export const OperationBadge = styled.span.attrs((props: { type: string }) => ({
|
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
justify-content: center;
|
|
10
|
-
font-size: var(--
|
|
11
|
-
font-family: var(--http-
|
|
12
|
-
font-weight: var(--http-
|
|
13
|
-
line-height: var(--
|
|
14
|
-
color: var(--http-
|
|
15
|
-
background-color:
|
|
16
|
-
border-radius: var(--http-
|
|
17
|
-
width:
|
|
18
|
-
height: 14px;
|
|
10
|
+
font-size: var(--badge-http-font-size);
|
|
11
|
+
font-family: var(--badge-http-font-family);
|
|
12
|
+
font-weight: var(--badge-http-font-weight);
|
|
13
|
+
line-height: var(--badge-http-line-height);
|
|
14
|
+
color: var(--badge-http-text-color);
|
|
15
|
+
background-color: var(--badge-background-color);
|
|
16
|
+
border-radius: var(--badge-http-border-radius);
|
|
17
|
+
width: 58px;
|
|
19
18
|
text-transform: uppercase;
|
|
20
19
|
text-align: center;
|
|
21
20
|
margin-right: 6px;
|
|
@@ -6,7 +6,15 @@ import { NextPageLink } from '@theme/PageNavigation/NextPageLink';
|
|
|
6
6
|
import { useThemeSettings } from '@portal/hooks';
|
|
7
7
|
import { DEFAULT_THEME_NAME } from '@portal/constants';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type PageNavigationProps = {
|
|
10
|
+
showPrevButton?: boolean;
|
|
11
|
+
showNextButton?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function PageNavigation({
|
|
15
|
+
showPrevButton = true,
|
|
16
|
+
showNextButton = true,
|
|
17
|
+
}: PageNavigationProps): JSX.Element | null {
|
|
10
18
|
const { navigation } = useThemeSettings(DEFAULT_THEME_NAME);
|
|
11
19
|
|
|
12
20
|
if (navigation?.hide) {
|
|
@@ -15,8 +23,8 @@ export function PageNavigation(): JSX.Element | null {
|
|
|
15
23
|
|
|
16
24
|
return (
|
|
17
25
|
<PageNavigationWrapper data-component-name="PageNavigation/PageNavigation">
|
|
18
|
-
<PreviousPageLink />
|
|
19
|
-
<NextPageLink />
|
|
26
|
+
{showPrevButton && <PreviousPageLink />}
|
|
27
|
+
{showNextButton && <NextPageLink />}
|
|
20
28
|
</PageNavigationWrapper>
|
|
21
29
|
);
|
|
22
30
|
}
|