// axi0 Motion 0.2.0: Dust type. The text gathers out of drifting dust; the pointer scatters it and a click blows it apart before it settles back.
// Generated from src/dust-type/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 DustTypeProps extends HTMLAttributes<HTMLElement> {
  /** Dust per letter height (default 18) */
  density?: number;
  /** Grain size (default 1.8) */
  size?: number;
  /** Reach of the pointer (default 80) */
  radius?: number;
  /** Color of moving grains (default "#f6a04d") */
  color?: string;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function DustType({ as = "div", density, size, radius, color, ...rest }: DustTypeProps) {
  return createElement(as, { ...rest, "data-motion": "dust-type", "data-motion-density": s(density), "data-motion-size": s(size), "data-motion-radius": s(radius), "data-motion-color": s(color) });
}

export default DustType;
