UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

40 lines (34 loc) 1.39 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var React = require('react'); var React__default = _interopDefault(React); var styled = require('styled-components'); var styled__default = _interopDefault(styled); /** * @file index.tsx * * @fileoverview Renders a badge using the styles provided in the theme. */ const StyledSpanBadge = styled__default.span ` background: ${props => props.theme.badge.backgroundColor[props.badgeStyle]}; padding: ${props => props.theme.badge.padding}; border-radius: ${props => props.theme.badge.borderRadius}; font-size: ${props => props.theme.badge.fontSize}; color: ${props => props.theme.badge.color[props.badgeStyle]}; `; /** * Badges contain numeric values, like the number of unread messages. * Use badges to label page items with a small amount of information that help. * Badges are normally placed before or after the label of the thing they're quantifying * and contain on. */ const Badge = ({ children, badgeStyle }) => { return React__default.createElement(StyledSpanBadge, { badgeStyle: badgeStyle }, children); }; Badge.defaultProps = { badgeStyle: 'primary', theme: null }; exports.Badge = Badge; exports.StyledSpanBadge = StyledSpanBadge;