var k=Object.defineProperty,z=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var n=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var c=(o,e,t)=>e in o?k(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,a=(o,e)=>{for(var t in e||(e={}))p.call(e,t)&&c(o,t,e[t]);if(n)for(var t of n(e))m.call(e,t)&&c(o,t,e[t]);return o},f=(o,e)=>z(o,F(e));var b=(o,e)=>{var t={};for(var r in o)p.call(o,r)&&e.indexOf(r)<0&&(t[r]=o[r]);if(o!=null&&n)for(var r of n(o))e.indexOf(r)<0&&m.call(o,r)&&(t[r]=o[r]);return t};import R from"react";import{createMultiStyleConfigHelpers as T,defineStyle as _,FormControl as v,Input as w,InputGroup as G,Text as u}from"@chakra-ui/react";import{inputAnatomy as H}from"@chakra-ui/anatomy";import{jsx as d,jsxs as g}from"react/jsx-runtime";var K=R.forwardRef((V,x)=>{var l=V,{label:o,error:e,placeholder:t,helperText:r,isInvalid:i,as:S=w,InputLeftAddon:C,InputRightAddon:h}=l,s=b(l,["label","error","placeholder","helperText","isInvalid","as","InputLeftAddon","InputRightAddon"]);let{disabled:I}=s;return g(v,{isInvalid:i,opacity:I?.4:1,children:[o&&d(u,{color:i?"destructive":"foreground",fontWeight:"medium",fontSize:"sm",lineHeight:1,children:o}),g(G,{mt:"2",children:[C,d(S,f(a({variant:"",placeholder:t},s),{ref:x})),h]}),r&&d(u,{fontSize:"xs",mt:2,color:"mutedForeground",children:r}),i&&e&&d(u,{fontSize:"xs",mt:2,color:"destructive",children:e})]})}),{definePartsStyle:y,defineMultiStyleConfig:M}=T(H.keys),W=y({field:{color:"foreground",background:"background",boxShadow:"base",borderWidth:"1px",borderStyle:"solid",borderColor:"input",borderRadius:"lg",_focusVisible:{borderColor:"ring"},_hover:{},_disabled:{opacity:1},_placeholder:{color:"mutedForeground"}}}),A=_({borderRadius:"md"}),P={sm:y({field:A})},L=M({baseStyle:W,sizes:P});export{K as Input,L as InputTheme};
