doccupine 0.0.136 → 0.0.137

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 (43) hide show
  1. package/dist/lib/structures.js +6 -0
  2. package/dist/templates/components/Docs.d.ts +1 -1
  3. package/dist/templates/components/Docs.js +7 -2
  4. package/dist/templates/components/MDXComponents.d.ts +1 -1
  5. package/dist/templates/components/MDXComponents.js +2 -0
  6. package/dist/templates/components/SideBar.d.ts +1 -1
  7. package/dist/templates/components/SideBar.js +5 -0
  8. package/dist/templates/components/layout/Badge.d.ts +1 -1
  9. package/dist/templates/components/layout/Badge.js +16 -5
  10. package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
  11. package/dist/templates/components/layout/DocsComponents.js +10 -0
  12. package/dist/templates/components/layout/DocsNavigation.d.ts +1 -1
  13. package/dist/templates/components/layout/DocsNavigation.js +8 -1
  14. package/dist/templates/components/layout/FocusModeToggle.d.ts +1 -0
  15. package/dist/templates/components/layout/FocusModeToggle.js +103 -0
  16. package/dist/templates/components/layout/Footer.d.ts +1 -1
  17. package/dist/templates/components/layout/Footer.js +7 -0
  18. package/dist/templates/components/layout/SharedStyles.d.ts +1 -1
  19. package/dist/templates/components/layout/SharedStyles.js +47 -0
  20. package/dist/templates/components/layout/SidePanel.d.ts +1 -0
  21. package/dist/templates/components/layout/SidePanel.js +65 -0
  22. package/dist/templates/components/layout/StaticLinks.d.ts +1 -1
  23. package/dist/templates/components/layout/StaticLinks.js +8 -1
  24. package/dist/templates/mdx/api-playground.mdx.d.ts +1 -1
  25. package/dist/templates/mdx/api-playground.mdx.js +1 -1
  26. package/dist/templates/mdx/badges.mdx.d.ts +1 -1
  27. package/dist/templates/mdx/badges.mdx.js +2 -0
  28. package/dist/templates/mdx/color-swatches.mdx.d.ts +1 -1
  29. package/dist/templates/mdx/color-swatches.mdx.js +1 -1
  30. package/dist/templates/mdx/components.mdx.d.ts +1 -1
  31. package/dist/templates/mdx/components.mdx.js +3 -0
  32. package/dist/templates/mdx/fields.mdx.d.ts +1 -1
  33. package/dist/templates/mdx/fields.mdx.js +1 -1
  34. package/dist/templates/mdx/mermaid.mdx.d.ts +1 -1
  35. package/dist/templates/mdx/mermaid.mdx.js +1 -1
  36. package/dist/templates/mdx/navigation.mdx.d.ts +1 -1
  37. package/dist/templates/mdx/navigation.mdx.js +1 -0
  38. package/dist/templates/mdx/side-panel.mdx.d.ts +1 -0
  39. package/dist/templates/mdx/side-panel.mdx.js +62 -0
  40. package/dist/templates/mdx/update.mdx.d.ts +1 -1
  41. package/dist/templates/mdx/update.mdx.js +1 -1
  42. package/dist/templates/package.js +2 -2
  43. package/package.json +2 -2
