"use client"; import { useState, type CSSProperties, type InputHTMLAttributes } from "react"; import { AnimatePresence, motion, useReducedMotion } from "motion/react"; type CheckboxBloomProps = Omit, "type" | "checked" | "defaultChecked" | "onChange" | "className"> & { /** Text next to the box. */ label: string; /** Small text under the label. */ hint?: string; /** Ticked or not (controlled). */ checked?: boolean; /** Ticked or not at start (uncontrolled). */ defaultChecked?: boolean; /** Called with the new state. */ onChange?: (checked: boolean) => void; /** Box and petal colour. */ accent?: string; /** How many petals burst out. */ petals?: number; /** Wrapper look (width etc.). */ className?: string; }; /* CheckboxBloom: a real checkbox that fills from the centre, draws its tick and throws a ring of petals when ticked. */ export function CheckboxBloom({ label, hint, checked, defaultChecked = false, onChange, accent = "#a78bfa", petals = 8, className = "w-full max-w-xs", ...rest }: CheckboxBloomProps) { const reduce = useReducedMotion(); const [inner, setInner] = useState(defaultChecked); const [bursts, setBursts] = useState(0); const on = checked ?? inner; return ( ); }