@redocly/theme 0.1.11 → 0.1.12

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.
Files changed (104) hide show
  1. package/Search/ClearIcon.js +1 -1
  2. package/Search/Input.js +1 -1
  3. package/Search/Popover.js +1 -1
  4. package/Search/SearchIcon.js +1 -1
  5. package/Sidebar/ApiCallItem.js +1 -1
  6. package/globalStyle.js +24 -6
  7. package/mocks/Link.js +1 -1
  8. package/package.json +1 -1
  9. package/src/Search/ClearIcon.tsx +1 -1
  10. package/src/Search/Input.tsx +7 -7
  11. package/src/Search/Popover.tsx +2 -2
  12. package/src/Search/SearchIcon.tsx +1 -1
  13. package/src/Sidebar/ApiCallItem.tsx +1 -2
  14. package/src/globalStyle.ts +624 -461
  15. package/src/mocks/Link.tsx +1 -1
  16. package/src/ui/Typography.tsx +8 -8
  17. package/src/ui/UniversalLink.tsx +3 -8
  18. package/src/utils/isUrl.ts +4 -4
  19. package/ui/Typography.js +8 -8
  20. package/ui/UniversalLink.js +1 -5
  21. package/utils/isUrl.d.ts +2 -2
  22. package/utils/isUrl.js +4 -4
  23. package/src/Button/Button.stories.tsx +0 -74
  24. package/src/Button/__tests__/Button.test.tsx +0 -42
  25. package/src/Button/__tests__/__snapshots__/Button.test.tsx.snap +0 -274
  26. package/src/CodeBlock/__tests__/CodeBlock.test.tsx +0 -12
  27. package/src/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap +0 -140
  28. package/src/CopyButton/CopyButton.stories.tsx +0 -18
  29. package/src/CopyButton/__tests__/CopyButton.test.tsx +0 -35
  30. package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +0 -17
  31. package/src/CopyButton/__tests__/__snapshots__/CopyButton.test.tsx.snap +0 -55
  32. package/src/CopyButton/__tests__/__snapshots__/CopyButtonWrapper.test.tsx.snap +0 -46
  33. package/src/DesignTokens/borders.stories.mdx +0 -20
  34. package/src/DesignTokens/colors.stories.mdx +0 -24
  35. package/src/DesignTokens/page-layout.stories.mdx +0 -12
  36. package/src/DesignTokens/tokens-generated.scss +0 -610
  37. package/src/DesignTokens/typography.stories.mdx +0 -36
  38. package/src/Footer/Footer.stories.tsx +0 -57
  39. package/src/Footer/__tests__/Footer.test.tsx +0 -55
  40. package/src/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +0 -253
  41. package/src/Headings/Headings.stories.tsx +0 -36
  42. package/src/Headings/__tests__/Headings.test.tsx +0 -24
  43. package/src/Headings/__tests__/__snapshots__/Headings.test.tsx.snap +0 -57
  44. package/src/JsonViewer/JsonViewer.stories.tsx +0 -57
  45. package/src/JsonViewer/__tests__/JsonViewer.test.tsx +0 -83
  46. package/src/JsonViewer/__tests__/__snapshots__/JsonViewer.test.tsx.snap +0 -2728
  47. package/src/Layout/__tests__/PageLayout.test.tsx +0 -17
  48. package/src/Layout/__tests__/RootLayout.test.tsx +0 -17
  49. package/src/Layout/__tests__/__snapshots__/PageLayout.test.tsx.snap +0 -38
  50. package/src/Layout/__tests__/__snapshots__/RootLayout.test.tsx.snap +0 -18
  51. package/src/Navbar/Navbar.stories.tsx +0 -32
  52. package/src/Navbar/__tests__/Navbar.test.tsx +0 -55
  53. package/src/Navbar/__tests__/__snapshots__/Navbar.test.tsx.snap +0 -256
  54. package/src/NavbarLogo/NavbarLogo.stories.tsx +0 -20
  55. package/src/NavbarLogo/__tests__/NavbarLogo.test.tsx +0 -47
  56. package/src/NavbarLogo/__tests__/__snapshots__/NavbarLogo.test.tsx.snap +0 -38
  57. package/src/OperationBadge/OperationBadge.stories.tsx +0 -35
  58. package/src/OperationBadge/__tests__/OperationBadge.test.tsx +0 -59
  59. package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +0 -651
  60. package/src/PageNavigation/PageNavigation.stories.tsx +0 -21
  61. package/src/PageNavigation/__tests__/NextPageLink.test.tsx +0 -29
  62. package/src/PageNavigation/__tests__/PageNavigation.test.tsx +0 -54
  63. package/src/PageNavigation/__tests__/PreviousPageLink.test.tsx +0 -29
  64. package/src/PageNavigation/__tests__/__snapshots__/NextPageLink.test.tsx.snap +0 -67
  65. package/src/PageNavigation/__tests__/__snapshots__/PageNavigation.test.tsx.snap +0 -275
  66. package/src/PageNavigation/__tests__/__snapshots__/PreviousPageLink.test.tsx.snap +0 -67
  67. package/src/Panel/CodePanel.stories.tsx +0 -26
  68. package/src/Panel/ContentPanel.stories.tsx +0 -26
  69. package/src/Panel/Panel.stories.tsx +0 -56
  70. package/src/Panel/__tests__/CodePanel.test.tsx +0 -26
  71. package/src/Panel/__tests__/ContentPanel.test.tsx +0 -26
  72. package/src/Panel/__tests__/Panel.test.tsx +0 -53
  73. package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +0 -258
  74. package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +0 -278
  75. package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +0 -398
  76. package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +0 -18
  77. package/src/SamplesPanelControls/__tests__/SamplesPanelControls.test.tsx +0 -36
  78. package/src/SamplesPanelControls/__tests__/__snapshots__/SamplesPanelControls.test.tsx.snap +0 -228
  79. package/src/Search/__tests__/Input.test.tsx +0 -13
  80. package/src/Search/__tests__/__snapshots__/Input.test.tsx.snap +0 -36
  81. package/src/SidebarLogo/SidebarLogo.stories.tsx +0 -21
  82. package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +0 -32
  83. package/src/SidebarLogo/__tests__/__snapshots__/SidebarLogo.test.tsx.snap +0 -62
  84. package/src/SourceCode/SourceCode.stories.tsx +0 -29
  85. package/src/SourceCode/__tests__/SourceCode.test.tsx +0 -48
  86. package/src/SourceCode/__tests__/__snapshots__/SourceCode.test.tsx.snap +0 -786
  87. package/src/TableOfContent/TableOfContent.stories.tsx +0 -37
  88. package/src/TableOfContent/__tests__/TableOfContent.test.tsx +0 -61
  89. package/src/TableOfContent/__tests__/__snapshots__/TableOfContent.test.tsx.snap +0 -153
  90. package/src/Tooltip/Tooltip.stories.tsx +0 -27
  91. package/src/Tooltip/__tests__/Tooltip.test.tsx +0 -41
  92. package/src/Tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -83
  93. package/src/Welcome.stories.mdx +0 -7
  94. package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +0 -36
  95. package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +0 -54
  96. package/src/icons/ShelfIcon/__tests__/__snapshots__/ShelfIcon.test.tsx.snap +0 -235
  97. package/src/utils/__tests__/ClipboardService.test.ts +0 -24
  98. package/src/utils/__tests__/__snapshots__/highlight.test.ts.snap +0 -5
  99. package/src/utils/__tests__/__snapshots__/jsonToHtml.test.ts.snap +0 -5
  100. package/src/utils/__tests__/css-variables.test.ts +0 -20
  101. package/src/utils/__tests__/highlight.test.ts +0 -51
  102. package/src/utils/__tests__/jsonToHtml.test.ts +0 -40
  103. package/src/utils/__tests__/media-css.test.ts +0 -20
  104. package/src/utils/__tests__/theme-helpers.test.ts +0 -25
