"use client"; import { useId, useState, type ButtonHTMLAttributes } from "react"; import "./gel-toggle.css"; /** * Gel Toggle * A switch whose thumb is a drop of gel. It leaves with a stretch — the front of the drop runs * ahead and the back catches up through a gooey bridge — and squashes when it lands, while the * track fills behind it with a wobbling meniscus. */ type Props = Omit, "onChange"> & { checked?: boolean; defaultChecked?: boolean; onChange?: (on: boolean) => void; label: string; accent?: string; }; export function GelToggle({ checked, defaultChecked = false, onChange, label, accent = "#34c77b", className = "", ...rest }: Props) { const [inner, setInner] = useState(defaultChecked); const on = checked ?? inner; const [beat, setBeat] = useState(0); const goo = `gel-${useId().replace(/:/g, "")}`; return ( ); }