Files
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

85 lines
2.2 KiB
TypeScript

"use client";
import { useDocsSearch } from "fumadocs-core/search/client";
import {
SearchDialog as FumadocsSearchDialog,
SearchDialogClose,
SearchDialogContent,
SearchDialogHeader,
SearchDialogIcon,
SearchDialogInput,
SearchDialogList,
SearchDialogOverlay,
type SharedProps,
} from "fumadocs-ui/components/dialog/search";
import { useI18n } from "fumadocs-ui/contexts/i18n";
import { useSearchContext } from "fumadocs-ui/contexts/search";
import { cn } from "@/lib/utils";
import { Button } from "../ui/button";
import { Kbd } from "../ui/kbd";
interface SearchButtonProps {
className?: string;
onClick?: () => void;
}
export const SearchDialog = ({
basePath,
...props
}: SharedProps & { basePath: string | undefined }) => {
const { locale } = useI18n();
const { search, setSearch, query } = useDocsSearch({
type: "fetch",
locale,
api: basePath ? `${basePath}/api/search` : "/api/search",
});
return (
<FumadocsSearchDialog
isLoading={query.isLoading}
onSearchChange={setSearch}
search={search}
{...props}
>
<SearchDialogOverlay />
<SearchDialogContent>
<SearchDialogHeader>
<SearchDialogIcon />
<SearchDialogInput />
<SearchDialogClose />
</SearchDialogHeader>
<SearchDialogList items={query.data === "empty" ? null : query.data} />
</SearchDialogContent>
</FumadocsSearchDialog>
);
};
export const SearchButton = ({ className, onClick }: SearchButtonProps) => {
const { setOpenSearch } = useSearchContext();
return (
<Button
className={cn(
// desktop styling
"group justify-between gap-8 pr-1.5 font-normal text-muted-foreground shadow-none lg:h-8 lg:w-[150px] lg:bg-background-200 hover:lg:bg-background-200",
// mobile styling
"h-10",
className
)}
onClick={() => {
setOpenSearch(true);
onClick?.();
}}
size="sm"
type="button"
variant="outline"
>
<span>Search...</span>
<Kbd className="border bg-background font-medium transition-colors group-hover:text-gray-1000">
⌘K
</Kbd>
</Button>
);
};