@primer/react-brand
Version:
Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.
31 lines (30 loc) • 1.39 kB
JavaScript
import e from "../../node_modules/clsx/dist/clsx.js";
import t from "./Textarea.module.js";
import { forwardRef as n } from "react";
import { jsx as r } from "react/jsx-runtime";
//#region src/forms/Textarea/Textarea.tsx
var i = 7, a = 30, o = "both", s = {
root: "Textarea",
get outerContainer() {
return `${this.root}-outer-container`;
}
}, c = n(({ children: n, className: i, cols: a = 30, disabled: c, fullWidth: l = !1, invisible: u = !1, monospace: d, placeholder: f, size: p = "medium", validationStatus: m, required: h, resize: g = o, rows: _ = 7, ...v }, y) => /* @__PURE__ */ r("span", {
className: e(t["Textarea-wrapper"], l && t["Textarea-wrapper--fullWidth"], u && t["Textarea-wrapper--invisible"], c && t["Textarea-wrapper--disabled"], d && t["Textarea-wrapper--monospace"], m && t[`Textarea-wrapper--${m}`]),
"data-testid": s.outerContainer,
children: /* @__PURE__ */ r("textarea", {
ref: y,
className: e(t.Textarea, "Textarea", t[`Textarea--${p}`], t[`Textarea-resize--${g}`], l && t["Textarea--fullWidth"], m && t[`Textarea--${m}`], i),
placeholder: f,
disabled: c,
"aria-invalid": m === "error",
required: h,
rows: _,
cols: a,
...v,
children: n
})
}));
c.displayName = "Textarea";
//#endregion
export { a as DEFAULT_TEXTAREA_COLS, o as DEFAULT_TEXTAREA_RESIZE, i as DEFAULT_TEXTAREA_ROWS, c as Textarea };
//# sourceMappingURL=Textarea.js.map