import{_ as __rest,a as __assign}from"./tslib.es6-bjGg6Bxl.js";import React__default from"react";import{I as Icon,K as KnownIconsEnum}from"./Icon.component-7-ap-6Ys.js";var badgeBaseStyles="\n  jn-rounded\n  jn-text-sm\n  jn-text-theme-default\n  jn-py-0.5\n  jn-px-1\n  jn-justify-center\n  jn-items-center\n",badgeVariantStyles={default:"jn-bg-theme-badge-default",info:"jn-bg-theme-info/25",success:"jn-bg-theme-success/25",warning:"jn-bg-theme-warning/25",danger:"jn-bg-theme-danger/25",error:"jn-bg-theme-error/25"},iconStyles="jn-mr-1 jn-items-center",getVariantStyle=function(a){return badgeVariantStyles[a]||badgeVariantStyles.default},getIcon=function(a,b){return"string"==typeof a&&isValidIcon(a)?a:!0===a?b:void 0},getIconColor=function(a,b){return!0===a?"jn-text-theme-".concat(b):void 0},isValidIcon=function(a){var b=new Set(Object.values(KnownIconsEnum));return b.has(a)},Badge=function(a){var b=a.variant,c=void 0===b?"default":b,d=a.icon,e=void 0!==d&&d,f=a.text,g=void 0===f?"":f,h=a.className,i=void 0===h?"":h,j=a.children,k=void 0===j?null:j,l=__rest(a,["variant","icon","text","className","children"]),m=getIcon(e,c),n=getIconColor(e,c);return React__default.createElement("span",__assign({className:"\n        juno-badge \n        juno-badge-".concat(c," \n        ").concat(badgeBaseStyles," \n        ").concat(getVariantStyle(c)," \n        ").concat(e?"jn-inline-flex":""," \n        ").concat(i)},l),m&&React__default.createElement(Icon,{icon:m,size:"1.125rem",className:iconStyles,color:n}),k||g)};export{Badge as B};