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 @@
|
|
|
1
|
+
export declare const themeToggleTemplate = "\"use client\";\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Theme, resetButton, ThemeContext } from \"cherry-styled-components/src/lib\";\nimport styled, { css, useTheme } from \"styled-components\";\nimport { useSearchParams } from \"next/navigation\";\nimport { theme as themeLight, themeDark } from \"@/app/theme\";\nimport { Icon } from \"@/components/layout/Icon\";\n\nconst StyledThemeToggle = styled.button<{ theme: Theme; $hidden?: boolean }>`\n ${resetButton}\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n position: relative;\n margin: auto 0;\n transform: scale(1);\n\n ${({ $hidden }) =>\n $hidden &&\n css`\n display: none;\n `}\n\n & svg {\n width: 100%;\n height: 100%;\n object-fit: contain;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) translateY(0);\n margin: auto;\n transition: all 0.3s ease;\n\n &.lucide-sun {\n ${({ theme }) =>\n theme.isDark &&\n `opacity: 0;\n\t\t\ttransform: translate(-50%, -50%) translateY(10px);`}\n }\n\n &.lucide-moon-star {\n ${({ theme }) =>\n !theme.isDark &&\n `opacity: 0;\n\t\t\ttransform: translate(-50%, -50%) translateY(10px);`}\n }\n }\n\n & svg[stroke] {\n stroke: ${({ theme }) => theme.colors.primary};\n }\n\n @media (hover: hover) {\n &:hover {\n transform: scale(1.05);\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};\n Toggle & svg[stroke] {\n stroke: ${({ theme }) =>\n theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};\n }\n }\n }\n\n &:active {\n transform: scale(0.97);\n }\n`;\n\nfunction ToggleTheme({ $hidden }: { $hidden?: boolean }) {\n const theme = useTheme() as Theme;\n const { setTheme } = useContext(ThemeContext);\n const [isMounted, setIsMounted] = useState(false);\n\n const searchParams = useSearchParams();\n const themeParam = searchParams.get(\"theme\");\n\n useEffect(() => {\n setIsMounted(true);\n if (themeParam === \"light\") {\n setTheme(themeLight);\n localStorage.theme = \"light\";\n } else if (themeParam === \"dark\") {\n setTheme(themeDark);\n localStorage.theme = \"dark\";\n }\n }, [themeParam, setTheme]);\n\n if (!isMounted) return null;\n\n return (\n <StyledThemeToggle\n onClick={() => {\n if (theme.isDark) {\n setTheme(themeLight);\n localStorage.theme = \"light\";\n } else {\n setTheme(themeDark);\n localStorage.theme = \"dark\";\n }\n }}\n $hidden={$hidden}\n aria-label=\"Toggle Theme\"\n >\n <Icon name=\"MoonStar\" className=\"dark\" />\n <Icon name=\"Sun\" className=\"light\" />\n </StyledThemeToggle>\n );\n}\n\nfunction ToggleThemeLoading() {\n return (\n <StyledThemeToggle $hidden aria-label=\"Toggle Theme\">\n <Icon name=\"MoonStar\" className=\"dark\" />\n <Icon name=\"Sun\" className=\"light\" />\n </StyledThemeToggle>\n );\n}\n\nexport { ToggleTheme, ToggleThemeLoading };\n";
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export const themeToggleTemplate = `"use client";
|
|
2
|
+
import React, { useContext, useEffect, useState } from "react";
|
|
3
|
+
import { Theme, resetButton, ThemeContext } from "cherry-styled-components/src/lib";
|
|
4
|
+
import styled, { css, useTheme } from "styled-components";
|
|
5
|
+
import { useSearchParams } from "next/navigation";
|
|
6
|
+
import { theme as themeLight, themeDark } from "@/app/theme";
|
|
7
|
+
import { Icon } from "@/components/layout/Icon";
|
|
8
|
+
|
|
9
|
+
const StyledThemeToggle = styled.button<{ theme: Theme; $hidden?: boolean }>\`
|
|
10
|
+
\${resetButton}
|
|
11
|
+
width: 24px;
|
|
12
|
+
height: 24px;
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
display: flex;
|
|
15
|
+
position: relative;
|
|
16
|
+
margin: auto 0;
|
|
17
|
+
transform: scale(1);
|
|
18
|
+
|
|
19
|
+
\${({ $hidden }) =>
|
|
20
|
+
$hidden &&
|
|
21
|
+
css\`
|
|
22
|
+
display: none;
|
|
23
|
+
\`}
|
|
24
|
+
|
|
25
|
+
& svg {
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
object-fit: contain;
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 50%;
|
|
31
|
+
left: 50%;
|
|
32
|
+
transform: translate(-50%, -50%) translateY(0);
|
|
33
|
+
margin: auto;
|
|
34
|
+
transition: all 0.3s ease;
|
|
35
|
+
|
|
36
|
+
&.lucide-sun {
|
|
37
|
+
\${({ theme }) =>
|
|
38
|
+
theme.isDark &&
|
|
39
|
+
\`opacity: 0;
|
|
40
|
+
transform: translate(-50%, -50%) translateY(10px);\`}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.lucide-moon-star {
|
|
44
|
+
\${({ theme }) =>
|
|
45
|
+
!theme.isDark &&
|
|
46
|
+
\`opacity: 0;
|
|
47
|
+
transform: translate(-50%, -50%) translateY(10px);\`}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
& svg[stroke] {
|
|
52
|
+
stroke: \${({ theme }) => theme.colors.primary};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (hover: hover) {
|
|
56
|
+
&:hover {
|
|
57
|
+
transform: scale(1.05);
|
|
58
|
+
color: \${({ theme }) =>
|
|
59
|
+
theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};
|
|
60
|
+
Toggle & svg[stroke] {
|
|
61
|
+
stroke: \${({ theme }) =>
|
|
62
|
+
theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:active {
|
|
68
|
+
transform: scale(0.97);
|
|
69
|
+
}
|
|
70
|
+
\`;
|
|
71
|
+
|
|
72
|
+
function ToggleTheme({ $hidden }: { $hidden?: boolean }) {
|
|
73
|
+
const theme = useTheme() as Theme;
|
|
74
|
+
const { setTheme } = useContext(ThemeContext);
|
|
75
|
+
const [isMounted, setIsMounted] = useState(false);
|
|
76
|
+
|
|
77
|
+
const searchParams = useSearchParams();
|
|
78
|
+
const themeParam = searchParams.get("theme");
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
setIsMounted(true);
|
|
82
|
+
if (themeParam === "light") {
|
|
83
|
+
setTheme(themeLight);
|
|
84
|
+
localStorage.theme = "light";
|
|
85
|
+
} else if (themeParam === "dark") {
|
|
86
|
+
setTheme(themeDark);
|
|
87
|
+
localStorage.theme = "dark";
|
|
88
|
+
}
|
|
89
|
+
}, [themeParam, setTheme]);
|
|
90
|
+
|
|
91
|
+
if (!isMounted) return null;
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<StyledThemeToggle
|
|
95
|
+
onClick={() => {
|
|
96
|
+
if (theme.isDark) {
|
|
97
|
+
setTheme(themeLight);
|
|
98
|
+
localStorage.theme = "light";
|
|
99
|
+
} else {
|
|
100
|
+
setTheme(themeDark);
|
|
101
|
+
localStorage.theme = "dark";
|
|
102
|
+
}
|
|
103
|
+
}}
|
|
104
|
+
$hidden={$hidden}
|
|
105
|
+
aria-label="Toggle Theme"
|
|
106
|
+
>
|
|
107
|
+
<Icon name="MoonStar" className="dark" />
|
|
108
|
+
<Icon name="Sun" className="light" />
|
|
109
|
+
</StyledThemeToggle>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function ToggleThemeLoading() {
|
|
114
|
+
return (
|
|
115
|
+
<StyledThemeToggle $hidden aria-label="Toggle Theme">
|
|
116
|
+
<Icon name="MoonStar" className="dark" />
|
|
117
|
+
<Icon name="Sun" className="light" />
|
|
118
|
+
</StyledThemeToggle>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { ToggleTheme, ToggleThemeLoading };
|
|
123
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const typographyTemplate = "\"use client\";\nimport {\n styledH1,\n styledH2,\n styledH3,\n styledH4,\n styledH5,\n styledH6,\n styledText,\n Theme,\n} from \"cherry-styled-components/src/lib\";\nimport styled, { css } from \"styled-components\";\n\nconst StyledHeading = css`\n font-weight: 900;\n`; \n\nexport const StyledH1 = styled.h1<{ theme: Theme }>` \n ${StyledHeading};\n ${({ theme }) => styledH1(theme)}\n`; \n\nexport const StyledH2 = styled.h2<{ theme: Theme }>` \n ${StyledHeading};\n ${({ theme }) => styledH2(theme)}\n`; \n\nexport const StyledH3 = styled.h3<{ theme: Theme }>` \n ${StyledHeading};\n ${({ theme }) => styledH3(theme)}\n`; \n\nexport const StyledH4 = styled.h4<{ theme: Theme }>` \n ${StyledHeading};\n ${({ theme }) => styledH4(theme)}\n`; \n\nexport const StyledH5 = styled.h5<{ theme: Theme }>` \n ${StyledHeading};\n ${({ theme }) => styledH5(theme)}\n`; \n\nexport const StyledH6 = styled.h6<{ theme: Theme }>` \n ${StyledHeading};\n ${({ theme }) => styledH6(theme)}\n`; \n\nexport const StyledText = styled.p<{ theme: Theme }>` \n ${({ theme }) => styledText(theme)}\n`; \n";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const typographyTemplate = `"use client";
|
|
2
|
+
import {
|
|
3
|
+
styledH1,
|
|
4
|
+
styledH2,
|
|
5
|
+
styledH3,
|
|
6
|
+
styledH4,
|
|
7
|
+
styledH5,
|
|
8
|
+
styledH6,
|
|
9
|
+
styledText,
|
|
10
|
+
Theme,
|
|
11
|
+
} from "cherry-styled-components/src/lib";
|
|
12
|
+
import styled, { css } from "styled-components";
|
|
13
|
+
|
|
14
|
+
const StyledHeading = css\`
|
|
15
|
+
font-weight: 900;
|
|
16
|
+
\`;
|
|
17
|
+
|
|
18
|
+
export const StyledH1 = styled.h1<{ theme: Theme }>\`
|
|
19
|
+
\${StyledHeading};
|
|
20
|
+
\${({ theme }) => styledH1(theme)}
|
|
21
|
+
\`;
|
|
22
|
+
|
|
23
|
+
export const StyledH2 = styled.h2<{ theme: Theme }>\`
|
|
24
|
+
\${StyledHeading};
|
|
25
|
+
\${({ theme }) => styledH2(theme)}
|
|
26
|
+
\`;
|
|
27
|
+
|
|
28
|
+
export const StyledH3 = styled.h3<{ theme: Theme }>\`
|
|
29
|
+
\${StyledHeading};
|
|
30
|
+
\${({ theme }) => styledH3(theme)}
|
|
31
|
+
\`;
|
|
32
|
+
|
|
33
|
+
export const StyledH4 = styled.h4<{ theme: Theme }>\`
|
|
34
|
+
\${StyledHeading};
|
|
35
|
+
\${({ theme }) => styledH4(theme)}
|
|
36
|
+
\`;
|
|
37
|
+
|
|
38
|
+
export const StyledH5 = styled.h5<{ theme: Theme }>\`
|
|
39
|
+
\${StyledHeading};
|
|
40
|
+
\${({ theme }) => styledH5(theme)}
|
|
41
|
+
\`;
|
|
42
|
+
|
|
43
|
+
export const StyledH6 = styled.h6<{ theme: Theme }>\`
|
|
44
|
+
\${StyledHeading};
|
|
45
|
+
\${({ theme }) => styledH6(theme)}
|
|
46
|
+
\`;
|
|
47
|
+
|
|
48
|
+
export const StyledText = styled.p<{ theme: Theme }>\`
|
|
49
|
+
\${({ theme }) => styledText(theme)}
|
|
50
|
+
\`;
|
|
51
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const docsComponentsTemplate = "\n\"use client\";\nimport { mq, Theme } from \"@/app/theme\";\nimport {\n resetButton,\n styledStrong,\n styledText,\n} from \"cherry-styled-components/src/lib\";\nimport Link from \"next/link\";\nimport { rgba } from \"polished\";\nimport React from \"react\";\nimport styled, { css } from \"styled-components\";\nimport { interactiveStyles } from \"./SharedStyled\";\n\ninterface DocsProps {\n children: React.ReactNode;\n}\n\nconst StyledDocsWrapper = styled.div<{ theme: Theme }>`\n position: relative;\n`;\n\nconst StyledDocsSidebar = styled.div<{ theme: Theme }>`\n position: sticky;\n top: 90px;\n min-width: 200px;\n float: left;\n z-index: 999;\n\n ${mq(\"lg\")} {\n z-index: 2;\n }\n`;\n\nconst StyledDocsContainer = styled.div<{ theme: Theme }>`\n position: relative;\n padding: 0;\n width: 100%;\n\n ${mq(\"lg\")} {\n padding-left: 230px;\n }\n\n & ul {\n list-style: none;\n padding: 0;\n margin: 0;\n\n & li {\n text-indent: 0;\n display: block;\n position: relative;\n padding: 0 0 0 15px;\n margin: 0;\n ${({ theme }) => styledText(theme)};\n min-height: 23px;\n\n $mq: \"lg\" {\n min-height: 27px;\n }\n\n &::before {\n content: \"\";\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: ${({ theme }) => theme.colors.primary};\n position: absolute;\n top: 8px;\n left: 2px;\n\n ${mq(\"lg\")} {\n top: 10px;\n }\n }\n }\n }\n\n & ol {\n padding: 0;\n margin: 0;\n\n & > li {\n position: relative;\n padding: 0;\n counter-increment: item;\n padding: 0;\n margin: 0;\n ${({ theme }) => styledText(theme)};\n\n &::before {\n content: counter(item) \".\";\n display: inline-block;\n margin: 0 4px 0 0;\n font-weight: 700;\n color: ${({ theme }) => theme.colors.primary};\n min-width: max-content;\n }\n }\n }\n`;\n\nexport const StyledMarkdownContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 20px;\n flex-wrap: wrap;\n flex: 1;\n`;\n\ninterface Props {\n theme?: Theme;\n $isActive?: boolean;\n}\n\nexport const StyledSidebar = styled.nav<Props>`\n position: fixed;\n overflow-y: auto;\n max-height: calc(100svh - 70px);\n width: 100%;\n background: ${({ theme }) => theme.colors.light};\n z-index: 99;\n top: 70px;\n height: 100%;\n padding: 20px 0;\n opacity: 0;\n pointer-events: none;\n transition: all 0.3s ease;\n transform: translateY(30px);\n\n ${mq(\"lg\")} {\n width: 220px;\n left: 20px;\n background: transparent;\n padding: 20px 20px 20px 0;\n opacity: 1;\n pointer-events: all;\n transform: translateY(0);\n }\n\n ${mq(\"xl\")} {\n width: 220px;\n left: calc(50% - 610px);\n }\n\n ${mq(\"xxl\")} {\n width: 220px;\n left: calc(50% - 690px);\n }\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n transform: translateY(0);\n opacity: 1;\n pointer-events: all;\n `}\n`;\n\nexport const StyledSidebarList = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nexport const StyledStrong = styled.strong<{ theme: Theme }>`\n font-weight: 600;\n ${({ theme }) => styledStrong(theme)};\n`;\n\nexport const StyledSidebarListItem = styled.li`\n display: flex;\n gap: 10px;\n clear: both;\n`;\n\nexport const StyledSidebarListItemLink = styled(Link)<Props>`\n text-decoration: none;\n font-size: ${({ theme }) => theme.fontSizes.strong.xs};\n line-height: 2.1;\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.grayDark : theme.colors.primary};\n padding: 0 0 0 20px;\n display: flex;\n transition: all 0.3s ease;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n\n ${mq(\"lg\")} {\n font-size: ${({ theme }) => theme.fontSizes.strong.lg};\n line-height: 2.1;\n }\n\n @media (hover: hover) {\n &:hover {\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};\n border-color: ${({ theme }) => theme.colors.info};\n }\n }\n\n ${({ $isActive, theme }) =>\n $isActive &&\n `\n\t\t\tcolor: ${theme.colors.dark};\n\t\t\tborder-color: ${theme.colors.info};\n\t\t\tfont-weight: 600;\n\t`};\n`;\n\nexport const StyleMobileBar = styled.button<Props>`\n ${resetButton};\n position: fixed;\n z-index: 1000;\n bottom: 0;\n right: 20px;\n font-size: ${({ theme }) => theme.fontSizes.strong.lg};\n line-height: ${({ theme }) => theme.fontSizes.strong.lg};\n box-shadow: ${({ theme }) => theme.shadows.sm};\n background: ${({ theme }) =>\n theme.isDark\n ? rgba(theme.colors.grayLight, 0.7)\n : rgba(theme.colors.light, 0.7)};\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.dark : theme.colors.primary};\n backdrop-filter: blur(10px);\n -webkit-backdrop-filter: blur(10px);\n padding: 30px;\n border-radius: 100px;\n margin: 0 0 20px 0;\n font-weight: 600;\n display: flex;\n justify-content: flex-start;\n width: auto;\n\n ${mq(\"lg\")} {\n display: none;\n }\n\n ${({ $isActive }) => $isActive && `position: fixed; `};\n`;\n\nexport const StyledMobileBurger = styled.span<Props>`\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 &::before,\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n width: 18px;\n height: 3px;\n border-radius: 3px;\n background: ${({ theme }) =>\n theme.isDark ? theme.colors.dark : theme.colors.primary};\n transition: all 0.3s ease;\n }\n\n &::before {\n top: 3px;\n }\n\n &::after {\n bottom: 3px;\n }\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n &::before {\n transform: translateY(5px) rotate(45deg);\n }\n\n &::after {\n transform: translateY(-4px) rotate(-45deg);\n }\n `};\n`;\n\nexport const StyledInlineButton = styled.button<{ theme: Theme }>`\n ${resetButton};\n ${interactiveStyles};\n color: ${({ theme }) => theme.colors.primary};\n vertical-align: middle;\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n padding: 0;\n width: 18px;\n height: 18px;\n display: flex;\n margin: auto 0;\n transition: all 0.3s ease;\n\n @media (hover: hover) {\n &:hover {\n color: ${({ theme }) => theme.colors.light};\n background: ${({ theme }) => theme.colors.primary};\n border-color: ${({ theme }) => theme.colors.primary};\n }\n }\n\n & svg {\n vertical-align: middle;\n width: 12px;\n height: 12px;\n margin: auto;\n }\n`;\n\nexport const StyledPlusButton = styled.button<{ theme: Theme }>`\n ${resetButton};\n color: ${({ theme }) => theme.colors.primary};\n vertical-align: middle;\n padding: 0;\n width: 100%;\n height: 18px;\n display: flex;\n margin: auto 0;\n transition: all 0.3s ease;\n position: relative;\n margin: 20px 0 0 0;\n\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 100%;\n height: 1px;\n border-radius: 3px;\n background: ${({ theme }) => theme.colors.grayLight};\n transition: all 0.3s ease;\n z-index: -1;\n }\n\n &::after {\n content: \"\";\n display: block;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 18px;\n height: 18px;\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n background: ${({ theme }) => theme.colors.light};\n transition: all 0.3s ease;\n z-index: -1;\n }\n\n box-shadow: 0 0 0 0px ${({ theme }) => theme.colors.primary};\n\n @media (hover: hover) {\n &:hover {\n &::after {\n border-color: ${({ theme }) => theme.colors.primary};\n }\n }\n }\n\n &:focus {\n &::after {\n border-color: ${({ theme }) => theme.colors.primary};\n box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};\n }\n }\n\n &:active {\n &::after {\n box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n }\n\n @media (hover: hover) {\n &:hover {\n color: ${({ theme }) => theme.colors.light};\n\n &::after {\n background: ${({ theme }) => theme.colors.primary};\n border-color: ${({ theme }) => theme.colors.primary};\n }\n }\n }\n\n & svg {\n vertical-align: middle;\n width: 14px;\n height: 14px;\n margin: auto;\n }\n`;\n\nexport const StyledFullHeightInput = styled.div`\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 20px;\n flex: 1;\n\n & > span {\n height: 100%;\n width: 100%;\n }\n\n & textarea {\n height: 100%;\n }\n`;\n\nexport const StyledEditorWrapper = styled.div`\n flex: 1;\n\n &:empty {\n display: none;\n }\n`;\n\nfunction DocsWrapper({ children }: DocsProps) {\n return <StyledDocsWrapper>{children}</StyledDocsWrapper>;\n}\n\nfunction DocsSidebar({ children }: DocsProps) {\n return <StyledDocsSidebar>{children}</StyledDocsSidebar>;\n}\n\nfunction DocsContainer({ children }: DocsProps) {\n return <StyledDocsContainer>{children}</StyledDocsContainer>;\n}\n\nexport { DocsWrapper, DocsSidebar, DocsContainer };\n";
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
export const docsComponentsTemplate = `
|
|
2
|
+
"use client";
|
|
3
|
+
import { mq, Theme } from "@/app/theme";
|
|
4
|
+
import {
|
|
5
|
+
resetButton,
|
|
6
|
+
styledStrong,
|
|
7
|
+
styledText,
|
|
8
|
+
} from "cherry-styled-components/src/lib";
|
|
9
|
+
import Link from "next/link";
|
|
10
|
+
import { rgba } from "polished";
|
|
11
|
+
import React from "react";
|
|
12
|
+
import styled, { css } from "styled-components";
|
|
13
|
+
import { interactiveStyles } from "./SharedStyled";
|
|
14
|
+
|
|
15
|
+
interface DocsProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const StyledDocsWrapper = styled.div<{ theme: Theme }>\`
|
|
20
|
+
position: relative;
|
|
21
|
+
\`;
|
|
22
|
+
|
|
23
|
+
const StyledDocsSidebar = styled.div<{ theme: Theme }>\`
|
|
24
|
+
position: sticky;
|
|
25
|
+
top: 90px;
|
|
26
|
+
min-width: 200px;
|
|
27
|
+
float: left;
|
|
28
|
+
z-index: 999;
|
|
29
|
+
|
|
30
|
+
\${mq("lg")} {
|
|
31
|
+
z-index: 2;
|
|
32
|
+
}
|
|
33
|
+
\`;
|
|
34
|
+
|
|
35
|
+
const StyledDocsContainer = styled.div<{ theme: Theme }>\`
|
|
36
|
+
position: relative;
|
|
37
|
+
padding: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
|
|
40
|
+
\${mq("lg")} {
|
|
41
|
+
padding-left: 230px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
& ul {
|
|
45
|
+
list-style: none;
|
|
46
|
+
padding: 0;
|
|
47
|
+
margin: 0;
|
|
48
|
+
|
|
49
|
+
& li {
|
|
50
|
+
text-indent: 0;
|
|
51
|
+
display: block;
|
|
52
|
+
position: relative;
|
|
53
|
+
padding: 0 0 0 15px;
|
|
54
|
+
margin: 0;
|
|
55
|
+
\${({ theme }) => styledText(theme)};
|
|
56
|
+
min-height: 23px;
|
|
57
|
+
|
|
58
|
+
$mq: "lg" {
|
|
59
|
+
min-height: 27px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&::before {
|
|
63
|
+
content: "";
|
|
64
|
+
display: block;
|
|
65
|
+
width: 6px;
|
|
66
|
+
height: 6px;
|
|
67
|
+
border-radius: 50%;
|
|
68
|
+
background: \${({ theme }) => theme.colors.primary};
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 8px;
|
|
71
|
+
left: 2px;
|
|
72
|
+
|
|
73
|
+
\${mq("lg")} {
|
|
74
|
+
top: 10px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
& ol {
|
|
81
|
+
padding: 0;
|
|
82
|
+
margin: 0;
|
|
83
|
+
|
|
84
|
+
& > li {
|
|
85
|
+
position: relative;
|
|
86
|
+
padding: 0;
|
|
87
|
+
counter-increment: item;
|
|
88
|
+
padding: 0;
|
|
89
|
+
margin: 0;
|
|
90
|
+
\${({ theme }) => styledText(theme)};
|
|
91
|
+
|
|
92
|
+
&::before {
|
|
93
|
+
content: counter(item) ".";
|
|
94
|
+
display: inline-block;
|
|
95
|
+
margin: 0 4px 0 0;
|
|
96
|
+
font-weight: 700;
|
|
97
|
+
color: \${({ theme }) => theme.colors.primary};
|
|
98
|
+
min-width: max-content;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
\`;
|
|
103
|
+
|
|
104
|
+
export const StyledMarkdownContainer = styled.div\`
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
gap: 20px;
|
|
108
|
+
flex-wrap: wrap;
|
|
109
|
+
flex: 1;
|
|
110
|
+
\`;
|
|
111
|
+
|
|
112
|
+
interface Props {
|
|
113
|
+
theme?: Theme;
|
|
114
|
+
$isActive?: boolean;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const StyledSidebar = styled.nav<Props>\`
|
|
118
|
+
position: fixed;
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
max-height: calc(100svh - 70px);
|
|
121
|
+
width: 100%;
|
|
122
|
+
background: \${({ theme }) => theme.colors.light};
|
|
123
|
+
z-index: 99;
|
|
124
|
+
top: 70px;
|
|
125
|
+
height: 100%;
|
|
126
|
+
padding: 20px 0;
|
|
127
|
+
opacity: 0;
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
transition: all 0.3s ease;
|
|
130
|
+
transform: translateY(30px);
|
|
131
|
+
|
|
132
|
+
\${mq("lg")} {
|
|
133
|
+
width: 220px;
|
|
134
|
+
left: 20px;
|
|
135
|
+
background: transparent;
|
|
136
|
+
padding: 20px 20px 20px 0;
|
|
137
|
+
opacity: 1;
|
|
138
|
+
pointer-events: all;
|
|
139
|
+
transform: translateY(0);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
\${mq("xl")} {
|
|
143
|
+
width: 220px;
|
|
144
|
+
left: calc(50% - 610px);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
\${mq("xxl")} {
|
|
148
|
+
width: 220px;
|
|
149
|
+
left: calc(50% - 690px);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
\${({ $isActive }) =>
|
|
153
|
+
$isActive &&
|
|
154
|
+
css\`
|
|
155
|
+
transform: translateY(0);
|
|
156
|
+
opacity: 1;
|
|
157
|
+
pointer-events: all;
|
|
158
|
+
\`}
|
|
159
|
+
\`;
|
|
160
|
+
|
|
161
|
+
export const StyledSidebarList = styled.ul\`
|
|
162
|
+
list-style: none;
|
|
163
|
+
margin: 0;
|
|
164
|
+
padding: 0;
|
|
165
|
+
\`;
|
|
166
|
+
|
|
167
|
+
export const StyledStrong = styled.strong<{ theme: Theme }>\`
|
|
168
|
+
font-weight: 600;
|
|
169
|
+
\${({ theme }) => styledStrong(theme)};
|
|
170
|
+
\`;
|
|
171
|
+
|
|
172
|
+
export const StyledSidebarListItem = styled.li\`
|
|
173
|
+
display: flex;
|
|
174
|
+
gap: 10px;
|
|
175
|
+
clear: both;
|
|
176
|
+
\`;
|
|
177
|
+
|
|
178
|
+
export const StyledSidebarListItemLink = styled(Link)<Props>\`
|
|
179
|
+
text-decoration: none;
|
|
180
|
+
font-size: \${({ theme }) => theme.fontSizes.strong.xs};
|
|
181
|
+
line-height: 2.1;
|
|
182
|
+
color: \${({ theme }) =>
|
|
183
|
+
theme.isDark ? theme.colors.grayDark : theme.colors.primary};
|
|
184
|
+
padding: 0 0 0 20px;
|
|
185
|
+
display: flex;
|
|
186
|
+
transition: all 0.3s ease;
|
|
187
|
+
border-left: solid 1px \${({ theme }) => theme.colors.grayLight};
|
|
188
|
+
|
|
189
|
+
\${mq("lg")} {
|
|
190
|
+
font-size: \${({ theme }) => theme.fontSizes.strong.lg};
|
|
191
|
+
line-height: 2.1;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@media (hover: hover) {
|
|
195
|
+
&:hover {
|
|
196
|
+
color: \${({ theme }) =>
|
|
197
|
+
theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};
|
|
198
|
+
border-color: \${({ theme }) => theme.colors.info};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
\${({ $isActive, theme }) =>
|
|
203
|
+
$isActive &&
|
|
204
|
+
\`
|
|
205
|
+
color: \${theme.colors.dark};
|
|
206
|
+
border-color: \${theme.colors.info};
|
|
207
|
+
font-weight: 600;
|
|
208
|
+
\`};
|
|
209
|
+
\`;
|
|
210
|
+
|
|
211
|
+
export const StyleMobileBar = styled.button<Props>\`
|
|
212
|
+
\${resetButton};
|
|
213
|
+
position: fixed;
|
|
214
|
+
z-index: 1000;
|
|
215
|
+
bottom: 0;
|
|
216
|
+
right: 20px;
|
|
217
|
+
font-size: \${({ theme }) => theme.fontSizes.strong.lg};
|
|
218
|
+
line-height: \${({ theme }) => theme.fontSizes.strong.lg};
|
|
219
|
+
box-shadow: \${({ theme }) => theme.shadows.sm};
|
|
220
|
+
background: \${({ theme }) =>
|
|
221
|
+
theme.isDark
|
|
222
|
+
? rgba(theme.colors.grayLight, 0.7)
|
|
223
|
+
: rgba(theme.colors.light, 0.7)};
|
|
224
|
+
color: \${({ theme }) =>
|
|
225
|
+
theme.isDark ? theme.colors.dark : theme.colors.primary};
|
|
226
|
+
backdrop-filter: blur(10px);
|
|
227
|
+
-webkit-backdrop-filter: blur(10px);
|
|
228
|
+
padding: 30px;
|
|
229
|
+
border-radius: 100px;
|
|
230
|
+
margin: 0 0 20px 0;
|
|
231
|
+
font-weight: 600;
|
|
232
|
+
display: flex;
|
|
233
|
+
justify-content: flex-start;
|
|
234
|
+
width: auto;
|
|
235
|
+
|
|
236
|
+
\${mq("lg")} {
|
|
237
|
+
display: none;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
\${({ $isActive }) => $isActive && \`position: fixed; \`};
|
|
241
|
+
\`;
|
|
242
|
+
|
|
243
|
+
export const StyledMobileBurger = styled.span<Props>\`
|
|
244
|
+
display: block;
|
|
245
|
+
margin: auto 0;
|
|
246
|
+
width: 18px;
|
|
247
|
+
height: 18px;
|
|
248
|
+
position: relative;
|
|
249
|
+
overflow: hidden;
|
|
250
|
+
background: transparent;
|
|
251
|
+
position: relative;
|
|
252
|
+
|
|
253
|
+
&::before,
|
|
254
|
+
&::after {
|
|
255
|
+
content: "";
|
|
256
|
+
display: block;
|
|
257
|
+
position: absolute;
|
|
258
|
+
width: 18px;
|
|
259
|
+
height: 3px;
|
|
260
|
+
border-radius: 3px;
|
|
261
|
+
background: \${({ theme }) =>
|
|
262
|
+
theme.isDark ? theme.colors.dark : theme.colors.primary};
|
|
263
|
+
transition: all 0.3s ease;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&::before {
|
|
267
|
+
top: 3px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
&::after {
|
|
271
|
+
bottom: 3px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
\${({ $isActive }) =>
|
|
275
|
+
$isActive &&
|
|
276
|
+
css\`
|
|
277
|
+
&::before {
|
|
278
|
+
transform: translateY(5px) rotate(45deg);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
&::after {
|
|
282
|
+
transform: translateY(-4px) rotate(-45deg);
|
|
283
|
+
}
|
|
284
|
+
\`};
|
|
285
|
+
\`;
|
|
286
|
+
|
|
287
|
+
export const StyledInlineButton = styled.button<{ theme: Theme }>\`
|
|
288
|
+
\${resetButton};
|
|
289
|
+
\${interactiveStyles};
|
|
290
|
+
color: \${({ theme }) => theme.colors.primary};
|
|
291
|
+
vertical-align: middle;
|
|
292
|
+
border: solid 1px \${({ theme }) => theme.colors.grayLight};
|
|
293
|
+
border-radius: \${({ theme }) => theme.spacing.radius.xs};
|
|
294
|
+
padding: 0;
|
|
295
|
+
width: 18px;
|
|
296
|
+
height: 18px;
|
|
297
|
+
display: flex;
|
|
298
|
+
margin: auto 0;
|
|
299
|
+
transition: all 0.3s ease;
|
|
300
|
+
|
|
301
|
+
@media (hover: hover) {
|
|
302
|
+
&:hover {
|
|
303
|
+
color: \${({ theme }) => theme.colors.light};
|
|
304
|
+
background: \${({ theme }) => theme.colors.primary};
|
|
305
|
+
border-color: \${({ theme }) => theme.colors.primary};
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
& svg {
|
|
310
|
+
vertical-align: middle;
|
|
311
|
+
width: 12px;
|
|
312
|
+
height: 12px;
|
|
313
|
+
margin: auto;
|
|
314
|
+
}
|
|
315
|
+
\`;
|
|
316
|
+
|
|
317
|
+
export const StyledPlusButton = styled.button<{ theme: Theme }>\`
|
|
318
|
+
\${resetButton};
|
|
319
|
+
color: \${({ theme }) => theme.colors.primary};
|
|
320
|
+
vertical-align: middle;
|
|
321
|
+
padding: 0;
|
|
322
|
+
width: 100%;
|
|
323
|
+
height: 18px;
|
|
324
|
+
display: flex;
|
|
325
|
+
margin: auto 0;
|
|
326
|
+
transition: all 0.3s ease;
|
|
327
|
+
position: relative;
|
|
328
|
+
margin: 20px 0 0 0;
|
|
329
|
+
|
|
330
|
+
&::before {
|
|
331
|
+
content: "";
|
|
332
|
+
display: block;
|
|
333
|
+
position: absolute;
|
|
334
|
+
top: 50%;
|
|
335
|
+
transform: translateY(-50%);
|
|
336
|
+
width: 100%;
|
|
337
|
+
height: 1px;
|
|
338
|
+
border-radius: 3px;
|
|
339
|
+
background: \${({ theme }) => theme.colors.grayLight};
|
|
340
|
+
transition: all 0.3s ease;
|
|
341
|
+
z-index: -1;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
&::after {
|
|
345
|
+
content: "";
|
|
346
|
+
display: block;
|
|
347
|
+
position: absolute;
|
|
348
|
+
left: 50%;
|
|
349
|
+
top: 50%;
|
|
350
|
+
transform: translate(-50%, -50%);
|
|
351
|
+
width: 18px;
|
|
352
|
+
height: 18px;
|
|
353
|
+
border: solid 1px \${({ theme }) => theme.colors.grayLight};
|
|
354
|
+
border-radius: \${({ theme }) => theme.spacing.radius.xs};
|
|
355
|
+
background: \${({ theme }) => theme.colors.light};
|
|
356
|
+
transition: all 0.3s ease;
|
|
357
|
+
z-index: -1;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
box-shadow: 0 0 0 0px \${({ theme }) => theme.colors.primary};
|
|
361
|
+
|
|
362
|
+
@media (hover: hover) {
|
|
363
|
+
&:hover {
|
|
364
|
+
&::after {
|
|
365
|
+
border-color: \${({ theme }) => theme.colors.primary};
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
&:focus {
|
|
371
|
+
&::after {
|
|
372
|
+
border-color: \${({ theme }) => theme.colors.primary};
|
|
373
|
+
box-shadow: 0 0 0 4px \${({ theme }) => theme.colors.primaryLight};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
&:active {
|
|
378
|
+
&::after {
|
|
379
|
+
box-shadow: 0 0 0 2px \${({ theme }) => theme.colors.primaryLight};
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@media (hover: hover) {
|
|
384
|
+
&:hover {
|
|
385
|
+
color: \${({ theme }) => theme.colors.light};
|
|
386
|
+
|
|
387
|
+
&::after {
|
|
388
|
+
background: \${({ theme }) => theme.colors.primary};
|
|
389
|
+
border-color: \${({ theme }) => theme.colors.primary};
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
& svg {
|
|
395
|
+
vertical-align: middle;
|
|
396
|
+
width: 14px;
|
|
397
|
+
height: 14px;
|
|
398
|
+
margin: auto;
|
|
399
|
+
}
|
|
400
|
+
\`;
|
|
401
|
+
|
|
402
|
+
export const StyledFullHeightInput = styled.div\`
|
|
403
|
+
height: 100%;
|
|
404
|
+
width: 100%;
|
|
405
|
+
display: flex;
|
|
406
|
+
flex-direction: column;
|
|
407
|
+
gap: 20px;
|
|
408
|
+
flex: 1;
|
|
409
|
+
|
|
410
|
+
& > span {
|
|
411
|
+
height: 100%;
|
|
412
|
+
width: 100%;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
& textarea {
|
|
416
|
+
height: 100%;
|
|
417
|
+
}
|
|
418
|
+
\`;
|
|
419
|
+
|
|
420
|
+
export const StyledEditorWrapper = styled.div\`
|
|
421
|
+
flex: 1;
|
|
422
|
+
|
|
423
|
+
&:empty {
|
|
424
|
+
display: none;
|
|
425
|
+
}
|
|
426
|
+
\`;
|
|
427
|
+
|
|
428
|
+
function DocsWrapper({ children }: DocsProps) {
|
|
429
|
+
return <StyledDocsWrapper>{children}</StyledDocsWrapper>;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
function DocsSidebar({ children }: DocsProps) {
|
|
433
|
+
return <StyledDocsSidebar>{children}</StyledDocsSidebar>;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function DocsContainer({ children }: DocsProps) {
|
|
437
|
+
return <StyledDocsContainer>{children}</StyledDocsContainer>;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export { DocsWrapper, DocsSidebar, DocsContainer };
|
|
441
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const docsTemplate = "\n\"use client\";\nimport { useState } from \"react\";\nimport Link from 'next/link';\nimport { usePathname } from \"next/navigation\";\nimport { Container, Flex, Space } from \"cherry-styled-components/src/lib\";\nimport Markdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { Code } from \"@/app/components/layout/Code\";\nimport { \n DocsWrapper,\n DocsSidebar,\n DocsContainer,\n StyledMarkdownContainer,\n StyledSidebar,\n StyledSidebarList,\n StyledSidebarListItem,\n StyledStrong,\n StyledSidebarListItemLink,\n StyleMobileBar,\n StyledMobileBurger\n} from \"@/app/components/layout/DocsComponents\";\n \nfunction Docs({content, result}) {\n const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);\n const pathname = usePathname();\n console.log(result, \"-\".repeat(100));\n return (\n <Container $padding={20}>\n <DocsWrapper>\n <DocsSidebar>\n <StyleMobileBar\n onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}\n $isActive={isMobileMenuOpen}\n >\n <StyledMobileBurger $isActive={isMobileMenuOpen} />\n </StyleMobileBar>\n\n <StyledSidebar $isActive={isMobileMenuOpen}>\n <StyledSidebarList>\n {result && result.map((item: any, index: number) => {\n return (\n <div key={index}>\n <StyledSidebarListItem>\n <StyledStrong>{item.label}</StyledStrong>{\" \"}\n </StyledSidebarListItem>\n <Space $size={20} />\n {item.links &&\n item.links.map((link: any, indexChild: number) => {\n return (\n <StyledSidebarListItem key={indexChild}>\n <StyledSidebarListItemLink\n href={`/${link.slug}`}\n $isActive={\n pathname ===\n `/${link.slug}`\n }\n onClick={() => setIsMobileMenuOpen(false)}\n >\n {link.title}\n </StyledSidebarListItemLink>\n </StyledSidebarListItem>\n );\n })}\n <Space $size={20} />\n </div>\n );\n })}\n </StyledSidebarList>\n </StyledSidebar>\n </DocsSidebar>\n <DocsContainer>\n <Flex $gap={20}>\n <StyledMarkdownContainer>\n {content && (\n <Markdown\n remarkPlugins={[remarkGfm]}\n components={{\n code(props) {\n const { children, className, node, ...rest } = props;\n const match = /language-(\\w+)/.exec(className || \"\");\n return match ? (\n <Code\n {...rest}\n className={className}\n code={String(children).replace(/\\n$/, \"\")}\n />\n ) : (\n <code {...rest} className={className}>\n {children}\n </code>\n );\n },\n }}\n >\n {content}\n </Markdown>\n )}\n </StyledMarkdownContainer>\n </Flex>\n </DocsContainer>\n </DocsWrapper>\n </Container>\n );\n}\n\nexport { Docs };\n";
|