"use client";
import { jsx as e } from "react/jsx-runtime";
import { i as y } from "./input-lpa5fc75tgrraafv.js";
import { c as N } from "./cn-ct4n7r74mh8y0f48.js";
import * as x from "react";
import { useCallback as I } from "react";
import { F as b } from "./field-lnj619xpe8zjd26r.js";
import { aT as w } from "./vendor-base-ui-ie71jahf0czyf58j.js";
const c = x.forwardRef(
  (u, t) => {
    const {
      className: d,
      onValueChange: n,
      size: f = "base",
      variant: s,
      onChange: i,
      label: p,
      labelTooltip: h,
      description: g,
      error: r,
      ...o
    } = u;
    process.env.NODE_ENV !== "production" && s === "error" && console.warn(
      '[Kumo InputArea]: variant="error" is deprecated. Error styling is now automatically applied when the `error` prop is truthy. Simply remove the variant prop and pass an error message instead.'
    );
    const v = s ?? (r ? "error" : "default"), { required: C } = o, l = I(
      (a) => {
        i?.(a), n?.(a.target.value);
      },
      [i, n]
    ), m = N(
      y({ size: f, variant: v, focusIndicator: !0 }),
      "h-auto py-2",
      // Input variant always comes with size, but it does not apply for textarea
      d
    );
    return p ? /* @__PURE__ */ e(
      b,
      {
        label: p,
        required: C,
        labelTooltip: h,
        description: g,
        error: r ? typeof r == "string" ? { message: r, match: !0 } : r : void 0,
        children: /* @__PURE__ */ e(
          w,
          {
            render: (a) => /* @__PURE__ */ e(
              "textarea",
              {
                ...a,
                ref: t,
                className: m,
                onChange: l,
                ...o
              }
            )
          }
        )
      }
    ) : /* @__PURE__ */ e(
      "textarea",
      {
        ref: t,
        className: m,
        onChange: l,
        ...o
      }
    );
  }
);
c.displayName = "InputArea";
const j = c;
export {
  c as I,
  j as T
};
//# sourceMappingURL=input-area-h8xbqturegdfm1mi.js.map
