doccupine 0.0.87 → 0.0.89

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 (78) hide show
  1. package/README.md +15 -2
  2. package/dist/index.js +177 -4
  3. package/dist/lib/layout.js +38 -24
  4. package/dist/lib/metadata.d.ts +30 -0
  5. package/dist/lib/metadata.js +98 -1
  6. package/dist/lib/structures.js +0 -2
  7. package/dist/lib/types.d.ts +1 -0
  8. package/dist/templates/app/robots.d.ts +1 -1
  9. package/dist/templates/app/robots.js +28 -1
  10. package/dist/templates/app/sitemap.d.ts +7 -0
  11. package/dist/templates/app/sitemap.js +56 -0
  12. package/dist/templates/app/theme.d.ts +1 -1
  13. package/dist/templates/app/theme.js +84 -19
  14. package/dist/templates/components/Chat.d.ts +1 -1
  15. package/dist/templates/components/Chat.js +26 -27
  16. package/dist/templates/components/SearchModalContent.d.ts +1 -1
  17. package/dist/templates/components/SearchModalContent.js +12 -6
  18. package/dist/templates/components/SideBar.d.ts +1 -1
  19. package/dist/templates/components/SideBar.js +3 -1
  20. package/dist/templates/components/layout/Accordion.d.ts +1 -1
  21. package/dist/templates/components/layout/Accordion.js +2 -1
  22. package/dist/templates/components/layout/ActionBar.d.ts +1 -1
  23. package/dist/templates/components/layout/ActionBar.js +4 -6
  24. package/dist/templates/components/layout/Button.d.ts +1 -1
  25. package/dist/templates/components/layout/Button.js +10 -0
  26. package/dist/templates/components/layout/Callout.d.ts +1 -1
  27. package/dist/templates/components/layout/Callout.js +75 -20
  28. package/dist/templates/components/layout/Card.d.ts +1 -1
  29. package/dist/templates/components/layout/Card.js +2 -1
  30. package/dist/templates/components/layout/CherryThemeProvider.d.ts +1 -1
  31. package/dist/templates/components/layout/CherryThemeProvider.js +6 -12
  32. package/dist/templates/components/layout/ClientThemeProvider.d.ts +1 -1
  33. package/dist/templates/components/layout/ClientThemeProvider.js +45 -40
  34. package/dist/templates/components/layout/Code.d.ts +1 -1
  35. package/dist/templates/components/layout/Code.js +223 -255
  36. package/dist/templates/components/layout/ColorSwatch.d.ts +1 -1
  37. package/dist/templates/components/layout/ColorSwatch.js +2 -2
  38. package/dist/templates/components/layout/Columns.d.ts +1 -1
  39. package/dist/templates/components/layout/Columns.js +1 -1
  40. package/dist/templates/components/layout/DemoTheme.d.ts +1 -1
  41. package/dist/templates/components/layout/DemoTheme.js +65 -167
  42. package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
  43. package/dist/templates/components/layout/DocsComponents.js +13 -19
  44. package/dist/templates/components/layout/Field.d.ts +1 -1
  45. package/dist/templates/components/layout/Field.js +6 -4
  46. package/dist/templates/components/layout/Footer.d.ts +1 -1
  47. package/dist/templates/components/layout/Footer.js +1 -2
  48. package/dist/templates/components/layout/GlobalStyles.d.ts +1 -1
  49. package/dist/templates/components/layout/GlobalStyles.js +63 -10
  50. package/dist/templates/components/layout/Header.d.ts +1 -1
  51. package/dist/templates/components/layout/Header.js +14 -11
  52. package/dist/templates/components/layout/SharedStyles.d.ts +1 -1
  53. package/dist/templates/components/layout/SharedStyles.js +4 -5
  54. package/dist/templates/components/layout/StaticLinks.d.ts +1 -1
  55. package/dist/templates/components/layout/StaticLinks.js +4 -6
  56. package/dist/templates/components/layout/Steps.d.ts +1 -1
  57. package/dist/templates/components/layout/Steps.js +3 -3
  58. package/dist/templates/components/layout/Tabs.d.ts +1 -1
  59. package/dist/templates/components/layout/Tabs.js +5 -2
  60. package/dist/templates/components/layout/ThemeToggle.d.ts +1 -1
  61. package/dist/templates/components/layout/ThemeToggle.js +17 -19
  62. package/dist/templates/components/layout/Typography.d.ts +1 -1
  63. package/dist/templates/components/layout/Typography.js +1 -1
  64. package/dist/templates/components/layout/Update.d.ts +1 -1
  65. package/dist/templates/components/layout/Update.js +4 -3
  66. package/dist/templates/env.example.d.ts +1 -1
  67. package/dist/templates/env.example.js +5 -1
  68. package/dist/templates/mdx/deployment-and-hosting.mdx.d.ts +1 -1
  69. package/dist/templates/mdx/deployment-and-hosting.mdx.js +19 -0
  70. package/dist/templates/mdx/globals.mdx.d.ts +1 -1
  71. package/dist/templates/mdx/globals.mdx.js +3 -1
  72. package/dist/templates/mdx/platform/site-settings.mdx.d.ts +1 -1
  73. package/dist/templates/mdx/platform/site-settings.mdx.js +5 -1
  74. package/dist/templates/package.js +17 -18
  75. package/dist/templates/proxy.js +14 -20
  76. package/dist/templates/utils/config.d.ts +1 -1
  77. package/dist/templates/utils/config.js +1 -0
  78. package/package.json +8 -8
