"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const TextareaAutosize = require("react-textarea-autosize");
require("react");
const getEnv = require("../../core/utils/get-env/get-env.cjs");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const factory = require("../../core/factory/factory.cjs");
const InputBase = require("../InputBase/InputBase.cjs");
const defaultProps = {};
const Textarea = factory.factory((props, ref) => {
  const { autosize, maxRows, minRows, __staticSelector, resize, ...others } = useProps.useProps(
    "Textarea",
    defaultProps,
    props
  );
  const shouldAutosize = autosize && getEnv.getEnv() !== "test";
  const autosizeProps = shouldAutosize ? { maxRows, minRows } : {};
  return /* @__PURE__ */ jsxRuntime.jsx(
    InputBase.InputBase,
    {
      component: shouldAutosize ? TextareaAutosize : "textarea",
      ref,
      ...others,
      __staticSelector: __staticSelector || "Textarea",
      multiline: true,
      "data-no-overflow": autosize && maxRows === void 0 || void 0,
      __vars: { "--input-resize": resize },
      ...autosizeProps
    }
  );
});
Textarea.classes = InputBase.InputBase.classes;
Textarea.displayName = "@mantine/core/Textarea";
exports.Textarea = Textarea;
