import { t as e } from "../chunks/ui.module-BisoTevy.js";
import { l as t, s as n } from "../chunks/input-BCJfUdK_.js";
import { cn as r } from "@ryuzaki13/react-foundation-lib/utils";
import { jsx as i } from "react/jsx-runtime";
var a = { textarea: "TjY2iu" };
//#endregion
//#region src/textarea/Textarea.tsx
function o({ label: o, description: s, className: c, disabled: l, size: u, value: d, onChange: f, error: p, onClearError: m, id: h, ...g }) {
	let { controlId: _, labelId: v, descriptionId: y, errorId: b, describedBy: x } = t({
		id: h,
		hasLabel: o != null,
		hasDescription: !!s,
		hasError: !!p
	});
	return /* @__PURE__ */ i(n, {
		label: o,
		description: s,
		disabled: l,
		size: u,
		error: p,
		controlId: _,
		labelId: v,
		descriptionId: y,
		errorId: b,
		children: /* @__PURE__ */ i("textarea", {
			...g,
			id: _,
			disabled: l,
			value: d,
			"aria-invalid": !!p || void 0,
			"aria-labelledby": v,
			"aria-describedby": x,
			"data-invalid": p ? "" : void 0,
			className: r(e.uiControl, a.textarea, "scrollable", c),
			onChange: (e) => {
				f?.(e.target.value), p && m && m();
			}
		})
	});
}
//#endregion
export { o as Textarea };

//# sourceMappingURL=index.js.map