From 0f4f029d071d637c25891ff6bb6477eb8df0bb1e Mon Sep 17 00:00:00 2001 From: Nahiyan Khan Date: Tue, 7 Apr 2026 01:15:30 -0400 Subject: [PATCH] Gitignore built registry output and fix pre-existing lint warnings Registry JSON files in public/r/ will be generated at deploy time by the static site build rather than committed to the repo. Also adds biome-ignore directives for unavoidable `any` usage in the visual harness's dynamic imports and browser-context globals. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 1 + .../ghost-core/src/scanners/visual-harness.ts | 17 +- packages/ghost-ui/public/r/accordion.json | 16 - packages/ghost-ui/public/r/agent.json | 16 - packages/ghost-ui/public/r/alert-dialog.json | 16 - packages/ghost-ui/public/r/alert.json | 16 - packages/ghost-ui/public/r/artifact.json | 16 - packages/ghost-ui/public/r/aspect-ratio.json | 15 - packages/ghost-ui/public/r/attachments.json | 16 - packages/ghost-ui/public/r/audio-player.json | 16 - packages/ghost-ui/public/r/avatar.json | 16 - packages/ghost-ui/public/r/badge.json | 16 - packages/ghost-ui/public/r/breadcrumb.json | 16 - packages/ghost-ui/public/r/button-group.json | 16 - packages/ghost-ui/public/r/button.json | 16 - packages/ghost-ui/public/r/calendar.json | 16 - packages/ghost-ui/public/r/canvas.json | 15 - packages/ghost-ui/public/r/card.json | 15 - packages/ghost-ui/public/r/carousel.json | 16 - .../ghost-ui/public/r/chain-of-thought.json | 16 - packages/ghost-ui/public/r/chart.json | 16 - packages/ghost-ui/public/r/checkbox.json | 16 - packages/ghost-ui/public/r/checkpoint.json | 16 - packages/ghost-ui/public/r/code-block.json | 16 - packages/ghost-ui/public/r/collapsible.json | 15 - packages/ghost-ui/public/r/command.json | 16 - packages/ghost-ui/public/r/commit.json | 16 - packages/ghost-ui/public/r/confirmation.json | 16 - packages/ghost-ui/public/r/connection.json | 15 - packages/ghost-ui/public/r/context-menu.json | 16 - packages/ghost-ui/public/r/context.json | 16 - packages/ghost-ui/public/r/controls.json | 16 - packages/ghost-ui/public/r/conversation.json | 16 - packages/ghost-ui/public/r/dialog.json | 16 - packages/ghost-ui/public/r/drawer.json | 16 - packages/ghost-ui/public/r/dropdown-menu.json | 16 - packages/ghost-ui/public/r/edge.json | 15 - .../public/r/environment-variables.json | 16 - packages/ghost-ui/public/r/file-tree.json | 16 - .../public/r/font-hk-grotesk-faces.json | 13 - .../ghost-ui/public/r/font-hk-grotesk.json | 61 - packages/ghost-ui/public/r/form.json | 16 - packages/ghost-ui/public/r/ghost-ui-base.json | 343 --- packages/ghost-ui/public/r/hover-card.json | 16 - packages/ghost-ui/public/r/image.json | 16 - .../ghost-ui/public/r/inline-citation.json | 16 - packages/ghost-ui/public/r/input-group.json | 16 - packages/ghost-ui/public/r/input-otp.json | 16 - packages/ghost-ui/public/r/input.json | 15 - packages/ghost-ui/public/r/jsx-preview.json | 16 - packages/ghost-ui/public/r/label.json | 16 - packages/ghost-ui/public/r/menubar.json | 16 - packages/ghost-ui/public/r/message.json | 24 - packages/ghost-ui/public/r/mic-selector.json | 16 - .../ghost-ui/public/r/model-selector.json | 15 - .../ghost-ui/public/r/navigation-menu.json | 20 - packages/ghost-ui/public/r/node.json | 16 - packages/ghost-ui/public/r/open-in-chat.json | 16 - packages/ghost-ui/public/r/package-info.json | 16 - packages/ghost-ui/public/r/pagination.json | 16 - packages/ghost-ui/public/r/panel.json | 16 - packages/ghost-ui/public/r/persona.json | 16 - packages/ghost-ui/public/r/plan.json | 16 - packages/ghost-ui/public/r/popover.json | 16 - packages/ghost-ui/public/r/progress.json | 16 - packages/ghost-ui/public/r/prompt-input.json | 25 - packages/ghost-ui/public/r/queue.json | 16 - packages/ghost-ui/public/r/radio-group.json | 16 - packages/ghost-ui/public/r/reasoning.json | 24 - packages/ghost-ui/public/r/registry.json | 2204 ----------------- packages/ghost-ui/public/r/resizable.json | 16 - packages/ghost-ui/public/r/sandbox.json | 16 - .../ghost-ui/public/r/schema-display.json | 16 - packages/ghost-ui/public/r/scroll-area.json | 16 - packages/ghost-ui/public/r/select.json | 16 - packages/ghost-ui/public/r/separator.json | 16 - packages/ghost-ui/public/r/sheet.json | 16 - packages/ghost-ui/public/r/shimmer.json | 16 - packages/ghost-ui/public/r/sidebar.json | 28 - packages/ghost-ui/public/r/skeleton.json | 15 - packages/ghost-ui/public/r/slider.json | 16 - packages/ghost-ui/public/r/snippet.json | 16 - packages/ghost-ui/public/r/sonner.json | 15 - packages/ghost-ui/public/r/sources.json | 16 - packages/ghost-ui/public/r/speech-input.json | 16 - packages/ghost-ui/public/r/spinner.json | 16 - packages/ghost-ui/public/r/stack-trace.json | 16 - packages/ghost-ui/public/r/styles-main.json | 16 - packages/ghost-ui/public/r/suggestion.json | 15 - packages/ghost-ui/public/r/switch.json | 16 - packages/ghost-ui/public/r/table.json | 15 - packages/ghost-ui/public/r/tabs.json | 16 - packages/ghost-ui/public/r/task.json | 16 - packages/ghost-ui/public/r/terminal.json | 16 - packages/ghost-ui/public/r/test-results.json | 16 - packages/ghost-ui/public/r/textarea.json | 15 - .../public/r/theme-midnight-luxe.json | 62 - .../public/r/theme-neon-brutalist.json | 78 - packages/ghost-ui/public/r/theme-ocean.json | 60 - .../ghost-ui/public/r/theme-soft-pastel.json | 94 - .../ghost-ui/public/r/theme-warm-sand.json | 60 - packages/ghost-ui/public/r/toggle-group.json | 16 - packages/ghost-ui/public/r/toggle.json | 16 - packages/ghost-ui/public/r/tool.json | 16 - packages/ghost-ui/public/r/toolbar.json | 16 - packages/ghost-ui/public/r/tooltip.json | 16 - packages/ghost-ui/public/r/transcription.json | 16 - packages/ghost-ui/public/r/utils.json | 14 - .../ghost-ui/public/r/voice-selector.json | 16 - packages/ghost-ui/public/r/web-preview.json | 22 - 110 files changed, 13 insertions(+), 4596 deletions(-) delete mode 100644 packages/ghost-ui/public/r/accordion.json delete mode 100644 packages/ghost-ui/public/r/agent.json delete mode 100644 packages/ghost-ui/public/r/alert-dialog.json delete mode 100644 packages/ghost-ui/public/r/alert.json delete mode 100644 packages/ghost-ui/public/r/artifact.json delete mode 100644 packages/ghost-ui/public/r/aspect-ratio.json delete mode 100644 packages/ghost-ui/public/r/attachments.json delete mode 100644 packages/ghost-ui/public/r/audio-player.json delete mode 100644 packages/ghost-ui/public/r/avatar.json delete mode 100644 packages/ghost-ui/public/r/badge.json delete mode 100644 packages/ghost-ui/public/r/breadcrumb.json delete mode 100644 packages/ghost-ui/public/r/button-group.json delete mode 100644 packages/ghost-ui/public/r/button.json delete mode 100644 packages/ghost-ui/public/r/calendar.json delete mode 100644 packages/ghost-ui/public/r/canvas.json delete mode 100644 packages/ghost-ui/public/r/card.json delete mode 100644 packages/ghost-ui/public/r/carousel.json delete mode 100644 packages/ghost-ui/public/r/chain-of-thought.json delete mode 100644 packages/ghost-ui/public/r/chart.json delete mode 100644 packages/ghost-ui/public/r/checkbox.json delete mode 100644 packages/ghost-ui/public/r/checkpoint.json delete mode 100644 packages/ghost-ui/public/r/code-block.json delete mode 100644 packages/ghost-ui/public/r/collapsible.json delete mode 100644 packages/ghost-ui/public/r/command.json delete mode 100644 packages/ghost-ui/public/r/commit.json delete mode 100644 packages/ghost-ui/public/r/confirmation.json delete mode 100644 packages/ghost-ui/public/r/connection.json delete mode 100644 packages/ghost-ui/public/r/context-menu.json delete mode 100644 packages/ghost-ui/public/r/context.json delete mode 100644 packages/ghost-ui/public/r/controls.json delete mode 100644 packages/ghost-ui/public/r/conversation.json delete mode 100644 packages/ghost-ui/public/r/dialog.json delete mode 100644 packages/ghost-ui/public/r/drawer.json delete mode 100644 packages/ghost-ui/public/r/dropdown-menu.json delete mode 100644 packages/ghost-ui/public/r/edge.json delete mode 100644 packages/ghost-ui/public/r/environment-variables.json delete mode 100644 packages/ghost-ui/public/r/file-tree.json delete mode 100644 packages/ghost-ui/public/r/font-hk-grotesk-faces.json delete mode 100644 packages/ghost-ui/public/r/font-hk-grotesk.json delete mode 100644 packages/ghost-ui/public/r/form.json delete mode 100644 packages/ghost-ui/public/r/ghost-ui-base.json delete mode 100644 packages/ghost-ui/public/r/hover-card.json delete mode 100644 packages/ghost-ui/public/r/image.json delete mode 100644 packages/ghost-ui/public/r/inline-citation.json delete mode 100644 packages/ghost-ui/public/r/input-group.json delete mode 100644 packages/ghost-ui/public/r/input-otp.json delete mode 100644 packages/ghost-ui/public/r/input.json delete mode 100644 packages/ghost-ui/public/r/jsx-preview.json delete mode 100644 packages/ghost-ui/public/r/label.json delete mode 100644 packages/ghost-ui/public/r/menubar.json delete mode 100644 packages/ghost-ui/public/r/message.json delete mode 100644 packages/ghost-ui/public/r/mic-selector.json delete mode 100644 packages/ghost-ui/public/r/model-selector.json delete mode 100644 packages/ghost-ui/public/r/navigation-menu.json delete mode 100644 packages/ghost-ui/public/r/node.json delete mode 100644 packages/ghost-ui/public/r/open-in-chat.json delete mode 100644 packages/ghost-ui/public/r/package-info.json delete mode 100644 packages/ghost-ui/public/r/pagination.json delete mode 100644 packages/ghost-ui/public/r/panel.json delete mode 100644 packages/ghost-ui/public/r/persona.json delete mode 100644 packages/ghost-ui/public/r/plan.json delete mode 100644 packages/ghost-ui/public/r/popover.json delete mode 100644 packages/ghost-ui/public/r/progress.json delete mode 100644 packages/ghost-ui/public/r/prompt-input.json delete mode 100644 packages/ghost-ui/public/r/queue.json delete mode 100644 packages/ghost-ui/public/r/radio-group.json delete mode 100644 packages/ghost-ui/public/r/reasoning.json delete mode 100644 packages/ghost-ui/public/r/registry.json delete mode 100644 packages/ghost-ui/public/r/resizable.json delete mode 100644 packages/ghost-ui/public/r/sandbox.json delete mode 100644 packages/ghost-ui/public/r/schema-display.json delete mode 100644 packages/ghost-ui/public/r/scroll-area.json delete mode 100644 packages/ghost-ui/public/r/select.json delete mode 100644 packages/ghost-ui/public/r/separator.json delete mode 100644 packages/ghost-ui/public/r/sheet.json delete mode 100644 packages/ghost-ui/public/r/shimmer.json delete mode 100644 packages/ghost-ui/public/r/sidebar.json delete mode 100644 packages/ghost-ui/public/r/skeleton.json delete mode 100644 packages/ghost-ui/public/r/slider.json delete mode 100644 packages/ghost-ui/public/r/snippet.json delete mode 100644 packages/ghost-ui/public/r/sonner.json delete mode 100644 packages/ghost-ui/public/r/sources.json delete mode 100644 packages/ghost-ui/public/r/speech-input.json delete mode 100644 packages/ghost-ui/public/r/spinner.json delete mode 100644 packages/ghost-ui/public/r/stack-trace.json delete mode 100644 packages/ghost-ui/public/r/styles-main.json delete mode 100644 packages/ghost-ui/public/r/suggestion.json delete mode 100644 packages/ghost-ui/public/r/switch.json delete mode 100644 packages/ghost-ui/public/r/table.json delete mode 100644 packages/ghost-ui/public/r/tabs.json delete mode 100644 packages/ghost-ui/public/r/task.json delete mode 100644 packages/ghost-ui/public/r/terminal.json delete mode 100644 packages/ghost-ui/public/r/test-results.json delete mode 100644 packages/ghost-ui/public/r/textarea.json delete mode 100644 packages/ghost-ui/public/r/theme-midnight-luxe.json delete mode 100644 packages/ghost-ui/public/r/theme-neon-brutalist.json delete mode 100644 packages/ghost-ui/public/r/theme-ocean.json delete mode 100644 packages/ghost-ui/public/r/theme-soft-pastel.json delete mode 100644 packages/ghost-ui/public/r/theme-warm-sand.json delete mode 100644 packages/ghost-ui/public/r/toggle-group.json delete mode 100644 packages/ghost-ui/public/r/toggle.json delete mode 100644 packages/ghost-ui/public/r/tool.json delete mode 100644 packages/ghost-ui/public/r/toolbar.json delete mode 100644 packages/ghost-ui/public/r/tooltip.json delete mode 100644 packages/ghost-ui/public/r/transcription.json delete mode 100644 packages/ghost-ui/public/r/utils.json delete mode 100644 packages/ghost-ui/public/r/voice-selector.json delete mode 100644 packages/ghost-ui/public/r/web-preview.json diff --git a/.gitignore b/.gitignore index e021c5b..45c49be 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist *.tsbuildinfo .DS_Store .claude/settings.local.json +packages/ghost-ui/public/r/ diff --git a/packages/ghost-core/src/scanners/visual-harness.ts b/packages/ghost-core/src/scanners/visual-harness.ts index 4d7a199..45f1955 100644 --- a/packages/ghost-core/src/scanners/visual-harness.ts +++ b/packages/ghost-core/src/scanners/visual-harness.ts @@ -6,6 +6,7 @@ import type { RegistryItem, VisualScanConfig } from "../types.js"; // Dynamic import helper — bypasses TypeScript's compile-time module resolution // so optional peer dependencies don't cause build errors when not installed. +// biome-ignore lint/suspicious/noExplicitAny: dynamic imports return unknown module shapes async function optionalImport(id: string): Promise { return import(/* webpackIgnore: true */ id); } @@ -213,10 +214,13 @@ export default defineConfig({ }); // Dynamically import optional dependencies - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // biome-ignore lint/suspicious/noExplicitAny: dynamic imports with unknown module shapes let createServer: any; + // biome-ignore lint/suspicious/noExplicitAny: dynamic imports with unknown module shapes let chromium: any; + // biome-ignore lint/suspicious/noExplicitAny: dynamic imports with unknown module shapes let pixelmatch: any; + // biome-ignore lint/suspicious/noExplicitAny: dynamic imports with unknown module shapes let PNG: any; try { @@ -285,6 +289,7 @@ export default defineConfig({ timeout: config.timeout, }); await regPage + // biome-ignore lint/suspicious/noExplicitAny: browser context global .waitForFunction(() => (window as any).__GHOST_READY === true, { timeout: config.timeout, }) @@ -298,6 +303,7 @@ export default defineConfig({ timeout: config.timeout, }); await conPage + // biome-ignore lint/suspicious/noExplicitAny: browser context global .waitForFunction(() => (window as any).__GHOST_READY === true, { timeout: config.timeout, }) @@ -420,6 +426,7 @@ root.render(); `; } +// biome-ignore lint/suspicious/noExplicitAny: dynamically imported PNG constructor function resizePng(PNG: any, img: any, width: number, height: number): any { if (img.width === width && img.height === height) return img; @@ -432,10 +439,10 @@ function resizePng(PNG: any, img: any, width: number, height: number): any { for (let x = 0; x < img.width; x++) { const srcIdx = (y * img.width + x) * 4; const dstIdx = (y * width + x) * 4; - resized.data[dstIdx] = img.data[srcIdx]!; - resized.data[dstIdx + 1] = img.data[srcIdx + 1]!; - resized.data[dstIdx + 2] = img.data[srcIdx + 2]!; - resized.data[dstIdx + 3] = img.data[srcIdx + 3]!; + resized.data[dstIdx] = img.data[srcIdx]; + resized.data[dstIdx + 1] = img.data[srcIdx + 1]; + resized.data[dstIdx + 2] = img.data[srcIdx + 2]; + resized.data[dstIdx + 3] = img.data[srcIdx + 3]; } } diff --git a/packages/ghost-ui/public/r/accordion.json b/packages/ghost-ui/public/r/accordion.json deleted file mode 100644 index b9337a2..0000000 --- a/packages/ghost-ui/public/r/accordion.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "accordion", - "dependencies": ["@radix-ui/react-accordion", "lucide-react"], - "registryDependencies": ["utils"], - "files": [ - { - "path": "src/components/ui/accordion.tsx", - "content": "\"use client\";\n\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDownIcon } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Accordion({\n ...props\n}: React.ComponentProps) {\n return ;\n}\n\nfunction AccordionItem({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AccordionTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n \n svg]:rotate-180\",\n className,\n )}\n {...props}\n >\n {children}\n \n \n \n );\n}\n\nfunction AccordionContent({\n className,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n \n
{children}
\n \n );\n}\n\nexport { Accordion, AccordionContent, AccordionItem, AccordionTrigger };\n", - "type": "registry:ui", - "target": "components/ui/accordion.tsx" - } - ], - "categories": ["layout"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/agent.json b/packages/ghost-ui/public/r/agent.json deleted file mode 100644 index 87986b6..0000000 --- a/packages/ghost-ui/public/r/agent.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "agent", - "dependencies": ["ai", "lucide-react"], - "registryDependencies": ["utils", "accordion", "badge"], - "files": [ - { - "path": "src/components/ai-elements/agent.tsx", - "content": "\"use client\";\n\nimport type { Tool } from \"ai\";\nimport { BotIcon } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { memo } from \"react\";\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"@/components/ui/accordion\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/lib/utils\";\n\nimport { CodeBlock } from \"./code-block\";\n\nexport type AgentProps = ComponentProps<\"div\">;\n\nexport const Agent = memo(({ className, ...props }: AgentProps) => (\n \n));\n\nexport type AgentHeaderProps = ComponentProps<\"div\"> & {\n name: string;\n model?: string;\n};\n\nexport const AgentHeader = memo(\n ({ className, name, model, ...props }: AgentHeaderProps) => (\n \n
\n \n {name}\n {model && (\n \n {model}\n \n )}\n
\n \n ),\n);\n\nexport type AgentContentProps = ComponentProps<\"div\">;\n\nexport const AgentContent = memo(\n ({ className, ...props }: AgentContentProps) => (\n
\n ),\n);\n\nexport type AgentInstructionsProps = ComponentProps<\"div\"> & {\n children: string;\n};\n\nexport const AgentInstructions = memo(\n ({ className, children, ...props }: AgentInstructionsProps) => (\n
\n \n Instructions\n \n
\n

