@konstructio/ui
Version:
A set of reusable and customizable React components built for konstruct.io
31 lines (30 loc) • 941 B
JavaScript
import { t as m } from "../../utils-COaoD3PI.js";
import { textAreaVariants as h } from "./TextArea.variants.js";
import { forwardRef as u, useId as p } from "react";
import { jsx as e, jsxs as v } from "react/jsx-runtime";
var g = u(({ initialValue: s, label: r, labelWrapperClassName: o, name: i, placeholder: c, rows: d = 3, theme: n, className: f, ...a }, x) => {
const t = p(), l = i ? `${t}-name` : t;
return /* @__PURE__ */ v("div", {
className: "flex flex-col gap-2",
"data-theme": n,
children: [r ? /* @__PURE__ */ e("div", {
className: m(o),
children: /* @__PURE__ */ e("label", {
htmlFor: l,
className: "cursor-pointer",
children: r
})
}) : null, /* @__PURE__ */ e("textarea", {
id: l,
ref: x,
className: m(h({ className: f })),
rows: d,
placeholder: c,
value: s ?? a.value,
...a
})]
});
});
export {
g as TextArea
};