intelicoreact 1.3.71 → 1.3.72
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.
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _reactDom = require("react-dom");
|
|
11
11
|
var _reactFeather = require("react-feather");
|
|
12
|
+
var _utils = require("../../../Functions/utils");
|
|
12
13
|
var _CustomIcons = require("./../../../Molecular/CustomIcons");
|
|
13
14
|
require("./Hint.scss");
|
|
14
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -28,7 +29,8 @@ const Hint = _ref => {
|
|
|
28
29
|
id,
|
|
29
30
|
children,
|
|
30
31
|
icon,
|
|
31
|
-
isAccessability = false
|
|
32
|
+
isAccessability = false,
|
|
33
|
+
testId = "test-hint"
|
|
32
34
|
} = _ref;
|
|
33
35
|
const hintId = (_ref2 = key !== null && key !== void 0 ? key : id) !== null && _ref2 !== void 0 ? _ref2 : time;
|
|
34
36
|
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
@@ -95,7 +97,7 @@ const Hint = _ref => {
|
|
|
95
97
|
ref: hintRef
|
|
96
98
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
97
99
|
tabIndex: isAccessability ? 0 : -1,
|
|
98
|
-
"data-testid":
|
|
100
|
+
"data-testid": typeof label === "string" && label.length ? label.replace(/\s/g, "-") : testId,
|
|
99
101
|
"aria-label": isAccessability && label || "",
|
|
100
102
|
onClick: () => handleOpenType === "click" && (isCallbackExist ? onClickCallback() : setIsOpen(!isOpen)),
|
|
101
103
|
onMouseEnter: () => handleOpenType === "hover" && setIsOpen(!isOpen),
|
|
@@ -103,7 +105,7 @@ const Hint = _ref => {
|
|
|
103
105
|
className: (0, _classnames.default)("hint__button", {
|
|
104
106
|
hint__button_active: isOpen
|
|
105
107
|
})
|
|
106
|
-
}, icon || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, variant === "outlined" && /*#__PURE__*/_react.default.createElement(_reactFeather.HelpCircle, {
|
|
108
|
+
}, icon || icon === null || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, variant === "outlined" && /*#__PURE__*/_react.default.createElement(_reactFeather.HelpCircle, {
|
|
107
109
|
width: 16,
|
|
108
110
|
height: 16,
|
|
109
111
|
className: "hint__icon outlined"
|
|
@@ -118,6 +120,6 @@ const Hint = _ref => {
|
|
|
118
120
|
className: (0, _classnames.default)("hint__label", {
|
|
119
121
|
"color--primary": isOpen
|
|
120
122
|
})
|
|
121
|
-
},
|
|
123
|
+
}, (0, _utils.capitalized)(label))), isOpen && renderHintContainer());
|
|
122
124
|
};
|
|
123
125
|
var _default = exports.default = Hint;
|