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