react-tooltip 5.15.0-beta.1045.1 → 5.16.0-beta.1041.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.
@@ -8,7 +8,7 @@
8
8
  --rt-opacity: 0.9;
9
9
  }
10
10
 
11
- .styles-module_tooltip__mnnfp {
11
+ .core-styles-module_tooltip__3vRRp {
12
12
  visibility: hidden;
13
13
  width: max-content;
14
14
  position: absolute;
@@ -23,31 +23,36 @@
23
23
  will-change: opacity, visibility;
24
24
  }
25
25
 
26
- .styles-module_fixed__7ciUi {
26
+ .core-styles-module_fixed__pcSol {
27
27
  position: fixed;
28
28
  }
29
29
 
30
- .styles-module_arrow__K0L3T {
30
+ .core-styles-module_arrow__cvMwQ {
31
31
  position: absolute;
32
32
  background: inherit;
33
- width: 8px;
34
- height: 8px;
35
- transform: rotate(45deg);
36
33
  }
37
34
 
38
- .styles-module_noArrow__T8y2L {
35
+ .core-styles-module_noArrow__xock6 {
39
36
  display: none;
40
37
  }
41
38
 
42
- .styles-module_clickable__Bv9o7 {
39
+ .core-styles-module_clickable__ZuTTB {
43
40
  pointer-events: auto;
44
41
  }
45
42
 
46
- .styles-module_show__2NboJ {
43
+ .core-styles-module_show__Nt9eE {
47
44
  visibility: visible;
48
45
  opacity: var(--rt-opacity);
49
46
  }
50
47
 
48
+ /** end - core styles **/
49
+
50
+ .styles-module_arrow__K0L3T {
51
+ width: 8px;
52
+ height: 8px;
53
+ transform: rotate(45deg);
54
+ }
55
+
51
56
  /** Types variant **/
52
57
  .styles-module_dark__xNqje {
53
58
  background: var(--rt-color-dark);
@@ -147,4 +147,9 @@ declare const TooltipProvider: React.FC<PropsWithChildren<void>>;
147
147
  */
148
148
  declare const TooltipWrapper: ({ tooltipId, children, className, place, content, html, variant, offset, wrapper, events, positionStrategy, delayShow, delayHide, }: ITooltipWrapper) => JSX.Element;
149
149
 
150
- export { ChildrenType, DataAttribute, EventsType, IPosition, ITooltipController as ITooltip, ITooltipWrapper, Middleware, PlacesType, PositionStrategy, TooltipController as Tooltip, TooltipProvider, TooltipWrapper, VariantType, WrapperType };
150
+ declare function removeStyle({ type, id, }: {
151
+ type?: string;
152
+ id?: string;
153
+ }): void;
154
+
155
+ export { ChildrenType, DataAttribute, EventsType, IPosition, ITooltipController as ITooltip, ITooltipWrapper, Middleware, PlacesType, PositionStrategy, TooltipController as Tooltip, TooltipProvider, TooltipWrapper, VariantType, WrapperType, removeStyle };
@@ -4,5 +4,5 @@
4
4
  * @copyright ReactTooltip Team
5
5
  * @license MIT
6
6
  */
7
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@floating-ui/dom");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(e),n=o(t);function s(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===r&&o.firstChild?o.insertBefore(l,o.firstChild):o.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}s(":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}");const c=(e,t,r)=>{let o=null;return function(...l){const n=()=>{o=null,r||e.apply(this,l)};r&&!o&&(e.apply(this,l),o=setTimeout(n,t)),r||(o&&clearTimeout(o),o=setTimeout(n,t))}},a="DEFAULT_TOOLTIP_ID",i={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},u={getTooltipData:()=>i},d=e.createContext(u);function f(t=a){return e.useContext(d).getTooltipData(t)}const p="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,v=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return null;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const r=t.getPropertyValue(e);return"auto"===r||"scroll"===r}))},m=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(v(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},h=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:l="top",offset:n=10,strategy:s="absolute",middlewares:c=[r.offset(Number(n)),r.flip(),r.shift({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:l};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:l};const a=c;return o?(a.push(r.arrow({element:o,padding:5})),r.computePosition(e,t,{placement:l,strategy:s,middleware:a}).then((({x:e,y:t,placement:r,middlewareData:o})=>{var l,n;const s={left:`${e}px`,top:`${t}px`},{x:c,y:a}=null!==(l=o.arrow)&&void 0!==l?l:{x:0,y:0};return{tooltipStyles:s,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]])&&void 0!==n?n:"bottom"]:"-4px"},place:r}}))):r.computePosition(e,t,{placement:"bottom",strategy:s,middleware:a}).then((({x:e,y:t,placement:r})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:r})))};var y={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T",noArrow:"styles-module_noArrow__T8y2L",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",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"};s(".styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;left:0;opacity:0;padding:8px 16px;pointer-events:none;position:absolute;top:0;transition:opacity .3s ease-out;visibility:hidden;width:max-content;will-change:opacity,visibility}.styles-module_fixed__7ciUi{position:fixed}.styles-module_arrow__K0L3T{background:inherit;height:8px;position:absolute;transform:rotate(45deg);width:8px}.styles-module_noArrow__T8y2L{display:none}.styles-module_clickable__Bv9o7{pointer-events:auto}.styles-module_show__2NboJ{opacity:var(--rt-opacity);visibility:visible}.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)}");const w=({id:t,className:r,classNameArrow:o,variant:s="dark",anchorId:a,anchorSelect:i,place:u="top",offset:d=10,events:v=["hover"],openOnClick:w=!1,positionStrategy:_="absolute",middlewares:S,wrapper:E,delayShow:b=0,delayHide:g=0,float:A=!1,hidden:k=!1,noArrow:x=!1,clickable:T=!1,closeOnEsc:O=!1,closeOnScroll:L=!1,closeOnResize:R=!1,style:N,position:C,afterShow:$,afterHide:q,content:j,contentWrapperRef:H,isOpen:W,setIsOpen:I,activeAnchor:z,setActiveAnchor:D})=>{const B=e.useRef(null),M=e.useRef(null),P=e.useRef(null),K=e.useRef(null),[X,J]=e.useState(u),[U,F]=e.useState({}),[V,Z]=e.useState({}),[G,Y]=e.useState(!1),[Q,ee]=e.useState(!1),te=e.useRef(!1),re=e.useRef(null),{anchorRefs:oe,setActiveAnchor:le}=f(t),ne=e.useRef(!1),[se,ce]=e.useState([]),ae=e.useRef(!1),ie=w||v.includes("click");p((()=>(ae.current=!0,()=>{ae.current=!1})),[]),e.useEffect((()=>{if(!G){const e=setTimeout((()=>{ee(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[G]);const ue=e=>{ae.current&&(e&&ee(!0),setTimeout((()=>{ae.current&&(null==I||I(e),void 0===W&&Y(e))}),10))};e.useEffect((()=>{if(void 0===W)return()=>null;W&&ee(!0);const e=setTimeout((()=>{Y(W)}),10);return()=>{clearTimeout(e)}}),[W]),e.useEffect((()=>{G!==te.current&&(te.current=G,G?null==$||$():null==q||q())}),[G]);const de=(e=g)=>{K.current&&clearTimeout(K.current),K.current=setTimeout((()=>{ne.current||ue(!1)}),e)},fe=e=>{var t;if(!e)return;const r=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==r?void 0:r.isConnected))return D(null),void le({current:null});b?(P.current&&clearTimeout(P.current),P.current=setTimeout((()=>{ue(!0)}),b)):ue(!0),D(r),le({current:r}),K.current&&clearTimeout(K.current)},pe=()=>{T?de(g||100):g?de():ue(!1),P.current&&clearTimeout(P.current)},ve=({x:e,y:t})=>{h({place:u,offset:d,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:B.current,tooltipArrowReference:M.current,strategy:_,middlewares:S}).then((e=>{Object.keys(e.tooltipStyles).length&&F(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&Z(e.tooltipArrowStyles),J(e.place)}))},me=e=>{if(!e)return;const t=e,r={x:t.clientX,y:t.clientY};ve(r),re.current=r},he=e=>{fe(e),g&&de()},ye=e=>{var t;[document.querySelector(`[id='${a}']`),...se].some((t=>null==t?void 0:t.contains(e.target)))||(null===(t=B.current)||void 0===t?void 0:t.contains(e.target))||ue(!1)},we=c(fe,50,!0),_e=c(pe,50,!0);e.useEffect((()=>{var e,t;const r=new Set(oe);se.forEach((e=>{r.add({current:e})}));const o=document.querySelector(`[id='${a}']`);o&&r.add({current:o});const l=()=>{ue(!1)},n=m(z),s=m(B.current);L&&(window.addEventListener("scroll",l),null==n||n.addEventListener("scroll",l),null==s||s.addEventListener("scroll",l)),R&&window.addEventListener("resize",l);const c=e=>{"Escape"===e.key&&ue(!1)};O&&window.addEventListener("keydown",c);const i=[];ie?(window.addEventListener("click",ye),i.push({event:"click",listener:he})):(i.push({event:"mouseenter",listener:we},{event:"mouseleave",listener:_e},{event:"focus",listener:we},{event:"blur",listener:_e}),A&&i.push({event:"mousemove",listener:me}));const u=()=>{ne.current=!0},d=()=>{ne.current=!1,pe()};return T&&!ie&&(null===(e=B.current)||void 0===e||e.addEventListener("mouseenter",u),null===(t=B.current)||void 0===t||t.addEventListener("mouseleave",d)),i.forEach((({event:e,listener:t})=>{r.forEach((r=>{var o;null===(o=r.current)||void 0===o||o.addEventListener(e,t)}))})),()=>{var e,t;L&&(window.removeEventListener("scroll",l),null==n||n.removeEventListener("scroll",l),null==s||s.removeEventListener("scroll",l)),R&&window.removeEventListener("resize",l),ie&&window.removeEventListener("click",ye),O&&window.removeEventListener("keydown",c),T&&!ie&&(null===(e=B.current)||void 0===e||e.removeEventListener("mouseenter",u),null===(t=B.current)||void 0===t||t.removeEventListener("mouseleave",d)),i.forEach((({event:e,listener:t})=>{r.forEach((r=>{var o;null===(o=r.current)||void 0===o||o.removeEventListener(e,t)}))}))}}),[Q,oe,se,O,v]),e.useEffect((()=>{let e=null!=i?i:"";!e&&t&&(e=`[data-tooltip-id='${t}']`);const r=new MutationObserver((r=>{const o=[];r.forEach((r=>{if("attributes"===r.type&&"data-tooltip-id"===r.attributeName){r.target.getAttribute("data-tooltip-id")===t&&o.push(r.target)}if("childList"===r.type&&(z&&[...r.removedNodes].some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,z))&&(ee(!1),ue(!1),D(null),!0)})),e))try{const t=[...r.addedNodes].filter((e=>1===e.nodeType));o.push(...t.filter((t=>t.matches(e)))),o.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch(e){}})),o.length&&ce((e=>[...e,...o]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{r.disconnect()}}),[t,i,z]);const Se=()=>{C?ve(C):A?re.current&&ve(re.current):h({place:u,offset:d,elementReference:z,tooltipReference:B.current,tooltipArrowReference:M.current,strategy:_,middlewares:S}).then((e=>{ae.current&&(Object.keys(e.tooltipStyles).length&&F(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&Z(e.tooltipArrowStyles),J(e.place))}))};e.useEffect((()=>{Se()}),[G,z,j,N,u,d,_,C]),e.useEffect((()=>{if(!(null==H?void 0:H.current))return()=>null;const e=new ResizeObserver((()=>{Se()}));return e.observe(H.current),()=>{e.disconnect()}}),[j,null==H?void 0:H.current]),e.useEffect((()=>{var e;const t=document.querySelector(`[id='${a}']`),r=[...se,t];z&&r.includes(z)||D(null!==(e=se[0])&&void 0!==e?e:t)}),[a,se,z]),e.useEffect((()=>()=>{P.current&&clearTimeout(P.current),K.current&&clearTimeout(K.current)}),[]),e.useEffect((()=>{let e=i;if(!e&&t&&(e=`[data-tooltip-id='${t}']`),e)try{const t=Array.from(document.querySelectorAll(e));ce(t)}catch(e){ce([])}}),[t,i]);const Ee=!k&&j&&G&&Object.keys(U).length>0;return Q?l.default.createElement(E,{id:t,role:"tooltip",className:n.default("react-tooltip",y.tooltip,y[s],r,`react-tooltip__place-${X}`,{[y.show]:Ee,[y.fixed]:"fixed"===_,[y.clickable]:T}),style:{...N,...U},ref:B},j,l.default.createElement(E,{className:n.default("react-tooltip-arrow",y.arrow,o,{[y.noArrow]:x}),style:V,ref:M})):null},_=({content:e})=>l.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}});exports.Tooltip=({id:t,anchorId:r,anchorSelect:o,content:n,html:s,render:c,className:a,classNameArrow:i,variant:u="dark",place:d="top",offset:p=10,wrapper:v="div",children:m=null,events:h=["hover"],openOnClick:y=!1,positionStrategy:S="absolute",middlewares:E,delayShow:b=0,delayHide:g=0,float:A=!1,hidden:k=!1,noArrow:x=!1,clickable:T=!1,closeOnEsc:O=!1,closeOnScroll:L=!1,closeOnResize:R=!1,style:N,position:C,isOpen:$,setIsOpen:q,afterShow:j,afterHide:H})=>{const[W,I]=e.useState(n),[z,D]=e.useState(s),[B,M]=e.useState(d),[P,K]=e.useState(u),[X,J]=e.useState(p),[U,F]=e.useState(b),[V,Z]=e.useState(g),[G,Y]=e.useState(A),[Q,ee]=e.useState(k),[te,re]=e.useState(v),[oe,le]=e.useState(h),[ne,se]=e.useState(S),[ce,ae]=e.useState(null),{anchorRefs:ie,activeAnchor:ue}=f(t),de=e=>null==e?void 0:e.getAttributeNames().reduce(((t,r)=>{var o;if(r.startsWith("data-tooltip-")){t[r.replace(/^data-tooltip-/,"")]=null!==(o=null==e?void 0:e.getAttribute(r))&&void 0!==o?o:null}return t}),{}),fe=e=>{const t={place:e=>{var t;M(null!==(t=e)&&void 0!==t?t:d)},content:e=>{I(null!=e?e:n)},html:e=>{D(null!=e?e:s)},variant:e=>{var t;K(null!==(t=e)&&void 0!==t?t:u)},offset:e=>{J(null===e?p:Number(e))},wrapper:e=>{var t;re(null!==(t=e)&&void 0!==t?t:v)},events:e=>{const t=null==e?void 0:e.split(" ");le(null!=t?t:h)},"position-strategy":e=>{var t;se(null!==(t=e)&&void 0!==t?t:S)},"delay-show":e=>{F(null===e?b:Number(e))},"delay-hide":e=>{Z(null===e?g:Number(e))},float:e=>{Y(null===e?A:"true"===e)},hidden:e=>{ee(null===e?k:"true"===e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,r])=>{var o;null===(o=t[e])||void 0===o||o.call(t,r)}))};e.useEffect((()=>{I(n)}),[n]),e.useEffect((()=>{D(s)}),[s]),e.useEffect((()=>{M(d)}),[d]),e.useEffect((()=>{K(u)}),[u]),e.useEffect((()=>{J(p)}),[p]),e.useEffect((()=>{F(b)}),[b]),e.useEffect((()=>{Z(g)}),[g]),e.useEffect((()=>{Y(A)}),[A]),e.useEffect((()=>{ee(k)}),[k]),e.useEffect((()=>{se(S)}),[S]),e.useEffect((()=>{var e;const l=new Set(ie);let n=o;if(!n&&t&&(n=`[data-tooltip-id='${t}']`),n)try{document.querySelectorAll(n).forEach((e=>{l.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${n}" is not a valid CSS selector`)}const s=document.querySelector(`[id='${r}']`);if(s&&l.add({current:s}),!l.size)return()=>null;const c=null!==(e=null!=ce?ce:s)&&void 0!==e?e:ue.current,a=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const r=de(c);fe(r)}))})),i={attributes:!0,childList:!1,subtree:!1};if(c){const e=de(c);fe(e),a.observe(c,i)}return()=>{a.disconnect()}}),[ie,ue,ce,r,o]);let pe=m;const ve=e.useRef(null);if(c){const e=c({content:null!=W?W:null,activeAnchor:ce});pe=e?l.default.createElement("div",{ref:ve,className:"react-tooltip-content-wrapper"},e):null}else W&&(pe=W);z&&(pe=l.default.createElement(_,{content:z}));const me={id:t,anchorId:r,anchorSelect:o,className:a,classNameArrow:i,content:pe,contentWrapperRef:ve,place:B,variant:P,offset:X,wrapper:te,events:oe,openOnClick:y,positionStrategy:ne,middlewares:E,delayShow:U,delayHide:V,float:G,hidden:Q,noArrow:x,clickable:T,closeOnEsc:O,closeOnScroll:L,closeOnResize:R,style:N,position:C,isOpen:$,setIsOpen:q,afterShow:j,afterHide:H,activeAnchor:ce,setActiveAnchor:e=>ae(e)};return l.default.createElement(w,{...me})},exports.TooltipProvider=({children:t})=>{const[r,o]=e.useState({[a]:new Set}),[n,s]=e.useState({[a]:{current:null}}),c=(e,...t)=>{o((r=>{var o;const l=null!==(o=r[e])&&void 0!==o?o:new Set;return t.forEach((e=>l.add(e))),{...r,[e]:new Set(l)}}))},i=(e,...t)=>{o((r=>{const o=r[e];return o?(t.forEach((e=>o.delete(e))),{...r}):r}))},u=e.useCallback(((e=a)=>{var t,o;return{anchorRefs:null!==(t=r[e])&&void 0!==t?t:new Set,activeAnchor:null!==(o=n[e])&&void 0!==o?o:{current:null},attach:(...t)=>c(e,...t),detach:(...t)=>i(e,...t),setActiveAnchor:t=>((e,t)=>{s((r=>{var o;return(null===(o=r[e])||void 0===o?void 0:o.current)===t.current?r:{...r,[e]:t}}))})(e,t)}}),[r,n,c,i]),f=e.useMemo((()=>({getTooltipData:u})),[u]);return l.default.createElement(d.Provider,{value:f},t)},exports.TooltipWrapper=({tooltipId:t,children:r,className:o,place:s,content:c,html:a,variant:i,offset:u,wrapper:d,events:p,positionStrategy:v,delayShow:m,delayHide:h})=>{const{attach:y,detach:w}=f(t),_=e.useRef(null);return e.useEffect((()=>(y(_),()=>{w(_)})),[]),l.default.createElement("span",{ref:_,className:n.default("react-tooltip-wrapper",o),"data-tooltip-place":s,"data-tooltip-content":c,"data-tooltip-html":a,"data-tooltip-variant":i,"data-tooltip-offset":u,"data-tooltip-wrapper":d,"data-tooltip-events":p,"data-tooltip-position-strategy":v,"data-tooltip-delay-show":m,"data-tooltip-delay-hide":h},r)};
8
- //# sourceMappingURL=react-tooltip.min.cjs.map
7
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@floating-ui/dom");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(e),l=o(t);const c="react-tooltip-core-styles",s="react-tooltip-base-styles";function a({css:e,id:t=s,type:r="base",ref:o}){if("core"===r&&process.env.REACT_TOOLTIP_DISABLE_CORE_STYLES)return;if("core"!==r&&process.env.REACT_TOOLTIP_DISABLE_BASE_STYLES)return;"core"===r&&(t=c),o||(o={});const{insertAt:n}=o;if(!e||"undefined"==typeof document||document.getElementById(t))return;const l=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.id=t,a.type="text/css","top"===n&&l.firstChild?l.insertBefore(a,l.firstChild):l.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const u=(e,t,r)=>{let o=null;return function(...n){const l=()=>{o=null,r||e.apply(this,n)};r&&!o&&(e.apply(this,n),o=setTimeout(l,t)),r||(o&&clearTimeout(o),o=setTimeout(l,t))}},i="DEFAULT_TOOLTIP_ID",d={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},f={getTooltipData:()=>d},p=e.createContext(f);function v(t=i){return e.useContext(p).getTooltipData(t)}const m="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,h=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const r=t.getPropertyValue(e);return"auto"===r||"scroll"===r}))},y=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(h(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},w=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:n="top",offset:l=10,strategy:c="absolute",middlewares:s=[r.offset(Number(l)),r.flip(),r.shift({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const a=s;return o?(a.push(r.arrow({element:o,padding:5})),r.computePosition(e,t,{placement:n,strategy:c,middleware:a}).then((({x:e,y:t,placement:r,middlewareData:o})=>{var n,l;const c={left:`${e}px`,top:`${t}px`},{x:s,y:a}=null!==(n=o.arrow)&&void 0!==n?n:{x:0,y:0};return{tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[null!==(l={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]])&&void 0!==l?l:"bottom"]:"-4px"},place:r}}))):r.computePosition(e,t,{placement:"bottom",strategy:c,middleware:a}).then((({x:e,y:t,placement:r})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:r})))};var E="core-styles-module_tooltip__3vRRp",S="core-styles-module_fixed__pcSol",_="core-styles-module_arrow__cvMwQ",g="core-styles-module_noArrow__xock6",b="core-styles-module_clickable__ZuTTB",A="core-styles-module_show__Nt9eE",T={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 O=({id:t,className:r,classNameArrow:o,variant:c="dark",anchorId:s,anchorSelect:a,place:i="top",offset:d=10,events:f=["hover"],openOnClick:p=!1,positionStrategy:h="absolute",middlewares:O,wrapper:R,delayShow:L=0,delayHide:x=0,float:k=!1,hidden:N=!1,noArrow:C=!1,clickable:I=!1,closeOnEsc:$=!1,closeOnScroll:q=!1,closeOnResize:j=!1,style:B,position:H,afterShow:D,afterHide:P,content:M,contentWrapperRef:W,isOpen:z,setIsOpen:K,activeAnchor:X,setActiveAnchor:Y})=>{const F=e.useRef(null),V=e.useRef(null),Z=e.useRef(null),G=e.useRef(null),[J,Q]=e.useState(i),[U,ee]=e.useState({}),[te,re]=e.useState({}),[oe,ne]=e.useState(!1),[le,ce]=e.useState(!1),se=e.useRef(!1),ae=e.useRef(null),{anchorRefs:ue,setActiveAnchor:ie}=v(t),de=e.useRef(!1),[fe,pe]=e.useState([]),ve=e.useRef(!1),me=p||f.includes("click");m((()=>(ve.current=!0,()=>{ve.current=!1})),[]),e.useEffect((()=>{if(!oe){const e=setTimeout((()=>{ce(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[oe]);const he=e=>{ve.current&&(e&&ce(!0),setTimeout((()=>{ve.current&&(null==K||K(e),void 0===z&&ne(e))}),10))};e.useEffect((()=>{if(void 0===z)return()=>null;z&&ce(!0);const e=setTimeout((()=>{ne(z)}),10);return()=>{clearTimeout(e)}}),[z]),e.useEffect((()=>{oe!==se.current&&(se.current=oe,oe?null==D||D():null==P||P())}),[oe]);const ye=(e=x)=>{G.current&&clearTimeout(G.current),G.current=setTimeout((()=>{de.current||he(!1)}),e)},we=e=>{var t;if(!e)return;const r=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==r?void 0:r.isConnected))return Y(null),void ie({current:null});L?(Z.current&&clearTimeout(Z.current),Z.current=setTimeout((()=>{he(!0)}),L)):he(!0),Y(r),ie({current:r}),G.current&&clearTimeout(G.current)},Ee=()=>{I?ye(x||100):x?ye():he(!1),Z.current&&clearTimeout(Z.current)},Se=({x:e,y:t})=>{w({place:i,offset:d,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:F.current,tooltipArrowReference:V.current,strategy:h,middlewares:O}).then((e=>{Object.keys(e.tooltipStyles).length&&ee(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&re(e.tooltipArrowStyles),Q(e.place)}))},_e=e=>{if(!e)return;const t=e,r={x:t.clientX,y:t.clientY};Se(r),ae.current=r},ge=e=>{we(e),x&&ye()},be=e=>{var t;[document.querySelector(`[id='${s}']`),...fe].some((t=>null==t?void 0:t.contains(e.target)))||(null===(t=F.current)||void 0===t?void 0:t.contains(e.target))||(he(!1),Z.current&&clearTimeout(Z.current))},Ae=u(we,50,!0),Te=u(Ee,50,!0);e.useEffect((()=>{var e,t;const r=new Set(ue);fe.forEach((e=>{r.add({current:e})}));const o=document.querySelector(`[id='${s}']`);o&&r.add({current:o});const n=()=>{he(!1)},l=y(X),c=y(F.current);q&&(window.addEventListener("scroll",n),null==l||l.addEventListener("scroll",n),null==c||c.addEventListener("scroll",n)),j&&window.addEventListener("resize",n);const a=e=>{"Escape"===e.key&&he(!1)};$&&window.addEventListener("keydown",a);const u=[];me?(window.addEventListener("click",be),u.push({event:"click",listener:ge})):(u.push({event:"mouseenter",listener:Ae},{event:"mouseleave",listener:Te},{event:"focus",listener:Ae},{event:"blur",listener:Te}),k&&u.push({event:"mousemove",listener:_e}));const i=()=>{de.current=!0},d=()=>{de.current=!1,Ee()};return I&&!me&&(null===(e=F.current)||void 0===e||e.addEventListener("mouseenter",i),null===(t=F.current)||void 0===t||t.addEventListener("mouseleave",d)),u.forEach((({event:e,listener:t})=>{r.forEach((r=>{var o;null===(o=r.current)||void 0===o||o.addEventListener(e,t)}))})),()=>{var e,t;q&&(window.removeEventListener("scroll",n),null==l||l.removeEventListener("scroll",n),null==c||c.removeEventListener("scroll",n)),j&&window.removeEventListener("resize",n),me&&window.removeEventListener("click",be),$&&window.removeEventListener("keydown",a),I&&!me&&(null===(e=F.current)||void 0===e||e.removeEventListener("mouseenter",i),null===(t=F.current)||void 0===t||t.removeEventListener("mouseleave",d)),u.forEach((({event:e,listener:t})=>{r.forEach((r=>{var o;null===(o=r.current)||void 0===o||o.removeEventListener(e,t)}))}))}}),[le,ue,fe,$,f]),e.useEffect((()=>{let e=null!=a?a:"";!e&&t&&(e=`[data-tooltip-id='${t}']`);const r=new MutationObserver((r=>{const o=[];r.forEach((r=>{if("attributes"===r.type&&"data-tooltip-id"===r.attributeName){r.target.getAttribute("data-tooltip-id")===t&&o.push(r.target)}if("childList"===r.type&&(X&&[...r.removedNodes].some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,X))&&(ce(!1),he(!1),Y(null),Z.current&&clearTimeout(Z.current),G.current&&clearTimeout(G.current),!0)})),e))try{const t=[...r.addedNodes].filter((e=>1===e.nodeType));o.push(...t.filter((t=>t.matches(e)))),o.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch(e){}})),o.length&&pe((e=>[...e,...o]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{r.disconnect()}}),[t,a,X]);const Oe=()=>{H?Se(H):k?ae.current&&Se(ae.current):w({place:i,offset:d,elementReference:X,tooltipReference:F.current,tooltipArrowReference:V.current,strategy:h,middlewares:O}).then((e=>{ve.current&&(Object.keys(e.tooltipStyles).length&&ee(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&re(e.tooltipArrowStyles),Q(e.place))}))};e.useEffect((()=>{Oe()}),[oe,X,M,B,i,d,h,H]),e.useEffect((()=>{if(!(null==W?void 0:W.current))return()=>null;const e=new ResizeObserver((()=>{Oe()}));return e.observe(W.current),()=>{e.disconnect()}}),[M,null==W?void 0:W.current]),e.useEffect((()=>{var e;const t=document.querySelector(`[id='${s}']`),r=[...fe,t];X&&r.includes(X)||Y(null!==(e=fe[0])&&void 0!==e?e:t)}),[s,fe,X]),e.useEffect((()=>()=>{Z.current&&clearTimeout(Z.current),G.current&&clearTimeout(G.current)}),[]),e.useEffect((()=>{let e=a;if(!e&&t&&(e=`[data-tooltip-id='${t}']`),e)try{const t=Array.from(document.querySelectorAll(e));pe(t)}catch(e){pe([])}}),[t,a]);const Re=!N&&M&&oe&&Object.keys(U).length>0;return le?n.default.createElement(R,{id:t,role:"tooltip",className:l.default("react-tooltip",E,T[c],r,`react-tooltip__place-${J}`,{[A]:Re,[S]:"fixed"===h,[b]:I}),style:{...B,...U},ref:F},M,n.default.createElement(R,{className:l.default("react-tooltip-arrow",_,T.arrow,o,{[g]:C}),style:te,ref:V})):null},R=({content:e})=>n.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}});a({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}.core-styles-module_tooltip__3vRRp{visibility:hidden;width:max-content;position:absolute;top:0;left:0;padding:8px 16px;border-radius:3px;font-size:90%;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.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{visibility:visible;opacity:var(--rt-opacity)}`,type:"core"}),a({css:`
8
+ .styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.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)}`}),exports.Tooltip=({id:t,anchorId:r,anchorSelect:o,content:l,html:c,render:s,className:a,classNameArrow:u,variant:i="dark",place:d="top",offset:f=10,wrapper:p="div",children:m=null,events:h=["hover"],openOnClick:y=!1,positionStrategy:w="absolute",middlewares:E,delayShow:S=0,delayHide:_=0,float:g=!1,hidden:b=!1,noArrow:A=!1,clickable:T=!1,closeOnEsc:L=!1,closeOnScroll:x=!1,closeOnResize:k=!1,style:N,position:C,isOpen:I,setIsOpen:$,afterShow:q,afterHide:j})=>{const[B,H]=e.useState(l),[D,P]=e.useState(c),[M,W]=e.useState(d),[z,K]=e.useState(i),[X,Y]=e.useState(f),[F,V]=e.useState(S),[Z,G]=e.useState(_),[J,Q]=e.useState(g),[U,ee]=e.useState(b),[te,re]=e.useState(p),[oe,ne]=e.useState(h),[le,ce]=e.useState(w),[se,ae]=e.useState(null),{anchorRefs:ue,activeAnchor:ie}=v(t),de=e=>null==e?void 0:e.getAttributeNames().reduce(((t,r)=>{var o;if(r.startsWith("data-tooltip-")){t[r.replace(/^data-tooltip-/,"")]=null!==(o=null==e?void 0:e.getAttribute(r))&&void 0!==o?o:null}return t}),{}),fe=e=>{const t={place:e=>{var t;W(null!==(t=e)&&void 0!==t?t:d)},content:e=>{H(null!=e?e:l)},html:e=>{P(null!=e?e:c)},variant:e=>{var t;K(null!==(t=e)&&void 0!==t?t:i)},offset:e=>{Y(null===e?f:Number(e))},wrapper:e=>{var t;re(null!==(t=e)&&void 0!==t?t:p)},events:e=>{const t=null==e?void 0:e.split(" ");ne(null!=t?t:h)},"position-strategy":e=>{var t;ce(null!==(t=e)&&void 0!==t?t:w)},"delay-show":e=>{V(null===e?S:Number(e))},"delay-hide":e=>{G(null===e?_:Number(e))},float:e=>{Q(null===e?g:"true"===e)},hidden:e=>{ee(null===e?b:"true"===e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,r])=>{var o;null===(o=t[e])||void 0===o||o.call(t,r)}))};e.useEffect((()=>{H(l)}),[l]),e.useEffect((()=>{P(c)}),[c]),e.useEffect((()=>{W(d)}),[d]),e.useEffect((()=>{K(i)}),[i]),e.useEffect((()=>{Y(f)}),[f]),e.useEffect((()=>{V(S)}),[S]),e.useEffect((()=>{G(_)}),[_]),e.useEffect((()=>{Q(g)}),[g]),e.useEffect((()=>{ee(b)}),[b]),e.useEffect((()=>{ce(w)}),[w]),e.useEffect((()=>{var e;const n=new Set(ue);let l=o;if(!l&&t&&(l=`[data-tooltip-id='${t}']`),l)try{document.querySelectorAll(l).forEach((e=>{n.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`)}const c=document.querySelector(`[id='${r}']`);if(c&&n.add({current:c}),!n.size)return()=>null;const s=null!==(e=null!=se?se:c)&&void 0!==e?e:ie.current,a=new MutationObserver((e=>{e.forEach((e=>{var t;if(!s||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const r=de(s);fe(r)}))})),u={attributes:!0,childList:!1,subtree:!1};if(s){const e=de(s);fe(e),a.observe(s,u)}return()=>{a.disconnect()}}),[ue,ie,se,r,o]);let pe=m;const ve=e.useRef(null);if(s){const e=s({content:null!=B?B:null,activeAnchor:se});pe=e?n.default.createElement("div",{ref:ve,className:"react-tooltip-content-wrapper"},e):null}else B&&(pe=B);D&&(pe=n.default.createElement(R,{content:D}));const me={id:t,anchorId:r,anchorSelect:o,className:a,classNameArrow:u,content:pe,contentWrapperRef:ve,place:M,variant:z,offset:X,wrapper:te,events:oe,openOnClick:y,positionStrategy:le,middlewares:E,delayShow:F,delayHide:Z,float:J,hidden:U,noArrow:A,clickable:T,closeOnEsc:L,closeOnScroll:x,closeOnResize:k,style:N,position:C,isOpen:I,setIsOpen:$,afterShow:q,afterHide:j,activeAnchor:se,setActiveAnchor:e=>ae(e)};return n.default.createElement(O,{...me})},exports.TooltipProvider=({children:t})=>{const[r,o]=e.useState({[i]:new Set}),[l,c]=e.useState({[i]:{current:null}}),s=(e,...t)=>{o((r=>{var o;const n=null!==(o=r[e])&&void 0!==o?o:new Set;return t.forEach((e=>n.add(e))),{...r,[e]:new Set(n)}}))},a=(e,...t)=>{o((r=>{const o=r[e];return o?(t.forEach((e=>o.delete(e))),{...r}):r}))},u=e.useCallback(((e=i)=>{var t,o;return{anchorRefs:null!==(t=r[e])&&void 0!==t?t:new Set,activeAnchor:null!==(o=l[e])&&void 0!==o?o:{current:null},attach:(...t)=>s(e,...t),detach:(...t)=>a(e,...t),setActiveAnchor:t=>((e,t)=>{c((r=>{var o;return(null===(o=r[e])||void 0===o?void 0:o.current)===t.current?r:{...r,[e]:t}}))})(e,t)}}),[r,l,s,a]),d=e.useMemo((()=>({getTooltipData:u})),[u]);return n.default.createElement(p.Provider,{value:d},t)},exports.TooltipWrapper=({tooltipId:t,children:r,className:o,place:c,content:s,html:a,variant:u,offset:i,wrapper:d,events:f,positionStrategy:p,delayShow:m,delayHide:h})=>{const{attach:y,detach:w}=v(t),E=e.useRef(null);return e.useEffect((()=>(y(E),()=>{w(E)})),[]),n.default.createElement("span",{ref:E,className:l.default("react-tooltip-wrapper",o),"data-tooltip-place":c,"data-tooltip-content":s,"data-tooltip-html":a,"data-tooltip-variant":u,"data-tooltip-offset":i,"data-tooltip-wrapper":d,"data-tooltip-events":f,"data-tooltip-position-strategy":p,"data-tooltip-delay-show":m,"data-tooltip-delay-hide":h},r)},exports.removeStyle=function({type:e="base",id:t=s}){"core"===e&&(t=c);const r=document.getElementById(t);null==r||r.remove()};
@@ -1 +1 @@
1
- {"version":3,"file":"react-tooltip.min.cjs","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/debounce.ts","../src/components/TooltipProvider/TooltipProvider.tsx","../src/components/TooltipProvider/TooltipWrapper.tsx","../src/utils/use-isomorphic-layout-effect.ts","../src/utils/get-scroll-parent.ts","../src/utils/compute-positions.ts","../src/components/Tooltip/Tooltip.tsx","../src/components/TooltipContent/TooltipContent.tsx","../src/components/TooltipController/TooltipController.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This function debounce the received function\n * @param { function } \tfunc\t\t\t\tFunction to be debounced\n * @param { number } \t\twait\t\t\t\tTime to wait before execut the function\n * @param { boolean } \timmediate\t\tParam to define if the function will be executed immediately\n */\nconst debounce = (func: (...args: any[]) => void, wait?: number, immediate?: true) => {\n let timeout: NodeJS.Timeout | null = null\n\n return function debounced(this: typeof func, ...args: any[]) {\n const later = () => {\n timeout = null\n if (!immediate) {\n func.apply(this, args)\n }\n }\n\n if (immediate && !timeout) {\n /**\n * there's not need to clear the timeout\n * since we expect it to resolve and set `timeout = null`\n */\n func.apply(this, args)\n timeout = setTimeout(later, wait)\n }\n\n if (!immediate) {\n if (timeout) {\n clearTimeout(timeout)\n }\n timeout = setTimeout(later, wait)\n }\n }\n}\n\nexport default debounce\n","import React, {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react'\n\nimport type {\n AnchorRef,\n TooltipContextData,\n TooltipContextDataWrapper,\n} from './TooltipProviderTypes'\n\nconst DEFAULT_TOOLTIP_ID = 'DEFAULT_TOOLTIP_ID'\nconst DEFAULT_CONTEXT_DATA: TooltipContextData = {\n anchorRefs: new Set(),\n activeAnchor: { current: null },\n attach: () => {\n /* attach anchor element */\n },\n detach: () => {\n /* detach anchor element */\n },\n setActiveAnchor: () => {\n /* set active anchor */\n },\n}\n\nconst DEFAULT_CONTEXT_DATA_WRAPPER: TooltipContextDataWrapper = {\n getTooltipData: () => DEFAULT_CONTEXT_DATA,\n}\n\nconst TooltipContext = createContext<TooltipContextDataWrapper>(DEFAULT_CONTEXT_DATA_WRAPPER)\n\n/**\n * @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead.\n * See https://react-tooltip.com/docs/getting-started\n */\nconst TooltipProvider: React.FC<PropsWithChildren<void>> = ({ children }) => {\n const [anchorRefMap, setAnchorRefMap] = useState<Record<string, Set<AnchorRef>>>({\n [DEFAULT_TOOLTIP_ID]: new Set(),\n })\n const [activeAnchorMap, setActiveAnchorMap] = useState<Record<string, AnchorRef>>({\n [DEFAULT_TOOLTIP_ID]: { current: null },\n })\n\n const attach = (tooltipId: string, ...refs: AnchorRef[]) => {\n setAnchorRefMap((oldMap) => {\n const tooltipRefs = oldMap[tooltipId] ?? new Set()\n refs.forEach((ref) => tooltipRefs.add(ref))\n // create new object to trigger re-render\n return { ...oldMap, [tooltipId]: new Set(tooltipRefs) }\n })\n }\n\n const detach = (tooltipId: string, ...refs: AnchorRef[]) => {\n setAnchorRefMap((oldMap) => {\n const tooltipRefs = oldMap[tooltipId]\n if (!tooltipRefs) {\n // tooltip not found\n // maybe thow error?\n return oldMap\n }\n refs.forEach((ref) => tooltipRefs.delete(ref))\n // create new object to trigger re-render\n return { ...oldMap }\n })\n }\n\n const setActiveAnchor = (tooltipId: string, ref: React.RefObject<HTMLElement>) => {\n setActiveAnchorMap((oldMap) => {\n if (oldMap[tooltipId]?.current === ref.current) {\n return oldMap\n }\n // create new object to trigger re-render\n return { ...oldMap, [tooltipId]: ref }\n })\n }\n\n const getTooltipData = useCallback(\n (tooltipId = DEFAULT_TOOLTIP_ID) => ({\n anchorRefs: anchorRefMap[tooltipId] ?? new Set(),\n activeAnchor: activeAnchorMap[tooltipId] ?? { current: null },\n attach: (...refs: AnchorRef[]) => attach(tooltipId, ...refs),\n detach: (...refs: AnchorRef[]) => detach(tooltipId, ...refs),\n setActiveAnchor: (ref: AnchorRef) => setActiveAnchor(tooltipId, ref),\n }),\n [anchorRefMap, activeAnchorMap, attach, detach],\n )\n\n const context = useMemo(() => {\n return {\n getTooltipData,\n }\n }, [getTooltipData])\n\n return <TooltipContext.Provider value={context}>{children}</TooltipContext.Provider>\n}\n\nexport function useTooltip(tooltipId = DEFAULT_TOOLTIP_ID) {\n return useContext(TooltipContext).getTooltipData(tooltipId)\n}\n\nexport default TooltipProvider\n","import React, { useEffect, useRef } from 'react'\nimport classNames from 'classnames'\nimport { useTooltip } from './TooltipProvider'\nimport type { ITooltipWrapper } from './TooltipProviderTypes'\n\n/**\n * @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead.\n * See https://react-tooltip.com/docs/getting-started\n */\nconst TooltipWrapper = ({\n tooltipId,\n children,\n className,\n place,\n content,\n html,\n variant,\n offset,\n wrapper,\n events,\n positionStrategy,\n delayShow,\n delayHide,\n}: ITooltipWrapper) => {\n const { attach, detach } = useTooltip(tooltipId)\n const anchorRef = useRef<HTMLElement | null>(null)\n\n useEffect(() => {\n attach(anchorRef)\n return () => {\n detach(anchorRef)\n }\n }, [])\n\n return (\n <span\n ref={anchorRef}\n className={classNames('react-tooltip-wrapper', className)}\n data-tooltip-place={place}\n data-tooltip-content={content}\n data-tooltip-html={html}\n data-tooltip-variant={variant}\n data-tooltip-offset={offset}\n data-tooltip-wrapper={wrapper}\n data-tooltip-events={events}\n data-tooltip-position-strategy={positionStrategy}\n data-tooltip-delay-show={delayShow}\n data-tooltip-delay-hide={delayHide}\n >\n {children}\n </span>\n )\n}\n\nexport default TooltipWrapper\n","import { useLayoutEffect, useEffect } from 'react'\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nexport default useIsomorphicLayoutEffect\n","const isScrollable = (node: Element) => {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return null\n }\n const style = getComputedStyle(node)\n return ['overflow', 'overflow-x', 'overflow-y'].some((propertyName) => {\n const value = style.getPropertyValue(propertyName)\n return value === 'auto' || value === 'scroll'\n })\n}\n\nexport const getScrollParent = (node: Element | null) => {\n if (!node) {\n return null\n }\n let currentParent = node.parentElement\n while (currentParent) {\n if (isScrollable(currentParent)) {\n return currentParent\n }\n currentParent = currentParent.parentElement\n }\n return document.scrollingElement || document.documentElement\n}\n","import { computePosition, offset, shift, arrow, flip } from '@floating-ui/dom'\nimport type { IComputePositions } from './compute-positions-types'\n\nexport const computeTooltipPosition = async ({\n elementReference = null,\n tooltipReference = null,\n tooltipArrowReference = null,\n place = 'top',\n offset: offsetValue = 10,\n strategy = 'absolute',\n middlewares = [offset(Number(offsetValue)), flip(), shift({ padding: 5 })],\n}: IComputePositions) => {\n if (!elementReference) {\n // elementReference can be null or undefined and we will not compute the position\n // eslint-disable-next-line no-console\n // console.error('The reference element for tooltip was not defined: ', elementReference)\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n if (tooltipReference === null) {\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n const middleware = middlewares\n\n if (tooltipArrowReference) {\n middleware.push(arrow({ element: tooltipArrowReference as HTMLElement, padding: 5 }))\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: place,\n strategy,\n middleware,\n }).then(({ x, y, placement, middlewareData }) => {\n const styles = { left: `${x}px`, top: `${y}px` }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow ?? { x: 0, y: 0 }\n\n const staticSide =\n {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0]] ?? 'bottom'\n\n const arrowStyle = {\n left: arrowX != null ? `${arrowX}px` : '',\n top: arrowY != null ? `${arrowY}px` : '',\n right: '',\n bottom: '',\n [staticSide]: '-4px',\n }\n\n return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement }\n })\n }\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: 'bottom',\n strategy,\n middleware,\n }).then(({ x, y, placement }) => {\n const styles = { left: `${x}px`, top: `${y}px` }\n\n return { tooltipStyles: styles, tooltipArrowStyles: {}, place: placement }\n })\n}\n","import React, { useEffect, useState, useRef } from 'react'\nimport classNames from 'classnames'\nimport debounce from 'utils/debounce'\nimport { useTooltip } from 'components/TooltipProvider'\nimport useIsomorphicLayoutEffect from 'utils/use-isomorphic-layout-effect'\nimport { getScrollParent } from 'utils/get-scroll-parent'\nimport { computeTooltipPosition } from 'utils/compute-positions'\nimport styles from './styles.module.css'\nimport type { IPosition, ITooltip, PlacesType } from './TooltipTypes'\n\nconst Tooltip = ({\n // props\n id,\n className,\n classNameArrow,\n variant = 'dark',\n anchorId,\n anchorSelect,\n place = 'top',\n offset = 10,\n events = ['hover'],\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n wrapper: WrapperElement,\n delayShow = 0,\n delayHide = 0,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n closeOnEsc = false,\n closeOnScroll = false,\n closeOnResize = false,\n style: externalStyles,\n position,\n afterShow,\n afterHide,\n // props handled by controller\n content,\n contentWrapperRef,\n isOpen,\n setIsOpen,\n activeAnchor,\n setActiveAnchor,\n}: ITooltip) => {\n const tooltipRef = useRef<HTMLElement>(null)\n const tooltipArrowRef = useRef<HTMLElement>(null)\n const tooltipShowDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const tooltipHideDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const [actualPlacement, setActualPlacement] = useState(place)\n const [inlineStyles, setInlineStyles] = useState({})\n const [inlineArrowStyles, setInlineArrowStyles] = useState({})\n const [show, setShow] = useState(false)\n const [rendered, setRendered] = useState(false)\n const wasShowing = useRef(false)\n const lastFloatPosition = useRef<IPosition | null>(null)\n /**\n * @todo Remove this in a future version (provider/wrapper method is deprecated)\n */\n const { anchorRefs, setActiveAnchor: setProviderActiveAnchor } = useTooltip(id)\n const hoveringTooltip = useRef(false)\n const [anchorsBySelect, setAnchorsBySelect] = useState<HTMLElement[]>([])\n const mounted = useRef(false)\n\n const shouldOpenOnClick = openOnClick || events.includes('click')\n\n /**\n * useLayoutEffect runs before useEffect,\n * but should be used carefully because of caveats\n * https://beta.reactjs.org/reference/react/useLayoutEffect#caveats\n */\n useIsomorphicLayoutEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n }\n }, [])\n\n useEffect(() => {\n if (!show) {\n /**\n * this fixes weird behavior when switching between two anchor elements very quickly\n * remove the timeout and switch quickly between two adjancent anchor elements to see it\n *\n * in practice, this means the tooltip is not immediately removed from the DOM on hide\n */\n const timeout = setTimeout(() => {\n setRendered(false)\n }, 150)\n return () => {\n clearTimeout(timeout)\n }\n }\n return () => null\n }, [show])\n\n const handleShow = (value: boolean) => {\n if (!mounted.current) {\n return\n }\n if (value) {\n setRendered(true)\n }\n /**\n * wait for the component to render and calculate position\n * before actually showing\n */\n setTimeout(() => {\n if (!mounted.current) {\n return\n }\n setIsOpen?.(value)\n if (isOpen === undefined) {\n setShow(value)\n }\n }, 10)\n }\n\n /**\n * this replicates the effect from `handleShow()`\n * when `isOpen` is changed from outside\n */\n useEffect(() => {\n if (isOpen === undefined) {\n return () => null\n }\n if (isOpen) {\n setRendered(true)\n }\n const timeout = setTimeout(() => {\n setShow(isOpen)\n }, 10)\n return () => {\n clearTimeout(timeout)\n }\n }, [isOpen])\n\n useEffect(() => {\n if (show === wasShowing.current) {\n return\n }\n wasShowing.current = show\n if (show) {\n afterShow?.()\n } else {\n afterHide?.()\n }\n }, [show])\n\n const handleShowTooltipDelayed = () => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n\n tooltipShowDelayTimerRef.current = setTimeout(() => {\n handleShow(true)\n }, delayShow)\n }\n\n const handleHideTooltipDelayed = (delay = delayHide) => {\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n\n tooltipHideDelayTimerRef.current = setTimeout(() => {\n if (hoveringTooltip.current) {\n return\n }\n handleShow(false)\n }, delay)\n }\n\n const handleShowTooltip = (event?: Event) => {\n if (!event) {\n return\n }\n const target = (event.currentTarget ?? event.target) as HTMLElement | null\n if (!target?.isConnected) {\n /**\n * this happens when the target is removed from the DOM\n * at the same time the tooltip gets triggered\n */\n setActiveAnchor(null)\n setProviderActiveAnchor({ current: null })\n return\n }\n if (delayShow) {\n handleShowTooltipDelayed()\n } else {\n handleShow(true)\n }\n setActiveAnchor(target)\n setProviderActiveAnchor({ current: target })\n\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n\n const handleHideTooltip = () => {\n if (clickable) {\n // allow time for the mouse to reach the tooltip, in case there's a gap\n handleHideTooltipDelayed(delayHide || 100)\n } else if (delayHide) {\n handleHideTooltipDelayed()\n } else {\n handleShow(false)\n }\n\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n }\n\n const handleTooltipPosition = ({ x, y }: IPosition) => {\n const virtualElement = {\n getBoundingClientRect() {\n return {\n x,\n y,\n width: 0,\n height: 0,\n top: y,\n left: x,\n right: x,\n bottom: y,\n }\n },\n } as Element\n computeTooltipPosition({\n place,\n offset,\n elementReference: virtualElement,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n }).then((computedStylesData) => {\n if (Object.keys(computedStylesData.tooltipStyles).length) {\n setInlineStyles(computedStylesData.tooltipStyles)\n }\n if (Object.keys(computedStylesData.tooltipArrowStyles).length) {\n setInlineArrowStyles(computedStylesData.tooltipArrowStyles)\n }\n setActualPlacement(computedStylesData.place as PlacesType)\n })\n }\n\n const handleMouseMove = (event?: Event) => {\n if (!event) {\n return\n }\n const mouseEvent = event as MouseEvent\n const mousePosition = {\n x: mouseEvent.clientX,\n y: mouseEvent.clientY,\n }\n handleTooltipPosition(mousePosition)\n lastFloatPosition.current = mousePosition\n }\n\n const handleClickTooltipAnchor = (event?: Event) => {\n handleShowTooltip(event)\n if (delayHide) {\n handleHideTooltipDelayed()\n }\n }\n\n const handleClickOutsideAnchors = (event: MouseEvent) => {\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n const anchors = [anchorById, ...anchorsBySelect]\n if (anchors.some((anchor) => anchor?.contains(event.target as HTMLElement))) {\n return\n }\n if (tooltipRef.current?.contains(event.target as HTMLElement)) {\n return\n }\n handleShow(false)\n }\n\n // debounce handler to prevent call twice when\n // mouse enter and focus events being triggered toggether\n const debouncedHandleShowTooltip = debounce(handleShowTooltip, 50, true)\n const debouncedHandleHideTooltip = debounce(handleHideTooltip, 50, true)\n\n useEffect(() => {\n const elementRefs = new Set(anchorRefs)\n\n anchorsBySelect.forEach((anchor) => {\n elementRefs.add({ current: anchor })\n })\n\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n if (anchorById) {\n elementRefs.add({ current: anchorById })\n }\n\n const handleScrollResize = () => {\n handleShow(false)\n }\n\n const anchorScrollParent = getScrollParent(activeAnchor)\n const tooltipScrollParent = getScrollParent(tooltipRef.current)\n\n if (closeOnScroll) {\n window.addEventListener('scroll', handleScrollResize)\n anchorScrollParent?.addEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.addEventListener('scroll', handleScrollResize)\n }\n if (closeOnResize) {\n window.addEventListener('resize', handleScrollResize)\n }\n\n const handleEsc = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return\n }\n handleShow(false)\n }\n\n if (closeOnEsc) {\n window.addEventListener('keydown', handleEsc)\n }\n\n const enabledEvents: { event: string; listener: (event?: Event) => void }[] = []\n\n if (shouldOpenOnClick) {\n window.addEventListener('click', handleClickOutsideAnchors)\n enabledEvents.push({ event: 'click', listener: handleClickTooltipAnchor })\n } else {\n enabledEvents.push(\n { event: 'mouseenter', listener: debouncedHandleShowTooltip },\n { event: 'mouseleave', listener: debouncedHandleHideTooltip },\n { event: 'focus', listener: debouncedHandleShowTooltip },\n { event: 'blur', listener: debouncedHandleHideTooltip },\n )\n if (float) {\n enabledEvents.push({\n event: 'mousemove',\n listener: handleMouseMove,\n })\n }\n }\n\n const handleMouseEnterTooltip = () => {\n hoveringTooltip.current = true\n }\n const handleMouseLeaveTooltip = () => {\n hoveringTooltip.current = false\n handleHideTooltip()\n }\n\n if (clickable && !shouldOpenOnClick) {\n tooltipRef.current?.addEventListener('mouseenter', handleMouseEnterTooltip)\n tooltipRef.current?.addEventListener('mouseleave', handleMouseLeaveTooltip)\n }\n\n enabledEvents.forEach(({ event, listener }) => {\n elementRefs.forEach((ref) => {\n ref.current?.addEventListener(event, listener)\n })\n })\n\n return () => {\n if (closeOnScroll) {\n window.removeEventListener('scroll', handleScrollResize)\n anchorScrollParent?.removeEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.removeEventListener('scroll', handleScrollResize)\n }\n if (closeOnResize) {\n window.removeEventListener('resize', handleScrollResize)\n }\n if (shouldOpenOnClick) {\n window.removeEventListener('click', handleClickOutsideAnchors)\n }\n if (closeOnEsc) {\n window.removeEventListener('keydown', handleEsc)\n }\n if (clickable && !shouldOpenOnClick) {\n tooltipRef.current?.removeEventListener('mouseenter', handleMouseEnterTooltip)\n tooltipRef.current?.removeEventListener('mouseleave', handleMouseLeaveTooltip)\n }\n enabledEvents.forEach(({ event, listener }) => {\n elementRefs.forEach((ref) => {\n ref.current?.removeEventListener(event, listener)\n })\n })\n }\n /**\n * rendered is also a dependency to ensure anchor observers are re-registered\n * since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM\n */\n }, [rendered, anchorRefs, anchorsBySelect, closeOnEsc, events])\n\n useEffect(() => {\n let selector = anchorSelect ?? ''\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n const documentObserverCallback: MutationCallback = (mutationList) => {\n const newAnchors: HTMLElement[] = []\n mutationList.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-id') {\n const newId = (mutation.target as HTMLElement).getAttribute('data-tooltip-id')\n if (newId === id) {\n newAnchors.push(mutation.target as HTMLElement)\n }\n }\n if (mutation.type !== 'childList') {\n return\n }\n if (activeAnchor) {\n ;[...mutation.removedNodes].some((node) => {\n if (node?.contains?.(activeAnchor)) {\n setRendered(false)\n handleShow(false)\n setActiveAnchor(null)\n return true\n }\n return false\n })\n }\n if (!selector) {\n return\n }\n try {\n const elements = [...mutation.addedNodes].filter((node) => node.nodeType === 1)\n newAnchors.push(\n // the element itself is an anchor\n ...(elements.filter((element) =>\n (element as HTMLElement).matches(selector),\n ) as HTMLElement[]),\n )\n newAnchors.push(\n // the element has children which are anchors\n ...elements.flatMap(\n (element) =>\n [...(element as HTMLElement).querySelectorAll(selector)] as HTMLElement[],\n ),\n )\n } catch {\n /**\n * invalid CSS selector.\n * already warned on tooltip controller\n */\n }\n })\n if (newAnchors.length) {\n setAnchorsBySelect((anchors) => [...anchors, ...newAnchors])\n }\n }\n const documentObserver = new MutationObserver(documentObserverCallback)\n // watch for anchor being removed from the DOM\n documentObserver.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-tooltip-id'],\n })\n return () => {\n documentObserver.disconnect()\n }\n }, [id, anchorSelect, activeAnchor])\n\n const updateTooltipPosition = () => {\n if (position) {\n // if `position` is set, override regular and `float` positioning\n handleTooltipPosition(position)\n return\n }\n\n if (float) {\n if (lastFloatPosition.current) {\n /*\n Without this, changes to `content`, `place`, `offset`, ..., will only\n trigger a position calculation after a `mousemove` event.\n\n To see why this matters, comment this line, run `yarn dev` and click the\n \"Hover me!\" anchor.\n */\n handleTooltipPosition(lastFloatPosition.current)\n }\n // if `float` is set, override regular positioning\n return\n }\n\n computeTooltipPosition({\n place,\n offset,\n elementReference: activeAnchor,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n }).then((computedStylesData) => {\n if (!mounted.current) {\n // invalidate computed positions after remount\n return\n }\n if (Object.keys(computedStylesData.tooltipStyles).length) {\n setInlineStyles(computedStylesData.tooltipStyles)\n }\n if (Object.keys(computedStylesData.tooltipArrowStyles).length) {\n setInlineArrowStyles(computedStylesData.tooltipArrowStyles)\n }\n setActualPlacement(computedStylesData.place as PlacesType)\n })\n }\n\n useEffect(() => {\n updateTooltipPosition()\n }, [show, activeAnchor, content, externalStyles, place, offset, positionStrategy, position])\n\n useEffect(() => {\n if (!contentWrapperRef?.current) {\n return () => null\n }\n const contentObserver = new ResizeObserver(() => {\n updateTooltipPosition()\n })\n contentObserver.observe(contentWrapperRef.current)\n return () => {\n contentObserver.disconnect()\n }\n }, [content, contentWrapperRef?.current])\n\n useEffect(() => {\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n const anchors = [...anchorsBySelect, anchorById]\n if (!activeAnchor || !anchors.includes(activeAnchor)) {\n /**\n * if there is no active anchor,\n * or if the current active anchor is not amongst the allowed ones,\n * reset it\n */\n setActiveAnchor(anchorsBySelect[0] ?? anchorById)\n }\n }, [anchorId, anchorsBySelect, activeAnchor])\n\n useEffect(() => {\n return () => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n }, [])\n\n useEffect(() => {\n let selector = anchorSelect\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n if (!selector) {\n return\n }\n try {\n const anchors = Array.from(document.querySelectorAll<HTMLElement>(selector))\n setAnchorsBySelect(anchors)\n } catch {\n // warning was already issued in the controller\n setAnchorsBySelect([])\n }\n }, [id, anchorSelect])\n\n const canShow = !hidden && content && show && Object.keys(inlineStyles).length > 0\n\n return rendered ? (\n <WrapperElement\n id={id}\n role=\"tooltip\"\n className={classNames(\n 'react-tooltip',\n styles['tooltip'],\n styles[variant],\n className,\n `react-tooltip__place-${actualPlacement}`,\n {\n [styles['show']]: canShow,\n [styles['fixed']]: positionStrategy === 'fixed',\n [styles['clickable']]: clickable,\n },\n )}\n style={{ ...externalStyles, ...inlineStyles }}\n ref={tooltipRef}\n >\n {content}\n <WrapperElement\n className={classNames('react-tooltip-arrow', styles['arrow'], classNameArrow, {\n /**\n * changed from dash `no-arrow` to camelcase because of:\n * https://github.com/indooorsman/esbuild-css-modules-plugin/issues/42\n */\n [styles['noArrow']]: noArrow,\n })}\n style={inlineArrowStyles}\n ref={tooltipArrowRef}\n />\n </WrapperElement>\n ) : null\n}\n\nexport default Tooltip\n","/* eslint-disable react/no-danger */\nimport React from 'react'\nimport type { ITooltipContent } from './TooltipContentTypes'\n\nconst TooltipContent = ({ content }: ITooltipContent) => {\n return <span dangerouslySetInnerHTML={{ __html: content }} />\n}\n\nexport default TooltipContent\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Tooltip } from 'components/Tooltip'\nimport type {\n EventsType,\n PositionStrategy,\n PlacesType,\n VariantType,\n WrapperType,\n DataAttribute,\n ITooltip,\n ChildrenType,\n} from 'components/Tooltip/TooltipTypes'\nimport { useTooltip } from 'components/TooltipProvider'\nimport { TooltipContent } from 'components/TooltipContent'\nimport type { ITooltipController } from './TooltipControllerTypes'\n\nconst TooltipController = ({\n id,\n anchorId,\n anchorSelect,\n content,\n html,\n render,\n className,\n classNameArrow,\n variant = 'dark',\n place = 'top',\n offset = 10,\n wrapper = 'div',\n children = null,\n events = ['hover'],\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n delayShow = 0,\n delayHide = 0,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n closeOnEsc = false,\n closeOnScroll = false,\n closeOnResize = false,\n style,\n position,\n isOpen,\n setIsOpen,\n afterShow,\n afterHide,\n}: ITooltipController) => {\n const [tooltipContent, setTooltipContent] = useState(content)\n const [tooltipHtml, setTooltipHtml] = useState(html)\n const [tooltipPlace, setTooltipPlace] = useState(place)\n const [tooltipVariant, setTooltipVariant] = useState(variant)\n const [tooltipOffset, setTooltipOffset] = useState(offset)\n const [tooltipDelayShow, setTooltipDelayShow] = useState(delayShow)\n const [tooltipDelayHide, setTooltipDelayHide] = useState(delayHide)\n const [tooltipFloat, setTooltipFloat] = useState(float)\n const [tooltipHidden, setTooltipHidden] = useState(hidden)\n const [tooltipWrapper, setTooltipWrapper] = useState<WrapperType>(wrapper)\n const [tooltipEvents, setTooltipEvents] = useState(events)\n const [tooltipPositionStrategy, setTooltipPositionStrategy] = useState(positionStrategy)\n const [activeAnchor, setActiveAnchor] = useState<HTMLElement | null>(null)\n /**\n * @todo Remove this in a future version (provider/wrapper method is deprecated)\n */\n const { anchorRefs, activeAnchor: providerActiveAnchor } = useTooltip(id)\n\n const getDataAttributesFromAnchorElement = (elementReference: HTMLElement) => {\n const dataAttributes = elementReference?.getAttributeNames().reduce((acc, name) => {\n if (name.startsWith('data-tooltip-')) {\n const parsedAttribute = name.replace(/^data-tooltip-/, '') as DataAttribute\n acc[parsedAttribute] = elementReference?.getAttribute(name) ?? null\n }\n return acc\n }, {} as Record<DataAttribute, string | null>)\n\n return dataAttributes\n }\n\n const applyAllDataAttributesFromAnchorElement = (\n dataAttributes: Record<string, string | null>,\n ) => {\n const handleDataAttributes: Record<DataAttribute, (value: string | null) => void> = {\n place: (value) => {\n setTooltipPlace((value as PlacesType) ?? place)\n },\n content: (value) => {\n setTooltipContent(value ?? content)\n },\n html: (value) => {\n setTooltipHtml(value ?? html)\n },\n variant: (value) => {\n setTooltipVariant((value as VariantType) ?? variant)\n },\n offset: (value) => {\n setTooltipOffset(value === null ? offset : Number(value))\n },\n wrapper: (value) => {\n setTooltipWrapper((value as WrapperType) ?? wrapper)\n },\n events: (value) => {\n const parsed = value?.split(' ') as EventsType[]\n setTooltipEvents(parsed ?? events)\n },\n 'position-strategy': (value) => {\n setTooltipPositionStrategy((value as PositionStrategy) ?? positionStrategy)\n },\n 'delay-show': (value) => {\n setTooltipDelayShow(value === null ? delayShow : Number(value))\n },\n 'delay-hide': (value) => {\n setTooltipDelayHide(value === null ? delayHide : Number(value))\n },\n float: (value) => {\n setTooltipFloat(value === null ? float : value === 'true')\n },\n hidden: (value) => {\n setTooltipHidden(value === null ? hidden : value === 'true')\n },\n }\n // reset unset data attributes to default values\n // without this, data attributes from the last active anchor will still be used\n Object.values(handleDataAttributes).forEach((handler) => handler(null))\n Object.entries(dataAttributes).forEach(([key, value]) => {\n handleDataAttributes[key as DataAttribute]?.(value)\n })\n }\n\n useEffect(() => {\n setTooltipContent(content)\n }, [content])\n\n useEffect(() => {\n setTooltipHtml(html)\n }, [html])\n\n useEffect(() => {\n setTooltipPlace(place)\n }, [place])\n\n useEffect(() => {\n setTooltipVariant(variant)\n }, [variant])\n\n useEffect(() => {\n setTooltipOffset(offset)\n }, [offset])\n\n useEffect(() => {\n setTooltipDelayShow(delayShow)\n }, [delayShow])\n\n useEffect(() => {\n setTooltipDelayHide(delayHide)\n }, [delayHide])\n\n useEffect(() => {\n setTooltipFloat(float)\n }, [float])\n\n useEffect(() => {\n setTooltipHidden(hidden)\n }, [hidden])\n\n useEffect(() => {\n setTooltipPositionStrategy(positionStrategy)\n }, [positionStrategy])\n\n useEffect(() => {\n const elementRefs = new Set(anchorRefs)\n\n let selector = anchorSelect\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n if (selector) {\n try {\n const anchorsBySelect = document.querySelectorAll<HTMLElement>(selector)\n anchorsBySelect.forEach((anchor) => {\n elementRefs.add({ current: anchor })\n })\n } catch {\n if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${selector}\" is not a valid CSS selector`)\n }\n }\n }\n\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n if (anchorById) {\n elementRefs.add({ current: anchorById })\n }\n\n if (!elementRefs.size) {\n return () => null\n }\n\n const anchorElement = activeAnchor ?? anchorById ?? providerActiveAnchor.current\n\n const observerCallback: MutationCallback = (mutationList) => {\n mutationList.forEach((mutation) => {\n if (\n !anchorElement ||\n mutation.type !== 'attributes' ||\n !mutation.attributeName?.startsWith('data-tooltip-')\n ) {\n return\n }\n // make sure to get all set attributes, since all unset attributes are reset\n const dataAttributes = getDataAttributesFromAnchorElement(anchorElement)\n applyAllDataAttributesFromAnchorElement(dataAttributes)\n })\n }\n\n // Create an observer instance linked to the callback function\n const observer = new MutationObserver(observerCallback)\n\n // do not check for subtree and childrens, we only want to know attribute changes\n // to stay watching `data-attributes-*` from anchor element\n const observerConfig = { attributes: true, childList: false, subtree: false }\n\n if (anchorElement) {\n const dataAttributes = getDataAttributesFromAnchorElement(anchorElement)\n applyAllDataAttributesFromAnchorElement(dataAttributes)\n // Start observing the target node for configured mutations\n observer.observe(anchorElement, observerConfig)\n }\n\n return () => {\n // Remove the observer when the tooltip is destroyed\n observer.disconnect()\n }\n }, [anchorRefs, providerActiveAnchor, activeAnchor, anchorId, anchorSelect])\n\n /**\n * content priority: children < render or content < html\n * children should be lower priority so that it can be used as the \"default\" content\n */\n let renderedContent: ChildrenType = children\n const contentWrapperRef = useRef<HTMLDivElement>(null)\n if (render) {\n const rendered = render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode\n renderedContent = rendered ? (\n <div ref={contentWrapperRef} className=\"react-tooltip-content-wrapper\">\n {rendered}\n </div>\n ) : null\n } else if (tooltipContent) {\n renderedContent = tooltipContent\n }\n if (tooltipHtml) {\n renderedContent = <TooltipContent content={tooltipHtml} />\n }\n\n const props: ITooltip = {\n id,\n anchorId,\n anchorSelect,\n className,\n classNameArrow,\n content: renderedContent,\n contentWrapperRef,\n place: tooltipPlace,\n variant: tooltipVariant,\n offset: tooltipOffset,\n wrapper: tooltipWrapper,\n events: tooltipEvents,\n openOnClick,\n positionStrategy: tooltipPositionStrategy,\n middlewares,\n delayShow: tooltipDelayShow,\n delayHide: tooltipDelayHide,\n float: tooltipFloat,\n hidden: tooltipHidden,\n noArrow,\n clickable,\n closeOnEsc,\n closeOnScroll,\n closeOnResize,\n style,\n position,\n isOpen,\n setIsOpen,\n afterShow,\n afterHide,\n activeAnchor,\n setActiveAnchor: (anchor: HTMLElement | null) => setActiveAnchor(anchor),\n }\n\n return <Tooltip {...props} />\n}\n\nexport default TooltipController\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","debounce","func","wait","immediate","timeout","args","later","apply","this","setTimeout","clearTimeout","DEFAULT_TOOLTIP_ID","DEFAULT_CONTEXT_DATA","anchorRefs","Set","activeAnchor","current","attach","detach","setActiveAnchor","DEFAULT_CONTEXT_DATA_WRAPPER","getTooltipData","TooltipContext","createContext","useTooltip","tooltipId","useContext","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","isScrollable","node","HTMLElement","SVGElement","getComputedStyle","some","propertyName","value","getPropertyValue","getScrollParent","currentParent","parentElement","scrollingElement","documentElement","computeTooltipPosition","async","elementReference","tooltipReference","tooltipArrowReference","place","offset","offsetValue","strategy","middlewares","Number","flip","shift","padding","tooltipStyles","tooltipArrowStyles","middleware","push","arrow","element","computePosition","placement","then","x","y","middlewareData","styles","left","top","arrowX","arrowY","_a","right","bottom","_b","split","Tooltip","id","className","classNameArrow","variant","anchorId","anchorSelect","events","openOnClick","positionStrategy","wrapper","WrapperElement","delayShow","delayHide","float","hidden","noArrow","clickable","closeOnEsc","closeOnScroll","closeOnResize","externalStyles","position","afterShow","afterHide","content","contentWrapperRef","isOpen","setIsOpen","tooltipRef","useRef","tooltipArrowRef","tooltipShowDelayTimerRef","tooltipHideDelayTimerRef","actualPlacement","setActualPlacement","useState","inlineStyles","setInlineStyles","inlineArrowStyles","setInlineArrowStyles","show","setShow","rendered","setRendered","wasShowing","lastFloatPosition","setProviderActiveAnchor","hoveringTooltip","anchorsBySelect","setAnchorsBySelect","mounted","shouldOpenOnClick","includes","handleShow","undefined","handleHideTooltipDelayed","delay","handleShowTooltip","event","target","currentTarget","isConnected","handleHideTooltip","handleTooltipPosition","getBoundingClientRect","width","height","computedStylesData","Object","keys","length","handleMouseMove","mouseEvent","mousePosition","clientX","clientY","handleClickTooltipAnchor","handleClickOutsideAnchors","querySelector","anchor","contains","debouncedHandleShowTooltip","debouncedHandleHideTooltip","elementRefs","forEach","add","anchorById","handleScrollResize","anchorScrollParent","tooltipScrollParent","addEventListener","handleEsc","key","enabledEvents","listener","handleMouseEnterTooltip","handleMouseLeaveTooltip","removeEventListener","selector","documentObserver","MutationObserver","mutationList","newAnchors","mutation","attributeName","getAttribute","removedNodes","call","elements","addedNodes","filter","nodeType","matches","flatMap","querySelectorAll","anchors","observe","body","childList","subtree","attributes","attributeFilter","disconnect","updateTooltipPosition","contentObserver","ResizeObserver","Array","from","canShow","React","role","classNames","TooltipContent","dangerouslySetInnerHTML","__html","html","render","children","tooltipContent","setTooltipContent","tooltipHtml","setTooltipHtml","tooltipPlace","setTooltipPlace","tooltipVariant","setTooltipVariant","tooltipOffset","setTooltipOffset","tooltipDelayShow","setTooltipDelayShow","tooltipDelayHide","setTooltipDelayHide","tooltipFloat","setTooltipFloat","tooltipHidden","setTooltipHidden","tooltipWrapper","setTooltipWrapper","tooltipEvents","setTooltipEvents","tooltipPositionStrategy","setTooltipPositionStrategy","providerActiveAnchor","getDataAttributesFromAnchorElement","getAttributeNames","reduce","acc","name","startsWith","replace","applyAllDataAttributesFromAnchorElement","dataAttributes","handleDataAttributes","parsed","values","handler","entries","console","warn","size","anchorElement","observer","observerConfig","renderedContent","props","anchorRefMap","setAnchorRefMap","activeAnchorMap","setActiveAnchorMap","refs","oldMap","tooltipRefs","delete","useCallback","context","useMemo","Provider","anchorRef"],"mappings":";;;;;;2OAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB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,QACE3N,cAAA,OAAA,CAAAN,IAAKqS,EACLpM,UAAWkI,EAAAA,QAAW,wBAAyBlI,GAC3B,qBAAAjC,yBACEwD,EAAO,oBACV+G,EAAI,uBACDpI,EACD,sBAAAlC,EACC,uBAAAwC,wBACDH,EAAM,iCACKE,EAAgB,0BACvBG,EACA,0BAAAC,GAExB6H,EAEJ"}
1
+ {"version":3,"file":"react-tooltip.min.cjs","sources":["../src/utils/handle-style.ts","../src/utils/debounce.ts","../src/components/TooltipProvider/TooltipProvider.tsx","../src/components/TooltipProvider/TooltipWrapper.tsx","../src/utils/use-isomorphic-layout-effect.ts","../src/utils/get-scroll-parent.ts","../src/utils/compute-positions.ts","../src/components/Tooltip/Tooltip.tsx","../src/components/TooltipContent/TooltipContent.tsx","../src/index.tsx","../src/components/TooltipController/TooltipController.tsx"],"sourcesContent":["// This is the ID for the core styles of ReactTooltip\nconst REACT_TOOLTIP_CORE_STYLES_ID = 'react-tooltip-core-styles'\n// This is the ID for the visual styles of ReactTooltip\nconst REACT_TOOLTIP_BASE_STYLES_ID = 'react-tooltip-base-styles'\n\nfunction injectStyle({\n css,\n id = REACT_TOOLTIP_BASE_STYLES_ID,\n type = 'base',\n ref,\n}: {\n css: string\n id?: string\n type?: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref?: any\n}) {\n if (type === 'core' && process.env.REACT_TOOLTIP_DISABLE_CORE_STYLES) {\n return\n }\n\n if (type !== 'core' && process.env.REACT_TOOLTIP_DISABLE_BASE_STYLES) {\n return\n }\n\n if (type === 'core') {\n // eslint-disable-next-line no-param-reassign\n id = REACT_TOOLTIP_CORE_STYLES_ID\n }\n\n if (!ref) {\n // eslint-disable-next-line no-param-reassign\n ref = {}\n }\n const { insertAt } = ref\n\n if (!css || typeof document === 'undefined' || document.getElementById(id)) {\n return\n }\n\n const head = document.head || document.getElementsByTagName('head')[0]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const style: any = document.createElement('style')\n style.id = id\n style.type = 'text/css'\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n}\n\nfunction removeStyle({\n type = 'base',\n id = REACT_TOOLTIP_BASE_STYLES_ID,\n}: {\n type?: string\n id?: string\n}) {\n if (type === 'core') {\n // eslint-disable-next-line no-param-reassign\n id = REACT_TOOLTIP_CORE_STYLES_ID\n }\n\n const style = document.getElementById(id)\n style?.remove()\n}\n\nexport { injectStyle, removeStyle }\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This function debounce the received function\n * @param { function } \tfunc\t\t\t\tFunction to be debounced\n * @param { number } \t\twait\t\t\t\tTime to wait before execut the function\n * @param { boolean } \timmediate\t\tParam to define if the function will be executed immediately\n */\nconst debounce = (func: (...args: any[]) => void, wait?: number, immediate?: true) => {\n let timeout: NodeJS.Timeout | null = null\n\n return function debounced(this: typeof func, ...args: any[]) {\n const later = () => {\n timeout = null\n if (!immediate) {\n func.apply(this, args)\n }\n }\n\n if (immediate && !timeout) {\n /**\n * there's not need to clear the timeout\n * since we expect it to resolve and set `timeout = null`\n */\n func.apply(this, args)\n timeout = setTimeout(later, wait)\n }\n\n if (!immediate) {\n if (timeout) {\n clearTimeout(timeout)\n }\n timeout = setTimeout(later, wait)\n }\n }\n}\n\nexport default debounce\n","import React, {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react'\n\nimport type {\n AnchorRef,\n TooltipContextData,\n TooltipContextDataWrapper,\n} from './TooltipProviderTypes'\n\nconst DEFAULT_TOOLTIP_ID = 'DEFAULT_TOOLTIP_ID'\nconst DEFAULT_CONTEXT_DATA: TooltipContextData = {\n anchorRefs: new Set(),\n activeAnchor: { current: null },\n attach: () => {\n /* attach anchor element */\n },\n detach: () => {\n /* detach anchor element */\n },\n setActiveAnchor: () => {\n /* set active anchor */\n },\n}\n\nconst DEFAULT_CONTEXT_DATA_WRAPPER: TooltipContextDataWrapper = {\n getTooltipData: () => DEFAULT_CONTEXT_DATA,\n}\n\nconst TooltipContext = createContext<TooltipContextDataWrapper>(DEFAULT_CONTEXT_DATA_WRAPPER)\n\n/**\n * @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead.\n * See https://react-tooltip.com/docs/getting-started\n */\nconst TooltipProvider: React.FC<PropsWithChildren<void>> = ({ children }) => {\n const [anchorRefMap, setAnchorRefMap] = useState<Record<string, Set<AnchorRef>>>({\n [DEFAULT_TOOLTIP_ID]: new Set(),\n })\n const [activeAnchorMap, setActiveAnchorMap] = useState<Record<string, AnchorRef>>({\n [DEFAULT_TOOLTIP_ID]: { current: null },\n })\n\n const attach = (tooltipId: string, ...refs: AnchorRef[]) => {\n setAnchorRefMap((oldMap) => {\n const tooltipRefs = oldMap[tooltipId] ?? new Set()\n refs.forEach((ref) => tooltipRefs.add(ref))\n // create new object to trigger re-render\n return { ...oldMap, [tooltipId]: new Set(tooltipRefs) }\n })\n }\n\n const detach = (tooltipId: string, ...refs: AnchorRef[]) => {\n setAnchorRefMap((oldMap) => {\n const tooltipRefs = oldMap[tooltipId]\n if (!tooltipRefs) {\n // tooltip not found\n // maybe thow error?\n return oldMap\n }\n refs.forEach((ref) => tooltipRefs.delete(ref))\n // create new object to trigger re-render\n return { ...oldMap }\n })\n }\n\n const setActiveAnchor = (tooltipId: string, ref: React.RefObject<HTMLElement>) => {\n setActiveAnchorMap((oldMap) => {\n if (oldMap[tooltipId]?.current === ref.current) {\n return oldMap\n }\n // create new object to trigger re-render\n return { ...oldMap, [tooltipId]: ref }\n })\n }\n\n const getTooltipData = useCallback(\n (tooltipId = DEFAULT_TOOLTIP_ID) => ({\n anchorRefs: anchorRefMap[tooltipId] ?? new Set(),\n activeAnchor: activeAnchorMap[tooltipId] ?? { current: null },\n attach: (...refs: AnchorRef[]) => attach(tooltipId, ...refs),\n detach: (...refs: AnchorRef[]) => detach(tooltipId, ...refs),\n setActiveAnchor: (ref: AnchorRef) => setActiveAnchor(tooltipId, ref),\n }),\n [anchorRefMap, activeAnchorMap, attach, detach],\n )\n\n const context = useMemo(() => {\n return {\n getTooltipData,\n }\n }, [getTooltipData])\n\n return <TooltipContext.Provider value={context}>{children}</TooltipContext.Provider>\n}\n\nexport function useTooltip(tooltipId = DEFAULT_TOOLTIP_ID) {\n return useContext(TooltipContext).getTooltipData(tooltipId)\n}\n\nexport default TooltipProvider\n","import React, { useEffect, useRef } from 'react'\nimport classNames from 'classnames'\nimport { useTooltip } from './TooltipProvider'\nimport type { ITooltipWrapper } from './TooltipProviderTypes'\n\n/**\n * @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead.\n * See https://react-tooltip.com/docs/getting-started\n */\nconst TooltipWrapper = ({\n tooltipId,\n children,\n className,\n place,\n content,\n html,\n variant,\n offset,\n wrapper,\n events,\n positionStrategy,\n delayShow,\n delayHide,\n}: ITooltipWrapper) => {\n const { attach, detach } = useTooltip(tooltipId)\n const anchorRef = useRef<HTMLElement | null>(null)\n\n useEffect(() => {\n attach(anchorRef)\n return () => {\n detach(anchorRef)\n }\n }, [])\n\n return (\n <span\n ref={anchorRef}\n className={classNames('react-tooltip-wrapper', className)}\n data-tooltip-place={place}\n data-tooltip-content={content}\n data-tooltip-html={html}\n data-tooltip-variant={variant}\n data-tooltip-offset={offset}\n data-tooltip-wrapper={wrapper}\n data-tooltip-events={events}\n data-tooltip-position-strategy={positionStrategy}\n data-tooltip-delay-show={delayShow}\n data-tooltip-delay-hide={delayHide}\n >\n {children}\n </span>\n )\n}\n\nexport default TooltipWrapper\n","import { useLayoutEffect, useEffect } from 'react'\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nexport default useIsomorphicLayoutEffect\n","const isScrollable = (node: Element) => {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return false\n }\n const style = getComputedStyle(node)\n return ['overflow', 'overflow-x', 'overflow-y'].some((propertyName) => {\n const value = style.getPropertyValue(propertyName)\n return value === 'auto' || value === 'scroll'\n })\n}\n\nexport const getScrollParent = (node: Element | null) => {\n if (!node) {\n return null\n }\n let currentParent = node.parentElement\n while (currentParent) {\n if (isScrollable(currentParent)) {\n return currentParent\n }\n currentParent = currentParent.parentElement\n }\n return document.scrollingElement || document.documentElement\n}\n","import { computePosition, offset, shift, arrow, flip } from '@floating-ui/dom'\nimport type { IComputePositions } from './compute-positions-types'\n\nexport const computeTooltipPosition = async ({\n elementReference = null,\n tooltipReference = null,\n tooltipArrowReference = null,\n place = 'top',\n offset: offsetValue = 10,\n strategy = 'absolute',\n middlewares = [offset(Number(offsetValue)), flip(), shift({ padding: 5 })],\n}: IComputePositions) => {\n if (!elementReference) {\n // elementReference can be null or undefined and we will not compute the position\n // eslint-disable-next-line no-console\n // console.error('The reference element for tooltip was not defined: ', elementReference)\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n if (tooltipReference === null) {\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n const middleware = middlewares\n\n if (tooltipArrowReference) {\n middleware.push(arrow({ element: tooltipArrowReference as HTMLElement, padding: 5 }))\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: place,\n strategy,\n middleware,\n }).then(({ x, y, placement, middlewareData }) => {\n const styles = { left: `${x}px`, top: `${y}px` }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow ?? { x: 0, y: 0 }\n\n const staticSide =\n {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0]] ?? 'bottom'\n\n const arrowStyle = {\n left: arrowX != null ? `${arrowX}px` : '',\n top: arrowY != null ? `${arrowY}px` : '',\n right: '',\n bottom: '',\n [staticSide]: '-4px',\n }\n\n return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement }\n })\n }\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: 'bottom',\n strategy,\n middleware,\n }).then(({ x, y, placement }) => {\n const styles = { left: `${x}px`, top: `${y}px` }\n\n return { tooltipStyles: styles, tooltipArrowStyles: {}, place: placement }\n })\n}\n","import React, { useEffect, useState, useRef } from 'react'\nimport classNames from 'classnames'\nimport debounce from 'utils/debounce'\nimport { useTooltip } from 'components/TooltipProvider'\nimport useIsomorphicLayoutEffect from 'utils/use-isomorphic-layout-effect'\nimport { getScrollParent } from 'utils/get-scroll-parent'\nimport { computeTooltipPosition } from 'utils/compute-positions'\nimport coreStyles from './core-styles.module.css'\nimport styles from './styles.module.css'\nimport type { IPosition, ITooltip, PlacesType } from './TooltipTypes'\n\nconst Tooltip = ({\n // props\n id,\n className,\n classNameArrow,\n variant = 'dark',\n anchorId,\n anchorSelect,\n place = 'top',\n offset = 10,\n events = ['hover'],\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n wrapper: WrapperElement,\n delayShow = 0,\n delayHide = 0,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n closeOnEsc = false,\n closeOnScroll = false,\n closeOnResize = false,\n style: externalStyles,\n position,\n afterShow,\n afterHide,\n // props handled by controller\n content,\n contentWrapperRef,\n isOpen,\n setIsOpen,\n activeAnchor,\n setActiveAnchor,\n}: ITooltip) => {\n const tooltipRef = useRef<HTMLElement>(null)\n const tooltipArrowRef = useRef<HTMLElement>(null)\n const tooltipShowDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const tooltipHideDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const [actualPlacement, setActualPlacement] = useState(place)\n const [inlineStyles, setInlineStyles] = useState({})\n const [inlineArrowStyles, setInlineArrowStyles] = useState({})\n const [show, setShow] = useState(false)\n const [rendered, setRendered] = useState(false)\n const wasShowing = useRef(false)\n const lastFloatPosition = useRef<IPosition | null>(null)\n /**\n * @todo Remove this in a future version (provider/wrapper method is deprecated)\n */\n const { anchorRefs, setActiveAnchor: setProviderActiveAnchor } = useTooltip(id)\n const hoveringTooltip = useRef(false)\n const [anchorsBySelect, setAnchorsBySelect] = useState<HTMLElement[]>([])\n const mounted = useRef(false)\n\n const shouldOpenOnClick = openOnClick || events.includes('click')\n\n /**\n * useLayoutEffect runs before useEffect,\n * but should be used carefully because of caveats\n * https://beta.reactjs.org/reference/react/useLayoutEffect#caveats\n */\n useIsomorphicLayoutEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n }\n }, [])\n\n useEffect(() => {\n if (!show) {\n /**\n * this fixes weird behavior when switching between two anchor elements very quickly\n * remove the timeout and switch quickly between two adjancent anchor elements to see it\n *\n * in practice, this means the tooltip is not immediately removed from the DOM on hide\n */\n const timeout = setTimeout(() => {\n setRendered(false)\n }, 150)\n return () => {\n clearTimeout(timeout)\n }\n }\n return () => null\n }, [show])\n\n const handleShow = (value: boolean) => {\n if (!mounted.current) {\n return\n }\n if (value) {\n setRendered(true)\n }\n /**\n * wait for the component to render and calculate position\n * before actually showing\n */\n setTimeout(() => {\n if (!mounted.current) {\n return\n }\n setIsOpen?.(value)\n if (isOpen === undefined) {\n setShow(value)\n }\n }, 10)\n }\n\n /**\n * this replicates the effect from `handleShow()`\n * when `isOpen` is changed from outside\n */\n useEffect(() => {\n if (isOpen === undefined) {\n return () => null\n }\n if (isOpen) {\n setRendered(true)\n }\n const timeout = setTimeout(() => {\n setShow(isOpen)\n }, 10)\n return () => {\n clearTimeout(timeout)\n }\n }, [isOpen])\n\n useEffect(() => {\n if (show === wasShowing.current) {\n return\n }\n wasShowing.current = show\n if (show) {\n afterShow?.()\n } else {\n afterHide?.()\n }\n }, [show])\n\n const handleShowTooltipDelayed = () => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n\n tooltipShowDelayTimerRef.current = setTimeout(() => {\n handleShow(true)\n }, delayShow)\n }\n\n const handleHideTooltipDelayed = (delay = delayHide) => {\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n\n tooltipHideDelayTimerRef.current = setTimeout(() => {\n if (hoveringTooltip.current) {\n return\n }\n handleShow(false)\n }, delay)\n }\n\n const handleShowTooltip = (event?: Event) => {\n if (!event) {\n return\n }\n const target = (event.currentTarget ?? event.target) as HTMLElement | null\n if (!target?.isConnected) {\n /**\n * this happens when the target is removed from the DOM\n * at the same time the tooltip gets triggered\n */\n setActiveAnchor(null)\n setProviderActiveAnchor({ current: null })\n return\n }\n if (delayShow) {\n handleShowTooltipDelayed()\n } else {\n handleShow(true)\n }\n setActiveAnchor(target)\n setProviderActiveAnchor({ current: target })\n\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n\n const handleHideTooltip = () => {\n if (clickable) {\n // allow time for the mouse to reach the tooltip, in case there's a gap\n handleHideTooltipDelayed(delayHide || 100)\n } else if (delayHide) {\n handleHideTooltipDelayed()\n } else {\n handleShow(false)\n }\n\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n }\n\n const handleTooltipPosition = ({ x, y }: IPosition) => {\n const virtualElement = {\n getBoundingClientRect() {\n return {\n x,\n y,\n width: 0,\n height: 0,\n top: y,\n left: x,\n right: x,\n bottom: y,\n }\n },\n } as Element\n computeTooltipPosition({\n place,\n offset,\n elementReference: virtualElement,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n }).then((computedStylesData) => {\n if (Object.keys(computedStylesData.tooltipStyles).length) {\n setInlineStyles(computedStylesData.tooltipStyles)\n }\n if (Object.keys(computedStylesData.tooltipArrowStyles).length) {\n setInlineArrowStyles(computedStylesData.tooltipArrowStyles)\n }\n setActualPlacement(computedStylesData.place as PlacesType)\n })\n }\n\n const handleMouseMove = (event?: Event) => {\n if (!event) {\n return\n }\n const mouseEvent = event as MouseEvent\n const mousePosition = {\n x: mouseEvent.clientX,\n y: mouseEvent.clientY,\n }\n handleTooltipPosition(mousePosition)\n lastFloatPosition.current = mousePosition\n }\n\n const handleClickTooltipAnchor = (event?: Event) => {\n handleShowTooltip(event)\n if (delayHide) {\n handleHideTooltipDelayed()\n }\n }\n\n const handleClickOutsideAnchors = (event: MouseEvent) => {\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n const anchors = [anchorById, ...anchorsBySelect]\n if (anchors.some((anchor) => anchor?.contains(event.target as HTMLElement))) {\n return\n }\n if (tooltipRef.current?.contains(event.target as HTMLElement)) {\n return\n }\n handleShow(false)\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n }\n\n // debounce handler to prevent call twice when\n // mouse enter and focus events being triggered toggether\n const debouncedHandleShowTooltip = debounce(handleShowTooltip, 50, true)\n const debouncedHandleHideTooltip = debounce(handleHideTooltip, 50, true)\n\n useEffect(() => {\n const elementRefs = new Set(anchorRefs)\n\n anchorsBySelect.forEach((anchor) => {\n elementRefs.add({ current: anchor })\n })\n\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n if (anchorById) {\n elementRefs.add({ current: anchorById })\n }\n\n const handleScrollResize = () => {\n handleShow(false)\n }\n\n const anchorScrollParent = getScrollParent(activeAnchor)\n const tooltipScrollParent = getScrollParent(tooltipRef.current)\n\n if (closeOnScroll) {\n window.addEventListener('scroll', handleScrollResize)\n anchorScrollParent?.addEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.addEventListener('scroll', handleScrollResize)\n }\n if (closeOnResize) {\n window.addEventListener('resize', handleScrollResize)\n }\n\n const handleEsc = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return\n }\n handleShow(false)\n }\n\n if (closeOnEsc) {\n window.addEventListener('keydown', handleEsc)\n }\n\n const enabledEvents: { event: string; listener: (event?: Event) => void }[] = []\n\n if (shouldOpenOnClick) {\n window.addEventListener('click', handleClickOutsideAnchors)\n enabledEvents.push({ event: 'click', listener: handleClickTooltipAnchor })\n } else {\n enabledEvents.push(\n { event: 'mouseenter', listener: debouncedHandleShowTooltip },\n { event: 'mouseleave', listener: debouncedHandleHideTooltip },\n { event: 'focus', listener: debouncedHandleShowTooltip },\n { event: 'blur', listener: debouncedHandleHideTooltip },\n )\n if (float) {\n enabledEvents.push({\n event: 'mousemove',\n listener: handleMouseMove,\n })\n }\n }\n\n const handleMouseEnterTooltip = () => {\n hoveringTooltip.current = true\n }\n const handleMouseLeaveTooltip = () => {\n hoveringTooltip.current = false\n handleHideTooltip()\n }\n\n if (clickable && !shouldOpenOnClick) {\n tooltipRef.current?.addEventListener('mouseenter', handleMouseEnterTooltip)\n tooltipRef.current?.addEventListener('mouseleave', handleMouseLeaveTooltip)\n }\n\n enabledEvents.forEach(({ event, listener }) => {\n elementRefs.forEach((ref) => {\n ref.current?.addEventListener(event, listener)\n })\n })\n\n return () => {\n if (closeOnScroll) {\n window.removeEventListener('scroll', handleScrollResize)\n anchorScrollParent?.removeEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.removeEventListener('scroll', handleScrollResize)\n }\n if (closeOnResize) {\n window.removeEventListener('resize', handleScrollResize)\n }\n if (shouldOpenOnClick) {\n window.removeEventListener('click', handleClickOutsideAnchors)\n }\n if (closeOnEsc) {\n window.removeEventListener('keydown', handleEsc)\n }\n if (clickable && !shouldOpenOnClick) {\n tooltipRef.current?.removeEventListener('mouseenter', handleMouseEnterTooltip)\n tooltipRef.current?.removeEventListener('mouseleave', handleMouseLeaveTooltip)\n }\n enabledEvents.forEach(({ event, listener }) => {\n elementRefs.forEach((ref) => {\n ref.current?.removeEventListener(event, listener)\n })\n })\n }\n /**\n * rendered is also a dependency to ensure anchor observers are re-registered\n * since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM\n */\n }, [rendered, anchorRefs, anchorsBySelect, closeOnEsc, events])\n\n useEffect(() => {\n let selector = anchorSelect ?? ''\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n const documentObserverCallback: MutationCallback = (mutationList) => {\n const newAnchors: HTMLElement[] = []\n mutationList.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-id') {\n const newId = (mutation.target as HTMLElement).getAttribute('data-tooltip-id')\n if (newId === id) {\n newAnchors.push(mutation.target as HTMLElement)\n }\n }\n if (mutation.type !== 'childList') {\n return\n }\n if (activeAnchor) {\n ;[...mutation.removedNodes].some((node) => {\n if (node?.contains?.(activeAnchor)) {\n setRendered(false)\n handleShow(false)\n setActiveAnchor(null)\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n return true\n }\n return false\n })\n }\n if (!selector) {\n return\n }\n try {\n const elements = [...mutation.addedNodes].filter((node) => node.nodeType === 1)\n newAnchors.push(\n // the element itself is an anchor\n ...(elements.filter((element) =>\n (element as HTMLElement).matches(selector),\n ) as HTMLElement[]),\n )\n newAnchors.push(\n // the element has children which are anchors\n ...elements.flatMap(\n (element) =>\n [...(element as HTMLElement).querySelectorAll(selector)] as HTMLElement[],\n ),\n )\n } catch {\n /**\n * invalid CSS selector.\n * already warned on tooltip controller\n */\n }\n })\n if (newAnchors.length) {\n setAnchorsBySelect((anchors) => [...anchors, ...newAnchors])\n }\n }\n const documentObserver = new MutationObserver(documentObserverCallback)\n // watch for anchor being removed from the DOM\n documentObserver.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-tooltip-id'],\n })\n return () => {\n documentObserver.disconnect()\n }\n }, [id, anchorSelect, activeAnchor])\n\n const updateTooltipPosition = () => {\n if (position) {\n // if `position` is set, override regular and `float` positioning\n handleTooltipPosition(position)\n return\n }\n\n if (float) {\n if (lastFloatPosition.current) {\n /*\n Without this, changes to `content`, `place`, `offset`, ..., will only\n trigger a position calculation after a `mousemove` event.\n\n To see why this matters, comment this line, run `yarn dev` and click the\n \"Hover me!\" anchor.\n */\n handleTooltipPosition(lastFloatPosition.current)\n }\n // if `float` is set, override regular positioning\n return\n }\n\n computeTooltipPosition({\n place,\n offset,\n elementReference: activeAnchor,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n }).then((computedStylesData) => {\n if (!mounted.current) {\n // invalidate computed positions after remount\n return\n }\n if (Object.keys(computedStylesData.tooltipStyles).length) {\n setInlineStyles(computedStylesData.tooltipStyles)\n }\n if (Object.keys(computedStylesData.tooltipArrowStyles).length) {\n setInlineArrowStyles(computedStylesData.tooltipArrowStyles)\n }\n setActualPlacement(computedStylesData.place as PlacesType)\n })\n }\n\n useEffect(() => {\n updateTooltipPosition()\n }, [show, activeAnchor, content, externalStyles, place, offset, positionStrategy, position])\n\n useEffect(() => {\n if (!contentWrapperRef?.current) {\n return () => null\n }\n const contentObserver = new ResizeObserver(() => {\n updateTooltipPosition()\n })\n contentObserver.observe(contentWrapperRef.current)\n return () => {\n contentObserver.disconnect()\n }\n }, [content, contentWrapperRef?.current])\n\n useEffect(() => {\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n const anchors = [...anchorsBySelect, anchorById]\n if (!activeAnchor || !anchors.includes(activeAnchor)) {\n /**\n * if there is no active anchor,\n * or if the current active anchor is not amongst the allowed ones,\n * reset it\n */\n setActiveAnchor(anchorsBySelect[0] ?? anchorById)\n }\n }, [anchorId, anchorsBySelect, activeAnchor])\n\n useEffect(() => {\n return () => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n }, [])\n\n useEffect(() => {\n let selector = anchorSelect\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n if (!selector) {\n return\n }\n try {\n const anchors = Array.from(document.querySelectorAll<HTMLElement>(selector))\n setAnchorsBySelect(anchors)\n } catch {\n // warning was already issued in the controller\n setAnchorsBySelect([])\n }\n }, [id, anchorSelect])\n\n const canShow = !hidden && content && show && Object.keys(inlineStyles).length > 0\n\n return rendered ? (\n <WrapperElement\n id={id}\n role=\"tooltip\"\n className={classNames(\n 'react-tooltip',\n coreStyles['tooltip'],\n styles[variant],\n className,\n `react-tooltip__place-${actualPlacement}`,\n {\n [coreStyles['show']]: canShow,\n [coreStyles['fixed']]: positionStrategy === 'fixed',\n [coreStyles['clickable']]: clickable,\n },\n )}\n style={{ ...externalStyles, ...inlineStyles }}\n ref={tooltipRef}\n >\n {content}\n <WrapperElement\n className={classNames(\n 'react-tooltip-arrow',\n coreStyles['arrow'],\n styles['arrow'],\n classNameArrow,\n {\n /**\n * changed from dash `no-arrow` to camelcase because of:\n * https://github.com/indooorsman/esbuild-css-modules-plugin/issues/42\n */\n [coreStyles['noArrow']]: noArrow,\n },\n )}\n style={inlineArrowStyles}\n ref={tooltipArrowRef}\n />\n </WrapperElement>\n ) : null\n}\n\nexport default Tooltip\n","/* eslint-disable react/no-danger */\nimport React from 'react'\nimport type { ITooltipContent } from './TooltipContentTypes'\n\nconst TooltipContent = ({ content }: ITooltipContent) => {\n return <span dangerouslySetInnerHTML={{ __html: content }} />\n}\n\nexport default TooltipContent\n","import './tokens.css'\n\nimport { injectStyle } from 'utils/handle-style'\n\nimport type {\n ChildrenType,\n DataAttribute,\n EventsType,\n PlacesType,\n PositionStrategy,\n VariantType,\n WrapperType,\n IPosition,\n Middleware,\n} from './components/Tooltip/TooltipTypes'\nimport type { ITooltipController } from './components/TooltipController/TooltipControllerTypes'\nimport type { ITooltipWrapper } from './components/TooltipProvider/TooltipProviderTypes'\n\n// those content will be replaced in build time with the `react-tooltip.css` builded content\nconst TooltipCoreStyles = 'react-tooltip-core-css-placeholder'\nconst TooltipStyles = 'react-tooltip-css-placeholder'\n\ninjectStyle({ css: TooltipCoreStyles, type: 'core' })\ninjectStyle({ css: TooltipStyles })\n\nexport { TooltipController as Tooltip } from './components/TooltipController'\nexport { TooltipProvider, TooltipWrapper } from './components/TooltipProvider'\nexport type {\n ChildrenType,\n DataAttribute,\n EventsType,\n PlacesType,\n PositionStrategy,\n VariantType,\n WrapperType,\n ITooltipController as ITooltip,\n ITooltipWrapper,\n IPosition,\n Middleware,\n}\n\nexport { removeStyle } from './utils/handle-style'\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Tooltip } from 'components/Tooltip'\nimport type {\n EventsType,\n PositionStrategy,\n PlacesType,\n VariantType,\n WrapperType,\n DataAttribute,\n ITooltip,\n ChildrenType,\n} from 'components/Tooltip/TooltipTypes'\nimport { useTooltip } from 'components/TooltipProvider'\nimport { TooltipContent } from 'components/TooltipContent'\nimport type { ITooltipController } from './TooltipControllerTypes'\n\nconst TooltipController = ({\n id,\n anchorId,\n anchorSelect,\n content,\n html,\n render,\n className,\n classNameArrow,\n variant = 'dark',\n place = 'top',\n offset = 10,\n wrapper = 'div',\n children = null,\n events = ['hover'],\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n delayShow = 0,\n delayHide = 0,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n closeOnEsc = false,\n closeOnScroll = false,\n closeOnResize = false,\n style,\n position,\n isOpen,\n setIsOpen,\n afterShow,\n afterHide,\n}: ITooltipController) => {\n const [tooltipContent, setTooltipContent] = useState(content)\n const [tooltipHtml, setTooltipHtml] = useState(html)\n const [tooltipPlace, setTooltipPlace] = useState(place)\n const [tooltipVariant, setTooltipVariant] = useState(variant)\n const [tooltipOffset, setTooltipOffset] = useState(offset)\n const [tooltipDelayShow, setTooltipDelayShow] = useState(delayShow)\n const [tooltipDelayHide, setTooltipDelayHide] = useState(delayHide)\n const [tooltipFloat, setTooltipFloat] = useState(float)\n const [tooltipHidden, setTooltipHidden] = useState(hidden)\n const [tooltipWrapper, setTooltipWrapper] = useState<WrapperType>(wrapper)\n const [tooltipEvents, setTooltipEvents] = useState(events)\n const [tooltipPositionStrategy, setTooltipPositionStrategy] = useState(positionStrategy)\n const [activeAnchor, setActiveAnchor] = useState<HTMLElement | null>(null)\n /**\n * @todo Remove this in a future version (provider/wrapper method is deprecated)\n */\n const { anchorRefs, activeAnchor: providerActiveAnchor } = useTooltip(id)\n\n const getDataAttributesFromAnchorElement = (elementReference: HTMLElement) => {\n const dataAttributes = elementReference?.getAttributeNames().reduce((acc, name) => {\n if (name.startsWith('data-tooltip-')) {\n const parsedAttribute = name.replace(/^data-tooltip-/, '') as DataAttribute\n acc[parsedAttribute] = elementReference?.getAttribute(name) ?? null\n }\n return acc\n }, {} as Record<DataAttribute, string | null>)\n\n return dataAttributes\n }\n\n const applyAllDataAttributesFromAnchorElement = (\n dataAttributes: Record<string, string | null>,\n ) => {\n const handleDataAttributes: Record<DataAttribute, (value: string | null) => void> = {\n place: (value) => {\n setTooltipPlace((value as PlacesType) ?? place)\n },\n content: (value) => {\n setTooltipContent(value ?? content)\n },\n html: (value) => {\n setTooltipHtml(value ?? html)\n },\n variant: (value) => {\n setTooltipVariant((value as VariantType) ?? variant)\n },\n offset: (value) => {\n setTooltipOffset(value === null ? offset : Number(value))\n },\n wrapper: (value) => {\n setTooltipWrapper((value as WrapperType) ?? wrapper)\n },\n events: (value) => {\n const parsed = value?.split(' ') as EventsType[]\n setTooltipEvents(parsed ?? events)\n },\n 'position-strategy': (value) => {\n setTooltipPositionStrategy((value as PositionStrategy) ?? positionStrategy)\n },\n 'delay-show': (value) => {\n setTooltipDelayShow(value === null ? delayShow : Number(value))\n },\n 'delay-hide': (value) => {\n setTooltipDelayHide(value === null ? delayHide : Number(value))\n },\n float: (value) => {\n setTooltipFloat(value === null ? float : value === 'true')\n },\n hidden: (value) => {\n setTooltipHidden(value === null ? hidden : value === 'true')\n },\n }\n // reset unset data attributes to default values\n // without this, data attributes from the last active anchor will still be used\n Object.values(handleDataAttributes).forEach((handler) => handler(null))\n Object.entries(dataAttributes).forEach(([key, value]) => {\n handleDataAttributes[key as DataAttribute]?.(value)\n })\n }\n\n useEffect(() => {\n setTooltipContent(content)\n }, [content])\n\n useEffect(() => {\n setTooltipHtml(html)\n }, [html])\n\n useEffect(() => {\n setTooltipPlace(place)\n }, [place])\n\n useEffect(() => {\n setTooltipVariant(variant)\n }, [variant])\n\n useEffect(() => {\n setTooltipOffset(offset)\n }, [offset])\n\n useEffect(() => {\n setTooltipDelayShow(delayShow)\n }, [delayShow])\n\n useEffect(() => {\n setTooltipDelayHide(delayHide)\n }, [delayHide])\n\n useEffect(() => {\n setTooltipFloat(float)\n }, [float])\n\n useEffect(() => {\n setTooltipHidden(hidden)\n }, [hidden])\n\n useEffect(() => {\n setTooltipPositionStrategy(positionStrategy)\n }, [positionStrategy])\n\n useEffect(() => {\n const elementRefs = new Set(anchorRefs)\n\n let selector = anchorSelect\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n if (selector) {\n try {\n const anchorsBySelect = document.querySelectorAll<HTMLElement>(selector)\n anchorsBySelect.forEach((anchor) => {\n elementRefs.add({ current: anchor })\n })\n } catch {\n if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${selector}\" is not a valid CSS selector`)\n }\n }\n }\n\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n if (anchorById) {\n elementRefs.add({ current: anchorById })\n }\n\n if (!elementRefs.size) {\n return () => null\n }\n\n const anchorElement = activeAnchor ?? anchorById ?? providerActiveAnchor.current\n\n const observerCallback: MutationCallback = (mutationList) => {\n mutationList.forEach((mutation) => {\n if (\n !anchorElement ||\n mutation.type !== 'attributes' ||\n !mutation.attributeName?.startsWith('data-tooltip-')\n ) {\n return\n }\n // make sure to get all set attributes, since all unset attributes are reset\n const dataAttributes = getDataAttributesFromAnchorElement(anchorElement)\n applyAllDataAttributesFromAnchorElement(dataAttributes)\n })\n }\n\n // Create an observer instance linked to the callback function\n const observer = new MutationObserver(observerCallback)\n\n // do not check for subtree and childrens, we only want to know attribute changes\n // to stay watching `data-attributes-*` from anchor element\n const observerConfig = { attributes: true, childList: false, subtree: false }\n\n if (anchorElement) {\n const dataAttributes = getDataAttributesFromAnchorElement(anchorElement)\n applyAllDataAttributesFromAnchorElement(dataAttributes)\n // Start observing the target node for configured mutations\n observer.observe(anchorElement, observerConfig)\n }\n\n return () => {\n // Remove the observer when the tooltip is destroyed\n observer.disconnect()\n }\n }, [anchorRefs, providerActiveAnchor, activeAnchor, anchorId, anchorSelect])\n\n /**\n * content priority: children < render or content < html\n * children should be lower priority so that it can be used as the \"default\" content\n */\n let renderedContent: ChildrenType = children\n const contentWrapperRef = useRef<HTMLDivElement>(null)\n if (render) {\n const rendered = render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode\n renderedContent = rendered ? (\n <div ref={contentWrapperRef} className=\"react-tooltip-content-wrapper\">\n {rendered}\n </div>\n ) : null\n } else if (tooltipContent) {\n renderedContent = tooltipContent\n }\n if (tooltipHtml) {\n renderedContent = <TooltipContent content={tooltipHtml} />\n }\n\n const props: ITooltip = {\n id,\n anchorId,\n anchorSelect,\n className,\n classNameArrow,\n content: renderedContent,\n contentWrapperRef,\n place: tooltipPlace,\n variant: tooltipVariant,\n offset: tooltipOffset,\n wrapper: tooltipWrapper,\n events: tooltipEvents,\n openOnClick,\n positionStrategy: tooltipPositionStrategy,\n middlewares,\n delayShow: tooltipDelayShow,\n delayHide: tooltipDelayHide,\n float: tooltipFloat,\n hidden: tooltipHidden,\n noArrow,\n clickable,\n closeOnEsc,\n closeOnScroll,\n closeOnResize,\n style,\n position,\n isOpen,\n setIsOpen,\n afterShow,\n afterHide,\n activeAnchor,\n setActiveAnchor: (anchor: HTMLElement | null) => setActiveAnchor(anchor),\n }\n\n return <Tooltip {...props} />\n}\n\nexport default TooltipController\n"],"names":["REACT_TOOLTIP_CORE_STYLES_ID","REACT_TOOLTIP_BASE_STYLES_ID","injectStyle","css","id","type","ref","process","env","REACT_TOOLTIP_DISABLE_CORE_STYLES","REACT_TOOLTIP_DISABLE_BASE_STYLES","insertAt","document","getElementById","head","getElementsByTagName","style","createElement","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","debounce","func","wait","immediate","timeout","args","later","apply","this","setTimeout","clearTimeout","DEFAULT_TOOLTIP_ID","DEFAULT_CONTEXT_DATA","anchorRefs","Set","activeAnchor","current","attach","detach","setActiveAnchor","DEFAULT_CONTEXT_DATA_WRAPPER","getTooltipData","TooltipContext","createContext","useTooltip","tooltipId","useContext","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","isScrollable","node","HTMLElement","SVGElement","getComputedStyle","some","propertyName","value","getPropertyValue","getScrollParent","currentParent","parentElement","scrollingElement","documentElement","computeTooltipPosition","async","elementReference","tooltipReference","tooltipArrowReference","place","offset","offsetValue","strategy","middlewares","Number","flip","shift","padding","tooltipStyles","tooltipArrowStyles","middleware","push","arrow","element","computePosition","placement","then","x","y","middlewareData","styles","left","top","arrowX","arrowY","_a","right","bottom","_b","split","Tooltip","className","classNameArrow","variant","anchorId","anchorSelect","events","openOnClick","positionStrategy","wrapper","WrapperElement","delayShow","delayHide","float","hidden","noArrow","clickable","closeOnEsc","closeOnScroll","closeOnResize","externalStyles","position","afterShow","afterHide","content","contentWrapperRef","isOpen","setIsOpen","tooltipRef","useRef","tooltipArrowRef","tooltipShowDelayTimerRef","tooltipHideDelayTimerRef","actualPlacement","setActualPlacement","useState","inlineStyles","setInlineStyles","inlineArrowStyles","setInlineArrowStyles","show","setShow","rendered","setRendered","wasShowing","lastFloatPosition","setProviderActiveAnchor","hoveringTooltip","anchorsBySelect","setAnchorsBySelect","mounted","shouldOpenOnClick","includes","handleShow","undefined","handleHideTooltipDelayed","delay","handleShowTooltip","event","target","currentTarget","isConnected","handleHideTooltip","handleTooltipPosition","getBoundingClientRect","width","height","computedStylesData","Object","keys","length","handleMouseMove","mouseEvent","mousePosition","clientX","clientY","handleClickTooltipAnchor","handleClickOutsideAnchors","querySelector","anchor","contains","debouncedHandleShowTooltip","debouncedHandleHideTooltip","elementRefs","forEach","add","anchorById","handleScrollResize","anchorScrollParent","tooltipScrollParent","addEventListener","handleEsc","key","enabledEvents","listener","handleMouseEnterTooltip","handleMouseLeaveTooltip","removeEventListener","selector","documentObserver","MutationObserver","mutationList","newAnchors","mutation","attributeName","getAttribute","removedNodes","call","elements","addedNodes","filter","nodeType","matches","flatMap","querySelectorAll","anchors","observe","body","childList","subtree","attributes","attributeFilter","disconnect","updateTooltipPosition","contentObserver","ResizeObserver","Array","from","canShow","React","role","classNames","coreStyles","coreStyles_show","coreStyles_fixed","coreStyles_clickable","coreStyles_noArrow","TooltipContent","dangerouslySetInnerHTML","__html","html","render","children","tooltipContent","setTooltipContent","tooltipHtml","setTooltipHtml","tooltipPlace","setTooltipPlace","tooltipVariant","setTooltipVariant","tooltipOffset","setTooltipOffset","tooltipDelayShow","setTooltipDelayShow","tooltipDelayHide","setTooltipDelayHide","tooltipFloat","setTooltipFloat","tooltipHidden","setTooltipHidden","tooltipWrapper","setTooltipWrapper","tooltipEvents","setTooltipEvents","tooltipPositionStrategy","setTooltipPositionStrategy","providerActiveAnchor","getDataAttributesFromAnchorElement","getAttributeNames","reduce","acc","name","startsWith","replace","applyAllDataAttributesFromAnchorElement","dataAttributes","handleDataAttributes","parsed","values","handler","entries","console","warn","size","anchorElement","observer","observerConfig","renderedContent","props","anchorRefMap","setAnchorRefMap","activeAnchorMap","setActiveAnchorMap","refs","oldMap","tooltipRefs","delete","useCallback","context","useMemo","Provider","anchorRef","remove"],"mappings":";;;;;;2OACA,MAAMA,EAA+B,4BAE/BC,EAA+B,4BAErC,SAASC,GAAYC,IACnBA,EAAGC,GACHA,EAAKH,EAA4BI,KACjCA,EAAO,OAAMC,IACbA,IAQA,GAAa,SAATD,GAAmBE,QAAQC,IAAIC,kCACjC,OAGF,GAAa,SAATJ,GAAmBE,QAAQC,IAAIE,kCACjC,OAGW,SAATL,IAEFD,EAAKJ,GAGFM,IAEHA,EAAM,CAAA,GAER,MAAMK,SAAEA,GAAaL,EAErB,IAA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,GAAUzD,EAAmC,yBCzF/D,EACrBtM,YACAsM,WACA7I,YACAhC,QACAuD,UACAoH,OACAzI,UACAjC,SACAuC,UACAH,SACAE,mBACAG,YACAC,gBAEA,MAAM5E,OAAEA,EAAMC,OAAEA,GAAWM,EAAWC,GAChCkQ,EAAY7K,SAA2B,MAS7C,OAPAhF,EAAAA,WAAU,KACRb,EAAO0Q,GACA,KACLzQ,EAAOyQ,EAAU,IAElB,IAGDzE,EAAAA,QACEzN,cAAA,OAAA,CAAAX,IAAK6S,EACLzM,UAAWkI,EAAAA,QAAW,wBAAyBlI,GAC3B,qBAAAhC,yBACEuD,EAAO,oBACVoH,EAAI,uBACDzI,EACD,sBAAAjC,EACC,uBAAAuC,wBACDH,EAAM,iCACKE,EAAgB,0BACvBG,EACA,0BAAAC,GAExBkI,EAEJ,sBHYH,UAAqBlP,KACnBA,EAAO,OAAMD,GACbA,EAAKH,IAKQ,SAATI,IAEFD,EAAKJ,GAGP,MAAMgB,EAAQJ,SAASC,eAAeT,GACtCY,SAAAA,EAAOoS,QACT"}
@@ -1 +1 @@
1
- :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}.styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;left:0;opacity:0;padding:8px 16px;pointer-events:none;position:absolute;top:0;transition:opacity .3s ease-out;visibility:hidden;width:max-content;will-change:opacity,visibility}.styles-module_fixed__7ciUi{position:fixed}.styles-module_arrow__K0L3T{background:inherit;height:8px;position:absolute;transform:rotate(45deg);width:8px}.styles-module_noArrow__T8y2L{display:none}.styles-module_clickable__Bv9o7{pointer-events:auto}.styles-module_show__2NboJ{opacity:var(--rt-opacity);visibility:visible}.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)}
1
+ :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}.core-styles-module_tooltip__3vRRp{border-radius:3px;font-size:90%;left:0;opacity:0;padding:8px 16px;pointer-events:none;position:absolute;top:0;transition:opacity .3s ease-out;visibility:hidden;width:max-content;will-change:opacity,visibility}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{background:inherit;position:absolute}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);visibility:visible}.styles-module_arrow__K0L3T{height:8px;transform:rotate(45deg);width:8px}.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)}
@@ -4,5 +4,5 @@
4
4
  * @copyright ReactTooltip Team
