@vx/tooltip
Advanced tools
Comparing version 0.0.195 to 0.0.196
@@ -11,7 +11,3 @@ function _extends() { _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; }; return _extends.apply(this, arguments); } | ||
}), | ||
_useState$ = _useState[0], | ||
tooltipOpen = _useState$.tooltipOpen, | ||
tooltipLeft = _useState$.tooltipLeft, | ||
tooltipTop = _useState$.tooltipTop, | ||
tooltipData = _useState$.tooltipData, | ||
tooltipState = _useState[0], | ||
setTooltipState = _useState[1]; | ||
@@ -56,6 +52,6 @@ | ||
return { | ||
tooltipOpen: tooltipOpen, | ||
tooltipLeft: tooltipLeft, | ||
tooltipTop: tooltipTop, | ||
tooltipData: tooltipData, | ||
tooltipOpen: tooltipState.tooltipOpen, | ||
tooltipLeft: tooltipState.tooltipLeft, | ||
tooltipTop: tooltipState.tooltipTop, | ||
tooltipData: tooltipState.tooltipData, | ||
updateTooltip: updateTooltip, | ||
@@ -62,0 +58,0 @@ showTooltip: showTooltip, |
export { default as withTooltip } from './enhancers/withTooltip'; | ||
export { default as useTooltip } from './hooks/useTooltip'; | ||
export { default as Tooltip } from './tooltips/Tooltip'; | ||
export { default as Tooltip, defaultStyles } from './tooltips/Tooltip'; | ||
export { default as TooltipWithBounds } from './tooltips/TooltipWithBounds'; |
@@ -9,2 +9,13 @@ import _pt from "prop-types"; | ||
import cx from 'classnames'; | ||
export var defaultStyles = { | ||
position: 'absolute', | ||
backgroundColor: 'white', | ||
color: '#666666', | ||
padding: '.3rem .5rem', | ||
borderRadius: '3px', | ||
fontSize: '14px', | ||
boxShadow: '0 1px 2px rgba(33,33,33,0.2)', | ||
lineHeight: '1em', | ||
pointerEvents: 'none' | ||
}; | ||
export default function Tooltip(_ref) { | ||
@@ -14,5 +25,8 @@ var className = _ref.className, | ||
left = _ref.left, | ||
style = _ref.style, | ||
_ref$style = _ref.style, | ||
style = _ref$style === void 0 ? defaultStyles : _ref$style, | ||
children = _ref.children, | ||
restProps = _objectWithoutPropertiesLoose(_ref, ["className", "top", "left", "style", "children"]); | ||
_ref$unstyled = _ref.unstyled, | ||
unstyled = _ref$unstyled === void 0 ? false : _ref$unstyled, | ||
restProps = _objectWithoutPropertiesLoose(_ref, ["className", "top", "left", "style", "children", "unstyled"]); | ||
@@ -22,14 +36,5 @@ return React.createElement("div", _extends({ | ||
style: _extends({ | ||
position: 'absolute', | ||
backgroundColor: 'white', | ||
color: '#666666', | ||
padding: '.3rem .5rem', | ||
borderRadius: '3px', | ||
fontSize: '14px', | ||
boxShadow: '0 1px 2px rgba(33,33,33,0.2)', | ||
lineHeight: '1em', | ||
pointerEvents: 'none', | ||
top: top, | ||
left: left | ||
}, style) | ||
}, !unstyled && style) | ||
}, restProps), children); | ||
@@ -41,3 +46,4 @@ } | ||
className: _pt.string, | ||
children: _pt.node | ||
children: _pt.node, | ||
unstyled: _pt.bool | ||
}; |
@@ -7,4 +7,3 @@ import _pt from "prop-types"; | ||
import React from 'react'; // @ts-ignore This line could be removed after bounds migration to the TS | ||
import React from 'react'; | ||
import { withBoundingRects } from '@vx/bounds'; | ||
@@ -11,0 +10,0 @@ import Tooltip from './Tooltip'; |
@@ -21,7 +21,3 @@ "use strict"; | ||
}), | ||
_useState$ = _useState[0], | ||
tooltipOpen = _useState$.tooltipOpen, | ||
tooltipLeft = _useState$.tooltipLeft, | ||
tooltipTop = _useState$.tooltipTop, | ||
tooltipData = _useState$.tooltipData, | ||
tooltipState = _useState[0], | ||
setTooltipState = _useState[1]; | ||
@@ -66,6 +62,6 @@ | ||
return { | ||
tooltipOpen: tooltipOpen, | ||
tooltipLeft: tooltipLeft, | ||
tooltipTop: tooltipTop, | ||
tooltipData: tooltipData, | ||
tooltipOpen: tooltipState.tooltipOpen, | ||
tooltipLeft: tooltipState.tooltipLeft, | ||
tooltipTop: tooltipState.tooltipTop, | ||
tooltipData: tooltipState.tooltipData, | ||
updateTooltip: updateTooltip, | ||
@@ -72,0 +68,0 @@ showTooltip: showTooltip, |
export { default as withTooltip } from './enhancers/withTooltip'; | ||
export { default as useTooltip } from './hooks/useTooltip'; | ||
export { default as Tooltip } from './tooltips/Tooltip'; | ||
export { default as Tooltip, defaultStyles } from './tooltips/Tooltip'; | ||
export { default as TooltipWithBounds } from './tooltips/TooltipWithBounds'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
exports.__esModule = true; | ||
exports.TooltipWithBounds = exports.Tooltip = exports.useTooltip = exports.withTooltip = void 0; | ||
exports.defaultStyles = exports.TooltipWithBounds = exports.Tooltip = exports.useTooltip = exports.withTooltip = void 0; | ||
@@ -14,5 +14,6 @@ var _withTooltip = _interopRequireDefault(require("./enhancers/withTooltip")); | ||
var _Tooltip = _interopRequireDefault(require("./tooltips/Tooltip")); | ||
var _Tooltip = _interopRequireWildcard(require("./tooltips/Tooltip")); | ||
exports.Tooltip = _Tooltip.default; | ||
exports.defaultStyles = _Tooltip.defaultStyles; | ||
@@ -23,2 +24,6 @@ var _TooltipWithBounds = _interopRequireDefault(require("./tooltips/TooltipWithBounds")); | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -8,4 +8,6 @@ import React from 'react'; | ||
children?: React.ReactNode; | ||
unstyled?: boolean; | ||
}; | ||
export default function Tooltip({ className, top, left, style, children, ...restProps }: TooltipProps & JSX.IntrinsicElements['div']): JSX.Element; | ||
export declare const defaultStyles: React.CSSProperties; | ||
export default function Tooltip({ className, top, left, style, children, unstyled, ...restProps }: TooltipProps & JSX.IntrinsicElements['div']): JSX.Element; | ||
//# sourceMappingURL=Tooltip.d.ts.map |
@@ -5,2 +5,3 @@ "use strict"; | ||
exports.default = Tooltip; | ||
exports.defaultStyles = void 0; | ||
@@ -19,2 +20,15 @@ var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var defaultStyles = { | ||
position: 'absolute', | ||
backgroundColor: 'white', | ||
color: '#666666', | ||
padding: '.3rem .5rem', | ||
borderRadius: '3px', | ||
fontSize: '14px', | ||
boxShadow: '0 1px 2px rgba(33,33,33,0.2)', | ||
lineHeight: '1em', | ||
pointerEvents: 'none' | ||
}; | ||
exports.defaultStyles = defaultStyles; | ||
function Tooltip(_ref) { | ||
@@ -24,5 +38,8 @@ var className = _ref.className, | ||
left = _ref.left, | ||
style = _ref.style, | ||
_ref$style = _ref.style, | ||
style = _ref$style === void 0 ? defaultStyles : _ref$style, | ||
children = _ref.children, | ||
restProps = _objectWithoutPropertiesLoose(_ref, ["className", "top", "left", "style", "children"]); | ||
_ref$unstyled = _ref.unstyled, | ||
unstyled = _ref$unstyled === void 0 ? false : _ref$unstyled, | ||
restProps = _objectWithoutPropertiesLoose(_ref, ["className", "top", "left", "style", "children", "unstyled"]); | ||
@@ -32,14 +49,5 @@ return _react.default.createElement("div", _extends({ | ||
style: _extends({ | ||
position: 'absolute', | ||
backgroundColor: 'white', | ||
color: '#666666', | ||
padding: '.3rem .5rem', | ||
borderRadius: '3px', | ||
fontSize: '14px', | ||
boxShadow: '0 1px 2px rgba(33,33,33,0.2)', | ||
lineHeight: '1em', | ||
pointerEvents: 'none', | ||
top: top, | ||
left: left | ||
}, style) | ||
}, !unstyled && style) | ||
}, restProps), children); | ||
@@ -52,3 +60,4 @@ } | ||
className: _propTypes.default.string, | ||
children: _propTypes.default.node | ||
children: _propTypes.default.node, | ||
unstyled: _propTypes.default.bool | ||
}; |
@@ -33,3 +33,3 @@ import React from 'react'; | ||
context: any; | ||
setState<K extends never>(state: {} | Pick<{}, K> | ((prevState: Readonly<{}>, props: Readonly<Props>) => {} | Pick<{}, K> | null) | null, callback?: (() => void) | undefined): void; | ||
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Props>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; | ||
forceUpdate(callback?: (() => void) | undefined): void; | ||
@@ -36,0 +36,0 @@ readonly props: Readonly<Props> & Readonly<{ |
{ | ||
"name": "@vx/tooltip", | ||
"version": "0.0.195", | ||
"version": "0.0.196", | ||
"description": "vx tooltip", | ||
@@ -33,3 +33,3 @@ "sideEffects": false, | ||
"@types/react": "*", | ||
"@vx/bounds": "0.0.195", | ||
"@vx/bounds": "0.0.196", | ||
"classnames": "^2.2.5", | ||
@@ -44,3 +44,3 @@ "prop-types": "^15.5.10" | ||
}, | ||
"gitHead": "217be78e66c2ff2920f69ebd0a1d6b50b7edbfd8" | ||
"gitHead": "0b9ff48c735be9a9273f38750120e7fe2fb2caaf" | ||
} |
@@ -56,2 +56,3 @@ # @vx/tooltip | ||
| children | node | -- | Sets the children of the tooltip, i.e., the actual content | | ||
| unstyled | bool | true | Whether the tooltip use styles from the style prop or not | | ||
@@ -58,0 +59,0 @@ #### TooltipWithBounds |
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
38846
501
180
+ Added@vx/bounds@0.0.196(transitive)
- Removed@vx/bounds@0.0.195(transitive)
Updated@vx/bounds@0.0.196