import{E as h,G as d,g as C,j as u,N as $,o,c as s,a as i,L as k,W as S,K as V,H as B,d as q,t as g,y as t,l as n}from"./entry.9e31e8a4.js";import{t as N}from"./tw-merge.27ca352e.js";import{r as w,u as j}from"./ui.config.7ae255de.js";import{u as A}from"./useFormGroup.38d9f2fe.js";import{_ as G}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.87a09f8b.js";const v=h(d.ui.strategy,d.ui.radio,w),D=C({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:()=>v.default.color,validator(e){return d.ui.colors.includes(e)}},inputClass:{type:String,default:null},ui:{type:Object,default:void 0}},emits:["update:modelValue"],setup(e,{emit:l}){const{ui:a,attrs:p}=j("radio",e.ui,v,{mergeWrapper:!0}),{emitFormChange:m,formGroup:f}=A(),r=u(()=>f?.error?.value?"red":e.color),b=u({get(){return e.modelValue},set(c){l("update:modelValue",c),c&&m()}}),y=u(()=>N($(a.value.base,a.value.background,a.value.border,a.value.ring.replaceAll("{color}",r.value),a.value.color.replaceAll("{color}",r.value)),e.inputClass));return{ui:a,attrs:p,pick:b,inputClass:y}}}),E={class:"flex items-center h-5"},F=["id","name","required","value","disabled"],M={key:0,class:"ms-3 text-sm"},O=["for"];function R(e,l,a,p,m,f){return o(),s("div",{class:t(e.ui.wrapper)},[i("div",E,[k(i("input",V({id:`${e.name}-${e.value}`,"onUpdate:modelValue":l[0]||(l[0]=r=>e.pick=r),name:e.name,required:e.required,value:e.value,disabled:e.disabled,type:"radio",class:["form-radio",e.inputClass]},e.attrs),null,16,F),[[S,e.pick]])]),e.label||e.$slots.label?(o(),s("div",M,[i("label",{for:`${e.name}-${e.value}`,class:t(e.ui.label)},[B(e.$slots,"label",{},()=>[q(g(e.label),1)]),e.required?(o(),s("span",{key:0,class:t(e.ui.required)},"*",2)):n("",!0)],10,O),e.help?(o(),s("p",{key:0,class:t(e.ui.help)},g(e.help),3)):n("",!0)])):n("",!0)],2)}const K=G(D,[["render",R]]);export{K as default};
