@instructure/ui-tooltip 8.10.1 → 8.10.3-snapshot.12

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,10 @@
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.10.2](https://github.com/instructure/instructure-ui/compare/v8.10.1...v8.10.2) (2021-10-01)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-tooltip
9
+
6
10
  ## [8.10.1](https://github.com/instructure/instructure-ui/compare/v8.10.0...v8.10.1) (2021-10-01)
7
11
 
8
12
  **Note:** Version bump only for package @instructure/ui-tooltip
package/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: The MIT License (MIT)
3
+ category: Getting Started
4
+ order: 9
5
+ ---
6
+
7
+ # The MIT License (MIT)
8
+
9
+ Copyright (c) 2015 Instructure, Inc.
10
+
11
+ **Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions.**
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
@@ -50,6 +50,11 @@ let Tooltip = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
50
50
  this.state = {
51
51
  hasFocus: false
52
52
  };
53
+ this.ref = null;
54
+
55
+ this.handleRef = el => {
56
+ this.ref = el;
57
+ };
53
58
 
54
59
  this.handleFocus = event => {
55
60
  this.setState({
@@ -138,7 +143,8 @@ let Tooltip = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
138
143
  onShowContent: onShowContent,
139
144
  onHideContent: onHideContent,
140
145
  onFocus: this.handleFocus,
141
- onBlur: this.handleBlur
146
+ onBlur: this.handleBlur,
147
+ elementRef: this.handleRef
142
148
  }), jsx("span", {
143
149
  id: this._id,
144
150
  css: styles === null || styles === void 0 ? void 0 : styles.tooltip,
@@ -51,6 +51,11 @@ let Tooltip = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
51
51
  this.state = {
52
52
  hasFocus: false
53
53
  };
54
+ this.ref = null;
55
+
56
+ this.handleRef = el => {
57
+ this.ref = el;
58
+ };
54
59
 
55
60
  this.handleFocus = event => {
56
61
  this.setState({
@@ -138,7 +143,8 @@ let Tooltip = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
138
143
  onShowContent: onShowContent,
139
144
  onHideContent: onHideContent,
140
145
  onFocus: this.handleFocus,
141
- onBlur: this.handleBlur
146
+ onBlur: this.handleBlur,
147
+ elementRef: this.handleRef
142
148
  }), (0, _emotion.jsx)("span", {
143
149
  id: this._id,
144
150
  css: styles === null || styles === void 0 ? void 0 : styles.tooltip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-tooltip",
3
- "version": "8.10.1",
3
+ "version": "8.10.3-snapshot.12+af470a237",
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
  "type": "commonjs",
@@ -25,23 +25,23 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/emotion": "8.10.1",
29
- "@instructure/shared-types": "8.10.1",
30
- "@instructure/ui-popover": "8.10.1",
31
- "@instructure/ui-position": "8.10.1",
32
- "@instructure/ui-prop-types": "8.10.1",
33
- "@instructure/ui-react-utils": "8.10.1",
34
- "@instructure/ui-testable": "8.10.1",
35
- "@instructure/uid": "8.10.1",
28
+ "@instructure/emotion": "8.10.3-snapshot.12+af470a237",
29
+ "@instructure/shared-types": "8.10.3-snapshot.12+af470a237",
30
+ "@instructure/ui-popover": "8.10.3-snapshot.12+af470a237",
31
+ "@instructure/ui-position": "8.10.3-snapshot.12+af470a237",
32
+ "@instructure/ui-prop-types": "8.10.3-snapshot.12+af470a237",
33
+ "@instructure/ui-react-utils": "8.10.3-snapshot.12+af470a237",
34
+ "@instructure/ui-testable": "8.10.3-snapshot.12+af470a237",
35
+ "@instructure/uid": "8.10.3-snapshot.12+af470a237",
36
36
  "prop-types": "^15"
37
37
  },
38
38
  "devDependencies": {
39
- "@instructure/ui-babel-preset": "8.10.1",
40
- "@instructure/ui-color-utils": "8.10.1",
41
- "@instructure/ui-test-locator": "8.10.1",
42
- "@instructure/ui-test-queries": "8.10.1",
43
- "@instructure/ui-test-utils": "8.10.1",
44
- "@instructure/ui-themes": "8.10.1"
39
+ "@instructure/ui-babel-preset": "8.10.3-snapshot.12+af470a237",
40
+ "@instructure/ui-color-utils": "8.10.3-snapshot.12+af470a237",
41
+ "@instructure/ui-test-locator": "8.10.3-snapshot.12+af470a237",
42
+ "@instructure/ui-test-queries": "8.10.3-snapshot.12+af470a237",
43
+ "@instructure/ui-test-utils": "8.10.3-snapshot.12+af470a237",
44
+ "@instructure/ui-themes": "8.10.3-snapshot.12+af470a237"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": ">=16.8 <=17"
@@ -49,5 +49,6 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "sideEffects": false
52
+ "sideEffects": false,
53
+ "gitHead": "af470a2374463c265ed1304870b7890fc8bb09a4"
53
54
  }
@@ -104,7 +104,29 @@ class Example extends React.Component {
104
104
  }
105
105
 
106
106
  render(<Example />)
107
+ ```
108
+
109
+ ### Custom elements as renderTrigger
110
+
111
+ Popover and Tooltip attach mouse and focus event listeners to their render trigger components via props. These need to be propagated to the component for the listeners to work:
107
112
 
113
+ ```js
114
+ ---
115
+ example: true
116
+ ---
117
+ class MyComponent extends React.Component {
118
+ constructor(props) {
119
+ super(props)
120
+ this.ref = React.createRef()
121
+ }
122
+ render() {
123
+ // Spread the props to the underlying DOM element
124
+ return <div {...this.props} ref={this.ref} style={{width:"10rem"}}>My custom component</div>
125
+ }
126
+ }
127
+ <Tooltip renderTip="Tooltip text to display" >
128
+ <MyComponent />
129
+ </Tooltip>
108
130
  ```
109
131
 
110
132
  ### Guidelines
@@ -73,6 +73,12 @@ class Tooltip extends Component<TooltipProps> {
73
73
  _id = uid('Tooltip')
74
74
  state = { hasFocus: false }
75
75
 
76
+ ref: Element | null = null
77
+
78
+ handleRef = (el: Element | null) => {
79
+ this.ref = el
80
+ }
81
+
76
82
  componentDidMount() {
77
83
  this.props.makeStyles?.()
78
84
  }
@@ -161,8 +167,10 @@ class Tooltip extends Component<TooltipProps> {
161
167
  onHideContent={onHideContent}
162
168
  onFocus={this.handleFocus}
163
169
  onBlur={this.handleBlur}
170
+ elementRef={this.handleRef}
164
171
  >
165
172
  <span id={this._id} css={styles?.tooltip} role="tooltip">
173
+ {/* TODO: figure out how to add a ref to this */}
166
174
  {callRenderProp(renderTip)}
167
175
  </span>
168
176
  </Popover>
@@ -26,24 +26,28 @@ export declare const TooltipLocator: {
26
26
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
27
27
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
28
28
  } & {
29
+ toString: (maxLength?: number | undefined, options?: {
30
+ highlight: boolean;
31
+ } | undefined) => string;
32
+ contains: (elementOrSelector?: string | Element | undefined) => boolean | Element;
33
+ children: (selector: string) => Element[];
34
+ title: () => string | null | undefined;
35
+ id: () => string;
36
+ tagName: () => string;
37
+ getAttribute: (qualifiedName: string) => string | null;
38
+ getBoundingClientRect: () => DOMRect;
39
+ matches: (selector: string | undefined) => boolean;
29
40
  visible: () => boolean;
30
41
  value: () => string | null;
31
42
  disabled: () => string | null;
32
43
  role: () => string | null;
33
- id: () => string;
34
44
  label: () => string | null | undefined;
35
- title: () => string | null | undefined;
36
- toString: (maxLength?: number | undefined, options?: {
37
- highlight: boolean;
38
- } | undefined) => string;
39
45
  getId: () => string;
40
46
  getOwnerWindow: () => (Window & typeof globalThis) | null;
41
47
  getOwnerDocument: () => Document;
42
48
  getComputedStyle: () => CSSStyleDeclaration;
43
49
  getTagName: () => string;
44
- tagName: () => string;
45
50
  typeIn: (text: string) => Promise<void>;
46
- getAttribute: (qualifiedName: string) => string | null;
47
51
  getDOMNode: () => Element;
48
52
  node: () => Element;
49
53
  debug: (maxLength?: number | undefined, options?: {
@@ -51,9 +55,8 @@ export declare const TooltipLocator: {
51
55
  } | undefined) => void;
52
56
  accessible: (options?: Record<string, unknown> | undefined) => Promise<boolean>;
53
57
  getTextContent: () => string | null;
54
- getParentNode: () => (Node & ParentNode) | null;
55
- parent: () => (Node & ParentNode) | null;
56
- getBoundingClientRect: () => DOMRect;
58
+ getParentNode: () => ParentNode | null;
59
+ parent: () => ParentNode | null;
57
60
  rect: () => DOMRect;
58
61
  hasClass: (classname: string) => boolean;
59
62
  containsFocus: () => boolean;
@@ -65,19 +68,17 @@ export declare const TooltipLocator: {
65
68
  exists: () => boolean;
66
69
  text: () => string | null;
67
70
  empty: () => boolean;
68
- contains: (elementOrSelector?: string | Element | undefined) => boolean | Element;
69
71
  descendants: (selector: string) => Element[];
70
- ancestors: (selector: string) => (Node & ParentNode)[];
72
+ ancestors: (selector: string) => ParentNode[];
71
73
  attribute: (qualifiedName: string) => string | null;
72
74
  style: (property: string) => string;
73
75
  classNames: () => string[];
74
- matches: (selector: string | undefined) => boolean;
75
76
  checked: () => any;
76
77
  selected: () => any;
77
78
  readonly: () => any;
78
- children: (selector: string) => Element[];
79
- parents: (selector: string) => (Node & ParentNode)[];
79
+ parents: (selector: string) => ParentNode[];
80
80
  } & {
81
+ scroll: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
81
82
  copy: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
82
83
  cut: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
83
84
  paste: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
@@ -115,7 +116,6 @@ export declare const TooltipLocator: {
115
116
  touchEnd: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
116
117
  touchMove: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
117
118
  touchStart: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
118
- scroll: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
119
119
  wheel: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
120
120
  abort: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
121
121
  canPlay: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
@@ -168,24 +168,28 @@ export declare const TooltipLocator: {
168
168
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
169
169
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
170
170
  } & {
171
+ toString: (maxLength?: number | undefined, options?: {
172
+ highlight: boolean;
173
+ } | undefined) => string;
174
+ contains: (elementOrSelector?: string | Element | undefined) => boolean | Element;
175
+ children: (selector: string) => Element[];
176
+ title: () => string | null | undefined;
177
+ id: () => string;
178
+ tagName: () => string;
179
+ getAttribute: (qualifiedName: string) => string | null;
180
+ getBoundingClientRect: () => DOMRect;
181
+ matches: (selector: string | undefined) => boolean;
171
182
  visible: () => boolean;
172
183
  value: () => string | null;
173
184
  disabled: () => string | null;
174
185
  role: () => string | null;
175
- id: () => string;
176
186
  label: () => string | null | undefined;
177
- title: () => string | null | undefined;
178
- toString: (maxLength?: number | undefined, options?: {
179
- highlight: boolean;
180
- } | undefined) => string;
181
187
  getId: () => string;
182
188
  getOwnerWindow: () => (Window & typeof globalThis) | null;
183
189
  getOwnerDocument: () => Document;
184
190
  getComputedStyle: () => CSSStyleDeclaration;
185
191
  getTagName: () => string;
186
- tagName: () => string;
187
192
  typeIn: (text: string) => Promise<void>;
188
- getAttribute: (qualifiedName: string) => string | null;
189
193
  getDOMNode: () => Element;
190
194
  node: () => Element;
191
195
  debug: (maxLength?: number | undefined, options?: {
@@ -193,9 +197,8 @@ export declare const TooltipLocator: {
193
197
  } | undefined) => void;
194
198
  accessible: (options?: Record<string, unknown> | undefined) => Promise<boolean>;
195
199
  getTextContent: () => string | null;
196
- getParentNode: () => (Node & ParentNode) | null;
197
- parent: () => (Node & ParentNode) | null;
198
- getBoundingClientRect: () => DOMRect;
200
+ getParentNode: () => ParentNode | null;
201
+ parent: () => ParentNode | null;
199
202
  rect: () => DOMRect;
200
203
  hasClass: (classname: string) => boolean;
201
204
  containsFocus: () => boolean;
@@ -207,19 +210,17 @@ export declare const TooltipLocator: {
207
210
  exists: () => boolean;
208
211
  text: () => string | null;
209
212
  empty: () => boolean;
210
- contains: (elementOrSelector?: string | Element | undefined) => boolean | Element;
211
213
  descendants: (selector: string) => Element[];
212
- ancestors: (selector: string) => (Node & ParentNode)[];
214
+ ancestors: (selector: string) => ParentNode[];
213
215
  attribute: (qualifiedName: string) => string | null;
214
216
  style: (property: string) => string;
215
217
  classNames: () => string[];
216
- matches: (selector: string | undefined) => boolean;
217
218
  checked: () => any;
218
219
  selected: () => any;
219
220
  readonly: () => any;
220
- children: (selector: string) => Element[];
221
- parents: (selector: string) => (Node & ParentNode)[];
221
+ parents: (selector: string) => ParentNode[];
222
222
  } & {
223
+ scroll: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
223
224
  copy: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
224
225
  cut: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
225
226
  paste: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
@@ -257,7 +258,6 @@ export declare const TooltipLocator: {
257
258
  touchEnd: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
258
259
  touchMove: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
259
260
  touchStart: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
260
- scroll: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
261
261
  wheel: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
262
262
  abort: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
263
263
  canPlay: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
@@ -310,24 +310,28 @@ export declare const TooltipLocator: {
310
310
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
311
311
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
312
312
  } & {
313
+ toString: (maxLength?: number | undefined, options?: {
314
+ highlight: boolean;
315
+ } | undefined) => string;
316
+ contains: (elementOrSelector?: string | Element | undefined) => boolean | Element;
317
+ children: (selector: string) => Element[];
318
+ title: () => string | null | undefined;
319
+ id: () => string;
320
+ tagName: () => string;
321
+ getAttribute: (qualifiedName: string) => string | null;
322
+ getBoundingClientRect: () => DOMRect;
323
+ matches: (selector: string | undefined) => boolean;
313
324
  visible: () => boolean;
314
325
  value: () => string | null;
315
326
  disabled: () => string | null;
316
327
  role: () => string | null;
317
- id: () => string;
318
328
  label: () => string | null | undefined;
319
- title: () => string | null | undefined;
320
- toString: (maxLength?: number | undefined, options?: {
321
- highlight: boolean;
322
- } | undefined) => string;
323
329
  getId: () => string;
324
330
  getOwnerWindow: () => (Window & typeof globalThis) | null;
325
331
  getOwnerDocument: () => Document;
326
332
  getComputedStyle: () => CSSStyleDeclaration;
327
333
  getTagName: () => string;
328
- tagName: () => string;
329
334
  typeIn: (text: string) => Promise<void>;
330
- getAttribute: (qualifiedName: string) => string | null;
331
335
  getDOMNode: () => Element;
332
336
  node: () => Element;
333
337
  debug: (maxLength?: number | undefined, options?: {
@@ -335,9 +339,8 @@ export declare const TooltipLocator: {
335
339
  } | undefined) => void;
336
340
  accessible: (options?: Record<string, unknown> | undefined) => Promise<boolean>;
337
341
  getTextContent: () => string | null;
338
- getParentNode: () => (Node & ParentNode) | null;
339
- parent: () => (Node & ParentNode) | null;
340
- getBoundingClientRect: () => DOMRect;
342
+ getParentNode: () => ParentNode | null;
343
+ parent: () => ParentNode | null;
341
344
  rect: () => DOMRect;
342
345
  hasClass: (classname: string) => boolean;
343
346
  containsFocus: () => boolean;
@@ -349,19 +352,17 @@ export declare const TooltipLocator: {
349
352
  exists: () => boolean;
350
353
  text: () => string | null;
351
354
  empty: () => boolean;
352
- contains: (elementOrSelector?: string | Element | undefined) => boolean | Element;
353
355
  descendants: (selector: string) => Element[];
354
- ancestors: (selector: string) => (Node & ParentNode)[];
356
+ ancestors: (selector: string) => ParentNode[];
355
357
  attribute: (qualifiedName: string) => string | null;
356
358
  style: (property: string) => string;
357
359
  classNames: () => string[];
358
- matches: (selector: string | undefined) => boolean;
359
360
  checked: () => any;
360
361
  selected: () => any;
361
362
  readonly: () => any;
362
- children: (selector: string) => Element[];
363
- parents: (selector: string) => (Node & ParentNode)[];
363
+ parents: (selector: string) => ParentNode[];
364
364
  } & {
365
+ scroll: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
365
366
  copy: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
366
367
  cut: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
367
368
  paste: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
@@ -399,7 +400,6 @@ export declare const TooltipLocator: {
399
400
  touchEnd: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
400
401
  touchMove: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
401
402
  touchStart: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
402
- scroll: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
403
403
  wheel: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
404
404
  abort: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
405
405
  canPlay: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
@@ -452,24 +452,28 @@ export declare const TooltipLocator: {
452
452
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
453
453
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
454
454
  } & {
455
+ toString: (maxLength?: number | undefined, options?: {
456
+ highlight: boolean;
457
+ } | undefined) => string;
458
+ contains: (elementOrSelector?: string | Element | undefined) => boolean | Element;
459
+ children: (selector: string) => Element[];
460
+ title: () => string | null | undefined;
461
+ id: () => string;
462
+ tagName: () => string;
463
+ getAttribute: (qualifiedName: string) => string | null;
464
+ getBoundingClientRect: () => DOMRect;
465
+ matches: (selector: string | undefined) => boolean;
455
466
  visible: () => boolean;
456
467
  value: () => string | null;
457
468
  disabled: () => string | null;
458
469
  role: () => string | null;
459
- id: () => string;
460
470
  label: () => string | null | undefined;
461
- title: () => string | null | undefined;
462
- toString: (maxLength?: number | undefined, options?: {
463
- highlight: boolean;
464
- } | undefined) => string;
465
471
  getId: () => string;
466
472
  getOwnerWindow: () => (Window & typeof globalThis) | null;
467
473
  getOwnerDocument: () => Document;
468
474
  getComputedStyle: () => CSSStyleDeclaration;
469
475
  getTagName: () => string;
470
- tagName: () => string;
471
476
  typeIn: (text: string) => Promise<void>;
472
- getAttribute: (qualifiedName: string) => string | null;
473
477
  getDOMNode: () => Element;
474
478
  node: () => Element;
475
479
  debug: (maxLength?: number | undefined, options?: {
@@ -477,9 +481,8 @@ export declare const TooltipLocator: {
477
481
  } | undefined) => void;
478
482
  accessible: (options?: Record<string, unknown> | undefined) => Promise<boolean>;
479
483
  getTextContent: () => string | null;
480
- getParentNode: () => (Node & ParentNode) | null;
481
- parent: () => (Node & ParentNode) | null;
482
- getBoundingClientRect: () => DOMRect;
484
+ getParentNode: () => ParentNode | null;
485
+ parent: () => ParentNode | null;
483
486
  rect: () => DOMRect;
484
487
  hasClass: (classname: string) => boolean;
485
488
  containsFocus: () => boolean;
@@ -491,19 +494,17 @@ export declare const TooltipLocator: {
491
494
  exists: () => boolean;
492
495
  text: () => string | null;
493
496
  empty: () => boolean;
494
- contains: (elementOrSelector?: string | Element | undefined) => boolean | Element;
495
497
  descendants: (selector: string) => Element[];
496
- ancestors: (selector: string) => (Node & ParentNode)[];
498
+ ancestors: (selector: string) => ParentNode[];
497
499
  attribute: (qualifiedName: string) => string | null;
498
500
  style: (property: string) => string;
499
501
  classNames: () => string[];
500
- matches: (selector: string | undefined) => boolean;
501
502
  checked: () => any;
502
503
  selected: () => any;
503
504
  readonly: () => any;
504
- children: (selector: string) => Element[];
505
- parents: (selector: string) => (Node & ParentNode)[];
505
+ parents: (selector: string) => ParentNode[];
506
506
  } & {
507
+ scroll: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
507
508
  copy: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
508
509
  cut: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
509
510
  paste: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
@@ -541,7 +542,6 @@ export declare const TooltipLocator: {
541
542
  touchEnd: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
542
543
  touchMove: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
543
544
  touchStart: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
544
- scroll: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
545
545
  wheel: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
546
546
  abort: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
547
547
  canPlay: (init?: import("@instructure/ui-test-queries/src/utils/events").FireEventInit | undefined, options?: Record<string, unknown> | undefined) => Promise<Event>;
@@ -60,6 +60,8 @@ declare class Tooltip extends Component<TooltipProps> {
60
60
  state: {
61
61
  hasFocus: boolean;
62
62
  };
63
+ ref: Element | null;
64
+ handleRef: (el: Element | null) => void;
63
65
  componentDidMount(): void;
64
66
  componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
65
67
  handleFocus: (event: any) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Tooltip/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAGlE;;;;GAIG;AACH,cAEM,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,aAAY;IAEvC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;;;MAYT;IAEV,GAAG,SAAiB;IACpB,KAAK;;MAAsB;IAE3B,iBAAiB;IAKjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,WAAW,uBAEV;IAGD,UAAU,uBAET;IAED,aAAa;IA6Bb,MAAM;CA+CP;AAED,eAAe,OAAO,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Tooltip/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAGlE;;;;GAIG;AACH,cAEM,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,aAAY;IAEvC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;;;MAYT;IAEV,GAAG,SAAiB;IACpB,KAAK;;MAAsB;IAE3B,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAKjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,WAAW,uBAEV;IAGD,UAAU,uBAET;IAED,aAAa;IA6Bb,MAAM;CAiDP;AAED,eAAe,OAAO,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}