{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "bento-pointer-glow",
  "type": "registry:component",
  "title": "Bento Pointer Glow",
  "description": "A three-column bento grid where one cursor-following glow lights every tile border and surface. Tiles lift on hover or focus and swap their description for a secondary caption; built-in visuals animate on their own.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "components",
    "bento",
    "grid",
    "glow",
    "pointer",
    "tiles",
    "dashboard"
  ],
  "docs": "https://hyperblur.dev/effects/bento-pointer-glow",
  "files": [
    {
      "path": "registry/hyperblur/bento-pointer-glow.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/bento-pointer-glow.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type BentoVisual = \"bars\" | \"toggles\" | \"avatars\" | \"spark\" | \"none\";\nexport type BentoSize = \"sm\" | \"wide\" | \"tall\" | \"large\";\n\nexport interface BentoPointerGlowItem {\n  id: string;\n  title: string;\n  description?: string;\n  caption?: string;\n  visual?: BentoVisual | React.ReactNode;\n  size?: BentoSize;\n}\n\nexport interface BentoPointerGlowProps extends React.HTMLAttributes<HTMLDivElement> {\n  items?: BentoPointerGlowItem[];\n  accent?: string;\n  rowHeight?: number;\n  gap?: number;\n  radius?: number;\n  glowSize?: number;\n  idle?: boolean;\n}\n\nconst defaultItems: BentoPointerGlowItem[] = [\n  { id: \"traffic\", title: \"Traffic\", description: \"Visits this week\", caption: \"Up 18% on the week before\", visual: \"bars\", size: \"wide\" },\n  { id: \"team\", title: \"Team\", description: \"Online right now\", caption: \"Four teammates are editing\", visual: \"avatars\", size: \"tall\" },\n  { id: \"alerts\", title: \"Alerts\", description: \"Notification rules\", caption: \"Three rules are switched on\", visual: \"toggles\" },\n  { id: \"latency\", title: \"Latency\", description: \"p95 response time\", caption: \"Down to 112 ms today\", visual: \"spark\" },\n];\n\nconst avatarPeople = [\n  { initials: \"AO\", color: \"#2f7bff\" },\n  { initials: \"BH\", color: \"#8b5cf6\" },\n  { initials: \"CT\", color: \"#14b8a6\" },\n  { initials: \"DS\", color: \"#f59e0b\" },\n];\n\nconst css = `\n.hb-qv3 {\n  --hb-qv3-acc: #2f7bff;\n  --hb-qv3-gap: 10px;\n  --hb-qv3-row: 132px;\n  --hb-qv3-r: 18px;\n  --hb-qv3-g: 220px;\n  --hb-qv3-k: 0.7;\n  position: relative;\n  display: grid;\n  grid-template-columns: repeat(3, minmax(0, 1fr));\n  grid-auto-rows: var(--hb-qv3-row);\n  gap: var(--hb-qv3-gap);\n  box-sizing: border-box;\n  width: 100%;\n  font: inherit;\n  color: #ededed;\n}\n.hb-qv3 *, .hb-qv3 *::before, .hb-qv3 *::after { box-sizing: border-box; }\n.hb-qv3-t {\n  --hb-qv3-mx: -400px;\n  --hb-qv3-my: -400px;\n  position: relative;\n  min-width: 0;\n  min-height: 0;\n  border-radius: var(--hb-qv3-r);\n  background: #111111;\n  outline: none;\n  isolation: isolate;\n  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;\n}\n.hb-qv3-t[data-size=\"wide\"] { grid-column: span 2; }\n.hb-qv3-t[data-size=\"tall\"] { grid-row: span 2; }\n.hb-qv3-t[data-size=\"large\"] { grid-column: span 2; grid-row: span 2; }\n.hb-qv3-t:hover, .hb-qv3-t:focus-visible {\n  transform: translateY(-3px);\n  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.9);\n}\n.hb-qv3-t:focus-visible { box-shadow: 0 0 0 2px #7fb3ff; }\n.hb-qv3-bd {\n  position: absolute;\n  inset: 0;\n  z-index: 2;\n  border-radius: inherit;\n  padding: 1px;\n  pointer-events: none;\n  background:\n    radial-gradient(\n      circle var(--hb-qv3-g) at var(--hb-qv3-mx) var(--hb-qv3-my),\n      color-mix(in srgb, var(--hb-qv3-acc) 45%, #ffffff) 0%,\n      color-mix(in srgb, var(--hb-qv3-acc) 70%, transparent) 38%,\n      transparent 72%\n    ),\n    rgba(255, 255, 255, 0.08);\n  opacity: 1;\n  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n  -webkit-mask-composite: xor;\n  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);\n}\n.hb-qv3-sf {\n  position: absolute;\n  inset: 0;\n  z-index: 0;\n  border-radius: inherit;\n  pointer-events: none;\n  opacity: var(--hb-qv3-k);\n  background: radial-gradient(\n    circle calc(var(--hb-qv3-g) * 1.1) at var(--hb-qv3-mx) var(--hb-qv3-my),\n    color-mix(in srgb, var(--hb-qv3-acc) 20%, transparent),\n    transparent 70%\n  );\n  transition: opacity 0.3s ease;\n}\n.hb-qv3-t:hover .hb-qv3-sf, .hb-qv3-t:focus-visible .hb-qv3-sf { opacity: 1; }\n.hb-qv3-in {\n  position: relative;\n  z-index: 1;\n  display: flex;\n  flex-direction: column;\n  gap: 5px;\n  height: 100%;\n  padding: 10px 12px;\n  overflow: hidden;\n  border-radius: inherit;\n}\n.hb-qv3-ti {\n  margin: 0;\n  font-size: 12px;\n  font-weight: 600;\n  line-height: 16px;\n  letter-spacing: 0.01em;\n  color: #ededed;\n}\n.hb-qv3-vz {\n  position: relative;\n  display: flex;\n  flex: 1;\n  align-items: flex-end;\n  min-height: 0;\n  overflow: hidden;\n}\n.hb-qv3-sw {\n  display: grid;\n  min-height: 15px;\n  font-size: 11px;\n  line-height: 15px;\n}\n.hb-qv3-sw > span {\n  grid-area: 1 / 1;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);\n}\n.hb-qv3-d { color: #8f8f8f; }\n.hb-qv3-p { color: color-mix(in srgb, var(--hb-qv3-acc) 40%, #ffffff); opacity: 0; transform: translateY(8px); }\n.hb-qv3-t:hover .hb-qv3-d, .hb-qv3-t:focus-visible .hb-qv3-d { opacity: 0; transform: translateY(-8px); }\n.hb-qv3-t:hover .hb-qv3-p, .hb-qv3-t:focus-visible .hb-qv3-p { opacity: 1; transform: translateY(0); }\n.hb-qv3-bars { display: flex; align-items: flex-end; gap: 4px; width: 100%; height: 100%; }\n.hb-qv3-bar {\n  flex: 1;\n  min-width: 0;\n  height: var(--hb-qv3-h);\n  border-radius: 3px 3px 1px 1px;\n  background: linear-gradient(180deg, color-mix(in srgb, var(--hb-qv3-acc) 80%, #ffffff), color-mix(in srgb, var(--hb-qv3-acc) 30%, transparent));\n  transform-origin: bottom;\n  animation: hb-qv3-rise 2.6s ease-in-out infinite;\n  animation-delay: var(--hb-qv3-dl);\n}\n.hb-qv3-tgs { display: flex; align-items: flex-end; gap: 8px; width: 100%; }\n.hb-qv3-tg {\n  position: relative;\n  width: 24px;\n  height: 14px;\n  border-radius: 999px;\n  background: #2a2a2a;\n  animation: hb-qv3-trk 4.2s ease-in-out infinite;\n  animation-delay: var(--hb-qv3-dl);\n}\n.hb-qv3-tg::after {\n  content: \"\";\n  position: absolute;\n  top: 2px;\n  left: 2px;\n  width: 10px;\n  height: 10px;\n  border-radius: 50%;\n  background: #ffffff;\n  animation: hb-qv3-knob 4.2s cubic-bezier(0.4, 1.4, 0.5, 1) infinite;\n  animation-delay: var(--hb-qv3-dl);\n}\n.hb-qv3-av { display: flex; align-items: center; width: 100%; padding-left: 8px; }\n.hb-qv3-a {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 26px;\n  height: 26px;\n  margin-left: -8px;\n  border: 2px solid #111111;\n  border-radius: 50%;\n  font-size: 9px;\n  font-weight: 700;\n  color: #ffffff;\n  background: var(--hb-qv3-c);\n  animation: hb-qv3-bob 3s ease-in-out infinite;\n  animation-delay: var(--hb-qv3-dl);\n}\n.hb-qv3-sp { width: 100%; height: 100%; animation: hb-qv3-draw 4.4s ease-in-out infinite; }\n.hb-qv3-sl {\n  fill: none;\n  stroke: color-mix(in srgb, var(--hb-qv3-acc) 70%, #ffffff);\n  stroke-width: 2;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n.hb-qv3-sa { fill: color-mix(in srgb, var(--hb-qv3-acc) 22%, transparent); stroke: none; }\n@keyframes hb-qv3-rise {\n  0%, 100% { transform: scaleY(1); }\n  50% { transform: scaleY(0.62); }\n}\n@keyframes hb-qv3-trk {\n  0%, 30% { background: #2a2a2a; }\n  40%, 80% { background: var(--hb-qv3-acc); }\n  90%, 100% { background: #2a2a2a; }\n}\n@keyframes hb-qv3-knob {\n  0%, 30% { transform: translateX(0); }\n  40%, 80% { transform: translateX(10px); }\n  90%, 100% { transform: translateX(0); }\n}\n@keyframes hb-qv3-bob {\n  0%, 100% { transform: translateY(0); }\n  50% { transform: translateY(-3px); }\n}\n@keyframes hb-qv3-draw {\n  0% { clip-path: inset(0 100% 0 0); }\n  50%, 82% { clip-path: inset(0 0 0 0); }\n  100% { clip-path: inset(0 0 0 100%); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-qv3-t, .hb-qv3-sf, .hb-qv3-sw > span { transition: none; }\n  .hb-qv3-bar, .hb-qv3-tg, .hb-qv3-tg::after, .hb-qv3-a, .hb-qv3-sp { animation: none; }\n  .hb-qv3-t:hover, .hb-qv3-t:focus-visible { transform: none; }\n}\n`;\n\nfunction hashAt(i: number, mod: number) {\n  return (Math.imul(i + 7, 2654435761) >>> 0) % mod;\n}\n\nfunction Bars() {\n  return (\n    <div className=\"hb-qv3-bars\" aria-hidden=\"true\">\n      {Array.from({ length: 14 }, (_, i) => (\n        <span\n          key={i}\n          className=\"hb-qv3-bar\"\n          style={{ \"--hb-qv3-h\": `${30 + hashAt(i, 66)}%`, \"--hb-qv3-dl\": `${(-i * 0.19).toFixed(2)}s` } as React.CSSProperties}\n        />\n      ))}\n    </div>\n  );\n}\n\nfunction Toggles() {\n  return (\n    <div className=\"hb-qv3-tgs\" aria-hidden=\"true\">\n      {[0, 1, 2].map((i) => (\n        <span key={i} className=\"hb-qv3-tg\" style={{ \"--hb-qv3-dl\": `${(-i * 1.1).toFixed(2)}s` } as React.CSSProperties} />\n      ))}\n    </div>\n  );\n}\n\nfunction Avatars() {\n  return (\n    <div className=\"hb-qv3-av\" aria-hidden=\"true\">\n      {avatarPeople.map((p, i) => (\n        <span\n          key={p.initials}\n          className=\"hb-qv3-a\"\n          style={{ \"--hb-qv3-c\": p.color, \"--hb-qv3-dl\": `${(-i * 0.5).toFixed(2)}s` } as React.CSSProperties}\n        >\n          {p.initials}\n        </span>\n      ))}\n    </div>\n  );\n}\n\nfunction Spark() {\n  return (\n    <svg className=\"hb-qv3-sp\" viewBox=\"0 0 100 30\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n      <path className=\"hb-qv3-sa\" d=\"M0 22 L14 18 L28 24 L42 12 L56 16 L70 7 L84 11 L100 3 L100 30 L0 30 Z\" />\n      <path\n        className=\"hb-qv3-sl\"\n        vectorEffect=\"non-scaling-stroke\"\n        d=\"M0 22 L14 18 L28 24 L42 12 L56 16 L70 7 L84 11 L100 3\"\n      />\n    </svg>\n  );\n}\n\nfunction renderVisual(visual: BentoPointerGlowItem[\"visual\"]) {\n  if (visual === \"bars\") return <Bars />;\n  if (visual === \"toggles\") return <Toggles />;\n  if (visual === \"avatars\") return <Avatars />;\n  if (visual === \"spark\") return <Spark />;\n  if (visual === \"none\" || visual === undefined || visual === null) return null;\n  return visual;\n}\n\nexport function BentoPointerGlow({\n  items = defaultItems,\n  accent = \"#2f7bff\",\n  rowHeight = 132,\n  gap = 10,\n  radius = 18,\n  glowSize = 220,\n  idle = true,\n  className = \"\",\n  style,\n  onPointerMove,\n  onPointerLeave,\n  ...rest\n}: BentoPointerGlowProps) {\n  const ref = React.useRef<HTMLDivElement>(null);\n  const wake = React.useRef<(() => void) | null>(null);\n  const sim = React.useRef({ x: 0, y: 0, tx: 0, ty: 0, k: 0.7, active: false, visible: true, running: false, raf: 0, seeded: false });\n\n  React.useEffect(() => {\n    const grid = ref.current;\n    if (!grid) return;\n    const s = sim.current;\n    const reduced = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n\n    function write() {\n      if (!grid) return;\n      const tiles = grid.children;\n      for (let n = 0; n < tiles.length; n++) {\n        const tile = tiles[n] as HTMLElement;\n        tile.style.setProperty(\"--hb-qv3-mx\", `${(s.x - tile.offsetLeft).toFixed(1)}px`);\n        tile.style.setProperty(\"--hb-qv3-my\", `${(s.y - tile.offsetTop).toFixed(1)}px`);\n      }\n      grid.style.setProperty(\"--hb-qv3-k\", s.k.toFixed(3));\n    }\n\n    function tick(ts: number) {\n      s.running = false;\n      if (!s.visible || !grid) return;\n      const w = grid.clientWidth;\n      const h = grid.clientHeight;\n      if (!s.active && idle) {\n        const t = ts / 1000;\n        s.tx = w * (0.5 + 0.42 * Math.sin(t * 0.55));\n        s.ty = h * (0.5 + 0.36 * Math.sin(t * 0.83 + 1.2));\n      }\n      if (!s.seeded) {\n        s.x = s.tx;\n        s.y = s.ty;\n        s.seeded = true;\n      }\n      s.x += (s.tx - s.x) * 0.12;\n      s.y += (s.ty - s.y) * 0.12;\n      s.k += ((s.active ? 1 : 0.7) - s.k) * 0.1;\n      write();\n      const moving = Math.abs(s.tx - s.x) > 0.3 || Math.abs(s.ty - s.y) > 0.3;\n      if (idle || s.active || moving) {\n        s.running = true;\n        s.raf = requestAnimationFrame(tick);\n      }\n    }\n\n    function ensure() {\n      if (reduced) {\n        s.x = s.tx;\n        s.y = s.ty;\n        write();\n        return;\n      }\n      if (s.running || !s.visible) return;\n      s.running = true;\n      s.raf = requestAnimationFrame(tick);\n    }\n\n    wake.current = ensure;\n    if (reduced) {\n      s.tx = grid.clientWidth * 0.5;\n      s.ty = grid.clientHeight * 0.4;\n    }\n    ensure();\n\n    const io = new IntersectionObserver(([entry]) => {\n      s.visible = entry.isIntersecting;\n      if (s.visible) ensure();\n    });\n    io.observe(grid);\n\n    return () => {\n      wake.current = null;\n      io.disconnect();\n      cancelAnimationFrame(s.raf);\n      s.running = false;\n    };\n  }, [idle, items.length]);\n\n  function aim(e: React.PointerEvent<HTMLDivElement>) {\n    const grid = ref.current;\n    if (!grid) return;\n    const r = grid.getBoundingClientRect();\n    const s = sim.current;\n    s.active = true;\n    s.tx = e.clientX - r.left;\n    s.ty = e.clientY - r.top;\n    wake.current?.();\n  }\n\n  const vars = {\n    \"--hb-qv3-acc\": accent,\n    \"--hb-qv3-row\": `${rowHeight}px`,\n    \"--hb-qv3-gap\": `${gap}px`,\n    \"--hb-qv3-r\": `${radius}px`,\n    \"--hb-qv3-g\": `${glowSize}px`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <>\n      <style href=\"hb-bento-pointer-glow\" precedence=\"default\">{css}</style>\n      <div\n        ref={ref}\n        className={`hb-qv3 ${className}`}\n        style={vars}\n        onPointerMove={(e) => {\n          onPointerMove?.(e);\n          aim(e);\n        }}\n        onPointerLeave={(e) => {\n          onPointerLeave?.(e);\n          sim.current.active = false;\n          wake.current?.();\n        }}\n        {...rest}\n      >\n        {items.map((item) => (\n          <div key={item.id} className=\"hb-qv3-t\" data-size={item.size ?? \"sm\"} tabIndex={0}>\n            <span className=\"hb-qv3-sf\" aria-hidden=\"true\" />\n            <span className=\"hb-qv3-bd\" aria-hidden=\"true\" />\n            <div className=\"hb-qv3-in\">\n              <h3 className=\"hb-qv3-ti\">{item.title}</h3>\n              <div className=\"hb-qv3-vz\">{renderVisual(item.visual)}</div>\n              <div className=\"hb-qv3-sw\">\n                <span className=\"hb-qv3-d\">{item.description}</span>\n                <span className=\"hb-qv3-p\">{item.caption ?? item.description}</span>\n              </div>\n            </div>\n          </div>\n        ))}\n      </div>\n    </>\n  );\n}\n"
    }
  ]
}