// axi0 Motion 0.2.0: Color lens. Grayscale cards get their color back under a soft lens that follows the pointer.
// Generated from src/color-lens/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 ColorLensProps extends HTMLAttributes<HTMLElement> {
  /** the lens radius in pixels (default 260) */
  radius?: number;
  /** how much darker the gray part is, 0 to 1 (default 0.22) */
  dim?: number;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function ColorLens({ as = "div", radius, dim, ...rest }: ColorLensProps) {
  return createElement(as, { ...rest, "data-motion": "color-lens", "data-motion-radius": s(radius), "data-motion-dim": s(dim) });
}

export default ColorLens;
