import "../Input.css";
import { jsx } from "react/jsx-runtime";
import { Input as Input$1 } from "antd";
import { forwardRef } from "react";
import { useInputEscape } from "./internal/useInputEscape.js";
import { useTheme } from "./Theme/UI.js";
import "./Theme/themeUtils.js";
import "./Theme/themes.js";
import { c as css } from "../Inputs.module-PclJ7tln.js";
const Input = forwardRef(
  ({ width, ...props }, ref) => {
    const { onFocus, onBlur, inputRef } = useInputEscape(ref, props.onBlur);
    const {
      themeSettings: { className }
    } = useTheme();
    const classes = (props == null ? void 0 : props.className) ? className.concat(" ", props.className) : className;
    return /* @__PURE__ */ jsx(
      Input$1,
      {
        ...props,
        className: classes,
        ref: inputRef,
        style: { width },
        onBlur,
        onFocus
      }
    );
  }
);
const Group = (props) => {
  const {
    themeSettings: { className }
  } = useTheme();
  const classes = (props == null ? void 0 : props.className) ? className.concat(" ", props.className) : className;
  return /* @__PURE__ */ jsx(Input$1.Group, { ...props, className: classes });
};
Input.Group = Group;
Input.Password = forwardRef((props, ref) => {
  const { onFocus, onBlur, inputRef } = useInputEscape(ref);
  const {
    themeSettings: { className: themeClass }
  } = useTheme();
  return /* @__PURE__ */ jsx(
    Input$1.Password,
    {
      ...props,
      className: [themeClass, css.hasAffix].join(" "),
      ref: inputRef,
      onBlur,
      onFocus
    }
  );
});
Input.TextArea = forwardRef((props, ref) => {
  const { onFocus, onBlur, inputRef } = useInputEscape(ref);
  const {
    themeSettings: { className: themeClass }
  } = useTheme();
  return /* @__PURE__ */ jsx(
    Input$1.TextArea,
    {
      ...props,
      className: themeClass,
      ref: inputRef,
      onBlur,
      onFocus
    }
  );
});
export {
  Input as default
};
