@instructure/ui-tooltip 8.56.2-pr-snapshot-1721749364069 → 8.56.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/lib/Tooltip/TooltipLocator.js +3 -3
- package/lib/Tooltip/index.js +14 -9
- package/lib/Tooltip/props.js +6 -6
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [8.56.2
|
|
6
|
+
## [8.56.2](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2) (2024-08-06)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-tooltip
|
|
9
9
|
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.customMethods = exports.TooltipLocator = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
8
8
|
var _uiTestQueries = require("@instructure/ui-test-queries");
|
|
9
|
-
var _PopoverLocator = require("@instructure/ui-popover/
|
|
9
|
+
var _PopoverLocator = require("@instructure/ui-popover/lib/Popover/PopoverLocator");
|
|
10
10
|
var _index = require("./index");
|
|
11
11
|
/*
|
|
12
12
|
* The MIT License (MIT)
|
|
@@ -51,4 +51,4 @@ const customMethods = exports.customMethods = {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
54
|
-
const TooltipLocator = exports.TooltipLocator = (0,
|
|
54
|
+
const TooltipLocator = exports.TooltipLocator = (0, _locator.locator)(_index.Tooltip.selector, customMethods);
|
package/lib/Tooltip/index.js
CHANGED
|
@@ -7,9 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.Tooltip = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
10
|
+
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
11
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
12
|
+
var _ensureSingleChild = require("@instructure/ui-react-utils/lib/ensureSingleChild.js");
|
|
13
|
+
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
14
|
+
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
15
|
+
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
16
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
17
|
+
var _Popover = require("@instructure/ui-popover/lib/Popover");
|
|
13
18
|
var _emotion = require("@instructure/emotion");
|
|
14
19
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
20
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -45,7 +50,7 @@ var _dec, _dec2, _dec3, _class, _class2;
|
|
|
45
50
|
category: components
|
|
46
51
|
---
|
|
47
52
|
**/
|
|
48
|
-
let Tooltip = exports.Tooltip = (_dec = (0,
|
|
53
|
+
let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Tooltip extends _react.Component {
|
|
49
54
|
constructor(props) {
|
|
50
55
|
super(props);
|
|
51
56
|
this._id = void 0;
|
|
@@ -88,8 +93,8 @@ let Tooltip = exports.Tooltip = (_dec = (0, _uiReactUtils.withDeterministicId)()
|
|
|
88
93
|
'aria-describedby': this._id
|
|
89
94
|
};
|
|
90
95
|
if (as) {
|
|
91
|
-
const Trigger = (0,
|
|
92
|
-
const props = (0,
|
|
96
|
+
const Trigger = (0, _getElementType.getElementType)(Tooltip, this.props);
|
|
97
|
+
const props = (0, _omitProps.omitProps)(this.props, Tooltip.allowedProps);
|
|
93
98
|
return (0, _emotion.jsx)(Trigger, Object.assign({}, props, triggerProps), children /*TODO check if it can be TooltipRenderChildren, this might cause a crash*/);
|
|
94
99
|
} else if (typeof children === 'function') {
|
|
95
100
|
return children({
|
|
@@ -100,7 +105,7 @@ let Tooltip = exports.Tooltip = (_dec = (0, _uiReactUtils.withDeterministicId)()
|
|
|
100
105
|
})
|
|
101
106
|
});
|
|
102
107
|
} else {
|
|
103
|
-
return (0,
|
|
108
|
+
return (0, _ensureSingleChild.ensureSingleChild)(children, triggerProps);
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
111
|
render() {
|
|
@@ -120,7 +125,7 @@ let Tooltip = exports.Tooltip = (_dec = (0, _uiReactUtils.withDeterministicId)()
|
|
|
120
125
|
onHideContent = _this$props3.onHideContent,
|
|
121
126
|
styles = _this$props3.styles,
|
|
122
127
|
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
123
|
-
return (0, _emotion.jsx)(
|
|
128
|
+
return (0, _emotion.jsx)(_Popover.Popover, Object.assign({}, (0, _passthroughProps.passthroughProps)(rest), {
|
|
124
129
|
isShowingContent: isShowingContent,
|
|
125
130
|
defaultIsShowingContent: defaultIsShowingContent,
|
|
126
131
|
on: on,
|
|
@@ -145,7 +150,7 @@ let Tooltip = exports.Tooltip = (_dec = (0, _uiReactUtils.withDeterministicId)()
|
|
|
145
150
|
id: this._id,
|
|
146
151
|
css: styles === null || styles === void 0 ? void 0 : styles.tooltip,
|
|
147
152
|
role: "tooltip"
|
|
148
|
-
}, (0,
|
|
153
|
+
}, (0, _callRenderProp.callRenderProp)(renderTip)));
|
|
149
154
|
}
|
|
150
155
|
}, _class2.displayName = "Tooltip", _class2.componentId = 'Tooltip', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
|
151
156
|
defaultIsShowingContent: false,
|
package/lib/Tooltip/props.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _PositionPropTypes = require("@instructure/ui-position/lib/PositionPropTypes.js");
|
|
10
|
+
var _element = require("@instructure/ui-prop-types/lib/element.js");
|
|
11
11
|
/*
|
|
12
12
|
* The MIT License (MIT)
|
|
13
13
|
*
|
|
@@ -44,12 +44,12 @@ const propTypes = exports.propTypes = {
|
|
|
44
44
|
// eslint-disable-line react/require-default-props
|
|
45
45
|
on: _propTypes.default.oneOfType([_propTypes.default.oneOf(['click', 'hover', 'focus']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['click', 'hover', 'focus']))]),
|
|
46
46
|
color: _propTypes.default.oneOf(['primary', 'primary-inverse']),
|
|
47
|
-
placement:
|
|
48
|
-
mountNode:
|
|
49
|
-
constrain:
|
|
47
|
+
placement: _PositionPropTypes.PositionPropTypes.placement,
|
|
48
|
+
mountNode: _PositionPropTypes.PositionPropTypes.mountNode,
|
|
49
|
+
constrain: _PositionPropTypes.PositionPropTypes.constrain,
|
|
50
50
|
offsetX: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
51
51
|
offsetY: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
52
|
-
positionTarget: _propTypes.default.oneOfType([
|
|
52
|
+
positionTarget: _propTypes.default.oneOfType([_element.element, _propTypes.default.func]),
|
|
53
53
|
onShowContent: _propTypes.default.func,
|
|
54
54
|
onHideContent: _propTypes.default.func
|
|
55
55
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tooltip",
|
|
3
|
-
"version": "8.56.2
|
|
3
|
+
"version": "8.56.2",
|
|
4
4
|
"description": "A component for showing small text-only overlays on hover/focus.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,23 +24,23 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.23.2",
|
|
27
|
-
"@instructure/emotion": "8.56.2
|
|
28
|
-
"@instructure/shared-types": "8.56.2
|
|
29
|
-
"@instructure/ui-popover": "8.56.2
|
|
30
|
-
"@instructure/ui-position": "8.56.2
|
|
31
|
-
"@instructure/ui-prop-types": "8.56.2
|
|
32
|
-
"@instructure/ui-react-utils": "8.56.2
|
|
33
|
-
"@instructure/ui-testable": "8.56.2
|
|
34
|
-
"@instructure/ui-utils": "8.56.2
|
|
27
|
+
"@instructure/emotion": "8.56.2",
|
|
28
|
+
"@instructure/shared-types": "8.56.2",
|
|
29
|
+
"@instructure/ui-popover": "8.56.2",
|
|
30
|
+
"@instructure/ui-position": "8.56.2",
|
|
31
|
+
"@instructure/ui-prop-types": "8.56.2",
|
|
32
|
+
"@instructure/ui-react-utils": "8.56.2",
|
|
33
|
+
"@instructure/ui-testable": "8.56.2",
|
|
34
|
+
"@instructure/ui-utils": "8.56.2",
|
|
35
35
|
"prop-types": "^15.8.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@instructure/ui-babel-preset": "8.56.2
|
|
39
|
-
"@instructure/ui-color-utils": "8.56.2
|
|
40
|
-
"@instructure/ui-test-locator": "8.56.2
|
|
41
|
-
"@instructure/ui-test-queries": "8.56.2
|
|
42
|
-
"@instructure/ui-test-utils": "8.56.2
|
|
43
|
-
"@instructure/ui-themes": "8.56.2
|
|
38
|
+
"@instructure/ui-babel-preset": "8.56.2",
|
|
39
|
+
"@instructure/ui-color-utils": "8.56.2",
|
|
40
|
+
"@instructure/ui-test-locator": "8.56.2",
|
|
41
|
+
"@instructure/ui-test-queries": "8.56.2",
|
|
42
|
+
"@instructure/ui-test-utils": "8.56.2",
|
|
43
|
+
"@instructure/ui-themes": "8.56.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16.8 <=18"
|