UNPKG

@yandex/ui

Version:

Yandex UI components

17 lines (16 loc) 1.04 kB
import { __assign, __rest } from "tslib"; import React from 'react'; import { cn } from '@bem-react/classname'; import './Badge.css'; export var cnBadge = cn('Badge'); /** * Индикатор-счётчик новой информации * @param {BadgeProps} props */ export var Badge = function (_a) { var color = _a.color, textColor = _a.textColor, outlineColor = _a.outlineColor, content = _a.content, children = _a.children, innerRef = _a.innerRef, style = _a.style, className = _a.className, props = __rest(_a, ["color", "textColor", "outlineColor", "content", "children", "innerRef", "style", "className"]); return (React.createElement("div", __assign({ ref: innerRef }, props, { className: cnBadge(null, [className]) }), children, React.createElement("div", { className: cnBadge('Dot', { withChildren: Boolean(children), withContent: Boolean(content) }), style: __assign({ backgroundColor: color, color: textColor, borderColor: outlineColor }, style) }, content))); }; Badge.displayName = cnBadge();