{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "quote-wall",
  "type": "registry:block",
  "title": "Quote Wall",
  "description": "Customer quotes stacked in columns that drift past in opposite directions and settle the moment you stop to read one.",
  "categories": [
    "block",
    "Marketing"
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/devl/quote-wall.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { PauseIcon, PlayIcon, QuoteIcon, StarIcon } from \"lucide-react\";\nimport { motion, useAnimationFrame, useMotionValue, useReducedMotion } from \"motion/react\";\nimport { type RefObject, useEffect, useRef, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n// Stays false until mounted so the server render and the first client render match.\nfunction useSafeReducedMotion() {\n  const prefers = useReducedMotion();\n  const [mounted, setMounted] = useState(false);\n  useEffect(() => setMounted(true), []);\n  return mounted && !!prefers;\n}\n\nexport interface WallQuote {\n  quote: string;\n  highlight?: string;\n  name: string;\n  role: string;\n  company: string;\n}\n\nexport interface QuoteWallProps {\n  quotes: WallQuote[];\n  eyebrow?: string;\n  title?: string;\n  rating?: { score: number; count: string };\n  speed?: number;\n  className?: string;\n}\n\nconst avatarTones = [\n  \"bg-info/16 text-info-foreground\",\n  \"bg-success/16 text-success-foreground\",\n  \"bg-warning/12 text-warning-foreground\",\n  \"bg-muted text-foreground\",\n];\n\nfunction initials(name: string) {\n  return name\n    .split(/\\s+/)\n    .map((part) => part[0])\n    .slice(0, 2)\n    .join(\"\")\n    .toUpperCase();\n}\n\nfunction toneFor(name: string) {\n  let hash = 0;\n  for (const char of name) hash = (hash * 31 + char.charCodeAt(0)) >>> 0;\n  return avatarTones[hash % avatarTones.length];\n}\n\nfunction QuoteText({ text, highlight }: { text: string; highlight?: string }) {\n  const at = highlight ? text.indexOf(highlight) : -1;\n  if (!highlight || at < 0) return <>{text}</>;\n  return (\n    <>\n      {text.slice(0, at)}\n      <mark className=\"rounded-sm bg-warning/20 px-0.5 font-medium text-foreground [box-decoration-break:clone]\">\n        {highlight}\n      </mark>\n      {text.slice(at + highlight.length)}\n    </>\n  );\n}\n\nfunction QuoteCard({ item }: { item: WallQuote }) {\n  return (\n    <figure className=\"relative rounded-2xl border bg-card p-5 shadow-xs/5 transition-colors duration-200 ease-out hover:border-foreground/16\">\n      <QuoteIcon\n        aria-hidden\n        className=\"absolute top-4 right-4 size-5 rotate-180 text-muted-foreground/16\"\n        fill=\"currentColor\"\n        strokeWidth={0}\n      />\n      <blockquote className=\"text-pretty pe-6 text-muted-foreground text-sm leading-relaxed\">\n        <QuoteText highlight={item.highlight} text={item.quote} />\n      </blockquote>\n      <figcaption className=\"mt-4 flex items-center gap-3\">\n        <span\n          aria-hidden\n          className={cn(\n            \"flex size-9 shrink-0 items-center justify-center rounded-full font-semibold text-xs\",\n            toneFor(item.name),\n          )}\n        >\n          {initials(item.name)}\n        </span>\n        <span className=\"min-w-0\">\n          <span className=\"block truncate font-medium text-sm\">{item.name}</span>\n          <span className=\"block truncate text-muted-foreground text-xs\">\n            {item.role}, {item.company}\n          </span>\n        </span>\n      </figcaption>\n    </figure>\n  );\n}\n\nfunction ScrollColumn({\n  items,\n  speed,\n  reverse,\n  offset,\n  hovered,\n  paused,\n}: {\n  items: WallQuote[];\n  speed: number;\n  reverse: boolean;\n  offset: number;\n  hovered: RefObject<boolean>;\n  paused: boolean;\n}) {\n  const reduce = useSafeReducedMotion();\n  const viewportRef = useRef<HTMLDivElement>(null);\n  const copyRef = useRef<HTMLDivElement>(null);\n  const [copyHeight, setCopyHeight] = useState(0);\n  const [copies, setCopies] = useState(2);\n  const y = useMotionValue(0);\n  const velocity = useRef(0);\n\n  useEffect(() => {\n    const viewport = viewportRef.current;\n    const copy = copyRef.current;\n    if (!viewport || !copy) return;\n    const measure = () => {\n      const h = copy.offsetHeight;\n      setCopyHeight(h);\n      if (h > 0) {\n        setCopies(Math.max(2, Math.ceil(viewport.offsetHeight / h) + 1));\n        y.set(-h * offset);\n      }\n    };\n    measure();\n    const observer = new ResizeObserver(measure);\n    observer.observe(copy);\n    return () => observer.disconnect();\n  }, [offset, y]);\n\n  useAnimationFrame((_, delta) => {\n    if (!copyHeight || reduce) return;\n    const dt = Math.min(delta, 50) / 1000;\n    const still = hovered.current || paused;\n    const target = still ? 0 : reverse ? speed : -speed;\n    const rate = still ? 3.2 : 1.4;\n    velocity.current += (target - velocity.current) * (1 - Math.exp(-rate * dt));\n    if (target === 0 && Math.abs(velocity.current) < 0.3) {\n      velocity.current = 0;\n      return;\n    }\n    const next = y.get() + velocity.current * dt;\n    y.set((((next % copyHeight) - copyHeight) % copyHeight) || 0);\n  });\n\n  return (\n    <div\n      aria-label={reduce ? \"Customer quotes\" : undefined}\n      className={cn(\"h-full rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-ring\", reduce ? \"overflow-y-auto\" : \"overflow-hidden\")}\n      ref={viewportRef}\n      role={reduce ? \"region\" : undefined}\n      tabIndex={reduce ? 0 : undefined}\n    >\n      <motion.div style={reduce ? undefined : { y }}>\n        {Array.from({ length: reduce ? 1 : copies }, (_, copy) => (\n          <div\n            aria-hidden={copy > 0 || undefined}\n            className=\"flex flex-col gap-4 pb-4\"\n            key={copy}\n            ref={copy === 0 ? copyRef : undefined}\n          >\n            {items.map((item) => (\n              <QuoteCard item={item} key={item.name} />\n            ))}\n          </div>\n        ))}\n      </motion.div>\n    </div>\n  );\n}\n\nexport function QuoteWall({\n  quotes,\n  eyebrow = \"Wall of love\",\n  title = \"People keep telling us nice things\",\n  rating,\n  speed = 28,\n  className,\n}: QuoteWallProps) {\n  const reduce = useSafeReducedMotion();\n  const wallRef = useRef<HTMLDivElement>(null);\n  const hovered = useRef(false);\n  const [paused, setPaused] = useState(false);\n  const [columnCount, setColumnCount] = useState(3);\n\n  useEffect(() => {\n    const wall = wallRef.current;\n    if (!wall) return;\n    const observer = new ResizeObserver(([entry]) => {\n      const w = entry.contentRect.width;\n      setColumnCount(w < 560 ? 1 : w < 860 ? 2 : 3);\n    });\n    observer.observe(wall);\n    return () => observer.disconnect();\n  }, []);\n\n  const columns = Array.from({ length: columnCount }, (_, c) => quotes.filter((_, i) => i % columnCount === c));\n\n  return (\n    <section className={cn(\"mx-auto w-full max-w-[1100px]\", className)}>\n      <header className=\"relative mx-auto mb-10 flex flex-col items-center px-10 text-center\">\n        {eyebrow && <p className=\"font-medium text-muted-foreground text-xs uppercase tracking-widest\">{eyebrow}</p>}\n        <h2 className=\"mt-2 max-w-xl text-balance font-semibold text-3xl tracking-tight\">{title}</h2>\n        {rating && (\n          <div className=\"mt-4 flex items-center gap-2 text-sm\">\n            <span aria-hidden className=\"flex gap-0.5 text-warning\">\n              {Array.from({ length: 5 }, (_, i) => (\n                <StarIcon className=\"size-4\" fill=\"currentColor\" key={i} strokeWidth={0} />\n              ))}\n            </span>\n            <span className=\"font-medium tabular-nums\">{rating.score.toFixed(1)}</span>\n            <span className=\"text-muted-foreground\">from {rating.count} reviews</span>\n          </div>\n        )}\n        {!reduce && (\n          <button\n            aria-label={paused ? \"Resume scrolling quotes\" : \"Pause scrolling quotes\"}\n            aria-pressed={paused}\n            className=\"absolute -top-2 end-0 inline-flex size-8 cursor-pointer items-center justify-center rounded-full text-muted-foreground/72 outline-none transition-[color,background-color,transform] duration-150 ease-out hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.97]\"\n            onClick={() => setPaused((p) => !p)}\n            type=\"button\"\n          >\n            {paused ? <PlayIcon className=\"size-3.5 translate-x-px\" /> : <PauseIcon className=\"size-3.5\" />}\n          </button>\n        )}\n      </header>\n      <div\n        className=\"grid h-[560px] gap-4 [mask-image:linear-gradient(to_bottom,transparent,black_14%,black_86%,transparent)]\"\n        onPointerEnter={(e) => {\n          if (e.pointerType === \"mouse\") hovered.current = true;\n        }}\n        onPointerLeave={() => {\n          hovered.current = false;\n        }}\n        ref={wallRef}\n        style={{ gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))` }}\n      >\n        {columns.map((items, c) => (\n          <ScrollColumn\n            hovered={hovered}\n            items={items}\n            key={`${columnCount}-${c}`}\n            offset={c * 0.37}\n            paused={paused}\n            reverse={c % 2 === 1}\n            speed={speed * (1 + (c % 3) * 0.12)}\n          />\n        ))}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}