import{n as e}from"./useStore-CusP06SD.js";import{a as t}from"./dist-DhH_lYkz.js";import{t as n}from"./input-CsfmMUT5.js";import{i as r}from"./index-DinSQfHc.js";import{r as i}from"./form-context-B-ekdUc0.js";import{n as a,t as o}from"./required-indicator-BXf2UzTH.js";import{t as s}from"./FieldInfo-FLjtPgL4.js";var c=e(),l=({className:e,label:l,hideLabel:u=!1,...d})=>{let f=i(),{isFieldRequired:p}=a(),m=e=>{let t=e.target.value;if(t===``){f.handleChange(null);return}let n=Number(t);isNaN(n)||f.handleChange(n)};return(0,c.jsxs)(`div`,{className:t(`space-y-3`,e),children:[!u&&(0,c.jsxs)(r,{htmlFor:f.name,className:`block w-full`,children:[l,p(f.name)&&(0,c.jsx)(o,{})]}),(0,c.jsx)(n,{type:`number`,className:`form-input`,name:f.name,id:f.name,value:f.state.value??``,"aria-invalid":f.state.meta.isTouched&&f.state.meta.errors?.length>0,onBlur:f.handleBlur,onChange:m,...d}),(0,c.jsx)(s,{fieldMeta:f.state.meta})]})};export{l as default};