{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "image-zoom",
  "title": "Image Zoom",
  "description": "A thumbnail that opens its full-size source in a dialog, with a caption and the focus behaviour a dialog owes its trigger.",
  "dependencies": [
    "cn",
    "lucide-react"
  ],
  "registryDependencies": [
    "litingyes/blocove/image",
    "dialog"
  ],
  "files": [
    {
      "path": "src/registry/blocove/ui/image/zoom.tsx",
      "content": "import type { ReactNode } from 'react'\nimport type { ImageTransform } from '@/components/blocove/image/image'\nimport { cn } from 'cn'\nimport { Maximize2Icon } from 'lucide-react'\nimport { Image } from '@/components/blocove/image/image'\nimport {\n  Dialog,\n  DialogContent,\n  DialogTitle,\n  DialogTrigger,\n} from '@/components/ui/dialog'\n\nexport interface ImageZoomProps {\n  /** The full-size source opened in the dialog. */\n  src: string\n  /** Alternative text, also used as the dialog title. */\n  alt: string\n  /** The smaller source shown in the trigger; defaults to `src`. */\n  thumbnailSrc?: string\n  /** Caption rendered under the large image. */\n  caption?: ReactNode\n  /** Aspect ratio of the trigger image. */\n  aspectRatio?: number | string\n  /** Intrinsic width of the trigger image. */\n  width?: number\n  /** Intrinsic height of the trigger image. */\n  height?: number\n  /** Whether both the trigger and the dialog image are priority images. */\n  priority?: boolean\n  /** Layout sizes for the large image. */\n  sizes?: string\n  /** Widths the large image requests, for example for a CDN transform. */\n  widths?: readonly number[]\n  /** Turns a source and a width into the URL that serves it. */\n  transform?: ImageTransform\n  /** A CSS color or image URL drawn behind the trigger image while it loads. */\n  placeholder?: string\n  /** Accessible name of the trigger button. */\n  zoomLabel?: string\n  /** Extra classes for the trigger button. */\n  triggerClassName?: string\n  /** Extra classes for the dialog panel. */\n  className?: string\n}\n\n/**\n * A thumbnail that opens its full-size source in a dialog. The dialog handles\n * Escape, the focus trap and returning focus to the trigger, so the item only\n * owns the composition.\n */\nexport function ImageZoom({\n  src,\n  alt,\n  thumbnailSrc,\n  caption,\n  aspectRatio,\n  width,\n  height,\n  priority = false,\n  sizes,\n  widths,\n  transform,\n  placeholder,\n  zoomLabel,\n  triggerClassName,\n  className,\n}: ImageZoomProps) {\n  return (\n    <Dialog>\n      <DialogTrigger\n        data-slot=\"image-zoom\"\n        aria-label={zoomLabel ?? `Zoom image: ${alt}`}\n        className={cn(\n          'group relative block w-full overflow-hidden rounded-lg border bg-muted/30 text-left outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50',\n          triggerClassName,\n        )}\n      >\n        <Image\n          alt={alt}\n          aspectRatio={aspectRatio}\n          height={height}\n          placeholder={placeholder}\n          priority={priority}\n          sizes={sizes}\n          src={thumbnailSrc ?? src}\n          transform={transform}\n          widths={widths}\n          width={width}\n          className=\"transition-transform duration-300 group-hover:scale-[1.02] motion-reduce:transition-none motion-reduce:group-hover:scale-100\"\n        />\n        <span className=\"pointer-events-none absolute right-2 bottom-2 z-20 inline-flex items-center gap-1 rounded-md bg-background/85 px-2 py-1 text-xs font-medium text-foreground shadow-sm backdrop-blur-sm\">\n          <Maximize2Icon className=\"size-3.5\" />\n          Zoom\n        </span>\n      </DialogTrigger>\n\n      <DialogContent\n        className={cn('max-w-4xl gap-2 p-2 sm:max-w-4xl', className)}\n        showCloseButton\n      >\n        <DialogTitle className=\"sr-only\">{alt}</DialogTitle>\n        <Image\n          alt={alt}\n          priority={priority}\n          sizes={sizes ?? '100vw'}\n          src={src}\n          transform={transform}\n          widths={widths}\n          className=\"h-auto max-h-[80vh] w-full rounded-md bg-muted/30\"\n          objectFit=\"contain\"\n        />\n        {caption\n          ? (\n              <p className=\"px-2 pb-1 text-sm text-muted-foreground\">\n                {caption}\n              </p>\n            )\n          : null}\n      </DialogContent>\n    </Dialog>\n  )\n}\n",
      "type": "registry:ui",
      "target": "components/blocove/image/zoom.tsx"
    }
  ],
  "categories": [
    "image"
  ],
  "type": "registry:ui"
}