"use strict";const r=require("react/jsx-runtime"),j=require("react"),y=require("./field-error-text-FhQulSV5.js"),O=require("./field-helper-text-DSKO-Tce.js"),R=require("./label-yHK80hhV.js");require("./ThemeProvider-djmNDpmy.js");require("change-case");const T=require("./useColorScheme-DwlZAnlk.js"),A=require("./bind-DeUYJ6m9.js"),s={"purpur-text-area":"_purpur-text-area_1qqf0_1","purpur-text-area__label":"_purpur-text-area__label_1qqf0_8","purpur-text-area__label-text":"_purpur-text-area__label-text_1qqf0_13","purpur-text-area__frame":"_purpur-text-area__frame_1qqf0_16","purpur-text-area__textarea-container":"_purpur-text-area__textarea-container_1qqf0_23","purpur-text-area__textarea-container--disabled":"_purpur-text-area__textarea-container--disabled_1qqf0_33","purpur-text-area__textarea-container--readonly":"_purpur-text-area__textarea-container--readonly_1qqf0_36","purpur-text-area__textarea":"_purpur-text-area__textarea_1qqf0_23","purpur-text-area__textarea--light":"_purpur-text-area__textarea--light_1qqf0_52","purpur-text-area__textarea--dark":"_purpur-text-area__textarea--dark_1qqf0_60","purpur-text-area__textarea--valid":"_purpur-text-area__textarea--valid_1qqf0_91","purpur-text-area__textarea--error":"_purpur-text-area__textarea--error_1qqf0_91"},c={NONE:"none",BOTH:"both",HORIZONTAL:"horizontal",VERTICAL:"vertical"},l=A.c.bind(s),e="purpur-text-area",p=j.forwardRef(({id:i,["data-testid"]:x,className:o,errorText:t,helperText:n,label:d,rows:q=3,cols:b=90,resize:f=c.BOTH,style:h,...a},m)=>{const[$]=T.useColorScheme(),_=N=>x?`${x}-${N}`:void 0,u=n?`${i}-helper-text`:void 0,v=l(`${e}__textarea-container`,{[`${e}__textarea-container--disabled`]:a.disabled,[`${e}__textarea-container--readonly`]:a.readOnly&&!a.disabled});return r.jsxs("div",{className:l(o,e),"data-testid":x,children:[d&&r.jsxs(R.Label,{htmlFor:i,disabled:a.disabled,className:s[`${e}__label`],"data-testid":_("label"),children:[a.required&&r.jsx("span",{"aria-hidden":!0,children:"*"}),d]}),r.jsxs("div",{className:v,children:[r.jsx("textarea",{...a,ref:m,id:i,"data-testid":_("textarea"),"aria-describedby":a["aria-describedby"]||u,"aria-invalid":a["aria-invalid"]||!!t,className:l(`${e}__textarea`,`${e}__textarea--${$}`,{[`${e}__textarea--error`]:!!t}),rows:q,cols:b,style:{resize:f,...h}}),r.jsx("div",{className:s[`${e}__frame`]})]}),u&&r.jsx(O.FieldHelperText,{"data-testid":_("helper-text"),id:u,children:n}),t&&r.jsx(y.FieldErrorText,{"data-testid":_("error-text"),children:t})]})});p.displayName="TextArea";exports.ResizeOption=c;exports.TextArea=p;
//# sourceMappingURL=text-area-C4mcG5c0.js.map
