@janiscommerce/ui-web 1.8.0 → 1.9.0-beta.2

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/dist/index.umd.js CHANGED
@@ -9536,26 +9536,24 @@
9536
9536
  Icon: styled__default["default"](Icon).withConfig({
9537
9537
  displayName: "styles__Icon",
9538
9538
  componentId: "sc-3jodl7-1"
9539
- })(["margin-right:6px;flex-shrink:0;"])
9539
+ })(["margin-right:6px;flex-shrink:0;"]),
9540
+ Message: styled__default["default"].span.withConfig({
9541
+ displayName: "styles__Message",
9542
+ componentId: "sc-3jodl7-2"
9543
+ })(["color:", ";font-size:", ";font-family:", ";"], palette.statusRed, typography.size.baseSmall, typography.fontFamily)
9540
9544
  };
9541
9545
 
9542
9546
  var DefaultError = function DefaultError(_ref) {
9543
- var message = _ref.message;
9547
+ var _ref$message = _ref.message,
9548
+ message = _ref$message === void 0 ? 'Something went wrong' : _ref$message;
9544
9549
  return /*#__PURE__*/React__default["default"].createElement(styled$6.Wrapper, null, /*#__PURE__*/React__default["default"].createElement(styled$6.Icon, {
9545
9550
  name: "exclamation_circle",
9546
9551
  color: "statusRed"
9547
- }), /*#__PURE__*/React__default["default"].createElement("p", {
9548
- color: "statusRed",
9549
- fontSize: "baseSmall"
9550
- }, message));
9552
+ }), /*#__PURE__*/React__default["default"].createElement(styled$6.Message, null, message));
9551
9553
  };
9552
9554
 
9553
- DefaultError.defaultProps = {
9554
- message: 'something went wrong error'
9555
- };
9556
-
9557
- var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
9558
- _inherits$2(ErrorBoundary, _React$Component);
9555
+ var ErrorBoundary = /*#__PURE__*/function (_React$PureComponent) {
9556
+ _inherits$2(ErrorBoundary, _React$PureComponent);
9559
9557
 
9560
9558
  var _super = _createSuper(ErrorBoundary);
9561
9559
 
@@ -9582,8 +9580,8 @@
9582
9580
  value: function render() {
9583
9581
  var _this$props = this.props,
9584
9582
  children = _this$props.children,
9585
- _this$props$errorCont = _this$props.errorContent,
9586
- errorContent = _this$props$errorCont === void 0 ? /*#__PURE__*/React__default["default"].createElement(DefaultError, null) : _this$props$errorCont,
9583
+ _this$props$errorComp = _this$props.errorComponent,
9584
+ errorComponent = _this$props$errorComp === void 0 ? /*#__PURE__*/React__default["default"].createElement(DefaultError, null) : _this$props$errorComp,
9587
9585
  message = _this$props.message;
9588
9586
  if (!children) return null;
9589
9587
 
@@ -9591,7 +9589,7 @@
9591
9589
  // You can render any custom fallback UI
9592
9590
  return message ? /*#__PURE__*/React__default["default"].createElement(DefaultError, {
9593
9591
  message: message
9594
- }) : errorContent;
9592
+ }) : errorComponent;
9595
9593
  }
9596
9594
 
9597
9595
  return children;
@@ -9607,7 +9605,7 @@
9607
9605
  }]);
9608
9606
 
9609
9607
  return ErrorBoundary;
9610
- }(React__default["default"].Component);
9608
+ }(React__default["default"].PureComponent);
9611
9609
 
9612
9610
  /**
9613
9611
  * Depending of the given value returns a height measure