import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import classNames from 'classnames';
import { useRef } from 'react';
import { CheckboxBlankIcon } from '../../lib/icons/CheckboxBlank.js';
import { CheckboxFilledIcon } from '../../lib/icons/CheckboxFilled.js';
export function Checkbox({ label, checked, onChange, className, }) {
    const inputRef = useRef(null);
    const toggle = () => {
        if (inputRef.current != null) {
            inputRef.current.click();
        }
    };
    return (_jsxs("div", { className: classNames('seam-checkbox', className), onClick: toggle, children: [_jsx("span", { className: 'seam-checkbox-icon', children: checked === true ? _jsx(CheckboxFilledIcon, {}) : _jsx(CheckboxBlankIcon, {}) }), _jsx("input", { type: 'checkbox', ref: inputRef, onChange: (event) => {
                    onChange(event.target.checked);
                }, checked: checked }), _jsx("span", { className: ' seam-checkbox-label', children: label })] }));
}
//# sourceMappingURL=Checkbox.js.map