"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    CheckboxField: ()=>CheckboxField_CheckboxField
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
const external_react_namespaceObject = require("react");
const CheckboxField_CheckboxField = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ field, value, onChange, error }) {
    const handleChange = (0, external_react_namespaceObject.useCallback)((e)=>{
        onChange(e.target.checked);
    }, [
        onChange
    ]);
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
        className: "flex flex-col gap-1",
        children: [
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                className: (0, apollo_wind_namespaceObject.cn)('py-2 rounded transition', field.disabled ? 'opacity-50 cursor-not-allowed' : 'hover:bg-(--canvas-background-hover)'),
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("label", {
                    className: (0, apollo_wind_namespaceObject.cn)('flex items-center text-[13px] text-(--canvas-foreground) select-none', field.disabled ? 'cursor-not-allowed' : 'cursor-pointer'),
                    children: [
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
                            className: "nodrag size-[18px] mr-2 cursor-pointer disabled:cursor-not-allowed accent-(--canvas-primary)",
                            type: "checkbox",
                            checked: !!value,
                            onChange: handleChange,
                            disabled: field.disabled
                        }),
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                            children: field.label
                        }),
                        field.icon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                            className: "ml-2",
                            children: field.icon
                        })
                    ]
                })
            }),
            field.helpText && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                className: "text-[12px] text-(--canvas-foreground-de-emp) block ml-[26px]",
                children: field.helpText
            }),
            error && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                className: "text-[12px] text-(--canvas-error-text) block ml-[26px]",
                children: error
            })
        ]
    });
});
exports.CheckboxField = __webpack_exports__.CheckboxField;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "CheckboxField"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
