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
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
fallbackAxisSideDirection: 'start',
|
|
106
106
|
}),
|
|
107
107
|
dom.shift({ padding: 5 }),
|
|
108
|
-
], border, }) => {
|
|
108
|
+
], border, arrowSize = 8, }) => {
|
|
109
109
|
if (!elementReference) {
|
|
110
110
|
// elementReference can be null or undefined and we will not compute the position
|
|
111
111
|
// eslint-disable-next-line no-console
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
right: '',
|
|
160
160
|
bottom: '',
|
|
161
161
|
...borderSide,
|
|
162
|
-
[staticSide]: `-${
|
|
162
|
+
[staticSide]: `-${arrowSize / 2 + borderWidth}px`,
|
|
163
163
|
};
|
|
164
164
|
/* c8 ignore end */
|
|
165
165
|
return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement };
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
// props
|
|
400
400
|
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,
|
|
401
401
|
// props handled by controller
|
|
402
|
-
content, contentWrapperRef, isOpen, defaultIsOpen = false, setIsOpen, activeAnchor, setActiveAnchor, border, opacity, arrowColor, role = 'tooltip', }) => {
|
|
402
|
+
content, contentWrapperRef, isOpen, defaultIsOpen = false, setIsOpen, activeAnchor, setActiveAnchor, border, opacity, arrowColor, arrowSize = 8, role = 'tooltip', }) => {
|
|
403
403
|
var _a;
|
|
404
404
|
const tooltipRef = React.useRef(null);
|
|
405
405
|
const tooltipArrowRef = React.useRef(null);
|
|
@@ -660,6 +660,7 @@
|
|
|
660
660
|
strategy: positionStrategy,
|
|
661
661
|
middlewares,
|
|
662
662
|
border,
|
|
663
|
+
arrowSize,
|
|
663
664
|
}).then((computedStylesData) => {
|
|
664
665
|
handleComputedPosition(computedStylesData);
|
|
665
666
|
});
|
|
@@ -747,6 +748,7 @@
|
|
|
747
748
|
strategy: positionStrategy,
|
|
748
749
|
middlewares,
|
|
749
750
|
border,
|
|
751
|
+
arrowSize,
|
|
750
752
|
}).then((computedStylesData) => {
|
|
751
753
|
if (!mounted.current) {
|
|
752
754
|
// invalidate computed positions after remount
|
|
@@ -766,6 +768,7 @@
|
|
|
766
768
|
position,
|
|
767
769
|
imperativeOptions === null || imperativeOptions === void 0 ? void 0 : imperativeOptions.position,
|
|
768
770
|
float,
|
|
771
|
+
arrowSize,
|
|
769
772
|
]);
|
|
770
773
|
React.useEffect(() => {
|
|
771
774
|
var _a, _b;
|
|
@@ -1150,6 +1153,7 @@
|
|
|
1150
1153
|
background: arrowColor
|
|
1151
1154
|
? `linear-gradient(to right bottom, transparent 50%, ${arrowColor} 50%)`
|
|
1152
1155
|
: undefined,
|
|
1156
|
+
'--rt-arrow-size': `${arrowSize}px`,
|
|
1153
1157
|
}, ref: tooltipArrowRef }))) : null;
|
|
1154
1158
|
};
|
|
1155
1159
|
|
|
@@ -1158,7 +1162,7 @@
|
|
|
1158
1162
|
return React__default["default"].createElement("span", { dangerouslySetInnerHTML: { __html: content } });
|
|
1159
1163
|
};
|
|
1160
1164
|
|
|
1161
|
-
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) => {
|
|
1165
|
+
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) => {
|
|
1162
1166
|
const [tooltipContent, setTooltipContent] = React.useState(content);
|
|
1163
1167
|
const [tooltipHtml, setTooltipHtml] = React.useState(html);
|
|
1164
1168
|
const [tooltipPlace, setTooltipPlace] = React.useState(place);
|
|
@@ -1428,6 +1432,7 @@
|
|
|
1428
1432
|
border,
|
|
1429
1433
|
opacity,
|
|
1430
1434
|
arrowColor,
|
|
1435
|
+
arrowSize,
|
|
1431
1436
|
setIsOpen,
|
|
1432
1437
|
afterShow,
|
|
1433
1438
|
afterHide,
|
|
@@ -1450,6 +1455,7 @@
|
|
|
1450
1455
|
--rt-opacity: 0.9;
|
|
1451
1456
|
--rt-transition-show-delay: 0.15s;
|
|
1452
1457
|
--rt-transition-closing-delay: 0.15s;
|
|
1458
|
+
--rt-arrow-size: 8px;
|
|
1453
1459
|
}
|
|
1454
1460
|
|
|
1455
1461
|
.core-styles-module_tooltip__3vRRp {
|
|
@@ -1468,6 +1474,7 @@
|
|
|
1468
1474
|
.core-styles-module_arrow__cvMwQ {
|
|
1469
1475
|
position: absolute;
|
|
1470
1476
|
background: inherit;
|
|
1477
|
+
z-index: -1;
|
|
1471
1478
|
}
|
|
1472
1479
|
|
|
1473
1480
|
.core-styles-module_noArrow__xock6 {
|
|
@@ -1499,8 +1506,8 @@
|
|
|
1499
1506
|
}
|
|
1500
1507
|
|
|
1501
1508
|
.styles-module_arrow__K0L3T {
|
|
1502
|
-
width:
|
|
1503
|
-
height:
|
|
1509
|
+
width: var(--rt-arrow-size);
|
|
1510
|
+
height: var(--rt-arrow-size);
|
|
1504
1511
|
}
|
|
1505
1512
|
|
|
1506
1513
|
[class*='react-tooltip__place-top'] > .styles-module_arrow__K0L3T {
|