Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-tooltip

Package Overview
Dependencies
Maintainers
6
Versions
344
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tooltip - npm Package Compare versions

Comparing version 6.0.0-beta.1179.rc.1 to 6.0.0-beta.1179.rc.2

2

dist/react-tooltip.d.ts

@@ -85,2 +85,3 @@ import React$1, { ElementType, ReactNode, CSSProperties } from 'react';

focus?: boolean
mouseover?: boolean
click?: boolean

@@ -93,2 +94,3 @@ dblclick?: boolean

blur?: boolean
mouseout?: boolean
click?: boolean

@@ -95,0 +97,0 @@ dblclick?: boolean

59

dist/react-tooltip.umd.js

@@ -47,7 +47,3 @@

if (document.getElementById(id)) {
// this should never happen because of `injected[type]`
{
// eslint-disable-next-line no-console
console.warn(`[react-tooltip] Element with id '${id}' already exists. Call \`removeStyle()\` first`);
}
// this could happen in cases the tooltip is imported by multiple js modules
return;

@@ -156,7 +152,2 @@ }

const cssSupports = (property, value) => {
const hasCssSupports = 'CSS' in window && 'supports' in window.CSS;
return hasCssSupports ? window.CSS.supports(property, value) : true;
};
const cssTimeToMs = (time) => {

@@ -258,2 +249,10 @@ const match = time.match(/^([\d.]+)(m?s)$/);

const clearTimeoutRef = (ref) => {
if (ref.current) {
clearTimeout(ref.current);
// eslint-disable-next-line no-param-reassign
ref.current = null;
}
};
var coreStyles = {"tooltip":"core-styles-module_tooltip__3vRRp","fixed":"core-styles-module_fixed__pcSol","arrow":"core-styles-module_arrow__cvMwQ","noArrow":"core-styles-module_noArrow__xock6","clickable":"core-styles-module_clickable__ZuTTB","show":"core-styles-module_show__Nt9eE","closing":"core-styles-module_closing__sGnxF"};

@@ -341,5 +340,3 @@

}
if (missedTransitionTimerRef.current) {
clearTimeout(missedTransitionTimerRef.current);
}
clearTimeoutRef(missedTransitionTimerRef);
wasShowing.current = show;

@@ -695,3 +692,3 @@ if (show) {

};
const regularEvents = ['mouseenter', 'mouseleave', 'focus', 'blur'];
const regularEvents = ['mouseover', 'mouseout', 'mouseenter', 'mouseleave', 'focus', 'blur'];
const clickEvents = ['click', 'dblclick', 'mousedown', 'mouseup'];

@@ -840,8 +837,4 @@ Object.entries(actualOpenEvents).forEach(([event, enabled]) => {

setActiveAnchor(null);
if (tooltipShowDelayTimerRef.current) {
clearTimeout(tooltipShowDelayTimerRef.current);
}
if (tooltipHideDelayTimerRef.current) {
clearTimeout(tooltipHideDelayTimerRef.current);
}
clearTimeoutRef(tooltipShowDelayTimerRef);
clearTimeoutRef(tooltipHideDelayTimerRef);
return true;

@@ -965,8 +958,4 @@ }

return () => {
if (tooltipShowDelayTimerRef.current) {
clearTimeout(tooltipShowDelayTimerRef.current);
}
if (tooltipHideDelayTimerRef.current) {
clearTimeout(tooltipHideDelayTimerRef.current);
}
clearTimeoutRef(tooltipShowDelayTimerRef);
clearTimeoutRef(tooltipHideDelayTimerRef);
};

@@ -994,3 +983,7 @@ }, [defaultIsOpen, handleShow]);

if (tooltipShowDelayTimerRef.current) {
clearTimeout(tooltipShowDelayTimerRef.current);
/**
* if the delay changes while the tooltip is waiting to show,
* reset the timer with the new delay
*/
clearTimeoutRef(tooltipShowDelayTimerRef);
handleShowTooltipDelayed(delayShow);

@@ -1036,5 +1029,3 @@ }

