// axi0 Motion 0.2.0: Edge glow. A gradient border glows on the side nearest the pointer, brightest at the edge.
// Generated from src/edge-glow/meta.json by motion-pack: a thin wrapper. The loader (motion.js) must be on the page once;
// it starts the effect on the element this renders. Options left out keep the effect's own defaults.
import { createElement } from "react";
import type { HTMLAttributes, ReactNode } from "react";

export interface EdgeGlowProps extends HTMLAttributes<HTMLElement> {
  /** up to three hex colors along the lit arc (default "#f6a04d,#ff6b8b,#8a7dff") */
  colors?: string;
  /** the ring's width in pixels (default 2) */
  width?: number;
  /** the blur of the glow in pixels (default 16) */
  glow?: number;
  /** how far outside the element, in pixels, the pointer still lights it (default 90) */
  reach?: number;
  /** half the lit arc, in degrees (default 80) */
  spread?: number;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

const s = (v: unknown) => (v === undefined ? undefined : String(v));

export function EdgeGlow({ as = "div", colors, width, glow, reach, spread, ...rest }: EdgeGlowProps) {
  return createElement(as, { ...rest, "data-motion": "edge-glow", "data-motion-colors": s(colors), "data-motion-width": s(width), "data-motion-glow": s(glow), "data-motion-reach": s(reach), "data-motion-spread": s(spread) });
}

export default EdgeGlow;
