"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Checkbox = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const constants_1 = require("./constants");
const Icon_1 = require("./Icon");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
exports.Checkbox = (0, react_1.forwardRef)((props, ref) => {
    const { onChange, color, isChecked, indeterminate, isError, disabled, restProps, className, role, style, name, inputRef, value, id, } = (0, useLogic_1.useLogic)(props);
    return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { role: role, "$isDisabled": disabled, "$isError": isError, "$isChecked": isChecked, "$isIndeterminate": indeterminate, className: className, style: style, ref: ref, ...restProps, children: [(0, jsx_runtime_1.jsx)(styles_1.Input, { type: "checkbox", checked: isChecked, disabled: disabled, onChange: onChange, "aria-checked": indeterminate ? 'mixed' : isChecked, "aria-disabled": disabled, name: name, ref: inputRef, value: value, id: id, className: constants_1.checkboxClassnames.input }), (0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { className: constants_1.checkboxClassnames.iconWrapper, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: constants_1.checkboxClassnames.icon, color: color }) })] }));
});