@@ -0,0 +1,103 @@
1
+ export const focusModeToggleTemplate = `"use client";
2
+ import { useEffect, useRef, useState } from "react";
3
+ import styled from "styled-components";
4
+ import { resetButton } from "cherry-styled-components";
5
+ import { Icon } from "@/components/layout/Icon";
6
+ import { mq, Theme } from "@/app/theme";
7
+ import { interactiveStyles } from "@/components/layout/SharedStyled";
8
+
9
+ // Desktop-only affordance that collapses both rails for distraction-free
10
+ // reading. The button is fixed rather than living in the sidebar footer next
11
+ // to the ThemeToggle: the footer slides away with the sidebar, and the way
12
+ // back out of focus mode has to stay on screen.
13
+ const StyledFocusToggle = styled.button<{ theme: Theme }>\`
14
+ display: none;
15
+
16
+ \${mq("lg")} {
17
+ \${resetButton};
18
+ \${interactiveStyles};
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ position: fixed;
23
+ /* Above the sidebar (99) so it stays clickable once the rails are out,
24
+ below the chat panel (1000). */
25
+ z-index: 100;
26
+ /* Sidebar footer row, flush with the footer's left padding (the
27
+ ThemeToggle holds the right end of the same row). */
28
+ left: 20px;
29
+ bottom: 16px;
30
+ width: 30px;
31
+ height: 30px;
32
+ border-radius: 50%;
33
+ background: \${({ theme }) => theme.colors.light};
34
+ border-color: \${({ theme }) => theme.colors.grayLight};
35
+
36
+ & svg {
37
+ width: 16px;
38
+ height: 16px;
39
+ }
40
+
41
+ & svg[stroke] {
42
+ stroke: \${({ theme }) => theme.colors.primary};
43
+ }
44
+
45
+ &:hover svg[stroke] {
46
+ stroke: \${({ theme }) => theme.colors.accent};
47
+ }
48
+ }
49
+ \`;
50
+
51
+ function FocusModeToggle() {
52
+ const [isFocusMode, setIsFocusMode] = useState(false);
53
+ const buttonRef = useRef<HTMLButtonElement>(null);
54
+
55
+ // Cmd/Ctrl+B, the editor convention for collapsing the side columns. Sits
56
+ // alongside the app's other chords (Cmd+K search, Cmd+I chat,
57
+ // Cmd+Shift+L theme) and stays out of the way while the reader is typing.
58
+ useEffect(() => {
59
+ function handleKeyDown(e: KeyboardEvent) {
60
+ if (!(e.metaKey || e.ctrlKey) || e.shiftKey || e.altKey) return;
61
+ if (e.key.toLowerCase() !== "b") return;
62
+ const target = e.target as HTMLElement | null;
63
+ if (target?.closest("input, textarea, [contenteditable='true']")) return;
64
+ // The button is display:none below "lg" and focus mode is a desktop
65
+ // layout, so the shortcut is live exactly when the button is.
66
+ const button = buttonRef.current;
67
+ if (!button || getComputedStyle(button).display === "none") return;
68
+ e.preventDefault();
69
+ setIsFocusMode((value) => !value);
70
+ }
71
+ document.addEventListener("keydown", handleKeyDown);
72
+ return () => document.removeEventListener("keydown", handleKeyDown);
73
+ }, []);
74
+
75
+ // The nav sidebar, the right rail and the content columns sit in separate
76
+ // subtrees, so the state rides on the root element and each of them reacts
77
+ // in CSS (see focusModeHide / focusModeColumn in SharedStyled).
78
+ useEffect(() => {
79
+ const root = document.documentElement;
80
+ if (isFocusMode) {
81
+ root.setAttribute("data-focus-mode", "");
82
+ } else {
83
+ root.removeAttribute("data-focus-mode");
84
+ }
85
+ return () => root.removeAttribute("data-focus-mode");
86
+ }, [isFocusMode]);
87
+
88
+ return (
89
+ <StyledFocusToggle
90
+ ref={buttonRef}
91
+ type="button"
92
+ onClick={() => setIsFocusMode((value) => !value)}
93
+ aria-pressed={isFocusMode}
94
+ aria-label={isFocusMode ? "Exit focus mode" : "Enter focus mode"}
95
+ title={isFocusMode ? "Exit focus mode (⌘B)" : "Focus mode (⌘B)"}
96
+ >
97
+ <Icon name={isFocusMode ? "minimize" : "maximize"} size={16} />
98
+ </StyledFocusToggle>
99
+ );
100
+ }
101
+
102
+ export { FocusModeToggle };
103
+ `;
@@ -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 }) => 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.primary};\n }\n\n /* The GitHub logo is an icon-only link - round the global focus ring so it\n hugs the icon instead of drawing a rectangle. */\n &:has(svg):focus-visible {\n border-radius: 100%;\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{\" \"}\n <a\n href=\"https://doccupine.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Doccupine\n </a>\n </span>\n <a\n href=\"https://github.com/doccupine/cli\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\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 {\n focusModeColumn,\n sidePanelOffset,\n} from \"@/components/layout/SharedStyled\";\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 ${sidePanelOffset};\n ${({ $isChatOpen }) => !$isChatOpen && focusModeColumn};\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.primary};\n }\n\n /* The GitHub logo is an icon-only link - round the global focus ring so it\n hugs the icon instead of drawing a rectangle. */\n &:has(svg):focus-visible {\n border-radius: 100%;\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{\" \"}\n <a\n href=\"https://doccupine.com\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Doccupine\n </a>\n </span>\n <a\n href=\"https://github.com/doccupine/cli\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Doccupine on GitHub\"\n >\n <GitHubLogo />\n </a>\n </StyledFooterFlex>\n </StyledFooterInner>\n </StyledFooter>\n );\n}\n\nexport { Footer };\n";
@@ -6,6 +6,10 @@ import { Space, styledSmall } from "cherry-styled-components";
6
6
  import { ChatContext } from "@/components/Chat";
7
7
  import { mq, Theme } from "@/app/theme";
8
8
  import { GitHubLogo } from "@/components/layout/Pictograms";
9
+ import {
10
+ focusModeColumn,
11
+ sidePanelOffset,
12
+ } from "@/components/layout/SharedStyled";
9
13
  import linksData from "@/links.json";
10
14
 
11
15
  interface LinkProps {
@@ -40,6 +44,9 @@ const StyledFooter = styled.footer<{
40
44
  padding: 0 ${CHAT_WIDTH + 20}px 0 ${SIDEBAR_WIDTH + 20}px;
41
45
  \`}
42
46
  }
47
+
48
+ \${sidePanelOffset};
49
+ \${({ $isChatOpen }) => !$isChatOpen && focusModeColumn};
43
50
  \`;
44
51
 
45
52
  const StyledFooterInner = styled.div<{ theme: Theme }>\`
@@ -1 +1 @@
1
- export declare const sharedStyledTemplate = "\"use client\";\nimport { styledSmall, styledText } from \"cherry-styled-components\";\nimport { mq, Theme } from \"@/app/theme\";\nimport styled, { css } from \"styled-components\";\n\n/** Slim, theme-aware scrollbar for internal scroll areas (code blocks,\n modals, tables) so the chunky native bar doesn't stand out, especially\n in dark mode. */\nexport const thinScrollbar = css<{ theme: Theme }>`\n scrollbar-width: thin;\n scrollbar-color: ${({ theme }) => theme.colors.grayLight} transparent;\n`;\n\nexport const interactiveStyles = css<{ theme: Theme }>`\n transition: all 0.3s ease;\n border: solid 1px transparent;\n box-shadow: 0 0 0 0px ${({ theme }) => theme.colors.primary};\n\n &:hover {\n border-color: ${({ theme }) => theme.colors.primary};\n }\n\n &:focus {\n border-color: ${({ theme }) => theme.colors.primary};\n box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};\n }\n\n &:active {\n box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n`;\n\nexport const styledAnchor = css<{ theme: Theme }>`\n & a:not([class]):not(:has(img)) {\n color: inherit;\n transition: all 0.3s ease;\n text-decoration: none;\n box-shadow: 0 2px 0 0 ${({ theme }) => theme.colors.primary};\n\n &:hover {\n color: ${({ theme }) => theme.colors.accent};\n box-shadow: 0 1px 0 0 ${({ theme }) => theme.colors.primary};\n }\n\n /* Same primaryLight focus glow as the global a:focus-visible ring, but\n layered over the link's own box-shadow underline (same property) so the\n underline is preserved. */\n &:focus-visible {\n outline: none;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n box-shadow:\n 0 2px 0 0 ${({ theme }) => theme.colors.primary},\n 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n }\n`;\n\nexport const stylesLists = css<{ theme: Theme }>`\n & ul,\n & ol {\n & li {\n & > .code-wrapper {\n margin: 10px 0;\n }\n\n & p {\n display: inline;\n }\n }\n }\n\n & ul {\n list-style: none;\n padding: 0;\n margin: 0;\n\n & li {\n text-indent: 0;\n display: block;\n position: relative;\n padding: 0 0 0 24px;\n margin: 0;\n ${({ theme }) => styledText(theme)};\n min-height: 23px;\n\n ${mq(\"lg\")} {\n min-height: 27px;\n }\n\n &::before {\n content: \"\";\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: ${({ theme }) => theme.colors.primary};\n position: absolute;\n top: 8px;\n left: 9px;\n\n ${mq(\"lg\")} {\n top: 10px;\n }\n }\n }\n }\n\n & ol {\n counter-reset: item;\n padding: 0;\n margin: 0;\n\n & > li {\n counter-increment: item;\n padding: 0 0 0 24px;\n margin: 0;\n ${({ theme }) => styledText(theme)};\n\n &::before {\n content: counter(item) \".\";\n display: inline-block;\n min-width: 20px;\n margin-left: -24px;\n margin-right: 4px;\n text-align: right;\n font-weight: 700;\n color: ${({ theme }) => theme.colors.primary};\n }\n }\n }\n`;\n\nexport const styledTable = css<{ theme: Theme }>`\n & .table-wrapper {\n overflow-x: auto;\n width: 100%;\n ${thinScrollbar};\n }\n\n & table {\n margin: 0;\n padding: 0;\n border-collapse: collapse;\n width: 100%;\n text-align: left;\n\n & tr {\n margin: 0;\n padding: 0;\n }\n\n & th {\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n padding: 10px 10px 10px 0;\n ${({ theme }) => styledSmall(theme)};\n font-weight: 600;\n color: ${({ theme }) => theme.colors.dark};\n }\n\n & td {\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n padding: 10px 10px 10px 0;\n color: ${({ theme }) => theme.colors.grayDark};\n ${({ theme }) => styledSmall(theme)};\n }\n }\n`;\n\nexport const StyledSmallButton = styled.button<{ theme: Theme }>`\n ${interactiveStyles};\n background: ${({ theme }) => theme.colors.light};\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n color: ${({ theme }) => theme.colors.accent};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n padding: 6px 8px;\n font-size: 12px;\n font-family: inherit;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 6px;\n margin-right: -6px;\n\n & svg.lucide {\n color: inherit;\n }\n`;\n";
1
+ export declare const sharedStyledTemplate = "\"use client\";\nimport { styledSmall, styledText } from \"cherry-styled-components\";\nimport { mq, Theme } from \"@/app/theme\";\nimport styled, { css } from \"styled-components\";\n\n/** From \"xl\" a <SidePanel> widens from the navigation rail's width to the\n chat panel's, so every column that already shifts for an open chat shifts\n by the same amount when a panel is on the page. Below \"xl\" the panel fits\n the space the table of contents already reserved, so no offset applies and\n the content column keeps its width. :has() reads the server-rendered\n panel, so the layout is right on first paint with no client state. */\nexport const sidePanelOffset = css`\n ${mq(\"xl\")} {\n body:has([data-side-panel]) & {\n padding-right: 440px;\n }\n }\n`;\n\n/** Focus mode: FocusModeToggle sets data-focus-mode on <html> and the rails\n slide out of view, left rail leftwards and right rail rightwards. Keyed\n off the root element because the sidebar, the rails and the content\n columns live in separate subtrees. Desktop only - below \"lg\" the rails are\n already collapsed or inline. */\nexport const focusModeHide = (edge: \"left\" | \"right\") => css`\n ${mq(\"lg\")} {\n transition:\n transform 0.3s ease,\n opacity 0.3s ease;\n\n html[data-focus-mode] & {\n transform: translateX(${edge === \"left\" ? \"-100%\" : \"100%\"});\n opacity: 0;\n pointer-events: none;\n }\n }\n`;\n\n/** The other half of focus mode: a content column drops the padding it was\n reserving for the rails and centers on the full viewport. Interpolate it\n last so it wins over the equally specific sidePanelOffset rule, and skip\n it while the chat is open - that panel is still there to make room for. */\nexport const focusModeColumn = css`\n ${mq(\"lg\")} {\n html[data-focus-mode] & {\n padding-left: 20px;\n padding-right: 20px;\n }\n }\n`;\n\n/** Slim, theme-aware scrollbar for internal scroll areas (code blocks,\n modals, tables) so the chunky native bar doesn't stand out, especially\n in dark mode. */\nexport const thinScrollbar = css<{ theme: Theme }>`\n scrollbar-width: thin;\n scrollbar-color: ${({ theme }) => theme.colors.grayLight} transparent;\n`;\n\nexport const interactiveStyles = css<{ theme: Theme }>`\n transition: all 0.3s ease;\n border: solid 1px transparent;\n box-shadow: 0 0 0 0px ${({ theme }) => theme.colors.primary};\n\n &:hover {\n border-color: ${({ theme }) => theme.colors.primary};\n }\n\n &:focus {\n border-color: ${({ theme }) => theme.colors.primary};\n box-shadow: 0 0 0 4px ${({ theme }) => theme.colors.primaryLight};\n }\n\n &:active {\n box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n`;\n\nexport const styledAnchor = css<{ theme: Theme }>`\n & a:not([class]):not(:has(img)) {\n color: inherit;\n transition: all 0.3s ease;\n text-decoration: none;\n box-shadow: 0 2px 0 0 ${({ theme }) => theme.colors.primary};\n\n &:hover {\n color: ${({ theme }) => theme.colors.accent};\n box-shadow: 0 1px 0 0 ${({ theme }) => theme.colors.primary};\n }\n\n /* Same primaryLight focus glow as the global a:focus-visible ring, but\n layered over the link's own box-shadow underline (same property) so the\n underline is preserved. */\n &:focus-visible {\n outline: none;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n box-shadow:\n 0 2px 0 0 ${({ theme }) => theme.colors.primary},\n 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};\n }\n }\n`;\n\nexport const stylesLists = css<{ theme: Theme }>`\n & ul,\n & ol {\n & li {\n & > .code-wrapper {\n margin: 10px 0;\n }\n\n & p {\n display: inline;\n }\n }\n }\n\n & ul {\n list-style: none;\n padding: 0;\n margin: 0;\n\n & li {\n text-indent: 0;\n display: block;\n position: relative;\n padding: 0 0 0 24px;\n margin: 0;\n ${({ theme }) => styledText(theme)};\n min-height: 23px;\n\n ${mq(\"lg\")} {\n min-height: 27px;\n }\n\n &::before {\n content: \"\";\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: ${({ theme }) => theme.colors.primary};\n position: absolute;\n top: 8px;\n left: 9px;\n\n ${mq(\"lg\")} {\n top: 10px;\n }\n }\n }\n }\n\n & ol {\n counter-reset: item;\n padding: 0;\n margin: 0;\n\n & > li {\n counter-increment: item;\n padding: 0 0 0 24px;\n margin: 0;\n ${({ theme }) => styledText(theme)};\n\n &::before {\n content: counter(item) \".\";\n display: inline-block;\n min-width: 20px;\n margin-left: -24px;\n margin-right: 4px;\n text-align: right;\n font-weight: 700;\n color: ${({ theme }) => theme.colors.primary};\n }\n }\n }\n`;\n\nexport const styledTable = css<{ theme: Theme }>`\n & .table-wrapper {\n overflow-x: auto;\n width: 100%;\n ${thinScrollbar};\n }\n\n & table {\n margin: 0;\n padding: 0;\n border-collapse: collapse;\n width: 100%;\n text-align: left;\n\n & tr {\n margin: 0;\n padding: 0;\n }\n\n & th {\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n padding: 10px 10px 10px 0;\n ${({ theme }) => styledSmall(theme)};\n font-weight: 600;\n color: ${({ theme }) => theme.colors.dark};\n }\n\n & td {\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n padding: 10px 10px 10px 0;\n color: ${({ theme }) => theme.colors.grayDark};\n ${({ theme }) => styledSmall(theme)};\n }\n }\n`;\n\nexport const StyledSmallButton = styled.button<{ theme: Theme }>`\n ${interactiveStyles};\n background: ${({ theme }) => theme.colors.light};\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n color: ${({ theme }) => theme.colors.accent};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n padding: 6px 8px;\n font-size: 12px;\n font-family: inherit;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 6px;\n margin-right: -6px;\n\n & svg.lucide {\n color: inherit;\n }\n`;\n";
@@ -1,8 +1,55 @@
1
+ import { CHAT_WIDTH } from "../../app/theme.js";
1
2
  export const sharedStyledTemplate = `"use client";
2
3
  import { styledSmall, styledText } from "cherry-styled-components";
3
4
  import { mq, Theme } from "@/app/theme";
4
5
  import styled, { css } from "styled-components";
5
6
 
7
+ /** From "xl" a <SidePanel> widens from the navigation rail's width to the
8
+ chat panel's, so every column that already shifts for an open chat shifts
9
+ by the same amount when a panel is on the page. Below "xl" the panel fits
10
+ the space the table of contents already reserved, so no offset applies and
11
+ the content column keeps its width. :has() reads the server-rendered
12
+ panel, so the layout is right on first paint with no client state. */
13
+ export const sidePanelOffset = css\`
14
+ \${mq("xl")} {
15
+ body:has([data-side-panel]) & {
16
+ padding-right: ${CHAT_WIDTH + 20}px;
17
+ }
18
+ }
19
+ \`;
20
+
21
+ /** Focus mode: FocusModeToggle sets data-focus-mode on <html> and the rails
22
+ slide out of view, left rail leftwards and right rail rightwards. Keyed
23
+ off the root element because the sidebar, the rails and the content
24
+ columns live in separate subtrees. Desktop only - below "lg" the rails are
25
+ already collapsed or inline. */
26
+ export const focusModeHide = (edge: "left" | "right") => css\`
27
+ \${mq("lg")} {
28
+ transition:
29
+ transform 0.3s ease,
30
+ opacity 0.3s ease;
31
+
32
+ html[data-focus-mode] & {
33
+ transform: translateX(\${edge === "left" ? "-100%" : "100%"});
34
+ opacity: 0;
35
+ pointer-events: none;
36
+ }
37
+ }
38
+ \`;
39
+
40
+ /** The other half of focus mode: a content column drops the padding it was
41
+ reserving for the rails and centers on the full viewport. Interpolate it
42
+ last so it wins over the equally specific sidePanelOffset rule, and skip
43
+ it while the chat is open - that panel is still there to make room for. */
44
+ export const focusModeColumn = css\`
45
+ \${mq("lg")} {
46
+ html[data-focus-mode] & {
47
+ padding-left: 20px;
48
+ padding-right: 20px;
49
+ }
50
+ }
51
+ \`;
52
+
6
53
  /** Slim, theme-aware scrollbar for internal scroll areas (code blocks,
7
54
  modals, tables) so the chunky native bar doesn't stand out, especially
8
55
  in dark mode. */
@@ -0,0 +1 @@
1
+ export declare const sidePanelTemplate = "\"use client\";\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport { mq, Theme } from \"@/app/theme\";\nimport { focusModeHide } from \"@/components/layout/SharedStyled\";\n\n// Below \"lg\" the panel stays in the document flow, rendering inline exactly\n// where it sits in the MDX source. From \"lg\" up it is lifted out of the flow\n// into the fixed right rail, at the 280px width the table of\n// contents it replaces would have used - the content column already reserves\n// exactly that much, so nothing has to move. Only from \"xl\", where there is\n// room to spare, does it widen to the chat panel's 420px and pull\n// the other columns left with it (see sidePanelOffset, keyed off the data\n// attribute below).\nconst StyledSidePanel = styled.aside<{ theme: Theme }>`\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 20px;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 10%, transparent)`};\n\n ${mq(\"lg\")} {\n position: fixed;\n top: 0;\n right: 0;\n z-index: 1;\n width: 280px;\n height: 100dvh;\n overflow-y: auto;\n gap: 15px;\n padding: 82px 20px 20px 20px;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n border-radius: 0;\n background: ${({ theme }) => theme.colors.light};\n -webkit-overflow-scrolling: touch;\n\n &::-webkit-scrollbar {\n display: none;\n }\n }\n\n ${mq(\"xl\")} {\n width: 420px;\n }\n\n ${focusModeHide(\"right\")};\n`;\n\ninterface SidePanelProps {\n children?: React.ReactNode;\n}\n\nfunction SidePanel({ children }: SidePanelProps) {\n return (\n <StyledSidePanel aria-label=\"Page panel\" data-side-panel>\n {children}\n </StyledSidePanel>\n );\n}\n\nexport { SidePanel };\n";
@@ -0,0 +1,65 @@
1
+ import { CHAT_WIDTH, SIDEBAR_WIDTH } from "../../app/theme.js";
2
+ export const sidePanelTemplate = `"use client";
3
+ import React from "react";
4
+ import styled from "styled-components";
5
+ import { mq, Theme } from "@/app/theme";
6
+ import { focusModeHide } from "@/components/layout/SharedStyled";
7
+
8
+ // Below "lg" the panel stays in the document flow, rendering inline exactly
9
+ // where it sits in the MDX source. From "lg" up it is lifted out of the flow
10
+ // into the fixed right rail, at the ${SIDEBAR_WIDTH}px width the table of
11
+ // contents it replaces would have used - the content column already reserves
12
+ // exactly that much, so nothing has to move. Only from "xl", where there is
13
+ // room to spare, does it widen to the chat panel's ${CHAT_WIDTH}px and pull
14
+ // the other columns left with it (see sidePanelOffset, keyed off the data
15
+ // attribute below).
16
+ const StyledSidePanel = styled.aside<{ theme: Theme }>\`
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: 20px;
20
+ padding: 20px;
21
+ border-radius: \${({ theme }) => theme.spacing.radius.lg};
22
+ background: \${({ theme }) =>
23
+ \`color-mix(in srgb, \${theme.colors.primaryLight} 10%, transparent)\`};
24
+
25
+ \${mq("lg")} {
26
+ position: fixed;
27
+ top: 0;
28
+ right: 0;
29
+ z-index: 1;
30
+ width: ${SIDEBAR_WIDTH}px;
31
+ height: 100dvh;
32
+ overflow-y: auto;
33
+ gap: 15px;
34
+ padding: 82px 20px 20px 20px;
35
+ border-left: solid 1px \${({ theme }) => theme.colors.grayLight};
36
+ border-radius: 0;
37
+ background: \${({ theme }) => theme.colors.light};
38
+ -webkit-overflow-scrolling: touch;
39
+
40
+ &::-webkit-scrollbar {
41
+ display: none;
42
+ }
43
+ }
44
+
45
+ \${mq("xl")} {
46
+ width: ${CHAT_WIDTH}px;
47
+ }
48
+
49
+ \${focusModeHide("right")};
50
+ \`;
51
+
52
+ interface SidePanelProps {
53
+ children?: React.ReactNode;
54
+ }
55
+
56
+ function SidePanel({ children }: SidePanelProps) {
57
+ return (
58
+ <StyledSidePanel aria-label="Page panel" data-side-panel>
59
+ {children}
60
+ </StyledSidePanel>
61
+ );
62
+ }
63
+
64
+ export { SidePanel };
65
+ `;
@@ -1 +1 @@
1
- export declare const staticLinksTemplate = "\"use client\";\nimport styled, { css } from \"styled-components\";\nimport { useContext } from \"react\";\nimport { ChatContext } from \"@/components/Chat\";\nimport { mq, Theme } from \"@/app/theme\";\nimport { interactiveStyles } from \"@/components/layout/SharedStyled\";\nimport { Icon } from \"@/components/layout/Icon\";\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 StyledStaticLinks = styled.div<{ theme: Theme; $isChatOpen: boolean }>`\n display: flex;\n margin: 0 auto;\n transition: all 0.3s ease;\n padding: 0 20px;\n margin-bottom: 20px;\n\n ${mq(\"lg\")} {\n margin: 0;\n padding: 0 300px 20px 300px;\n\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 20px 300px;\n `}\n }\n`;\n\nconst StyledStaticLinksContent = styled.div`\n max-width: 640px;\n margin: auto 0;\n display: flex;\n gap: 16px;\n flex-wrap: wrap;\n width: 100%;\n margin: 0 auto;\n`;\n\nconst StyledLink = styled.a<{ theme: Theme; $hasIcon?: boolean }>`\n position: relative;\n text-decoration: none;\n font-size: ${({ theme }) => theme.fontSizes.small.lg};\n line-height: 1;\n color: ${({ theme }) => theme.colors.accent};\n padding: 0;\n display: flex;\n gap: 6px;\n transition: all 0.3s ease;\n font-weight: 600;\n white-space: nowrap;\n min-width: fit-content;\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 10%, transparent)`};\n padding: 6px 8px;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n ${interactiveStyles};\n\n ${({ $hasIcon }) =>\n $hasIcon &&\n css`\n padding-left: 30px;\n `}\n\n & * {\n margin: auto 0;\n }\n\n & svg {\n position: absolute;\n top: 50%;\n left: 8px;\n transform: translateY(-50%);\n }\n\n &:hover {\n color: ${({ theme }) => theme.colors.accent};\n }\n`;\n\nfunction StaticLinks() {\n const { isOpen } = useContext(ChatContext);\n\n if (links.length === 0) {\n return null;\n }\n\n return (\n <>\n <StyledStaticLinks $isChatOpen={isOpen}>\n <StyledStaticLinksContent>\n {links.map((link, index) => (\n <StyledLink\n key={index}\n href={link.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n $hasIcon={link.icon ? true : false}\n >\n {link.icon && <Icon name={link.icon} size={16} />}\n <span>{link.title}</span>\n </StyledLink>\n ))}\n </StyledStaticLinksContent>\n </StyledStaticLinks>\n </>\n );\n}\n\nexport { StaticLinks };\n";
1
+ export declare const staticLinksTemplate = "\"use client\";\nimport styled, { css } from \"styled-components\";\nimport { useContext } from \"react\";\nimport { ChatContext } from \"@/components/Chat\";\nimport { mq, Theme } from \"@/app/theme\";\nimport {\n focusModeColumn,\n interactiveStyles,\n sidePanelOffset,\n} from \"@/components/layout/SharedStyled\";\nimport { Icon } from \"@/components/layout/Icon\";\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 StyledStaticLinks = styled.div<{ theme: Theme; $isChatOpen: boolean }>`\n display: flex;\n margin: 0 auto;\n transition: all 0.3s ease;\n padding: 0 20px;\n margin-bottom: 20px;\n\n ${mq(\"lg\")} {\n margin: 0;\n padding: 0 300px 20px 300px;\n\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 20px 300px;\n `}\n }\n\n ${sidePanelOffset};\n ${({ $isChatOpen }) => !$isChatOpen && focusModeColumn};\n`;\n\nconst StyledStaticLinksContent = styled.div`\n max-width: 640px;\n margin: auto 0;\n display: flex;\n gap: 16px;\n flex-wrap: wrap;\n width: 100%;\n margin: 0 auto;\n`;\n\nconst StyledLink = styled.a<{ theme: Theme; $hasIcon?: boolean }>`\n position: relative;\n text-decoration: none;\n font-size: ${({ theme }) => theme.fontSizes.small.lg};\n line-height: 1;\n color: ${({ theme }) => theme.colors.accent};\n padding: 0;\n display: flex;\n gap: 6px;\n transition: all 0.3s ease;\n font-weight: 600;\n white-space: nowrap;\n min-width: fit-content;\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 10%, transparent)`};\n padding: 6px 8px;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n ${interactiveStyles};\n\n ${({ $hasIcon }) =>\n $hasIcon &&\n css`\n padding-left: 30px;\n `}\n\n & * {\n margin: auto 0;\n }\n\n & svg {\n position: absolute;\n top: 50%;\n left: 8px;\n transform: translateY(-50%);\n }\n\n &:hover {\n color: ${({ theme }) => theme.colors.accent};\n }\n`;\n\nfunction StaticLinks() {\n const { isOpen } = useContext(ChatContext);\n\n if (links.length === 0) {\n return null;\n }\n\n return (\n <>\n <StyledStaticLinks $isChatOpen={isOpen}>\n <StyledStaticLinksContent>\n {links.map((link, index) => (\n <StyledLink\n key={index}\n href={link.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n $hasIcon={link.icon ? true : false}\n >\n {link.icon && <Icon name={link.icon} size={16} />}\n <span>{link.title}</span>\n </StyledLink>\n ))}\n </StyledStaticLinksContent>\n </StyledStaticLinks>\n </>\n );\n}\n\nexport { StaticLinks };\n";
@@ -4,7 +4,11 @@ import styled, { css } from "styled-components";
4
4
  import { useContext } from "react";
5
5
  import { ChatContext } from "@/components/Chat";
6
6
  import { mq, Theme } from "@/app/theme";
7
- import { interactiveStyles } from "@/components/layout/SharedStyled";
7
+ import {
8
+ focusModeColumn,
9
+ interactiveStyles,
10
+ sidePanelOffset,
11
+ } from "@/components/layout/SharedStyled";
8
12
  import { Icon } from "@/components/layout/Icon";
9
13
  import linksData from "@/links.json";
10
14
 
@@ -33,6 +37,9 @@ const StyledStaticLinks = styled.div<{ theme: Theme; $isChatOpen: boolean }>\`
33
37
  padding: 0 ${CHAT_WIDTH + 20}px 20px ${SIDEBAR_WIDTH + 20}px;
34
38
  \`}
35
39
  }
40
+
41
+ \${sidePanelOffset};
42
+ \${({ $isChatOpen }) => !$isChatOpen && focusModeColumn};
36
43
  \`;
37
44
 
38
45
  const StyledStaticLinksContent = styled.div\`
@@ -1 +1 @@
1
- export declare const apiPlaygroundMdxTemplate = "---\ntitle: \"API Playground\"\ndescription: \"Turn an OpenAPI document into an interactive API reference where readers send real requests and see live responses, right inside your docs.\"\ndate: \"2026-07-25\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 19\n---\n# API Playground\n\nPoint Doccupine at an OpenAPI document and it generates a complete, interactive API reference: one page per endpoint, grouped by tag in the sidebar, each with a \"Send request\" panel that makes real calls and shows the live response - plus copy-pasteable code snippets.\n\n<Callout type=\"note\">\nThe playground is driven entirely by your OpenAPI document. There is nothing to wire up by hand - add one line of config and every endpoint becomes a documented, runnable page.\n</Callout>\n\n## Try it\n\nPress **Try it** below to open the playground, tweak the request body, and send a real request to a live API - right from these docs.\n\n<ApiPlaygroundDemo />\n\n## Enabling the playground\n\n<Steps>\n <Step title=\"Add an openapi path to doccupine.json.\">\n Point at a local `.json`, `.yaml`, or `.yml` OpenAPI 3.0 or 3.1 document.\n\n```json\n{\n \"watchDir\": \"docs\",\n \"outputDir\": \"nextjs-app\",\n \"openapi\": \"openapi.yaml\"\n}\n```\n </Step>\n <Step title=\"Run Doccupine.\">\n On the next build (or live, while watching) Doccupine parses the document, resolves every `$ref`, and writes an endpoint page for each operation.\n </Step>\n <Step title=\"Open the API Reference section.\">\n Endpoints appear in the sidebar grouped by their OpenAPI tag. Editing the spec regenerates the pages automatically.\n </Step>\n</Steps>\n\n## Example spec\n\nDo not have a document yet? This `openapi.yaml` points at [JSONPlaceholder](https://jsonplaceholder.typicode.com), a free public test API, so it works end to end - save it, set `openapi` to it, and the generated pages can send real requests:\n\n```yaml\nopenapi: 3.1.0\ninfo:\n title: JSONPlaceholder\n version: 1.0.0\nservers:\n - url: https://jsonplaceholder.typicode.com\ntags:\n - name: Todos\n - name: Posts\npaths:\n /todos/{id}:\n get:\n summary: Get a to-do\n tags: [Todos]\n parameters:\n - name: id\n in: path\n required: true\n schema:\n type: integer\n responses:\n \"200\":\n description: Just a demo of a to-do item\n /posts:\n post:\n summary: Create a post\n tags: [Posts]\n requestBody:\n required: true\n content:\n application/json:\n example:\n title: Hello\n body: Sent from the docs\n userId: 1\n responses:\n \"201\":\n description: Just a demo of the created post\n```\n\nEach part maps to something in the playground: `servers` sets the request target - and the only host the proxy will call - `tags` group endpoints in the sidebar, and `parameters` and `requestBody` become the inputs (adding a `securitySchemes` entry would produce authentication fields). Doccupine reads OpenAPI 3.0 and 3.1; see the [OpenAPI specification](https://spec.openapis.org) for the full format.\n\n## What gets generated\n\nEvery operation becomes its own page under `/api-reference/{tag}/{operation}`, showing:\n\n<Field value=\"Parameters\" type=\"path, query, header, cookie\">\nEach parameter is rendered with its name, type, and whether it is required, grouped into a collapsible section with an input to fill in.\n</Field>\n\n<Field value=\"Request body\" type=\"editable\">\nA JSON editor prefilled from the schema's example, ready to tweak and send.\n</Field>\n\n<Field value=\"Authentication\" type=\"from securitySchemes\">\nInputs for the endpoint's security schemes - API keys, bearer tokens, or basic auth - generated from the document.\n</Field>\n\n<Field value=\"Response\" type=\"live\">\nThe real status, timing, and body from your API, rendered to match its content type.\n</Field>\n\n## Embedding a single endpoint\n\nTo mix prose and a live endpoint on a hand-written page, reference an operation from the page's frontmatter with `openapi`. Use `METHOD /path` or an `operationId`:\n\n```mdx\n---\ntitle: \"Create a post\"\nopenapi: \"POST /posts\"\n---\n\nPosts are created for a user. The playground above is fully live - fill in the\nbody and send a real request.\n```\n\nDoccupine renders that endpoint's playground above your prose. If the reference does not match any operation in your document, the page still renders its prose and a warning is logged.\n\n## Running requests\n\nRequests run one of two ways, and readers can switch between them:\n\n<Callout type=\"note\">\n**Proxy (default).** The request is forwarded server-side, so it works even when the target API blocks cross-origin browser calls. **Direct.** The browser calls the API itself - useful when the API allows CORS and you want requests to never leave the reader's machine.\n</Callout>\n\nThe proxy is deliberately locked down. It only forwards to the servers declared in your OpenAPI document, refuses to reach private or internal network addresses, and never logs request URLs, headers, or bodies - so API keys a reader enters are not written anywhere.\n\n<Callout type=\"warning\">\nKeys and tokens a reader types are used only to make the request. Turn on \"Show secrets\" to reveal them in the generated code snippets; they are redacted by default.\n</Callout>\n\n## Responses and snippets\n\nResponses render to match their type: images and video play inline, everything else is shown as a formatted, syntax-highlighted body. Alongside the response, the playground generates ready-to-run **cURL**, **JavaScript**, and **Python** snippets for the exact request you built.\n\n## Documenting more than one API\n\nPass an array to document several APIs at once. Each spec becomes its own namespaced section:\n\n```json\n{\n \"openapi\": [\n { \"name\": \"public\", \"file\": \"specs/public.yaml\" },\n { \"name\": \"admin\", \"file\": \"specs/admin.yaml\" }\n ]\n}\n```\n";
1
+ export declare const apiPlaygroundMdxTemplate = "---\ntitle: \"API Playground\"\ndescription: \"Turn an OpenAPI document into an interactive API reference where readers send real requests and see live responses, right inside your docs.\"\ndate: \"2026-07-25\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 20\n---\n# API Playground\n\nPoint Doccupine at an OpenAPI document and it generates a complete, interactive API reference: one page per endpoint, grouped by tag in the sidebar, each with a \"Send request\" panel that makes real calls and shows the live response - plus copy-pasteable code snippets.\n\n<Callout type=\"note\">\nThe playground is driven entirely by your OpenAPI document. There is nothing to wire up by hand - add one line of config and every endpoint becomes a documented, runnable page.\n</Callout>\n\n## Try it\n\nPress **Try it** below to open the playground, tweak the request body, and send a real request to a live API - right from these docs.\n\n<ApiPlaygroundDemo />\n\n## Enabling the playground\n\n<Steps>\n <Step title=\"Add an openapi path to doccupine.json.\">\n Point at a local `.json`, `.yaml`, or `.yml` OpenAPI 3.0 or 3.1 document.\n\n```json\n{\n \"watchDir\": \"docs\",\n \"outputDir\": \"nextjs-app\",\n \"openapi\": \"openapi.yaml\"\n}\n```\n </Step>\n <Step title=\"Run Doccupine.\">\n On the next build (or live, while watching) Doccupine parses the document, resolves every `$ref`, and writes an endpoint page for each operation.\n </Step>\n <Step title=\"Open the API Reference section.\">\n Endpoints appear in the sidebar grouped by their OpenAPI tag. Editing the spec regenerates the pages automatically.\n </Step>\n</Steps>\n\n## Example spec\n\nDo not have a document yet? This `openapi.yaml` points at [JSONPlaceholder](https://jsonplaceholder.typicode.com), a free public test API, so it works end to end - save it, set `openapi` to it, and the generated pages can send real requests:\n\n```yaml\nopenapi: 3.1.0\ninfo:\n title: JSONPlaceholder\n version: 1.0.0\nservers:\n - url: https://jsonplaceholder.typicode.com\ntags:\n - name: Todos\n - name: Posts\npaths:\n /todos/{id}:\n get:\n summary: Get a to-do\n tags: [Todos]\n parameters:\n - name: id\n in: path\n required: true\n schema:\n type: integer\n responses:\n \"200\":\n description: Just a demo of a to-do item\n /posts:\n post:\n summary: Create a post\n tags: [Posts]\n requestBody:\n required: true\n content:\n application/json:\n example:\n title: Hello\n body: Sent from the docs\n userId: 1\n responses:\n \"201\":\n description: Just a demo of the created post\n```\n\nEach part maps to something in the playground: `servers` sets the request target - and the only host the proxy will call - `tags` group endpoints in the sidebar, and `parameters` and `requestBody` become the inputs (adding a `securitySchemes` entry would produce authentication fields). Doccupine reads OpenAPI 3.0 and 3.1; see the [OpenAPI specification](https://spec.openapis.org) for the full format.\n\n## What gets generated\n\nEvery operation becomes its own page under `/api-reference/{tag}/{operation}`, showing:\n\n<Field value=\"Parameters\" type=\"path, query, header, cookie\">\nEach parameter is rendered with its name, type, and whether it is required, grouped into a collapsible section with an input to fill in.\n</Field>\n\n<Field value=\"Request body\" type=\"editable\">\nA JSON editor prefilled from the schema's example, ready to tweak and send.\n</Field>\n\n<Field value=\"Authentication\" type=\"from securitySchemes\">\nInputs for the endpoint's security schemes - API keys, bearer tokens, or basic auth - generated from the document.\n</Field>\n\n<Field value=\"Response\" type=\"live\">\nThe real status, timing, and body from your API, rendered to match its content type.\n</Field>\n\n## Embedding a single endpoint\n\nTo mix prose and a live endpoint on a hand-written page, reference an operation from the page's frontmatter with `openapi`. Use `METHOD /path` or an `operationId`:\n\n```mdx\n---\ntitle: \"Create a post\"\nopenapi: \"POST /posts\"\n---\n\nPosts are created for a user. The playground above is fully live - fill in the\nbody and send a real request.\n```\n\nDoccupine renders that endpoint's playground above your prose. If the reference does not match any operation in your document, the page still renders its prose and a warning is logged.\n\n## Running requests\n\nRequests run one of two ways, and readers can switch between them:\n\n<Callout type=\"note\">\n**Proxy (default).** The request is forwarded server-side, so it works even when the target API blocks cross-origin browser calls. **Direct.** The browser calls the API itself - useful when the API allows CORS and you want requests to never leave the reader's machine.\n</Callout>\n\nThe proxy is deliberately locked down. It only forwards to the servers declared in your OpenAPI document, refuses to reach private or internal network addresses, and never logs request URLs, headers, or bodies - so API keys a reader enters are not written anywhere.\n\n<Callout type=\"warning\">\nKeys and tokens a reader types are used only to make the request. Turn on \"Show secrets\" to reveal them in the generated code snippets; they are redacted by default.\n</Callout>\n\n## Responses and snippets\n\nResponses render to match their type: images and video play inline, everything else is shown as a formatted, syntax-highlighted body. Alongside the response, the playground generates ready-to-run **cURL**, **JavaScript**, and **Python** snippets for the exact request you built.\n\n## Documenting more than one API\n\nPass an array to document several APIs at once. Each spec becomes its own namespaced section:\n\n```json\n{\n \"openapi\": [\n { \"name\": \"public\", \"file\": \"specs/public.yaml\" },\n { \"name\": \"admin\", \"file\": \"specs/admin.yaml\" }\n ]\n}\n```\n";
@@ -4,7 +4,7 @@ description: "Turn an OpenAPI document into an interactive API reference where r
4
4
  date: "2026-07-25"
5
5
  category: "Components"
6
6
  categoryOrder: 1
7
- order: 19
7
+ order: 20
8
8
  ---
9
9
  # API Playground
10
10
 
@@ -1 +1 @@
1
- export declare const badgesMdxTemplate = "---\ntitle: \"Badges\"\ndescription: \"Highlight statuses, version labels, and metadata inline with colored badges.\"\ndate: \"2026-07-27\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 12\n---\n# Badges\n\nHighlight statuses, version labels, and metadata with small colored badges - inline within text or standing on their own.\n\n## Basic badge\n\nYou can use the Badge component directly within your MDX files without any import:\n\n```html\n<Badge>Badge</Badge>\n```\n\n<Badge>Badge</Badge>\n\n## Colors\n\nThe `color` property selects one of eleven variants to convey different meanings:\n\n```html\n<Badge color=\"gray\">Badge</Badge>\n<Badge color=\"blue\">Badge</Badge>\n<Badge color=\"green\">Badge</Badge>\n<Badge color=\"yellow\">Badge</Badge>\n<Badge color=\"orange\">Badge</Badge>\n<Badge color=\"red\">Badge</Badge>\n<Badge color=\"purple\">Badge</Badge>\n<Badge color=\"white\">Badge</Badge>\n<Badge color=\"surface\">Badge</Badge>\n<Badge color=\"white-destructive\">Badge</Badge>\n<Badge color=\"surface-destructive\">Badge</Badge>\n```\n\n<Badge color=\"gray\">Badge</Badge>\n<Badge color=\"blue\">Badge</Badge>\n<Badge color=\"green\">Badge</Badge>\n<Badge color=\"yellow\">Badge</Badge>\n<Badge color=\"orange\">Badge</Badge>\n<Badge color=\"red\">Badge</Badge>\n<Badge color=\"purple\">Badge</Badge>\n<Badge color=\"white\">Badge</Badge>\n<Badge color=\"surface\">Badge</Badge>\n<Badge color=\"white-destructive\">Badge</Badge>\n<Badge color=\"surface-destructive\">Badge</Badge>\n\n## Sizes\n\nFour sizes match different content hierarchies:\n\n```html\n<Badge size=\"xs\">Badge</Badge>\n<Badge size=\"sm\">Badge</Badge>\n<Badge size=\"md\">Badge</Badge>\n<Badge size=\"lg\">Badge</Badge>\n```\n\n<Badge size=\"xs\">Badge</Badge>\n<Badge size=\"sm\">Badge</Badge>\n<Badge size=\"md\">Badge</Badge>\n<Badge size=\"lg\">Badge</Badge>\n\n## Shapes\n\nChoose between rounded corners and a pill shape:\n\n```html\n<Badge shape=\"rounded\">Badge</Badge>\n<Badge shape=\"pill\">Badge</Badge>\n```\n\n<Badge shape=\"rounded\">Badge</Badge>\n<Badge shape=\"pill\">Badge</Badge>\n\n## Icons\n\nAdd a [Lucide](https://lucide.dev/icons) icon (kebab-case name) for extra context. Unknown names render nothing, so a typo never breaks the page:\n\n```html\n<Badge icon=\"circle-check\" color=\"green\">Passing</Badge>\n<Badge icon=\"clock\" color=\"orange\">Pending</Badge>\n<Badge icon=\"ban\" color=\"red\">Blocked</Badge>\n```\n\n<Badge icon=\"circle-check\" color=\"green\">Passing</Badge>\n<Badge icon=\"clock\" color=\"orange\">Pending</Badge>\n<Badge icon=\"ban\" color=\"red\">Blocked</Badge>\n\n## Stroke variant\n\nSet `stroke` for an outline instead of a filled background:\n\n```html\n<Badge stroke color=\"blue\">Badge</Badge>\n<Badge stroke color=\"green\">Badge</Badge>\n<Badge stroke color=\"orange\">Badge</Badge>\n<Badge stroke color=\"red\">Badge</Badge>\n```\n\n<Badge stroke color=\"blue\">Badge</Badge>\n<Badge stroke color=\"green\">Badge</Badge>\n<Badge stroke color=\"orange\">Badge</Badge>\n<Badge stroke color=\"red\">Badge</Badge>\n\n## Solid variant\n\nSet `solid` for a strong filled background with contrasting text:\n\n```html\n<Badge solid color=\"blue\">Badge</Badge>\n<Badge solid color=\"green\">Badge</Badge>\n<Badge solid color=\"red\">Badge</Badge>\n<Badge solid color=\"purple\">Badge</Badge>\n```\n\n<Badge solid color=\"blue\">Badge</Badge>\n<Badge solid color=\"green\">Badge</Badge>\n<Badge solid color=\"red\">Badge</Badge>\n<Badge solid color=\"purple\">Badge</Badge>\n\n## Semantic colors\n\nThe `info`, `success`, `warning`, and `error` colors come from your theme rather than the fixed palette, so they follow your `theme.json` and the light/dark toggle. They support the same `stroke` and `solid` variations:\n\n```html\n<Badge color=\"info\">Badge</Badge>\n<Badge color=\"success\">Badge</Badge>\n<Badge color=\"warning\">Badge</Badge>\n<Badge color=\"error\">Badge</Badge>\n<Badge solid color=\"info\">Badge</Badge>\n<Badge solid color=\"success\">Badge</Badge>\n```\n\n<Badge color=\"info\">Badge</Badge>\n<Badge color=\"success\">Badge</Badge>\n<Badge color=\"warning\">Badge</Badge>\n<Badge color=\"error\">Badge</Badge>\n<Badge solid color=\"info\">Badge</Badge>\n<Badge solid color=\"success\">Badge</Badge>\n\n## HTTP method badges\n\nSet `mono` for a monospace, uppercase label. Combining `mono`, `solid`, and the semantic colors gives the method chips Doccupine itself uses in the sidebar navigation and the API playground:\n\n```html\n<Badge mono solid color=\"info\" size=\"sm\">GET</Badge>\n<Badge mono solid color=\"success\" size=\"sm\">POST</Badge>\n<Badge mono solid color=\"warning\" size=\"sm\">PUT</Badge>\n<Badge mono solid color=\"error\" size=\"sm\">DELETE</Badge>\n```\n\n<Badge mono solid color=\"info\" size=\"sm\">GET</Badge>\n<Badge mono solid color=\"success\" size=\"sm\">POST</Badge>\n<Badge mono solid color=\"warning\" size=\"sm\">PUT</Badge>\n<Badge mono solid color=\"error\" size=\"sm\">DELETE</Badge>\n\n## Disabled state\n\nSet `disabled` to indicate inactive or unavailable states with reduced opacity:\n\n```html\n<Badge disabled icon=\"lock\" color=\"gray\">Badge</Badge>\n<Badge disabled icon=\"lock\" color=\"blue\">Badge</Badge>\n```\n\n<Badge disabled icon=\"lock\" color=\"gray\">Badge</Badge>\n<Badge disabled icon=\"lock\" color=\"blue\">Badge</Badge>\n\n## Inline usage\n\nBadges flow naturally with the surrounding text. For example, this feature requires a <Badge color=\"orange\" size=\"sm\">Premium</Badge> subscription, and this endpoint returns <Badge color=\"green\" size=\"sm\">JSON</Badge>.\n\n```html\nThis feature requires a <Badge color=\"orange\" size=\"sm\">Premium</Badge> subscription.\n```\n\n## Combined properties\n\nAll properties compose freely:\n\n```html\n<Badge icon=\"star\" color=\"purple\" size=\"lg\" shape=\"pill\">Pro</Badge>\n<Badge icon=\"check\" stroke color=\"green\" size=\"sm\">Verified</Badge>\n<Badge icon=\"flask-conical\" color=\"blue\" shape=\"rounded\">Beta</Badge>\n```\n\n<Badge icon=\"star\" color=\"purple\" size=\"lg\" shape=\"pill\">Pro</Badge>\n<Badge icon=\"check\" stroke color=\"green\" size=\"sm\">Verified</Badge>\n<Badge icon=\"flask-conical\" color=\"blue\" shape=\"rounded\">Beta</Badge>\n\n## Properties\n\n<Field value=\"color\" type=\"string\">\n Badge color variant. Defaults to `gray`. Options: `gray`, `blue`, `green`, `yellow`, `orange`, `red`, `purple`, `white`, `surface`, `white-destructive`, `surface-destructive`, plus the theme-driven `info`, `success`, `warning`, and `error`.\n</Field>\n\n<Field value=\"size\" type=\"string\">\n Badge size. Defaults to `md`. Options: `xs`, `sm`, `md`, `lg`.\n</Field>\n\n<Field value=\"shape\" type=\"string\">\n Badge shape. Defaults to `rounded`. Options: `rounded`, `pill`.\n</Field>\n\n<Field value=\"icon\" type=\"string\">\n A [Lucide](https://lucide.dev/icons) icon name in kebab-case, displayed before the badge text.\n</Field>\n\n<Field value=\"stroke\" type=\"boolean\">\n Display the badge with an outline instead of a filled background. Defaults to `false`.\n</Field>\n\n<Field value=\"solid\" type=\"boolean\">\n Display the badge with a strong filled background and contrasting text. Takes precedence over `stroke`. Defaults to `false`.\n</Field>\n\n<Field value=\"mono\" type=\"boolean\">\n Render the label in monospace uppercase, for code-like labels such as HTTP methods. Defaults to `false`.\n</Field>\n\n<Field value=\"disabled\" type=\"boolean\">\n Display the badge in a disabled state with reduced opacity. Defaults to `false`.\n</Field>\n\n<Field value=\"className\" type=\"string\">\n Additional CSS classes to apply to the badge.\n</Field>\n\n<Field value=\"children\" type=\"node\" required>\n The badge label.\n</Field>";
1
+ export declare const badgesMdxTemplate = "---\ntitle: \"Badges\"\ndescription: \"Highlight statuses, version labels, and metadata inline with colored badges.\"\ndate: \"2026-07-27\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 12\n---\n# Badges\n\nHighlight statuses, version labels, and metadata with small colored badges - inline within text or standing on their own.\n\n## Basic badge\n\nYou can use the Badge component directly within your MDX files without any import:\n\n```html\n<Badge>Badge</Badge>\n```\n\n<Badge>Badge</Badge>\n\n## Colors\n\nThe `color` property selects one of eleven variants to convey different meanings:\n\n```html\n<Badge color=\"gray\">Badge</Badge>\n<Badge color=\"blue\">Badge</Badge>\n<Badge color=\"green\">Badge</Badge>\n<Badge color=\"yellow\">Badge</Badge>\n<Badge color=\"orange\">Badge</Badge>\n<Badge color=\"red\">Badge</Badge>\n<Badge color=\"purple\">Badge</Badge>\n<Badge color=\"white\">Badge</Badge>\n<Badge color=\"surface\">Badge</Badge>\n<Badge color=\"white-destructive\">Badge</Badge>\n<Badge color=\"surface-destructive\">Badge</Badge>\n```\n\n<Badge color=\"gray\">Badge</Badge>\n<Badge color=\"blue\">Badge</Badge>\n<Badge color=\"green\">Badge</Badge>\n<Badge color=\"yellow\">Badge</Badge>\n<Badge color=\"orange\">Badge</Badge>\n<Badge color=\"red\">Badge</Badge>\n<Badge color=\"purple\">Badge</Badge>\n<Badge color=\"white\">Badge</Badge>\n<Badge color=\"surface\">Badge</Badge>\n<Badge color=\"white-destructive\">Badge</Badge>\n<Badge color=\"surface-destructive\">Badge</Badge>\n\nThe `white` and `white-destructive` badges stay literally white in both light and dark mode, which keeps them legible on top of images, colored frames, and hero areas. Their `surface` counterparts follow the active theme instead - white on light pages, dark on dark ones - so reach for those when the badge sits in regular page content.\n\n## Sizes\n\nFour sizes match different content hierarchies:\n\n```html\n<Badge size=\"xs\">Badge</Badge>\n<Badge size=\"sm\">Badge</Badge>\n<Badge size=\"md\">Badge</Badge>\n<Badge size=\"lg\">Badge</Badge>\n```\n\n<Badge size=\"xs\">Badge</Badge>\n<Badge size=\"sm\">Badge</Badge>\n<Badge size=\"md\">Badge</Badge>\n<Badge size=\"lg\">Badge</Badge>\n\n## Shapes\n\nChoose between rounded corners and a pill shape:\n\n```html\n<Badge shape=\"rounded\">Badge</Badge>\n<Badge shape=\"pill\">Badge</Badge>\n```\n\n<Badge shape=\"rounded\">Badge</Badge>\n<Badge shape=\"pill\">Badge</Badge>\n\n## Icons\n\nAdd a [Lucide](https://lucide.dev/icons) icon (kebab-case name) for extra context. Unknown names render nothing, so a typo never breaks the page:\n\n```html\n<Badge icon=\"circle-check\" color=\"green\">Passing</Badge>\n<Badge icon=\"clock\" color=\"orange\">Pending</Badge>\n<Badge icon=\"ban\" color=\"red\">Blocked</Badge>\n```\n\n<Badge icon=\"circle-check\" color=\"green\">Passing</Badge>\n<Badge icon=\"clock\" color=\"orange\">Pending</Badge>\n<Badge icon=\"ban\" color=\"red\">Blocked</Badge>\n\n## Stroke variant\n\nSet `stroke` for an outline instead of a filled background:\n\n```html\n<Badge stroke color=\"blue\">Badge</Badge>\n<Badge stroke color=\"green\">Badge</Badge>\n<Badge stroke color=\"orange\">Badge</Badge>\n<Badge stroke color=\"red\">Badge</Badge>\n```\n\n<Badge stroke color=\"blue\">Badge</Badge>\n<Badge stroke color=\"green\">Badge</Badge>\n<Badge stroke color=\"orange\">Badge</Badge>\n<Badge stroke color=\"red\">Badge</Badge>\n\n## Solid variant\n\nSet `solid` for a strong filled background with contrasting text:\n\n```html\n<Badge solid color=\"blue\">Badge</Badge>\n<Badge solid color=\"green\">Badge</Badge>\n<Badge solid color=\"red\">Badge</Badge>\n<Badge solid color=\"purple\">Badge</Badge>\n```\n\n<Badge solid color=\"blue\">Badge</Badge>\n<Badge solid color=\"green\">Badge</Badge>\n<Badge solid color=\"red\">Badge</Badge>\n<Badge solid color=\"purple\">Badge</Badge>\n\n## Semantic colors\n\nThe `info`, `success`, `warning`, and `error` colors come from your theme rather than the fixed palette, so they follow your `theme.json` and the light/dark toggle. They support the same `stroke` and `solid` variations:\n\n```html\n<Badge color=\"info\">Badge</Badge>\n<Badge color=\"success\">Badge</Badge>\n<Badge color=\"warning\">Badge</Badge>\n<Badge color=\"error\">Badge</Badge>\n<Badge solid color=\"info\">Badge</Badge>\n<Badge solid color=\"success\">Badge</Badge>\n```\n\n<Badge color=\"info\">Badge</Badge>\n<Badge color=\"success\">Badge</Badge>\n<Badge color=\"warning\">Badge</Badge>\n<Badge color=\"error\">Badge</Badge>\n<Badge solid color=\"info\">Badge</Badge>\n<Badge solid color=\"success\">Badge</Badge>\n\n## HTTP method badges\n\nSet `mono` for a monospace, uppercase label. Combining `mono`, `solid`, and the semantic colors gives the method chips Doccupine itself uses in the sidebar navigation and the API playground:\n\n```html\n<Badge mono solid color=\"info\" size=\"sm\">GET</Badge>\n<Badge mono solid color=\"success\" size=\"sm\">POST</Badge>\n<Badge mono solid color=\"warning\" size=\"sm\">PUT</Badge>\n<Badge mono solid color=\"error\" size=\"sm\">DELETE</Badge>\n```\n\n<Badge mono solid color=\"info\" size=\"sm\">GET</Badge>\n<Badge mono solid color=\"success\" size=\"sm\">POST</Badge>\n<Badge mono solid color=\"warning\" size=\"sm\">PUT</Badge>\n<Badge mono solid color=\"error\" size=\"sm\">DELETE</Badge>\n\n## Disabled state\n\nSet `disabled` to indicate inactive or unavailable states with reduced opacity:\n\n```html\n<Badge disabled icon=\"lock\" color=\"gray\">Badge</Badge>\n<Badge disabled icon=\"lock\" color=\"blue\">Badge</Badge>\n```\n\n<Badge disabled icon=\"lock\" color=\"gray\">Badge</Badge>\n<Badge disabled icon=\"lock\" color=\"blue\">Badge</Badge>\n\n## Inline usage\n\nBadges flow naturally with the surrounding text. For example, this feature requires a <Badge color=\"orange\" size=\"sm\">Premium</Badge> subscription, and this endpoint returns <Badge color=\"green\" size=\"sm\">JSON</Badge>.\n\n```html\nThis feature requires a <Badge color=\"orange\" size=\"sm\">Premium</Badge> subscription.\n```\n\n## Combined properties\n\nAll properties compose freely:\n\n```html\n<Badge icon=\"star\" color=\"purple\" size=\"lg\" shape=\"pill\">Pro</Badge>\n<Badge icon=\"check\" stroke color=\"green\" size=\"sm\">Verified</Badge>\n<Badge icon=\"flask-conical\" color=\"blue\" shape=\"rounded\">Beta</Badge>\n```\n\n<Badge icon=\"star\" color=\"purple\" size=\"lg\" shape=\"pill\">Pro</Badge>\n<Badge icon=\"check\" stroke color=\"green\" size=\"sm\">Verified</Badge>\n<Badge icon=\"flask-conical\" color=\"blue\" shape=\"rounded\">Beta</Badge>\n\n## Properties\n\n<Field value=\"color\" type=\"string\">\n Badge color variant. Defaults to `gray`. Options: `gray`, `blue`, `green`, `yellow`, `orange`, `red`, `purple`, `white`, `surface`, `white-destructive`, `surface-destructive`, plus the theme-driven `info`, `success`, `warning`, and `error`.\n</Field>\n\n<Field value=\"size\" type=\"string\">\n Badge size. Defaults to `md`. Options: `xs`, `sm`, `md`, `lg`.\n</Field>\n\n<Field value=\"shape\" type=\"string\">\n Badge shape. Defaults to `rounded`. Options: `rounded`, `pill`.\n</Field>\n\n<Field value=\"icon\" type=\"string\">\n A [Lucide](https://lucide.dev/icons) icon name in kebab-case, displayed before the badge text.\n</Field>\n\n<Field value=\"stroke\" type=\"boolean\">\n Display the badge with an outline instead of a filled background. Defaults to `false`.\n</Field>\n\n<Field value=\"solid\" type=\"boolean\">\n Display the badge with a strong filled background and contrasting text. Takes precedence over `stroke`. Defaults to `false`.\n</Field>\n\n<Field value=\"mono\" type=\"boolean\">\n Render the label in monospace uppercase, for code-like labels such as HTTP methods. Defaults to `false`.\n</Field>\n\n<Field value=\"disabled\" type=\"boolean\">\n Display the badge in a disabled state with reduced opacity. Defaults to `false`.\n</Field>\n\n<Field value=\"className\" type=\"string\">\n Additional CSS classes to apply to the badge.\n</Field>\n\n<Field value=\"children\" type=\"node\" required>\n The badge label.\n</Field>";
@@ -50,6 +50,8 @@ The \`color\` property selects one of eleven variants to convey different meanin
50
50
  <Badge color="white-destructive">Badge</Badge>
51
51
  <Badge color="surface-destructive">Badge</Badge>
52
52
 
53
+ The \`white\` and \`white-destructive\` badges stay literally white in both light and dark mode, which keeps them legible on top of images, colored frames, and hero areas. Their \`surface\` counterparts follow the active theme instead - white on light pages, dark on dark ones - so reach for those when the badge sits in regular page content.
54
+
53
55
  ## Sizes
54
56
 
55
57
  Four sizes match different content hierarchies:
@@ -1 +1 @@
1
- export declare const colorSwatchesMdxTemplate = "---\ntitle: \"Color Swatches\"\ndescription: \"Display color palettes with labeled swatches to document your theme colors.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 21\n---\n# Color Swatches\n\nDisplay color palettes with labeled swatches to document your theme colors.\n\nThe `ColorSwatch` component renders a visual preview of a color alongside its token name, and `ColorSwatchGroup` arranges multiple swatches in a responsive grid.\n\n## Usage\n\nYou can use the ColorSwatch components directly within your MDX files without any import:\n\n```html\n<ColorSwatchGroup>\n <ColorSwatch token=\"primary\" value=\"#6366F1\" />\n <ColorSwatch token=\"secondary\" value=\"#EC4899\" />\n <ColorSwatch token=\"success\" value=\"#10B981\" />\n <ColorSwatch token=\"warning\" value=\"#F59E0B\" />\n <ColorSwatch token=\"danger\" value=\"#EF4444\" />\n <ColorSwatch token=\"info\" value=\"#3B82F6\" />\n</ColorSwatchGroup>\n```\n\n<ColorSwatchGroup>\n <ColorSwatch token=\"primary\" value=\"#6366F1\" />\n <ColorSwatch token=\"secondary\" value=\"#EC4899\" />\n <ColorSwatch token=\"success\" value=\"#10B981\" />\n <ColorSwatch token=\"warning\" value=\"#F59E0B\" />\n <ColorSwatch token=\"danger\" value=\"#EF4444\" />\n <ColorSwatch token=\"info\" value=\"#3B82F6\" />\n</ColorSwatchGroup>\n\n## Dark Colors\n\nText color automatically adapts based on the background luminance, so dark swatches display white text:\n\n```html\n<ColorSwatchGroup>\n <ColorSwatch token=\"dark\" value=\"#1E1E2E\" />\n <ColorSwatch token=\"grayDark\" value=\"#374151\" />\n <ColorSwatch token=\"gray\" value=\"#6B7280\" />\n <ColorSwatch token=\"grayLight\" value=\"#D1D5DB\" />\n <ColorSwatch token=\"light\" value=\"#F9FAFB\" />\n <ColorSwatch token=\"white\" value=\"#FFFFFF\" />\n</ColorSwatchGroup>\n```\n\n<ColorSwatchGroup>\n <ColorSwatch token=\"dark\" value=\"#1E1E2E\" />\n <ColorSwatch token=\"grayDark\" value=\"#374151\" />\n <ColorSwatch token=\"gray\" value=\"#6B7280\" />\n <ColorSwatch token=\"grayLight\" value=\"#D1D5DB\" />\n <ColorSwatch token=\"light\" value=\"#F9FAFB\" />\n <ColorSwatch token=\"white\" value=\"#FFFFFF\" />\n</ColorSwatchGroup>\n\n## ColorSwatch Properties\n\n<Field value=\"token\" type=\"string\" required>\n The name or label displayed below the color preview (e.g. a design token name).\n</Field>\n\n<Field value=\"value\" type=\"string\" required>\n A hex color value (e.g. `#6366F1`). Displayed inside the color preview and used as the background.\n</Field>\n\n## ColorSwatchGroup Properties\n\n<Field value=\"children\" type=\"node\" required>\n One or more `ColorSwatch` components to display in a responsive grid.\n</Field>";
1
+ export declare const colorSwatchesMdxTemplate = "---\ntitle: \"Color Swatches\"\ndescription: \"Display color palettes with labeled swatches to document your theme colors.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 22\n---\n# Color Swatches\n\nDisplay color palettes with labeled swatches to document your theme colors.\n\nThe `ColorSwatch` component renders a visual preview of a color alongside its token name, and `ColorSwatchGroup` arranges multiple swatches in a responsive grid.\n\n## Usage\n\nYou can use the ColorSwatch components directly within your MDX files without any import:\n\n```html\n<ColorSwatchGroup>\n <ColorSwatch token=\"primary\" value=\"#6366F1\" />\n <ColorSwatch token=\"secondary\" value=\"#EC4899\" />\n <ColorSwatch token=\"success\" value=\"#10B981\" />\n <ColorSwatch token=\"warning\" value=\"#F59E0B\" />\n <ColorSwatch token=\"danger\" value=\"#EF4444\" />\n <ColorSwatch token=\"info\" value=\"#3B82F6\" />\n</ColorSwatchGroup>\n```\n\n<ColorSwatchGroup>\n <ColorSwatch token=\"primary\" value=\"#6366F1\" />\n <ColorSwatch token=\"secondary\" value=\"#EC4899\" />\n <ColorSwatch token=\"success\" value=\"#10B981\" />\n <ColorSwatch token=\"warning\" value=\"#F59E0B\" />\n <ColorSwatch token=\"danger\" value=\"#EF4444\" />\n <ColorSwatch token=\"info\" value=\"#3B82F6\" />\n</ColorSwatchGroup>\n\n## Dark Colors\n\nText color automatically adapts based on the background luminance, so dark swatches display white text:\n\n```html\n<ColorSwatchGroup>\n <ColorSwatch token=\"dark\" value=\"#1E1E2E\" />\n <ColorSwatch token=\"grayDark\" value=\"#374151\" />\n <ColorSwatch token=\"gray\" value=\"#6B7280\" />\n <ColorSwatch token=\"grayLight\" value=\"#D1D5DB\" />\n <ColorSwatch token=\"light\" value=\"#F9FAFB\" />\n <ColorSwatch token=\"white\" value=\"#FFFFFF\" />\n</ColorSwatchGroup>\n```\n\n<ColorSwatchGroup>\n <ColorSwatch token=\"dark\" value=\"#1E1E2E\" />\n <ColorSwatch token=\"grayDark\" value=\"#374151\" />\n <ColorSwatch token=\"gray\" value=\"#6B7280\" />\n <ColorSwatch token=\"grayLight\" value=\"#D1D5DB\" />\n <ColorSwatch token=\"light\" value=\"#F9FAFB\" />\n <ColorSwatch token=\"white\" value=\"#FFFFFF\" />\n</ColorSwatchGroup>\n\n## ColorSwatch Properties\n\n<Field value=\"token\" type=\"string\" required>\n The name or label displayed below the color preview (e.g. a design token name).\n</Field>\n\n<Field value=\"value\" type=\"string\" required>\n A hex color value (e.g. `#6366F1`). Displayed inside the color preview and used as the background.\n</Field>\n\n## ColorSwatchGroup Properties\n\n<Field value=\"children\" type=\"node\" required>\n One or more `ColorSwatch` components to display in a responsive grid.\n</Field>";
@@ -4,7 +4,7 @@ description: "Display color palettes with labeled swatches to document your them
4
4
  date: "2026-02-19"
5
5
  category: "Components"
6
6
  categoryOrder: 1
7
- order: 21
7
+ order: 22
8
8
  ---
9
9
  # Color Swatches
10
10
 
@@ -1 +1 @@
1
- export declare const componentsMdxTemplate = "---\ntitle: \"Components\"\ndescription: \"Explore the full library of built-in components available in your documentation pages.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\ncategoryIcon: \"blocks\"\norder: 0\n---\n# Components\n\nDoccupine includes a rich set of built-in components you can use directly in your MDX files - no imports needed. Browse the full library below.\n\n<Columns cols={2}>\n <Card title=\"Headers and Text\" icon=\"heading\" href=\"/headers-and-text\">\n Headings, paragraphs, bold, italic, links, and other text formatting.\n </Card>\n <Card title=\"Lists and Tables\" icon=\"list\" href=\"/lists-and-tables\">\n Ordered lists, unordered lists, and data tables.\n </Card>\n <Card title=\"Code\" icon=\"code\" href=\"/code\">\n Inline code, fenced code blocks, and syntax highlighting.\n </Card>\n <Card title=\"Prompt\" icon=\"sparkles\" href=\"/prompt\">\n Pre-built AI prompts readers can copy or open in Cursor.\n </Card>\n <Card title=\"Callouts\" icon=\"megaphone\" href=\"/callouts\">\n Highlighted blocks for tips, warnings, and important notes.\n </Card>\n <Card title=\"Accordion\" icon=\"chevrons-down\" href=\"/accordion\">\n Collapsible sections for organizing lengthy content.\n </Card>\n <Card title=\"Tabs\" icon=\"panel-top\" href=\"/tabs\">\n Tabbed interfaces for grouping related content.\n </Card>\n <Card title=\"Steps\" icon=\"footprints\" href=\"/steps\">\n Numbered step-by-step guides and walkthroughs.\n </Card>\n <Card title=\"Tree\" icon=\"folder-tree\" href=\"/tree\">\n File and folder structures with collapsible nodes and keyboard navigation.\n </Card>\n <Card title=\"Cards\" icon=\"square\" href=\"/cards\">\n Visual containers for content, icons, and links.\n </Card>\n <Card title=\"Buttons\" icon=\"mouse-pointer-click\" href=\"/buttons\">\n Action components with variants, sizes, and icons.\n </Card>\n <Card title=\"Badges\" icon=\"tag\" href=\"/badges\">\n Colored labels for statuses, versions, and metadata.\n </Card>\n <Card title=\"Tooltips\" icon=\"message-square\" href=\"/tooltips\">\n Contextual definitions and explanations shown on hover.\n </Card>\n <Card title=\"Images and Embeds\" icon=\"image\" href=\"/images-and-embeds\">\n Images, videos, and embedded content.\n </Card>\n <Card title=\"Frames\" icon=\"frame\" href=\"/frames\">\n Bordered containers with captions for images, videos, and diagrams.\n </Card>\n <Card title=\"Icons\" icon=\"smile\" href=\"/icons\">\n Lucide icons you can use anywhere in your docs.\n </Card>\n <Card title=\"Columns\" icon=\"columns-3\" href=\"/columns\">\n Grid layouts for arranging cards and content side by side.\n </Card>\n <Card title=\"Fields\" icon=\"text-cursor-input\" href=\"/fields\">\n Property and parameter documentation blocks.\n </Card>\n <Card title=\"API Playground\" icon=\"square-terminal\" href=\"/api-playground\">\n Interactive API reference where readers send real requests and see live responses.\n </Card>\n <Card title=\"Update\" icon=\"bell\" href=\"/update\">\n Changelog blocks with a subscribable RSS feed.\n </Card>\n <Card title=\"Color Swatches\" icon=\"palette\" href=\"/color-swatches\">\n Visual color palette swatches to document your theme colors.\n </Card>\n <Card title=\"Mermaid\" icon=\"workflow\" href=\"/mermaid\">\n Flowcharts, sequence diagrams, and other visualizations from Mermaid syntax.\n </Card>\n</Columns>";
1
+ export declare const componentsMdxTemplate = "---\ntitle: \"Components\"\ndescription: \"Explore the full library of built-in components available in your documentation pages.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\ncategoryIcon: \"blocks\"\norder: 0\n---\n# Components\n\nDoccupine includes a rich set of built-in components you can use directly in your MDX files - no imports needed. Browse the full library below.\n\n<Columns cols={2}>\n <Card title=\"Headers and Text\" icon=\"heading\" href=\"/headers-and-text\">\n Headings, paragraphs, bold, italic, links, and other text formatting.\n </Card>\n <Card title=\"Lists and Tables\" icon=\"list\" href=\"/lists-and-tables\">\n Ordered lists, unordered lists, and data tables.\n </Card>\n <Card title=\"Code\" icon=\"code\" href=\"/code\">\n Inline code, fenced code blocks, and syntax highlighting.\n </Card>\n <Card title=\"Prompt\" icon=\"sparkles\" href=\"/prompt\">\n Pre-built AI prompts readers can copy or open in Cursor.\n </Card>\n <Card title=\"Callouts\" icon=\"megaphone\" href=\"/callouts\">\n Highlighted blocks for tips, warnings, and important notes.\n </Card>\n <Card title=\"Accordion\" icon=\"chevrons-down\" href=\"/accordion\">\n Collapsible sections for organizing lengthy content.\n </Card>\n <Card title=\"Tabs\" icon=\"panel-top\" href=\"/tabs\">\n Tabbed interfaces for grouping related content.\n </Card>\n <Card title=\"Steps\" icon=\"footprints\" href=\"/steps\">\n Numbered step-by-step guides and walkthroughs.\n </Card>\n <Card title=\"Tree\" icon=\"folder-tree\" href=\"/tree\">\n File and folder structures with collapsible nodes and keyboard navigation.\n </Card>\n <Card title=\"Cards\" icon=\"square\" href=\"/cards\">\n Visual containers for content, icons, and links.\n </Card>\n <Card title=\"Buttons\" icon=\"mouse-pointer-click\" href=\"/buttons\">\n Action components with variants, sizes, and icons.\n </Card>\n <Card title=\"Badges\" icon=\"tag\" href=\"/badges\">\n Colored labels for statuses, versions, and metadata.\n </Card>\n <Card title=\"Tooltips\" icon=\"message-square\" href=\"/tooltips\">\n Contextual definitions and explanations shown on hover.\n </Card>\n <Card title=\"Images and Embeds\" icon=\"image\" href=\"/images-and-embeds\">\n Images, videos, and embedded content.\n </Card>\n <Card title=\"Frames\" icon=\"frame\" href=\"/frames\">\n Bordered containers with captions for images, videos, and diagrams.\n </Card>\n <Card title=\"Icons\" icon=\"smile\" href=\"/icons\">\n Lucide icons you can use anywhere in your docs.\n </Card>\n <Card title=\"Columns\" icon=\"columns-3\" href=\"/columns\">\n Grid layouts for arranging cards and content side by side.\n </Card>\n <Card title=\"Side Panel\" icon=\"panel-right\" href=\"/side-panel\">\n Pinned right-rail content that replaces a page's table of contents.\n </Card>\n <Card title=\"Fields\" icon=\"text-cursor-input\" href=\"/fields\">\n Property and parameter documentation blocks.\n </Card>\n <Card title=\"API Playground\" icon=\"square-terminal\" href=\"/api-playground\">\n Interactive API reference where readers send real requests and see live responses.\n </Card>\n <Card title=\"Update\" icon=\"bell\" href=\"/update\">\n Changelog blocks with a subscribable RSS feed.\n </Card>\n <Card title=\"Color Swatches\" icon=\"palette\" href=\"/color-swatches\">\n Visual color palette swatches to document your theme colors.\n </Card>\n <Card title=\"Mermaid\" icon=\"workflow\" href=\"/mermaid\">\n Flowcharts, sequence diagrams, and other visualizations from Mermaid syntax.\n </Card>\n</Columns>";
@@ -63,6 +63,9 @@ Doccupine includes a rich set of built-in components you can use directly in you
63
63
  <Card title="Columns" icon="columns-3" href="/columns">
64
64
  Grid layouts for arranging cards and content side by side.
65
65
  </Card>
66
+ <Card title="Side Panel" icon="panel-right" href="/side-panel">
67
+ Pinned right-rail content that replaces a page's table of contents.
68
+ </Card>
66
69
  <Card title="Fields" icon="text-cursor-input" href="/fields">
67
70
  Property and parameter documentation blocks.
68
71
  </Card>
@@ -1 +1 @@
1
- export declare const fieldsMdxTemplate = "---\ntitle: \"Fields\"\ndescription: \"Configure parameters for your API or SDK documentation.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 18\n---\n# Fields\n\nConfigure parameters for your API or SDK documentation.\n\nFields allow you to describe both the **inputs** (parameters) and **outputs** (responses) of your API. The main field component is available: `Field` for parameters and for responses.\n\n## Fields Usage\n\nUse the `<Field>` component to declare API or SDK parameters, or define the return values of an API.\n\n<Field value=\"param\" type=\"string\" required>\n Example definition of a parameter field.\n</Field>\n\n```html\n<Field value=\"param\" type=\"string\" required>\n Example definition of a parameter field.\n</Field>\n```\n\n## Properties\n\n<Field value=\"value\" type=\"string\" required>\n The name of the field.\n</Field>\n\n<Field value=\"type\" type=\"string\" required>\n The type of the field.\n</Field>\n\n<Field value=\"required\" type=\"boolean\">\n Whether the field is required.\n</Field>";
1
+ export declare const fieldsMdxTemplate = "---\ntitle: \"Fields\"\ndescription: \"Configure parameters for your API or SDK documentation.\"\ndate: \"2026-02-19\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 19\n---\n# Fields\n\nConfigure parameters for your API or SDK documentation.\n\nFields allow you to describe both the **inputs** (parameters) and **outputs** (responses) of your API. The main field component is available: `Field` for parameters and for responses.\n\n## Fields Usage\n\nUse the `<Field>` component to declare API or SDK parameters, or define the return values of an API.\n\n<Field value=\"param\" type=\"string\" required>\n Example definition of a parameter field.\n</Field>\n\n```html\n<Field value=\"param\" type=\"string\" required>\n Example definition of a parameter field.\n</Field>\n```\n\n## Properties\n\n<Field value=\"value\" type=\"string\" required>\n The name of the field.\n</Field>\n\n<Field value=\"type\" type=\"string\" required>\n The type of the field.\n</Field>\n\n<Field value=\"required\" type=\"boolean\">\n Whether the field is required.\n</Field>";
@@ -4,7 +4,7 @@ description: "Configure parameters for your API or SDK documentation."
4
4
  date: "2026-02-19"
5
5
  category: "Components"
6
6
  categoryOrder: 1
7
- order: 18
7
+ order: 19
8
8
  ---
9
9
  # Fields
10
10
 
@@ -1 +1 @@
1
- export declare const mermaidMdxTemplate = "---\ntitle: \"Mermaid\"\ndescription: \"Create flowcharts, sequence diagrams, and other visualizations using Mermaid syntax.\"\ndate: \"2026-07-16\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 22\n---\n# Mermaid\n\nCreate flowcharts, sequence diagrams, and other visualizations using Mermaid syntax with automatic rendering.\n\nWrite a diagram inside a `mermaid` code fence and it renders as an SVG:\n\n````mdx\n```mermaid\nflowchart LR\n A[Start] --> B{Decision}\n B -->|Yes| C[Action]\n B -->|No| D[End]\n```\n````\n\n```mermaid\nflowchart LR\n A[Start] --> B{Decision}\n B -->|Yes| C[Action]\n B -->|No| D[End]\n```\n\nDiagrams are rendered when your site is built, so no diagramming library is shipped to your readers' browsers. They are drawn with your theme's colors and follow the light and dark toggle automatically.\n\n## Supported diagram types\n\nDoccupine renders diagrams with [beautiful-mermaid](https://github.com/lukilabs/beautiful-mermaid), which supports six diagram types:\n\n| Type | Opening keyword |\n| --- | --- |\n| Flowchart | `flowchart` or `graph` |\n| Sequence | `sequenceDiagram` |\n| State | `stateDiagram-v2` |\n| Class | `classDiagram` |\n| Entity relationship | `erDiagram` |\n| XY chart | `xychart-beta` |\n\nOther Mermaid diagram types - including `pie`, `gantt`, `mindmap`, `journey`, and `gitGraph` - are not supported. A diagram that cannot be rendered falls back to a plain code block showing its source, and the reason is logged when your site builds. A broken diagram never breaks the page.\n\n## Examples\n\n### Sequence diagram\n\n```mermaid\nsequenceDiagram\n participant Reader\n participant Docs\n participant Search\n Reader->>Docs: Open a page\n Docs->>Search: Index the content\n Search-->>Reader: Return results\n```\n\n### Subgraphs\n\n```mermaid placement=\"top-right\"\nflowchart LR\n subgraph one\n direction TB\n top1[top] --> bottom1[bottom]\n end\n subgraph two\n direction TB\n top2[top] --> bottom2[bottom]\n end\n outside --> one\n outside --> top2\n```\n\n## Interactive controls\n\nDiagrams include zoom in and out, pan in four directions, reset the view, and full screen. You can also drag a diagram with your mouse to move it around.\n\nBy default the controls appear once a diagram is taller than 120px, since a diagram that already fits does not need them. Use the `actions` property to decide explicitly. Setting `actions={false}` turns off the whole interactive layer, including dragging.\n\n## Properties\n\n<Field value=\"placement\" type=\"string\">\n Where the controls sit. One of `top-left`, `top-right`, `bottom-left`, or `bottom-right`. Defaults to `bottom-right`.\n</Field>\n\n<Field value=\"actions\" type=\"boolean\">\n Show or hide the controls. When set, this overrides the default behavior of showing them only on diagrams taller than 120px.\n</Field>\n\nSet properties on the opening fence, after the language:\n\n````mdx\n```mermaid placement=\"top-left\" actions={true}\nflowchart LR\n A --> B\n```\n````\n\nTo hide the controls entirely:\n\n````mdx\n```mermaid actions={false}\nflowchart LR\n A --> B\n```\n````\n\n```mermaid actions={false}\nflowchart LR\n A --> B\n```\n\n## Layout\n\nDiagrams are laid out with the [ELK](https://eclipse.dev/elk/) engine, which arranges nodes to reduce overlapping edges and keep large diagrams readable. It is always on, so no directive is needed to enable it.\n\nIf you are porting diagrams from another tool, a `%%{init: ...}%%` directive is read as a comment and ignored rather than causing an error.\n\n## Theming\n\nDiagram colors come from CSS variables, so they follow your theme and the light/dark toggle without re-rendering. Override any of them in your own CSS to restyle diagrams:\n\n```css\n:root {\n --mermaid-bg: var(--color-light);\n --mermaid-fg: var(--color-dark);\n --mermaid-line: var(--color-grayDark);\n --mermaid-accent: var(--color-accent);\n --mermaid-muted: var(--color-grayDark);\n --mermaid-surface: var(--color-grayLight);\n --mermaid-border: var(--color-gray);\n}\n```\n\n## Syntax reference\n\nFor the syntax of each supported diagram type, see the [Mermaid documentation](https://mermaid.js.org/intro/). Keep to the six types listed above.";
1
+ export declare const mermaidMdxTemplate = "---\ntitle: \"Mermaid\"\ndescription: \"Create flowcharts, sequence diagrams, and other visualizations using Mermaid syntax.\"\ndate: \"2026-07-16\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 23\n---\n# Mermaid\n\nCreate flowcharts, sequence diagrams, and other visualizations using Mermaid syntax with automatic rendering.\n\nWrite a diagram inside a `mermaid` code fence and it renders as an SVG:\n\n````mdx\n```mermaid\nflowchart LR\n A[Start] --> B{Decision}\n B -->|Yes| C[Action]\n B -->|No| D[End]\n```\n````\n\n```mermaid\nflowchart LR\n A[Start] --> B{Decision}\n B -->|Yes| C[Action]\n B -->|No| D[End]\n```\n\nDiagrams are rendered when your site is built, so no diagramming library is shipped to your readers' browsers. They are drawn with your theme's colors and follow the light and dark toggle automatically.\n\n## Supported diagram types\n\nDoccupine renders diagrams with [beautiful-mermaid](https://github.com/lukilabs/beautiful-mermaid), which supports six diagram types:\n\n| Type | Opening keyword |\n| --- | --- |\n| Flowchart | `flowchart` or `graph` |\n| Sequence | `sequenceDiagram` |\n| State | `stateDiagram-v2` |\n| Class | `classDiagram` |\n| Entity relationship | `erDiagram` |\n| XY chart | `xychart-beta` |\n\nOther Mermaid diagram types - including `pie`, `gantt`, `mindmap`, `journey`, and `gitGraph` - are not supported. A diagram that cannot be rendered falls back to a plain code block showing its source, and the reason is logged when your site builds. A broken diagram never breaks the page.\n\n## Examples\n\n### Sequence diagram\n\n```mermaid\nsequenceDiagram\n participant Reader\n participant Docs\n participant Search\n Reader->>Docs: Open a page\n Docs->>Search: Index the content\n Search-->>Reader: Return results\n```\n\n### Subgraphs\n\n```mermaid placement=\"top-right\"\nflowchart LR\n subgraph one\n direction TB\n top1[top] --> bottom1[bottom]\n end\n subgraph two\n direction TB\n top2[top] --> bottom2[bottom]\n end\n outside --> one\n outside --> top2\n```\n\n## Interactive controls\n\nDiagrams include zoom in and out, pan in four directions, reset the view, and full screen. You can also drag a diagram with your mouse to move it around.\n\nBy default the controls appear once a diagram is taller than 120px, since a diagram that already fits does not need them. Use the `actions` property to decide explicitly. Setting `actions={false}` turns off the whole interactive layer, including dragging.\n\n## Properties\n\n<Field value=\"placement\" type=\"string\">\n Where the controls sit. One of `top-left`, `top-right`, `bottom-left`, or `bottom-right`. Defaults to `bottom-right`.\n</Field>\n\n<Field value=\"actions\" type=\"boolean\">\n Show or hide the controls. When set, this overrides the default behavior of showing them only on diagrams taller than 120px.\n</Field>\n\nSet properties on the opening fence, after the language:\n\n````mdx\n```mermaid placement=\"top-left\" actions={true}\nflowchart LR\n A --> B\n```\n````\n\nTo hide the controls entirely:\n\n````mdx\n```mermaid actions={false}\nflowchart LR\n A --> B\n```\n````\n\n```mermaid actions={false}\nflowchart LR\n A --> B\n```\n\n## Layout\n\nDiagrams are laid out with the [ELK](https://eclipse.dev/elk/) engine, which arranges nodes to reduce overlapping edges and keep large diagrams readable. It is always on, so no directive is needed to enable it.\n\nIf you are porting diagrams from another tool, a `%%{init: ...}%%` directive is read as a comment and ignored rather than causing an error.\n\n## Theming\n\nDiagram colors come from CSS variables, so they follow your theme and the light/dark toggle without re-rendering. Override any of them in your own CSS to restyle diagrams:\n\n```css\n:root {\n --mermaid-bg: var(--color-light);\n --mermaid-fg: var(--color-dark);\n --mermaid-line: var(--color-grayDark);\n --mermaid-accent: var(--color-accent);\n --mermaid-muted: var(--color-grayDark);\n --mermaid-surface: var(--color-grayLight);\n --mermaid-border: var(--color-gray);\n}\n```\n\n## Syntax reference\n\nFor the syntax of each supported diagram type, see the [Mermaid documentation](https://mermaid.js.org/intro/). Keep to the six types listed above.";
@@ -4,7 +4,7 @@ description: "Create flowcharts, sequence diagrams, and other visualizations usi
4
4
  date: "2026-07-16"
5
5
  category: "Components"
6
6
  categoryOrder: 1
7
- order: 22
7
+ order: 23
8
8
  ---
9
9
  # Mermaid
10
10