@react-md/tooltip
Advanced tools
Comparing version 2.0.0-alpha.9 to 2.0.0-alpha.10
@@ -25,3 +25,3 @@ var __assign = (this && this.__assign) || function () { | ||
import cn from "classnames"; | ||
import { CSSTransition } from "react-transition-group"; | ||
import CSSTransition from "react-transition-group/CSSTransition"; | ||
import { bem } from "@react-md/utils"; | ||
@@ -28,0 +28,0 @@ import { TOOLTIP_CLASS_NAMES, TOOLTIP_TRANSITION_TIMEOUT } from "./constants"; |
@@ -27,3 +27,18 @@ import React, { useMemo } from "react"; | ||
TooltipHoverModeConfig.defaultProps = defaultProps; | ||
if (process.env.NODE_ENV !== "production") { | ||
var PropTypes = void 0; | ||
try { | ||
PropTypes = require("prop-types"); | ||
} | ||
catch (e) { } | ||
if (PropTypes) { | ||
TooltipHoverModeConfig.propTypes = { | ||
enabled: PropTypes.bool, | ||
delayTimeout: PropTypes.number, | ||
defaultDelay: PropTypes.number, | ||
children: PropTypes.node.isRequired, | ||
}; | ||
} | ||
} | ||
export default TooltipHoverModeConfig; | ||
//# sourceMappingURL=TooltipHoverModeConfig.js.map |
@@ -107,7 +107,5 @@ var __assign = (this && this.__assign) || function () { | ||
if (!propHandler) { | ||
// @ts-ignore | ||
result[propName] = configHandler; | ||
} | ||
else if (!configHandler) { | ||
// @ts-ignore | ||
result[propName] = propHandler; | ||
@@ -114,0 +112,0 @@ } |
import { useCallback, useEffect, useRef } from "react"; | ||
import { useInteractionModeContext } from "@react-md/states"; | ||
import { useToggle } from "@react-md/utils"; | ||
import { useToggle, useInteractionModeContext, } from "@react-md/utils"; | ||
import { DEFAULT_DELAY, DEFAULT_THRESHOLD } from "./constants"; | ||
@@ -5,0 +4,0 @@ import { useKeyboardState, useMouseState, useTouchState, } from "./useHandlers"; |
@@ -37,3 +37,3 @@ "use strict"; | ||
var classnames_1 = __importDefault(require("classnames")); | ||
var react_transition_group_1 = require("react-transition-group"); | ||
var CSSTransition_1 = __importDefault(require("react-transition-group/CSSTransition")); | ||
var utils_1 = require("@react-md/utils"); | ||
@@ -50,3 +50,3 @@ var constants_1 = require("./constants"); | ||
var _b = providedProps, className = _b.className, classNames = _b.classNames, visible = _b.visible, timeout = _b.timeout, dense = _b.dense, lineWrap = _b.lineWrap, position = _b.position, children = _b.children, forwardedRef = _b.forwardedRef, onEnter = _b.onEnter, onEntering = _b.onEntering, onEntered = _b.onEntered, onExit = _b.onExit, onExiting = _b.onExiting, onExited = _b.onExited, mountOnEnter = _b.mountOnEnter, unmountOnExit = _b.unmountOnExit, props = __rest(_b, ["className", "classNames", "visible", "timeout", "dense", "lineWrap", "position", "children", "forwardedRef", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "mountOnEnter", "unmountOnExit"]); | ||
return (react_1.default.createElement(react_transition_group_1.CSSTransition, { classNames: classNames, in: visible, timeout: timeout, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, mountOnEnter: mountOnEnter, unmountOnExit: unmountOnExit }, | ||
return (react_1.default.createElement(CSSTransition_1.default, { classNames: classNames, in: visible, timeout: timeout, onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, mountOnEnter: mountOnEnter, unmountOnExit: unmountOnExit }, | ||
react_1.default.createElement("span", __assign({}, props, { ref: forwardedRef, role: "tooltip", className: classnames_1.default(block((_a = { | ||
@@ -53,0 +53,0 @@ dense: dense, |
@@ -36,3 +36,18 @@ "use strict"; | ||
TooltipHoverModeConfig.defaultProps = defaultProps; | ||
if (process.env.NODE_ENV !== "production") { | ||
var PropTypes = void 0; | ||
try { | ||
PropTypes = require("prop-types"); | ||
} | ||
catch (e) { } | ||
if (PropTypes) { | ||
TooltipHoverModeConfig.propTypes = { | ||
enabled: PropTypes.bool, | ||
delayTimeout: PropTypes.number, | ||
defaultDelay: PropTypes.number, | ||
children: PropTypes.node.isRequired, | ||
}; | ||
} | ||
} | ||
exports.default = TooltipHoverModeConfig; | ||
//# sourceMappingURL=TooltipHoverModeConfig.js.map |
@@ -119,7 +119,5 @@ "use strict"; | ||
if (!propHandler) { | ||
// @ts-ignore | ||
result[propName] = configHandler; | ||
} | ||
else if (!configHandler) { | ||
// @ts-ignore | ||
result[propName] = propHandler; | ||
@@ -126,0 +124,0 @@ } |
@@ -7,3 +7,2 @@ "use strict"; | ||
var react_1 = require("react"); | ||
var states_1 = require("@react-md/states"); | ||
var utils_1 = require("@react-md/utils"); | ||
@@ -61,3 +60,3 @@ var constants_1 = require("./constants"); | ||
var propPosition = _a.position, defaultPosition = _a.defaultPosition, _b = _a.positionThreshold, positionThreshold = _b === void 0 ? constants_1.DEFAULT_THRESHOLD : _b, _c = _a.hoverDelay, hoverDelay = _c === void 0 ? constants_1.DEFAULT_DELAY : _c, _d = _a.touchTimeout, touchTimeout = _d === void 0 ? constants_1.DEFAULT_DELAY : _d, _e = _a.focusDelay, focusDelay = _e === void 0 ? constants_1.DEFAULT_DELAY : _e, disableHoverMode = _a.disableHoverMode, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onTouchStart = _a.onTouchStart, onTouchMove = _a.onTouchMove, onFocus = _a.onFocus, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown, onShow = _a.onShow, onHide = _a.onHide; | ||
var mode = states_1.useInteractionModeContext(); | ||
var mode = utils_1.useInteractionModeContext(); | ||
var initiated = react_1.useRef(null); | ||
@@ -64,0 +63,0 @@ var setInitiated = react_1.useCallback(function (initiatedBy) { |
{ | ||
"name": "@react-md/tooltip", | ||
"version": "2.0.0-alpha.9", | ||
"version": "2.0.0-alpha.10", | ||
"description": "Create accessible tooltips within react-md based on the material design specifications.", | ||
@@ -41,9 +41,9 @@ "scripts": { | ||
"dependencies": { | ||
"@react-md/portal": "^2.0.0-alpha.9", | ||
"@react-md/theme": "^2.0.0-alpha.9", | ||
"@react-md/transition": "^2.0.0-alpha.9", | ||
"@react-md/typography": "^2.0.0-alpha.9", | ||
"@react-md/utils": "^2.0.0-alpha.9", | ||
"@react-md/portal": "^2.0.0-alpha.10", | ||
"@react-md/theme": "^2.0.0-alpha.10", | ||
"@react-md/transition": "^2.0.0-alpha.10", | ||
"@react-md/typography": "^2.0.0-alpha.10", | ||
"@react-md/utils": "^2.0.0-alpha.10", | ||
"classnames": "^2.2.6", | ||
"react-transition-group": "^4.2.1" | ||
"react-transition-group": "^4.3.0" | ||
}, | ||
@@ -59,3 +59,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "5dc105d777dd95c5ab6b38509d9c002993bbf4b0" | ||
"gitHead": "d42497f9e2e5c6e7f37774e140a5bf80c644081d" | ||
} |
@@ -1,5 +0,3 @@ | ||
import { | ||
CSSTransitionClassNames, | ||
TransitionTimeout, | ||
} from "@react-md/transition"; | ||
import { CSSTransitionClassNames } from "react-transition-group/CSSTransition"; | ||
import { TransitionTimeout } from "@react-md/transition"; | ||
@@ -6,0 +4,0 @@ export const TOOLTIP_CLASS_NAMES: CSSTransitionClassNames = { |
@@ -8,4 +8,3 @@ import { | ||
} from "react"; | ||
import { UserInteractionMode } from "@react-md/states/types/useModeDetection"; | ||
import { useRefCache, useTimeout } from "@react-md/utils"; | ||
import { useRefCache, useTimeout, UserInteractionMode } from "@react-md/utils"; | ||
@@ -12,0 +11,0 @@ import { |
import { HTMLAttributes, useCallback, useEffect, useRef } from "react"; | ||
import { useInteractionModeContext } from "@react-md/states"; | ||
import { SimplePosition, useToggle } from "@react-md/utils"; | ||
import { | ||
SimplePosition, | ||
useToggle, | ||
useInteractionModeContext, | ||
} from "@react-md/utils"; | ||
@@ -5,0 +8,0 @@ import { DEFAULT_DELAY, DEFAULT_THRESHOLD } from "./constants"; |
import { useEffect } from "react"; | ||
import { UserInteractionMode } from "@react-md/states/types/useModeDetection"; | ||
import { useRefCache } from "@react-md/utils"; | ||
import { useRefCache, UserInteractionMode } from "@react-md/utils"; | ||
@@ -5,0 +4,0 @@ import { TooltipInitiated } from "./useHandlers"; |
@@ -1,2 +0,3 @@ | ||
import { CSSTransitionClassNames, TransitionTimeout } from "@react-md/transition"; | ||
import { CSSTransitionClassNames } from "react-transition-group/CSSTransition"; | ||
import { TransitionTimeout } from "@react-md/transition"; | ||
export declare const TOOLTIP_CLASS_NAMES: CSSTransitionClassNames; | ||
@@ -3,0 +4,0 @@ export declare const TOOLTIP_TRANSITION_TIMEOUT: TransitionTimeout; |
import React, { CSSProperties, HTMLAttributes, ReactNode } from "react"; | ||
import { CSSTransitionClassNames, TransitionProps, TransitionTimeout } from "@react-md/transition"; | ||
import { CSSTransitionClassNames } from "react-transition-group/CSSTransition"; | ||
import { OverridableTransitionProps, TransitionTimeout } from "@react-md/transition"; | ||
import { SimplePosition } from "@react-md/utils"; | ||
@@ -7,3 +8,3 @@ /** | ||
*/ | ||
export interface TooltipProps extends Pick<TransitionProps, "onEnter" | "onEntering" | "onEntered" | "onExit" | "onExiting" | "onExited" | "mountOnEnter" | "unmountOnExit">, HTMLAttributes<HTMLSpanElement> { | ||
export interface TooltipProps extends Pick<OverridableTransitionProps, "onEnter" | "onEntering" | "onEntered" | "onExit" | "onExiting" | "onExited" | "mountOnEnter" | "unmountOnExit">, HTMLAttributes<HTMLSpanElement> { | ||
/** | ||
@@ -10,0 +11,0 @@ * An id for the tooltip. This is required for accessibility and finding an element to attach |
import { CSSProperties, FC, ReactElement, ReactNode } from "react"; | ||
import { RenderConditionalPortalProps } from "@react-md/portal"; | ||
import { Omit } from "@react-md/utils"; | ||
import { TooltipProps } from "./Tooltip"; | ||
@@ -5,0 +4,0 @@ import { MergableHandlers } from "./useHandlers"; |
import { HTMLAttributes, MutableRefObject } from "react"; | ||
import { UserInteractionMode } from "@react-md/states/types/useModeDetection"; | ||
import { UserInteractionMode } from "@react-md/utils"; | ||
export declare type TooltipInitiated = UserInteractionMode | null; | ||
@@ -4,0 +4,0 @@ interface HandlersBaseOptions { |
@@ -1,2 +0,2 @@ | ||
import { UserInteractionMode } from "@react-md/states/types/useModeDetection"; | ||
import { UserInteractionMode } from "@react-md/utils"; | ||
import { TooltipInitiated } from "./useHandlers"; | ||
@@ -3,0 +3,0 @@ export interface VisibilityChangeOptions { |
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 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 not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
239701
4044
6