import{g as b,E as u,G as v,j as i,H as y,O as h,o as s,c as r,a as n,M as C,W as $,L as k,I as B,d as S,t as g,y as t,l as d}from"./entry.eb978f24.js";import{u as V}from"./useFormEvents.4d081bc0.js";import{_ as q}from"./_plugin-vue_export-helper.c27b6911.js";const N=b({inheritAttrs:!1,props:{value:{type:[String,Number,Boolean],default:null},modelValue:{type:[String,Number,Boolean,Object],default:null},name:{type:String,default:null},disabled:{type:Boolean,default:!1},help:{type:String,default:null},label:{type:String,default:null},required:{type:Boolean,default:!1},color:{type:String,default:()=>u.ui.radio.default.color,validator(e){return u.ui.colors.includes(e)}},ui:{type:Object,default:()=>u.ui.radio}},emits:["update:modelValue","change"],setup(e,{emit:l}){const p=v(),a=i(()=>y({},e.ui,p.ui.radio)),{emitFormBlur:m}=V(),f=i({get(){return e.modelValue},set(c){l("update:modelValue",c),c&&m()}}),o=i(()=>h(a.value.base,a.value.background,a.value.border,a.value.ring.replaceAll("{color}",e.color),a.value.color.replaceAll("{color}",e.color)));return{ui:a,pick:f,inputClass:o}}}),A={class:"flex items-center h-5"},j=["id","name","required","value","disabled"],E={key:0,class:"ms-3 text-sm"},O=["for"];function w(e,l,p,a,m,f){return s(),r("div",{class:t(e.ui.wrapper)},[n("div",A,[C(n("input",k({id:`${e.name}-${e.value}`,"onUpdate:modelValue":l[0]||(l[0]=o=>e.pick=o),name:e.name,required:e.required,value:e.value,disabled:e.disabled,type:"radio",class:["form-radio",e.inputClass]},e.$attrs,{onChange:l[1]||(l[1]=(...o)=>e.onChange&&e.onChange(...o))}),null,16,j),[[$,e.pick]])]),e.label||e.$slots.label?(s(),r("div",E,[n("label",{for:`${e.name}-${e.value}`,class:t(e.ui.label)},[B(e.$slots,"label",{},()=>[S(g(e.label),1)]),e.required?(s(),r("span",{key:0,class:t(e.ui.required)},"*",2)):d("",!0)],10,O),e.help?(s(),r("p",{key:0,class:t(e.ui.help)},g(e.help),3)):d("",!0)])):d("",!0)],2)}const R=q(N,[["render",w]]);export{R as default};
