@canonical/react-components 0.51.1 → 0.51.3

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.
@@ -32,11 +32,10 @@ const generateError = (error, caution, success, validationId) => {
32
32
  if (!error && !caution && !success) {
33
33
  return null;
34
34
  }
35
- const messageType = error && "Error" || caution && "Caution" || success && "Success";
36
35
  return /*#__PURE__*/_react.default.createElement("p", {
37
36
  className: "p-form-validation__message",
38
37
  id: validationId
39
- }, /*#__PURE__*/_react.default.createElement("strong", null, messageType, ":"), " ", error || caution || success);
38
+ }, error || caution || success);
40
39
  };
41
40
  const generateLabel = (forId, required, label, labelClassName, stacked) => {
42
41
  if (!label) {
@@ -191,12 +191,12 @@ const Tooltip = _ref => {
191
191
  };
192
192
  }, [handleKeyPress]);
193
193
  const handleBlur = e => {
194
- var _wrapperRef$current, _messageRef$current;
194
+ var _wrapperRef$current, _messageRef$current, _wrapperRef$current2;
195
195
  // do not close if the focus is within the tooltip wrapper
196
196
  if (wrapperRef !== null && wrapperRef !== void 0 && (_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(document.activeElement)) {
197
197
  return;
198
198
  }
199
- if (e.relatedTarget ? !((_messageRef$current = messageRef.current) !== null && _messageRef$current !== void 0 && _messageRef$current.contains(e.relatedTarget)) : e.target !== messageRef.current) {
199
+ if (e.relatedTarget ? !((_messageRef$current = messageRef.current) !== null && _messageRef$current !== void 0 && _messageRef$current.contains(e.relatedTarget)) && !((_wrapperRef$current2 = wrapperRef.current) !== null && _wrapperRef$current2 !== void 0 && _wrapperRef$current2.contains(e.relatedTarget)) : e.target !== messageRef.current) {
200
200
  cancelableClosePortal();
201
201
  }
202
202
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-components",
3
- "version": "0.51.1",
3
+ "version": "0.51.3",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "Huw Wilkins <huw.wilkins@canonical.com>",