// axi0 Motion 0.2.0: Bento glow. A grid of cards lit by one light that follows the pointer across them, catching every nearby edge, with a wave of light on click.
// Generated from src/bento-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 BentoGlowProps extends HTMLAttributes<HTMLElement> {
  /** Color of the light (default "#f6a04d") */
  color?: string;
  /** How far the light reaches from the pointer (default 260) */
  radius?: number;
  /** Send a wave of light through the cards on click or tap (default true) */
  wave?: boolean;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function BentoGlow({ as = "div", color, radius, wave, ...rest }: BentoGlowProps) {
  return createElement(as, { ...rest, "data-motion": "bento-glow", "data-motion-color": s(color), "data-motion-radius": s(radius), "data-motion-wave": s(wave) });
}

export default BentoGlow;
