create-sidekick-app 0.0.1 → 2.0.0
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/LICENSE.md +202 -0
- package/NOTICE +27 -0
- package/README.md +29 -2
- package/dist/index.js +59 -0
- package/package.json +65 -4
- package/template/base/ai-chat/.env.example +6 -0
- package/template/base/ai-chat/.prettierignore +2 -0
- package/template/base/ai-chat/.prettierrc.json +5 -0
- package/template/base/ai-chat/README.md +38 -0
- package/template/base/ai-chat/_gitignore +41 -0
- package/template/base/ai-chat/components.json +23 -0
- package/template/base/ai-chat/next.config.ts +5 -0
- package/template/base/ai-chat/package.json +61 -0
- package/template/base/ai-chat/postcss.config.mjs +5 -0
- package/template/base/ai-chat/src/app/api/chat/route.ts +141 -0
- package/template/base/ai-chat/src/app/api/instant/route.ts +5 -0
- package/template/base/ai-chat/src/app/chat/[id]/page.tsx +20 -0
- package/template/base/ai-chat/src/app/globals.css +124 -0
- package/template/base/ai-chat/src/app/layout.tsx +34 -0
- package/template/base/ai-chat/src/app/page.tsx +6 -0
- package/template/base/ai-chat/src/components/AuthGate.tsx +15 -0
- package/template/base/ai-chat/src/components/Chat.tsx +228 -0
- package/template/base/ai-chat/src/components/InstantProvider.tsx +18 -0
- package/template/base/ai-chat/src/components/Login.tsx +163 -0
- package/template/base/ai-chat/src/components/Sidebar.tsx +100 -0
- package/template/base/ai-chat/src/components/ai-elements/agent.tsx +142 -0
- package/template/base/ai-chat/src/components/ai-elements/artifact.tsx +149 -0
- package/template/base/ai-chat/src/components/ai-elements/attachments.tsx +427 -0
- package/template/base/ai-chat/src/components/ai-elements/audio-player.tsx +229 -0
- package/template/base/ai-chat/src/components/ai-elements/canvas.tsx +26 -0
- package/template/base/ai-chat/src/components/ai-elements/chain-of-thought.tsx +223 -0
- package/template/base/ai-chat/src/components/ai-elements/checkpoint.tsx +72 -0
- package/template/base/ai-chat/src/components/ai-elements/code-block.tsx +556 -0
- package/template/base/ai-chat/src/components/ai-elements/commit.tsx +449 -0
- package/template/base/ai-chat/src/components/ai-elements/confirmation.tsx +173 -0
- package/template/base/ai-chat/src/components/ai-elements/connection.tsx +28 -0
- package/template/base/ai-chat/src/components/ai-elements/context.tsx +410 -0
- package/template/base/ai-chat/src/components/ai-elements/controls.tsx +19 -0
- package/template/base/ai-chat/src/components/ai-elements/conversation.tsx +167 -0
- package/template/base/ai-chat/src/components/ai-elements/edge.tsx +144 -0
- package/template/base/ai-chat/src/components/ai-elements/environment-variables.tsx +325 -0
- package/template/base/ai-chat/src/components/ai-elements/file-tree.tsx +298 -0
- package/template/base/ai-chat/src/components/ai-elements/image.tsx +25 -0
- package/template/base/ai-chat/src/components/ai-elements/inline-citation.tsx +294 -0
- package/template/base/ai-chat/src/components/ai-elements/jsx-preview.tsx +250 -0
- package/template/base/ai-chat/src/components/ai-elements/message.tsx +356 -0
- package/template/base/ai-chat/src/components/ai-elements/mic-selector.tsx +372 -0
- package/template/base/ai-chat/src/components/ai-elements/model-selector.tsx +214 -0
- package/template/base/ai-chat/src/components/ai-elements/node.tsx +72 -0
- package/template/base/ai-chat/src/components/ai-elements/open-in-chat.tsx +367 -0
- package/template/base/ai-chat/src/components/ai-elements/package-info.tsx +235 -0
- package/template/base/ai-chat/src/components/ai-elements/panel.tsx +16 -0
- package/template/base/ai-chat/src/components/ai-elements/persona.tsx +280 -0
- package/template/base/ai-chat/src/components/ai-elements/plan.tsx +144 -0
- package/template/base/ai-chat/src/components/ai-elements/prompt-input.tsx +1341 -0
- package/template/base/ai-chat/src/components/ai-elements/queue.tsx +275 -0
- package/template/base/ai-chat/src/components/ai-elements/reasoning.tsx +229 -0
- package/template/base/ai-chat/src/components/ai-elements/sandbox.tsx +128 -0
- package/template/base/ai-chat/src/components/ai-elements/schema-display.tsx +473 -0
- package/template/base/ai-chat/src/components/ai-elements/shimmer.tsx +78 -0
- package/template/base/ai-chat/src/components/ai-elements/snippet.tsx +141 -0
- package/template/base/ai-chat/src/components/ai-elements/sources.tsx +78 -0
- package/template/base/ai-chat/src/components/ai-elements/speech-input.tsx +324 -0
- package/template/base/ai-chat/src/components/ai-elements/stack-trace.tsx +531 -0
- package/template/base/ai-chat/src/components/ai-elements/suggestion.tsx +55 -0
- package/template/base/ai-chat/src/components/ai-elements/task.tsx +88 -0
- package/template/base/ai-chat/src/components/ai-elements/terminal.tsx +277 -0
- package/template/base/ai-chat/src/components/ai-elements/test-results.tsx +497 -0
- package/template/base/ai-chat/src/components/ai-elements/tool.tsx +174 -0
- package/template/base/ai-chat/src/components/ai-elements/toolbar.tsx +17 -0
- package/template/base/ai-chat/src/components/ai-elements/transcription.tsx +126 -0
- package/template/base/ai-chat/src/components/ai-elements/voice-selector.tsx +525 -0
- package/template/base/ai-chat/src/components/ai-elements/web-preview.tsx +282 -0
- package/template/base/ai-chat/src/components/ui/accordion.tsx +66 -0
- package/template/base/ai-chat/src/components/ui/alert.tsx +66 -0
- package/template/base/ai-chat/src/components/ui/avatar.tsx +109 -0
- package/template/base/ai-chat/src/components/ui/badge.tsx +48 -0
- package/template/base/ai-chat/src/components/ui/button-group.tsx +83 -0
- package/template/base/ai-chat/src/components/ui/button.tsx +64 -0
- package/template/base/ai-chat/src/components/ui/card.tsx +92 -0
- package/template/base/ai-chat/src/components/ui/carousel.tsx +241 -0
- package/template/base/ai-chat/src/components/ui/collapsible.tsx +33 -0
- package/template/base/ai-chat/src/components/ui/command.tsx +184 -0
- package/template/base/ai-chat/src/components/ui/dialog.tsx +158 -0
- package/template/base/ai-chat/src/components/ui/dropdown-menu.tsx +257 -0
- package/template/base/ai-chat/src/components/ui/hover-card.tsx +44 -0
- package/template/base/ai-chat/src/components/ui/input-group.tsx +170 -0
- package/template/base/ai-chat/src/components/ui/input.tsx +21 -0
- package/template/base/ai-chat/src/components/ui/popover.tsx +89 -0
- package/template/base/ai-chat/src/components/ui/progress.tsx +31 -0
- package/template/base/ai-chat/src/components/ui/scroll-area.tsx +58 -0
- package/template/base/ai-chat/src/components/ui/select.tsx +190 -0
- package/template/base/ai-chat/src/components/ui/separator.tsx +28 -0
- package/template/base/ai-chat/src/components/ui/spinner.tsx +16 -0
- package/template/base/ai-chat/src/components/ui/switch.tsx +35 -0
- package/template/base/ai-chat/src/components/ui/tabs.tsx +91 -0
- package/template/base/ai-chat/src/components/ui/textarea.tsx +18 -0
- package/template/base/ai-chat/src/components/ui/tooltip.tsx +57 -0
- package/template/base/ai-chat/src/instant.perms.ts +34 -0
- package/template/base/ai-chat/src/instant.schema.ts +107 -0
- package/template/base/ai-chat/src/lib/adminDb.ts +8 -0
- package/template/base/ai-chat/src/lib/db.ts +8 -0
- package/template/base/ai-chat/src/lib/mockModel.ts +119 -0
- package/template/base/ai-chat/src/lib/utils.ts +6 -0
- package/template/base/ai-chat/tsconfig.json +33 -0
- package/template/base/bun-react/.env.example +2 -0
- package/template/base/bun-react/README.md +12 -0
- package/template/base/bun-react/_gitignore +34 -0
- package/template/base/bun-react/bun-env.d.ts +17 -0
- package/template/base/bun-react/bunfig.toml +4 -0
- package/template/base/bun-react/package.json +22 -0
- package/template/base/bun-react/src/App.tsx +168 -0
- package/template/base/bun-react/src/frontend.tsx +20 -0
- package/template/base/bun-react/src/getUnusedPort.ts +32 -0
- package/template/base/bun-react/src/index.css +25 -0
- package/template/base/bun-react/src/index.html +13 -0
- package/template/base/bun-react/src/index.ts +21 -0
- package/template/base/bun-react/src/instant.perms.ts +24 -0
- package/template/base/bun-react/src/instant.schema.ts +46 -0
- package/template/base/bun-react/src/lib/db.ts +8 -0
- package/template/base/bun-react/src/logo.svg +1 -0
- package/template/base/bun-react/tsconfig.json +36 -0
- package/template/base/expo/.env.example +2 -0
- package/template/base/expo/README.md +18 -0
- package/template/base/expo/_gitignore +41 -0
- package/template/base/expo/app/+not-found.tsx +16 -0
- package/template/base/expo/app/_layout.tsx +37 -0
- package/template/base/expo/app/index.tsx +64 -0
- package/template/base/expo/app.json +42 -0
- package/template/base/expo/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/template/base/expo/assets/images/adaptive-icon.png +0 -0
- package/template/base/expo/assets/images/favicon.png +0 -0
- package/template/base/expo/assets/images/icon.png +0 -0
- package/template/base/expo/assets/images/partial-react-logo.png +0 -0
- package/template/base/expo/assets/images/react-logo.png +0 -0
- package/template/base/expo/assets/images/react-logo@2x.png +0 -0
- package/template/base/expo/assets/images/react-logo@3x.png +0 -0
- package/template/base/expo/assets/images/splash-icon.png +0 -0
- package/template/base/expo/babel.config.js +12 -0
- package/template/base/expo/constants/Colors.ts +26 -0
- package/template/base/expo/eslint.config.js +10 -0
- package/template/base/expo/global.css +3 -0
- package/template/base/expo/hooks/useColorScheme.ts +1 -0
- package/template/base/expo/hooks/useColorScheme.web.ts +21 -0
- package/template/base/expo/hooks/useThemeColor.ts +21 -0
- package/template/base/expo/instant.perms.ts +24 -0
- package/template/base/expo/instant.schema.ts +44 -0
- package/template/base/expo/lib/db.ts +7 -0
- package/template/base/expo/metro.config.js +6 -0
- package/template/base/expo/nativewind-env.d.ts +1 -0
- package/template/base/expo/package.json +57 -0
- package/template/base/expo/scripts/reset-project.js +112 -0
- package/template/base/expo/tailwind.config.js +9 -0
- package/template/base/expo/tsconfig.json +18 -0
- package/template/base/next-js-app-dir/.env.example +2 -0
- package/template/base/next-js-app-dir/README.md +18 -0
- package/template/base/next-js-app-dir/_gitignore +41 -0
- package/template/base/next-js-app-dir/next.config.ts +7 -0
- package/template/base/next-js-app-dir/package.json +27 -0
- package/template/base/next-js-app-dir/postcss.config.mjs +5 -0
- package/template/base/next-js-app-dir/public/file.svg +1 -0
- package/template/base/next-js-app-dir/public/globe.svg +1 -0
- package/template/base/next-js-app-dir/public/next.svg +1 -0
- package/template/base/next-js-app-dir/public/vercel.svg +1 -0
- package/template/base/next-js-app-dir/public/window.svg +1 -0
- package/template/base/next-js-app-dir/src/app/favicon.ico +0 -0
- package/template/base/next-js-app-dir/src/app/globals.css +26 -0
- package/template/base/next-js-app-dir/src/app/layout.tsx +34 -0
- package/template/base/next-js-app-dir/src/app/page.tsx +169 -0
- package/template/base/next-js-app-dir/src/instant.perms.ts +24 -0
- package/template/base/next-js-app-dir/src/instant.schema.ts +50 -0
- package/template/base/next-js-app-dir/src/lib/db.ts +8 -0
- package/template/base/next-js-app-dir/tsconfig.json +41 -0
- package/template/base/solidjs-vite/README.md +15 -0
- package/template/base/solidjs-vite/_gitignore +25 -0
- package/template/base/solidjs-vite/index.html +15 -0
- package/template/base/solidjs-vite/package.json +25 -0
- package/template/base/solidjs-vite/src/App.tsx +171 -0
- package/template/base/solidjs-vite/src/index.css +25 -0
- package/template/base/solidjs-vite/src/index.tsx +16 -0
- package/template/base/solidjs-vite/src/instant.perms.ts +24 -0
- package/template/base/solidjs-vite/src/instant.schema.ts +46 -0
- package/template/base/solidjs-vite/src/lib/db.ts +8 -0
- package/template/base/solidjs-vite/tsconfig.json +20 -0
- package/template/base/solidjs-vite/vite.config.ts +11 -0
- package/template/base/sveltekit/README.md +15 -0
- package/template/base/sveltekit/_gitignore +26 -0
- package/template/base/sveltekit/package.json +25 -0
- package/template/base/sveltekit/src/app.css +25 -0
- package/template/base/sveltekit/src/app.html +11 -0
- package/template/base/sveltekit/src/instant.perms.ts +24 -0
- package/template/base/sveltekit/src/instant.schema.ts +46 -0
- package/template/base/sveltekit/src/lib/db.ts +8 -0
- package/template/base/sveltekit/src/routes/+layout.svelte +6 -0
- package/template/base/sveltekit/src/routes/+page.svelte +236 -0
- package/template/base/sveltekit/src/routes/+page.ts +1 -0
- package/template/base/sveltekit/svelte.config.js +10 -0
- package/template/base/sveltekit/tsconfig.json +14 -0
- package/template/base/sveltekit/vite.config.ts +7 -0
- package/template/base/tanstack-start/.cta.json +12 -0
- package/template/base/tanstack-start/README.md +17 -0
- package/template/base/tanstack-start/_gitignore +13 -0
- package/template/base/tanstack-start/package.json +43 -0
- package/template/base/tanstack-start/public/favicon.ico +0 -0
- package/template/base/tanstack-start/public/logo192.png +0 -0
- package/template/base/tanstack-start/public/logo512.png +0 -0
- package/template/base/tanstack-start/public/manifest.json +25 -0
- package/template/base/tanstack-start/public/robots.txt +3 -0
- package/template/base/tanstack-start/public/tanstack-circle-logo.png +0 -0
- package/template/base/tanstack-start/public/tanstack-word-logo-white.svg +1 -0
- package/template/base/tanstack-start/src/components/Header.tsx +21 -0
- package/template/base/tanstack-start/src/instant.perms.ts +24 -0
- package/template/base/tanstack-start/src/instant.schema.ts +50 -0
- package/template/base/tanstack-start/src/lib/adminDb.ts +12 -0
- package/template/base/tanstack-start/src/lib/db.ts +9 -0
- package/template/base/tanstack-start/src/logo.svg +12 -0
- package/template/base/tanstack-start/src/routeTree.gen.ts +104 -0
- package/template/base/tanstack-start/src/router.tsx +22 -0
- package/template/base/tanstack-start/src/routes/__root.tsx +70 -0
- package/template/base/tanstack-start/src/routes/api/instant.ts +18 -0
- package/template/base/tanstack-start/src/routes/index.tsx +238 -0
- package/template/base/tanstack-start/src/routes/login.tsx +140 -0
- package/template/base/tanstack-start/src/styles.css +18 -0
- package/template/base/tanstack-start/tsconfig.json +28 -0
- package/template/base/tanstack-start/vite.config.ts +33 -0
- package/template/base/tanstack-start-with-tanstack-query/.cta.json +12 -0
- package/template/base/tanstack-start-with-tanstack-query/README.md +18 -0
- package/template/base/tanstack-start-with-tanstack-query/_gitignore +13 -0
- package/template/base/tanstack-start-with-tanstack-query/package.json +46 -0
- package/template/base/tanstack-start-with-tanstack-query/public/favicon.ico +0 -0
- package/template/base/tanstack-start-with-tanstack-query/public/logo192.png +0 -0
- package/template/base/tanstack-start-with-tanstack-query/public/logo512.png +0 -0
- package/template/base/tanstack-start-with-tanstack-query/public/manifest.json +25 -0
- package/template/base/tanstack-start-with-tanstack-query/public/robots.txt +3 -0
- package/template/base/tanstack-start-with-tanstack-query/public/tanstack-circle-logo.png +0 -0
- package/template/base/tanstack-start-with-tanstack-query/public/tanstack-word-logo-white.svg +1 -0
- package/template/base/tanstack-start-with-tanstack-query/src/components/Header.tsx +21 -0
- package/template/base/tanstack-start-with-tanstack-query/src/instant.perms.ts +24 -0
- package/template/base/tanstack-start-with-tanstack-query/src/instant.schema.ts +50 -0
- package/template/base/tanstack-start-with-tanstack-query/src/lib/adminDb.ts +9 -0
- package/template/base/tanstack-start-with-tanstack-query/src/lib/db.ts +11 -0
- package/template/base/tanstack-start-with-tanstack-query/src/lib/instantQuery.ts +93 -0
- package/template/base/tanstack-start-with-tanstack-query/src/logo.svg +12 -0
- package/template/base/tanstack-start-with-tanstack-query/src/routeTree.gen.ts +104 -0
- package/template/base/tanstack-start-with-tanstack-query/src/router.tsx +108 -0
- package/template/base/tanstack-start-with-tanstack-query/src/routes/__root.tsx +76 -0
- package/template/base/tanstack-start-with-tanstack-query/src/routes/api/instant.ts +16 -0
- package/template/base/tanstack-start-with-tanstack-query/src/routes/index.tsx +231 -0
- package/template/base/tanstack-start-with-tanstack-query/src/routes/login.tsx +140 -0
- package/template/base/tanstack-start-with-tanstack-query/src/styles.css +17 -0
- package/template/base/tanstack-start-with-tanstack-query/tsconfig.json +28 -0
- package/template/base/tanstack-start-with-tanstack-query/vite.config.ts +33 -0
- package/template/base/vite-react/README.md +16 -0
- package/template/base/vite-react/_gitignore +26 -0
- package/template/base/vite-react/eslint.config.js +23 -0
- package/template/base/vite-react/index.html +13 -0
- package/template/base/vite-react/package.json +35 -0
- package/template/base/vite-react/public/favicon.svg +1 -0
- package/template/base/vite-react/src/App.tsx +167 -0
- package/template/base/vite-react/src/index.css +1 -0
- package/template/base/vite-react/src/instant.perms.ts +24 -0
- package/template/base/vite-react/src/instant.schema.ts +51 -0
- package/template/base/vite-react/src/lib/db.ts +8 -0
- package/template/base/vite-react/src/main.tsx +10 -0
- package/template/base/vite-react/tsconfig.app.json +25 -0
- package/template/base/vite-react/tsconfig.json +7 -0
- package/template/base/vite-react/tsconfig.node.json +24 -0
- package/template/base/vite-react/vite.config.ts +8 -0
- package/template/base/vite-vanilla/.env.example +2 -0
- package/template/base/vite-vanilla/README.md +17 -0
- package/template/base/vite-vanilla/_gitignore +25 -0
- package/template/base/vite-vanilla/index.html +13 -0
- package/template/base/vite-vanilla/package.json +20 -0
- package/template/base/vite-vanilla/pnpm-lock.yaml +707 -0
- package/template/base/vite-vanilla/public/vite.svg +1 -0
- package/template/base/vite-vanilla/src/instant.perms.ts +24 -0
- package/template/base/vite-vanilla/src/instant.schema.ts +50 -0
- package/template/base/vite-vanilla/src/lib/db.ts +11 -0
- package/template/base/vite-vanilla/src/main.ts +242 -0
- package/template/base/vite-vanilla/src/style.css +96 -0
- package/template/base/vite-vanilla/src/typescript.svg +1 -0
- package/template/base/vite-vanilla/src/vite-env.d.ts +1 -0
- package/template/base/vite-vanilla/tsconfig.json +24 -0
- package/template/base/vue-vite/README.md +15 -0
- package/template/base/vue-vite/_gitignore +43 -0
- package/template/base/vue-vite/env.d.ts +1 -0
- package/template/base/vue-vite/index.html +12 -0
- package/template/base/vue-vite/package.json +34 -0
- package/template/base/vue-vite/src/App.vue +238 -0
- package/template/base/vue-vite/src/assets/main.css +25 -0
- package/template/base/vue-vite/src/instant.perms.ts +24 -0
- package/template/base/vue-vite/src/instant.schema.ts +46 -0
- package/template/base/vue-vite/src/lib/db.ts +8 -0
- package/template/base/vue-vite/src/main.ts +6 -0
- package/template/base/vue-vite/tsconfig.app.json +15 -0
- package/template/base/vue-vite/tsconfig.json +11 -0
- package/template/base/vue-vite/tsconfig.node.json +27 -0
- package/template/base/vue-vite/vite.config.ts +16 -0
- package/template/rules/AGENTS.md +436 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Collapsible,
|
|
7
|
+
CollapsibleContent,
|
|
8
|
+
CollapsibleTrigger,
|
|
9
|
+
} from '@/components/ui/collapsible';
|
|
10
|
+
import { cn } from '@/lib/utils';
|
|
11
|
+
import {
|
|
12
|
+
ChevronRightIcon,
|
|
13
|
+
FileIcon,
|
|
14
|
+
FolderIcon,
|
|
15
|
+
FolderOpenIcon,
|
|
16
|
+
} from 'lucide-react';
|
|
17
|
+
import {
|
|
18
|
+
createContext,
|
|
19
|
+
useCallback,
|
|
20
|
+
useContext,
|
|
21
|
+
useMemo,
|
|
22
|
+
useState,
|
|
23
|
+
} from 'react';
|
|
24
|
+
|
|
25
|
+
interface FileTreeContextType {
|
|
26
|
+
expandedPaths: Set<string>;
|
|
27
|
+
togglePath: (path: string) => void;
|
|
28
|
+
selectedPath?: string;
|
|
29
|
+
onSelect?: (path: string) => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Default noop for context default value
|
|
33
|
+
// oxlint-disable-next-line eslint(no-empty-function)
|
|
34
|
+
const noop = () => {};
|
|
35
|
+
|
|
36
|
+
const FileTreeContext = createContext<FileTreeContextType>({
|
|
37
|
+
// oxlint-disable-next-line eslint-plugin-unicorn(no-new-builtin)
|
|
38
|
+
expandedPaths: new Set(),
|
|
39
|
+
togglePath: noop,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export type FileTreeProps = HTMLAttributes<HTMLDivElement> & {
|
|
43
|
+
expanded?: Set<string>;
|
|
44
|
+
defaultExpanded?: Set<string>;
|
|
45
|
+
selectedPath?: string;
|
|
46
|
+
onSelect?: (path: string) => void;
|
|
47
|
+
onExpandedChange?: (expanded: Set<string>) => void;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const FileTree = ({
|
|
51
|
+
expanded: controlledExpanded,
|
|
52
|
+
defaultExpanded = new Set(),
|
|
53
|
+
selectedPath,
|
|
54
|
+
onSelect,
|
|
55
|
+
onExpandedChange,
|
|
56
|
+
className,
|
|
57
|
+
children,
|
|
58
|
+
...props
|
|
59
|
+
}: FileTreeProps) => {
|
|
60
|
+
const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);
|
|
61
|
+
const expandedPaths = controlledExpanded ?? internalExpanded;
|
|
62
|
+
|
|
63
|
+
const togglePath = useCallback(
|
|
64
|
+
(path: string) => {
|
|
65
|
+
const newExpanded = new Set(expandedPaths);
|
|
66
|
+
if (newExpanded.has(path)) {
|
|
67
|
+
newExpanded.delete(path);
|
|
68
|
+
} else {
|
|
69
|
+
newExpanded.add(path);
|
|
70
|
+
}
|
|
71
|
+
setInternalExpanded(newExpanded);
|
|
72
|
+
onExpandedChange?.(newExpanded);
|
|
73
|
+
},
|
|
74
|
+
[expandedPaths, onExpandedChange],
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const contextValue = useMemo(
|
|
78
|
+
() => ({ expandedPaths, onSelect, selectedPath, togglePath }),
|
|
79
|
+
[expandedPaths, onSelect, selectedPath, togglePath],
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<FileTreeContext.Provider value={contextValue}>
|
|
84
|
+
<div
|
|
85
|
+
className={cn(
|
|
86
|
+
'bg-background rounded-lg border font-mono text-sm',
|
|
87
|
+
className,
|
|
88
|
+
)}
|
|
89
|
+
role="tree"
|
|
90
|
+
{...props}
|
|
91
|
+
>
|
|
92
|
+
<div className="p-2">{children}</div>
|
|
93
|
+
</div>
|
|
94
|
+
</FileTreeContext.Provider>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
interface FileTreeFolderContextType {
|
|
99
|
+
path: string;
|
|
100
|
+
name: string;
|
|
101
|
+
isExpanded: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const FileTreeFolderContext = createContext<FileTreeFolderContextType>({
|
|
105
|
+
isExpanded: false,
|
|
106
|
+
name: '',
|
|
107
|
+
path: '',
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export type FileTreeFolderProps = HTMLAttributes<HTMLDivElement> & {
|
|
111
|
+
path: string;
|
|
112
|
+
name: string;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const FileTreeFolder = ({
|
|
116
|
+
path,
|
|
117
|
+
name,
|
|
118
|
+
className,
|
|
119
|
+
children,
|
|
120
|
+
...props
|
|
121
|
+
}: FileTreeFolderProps) => {
|
|
122
|
+
const { expandedPaths, togglePath, selectedPath, onSelect } =
|
|
123
|
+
useContext(FileTreeContext);
|
|
124
|
+
const isExpanded = expandedPaths.has(path);
|
|
125
|
+
const isSelected = selectedPath === path;
|
|
126
|
+
|
|
127
|
+
const handleOpenChange = useCallback(() => {
|
|
128
|
+
togglePath(path);
|
|
129
|
+
}, [togglePath, path]);
|
|
130
|
+
|
|
131
|
+
const handleSelect = useCallback(() => {
|
|
132
|
+
onSelect?.(path);
|
|
133
|
+
}, [onSelect, path]);
|
|
134
|
+
|
|
135
|
+
const folderContextValue = useMemo(
|
|
136
|
+
() => ({ isExpanded, name, path }),
|
|
137
|
+
[isExpanded, name, path],
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<FileTreeFolderContext.Provider value={folderContextValue}>
|
|
142
|
+
<Collapsible onOpenChange={handleOpenChange} open={isExpanded}>
|
|
143
|
+
<div
|
|
144
|
+
className={cn('', className)}
|
|
145
|
+
role="treeitem"
|
|
146
|
+
tabIndex={0}
|
|
147
|
+
{...props}
|
|
148
|
+
>
|
|
149
|
+
<CollapsibleTrigger asChild>
|
|
150
|
+
<button
|
|
151
|
+
className={cn(
|
|
152
|
+
'hover:bg-muted/50 flex w-full items-center gap-1 rounded px-2 py-1 text-left transition-colors',
|
|
153
|
+
isSelected && 'bg-muted',
|
|
154
|
+
)}
|
|
155
|
+
onClick={handleSelect}
|
|
156
|
+
type="button"
|
|
157
|
+
>
|
|
158
|
+
<ChevronRightIcon
|
|
159
|
+
className={cn(
|
|
160
|
+
'text-muted-foreground size-4 shrink-0 transition-transform',
|
|
161
|
+
isExpanded && 'rotate-90',
|
|
162
|
+
)}
|
|
163
|
+
/>
|
|
164
|
+
<FileTreeIcon>
|
|
165
|
+
{isExpanded ? (
|
|
166
|
+
<FolderOpenIcon className="size-4 text-blue-500" />
|
|
167
|
+
) : (
|
|
168
|
+
<FolderIcon className="size-4 text-blue-500" />
|
|
169
|
+
)}
|
|
170
|
+
</FileTreeIcon>
|
|
171
|
+
<FileTreeName>{name}</FileTreeName>
|
|
172
|
+
</button>
|
|
173
|
+
</CollapsibleTrigger>
|
|
174
|
+
<CollapsibleContent>
|
|
175
|
+
<div className="ml-4 border-l pl-2">{children}</div>
|
|
176
|
+
</CollapsibleContent>
|
|
177
|
+
</div>
|
|
178
|
+
</Collapsible>
|
|
179
|
+
</FileTreeFolderContext.Provider>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
interface FileTreeFileContextType {
|
|
184
|
+
path: string;
|
|
185
|
+
name: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const FileTreeFileContext = createContext<FileTreeFileContextType>({
|
|
189
|
+
name: '',
|
|
190
|
+
path: '',
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
export type FileTreeFileProps = HTMLAttributes<HTMLDivElement> & {
|
|
194
|
+
path: string;
|
|
195
|
+
name: string;
|
|
196
|
+
icon?: ReactNode;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export const FileTreeFile = ({
|
|
200
|
+
path,
|
|
201
|
+
name,
|
|
202
|
+
icon,
|
|
203
|
+
className,
|
|
204
|
+
children,
|
|
205
|
+
...props
|
|
206
|
+
}: FileTreeFileProps) => {
|
|
207
|
+
const { selectedPath, onSelect } = useContext(FileTreeContext);
|
|
208
|
+
const isSelected = selectedPath === path;
|
|
209
|
+
|
|
210
|
+
const handleClick = useCallback(() => {
|
|
211
|
+
onSelect?.(path);
|
|
212
|
+
}, [onSelect, path]);
|
|
213
|
+
|
|
214
|
+
const handleKeyDown = useCallback(
|
|
215
|
+
(e: React.KeyboardEvent) => {
|
|
216
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
217
|
+
onSelect?.(path);
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
[onSelect, path],
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
const fileContextValue = useMemo(() => ({ name, path }), [name, path]);
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
<FileTreeFileContext.Provider value={fileContextValue}>
|
|
227
|
+
<div
|
|
228
|
+
className={cn(
|
|
229
|
+
'hover:bg-muted/50 flex cursor-pointer items-center gap-1 rounded px-2 py-1 transition-colors',
|
|
230
|
+
isSelected && 'bg-muted',
|
|
231
|
+
className,
|
|
232
|
+
)}
|
|
233
|
+
onClick={handleClick}
|
|
234
|
+
onKeyDown={handleKeyDown}
|
|
235
|
+
role="treeitem"
|
|
236
|
+
tabIndex={0}
|
|
237
|
+
{...props}
|
|
238
|
+
>
|
|
239
|
+
{children ?? (
|
|
240
|
+
<>
|
|
241
|
+
{/* Spacer for alignment */}
|
|
242
|
+
<span className="size-4" />
|
|
243
|
+
<FileTreeIcon>
|
|
244
|
+
{icon ?? <FileIcon className="text-muted-foreground size-4" />}
|
|
245
|
+
</FileTreeIcon>
|
|
246
|
+
<FileTreeName>{name}</FileTreeName>
|
|
247
|
+
</>
|
|
248
|
+
)}
|
|
249
|
+
</div>
|
|
250
|
+
</FileTreeFileContext.Provider>
|
|
251
|
+
);
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export type FileTreeIconProps = HTMLAttributes<HTMLSpanElement>;
|
|
255
|
+
|
|
256
|
+
export const FileTreeIcon = ({
|
|
257
|
+
className,
|
|
258
|
+
children,
|
|
259
|
+
...props
|
|
260
|
+
}: FileTreeIconProps) => (
|
|
261
|
+
<span className={cn('shrink-0', className)} {...props}>
|
|
262
|
+
{children}
|
|
263
|
+
</span>
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
export type FileTreeNameProps = HTMLAttributes<HTMLSpanElement>;
|
|
267
|
+
|
|
268
|
+
export const FileTreeName = ({
|
|
269
|
+
className,
|
|
270
|
+
children,
|
|
271
|
+
...props
|
|
272
|
+
}: FileTreeNameProps) => (
|
|
273
|
+
<span className={cn('truncate', className)} {...props}>
|
|
274
|
+
{children}
|
|
275
|
+
</span>
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
export type FileTreeActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
279
|
+
|
|
280
|
+
const stopPropagation = (e: React.SyntheticEvent) => e.stopPropagation();
|
|
281
|
+
|
|
282
|
+
export const FileTreeActions = ({
|
|
283
|
+
className,
|
|
284
|
+
children,
|
|
285
|
+
...props
|
|
286
|
+
}: FileTreeActionsProps) => (
|
|
287
|
+
// biome-ignore lint/a11y/noNoninteractiveElementInteractions: stopPropagation required for nested interactions
|
|
288
|
+
// biome-ignore lint/a11y/useSemanticElements: fieldset doesn't fit this UI pattern
|
|
289
|
+
<div
|
|
290
|
+
className={cn('ml-auto flex items-center gap-1', className)}
|
|
291
|
+
onClick={stopPropagation}
|
|
292
|
+
onKeyDown={stopPropagation}
|
|
293
|
+
role="group"
|
|
294
|
+
{...props}
|
|
295
|
+
>
|
|
296
|
+
{children}
|
|
297
|
+
</div>
|
|
298
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Experimental_GeneratedImage } from 'ai';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
|
|
5
|
+
export type ImageProps = Experimental_GeneratedImage & {
|
|
6
|
+
className?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Image = ({
|
|
11
|
+
base64,
|
|
12
|
+
uint8Array: _uint8Array,
|
|
13
|
+
mediaType,
|
|
14
|
+
...props
|
|
15
|
+
}: ImageProps) => (
|
|
16
|
+
<img
|
|
17
|
+
{...props}
|
|
18
|
+
alt={props.alt}
|
|
19
|
+
className={cn(
|
|
20
|
+
'h-auto max-w-full overflow-hidden rounded-md',
|
|
21
|
+
props.className,
|
|
22
|
+
)}
|
|
23
|
+
src={`data:${mediaType};base64,${base64}`}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { CarouselApi } from '@/components/ui/carousel';
|
|
4
|
+
import type { ComponentProps } from 'react';
|
|
5
|
+
|
|
6
|
+
import { Badge } from '@/components/ui/badge';
|
|
7
|
+
import {
|
|
8
|
+
Carousel,
|
|
9
|
+
CarouselContent,
|
|
10
|
+
CarouselItem,
|
|
11
|
+
} from '@/components/ui/carousel';
|
|
12
|
+
import {
|
|
13
|
+
HoverCard,
|
|
14
|
+
HoverCardContent,
|
|
15
|
+
HoverCardTrigger,
|
|
16
|
+
} from '@/components/ui/hover-card';
|
|
17
|
+
import { cn } from '@/lib/utils';
|
|
18
|
+
import { ArrowLeftIcon, ArrowRightIcon } from 'lucide-react';
|
|
19
|
+
import {
|
|
20
|
+
createContext,
|
|
21
|
+
useCallback,
|
|
22
|
+
useContext,
|
|
23
|
+
useEffect,
|
|
24
|
+
useState,
|
|
25
|
+
} from 'react';
|
|
26
|
+
|
|
27
|
+
export type InlineCitationProps = ComponentProps<'span'>;
|
|
28
|
+
|
|
29
|
+
export const InlineCitation = ({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: InlineCitationProps) => (
|
|
33
|
+
<span
|
|
34
|
+
className={cn('group inline items-center gap-1', className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export type InlineCitationTextProps = ComponentProps<'span'>;
|
|
40
|
+
|
|
41
|
+
export const InlineCitationText = ({
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}: InlineCitationTextProps) => (
|
|
45
|
+
<span
|
|
46
|
+
className={cn('group-hover:bg-accent transition-colors', className)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export type InlineCitationCardProps = ComponentProps<typeof HoverCard>;
|
|
52
|
+
|
|
53
|
+
export const InlineCitationCard = (props: InlineCitationCardProps) => (
|
|
54
|
+
<HoverCard closeDelay={0} openDelay={0} {...props} />
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
export type InlineCitationCardTriggerProps = ComponentProps<typeof Badge> & {
|
|
58
|
+
sources: string[];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const InlineCitationCardTrigger = ({
|
|
62
|
+
sources,
|
|
63
|
+
className,
|
|
64
|
+
...props
|
|
65
|
+
}: InlineCitationCardTriggerProps) => (
|
|
66
|
+
<HoverCardTrigger asChild>
|
|
67
|
+
<Badge
|
|
68
|
+
className={cn('ml-1 rounded-full', className)}
|
|
69
|
+
variant="secondary"
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
{sources[0] ? (
|
|
73
|
+
<>
|
|
74
|
+
{new URL(sources[0]).hostname}{' '}
|
|
75
|
+
{sources.length > 1 && `+${sources.length - 1}`}
|
|
76
|
+
</>
|
|
77
|
+
) : (
|
|
78
|
+
'unknown'
|
|
79
|
+
)}
|
|
80
|
+
</Badge>
|
|
81
|
+
</HoverCardTrigger>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
export type InlineCitationCardBodyProps = ComponentProps<'div'>;
|
|
85
|
+
|
|
86
|
+
export const InlineCitationCardBody = ({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: InlineCitationCardBodyProps) => (
|
|
90
|
+
<HoverCardContent className={cn('relative w-80 p-0', className)} {...props} />
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const CarouselApiContext = createContext<CarouselApi | undefined>(undefined);
|
|
94
|
+
|
|
95
|
+
const useCarouselApi = () => {
|
|
96
|
+
const context = useContext(CarouselApiContext);
|
|
97
|
+
return context;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type InlineCitationCarouselProps = ComponentProps<typeof Carousel>;
|
|
101
|
+
|
|
102
|
+
export const InlineCitationCarousel = ({
|
|
103
|
+
className,
|
|
104
|
+
children,
|
|
105
|
+
...props
|
|
106
|
+
}: InlineCitationCarouselProps) => {
|
|
107
|
+
const [api, setApi] = useState<CarouselApi>();
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<CarouselApiContext.Provider value={api}>
|
|
111
|
+
<Carousel className={cn('w-full', className)} setApi={setApi} {...props}>
|
|
112
|
+
{children}
|
|
113
|
+
</Carousel>
|
|
114
|
+
</CarouselApiContext.Provider>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type InlineCitationCarouselContentProps = ComponentProps<'div'>;
|
|
119
|
+
|
|
120
|
+
export const InlineCitationCarouselContent = (
|
|
121
|
+
props: InlineCitationCarouselContentProps,
|
|
122
|
+
) => <CarouselContent {...props} />;
|
|
123
|
+
|
|
124
|
+
export type InlineCitationCarouselItemProps = ComponentProps<'div'>;
|
|
125
|
+
|
|
126
|
+
export const InlineCitationCarouselItem = ({
|
|
127
|
+
className,
|
|
128
|
+
...props
|
|
129
|
+
}: InlineCitationCarouselItemProps) => (
|
|
130
|
+
<CarouselItem
|
|
131
|
+
className={cn('w-full space-y-2 p-4 pl-8', className)}
|
|
132
|
+
{...props}
|
|
133
|
+
/>
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
export type InlineCitationCarouselHeaderProps = ComponentProps<'div'>;
|
|
137
|
+
|
|
138
|
+
export const InlineCitationCarouselHeader = ({
|
|
139
|
+
className,
|
|
140
|
+
...props
|
|
141
|
+
}: InlineCitationCarouselHeaderProps) => (
|
|
142
|
+
<div
|
|
143
|
+
className={cn(
|
|
144
|
+
'bg-secondary flex items-center justify-between gap-2 rounded-t-md p-2',
|
|
145
|
+
className,
|
|
146
|
+
)}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
export type InlineCitationCarouselIndexProps = ComponentProps<'div'>;
|
|
152
|
+
|
|
153
|
+
export const InlineCitationCarouselIndex = ({
|
|
154
|
+
children,
|
|
155
|
+
className,
|
|
156
|
+
...props
|
|
157
|
+
}: InlineCitationCarouselIndexProps) => {
|
|
158
|
+
const api = useCarouselApi();
|
|
159
|
+
const [current, setCurrent] = useState(0);
|
|
160
|
+
const [count, setCount] = useState(0);
|
|
161
|
+
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
if (!api) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
setCount(api.scrollSnapList().length);
|
|
168
|
+
setCurrent(api.selectedScrollSnap() + 1);
|
|
169
|
+
|
|
170
|
+
const handleSelect = () => {
|
|
171
|
+
setCurrent(api.selectedScrollSnap() + 1);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
api.on('select', handleSelect);
|
|
175
|
+
|
|
176
|
+
return () => {
|
|
177
|
+
api.off('select', handleSelect);
|
|
178
|
+
};
|
|
179
|
+
}, [api]);
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<div
|
|
183
|
+
className={cn(
|
|
184
|
+
'text-muted-foreground flex flex-1 items-center justify-end px-3 py-1 text-xs',
|
|
185
|
+
className,
|
|
186
|
+
)}
|
|
187
|
+
{...props}
|
|
188
|
+
>
|
|
189
|
+
{children ?? `${current}/${count}`}
|
|
190
|
+
</div>
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export type InlineCitationCarouselPrevProps = ComponentProps<'button'>;
|
|
195
|
+
|
|
196
|
+
export const InlineCitationCarouselPrev = ({
|
|
197
|
+
className,
|
|
198
|
+
...props
|
|
199
|
+
}: InlineCitationCarouselPrevProps) => {
|
|
200
|
+
const api = useCarouselApi();
|
|
201
|
+
|
|
202
|
+
const handleClick = useCallback(() => {
|
|
203
|
+
if (api) {
|
|
204
|
+
api.scrollPrev();
|
|
205
|
+
}
|
|
206
|
+
}, [api]);
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<button
|
|
210
|
+
aria-label="Previous"
|
|
211
|
+
className={cn('shrink-0', className)}
|
|
212
|
+
onClick={handleClick}
|
|
213
|
+
type="button"
|
|
214
|
+
{...props}
|
|
215
|
+
>
|
|
216
|
+
<ArrowLeftIcon className="text-muted-foreground size-4" />
|
|
217
|
+
</button>
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export type InlineCitationCarouselNextProps = ComponentProps<'button'>;
|
|
222
|
+
|
|
223
|
+
export const InlineCitationCarouselNext = ({
|
|
224
|
+
className,
|
|
225
|
+
...props
|
|
226
|
+
}: InlineCitationCarouselNextProps) => {
|
|
227
|
+
const api = useCarouselApi();
|
|
228
|
+
|
|
229
|
+
const handleClick = useCallback(() => {
|
|
230
|
+
if (api) {
|
|
231
|
+
api.scrollNext();
|
|
232
|
+
}
|
|
233
|
+
}, [api]);
|
|
234
|
+
|
|
235
|
+
return (
|
|
236
|
+
<button
|
|
237
|
+
aria-label="Next"
|
|
238
|
+
className={cn('shrink-0', className)}
|
|
239
|
+
onClick={handleClick}
|
|
240
|
+
type="button"
|
|
241
|
+
{...props}
|
|
242
|
+
>
|
|
243
|
+
<ArrowRightIcon className="text-muted-foreground size-4" />
|
|
244
|
+
</button>
|
|
245
|
+
);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export type InlineCitationSourceProps = ComponentProps<'div'> & {
|
|
249
|
+
title?: string;
|
|
250
|
+
url?: string;
|
|
251
|
+
description?: string;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export const InlineCitationSource = ({
|
|
255
|
+
title,
|
|
256
|
+
url,
|
|
257
|
+
description,
|
|
258
|
+
className,
|
|
259
|
+
children,
|
|
260
|
+
...props
|
|
261
|
+
}: InlineCitationSourceProps) => (
|
|
262
|
+
<div className={cn('space-y-1', className)} {...props}>
|
|
263
|
+
{title && (
|
|
264
|
+
<h4 className="truncate text-sm leading-tight font-medium">{title}</h4>
|
|
265
|
+
)}
|
|
266
|
+
{url && (
|
|
267
|
+
<p className="text-muted-foreground truncate text-xs break-all">{url}</p>
|
|
268
|
+
)}
|
|
269
|
+
{description && (
|
|
270
|
+
<p className="text-muted-foreground line-clamp-3 text-sm leading-relaxed">
|
|
271
|
+
{description}
|
|
272
|
+
</p>
|
|
273
|
+
)}
|
|
274
|
+
{children}
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
export type InlineCitationQuoteProps = ComponentProps<'blockquote'>;
|
|
279
|
+
|
|
280
|
+
export const InlineCitationQuote = ({
|
|
281
|
+
children,
|
|
282
|
+
className,
|
|
283
|
+
...props
|
|
284
|
+
}: InlineCitationQuoteProps) => (
|
|
285
|
+
<blockquote
|
|
286
|
+
className={cn(
|
|
287
|
+
'border-muted text-muted-foreground border-l-2 pl-3 text-sm italic',
|
|
288
|
+
className,
|
|
289
|
+
)}
|
|
290
|
+
{...props}
|
|
291
|
+
>
|
|
292
|
+
{children}
|
|
293
|
+
</blockquote>
|
|
294
|
+
);
|