@vercel/geistdocs 1.25.1-canary.9556d32 → 1.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/icon-acronym-ts.d.ts +5 -0
- package/dist/assets/icons/icon-acronym-ts.d.ts.map +1 -0
- package/dist/assets/icons/icon-acronym-ts.js +4 -0
- package/dist/assets/icons/icon-agents.d.ts +5 -0
- package/dist/assets/icons/icon-agents.d.ts.map +1 -0
- package/dist/assets/icons/icon-agents.js +4 -0
- package/dist/assets/icons/icon-api.d.ts +5 -0
- package/dist/assets/icons/icon-api.d.ts.map +1 -0
- package/dist/assets/icons/icon-api.js +4 -0
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts +8 -0
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right-small.js +4 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts +5 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right.js +4 -0
- package/dist/assets/icons/icon-check.d.ts +5 -0
- package/dist/assets/icons/icon-check.d.ts.map +1 -0
- package/dist/assets/icons/icon-check.js +4 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts +8 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-down-small.js +7 -0
- package/dist/assets/icons/icon-chevron-right.d.ts +5 -0
- package/dist/assets/icons/icon-chevron-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-right.js +4 -0
- package/dist/assets/icons/icon-clock.d.ts +5 -0
- package/dist/assets/icons/icon-clock.d.ts.map +1 -0
- package/dist/assets/icons/icon-clock.js +4 -0
- package/dist/assets/icons/icon-copy.d.ts +5 -0
- package/dist/assets/icons/icon-copy.d.ts.map +1 -0
- package/dist/assets/icons/icon-copy.js +4 -0
- package/dist/assets/icons/icon-display-small.d.ts +5 -0
- package/dist/assets/icons/icon-display-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-display-small.js +4 -0
- package/dist/assets/icons/icon-display.d.ts +5 -0
- package/dist/assets/icons/icon-display.d.ts.map +1 -0
- package/dist/assets/icons/icon-display.js +4 -0
- package/dist/assets/icons/icon-file-text.d.ts +5 -0
- package/dist/assets/icons/icon-file-text.d.ts.map +1 -0
- package/dist/assets/icons/icon-file-text.js +4 -0
- package/dist/assets/icons/icon-folder-open.d.ts +5 -0
- package/dist/assets/icons/icon-folder-open.d.ts.map +1 -0
- package/dist/assets/icons/icon-folder-open.js +4 -0
- package/dist/assets/icons/icon-linked.d.ts +5 -0
- package/dist/assets/icons/icon-linked.d.ts.map +1 -0
- package/dist/assets/icons/icon-linked.js +4 -0
- package/dist/assets/icons/icon-logs.d.ts +5 -0
- package/dist/assets/icons/icon-logs.d.ts.map +1 -0
- package/dist/assets/icons/icon-logs.js +4 -0
- package/dist/assets/icons/icon-menu-alt.d.ts +5 -0
- package/dist/assets/icons/icon-menu-alt.d.ts.map +1 -0
- package/dist/assets/icons/icon-menu-alt.js +4 -0
- package/dist/assets/icons/icon-message.d.ts +5 -0
- package/dist/assets/icons/icon-message.d.ts.map +1 -0
- package/dist/assets/icons/icon-message.js +4 -0
- package/dist/assets/icons/icon-moon-small.d.ts +5 -0
- package/dist/assets/icons/icon-moon-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-moon-small.js +4 -0
- package/dist/assets/icons/icon-moon.d.ts +5 -0
- package/dist/assets/icons/icon-moon.d.ts.map +1 -0
- package/dist/assets/icons/icon-moon.js +4 -0
- package/dist/assets/icons/icon-openai.d.ts +5 -0
- package/dist/assets/icons/icon-openai.d.ts.map +1 -0
- package/dist/assets/icons/icon-openai.js +4 -0
- package/dist/assets/icons/icon-plus-circle.d.ts +5 -0
- package/dist/assets/icons/icon-plus-circle.d.ts.map +1 -0
- package/dist/assets/icons/icon-plus-circle.js +4 -0
- package/dist/assets/icons/icon-refresh-counter-clockwise.d.ts +5 -0
- package/dist/assets/icons/icon-refresh-counter-clockwise.d.ts.map +1 -0
- package/dist/assets/icons/icon-refresh-counter-clockwise.js +4 -0
- package/dist/assets/icons/icon-robot.d.ts +5 -0
- package/dist/assets/icons/icon-robot.d.ts.map +1 -0
- package/dist/assets/icons/icon-robot.js +4 -0
- package/dist/assets/icons/icon-sandbox.d.ts +5 -0
- package/dist/assets/icons/icon-sandbox.d.ts.map +1 -0
- package/dist/assets/icons/icon-sandbox.js +4 -0
- package/dist/assets/icons/icon-slash-forward.d.ts +8 -0
- package/dist/assets/icons/icon-slash-forward.d.ts.map +1 -0
- package/dist/assets/icons/icon-slash-forward.js +4 -0
- package/dist/assets/icons/icon-sparkles.d.ts +5 -0
- package/dist/assets/icons/icon-sparkles.d.ts.map +1 -0
- package/dist/assets/icons/icon-sparkles.js +4 -0
- package/dist/assets/icons/icon-sun-small.d.ts +5 -0
- package/dist/assets/icons/icon-sun-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-sun-small.js +4 -0
- package/dist/assets/icons/icon-sun.d.ts +5 -0
- package/dist/assets/icons/icon-sun.d.ts.map +1 -0
- package/dist/assets/icons/icon-sun.js +4 -0
- package/dist/assets/icons/icon-trash.d.ts +5 -0
- package/dist/assets/icons/icon-trash.d.ts.map +1 -0
- package/dist/assets/icons/icon-trash.js +4 -0
- package/dist/assets/icons/icon-user.d.ts +5 -0
- package/dist/assets/icons/icon-user.d.ts.map +1 -0
- package/dist/assets/icons/icon-user.js +4 -0
- package/dist/assets/icons/icon-workflow.d.ts +5 -0
- package/dist/assets/icons/icon-workflow.d.ts.map +1 -0
- package/dist/assets/icons/icon-workflow.js +4 -0
- package/dist/assets/icons/icon-wrench.d.ts +5 -0
- package/dist/assets/icons/icon-wrench.d.ts.map +1 -0
- package/dist/assets/icons/icon-wrench.js +4 -0
- package/dist/assets/icons/index.d.ts +35 -0
- package/dist/assets/icons/index.d.ts.map +1 -0
- package/dist/assets/icons/index.js +35 -0
- package/dist/assets/logos/index.d.ts +17 -0
- package/dist/assets/logos/index.d.ts.map +1 -0
- package/dist/assets/logos/index.js +17 -0
- package/dist/assets/logos/logo-ai-elements.d.ts +5 -0
- package/dist/assets/logos/logo-ai-elements.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-elements.js +5 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts +5 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-sdk.js +5 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts +5 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-chat-sdk.js +5 -0
- package/dist/assets/logos/logo-eve.d.ts +5 -0
- package/dist/assets/logos/logo-eve.d.ts.map +1 -0
- package/dist/assets/logos/logo-eve.js +5 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts +5 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-flags-sdk.js +5 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts +5 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts.map +1 -0
- package/dist/assets/logos/logo-icon-vercel.js +4 -0
- package/dist/assets/logos/logo-nextjs.d.ts +5 -0
- package/dist/assets/logos/logo-nextjs.d.ts.map +1 -0
- package/dist/assets/logos/logo-nextjs.js +9 -0
- package/dist/assets/logos/logo-streamdown.d.ts +5 -0
- package/dist/assets/logos/logo-streamdown.d.ts.map +1 -0
- package/dist/assets/logos/logo-streamdown.js +5 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts +5 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts.map +1 -0
- package/dist/assets/logos/logo-svelte-kit.js +4 -0
- package/dist/assets/logos/logo-turborepo.d.ts +5 -0
- package/dist/assets/logos/logo-turborepo.d.ts.map +1 -0
- package/dist/assets/logos/logo-turborepo.js +5 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts +5 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts.map +1 -0
- package/dist/assets/logos/logo-vercel-oss.js +4 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts +5 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-workflow-sdk.js +5 -0
- package/dist/cli/index.js +1 -1
- package/dist/components/badge.d.ts +11 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +22 -0
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +2 -0
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +2 -0
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +1 -1
- package/dist/components/card.d.ts +2 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +2 -0
- package/dist/components/code-block-tabs.d.ts.map +1 -1
- package/dist/components/code-block-tabs.js +1 -1
- package/dist/components/code-block.d.ts +6 -2
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +75 -4
- 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/dialog.d.ts +13 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +35 -0
- package/dist/components/drawer.d.ts +2 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +3 -0
- package/dist/components/input-group.d.ts +2 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +3 -0
- package/dist/components/input.d.ts +2 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +2 -0
- package/dist/components/kbd.d.ts +2 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +2 -0
- package/dist/components/mermaid.js +1 -1
- package/dist/components/separator.d.ts +2 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +3 -0
- package/dist/components/sheet.d.ts +2 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +3 -0
- package/dist/components/sonner.d.ts +2 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +3 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +2 -0
- package/dist/components/switch.d.ts +11 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +12 -0
- package/dist/components/textarea.d.ts +2 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +2 -0
- package/dist/components/theme-aware-image.d.ts +12 -0
- package/dist/components/theme-aware-image.d.ts.map +1 -0
- package/dist/components/theme-aware-image.js +8 -0
- package/dist/components/theme-switcher.d.ts +8 -0
- package/dist/components/theme-switcher.d.ts.map +1 -0
- package/dist/components/theme-switcher.js +37 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +3 -0
- package/dist/controls.d.ts +4 -8
- 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/internal/chat/conversation.d.ts +3 -4
- 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 +10 -13
- package/dist/internal/chat/message-metadata.d.ts.map +1 -1
- package/dist/internal/chat/message-metadata.js +7 -8
- 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 +27 -24
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +19 -27
- package/dist/internal/chat/shimmer.d.ts +11 -0
- package/dist/internal/chat/shimmer.d.ts.map +1 -0
- package/dist/internal/chat/shimmer.js +22 -0
- package/dist/internal/chat/sources.d.ts +1 -3
- 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 +6 -11
- package/dist/internal/chat/suggestion.d.ts.map +1 -1
- package/dist/internal/chat/suggestion.js +5 -5
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/cn.js +47 -0
- 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 +2 -2
- 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 +7 -5
- 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 +20 -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/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +8 -6
- package/dist/internal/toc-items.d.ts.map +1 -1
- package/dist/internal/toc-items.js +1 -1
- package/dist/internal/ui/button-group.d.ts +13 -0
- package/dist/internal/ui/button-group.d.ts.map +1 -0
- package/dist/internal/ui/button-group.js +26 -0
- package/dist/internal/ui/button.d.ts +12 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +33 -0
- package/dist/internal/ui/card.d.ts +6 -0
- package/dist/internal/ui/card.d.ts.map +1 -0
- package/dist/internal/ui/card.js +14 -0
- package/dist/internal/ui/drawer.d.ts +8 -0
- package/dist/internal/ui/drawer.d.ts.map +1 -0
- package/dist/internal/ui/drawer.js +19 -0
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/internal/ui/dropdown-menu.js +5 -5
- package/dist/internal/ui/input-group.d.ts +15 -0
- package/dist/internal/ui/input-group.d.ts.map +1 -0
- package/dist/internal/ui/input-group.js +44 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/kbd.d.ts +4 -0
- package/dist/internal/ui/kbd.d.ts.map +1 -0
- package/dist/internal/ui/kbd.js +8 -0
- package/dist/internal/ui/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/internal/ui/separator.d.ts +4 -0
- package/dist/internal/ui/separator.d.ts.map +1 -0
- package/dist/internal/ui/separator.js +7 -0
- package/dist/internal/ui/sheet.d.ts +13 -0
- package/dist/internal/ui/sheet.d.ts.map +1 -0
- package/dist/internal/ui/sheet.js +24 -0
- package/dist/internal/ui/sonner.d.ts +3 -0
- package/dist/internal/ui/sonner.d.ts.map +1 -0
- package/dist/internal/ui/sonner.js +20 -0
- package/dist/internal/ui/spinner.d.ts +3 -0
- package/dist/internal/ui/spinner.d.ts.map +1 -0
- package/dist/internal/ui/spinner.js +6 -0
- package/dist/internal/ui/textarea.d.ts +3 -0
- package/dist/internal/ui/textarea.d.ts.map +1 -0
- package/dist/internal/ui/textarea.js +5 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/mobile-docs-bar.d.ts.map +1 -1
- package/dist/mobile-docs-bar.js +2 -1
- package/dist/navbar.js +2 -3
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +1 -1
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +2 -0
- package/dist/versions.d.ts.map +1 -1
- package/dist/versions.js +5 -5
- package/docs/agents.md +2 -1
- package/docs/llms.txt +75 -9
- package/docs/manifest.json +10 -1
- package/docs/pages/migration.md +7 -5
- package/docs/pages/theme-aware-image.md +59 -0
- package/docs/pages/versioned-docs.md +3 -3
- package/docs/sitemap.md +1 -0
- package/package.json +102 -10
- package/styles.css +2 -3
- package/template/AGENTS.md +0 -10
- package/template/app/[lang]/(home)/components/centered-section.tsx +32 -0
- package/template/app/[lang]/(home)/components/hero.tsx +2 -2
- package/template/app/[lang]/(home)/components/one-two-section.tsx +1 -9
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +1 -1
- package/template/app/[lang]/(home)/page.tsx +6 -5
- package/template/app/[lang]/layout.tsx +4 -7
- package/template/app/styles/geistdocs.css +14 -17
- package/template/content/docs/configuration.cn.mdx +2 -2
- package/template/content/docs/migration.mdx +7 -5
- package/template/content/docs/theme-aware-image.mdx +57 -0
- package/template/content/docs/versioned-docs.mdx +3 -3
- package/template/lib/geistdocs/config.tsx +5 -0
- package/template/next.config.ts +2 -16
- package/template/package.json +7 -5
- package/theme.css +661 -4
- package/dist/internal/chat/dots-spinner.d.ts +0 -5
- package/dist/internal/chat/dots-spinner.d.ts.map +0 -1
- package/dist/internal/chat/dots-spinner.js +0 -15
package/dist/controls.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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 { Kbd } from "@vercel/geistcn/components/kbd";
|
|
5
|
-
import { useTheme } from "@vercel/geistcn/core";
|
|
6
|
-
import { cn } from "@vercel/geistcn/utils";
|
|
7
|
-
import { IconCheck, IconLanguages, IconMoon, IconSun, } from "@vercel/geistcn-assets/icons";
|
|
8
3
|
import { useI18n } from "fumadocs-ui/contexts/i18n";
|
|
9
4
|
import { useSearchContext } from "fumadocs-ui/contexts/search";
|
|
5
|
+
import { CheckIcon, LanguagesIcon, MoonIcon, SunIcon } from "lucide-react";
|
|
6
|
+
import { useTheme } from "next-themes";
|
|
10
7
|
import { useEffect, useState } from "react";
|
|
11
8
|
import { useGeistdocsChat } from "./internal/chat/context";
|
|
9
|
+
import { cn } from "./internal/cn";
|
|
10
|
+
import { Button } from "./internal/ui/button";
|
|
12
11
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./internal/ui/dropdown-menu";
|
|
12
|
+
import { Kbd } from "./internal/ui/kbd";
|
|
13
13
|
export const SearchButton = ({ className, onClick }) => {
|
|
14
14
|
const { setOpenSearch } = useSearchContext();
|
|
15
|
-
return (_jsxs(
|
|
15
|
+
return (_jsxs(Button, { className: cn("justify-between gap-2 pr-1.5 font-normal text-gray-1000 shadow-none", className), onClick: () => {
|
|
16
16
|
setOpenSearch(true);
|
|
17
17
|
onClick?.();
|
|
18
|
-
}, type: "button", children: [_jsx("span", {
|
|
18
|
+
}, size: "sm", type: "button", variant: "outline", children: [_jsx("span", { children: "Search\u2026" }), _jsx(Kbd, { className: "border bg-background-100 font-medium", children: "\u2318\u00A0K" })] }));
|
|
19
19
|
};
|
|
20
20
|
export const ThemeToggle = () => {
|
|
21
21
|
const { resolvedTheme, setTheme } = useTheme();
|
|
@@ -24,31 +24,31 @@ export const ThemeToggle = () => {
|
|
|
24
24
|
setMounted(true);
|
|
25
25
|
}, []);
|
|
26
26
|
if (!mounted) {
|
|
27
|
-
return (_jsx(Button, { "aria-label": "Toggle Theme",
|
|
27
|
+
return (_jsx(Button, { "aria-label": "Toggle Theme", size: "icon-sm", type: "button", variant: "ghost", children: _jsx("div", { className: "size-4" }) }));
|
|
28
28
|
}
|
|
29
|
-
const Icon = resolvedTheme === "dark" ?
|
|
29
|
+
const Icon = resolvedTheme === "dark" ? MoonIcon : SunIcon;
|
|
30
30
|
return (_jsx(Button, { "aria-label": resolvedTheme === "dark"
|
|
31
31
|
? "Switch to Light Theme"
|
|
32
|
-
: "Switch to Dark Theme", onClick: () => setTheme(resolvedTheme === "dark" ? "light" : "dark"),
|
|
32
|
+
: "Switch to Dark Theme", onClick: () => setTheme(resolvedTheme === "dark" ? "light" : "dark"), size: "icon-sm", type: "button", variant: "ghost", children: _jsx(Icon, { className: "size-4" }) }));
|
|
33
33
|
};
|
|
34
34
|
export const LanguageSelector = () => {
|
|
35
35
|
const { locale, locales, onChange } = useI18n();
|
|
36
36
|
if (!locales) {
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
|
-
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "aria-label": "Select Language", className: "flex items-center justify-center rounded-md p-2 hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:bg-gray-alpha-300", children: [_jsx(
|
|
39
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "aria-label": "Select Language", className: "flex items-center justify-center rounded-md p-2 hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:bg-gray-alpha-300", children: [_jsx(LanguagesIcon, { className: "size-4.5" }), _jsx("span", { className: "sr-only", children: "Select Language" })] }), _jsx(DropdownMenuContent, { align: "end", children: locales.map((lang) => (_jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center justify-between", disabled: locale === lang.locale, onClick: () => onChange?.(lang.locale), children: [lang.name, locale === lang.locale && _jsx(CheckIcon, { className: "size-4" })] }, lang.locale))) })] }));
|
|
40
40
|
};
|
|
41
|
-
export const AskAIButton = ({ children, className, prompt, size = "
|
|
41
|
+
export const AskAIButton = ({ children, className, prompt, size = "sm", variant = "outline", ...props }) => {
|
|
42
42
|
const { enabled, isOpen, setIsOpen, setPrompt } = useGeistdocsChat();
|
|
43
43
|
if (!enabled) {
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
|
-
return (_jsx(Button, { className: cn("shrink-0", className), onClick: () => {
|
|
46
|
+
return (_jsx(Button, { className: cn("shrink-0 shadow-none", className), onClick: () => {
|
|
47
47
|
if (prompt) {
|
|
48
48
|
setPrompt(prompt);
|
|
49
49
|
setIsOpen(true);
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
setIsOpen(!isOpen);
|
|
53
|
-
}, size: size,
|
|
53
|
+
}, size: size, type: "button", variant: variant, ...props, children: children ?? _jsx("span", { children: "Ask AI" }) }));
|
|
54
54
|
};
|
package/dist/footer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.tsx"],"names":[],"mappings":"AA6OA,eAAO,MAAM,MAAM,+CA4ClB,CAAC"}
|
package/dist/footer.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { LogoIconVercel } from "./assets/logos/logo-icon-vercel";
|
|
3
|
+
import { Badge } from "./components/badge";
|
|
4
|
+
import { ThemeSwitcher } from "./components/theme-switcher";
|
|
5
|
+
import { cn } from "./internal/cn";
|
|
6
6
|
// Vercel product directory (mirrors the vercel.com home footer). Relative hrefs
|
|
7
7
|
// resolve against vercel.com; `external` marks off-domain links.
|
|
8
8
|
const VERCEL = "https://vercel.com";
|
|
@@ -172,5 +172,5 @@ const resolveHref = (item) => item.external || item.href.startsWith("http")
|
|
|
172
172
|
? item.href
|
|
173
173
|
: `${VERCEL}${item.href}`;
|
|
174
174
|
const FooterGroup = ({ title, children, }) => (_jsxs("div", { children: [title ? (_jsx("h2", { className: "my-3 font-medium text-gray-1000 text-label-14", children: title })) : null, _jsx("ul", { className: "m-0 list-none p-0", children: children })] }));
|
|
175
|
-
const FooterLink = ({ badge, children, external, href, }) => (_jsx("li", { className: "py-0.5 leading-5", children: _jsxs("a", { className: "-ml-0.5 flex w-fit items-center gap-1.5 p-0.5 text-gray-900 transition-colors hover:text-gray-1000 motion-reduce:transition-none", href: href, rel: external ? "noopener" : undefined, target: external ? "_blank" : undefined, children: [children, badge ? (_jsx(Badge, { className: "h-5 bg-gray-200 px-2 text-[11px]/[20px] tabular-nums tracking-[0.2px]",
|
|
176
|
-
export const Footer = () => (_jsxs("footer", { className: "mx-auto max-w-[1448px] px-6 pt-10 pb-6 text-sm", children: [_jsxs("div", { className: cn("grid grid-cols-2 gap-6 md:grid-cols-3 lg:grid-cols-4 lg:gap-y-7 xl:grid-cols-6"), children: [FOOTER_GROUPS.map((group) => (_jsx(FooterGroup, { title: group.title, children: group.items.map((item) => (_jsx(FooterLink, { badge: item.badge, external: item.external, href: resolveHref(item), children: item.name }, item.href + item.name))) }, group.title))), _jsx(FooterGroup, { title: "Social", children: SOCIAL_LINKS.map((item) => (_jsx(FooterLink, { external: item.external, href: item.href, children: item.name }, item.name))) })] }), _jsxs("div", { className: "mt-10 flex items-center justify-between", children: [_jsx("a", { "aria-label": "Vercel", className: "inline-flex text-gray-1000", href: `${VERCEL}/home`, rel: "noopener", target: "_blank", children: _jsx(
|
|
175
|
+
const FooterLink = ({ badge, children, external, href, }) => (_jsx("li", { className: "py-0.5 leading-5", children: _jsxs("a", { className: "-ml-0.5 flex w-fit items-center gap-1.5 p-0.5 text-gray-900 transition-colors hover:text-gray-1000 motion-reduce:transition-none", href: href, rel: external ? "noopener" : undefined, target: external ? "_blank" : undefined, children: [children, badge ? (_jsx(Badge, { className: "h-5 bg-gray-200 px-2 text-[11px]/[20px] tabular-nums tracking-[0.2px]", variant: "secondary", children: badge })) : null] }) }));
|
|
176
|
+
export const Footer = () => (_jsxs("footer", { className: "mx-auto max-w-[1448px] px-6 pt-10 pb-6 text-sm", children: [_jsxs("div", { className: cn("grid grid-cols-2 gap-6 md:grid-cols-3 lg:grid-cols-4 lg:gap-y-7 xl:grid-cols-6"), children: [FOOTER_GROUPS.map((group) => (_jsx(FooterGroup, { title: group.title, children: group.items.map((item) => (_jsx(FooterLink, { badge: item.badge, external: item.external, href: resolveHref(item), children: item.name }, item.href + item.name))) }, group.title))), _jsx(FooterGroup, { title: "Social", children: SOCIAL_LINKS.map((item) => (_jsx(FooterLink, { external: item.external, href: item.href, children: item.name }, item.name))) })] }), _jsxs("div", { className: "mt-10 flex items-center justify-between", children: [_jsx("a", { "aria-label": "Vercel", className: "inline-flex text-gray-1000", href: `${VERCEL}/home`, rel: "noopener", target: "_blank", children: _jsx(LogoIconVercel, { size: 16 }) }), _jsx(ThemeSwitcher, { small: true })] })] }));
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
2
|
import { StickToBottom } from "use-stick-to-bottom";
|
|
3
|
+
import { Button } from "../ui/button";
|
|
3
4
|
export type ConversationProps = ComponentProps<typeof StickToBottom>;
|
|
4
5
|
export declare const Conversation: ({ className, ...props }: ConversationProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export type ConversationContentProps = ComponentProps<typeof StickToBottom.Content>;
|
|
6
7
|
export declare const ConversationContent: ({ className, ...props }: ConversationContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export declare const ConversationScrollButton: ({ className, }: ConversationScrollButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export type ConversationScrollButtonProps = ComponentProps<typeof Button>;
|
|
9
|
+
export declare const ConversationScrollButton: ({ className, ...props }: ConversationScrollButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
10
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/conversation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/conversation.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,aAAa,EAA2B,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAErE,eAAO,MAAM,YAAY,GAAI,yBAAyB,iBAAiB,4CAQtE,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CACnD,OAAO,aAAa,CAAC,OAAO,CAC7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,yBAGjC,wBAAwB,4CAK1B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAE1E,eAAO,MAAM,wBAAwB,GAAI,yBAGtC,6BAA6B,mDAsB/B,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { cn } from "@vercel/geistcn/utils";
|
|
5
|
-
import { IconArrowDown } from "@vercel/geistcn-assets/icons";
|
|
3
|
+
import { ArrowDownIcon } from "lucide-react";
|
|
6
4
|
import { useCallback } from "react";
|
|
7
5
|
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, ...props }) => {
|
|
11
11
|
const { isAtBottom, scrollToBottom } = useStickToBottomContext();
|
|
12
12
|
const handleScrollToBottom = useCallback(() => {
|
|
13
13
|
scrollToBottom();
|
|
14
14
|
}, [scrollToBottom]);
|
|
15
|
-
return isAtBottom ? null : (_jsx(Button, {
|
|
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, size: "icon", type: "button", variant: "outline", ...props, children: _jsx(ArrowDownIcon, { 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":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAOpC,eAAO,MAAM,QAAQ,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,4CA6C/D,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
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";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
7
4
|
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();
|
|
11
10
|
const handleCopyChat = async () => {
|
|
12
11
|
const markdown = messages
|
|
13
12
|
.map((message) => {
|
|
@@ -21,18 +20,16 @@ export const CopyChat = ({ messages }) => {
|
|
|
21
20
|
.join("\n\n---\n\n");
|
|
22
21
|
try {
|
|
23
22
|
await navigator.clipboard.writeText(markdown);
|
|
24
|
-
toast.success(
|
|
23
|
+
toast.success("Chat copied to clipboard");
|
|
25
24
|
setCopied(true);
|
|
26
25
|
setTimeout(() => setCopied(false), 2000);
|
|
27
26
|
}
|
|
28
27
|
catch (error) {
|
|
29
|
-
toast.error({
|
|
30
|
-
|
|
31
|
-
? `Failed to copy chat: ${error.message}`
|
|
32
|
-
: "Failed to copy chat",
|
|
28
|
+
toast.error("Failed to copy chat", {
|
|
29
|
+
description: error instanceof Error ? error.message : "Unknown error",
|
|
33
30
|
});
|
|
34
31
|
}
|
|
35
32
|
};
|
|
36
|
-
const Icon = copied ?
|
|
37
|
-
return (
|
|
33
|
+
const Icon = copied ? CheckIcon : CopyIcon;
|
|
34
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { "aria-label": copied ? "Chat copied" : "Copy chat", disabled: messages.length === 0, onClick: handleCopyChat, size: "icon-sm", variant: "ghost", children: _jsx(Icon, { className: "size-3.5" }) }) }), _jsx(TooltipContent, { children: "Copy chat" })] }));
|
|
38
35
|
};
|
|
@@ -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":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,IAAI,CAAC;AAK/D,UAAU,oBAAoB;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC3B;AAYD,eAAO,MAAM,eAAe,GAAI,wBAG7B,oBAAoB,mDAsEtB,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
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";
|
|
4
3
|
import { getToolName, isToolUIPart } from "ai";
|
|
5
|
-
import {
|
|
4
|
+
import { BookmarkIcon } from "lucide-react";
|
|
5
|
+
import { Shimmer } from "./shimmer";
|
|
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 }));
|
|
9
8
|
const getToolActivityLabel = (part) => {
|
|
10
9
|
const name = getToolName(part).replace(WORD_SEPARATOR_PATTERN, " ").trim();
|
|
11
10
|
return name ? `Running ${name}...` : "Working...";
|
|
@@ -15,12 +14,12 @@ export const MessageMetadata = ({ parts, inProgress, }) => {
|
|
|
15
14
|
.filter((part) => part.type === "text" || part.type === "reasoning" || isToolUIPart(part))
|
|
16
15
|
.at(-1);
|
|
17
16
|
if (!lastPart) {
|
|
18
|
-
return
|
|
17
|
+
return _jsx(Shimmer, { className: "text-xs", children: "Thinking..." });
|
|
19
18
|
}
|
|
20
19
|
if (lastPart.type === "reasoning" &&
|
|
21
20
|
lastPart.state !== "done" &&
|
|
22
21
|
inProgress) {
|
|
23
|
-
return (
|
|
22
|
+
return _jsx(Shimmer, { className: "text-xs", children: "Thinking..." });
|
|
24
23
|
}
|
|
25
24
|
const tool = isToolUIPart(lastPart) ? lastPart : null;
|
|
26
25
|
const hasTextPart = parts.some((part) => part.type === "text");
|
|
@@ -28,15 +27,15 @@ export const MessageMetadata = ({ parts, inProgress, }) => {
|
|
|
28
27
|
.filter((part) => part.type === "source-url")
|
|
29
28
|
.map((part) => [part.url, part])).values());
|
|
30
29
|
if (sources.length > 0 && !hasTextPart && inProgress) {
|
|
31
|
-
return (
|
|
30
|
+
return _jsx(Shimmer, { className: "text-xs", children: "Searching sources..." });
|
|
32
31
|
}
|
|
33
32
|
if (tool &&
|
|
34
33
|
inProgress &&
|
|
35
34
|
(tool.state === "input-streaming" || tool.state === "input-available")) {
|
|
36
|
-
return (
|
|
35
|
+
return _jsx(Shimmer, { className: "text-xs", children: getToolActivityLabel(tool) });
|
|
37
36
|
}
|
|
38
37
|
if (sources.length > 0 && !(tool && inProgress)) {
|
|
39
|
-
return (_jsxs(Sources, {
|
|
38
|
+
return (_jsxs(Sources, { children: [_jsxs(SourcesTrigger, { count: sources.length, children: [_jsx(BookmarkIcon, { className: "size-4" }), _jsxs("p", { children: ["Used ", sources.length, " sources"] })] }), _jsx(SourcesContent, { children: _jsx("ul", { className: "flex flex-col gap-2", children: sources.map((source) => (_jsx("li", { className: "ml-4.5 list-disc pl-1", children: _jsx(Source, { href: source.url, title: source.url, children: source.title }) }, source.url))) }) })] }));
|
|
40
39
|
}
|
|
41
40
|
if (!tool && sources.length === 0) {
|
|
42
41
|
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":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,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,4CAYrB,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
|
|
2
|
+
import { jsx as _jsx } 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";
|
|
6
5
|
import { memo } from "react";
|
|
7
6
|
import { Streamdown } from "streamdown";
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
7
|
+
import { cn } from "../cn";
|
|
8
|
+
export const Message = ({ className, from, ...props }) => (_jsx("div", { className: cn("group flex w-full max-w-[95%] flex-col gap-2", from === "user" ? "is-user ml-auto justify-end" : "is-assistant", className), ...props }));
|
|
9
|
+
export const MessageContent = ({ children, className, ...props }) => (_jsx("div", { className: cn("is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm", "group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-gray-100 group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-gray-1000", "group-[.is-assistant]:text-gray-1000", className), ...props, children: children }));
|
|
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);
|
|
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":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAOrC,OAAO,KAAK,EAAE,gBAAgB,EAAwB,SAAS,EAAE,MAAM,OAAO,CAAC;AAU/E,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,4CAsEtB,CAAC"}
|
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { CornerDownLeftIcon, Loader2Icon, SquareIcon, XIcon, } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { cn } from "../cn";
|
|
6
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea, } from "../ui/input-group";
|
|
6
7
|
export const ChatPromptInput = ({ onChange, onStop, onSubmit, status, textareaRef, value, }) => {
|
|
8
|
+
const [isComposing, setIsComposing] = useState(false);
|
|
7
9
|
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
|
-
useEffect(() => {
|
|
18
|
-
adjustHeight();
|
|
19
|
-
}, [adjustHeight, value]);
|
|
20
|
-
const handleChange = (event) => {
|
|
21
|
-
adjustHeight();
|
|
22
|
-
onChange(event.currentTarget.value);
|
|
23
|
-
};
|
|
24
10
|
const handleKeyDown = (event) => {
|
|
25
|
-
if (event.key === "Enter"
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
if (event.key === "Enter") {
|
|
12
|
+
if (isComposing || event.nativeEvent.isComposing || event.shiftKey) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
28
15
|
event.preventDefault();
|
|
29
|
-
|
|
16
|
+
const submitButton = event.currentTarget.form?.querySelector('button[type="submit"]');
|
|
17
|
+
if (submitButton?.disabled) {
|
|
30
18
|
return;
|
|
31
19
|
}
|
|
32
20
|
event.currentTarget.form?.requestSubmit();
|
|
33
21
|
}
|
|
34
22
|
};
|
|
35
|
-
|
|
23
|
+
let icon = _jsx(CornerDownLeftIcon, { className: "size-4" });
|
|
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
39
|
};
|
|
@@ -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":"AAqXA,eAAO,MAAM,kBAAkB,sDAgE9B,CAAC"}
|
|
@@ -1,28 +1,27 @@
|
|
|
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";
|
|
13
4
|
import { DefaultChatTransport } from "ai";
|
|
14
5
|
import { useLiveQuery } from "dexie-react-hooks";
|
|
6
|
+
import { ChevronRightIcon, Trash } from "lucide-react";
|
|
15
7
|
import { catchError } from "next/error";
|
|
16
8
|
import { usePathname } from "next/navigation";
|
|
17
9
|
import { Portal } from "radix-ui";
|
|
18
10
|
import { useCallback, useEffect, useId, useMemo, useRef, useState, } from "react";
|
|
11
|
+
import { toast } from "sonner";
|
|
19
12
|
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";
|
|
26
25
|
import { Message, MessageContent, MessageResponse } from "./message";
|
|
27
26
|
import { MessageMetadata } from "./message-metadata";
|
|
28
27
|
import { ChatPromptInput } from "./prompt-input";
|
|
@@ -34,12 +33,6 @@ const isFromPreviousDay = (timestamp) => {
|
|
|
34
33
|
messageDate.getMonth() !== today.getMonth() ||
|
|
35
34
|
messageDate.getDate() !== today.getDate());
|
|
36
35
|
};
|
|
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
|
-
];
|
|
43
36
|
const useChatPersistence = (title) => {
|
|
44
37
|
const saveTimeoutRef = useRef(undefined);
|
|
45
38
|
const db = useMemo(() => getChatDatabase(title), [title]);
|
|
@@ -102,7 +95,6 @@ const GeistdocsChatInner = ({ isOpen }) => {
|
|
|
102
95
|
const pathname = usePathname();
|
|
103
96
|
const textareaRef = useRef(null);
|
|
104
97
|
const [isInitialized, setIsInitialized] = useState(false);
|
|
105
|
-
const toast = useToasts();
|
|
106
98
|
const { prompt, setPrompt, setIsOpen, title, basePath, footer, suggestions } = useGeistdocsChat();
|
|
107
99
|
const { initialMessages, isLoading, saveMessages, clearMessages } = useChatPersistence(title);
|
|
108
100
|
const { messages, sendMessage, status, setMessages, stop } = useChat({
|
|
@@ -118,7 +110,9 @@ const GeistdocsChatInner = ({ isOpen }) => {
|
|
|
118
110
|
}),
|
|
119
111
|
}),
|
|
120
112
|
onError: (error) => {
|
|
121
|
-
toast.error(
|
|
113
|
+
toast.error(error.message, {
|
|
114
|
+
description: error.message,
|
|
115
|
+
});
|
|
122
116
|
},
|
|
123
117
|
});
|
|
124
118
|
useEffect(() => {
|
|
@@ -162,29 +156,27 @@ const GeistdocsChatInner = ({ isOpen }) => {
|
|
|
162
156
|
try {
|
|
163
157
|
await clearMessages();
|
|
164
158
|
setMessages([]);
|
|
165
|
-
toast.success(
|
|
159
|
+
toast.success("Chat history cleared");
|
|
166
160
|
}
|
|
167
161
|
catch (error) {
|
|
168
|
-
toast.error({
|
|
169
|
-
|
|
170
|
-
? `Failed to clear chat history: ${error.message}`
|
|
171
|
-
: "Failed to clear chat history",
|
|
162
|
+
toast.error("Failed to clear chat history", {
|
|
163
|
+
description: error instanceof Error ? error.message : "Unknown error",
|
|
172
164
|
});
|
|
173
165
|
}
|
|
174
166
|
};
|
|
175
167
|
if (isLoading) {
|
|
176
168
|
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, {}) }));
|
|
177
169
|
}
|
|
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: "
|
|
170
|
+
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: "flex items-center justify-between px-4 py-2.5", children: [_jsx("h2", { className: "font-semibold text-sm", children: "Chat" }), _jsx("div", { className: "flex items-center gap-3", children: _jsxs(ButtonGroup, { children: [_jsx(CopyChat, { messages: messages }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { "aria-label": "Clear chat", disabled: messages.length === 0, onClick: handleClearChat, size: "icon-sm", variant: "ghost", children: _jsx(Trash, { className: "size-3.5" }) }) }), _jsx(TooltipContent, { children: "Clear chat" })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { "aria-label": "Close chat", onClick: () => setIsOpen(false), size: "icon-sm", variant: "ghost", children: _jsx(ChevronRightIcon, { className: "size-3.5" }) }) }), _jsx(TooltipContent, { children: "Close chat" })] })] }) })] }), _jsxs(Conversation, { children: [_jsxs(ConversationContent, { children: [messages.map((message) => (_jsxs(Message, { className: "max-w-[90%]", from: message.role, children: [_jsx(MessageMetadata, { inProgress: status === "submitted" || status === "streaming", parts: message.parts }), message.parts
|
|
179
171
|
.filter((part) => part.type === "text")
|
|
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: "
|
|
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: "size-12 text-gray-800 text-sm", children: _jsx(Spinner, {}) })) : null] }), _jsx(ConversationScrollButton, {})] }), _jsxs("div", { className: "relative grid w-auto shrink-0 gap-4 p-4", children: [messages.length ? null : (_jsxs(_Fragment, { children: [_jsx(Suggestions, { className: "flex-col items-start gap-px", children: suggestions.map((text) => (_jsx(Suggestion, { className: "rounded-none p-0 text-copy-14", onClick: handleSuggestionClick, suggestion: text, variant: "link" }, text))) }), _jsxs("p", { className: "text-gray-800 text-sm", children: ["Tip: You can open and close chat with", " ", _jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "border bg-transparent", children: "\u2318" }), _jsx(Kbd, { className: "border bg-transparent", children: "I" })] })] })] })), _jsx(ChatPromptInput, { onChange: setPrompt, onStop: stop, onSubmit: (event) => {
|
|
181
173
|
event.preventDefault();
|
|
182
174
|
handleSubmit().catch((error) => {
|
|
183
175
|
console.error("Failed to submit chat message:", error);
|
|
184
176
|
});
|
|
185
177
|
}, status: status, textareaRef: textareaRef, value: prompt }), footer ? _jsx("div", { className: "text-gray-800 text-sm", children: footer }) : null] })] }));
|
|
186
178
|
};
|
|
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(),
|
|
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(), type: "button", children: "Try again" }), _jsx(Button, { onClick: onClose, type: "button", variant: "outline", children: "Close" })] })] }));
|
|
188
180
|
const GeistdocsChatErrorBoundary = catchError(GeistdocsChatErrorFallback);
|
|
189
181
|
export const GeistdocsChatShell = () => {
|
|
190
182
|
const { enabled, isOpen, setIsOpen } = useGeistdocsChat();
|
|
@@ -210,5 +202,5 @@ export const GeistdocsChatShell = () => {
|
|
|
210
202
|
// modal surfaces like the search command menu, dialogs, and
|
|
211
203
|
// dropdowns (z-50), so opening the command menu paints over an
|
|
212
204
|
// open chat panel.
|
|
213
|
-
"fixed inset-y-0 right-0 z-45 flex h-full w-
|
|
205
|
+
"fixed inset-y-0 right-0 z-45 flex h-full w-3/4 max-w-sm 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: _jsx(Drawer, { onOpenChange: isMobile ? setIsOpen : undefined, open: isMobile ? isOpen : false, children: _jsxs(DrawerContent, { className: "h-[80dvh]", children: [_jsx(DrawerTitle, { className: "sr-only", children: "Ask AI" }), _jsx(DrawerDescription, { className: "sr-only", children: "Chat with the documentation." }), _jsx(GeistdocsChatErrorBoundary, { onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { isOpen: isOpen }) })] }) }) })] }));
|
|
214
206
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ElementType } from "react";
|
|
2
|
+
interface TextShimmerProps {
|
|
3
|
+
as?: ElementType;
|
|
4
|
+
children: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
duration?: number;
|
|
7
|
+
spread?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const Shimmer: import("react").MemoExoticComponent<({ children, as: Component, className, duration, spread, }: TextShimmerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=shimmer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shimmer.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/shimmer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,WAAW,EAAiB,MAAM,OAAO,CAAC;AAG5E,UAAU,gBAAgB;IACxB,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8CD,eAAO,MAAM,OAAO,kGAtCjB,gBAAgB,6CAsC0B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { motion } from "motion/react";
|
|
4
|
+
import { memo, useMemo } from "react";
|
|
5
|
+
import { cn } from "../cn";
|
|
6
|
+
const ShimmerComponent = ({ children, as: Component = "p", className, duration = 2, spread = 2, }) => {
|
|
7
|
+
const MotionComponent = motion.create(Component);
|
|
8
|
+
const dynamicSpread = useMemo(() => (children?.length ?? 0) * spread, [children, spread]);
|
|
9
|
+
return (_jsx(MotionComponent, { animate: { backgroundPosition: "0% center" }, className: cn("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
|
|
10
|
+
// Uses package theme tokens (--color-fd-*): the shadcn-style
|
|
11
|
+
// --color-background / --color-muted-foreground tokens are not
|
|
12
|
+
// defined in consumer apps, which made the clipped text invisible.
|
|
13
|
+
"[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-fd-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", className), initial: { backgroundPosition: "100% center" }, style: {
|
|
14
|
+
"--spread": `${dynamicSpread}px`,
|
|
15
|
+
backgroundImage: "var(--bg), linear-gradient(var(--color-fd-muted-foreground), var(--color-fd-muted-foreground))",
|
|
16
|
+
}, transition: {
|
|
17
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
18
|
+
duration,
|
|
19
|
+
ease: "linear",
|
|
20
|
+
}, children: children }));
|
|
21
|
+
};
|
|
22
|
+
export const Shimmer = memo(ShimmerComponent);
|
|
@@ -8,8 +8,6 @@ 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"
|
|
12
|
-
href: string;
|
|
13
|
-
};
|
|
11
|
+
export type SourceProps = ComponentProps<"a">;
|
|
14
12
|
export declare const Source: ({ href, title, children, ...props }: SourceProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
13
|
//# 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":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,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,4CAYrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE5E,eAAO,MAAM,cAAc,GAAI,yBAG5B,mBAAmB,4CASrB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAE9C,eAAO,MAAM,MAAM,GAAI,qCAAqC,WAAW,4CAetE,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 { BookIcon, ChevronDownIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "../cn";
|
|
5
5
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../ui/collapsible";
|
|
6
|
-
export const Sources = ({ className, ...props }) => (_jsx(Collapsible, { className: cn("not-prose text-gray-
|
|
7
|
-
export const SourcesTrigger = ({ className, count, children, ...props }) => (_jsx(CollapsibleTrigger, { className: cn("
|
|
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: "
|
|
6
|
+
export const Sources = ({ className, ...props }) => (_jsx(Collapsible, { className: cn("not-prose mb-4 text-gray-1000 text-xs", className), ...props }));
|
|
7
|
+
export const SourcesTrigger = ({ className, count, children, ...props }) => (_jsx(CollapsibleTrigger, { className: cn("flex items-center gap-2", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsxs("p", { className: "font-medium", children: ["Used ", count, " sources"] }), _jsx(ChevronDownIcon, { className: "h-4 w-4" })] })) }));
|
|
8
|
+
export const SourcesContent = ({ className, ...props }) => (_jsx(CollapsibleContent, { className: cn("mt-3 flex w-fit flex-col gap-2", "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", className), ...props }));
|
|
9
|
+
export const Source = ({ href, title, children, ...props }) => (_jsx("a", { className: "flex items-center gap-2", href: href, rel: "noreferrer", target: "_blank", ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(BookIcon, { className: "h-4 w-4" }), _jsx("span", { className: "block font-medium", children: title })] })) }));
|