@justeattakeaway/pie-tooltip 0.2.0 → 0.4.0

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/README.md CHANGED
@@ -35,11 +35,11 @@ Ideally, you should install the component using the **`@justeattakeaway/pie-webc
35
35
 
36
36
  ### Controlled component
37
37
 
38
- `pie-tooltip` is a controlled component. It never writes to its own `isOpen`.
38
+ `pie-tooltip` is a controlled component. It never writes to its own `isOpen`, and it never opens or closes itself.
39
39
 
40
40
  1. You own `isOpen`.
41
- 2. You listen for `pie-tooltip-close`.
42
- 3. You pass the value back.
41
+ 2. You listen for `pie-tooltip-open` and `pie-tooltip-close`.
42
+ 3. You pass the value back to open/close the tooltip.
43
43
 
44
44
  ### Properties
45
45
 
@@ -47,7 +47,7 @@ Ideally, you should install the component using the **`@justeattakeaway/pie-webc
47
47
  |---|---|---|---|
48
48
  | `trigger` | Any string | The `id` of the element the panel is anchored to. The trigger lives elsewhere in the DOM and is never slotted into the tooltip. | `undefined` |
49
49
  | `isOpen` | `true`, `false` | When true, the panel is visible. The component never writes to this property. | `false` |
50
- | `position` | `top`, `top-start`, `top-end`, `bottom`, `bottom-start`, `bottom-end`, `left`, `left-start`, `left-end`, `right`, `right-start`, `right-end` | The side of the trigger the panel sits on, and its alignment along the cross axis. | `top` |
50
+ | `position` | `top`, `top-start`, `top-end`, `bottom`, `bottom-start`, `bottom-end`, `left`, `left-start`, `left-end`, `right`, `right-start`, `right-end` | The preferred side of the trigger the panel sits on, and its alignment along the cross axis. The panel repositions itself when this would collide with the viewport or a clipping scroll container. | `top` |
51
51
  | `size` | `default`, `fit-to-content`, `fill-container` | How the panel sizes itself. `default` is a fixed 280px and wraps, `fit-to-content` is as wide as its content, and `fill-container` matches the inline size of the trigger's parent element. Not applied when `type` is `icon`. | `default` |
52
52
  | `variant` | `default`, `inverse` | The colour treatment of the panel. `default` is the dark panel, `inverse` the light one. | `default` |
53
53
  | `type` | `default`, `icon` | The presentation of the panel. `icon` is the compact treatment intended for icon triggers: it has no arrow and is always as wide as its content, so `size` and `--tooltip-width` have no effect on it. | `default` |
@@ -55,6 +55,7 @@ Ideally, you should install the component using the **`@justeattakeaway/pie-webc
55
55
  | `heading` | Any string | The text to display in the panel's heading. In dialog mode this also provides the panel's accessible name. | `undefined` |
56
56
  | `headingLevel` | `h2`, `h3`, `h4`, `h5`, `h6` | The HTML heading tag to use for the panel's heading. | `h2` |
57
57
  | `aria` | `{ close?: string, label?: string }` | `close` names the close button. `label` names the panel in dialog mode when no `heading` is provided. | `undefined` |
58
+ | `triggers` | Array of `hover`, `focus`, `click` | Which interactions request that the panel opens and closes. A configured interaction emits an event; it never changes the panel's state on its own. Empty by default, so no interaction is watched at all. Configure `hover` and `focus` together for keyboard reachability. | `[]` |
58
59
 
59
60
  ### Slots
60
61
 
@@ -67,7 +68,8 @@ Ideally, you should install the component using the **`@justeattakeaway/pie-webc
67
68
 
68
69
  | Event | Type | Description |
69
70
  |---|---|---|
70
- | `pie-tooltip-close` | `Event` | Emitted when the close button is clicked. Set `isOpen` to `false` in response. Bubbles and is composed. |
71
+ | `pie-tooltip-open` | `Event` | Emitted when a configured trigger asks for the panel. Set `isOpen` to `true` in response. Bubbles and is composed. |
72
+ | `pie-tooltip-close` | `Event` | Emitted when the close button is clicked, or when a configured trigger asks to dismiss the panel. Set `isOpen` to `false` in response. Bubbles and is composed. |
71
73
 
