| 1 |
import{a as x,r as e,j as m}from"./main-96.js";import{F as w}from"./bf-460-326.js";const y={section:{flx:"center-between",mx:10,mt:5,mb:15,brs:8,fw:600},flxColumn:{fd:"column",jc:"start !important",ai:"self-start"},mainTitle:{fs:16,fw:700,tt:"capitalize"},titleWrapper:{flx:"center-between",w:"100%",bb:"1px solid var(--bf-stroke-clr)",pb:10},fieldKey:{fs:"var(--bf-font-base)",cr:"var(--bf-secondary-700)",mr:5},btn:{oe:"none",flx:"center",tn:"background 0.2s",lh:"1.2 !important",bc:"none",px:4,brs:8,cur:"pointer",cr:"var(--white-0-50)",bd:"none !important",b:"none",pl:"0 !important",ml:"-5px",mb:5,fw:400,fs:12,":hover":{cr:"var(--b-50)"},":focus-visible":{focusShadow:1}},fixed:{pn:"sticky",tp:"0",bd:"var(--white-100)",zx:3},shw:{bs:"rgb(123 123 123) 0px 7px 7px -9px"}},A=({id:n,testId:o,name:c,className:i,ariaLabel:a,placeholder:u,changeAction:f,value:r,rows:l=1,maxRow:b=3})=>{const{css:p}=x(),t=e.useRef(null),s=()=>{for(;t.current.getAttribute("rows")<b&&t.current.offsetHeight<t.current.scrollHeight;)t.current.setAttribute("rows",Number(t.current.getAttribute("rows"))+1)},h=()=>{for(t.current.style.height=`${t.current.offsetHeight-1}px`;t.current.offsetHeight>=t.current.scrollHeight&&t.current.getAttribute("rows")>1;)t.current.setAttribute("rows",Number(t.current.getAttribute("rows"))-1),t.current.style.height="unset",t.current.style.height=`${t.current.offsetHeight-1}px`;t.current.style.height="unset"};return e.useEffect(()=>{s()},[]),e.useEffect(()=>{h(),s()},[r]),m.jsx("textarea",{"data-testid":`${o||n}-ato-siz-inp`,"aria-label":a,ref:t,name:c,className:`${p(w.input,{ow:"auto",re:"height"})} ${i}`,placeholder:u,value:r,rows:l,onChange:f})};export{A,y as s}; |