import{C as e,E as t,ft as n,l as r,m as i,o as a,u as o,ut as s}from"./runtime-core.esm-bundler-DTXUv7Wx.js";import{t as c}from"./Icon-CtR1FGIT.js";var l=[`type`,`aria-label`],u={key:0,class:`absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 rounded-full bg-danger text-white text-[10px] font-bold flex items-center justify-center`},d={__name:`IconButton`,props:{icon:{type:String,required:!0},iconSize:{type:Number,default:null},iconStrokeWidth:{type:[Number,String],default:null},variant:{type:String,default:`float`,validator:e=>[`float`,`accent`,`cream-wash`,`brand-wash`,`cream-dark`,`ghost`].includes(e)},size:{type:String,default:`lg`,validator:e=>[`xs`,`sm`,`md`,`lg`].includes(e)},shadow:{type:String,default:null,validator:e=>e===null||[`none`,`sm`,`md`,`lg`].includes(e)},count:{type:Number,default:null},ariaLabel:{type:String,default:``},type:{type:String,default:`button`}},emits:[`click`],setup(d){let f=d,p=new Set([`float`,`accent`]),m={float:`bg-brand-float text-accent`,accent:`bg-accent text-brand hover:bg-accent-soft`,"cream-wash":`bg-cream-wash text-cream hover:bg-cream-wash-strong`,"brand-wash":`bg-brand-wash text-brand`,"cream-dark":`bg-cream-dark text-brand hover:bg-brand-soft hover:text-cream`,ghost:`bg-transparent text-muted hover:bg-brand-wash hover:text-brand`},h={float:`shadow-lg`,accent:``,"cream-wash":``,"brand-wash":``,"cream-dark":``,ghost:``},g={none:``,sm:`shadow-sm`,md:`shadow-md`,lg:`shadow-lg`},_={xs:{box:`w-9 h-9`,icon:18},sm:{box:`w-10 h-10`,icon:20},md:{box:`w-11 h-11`,icon:20},lg:{box:`w-14 h-14`,icon:22}},v=a(()=>p.has(f.variant)),y=a(()=>v.value?`transition-transform duration-base ease-out hover:-translate-y-0.5 active:translate-y-0`:`transition-colors`),b=a(()=>f.shadow===null?h[f.variant]:g[f.shadow]),x=a(()=>[`relative inline-flex items-center justify-center rounded-full`,_[f.size].box,m[f.variant],b.value,y.value]),S=a(()=>f.iconSize??_[f.size].icon);return(a,f)=>(e(),o(`button`,{type:d.type,class:s(x.value),"aria-label":d.ariaLabel||void 0,onClick:f[0]||=e=>a.$emit(`click`,e)},[i(c,{name:d.icon,size:S.value,"stroke-width":d.iconStrokeWidth??void 0},null,8,[`name`,`size`,`stroke-width`]),d.count!==null&&d.count>0?(e(),o(`span`,u,n(d.count),1)):r(``,!0),t(a.$slots,`default`)],10,l))}};export{d as t};