import "../../../chunks/chunk.QU3DSPNU.js";
import { createElement, useRef } from "react";
import { GdsCheckbox as GdsCheckboxClass } from "../../../components/checkbox/checkbox.component.js";
import { getReactComponent, useControlledChecked } from "../../../utils/react.js";
const GdsCheckbox = (props) => {
  GdsCheckboxClass.define();
  const JSXElement = getReactComponent("gds-checkbox");
  const internalRef = useRef(null);
  const ref = props.ref || internalRef;
  useControlledChecked(
    ref,
    props.checked,
    props.defaultChecked,
    props.onChange,
    props.onInput
  );
  const { onChange, onInput, ref: _ref, ...restProps } = props;
  const propsWithClass = { ...restProps, class: props.className, ref };
  return createElement(JSXElement, propsWithClass);
};
GdsCheckbox.displayName = "GdsCheckbox";
export {
  GdsCheckbox
};
