@instructure/ui-tooltip 8.56.0 → 8.56.2-pr-snapshot-1721749364069
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 +16 -0
- package/lib/Tooltip/TooltipLocator.js +3 -3
- package/lib/Tooltip/index.js +9 -14
- package/lib/Tooltip/props.js +6 -6
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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-pr-snapshot-1721749364069](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2-pr-snapshot-1721749364069) (2024-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-tooltip
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.56.1](https://github.com/instructure/instructure-ui/compare/v8.56.0...v8.56.1) (2024-06-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-tooltip
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [8.56.0](https://github.com/instructure/instructure-ui/compare/v8.55.1...v8.56.0) (2024-05-06)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @instructure/ui-tooltip
|
|
@@ -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 _uiTestLocator = require("@instructure/ui-test-locator");
|
|
8
8
|
var _uiTestQueries = require("@instructure/ui-test-queries");
|
|
9
|
-
var _PopoverLocator = require("@instructure/ui-popover/
|
|
9
|
+
var _PopoverLocator = require("@instructure/ui-popover/es/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, _uiTestLocator.locator)(_index.Tooltip.selector, customMethods);
|
package/lib/Tooltip/index.js
CHANGED
|
@@ -7,14 +7,9 @@ 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
|
|
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");
|
|
10
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
11
|
+
var _uiTestable = require("@instructure/ui-testable");
|
|
12
|
+
var _uiPopover = require("@instructure/ui-popover");
|
|
18
13
|
var _emotion = require("@instructure/emotion");
|
|
19
14
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
20
15
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -50,7 +45,7 @@ var _dec, _dec2, _dec3, _class, _class2;
|
|
|
50
45
|
category: components
|
|
51
46
|
---
|
|
52
47
|
**/
|
|
53
|
-
let Tooltip = exports.Tooltip = (_dec = (0,
|
|
48
|
+
let Tooltip = exports.Tooltip = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Tooltip extends _react.Component {
|
|
54
49
|
constructor(props) {
|
|
55
50
|
super(props);
|
|
56
51
|
this._id = void 0;
|
|
@@ -93,8 +88,8 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
|
|
|
93
88
|
'aria-describedby': this._id
|
|
94
89
|
};
|
|
95
90
|
if (as) {
|
|
96
|
-
const Trigger = (0,
|
|
97
|
-
const props = (0,
|
|
91
|
+
const Trigger = (0, _uiReactUtils.getElementType)(Tooltip, this.props);
|
|
92
|
+
const props = (0, _uiReactUtils.omitProps)(this.props, Tooltip.allowedProps);
|
|
98
93
|
return (0, _emotion.jsx)(Trigger, Object.assign({}, props, triggerProps), children /*TODO check if it can be TooltipRenderChildren, this might cause a crash*/);
|
|
99
94
|
} else if (typeof children === 'function') {
|
|
100
95
|
return children({
|
|
@@ -105,7 +100,7 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
|
|
|
105
100
|
})
|
|
106
101
|
});
|
|
107
102
|
} else {
|
|
108
|
-
return (0,
|
|
103
|
+
return (0, _uiReactUtils.ensureSingleChild)(children, triggerProps);
|
|
109
104
|
}
|
|
110
105
|
}
|
|
111
106
|
render() {
|
|
@@ -125,7 +120,7 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
|
|
|
125
120
|
onHideContent = _this$props3.onHideContent,
|
|
126
121
|
styles = _this$props3.styles,
|
|
127
122
|
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
128
|
-
return (0, _emotion.jsx)(
|
|
123
|
+
return (0, _emotion.jsx)(_uiPopover.Popover, Object.assign({}, (0, _uiReactUtils.passthroughProps)(rest), {
|
|
129
124
|
isShowingContent: isShowingContent,
|
|
130
125
|
defaultIsShowingContent: defaultIsShowingContent,
|
|
131
126
|
on: on,
|
|
@@ -150,7 +145,7 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
|
|
|
150
145
|
id: this._id,
|
|
151
146
|
css: styles === null || styles === void 0 ? void 0 : styles.tooltip,
|
|
152
147
|
role: "tooltip"
|
|
153
|
-
}, (0,
|
|
148
|
+
}, (0, _uiReactUtils.callRenderProp)(renderTip)));
|
|
154
149
|
}
|
|
155
150
|
}, _class2.displayName = "Tooltip", _class2.componentId = 'Tooltip', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
|
156
151
|
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 _uiPosition = require("@instructure/ui-position");
|
|
10
|
+
var _uiPropTypes = require("@instructure/ui-prop-types");
|
|
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: _uiPosition.PositionPropTypes.placement,
|
|
48
|
+
mountNode: _uiPosition.PositionPropTypes.mountNode,
|
|
49
|
+
constrain: _uiPosition.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([_uiPropTypes.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.
|
|
3
|
+
"version": "8.56.2-pr-snapshot-1721749364069",
|
|
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.
|
|
28
|
-
"@instructure/shared-types": "8.56.
|
|
29
|
-
"@instructure/ui-popover": "8.56.
|
|
30
|
-
"@instructure/ui-position": "8.56.
|
|
31
|
-
"@instructure/ui-prop-types": "8.56.
|
|
32
|
-
"@instructure/ui-react-utils": "8.56.
|
|
33
|
-
"@instructure/ui-testable": "8.56.
|
|
34
|
-
"@instructure/ui-utils": "8.56.
|
|
27
|
+
"@instructure/emotion": "8.56.2-pr-snapshot-1721749364069",
|
|
28
|
+
"@instructure/shared-types": "8.56.2-pr-snapshot-1721749364069",
|
|
29
|
+
"@instructure/ui-popover": "8.56.2-pr-snapshot-1721749364069",
|
|
30
|
+
"@instructure/ui-position": "8.56.2-pr-snapshot-1721749364069",
|
|
31
|
+
"@instructure/ui-prop-types": "8.56.2-pr-snapshot-1721749364069",
|
|
32
|
+
"@instructure/ui-react-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
33
|
+
"@instructure/ui-testable": "8.56.2-pr-snapshot-1721749364069",
|
|
34
|
+
"@instructure/ui-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
35
35
|
"prop-types": "^15.8.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@instructure/ui-babel-preset": "8.56.
|
|
39
|
-
"@instructure/ui-color-utils": "8.56.
|
|
40
|
-
"@instructure/ui-test-locator": "8.56.
|
|
41
|
-
"@instructure/ui-test-queries": "8.56.
|
|
42
|
-
"@instructure/ui-test-utils": "8.56.
|
|
43
|
-
"@instructure/ui-themes": "8.56.
|
|
38
|
+
"@instructure/ui-babel-preset": "8.56.2-pr-snapshot-1721749364069",
|
|
39
|
+
"@instructure/ui-color-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
40
|
+
"@instructure/ui-test-locator": "8.56.2-pr-snapshot-1721749364069",
|
|
41
|
+
"@instructure/ui-test-queries": "8.56.2-pr-snapshot-1721749364069",
|
|
42
|
+
"@instructure/ui-test-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
43
|
+
"@instructure/ui-themes": "8.56.2-pr-snapshot-1721749364069"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16.8 <=18"
|