@fluentui/react-tooltip 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.11
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +817 -23
- package/CHANGELOG.md +310 -110
- package/MIGRATION.md +51 -43
- package/Spec.md +201 -337
- package/dist/index.d.ts +152 -0
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +9 -9
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.types.js.map +1 -1
- package/lib/components/Tooltip/index.js +1 -1
- package/lib/components/Tooltip/index.js.map +1 -1
- package/lib/components/Tooltip/private/constants.js +14 -0
- package/lib/components/Tooltip/private/constants.js.map +1 -0
- package/lib/components/Tooltip/renderTooltip.js +10 -8
- package/lib/components/Tooltip/renderTooltip.js.map +1 -1
- package/lib/components/Tooltip/useTooltip.js +100 -129
- package/lib/components/Tooltip/useTooltip.js.map +1 -1
- package/lib/components/Tooltip/useTooltipStyles.js +52 -23
- package/lib/components/Tooltip/useTooltipStyles.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Tooltip.js +1 -1
- package/lib-commonjs/Tooltip.js.map +1 -1
- package/lib-commonjs/components/Tooltip/Tooltip.js +11 -10
- package/lib-commonjs/components/Tooltip/Tooltip.js.map +1 -1
- package/lib-commonjs/components/Tooltip/Tooltip.types.js.map +1 -1
- package/lib-commonjs/components/Tooltip/index.js +2 -10
- package/lib-commonjs/components/Tooltip/index.js.map +1 -1
- package/lib-commonjs/components/Tooltip/private/constants.js +21 -0
- package/lib-commonjs/components/Tooltip/private/constants.js.map +1 -0
- package/lib-commonjs/components/Tooltip/renderTooltip.js +15 -14
- package/lib-commonjs/components/Tooltip/renderTooltip.js.map +1 -1
- package/lib-commonjs/components/Tooltip/useTooltip.js +106 -135
- package/lib-commonjs/components/Tooltip/useTooltip.js.map +1 -1
- package/lib-commonjs/components/Tooltip/useTooltipStyles.js +58 -26
- package/lib-commonjs/components/Tooltip/useTooltipStyles.js.map +1 -1
- package/lib-commonjs/index.js +32 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +21 -26
- package/dist/react-tooltip.d.ts +0 -162
- package/lib/Tooltip.d.ts +0 -1
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -11
- package/lib/common/isConformant.js.map +0 -1
- package/lib/components/Tooltip/Tooltip.d.ts +0 -6
- package/lib/components/Tooltip/Tooltip.types.d.ts +0 -124
- package/lib/components/Tooltip/index.d.ts +0 -5
- package/lib/components/Tooltip/renderTooltip.d.ts +0 -5
- package/lib/components/Tooltip/useTooltip.d.ts +0 -13
- package/lib/components/Tooltip/useTooltipStyles.d.ts +0 -5
- package/lib/index.d.ts +0 -1
- package/lib-commonjs/Tooltip.d.ts +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -22
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/components/Tooltip/Tooltip.d.ts +0 -6
- package/lib-commonjs/components/Tooltip/Tooltip.types.d.ts +0 -124
- package/lib-commonjs/components/Tooltip/index.d.ts +0 -5
- package/lib-commonjs/components/Tooltip/renderTooltip.d.ts +0 -5
- package/lib-commonjs/components/Tooltip/useTooltip.d.ts +0 -13
- package/lib-commonjs/components/Tooltip/useTooltipStyles.d.ts +0 -5
- package/lib-commonjs/index.d.ts +0 -1
@@ -3,67 +3,55 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useTooltip_unstable = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
|
11
11
|
|
12
|
-
|
12
|
+
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities"); // Style values that are required for popper to properly position the tooltip
|
17
|
-
|
18
|
-
|
19
|
-
var tooltipBorderRadius = 4; // Update the root's borderRadius in useTooltipStyles.ts if this changes
|
20
|
-
|
21
|
-
var arrowHeight = 6; // Update the arrow's width/height in useTooltipStyles.ts if this changes
|
14
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
22
15
|
|
16
|
+
const constants_1 = /*#__PURE__*/require("./private/constants");
|
23
17
|
/**
|
24
18
|
* Create the state required to render Tooltip.
|
25
19
|
*
|
26
|
-
* The returned state can be modified with hooks such as
|
27
|
-
* before being passed to
|
20
|
+
* The returned state can be modified with hooks such as useTooltipStyles_unstable,
|
21
|
+
* before being passed to renderTooltip_unstable.
|
28
22
|
*
|
29
23
|
* @param props - props from this instance of Tooltip
|
30
|
-
* @param ref - reference to root HTMLElement of Tooltip
|
31
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
32
24
|
*/
|
33
25
|
|
34
|
-
|
26
|
+
|
27
|
+
const useTooltip_unstable = props => {
|
35
28
|
var _a, _b, _c, _d;
|
36
29
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
var _j = react_utilities_1.useControllableState({
|
30
|
+
const context = React.useContext(react_shared_contexts_1.TooltipContext);
|
31
|
+
const isServerSideRender = react_utilities_1.useIsSSR();
|
32
|
+
const {
|
33
|
+
targetDocument
|
34
|
+
} = react_shared_contexts_1.useFluent();
|
35
|
+
const [setDelayTimeout, clearDelayTimeout] = react_utilities_1.useTimeout();
|
36
|
+
const {
|
37
|
+
appearance = 'normal',
|
38
|
+
children,
|
39
|
+
content,
|
40
|
+
withArrow = false,
|
41
|
+
positioning = 'above',
|
42
|
+
onVisibleChange,
|
43
|
+
relationship,
|
44
|
+
showDelay = 250,
|
45
|
+
hideDelay = 250,
|
46
|
+
mountNode
|
47
|
+
} = props;
|
48
|
+
const [visible, setVisibleInternal] = react_utilities_1.useControllableState({
|
58
49
|
state: props.visible,
|
59
50
|
initialState: false
|
60
|
-
})
|
61
|
-
|
62
|
-
setVisibleInternal = _j[1];
|
63
|
-
|
64
|
-
var setVisible = React.useCallback(function (newVisible, ev) {
|
51
|
+
});
|
52
|
+
const setVisible = React.useCallback((newVisible, ev) => {
|
65
53
|
clearDelayTimeout();
|
66
|
-
setVisibleInternal(
|
54
|
+
setVisibleInternal(oldVisible => {
|
67
55
|
if (newVisible !== oldVisible) {
|
68
56
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(ev, {
|
69
57
|
visible: newVisible
|
@@ -73,76 +61,74 @@ var useTooltip = function (props, ref) {
|
|
73
61
|
return newVisible;
|
74
62
|
});
|
75
63
|
}, [clearDelayTimeout, setVisibleInternal, onVisibleChange]);
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
triggerAriaAttribute: triggerAriaAttribute,
|
84
|
-
visible: visible,
|
64
|
+
const state = {
|
65
|
+
withArrow,
|
66
|
+
positioning,
|
67
|
+
showDelay,
|
68
|
+
hideDelay,
|
69
|
+
relationship,
|
70
|
+
visible,
|
85
71
|
shouldRenderTooltip: visible,
|
86
|
-
appearance
|
72
|
+
appearance,
|
73
|
+
mountNode,
|
87
74
|
// Slots
|
88
75
|
components: {
|
89
|
-
|
76
|
+
content: 'div'
|
90
77
|
},
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
})
|
78
|
+
content: react_utilities_1.resolveShorthand(content, {
|
79
|
+
defaultProps: {
|
80
|
+
role: 'tooltip'
|
81
|
+
},
|
82
|
+
required: true
|
83
|
+
})
|
97
84
|
};
|
98
|
-
|
99
|
-
|
85
|
+
state.content.id = react_utilities_1.useId('tooltip-', state.content.id);
|
86
|
+
const positioningOptions = {
|
100
87
|
enabled: state.visible,
|
101
|
-
arrowPadding: 2 * tooltipBorderRadius,
|
88
|
+
arrowPadding: 2 * constants_1.tooltipBorderRadius,
|
102
89
|
position: 'above',
|
103
90
|
align: 'center',
|
104
|
-
offset:
|
105
|
-
|
91
|
+
offset: 4,
|
92
|
+
...react_positioning_1.resolvePositioningShorthand(state.positioning)
|
93
|
+
};
|
106
94
|
|
107
95
|
if (state.withArrow) {
|
108
|
-
|
96
|
+
positioningOptions.offset = react_positioning_1.mergeArrowOffset(positioningOptions.offset, constants_1.arrowHeight);
|
109
97
|
}
|
110
98
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
state.
|
99
|
+
const {
|
100
|
+
targetRef,
|
101
|
+
containerRef,
|
102
|
+
arrowRef
|
103
|
+
} = react_positioning_1.usePositioning(positioningOptions);
|
104
|
+
state.content.ref = react_utilities_1.useMergedRefs(state.content.ref, containerRef);
|
117
105
|
state.arrowRef = arrowRef; // When this tooltip is visible, hide any other tooltips, and register it
|
118
106
|
// as the visibleTooltip with the TooltipContext.
|
119
107
|
// Also add a listener on document to hide the tooltip if Escape is pressed
|
120
108
|
|
121
|
-
react_utilities_1.useIsomorphicLayoutEffect(
|
109
|
+
react_utilities_1.useIsomorphicLayoutEffect(() => {
|
122
110
|
var _a;
|
123
111
|
|
124
112
|
if (visible) {
|
125
|
-
|
126
|
-
hide:
|
127
|
-
return setVisible(false);
|
128
|
-
}
|
113
|
+
const thisTooltip = {
|
114
|
+
hide: () => setVisible(false)
|
129
115
|
};
|
130
116
|
(_a = context.visibleTooltip) === null || _a === void 0 ? void 0 : _a.hide();
|
131
|
-
context.visibleTooltip =
|
117
|
+
context.visibleTooltip = thisTooltip;
|
132
118
|
|
133
|
-
|
119
|
+
const onDocumentKeyDown = ev => {
|
134
120
|
if (ev.key === 'Escape' || ev.key === 'Esc') {
|
135
|
-
|
121
|
+
thisTooltip.hide();
|
136
122
|
}
|
137
123
|
};
|
138
124
|
|
139
|
-
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener('keydown',
|
140
|
-
return
|
141
|
-
if (context.visibleTooltip ===
|
125
|
+
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener('keydown', onDocumentKeyDown);
|
126
|
+
return () => {
|
127
|
+
if (context.visibleTooltip === thisTooltip) {
|
142
128
|
context.visibleTooltip = undefined;
|
143
129
|
}
|
144
130
|
|
145
|
-
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener('keydown',
|
131
|
+
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener('keydown', onDocumentKeyDown);
|
146
132
|
};
|
147
133
|
}
|
148
134
|
}, [context, targetDocument, visible, setVisible]); // The focused element gets a blur event when the document loses focus
|
@@ -151,24 +137,24 @@ var useTooltip = function (props, ref) {
|
|
151
137
|
// checking if the blurred element is still the document's activeElement.
|
152
138
|
// See https://github.com/microsoft/fluentui/issues/13541
|
153
139
|
|
154
|
-
|
140
|
+
const ignoreNextFocusEventRef = React.useRef(false); // Listener for onPointerEnter and onFocus on the trigger element
|
155
141
|
|
156
|
-
|
142
|
+
const onEnterTrigger = React.useCallback(ev => {
|
157
143
|
if (ev.type === 'focus' && ignoreNextFocusEventRef.current) {
|
158
144
|
ignoreNextFocusEventRef.current = false;
|
159
145
|
return;
|
160
146
|
} // Show immediately if another tooltip is already visible
|
161
147
|
|
162
148
|
|
163
|
-
|
164
|
-
setDelayTimeout(
|
149
|
+
const delay = context.visibleTooltip ? 0 : state.showDelay;
|
150
|
+
setDelayTimeout(() => {
|
165
151
|
setVisible(true, ev);
|
166
152
|
}, delay);
|
167
153
|
ev.persist(); // Persist the event since the setVisible call will happen asynchronously
|
168
154
|
}, [setDelayTimeout, setVisible, state.showDelay, context]); // Listener for onPointerLeave and onBlur on the trigger element
|
169
155
|
|
170
|
-
|
171
|
-
|
156
|
+
const onLeaveTrigger = React.useCallback(ev => {
|
157
|
+
let delay = state.hideDelay;
|
172
158
|
|
173
159
|
if (ev.type === 'blur') {
|
174
160
|
// Hide immediately when losing focus
|
@@ -176,63 +162,48 @@ var useTooltip = function (props, ref) {
|
|
176
162
|
ignoreNextFocusEventRef.current = (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) === ev.target;
|
177
163
|
}
|
178
164
|
|
179
|
-
setDelayTimeout(
|
165
|
+
setDelayTimeout(() => {
|
180
166
|
setVisible(false, ev);
|
181
167
|
}, delay);
|
182
168
|
ev.persist(); // Persist the event since the setVisible call will happen asynchronously
|
183
169
|
}, [setDelayTimeout, setVisible, state.hideDelay, targetDocument]); // Cancel the hide timer when the pointer enters the tooltip, and restart it when the mouse leaves.
|
184
170
|
// This keeps the tooltip visible when the pointer is moved over it.
|
185
171
|
|
186
|
-
state.
|
187
|
-
state.
|
188
|
-
|
172
|
+
state.content.onPointerEnter = react_utilities_1.useMergedEventCallbacks(state.content.onPointerEnter, clearDelayTimeout);
|
173
|
+
state.content.onPointerLeave = react_utilities_1.useMergedEventCallbacks(state.content.onPointerLeave, onLeaveTrigger);
|
174
|
+
const child = React.isValidElement(children) ? react_utilities_1.getTriggerChild(children) : undefined;
|
175
|
+
const triggerAriaProps = {};
|
189
176
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
177
|
+
if (relationship === 'label') {
|
178
|
+
// aria-label only works if the content is a string. Otherwise, need to use aria-labelledby.
|
179
|
+
if (typeof state.content.children === 'string') {
|
180
|
+
triggerAriaProps['aria-label'] = state.content.children;
|
181
|
+
} else if (!isServerSideRender) {
|
182
|
+
triggerAriaProps['aria-labelledby'] = state.content.id; // Always render the tooltip even if hidden, so that aria-labelledby refers to a valid element
|
196
183
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
}
|
184
|
+
state.shouldRenderTooltip = true;
|
185
|
+
}
|
186
|
+
} else if (relationship === 'description') {
|
187
|
+
if (!isServerSideRender) {
|
188
|
+
triggerAriaProps['aria-describedby'] = state.content.id; // Always render the tooltip even if hidden, so that aria-describedby refers to a valid element
|
203
189
|
|
204
|
-
|
205
|
-
// aria-label only works if the content is a string. Otherwise, need to use labelledby.
|
206
|
-
if (typeof state.content === 'string') {
|
207
|
-
triggerProps['aria-label'] = state.content;
|
208
|
-
} else {
|
209
|
-
state.triggerAriaAttribute = 'labelledby';
|
190
|
+
state.shouldRenderTooltip = true;
|
210
191
|
}
|
211
192
|
}
|
212
193
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
194
|
+
const childTargetRef = react_utilities_1.useMergedRefs(child === null || child === void 0 ? void 0 : child.ref, targetRef); // Apply the trigger props to the child, either by calling the render function, or cloning with the new props
|
195
|
+
|
196
|
+
state.children = react_utilities_1.applyTriggerPropsToChildren(children, { ...triggerAriaProps,
|
197
|
+
...(child === null || child === void 0 ? void 0 : child.props),
|
198
|
+
// If the target prop is not provided, attach targetRef to the trigger element's ref prop
|
199
|
+
ref: positioningOptions.target === undefined ? childTargetRef : child === null || child === void 0 ? void 0 : child.ref,
|
200
|
+
onPointerEnter: react_utilities_1.useMergedEventCallbacks((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onPointerEnter, onEnterTrigger),
|
201
|
+
onPointerLeave: react_utilities_1.useMergedEventCallbacks((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onPointerLeave, onLeaveTrigger),
|
202
|
+
onFocus: react_utilities_1.useMergedEventCallbacks((_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.onFocus, onEnterTrigger),
|
203
|
+
onBlur: react_utilities_1.useMergedEventCallbacks((_d = child === null || child === void 0 ? void 0 : child.props) === null || _d === void 0 ? void 0 : _d.onBlur, onLeaveTrigger)
|
204
|
+
});
|
224
205
|
return state;
|
225
206
|
};
|
226
207
|
|
227
|
-
exports.
|
228
|
-
/**
|
229
|
-
* Combine up to two event callbacks into a single function that calls them in order
|
230
|
-
*/
|
231
|
-
|
232
|
-
var useMergedCallbacks = function (callback1, callback2) {
|
233
|
-
return React.useCallback(function (ev) {
|
234
|
-
callback1 === null || callback1 === void 0 ? void 0 : callback1(ev);
|
235
|
-
callback2 === null || callback2 === void 0 ? void 0 : callback2(ev);
|
236
|
-
}, [callback1, callback2]);
|
237
|
-
};
|
208
|
+
exports.useTooltip_unstable = useTooltip_unstable;
|
238
209
|
//# sourceMappingURL=useTooltip.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Tooltip/useTooltip.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA,C,CAYA;;;AACA,IAAM,mBAAmB,GAAG,CAA5B,C,CAA+B;;AAC/B,IAAM,WAAW,GAAG,CAApB,C,CAAuB;;AAEvB;;;;;;;;;AASG;;AACI,IAAM,UAAU,GAAG,UAAC,KAAD,EAAsB,GAAtB,EAAoD;;;AAC5E,MAAM,OAAO,GAAG,KAAK,CAAC,UAAN,CAAiB,uBAAA,CAAA,cAAjB,CAAhB;AACA,MAAM,kBAAkB,GAAG,iBAAA,CAAA,QAAA,EAA3B;AACQ,MAAA,cAAc,GAAK,uBAAA,CAAA,SAAA,GAAL,cAAd;;AACF,MAAA,EAAA,GAAuC,iBAAA,CAAA,UAAA,EAAvC;AAAA,MAAC,eAAe,G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,EAAE,iBAAA,CAAA,uBAAA,CAAwB,CAAA,EAAA,GAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,KAAP,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,KAAA,CAAZ,GAAY,EAAA,CAAE,MAAtC,EAA8C,cAA9C;AARkE,GAA3D,CAAjB;AAWA,SAAO,KAAP;AACD,CAxMM;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","sourcesContent":["import * as React from 'react';\nimport { mergeArrowOffset, resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport { TooltipContext, useFluent } from '@fluentui/react-shared-contexts';\nimport {\n applyTriggerPropsToChildren,\n resolveShorthand,\n useControllableState,\n useMergedEventCallbacks,\n useId,\n useIsomorphicLayoutEffect,\n useIsSSR,\n useMergedRefs,\n useTimeout,\n getTriggerChild,\n} from '@fluentui/react-utilities';\nimport type { TooltipProps, TooltipState, TooltipTriggerProps } from './Tooltip.types';\nimport { arrowHeight, tooltipBorderRadius } from './private/constants';\n\n/**\n * Create the state required to render Tooltip.\n *\n * The returned state can be modified with hooks such as useTooltipStyles_unstable,\n * before being passed to renderTooltip_unstable.\n *\n * @param props - props from this instance of Tooltip\n */\nexport const useTooltip_unstable = (props: TooltipProps): TooltipState => {\n const context = React.useContext(TooltipContext);\n const isServerSideRender = useIsSSR();\n const { targetDocument } = useFluent();\n const [setDelayTimeout, clearDelayTimeout] = useTimeout();\n\n const {\n appearance = 'normal',\n children,\n content,\n withArrow = false,\n positioning = 'above',\n onVisibleChange,\n relationship,\n showDelay = 250,\n hideDelay = 250,\n mountNode,\n } = props;\n\n const [visible, setVisibleInternal] = useControllableState({ state: props.visible, initialState: false });\n const setVisible = React.useCallback(\n (newVisible: boolean, ev?: React.PointerEvent<HTMLElement> | React.FocusEvent<HTMLElement>) => {\n clearDelayTimeout();\n setVisibleInternal(oldVisible => {\n if (newVisible !== oldVisible) {\n onVisibleChange?.(ev, { visible: newVisible });\n }\n return newVisible;\n });\n },\n [clearDelayTimeout, setVisibleInternal, onVisibleChange],\n );\n\n const state: TooltipState = {\n withArrow,\n positioning,\n showDelay,\n hideDelay,\n relationship,\n visible,\n shouldRenderTooltip: visible,\n appearance,\n mountNode,\n // Slots\n components: {\n content: 'div',\n },\n content: resolveShorthand(content, {\n defaultProps: {\n role: 'tooltip',\n },\n required: true,\n }),\n };\n\n state.content.id = useId('tooltip-', state.content.id);\n\n const positioningOptions = {\n enabled: state.visible,\n arrowPadding: 2 * tooltipBorderRadius,\n position: 'above' as const,\n align: 'center' as const,\n offset: 4,\n ...resolvePositioningShorthand(state.positioning),\n };\n\n if (state.withArrow) {\n positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeight);\n }\n\n const {\n targetRef,\n containerRef,\n arrowRef,\n }: {\n targetRef: React.MutableRefObject<unknown>;\n containerRef: React.MutableRefObject<HTMLDivElement>;\n arrowRef: React.MutableRefObject<HTMLDivElement>;\n } = usePositioning(positioningOptions);\n\n state.content.ref = useMergedRefs(state.content.ref, containerRef);\n state.arrowRef = arrowRef;\n\n // When this tooltip is visible, hide any other tooltips, and register it\n // as the visibleTooltip with the TooltipContext.\n // Also add a listener on document to hide the tooltip if Escape is pressed\n useIsomorphicLayoutEffect(() => {\n if (visible) {\n const thisTooltip = { hide: () => setVisible(false) };\n\n context.visibleTooltip?.hide();\n context.visibleTooltip = thisTooltip;\n\n const onDocumentKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape' || ev.key === 'Esc') {\n thisTooltip.hide();\n }\n };\n\n targetDocument?.addEventListener('keydown', onDocumentKeyDown);\n\n return () => {\n if (context.visibleTooltip === thisTooltip) {\n context.visibleTooltip = undefined;\n }\n\n targetDocument?.removeEventListener('keydown', onDocumentKeyDown);\n };\n }\n }, [context, targetDocument, visible, setVisible]);\n\n // The focused element gets a blur event when the document loses focus\n // (e.g. switching tabs in the browser), but we don't want to show the\n // tooltip again when the document gets focus back. Handle this case by\n // checking if the blurred element is still the document's activeElement.\n // See https://github.com/microsoft/fluentui/issues/13541\n const ignoreNextFocusEventRef = React.useRef(false);\n\n // Listener for onPointerEnter and onFocus on the trigger element\n const onEnterTrigger = React.useCallback(\n (ev: React.PointerEvent<HTMLElement> | React.FocusEvent<HTMLElement>) => {\n if (ev.type === 'focus' && ignoreNextFocusEventRef.current) {\n ignoreNextFocusEventRef.current = false;\n return;\n }\n\n // Show immediately if another tooltip is already visible\n const delay = context.visibleTooltip ? 0 : state.showDelay;\n\n setDelayTimeout(() => {\n setVisible(true, ev);\n }, delay);\n\n ev.persist(); // Persist the event since the setVisible call will happen asynchronously\n },\n [setDelayTimeout, setVisible, state.showDelay, context],\n );\n\n // Listener for onPointerLeave and onBlur on the trigger element\n const onLeaveTrigger = React.useCallback(\n (ev: React.PointerEvent<HTMLElement> | React.FocusEvent<HTMLElement>) => {\n let delay = state.hideDelay;\n\n if (ev.type === 'blur') {\n // Hide immediately when losing focus\n delay = 0;\n\n ignoreNextFocusEventRef.current = targetDocument?.activeElement === ev.target;\n }\n\n setDelayTimeout(() => {\n setVisible(false, ev);\n }, delay);\n\n ev.persist(); // Persist the event since the setVisible call will happen asynchronously\n },\n [setDelayTimeout, setVisible, state.hideDelay, targetDocument],\n );\n\n // Cancel the hide timer when the pointer enters the tooltip, and restart it when the mouse leaves.\n // This keeps the tooltip visible when the pointer is moved over it.\n state.content.onPointerEnter = useMergedEventCallbacks(state.content.onPointerEnter, clearDelayTimeout);\n state.content.onPointerLeave = useMergedEventCallbacks(state.content.onPointerLeave, onLeaveTrigger);\n\n const child = React.isValidElement(children) ? getTriggerChild(children) : undefined;\n\n const triggerAriaProps: Pick<TooltipTriggerProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> = {};\n\n if (relationship === 'label') {\n // aria-label only works if the content is a string. Otherwise, need to use aria-labelledby.\n if (typeof state.content.children === 'string') {\n triggerAriaProps['aria-label'] = state.content.children;\n } else if (!isServerSideRender) {\n triggerAriaProps['aria-labelledby'] = state.content.id;\n // Always render the tooltip even if hidden, so that aria-labelledby refers to a valid element\n state.shouldRenderTooltip = true;\n }\n } else if (relationship === 'description') {\n if (!isServerSideRender) {\n triggerAriaProps['aria-describedby'] = state.content.id;\n // Always render the tooltip even if hidden, so that aria-describedby refers to a valid element\n state.shouldRenderTooltip = true;\n }\n }\n\n const childTargetRef = useMergedRefs(child?.ref, targetRef);\n\n // Apply the trigger props to the child, either by calling the render function, or cloning with the new props\n state.children = applyTriggerPropsToChildren<TooltipTriggerProps>(children, {\n ...triggerAriaProps,\n ...child?.props,\n // If the target prop is not provided, attach targetRef to the trigger element's ref prop\n ref: positioningOptions.target === undefined ? childTargetRef : child?.ref,\n onPointerEnter: useMergedEventCallbacks(child?.props?.onPointerEnter, onEnterTrigger),\n onPointerLeave: useMergedEventCallbacks(child?.props?.onPointerLeave, onLeaveTrigger),\n onFocus: useMergedEventCallbacks(child?.props?.onFocus, onEnterTrigger),\n onBlur: useMergedEventCallbacks(child?.props?.onBlur, onLeaveTrigger),\n });\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -3,28 +3,53 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useTooltipStyles_unstable = exports.tooltipClassNames = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
+
|
10
|
+
const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
|
11
|
+
|
12
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
13
|
+
|
14
|
+
const constants_1 = /*#__PURE__*/require("./private/constants");
|
15
|
+
|
16
|
+
exports.tooltipClassNames = {
|
17
|
+
content: 'fui-Tooltip__content'
|
18
|
+
};
|
9
19
|
/**
|
10
20
|
* Styles for the tooltip
|
11
21
|
*/
|
12
22
|
|
13
|
-
|
14
|
-
var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
23
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
15
24
|
"root": {
|
16
25
|
"mc9l5x": "fjseox",
|
17
|
-
"
|
18
|
-
"z189sj": ["f11qrl6u", "fjlbh76"],
|
19
|
-
"Byoj8tv": "fy7v416",
|
20
|
-
"uwmqm3": ["fjlbh76", "f11qrl6u"],
|
26
|
+
"B7ck84d": "f1ewtqcl",
|
21
27
|
"B2u0y6b": "f132xexn",
|
22
28
|
"Bceei9c": "f158kwzp",
|
23
29
|
"Bahqtrf": "fk6fouc",
|
24
30
|
"Be2twd7": "fy9rknc",
|
25
31
|
"Bg96gwp": "fwrc4pm",
|
26
|
-
"
|
27
|
-
"
|
32
|
+
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
33
|
+
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
34
|
+
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
35
|
+
"Btl43ni": ["fyu767a", "f1jar5jt"],
|
36
|
+
"B4j52fo": "f5ogflp",
|
37
|
+
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
38
|
+
"Bn0qgzm": "f1f09k3d",
|
39
|
+
"ibv6hh": ["finvdd3", "f1hqa2wf"],
|
40
|
+
"icvyot": "fzkkow9",
|
41
|
+
"vrafjx": ["fcdblym", "fjik90z"],
|
42
|
+
"oivjwe": "fg706s2",
|
43
|
+
"wvpqe5": ["fjik90z", "fcdblym"],
|
44
|
+
"g2u3we": "fghlq4f",
|
45
|
+
"h3c5rm": ["f1gn591s", "fjscplz"],
|
46
|
+
"B9xav0g": "fb073pr",
|
47
|
+
"zhjwy3": ["fjscplz", "f1gn591s"],
|
48
|
+
"z8tnut": "f10ra9hq",
|
49
|
+
"z189sj": ["fd9xhir", "f1jlaasf"],
|
50
|
+
"Byoj8tv": "f1d7kygh",
|
51
|
+
"uwmqm3": ["f1jlaasf", "fd9xhir"],
|
52
|
+
"De3pzq": "fxugw4r",
|
28
53
|
"sj55zd": "f19n0e5",
|
29
54
|
"Bhu2qc9": "fxeb0a7"
|
30
55
|
},
|
@@ -32,47 +57,54 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
32
57
|
"mc9l5x": "ftgm304"
|
33
58
|
},
|
34
59
|
"inverted": {
|
35
|
-
"
|
60
|
+
"De3pzq": "f5pduvr",
|
36
61
|
"sj55zd": "fqpbvvt"
|
37
62
|
},
|
38
63
|
"arrow": {
|
39
64
|
"qhf8xq": "f1euv43f",
|
40
|
-
"
|
41
|
-
"Bqenvij": "ftt2rgf",
|
42
|
-
"ayd6f0": "f1uo6wrk",
|
65
|
+
"De3pzq": "f1u2r49w",
|
43
66
|
"Bcdw1i0": "fd7fpy0",
|
44
67
|
"Bj3rh1h": "f1bsuimh",
|
68
|
+
"a9b677": "f1ekdpwm",
|
69
|
+
"Bqenvij": "f83vc9z",
|
45
70
|
"rurcny": "fuzzvh5",
|
71
|
+
"Bex5imi": "fkk33zh",
|
46
72
|
"xx9plb": "fxf9f1y",
|
73
|
+
"Bmqnesq": "f170vdtw",
|
47
74
|
"Bdn98qo": "f103af6e",
|
48
75
|
"Bbc2r3f": "f15umuo5",
|
49
|
-
"
|
50
|
-
"
|
76
|
+
"B1dvbpk": "f3wpjpt",
|
77
|
+
"D4ky5z": "f1k3tce7",
|
78
|
+
"cqycoz": "f1dkdgqi",
|
79
|
+
"I89eb": "f5ghsz",
|
80
|
+
"k1i1uq": "fyqop9u",
|
81
|
+
"Epwjcz": "f1m5ya7j",
|
82
|
+
"Bp1vogq": "f3sp63x",
|
51
83
|
"px8gyy": ["f5bg3dr", "f1rfdd74"],
|
52
|
-
"h6z6rw":
|
53
|
-
"hl6cv3": "
|
84
|
+
"h6z6rw": "fzd2j21",
|
85
|
+
"hl6cv3": "f1773hnp",
|
54
86
|
"Bh2vraf": "f1n8855c",
|
55
|
-
"yayu3t":
|
87
|
+
"yayu3t": "f1v7783n",
|
56
88
|
"wedwtw": "fsw6im5",
|
57
|
-
"rhl9o9": "
|
89
|
+
"rhl9o9": "fh2hsk5",
|
58
90
|
"Bu8t5uz": "f159pzir",
|
59
|
-
"B6q6orb":
|
91
|
+
"B6q6orb": "f11yvu4",
|
60
92
|
"Bwwlvwl": "fm1ycve"
|
61
93
|
}
|
62
94
|
}, {
|
63
|
-
"d": [".fjseox{display:none;}", ".
|
95
|
+
"d": [".fjseox{display:none;}", ".f1ewtqcl{box-sizing:border-box;}", ".f132xexn{max-width:240px;}", ".f158kwzp{cursor:default;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f10ra9hq{padding-top:4px;}", ".fd9xhir{padding-right:11px;}", ".f1jlaasf{padding-left:11px;}", ".f1d7kygh{padding-bottom:6px;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxeb0a7{-webkit-filter:drop-shadow(0 0 2px var(--colorNeutralShadowAmbient)) drop-shadow(0 4px 8px var(--colorNeutralShadowKey));filter:drop-shadow(0 0 2px var(--colorNeutralShadowAmbient)) drop-shadow(0 4px 8px var(--colorNeutralShadowKey));}", ".ftgm304{display:block;}", ".f5pduvr{background-color:var(--colorNeutralBackgroundInverted);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".f1euv43f{position:absolute;}", ".f1u2r49w{background-color:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".f1ekdpwm{width:8.484px;}", ".f83vc9z{height:8.484px;}", ".fuzzvh5:before{content:\"\";}", ".fkk33zh:before{visibility:visible;}", ".fxf9f1y:before{position:absolute;}", ".f170vdtw:before{box-sizing:border-box;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".f3wpjpt:before{background-color:inherit;}", ".f1k3tce7:before{border-right-width:1px;}", ".f1dkdgqi:before{border-right-style:solid;}", ".f5ghsz:before{border-right-color:var(--colorTransparentStroke);}", ".fyqop9u:before{border-bottom-width:1px;}", ".f1m5ya7j:before{border-bottom-style:solid;}", ".f3sp63x:before{border-bottom-color:var(--colorTransparentStroke);}", ".f5bg3dr:before{border-bottom-right-radius:var(--borderRadiusSmall);}", ".f1rfdd74:before{border-bottom-left-radius:var(--borderRadiusSmall);}", ".fzd2j21:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}", "[data-popper-placement^=\"top\"] .f1773hnp{bottom:-1px;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1v7783n{left:-1px;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .fh2hsk5{top:-1px;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f11yvu4{right:-1px;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
|
64
96
|
});
|
65
97
|
/**
|
66
98
|
* Apply styling to the Tooltip slots based on the state
|
67
99
|
*/
|
68
100
|
|
69
101
|
|
70
|
-
|
71
|
-
|
72
|
-
state.
|
102
|
+
const useTooltipStyles_unstable = state => {
|
103
|
+
const styles = useStyles();
|
104
|
+
state.content.className = react_1.mergeClasses(exports.tooltipClassNames.content, styles.root, state.appearance === 'inverted' && styles.inverted, state.visible && styles.visible, state.content.className);
|
73
105
|
state.arrowClassName = styles.arrow;
|
74
106
|
return state;
|
75
107
|
};
|
76
108
|
|
77
|
-
exports.
|
109
|
+
exports.useTooltipStyles_unstable = useTooltipStyles_unstable;
|
78
110
|
//# sourceMappingURL=useTooltipStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/Tooltip/useTooltipStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AAIa,OAAA,CAAA,iBAAA,GAAkD;AAC7D,EAAA,OAAO,EAAE;AADoD,CAAlD;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAkCA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAAsC;AAC7E,QAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,OAAA,CAAA,YAAA,CACxB,OAAA,CAAA,iBAAA,CAAkB,OADM,EAExB,MAAM,CAAC,IAFiB,EAGxB,KAAK,CAAC,UAAN,KAAqB,UAArB,IAAmC,MAAM,CAAC,QAHlB,EAIxB,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,OAJA,EAKxB,KAAK,CAAC,OAAN,CAAc,SALU,CAA1B;AAQA,EAAA,KAAK,CAAC,cAAN,GAAuB,MAAM,CAAC,KAA9B;AAEA,SAAO,KAAP;AACD,CAdM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createArrowStyles } from '@fluentui/react-positioning';\nimport { tokens } from '@fluentui/react-theme';\nimport { arrowHeight } from './private/constants';\nimport type { TooltipSlots, TooltipState } from './Tooltip.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tooltipClassNames: SlotClassNames<TooltipSlots> = {\n content: 'fui-Tooltip__content',\n};\n\n/**\n * Styles for the tooltip\n */\nconst useStyles = makeStyles({\n root: {\n display: 'none',\n boxSizing: 'border-box',\n maxWidth: '240px',\n cursor: 'default',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.border('1px', 'solid', tokens.colorTransparentStroke),\n ...shorthands.padding('4px', '11px', '6px', '11px'), // '5px 12px 7px 12px' minus the border width '1px'\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n\n // TODO need to add versions of tokens.alias.shadow.shadow8, etc. that work with filter\n filter:\n `drop-shadow(0 0 2px ${tokens.colorNeutralShadowAmbient}) ` +\n `drop-shadow(0 4px 8px ${tokens.colorNeutralShadowKey})`,\n },\n\n visible: {\n display: 'block',\n },\n\n inverted: {\n backgroundColor: tokens.colorNeutralBackgroundInverted,\n color: tokens.colorNeutralForegroundInverted,\n },\n\n arrow: createArrowStyles({ arrowHeight }),\n});\n\n/**\n * Apply styling to the Tooltip slots based on the state\n */\nexport const useTooltipStyles_unstable = (state: TooltipState): TooltipState => {\n const styles = useStyles();\n\n state.content.className = mergeClasses(\n tooltipClassNames.content,\n styles.root,\n state.appearance === 'inverted' && styles.inverted,\n state.visible && styles.visible,\n state.content.className,\n );\n\n state.arrowClassName = styles.arrow;\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
@@ -3,8 +3,38 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.useTooltip_unstable = exports.useTooltipStyles_unstable = exports.tooltipClassNames = exports.renderTooltip_unstable = exports.Tooltip = void 0;
|
6
7
|
|
7
|
-
var
|
8
|
+
var Tooltip_1 = /*#__PURE__*/require("./Tooltip");
|
8
9
|
|
9
|
-
|
10
|
+
Object.defineProperty(exports, "Tooltip", {
|
11
|
+
enumerable: true,
|
12
|
+
get: function () {
|
13
|
+
return Tooltip_1.Tooltip;
|
14
|
+
}
|
15
|
+
});
|
16
|
+
Object.defineProperty(exports, "renderTooltip_unstable", {
|
17
|
+
enumerable: true,
|
18
|
+
get: function () {
|
19
|
+
return Tooltip_1.renderTooltip_unstable;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
Object.defineProperty(exports, "tooltipClassNames", {
|
23
|
+
enumerable: true,
|
24
|
+
get: function () {
|
25
|
+
return Tooltip_1.tooltipClassNames;
|
26
|
+
}
|
27
|
+
});
|
28
|
+
Object.defineProperty(exports, "useTooltipStyles_unstable", {
|
29
|
+
enumerable: true,
|
30
|
+
get: function () {
|
31
|
+
return Tooltip_1.useTooltipStyles_unstable;
|
32
|
+
}
|
33
|
+
});
|
34
|
+
Object.defineProperty(exports, "useTooltip_unstable", {
|
35
|
+
enumerable: true,
|
36
|
+
get: function () {
|
37
|
+
return Tooltip_1.useTooltip_unstable;
|
38
|
+
}
|
39
|
+
});
|
10
40
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,SAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,OAAA;AAAO;AAAP,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,yBAAA;AAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,mBAAA;AAAmB;AAAnB,CAAA","sourcesContent":["export {\n Tooltip,\n renderTooltip_unstable,\n tooltipClassNames,\n useTooltipStyles_unstable,\n useTooltip_unstable,\n} from './Tooltip';\nexport type { OnVisibleChangeData, TooltipProps, TooltipSlots, TooltipState, TooltipTriggerProps } from './Tooltip';\n"],"sourceRoot":"../src/"}
|