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

react-tailwind-tooltip

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tailwind-tooltip - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

2

dist/cjs/components/Tooltip/Tooltip.d.ts
import React from 'react';
interface TooltipProps {
children: React.ReactNode;
title: string;
title: React.ReactNode;
placement?: 'top' | 'bottom' | 'left' | 'right';

@@ -6,0 +6,0 @@ followCursor?: boolean;

@@ -14,2 +14,3 @@ "use strict";

var childRef = react_1["default"].useRef(null);
var isTooltipHovered = react_1["default"].useRef(false);
var calculatePosition = function () {

@@ -79,2 +80,15 @@ if (childRef.current && tooltipRef.current) {

var handleMouseLeave = function (event) {
setTimeout(function () {
if (!isTooltipHovered.current) {
setOpen(false);
if (onClose)
onClose(event);
}
}, 100);
};
var handleTooltipMouseEnter = function () {
isTooltipHovered.current = true;
};
var handleTooltipMouseLeave = function (event) {
isTooltipHovered.current = false;
setOpen(false);

@@ -106,3 +120,3 @@ if (onClose)

open && (react_1["default"].createElement(Portal_1.Portal, null,
react_1["default"].createElement("div", { className: "fixed z-10 p-2 bg-[#223354]/95 text-white text-sm rounded-lg shadow-lg", style: { top: "".concat(tooltipPosition.top, "px"), left: "".concat(tooltipPosition.left, "px") }, ref: tooltipRef },
react_1["default"].createElement("div", { className: "fixed z-10 p-2 bg-[#223354]/95 text-white text-sm rounded-lg shadow-lg", style: { top: "".concat(tooltipPosition.top, "px"), left: "".concat(tooltipPosition.left, "px") }, ref: tooltipRef, onMouseEnter: handleTooltipMouseEnter, onMouseLeave: handleTooltipMouseLeave },
title,

@@ -109,0 +123,0 @@ arrow && (react_1["default"].createElement("div", { className: "absolute w-2 h-2 to-[#223354]/95 to-50% transform rotate-45 ".concat(currentPlacement === 'top'

import React from 'react';
interface TooltipProps {
children: React.ReactNode;
title: string;
title: React.ReactNode;
placement?: 'top' | 'bottom' | 'left' | 'right';

@@ -6,0 +6,0 @@ followCursor?: boolean;

@@ -10,2 +10,3 @@ import React from 'react';

var childRef = React.useRef(null);
var isTooltipHovered = React.useRef(false);
var calculatePosition = function () {

@@ -75,2 +76,15 @@ if (childRef.current && tooltipRef.current) {

var handleMouseLeave = function (event) {
setTimeout(function () {
if (!isTooltipHovered.current) {
setOpen(false);
if (onClose)
onClose(event);
}
}, 100);
};
var handleTooltipMouseEnter = function () {
isTooltipHovered.current = true;
};
var handleTooltipMouseLeave = function (event) {
isTooltipHovered.current = false;
setOpen(false);

@@ -102,3 +116,3 @@ if (onClose)

open && (React.createElement(Portal, null,
React.createElement("div", { className: "fixed z-10 p-2 bg-[#223354]/95 text-white text-sm rounded-lg shadow-lg", style: { top: "".concat(tooltipPosition.top, "px"), left: "".concat(tooltipPosition.left, "px") }, ref: tooltipRef },
React.createElement("div", { className: "fixed z-10 p-2 bg-[#223354]/95 text-white text-sm rounded-lg shadow-lg", style: { top: "".concat(tooltipPosition.top, "px"), left: "".concat(tooltipPosition.left, "px") }, ref: tooltipRef, onMouseEnter: handleTooltipMouseEnter, onMouseLeave: handleTooltipMouseLeave },
title,

@@ -105,0 +119,0 @@ arrow && (React.createElement("div", { className: "absolute w-2 h-2 to-[#223354]/95 to-50% transform rotate-45 ".concat(currentPlacement === 'top'

{
"name": "react-tailwind-tooltip",
"version": "1.0.0",
"version": "1.0.2",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

@@ -15,2 +15,4 @@ # React tailwind tooltip

[![NPM](https://nodei.co/npm/react-tailwind-tooltip.png?downloads=true&stars=true)](https://www.npmjs.com/package/react-tailwind-tooltip)
Install with npm:

@@ -38,2 +40,4 @@

![Example](./images/example.png)
```tsx

@@ -40,0 +44,0 @@ import React from 'react';

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