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.
Files changed (59) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +526 -0
  3. package/dist/templates/click-outside.d.ts +1 -0
  4. package/dist/templates/click-outside.js +28 -0
  5. package/dist/templates/code.d.ts +1 -0
  6. package/dist/templates/code.js +192 -0
  7. package/dist/templates/components/ClickOutside.d.ts +1 -0
  8. package/dist/templates/components/ClickOutside.js +27 -0
  9. package/dist/templates/components/Docs.d.ts +1 -0
  10. package/dist/templates/components/Docs.js +52 -0
  11. package/dist/templates/components/SideBar.d.ts +1 -0
  12. package/dist/templates/components/SideBar.js +80 -0
  13. package/dist/templates/components/layout/Code.d.ts +1 -0
  14. package/dist/templates/components/layout/Code.js +192 -0
  15. package/dist/templates/components/layout/DocsComponents.d.ts +1 -0
  16. package/dist/templates/components/layout/DocsComponents.js +444 -0
  17. package/dist/templates/components/layout/Footer.d.ts +1 -0
  18. package/dist/templates/components/layout/Footer.js +8 -0
  19. package/dist/templates/components/layout/Header.d.ts +1 -0
  20. package/dist/templates/components/layout/Header.js +280 -0
  21. package/dist/templates/components/layout/Icon.d.ts +1 -0
  22. package/dist/templates/components/layout/Icon.js +19 -0
  23. package/dist/templates/components/layout/Pictograms.d.ts +1 -0
  24. package/dist/templates/components/layout/Pictograms.js +66 -0
  25. package/dist/templates/components/layout/SharedStyles.d.ts +1 -0
  26. package/dist/templates/components/layout/SharedStyles.js +791 -0
  27. package/dist/templates/components/layout/ThemeToggle.d.ts +1 -0
  28. package/dist/templates/components/layout/ThemeToggle.js +123 -0
  29. package/dist/templates/components/layout/Typography.d.ts +1 -0
  30. package/dist/templates/components/layout/Typography.js +51 -0
  31. package/dist/templates/docs-components.d.ts +1 -0
  32. package/dist/templates/docs-components.js +441 -0
  33. package/dist/templates/docs.d.ts +1 -0
  34. package/dist/templates/docs.js +48 -0
  35. package/dist/templates/footer.d.ts +1 -0
  36. package/dist/templates/footer.js +9 -0
  37. package/dist/templates/header.d.ts +1 -0
  38. package/dist/templates/header.js +275 -0
  39. package/dist/templates/home.d.ts +1 -0
  40. package/dist/templates/home.js +80 -0
  41. package/dist/templates/icon.d.ts +1 -0
  42. package/dist/templates/icon.js +20 -0
  43. package/dist/templates/layout.d.ts +1 -0
  44. package/dist/templates/layout.js +66 -0
  45. package/dist/templates/not-found.d.ts +1 -0
  46. package/dist/templates/not-found.js +22 -0
  47. package/dist/templates/pictograms.d.ts +1 -0
  48. package/dist/templates/pictograms.js +67 -0
  49. package/dist/templates/shared-styles.d.ts +1 -0
  50. package/dist/templates/shared-styles.js +792 -0
  51. package/dist/templates/theme-toggle.d.ts +1 -0
  52. package/dist/templates/theme-toggle.js +111 -0
  53. package/dist/templates/theme.d.ts +1 -0
  54. package/dist/templates/theme.js +291 -0
  55. package/dist/templates/typography.d.ts +1 -0
  56. package/dist/templates/typography.js +52 -0
  57. package/dist/templates/utils/orderNavItems.d.ts +1 -0
  58. package/dist/templates/utils/orderNavItems.js +45 -0
  59. package/package.json +44 -0
