!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>b});var n=t(6031),a=t.n(n),l=t(2462),u=t.n(l),i=t(2015),p=t.n(i),s=t(9825),d=t.n(s),c=t(8619),m=t(3294);const f=["name","label","maxLength","required"],x=e=>{var r;let{name:t,label:o,maxLength:n,required:l=!1}=e,i=u()(e,f);const[s,d]=(0,m.useField)(t),x=(null===(r=s.value)||void 0===r?void 0:r.length)||0;let b="";return o&&(b=l?`${o} *`:o),p().createElement(c.Box,null,p().createElement(c.TextField,a()({name:t,label:b},s,{onBlur:s.onBlur,margin:"normal",error:d.touched&&Boolean(d.error),helperText:d.touched&&d.error,slotProps:{htmlInput:{maxLength:n}}},i)),n&&p().createElement(c.Typography,{sx:{fontSize:"1.2rem",color:"#00000099",pl:2}},n-x+" characters left"))};x.propTypes={name:d().string.isRequired,label:d().string,maxLength:d().number,required:d().bool};const b=x;return o})()));
//# sourceMappingURL=textfield.js.map