| 1 |
import{a as h,r as e,j as x}from"./main-634.js";import{F as w}from"./bf-767-388.js";const m={section:{flx:"center-between",mx:10,mt:5,mb:15,brs:8,fw:600},flxColumn:{fd:"column",jc:"start !important",ai:"self-start"},title:{fs:14,fw:600},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},divider:{my:0,mx:10,bb:"0.5px solid var(--white-0-83)"},subtitle:{fs:12,fw:400},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"}};var y=m;const g=({id:n,name:i,className:o,ariaLabel:c,placeholder:a,changeAction:u,value:r,rows:f=1,maxRow:l=3})=>{const{css:b}=h(),t=e.useRef(null),s=()=>{for(;t.current.getAttribute("rows")<l&&t.current.offsetHeight<t.current.scrollHeight;)t.current.setAttribute("rows",Number(t.current.getAttribute("rows"))+1)},p=()=>{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(()=>{p(),s()},[r]),x.jsx("textarea",{"data-testid":`${n}-ato-siz-inp`,"aria-label":c,ref:t,name:i,className:`${b(w.input,{ow:"auto",re:"height"})} ${o}`,placeholder:a,value:r,rows:f,onChange:u})};var A=g;export{A,y as s}; |