@vercel/geistdocs 1.2.3 → 1.3.0-canary.41d37f1
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 +3 -0
- package/dist/components/callout.d.ts +12 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +7 -0
- package/dist/components/code-block-tabs.d.ts +7 -0
- package/dist/components/code-block-tabs.d.ts.map +1 -0
- package/dist/components/code-block-tabs.js +7 -0
- package/dist/components/code-block.d.ts +14 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +41 -0
- package/dist/components/mermaid.d.ts +4 -0
- package/dist/components/mermaid.d.ts.map +1 -0
- package/dist/components/mermaid.js +44 -0
- package/dist/components/theme-aware-image.d.ts +12 -0
- package/dist/components/theme-aware-image.d.ts.map +1 -0
- package/dist/components/theme-aware-image.js +8 -0
- package/dist/components/video.d.ts +6 -0
- package/dist/components/video.d.ts.map +1 -0
- package/dist/components/video.js +3 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/controls.d.ts +15 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +52 -0
- package/dist/internal/chat/context.d.ts +19 -0
- package/dist/internal/chat/context.d.ts.map +1 -0
- package/dist/internal/chat/context.js +36 -0
- package/dist/internal/chat/conversation.d.ts +10 -0
- package/dist/internal/chat/conversation.d.ts.map +1 -0
- package/dist/internal/chat/conversation.js +16 -0
- package/dist/internal/chat/copy-chat.d.ts +5 -0
- package/dist/internal/chat/copy-chat.d.ts.map +1 -0
- package/dist/internal/chat/copy-chat.js +35 -0
- package/dist/internal/chat/db.d.ts +13 -0
- package/dist/internal/chat/db.d.ts.map +1 -0
- package/dist/internal/chat/db.js +19 -0
- package/dist/internal/chat/message-metadata.d.ts +8 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -0
- package/dist/internal/chat/message-metadata.js +29 -0
- package/dist/internal/chat/message.d.ts +11 -0
- package/dist/internal/chat/message.d.ts.map +1 -0
- package/dist/internal/chat/message.js +11 -0
- package/dist/internal/chat/prompt-input.d.ts +13 -0
- package/dist/internal/chat/prompt-input.d.ts.map +1 -0
- package/dist/internal/chat/prompt-input.js +39 -0
- package/dist/internal/chat/shell.d.ts +2 -0
- package/dist/internal/chat/shell.d.ts.map +1 -0
- package/dist/internal/chat/shell.js +194 -0
- package/dist/internal/chat/shimmer.d.ts +11 -0
- package/dist/internal/chat/shimmer.d.ts.map +1 -0
- package/dist/internal/chat/shimmer.js +18 -0
- package/dist/internal/chat/sources.d.ts +13 -0
- package/dist/internal/chat/sources.d.ts.map +1 -0
- package/dist/internal/chat/sources.js +9 -0
- package/dist/internal/chat/suggestion.d.ts +11 -0
- package/dist/internal/chat/suggestion.d.ts.map +1 -0
- package/dist/internal/chat/suggestion.js +12 -0
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/cn.js +3 -0
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -0
- package/dist/internal/feedback-action.js +34 -0
- package/dist/internal/i18n.d.ts +6 -0
- package/dist/internal/i18n.d.ts.map +1 -0
- package/dist/internal/i18n.js +18 -0
- package/dist/internal/languages.d.ts +7 -0
- package/dist/internal/languages.d.ts.map +1 -0
- package/dist/internal/languages.js +18 -0
- package/dist/internal/not-implemented.d.ts +2 -0
- package/dist/internal/not-implemented.d.ts.map +1 -0
- package/dist/internal/not-implemented.js +4 -0
- package/dist/internal/page-actions-client.d.ts +14 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -0
- package/dist/internal/page-actions-client.js +154 -0
- package/dist/internal/page-actions.d.ts +18 -0
- package/dist/internal/page-actions.d.ts.map +1 -0
- package/dist/internal/page-actions.js +4 -0
- package/dist/internal/search.d.ts +5 -0
- package/dist/internal/search.d.ts.map +1 -0
- package/dist/internal/search.js +14 -0
- package/dist/internal/sidebar.d.ts +6 -0
- package/dist/internal/sidebar.d.ts.map +1 -0
- package/dist/internal/sidebar.js +37 -0
- package/dist/internal/ui/button-group.d.ts +13 -0
- package/dist/internal/ui/button-group.d.ts.map +1 -0
- package/dist/internal/ui/button-group.js +26 -0
- package/dist/internal/ui/button.d.ts +12 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +33 -0
- package/dist/internal/ui/card.d.ts +6 -0
- package/dist/internal/ui/card.d.ts.map +1 -0
- package/dist/internal/ui/card.js +14 -0
- package/dist/internal/ui/collapsible.d.ts +6 -0
- package/dist/internal/ui/collapsible.d.ts.map +1 -0
- package/dist/internal/ui/collapsible.js +12 -0
- package/dist/internal/ui/drawer.d.ts +6 -0
- package/dist/internal/ui/drawer.d.ts.map +1 -0
- package/dist/internal/ui/drawer.js +13 -0
- package/dist/internal/ui/dropdown-menu.d.ts +22 -0
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/internal/ui/dropdown-menu.js +41 -0
- package/dist/internal/ui/input-group.d.ts +15 -0
- package/dist/internal/ui/input-group.d.ts.map +1 -0
- package/dist/internal/ui/input-group.js +44 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/kbd.d.ts +4 -0
- package/dist/internal/ui/kbd.d.ts.map +1 -0
- package/dist/internal/ui/kbd.js +8 -0
- package/dist/internal/ui/popover.d.ts +6 -0
- package/dist/internal/ui/popover.d.ts.map +1 -0
- package/dist/internal/ui/popover.js +13 -0
- package/dist/internal/ui/scroll-area.d.ts +5 -0
- package/dist/internal/ui/scroll-area.d.ts.map +1 -0
- package/dist/internal/ui/scroll-area.js +12 -0
- package/dist/internal/ui/separator.d.ts +4 -0
- package/dist/internal/ui/separator.d.ts.map +1 -0
- package/dist/internal/ui/separator.js +7 -0
- package/dist/internal/ui/sheet.d.ts +10 -0
- package/dist/internal/ui/sheet.d.ts.map +1 -0
- package/dist/internal/ui/sheet.js +24 -0
- package/dist/internal/ui/sonner.d.ts +3 -0
- package/dist/internal/ui/sonner.d.ts.map +1 -0
- package/dist/internal/ui/sonner.js +20 -0
- package/dist/internal/ui/spinner.d.ts +3 -0
- package/dist/internal/ui/spinner.d.ts.map +1 -0
- package/dist/internal/ui/spinner.js +6 -0
- package/dist/internal/ui/textarea.d.ts +3 -0
- package/dist/internal/ui/textarea.d.ts.map +1 -0
- package/dist/internal/ui/textarea.js +5 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/internal/use-mobile.d.ts +2 -0
- package/dist/internal/use-mobile.d.ts.map +1 -0
- package/dist/internal/use-mobile.js +16 -0
- package/dist/layout.d.ts +18 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +49 -0
- package/dist/mdx.d.ts +36 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +72 -0
- package/dist/pages/docs.d.ts +55 -0
- package/dist/pages/docs.d.ts.map +1 -0
- package/dist/pages/docs.js +63 -0
- package/dist/proxy.d.ts +21 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +109 -0
- package/dist/routes/chat.d.ts +13 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +229 -0
- package/dist/routes/llms.d.ts +33 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +39 -0
- package/dist/routes/search.d.ts +10 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +33 -0
- package/dist/routes/sitemap.d.ts +35 -0
- package/dist/routes/sitemap.d.ts.map +1 -0
- package/dist/routes/sitemap.js +150 -0
- package/dist/source.d.ts +30 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +72 -0
- package/package.json +129 -9
- package/styles.css +193 -0
- package/template/_gitignore +1 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +26 -0
- package/template/app/[lang]/(home)/components/cta.tsx +19 -0
- package/template/app/[lang]/(home)/components/hero.tsx +27 -0
- package/template/app/[lang]/(home)/components/one-two-section.tsx +25 -0
- package/template/app/[lang]/(home)/components/templates.tsx +50 -0
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
- package/template/app/[lang]/(home)/layout.tsx +14 -0
- package/template/app/[lang]/(home)/page.tsx +126 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +19 -0
- package/template/app/[lang]/docs/layout.tsx +14 -0
- package/template/app/[lang]/layout.tsx +29 -0
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
- package/template/app/[lang]/llms.txt/route.ts +6 -0
- package/template/app/[lang]/og/[...slug]/background.png +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
- package/template/app/[lang]/rss.xml/route.ts +52 -0
- package/template/app/[lang]/sitemap.md/route.ts +9 -0
- package/template/app/actions/feedback/emotions.ts +18 -0
- package/template/app/actions/feedback/index.ts +45 -0
- package/template/app/api/chat/route.ts +8 -0
- package/template/app/api/search/route.ts +5 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/global.css +2 -0
- package/template/app/robots.ts +14 -0
- package/template/app/sitemap.ts +36 -0
- package/template/app/styles/geistdocs.css +553 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small.tsx +35 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-check.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-down-small.tsx +30 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-right.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-copy.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text.tsx +25 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-slash-forward.tsx +36 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/index.tsx +11 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/index.tsx +14 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-elements.tsx +29 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-sdk.tsx +38 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-chat-sdk.tsx +42 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-flags-sdk.tsx +42 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-icon-vercel.tsx +31 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-streamdown.tsx +29 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-vercel-oss.tsx +24 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-workflow-sdk.tsx +73 -0
- package/template/components/geistdocs/callout.tsx +40 -0
- package/template/components/geistdocs/chat.tsx +24 -0
- package/template/components/geistdocs/code-block-tabs.tsx +61 -0
- package/template/components/geistdocs/code-block.tsx +134 -0
- package/template/components/geistdocs/copy-page.tsx +27 -0
- package/template/components/geistdocs/desktop-menu.tsx +52 -0
- package/template/components/geistdocs/docs-layout.tsx +20 -0
- package/template/components/geistdocs/docs-page.tsx +35 -0
- package/template/components/geistdocs/edit-source.tsx +30 -0
- package/template/components/geistdocs/feedback.tsx +139 -0
- package/template/components/geistdocs/footer.tsx +30 -0
- package/template/components/geistdocs/github-button.tsx +19 -0
- package/template/components/geistdocs/home-layout.tsx +46 -0
- package/template/components/geistdocs/icons.tsx +13 -0
- package/template/components/geistdocs/installer.tsx +58 -0
- package/template/components/geistdocs/language-selector.tsx +3 -0
- package/template/components/geistdocs/mdx-components.tsx +5 -0
- package/template/components/geistdocs/mermaid.tsx +68 -0
- package/template/components/geistdocs/mobile-docs-bar.tsx +81 -0
- package/template/components/geistdocs/mobile-menu.tsx +150 -0
- package/template/components/geistdocs/navbar-logo.tsx +124 -0
- package/template/components/geistdocs/navbar.tsx +22 -0
- package/template/components/geistdocs/provider.tsx +31 -0
- package/template/components/geistdocs/rss-button.tsx +10 -0
- package/template/components/geistdocs/scroll-top.tsx +21 -0
- package/template/components/geistdocs/search.tsx +17 -0
- package/template/components/geistdocs/sidebar.tsx +128 -0
- package/template/components/geistdocs/theme-aware-image.tsx +22 -0
- package/template/components/geistdocs/theme-toggle.tsx +3 -0
- package/template/components/geistdocs/video.tsx +16 -0
- package/template/components/ui/badge.tsx +46 -0
- package/template/components/ui/button-group.tsx +83 -0
- package/template/components/ui/button.tsx +60 -0
- package/template/components/ui/card.tsx +92 -0
- package/template/components/ui/collapsible.tsx +33 -0
- package/template/components/ui/command-prompt.tsx +488 -0
- package/template/components/ui/command.tsx +184 -0
- package/template/components/ui/dialog.tsx +143 -0
- package/template/components/ui/drawer.tsx +135 -0
- package/template/components/ui/dropdown-menu.tsx +257 -0
- package/template/components/ui/hover-card.tsx +44 -0
- package/template/components/ui/input-group.tsx +170 -0
- package/template/components/ui/input.tsx +21 -0
- package/template/components/ui/kbd.tsx +28 -0
- package/template/components/ui/navigation-menu.tsx +192 -0
- package/template/components/ui/popover.tsx +48 -0
- package/template/components/ui/scroll-area.tsx +58 -0
- package/template/components/ui/select.tsx +187 -0
- package/template/components/ui/separator.tsx +28 -0
- package/template/components/ui/sheet.tsx +139 -0
- package/template/components/ui/sonner.tsx +40 -0
- package/template/components/ui/spinner.tsx +16 -0
- package/template/components/ui/textarea.tsx +18 -0
- package/template/components/ui/tooltip.tsx +61 -0
- package/template/components.json +22 -0
- package/template/content/docs/ask-ai.cn.mdx +85 -0
- package/template/content/docs/ask-ai.mdx +85 -0
- package/template/content/docs/configuration.cn.mdx +115 -0
- package/template/content/docs/configuration.mdx +115 -0
- package/template/content/docs/deployment.cn.mdx +34 -0
- package/template/content/docs/deployment.mdx +34 -0
- package/template/content/docs/edit-on-github.cn.mdx +47 -0
- package/template/content/docs/edit-on-github.mdx +47 -0
- package/template/content/docs/env.cn.mdx +25 -0
- package/template/content/docs/env.mdx +25 -0
- package/template/content/docs/feedback.cn.mdx +85 -0
- package/template/content/docs/feedback.mdx +85 -0
- package/template/content/docs/getting-started.cn.mdx +86 -0
- package/template/content/docs/getting-started.mdx +86 -0
- package/template/content/docs/index.cn.mdx +54 -0
- package/template/content/docs/index.mdx +87 -0
- package/template/content/docs/internationalization.cn.mdx +113 -0
- package/template/content/docs/internationalization.mdx +117 -0
- package/template/content/docs/llms-txt.cn.mdx +50 -0
- package/template/content/docs/llms-txt.mdx +50 -0
- package/template/content/docs/md.cn.mdx +68 -0
- package/template/content/docs/md.mdx +68 -0
- package/template/content/docs/meta.json +21 -0
- package/template/content/docs/open-in-chat.cn.mdx +78 -0
- package/template/content/docs/open-in-chat.mdx +78 -0
- package/template/content/docs/provider.cn.mdx +69 -0
- package/template/content/docs/provider.mdx +69 -0
- package/template/content/docs/rss.cn.mdx +104 -0
- package/template/content/docs/rss.mdx +104 -0
- package/template/content/docs/syntax.cn.mdx +416 -0
- package/template/content/docs/syntax.mdx +407 -0
- package/template/content/docs/theme-aware-image.mdx +53 -0
- package/template/geistdocs.tsx +51 -0
- package/template/hooks/geistdocs/use-sidebar.ts +13 -0
- package/template/hooks/use-mobile.ts +19 -0
- package/template/lib/geistdocs/config.tsx +27 -0
- package/template/lib/geistdocs/fonts.ts +18 -0
- package/template/lib/geistdocs/i18n.ts +13 -0
- package/template/lib/geistdocs/md-tracking.ts +56 -0
- package/template/lib/geistdocs/source.ts +12 -0
- package/template/lib/utils.ts +6 -0
- package/template/next.config.ts +22 -0
- package/template/package.json +63 -0
- package/template/postcss.config.mjs +5 -0
- package/template/proxy.ts +16 -0
- package/template/source.config.ts +62 -0
- package/template/tsconfig.json +37 -0
- package/dist/index.js +0 -2
- /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { SiGithub, SiMarkdown } from "@icons-pack/react-simple-icons";
|
|
4
|
+
import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
|
|
5
|
+
import { ArrowUpCircleIcon, CheckIcon, CopyIcon, ExternalLinkIcon, MessageCircleIcon, ThumbsUpIcon, } from "lucide-react";
|
|
6
|
+
import { usePathname } from "next/navigation";
|
|
7
|
+
import { useEffect, useState, useTransition, } from "react";
|
|
8
|
+
import { useGeistdocsChat } from "./chat/context";
|
|
9
|
+
import { sendFeedback } from "./feedback-action";
|
|
10
|
+
import { Button } from "./ui/button";
|
|
11
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "./ui/dropdown-menu";
|
|
12
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
|
13
|
+
import { Textarea } from "./ui/textarea";
|
|
14
|
+
const actionClassName = "flex items-center gap-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground";
|
|
15
|
+
const feedbackEmotions = [
|
|
16
|
+
{ name: "cry", emoji: "😭" },
|
|
17
|
+
{ name: "sad", emoji: "😕" },
|
|
18
|
+
{ name: "happy", emoji: "🙂" },
|
|
19
|
+
{ name: "amazed", emoji: "🤩" },
|
|
20
|
+
];
|
|
21
|
+
const openInProviders = [
|
|
22
|
+
{
|
|
23
|
+
id: "v0",
|
|
24
|
+
label: "Open in v0",
|
|
25
|
+
getHref: (query) => `https://v0.app?${new URLSearchParams({ q: query }).toString()}`,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "chatgpt",
|
|
29
|
+
label: "Open in ChatGPT",
|
|
30
|
+
getHref: (query) => `https://chatgpt.com/?${new URLSearchParams({ hints: "search", prompt: query }).toString()}`,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "claude",
|
|
34
|
+
label: "Open in Claude",
|
|
35
|
+
getHref: (query) => `https://claude.ai/new?${new URLSearchParams({ q: query }).toString()}`,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: "t3",
|
|
39
|
+
label: "Open in T3 Chat",
|
|
40
|
+
getHref: (query) => `https://t3.chat/new?${new URLSearchParams({ q: query }).toString()}`,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "scira",
|
|
44
|
+
label: "Open in Scira",
|
|
45
|
+
getHref: (query) => `https://scira.ai/?${new URLSearchParams({ q: query }).toString()}`,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "cursor",
|
|
49
|
+
label: "Open in Cursor",
|
|
50
|
+
getHref: (query) => {
|
|
51
|
+
const url = new URL("https://cursor.com/link/prompt");
|
|
52
|
+
url.searchParams.set("text", query);
|
|
53
|
+
return url.toString();
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
const EditSourceAction = ({ github, path, }) => {
|
|
58
|
+
let url;
|
|
59
|
+
if (github?.owner && github?.repo && path) {
|
|
60
|
+
url = `https://github.com/${github.owner}/${github.repo}/edit/main/content/docs/${path}`;
|
|
61
|
+
}
|
|
62
|
+
if (!url) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return (_jsxs("a", { className: actionClassName, href: url, rel: "noopener noreferrer", target: "_blank", children: [_jsx(SiGithub, { className: "size-3.5" }), _jsx("span", { children: "Edit this page on GitHub" })] }));
|
|
66
|
+
};
|
|
67
|
+
const CopyPageAction = ({ text }) => {
|
|
68
|
+
const [checked, handleCopy] = useCopyButton(async () => {
|
|
69
|
+
await navigator.clipboard.writeText(text);
|
|
70
|
+
});
|
|
71
|
+
const Icon = checked ? CheckIcon : CopyIcon;
|
|
72
|
+
return (_jsxs("button", { className: actionClassName, onClick: handleCopy, type: "button", children: [_jsx(Icon, { className: "size-3.5" }), _jsx("span", { children: "Copy page" })] }));
|
|
73
|
+
};
|
|
74
|
+
const OpenInChatAction = ({ href }) => {
|
|
75
|
+
const protocol = process.env.NODE_ENV === "production" ? "https" : "http";
|
|
76
|
+
const url = new URL(href, `${protocol}://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`).toString();
|
|
77
|
+
const query = `Read this page, I want to ask questions about it. ${url}`;
|
|
78
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { className: actionClassName, type: "button", children: [_jsx(ExternalLinkIcon, { className: "size-4" }), "Open in chat"] }) }), _jsx(DropdownMenuContent, { align: "start", side: "top", children: openInProviders.map((provider, index) => (_jsxs("div", { children: [index === 1 ? _jsx(DropdownMenuSeparator, {}) : null, _jsx(DropdownMenuItem, { asChild: true, children: _jsxs("a", { className: "flex items-center gap-2", href: provider.getHref(query), rel: "noopener", target: "_blank", children: [_jsx("span", { className: "flex-1", children: provider.label }), _jsx(ExternalLinkIcon, { className: "size-4 shrink-0" })] }) })] }, provider.id))) })] }));
|
|
79
|
+
};
|
|
80
|
+
const ScrollTopAction = () => (_jsxs("button", { className: actionClassName, onClick: () => window.scrollTo({ top: 0, behavior: "smooth" }), type: "button", children: [_jsx(ArrowUpCircleIcon, { className: "size-3.5" }), _jsx("span", { children: "Scroll to top" })] }));
|
|
81
|
+
const AskAIAction = ({ href }) => {
|
|
82
|
+
const { enabled, setIsOpen, setPrompt } = useGeistdocsChat();
|
|
83
|
+
if (!enabled) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const protocol = process.env.NODE_ENV === "production" ? "https" : "http";
|
|
87
|
+
const url = new URL(href, `${protocol}://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`).toString();
|
|
88
|
+
const query = `Read this page, I want to ask questions about it. ${url}`;
|
|
89
|
+
return (_jsxs("button", { className: actionClassName, onClick: () => {
|
|
90
|
+
setPrompt(query);
|
|
91
|
+
setIsOpen(true);
|
|
92
|
+
}, type: "button", children: [_jsx(MessageCircleIcon, { className: "size-3.5" }), _jsx("span", { children: "Ask AI about this page" })] }));
|
|
93
|
+
};
|
|
94
|
+
const FeedbackAction = ({ siteId }) => {
|
|
95
|
+
const url = usePathname();
|
|
96
|
+
const [submitted, setSubmitted] = useState(false);
|
|
97
|
+
const [emotion, setEmotion] = useState(null);
|
|
98
|
+
const [message, setMessage] = useState("");
|
|
99
|
+
const [isPending, startTransition] = useTransition();
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
const item = localStorage.getItem(`docs-feedback-${url}`);
|
|
102
|
+
if (!item) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
setSubmitted(true);
|
|
106
|
+
}, [url]);
|
|
107
|
+
const submit = (event) => {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
if (!emotion) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
startTransition(() => {
|
|
113
|
+
const feedback = {
|
|
114
|
+
emotion,
|
|
115
|
+
message,
|
|
116
|
+
};
|
|
117
|
+
sendFeedback({ url, feedback, siteId }).then(() => {
|
|
118
|
+
setSubmitted(true);
|
|
119
|
+
localStorage.setItem(`docs-feedback-${url}`, "1");
|
|
120
|
+
setMessage("");
|
|
121
|
+
setEmotion(null);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { className: actionClassName, type: "button", children: [_jsx(ThumbsUpIcon, { className: "size-3.5" }), _jsx("span", { children: "Give feedback" })] }) }), _jsx(PopoverContent, { className: "overflow-hidden p-0", children: _jsx("div", { className: "overflow-visible", children: submitted ? (_jsx("div", { className: "flex flex-col items-center gap-3 rounded-xl bg-sidebar px-3 py-6 text-center text-sm", children: _jsx("p", { children: "Thank you for your feedback!" }) })) : (_jsxs("form", { className: "flex flex-col", onSubmit: submit, children: [_jsx("div", { className: "p-2", children: _jsx(Textarea, { autoFocus: true, className: "max-h-48 min-h-24 shadow-none", onChange: (event) => setMessage(event.target.value), onKeyDown: (event) => {
|
|
126
|
+
if (!event.shiftKey && event.key === "Enter") {
|
|
127
|
+
event.currentTarget.form?.requestSubmit();
|
|
128
|
+
}
|
|
129
|
+
}, placeholder: "Leave your feedback...", required: true, value: message }) }), _jsxs("div", { className: "flex items-center justify-end gap-1 px-2 text-muted-foreground", children: [_jsx(SiMarkdown, { className: "inline size-3" }), _jsx("p", { className: "text-xs", children: " supported" })] }), _jsxs("div", { className: "mt-2 flex items-center justify-between border-t bg-sidebar p-2", children: [_jsx("div", { className: "flex items-center gap-px", children: feedbackEmotions.map((entry) => (_jsxs(Button, { className: emotion === entry.name
|
|
130
|
+
? "bg-accent text-foreground"
|
|
131
|
+
: "text-muted-foreground hover:text-foreground", onClick: () => setEmotion(entry.name), size: "sm", type: "button", variant: "ghost", children: [entry.emoji, _jsx("span", { className: "sr-only", children: entry.name })] }, entry.name))) }), _jsx(Button, { disabled: isPending || !emotion || !message, size: "sm", type: "submit", variant: "default", children: "Send" })] })] })) }) })] }));
|
|
132
|
+
};
|
|
133
|
+
export const GeistdocsPageActions = ({ config, extraActions, markdown, page, }) => {
|
|
134
|
+
const actions = [];
|
|
135
|
+
if (config.pageActions?.editSource !== false) {
|
|
136
|
+
actions.push(_jsx(EditSourceAction, { github: config.github, path: page.path }, "edit-source"));
|
|
137
|
+
}
|
|
138
|
+
if (config.pageActions?.scrollTop !== false) {
|
|
139
|
+
actions.push(_jsx(ScrollTopAction, {}, "scroll-top"));
|
|
140
|
+
}
|
|
141
|
+
if (config.feedback?.enabled !== false) {
|
|
142
|
+
actions.push(_jsx(FeedbackAction, { siteId: config.siteId }, "feedback"));
|
|
143
|
+
}
|
|
144
|
+
if (config.pageActions?.copyPage !== false) {
|
|
145
|
+
actions.push(_jsx(CopyPageAction, { text: markdown }, "copy-page"));
|
|
146
|
+
}
|
|
147
|
+
if (config.ai?.enabled !== false && config.pageActions?.askAI !== false) {
|
|
148
|
+
actions.push(_jsx(AskAIAction, { href: page.url }, "ask-ai"));
|
|
149
|
+
}
|
|
150
|
+
if (config.pageActions?.openInChat !== false) {
|
|
151
|
+
actions.push(_jsx(OpenInChatAction, { href: page.url }, "open-in-chat"));
|
|
152
|
+
}
|
|
153
|
+
return (_jsxs(_Fragment, { children: [actions, extraActions] }));
|
|
154
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { GeistdocsConfig } from "../config";
|
|
3
|
+
export interface PageActionRenderContext {
|
|
4
|
+
markdown: string;
|
|
5
|
+
page: {
|
|
6
|
+
path?: string;
|
|
7
|
+
url: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface CreatePageActionsOptions {
|
|
11
|
+
config: Pick<GeistdocsConfig, "ai" | "feedback" | "github" | "pageActions" | "siteId">;
|
|
12
|
+
getExtraActions?: (context: PageActionRenderContext) => ReactNode[];
|
|
13
|
+
}
|
|
14
|
+
export declare const createPageActions: ({ config, getExtraActions, }: CreatePageActionsOptions) => {
|
|
15
|
+
config: Pick<GeistdocsConfig, "ai" | "feedback" | "github" | "pageActions" | "siteId">;
|
|
16
|
+
getExtraActions: ((context: PageActionRenderContext) => ReactNode[]) | undefined;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=page-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-actions.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,SAAS,EAAE,CAAC;CACrE;AAED,eAAO,MAAM,iBAAiB,GAAI,8BAG/B,wBAAwB;;gCANG,uBAAuB,KAAK,SAAS,EAAE;CASnE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EASL,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAG9C,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,4CA0BrC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useDocsSearch } from "fumadocs-core/search/client";
|
|
4
|
+
import { SearchDialog as FumadocsSearchDialog, SearchDialogClose, SearchDialogContent, SearchDialogHeader, SearchDialogIcon, SearchDialogInput, SearchDialogList, SearchDialogOverlay, } from "fumadocs-ui/components/dialog/search";
|
|
5
|
+
import { useI18n } from "fumadocs-ui/contexts/i18n";
|
|
6
|
+
export const GeistdocsSearchDialog = ({ basePath, ...props }) => {
|
|
7
|
+
const { locale } = useI18n();
|
|
8
|
+
const { search, setSearch, query } = useDocsSearch({
|
|
9
|
+
type: "fetch",
|
|
10
|
+
locale,
|
|
11
|
+
api: basePath ? `${basePath}/api/search` : "/api/search",
|
|
12
|
+
});
|
|
13
|
+
return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, {}), _jsxs(SearchDialogContent, { children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, {}), _jsx(SearchDialogClose, {})] }), _jsx(SearchDialogList, { items: query.data === "empty" ? null : query.data })] })] }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SidebarPageTreeComponents } from "fumadocs-ui/components/sidebar/page-tree";
|
|
2
|
+
export declare const GeistdocsSidebar: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const GeistdocsSidebarFolder: SidebarPageTreeComponents["Folder"];
|
|
4
|
+
export declare const GeistdocsSidebarItem: SidebarPageTreeComponents["Item"];
|
|
5
|
+
export declare const GeistdocsSidebarSeparator: SidebarPageTreeComponents["Separator"];
|
|
6
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAa1F,eAAO,MAAM,gBAAgB,+CAsD5B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,yBAAyB,CAAC,QAAQ,CA2BtE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,CAAC,MAAM,CAWlE,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,yBAAyB,CAAC,WAAW,CAM1E,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarSeparator, } from "fumadocs-ui/components/sidebar/base";
|
|
4
|
+
import { useTreeContext, useTreePath } from "fumadocs-ui/contexts/tree";
|
|
5
|
+
import { usePathname } from "next/navigation";
|
|
6
|
+
import { Fragment, useEffect, useRef, useState } from "react";
|
|
7
|
+
import { SearchButton } from "../controls";
|
|
8
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "./ui/sheet";
|
|
9
|
+
export const GeistdocsSidebar = () => {
|
|
10
|
+
const { root } = useTreeContext();
|
|
11
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
12
|
+
const pathname = usePathname();
|
|
13
|
+
const previousPathname = useRef(pathname);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (pathname !== previousPathname.current) {
|
|
16
|
+
setIsOpen(false);
|
|
17
|
+
previousPathname.current = pathname;
|
|
18
|
+
}
|
|
19
|
+
}, [pathname]);
|
|
20
|
+
const renderSidebarList = (items) => items.map((item) => {
|
|
21
|
+
if (item.type === "separator") {
|
|
22
|
+
return _jsx(GeistdocsSidebarSeparator, { item: item }, item.$id);
|
|
23
|
+
}
|
|
24
|
+
if (item.type === "folder") {
|
|
25
|
+
return (_jsx(GeistdocsSidebarFolder, { item: item, children: renderSidebarList(item.children) }, item.$id));
|
|
26
|
+
}
|
|
27
|
+
return _jsx(GeistdocsSidebarItem, { item: item }, item.$id);
|
|
28
|
+
});
|
|
29
|
+
return (_jsxs("div", { className: "pointer-events-none sticky top-(--fd-docs-row-1) z-20 h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] [grid-area:sidebar] *:pointer-events-auto max-md:hidden md:layout:[--fd-sidebar-width:268px]", "data-sidebar-placeholder": true, children: [_jsx("div", { className: "h-full overflow-y-auto px-4 pt-12 pb-4", children: _jsx(Fragment, { children: renderSidebarList(root.children) }, root.$id) }), _jsx(Sheet, { onOpenChange: setIsOpen, open: isOpen, children: _jsxs(SheetContent, { className: "gap-0", children: [_jsxs(SheetHeader, { className: "mt-8", children: [_jsx(SheetTitle, { className: "sr-only", children: "Mobile Menu" }), _jsx(SheetDescription, { className: "sr-only", children: "Navigation for the documentation." }), _jsx(SearchButton, { onClick: () => setIsOpen(false) })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 pb-4", children: renderSidebarList(root.children) })] }) })] }));
|
|
30
|
+
};
|
|
31
|
+
export const GeistdocsSidebarFolder = ({ children, item, }) => {
|
|
32
|
+
const path = useTreePath();
|
|
33
|
+
const defaultOpen = item.defaultOpen ?? path.includes(item);
|
|
34
|
+
return (_jsxs(SidebarFolder, { defaultOpen: defaultOpen, children: [item.index ? (_jsxs(SidebarFolderLink, { className: "flex items-center gap-2 text-pretty py-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground data-[active=true]:text-foreground [&_svg]:size-3.5", external: item.index.external, href: item.index.url, children: [item.icon, item.name] })) : (_jsxs(SidebarFolderTrigger, { className: "flex items-center gap-2 text-pretty py-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground [&_svg]:size-3.5", children: [item.icon, item.name] })), _jsx(SidebarFolderContent, { className: "ml-2", children: children })] }));
|
|
35
|
+
};
|
|
36
|
+
export const GeistdocsSidebarItem = ({ item, }) => (_jsx(SidebarItem, { className: "block w-full truncate text-pretty py-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground data-[active=true]:text-foreground", external: item.external, href: item.url, icon: item.icon, children: item.name }));
|
|
37
|
+
export const GeistdocsSidebarSeparator = ({ item }) => (_jsxs(SidebarSeparator, { className: "mt-4 mb-2 flex items-center gap-2 px-0 font-medium text-sm first-child:mt-0", children: [item.icon, item.name] }));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Separator } from "./separator";
|
|
4
|
+
declare const buttonGroupVariants: (props?: ({
|
|
5
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare function ButtonGroup({ className, orientation, ...props }: ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function ButtonGroupText({ className, asChild, ...props }: ComponentProps<"div"> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function ButtonGroupSeparator({ className, orientation, ...props }: ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=button-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,QAAA,MAAM,mBAAmB;;8EAexB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,WAAW,EACX,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,2CASlE;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,OAAe,EACf,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAYA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,WAAwB,EACxB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,2CAYlC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../cn";
|
|
5
|
+
import { Separator } from "./separator";
|
|
6
|
+
const buttonGroupVariants = cva("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10", {
|
|
7
|
+
variants: {
|
|
8
|
+
orientation: {
|
|
9
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
10
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
orientation: "horizontal",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export function ButtonGroup({ className, orientation, ...props }) {
|
|
18
|
+
return (_jsx("div", { className: cn(buttonGroupVariants({ orientation }), className), "data-orientation": orientation, "data-slot": "button-group", ...props }));
|
|
19
|
+
}
|
|
20
|
+
export function ButtonGroupText({ className, asChild = false, ...props }) {
|
|
21
|
+
const Comp = asChild ? SlotPrimitive.Slot : "div";
|
|
22
|
+
return (_jsx(Comp, { className: cn("flex items-center gap-2 rounded-md border bg-muted px-4 font-medium text-sm shadow-xs [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
25
|
+
return (_jsx(Separator, { className: cn("!m-0 relative self-stretch bg-input data-[orientation=vertical]:h-auto", className), "data-slot": "button-group-separator", orientation: orientation, ...props }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type ButtonProps = ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { buttonVariants };
|
|
12
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,QAAA,MAAM,cAAc;;;8EA8BnB,CAAC;AAEF,KAAK,WAAW,GAAG,cAAc,CAAC,QAAQ,CAAC,GACzC,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEJ,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,2CAUb;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../cn";
|
|
5
|
+
const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
9
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
10
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
12
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
13
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
17
|
+
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
18
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
19
|
+
icon: "size-9",
|
|
20
|
+
"icon-sm": "size-8",
|
|
21
|
+
"icon-lg": "size-10",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export function Button({ className, variant, size, asChild = false, ...props }) {
|
|
30
|
+
const Comp = asChild ? SlotPrimitive.Slot : "button";
|
|
31
|
+
return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), "data-slot": "button", ...props }));
|
|
32
|
+
}
|
|
33
|
+
export { buttonVariants };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export declare function Card({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function CardHeader({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function CardTitle({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function CardContent({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAWlE;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAWxE;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAQvE;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAQzE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../cn";
|
|
3
|
+
export function Card({ className, ...props }) {
|
|
4
|
+
return (_jsx("div", { className: cn("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm", className), "data-slot": "card", ...props }));
|
|
5
|
+
}
|
|
6
|
+
export function CardHeader({ className, ...props }) {
|
|
7
|
+
return (_jsx("div", { className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className), "data-slot": "card-header", ...props }));
|
|
8
|
+
}
|
|
9
|
+
export function CardTitle({ className, ...props }) {
|
|
10
|
+
return (_jsx("div", { className: cn("font-semibold leading-none", className), "data-slot": "card-title", ...props }));
|
|
11
|
+
}
|
|
12
|
+
export function CardContent({ className, ...props }) {
|
|
13
|
+
return (_jsx("div", { className: cn("px-6", className), "data-slot": "card-content", ...props }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export declare function Collapsible(props: ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function CollapsibleTrigger(props: ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function CollapsibleContent(props: ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/collapsible.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,2CAGxD;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,2CAQtE;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,2CAQtE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
4
|
+
export function Collapsible(props) {
|
|
5
|
+
return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
6
|
+
}
|
|
7
|
+
export function CollapsibleTrigger(props) {
|
|
8
|
+
return (_jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props }));
|
|
9
|
+
}
|
|
10
|
+
export function CollapsibleContent(props) {
|
|
11
|
+
return (_jsx(CollapsiblePrimitive.CollapsibleContent, { "data-slot": "collapsible-content", ...props }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
+
export declare function Drawer(props: ComponentProps<typeof DrawerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function DrawerTrigger(props: ComponentProps<typeof DrawerPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function DrawerContent({ className, children, ...props }: ComponentProps<typeof DrawerPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAC;AAGjD,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAExE;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAGtD;AAED,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAwBhD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
4
|
+
import { cn } from "../cn";
|
|
5
|
+
export function Drawer(props) {
|
|
6
|
+
return _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", ...props });
|
|
7
|
+
}
|
|
8
|
+
export function DrawerTrigger(props) {
|
|
9
|
+
return _jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
export function DrawerContent({ className, children, ...props }) {
|
|
12
|
+
return (_jsxs(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", children: [_jsx(DrawerPrimitive.Overlay, { className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", "data-slot": "drawer-overlay" }), _jsxs(DrawerPrimitive.Content, { className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-background", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className), "data-slot": "drawer-content", ...props, children: [_jsx("div", { className: "mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children] })] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export declare function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function DropdownMenuContent({ className, sideOffset, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function DropdownMenuItem({ className, inset, variant, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
7
|
+
inset?: boolean;
|
|
8
|
+
variant?: "default" | "destructive";
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function DropdownMenuLabel({ className, inset, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
11
|
+
inset?: boolean;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function DropdownMenuRadioItem({ className, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function DropdownMenuSubContent({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,wBAAgB,YAAY,CAC1B,KAAK,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,2CAGzD;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,2CAQ5D;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,UAAc,EACd,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,2CActD;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,KAAK,EACL,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACrC,2CAaA;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,GAAG;IACtD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,2CAYA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,2CAQxD;AAED,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,QAAQ,EACR,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,YAAY,CAAC,2CAmB3D;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,2CAQ/D;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,2CAkBxD;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG,CAAC,2CAGxD;AAED,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,2CAeA;AAED,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,2CAWzD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../cn";
|
|
6
|
+
export function DropdownMenu(props) {
|
|
7
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
8
|
+
}
|
|
9
|
+
export function DropdownMenuTrigger(props) {
|
|
10
|
+
return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
11
|
+
}
|
|
12
|
+
export function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
13
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { className: cn("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in", className), "data-slot": "dropdown-menu-content", sideOffset: sideOffset, ...props }) }));
|
|
14
|
+
}
|
|
15
|
+
export function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
16
|
+
return (_jsx(DropdownMenuPrimitive.Item, { className: cn("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-inset": inset, "data-slot": "dropdown-menu-item", "data-variant": variant, ...props }));
|
|
17
|
+
}
|
|
18
|
+
export function DropdownMenuLabel({ className, inset, ...props }) {
|
|
19
|
+
return (_jsx(DropdownMenuPrimitive.Label, { className: cn("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8", className), "data-inset": inset, "data-slot": "dropdown-menu-label", ...props }));
|
|
20
|
+
}
|
|
21
|
+
export function DropdownMenuSeparator({ className, ...props }) {
|
|
22
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { className: cn("-mx-1 my-1 h-px bg-border", className), "data-slot": "dropdown-menu-separator", ...props }));
|
|
23
|
+
}
|
|
24
|
+
export function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
25
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { checked: checked, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-slot": "dropdown-menu-checkbox-item", ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
26
|
+
}
|
|
27
|
+
export function DropdownMenuRadioGroup(props) {
|
|
28
|
+
return (_jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
|
|
29
|
+
}
|
|
30
|
+
export function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
31
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, { className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-slot": "dropdown-menu-radio-item", ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
32
|
+
}
|
|
33
|
+
export function DropdownMenuSub(props) {
|
|
34
|
+
return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
35
|
+
}
|
|
36
|
+
export function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
37
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { className: cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[inset]:pl-8 data-[state=open]:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0", className), "data-inset": inset, "data-slot": "dropdown-menu-sub-trigger", ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto size-4" })] }));
|
|
38
|
+
}
|
|
39
|
+
export function DropdownMenuSubContent({ className, ...props }) {
|
|
40
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { className: cn("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in", className), "data-slot": "dropdown-menu-sub-content", ...props }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
export declare function InputGroup({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
6
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export declare function InputGroupAddon({ className, align, ...props }: ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
10
|
+
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
export declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function InputGroupTextarea({ className, ...props }: ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=input-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAkBxE;AAED,QAAA,MAAM,uBAAuB;;8EAmB5B,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,KAAsB,EACtB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,2CAStE;AAED,QAAA,MAAM,wBAAwB;;8EAgB7B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,IAAe,EACf,OAAiB,EACjB,IAAW,EACX,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,CAAC,GAC5C,YAAY,CAAC,OAAO,wBAAwB,CAAC,2CAU9C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,UAAU,CAAC,2CAW5B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../cn";
|
|
5
|
+
import { Button } from "./button";
|
|
6
|
+
import { Textarea } from "./textarea";
|
|
7
|
+
export function InputGroup({ className, ...props }) {
|
|
8
|
+
return (_jsx("div", { className: cn("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs outline-none transition-[color,box-shadow] dark:bg-input/30", "h-9 min-w-0 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", className), "data-slot": "input-group", ...props }));
|
|
9
|
+
}
|
|
10
|
+
const inputGroupAddonVariants = cva("flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 font-medium text-muted-foreground text-sm group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
11
|
+
variants: {
|
|
12
|
+
align: {
|
|
13
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
14
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
15
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
|
|
16
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
align: "inline-start",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
export function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
24
|
+
return (_jsx("div", { className: cn(inputGroupAddonVariants({ align }), className), "data-align": align, "data-slot": "input-group-addon", ...props }));
|
|
25
|
+
}
|
|
26
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
27
|
+
variants: {
|
|
28
|
+
size: {
|
|
29
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
30
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
31
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
32
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
size: "xs",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
export function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
40
|
+
return (_jsx(Button, { className: cn(inputGroupButtonVariants({ size }), className), "data-size": size, type: type, variant: variant, ...props }));
|
|
41
|
+
}
|
|
42
|
+
export function InputGroupTextarea({ className, ...props }) {
|
|
43
|
+
return (_jsx(Textarea, { className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className), "data-slot": "input-group-control", ...props }));
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,CAAC,2CAc3E"}
|