import{j as e}from"./query-PJ0ZdjbV.js";import{d as j,a as y}from"./date-range-picker-BB0TgAn8.js";import{q as F,c1 as N,c2 as w,ap as c}from"./index-BSPIaiZU.js";function E({name:t,label:x,description:i,required:m,disabled:u,min:p=w,max:b=N,minField:l,maxField:n,className:f}){const{control:v,watch:d}=j(),o=l?d(l):void 0,a=n?d(n):void 0,g=typeof o=="string"&&o?o:p,h=typeof a=="string"&&a?a:b;return e.jsx(y,{name:t,control:v,render:({field:r,fieldState:{error:s}})=>e.jsxs("div",{className:c("space-y-1.5",f),children:[e.jsxs(F,{htmlFor:t,children:[x,m&&e.jsx("span",{className:"ml-0.5 text-red-500",children:"*"})]}),i&&e.jsx("p",{className:"text-[11px] text-slate-400 leading-relaxed",children:i}),e.jsx("input",{...r,id:t,type:"date",disabled:u,min:g,max:h,value:r.value??"",className:c("flex h-9 w-full rounded-md border border-input bg-white px-3 py-2 text-[13px] text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/30 focus-visible:border-blue-400","disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-slate-50","transition-colors duration-150",s&&"border-red-400 focus-visible:ring-red-500/30")}),(s==null?void 0:s.message)&&e.jsx("p",{className:"text-[11px] text-red-500",children:s.message})]})})}export{E as F};