@@ -0,0 +1 @@
1
+ export declare const themeToggleTemplate = "\n\"use client\";\nimport { Theme, resetButton, ThemeContext } from \"cherry-styled-components/src/lib\";\nimport React, { useContext, useEffect } from \"react\";\nimport styled, { css, useTheme } from \"styled-components\";\nimport { useSearchParams } from \"next/navigation\";\nimport { theme as themeLight, themeDark } from \"@/app/theme\";\nimport { Icon } from \"@/app/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\n const searchParams = useSearchParams();\n const themeParam = searchParams.get(\"theme\");\n\n useEffect(() => {\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 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\nexport { ToggleTheme };\n";
@@ -0,0 +1,111 @@
1
+ export const themeToggleTemplate = `
2
+ "use client";
3
+ import { Theme, resetButton, ThemeContext } from "cherry-styled-components/src/lib";
4
+ import React, { useContext, useEffect } from "react";
5
+ import styled, { css, useTheme } from "styled-components";
6
+ import { useSearchParams } from "next/navigation";
7
+ import { theme as themeLight, themeDark } from "@/app/theme";
8
+ import { Icon } from "@/app/components/layout/Icon";
9
+
10
+ const StyledThemeToggle = styled.button<{ theme: Theme; $hidden?: boolean }>\`
11
+ \${resetButton}
12
+ width: 24px;
13
+ height: 24px;
14
+ border-radius: 50%;
15
+ display: flex;
16
+ position: relative;
17
+ margin: auto 0;
18
+ transform: scale(1);
19
+
20
+ \${({ $hidden }) =>
21
+ $hidden &&
22
+ css\`
23
+ display: none;
24
+ \`}
25
+
26
+ & svg {
27
+ width: 100%;
28
+ height: 100%;
29
+ object-fit: contain;
30
+ position: absolute;
31
+ top: 50%;
32
+ left: 50%;
33
+ transform: translate(-50%, -50%) translateY(0);
34
+ margin: auto;
35
+ transition: all 0.3s ease;
36
+
37
+ &.lucide-sun {
38
+ \${({ theme }) =>
39
+ theme.isDark &&
40
+ \`opacity: 0;
41
+ transform: translate(-50%, -50%) translateY(10px);\`}
42
+ }
43
+
44
+ &.lucide-moon-star {
45
+ \${({ theme }) =>
46
+ !theme.isDark &&
47
+ \`opacity: 0;
48
+ transform: translate(-50%, -50%) translateY(10px);\`}
49
+ }
50
+ }
51
+
52
+ & svg[stroke] {
53
+ stroke: \${({ theme }) => theme.colors.primary};
54
+ }
55
+
56
+ @media (hover: hover) {
57
+ &:hover {
58
+ transform: scale(1.05);
59
+ color: \${({ theme }) =>
60
+ theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};
61
+ Toggle & svg[stroke] {
62
+ stroke: \${({ theme }) =>
63
+ theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};
64
+ }
65
+ }
66
+ }
67
+
68
+ &:active {
69
+ transform: scale(0.97);
70
+ }
71
+ \`;
72
+
73
+ function ToggleTheme({ $hidden }: { $hidden?: boolean }) {
74
+ const theme = useTheme() as Theme;
75
+ const { setTheme } = useContext(ThemeContext);
76
+
77
+ const searchParams = useSearchParams();
78
+ const themeParam = searchParams.get("theme");
79
+
80
+ useEffect(() => {
81
+ if (themeParam === "light") {
82
+ setTheme(themeLight);
83
+ localStorage.theme = "light";
84
+ } else if (themeParam === "dark") {
85
+ setTheme(themeDark);
86
+ localStorage.theme = "dark";
87
+ }
88
+ }, [themeParam, setTheme]);
89
+
90
+ return (
91
+ <StyledThemeToggle
92
+ onClick={() => {
93
+ if (theme.isDark) {
94
+ setTheme(themeLight);
95
+ localStorage.theme = "light";
96
+ } else {
97
+ setTheme(themeDark);
98
+ localStorage.theme = "dark";
99
+ }
100
+ }}
101
+ $hidden={$hidden}
102
+ aria-label="Toggle Theme"
103
+ >
104
+ <Icon name="MoonStar" className="dark" />
105
+ <Icon name="Sun" className="light" />
106
+ </StyledThemeToggle>
107
+ );
108
+ }
109
+
110
+ export { ToggleTheme };
111
+ `;
@@ -0,0 +1 @@
1
+ export declare const themeTemplate = "\n\"use client\";\nexport const breakpoints: Breakpoints = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1440,\n xxxl: 1920,\n};\n\nexport function mq(minWidth: keyof Breakpoints) {\n return `@media screen and (min-width: ${breakpoints[minWidth]}px)`;\n}\n\nexport const spacing: Spacing = {\n maxWidth: { xs: \"1280px\", xxxl: \"1440px\" },\n padding: { xs: \"20px\", lg: \"40px\" },\n radius: { xs: \"6px\", lg: \"12px\", xl: \"30px\" },\n gridGap: { xs: \"20px\", lg: \"40px\" },\n};\n\nexport const colors: Colors = {\n primaryLight: \"#93c5fd\",\n primary: \"#3b82f6\",\n primaryDark: \"#1e40af\",\n\n secondaryLight: \"#475569\",\n secondary: \"#1e293b\",\n secondaryDark: \"#020617\",\n\n tertiaryLight: \"#ebccb9\",\n tertiary: \"#816b5a\",\n tertiaryDark: \"#675445\",\n\n grayLight: \"#e5e7eb\",\n gray: \"#9ca3af\",\n grayDark: \"#4b5563\",\n\n success: \"#84cc16\",\n error: \"#ef4444\",\n warning: \"#eab308\",\n info: \"#06b6d4\",\n\n dark: \"#000000\",\n light: \"#ffffff\",\n};\n\nexport const colorsDark: Colors = {\n primaryLight: \"#9bcaff\",\n primary: \"#1e7ae0\",\n primaryDark: \"#033d7e\",\n\n secondaryLight: \"#a4b17b\",\n secondary: \"#5c6e46\",\n secondaryDark: \"#354c2b\",\n\n tertiaryLight: \"#0B0E13\",\n tertiary: \"#372414\",\n tertiaryDark: \"\",\n\n grayLight: \"#1a1a1a\",\n gray: \"#454444\",\n grayDark: \"#808080\",\n\n success: \"#84cc16\",\n error: \"#ef4444\",\n warning: \"#eab308\",\n info: \"#06b6d4\",\n\n dark: \"#ffffff\",\n light: \"#000000\",\n};\n\nexport const shadows: Shadows = {\n xs: \"0px 4px 4px 0px rgba(18, 18, 18, 0.04), 0px 1px 3px 0px rgba(39, 41, 45, 0.02)\",\n sm: \"0px 4px 4px 0px rgba(18, 18, 18, 0.08), 0px 1px 3px 0px rgba(39, 41, 45, 0.04)\",\n md: \"0px 8px 8px 0px rgba(18, 18, 18, 0.16), 0px 2px 3px 0px rgba(39, 41, 45, 0.06)\",\n lg: \"0px 16px 24px 0px rgba(18, 18, 18, 0.20), 0px 2px 3px 0px rgba(39, 41, 45, 0.08)\",\n xl: \"0px 24px 32px 0px rgba(18, 18, 18, 0.24), 0px 2px 3px 0px rgba(39, 41, 45, 0.12)\",\n};\n\nexport const shadowsDark: Shadows = {\n xs: \"0px 4px 4px 0px rgba(255, 255, 255, 0.04), 0px 1px 3px 0px rgba(255, 255, 255, 0.02)\",\n sm: \"0px 4px 4px 0px rgba(255, 255, 255, 0.08), 0px 1px 3px 0px rgba(255, 255, 255, 0.04)\",\n md: \"0px 8px 8px 0px rgba(255, 255, 255, 0.16), 0px 2px 3px 0px rgba(255, 255, 255, 0.06)\",\n lg: \"0px 16px 24px 0px rgba(255, 255, 255, 0.20), 0px 2px 3px 0px rgba(255, 255, 255, 0.08)\",\n xl: \"0px 24px 32px 0px rgba(255, 255, 255, 0.24), 0px 2px 3px 0px rgba(255, 255, 255, 0.12)\",\n};\n\nexport const fonts: Fonts = {\n text: \"Inter\",\n head: \"Inter\",\n mono: \"Roboto Mono\",\n};\n\nexport const fontSizes: FontSizes = {\n hero1: { xs: \"72px\", lg: \"128px\" },\n hero2: { xs: \"60px\", lg: \"96px\" },\n hero3: { xs: \"36px\", lg: \"72px\" },\n\n h1: { xs: \"40px\", lg: \"60px\" },\n h2: { xs: \"30px\", lg: \"36px\" },\n h3: { xs: \"28px\", lg: \"30px\" },\n h4: { xs: \"24px\", lg: \"26px\" },\n h5: { xs: \"18px\", lg: \"20px\" },\n h6: { xs: \"16px\", lg: \"18px\" },\n\n text: { xs: \"14px\", lg: \"16px\" },\n strong: { xs: \"14px\", lg: \"16px\" },\n small: { xs: \"12px\", lg: \"14px\" },\n\n blockquote: { xs: \"16px\", lg: \"18px\" },\n code: { xs: \"14px\", lg: \"16px\" },\n\n button: { xs: \"16px\", lg: \"16px\" },\n buttonBig: { xs: \"18px\", lg: \"18px\" },\n\n input: { xs: \"16px\", lg: \"16px\" },\n inputBig: { xs: \"18px\", lg: \"18px\" },\n};\n\nexport const lineHeights: LineHeights = {\n hero1: { xs: \"1.1\", lg: \"1.1\" },\n hero2: { xs: \"1.1\", lg: \"1.1\" },\n hero3: { xs: \"1.17\", lg: \"1.1\" },\n\n h1: { xs: \"1\", lg: \"1.07\" },\n h2: { xs: \"1.2\", lg: \"1.2\" },\n h3: { xs: \"1.3\", lg: \"1.5\" },\n h4: { xs: \"1.3\", lg: \"1.5\" },\n h5: { xs: \"1.6\", lg: \"1.5\" },\n h6: { xs: \"1.6\", lg: \"1.6\" },\n\n text: { xs: \"1.7\", lg: \"1.7\" },\n strong: { xs: \"1.7\", lg: \"1.7\" },\n small: { xs: \"1.7\", lg: \"1.7\" },\n\n blockquote: { xs: \"1.7\", lg: \"1.7\" },\n code: { xs: \"1.7\", lg: \"1.7\" },\n\n button: { xs: \"1\", lg: \"1\" },\n buttonBig: { xs: \"1\", lg: \"1\" },\n\n input: { xs: \"1\", lg: \"1\" },\n inputBig: { xs: \"1\", lg: \"1\" },\n};\n\nexport const theme: Theme = {\n breakpoints,\n spacing,\n colors,\n shadows,\n fonts,\n fontSizes,\n lineHeights,\n isDark: false,\n};\n\nexport const themeDark: Theme = {\n breakpoints,\n spacing,\n colors: colorsDark,\n shadows: shadowsDark,\n fonts,\n fontSizes,\n lineHeights,\n isDark: true,\n};\n\nexport interface Breakpoints<TNumber = number> {\n xs: TNumber;\n sm: TNumber;\n md: TNumber;\n lg: TNumber;\n xl: TNumber;\n xxl: TNumber;\n xxxl: TNumber;\n}\n\nexport interface Spacing<TString = string> {\n maxWidth: { xs: TString; xxxl: TString };\n padding: { xs: TString; lg: TString };\n radius: { xs: TString; lg: TString; xl: TString };\n gridGap: { xs: TString; lg: TString };\n}\n\nexport interface Colors<TString = string> {\n primaryLight: TString;\n primary: TString;\n primaryDark: TString;\n\n secondaryLight: TString;\n secondary: TString;\n secondaryDark: TString;\n\n tertiaryLight: TString;\n tertiary: TString;\n tertiaryDark: TString;\n\n grayLight: TString;\n gray: TString;\n grayDark: TString;\n\n success: TString;\n error: TString;\n warning: TString;\n info: TString;\n\n dark: TString;\n light: TString;\n}\n\ninterface Shadows<TString = string> {\n xs: TString;\n sm: TString;\n md: TString;\n lg: TString;\n xl: TString;\n}\n\nexport interface Fonts<TString = string> {\n head: TString;\n text: TString;\n mono: TString;\n}\n\nexport interface FontSizes<TString = string> {\n hero1: { xs: TString; lg: TString };\n hero2: { xs: TString; lg: TString };\n hero3: { xs: TString; lg: TString };\n\n h1: { xs: TString; lg: TString };\n h2: { xs: TString; lg: TString };\n h3: { xs: TString; lg: TString };\n h4: { xs: TString; lg: TString };\n h5: { xs: TString; lg: TString };\n h6: { xs: TString; lg: TString };\n\n text: { xs: TString; lg: TString };\n strong: { xs: TString; lg: TString };\n small: { xs: TString; lg: TString };\n\n blockquote: { xs: TString; lg: TString };\n code: { xs: TString; lg: TString };\n\n button: { xs: TString; lg: TString };\n buttonBig: { xs: TString; lg: TString };\n\n input: { xs: TString; lg: TString };\n inputBig: { xs: TString; lg: TString };\n}\n\nexport interface LineHeights<TString = string> {\n hero1: { xs: TString; lg: TString };\n hero2: { xs: TString; lg: TString };\n hero3: { xs: TString; lg: TString };\n\n h1: { xs: TString; lg: TString };\n h2: { xs: TString; lg: TString };\n h3: { xs: TString; lg: TString };\n h4: { xs: TString; lg: TString };\n h5: { xs: TString; lg: TString };\n h6: { xs: TString; lg: TString };\n\n text: { xs: TString; lg: TString };\n strong: { xs: TString; lg: TString };\n small: { xs: TString; lg: TString };\n\n blockquote: { xs: TString; lg: TString };\n code: { xs: TString; lg: TString };\n\n button: { xs: TString; lg: TString };\n buttonBig: { xs: TString; lg: TString };\n\n input: { xs: TString; lg: TString };\n inputBig: { xs: TString; lg: TString };\n}\n\nexport interface Theme {\n breakpoints: Breakpoints;\n spacing: Spacing;\n colors: Colors;\n shadows: Shadows;\n fonts: Fonts;\n fontSizes: FontSizes;\n lineHeights: LineHeights;\n isDark: boolean;\n}\n";
@@ -0,0 +1,291 @@
1
+ export const themeTemplate = `
2
+ "use client";
3
+ export const breakpoints: Breakpoints = {
4
+ xs: 0,
5
+ sm: 576,
6
+ md: 768,
7
+ lg: 992,
8
+ xl: 1200,
9
+ xxl: 1440,
10
+ xxxl: 1920,
11
+ };
12
+
13
+ export function mq(minWidth: keyof Breakpoints) {
14
+ return \`@media screen and (min-width: \${breakpoints[minWidth]}px)\`;
15
+ }
16
+
17
+ export const spacing: Spacing = {
18
+ maxWidth: { xs: "1280px", xxxl: "1440px" },
19
+ padding: { xs: "20px", lg: "40px" },
20
+ radius: { xs: "6px", lg: "12px", xl: "30px" },
21
+ gridGap: { xs: "20px", lg: "40px" },
22
+ };
23
+
24
+ export const colors: Colors = {
25
+ primaryLight: "#93c5fd",
26
+ primary: "#3b82f6",
27
+ primaryDark: "#1e40af",
28
+
29
+ secondaryLight: "#475569",
30
+ secondary: "#1e293b",
31
+ secondaryDark: "#020617",
32
+
33
+ tertiaryLight: "#ebccb9",
34
+ tertiary: "#816b5a",
35
+ tertiaryDark: "#675445",
36
+
37
+ grayLight: "#e5e7eb",
38
+ gray: "#9ca3af",
39
+ grayDark: "#4b5563",
40
+
41
+ success: "#84cc16",
42
+ error: "#ef4444",
43
+ warning: "#eab308",
44
+ info: "#06b6d4",
45
+
46
+ dark: "#000000",
47
+ light: "#ffffff",
48
+ };
49
+
50
+ export const colorsDark: Colors = {
51
+ primaryLight: "#9bcaff",
52
+ primary: "#1e7ae0",
53
+ primaryDark: "#033d7e",
54
+
55
+ secondaryLight: "#a4b17b",
56
+ secondary: "#5c6e46",
57
+ secondaryDark: "#354c2b",
58
+
59
+ tertiaryLight: "#0B0E13",
60
+ tertiary: "#372414",
61
+ tertiaryDark: "",
62
+
63
+ grayLight: "#1a1a1a",
64
+ gray: "#454444",
65
+ grayDark: "#808080",
66
+
67
+ success: "#84cc16",
68
+ error: "#ef4444",
69
+ warning: "#eab308",
70
+ info: "#06b6d4",
71
+
72
+ dark: "#ffffff",
73
+ light: "#000000",
74
+ };
75
+
76
+ export const shadows: Shadows = {
77
+ xs: "0px 4px 4px 0px rgba(18, 18, 18, 0.04), 0px 1px 3px 0px rgba(39, 41, 45, 0.02)",
78
+ sm: "0px 4px 4px 0px rgba(18, 18, 18, 0.08), 0px 1px 3px 0px rgba(39, 41, 45, 0.04)",
79
+ md: "0px 8px 8px 0px rgba(18, 18, 18, 0.16), 0px 2px 3px 0px rgba(39, 41, 45, 0.06)",
80
+ lg: "0px 16px 24px 0px rgba(18, 18, 18, 0.20), 0px 2px 3px 0px rgba(39, 41, 45, 0.08)",
81
+ xl: "0px 24px 32px 0px rgba(18, 18, 18, 0.24), 0px 2px 3px 0px rgba(39, 41, 45, 0.12)",
82
+ };
83
+
84
+ export const shadowsDark: Shadows = {
85
+ xs: "0px 4px 4px 0px rgba(255, 255, 255, 0.04), 0px 1px 3px 0px rgba(255, 255, 255, 0.02)",
86
+ sm: "0px 4px 4px 0px rgba(255, 255, 255, 0.08), 0px 1px 3px 0px rgba(255, 255, 255, 0.04)",
87
+ md: "0px 8px 8px 0px rgba(255, 255, 255, 0.16), 0px 2px 3px 0px rgba(255, 255, 255, 0.06)",
88
+ lg: "0px 16px 24px 0px rgba(255, 255, 255, 0.20), 0px 2px 3px 0px rgba(255, 255, 255, 0.08)",
89
+ xl: "0px 24px 32px 0px rgba(255, 255, 255, 0.24), 0px 2px 3px 0px rgba(255, 255, 255, 0.12)",
90
+ };
91
+
92
+ export const fonts: Fonts = {
93
+ text: "Inter",
94
+ head: "Inter",
95
+ mono: "Roboto Mono",
96
+ };
97
+
98
+ export const fontSizes: FontSizes = {
99
+ hero1: { xs: "72px", lg: "128px" },
100
+ hero2: { xs: "60px", lg: "96px" },
101
+ hero3: { xs: "36px", lg: "72px" },
102
+
103
+ h1: { xs: "40px", lg: "60px" },
104
+ h2: { xs: "30px", lg: "36px" },
105
+ h3: { xs: "28px", lg: "30px" },
106
+ h4: { xs: "24px", lg: "26px" },
107
+ h5: { xs: "18px", lg: "20px" },
108
+ h6: { xs: "16px", lg: "18px" },
109
+
110
+ text: { xs: "14px", lg: "16px" },
111
+ strong: { xs: "14px", lg: "16px" },
112
+ small: { xs: "12px", lg: "14px" },
113
+
114
+ blockquote: { xs: "16px", lg: "18px" },
115
+ code: { xs: "14px", lg: "16px" },
116
+
117
+ button: { xs: "16px", lg: "16px" },
118
+ buttonBig: { xs: "18px", lg: "18px" },
119
+
120
+ input: { xs: "16px", lg: "16px" },
121
+ inputBig: { xs: "18px", lg: "18px" },
122
+ };
123
+
124
+ export const lineHeights: LineHeights = {
125
+ hero1: { xs: "1.1", lg: "1.1" },
126
+ hero2: { xs: "1.1", lg: "1.1" },
127
+ hero3: { xs: "1.17", lg: "1.1" },
128
+
129
+ h1: { xs: "1", lg: "1.07" },
130
+ h2: { xs: "1.2", lg: "1.2" },
131
+ h3: { xs: "1.3", lg: "1.5" },
132
+ h4: { xs: "1.3", lg: "1.5" },
133
+ h5: { xs: "1.6", lg: "1.5" },
134
+ h6: { xs: "1.6", lg: "1.6" },
135
+
136
+ text: { xs: "1.7", lg: "1.7" },
137
+ strong: { xs: "1.7", lg: "1.7" },
138
+ small: { xs: "1.7", lg: "1.7" },
139
+
140
+ blockquote: { xs: "1.7", lg: "1.7" },
141
+ code: { xs: "1.7", lg: "1.7" },
142
+
143
+ button: { xs: "1", lg: "1" },
144
+ buttonBig: { xs: "1", lg: "1" },
145
+
146
+ input: { xs: "1", lg: "1" },
147
+ inputBig: { xs: "1", lg: "1" },
148
+ };
149
+
150
+ export const theme: Theme = {
151
+ breakpoints,
152
+ spacing,
153
+ colors,
154
+ shadows,
155
+ fonts,
156
+ fontSizes,
157
+ lineHeights,
158
+ isDark: false,
159
+ };
160
+
161
+ export const themeDark: Theme = {
162
+ breakpoints,
163
+ spacing,
164
+ colors: colorsDark,
165
+ shadows: shadowsDark,
166
+ fonts,
167
+ fontSizes,
168
+ lineHeights,
169
+ isDark: true,
170
+ };
171
+
172
+ export interface Breakpoints<TNumber = number> {
173
+ xs: TNumber;
174
+ sm: TNumber;
175
+ md: TNumber;
176
+ lg: TNumber;
177
+ xl: TNumber;
178
+ xxl: TNumber;
179
+ xxxl: TNumber;
180
+ }
181
+
182
+ export interface Spacing<TString = string> {
183
+ maxWidth: { xs: TString; xxxl: TString };
184
+ padding: { xs: TString; lg: TString };
185
+ radius: { xs: TString; lg: TString; xl: TString };
186
+ gridGap: { xs: TString; lg: TString };
187
+ }
188
+
189
+ export interface Colors<TString = string> {
190
+ primaryLight: TString;
191
+ primary: TString;
192
+ primaryDark: TString;
193
+
194
+ secondaryLight: TString;
195
+ secondary: TString;
196
+ secondaryDark: TString;
197
+
198
+ tertiaryLight: TString;
199
+ tertiary: TString;
200
+ tertiaryDark: TString;
201
+
202
+ grayLight: TString;
203
+ gray: TString;
204
+ grayDark: TString;
205
+
206
+ success: TString;
207
+ error: TString;
208
+ warning: TString;
209
+ info: TString;
210
+
211
+ dark: TString;
212
+ light: TString;
213
+ }
214
+
215
+ interface Shadows<TString = string> {
216
+ xs: TString;
217
+ sm: TString;
218
+ md: TString;
219
+ lg: TString;
220
+ xl: TString;
221
+ }
222
+
223
+ export interface Fonts<TString = string> {
224
+ head: TString;
225
+ text: TString;
226
+ mono: TString;
227
+ }
228
+
229
+ export interface FontSizes<TString = string> {
230
+ hero1: { xs: TString; lg: TString };
231
+ hero2: { xs: TString; lg: TString };
232
+ hero3: { xs: TString; lg: TString };
233
+
234
+ h1: { xs: TString; lg: TString };
235
+ h2: { xs: TString; lg: TString };
236
+ h3: { xs: TString; lg: TString };
237
+ h4: { xs: TString; lg: TString };
238
+ h5: { xs: TString; lg: TString };
239
+ h6: { xs: TString; lg: TString };
240
+
241
+ text: { xs: TString; lg: TString };
242
+ strong: { xs: TString; lg: TString };
243
+ small: { xs: TString; lg: TString };
244
+
245
+ blockquote: { xs: TString; lg: TString };
246
+ code: { xs: TString; lg: TString };
247
+
248
+ button: { xs: TString; lg: TString };
249
+ buttonBig: { xs: TString; lg: TString };
250
+
251
+ input: { xs: TString; lg: TString };
252
+ inputBig: { xs: TString; lg: TString };
253
+ }
254
+
255
+ export interface LineHeights<TString = string> {
256
+ hero1: { xs: TString; lg: TString };
257
+ hero2: { xs: TString; lg: TString };
258
+ hero3: { xs: TString; lg: TString };
259
+
260
+ h1: { xs: TString; lg: TString };
261
+ h2: { xs: TString; lg: TString };
262
+ h3: { xs: TString; lg: TString };
263
+ h4: { xs: TString; lg: TString };
264
+ h5: { xs: TString; lg: TString };
265
+ h6: { xs: TString; lg: TString };
266
+
267
+ text: { xs: TString; lg: TString };
268
+ strong: { xs: TString; lg: TString };
269
+ small: { xs: TString; lg: TString };
270
+
271
+ blockquote: { xs: TString; lg: TString };
272
+ code: { xs: TString; lg: TString };
273
+
274
+ button: { xs: TString; lg: TString };
275
+ buttonBig: { xs: TString; lg: TString };
276
+
277
+ input: { xs: TString; lg: TString };
278
+ inputBig: { xs: TString; lg: TString };
279
+ }
280
+
281
+ export interface Theme {
282
+ breakpoints: Breakpoints;
283
+ spacing: Spacing;
284
+ colors: Colors;
285
+ shadows: Shadows;
286
+ fonts: Fonts;
287
+ fontSizes: FontSizes;
288
+ lineHeights: LineHeights;
289
+ isDark: boolean;
290
+ }
291
+ `;
@@ -0,0 +1 @@
1
+ export declare const typographyTemplate = "\n\"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,52 @@
1
+ export const typographyTemplate = `
2
+ "use client";
3
+ import {
4
+ styledH1,
5
+ styledH2,
6
+ styledH3,
7
+ styledH4,
8
+ styledH5,
9
+ styledH6,
10
+ styledText,
11
+ Theme,
12
+ } from "cherry-styled-components/src/lib";
13
+ import styled, { css } from "styled-components";
14
+
15
+ const StyledHeading = css\`
16
+ font-weight: 900;
17
+ \`;
18
+
19
+ export const StyledH1 = styled.h1<{ theme: Theme }>\`
20
+ \${StyledHeading};
21
+ \${({ theme }) => styledH1(theme)}
22
+ \`;
23
+
24
+ export const StyledH2 = styled.h2<{ theme: Theme }>\`
25
+ \${StyledHeading};
26
+ \${({ theme }) => styledH2(theme)}
27
+ \`;
28
+
29
+ export const StyledH3 = styled.h3<{ theme: Theme }>\`
30
+ \${StyledHeading};
31
+ \${({ theme }) => styledH3(theme)}
32
+ \`;
33
+
34
+ export const StyledH4 = styled.h4<{ theme: Theme }>\`
35
+ \${StyledHeading};
36
+ \${({ theme }) => styledH4(theme)}
37
+ \`;
38
+
39
+ export const StyledH5 = styled.h5<{ theme: Theme }>\`
40
+ \${StyledHeading};
41
+ \${({ theme }) => styledH5(theme)}
42
+ \`;
43
+
44
+ export const StyledH6 = styled.h6<{ theme: Theme }>\`
45
+ \${StyledHeading};
46
+ \${({ theme }) => styledH6(theme)}
47
+ \`;
48
+
49
+ export const StyledText = styled.p<{ theme: Theme }>\`
50
+ \${({ theme }) => styledText(theme)}
51
+ \`;
52
+ `;
@@ -0,0 +1 @@
1
+ export declare const orderNavItemsTemplate = "interface PagesProps {\n slug: string;\n title: string;\n date: string;\n category: string;\n categoryOrder?: number;\n order?: number;\n}\n\ninterface AccProps {\n [key: string]: { categoryOrder: number; pages: { date: string; slug: string; title: string; order: number }[] };\n}\n\nfunction transformPagesToGroupedStructure(pages: PagesProps[]) {\n const grouped = pages.reduce((acc: AccProps, page: PagesProps) => {\n const category = page.category || 'Uncategorized';\n \n if (!acc[category]) {\n acc[category] = {\n categoryOrder: page.categoryOrder || 0,\n pages: []\n };\n }\n \n acc[category].pages.push({\n date: page.date,\n slug: page.slug,\n title: page.title,\n order: page.order || 0\n });\n \n return acc;\n }, {});\n\n return Object.entries(grouped)\n .sort(([, a], [, b]) => a.categoryOrder - b.categoryOrder)\n .map(([categoryName, categoryData], index) => ({\n slug: index === 0 ? \"\" : categoryName.toLowerCase().replace(/s+/g, '-'),\n label: categoryName,\n links: categoryData.pages.sort((a, b) => a.order - b.order)\n }));\n}\n\nexport { transformPagesToGroupedStructure };\n";
@@ -0,0 +1,45 @@
1
+ export const orderNavItemsTemplate = `interface PagesProps {
2
+ slug: string;
3
+ title: string;
4
+ date: string;
5
+ category: string;
6
+ categoryOrder?: number;
7
+ order?: number;
8
+ }
9
+
10
+ interface AccProps {
11
+ [key: string]: { categoryOrder: number; pages: { date: string; slug: string; title: string; order: number }[] };
12
+ }
13
+
14
+ function transformPagesToGroupedStructure(pages: PagesProps[]) {
15
+ const grouped = pages.reduce((acc: AccProps, page: PagesProps) => {
16
+ const category = page.category || 'Uncategorized';
17
+
18
+ if (!acc[category]) {
19
+ acc[category] = {
20
+ categoryOrder: page.categoryOrder || 0,
21
+ pages: []
22
+ };
23
+ }
24
+
25
+ acc[category].pages.push({
26
+ date: page.date,
27
+ slug: page.slug,
28
+ title: page.title,
29
+ order: page.order || 0
30
+ });
31
+
32
+ return acc;
33
+ }, {});
34
+
35
+ return Object.entries(grouped)
36
+ .sort(([, a], [, b]) => a.categoryOrder - b.categoryOrder)
37
+ .map(([categoryName, categoryData], index) => ({
38
+ slug: index === 0 ? "" : categoryName.toLowerCase().replace(/\s+/g, '-'),
39
+ label: categoryName,
40
+ links: categoryData.pages.sort((a, b) => a.order - b.order)
41
+ }));
42
+ }
43
+
44
+ export { transformPagesToGroupedStructure };
45
+ `;
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "doccupine",
3
+ "version": "0.0.1",
4
+ "description": "CLI tool to watch MDX files and generate Next.js beautiful documentation pages automatically",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "doccupine-beta": "dist/index.js"
8
+ },
9
+ "type": "module",
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
13
+ "start": "node dist/index.js",
14
+ "prepare": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "doccupine",
18
+ "documentation",
19
+ "mdx",
20
+ "nextjs",
21
+ "cli",
22
+ "file-watcher",
23
+ "static-site-generator"
24
+ ],
25
+ "author": "Luan Gjokaj",
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "chalk": "^5.3.0",
29
+ "chokidar": "^3.5.3",
30
+ "commander": "^11.1.0",
31
+ "fs-extra": "^11.2.0",
32
+ "gray-matter": "^4.0.3",
33
+ "prompts": "^2.4.2"
34
+ },
35
+ "devDependencies": {
36
+ "@types/fs-extra": "^11.0.4",
37
+ "@types/node": "^20.10.5",
38
+ "@types/prompts": "^2.4.9",
39
+ "typescript": "^5.3.3"
40
+ },
41
+ "files": [
42
+ "dist/**/*"
43
+ ]
44
+ }