@vercel/geistdocs 1.2.2 → 1.2.3-canary.a12a9c6
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/dist/assets/icons/icon-arrow-up-right-small.d.ts +8 -0
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right-small.js +4 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts +5 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right.js +4 -0
- package/dist/assets/icons/icon-check.d.ts +5 -0
- package/dist/assets/icons/icon-check.d.ts.map +1 -0
- package/dist/assets/icons/icon-check.js +4 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts +8 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-down-small.js +7 -0
- package/dist/assets/icons/icon-chevron-right.d.ts +5 -0
- package/dist/assets/icons/icon-chevron-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-right.js +4 -0
- package/dist/assets/icons/icon-copy.d.ts +5 -0
- package/dist/assets/icons/icon-copy.d.ts.map +1 -0
- package/dist/assets/icons/icon-copy.js +4 -0
- package/dist/assets/icons/icon-file-text.d.ts +5 -0
- package/dist/assets/icons/icon-file-text.d.ts.map +1 -0
- package/dist/assets/icons/icon-file-text.js +4 -0
- package/dist/assets/icons/icon-menu-alt.d.ts +5 -0
- package/dist/assets/icons/icon-menu-alt.d.ts.map +1 -0
- package/dist/assets/icons/icon-menu-alt.js +4 -0
- package/dist/assets/icons/icon-slash-forward.d.ts +8 -0
- package/dist/assets/icons/icon-slash-forward.d.ts.map +1 -0
- package/dist/assets/icons/icon-slash-forward.js +4 -0
- package/dist/assets/icons/index.d.ts +10 -0
- package/dist/assets/icons/index.d.ts.map +1 -0
- package/dist/assets/icons/index.js +10 -0
- package/dist/assets/logos/index.d.ts +13 -0
- package/dist/assets/logos/index.d.ts.map +1 -0
- package/dist/assets/logos/index.js +13 -0
- package/dist/assets/logos/logo-ai-elements.d.ts +8 -0
- package/dist/assets/logos/logo-ai-elements.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-elements.js +8 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-sdk.js +8 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-chat-sdk.js +8 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-flags-sdk.js +8 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts +9 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts.map +1 -0
- package/dist/assets/logos/logo-icon-vercel.js +8 -0
- package/dist/assets/logos/logo-streamdown.d.ts +8 -0
- package/dist/assets/logos/logo-streamdown.d.ts.map +1 -0
- package/dist/assets/logos/logo-streamdown.js +8 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts +8 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts.map +1 -0
- package/dist/assets/logos/logo-vercel-oss.js +7 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-workflow-sdk.js +8 -0
- package/dist/cli/index.js +3 -0
- package/dist/components/callout.d.ts +12 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +7 -0
- package/dist/components/code-block-tabs.d.ts +7 -0
- package/dist/components/code-block-tabs.d.ts.map +1 -0
- package/dist/components/code-block-tabs.js +7 -0
- package/dist/components/code-block.d.ts +14 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +45 -0
- package/dist/components/copy-prompt.d.ts +11 -0
- package/dist/components/copy-prompt.d.ts.map +1 -0
- package/dist/components/copy-prompt.js +58 -0
- package/dist/components/mermaid.d.ts +4 -0
- package/dist/components/mermaid.d.ts.map +1 -0
- package/dist/components/mermaid.js +44 -0
- package/dist/components/theme-aware-image.d.ts +12 -0
- package/dist/components/theme-aware-image.d.ts.map +1 -0
- package/dist/components/theme-aware-image.js +8 -0
- package/dist/components/video.d.ts +6 -0
- package/dist/components/video.d.ts.map +1 -0
- package/dist/components/video.js +3 -0
- package/dist/config.d.ts +71 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/controls.d.ts +15 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +52 -0
- package/dist/internal/chat/context.d.ts +19 -0
- package/dist/internal/chat/context.d.ts.map +1 -0
- package/dist/internal/chat/context.js +36 -0
- package/dist/internal/chat/conversation.d.ts +10 -0
- package/dist/internal/chat/conversation.d.ts.map +1 -0
- package/dist/internal/chat/conversation.js +16 -0
- package/dist/internal/chat/copy-chat.d.ts +5 -0
- package/dist/internal/chat/copy-chat.d.ts.map +1 -0
- package/dist/internal/chat/copy-chat.js +35 -0
- package/dist/internal/chat/db.d.ts +13 -0
- package/dist/internal/chat/db.d.ts.map +1 -0
- package/dist/internal/chat/db.js +19 -0
- package/dist/internal/chat/message-metadata.d.ts +8 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -0
- package/dist/internal/chat/message-metadata.js +29 -0
- package/dist/internal/chat/message.d.ts +11 -0
- package/dist/internal/chat/message.d.ts.map +1 -0
- package/dist/internal/chat/message.js +11 -0
- package/dist/internal/chat/prompt-input.d.ts +13 -0
- package/dist/internal/chat/prompt-input.d.ts.map +1 -0
- package/dist/internal/chat/prompt-input.js +39 -0
- package/dist/internal/chat/shell.d.ts +2 -0
- package/dist/internal/chat/shell.d.ts.map +1 -0
- package/dist/internal/chat/shell.js +194 -0
- package/dist/internal/chat/shimmer.d.ts +11 -0
- package/dist/internal/chat/shimmer.d.ts.map +1 -0
- package/dist/internal/chat/shimmer.js +18 -0
- package/dist/internal/chat/sources.d.ts +13 -0
- package/dist/internal/chat/sources.d.ts.map +1 -0
- package/dist/internal/chat/sources.js +9 -0
- package/dist/internal/chat/suggestion.d.ts +11 -0
- package/dist/internal/chat/suggestion.d.ts.map +1 -0
- package/dist/internal/chat/suggestion.js +12 -0
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/cn.js +3 -0
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -0
- package/dist/internal/feedback-action.js +34 -0
- package/dist/internal/i18n.d.ts +6 -0
- package/dist/internal/i18n.d.ts.map +1 -0
- package/dist/internal/i18n.js +18 -0
- package/dist/internal/languages.d.ts +7 -0
- package/dist/internal/languages.d.ts.map +1 -0
- package/dist/internal/languages.js +18 -0
- package/dist/internal/not-implemented.d.ts +2 -0
- package/dist/internal/not-implemented.d.ts.map +1 -0
- package/dist/internal/not-implemented.js +4 -0
- package/dist/internal/page-actions-client.d.ts +13 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -0
- package/dist/internal/page-actions-client.js +160 -0
- package/dist/internal/page-actions.d.ts +18 -0
- package/dist/internal/page-actions.d.ts.map +1 -0
- package/dist/internal/page-actions.js +4 -0
- package/dist/internal/provider-client.d.ts +9 -0
- package/dist/internal/provider-client.d.ts.map +1 -0
- package/dist/internal/provider-client.js +23 -0
- package/dist/internal/search.d.ts +5 -0
- package/dist/internal/search.d.ts.map +1 -0
- package/dist/internal/search.js +14 -0
- package/dist/internal/sidebar.d.ts +9 -0
- package/dist/internal/sidebar.d.ts.map +1 -0
- package/dist/internal/sidebar.js +38 -0
- package/dist/internal/table-of-contents.d.ts +9 -0
- package/dist/internal/table-of-contents.d.ts.map +1 -0
- package/dist/internal/table-of-contents.js +5 -0
- package/dist/internal/ui/button-group.d.ts +13 -0
- package/dist/internal/ui/button-group.d.ts.map +1 -0
- package/dist/internal/ui/button-group.js +26 -0
- package/dist/internal/ui/button.d.ts +12 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +33 -0
- package/dist/internal/ui/card.d.ts +6 -0
- package/dist/internal/ui/card.d.ts.map +1 -0
- package/dist/internal/ui/card.js +14 -0
- package/dist/internal/ui/collapsible.d.ts +6 -0
- package/dist/internal/ui/collapsible.d.ts.map +1 -0
- package/dist/internal/ui/collapsible.js +12 -0
- package/dist/internal/ui/drawer.d.ts +6 -0
- package/dist/internal/ui/drawer.d.ts.map +1 -0
- package/dist/internal/ui/drawer.js +13 -0
- package/dist/internal/ui/dropdown-menu.d.ts +22 -0
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/internal/ui/dropdown-menu.js +41 -0
- package/dist/internal/ui/input-group.d.ts +15 -0
- package/dist/internal/ui/input-group.d.ts.map +1 -0
- package/dist/internal/ui/input-group.js +44 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/kbd.d.ts +4 -0
- package/dist/internal/ui/kbd.d.ts.map +1 -0
- package/dist/internal/ui/kbd.js +8 -0
- package/dist/internal/ui/popover.d.ts +6 -0
- package/dist/internal/ui/popover.d.ts.map +1 -0
- package/dist/internal/ui/popover.js +13 -0
- package/dist/internal/ui/scroll-area.d.ts +5 -0
- package/dist/internal/ui/scroll-area.d.ts.map +1 -0
- package/dist/internal/ui/scroll-area.js +12 -0
- package/dist/internal/ui/separator.d.ts +4 -0
- package/dist/internal/ui/separator.d.ts.map +1 -0
- package/dist/internal/ui/separator.js +7 -0
- package/dist/internal/ui/sheet.d.ts +10 -0
- package/dist/internal/ui/sheet.d.ts.map +1 -0
- package/dist/internal/ui/sheet.js +24 -0
- package/dist/internal/ui/sonner.d.ts +3 -0
- package/dist/internal/ui/sonner.d.ts.map +1 -0
- package/dist/internal/ui/sonner.js +20 -0
- package/dist/internal/ui/spinner.d.ts +3 -0
- package/dist/internal/ui/spinner.d.ts.map +1 -0
- package/dist/internal/ui/spinner.js +6 -0
- package/dist/internal/ui/textarea.d.ts +3 -0
- package/dist/internal/ui/textarea.d.ts.map +1 -0
- package/dist/internal/ui/textarea.js +5 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/internal/use-mobile.d.ts +2 -0
- package/dist/internal/use-mobile.d.ts.map +1 -0
- package/dist/internal/use-mobile.js +16 -0
- package/dist/layout.d.ts +14 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +31 -0
- package/dist/mdx.d.ts +36 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +80 -0
- package/dist/pages/docs.d.ts +77 -0
- package/dist/pages/docs.d.ts.map +1 -0
- package/dist/pages/docs.js +92 -0
- package/dist/proxy.d.ts +37 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +162 -0
- package/dist/routes/chat.d.ts +14 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +242 -0
- package/dist/routes/llms.d.ts +51 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +59 -0
- package/dist/routes/search.d.ts +11 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +74 -0
- package/dist/routes/sitemap.d.ts +44 -0
- package/dist/routes/sitemap.d.ts.map +1 -0
- package/dist/routes/sitemap.js +168 -0
- package/dist/shiki-theme.d.ts +20 -0
- package/dist/shiki-theme.d.ts.map +1 -0
- package/dist/shiki-theme.js +110 -0
- package/dist/sidebar.d.ts +11 -0
- package/dist/sidebar.d.ts.map +1 -0
- package/dist/sidebar.js +16 -0
- package/dist/source.d.ts +174 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +129 -0
- package/dist/versions.d.ts +15 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +52 -0
- package/package.json +161 -9
- package/styles.css +556 -0
- package/template/_gitignore +29 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +24 -0
- package/template/app/[lang]/(home)/components/cta.tsx +19 -0
- package/template/app/[lang]/(home)/components/hero.tsx +27 -0
- package/template/app/[lang]/(home)/components/one-two-section.tsx +23 -0
- package/template/app/[lang]/(home)/components/templates.tsx +48 -0
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
- package/template/app/[lang]/(home)/layout.tsx +14 -0
- package/template/app/[lang]/(home)/page.tsx +126 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +19 -0
- package/template/app/[lang]/docs/layout.tsx +14 -0
- package/template/app/[lang]/layout.tsx +29 -0
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
- package/template/app/[lang]/llms.txt/route.ts +6 -0
- package/template/app/[lang]/og/[...slug]/background.png +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
- package/template/app/[lang]/rss.xml/route.ts +52 -0
- package/template/app/[lang]/sitemap.md/route.ts +9 -0
- package/template/app/actions/feedback/emotions.ts +18 -0
- package/template/app/actions/feedback/index.ts +45 -0
- package/template/app/api/chat/route.ts +8 -0
- package/template/app/api/search/route.ts +5 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/global.css +2 -0
- package/template/app/robots.ts +14 -0
- package/template/app/sitemap.ts +36 -0
- package/template/app/styles/geistdocs.css +595 -0
- package/template/components/geistdocs/chat.tsx +24 -0
- package/template/components/geistdocs/desktop-menu.tsx +52 -0
- package/template/components/geistdocs/docs-layout.tsx +20 -0
- package/template/components/geistdocs/feedback.tsx +139 -0
- package/template/components/geistdocs/footer.tsx +30 -0
- package/template/components/geistdocs/github-button.tsx +19 -0
- package/template/components/geistdocs/home-layout.tsx +46 -0
- package/template/components/geistdocs/language-selector.tsx +3 -0
- package/template/components/geistdocs/mdx-components.tsx +5 -0
- package/template/components/geistdocs/mobile-docs-bar.tsx +77 -0
- package/template/components/geistdocs/mobile-menu.tsx +150 -0
- package/template/components/geistdocs/navbar-logo.tsx +124 -0
- package/template/components/geistdocs/navbar.tsx +22 -0
- package/template/components/geistdocs/provider.tsx +31 -0
- package/template/components/geistdocs/rss-button.tsx +10 -0
- package/template/components/geistdocs/search.tsx +17 -0
- package/template/components/geistdocs/sidebar.tsx +128 -0
- package/template/components/geistdocs/theme-aware-image.tsx +22 -0
- package/template/components/geistdocs/theme-toggle.tsx +3 -0
- package/template/components/ui/badge.tsx +46 -0
- package/template/components/ui/button.tsx +60 -0
- package/template/components/ui/card.tsx +92 -0
- package/template/components/ui/command-prompt.tsx +488 -0
- package/template/components/ui/dialog.tsx +143 -0
- package/template/components/ui/input-group.tsx +170 -0
- package/template/components/ui/input.tsx +21 -0
- package/template/components/ui/navigation-menu.tsx +192 -0
- package/template/components/ui/popover.tsx +48 -0
- package/template/components/ui/separator.tsx +28 -0
- package/template/components/ui/sheet.tsx +139 -0
- package/template/components/ui/textarea.tsx +18 -0
- package/template/components.json +22 -0
- package/template/content/docs/ask-ai.cn.mdx +85 -0
- package/template/content/docs/ask-ai.mdx +89 -0
- package/template/content/docs/configuration.cn.mdx +155 -0
- package/template/content/docs/configuration.mdx +200 -0
- package/template/content/docs/deployment.cn.mdx +34 -0
- package/template/content/docs/deployment.mdx +40 -0
- package/template/content/docs/edit-on-github.cn.mdx +47 -0
- package/template/content/docs/edit-on-github.mdx +51 -0
- package/template/content/docs/env.cn.mdx +25 -0
- package/template/content/docs/env.mdx +29 -0
- package/template/content/docs/feedback.cn.mdx +85 -0
- package/template/content/docs/feedback.mdx +89 -0
- package/template/content/docs/getting-started.cn.mdx +86 -0
- package/template/content/docs/getting-started.mdx +107 -0
- package/template/content/docs/index.cn.mdx +57 -0
- package/template/content/docs/index.mdx +92 -0
- package/template/content/docs/internationalization.cn.mdx +111 -0
- package/template/content/docs/internationalization.mdx +122 -0
- package/template/content/docs/llms-txt.cn.mdx +72 -0
- package/template/content/docs/llms-txt.mdx +85 -0
- package/template/content/docs/md.cn.mdx +65 -0
- package/template/content/docs/md.mdx +81 -0
- package/template/content/docs/meta.json +23 -0
- package/template/content/docs/open-in-chat.cn.mdx +78 -0
- package/template/content/docs/open-in-chat.mdx +80 -0
- package/template/content/docs/provider.cn.mdx +70 -0
- package/template/content/docs/provider.mdx +74 -0
- package/template/content/docs/proxy.cn.mdx +96 -0
- package/template/content/docs/proxy.mdx +124 -0
- package/template/content/docs/rss.cn.mdx +104 -0
- package/template/content/docs/rss.mdx +108 -0
- package/template/content/docs/syntax.cn.mdx +416 -0
- package/template/content/docs/syntax.mdx +411 -0
- package/template/content/docs/theme-aware-image.mdx +57 -0
- package/template/content/docs/versioned-docs.cn.mdx +117 -0
- package/template/content/docs/versioned-docs.mdx +181 -0
- package/template/geistdocs.tsx +51 -0
- package/template/hooks/geistdocs/use-sidebar.ts +13 -0
- package/template/hooks/use-mobile.ts +19 -0
- package/template/lib/geistdocs/config.tsx +27 -0
- package/template/lib/geistdocs/fonts.ts +18 -0
- package/template/lib/geistdocs/i18n.ts +13 -0
- package/template/lib/geistdocs/md-tracking.ts +56 -0
- package/template/lib/geistdocs/source.ts +12 -0
- package/template/lib/utils.ts +6 -0
- package/template/next.config.ts +22 -0
- package/template/package.json +63 -0
- package/template/postcss.config.mjs +5 -0
- package/template/proxy.ts +18 -0
- package/template/source.config.ts +179 -0
- package/template/tsconfig.json +37 -0
- package/dist/index.js +0 -2
- /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { SiMarkdown } from "@icons-pack/react-simple-icons";
|
|
4
|
+
import { ThumbsUpIcon } from "lucide-react";
|
|
5
|
+
import { usePathname } from "next/navigation";
|
|
6
|
+
import {
|
|
7
|
+
type FormEventHandler,
|
|
8
|
+
useEffect,
|
|
9
|
+
useState,
|
|
10
|
+
useTransition,
|
|
11
|
+
} from "react";
|
|
12
|
+
import { sendFeedback } from "@/app/actions/feedback";
|
|
13
|
+
import { emotions } from "@/app/actions/feedback/emotions";
|
|
14
|
+
import { cn } from "@/lib/utils";
|
|
15
|
+
import { Button } from "../ui/button";
|
|
16
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
17
|
+
import { Textarea } from "../ui/textarea";
|
|
18
|
+
|
|
19
|
+
type Emotion = (typeof emotions)[number]["name"];
|
|
20
|
+
|
|
21
|
+
export interface Feedback {
|
|
22
|
+
emotion: Emotion;
|
|
23
|
+
message: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const Feedback = () => {
|
|
28
|
+
const url = usePathname();
|
|
29
|
+
const [submitted, setSubmitted] = useState(false);
|
|
30
|
+
const [emotion, setEmotion] = useState<Emotion | null>(null);
|
|
31
|
+
const [message, setMessage] = useState("");
|
|
32
|
+
const [isPending, startTransition] = useTransition();
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const item = localStorage.getItem(`docs-feedback-${url}`);
|
|
36
|
+
|
|
37
|
+
if (!item) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
setSubmitted(true);
|
|
42
|
+
}, [url]);
|
|
43
|
+
|
|
44
|
+
const submit: FormEventHandler<HTMLFormElement> = (e) => {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
|
|
47
|
+
if (!emotion) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
startTransition(() => {
|
|
52
|
+
const feedback: Feedback = {
|
|
53
|
+
emotion,
|
|
54
|
+
message,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
sendFeedback(url, feedback).then(() => {
|
|
58
|
+
setSubmitted(true);
|
|
59
|
+
setMessage("");
|
|
60
|
+
setEmotion(null);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
e?.preventDefault();
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Popover>
|
|
69
|
+
<PopoverTrigger asChild>
|
|
70
|
+
<button
|
|
71
|
+
className="flex items-center gap-1.5 text-gray-800 text-sm transition-colors hover:text-gray-1000"
|
|
72
|
+
type="button"
|
|
73
|
+
>
|
|
74
|
+
<ThumbsUpIcon className="size-3.5" />
|
|
75
|
+
<span>Give feedback</span>
|
|
76
|
+
</button>
|
|
77
|
+
</PopoverTrigger>
|
|
78
|
+
<PopoverContent className="overflow-hidden p-0">
|
|
79
|
+
<div className="overflow-visible">
|
|
80
|
+
{submitted ? (
|
|
81
|
+
<div className="flex flex-col items-center gap-3 rounded-xl bg-background-200 px-3 py-6 text-center text-sm">
|
|
82
|
+
<p>Thank you for your feedback!</p>
|
|
83
|
+
</div>
|
|
84
|
+
) : (
|
|
85
|
+
<form className="flex flex-col" onSubmit={submit}>
|
|
86
|
+
<div className="p-2">
|
|
87
|
+
<Textarea
|
|
88
|
+
autoFocus
|
|
89
|
+
className="max-h-48 min-h-24 shadow-none"
|
|
90
|
+
onChange={(e) => setMessage(e.target.value)}
|
|
91
|
+
onKeyDown={(e) => {
|
|
92
|
+
if (!e.shiftKey && e.key === "Enter") {
|
|
93
|
+
e.currentTarget.form?.requestSubmit();
|
|
94
|
+
}
|
|
95
|
+
}}
|
|
96
|
+
placeholder="Leave your feedback..."
|
|
97
|
+
required
|
|
98
|
+
value={message}
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
<div className="flex items-center justify-end gap-1 px-2 text-gray-800">
|
|
102
|
+
<SiMarkdown className="inline size-3" />
|
|
103
|
+
<p className="text-xs"> supported</p>
|
|
104
|
+
</div>
|
|
105
|
+
<div className="mt-2 flex items-center justify-between border-t bg-background-200 p-2">
|
|
106
|
+
<div className="flex items-center gap-px">
|
|
107
|
+
{emotions.map((e) => (
|
|
108
|
+
<Button
|
|
109
|
+
className={cn(
|
|
110
|
+
"text-gray-800 hover:text-gray-1000",
|
|
111
|
+
emotion === e.name ? "bg-gray-100 text-gray-1000" : ""
|
|
112
|
+
)}
|
|
113
|
+
key={e.name}
|
|
114
|
+
onClick={() => setEmotion(e.name)}
|
|
115
|
+
size="sm"
|
|
116
|
+
type="button"
|
|
117
|
+
variant="ghost"
|
|
118
|
+
>
|
|
119
|
+
{e.emoji}
|
|
120
|
+
<span className="sr-only">{e.name}</span>
|
|
121
|
+
</Button>
|
|
122
|
+
))}
|
|
123
|
+
</div>
|
|
124
|
+
<Button
|
|
125
|
+
disabled={isPending || !emotion || !message}
|
|
126
|
+
size="sm"
|
|
127
|
+
type="submit"
|
|
128
|
+
variant="default"
|
|
129
|
+
>
|
|
130
|
+
Send
|
|
131
|
+
</Button>
|
|
132
|
+
</div>
|
|
133
|
+
</form>
|
|
134
|
+
)}
|
|
135
|
+
</div>
|
|
136
|
+
</PopoverContent>
|
|
137
|
+
</Popover>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SiVercel } from "@icons-pack/react-simple-icons";
|
|
2
|
+
import { GitHubButton } from "./github-button";
|
|
3
|
+
import { LanguageSelector } from "./language-selector";
|
|
4
|
+
import { RSSButton } from "./rss-button";
|
|
5
|
+
import { ThemeToggle } from "./theme-toggle";
|
|
6
|
+
|
|
7
|
+
interface FooterProps {
|
|
8
|
+
copyright?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Footer = ({
|
|
12
|
+
copyright = `Copyright Vercel ${new Date().getFullYear()}. All rights reserved.`,
|
|
13
|
+
}: FooterProps) => (
|
|
14
|
+
<footer className="border-t px-4 py-5 md:px-6">
|
|
15
|
+
<div className="mx-auto flex max-w-[1448px] flex-col items-center justify-between gap-4 sm:flex-row">
|
|
16
|
+
<div className="flex items-center gap-2">
|
|
17
|
+
<SiVercel className="size-4 shrink-0" />
|
|
18
|
+
<p className="text-center text-gray-800 text-sm sm:text-left">
|
|
19
|
+
{copyright}
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
<div className="flex items-center gap-2">
|
|
23
|
+
<LanguageSelector />
|
|
24
|
+
<RSSButton />
|
|
25
|
+
<GitHubButton />
|
|
26
|
+
<ThemeToggle />
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</footer>
|
|
30
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SiGithub } from "@icons-pack/react-simple-icons";
|
|
2
|
+
import { github } from "@/geistdocs";
|
|
3
|
+
import { Button } from "../ui/button";
|
|
4
|
+
|
|
5
|
+
export const GitHubButton = () => {
|
|
6
|
+
if (!(github.owner && github.repo)) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const url = `https://github.com/${github.owner}/${github.repo}`;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Button asChild size="icon-sm" type="button" variant="ghost">
|
|
14
|
+
<a href={url} rel="noopener" target="_blank">
|
|
15
|
+
<SiGithub className="size-4" />
|
|
16
|
+
</a>
|
|
17
|
+
</Button>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DocsLayout as FumadocsDocsLayout } from "fumadocs-ui/layouts/docs";
|
|
2
|
+
import type { ComponentProps, CSSProperties, ReactNode } from "react";
|
|
3
|
+
import { i18n } from "@/lib/geistdocs/i18n";
|
|
4
|
+
import { Folder, Item, Separator, Sidebar } from "./sidebar";
|
|
5
|
+
|
|
6
|
+
interface HomeLayoutProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
tree: ComponentProps<typeof FumadocsDocsLayout>["tree"];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const HomeLayout = ({ tree, children }: HomeLayoutProps) => (
|
|
12
|
+
<FumadocsDocsLayout
|
|
13
|
+
containerProps={{
|
|
14
|
+
className: "p-0! max-w-full mx-0 [&_[data-sidebar-placeholder]]:hidden",
|
|
15
|
+
style: {
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexDirection: "column",
|
|
18
|
+
"--fd-docs-row-1": "4rem",
|
|
19
|
+
} as CSSProperties,
|
|
20
|
+
}}
|
|
21
|
+
i18n={i18n}
|
|
22
|
+
nav={{
|
|
23
|
+
enabled: false,
|
|
24
|
+
}}
|
|
25
|
+
searchToggle={{
|
|
26
|
+
enabled: false,
|
|
27
|
+
}}
|
|
28
|
+
sidebar={{
|
|
29
|
+
className: "md:hidden",
|
|
30
|
+
collapsible: false,
|
|
31
|
+
component: <Sidebar />,
|
|
32
|
+
components: {
|
|
33
|
+
Folder,
|
|
34
|
+
Item,
|
|
35
|
+
Separator,
|
|
36
|
+
},
|
|
37
|
+
}}
|
|
38
|
+
tabMode="auto"
|
|
39
|
+
themeSwitch={{
|
|
40
|
+
enabled: false,
|
|
41
|
+
}}
|
|
42
|
+
tree={tree}
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
</FumadocsDocsLayout>
|
|
46
|
+
);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { IconFileText } from "@vercel/geistdocs/assets/icons/icon-file-text";
|
|
4
|
+
import { IconMenuAlt } from "@vercel/geistdocs/assets/icons/icon-menu-alt";
|
|
5
|
+
import { useGeistdocsSidebar } from "@vercel/geistdocs/sidebar";
|
|
6
|
+
import type { TableOfContents } from "fumadocs-core/toc";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import {
|
|
9
|
+
Sheet,
|
|
10
|
+
SheetContent,
|
|
11
|
+
SheetDescription,
|
|
12
|
+
SheetHeader,
|
|
13
|
+
} from "@/components/ui/sheet";
|
|
14
|
+
import { cn } from "@/lib/utils";
|
|
15
|
+
|
|
16
|
+
interface MobileDocsBarProps {
|
|
17
|
+
toc?: TableOfContents;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const MobileDocsBar = ({ toc }: MobileDocsBarProps) => {
|
|
21
|
+
const { setIsOpen: setSidebarOpen } = useGeistdocsSidebar();
|
|
22
|
+
const [tocOpen, setTocOpen] = useState(false);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<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">
|
|
26
|
+
<button
|
|
27
|
+
className="flex items-center gap-3 text-base text-gray-1000"
|
|
28
|
+
onClick={() => setSidebarOpen(true)}
|
|
29
|
+
type="button"
|
|
30
|
+
>
|
|
31
|
+
<IconMenuAlt size={16} />
|
|
32
|
+
Menu
|
|
33
|
+
</button>
|
|
34
|
+
|
|
35
|
+
{toc && toc.length > 0 && (
|
|
36
|
+
<>
|
|
37
|
+
<button
|
|
38
|
+
aria-label="Table of contents"
|
|
39
|
+
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"
|
|
40
|
+
onClick={() => setTocOpen(true)}
|
|
41
|
+
type="button"
|
|
42
|
+
>
|
|
43
|
+
<IconFileText size={16} />
|
|
44
|
+
</button>
|
|
45
|
+
|
|
46
|
+
<Sheet onOpenChange={setTocOpen} open={tocOpen}>
|
|
47
|
+
<SheetContent className="w-72 gap-0" side="right">
|
|
48
|
+
<SheetHeader>
|
|
49
|
+
<SheetDescription className="sr-only">
|
|
50
|
+
Table of contents for the current page.
|
|
51
|
+
</SheetDescription>
|
|
52
|
+
</SheetHeader>
|
|
53
|
+
<nav className="flex-1 overflow-y-auto px-4 pb-4">
|
|
54
|
+
<ul className="space-y-1">
|
|
55
|
+
{toc.map((item) => (
|
|
56
|
+
<li key={item.url}>
|
|
57
|
+
<a
|
|
58
|
+
className={cn(
|
|
59
|
+
"block rounded-md py-1.5 text-gray-900 text-sm transition-colors hover:text-gray-1000",
|
|
60
|
+
item.depth > 2 && "pl-4"
|
|
61
|
+
)}
|
|
62
|
+
href={item.url}
|
|
63
|
+
onClick={() => setTocOpen(false)}
|
|
64
|
+
>
|
|
65
|
+
{item.title}
|
|
66
|
+
</a>
|
|
67
|
+
</li>
|
|
68
|
+
))}
|
|
69
|
+
</ul>
|
|
70
|
+
</nav>
|
|
71
|
+
</SheetContent>
|
|
72
|
+
</Sheet>
|
|
73
|
+
</>
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { IconArrowUpRight } from "@vercel/geistdocs/assets/icons/icon-arrow-up-right";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import { nav } from "@/geistdocs";
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
8
|
+
import { SearchButton } from "./search";
|
|
9
|
+
|
|
10
|
+
function NavLink({
|
|
11
|
+
href,
|
|
12
|
+
external,
|
|
13
|
+
onClick,
|
|
14
|
+
children,
|
|
15
|
+
}: {
|
|
16
|
+
href: string;
|
|
17
|
+
external?: boolean;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
<Link
|
|
23
|
+
className="group flex items-center justify-between rounded-md p-3 text-gray-900 transition-colors hover:bg-gray-100 hover:text-gray-1000"
|
|
24
|
+
href={href}
|
|
25
|
+
onClick={onClick}
|
|
26
|
+
rel={external ? "noopener" : undefined}
|
|
27
|
+
target={external ? "_blank" : undefined}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
{external && (
|
|
31
|
+
<IconArrowUpRight
|
|
32
|
+
className="text-gray-900 group-hover:text-gray-1000"
|
|
33
|
+
size={16}
|
|
34
|
+
/>
|
|
35
|
+
)}
|
|
36
|
+
</Link>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function MobileMenuButton({
|
|
41
|
+
expanded,
|
|
42
|
+
onClick,
|
|
43
|
+
}: {
|
|
44
|
+
expanded: boolean;
|
|
45
|
+
onClick: () => void;
|
|
46
|
+
}) {
|
|
47
|
+
return (
|
|
48
|
+
<button
|
|
49
|
+
aria-expanded={expanded}
|
|
50
|
+
aria-label={expanded ? "Close menu" : "Open menu"}
|
|
51
|
+
className="relative flex size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100 lg:hidden"
|
|
52
|
+
onClick={onClick}
|
|
53
|
+
type="button"
|
|
54
|
+
>
|
|
55
|
+
<span className="flex flex-col items-center justify-center gap-[5px]">
|
|
56
|
+
<span
|
|
57
|
+
className={cn(
|
|
58
|
+
"block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150",
|
|
59
|
+
expanded && "translate-y-[3.25px] rotate-45"
|
|
60
|
+
)}
|
|
61
|
+
/>
|
|
62
|
+
<span
|
|
63
|
+
className={cn(
|
|
64
|
+
"block h-[1.5px] w-3.5 bg-gray-1000 transition-all duration-150",
|
|
65
|
+
expanded && "-translate-y-[3.25px] -rotate-45"
|
|
66
|
+
)}
|
|
67
|
+
/>
|
|
68
|
+
</span>
|
|
69
|
+
</button>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const MobileMenu = () => {
|
|
74
|
+
const [show, setShow] = useState(false);
|
|
75
|
+
|
|
76
|
+
// Close on route change
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
setShow(false);
|
|
79
|
+
}, []);
|
|
80
|
+
|
|
81
|
+
// Close on escape
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
const handleEscape = (e: KeyboardEvent) => {
|
|
84
|
+
if (e.key === "Escape" && show) {
|
|
85
|
+
setShow(false);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
document.addEventListener("keydown", handleEscape);
|
|
89
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
90
|
+
}, [show]);
|
|
91
|
+
|
|
92
|
+
// Lock scroll when open
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
document.body.style.overflow = show ? "hidden" : "";
|
|
95
|
+
return () => {
|
|
96
|
+
document.body.style.overflow = "";
|
|
97
|
+
};
|
|
98
|
+
}, [show]);
|
|
99
|
+
|
|
100
|
+
const close = () => setShow(false);
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<>
|
|
104
|
+
<MobileMenuButton expanded={show} onClick={() => setShow(!show)} />
|
|
105
|
+
|
|
106
|
+
{/* Backdrop */}
|
|
107
|
+
{/* biome-ignore lint/a11y/noNoninteractiveElementInteractions: backdrop dismiss */}
|
|
108
|
+
{/* biome-ignore lint/a11y/noStaticElementInteractions: backdrop dismiss */}
|
|
109
|
+
{/* biome-ignore lint/a11y/useKeyWithClickEvents: backdrop dismiss */}
|
|
110
|
+
<div
|
|
111
|
+
className={cn(
|
|
112
|
+
"fixed inset-0 top-16 z-40 bg-background-200 backdrop-blur-sm transition-opacity duration-200",
|
|
113
|
+
show
|
|
114
|
+
? "pointer-events-auto opacity-100"
|
|
115
|
+
: "pointer-events-none opacity-0"
|
|
116
|
+
)}
|
|
117
|
+
onClick={close}
|
|
118
|
+
/>
|
|
119
|
+
|
|
120
|
+
{/* Popover */}
|
|
121
|
+
<div
|
|
122
|
+
className={cn(
|
|
123
|
+
"fixed inset-x-0 top-16 bottom-0 z-40 overflow-y-auto bg-background-200 px-2 transition-all duration-200",
|
|
124
|
+
show
|
|
125
|
+
? "translate-y-0 opacity-100"
|
|
126
|
+
: "pointer-events-none -translate-y-2 opacity-0"
|
|
127
|
+
)}
|
|
128
|
+
>
|
|
129
|
+
{/* Search */}
|
|
130
|
+
<div className="p-4">
|
|
131
|
+
<SearchButton className="w-full" onClick={close} />
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
{/* Navigation */}
|
|
135
|
+
<nav className="px-1">
|
|
136
|
+
{nav.map(({ label, href }) => (
|
|
137
|
+
<NavLink
|
|
138
|
+
external={href.startsWith("http")}
|
|
139
|
+
href={href}
|
|
140
|
+
key={href}
|
|
141
|
+
onClick={close}
|
|
142
|
+
>
|
|
143
|
+
{label}
|
|
144
|
+
</NavLink>
|
|
145
|
+
))}
|
|
146
|
+
</nav>
|
|
147
|
+
</div>
|
|
148
|
+
</>
|
|
149
|
+
);
|
|
150
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { IconSlashForward } from "@vercel/geistdocs/assets/icons/icon-slash-forward";
|
|
4
|
+
import { LogoAiElements } from "@vercel/geistdocs/assets/logos/logo-ai-elements";
|
|
5
|
+
import { LogoAiSdk } from "@vercel/geistdocs/assets/logos/logo-ai-sdk";
|
|
6
|
+
import { LogoChatSdk } from "@vercel/geistdocs/assets/logos/logo-chat-sdk";
|
|
7
|
+
import { LogoFlagsSdk } from "@vercel/geistdocs/assets/logos/logo-flags-sdk";
|
|
8
|
+
import { LogoIconVercel } from "@vercel/geistdocs/assets/logos/logo-icon-vercel";
|
|
9
|
+
import { LogoStreamdown } from "@vercel/geistdocs/assets/logos/logo-streamdown";
|
|
10
|
+
import { LogoVercelOss } from "@vercel/geistdocs/assets/logos/logo-vercel-oss";
|
|
11
|
+
import { LogoWorkflowSdk } from "@vercel/geistdocs/assets/logos/logo-workflow-sdk";
|
|
12
|
+
import Link from "next/link";
|
|
13
|
+
import type { ComponentType, ReactNode } from "react";
|
|
14
|
+
import {
|
|
15
|
+
NavigationMenu,
|
|
16
|
+
NavigationMenuContent,
|
|
17
|
+
NavigationMenuItem,
|
|
18
|
+
NavigationMenuLink,
|
|
19
|
+
NavigationMenuList,
|
|
20
|
+
NavigationMenuTrigger,
|
|
21
|
+
} from "@/components/ui/navigation-menu";
|
|
22
|
+
import { cn } from "@/lib/utils";
|
|
23
|
+
|
|
24
|
+
const OSS_PRODUCT_LINKS: {
|
|
25
|
+
href: string;
|
|
26
|
+
logo: ComponentType<{ height: number }>;
|
|
27
|
+
height: number;
|
|
28
|
+
}[] = [
|
|
29
|
+
{ href: "https://ai-sdk.dev/", logo: LogoAiSdk, height: 12 },
|
|
30
|
+
{ href: "https://flags-sdk.dev/", logo: LogoFlagsSdk, height: 20 },
|
|
31
|
+
{ href: "https://chat-sdk.dev/", logo: LogoChatSdk, height: 20 },
|
|
32
|
+
{ href: "https://elements.ai-sdk.dev/", logo: LogoAiElements, height: 12 },
|
|
33
|
+
{ href: "https://workflow-sdk.dev/", logo: LogoWorkflowSdk, height: 12 },
|
|
34
|
+
{ href: "https://streamdown.ai/", logo: LogoStreamdown, height: 13 },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
type NavbarLogoProps = {
|
|
38
|
+
className?: string;
|
|
39
|
+
/** Where the logo links to (defaults to "/") */
|
|
40
|
+
href?: string;
|
|
41
|
+
} & (
|
|
42
|
+
| {
|
|
43
|
+
variant: "oss";
|
|
44
|
+
/** Logo shown in the trigger (e.g. LogoAiSdk) */
|
|
45
|
+
logo: ReactNode;
|
|
46
|
+
}
|
|
47
|
+
| {
|
|
48
|
+
variant?: "standard";
|
|
49
|
+
/** Logo shown after the slash (e.g. product name) */
|
|
50
|
+
logo: ReactNode;
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
export function NavbarLogo({
|
|
55
|
+
className,
|
|
56
|
+
href = "/",
|
|
57
|
+
...props
|
|
58
|
+
}: NavbarLogoProps) {
|
|
59
|
+
const isOss = props.variant === "oss";
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<span className={cn("flex items-center gap-2.5", className)}>
|
|
63
|
+
<Link
|
|
64
|
+
className="text-gray-1000"
|
|
65
|
+
href={isOss ? "https://vercel.com/oss" : "https://vercel.com/"}
|
|
66
|
+
rel="noopener"
|
|
67
|
+
target="_blank"
|
|
68
|
+
>
|
|
69
|
+
{isOss ? (
|
|
70
|
+
<>
|
|
71
|
+
<LogoIconVercel className="sm:hidden" size={20} />
|
|
72
|
+
<LogoVercelOss className="hidden sm:block" size={18} />
|
|
73
|
+
</>
|
|
74
|
+
) : (
|
|
75
|
+
<LogoIconVercel size={20} />
|
|
76
|
+
)}
|
|
77
|
+
</Link>
|
|
78
|
+
<div className="w-4 text-center text-gray-alpha-400 text-lg dark:text-gray-600">
|
|
79
|
+
<IconSlashForward />
|
|
80
|
+
</div>
|
|
81
|
+
{isOss ? (
|
|
82
|
+
<NavigationMenu viewportClassName="-left-5 top-4">
|
|
83
|
+
<NavigationMenuList>
|
|
84
|
+
<NavigationMenuItem className="flex items-center">
|
|
85
|
+
<NavigationMenuTrigger className="-m-3 flex items-center gap-1.5 p-3">
|
|
86
|
+
<Link
|
|
87
|
+
className="flex items-center text-gray-1000"
|
|
88
|
+
href={href}
|
|
89
|
+
onClick={(e) => e.stopPropagation()}
|
|
90
|
+
>
|
|
91
|
+
{props.logo}
|
|
92
|
+
</Link>
|
|
93
|
+
</NavigationMenuTrigger>
|
|
94
|
+
<NavigationMenuContent>
|
|
95
|
+
<ul className="grid w-[200px] gap-0.5 p-2">
|
|
96
|
+
{OSS_PRODUCT_LINKS.map(
|
|
97
|
+
({ href, logo: ProductLogo, height }) => (
|
|
98
|
+
<li key={href}>
|
|
99
|
+
<NavigationMenuLink asChild>
|
|
100
|
+
<Link
|
|
101
|
+
className="flex h-10 items-center gap-3 rounded-md px-3 py-2.5 text-gray-1000 text-sm outline-none transition-colors hover:bg-gray-100"
|
|
102
|
+
href={href}
|
|
103
|
+
rel="noopener"
|
|
104
|
+
target="_blank"
|
|
105
|
+
>
|
|
106
|
+
<ProductLogo height={height} />
|
|
107
|
+
</Link>
|
|
108
|
+
</NavigationMenuLink>
|
|
109
|
+
</li>
|
|
110
|
+
)
|
|
111
|
+
)}
|
|
112
|
+
</ul>
|
|
113
|
+
</NavigationMenuContent>
|
|
114
|
+
</NavigationMenuItem>
|
|
115
|
+
</NavigationMenuList>
|
|
116
|
+
</NavigationMenu>
|
|
117
|
+
) : (
|
|
118
|
+
<Link className="flex items-center text-gray-1000" href={href}>
|
|
119
|
+
{props.logo}
|
|
120
|
+
</Link>
|
|
121
|
+
)}
|
|
122
|
+
</span>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { basePath, Logo, nav, suggestions } from "@/geistdocs";
|
|
2
|
+
import { Chat } from "./chat";
|
|
3
|
+
import { DesktopMenu } from "./desktop-menu";
|
|
4
|
+
import { MobileMenu } from "./mobile-menu";
|
|
5
|
+
import { NavbarLogo } from "./navbar-logo";
|
|
6
|
+
import { SearchButton } from "./search";
|
|
7
|
+
|
|
8
|
+
export const Navbar = () => (
|
|
9
|
+
<header className="sticky top-0 z-40 flex h-16 justify-center border-b bg-background-200">
|
|
10
|
+
<div className="mx-auto flex w-full max-w-[1448px] justify-between px-2">
|
|
11
|
+
<div className="flex select-none flex-row items-center">
|
|
12
|
+
<NavbarLogo className="ml-4" logo={<Logo />} variant="oss" />
|
|
13
|
+
<DesktopMenu className="hidden pl-6 lg:flex" items={nav} />
|
|
14
|
+
</div>
|
|
15
|
+
<div className="mr-4 flex flex-row items-center justify-end gap-2">
|
|
16
|
+
<SearchButton className="hidden lg:flex" />
|
|
17
|
+
<Chat basePath={basePath} suggestions={suggestions} />
|
|
18
|
+
<MobileMenu />
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</header>
|
|
22
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Analytics } from "@vercel/analytics/next";
|
|
4
|
+
import { GeistdocsProvider as PackageProvider } from "@vercel/geistdocs/layout";
|
|
5
|
+
import { SpeedInsights } from "@vercel/speed-insights/next";
|
|
6
|
+
import type { ComponentProps } from "react";
|
|
7
|
+
import { config } from "@/lib/geistdocs/config";
|
|
8
|
+
|
|
9
|
+
type GeistdocsProviderProps = Omit<
|
|
10
|
+
ComponentProps<typeof PackageProvider>,
|
|
11
|
+
"config"
|
|
12
|
+
> & {
|
|
13
|
+
basePath: string | undefined;
|
|
14
|
+
className?: string;
|
|
15
|
+
lang?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const GeistdocsProvider = ({
|
|
19
|
+
basePath: _basePath,
|
|
20
|
+
className: _className,
|
|
21
|
+
lang,
|
|
22
|
+
...props
|
|
23
|
+
}: GeistdocsProviderProps) => {
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<PackageProvider config={config} lang={lang} {...props} />
|
|
27
|
+
<Analytics />
|
|
28
|
+
<SpeedInsights />
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RssIcon } from "lucide-react";
|
|
2
|
+
import { Button } from "../ui/button";
|
|
3
|
+
|
|
4
|
+
export const RSSButton = () => (
|
|
5
|
+
<Button asChild size="icon-sm" type="button" variant="ghost">
|
|
6
|
+
<a href="/rss.xml" rel="noopener" target="_blank">
|
|
7
|
+
<RssIcon className="size-4" />
|
|
8
|
+
</a>
|
|
9
|
+
</Button>
|
|
10
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { SearchButton as PackageSearchButton } from "@vercel/geistdocs/controls";
|
|
4
|
+
import type { ComponentProps } from "react";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
type SearchButtonProps = ComponentProps<typeof PackageSearchButton>;
|
|
8
|
+
|
|
9
|
+
export const SearchButton = ({ className, ...props }: SearchButtonProps) => (
|
|
10
|
+
<PackageSearchButton
|
|
11
|
+
className={cn(
|
|
12
|
+
"group h-10 justify-between gap-8 pr-1.5 font-normal text-gray-800 shadow-none lg:h-8 lg:w-[150px] lg:bg-background-200 hover:lg:bg-background-200 [&_[data-slot=kbd]]:transition-colors group-hover:[&_[data-slot=kbd]]:text-gray-1000",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|