@vercel/geistdocs 1.3.0-canary.88e35b7 → 1.3.1
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/{template/components/geistcn-fallbacks/geistcn-assets/icons/index.tsx → dist/assets/icons/index.js} +0 -1
- package/dist/assets/logos/index.d.ts +15 -0
- package/dist/assets/logos/index.d.ts.map +1 -0
- package/{template/components/geistcn-fallbacks/geistcn-assets/logos/index.tsx → dist/assets/logos/index.js} +2 -1
- 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-nextjs.d.ts +8 -0
- package/dist/assets/logos/logo-nextjs.d.ts.map +1 -0
- package/dist/assets/logos/logo-nextjs.js +7 -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-svelte-kit.d.ts +5 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts.map +1 -0
- package/dist/assets/logos/logo-svelte-kit.js +4 -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 +2 -5
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +2 -0
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +2 -0
- package/dist/components/card.d.ts +2 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +2 -0
- package/dist/components/code-block-tabs.js +3 -3
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +7 -3
- package/dist/components/collapsible.d.ts +2 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +3 -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/dialog.d.ts +13 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +35 -0
- package/dist/components/drawer.d.ts +2 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +3 -0
- package/dist/components/dropdown-menu.d.ts +2 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +3 -0
- package/dist/components/input-group.d.ts +2 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +3 -0
- package/dist/components/input.d.ts +2 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +2 -0
- package/dist/components/kbd.d.ts +2 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +2 -0
- package/dist/components/navigation-menu.d.ts +2 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +3 -0
- package/dist/components/popover.d.ts +2 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +3 -0
- package/dist/components/scroll-area.d.ts +2 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +3 -0
- package/dist/components/separator.d.ts +2 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +3 -0
- package/dist/components/sheet.d.ts +2 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +3 -0
- package/dist/components/sonner.d.ts +2 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +3 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +2 -0
- package/dist/components/textarea.d.ts +2 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +2 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +3 -0
- package/dist/config.d.ts +66 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/controls.js +4 -4
- package/dist/footer.d.ts +8 -0
- package/dist/footer.d.ts.map +1 -0
- package/dist/footer.js +6 -0
- package/dist/home-layout.d.ts +11 -0
- package/dist/home-layout.d.ts.map +1 -0
- package/dist/home-layout.js +31 -0
- package/dist/internal/chat/conversation.js +1 -1
- package/dist/internal/chat/message.js +1 -1
- package/dist/internal/chat/prompt-input.js +1 -1
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +6 -5
- package/dist/internal/chat/sources.js +1 -1
- package/dist/internal/config-context.d.ts +10 -0
- package/dist/internal/config-context.d.ts.map +1 -0
- package/dist/internal/config-context.js +15 -0
- package/dist/internal/footer/github-button.d.ts +7 -0
- package/dist/internal/footer/github-button.d.ts.map +1 -0
- package/dist/internal/footer/github-button.js +10 -0
- package/dist/internal/footer/rss-button.d.ts +2 -0
- package/dist/internal/footer/rss-button.d.ts.map +1 -0
- package/dist/internal/footer/rss-button.js +4 -0
- package/dist/internal/localized-link.d.ts +8 -0
- package/dist/internal/localized-link.d.ts.map +1 -0
- package/dist/internal/localized-link.js +13 -0
- package/dist/internal/navbar/desktop-menu.d.ts +10 -0
- package/dist/internal/navbar/desktop-menu.d.ts.map +1 -0
- package/dist/internal/navbar/desktop-menu.js +11 -0
- package/dist/internal/navbar/mobile-menu.d.ts +7 -0
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -0
- package/dist/internal/navbar/mobile-menu.js +44 -0
- package/dist/internal/navbar/navbar-logo.d.ts +16 -0
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -0
- package/dist/internal/navbar/navbar-logo.js +30 -0
- package/dist/internal/page-actions-client.d.ts +1 -2
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +28 -11
- package/dist/internal/page-visibility.d.ts +18 -0
- package/dist/internal/page-visibility.d.ts.map +1 -0
- package/dist/internal/page-visibility.js +24 -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 +24 -0
- package/dist/internal/sidebar.d.ts +4 -1
- package/dist/internal/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +8 -7
- 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.js +2 -2
- package/dist/internal/ui/button.d.ts +1 -1
- package/dist/internal/ui/button.d.ts.map +1 -1
- package/dist/internal/ui/button.js +7 -7
- package/dist/internal/ui/card.js +1 -1
- package/dist/internal/ui/drawer.js +1 -1
- package/dist/internal/ui/dropdown-menu.js +7 -7
- package/dist/internal/ui/input-group.js +2 -2
- package/dist/internal/ui/input.js +1 -1
- package/dist/internal/ui/kbd.js +1 -1
- package/dist/internal/ui/navigation-menu.d.ts +17 -0
- package/dist/internal/ui/navigation-menu.d.ts.map +1 -0
- package/dist/internal/ui/navigation-menu.js +38 -0
- package/dist/internal/ui/popover.js +1 -1
- package/dist/internal/ui/scroll-area.js +2 -2
- package/dist/internal/ui/separator.js +1 -1
- package/dist/internal/ui/sheet.js +4 -4
- package/dist/internal/ui/sonner.js +3 -3
- package/dist/internal/ui/textarea.js +1 -1
- package/dist/internal/ui/tooltip.js +1 -1
- package/dist/layout.d.ts +4 -8
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +26 -44
- package/dist/mdx.d.ts +55 -24
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +9 -46
- package/dist/mobile-docs-bar.d.ts +7 -0
- package/dist/mobile-docs-bar.d.ts.map +1 -0
- package/dist/mobile-docs-bar.js +13 -0
- package/dist/navbar.d.ts +7 -0
- package/dist/navbar.d.ts.map +1 -0
- package/dist/navbar.js +10 -0
- package/dist/pages/docs.d.ts +33 -5
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +57 -22
- package/dist/proxy.d.ts +24 -8
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +116 -36
- package/dist/routes/agents.d.ts +21 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +201 -0
- package/dist/routes/chat.d.ts +11 -5
- package/dist/routes/chat.d.ts.map +1 -1
- package/dist/routes/chat.js +386 -65
- package/dist/routes/llms.d.ts +29 -10
- package/dist/routes/llms.d.ts.map +1 -1
- package/dist/routes/llms.js +80 -9
- package/dist/routes/search.d.ts +8 -5
- package/dist/routes/search.d.ts.map +1 -1
- package/dist/routes/search.js +52 -4
- package/dist/routes/sitemap.d.ts +15 -3
- package/dist/routes/sitemap.d.ts.map +1 -1
- package/dist/routes/sitemap.js +32 -6
- 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-config.d.ts +68 -0
- package/dist/source-config.d.ts.map +1 -0
- package/dist/source-config.js +161 -0
- package/dist/source.d.ts +155 -4
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +73 -3
- package/dist/versions.d.ts +45 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +79 -0
- package/package.json +142 -9
- package/source-config.js +174 -0
- package/styles.css +465 -102
- package/template/AGENTS.md +95 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +1 -3
- package/template/app/[lang]/(home)/components/hero.tsx +2 -2
- package/template/app/[lang]/(home)/components/one-two-section.tsx +1 -3
- package/template/app/[lang]/(home)/components/templates.tsx +3 -5
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +1 -1
- package/template/app/[lang]/(home)/layout.tsx +4 -3
- package/template/app/[lang]/(home)/page.tsx +2 -2
- package/template/app/[lang]/agents.md/route.ts +6 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +4 -1
- package/template/app/[lang]/layout.tsx +6 -6
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +1 -1
- package/template/app/[lang]/llms.txt/route.ts +1 -1
- package/template/app/[lang]/sitemap.md/route.ts +2 -2
- package/template/app/api/chat/route.ts +12 -1
- package/template/app/api/search/route.ts +2 -2
- package/template/app/styles/geistdocs.css +151 -109
- package/template/components/ui/badge.tsx +5 -5
- package/template/components/ui/button.tsx +7 -7
- package/template/components/ui/command-prompt.tsx +2 -2
- package/template/content/docs/agent-readiness.mdx +103 -0
- package/template/content/docs/ask-ai.mdx +61 -5
- package/template/content/docs/configuration.cn.mdx +47 -7
- package/template/content/docs/configuration.mdx +226 -66
- package/template/content/docs/deployment.mdx +17 -0
- package/template/content/docs/edit-on-github.mdx +6 -2
- package/template/content/docs/env.mdx +38 -3
- package/template/content/docs/feedback.mdx +6 -2
- package/template/content/docs/getting-started.cn.mdx +2 -2
- package/template/content/docs/getting-started.mdx +71 -43
- package/template/content/docs/index.cn.mdx +36 -33
- package/template/content/docs/index.mdx +69 -59
- package/template/content/docs/internationalization.cn.mdx +7 -9
- package/template/content/docs/internationalization.mdx +10 -5
- package/template/content/docs/llms-txt.cn.mdx +24 -2
- package/template/content/docs/llms-txt.mdx +48 -12
- package/template/content/docs/md.cn.mdx +12 -15
- package/template/content/docs/md.mdx +30 -16
- package/template/content/docs/meta.json +6 -2
- package/template/content/docs/migration.mdx +364 -0
- package/template/content/docs/open-in-chat.mdx +12 -10
- package/template/content/docs/provider.cn.mdx +6 -5
- package/template/content/docs/provider.mdx +13 -8
- package/template/content/docs/proxy.cn.mdx +96 -0
- package/template/content/docs/proxy.mdx +178 -0
- package/template/content/docs/rss.mdx +6 -2
- package/template/content/docs/syntax.cn.mdx +2 -2
- package/template/content/docs/syntax.mdx +6 -2
- package/template/content/docs/theme-aware-image.mdx +5 -1
- package/template/content/docs/versioned-docs.cn.mdx +117 -0
- package/template/content/docs/versioned-docs.mdx +228 -0
- package/template/geistdocs.tsx +26 -0
- package/template/lib/geistdocs/config.tsx +3 -0
- package/template/package.json +5 -5
- package/template/proxy.ts +2 -1
- package/template/source.config.ts +8 -47
- package/template/app/actions/feedback/emotions.ts +0 -18
- package/template/app/actions/feedback/index.ts +0 -45
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small.tsx +0 -35
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-check.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-down-small.tsx +0 -30
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-right.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-copy.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text.tsx +0 -25
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-slash-forward.tsx +0 -36
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-elements.tsx +0 -29
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-sdk.tsx +0 -38
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-chat-sdk.tsx +0 -42
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-flags-sdk.tsx +0 -42
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-icon-vercel.tsx +0 -31
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-streamdown.tsx +0 -29
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-vercel-oss.tsx +0 -24
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-workflow-sdk.tsx +0 -73
- package/template/components/geistdocs/callout.tsx +0 -40
- package/template/components/geistdocs/chat.tsx +0 -24
- package/template/components/geistdocs/code-block-tabs.tsx +0 -61
- package/template/components/geistdocs/code-block.tsx +0 -134
- package/template/components/geistdocs/copy-page.tsx +0 -27
- package/template/components/geistdocs/desktop-menu.tsx +0 -52
- package/template/components/geistdocs/docs-page.tsx +0 -35
- package/template/components/geistdocs/edit-source.tsx +0 -30
- package/template/components/geistdocs/feedback.tsx +0 -139
- package/template/components/geistdocs/footer.tsx +0 -30
- package/template/components/geistdocs/github-button.tsx +0 -19
- package/template/components/geistdocs/home-layout.tsx +0 -46
- package/template/components/geistdocs/icons.tsx +0 -13
- package/template/components/geistdocs/installer.tsx +0 -58
- package/template/components/geistdocs/language-selector.tsx +0 -3
- package/template/components/geistdocs/mermaid.tsx +0 -68
- package/template/components/geistdocs/mobile-docs-bar.tsx +0 -81
- package/template/components/geistdocs/mobile-menu.tsx +0 -150
- package/template/components/geistdocs/navbar-logo.tsx +0 -124
- package/template/components/geistdocs/navbar.tsx +0 -22
- package/template/components/geistdocs/rss-button.tsx +0 -10
- package/template/components/geistdocs/scroll-top.tsx +0 -21
- package/template/components/geistdocs/search.tsx +0 -17
- package/template/components/geistdocs/sidebar.tsx +0 -128
- package/template/components/geistdocs/theme-aware-image.tsx +0 -22
- package/template/components/geistdocs/theme-toggle.tsx +0 -3
- package/template/components/geistdocs/video.tsx +0 -16
- package/template/components/ui/button-group.tsx +0 -83
- package/template/components/ui/card.tsx +0 -92
- package/template/components/ui/collapsible.tsx +0 -33
- package/template/components/ui/command.tsx +0 -184
- package/template/components/ui/dialog.tsx +0 -143
- package/template/components/ui/drawer.tsx +0 -135
- package/template/components/ui/dropdown-menu.tsx +0 -257
- package/template/components/ui/hover-card.tsx +0 -44
- package/template/components/ui/input-group.tsx +0 -170
- package/template/components/ui/input.tsx +0 -21
- package/template/components/ui/kbd.tsx +0 -28
- package/template/components/ui/navigation-menu.tsx +0 -192
- package/template/components/ui/popover.tsx +0 -48
- package/template/components/ui/scroll-area.tsx +0 -58
- package/template/components/ui/select.tsx +0 -187
- package/template/components/ui/separator.tsx +0 -28
- package/template/components/ui/sheet.tsx +0 -139
- package/template/components/ui/sonner.tsx +0 -40
- package/template/components/ui/spinner.tsx +0 -16
- package/template/components/ui/textarea.tsx +0 -18
- package/template/components/ui/tooltip.tsx +0 -61
- package/template/hooks/geistdocs/use-sidebar.ts +0 -13
- package/template/hooks/use-mobile.ts +0 -19
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
|
|
4
|
-
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
5
|
-
|
|
6
|
-
interface CopyPageProps {
|
|
7
|
-
text: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const CopyPage = ({ text }: CopyPageProps) => {
|
|
11
|
-
const [checked, handleCopy] = useCopyButton(async () => {
|
|
12
|
-
await navigator.clipboard.writeText(text);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const Icon = checked ? CheckIcon : CopyIcon;
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<button
|
|
19
|
-
className="flex items-center gap-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground"
|
|
20
|
-
onClick={handleCopy}
|
|
21
|
-
type="button"
|
|
22
|
-
>
|
|
23
|
-
<Icon className="size-3.5" />
|
|
24
|
-
<span>Copy page</span>
|
|
25
|
-
</button>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import DynamicLink from "fumadocs-core/dynamic-link";
|
|
4
|
-
import { IconArrowUpRightSmall } from "@/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small";
|
|
5
|
-
import {
|
|
6
|
-
NavigationMenu,
|
|
7
|
-
NavigationMenuItem,
|
|
8
|
-
NavigationMenuLink,
|
|
9
|
-
NavigationMenuList,
|
|
10
|
-
} from "@/components/ui/navigation-menu";
|
|
11
|
-
import { useIsMobile } from "@/hooks/use-mobile";
|
|
12
|
-
import { cn } from "@/lib/utils";
|
|
13
|
-
|
|
14
|
-
interface DesktopMenuProps {
|
|
15
|
-
className?: string;
|
|
16
|
-
items: { label: string; href: string }[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const DesktopMenu = ({ items, className }: DesktopMenuProps) => {
|
|
20
|
-
const isMobile = useIsMobile();
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<NavigationMenu viewport={isMobile}>
|
|
24
|
-
<NavigationMenuList className={cn("h-14 gap-4", className)}>
|
|
25
|
-
{items.map((item) => (
|
|
26
|
-
<NavigationMenuItem key={item.href}>
|
|
27
|
-
<NavigationMenuLink
|
|
28
|
-
asChild
|
|
29
|
-
className="flex items-center text-gray-900 text-sm transition-colors duration-100 hover:text-gray-1000"
|
|
30
|
-
>
|
|
31
|
-
{item.href.startsWith("http") ? (
|
|
32
|
-
<a
|
|
33
|
-
className="flex flex-row items-center gap-1"
|
|
34
|
-
href={item.href}
|
|
35
|
-
rel="noopener"
|
|
36
|
-
target="_blank"
|
|
37
|
-
>
|
|
38
|
-
{item.label}
|
|
39
|
-
<IconArrowUpRightSmall aria-hidden="true" size={12} />
|
|
40
|
-
</a>
|
|
41
|
-
) : (
|
|
42
|
-
<DynamicLink href={`/[lang]${item.href}`}>
|
|
43
|
-
{item.label}
|
|
44
|
-
</DynamicLink>
|
|
45
|
-
)}
|
|
46
|
-
</NavigationMenuLink>
|
|
47
|
-
</NavigationMenuItem>
|
|
48
|
-
))}
|
|
49
|
-
</NavigationMenuList>
|
|
50
|
-
</NavigationMenu>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DocsBody as FumadocsDocsBody,
|
|
3
|
-
DocsDescription as FumadocsDocsDescription,
|
|
4
|
-
DocsPage as FumadocsDocsPage,
|
|
5
|
-
DocsTitle as FumadocsDocsTitle,
|
|
6
|
-
} from "fumadocs-ui/layouts/docs/page";
|
|
7
|
-
import type { ComponentProps } from "react";
|
|
8
|
-
import { cn } from "@/lib/utils";
|
|
9
|
-
|
|
10
|
-
type PageProps = ComponentProps<typeof FumadocsDocsPage>;
|
|
11
|
-
|
|
12
|
-
export const DocsPage = ({ ...props }: PageProps) => (
|
|
13
|
-
<FumadocsDocsPage {...props} />
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
export const DocsTitle = ({
|
|
17
|
-
className,
|
|
18
|
-
...props
|
|
19
|
-
}: ComponentProps<typeof FumadocsDocsTitle>) => (
|
|
20
|
-
<FumadocsDocsTitle
|
|
21
|
-
className={cn("mb-4 text-4xl tracking-tight", className)}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export const DocsDescription = (
|
|
27
|
-
props: ComponentProps<typeof FumadocsDocsDescription>
|
|
28
|
-
) => <FumadocsDocsDescription {...props} />;
|
|
29
|
-
|
|
30
|
-
export const DocsBody = ({
|
|
31
|
-
className,
|
|
32
|
-
...props
|
|
33
|
-
}: ComponentProps<typeof FumadocsDocsBody>) => (
|
|
34
|
-
<FumadocsDocsBody className={cn("mx-auto w-full", className)} {...props} />
|
|
35
|
-
);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SiGithub } from "@icons-pack/react-simple-icons";
|
|
2
|
-
import { github } from "@/geistdocs";
|
|
3
|
-
|
|
4
|
-
interface EditSourceProps {
|
|
5
|
-
path: string | undefined;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const EditSource = ({ path }: EditSourceProps) => {
|
|
9
|
-
let url: string | undefined;
|
|
10
|
-
|
|
11
|
-
if (github.owner && github.repo && path) {
|
|
12
|
-
url = `https://github.com/${github.owner}/${github.repo}/edit/main/content/docs/${path}`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (!url) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<a
|
|
21
|
-
className="flex items-center gap-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground"
|
|
22
|
-
href={url}
|
|
23
|
-
rel="noopener noreferrer"
|
|
24
|
-
target="_blank"
|
|
25
|
-
>
|
|
26
|
-
<SiGithub className="size-3.5" />
|
|
27
|
-
<span>Edit this page on GitHub</span>
|
|
28
|
-
</a>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
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-muted-foreground text-sm transition-colors hover:text-foreground"
|
|
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-sidebar 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-muted-foreground">
|
|
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-sidebar p-2">
|
|
106
|
-
<div className="flex items-center gap-px">
|
|
107
|
-
{emotions.map((e) => (
|
|
108
|
-
<Button
|
|
109
|
-
className={cn(
|
|
110
|
-
"text-muted-foreground hover:text-foreground",
|
|
111
|
-
emotion === e.name ? "bg-accent text-foreground" : ""
|
|
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
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
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-muted-foreground 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
|
-
);
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const SlashIcon = (props: ComponentProps<"svg">) => (
|
|
4
|
-
<svg aria-hidden="true" strokeLinejoin="round" viewBox="0 0 16 16" {...props}>
|
|
5
|
-
<title>Slash</title>
|
|
6
|
-
<path
|
|
7
|
-
clipRule="evenodd"
|
|
8
|
-
d="M4.01526 15.3939L4.3107 14.7046L10.3107 0.704556L10.6061 0.0151978L11.9849 0.606077L11.6894 1.29544L5.68942 15.2954L5.39398 15.9848L4.01526 15.3939Z"
|
|
9
|
-
fill="currentColor"
|
|
10
|
-
fillRule="evenodd"
|
|
11
|
-
/>
|
|
12
|
-
</svg>
|
|
13
|
-
);
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { track } from "@vercel/analytics";
|
|
4
|
-
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
5
|
-
import { useState } from "react";
|
|
6
|
-
import { toast } from "sonner";
|
|
7
|
-
import {
|
|
8
|
-
InputGroup,
|
|
9
|
-
InputGroupAddon,
|
|
10
|
-
InputGroupButton,
|
|
11
|
-
InputGroupInput,
|
|
12
|
-
InputGroupText,
|
|
13
|
-
} from "@/components/ui/input-group";
|
|
14
|
-
|
|
15
|
-
const COPY_TIMEOUT = 2000;
|
|
16
|
-
|
|
17
|
-
interface InstallerProps {
|
|
18
|
-
className?: string;
|
|
19
|
-
command: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const Installer = ({ command, className = "w-48" }: InstallerProps) => {
|
|
23
|
-
const [copied, setCopied] = useState(false);
|
|
24
|
-
|
|
25
|
-
const handleCopy = () => {
|
|
26
|
-
navigator.clipboard.writeText(command);
|
|
27
|
-
toast.success("Copied to clipboard");
|
|
28
|
-
setCopied(true);
|
|
29
|
-
|
|
30
|
-
track("Copied installer command");
|
|
31
|
-
setTimeout(() => {
|
|
32
|
-
setCopied(false);
|
|
33
|
-
}, COPY_TIMEOUT);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const Icon = copied ? CheckIcon : CopyIcon;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<InputGroup className="h-10 bg-background font-mono shadow-none">
|
|
40
|
-
<InputGroupAddon>
|
|
41
|
-
<InputGroupText className="font-normal text-muted-foreground">
|
|
42
|
-
$
|
|
43
|
-
</InputGroupText>
|
|
44
|
-
</InputGroupAddon>
|
|
45
|
-
<InputGroupInput className={className} readOnly value={command} />
|
|
46
|
-
<InputGroupAddon align="inline-end">
|
|
47
|
-
<InputGroupButton
|
|
48
|
-
aria-label="Copy"
|
|
49
|
-
onClick={handleCopy}
|
|
50
|
-
size="icon-xs"
|
|
51
|
-
title="Copy"
|
|
52
|
-
>
|
|
53
|
-
<Icon className="size-3.5" size={14} />
|
|
54
|
-
</InputGroupButton>
|
|
55
|
-
</InputGroupAddon>
|
|
56
|
-
</InputGroup>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useTheme } from "next-themes";
|
|
4
|
-
import { use, useEffect, useId, useState } from "react";
|
|
5
|
-
|
|
6
|
-
export const Mermaid = ({ chart }: { chart: string }) => {
|
|
7
|
-
const [mounted, setMounted] = useState(false);
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
setMounted(true);
|
|
11
|
-
}, []);
|
|
12
|
-
|
|
13
|
-
if (!mounted) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return <MermaidContent chart={chart} />;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const cache = new Map<string, Promise<unknown>>();
|
|
21
|
-
|
|
22
|
-
function cachePromise<T>(
|
|
23
|
-
key: string,
|
|
24
|
-
setPromise: () => Promise<T>
|
|
25
|
-
): Promise<T> {
|
|
26
|
-
const cached = cache.get(key);
|
|
27
|
-
if (cached) {
|
|
28
|
-
return cached as Promise<T>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const promise = setPromise();
|
|
32
|
-
cache.set(key, promise);
|
|
33
|
-
return promise;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function MermaidContent({ chart }: { chart: string }) {
|
|
37
|
-
const id = useId();
|
|
38
|
-
const { resolvedTheme } = useTheme();
|
|
39
|
-
const { default: mermaid } = use(
|
|
40
|
-
cachePromise("mermaid", () => import("mermaid"))
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
mermaid.initialize({
|
|
44
|
-
startOnLoad: false,
|
|
45
|
-
securityLevel: "loose",
|
|
46
|
-
fontFamily: "inherit",
|
|
47
|
-
themeCSS: "margin: 1.5rem auto 0;",
|
|
48
|
-
theme: resolvedTheme === "dark" ? "dark" : "default",
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const { svg, bindFunctions } = use(
|
|
52
|
-
cachePromise(`${chart}-${resolvedTheme}`, () =>
|
|
53
|
-
mermaid.render(id, chart.replaceAll("\\n", "\n"))
|
|
54
|
-
)
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<div
|
|
59
|
-
// biome-ignore lint/security/noDangerouslySetInnerHtml: "this is needed."
|
|
60
|
-
dangerouslySetInnerHTML={{ __html: svg }}
|
|
61
|
-
ref={(container) => {
|
|
62
|
-
if (container) {
|
|
63
|
-
bindFunctions?.(container);
|
|
64
|
-
}
|
|
65
|
-
}}
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { TableOfContents } from "fumadocs-core/toc";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import { IconFileText } from "@/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text";
|
|
6
|
-
import { IconMenuAlt } from "@/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt";
|
|
7
|
-
import {
|
|
8
|
-
Sheet,
|
|
9
|
-
SheetContent,
|
|
10
|
-
SheetDescription,
|
|
11
|
-
SheetHeader,
|
|
12
|
-
SheetTitle,
|
|
13
|
-
} from "@/components/ui/sheet";
|
|
14
|
-
import { useSidebarContext } from "@/hooks/geistdocs/use-sidebar";
|
|
15
|
-
import { cn } from "@/lib/utils";
|
|
16
|
-
|
|
17
|
-
interface MobileDocsBarProps {
|
|
18
|
-
toc?: TableOfContents;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const MobileDocsBar = ({ toc }: MobileDocsBarProps) => {
|
|
22
|
-
const { setIsOpen: setSidebarOpen } = useSidebarContext();
|
|
23
|
-
const [tocOpen, setTocOpen] = useState(false);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<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">
|
|
27
|
-
<button
|
|
28
|
-
className="flex items-center gap-3 text-base text-gray-1000"
|
|
29
|
-
onClick={() => setSidebarOpen(true)}
|
|
30
|
-
type="button"
|
|
31
|
-
>
|
|
32
|
-
<IconMenuAlt size={16} />
|
|
33
|
-
Menu
|
|
34
|
-
</button>
|
|
35
|
-
|
|
36
|
-
{toc && toc.length > 0 && (
|
|
37
|
-
<>
|
|
38
|
-
<button
|
|
39
|
-
aria-label="Table of contents"
|
|
40
|
-
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"
|
|
41
|
-
onClick={() => setTocOpen(true)}
|
|
42
|
-
type="button"
|
|
43
|
-
>
|
|
44
|
-
<IconFileText size={16} />
|
|
45
|
-
</button>
|
|
46
|
-
|
|
47
|
-
<Sheet onOpenChange={setTocOpen} open={tocOpen}>
|
|
48
|
-
<SheetContent className="w-72 gap-0" side="right">
|
|
49
|
-
<SheetHeader>
|
|
50
|
-
<SheetTitle className="px-4 pt-4 font-medium text-sm">
|
|
51
|
-
On this page
|
|
52
|
-
</SheetTitle>
|
|
53
|
-
<SheetDescription className="sr-only">
|
|
54
|
-
Table of contents for the current page.
|
|
55
|
-
</SheetDescription>
|
|
56
|
-
</SheetHeader>
|
|
57
|
-
<nav className="flex-1 overflow-y-auto px-4 pb-4">
|
|
58
|
-
<ul className="space-y-1">
|
|
59
|
-
{toc.map((item) => (
|
|
60
|
-
<li key={item.url}>
|
|
61
|
-
<a
|
|
62
|
-
className={cn(
|
|
63
|
-
"block rounded-md py-1.5 text-gray-900 text-sm transition-colors hover:text-gray-1000",
|
|
64
|
-
item.depth > 2 && "pl-4"
|
|
65
|
-
)}
|
|
66
|
-
href={item.url}
|
|
67
|
-
onClick={() => setTocOpen(false)}
|
|
68
|
-
>
|
|
69
|
-
{item.title}
|
|
70
|
-
</a>
|
|
71
|
-
</li>
|
|
72
|
-
))}
|
|
73
|
-
</ul>
|
|
74
|
-
</nav>
|
|
75
|
-
</SheetContent>
|
|
76
|
-
</Sheet>
|
|
77
|
-
</>
|
|
78
|
-
)}
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
};
|