import { Checkbox } from "../../Input/Checkbox.mjs";
import { FormElement } from "./FormElement.mjs";
import { jsx } from "react/jsx-runtime";

//#region src/components/Form/elements/CheckboxElement.tsx
/**
* Wrapper component that converts FormElement's value/onChange pattern
* to checkbox's checked/onChange pattern
*/
const CheckboxComponent = ({ inputLabel, value, onChange, ...props }) => /* @__PURE__ */ jsx(Checkbox, {
	...props,
	label: inputLabel,
	checked: Boolean(value),
	onChange
});
const CheckboxElement = ({ autoComplete, ...props }) => /* @__PURE__ */ jsx(FormElement, {
	Element: CheckboxComponent,
	id: props.name,
	"data-testid": props.name,
	autoComplete,
	...props
});

//#endregion
export { CheckboxElement };
//# sourceMappingURL=CheckboxElement.mjs.map