72
74
  ### CSS Variables
73
75
 
@@ -84,7 +86,7 @@ Set both on the `pie-tooltip` element itself.
84
86
 
85
87
  ## Positioning
86
88
 
87
- The component projects itself over the trigger's box and places the panel against that box in CSS. The trigger is found by `id`, so `pie-tooltip` can sit anywhere in the DOM, but reading and tab order follow DOM order, so place it immediately after its trigger.
89
+ Place the tooltip next to its trigger element in the DOM for the best accessibility practice. The `position` element will place the tooltip near to the trigger based on which value is provided.
88
90
 
89
91
  `position` names a side and, optionally, an alignment along the opposite axis:
90
92
 
@@ -95,7 +97,18 @@ left left-start left-end
95
97
  right right-start right-end
96
98
  ```
97
99
 
98
- In right-to-left languages, everything on the inline axis mirrors. The alignments follow the reading direction, so `top-start` aligns against the right-hand edge, and `left` and `right` swap: a panel asked for on the left appears on the right. The `-start` and `-end` alignments of `left` and `right` are on the block axis, which has no direction to mirror, so only the side moves. None of this needs configuration or any JavaScript awareness of direction.
100
+ In right-to-left languages, everything on the inline axis mirrors. The alignments follow the reading direction, so `top-start` aligns against the right-hand edge, and `left` and `right` swap: a panel asked for on the left appears on the right. The `-start` and `-end` alignments of `left` and `right` are on the block axis, which has no direction to mirror, so only the side moves.
101
+
102
+ ### Collision detection
103
+
104
+ `position` is a preference, not a guarantee. Before the panel is shown, and on every scroll, resize or direction change while it is open, the component measures the panel against the space available and repositions it if the preferred position would collide.
105
+
106
+ - It flips to the opposite side first: `top` to `bottom`, and so on.
107
+ - It then tries the remaining sides.
108
+ - Within a side, it shifts the alignment (for example `top-start` to `top-end`) so the panel stays fully in view.
109
+ - If no position fits entirely, it uses whichever position shows the most of the panel.
110
+
111
+ The available space is the viewport, narrowed by any ancestor that clips the panel. Collision detection is always on and cannot be disabled.
99
112
 
100
113
  ## Sizing
101
114
 
@@ -131,8 +144,12 @@ A close button does not make the panel a dialog. Only the `action` slot does.
131
144
  - Keeps the panel clear of the trigger at every placement, so the panel cannot obscure a focused trigger (WCAG 2.4.11).
132
145
  - Wraps content.
133
146
 
147
+ It does not touch the trigger, and it does not move focus. The component never writes attributes to the element named by `trigger`, and never calls `focus()` on anything. Both are yours to declare: see [Wiring the trigger](#wiring-the-trigger) and [Managing focus](#managing-focus).
148
+
134
149
  ### What you need to do
135
150
 
151
+ - **Wire the trigger yourself.** The ARIA attributes that connect the trigger to the panel are yours to set. See [Wiring the trigger](#wiring-the-trigger) for what to set and when.
152
+ - **Move focus yourself in dialog mode.** The panel holds focusable content, so opening it should move focus in and closing it should put focus back. See [Managing focus](#managing-focus).
136
153
  - **Give the trigger its own accessible name.** The tooltip is a description and never supplies a name. An icon-only trigger must set its own label; `pie-icon-button` already requires `aria.label`.
137
154
  - **Use a natively interactive element as the trigger**, a button or a link, so focus and click behave correctly.
138
155
  - **Own `isOpen`.** Listen for `pie-tooltip-close` and set `isOpen` to `false` in response.
@@ -142,6 +159,167 @@ A close button does not make the panel a dialog. Only the `action` slot does.
142
159
  - **Provide a translated `aria.close`** whenever `isDismissible` is set.
143
160
  - **Keep tooltip-mode content short and supplementary.** Anything essential or interactive belongs in dialog mode, or inline in the page.
144
161
 
162
+ ### Wiring the trigger
163
+
164
+ The trigger lives outside the tooltip and the component leaves it untouched, so you declare the relationship. What to set depends on the mode.
165
+
166
+ | ARIA | Set it when | Value |
167
+ |---|---|---|
168
+ | `haspopup` | Dialog mode, so the trigger announces that it opens a dialog | `dialog` |
169
+ | `expanded` | You toggle the panel from the trigger with a click or a tap | Your `isOpen` value |
170
+ | `describedby` | Tooltip mode, and the trigger is a plain HTML element | The `id` of the element you put in the `content` slot |
171
+
172
+ Leave `expanded` off a hover-only or focus-only panel. Nothing is being toggled, so it has nothing to describe. There is no `controls` in the table because it adds nothing here: the description already carries the relationship, and support for it is patchy.
173
+
174
+ #### A description cannot cross a shadow boundary
175
+
176
+ `aria.describedby` takes an `id`, and an `id` only resolves inside the tree of the element that references it. The element you put in the `content` slot stays in your light DOM, so a plain `<button>` in the same document resolves it. The `<button>` inside `pie-icon-button` does not: it cannot see an `id` in your document, so `aria.describedby` is unusable for this purpose even though the property exists.
177
+
178
+ There is no way around this from outside the component. When the trigger is a PIE component and the panel is a plain tooltip, put the information in the trigger's name with `aria.label` instead, as in the first example below. It is the only route that reaches a screen reader.
179
+
180
+ Dialog mode is unaffected, because the panel is named by `heading` and needs no description at all.
181
+
182
+ #### A tooltip panel on an icon trigger
183
+
184
+ `hover` and `focus` together give the panel to both pointer and keyboard users. Nothing is toggled, so there is no `expanded`, and the name carries the content because a description cannot reach the button inside the trigger.
185
+
186
+ ```js
187
+ // main.js
188
+ import '@justeattakeaway/pie-webc/components/tooltip.js';
189
+ import '@justeattakeaway/pie-webc/components/icon-button.js';
190
+ import '@justeattakeaway/pie-icons-webc/dist/IconInfoCircle.js';
191
+
192
+ const trigger = document.querySelector('#delivery-info');
193
+ const panel = document.querySelector('#delivery-panel');
194
+
195
+ trigger.aria = { label: 'Delivery times: orders placed before 6pm arrive today' };
196
+ panel.triggers = ['hover', 'focus'];
197
+
198
+ panel.addEventListener('pie-tooltip-open', () => { panel.isOpen = true; });
199
+ panel.addEventListener('pie-tooltip-close', () => { panel.isOpen = false; });
200
+ ```
201
+
202
+ ```html
203
+ <script type="module" src="/main.js"></script>
204
+
205
+ <pie-icon-button id="delivery-info" variant="outline">
206
+ <icon-info-circle></icon-info-circle>
207
+ </pie-icon-button>
208
+
209
+ <pie-tooltip id="delivery-panel" trigger="delivery-info" type="icon">
210
+ <span slot="content">Orders placed before 6pm arrive today.</span>
211
+ </pie-tooltip>
212
+ ```
213
+
214
+ The two handlers are the whole contract. Without them the panel never opens, because the component only ever asks.
215
+
216
+ #### A dialog panel toggled from the trigger
217
+
218
+ Filling the `action` slot makes the panel a dialog, so the trigger gets `haspopup` and, because a click toggles it, `expanded`. Both track the same state you already own.
219
+
220
+ ```jsx
221
+ import { useRef, useState } from 'react';
222
+ import { PieButton } from '@justeattakeaway/pie-webc/react/button.js';
223
+ import { PieIconButton } from '@justeattakeaway/pie-webc/react/icon-button.js';
224
+ import { PieTooltip } from '@justeattakeaway/pie-webc/react/tooltip.js';
225
+ import { IconInfoCircle } from '@justeattakeaway/pie-icons-webc/dist/react/IconInfoCircle.js';
226
+
227
+ export function DeliveryTimes () {
228
+ const [isOpen, setIsOpen] = useState(false);
229
+ const triggerRef = useRef(null);
230
+ const actionRef = useRef(null);
231
+
232
+ const open = () => {
233
+ setIsOpen(true);
234
+ // The panel is only focusable once it has rendered and been positioned.
235
+ requestAnimationFrame(() => actionRef.current?.focus({ preventScroll: true }));
236
+ };
237
+
238
+ const close = () => {
239
+ // Only reclaim focus if it is still inside the panel. Closing on a hover-away or a
240
+ // click elsewhere must not yank focus from whatever the user has moved on to.
241
+ const panelHadFocus = document.activeElement?.closest('pie-tooltip');
242
+
243
+ setIsOpen(false);
244
+
245
+ if (panelHadFocus) {
246
+ triggerRef.current?.focus({ preventScroll: true });
247
+ }
248
+ };
249
+
250
+ return (
251
+ <>
252
+ <PieIconButton
253
+ id="delivery-info"
254
+ ref={triggerRef}
255
+ variant="outline"
256
+ aria={{
257
+ label: 'Delivery times',
258
+ haspopup: 'dialog',
259
+ expanded: isOpen,
260
+ }}>
261
+ <IconInfoCircle />
262
+ </PieIconButton>
263
+
264
+ <PieTooltip
265
+ trigger="delivery-info"
266
+ heading="Delivery times"
267
+ isOpen={isOpen}
268
+ isDismissible
269
+ aria={{ close: 'Close' }}
270
+ triggers={['click']}
271
+ onPieTooltipOpen={open}
272
+ onPieTooltipClose={close}>
273
+ <span slot="content">Orders placed before 6pm arrive today.</span>
274
+ <PieButton slot="action" size="xsmall" ref={actionRef} onClick={close}>
275
+ Got it
276
+ </PieButton>
277
+ </PieTooltip>
278
+ </>
279
+ );
280
+ }
281
+ ```
282
+
283
+ `isDismissible` and Escape both route through `onPieTooltipClose`, so a single `close` covers the close button, Escape, a click outside and the action button.
284
+
285
+ The `closest('pie-tooltip')` check works because `document.activeElement` reports the outermost shadow host, so focus on the close button inside the panel's shadow root reads as the `pie-tooltip` element itself. Focus on your slotted action button reports that button, whose `closest` finds the same panel. One check covers both. See [Managing focus](#managing-focus).
286
+
287
+ #### Driving the panel without `triggers`
288
+
289
+ Leave `triggers` unset when the panel's timing is not an interaction with its trigger, such as a step in an onboarding tour. Nothing is watched, so `pie-tooltip-open` never fires and `expanded` has nothing to describe. The close button still emits `pie-tooltip-close`.
290
+
291
+ Escape is watched only while at least one trigger is configured, so a panel driven this way needs its own key handling if you want Escape to dismiss it.
292
+
293
+ ```html
294
+ <template>
295
+ <pie-icon-button
296
+ id="delivery-info"
297
+ variant="outline"
298
+ :aria="{ label: 'Delivery times' }">
299
+ <icon-info-circle />
300
+ </pie-icon-button>
301
+
302
+ <pie-tooltip
303
+ trigger="delivery-info"
304
+ heading="Delivery times"
305
+ :isOpen="isOpen"
306
+ isDismissible
307
+ :aria="{ close: 'Close' }"
308
+ @pie-tooltip-close="isOpen = false">
309
+ <span slot="content">Orders placed before 6pm arrive today.</span>
310
+ </pie-tooltip>
311
+ </template>
312
+ ```
313
+
314
+ ### Managing focus
315
+
316
+ In tooltip mode there is nothing to do. A tooltip must not take focus, and the close button that `isDismissible` renders is reachable by tabbing.
317
+
318
+ In dialog mode you own two moments:
319
+
320
+ - **On open, move focus into the panel.** Wait for the panel to render and be positioned first, because a `visibility: hidden` element cannot take focus. `await panel.updateComplete` followed by one animation frame is enough.
321
+ - **On close, put focus back**, but only if focus was still inside the panel. Closing on a hover-away or a click elsewhere must not pull focus away from whatever the user has moved on to.
322
+
145
323
  ## Usage Examples
146
324
 
147
325
  **For HTML:**
@@ -149,6 +327,10 @@ A close button does not make the panel a dialog. Only the `action` slot does.
149
327
  ```js
