import{g as p,d as y,$ as x,o as a,c as l,n as f,l as c,t as h,e as u,k as m,r as i,a0 as C,ai as S,L as $,a7 as w}from"./framework.3f630664.js";import{a as B}from"./index.b15c605d.js";import{t as b}from"./FwbRange.vue_vue_type_style_index_0_scoped_fadec9c5_lang.66ff4c69.js";const o={Success:"success",Error:"error"},I="block mb-2 text-sm font-medium",M="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",V="cursor-not-allowed bg-gray-100",E={lg:"p-4",md:"p-2.5 text-sm",sm:"p-2 text-sm"},q="bg-green-50 border-green-500 dark:border-green-500 text-green-900 dark:text-green-400 placeholder-green-700 dark:placeholder-green-500 focus:ring-green-500 focus:border-green-500",z="bg-red-50 border-red-500 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500 dark:text-red-500 dark:placeholder-red-500 dark:border-red-500";function D(t){const r=p(()=>{const s=t.validationStatus.value,n=s===o.Success?q:s===o.Error?z:"";return b(M,n,E[t.size.value],t.disabled.value?V:"")}),d=p(()=>{const s=t.validationStatus.value,n=s===o.Success?"text-green-700 dark:text-green-500":s===o.Error?"text-red-700 dark:text-red-500":"text-gray-900 dark:text-white";return b(I,n)});return{inputClasses:r,labelClasses:d}}const L={class:"flex relative"},N={key:0,class:"w-10 flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none overflow-hidden"},R=["disabled","type","required"],F={key:1,class:"absolute right-2.5 bottom-2.5"},P={key:2,class:"mt-2 text-sm text-gray-500 dark:text-gray-400"},A=y({__name:"FwbInput",props:{disabled:{type:Boolean,default:!1},label:{default:""},modelValue:{default:""},required:{type:Boolean,default:!1},size:{default:"md"},type:{default:"text"},validationStatus:{default:void 0}},setup(t){const r=t,d=B(r,"modelValue"),{inputClasses:s,labelClasses:n}=D(x(r)),k=p(()=>b("mt-2 text-sm",r.validationStatus===o.Success?"text-green-600 dark:text-green-500":"",r.validationStatus===o.Error?"text-red-600 dark:text-red-500":""));return(e,g)=>(a(),l("div",null,[e.label?(a(),l("label",{key:0,class:f(c(n))},h(e.label),3)):u("",!0),m("div",L,[e.$slots.prefix?(a(),l("div",N,[i(e.$slots,"prefix")])):u("",!0),C(m("input",$(e.$attrs,{"onUpdate:modelValue":g[0]||(g[0]=v=>w(d)?d.value=v:null),disabled:e.disabled,type:e.type,required:e.required,class:[c(s),e.$slots.prefix?"pl-10":""]}),null,16,R),[[S,c(d)]]),e.$slots.suffix?(a(),l("div",F,[i(e.$slots,"suffix")])):u("",!0)]),e.$slots.validationMessage?(a(),l("p",{key:1,class:f(k.value)},[i(e.$slots,"validationMessage")],2)):u("",!0),e.$slots.helper?(a(),l("p",P,[i(e.$slots,"helper")])):u("",!0)]))}});export{A as _};
