krl-alfred 2.17.41 → 2.17.42
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,3 +1,3 @@
|
|
|
1
1
|
import { TooltipProps } from "./props";
|
|
2
|
-
declare const Tooltip: ({ iconWidth, iconHeight, children, title, popupWidth, hasClickAction, hasCloseOnOutsideClick, isOpen, position, popupSize, popupLeft, popupRight, id, selectorTitle, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Tooltip: ({ iconWidth, iconHeight, children, title, popupWidth, hasClickAction, hasCloseOnOutsideClick, isOpen, position, popupSize, popupLeft, popupRight, id, selectorTitle, popupRightSm, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Tooltip;
|
|
@@ -21,13 +21,13 @@ var Tooltip_styled_1 = require("./Tooltip.styled");
|
|
|
21
21
|
var Icon_1 = __importDefault(require("../Icon/Icon"));
|
|
22
22
|
var useOnClickOutside_1 = __importDefault(require("../../hooks/useOnClickOutside"));
|
|
23
23
|
var Tooltip = function (_a) {
|
|
24
|
-
var _b = _a.iconWidth, iconWidth = _b === void 0 ? props_1.TooltipDefault.iconWidth : _b, _c = _a.iconHeight, iconHeight = _c === void 0 ? props_1.TooltipDefault.iconHeight : _c, _d = _a.children, children = _d === void 0 ? props_1.TooltipDefault.children : _d, _e = _a.title, title = _e === void 0 ? props_1.TooltipDefault.title : _e, _f = _a.popupWidth, popupWidth = _f === void 0 ? props_1.TooltipDefault.popupWidth : _f, _g = _a.hasClickAction, hasClickAction = _g === void 0 ? props_1.TooltipDefault.hasClickAction : _g, _h = _a.hasCloseOnOutsideClick, hasCloseOnOutsideClick = _h === void 0 ? props_1.TooltipDefault.hasCloseOnOutsideClick : _h, _j = _a.isOpen, isOpen = _j === void 0 ? props_1.TooltipDefault.isOpen : _j, _k = _a.position, position = _k === void 0 ? props_1.TooltipDefault.position : _k, _l = _a.popupSize, popupSize = _l === void 0 ? props_1.TooltipDefault.popupSize : _l, _m = _a.popupLeft, popupLeft = _m === void 0 ? props_1.TooltipDefault.popupLeft : _m, _o = _a.popupRight, popupRight = _o === void 0 ? props_1.TooltipDefault.popupRight : _o, _p = _a.id, id = _p === void 0 ? props_1.TooltipDefault.id : _p, _q = _a.selectorTitle, selectorTitle = _q === void 0 ? props_1.TooltipDefault.selectorTitle : _q;
|
|
25
|
-
var
|
|
24
|
+
var _b = _a.iconWidth, iconWidth = _b === void 0 ? props_1.TooltipDefault.iconWidth : _b, _c = _a.iconHeight, iconHeight = _c === void 0 ? props_1.TooltipDefault.iconHeight : _c, _d = _a.children, children = _d === void 0 ? props_1.TooltipDefault.children : _d, _e = _a.title, title = _e === void 0 ? props_1.TooltipDefault.title : _e, _f = _a.popupWidth, popupWidth = _f === void 0 ? props_1.TooltipDefault.popupWidth : _f, _g = _a.hasClickAction, hasClickAction = _g === void 0 ? props_1.TooltipDefault.hasClickAction : _g, _h = _a.hasCloseOnOutsideClick, hasCloseOnOutsideClick = _h === void 0 ? props_1.TooltipDefault.hasCloseOnOutsideClick : _h, _j = _a.isOpen, isOpen = _j === void 0 ? props_1.TooltipDefault.isOpen : _j, _k = _a.position, position = _k === void 0 ? props_1.TooltipDefault.position : _k, _l = _a.popupSize, popupSize = _l === void 0 ? props_1.TooltipDefault.popupSize : _l, _m = _a.popupLeft, popupLeft = _m === void 0 ? props_1.TooltipDefault.popupLeft : _m, _o = _a.popupRight, popupRight = _o === void 0 ? props_1.TooltipDefault.popupRight : _o, _p = _a.id, id = _p === void 0 ? props_1.TooltipDefault.id : _p, _q = _a.selectorTitle, selectorTitle = _q === void 0 ? props_1.TooltipDefault.selectorTitle : _q, _r = _a.popupRightSm, popupRightSm = _r === void 0 ? props_1.TooltipDefault.popupRightSm : _r;
|
|
25
|
+
var _s = (0, react_1.useState)(isOpen), isOpenTooltip = _s[0], setIsOpenTooltip = _s[1];
|
|
26
26
|
(0, react_1.useEffect)(function () {
|
|
27
27
|
setIsOpenTooltip(isOpen);
|
|
28
28
|
}, [isOpen]);
|
|
29
29
|
var tooltipRef = (0, react_1.useRef)();
|
|
30
30
|
(0, useOnClickOutside_1.default)(tooltipRef, function () { return setIsOpenTooltip(false); }, hasCloseOnOutsideClick);
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(Tooltip_styled_1.TooltipStyled, __assign({ id: id, ref: tooltipRef, "$hasClickAction": hasClickAction }, { children: [(0, jsx_runtime_1.jsxs)(Tooltip_styled_1.Selector, __assign({ "$isOpen": isOpenTooltip, "$position": position, "$hasClickAction": hasClickAction, onClick: function () { return setIsOpenTooltip(!isOpenTooltip); } }, { children: [(0, jsx_runtime_1.jsx)(Tooltip_styled_1.SelectorIconWrapper, __assign({ "$isOpen": isOpenTooltip, "$position": position, "$hasClickAction": hasClickAction }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: iconWidth === "16px" ? "InfoSquareSmall" : "InfoSquare", width: iconWidth, height: iconHeight }) })), selectorTitle && (0, jsx_runtime_1.jsx)(Tooltip_styled_1.SelectorTitle, { children: selectorTitle })] })), (0, jsx_runtime_1.jsx)(Tooltip_styled_1.PopupWrapper, __assign({ "$iconWidth": iconWidth }, { children: (0, jsx_runtime_1.jsxs)(Tooltip_styled_1.Popup, __assign({ "$popupSize": popupSize, "$position": position, "$popupWidth": popupWidth, "$isOpen": isOpenTooltip, "$hasClickAction": hasClickAction, "$popupLeft": popupLeft, "$popupRight": popupRight, className: "customPopup" }, { children: [title && (0, jsx_runtime_1.jsx)(Tooltip_styled_1.Title, { children: title }), children] })) }))] })));
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(Tooltip_styled_1.TooltipStyled, __assign({ id: id, ref: tooltipRef, "$hasClickAction": hasClickAction }, { children: [(0, jsx_runtime_1.jsxs)(Tooltip_styled_1.Selector, __assign({ "$isOpen": isOpenTooltip, "$position": position, "$hasClickAction": hasClickAction, onClick: function () { return setIsOpenTooltip(!isOpenTooltip); } }, { children: [(0, jsx_runtime_1.jsx)(Tooltip_styled_1.SelectorIconWrapper, __assign({ "$isOpen": isOpenTooltip, "$position": position, "$hasClickAction": hasClickAction }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: iconWidth === "16px" ? "InfoSquareSmall" : "InfoSquare", width: iconWidth, height: iconHeight }) })), selectorTitle && (0, jsx_runtime_1.jsx)(Tooltip_styled_1.SelectorTitle, { children: selectorTitle })] })), (0, jsx_runtime_1.jsx)(Tooltip_styled_1.PopupWrapper, __assign({ "$iconWidth": iconWidth }, { children: (0, jsx_runtime_1.jsxs)(Tooltip_styled_1.Popup, __assign({ "$popupSize": popupSize, "$position": position, "$popupWidth": popupWidth, "$isOpen": isOpenTooltip, "$hasClickAction": hasClickAction, "$popupLeft": popupLeft, "$popupRight": popupRight, "$popupRightSm": popupRightSm, className: "customPopup" }, { children: [title && (0, jsx_runtime_1.jsx)(Tooltip_styled_1.Title, { children: title }), children] })) }))] })));
|
|
32
32
|
};
|
|
33
33
|
exports.default = Tooltip;
|
|
@@ -58,6 +58,6 @@ exports.Popup = styled_components_1.default.div(templateObject_6 || (templateObj
|
|
|
58
58
|
default:
|
|
59
59
|
return "\n left: 50%;\n bottom: calc(100% + 10px);\n transform: translateX(-50%);\n ";
|
|
60
60
|
}
|
|
61
|
-
}, devices_1.devices.xl, function (props) { return props.$popupRight || "-1.5rem"; });
|
|
61
|
+
}, devices_1.devices.xl, function (props) { return props.$popupRight || props.$popupRightSm || "-1.5rem"; });
|
|
62
62
|
exports.PopupWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: ", ";\n height: 100%;\n"], ["\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: ", ";\n height: 100%;\n"])), function (props) { return props.$iconWidth ? props.$iconWidth : "16px"; });
|
|
63
63
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -16,12 +16,14 @@ export interface Tooltip {
|
|
|
16
16
|
popupSize?: SIZE;
|
|
17
17
|
popupLeft?: string;
|
|
18
18
|
popupRight?: string;
|
|
19
|
+
popupRightSm?: string;
|
|
19
20
|
id?: string;
|
|
20
21
|
selectorTitle?: React.ReactNode;
|
|
21
22
|
}
|
|
22
23
|
export interface TooltipStyledProps {
|
|
23
24
|
$iconWidth?: string;
|
|
24
25
|
$popupRight?: string;
|
|
26
|
+
$popupRightSm?: string;
|
|
25
27
|
$hasClickAction?: boolean;
|
|
26
28
|
$isOpen?: boolean;
|
|
27
29
|
$position?: POSITION;
|