@fluentui/react-tooltip 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/CHANGELOG.json +762 -25
  2. package/CHANGELOG.md +295 -111
  3. package/MIGRATION.md +51 -43
  4. package/Spec.md +201 -337
  5. package/dist/index.d.ts +157 -0
  6. package/{lib → dist}/tsdoc-metadata.json +0 -0
  7. package/lib/Tooltip.js.map +1 -1
  8. package/lib/components/Tooltip/Tooltip.js +9 -9
  9. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  10. package/lib/components/Tooltip/Tooltip.types.js.map +1 -1
  11. package/lib/components/Tooltip/index.js +1 -1
  12. package/lib/components/Tooltip/index.js.map +1 -1
  13. package/lib/components/Tooltip/private/constants.js +14 -0
  14. package/lib/components/Tooltip/private/constants.js.map +1 -0
  15. package/lib/components/Tooltip/renderTooltip.js +10 -8
  16. package/lib/components/Tooltip/renderTooltip.js.map +1 -1
  17. package/lib/components/Tooltip/useTooltip.js +98 -127
  18. package/lib/components/Tooltip/useTooltip.js.map +1 -1
  19. package/lib/components/Tooltip/useTooltipStyles.js +59 -23
  20. package/lib/components/Tooltip/useTooltipStyles.js.map +1 -1
  21. package/lib/index.js +2 -1
  22. package/lib/index.js.map +1 -1
  23. package/lib-commonjs/Tooltip.js +1 -1
  24. package/lib-commonjs/Tooltip.js.map +1 -1
  25. package/lib-commonjs/components/Tooltip/Tooltip.js +11 -10
  26. package/lib-commonjs/components/Tooltip/Tooltip.js.map +1 -1
  27. package/lib-commonjs/components/Tooltip/Tooltip.types.js.map +1 -1
  28. package/lib-commonjs/components/Tooltip/index.js +2 -10
  29. package/lib-commonjs/components/Tooltip/index.js.map +1 -1
  30. package/lib-commonjs/components/Tooltip/private/constants.js +21 -0
  31. package/lib-commonjs/components/Tooltip/private/constants.js.map +1 -0
  32. package/lib-commonjs/components/Tooltip/renderTooltip.js +15 -14
  33. package/lib-commonjs/components/Tooltip/renderTooltip.js.map +1 -1
  34. package/lib-commonjs/components/Tooltip/useTooltip.js +106 -135
  35. package/lib-commonjs/components/Tooltip/useTooltip.js.map +1 -1
  36. package/lib-commonjs/components/Tooltip/useTooltipStyles.js +65 -26
  37. package/lib-commonjs/components/Tooltip/useTooltipStyles.js.map +1 -1
  38. package/lib-commonjs/index.js +39 -2
  39. package/lib-commonjs/index.js.map +1 -1
  40. package/package.json +21 -26
  41. package/dist/react-tooltip.d.ts +0 -162
  42. package/lib/Tooltip.d.ts +0 -1
  43. package/lib/common/isConformant.d.ts +0 -4
  44. package/lib/common/isConformant.js +0 -11
  45. package/lib/common/isConformant.js.map +0 -1
  46. package/lib/components/Tooltip/Tooltip.d.ts +0 -6
  47. package/lib/components/Tooltip/Tooltip.types.d.ts +0 -124
  48. package/lib/components/Tooltip/index.d.ts +0 -5
  49. package/lib/components/Tooltip/renderTooltip.d.ts +0 -5
  50. package/lib/components/Tooltip/useTooltip.d.ts +0 -13
  51. package/lib/components/Tooltip/useTooltipStyles.d.ts +0 -5
  52. package/lib/index.d.ts +0 -1
  53. package/lib-commonjs/Tooltip.d.ts +0 -1
  54. package/lib-commonjs/common/isConformant.d.ts +0 -4
  55. package/lib-commonjs/common/isConformant.js +0 -22
  56. package/lib-commonjs/common/isConformant.js.map +0 -1
  57. package/lib-commonjs/components/Tooltip/Tooltip.d.ts +0 -6
  58. package/lib-commonjs/components/Tooltip/Tooltip.types.d.ts +0 -124
  59. package/lib-commonjs/components/Tooltip/index.d.ts +0 -5
  60. package/lib-commonjs/components/Tooltip/renderTooltip.d.ts +0 -5
  61. package/lib-commonjs/components/Tooltip/useTooltip.d.ts +0 -13
  62. package/lib-commonjs/components/Tooltip/useTooltipStyles.d.ts +0 -5
  63. 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.useTooltip = void 0;
