var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React, { forwardRef, useRef, useId } from "react";
import { cn } from "@utils";
import { checkboxVariants, checkboxLabelVariants, checkmarkClipPath } from "./checkboxVariants";
/**
 * A standard checkbox component with multiple size and style variants.
 */
export const Checkbox = forwardRef((_a, ref) => {
    var { id, label, size = "md", variant = "filled", className, disabled } = _a, restProps = __rest(_a, ["id", "label", "size", "variant", "className", "disabled"]);
    const inputId = useRef(useId());
    // Create inline style for the clip-path for the checkmark
    const beforeStyle = {
        clipPath: checkmarkClipPath
    };
    return (_jsxs("div", { className: cn("inline-flex items-center gap-2", className), children: [_jsx("input", Object.assign({ id: id || inputId.current, type: "checkbox", ref: ref, className: cn(checkboxVariants({ variant, size }), "before:[clip-path:var(--checkbox-clip-path)]"), style: { "--checkbox-clip-path": beforeStyle.clipPath }, disabled: disabled }, restProps)), typeof label !== "undefined" && (_jsx("label", { htmlFor: id || inputId.current, className: checkboxLabelVariants({ size, disabled }), children: label }))] }));
});
Checkbox.displayName = "Checkbox";
//# sourceMappingURL=checkbox.js.map