doccupine 0.0.134 → 0.0.135

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 (85) hide show
  1. package/README.md +10 -9
  2. package/dist/index.js +222 -44
  3. package/dist/lib/metadata.d.ts +5 -0
  4. package/dist/lib/metadata.js +15 -4
  5. package/dist/lib/rss.d.ts +24 -0
  6. package/dist/lib/rss.js +137 -0
  7. package/dist/lib/structures.js +22 -2
  8. package/dist/templates/app/rssRoute.d.ts +11 -0
  9. package/dist/templates/app/rssRoute.js +30 -0
  10. package/dist/templates/components/Docs.d.ts +1 -1
  11. package/dist/templates/components/Docs.js +5 -2
  12. package/dist/templates/components/MDXComponents.d.ts +1 -1
  13. package/dist/templates/components/MDXComponents.js +29 -0
  14. package/dist/templates/components/SideBar.d.ts +1 -1
  15. package/dist/templates/components/SideBar.js +5 -2
  16. package/dist/templates/components/layout/ActionBar.d.ts +1 -1
  17. package/dist/templates/components/layout/ActionBar.js +44 -13
  18. package/dist/templates/components/layout/ApiPlayground.d.ts +1 -1
  19. package/dist/templates/components/layout/ApiPlayground.js +20 -28
  20. package/dist/templates/components/layout/Badge.d.ts +1 -0
  21. package/dist/templates/components/layout/Badge.js +455 -0
  22. package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
  23. package/dist/templates/components/layout/DocsComponents.js +5 -30
  24. package/dist/templates/components/layout/Prompt.d.ts +1 -0
  25. package/dist/templates/components/layout/Prompt.js +149 -0
  26. package/dist/templates/components/layout/Tooltip.d.ts +1 -0
  27. package/dist/templates/components/layout/Tooltip.js +222 -0
  28. package/dist/templates/components/layout/Tree.d.ts +1 -0
  29. package/dist/templates/components/layout/Tree.js +322 -0
  30. package/dist/templates/components/layout/TreeData.d.ts +1 -0
  31. package/dist/templates/components/layout/TreeData.js +131 -0
  32. package/dist/templates/components/layout/Update.d.ts +1 -1
  33. package/dist/templates/components/layout/Update.js +3 -0
  34. package/dist/templates/lib/rss.d.ts +1 -0
  35. package/dist/templates/lib/rss.js +78 -0
  36. package/dist/templates/mdx/accordion.mdx.d.ts +1 -1
  37. package/dist/templates/mdx/accordion.mdx.js +1 -1
  38. package/dist/templates/mdx/api-playground.mdx.d.ts +1 -1
  39. package/dist/templates/mdx/api-playground.mdx.js +1 -1
  40. package/dist/templates/mdx/badges.mdx.d.ts +1 -0
  41. package/dist/templates/mdx/badges.mdx.js +237 -0
  42. package/dist/templates/mdx/buttons.mdx.d.ts +1 -1
  43. package/dist/templates/mdx/buttons.mdx.js +1 -1
  44. package/dist/templates/mdx/callouts.mdx.d.ts +1 -1
  45. package/dist/templates/mdx/callouts.mdx.js +1 -1
  46. package/dist/templates/mdx/cards.mdx.d.ts +1 -1
  47. package/dist/templates/mdx/cards.mdx.js +1 -1
  48. package/dist/templates/mdx/color-swatches.mdx.d.ts +1 -1
  49. package/dist/templates/mdx/color-swatches.mdx.js +1 -1
  50. package/dist/templates/mdx/columns.mdx.d.ts +1 -1
  51. package/dist/templates/mdx/columns.mdx.js +1 -1
  52. package/dist/templates/mdx/components.mdx.d.ts +1 -1
  53. package/dist/templates/mdx/components.mdx.js +14 -2
  54. package/dist/templates/mdx/fields.mdx.d.ts +1 -1
  55. package/dist/templates/mdx/fields.mdx.js +1 -1
  56. package/dist/templates/mdx/frames.mdx.d.ts +1 -1
  57. package/dist/templates/mdx/frames.mdx.js +1 -1
  58. package/dist/templates/mdx/icons.mdx.d.ts +1 -1
  59. package/dist/templates/mdx/icons.mdx.js +1 -1
  60. package/dist/templates/mdx/image-and-embeds.mdx.d.ts +1 -1
  61. package/dist/templates/mdx/image-and-embeds.mdx.js +1 -1
  62. package/dist/templates/mdx/images-and-embeds.mdx.d.ts +1 -0
  63. package/dist/templates/mdx/images-and-embeds.mdx.js +118 -0
  64. package/dist/templates/mdx/mermaid.mdx.d.ts +1 -1
  65. package/dist/templates/mdx/mermaid.mdx.js +1 -1
  66. package/dist/templates/mdx/navigation.mdx.d.ts +1 -1
  67. package/dist/templates/mdx/navigation.mdx.js +5 -1
  68. package/dist/templates/mdx/prompt.mdx.d.ts +1 -0
  69. package/dist/templates/mdx/prompt.mdx.js +69 -0
  70. package/dist/templates/mdx/steps.mdx.d.ts +1 -1
  71. package/dist/templates/mdx/steps.mdx.js +1 -1
  72. package/dist/templates/mdx/tabs.mdx.d.ts +1 -1
  73. package/dist/templates/mdx/tabs.mdx.js +1 -1
  74. package/dist/templates/mdx/tooltips.mdx.d.ts +1 -0
  75. package/dist/templates/mdx/tooltips.mdx.js +57 -0
  76. package/dist/templates/mdx/tree.mdx.d.ts +1 -0
  77. package/dist/templates/mdx/tree.mdx.js +158 -0
  78. package/dist/templates/mdx/update.mdx.d.ts +1 -1
  79. package/dist/templates/mdx/update.mdx.js +42 -2
  80. package/dist/templates/package.js +1 -1
  81. package/package.json +2 -2
  82. package/dist/templates/mdx/platform/external-links.mdx.d.ts +0 -1
  83. package/dist/templates/mdx/platform/external-links.mdx.js +0 -47
  84. package/dist/templates/utils/apiAnchors.d.ts +0 -1
  85. package/dist/templates/utils/apiAnchors.js +0 -39
