'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var formik = require('formik');
var ramda = require('ramda');
var Input = require('../Input-CpuJXazH.js');
require('../utils-BhM0B89p.js');
require('../primitives/Field.js');
require('../index-vioSzJOw.js');
require('../label-DJ7KkKYy.js');
require('../index-DMbj7vXd.js');
require('react-dom');
require('../index-D-iDn9RI.js');
require('../separator-DSL-aG1J.js');
require('../primitives/InputGroup.js');
require('../input-group-8TZFHzVl.js');
require('../button-CMl9rLXi.js');
require('../index-DuNgWCXZ.js');
require('../input-BlyvDsZ5.js');
require('../textarea-Br-J3v7z.js');

const FormikInput = React.forwardRef(
  ({ name, onChange: onChangeProp, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx(formik.Field, { name, children: ({ field, meta, form }) => {
    const { status = {}, setStatus } = form;
    const fieldStatus = formik.getIn(status, name);
    const fieldProps = {
      ...field,
      onChange: (e) => {
        setStatus(ramda.dissoc(name, status));
        field.onChange(e);
        onChangeProp?.(e);
      }
    };
    return /* @__PURE__ */ jsxRuntime.jsx(
      Input.Input,
      {
        ref,
        ...fieldProps,
        error: meta.touched ? meta.error || fieldStatus : "",
        ...rest
      }
    );
  } })
);
FormikInput.displayName = "FormikInput";

exports.FormikInput = FormikInput;
//# sourceMappingURL=Input.js.map
