import{capitalize as p}from"../../_util/util.mjs";import{resetComponent as u}from"../../style/index.mjs";import"../../theme/internal.mjs";import m from"../../theme/util/genComponentStyleHook.mjs";import{merge as h}from"../../theme/util/statistic.mjs";import{genPresetColor as b}from"../../style/presetColor.mjs";const t=(o,i,e)=>{const l=p(e);return{[`${o.componentCls}-${i}`]:{color:o[`color${e}`],background:o[`color${l}Bg`],borderColor:o[`color${l}Border`],[`&${o.componentCls}-borderless`]:{borderColor:"transparent"}}}},C=o=>b(o,(i,{textColor:e,lightBorderColor:l,lightColor:r,darkColor:a})=>({[`${o.componentCls}-${i}`]:{color:e,background:r,borderColor:l,"&-inverse":{color:o.colorTextLightSolid,background:a,borderColor:a},[`&${o.componentCls}-borderless`]:{borderColor:"transparent"}}})),S=o=>{const{paddingXXS:i,lineWidth:e,tagPaddingHorizontal:l,componentCls:r}=o,a=l-e,c=i-e;return{[r]:{...u(o),display:"inline-block",height:"auto",marginInlineEnd:o.marginXS,paddingInline:a,fontSize:o.tagFontSize,lineHeight:`${o.tagLineHeight}px`,whiteSpace:"nowrap",background:o.tagDefaultBg,border:`${o.lineWidth}px ${o.lineType} ${o.colorBorder}`,borderRadius:o.borderRadiusSM,opacity:1,transition:`all ${o.motionDurationMid}`,textAlign:"start",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:o.tagDefaultColor},[`${r}-close-icon`]:{marginInlineStart:c,color:o.colorTextDescription,fontSize:o.tagIconSize,cursor:"pointer",transition:`all ${o.motionDurationMid}`,"&:hover":{color:o.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${o.iconCls}-close, ${o.iconCls}-close:hover`]:{color:o.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-checkable-checked):hover`]:{color:o.colorPrimary,backgroundColor:o.colorFillSecondary},"&:active, &-checked":{color:o.colorTextLightSolid},"&-checked":{backgroundColor:o.colorPrimary,"&:hover":{backgroundColor:o.colorPrimaryHover}},"&:active":{backgroundColor:o.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${o.iconCls} + span, > span + ${o.iconCls}`]:{marginInlineStart:a}},[`${r}-borderless`]:{borderColor:"transparent",background:o.tagBorderlessBg}}},x=m("Tag",o=>{const{fontSize:i,lineHeight:e,lineWidth:l,fontSizeIcon:r}=o,a=Math.round(i*e),c=o.fontSizeSM,s=a-l*2,g=o.colorFillAlter,d=o.colorText,n=h(o,{tagFontSize:c,tagLineHeight:s,tagDefaultBg:g,tagDefaultColor:d,tagIconSize:r-2*l,tagPaddingHorizontal:8,tagBorderlessBg:o.colorFillTertiary});return[S(n),C(n),t(n,"success","Success"),t(n,"processing","Info"),t(n,"error","Error"),t(n,"warning","Warning")]});export{x as default};
