UNPKG

2.41 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8var _react = _interopRequireDefault(require("react"));
9
10var _withStyles = require("../helpers/withStyles");
11
12function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
14function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
16var Tag = function Tag(_ref) {
17 var children = _ref.children,
18 css = _ref.css,
19 label = _ref.label,
20 styles = _ref.styles;
21 return _react.default.createElement("div", css(styles.tag), children || label);
22};
23
24var TagWithStyles = (0, _withStyles.withStyles)(function (_ref2) {
25 var color = _ref2.color,
26 units = _ref2.units,
27 font = _ref2.font,
28 fontSize = _ref2.fontSize,
29 radius = _ref2.radius,
30 breakpoint = _ref2.breakpoint;
31 return {
32 tag: _defineProperty({
33 appearance: 'none',
34 borderWidth: 0,
35 background: color.blueGrayLighter,
36 display: 'inline-block',
37 paddingTop: 5,
38 paddingRight: 8,
39 paddingBottom: 5,
40 paddingLeft: 8,
41 borderRadius: radius,
42 fontSize: fontSize.small.small,
43 color: color.blueGrayDark,
44 outline: 0,
45 position: 'relative',
46 marginLeft: units(0.125),
47 marginRight: units(0.125),
48 marginBottom: units(0.5),
49 fontWeight: 500,
50 lineHeight: 1,
51 fontFamily: font.default,
52 boxSizing: 'border-box',
53 overflow: 'hidden',
54 whiteSpace: 'nowrap'
55 }, breakpoint.large, {
56 fontSize: fontSize.large.small
57 }),
58 tag_soft: {
59 background: color.blueGrayLighter,
60 color: color.primary
61 },
62 tag_mono: {
63 background: color.transparent,
64 borderColor: color.black,
65 borderWidth: 1,
66 borderStyle: 'solid',
67 color: color.black
68 },
69 tag_primary: {
70 background: color.primary
71 },
72 tag_secondary: {
73 background: color.transparent,
74 borderColor: color.secondary,
75 borderWidth: 1,
76 borderStyle: 'solid',
77 color: color.secondary
78 },
79 tag_inverse: {
80 background: color.white,
81 color: color.primary,
82 borderWidth: 0
83 },
84 tag_outline: {}
85 };
86})(Tag);
87var _default = TagWithStyles;
88exports.default = _default;
\No newline at end of file