@justeattakeaway/pie-tooltip 0.1.0 → 0.2.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 +161 -15
- package/custom-elements.json +459 -3
- package/dist/index.d.ts +123 -2
- package/dist/index.js +266 -18
- package/dist/react.d.ts +128 -3
- package/dist/react.js +21 -7
- package/package.json +5 -3
- package/src/defs.ts +117 -3
- package/src/index.ts +395 -9
- package/src/react.ts +9 -3
- package/src/tooltip.scss +364 -2
package/custom-elements.json
CHANGED
|
@@ -11,8 +11,168 @@
|
|
|
11
11
|
{
|
|
12
12
|
"kind": "javascript-module",
|
|
13
13
|
"path": "src/defs.js",
|
|
14
|
-
"declarations": [
|
|
15
|
-
|
|
14
|
+
"declarations": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "variable",
|
|
17
|
+
"name": "positions",
|
|
18
|
+
"type": {
|
|
19
|
+
"text": "[\n 'top',\n 'top-start',\n 'top-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'left',\n 'left-start',\n 'left-end',\n 'right',\n 'right-start',\n 'right-end',\n]"
|
|
20
|
+
},
|
|
21
|
+
"default": "[ 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end', ]"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"kind": "variable",
|
|
25
|
+
"name": "sizes",
|
|
26
|
+
"type": {
|
|
27
|
+
"text": "['default', 'fit-to-content', 'fill-container']"
|
|
28
|
+
},
|
|
29
|
+
"default": "['default', 'fit-to-content', 'fill-container']"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"kind": "variable",
|
|
33
|
+
"name": "variants",
|
|
34
|
+
"type": {
|
|
35
|
+
"text": "['default', 'inverse']"
|
|
36
|
+
},
|
|
37
|
+
"default": "['default', 'inverse']"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"kind": "variable",
|
|
41
|
+
"name": "types",
|
|
42
|
+
"type": {
|
|
43
|
+
"text": "['default', 'icon']"
|
|
44
|
+
},
|
|
45
|
+
"default": "['default', 'icon']"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"kind": "variable",
|
|
49
|
+
"name": "headingLevels",
|
|
50
|
+
"type": {
|
|
51
|
+
"text": "['h2', 'h3', 'h4', 'h5', 'h6']"
|
|
52
|
+
},
|
|
53
|
+
"default": "['h2', 'h3', 'h4', 'h5', 'h6']"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"kind": "variable",
|
|
57
|
+
"name": "modes",
|
|
58
|
+
"type": {
|
|
59
|
+
"text": "['tooltip', 'dialog']"
|
|
60
|
+
},
|
|
61
|
+
"default": "['tooltip', 'dialog']",
|
|
62
|
+
"description": "The two patterns the panel can present as. Inferred from the `action` slot rather than\nconfigured: an empty `action` slot is a tooltip, a filled one is a non-modal dialog."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"kind": "variable",
|
|
66
|
+
"name": "componentSelector",
|
|
67
|
+
"type": {
|
|
68
|
+
"text": "string"
|
|
69
|
+
},
|
|
70
|
+
"default": "'pie-tooltip'"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"kind": "variable",
|
|
74
|
+
"name": "componentClass",
|
|
75
|
+
"type": {
|
|
76
|
+
"text": "string"
|
|
77
|
+
},
|
|
78
|
+
"default": "'c-tooltip'"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"kind": "variable",
|
|
82
|
+
"name": "ON_TOOLTIP_CLOSE_EVENT",
|
|
83
|
+
"default": "`${componentSelector}-close`"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"kind": "variable",
|
|
87
|
+
"name": "defaultProps",
|
|
88
|
+
"type": {
|
|
89
|
+
"text": "DefaultProps"
|
|
90
|
+
},
|
|
91
|
+
"default": "{ isOpen: false, position: 'top', size: 'default', variant: 'default', type: 'default', isDismissible: false, headingLevel: 'h2', }"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"exports": [
|
|
95
|
+
{
|
|
96
|
+
"kind": "js",
|
|
97
|
+
"name": "positions",
|
|
98
|
+
"declaration": {
|
|
99
|
+
"name": "positions",
|
|
100
|
+
"module": "src/defs.js"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"kind": "js",
|
|
105
|
+
"name": "sizes",
|
|
106
|
+
"declaration": {
|
|
107
|
+
"name": "sizes",
|
|
108
|
+
"module": "src/defs.js"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"kind": "js",
|
|
113
|
+
"name": "variants",
|
|
114
|
+
"declaration": {
|
|
115
|
+
"name": "variants",
|
|
116
|
+
"module": "src/defs.js"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"kind": "js",
|
|
121
|
+
"name": "types",
|
|
122
|
+
"declaration": {
|
|
123
|
+
"name": "types",
|
|
124
|
+
"module": "src/defs.js"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"kind": "js",
|
|
129
|
+
"name": "headingLevels",
|
|
130
|
+
"declaration": {
|
|
131
|
+
"name": "headingLevels",
|
|
132
|
+
"module": "src/defs.js"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"kind": "js",
|
|
137
|
+
"name": "modes",
|
|
138
|
+
"declaration": {
|
|
139
|
+
"name": "modes",
|
|
140
|
+
"module": "src/defs.js"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"kind": "js",
|
|
145
|
+
"name": "componentSelector",
|
|
146
|
+
"declaration": {
|
|
147
|
+
"name": "componentSelector",
|
|
148
|
+
"module": "src/defs.js"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"kind": "js",
|
|
153
|
+
"name": "componentClass",
|
|
154
|
+
"declaration": {
|
|
155
|
+
"name": "componentClass",
|
|
156
|
+
"module": "src/defs.js"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"kind": "js",
|
|
161
|
+
"name": "ON_TOOLTIP_CLOSE_EVENT",
|
|
162
|
+
"declaration": {
|
|
163
|
+
"name": "ON_TOOLTIP_CLOSE_EVENT",
|
|
164
|
+
"module": "src/defs.js"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"kind": "js",
|
|
169
|
+
"name": "defaultProps",
|
|
170
|
+
"declaration": {
|
|
171
|
+
"name": "defaultProps",
|
|
172
|
+
"module": "src/defs.js"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
]
|
|
16
176
|
},
|
|
17
177
|
{
|
|
18
178
|
"kind": "javascript-module",
|
|
@@ -22,7 +182,303 @@
|
|
|
22
182
|
"kind": "class",
|
|
23
183
|
"description": "",
|
|
24
184
|
"name": "PieTooltip",
|
|
25
|
-
"
|
|
185
|
+
"slots": [
|
|
186
|
+
{
|
|
187
|
+
"description": "The descriptive content of the panel. Must not contain focusable elements.",
|
|
188
|
+
"name": "content"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"description": "An optional slot for interactive content such as a `pie-button`. Filling this slot switches the panel to a non-modal dialog.",
|
|
192
|
+
"name": "action"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"members": [
|
|
196
|
+
{
|
|
197
|
+
"kind": "field",
|
|
198
|
+
"name": "trigger",
|
|
199
|
+
"type": {
|
|
200
|
+
"text": "TooltipProps['trigger']"
|
|
201
|
+
},
|
|
202
|
+
"privacy": "public",
|
|
203
|
+
"attribute": "trigger"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"kind": "field",
|
|
207
|
+
"name": "isOpen",
|
|
208
|
+
"privacy": "public",
|
|
209
|
+
"attribute": "isOpen"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"kind": "field",
|
|
213
|
+
"name": "position",
|
|
214
|
+
"privacy": "public",
|
|
215
|
+
"attribute": "position"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"kind": "field",
|
|
219
|
+
"name": "size",
|
|
220
|
+
"privacy": "public",
|
|
221
|
+
"attribute": "size"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"kind": "field",
|
|
225
|
+
"name": "variant",
|
|
226
|
+
"privacy": "public",
|
|
227
|
+
"attribute": "variant"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"kind": "field",
|
|
231
|
+
"name": "type",
|
|
232
|
+
"privacy": "public",
|
|
233
|
+
"attribute": "type"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"kind": "field",
|
|
237
|
+
"name": "isDismissible",
|
|
238
|
+
"privacy": "public",
|
|
239
|
+
"attribute": "isDismissible"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"kind": "field",
|
|
243
|
+
"name": "heading",
|
|
244
|
+
"type": {
|
|
245
|
+
"text": "TooltipProps['heading']"
|
|
246
|
+
},
|
|
247
|
+
"privacy": "public",
|
|
248
|
+
"attribute": "heading"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"kind": "field",
|
|
252
|
+
"name": "headingLevel",
|
|
253
|
+
"privacy": "public",
|
|
254
|
+
"attribute": "headingLevel"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"kind": "field",
|
|
258
|
+
"name": "aria",
|
|
259
|
+
"type": {
|
|
260
|
+
"text": "TooltipProps['aria']"
|
|
261
|
+
},
|
|
262
|
+
"privacy": "public",
|
|
263
|
+
"attribute": "aria"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"kind": "field",
|
|
267
|
+
"name": "_assignedActionElements",
|
|
268
|
+
"type": {
|
|
269
|
+
"text": "Array<HTMLElement>"
|
|
270
|
+
},
|
|
271
|
+
"privacy": "private"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"kind": "field",
|
|
275
|
+
"name": "_originElement",
|
|
276
|
+
"type": {
|
|
277
|
+
"text": "HTMLElement | null"
|
|
278
|
+
},
|
|
279
|
+
"privacy": "private"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"kind": "field",
|
|
283
|
+
"name": "_hasActionContent",
|
|
284
|
+
"type": {
|
|
285
|
+
"text": "boolean | undefined"
|
|
286
|
+
},
|
|
287
|
+
"privacy": "private"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"kind": "field",
|
|
291
|
+
"name": "_isPositioned",
|
|
292
|
+
"type": {
|
|
293
|
+
"text": "boolean"
|
|
294
|
+
},
|
|
295
|
+
"privacy": "private",
|
|
296
|
+
"default": "false"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"kind": "field",
|
|
300
|
+
"name": "_triggerTrackingController",
|
|
301
|
+
"type": {
|
|
302
|
+
"text": "AbortController | undefined"
|
|
303
|
+
},
|
|
304
|
+
"privacy": "private"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"kind": "field",
|
|
308
|
+
"name": "_directionObserver",
|
|
309
|
+
"type": {
|
|
310
|
+
"text": "MutationObserver | undefined"
|
|
311
|
+
},
|
|
312
|
+
"privacy": "private"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"kind": "field",
|
|
316
|
+
"name": "_reanchorFrame",
|
|
317
|
+
"type": {
|
|
318
|
+
"text": "number"
|
|
319
|
+
},
|
|
320
|
+
"privacy": "private",
|
|
321
|
+
"default": "0"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"kind": "field",
|
|
325
|
+
"name": "_shouldResolveOverlayMode",
|
|
326
|
+
"type": {
|
|
327
|
+
"text": "boolean"
|
|
328
|
+
},
|
|
329
|
+
"privacy": "private",
|
|
330
|
+
"default": "false"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"kind": "field",
|
|
334
|
+
"name": "_mode",
|
|
335
|
+
"type": {
|
|
336
|
+
"text": "TooltipMode | undefined"
|
|
337
|
+
},
|
|
338
|
+
"privacy": "private",
|
|
339
|
+
"readonly": true
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"kind": "method",
|
|
343
|
+
"name": "startTrackingTrigger",
|
|
344
|
+
"privacy": "private",
|
|
345
|
+
"return": {
|
|
346
|
+
"type": {
|
|
347
|
+
"text": "void"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"kind": "method",
|
|
353
|
+
"name": "stopTrackingTrigger",
|
|
354
|
+
"privacy": "private",
|
|
355
|
+
"return": {
|
|
356
|
+
"type": {
|
|
357
|
+
"text": "void"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"kind": "method",
|
|
363
|
+
"name": "resolveMode",
|
|
364
|
+
"privacy": "private",
|
|
365
|
+
"return": {
|
|
366
|
+
"type": {
|
|
367
|
+
"text": "void"
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"kind": "method",
|
|
373
|
+
"name": "resolveOverlayMode",
|
|
374
|
+
"privacy": "private",
|
|
375
|
+
"return": {
|
|
376
|
+
"type": {
|
|
377
|
+
"text": "void"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"kind": "method",
|
|
383
|
+
"name": "projectOverTrigger",
|
|
384
|
+
"privacy": "private",
|
|
385
|
+
"return": {
|
|
386
|
+
"type": {
|
|
387
|
+
"text": "void"
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"kind": "method",
|
|
393
|
+
"name": "handleCloseButtonClick",
|
|
394
|
+
"privacy": "private",
|
|
395
|
+
"return": {
|
|
396
|
+
"type": {
|
|
397
|
+
"text": "void"
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"kind": "method",
|
|
403
|
+
"name": "renderHeading",
|
|
404
|
+
"privacy": "private",
|
|
405
|
+
"return": {
|
|
406
|
+
"type": {
|
|
407
|
+
"text": "TemplateResult"
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"kind": "method",
|
|
413
|
+
"name": "renderCloseButton",
|
|
414
|
+
"privacy": "private",
|
|
415
|
+
"return": {
|
|
416
|
+
"type": {
|
|
417
|
+
"text": "TemplateResult"
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
],
|
|
422
|
+
"events": [
|
|
423
|
+
{
|
|
424
|
+
"type": {
|
|
425
|
+
"text": "Event"
|
|
426
|
+
},
|
|
427
|
+
"description": "When the close button is clicked. Set `isOpen` to `false` in response.",
|
|
428
|
+
"name": "pie-tooltip-close"
|
|
429
|
+
}
|
|
430
|
+
],
|
|
431
|
+
"attributes": [
|
|
432
|
+
{
|
|
433
|
+
"name": "trigger",
|
|
434
|
+
"type": {
|
|
435
|
+
"text": "TooltipProps['trigger']"
|
|
436
|
+
},
|
|
437
|
+
"fieldName": "trigger"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "isOpen",
|
|
441
|
+
"fieldName": "isOpen"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"name": "position",
|
|
445
|
+
"fieldName": "position"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"name": "size",
|
|
449
|
+
"fieldName": "size"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "variant",
|
|
453
|
+
"fieldName": "variant"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"name": "type",
|
|
457
|
+
"fieldName": "type"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"name": "isDismissible",
|
|
461
|
+
"fieldName": "isDismissible"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "heading",
|
|
465
|
+
"type": {
|
|
466
|
+
"text": "TooltipProps['heading']"
|
|
467
|
+
},
|
|
468
|
+
"fieldName": "heading"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"name": "headingLevel",
|
|
472
|
+
"fieldName": "headingLevel"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"name": "aria",
|
|
476
|
+
"type": {
|
|
477
|
+
"text": "TooltipProps['aria']"
|
|
478
|
+
},
|
|
479
|
+
"fieldName": "aria"
|
|
480
|
+
}
|
|
481
|
+
],
|
|
26
482
|
"superclass": {
|
|
27
483
|
"name": "PieElement",
|
|
28
484
|
"package": "@justeattakeaway/pie-webc-core/src/internals/PieElement"
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,137 @@
|
|
|
1
|
+
import { ComponentDefaultProps } from '@justeattakeaway/pie-webc-core';
|
|
1
2
|
import { CSSResult } from 'lit';
|
|
2
3
|
import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElement';
|
|
3
|
-
import {
|
|
4
|
+
import { PropertyValues } from 'lit';
|
|
5
|
+
import { TemplateResult } from 'lit';
|
|
6
|
+
|
|
7
|
+
declare type AriaProps = {
|
|
8
|
+
/**
|
|
9
|
+
* The accessible name for the close button. Required whenever `isDismissible` is set.
|
|
10
|
+
*/
|
|
11
|
+
close?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The accessible name for the panel in dialog mode. Only used when `heading` is not provided.
|
|
14
|
+
*/
|
|
15
|
+
label?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export declare const componentClass = "c-tooltip";
|
|
19
|
+
|
|
20
|
+
export declare const componentSelector = "pie-tooltip";
|
|
21
|
+
|
|
22
|
+
export declare type DefaultProps = ComponentDefaultProps<TooltipProps, keyof Omit<TooltipProps, 'trigger' | 'heading' | 'aria'>>;
|
|
23
|
+
|
|
24
|
+
export declare const defaultProps: DefaultProps;
|
|
25
|
+
|
|
26
|
+
export declare const headingLevels: readonly ["h2", "h3", "h4", "h5", "h6"];
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The two patterns the panel can present as. Inferred from the `action` slot rather than
|
|
30
|
+
* configured: an empty `action` slot is a tooltip, a filled one is a non-modal dialog.
|
|
31
|
+
*/
|
|
32
|
+
export declare const modes: readonly ["tooltip", "dialog"];
|
|
33
|
+
|
|
34
|
+
export declare const ON_TOOLTIP_CLOSE_EVENT = "pie-tooltip-close";
|
|
4
35
|
|
|
5
36
|
/**
|
|
6
37
|
* @tagname pie-tooltip
|
|
38
|
+
* @event {Event} pie-tooltip-close - When the close button is clicked. Set `isOpen` to `false` in response.
|
|
39
|
+
* @slot content - The descriptive content of the panel. Must not contain focusable elements.
|
|
40
|
+
* @slot action - An optional slot for interactive content such as a `pie-button`. Filling this slot switches the panel to a non-modal dialog.
|
|
7
41
|
*/
|
|
8
42
|
export declare class PieTooltip extends PieElement implements TooltipProps {
|
|
9
|
-
|
|
43
|
+
trigger: TooltipProps['trigger'];
|
|
44
|
+
isOpen: boolean;
|
|
45
|
+
position: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
46
|
+
size: "default" | "fit-to-content" | "fill-container";
|
|
47
|
+
variant: "default" | "inverse";
|
|
48
|
+
type: "default" | "icon";
|
|
49
|
+
isDismissible: boolean;
|
|
50
|
+
heading: TooltipProps['heading'];
|
|
51
|
+
headingLevel: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
52
|
+
aria: TooltipProps['aria'];
|
|
53
|
+
private _assignedActionElements;
|
|
54
|
+
private _originElement;
|
|
55
|
+
private _hasActionContent;
|
|
56
|
+
private _isPositioned;
|
|
57
|
+
private _triggerTrackingController;
|
|
58
|
+
private _directionObserver;
|
|
59
|
+
private _reanchorFrame;
|
|
60
|
+
private _shouldResolveOverlayMode;
|
|
10
61
|
static styles: CSSResult;
|
|
62
|
+
private get _mode();
|
|
63
|
+
protected firstUpdated(): void;
|
|
64
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
65
|
+
disconnectedCallback(): void;
|
|
66
|
+
private startTrackingTrigger;
|
|
67
|
+
private stopTrackingTrigger;
|
|
68
|
+
private resolveMode;
|
|
69
|
+
private resolveOverlayMode;
|
|
70
|
+
private projectOverTrigger;
|
|
71
|
+
private handleCloseButtonClick;
|
|
72
|
+
private renderHeading;
|
|
73
|
+
private renderCloseButton;
|
|
74
|
+
render(): TemplateResult;
|
|
11
75
|
}
|
|
12
76
|
|
|
77
|
+
export declare const positions: readonly ["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end"];
|
|
78
|
+
|
|
79
|
+
export declare const sizes: readonly ["default", "fit-to-content", "fill-container"];
|
|
80
|
+
|
|
81
|
+
export declare type TooltipMode = typeof modes[number];
|
|
82
|
+
|
|
13
83
|
export declare interface TooltipProps {
|
|
84
|
+
/**
|
|
85
|
+
* The `id` of the element the panel is anchored to. The trigger lives elsewhere in the
|
|
86
|
+
* DOM and is never slotted into the tooltip.
|
|
87
|
+
*/
|
|
88
|
+
trigger?: string;
|
|
89
|
+
/**
|
|
90
|
+
* When true, the panel is visible. The component never writes to this property: the
|
|
91
|
+
* consumer owns it and updates it in response to the close event.
|
|
92
|
+
*/
|
|
93
|
+
isOpen?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The side of the trigger the panel sits on, and its alignment along the cross axis.
|
|
96
|
+
*/
|
|
97
|
+
position?: typeof positions[number];
|
|
98
|
+
/**
|
|
99
|
+
* How the panel sizes itself. `default` is a fixed 280px and wraps, `fit-to-content` is as
|
|
100
|
+
* wide as its content, and `fill-container` matches the inline size of the trigger's parent
|
|
101
|
+
* element. Not applied when `type` is `icon`.
|
|
102
|
+
*/
|
|
103
|
+
size?: typeof sizes[number];
|
|
104
|
+
/**
|
|
105
|
+
* The colour treatment of the panel. `default` is the dark panel, `inverse` the light one.
|
|
106
|
+
*/
|
|
107
|
+
variant?: typeof variants[number];
|
|
108
|
+
/**
|
|
109
|
+
* The presentation of the panel. `icon` is the compact treatment intended for icon triggers:
|
|
110
|
+
* it has no arrow and is always as wide as its content, so `size` and `--tooltip-width` have
|
|
111
|
+
* no effect on it.
|
|
112
|
+
*/
|
|
113
|
+
type?: typeof types[number];
|
|
114
|
+
/**
|
|
115
|
+
* When true, a close button is rendered inside the panel.
|
|
116
|
+
*/
|
|
117
|
+
isDismissible?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The text to display in the panel's heading. In dialog mode this also provides the
|
|
120
|
+
* panel's accessible name.
|
|
121
|
+
*/
|
|
122
|
+
heading?: string;
|
|
123
|
+
/**
|
|
124
|
+
* The HTML heading tag to use for the panel's heading. Can be h2-h6.
|
|
125
|
+
*/
|
|
126
|
+
headingLevel?: typeof headingLevels[number];
|
|
127
|
+
/**
|
|
128
|
+
* The ARIA labels used for various parts of the tooltip.
|
|
129
|
+
*/
|
|
130
|
+
aria?: AriaProps;
|
|
14
131
|
}
|
|
15
132
|
|
|
133
|
+
export declare const types: readonly ["default", "icon"];
|
|
134
|
+
|
|
135
|
+
export declare const variants: readonly ["default", "inverse"];
|
|
136
|
+
|
|
16
137
|
export { }
|