{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "product-features-block",
  "title": "Product Features Block",
  "description": "A product feature tour: a vertical list of features with progress bars that autoplay through them, a large photo that crossfades and slowly zooms toward the part being described, a floating stat card, and a compact spec grid underneath.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/product-features-block/product-features-block.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, animate, motion, useMotionValue, useReducedMotion, useTransform, type MotionValue } from \"motion/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 ProductFeature {\n  id: string;\n  title: string;\n  body: string;\n  image: string;\n  /** Point the photo zooms toward, in percent. */\n  focus?: { x: number; y: number };\n  stat?: { value: string; label: string };\n}\n\nexport interface ProductFeaturesBlockProps {\n  eyebrow?: string;\n  title?: string;\n  features?: ProductFeature[];\n  specs?: { label: string; value: string }[];\n  /** Seconds each feature stays before the next one plays. */\n  interval?: number;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", title: \"#FFFFFF\", muted: \"rgba(255,255,255,0.45)\", body: \"rgba(255,255,255,0.62)\", line: \"rgba(255,255,255,0.12)\", card: \"#141414\", photo: \"#F1F1F1\", accent: \"#7CDE6A\", ring: \"rgba(255,255,255,0.5)\" },\n  light: { bg: \"#FFFFFF\", title: \"#111111\", muted: \"rgba(0,0,0,0.45)\", body: \"rgba(0,0,0,0.62)\", line: \"rgba(0,0,0,0.1)\", card: \"#F7F7F6\", photo: \"#F1F1F1\", accent: \"#2F9E44\", ring: \"rgba(0,0,0,0.45)\" },\n};\nconst FEATURES: ProductFeature[] = [\n  { id: \"case\", title: \"A 7 mm case\", body: \"Brushed steel with a matte black finish, thin enough to slide under a shirt cuff.\", image: \"/demo/blocks/product-detail/watch-1.webp\", focus: { x: 50, y: 50 }, stat: { value: \"7 mm\", label: \"thin\" } },\n  { id: \"dial\", title: \"Nothing extra on the dial\", body: \"Twelve indices and two hands. Easy to read at a glance, quiet the rest of the time.\", image: \"/demo/blocks/product-detail/watch-2.webp\", focus: { x: 50, y: 48 }, stat: { value: \"2\", label: \"hands\" } },\n  { id: \"strap\", title: \"Quick-release strap\", body: \"Vegetable-tanned leather that softens with wear. Swap it without tools in seconds.\", image: \"/demo/blocks/product-detail/watch-3.webp\", focus: { x: 50, y: 30 }, stat: { value: \"5 s\", label: \"to swap\" } },\n  { id: \"water\", title: \"Made for every day\", body: \"3 ATM water resistance for rain and hand washing, and a battery that lasts about three years.\", image: \"/demo/blocks/product-detail/watch-4.webp\", focus: { x: 50, y: 60 }, stat: { value: \"3 yr\", label: \"battery\" } },\n];\nconst SPECS = [\n  { label: \"Case\", value: \"40 mm stainless steel\" },\n  { label: \"Movement\", value: \"Japanese quartz\" },\n  { label: \"Glass\", value: \"Scratch-resistant mineral\" },\n  { label: \"Water\", value: \"3 ATM (30 m)\" },\n  { label: \"Strap\", value: \"20 mm leather\" },\n  { label: \"Warranty\", value: \"2 years\" },\n];\n\nfunction Bar({ active, progress, done, color, track }: { active: boolean; progress: MotionValue<number>; done: boolean; color: string; track: string }) {\n  const h = useTransform(progress, (v) => `${(active ? v : done ? 1 : 0) * 100}%`);\n  return (\n    <span className=\"relative block w-[2px] self-stretch overflow-hidden rounded-full\" style={{ background: track }}>\n      <motion.span className=\"absolute inset-x-0 top-0 block rounded-full\" style={{ height: h, background: color }} />\n    </span>\n  );\n}\n\nexport function ProductFeaturesBlock({ eyebrow = \"Minimal Watch\", title = \"Designed to disappear on your wrist\", features = FEATURES, specs = SPECS, interval = 5, theme = \"dark\", className }: ProductFeaturesBlockProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [index, setIndex] = React.useState(0);\n  const [paused, setPaused] = React.useState(false);\n  const progress = useMotionValue(0);\n  const f = features[index];\n\n  const go = React.useCallback(\n    (i: number) => {\n      setIndex((i + features.length) % features.length);\n      progress.set(0);\n    },\n    [features.length, progress],\n  );\n  React.useEffect(() => {\n    if (paused || reduce) return;\n    const c = animate(progress, 1, { duration: interval * (1 - progress.get()), ease: \"linear\", onComplete: () => go(index + 1) });\n    return () => c.stop();\n  }, [paused, reduce, interval, index, go, progress]);\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.bg } as React.CSSProperties;\n\n  return (\n    <section className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.title }} aria-labelledby={`${uid}-t`}>\n      <div className=\"mx-auto max-w-6xl px-4 py-12 @[640px]:px-8\">\n        <p className=\"m-0 text-[12px] font-semibold tracking-[0.12em] uppercase\" style={{ color: p.accent }}>\n          {eyebrow}\n        </p>\n        <h2 id={`${uid}-t`} className=\"m-0 mt-3 max-w-[20ch] text-[32px] leading-[1.05] font-semibold tracking-[-0.03em] @[640px]:text-[46px]\">\n          {title}\n        </h2>\n\n        <div className=\"mt-9 grid grid-cols-1 items-start gap-8 @[860px]:grid-cols-[minmax(0,1.05fr)_minmax(0,1fr)] @[860px]:gap-12\" onMouseEnter={() => setPaused(true)} onMouseLeave={() => setPaused(false)}>\n          {/* Photo */}\n          <div className=\"relative aspect-square w-full overflow-hidden rounded-3xl @[860px]:sticky @[860px]:top-8\" style={{ background: p.photo }}>\n            <AnimatePresence initial={false}>\n              <motion.img\n                key={f.id}\n                src={f.image}\n                alt={`${eyebrow}: ${f.title}`}\n                className=\"absolute inset-0 h-full w-full object-cover\"\n                style={{ transformOrigin: `${f.focus?.x ?? 50}% ${f.focus?.y ?? 50}%` }}\n                initial={reduce ? false : { opacity: 0, scale: 1.08 }}\n                animate={{ opacity: 1, scale: reduce ? 1 : [1, 1.06] }}\n                exit={reduce ? undefined : { opacity: 0 }}\n                transition={{ opacity: { duration: 0.6 }, scale: { duration: interval + 1, ease: \"linear\" } }}\n              />\n            </AnimatePresence>\n            {f.stat && (\n              <AnimatePresence mode=\"popLayout\" initial={false}>\n                <motion.div key={f.id} className=\"absolute bottom-4 left-4 rounded-2xl px-4 py-3 shadow-xl backdrop-blur-md\" style={{ background: \"rgba(255,255,255,0.88)\", color: \"#111\" }} initial={reduce ? false : { opacity: 0, y: 12 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0, y: -8 }} transition={{ duration: 0.35, delay: reduce ? 0 : 0.15 }}>\n                  <span className=\"block text-[26px] leading-none font-semibold tracking-[-0.02em] tabular-nums\">{f.stat.value}</span>\n                  <span className=\"mt-1 block text-[12px] text-black/55\">{f.stat.label}</span>\n                </motion.div>\n              </AnimatePresence>\n            )}\n            <span className=\"absolute top-4 right-4 rounded-full bg-white/85 px-2.5 py-1 text-[11.5px] font-medium text-[#111] tabular-nums backdrop-blur\" aria-hidden=\"true\">\n              {String(index + 1).padStart(2, \"0\")} / {String(features.length).padStart(2, \"0\")}\n            </span>\n          </div>\n\n          {/* Feature list */}\n          <div>\n            <div role=\"tablist\" aria-orientation=\"vertical\" aria-label=\"Features\" className=\"flex flex-col\">\n              {features.map((x, i) => {\n                const on = i === index;\n                return (\n                  <button\n                    key={x.id}\n                    type=\"button\"\n                    role=\"tab\"\n                    aria-selected={on}\n                    tabIndex={on ? 0 : -1}\n                    aria-controls={`${uid}-panel`}\n                    onClick={() => go(i)}\n                    onKeyDown={(e) => {\n                      if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n                        e.preventDefault();\n                        const n = (i + (e.key === \"ArrowDown\" ? 1 : -1) + features.length) % features.length;\n                        go(n);\n                        (e.currentTarget.parentElement?.children[n] as HTMLElement | undefined)?.focus();\n                      }\n                    }}\n                    className=\"group flex cursor-pointer gap-4 border-0 bg-transparent py-4 text-left outline-none focus-visible:ring-2 focus-visible:ring-offset-2\"\n                    style={{ color: p.title, ...ring }}\n                  >\n                    <Bar active={on} progress={progress} done={reduce ? on : i < index} color={p.title} track={p.line} />\n                    <span className=\"min-w-0 flex-1\">\n                      <span className=\"flex items-baseline gap-3\">\n                        <span className=\"text-[12px] tabular-nums\" style={{ color: p.muted }}>\n                          {String(i + 1).padStart(2, \"0\")}\n                        </span>\n                        <span className=\"text-[19px] font-semibold tracking-[-0.01em] transition-opacity\" style={{ opacity: on ? 1 : 0.45 }}>\n                          {x.title}\n                        </span>\n                      </span>\n                      <AnimatePresence initial={false}>\n                        {on && (\n                          <motion.span key=\"b\" id={`${uid}-panel`} role=\"tabpanel\" className=\"block overflow-hidden\" initial={reduce ? false : { height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={reduce ? undefined : { height: 0, opacity: 0 }} transition={{ duration: 0.35, ease: [0.22, 1, 0.36, 1] }}>\n                            <span className=\"block pt-2 pl-[30px] text-[14.5px] leading-relaxed\" style={{ color: p.body }}>\n                              {x.body}\n                            </span>\n                          </motion.span>\n                        )}\n                      </AnimatePresence>\n                    </span>\n                  </button>\n                );\n              })}\n            </div>\n            <dl className=\"m-0 mt-6 grid grid-cols-2 gap-px overflow-hidden rounded-2xl border\" style={{ borderColor: p.line, background: p.line }}>\n              {specs.map((s) => (\n                <div key={s.label} className=\"px-4 py-3\" style={{ background: p.card }}>\n                  <dt className=\"text-[11.5px]\" style={{ color: p.muted }}>\n                    {s.label}\n                  </dt>\n                  <dd className=\"m-0 mt-0.5 text-[13.5px] font-medium\">{s.value}</dd>\n                </div>\n              ))}\n            </dl>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport default ProductFeaturesBlock;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}