{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "image-figure",
  "title": "Image Figure",
  "description": "An image with an editorial caption and credit, keeping the reserved space and responsive behaviour of the Image component.",
  "dependencies": [
    "cn"
  ],
  "registryDependencies": [
    "litingyes/blocove/image"
  ],
  "files": [
    {
      "path": "src/registry/blocove/ui/image/figure.tsx",
      "content": "import type { ReactNode } from 'react'\nimport type { ImageProps } from '@/components/blocove/image/image'\nimport { cn } from 'cn'\nimport { Image } from '@/components/blocove/image/image'\n\nexport interface ImageFigureProps extends Omit<ImageProps, 'className' | 'containerClassName'> {\n  /** Classes for the figure. */\n  className?: string\n  /** Classes for the image itself. */\n  imageClassName?: string\n  /** The caption rendered under the image. */\n  caption?: ReactNode\n  /** The attribution rendered opposite the caption. */\n  credit?: ReactNode\n}\n\n/**\n * An image with an editorial caption. The figure keeps the caption and the\n * credit on one baseline, and the image keeps every `Image` behaviour: reserved\n * space, srcset, focal point, placeholder and fallback.\n */\nexport function ImageFigure({\n  className,\n  imageClassName,\n  caption,\n  credit,\n  ...imageProps\n}: ImageFigureProps) {\n  return (\n    <figure\n      data-slot=\"image-figure\"\n      className={cn('flex w-full flex-col gap-2', className)}\n    >\n      <Image {...imageProps} className={imageClassName} />\n\n      {caption || credit\n        ? (\n            <figcaption className=\"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 text-xs text-muted-foreground\">\n              {caption\n                ? <span>{caption}</span>\n                : <span />}\n              {credit\n                ? <span className=\"text-muted-foreground/80\">{credit}</span>\n                : null}\n            </figcaption>\n          )\n        : null}\n    </figure>\n  )\n}\n",
      "type": "registry:ui",
      "target": "components/blocove/image/figure.tsx"
    }
  ],
  "categories": [
    "image"
  ],
  "type": "registry:ui"
}