{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "wordmark-ticker",
  "type": "registry:block",
  "title": "Wordmark Ticker",
  "description": "A quiet strip of customer wordmarks that eases to a stop under your cursor, flings when you drag it, and pauses with a click.",
  "categories": [
    "block",
    "Marketing"
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/devl/wordmark-ticker.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { PauseIcon, PlayIcon, type LucideIcon } from \"lucide-react\";\nimport { motion, useAnimationFrame, useMotionValue, useReducedMotion } from \"motion/react\";\nimport { type PointerEvent, useEffect, useRef, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport type WordmarkStyle = \"sans\" | \"serif\" | \"mono\" | \"caps\" | \"heavy\" | \"light\";\n\nexport interface TickerLogo {\n  name: string;\n  icon: LucideIcon;\n  style?: WordmarkStyle;\n}\n\nexport interface WordmarkTickerProps {\n  logos: TickerLogo[];\n  title?: string;\n  rows?: number;\n  speed?: number;\n  className?: string;\n}\n\nconst wordmarkStyles: Record<WordmarkStyle, string> = {\n  sans: \"font-semibold text-lg tracking-tight\",\n  serif: \"font-serif text-xl italic\",\n  mono: \"font-mono font-medium text-base lowercase\",\n  caps: \"font-bold text-sm uppercase tracking-[0.22em]\",\n  heavy: \"font-black text-xl tracking-tighter\",\n  light: \"font-light text-xl tracking-wide\",\n};\n\nfunction Wordmark({ logo }: { logo: TickerLogo }) {\n  const Icon = logo.icon;\n  return (\n    <span className={cn(\"flex items-center gap-2 whitespace-nowrap\", wordmarkStyles[logo.style ?? \"sans\"])}>\n      <Icon className=\"size-5 shrink-0\" strokeWidth={logo.style === \"light\" ? 1.5 : 2.25} />\n      {logo.name}\n    </span>\n  );\n}\n\nfunction TickerRow({\n  logos,\n  speed,\n  reverse,\n  paused,\n}: {\n  logos: TickerLogo[];\n  speed: number;\n  reverse: boolean;\n  paused: boolean;\n}) {\n  const reduce = useReducedMotion();\n  const containerRef = useRef<HTMLDivElement>(null);\n  const copyRef = useRef<HTMLUListElement>(null);\n  const [copyWidth, setCopyWidth] = useState(0);\n  const [copies, setCopies] = useState(2);\n  const x = useMotionValue(0);\n  const velocity = useRef(0);\n  const hovered = useRef(false);\n  const drag = useRef<{ active: boolean; lastX: number; lastT: number; v: number } | null>(null);\n\n  useEffect(() => {\n    const container = containerRef.current;\n    const copy = copyRef.current;\n    if (!container || !copy) return;\n    const measure = () => {\n      const w = copy.offsetWidth;\n      setCopyWidth(w);\n      if (w > 0) setCopies(Math.max(2, Math.ceil(container.offsetWidth / w) + 1));\n    };\n    measure();\n    const observer = new ResizeObserver(measure);\n    observer.observe(container);\n    observer.observe(copy);\n    return () => observer.disconnect();\n  }, []);\n\n  const wrap = (value: number) => (copyWidth ? (((value % copyWidth) - copyWidth) % copyWidth) : value);\n\n  useAnimationFrame((_, delta) => {\n    if (!copyWidth || drag.current?.active) return;\n    const dt = Math.min(delta, 50) / 1000;\n    const cruise = reverse ? speed : -speed;\n    const target = hovered.current || paused || reduce ? 0 : cruise;\n    const gap = Math.abs(velocity.current - target);\n    const rate = gap > speed * 3 ? 2.2 : hovered.current ? 5 : 1.6;\n    velocity.current += (target - velocity.current) * (1 - Math.exp(-rate * dt));\n    if (target === 0 && Math.abs(velocity.current) < 0.5) {\n      velocity.current = 0;\n      return;\n    }\n    x.set(wrap(x.get() + velocity.current * dt));\n  });\n\n  const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n    if (event.button !== 0) return;\n    event.currentTarget.setPointerCapture(event.pointerId);\n    drag.current = { active: true, lastX: event.clientX, lastT: event.timeStamp, v: 0 };\n    velocity.current = 0;\n  };\n\n  const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n    const d = drag.current;\n    if (!d?.active) return;\n    const dx = event.clientX - d.lastX;\n    const dt = Math.max(1, event.timeStamp - d.lastT);\n    d.v = d.v * 0.5 + (dx / dt) * 1000 * 0.5;\n    d.lastX = event.clientX;\n    d.lastT = event.timeStamp;\n    x.set(wrap(x.get() + dx));\n  };\n\n  const onPointerUp = (event: PointerEvent<HTMLDivElement>) => {\n    const d = drag.current;\n    if (!d?.active) return;\n    const idle = event.timeStamp - d.lastT > 90;\n    velocity.current = idle ? 0 : Math.max(-4000, Math.min(4000, d.v));\n    drag.current = null;\n  };\n\n  return (\n    <div\n      className=\"relative cursor-grab touch-pan-y select-none overflow-hidden py-2 [mask-image:linear-gradient(to_right,transparent,black_12%,black_88%,transparent)] active:cursor-grabbing\"\n      onPointerCancel={onPointerUp}\n      onPointerDown={onPointerDown}\n      onPointerEnter={(e) => {\n        if (e.pointerType === \"mouse\") hovered.current = true;\n      }}\n      onPointerLeave={() => {\n        hovered.current = false;\n      }}\n      onPointerMove={onPointerMove}\n      onPointerUp={onPointerUp}\n      ref={containerRef}\n    >\n      <motion.div className=\"flex w-max\" style={{ x }}>\n        {Array.from({ length: copies }, (_, copy) => {\n          const items = logos.map((logo) => (\n            <li\n              className=\"flex h-12 items-center px-3 text-muted-foreground transition-colors duration-200 ease-out hover:text-foreground\"\n              key={logo.name}\n            >\n              <Wordmark logo={logo} />\n            </li>\n          ));\n          return copy === 0 ? (\n            <ul className=\"flex shrink-0 items-center gap-8 pe-8 sm:gap-12 sm:pe-12\" key=\"main\" ref={copyRef}>\n              {items}\n            </ul>\n          ) : (\n            <ul aria-hidden className=\"flex shrink-0 items-center gap-8 pe-8 sm:gap-12 sm:pe-12\" key={copy}>\n              {items}\n            </ul>\n          );\n        })}\n      </motion.div>\n    </div>\n  );\n}\n\nexport function WordmarkTicker({ logos, title = \"Trusted by teams at\", rows = 1, speed = 40, className }: WordmarkTickerProps) {\n  const [paused, setPaused] = useState(false);\n  const rowCount = Math.max(1, Math.min(rows, logos.length));\n  const split = Array.from({ length: rowCount }, (_, r) => logos.filter((_, i) => i % rowCount === r));\n\n  return (\n    <section aria-label={title} className={cn(\"mx-auto w-full max-w-[1100px]\", className)}>\n      <div className=\"relative mb-3 flex h-8 items-center justify-center gap-3 px-10\">\n        <span aria-hidden className=\"h-px w-8 shrink bg-linear-to-r from-transparent to-border sm:w-24\" />\n        <h2 className=\"truncate text-center font-medium text-muted-foreground text-sm\">{title}</h2>\n        <span aria-hidden className=\"h-px w-8 shrink bg-linear-to-l from-transparent to-border sm:w-24\" />\n        <button\n          aria-label={paused ? \"Resume scrolling\" : \"Pause scrolling\"}\n          aria-pressed={paused}\n          className=\"absolute 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      </div>\n      <div className=\"space-y-1\">\n        {split.map((rowLogos, r) => (\n          <TickerRow\n            key={rowLogos.map((l) => l.name).join(\"|\")}\n            logos={rowLogos}\n            paused={paused}\n            reverse={r % 2 === 1}\n            speed={speed * (r % 2 === 1 ? 0.8 : 1)}\n          />\n        ))}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}