5
5
  * @license MIT
6
6
  */
7
- import e,{createContext as t,useState as r,useCallback as o,useMemo as l,useContext as n,useRef as i,useEffect as c,useLayoutEffect as a}from"react";import s from"classnames";import{arrow as u,computePosition as d,offset as p,flip as v,shift as m}from"@floating-ui/dom";function f(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===r&&o.firstChild?o.insertBefore(l,o.firstChild):o.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}f(":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}");const h=(e,t,r)=>{let o=null;return function(...l){const n=()=>{o=null,r||e.apply(this,l)};r&&!o&&(e.apply(this,l),o=setTimeout(n,t)),r||(o&&clearTimeout(o),o=setTimeout(n,t))}},y="DEFAULT_TOOLTIP_ID",w={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},_=t({getTooltipData:()=>w}),b=({children:t})=>{const[n,i]=r({[y]:new Set}),[c,a]=r({[y]:{current:null}}),s=(e,...t)=>{i((r=>{var o;const l=null!==(o=r[e])&&void 0!==o?o:new Set;return t.forEach((e=>l.add(e))),{...r,[e]:new Set(l)}}))},u=(e,...t)=>{i((r=>{const o=r[e];return o?(t.forEach((e=>o.delete(e))),{...r}):r}))},d=o(((e=y)=>{var t,r;return{anchorRefs:null!==(t=n[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=c[e])&&void 0!==r?r:{current:null},attach:(...t)=>s(e,...t),detach:(...t)=>u(e,...t),setActiveAnchor:t=>((e,t)=>{a((r=>{var o;return(null===(o=r[e])||void 0===o?void 0:o.current)===t.current?r:{...r,[e]:t}}))})(e,t)}}),[n,c,s,u]),p=l((()=>({getTooltipData:d})),[d]);return e.createElement(_.Provider,{value:p},t)};function g(e=y){return n(_).getTooltipData(e)}const S=({tooltipId:t,children:r,className:o,place:l,content:n,html:a,variant:u,offset:d,wrapper:p,events:v,positionStrategy:m,delayShow:f,delayHide:h})=>{const{attach:y,detach:w}=g(t),_=i(null);return c((()=>(y(_),()=>{w(_)})),[]),e.createElement("span",{ref:_,className:s("react-tooltip-wrapper",o),"data-tooltip-place":l,"data-tooltip-content":n,"data-tooltip-html":a,"data-tooltip-variant":u,"data-tooltip-offset":d,"data-tooltip-wrapper":p,"data-tooltip-events":v,"data-tooltip-position-strategy":m,"data-tooltip-delay-show":f,"data-tooltip-delay-hide":h},r)},E="undefined"!=typeof window?a:c,A=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return null;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const r=t.getPropertyValue(e);return"auto"===r||"scroll"===r}))},k=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(A(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},T=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:r=null,place:o="top",offset:l=10,strategy:n="absolute",middlewares:i=[p(Number(l)),v(),m({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:o};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:o};const c=i;return r?(c.push(u({element:r,padding:5})),d(e,t,{placement:o,strategy:n,middleware:c}).then((({x:e,y:t,placement:r,middlewareData:o})=>{var l,n;const i={left:`${e}px`,top:`${t}px`},{x:c,y:a}=null!==(l=o.arrow)&&void 0!==l?l:{x:0,y:0};return{tooltipStyles:i,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]])&&void 0!==n?n:"bottom"]:"-4px"},place:r}}))):d(e,t,{placement:"bottom",strategy:n,middleware:c}).then((({x:e,y:t,placement:r})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:r})))};var x={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T",noArrow:"styles-module_noArrow__T8y2L",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",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"};f(".styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;left:0;opacity:0;padding:8px 16px;pointer-events:none;position:absolute;top:0;transition:opacity .3s ease-out;visibility:hidden;width:max-content;will-change:opacity,visibility}.styles-module_fixed__7ciUi{position:fixed}.styles-module_arrow__K0L3T{background:inherit;height:8px;position:absolute;transform:rotate(45deg);width:8px}.styles-module_noArrow__T8y2L{display:none}.styles-module_clickable__Bv9o7{pointer-events:auto}.styles-module_show__2NboJ{opacity:var(--rt-opacity);visibility:visible}.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)}");const O=({id:t,className:o,classNameArrow:l,variant:n="dark",anchorId:a,anchorSelect:u,place:d="top",offset:p=10,events:v=["hover"],openOnClick:m=!1,positionStrategy:f="absolute",middlewares:y,wrapper:w,delayShow:_=0,delayHide:b=0,float:S=!1,hidden:A=!1,noArrow:O=!1,clickable:L=!1,closeOnEsc:N=!1,closeOnScroll:R=!1,closeOnResize:$=!1,style:C,position:H,afterShow:I,afterHide:W,content:j,contentWrapperRef:q,isOpen:z,setIsOpen:D,activeAnchor:B,setActiveAnchor:K})=>{const M=i(null),X=i(null),J=i(null),P=i(null),[U,F]=r(d),[V,Z]=r({}),[G,Y]=r({}),[Q,ee]=r(!1),[te,re]=r(!1),oe=i(!1),le=i(null),{anchorRefs:ne,setActiveAnchor:ie}=g(t),ce=i(!1),[ae,se]=r([]),ue=i(!1),de=m||v.includes("click");E((()=>(ue.current=!0,()=>{ue.current=!1})),[]),c((()=>{if(!Q){const e=setTimeout((()=>{re(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[Q]);const pe=e=>{ue.current&&(e&&re(!0),setTimeout((()=>{ue.current&&(null==D||D(e),void 0===z&&ee(e))}),10))};c((()=>{if(void 0===z)return()=>null;z&&re(!0);const e=setTimeout((()=>{ee(z)}),10);return()=>{clearTimeout(e)}}),[z]),c((()=>{Q!==oe.current&&(oe.current=Q,Q?null==I||I():null==W||W())}),[Q]);const ve=(e=b)=>{P.current&&clearTimeout(P.current),P.current=setTimeout((()=>{ce.current||pe(!1)}),e)},me=e=>{var t;if(!e)return;const r=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==r?void 0:r.isConnected))return K(null),void ie({current:null});_?(J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{pe(!0)}),_)):pe(!0),K(r),ie({current:r}),P.current&&clearTimeout(P.current)},fe=()=>{L?ve(b||100):b?ve():pe(!1),J.current&&clearTimeout(J.current)},he=({x:e,y:t})=>{T({place:d,offset:p,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:M.current,tooltipArrowReference:X.current,strategy:f,middlewares:y}).then((e=>{Object.keys(e.tooltipStyles).length&&Z(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&Y(e.tooltipArrowStyles),F(e.place)}))},ye=e=>{if(!e)return;const t=e,r={x:t.clientX,y:t.clientY};he(r),le.current=r},we=e=>{me(e),b&&ve()},_e=e=>{var t;[document.querySelector(`[id='${a}']`),...ae].some((t=>null==t?void 0:t.contains(e.target)))||(null===(t=M.current)||void 0===t?void 0:t.contains(e.target))||pe(!1)},be=h(me,50,!0),ge=h(fe,50,!0);c((()=>{var e,t;const r=new Set(ne);ae.forEach((e=>{r.add({current:e})}));const o=document.querySelector(`[id='${a}']`);o&&r.add({current:o});const l=()=>{pe(!1)},n=k(B),i=k(M.current);R&&(window.addEventListener("scroll",l),null==n||n.addEventListener("scroll",l),null==i||i.addEventListener("scroll",l)),$&&window.addEventListener("resize",l);const c=e=>{"Escape"===e.key&&pe(!1)};N&&window.addEventListener("keydown",c);const s=[];de?(window.addEventListener("click",_e),s.push({event:"click",listener:we})):(s.push({event:"mouseenter",listener:be},{event:"mouseleave",listener:ge},{event:"focus",listener:be},{event:"blur",listener:ge}),S&&s.push({event:"mousemove",listener:ye}));const u=()=>{ce.current=!0},d=()=>{ce.current=!1,fe()};return L&&!de&&(null===(e=M.current)||void 0===e||e.addEventListener("mouseenter",u),null===(t=M.current)||void 0===t||t.addEventListener("mouseleave",d)),s.forEach((({event:e,listener:t})=>{r.forEach((r=>{var o;null===(o=r.current)||void 0===o||o.addEventListener(e,t)}))})),()=>{var e,t;R&&(window.removeEventListener("scroll",l),null==n||n.removeEventListener("scroll",l),null==i||i.removeEventListener("scroll",l)),$&&window.removeEventListener("resize",l),de&&window.removeEventListener("click",_e),N&&window.removeEventListener("keydown",c),L&&!de&&(null===(e=M.current)||void 0===e||e.removeEventListener("mouseenter",u),null===(t=M.current)||void 0===t||t.removeEventListener("mouseleave",d)),s.forEach((({event:e,listener:t})=>{r.forEach((r=>{var o;null===(o=r.current)||void 0===o||o.removeEventListener(e,t)}))}))}}),[te,ne,ae,N,v]),c((()=>{let e=null!=u?u:"";!e&&t&&(e=`[data-tooltip-id='${t}']`);const r=new MutationObserver((r=>{const o=[];r.forEach((r=>{if("attributes"===r.type&&"data-tooltip-id"===r.attributeName){r.target.getAttribute("data-tooltip-id")===t&&o.push(r.target)}if("childList"===r.type&&(B&&[...r.removedNodes].some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,B))&&(re(!1),pe(!1),K(null),!0)})),e))try{const t=[...r.addedNodes].filter((e=>1===e.nodeType));o.push(...t.filter((t=>t.matches(e)))),o.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch(e){}})),o.length&&se((e=>[...e,...o]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{r.disconnect()}}),[t,u,B]);const Se=()=>{H?he(H):S?le.current&&he(le.current):T({place:d,offset:p,elementReference:B,tooltipReference:M.current,tooltipArrowReference:X.current,strategy:f,middlewares:y}).then((e=>{ue.current&&(Object.keys(e.tooltipStyles).length&&Z(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&Y(e.tooltipArrowStyles),F(e.place))}))};c((()=>{Se()}),[Q,B,j,C,d,p,f,H]),c((()=>{if(!(null==q?void 0:q.current))return()=>null;const e=new ResizeObserver((()=>{Se()}));return e.observe(q.current),()=>{e.disconnect()}}),[j,null==q?void 0:q.current]),c((()=>{var e;const t=document.querySelector(`[id='${a}']`),r=[...ae,t];B&&r.includes(B)||K(null!==(e=ae[0])&&void 0!==e?e:t)}),[a,ae,B]),c((()=>()=>{J.current&&clearTimeout(J.current),P.current&&clearTimeout(P.current)}),[]),c((()=>{let e=u;if(!e&&t&&(e=`[data-tooltip-id='${t}']`),e)try{const t=Array.from(document.querySelectorAll(e));se(t)}catch(e){se([])}}),[t,u]);const Ee=!A&&j&&Q&&Object.keys(V).length>0;return te?e.createElement(w,{id:t,role:"tooltip",className:s("react-tooltip",x.tooltip,x[n],o,`react-tooltip__place-${U}`,{[x.show]:Ee,[x.fixed]:"fixed"===f,[x.clickable]:L}),style:{...C,...V},ref:M},j,e.createElement(w,{className:s("react-tooltip-arrow",x.arrow,l,{[x.noArrow]:O}),style:G,ref:X})):null},L=({content:t})=>e.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),N=({id:t,anchorId:o,anchorSelect:l,content:n,html:a,render:s,className:u,classNameArrow:d,variant:p="dark",place:v="top",offset:m=10,wrapper:f="div",children:h=null,events:y=["hover"],openOnClick:w=!1,positionStrategy:_="absolute",middlewares:b,delayShow:S=0,delayHide:E=0,float:A=!1,hidden:k=!1,noArrow:T=!1,clickable:x=!1,closeOnEsc:N=!1,closeOnScroll:R=!1,closeOnResize:$=!1,style:C,position:H,isOpen:I,setIsOpen:W,afterShow:j,afterHide:q})=>{const[z,D]=r(n),[B,K]=r(a),[M,X]=r(v),[J,P]=r(p),[U,F]=r(m),[V,Z]=r(S),[G,Y]=r(E),[Q,ee]=r(A),[te,re]=r(k),[oe,le]=r(f),[ne,ie]=r(y),[ce,ae]=r(_),[se,ue]=r(null),{anchorRefs:de,activeAnchor:pe}=g(t),ve=e=>null==e?void 0:e.getAttributeNames().reduce(((t,r)=>{var o;if(r.startsWith("data-tooltip-")){t[r.replace(/^data-tooltip-/,"")]=null!==(o=null==e?void 0:e.getAttribute(r))&&void 0!==o?o:null}return t}),{}),me=e=>{const t={place:e=>{var t;X(null!==(t=e)&&void 0!==t?t:v)},content:e=>{D(null!=e?e:n)},html:e=>{K(null!=e?e:a)},variant:e=>{var t;P(null!==(t=e)&&void 0!==t?t:p)},offset:e=>{F(null===e?m:Number(e))},wrapper:e=>{var t;le(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");ie(null!=t?t:y)},"position-strategy":e=>{var t;ae(null!==(t=e)&&void 0!==t?t:_)},"delay-show":e=>{Z(null===e?S:Number(e))},"delay-hide":e=>{Y(null===e?E:Number(e))},float:e=>{ee(null===e?A:"true"===e)},hidden:e=>{re(null===e?k:"true"===e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,r])=>{var o;null===(o=t[e])||void 0===o||o.call(t,r)}))};c((()=>{D(n)}),[n]),c((()=>{K(a)}),[a]),c((()=>{X(v)}),[v]),c((()=>{P(p)}),[p]),c((()=>{F(m)}),[m]),c((()=>{Z(S)}),[S]),c((()=>{Y(E)}),[E]),c((()=>{ee(A)}),[A]),c((()=>{re(k)}),[k]),c((()=>{ae(_)}),[_]),c((()=>{var e;const r=new Set(de);let n=l;if(!n&&t&&(n=`[data-tooltip-id='${t}']`),n)try{document.querySelectorAll(n).forEach((e=>{r.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${n}" is not a valid CSS selector`)}const i=document.querySelector(`[id='${o}']`);if(i&&r.add({current:i}),!r.size)return()=>null;const c=null!==(e=null!=se?se:i)&&void 0!==e?e:pe.current,a=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const r=ve(c);me(r)}))})),s={attributes:!0,childList:!1,subtree:!1};if(c){const e=ve(c);me(e),a.observe(c,s)}return()=>{a.disconnect()}}),[de,pe,se,o,l]);let fe=h;const he=i(null);if(s){const t=s({content:null!=z?z:null,activeAnchor:se});fe=t?e.createElement("div",{ref:he,className:"react-tooltip-content-wrapper"},t):null}else z&&(fe=z);B&&(fe=e.createElement(L,{content:B}));const ye={id:t,anchorId:o,anchorSelect:l,className:u,classNameArrow:d,content:fe,contentWrapperRef:he,place:M,variant:J,offset:U,wrapper:oe,events:ne,openOnClick:w,positionStrategy:ce,middlewares:b,delayShow:V,delayHide:G,float:Q,hidden:te,noArrow:T,clickable:x,closeOnEsc:N,closeOnScroll:R,closeOnResize:$,style:C,position:H,isOpen:I,setIsOpen:W,afterShow:j,afterHide:q,activeAnchor:se,setActiveAnchor:e=>ue(e)};return e.createElement(O,{...ye})};export{N as Tooltip,b as TooltipProvider,S as TooltipWrapper};
8
- //# sourceMappingURL=react-tooltip.min.mjs.map
7
+ import e,{createContext as t,useState as r,useCallback as n,useMemo as o,useContext as l,useRef as c,useEffect as i,useLayoutEffect as s}from"react";import a from"classnames";import{arrow as u,computePosition as d,offset as p,flip as m,shift as v}from"@floating-ui/dom";const f="react-tooltip-core-styles",h="react-tooltip-base-styles";function y({css:e,id:t=h,type:r="base",ref:n}){if("core"===r&&process.env.REACT_TOOLTIP_DISABLE_CORE_STYLES)return;if("core"!==r&&process.env.REACT_TOOLTIP_DISABLE_BASE_STYLES)return;"core"===r&&(t=f),n||(n={});const{insertAt:o}=n;if(!e||"undefined"==typeof document||document.getElementById(t))return;const l=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.id=t,c.type="text/css","top"===o&&l.firstChild?l.insertBefore(c,l.firstChild):l.appendChild(c),c.styleSheet?c.styleSheet.cssText=e:c.appendChild(document.createTextNode(e))}function w({type:e="base",id:t=h}){"core"===e&&(t=f);const r=document.getElementById(t);null==r||r.remove()}const S=(e,t,r)=>{let n=null;return function(...o){const l=()=>{n=null,r||e.apply(this,o)};r&&!n&&(e.apply(this,o),n=setTimeout(l,t)),r||(n&&clearTimeout(n),n=setTimeout(l,t))}},E="DEFAULT_TOOLTIP_ID",_={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},g=t({getTooltipData:()=>_}),A=({children:t})=>{const[l,c]=r({[E]:new Set}),[i,s]=r({[E]:{current:null}}),a=(e,...t)=>{c((r=>{var n;const o=null!==(n=r[e])&&void 0!==n?n:new Set;return t.forEach((e=>o.add(e))),{...r,[e]:new Set(o)}}))},u=(e,...t)=>{c((r=>{const n=r[e];return n?(t.forEach((e=>n.delete(e))),{...r}):r}))},d=n(((e=E)=>{var t,r;return{anchorRefs:null!==(t=l[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=i[e])&&void 0!==r?r:{current:null},attach:(...t)=>a(e,...t),detach:(...t)=>u(e,...t),setActiveAnchor:t=>((e,t)=>{s((r=>{var n;return(null===(n=r[e])||void 0===n?void 0:n.current)===t.current?r:{...r,[e]:t}}))})(e,t)}}),[l,i,a,u]),p=o((()=>({getTooltipData:d})),[d]);return e.createElement(g.Provider,{value:p},t)};function b(e=E){return l(g).getTooltipData(e)}const T=({tooltipId:t,children:r,className:n,place:o,content:l,html:s,variant:u,offset:d,wrapper:p,events:m,positionStrategy:v,delayShow:f,delayHide:h})=>{const{attach:y,detach:w}=b(t),S=c(null);return i((()=>(y(S),()=>{w(S)})),[]),e.createElement("span",{ref:S,className:a("react-tooltip-wrapper",n),"data-tooltip-place":o,"data-tooltip-content":l,"data-tooltip-html":s,"data-tooltip-variant":u,"data-tooltip-offset":d,"data-tooltip-wrapper":p,"data-tooltip-events":m,"data-tooltip-position-strategy":v,"data-tooltip-delay-show":f,"data-tooltip-delay-hide":h},r)},O="undefined"!=typeof window?s:i,L=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const r=t.getPropertyValue(e);return"auto"===r||"scroll"===r}))},R=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(L(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},k=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:r=null,place:n="top",offset:o=10,strategy:l="absolute",middlewares:c=[p(Number(o)),m(),v({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const i=c;return r?(i.push(u({element:r,padding:5})),d(e,t,{placement:n,strategy:l,middleware:i}).then((({x:e,y:t,placement:r,middlewareData:n})=>{var o,l;const c={left:`${e}px`,top:`${t}px`},{x:i,y:s}=null!==(o=n.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:c,tooltipArrowStyles:{left:null!=i?`${i}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(l={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]])&&void 0!==l?l:"bottom"]:"-4px"},place:r}}))):d(e,t,{placement:"bottom",strategy:l,middleware:i}).then((({x:e,y:t,placement:r})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:r})))};var N="core-styles-module_tooltip__3vRRp",x="core-styles-module_fixed__pcSol",I="core-styles-module_arrow__cvMwQ",C="core-styles-module_noArrow__xock6",$="core-styles-module_clickable__ZuTTB",B="core-styles-module_show__Nt9eE",H={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 D=({id:t,className:n,classNameArrow:o,variant:l="dark",anchorId:s,anchorSelect:u,place:d="top",offset:p=10,events:m=["hover"],openOnClick:v=!1,positionStrategy:f="absolute",middlewares:h,wrapper:y,delayShow:w=0,delayHide:E=0,float:_=!1,hidden:g=!1,noArrow:A=!1,clickable:T=!1,closeOnEsc:L=!1,closeOnScroll:D=!1,closeOnResize:j=!1,style:q,position:z,afterShow:W,afterHide:M,content:P,contentWrapperRef:K,isOpen:X,setIsOpen:Y,activeAnchor:F,setActiveAnchor:V})=>{const Z=c(null),G=c(null),J=c(null),Q=c(null),[U,ee]=r(d),[te,re]=r({}),[ne,oe]=r({}),[le,ce]=r(!1),[ie,se]=r(!1),ae=c(!1),ue=c(null),{anchorRefs:de,setActiveAnchor:pe}=b(t),me=c(!1),[ve,fe]=r([]),he=c(!1),ye=v||m.includes("click");O((()=>(he.current=!0,()=>{he.current=!1})),[]),i((()=>{if(!le){const e=setTimeout((()=>{se(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[le]);const we=e=>{he.current&&(e&&se(!0),setTimeout((()=>{he.current&&(null==Y||Y(e),void 0===X&&ce(e))}),10))};i((()=>{if(void 0===X)return()=>null;X&&se(!0);const e=setTimeout((()=>{ce(X)}),10);return()=>{clearTimeout(e)}}),[X]),i((()=>{le!==ae.current&&(ae.current=le,le?null==W||W():null==M||M())}),[le]);const Se=(e=E)=>{Q.current&&clearTimeout(Q.current),Q.current=setTimeout((()=>{me.current||we(!1)}),e)},Ee=e=>{var t;if(!e)return;const r=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==r?void 0:r.isConnected))return V(null),void pe({current:null});w?(J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{we(!0)}),w)):we(!0),V(r),pe({current:r}),Q.current&&clearTimeout(Q.current)},_e=()=>{T?Se(E||100):E?Se():we(!1),J.current&&clearTimeout(J.current)},ge=({x:e,y:t})=>{k({place:d,offset:p,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:Z.current,tooltipArrowReference:G.current,strategy:f,middlewares:h}).then((e=>{Object.keys(e.tooltipStyles).length&&re(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&oe(e.tooltipArrowStyles),ee(e.place)}))},Ae=e=>{if(!e)return;const t=e,r={x:t.clientX,y:t.clientY};ge(r),ue.current=r},be=e=>{Ee(e),E&&Se()},Te=e=>{var t;[document.querySelector(`[id='${s}']`),...ve].some((t=>null==t?void 0:t.contains(e.target)))||(null===(t=Z.current)||void 0===t?void 0:t.contains(e.target))||(we(!1),J.current&&clearTimeout(J.current))},Oe=S(Ee,50,!0),Le=S(_e,50,!0);i((()=>{var e,t;const r=new Set(de);ve.forEach((e=>{r.add({current:e})}));const n=document.querySelector(`[id='${s}']`);n&&r.add({current:n});const o=()=>{we(!1)},l=R(F),c=R(Z.current);D&&(window.addEventListener("scroll",o),null==l||l.addEventListener("scroll",o),null==c||c.addEventListener("scroll",o)),j&&window.addEventListener("resize",o);const i=e=>{"Escape"===e.key&&we(!1)};L&&window.addEventListener("keydown",i);const a=[];ye?(window.addEventListener("click",Te),a.push({event:"click",listener:be})):(a.push({event:"mouseenter",listener:Oe},{event:"mouseleave",listener:Le},{event:"focus",listener:Oe},{event:"blur",listener:Le}),_&&a.push({event:"mousemove",listener:Ae}));const u=()=>{me.current=!0},d=()=>{me.current=!1,_e()};return T&&!ye&&(null===(e=Z.current)||void 0===e||e.addEventListener("mouseenter",u),null===(t=Z.current)||void 0===t||t.addEventListener("mouseleave",d)),a.forEach((({event:e,listener:t})=>{r.forEach((r=>{var n;null===(n=r.current)||void 0===n||n.addEventListener(e,t)}))})),()=>{var e,t;D&&(window.removeEventListener("scroll",o),null==l||l.removeEventListener("scroll",o),null==c||c.removeEventListener("scroll",o)),j&&window.removeEventListener("resize",o),ye&&window.removeEventListener("click",Te),L&&window.removeEventListener("keydown",i),T&&!ye&&(null===(e=Z.current)||void 0===e||e.removeEventListener("mouseenter",u),null===(t=Z.current)||void 0===t||t.removeEventListener("mouseleave",d)),a.forEach((({event:e,listener:t})=>{r.forEach((r=>{var n;null===(n=r.current)||void 0===n||n.removeEventListener(e,t)}))}))}}),[ie,de,ve,L,m]),i((()=>{let e=null!=u?u:"";!e&&t&&(e=`[data-tooltip-id='${t}']`);const r=new MutationObserver((r=>{const n=[];r.forEach((r=>{if("attributes"===r.type&&"data-tooltip-id"===r.attributeName){r.target.getAttribute("data-tooltip-id")===t&&n.push(r.target)}if("childList"===r.type&&(F&&[...r.removedNodes].some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,F))&&(se(!1),we(!1),V(null),J.current&&clearTimeout(J.current),Q.current&&clearTimeout(Q.current),!0)})),e))try{const t=[...r.addedNodes].filter((e=>1===e.nodeType));n.push(...t.filter((t=>t.matches(e)))),n.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch(e){}})),n.length&&fe((e=>[...e,...n]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{r.disconnect()}}),[t,u,F]);const Re=()=>{z?ge(z):_?ue.current&&ge(ue.current):k({place:d,offset:p,elementReference:F,tooltipReference:Z.current,tooltipArrowReference:G.current,strategy:f,middlewares:h}).then((e=>{he.current&&(Object.keys(e.tooltipStyles).length&&re(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&oe(e.tooltipArrowStyles),ee(e.place))}))};i((()=>{Re()}),[le,F,P,q,d,p,f,z]),i((()=>{if(!(null==K?void 0:K.current))return()=>null;const e=new ResizeObserver((()=>{Re()}));return e.observe(K.current),()=>{e.disconnect()}}),[P,null==K?void 0:K.current]),i((()=>{var e;const t=document.querySelector(`[id='${s}']`),r=[...ve,t];F&&r.includes(F)||V(null!==(e=ve[0])&&void 0!==e?e:t)}),[s,ve,F]),i((()=>()=>{J.current&&clearTimeout(J.current),Q.current&&clearTimeout(Q.current)}),[]),i((()=>{let e=u;if(!e&&t&&(e=`[data-tooltip-id='${t}']`),e)try{const t=Array.from(document.querySelectorAll(e));fe(t)}catch(e){fe([])}}),[t,u]);const ke=!g&&P&&le&&Object.keys(te).length>0;return ie?e.createElement(y,{id:t,role:"tooltip",className:a("react-tooltip",N,H[l],n,`react-tooltip__place-${U}`,{[B]:ke,[x]:"fixed"===f,[$]:T}),style:{...q,...te},ref:Z},P,e.createElement(y,{className:a("react-tooltip-arrow",I,H.arrow,o,{[C]:A}),style:ne,ref:G})):null},j=({content:t})=>e.createElement("span",{dangerouslySetInnerHTML:{__html:t}}),q=({id:t,anchorId:n,anchorSelect:o,content:l,html:s,render:a,className:u,classNameArrow:d,variant:p="dark",place:m="top",offset:v=10,wrapper:f="div",children:h=null,events:y=["hover"],openOnClick:w=!1,positionStrategy:S="absolute",middlewares:E,delayShow:_=0,delayHide:g=0,float:A=!1,hidden:T=!1,noArrow:O=!1,clickable:L=!1,closeOnEsc:R=!1,closeOnScroll:k=!1,closeOnResize:N=!1,style:x,position:I,isOpen:C,setIsOpen:$,afterShow:B,afterHide:H})=>{const[q,z]=r(l),[W,M]=r(s),[P,K]=r(m),[X,Y]=r(p),[F,V]=r(v),[Z,G]=r(_),[J,Q]=r(g),[U,ee]=r(A),[te,re]=r(T),[ne,oe]=r(f),[le,ce]=r(y),[ie,se]=r(S),[ae,ue]=r(null),{anchorRefs:de,activeAnchor:pe}=b(t),me=e=>null==e?void 0:e.getAttributeNames().reduce(((t,r)=>{var n;if(r.startsWith("data-tooltip-")){t[r.replace(/^data-tooltip-/,"")]=null!==(n=null==e?void 0:e.getAttribute(r))&&void 0!==n?n:null}return t}),{}),ve=e=>{const t={place:e=>{var t;K(null!==(t=e)&&void 0!==t?t:m)},content:e=>{z(null!=e?e:l)},html:e=>{M(null!=e?e:s)},variant:e=>{var t;Y(null!==(t=e)&&void 0!==t?t:p)},offset:e=>{V(null===e?v:Number(e))},wrapper:e=>{var t;oe(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");ce(null!=t?t:y)},"position-strategy":e=>{var t;se(null!==(t=e)&&void 0!==t?t:S)},"delay-show":e=>{G(null===e?_:Number(e))},"delay-hide":e=>{Q(null===e?g:Number(e))},float:e=>{ee(null===e?A:"true"===e)},hidden:e=>{re(null===e?T:"true"===e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,r])=>{var n;null===(n=t[e])||void 0===n||n.call(t,r)}))};i((()=>{z(l)}),[l]),i((()=>{M(s)}),[s]),i((()=>{K(m)}),[m]),i((()=>{Y(p)}),[p]),i((()=>{V(v)}),[v]),i((()=>{G(_)}),[_]),i((()=>{Q(g)}),[g]),i((()=>{ee(A)}),[A]),i((()=>{re(T)}),[T]),i((()=>{se(S)}),[S]),i((()=>{var e;const r=new Set(de);let l=o;if(!l&&t&&(l=`[data-tooltip-id='${t}']`),l)try{document.querySelectorAll(l).forEach((e=>{r.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`)}const c=document.querySelector(`[id='${n}']`);if(c&&r.add({current:c}),!r.size)return()=>null;const i=null!==(e=null!=ae?ae:c)&&void 0!==e?e:pe.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!i||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const r=me(i);ve(r)}))})),a={attributes:!0,childList:!1,subtree:!1};if(i){const e=me(i);ve(e),s.observe(i,a)}return()=>{s.disconnect()}}),[de,pe,ae,n,o]);let fe=h;const he=c(null);if(a){const t=a({content:null!=q?q:null,activeAnchor:ae});fe=t?e.createElement("div",{ref:he,className:"react-tooltip-content-wrapper"},t):null}else q&&(fe=q);W&&(fe=e.createElement(j,{content:W}));const ye={id:t,anchorId:n,anchorSelect:o,className:u,classNameArrow:d,content:fe,contentWrapperRef:he,place:P,variant:X,offset:F,wrapper:ne,events:le,openOnClick:w,positionStrategy:ie,middlewares:E,delayShow:Z,delayHide:J,float:U,hidden:te,noArrow:O,clickable:L,closeOnEsc:R,closeOnScroll:k,closeOnResize:N,style:x,position:I,isOpen:C,setIsOpen:$,afterShow:B,afterHide:H,activeAnchor:ae,setActiveAnchor:e=>ue(e)};return e.createElement(D,{...ye})};y({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}.core-styles-module_tooltip__3vRRp{visibility:hidden;width:max-content;position:absolute;top:0;left:0;padding:8px 16px;border-radius:3px;font-size:90%;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.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{visibility:visible;opacity:var(--rt-opacity)}`,type:"core"}),y({css:`
8
+ .styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.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)}`});export{q as Tooltip,A as TooltipProvider,T as TooltipWrapper,w as removeStyle};