// packages/components/src/validated-form-controls/components/range-control.tsx
import { useMergeRefs } from "@wordpress/compose";
import { forwardRef, useRef } from "@wordpress/element";
import { ControlWithError } from "../control-with-error.js";
import RangeControl from "../../range-control/index.js";
import { jsx as _jsx } from "react/jsx-runtime";
var UnforwardedValidatedRangeControl = ({
  required,
  customValidity,
  markWhenOptional,
  ...restProps
}, forwardedRef) => {
  const validityTargetRef = useRef(null);
  const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
  return /* @__PURE__ */ _jsx(ControlWithError, {
    required,
    markWhenOptional,
    customValidity,
    getValidityTarget: () => validityTargetRef.current,
    children: /* @__PURE__ */ _jsx(RangeControl, {
      __next40pxDefaultSize: true,
      ref: mergedRefs,
      ...restProps
    })
  });
};
var ValidatedRangeControl = forwardRef(UnforwardedValidatedRangeControl);
export {
  ValidatedRangeControl
};
//# sourceMappingURL=range-control.js.map
