'use client';
import{__rest as e}from"tslib";import t from"react";import{twMerge as o}from"tailwind-merge";import{BaseColors as r,Sizes as i}from"../../../lib/constants.js";import{borderRadius as s}from"../../../lib/shape.js";import{spacing as l}from"../../../lib/spacing.js";import{colorPalette as a}from"../../../lib/theme.js";import{mergeRefs as m,getColorClassNames as n,makeClassName as c}from"../../../lib/utils.js";import{badgeProportions as p,iconSizes as f}from"./styles.js";import g,{useTooltip as d}from"../../util-elements/Tooltip/Tooltip.js";const u=c("Badge"),h=t.forwardRef(((c,h)=>{const{color:j=r.Blue,icon:x,size:b=i.SM,tooltip:w,className:N,children:B}=c,E=e(c,["color","icon","size","tooltip","className","children"]),R=x||null,{tooltipProps:k,getReferenceProps:y}=d();return t.createElement("span",Object.assign({ref:m([h,k.refs.setReference]),className:o(u("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default",n(j,a.darkText).textColor,n(j,a.lightBackground).bgColor,s.full.all,p[b].paddingX,p[b].paddingY,p[b].fontSize,N)},y,E),t.createElement(g,Object.assign({text:w},k)),R?t.createElement(R,{className:o(u("icon"),l.twoXs.negativeMarginLeft,l.xs.marginRight,f[b].height,f[b].width)}):null,t.createElement("p",{className:o(u("text"),"text-sm whitespace-nowrap")},B))}));h.displayName="Badge";export{h as default};
