@vercel/geistdocs 1.25.0 → 1.25.1-canary.4e75e60
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/cli/index.js +1 -1
- package/dist/components/blockquote.d.ts +3 -0
- package/dist/components/blockquote.d.ts.map +1 -0
- package/dist/components/blockquote.js +3 -0
- package/dist/components/callout.d.ts +13 -10
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +7 -7
- package/dist/components/code-block-tabs.d.ts +5 -2
- package/dist/components/code-block-tabs.d.ts.map +1 -1
- package/dist/components/code-block-tabs.js +30 -5
- package/dist/components/code-block.d.ts +2 -6
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +22 -68
- package/dist/components/command-prompt.d.ts.map +1 -1
- package/dist/components/command-prompt.js +18 -25
- package/dist/components/copy-prompt.d.ts +2 -1
- package/dist/components/copy-prompt.d.ts.map +1 -1
- package/dist/components/copy-prompt.js +5 -5
- package/dist/components/heading.d.ts +7 -0
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +14 -0
- package/dist/components/mermaid.js +1 -1
- package/dist/components/table.d.ts +3 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +3 -0
- package/dist/controls.d.ts +8 -4
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +16 -15
- package/dist/footer.d.ts.map +1 -1
- package/dist/footer.js +6 -6
- package/dist/home-layout.js +1 -1
- package/dist/internal/chat/context.d.ts +2 -0
- package/dist/internal/chat/context.d.ts.map +1 -1
- package/dist/internal/chat/context.js +24 -3
- package/dist/internal/chat/conversation.d.ts +4 -3
- package/dist/internal/chat/conversation.d.ts.map +1 -1
- package/dist/internal/chat/conversation.js +5 -5
- package/dist/internal/chat/copy-chat.d.ts.map +1 -1
- package/dist/internal/chat/copy-chat.js +13 -10
- package/dist/internal/chat/dots-spinner.d.ts +5 -0
- package/dist/internal/chat/dots-spinner.d.ts.map +1 -0
- package/dist/internal/chat/dots-spinner.js +21 -0
- package/dist/internal/chat/loading-skeleton.d.ts +7 -0
- package/dist/internal/chat/loading-skeleton.d.ts.map +1 -0
- package/dist/internal/chat/loading-skeleton.js +46 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -1
- package/dist/internal/chat/message-metadata.js +8 -7
- package/dist/internal/chat/message.d.ts.map +1 -1
- package/dist/internal/chat/message.js +26 -6
- package/dist/internal/chat/prompt-input.d.ts +1 -1
- package/dist/internal/chat/prompt-input.d.ts.map +1 -1
- package/dist/internal/chat/prompt-input.js +25 -27
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +36 -33
- package/dist/internal/chat/sources.d.ts +3 -1
- package/dist/internal/chat/sources.d.ts.map +1 -1
- package/dist/internal/chat/sources.js +9 -6
- package/dist/internal/chat/suggestion.d.ts +11 -6
- package/dist/internal/chat/suggestion.d.ts.map +1 -1
- package/dist/internal/chat/suggestion.js +5 -5
- package/dist/internal/docs-page-error-boundary.d.ts.map +1 -1
- package/dist/internal/docs-page-error-boundary.js +3 -3
- package/dist/internal/external-arrow.d.ts.map +1 -1
- package/dist/internal/external-arrow.js +1 -1
- package/dist/internal/footer/rss-button.d.ts.map +1 -1
- package/dist/internal/footer/rss-button.js +3 -3
- package/dist/internal/github-button.d.ts.map +1 -1
- package/dist/internal/github-button.js +3 -3
- package/dist/internal/mousedown-navigation-utils.d.ts +5 -0
- package/dist/internal/mousedown-navigation-utils.d.ts.map +1 -0
- package/dist/internal/mousedown-navigation-utils.js +95 -0
- package/dist/internal/mousedown-navigation.d.ts +10 -0
- package/dist/internal/mousedown-navigation.d.ts.map +1 -0
- package/dist/internal/mousedown-navigation.js +42 -0
- package/dist/internal/navbar/desktop-menu.d.ts.map +1 -1
- package/dist/internal/navbar/desktop-menu.js +3 -3
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
- package/dist/internal/navbar/mobile-menu.js +11 -16
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
- package/dist/internal/navbar/navbar-logo.js +6 -8
- package/dist/internal/navbar/navbar-shell.d.ts.map +1 -1
- package/dist/internal/navbar/navbar-shell.js +3 -2
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +52 -49
- package/dist/internal/page-breadcrumb.d.ts.map +1 -1
- package/dist/internal/page-breadcrumb.js +3 -3
- package/dist/internal/page-footer.d.ts.map +1 -1
- package/dist/internal/page-footer.js +2 -2
- package/dist/internal/provider-client.d.ts.map +1 -1
- package/dist/internal/provider-client.js +36 -12
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/search.js +2 -2
- package/dist/internal/sidebar-responsive.d.ts +0 -1
- package/dist/internal/sidebar-responsive.d.ts.map +1 -1
- package/dist/internal/sidebar-responsive.js +0 -9
- package/dist/internal/sidebar-tree.d.ts.map +1 -1
- package/dist/internal/sidebar-tree.js +9 -7
- package/dist/internal/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +80 -53
- package/dist/internal/table-of-contents.d.ts.map +1 -1
- package/dist/internal/table-of-contents.js +1 -1
- package/dist/internal/toc-items.d.ts.map +1 -1
- package/dist/internal/toc-items.js +17 -7
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/internal/ui/dropdown-menu.js +8 -8
- package/dist/internal/ui/navigation-menu.d.ts.map +1 -1
- package/dist/internal/ui/navigation-menu.js +4 -4
- package/dist/internal/ui/popover.d.ts.map +1 -1
- package/dist/internal/ui/popover.js +1 -1
- package/dist/internal/ui/scroll-area.d.ts.map +1 -1
- package/dist/internal/ui/scroll-area.js +1 -1
- package/dist/internal/use-mobile.d.ts.map +1 -1
- package/dist/internal/use-mobile.js +2 -12
- package/dist/layout.d.ts +1 -0
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +3 -1
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +15 -2
- package/dist/mobile-docs-bar.d.ts.map +1 -1
- package/dist/mobile-docs-bar.js +1 -2
- package/dist/navbar.js +3 -2
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +12 -4
- package/dist/routes/chat.d.ts +1 -1
- package/dist/routes/chat.js +1 -1
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +0 -2
- package/dist/versions.d.ts.map +1 -1
- package/dist/versions.js +5 -5
- package/docs/agents.md +1 -2
- package/docs/llms.txt +216 -89
- package/docs/manifest.json +1 -10
- package/docs/pages/ask-ai.md +2 -2
- package/docs/pages/md.md +1 -1
- package/docs/pages/migration.md +5 -7
- package/docs/pages/syntax.md +204 -11
- package/docs/pages/versioned-docs.md +3 -3
- package/docs/sitemap.md +0 -1
- package/package.json +12 -103
- package/styles.css +3 -2
- package/template/AGENTS.md +10 -0
- package/template/app/[lang]/(home)/components/hero.tsx +2 -2
- package/template/app/[lang]/(home)/components/one-two-section.tsx +9 -1
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +1 -1
- package/template/app/[lang]/(home)/page.tsx +5 -6
- package/template/app/[lang]/layout.tsx +11 -4
- package/template/app/styles/geistdocs.css +18 -15
- package/template/components/ui/button.tsx +1 -1
- package/template/content/docs/ask-ai.cn.mdx +2 -2
- package/template/content/docs/ask-ai.mdx +2 -2
- package/template/content/docs/configuration.cn.mdx +2 -2
- package/template/content/docs/md.mdx +1 -1
- package/template/content/docs/migration.mdx +5 -7
- package/template/content/docs/syntax.mdx +210 -11
- package/template/content/docs/versioned-docs.mdx +3 -3
- package/template/lib/geistdocs/config.tsx +0 -5
- package/template/next.config.ts +16 -2
- package/template/package.json +6 -8
- package/theme.css +39 -695
- package/dist/assets/icons/icon-acronym-ts.d.ts +0 -5
- package/dist/assets/icons/icon-acronym-ts.d.ts.map +0 -1
- package/dist/assets/icons/icon-acronym-ts.js +0 -4
- package/dist/assets/icons/icon-agents.d.ts +0 -5
- package/dist/assets/icons/icon-agents.d.ts.map +0 -1
- package/dist/assets/icons/icon-agents.js +0 -4
- package/dist/assets/icons/icon-api.d.ts +0 -5
- package/dist/assets/icons/icon-api.d.ts.map +0 -1
- package/dist/assets/icons/icon-api.js +0 -4
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts +0 -8
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts.map +0 -1
- package/dist/assets/icons/icon-arrow-up-right-small.js +0 -4
- package/dist/assets/icons/icon-arrow-up-right.d.ts +0 -5
- package/dist/assets/icons/icon-arrow-up-right.d.ts.map +0 -1
- package/dist/assets/icons/icon-arrow-up-right.js +0 -4
- package/dist/assets/icons/icon-check.d.ts +0 -5
- package/dist/assets/icons/icon-check.d.ts.map +0 -1
- package/dist/assets/icons/icon-check.js +0 -4
- package/dist/assets/icons/icon-chevron-down-small.d.ts +0 -8
- package/dist/assets/icons/icon-chevron-down-small.d.ts.map +0 -1
- package/dist/assets/icons/icon-chevron-down-small.js +0 -7
- package/dist/assets/icons/icon-chevron-right.d.ts +0 -5
- package/dist/assets/icons/icon-chevron-right.d.ts.map +0 -1
- package/dist/assets/icons/icon-chevron-right.js +0 -4
- package/dist/assets/icons/icon-clock.d.ts +0 -5
- package/dist/assets/icons/icon-clock.d.ts.map +0 -1
- package/dist/assets/icons/icon-clock.js +0 -4
- package/dist/assets/icons/icon-copy.d.ts +0 -5
- package/dist/assets/icons/icon-copy.d.ts.map +0 -1
- package/dist/assets/icons/icon-copy.js +0 -4
- package/dist/assets/icons/icon-display-small.d.ts +0 -5
- package/dist/assets/icons/icon-display-small.d.ts.map +0 -1
- package/dist/assets/icons/icon-display-small.js +0 -4
- package/dist/assets/icons/icon-display.d.ts +0 -5
- package/dist/assets/icons/icon-display.d.ts.map +0 -1
- package/dist/assets/icons/icon-display.js +0 -4
- package/dist/assets/icons/icon-file-text.d.ts +0 -5
- package/dist/assets/icons/icon-file-text.d.ts.map +0 -1
- package/dist/assets/icons/icon-file-text.js +0 -4
- package/dist/assets/icons/icon-folder-open.d.ts +0 -5
- package/dist/assets/icons/icon-folder-open.d.ts.map +0 -1
- package/dist/assets/icons/icon-folder-open.js +0 -4
- package/dist/assets/icons/icon-linked.d.ts +0 -5
- package/dist/assets/icons/icon-linked.d.ts.map +0 -1
- package/dist/assets/icons/icon-linked.js +0 -4
- package/dist/assets/icons/icon-logs.d.ts +0 -5
- package/dist/assets/icons/icon-logs.d.ts.map +0 -1
- package/dist/assets/icons/icon-logs.js +0 -4
- package/dist/assets/icons/icon-menu-alt.d.ts +0 -5
- package/dist/assets/icons/icon-menu-alt.d.ts.map +0 -1
- package/dist/assets/icons/icon-menu-alt.js +0 -4
- package/dist/assets/icons/icon-message.d.ts +0 -5
- package/dist/assets/icons/icon-message.d.ts.map +0 -1
- package/dist/assets/icons/icon-message.js +0 -4
- package/dist/assets/icons/icon-moon-small.d.ts +0 -5
- package/dist/assets/icons/icon-moon-small.d.ts.map +0 -1
- package/dist/assets/icons/icon-moon-small.js +0 -4
- package/dist/assets/icons/icon-moon.d.ts +0 -5
- package/dist/assets/icons/icon-moon.d.ts.map +0 -1
- package/dist/assets/icons/icon-moon.js +0 -4
- package/dist/assets/icons/icon-openai.d.ts +0 -5
- package/dist/assets/icons/icon-openai.d.ts.map +0 -1
- package/dist/assets/icons/icon-openai.js +0 -4
- package/dist/assets/icons/icon-plus-circle.d.ts +0 -5
- package/dist/assets/icons/icon-plus-circle.d.ts.map +0 -1
- package/dist/assets/icons/icon-plus-circle.js +0 -4
- package/dist/assets/icons/icon-refresh-counter-clockwise.d.ts +0 -5
- package/dist/assets/icons/icon-refresh-counter-clockwise.d.ts.map +0 -1
- package/dist/assets/icons/icon-refresh-counter-clockwise.js +0 -4
- package/dist/assets/icons/icon-robot.d.ts +0 -5
- package/dist/assets/icons/icon-robot.d.ts.map +0 -1
- package/dist/assets/icons/icon-robot.js +0 -4
- package/dist/assets/icons/icon-sandbox.d.ts +0 -5
- package/dist/assets/icons/icon-sandbox.d.ts.map +0 -1
- package/dist/assets/icons/icon-sandbox.js +0 -4
- package/dist/assets/icons/icon-slash-forward.d.ts +0 -8
- package/dist/assets/icons/icon-slash-forward.d.ts.map +0 -1
- package/dist/assets/icons/icon-slash-forward.js +0 -4
- package/dist/assets/icons/icon-sparkles.d.ts +0 -5
- package/dist/assets/icons/icon-sparkles.d.ts.map +0 -1
- package/dist/assets/icons/icon-sparkles.js +0 -4
- package/dist/assets/icons/icon-sun-small.d.ts +0 -5
- package/dist/assets/icons/icon-sun-small.d.ts.map +0 -1
- package/dist/assets/icons/icon-sun-small.js +0 -4
- package/dist/assets/icons/icon-sun.d.ts +0 -5
- package/dist/assets/icons/icon-sun.d.ts.map +0 -1
- package/dist/assets/icons/icon-sun.js +0 -4
- package/dist/assets/icons/icon-trash.d.ts +0 -5
- package/dist/assets/icons/icon-trash.d.ts.map +0 -1
- package/dist/assets/icons/icon-trash.js +0 -4
- package/dist/assets/icons/icon-user.d.ts +0 -5
- package/dist/assets/icons/icon-user.d.ts.map +0 -1
- package/dist/assets/icons/icon-user.js +0 -4
- package/dist/assets/icons/icon-workflow.d.ts +0 -5
- package/dist/assets/icons/icon-workflow.d.ts.map +0 -1
- package/dist/assets/icons/icon-workflow.js +0 -4
- package/dist/assets/icons/icon-wrench.d.ts +0 -5
- package/dist/assets/icons/icon-wrench.d.ts.map +0 -1
- package/dist/assets/icons/icon-wrench.js +0 -4
- package/dist/assets/icons/index.d.ts +0 -35
- package/dist/assets/icons/index.d.ts.map +0 -1
- package/dist/assets/icons/index.js +0 -35
- package/dist/assets/logos/index.d.ts +0 -17
- package/dist/assets/logos/index.d.ts.map +0 -1
- package/dist/assets/logos/index.js +0 -17
- package/dist/assets/logos/logo-ai-elements.d.ts +0 -5
- package/dist/assets/logos/logo-ai-elements.d.ts.map +0 -1
- package/dist/assets/logos/logo-ai-elements.js +0 -5
- package/dist/assets/logos/logo-ai-sdk.d.ts +0 -5
- package/dist/assets/logos/logo-ai-sdk.d.ts.map +0 -1
- package/dist/assets/logos/logo-ai-sdk.js +0 -5
- package/dist/assets/logos/logo-chat-sdk.d.ts +0 -5
- package/dist/assets/logos/logo-chat-sdk.d.ts.map +0 -1
- package/dist/assets/logos/logo-chat-sdk.js +0 -5
- package/dist/assets/logos/logo-eve.d.ts +0 -5
- package/dist/assets/logos/logo-eve.d.ts.map +0 -1
- package/dist/assets/logos/logo-eve.js +0 -5
- package/dist/assets/logos/logo-flags-sdk.d.ts +0 -5
- package/dist/assets/logos/logo-flags-sdk.d.ts.map +0 -1
- package/dist/assets/logos/logo-flags-sdk.js +0 -5
- package/dist/assets/logos/logo-icon-vercel.d.ts +0 -5
- package/dist/assets/logos/logo-icon-vercel.d.ts.map +0 -1
- package/dist/assets/logos/logo-icon-vercel.js +0 -4
- package/dist/assets/logos/logo-nextjs.d.ts +0 -5
- package/dist/assets/logos/logo-nextjs.d.ts.map +0 -1
- package/dist/assets/logos/logo-nextjs.js +0 -9
- package/dist/assets/logos/logo-streamdown.d.ts +0 -5
- package/dist/assets/logos/logo-streamdown.d.ts.map +0 -1
- package/dist/assets/logos/logo-streamdown.js +0 -5
- package/dist/assets/logos/logo-svelte-kit.d.ts +0 -5
- package/dist/assets/logos/logo-svelte-kit.d.ts.map +0 -1
- package/dist/assets/logos/logo-svelte-kit.js +0 -4
- package/dist/assets/logos/logo-turborepo.d.ts +0 -5
- package/dist/assets/logos/logo-turborepo.d.ts.map +0 -1
- package/dist/assets/logos/logo-turborepo.js +0 -5
- package/dist/assets/logos/logo-vercel-oss.d.ts +0 -5
- package/dist/assets/logos/logo-vercel-oss.d.ts.map +0 -1
- package/dist/assets/logos/logo-vercel-oss.js +0 -4
- package/dist/assets/logos/logo-workflow-sdk.d.ts +0 -5
- package/dist/assets/logos/logo-workflow-sdk.d.ts.map +0 -1
- package/dist/assets/logos/logo-workflow-sdk.js +0 -5
- package/dist/components/badge.d.ts +0 -11
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/badge.js +0 -22
- package/dist/components/button-group.d.ts +0 -2
- package/dist/components/button-group.d.ts.map +0 -1
- package/dist/components/button-group.js +0 -2
- package/dist/components/button.d.ts +0 -2
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/button.js +0 -2
- package/dist/components/card.d.ts +0 -2
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js +0 -2
- package/dist/components/dialog.d.ts +0 -13
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dialog.js +0 -35
- package/dist/components/drawer.d.ts +0 -2
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/drawer.js +0 -3
- package/dist/components/input-group.d.ts +0 -2
- package/dist/components/input-group.d.ts.map +0 -1
- package/dist/components/input-group.js +0 -3
- package/dist/components/input.d.ts +0 -2
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/input.js +0 -2
- package/dist/components/kbd.d.ts +0 -2
- package/dist/components/kbd.d.ts.map +0 -1
- package/dist/components/kbd.js +0 -2
- package/dist/components/separator.d.ts +0 -2
- package/dist/components/separator.d.ts.map +0 -1
- package/dist/components/separator.js +0 -3
- package/dist/components/sheet.d.ts +0 -2
- package/dist/components/sheet.d.ts.map +0 -1
- package/dist/components/sheet.js +0 -3
- package/dist/components/sonner.d.ts +0 -2
- package/dist/components/sonner.d.ts.map +0 -1
- package/dist/components/sonner.js +0 -3
- package/dist/components/spinner.d.ts +0 -2
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/spinner.js +0 -2
- package/dist/components/switch.d.ts +0 -11
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/switch.js +0 -12
- package/dist/components/textarea.d.ts +0 -2
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/textarea.js +0 -2
- package/dist/components/theme-aware-image.d.ts +0 -12
- package/dist/components/theme-aware-image.d.ts.map +0 -1
- package/dist/components/theme-aware-image.js +0 -8
- package/dist/components/theme-switcher.d.ts +0 -8
- package/dist/components/theme-switcher.d.ts.map +0 -1
- package/dist/components/theme-switcher.js +0 -37
- package/dist/components/tooltip.d.ts +0 -2
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip.js +0 -3
- package/dist/internal/chat/shimmer.d.ts +0 -11
- package/dist/internal/chat/shimmer.d.ts.map +0 -1
- package/dist/internal/chat/shimmer.js +0 -22
- package/dist/internal/cn.d.ts +0 -3
- package/dist/internal/cn.d.ts.map +0 -1
- package/dist/internal/cn.js +0 -47
- package/dist/internal/ui/button-group.d.ts +0 -13
- package/dist/internal/ui/button-group.d.ts.map +0 -1
- package/dist/internal/ui/button-group.js +0 -26
- package/dist/internal/ui/button.d.ts +0 -12
- package/dist/internal/ui/button.d.ts.map +0 -1
- package/dist/internal/ui/button.js +0 -33
- package/dist/internal/ui/card.d.ts +0 -6
- package/dist/internal/ui/card.d.ts.map +0 -1
- package/dist/internal/ui/card.js +0 -14
- package/dist/internal/ui/drawer.d.ts +0 -8
- package/dist/internal/ui/drawer.d.ts.map +0 -1
- package/dist/internal/ui/drawer.js +0 -19
- package/dist/internal/ui/input-group.d.ts +0 -15
- package/dist/internal/ui/input-group.d.ts.map +0 -1
- package/dist/internal/ui/input-group.js +0 -44
- package/dist/internal/ui/input.d.ts +0 -3
- package/dist/internal/ui/input.d.ts.map +0 -1
- package/dist/internal/ui/input.js +0 -5
- package/dist/internal/ui/kbd.d.ts +0 -4
- package/dist/internal/ui/kbd.d.ts.map +0 -1
- package/dist/internal/ui/kbd.js +0 -8
- package/dist/internal/ui/separator.d.ts +0 -4
- package/dist/internal/ui/separator.d.ts.map +0 -1
- package/dist/internal/ui/separator.js +0 -7
- package/dist/internal/ui/sheet.d.ts +0 -13
- package/dist/internal/ui/sheet.d.ts.map +0 -1
- package/dist/internal/ui/sheet.js +0 -24
- package/dist/internal/ui/sonner.d.ts +0 -3
- package/dist/internal/ui/sonner.d.ts.map +0 -1
- package/dist/internal/ui/sonner.js +0 -20
- package/dist/internal/ui/spinner.d.ts +0 -3
- package/dist/internal/ui/spinner.d.ts.map +0 -1
- package/dist/internal/ui/spinner.js +0 -6
- package/dist/internal/ui/textarea.d.ts +0 -3
- package/dist/internal/ui/textarea.d.ts.map +0 -1
- package/dist/internal/ui/textarea.js +0 -5
- package/dist/internal/ui/tooltip.d.ts +0 -7
- package/dist/internal/ui/tooltip.d.ts.map +0 -1
- package/dist/internal/ui/tooltip.js +0 -16
- package/docs/pages/theme-aware-image.md +0 -59
- package/template/app/[lang]/(home)/components/centered-section.tsx +0 -32
- package/template/content/docs/theme-aware-image.mdx +0 -57
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useChat } from "@ai-sdk/react";
|
|
4
|
+
import { Button } from "@vercel/geistcn/components/button";
|
|
5
|
+
import { Drawer, DrawerTitle } from "@vercel/geistcn/components/drawer";
|
|
6
|
+
import { Kbd } from "@vercel/geistcn/components/kbd";
|
|
7
|
+
import { Spinner } from "@vercel/geistcn/components/spinner";
|
|
8
|
+
import { useToasts } from "@vercel/geistcn/components/toasts";
|
|
9
|
+
import { Tooltip } from "@vercel/geistcn/components/tooltip";
|
|
10
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
11
|
+
import { IconChevronDoubleRight, IconCreditCard, IconDeviceDesktop, IconFluid, IconTrash, } from "@vercel/geistcn-assets/icons";
|
|
12
|
+
import { LogoIconVercelFillSvg } from "@vercel/geistcn-assets/logos";
|
|
4
13
|
import { DefaultChatTransport } from "ai";
|
|
5
14
|
import { useLiveQuery } from "dexie-react-hooks";
|
|
6
|
-
import { ChevronRightIcon, Trash } from "lucide-react";
|
|
7
15
|
import { catchError } from "next/error";
|
|
8
16
|
import { usePathname } from "next/navigation";
|
|
9
17
|
import { Portal } from "radix-ui";
|
|
10
18
|
import { useCallback, useEffect, useId, useMemo, useRef, useState, } from "react";
|
|
11
|
-
import { toast } from "sonner";
|
|
12
19
|
import { getPublicPath } from "../../config";
|
|
13
|
-
import { cn } from "../cn";
|
|
14
|
-
import { Button } from "../ui/button";
|
|
15
|
-
import { ButtonGroup } from "../ui/button-group";
|
|
16
|
-
import { Drawer, DrawerContent, DrawerDescription, DrawerTitle, } from "../ui/drawer";
|
|
17
|
-
import { Kbd, KbdGroup } from "../ui/kbd";
|
|
18
|
-
import { Spinner } from "../ui/spinner";
|
|
19
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
|
|
20
20
|
import { useIsMobile } from "../use-mobile";
|
|
21
21
|
import { useGeistdocsChat } from "./context";
|
|
22
22
|
import { Conversation, ConversationContent, ConversationScrollButton, } from "./conversation";
|
|
23
23
|
import { CopyChat } from "./copy-chat";
|
|
24
24
|
import { getChatDatabase } from "./db";
|
|
25
|
+
import { DotsSpinner } from "./dots-spinner";
|
|
25
26
|
import { Message, MessageContent, MessageResponse } from "./message";
|
|
26
27
|
import { MessageMetadata } from "./message-metadata";
|
|
27
28
|
import { ChatPromptInput } from "./prompt-input";
|
|
@@ -33,6 +34,12 @@ const isFromPreviousDay = (timestamp) => {
|
|
|
33
34
|
messageDate.getMonth() !== today.getMonth() ||
|
|
34
35
|
messageDate.getDate() !== today.getDate());
|
|
35
36
|
};
|
|
37
|
+
const suggestionIcons = [
|
|
38
|
+
_jsx(LogoIconVercelFillSvg, { color: "gray-700" }, "vercel"),
|
|
39
|
+
_jsx(IconDeviceDesktop, { color: "gray-700" }, "deploy"),
|
|
40
|
+
_jsx(IconFluid, { color: "gray-700" }, "fluid"),
|
|
41
|
+
_jsx(IconCreditCard, { color: "gray-700" }, "cost"),
|
|
42
|
+
];
|
|
36
43
|
const useChatPersistence = (title) => {
|
|
37
44
|
const saveTimeoutRef = useRef(undefined);
|
|
38
45
|
const db = useMemo(() => getChatDatabase(title), [title]);
|
|
@@ -95,6 +102,7 @@ const GeistdocsChatInner = ({ isOpen }) => {
|
|
|
95
102
|
const pathname = usePathname();
|
|
96
103
|
const textareaRef = useRef(null);
|
|
97
104
|
const [isInitialized, setIsInitialized] = useState(false);
|
|
105
|
+
const toast = useToasts();
|
|
98
106
|
const { prompt, setPrompt, setIsOpen, title, basePath, footer, suggestions } = useGeistdocsChat();
|
|
99
107
|
const { initialMessages, isLoading, saveMessages, clearMessages } = useChatPersistence(title);
|
|
100
108
|
const { messages, sendMessage, status, setMessages, stop } = useChat({
|
|
@@ -110,9 +118,7 @@ const GeistdocsChatInner = ({ isOpen }) => {
|
|
|
110
118
|
}),
|
|
111
119
|
}),
|
|
112
120
|
onError: (error) => {
|
|
113
|
-
toast.error(error.message
|
|
114
|
-
description: error.message,
|
|
115
|
-
});
|
|
121
|
+
toast.error({ text: error.message });
|
|
116
122
|
},
|
|
117
123
|
});
|
|
118
124
|
useEffect(() => {
|
|
@@ -156,51 +162,48 @@ const GeistdocsChatInner = ({ isOpen }) => {
|
|
|
156
162
|
try {
|
|
157
163
|
await clearMessages();
|
|
158
164
|
setMessages([]);
|
|
159
|
-
toast.success("Chat
|
|
165
|
+
toast.success({ text: "Chat cleared" });
|
|
160
166
|
}
|
|
161
167
|
catch (error) {
|
|
162
|
-
toast.error(
|
|
163
|
-
|
|
168
|
+
toast.error({
|
|
169
|
+
text: error instanceof Error
|
|
170
|
+
? `Failed to clear chat history: ${error.message}`
|
|
171
|
+
: "Failed to clear chat history",
|
|
164
172
|
});
|
|
165
173
|
}
|
|
166
174
|
};
|
|
167
175
|
if (isLoading) {
|
|
168
176
|
return (_jsx("div", { className: "flex size-full w-full flex-col items-center justify-center overflow-hidden whitespace-nowrap rounded-xl xl:max-w-md xl:border xl:bg-background-100", children: _jsx(Spinner, {}) }));
|
|
169
177
|
}
|
|
170
|
-
return (_jsxs("
|
|
178
|
+
return (_jsxs("aside", { "aria-label": "Ask AI chat", className: "flex size-full w-full flex-col overflow-hidden whitespace-nowrap bg-background-100", children: [_jsxs("div", { className: "sticky top-0 z-10 flex h-16 items-center justify-between bg-background-100 py-2 pr-2 pl-3.5", children: [_jsx("h2", { className: "font-semibold text-sm", children: "Ask AI" }), _jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx(CopyChat, { messages: messages }), _jsx(Tooltip, { position: "bottom", text: "Delete chat", children: _jsx(Button, { "aria-label": "Delete chat", className: "text-gray-800! disabled:bg-gray-alpha-100!", disabled: messages.length === 0, onClick: handleClearChat, shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconTrash, { size: 14 }) }) }), _jsx(Tooltip, { position: "bottom", text: "Close chat", children: _jsx(Button, { "aria-label": "Close chat", className: "text-gray-800! shadow-none", onClick: () => setIsOpen(false), shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconChevronDoubleRight, { size: 14 }) }) })] })] }), _jsxs(Conversation, { children: [_jsxs(ConversationContent, { children: [messages.map((message) => (_jsxs(Message, { from: message.role, children: [_jsx(MessageMetadata, { inProgress: status === "submitted" || status === "streaming", parts: message.parts }), message.parts
|
|
171
179
|
.filter((part) => part.type === "text")
|
|
172
|
-
.map((part) => (_jsx(MessageContent, { children: _jsx(MessageResponse, { className: "text-wrap", children: part.text }) }, `${message.id}-${part.type}-${part.text}`)))] }, message.id))), status === "submitted" ? (_jsx("div", { className: "
|
|
180
|
+
.map((part) => (_jsx(MessageContent, { children: _jsx(MessageResponse, { className: "text-wrap", children: part.text }) }, `${message.id}-${part.type}-${part.text}`)))] }, message.id))), status === "submitted" ? (_jsx("div", { className: "h-12 animate-pulse pt-2 text-gray-900 text-sm", children: _jsx(DotsSpinner, {}) })) : null] }), _jsx(ConversationScrollButton, {})] }), _jsxs("div", { className: "relative grid w-auto shrink-0 gap-3 whitespace-normal p-4 text-left", children: [messages.length ? null : (_jsxs(_Fragment, { children: [_jsx(Suggestions, { className: "w-full cursor-text", children: suggestions.slice(0, 4).map((text, index) => (_jsx(Suggestion, { className: "w-full", icon: suggestionIcons[index], onClick: handleSuggestionClick, suggestion: text, variant: "tertiary" }, text))) }), _jsxs("p", { className: "mb-3 whitespace-normal px-2 text-left text-gray-900 text-label-14", children: ["Tip: You can open and close chat with", _jsx(Kbd, { className: "material-base ml-1.5 text-gray-900", meta: true, small: true }), _jsx(Kbd, { className: "material-base ml-1 font-mono! text-gray-900", small: true, children: "I" })] })] })), _jsx(ChatPromptInput, { onChange: setPrompt, onStop: stop, onSubmit: (event) => {
|
|
173
181
|
event.preventDefault();
|
|
174
182
|
handleSubmit().catch((error) => {
|
|
175
183
|
console.error("Failed to submit chat message:", error);
|
|
176
184
|
});
|
|
177
185
|
}, status: status, textareaRef: textareaRef, value: prompt }), footer ? _jsx("div", { className: "text-gray-800 text-sm", children: footer }) : null] })] }));
|
|
178
186
|
};
|
|
179
|
-
const GeistdocsChatErrorFallback = ({ onClose }, { retry }) => (_jsxs("div", { className: "flex size-full flex-col items-start justify-center gap-4 p-6", "data-geistdocs-chat-error": true, role: "alert", children: [_jsx("h2", { className: "font-semibold text-lg", children: "Ask AI couldn't load" }), _jsx("p", { className: "text-gray-900 text-sm", children: "Try loading Ask AI again or close the panel to continue reading." }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { onClick: () => retry(),
|
|
187
|
+
const GeistdocsChatErrorFallback = ({ onClose }, { retry }) => (_jsxs("div", { className: "flex size-full flex-col items-start justify-center gap-4 p-6", "data-geistdocs-chat-error": true, role: "alert", children: [_jsx("h2", { className: "font-semibold text-lg", children: "Ask AI couldn't load" }), _jsx("p", { className: "text-gray-900 text-sm", children: "Try loading Ask AI again or close the panel to continue reading." }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { onClick: () => retry(), typeName: "button", children: "Try again" }), _jsx(Button, { onClick: onClose, typeName: "button", variant: "secondary", children: "Close" })] })] }));
|
|
180
188
|
const GeistdocsChatErrorBoundary = catchError(GeistdocsChatErrorFallback);
|
|
181
189
|
export const GeistdocsChatShell = () => {
|
|
182
190
|
const { enabled, isOpen, setIsOpen } = useGeistdocsChat();
|
|
183
191
|
const isMobile = useIsMobile();
|
|
184
|
-
useEffect(() => {
|
|
185
|
-
const handleKeyDown = (event) => {
|
|
186
|
-
if ((event.metaKey || event.ctrlKey) &&
|
|
187
|
-
!event.altKey &&
|
|
188
|
-
!event.shiftKey &&
|
|
189
|
-
event.key.toLowerCase() === "i") {
|
|
190
|
-
event.preventDefault();
|
|
191
|
-
setIsOpen((prev) => !prev);
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
195
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
196
|
-
}, [setIsOpen]);
|
|
197
192
|
if (!enabled) {
|
|
198
193
|
return null;
|
|
199
194
|
}
|
|
200
|
-
return (_jsxs(_Fragment, { children: [
|
|
195
|
+
return (_jsxs(_Fragment, { children: [isOpen ? (_jsx("style", { children: `
|
|
196
|
+
html {
|
|
197
|
+
scrollbar-width: none !important;
|
|
198
|
+
-ms-overflow-style: none !important;
|
|
199
|
+
}
|
|
200
|
+
html::-webkit-scrollbar {
|
|
201
|
+
display: none !important;
|
|
202
|
+
}
|
|
203
|
+
` })) : null, _jsx(Portal.Root, { children: _jsx("div", { className: cn(
|
|
201
204
|
// z-45 keeps the panel above the sticky navbar (z-40) but below
|
|
202
205
|
// modal surfaces like the search command menu, dialogs, and
|
|
203
206
|
// dropdowns (z-50), so opening the command menu paints over an
|
|
204
207
|
// open chat panel.
|
|
205
|
-
"fixed inset-y-0 right-0 z-45
|
|
208
|
+
"fixed inset-y-0 right-0 z-45 hidden h-full w-[400px] max-w-[75vw] flex-col gap-4 border-l bg-background-100 transition-transform min-[768px]:flex", "translate-x-full data-[state=open]:translate-x-0"), "data-state": isOpen ? "open" : "closed", children: _jsx(GeistdocsChatErrorBoundary, { onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { isOpen: isOpen }) }) }) }), _jsx("div", { className: "min-[768px]:hidden", children: _jsxs(Drawer, { className: "flex flex-col bg-background-100", height: "80dvh", onDismiss: () => setIsOpen(false), show: isMobile && isOpen, children: [_jsx(DrawerTitle, { className: "sr-only", children: "Ask AI" }), _jsx(GeistdocsChatErrorBoundary, { onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { isOpen: isOpen }) })] }) })] }));
|
|
206
209
|
};
|
|
@@ -8,6 +8,8 @@ export type SourcesTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
|
8
8
|
export declare const SourcesTrigger: ({ className, count, children, ...props }: SourcesTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export type SourcesContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
10
10
|
export declare const SourcesContent: ({ className, ...props }: SourcesContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export type SourceProps = ComponentProps<"a"
|
|
11
|
+
export type SourceProps = ComponentProps<"a"> & {
|
|
12
|
+
href: string;
|
|
13
|
+
};
|
|
12
14
|
export declare const Source: ({ href, title, children, ...props }: SourceProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/sources.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/sources.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEjD,eAAO,MAAM,OAAO,GAAI,yBAAyB,YAAY,4CAK5D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,GAAG;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,0CAK5B,mBAAmB,4CAerB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE5E,eAAO,MAAM,cAAc,GAAI,yBAG5B,mBAAmB,4CAErB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,eAAO,MAAM,MAAM,GAAI,qCAAqC,WAAW,4CAgBtE,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
4
|
+
import { IconChevronDown } from "@vercel/geistcn-assets/icons";
|
|
5
5
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../ui/collapsible";
|
|
6
|
-
export const Sources = ({ className, ...props }) => (_jsx(Collapsible, { className: cn("not-prose
|
|
7
|
-
export const SourcesTrigger = ({ className, count, children, ...props }) => (_jsx(CollapsibleTrigger, { className: cn("flex items-center
|
|
8
|
-
export const SourcesContent = ({ className, ...props }) => (_jsx(CollapsibleContent, { className: cn("
|
|
9
|
-
export const Source = ({ href, title, children, ...props }) =>
|
|
6
|
+
export const Sources = ({ className, ...props }) => (_jsx(Collapsible, { className: cn("not-prose text-gray-600 text-xs", className), ...props }));
|
|
7
|
+
export const SourcesTrigger = ({ className, count, children, ...props }) => (_jsx(CollapsibleTrigger, { className: cn("group flex items-center rounded-md border-none bg-transparent", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsxs("p", { className: "font-medium", children: ["Used ", count, " sources"] }), _jsx(IconChevronDown, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-180" })] })) }));
|
|
8
|
+
export const SourcesContent = ({ className, ...props }) => (_jsx(CollapsibleContent, { className: cn("flex flex-col", className), ...props }));
|
|
9
|
+
export const Source = ({ href, title, children, ...props }) => {
|
|
10
|
+
const external = href.startsWith("http://") || href.startsWith("https://");
|
|
11
|
+
return (_jsx("a", { className: "inline-flex min-w-0 max-w-full items-center underline underline-offset-1", href: href, rel: external ? "noreferrer" : undefined, target: external ? "_blank" : undefined, ...props, children: children ?? (_jsx("span", { className: "truncate font-medium text-gray-1000", children: title })) }));
|
|
12
|
+
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
import { Button } from "../ui/button";
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
2
|
import { ScrollArea } from "../ui/scroll-area";
|
|
4
3
|
export type SuggestionsProps = ComponentProps<typeof ScrollArea>;
|
|
5
4
|
export declare const Suggestions: ({ className, children, ...props }: SuggestionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export
|
|
7
|
-
|
|
5
|
+
export interface SuggestionProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: ReactNode;
|
|
8
10
|
onClick?: (suggestion: string) => void;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
size?: "tiny" | "small" | "medium" | "large" | null;
|
|
12
|
+
suggestion: string;
|
|
13
|
+
variant?: "default" | "secondary" | "tertiary";
|
|
14
|
+
}
|
|
15
|
+
export declare const Suggestion: ({ suggestion, onClick, className, disabled, icon, variant, size, children, }: SuggestionProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
16
|
//# sourceMappingURL=suggestion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/suggestion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/suggestion.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEjE,eAAO,MAAM,WAAW,GAAI,mCAIzB,gBAAgB,4CAKlB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;CAChD;AAED,eAAO,MAAM,UAAU,GAAI,8EASxB,eAAe,4CAqBjB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Button } from "@vercel/geistcn/components/button";
|
|
4
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
5
5
|
import { ScrollArea, ScrollBar } from "../ui/scroll-area";
|
|
6
|
-
export const Suggestions = ({ className, children, ...props }) => (_jsxs(ScrollArea, { className: "w-full overflow-x-auto whitespace-nowrap", ...props, children: [_jsx("div", { className: cn("
|
|
7
|
-
export const Suggestion = ({ suggestion, onClick, className, variant = "
|
|
6
|
+
export const Suggestions = ({ className, children, ...props }) => (_jsxs(ScrollArea, { className: "w-full overflow-x-auto whitespace-nowrap", ...props, children: [_jsx("div", { className: cn("w-max", className), children: children }), _jsx(ScrollBar, { className: "hidden", orientation: "horizontal" })] }));
|
|
7
|
+
export const Suggestion = ({ suggestion, onClick, className, disabled, icon, variant = "secondary", size = "small", children, }) => {
|
|
8
8
|
const handleClick = () => {
|
|
9
9
|
onClick?.(suggestion);
|
|
10
10
|
};
|
|
11
|
-
return (_jsx(Button, { className: cn("
|
|
11
|
+
return (_jsx(Button, { className: cn("justify-start! font-normal! text-left! hover:bg-gray-alpha-100! [&>span:last-child]:text-left", className), disabled: disabled, onClick: handleClick, prefix: icon, size: size, typeName: "button", variant: variant, children: children || suggestion }));
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-page-error-boundary.d.ts","sourceRoot":"","sources":["../../src/internal/docs-page-error-boundary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs-page-error-boundary.d.ts","sourceRoot":"","sources":["../../src/internal/docs-page-error-boundary.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,0BAA0B;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyBD,eAAO,MAAM,qBAAqB;;EAAoC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@vercel/geistcn/components/button";
|
|
4
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
3
5
|
import { catchError } from "next/error";
|
|
4
|
-
|
|
5
|
-
import { Button } from "./ui/button";
|
|
6
|
-
const DocsPageErrorFallback = ({ className }, { retry }) => (_jsxs("article", { className: cn("mx-auto flex w-full max-w-[900px] flex-col gap-4 px-4 py-6 [grid-area:main] md:px-6 md:pt-8 xl:px-8 xl:pt-14", className), "data-geistdocs-page-error": true, role: "alert", children: [_jsx("h1", { className: "font-semibold text-[1.75em]", children: "This page couldn't load" }), _jsx("p", { className: "text-gray-900", children: "Try loading the page again. The surrounding documentation remains available." }), _jsx(Button, { className: "w-fit", onClick: () => retry(), type: "button", children: "Try again" })] }));
|
|
6
|
+
const DocsPageErrorFallback = ({ className }, { retry }) => (_jsxs("article", { className: cn("mx-auto flex w-full max-w-[900px] flex-col gap-4 px-4 py-6 [grid-area:main] md:px-6 md:pt-8 xl:px-8 xl:pt-14", className), "data-geistdocs-page-error": true, role: "alert", children: [_jsx("h1", { className: "font-semibold text-[1.75em]", children: "This page couldn't load" }), _jsx("p", { className: "text-gray-900", children: "Try loading the page again. The surrounding documentation remains available." }), _jsx(Button, { className: "w-fit", onClick: () => retry(), typeName: "button", children: "Try again" })] }));
|
|
7
7
|
export const DocsPageErrorBoundary = catchError(DocsPageErrorFallback);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-arrow.d.ts","sourceRoot":"","sources":["../../src/internal/external-arrow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"external-arrow.d.ts","sourceRoot":"","sources":["../../src/internal/external-arrow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,KAAK,GACN,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,GAAG,GAAG,CAAC,OAAO,CAmBd"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "
|
|
2
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
3
3
|
/**
|
|
4
4
|
* External-link arrow (Geist U+2197 ↗) traced as an inline SVG, since geistdocs'
|
|
5
5
|
* Geist web-font subset omits the glyph. Sized in `em` with `currentColor` so it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rss-button.d.ts","sourceRoot":"","sources":["../../../src/internal/footer/rss-button.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,GAAI,cAAc;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"rss-button.d.ts","sourceRoot":"","sources":["../../../src/internal/footer/rss-button.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,GAAI,cAAc;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,4CAc5D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Button } from "@vercel/geistcn/components/button";
|
|
3
|
+
import { IconRss } from "@vercel/geistcn-assets/icons";
|
|
3
4
|
import { getPublicPath } from "../../config";
|
|
4
|
-
|
|
5
|
-
export const RSSButton = ({ basePath }) => (_jsx(Button, { asChild: true, size: "icon-sm", type: "button", variant: "ghost", children: _jsx("a", { "aria-label": "RSS feed", href: getPublicPath("/rss.xml", basePath), rel: "noopener", target: "_blank", children: _jsx(RssIcon, { className: "size-4" }) }) }));
|
|
5
|
+
export const RSSButton = ({ basePath }) => (_jsx(Button, { "aria-label": "RSS feed", Component: "a", href: getPublicPath("/rss.xml", basePath), rel: "noopener", shape: "square", size: "small", svgOnly: true, target: "_blank", type: "unstyled", children: _jsx(IconRss, { className: "size-4" }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-button.d.ts","sourceRoot":"","sources":["../../src/internal/github-button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-button.d.ts","sourceRoot":"","sources":["../../src/internal/github-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED,eAAO,MAAM,gBAAgB,GAC3B,SAAS,qBAAqB,KAC7B,MAAM,GAAG,IAGF,CAAC;AAEX,eAAO,MAAM,YAAY,GAAI,uBAAuB,iBAAiB,mDAuBpE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Button } from "@vercel/geistcn/components/button";
|
|
3
|
+
import { LogoIconGithub } from "@vercel/geistcn-assets/logos";
|
|
4
4
|
export const getGithubRepoUrl = (github) => github?.owner && github.repo
|
|
5
5
|
? `https://github.com/${github.owner}/${github.repo}`
|
|
6
6
|
: null;
|
|
@@ -9,5 +9,5 @@ export const GitHubButton = ({ className, github }) => {
|
|
|
9
9
|
if (!url) {
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
|
-
return (_jsx(Button, {
|
|
12
|
+
return (_jsx(Button, { "aria-label": "GitHub repository", Component: "a", className: className, href: url, rel: "noopener", shape: "square", size: "small", svgOnly: true, target: "_blank", type: "unstyled", children: _jsx(LogoIconGithub, { size: 16 }) }));
|
|
13
13
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PointerEvent as ReactPointerEvent } from "react";
|
|
2
|
+
export declare const getMouseDownRouterHref: (href: string, basePath: string | undefined) => string;
|
|
3
|
+
export declare const findMouseDownNavigationAnchor: (target: EventTarget | null, boundary: EventTarget | null) => HTMLAnchorElement | null;
|
|
4
|
+
export declare const shouldNavigateOnPointerDown: (event: ReactPointerEvent, anchor: HTMLAnchorElement) => boolean;
|
|
5
|
+
//# sourceMappingURL=mousedown-navigation-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mousedown-navigation-utils.d.ts","sourceRoot":"","sources":["../../src/internal/mousedown-navigation-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAwB/D,eAAO,MAAM,sBAAsB,GACjC,MAAM,MAAM,EACZ,UAAU,MAAM,GAAG,SAAS,WAoB7B,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,QAAQ,WAAW,GAAG,IAAI,EAC1B,UAAU,WAAW,GAAG,IAAI,KAC3B,iBAAiB,GAAG,IAWtB,CAAC;AAyBF,eAAO,MAAM,2BAA2B,GACtC,OAAO,iBAAiB,EACxB,QAAQ,iBAAiB,YA0C1B,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const TRAILING_SLASH_PATTERN = /\/$/;
|
|
2
|
+
const normalizeRouterBasePath = (basePath) => {
|
|
3
|
+
if (!basePath || basePath === "/") {
|
|
4
|
+
return "";
|
|
5
|
+
}
|
|
6
|
+
const normalized = basePath.startsWith("/") ? basePath : `/${basePath}`;
|
|
7
|
+
return normalized.replace(TRAILING_SLASH_PATTERN, "");
|
|
8
|
+
};
|
|
9
|
+
const NESTED_CONTROL_TAGS = new Set([
|
|
10
|
+
"BUTTON",
|
|
11
|
+
"INPUT",
|
|
12
|
+
"LABEL",
|
|
13
|
+
"SELECT",
|
|
14
|
+
"SUMMARY",
|
|
15
|
+
"TEXTAREA",
|
|
16
|
+
]);
|
|
17
|
+
const HANDLED_KEY = "__geistdocsMouseDownNavigationHandled";
|
|
18
|
+
export const getMouseDownRouterHref = (href, basePath) => {
|
|
19
|
+
const normalizedBasePath = normalizeRouterBasePath(basePath);
|
|
20
|
+
if (!normalizedBasePath) {
|
|
21
|
+
return href;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const url = new URL(href, window.location.origin);
|
|
25
|
+
if (url.pathname === normalizedBasePath) {
|
|
26
|
+
return `/${url.search}${url.hash}`;
|
|
27
|
+
}
|
|
28
|
+
if (url.pathname.startsWith(`${normalizedBasePath}/`)) {
|
|
29
|
+
return `${url.pathname.slice(normalizedBasePath.length)}${url.search}${url.hash}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return href;
|
|
34
|
+
}
|
|
35
|
+
return href;
|
|
36
|
+
};
|
|
37
|
+
export const findMouseDownNavigationAnchor = (target, boundary) => {
|
|
38
|
+
let element = target;
|
|
39
|
+
while (element && element !== boundary) {
|
|
40
|
+
if (element.tagName === "A") {
|
|
41
|
+
return element;
|
|
42
|
+
}
|
|
43
|
+
element = element.parentElement;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
};
|
|
47
|
+
const startsOnNestedControl = (target, anchor) => {
|
|
48
|
+
if (anchor.hasAttribute("data-no-mousedown-nav")) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
let element = target;
|
|
52
|
+
while (element && element !== anchor) {
|
|
53
|
+
if (element.hasAttribute("data-no-mousedown-nav") ||
|
|
54
|
+
NESTED_CONTROL_TAGS.has(element.tagName) ||
|
|
55
|
+
element.getAttribute("role") === "button") {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
element = element.parentElement;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
};
|
|
62
|
+
export const shouldNavigateOnPointerDown = (event, anchor) => {
|
|
63
|
+
if (event.defaultPrevented ||
|
|
64
|
+
event.button !== 0 ||
|
|
65
|
+
event.pointerType !== "mouse" ||
|
|
66
|
+
event.altKey ||
|
|
67
|
+
event.ctrlKey ||
|
|
68
|
+
event.metaKey ||
|
|
69
|
+
event.shiftKey ||
|
|
70
|
+
startsOnNestedControl(event.target, anchor)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
const nativeEvent = event.nativeEvent;
|
|
74
|
+
if (nativeEvent[HANDLED_KEY] === true) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
const target = anchor.getAttribute("target");
|
|
78
|
+
if ((target && target !== "_self") || anchor.hasAttribute("download")) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
const href = anchor.getAttribute("href");
|
|
82
|
+
if (!href || href.startsWith("#")) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
if (new URL(href, window.location.origin).origin !== window.location.origin) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
nativeEvent[HANDLED_KEY] = true;
|
|
94
|
+
return true;
|
|
95
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Starts same-origin mouse navigation on pointer down, matching Vercel's
|
|
4
|
+
* marketing navbar behavior. Browser click behavior remains the fallback for
|
|
5
|
+
* keyboard activation, touch, modified clicks, downloads, and external links.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MouseDownNavigation: ({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=mousedown-navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mousedown-navigation.d.ts","sourceRoot":"","sources":["../../src/internal/mousedown-navigation.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAQf;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAkDxE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRouter } from "next/navigation";
|
|
4
|
+
import { useCallback, useRef, } from "react";
|
|
5
|
+
import { useGeistdocsConfig } from "./config-context";
|
|
6
|
+
import { findMouseDownNavigationAnchor, getMouseDownRouterHref, shouldNavigateOnPointerDown, } from "./mousedown-navigation-utils";
|
|
7
|
+
/**
|
|
8
|
+
* Starts same-origin mouse navigation on pointer down, matching Vercel's
|
|
9
|
+
* marketing navbar behavior. Browser click behavior remains the fallback for
|
|
10
|
+
* keyboard activation, touch, modified clicks, downloads, and external links.
|
|
11
|
+
*/
|
|
12
|
+
export const MouseDownNavigation = ({ children }) => {
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
const { basePath } = useGeistdocsConfig();
|
|
15
|
+
const navigated = useRef(false);
|
|
16
|
+
const onPointerDownCapture = useCallback((event) => {
|
|
17
|
+
// A drag-off has no follow-up click inside this wrapper. Clear stale
|
|
18
|
+
// state at the beginning of every pointer interaction.
|
|
19
|
+
navigated.current = false;
|
|
20
|
+
const anchor = findMouseDownNavigationAnchor(event.target, event.currentTarget);
|
|
21
|
+
if (!(anchor && shouldNavigateOnPointerDown(event, anchor))) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const href = anchor.getAttribute("href");
|
|
25
|
+
if (!href) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
navigated.current = true;
|
|
29
|
+
router.push(getMouseDownRouterHref(href, basePath), {
|
|
30
|
+
scroll: anchor.getAttribute("data-scroll") !== "false",
|
|
31
|
+
});
|
|
32
|
+
}, [basePath, router]);
|
|
33
|
+
const onClickCapture = useCallback((event) => {
|
|
34
|
+
if (navigated.current) {
|
|
35
|
+
// Prevent Next.js/the browser from navigating a second time without
|
|
36
|
+
// stopping propagation, so click handlers and analytics still run.
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
navigated.current = false;
|
|
39
|
+
}
|
|
40
|
+
}, []);
|
|
41
|
+
return (_jsx("div", { onClickCapture: onClickCapture, onPointerDownCapture: onPointerDownCapture, style: { display: "contents" }, children: children }));
|
|
42
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desktop-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/desktop-menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"desktop-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/desktop-menu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAYtB,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAiBD,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,wBAAwB,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,oBAAoB,GAC7B,eAAe,EAAE,CAYnB;AA4DD,eAAO,MAAM,WAAW,GAAI,sBAAsB,gBAAgB,4CAsEjE,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
4
|
+
import { IconArrowUpRightSmall } from "@vercel/geistcn-assets/icons";
|
|
3
5
|
import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui";
|
|
4
6
|
import { useState } from "react";
|
|
5
|
-
import { IconArrowUpRightSmall } from "../../assets/icons/icon-arrow-up-right-small";
|
|
6
|
-
import { cn } from "../cn";
|
|
7
7
|
import { LocalizedLink } from "../localized-link";
|
|
8
8
|
import { NavigationMenu, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, } from "../ui/navigation-menu";
|
|
9
9
|
import { NAVBAR_PANEL_CLASSNAME, PanelLink } from "./navbar-logo";
|
|
@@ -49,5 +49,5 @@ const DropdownNavItem = ({ first, item, }) => {
|
|
|
49
49
|
export const DesktopMenu = ({ items, className }) => {
|
|
50
50
|
const isActive = useNavActive();
|
|
51
51
|
const [navOpen, setNavOpen] = useState(false);
|
|
52
|
-
return (_jsxs(_Fragment, { children: [_jsx(NavigationMenu, { delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: cn("h-16 items-stretch gap-0", className), children: items.map((item, index) => "items" in item ? (_jsx(DropdownNavItem, { first: index === 0, item: item }, item.label)) : (_jsx(NavigationMenuItem, { className: "flex", children: _jsx(NavigationMenuLink, { active: isActive(item.href), asChild: true, className: topLevelItemClassName(index === 0), children: item.href.startsWith("http") ? (_jsxs("a", { className: "flex flex-row items-center gap-1", href: item.href, rel: "noopener", target: "_blank", children: [item.label, _jsx(IconArrowUpRightSmall, { "aria-hidden": "true", className: "will-change-transform", size: 12 })] })) : (_jsx(LocalizedLink, { href: item.href, children: item.label })) }) }, item.href))) }) }), _jsx("div", { "aria-hidden": "true", className: cn("pointer-events-none fixed inset-x-0 top-16 bottom-0 z-0 bg-background-200/60", navOpen ? "opacity-100" : "opacity-0") })] }));
|
|
52
|
+
return (_jsxs(_Fragment, { children: [_jsx(NavigationMenu, { "aria-label": "Primary navigation", delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: cn("h-16 items-stretch gap-0", className), children: items.map((item, index) => "items" in item ? (_jsx(DropdownNavItem, { first: index === 0, item: item }, item.label)) : (_jsx(NavigationMenuItem, { className: "flex", children: _jsx(NavigationMenuLink, { active: isActive(item.href), asChild: true, className: topLevelItemClassName(index === 0), children: item.href.startsWith("http") ? (_jsxs("a", { className: "flex flex-row items-center gap-1", href: item.href, rel: "noopener", target: "_blank", children: [item.label, _jsx(IconArrowUpRightSmall, { "aria-hidden": "true", className: cn(navOpen && "will-change-transform"), size: 12 })] })) : (_jsx(LocalizedLink, { href: item.href, children: item.label })) }) }, item.href))) }) }), _jsx("div", { "aria-hidden": "true", className: cn("pointer-events-none fixed inset-x-0 top-16 bottom-0 z-0 bg-background-200/60", navOpen ? "opacity-100" : "opacity-0") })] }));
|
|
53
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/mobile-menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mobile-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/mobile-menu.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,yBAAyB,EAEzB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAQtB,UAAU,eAAe;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,gBAAgB,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAC1C,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA6PD,eAAO,MAAM,UAAU,GAAI,0DAMxB,eAAe,4CA4HjB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { ThemeSwitcher } from "@vercel/geistcn/components/theme-switcher";
|
|
4
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
5
|
+
import { IconChevronDownSmall } from "@vercel/geistcn-assets/icons";
|
|
6
|
+
import { useMediaQuery } from "phase/react";
|
|
3
7
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { IconChevronDownSmall } from "../../assets/icons/icon-chevron-down-small";
|
|
5
|
-
import { ThemeSwitcher } from "../../components/theme-switcher";
|
|
6
8
|
import { SearchButton } from "../../controls";
|
|
7
|
-
import { cn } from "../cn";
|
|
8
9
|
import { ExternalArrow } from "../external-arrow";
|
|
9
10
|
import { LocalizedLink } from "../localized-link";
|
|
10
11
|
import { groupDropdownItems } from "./desktop-menu";
|
|
@@ -50,9 +51,10 @@ function OssCollapsible({ sections, onLinkClick, }) {
|
|
|
50
51
|
return (_jsxs("details", { className: "group flex flex-col", name: "geistdocs-mobile-nav", children: [_jsxs("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md px-3 font-normal text-2xl text-gray-900 outline-none transition-colors hover:bg-gray-alpha-100 hover:text-gray-1000 [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { children: ["Vercel OSS", _jsx(ExternalArrow, { className: "mt-1" })] }), _jsx(IconChevronDownSmall, { className: "relative shrink-0 text-gray-700 transition-transform duration-150 group-open:rotate-180", size: 24 })] }), _jsx("div", { className: "flex flex-col gap-6 px-3 py-4", children: sections.map((section) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "mb-2 font-mono text-gray-700 text-xs uppercase tracking-wider", children: section.heading }), _jsx("ul", { className: "-mx-3 flex list-none flex-col", children: section.items.map((product) => (_jsx("li", { children: _jsx(SubNavLink, { external: product.external ?? product.href.startsWith("http"), href: product.href, onClick: onLinkClick, children: product.label }) }, product.href))) })] }, section.heading))) })] }));
|
|
51
52
|
}
|
|
52
53
|
function MobileMenuButton({ expanded, onClick, }) {
|
|
53
|
-
return (_jsx("button", { "aria-expanded": expanded, "aria-label": expanded ? "Close menu" : "Open menu", className: "relative flex @min-[1024px]:hidden size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100", "data-slot": "mobile-menu-toggle", onClick: onClick, type: "button", children: _jsxs("span", { className: "flex flex-col items-center justify-center gap-[5px]", children: [_jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-
|
|
54
|
+
return (_jsx("button", { "aria-expanded": expanded, "aria-label": expanded ? "Close menu" : "Open menu", className: "relative flex @min-[1024px]:hidden size-8 items-center justify-center rounded-full border border-gray-200 transition-colors hover:bg-gray-100", "data-slot": "mobile-menu-toggle", onClick: onClick, type: "button", children: _jsxs("span", { className: "flex flex-col items-center justify-center gap-[5px]", children: [_jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-transform duration-150", expanded && "translate-y-[3.25px] rotate-45") }), _jsx("span", { className: cn("block h-[1.5px] w-3.5 bg-gray-1000 transition-transform duration-150", expanded && "-translate-y-[3.25px] -rotate-45") })] }) }));
|
|
54
55
|
}
|
|
55
56
|
export const MobileMenu = ({ activeProduct, githubUrl, nav, ossProducts, showOss = false, }) => {
|
|
57
|
+
const isDesktop = useMediaQuery("(min-width: 1024px)");
|
|
56
58
|
const [show, setShow] = useState(false);
|
|
57
59
|
const isActive = useNavActive();
|
|
58
60
|
// Resolve the default/custom list and drop the active product here on the
|
|
@@ -83,18 +85,11 @@ export const MobileMenu = ({ activeProduct, githubUrl, nav, ossProducts, showOss
|
|
|
83
85
|
useEffect(() => {
|
|
84
86
|
setShow(false);
|
|
85
87
|
}, []);
|
|
86
|
-
// Close the sheet when resizing up to desktop (also releases the scroll lock).
|
|
87
88
|
useEffect(() => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
onChange();
|
|
95
|
-
mq.addEventListener("change", onChange);
|
|
96
|
-
return () => mq.removeEventListener("change", onChange);
|
|
97
|
-
}, []);
|
|
89
|
+
if (isDesktop) {
|
|
90
|
+
setShow(false);
|
|
91
|
+
}
|
|
92
|
+
}, [isDesktop]);
|
|
98
93
|
useEffect(() => {
|
|
99
94
|
const handleEscape = (e) => {
|
|
100
95
|
if (e.key === "Escape" && show) {
|
|
@@ -113,7 +108,7 @@ export const MobileMenu = ({ activeProduct, githubUrl, nav, ossProducts, showOss
|
|
|
113
108
|
const close = () => setShow(false);
|
|
114
109
|
return (_jsxs(_Fragment, { children: [_jsx(MobileMenuButton, { expanded: show, onClick: () => setShow(!show) }), _jsx("div", { className: cn("fixed inset-0 top-16 z-40 @min-[1024px]:hidden bg-background-200 transition-opacity duration-200", show
|
|
115
110
|
? "pointer-events-auto opacity-100"
|
|
116
|
-
: "pointer-events-none opacity-0"), onClick: close }), _jsxs("div", { className: cn("fixed inset-x-0 top-16 bottom-0 z-40 @min-[1024px]:hidden overflow-y-auto bg-background-200 px-2 transition-
|
|
111
|
+
: "pointer-events-none opacity-0"), onClick: close }), _jsxs("div", { className: cn("fixed inset-x-0 top-16 bottom-0 z-40 @min-[1024px]:hidden overflow-y-auto bg-background-200 px-2 transition-[transform,opacity] duration-200", show
|
|
117
112
|
? "translate-y-0 opacity-100"
|
|
118
113
|
: "pointer-events-none -translate-y-2 opacity-0"), children: [_jsx("div", { className: "p-4", children: _jsx(SearchButton, { className: "w-full py-4.5", onClick: close }) }), _jsxs("nav", { className: "flex flex-col px-1", children: [nav.map((item) => "items" in item ? (_jsx(NavDropdownCollapsible, { dropdown: item, onLinkClick: close }, item.label)) : (_jsx(NavLink, { active: isActive(item.href), external: item.href.startsWith("http"), href: item.href, onClick: close, children: item.label }, item.href))), githubUrl ? (_jsx(NavLink, { external: true, href: githubUrl, onClick: close, children: "GitHub" })) : null, _jsx(OssCollapsible, { onLinkClick: close, sections: ossSections })] }), _jsx("div", { className: "mt-2 flex justify-end px-4 py-4", children: _jsx(ThemeSwitcher, { small: true }) })] })] }));
|
|
119
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navbar-logo.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-logo.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAU9D,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAuF3D,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,gNAC4K,CAAC;AAEhN;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACzE,2CA+BA;AAwCD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,yBAAyB,EAAE,GAAG,SAAS,EACjD,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,yBAAyB,EAAE,CAI7B;AAED,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,CACA;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C,GACD;IACE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;CACjB,CACJ,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CAyLjB"}
|