@@ -1 +1 @@
1
- export declare const demoThemeTemplate = "\"use client\";\nimport { Button } from \"@/components/layout/Button\";\nimport { useThemeOverride } from \"@/components/layout/ClientThemeProvider\";\nimport { Theme, theme, themeDark } from \"@/app/theme\";\nimport { Columns } from \"@/components/layout/Columns\";\n\ninterface DemoThemeProps {\n variant: \"purple\" | \"green\" | \"yellow\";\n}\n\nfunction DemoTheme({ variant }: DemoThemeProps) {\n const { setTheme } = useThemeOverride();\n\n const purpleLight: Theme = {\n ...theme,\n colors: {\n primaryLight: \"#c4b5fd\",\n primary: \"#8b5cf6\",\n primaryDark: \"#5b21b6\",\n secondaryLight: \"#86efac\",\n secondary: \"#22c55e\",\n secondaryDark: \"#15803d\",\n tertiaryLight: \"#fbbf24\",\n tertiary: \"#f59e0b\",\n tertiaryDark: \"#d97706\",\n grayLight: \"#f3f4f6\",\n gray: \"#9ca3af\",\n grayDark: \"#374151\",\n success: \"#10b981\",\n error: \"#f43f5e\",\n warning: \"#f59e0b\",\n info: \"#3b82f6\",\n dark: \"#000000\",\n light: \"#ffffff\",\n },\n };\n\n const purpleDark: Theme = {\n ...themeDark,\n colors: {\n primaryLight: \"#ddd6fe\",\n primary: \"#a78bfa\",\n primaryDark: \"#7c3aed\",\n secondaryLight: \"#6ee7b7\",\n secondary: \"#10b981\",\n secondaryDark: \"#065f46\",\n tertiaryLight: \"#fed7aa\",\n tertiary: \"#fb923c\",\n tertiaryDark: \"#ea580c\",\n grayLight: \"#1f2937\",\n gray: \"#6b7280\",\n grayDark: \"#9ca3af\",\n success: \"#10b981\",\n error: \"#f43f5e\",\n warning: \"#f59e0b\",\n info: \"#3b82f6\",\n dark: \"#ffffff\",\n light: \"#000000\",\n },\n };\n\n const greenLight: Theme = {\n ...theme,\n colors: {\n primaryLight: \"#86efac\",\n primary: \"#22c55e\",\n primaryDark: \"#15803d\",\n secondaryLight: \"#c4b5fd\",\n secondary: \"#8b5cf6\",\n secondaryDark: \"#5b21b6\",\n tertiaryLight: \"#fbbf24\",\n tertiary: \"#f59e0b\",\n tertiaryDark: \"#d97706\",\n grayLight: \"#f3f4f6\",\n gray: \"#9ca3af\",\n grayDark: \"#374151\",\n success: \"#10b981\",\n error: \"#f43f5e\",\n warning: \"#f59e0b\",\n info: \"#3b82f6\",\n dark: \"#000000\",\n light: \"#ffffff\",\n },\n };\n\n const greenDark: Theme = {\n ...themeDark,\n colors: {\n primaryLight: \"#6ee7b7\",\n primary: \"#10b981\",\n primaryDark: \"#065f46\",\n secondaryLight: \"#ddd6fe\",\n secondary: \"#a78bfa\",\n secondaryDark: \"#7c3aed\",\n tertiaryLight: \"#fed7aa\",\n tertiary: \"#fb923c\",\n tertiaryDark: \"#ea580c\",\n grayLight: \"#1f2937\",\n gray: \"#6b7280\",\n grayDark: \"#9ca3af\",\n success: \"#10b981\",\n error: \"#f43f5e\",\n warning: \"#f59e0b\",\n info: \"#3b82f6\",\n dark: \"#ffffff\",\n light: \"#000000\",\n },\n };\n\n const yellowLight: Theme = {\n ...theme,\n colors: {\n primaryLight: \"#fbbf24\",\n primary: \"#f59e0b\",\n primaryDark: \"#d97706\",\n secondaryLight: \"#c4b5fd\",\n secondary: \"#8b5cf6\",\n secondaryDark: \"#5b21b6\",\n tertiaryLight: \"#86efac\",\n tertiary: \"#22c55e\",\n tertiaryDark: \"#15803d\",\n grayLight: \"#f3f4f6\",\n gray: \"#9ca3af\",\n grayDark: \"#374151\",\n success: \"#10b981\",\n error: \"#f43f5e\",\n warning: \"#f59e0b\",\n info: \"#3b82f6\",\n dark: \"#000000\",\n light: \"#ffffff\",\n },\n };\n\n const yellowDark: Theme = {\n ...themeDark,\n colors: {\n primaryLight: \"#fed7aa\",\n primary: \"#fb923c\",\n primaryDark: \"#ea580c\",\n secondaryLight: \"#ddd6fe\",\n secondary: \"#a78bfa\",\n secondaryDark: \"#7c3aed\",\n tertiaryLight: \"#6ee7b7\",\n tertiary: \"#10b981\",\n tertiaryDark: \"#065f46\",\n grayLight: \"#1f2937\",\n gray: \"#6b7280\",\n grayDark: \"#9ca3af\",\n success: \"#10b981\",\n error: \"#f43f5e\",\n warning: \"#f59e0b\",\n info: \"#3b82f6\",\n dark: \"#ffffff\",\n light: \"#000000\",\n },\n };\n\n if (variant === \"purple\") {\n return (\n <Columns cols={2}>\n <Button onClick={() => setTheme(purpleLight)} icon=\"sun\" fullWidth>\n Demo Purple Light\n </Button>\n <Button\n outline\n onClick={() => setTheme(purpleDark)}\n icon=\"moon-star\"\n fullWidth\n >\n Demo Purple Dark\n </Button>\n </Columns>\n );\n }\n\n if (variant === \"green\") {\n return (\n <Columns cols={2}>\n <Button onClick={() => setTheme(greenLight)} icon=\"sun\" fullWidth>\n Demo Green Light\n </Button>\n <Button\n outline\n onClick={() => setTheme(greenDark)}\n icon=\"moon-star\"\n fullWidth\n >\n Demo Green Dark\n </Button>\n </Columns>\n );\n }\n\n if (variant === \"yellow\") {\n return (\n <Columns cols={2}>\n <Button onClick={() => setTheme(yellowLight)} icon=\"sun\" fullWidth>\n Demo Yellow Light\n </Button>\n <Button\n outline\n onClick={() => setTheme(yellowDark)}\n icon=\"moon-star\"\n fullWidth\n >\n Demo Yellow Dark\n </Button>\n </Columns>\n );\n }\n\n return (\n <Columns cols={2}>\n <Button onClick={() => setTheme(null)} fullWidth>\n Reset to Default\n </Button>\n </Columns>\n );\n}\n\nexport { DemoTheme };\n";
1
+ export declare const demoThemeTemplate = "\"use client\";\nimport { Button } from \"@/components/layout/Button\";\nimport { useThemeOverride } from \"@/components/layout/ClientThemeProvider\";\nimport { Columns } from \"@/components/layout/Columns\";\n\ninterface DemoThemeProps {\n variant: \"purple\" | \"green\" | \"yellow\";\n}\n\ntype Palette = Record<string, string>;\n\n// Each preset is light + dark color overrides applied directly to CSS custom\n// properties on <html>. This mirrors what a user editing theme.json would see:\n// the variable names are identical, the variables flip light vs dark via the\n// \"dark\" class on <html>, and Reset clears the overrides so the defaults take\n// over again.\nconst PRESETS: Record<\n DemoThemeProps[\"variant\"],\n { light: Palette; dark: Palette; label: string }\n> = {\n purple: {\n label: \"Purple\",\n light: {\n primaryLight: \"#c4b5fd\",\n primary: \"#8b5cf6\",\n primaryDark: \"#5b21b6\",\n },\n dark: {\n primaryLight: \"#ddd6fe\",\n primary: \"#a78bfa\",\n primaryDark: \"#7c3aed\",\n },\n },\n green: {\n label: \"Green\",\n light: {\n primaryLight: \"#86efac\",\n primary: \"#22c55e\",\n primaryDark: \"#15803d\",\n },\n dark: {\n primaryLight: \"#6ee7b7\",\n primary: \"#10b981\",\n primaryDark: \"#065f46\",\n },\n },\n yellow: {\n label: \"Yellow\",\n light: {\n primaryLight: \"#fbbf24\",\n primary: \"#f59e0b\",\n primaryDark: \"#d97706\",\n },\n dark: {\n primaryLight: \"#fed7aa\",\n primary: \"#fb923c\",\n primaryDark: \"#ea580c\",\n },\n },\n};\n\nconst PRESET_KEYS = [\"primaryLight\", \"primary\", \"primaryDark\"] as const;\n\nfunction applyPreset(palette: Palette) {\n const root = document.documentElement;\n for (const key of PRESET_KEYS) {\n if (palette[key]) root.style.setProperty(`--color-${key}`, palette[key]);\n }\n}\n\nfunction clearPreset() {\n const root = document.documentElement;\n for (const key of PRESET_KEYS) {\n root.style.removeProperty(`--color-${key}`);\n }\n}\n\nfunction DemoTheme({ variant }: DemoThemeProps) {\n const { setMode } = useThemeOverride();\n const preset = PRESETS[variant];\n\n if (!preset) {\n return (\n <Columns cols={2}>\n <Button onClick={() => clearPreset()} fullWidth>\n Reset to Default\n </Button>\n </Columns>\n );\n }\n\n return (\n <Columns cols={2}>\n <Button\n onClick={() => {\n applyPreset(preset.light);\n setMode(\"light\");\n }}\n icon=\"sun\"\n fullWidth\n >\n Demo {preset.label} Light\n </Button>\n <Button\n outline\n onClick={() => {\n applyPreset(preset.dark);\n setMode(\"dark\");\n }}\n icon=\"moon-star\"\n fullWidth\n >\n Demo {preset.label} Dark\n </Button>\n </Columns>\n );\n}\n\nexport { DemoTheme };\n";
@@ -1,209 +1,89 @@
1
1
  export const demoThemeTemplate = `"use client";
2
2
  import { Button } from "@/components/layout/Button";
3
3
  import { useThemeOverride } from "@/components/layout/ClientThemeProvider";
4
- import { Theme, theme, themeDark } from "@/app/theme";
5
4
  import { Columns } from "@/components/layout/Columns";
6
5
 
7
6
  interface DemoThemeProps {
8
7
  variant: "purple" | "green" | "yellow";
9
8
  }
10
9
 
11
- function DemoTheme({ variant }: DemoThemeProps) {
12
- const { setTheme } = useThemeOverride();
10
+ type Palette = Record<string, string>;
13
11
 
14
- const purpleLight: Theme = {
15
- ...theme,
16
- colors: {
12
+ // Each preset is light + dark color overrides applied directly to CSS custom
13
+ // properties on <html>. This mirrors what a user editing theme.json would see:
14
+ // the variable names are identical, the variables flip light vs dark via the
15
+ // "dark" class on <html>, and Reset clears the overrides so the defaults take
16
+ // over again.
17
+ const PRESETS: Record<
18
+ DemoThemeProps["variant"],
19
+ { light: Palette; dark: Palette; label: string }
20
+ > = {
21
+ purple: {
22
+ label: "Purple",
23
+ light: {
17
24
  primaryLight: "#c4b5fd",
18
25
  primary: "#8b5cf6",
19
26
  primaryDark: "#5b21b6",
20
- secondaryLight: "#86efac",
21
- secondary: "#22c55e",
22
- secondaryDark: "#15803d",
23
- tertiaryLight: "#fbbf24",
24
- tertiary: "#f59e0b",
25
- tertiaryDark: "#d97706",
26
- grayLight: "#f3f4f6",
27
- gray: "#9ca3af",
28
- grayDark: "#374151",
29
- success: "#10b981",
30
- error: "#f43f5e",
31
- warning: "#f59e0b",
32
- info: "#3b82f6",
33
- dark: "#000000",
34
- light: "#ffffff",
35
27
  },
36
- };
37
-
38
- const purpleDark: Theme = {
39
- ...themeDark,
40
- colors: {
28
+ dark: {
41
29
  primaryLight: "#ddd6fe",
42
30
  primary: "#a78bfa",
43
31
  primaryDark: "#7c3aed",
44
- secondaryLight: "#6ee7b7",
45
- secondary: "#10b981",
46
- secondaryDark: "#065f46",
47
- tertiaryLight: "#fed7aa",
48
- tertiary: "#fb923c",
49
- tertiaryDark: "#ea580c",
50
- grayLight: "#1f2937",
51
- gray: "#6b7280",
52
- grayDark: "#9ca3af",
53
- success: "#10b981",
54
- error: "#f43f5e",
55
- warning: "#f59e0b",
56
- info: "#3b82f6",
57
- dark: "#ffffff",
58
- light: "#000000",
59
32
  },
60
- };
61
-
62
- const greenLight: Theme = {
63
- ...theme,
64
- colors: {
33
+ },
34
+ green: {
35
+ label: "Green",
36
+ light: {
65
37
  primaryLight: "#86efac",
66
38
  primary: "#22c55e",
67
39
  primaryDark: "#15803d",
68
- secondaryLight: "#c4b5fd",
69
- secondary: "#8b5cf6",
70
- secondaryDark: "#5b21b6",
71
- tertiaryLight: "#fbbf24",
72
- tertiary: "#f59e0b",
73
- tertiaryDark: "#d97706",
74
- grayLight: "#f3f4f6",
75
- gray: "#9ca3af",
76
- grayDark: "#374151",
77
- success: "#10b981",
78
- error: "#f43f5e",
79
- warning: "#f59e0b",
80
- info: "#3b82f6",
81
- dark: "#000000",
82
- light: "#ffffff",
83
40
  },
84
- };
85
-
86
- const greenDark: Theme = {
87
- ...themeDark,
88
- colors: {
41
+ dark: {
89
42
  primaryLight: "#6ee7b7",
90
43
  primary: "#10b981",
91
44
  primaryDark: "#065f46",
92
- secondaryLight: "#ddd6fe",
93
- secondary: "#a78bfa",
94
- secondaryDark: "#7c3aed",
95
- tertiaryLight: "#fed7aa",
96
- tertiary: "#fb923c",
97
- tertiaryDark: "#ea580c",
98
- grayLight: "#1f2937",
99
- gray: "#6b7280",
100
- grayDark: "#9ca3af",
101
- success: "#10b981",
102
- error: "#f43f5e",
103
- warning: "#f59e0b",
104
- info: "#3b82f6",
105
- dark: "#ffffff",
106
- light: "#000000",
107
45
  },
108
- };
109
-
110
- const yellowLight: Theme = {
111
- ...theme,
112
- colors: {
46
+ },
47
+ yellow: {
48
+ label: "Yellow",
49
+ light: {
113
50
  primaryLight: "#fbbf24",
114
51
  primary: "#f59e0b",
115
52
  primaryDark: "#d97706",
116
- secondaryLight: "#c4b5fd",
117
- secondary: "#8b5cf6",
118
- secondaryDark: "#5b21b6",
119
- tertiaryLight: "#86efac",
120
- tertiary: "#22c55e",
121
- tertiaryDark: "#15803d",
122
- grayLight: "#f3f4f6",
123
- gray: "#9ca3af",
124
- grayDark: "#374151",
125
- success: "#10b981",
126
- error: "#f43f5e",
127
- warning: "#f59e0b",
128
- info: "#3b82f6",
129
- dark: "#000000",
130
- light: "#ffffff",
131
53
  },
132
- };
133
-
134
- const yellowDark: Theme = {
135
- ...themeDark,
136
- colors: {
54
+ dark: {
137
55
  primaryLight: "#fed7aa",
138
56
  primary: "#fb923c",
139
57
  primaryDark: "#ea580c",
140
- secondaryLight: "#ddd6fe",
141
- secondary: "#a78bfa",
142
- secondaryDark: "#7c3aed",
143
- tertiaryLight: "#6ee7b7",
144
- tertiary: "#10b981",
145
- tertiaryDark: "#065f46",
146
- grayLight: "#1f2937",
147
- gray: "#6b7280",
148
- grayDark: "#9ca3af",
149
- success: "#10b981",
150
- error: "#f43f5e",
151
- warning: "#f59e0b",
152
- info: "#3b82f6",
153
- dark: "#ffffff",
154
- light: "#000000",
155
58
  },
156
- };
59
+ },
60
+ };
157
61
 
158
- if (variant === "purple") {
159
- return (
160
- <Columns cols={2}>
161
- <Button onClick={() => setTheme(purpleLight)} icon="sun" fullWidth>
162
- Demo Purple Light
163
- </Button>
164
- <Button
165
- outline
166
- onClick={() => setTheme(purpleDark)}
167
- icon="moon-star"
168
- fullWidth
169
- >
170
- Demo Purple Dark
171
- </Button>
172
- </Columns>
173
- );
62
+ const PRESET_KEYS = ["primaryLight", "primary", "primaryDark"] as const;
63
+
64
+ function applyPreset(palette: Palette) {
65
+ const root = document.documentElement;
66
+ for (const key of PRESET_KEYS) {
67
+ if (palette[key]) root.style.setProperty(\`--color-\${key}\`, palette[key]);
174
68
  }
69
+ }
175
70
 
176
- if (variant === "green") {
177
- return (
178
- <Columns cols={2}>
179
- <Button onClick={() => setTheme(greenLight)} icon="sun" fullWidth>
180
- Demo Green Light
181
- </Button>
182
- <Button
183
- outline
184
- onClick={() => setTheme(greenDark)}
185
- icon="moon-star"
186
- fullWidth
187
- >
188
- Demo Green Dark
189
- </Button>
190
- </Columns>
191
- );
71
+ function clearPreset() {
72
+ const root = document.documentElement;
73
+ for (const key of PRESET_KEYS) {
74
+ root.style.removeProperty(\`--color-\${key}\`);
192
75
  }
76
+ }
77
+
78
+ function DemoTheme({ variant }: DemoThemeProps) {
79
+ const { setMode } = useThemeOverride();
80
+ const preset = PRESETS[variant];
193
81
 
194
- if (variant === "yellow") {
82
+ if (!preset) {
195
83
  return (
196
84
  <Columns cols={2}>
197
- <Button onClick={() => setTheme(yellowLight)} icon="sun" fullWidth>
198
- Demo Yellow Light
199
- </Button>
200
- <Button
201
- outline
202
- onClick={() => setTheme(yellowDark)}
203
- icon="moon-star"
204
- fullWidth
205
- >
206
- Demo Yellow Dark
85
+ <Button onClick={() => clearPreset()} fullWidth>
86
+ Reset to Default
207
87
  </Button>
208
88
  </Columns>
209
89
  );
@@ -211,8 +91,26 @@ function DemoTheme({ variant }: DemoThemeProps) {
211
91
 
212
92
  return (
213
93
  <Columns cols={2}>
214
- <Button onClick={() => setTheme(null)} fullWidth>
215
- Reset to Default
94
+ <Button
95
+ onClick={() => {
96
+ applyPreset(preset.light);
97
+ setMode("light");
98
+ }}
99
+ icon="sun"
100
+ fullWidth
101
+ >
102
+ Demo {preset.label} Light
103
+ </Button>
104
+ <Button
105
+ outline
106
+ onClick={() => {
107
+ applyPreset(preset.dark);
108
+ setMode("dark");
109
+ }}
110
+ icon="moon-star"
111
+ fullWidth
112
+ >
113
+ Demo {preset.label} Dark
216
114
  </Button>
217
115
  </Columns>
218
116
  );
@@ -1 +1 @@
1
- export declare const docsComponentsTemplate = "\"use client\";\nimport { darken, lighten, rgba } from \"polished\";\nimport React, { createContext, useContext } from \"react\";\nimport styled, { css } from \"styled-components\";\nimport {\n resetButton,\n styledSmall,\n styledStrong,\n styledText,\n} from \"cherry-styled-components\";\nimport Link from \"next/link\";\nimport { mq, Theme } from \"@/app/theme\";\nimport {\n styledAnchor,\n styledTable,\n stylesLists,\n} from \"@/components/layout/SharedStyled\";\nimport { ChatContext } from \"@/components/Chat\";\n\nconst SectionBarContext = createContext(false);\n\nfunction SectionBarProvider({\n hasSectionBar,\n children,\n}: {\n hasSectionBar: boolean;\n children: React.ReactNode;\n}) {\n return (\n <SectionBarContext.Provider value={hasSectionBar}>\n {children}\n </SectionBarContext.Provider>\n );\n}\n\ninterface DocsProps {\n children: React.ReactNode;\n}\n\nconst StyledDocsWrapper = styled.main<{ theme: Theme }>`\n position: relative;\n`;\n\nconst StyledDocsSidebar = styled.div<{ theme: Theme }>`\n clear: both;\n`;\n\nconst StyledDocsContainer = styled.div<{ theme: Theme; $isChatOpen?: boolean }>`\n position: relative;\n padding: 0 20px 100px 20px;\n width: 100%;\n ${({ theme }) => styledText(theme)};\n transition: all 0.3s ease;\n\n ${mq(\"lg\")} {\n padding: 0 300px 80px 300px;\n\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 80px 300px;\n `}\n }\n\n & p {\n color: ${({ theme }) => theme.colors.grayDark};\n hyphens: auto;\n }\n\n & pre {\n max-width: 100%;\n }\n\n ${styledAnchor};\n ${stylesLists};\n ${styledTable};\n\n & img,\n & video,\n & iframe {\n max-width: 100%;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n }\n\n & code:not([class]) {\n background: ${({ theme }) => rgba(theme.colors.primaryLight, 0.2)};\n color: ${({ theme }) => theme.colors.dark};\n padding: 2px 4px;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n white-space: pre;\n }\n\n & .lucide {\n color: ${({ theme }) => theme.colors.primary};\n }\n\n & .aspect-video {\n aspect-ratio: 16 / 9;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\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 max-width: 640px;\n margin: auto;\n`;\n\ninterface Props {\n theme?: Theme;\n $isActive?: boolean;\n $hasSectionBar?: boolean;\n}\n\nexport const StyledSidebar = styled.nav<Props>`\n position: fixed;\n overflow-y: auto;\n max-height: calc(\n 100dvh - ${({ $hasSectionBar }) => ($hasSectionBar ? 104 : 62)}px\n );\n width: 100%;\n z-index: 99;\n top: ${({ $hasSectionBar }) => ($hasSectionBar ? 104 : 62)}px;\n height: 100%;\n padding: 20px;\n opacity: 0;\n pointer-events: none;\n transition: all 0.3s ease;\n transform: translateY(30px);\n left: 0;\n background: ${({ theme }) => theme.colors.light};\n -webkit-overflow-scrolling: touch;\n display: flex;\n flex-direction: column;\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n ${mq(\"lg\")} {\n border-right: solid 1px ${({ theme }) => theme.colors.grayLight};\n transition: none;\n max-height: 100dvh;\n width: 220px;\n background: transparent;\n padding: 82px 20px 20px 20px;\n opacity: 1;\n pointer-events: all;\n transform: translateY(0);\n background: ${({ theme }) => rgba(theme.colors.primaryLight, 0.05)};\n top: 0;\n width: 280px;\n }\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n transform: translateY(0);\n opacity: 1;\n pointer-events: all;\n `}\n`;\n\nexport const StyledSidebarFooter = styled.div`\n padding: 22px 20px;\n position: sticky;\n border-top: 1px solid ${({ theme }) => theme.colors.grayLight};\n background: ${({ theme }) => rgba(theme.colors.primaryLight, 0.05)};\n margin: 0 -20px -20px;\n bottom: -20px;\n backdrop-filter: blur(10px);\n\n ${mq(\"lg\")} {\n padding: 16px 20px;\n }\n`;\n\nexport const StyledIndexSidebar = styled.ul<{ theme: Theme }>`\n display: none;\n list-style: none;\n margin: 0;\n padding: 0;\n position: fixed;\n top: 0;\n right: 0;\n width: 280px;\n height: 100dvh;\n overflow-y: auto;\n z-index: 1;\n padding: 82px 20px 20px 20px;\n background: ${({ theme }) => theme.colors.light};\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n -webkit-overflow-scrolling: touch;\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n ${mq(\"lg\")} {\n display: block;\n }\n\n & li {\n padding: 5px 0;\n }\n`;\n\nexport const StyledIndexSidebarLabel = styled.span<{ theme: Theme }>`\n ${({ theme }) => styledSmall(theme)};\n color: ${({ theme }) => theme.colors.grayDark};\n`;\n\nexport const StyledIndexSidebarLi = styled.li<{\n theme: Theme;\n $isActive: boolean;\n}>`\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n left: 0;\n height: 20px;\n width: 1px;\n background: transparent;\n transition: all 0.3s ease;\n }\n\n ${({ $isActive, theme }) =>\n $isActive &&\n css`\n &::before {\n background: ${theme.colors.primary};\n }\n `}\n`;\n\nexport const StyledIndexSidebarLink = styled.a<{\n theme: Theme;\n $isActive: boolean;\n}>`\n ${({ theme }) => styledSmall(theme)};\n color: ${({ theme, $isActive }) =>\n $isActive ? theme.colors.primary : theme.colors.dark};\n font-weight: ${({ $isActive }) => ($isActive ? \"600\" : \"400\")};\n text-decoration: none;\n transition: all 0.3s ease;\n\n &:hover {\n color: ${({ theme }) => theme.colors.primary};\n }\n`;\n\nexport const StyledSidebarList = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n\n &:last-of-type {\n margin-bottom: auto;\n }\n`;\n\nexport const StyledStrong = styled.strong<{ theme: Theme }>`\n font-weight: 600;\n ${({ theme }) => styledStrong(theme)};\n color: ${({ theme }) =>\n theme.isDark\n ? lighten(0.1, theme.colors.primaryLight)\n : darken(0.1, theme.colors.primaryDark)};\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.small.lg};\n line-height: 1.6;\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.grayDark : theme.colors.primary};\n padding: 5px 0 5px 20px;\n display: flex;\n transition: all 0.3s ease;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n\n &:hover {\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};\n border-color: ${({ theme }) => theme.colors.primary};\n }\n\n ${({ $isActive, theme }) =>\n $isActive &&\n `\n\t\t\tcolor: ${theme.isDark ? lighten(0.1, theme.colors.primaryLight) : darken(0.1, theme.colors.primaryDark)};\n\t\t\tborder-color: ${theme.colors.primary};\n\t\t\tfont-weight: 600;\n\t`};\n`;\n\nexport const StyleMobileBar = styled.button<Props>`\n ${resetButton};\n position: fixed;\n z-index: 999;\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 }) => theme.colors.primary};\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.dark : theme.colors.light};\n backdrop-filter: blur(10px);\n -webkit-backdrop-filter: blur(10px);\n padding: 10px;\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 transform: scale(0.8);\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.light};\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 StyledMissingComponent = styled.div`\n background: ${({ theme }) => theme.colors.error};\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n padding: 20px;\n font-size: ${({ theme }) => theme.fontSizes.small.lg};\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.dark : theme.colors.light};\n font-weight: 600;\n display: flex;\n gap: 10px;\n align-items: center;\n`;\n\ninterface DocsWrapperProps {\n children: React.ReactNode;\n}\n\nfunction DocsWrapper({ children }: DocsWrapperProps) {\n return <StyledDocsWrapper>{children}</StyledDocsWrapper>;\n}\n\nfunction DocsSidebar({ children }: DocsProps) {\n return <StyledDocsSidebar>{children}</StyledDocsSidebar>;\n}\n\nfunction DocsContainer({ children }: DocsProps) {\n const { isOpen } = useContext(ChatContext);\n\n return (\n <StyledDocsContainer $isChatOpen={isOpen}>{children}</StyledDocsContainer>\n );\n}\n\nexport {\n DocsWrapper,\n DocsSidebar,\n DocsContainer,\n SectionBarContext,\n SectionBarProvider,\n};\n";
1
+ export declare const docsComponentsTemplate = "\"use client\";\nimport React, { createContext, useContext } from \"react\";\nimport styled, { css } from \"styled-components\";\nimport {\n resetButton,\n styledSmall,\n styledStrong,\n styledText,\n} from \"cherry-styled-components\";\nimport Link from \"next/link\";\nimport { mq, Theme } from \"@/app/theme\";\nimport {\n styledAnchor,\n styledTable,\n stylesLists,\n} from \"@/components/layout/SharedStyled\";\nimport { ChatContext } from \"@/components/Chat\";\n\nconst SectionBarContext = createContext(false);\n\nfunction SectionBarProvider({\n hasSectionBar,\n children,\n}: {\n hasSectionBar: boolean;\n children: React.ReactNode;\n}) {\n return (\n <SectionBarContext.Provider value={hasSectionBar}>\n {children}\n </SectionBarContext.Provider>\n );\n}\n\ninterface DocsProps {\n children: React.ReactNode;\n}\n\nconst StyledDocsWrapper = styled.main<{ theme: Theme }>`\n position: relative;\n`;\n\nconst StyledDocsSidebar = styled.div<{ theme: Theme }>`\n clear: both;\n`;\n\nconst StyledDocsContainer = styled.div<{ theme: Theme; $isChatOpen?: boolean }>`\n position: relative;\n padding: 0 20px 100px 20px;\n width: 100%;\n ${({ theme }) => styledText(theme)};\n transition: all 0.3s ease;\n\n ${mq(\"lg\")} {\n padding: 0 300px 80px 300px;\n\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 80px 300px;\n `}\n }\n\n & p {\n color: ${({ theme }) => theme.colors.grayDark};\n hyphens: auto;\n }\n\n & pre {\n max-width: 100%;\n }\n\n ${styledAnchor};\n ${stylesLists};\n ${styledTable};\n\n & img,\n & video,\n & iframe {\n max-width: 100%;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n }\n\n & code:not([class]) {\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 20%, transparent)`};\n color: ${({ theme }) => theme.colors.dark};\n padding: 2px 4px;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n white-space: pre;\n }\n\n & .lucide {\n color: ${({ theme }) => theme.colors.primary};\n }\n\n & .aspect-video {\n aspect-ratio: 16 / 9;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\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 max-width: 640px;\n margin: auto;\n`;\n\ninterface Props {\n theme?: Theme;\n $isActive?: boolean;\n $hasSectionBar?: boolean;\n}\n\nexport const StyledSidebar = styled.nav<Props>`\n position: fixed;\n overflow-y: auto;\n max-height: calc(\n 100dvh - ${({ $hasSectionBar }) => ($hasSectionBar ? 104 : 62)}px\n );\n width: 100%;\n z-index: 99;\n top: ${({ $hasSectionBar }) => ($hasSectionBar ? 104 : 62)}px;\n height: 100%;\n padding: 20px;\n opacity: 0;\n pointer-events: none;\n transition: all 0.3s ease;\n transform: translateY(30px);\n left: 0;\n background: ${({ theme }) => theme.colors.light};\n -webkit-overflow-scrolling: touch;\n display: flex;\n flex-direction: column;\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n ${mq(\"lg\")} {\n border-right: solid 1px ${({ theme }) => theme.colors.grayLight};\n transition: none;\n max-height: 100dvh;\n width: 220px;\n background: transparent;\n padding: 82px 20px 20px 20px;\n opacity: 1;\n pointer-events: all;\n transform: translateY(0);\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 5%, transparent)`};\n top: 0;\n width: 280px;\n }\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n transform: translateY(0);\n opacity: 1;\n pointer-events: all;\n `}\n`;\n\nexport const StyledSidebarFooter = styled.div`\n padding: 22px 20px;\n position: sticky;\n border-top: 1px solid ${({ theme }) => theme.colors.grayLight};\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 5%, transparent)`};\n margin: 0 -20px -20px;\n bottom: -20px;\n backdrop-filter: blur(10px);\n\n ${mq(\"lg\")} {\n padding: 16px 20px;\n }\n`;\n\nexport const StyledIndexSidebar = styled.ul<{ theme: Theme }>`\n display: none;\n list-style: none;\n margin: 0;\n padding: 0;\n position: fixed;\n top: 0;\n right: 0;\n width: 280px;\n height: 100dvh;\n overflow-y: auto;\n z-index: 1;\n padding: 82px 20px 20px 20px;\n background: ${({ theme }) => theme.colors.light};\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n -webkit-overflow-scrolling: touch;\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n ${mq(\"lg\")} {\n display: block;\n }\n\n & li {\n padding: 5px 0;\n }\n`;\n\nexport const StyledIndexSidebarLabel = styled.span<{ theme: Theme }>`\n ${({ theme }) => styledSmall(theme)};\n color: ${({ theme }) => theme.colors.grayDark};\n`;\n\nexport const StyledIndexSidebarLi = styled.li<{\n theme: Theme;\n $isActive: boolean;\n}>`\n &::before {\n content: \"\";\n display: block;\n position: absolute;\n left: 0;\n height: 20px;\n width: 1px;\n background: transparent;\n transition: all 0.3s ease;\n }\n\n ${({ $isActive, theme }) =>\n $isActive &&\n css`\n &::before {\n background: ${theme.colors.primary};\n }\n `}\n`;\n\nexport const StyledIndexSidebarLink = styled.a<{\n theme: Theme;\n $isActive: boolean;\n}>`\n ${({ theme }) => styledSmall(theme)};\n color: ${({ theme, $isActive }) =>\n $isActive ? theme.colors.primary : theme.colors.dark};\n font-weight: ${({ $isActive }) => ($isActive ? \"600\" : \"400\")};\n text-decoration: none;\n transition: all 0.3s ease;\n\n &:hover {\n color: ${({ theme }) => theme.colors.primary};\n }\n`;\n\nexport const StyledSidebarList = styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n\n &:last-of-type {\n margin-bottom: auto;\n }\n`;\n\nexport const StyledStrong = styled.strong<{ theme: Theme }>`\n font-weight: 600;\n ${({ theme }) => styledStrong(theme)};\n color: ${({ theme }) => theme.colors.accentStrong};\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.small.lg};\n line-height: 1.6;\n color: ${({ theme }) => theme.colors.accentMuted};\n padding: 5px 0 5px 20px;\n display: flex;\n transition: all 0.3s ease;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n\n &:hover {\n color: ${({ theme }) => theme.colors.accent};\n border-color: ${({ theme }) => theme.colors.primary};\n }\n\n ${({ $isActive, theme }) =>\n $isActive &&\n `\n\t\t\tcolor: ${theme.colors.accentStrong};\n\t\t\tborder-color: ${theme.colors.primary};\n\t\t\tfont-weight: 600;\n\t`};\n`;\n\nexport const StyleMobileBar = styled.button<Props>`\n ${resetButton};\n position: fixed;\n z-index: 999;\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 }) => theme.colors.primary};\n color: ${({ theme }) => theme.colors.surface};\n backdrop-filter: blur(10px);\n -webkit-backdrop-filter: blur(10px);\n padding: 10px;\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 transform: scale(0.8);\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 }) => theme.colors.surface};\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 StyledMissingComponent = styled.div`\n background: ${({ theme }) => theme.colors.error};\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n padding: 20px;\n font-size: ${({ theme }) => theme.fontSizes.small.lg};\n color: ${({ theme }) => theme.colors.surface};\n font-weight: 600;\n display: flex;\n gap: 10px;\n align-items: center;\n`;\n\ninterface DocsWrapperProps {\n children: React.ReactNode;\n}\n\nfunction DocsWrapper({ children }: DocsWrapperProps) {\n return <StyledDocsWrapper>{children}</StyledDocsWrapper>;\n}\n\nfunction DocsSidebar({ children }: DocsProps) {\n return <StyledDocsSidebar>{children}</StyledDocsSidebar>;\n}\n\nfunction DocsContainer({ children }: DocsProps) {\n const { isOpen } = useContext(ChatContext);\n\n return (\n <StyledDocsContainer $isChatOpen={isOpen}>{children}</StyledDocsContainer>\n );\n}\n\nexport {\n DocsWrapper,\n DocsSidebar,\n DocsContainer,\n SectionBarContext,\n SectionBarProvider,\n};\n";
@@ -1,6 +1,5 @@
1
1
  import { SIDEBAR_WIDTH, CHAT_WIDTH } from "../../app/theme.js";
2
2
  export const docsComponentsTemplate = `"use client";
3
- import { darken, lighten, rgba } from "polished";
4
3
  import React, { createContext, useContext } from "react";
5
4
  import styled, { css } from "styled-components";
6
5
  import {
@@ -84,7 +83,8 @@ const StyledDocsContainer = styled.div<{ theme: Theme; $isChatOpen?: boolean }>\
84
83
  }
85
84
 
86
85
  & code:not([class]) {
87
- background: \${({ theme }) => rgba(theme.colors.primaryLight, 0.2)};
86
+ background: \${({ theme }) =>
87
+ \`color-mix(in srgb, \${theme.colors.primaryLight} 20%, transparent)\`};
88
88
  color: \${({ theme }) => theme.colors.dark};
89
89
  padding: 2px 4px;
90
90
  border-radius: \${({ theme }) => theme.spacing.radius.xs};
@@ -152,7 +152,8 @@ export const StyledSidebar = styled.nav<Props>\`
152
152
  opacity: 1;
153
153
  pointer-events: all;
154
154
  transform: translateY(0);
155
- background: \${({ theme }) => rgba(theme.colors.primaryLight, 0.05)};
155
+ background: \${({ theme }) =>
156
+ \`color-mix(in srgb, \${theme.colors.primaryLight} 5%, transparent)\`};
156
157
  top: 0;
157
158
  width: ${SIDEBAR_WIDTH}px;
158
159
  }
@@ -170,7 +171,8 @@ export const StyledSidebarFooter = styled.div\`
170
171
  padding: 22px 20px;
171
172
  position: sticky;
172
173
  border-top: 1px solid \${({ theme }) => theme.colors.grayLight};
173
- background: \${({ theme }) => rgba(theme.colors.primaryLight, 0.05)};
174
+ background: \${({ theme }) =>
175
+ \`color-mix(in srgb, \${theme.colors.primaryLight} 5%, transparent)\`};
174
176
  margin: 0 -20px -20px;
175
177
  bottom: -20px;
176
178
  backdrop-filter: blur(10px);
@@ -268,10 +270,7 @@ export const StyledSidebarList = styled.ul\`
268
270
  export const StyledStrong = styled.strong<{ theme: Theme }>\`
269
271
  font-weight: 600;
270
272
  \${({ theme }) => styledStrong(theme)};
271
- color: \${({ theme }) =>
272
- theme.isDark
273
- ? lighten(0.1, theme.colors.primaryLight)
274
- : darken(0.1, theme.colors.primaryDark)};
273
+ color: \${({ theme }) => theme.colors.accentStrong};
275
274
  \`;
276
275
 
277
276
  export const StyledSidebarListItem = styled.li\`
@@ -284,23 +283,21 @@ export const StyledSidebarListItemLink = styled(Link)<Props>\`
284
283
  text-decoration: none;
285
284
  font-size: \${({ theme }) => theme.fontSizes.small.lg};
286
285
  line-height: 1.6;
287
- color: \${({ theme }) =>
288
- theme.isDark ? theme.colors.grayDark : theme.colors.primary};
286
+ color: \${({ theme }) => theme.colors.accentMuted};
289
287
  padding: 5px 0 5px 20px;
290
288
  display: flex;
291
289
  transition: all 0.3s ease;
292
290
  border-left: solid 1px \${({ theme }) => theme.colors.grayLight};
293
291
 
294
292
  &:hover {
295
- color: \${({ theme }) =>
296
- theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};
293
+ color: \${({ theme }) => theme.colors.accent};
297
294
  border-color: \${({ theme }) => theme.colors.primary};
298
295
  }
299
296
 
300
297
  \${({ $isActive, theme }) =>
301
298
  $isActive &&
302
299
  \`
303
- color: \${theme.isDark ? lighten(0.1, theme.colors.primaryLight) : darken(0.1, theme.colors.primaryDark)};
300
+ color: \${theme.colors.accentStrong};
304
301
  border-color: \${theme.colors.primary};
305
302
  font-weight: 600;
306
303
  \`};
@@ -316,8 +313,7 @@ export const StyleMobileBar = styled.button<Props>\`
316
313
  line-height: \${({ theme }) => theme.fontSizes.strong.lg};
317
314
  box-shadow: \${({ theme }) => theme.shadows.sm};
318
315
  background: \${({ theme }) => theme.colors.primary};
319
- color: \${({ theme }) =>
320
- theme.isDark ? theme.colors.dark : theme.colors.light};
316
+ color: \${({ theme }) => theme.colors.surface};
321
317
  backdrop-filter: blur(10px);
322
318
  -webkit-backdrop-filter: blur(10px);
323
319
  padding: 10px;
@@ -354,8 +350,7 @@ export const StyledMobileBurger = styled.span<Props>\`
354
350
  width: 18px;
355
351
  height: 3px;
356
352
  border-radius: 3px;
357
- background: \${({ theme }) =>
358
- theme.isDark ? theme.colors.dark : theme.colors.light};
353
+ background: \${({ theme }) => theme.colors.surface};
359
354
  transition: all 0.3s ease;
360
355
  }
361
356
 
@@ -385,8 +380,7 @@ export const StyledMissingComponent = styled.div\`
385
380
  border-radius: \${({ theme }) => theme.spacing.radius.lg};
386
381
  padding: 20px;
387
382
  font-size: \${({ theme }) => theme.fontSizes.small.lg};
388
- color: \${({ theme }) =>
389
- theme.isDark ? theme.colors.dark : theme.colors.light};
383
+ color: \${({ theme }) => theme.colors.surface};
390
384
  font-weight: 600;
391
385
  display: flex;
392
386
  gap: 10px;
@@ -1 +1 @@
1
- export declare const fieldTemplate = "\"use client\";\nimport styled from \"styled-components\";\nimport { styledSmall, Theme } from \"cherry-styled-components\";\nimport { rgba } from \"polished\";\n\nconst StyledField = styled.div<{ theme: Theme; $columns?: number }>`\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n padding: 0 0 20px 0;\n color: ${({ theme }) => theme.colors.grayDark};\n`;\n\nconst StyledFieldFlex = styled.div<{ theme: Theme }>`\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n ${({ theme }) => styledSmall(theme)};\n padding: 0 0 15px 0;\n`;\n\nconst StyledFieldValue = styled.span<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.primary};\n font-family: ${({ theme }) => theme.fonts.mono};\n font-weight: 600;\n`;\n\nconst StyledFieldType = styled.span<{ theme: Theme }>`\n background: ${({ theme }) => rgba(theme.colors.primaryLight, 0.2)};\n color: ${({ theme }) => theme.colors.dark};\n padding: 0 4px;\n font-family: ${({ theme }) => theme.fonts.mono};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n`;\n\nconst StyledFieldRequired = styled.span<{ theme: Theme }>`\n background: ${({ theme }) => rgba(theme.colors.error, 0.2)};\n color: ${({ theme }) => theme.colors.error};\n padding: 0 4px;\n font-family: ${({ theme }) => theme.fonts.mono};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n`;\n\ninterface FieldProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode;\n value: string;\n type: string;\n required?: boolean;\n}\n\nfunction Field({ children, value, type, required }: FieldProps) {\n return (\n <StyledField>\n <StyledFieldFlex>\n <StyledFieldValue>{value}</StyledFieldValue>\n <StyledFieldType>{type}</StyledFieldType>\n {required && <StyledFieldRequired>required</StyledFieldRequired>}\n </StyledFieldFlex>\n {children}\n </StyledField>\n );\n}\n\nexport { Field };\n";
1
+ export declare const fieldTemplate = "\"use client\";\nimport styled from \"styled-components\";\nimport { styledSmall } from \"cherry-styled-components\";\nimport { Theme } from \"@/app/theme\";\n\nconst StyledField = styled.div<{ theme: Theme; $columns?: number }>`\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n padding: 0 0 20px 0;\n color: ${({ theme }) => theme.colors.grayDark};\n`;\n\nconst StyledFieldFlex = styled.div<{ theme: Theme }>`\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n ${({ theme }) => styledSmall(theme)};\n padding: 0 0 15px 0;\n`;\n\nconst StyledFieldValue = styled.span<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.primary};\n font-family: ${({ theme }) => theme.fonts.mono};\n font-weight: 600;\n`;\n\nconst StyledFieldType = styled.span<{ theme: Theme }>`\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 20%, transparent)`};\n color: ${({ theme }) => theme.colors.dark};\n padding: 0 4px;\n font-family: ${({ theme }) => theme.fonts.mono};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n`;\n\nconst StyledFieldRequired = styled.span<{ theme: Theme }>`\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.error} 20%, transparent)`};\n color: ${({ theme }) => theme.colors.error};\n padding: 0 4px;\n font-family: ${({ theme }) => theme.fonts.mono};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n`;\n\ninterface FieldProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode;\n value: string;\n type: string;\n required?: boolean;\n}\n\nfunction Field({ children, value, type, required }: FieldProps) {\n return (\n <StyledField>\n <StyledFieldFlex>\n <StyledFieldValue>{value}</StyledFieldValue>\n <StyledFieldType>{type}</StyledFieldType>\n {required && <StyledFieldRequired>required</StyledFieldRequired>}\n </StyledFieldFlex>\n {children}\n </StyledField>\n );\n}\n\nexport { Field };\n";
@@ -1,7 +1,7 @@
1
1
  export const fieldTemplate = `"use client";
2
2
  import styled from "styled-components";
3
- import { styledSmall, Theme } from "cherry-styled-components";
4
- import { rgba } from "polished";
3
+ import { styledSmall } from "cherry-styled-components";
4
+ import { Theme } from "@/app/theme";
5
5
 
6
6
  const StyledField = styled.div<{ theme: Theme; $columns?: number }>\`
7
7
  border-bottom: solid 1px \${({ theme }) => theme.colors.grayLight};
@@ -24,7 +24,8 @@ const StyledFieldValue = styled.span<{ theme: Theme }>\`
24
24
  \`;
25
25
 
26
26
  const StyledFieldType = styled.span<{ theme: Theme }>\`
27
- background: \${({ theme }) => rgba(theme.colors.primaryLight, 0.2)};
27
+ background: \${({ theme }) =>
28
+ \`color-mix(in srgb, \${theme.colors.primaryLight} 20%, transparent)\`};
28
29
  color: \${({ theme }) => theme.colors.dark};
29
30
  padding: 0 4px;
30
31
  font-family: \${({ theme }) => theme.fonts.mono};
@@ -32,7 +33,8 @@ const StyledFieldType = styled.span<{ theme: Theme }>\`
32
33
  \`;
33
34
 
34
35
  const StyledFieldRequired = styled.span<{ theme: Theme }>\`
35
- background: \${({ theme }) => rgba(theme.colors.error, 0.2)};
36
+ background: \${({ theme }) =>
37
+ \`color-mix(in srgb, \${theme.colors.error} 20%, transparent)\`};
36
38
  color: \${({ theme }) => theme.colors.error};
37
39
  padding: 0 4px;
38
40
  font-family: \${({ theme }) => theme.fonts.mono};
@@ -1 +1 @@
1
- export declare const footerTemplate = "\"use client\";\nimport { useContext } from \"react\";\nimport styled, { css } from \"styled-components\";\nimport { Space, styledSmall } from \"cherry-styled-components\";\nimport { ChatContext } from \"@/components/Chat\";\nimport { mq, Theme } from \"@/app/theme\";\nimport { GitHubLogo } from \"@/components/layout/Pictograms\";\nimport linksData from \"@/links.json\";\n\ninterface LinkProps {\n title: string;\n url: string;\n icon?: string;\n}\n\nconst links = linksData as LinkProps[];\n\nconst StyledFooter = styled.footer<{\n theme: Theme;\n $isChatOpen?: boolean;\n $hasLinks?: boolean;\n}>`\n padding: 0 20px;\n transition: all 0.3s ease;\n\n ${({ $hasLinks }) =>\n $hasLinks &&\n css`\n margin-top: 20px;\n `}\n\n ${mq(\"lg\")} {\n margin: 0;\n padding: 0 300px 0 300px;\n\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 0 300px;\n `}\n }\n`;\n\nconst StyledFooterInner = styled.div<{ theme: Theme }>`\n border-top: solid 1px ${({ theme }) => theme.colors.grayLight};\n max-width: 640px;\n margin: 0 auto;\n padding: 28px 0;\n color: ${({ theme }) => theme.colors.grayDark};\n ${({ theme }) => styledSmall(theme)};\n\n ${mq(\"lg\")} {\n padding: 20px 0;\n }\n\n & a {\n font-weight: 700;\n color: ${({ theme }) =>\n theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};\n text-decoration: none;\n transition: all 0.3s ease;\n display: inline-flex;\n\n &:hover {\n color: ${({ theme }) => theme.colors.primaryDark};\n }\n\n & svg {\n width: 18px;\n height: 18px;\n }\n }\n`;\n\nconst StyledFooterFlex = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n gap: 20px;\n\n ${mq(\"lg\")} {\n justify-content: space-between;\n }\n`;\n\nfunction Footer({ hideBranding }: { hideBranding?: boolean }) {\n const { isOpen } = useContext(ChatContext);\n\n if (hideBranding) return <Space $xs={80} $lg=\"none\" />;\n\n return (\n <StyledFooter $isChatOpen={isOpen} $hasLinks={links.length > 0}>\n <StyledFooterInner>\n <StyledFooterFlex>\n <span>\n Powered by <a href=\"https://doccupine.com\">Doccupine</a>\n </span>\n <a\n href=\"https://github.com/doccupine/cli\"\n target=\"_blank\"\n aria-label=\"Doccupine on GitHub\"\n >\n <GitHubLogo />\n </a>\n </StyledFooterFlex>\n </StyledFooterInner>\n </StyledFooter>\n );\n}\n\nexport { Footer };\n";
1
+ export declare const footerTemplate = "\"use client\";\nimport { useContext } from \"react\";\nimport styled, { css } from \"styled-components\";\nimport { Space, styledSmall } from \"cherry-styled-components\";\nimport { ChatContext } from \"@/components/Chat\";\nimport { mq, Theme } from \"@/app/theme\";\nimport { GitHubLogo } from \"@/components/layout/Pictograms\";\nimport linksData from \"@/links.json\";\n\ninterface LinkProps {\n title: string;\n url: string;\n icon?: string;\n}\n\nconst links = linksData as LinkProps[];\n\nconst StyledFooter = styled.footer<{\n theme: Theme;\n $isChatOpen?: boolean;\n $hasLinks?: boolean;\n}>`\n padding: 0 20px;\n transition: all 0.3s ease;\n\n ${({ $hasLinks }) =>\n $hasLinks &&\n css`\n margin-top: 20px;\n `}\n\n ${mq(\"lg\")} {\n margin: 0;\n padding: 0 300px 0 300px;\n\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 0 300px;\n `}\n }\n`;\n\nconst StyledFooterInner = styled.div<{ theme: Theme }>`\n border-top: solid 1px ${({ theme }) => theme.colors.grayLight};\n max-width: 640px;\n margin: 0 auto;\n padding: 28px 0;\n color: ${({ theme }) => theme.colors.grayDark};\n ${({ theme }) => styledSmall(theme)};\n\n ${mq(\"lg\")} {\n padding: 20px 0;\n }\n\n & a {\n font-weight: 700;\n color: ${({ theme }) => theme.colors.accent};\n text-decoration: none;\n transition: all 0.3s ease;\n display: inline-flex;\n\n &:hover {\n color: ${({ theme }) => theme.colors.primaryDark};\n }\n\n & svg {\n width: 18px;\n height: 18px;\n }\n }\n`;\n\nconst StyledFooterFlex = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n gap: 20px;\n\n ${mq(\"lg\")} {\n justify-content: space-between;\n }\n`;\n\nfunction Footer({ hideBranding }: { hideBranding?: boolean }) {\n const { isOpen } = useContext(ChatContext);\n\n if (hideBranding) return <Space $xs={80} $lg=\"none\" />;\n\n return (\n <StyledFooter $isChatOpen={isOpen} $hasLinks={links.length > 0}>\n <StyledFooterInner>\n <StyledFooterFlex>\n <span>\n Powered by <a href=\"https://doccupine.com\">Doccupine</a>\n </span>\n <a\n href=\"https://github.com/doccupine/cli\"\n target=\"_blank\"\n aria-label=\"Doccupine on GitHub\"\n >\n <GitHubLogo />\n </a>\n </StyledFooterFlex>\n </StyledFooterInner>\n </StyledFooter>\n );\n}\n\nexport { Footer };\n";
@@ -56,8 +56,7 @@ const StyledFooterInner = styled.div<{ theme: Theme }>\`
56
56
 
57
57
  & a {
58
58
  font-weight: 700;
59
- color: \${({ theme }) =>
60
- theme.isDark ? theme.colors.primaryLight : theme.colors.primaryDark};
59
+ color: \${({ theme }) => theme.colors.accent};
61
60
  text-decoration: none;
62
61
  transition: all 0.3s ease;
63
62
  display: inline-flex;
@@ -1 +1 @@
1
- export declare const globalStylesTemplate = "\"use client\";\nimport { createGlobalStyle } from \"styled-components\";\n\nconst GlobalStyles = createGlobalStyle`\nhtml,\nbody {\n margin: 0;\n padding: 0;\n min-height: 100%;\n background-color: ${({ theme }) => theme.colors.light};\n scroll-padding-top: 80px;\n}\n\nhtml:has(:target) {\n scroll-behavior: smooth;\n}\n\nbody {\n font-family: \"Inter\", sans-serif;\n -moz-osx-font-smoothing: grayscale;\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n}\n\n:root {\n interpolate-size: allow-keywords;\n}\n\n* {\n box-sizing: border-box;\n min-width: 0;\n}\n\nhr {\n border: none;\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n margin: 10px 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n}\n\npre,\ncode,\nkbd,\nsamp,\nblockquote,\np,\na,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nul li,\nol li {\n margin: 0;\n padding: 0;\n color: ${({ theme }) => theme.colors.dark};\n}\n\na {\n color: ${({ theme }) => (theme.isDark ? theme.colors.dark : theme.colors.primary)};\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\nfigure {\n margin: 0;\n}\n\nfieldset {\n appearance: none;\n border: none;\n}\n\nbutton,\ninput,\na,\nimg,\nsvg,\nsvg * {\n transition: all 0.3s ease;\n}\n\nstrong,\nb {\n font-weight: 700;\n}\n\n.full-width {\n width: 100%;\n}\n\n.light-only {\n ${({ theme }) => theme.isDark && \"display: none !important;\"}\n}\n\n.dark-only {\n ${({ theme }) => !theme.isDark && \"display: none !important;\"}\n}`;\n\nexport { GlobalStyles };\n";
1
+ export declare const globalStylesTemplate = "\"use client\";\nimport { createGlobalStyle } from \"styled-components\";\nimport {\n colorsLight,\n colorsDark,\n shadowsLight,\n shadowsDark,\n} from \"@/app/theme\";\n\n// Build \"name: value;\" lines for every entry in a record. Used to emit\n// :root and :root.dark blocks from the resolved hex objects in theme.ts.\n// Custom theme.json overrides flow through automatically because they are\n// already merged into colorsLight / colorsDark.\nfunction toCssVars<T extends object>(prefix: string, record: T): string {\n return Object.entries(record)\n .map(([k, v]) => ` --${prefix}-${k}: ${v};`)\n .join(\"\\n\");\n}\n\nconst lightVars = [\n toCssVars(\"color\", colorsLight),\n toCssVars(\"shadow\", shadowsLight),\n // Semantic tokens \u2014 derived from the brand palette per mode. See the\n // SemanticColors interface in theme.ts for the intent of each.\n // These reference the palette via var() (not baked hex) so that any\n // runtime override of --color-primary* (e.g. the DemoTheme presets)\n // cascades into the semantic tokens automatically.\n ` --color-accent: var(--color-primaryDark);`,\n // accentStrong = accent shifted ~10% toward black (light mode) or white (dark\n // mode). color-mix in sRGB is not identical to polished's HSL darken/lighten\n // but the visual difference at 10% on a UI accent is imperceptible.\n ` --color-accentStrong: color-mix(in srgb, var(--color-primaryDark) 90%, black);`,\n ` --color-accentMuted: var(--color-primary);`,\n ` --color-surface: var(--color-light);`,\n].join(\"\\n\");\n\nconst darkVars = [\n toCssVars(\"color\", colorsDark),\n toCssVars(\"shadow\", shadowsDark),\n ` --color-accent: var(--color-primaryLight);`,\n ` --color-accentStrong: color-mix(in srgb, var(--color-primaryLight) 90%, white);`,\n ` --color-accentMuted: var(--color-grayDark);`,\n ` --color-surface: var(--color-dark);`,\n].join(\"\\n\");\n\nconst GlobalStyles = createGlobalStyle`\n:root {\n${lightVars}\n}\n\n:root.dark {\n${darkVars}\n}\n\nhtml,\nbody {\n margin: 0;\n padding: 0;\n min-height: 100%;\n background-color: var(--color-light);\n scroll-padding-top: 80px;\n}\n\nhtml:has(:target) {\n scroll-behavior: smooth;\n}\n\nbody {\n font-family: \"Inter\", sans-serif;\n -moz-osx-font-smoothing: grayscale;\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n}\n\n:root {\n interpolate-size: allow-keywords;\n}\n\n* {\n box-sizing: border-box;\n min-width: 0;\n}\n\nhr {\n border: none;\n border-bottom: solid 1px var(--color-grayLight);\n margin: 10px 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n}\n\npre,\ncode,\nkbd,\nsamp,\nblockquote,\np,\na,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nul li,\nol li {\n margin: 0;\n padding: 0;\n color: var(--color-dark);\n}\n\na {\n color: var(--color-primary);\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\nfigure {\n margin: 0;\n}\n\nfieldset {\n appearance: none;\n border: none;\n}\n\nbutton,\ninput,\na,\nimg,\nsvg,\nsvg * {\n transition: all 0.3s ease;\n}\n\nstrong,\nb {\n font-weight: 700;\n}\n\n.full-width {\n width: 100%;\n}\n\n/* Mode-conditional visibility helpers. ThemeToggle uses these to swap Sun\n and Moon icons; Header uses them to swap light/dark logos. Pure CSS so\n the swap happens via the active <html> class without JS or re-render. */\n:root.dark .light-only {\n display: none !important;\n}\n:root:not(.dark) .dark-only {\n display: none !important;\n}\n`;\n\nexport { GlobalStyles };\n";