@vercel/geistdocs 1.25.0 → 1.25.1-canary.738f050
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 +28 -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 +3 -3
- package/dist/components/copy-prompt.d.ts.map +1 -1
- package/dist/components/copy-prompt.js +4 -4
- package/dist/components/mermaid.js +1 -1
- package/dist/controls.d.ts +8 -4
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +14 -14
- 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/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 +15 -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 +5 -5
- 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 +27 -19
- 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 +6 -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/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 +3 -3
- 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 +1 -1
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +19 -20
- 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 +9 -9
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/search.js +2 -2
- 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 +6 -8
- package/dist/internal/toc-items.d.ts.map +1 -1
- package/dist/internal/toc-items.js +1 -1
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/internal/ui/dropdown-menu.js +5 -5
- package/dist/internal/ui/navigation-menu.d.ts.map +1 -1
- package/dist/internal/ui/navigation-menu.js +2 -2
- 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/layout.js +1 -1
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +9 -3
- 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 +8 -3
- 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 +131 -86
- package/docs/manifest.json +1 -10
- package/docs/pages/migration.md +5 -7
- package/docs/pages/syntax.md +122 -11
- package/docs/pages/versioned-docs.md +3 -3
- package/docs/sitemap.md +0 -1
- package/package.json +10 -102
- 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 +7 -4
- package/template/app/styles/geistdocs.css +17 -14
- package/template/content/docs/configuration.cn.mdx +2 -2
- package/template/content/docs/migration.mdx +5 -7
- package/template/content/docs/syntax.mdx +123 -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 +5 -7
- package/theme.css +71 -700
- 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,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { Button } from "@vercel/geistcn/components/button";
|
|
4
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
5
|
+
import { IconArrowDown } from "@vercel/geistcn-assets/icons";
|
|
4
6
|
import { useCallback } from "react";
|
|
5
7
|
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
|
6
|
-
import { cn } from "../cn";
|
|
7
|
-
import { Button } from "../ui/button";
|
|
8
8
|
export const Conversation = ({ className, ...props }) => (_jsx(StickToBottom, { className: cn("relative flex-1 overflow-y-hidden", className), initial: "smooth", resize: "smooth", role: "log", ...props }));
|
|
9
9
|
export const ConversationContent = ({ className, ...props }) => (_jsx(StickToBottom.Content, { className: cn("flex flex-col gap-8 p-4", className), ...props }));
|
|
10
|
-
export const ConversationScrollButton = ({ className,
|
|
10
|
+
export const ConversationScrollButton = ({ className, }) => {
|
|
11
11
|
const { isAtBottom, scrollToBottom } = useStickToBottomContext();
|
|
12
12
|
const handleScrollToBottom = useCallback(() => {
|
|
13
13
|
scrollToBottom();
|
|
14
14
|
}, [scrollToBottom]);
|
|
15
|
-
return isAtBottom ? null : (_jsx(Button, { className: cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full border-none bg-gray-1000 text-background-100 hover:bg-gray-1000/80 hover:text-background-100", className), onClick: handleScrollToBottom,
|
|
15
|
+
return isAtBottom ? null : (_jsx(Button, { "aria-label": "Scroll to bottom", className: cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full border-none bg-gray-1000 text-background-100 hover:bg-gray-1000/80 hover:text-background-100", className), onClick: handleScrollToBottom, shape: "circle", svgOnly: true, typeName: "button", variant: "secondary", children: _jsx(IconArrowDown, { className: "size-4" }) }));
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-chat.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/copy-chat.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-chat.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/copy-chat.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAGpC,eAAO,MAAM,QAAQ,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,4CAkD/D,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@vercel/geistcn/components/button";
|
|
4
|
+
import { useToasts } from "@vercel/geistcn/components/toasts";
|
|
5
|
+
import { Tooltip } from "@vercel/geistcn/components/tooltip";
|
|
6
|
+
import { IconCheck, IconCopy } from "@vercel/geistcn-assets/icons";
|
|
4
7
|
import { useState } from "react";
|
|
5
|
-
import { toast } from "sonner";
|
|
6
|
-
import { Button } from "../ui/button";
|
|
7
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
|
|
8
8
|
export const CopyChat = ({ messages }) => {
|
|
9
9
|
const [copied, setCopied] = useState(false);
|
|
10
|
+
const toast = useToasts();
|
|
10
11
|
const handleCopyChat = async () => {
|
|
11
12
|
const markdown = messages
|
|
12
13
|
.map((message) => {
|
|
@@ -20,16 +21,18 @@ export const CopyChat = ({ messages }) => {
|
|
|
20
21
|
.join("\n\n---\n\n");
|
|
21
22
|
try {
|
|
22
23
|
await navigator.clipboard.writeText(markdown);
|
|
23
|
-
toast.success("Chat copied to clipboard");
|
|
24
|
+
toast.success({ text: "Chat copied to clipboard" });
|
|
24
25
|
setCopied(true);
|
|
25
26
|
setTimeout(() => setCopied(false), 2000);
|
|
26
27
|
}
|
|
27
28
|
catch (error) {
|
|
28
|
-
toast.error(
|
|
29
|
-
|
|
29
|
+
toast.error({
|
|
30
|
+
text: error instanceof Error
|
|
31
|
+
? `Failed to copy chat: ${error.message}`
|
|
32
|
+
: "Failed to copy chat",
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
35
|
};
|
|
33
|
-
const Icon = copied ?
|
|
34
|
-
return (
|
|
36
|
+
const Icon = copied ? IconCheck : IconCopy;
|
|
37
|
+
return (_jsx(Tooltip, { position: "bottom", text: "Copy chat as Markdown", children: _jsx(Button, { "aria-label": copied ? "Chat copied" : "Copy chat as Markdown", className: "text-gray-800! disabled:bg-gray-alpha-100!", disabled: messages.length === 0, onClick: handleCopyChat, shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(Icon, { size: 14 }) }) }));
|
|
35
38
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dots-spinner.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/dots-spinner.tsx"],"names":[],"mappings":"AAOA,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,KAAW,GACZ,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CAgBA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
const FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
6
|
+
export function DotsSpinner({ className, speed = 150, }) {
|
|
7
|
+
const [currentFrame, setCurrentFrame] = useState(0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const interval = window.setInterval(() => {
|
|
10
|
+
setCurrentFrame((frame) => (frame + 1) % FRAMES.length);
|
|
11
|
+
}, speed);
|
|
12
|
+
return () => window.clearInterval(interval);
|
|
13
|
+
}, [speed]);
|
|
14
|
+
return (_jsx("span", { className: cn("inline-block w-4 text-center", className), children: FRAMES[currentFrame] }));
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-metadata.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/message-metadata.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-metadata.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/message-metadata.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,IAAI,CAAC;AAI/D,UAAU,oBAAoB;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC3B;AAkBD,eAAO,MAAM,eAAe,GAAI,wBAG7B,oBAAoB,mDA+FtB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { IconBookmark, IconChevronDown } from "@vercel/geistcn-assets/icons";
|
|
3
4
|
import { getToolName, isToolUIPart } from "ai";
|
|
4
|
-
import {
|
|
5
|
-
import { Shimmer } from "./shimmer";
|
|
5
|
+
import { DotsSpinner } from "./dots-spinner";
|
|
6
6
|
import { Source, Sources, SourcesContent, SourcesTrigger } from "./sources";
|
|
7
7
|
const WORD_SEPARATOR_PATTERN = /[_-]+/g;
|
|
8
|
+
const LoadingContainer = ({ children }) => (_jsx("div", { className: "h-12 animate-pulse pt-2 text-gray-900 text-sm", children: children }));
|
|
8
9
|
const getToolActivityLabel = (part) => {
|
|
9
10
|
const name = getToolName(part).replace(WORD_SEPARATOR_PATTERN, " ").trim();
|
|
10
11
|
return name ? `Running ${name}...` : "Working...";
|
|
@@ -14,12 +15,12 @@ export const MessageMetadata = ({ parts, inProgress, }) => {
|
|
|
14
15
|
.filter((part) => part.type === "text" || part.type === "reasoning" || isToolUIPart(part))
|
|
15
16
|
.at(-1);
|
|
16
17
|
if (!lastPart) {
|
|
17
|
-
return _jsx(
|
|
18
|
+
return (_jsx(LoadingContainer, { children: _jsx(DotsSpinner, {}) }));
|
|
18
19
|
}
|
|
19
20
|
if (lastPart.type === "reasoning" &&
|
|
20
21
|
lastPart.state !== "done" &&
|
|
21
22
|
inProgress) {
|
|
22
|
-
return
|
|
23
|
+
return (_jsxs(LoadingContainer, { children: [_jsx(DotsSpinner, {}), " Thinking..."] }));
|
|
23
24
|
}
|
|
24
25
|
const tool = isToolUIPart(lastPart) ? lastPart : null;
|
|
25
26
|
const hasTextPart = parts.some((part) => part.type === "text");
|
|
@@ -27,15 +28,15 @@ export const MessageMetadata = ({ parts, inProgress, }) => {
|
|
|
27
28
|
.filter((part) => part.type === "source-url")
|
|
28
29
|
.map((part) => [part.url, part])).values());
|
|
29
30
|
if (sources.length > 0 && !hasTextPart && inProgress) {
|
|
30
|
-
return
|
|
31
|
+
return (_jsxs(LoadingContainer, { children: [_jsx(DotsSpinner, {}), " Searching..."] }));
|
|
31
32
|
}
|
|
32
33
|
if (tool &&
|
|
33
34
|
inProgress &&
|
|
34
35
|
(tool.state === "input-streaming" || tool.state === "input-available")) {
|
|
35
|
-
return
|
|
36
|
+
return (_jsxs(LoadingContainer, { children: [_jsx(DotsSpinner, {}), " ", getToolActivityLabel(tool)] }));
|
|
36
37
|
}
|
|
37
38
|
if (sources.length > 0 && !(tool && inProgress)) {
|
|
38
|
-
return (_jsxs(Sources, { children: [_jsxs(SourcesTrigger, { count: sources.length, children: [_jsx(
|
|
39
|
+
return (_jsxs(Sources, { className: "mb-4", children: [_jsxs(SourcesTrigger, { className: "w-full max-w-fit cursor-pointer justify-between gap-2 py-1 pr-3 pl-0 text-left", count: sources.length, children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(IconBookmark, { className: "size-4", color: "gray-900" }), _jsxs("p", { className: "text-gray-900 text-xs", children: ["Used ", sources.length, " source", sources.length === 1 ? "" : "s"] })] }), _jsx(IconChevronDown, { className: "size-4 transition-transform duration-200 group-data-[state=open]:rotate-180", color: "gray-900" })] }), _jsx(SourcesContent, { children: _jsx("ul", { className: "mt-1.5 list-disc pl-4", children: sources.map((source) => (_jsx("li", { className: "my-1.5", children: _jsx(Source, { href: source.url, title: source.title }) }, source.url))) }) })] }));
|
|
39
40
|
}
|
|
40
41
|
if (!tool && sources.length === 0) {
|
|
41
42
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/message.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/message.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC1D,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,+BAA+B,YAAY,4CASlE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjE,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAqBrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAErE,eAAO,MAAM,eAAe,gEACA,oBAAoB,6CAW/C,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cjk } from "@streamdown/cjk";
|
|
4
4
|
import { code } from "@streamdown/code";
|
|
5
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
5
6
|
import { memo } from "react";
|
|
6
7
|
import { Streamdown } from "streamdown";
|
|
7
|
-
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const MessageResponse = memo(({ className, ...props }) => (_jsx(Streamdown, { className: cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className), plugins: { code, cjk }, ...props })), (prevProps, nextProps) => prevProps.children === nextProps.children);
|
|
8
|
+
export const Message = ({ className, from, ...props }) => (_jsx("div", { className: cn("group flex w-full flex-col gap-2 py-4 [&>div]:max-w-[80%]", from === "user" ? "is-user items-end" : "is-assistant items-start", className), ...props }));
|
|
9
|
+
export const MessageContent = ({ children, className, ...props }) => (_jsxs("div", { className: cn("relative flex min-h-10 w-fit min-w-0 max-w-full flex-col gap-2 whitespace-normal rounded-[12px] px-4 py-2 text-left text-sm leading-relaxed", "group-[.is-user]:bg-gray-1000 group-[.is-user]:text-white group-[.is-user]:dark:bg-gray-100 group-[.is-user]:dark:text-gray-1000", "group-[.is-assistant]:min-h-0 group-[.is-assistant]:px-0 group-[.is-assistant]:py-0 group-[.is-assistant]:text-gray-1000", className), ...props, children: [_jsx("div", { className: "is-user:dark", children: children }), _jsx("svg", { "aria-hidden": "true", className: "absolute right-[2.5px] -bottom-[0.5px] hidden translate-x-1/2 group-[.is-user]:block group-[.is-user]:fill-gray-1000 group-[.is-user]:dark:fill-gray-100", height: "14", viewBox: "0 0 18 14", width: "18", children: _jsx("path", { d: "M0.866025 8.80383L11.2583 0.803833C11.2583 0.803833 12.0621 9.5 17.2583 13.1961C12.0621 13.1961 0.866025 8.80383 0.866025 8.80383Z" }) })] }));
|
|
10
|
+
export const MessageResponse = memo(({ className, ...props }) => (_jsx(Streamdown, { className: cn("size-full whitespace-normal text-left text-sm leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className), plugins: { code, cjk }, ...props })), (prevProps, nextProps) => prevProps.children === nextProps.children);
|
|
11
11
|
MessageResponse.displayName = "MessageResponse";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/prompt-input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/prompt-input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAI,6DAO7B,oBAAoB,4CAmFtB,CAAC"}
|
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea, } from "../ui/input-group";
|
|
3
|
+
import { Button } from "@vercel/geistcn/components/button";
|
|
4
|
+
import { IconArrowUp, IconStopCircle } from "@vercel/geistcn-assets/icons";
|
|
5
|
+
import { useCallback, useEffect, } from "react";
|
|
7
6
|
export const ChatPromptInput = ({ onChange, onStop, onSubmit, status, textareaRef, value, }) => {
|
|
8
|
-
const [isComposing, setIsComposing] = useState(false);
|
|
9
7
|
const isGenerating = status === "submitted" || status === "streaming";
|
|
8
|
+
const adjustHeight = useCallback(() => {
|
|
9
|
+
const textarea = textareaRef.current;
|
|
10
|
+
if (!textarea) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
textarea.style.height = "56px";
|
|
14
|
+
const nextHeight = textarea.scrollHeight > 56 ? Math.min(textarea.scrollHeight, 200) : 56;
|
|
15
|
+
textarea.style.height = `${nextHeight}px`;
|
|
16
|
+
}, [textareaRef]);
|
|
17
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: controlled value changes must resize the textarea after React updates its DOM value.
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
adjustHeight();
|
|
20
|
+
}, [adjustHeight, value]);
|
|
21
|
+
const handleChange = (event) => {
|
|
22
|
+
adjustHeight();
|
|
23
|
+
onChange(event.currentTarget.value);
|
|
24
|
+
};
|
|
10
25
|
const handleKeyDown = (event) => {
|
|
11
|
-
if (event.key === "Enter"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
26
|
+
if (event.key === "Enter" &&
|
|
27
|
+
!event.shiftKey &&
|
|
28
|
+
!event.nativeEvent.isComposing) {
|
|
15
29
|
event.preventDefault();
|
|
16
|
-
|
|
17
|
-
if (submitButton?.disabled) {
|
|
30
|
+
if (value.trim().length <= 3) {
|
|
18
31
|
return;
|
|
19
32
|
}
|
|
20
33
|
event.currentTarget.form?.requestSubmit();
|
|
21
34
|
}
|
|
22
35
|
};
|
|
23
|
-
|
|
24
|
-
if (status === "submitted") {
|
|
25
|
-
icon = _jsx(Loader2Icon, { className: "size-4 animate-spin" });
|
|
26
|
-
}
|
|
27
|
-
else if (status === "streaming") {
|
|
28
|
-
icon = _jsx(SquareIcon, { className: "size-4" });
|
|
29
|
-
}
|
|
30
|
-
else if (status === "error") {
|
|
31
|
-
icon = _jsx(XIcon, { className: "size-4" });
|
|
32
|
-
}
|
|
33
|
-
return (_jsx("form", { onSubmit: onSubmit, children: _jsxs(InputGroup, { children: [_jsx(InputGroupTextarea, { className: cn("field-sizing-content max-h-48 min-h-16"), maxLength: 1000, name: "message", onChange: (event) => onChange(event.currentTarget.value), onCompositionEnd: () => setIsComposing(false), onCompositionStart: () => setIsComposing(true), onKeyDown: handleKeyDown, placeholder: "What would you like to know?", ref: textareaRef, value: value }), _jsxs(InputGroupAddon, { align: "block-end", className: "justify-between gap-1", children: [_jsxs("p", { className: "text-gray-800 text-xs", children: [value.length, " / 1000"] }), _jsx(InputGroupButton, { "aria-label": isGenerating ? "Stop" : "Submit", onClick: isGenerating && onStop
|
|
34
|
-
? (event) => {
|
|
35
|
-
event.preventDefault();
|
|
36
|
-
onStop();
|
|
37
|
-
}
|
|
38
|
-
: undefined, size: "icon-sm", type: isGenerating && onStop ? "button" : "submit", variant: "default", children: icon })] })] }) }));
|
|
36
|
+
return (_jsx("div", { className: "cursor-text rounded-[12px] border border-gray-300 border-solid pt-2 pb-2 shadow-xs transition-colors duration-250 focus-within:border-gray-500", children: _jsxs("form", { className: "flex flex-col items-center gap-2", onSubmit: onSubmit, children: [_jsx("textarea", { className: "min-h-0 w-full resize-none rounded-none border-0 bg-transparent px-4 py-2 font-sans text-gray-1000 text-sm shadow-none outline-hidden ring-0 placeholder:text-gray-600 focus:outline-none focus-visible:ring-0", maxLength: 1000, name: "message", onChange: handleChange, onKeyDown: handleKeyDown, placeholder: "Ask a question...", ref: textareaRef, value: value }), _jsx("div", { className: "flex w-full items-center justify-end px-2", children: isGenerating && onStop ? (_jsx(Button, { className: "animate-fade-in-scale", onClick: onStop, prefix: _jsx(IconStopCircle, { className: "size-4" }), size: "small", typeName: "button", children: "Stop" })) : (_jsx(Button, { "aria-label": "Submit", className: "size-8 animate-fade-in-scale p-0", disabled: value.trim().length <= 3, shape: "square", size: "small", svgOnly: true, typeName: "submit", children: _jsx(IconArrowUp, { className: "size-4" }) })) })] }) }));
|
|
39
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shell.tsx"],"names":[],"mappings":"AAgYA,eAAO,MAAM,kBAAkB,sDA6D9B,CAAC"}
|
|
@@ -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,27 +162,29 @@ 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();
|
|
@@ -202,5 +210,5 @@ export const GeistdocsChatShell = () => {
|
|
|
202
210
|
// modal surfaces like the search command menu, dialogs, and
|
|
203
211
|
// dropdowns (z-50), so opening the command menu paints over an
|
|
204
212
|
// open chat panel.
|
|
205
|
-
"fixed inset-y-0 right-0 z-45 flex h-full w-
|
|
213
|
+
"fixed inset-y-0 right-0 z-45 flex h-full w-[400px] max-w-[75vw] flex-col gap-4 border-l bg-background-100 transition-all", "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: "md: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
214
|
};
|
|
@@ -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,4CAYtE,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 {
|
|
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 }) => (_jsx("a", { className: "flex items-center
|
|
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 }) => (_jsx("a", { className: "inline-flex min-w-0 max-w-full items-center underline underline-offset-1", href: href, rel: "noreferrer", target: "_blank", ...props, children: children ?? (_jsx("span", { className: "truncate font-medium text-gray-1000", children: title })) }));
|
|
@@ -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
|
};
|
|
@@ -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"}
|