150
328
  // import as module into a js file e.g. main.js
151
329
  import '@justeattakeaway/pie-webc/components/tooltip.js'
330
+ import '@justeattakeaway/pie-webc/components/button.js'
331
+
332
+ // `aria` takes an object, so it is set as a property rather than an attribute.
333
+ document.querySelector('#delivery-panel').aria = { close: 'Close' };
152
334
  ```
153
335
 
154
336
  ```html
@@ -160,7 +342,7 @@ import '@justeattakeaway/pie-webc/components/tooltip.js'
160
342
  ```html
161
343
  <pie-button id="delivery-info">Delivery times</pie-button>
162
344
 
163
- <pie-tooltip trigger="delivery-info" isOpen isDismissible>
345
+ <pie-tooltip id="delivery-panel" trigger="delivery-info" isOpen isDismissible>
164
346
  <span slot="content">Orders placed before 6pm arrive today.</span>
165
347
  </pie-tooltip>
166
348
  ```
@@ -218,7 +400,19 @@ export function DeliveryTimes () {
218
400
 
219
401
  Filling the `action` slot switches the panel to a non-modal dialog, which then needs an accessible name.
220
402
 
403
+ ```js
404
+ document.querySelector('#delivery-info').aria = {
405
+ label: 'Delivery times',
406
+ haspopup: 'dialog',
407
+ expanded: true,
408
+ };
409
+ ```
410
+
221
411
  ```html
412
+ <pie-icon-button id="delivery-info" variant="outline">
413
+ <icon-info-circle></icon-info-circle>
414
+ </pie-icon-button>
415
+
222
416
  <pie-tooltip trigger="delivery-info" isOpen heading="Delivery times">
223
417
  <span slot="content">Orders placed before 6pm arrive today.</span>
224
418
  <pie-button slot="action" size="xsmall">Next</pie-button>
@@ -52,6 +52,14 @@
52
52
  },
53
53
  "default": "['h2', 'h3', 'h4', 'h5', 'h6']"
54
54
  },
55
+ {
56
+ "kind": "variable",
57
+ "name": "triggers",
58
+ "type": {
59
+ "text": "['hover', 'focus', 'click']"
60
+ },
61
+ "default": "['hover', 'focus', 'click']"
62
+ },
55
63
  {
56
64
  "kind": "variable",
57
65
  "name": "modes",
@@ -77,6 +85,11 @@
77
85
  },
78
86
  "default": "'c-tooltip'"
79
87
  },
88
+ {
89
+ "kind": "variable",
90
+ "name": "ON_TOOLTIP_OPEN_EVENT",
91
+ "default": "`${componentSelector}-open`"
92
+ },
80
93
  {
81
94
  "kind": "variable",
82
95
  "name": "ON_TOOLTIP_CLOSE_EVENT",
@@ -132,6 +145,14 @@
132
145
  "module": "src/defs.js"
133
146
  }
134
147
  },
148
+ {
149
+ "kind": "js",
150
+ "name": "triggers",
151
+ "declaration": {
152
+ "name": "triggers",
153
+ "module": "src/defs.js"
154
+ }
155
+ },
135
156
  {
136
157
  "kind": "js",
137
158
  "name": "modes",
@@ -156,6 +177,14 @@
156
177
  "module": "src/defs.js"
157
178
  }
158
179
  },
180
+ {
181
+ "kind": "js",
182
+ "name": "ON_TOOLTIP_OPEN_EVENT",
183
+ "declaration": {
184
+ "name": "ON_TOOLTIP_OPEN_EVENT",
185
+ "module": "src/defs.js"
186
+ }
187
+ },
159
188
  {
160
189
  "kind": "js",
161
190
  "name": "ON_TOOLTIP_CLOSE_EVENT",
@@ -262,6 +291,16 @@
262
291
  "privacy": "public",
263
292
  "attribute": "aria"
264
293
  },
294
+ {
295
+ "kind": "field",
296
+ "name": "triggers",
297
+ "type": {
298
+ "text": "TooltipProps['triggers']"
299
+ },
300
+ "privacy": "public",
301
+ "default": "[]",
302
+ "attribute": "triggers"
303
+ },
265
304
  {
266
305
  "kind": "field",
267
306
  "name": "_assignedActionElements",
@@ -295,6 +334,68 @@
295
334
  "privacy": "private",
296
335
  "default": "false"
297
336
  },
337
+ {
338
+ "kind": "field",
339
+ "name": "_isAnchorVisible",
340
+ "type": {
341
+ "text": "boolean"
342
+ },
343
+ "privacy": "private",
344
+ "default": "true"
345
+ },
346
+ {
347
+ "kind": "field",
348
+ "name": "_resolvedPosition",
349
+ "type": {
350
+ "text": "TooltipProps['position'] | undefined"
351
+ },
352
+ "privacy": "private"
353
+ },
354
+ {
355
+ "kind": "field",
356
+ "name": "_clippedTriggerElement",
357
+ "type": {
358
+ "text": "Element | null"
359
+ },
360
+ "privacy": "private",
361
+ "default": "null"
362
+ },
363
+ {
364
+ "kind": "field",
365
+ "name": "_triggerClippers",
366
+ "type": {
367
+ "text": "Array<Element>"
368
+ },
369
+ "privacy": "private",
370
+ "default": "[]"
371
+ },
372
+ {
373
+ "kind": "field",
374
+ "name": "_overlayClippers",
375
+ "type": {
376
+ "text": "Array<Element>"
377
+ },
378
+ "privacy": "private",
379
+ "default": "[]"
380
+ },
381
+ {
382
+ "kind": "field",
383
+ "name": "_collisionSignature",
384
+ "type": {
385
+ "text": "string | null"
386
+ },
387
+ "privacy": "private",
388
+ "default": "null"
389
+ },
390
+ {
391
+ "kind": "field",
392
+ "name": "_overlayModeDirty",
393
+ "type": {
394
+ "text": "boolean"
395
+ },
396
+ "privacy": "private",
397
+ "default": "true"
398
+ },
298
399
  {
299
400
  "kind": "field",
300
401
  "name": "_triggerTrackingController",
@@ -303,6 +404,14 @@
303
404
  },
304
405
  "privacy": "private"
305
406
  },
407
+ {
408
+ "kind": "field",
409
+ "name": "_interactionController",
410
+ "type": {
411
+ "text": "AbortController | undefined"
412
+ },
413
+ "privacy": "private"
414
+ },
306
415
  {
307
416
  "kind": "field",
308
417
  "name": "_directionObserver",
@@ -311,6 +420,14 @@
311
420
  },
312
421
  "privacy": "private"
313
422
  },
423
+ {
424
+ "kind": "field",
425
+ "name": "_triggerObserver",
426
+ "type": {
427
+ "text": "ResizeObserver | undefined"
428
+ },
429
+ "privacy": "private"
430
+ },
314
431
  {
315
432
  "kind": "field",
316
433
  "name": "_reanchorFrame",
@@ -322,7 +439,15 @@
322
439
  },
323
440
  {
324
441
  "kind": "field",
325
- "name": "_shouldResolveOverlayMode",
442
+ "name": "_hoverCloseTimer",
443
+ "type": {
444
+ "text": "ReturnType<typeof setTimeout> | undefined"
445
+ },
446
+ "privacy": "private"
447
+ },
448
+ {
449
+ "kind": "field",
450
+ "name": "_openedByClick",
326
451
  "type": {
327
452
  "text": "boolean"
328
453
  },
@@ -388,6 +513,86 @@
388
513
  }
389
514
  }
390
515
  },
516
+ {
517
+ "kind": "method",
518
+ "name": "resolveCollision",
519
+ "privacy": "private",
520
+ "return": {
521
+ "type": {
522
+ "text": "void"
523
+ }
524
+ },
525
+ "parameters": [
526
+ {
527
+ "name": "anchorRect",
528
+ "type": {
529
+ "text": "DOMRect"
530
+ }
531
+ }
532
+ ]
533
+ },
534
+ {
535
+ "kind": "method",
536
+ "name": "_setResolvedPosition",
537
+ "privacy": "private",
538
+ "return": {
539
+ "type": {
540
+ "text": "void"
541
+ }
542
+ },
543
+ "parameters": [
544
+ {
545
+ "name": "position",
546
+ "type": {
547
+ "text": "TooltipProps['position']"
548
+ }
549
+ }
550
+ ]
551
+ },
552
+ {
553
+ "kind": "method",
554
+ "name": "_getCollisionBoundary",
555
+ "privacy": "private",
556
+ "return": {
557
+ "type": {
558
+ "text": "DOMRect | null"
559
+ }
560
+ }
561
+ },
562
+ {
563
+ "kind": "method",
564
+ "name": "_getCandidatePositions",
565
+ "privacy": "private",
566
+ "return": {
567
+ "type": {
568
+ "text": "Array<{ side: TooltipSide; alignment: TooltipAlignment }>"
569
+ }
570
+ },
571
+ "parameters": [
572
+ {
573
+ "name": "preferredSide",
574
+ "type": {
575
+ "text": "TooltipSide"
576
+ }
577
+ },
578
+ {
579
+ "name": "preferredAlignment",
580
+ "type": {
581
+ "text": "TooltipAlignment"
582
+ }
583
+ }
584
+ ]
585
+ },
586
+ {
587
+ "kind": "method",
588
+ "name": "_refreshTriggerClippers",
589
+ "privacy": "private",
590
+ "return": {
591
+ "type": {
592
+ "text": "void"
593
+ }
594
+ }
595
+ },
391
596
  {
392
597
  "kind": "method",
393
598
  "name": "handleCloseButtonClick",
@@ -398,6 +603,76 @@
398
603
  }
399
604
  }
400
605
  },
606
+ {
607
+ "kind": "method",
608
+ "name": "_getTriggerElement",
609
+ "privacy": "private",
610
+ "return": {
611
+ "type": {
612
+ "text": "Element | null"
613
+ }
614
+ }
615
+ },
616
+ {
617
+ "kind": "method",
618
+ "name": "_requestOpen",
619
+ "privacy": "private",
620
+ "return": {
621
+ "type": {
622
+ "text": "void"
623
+ }
624
+ }
625
+ },
626
+ {
627
+ "kind": "method",
628
+ "name": "_requestClose",
629
+ "privacy": "private",
630
+ "return": {
631
+ "type": {
632
+ "text": "void"
633
+ }
634
+ }
635
+ },
636
+ {
637
+ "kind": "method",
638
+ "name": "_startHoverCloseTimer",
639
+ "privacy": "private",
640
+ "return": {
641
+ "type": {
642
+ "text": "void"
643
+ }
644
+ }
645
+ },
646
+ {
647
+ "kind": "method",
648
+ "name": "_cancelHoverCloseTimer",
649
+ "privacy": "private",
650
+ "return": {
651
+ "type": {
652
+ "text": "void"
653
+ }
654
+ }
655
+ },
656
+ {
657
+ "kind": "method",
658
+ "name": "_rebuildInteractionListeners",
659
+ "privacy": "private",
660
+ "return": {
661
+ "type": {
662
+ "text": "void"
663
+ }
664
+ }
665
+ },
666
+ {
667
+ "kind": "method",
668
+ "name": "_teardownInteractionListeners",
669
+ "privacy": "private",
670
+ "return": {
671
+ "type": {
672
+ "text": "void"
673
+ }
674
+ }
675
+ },
401
676
  {
402
677
  "kind": "method",
403
678
  "name": "renderHeading",
@@ -424,7 +699,14 @@
424
699
  "type": {
425
700
  "text": "Event"
426
701
  },
427
- "description": "When the close button is clicked. Set `isOpen` to `false` in response.",
702
+ "description": "When a configured trigger asks for the panel. Set `isOpen` to `true` in response.",
703
+ "name": "pie-tooltip-open"
704
+ },
705
+ {
706
+ "type": {
707
+ "text": "Event"
708
+ },
709
+ "description": "When the close button is clicked, or a configured trigger asks to dismiss the panel. Set `isOpen` to `false` in response.",
428
710
  "name": "pie-tooltip-close"
429
711
  }
430
712
  ],
@@ -477,6 +759,14 @@
477
759
  "text": "TooltipProps['aria']"
478
760
  },
479
761
  "fieldName": "aria"
762
+ },
763
+ {
764
+ "name": "triggers",
765
+ "type": {
766
+ "text": "TooltipProps['triggers']"
767
+ },
768
+ "default": "[]",
769
+ "fieldName": "triggers"
480
770
  }
481
771
  ],
482
772
  "superclass": {