6
+ exports.useTooltip_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
11
11
 
12
- var react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
12
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
13
13
 
14
- var react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
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 useTooltipStyles,
27
- * before being passed to renderTooltip.
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
- var useTooltip = function (props, ref) {
26
+
27
+ const useTooltip_unstable = props => {
35
28
  var _a, _b, _c, _d;
36
29
 
37
- var context = React.useContext(react_shared_contexts_1.TooltipContext);
38
- var isServerSideRender = react_utilities_1.useIsSSR();
39
- var targetDocument = react_shared_contexts_1.useFluent().targetDocument;
40
-
41
- var _e = react_utilities_1.useTimeout(),
42
- setDelayTimeout = _e[0],
43
- clearDelayTimeout = _e[1];
44
-
45
- var content = props.content,
46
- inverted = props.inverted,
47
- withArrow = props.withArrow,
48
- positioning = props.positioning,
49
- onVisibleChange = props.onVisibleChange,
50
- _f = props.triggerAriaAttribute,
51
- triggerAriaAttribute = _f === void 0 ? 'label' : _f,
52
- _g = props.showDelay,
53
- showDelay = _g === void 0 ? 250 : _g,
54
- _h = props.hideDelay,
55
- hideDelay = _h === void 0 ? 250 : _h;
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
- visible = _j[0],
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(function (oldVisible) {
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
- var state = {
77
- content: content,
78
- inverted: inverted,
79
- withArrow: withArrow,
80
- positioning: positioning,
81
- showDelay: showDelay,
82
- hideDelay: hideDelay,
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: props.appearance,
72
+ appearance,
73
+ mountNode,
87
74
  // Slots
88
75
  components: {
89
- root: 'div'
76
+ content: 'div'
90
77
  },
91
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign({
92
- role: 'tooltip'
93
- }, props), {
94
- ref: ref,
95
- id: react_utilities_1.useId('tooltip-', props.id)
96
- }))
78
+ content: react_utilities_1.resolveShorthand(content, {
79
+ defaultProps: {
80
+ role: 'tooltip'
81
+ },
82
+ required: true
83
+ })
97
84
  };
98
-
99
- var popperOptions = tslib_1.__assign({
85
+ state.content.id = react_utilities_1.useId('tooltip-', state.content.id);
86
+ const popperOptions = {
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: [0, 4]
105
- }, react_positioning_1.resolvePositioningShorthand(state.positioning));
91
+ offset: [0, 4],
92
+ ...react_positioning_1.resolvePositioningShorthand(state.positioning)
93
+ };
106
94
 
107
95
  if (state.withArrow) {
108
- popperOptions.offset = react_positioning_1.mergeArrowOffset(popperOptions.offset, arrowHeight);
96
+ popperOptions.offset = react_positioning_1.mergeArrowOffset(popperOptions.offset, constants_1.arrowHeight);
109
97
  }
110
98
 
111
- var _k = react_positioning_1.usePopper(popperOptions),
112
- targetRef = _k.targetRef,
113
- containerRef = _k.containerRef,
114
- arrowRef = _k.arrowRef;
115
-
116
- state.root.ref = react_utilities_1.useMergedRefs(state.root.ref, containerRef);
99
+ const {
100
+ targetRef,
101
+ containerRef,
102
+ arrowRef
103
+ } = react_positioning_1.usePopper(popperOptions);
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(function () {
109
+ react_utilities_1.useIsomorphicLayoutEffect(() => {
122
110
  var _a;
123
111
 
124
112
  if (visible) {
125
- var thisTooltip_1 = {
126
- hide: function () {
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 = thisTooltip_1;
117
+ context.visibleTooltip = thisTooltip;
132
118
 
133
- var onDocumentKeyDown_1 = function (ev) {
119
+ const onDocumentKeyDown = ev => {
134
120
  if (ev.key === 'Escape' || ev.key === 'Esc') {
135
- thisTooltip_1.hide();
121
+ thisTooltip.hide();
136
122
  }
137
123
  };
138
124
 
139
- targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener('keydown', onDocumentKeyDown_1);
140
- return function () {
141
- if (context.visibleTooltip === thisTooltip_1) {
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', onDocumentKeyDown_1);
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
- var ignoreNextFocusEventRef = React.useRef(false); // Listener for onPointerEnter and onFocus on the trigger element
140
+ const ignoreNextFocusEventRef = React.useRef(false); // Listener for onPointerEnter and onFocus on the trigger element
155
141
 
156
- var onEnterTrigger = React.useCallback(function (ev) {
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
- var delay = context.visibleTooltip ? 0 : state.showDelay;
164
- setDelayTimeout(function () {
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
- var onLeaveTrigger = React.useCallback(function (ev) {
171
- var delay = state.hideDelay;
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(function () {
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.root.onPointerEnter = useMergedCallbacks(state.root.onPointerEnter, clearDelayTimeout);
187
- state.root.onPointerLeave = useMergedCallbacks(state.root.onPointerLeave, onLeaveTrigger);
188
- var child = React.isValidElement(state.root.children) ? state.root.children : undefined; // The props to add to the trigger element (child)
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
- var triggerProps = {
191
- onPointerEnter: useMergedCallbacks((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onPointerEnter, onEnterTrigger),
192
- onPointerLeave: useMergedCallbacks((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onPointerLeave, onLeaveTrigger),
193
- onFocus: useMergedCallbacks((_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.onFocus, onEnterTrigger),
194
- onBlur: useMergedCallbacks((_d = child === null || child === void 0 ? void 0 : child.props) === null || _d === void 0 ? void 0 : _d.onBlur, onLeaveTrigger)
195
- }; // If the target prop is not provided, attach targetRef to the trigger element's ref prop
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
- var childWithRef = child;
198
- var childTargetRef = react_utilities_1.useMergedRefs(childWithRef === null || childWithRef === void 0 ? void 0 : childWithRef.ref, targetRef);
199
-
200
- if (popperOptions.target === undefined) {
201
- triggerProps.ref = childTargetRef;
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
- if (state.triggerAriaAttribute === 'label') {
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
- if (state.triggerAriaAttribute === 'labelledby' && !isServerSideRender) {
214
- triggerProps['aria-labelledby'] = state.root.id; // Always render the tooltip even if hidden, so that aria-labelledby refers to a valid element
215
-
216
- state.shouldRenderTooltip = true;
217
- } else if (state.triggerAriaAttribute === 'describedby' && !isServerSideRender) {
218
- triggerProps['aria-describedby'] = state.root.id;
219
- state.shouldRenderTooltip = true;
220
- } // Apply the trigger props to the child, either by calling the render function, or cloning with the new props
221
-
222
-
223
- state.root.children = react_utilities_1.applyTriggerPropsToChildren(state.root.children, triggerProps);
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: popperOptions.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.useTooltip = useTooltip;
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,GAAA,EAAA,CAAA,CAAA,CAAhB;AAAA,MAAkB,iBAAiB,GAAA,EAAA,CAAA,CAAA,CAAnC;;AAGJ,MAAA,OAAO,GAQL,KAAK,CARA,OAAP;AAAA,MACA,QAAQ,GAON,KAAK,CAPC,QADR;AAAA,MAEA,SAAS,GAMP,KAAK,CANE,SAFT;AAAA,MAGA,WAAW,GAKT,KAAK,CALI,WAHX;AAAA,MAIA,eAAe,GAIb,KAAK,CAJQ,eAJf;AAAA,MAKA,EAAA,GAGE,KAAK,CAHuB,oBAL9B;AAAA,MAKA,oB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ent":["import * as React from 'react';\nimport { mergeArrowOffset, resolvePositioningShorthand, usePopper } 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 popperOptions = {\n enabled: state.visible,\n arrowPadding: 2 * tooltipBorderRadius,\n position: 'above' as const,\n align: 'center' as const,\n offset: [0, 4] as [number, number],\n ...resolvePositioningShorthand(state.positioning),\n };\n\n if (state.withArrow) {\n popperOptions.offset = mergeArrowOffset(popperOptions.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 } = usePopper(popperOptions);\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: popperOptions.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,58 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useTooltipStyles = void 0;
6
+ exports.useTooltipStyles_unstable = exports.tooltipClassNames = exports.tooltipClassName = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
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");
9
15
  /**
10
- * Styles for the tooltip
16
+ * @deprecated Use `tooltipClassNames.root` instead.
11
17
  */
12
18
 
13
19
 
14
- var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
20
+ exports.tooltipClassName = 'fui-Tooltip';
21
+ exports.tooltipClassNames = {
22
+ content: 'fui-Tooltip__content'
23
+ };
24
+ /**
25
+ * Styles for the tooltip
26
+ */
27
+
28
+ const useStyles = /*#__PURE__*/react_1.__styles({
15
29
  "root": {
16
30
  "mc9l5x": "fjseox",
17
- "z8tnut": "f1sbtcvk",
18
- "z189sj": ["f11qrl6u", "fjlbh76"],
19
- "Byoj8tv": "fy7v416",
20
- "uwmqm3": ["fjlbh76", "f11qrl6u"],
31
+ "B7ck84d": "f1ewtqcl",
21
32
  "B2u0y6b": "f132xexn",
22
33
  "Bceei9c": "f158kwzp",
23
34
  "Bahqtrf": "fk6fouc",
24
35
  "Be2twd7": "fy9rknc",
25
36
  "Bg96gwp": "fwrc4pm",
26
- "Dimara": "ft85np5",
27
- "ayd6f0": "fcm7iae",
37
+ "Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
38
+ "Beyfa6y": ["f16jpd5f", "f1aa9q02"],
39
+ "B7oj6ja": ["f1jar5jt", "fyu767a"],
40
+ "Btl43ni": ["fyu767a", "f1jar5jt"],
41
+ "B4j52fo": "f5ogflp",
42
+ "Bekrc4i": ["f1hqa2wf", "finvdd3"],
43
+ "Bn0qgzm": "f1f09k3d",
44
+ "ibv6hh": ["finvdd3", "f1hqa2wf"],
45
+ "icvyot": "fzkkow9",
46
+ "vrafjx": ["fcdblym", "fjik90z"],
47
+ "oivjwe": "fg706s2",
48
+ "wvpqe5": ["fjik90z", "fcdblym"],
49
+ "g2u3we": "fghlq4f",
50
+ "h3c5rm": ["f1gn591s", "fjscplz"],
51
+ "B9xav0g": "fb073pr",
52
+ "zhjwy3": ["fjscplz", "f1gn591s"],
53
+ "z8tnut": "f10ra9hq",
54
+ "z189sj": ["fd9xhir", "f1jlaasf"],
55
+ "Byoj8tv": "f1d7kygh",
56
+ "uwmqm3": ["f1jlaasf", "fd9xhir"],
57
+ "De3pzq": "fxugw4r",
28
58
  "sj55zd": "f19n0e5",
29
59
  "Bhu2qc9": "fxeb0a7"
30
60
  },
@@ -32,47 +62,56 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
32
62
  "mc9l5x": "ftgm304"
33
63
  },
34
64
  "inverted": {
35
- "ayd6f0": "fdr7u1v",
65
+ "De3pzq": "f5pduvr",
36
66
  "sj55zd": "fqpbvvt"
37
67
  },
38
68
  "arrow": {
39
69
  "qhf8xq": "f1euv43f",
40
- "a9b677": "fpkirms",
41
- "Bqenvij": "ftt2rgf",
42
- "ayd6f0": "f1uo6wrk",
70
+ "De3pzq": "f1u2r49w",
43
71
  "Bcdw1i0": "fd7fpy0",
44
72
  "Bj3rh1h": "f1bsuimh",
73
+ "a9b677": "f1ekdpwm",
74
+ "Bqenvij": "f83vc9z",
45
75
  "rurcny": "fuzzvh5",
76
+ "Bex5imi": "fkk33zh",
46
77
  "xx9plb": "fxf9f1y",
78
+ "Bmqnesq": "f170vdtw",
47
79
  "Bdn98qo": "f103af6e",
48
80
  "Bbc2r3f": "f15umuo5",
49
- "B4zgs9e": "ffo048g",
50
- "Bex5imi": "fkk33zh",
81
+ "B1dvbpk": "f3wpjpt",
82
+ "D4ky5z": "f1k3tce7",
83
+ "cqycoz": "f1dkdgqi",
84
+ "I89eb": "f5ghsz",
85
+ "k1i1uq": "fyqop9u",
86
+ "Epwjcz": "f1m5ya7j",
87
+ "Bp1vogq": "f3sp63x",
51
88
  "px8gyy": ["f5bg3dr", "f1rfdd74"],
52
- "h6z6rw": ["fzd2j21", "f2549he"],
53
- "hl6cv3": "fotnskf",
89
+ "h6z6rw": "fzd2j21",
90
+ "hl6cv3": "f1773hnp",
54
91
  "Bh2vraf": "f1n8855c",
55
- "yayu3t": ["f1nq055x", "f13ohf3"],
92
+ "yayu3t": "f1v7783n",
56
93
  "wedwtw": "fsw6im5",
57
- "rhl9o9": "ftghsr9",
94
+ "rhl9o9": "fh2hsk5",
58
95
  "Bu8t5uz": "f159pzir",
59
- "B6q6orb": ["f1l8vbt4", "fsxzh25"],
96
+ "B6q6orb": "f11yvu4",
60
97
  "Bwwlvwl": "fm1ycve"
61
98
  }
62
99
  }, {
63
- "d": [".fjseox{display:none;}", ".f1sbtcvk{padding-top:5px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fy7v416{padding-bottom:7px;}", ".f132xexn{max-width:240px;}", ".f158kwzp{cursor:default;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".ft85np5{border-radius:var(--borderRadiusMedium);}", ".fcm7iae{background: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;}", ".fdr7u1v{background:var(--colorNeutralForeground2);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".f1euv43f{position:absolute;}", ".fpkirms{width:8.485px;}", ".ftt2rgf{height:8.485px;}", ".f1uo6wrk{background:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".fuzzvh5:before{content:\"\";}", ".fxf9f1y:before{position:absolute;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".ffo048g:before{background:inherit;}", ".fkk33zh:before{visibility:visible;}", ".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);}", ".f2549he: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\"] .fotnskf{bottom:0;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1nq055x{left:0;}", "[data-popper-placement^=\"right\"] .f13ohf3{right:0;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .ftghsr9{top:0;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f1l8vbt4{right:0;}", "[data-popper-placement^=\"left\"] .fsxzh25{left:0;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
100
+ "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
101
  });
65
102
  /**
66
103
  * Apply styling to the Tooltip slots based on the state
67
104
  */
68
105
 
69
106
 
70
- var useTooltipStyles = function (state) {
71
- var styles = useStyles();
72
- state.root.className = react_make_styles_1.mergeClasses(styles.root, state.appearance === 'inverted' && styles.inverted, state.visible && styles.visible, state.root.className);
107
+ const useTooltipStyles_unstable = state => {
108
+ const styles = useStyles();
109
+ state.content.className = react_1.mergeClasses(
110
+ /* eslint-disable-next-line deprecation/deprecation */
111
+ exports.tooltipClassName, exports.tooltipClassNames.content, styles.root, state.appearance === 'inverted' && styles.inverted, state.visible && styles.visible, state.content.className);
73
112
  state.arrowClassName = styles.arrow;
74
113
  return state;
75
114
  };
76
115
 
77
- exports.useTooltipStyles = useTooltipStyles;
116
+ exports.useTooltipStyles_unstable = useTooltipStyles_unstable;
78
117
  //# sourceMappingURL=useTooltipStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Tooltip/useTooltipStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAGA;;AAEG;;;AACH,IAAM,SAAS,gBAAG,mBAAA,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,EAAlB;AAwDA;;AAEG;;;AACI,IAAM,gBAAgB,GAAG,UAAC,KAAD,EAAoB;AAClD,MAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CACrB,MAAM,CAAC,I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KAAD,IAAsC;AAC7E,QAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,OAAN,CAAc,SAAd,GAA0B,OAAA,CAAA,YAAA;AACxB;AACA,EAAA,OAAA,CAAA,gBAFwB,EAGxB,OAAA,CAAA,iBAAA,CAAkB,OAHM,EAIxB,MAAM,CAAC,IAJiB,EAKxB,KAAK,CAAC,UAAN,KAAqB,UAArB,IAAmC,MAAM,CAAC,QALlB,EAMxB,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,OANA,EAOxB,KAAK,CAAC,OAAN,CAAc,SAPU,CAA1B;AAUA,EAAA,KAAK,CAAC,cAAN,GAAuB,MAAM,CAAC,KAA9B;AAEA,SAAO,KAAP;AACD,CAhBM;;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\n/**\n * @deprecated Use `tooltipClassNames.root` instead.\n */\nexport const tooltipClassName = 'fui-Tooltip';\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 /* eslint-disable-next-line deprecation/deprecation */\n tooltipClassName,\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/"}
@@ -3,8 +3,45 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.useTooltip_unstable = exports.useTooltipStyles_unstable = exports.tooltipClassNames = exports.tooltipClassName = exports.renderTooltip_unstable = exports.Tooltip = void 0;
6
7
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ var Tooltip_1 = /*#__PURE__*/require("./Tooltip");
8
9
 
9
- tslib_1.__exportStar(require("./Tooltip"), exports);
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
+ }); // eslint-disable-next-line deprecation/deprecation
22
+
23
+ Object.defineProperty(exports, "tooltipClassName", {
24
+ enumerable: true,
25
+ get: function () {
26
+ return Tooltip_1.tooltipClassName;
27
+ }
28
+ });
29
+ Object.defineProperty(exports, "tooltipClassNames", {
30
+ enumerable: true,
31
+ get: function () {
32
+ return Tooltip_1.tooltipClassNames;
33
+ }
34
+ });
35
+ Object.defineProperty(exports, "useTooltipStyles_unstable", {
36
+ enumerable: true,
37
+ get: function () {
38
+ return Tooltip_1.useTooltipStyles_unstable;
39
+ }
40
+ });
41
+ Object.defineProperty(exports, "useTooltip_unstable", {
42
+ enumerable: true,
43
+ get: function () {
44
+ return Tooltip_1.useTooltip_unstable;
45
+ }
46
+ });
10
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA","sourceRoot":""}
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,E,CACA;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,gBAAA;AAAgB;AAAhB,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 // eslint-disable-next-line deprecation/deprecation\n tooltipClassName,\n tooltipClassNames,\n useTooltipStyles_unstable,\n useTooltip_unstable,\n} from './Tooltip';\nexport type { OnVisibleChangeData, TooltipProps, TooltipSlots, TooltipState, TooltipTriggerProps } from './Tooltip';\n"],"sourceRoot":"../src/"}