UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

50 lines (37 loc) 1.6 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var React = _interopRequireWildcard(require("react")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _Badge = _interopRequireDefault(require("../Badge")); var _BadgePrimitive = require("../primitives/BadgePrimitive"); var _defaultTheme = _interopRequireDefault(require("../defaultTheme")); var StyledNotificationBadge = _styledComponents.default.div.withConfig({ displayName: "NotificationBadge__StyledNotificationBadge", componentId: "zl2bxd-0" })(["", "{width:", ";padding:0;}"], _BadgePrimitive.StyledBadge, function (_ref) { var theme = _ref.theme; return theme.orbit.widthBadgeCircled; }); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 StyledNotificationBadge.defaultProps = { theme: _defaultTheme.default }; var NotificationBadge = function NotificationBadge(props) { var type = props.type, children = props.children, icon = props.icon, ariaLabel = props.ariaLabel, dataTest = props.dataTest; return /*#__PURE__*/React.createElement(StyledNotificationBadge, null, /*#__PURE__*/React.createElement(_Badge.default, { type: type, dataTest: dataTest, icon: icon, ariaLabel: ariaLabel }, !icon && children)); }; var _default = NotificationBadge; exports.default = _default;