{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "image-showcase",
  "title": "Image Showcase",
  "description": "A product-style image viewer, a large main frame with prev/next arrows and an image counter, backed by a click-to-jump thumbnail strip and a reset-to-first button.",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/image-showcase/image-showcase.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface ImageShowcaseImage {\n  src: string;\n  alt?: string;\n}\n\nexport interface ImageShowcaseProps extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\"> {\n  images?: ImageShowcaseImage[];\n  height?: number;\n  thumbnailHeight?: number;\n  thumbnailGap?: number;\n  borderRadius?: number;\n  showCounter?: boolean;\n  showReset?: boolean;\n  accentColor?: string;\n}\n\nfunction ChevronIcon({ direction, color }: { direction: \"left\" | \"right\"; color: string }) {\n  return (\n    <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\" stroke={color} strokeWidth={2.5} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n      {direction === \"left\" ? <polyline points=\"15 18 9 12 15 6\" /> : <polyline points=\"9 18 15 12 9 6\" />}\n    </svg>\n  );\n}\n\nfunction ResetIcon({ color }: { color: string }) {\n  return (\n    <svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\" stroke={color} strokeWidth={2.5} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n      <polyline points=\"1 4 1 10 7 10\" />\n      <path d=\"M3.51 15a9 9 0 1 0 .49-4.95\" />\n    </svg>\n  );\n}\n\nexport function ImageShowcase({\n  images = [],\n  height = 700,\n  thumbnailHeight = 80,\n  thumbnailGap = 8,\n  borderRadius = 12,\n  showCounter = true,\n  showReset = true,\n  accentColor = \"#ffffff\",\n  className,\n  style,\n  ...props\n}: ImageShowcaseProps) {\n  const [current, setCurrent] = React.useState(0);\n  const total = images.length;\n\n  const prev = React.useCallback(() => setCurrent((c) => (c - 1 + total) % total), [total]);\n  const next = React.useCallback(() => setCurrent((c) => (c + 1) % total), [total]);\n  const reset = React.useCallback(() => setCurrent(0), []);\n\n  if (total === 0) {\n    return (\n      <div\n        className={cn(\"flex w-full items-center justify-center bg-[#1a1a1a] font-sans text-sm text-[#666]\", className)}\n        style={{ height: height + thumbnailHeight + thumbnailGap + 16, borderRadius, ...style }}\n        {...props}\n      >\n        No images connected\n      </div>\n    );\n  }\n\n  const mainImg = images[current];\n\n  return (\n    <div className={cn(\"flex w-full select-none flex-col\", className)} style={{ gap: thumbnailGap, ...style }} {...props}>\n      <div className=\"relative w-full shrink-0 overflow-hidden bg-[#111]\" style={{ height, borderRadius }}>\n        {mainImg?.src ? (\n          <img key={current} src={mainImg.src} alt={mainImg.alt ?? `Image ${current + 1}`} className=\"block h-full w-full object-cover transition-opacity duration-[250ms] ease-[ease]\" />\n        ) : (\n          <div className=\"flex h-full w-full items-center justify-center bg-[#222] font-sans text-sm text-[#555]\">No image</div>\n        )}\n\n        <button\n          onClick={prev}\n          aria-label=\"Previous image\"\n          className=\"absolute top-1/2 left-5 z-10 flex h-11 w-11 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-black/55 backdrop-blur-[6px] transition-colors duration-200 ease-[ease] hover:bg-black/75\"\n        >\n          <ChevronIcon direction=\"left\" color={accentColor} />\n        </button>\n        <button\n          onClick={next}\n          aria-label=\"Next image\"\n          className=\"absolute top-1/2 right-5 z-10 flex h-11 w-11 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-black/55 backdrop-blur-[6px] transition-colors duration-200 ease-[ease] hover:bg-black/75\"\n        >\n          <ChevronIcon direction=\"right\" color={accentColor} />\n        </button>\n\n        {showCounter && (\n          <div\n            className=\"absolute top-4 z-10 rounded-full bg-black/55 px-3 py-1 font-sans text-[13px] font-semibold tracking-[0.02em] backdrop-blur-[6px]\"\n            style={{ right: showReset ? 60 : 16, color: accentColor }}\n          >\n            {current + 1} / {total}\n          </div>\n        )}\n\n        {showReset && (\n          <button\n            onClick={reset}\n            title=\"Reset to first\"\n            aria-label=\"Reset to first image\"\n            className=\"absolute top-3 right-3.5 z-10 flex h-9 w-9 cursor-pointer items-center justify-center rounded-full bg-black/55 backdrop-blur-[6px]\"\n          >\n            <ResetIcon color={accentColor} />\n          </button>\n        )}\n      </div>\n\n      {total > 1 && (\n        <div className=\"flex overflow-x-auto pb-0.5 [scrollbar-width:none]\" style={{ gap: thumbnailGap }}>\n          {images.map((img, idx) => (\n            <div\n              key={idx}\n              onClick={() => setCurrent(idx)}\n              className=\"shrink-0 cursor-pointer overflow-hidden bg-[#111] transition-[border-color,opacity] duration-200 ease-[ease]\"\n              style={{\n                width: thumbnailHeight * 1.6,\n                height: thumbnailHeight,\n                borderRadius: borderRadius * 0.6,\n                border: idx === current ? `2.5px solid ${accentColor}` : \"2.5px solid transparent\",\n                opacity: idx === current ? 1 : 0.65,\n              }}\n            >\n              {img?.src ? (\n                <img src={img.src} alt={img.alt ?? `Thumb ${idx + 1}`} className=\"block h-full w-full object-cover\" />\n              ) : (\n                <div className=\"h-full w-full bg-[#333]\" />\n              )}\n            </div>\n          ))}\n        </div>\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}