{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "gallery-section-v1",
  "title": "Gallery Section v1",
  "description": "Ten side-by-side gallery panels with hover expansion, focus framing, and vertical indicator lines within a dedicated canvas area.",
  "dependencies": [],
  "registryDependencies": [
    "https://uiception.com/r/block-media.json"
  ],
  "files": [
    {
      "path": "registry/new-york/blocks/gallery-section-v1/page.tsx",
      "content": "import GallerySectionV1 from \"./components/gallery-section-v1\"\n\nexport default function Page() {\n  return <GallerySectionV1 />\n}\n",
      "type": "registry:page",
      "target": "app/gallery-section-v1/page.tsx"
    },
    {
      "path": "registry/new-york/blocks/gallery-section-v1/components/gallery-section-v1.tsx",
      "content": "import GalleryTrack from \"./gallery-track\"\nimport { createBlockImage } from \"@/lib/block-media\"\nimport { imageFiles, sectionMeta, type GalleryItem } from \"../lib/config\"\n\nconst blockImage = createBlockImage(\"gallery-section-v1\")\nconst galleryItems: GalleryItem[] = imageFiles.map(({ file, alt }, index) => ({\n  id: `panel-${index + 1}`,\n  label: `Panel ${index + 1}`,\n  alt,\n  imageSrc: blockImage(file),\n}))\n\nexport type GallerySectionV1Props = {\n  /** Pass `false` to render only the gallery canvas (no title or description). */\n  header?: { title: string; description?: string } | false\n  items?: GalleryItem[]\n}\n\nexport default function GallerySectionV1({\n  header = sectionMeta,\n  items = galleryItems,\n}: GallerySectionV1Props = {}) {\n  return (\n    <section className=\"py-4 md:py-6 lg:py-8\">\n      <div className=\"mx-auto max-w-7xl px-4\">\n        {header !== false ? (\n          <div className=\"mb-10 md:mb-12\">\n            <h2 className=\"text-4xl font-medium leading-[1.1] tracking-[-0.03em] lg:text-5xl\">\n              {header.title}\n            </h2>\n            {header.description ? (\n              <p className=\"mt-3 max-w-xl text-[0.9375rem] leading-relaxed text-muted-foreground\">\n                {header.description}\n              </p>\n            ) : null}\n          </div>\n        ) : null}\n        <GalleryTrack items={items} />\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/gallery-section-v1/components/gallery-section-v1.tsx"
    },
    {
      "path": "registry/new-york/blocks/gallery-section-v1/components/gallery-track.tsx",
      "content": "\"use client\"\n\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from \"react\"\n\nimport GalleryPanel from \"./gallery-panel\"\nimport type { GalleryItem } from \"../lib/config\"\nimport \"../styles/gallery-track.css\"\n\ntype GalleryTrackProps = {\n  items: GalleryItem[]\n}\n\nexport default function GalleryTrack({ items }: GalleryTrackProps) {\n  const [activeIndex, setActiveIndex] = useState(0)\n  const [coarsePointer, setCoarsePointer] = useState(false)\n\n  const trackRef = useRef<HTMLDivElement>(null)\n  const canvasRef = useRef<HTMLDivElement>(null)\n  const panelRefs = useRef<(HTMLDivElement | null)[]>([])\n  const activeIndexRef = useRef(activeIndex)\n  const topLineRef = useRef<HTMLDivElement>(null)\n  const bottomLineRef = useRef<HTMLDivElement>(null)\n  const scheduleLinesRef = useRef<() => void>(() => {})\n\n  useLayoutEffect(() => {\n    activeIndexRef.current = activeIndex\n  })\n\n  useEffect(() => {\n    const mq = window.matchMedia(\"(hover: none)\")\n    const update = () => setCoarsePointer(mq.matches)\n    update()\n    mq.addEventListener(\"change\", update)\n    return () => mq.removeEventListener(\"change\", update)\n  }, [])\n\n  const handleActivate = useCallback((index: number) => {\n    setActiveIndex(index)\n  }, [])\n\n  const handleMouseLeave = () => {\n    if (!coarsePointer) setActiveIndex(0)\n  }\n\n  const handleFocusOut = (event: React.FocusEvent<HTMLDivElement>) => {\n    const next = event.relatedTarget\n    if (next instanceof Node && event.currentTarget.contains(next)) return\n    setActiveIndex(0)\n  }\n\n  const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n    if (event.key === \"ArrowRight\") {\n      event.preventDefault()\n      const next = (activeIndex + 1) % items.length\n      setActiveIndex(next)\n      panelRefs.current[next]?.focus()\n    } else if (event.key === \"ArrowLeft\") {\n      event.preventDefault()\n      const prev = (activeIndex - 1 + items.length) % items.length\n      setActiveIndex(prev)\n      panelRefs.current[prev]?.focus()\n    }\n  }\n\n  useLayoutEffect(() => {\n    const track = trackRef.current\n    const canvas = canvasRef.current\n    if (!track || !canvas) return\n\n    let rafId = 0\n\n    const commitLines = () => {\n      const currentTrack = trackRef.current\n      const currentCanvas = canvasRef.current\n      const currentPanel = panelRefs.current[activeIndexRef.current]\n      if (!currentTrack || !currentCanvas || !currentPanel) return\n      if (!topLineRef.current || !bottomLineRef.current) return\n\n      const panelRect = currentPanel.getBoundingClientRect()\n      const trackRect = currentTrack.getBoundingClientRect()\n      const canvasRect = currentCanvas.getBoundingClientRect()\n      const left = panelRect.left + panelRect.width / 2 - canvasRect.left\n\n      topLineRef.current.style.transform = `translateX(${left}px)`\n      topLineRef.current.style.height = `${trackRect.top - canvasRect.top}px`\n      bottomLineRef.current.style.transform = `translateX(${left}px)`\n      bottomLineRef.current.style.top = `${trackRect.bottom - canvasRect.top}px`\n      bottomLineRef.current.style.height = `${canvasRect.bottom - trackRect.bottom}px`\n    }\n\n    const scheduleLines = () => {\n      cancelAnimationFrame(rafId)\n      rafId = requestAnimationFrame(commitLines)\n    }\n\n    scheduleLinesRef.current = scheduleLines\n\n    commitLines()\n\n    const observer = new ResizeObserver(scheduleLines)\n    panelRefs.current.forEach((panel) => {\n      if (panel) observer.observe(panel)\n    })\n\n    window.addEventListener(\"resize\", scheduleLines, { passive: true })\n\n    return () => {\n      cancelAnimationFrame(rafId)\n      observer.disconnect()\n      window.removeEventListener(\"resize\", scheduleLines)\n    }\n  }, [])\n\n  useEffect(() => {\n    scheduleLinesRef.current()\n  }, [activeIndex])\n\n  return (\n    <div className=\"gsv1-root relative w-full\">\n      <div ref={canvasRef} className=\"gsv1-canvas\">\n        <div\n          ref={topLineRef}\n          aria-hidden\n          className=\"gsv1-vline gsv1-vline--top\"\n          style={{ top: 0 }}\n        />\n        <div\n          ref={bottomLineRef}\n          aria-hidden\n          className=\"gsv1-vline gsv1-vline--bottom\"\n        />\n        <div\n          ref={trackRef}\n          aria-label=\"Photo gallery — use arrow keys to navigate\"\n          className=\"gsv1-track flex h-96 w-full overflow-x-auto overflow-y-visible md:h-104 md:overflow-x-hidden\"\n          role=\"list\"\n          onBlurCapture={handleFocusOut}\n          onKeyDown={handleKeyDown}\n          onMouseLeave={handleMouseLeave}\n        >\n          {items.map((item, index) => (\n            <GalleryPanel\n              key={item.id}\n              ref={(node) => {\n                panelRefs.current[index] = node\n              }}\n              index={index}\n              isActive={activeIndex === index}\n              item={item}\n              priority={index === 0}\n              onActivate={handleActivate}\n            />\n          ))}\n        </div>\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/gallery-section-v1/components/gallery-track.tsx"
    },
    {
      "path": "registry/new-york/blocks/gallery-section-v1/components/gallery-panel.tsx",
      "content": "\"use client\"\n\nimport { forwardRef, memo, useState } from \"react\"\nimport Image from \"next/image\"\n\nimport type { GalleryItem } from \"../lib/config\"\n\ntype GalleryPanelProps = {\n  item: GalleryItem\n  index: number\n  isActive: boolean\n  priority?: boolean\n  onActivate: (index: number) => void\n}\n\nconst GalleryPanel = memo(\n  forwardRef<HTMLDivElement, GalleryPanelProps>(function GalleryPanel(\n    { item, index, isActive, priority = false, onActivate },\n    ref,\n  ) {\n    const [loaded, setLoaded] = useState(false)\n\n    return (\n      <div\n        ref={ref}\n        aria-label={item.label}\n        className={`gsv1-panel group relative min-w-12 shrink-0 overflow-hidden outline-none md:min-w-0${isActive ? \" gsv1-panel--active\" : \"\"}`}\n        role=\"listitem\"\n        tabIndex={0}\n        onFocus={() => onActivate(index)}\n        onMouseEnter={() => onActivate(index)}\n      >\n        <Image\n          src={item.imageSrc}\n          alt={item.alt}\n          fill\n          unoptimized\n          priority={priority}\n          sizes=\"(max-width: 768px) 20vw, 15vw\"\n          className={`object-cover transition-[transform,scale,opacity] duration-680 ease-[var(--gsv1-ease)]${isActive ? \" scale-105\" : \" scale-100\"}${loaded ? \" opacity-100\" : \" opacity-0\"}`}\n          onLoad={() => setLoaded(true)}\n          onError={() => setLoaded(true)}\n        />\n\n        <div aria-hidden className=\"gsv1-caption\">\n          {item.alt}\n        </div>\n      </div>\n    )\n  }),\n)\n\nexport default GalleryPanel\n",
      "type": "registry:component",
      "target": "app/gallery-section-v1/components/gallery-panel.tsx"
    },
    {
      "path": "registry/new-york/blocks/gallery-section-v1/lib/config.ts",
      "content": "export type GalleryItem = {\n  id: string\n  label: string\n  alt: string\n  imageSrc: string\n}\n\nexport const sectionMeta = {\n  title: \"Moments In Focus\",\n}\n\nexport const imageFiles = [\n  { file: \"image-1.jpg\",  alt: \"Mountain landscape at golden hour\" },\n  { file: \"image-2.jpg\",  alt: \"Coastal cliffs and ocean waves\" },\n  { file: \"image-3.jpg\",  alt: \"Forest trail through tall trees\" },\n  { file: \"image-4.jpg\",  alt: \"City skyline at dusk\" },\n  { file: \"image-5.jpg\",  alt: \"Desert dunes under a clear sky\" },\n  { file: \"image-6.jpg\",  alt: \"Snow-capped peaks above a valley\" },\n  { file: \"image-7.jpg\",  alt: \"Lush green hills and farmland\" },\n  { file: \"image-8.jpg\",  alt: \"Rocky shoreline at sunset\" },\n  { file: \"image-9.jpg\",  alt: \"Misty lake surrounded by mountains\" },\n  { file: \"image-10.jpg\", alt: \"Cherry blossoms in spring light\" },\n]\n",
      "type": "registry:lib",
      "target": "app/gallery-section-v1/lib/config.ts"
    },
    {
      "path": "registry/new-york/blocks/gallery-section-v1/styles/gallery-track.css",
      "content": ".gsv1-root {\n  --gsv1-ease: cubic-bezier(0.16, 1, 0.3, 1);\n  --gsv1-duration: 680ms;\n}\n\n.gsv1-canvas {\n  --gsv1-stub: clamp(4rem, 12vw, 9rem);\n  position: relative;\n  padding-top: var(--gsv1-stub);\n  padding-bottom: var(--gsv1-stub);\n}\n\n.gsv1-track {\n  scrollbar-width: none;\n  isolation: isolate;\n}\n\n.gsv1-track::-webkit-scrollbar {\n  display: none;\n}\n\n/* ── Panel ── */\n\n.gsv1-panel {\n  flex: 1 1 0;\n  min-width: 0;\n  min-height: 100%;\n  background-color: var(--muted);\n  transition: flex var(--gsv1-duration) var(--gsv1-ease);\n  contain: layout paint;\n  margin-right: -1px;\n  cursor: pointer;\n}\n\n.gsv1-panel:last-child {\n  margin-right: 0;\n}\n\n.gsv1-panel--active {\n  flex: 5 1 0;\n  z-index: 2;\n}\n\n/* Dark scrim on inactive panels */\n.gsv1-panel::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  z-index: 1;\n  pointer-events: none;\n  background: rgb(0 0 0 / 0.32);\n  opacity: 1;\n  transition: opacity var(--gsv1-duration) var(--gsv1-ease);\n}\n\n.gsv1-panel--active::before {\n  opacity: 0;\n}\n\n/* Inset ring on active panel */\n.gsv1-panel::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n  z-index: 3;\n  box-shadow: inset 0 0 0 1px transparent;\n  transition: box-shadow calc(var(--gsv1-duration) * 0.45) var(--gsv1-ease);\n}\n\n.gsv1-panel--active::after {\n  box-shadow: inset 0 0 0 1px var(--foreground);\n  transition-delay: 80ms;\n}\n\n/* ── Caption ── */\n\n.gsv1-caption {\n  position: absolute;\n  inset-inline: 0;\n  bottom: 0;\n  z-index: 4;\n  padding: 2.5rem 0.875rem 0.75rem;\n  background: linear-gradient(to top, rgb(0 0 0 / 0.52) 0%, transparent 100%);\n  color: #fff;\n  font-size: 0.6875rem;\n  font-weight: 500;\n  letter-spacing: 0.07em;\n  text-transform: uppercase;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  opacity: 0;\n  transform: translateY(5px);\n  transition:\n    opacity calc(var(--gsv1-duration) * 0.5) var(--gsv1-ease),\n    transform calc(var(--gsv1-duration) * 0.5) var(--gsv1-ease);\n  pointer-events: none;\n}\n\n.gsv1-panel--active .gsv1-caption {\n  opacity: 1;\n  transform: translateY(0);\n  transition-delay: calc(var(--gsv1-duration) * 0.3);\n}\n\n/* ── Vlines ── */\n\n.gsv1-vline {\n  position: absolute;\n  left: 0;\n  z-index: 50;\n  width: 1px;\n  margin-left: -0.5px;\n  pointer-events: none;\n  background: var(--foreground);\n  opacity: 1;\n  will-change: transform;\n}\n\n.gsv1-vline--top {\n  mask-image: linear-gradient(to bottom, transparent 0%, black 40%);\n}\n\n.gsv1-vline--bottom {\n  mask-image: linear-gradient(to top, transparent 0%, black 40%);\n}\n\n/* ── Reduced motion ── */\n\n@media (prefers-reduced-motion: reduce) {\n  .gsv1-panel,\n  .gsv1-panel::before,\n  .gsv1-panel::after,\n  .gsv1-caption {\n    transition: none;\n  }\n}\n",
      "type": "registry:file",
      "target": "app/gallery-section-v1/styles/gallery-track.css"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-1.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-1.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-2.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-2.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-3.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-3.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-4.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-4.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-5.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-5.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-6.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-6.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-7.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-7.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-8.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-8.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-9.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-9.jpg.gitkeep"
    },
    {
      "path": "public/images/blocks/gallery-section-v1/image-10.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/gallery-section-v1/image-10.jpg.gitkeep"
    }
  ],
  "type": "registry:block"
}