react-tooltip
Advanced tools
Comparing version 5.26.4 to 6.0.0-beta.1179.rc.0
@@ -93,4 +93,6 @@ { | ||
"no-shadow": "off", | ||
"@typescript-eslint/no-shadow": "error" | ||
"@typescript-eslint/no-shadow": "error", | ||
"react-hooks/rules-of-hooks": "error", | ||
"react-hooks/exhaustive-deps": "warn" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import React$1, { ElementType, ReactNode, CSSProperties, PropsWithChildren } from 'react'; | ||
import React$1, { ElementType, ReactNode, CSSProperties } from 'react'; | ||
@@ -21,6 +21,2 @@ type PlacesType = | ||
type ChildrenType = Element | ElementType | ReactNode | ||
type EventsType = 'hover' | 'click' | ||
type PositionStrategy = 'absolute' | 'fixed' | ||
@@ -31,7 +27,5 @@ | ||
| 'content' | ||
| 'html' | ||
| 'variant' | ||
| 'offset' | ||
| 'wrapper' | ||
| 'events' | ||
| 'position-strategy' | ||
@@ -59,3 +53,3 @@ | 'delay-show' | ||
place?: PlacesType | ||
content?: ChildrenType | ||
content?: ReactNode | ||
/** | ||
@@ -116,7 +110,3 @@ * @description Delay (in ms) before opening the tooltip. | ||
content?: string | ||
/** | ||
* @deprecated Use `children` or `render` instead | ||
*/ | ||
html?: string | ||
render?: (render: { content: string | null; activeAnchor: HTMLElement | null }) => ChildrenType | ||
render?: (render: { content: string | null; activeAnchor: HTMLElement | null }) => ReactNode | ||
place?: PlacesType | ||
@@ -126,14 +116,5 @@ offset?: number | ||
variant?: VariantType | ||
/** | ||
* @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead. | ||
* See https://react-tooltip.com/docs/getting-started | ||
*/ | ||
anchorId?: string | ||
anchorSelect?: string | ||
wrapper?: WrapperType | ||
children?: ChildrenType | ||
/** | ||
* @deprecated Use `openOnClick` or `openEvents`/`closeEvents` instead. | ||
*/ | ||
events?: EventsType[] | ||
children?: ReactNode | ||
openOnClick?: boolean | ||
@@ -149,14 +130,2 @@ positionStrategy?: PositionStrategy | ||
/** | ||
* @deprecated Use `globalCloseEvents={{ escape: true }}` instead. | ||
*/ | ||
closeOnEsc?: boolean | ||
/** | ||
* @deprecated Use `globalCloseEvents={{ scroll: true }}` instead. | ||
*/ | ||
closeOnScroll?: boolean | ||
/** | ||
* @deprecated Use `globalCloseEvents={{ resize: true }}` instead. | ||
*/ | ||
closeOnResize?: boolean | ||
/** | ||
* @description The events to be listened on anchor elements to open the tooltip. | ||
@@ -207,6 +176,2 @@ */ | ||
'data-tooltip-wrapper'?: WrapperType | ||
/** | ||
* @deprecated Use `openOnClick` tooltip prop instead. | ||
*/ | ||
'data-tooltip-events'?: EventsType[] | ||
'data-tooltip-position-strategy'?: PositionStrategy | ||
@@ -221,46 +186,4 @@ 'data-tooltip-delay-show'?: number | ||
/** | ||
* @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead. | ||
* See https://react-tooltip.com/docs/getting-started | ||
*/ | ||
interface ITooltipWrapper { | ||
tooltipId?: string | ||
children: ReactNode | ||
className?: string | ||
place?: ITooltipController['place'] | ||
content?: ITooltipController['content'] | ||
html?: ITooltipController['html'] | ||
variant?: ITooltipController['variant'] | ||
offset?: ITooltipController['offset'] | ||
wrapper?: ITooltipController['wrapper'] | ||
events?: ITooltipController['events'] | ||
positionStrategy?: ITooltipController['positionStrategy'] | ||
delayShow?: ITooltipController['delayShow'] | ||
delayHide?: ITooltipController['delayHide'] | ||
} | ||
declare const TooltipController: React$1.ForwardRefExoticComponent<ITooltipController & React$1.RefAttributes<TooltipRefProps>>; | ||
/** | ||
* @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead. | ||
* See https://react-tooltip.com/docs/getting-started | ||
*/ | ||
declare const TooltipProvider: React$1.FC<PropsWithChildren<void>>; | ||
/** | ||
* @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead. | ||
* See https://react-tooltip.com/docs/getting-started | ||
*/ | ||
declare const TooltipWrapper: ({ tooltipId, children, className, place, content, html, variant, offset, wrapper, events, positionStrategy, delayShow, delayHide, }: ITooltipWrapper) => React$1.JSX.Element; | ||
/** | ||
* @deprecated Use the `disableStyleInjection` tooltip prop instead. | ||
* See https://react-tooltip.com/docs/examples/styling#disabling-reacttooltip-css | ||
*/ | ||
declare function removeStyle({ type, id, }?: { | ||
type?: 'core' | 'base'; | ||
id?: string; | ||
}): void; | ||
export { ChildrenType, DataAttribute, EventsType, IPosition, ITooltipController as ITooltip, ITooltipWrapper, Middleware, PlacesType, PositionStrategy, TooltipController as Tooltip, TooltipProvider, TooltipRefProps, TooltipWrapper, VariantType, WrapperType, removeStyle }; | ||
export { type DataAttribute, type IPosition, type ITooltipController as ITooltip, type Middleware, type PlacesType, type PositionStrategy, TooltipController as Tooltip, type TooltipRefProps, type VariantType, type WrapperType }; |
@@ -7,3 +7,4 @@ /* | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/dom"),require("classnames")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/dom","classnames"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.FloatingUIDOM,e.classNames)}(this,(function(e,t,o,r){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=l(t),c=l(r);const s="react-tooltip-core-styles",i="react-tooltip-base-styles",a={core:!1,base:!1};function u({css:e,id:t=i,type:o="base",ref:r}){var l,n;if(!e||"undefined"==typeof document||a[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=s),r||(r={});const{insertAt:c}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const u=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.id=t,d.type="text/css","top"===c&&u.firstChild?u.insertBefore(d,u.firstChild):u.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e)),a[o]=!0}const d=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:r=null,place:l="top",offset:n=10,strategy:c="absolute",middlewares:s=[o.offset(Number(n)),o.flip({fallbackAxisSideDirection:"start"}),o.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:l};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:l};const a=s;return r?(a.push(o.arrow({element:r,padding:5})),o.computePosition(e,t,{placement:l,strategy:c,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:r})=>{var l,n;const c={left:`${e}px`,top:`${t}px`,border:i},{x:s,y:a}=null!==(l=r.arrow)&&void 0!==l?l:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):o.computePosition(e,t,{placement:"bottom",strategy:c,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},p=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),f=(e,t,o)=>{let r=null;const l=function(...l){const n=()=>{r=null,o||e.apply(this,l)};o&&!r&&(e.apply(this,l),r=setTimeout(n,t)),o||(r&&clearTimeout(r),r=setTimeout(n,t))};return l.cancel=()=>{r&&(clearTimeout(r),r=null)},l},v=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,m=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>m(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!v(e)||!v(t))return e===t;const o=Object.keys(e),r=Object.keys(t);return o.length===r.length&&o.every((o=>m(e[o],t[o])))},y=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},h=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(y(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},w="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,S="DEFAULT_TOOLTIP_ID",b={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},E={getTooltipData:()=>b},g=t.createContext(E);function A(e=S){return t.useContext(g).getTooltipData(e)}var _={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},T={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const O=({forwardRef:e,id:r,className:l,classNameArrow:s,variant:i="dark",anchorId:a,anchorSelect:u,place:p="top",offset:v=10,events:y=["hover"],openOnClick:S=!1,positionStrategy:b="absolute",middlewares:E,wrapper:g,delayShow:O=0,delayHide:R=0,float:k=!1,hidden:C=!1,noArrow:L=!1,clickable:x=!1,closeOnEsc:N=!1,closeOnScroll:$=!1,closeOnResize:I=!1,openEvents:j,closeEvents:B,globalCloseEvents:D,imperativeModeOnly:q,style:z,position:M,afterShow:H,afterHide:P,content:W,contentWrapperRef:F,isOpen:U,defaultIsOpen:V=!1,setIsOpen:K,activeAnchor:X,setActiveAnchor:Y,border:G,opacity:Z,arrowColor:J,role:Q="tooltip"})=>{var ee;const te=t.useRef(null),oe=t.useRef(null),re=t.useRef(null),le=t.useRef(null),ne=t.useRef(null),[ce,se]=t.useState({tooltipStyles:{},tooltipArrowStyles:{},place:p}),[ie,ae]=t.useState(!1),[ue,de]=t.useState(!1),[pe,fe]=t.useState(null),ve=t.useRef(!1),me=t.useRef(null),{anchorRefs:ye,setActiveAnchor:he}=A(r),we=t.useRef(!1),[Se,be]=t.useState([]),Ee=t.useRef(!1),ge=S||y.includes("click"),Ae=ge||(null==j?void 0:j.click)||(null==j?void 0:j.dblclick)||(null==j?void 0:j.mousedown),_e=j?{...j}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!j&&ge&&Object.assign(_e,{mouseenter:!1,focus:!1,click:!0});const Te=B?{...B}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!B&&ge&&Object.assign(Te,{mouseleave:!1,blur:!1});const Oe=D?{...D}:{escape:N||!1,scroll:$||!1,resize:I||!1,clickOutsideAnchor:Ae||!1};q&&(Object.assign(_e,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Te,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Oe,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),w((()=>(Ee.current=!0,()=>{Ee.current=!1})),[]);const Re=e=>{Ee.current&&(e&&de(!0),setTimeout((()=>{Ee.current&&(null==K||K(e),void 0===U&&ae(e))}),10))};t.useEffect((()=>{if(void 0===U)return()=>null;U&&de(!0);const e=setTimeout((()=>{ae(U)}),10);return()=>{clearTimeout(e)}}),[U]),t.useEffect((()=>{if(ie!==ve.current)if(ne.current&&clearTimeout(ne.current),ve.current=ie,ie)null==H||H();else{const e=(e=>{const t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,o,r]=t;return Number(o)*("ms"===r?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));ne.current=setTimeout((()=>{de(!1),fe(null),null==P||P()}),e+25)}}),[ie]);const ke=e=>{se((t=>m(t,e)?t:e))},Ce=(e=O)=>{re.current&&clearTimeout(re.current),ue?Re(!0):re.current=setTimeout((()=>{Re(!0)}),e)},Le=(e=R)=>{le.current&&clearTimeout(le.current),le.current=setTimeout((()=>{we.current||Re(!1)}),e)},xe=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return Y(null),void he({current:null});O?Ce():Re(!0),Y(o),he({current:o}),le.current&&clearTimeout(le.current)},Ne=()=>{x?Le(R||100):R?Le():Re(!1),re.current&&clearTimeout(re.current)},$e=({x:e,y:t})=>{var o;const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};d({place:null!==(o=null==pe?void 0:pe.place)&&void 0!==o?o:p,offset:v,elementReference:r,tooltipReference:te.current,tooltipArrowReference:oe.current,strategy:b,middlewares:E,border:G}).then((e=>{ke(e)}))},Ie=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};$e(o),me.current=o},je=e=>{var t;if(!ie)return;const o=e.target;if(!o.isConnected)return;if(null===(t=te.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${a}']`),...Se].some((e=>null==e?void 0:e.contains(o)))||(Re(!1),re.current&&clearTimeout(re.current))},Be=f(xe,50,!0),De=f(Ne,50,!0),qe=e=>{De.cancel(),Be(e)},ze=()=>{Be.cancel(),De()},Me=t.useCallback((()=>{var e,t;const o=null!==(e=null==pe?void 0:pe.position)&&void 0!==e?e:M;o?$e(o):k?me.current&&$e(me.current):(null==X?void 0:X.isConnected)&&d({place:null!==(t=null==pe?void 0:pe.place)&&void 0!==t?t:p,offset:v,elementReference:X,tooltipReference:te.current,tooltipArrowReference:oe.current,strategy:b,middlewares:E,border:G}).then((e=>{Ee.current&&ke(e)}))}),[ie,X,W,z,p,null==pe?void 0:pe.place,v,b,M,null==pe?void 0:pe.position,k]);t.useEffect((()=>{var e,t;const r=new Set(ye);Se.forEach((e=>{r.add({current:e})}));const l=document.querySelector(`[id='${a}']`);l&&r.add({current:l});const n=()=>{Re(!1)},c=h(X),s=h(te.current);Oe.scroll&&(window.addEventListener("scroll",n),null==c||c.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n));let i=null;Oe.resize?window.addEventListener("resize",n):X&&te.current&&(i=o.autoUpdate(X,te.current,Me,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const u=e=>{"Escape"===e.key&&Re(!1)};Oe.escape&&window.addEventListener("keydown",u),Oe.clickOutsideAnchor&&window.addEventListener("click",je);const d=[],p=e=>{ie&&(null==e?void 0:e.target)===X||xe(e)},f=e=>{ie&&(null==e?void 0:e.target)===X&&Ne()},v=["mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(_e).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:qe}):m.includes(e)&&d.push({event:e,listener:p}))})),Object.entries(Te).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:ze}):m.includes(e)&&d.push({event:e,listener:f}))})),k&&d.push({event:"pointermove",listener:Ie});const y=()=>{we.current=!0},w=()=>{we.current=!1,Ne()};return x&&!Ae&&(null===(e=te.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=te.current)||void 0===t||t.addEventListener("mouseleave",w)),d.forEach((({event:e,listener:t})=>{r.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;Oe.scroll&&(window.removeEventListener("scroll",n),null==c||c.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),Oe.resize?window.removeEventListener("resize",n):null==i||i(),Oe.clickOutsideAnchor&&window.removeEventListener("click",je),Oe.escape&&window.removeEventListener("keydown",u),x&&!Ae&&(null===(e=te.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=te.current)||void 0===t||t.removeEventListener("mouseleave",w)),d.forEach((({event:e,listener:t})=>{r.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[X,Me,ue,ye,Se,j,B,D,ge,O,R]),t.useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==pe?void 0:pe.anchorSelect)&&void 0!==e?e:u)&&void 0!==t?t:"";!o&&r&&(o=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`);const l=new MutationObserver((e=>{const t=[],l=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===r?t.push(e.target):e.oldValue===r&&l.push(e.target)}if("childList"===e.type){if(X){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{l.push(...t.filter((e=>e.matches(o)))),l.push(...t.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,X))&&(de(!1),Re(!1),Y(null),re.current&&clearTimeout(re.current),le.current&&clearTimeout(le.current),!0)}))}if(o)try{const r=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...r.filter((e=>e.matches(o)))),t.push(...r.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}}})),(t.length||l.length)&&be((e=>[...e.filter((e=>!l.includes(e))),...t]))}));return l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{l.disconnect()}}),[r,u,null==pe?void 0:pe.anchorSelect,X]),t.useEffect((()=>{Me()}),[Me]),t.useEffect((()=>{if(!(null==F?void 0:F.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Me()))}));return e.observe(F.current),()=>{e.disconnect()}}),[W,null==F?void 0:F.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${a}']`),o=[...Se,t];X&&o.includes(X)||Y(null!==(e=Se[0])&&void 0!==e?e:t)}),[a,Se,X]),t.useEffect((()=>(V&&Re(!0),()=>{re.current&&clearTimeout(re.current),le.current&&clearTimeout(le.current)})),[]),t.useEffect((()=>{var e;let t=null!==(e=null==pe?void 0:pe.anchorSelect)&&void 0!==e?e:u;if(!t&&r&&(t=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));be(e)}catch(e){be([])}}),[r,u,null==pe?void 0:pe.anchorSelect]),t.useEffect((()=>{re.current&&(clearTimeout(re.current),Ce(O))}),[O]);const He=null!==(ee=null==pe?void 0:pe.content)&&void 0!==ee?ee:W,Pe=ie&&Object.keys(ce.tooltipStyles).length>0;return t.useImperativeHandle(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}fe(null!=e?e:null),(null==e?void 0:e.delay)?Ce(e.delay):Re(!0)},close:e=>{(null==e?void 0:e.delay)?Le(e.delay):Re(!1)},activeAnchor:X,place:ce.place,isOpen:Boolean(ue&&!C&&He&&Pe)}))),ue&&!C&&He?n.default.createElement(g,{id:r,role:Q,className:c.default("react-tooltip",_.tooltip,T.tooltip,T[i],l,`react-tooltip__place-${ce.place}`,_[Pe?"show":"closing"],Pe?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&_.fixed,x&&_.clickable),onTransitionEnd:e=>{ne.current&&clearTimeout(ne.current),ie||"opacity"!==e.propertyName||(de(!1),fe(null),null==P||P())},style:{...z,...ce.tooltipStyles,opacity:void 0!==Z&&Pe?Z:void 0},ref:te},He,n.default.createElement(g,{className:c.default("react-tooltip-arrow",_.arrow,T.arrow,s,L&&_.noArrow),style:{...ce.tooltipArrowStyles,background:J?`linear-gradient(to right bottom, transparent 50%, ${J} 50%)`:void 0},ref:oe})):null},R=({content:e})=>n.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),k=n.default.forwardRef((({id:e,anchorId:o,anchorSelect:r,content:l,html:s,render:i,className:a,classNameArrow:u,variant:d="dark",place:f="top",offset:v=10,wrapper:m="div",children:y=null,events:h=["hover"],openOnClick:w=!1,positionStrategy:S="absolute",middlewares:b,delayShow:E=0,delayHide:g=0,float:_=!1,hidden:T=!1,noArrow:k=!1,clickable:C=!1,closeOnEsc:L=!1,closeOnScroll:x=!1,closeOnResize:N=!1,openEvents:$,closeEvents:I,globalCloseEvents:j,imperativeModeOnly:B=!1,style:D,position:q,isOpen:z,defaultIsOpen:M=!1,disableStyleInjection:H=!1,border:P,opacity:W,arrowColor:F,setIsOpen:U,afterShow:V,afterHide:K,role:X="tooltip"},Y)=>{const[G,Z]=t.useState(l),[J,Q]=t.useState(s),[ee,te]=t.useState(f),[oe,re]=t.useState(d),[le,ne]=t.useState(v),[ce,se]=t.useState(E),[ie,ae]=t.useState(g),[ue,de]=t.useState(_),[pe,fe]=t.useState(T),[ve,me]=t.useState(m),[ye,he]=t.useState(h),[we,Se]=t.useState(S),[be,Ee]=t.useState(null),[ge,Ae]=t.useState(null),_e=t.useRef(H),{anchorRefs:Te,activeAnchor:Oe}=A(e),Re=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var r;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(o))&&void 0!==r?r:null}return t}),{}),ke=e=>{const t={place:e=>{var t;te(null!==(t=e)&&void 0!==t?t:f)},content:e=>{Z(null!=e?e:l)},html:e=>{Q(null!=e?e:s)},variant:e=>{var t;re(null!==(t=e)&&void 0!==t?t:d)},offset:e=>{ne(null===e?v:Number(e))},wrapper:e=>{var t;me(null!==(t=e)&&void 0!==t?t:m)},events:e=>{const t=null==e?void 0:e.split(" ");he(null!=t?t:h)},"position-strategy":e=>{var t;Se(null!==(t=e)&&void 0!==t?t:S)},"delay-show":e=>{se(null===e?E:Number(e))},"delay-hide":e=>{ae(null===e?g:Number(e))},float:e=>{de(null===e?_:"true"===e)},hidden:e=>{fe(null===e?T:"true"===e)},"class-name":e=>{Ee(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var r;null===(r=t[e])||void 0===r||r.call(t,o)}))};t.useEffect((()=>{Z(l)}),[l]),t.useEffect((()=>{Q(s)}),[s]),t.useEffect((()=>{te(f)}),[f]),t.useEffect((()=>{re(d)}),[d]),t.useEffect((()=>{ne(v)}),[v]),t.useEffect((()=>{se(E)}),[E]),t.useEffect((()=>{ae(g)}),[g]),t.useEffect((()=>{de(_)}),[_]),t.useEffect((()=>{fe(T)}),[T]),t.useEffect((()=>{Se(S)}),[S]),t.useEffect((()=>{_e.current!==H&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[H]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===H,disableBase:H}}))}),[]),t.useEffect((()=>{var t;const l=new Set(Te);let n=r;if(!n&&e&&(n=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),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 c=document.querySelector(`[id='${o}']`);if(c&&l.add({current:c}),!l.size)return()=>null;const s=null!==(t=null!=ge?ge:c)&&void 0!==t?t:Oe.current,i=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 o=Re(s);ke(o)}))})),a={attributes:!0,childList:!1,subtree:!1};if(s){const e=Re(s);ke(e),i.observe(s,a)}return()=>{i.disconnect()}}),[Te,Oe,ge,o,r]),t.useEffect((()=>{(null==D?void 0:D.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),P&&!p("border",`${P}`)&&console.warn(`[react-tooltip] "${P}" is not a valid \`border\`.`),(null==D?void 0:D.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),W&&!p("opacity",`${W}`)&&console.warn(`[react-tooltip] "${W}" is not a valid \`opacity\`.`)}),[]);let Ce=y;const Le=t.useRef(null);if(i){const e=i({content:(null==ge?void 0:ge.getAttribute("data-tooltip-content"))||G||null,activeAnchor:ge});Ce=e?n.default.createElement("div",{ref:Le,className:"react-tooltip-content-wrapper"},e):null}else G&&(Ce=G);J&&(Ce=n.default.createElement(R,{content:J}));const xe={forwardRef:Y,id:e,anchorId:o,anchorSelect:r,className:c.default(a,be),classNameArrow:u,content:Ce,contentWrapperRef:Le,place:ee,variant:oe,offset:le,wrapper:ve,events:ye,openOnClick:w,positionStrategy:we,middlewares:b,delayShow:ce,delayHide:ie,float:ue,hidden:pe,noArrow:k,clickable:C,closeOnEsc:L,closeOnScroll:x,closeOnResize:N,openEvents:$,closeEvents:I,globalCloseEvents:j,imperativeModeOnly:B,style:D,position:q,isOpen:z,defaultIsOpen:M,border:P,opacity:W,arrowColor:F,setIsOpen:U,afterShow:V,afterHide:K,activeAnchor:ge,setActiveAnchor:e=>Ae(e),role:X};return n.default.createElement(O,{...xe})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||u({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||u({css:` | ||
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})})),e.Tooltip=k,e.TooltipProvider=({children:e})=>{const[o,r]=t.useState({[S]:new Set}),[l,c]=t.useState({[S]:{current:null}}),s=(e,...t)=>{r((o=>{var r;const l=null!==(r=o[e])&&void 0!==r?r:new Set;return t.forEach((e=>l.add(e))),{...o,[e]:new Set(l)}}))},i=(e,...t)=>{r((o=>{const r=o[e];return r?(t.forEach((e=>r.delete(e))),{...o}):o}))},a=t.useCallback(((e=S)=>{var t,r;return{anchorRefs:null!==(t=o[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=l[e])&&void 0!==r?r:{current:null},attach:(...t)=>s(e,...t),detach:(...t)=>i(e,...t),setActiveAnchor:t=>((e,t)=>{c((o=>{var r;return(null===(r=o[e])||void 0===r?void 0:r.current)===t.current?o:{...o,[e]:t}}))})(e,t)}}),[o,l,s,i]),u=t.useMemo((()=>({getTooltipData:a})),[a]);return n.default.createElement(g.Provider,{value:u},e)},e.TooltipWrapper=({tooltipId:e,children:o,className:r,place:l,content:s,html:i,variant:a,offset:u,wrapper:d,events:p,positionStrategy:f,delayShow:v,delayHide:m})=>{const{attach:y,detach:h}=A(e),w=t.useRef(null);return t.useEffect((()=>(y(w),()=>{h(w)})),[]),n.default.createElement("span",{ref:w,className:c.default("react-tooltip-wrapper",r),"data-tooltip-place":l,"data-tooltip-content":s,"data-tooltip-html":i,"data-tooltip-variant":a,"data-tooltip-offset":u,"data-tooltip-wrapper":d,"data-tooltip-events":p,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":v,"data-tooltip-delay-hide":m},o)},e.removeStyle=function({type:e="base",id:t=i}={}){if(!a[e])return;"core"===e&&(t=s);const o=document.getElementById(t);"style"===(null==o?void 0:o.tagName)?null==o||o.remove():console.warn(`[react-tooltip] Failed to remove 'style' element with id '${t}'. Call \`injectStyle()\` first`),a[e]=!1},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/dom"),require("clsx")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/dom","clsx"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.FloatingUIDOM,e.clsx)}(this,(function(e,t,o,l){"use strict";const r={core:!1,base:!1};function n({css:e,id:t="react-tooltip-base-styles",type:o="base",ref:l}){var n,s;if(!e||"undefined"==typeof document||r[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(s=null===process||void 0===process?void 0:process.env)||void 0===s?void 0:s.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t="react-tooltip-core-styles"),l||(l={});const{insertAt:c}=l;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.id=t,a.type="text/css","top"===c&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e)),r[o]=!0}const s=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:l=null,place:r="top",offset:n=10,strategy:s="absolute",middlewares:c=[o.offset(Number(n)),o.flip({fallbackAxisSideDirection:"start"}),o.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=c;return l?(a.push(o.arrow({element:l,padding:5})),o.computePosition(e,t,{placement:r,strategy:s,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const s={left:`${e}px`,top:`${t}px`,border:i},{x:c,y:a}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:s,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):o.computePosition(e,t,{placement:"bottom",strategy:s,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))},c=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),i=(e,t,o)=>{let l=null;const r=function(...r){const n=()=>{l=null,o||e.apply(this,r)};o&&!l&&(e.apply(this,r),l=setTimeout(n,t)),o||(l&&clearTimeout(l),l=setTimeout(n,t))};return r.cancel=()=>{l&&(clearTimeout(l),l=null)},r},a=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,u=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,o)=>u(e,t[o])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!a(e)||!a(t))return e===t;const o=Object.keys(e),l=Object.keys(t);return o.length===l.length&&o.every((o=>u(e[o],t[o])))},d=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},p=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(d(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},f="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var v={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},m={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const y=({forwardRef:e,id:r,className:n,classNameArrow:c,variant:a="dark",anchorSelect:d,place:y="top",offset:w=10,openOnClick:h=!1,positionStrategy:b="absolute",middlewares:E,wrapper:S,delayShow:g=0,delayHide:_=0,float:A=!1,hidden:k=!1,noArrow:T=!1,clickable:O=!1,openEvents:C,closeEvents:R,globalCloseEvents:x,imperativeModeOnly:L,style:N,position:$,afterShow:j,afterHide:I,content:B,contentWrapperRef:z,isOpen:D,defaultIsOpen:H=!1,setIsOpen:q,activeAnchor:M,setActiveAnchor:W,border:P,opacity:V,arrowColor:U,role:F="tooltip"})=>{var K;const X=t.useRef(null),Y=t.useRef(null),G=t.useRef(null),Z=t.useRef(null),J=t.useRef(null),[Q,ee]=t.useState({tooltipStyles:{},tooltipArrowStyles:{},place:y}),[te,oe]=t.useState(!1),[le,re]=t.useState(!1),[ne,se]=t.useState(null),ce=t.useRef(!1),ie=t.useRef(null),ae=t.useRef(!1),[ue,de]=t.useState([]),pe=t.useRef(!1);f((()=>(pe.current=!0,()=>{pe.current=!1})),[]);const fe=t.useCallback((e=>{pe.current&&(e&&re(!0),setTimeout((()=>{pe.current&&(null==q||q(e),void 0===D&&oe(e))}),10))}),[D,q]);t.useEffect((()=>{if(void 0===D)return()=>null;D&&re(!0);const e=setTimeout((()=>{oe(D)}),10);return()=>{clearTimeout(e)}}),[D]),t.useEffect((()=>{if(te!==ce.current)if(J.current&&clearTimeout(J.current),ce.current=te,te)null==j||j();else{const e=(e=>{const t=e.match(/^([\d.]+)(m?s)$/);if(!t)return 0;const[,o,l]=t;return Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));J.current=setTimeout((()=>{re(!1),se(null),null==I||I()}),e+25)}}),[I,j,te]);const ve=e=>{ee((t=>u(t,e)?t:e))},me=t.useCallback(((e=g)=>{G.current&&clearTimeout(G.current),le?fe(!0):G.current=setTimeout((()=>{fe(!0)}),e)}),[g,fe,le]),ye=t.useCallback(((e=_)=>{Z.current&&clearTimeout(Z.current),Z.current=setTimeout((()=>{ae.current||fe(!1)}),e)}),[_,fe]),we=t.useCallback((({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};s({place:null!==(o=null==ne?void 0:ne.place)&&void 0!==o?o:y,offset:w,elementReference:l,tooltipReference:X.current,tooltipArrowReference:Y.current,strategy:b,middlewares:E,border:P}).then((e=>{ve(e)}))}),[null==ne?void 0:ne.place,y,w,b,E,P]),he=t.useCallback((()=>{var e,t;const o=null!==(e=null==ne?void 0:ne.position)&&void 0!==e?e:$;o?we(o):A?ie.current&&we(ie.current):(null==M?void 0:M.isConnected)&&s({place:null!==(t=null==ne?void 0:ne.place)&&void 0!==t?t:y,offset:w,elementReference:M,tooltipReference:X.current,tooltipArrowReference:Y.current,strategy:b,middlewares:E,border:P}).then((e=>{pe.current&&ve(e)}))}),[null==ne?void 0:ne.position,null==ne?void 0:ne.place,$,A,M,y,w,b,E,P,we]);t.useEffect((()=>{const e=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};we(o),ie.current=o},t=e=>{var t;if(!te)return;const o=e.target;o.isConnected&&((null===(t=X.current)||void 0===t?void 0:t.contains(o))||ue.some((e=>null==e?void 0:e.contains(o)))||(fe(!1),G.current&&clearTimeout(G.current)))},l=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;(null==o?void 0:o.isConnected)?(g?me():fe(!0),W(o),Z.current&&clearTimeout(Z.current)):W(null)},r=()=>{O?ye(_||100):_?ye():fe(!1),G.current&&clearTimeout(G.current)},n=i(l,50,!0),s=i(r,50,!0),c=e=>{s.cancel(),n(e)},a=()=>{n.cancel(),s()},u=()=>{fe(!1)},d=h||(null==C?void 0:C.click)||(null==C?void 0:C.dblclick)||(null==C?void 0:C.mousedown),f=C?{...C}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!C&&h&&Object.assign(f,{mouseenter:!1,focus:!1,click:!0});const v=R?{...R}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!R&&h&&Object.assign(v,{mouseleave:!1,blur:!1});const m=x?{...x}:{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:d||!1};L&&(Object.assign(f,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(v,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(m,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1}));const y=X.current,w=p(X.current),b=p(M);m.scroll&&(window.addEventListener("scroll",u),null==b||b.addEventListener("scroll",u),null==w||w.addEventListener("scroll",u));let E=null;m.resize?window.addEventListener("resize",u):M&&X.current&&(E=o.autoUpdate(M,X.current,he,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const S=e=>{"Escape"===e.key&&fe(!1)};m.escape&&window.addEventListener("keydown",S),m.clickOutsideAnchor&&window.addEventListener("click",t);const k=[],T=e=>{te&&(null==e?void 0:e.target)===M||l(e)},N=e=>{te&&(null==e?void 0:e.target)===M&&r()},$=["mouseenter","mouseleave","focus","blur"],j=["click","dblclick","mousedown","mouseup"];Object.entries(f).forEach((([e,t])=>{t&&($.includes(e)?k.push({event:e,listener:c}):j.includes(e)&&k.push({event:e,listener:T}))})),Object.entries(v).forEach((([e,t])=>{t&&($.includes(e)?k.push({event:e,listener:a}):j.includes(e)&&k.push({event:e,listener:N}))})),A&&k.push({event:"pointermove",listener:e});const I=()=>{ae.current=!0},B=()=>{ae.current=!1,r()};return O&&!d&&(null==y||y.addEventListener("mouseenter",I),null==y||y.addEventListener("mouseleave",B)),k.forEach((({event:e,listener:t})=>{ue.forEach((o=>{o.addEventListener(e,t)}))})),()=>{m.scroll&&(window.removeEventListener("scroll",u),null==b||b.removeEventListener("scroll",u),null==w||w.removeEventListener("scroll",u)),m.resize?window.removeEventListener("resize",u):null==E||E(),m.clickOutsideAnchor&&window.removeEventListener("click",t),m.escape&&window.removeEventListener("keydown",S),O&&!d&&(null==y||y.removeEventListener("mouseenter",I),null==y||y.removeEventListener("mouseleave",B)),k.forEach((({event:e,listener:t})=>{ue.forEach((o=>{o.removeEventListener(e,t)}))}))}}),[M,ue,O,R,_,g,A,x,ye,fe,me,we,L,C,h,W,te,he]),t.useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==ne?void 0:ne.anchorSelect)&&void 0!==e?e:d)&&void 0!==t?t:"";!o&&r&&(o=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`);const l=new MutationObserver((e=>{const t=new Set,l=new Set;e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){const o=e.target;o.getAttribute("data-tooltip-id")===r?t.add(o):e.oldValue===r&&l.add(o)}if("childList"!==e.type)return;const n=[...e.removedNodes].filter((e=>1===e.nodeType));if(M&&n.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,M))&&(re(!1),fe(!1),W(null),G.current&&clearTimeout(G.current),Z.current&&clearTimeout(Z.current),!0)})),o){try{n.forEach((e=>{const t=e;t.matches(o)?l.add(t):t.querySelectorAll(o).forEach((e=>l.add(e)))}))}catch(e){console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`)}try{[...e.addedNodes].filter((e=>1===e.nodeType)).forEach((e=>{const l=e;l.matches(o)?t.add(l):l.querySelectorAll(o).forEach((e=>t.add(e)))}))}catch(e){console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`)}}})),(t.size||l.size)&&de((e=>[...e.filter((e=>!l.has(e))),...t]))}));return l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{l.disconnect()}}),[r,d,null==ne?void 0:ne.anchorSelect,M,fe,W]),t.useEffect((()=>{he()}),[he]),t.useEffect((()=>{if(!(null==z?void 0:z.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>he()))}));return e.observe(z.current),()=>{e.disconnect()}}),[B,z,he]),t.useEffect((()=>{var e;M&&ue.includes(M)||W(null!==(e=ue[0])&&void 0!==e?e:null)}),[ue,M,W]),t.useEffect((()=>(H&&fe(!0),()=>{G.current&&clearTimeout(G.current),Z.current&&clearTimeout(Z.current)})),[H,fe]),t.useEffect((()=>{var e;let t=null!==(e=null==ne?void 0:ne.anchorSelect)&&void 0!==e?e:d;if(!t&&r&&(t=`[data-tooltip-id='${r.replace(/'/g,"\\'")}']`),t)try{const e=Array.from(document.querySelectorAll(t));de(e)}catch(e){de([])}}),[r,d,null==ne?void 0:ne.anchorSelect]),t.useEffect((()=>{G.current&&(clearTimeout(G.current),me(g))}),[g,me]);const be=null!==(K=null==ne?void 0:ne.content)&&void 0!==K?K:B,Ee=te&&Object.keys(Q.tooltipStyles).length>0;return t.useImperativeHandle(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}se(null!=e?e:null),(null==e?void 0:e.delay)?me(e.delay):fe(!0)},close:e=>{(null==e?void 0:e.delay)?ye(e.delay):fe(!1)},activeAnchor:M,place:Q.place,isOpen:Boolean(le&&!k&&be&&Ee)}))),le&&!k&&be?t.createElement(S,{id:r,role:F,className:l("react-tooltip",v.tooltip,m.tooltip,m[a],n,`react-tooltip__place-${Q.place}`,v[Ee?"show":"closing"],Ee?"react-tooltip__show":"react-tooltip__closing","fixed"===b&&v.fixed,O&&v.clickable),onTransitionEnd:e=>{J.current&&clearTimeout(J.current),te||"opacity"!==e.propertyName||(re(!1),se(null),null==I||I())},style:{...N,...Q.tooltipStyles,opacity:void 0!==V&&Ee?V:void 0},ref:X},be,t.createElement(S,{className:l("react-tooltip-arrow",v.arrow,m.arrow,c,T&&v.noArrow),style:{...Q.tooltipArrowStyles,background:U?`linear-gradient(to right bottom, transparent 50%, ${U} 50%)`:void 0},ref:Y})):null},w=t.forwardRef((({id:e,anchorSelect:o,content:r,render:n,className:s,classNameArrow:i,variant:a="dark",place:u="top",offset:d=10,wrapper:p="div",children:f=null,openOnClick:v=!1,positionStrategy:m="absolute",middlewares:w,delayShow:h=0,delayHide:b=0,float:E=!1,hidden:S=!1,noArrow:g=!1,clickable:_=!1,openEvents:A,closeEvents:k,globalCloseEvents:T,imperativeModeOnly:O=!1,style:C,position:R,isOpen:x,defaultIsOpen:L=!1,disableStyleInjection:N=!1,border:$,opacity:j,arrowColor:I,setIsOpen:B,afterShow:z,afterHide:D,role:H="tooltip"},q)=>{const[M,W]=t.useState(r),[P,V]=t.useState(u),[U,F]=t.useState(a),[K,X]=t.useState(d),[Y,G]=t.useState(h),[Z,J]=t.useState(b),[Q,ee]=t.useState(E),[te,oe]=t.useState(S),[le,re]=t.useState(p),[ne,se]=t.useState(m),[ce,ie]=t.useState(null),[ae,ue]=t.useState(null),de=t.useRef(N),pe=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null}return t}),{}),fe=t.useCallback((e=>{const t={place:e=>{var t;V(null!==(t=e)&&void 0!==t?t:u)},content:e=>{W(null!=e?e:r)},variant:e=>{var t;F(null!==(t=e)&&void 0!==t?t:a)},offset:e=>{X(null===e?d:Number(e))},wrapper:e=>{var t;re(null!==(t=e)&&void 0!==t?t:p)},"position-strategy":e=>{var t;se(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{G(null===e?h:Number(e))},"delay-hide":e=>{J(null===e?b:Number(e))},float:e=>{ee(null===e?E:"true"===e)},hidden:e=>{oe(null===e?S:"true"===e)},"class-name":e=>{ie(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o)}))}),[r,b,h,E,S,d,u,m,a,p]);t.useEffect((()=>{W(r)}),[r]),t.useEffect((()=>{V(u)}),[u]),t.useEffect((()=>{F(a)}),[a]),t.useEffect((()=>{X(d)}),[d]),t.useEffect((()=>{G(h)}),[h]),t.useEffect((()=>{J(b)}),[b]),t.useEffect((()=>{ee(E)}),[E]),t.useEffect((()=>{oe(S)}),[S]),t.useEffect((()=>{se(m)}),[m]),t.useEffect((()=>{de.current!==N&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[N]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===N,disableBase:N}}))}),[]),t.useEffect((()=>{const e=new MutationObserver((e=>{e.forEach((e=>{var t;if(!ae||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=pe(ae);fe(o)}))})),t={attributes:!0,childList:!1,subtree:!1};if(ae){const o=pe(ae);fe(o),e.observe(ae,t)}return()=>{e.disconnect()}}),[ae,o,fe]),t.useEffect((()=>{(null==C?void 0:C.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),$&&!c("border",`${$}`)&&console.warn(`[react-tooltip] "${$}" is not a valid \`border\`.`),(null==C?void 0:C.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),j&&!c("opacity",`${j}`)&&console.warn(`[react-tooltip] "${j}" is not a valid \`opacity\`.`)}),[$,j,null==C?void 0:C.border,null==C?void 0:C.opacity]);let ve=f;const me=t.useRef(null);if(n){const e=n({content:(null==ae?void 0:ae.getAttribute("data-tooltip-content"))||M||null,activeAnchor:ae});ve=e?t.createElement("div",{ref:me,className:"react-tooltip-content-wrapper"},e):null}else M&&(ve=M);const ye={forwardRef:q,id:e,anchorSelect:o,className:l(s,ce),classNameArrow:i,content:ve,contentWrapperRef:me,place:P,variant:U,offset:K,wrapper:le,openOnClick:v,positionStrategy:ne,middlewares:w,delayShow:Y,delayHide:Z,float:Q,hidden:te,noArrow:g,clickable:_,openEvents:A,closeEvents:k,globalCloseEvents:T,imperativeModeOnly:O,style:C,position:R,isOpen:x,defaultIsOpen:L,border:$,opacity:j,arrowColor:I,setIsOpen:B,afterShow:z,afterHide:D,activeAnchor:ae,setActiveAnchor:ue,role:H};return t.createElement(y,{...ye})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||n({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||n({css:` | ||
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})})),e.Tooltip=w})); | ||
//# sourceMappingURL=react-tooltip.umd.min.js.map |
{ | ||
"name": "react-tooltip", | ||
"version": "5.26.4", | ||
"version": "6.0.0-beta.1179.rc.0", | ||
"description": "react tooltip component", | ||
"scripts": { | ||
"dev-rollup": "node ./prebuild.js --env=development && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.dev.js --watch", | ||
"build": "node ./prebuild.js --env=production && npm run types && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.prod.js", | ||
"dev-rollup": "node ./prebuild.js --env=development && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.dev.mjs --watch", | ||
"build": "node ./prebuild.js --env=production && npm run types && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.prod.mjs && npm run test", | ||
"dev": "node ./prebuild.js --env=development && node ./esbuild.config.dev.mjs", | ||
"build-esbuild": "node ./prebuild.js --env=production && node ./esbuild.config.prod.mjs", | ||
"types": "node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.types.js", | ||
"types": "node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.types.mjs", | ||
"eslint": "eslint --ext=js --ext=jsx --ext=ts --ext=tsx --fix ./src", | ||
"stylelint": "stylelint \"src/**/*.css\"", | ||
"prettier": "prettier --config ./.prettierrc.json --write \"src/**/*{.js,.jsx,.ts,.tsx,.css}\"", | ||
"prepare": "husky install", | ||
"prepare": "husky", | ||
"bundlesize": "bundlesize", | ||
@@ -21,2 +21,3 @@ "esbuild": "esbuild", | ||
}, | ||
"type": "module", | ||
"types": "dist/react-tooltip.d.ts", | ||
@@ -52,47 +53,48 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "22.0.2", | ||
"@rollup/plugin-node-resolve": "14.1.0", | ||
"@rollup/plugin-replace": "4.0.0", | ||
"@rollup/plugin-typescript": "8.5.0", | ||
"@rollup/plugin-commonjs": "25.0.7", | ||
"@rollup/plugin-node-resolve": "15.2.3", | ||
"@rollup/plugin-replace": "5.0.5", | ||
"@rollup/plugin-typescript": "11.1.6", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "12.1.5", | ||
"@testing-library/user-event": "^14.4.3", | ||
"@types/css": "^0.0.33", | ||
"@types/css-modules": "^1.0.2", | ||
"@types/jest": "29.4.0", | ||
"@testing-library/user-event": "14.5.2", | ||
"@types/css": "0.0.37", | ||
"@types/css-modules": "1.0.5", | ||
"@types/jest": "29.5.12", | ||
"@types/node": "^18.15.3", | ||
"@types/react": "^18.2.17", | ||
"@types/react-dom": "18.0.11", | ||
"@types/react-test-renderer": "^18.0.0", | ||
"@typescript-eslint/eslint-plugin": "5.54.0", | ||
"@typescript-eslint/parser": "5.54.0", | ||
"bundlesize": "^0.18.1", | ||
"css-loader": "6.7.3", | ||
"esbuild": "0.17.11", | ||
"@types/react": "18.2.17", | ||
"@types/react-dom": "18.2.22", | ||
"@types/react-test-renderer": "18.0.7", | ||
"@typescript-eslint/eslint-plugin": "7.3.1", | ||
"@typescript-eslint/parser": "7.3.1", | ||
"bundlesize": "0.18.2", | ||
"css-loader": "6.10.0", | ||
"esbuild": "0.20.2", | ||
"esbuild-css-modules-plugin": "^2.7.1", | ||
"eslint": "8.35.0", | ||
"eslint": "8.57.0", | ||
"eslint-config-airbnb": "19.0.4", | ||
"eslint-config-prettier": "8.6.0", | ||
"eslint-plugin-import": "2.27.5", | ||
"eslint-plugin-jsx-a11y": "6.7.1", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-react": "7.32.2", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-import": "2.29.1", | ||
"eslint-plugin-jsx-a11y": "6.8.0", | ||
"eslint-plugin-prettier": "5.1.3", | ||
"eslint-plugin-react": "7.34.1", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"husky": "8.0.3", | ||
"jest": "29.4.3", | ||
"jest-environment-jsdom": "29.4.3", | ||
"husky": "9.0.11", | ||
"jest": "29.7.0", | ||
"jest-environment-jsdom": "29.7.0", | ||
"jest-transform-css": "6.0.1", | ||
"lint-staged": "13.1.2", | ||
"postcss": "8.4.21", | ||
"prettier": "2.8.4", | ||
"lint-staged": "15.2.2", | ||
"minimist": "^1.2.8", | ||
"postcss": "8.4.37", | ||
"prettier": "3.2.5", | ||
"process": "^0.11.10", | ||
"react": "16.14.0", | ||
"react-dom": "16.14.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "2.79.1", | ||
"rimraf": "5.0.5", | ||
"rollup": "4.13.0", | ||
"rollup-plugin-analyzer": "^4.0.0", | ||
"rollup-plugin-browsersync": "^1.3.3", | ||
"rollup-plugin-copy": "^3.4.0", | ||
"rollup-plugin-dts": "5.2.0", | ||
"rollup-plugin-filesize": "^9.1.1", | ||
"rollup-plugin-copy": "3.5.0", | ||
"rollup-plugin-dts": "6.1.0", | ||
"rollup-plugin-filesize": "10.0.0", | ||
"rollup-plugin-html-scaffold": "^0.2.0", | ||
@@ -103,10 +105,10 @@ "rollup-plugin-postcss": "^4.0.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-visualizer": "5.9.0", | ||
"style-loader": "^3.3.0", | ||
"stylelint": "^13.13.1", | ||
"stylelint-config-prettier": "^8.0.2", | ||
"stylelint-config-standard": "^22.0.0", | ||
"ts-jest": "29.0.5", | ||
"ts-node": "^10.9.1", | ||
"typescript": "4.9.5" | ||
"rollup-plugin-visualizer": "5.12.0", | ||
"style-loader": "3.3.4", | ||
"stylelint": "16.2.1", | ||
"stylelint-config-prettier": "9.0.5", | ||
"stylelint-config-standard": "36.0.0", | ||
"ts-jest": "29.1.2", | ||
"ts-node": "10.9.2", | ||
"typescript": "5.4.2" | ||
}, | ||
@@ -131,4 +133,4 @@ "peerDependencies": { | ||
"@floating-ui/dom": "^1.6.1", | ||
"classnames": "^2.3.0" | ||
"clsx": "2.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
31
Yes
775373
59
5206
3
1
+ Addedclsx@2.1.0
+ Addedclsx@2.1.0(transitive)
- Removedclassnames@^2.3.0
- Removedclassnames@2.5.1(transitive)