@barodoc/theme-docs 2.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/components/Breadcrumb.astro +8 -8
- package/src/components/CodeCopy.astro +14 -13
- package/src/components/DocHeader.tsx +24 -24
- package/src/components/DocsSidebar.tsx +11 -15
- package/src/components/LanguageSwitcher.astro +3 -3
- package/src/components/MobileNavSheet.tsx +1 -1
- package/src/components/Search.tsx +10 -10
- package/src/components/SearchDialog.tsx +8 -8
- package/src/components/TableOfContents.astro +5 -5
- package/src/components/ThemeToggle.tsx +4 -4
- package/src/components/api/ApiEndpoint.astro +5 -5
- package/src/components/api/ApiParam.astro +4 -4
- package/src/components/api/ApiParams.astro +3 -3
- package/src/components/api/ApiResponse.astro +2 -2
- package/src/components/mdx/Accordion.tsx +6 -6
- package/src/components/mdx/Badge.tsx +1 -1
- package/src/components/mdx/Callout.astro +20 -20
- package/src/components/mdx/Card.astro +5 -5
- package/src/components/mdx/CodeGroup.astro +23 -20
- package/src/components/mdx/CodeGroup.tsx +6 -6
- package/src/components/mdx/DocAccordion.tsx +5 -5
- package/src/components/mdx/DocCard.tsx +2 -2
- package/src/components/mdx/DocTabs.tsx +3 -3
- package/src/components/mdx/Expandable.tsx +11 -11
- package/src/components/mdx/FileTree.tsx +6 -6
- package/src/components/mdx/Frame.tsx +2 -2
- package/src/components/mdx/Mermaid.tsx +3 -3
- package/src/components/mdx/ParamField.tsx +7 -7
- package/src/components/mdx/ResponseField.tsx +6 -6
- package/src/components/mdx/Step.astro +2 -2
- package/src/components/mdx/Steps.astro +3 -3
- package/src/components/mdx/Steps.tsx +10 -19
- package/src/components/mdx/Tabs.tsx +5 -8
- package/src/components/mdx/Tooltip.tsx +20 -19
- package/src/components/ui/accordion.tsx +2 -2
- package/src/components/ui/alert.tsx +1 -1
- package/src/components/ui/button.tsx +3 -3
- package/src/components/ui/card.tsx +2 -2
- package/src/components/ui/dialog.tsx +2 -2
- package/src/components/ui/scroll-area.tsx +1 -1
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +3 -3
- package/src/components/ui/tabs.tsx +2 -2
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/index.ts +6 -0
- package/src/layouts/BaseLayout.astro +7 -1
- package/src/layouts/DocsLayout.astro +39 -22
- package/src/pages/404.astro +5 -5
- package/src/pages/docs/[...slug].astro +2 -2
- package/src/pages/index.astro +21 -21
- package/src/styles/global.css +473 -166
|
@@ -11,21 +11,21 @@ export function Accordion({ title, icon, defaultOpen = false, children }: Accord
|
|
|
11
11
|
const [isOpen, setIsOpen] = useState(defaultOpen);
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<div className="accordion-item border border-[var(--
|
|
14
|
+
<div className="accordion-item border border-[var(--bd-border)] rounded-xl overflow-hidden bg-[var(--bd-bg)] my-3">
|
|
15
15
|
<button
|
|
16
16
|
type="button"
|
|
17
17
|
onClick={() => setIsOpen(!isOpen)}
|
|
18
|
-
className="w-full flex items-center gap-3 px-5 py-4 text-left hover:bg-[var(--
|
|
18
|
+
className="w-full flex items-center gap-3 px-5 py-4 text-left hover:bg-[var(--bd-bg-subtle)] transition-colors"
|
|
19
19
|
aria-expanded={isOpen}
|
|
20
20
|
>
|
|
21
21
|
{icon && (
|
|
22
|
-
<span className="flex items-center justify-center w-8 h-8 rounded-lg bg-[var(--
|
|
22
|
+
<span className="flex items-center justify-center w-8 h-8 rounded-lg bg-[var(--bd-bg-subtle)] text-lg shrink-0">
|
|
23
23
|
{icon}
|
|
24
24
|
</span>
|
|
25
25
|
)}
|
|
26
|
-
<span className="flex-1 font-medium text-[var(--
|
|
26
|
+
<span className="flex-1 font-medium text-[var(--bd-text)]">{title}</span>
|
|
27
27
|
<svg
|
|
28
|
-
className={`w-5 h-5 text-[var(--
|
|
28
|
+
className={`w-5 h-5 text-[var(--bd-text-secondary)] transition-transform duration-200 ${isOpen ? "rotate-180" : ""}`}
|
|
29
29
|
fill="none"
|
|
30
30
|
stroke="currentColor"
|
|
31
31
|
viewBox="0 0 24 24"
|
|
@@ -38,7 +38,7 @@ export function Accordion({ title, icon, defaultOpen = false, children }: Accord
|
|
|
38
38
|
isOpen ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"
|
|
39
39
|
}`}
|
|
40
40
|
>
|
|
41
|
-
<div className="px-5 pb-5 pt-1 text-sm text-[var(--
|
|
41
|
+
<div className="px-5 pb-5 pt-1 text-sm text-[var(--bd-text-secondary)] leading-relaxed">
|
|
42
42
|
{children}
|
|
43
43
|
</div>
|
|
44
44
|
</div>
|
|
@@ -13,7 +13,7 @@ const badgeVariants = cva(
|
|
|
13
13
|
warning: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300",
|
|
14
14
|
error: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",
|
|
15
15
|
info: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
|
|
16
|
-
outline: "border border-[var(--
|
|
16
|
+
outline: "border border-[var(--bd-border)] text-[var(--bd-text-secondary)]",
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
defaultVariants: {
|
|
@@ -8,34 +8,34 @@ const { type = "info", title } = Astro.props;
|
|
|
8
8
|
|
|
9
9
|
const styles = {
|
|
10
10
|
info: {
|
|
11
|
-
container: "bg-blue-50/70 dark:bg-blue-
|
|
12
|
-
iconBg: "bg-blue-100 dark:bg-blue-
|
|
11
|
+
container: "bg-blue-50/70 dark:bg-blue-500/10 border-l-blue-500",
|
|
12
|
+
iconBg: "bg-blue-100 dark:bg-blue-500/20",
|
|
13
13
|
icon: "text-blue-600 dark:text-blue-400",
|
|
14
|
-
title: "text-blue-900 dark:text-blue-
|
|
14
|
+
title: "text-blue-900 dark:text-blue-200",
|
|
15
15
|
},
|
|
16
16
|
note: {
|
|
17
|
-
container: "bg-gray-50/70 dark:bg-gray-
|
|
18
|
-
iconBg: "bg-gray-100 dark:bg-gray-
|
|
17
|
+
container: "bg-gray-50/70 dark:bg-gray-500/10 border-l-gray-400",
|
|
18
|
+
iconBg: "bg-gray-100 dark:bg-gray-500/20",
|
|
19
19
|
icon: "text-gray-600 dark:text-gray-400",
|
|
20
|
-
title: "text-gray-900 dark:text-gray-
|
|
20
|
+
title: "text-gray-900 dark:text-gray-200",
|
|
21
21
|
},
|
|
22
22
|
warning: {
|
|
23
|
-
container: "bg-orange-50/70 dark:bg-orange-
|
|
24
|
-
iconBg: "bg-orange-100 dark:bg-orange-
|
|
23
|
+
container: "bg-orange-50/70 dark:bg-orange-500/10 border-l-orange-500",
|
|
24
|
+
iconBg: "bg-orange-100 dark:bg-orange-500/20",
|
|
25
25
|
icon: "text-orange-600 dark:text-orange-400",
|
|
26
|
-
title: "text-orange-900 dark:text-orange-
|
|
26
|
+
title: "text-orange-900 dark:text-orange-200",
|
|
27
27
|
},
|
|
28
28
|
tip: {
|
|
29
|
-
container: "bg-green-50/70 dark:bg-green-
|
|
30
|
-
iconBg: "bg-green-100 dark:bg-green-
|
|
29
|
+
container: "bg-green-50/70 dark:bg-green-500/10 border-l-green-500",
|
|
30
|
+
iconBg: "bg-green-100 dark:bg-green-500/20",
|
|
31
31
|
icon: "text-green-600 dark:text-green-400",
|
|
32
|
-
title: "text-green-900 dark:text-green-
|
|
32
|
+
title: "text-green-900 dark:text-green-200",
|
|
33
33
|
},
|
|
34
34
|
danger: {
|
|
35
|
-
container: "bg-red-50/70 dark:bg-red-
|
|
36
|
-
iconBg: "bg-red-100 dark:bg-red-
|
|
35
|
+
container: "bg-red-50/70 dark:bg-red-500/10 border-l-red-500",
|
|
36
|
+
iconBg: "bg-red-100 dark:bg-red-500/20",
|
|
37
37
|
icon: "text-red-600 dark:text-red-400",
|
|
38
|
-
title: "text-red-900 dark:text-red-
|
|
38
|
+
title: "text-red-900 dark:text-red-200",
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -60,17 +60,17 @@ const icon = icons[type];
|
|
|
60
60
|
const displayTitle = title || defaultTitles[type];
|
|
61
61
|
---
|
|
62
62
|
|
|
63
|
-
<div class:list={["not-prose my-
|
|
64
|
-
<div class="
|
|
63
|
+
<div class:list={["not-prose my-5 rounded-lg border-l-4 overflow-hidden", style.container]}>
|
|
64
|
+
<div class="px-4 py-3.5">
|
|
65
65
|
<div class="flex items-start gap-3">
|
|
66
|
-
<div class:list={["shrink-0 flex items-center justify-center w-6 h-6 rounded", style.iconBg]}>
|
|
66
|
+
<div class:list={["shrink-0 flex items-center justify-center w-6 h-6 rounded-md", style.iconBg]}>
|
|
67
67
|
<div class:list={[style.icon]} set:html={icon} />
|
|
68
68
|
</div>
|
|
69
69
|
<div class="flex-1 min-w-0">
|
|
70
70
|
{displayTitle && (
|
|
71
|
-
<p class:list={["font-semibold text-
|
|
71
|
+
<p class:list={["font-semibold text-[13px] mb-1", style.title]}>{displayTitle}</p>
|
|
72
72
|
)}
|
|
73
|
-
<div class="text-
|
|
73
|
+
<div class="text-[13px] text-zinc-700 dark:text-zinc-300 leading-relaxed [&>p]:m-0 [&>p+p]:mt-1.5">
|
|
74
74
|
<slot />
|
|
75
75
|
</div>
|
|
76
76
|
</div>
|
|
@@ -13,27 +13,27 @@ const Tag = href ? "a" : "div";
|
|
|
13
13
|
<Tag
|
|
14
14
|
href={href}
|
|
15
15
|
class:list={[
|
|
16
|
-
"card-component not-prose group block p-4 rounded-lg border border-[var(--
|
|
16
|
+
"card-component not-prose group block p-4 rounded-lg border border-[var(--bd-border)] bg-[var(--bd-bg)] no-underline",
|
|
17
17
|
href && "cursor-pointer hover:border-primary-300 dark:hover:border-primary-600 hover:shadow-md transition-all duration-200"
|
|
18
18
|
]}
|
|
19
19
|
style={href ? "cursor: pointer;" : ""}
|
|
20
20
|
>
|
|
21
21
|
<div class="flex flex-col gap-3">
|
|
22
22
|
{icon && (
|
|
23
|
-
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-[var(--
|
|
23
|
+
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-[var(--bd-bg-subtle)] group-hover:bg-primary-50 dark:group-hover:bg-primary-950/50 transition-colors">
|
|
24
24
|
<span class="text-xl">{icon}</span>
|
|
25
25
|
</div>
|
|
26
26
|
)}
|
|
27
27
|
<div class="flex-1 min-w-0">
|
|
28
28
|
<div class="flex items-center gap-2">
|
|
29
|
-
<h3 class="font-semibold text-[var(--
|
|
29
|
+
<h3 class="font-semibold text-[var(--bd-text)] group-hover:text-primary-700 dark:group-hover:text-primary-300 transition-colors">{title}</h3>
|
|
30
30
|
{href && (
|
|
31
|
-
<svg class="w-4 h-4 text-[var(--
|
|
31
|
+
<svg class="w-4 h-4 text-[var(--bd-text-muted)] opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
32
32
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
|
|
33
33
|
</svg>
|
|
34
34
|
)}
|
|
35
35
|
</div>
|
|
36
|
-
<div class="mt-1 text-sm text-[var(--
|
|
36
|
+
<div class="mt-1 text-sm text-[var(--bd-text-secondary)] group-hover:text-[var(--bd-text)] leading-relaxed transition-colors">
|
|
37
37
|
<slot />
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
@@ -9,9 +9,9 @@ interface Props {
|
|
|
9
9
|
const { titles = [] } = Astro.props;
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<div class="code-group not-prose my-4 rounded-lg border border-[var(--
|
|
13
|
-
<div class="code-group-tabs flex flex-wrap gap-0 border-b border-[var(--
|
|
14
|
-
<div class="code-group-content bg-[var(--
|
|
12
|
+
<div class="code-group not-prose my-4 rounded-lg border border-[var(--bd-border)] overflow-hidden" data-titles={JSON.stringify(titles)}>
|
|
13
|
+
<div class="code-group-tabs flex flex-wrap gap-0 border-b border-[var(--bd-border)] bg-[var(--bd-bg-muted)]"></div>
|
|
14
|
+
<div class="code-group-content bg-[var(--bd-bg-subtle)]">
|
|
15
15
|
<slot />
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
@@ -21,37 +21,40 @@ const { titles = [] } = Astro.props;
|
|
|
21
21
|
document.querySelectorAll('.code-group').forEach((group) => {
|
|
22
22
|
const tabsContainer = group.querySelector('.code-group-tabs');
|
|
23
23
|
const contentContainer = group.querySelector('.code-group-content');
|
|
24
|
+
if (!tabsContainer || !contentContainer) return;
|
|
25
|
+
|
|
26
|
+
tabsContainer.innerHTML = '';
|
|
27
|
+
|
|
24
28
|
const fallbackTitles = JSON.parse(group.getAttribute('data-titles') || '[]');
|
|
25
29
|
|
|
26
|
-
const codeItems = contentContainer
|
|
27
|
-
const directPres = contentContainer
|
|
30
|
+
const codeItems = contentContainer.querySelectorAll(':scope > .code-item');
|
|
31
|
+
const directPres = contentContainer.querySelectorAll(':scope > pre');
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
const useCodeItems = (codeItems?.length ?? 0) > 0;
|
|
33
|
+
const useCodeItems = codeItems.length > 0;
|
|
31
34
|
const tabPanels = useCodeItems
|
|
32
|
-
? Array.from(codeItems
|
|
33
|
-
: Array.from(directPres
|
|
34
|
-
const titles = useCodeItems
|
|
35
|
-
? Array.from(codeItems
|
|
35
|
+
? Array.from(codeItems)
|
|
36
|
+
: Array.from(directPres);
|
|
37
|
+
const titles = useCodeItems
|
|
38
|
+
? Array.from(codeItems).map((el) => (el as HTMLElement).getAttribute('data-title') ?? '')
|
|
36
39
|
: fallbackTitles;
|
|
37
40
|
const numTabs = tabPanels.length;
|
|
38
41
|
|
|
39
|
-
if (
|
|
42
|
+
if (numTabs === 0) return;
|
|
40
43
|
|
|
41
44
|
// Create tabs from titles; show/hide tabPanels
|
|
42
45
|
tabPanels.forEach((_panel, index) => {
|
|
43
46
|
const tab = document.createElement('button');
|
|
44
|
-
tab.className = 'shrink-0 px-4 py-2 text-sm font-medium transition-colors whitespace-nowrap text-[var(--
|
|
47
|
+
tab.className = 'shrink-0 px-4 py-2 text-sm font-medium transition-colors whitespace-nowrap text-[var(--bd-text-muted)] hover:text-[var(--bd-text)]';
|
|
45
48
|
tab.textContent = titles[index]?.trim() || `Tab ${index + 1}`;
|
|
46
49
|
const panel = tabPanels[index] as HTMLElement;
|
|
47
50
|
tab.addEventListener('click', () => {
|
|
48
51
|
tabsContainer.querySelectorAll('button').forEach((t, i) => {
|
|
49
52
|
if (i === index) {
|
|
50
|
-
t.classList.add('border-b-2', 'border-primary-500', 'text-[var(--
|
|
51
|
-
t.classList.remove('text-[var(--
|
|
53
|
+
t.classList.add('border-b-2', 'border-primary-500', 'text-[var(--bd-text)]', '-mb-px');
|
|
54
|
+
t.classList.remove('text-[var(--bd-text-muted)]');
|
|
52
55
|
} else {
|
|
53
|
-
t.classList.remove('border-b-2', 'border-primary-500', 'text-[var(--
|
|
54
|
-
t.classList.add('text-[var(--
|
|
56
|
+
t.classList.remove('border-b-2', 'border-primary-500', 'text-[var(--bd-text)]', '-mb-px');
|
|
57
|
+
t.classList.add('text-[var(--bd-text-muted)]');
|
|
55
58
|
}
|
|
56
59
|
});
|
|
57
60
|
tabPanels.forEach((p, i) => {
|
|
@@ -61,8 +64,8 @@ const { titles = [] } = Astro.props;
|
|
|
61
64
|
tabsContainer.appendChild(tab);
|
|
62
65
|
|
|
63
66
|
if (index === 0) {
|
|
64
|
-
tab.classList.add('border-b-2', 'border-primary-500', 'text-[var(--
|
|
65
|
-
tab.classList.remove('text-[var(--
|
|
67
|
+
tab.classList.add('border-b-2', 'border-primary-500', 'text-[var(--bd-text)]', '-mb-px');
|
|
68
|
+
tab.classList.remove('text-[var(--bd-text-muted)]');
|
|
66
69
|
} else {
|
|
67
70
|
panel.style.display = 'none';
|
|
68
71
|
}
|
|
@@ -70,6 +73,6 @@ const { titles = [] } = Astro.props;
|
|
|
70
73
|
});
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
initCodeGroups();
|
|
74
76
|
document.addEventListener('astro:page-load', initCodeGroups);
|
|
77
|
+
if (document.readyState === 'complete') initCodeGroups();
|
|
75
78
|
</script>
|
|
@@ -72,16 +72,16 @@ export function CodeGroup({ children, titles = [] }: CodeGroupProps) {
|
|
|
72
72
|
|
|
73
73
|
if (codeBlocks.length === 0) {
|
|
74
74
|
return (
|
|
75
|
-
<div className="code-group not-prose my-4 rounded-lg border border-[var(--
|
|
75
|
+
<div className="code-group not-prose my-4 rounded-lg border border-[var(--bd-border)] overflow-hidden p-4 text-[var(--bd-text-muted)] text-sm">
|
|
76
76
|
No code blocks found inside CodeGroup.
|
|
77
77
|
</div>
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
return (
|
|
82
|
-
<div className="code-group not-prose my-4 rounded-lg border border-[var(--
|
|
82
|
+
<div className="code-group not-prose my-4 rounded-lg border border-[var(--bd-border)] overflow-hidden">
|
|
83
83
|
{/* Tabs */}
|
|
84
|
-
<div className="flex flex-wrap gap-0 bg-[var(--
|
|
84
|
+
<div className="flex flex-wrap gap-0 bg-[var(--bd-bg-muted)] border-b border-[var(--bd-border)]">
|
|
85
85
|
{tabTitles.map((title, index) => {
|
|
86
86
|
const isActive = activeIndex === index;
|
|
87
87
|
return (
|
|
@@ -91,8 +91,8 @@ export function CodeGroup({ children, titles = [] }: CodeGroupProps) {
|
|
|
91
91
|
onClick={() => setActiveIndex(index)}
|
|
92
92
|
className={`shrink-0 px-4 py-2 text-sm font-medium transition-colors whitespace-nowrap ${
|
|
93
93
|
isActive
|
|
94
|
-
? "bg-[var(--
|
|
95
|
-
: "text-[var(--
|
|
94
|
+
? "bg-[var(--bd-bg-subtle)] text-[var(--bd-text)] border-b-2 border-primary-500 -mb-px"
|
|
95
|
+
: "text-[var(--bd-text-muted)] hover:text-[var(--bd-text)]"
|
|
96
96
|
}`}
|
|
97
97
|
>
|
|
98
98
|
{title}
|
|
@@ -102,7 +102,7 @@ export function CodeGroup({ children, titles = [] }: CodeGroupProps) {
|
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
104
|
{/* Content */}
|
|
105
|
-
<div className="bg-[var(--
|
|
105
|
+
<div className="bg-[var(--bd-bg-subtle)]">
|
|
106
106
|
{codeBlocks.map((block, index) => (
|
|
107
107
|
<div
|
|
108
108
|
key={index}
|
|
@@ -36,11 +36,11 @@ export function DocAccordion({
|
|
|
36
36
|
<AccordionItem
|
|
37
37
|
key={value}
|
|
38
38
|
value={value}
|
|
39
|
-
className="border-b border-[var(--
|
|
39
|
+
className="border-b border-[var(--bd-border)] last:border-b-0"
|
|
40
40
|
>
|
|
41
41
|
<div className="flex items-start gap-3 px-4">
|
|
42
42
|
{item.icon && (
|
|
43
|
-
<span className="flex items-center justify-center w-8 h-8 rounded-lg bg-[var(--
|
|
43
|
+
<span className="flex items-center justify-center w-8 h-8 rounded-lg bg-[var(--bd-bg-subtle)] text-lg shrink-0 mt-3">
|
|
44
44
|
{item.icon}
|
|
45
45
|
</span>
|
|
46
46
|
)}
|
|
@@ -48,7 +48,7 @@ export function DocAccordion({
|
|
|
48
48
|
<AccordionTrigger className="text-left">
|
|
49
49
|
{item.title}
|
|
50
50
|
</AccordionTrigger>
|
|
51
|
-
<AccordionContent className="text-[var(--
|
|
51
|
+
<AccordionContent className="text-[var(--bd-text-secondary)]">
|
|
52
52
|
{item.content}
|
|
53
53
|
</AccordionContent>
|
|
54
54
|
</div>
|
|
@@ -63,7 +63,7 @@ export function DocAccordion({
|
|
|
63
63
|
type="single"
|
|
64
64
|
collapsible={collapsible}
|
|
65
65
|
defaultValue={defaultValue as string}
|
|
66
|
-
className={cn("not-prose my-6 rounded-xl border border-[var(--
|
|
66
|
+
className={cn("not-prose my-6 rounded-xl border border-[var(--bd-border)] overflow-hidden", className)}
|
|
67
67
|
>
|
|
68
68
|
{renderItems()}
|
|
69
69
|
</Accordion>
|
|
@@ -74,7 +74,7 @@ export function DocAccordion({
|
|
|
74
74
|
<Accordion
|
|
75
75
|
type="multiple"
|
|
76
76
|
defaultValue={defaultValue as string[]}
|
|
77
|
-
className={cn("not-prose my-6 rounded-xl border border-[var(--
|
|
77
|
+
className={cn("not-prose my-6 rounded-xl border border-[var(--bd-border)] overflow-hidden", className)}
|
|
78
78
|
>
|
|
79
79
|
{renderItems()}
|
|
80
80
|
</Accordion>
|
|
@@ -24,7 +24,7 @@ export function DocCard({ title, icon, href, children }: DocCardProps) {
|
|
|
24
24
|
<div className="absolute inset-0 bg-gradient-to-br from-primary-50/50 to-transparent dark:from-primary-950/30 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none" />
|
|
25
25
|
<CardHeader className="relative">
|
|
26
26
|
{icon && (
|
|
27
|
-
<div className="flex items-center justify-center w-10 h-10 rounded-lg bg-[var(--
|
|
27
|
+
<div className="flex items-center justify-center w-10 h-10 rounded-lg bg-[var(--bd-bg-subtle)] group-hover:bg-primary-50 dark:group-hover:bg-primary-950/50 mb-3 transition-colors">
|
|
28
28
|
<span className="text-xl">{icon}</span>
|
|
29
29
|
</div>
|
|
30
30
|
)}
|
|
@@ -33,7 +33,7 @@ export function DocCard({ title, icon, href, children }: DocCardProps) {
|
|
|
33
33
|
{title}
|
|
34
34
|
</CardTitle>
|
|
35
35
|
{href && (
|
|
36
|
-
<ChevronRight className="h-4 w-4 text-[var(--
|
|
36
|
+
<ChevronRight className="h-4 w-4 text-[var(--bd-text-muted)] opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200" />
|
|
37
37
|
)}
|
|
38
38
|
</div>
|
|
39
39
|
{children && (
|
|
@@ -19,12 +19,12 @@ export function DocTabs({ items, defaultValue, className }: DocTabsProps) {
|
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<Tabs defaultValue={defaultTab} className={cn("not-prose my-6", className)}>
|
|
22
|
-
<TabsList className="w-full justify-start bg-[var(--
|
|
22
|
+
<TabsList className="w-full justify-start bg-[var(--bd-bg-subtle)] rounded-lg p-1">
|
|
23
23
|
{items.map((item) => (
|
|
24
24
|
<TabsTrigger
|
|
25
25
|
key={item.value}
|
|
26
26
|
value={item.value}
|
|
27
|
-
className="data-[state=active]:bg-[var(--
|
|
27
|
+
className="data-[state=active]:bg-[var(--bd-bg)] data-[state=active]:shadow-sm"
|
|
28
28
|
>
|
|
29
29
|
{item.label}
|
|
30
30
|
</TabsTrigger>
|
|
@@ -34,7 +34,7 @@ export function DocTabs({ items, defaultValue, className }: DocTabsProps) {
|
|
|
34
34
|
<TabsContent
|
|
35
35
|
key={item.value}
|
|
36
36
|
value={item.value}
|
|
37
|
-
className="mt-4 rounded-lg border border-[var(--
|
|
37
|
+
className="mt-4 rounded-lg border border-[var(--bd-border)] bg-[var(--bd-bg-subtle)] p-4"
|
|
38
38
|
>
|
|
39
39
|
<div className="text-sm">
|
|
40
40
|
{item.children}
|
|
@@ -20,27 +20,27 @@ export function Expandable({
|
|
|
20
20
|
return (
|
|
21
21
|
<div
|
|
22
22
|
className={cn(
|
|
23
|
-
"not-prose border border-[var(--
|
|
23
|
+
"not-prose border border-[var(--bd-border)] rounded-lg overflow-hidden my-4",
|
|
24
24
|
className
|
|
25
25
|
)}
|
|
26
26
|
>
|
|
27
27
|
<button
|
|
28
28
|
type="button"
|
|
29
29
|
onClick={() => setIsOpen(!isOpen)}
|
|
30
|
-
className="flex w-full items-center justify-between px-4 py-3 bg-[var(--
|
|
30
|
+
className="flex w-full items-center justify-between px-4 py-3 bg-[var(--bd-bg-subtle)] hover:bg-[var(--bd-bg-muted)] transition-colors text-left"
|
|
31
31
|
>
|
|
32
|
-
<span className="text-sm font-medium text-[var(--
|
|
32
|
+
<span className="text-sm font-medium text-[var(--bd-text)]">
|
|
33
33
|
{title}
|
|
34
34
|
</span>
|
|
35
35
|
<ChevronDown
|
|
36
36
|
className={cn(
|
|
37
|
-
"h-4 w-4 text-[var(--
|
|
37
|
+
"h-4 w-4 text-[var(--bd-text-muted)] transition-transform",
|
|
38
38
|
isOpen && "rotate-180"
|
|
39
39
|
)}
|
|
40
40
|
/>
|
|
41
41
|
</button>
|
|
42
42
|
{isOpen && (
|
|
43
|
-
<div className="px-4 py-3 bg-[var(--
|
|
43
|
+
<div className="px-4 py-3 bg-[var(--bd-bg)] border-t border-[var(--bd-border)] text-sm text-[var(--bd-text-secondary)]">
|
|
44
44
|
{children}
|
|
45
45
|
</div>
|
|
46
46
|
)}
|
|
@@ -77,28 +77,28 @@ export function ExpandableItem({
|
|
|
77
77
|
const [isOpen, setIsOpen] = React.useState(defaultOpen);
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
|
-
<div className="not-prose border-l-2 border-[var(--
|
|
80
|
+
<div className="not-prose border-l-2 border-[var(--bd-border)] pl-4">
|
|
81
81
|
<button
|
|
82
82
|
type="button"
|
|
83
83
|
onClick={() => setIsOpen(!isOpen)}
|
|
84
84
|
className="flex items-center gap-2 text-left group"
|
|
85
85
|
>
|
|
86
86
|
{isOpen ? (
|
|
87
|
-
<Minus className="h-3 w-3 text-[var(--
|
|
87
|
+
<Minus className="h-3 w-3 text-[var(--bd-text-muted)]" />
|
|
88
88
|
) : (
|
|
89
|
-
<Plus className="h-3 w-3 text-[var(--
|
|
89
|
+
<Plus className="h-3 w-3 text-[var(--bd-text-muted)]" />
|
|
90
90
|
)}
|
|
91
|
-
<code className="font-mono text-sm text-[var(--
|
|
91
|
+
<code className="font-mono text-sm text-[var(--bd-text)] group-hover:text-primary-600 dark:group-hover:text-primary-400">
|
|
92
92
|
{title}
|
|
93
93
|
</code>
|
|
94
94
|
{type && (
|
|
95
|
-
<span className="font-mono text-xs text-[var(--
|
|
95
|
+
<span className="font-mono text-xs text-[var(--bd-text-muted)]">
|
|
96
96
|
{type}
|
|
97
97
|
</span>
|
|
98
98
|
)}
|
|
99
99
|
</button>
|
|
100
100
|
{isOpen && (
|
|
101
|
-
<div className="mt-2 ml-5 text-sm text-[var(--
|
|
101
|
+
<div className="mt-2 ml-5 text-sm text-[var(--bd-text-secondary)]">
|
|
102
102
|
{children}
|
|
103
103
|
</div>
|
|
104
104
|
)}
|
|
@@ -9,7 +9,7 @@ interface FileTreeProps {
|
|
|
9
9
|
|
|
10
10
|
export function FileTree({ children, className }: FileTreeProps) {
|
|
11
11
|
return (
|
|
12
|
-
<div className={cn("not-prose my-4 rounded-lg border border-[var(--
|
|
12
|
+
<div className={cn("not-prose my-4 rounded-lg border border-[var(--bd-border)] bg-[var(--bd-bg-subtle)] p-4 font-mono text-sm", className)}>
|
|
13
13
|
<ul className="space-y-1">{children}</ul>
|
|
14
14
|
</div>
|
|
15
15
|
);
|
|
@@ -22,8 +22,8 @@ interface FileProps {
|
|
|
22
22
|
|
|
23
23
|
export function TreeFile({ name, icon }: FileProps) {
|
|
24
24
|
return (
|
|
25
|
-
<li className="flex items-center gap-2 py-0.5 text-[var(--
|
|
26
|
-
{icon || <File className="h-4 w-4 text-[var(--
|
|
25
|
+
<li className="flex items-center gap-2 py-0.5 text-[var(--bd-text-secondary)]">
|
|
26
|
+
{icon || <File className="h-4 w-4 text-[var(--bd-text-muted)]" />}
|
|
27
27
|
<span>{name}</span>
|
|
28
28
|
</li>
|
|
29
29
|
);
|
|
@@ -44,12 +44,12 @@ export function TreeFolder({ name, children, defaultOpen = false }: FolderProps)
|
|
|
44
44
|
<button
|
|
45
45
|
type="button"
|
|
46
46
|
onClick={() => setIsOpen(!isOpen)}
|
|
47
|
-
className="flex w-full items-center gap-1 py-0.5 text-[var(--
|
|
47
|
+
className="flex w-full items-center gap-1 py-0.5 text-[var(--bd-text)] hover:text-primary-600 dark:hover:text-primary-400 transition-colors"
|
|
48
48
|
>
|
|
49
49
|
{hasChildren && (
|
|
50
50
|
<ChevronRight
|
|
51
51
|
className={cn(
|
|
52
|
-
"h-3 w-3 text-[var(--
|
|
52
|
+
"h-3 w-3 text-[var(--bd-text-muted)] transition-transform",
|
|
53
53
|
isOpen && "rotate-90"
|
|
54
54
|
)}
|
|
55
55
|
/>
|
|
@@ -63,7 +63,7 @@ export function TreeFolder({ name, children, defaultOpen = false }: FolderProps)
|
|
|
63
63
|
<span className="font-medium">{name}</span>
|
|
64
64
|
</button>
|
|
65
65
|
{isOpen && hasChildren && (
|
|
66
|
-
<ul className="ml-4 border-l border-[var(--
|
|
66
|
+
<ul className="ml-4 border-l border-[var(--bd-border)] pl-3 mt-1 space-y-1">
|
|
67
67
|
{children}
|
|
68
68
|
</ul>
|
|
69
69
|
)}
|
|
@@ -10,11 +10,11 @@ interface FrameProps {
|
|
|
10
10
|
export function Frame({ children, caption, className }: FrameProps) {
|
|
11
11
|
return (
|
|
12
12
|
<figure className={cn("not-prose my-6", className)}>
|
|
13
|
-
<div className="overflow-hidden rounded-lg border border-[var(--
|
|
13
|
+
<div className="overflow-hidden rounded-lg border border-[var(--bd-border)] bg-[var(--bd-bg-subtle)]">
|
|
14
14
|
{children}
|
|
15
15
|
</div>
|
|
16
16
|
{caption && (
|
|
17
|
-
<figcaption className="mt-2 text-center text-sm text-[var(--
|
|
17
|
+
<figcaption className="mt-2 text-center text-sm text-[var(--bd-text-muted)]">
|
|
18
18
|
{caption}
|
|
19
19
|
</figcaption>
|
|
20
20
|
)}
|
|
@@ -78,8 +78,8 @@ export function Mermaid({ chart, className }: MermaidProps) {
|
|
|
78
78
|
|
|
79
79
|
if (!svg) {
|
|
80
80
|
return (
|
|
81
|
-
<div className={cn("not-prose my-4 flex items-center justify-center p-8 bg-[var(--
|
|
82
|
-
<div className="text-sm text-[var(--
|
|
81
|
+
<div className={cn("not-prose my-4 flex items-center justify-center p-8 bg-[var(--bd-bg-subtle)] rounded-lg", className)}>
|
|
82
|
+
<div className="text-sm text-[var(--bd-text-muted)]">Loading diagram...</div>
|
|
83
83
|
</div>
|
|
84
84
|
);
|
|
85
85
|
}
|
|
@@ -87,7 +87,7 @@ export function Mermaid({ chart, className }: MermaidProps) {
|
|
|
87
87
|
return (
|
|
88
88
|
<div
|
|
89
89
|
ref={containerRef}
|
|
90
|
-
className={cn("not-prose my-4 flex justify-center overflow-x-auto rounded-lg bg-[var(--
|
|
90
|
+
className={cn("not-prose my-4 flex justify-center overflow-x-auto rounded-lg bg-[var(--bd-bg)] p-4", className)}
|
|
91
91
|
dangerouslySetInnerHTML={{ __html: svg }}
|
|
92
92
|
/>
|
|
93
93
|
);
|
|
@@ -21,16 +21,16 @@ export function ParamField({
|
|
|
21
21
|
return (
|
|
22
22
|
<div
|
|
23
23
|
className={cn(
|
|
24
|
-
"not-prose border-b border-[var(--
|
|
24
|
+
"not-prose border-b border-[var(--bd-border)] py-4 last:border-b-0",
|
|
25
25
|
className
|
|
26
26
|
)}
|
|
27
27
|
>
|
|
28
28
|
<div className="flex flex-wrap items-baseline gap-2">
|
|
29
|
-
<code className="font-mono text-sm font-semibold text-[var(--
|
|
29
|
+
<code className="font-mono text-sm font-semibold text-[var(--bd-text)]">
|
|
30
30
|
{name}
|
|
31
31
|
</code>
|
|
32
32
|
{type && (
|
|
33
|
-
<span className="font-mono text-xs text-[var(--
|
|
33
|
+
<span className="font-mono text-xs text-[var(--bd-text-muted)]">
|
|
34
34
|
{type}
|
|
35
35
|
</span>
|
|
36
36
|
)}
|
|
@@ -40,13 +40,13 @@ export function ParamField({
|
|
|
40
40
|
</span>
|
|
41
41
|
)}
|
|
42
42
|
{defaultValue && (
|
|
43
|
-
<span className="text-xs text-[var(--
|
|
43
|
+
<span className="text-xs text-[var(--bd-text-muted)]">
|
|
44
44
|
default: <code className="font-mono">{defaultValue}</code>
|
|
45
45
|
</span>
|
|
46
46
|
)}
|
|
47
47
|
</div>
|
|
48
48
|
{children && (
|
|
49
|
-
<div className="mt-2 text-sm text-[var(--
|
|
49
|
+
<div className="mt-2 text-sm text-[var(--bd-text-secondary)] prose prose-sm dark:prose-invert max-w-none">
|
|
50
50
|
{children}
|
|
51
51
|
</div>
|
|
52
52
|
)}
|
|
@@ -64,11 +64,11 @@ export function ParamFieldGroup({ children, title, className }: ParamFieldGroupP
|
|
|
64
64
|
return (
|
|
65
65
|
<div className={cn("my-6", className)}>
|
|
66
66
|
{title && (
|
|
67
|
-
<h4 className="text-sm font-semibold text-[var(--
|
|
67
|
+
<h4 className="text-sm font-semibold text-[var(--bd-text)] mb-4 uppercase tracking-wide">
|
|
68
68
|
{title}
|
|
69
69
|
</h4>
|
|
70
70
|
)}
|
|
71
|
-
<div className="rounded-lg border border-[var(--
|
|
71
|
+
<div className="rounded-lg border border-[var(--bd-border)] bg-[var(--bd-bg)] px-4">
|
|
72
72
|
{children}
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
@@ -17,22 +17,22 @@ export function ResponseField({
|
|
|
17
17
|
return (
|
|
18
18
|
<div
|
|
19
19
|
className={cn(
|
|
20
|
-
"not-prose border-b border-[var(--
|
|
20
|
+
"not-prose border-b border-[var(--bd-border)] py-4 first:pt-0 last:border-b-0",
|
|
21
21
|
className
|
|
22
22
|
)}
|
|
23
23
|
>
|
|
24
24
|
<div className="flex flex-wrap items-baseline gap-2">
|
|
25
|
-
<code className="font-mono text-sm font-semibold text-[var(--
|
|
25
|
+
<code className="font-mono text-sm font-semibold text-[var(--bd-text)]">
|
|
26
26
|
{name}
|
|
27
27
|
</code>
|
|
28
28
|
{type && (
|
|
29
|
-
<span className="font-mono text-xs text-[var(--
|
|
29
|
+
<span className="font-mono text-xs text-[var(--bd-text-muted)]">
|
|
30
30
|
{type}
|
|
31
31
|
</span>
|
|
32
32
|
)}
|
|
33
33
|
</div>
|
|
34
34
|
{children && (
|
|
35
|
-
<div className="mt-2 text-sm text-[var(--
|
|
35
|
+
<div className="mt-2 text-sm text-[var(--bd-text-secondary)] prose prose-sm dark:prose-invert max-w-none">
|
|
36
36
|
{children}
|
|
37
37
|
</div>
|
|
38
38
|
)}
|
|
@@ -50,11 +50,11 @@ export function ResponseFieldGroup({ children, title, className }: ResponseField
|
|
|
50
50
|
return (
|
|
51
51
|
<div className={cn("my-6", className)}>
|
|
52
52
|
{title && (
|
|
53
|
-
<h4 className="text-sm font-semibold text-[var(--
|
|
53
|
+
<h4 className="text-sm font-semibold text-[var(--bd-text)] mb-4 uppercase tracking-wide">
|
|
54
54
|
{title}
|
|
55
55
|
</h4>
|
|
56
56
|
)}
|
|
57
|
-
<div className="rounded-lg border border-[var(--
|
|
57
|
+
<div className="rounded-lg border border-[var(--bd-border)] bg-[var(--bd-bg)] px-4">
|
|
58
58
|
{children}
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
@@ -7,8 +7,8 @@ const { title } = Astro.props;
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
<div class="relative">
|
|
10
|
-
<h3 class="font-semibold text-[var(--
|
|
11
|
-
<div class="text-sm text-[var(--
|
|
10
|
+
<h3 class="font-semibold text-[var(--bd-text)] mb-2">{title}</h3>
|
|
11
|
+
<div class="text-sm text-[var(--bd-text-secondary)]">
|
|
12
12
|
<slot />
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|