import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import TextBase from "../text";
import { Row } from "../grid";
import Space from "../space";
import { Checkbox as CheckboxWrapper, Wrapper } from "./styled";
import { Check } from "./icons";
const Checkbox = ({ checked, onChange, label, disabled, error, customCheckedIcon, ...rest }) => {
    return (_jsx(Wrapper, { ...rest, children: label ? (_jsxs(Row, { alignItems: "center", className: "ui-checkbox__row", noWrap: true, children: [_jsx(CheckboxWrapper, { onClick: !disabled ? () => onChange(checked) : undefined, className: `ui-checkbox__item ${disabled ? "ui-checkbox__item__disabled" : ""}`, disabled: disabled, error: error, children: checked && (customCheckedIcon ?? _jsx(Check, { disabled: disabled })) }), _jsx(Space, { width: 8, widthMobile: 8, height: 0, heightMobile: 0 }), _jsx(TextBase.F2, { className: `ui-checkbox__label ${disabled ? "ui-checkbox__label__disabled" : ""} ${error ? "ui-checkbox__label__error" : ""}`, children: label })] })) : (_jsx(CheckboxWrapper, { onClick: !disabled ? () => onChange(checked) : undefined, className: `ui-checkbox__item ${disabled ? "ui-checkbox__item__disabled" : ""}`, disabled: disabled, children: checked && (customCheckedIcon ?? _jsx(Check, { disabled: disabled })) })) }));
};
export default Checkbox;
//# sourceMappingURL=index.js.map