@redocly/theme 0.0.1 → 0.1.2

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 (54) hide show
  1. package/{lib/src/index.ts → index.js} +0 -0
  2. package/package.json +1 -2
  3. package/LICENSE +0 -1
  4. package/lib/package.json +0 -91
  5. package/lib/src/Button/Button.tsx +0 -122
  6. package/lib/src/Button/index.ts +0 -1
  7. package/lib/src/CodeBlock/CodeBlock.ts +0 -125
  8. package/lib/src/CodeBlock/index.ts +0 -1
  9. package/lib/src/CopyButton/CopyButton.tsx +0 -26
  10. package/lib/src/CopyButton/CopyButtonWrapper.tsx +0 -52
  11. package/lib/src/CopyButton/index.ts +0 -2
  12. package/lib/src/Headings/Headings.ts +0 -23
  13. package/lib/src/Headings/index.ts +0 -1
  14. package/lib/src/JsonViewer/JsonViewer.tsx +0 -130
  15. package/lib/src/JsonViewer/index.ts +0 -1
  16. package/lib/src/JsonViewer/styled.ts +0 -103
  17. package/lib/src/Logo/Logo.tsx +0 -23
  18. package/lib/src/Navbar/Navbar.tsx +0 -60
  19. package/lib/src/Navbar/NavbarItem.tsx +0 -90
  20. package/lib/src/Navbar/NavbarMenu.tsx +0 -29
  21. package/lib/src/Panel/CodePanel.ts +0 -31
  22. package/lib/src/Panel/ContentPanel.ts +0 -43
  23. package/lib/src/Panel/DarkHeader.ts +0 -8
  24. package/lib/src/Panel/Panel.ts +0 -18
  25. package/lib/src/Panel/PanelBody.ts +0 -30
  26. package/lib/src/Panel/PanelComponent.tsx +0 -73
  27. package/lib/src/Panel/PanelHeader.ts +0 -25
  28. package/lib/src/Panel/PanelHeaderTitle.ts +0 -11
  29. package/lib/src/Panel/index.ts +0 -7
  30. package/lib/src/SamplesPanelControls/SamplesPanelControls.ts +0 -70
  31. package/lib/src/SamplesPanelControls/index.ts +0 -1
  32. package/lib/src/SidebarLogo/SidebarLogo.tsx +0 -47
  33. package/lib/src/SidebarLogo/index.ts +0 -1
  34. package/lib/src/SourceCode/SourceCode.tsx +0 -67
  35. package/lib/src/SourceCode/index.ts +0 -1
  36. package/lib/src/Tooltip/Tooltip.tsx +0 -171
  37. package/lib/src/Tooltip/index.ts +0 -1
  38. package/lib/src/globalStyle.ts +0 -512
  39. package/lib/src/hooks/index.ts +0 -3
  40. package/lib/src/hooks/useControl.ts +0 -20
  41. package/lib/src/hooks/useMount.ts +0 -8
  42. package/lib/src/hooks/useUnmount.ts +0 -10
  43. package/lib/src/icons/ShelfIcon/ShelfIcon.tsx +0 -45
  44. package/lib/src/icons/ShelfIcon/index.ts +0 -2
  45. package/lib/src/icons/index.ts +0 -1
  46. package/lib/src/mocks/Link.tsx +0 -7
  47. package/lib/src/mocks/utils.ts +0 -3
  48. package/lib/src/utils/ClipboardService.ts +0 -92
  49. package/lib/src/utils/css-variables.ts +0 -2
  50. package/lib/src/utils/highlight.ts +0 -81
  51. package/lib/src/utils/index.ts +0 -6
  52. package/lib/src/utils/jsonToHtml.ts +0 -122
  53. package/lib/src/utils/media-css.ts +0 -16
  54. package/lib/src/utils/theme-helpers.ts +0 -34
@@ -1,512 +0,0 @@
1
- import { createGlobalStyle } from 'styled-components';
2
-
3
- export const GlobalStyle = createGlobalStyle`
4
- /*
5
- * Static classnames that can be used to override styles for components:
6
- * download-specification-button, next-section-button, button-base
7
- */
8
- :root {
9
- /* === Palette === */
10
-
11
- /*
12
- * Color palette
13
- */
14
- --color-primary-100: #62a1ff;
15
- --color-primary-200: #4892ff;
16
- --color-primary-300: #2f83ff;
17
- --color-primary-400: #1573ff;
18
- --color-primary-500: #0065fb;
19
- --color-primary-600: #005be2;
20
- --color-primary-700: #0050c8;
21
- --color-primary-800: #0046af;
22
- --color-primary-900: #003c95;
23
-
24
- --color-secondary-100: #ffffff;
25
- --color-secondary-200: #f5f7fa;
26
- --color-secondary-300: #f3f4f6;
27
- --color-secondary-400: #e4e7eb;
28
- --color-secondary-500: #d5dae0;
29
- --color-secondary-600: #c7cdd5;
30
- --color-secondary-700: #b8c0ca;
31
- --color-secondary-800: #a9b3c0;
32
- --color-secondary-900: #9ba6b5;
33
-
34
- --color-emphasis-100: #ffffff;
35
- --color-emphasis-200: #e9eaec;
36
- --color-emphasis-300: #cdd0d5;
37
- --color-emphasis-400: #b2b6bd;
38
- --color-emphasis-500: #969ca6;
39
- --color-emphasis-600: #7a828f;
40
- --color-emphasis-700: #626974;
41
- --color-emphasis-800: #4b5058;
42
- --color-emphasis-900: #1c1e21;
43
-
44
- --color-accent-100: #b3dcf3;
45
- --color-accent-200: #a6dfff;
46
- --color-accent-300: #8cd5ff;
47
- --color-accent-400: #73ccff;
48
- --color-accent-500: #59c3ff;
49
- --color-accent-600: #40baff;
50
- --color-accent-700: #26b1ff;
51
- --color-accent-800: #0da7ff;
52
- --color-accent-900: #009bf2;
53
-
54
- --color-success-100: #98eda0;
55
- --color-success-200: #82e98c;
56
- --color-success-300: #6ce678;
57
- --color-success-400: #57e264;
58
- --color-success-500: #41de50;
59
- --color-success-600: #2bda3c;
60
- --color-success-700: #23c933;
61
- --color-success-800: #1fb32d;
62
- --color-success-900: #1b9e28;
63
-
64
- --color-warning-100: #ffc966;
65
- --color-warning-200: #ffc04d;
66
- --color-warning-300: #ffb733;
67
- --color-warning-400: #ffae1a;
68
- --color-warning-500: #ffa500;
69
- --color-warning-600: #e69400;
70
- --color-warning-700: #cc8400;
71
- --color-warning-800: #b37300;
72
- --color-warning-900: #996300;
73
-
74
- --color-error-100: #ffc7c7;
75
- --color-error-200: #ffaeae;
76
- --color-error-300: #ff9494;
77
- --color-error-400: #ff7b7b;
78
- --color-error-500: #ff6161;
79
- --color-error-600: #ff4747;
80
- --color-error-700: #ff2e2e;
81
- --color-error-800: #ff1414;
82
- --color-error-900: #ff0000;
83
-
84
- /* === Typography === */
85
-
86
- --color-content: #1f2933;
87
- --color-content-inverse: var(--color-secondary-200);
88
- --color-content-secondary: #7b8794;
89
-
90
- --font-size-base: 14px;
91
- --line-height-base: 1.5em;
92
- --font-weight-regular: 400;
93
- --font-weight-bold: 600;
94
- --font-weight-bolder: 700;
95
- --font-family-base: Source Sans Pro, sans-serif;
96
- --font-family-monospaced: Source Code Pro, monospace;
97
-
98
- --smoothing: antialiased; // text-smoothing
99
- --text-rendering: optimizeSpeed; // text-rendering
100
-
101
- /*
102
- * Spacing
103
- */
104
- --spacing-unit: 5px;
105
- --spacing-horizontal: calc(var(--spacing-unit) * 8);
106
- --spacing-vertical: calc(var(--spacing-unit) * 4);
107
-
108
- /*
109
- * Global
110
- */
111
- --global-border-radius: 4px;
112
- --global-border-width: 1px;
113
- --global-border-color: var(--color-secondary-400);
114
- --global-border-color-secondary: #616e7c;
115
- --global-background-color: transparent;
116
-
117
- /* === Page layout === */
118
- //TBD
119
- /* === Navbar === */
120
- //--navbar-height:
121
- //TBD
122
-
123
- /* === Menu (sidebar) === */
124
-
125
- --sidebar-width: 285px;
126
- --sidebar-background-color: #fff;
127
- --sidebar-right-line-color: var(--global-border-color);
128
- --sidebar-spacing-unit: 8px;
129
- --sidebar-spacing-horizontal: var(--sidebar-spacing-unit);
130
- --sidebar-spacing-vertical: var(--sidebar-spacing-unit);
131
-
132
- --sidebar-word-break: 'inherit';
133
- --sidebar-separator-label-color: var(--sidebar-item-color);
134
- --sidebar-separator-line-color: #dadada;
135
- --sidebar-chevron-color: var(--sidebar-item-color);
136
- --sidebar-chevron-size: var(--sidebar-spacing-unit);
137
-
138
- --sidebar-item-spacing-offset-top: calc(var(--sidebar-spacing-unit) * 2);
139
- --sidebar-item-spacing-offset-left: calc(var(--sidebar-spacing-unit) * 2);
140
- --sidebar-item-spacing-offset-nesting: calc(var(--sidebar-spacing-unit) * 2);
141
- --sidebar-item-border-radius: 4px;
142
- --sidebar-item-font-family: var(--font-family-base);
143
- --sidebar-item-font-size: var(--font-size-base);
144
- --sidebar-item-color: var(--color-content);
145
- --sidebar-item-active-color: var(--color-content);
146
- --sidebar-item-background-color: #fff;
147
- --sidebar-item-active-background-color: var(--global-border-color);
148
-
149
- //TBD
150
- /* === Footer === */
151
- //TBD
152
- /* === Table of contents === */
153
- //TBD
154
- /* === Various components: buttons, inputs, alerts, tooltip === */
155
-
156
- /*
157
- * Buttons
158
- */
159
- --button-color: white;
160
- --button-background-color: var(--color-emphasis-500);
161
- --button-hover-background-color: var(--color-emphasis-600);
162
- --button-active-background-color: var(--color-emphasis-700);
163
- --button-outlined-active-border-color: var(--color-emphasis-800);
164
- --button-border-radius: var(--global-border-radius);
165
- --button-font-family: inherit;
166
- --button-font-weight: var(--font-weight-bold);
167
- --button-box-shadow: none;
168
- --button-active-box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.1);
169
-
170
- .button-color-primary {
171
- --button-color: white;
172
- --button-background-color: var(--color-primary-500);
173
- --button-hover-background-color: var(--color-primary-600);
174
- --button-active-background-color: var(--color-primary-700);
175
- --button-outlined-active-border-color: var(--color-primary-800);
176
- }
177
-
178
- .button-color-secondary {
179
- --button-color: var(--color-emphasis-800);
180
- --button-background-color: var(--color-secondary-400);
181
- --button-hover-background-color: var(--color-secondary-500);
182
- --button-active-background-color: var(--color-secondary-600);
183
- --button-outlined-active-border-color: var(--color-secondary-700);
184
- }
185
-
186
- --button-small-font-size: 12px;
187
- --button-small-padding: 8px 10px;
188
- --button-small-min-width: 90px;
189
- --button-medium-font-size: 14px;
190
- --button-medium-padding: 8px 20px;
191
- --button-medium-min-width: 120px;
192
- --button-large-font-size: 14px;
193
- --button-large-padding: 12px 24px;
194
- --button-large-min-width: 150px;
195
- --button-xlarge-font-size: 16px;
196
- --button-xlarge-padding: 20px 24px;
197
- --button-xlarge-min-width: 200px;
198
-
199
- /*
200
- * Tooltip
201
- */
202
- --tooltip-color: var(--color-secondary-300);
203
- --tooltip-background-color: #52606d;
204
-
205
- .tooltip-copy-button {
206
- --tooltip-color: #000;
207
- --tooltip-background-color: #fff;
208
- }
209
-
210
- /* === Markdown/Page content (tables, inline code, blockquotes) === */
211
-
212
- /*
213
- * Headings
214
- * --h-{css-property-name} is fallback for h1...h6
215
- */
216
- --h-font-family: Source Sans Pro, sans-serif;
217
- --h-font-weight: var(--font-weight-bolder);
218
- --h-color: var(--color-content);
219
-
220
- --h1-font-size: 36px;
221
- --h2-font-size: 28px;
222
- --h3-font-size: 18px;
223
- --h4-font-size: 16px;
224
- --h5-font-size: 14px;
225
- --h6-font-size: 12px;
226
-
227
- --h1-line-height: 36px;
228
- --h2-line-height: 28px;
229
- --h3-line-height: 18px;
230
- --h4-line-height: 16px;
231
- --h5-line-height: 14px;
232
- --h6-line-height: 12px;
233
-
234
- --code-font-size: 13px;
235
- --code-font-family: var(--font-family-monospaced);
236
- --code-font-weight: 400;
237
- --code-wrap: pre;
238
-
239
- --inline-code-font-size: var(--code-font-size);
240
- --inline-code-font-family: var(--code-font-family);
241
- --inline-code-color: #e53935;
242
- --inline-code-background-color: var(--color-secondary-200);
243
- --inline-code-border-color: var(--global-border-color);
244
- --inline-code-border-radius: var(--global-border-radius);
245
-
246
- --code-block-font-size: var(--code-font-size);
247
- --code-block-font-family: var(--code-font-family);
248
- --code-block-color: #f1928f;
249
- --code-block-background-color: rgba(217, 205, 199, 0.05);
250
- --code-block-border-color: var(--global-border-color);
251
- --code-block-border-radius: 8px;
252
- --code-block-max-height: 600px;
253
- --code-block-word-break: initial;
254
- --code-block-preformatted-background-color: #323f4b;
255
-
256
- /*
257
- * Links
258
- */
259
- --link-color: var(--color-primary-500);
260
- --link-decoration: none;
261
- --link-hover-color: var(--color-primary-100);
262
- --link-hover-decoration: underline;
263
-
264
- /* === ref docs and graphql docs specific === */
265
- /*
266
- * Logo
267
- */
268
- --logo-max-height: 285px;
269
- --logo-max-width: 285px;
270
- --logo-padding: 2px;
271
-
272
- /*
273
- * Http colors
274
- */
275
- --color-http-get: #3a9601;
276
- --color-http-post: #0065fb;
277
- --color-http-put: #93527b;
278
- --color-http-options: #947014;
279
- --color-http-patch: #bf581d;
280
- --color-http-delete: #c83637;
281
- --color-http-basic: #707070;
282
- --color-http-link: #07818f;
283
- --color-http-head: #a23dad;
284
- --color-http-hook: var(--color-http-post);
285
-
286
- /*
287
- * Response colors
288
- */
289
- --response-success-border-color: #b1e996;
290
- --response-success-background-color: #f6fff4;
291
- --response-success-text-color: var(--response-success-border-color);
292
-
293
- --response-error-border-color: #ffc9c9;
294
- --response-error-background-color: #fff4f4;
295
- --response-error-text-color: var(--response-error-border-color);
296
-
297
- --response-redirect-border-color: var(--color-warning-500);
298
- --response-redirect-background-color: #ffa5001a;
299
- --response-redirect-text-color: var(--response-redirect-border-color);
300
-
301
- --response-info-border-color: #87ceeb;
302
- --response-info-background-color: #87ceeb1a;
303
- --response-info-text-color: var(--response-info-border-color);
304
-
305
- /*
306
- * Panels
307
- */
308
- --panels-border-radius: 8px;
309
- --panels-background-color: #fff;
310
-
311
- --samples-panel-gap: 20px;
312
- --samples-panel-width: 37.5%;
313
- --samples-panel-block-background-color: #fff;
314
- --samples-panel-background-color: #52606d;
315
- --samples-panel-callback-background-color: var(--samples-panel-callback-background-color);
316
- --samples-panel-controls-background-color: #323f4b;
317
- --samples-panel-controls-hover-background-color: #3c4c5a;
318
- --samples-panel-controls-active-border-color: var(--color-accent-500);
319
- --samples-panel-text-color: #fff;
320
- --samples-panel-heading-color: #fff;
321
-
322
- --samples-panel-markdown-background-color: #3c4c5a;
323
- --samples-panel-markdown-border-color: #46596a;
324
-
325
- --try-it-panel-tab-background-color: var(--samples-panel-background-color);
326
- --try-it-panel-active-tab-background-color: #47535e;
327
- --try-it-panel-active-tab-border-color: var(--color-accent-500);
328
- --try-it-panel-disabled-tab-color: rgba(245, 247, 250, 0.7);
329
- --try-it-panel-controls-background-color: var(--samples-panel-controls-background-color);
330
- --try-it-panel-action-button-width: auto;
331
-
332
- --request-and-response-panel-background-color: #fff;
333
-
334
- /*
335
- * Layout
336
- */
337
- --layout-buttons-top-offset: 20px;
338
- --layout-buttons-height: 36px;
339
- --layout-buttons-width: 36px;
340
-
341
- --layout-stacked-small-max-width: 90%;
342
- --layout-stacked-medium-max-width: 75%;
343
- --layout-stacked-large-max-width: 1200px;
344
-
345
- --layout-three-panel-small-max-width: 100%;
346
- --layout-three-panel-medium-max-width: 100%;
347
- --layout-three-panel-large-max-width: 1800px;
348
-
349
- --layout-middle-panel-small-max-width: none;
350
- --layout-middle-panel-medium-max-width: none;
351
- --layout-middle-panel-large-max-width: none;
352
-
353
- /*
354
- * Schema
355
- */
356
- --schema-lines-color: var(--global-border-color);
357
- --schema-default-details-width: 70%;
358
- --schema-type-name-color: var(--color-content-secondary);
359
- --schema-type-title-color: var(--color-content-secondary);
360
- --schema-require-label-color: var(--color-error-900);
361
- --schema-labels-text-size: 0.9em;
362
- --schema-nesting-spacing: 1em;
363
- --schema-nested-background-color: var(--color-secondary-200);
364
- --schema-chevron-color: var(--color-content);
365
- --schema-chevron-size: 9px;
366
-
367
- --schema-controls-color: var(--color-emphasis-800);
368
- --schema-controls-background-color: var(--color-secondary-400);
369
- --schema-controls-hover-background-color: var(--color-secondary-500);
370
- --schema-controls-border-color: var(--color-secondary-600);
371
-
372
- --field-name-font-size: var(--code-font-size);
373
- --field-name-font-family: var(--code-font-family);
374
- --field-enum-background-color: var(--inline-code-background-color);
375
- --field-constraint-background-color: var(--inline-code-background-color);
376
-
377
- /*
378
- * Search
379
- */
380
- --search-input-border-bottom: #e6e6e6;
381
- --search-results-background-color: #f2f2f2;
382
- --search-results-active-item-background-color: #e6e6e6;
383
- --search-marked-background-color: #ffff03;
384
- --search-popup-header-background-color: var(--color-secondary-200);
385
- --search-clear-button-background-color: var(--color-secondary-400);
386
- --search-clear-button-hover-background-color: var(--color-secondary-600);
387
-
388
- /*
389
- * Other
390
- */
391
- --badge-color: var(--color-emphasis-100);
392
- --badge-background-color: var(--color-primary-500);
393
- --deprecated-badge-color: var(--color-emphasis-100);
394
- --deprecated-badge-background-color: var(--color-warning-500);
395
-
396
- --recursive-label-color: var(--color-warning-500);
397
-
398
- --http-badge-font-size: 12px;
399
- --http-badge-line-height: 20px;
400
- --http-badge-font-family: var(--code-font-family);
401
- --http-badge-font-weight: var(--font-weight-bold);
402
- --http-badge-border-radius: 16px;
403
- --http-badge-color: var(--color-content-inverse);
404
-
405
- --http-badge-menu-font-size: 8px;
406
- --http-badge-menu-line-height: 14px;
407
-
408
- --spinner-color: var(--color-primary-500);
409
-
410
- --linear-progress-color: var(--color-accent-500);
411
- --linear-progress-background-color: var(--color-accent-100);
412
-
413
- /* Floating action button */
414
- --fab-color: #0065FB;
415
- --fab-background-color: #f2f2f2;
416
-
417
-
418
- /**
419
- * Sidebar
420
- * */
421
- --sidebar-spacing-unit: 8px;
422
- --sidebar-margin-left: calc(var(--sidebar-spacing-unit) * 2);
423
- --sidebar-padding-horizontal: var(--sidebar-spacing-unit);
424
- --sidebar-padding-vertical: var(--sidebar-spacing-unit);
425
-
426
- --sidebar-spacing-padding-vertical: var(--sidebar-spacing-unit);
427
- --sidebar-spacing-padding-horizontal: var(--sidebar-spacing-unit);
428
- --sidebar-spacing-offset-top: calc(var(--sidebar-spacing-unit) * 2);
429
- --sidebar-spacing-offset-left: calc(var(--sidebar-spacing-unit) * 2);
430
- --sidebar-spacing-offset-nesting: calc(var(--sidebar-spacing-unit) * 2);
431
-
432
- --sidebar-chevron-size: var(--sidebar-spacing-unit);
433
- --sidebar-chevron-color: var(--sidebar-text-color);
434
-
435
- --sidebar-border-radius: 4px;
436
- --sidebar-background-color: #fff;
437
- --sidebar-font-size: var(--font-size-base);
438
- --sidebar-font-family: var(--font-family-primary);
439
- --sidebar-right-line-color: var(--color-border-light);
440
- --sidebar-text-color: var(--color-text-main);
441
- --sidebar-text-active-color: var(--sidebar-text-color);
442
- --sidebar-text-active-background-color: var(--color-border-light);
443
- --sidebar-width: 285px;
444
-
445
- --sidebar-separator-line-color: #dadada;
446
- --sidebar-separator-label-color: var(--sidebar-text-color);
447
-
448
- /**
449
- * Portal Logo
450
- * */
451
- --logo-height: 2rem;
452
- --logo-margin: var(--sidebar-margin-left);
453
-
454
- /**
455
- * Portal Navbar
456
- * */
457
- --navbar-height: 60px;
458
- --navbar-color-text: var(--color-content-inverse);
459
- --navbar-color-background: var(--color-primary-500);
460
-
461
- /**
462
- * Portal Navbar Item
463
- * */
464
- --navbar-item-font-size: 16px;
465
- --navbar-item-margin-horizontal: 0;
466
- --navbar-item-margin-vertical: 0;
467
- --navbar-item-border-radius: 10px;
468
- --navbar-item-font-weight: var(--font-weight-bold);
469
- --navbar-item-active-background-color: #1b75fa;
470
- --navbar-item-active-text-color: var(--color-primary-contrast);
471
- --navbar-item-active-text-decoration: none;
472
- }
473
-
474
- @media (prefers-color-scheme: dark) {
475
- :root {
476
- --color-content: #f5f7fa;
477
- --global-border-color: #4c4c4c;
478
- --inline-code-color: #ed8282;
479
- --schema-require-label-color: #e55252;
480
- --global-background-color: #101010;
481
- --sidebar-background-color: #101010;
482
- --sidebar-item-active-background-color: #424242;
483
- --samples-panel-block-background-color: var(--sidebar-background-color);
484
- --color-secondary-200: #1f2933;
485
- --color-primary-900: #4892ff;
486
- --search-marked-background-color: #707000;
487
-
488
- --response-success-border-color: #3c8d06;
489
- --response-success-background-color: #2e7102;
490
- --response-error-border-color: #8d5c5c;
491
- --response-error-background-color: #802828;
492
- --response-redirect-border-color: #ffa500;
493
- --response-redirect-background-color: #ffa5001a;
494
- --response-info-border-color: #87ceeb;
495
- --response-info-background-color: #87ceeb1a;
496
-
497
- --link-color: #4d91ff;
498
- --link-hover-color: #3686ff;
499
-
500
- --navbar-color-background: #f2f2f2;
501
-
502
- .search-input {
503
- color: var(--color-content);
504
- }
505
-
506
- .button-clear {
507
- --color-secondary-600: #3e4c59;
508
- --color-secondary-400: #1b1b1b;
509
- }
510
- }
511
- }
512
- `;
@@ -1,3 +0,0 @@
1
- export * from './useControl';
2
- export * from './useMount';
3
- export * from './useUnmount';
@@ -1,20 +0,0 @@
1
- import { useState, useCallback } from 'react';
2
-
3
- export type UseControlReturnType = {
4
- isOpened: boolean;
5
- handleOpen: () => void;
6
- handleClose: () => void;
7
- };
8
-
9
- export const useControl = (initialVal = false): UseControlReturnType => {
10
- const [isOpened, setIsOpened] = useState<boolean>(initialVal);
11
-
12
- const handleOpen = useCallback(() => setIsOpened(true), []);
13
- const handleClose = useCallback(() => setIsOpened(false), []);
14
-
15
- return {
16
- isOpened,
17
- handleOpen,
18
- handleClose,
19
- };
20
- };
@@ -1,8 +0,0 @@
1
- import { useEffect } from 'react';
2
-
3
- export const useMount = (callback: () => void): void => {
4
- useEffect(() => {
5
- callback();
6
- // eslint-disable-next-line react-hooks/exhaustive-deps
7
- }, []);
8
- };
@@ -1,10 +0,0 @@
1
- import { useEffect } from 'react';
2
-
3
- export const useUnmount = (callback: () => void): void => {
4
- useEffect(() => {
5
- return () => {
6
- callback();
7
- };
8
- // eslint-disable-next-line react-hooks/exhaustive-deps
9
- }, []);
10
- };
@@ -1,45 +0,0 @@
1
- import * as React from 'react';
2
- import styled, { css } from 'styled-components';
3
-
4
- import { getCssColorVariable } from '../../utils/css-variables';
5
-
6
- const directionMap = {
7
- right: '0deg',
8
- down: '90deg',
9
- left: '180deg',
10
- up: '270deg',
11
- };
12
-
13
- export interface ShelfIconProps {
14
- className?: string;
15
- float?: 'left' | 'right';
16
- size?: string;
17
- color?: string;
18
- direction: 'left' | 'right' | 'up' | 'down';
19
- style?: React.CSSProperties;
20
- }
21
-
22
- const IntShelfIcon = ({ className, style }: ShelfIconProps): JSX.Element => (
23
- <svg
24
- className={className}
25
- style={style}
26
- viewBox="0 0 4.25 7"
27
- xmlns="http://www.w3.org/2000/svg"
28
- aria-hidden="true"
29
- >
30
- <path 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" />
31
- <path 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" />
32
- </svg>
33
- );
34
-
35
- export const ShelfIcon = styled(IntShelfIcon)`
36
- ${({ size = '9px', float = '', direction, color }) => css`
37
- height: ${size};
38
- width: ${size};
39
- float: ${float};
40
- transform: rotateZ(${directionMap[direction]});
41
- fill: ${getCssColorVariable(color)};
42
- `}
43
- vertical-align: middle;
44
- transition: transform 0.2s ease-out;
45
- `;
@@ -1,2 +0,0 @@
1
- export { ShelfIcon } from './ShelfIcon';
2
- export type { ShelfIconProps } from './ShelfIcon';
@@ -1 +0,0 @@
1
- export * from './ShelfIcon';
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
-
3
- // TODO: use real typings here
4
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
5
- export function Link(props: any): JSX.Element {
6
- return <a href={props.to} {...props} />;
7
- }
@@ -1,3 +0,0 @@
1
- export function withPathPrefix(link: string): string {
2
- return link;
3
- }