return rendered && !hidden && actualContent ? (React.createElement(WrapperElement, { id: id, role: role, className: clsx('react-tooltip', coreStyles['tooltip'], styles['tooltip'], styles[variant], className, `react-tooltip__place-${computedPosition.place}`, coreStyles[canShow ? 'show' : 'closing'], canShow ? 'react-tooltip__show' : 'react-tooltip__closing', positionStrategy === 'fixed' && coreStyles['fixed'], clickable && coreStyles['clickable']), onTransitionEnd: (event) => {
if (missedTransitionTimerRef.current) {
clearTimeout(missedTransitionTimerRef.current);
}
clearTimeoutRef(missedTransitionTimerRef);
if (show || event.propertyName !== 'opacity') {

@@ -1229,6 +1220,2 @@ return;

}
if (border && !cssSupports('border', `${border}`)) {
// eslint-disable-next-line no-console
console.warn(`[react-tooltip] "${border}" is not a valid \`border\`.`);
}
if (style === null || style === void 0 ? void 0 : style.opacity) {

@@ -1238,6 +1225,2 @@ // eslint-disable-next-line no-console

}
if (opacity && !cssSupports('opacity', `${opacity}`)) {
// eslint-disable-next-line no-console
console.warn(`[react-tooltip] "${opacity}" is not a valid \`opacity\`.`);
}
}, [border, opacity, style === null || style === void 0 ? void 0 : style.border, style === null || style === void 0 ? void 0 : style.opacity]);

@@ -1244,0 +1227,0 @@ /**

@@ -7,4 +7,4 @@ /*

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/dom"),require("clsx")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/dom","clsx"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.FloatingUIDOM,e.clsx)}(this,(function(e,t,o,l){"use strict";const r={core:!1,base:!1};function n({css:e,id:t="react-tooltip-base-styles",type:o="base",ref:l}){var n,s;if(!e||"undefined"==typeof document||r[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(s=null===process||void 0===process?void 0:process.env)||void 0===s?void 0:s.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t="react-tooltip-core-styles"),l||(l={});const{insertAt:c}=l;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.id=t,a.type="text/css","top"===c&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e)),r[o]=!0}const s=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:l=null,place:r="top",offset:n=10,strategy:s="absolute",middlewares:c=[o.offset(Number(n)),o.flip({fallbackAxisSideDirection:"start"}),o.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=c;return l?(a.push(o.arrow({element:l,padding:5})),o.computePosition(e,t,{placement:r,strategy:s,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const s={left:`${e}px`,top:`${t}px`,border:i},{x:c,y:a}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:s,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):o.computePosition(e,t,{placement:"bottom",strategy:s,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},c=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),i=(e,t,o)=>{let l=null;const r=function(...o){const r=()=>{l=null};l||(e.apply(this,o),l=setTimeout(r,t))};return r.cancel=()=>{l&&(clearTimeout(l),l=null)},r},a=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,u=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>u(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!a(e)||!a(t))return e===t;const o=Object.keys(e),l=Object.keys(t);return o.length===l.length&&o.every((o=>u(e[o],t[o])))},d=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},p=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(d(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},f="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var v={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},m={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const y=({forwardRef:e,id:r,className:n,classNameArrow:c,variant:a="dark",anchorSelect:d,place:y="top",offset:w=10,openOnClick:h=!1,positionStrategy:b="absolute",middlewares:E,wrapper:S,delayShow:g=0,delayHide:_=0,float:A=!1,hidden:k=!1,noArrow:T=!1,clickable:O=!1,openEvents:C,closeEvents:R,globalCloseEvents:x,imperativeModeOnly:L,style:N,position:$,afterShow:j,afterHide:I,content:B,contentWrapperRef:z,isOpen:D,defaultIsOpen:H=!1,setIsOpen:q,activeAnchor:M,setActiveAnchor:W,border:P,opacity:V,arrowColor:U,role:F="tooltip"})=>{var K;const X=t.useRef(null),Y=t.useRef(null),G=t.useRef(null),Z=t.useRef(null),J=t.useRef(null),[Q,ee]=t.useState({tooltipStyles:{},tooltipArrowStyles:{},place:y}),[te,oe]=t.useState(!1),[le,re]=t.useState(!1),[ne,se]=t.useState(null),ce=t.useRef(!1),ie=t.useRef(null),ae=t.useRef(!1),[ue,de]=t.useState([]),pe=t.useRef(!1);f((()=>(pe.current=!0,()=>{pe.current=!1})),[]);const fe=t.useCallback((e=>{pe.current&&(e&&re(!0),setTimeout((()=>{pe.current&&(null==q||q(e),void 0===D&&oe(e))}),10))}),[D,q]);t.useEffect((()=>{if(void 0===D)return()=>null;D&&re(!0);const e=setTimeout((()=>{oe(D)}),10);return()=>{clearTimeout(e)}}),[D]),t.useEffect((()=>{if(te!==ce.current)if(J.current&&clearTimeout(J.current),ce.current=te,te)null==j||j();else{const e=(e=>{const t=e.match(/^([\d.]+)(m?s)$/);if(!t)return 0;const[,o,l]=t;return Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));J.current=setTimeout((()=>{re(!1),se(null),null==I||I()}),e+25)}}),[I,j,te]);const ve=e=>{ee((t=>u(t,e)?t:e))},me=t.useCallback(((e=g)=>{G.current&&clearTimeout(G.current),le?fe(!0):G.current=setTimeout((()=>{fe(!0)}),e)}),[g,fe,le]),ye=t.useCallback(((e=_)=>{Z.current&&clearTimeout(Z.current),Z.current=setTimeout((()=>{ae.current||fe(!1)}),e)}),[_,fe]),we=t.useCallback((({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};s({place:null!==(o=null==ne?void 0:ne.place)&&void 0!==o?o:y,offset:w,elementReference:l,tooltipReference:X.current,tooltipArrowReference:Y.current,strategy:b,middlewares:E,border:P}).then((e=>{ve(e)}))}),[null==ne?void 0:ne.place,y,w,b,E,P]),he=t.useCallback((()=>{var e,t;const o=null!==(e=null==ne?void 0:ne.position)&&void 0!==e?e:$;o?we(o):A?ie.current&&we(ie.current):(null==M?void 0:M.isConnected)&&s({place:null!==(t=null==ne?void 0:ne.place)&&void 0!==t?t:y,offset:w,elementReference:M,tooltipReference:X.current,tooltipArrowReference:Y.current,strategy:b,middlewares:E,border:P}).then((e=>{pe.current&&ve(e)}))}),[null==ne?void 0:ne.position,null==ne?void 0:ne.place,$,A,M,y,w,b,E,P,we]);t.useEffect((()=>{const e=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};we(o),ie.current=o},t=e=>{var t;if(!te)return;const o=e.target;o.isConnected&&((null===(t=X.current)||void 0===t?void 0:t.contains(o))||ue.some((e=>null==e?void 0:e.contains(o)))||(fe(!1),G.current&&clearTimeout(G.current)))},l=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;(null==o?void 0:o.isConnected)?(g?me():fe(!0),W(o),Z.current&&clearTimeout(Z.current)):W(null)},r=()=>{O?ye(_||100):_?ye():fe(!1),G.current&&clearTimeout(G.current)},n=i(l,50),s=i(r,50),c=e=>{s.cancel(),n(e)},a=()=>{n.cancel(),s()},u=()=>{fe(!1)},d=h||(null==C?void 0:C.click)||(null==C?void 0:C.dblclick)||(null==C?void 0:C.mousedown),f=C?{...C}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!C&&h&&Object.assign(f,{mouseenter:!1,focus:!1,click:!0});const v=R?{...R}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!R&&h&&Object.assign(v,{mouseleave:!1,blur:!1});const m=x?{...x}:{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:d||!1};L&&(Object.assign(f,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(v,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(m,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1}));const y=X.current,w=p(X.current),b=p(M);m.scroll&&(window.addEventListener("scroll",u),null==b||b.addEventListener("scroll",u),null==w||w.addEventListener("scroll",u));let E=null;m.resize?window.addEventListener("resize",u):M&&X.current&&(E=o.autoUpdate(M,X.current,he,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const S=e=>{"Escape"===e.key&&fe(!1)};m.escape&&window.addEventListener("keydown",S),m.clickOutsideAnchor&&window.addEventListener("click",t);const k=[],T=e=>{te&&(null==e?void 0:e.target)===M||l(e)},N=e=>{te&&(null==e?void 0:e.target)===M&&r()},$=["mouseenter","mouseleave","focus","blur"],j=["click","dblclick","mousedown","mouseup"];Object.entries(f).forEach((([e,t])=>{t&&($.includes(e)?k.push({event:e,listener:c}):j.includes(e)&&k.push({event:e,listener:T}))})),Object.entries(v).forEach((([e,t])=>{t&&($.includes(e)?k.push({event:e,listener:a}):j.includes(e)&&k.push({event:e,listener:N}))})),A&&k.push({event:"pointermove",listener:e});const I=()=>{ae.current=!0},B=()=>{ae.current=!1,r()};return O&&!d&&(null==y||y.addEventListener("mouseenter",I),null==y||y.addEventListener("mouseleave",B)),k.forEach((({event:e,listener:t})=>{ue.forEach((o=>{o.addEventListener(e,t)}))})),()=>{m.scroll&&(window.removeEventListener("scroll",u),null==b||b.removeEventListener("scroll",u),null==w||w.removeEventListener("scroll",u)),m.resize?window.removeEventListener("resize",u):null==E||E(),m.clickOutsideAnchor&&window.removeEventListener("click",t),m.escape&&window.removeEventListener("keydown",S),O&&!d&&(null==y||y.removeEventListener("mouseenter",I),null==y||y.removeEventListener("mouseleave",B)),k.forEach((({event:e,listener:t})=>{ue.forEach((o=>{o.removeEventListener(e,t)}))}))}}),[M,ue,O,R,_,g,A,x,ye,fe,me,we,L,C,h,W,te,he]),t.useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==ne?void 0:ne.anchorSelect)&&void 0!==e?e:d)&&void 0!==t?t:"";!o&&r&&(o=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`);const l=new MutationObserver((e=>{const t=new Set,l=new Set;e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){const o=e.target;o.getAttribute("data-tooltip-id")===r?t.add(o):e.oldValue===r&&l.add(o)}if("childList"!==e.type)return;const n=[...e.removedNodes].filter((e=>1===e.nodeType));if(M&&n.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,M))&&(re(!1),fe(!1),W(null),G.current&&clearTimeout(G.current),Z.current&&clearTimeout(Z.current),!0)})),o){try{n.forEach((e=>{const t=e;t.matches(o)?l.add(t):t.querySelectorAll(o).forEach((e=>l.add(e)))}))}catch(e){console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`)}try{[...e.addedNodes].filter((e=>1===e.nodeType)).forEach((e=>{const l=e;l.matches(o)?t.add(l):l.querySelectorAll(o).forEach((e=>t.add(e)))}))}catch(e){console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`)}}})),(t.size||l.size)&&de((e=>[...e.filter((e=>!l.has(e))),...t]))}));return l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{l.disconnect()}}),[r,d,null==ne?void 0:ne.anchorSelect,M,fe,W]),t.useEffect((()=>{he()}),[he]),t.useEffect((()=>{if(!(null==z?void 0:z.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>he()))}));return e.observe(z.current),()=>{e.disconnect()}}),[B,z,he]),t.useEffect((()=>{var e;M&&ue.includes(M)||W(null!==(e=ue[0])&&void 0!==e?e:null)}),[ue,M,W]),t.useEffect((()=>(H&&fe(!0),()=>{G.current&&clearTimeout(G.current),Z.current&&clearTimeout(Z.current)})),[H,fe]),t.useEffect((()=>{var e;let t=null!==(e=null==ne?void 0:ne.anchorSelect)&&void 0!==e?e:d;if(!t&&r&&(t=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));de(e)}catch(e){de([])}}),[r,d,null==ne?void 0:ne.anchorSelect]),t.useEffect((()=>{G.current&&(clearTimeout(G.current),me(g))}),[g,me]);const be=null!==(K=null==ne?void 0:ne.content)&&void 0!==K?K:B,Ee=te&&Object.keys(Q.tooltipStyles).length>0;return t.useImperativeHandle(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}se(null!=e?e:null),(null==e?void 0:e.delay)?me(e.delay):fe(!0)},close:e=>{(null==e?void 0:e.delay)?ye(e.delay):fe(!1)},activeAnchor:M,place:Q.place,isOpen:Boolean(le&&!k&&be&&Ee)}))),le&&!k&&be?t.createElement(S,{id:r,role:F,className:l("react-tooltip",v.tooltip,m.tooltip,m[a],n,`react-tooltip__place-${Q.place}`,v[Ee?"show":"closing"],Ee?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&v.fixed,O&&v.clickable),onTransitionEnd:e=>{J.current&&clearTimeout(J.current),te||"opacity"!==e.propertyName||(re(!1),se(null),null==I||I())},style:{...N,...Q.tooltipStyles,opacity:void 0!==V&&Ee?V:void 0},ref:X},be,t.createElement(S,{className:l("react-tooltip-arrow",v.arrow,m.arrow,c,T&&v.noArrow),style:{...Q.tooltipArrowStyles,background:U?`linear-gradient(to right bottom, transparent 50%, ${U} 50%)`:void 0},ref:Y})):null},w=t.forwardRef((({id:e,anchorSelect:o,content:r,render:n,className:s,classNameArrow:i,variant:a="dark",place:u="top",offset:d=10,wrapper:p="div",children:f=null,openOnClick:v=!1,positionStrategy:m="absolute",middlewares:w,delayShow:h=0,delayHide:b=0,float:E=!1,hidden:S=!1,noArrow:g=!1,clickable:_=!1,openEvents:A,closeEvents:k,globalCloseEvents:T,imperativeModeOnly:O=!1,style:C,position:R,isOpen:x,defaultIsOpen:L=!1,disableStyleInjection:N=!1,border:$,opacity:j,arrowColor:I,setIsOpen:B,afterShow:z,afterHide:D,role:H="tooltip"},q)=>{const[M,W]=t.useState(r),[P,V]=t.useState(u),[U,F]=t.useState(a),[K,X]=t.useState(d),[Y,G]=t.useState(h),[Z,J]=t.useState(b),[Q,ee]=t.useState(E),[te,oe]=t.useState(S),[le,re]=t.useState(p),[ne,se]=t.useState(m),[ce,ie]=t.useState(null),[ae,ue]=t.useState(null),de=t.useRef(N),pe=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null}return t}),{}),fe=t.useCallback((e=>{const t={place:e=>{var t;V(null!==(t=e)&&void 0!==t?t:u)},content:e=>{W(null!=e?e:r)},variant:e=>{var t;F(null!==(t=e)&&void 0!==t?t:a)},offset:e=>{X(null===e?d:Number(e))},wrapper:e=>{var t;re(null!==(t=e)&&void 0!==t?t:p)},"position-strategy":e=>{var t;se(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{G(null===e?h:Number(e))},"delay-hide":e=>{J(null===e?b:Number(e))},float:e=>{ee(null===e?E:"true"===e)},hidden:e=>{oe(null===e?S:"true"===e)},"class-name":e=>{ie(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o)}))}),[r,b,h,E,S,d,u,m,a,p]);t.useEffect((()=>{W(r)}),[r]),t.useEffect((()=>{V(u)}),[u]),t.useEffect((()=>{F(a)}),[a]),t.useEffect((()=>{X(d)}),[d]),t.useEffect((()=>{G(h)}),[h]),t.useEffect((()=>{J(b)}),[b]),t.useEffect((()=>{ee(E)}),[E]),t.useEffect((()=>{oe(S)}),[S]),t.useEffect((()=>{se(m)}),[m]),t.useEffect((()=>{de.current!==N&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[N]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===N,disableBase:N}}))}),[]),t.useEffect((()=>{const e=new MutationObserver((e=>{e.forEach((e=>{var t;if(!ae||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=pe(ae);fe(o)}))})),t={attributes:!0,childList:!1,subtree:!1};if(ae){const o=pe(ae);fe(o),e.observe(ae,t)}return()=>{e.disconnect()}}),[ae,o,fe]),t.useEffect((()=>{(null==C?void 0:C.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),$&&!c("border",`${$}`)&&console.warn(`[react-tooltip] "${$}" is not a valid \`border\`.`),(null==C?void 0:C.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),j&&!c("opacity",`${j}`)&&console.warn(`[react-tooltip] "${j}" is not a valid \`opacity\`.`)}),[$,j,null==C?void 0:C.border,null==C?void 0:C.opacity]);let ve=f;const me=t.useRef(null);if(n){const e=n({content:(null==ae?void 0:ae.getAttribute("data-tooltip-content"))||M||null,activeAnchor:ae});ve=e?t.createElement("div",{ref:me,className:"react-tooltip-content-wrapper"},e):null}else M&&(ve=M);const ye={forwardRef:q,id:e,anchorSelect:o,className:l(s,ce),classNameArrow:i,content:ve,contentWrapperRef:me,place:P,variant:U,offset:K,wrapper:le,openOnClick:v,positionStrategy:ne,middlewares:w,delayShow:Y,delayHide:Z,float:Q,hidden:te,noArrow:g,clickable:_,openEvents:A,closeEvents:k,globalCloseEvents:T,imperativeModeOnly:O,style:C,position:R,isOpen:x,defaultIsOpen:L,border:$,opacity:j,arrowColor:I,setIsOpen:B,afterShow:z,afterHide:D,activeAnchor:ae,setActiveAnchor:ue,role:H};return t.createElement(y,{...ye})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||n({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||n({css:`
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})})),e.Tooltip=w}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/dom"),require("clsx")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/dom","clsx"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.FloatingUIDOM,e.clsx)}(this,(function(e,t,o,l){"use strict";const r={core:!1,base:!1};function n({css:e,id:t="react-tooltip-base-styles",type:o="base",ref:l}){var n,s;if(!e||"undefined"==typeof document||r[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(s=null===process||void 0===process?void 0:process.env)||void 0===s?void 0:s.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t="react-tooltip-core-styles"),l||(l={});const{insertAt:c}=l;if(document.getElementById(t))return;const i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.id=t,a.type="text/css","top"===c&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e)),r[o]=!0}const s=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:l=null,place:r="top",offset:n=10,strategy:s="absolute",middlewares:c=[o.offset(Number(n)),o.flip({fallbackAxisSideDirection:"start"}),o.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=c;return l?(a.push(o.arrow({element:l,padding:5})),o.computePosition(e,t,{placement:r,strategy:s,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const s={left:`${e}px`,top:`${t}px`,border:i},{x:c,y:a}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:s,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):o.computePosition(e,t,{placement:"bottom",strategy:s,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},c=(e,t,o)=>{let l=null;const r=function(...o){const r=()=>{l=null};l||(e.apply(this,o),l=setTimeout(r,t))};return r.cancel=()=>{l&&(clearTimeout(l),l=null)},r},i=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,a=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>a(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!i(e)||!i(t))return e===t;const o=Object.keys(e),l=Object.keys(t);return o.length===l.length&&o.every((o=>a(e[o],t[o])))},u=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},d=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(u(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},p="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,f=e=>{e.current&&(clearTimeout(e.current),e.current=null)};var v={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},m={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const y=({forwardRef:e,id:r,className:n,classNameArrow:i,variant:u="dark",anchorSelect:y,place:h="top",offset:w=10,openOnClick:b=!1,positionStrategy:E="absolute",middlewares:S,wrapper:g,delayShow:_=0,delayHide:A=0,float:k=!1,hidden:O=!1,noArrow:T=!1,clickable:R=!1,openEvents:C,closeEvents:x,globalCloseEvents:L,imperativeModeOnly:N,style:j,position:$,afterShow:I,afterHide:B,content:z,contentWrapperRef:D,isOpen:H,defaultIsOpen:q=!1,setIsOpen:M,activeAnchor:W,setActiveAnchor:P,border:V,opacity:U,arrowColor:F,role:K="tooltip"})=>{var X;const Y=t.useRef(null),G=t.useRef(null),Z=t.useRef(null),J=t.useRef(null),Q=t.useRef(null),[ee,te]=t.useState({tooltipStyles:{},tooltipArrowStyles:{},place:h}),[oe,le]=t.useState(!1),[re,ne]=t.useState(!1),[se,ce]=t.useState(null),ie=t.useRef(!1),ae=t.useRef(null),ue=t.useRef(!1),[de,pe]=t.useState([]),fe=t.useRef(!1);p((()=>(fe.current=!0,()=>{fe.current=!1})),[]);const ve=t.useCallback((e=>{fe.current&&(e&&ne(!0),setTimeout((()=>{fe.current&&(null==M||M(e),void 0===H&&le(e))}),10))}),[H,M]);t.useEffect((()=>{if(void 0===H)return()=>null;H&&ne(!0);const e=setTimeout((()=>{le(H)}),10);return()=>{clearTimeout(e)}}),[H]),t.useEffect((()=>{if(oe!==ie.current)if(f(Q),ie.current=oe,oe)null==I||I();else{const e=(e=>{const t=e.match(/^([\d.]+)(m?s)$/);if(!t)return 0;const[,o,l]=t;return Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));Q.current=setTimeout((()=>{ne(!1),ce(null),null==B||B()}),e+25)}}),[B,I,oe]);const me=e=>{te((t=>a(t,e)?t:e))},ye=t.useCallback(((e=_)=>{Z.current&&clearTimeout(Z.current),re?ve(!0):Z.current=setTimeout((()=>{ve(!0)}),e)}),[_,ve,re]),he=t.useCallback(((e=A)=>{J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{ue.current||ve(!1)}),e)}),[A,ve]),we=t.useCallback((({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};s({place:null!==(o=null==se?void 0:se.place)&&void 0!==o?o:h,offset:w,elementReference:l,tooltipReference:Y.current,tooltipArrowReference:G.current,strategy:E,middlewares:S,border:V}).then((e=>{me(e)}))}),[null==se?void 0:se.place,h,w,E,S,V]),be=t.useCallback((()=>{var e,t;const o=null!==(e=null==se?void 0:se.position)&&void 0!==e?e:$;o?we(o):k?ae.current&&we(ae.current):(null==W?void 0:W.isConnected)&&s({place:null!==(t=null==se?void 0:se.place)&&void 0!==t?t:h,offset:w,elementReference:W,tooltipReference:Y.current,tooltipArrowReference:G.current,strategy:E,middlewares:S,border:V}).then((e=>{fe.current&&me(e)}))}),[null==se?void 0:se.position,null==se?void 0:se.place,$,k,W,h,w,E,S,V,we]);t.useEffect((()=>{const e=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};we(o),ae.current=o},t=e=>{var t;if(!oe)return;const o=e.target;o.isConnected&&((null===(t=Y.current)||void 0===t?void 0:t.contains(o))||de.some((e=>null==e?void 0:e.contains(o)))||(ve(!1),Z.current&&clearTimeout(Z.current)))},l=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;(null==o?void 0:o.isConnected)?(_?ye():ve(!0),P(o),J.current&&clearTimeout(J.current)):P(null)},r=()=>{R?he(A||100):A?he():ve(!1),Z.current&&clearTimeout(Z.current)},n=c(l,50),s=c(r,50),i=e=>{s.cancel(),n(e)},a=()=>{n.cancel(),s()},u=()=>{ve(!1)},p=b||(null==C?void 0:C.click)||(null==C?void 0:C.dblclick)||(null==C?void 0:C.mousedown),f=C?{...C}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!C&&b&&Object.assign(f,{mouseenter:!1,focus:!1,click:!0});const v=x?{...x}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!x&&b&&Object.assign(v,{mouseleave:!1,blur:!1});const m=L?{...L}:{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:p||!1};N&&(Object.assign(f,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(v,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(m,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1}));const y=Y.current,h=d(Y.current),w=d(W);m.scroll&&(window.addEventListener("scroll",u),null==w||w.addEventListener("scroll",u),null==h||h.addEventListener("scroll",u));let E=null;m.resize?window.addEventListener("resize",u):W&&Y.current&&(E=o.autoUpdate(W,Y.current,be,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const S=e=>{"Escape"===e.key&&ve(!1)};m.escape&&window.addEventListener("keydown",S),m.clickOutsideAnchor&&window.addEventListener("click",t);const g=[],O=e=>{oe&&(null==e?void 0:e.target)===W||l(e)},T=e=>{oe&&(null==e?void 0:e.target)===W&&r()},j=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],$=["click","dblclick","mousedown","mouseup"];Object.entries(f).forEach((([e,t])=>{t&&(j.includes(e)?g.push({event:e,listener:i}):$.includes(e)&&g.push({event:e,listener:O}))})),Object.entries(v).forEach((([e,t])=>{t&&(j.includes(e)?g.push({event:e,listener:a}):$.includes(e)&&g.push({event:e,listener:T}))})),k&&g.push({event:"pointermove",listener:e});const I=()=>{ue.current=!0},B=()=>{ue.current=!1,r()};return R&&!p&&(null==y||y.addEventListener("mouseenter",I),null==y||y.addEventListener("mouseleave",B)),g.forEach((({event:e,listener:t})=>{de.forEach((o=>{o.addEventListener(e,t)}))})),()=>{m.scroll&&(window.removeEventListener("scroll",u),null==w||w.removeEventListener("scroll",u),null==h||h.removeEventListener("scroll",u)),m.resize?window.removeEventListener("resize",u):null==E||E(),m.clickOutsideAnchor&&window.removeEventListener("click",t),m.escape&&window.removeEventListener("keydown",S),R&&!p&&(null==y||y.removeEventListener("mouseenter",I),null==y||y.removeEventListener("mouseleave",B)),g.forEach((({event:e,listener:t})=>{de.forEach((o=>{o.removeEventListener(e,t)}))}))}}),[W,de,R,x,A,_,k,L,he,ve,ye,we,N,C,b,P,oe,be]),t.useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==se?void 0:se.anchorSelect)&&void 0!==e?e:y)&&void 0!==t?t:"";!o&&r&&(o=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`);const l=new MutationObserver((e=>{const t=new Set,l=new Set;e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){const o=e.target;o.getAttribute("data-tooltip-id")===r?t.add(o):e.oldValue===r&&l.add(o)}if("childList"!==e.type)return;const n=[...e.removedNodes].filter((e=>1===e.nodeType));if(W&&n.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,W))&&(ne(!1),ve(!1),P(null),f(Z),f(J),!0)})),o){try{n.forEach((e=>{const t=e;t.matches(o)?l.add(t):t.querySelectorAll(o).forEach((e=>l.add(e)))}))}catch(e){console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`)}try{[...e.addedNodes].filter((e=>1===e.nodeType)).forEach((e=>{const l=e;l.matches(o)?t.add(l):l.querySelectorAll(o).forEach((e=>t.add(e)))}))}catch(e){console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`)}}})),(t.size||l.size)&&pe((e=>[...e.filter((e=>!l.has(e))),...t]))}));return l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{l.disconnect()}}),[r,y,null==se?void 0:se.anchorSelect,W,ve,P]),t.useEffect((()=>{be()}),[be]),t.useEffect((()=>{if(!(null==D?void 0:D.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>be()))}));return e.observe(D.current),()=>{e.disconnect()}}),[z,D,be]),t.useEffect((()=>{var e;W&&de.includes(W)||P(null!==(e=de[0])&&void 0!==e?e:null)}),[de,W,P]),t.useEffect((()=>(q&&ve(!0),()=>{f(Z),f(J)})),[q,ve]),t.useEffect((()=>{var e;let t=null!==(e=null==se?void 0:se.anchorSelect)&&void 0!==e?e:y;if(!t&&r&&(t=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));pe(e)}catch(e){pe([])}}),[r,y,null==se?void 0:se.anchorSelect]),t.useEffect((()=>{Z.current&&(f(Z),ye(_))}),[_,ye]);const Ee=null!==(X=null==se?void 0:se.content)&&void 0!==X?X:z,Se=oe&&Object.keys(ee.tooltipStyles).length>0;return t.useImperativeHandle(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}ce(null!=e?e:null),(null==e?void 0:e.delay)?ye(e.delay):ve(!0)},close:e=>{(null==e?void 0:e.delay)?he(e.delay):ve(!1)},activeAnchor:W,place:ee.place,isOpen:Boolean(re&&!O&&Ee&&Se)}))),re&&!O&&Ee?t.createElement(g,{id:r,role:K,className:l("react-tooltip",v.tooltip,m.tooltip,m[u],n,`react-tooltip__place-${ee.place}`,v[Se?"show":"closing"],Se?"react-tooltip__show":"react-tooltip__closing","fixed"===E&&v.fixed,R&&v.clickable),onTransitionEnd:e=>{f(Q),oe||"opacity"!==e.propertyName||(ne(!1),ce(null),null==B||B())},style:{...j,...ee.tooltipStyles,opacity:void 0!==U&&Se?U:void 0},ref:Y},Ee,t.createElement(g,{className:l("react-tooltip-arrow",v.arrow,m.arrow,i,T&&v.noArrow),style:{...ee.tooltipArrowStyles,background:F?`linear-gradient(to right bottom, transparent 50%, ${F} 50%)`:void 0},ref:G})):null},h=t.forwardRef((({id:e,anchorSelect:o,content:r,render:n,className:s,classNameArrow:c,variant:i="dark",place:a="top",offset:u=10,wrapper:d="div",children:p=null,openOnClick:f=!1,positionStrategy:v="absolute",middlewares:m,delayShow:h=0,delayHide:w=0,float:b=!1,hidden:E=!1,noArrow:S=!1,clickable:g=!1,openEvents:_,closeEvents:A,globalCloseEvents:k,imperativeModeOnly:O=!1,style:T,position:R,isOpen:C,defaultIsOpen:x=!1,disableStyleInjection:L=!1,border:N,opacity:j,arrowColor:$,setIsOpen:I,afterShow:B,afterHide:z,role:D="tooltip"},H)=>{const[q,M]=t.useState(r),[W,P]=t.useState(a),[V,U]=t.useState(i),[F,K]=t.useState(u),[X,Y]=t.useState(h),[G,Z]=t.useState(w),[J,Q]=t.useState(b),[ee,te]=t.useState(E),[oe,le]=t.useState(d),[re,ne]=t.useState(v),[se,ce]=t.useState(null),[ie,ae]=t.useState(null),ue=t.useRef(L),de=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null}return t}),{}),pe=t.useCallback((e=>{const t={place:e=>{var t;P(null!==(t=e)&&void 0!==t?t:a)},content:e=>{M(null!=e?e:r)},variant:e=>{var t;U(null!==(t=e)&&void 0!==t?t:i)},offset:e=>{K(null===e?u:Number(e))},wrapper:e=>{var t;le(null!==(t=e)&&void 0!==t?t:d)},"position-strategy":e=>{var t;ne(null!==(t=e)&&void 0!==t?t:v)},"delay-show":e=>{Y(null===e?h:Number(e))},"delay-hide":e=>{Z(null===e?w:Number(e))},float:e=>{Q(null===e?b:"true"===e)},hidden:e=>{te(null===e?E:"true"===e)},"class-name":e=>{ce(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o)}))}),[r,w,h,b,E,u,a,v,i,d]);t.useEffect((()=>{M(r)}),[r]),t.useEffect((()=>{P(a)}),[a]),t.useEffect((()=>{U(i)}),[i]),t.useEffect((()=>{K(u)}),[u]),t.useEffect((()=>{Y(h)}),[h]),t.useEffect((()=>{Z(w)}),[w]),t.useEffect((()=>{Q(b)}),[b]),t.useEffect((()=>{te(E)}),[E]),t.useEffect((()=>{ne(v)}),[v]),t.useEffect((()=>{ue.current!==L&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[L]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===L,disableBase:L}}))}),[]),t.useEffect((()=>{const e=new MutationObserver((e=>{e.forEach((e=>{var t;if(!ie||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=de(ie);pe(o)}))})),t={attributes:!0,childList:!1,subtree:!1};if(ie){const o=de(ie);pe(o),e.observe(ie,t)}return()=>{e.disconnect()}}),[ie,o,pe]),t.useEffect((()=>{(null==T?void 0:T.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),(null==T?void 0:T.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead.")}),[N,j,null==T?void 0:T.border,null==T?void 0:T.opacity]);let fe=p;const ve=t.useRef(null);if(n){const e=n({content:(null==ie?void 0:ie.getAttribute("data-tooltip-content"))||q||null,activeAnchor:ie});fe=e?t.createElement("div",{ref:ve,className:"react-tooltip-content-wrapper"},e):null}else q&&(fe=q);const me={forwardRef:H,id:e,anchorSelect:o,className:l(s,se),classNameArrow:c,content:fe,contentWrapperRef:ve,place:W,variant:V,offset:F,wrapper:oe,openOnClick:f,positionStrategy:re,middlewares:m,delayShow:X,delayHide:G,float:J,hidden:ee,noArrow:S,clickable:g,openEvents:_,closeEvents:A,globalCloseEvents:k,imperativeModeOnly:O,style:T,position:R,isOpen:C,defaultIsOpen:x,border:N,opacity:j,arrowColor:$,setIsOpen:I,afterShow:B,afterHide:z,activeAnchor:ie,setActiveAnchor:ae,role:D};return t.createElement(y,{...me})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||n({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||n({css:`
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})})),e.Tooltip=h}));
//# sourceMappingURL=react-tooltip.umd.min.js.map
{
"name": "react-tooltip",
"version": "6.0.0-beta.1179.rc.1",
"version": "6.0.0-beta.1179.rc.2",
"description": "react tooltip component",

@@ -52,5 +52,5 @@ "scripts": {

"devDependencies": {
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-commonjs": "26.0.1",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-replace": "5.0.5",
"@rollup/plugin-replace": "5.0.7",
"@rollup/plugin-typescript": "11.1.6",

@@ -67,7 +67,7 @@ "@testing-library/jest-dom": "^5.16.5",

"@types/react-test-renderer": "18.3.0",
"@typescript-eslint/eslint-plugin": "7.8.0",
"@typescript-eslint/parser": "7.8.0",
"@typescript-eslint/eslint-plugin": "7.16.1",
"@typescript-eslint/parser": "7.16.1",
"bundlesize": "0.18.2",
"css-loader": "6.10.0",
"esbuild": "0.21.1",
"esbuild": "0.23.0",
"esbuild-css-modules-plugin": "^2.7.1",

@@ -78,5 +78,5 @@ "eslint": "8.57.0",

"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-jsx-a11y": "6.9.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-react": "7.34.4",
"eslint-plugin-react-hooks": "4.6.2",

@@ -87,6 +87,6 @@ "husky": "9.0.11",

"jest-transform-css": "6.0.1",
"lint-staged": "15.2.2",
"lint-staged": "15.2.7",
"minimist": "^1.2.8",
"postcss": "8.4.38",
"prettier": "3.2.5",
"postcss": "8.4.39",
"prettier": "3.3.3",
"process": "^0.11.10",

@@ -96,7 +96,7 @@ "react": "16.14.0",

"rimraf": "5.0.5",
"rollup": "4.17.2",
"rollup": "4.18.1",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-browsersync": "^1.3.3",
"rollup-plugin-copy": "3.5.0",
"rollup-plugin-dts": "6.1.0",
"rollup-plugin-dts": "6.1.1",
"rollup-plugin-filesize": "10.0.0",

@@ -110,6 +110,6 @@ "rollup-plugin-html-scaffold": "^0.2.0",

"style-loader": "3.3.4",
"stylelint": "16.5.0",
"stylelint": "16.7.0",
"stylelint-config-prettier": "9.0.5",
"stylelint-config-standard": "36.0.0",
"ts-jest": "29.1.2",
"stylelint-config-standard": "36.0.1",
"ts-jest": "29.2.2",
"ts-node": "10.9.2",

@@ -135,5 +135,5 @@ "typescript": "5.4.5"

"dependencies": {
"@floating-ui/dom": "1.6.5",
"@floating-ui/dom": "1.6.7",
"clsx": "2.1.1"
}
}

@@ -57,5 +57,5 @@ # react-tooltip

<a href="https://dopt.com/?source=react-tooltip">
<img alt="Dopt" style="height: 200px; width: 200px;" src="docs/static/img/sponsors/dopt.png" />
</a>
<!-- <a href="#">
<img alt="Slot" style="height: 200px; width: 200px;" src="docs/static/img/sponsors/slot.png" />
</a> -->

@@ -62,0 +62,0 @@ ## Powered by

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc