@micromag/element-badge 0.3.423 → 0.3.429
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +9 -18
- package/package.json +10 -4
package/lib/index.js
CHANGED
|
@@ -9,22 +9,13 @@ var core = require('@micromag/core');
|
|
|
9
9
|
var utils = require('@micromag/core/utils');
|
|
10
10
|
var Text = require('@micromag/element-text');
|
|
11
11
|
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
|
-
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
16
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
17
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
18
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
-
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
20
|
-
|
|
21
12
|
var styles = {"container":"micromag-element-badge-container"};
|
|
22
13
|
|
|
23
14
|
var propTypes = {
|
|
24
15
|
label: core.PropTypes.textElement,
|
|
25
16
|
boxStyle: core.PropTypes.boxStyle,
|
|
26
|
-
className:
|
|
27
|
-
labelClassName:
|
|
17
|
+
className: PropTypes.string,
|
|
18
|
+
labelClassName: PropTypes.string
|
|
28
19
|
};
|
|
29
20
|
var defaultProps = {
|
|
30
21
|
label: null,
|
|
@@ -45,15 +36,15 @@ function Badge(_ref) {
|
|
|
45
36
|
lineHeight = _ref3$lineHeight === void 0 ? null : _ref3$lineHeight;
|
|
46
37
|
var boxStyles = null;
|
|
47
38
|
if (boxStyle !== null) {
|
|
48
|
-
boxStyles =
|
|
39
|
+
boxStyles = _objectSpread(_objectSpread({}, boxStyles), utils.getStyleFromBox(boxStyle));
|
|
49
40
|
}
|
|
50
|
-
return /*#__PURE__*/
|
|
51
|
-
className:
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
52
43
|
style: boxStyles
|
|
53
|
-
}, /*#__PURE__*/
|
|
54
|
-
className:
|
|
55
|
-
}, /*#__PURE__*/
|
|
56
|
-
textStyle:
|
|
44
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
45
|
+
className: classNames([styles.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Text, Object.assign({}, label, {
|
|
47
|
+
textStyle: _objectSpread(_objectSpread({}, textStyle), {}, {
|
|
57
48
|
lineHeight: lineHeight || 1
|
|
58
49
|
}),
|
|
59
50
|
inline: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-badge",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.429",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -28,6 +28,12 @@
|
|
|
28
28
|
"license": "ISC",
|
|
29
29
|
"main": "lib/index.js",
|
|
30
30
|
"module": "es/index.js",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"require": "./lib/index.js",
|
|
34
|
+
"import": "./es/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
31
37
|
"files": [
|
|
32
38
|
"lib",
|
|
33
39
|
"es",
|
|
@@ -46,8 +52,8 @@
|
|
|
46
52
|
},
|
|
47
53
|
"dependencies": {
|
|
48
54
|
"@babel/runtime": "^7.13.10",
|
|
49
|
-
"@micromag/core": "^0.3.
|
|
50
|
-
"@micromag/element-text": "^0.3.
|
|
55
|
+
"@micromag/core": "^0.3.429",
|
|
56
|
+
"@micromag/element-text": "^0.3.429",
|
|
51
57
|
"classnames": "^2.2.6",
|
|
52
58
|
"lodash": "^4.17.21",
|
|
53
59
|
"prop-types": "^15.7.2",
|
|
@@ -58,5 +64,5 @@
|
|
|
58
64
|
"access": "public",
|
|
59
65
|
"registry": "https://registry.npmjs.org/"
|
|
60
66
|
},
|
|
61
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "f15e72b88ecfda4c54b87626513149b58572c52b"
|
|
62
68
|
}
|