doccupine 0.0.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/dist/index.d.ts +1 -0
- package/dist/index.js +526 -0
- package/dist/templates/click-outside.d.ts +1 -0
- package/dist/templates/click-outside.js +28 -0
- package/dist/templates/code.d.ts +1 -0
- package/dist/templates/code.js +192 -0
- package/dist/templates/components/ClickOutside.d.ts +1 -0
- package/dist/templates/components/ClickOutside.js +27 -0
- package/dist/templates/components/Docs.d.ts +1 -0
- package/dist/templates/components/Docs.js +52 -0
- package/dist/templates/components/SideBar.d.ts +1 -0
- package/dist/templates/components/SideBar.js +80 -0
- package/dist/templates/components/layout/Code.d.ts +1 -0
- package/dist/templates/components/layout/Code.js +192 -0
- package/dist/templates/components/layout/DocsComponents.d.ts +1 -0
- package/dist/templates/components/layout/DocsComponents.js +444 -0
- package/dist/templates/components/layout/Footer.d.ts +1 -0
- package/dist/templates/components/layout/Footer.js +8 -0
- package/dist/templates/components/layout/Header.d.ts +1 -0
- package/dist/templates/components/layout/Header.js +280 -0
- package/dist/templates/components/layout/Icon.d.ts +1 -0
- package/dist/templates/components/layout/Icon.js +19 -0
- package/dist/templates/components/layout/Pictograms.d.ts +1 -0
- package/dist/templates/components/layout/Pictograms.js +66 -0
- package/dist/templates/components/layout/SharedStyles.d.ts +1 -0
- package/dist/templates/components/layout/SharedStyles.js +791 -0
- package/dist/templates/components/layout/ThemeToggle.d.ts +1 -0
- package/dist/templates/components/layout/ThemeToggle.js +123 -0
- package/dist/templates/components/layout/Typography.d.ts +1 -0
- package/dist/templates/components/layout/Typography.js +51 -0
- package/dist/templates/docs-components.d.ts +1 -0
- package/dist/templates/docs-components.js +441 -0
- package/dist/templates/docs.d.ts +1 -0
- package/dist/templates/docs.js +48 -0
- package/dist/templates/footer.d.ts +1 -0
- package/dist/templates/footer.js +9 -0
- package/dist/templates/header.d.ts +1 -0
- package/dist/templates/header.js +275 -0
- package/dist/templates/home.d.ts +1 -0
- package/dist/templates/home.js +80 -0
- package/dist/templates/icon.d.ts +1 -0
- package/dist/templates/icon.js +20 -0
- package/dist/templates/layout.d.ts +1 -0
- package/dist/templates/layout.js +66 -0
- package/dist/templates/not-found.d.ts +1 -0
- package/dist/templates/not-found.js +22 -0
- package/dist/templates/pictograms.d.ts +1 -0
- package/dist/templates/pictograms.js +67 -0
- package/dist/templates/shared-styles.d.ts +1 -0
- package/dist/templates/shared-styles.js +792 -0
- package/dist/templates/theme-toggle.d.ts +1 -0
- package/dist/templates/theme-toggle.js +111 -0
- package/dist/templates/theme.d.ts +1 -0
- package/dist/templates/theme.js +291 -0
- package/dist/templates/typography.d.ts +1 -0
- package/dist/templates/typography.js +52 -0
- package/dist/templates/utils/orderNavItems.d.ts +1 -0
- package/dist/templates/utils/orderNavItems.js +45 -0
- package/package.json +44 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
export const docsComponentsTemplate = `"use client";
|
|
2
|
+
import { mq, Theme } from "@/app/theme";
|
|
3
|
+
import {
|
|
4
|
+
resetButton,
|
|
5
|
+
styledStrong,
|
|
6
|
+
styledText,
|
|
7
|
+
} from "cherry-styled-components/src/lib";
|
|
8
|
+
import Link from "next/link";
|
|
9
|
+
import { rgba } from "polished";
|
|
10
|
+
import React from "react";
|
|
11
|
+
import styled, { css } from "styled-components";
|
|
12
|
+
import { interactiveStyles } from "./SharedStyled";
|
|
13
|
+
|
|
14
|
+
interface DocsProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const StyledDocsWrapper = styled.div<{ theme: Theme }>\`
|
|
19
|
+
position: relative;
|
|
20
|
+
\`;
|
|
21
|
+
|
|
22
|
+
const StyledDocsSidebar = styled.div<{ theme: Theme }>\`
|
|
23
|
+
position: sticky;
|
|
24
|
+
top: 90px;
|
|
25
|
+
min-width: 200px;
|
|
26
|
+
float: left;
|
|
27
|
+
z-index: 999;
|
|
28
|
+
|
|
29
|
+
\${mq("lg")} {
|
|
30
|
+
z-index: 2;
|
|
31
|
+
}
|
|
32
|
+
\`;
|
|
33
|
+
|
|
34
|
+
const StyledDocsContainer = styled.div<{ theme: Theme }>\`
|
|
35
|
+
position: relative;
|
|
36
|
+
padding: 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
|
|
39
|
+
& pre {
|
|
40
|
+
max-width: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
\${mq("lg")} {
|
|
44
|
+
padding-left: 230px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
& ul {
|
|
48
|
+
list-style: none;
|
|
49
|
+
padding: 0;
|
|
50
|
+
margin: 0;
|
|
51
|
+
|
|
52
|
+
& li {
|
|
53
|
+
text-indent: 0;
|
|
54
|
+
display: block;
|
|
55
|
+
position: relative;
|
|
56
|
+
padding: 0 0 0 15px;
|
|
57
|
+
margin: 0;
|
|
58
|
+
\${({ theme }) => styledText(theme)};
|
|
59
|
+
min-height: 23px;
|
|
60
|
+
|
|
61
|
+
$mq: "lg" {
|
|
62
|
+
min-height: 27px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&::before {
|
|
66
|
+
content: "";
|
|
67
|
+
display: block;
|
|
68
|
+
width: 6px;
|
|
69
|
+
height: 6px;
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
background: \${({ theme }) => theme.colors.primary};
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 8px;
|
|
74
|
+
left: 2px;
|
|
75
|
+
|
|
76
|
+
\${mq("lg")} {
|
|
77
|
+
top: 10px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
& ol {
|
|
84
|
+
padding: 0;
|
|
85
|
+
margin: 0;
|
|
86
|
+
|
|
87
|
+
& > li {
|
|
88
|
+
position: relative;
|
|
89
|
+
padding: 0;
|
|
90
|
+
counter-increment: item;
|
|
91
|
+
padding: 0;
|
|
92
|
+
margin: 0;
|
|
93
|
+
\${({ theme }) => styledText(theme)};
|
|
94
|
+
|
|
95
|
+
&::before {
|
|
96
|
+
content: counter(item) ".";
|
|
97
|
+
display: inline-block;
|
|
98
|
+
margin: 0 4px 0 0;
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
color: \${({ theme }) => theme.colors.primary};
|
|
101
|
+
min-width: max-content;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
\`;
|
|
106
|
+
|
|
107
|
+
export const StyledMarkdownContainer = styled.div\`
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
gap: 20px;
|
|
111
|
+
flex-wrap: wrap;
|
|
112
|
+
flex: 1;
|
|
113
|
+
\`;
|
|
114
|
+
|
|
115
|
+
interface Props {
|
|
116
|
+
theme?: Theme;
|
|
117
|
+
$isActive?: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const StyledSidebar = styled.nav<Props>\`
|
|
121
|
+
position: fixed;
|
|
122
|
+
overflow-y: auto;
|
|
123
|
+
max-height: calc(100svh - 70px);
|
|
124
|
+
width: 100%;
|
|
125
|
+
background: \${({ theme }) => theme.colors.light};
|
|
126
|
+
z-index: 99;
|
|
127
|
+
top: 70px;
|
|
128
|
+
height: 100%;
|
|
129
|
+
padding: 20px;
|
|
130
|
+
opacity: 0;
|
|
131
|
+
pointer-events: none;
|
|
132
|
+
transition: all 0.3s ease;
|
|
133
|
+
transform: translateY(30px);
|
|
134
|
+
left: 0;
|
|
135
|
+
|
|
136
|
+
\${mq("lg")} {
|
|
137
|
+
width: 220px;
|
|
138
|
+
left: 20px;
|
|
139
|
+
background: transparent;
|
|
140
|
+
padding: 20px 20px 20px 0;
|
|
141
|
+
opacity: 1;
|
|
142
|
+
pointer-events: all;
|
|
143
|
+
transform: translateY(0);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
\${mq("xl")} {
|
|
147
|
+
width: 220px;
|
|
148
|
+
left: calc(50% - 610px);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
\${mq("xxl")} {
|
|
152
|
+
width: 220px;
|
|
153
|
+
left: calc(50% - 690px);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
\${({ $isActive }) =>
|
|
157
|
+
$isActive &&
|
|
158
|
+
css\`
|
|
159
|
+
transform: translateY(0);
|
|
160
|
+
opacity: 1;
|
|
161
|
+
pointer-events: all;
|
|
162
|
+
\`}
|
|
163
|
+
\`;
|
|
164
|
+
|
|
165
|
+
export const StyledSidebarList = styled.ul\`
|
|
166
|
+
list-style: none;
|
|
167
|
+
margin: 0;
|
|
168
|
+
padding: 0;
|
|
169
|
+
\`;
|
|
170
|
+
|
|
171
|
+
export const StyledStrong = styled.strong<{ theme: Theme }>\`
|
|
172
|
+
font-weight: 600;
|
|
173
|
+
\${({ theme }) => styledStrong(theme)};
|
|
174
|
+
\`;
|
|
175
|
+
|
|
176
|
+
export const StyledSidebarListItem = styled.li\`
|
|
177
|
+
display: flex;
|
|
178
|
+
gap: 10px;
|
|
179
|
+
clear: both;
|
|
180
|
+
\`;
|
|
181
|
+
|
|
182
|
+
export const StyledSidebarListItemLink = styled(Link)<Props>\`
|
|
183
|
+
text-decoration: none;
|
|
184
|
+
font-size: \${({ theme }) => theme.fontSizes.strong.xs};
|
|
185
|
+
line-height: 1.6;
|
|
186
|
+
color: \${({ theme }) =>
|
|
187
|
+
theme.isDark ? theme.colors.grayDark : theme.colors.primary};
|
|
188
|
+
padding: 5px 0 5px 20px;
|
|
189
|
+
display: flex;
|
|
190
|
+
transition: all 0.3s ease;
|
|
191
|
+
border-left: solid 1px \${({ theme }) => theme.colors.grayLight};
|
|
192
|
+
|
|
193
|
+
\${mq("lg")} {
|
|
194
|
+
font-size: \${({ theme }) => theme.fontSizes.strong.lg};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@media (hover: hover) {
|
|
198
|
+
&:hover {
|
|
199
|
+
color: \${({ theme }) =>
|
|
200
|
+
theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};
|
|
201
|
+
border-color: \${({ theme }) => theme.colors.info};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
\${({ $isActive, theme }) =>
|
|
206
|
+
$isActive &&
|
|
207
|
+
\`
|
|
208
|
+
color: \${theme.colors.dark};
|
|
209
|
+
border-color: \${theme.colors.info};
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
\`};
|
|
212
|
+
\`;
|
|
213
|
+
|
|
214
|
+
export const StyleMobileBar = styled.button<Props>\`
|
|
215
|
+
\${resetButton};
|
|
216
|
+
position: fixed;
|
|
217
|
+
z-index: 1000;
|
|
218
|
+
bottom: 0;
|
|
219
|
+
right: 20px;
|
|
220
|
+
font-size: \${({ theme }) => theme.fontSizes.strong.lg};
|
|
221
|
+
line-height: \${({ theme }) => theme.fontSizes.strong.lg};
|
|
222
|
+
box-shadow: \${({ theme }) => theme.shadows.sm};
|
|
223
|
+
background: \${({ theme }) =>
|
|
224
|
+
theme.isDark
|
|
225
|
+
? rgba(theme.colors.grayLight, 0.7)
|
|
226
|
+
: rgba(theme.colors.light, 0.7)};
|
|
227
|
+
color: \${({ theme }) =>
|
|
228
|
+
theme.isDark ? theme.colors.dark : theme.colors.primary};
|
|
229
|
+
backdrop-filter: blur(10px);
|
|
230
|
+
-webkit-backdrop-filter: blur(10px);
|
|
231
|
+
padding: 30px;
|
|
232
|
+
border-radius: 100px;
|
|
233
|
+
margin: 0 0 20px 0;
|
|
234
|
+
font-weight: 600;
|
|
235
|
+
display: flex;
|
|
236
|
+
justify-content: flex-start;
|
|
237
|
+
width: auto;
|
|
238
|
+
|
|
239
|
+
\${mq("lg")} {
|
|
240
|
+
display: none;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
\${({ $isActive }) => $isActive && \`position: fixed; \`};
|
|
244
|
+
\`;
|
|
245
|
+
|
|
246
|
+
export const StyledMobileBurger = styled.span<Props>\`
|
|
247
|
+
display: block;
|
|
248
|
+
margin: auto 0;
|
|
249
|
+
width: 18px;
|
|
250
|
+
height: 18px;
|
|
251
|
+
position: relative;
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
background: transparent;
|
|
254
|
+
position: relative;
|
|
255
|
+
|
|
256
|
+
&::before,
|
|
257
|
+
&::after {
|
|
258
|
+
content: "";
|
|
259
|
+
display: block;
|
|
260
|
+
position: absolute;
|
|
261
|
+
width: 18px;
|
|
262
|
+
height: 3px;
|
|
263
|
+
border-radius: 3px;
|
|
264
|
+
background: \${({ theme }) =>
|
|
265
|
+
theme.isDark ? theme.colors.dark : theme.colors.primary};
|
|
266
|
+
transition: all 0.3s ease;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
&::before {
|
|
270
|
+
top: 3px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
&::after {
|
|
274
|
+
bottom: 3px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
\${({ $isActive }) =>
|
|
278
|
+
$isActive &&
|
|
279
|
+
css\`
|
|
280
|
+
&::before {
|
|
281
|
+
transform: translateY(5px) rotate(45deg);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
&::after {
|
|
285
|
+
transform: translateY(-4px) rotate(-45deg);
|
|
286
|
+
}
|
|
287
|
+
\`};
|
|
288
|
+
\`;
|
|
289
|
+
|
|
290
|
+
export const StyledInlineButton = styled.button<{ theme: Theme }>\`
|
|
291
|
+
\${resetButton};
|
|
292
|
+
\${interactiveStyles};
|
|
293
|
+
color: \${({ theme }) => theme.colors.primary};
|
|
294
|
+
vertical-align: middle;
|
|
295
|
+
border: solid 1px \${({ theme }) => theme.colors.grayLight};
|
|
296
|
+
border-radius: \${({ theme }) => theme.spacing.radius.xs};
|
|
297
|
+
padding: 0;
|
|
298
|
+
width: 18px;
|
|
299
|
+
height: 18px;
|
|
300
|
+
display: flex;
|
|
301
|
+
margin: auto 0;
|
|
302
|
+
transition: all 0.3s ease;
|
|
303
|
+
|
|
304
|
+
@media (hover: hover) {
|
|
305
|
+
&:hover {
|
|
306
|
+
color: \${({ theme }) => theme.colors.light};
|
|
307
|
+
background: \${({ theme }) => theme.colors.primary};
|
|
308
|
+
border-color: \${({ theme }) => theme.colors.primary};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
& svg {
|
|
313
|
+
vertical-align: middle;
|
|
314
|
+
width: 12px;
|
|
315
|
+
height: 12px;
|
|
316
|
+
margin: auto;
|
|
317
|
+
}
|
|
318
|
+
\`;
|
|
319
|
+
|
|
320
|
+
export const StyledPlusButton = styled.button<{ theme: Theme }>\`
|
|
321
|
+
\${resetButton};
|
|
322
|
+
color: \${({ theme }) => theme.colors.primary};
|
|
323
|
+
vertical-align: middle;
|
|
324
|
+
padding: 0;
|
|
325
|
+
width: 100%;
|
|
326
|
+
height: 18px;
|
|
327
|
+
display: flex;
|
|
328
|
+
margin: auto 0;
|
|
329
|
+
transition: all 0.3s ease;
|
|
330
|
+
position: relative;
|
|
331
|
+
margin: 20px 0 0 0;
|
|
332
|
+
|
|
333
|
+
&::before {
|
|
334
|
+
content: "";
|
|
335
|
+
display: block;
|
|
336
|
+
position: absolute;
|
|
337
|
+
top: 50%;
|
|
338
|
+
transform: translateY(-50%);
|
|
339
|
+
width: 100%;
|
|
340
|
+
height: 1px;
|
|
341
|
+
border-radius: 3px;
|
|
342
|
+
background: \${({ theme }) => theme.colors.grayLight};
|
|
343
|
+
transition: all 0.3s ease;
|
|
344
|
+
z-index: -1;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
&::after {
|
|
348
|
+
content: "";
|
|
349
|
+
display: block;
|
|
350
|
+
position: absolute;
|
|
351
|
+
left: 50%;
|
|
352
|
+
top: 50%;
|
|
353
|
+
transform: translate(-50%, -50%);
|
|
354
|
+
width: 18px;
|
|
355
|
+
height: 18px;
|
|
356
|
+
border: solid 1px \${({ theme }) => theme.colors.grayLight};
|
|
357
|
+
border-radius: \${({ theme }) => theme.spacing.radius.xs};
|
|
358
|
+
background: \${({ theme }) => theme.colors.light};
|
|
359
|
+
transition: all 0.3s ease;
|
|
360
|
+
z-index: -1;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
box-shadow: 0 0 0 0px \${({ theme }) => theme.colors.primary};
|
|
364
|
+
|
|
365
|
+
@media (hover: hover) {
|
|
366
|
+
&:hover {
|
|
367
|
+
&::after {
|
|
368
|
+
border-color: \${({ theme }) => theme.colors.primary};
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
&:focus {
|
|
374
|
+
&::after {
|
|
375
|
+
border-color: \${({ theme }) => theme.colors.primary};
|
|
376
|
+
box-shadow: 0 0 0 4px \${({ theme }) => theme.colors.primaryLight};
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
&:active {
|
|
381
|
+
&::after {
|
|
382
|
+
box-shadow: 0 0 0 2px \${({ theme }) => theme.colors.primaryLight};
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
@media (hover: hover) {
|
|
387
|
+
&:hover {
|
|
388
|
+
color: \${({ theme }) => theme.colors.light};
|
|
389
|
+
|
|
390
|
+
&::after {
|
|
391
|
+
background: \${({ theme }) => theme.colors.primary};
|
|
392
|
+
border-color: \${({ theme }) => theme.colors.primary};
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
& svg {
|
|
398
|
+
vertical-align: middle;
|
|
399
|
+
width: 14px;
|
|
400
|
+
height: 14px;
|
|
401
|
+
margin: auto;
|
|
402
|
+
}
|
|
403
|
+
\`;
|
|
404
|
+
|
|
405
|
+
export const StyledFullHeightInput = styled.div\`
|
|
406
|
+
height: 100%;
|
|
407
|
+
width: 100%;
|
|
408
|
+
display: flex;
|
|
409
|
+
flex-direction: column;
|
|
410
|
+
gap: 20px;
|
|
411
|
+
flex: 1;
|
|
412
|
+
|
|
413
|
+
& > span {
|
|
414
|
+
height: 100%;
|
|
415
|
+
width: 100%;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
& textarea {
|
|
419
|
+
height: 100%;
|
|
420
|
+
}
|
|
421
|
+
\`;
|
|
422
|
+
|
|
423
|
+
export const StyledEditorWrapper = styled.div\`
|
|
424
|
+
flex: 1;
|
|
425
|
+
|
|
426
|
+
&:empty {
|
|
427
|
+
display: none;
|
|
428
|
+
}
|
|
429
|
+
\`;
|
|
430
|
+
|
|
431
|
+
function DocsWrapper({ children }: DocsProps) {
|
|
432
|
+
return <StyledDocsWrapper>{children}</StyledDocsWrapper>;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
function DocsSidebar({ children }: DocsProps) {
|
|
436
|
+
return <StyledDocsSidebar>{children}</StyledDocsSidebar>;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function DocsContainer({ children }: DocsProps) {
|
|
440
|
+
return <StyledDocsContainer>{children}</StyledDocsContainer>;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export { DocsWrapper, DocsSidebar, DocsContainer };
|
|
444
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const footerTemplate = "\"use client\";\nimport React from \"react\";\n\nfunction Footer() {\n return <footer> </footer>;\n}\nexport { Footer };\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const headerTemplate = "\"use client\";\nimport {\n Flex,\n MaxWidth,\n resetButton,\n styledText,\n} from \"cherry-styled-components/src/lib\";\nimport React, { \n useCallback,\n useContext,\n useRef,\n useState,\n Suspense\n} from \"react\";\nimport styled, { css } from \"styled-components\";\nimport Link from \"next/link\";\nimport { rgba } from \"polished\";\nimport { mq, Theme } from \"@/app/theme\";\nimport { ToggleTheme, ToggleThemeLoading } from \"@/components/layout/ThemeToggle\";\nimport {\n StyledTinyDesktopOnly,\n StyledTinyMobileOnly,\n} from \"@/components/layout/SharedStyled\";\nimport { useOnClickOutside } from \"@/components/ClickOutside\";\nimport { Logo } from \"@/components/layout/Pictograms\";\n\nconst StyledHeader = styled.header<{ theme: Theme }>`\n position: sticky;\n top: 0;\n padding: 20px;\n margin: 0;\n z-index: 1000;\n\n &::before,\n &::after {\n display: block;\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: ${({ theme }) => theme.colors.light};\n z-index: -2;\n }\n\n &::after {\n background: ${({ theme }) => rgba(theme.colors.primaryLight, 0.1)};\n z-index: -1;\n }\n\n & .logo {\n display: flex;\n\n & svg {\n margin: auto;\n }\n }\n`;\n\nconst StyledLink = styled(Link)<{ theme: Theme }>`\n text-decoration: none;\n margin: auto 0;\n color: ${({ theme }) => theme.colors.primary};\n font-weight: 500;\n\n @media (hover: hover) {\n &:hover {\n color: ${({ theme }) => theme.colors.primaryDark};\n }\n }\n`;\n\nexport const StyledMobileBurger = styled.button<{\n theme: Theme;\n $isActive: boolean;\n}>`\n ${resetButton};\n display: block;\n margin: auto 0;\n width: 18px;\n height: 18px;\n position: relative;\n overflow: hidden;\n background: transparent;\n position: relative;\n\n ${mq(\"lg\")} {\n display: none;\n }\n\n &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n width: 18px;\n height: 2px;\n border-radius: 3px;\n background: ${({ theme }) => theme.colors.primary};\n transition: all 0.3s ease;\n }\n\n &::before {\n top: 4px;\n }\n\n &::after {\n bottom: 4px;\n }\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n &::before {\n transform: translateY(4px) rotate(45deg);\n }\n\n &::after {\n transform: translateY(-4px) rotate(-45deg);\n }\n `};\n`;\n\nconst StyledMobileMenu = styled.ul<{ theme: Theme; $isActive: boolean }>`\n list-style: none;\n padding: 70px 0 0 0;\n margin: 0;\n position: fixed;\n top: 0;\n left: 0;\n background: ${({ theme }) => theme.colors.light};\n pointer-events: none;\n opacity: 0;\n width: 100%;\n height: 100dvh;\n transition: all 0.3s ease;\n z-index: 800;\n transform: translateY(40px) scale(1.2);\n display: block;\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n pointer-events: all;\n opacity: 1;\n transform: translateY(0) scale(1);\n `};\n\n & li {\n display: block;\n width: 100%;\n padding: 0;\n margin: 0;\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n\n &.languages {\n display: flex;\n justify-content: center;\n gap: 10px;\n }\n\n & a,\n & button {\n ${({ theme }) => styledText(theme)};\n font-family: ${({ theme }) => theme.fonts.text};\n font-weight: 500;\n appearance: none;\n background: transparent;\n border: none;\n color: ${({ theme }) => theme.colors.dark};\n display: flex;\n margin: 0;\n padding: 20px;\n font-weight: 500;\n text-decoration: none;\n cursor: pointer;\n }\n\n & button {\n flex: 1;\n border-right: solid 1px ${({ theme }) => theme.colors.grayLight};\n text-align: center;\n justify-content: center;\n\n &:last-of-type {\n border-right: none;\n }\n }\n }\n`;\n\nconst StyledMenu = styled.div<{ theme: Theme }>`\n display: none;\n\n ${mq(\"lg\")} {\n display: flex;\n gap: 20px;\n }\n`;\n\nconst StyledDivider = styled.div<{ theme: Theme }>`\n width: 1px;\n height: calc(100% - 10px);\n margin: auto 0;\n background: ${({ theme }) => theme.colors.grayLight};\n`;\n\nconst StyledWrapper = styled.div<{ theme: Theme }>`\n margin: auto 0;\n`;\n\nfunction Header() {\n const [isOptionActive, setIsOptionActive] = useState(false);\n const [isLangActive, setIsLangActive] = useState(false);\n const [isMobileMenuActive, setIsMobileMenuActive] = useState(false);\n\n const wrapperRef = useRef<HTMLSpanElement>(null);\n const elmRef = useRef<HTMLDivElement>(null);\n const langRef = useRef<HTMLSpanElement>(null);\n const closeMenu = useCallback(() => {\n setIsOptionActive(false);\n setIsLangActive(false);\n }, []);\n\n useOnClickOutside(\n [elmRef, wrapperRef],\n isOptionActive ? closeMenu : () => {},\n );\n useOnClickOutside([langRef, wrapperRef], isLangActive ? closeMenu : () => {});\n\n return (\n <>\n <StyledHeader>\n <MaxWidth $size={1000}>\n <Flex $justifyContent=\"space-between\" $wrap=\"nowrap\">\n <Link href=\"/\" className=\"logo\" aria-label=\"Logo\">\n <StyledTinyDesktopOnly>\n <Logo />\n </StyledTinyDesktopOnly>\n <StyledTinyMobileOnly>\n <Logo />\n </StyledTinyMobileOnly>\n </Link>\n <StyledWrapper>\n <span ref={wrapperRef}>\n <Flex $gap={20} $wrap=\"wrap\">\n <StyledMenu>\n <StyledLink href=\"https://doccupine.com\" target=\"_blank\">\n Doccupine\n </StyledLink>\n </StyledMenu>\n <Suspense fallback={<ToggleThemeLoading />}>\n <ToggleTheme />\n </Suspense>\n <StyledMobileBurger\n $isActive={isMobileMenuActive}\n onClick={() => setIsMobileMenuActive(!isMobileMenuActive)}\n aria-label=\"Burger Menu\"\n />\n </Flex>\n </span>\n </StyledWrapper>\n </Flex>\n </MaxWidth>\n </StyledHeader>\n <StyledMobileMenu $isActive={isMobileMenuActive}>\n <li onClick={() => setIsMobileMenuActive(false)}>\n <a href=\"https://doccupine.com\" target=\"_blank\">\n Doccupine\n </a>\n </li>\n </StyledMobileMenu>\n </>\n );\n}\n\nexport { Header };\n";
|