Skip to content

Commit 389379f

Browse files
committed
chore: update dependencies and enhance documentation layout
- Added `remark-gfm` package for GitHub Flavored Markdown support. - Updated `next-env.d.ts` to reference the correct types path. - Refined layout in `page.tsx` to include a mobile Table of Contents component. - Adjusted styles in `command-menu.tsx` for improved backdrop clarity. - Introduced a collapsible Table of Contents for better navigation on small screens.
1 parent d741ef0 commit 389379f

7 files changed

Lines changed: 133 additions & 34 deletions

File tree

bun.lock

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docs/app/docs/[[...slug]]/page.tsx

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { notFound } from 'next/navigation';
22
import { MDXRemote } from 'next-mdx-remote/rsc';
3+
import remarkGfm from 'remark-gfm';
34
import { getDocBySlug, getAllDocSlugs, extractHeadings } from '@/lib/mdx';
45
import { mdxComponents } from '@/components/docs/mdx-components';
5-
import { TableOfContents } from '@/components/docs/toc';
6+
import { TableOfContents, MobileTOC } from '@/components/docs/toc';
67

78
interface DocPageProps {
89
params: Promise<{
@@ -46,32 +47,40 @@ export default async function DocPage({ params }: DocPageProps) {
4647
const headings = extractHeadings(doc.content);
4748

4849
return (
49-
<>
50-
<article className="relative">
51-
{/* Page header */}
52-
<div className="space-y-2">
53-
<h1 className="scroll-m-20 text-4xl font-bold tracking-tight">
54-
{doc.frontmatter.title}
55-
</h1>
56-
{doc.frontmatter.description && (
57-
<p className="text-lg text-muted-foreground">
58-
{doc.frontmatter.description}
59-
</p>
60-
)}
61-
</div>
50+
<div className="xl:grid xl:grid-cols-[1fr_200px] xl:gap-8">
51+
{/* Left column: mobile TOC + article */}
52+
<div className="min-w-0">
53+
<MobileTOC items={headings} />
54+
<article className="relative">
55+
{/* Page header */}
56+
<div className="space-y-2">
57+
<h1 className="scroll-m-20 text-4xl font-bold tracking-tight">
58+
{doc.frontmatter.title}
59+
</h1>
60+
{doc.frontmatter.description && (
61+
<p className="text-lg text-muted-foreground">
62+
{doc.frontmatter.description}
63+
</p>
64+
)}
65+
</div>
6266

63-
{/* MDX Content */}
64-
<div className="pb-12 pt-8">
65-
<MDXRemote source={doc.content} components={mdxComponents} />
66-
</div>
67-
</article>
67+
{/* MDX Content */}
68+
<div className="pb-12 pt-8">
69+
<MDXRemote
70+
source={doc.content}
71+
components={mdxComponents}
72+
options={{ mdxOptions: { remarkPlugins: [remarkGfm] } }}
73+
/>
74+
</div>
75+
</article>
76+
</div>
6877

69-
{/* Table of Contents - Desktop only */}
70-
<div className="hidden text-sm xl:block">
71-
<div className="sticky top-16 -mt-10 pt-4">
78+
{/* Right column: Table of Contents (desktop only) */}
79+
<aside className="hidden xl:block text-sm">
80+
<div className="sticky top-24 pt-4">
7281
<TableOfContents items={headings} />
7382
</div>
74-
</div>
75-
</>
83+
</aside>
84+
</div>
7685
);
7786
}

packages/docs/app/docs/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function DocsLayout({ children }: DocsLayoutProps) {
1717
</aside>
1818

1919
{/* Main content */}
20-
<main className="relative py-6 lg:gap-10 lg:py-8 xl:grid xl:grid-cols-[1fr_200px]">
20+
<main className="relative py-6 lg:gap-10 lg:py-8">
2121
<div className="mx-auto w-full min-w-0">
2222
{/* Mobile sidebar trigger - Glassmorphic */}
2323
<div className="flex items-center md:hidden mb-6 p-3 rounded-xl bg-background/50 dark:bg-background/30 backdrop-blur-md border border-white/10 dark:border-white/5">

packages/docs/components/command-menu.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ export function CommandMenu() {
6363
</button>
6464

6565
{open && (
66-
<div className="fixed inset-0 z-[100]">
67-
{/* Solid backdrop */}
66+
<div className="fixed inset-0 z-[200]">
67+
{/* Light backdrop - less opaque */}
6868
<div
69-
className="fixed inset-0 bg-black/80 backdrop-blur-sm"
69+
className="fixed inset-0 bg-black/40 backdrop-blur-[2px]"
7070
onClick={() => setOpen(false)}
7171
/>
7272

73-
{/* Dialog */}
74-
<div className="fixed left-[50%] top-[20%] z-[101] w-full max-w-lg translate-x-[-50%] p-4">
73+
{/* Dialog - above header (z-50) and mobile TOC (z-[60]) */}
74+
<div className="fixed left-[50%] top-[20%] z-[201] w-full max-w-lg translate-x-[-50%] p-4">
7575
<Command className={cn(
7676
'relative rounded-2xl overflow-hidden',
77-
'bg-zinc-900 border border-zinc-700',
78-
'shadow-2xl shadow-black/50'
77+
'bg-zinc-900/95 dark:bg-zinc-900 border border-zinc-700',
78+
'shadow-2xl shadow-black/30'
7979
)}>
8080
{/* Search input */}
8181
<div className="flex items-center border-b border-zinc-700 px-4 bg-zinc-800">

0 commit comments

Comments
 (0)