import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","view","status","form","icon","iconLeft","iconRight","minified","label","as"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./Badge.css";import{classnames}from"@bem-react/classnames";import React from"react";import{cn}from"../../utils/bem";import{forwardRefWithAs}from"../../utils/types/PropsWithAsAttributes";import{useTheme}from"../Theme/Theme";export var badgePropSize=["xs","s","m","l"];export var badgePropSizeDefault="m";export var badgePropView=["filled","stroked"];export var badgePropViewDefault=badgePropView[0];export var badgePropStatus=["normal","success","error","warning","system"];export var badgePropStatusDefault=badgePropStatus[0];export var badgePropForm=["default","round"];export var badgePropFormDefault=badgePropForm[0];export var cnBadge=cn("Badge");var renderIcon=function(a){if(a)return React.createElement(a,{size:"xs",className:cnBadge("Icon")})};export var Badge=forwardRefWithAs(function(a,b){var c=a.size,d=void 0===c?badgePropSizeDefault:c,e=a.view,f=void 0===e?badgePropViewDefault:e,g=a.status,h=void 0===g?badgePropStatusDefault:g,i=a.form,j=void 0===i?badgePropFormDefault:i,k=a.icon,l=a.iconLeft,m=a.iconRight,n=a.minified,o=a.label,p=a.as,q=void 0===p?"div":p,r=_objectWithoutProperties(a,_excluded),s=useTheme(),t=s.themeClassNames,u="system"!==h&&"filled"===f?classnames(a.className,t.color.accent):a.className,v=null!==l&&void 0!==l?l:k,w=1===[k,l,m,o].filter(function(a){return!!a}).length&&1>=((null===o||void 0===o?void 0:o.length)||0);return React.createElement(q,Object.assign({},r,{className:cnBadge(_objectSpread({size:d,status:h,minified:n},!n&&{view:f,form:j,counter:w}),[u]),ref:b,title:n&&o}),!n&&React.createElement(React.Fragment,null,renderIcon(v),o,renderIcon(m)))});
//# sourceMappingURL=Badge.js.map