{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "team-section-v1",
  "title": "Team Section v1",
  "description": "A centered title and description above a row of team portraits: the active card lies flat while the cards on either side turn slightly toward the center in 3D, and the name and title sit under the active card. Drag the row, click a neighbor, or use the arrow keys.",
  "registryDependencies": [
    "https://uiception.com/r/block-media.json"
  ],
  "files": [
    {
      "path": "registry/new-york/blocks/team-section-v1/page.tsx",
      "content": "import TeamSectionV1 from \"./components/team-section-v1\"\n\nexport default function Page() {\n  return <TeamSectionV1 />\n}\n",
      "type": "registry:page",
      "target": "app/team-section-v1/page.tsx"
    },
    {
      "path": "registry/new-york/blocks/team-section-v1/components/team-section-v1.tsx",
      "content": "import { createBlockImage } from \"@/lib/block-media\"\n\nimport { TeamSectionV1Root } from \"./team-section-v1-root\"\nimport { teamFiles, type TeamMember } from \"../lib/config\"\n\nconst blockImage = createBlockImage(\"team-section-v1\")\n\nconst teamMembers: TeamMember[] = teamFiles.map((member, index) => ({\n  id: String(index + 1),\n  name: member.name,\n  title: member.title,\n  avatarSrc: blockImage(member.file),\n}))\n\nexport type TeamSectionV1Props = {\n  members?: TeamMember[]\n}\n\nexport default function TeamSectionV1({\n  members = teamMembers,\n}: TeamSectionV1Props = {}) {\n  return <TeamSectionV1Root members={members} />\n}\n",
      "type": "registry:component",
      "target": "app/team-section-v1/components/team-section-v1.tsx"
    },
    {
      "path": "registry/new-york/blocks/team-section-v1/components/team-section-v1-root.tsx",
      "content": "\"use client\"\n\nimport Image from \"next/image\"\n\nimport { useTeamCarousel } from \"../hooks/use-team-carousel\"\nimport { sectionHeader, type TeamMember } from \"../lib/config\"\n\ntype TeamSectionV1RootProps = {\n  members: TeamMember[]\n}\n\nexport function TeamSectionV1Root({ members }: TeamSectionV1RootProps) {\n  const { stageRef, activeIndex, goTo, onCardClick } = useTeamCarousel(\n    members.length\n  )\n\n  return (\n    <section\n      aria-roledescription=\"carousel\"\n      aria-label=\"Team\"\n      className=\"relative overflow-hidden py-16 lg:py-24\"\n      onKeyDown={(event) => {\n        if (event.key === \"ArrowRight\") {\n          event.preventDefault()\n          goTo(activeIndex + 1)\n        } else if (event.key === \"ArrowLeft\") {\n          event.preventDefault()\n          goTo(activeIndex - 1)\n        }\n      }}\n    >\n      <div className=\"mx-auto max-w-xl px-6 text-center\">\n        <h2 className=\"text-4xl leading-[1.1] font-medium tracking-[-0.03em] text-foreground lg:text-5xl\">\n          {sectionHeader.title}\n        </h2>\n        <p className=\"mx-auto mt-4 max-w-sm text-[0.9375rem] leading-relaxed text-muted-foreground\">\n          {sectionHeader.description}\n        </p>\n      </div>\n\n      <div\n        ref={stageRef}\n        className=\"relative mt-6 h-[calc(var(--tsv1-card,240px)+7rem)] cursor-grab touch-none overflow-hidden select-none data-[dragging=true]:cursor-grabbing\"\n      >\n        {members.map((member, index) => (\n          <article\n            key={member.id}\n            data-tsv1-card\n            data-index={index}\n            className=\"invisible absolute top-8 left-1/2 will-change-transform\"\n          >\n            <div className=\"relative aspect-square overflow-hidden rounded-[15%] bg-muted shadow-[0_18px_40px_-16px_rgba(0,0,0,0.35)]\">\n              <Image\n                src={member.avatarSrc}\n                alt={member.name}\n                fill\n                unoptimized\n                draggable={false}\n                priority={index === 0}\n                sizes=\"240px\"\n                className=\"scale-[1.12] object-cover\"\n              />\n              <button\n                type=\"button\"\n                data-tsv1-hit\n                aria-label={`Show ${member.name}`}\n                aria-current={activeIndex === index ? \"true\" : undefined}\n                tabIndex={activeIndex === index ? -1 : 0}\n                className=\"absolute inset-0\"\n                onClick={() => onCardClick(index)}\n              />\n            </div>\n            <div\n              data-tsv1-caption\n              aria-hidden=\"true\"\n              className=\"mt-4 text-center opacity-0\"\n            >\n              <h3 className=\"text-base leading-snug font-medium tracking-[-0.01em] text-foreground\">\n                {member.name}\n              </h3>\n              <p className=\"text-sm leading-snug text-muted-foreground\">\n                {member.title}\n              </p>\n            </div>\n          </article>\n        ))}\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/team-section-v1/components/team-section-v1-root.tsx"
    },
    {
      "path": "registry/new-york/blocks/team-section-v1/hooks/use-team-carousel.ts",
      "content": "import { useCallback, useLayoutEffect, useRef, useState } from \"react\"\n\nconst CARD_MAX = 240\nconst CARD_MIN = 168\n/**\n * Distance between card centers, as a share of the card width: the first hop\n * clears the flat center card, later hops only clear foreshortened side cards.\n */\nconst STEP_RATIO = 0.97\nconst FAR_STEP_RATIO = 0.9\nconst SIDE_SCALE = 0.88\n/** Degrees each side card turns toward the center (3D, around its vertical axis). */\nconst TILT = 18\nconst PERSPECTIVE = 900\n/** Release glide that settles a drag onto the nearest card. */\nconst SNAP_MS = 320\n\nfunction mod(value: number, count: number) {\n  return ((value % count) + count) % count\n}\n\nfunction clamp(min: number, max: number, value: number) {\n  return Math.min(max, Math.max(min, value))\n}\n\nfunction wrapDelta(index: number, progress: number, count: number) {\n  let delta = index - progress\n  delta %= count\n  if (delta > count / 2) delta -= count\n  if (delta < -count / 2) delta += count\n  return delta\n}\n\n/** Horizontal offset, in card widths, of a card `delta` slots from the center. */\nfunction offsetOf(delta: number) {\n  const distance = Math.abs(delta)\n  const slots =\n    Math.min(distance, 1) * STEP_RATIO +\n    Math.max(distance - 1, 0) * FAR_STEP_RATIO\n  return Math.sign(delta) * slots\n}\n\nfunction measure(stage: HTMLElement) {\n  const card = clamp(CARD_MIN, CARD_MAX, stage.clientWidth * 0.26)\n  return { card, step: card * STEP_RATIO }\n}\n\nexport function useTeamCarousel(count: number) {\n  const stageRef = useRef<HTMLDivElement>(null)\n  const [activeIndex, setActiveIndex] = useState(0)\n  const api = useRef({\n    goTo: (() => {}) as (index: number) => void,\n    onCardClick: (() => {}) as (index: number) => void,\n  })\n\n  useLayoutEffect(() => {\n    const stage = stageRef.current\n    if (!stage || count < 1) return\n\n    const cards = [...stage.querySelectorAll<HTMLElement>(\"[data-tsv1-card]\")]\n    if (cards.length === 0) return\n\n    const progress = { current: 0 }\n    const metrics = { current: measure(stage) }\n    const reduce = {\n      current: window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches,\n    }\n    const active = { current: 0 }\n    const suppressClick = { current: false }\n    const drag = {\n      pointerId: -1,\n      startX: 0,\n      startProgress: 0,\n      lastX: 0,\n      lastTime: 0,\n      velocity: 0,\n      moved: false,\n      pressIndex: -1,\n    }\n    let snap = 0\n    let frame = 0\n    let pendingX = 0\n    let pendingTime = 0\n    let suppressTimer = 0\n\n    const syncActive = () => {\n      const next = mod(Math.round(progress.current), count)\n      if (next === active.current) return\n      active.current = next\n      setActiveIndex(next)\n    }\n\n    const layout = () => {\n      const { card } = metrics.current\n      stage.style.setProperty(\"--tsv1-card\", `${card}px`)\n      cards.forEach((cardEl, index) => {\n        const delta = wrapDelta(index, progress.current, count)\n        const distance = Math.abs(delta)\n        const scale = 1 + (SIDE_SCALE - 1) * Math.min(distance, 1)\n        const turn = clamp(-1, 1, delta) * TILT\n        const captionOpacity = clamp(0, 1, 1 - distance / 0.5)\n\n        cardEl.style.width = `${card}px`\n        cardEl.style.transformOrigin = `50% ${card / 2}px`\n        cardEl.style.transform = `translate3d(calc(-50% + ${offsetOf(delta) * card}px), 0, 0) perspective(${PERSPECTIVE}px) rotateY(${-turn}deg) scale(${scale})`\n        cardEl.style.zIndex = String(Math.round(80 - distance * 24))\n        cardEl.style.visibility =\n          distance > count / 2 - 0.05 ? \"hidden\" : \"visible\"\n\n        const caption = cardEl.querySelector<HTMLElement>(\"[data-tsv1-caption]\")\n        const hit = cardEl.querySelector<HTMLElement>(\"[data-tsv1-hit]\")\n        if (caption) {\n          caption.style.opacity = String(captionOpacity)\n          caption.setAttribute(\n            \"aria-hidden\",\n            captionOpacity > 0.4 ? \"false\" : \"true\"\n          )\n        }\n        if (hit) hit.style.pointerEvents = distance < 0.4 ? \"none\" : \"auto\"\n      })\n      syncActive()\n    }\n\n    const animateTo = (target: number) => {\n      cancelAnimationFrame(snap)\n      const from = progress.current\n      if (reduce.current || Math.abs(target - from) < 0.001) {\n        progress.current = target\n        layout()\n        return\n      }\n      const start = performance.now()\n      const tick = (now: number) => {\n        const t = Math.min(1, (now - start) / SNAP_MS)\n        const eased = 1 - (1 - t) ** 3\n        progress.current = from + (target - from) * eased\n        layout()\n        if (t < 1) snap = requestAnimationFrame(tick)\n      }\n      snap = requestAnimationFrame(tick)\n    }\n\n    const goTo = (index: number) => {\n      const normalized = mod(index, count)\n      const currentMod = mod(progress.current, count)\n      let delta = normalized - currentMod\n      if (delta > count / 2) delta -= count\n      if (delta < -count / 2) delta += count\n      animateTo(progress.current + delta)\n    }\n\n    api.current.goTo = goTo\n    api.current.onCardClick = (index: number) => {\n      if (suppressClick.current) return\n      goTo(index)\n    }\n\n    const applyPointer = (clientX: number, now: number) => {\n      const dx = clientX - drag.startX\n      if (Math.abs(dx) > 6) drag.moved = true\n      const dt = now - drag.lastTime\n      if (dt > 0) {\n        const instant = (clientX - drag.lastX) / dt\n        drag.velocity = drag.velocity * 0.65 + instant * 0.35\n      }\n      drag.lastX = clientX\n      drag.lastTime = now\n      progress.current = drag.startProgress - dx / metrics.current.step\n      layout()\n    }\n\n    const onPointerDown = (event: PointerEvent) => {\n      if (event.button !== 0) return\n      const target = event.target\n      cancelAnimationFrame(snap)\n      const card =\n        target instanceof Element ? target.closest(\"[data-tsv1-card]\") : null\n      drag.pressIndex = card ? Number(card.getAttribute(\"data-index\")) : -1\n      drag.pointerId = event.pointerId\n      drag.startX = event.clientX\n      drag.startProgress = progress.current\n      drag.lastX = event.clientX\n      drag.lastTime = performance.now()\n      drag.velocity = 0\n      drag.moved = false\n      try {\n        stage.setPointerCapture(event.pointerId)\n      } catch {\n        // Already released, or an untrusted pointer.\n      }\n      stage.dataset.dragging = \"true\"\n    }\n\n    const onPointerMove = (event: PointerEvent) => {\n      if (event.pointerId !== drag.pointerId) return\n      pendingX = event.clientX\n      pendingTime = performance.now()\n      if (frame) return\n      frame = requestAnimationFrame(() => {\n        frame = 0\n        if (drag.pointerId === -1) return\n        applyPointer(pendingX, pendingTime)\n      })\n    }\n\n    const endDrag = (event: PointerEvent) => {\n      if (event.pointerId !== drag.pointerId) return\n      if (frame) {\n        cancelAnimationFrame(frame)\n        frame = 0\n        applyPointer(event.clientX, performance.now())\n      }\n      drag.pointerId = -1\n      delete stage.dataset.dragging\n      if (stage.hasPointerCapture(event.pointerId)) {\n        stage.releasePointerCapture(event.pointerId)\n      }\n      if (!drag.moved) {\n        if (drag.pressIndex >= 0) goTo(drag.pressIndex)\n        return\n      }\n      suppressClick.current = true\n      window.clearTimeout(suppressTimer)\n      suppressTimer = window.setTimeout(() => {\n        suppressClick.current = false\n      }, 0)\n      const flickSlides = clamp(\n        -2,\n        2,\n        (-drag.velocity * 200) / metrics.current.step\n      )\n      animateTo(Math.round(progress.current + flickSlides))\n    }\n\n    const resizeObserver = new ResizeObserver(() => {\n      metrics.current = measure(stage)\n      layout()\n    })\n    resizeObserver.observe(stage)\n    stage.addEventListener(\"pointerdown\", onPointerDown)\n    stage.addEventListener(\"pointermove\", onPointerMove)\n    stage.addEventListener(\"pointerup\", endDrag)\n    stage.addEventListener(\"pointercancel\", endDrag)\n\n    const motionQuery = window.matchMedia(\"(prefers-reduced-motion: reduce)\")\n    const onMotion = () => {\n      reduce.current = motionQuery.matches\n    }\n    motionQuery.addEventListener(\"change\", onMotion)\n\n    layout()\n\n    return () => {\n      cancelAnimationFrame(snap)\n      if (frame) cancelAnimationFrame(frame)\n      window.clearTimeout(suppressTimer)\n      resizeObserver.disconnect()\n      stage.removeEventListener(\"pointerdown\", onPointerDown)\n      stage.removeEventListener(\"pointermove\", onPointerMove)\n      stage.removeEventListener(\"pointerup\", endDrag)\n      stage.removeEventListener(\"pointercancel\", endDrag)\n      motionQuery.removeEventListener(\"change\", onMotion)\n    }\n  }, [count])\n\n  const goTo = useCallback((index: number) => {\n    api.current.goTo(index)\n  }, [])\n\n  const onCardClick = useCallback((index: number) => {\n    api.current.onCardClick(index)\n  }, [])\n\n  return { stageRef, activeIndex, goTo, onCardClick }\n}\n",
      "type": "registry:hook",
      "target": "app/team-section-v1/hooks/use-team-carousel.ts"
    },
    {
      "path": "registry/new-york/blocks/team-section-v1/lib/config.ts",
      "content": "export type TeamMember = {\n  id: string\n  name: string\n  title: string\n  avatarSrc: string\n}\n\nexport const sectionHeader = {\n  title: \"Meet the team\",\n  description:\n    \"The people behind the product, from engineering and operations to design and data.\",\n} as const\n\nexport const teamFiles = [\n  { file: \"avatar-1.png\", name: \"Jane Doe\", title: \"VP of Engineering\" },\n  { file: \"avatar-2.png\", name: \"John Doe\", title: \"Director of Operations\" },\n  { file: \"avatar-3.png\", name: \"Jane Smith\", title: \"Chief Product Officer\" },\n  { file: \"avatar-4.png\", name: \"John Smith\", title: \"Head of Autonomy\" },\n  { file: \"avatar-5.png\", name: \"Alex Johnson\", title: \"Staff Data Engineer\" },\n  { file: \"avatar-6.png\", name: \"Sam Wilson\", title: \"SVP of Digital\" },\n] as const\n",
      "type": "registry:lib",
      "target": "app/team-section-v1/lib/config.ts"
    },
    {
      "path": "public/images/blocks/team-section-v1/avatar-1.png.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/team-section-v1/avatar-1.png.gitkeep"
    },
    {
      "path": "public/images/blocks/team-section-v1/avatar-2.png.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/team-section-v1/avatar-2.png.gitkeep"
    },
    {
      "path": "public/images/blocks/team-section-v1/avatar-3.png.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/team-section-v1/avatar-3.png.gitkeep"
    },
    {
      "path": "public/images/blocks/team-section-v1/avatar-4.png.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/team-section-v1/avatar-4.png.gitkeep"
    },
    {
      "path": "public/images/blocks/team-section-v1/avatar-5.png.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/team-section-v1/avatar-5.png.gitkeep"
    },
    {
      "path": "public/images/blocks/team-section-v1/avatar-6.png.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/team-section-v1/avatar-6.png.gitkeep"
    }
  ],
  "type": "registry:block"
}