import{_}from"./CBXHUQO1.js";import{E as u,v as p,_ as S,R as C,L as c,o as d,p as y,w as b,B as g,C as m,H as x,a7 as k}from"./CibDhUcP.js";const D=(t,i="baseButton")=>{const e={base:"transition-all duration-300 border-0 focus:outline-none",layout:"inline-flex items-center justify-center rounded gap-2"},n={base:"py-2 px-3",small:"py-1 px-2 text-sm",xsmall:"p-1 text-xs"},o="text-white bg-gray-300 italic cursor-not-allowed",s=u(()=>{const a=t.baseLayout.length?t.baseLayout:e.base,l=t.baseStyle.length?t.baseStyle:e.layout,f=t.customSize.length?t.customSize:n[t.size];return`${a} ${l} ${f}`});return{coloring:u(()=>t.disabled?t.disabledColoring||o:t.customColor?t.customColor:`${i}--${t.palette}`),styling:s}},h=p({__name:"ButtonElement",props:{tag:{type:String,default:"a"},inputType:{type:String,default:""},to:{type:String,default:""},target:{type:String,default:""},isDisabled:{type:Boolean,default:null},palette:{type:String,default:"base"},baseLayout:{type:String,default:""},baseStyle:{type:String,default:""},customColor:{type:String,default:""},disabledColoring:{type:String,default:""},size:{type:String,default:"base"},customSize:{type:String,default:""},tooltip:{type:String,default:""}},emits:["click"],setup(t,{expose:i,emit:e}){i();const n=e,o=t,{coloring:s,styling:r}=D(o,"buttonElement"),l={emit:n,props:o,coloring:s,styling:r,buttonClick:()=>{o.isDisabled||n("click")}};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}});function w(t,i,e,n,o,s){var l;const r=_,a=C("tippy");return((l=n.props.to)==null?void 0:l.length)>0?c((d(),y(r,{key:0,target:n.props.target??null,to:n.props.to,disabled:e.isDisabled?e.isDisabled:null,class:m(["buttonElement",[t.$attrs.class,n.coloring,n.styling,e.isDisabled?"buttonElement--disabled cursor-not-allowed opacity-50":"cursor-pointer"]])},{default:b(()=>[g(t.$slots,"default")]),_:3},8,["target","to","disabled","class"])),[[a,{content:e.tooltip,allowHTML:!0,placement:"auto"}]]):c((d(),y(k(e.tag),{key:1,disabled:e.isDisabled?e.isDisabled:null,class:m(["buttonElement",[t.$attrs.class,n.coloring,n.styling,e.isDisabled?"buttonElement--disabled cursor-not-allowed opacity-50":"cursor-pointer"]]),type:e.inputType.length?e.inputType:null,onClick:x(n.buttonClick,["stop"])},{default:b(()=>[g(t.$slots,"default")]),_:3},8,["disabled","type","class"])),[[a,{content:e.tooltip,allowHTML:!0,placement:"auto"}]])}const v=Object.assign(S(h,[["render",w],["__file","ButtonElement.vue"]]),{__name:"ButtonElement"});export{v as _};