@@ -0,0 +1,455 @@
1
+ export const badgeTemplate = `"use client";
2
+ import styled, { css } from "styled-components";
3
+ import { Theme } from "@/app/theme";
4
+ import { Icon } from "@/components/layout/Icon";
5
+
6
+ type BadgeColor =
7
+ | "gray"
8
+ | "blue"
9
+ | "green"
10
+ | "yellow"
11
+ | "orange"
12
+ | "red"
13
+ | "purple"
14
+ | "white"
15
+ | "surface"
16
+ | "white-destructive"
17
+ | "surface-destructive"
18
+ | "info"
19
+ | "success"
20
+ | "warning"
21
+ | "error";
22
+
23
+ type BadgeSize = "xs" | "sm" | "md" | "lg";
24
+
25
+ type BadgeShape = "rounded" | "pill";
26
+
27
+ // The semantic colors read theme tokens instead of the fixed palette, so
28
+ // they follow theme.json and the light/dark toggle. They are also what the
29
+ // HTTP method chips use.
30
+ const THEME_TOKEN_COLORS = ["info", "success", "warning", "error"] as const;
31
+
32
+ type ThemeTokenColor = (typeof THEME_TOKEN_COLORS)[number];
33
+
34
+ type HexBadgeColor = Exclude<BadgeColor, ThemeTokenColor>;
35
+
36
+ function isThemeTokenColor(color: BadgeColor): color is ThemeTokenColor {
37
+ return (THEME_TOKEN_COLORS as readonly string[]).includes(color);
38
+ }
39
+
40
+ // Single source for verb -> badge color, shared by the sidebar method tags
41
+ // and the API playground so every surface colors HTTP verbs identically.
42
+ const HTTP_METHOD_COLORS: Record<string, BadgeColor> = {
43
+ get: "info",
44
+ post: "success",
45
+ put: "warning",
46
+ patch: "warning",
47
+ delete: "error",
48
+ head: "gray",
49
+ options: "gray",
50
+ trace: "gray",
51
+ };
52
+
53
+ function httpMethodBadgeColor(method: string): BadgeColor {
54
+ return HTTP_METHOD_COLORS[method.toLowerCase()] ?? "gray";
55
+ }
56
+
57
+ interface BadgePalette {
58
+ background: string;
59
+ text: string;
60
+ border: string;
61
+ darkBackground: string;
62
+ darkText: string;
63
+ darkBorder: string;
64
+ }
65
+
66
+ // Strong fills for the hex palette; the white and surface variants have no
67
+ // distinct solid form and fall back to their filled palette.
68
+ const SOLID_ACCENTS: Partial<Record<HexBadgeColor, string>> = {
69
+ gray: "#71717a",
70
+ blue: "#3b82f6",
71
+ green: "#22c55e",
72
+ yellow: "#eab308",
73
+ orange: "#f97316",
74
+ red: "#ef4444",
75
+ purple: "#a855f7",
76
+ };
77
+
78
+ // Color tints are label-semantic and intentionally independent of theme.json
79
+ // (same rationale as Callout's alert tints); only the surface and semantic
80
+ // token variants read theme tokens, so they follow the active theme on both
81
+ // modes. When both are set, solid wins over stroke.
82
+ function badgePalette(
83
+ theme: Theme,
84
+ color: BadgeColor,
85
+ stroke: boolean,
86
+ solid: boolean,
87
+ ): BadgePalette {
88
+ if (isThemeTokenColor(color)) {
89
+ const token = theme.colors[color];
90
+ if (solid) {
91
+ return {
92
+ background: token,
93
+ text: theme.colors.surface,
94
+ border: "transparent",
95
+ darkBackground: token,
96
+ darkText: theme.colors.surface,
97
+ darkBorder: "transparent",
98
+ };
99
+ }
100
+ if (stroke) {
101
+ return {
102
+ background: "transparent",
103
+ text: token,
104
+ border: token,
105
+ darkBackground: "transparent",
106
+ darkText: token,
107
+ darkBorder: token,
108
+ };
109
+ }
110
+ const tint = \`color-mix(in srgb, \${token} 15%, transparent)\`;
111
+ return {
112
+ background: tint,
113
+ text: token,
114
+ border: "transparent",
115
+ darkBackground: tint,
116
+ darkText: token,
117
+ darkBorder: "transparent",
118
+ };
119
+ }
120
+
121
+ const solidAccent = SOLID_ACCENTS[color];
122
+ if (solid && solidAccent) {
123
+ return {
124
+ background: solidAccent,
125
+ text: "#ffffff",
126
+ border: "transparent",
127
+ darkBackground: solidAccent,
128
+ darkText: "#ffffff",
129
+ darkBorder: "transparent",
130
+ };
131
+ }
132
+
133
+ const surface = {
134
+ background: theme.colors.surface,
135
+ text: theme.colors.grayDark,
136
+ border: theme.colors.grayLight,
137
+ darkBackground: theme.colors.surface,
138
+ darkText: theme.colors.grayDark,
139
+ darkBorder: theme.colors.grayLight,
140
+ };
141
+
142
+ if (stroke && !solid) {
143
+ const strokes: Record<HexBadgeColor, BadgePalette> = {
144
+ gray: {
145
+ background: "transparent",
146
+ text: "#52525b",
147
+ border: "#a1a1aa",
148
+ darkBackground: "transparent",
149
+ darkText: "#d4d4d8",
150
+ darkBorder: "#71717a",
151
+ },
152
+ blue: {
153
+ background: "transparent",
154
+ text: "#1d4ed8",
155
+ border: "#3b82f6",
156
+ darkBackground: "transparent",
157
+ darkText: "#93c5fd",
158
+ darkBorder: "#3b82f6",
159
+ },
160
+ green: {
161
+ background: "transparent",
162
+ text: "#15803d",
163
+ border: "#22c55e",
164
+ darkBackground: "transparent",
165
+ darkText: "#86efac",
166
+ darkBorder: "#22c55e",
167
+ },
168
+ yellow: {
169
+ background: "transparent",
170
+ text: "#a16207",
171
+ border: "#eab308",
172
+ darkBackground: "transparent",
173
+ darkText: "#fde047",
174
+ darkBorder: "#eab308",
175
+ },
176
+ orange: {
177
+ background: "transparent",
178
+ text: "#c2410c",
179
+ border: "#f97316",
180
+ darkBackground: "transparent",
181
+ darkText: "#fdba74",
182
+ darkBorder: "#f97316",
183
+ },
184
+ red: {
185
+ background: "transparent",
186
+ text: "#b91c1c",
187
+ border: "#ef4444",
188
+ darkBackground: "transparent",
189
+ darkText: "#fca5a5",
190
+ darkBorder: "#ef4444",
191
+ },
192
+ purple: {
193
+ background: "transparent",
194
+ text: "#7e22ce",
195
+ border: "#a855f7",
196
+ darkBackground: "transparent",
197
+ darkText: "#d8b4fe",
198
+ darkBorder: "#a855f7",
199
+ },
200
+ white: {
201
+ background: "transparent",
202
+ text: "#18181b",
203
+ border: "#e4e4e7",
204
+ darkBackground: "transparent",
205
+ darkText: "#fafafa",
206
+ darkBorder: "#3f3f46",
207
+ },
208
+ surface: { ...surface, background: "transparent" },
209
+ "white-destructive": {
210
+ background: "transparent",
211
+ text: "#b91c1c",
212
+ border: "#ef4444",
213
+ darkBackground: "transparent",
214
+ darkText: "#fca5a5",
215
+ darkBorder: "#ef4444",
216
+ },
217
+ "surface-destructive": {
218
+ background: "transparent",
219
+ text: "#b91c1c",
220
+ border: "#ef4444",
221
+ darkBackground: "transparent",
222
+ darkText: "#fca5a5",
223
+ darkBorder: "#ef4444",
224
+ },
225
+ };
226
+ return strokes[color];
227
+ }
228
+
229
+ const filled: Record<HexBadgeColor, BadgePalette> = {
230
+ gray: {
231
+ background: "#f4f4f5",
232
+ text: "#3f3f46",
233
+ border: "transparent",
234
+ darkBackground: "#71717a33",
235
+ darkText: "#d4d4d8",
236
+ darkBorder: "transparent",
237
+ },
238
+ blue: {
239
+ background: "#dbeafe",
240
+ text: "#1e40af",
241
+ border: "transparent",
242
+ darkBackground: "#3b82f633",
243
+ darkText: "#93c5fd",
244
+ darkBorder: "transparent",
245
+ },
246
+ green: {
247
+ background: "#dcfce7",
248
+ text: "#166534",
249
+ border: "transparent",
250
+ darkBackground: "#22c55e33",
251
+ darkText: "#86efac",
252
+ darkBorder: "transparent",
253
+ },
254
+ yellow: {
255
+ background: "#fef9c3",
256
+ text: "#854d0e",
257
+ border: "transparent",
258
+ darkBackground: "#eab30833",
259
+ darkText: "#fde047",
260
+ darkBorder: "transparent",
261
+ },
262
+ orange: {
263
+ background: "#ffedd5",
264
+ text: "#9a3412",
265
+ border: "transparent",
266
+ darkBackground: "#f9731633",
267
+ darkText: "#fdba74",
268
+ darkBorder: "transparent",
269
+ },
270
+ red: {
271
+ background: "#fee2e2",
272
+ text: "#991b1b",
273
+ border: "transparent",
274
+ darkBackground: "#ef444433",
275
+ darkText: "#fca5a5",
276
+ darkBorder: "transparent",
277
+ },
278
+ purple: {
279
+ background: "#f3e8ff",
280
+ text: "#6b21a8",
281
+ border: "transparent",
282
+ darkBackground: "#a855f733",
283
+ darkText: "#d8b4fe",
284
+ darkBorder: "transparent",
285
+ },
286
+ white: {
287
+ background: "#ffffff",
288
+ text: "#18181b",
289
+ border: "#e4e4e7",
290
+ darkBackground: "#ffffff",
291
+ darkText: "#18181b",
292
+ darkBorder: "#e4e4e7",
293
+ },
294
+ surface,
295
+ "white-destructive": {
296
+ background: "#ffffff",
297
+ text: "#b91c1c",
298
+ border: "#fecaca",
299
+ darkBackground: "#ffffff",
300
+ darkText: "#b91c1c",
301
+ darkBorder: "#fecaca",
302
+ },
303
+ "surface-destructive": {
304
+ ...surface,
305
+ text: "#b91c1c",
306
+ border: "#fecaca",
307
+ darkText: "#fca5a5",
308
+ darkBorder: "#ef44444d",
309
+ },
310
+ };
311
+ return filled[color];
312
+ }
313
+
314
+ const badgeSizes = {
315
+ xs: css\`
316
+ font-size: 11px;
317
+ line-height: 16px;
318
+ padding: 1px 6px;
319
+ gap: 3px;
320
+ \`,
321
+ sm: css\`
322
+ font-size: 12px;
323
+ line-height: 18px;
324
+ padding: 2px 8px;
325
+ gap: 4px;
326
+ \`,
327
+ md: css\`
328
+ font-size: 13px;
329
+ line-height: 20px;
330
+ padding: 3px 10px;
331
+ gap: 5px;
332
+ \`,
333
+ lg: css\`
334
+ font-size: 14px;
335
+ line-height: 22px;
336
+ padding: 4px 12px;
337
+ gap: 6px;
338
+ \`,
339
+ };
340
+
341
+ const badgeIconSizes: Record<BadgeSize, number> = {
342
+ xs: 10,
343
+ sm: 12,
344
+ md: 14,
345
+ lg: 16,
346
+ };
347
+
348
+ const StyledBadge = styled.span<{
349
+ theme: Theme;
350
+ $color: BadgeColor;
351
+ $size: BadgeSize;
352
+ $shape: BadgeShape;
353
+ $stroke: boolean;
354
+ $solid: boolean;
355
+ $mono: boolean;
356
+ $disabled: boolean;
357
+ }>\`
358
+ display: inline-flex;
359
+ align-items: center;
360
+ vertical-align: middle;
361
+ max-width: max-content;
362
+ font-family: inherit;
363
+ font-weight: 600;
364
+ white-space: nowrap;
365
+
366
+ & svg.lucide {
367
+ flex-shrink: 0;
368
+ color: inherit;
369
+ }
370
+
371
+ \${({ $size }) => badgeSizes[$size]}
372
+
373
+ \${({ theme, $mono }) =>
374
+ $mono &&
375
+ css\`
376
+ font-family: \${theme.fonts.mono};
377
+ font-weight: 700;
378
+ text-transform: uppercase;
379
+ letter-spacing: 0.04em;
380
+ \`}
381
+
382
+ \${({ theme, $shape }) =>
383
+ $shape === "pill"
384
+ ? css\`
385
+ border-radius: 999px;
386
+ \`
387
+ : css\`
388
+ border-radius: \${theme.spacing.radius.xs};
389
+ \`}
390
+
391
+ \${({ theme, $color, $stroke, $solid }) => {
392
+ const palette = badgePalette(theme, $color, $stroke, $solid);
393
+ return css\`
394
+ background: \${palette.background};
395
+ color: \${palette.text};
396
+ border: solid 1px \${palette.border};
397
+
398
+ :root.dark & {
399
+ background: \${palette.darkBackground};
400
+ color: \${palette.darkText};
401
+ border-color: \${palette.darkBorder};
402
+ }
403
+ \`;
404
+ }}
405
+
406
+ \${({ $disabled }) =>
407
+ $disabled &&
408
+ css\`
409
+ opacity: 0.5;
410
+ \`}
411
+ \`;
412
+
413
+ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
414
+ children: React.ReactNode;
415
+ color?: BadgeColor;
416
+ size?: BadgeSize;
417
+ shape?: BadgeShape;
418
+ icon?: string;
419
+ stroke?: boolean;
420
+ solid?: boolean;
421
+ mono?: boolean;
422
+ disabled?: boolean;
423
+ }
424
+
425
+ function Badge({
426
+ children,
427
+ color = "gray",
428
+ size = "md",
429
+ shape = "rounded",
430
+ icon,
431
+ stroke = false,
432
+ solid = false,
433
+ mono = false,
434
+ disabled = false,
435
+ className,
436
+ }: BadgeProps) {
437
+ return (
438
+ <StyledBadge
439
+ className={className}
440
+ $color={color}
441
+ $size={size}
442
+ $shape={shape}
443
+ $stroke={stroke}
444
+ $solid={solid}
445
+ $mono={mono}
446
+ $disabled={disabled}
447
+ >
448
+ {icon ? <Icon name={icon} size={badgeIconSizes[size]} /> : null}
449
+ {children}
450
+ </StyledBadge>
451
+ );
452
+ }
453
+
454
+ export { Badge, httpMethodBadgeColor };
455
+ `;
@@ -1 +1 @@
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 & kbd {\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 overflow-wrap: anywhere;\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: 1;\n max-width: 640px;\n margin: auto;\n`;\n\ninterface Props {\n theme?: Theme;\n $isActive?: boolean;\n $isOpen?: 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 display: inline-flex;\n align-items: center;\n gap: 8px;\n\n & svg {\n flex-shrink: 0;\n }\n`;\n\nexport const StyledSidebarListItem = styled.li`\n display: flex;\n gap: 10px;\n clear: both;\n`;\n\n// Shared appearance for every sidebar row - leaf links AND nested group\n// headers - so hover, active state, and the left rail read identically.\nconst sidebarRowStyles = css<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 align-items: center;\n gap: 8px;\n flex: 1;\n min-width: 0;\n transition: all 0.3s ease;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n\n & svg {\n flex-shrink: 0;\n }\n\n &:hover {\n color: ${({ theme }) => theme.colors.accent};\n border-color: ${({ theme }) => theme.colors.primary};\n }\n\n ${({ $isActive, theme }) =>\n $isActive &&\n css`\n color: ${theme.colors.accentStrong};\n border-color: ${theme.colors.primary};\n font-weight: 600;\n `};\n`;\n\n// The collapse chevron points right when closed and rotates to point down\n// when the group is open.\nconst sidebarChevron = css<Props>`\n & .lucide-chevron-right {\n margin-left: auto;\n transition: transform 0.3s ease;\n\n ${({ $isOpen }) =>\n $isOpen &&\n css`\n transform: rotate(90deg);\n `}\n }\n`;\n\nexport const StyledSidebarListItemLink = styled(Link)<Props>`\n ${sidebarRowStyles};\n`;\n\n// Compact HTTP-method label shown before a generated API endpoint link, colored\n// by verb so endpoints are scannable in the sidebar. Only rendered when a link\n// carries an `httpMethod` (endpoint pages do; hand-written pages do not).\nconst METHOD_TAG_COLORS: Record<string, keyof Theme[\"colors\"]> = {\n get: \"info\",\n post: \"success\",\n put: \"warning\",\n patch: \"warning\",\n delete: \"error\",\n head: \"gray\",\n options: \"gray\",\n trace: \"gray\",\n};\n\nfunction methodTagColor(theme: Theme, method: string): string {\n return theme.colors[METHOD_TAG_COLORS[method.toLowerCase()] ?? \"gray\"];\n}\n\nexport const StyledSidebarMethodTag = styled.span<{\n theme: Theme;\n $method: string;\n $isActive?: boolean;\n}>`\n flex-shrink: 0;\n font-family: ${({ theme }) => theme.fonts.mono};\n font-size: 9px;\n font-weight: 700;\n letter-spacing: 0.02em;\n text-transform: uppercase;\n padding: 1px 4px;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n color: ${({ theme, $method, $isActive }) =>\n $isActive ? theme.colors.surface : methodTagColor(theme, $method)};\n background: ${({ theme, $method, $isActive }) =>\n $isActive\n ? methodTagColor(theme, $method)\n : `color-mix(in srgb, ${methodTagColor(theme, $method)} 15%, transparent)`};\n`;\n\n// Nested navigation group. The header shares the link appearance/hover; a\n// non-navigable group is a single toggle button, while a group that is also a\n// page pairs a link with a chevron toggle. Children live in\n// StyledSidebarGroupContent, which animates open/closed via height 0 <-> auto\n// (enabled by interpolate-size in GlobalStyles, same as the Accordion).\nexport const StyledSidebarGroupButton = styled.button<Props>`\n ${resetButton};\n ${sidebarRowStyles};\n ${sidebarChevron};\n width: 100%;\n text-align: left;\n\n /* Buttons aren't covered by the global a:focus-visible ring, so this\n nav-row toggle carries its own copy of it. */\n &:focus-visible {\n outline: none;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n`;\n\nexport const StyledSidebarGroupRow = styled.div<Props>`\n ${sidebarRowStyles};\n ${sidebarChevron};\n\n /* The row is a plain div, so it never matches :focus-visible itself. Ring the\n whole row when its inner link or chevron takes keyboard focus instead, to\n match the leaf-row focus treatment. */\n &:has(:focus-visible) {\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n`;\n\nexport const StyledSidebarGroupLink = styled(Link)`\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n min-width: 0;\n color: inherit;\n text-decoration: none;\n\n & svg {\n flex-shrink: 0;\n }\n\n /* Ring is drawn on the parent row via :has(:focus-visible); suppress the\n global a:focus-visible glow so it isn't drawn twice. */\n &:focus-visible {\n outline: none;\n box-shadow: none;\n }\n`;\n\nexport const StyledSidebarGroupChevron = styled.button`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n border: 0;\n background: none;\n color: inherit;\n cursor: pointer;\n\n /* Ring is drawn on the parent row via :has(:focus-visible). */\n &:focus-visible {\n outline: none;\n }\n`;\n\nexport const StyledSidebarGroupContent = styled.ul<Props>`\n list-style: none;\n margin: 0;\n padding: 0;\n height: 0;\n overflow: clip;\n transition: all 0.3s ease;\n\n ${({ $isOpen }) =>\n $isOpen &&\n css`\n height: auto;\n `}\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
+ 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 { Badge } from \"@/components/layout/Badge\";\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 & kbd {\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 overflow-wrap: anywhere;\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: 1;\n max-width: 640px;\n margin: auto;\n`;\n\ninterface Props {\n theme?: Theme;\n $isActive?: boolean;\n $isOpen?: 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 display: inline-flex;\n align-items: center;\n gap: 8px;\n\n & svg {\n flex-shrink: 0;\n }\n`;\n\nexport const StyledSidebarListItem = styled.li`\n display: flex;\n gap: 10px;\n clear: both;\n`;\n\n// Shared appearance for every sidebar row - leaf links AND nested group\n// headers - so hover, active state, and the left rail read identically.\nconst sidebarRowStyles = css<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 align-items: center;\n gap: 8px;\n flex: 1;\n min-width: 0;\n transition: all 0.3s ease;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n\n & svg {\n flex-shrink: 0;\n }\n\n &:hover {\n color: ${({ theme }) => theme.colors.accent};\n border-color: ${({ theme }) => theme.colors.primary};\n }\n\n ${({ $isActive, theme }) =>\n $isActive &&\n css`\n color: ${theme.colors.accentStrong};\n border-color: ${theme.colors.primary};\n font-weight: 600;\n `};\n`;\n\n// The collapse chevron points right when closed and rotates to point down\n// when the group is open.\nconst sidebarChevron = css<Props>`\n & .lucide-chevron-right {\n margin-left: auto;\n transition: transform 0.3s ease;\n\n ${({ $isOpen }) =>\n $isOpen &&\n css`\n transform: rotate(90deg);\n `}\n }\n`;\n\nexport const StyledSidebarListItemLink = styled(Link)<Props>`\n ${sidebarRowStyles};\n`;\n\n// Compact HTTP-method label shown before a generated API endpoint link, colored\n// by verb so endpoints are scannable in the sidebar. Only rendered when a link\n// carries an `httpMethod` (endpoint pages do; hand-written pages do not).\n// The look is Badge's mono variation (tinted, solid when active); only\n// sidebar metrics are adjusted here.\nexport const StyledSidebarMethodTag = styled(Badge)`\n flex-shrink: 0;\n font-size: 9px;\n letter-spacing: 0.02em;\n padding: 1px 4px;\n border: none;\n`;\n\n// Nested navigation group. The header shares the link appearance/hover; a\n// non-navigable group is a single toggle button, while a group that is also a\n// page pairs a link with a chevron toggle. Children live in\n// StyledSidebarGroupContent, which animates open/closed via height 0 <-> auto\n// (enabled by interpolate-size in GlobalStyles, same as the Accordion).\nexport const StyledSidebarGroupButton = styled.button<Props>`\n ${resetButton};\n ${sidebarRowStyles};\n ${sidebarChevron};\n width: 100%;\n text-align: left;\n\n /* Buttons aren't covered by the global a:focus-visible ring, so this\n nav-row toggle carries its own copy of it. */\n &:focus-visible {\n outline: none;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n`;\n\nexport const StyledSidebarGroupRow = styled.div<Props>`\n ${sidebarRowStyles};\n ${sidebarChevron};\n\n /* The row is a plain div, so it never matches :focus-visible itself. Ring the\n whole row when its inner link or chevron takes keyboard focus instead, to\n match the leaf-row focus treatment. */\n &:has(:focus-visible) {\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n`;\n\nexport const StyledSidebarGroupLink = styled(Link)`\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n min-width: 0;\n color: inherit;\n text-decoration: none;\n\n & svg {\n flex-shrink: 0;\n }\n\n /* Ring is drawn on the parent row via :has(:focus-visible); suppress the\n global a:focus-visible glow so it isn't drawn twice. */\n &:focus-visible {\n outline: none;\n box-shadow: none;\n }\n`;\n\nexport const StyledSidebarGroupChevron = styled.button`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0;\n border: 0;\n background: none;\n color: inherit;\n cursor: pointer;\n\n /* Ring is drawn on the parent row via :has(:focus-visible). */\n &:focus-visible {\n outline: none;\n }\n`;\n\nexport const StyledSidebarGroupContent = styled.ul<Props>`\n list-style: none;\n margin: 0;\n padding: 0;\n height: 0;\n overflow: clip;\n transition: all 0.3s ease;\n\n ${({ $isOpen }) =>\n $isOpen &&\n css`\n height: auto;\n `}\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";
@@ -15,6 +15,7 @@ import {
15
15
  styledTable,
16
16
  stylesLists,
17
17
  } from "@/components/layout/SharedStyled";
18
+ import { Badge } from "@/components/layout/Badge";
18
19
  import { ChatContext } from "@/components/Chat";
19
20
 
20
21
  const SectionBarContext = createContext(false);
@@ -343,40 +344,14 @@ export const StyledSidebarListItemLink = styled(Link)<Props>\`
343
344
  // Compact HTTP-method label shown before a generated API endpoint link, colored
344
345
  // by verb so endpoints are scannable in the sidebar. Only rendered when a link
345
346
  // carries an \`httpMethod\` (endpoint pages do; hand-written pages do not).
346
- const METHOD_TAG_COLORS: Record<string, keyof Theme["colors"]> = {
347
- get: "info",
348
- post: "success",
349
- put: "warning",
350
- patch: "warning",
351
- delete: "error",
352
- head: "gray",
353
- options: "gray",
354
- trace: "gray",
355
- };
356
-
357
- function methodTagColor(theme: Theme, method: string): string {
358
- return theme.colors[METHOD_TAG_COLORS[method.toLowerCase()] ?? "gray"];
359
- }
360
-
361
- export const StyledSidebarMethodTag = styled.span<{
362
- theme: Theme;
363
- $method: string;
364
- $isActive?: boolean;
365
- }>\`
347
+ // The look is Badge's mono variation (tinted, solid when active); only
348
+ // sidebar metrics are adjusted here.
349
+ export const StyledSidebarMethodTag = styled(Badge)\`
366
350
  flex-shrink: 0;
367
- font-family: \${({ theme }) => theme.fonts.mono};
368
351
  font-size: 9px;
369
- font-weight: 700;
370
352
  letter-spacing: 0.02em;
371
- text-transform: uppercase;
372
353
  padding: 1px 4px;
373
- border-radius: \${({ theme }) => theme.spacing.radius.xs};
374
- color: \${({ theme, $method, $isActive }) =>
375
- $isActive ? theme.colors.surface : methodTagColor(theme, $method)};
376
- background: \${({ theme, $method, $isActive }) =>
377
- $isActive
378
- ? methodTagColor(theme, $method)
379
- : \`color-mix(in srgb, \${methodTagColor(theme, $method)} 15%, transparent)\`};
354
+ border: none;
380
355
  \`;
381
356
 
382
357
  // Nested navigation group. The header shares the link appearance/hover; a
@@ -0,0 +1 @@
1
+ export declare const promptTemplate = "\"use client\";\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport {\n interactiveStyles,\n styledSmall,\n styledText,\n} from \"cherry-styled-components\";\nimport { Theme } from \"@/app/theme\";\nimport { Icon } from \"@/components/layout/Icon\";\nimport { CopyButton } from \"@/components/layout/CopyButton\";\n\ntype PromptAction = \"copy\" | \"cursor\";\n\nconst CURSOR_DEEPLINK = \"cursor://anysphere.cursor-deeplink/prompt?text=\";\n\n// The prompt body arrives as rendered MDX elements, but the copy and Cursor\n// actions need plain text. Paragraphs and lists become separate lines and\n// list items keep a \"- \" marker so the copied prompt stays readable.\nfunction promptText(node: React.ReactNode): string {\n if (node == null || typeof node === \"boolean\") return \"\";\n if (typeof node === \"string\" || typeof node === \"number\") {\n return String(node);\n }\n if (Array.isArray(node)) return node.map(promptText).join(\"\");\n if (React.isValidElement(node)) {\n const element = node as React.ReactElement<{\n children?: React.ReactNode;\n }>;\n const inner = promptText(element.props.children);\n if (element.type === \"p\") return inner + \"\\n\\n\";\n if (element.type === \"ul\" || element.type === \"ol\") return inner + \"\\n\";\n if (element.type === \"li\") return \"- \" + inner + \"\\n\";\n return inner;\n }\n return \"\";\n}\n\nconst StyledPrompt = styled.div<{ theme: Theme }>`\n background: ${({ theme }) => theme.colors.light};\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n padding: 20px;\n width: 100%;\n`;\n\nconst StyledPromptHeader = styled.div<{ theme: Theme }>`\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 0 0 15px;\n ${({ theme }) => styledSmall(theme)};\n font-weight: 700;\n color: ${({ theme }) => theme.colors.dark};\n\n & > svg.lucide {\n flex-shrink: 0;\n color: inherit;\n }\n`;\n\nconst StyledPromptDescription = styled.span`\n flex: 1;\n min-width: 0;\n`;\n\nconst StyledPromptActions = styled.span`\n display: flex;\n align-items: center;\n gap: 5px;\n flex-shrink: 0;\n`;\n\n// Matches the CopyButton chrome so the two actions read as one control\n// group; a link rather than a button because it navigates to the Cursor\n// deeplink.\nconst StyledCursorLink = styled.a<{ theme: Theme }>`\n ${interactiveStyles}\n display: flex;\n align-items: center;\n gap: 5px;\n background: ${({ theme }) => theme.colors.light};\n border-color: ${({ theme }) => theme.colors.grayLight};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n padding: 4px 8px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 600;\n color: ${({ theme }) => theme.colors.grayDark};\n text-decoration: none;\n\n & svg.lucide {\n margin: 0;\n color: inherit;\n }\n`;\n\nconst StyledPromptBody = styled.div<{ theme: Theme }>`\n ${({ theme }) => styledText(theme)};\n color: ${({ theme }) => theme.colors.grayDark};\n display: flex;\n flex-direction: column;\n gap: 20px;\n`;\n\ninterface PromptProps {\n children: React.ReactNode;\n description: string;\n icon?: string;\n actions?: PromptAction[];\n}\n\nfunction Prompt({\n children,\n description,\n icon,\n actions = [\"copy\"],\n}: PromptProps) {\n const text = promptText(children)\n .replace(/\\n{3,}/g, \"\\n\\n\")\n .trim();\n\n return (\n <StyledPrompt>\n <StyledPromptHeader>\n {icon ? <Icon name={icon} size={16} /> : null}\n <StyledPromptDescription>{description}</StyledPromptDescription>\n <StyledPromptActions>\n {actions.includes(\"copy\") && (\n <CopyButton text={text} label=\"Copy prompt\" size={16} />\n )}\n {actions.includes(\"cursor\") && (\n <StyledCursorLink\n href={CURSOR_DEEPLINK + encodeURIComponent(text)}\n aria-label=\"Open prompt in Cursor\"\n >\n Cursor\n <Icon name=\"arrow-up-right\" size={12} />\n </StyledCursorLink>\n )}\n </StyledPromptActions>\n </StyledPromptHeader>\n <StyledPromptBody>{children}</StyledPromptBody>\n </StyledPrompt>\n );\n}\n\nexport { Prompt };\n";