{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "artifact-preview",
  "type": "registry:ui",
  "title": "Artifact preview",
  "description": "Framed preview for AI generated artifacts such as code, documents or UI, with a title bar, copy button and optional expand action for a full view.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "https://ui.minidev.pro/r/copy-button.json",
    "https://ui.minidev.pro/r/icon-button.json",
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/artifact-preview.tsx",
      "type": "registry:ui",
      "target": "components/ui/artifact-preview.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { IconButton } from \"@/components/ui/icon-button\"\nimport { CopyButton } from \"@/components/ui/copy-button\"\nimport { Maximize2Icon } from \"lucide-react\"\n\nfunction ArtifactPreview({\n  title,\n  children,\n  className,\n  copyValue,\n  onExpand,\n}: {\n  title: string\n  children: React.ReactNode\n  className?: string\n  copyValue?: string\n  onExpand?: () => void\n}) {\n  return (\n    <div\n      data-slot=\"artifact-preview\"\n      className={cn(\n        \"overflow-hidden rounded-xl border border-border bg-surface shadow-highlight\",\n        className\n      )}\n    >\n      <div className=\"flex items-center justify-between gap-2 border-b border-border bg-sunken px-3 py-2\">\n        <p className=\"truncate text-xs font-medium text-fg-muted\">{title}</p>\n        <div className=\"flex items-center gap-1\">\n          {copyValue ? <CopyButton value={copyValue} size=\"sm\" /> : null}\n          {onExpand ? (\n            <IconButton type=\"button\" size=\"icon-sm\" variant=\"ghost\" aria-label=\"Expand artifact\" onClick={onExpand}>\n              <Maximize2Icon />\n            </IconButton>\n          ) : null}\n        </div>\n      </div>\n      <div className=\"p-3\">{children}</div>\n    </div>\n  )\n}\nexport { ArtifactPreview }\n"
    }
  ]
}
