"use client";
import { jsx as i } from "react/jsx-runtime";
import { i as C } from "./input-Dqvc2AB_.js";
import { c as b } from "./cn-Bhsu1vx2.js";
import * as x from "react";
import { useCallback as I } from "react";
import { F as y } from "./field-V3J0Ql_V.js";
const N = x.forwardRef(
  (c, l) => {
    const {
      className: m,
      onValueChange: r,
      size: p = "base",
      variant: u = "default",
      onChange: e,
      label: t,
      labelTooltip: f,
      description: d,
      error: a,
      ...o
    } = c, { required: h } = o, g = I(
      (n) => {
        e?.(n), r?.(n.target.value);
      },
      [e, r]
    ), s = /* @__PURE__ */ i(
      "textarea",
      {
        ref: l,
        className: b(
          C({ size: p, variant: u, focusIndicator: !0 }),
          "h-auto py-2",
          // Input variant always come with size, but it does not apply for textarea
          m
        ),
        onChange: g,
        ...o
      }
    );
    return t ? /* @__PURE__ */ i(
      y,
      {
        label: t,
        required: h,
        labelTooltip: f,
        description: d,
        error: a ? typeof a == "string" ? { message: a, match: !0 } : a : void 0,
        children: s
      }
    ) : s;
  }
);
N.displayName = "InputArea";
export {
  N as I
};
//# sourceMappingURL=input-area-B9qajxvZ.js.map