@@ -1,235 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`ShelfIcon renders down 1`] = `
4
- .c0 {
5
- height: 9px;
6
- width: 9px;
7
- -webkit-transform: rotateZ(90deg);
8
- -ms-transform: rotateZ(90deg);
9
- transform: rotateZ(90deg);
10
- fill: inherit;
11
- vertical-align: middle;
12
- -webkit-transition: -webkit-transform 0.2s ease-out;
13
- -webkit-transition: transform 0.2s ease-out;
14
- transition: transform 0.2s ease-out;
15
- }
16
-
17
- <svg
18
- aria-hidden="true"
19
- class="c0"
20
- viewBox="0 0 4.25 7"
21
- xmlns="http://www.w3.org/2000/svg"
22
- >
23
- <path
24
- d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
25
- />
26
- <path
27
- d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
28
- />
29
- </svg>
30
- `;
31
-
32
- exports[`ShelfIcon renders left 1`] = `
33
- .c0 {
34
- height: 9px;
35
- width: 9px;
36
- -webkit-transform: rotateZ(180deg);
37
- -ms-transform: rotateZ(180deg);
38
- transform: rotateZ(180deg);
39
- fill: inherit;
40
- vertical-align: middle;
41
- -webkit-transition: -webkit-transform 0.2s ease-out;
42
- -webkit-transition: transform 0.2s ease-out;
43
- transition: transform 0.2s ease-out;
44
- }
45
-
46
- <svg
47
- aria-hidden="true"
48
- class="c0"
49
- viewBox="0 0 4.25 7"
50
- xmlns="http://www.w3.org/2000/svg"
51
- >
52
- <path
53
- d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
54
- />
55
- <path
56
- d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
57
- />
58
- </svg>
59
- `;
60
-
61
- exports[`ShelfIcon renders right 1`] = `
62
- .c0 {
63
- height: 9px;
64
- width: 9px;
65
- -webkit-transform: rotateZ(0deg);
66
- -ms-transform: rotateZ(0deg);
67
- transform: rotateZ(0deg);
68
- fill: inherit;
69
- vertical-align: middle;
70
- -webkit-transition: -webkit-transform 0.2s ease-out;
71
- -webkit-transition: transform 0.2s ease-out;
72
- transition: transform 0.2s ease-out;
73
- }
74
-
75
- <svg
76
- aria-hidden="true"
77
- class="c0"
78
- viewBox="0 0 4.25 7"
79
- xmlns="http://www.w3.org/2000/svg"
80
- >
81
- <path
82
- d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
83
- />
84
- <path
85
- d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
86
- />
87
- </svg>
88
- `;
89
-
90
- exports[`ShelfIcon renders up 1`] = `
91
- .c0 {
92
- height: 9px;
93
- width: 9px;
94
- -webkit-transform: rotateZ(270deg);
95
- -ms-transform: rotateZ(270deg);
96
- transform: rotateZ(270deg);
97
- fill: inherit;
98
- vertical-align: middle;
99
- -webkit-transition: -webkit-transform 0.2s ease-out;
100
- -webkit-transition: transform 0.2s ease-out;
101
- transition: transform 0.2s ease-out;
102
- }
103
-
104
- <svg
105
- aria-hidden="true"
106
- class="c0"
107
- viewBox="0 0 4.25 7"
108
- xmlns="http://www.w3.org/2000/svg"
109
- >
110
- <path
111
- d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
112
- />
113
- <path
114
- d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
115
- />
116
- </svg>
117
- `;
118
-
119
- exports[`ShelfIcon renders with big size 1`] = `
120
- .c0 {
121
- height: 30px;
122
- width: 30px;
123
- -webkit-transform: rotateZ(0deg);
124
- -ms-transform: rotateZ(0deg);
125
- transform: rotateZ(0deg);
126
- fill: inherit;
127
- vertical-align: middle;
128
- -webkit-transition: -webkit-transform 0.2s ease-out;
129
- -webkit-transition: transform 0.2s ease-out;
130
- transition: transform 0.2s ease-out;
131
- }
132
-
133
- <svg
134
- aria-hidden="true"
135
- class="c0"
136
- viewBox="0 0 4.25 7"
137
- xmlns="http://www.w3.org/2000/svg"
138
- >
139
- <path
140
- d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
141
- />
142
- <path
143
- d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
144
- />
145
- </svg>
146
- `;
147
-
148
- exports[`ShelfIcon renders with color 1`] = `
149
- .c0 {
150
- height: 9px;
151
- width: 9px;
152
- -webkit-transform: rotateZ(0deg);
153
- -ms-transform: rotateZ(0deg);
154
- transform: rotateZ(0deg);
155
- fill: orange;
156
- vertical-align: middle;
157
- -webkit-transition: -webkit-transform 0.2s ease-out;
158
- -webkit-transition: transform 0.2s ease-out;
159
- transition: transform 0.2s ease-out;
160
- }
161
-
162
- <svg
163
- aria-hidden="true"
164
- class="c0"
165
- viewBox="0 0 4.25 7"
166
- xmlns="http://www.w3.org/2000/svg"
167
- >
168
- <path
169
- d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
170
- />
171
- <path
172
- d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
173
- />
174
- </svg>
175
- `;
176
-
177
- exports[`ShelfIcon renders with float left 1`] = `
178
- .c0 {
179
- height: 9px;
180
- width: 9px;
181
- float: left;
182
- -webkit-transform: rotateZ(0deg);
183
- -ms-transform: rotateZ(0deg);
184
- transform: rotateZ(0deg);
185
- fill: inherit;
186
- vertical-align: middle;
187
- -webkit-transition: -webkit-transform 0.2s ease-out;
188
- -webkit-transition: transform 0.2s ease-out;
189
- transition: transform 0.2s ease-out;
190
- }
191
-
192
- <svg
193
- aria-hidden="true"
194
- class="c0"
195
- viewBox="0 0 4.25 7"
196
- xmlns="http://www.w3.org/2000/svg"
197
- >
198
- <path
199
- d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
200
- />
201
- <path
202
- d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
203
- />
204
- </svg>
205
- `;
206
-
207
- exports[`ShelfIcon renders with float right 1`] = `
208
- .c0 {
209
- height: 9px;
210
- width: 9px;
211
- float: right;
212
- -webkit-transform: rotateZ(0deg);
213
- -ms-transform: rotateZ(0deg);
214
- transform: rotateZ(0deg);
215
- fill: inherit;
216
- vertical-align: middle;
217
- -webkit-transition: -webkit-transform 0.2s ease-out;
218
- -webkit-transition: transform 0.2s ease-out;
219
- transition: transform 0.2s ease-out;
220
- }
221
-
222
- <svg
223
- aria-hidden="true"
224
- class="c0"
225
- viewBox="0 0 4.25 7"
226
- xmlns="http://www.w3.org/2000/svg"
227
- >
228
- <path
229
- d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
230
- />
231
- <path
232
- d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
233
- />
234
- </svg>
235
- `;
@@ -1,24 +0,0 @@
1
- import { ClipboardService } from '@theme/utils';
2
-
3
- describe('ClipboardService', () => {
4
- describe('isSupported', () => {
5
- it('should call queryCommandSupported', () => {
6
- const queryCommandSupportedMock = jest.fn().mockReturnValue(true);
7
- Object.assign(global.document, { queryCommandSupported: queryCommandSupportedMock });
8
-
9
- expect(ClipboardService.isSupported()).toBe(true);
10
- expect(queryCommandSupportedMock).toBeCalledTimes(1);
11
- expect(queryCommandSupportedMock).toBeCalledWith('copy');
12
- });
13
-
14
- it('should return false, when queryCommandSupported is not defined', () => {
15
- Object.assign(global.document, { queryCommandSupported: undefined });
16
- expect(ClipboardService.isSupported()).toBe(false);
17
- });
18
-
19
- it('should return false, when document is not defined', () => {
20
- Object.assign(global, { document: undefined });
21
- expect(ClipboardService.isSupported()).toBe(false);
22
- });
23
- });
24
- });
@@ -1,5 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`highlight should work with correct lang name 1`] = `"<span class=\\"token keyword\\">int</span> name <span class=\\"token operator\\">=</span> <span class=\\"token string\\">\\"John\\"</span>"`;
4
-
5
- exports[`highlight should work with mapped lang name 1`] = `"<span class=\\"token keyword\\">int</span> name <span class=\\"token operator\\">=</span> <span class=\\"token string\\">\\"John\\"</span>"`;
@@ -1,5 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`jsonToHTML should work with maxExpandLevel 1 1`] = `"<div data-cy=\\"json-sample\\" class=\\"redoc-json\\"><code><button class=\\"collapser\\" aria-label=\\"collapse\\"></button><span class=\\"token punctuation\\">{</span><span class=\\"ellipsis\\"></span><ul class=\\"obj collapsible\\"><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"id\\"</span>: <span class=\\"token string\\">&quot;600dc3b5d617e547a0e74cb9&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"name\\"</span>: <span class=\\"token string\\">&quot;Mitchell Fitzgerald&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"about\\"</span>: <span class=\\"token string\\">&quot;lorem ipsum&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"address\\"</span>: <span class=\\"token string\\">&quot;48 Avenue, City, North&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"company\\"</span>: <span class=\\"token string\\">&quot;Test&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"bio\\"</span>: <span class=\\"token keyword\\">null</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"nicknames\\"</span>: <button class=\\"collapser\\" aria-label=\\"expand\\"></button><span class=\\"token punctuation\\">[</span><span class=\\"ellipsis\\"></span><ul class=\\"array collapsible\\"><li><div class=\\"hoverable collapsed\\"><span class=\\"token string\\">&quot;Mitch&quot;</span>,</div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"token string\\">&quot;Fitz&quot;</span>,</div></li><li><div class=\\"hoverable collapsed\\"><button class=\\"collapser\\" aria-label=\\"expand\\"></button><span class=\\"token punctuation\\">{</span><span class=\\"ellipsis\\"></span><ul class=\\"obj collapsible\\"><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"title\\"</span>: <span class=\\"token string\\">&quot;MitFitz&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"createdAt\\"</span>: <span class=\\"token string\\">&quot;2022-04-19T11:46:00.019Z&quot;</span></div></li></ul><span class=\\"token punctuation\\">}</span></div></li></ul><span class=\\"token punctuation\\">]</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"age\\"</span>: <span class=\\"token number\\">27</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"isBanned\\"</span>: <span class=\\"token boolean\\">true</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"link\\"</span>: <span class=\\"token string\\">&quot;</span><a href=\\"https://google.com\\">https://google.com</a><span class=\\"token string\\">&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"emptyArray\\"</span>: <span class=\\"token punctuation\\">[ ]</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"empty\\"</span>: <span class=\\"token punctuation\\">{ }</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"contacts\\"</span>: <button class=\\"collapser\\" aria-label=\\"expand\\"></button><span class=\\"token punctuation\\">{</span><span class=\\"ellipsis\\"></span><ul class=\\"obj collapsible\\"><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"phone\\"</span>: <button class=\\"collapser\\" aria-label=\\"expand\\"></button><span class=\\"token punctuation\\">{</span><span class=\\"ellipsis\\"></span><ul class=\\"obj collapsible\\"><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"code\\"</span>: <span class=\\"token string\\">&quot;+1&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"rest\\"</span>: <span class=\\"token string\\">&quot;999&quot;</span></div></li></ul><span class=\\"token punctuation\\">}</span></div></li></ul><span class=\\"token punctuation\\">}</span></div></li></ul><span class=\\"token punctuation\\">}</span></code></div>"`;
4
-
5
- exports[`jsonToHTML should work with maxExpandLevel 3 1`] = `"<div data-cy=\\"json-sample\\" class=\\"redoc-json\\"><code><button class=\\"collapser\\" aria-label=\\"collapse\\"></button><span class=\\"token punctuation\\">{</span><span class=\\"ellipsis\\"></span><ul class=\\"obj collapsible\\"><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"id\\"</span>: <span class=\\"token string\\">&quot;600dc3b5d617e547a0e74cb9&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"name\\"</span>: <span class=\\"token string\\">&quot;Mitchell Fitzgerald&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"about\\"</span>: <span class=\\"token string\\">&quot;lorem ipsum&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"address\\"</span>: <span class=\\"token string\\">&quot;48 Avenue, City, North&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"company\\"</span>: <span class=\\"token string\\">&quot;Test&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"bio\\"</span>: <span class=\\"token keyword\\">null</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"nicknames\\"</span>: <button class=\\"collapser\\" aria-label=\\"collapse\\"></button><span class=\\"token punctuation\\">[</span><span class=\\"ellipsis\\"></span><ul class=\\"array collapsible\\"><li><div class=\\"hoverable \\"><span class=\\"token string\\">&quot;Mitch&quot;</span>,</div></li><li><div class=\\"hoverable \\"><span class=\\"token string\\">&quot;Fitz&quot;</span>,</div></li><li><div class=\\"hoverable \\"><button class=\\"collapser\\" aria-label=\\"collapse\\"></button><span class=\\"token punctuation\\">{</span><span class=\\"ellipsis\\"></span><ul class=\\"obj collapsible\\"><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"title\\"</span>: <span class=\\"token string\\">&quot;MitFitz&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"createdAt\\"</span>: <span class=\\"token string\\">&quot;2022-04-19T11:46:00.019Z&quot;</span></div></li></ul><span class=\\"token punctuation\\">}</span></div></li></ul><span class=\\"token punctuation\\">]</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"age\\"</span>: <span class=\\"token number\\">27</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"isBanned\\"</span>: <span class=\\"token boolean\\">true</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"link\\"</span>: <span class=\\"token string\\">&quot;</span><a href=\\"https://google.com\\">https://google.com</a><span class=\\"token string\\">&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"emptyArray\\"</span>: <span class=\\"token punctuation\\">[ ]</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"empty\\"</span>: <span class=\\"token punctuation\\">{ }</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"contacts\\"</span>: <button class=\\"collapser\\" aria-label=\\"collapse\\"></button><span class=\\"token punctuation\\">{</span><span class=\\"ellipsis\\"></span><ul class=\\"obj collapsible\\"><li><div class=\\"hoverable \\"><span class=\\"property token string\\">\\"phone\\"</span>: <button class=\\"collapser\\" aria-label=\\"collapse\\"></button><span class=\\"token punctuation\\">{</span><span class=\\"ellipsis\\"></span><ul class=\\"obj collapsible\\"><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"code\\"</span>: <span class=\\"token string\\">&quot;+1&quot;</span><span class=\\"token punctuation\\">,</span></div></li><li><div class=\\"hoverable collapsed\\"><span class=\\"property token string\\">\\"rest\\"</span>: <span class=\\"token string\\">&quot;999&quot;</span></div></li></ul><span class=\\"token punctuation\\">}</span></div></li></ul><span class=\\"token punctuation\\">}</span></div></li></ul><span class=\\"token punctuation\\">}</span></code></div>"`;
@@ -1,20 +0,0 @@
1
- import { getCssColorVariable } from '@theme/utils';
2
-
3
- describe('css-variables', () => {
4
- afterEach(() => {
5
- document.documentElement.removeAttribute('style');
6
- });
7
-
8
- describe('getCssColorVariable', () => {
9
- it('should return variable', () => {
10
- expect(getCssColorVariable('--test')).toBe('var(--test)');
11
- });
12
- it('should return color', () => {
13
- expect(getCssColorVariable('#ffffff')).toBe('#ffffff');
14
- });
15
- it('should return defaultValue', () => {
16
- expect(getCssColorVariable('')).toBe('inherit');
17
- expect(getCssColorVariable('', '#000000')).toBe('#000000');
18
- });
19
- });
20
- });
@@ -1,51 +0,0 @@
1
- import * as Prism from 'prismjs';
2
-
3
- import { highlight, mapLang } from '@theme/utils';
4
-
5
- jest.mock('prismjs', () => {
6
- const original = jest.requireActual('prismjs');
7
- return {
8
- __isModule: true,
9
- ...original,
10
- highlight: jest.fn().mockImplementation((...args) => {
11
- return original.highlight(...args);
12
- }),
13
- };
14
- });
15
-
16
- describe('highlight', () => {
17
- beforeEach(() => {
18
- jest.clearAllMocks();
19
- });
20
-
21
- it('should work with correct lang name', () => {
22
- const highlighted = highlight('int name = "John"', 'cpp');
23
-
24
- expect(highlighted).toMatchSnapshot();
25
- });
26
-
27
- it('should work with mapped lang name', () => {
28
- const highlighted = highlight('int name = "John"', 'c++');
29
-
30
- expect(highlighted).toMatchSnapshot();
31
- });
32
-
33
- it('should have default value for lang', () => {
34
- const highlightSpy = jest.spyOn(Prism, 'highlight');
35
-
36
- highlight('i++');
37
-
38
- expect(highlightSpy).toBeCalledTimes(1);
39
- expect(highlightSpy).toBeCalledWith('i++', expect.any(Object), 'clike');
40
- });
41
-
42
- describe('mapLang', () => {
43
- it('should work with known lang', () => {
44
- expect(mapLang('node.js')).toBe('js');
45
- });
46
-
47
- it('should work with unknown lang', () => {
48
- expect(mapLang('ada')).toBe('clike');
49
- });
50
- });
51
- });
@@ -1,40 +0,0 @@
1
- import { jsonToHTML } from '@theme/utils';
2
-
3
- const data = {
4
- id: '600dc3b5d617e547a0e74cb9',
5
- name: 'Mitchell Fitzgerald',
6
- about: 'lorem ipsum',
7
- address: '48 Avenue, City, North',
8
- company: 'Test',
9
- bio: null,
10
- nicknames: [
11
- 'Mitch',
12
- 'Fitz',
13
- { title: 'MitFitz', createdAt: new Date('2022-04-19T11:46:00.019Z') },
14
- ],
15
- age: 27,
16
- isBanned: true,
17
- link: 'https://google.com',
18
- emptyArray: [],
19
- empty: {},
20
- contacts: {
21
- phone: {
22
- code: '+1',
23
- rest: '999',
24
- },
25
- },
26
- };
27
-
28
- describe('jsonToHTML', () => {
29
- it('should work with maxExpandLevel 1', () => {
30
- const result = jsonToHTML(data, 1);
31
-
32
- expect(result).toMatchSnapshot();
33
- });
34
-
35
- it('should work with maxExpandLevel 3', () => {
36
- const result = jsonToHTML(data, 3);
37
-
38
- expect(result).toMatchSnapshot();
39
- });
40
- });
@@ -1,20 +0,0 @@
1
- import { generateMediaQueries } from '@theme/utils';
2
-
3
- describe('media-css helpers', () => {
4
- describe('generateMediaQueries function', () => {
5
- it('generate media queries according to breakpoints', () => {
6
- expect(
7
- generateMediaQueries({
8
- small: '50rem',
9
- medium: '85rem',
10
- large: '105rem',
11
- }),
12
- ).toEqual({
13
- large: '@media screen and (min-width: 105rem)',
14
- medium: '@media screen and (min-width: 85rem)',
15
- print: '@media print',
16
- small: '@media screen and (min-width: 50rem)',
17
- });
18
- });
19
- });
20
- });
@@ -1,25 +0,0 @@
1
- import { getTypographyCssRulesByComponentName } from '@theme/utils';
2
-
3
- describe('getTypographyCssRulesByComponentName', () => {
4
- it('should return object with defined css variable for component', () => {
5
- expect(getTypographyCssRulesByComponentName('component')).toEqual({
6
- fontSize: 'var(--component-font-size)',
7
- fontWeight: 'var(--component-font-weight)',
8
- fontFamily: 'var(--component-font-family)',
9
- lineHeight: 'var(--component-line-height)',
10
- color: 'var(--component-color)',
11
- textTransform: 'var(--component-text-transform)',
12
- });
13
- });
14
-
15
- it('should return object with fallback', () => {
16
- expect(getTypographyCssRulesByComponentName('component', 'component1')).toEqual({
17
- fontSize: 'var(--component-font-size,var(--component1-font-size))',
18
- fontWeight: 'var(--component-font-weight,var(--component1-font-weight))',
19
- fontFamily: 'var(--component-font-family,var(--component1-font-family))',
20
- lineHeight: 'var(--component-line-height,var(--component1-line-height))',
21
- color: 'var(--component-color,var(--component1-color))',
22
- textTransform: 'var(--component-text-transform,var(--component1-text-transform))',
23
- });
24
- });
25
- });