import { jsx } from "react/jsx-runtime";
import { DSComboBox } from "@elliemae/ds-controlled-form";
import {
  Controller
} from "react-hook-form";
const ComboBoxV3 = ({
  name,
  defaultValue = null,
  rules = {},
  clearable = true,
  filteredOptions = null,
  ...rest
}) => /* @__PURE__ */ jsx(
  Controller,
  {
    name,
    rules,
    defaultValue,
    render: ({
      field: { onChange, value, ...props },
      fieldState: { error }
    }) => /* @__PURE__ */ jsx(
      DSComboBox,
      {
        ...props,
        ...rest,
        hasError: !!error,
        filteredOptions,
        selectedValues: value,
        onChange,
        isNonClearable: !clearable
      }
    )
  }
);
export {
  ComboBoxV3
};
