// axi0 Motion 0.2.0: Light column. A swirling pillar of light ignites, leans toward the pointer and surges on a click.
// Generated from src/light-column/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 LightColumnProps extends HTMLAttributes<HTMLElement> {
  /** the color at the foot and at the top (default "#f6a04d,#8a7dff") */
  colors?: string;
  /** the pillar's width, as a share of the box height (default 0.13) */
  width?: number;
  /** how fast it swirls (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 LightColumn({ colors, width, speed, cover, ...rest }: LightColumnProps) {
  return createElement("axi0-light-column", { ...rest, "colors": s(colors), "width": s(width), "speed": s(speed), "cover": flag(cover, false) });
}

export default LightColumn;
