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

@reach/tooltip

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reach/tooltip - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

7

es/index.js

@@ -462,2 +462,5 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

// feels awkward when it's perfectly aligned w/ the trigger
var OFFSET = 8;
var getStyles = function getStyles(position, triggerRect, tooltipRect) {

@@ -480,3 +483,3 @@ var haventMeasuredTooltipYet = !tooltipRect;

right: window.innerWidth < triggerRect.left + tooltipRect.width,
bottom: window.innerHeight < triggerRect.bottom + tooltipRect.height,
bottom: window.innerHeight < triggerRect.bottom + tooltipRect.height + OFFSET,
left: triggerRect.left - tooltipRect.width < 0

@@ -490,4 +493,4 @@ };

left: directionRight ? triggerRect.right - tooltipRect.width + window.scrollX + "px" : triggerRect.left + window.scrollX + "px",
top: directionUp ? triggerRect.top - tooltipRect.height + window.scrollY + "px" : triggerRect.top + triggerRect.height + window.scrollY + "px"
top: directionUp ? triggerRect.top - OFFSET - tooltipRect.height + window.scrollY + "px" : triggerRect.top + OFFSET + triggerRect.height + window.scrollY + "px"
});
};

@@ -482,2 +482,5 @@ "use strict";

// feels awkward when it's perfectly aligned w/ the trigger
var OFFSET = 8;
var getStyles = function getStyles(position, triggerRect, tooltipRect) {

@@ -500,3 +503,3 @@ var haventMeasuredTooltipYet = !tooltipRect;

right: window.innerWidth < triggerRect.left + tooltipRect.width,
bottom: window.innerHeight < triggerRect.bottom + tooltipRect.height,
bottom: window.innerHeight < triggerRect.bottom + tooltipRect.height + OFFSET,
left: triggerRect.left - tooltipRect.width < 0

@@ -510,4 +513,4 @@ };

left: directionRight ? triggerRect.right - tooltipRect.width + window.scrollX + "px" : triggerRect.left + window.scrollX + "px",
top: directionUp ? triggerRect.top - tooltipRect.height + window.scrollY + "px" : triggerRect.top + triggerRect.height + window.scrollY + "px"
top: directionUp ? triggerRect.top - OFFSET - tooltipRect.height + window.scrollY + "px" : triggerRect.top + OFFSET + triggerRect.height + window.scrollY + "px"
});
};
{
"name": "@reach/tooltip",
"version": "0.1.4",
"version": "0.1.5",
"description": "Accessible tooltips",

@@ -14,6 +14,6 @@ "main": "index.js",

"@reach/auto-id": "0.2.0",
"@reach/portal": "^0.2.0",
"@reach/portal": "^0.2.1",
"@reach/rect": "^0.2.1",
"@reach/utils": "^0.2.1",
"@reach/visually-hidden": "^0.1.3",
"@reach/utils": "^0.2.2",
"@reach/visually-hidden": "^0.1.4",
"prop-types": "^15.7.2"

@@ -20,0 +20,0 @@ },

@@ -468,2 +468,5 @@ ////////////////////////////////////////////////////////////////////////////////

// feels awkward when it's perfectly aligned w/ the trigger
const OFFSET = 8;
const getStyles = (position, triggerRect, tooltipRect) => {

@@ -486,3 +489,4 @@ const haventMeasuredTooltipYet = !tooltipRect;

right: window.innerWidth < triggerRect.left + tooltipRect.width,
bottom: window.innerHeight < triggerRect.bottom + tooltipRect.height,
bottom:
window.innerHeight < triggerRect.bottom + tooltipRect.height + OFFSET,
left: triggerRect.left - tooltipRect.width < 0

@@ -500,5 +504,5 @@ };

top: directionUp
? `${triggerRect.top - tooltipRect.height + window.scrollY}px`
: `${triggerRect.top + triggerRect.height + window.scrollY}px`
? `${triggerRect.top - OFFSET - tooltipRect.height + window.scrollY}px`
: `${triggerRect.top + OFFSET + triggerRect.height + window.scrollY}px`
};
};
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