'use strict';

const jsxRuntime = require('react/jsx-runtime');
const checkbox = require('../../checkbox.cjs');
const form = require('../../form.cjs');
const tooltip = require('../common/tooltip.cjs');
const label = require('../common/label.cjs');

function AutoFormCheckbox({
  label: label$1,
  isRequired,
  field,
  fieldConfigItem,
  fieldProps
}) {
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
    /* @__PURE__ */ jsxRuntime.jsx(form.FormItem, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-center gap-3", children: [
      /* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
        checkbox.Checkbox,
        {
          checked: field.value,
          onCheckedChange: field.onChange,
          ...fieldProps
        }
      ) }),
      /* @__PURE__ */ jsxRuntime.jsx(
        label,
        {
          label: fieldConfigItem?.label || label$1,
          isRequired
        }
      )
    ] }) }),
    /* @__PURE__ */ jsxRuntime.jsx(tooltip, { fieldConfigItem })
  ] });
}

module.exports = AutoFormCheckbox;
