@instructure/ui-tooltip 11.7.3-snapshot-25 → 11.7.3-snapshot-27
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 +5 -2
- package/es/Tooltip/v1/index.js +61 -57
- package/es/Tooltip/v1/theme.js +8 -6
- package/es/Tooltip/v2/index.js +61 -57
- package/lib/Tooltip/v1/index.js +61 -57
- package/lib/Tooltip/v1/theme.js +8 -6
- package/lib/Tooltip/v2/index.js +61 -57
- package/package.json +12 -12
- package/tsconfig.build.tsbuildinfo +1 -1
package/lib/Tooltip/v2/index.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.Tooltip = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
|
|
11
10
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
@@ -18,8 +17,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
18
17
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
19
18
|
var _props = require("./props");
|
|
20
19
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
21
|
-
|
|
22
|
-
var _dec, _dec2, _class, _Tooltip;
|
|
20
|
+
var _dec, _dec2, _class;
|
|
23
21
|
/*
|
|
24
22
|
* The MIT License (MIT)
|
|
25
23
|
*
|
|
@@ -48,45 +46,58 @@ var _dec, _dec2, _class, _Tooltip;
|
|
|
48
46
|
category: components
|
|
49
47
|
---
|
|
50
48
|
**/
|
|
51
|
-
let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default), _dec(_class = _dec2(_class =
|
|
49
|
+
let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default), _dec(_class = _dec2(_class = class Tooltip extends _react.Component {
|
|
50
|
+
static displayName = "Tooltip";
|
|
51
|
+
static componentId = 'Tooltip';
|
|
52
|
+
static allowedProps = _props.allowedProps;
|
|
53
|
+
static defaultProps = {
|
|
54
|
+
defaultIsShowingContent: false,
|
|
55
|
+
color: 'primary',
|
|
56
|
+
placement: 'top',
|
|
57
|
+
constrain: 'window',
|
|
58
|
+
offsetX: 0,
|
|
59
|
+
offsetY: 0,
|
|
60
|
+
preventTooltip: false
|
|
61
|
+
};
|
|
62
|
+
_id;
|
|
63
|
+
ref = null;
|
|
64
|
+
handleRef = el => {
|
|
65
|
+
this.ref = el;
|
|
66
|
+
if (typeof this.props.elementRef === 'function') {
|
|
67
|
+
this.props.elementRef(el);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
52
70
|
constructor(props) {
|
|
53
71
|
super(props);
|
|
54
|
-
this._id = void 0;
|
|
55
|
-
this.ref = null;
|
|
56
|
-
this.handleRef = el => {
|
|
57
|
-
this.ref = el;
|
|
58
|
-
if (typeof this.props.elementRef === 'function') {
|
|
59
|
-
this.props.elementRef(el);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
this.handleFocus = () => {
|
|
63
|
-
this.setState({
|
|
64
|
-
hasFocus: true
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
this.handleBlur = () => {
|
|
68
|
-
this.setState({
|
|
69
|
-
hasFocus: false
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
72
|
this._id = props.deterministicId();
|
|
73
73
|
this.state = {
|
|
74
74
|
hasFocus: false
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
componentDidMount() {
|
|
78
|
-
|
|
79
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
78
|
+
this.props.makeStyles?.();
|
|
80
79
|
}
|
|
81
80
|
componentDidUpdate() {
|
|
82
|
-
|
|
83
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
81
|
+
this.props.makeStyles?.();
|
|
84
82
|
}
|
|
83
|
+
handleFocus = () => {
|
|
84
|
+
this.setState({
|
|
85
|
+
hasFocus: true
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
handleBlur = () => {
|
|
89
|
+
this.setState({
|
|
90
|
+
hasFocus: false
|
|
91
|
+
});
|
|
92
|
+
};
|
|
85
93
|
renderTrigger() {
|
|
86
|
-
const
|
|
87
|
-
children
|
|
88
|
-
as
|
|
89
|
-
|
|
94
|
+
const {
|
|
95
|
+
children,
|
|
96
|
+
as
|
|
97
|
+
} = this.props;
|
|
98
|
+
const {
|
|
99
|
+
hasFocus
|
|
100
|
+
} = this.state;
|
|
90
101
|
const triggerProps = {
|
|
91
102
|
'aria-describedby': this._id
|
|
92
103
|
};
|
|
@@ -111,23 +122,24 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
|
|
|
111
122
|
}
|
|
112
123
|
}
|
|
113
124
|
render() {
|
|
114
|
-
const
|
|
115
|
-
renderTip
|
|
116
|
-
isShowingContent
|
|
117
|
-
defaultIsShowingContent
|
|
118
|
-
on
|
|
119
|
-
color
|
|
120
|
-
placement
|
|
121
|
-
mountNode
|
|
122
|
-
constrain
|
|
123
|
-
offsetX
|
|
124
|
-
offsetY
|
|
125
|
-
positionTarget
|
|
126
|
-
onShowContent
|
|
127
|
-
onHideContent
|
|
128
|
-
preventTooltip
|
|
129
|
-
styles
|
|
130
|
-
rest
|
|
125
|
+
const {
|
|
126
|
+
renderTip,
|
|
127
|
+
isShowingContent,
|
|
128
|
+
defaultIsShowingContent,
|
|
129
|
+
on,
|
|
130
|
+
color,
|
|
131
|
+
placement,
|
|
132
|
+
mountNode,
|
|
133
|
+
constrain,
|
|
134
|
+
offsetX,
|
|
135
|
+
offsetY,
|
|
136
|
+
positionTarget,
|
|
137
|
+
onShowContent,
|
|
138
|
+
onHideContent,
|
|
139
|
+
preventTooltip,
|
|
140
|
+
styles,
|
|
141
|
+
...rest
|
|
142
|
+
} = this.props;
|
|
131
143
|
return (0, _jsxRuntime.jsx)(_latest.Popover, {
|
|
132
144
|
...(0, _passthroughProps.passthroughProps)(rest),
|
|
133
145
|
isShowingContent: !preventTooltip && isShowingContent,
|
|
@@ -155,19 +167,11 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
|
|
|
155
167
|
"data-cid": "Tooltip",
|
|
156
168
|
children: !preventTooltip ? (0, _jsxRuntime.jsx)("span", {
|
|
157
169
|
id: this._id,
|
|
158
|
-
css: styles
|
|
170
|
+
css: styles?.tooltip,
|
|
159
171
|
role: "tooltip",
|
|
160
172
|
children: (0, _callRenderProp.callRenderProp)(renderTip)
|
|
161
173
|
}) : null
|
|
162
174
|
});
|
|
163
175
|
}
|
|
164
|
-
}
|
|
165
|
-
defaultIsShowingContent: false,
|
|
166
|
-
color: 'primary',
|
|
167
|
-
placement: 'top',
|
|
168
|
-
constrain: 'window',
|
|
169
|
-
offsetX: 0,
|
|
170
|
-
offsetY: 0,
|
|
171
|
-
preventTooltip: false
|
|
172
|
-
}, _Tooltip)) || _class) || _class);
|
|
176
|
+
}) || _class) || _class);
|
|
173
177
|
var _default = exports.default = Tooltip;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tooltip",
|
|
3
|
-
"version": "11.7.3-snapshot-
|
|
3
|
+
"version": "11.7.3-snapshot-27",
|
|
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",
|
|
@@ -14,23 +14,23 @@
|
|
|
14
14
|
"bugs": "https://github.com/instructure/instructure-ui/issues",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@babel/runtime": "^7.
|
|
18
|
-
"@instructure/emotion": "11.7.3-snapshot-
|
|
19
|
-
"@instructure/
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/ui-
|
|
22
|
-
"@instructure/ui-
|
|
23
|
-
"@instructure/ui-
|
|
24
|
-
"@instructure/ui-
|
|
17
|
+
"@babel/runtime": "^7.29.2",
|
|
18
|
+
"@instructure/emotion": "11.7.3-snapshot-27",
|
|
19
|
+
"@instructure/shared-types": "11.7.3-snapshot-27",
|
|
20
|
+
"@instructure/ui-popover": "11.7.3-snapshot-27",
|
|
21
|
+
"@instructure/ui-react-utils": "11.7.3-snapshot-27",
|
|
22
|
+
"@instructure/ui-position": "11.7.3-snapshot-27",
|
|
23
|
+
"@instructure/ui-utils": "11.7.3-snapshot-27",
|
|
24
|
+
"@instructure/ui-themes": "11.7.3-snapshot-27"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@testing-library/jest-dom": "^6.6.3",
|
|
28
28
|
"@testing-library/react": "15.0.7",
|
|
29
29
|
"@testing-library/user-event": "^14.6.1",
|
|
30
30
|
"vitest": "^3.2.2",
|
|
31
|
-
"@instructure/ui-
|
|
32
|
-
"@instructure/ui-
|
|
33
|
-
"@instructure/ui-color-utils": "11.7.3-snapshot-
|
|
31
|
+
"@instructure/ui-scripts": "11.7.3-snapshot-27",
|
|
32
|
+
"@instructure/ui-babel-preset": "11.7.3-snapshot-27",
|
|
33
|
+
"@instructure/ui-color-utils": "11.7.3-snapshot-27"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": ">=18 <=19"
|