@codacy/ui-components 0.65.37 → 0.65.38

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.
@@ -11,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
11
11
  var _Tooltip = require("../Tooltip");
12
12
  var _ = require("..");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- var _excluded = ["helpContent", "textAlignment", "placement", "tooltipMaxWidth"];
14
+ var _excluded = ["helpContent", "textAlignment", "placement", "tooltipMaxWidth", "selfClose", "withArrow"];
15
15
  var HelpIcon = function HelpIcon() {
16
16
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
17
17
  xmlns: "http://www.w3.org/2000/svg",
@@ -43,12 +43,16 @@ var MoreInfo = exports.MoreInfo = function MoreInfo(_ref) {
43
43
  textAlignment = _ref.textAlignment,
44
44
  placement = _ref.placement,
45
45
  tooltipMaxWidth = _ref.tooltipMaxWidth,
46
+ selfClose = _ref.selfClose,
47
+ withArrow = _ref.withArrow,
46
48
  props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
47
49
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
48
50
  content: helpContent,
49
51
  textAlignment: textAlignment,
50
52
  placement: placement,
51
53
  maxWidth: tooltipMaxWidth,
54
+ selfClose: selfClose,
55
+ withArrow: withArrow,
52
56
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, (0, _objectSpread2["default"])({
53
57
  icon: HelpIcon,
54
58
  color: "icon-enabled",
@@ -3,4 +3,6 @@ import { IconProps } from '../Icon/Icon.types';
3
3
  export interface MoreInfoProps extends TooltipPositionProps, Omit<IconProps, 'icon'> {
4
4
  tooltipMaxWidth?: string;
5
5
  helpContent: TooltipContentProps['content'];
6
+ selfClose?: boolean;
7
+ withArrow?: boolean;
6
8
  }
@@ -77,19 +77,17 @@ var Tooltip = exports.Tooltip = function Tooltip(_ref) {
77
77
  styles = _usePopper.styles,
78
78
  attributes = _usePopper.attributes;
79
79
  var handleEnter = (0, _react.useCallback)(function () {
80
- if (!selfClose) {
81
- setTimer(function (prevTimer) {
82
- if (prevTimer) {
83
- clearTimeout(prevTimer);
84
- }
85
- return setTimeout(function () {
86
- setVisible(true);
87
- }, Math.max(delay, 500));
88
- });
89
- }
90
- }, [delay, selfClose]);
80
+ setTimer(function (prevTimer) {
81
+ if (prevTimer) {
82
+ clearTimeout(prevTimer);
83
+ }
84
+ return setTimeout(function () {
85
+ setVisible(true);
86
+ }, Math.max(delay, 500));
87
+ });
88
+ }, [delay]);
91
89
  var handleOver = (0, _react.useCallback)(function () {
92
- if (!selfClose && !visible) {
90
+ if (!visible) {
93
91
  setTimer(function (prevTimer) {
94
92
  if (prevTimer) {
95
93
  clearTimeout(prevTimer);
@@ -99,19 +97,17 @@ var Tooltip = exports.Tooltip = function Tooltip(_ref) {
99
97
  }, Math.max(delay, 500));
100
98
  });
101
99
  }
102
- }, [delay, selfClose, visible]);
100
+ }, [delay, visible]);
103
101
  var handleLeave = (0, _react.useCallback)(function () {
104
- if (!selfClose) {
105
- setTimer(function (prevTimer) {
106
- if (prevTimer) {
107
- clearTimeout(prevTimer);
108
- }
109
- return setTimeout(function () {
110
- setVisible(false);
111
- }, 500);
112
- });
113
- }
114
- }, [selfClose]);
102
+ setTimer(function (prevTimer) {
103
+ if (prevTimer) {
104
+ clearTimeout(prevTimer);
105
+ }
106
+ return setTimeout(function () {
107
+ setVisible(false);
108
+ }, 500);
109
+ });
110
+ }, []);
115
111
  (0, _react.useEffect)(function () {
116
112
  if (selfClose) {
117
113
  var timer = setTimeout(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/ui-components",
3
- "version": "0.65.37",
3
+ "version": "0.65.38",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",