@instructure/ui-tooltip 10.13.0 → 10.13.1-pr-snapshot-1741357986437
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
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [10.13.1-pr-snapshot-1741357986437](https://github.com/instructure/instructure-ui/compare/v10.13.0...v10.13.1-pr-snapshot-1741357986437) (2025-03-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-tooltip
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [10.13.0](https://github.com/instructure/instructure-ui/compare/v10.12.0...v10.13.0) (2025-03-06)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -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)
|
|
@@ -50,4 +50,4 @@ const customMethods = exports.customMethods = {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
// @ts-ignore: Property 'selector' does not exist type Tooltip
|
|
53
|
-
const TooltipLocator = exports.TooltipLocator = (0,
|
|
53
|
+
const TooltipLocator = exports.TooltipLocator = (0, _uiTestLocator.locator)(_index.Tooltip.selector, customMethods);
|
|
@@ -7,7 +7,7 @@ var _vitest = require("vitest");
|
|
|
7
7
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
8
8
|
require("@testing-library/jest-dom");
|
|
9
9
|
var _generateA11yTests = require("@instructure/ui-scripts/lib/test/generateA11yTests");
|
|
10
|
-
var
|
|
10
|
+
var _uiAxeCheck = require("@instructure/ui-axe-check");
|
|
11
11
|
var _index = require("../index");
|
|
12
12
|
var _Tooltip7 = _interopRequireDefault(require("../__examples__/Tooltip.examples"));
|
|
13
13
|
var _Tooltip, _Tooltip2, _Tooltip3, _a, _Tooltip4, _Tooltip5, _Tooltip6, _h;
|
|
@@ -147,7 +147,7 @@ describe('<Tooltip />', () => {
|
|
|
147
147
|
it(component.description, async () => {
|
|
148
148
|
const _render = (0, _react2.render)(component.content),
|
|
149
149
|
container = _render.container;
|
|
150
|
-
const axeCheck = await (0,
|
|
150
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
151
151
|
expect(axeCheck).toBe(true);
|
|
152
152
|
});
|
|
153
153
|
}
|
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, _Tooltip;
|
|
|
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 = (_Tooltip = 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,
|
|
@@ -151,7 +146,7 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
|
|
|
151
146
|
id: this._id,
|
|
152
147
|
css: styles === null || styles === void 0 ? void 0 : styles.tooltip,
|
|
153
148
|
role: "tooltip"
|
|
154
|
-
}, (0,
|
|
149
|
+
}, (0, _uiReactUtils.callRenderProp)(renderTip)));
|
|
155
150
|
}
|
|
156
151
|
}, _Tooltip.displayName = "Tooltip", _Tooltip.componentId = 'Tooltip', _Tooltip.allowedProps = _props.allowedProps, _Tooltip.propTypes = _props.propTypes, _Tooltip.defaultProps = {
|
|
157
152
|
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
|
*
|
|
@@ -43,12 +43,12 @@ const propTypes = exports.propTypes = {
|
|
|
43
43
|
as: _propTypes.default.elementType,
|
|
44
44
|
on: _propTypes.default.oneOfType([_propTypes.default.oneOf(['click', 'hover', 'focus']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['click', 'hover', 'focus']))]),
|
|
45
45
|
color: _propTypes.default.oneOf(['primary', 'primary-inverse']),
|
|
46
|
-
placement:
|
|
47
|
-
mountNode:
|
|
48
|
-
constrain:
|
|
46
|
+
placement: _uiPosition.PositionPropTypes.placement,
|
|
47
|
+
mountNode: _uiPosition.PositionPropTypes.mountNode,
|
|
48
|
+
constrain: _uiPosition.PositionPropTypes.constrain,
|
|
49
49
|
offsetX: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
50
50
|
offsetY: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
51
|
-
positionTarget: _propTypes.default.oneOfType([
|
|
51
|
+
positionTarget: _propTypes.default.oneOfType([_uiPropTypes.element, _propTypes.default.func]),
|
|
52
52
|
onShowContent: _propTypes.default.func,
|
|
53
53
|
onHideContent: _propTypes.default.func
|
|
54
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tooltip",
|
|
3
|
-
"version": "10.13.
|
|
3
|
+
"version": "10.13.1-pr-snapshot-1741357986437",
|
|
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,25 +24,25 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.26.0",
|
|
27
|
-
"@instructure/emotion": "10.13.
|
|
28
|
-
"@instructure/shared-types": "10.13.
|
|
29
|
-
"@instructure/ui-popover": "10.13.
|
|
30
|
-
"@instructure/ui-position": "10.13.
|
|
31
|
-
"@instructure/ui-prop-types": "10.13.
|
|
32
|
-
"@instructure/ui-react-utils": "10.13.
|
|
33
|
-
"@instructure/ui-testable": "10.13.
|
|
34
|
-
"@instructure/ui-utils": "10.13.
|
|
27
|
+
"@instructure/emotion": "10.13.1-pr-snapshot-1741357986437",
|
|
28
|
+
"@instructure/shared-types": "10.13.1-pr-snapshot-1741357986437",
|
|
29
|
+
"@instructure/ui-popover": "10.13.1-pr-snapshot-1741357986437",
|
|
30
|
+
"@instructure/ui-position": "10.13.1-pr-snapshot-1741357986437",
|
|
31
|
+
"@instructure/ui-prop-types": "10.13.1-pr-snapshot-1741357986437",
|
|
32
|
+
"@instructure/ui-react-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
33
|
+
"@instructure/ui-testable": "10.13.1-pr-snapshot-1741357986437",
|
|
34
|
+
"@instructure/ui-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
35
35
|
"prop-types": "^15.8.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@instructure/ui-axe-check": "10.13.
|
|
39
|
-
"@instructure/ui-babel-preset": "10.13.
|
|
40
|
-
"@instructure/ui-color-utils": "10.13.
|
|
41
|
-
"@instructure/ui-scripts": "10.13.
|
|
42
|
-
"@instructure/ui-test-locator": "10.13.
|
|
43
|
-
"@instructure/ui-test-queries": "10.13.
|
|
44
|
-
"@instructure/ui-test-utils": "10.13.
|
|
45
|
-
"@instructure/ui-themes": "10.13.
|
|
38
|
+
"@instructure/ui-axe-check": "10.13.1-pr-snapshot-1741357986437",
|
|
39
|
+
"@instructure/ui-babel-preset": "10.13.1-pr-snapshot-1741357986437",
|
|
40
|
+
"@instructure/ui-color-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
41
|
+
"@instructure/ui-scripts": "10.13.1-pr-snapshot-1741357986437",
|
|
42
|
+
"@instructure/ui-test-locator": "10.13.1-pr-snapshot-1741357986437",
|
|
43
|
+
"@instructure/ui-test-queries": "10.13.1-pr-snapshot-1741357986437",
|
|
44
|
+
"@instructure/ui-test-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
45
|
+
"@instructure/ui-themes": "10.13.1-pr-snapshot-1741357986437",
|
|
46
46
|
"@testing-library/jest-dom": "^6.6.3",
|
|
47
47
|
"@testing-library/react": "^16.0.1",
|
|
48
48
|
"@testing-library/user-event": "^14.5.2",
|