@micromag/element-button 0.3.311 → 0.3.318
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/assets/css/styles.css +1 -1
- package/es/index.js +19 -27
- package/lib/index.js +19 -27
- package/package.json +4 -4
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.micromag-element-button-container{
|
|
1
|
+
.micromag-element-button-container{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;background-clip:padding-box;background-color:hsla(0,0%,100%,.1);border:0;border-radius:0;color:inherit;cursor:pointer;display:inline-block;font-family:inherit;padding:0;padding:5px 10px;position:relative}.micromag-element-button-container.micromag-element-button-disabled,.micromag-element-button-container:disabled{cursor:auto}.micromag-element-button-border{display:block}
|
package/es/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { getStyleFromText, getStyleFromBox } from '@micromag/core/utils';
|
|
|
11
11
|
var styles = {"container":"micromag-element-button-container","disabled":"micromag-element-button-disabled","border":"micromag-element-button-border"};
|
|
12
12
|
|
|
13
13
|
var _excluded = ["textStyle", "buttonStyle", "type", "disabled", "focusable", "inline", "onClick", "children", "className", "withoutExternalBorder", "refButton"],
|
|
14
|
-
|
|
14
|
+
_excluded2 = ["body"];
|
|
15
15
|
var propTypes = {
|
|
16
16
|
textStyle: PropTypes.textStyle,
|
|
17
17
|
buttonStyle: PropTypes.boxStyle,
|
|
@@ -25,9 +25,9 @@ var propTypes = {
|
|
|
25
25
|
withoutExternalBorder: PropTypes$1.bool,
|
|
26
26
|
refButton: PropTypes$1.oneOfType([PropTypes$1.func, PropTypes$1.shape({
|
|
27
27
|
current: PropTypes$1.any // eslint-disable-line
|
|
28
|
-
|
|
29
28
|
})])
|
|
30
29
|
};
|
|
30
|
+
|
|
31
31
|
var defaultProps = {
|
|
32
32
|
textStyle: null,
|
|
33
33
|
buttonStyle: null,
|
|
@@ -41,42 +41,36 @@ var defaultProps = {
|
|
|
41
41
|
withoutExternalBorder: false,
|
|
42
42
|
refButton: null
|
|
43
43
|
};
|
|
44
|
-
|
|
45
44
|
var Button = function Button(_ref) {
|
|
46
45
|
var textStyle = _ref.textStyle,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
buttonStyle = _ref.buttonStyle,
|
|
47
|
+
type = _ref.type,
|
|
48
|
+
disabled = _ref.disabled,
|
|
49
|
+
focusable = _ref.focusable,
|
|
50
|
+
inline = _ref.inline,
|
|
51
|
+
onClick = _ref.onClick,
|
|
52
|
+
children = _ref.children,
|
|
53
|
+
className = _ref.className,
|
|
54
|
+
withoutExternalBorder = _ref.withoutExternalBorder,
|
|
55
|
+
refButton = _ref.refButton,
|
|
56
|
+
buttonProps = _objectWithoutProperties(_ref, _excluded);
|
|
57
|
+
var finalStyles = null;
|
|
58
|
+
// eslint-disable-next-line no-unused-vars
|
|
61
59
|
var _ref2 = buttonProps || {};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
_ref2.body;
|
|
61
|
+
var otherProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
65
62
|
if (textStyle !== null) {
|
|
66
63
|
finalStyles = _objectSpread(_objectSpread({}, finalStyles), getStyleFromText(textStyle));
|
|
67
64
|
}
|
|
68
|
-
|
|
69
65
|
if (buttonStyle !== null) {
|
|
70
66
|
finalStyles = _objectSpread(_objectSpread(_objectSpread({}, finalStyles), getStyleFromBox(buttonStyle)), {}, {
|
|
71
67
|
display: withoutExternalBorder && inline ? 'inline-block' : null
|
|
72
68
|
});
|
|
73
69
|
}
|
|
74
|
-
|
|
75
70
|
if (!withoutExternalBorder) {
|
|
76
71
|
var _ref3 = finalStyles || {},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
_ref3$borderWidth = _ref3.borderWidth,
|
|
73
|
+
borderWidth = _ref3$borderWidth === void 0 ? null : _ref3$borderWidth;
|
|
80
74
|
var margin = borderWidth !== null && borderWidth > 0 ? '-1px' : null;
|
|
81
75
|
finalStyles = _objectSpread(_objectSpread({}, finalStyles), {}, {
|
|
82
76
|
display: inline ? 'inline-block' : null
|
|
@@ -84,7 +78,6 @@ var Button = function Button(_ref) {
|
|
|
84
78
|
margin: margin
|
|
85
79
|
} : null);
|
|
86
80
|
}
|
|
87
|
-
|
|
88
81
|
return /*#__PURE__*/React.createElement(Button$1, Object.assign({
|
|
89
82
|
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
90
83
|
disabled: disabled,
|
|
@@ -96,7 +89,6 @@ var Button = function Button(_ref) {
|
|
|
96
89
|
withoutBootstrapStyles: true
|
|
97
90
|
}, otherProps), children);
|
|
98
91
|
};
|
|
99
|
-
|
|
100
92
|
Button.propTypes = propTypes;
|
|
101
93
|
Button.defaultProps = defaultProps;
|
|
102
94
|
|
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
22
22
|
var styles = {"container":"micromag-element-button-container","disabled":"micromag-element-button-disabled","border":"micromag-element-button-border"};
|
|
23
23
|
|
|
24
24
|
var _excluded = ["textStyle", "buttonStyle", "type", "disabled", "focusable", "inline", "onClick", "children", "className", "withoutExternalBorder", "refButton"],
|
|
25
|
-
|
|
25
|
+
_excluded2 = ["body"];
|
|
26
26
|
var propTypes = {
|
|
27
27
|
textStyle: core.PropTypes.textStyle,
|
|
28
28
|
buttonStyle: core.PropTypes.boxStyle,
|
|
@@ -36,9 +36,9 @@ var propTypes = {
|
|
|
36
36
|
withoutExternalBorder: PropTypes__default["default"].bool,
|
|
37
37
|
refButton: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
|
|
38
38
|
current: PropTypes__default["default"].any // eslint-disable-line
|
|
39
|
-
|
|
40
39
|
})])
|
|
41
40
|
};
|
|
41
|
+
|
|
42
42
|
var defaultProps = {
|
|
43
43
|
textStyle: null,
|
|
44
44
|
buttonStyle: null,
|
|
@@ -52,42 +52,36 @@ var defaultProps = {
|
|
|
52
52
|
withoutExternalBorder: false,
|
|
53
53
|
refButton: null
|
|
54
54
|
};
|
|
55
|
-
|
|
56
55
|
var Button = function Button(_ref) {
|
|
57
56
|
var textStyle = _ref.textStyle,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
buttonStyle = _ref.buttonStyle,
|
|
58
|
+
type = _ref.type,
|
|
59
|
+
disabled = _ref.disabled,
|
|
60
|
+
focusable = _ref.focusable,
|
|
61
|
+
inline = _ref.inline,
|
|
62
|
+
onClick = _ref.onClick,
|
|
63
|
+
children = _ref.children,
|
|
64
|
+
className = _ref.className,
|
|
65
|
+
withoutExternalBorder = _ref.withoutExternalBorder,
|
|
66
|
+
refButton = _ref.refButton,
|
|
67
|
+
buttonProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
68
|
+
var finalStyles = null;
|
|
69
|
+
// eslint-disable-next-line no-unused-vars
|
|
72
70
|
var _ref2 = buttonProps || {};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
_ref2.body;
|
|
72
|
+
var otherProps = _objectWithoutProperties__default["default"](_ref2, _excluded2);
|
|
76
73
|
if (textStyle !== null) {
|
|
77
74
|
finalStyles = _objectSpread__default["default"](_objectSpread__default["default"]({}, finalStyles), utils.getStyleFromText(textStyle));
|
|
78
75
|
}
|
|
79
|
-
|
|
80
76
|
if (buttonStyle !== null) {
|
|
81
77
|
finalStyles = _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({}, finalStyles), utils.getStyleFromBox(buttonStyle)), {}, {
|
|
82
78
|
display: withoutExternalBorder && inline ? 'inline-block' : null
|
|
83
79
|
});
|
|
84
80
|
}
|
|
85
|
-
|
|
86
81
|
if (!withoutExternalBorder) {
|
|
87
82
|
var _ref3 = finalStyles || {},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
_ref3$borderWidth = _ref3.borderWidth,
|
|
84
|
+
borderWidth = _ref3$borderWidth === void 0 ? null : _ref3$borderWidth;
|
|
91
85
|
var margin = borderWidth !== null && borderWidth > 0 ? '-1px' : null;
|
|
92
86
|
finalStyles = _objectSpread__default["default"](_objectSpread__default["default"]({}, finalStyles), {}, {
|
|
93
87
|
display: inline ? 'inline-block' : null
|
|
@@ -95,7 +89,6 @@ var Button = function Button(_ref) {
|
|
|
95
89
|
margin: margin
|
|
96
90
|
} : null);
|
|
97
91
|
}
|
|
98
|
-
|
|
99
92
|
return /*#__PURE__*/React__default["default"].createElement(components.Button, Object.assign({
|
|
100
93
|
className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)]),
|
|
101
94
|
disabled: disabled,
|
|
@@ -107,7 +100,6 @@ var Button = function Button(_ref) {
|
|
|
107
100
|
withoutBootstrapStyles: true
|
|
108
101
|
}, otherProps), children);
|
|
109
102
|
};
|
|
110
|
-
|
|
111
103
|
Button.propTypes = propTypes;
|
|
112
104
|
Button.defaultProps = defaultProps;
|
|
113
105
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-button",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.318",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.318",
|
|
53
53
|
"classnames": "^2.2.6",
|
|
54
54
|
"prop-types": "^15.7.2",
|
|
55
55
|
"react-intl": "^5.12.1",
|
|
56
|
-
"uuid": "^
|
|
56
|
+
"uuid": "^9.0.0"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "7d1a296e0c0d410e1225279e1f19e3a7715bfa96"
|
|
62
62
|
}
|