import{r as j,f as $,j as e,aq as k,B as v}from"./index-952e178b.js";import{C as A}from"./index.esm-6feddb16.js";import{T as E,I as T,a as w}from"./TextField-d1a887ff.js";function y({control:x,id:c,label:p,name:t,minRows:m=3,maxRows:b=3,placeholder:h,helperText:n,containerSx:g,onChange:a,required:F,disabled:f,readOnly:B,...I}){const s={50:"#F3F6F9",100:"#E5EAF2",200:"#DAE2ED",300:"#C7D0DD",400:"#B0B8C4",500:"#9DA8B7",600:"#6B7A90",700:"#434D5B",800:"#303740",900:"#1C2025"},l={200:"#FFCDD2",600:"#fc0000"},D=$(E,{shouldForwardProp:r=>r!=="error"})(({theme:r,error:o})=>`
    box-sizing: border-box;
    width: 100%;
    font-family: "initial";
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 8px;
    color: ${r.palette.mode==="dark"?s[300]:s[900]};
    background: ${r.palette.background.paper};
    //border: 0.5px solid ${o?l[600]:r.palette.mode==="dark"?s[700]:s[200]};

	& > div {
	border : ${o&&"none"}
	}
    
    &:hover {
      border-color: ${o?l[600]:"#5B3959"};
    }

    & textarea {
      font-weight: normal !important;
      resize: vertical;
    }



    &:focus {
      border-color: ${o?l[600]:"#5B3959"};
      border-width: 1px;
    }

    // firefox
    &:focus-visible {
      outline: 0;
    }
  `);return e.jsx(A,{control:x,name:t,render:({field:r,fieldState:o})=>{var i,u;const C=k.useCallback(d=>{r.onChange(d.target.value),a&&a(d)},[r,a]);return e.jsxs(v,{sx:g,children:[e.jsx(T,{sx:{".MuiInputLabel-asterisk":{color:"red"}},required:F,htmlFor:c??t,style:{fontWeight:"medium"},error:o.error!=null,children:p}),e.jsx(D,{...r,id:t,multiline:!0,"aria-label":t,minRows:m,maxRows:b,placeholder:h,error:o.error!=null,onChange:C,value:r.value||"",disabled:f,InputProps:{readOnly:B}}),(n||((i=o.error)==null?void 0:i.message))&&e.jsx(w,{error:o.error!=null,children:((u=o.error)==null?void 0:u.message)??n})]})}})}const R=j.memo(y);export{R as T};
