{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "glow-grid",
  "title": "Glow Grid",
  "author": "VenusUI",
  "description": "Cards whose borders light up near the pointer, as if a light moved across them.",
  "files": [
    {
      "path": "registry/default/ui/glow-grid.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface GlowGridProps extends React.ComponentProps<\"div\"> {\n  /** Color of the light on the borders. Any CSS color. */\n  color?: string\n}\n\n/**\n * A grid of `GlowCard`s whose borders light up near the pointer, as if a\n * light were moving across them. Lay it out with grid classes. Without a\n * pointer (touch, keyboard) the cards look like normal cards.\n */\nfunction GlowGrid({ color = \"oklch(0.75 0.17 290)\", className, style, children, ...props }: GlowGridProps) {\n  const ref = React.useRef<HTMLDivElement>(null)\n\n  React.useEffect(() => {\n    const grid = ref.current\n    if (!grid) return\n    let frame = 0\n    let x = 0\n    let y = 0\n    const update = () => {\n      frame = 0\n      for (const card of grid.querySelectorAll<HTMLElement>(\"[data-slot=glow-card]\")) {\n        const rect = card.getBoundingClientRect()\n        card.style.setProperty(\"--glow-x\", `${x - rect.left}px`)\n        card.style.setProperty(\"--glow-y\", `${y - rect.top}px`)\n      }\n    }\n    const onMove = (event: PointerEvent) => {\n      if (event.pointerType === \"touch\") return\n      x = event.clientX\n      y = event.clientY\n      grid.style.setProperty(\"--glow\", \"1\")\n      if (!frame) frame = requestAnimationFrame(update)\n    }\n    const onLeave = () => grid.style.setProperty(\"--glow\", \"0\")\n    grid.addEventListener(\"pointermove\", onMove, { passive: true })\n    grid.addEventListener(\"pointerleave\", onLeave)\n    return () => {\n      cancelAnimationFrame(frame)\n      grid.removeEventListener(\"pointermove\", onMove)\n      grid.removeEventListener(\"pointerleave\", onLeave)\n    }\n  }, [])\n\n  return (\n    <div\n      ref={ref}\n      data-slot=\"glow-grid\"\n      className={cn(\"grid gap-3\", className)}\n      style={{ \"--glow-color\": color, ...style } as React.CSSProperties}\n      {...props}\n    >\n      {children}\n    </div>\n  )\n}\n\n/** A card inside `GlowGrid`. Accepts all `<div>` props. */\nfunction GlowCard({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"glow-card\"\n      className={cn(\n        \"relative isolate rounded-xl border bg-card p-5 text-card-foreground\",\n        // The lit border: a radial light, masked to a 1px ring.\n        \"before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:p-px before:opacity-(--glow,0) before:transition-opacity before:duration-300\",\n        \"before:[background:radial-gradient(260px_circle_at_var(--glow-x,-999px)_var(--glow-y,-999px),var(--glow-color),transparent_70%)]\",\n        \"before:[mask:linear-gradient(#000_0_0)_content-box_exclude,linear-gradient(#000_0_0)]\",\n        // A faint wash inside.\n        \"after:pointer-events-none after:absolute after:inset-0 after:-z-10 after:rounded-[inherit] after:opacity-(--glow,0) after:transition-opacity after:duration-300\",\n        \"after:[background:radial-gradient(320px_circle_at_var(--glow-x,-999px)_var(--glow-y,-999px),color-mix(in_oklch,var(--glow-color)_10%,transparent),transparent_70%)]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { GlowGrid, GlowCard, type GlowGridProps }\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "cards",
    "effects",
    "interactive"
  ],
  "type": "registry:ui"
}