react-tooltip 5.28.1 → 5.29.0
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/react-tooltip-tokens.css +1 -0
- package/dist/react-tooltip.cjs +13 -6
- package/dist/react-tooltip.cjs.map +1 -1
- package/dist/react-tooltip.css +4 -2
- package/dist/react-tooltip.d.ts +1 -0
- package/dist/react-tooltip.min.cjs +2 -2
- package/dist/react-tooltip.min.cjs.map +1 -1
- package/dist/react-tooltip.min.css +1 -1
- package/dist/react-tooltip.min.mjs +2 -2
- package/dist/react-tooltip.min.mjs.map +1 -1
- package/dist/react-tooltip.mjs +13 -6
- package/dist/react-tooltip.mjs.map +1 -1
- package/dist/react-tooltip.umd.js +13 -6
- package/dist/react-tooltip.umd.js.map +1 -1
- package/dist/react-tooltip.umd.min.js +2 -2
- package/dist/react-tooltip.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/react-tooltip.cjs
CHANGED
|
@@ -107,7 +107,7 @@ const computeTooltipPosition = async ({ elementReference = null, tooltipReferenc
|
|
|
107
107
|
fallbackAxisSideDirection: 'start',
|
|
108
108
|
}),
|
|
109
109
|
dom.shift({ padding: 5 }),
|
|
110
|
-
], border, }) => {
|
|
110
|
+
], border, arrowSize = 8, }) => {
|
|
111
111
|
if (!elementReference) {
|
|
112
112
|
// elementReference can be null or undefined and we will not compute the position
|
|
113
113
|
// eslint-disable-next-line no-console
|
|
@@ -161,7 +161,7 @@ const computeTooltipPosition = async ({ elementReference = null, tooltipReferenc
|
|
|
161
161
|
right: '',
|
|
162
162
|
bottom: '',
|
|
163
163
|
...borderSide,
|
|
164
|
-
[staticSide]: `-${
|
|
164
|
+
[staticSide]: `-${arrowSize / 2 + borderWidth}px`,
|
|
165
165
|
};
|
|
166
166
|
/* c8 ignore end */
|
|
167
167
|
return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement };
|
|
@@ -401,7 +401,7 @@ const Tooltip = ({
|
|
|
401
401
|
// props
|
|
402
402
|
forwardRef, id, className, classNameArrow, variant = 'dark', anchorId, anchorSelect, place = 'top', offset = 10, events = ['hover'], openOnClick = false, positionStrategy = 'absolute', middlewares, wrapper: WrapperElement, delayShow = 0, delayHide = 0, float = false, hidden = false, noArrow = false, clickable = false, closeOnEsc = false, closeOnScroll = false, closeOnResize = false, openEvents, closeEvents, globalCloseEvents, imperativeModeOnly, style: externalStyles, position, afterShow, afterHide, disableTooltip,
|
|
403
403
|
// props handled by controller
|
|
404
|
-
content, contentWrapperRef, isOpen, defaultIsOpen = false, setIsOpen, activeAnchor, setActiveAnchor, border, opacity, arrowColor, role = 'tooltip', }) => {
|
|
404
|
+
content, contentWrapperRef, isOpen, defaultIsOpen = false, setIsOpen, activeAnchor, setActiveAnchor, border, opacity, arrowColor, arrowSize = 8, role = 'tooltip', }) => {
|
|
405
405
|
var _a;
|
|
406
406
|
const tooltipRef = React.useRef(null);
|
|
407
407
|
const tooltipArrowRef = React.useRef(null);
|
|
@@ -662,6 +662,7 @@ content, contentWrapperRef, isOpen, defaultIsOpen = false, setIsOpen, activeAnch
|
|
|
662
662
|
strategy: positionStrategy,
|
|
663
663
|
middlewares,
|
|
664
664
|
border,
|
|
665
|
+
arrowSize,
|
|
665
666
|
}).then((computedStylesData) => {
|
|
666
667
|
handleComputedPosition(computedStylesData);
|
|
667
668
|
});
|
|
@@ -749,6 +750,7 @@ content, contentWrapperRef, isOpen, defaultIsOpen = false, setIsOpen, activeAnch
|
|
|
749
750
|
strategy: positionStrategy,
|
|
750
751
|
middlewares,
|
|
751
752
|
border,
|
|
753
|
+
arrowSize,
|
|
752
754
|
}).then((computedStylesData) => {
|
|
753
755
|
if (!mounted.current) {
|
|
754
756
|
// invalidate computed positions after remount
|
|
@@ -768,6 +770,7 @@ content, contentWrapperRef, isOpen, defaultIsOpen = false, setIsOpen, activeAnch
|
|
|
768
770
|
position,
|
|
769
771
|
imperativeOptions === null || imperativeOptions === void 0 ? void 0 : imperativeOptions.position,
|
|
770
772
|
float,
|
|
773
|
+
arrowSize,
|
|
771
774
|
]);
|
|
772
775
|
React.useEffect(() => {
|
|
773
776
|
var _a, _b;
|
|
@@ -1152,6 +1155,7 @@ content, contentWrapperRef, isOpen, defaultIsOpen = false, setIsOpen, activeAnch
|
|
|
1152
1155
|
background: arrowColor
|
|
1153
1156
|
? `linear-gradient(to right bottom, transparent 50%, ${arrowColor} 50%)`
|
|
1154
1157
|
: undefined,
|
|
1158
|
+
'--rt-arrow-size': `${arrowSize}px`,
|
|
1155
1159
|
}, ref: tooltipArrowRef }))) : null;
|
|
1156
1160
|
};
|
|
1157
1161
|
|
|
@@ -1160,7 +1164,7 @@ const TooltipContent = ({ content }) => {
|
|
|
1160
1164
|
return React__default["default"].createElement("span", { dangerouslySetInnerHTML: { __html: content } });
|
|
1161
1165
|
};
|
|
1162
1166
|
|
|
1163
|
-
const TooltipController = React__default["default"].forwardRef(({ id, anchorId, anchorSelect, content, html, render, className, classNameArrow, variant = 'dark', place = 'top', offset = 10, wrapper = 'div', children = null, events = ['hover'], openOnClick = false, positionStrategy = 'absolute', middlewares, delayShow = 0, delayHide = 0, float = false, hidden = false, noArrow = false, clickable = false, closeOnEsc = false, closeOnScroll = false, closeOnResize = false, openEvents, closeEvents, globalCloseEvents, imperativeModeOnly = false, style, position, isOpen, defaultIsOpen = false, disableStyleInjection = false, border, opacity, arrowColor, setIsOpen, afterShow, afterHide, disableTooltip, role = 'tooltip', }, ref) => {
|
|
1167
|
+
const TooltipController = React__default["default"].forwardRef(({ id, anchorId, anchorSelect, content, html, render, className, classNameArrow, variant = 'dark', place = 'top', offset = 10, wrapper = 'div', children = null, events = ['hover'], openOnClick = false, positionStrategy = 'absolute', middlewares, delayShow = 0, delayHide = 0, float = false, hidden = false, noArrow = false, clickable = false, closeOnEsc = false, closeOnScroll = false, closeOnResize = false, openEvents, closeEvents, globalCloseEvents, imperativeModeOnly = false, style, position, isOpen, defaultIsOpen = false, disableStyleInjection = false, border, opacity, arrowColor, arrowSize, setIsOpen, afterShow, afterHide, disableTooltip, role = 'tooltip', }, ref) => {
|
|
1164
1168
|
const [tooltipContent, setTooltipContent] = React.useState(content);
|
|
1165
1169
|
const [tooltipHtml, setTooltipHtml] = React.useState(html);
|
|
1166
1170
|
const [tooltipPlace, setTooltipPlace] = React.useState(place);
|
|
@@ -1430,6 +1434,7 @@ const TooltipController = React__default["default"].forwardRef(({ id, anchorId,
|
|
|
1430
1434
|
border,
|
|
1431
1435
|
opacity,
|
|
1432
1436
|
arrowColor,
|
|
1437
|
+
arrowSize,
|
|
1433
1438
|
setIsOpen,
|
|
1434
1439
|
afterShow,
|
|
1435
1440
|
afterHide,
|
|
@@ -1452,6 +1457,7 @@ const TooltipCoreStyles = `:root {
|
|
|
1452
1457
|
--rt-opacity: 0.9;
|
|
1453
1458
|
--rt-transition-show-delay: 0.15s;
|
|
1454
1459
|
--rt-transition-closing-delay: 0.15s;
|
|
1460
|
+
--rt-arrow-size: 8px;
|
|
1455
1461
|
}
|
|
1456
1462
|
|
|
1457
1463
|
.core-styles-module_tooltip__3vRRp {
|
|
@@ -1470,6 +1476,7 @@ const TooltipCoreStyles = `:root {
|
|
|
1470
1476
|
.core-styles-module_arrow__cvMwQ {
|
|
1471
1477
|
position: absolute;
|
|
1472
1478
|
background: inherit;
|
|
1479
|
+
z-index: -1;
|
|
1473
1480
|
}
|
|
1474
1481
|
|
|
1475
1482
|
.core-styles-module_noArrow__xock6 {
|
|
@@ -1501,8 +1508,8 @@ const TooltipStyles = `
|
|
|
1501
1508
|
}
|
|
1502
1509
|
|
|
1503
1510
|
.styles-module_arrow__K0L3T {
|
|
1504
|
-
width:
|
|
1505
|
-
height:
|
|
1511
|
+
width: var(--rt-arrow-size);
|
|
1512
|
+
height: var(--rt-arrow-size);
|
|
1506
1513
|
}
|
|
1507
1514
|
|
|
1508
1515
|
[class*='react-tooltip__place-top'] > .styles-module_arrow__K0L3T {
|