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

@radix-ui/react-tooltip

Package Overview
Dependencies
Maintainers
8
Versions
278
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-tooltip - npm Package Compare versions

Comparing version 0.1.4-rc.1 to 0.1.4-rc.2

2

dist/index.js

@@ -1,2 +0,2 @@

var e,o=require("@radix-ui/react-id").useId,t=E({},require("@radix-ui/react-visually-hidden")),r=require("@radix-ui/react-slot").Slottable,n=require("@radix-ui/react-portal").Portal,i=require("@radix-ui/react-popper"),l=E({},i),u=i.createPopperScope,a=require("@radix-ui/react-primitive").Primitive,s=require("@radix-ui/react-presence").Presence,c=require("@radix-ui/react-use-rect").useRect,p=require("@radix-ui/react-use-previous").usePrevious,d=require("@radix-ui/react-use-escape-keydown").useEscapeKeydown,T=require("@radix-ui/react-use-controllable-state").useControllableState,f=require("@radix-ui/react-context").createContextScope,m=require("@radix-ui/react-compose-refs").useComposedRefs,C=require("@radix-ui/primitive").composeEventHandlers,x=E({},require("react")),w=(e=require("@babel/runtime/helpers/extends"))&&e.__esModule?e.default:e;function E(e,o){return Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})})),e}const[v,g]=f("Tooltip",[u]);exports.createTooltipScope=g;const b=u(),_=700,[y,q]=v("TooltipProvider",{isOpenDelayed:!0,delayDuration:_,onTooltipOpen:()=>{},onTooltipClose:()=>{}}),h=e=>{const{__scopeTooltip:o,delayDuration:t=_,skipDelayDuration:r=300,children:n}=e,[i,l]=x.useState(!0),u=x.useRef(0);return x.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),/*#__PURE__*/x.createElement(y,{scope:o,isOpenDelayed:i,delayDuration:t,onTooltipOpen:x.useCallback((()=>{window.clearTimeout(u.current),l(!1)}),[]),onTooltipClose:x.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>l(!0)),r)}),[r])},n)};exports.TooltipProvider=h;const[D,O]=v("Tooltip"),R=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i=!1,onOpenChange:u,delayDuration:a}=e,s=q("Tooltip",t),c=b(t),[d,f]=x.useState(null),m=o(),C=x.useRef(0),w=x.useRef(!1),E=null!=a?a:s.delayDuration,v=!w.current&&s.isOpenDelayed?E:0,g=p(Boolean(v)),{onTooltipOpen:_,onTooltipClose:y}=s,[h=!1,O]=T({prop:n,defaultProp:i,onChange:e=>{e?(document.dispatchEvent(new CustomEvent("tooltip.open")),_()):(w.current=!1,y()),null==u||u(e)}}),R=x.useMemo((()=>h?g?"delayed-open":"instant-open":"closed"),[g,h]);return x.useEffect((()=>()=>window.clearTimeout(C.current)),[]),/*#__PURE__*/x.createElement(l.Root,c,/*#__PURE__*/x.createElement(D,{scope:t,contentId:m,open:h,stateAttribute:R,trigger:d,onTriggerChange:f,onFocus:x.useCallback((()=>{w.current=!0,O(!0)}),[O]),onOpen:x.useCallback((()=>{window.clearTimeout(C.current),C.current=window.setTimeout((()=>O(!0)),v)}),[v,O]),onClose:x.useCallback((()=>{window.clearTimeout(C.current),O(!1)}),[O])},r))};exports.Tooltip=R;const k=/*#__PURE__*/x.forwardRef(((e,o)=>{const{__scopeTooltip:t,...r}=e,n=O("TooltipTrigger",t),i=b(t),u=m(o,n.onTriggerChange);/*#__PURE__*/return x.createElement(l.Anchor,w({asChild:!0},i),/*#__PURE__*/x.createElement(a.button,w({"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute},r,{ref:u,onMouseEnter:C(e.onMouseEnter,n.onOpen),onMouseLeave:C(e.onMouseLeave,n.onClose),onMouseDown:C(e.onMouseDown,n.onClose),onFocus:C(e.onFocus,n.onFocus),onBlur:C(e.onBlur,n.onClose),onClick:C(e.onClick,n.onClose)})))}));exports.TooltipTrigger=k;const M=/*#__PURE__*/x.forwardRef(((e,o)=>{const{forceMount:t,...r}=e,n=O("TooltipContent",e.__scopeTooltip);/*#__PURE__*/return x.createElement(s,{present:t||n.open},/*#__PURE__*/x.createElement(P,w({ref:o},r)))}));exports.TooltipContent=M;const P=/*#__PURE__*/x.forwardRef(((e,o)=>{const{__scopeTooltip:i,children:u,"aria-label":a,portalled:s=!0,...c}=e,p=O("TooltipContent",i),T=b(i),f=s?n:x.Fragment,{onClose:m}=p;return d((()=>m())),x.useEffect((()=>(document.addEventListener("tooltip.open",m),()=>document.removeEventListener("tooltip.open",m))),[m]),/*#__PURE__*/x.createElement(f,null,/*#__PURE__*/x.createElement(S,{__scopeTooltip:i}),/*#__PURE__*/x.createElement(l.Content,w({"data-state":p.stateAttribute},T,c,{ref:o,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),/*#__PURE__*/x.createElement(r,null,u),/*#__PURE__*/x.createElement(t.Root,{id:p.contentId,role:"tooltip"},a||u)))})),A=/*#__PURE__*/x.forwardRef(((e,o)=>{const{__scopeTooltip:t,...r}=e,n=b(t);/*#__PURE__*/return x.createElement(l.Arrow,w({},n,r,{ref:o}))}));/*#__PURE__*/function S(e){const{__scopeTooltip:o}=e,t=O("CheckTriggerMoved",o),r=c(t.trigger),n=null==r?void 0:r.left,i=p(n),l=null==r?void 0:r.top,u=p(l),a=t.onClose;return x.useEffect((()=>{(void 0!==i&&i!==n||void 0!==u&&u!==l)&&a()}),[a,i,u,n,l]),null}exports.TooltipArrow=A;const F=h;exports.Provider=F;const I=R;exports.Root=I;const L=k;exports.Trigger=L;const B=M;exports.Content=B;const j=A;exports.Arrow=j;
var e,r=require("@radix-ui/react-id").useId,t=x({},require("@radix-ui/react-visually-hidden")),o=require("@radix-ui/react-slot").Slottable,n=require("@radix-ui/react-portal").Portal,i=require("@radix-ui/react-popper"),a=x({},i),u=i.createPopperScope,c=require("@radix-ui/react-primitive").Primitive,l=require("@radix-ui/react-presence").Presence,s=require("@radix-ui/react-use-rect").useRect,p=require("@radix-ui/react-use-previous").usePrevious,d=require("@radix-ui/react-use-escape-keydown").useEscapeKeydown,g=require("@radix-ui/react-use-controllable-state").useControllableState,T=require("@radix-ui/react-context").createContextScope,f=require("@radix-ui/react-compose-refs").useComposedRefs,m=require("@radix-ui/primitive").composeEventHandlers,v=x({},require("react")),E=(e=require("@babel/runtime/helpers/extends"))&&e.__esModule?e.default:e;function x(e,r){return Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e}const[w,C]=T("Tooltip",[u]);exports.createTooltipScope=C;const b=u(),_=700,[y,q]=w("TooltipProvider",{isOpenDelayed:!0,delayDuration:_,onTriggerEnter:()=>{},onTriggerLeave:()=>{}}),h=e=>{const{__scopeTooltip:r,delayDuration:t=_,skipDelayDuration:o=300,children:n}=e,[i,a]=v.useState(!0),u=v.useRef(0);return v.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),/*#__PURE__*/v.createElement(y,{scope:r,isOpenDelayed:i,delayDuration:t,onTriggerEnter:v.useCallback((()=>{window.clearTimeout(u.current),a(!1)}),[]),onTriggerLeave:v.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>a(!0)),o)}),[o])},n)};exports.TooltipProvider=h;const[k,D]=w("Tooltip"),L=e=>{const{__scopeTooltip:t,children:o,open:n,defaultOpen:i=!1,onOpenChange:u,delayDuration:c}=e,l=q("Tooltip",t),s=b(t),[d,T]=v.useState(null),f=r(),m=v.useRef(0),E=v.useRef(!1),x=null!=c?c:l.delayDuration,w=!E.current&&l.isOpenDelayed?x:0,C=p(Boolean(w)),{onTriggerEnter:_,onTriggerLeave:y}=l,[h=!1,D]=g({prop:n,defaultProp:i,onChange:e=>{e?document.dispatchEvent(new CustomEvent("tooltip.open")):E.current=!1,window.clearTimeout(m.current),null==u||u(e)}}),L=v.useMemo((()=>h?C?"delayed-open":"instant-open":"closed"),[C,h]);return v.useEffect((()=>()=>window.clearTimeout(m.current)),[]),/*#__PURE__*/v.createElement(a.Root,s,/*#__PURE__*/v.createElement(k,{scope:t,contentId:f,open:h,stateAttribute:L,trigger:d,onTriggerChange:T,onTriggerFocus:v.useCallback((()=>{E.current=!0,D(!0),_()}),[D,_]),onTriggerEnter:v.useCallback((()=>{m.current=window.setTimeout((()=>{D(!0),_()}),w)}),[w,D,_]),onTriggerLeave:v.useCallback((()=>{D(!1),y()}),[D,y]),onClose:v.useCallback((()=>D(!1)),[D])},o))};exports.Tooltip=L;const R=/*#__PURE__*/v.forwardRef(((e,r)=>{const{__scopeTooltip:t,...o}=e,n=D("TooltipTrigger",t),i=b(t),u=f(r,n.onTriggerChange);/*#__PURE__*/return v.createElement(a.Anchor,E({asChild:!0},i),/*#__PURE__*/v.createElement(c.button,E({"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute},o,{ref:u,onMouseEnter:m(e.onMouseEnter,n.onTriggerEnter),onMouseLeave:m(e.onMouseLeave,n.onTriggerLeave),onMouseDown:m(e.onMouseDown,n.onTriggerLeave),onFocus:m(e.onFocus,n.onTriggerFocus),onBlur:m(e.onBlur,n.onTriggerLeave),onClick:m(e.onClick,n.onTriggerLeave)})))}));exports.TooltipTrigger=R;const M=/*#__PURE__*/v.forwardRef(((e,r)=>{const{forceMount:t,...o}=e,n=D("TooltipContent",e.__scopeTooltip);/*#__PURE__*/return v.createElement(l,{present:t||n.open},/*#__PURE__*/v.createElement(P,E({ref:r},o)))}));exports.TooltipContent=M;const P=/*#__PURE__*/v.forwardRef(((e,r)=>{const{__scopeTooltip:i,children:u,"aria-label":c,portalled:l=!0,...s}=e,p=D("TooltipContent",i),g=b(i),T=l?n:v.Fragment,{onClose:f}=p;return d((()=>f())),v.useEffect((()=>(document.addEventListener("tooltip.open",f),()=>document.removeEventListener("tooltip.open",f))),[f]),/*#__PURE__*/v.createElement(T,null,/*#__PURE__*/v.createElement(O,{__scopeTooltip:i}),/*#__PURE__*/v.createElement(a.Content,E({"data-state":p.stateAttribute},g,s,{ref:r,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),/*#__PURE__*/v.createElement(o,null,u),/*#__PURE__*/v.createElement(t.Root,{id:p.contentId,role:"tooltip"},c||u)))})),A=/*#__PURE__*/v.forwardRef(((e,r)=>{const{__scopeTooltip:t,...o}=e,n=b(t);/*#__PURE__*/return v.createElement(a.Arrow,E({},n,o,{ref:r}))}));/*#__PURE__*/function O(e){const{__scopeTooltip:r}=e,t=D("CheckTriggerMoved",r),o=s(t.trigger),n=null==o?void 0:o.left,i=p(n),a=null==o?void 0:o.top,u=p(a),c=t.onClose;return v.useEffect((()=>{(void 0!==i&&i!==n||void 0!==u&&u!==a)&&c()}),[c,i,u,n,a]),null}exports.TooltipArrow=A;const S=h;exports.Provider=S;const F=L;exports.Root=F;const I=R;exports.Trigger=I;const B=M;exports.Content=B;const j=A;exports.Arrow=j;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import{useId as e}from"@radix-ui/react-id";import*as o from"@radix-ui/react-visually-hidden";import{Slottable as t}from"@radix-ui/react-slot";import{Portal as r}from"@radix-ui/react-portal";import*as n from"@radix-ui/react-popper";import{createPopperScope as i}from"@radix-ui/react-popper";import{Primitive as l}from"@radix-ui/react-primitive";import{Presence as a}from"@radix-ui/react-presence";import{useRect as p}from"@radix-ui/react-use-rect";import{usePrevious as c}from"@radix-ui/react-use-previous";import{useEscapeKeydown as s}from"@radix-ui/react-use-escape-keydown";import{useControllableState as u}from"@radix-ui/react-use-controllable-state";import{createContextScope as d}from"@radix-ui/react-context";import{useComposedRefs as m}from"@radix-ui/react-compose-refs";import{composeEventHandlers as f}from"@radix-ui/primitive";import*as T from"react";import x from"@babel/runtime/helpers/esm/extends";const[C,w]=d("Tooltip",[i]);export{w as createTooltipScope};const g=i(),E=700,[v,_]=C("TooltipProvider",{isOpenDelayed:!0,delayDuration:E,onTooltipOpen:()=>{},onTooltipClose:()=>{}});export const TooltipProvider=e=>{const{__scopeTooltip:o,delayDuration:t=E,skipDelayDuration:r=300,children:n}=e,[i,l]=T.useState(!0),a=T.useRef(0);return T.useEffect((()=>{const e=a.current;return()=>window.clearTimeout(e)}),[]),/*#__PURE__*/T.createElement(v,{scope:o,isOpenDelayed:i,delayDuration:t,onTooltipOpen:T.useCallback((()=>{window.clearTimeout(a.current),l(!1)}),[]),onTooltipClose:T.useCallback((()=>{window.clearTimeout(a.current),a.current=window.setTimeout((()=>l(!0)),r)}),[r])},n)};/*#__PURE__*/const[b,y]=C("Tooltip");export const Tooltip=o=>{const{__scopeTooltip:t,children:r,open:i,defaultOpen:l=!1,onOpenChange:a,delayDuration:p}=o,s=_("Tooltip",t),d=g(t),[m,f]=T.useState(null),x=e(),C=T.useRef(0),w=T.useRef(!1),E=null!=p?p:s.delayDuration,v=!w.current&&s.isOpenDelayed?E:0,y=c(Boolean(v)),{onTooltipOpen:h,onTooltipClose:D}=s,[k=!1,O]=u({prop:i,defaultProp:l,onChange:e=>{e?(document.dispatchEvent(new CustomEvent("tooltip.open")),h()):(w.current=!1,D()),null==a||a(e)}}),R=T.useMemo((()=>k?y?"delayed-open":"instant-open":"closed"),[y,k]);return T.useEffect((()=>()=>window.clearTimeout(C.current)),[]),/*#__PURE__*/T.createElement(n.Root,d,/*#__PURE__*/T.createElement(b,{scope:t,contentId:x,open:k,stateAttribute:R,trigger:m,onTriggerChange:f,onFocus:T.useCallback((()=>{w.current=!0,O(!0)}),[O]),onOpen:T.useCallback((()=>{window.clearTimeout(C.current),C.current=window.setTimeout((()=>O(!0)),v)}),[v,O]),onClose:T.useCallback((()=>{window.clearTimeout(C.current),O(!1)}),[O])},r))};/*#__PURE__*/export const TooltipTrigger=/*#__PURE__*/T.forwardRef(((e,o)=>{const{__scopeTooltip:t,...r}=e,i=y("TooltipTrigger",t),a=g(t),p=m(o,i.onTriggerChange);/*#__PURE__*/return T.createElement(n.Anchor,x({asChild:!0},a),/*#__PURE__*/T.createElement(l.button,x({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:p,onMouseEnter:f(e.onMouseEnter,i.onOpen),onMouseLeave:f(e.onMouseLeave,i.onClose),onMouseDown:f(e.onMouseDown,i.onClose),onFocus:f(e.onFocus,i.onFocus),onBlur:f(e.onBlur,i.onClose),onClick:f(e.onClick,i.onClose)})))}));/*#__PURE__*/export const TooltipContent=/*#__PURE__*/T.forwardRef(((e,o)=>{const{forceMount:t,...r}=e,n=y("TooltipContent",e.__scopeTooltip);/*#__PURE__*/return T.createElement(a,{present:t||n.open},/*#__PURE__*/T.createElement(h,x({ref:o},r)))}));const h=/*#__PURE__*/T.forwardRef(((e,i)=>{const{__scopeTooltip:l,children:a,"aria-label":p,portalled:c=!0,...u}=e,d=y("TooltipContent",l),m=g(l),f=c?r:T.Fragment,{onClose:C}=d;return s((()=>C())),T.useEffect((()=>(document.addEventListener("tooltip.open",C),()=>document.removeEventListener("tooltip.open",C))),[C]),/*#__PURE__*/T.createElement(f,null,/*#__PURE__*/T.createElement(D,{__scopeTooltip:l}),/*#__PURE__*/T.createElement(n.Content,x({"data-state":d.stateAttribute},m,u,{ref:i,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),/*#__PURE__*/T.createElement(t,null,a),/*#__PURE__*/T.createElement(o.Root,{id:d.contentId,role:"tooltip"},p||a)))}));/*#__PURE__*/export const TooltipArrow=/*#__PURE__*/T.forwardRef(((e,o)=>{const{__scopeTooltip:t,...r}=e,i=g(t);/*#__PURE__*/return T.createElement(n.Arrow,x({},i,r,{ref:o}))}));/*#__PURE__*/function D(e){const{__scopeTooltip:o}=e,t=y("CheckTriggerMoved",o),r=p(t.trigger),n=null==r?void 0:r.left,i=c(n),l=null==r?void 0:r.top,a=c(l),s=t.onClose;return T.useEffect((()=>{(void 0!==i&&i!==n||void 0!==a&&a!==l)&&s()}),[s,i,a,n,l]),null}export const Provider=TooltipProvider;export const Root=Tooltip;export const Trigger=TooltipTrigger;export const Content=TooltipContent;export const Arrow=TooltipArrow;
import{useId as e}from"@radix-ui/react-id";import*as o from"@radix-ui/react-visually-hidden";import{Slottable as r}from"@radix-ui/react-slot";import{Portal as t}from"@radix-ui/react-portal";import*as n from"@radix-ui/react-popper";import{createPopperScope as i}from"@radix-ui/react-popper";import{Primitive as a}from"@radix-ui/react-primitive";import{Presence as l}from"@radix-ui/react-presence";import{useRect as c}from"@radix-ui/react-use-rect";import{usePrevious as p}from"@radix-ui/react-use-previous";import{useEscapeKeydown as s}from"@radix-ui/react-use-escape-keydown";import{useControllableState as u}from"@radix-ui/react-use-controllable-state";import{createContextScope as d}from"@radix-ui/react-context";import{useComposedRefs as m}from"@radix-ui/react-compose-refs";import{composeEventHandlers as g}from"@radix-ui/primitive";import*as T from"react";import f from"@babel/runtime/helpers/esm/extends";const[v,x]=d("Tooltip",[i]);export{x as createTooltipScope};const E=i(),w=700,[C,b]=v("TooltipProvider",{isOpenDelayed:!0,delayDuration:w,onTriggerEnter:()=>{},onTriggerLeave:()=>{}});export const TooltipProvider=e=>{const{__scopeTooltip:o,delayDuration:r=w,skipDelayDuration:t=300,children:n}=e,[i,a]=T.useState(!0),l=T.useRef(0);return T.useEffect((()=>{const e=l.current;return()=>window.clearTimeout(e)}),[]),/*#__PURE__*/T.createElement(C,{scope:o,isOpenDelayed:i,delayDuration:r,onTriggerEnter:T.useCallback((()=>{window.clearTimeout(l.current),a(!1)}),[]),onTriggerLeave:T.useCallback((()=>{window.clearTimeout(l.current),l.current=window.setTimeout((()=>a(!0)),t)}),[t])},n)};/*#__PURE__*/const[_,y]=v("Tooltip");export const Tooltip=o=>{const{__scopeTooltip:r,children:t,open:i,defaultOpen:a=!1,onOpenChange:l,delayDuration:c}=o,s=b("Tooltip",r),d=E(r),[m,g]=T.useState(null),f=e(),v=T.useRef(0),x=T.useRef(!1),w=null!=c?c:s.delayDuration,C=!x.current&&s.isOpenDelayed?w:0,y=p(Boolean(C)),{onTriggerEnter:h,onTriggerLeave:D}=s,[L=!1,k]=u({prop:i,defaultProp:a,onChange:e=>{e?document.dispatchEvent(new CustomEvent("tooltip.open")):x.current=!1,window.clearTimeout(v.current),null==l||l(e)}}),R=T.useMemo((()=>L?y?"delayed-open":"instant-open":"closed"),[y,L]);return T.useEffect((()=>()=>window.clearTimeout(v.current)),[]),/*#__PURE__*/T.createElement(n.Root,d,/*#__PURE__*/T.createElement(_,{scope:r,contentId:f,open:L,stateAttribute:R,trigger:m,onTriggerChange:g,onTriggerFocus:T.useCallback((()=>{x.current=!0,k(!0),h()}),[k,h]),onTriggerEnter:T.useCallback((()=>{v.current=window.setTimeout((()=>{k(!0),h()}),C)}),[C,k,h]),onTriggerLeave:T.useCallback((()=>{k(!1),D()}),[k,D]),onClose:T.useCallback((()=>k(!1)),[k])},t))};/*#__PURE__*/export const TooltipTrigger=/*#__PURE__*/T.forwardRef(((e,o)=>{const{__scopeTooltip:r,...t}=e,i=y("TooltipTrigger",r),l=E(r),c=m(o,i.onTriggerChange);/*#__PURE__*/return T.createElement(n.Anchor,f({asChild:!0},l),/*#__PURE__*/T.createElement(a.button,f({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},t,{ref:c,onMouseEnter:g(e.onMouseEnter,i.onTriggerEnter),onMouseLeave:g(e.onMouseLeave,i.onTriggerLeave),onMouseDown:g(e.onMouseDown,i.onTriggerLeave),onFocus:g(e.onFocus,i.onTriggerFocus),onBlur:g(e.onBlur,i.onTriggerLeave),onClick:g(e.onClick,i.onTriggerLeave)})))}));/*#__PURE__*/export const TooltipContent=/*#__PURE__*/T.forwardRef(((e,o)=>{const{forceMount:r,...t}=e,n=y("TooltipContent",e.__scopeTooltip);/*#__PURE__*/return T.createElement(l,{present:r||n.open},/*#__PURE__*/T.createElement(h,f({ref:o},t)))}));const h=/*#__PURE__*/T.forwardRef(((e,i)=>{const{__scopeTooltip:a,children:l,"aria-label":c,portalled:p=!0,...u}=e,d=y("TooltipContent",a),m=E(a),g=p?t:T.Fragment,{onClose:v}=d;return s((()=>v())),T.useEffect((()=>(document.addEventListener("tooltip.open",v),()=>document.removeEventListener("tooltip.open",v))),[v]),/*#__PURE__*/T.createElement(g,null,/*#__PURE__*/T.createElement(D,{__scopeTooltip:a}),/*#__PURE__*/T.createElement(n.Content,f({"data-state":d.stateAttribute},m,u,{ref:i,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),/*#__PURE__*/T.createElement(r,null,l),/*#__PURE__*/T.createElement(o.Root,{id:d.contentId,role:"tooltip"},c||l)))}));/*#__PURE__*/export const TooltipArrow=/*#__PURE__*/T.forwardRef(((e,o)=>{const{__scopeTooltip:r,...t}=e,i=E(r);/*#__PURE__*/return T.createElement(n.Arrow,f({},i,t,{ref:o}))}));/*#__PURE__*/function D(e){const{__scopeTooltip:o}=e,r=y("CheckTriggerMoved",o),t=c(r.trigger),n=null==t?void 0:t.left,i=p(n),a=null==t?void 0:t.top,l=p(a),s=r.onClose;return T.useEffect((()=>{(void 0!==i&&i!==n||void 0!==l&&l!==a)&&s()}),[s,i,l,n,a]),null}export const Provider=TooltipProvider;export const Root=Tooltip;export const Trigger=TooltipTrigger;export const Content=TooltipContent;export const Arrow=TooltipArrow;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-tooltip",
"version": "0.1.4-rc.1",
"version": "0.1.4-rc.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "source": "src/index.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc