Files
vercel__chat/apps/docs/components/geistdocs/mobile-docs-bar.tsx
christopherkindl 46fc5bbe9d Sync docs with @vercel/geistdocs 1.2.0–1.2.3 (#399)
* docs: sync geistdocs template 1.2.0–1.2.3 + polish

- Ran @vercel/geistdocs@1.2.2 update --sync against origin/main
  (already contains merged 1.2.3) for:
  - components/geistdocs/*
  - components/geistcn-fallbacks/**/*  (new)
  - components/ui/command-prompt.tsx, navigation-menu.tsx
  - app/styles/geistdocs.css
- Manual overlays (paths skipped by sync due to chat customizations):
  - app/[lang]/layout.tsx: drop scroll-smooth (1.2.2)
  - app/[lang]/docs/[[...slug]]/page.tsx: MobileDocsBar + disable
    default TOC popover (1.2.0)
  - app/[lang]/docs/layout.tsx: wrap in bg-background-200 (1.2.3)
  - components/ui/badge.tsx: secondary variant → bg-gray-300/text-gray-1000 (1.2.3)
- Home hero: replace Get Started + Installer with CommandPrompt
  humans/agents switcher ("npm install chat" / "npx skills add vercel/chat")
- (home) layout: swap bg-sidebar dark:bg-background for bg-background-200
  so /, /adapters, /resources share the navbar surface
- DesktopMenu: active-state detection with longest-prefix match
  (so /docs/api highlights "API", not also "Docs")
- navbar-logo dropdown: drop Chat SDK self-entry
- New geist-fill icons (check-circle-fill, cross-circle-fill,
  warning-fill) ported from @vercel/geistcn-assets; new
  components/custom/status-icons.tsx registers Check/Cross/Warn MDX
  components
- content/docs/adapters.mdx: replace ✅/❌/⚠️ emojis with the new
  icons (emoji.mdx intentionally left alone)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: use LogoChatSdk from geistcn-fallbacks as the app Logo

Replace the inline Chat SDK wordmark SVG in geistdocs.tsx with
<LogoChatSdk /> so the navbar and other Logo consumers share the
same source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: default hero CommandPrompt to humans tab

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 09:23:36 +10:00

82 lines
2.7 KiB
TypeScript

"use client";
import type { TableOfContents } from "fumadocs-core/toc";
import { useState } from "react";
import { IconFileText } from "@/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text";
import { IconMenuAlt } from "@/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt";
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
} from "@/components/ui/sheet";
import { useSidebarContext } from "@/hooks/geistdocs/use-sidebar";
import { cn } from "@/lib/utils";
interface MobileDocsBarProps {
toc?: TableOfContents;
}
export const MobileDocsBar = ({ toc }: MobileDocsBarProps) => {
const { setIsOpen: setSidebarOpen } = useSidebarContext();
const [tocOpen, setTocOpen] = useState(false);
return (
<div className="sticky top-16 z-30 -mx-6 -mt-6 mb-6 flex h-[54px] items-center justify-between border-b bg-background-100 px-6 md:hidden">
<button
className="flex items-center gap-3 text-base text-gray-1000"
onClick={() => setSidebarOpen(true)}
type="button"
>
<IconMenuAlt size={16} />
Menu
</button>
{toc && toc.length > 0 && (
<>
<button
aria-label="Table of contents"
className="flex size-8 items-center justify-center rounded-md border border-gray-200 text-gray-900 transition-colors hover:bg-gray-100 hover:text-gray-1000"
onClick={() => setTocOpen(true)}
type="button"
>
<IconFileText size={16} />
</button>
<Sheet onOpenChange={setTocOpen} open={tocOpen}>
<SheetContent className="w-72 gap-0" side="right">
<SheetHeader>
<SheetTitle className="px-4 pt-4 font-medium text-sm">
On this page
</SheetTitle>
<SheetDescription className="sr-only">
Table of contents for the current page.
</SheetDescription>
</SheetHeader>
<nav className="flex-1 overflow-y-auto px-4 pb-4">
<ul className="space-y-1">
{toc.map((item) => (
<li key={item.url}>
<a
className={cn(
"block rounded-md py-1.5 text-gray-900 text-sm transition-colors hover:text-gray-1000",
item.depth > 2 && "pl-4"
)}
href={item.url}
onClick={() => setTocOpen(false)}
>
{item.title}
</a>
</li>
))}
</ul>
</nav>
</SheetContent>
</Sheet>
</>
)}
</div>
);
};