// axi0 Motion 0.2.0: Tick check. A checkbox row where one spring fills the box, draws the tick and strikes through the label.
// Generated from src/tick-check/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 TickCheckProps extends HTMLAttributes<HTMLElement> {
  /** strike through the label when checked (default true) */
  strike?: boolean;
  /** the fill (empty: the accent) (default auto) */
  color?: string;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function TickCheck({ as = "div", strike, color, ...rest }: TickCheckProps) {
  return createElement(as, { ...rest, "data-motion": "tick-check", "data-motion-strike": s(strike), "data-motion-color": s(color) });
}

export default TickCheck;
