@redocly/theme 0.1.10 → 0.1.13
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/CodeBlock/CodeBlock.js +2 -1
- package/Markdown/StyledMarkdown.d.ts +0 -2
- package/Markdown/StyledMarkdown.js +5 -16
- package/Markdown/index.d.ts +0 -1
- package/Markdown/index.js +0 -1
- package/Navbar/NavbarMenu.js +1 -1
- package/OperationBadge/OperationBadge.js +1 -1
- package/Search/ClearIcon.js +2 -2
- package/Search/Input.js +1 -1
- package/Search/Popover.js +1 -1
- package/Search/SearchIcon.js +2 -2
- package/Sidebar/ApiCallItem.js +1 -1
- package/TableOfContent/TableOfContent.js +5 -6
- package/globalStyle.d.ts +1 -0
- package/globalStyle.js +25 -3
- package/mocks/Link.js +4 -1
- package/mocks/hooks/usePageData.js +4 -1
- package/package.json +1 -1
- package/src/CodeBlock/CodeBlock.ts +3 -42
- package/src/Markdown/StyledMarkdown.tsx +14 -28
- package/src/Markdown/index.ts +0 -1
- package/src/Navbar/NavbarMenu.tsx +1 -1
- package/src/OperationBadge/OperationBadge.ts +5 -2
- package/src/Search/ClearIcon.tsx +12 -13
- package/src/Search/Input.tsx +7 -7
- package/src/Search/Popover.tsx +2 -2
- package/src/Search/SearchIcon.tsx +12 -13
- package/src/Sidebar/ApiCallItem.tsx +1 -2
- package/src/TableOfContent/TableOfContent.tsx +6 -4
- package/src/globalStyle.ts +829 -536
- package/src/mocks/Link.tsx +5 -2
- package/src/mocks/hooks/usePageData.ts +4 -1
- package/src/ui/Typography.tsx +12 -89
- package/src/ui/UniversalLink.tsx +3 -8
- package/src/utils/ClipboardService.ts +3 -86
- package/src/utils/isUrl.ts +4 -4
- package/src/utils/theme-helpers.ts +46 -0
- package/ui/Typography.d.ts +2 -71
- package/ui/Typography.js +15 -93
- package/ui/UniversalLink.js +1 -5
- package/utils/ClipboardService.d.ts +1 -5
- package/utils/ClipboardService.js +2 -73
- package/utils/isUrl.d.ts +2 -2
- package/utils/isUrl.js +4 -4
- package/utils/theme-helpers.d.ts +1 -0
- package/utils/theme-helpers.js +42 -2
- package/Markdown/CodeSample/CodeSample.d.ts +0 -8
- package/Markdown/CodeSample/CodeSample.js +0 -30
- package/Markdown/CodeSample/index.d.ts +0 -3
- package/Markdown/CodeSample/index.js +0 -19
- package/Markdown/CodeSample/styled.d.ts +0 -5
- package/Markdown/CodeSample/styled.js +0 -109
- package/Markdown/CodeSample/types.d.ts +0 -9
- package/Markdown/CodeSample/types.js +0 -2
- package/src/Button/Button.stories.tsx +0 -74
- package/src/Button/__tests__/Button.test.tsx +0 -42
- package/src/Button/__tests__/__snapshots__/Button.test.tsx.snap +0 -274
- package/src/CodeBlock/__tests__/CodeBlock.test.tsx +0 -12
- package/src/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap +0 -140
- package/src/CopyButton/CopyButton.stories.tsx +0 -18
- package/src/CopyButton/__tests__/CopyButton.test.tsx +0 -35
- package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +0 -17
- package/src/CopyButton/__tests__/__snapshots__/CopyButton.test.tsx.snap +0 -55
- package/src/CopyButton/__tests__/__snapshots__/CopyButtonWrapper.test.tsx.snap +0 -46
- package/src/Footer/Footer.stories.tsx +0 -57
- package/src/Footer/__tests__/Footer.test.tsx +0 -55
- package/src/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +0 -253
- package/src/Headings/Headings.stories.tsx +0 -36
- package/src/Headings/__tests__/Headings.test.tsx +0 -24
- package/src/Headings/__tests__/__snapshots__/Headings.test.tsx.snap +0 -57
- package/src/JsonViewer/JsonViewer.stories.tsx +0 -57
- package/src/JsonViewer/__tests__/JsonViewer.test.tsx +0 -83
- package/src/JsonViewer/__tests__/__snapshots__/JsonViewer.test.tsx.snap +0 -2728
- package/src/Layout/__tests__/PageLayout.test.tsx +0 -17
- package/src/Layout/__tests__/RootLayout.test.tsx +0 -17
- package/src/Layout/__tests__/__snapshots__/PageLayout.test.tsx.snap +0 -38
- package/src/Layout/__tests__/__snapshots__/RootLayout.test.tsx.snap +0 -18
- package/src/Markdown/CodeSample/CodeSample.tsx +0 -39
- package/src/Markdown/CodeSample/index.ts +0 -3
- package/src/Markdown/CodeSample/styled.ts +0 -289
- package/src/Markdown/CodeSample/types.ts +0 -40
- package/src/Navbar/Navbar.stories.tsx +0 -32
- package/src/NavbarLogo/NavbarLogo.stories.tsx +0 -20
- package/src/NavbarLogo/__tests__/NavbarLogo.test.tsx +0 -47
- package/src/NavbarLogo/__tests__/__snapshots__/NavbarLogo.test.tsx.snap +0 -38
- package/src/OperationBadge/OperationBadge.stories.tsx +0 -35
- package/src/OperationBadge/__tests__/OperationBadge.test.tsx +0 -59
- package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +0 -651
- package/src/Panel/CodePanel.stories.tsx +0 -26
- package/src/Panel/ContentPanel.stories.tsx +0 -26
- package/src/Panel/Panel.stories.tsx +0 -56
- package/src/Panel/__tests__/CodePanel.test.tsx +0 -26
- package/src/Panel/__tests__/ContentPanel.test.tsx +0 -26
- package/src/Panel/__tests__/Panel.test.tsx +0 -53
- package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +0 -258
- package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +0 -278
- package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +0 -398
- package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +0 -18
- package/src/SamplesPanelControls/__tests__/SamplesPanelControls.test.tsx +0 -36
- package/src/SamplesPanelControls/__tests__/__snapshots__/SamplesPanelControls.test.tsx.snap +0 -228
- package/src/SidebarLogo/SidebarLogo.stories.tsx +0 -21
- package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +0 -32
- package/src/SidebarLogo/__tests__/__snapshots__/SidebarLogo.test.tsx.snap +0 -62
- package/src/SourceCode/SourceCode.stories.tsx +0 -29
- package/src/SourceCode/__tests__/SourceCode.test.tsx +0 -48
- package/src/SourceCode/__tests__/__snapshots__/SourceCode.test.tsx.snap +0 -786
- package/src/TableOfContent/TableOfContent.stories.tsx +0 -39
- package/src/Tooltip/Tooltip.stories.tsx +0 -27
- package/src/Tooltip/__tests__/Tooltip.test.tsx +0 -41
- package/src/Tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -83
- package/src/Welcome.stories.mdx +0 -7
- package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +0 -36
- package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +0 -54
- package/src/icons/ShelfIcon/__tests__/__snapshots__/ShelfIcon.test.tsx.snap +0 -235
- package/src/utils/__tests__/ClipboardService.test.ts +0 -24
- package/src/utils/__tests__/__snapshots__/highlight.test.ts.snap +0 -5
- package/src/utils/__tests__/__snapshots__/jsonToHtml.test.ts.snap +0 -5
- package/src/utils/__tests__/css-variables.test.ts +0 -20
- package/src/utils/__tests__/highlight.test.ts +0 -51
- package/src/utils/__tests__/jsonToHtml.test.ts +0 -40
- package/src/utils/__tests__/media-css.test.ts +0 -20
- package/src/utils/__tests__/theme-helpers.test.ts +0 -25
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Button renders 1`] = `
|
|
4
|
-
.c1 {
|
|
5
|
-
-webkit-text-decoration: none;
|
|
6
|
-
text-decoration: none;
|
|
7
|
-
text-align: center;
|
|
8
|
-
width: auto;
|
|
9
|
-
outline: none;
|
|
10
|
-
border: none;
|
|
11
|
-
border-radius: var(--button-border-radius);
|
|
12
|
-
font-weight: var(--button-font-weight);
|
|
13
|
-
font-size: 14px;
|
|
14
|
-
padding: 2px 20px;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
17
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
18
|
-
line-height: 1;
|
|
19
|
-
font-family: var(--button-font-family);
|
|
20
|
-
box-shadow: var(--button-box-shadow);
|
|
21
|
-
color: var(--button-color);
|
|
22
|
-
background-color: var(--button-background-color);
|
|
23
|
-
font-size: var(--button-medium-font-size);
|
|
24
|
-
padding: var(--button-medium-padding);
|
|
25
|
-
min-width: var(--button-medium-min-width);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.c1:hover {
|
|
29
|
-
box-shadow: var(--button-active-box-shadow);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.c1:active {
|
|
33
|
-
box-shadow: var(--button-active-box-shadow);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.c1:hover {
|
|
37
|
-
background-color: var(--button-hover-background-color);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.c1:active {
|
|
41
|
-
background-color: var(--button-active-background-color);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.c0 + .c0 {
|
|
45
|
-
margin-left: 0.85em;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
<button
|
|
49
|
-
class="c0 c1 button-color-default"
|
|
50
|
-
>
|
|
51
|
-
Test
|
|
52
|
-
</button>
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
exports[`Button renders blinking 1`] = `
|
|
56
|
-
.c1 {
|
|
57
|
-
-webkit-text-decoration: none;
|
|
58
|
-
text-decoration: none;
|
|
59
|
-
text-align: center;
|
|
60
|
-
width: auto;
|
|
61
|
-
outline: none;
|
|
62
|
-
border: none;
|
|
63
|
-
border-radius: var(--button-border-radius);
|
|
64
|
-
font-weight: var(--button-font-weight);
|
|
65
|
-
font-size: 14px;
|
|
66
|
-
padding: 2px 20px;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
69
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
70
|
-
line-height: 1;
|
|
71
|
-
font-family: var(--button-font-family);
|
|
72
|
-
box-shadow: var(--button-box-shadow);
|
|
73
|
-
color: var(--button-color);
|
|
74
|
-
background-color: var(--button-background-color);
|
|
75
|
-
font-size: var(--button-medium-font-size);
|
|
76
|
-
padding: var(--button-medium-padding);
|
|
77
|
-
min-width: var(--button-medium-min-width);
|
|
78
|
-
pointer-events: none;
|
|
79
|
-
-webkit-animation: hiqtTO 1.2s infinite;
|
|
80
|
-
animation: hiqtTO 1.2s infinite;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.c1:hover {
|
|
84
|
-
box-shadow: var(--button-active-box-shadow);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.c1:active {
|
|
88
|
-
box-shadow: var(--button-active-box-shadow);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.c1:hover {
|
|
92
|
-
background-color: var(--button-hover-background-color);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.c1:active {
|
|
96
|
-
background-color: var(--button-active-background-color);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.c0 + .c0 {
|
|
100
|
-
margin-left: 0.85em;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
<button
|
|
104
|
-
class="c0 c1 button-color-default"
|
|
105
|
-
>
|
|
106
|
-
Test
|
|
107
|
-
</button>
|
|
108
|
-
`;
|
|
109
|
-
|
|
110
|
-
exports[`Button renders disabled 1`] = `
|
|
111
|
-
.c1 {
|
|
112
|
-
-webkit-text-decoration: none;
|
|
113
|
-
text-decoration: none;
|
|
114
|
-
text-align: center;
|
|
115
|
-
width: auto;
|
|
116
|
-
outline: none;
|
|
117
|
-
border: none;
|
|
118
|
-
border-radius: var(--button-border-radius);
|
|
119
|
-
font-weight: var(--button-font-weight);
|
|
120
|
-
font-size: 14px;
|
|
121
|
-
padding: 2px 20px;
|
|
122
|
-
cursor: pointer;
|
|
123
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
124
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
125
|
-
line-height: 1;
|
|
126
|
-
font-family: var(--button-font-family);
|
|
127
|
-
box-shadow: var(--button-box-shadow);
|
|
128
|
-
color: var(--button-color);
|
|
129
|
-
background-color: var(--button-background-color);
|
|
130
|
-
font-size: var(--button-medium-font-size);
|
|
131
|
-
padding: var(--button-medium-padding);
|
|
132
|
-
min-width: var(--button-medium-min-width);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.c1:hover {
|
|
136
|
-
box-shadow: var(--button-active-box-shadow);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.c1:active {
|
|
140
|
-
box-shadow: var(--button-active-box-shadow);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.c1:hover {
|
|
144
|
-
background-color: var(--button-hover-background-color);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.c1:active {
|
|
148
|
-
background-color: var(--button-active-background-color);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.c0 + .c0 {
|
|
152
|
-
margin-left: 0.85em;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.c1,
|
|
156
|
-
.c1:hover {
|
|
157
|
-
cursor: default;
|
|
158
|
-
color: #999999;
|
|
159
|
-
pointer-events: none;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
<button
|
|
163
|
-
class="c0 c1 button-color-default"
|
|
164
|
-
disabled=""
|
|
165
|
-
>
|
|
166
|
-
Test
|
|
167
|
-
</button>
|
|
168
|
-
`;
|
|
169
|
-
|
|
170
|
-
exports[`Button renders full width 1`] = `
|
|
171
|
-
.c1 {
|
|
172
|
-
-webkit-text-decoration: none;
|
|
173
|
-
text-decoration: none;
|
|
174
|
-
text-align: center;
|
|
175
|
-
width: 100%;
|
|
176
|
-
outline: none;
|
|
177
|
-
border: none;
|
|
178
|
-
border-radius: var(--button-border-radius);
|
|
179
|
-
font-weight: var(--button-font-weight);
|
|
180
|
-
font-size: 14px;
|
|
181
|
-
padding: 2px 20px;
|
|
182
|
-
cursor: pointer;
|
|
183
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
184
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
185
|
-
line-height: 1;
|
|
186
|
-
font-family: var(--button-font-family);
|
|
187
|
-
box-shadow: var(--button-box-shadow);
|
|
188
|
-
color: var(--button-color);
|
|
189
|
-
background-color: var(--button-background-color);
|
|
190
|
-
font-size: var(--button-medium-font-size);
|
|
191
|
-
padding: var(--button-medium-padding);
|
|
192
|
-
min-width: var(--button-medium-min-width);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.c1:hover {
|
|
196
|
-
box-shadow: var(--button-active-box-shadow);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.c1:active {
|
|
200
|
-
box-shadow: var(--button-active-box-shadow);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.c1:hover {
|
|
204
|
-
background-color: var(--button-hover-background-color);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.c1:active {
|
|
208
|
-
background-color: var(--button-active-background-color);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.c0 + .c0 {
|
|
212
|
-
margin-left: 0.85em;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
<button
|
|
216
|
-
class="c0 c1 button-color-default"
|
|
217
|
-
>
|
|
218
|
-
Test
|
|
219
|
-
</button>
|
|
220
|
-
`;
|
|
221
|
-
|
|
222
|
-
exports[`Button renders outlined 1`] = `
|
|
223
|
-
.c1 {
|
|
224
|
-
-webkit-text-decoration: none;
|
|
225
|
-
text-decoration: none;
|
|
226
|
-
text-align: center;
|
|
227
|
-
width: auto;
|
|
228
|
-
outline: none;
|
|
229
|
-
border: none;
|
|
230
|
-
border-radius: var(--button-border-radius);
|
|
231
|
-
font-weight: var(--button-font-weight);
|
|
232
|
-
font-size: 14px;
|
|
233
|
-
padding: 2px 20px;
|
|
234
|
-
cursor: pointer;
|
|
235
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
236
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
237
|
-
line-height: 1;
|
|
238
|
-
font-family: var(--button-font-family);
|
|
239
|
-
box-shadow: var(--button-box-shadow);
|
|
240
|
-
color: var(--button-background-color);
|
|
241
|
-
border: 2px solid var(--button-background-color);
|
|
242
|
-
background-color: transparent;
|
|
243
|
-
font-size: var(--button-medium-font-size);
|
|
244
|
-
padding: var(--button-medium-padding);
|
|
245
|
-
min-width: var(--button-medium-min-width);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.c1:hover {
|
|
249
|
-
box-shadow: var(--button-active-box-shadow);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.c1:active {
|
|
253
|
-
box-shadow: var(--button-active-box-shadow);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.c1:hover {
|
|
257
|
-
border: 2px solid var(--button-active-background-color);
|
|
258
|
-
background-color: transparent;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.c1:active {
|
|
262
|
-
border: 2px solid var(--button-outlined-active-border-color);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.c0 + .c0 {
|
|
266
|
-
margin-left: 0.85em;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
<button
|
|
270
|
-
class="c0 c1 button-color-default"
|
|
271
|
-
>
|
|
272
|
-
Test
|
|
273
|
-
</button>
|
|
274
|
-
`;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import { CodeBlock } from '@theme/CodeBlock';
|
|
5
|
-
|
|
6
|
-
describe('CodeBlock', () => {
|
|
7
|
-
it('renders', () => {
|
|
8
|
-
const { container } = render(<CodeBlock>Test</CodeBlock>);
|
|
9
|
-
|
|
10
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`CodeBlock renders 1`] = `
|
|
4
|
-
.c0 {
|
|
5
|
-
max-height: var(--code-block-max-height,600px);
|
|
6
|
-
word-break: var(--code-block-word-break,initial);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.c0 code[class*='language-'],
|
|
10
|
-
.c0 pre[class*='language-'] {
|
|
11
|
-
text-shadow: 0 -0.1em 0.2em black;
|
|
12
|
-
text-align: left;
|
|
13
|
-
white-space: pre;
|
|
14
|
-
word-spacing: normal;
|
|
15
|
-
word-break: normal;
|
|
16
|
-
word-wrap: normal;
|
|
17
|
-
line-height: 1.5;
|
|
18
|
-
-moz-tab-size: 4;
|
|
19
|
-
-o-tab-size: 4;
|
|
20
|
-
tab-size: 4;
|
|
21
|
-
-webkit-hyphens: none;
|
|
22
|
-
-moz-hyphens: none;
|
|
23
|
-
-ms-hyphens: none;
|
|
24
|
-
-webkit-hyphens: none;
|
|
25
|
-
-moz-hyphens: none;
|
|
26
|
-
-ms-hyphens: none;
|
|
27
|
-
hyphens: none;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.c0 pre[class*='language-'] {
|
|
31
|
-
padding: 1em;
|
|
32
|
-
margin: 0.5em 0;
|
|
33
|
-
overflow: auto;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.c0 .token.comment,
|
|
37
|
-
.c0 .token.prolog,
|
|
38
|
-
.c0 .token.doctype,
|
|
39
|
-
.c0 .token.cdata {
|
|
40
|
-
color: hsl(30,20%,50%);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.c0 .token.punctuation {
|
|
44
|
-
opacity: 1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.c0 .namespace {
|
|
48
|
-
opacity: 0.7;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.c0 .token.property,
|
|
52
|
-
.c0 .token.tag,
|
|
53
|
-
.c0 .token.number,
|
|
54
|
-
.c0 .token.constant,
|
|
55
|
-
.c0 .token.symbol {
|
|
56
|
-
color: var(--color-content-inverse);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.c0 .token.boolean {
|
|
60
|
-
color: var(--color-error-500);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.c0 .token.selector,
|
|
64
|
-
.c0 .token.attr-name,
|
|
65
|
-
.c0 .token.string,
|
|
66
|
-
.c0 .token.char,
|
|
67
|
-
.c0 .token.builtin,
|
|
68
|
-
.c0 .token.inserted {
|
|
69
|
-
color: #fee39e;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.c0 .token.selector + a,
|
|
73
|
-
.c0 .token.attr-name + a,
|
|
74
|
-
.c0 .token.string + a,
|
|
75
|
-
.c0 .token.char + a,
|
|
76
|
-
.c0 .token.builtin + a,
|
|
77
|
-
.c0 .token.inserted + a,
|
|
78
|
-
.c0 .token.selector + a:visited,
|
|
79
|
-
.c0 .token.attr-name + a:visited,
|
|
80
|
-
.c0 .token.string + a:visited,
|
|
81
|
-
.c0 .token.char + a:visited,
|
|
82
|
-
.c0 .token.builtin + a:visited,
|
|
83
|
-
.c0 .token.inserted + a:visited {
|
|
84
|
-
color: #4ed2ba;
|
|
85
|
-
-webkit-text-decoration: underline;
|
|
86
|
-
text-decoration: underline;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.c0 .token.property.string {
|
|
90
|
-
color: #9efaa7;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.c0 .token.operator,
|
|
94
|
-
.c0 .token.entity,
|
|
95
|
-
.c0 .token.url,
|
|
96
|
-
.c0 .token.variable {
|
|
97
|
-
color: #f5b83d;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.c0 .token.atrule,
|
|
101
|
-
.c0 .token.attr-value,
|
|
102
|
-
.c0 .token.keyword {
|
|
103
|
-
color: #ffdbf4;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.c0 .token.regex,
|
|
107
|
-
.c0 .token.important {
|
|
108
|
-
color: #e90;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.c0 .token.important,
|
|
112
|
-
.c0 .token.bold {
|
|
113
|
-
font-weight: bold;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.c0 .token.italic {
|
|
117
|
-
font-style: italic;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.c0 .token.entity {
|
|
121
|
-
cursor: help;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.c0 .token.deleted {
|
|
125
|
-
color: red;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
@media print {
|
|
129
|
-
.c0 code[class*='language-'],
|
|
130
|
-
.c0 pre[class*='language-'] {
|
|
131
|
-
text-shadow: none;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
<div
|
|
136
|
-
class="c0"
|
|
137
|
-
>
|
|
138
|
-
Test
|
|
139
|
-
</div>
|
|
140
|
-
`;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { CopyButton } from '@theme/CopyButton';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/CopyButton',
|
|
8
|
-
component: CopyButton,
|
|
9
|
-
} as ComponentMeta<typeof CopyButton>;
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof CopyButton> = (args) => (
|
|
12
|
-
<CopyButton {...args}>Copy</CopyButton>
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
export const Default = Template.bind({});
|
|
16
|
-
Default.args = {
|
|
17
|
-
text: 'Something useful',
|
|
18
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { fireEvent, getByText, render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import { CopyButton } from '@theme/CopyButton';
|
|
5
|
-
|
|
6
|
-
const mockSetState = jest.fn();
|
|
7
|
-
|
|
8
|
-
jest.mock('react', () => {
|
|
9
|
-
const original = jest.requireActual('react');
|
|
10
|
-
return {
|
|
11
|
-
...original,
|
|
12
|
-
useState: (initial: any) => [initial, mockSetState],
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
describe('CopyButton', () => {
|
|
17
|
-
it('renders', () => {
|
|
18
|
-
const { container } = render(<CopyButton text="test copy" dataTestId="copy" />);
|
|
19
|
-
|
|
20
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('changes button text on click', () => {
|
|
24
|
-
Object.assign(navigator, {
|
|
25
|
-
clipboard: { writeText: jest.fn() },
|
|
26
|
-
});
|
|
27
|
-
const textToCopy = 'test copy';
|
|
28
|
-
const { container } = render(<CopyButton text={textToCopy} />);
|
|
29
|
-
const button = getByText(container, /Copy/);
|
|
30
|
-
|
|
31
|
-
fireEvent.click(button);
|
|
32
|
-
|
|
33
|
-
expect(navigator.clipboard.writeText).toBeCalledWith(textToCopy);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { renderWithTheme } from '../../../tests/utils';
|
|
4
|
-
|
|
5
|
-
import { CopyButtonWrapper } from '@theme/CopyButton';
|
|
6
|
-
|
|
7
|
-
describe('CopyButtonWrapper', () => {
|
|
8
|
-
it('renders', () => {
|
|
9
|
-
const { container } = renderWithTheme(
|
|
10
|
-
<CopyButtonWrapper data="Something" dataTestId="copy">
|
|
11
|
-
{({ renderCopyButton }) => <div>{renderCopyButton()}</div>}
|
|
12
|
-
</CopyButtonWrapper>,
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`CopyButton renders 1`] = `
|
|
4
|
-
.c1 {
|
|
5
|
-
-webkit-text-decoration: none;
|
|
6
|
-
text-decoration: none;
|
|
7
|
-
text-align: center;
|
|
8
|
-
width: auto;
|
|
9
|
-
outline: none;
|
|
10
|
-
border: none;
|
|
11
|
-
border-radius: var(--button-border-radius);
|
|
12
|
-
font-weight: var(--button-font-weight);
|
|
13
|
-
font-size: 14px;
|
|
14
|
-
padding: 2px 20px;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
17
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
18
|
-
line-height: 1;
|
|
19
|
-
font-family: var(--button-font-family);
|
|
20
|
-
box-shadow: var(--button-box-shadow);
|
|
21
|
-
color: var(--button-color);
|
|
22
|
-
background-color: var(--button-background-color);
|
|
23
|
-
font-size: var(--button-medium-font-size);
|
|
24
|
-
padding: var(--button-medium-padding);
|
|
25
|
-
min-width: var(--button-medium-min-width);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.c1:hover {
|
|
29
|
-
box-shadow: var(--button-active-box-shadow);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.c1:active {
|
|
33
|
-
box-shadow: var(--button-active-box-shadow);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.c1:hover {
|
|
37
|
-
background-color: var(--button-hover-background-color);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.c1:active {
|
|
41
|
-
background-color: var(--button-active-background-color);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.c0 + .c0 {
|
|
45
|
-
margin-left: 0.85em;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
<button
|
|
49
|
-
class="c0 c1 button-color-secondary"
|
|
50
|
-
color="secondary"
|
|
51
|
-
data-cy="copy"
|
|
52
|
-
>
|
|
53
|
-
Copy
|
|
54
|
-
</button>
|
|
55
|
-
`;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`CopyButtonWrapper renders 1`] = `
|
|
4
|
-
.c1 {
|
|
5
|
-
background-color: var(--samples-panel-controls-background-color);
|
|
6
|
-
border: 0;
|
|
7
|
-
outline: 0;
|
|
8
|
-
border-radius: var(--global-border-radius);
|
|
9
|
-
height: 20px;
|
|
10
|
-
color: var(--color-content-inverse);
|
|
11
|
-
font-size: 12px;
|
|
12
|
-
line-height: 12px;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
padding: 1px 6px;
|
|
15
|
-
min-width: 90px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.c1:hover,
|
|
19
|
-
.c1:focus {
|
|
20
|
-
background-color: var(--samples-panel-controls-hover-background-color);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.c0 {
|
|
24
|
-
position: relative;
|
|
25
|
-
display: inline-block;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@media screen and (min-width:50rem) {
|
|
29
|
-
.c1 {
|
|
30
|
-
padding: 2px 20px;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
<div>
|
|
35
|
-
<div
|
|
36
|
-
class="c0 tooltip-copy-button"
|
|
37
|
-
>
|
|
38
|
-
<button
|
|
39
|
-
class="c1"
|
|
40
|
-
data-cy="copy"
|
|
41
|
-
>
|
|
42
|
-
Copy
|
|
43
|
-
</button>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
});
|