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

@react-md/tooltip

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-md/tooltip - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

## [4.0.1](https://github.com/mlaursen/react-md/compare/v4.0.0...v4.0.1) (2021-11-27)
### Other Internal Changes
* Updated imports to use `import type` when possible ([ba96bb6](https://github.com/mlaursen/react-md/commit/ba96bb62eeddcc0879f6d584aa670850203561e6))
# [4.0.0](https://github.com/mlaursen/react-md/compare/v3.1.1...v4.0.0) (2021-11-24)

@@ -8,0 +20,0 @@

22

es/useTooltip.js

@@ -23,2 +23,18 @@ var __assign = (this && this.__assign) || function () {

};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
import { useCallback, useEffect, useRef, useState, } from "react";

@@ -78,9 +94,9 @@ import cn from "classnames";

var containerRef = useRef(null);
var _m = useTooltipPosition({
var _m = __read(useTooltipPosition({
position: determinedPosition,
defaultPosition: defaultPosition,
threshold: threshold,
}), position = _m[0], updatePosition = _m[1];
}), 2), position = _m[0], updatePosition = _m[1];
var mode = useUserInteractionMode();
var _o = useState(null), initiatedBy = _o[0], setInitiatedBy = _o[1];
var _o = __read(useState(null), 2), initiatedBy = _o[0], setInitiatedBy = _o[1];
var windowFocusEvent = useRef(false);

@@ -87,0 +103,0 @@ var timeout = useRef(undefined);

@@ -0,1 +1,17 @@

var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
import { useCallback, useState } from "react";

@@ -17,3 +33,3 @@ import { getViewportSize } from "@react-md/utils";

var determinedPosition = _a.position, _b = _a.defaultPosition, defaultPosition = _b === void 0 ? "below" : _b, _c = _a.threshold, threshold = _c === void 0 ? DEFAULT_TOOLTIP_THRESHOLD : _c;
var _d = useState(defaultPosition), position = _d[0], setPosition = _d[1];
var _d = __read(useState(defaultPosition), 2), position = _d[0], setPosition = _d[1];
var updatePosition = useCallback(function (container) {

@@ -20,0 +36,0 @@ var _a = container.getBoundingClientRect(), top = _a.top, left = _a.left;

2

lib/Tooltipped.d.ts
import { CSSProperties, ReactElement, ReactNode } from "react";
import { RenderConditionalPortalProps } from "@react-md/portal";
import type { RenderConditionalPortalProps } from "@react-md/portal";
import { TooltipProps } from "./Tooltip";

@@ -4,0 +4,0 @@ import { TooltippedElementEventHandlers, BaseTooltipHookOptions } from "./useTooltip";

import { CSSProperties, HTMLAttributes, Ref } from "react";
import { FixedPositioningTransitionCallbacks, TransitionCallbacks } from "@react-md/transition";
import { HoverModeEventHandlers, HoverModeOnlyReturnValue, UserInteractionMode } from "@react-md/utils";
import { TooltipProps } from "./Tooltip";
import type { TooltipProps } from "./Tooltip";
import { TooltipPositionHookOptions } from "./useTooltipPosition";

@@ -6,0 +6,0 @@ /**

@@ -24,2 +24,18 @@ "use strict";

};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -84,9 +100,9 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

var containerRef = (0, react_1.useRef)(null);
var _m = (0, useTooltipPosition_1.useTooltipPosition)({
var _m = __read((0, useTooltipPosition_1.useTooltipPosition)({
position: determinedPosition,
defaultPosition: defaultPosition,
threshold: threshold,
}), position = _m[0], updatePosition = _m[1];
}), 2), position = _m[0], updatePosition = _m[1];
var mode = (0, utils_1.useUserInteractionMode)();
var _o = (0, react_1.useState)(null), initiatedBy = _o[0], setInitiatedBy = _o[1];
var _o = __read((0, react_1.useState)(null), 2), initiatedBy = _o[0], setInitiatedBy = _o[1];
var windowFocusEvent = (0, react_1.useRef)(false);

@@ -93,0 +109,0 @@ var timeout = (0, react_1.useRef)(undefined);

"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -20,3 +36,3 @@ exports.useTooltipPosition = void 0;

var determinedPosition = _a.position, _b = _a.defaultPosition, defaultPosition = _b === void 0 ? "below" : _b, _c = _a.threshold, threshold = _c === void 0 ? constants_1.DEFAULT_TOOLTIP_THRESHOLD : _c;
var _d = (0, react_1.useState)(defaultPosition), position = _d[0], setPosition = _d[1];
var _d = __read((0, react_1.useState)(defaultPosition), 2), position = _d[0], setPosition = _d[1];
var updatePosition = (0, react_1.useCallback)(function (container) {

@@ -23,0 +39,0 @@ var _a = container.getBoundingClientRect(), top = _a.top, left = _a.left;

{
"name": "@react-md/tooltip",
"version": "4.0.0",
"version": "4.0.1",
"description": "Create accessible tooltips within react-md based on the material design specifications.",

@@ -34,7 +34,7 @@ "main": "./lib/index.js",

"dependencies": {
"@react-md/portal": "^4.0.0",
"@react-md/theme": "^4.0.0",
"@react-md/transition": "^4.0.0",
"@react-md/typography": "^4.0.0",
"@react-md/utils": "^4.0.0",
"@react-md/portal": "^4.0.1",
"@react-md/theme": "^4.0.1",
"@react-md/transition": "^4.0.1",
"@react-md/typography": "^4.0.1",
"@react-md/utils": "^4.0.1",
"classnames": "^2.3.1"

@@ -53,3 +53,3 @@ },

},
"gitHead": "a9f2d64a777698fa65bb3196f6063cdd8321f5cb"
"gitHead": "0df0f24d688ea7c867b7ef656ee9887f00215705"
}

@@ -45,3 +45,3 @@ import {

} from "./constants";
import { TooltipProps } from "./Tooltip";
import type { TooltipProps } from "./Tooltip";
import {

@@ -48,0 +48,0 @@ TooltipPositionHookOptions,

import { CSSProperties, ReactElement, ReactNode } from "react";
import { RenderConditionalPortalProps } from "@react-md/portal";
import type { RenderConditionalPortalProps } from "@react-md/portal";
import { TooltipProps } from "./Tooltip";

@@ -4,0 +4,0 @@ import { TooltippedElementEventHandlers, BaseTooltipHookOptions } from "./useTooltip";

import { CSSProperties, HTMLAttributes, Ref } from "react";
import { FixedPositioningTransitionCallbacks, TransitionCallbacks } from "@react-md/transition";
import { HoverModeEventHandlers, HoverModeOnlyReturnValue, UserInteractionMode } from "@react-md/utils";
import { TooltipProps } from "./Tooltip";
import type { TooltipProps } from "./Tooltip";
import { TooltipPositionHookOptions } from "./useTooltipPosition";

@@ -6,0 +6,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

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