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