@destyler/tooltip 0.0.2 → 0.0.4
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 +7 -0
- package/dist/component.cjs +370 -373
- package/dist/component.d.cts +438 -58
- package/dist/component.d.mts +438 -58
- package/dist/component.d.ts +438 -58
- package/dist/component.mjs +360 -373
- package/dist/index.cjs +13 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/resolver.cjs +8 -8
- package/dist/resolver.d.cts +2 -2
- package/dist/resolver.d.mts +2 -2
- package/dist/resolver.d.ts +2 -2
- package/dist/resolver.mjs +8 -8
- package/dist/shared/tooltip.6a045e60.d.cts +1047 -0
- package/dist/shared/tooltip.6a045e60.d.mts +1047 -0
- package/dist/shared/tooltip.6a045e60.d.ts +1047 -0
- package/package.json +20 -21
- package/dist/shared/tooltip.79d8523b.d.cts +0 -600
- package/dist/shared/tooltip.79d8523b.d.mts +0 -600
- package/dist/shared/tooltip.79d8523b.d.ts +0 -600
package/dist/component.mjs
CHANGED
|
@@ -1,184 +1,102 @@
|
|
|
1
|
-
import { defineComponent, h, mergeProps, toRefs, ref, computed, watch, useSlots, onMounted,
|
|
2
|
-
import {
|
|
3
|
-
import { useTimeoutFn, useVModel,
|
|
4
|
-
import { createContext
|
|
1
|
+
import { defineComponent, h, mergeProps, toRefs, ref, computed, watch, useSlots, onMounted, withModifiers } from 'vue';
|
|
2
|
+
import { popperArrowProps, PopperArrow, PopperRoot, popperContentProps, PopperContent, PopperAnchor } from '@destyler/popper';
|
|
3
|
+
import { useForwardExpose, useTimeoutFn, useVModel, useForwardProps, useGraceArea, useForwardPropsEmits, useId } from '@destyler/composition';
|
|
4
|
+
import { createContext } from '@destyler/shared';
|
|
5
|
+
import { primitiveProps, Primitive } from '@destyler/primitive';
|
|
5
6
|
import { useEventListener } from '@vueuse/core';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { DestylerPrimitive } from '@destyler/primitive';
|
|
7
|
+
import { DismissableLayer } from '@destyler/dismissable-layer';
|
|
8
|
+
import { VisuallyHidden } from '@destyler/visually-hidden';
|
|
9
|
+
import { teleportPrimitiveProps, TeleportPrimitive } from '@destyler/teleport';
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
type: [String, Object],
|
|
14
|
-
required: false,
|
|
15
|
-
default: "div"
|
|
16
|
-
},
|
|
17
|
-
asChild: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
required: false,
|
|
20
|
-
default: false
|
|
21
|
-
},
|
|
22
|
-
width: {
|
|
23
|
-
type: Number,
|
|
24
|
-
required: false,
|
|
25
|
-
default: 10
|
|
26
|
-
},
|
|
27
|
-
height: {
|
|
28
|
-
type: Number,
|
|
29
|
-
required: false,
|
|
30
|
-
default: 5
|
|
31
|
-
}
|
|
11
|
+
const tooltipArrowProps = {
|
|
12
|
+
...popperArrowProps
|
|
32
13
|
};
|
|
33
|
-
const
|
|
14
|
+
const TooltipArrow = defineComponent({
|
|
34
15
|
name: "DestylerTooltipArrow",
|
|
35
|
-
props:
|
|
16
|
+
props: tooltipArrowProps,
|
|
17
|
+
setup() {
|
|
18
|
+
useForwardExpose();
|
|
19
|
+
},
|
|
36
20
|
render() {
|
|
37
|
-
return h(
|
|
38
|
-
default: () => this.$slots.default?.()
|
|
39
|
-
});
|
|
21
|
+
return h(PopperArrow, mergeProps(this.$props), () => this.$slots.default?.());
|
|
40
22
|
}
|
|
41
23
|
});
|
|
42
24
|
|
|
43
25
|
const TOOLTIP_OPEN = "tooltip.open";
|
|
44
|
-
function getExitSideFromRect(point, rect) {
|
|
45
|
-
const top = Math.abs(rect.top - point.y);
|
|
46
|
-
const bottom = Math.abs(rect.bottom - point.y);
|
|
47
|
-
const right = Math.abs(rect.right - point.x);
|
|
48
|
-
const left = Math.abs(rect.left - point.x);
|
|
49
|
-
switch (Math.min(top, bottom, right, left)) {
|
|
50
|
-
case left:
|
|
51
|
-
return "left";
|
|
52
|
-
case right:
|
|
53
|
-
return "right";
|
|
54
|
-
case top:
|
|
55
|
-
return "top";
|
|
56
|
-
case bottom:
|
|
57
|
-
return "bottom";
|
|
58
|
-
default:
|
|
59
|
-
throw new Error("unreachable");
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
|
|
63
|
-
const paddedExitPoints = [];
|
|
64
|
-
switch (exitSide) {
|
|
65
|
-
case "top":
|
|
66
|
-
paddedExitPoints.push(
|
|
67
|
-
{ x: exitPoint.x - padding, y: exitPoint.y + padding },
|
|
68
|
-
{ x: exitPoint.x + padding, y: exitPoint.y + padding }
|
|
69
|
-
);
|
|
70
|
-
break;
|
|
71
|
-
case "bottom":
|
|
72
|
-
paddedExitPoints.push(
|
|
73
|
-
{ x: exitPoint.x - padding, y: exitPoint.y - padding },
|
|
74
|
-
{ x: exitPoint.x + padding, y: exitPoint.y - padding }
|
|
75
|
-
);
|
|
76
|
-
break;
|
|
77
|
-
case "left":
|
|
78
|
-
paddedExitPoints.push(
|
|
79
|
-
{ x: exitPoint.x + padding, y: exitPoint.y - padding },
|
|
80
|
-
{ x: exitPoint.x + padding, y: exitPoint.y + padding }
|
|
81
|
-
);
|
|
82
|
-
break;
|
|
83
|
-
case "right":
|
|
84
|
-
paddedExitPoints.push(
|
|
85
|
-
{ x: exitPoint.x - padding, y: exitPoint.y - padding },
|
|
86
|
-
{ x: exitPoint.x - padding, y: exitPoint.y + padding }
|
|
87
|
-
);
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
return paddedExitPoints;
|
|
91
|
-
}
|
|
92
|
-
function getPointsFromRect(rect) {
|
|
93
|
-
const { top, right, bottom, left } = rect;
|
|
94
|
-
return [
|
|
95
|
-
{ x: left, y: top },
|
|
96
|
-
{ x: right, y: top },
|
|
97
|
-
{ x: right, y: bottom },
|
|
98
|
-
{ x: left, y: bottom }
|
|
99
|
-
];
|
|
100
|
-
}
|
|
101
|
-
function getHull(points) {
|
|
102
|
-
const newPoints = points.slice();
|
|
103
|
-
newPoints.sort((a, b) => {
|
|
104
|
-
if (a.x < b.x)
|
|
105
|
-
return -1;
|
|
106
|
-
else if (a.x > b.x)
|
|
107
|
-
return 1;
|
|
108
|
-
else if (a.y < b.y)
|
|
109
|
-
return -1;
|
|
110
|
-
else if (a.y > b.y)
|
|
111
|
-
return 1;
|
|
112
|
-
else
|
|
113
|
-
return 0;
|
|
114
|
-
});
|
|
115
|
-
return getHullPresorted(newPoints);
|
|
116
|
-
}
|
|
117
|
-
function getHullPresorted(points) {
|
|
118
|
-
if (points.length <= 1)
|
|
119
|
-
return points.slice();
|
|
120
|
-
const upperHull = [];
|
|
121
|
-
for (let i = 0; i < points.length; i++) {
|
|
122
|
-
const p = points[i];
|
|
123
|
-
while (upperHull.length >= 2) {
|
|
124
|
-
const q = upperHull[upperHull.length - 1];
|
|
125
|
-
const r = upperHull[upperHull.length - 2];
|
|
126
|
-
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x))
|
|
127
|
-
upperHull.pop();
|
|
128
|
-
else
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
upperHull.push(p);
|
|
132
|
-
}
|
|
133
|
-
upperHull.pop();
|
|
134
|
-
const lowerHull = [];
|
|
135
|
-
for (let i = points.length - 1; i >= 0; i--) {
|
|
136
|
-
const p = points[i];
|
|
137
|
-
while (lowerHull.length >= 2) {
|
|
138
|
-
const q = lowerHull[lowerHull.length - 1];
|
|
139
|
-
const r = lowerHull[lowerHull.length - 2];
|
|
140
|
-
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x))
|
|
141
|
-
lowerHull.pop();
|
|
142
|
-
else
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
lowerHull.push(p);
|
|
146
|
-
}
|
|
147
|
-
lowerHull.pop();
|
|
148
|
-
if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y)
|
|
149
|
-
return upperHull;
|
|
150
|
-
else
|
|
151
|
-
return upperHull.concat(lowerHull);
|
|
152
|
-
}
|
|
153
26
|
|
|
154
|
-
const
|
|
27
|
+
const tooltipProviderProps = {
|
|
28
|
+
/**
|
|
29
|
+
* The duration from when the pointer enters the trigger until the tooltip gets opened.
|
|
30
|
+
*
|
|
31
|
+
* @default 700
|
|
32
|
+
*/
|
|
155
33
|
delayDuration: {
|
|
156
34
|
type: Number,
|
|
157
35
|
required: false,
|
|
158
36
|
default: 700
|
|
159
37
|
},
|
|
38
|
+
/**
|
|
39
|
+
* How much time a user has to enter another trigger without incurring a delay again.
|
|
40
|
+
*
|
|
41
|
+
* @default 300
|
|
42
|
+
*/
|
|
160
43
|
skipDelayDuration: {
|
|
161
44
|
type: Number,
|
|
162
45
|
required: false,
|
|
163
46
|
default: 300
|
|
164
47
|
},
|
|
48
|
+
/**
|
|
49
|
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
165
53
|
disableHoverableContent: {
|
|
166
54
|
type: Boolean,
|
|
167
55
|
required: false,
|
|
168
56
|
default: false
|
|
169
57
|
},
|
|
58
|
+
/**
|
|
59
|
+
* When `true`, clicking on trigger will not close the content.
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
170
63
|
disableClosingTrigger: {
|
|
171
64
|
type: Boolean,
|
|
172
65
|
required: false,
|
|
173
66
|
default: false
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* When `true`, disable tooltip
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
disabled: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
required: false,
|
|
76
|
+
default: false
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* Prevent the tooltip from opening if the focus did not come from
|
|
80
|
+
* the keyboard by matching against the `:focus-visible` selector.
|
|
81
|
+
* This is useful if you want to avoid opening it when switching
|
|
82
|
+
* browser tabs or closing a dialog.
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
ignoreNonKeyboardFocus: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
required: false,
|
|
89
|
+
default: false
|
|
174
90
|
}
|
|
175
91
|
};
|
|
176
92
|
const [injectTooltipProviderContext, provideTooltipProviderContext] = createContext("DestylerTooltipProvider");
|
|
177
|
-
const
|
|
93
|
+
const TooltipProvider = defineComponent({
|
|
178
94
|
name: "DestylerTooltipProvider",
|
|
179
|
-
|
|
95
|
+
inheritAttrs: false,
|
|
96
|
+
props: tooltipProviderProps,
|
|
180
97
|
setup(props) {
|
|
181
|
-
const { delayDuration, skipDelayDuration, disableHoverableContent, disableClosingTrigger } = toRefs(props);
|
|
98
|
+
const { delayDuration, skipDelayDuration, disableHoverableContent, disableClosingTrigger, ignoreNonKeyboardFocus, disabled } = toRefs(props);
|
|
99
|
+
useForwardExpose();
|
|
182
100
|
const isOpenDelayed = ref(true);
|
|
183
101
|
const isPointerInTransitRef = ref(false);
|
|
184
102
|
const { start: startTimer, stop: clearTimer } = useTimeoutFn(() => {
|
|
@@ -195,11 +113,10 @@ const DestylerTooltipProvider = defineComponent({
|
|
|
195
113
|
startTimer();
|
|
196
114
|
},
|
|
197
115
|
isPointerInTransitRef,
|
|
198
|
-
onPointerInTransitChange(inTransit) {
|
|
199
|
-
isPointerInTransitRef.value = inTransit;
|
|
200
|
-
},
|
|
201
116
|
disableHoverableContent,
|
|
202
|
-
disableClosingTrigger
|
|
117
|
+
disableClosingTrigger,
|
|
118
|
+
disabled,
|
|
119
|
+
ignoreNonKeyboardFocus
|
|
203
120
|
});
|
|
204
121
|
},
|
|
205
122
|
render() {
|
|
@@ -207,50 +124,105 @@ const DestylerTooltipProvider = defineComponent({
|
|
|
207
124
|
}
|
|
208
125
|
});
|
|
209
126
|
|
|
210
|
-
const
|
|
127
|
+
const tooltipRootProps = {
|
|
128
|
+
/**
|
|
129
|
+
* The open state of the tooltip when it is initially rendered.
|
|
130
|
+
* Use when you do not need to control its open state.
|
|
131
|
+
*
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
211
134
|
defaultOpen: {
|
|
212
135
|
type: Boolean,
|
|
213
136
|
required: false,
|
|
214
137
|
default: false
|
|
215
138
|
},
|
|
139
|
+
/**
|
|
140
|
+
* The controlled open state of the tooltip.
|
|
141
|
+
*/
|
|
216
142
|
open: {
|
|
217
143
|
type: Boolean,
|
|
218
144
|
required: false,
|
|
219
145
|
default: void 0
|
|
220
146
|
},
|
|
147
|
+
/**
|
|
148
|
+
* Override the duration given to the `Provider` to customise
|
|
149
|
+
* the open delay for a specific tooltip.
|
|
150
|
+
*
|
|
151
|
+
* @default 400
|
|
152
|
+
*/
|
|
221
153
|
delayDuration: {
|
|
222
154
|
type: Number,
|
|
223
155
|
required: false,
|
|
224
156
|
default: 400
|
|
225
157
|
},
|
|
158
|
+
/**
|
|
159
|
+
* Prevents Tooltip.Content from remaining open when hovering.
|
|
160
|
+
* Disabling this has accessibility consequences. Inherits
|
|
161
|
+
* from Tooltip.Provider.
|
|
162
|
+
*/
|
|
226
163
|
disableHoverableContent: {
|
|
227
164
|
type: Boolean,
|
|
228
165
|
required: false,
|
|
229
166
|
default: void 0
|
|
230
167
|
},
|
|
168
|
+
/**
|
|
169
|
+
* When `true`, clicking on trigger will not close the content.
|
|
170
|
+
*
|
|
171
|
+
* @default false
|
|
172
|
+
*/
|
|
231
173
|
disableClosingTrigger: {
|
|
232
174
|
type: Boolean,
|
|
233
175
|
required: false,
|
|
234
176
|
default: void 0
|
|
177
|
+
},
|
|
178
|
+
/**
|
|
179
|
+
* When `true`, disable tooltip
|
|
180
|
+
*
|
|
181
|
+
* @default false
|
|
182
|
+
*/
|
|
183
|
+
disabled: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
required: false,
|
|
186
|
+
default: void 0
|
|
187
|
+
},
|
|
188
|
+
/**
|
|
189
|
+
* Prevent the tooltip from opening if the focus did not come from
|
|
190
|
+
* the keyboard by matching against the `:focus-visible` selector.
|
|
191
|
+
* This is useful if you want to avoid opening it when switching
|
|
192
|
+
* browser tabs or closing a dialog.
|
|
193
|
+
*
|
|
194
|
+
* @default false
|
|
195
|
+
*/
|
|
196
|
+
ignoreNonKeyboardFocus: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
required: false,
|
|
199
|
+
default: void 0
|
|
235
200
|
}
|
|
236
201
|
};
|
|
202
|
+
const tooltipRootEmits = {
|
|
203
|
+
/**
|
|
204
|
+
* Event handler called when the open state of the tooltip changes.
|
|
205
|
+
*/
|
|
206
|
+
"update:open": (_value) => true
|
|
207
|
+
};
|
|
237
208
|
const [injectTooltipRootContext, provideTooltipRootContext] = createContext("DestylerTooltipRoot");
|
|
238
|
-
const
|
|
209
|
+
const TooltipRoot = defineComponent({
|
|
239
210
|
name: "DestylerTooltipRoot",
|
|
240
|
-
props:
|
|
241
|
-
emits:
|
|
211
|
+
props: tooltipRootProps,
|
|
212
|
+
emits: tooltipRootEmits,
|
|
242
213
|
setup(props, { emit }) {
|
|
214
|
+
useForwardExpose();
|
|
243
215
|
const providerContext = injectTooltipProviderContext();
|
|
244
|
-
const disableHoverableContent = computed(() =>
|
|
245
|
-
return props.disableHoverableContent ?? providerContext.disableHoverableContent.value;
|
|
246
|
-
});
|
|
216
|
+
const disableHoverableContent = computed(() => props.disableHoverableContent ?? providerContext.disableHoverableContent.value);
|
|
247
217
|
const disableClosingTrigger = computed(() => props.disableClosingTrigger ?? providerContext.disableClosingTrigger.value);
|
|
218
|
+
const disableTooltip = computed(() => props.disabled ?? providerContext.disabled.value);
|
|
248
219
|
const delayDuration = computed(() => props.delayDuration ?? providerContext.delayDuration.value);
|
|
249
|
-
const
|
|
220
|
+
const ignoreNonKeyboardFocus = computed(() => props.ignoreNonKeyboardFocus ?? providerContext.ignoreNonKeyboardFocus.value);
|
|
221
|
+
const open = useVModel(props, "open", emit, {
|
|
250
222
|
defaultValue: props.defaultOpen,
|
|
251
223
|
passive: props.open === void 0
|
|
252
224
|
});
|
|
253
|
-
watch(
|
|
225
|
+
watch(open, (isOpen) => {
|
|
254
226
|
if (!providerContext.onClose)
|
|
255
227
|
return;
|
|
256
228
|
if (isOpen) {
|
|
@@ -263,29 +235,29 @@ const DestylerTooltipRoot = defineComponent({
|
|
|
263
235
|
const wasOpenDelayedRef = ref(false);
|
|
264
236
|
const trigger = ref();
|
|
265
237
|
const stateAttribute = computed(() => {
|
|
266
|
-
if (!
|
|
238
|
+
if (!open.value)
|
|
267
239
|
return "closed";
|
|
268
240
|
return wasOpenDelayedRef.value ? "delayed-open" : "instant-open";
|
|
269
241
|
});
|
|
270
242
|
const { start: startTimer, stop: clearTimer } = useTimeoutFn(() => {
|
|
271
243
|
wasOpenDelayedRef.value = true;
|
|
272
|
-
|
|
244
|
+
open.value = true;
|
|
273
245
|
}, delayDuration, { immediate: false });
|
|
274
246
|
function handleOpen() {
|
|
275
247
|
clearTimer();
|
|
276
248
|
wasOpenDelayedRef.value = false;
|
|
277
|
-
|
|
249
|
+
open.value = true;
|
|
278
250
|
}
|
|
279
251
|
function handleClose() {
|
|
280
252
|
clearTimer();
|
|
281
|
-
|
|
253
|
+
open.value = false;
|
|
282
254
|
}
|
|
283
255
|
function handleDelayedOpen() {
|
|
284
256
|
startTimer();
|
|
285
257
|
}
|
|
286
258
|
provideTooltipRootContext({
|
|
287
|
-
contentId:
|
|
288
|
-
open
|
|
259
|
+
contentId: "",
|
|
260
|
+
open,
|
|
289
261
|
stateAttribute,
|
|
290
262
|
trigger,
|
|
291
263
|
onTriggerChange(el) {
|
|
@@ -298,98 +270,150 @@ const DestylerTooltipRoot = defineComponent({
|
|
|
298
270
|
handleOpen();
|
|
299
271
|
},
|
|
300
272
|
onTriggerLeave() {
|
|
301
|
-
if (disableHoverableContent.value)
|
|
273
|
+
if (disableHoverableContent.value) {
|
|
302
274
|
handleClose();
|
|
303
|
-
else
|
|
275
|
+
} else {
|
|
304
276
|
clearTimer();
|
|
277
|
+
}
|
|
305
278
|
},
|
|
306
279
|
onOpen: handleOpen,
|
|
307
280
|
onClose: handleClose,
|
|
308
281
|
disableHoverableContent,
|
|
309
|
-
disableClosingTrigger
|
|
282
|
+
disableClosingTrigger,
|
|
283
|
+
disabled: disableTooltip,
|
|
284
|
+
ignoreNonKeyboardFocus
|
|
310
285
|
});
|
|
311
286
|
},
|
|
312
287
|
render() {
|
|
313
|
-
return h(
|
|
314
|
-
default: () => this.$slots.default?.()
|
|
315
|
-
});
|
|
288
|
+
return h(PopperRoot, null, () => this.$slots.default?.());
|
|
316
289
|
}
|
|
317
290
|
});
|
|
318
291
|
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
default: false
|
|
329
|
-
},
|
|
292
|
+
const tooltipContentImplProps = {
|
|
293
|
+
...primitiveProps,
|
|
294
|
+
/**
|
|
295
|
+
* The preferred side of the trigger to render against when open.
|
|
296
|
+
* Will be reversed when collisions occur and avoidCollisions
|
|
297
|
+
* is enabled.
|
|
298
|
+
*
|
|
299
|
+
* @default top
|
|
300
|
+
*/
|
|
330
301
|
side: {
|
|
331
|
-
|
|
332
|
-
required: false,
|
|
302
|
+
...popperContentProps.side,
|
|
333
303
|
default: "top"
|
|
334
304
|
},
|
|
305
|
+
/**
|
|
306
|
+
* The distance in pixels from the trigger.
|
|
307
|
+
*
|
|
308
|
+
* @default 0
|
|
309
|
+
*/
|
|
335
310
|
sideOffset: {
|
|
336
|
-
|
|
337
|
-
required: false,
|
|
338
|
-
default: 0
|
|
311
|
+
...popperContentProps.sideOffset
|
|
339
312
|
},
|
|
313
|
+
/**
|
|
314
|
+
* The preferred alignment against the trigger.
|
|
315
|
+
* May change when collisions occur.
|
|
316
|
+
*
|
|
317
|
+
* @default center
|
|
318
|
+
*/
|
|
340
319
|
align: {
|
|
341
|
-
|
|
342
|
-
required: false,
|
|
343
|
-
default: "center"
|
|
320
|
+
...popperContentProps.align
|
|
344
321
|
},
|
|
322
|
+
/**
|
|
323
|
+
* An offset in pixels from the `start` or `end` alignment options.
|
|
324
|
+
*
|
|
325
|
+
* @default 0
|
|
326
|
+
*/
|
|
345
327
|
alignOffset: {
|
|
346
|
-
|
|
347
|
-
required: false,
|
|
348
|
-
default: 0
|
|
328
|
+
...popperContentProps.alignOffset
|
|
349
329
|
},
|
|
330
|
+
/**
|
|
331
|
+
* When `true`, overrides the side andalign preferences
|
|
332
|
+
* to prevent collisions with boundary edges.
|
|
333
|
+
*
|
|
334
|
+
* @default true
|
|
335
|
+
*/
|
|
350
336
|
avoidCollisions: {
|
|
351
|
-
|
|
352
|
-
required: false,
|
|
353
|
-
default: true
|
|
337
|
+
...popperContentProps.avoidCollisions
|
|
354
338
|
},
|
|
339
|
+
/**
|
|
340
|
+
* The element used as the collision boundary. By default
|
|
341
|
+
* this is the viewport, though you can provide additional
|
|
342
|
+
* element(s) to be included in this check.
|
|
343
|
+
*
|
|
344
|
+
* @default () => []
|
|
345
|
+
*/
|
|
355
346
|
collisionBoundary: {
|
|
356
|
-
|
|
357
|
-
required: false,
|
|
358
|
-
default: () => []
|
|
347
|
+
...popperContentProps.collisionBoundary
|
|
359
348
|
},
|
|
349
|
+
/**
|
|
350
|
+
* The distance in pixels from the boundary edges where collision
|
|
351
|
+
* detection should occur. Accepts a number (same for all sides),
|
|
352
|
+
* or a partial padding object, for example: { top: 20, left: 20 }.
|
|
353
|
+
*
|
|
354
|
+
* @default 0
|
|
355
|
+
*/
|
|
360
356
|
collisionPadding: {
|
|
361
|
-
|
|
362
|
-
required: false,
|
|
363
|
-
default: 0
|
|
357
|
+
...popperContentProps.collisionPadding
|
|
364
358
|
},
|
|
359
|
+
/**
|
|
360
|
+
* The distance in pixels from the boundary edges where collision
|
|
361
|
+
* detection should occur. Accepts a number (same for all sides),
|
|
362
|
+
* or a partial padding object, for example: { top: 20, left: 20 }.
|
|
363
|
+
*
|
|
364
|
+
* @default 0
|
|
365
|
+
*/
|
|
365
366
|
arrowPadding: {
|
|
366
|
-
|
|
367
|
-
required: false,
|
|
368
|
-
default: 0
|
|
367
|
+
...popperContentProps.arrowPadding
|
|
369
368
|
},
|
|
369
|
+
/**
|
|
370
|
+
* The sticky behavior on the align axis. `partial` will keep the
|
|
371
|
+
* content in the boundary as long as the trigger is at least partially
|
|
372
|
+
* in the boundary whilst "always" will keep the content in the boundary
|
|
373
|
+
* regardless.
|
|
374
|
+
*
|
|
375
|
+
* @default partial
|
|
376
|
+
*/
|
|
370
377
|
sticky: {
|
|
371
|
-
|
|
372
|
-
required: false,
|
|
373
|
-
default: "partial"
|
|
378
|
+
...popperContentProps.sticky
|
|
374
379
|
},
|
|
380
|
+
/**
|
|
381
|
+
* Whether to hide the content when the trigger becomes fully occluded.
|
|
382
|
+
*
|
|
383
|
+
* @default false
|
|
384
|
+
*/
|
|
375
385
|
hideWhenDetached: {
|
|
376
|
-
|
|
377
|
-
required: false,
|
|
378
|
-
default: false
|
|
386
|
+
...popperContentProps.hideWhenDetached
|
|
379
387
|
},
|
|
388
|
+
/**
|
|
389
|
+
* By default, screenreaders will announce the content inside
|
|
390
|
+
* the component. If this is not descriptive enough, or you have
|
|
391
|
+
* content that cannot be announced, use aria-label as a more
|
|
392
|
+
* descriptive label.
|
|
393
|
+
*
|
|
394
|
+
*/
|
|
380
395
|
ariaLabel: {
|
|
381
396
|
type: String,
|
|
382
397
|
required: false
|
|
383
398
|
}
|
|
384
399
|
};
|
|
385
|
-
const
|
|
386
|
-
|
|
400
|
+
const tooltipContentImplEmits = {
|
|
401
|
+
/**
|
|
402
|
+
* Event handler called when focus moves to the destructive action after opening. It can be prevented by calling `event.preventDefault`
|
|
403
|
+
*/
|
|
404
|
+
escapeKeyDown: (_event) => true,
|
|
405
|
+
/**
|
|
406
|
+
* Event handler called when a pointer event occurs outside the bounds of the component. It can be prevented by calling `event.preventDefault`.
|
|
407
|
+
*/
|
|
408
|
+
pointerDownOutside: (_event) => true
|
|
409
|
+
};
|
|
410
|
+
const TooltipContentImpl = defineComponent({
|
|
387
411
|
name: "DestylerTooltipContentImpl",
|
|
388
|
-
props:
|
|
389
|
-
emits:
|
|
412
|
+
props: tooltipContentImplProps,
|
|
413
|
+
emits: tooltipContentImplEmits,
|
|
390
414
|
setup(props) {
|
|
391
|
-
const contentElement = ref();
|
|
392
415
|
const rootContext = injectTooltipRootContext();
|
|
416
|
+
const { forwardRef } = useForwardExpose();
|
|
393
417
|
const slot = useSlots();
|
|
394
418
|
const defaultSlot = computed(() => slot.default?.());
|
|
395
419
|
const ariaLabel = computed(() => {
|
|
@@ -405,7 +429,7 @@ const DestylerTooltipContentImpl = defineComponent({
|
|
|
405
429
|
defaultSlot.value?.forEach((node) => recursiveTextSearch(node));
|
|
406
430
|
return content;
|
|
407
431
|
});
|
|
408
|
-
const
|
|
432
|
+
const popperContentProps2 = computed(() => {
|
|
409
433
|
const { ariaLabel: _, ...restProps } = props;
|
|
410
434
|
return restProps;
|
|
411
435
|
});
|
|
@@ -418,14 +442,14 @@ const DestylerTooltipContentImpl = defineComponent({
|
|
|
418
442
|
useEventListener(window, TOOLTIP_OPEN, rootContext.onClose);
|
|
419
443
|
});
|
|
420
444
|
return {
|
|
421
|
-
contentElement,
|
|
422
445
|
rootContext,
|
|
423
|
-
popperContentProps,
|
|
424
|
-
ariaLabel
|
|
446
|
+
popperContentProps: popperContentProps2,
|
|
447
|
+
ariaLabel,
|
|
448
|
+
forwardRef
|
|
425
449
|
};
|
|
426
450
|
},
|
|
427
451
|
render() {
|
|
428
|
-
return h(
|
|
452
|
+
return h(DismissableLayer, {
|
|
429
453
|
asChild: true,
|
|
430
454
|
disableOutsidePointerEvents: false,
|
|
431
455
|
onEscapeKeyDown: (event) => {
|
|
@@ -436,170 +460,137 @@ const DestylerTooltipContentImpl = defineComponent({
|
|
|
436
460
|
event.preventDefault();
|
|
437
461
|
this.$emit("pointerDownOutside", event);
|
|
438
462
|
},
|
|
463
|
+
onFocusOutside: withModifiers(() => {
|
|
464
|
+
}, ["prevent"]),
|
|
439
465
|
onDismiss: () => {
|
|
440
466
|
this.rootContext.onClose();
|
|
441
467
|
}
|
|
442
|
-
}, h(
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
"
|
|
449
|
-
"
|
|
450
|
-
"
|
|
468
|
+
}, () => h(PopperContent, mergeProps(
|
|
469
|
+
{
|
|
470
|
+
...this.$attrs,
|
|
471
|
+
...this.popperContentProps
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"ref": this.forwardRef,
|
|
475
|
+
"data-state": this.rootContext.stateAttribute.value,
|
|
476
|
+
"style": {
|
|
477
|
+
"--destyler-tooltip-content-transform-origin": "var(--destyler-popper-transform-origin)",
|
|
478
|
+
"--destyler-tooltip-content-available-width": "var(--destyler-popper-available-width)",
|
|
479
|
+
"--destyler-tooltip-content-available-height": "var(--destyler-popper-available-height)",
|
|
480
|
+
"--destyler-tooltip-trigger-width": "var(--destyler-popper-anchor-width)",
|
|
481
|
+
"--destyler-tooltip-trigger-height": "var(--destyler-popper-anchor-height)"
|
|
482
|
+
}
|
|
451
483
|
}
|
|
452
|
-
|
|
484
|
+
), () => [
|
|
453
485
|
this.$slots.default?.(),
|
|
454
|
-
h(
|
|
455
|
-
role: "tooltip"
|
|
456
|
-
|
|
486
|
+
h(VisuallyHidden, {
|
|
487
|
+
role: "tooltip",
|
|
488
|
+
id: this.rootContext.contentId
|
|
489
|
+
}, () => this.ariaLabel)
|
|
457
490
|
]));
|
|
458
491
|
}
|
|
459
492
|
});
|
|
460
493
|
|
|
461
|
-
const
|
|
494
|
+
const TooltipContentHoverable = defineComponent({
|
|
462
495
|
name: "DestylerTooltipContentHoverable",
|
|
463
|
-
props:
|
|
464
|
-
setup() {
|
|
496
|
+
props: tooltipContentImplProps,
|
|
497
|
+
setup(props) {
|
|
498
|
+
const forwardedProps = useForwardProps(props);
|
|
465
499
|
const { forwardRef, currentElement } = useForwardExpose();
|
|
466
500
|
const { trigger, onClose } = injectTooltipRootContext();
|
|
467
501
|
const providerContext = injectTooltipProviderContext();
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
473
|
-
function handleCreateGraceArea(event, hoverTarget) {
|
|
474
|
-
const currentTarget = event.currentTarget;
|
|
475
|
-
const exitPoint = { x: event.clientX, y: event.clientY };
|
|
476
|
-
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
|
477
|
-
const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
|
|
478
|
-
const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
|
|
479
|
-
const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);
|
|
480
|
-
pointerGraceArea.value = graceArea;
|
|
481
|
-
providerContext.onPointerInTransitChange(true);
|
|
482
|
-
}
|
|
483
|
-
watchEffect((cleanupFn) => {
|
|
484
|
-
if (trigger.value && currentElement.value) {
|
|
485
|
-
const handleTriggerLeave = (event) => handleCreateGraceArea(event, currentElement.value);
|
|
486
|
-
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger.value);
|
|
487
|
-
trigger.value.addEventListener("pointerleave", handleTriggerLeave);
|
|
488
|
-
currentElement.value.addEventListener("pointerleave", handleContentLeave);
|
|
489
|
-
cleanupFn(() => {
|
|
490
|
-
trigger.value?.removeEventListener("pointerleave", handleTriggerLeave);
|
|
491
|
-
currentElement.value?.removeEventListener("pointerleave", handleContentLeave);
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
});
|
|
495
|
-
watchEffect((cleanupFn) => {
|
|
496
|
-
if (pointerGraceArea.value) {
|
|
497
|
-
const handleTrackPointerGrace = (event) => {
|
|
498
|
-
if (!pointerGraceArea.value)
|
|
499
|
-
return;
|
|
500
|
-
const target = event.target;
|
|
501
|
-
const pointerPosition = { x: event.clientX, y: event.clientY };
|
|
502
|
-
const hasEnteredTarget = trigger.value?.contains(target) || currentElement.value?.contains(target);
|
|
503
|
-
const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea.value);
|
|
504
|
-
if (hasEnteredTarget) {
|
|
505
|
-
handleRemoveGraceArea();
|
|
506
|
-
} else if (isPointerOutsideGraceArea) {
|
|
507
|
-
handleRemoveGraceArea();
|
|
508
|
-
onClose();
|
|
509
|
-
}
|
|
510
|
-
};
|
|
511
|
-
document.addEventListener("pointermove", handleTrackPointerGrace);
|
|
512
|
-
cleanupFn(() => document.removeEventListener("pointermove", handleTrackPointerGrace));
|
|
513
|
-
}
|
|
502
|
+
const { isPointerInTransit, onPointerExit } = useGraceArea(trigger, currentElement);
|
|
503
|
+
providerContext.isPointerInTransitRef = isPointerInTransit;
|
|
504
|
+
onPointerExit(() => {
|
|
505
|
+
onClose();
|
|
514
506
|
});
|
|
515
507
|
return {
|
|
516
|
-
forwardRef
|
|
508
|
+
forwardRef,
|
|
509
|
+
forwardedProps
|
|
517
510
|
};
|
|
518
511
|
},
|
|
519
512
|
render() {
|
|
520
|
-
return h(
|
|
521
|
-
ref:
|
|
522
|
-
|
|
523
|
-
}, {
|
|
524
|
-
default: () => this.$slots.default?.()
|
|
525
|
-
});
|
|
513
|
+
return h(TooltipContentImpl, mergeProps(this.forwardedProps, {
|
|
514
|
+
ref: this.forwardRef
|
|
515
|
+
}), () => this.$slots.default?.());
|
|
526
516
|
}
|
|
527
517
|
});
|
|
528
518
|
|
|
529
|
-
const
|
|
530
|
-
...
|
|
519
|
+
const tooltipContentProps = {
|
|
520
|
+
...tooltipContentImplProps
|
|
531
521
|
};
|
|
532
|
-
const
|
|
533
|
-
|
|
522
|
+
const tooltipContentEmits = {
|
|
523
|
+
...tooltipContentImplEmits
|
|
524
|
+
};
|
|
525
|
+
const TooltipContent = defineComponent({
|
|
534
526
|
name: "DestylerTooltipContent",
|
|
535
|
-
props:
|
|
536
|
-
emits:
|
|
527
|
+
props: tooltipContentProps,
|
|
528
|
+
emits: tooltipContentEmits,
|
|
537
529
|
setup(props, { emit }) {
|
|
538
530
|
const rootContext = injectTooltipRootContext();
|
|
539
531
|
const forwarded = useForwardPropsEmits(props, emit);
|
|
532
|
+
const { forwardRef } = useForwardExpose();
|
|
540
533
|
return {
|
|
541
534
|
rootContext,
|
|
542
|
-
forwarded
|
|
535
|
+
forwarded,
|
|
536
|
+
forwardRef
|
|
543
537
|
};
|
|
544
538
|
},
|
|
545
539
|
render() {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}) : null;
|
|
540
|
+
if (this.rootContext.open.value) {
|
|
541
|
+
return h(this.rootContext.disableHoverableContent.value ? TooltipContentImpl : TooltipContentHoverable, mergeProps(this.forwarded, {
|
|
542
|
+
ref: this.forwardRef
|
|
543
|
+
}), () => this.$slots.default?.());
|
|
544
|
+
}
|
|
552
545
|
}
|
|
553
546
|
});
|
|
554
547
|
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
type: [String, Object],
|
|
558
|
-
required: false,
|
|
559
|
-
default: "body"
|
|
560
|
-
},
|
|
561
|
-
disabled: {
|
|
562
|
-
type: Boolean,
|
|
563
|
-
required: false,
|
|
564
|
-
default: false
|
|
565
|
-
},
|
|
566
|
-
forceMount: {
|
|
567
|
-
type: Boolean,
|
|
568
|
-
required: false,
|
|
569
|
-
default: false
|
|
570
|
-
}
|
|
548
|
+
const tooltipPortalProps = {
|
|
549
|
+
...teleportPrimitiveProps
|
|
571
550
|
};
|
|
572
|
-
const
|
|
551
|
+
const TooltipPortal = defineComponent({
|
|
573
552
|
name: "DestylerTooltipPortal",
|
|
574
|
-
props:
|
|
553
|
+
props: tooltipPortalProps,
|
|
575
554
|
render() {
|
|
576
|
-
return h(
|
|
577
|
-
default: () => this.$slots.default?.()
|
|
578
|
-
});
|
|
555
|
+
return h(TeleportPrimitive, mergeProps(this.$props), () => this.$slots.default?.());
|
|
579
556
|
}
|
|
580
557
|
});
|
|
581
558
|
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
},
|
|
559
|
+
const tooltipTriggerProps = {
|
|
560
|
+
...primitiveProps,
|
|
561
|
+
/**
|
|
562
|
+
* @default button
|
|
563
|
+
*/
|
|
588
564
|
as: {
|
|
589
|
-
|
|
590
|
-
required: false,
|
|
565
|
+
...primitiveProps.as,
|
|
591
566
|
default: "button"
|
|
592
567
|
}
|
|
593
568
|
};
|
|
594
|
-
const
|
|
569
|
+
const TooltipTrigger = defineComponent({
|
|
595
570
|
name: "DestylerTooltipTrigger",
|
|
596
|
-
props:
|
|
571
|
+
props: tooltipTriggerProps,
|
|
597
572
|
setup() {
|
|
598
573
|
const rootContext = injectTooltipRootContext();
|
|
599
574
|
const providerContext = injectTooltipProviderContext();
|
|
575
|
+
rootContext.contentId || (rootContext.contentId = useId(void 0, "destyler-tooltip-content"));
|
|
600
576
|
const { forwardRef, currentElement: triggerElement } = useForwardExpose();
|
|
601
577
|
const isPointerDown = ref(false);
|
|
602
578
|
const hasPointerMoveOpened = ref(false);
|
|
579
|
+
const tooltipListeners = computed(() => {
|
|
580
|
+
if (rootContext.disabled.value)
|
|
581
|
+
return {};
|
|
582
|
+
return {
|
|
583
|
+
onclick: handleClick,
|
|
584
|
+
onfocus: handleFocus,
|
|
585
|
+
onpointermove: handlePointerMove,
|
|
586
|
+
onpointerleave: handlePointerLeave,
|
|
587
|
+
onpointerdown: handlePointerDown,
|
|
588
|
+
onblur: handleBlur
|
|
589
|
+
};
|
|
590
|
+
});
|
|
591
|
+
onMounted(() => {
|
|
592
|
+
rootContext.onTriggerChange(triggerElement.value);
|
|
593
|
+
});
|
|
603
594
|
function handlePointerUp() {
|
|
604
595
|
isPointerDown.value = false;
|
|
605
596
|
}
|
|
@@ -607,57 +598,53 @@ const DestylerTooltipTrigger = defineComponent({
|
|
|
607
598
|
isPointerDown.value = true;
|
|
608
599
|
document.addEventListener("pointerup", handlePointerUp, { once: true });
|
|
609
600
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
601
|
+
function handlePointerMove(event) {
|
|
602
|
+
if (event.pointerType === "touch")
|
|
603
|
+
return;
|
|
604
|
+
if (!hasPointerMoveOpened.value && !providerContext.isPointerInTransitRef.value) {
|
|
605
|
+
rootContext.onTriggerEnter();
|
|
606
|
+
hasPointerMoveOpened.value = true;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
function handlePointerLeave() {
|
|
610
|
+
rootContext.onTriggerLeave();
|
|
611
|
+
hasPointerMoveOpened.value = false;
|
|
612
|
+
}
|
|
613
|
+
function handleFocus(event) {
|
|
614
|
+
if (isPointerDown.value)
|
|
615
|
+
return;
|
|
616
|
+
if (rootContext.ignoreNonKeyboardFocus.value && !event.target.matches?.(":focus-visible"))
|
|
617
|
+
return;
|
|
618
|
+
rootContext.onOpen();
|
|
619
|
+
}
|
|
620
|
+
function handleBlur() {
|
|
621
|
+
rootContext.onClose();
|
|
622
|
+
}
|
|
623
|
+
function handleClick() {
|
|
624
|
+
if (!rootContext.disableClosingTrigger.value)
|
|
625
|
+
rootContext.onClose();
|
|
626
|
+
}
|
|
613
627
|
return {
|
|
614
628
|
rootContext,
|
|
615
629
|
providerContext,
|
|
616
630
|
forwardRef,
|
|
617
631
|
isPointerDown,
|
|
618
632
|
hasPointerMoveOpened,
|
|
619
|
-
handlePointerDown
|
|
633
|
+
handlePointerDown,
|
|
634
|
+
tooltipListeners
|
|
620
635
|
};
|
|
621
636
|
},
|
|
622
637
|
render() {
|
|
623
|
-
return h(
|
|
638
|
+
return h(PopperAnchor, {
|
|
624
639
|
asChild: true
|
|
625
|
-
}, h(
|
|
626
|
-
"ref":
|
|
640
|
+
}, () => h(Primitive, mergeProps(this.tooltipListeners, {
|
|
641
|
+
"ref": this.forwardRef,
|
|
627
642
|
"aria-describedby": this.rootContext.open.value ? this.rootContext.contentId : void 0,
|
|
628
643
|
"data-state": this.rootContext.stateAttribute.value,
|
|
629
644
|
"as": this.$props.as,
|
|
630
|
-
"asChild": this.$props.asChild
|
|
631
|
-
|
|
632
|
-
if (event.pointerType === "touch")
|
|
633
|
-
return;
|
|
634
|
-
if (!this.hasPointerMoveOpened && !this.providerContext.isPointerInTransitRef.value) {
|
|
635
|
-
this.rootContext.onTriggerEnter();
|
|
636
|
-
this.hasPointerMoveOpened = true;
|
|
637
|
-
}
|
|
638
|
-
},
|
|
639
|
-
"onPointerleave": () => {
|
|
640
|
-
this.rootContext.onTriggerLeave();
|
|
641
|
-
this.hasPointerMoveOpened = false;
|
|
642
|
-
},
|
|
643
|
-
"onPointerdown": () => {
|
|
644
|
-
this.handlePointerDown();
|
|
645
|
-
},
|
|
646
|
-
"onFocus": () => {
|
|
647
|
-
if (!this.isPointerDown)
|
|
648
|
-
this.rootContext.onOpen();
|
|
649
|
-
},
|
|
650
|
-
"onBlur": () => {
|
|
651
|
-
this.rootContext.onClose();
|
|
652
|
-
},
|
|
653
|
-
"onClick": () => {
|
|
654
|
-
if (!this.rootContext.disableClosingTrigger.value)
|
|
655
|
-
this.rootContext.onClose();
|
|
656
|
-
}
|
|
657
|
-
}, {
|
|
658
|
-
default: () => this.$slots.default?.()
|
|
659
|
-
}));
|
|
645
|
+
"asChild": this.$props.asChild
|
|
646
|
+
}), () => this.$slots.default?.()));
|
|
660
647
|
}
|
|
661
648
|
});
|
|
662
649
|
|
|
663
|
-
export {
|
|
650
|
+
export { TooltipArrow, TooltipContent, TooltipContentHoverable, TooltipContentImpl, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, tooltipArrowProps, tooltipContentEmits, tooltipContentImplEmits, tooltipContentImplProps, tooltipContentProps, tooltipPortalProps, tooltipProviderProps, tooltipRootEmits, tooltipRootProps, tooltipTriggerProps };
|