import{defineComponent as p,computed as s,createVNode as o}from"vue";import{isPresetColor as y}from"../_util/colors.mjs";import $ from"../_util/vue-types/index.mjs";import S from"../config-provider/hooks/useConfigInject.mjs";import g from"./style/index.mjs";const x=()=>({prefix:String,color:{type:String},text:$.any,placement:{type:String,default:"end"}}),R=p({compatConfig:{MODE:3},name:"ABadgeRibbon",inheritAttrs:!1,props:x(),slots:Object,setup(e,{attrs:i,slots:l}){const{prefixCls:t,direction:u}=S("ribbon",e),[m,r]=g(t),a=s(()=>y(e.color,!1)),f=s(()=>[t.value,`${t.value}-placement-${e.placement}`,{[`${t.value}-rtl`]:u.value==="rtl",[`${t.value}-color-${e.color}`]:a.value}]);return()=>{const{class:v,style:d,...b}=i,n={},c={};return e.color&&!a.value&&(n.background=e.color,c.color=e.color),m(o("div",{class:`${t.value}-wrapper ${r.value}`,...b},[l.default?.(),o("div",{class:[f.value,v,r.value],style:{...n,...d}},[o("span",{class:`${t.value}-text`},[e.text||l.text?.()]),o("div",{class:`${t.value}-corner`,style:c},null)])]))}}});export{R as default,x as ribbonProps};
