@instructure/ui-tooltip
Advanced tools
Comparing version 6.14.1-rc.5 to 6.14.1-rc.6
@@ -36,3 +36,3 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
import PropTypes from 'prop-types'; | ||
import { getElementType, omitProps, ensureSingleChild, passthroughProps, callRenderProp, experimental } from '@instructure/ui-react-utils'; | ||
import { getElementType, omitProps, ensureSingleChild, passthroughProps, callRenderProp, deprecated } from '@instructure/ui-react-utils'; | ||
import { LayoutPropTypes } from '@instructure/ui-layout'; | ||
@@ -54,7 +54,9 @@ import { uid } from '@instructure/uid'; | ||
category: components | ||
experimental: true | ||
--- | ||
**/ | ||
var Tooltip = (_dec = testable(), _dec2 = experimental(), _dec3 = themeable(theme, styles), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = | ||
var Tooltip = (_dec = deprecated('8.0.0', { | ||
tip: 'renderTip', | ||
variant: 'color' | ||
}), _dec2 = testable(), _dec3 = themeable(theme, styles), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = | ||
/*#__PURE__*/ | ||
@@ -133,3 +135,2 @@ function (_Component) { | ||
placement = _this$props2.placement, | ||
color = _this$props2.color, | ||
mountNode = _this$props2.mountNode, | ||
@@ -141,4 +142,14 @@ constrain = _this$props2.constrain, | ||
onRequestHideContent = _this$props2.onRequestHideContent, | ||
rest = _objectWithoutProperties(_this$props2, ["renderTip", "isShowingContent", "defaultIsShowingContent", "on", "placement", "color", "mountNode", "constrain", "offsetX", "offsetY", "onRequestShowContent", "onRequestHideContent"]); | ||
tip = _this$props2.tip, | ||
variant = _this$props2.variant, | ||
rest = _objectWithoutProperties(_this$props2, ["renderTip", "isShowingContent", "defaultIsShowingContent", "on", "placement", "mountNode", "constrain", "offsetX", "offsetY", "onRequestShowContent", "onRequestHideContent", "tip", "variant"]); | ||
var color = this.props.variant; | ||
if (color) { | ||
color = color === 'default' ? 'primary-inverse' : 'primary'; | ||
} else { | ||
color = this.props.color; | ||
} | ||
return React.createElement(Popover, Object.assign({}, passthroughProps(rest), { | ||
@@ -168,3 +179,3 @@ isShowingContent: isShowingContent, | ||
role: "tooltip" | ||
}, callRenderProp(renderTip))); | ||
}, renderTip ? callRenderProp(renderTip) : tip)); | ||
} | ||
@@ -182,5 +193,9 @@ }]); | ||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, | ||
renderTip: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, | ||
/** | ||
* The content to render in the tooltip | ||
*/ | ||
renderTip: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
/** | ||
* Whether or not the tooltip content is shown, when controlled | ||
@@ -252,4 +267,19 @@ */ | ||
*/ | ||
onRequestHideContent: PropTypes.func | ||
onRequestHideContent: PropTypes.func, | ||
/* eslint-disable react/require-default-props */ | ||
/** | ||
* __Deprecated - use `renderTip`__ | ||
*/ | ||
tip: PropTypes.node, | ||
/** | ||
* __Deprecated - use `color`__ | ||
*/ | ||
variant: PropTypes.oneOf(['default', 'inverse']) | ||
/* eslint-enable react/require-default-props */ | ||
}, _class2.defaultProps = { | ||
renderTip: void 0, | ||
isShowingContent: void 0, | ||
@@ -256,0 +286,0 @@ defaultIsShowingContent: false, |
@@ -40,3 +40,3 @@ "use strict"; | ||
var _experimental = require("@instructure/ui-react-utils/lib/experimental"); | ||
var _deprecated = require("@instructure/ui-react-utils/lib/deprecated"); | ||
@@ -68,6 +68,8 @@ var _LayoutPropTypes = require("@instructure/ui-layout/lib/LayoutPropTypes"); | ||
category: components | ||
experimental: true | ||
--- | ||
**/ | ||
var Tooltip = (_dec = (0, _testable.testable)(), _dec2 = (0, _experimental.experimental)(), _dec3 = (0, _themeable.themeable)(_theme.default, styles), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = | ||
var Tooltip = (_dec = (0, _deprecated.deprecated)('8.0.0', { | ||
tip: 'renderTip', | ||
variant: 'color' | ||
}), _dec2 = (0, _testable.testable)(), _dec3 = (0, _themeable.themeable)(_theme.default, styles), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = | ||
/*#__PURE__*/ | ||
@@ -146,3 +148,2 @@ function (_Component) { | ||
placement = _this$props2.placement, | ||
color = _this$props2.color, | ||
mountNode = _this$props2.mountNode, | ||
@@ -154,3 +155,13 @@ constrain = _this$props2.constrain, | ||
onRequestHideContent = _this$props2.onRequestHideContent, | ||
rest = (0, _objectWithoutProperties2.default)(_this$props2, ["renderTip", "isShowingContent", "defaultIsShowingContent", "on", "placement", "color", "mountNode", "constrain", "offsetX", "offsetY", "onRequestShowContent", "onRequestHideContent"]); | ||
tip = _this$props2.tip, | ||
variant = _this$props2.variant, | ||
rest = (0, _objectWithoutProperties2.default)(_this$props2, ["renderTip", "isShowingContent", "defaultIsShowingContent", "on", "placement", "mountNode", "constrain", "offsetX", "offsetY", "onRequestShowContent", "onRequestHideContent", "tip", "variant"]); | ||
var color = this.props.variant; | ||
if (color) { | ||
color = color === 'default' ? 'primary-inverse' : 'primary'; | ||
} else { | ||
color = this.props.color; | ||
} | ||
return _react.default.createElement(_Popover.Popover, Object.assign({}, (0, _passthroughProps.passthroughProps)(rest), { | ||
@@ -180,3 +191,3 @@ isShowingContent: isShowingContent, | ||
role: "tooltip" | ||
}, (0, _callRenderProp.callRenderProp)(renderTip))); | ||
}, renderTip ? (0, _callRenderProp.callRenderProp)(renderTip) : tip)); | ||
} | ||
@@ -193,5 +204,9 @@ }]); | ||
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired, | ||
renderTip: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired, | ||
/** | ||
* The content to render in the tooltip | ||
*/ | ||
renderTip: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]), | ||
/** | ||
* Whether or not the tooltip content is shown, when controlled | ||
@@ -263,4 +278,19 @@ */ | ||
*/ | ||
onRequestHideContent: _propTypes.default.func | ||
onRequestHideContent: _propTypes.default.func, | ||
/* eslint-disable react/require-default-props */ | ||
/** | ||
* __Deprecated - use `renderTip`__ | ||
*/ | ||
tip: _propTypes.default.node, | ||
/** | ||
* __Deprecated - use `color`__ | ||
*/ | ||
variant: _propTypes.default.oneOf(['default', 'inverse']) | ||
/* eslint-enable react/require-default-props */ | ||
}, _class2.defaultProps = { | ||
renderTip: void 0, | ||
isShowingContent: void 0, | ||
@@ -267,0 +297,0 @@ defaultIsShowingContent: false, |
{ | ||
"name": "@instructure/ui-tooltip", | ||
"version": "6.14.1-rc.5+d9437ae04", | ||
"version": "6.14.1-rc.6+7608e7c75", | ||
"description": "A component for showing small text-only overlays on hover/focus.", | ||
@@ -24,5 +24,5 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"@babel/runtime": "^7.5.0", | ||
"@instructure/ui-react-utils": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/ui-testable": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/ui-themeable": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/ui-react-utils": "6.14.1-rc.6+7608e7c75", | ||
"@instructure/ui-testable": "6.14.1-rc.6+7608e7c75", | ||
"@instructure/ui-themeable": "6.14.1-rc.6+7608e7c75", | ||
"prop-types": "^15", | ||
@@ -32,10 +32,10 @@ "react": "^15 || ^16" | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/ui-color-utils": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/ui-layout": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/ui-popover": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/ui-prop-types": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/ui-babel-preset": "6.14.1-rc.6+7608e7c75", | ||
"@instructure/ui-color-utils": "6.14.1-rc.6+7608e7c75", | ||
"@instructure/ui-layout": "6.14.1-rc.6+7608e7c75", | ||
"@instructure/ui-popover": "6.14.1-rc.6+7608e7c75", | ||
"@instructure/ui-prop-types": "6.14.1-rc.6+7608e7c75", | ||
"@instructure/ui-react-utils": "^6.13.0", | ||
"@instructure/ui-test-utils": "6.14.1-rc.5+d9437ae04", | ||
"@instructure/uid": "6.14.1-rc.5+d9437ae04" | ||
"@instructure/ui-test-utils": "6.14.1-rc.6+7608e7c75", | ||
"@instructure/uid": "6.14.1-rc.6+7608e7c75" | ||
}, | ||
@@ -46,3 +46,3 @@ "publishConfig": { | ||
"sideEffects": false, | ||
"gitHead": "d9437ae042d32a7528101fbb60d2c9fbf74ae610" | ||
"gitHead": "7608e7c752441e3305e231873909aeab85522c16" | ||
} |
@@ -34,3 +34,3 @@ /* | ||
callRenderProp, | ||
experimental | ||
deprecated | ||
} from '@instructure/ui-react-utils' | ||
@@ -49,7 +49,9 @@ import { LayoutPropTypes } from '@instructure/ui-layout' | ||
category: components | ||
experimental: true | ||
--- | ||
**/ | ||
@deprecated('8.0.0', { | ||
tip: 'renderTip', | ||
variant: 'color' | ||
}) | ||
@testable() | ||
@experimental() | ||
@themeable(theme, styles) | ||
@@ -64,4 +66,7 @@ class Tooltip extends Component { | ||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, | ||
renderTip: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, | ||
/** | ||
* The content to render in the tooltip | ||
*/ | ||
renderTip: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
/** | ||
* Whether or not the tooltip content is shown, when controlled | ||
@@ -124,6 +129,18 @@ */ | ||
*/ | ||
onRequestHideContent: PropTypes.func | ||
onRequestHideContent: PropTypes.func, | ||
/* eslint-disable react/require-default-props */ | ||
/** | ||
* __Deprecated - use `renderTip`__ | ||
*/ | ||
tip: PropTypes.node, | ||
/** | ||
* __Deprecated - use `color`__ | ||
*/ | ||
variant: PropTypes.oneOf(['default', 'inverse']) | ||
/* eslint-enable react/require-default-props */ | ||
} | ||
static defaultProps = { | ||
renderTip: undefined, | ||
isShowingContent: undefined, | ||
@@ -192,3 +209,2 @@ defaultIsShowingContent: false, | ||
placement, | ||
color, | ||
mountNode, | ||
@@ -200,5 +216,14 @@ constrain, | ||
onRequestHideContent, | ||
tip, | ||
variant, | ||
...rest | ||
} = this.props | ||
let color = this.props.variant | ||
if (color) { | ||
color = color === 'default' ? 'primary-inverse' : 'primary' | ||
} else { | ||
color = this.props.color | ||
} | ||
return ( | ||
@@ -230,3 +255,3 @@ <Popover | ||
> | ||
{ callRenderProp(renderTip) } | ||
{ renderTip ? callRenderProp(renderTip) : tip } | ||
</span> | ||
@@ -233,0 +258,0 @@ </Popover> |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
49101
1039