{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "inline-citation",
  "title": "Inline Citation",
  "description": "A numbered reference inside prose with an inspectable source preview.",
  "dependencies": [
    "@solar-icons/react@^2.2.0",
    "cn@^0.3.0"
  ],
  "registryDependencies": [
    "button",
    "https://pastaui.com/r/pastaui-styles.json"
  ],
  "files": [
    {
      "path": "src/components/ai/inline-citation.tsx",
      "content": "import { ExportIcon as ExternalLinkIcon } from '@solar-icons/react/linear/export'\nimport * as React from 'react'\n\nimport { Button } from '@/components/ui/button'\nimport { cn } from 'cn'\n\ninterface InlineCitationProps extends React.ComponentProps<'span'> {\n  excerpt?: string\n  index: number\n  onOpenChange?: (open: boolean) => void\n  onOpenSource?: () => void\n  open?: boolean\n  source: string\n  title: string\n}\n\nfunction InlineCitation({\n  className,\n  excerpt,\n  index,\n  onOpenChange,\n  onOpenSource,\n  open = false,\n  source,\n  title,\n  ...props\n}: InlineCitationProps) {\n  return (\n    <span\n      data-slot=\"inline-citation\"\n      className={cn(\n        'relative inline-flex font-sans text-sm font-[450] tracking-[-0.05px] text-muted-foreground',\n        className,\n      )}\n      {...props}\n    >\n      <button\n        aria-expanded={open}\n        className=\"inline-flex min-w-5 items-center justify-center rounded-md bg-muted px-1.5 py-0.5 align-super text-xs leading-4 font-[450] text-muted-foreground transition-colors outline-none hover:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\"\n        onClick={() => onOpenChange?.(!open)}\n        type=\"button\"\n      >\n        {index}\n      </button>\n      {open && (\n        <span className=\"absolute bottom-full left-1/2 z-20 mb-2 w-72 max-w-[calc(100vw-2rem)] origin-bottom -translate-x-1/2 rounded-[16px] bg-card p-4 text-muted-foreground shadow-card transition-[opacity,scale] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] starting:scale-95 starting:opacity-0 motion-reduce:starting:scale-100\">\n          <span className=\"block card-heading leading-5\">{title}</span>\n          <span className=\"mt-1 block text-xs leading-5 text-muted-foreground\">{source}</span>\n          {excerpt && (\n            <span className=\"mt-2 block text-xs leading-5 text-muted-foreground\">{excerpt}</span>\n          )}\n          <Button\n            className=\"mt-3 h-7 gap-2 rounded-full border-0 bg-primary bg-linear-to-b from-[color-mix(in_oklch,var(--primary),var(--primary-foreground)_30%)] to-primary px-3 text-sm font-[450] tracking-[-0.05px] text-primary-foreground shadow-[inset_0_1px_0_rgba(255,255,255,0.14),0_1px_2px_rgba(0,0,0,0.18)] shadow-none hover:brightness-110 dark:bg-none\"\n            onClick={onOpenSource}\n            size=\"sm\"\n            type=\"button\"\n            variant=\"default\"\n          >\n            Open source <ExternalLinkIcon data-icon=\"inline-end\" />\n          </Button>\n        </span>\n      )}\n    </span>\n  )\n}\n\nexport { InlineCitation }\nexport type { InlineCitationProps }\n",
      "type": "registry:component",
      "target": "@components/ai/inline-citation.tsx"
    }
  ],
  "type": "registry:component"
}