{children}

\n
\n
\n ),\n);\n\nexport type AgentToolsProps = ComponentProps;\n\nexport const AgentTools = memo(({ className, ...props }: AgentToolsProps) => (\n
\n Tools\n \n
\n));\n\nexport type AgentToolProps = ComponentProps & {\n tool: Tool;\n};\n\nexport const AgentTool = memo(\n ({ className, tool, value, ...props }: AgentToolProps) => {\n const schema =\n \"jsonSchema\" in tool && tool.jsonSchema\n ? tool.jsonSchema\n : tool.inputSchema;\n\n return (\n \n \n {tool.description ?? \"No description\"}\n \n \n
\n \n
\n
\n \n );\n },\n);\n\nexport type AgentOutputProps = ComponentProps<\"div\"> & {\n schema: string;\n};\n\nexport const AgentOutput = memo(\n ({ className, schema, ...props }: AgentOutputProps) => (\n
\n \n Output Schema\n \n
\n \n
\n
\n ),\n);\n\nAgent.displayName = \"Agent\";\nAgentHeader.displayName = \"AgentHeader\";\nAgentContent.displayName = \"AgentContent\";\nAgentInstructions.displayName = \"AgentInstructions\";\nAgentTools.displayName = \"AgentTools\";\nAgentTool.displayName = \"AgentTool\";\nAgentOutput.displayName = \"AgentOutput\";\n", - "type": "registry:ui", - "target": "components/ai-elements/agent.tsx" - } - ], - "categories": ["ai", "display"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/alert-dialog.json b/packages/ghost-ui/public/r/alert-dialog.json deleted file mode 100644 index 3497075..0000000 --- a/packages/ghost-ui/public/r/alert-dialog.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "alert-dialog", - "dependencies": ["@radix-ui/react-alert-dialog"], - "registryDependencies": ["utils", "button"], - "files": [ - { - "path": "src/components/ui/alert-dialog.tsx", - "content": "\"use client\";\n\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport type * as React from \"react\";\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nfunction AlertDialog({\n ...props\n}: React.ComponentProps) {\n return ;\n}\n\nfunction AlertDialogTrigger({\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AlertDialogPortal({\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AlertDialogContent({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n \n );\n}\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n );\n}\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n );\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AlertDialogAction({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AlertDialogCancel({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n};\n", - "type": "registry:ui", - "target": "components/ui/alert-dialog.tsx" - } - ], - "categories": ["feedback"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/alert.json b/packages/ghost-ui/public/r/alert.json deleted file mode 100644 index 0b638c3..0000000 --- a/packages/ghost-ui/public/r/alert.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "alert", - "dependencies": ["class-variance-authority"], - "registryDependencies": ["utils"], - "files": [ - { - "path": "src/components/ui/alert.tsx", - "content": "import { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current\",\n {\n variants: {\n variant: {\n default: \"bg-background text-text\",\n destructive:\n \"text-destructive bg-background [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps) {\n return (\n \n );\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n );\n}\n\nfunction AlertDescription({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n );\n}\n\nexport { Alert, AlertDescription, AlertTitle };\n", - "type": "registry:ui", - "target": "components/ui/alert.tsx" - } - ], - "categories": ["feedback"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/artifact.json b/packages/ghost-ui/public/r/artifact.json deleted file mode 100644 index 6d0b4e8..0000000 --- a/packages/ghost-ui/public/r/artifact.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "artifact", - "dependencies": ["lucide-react"], - "registryDependencies": ["utils", "button", "tooltip"], - "files": [ - { - "path": "src/components/ai-elements/artifact.tsx", - "content": "\"use client\";\n\nimport type { LucideIcon } from \"lucide-react\";\nimport { XIcon } from \"lucide-react\";\nimport type { ComponentProps, HTMLAttributes } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ArtifactProps = HTMLAttributes;\n\nexport const Artifact = ({ className, ...props }: ArtifactProps) => (\n \n);\n\nexport type ArtifactHeaderProps = HTMLAttributes;\n\nexport const ArtifactHeader = ({\n className,\n ...props\n}: ArtifactHeaderProps) => (\n \n);\n\nexport type ArtifactCloseProps = ComponentProps;\n\nexport const ArtifactClose = ({\n className,\n children,\n size = \"sm\",\n variant = \"ghost\",\n ...props\n}: ArtifactCloseProps) => (\n \n {children ?? }\n Close\n \n);\n\nexport type ArtifactTitleProps = HTMLAttributes;\n\nexport const ArtifactTitle = ({ className, ...props }: ArtifactTitleProps) => (\n \n);\n\nexport type ArtifactDescriptionProps = HTMLAttributes;\n\nexport const ArtifactDescription = ({\n className,\n ...props\n}: ArtifactDescriptionProps) => (\n

\n);\n\nexport type ArtifactActionsProps = HTMLAttributes;\n\nexport const ArtifactActions = ({\n className,\n ...props\n}: ArtifactActionsProps) => (\n

\n);\n\nexport type ArtifactActionProps = ComponentProps & {\n tooltip?: string;\n label?: string;\n icon?: LucideIcon;\n};\n\nexport const ArtifactAction = ({\n tooltip,\n label,\n icon: Icon,\n children,\n className,\n size = \"sm\",\n variant = \"ghost\",\n ...props\n}: ArtifactActionProps) => {\n const button = (\n \n {Icon ? : children}\n {label || tooltip}\n \n );\n\n if (tooltip) {\n return (\n \n \n {button}\n \n

{tooltip}

\n
\n
\n
\n );\n }\n\n return button;\n};\n\nexport type ArtifactContentProps = HTMLAttributes;\n\nexport const ArtifactContent = ({\n className,\n ...props\n}: ArtifactContentProps) => (\n
\n);\n", - "type": "registry:ui", - "target": "components/ai-elements/artifact.tsx" - } - ], - "categories": ["ai", "display"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/aspect-ratio.json b/packages/ghost-ui/public/r/aspect-ratio.json deleted file mode 100644 index 21df4d3..0000000 --- a/packages/ghost-ui/public/r/aspect-ratio.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "aspect-ratio", - "dependencies": ["@radix-ui/react-aspect-ratio"], - "files": [ - { - "path": "src/components/ui/aspect-ratio.tsx", - "content": "\"use client\";\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\n\nfunction AspectRatio({\n ...props\n}: React.ComponentProps) {\n return ;\n}\n\nexport { AspectRatio };\n", - "type": "registry:ui", - "target": "components/ui/aspect-ratio.tsx" - } - ], - "categories": ["layout"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/attachments.json b/packages/ghost-ui/public/r/attachments.json deleted file mode 100644 index e8d1ef9..0000000 --- a/packages/ghost-ui/public/r/attachments.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "attachments", - "dependencies": ["ai", "lucide-react"], - "registryDependencies": ["utils", "button", "hover-card"], - "files": [ - { - "path": "src/components/ai-elements/attachments.tsx", - "content": "\"use client\";\n\nimport type { FileUIPart, SourceDocumentUIPart } from \"ai\";\nimport {\n FileTextIcon,\n GlobeIcon,\n ImageIcon,\n Music2Icon,\n PaperclipIcon,\n VideoIcon,\n XIcon,\n} from \"lucide-react\";\nimport type { ComponentProps, HTMLAttributes, ReactNode } from \"react\";\nimport { createContext, useCallback, useContext, useMemo } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"@/components/ui/hover-card\";\nimport { cn } from \"@/lib/utils\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type AttachmentData =\n | (FileUIPart & { id: string })\n | (SourceDocumentUIPart & { id: string });\n\nexport type AttachmentMediaCategory =\n | \"image\"\n | \"video\"\n | \"audio\"\n | \"document\"\n | \"source\"\n | \"unknown\";\n\nexport type AttachmentVariant = \"grid\" | \"inline\" | \"list\";\n\nconst mediaCategoryIcons: Record = {\n audio: Music2Icon,\n document: FileTextIcon,\n image: ImageIcon,\n source: GlobeIcon,\n unknown: PaperclipIcon,\n video: VideoIcon,\n};\n\n// ============================================================================\n// Utility Functions\n// ============================================================================\n\nexport const getMediaCategory = (\n data: AttachmentData,\n): AttachmentMediaCategory => {\n if (data.type === \"source-document\") {\n return \"source\";\n }\n\n const mediaType = data.mediaType ?? \"\";\n\n if (mediaType.startsWith(\"image/\")) {\n return \"image\";\n }\n if (mediaType.startsWith(\"video/\")) {\n return \"video\";\n }\n if (mediaType.startsWith(\"audio/\")) {\n return \"audio\";\n }\n if (mediaType.startsWith(\"application/\") || mediaType.startsWith(\"text/\")) {\n return \"document\";\n }\n\n return \"unknown\";\n};\n\nexport const getAttachmentLabel = (data: AttachmentData): string => {\n if (data.type === \"source-document\") {\n return data.title || data.filename || \"Source\";\n }\n\n const category = getMediaCategory(data);\n return data.filename || (category === \"image\" ? \"Image\" : \"Attachment\");\n};\n\nconst renderAttachmentImage = (\n url: string,\n filename: string | undefined,\n isGrid: boolean,\n) =>\n isGrid ? (\n \n ) : (\n \n );\n\n// ============================================================================\n// Contexts\n// ============================================================================\n\ninterface AttachmentsContextValue {\n variant: AttachmentVariant;\n}\n\nconst AttachmentsContext = createContext(null);\n\ninterface AttachmentContextValue {\n data: AttachmentData;\n mediaCategory: AttachmentMediaCategory;\n onRemove?: () => void;\n variant: AttachmentVariant;\n}\n\nconst AttachmentContext = createContext(null);\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nexport const useAttachmentsContext = () =>\n useContext(AttachmentsContext) ?? { variant: \"grid\" as const };\n\nexport const useAttachmentContext = () => {\n const ctx = useContext(AttachmentContext);\n if (!ctx) {\n throw new Error(\"Attachment components must be used within \");\n }\n return ctx;\n};\n\n// ============================================================================\n// Attachments - Container\n// ============================================================================\n\nexport type AttachmentsProps = HTMLAttributes & {\n variant?: AttachmentVariant;\n};\n\nexport const Attachments = ({\n variant = \"grid\",\n className,\n children,\n ...props\n}: AttachmentsProps) => {\n const contextValue = useMemo(() => ({ variant }), [variant]);\n\n return (\n \n \n {children}\n
\n \n );\n};\n\n// ============================================================================\n// Attachment - Item\n// ============================================================================\n\nexport type AttachmentProps = HTMLAttributes & {\n data: AttachmentData;\n onRemove?: () => void;\n};\n\nexport const Attachment = ({\n data,\n onRemove,\n className,\n children,\n ...props\n}: AttachmentProps) => {\n const { variant } = useAttachmentsContext();\n const mediaCategory = getMediaCategory(data);\n\n const contextValue = useMemo(\n () => ({ data, mediaCategory, onRemove, variant }),\n [data, mediaCategory, onRemove, variant],\n );\n\n return (\n \n \n {children}\n
\n \n );\n};\n\n// ============================================================================\n// AttachmentPreview - Media preview\n// ============================================================================\n\nexport type AttachmentPreviewProps = HTMLAttributes & {\n fallbackIcon?: ReactNode;\n};\n\nexport const AttachmentPreview = ({\n fallbackIcon,\n className,\n ...props\n}: AttachmentPreviewProps) => {\n const { data, mediaCategory, variant } = useAttachmentContext();\n\n const iconSize = variant === \"inline\" ? \"size-3\" : \"size-4\";\n\n const renderIcon = (Icon: typeof ImageIcon) => (\n \n );\n\n const renderContent = () => {\n if (mediaCategory === \"image\" && data.type === \"file\" && data.url) {\n return renderAttachmentImage(data.url, data.filename, variant === \"grid\");\n }\n\n if (mediaCategory === \"video\" && data.type === \"file\" && data.url) {\n return
\n );\n};\n\n// ============================================================================\n// AttachmentInfo - Name and type display\n// ============================================================================\n\nexport type AttachmentInfoProps = HTMLAttributes & {\n showMediaType?: boolean;\n};\n\nexport const AttachmentInfo = ({\n showMediaType = false,\n className,\n ...props\n}: AttachmentInfoProps) => {\n const { data, variant } = useAttachmentContext();\n const label = getAttachmentLabel(data);\n\n if (variant === \"grid\") {\n return null;\n }\n\n return (\n
\n {label}\n {showMediaType && data.mediaType && (\n \n {data.mediaType}\n \n )}\n
\n );\n};\n\n// ============================================================================\n// AttachmentRemove - Remove button\n// ============================================================================\n\nexport type AttachmentRemoveProps = ComponentProps & {\n label?: string;\n};\n\nexport const AttachmentRemove = ({\n label = \"Remove\",\n className,\n children,\n ...props\n}: AttachmentRemoveProps) => {\n const { onRemove, variant } = useAttachmentContext();\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n onRemove?.();\n },\n [onRemove],\n );\n\n if (!onRemove) {\n return null;\n }\n\n return (\n svg]:size-3\",\n ],\n variant === \"inline\" && [\n \"size-5 rounded p-0\",\n \"opacity-0 transition-opacity group-hover:opacity-100\",\n \"[&>svg]:size-2.5\",\n ],\n variant === \"list\" && [\"size-8 shrink-0 rounded p-0\", \"[&>svg]:size-4\"],\n className,\n )}\n onClick={handleClick}\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? }\n {label}\n \n );\n};\n\n// ============================================================================\n// AttachmentHoverCard - Hover preview\n// ============================================================================\n\nexport type AttachmentHoverCardProps = ComponentProps;\n\nexport const AttachmentHoverCard = ({\n openDelay = 0,\n closeDelay = 0,\n ...props\n}: AttachmentHoverCardProps) => (\n \n);\n\nexport type AttachmentHoverCardTriggerProps = ComponentProps<\n typeof HoverCardTrigger\n>;\n\nexport const AttachmentHoverCardTrigger = (\n props: AttachmentHoverCardTriggerProps,\n) => ;\n\nexport type AttachmentHoverCardContentProps = ComponentProps<\n typeof HoverCardContent\n>;\n\nexport const AttachmentHoverCardContent = ({\n align = \"start\",\n className,\n ...props\n}: AttachmentHoverCardContentProps) => (\n \n);\n\n// ============================================================================\n// AttachmentEmpty - Empty state\n// ============================================================================\n\nexport type AttachmentEmptyProps = HTMLAttributes;\n\nexport const AttachmentEmpty = ({\n className,\n children,\n ...props\n}: AttachmentEmptyProps) => (\n \n {children ?? \"No attachments\"}\n \n);\n", - "type": "registry:ui", - "target": "components/ai-elements/attachments.tsx" - } - ], - "categories": ["ai", "input", "chat"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/audio-player.json b/packages/ghost-ui/public/r/audio-player.json deleted file mode 100644 index f9b7095..0000000 --- a/packages/ghost-ui/public/r/audio-player.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "audio-player", - "dependencies": ["ai", "media-chrome"], - "registryDependencies": ["utils", "button", "button-group"], - "files": [ - { - "path": "src/components/ai-elements/audio-player.tsx", - "content": "\"use client\";\n\nimport type { Experimental_SpeechResult as SpeechResult } from \"ai\";\nimport {\n MediaControlBar,\n MediaController,\n MediaDurationDisplay,\n MediaMuteButton,\n MediaPlayButton,\n MediaSeekBackwardButton,\n MediaSeekForwardButton,\n MediaTimeDisplay,\n MediaTimeRange,\n MediaVolumeRange,\n} from \"media-chrome/react\";\nimport type { ComponentProps, CSSProperties } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { ButtonGroup, ButtonGroupText } from \"@/components/ui/button-group\";\nimport { cn } from \"@/lib/utils\";\n\nexport type AudioPlayerProps = Omit<\n ComponentProps,\n \"audio\"\n>;\n\nexport const AudioPlayer = ({\n children,\n style,\n ...props\n}: AudioPlayerProps) => (\n \n {children}\n \n);\n\nexport type AudioPlayerElementProps = Omit, \"src\"> &\n (\n | {\n data: SpeechResult[\"audio\"];\n }\n | {\n src: string;\n }\n );\n\nexport const AudioPlayerElement = ({ ...props }: AudioPlayerElementProps) => (\n // oxlint-disable-next-line eslint-plugin-jsx-a11y(media-has-caption) -- audio player captions are provided by consumer\n \n);\n\nexport type AudioPlayerControlBarProps = ComponentProps;\n\nexport const AudioPlayerControlBar = ({\n children,\n ...props\n}: AudioPlayerControlBarProps) => (\n \n {children}\n \n);\n\nexport type AudioPlayerPlayButtonProps = ComponentProps;\n\nexport const AudioPlayerPlayButton = ({\n className,\n ...props\n}: AudioPlayerPlayButtonProps) => (\n \n);\n\nexport type AudioPlayerSeekBackwardButtonProps = ComponentProps<\n typeof MediaSeekBackwardButton\n>;\n\nexport const AudioPlayerSeekBackwardButton = ({\n seekOffset = 10,\n ...props\n}: AudioPlayerSeekBackwardButtonProps) => (\n \n);\n\nexport type AudioPlayerSeekForwardButtonProps = ComponentProps<\n typeof MediaSeekForwardButton\n>;\n\nexport const AudioPlayerSeekForwardButton = ({\n seekOffset = 10,\n ...props\n}: AudioPlayerSeekForwardButtonProps) => (\n \n);\n\nexport type AudioPlayerTimeDisplayProps = ComponentProps<\n typeof MediaTimeDisplay\n>;\n\nexport const AudioPlayerTimeDisplay = ({\n className,\n ...props\n}: AudioPlayerTimeDisplayProps) => (\n \n \n \n);\n\nexport type AudioPlayerTimeRangeProps = ComponentProps;\n\nexport const AudioPlayerTimeRange = ({\n className,\n ...props\n}: AudioPlayerTimeRangeProps) => (\n \n \n \n);\n\nexport type AudioPlayerDurationDisplayProps = ComponentProps<\n typeof MediaDurationDisplay\n>;\n\nexport const AudioPlayerDurationDisplay = ({\n className,\n ...props\n}: AudioPlayerDurationDisplayProps) => (\n \n \n \n);\n\nexport type AudioPlayerMuteButtonProps = ComponentProps;\n\nexport const AudioPlayerMuteButton = ({\n className,\n ...props\n}: AudioPlayerMuteButtonProps) => (\n \n \n \n);\n\nexport type AudioPlayerVolumeRangeProps = ComponentProps<\n typeof MediaVolumeRange\n>;\n\nexport const AudioPlayerVolumeRange = ({\n className,\n ...props\n}: AudioPlayerVolumeRangeProps) => (\n \n \n \n);\n", - "type": "registry:ui", - "target": "components/ai-elements/audio-player.tsx" - } - ], - "categories": ["ai", "media"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/avatar.json b/packages/ghost-ui/public/r/avatar.json deleted file mode 100644 index 5f5a437..0000000 --- a/packages/ghost-ui/public/r/avatar.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "avatar", - "dependencies": ["@radix-ui/react-avatar"], - "registryDependencies": ["utils"], - "files": [ - { - "path": "src/components/ui/avatar.tsx", - "content": "\"use client\";\n\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nexport { Avatar, AvatarFallback, AvatarImage };\n", - "type": "registry:ui", - "target": "components/ui/avatar.tsx" - } - ], - "categories": ["display"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/badge.json b/packages/ghost-ui/public/r/badge.json deleted file mode 100644 index a00865f..0000000 --- a/packages/ghost-ui/public/r/badge.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "badge", - "dependencies": ["@radix-ui/react-slot", "class-variance-authority"], - "registryDependencies": ["utils"], - "files": [ - { - "path": "src/components/ui/badge.tsx", - "content": "import { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-pill border px-2 py-0.5 text-xs w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[1px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-muted text-foreground [a&]:hover:bg-muted/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"text-foreground [a&]:hover:bg-muted [a&]:hover:text-muted-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\";\n\n return (\n \n );\n}\n\nexport { Badge, badgeVariants };\n", - "type": "registry:ui", - "target": "components/ui/badge.tsx" - } - ], - "categories": ["display"], - "type": "registry:ui" -} diff --git a/packages/ghost-ui/public/r/breadcrumb.json b/packages/ghost-ui/public/r/breadcrumb.json deleted file mode 100644 index 053b770..0000000 --- a/packages/ghost-ui/public/r/breadcrumb.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema/registry-item.json", - "name": "breadcrumb", - "dependencies": ["@radix-ui/react-slot", "lucide-react"], - "registryDependencies": ["utils"], - "files": [ - { - "path": "src/components/ui/breadcrumb.tsx", - "content": "import { Slot } from \"@radix-ui/react-slot\";\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Breadcrumb({ ...props }: React.ComponentProps<\"nav\">) {\n return