UNPKG

@pantheon-systems/design-toolkit-react

Version:
37 lines (34 loc) 945 B
import PropTypes from 'prop-types'; import { jsx } from 'react/jsx-runtime'; var basicTallyStyles = 'rounded-4xl py-0.5 px-2 font-semibold text-sm'; var typeStyles = { "default": 'text-white bg-gray-5', danger: 'text-white bg-red-3', info: 'text-white bg-blue-3', success: 'text-white bg-green-3', warning: 'text-orange-5 bg-orange-3' }; var Tally = function Tally(_ref) { var children = _ref.children, type = _ref.type; return /*#__PURE__*/jsx("span", { className: "".concat(basicTallyStyles, " ").concat(typeStyles[type]), children: children }); }; Tally.propTypes = { /** * The content within the tally. Usually a number. */ children: PropTypes.node.isRequired, /** * Tally type. Choose one of the following: */ type: PropTypes.oneOf(Object.keys(typeStyles)) }; Tally.defaultProps = { type: 'default' }; var Tally$1 = Tally; export { Tally$1 as default }; //# sourceMappingURL=Tally.js.map