// axi0 Motion 0.2.0: Light streaks. Streaks of light fall down a curved tunnel, bend around the pointer and warp while held.
// Generated from src/light-streaks/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 LightStreaksProps extends HTMLAttributes<HTMLElement> {
  /** the streaks' two colors (default "#f6a04d,#ff6b8b") */
  colors?: string;
  /** how many lanes the streaks fall in (default 70) */
  columns?: number;
  /** how fast they fall (default 1) */
  speed?: number;
  /** fill the nearest positioned parent, behind its content (default false) */
  cover?: boolean;
  children?: ReactNode;
}

const s = (v: unknown) => (v === undefined ? undefined : String(v));
// a present attribute is on; "false" turns off an option that is on by default
const flag = (v: boolean | undefined, d: boolean) => (v === undefined || v === d ? undefined : v ? "" : "false");

export function LightStreaks({ colors, columns, speed, cover, ...rest }: LightStreaksProps) {
  return createElement("axi0-light-streaks", { ...rest, "colors": s(colors), "columns": s(columns), "speed": s(speed), "cover": flag(cover, false) });
}

export default LightStreaks;
