@micromag/element-button 0.3.74 → 0.3.78

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