{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "aurora",
  "title": "Aurora",
  "description": "Slow, soft light drifting behind its content, from three radial gradients.",
  "registryDependencies": [
    "@corsair-ui/utils",
    "@corsair-ui/use-in-view"
  ],
  "files": [
    {
      "path": "registry/default/ui/aurora.tsx",
      "content": "\"use client\";\n\nimport { useMemo, type ComponentProps, type Ref } from \"react\";\n\nimport { useInView } from \"@/registry/default/hooks/use-in-view\";\nimport { cn } from \"@/registry/default/lib/utils\";\n\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]) {\n  return (node: T | null) => {\n    for (const ref of refs) {\n      if (typeof ref === \"function\") ref(node);\n      else if (ref) ref.current = node;\n    }\n  };\n}\n\n// Where each light starts, how much slower than `duration` it drifts, and\n// how far into its drift it begins, so the three never move in step.\nconst LIGHTS = [\n  { left: \"-15%\", top: \"-30%\", pace: 1, start: 0 },\n  { left: \"40%\", top: \"-15%\", pace: 1.35, start: -0.3 },\n  { left: \"10%\", top: \"35%\", pace: 1.7, start: -0.65 },\n];\n\ninterface AuroraProps extends ComponentProps<\"div\"> {\n  /** Three CSS colours, one per light. Theme variables work. */\n  colors?: [string, string, string];\n  /** Seconds for the fastest light to finish one drift. */\n  duration?: number;\n  /** Opacity of the lights, from 0 to 1. */\n  intensity?: number;\n}\n\n/**\n * Slow, soft light drifting behind its content. Three radial gradients\n * moved with transforms only: no blur filters, no canvas. The lights pause\n * while off screen and hold still with `prefers-reduced-motion`.\n *\n * @example\n * <Aurora className=\"rounded-xl border p-10\" colors={[\"#38bdf8\", \"#a78bfa\", \"#f472b6\"]}>\n *   <h2>…</h2>\n * </Aurora>\n */\nfunction Aurora({\n  colors = [\"var(--primary)\", \"var(--muted-foreground)\", \"var(--accent-foreground)\"],\n  duration = 20,\n  intensity = 0.3,\n  className,\n  children,\n  ref,\n  ...props\n}: AuroraProps) {\n  const [observe, inView] = useInView<HTMLDivElement>({ rootMargin: \"200px\" });\n  const mergedRef = useMemo(() => mergeRefs(ref, observe), [ref, observe]);\n\n  return (\n    <div\n      ref={mergedRef}\n      data-slot=\"aurora\"\n      className={cn(\"relative isolate overflow-hidden\", className)}\n      {...props}\n    >\n      <div\n        aria-hidden=\"true\"\n        data-slot=\"aurora-lights\"\n        className=\"pointer-events-none absolute inset-0 -z-10\"\n      >\n        {LIGHTS.map((light, index) => (\n          <span\n            key={index}\n            className=\"animate-aurora absolute size-[75%] rounded-full motion-reduce:animate-none\"\n            style={{\n              left: light.left,\n              top: light.top,\n              background: `radial-gradient(closest-side, ${colors[index]}, transparent)`,\n              opacity: intensity,\n              animationDuration: `${duration * light.pace}s`,\n              animationDelay: `${duration * light.start}s`,\n              animationPlayState: inView ? \"running\" : \"paused\",\n            }}\n          />\n        ))}\n      </div>\n      {children}\n    </div>\n  );\n}\n\nexport { Aurora, type AuroraProps };\n",
      "type": "registry:ui"
    }
  ],
  "tailwind": {
    "config": {
      "theme": {
        "extend": {
          "keyframes": {
            "aurora": {
              "0%, 100%": {
                "transform": "translate3d(0, 0, 0) rotate(0deg) scale(1)"
              },
              "33%": {
                "transform": "translate3d(8%, 6%, 0) rotate(12deg) scale(1.08)"
              },
              "66%": {
                "transform": "translate3d(-6%, 10%, 0) rotate(-8deg) scale(0.96)"
              }
            }
          },
          "animation": {
            "aurora": "aurora 20s ease-in-out infinite"
          }
        }
      }
    }
  },
  "cssVars": {
    "theme": {
      "animate-aurora": "aurora 20s ease-in-out infinite"
    }
  },
  "css": {
    "@keyframes aurora": {
      "0%, 100%": {
        "transform": "translate3d(0, 0, 0) rotate(0deg) scale(1)"
      },
      "33%": {
        "transform": "translate3d(8%, 6%, 0) rotate(12deg) scale(1.08)"
      },
      "66%": {
        "transform": "translate3d(-6%, 10%, 0) rotate(-8deg) scale(0.96)"
      }
    }
  },
  "categories": [
    "creative",
    "background"
  ],
  "type": "registry:ui"
}