{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-source-citation",
  "type": "registry:component",
  "title": "AI Source Citation",
  "description": "Compact source reference card for AI answers with a title, origin label, and optional excerpt.",
  "dependencies": [
    "@vllnt/ui@^0.2.1",
    "lucide-react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/ai-source-citation/ai-source-citation.tsx",
      "content": "import { forwardRef } from \"react\";\n\nimport { ExternalLink, Quote } from \"lucide-react\";\n\nimport { cn } from \"@vllnt/ui\";\n\nexport type AISourceCitationProps = React.ComponentPropsWithoutRef<\"a\"> & {\n  /** Optional short excerpt from the cited source. */\n  snippet?: string;\n  /** Source label such as domain, document, or collection. */\n  source: string;\n  /** Primary citation title. */\n  title: string;\n};\n\nconst AISourceCitation = forwardRef<HTMLAnchorElement, AISourceCitationProps>(\n  (\n    { className, href, snippet, source, target = \"_blank\", title, ...props },\n    ref,\n  ) => {\n    return (\n      <a\n        className={cn(\n          \"group inline-flex max-w-full flex-col gap-2 rounded-xl border border-border/70 bg-background px-3 py-2 text-left shadow-sm transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n          className,\n        )}\n        href={href}\n        ref={ref}\n        rel={target === \"_blank\" ? \"noreferrer\" : undefined}\n        target={target}\n        {...props}\n      >\n        <div className=\"flex items-start gap-2\">\n          <Quote className=\"mt-0.5 size-4 shrink-0 text-muted-foreground\" />\n          <div className=\"min-w-0 flex-1\">\n            <div className=\"flex items-start justify-between gap-3\">\n              <div className=\"min-w-0\">\n                <p className=\"truncate text-sm font-medium text-foreground\">\n                  {title}\n                </p>\n                <p className=\"text-xs text-muted-foreground\">{source}</p>\n              </div>\n              <ExternalLink className=\"size-4 shrink-0 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5\" />\n            </div>\n          </div>\n        </div>\n\n        {snippet ? (\n          <p className=\"line-clamp-3 text-sm leading-6 text-muted-foreground\">\n            {snippet}\n          </p>\n        ) : null}\n      </a>\n    );\n  },\n);\n\nAISourceCitation.displayName = \"AISourceCitation\";\n\nexport { AISourceCitation };\n",
      "type": "registry:component"
    }
  ],
  "version": "0.2.1",
  "stability": "stable"
}
