@react-spectrum/tooltip 3.6.5 → 3.6.7

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/dist/main.js CHANGED
@@ -1,27 +1,13 @@
1
- require("./main.css");
2
- var $kAvU8$spectrumiconsuiAlertSmall = require("@spectrum-icons/ui/AlertSmall");
3
- var $kAvU8$reactspectrumutils = require("@react-spectrum/utils");
4
- var $kAvU8$spectrumiconsuiInfoSmall = require("@spectrum-icons/ui/InfoSmall");
5
- var $kAvU8$reactariautils = require("@react-aria/utils");
6
- var $kAvU8$react = require("react");
7
- var $kAvU8$spectrumiconsuiSuccessSmall = require("@spectrum-icons/ui/SuccessSmall");
8
- var $kAvU8$reactariatooltip = require("@react-aria/tooltip");
9
- var $kAvU8$reactariafocus = require("@react-aria/focus");
10
- var $kAvU8$reactspectrumoverlays = require("@react-spectrum/overlays");
11
- var $kAvU8$reactariaoverlays = require("@react-aria/overlays");
12
- var $kAvU8$reactstatelytooltip = require("@react-stately/tooltip");
1
+ var $55bd11986fcffc6f$exports = require("./Tooltip.main.js");
2
+ var $19f06480c1c1a932$exports = require("./TooltipTrigger.main.js");
13
3
 
14
4
 
15
5
  function $parcel$export(e, n, v, s) {
16
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
7
  }
18
8
 
19
- function $parcel$interopDefault(a) {
20
- return a && a.__esModule ? a.default : a;
21
- }
22
-
23
- $parcel$export(module.exports, "Tooltip", () => $55bd11986fcffc6f$export$28c660c63b792dea);
24
- $parcel$export(module.exports, "TooltipTrigger", () => $19f06480c1c1a932$export$8c610744efcf8a1d);
9
+ $parcel$export(module.exports, "Tooltip", () => $55bd11986fcffc6f$exports.Tooltip);
10
+ $parcel$export(module.exports, "TooltipTrigger", () => $19f06480c1c1a932$exports.TooltipTrigger);
25
11
  /*
26
12
  * Copyright 2020 Adobe. All rights reserved.
27
13
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -33,280 +19,6 @@ $parcel$export(module.exports, "TooltipTrigger", () => $19f06480c1c1a932$export$
33
19
  * OF ANY KIND, either express or implied. See the License for the specific language
34
20
  * governing permissions and limitations under the License.
35
21
  */ /// <reference types="css-module-types" />
36
- /*
37
- * Copyright 2020 Adobe. All rights reserved.
38
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
39
- * you may not use this file except in compliance with the License. You may obtain a copy
40
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
41
- *
42
- * Unless required by applicable law or agreed to in writing, software distributed under
43
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
44
- * OF ANY KIND, either express or implied. See the License for the specific language
45
- * governing permissions and limitations under the License.
46
- */
47
-
48
-
49
-
50
-
51
- var $ba73465d6d9b6556$exports = {};
52
-
53
- $parcel$export($ba73465d6d9b6556$exports, "focus-ring", () => $ba73465d6d9b6556$export$f39a09f249340e2a, (v) => $ba73465d6d9b6556$export$f39a09f249340e2a = v);
54
- $parcel$export($ba73465d6d9b6556$exports, "i18nFontFamily", () => $ba73465d6d9b6556$export$8c4ee2c50c22c514, (v) => $ba73465d6d9b6556$export$8c4ee2c50c22c514 = v);
55
- $parcel$export($ba73465d6d9b6556$exports, "is-focused", () => $ba73465d6d9b6556$export$e7dc768d35940237, (v) => $ba73465d6d9b6556$export$e7dc768d35940237 = v);
56
- $parcel$export($ba73465d6d9b6556$exports, "is-hovered", () => $ba73465d6d9b6556$export$b8813cd5d7824ce7, (v) => $ba73465d6d9b6556$export$b8813cd5d7824ce7 = v);
57
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-overlay--open", () => $ba73465d6d9b6556$export$a397eb58038aa381, (v) => $ba73465d6d9b6556$export$a397eb58038aa381 = v);
58
- $parcel$export($ba73465d6d9b6556$exports, "is-open", () => $ba73465d6d9b6556$export$a9781837241c946d, (v) => $ba73465d6d9b6556$export$a9781837241c946d = v);
59
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-overlay--bottom--open", () => $ba73465d6d9b6556$export$a96755f239de61ee, (v) => $ba73465d6d9b6556$export$a96755f239de61ee = v);
60
- $parcel$export($ba73465d6d9b6556$exports, "is-open--bottom", () => $ba73465d6d9b6556$export$1f160596ffe52357, (v) => $ba73465d6d9b6556$export$1f160596ffe52357 = v);
61
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-overlay--left--open", () => $ba73465d6d9b6556$export$a85c0c6b6cf8598c, (v) => $ba73465d6d9b6556$export$a85c0c6b6cf8598c = v);
62
- $parcel$export($ba73465d6d9b6556$exports, "is-open--left", () => $ba73465d6d9b6556$export$d6106cb3acaf56ae, (v) => $ba73465d6d9b6556$export$d6106cb3acaf56ae = v);
63
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-overlay--right--open", () => $ba73465d6d9b6556$export$85aaa87e65e040bf, (v) => $ba73465d6d9b6556$export$85aaa87e65e040bf = v);
64
- $parcel$export($ba73465d6d9b6556$exports, "is-open--right", () => $ba73465d6d9b6556$export$8935d072812c3169, (v) => $ba73465d6d9b6556$export$8935d072812c3169 = v);
65
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-overlay--top--open", () => $ba73465d6d9b6556$export$b9768db7ffc1bc2, (v) => $ba73465d6d9b6556$export$b9768db7ffc1bc2 = v);
66
- $parcel$export($ba73465d6d9b6556$exports, "is-open--top", () => $ba73465d6d9b6556$export$cd4bf1e07ae86214, (v) => $ba73465d6d9b6556$export$cd4bf1e07ae86214 = v);
67
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-FocusRing-ring", () => $ba73465d6d9b6556$export$4109102f950813a6, (v) => $ba73465d6d9b6556$export$4109102f950813a6 = v);
68
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-FocusRing", () => $ba73465d6d9b6556$export$24c7f46a6e3605dd, (v) => $ba73465d6d9b6556$export$24c7f46a6e3605dd = v);
69
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-FocusRing--quiet", () => $ba73465d6d9b6556$export$2927016961429360, (v) => $ba73465d6d9b6556$export$2927016961429360 = v);
70
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-overlay", () => $ba73465d6d9b6556$export$39eed38e2296a1d6, (v) => $ba73465d6d9b6556$export$39eed38e2296a1d6 = v);
71
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip", () => $ba73465d6d9b6556$export$f7bf7078d3d03f05, (v) => $ba73465d6d9b6556$export$f7bf7078d3d03f05 = v);
72
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--bottom", () => $ba73465d6d9b6556$export$4f420a9bbb442953, (v) => $ba73465d6d9b6556$export$4f420a9bbb442953 = v);
73
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--error", () => $ba73465d6d9b6556$export$2b291890a5577893, (v) => $ba73465d6d9b6556$export$2b291890a5577893 = v);
74
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--help", () => $ba73465d6d9b6556$export$d33ca445ae528241, (v) => $ba73465d6d9b6556$export$d33ca445ae528241 = v);
75
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--info", () => $ba73465d6d9b6556$export$e995d5780591d0a8, (v) => $ba73465d6d9b6556$export$e995d5780591d0a8 = v);
76
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--left", () => $ba73465d6d9b6556$export$47f060b68b4cab2c, (v) => $ba73465d6d9b6556$export$47f060b68b4cab2c = v);
77
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--negative", () => $ba73465d6d9b6556$export$92fe45b4260594f6, (v) => $ba73465d6d9b6556$export$92fe45b4260594f6 = v);
78
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--positive", () => $ba73465d6d9b6556$export$11cbf31e1b6e51ac, (v) => $ba73465d6d9b6556$export$11cbf31e1b6e51ac = v);
79
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--right", () => $ba73465d6d9b6556$export$c094187772823b2e, (v) => $ba73465d6d9b6556$export$c094187772823b2e = v);
80
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--success", () => $ba73465d6d9b6556$export$4eae622bc9b08cac, (v) => $ba73465d6d9b6556$export$4eae622bc9b08cac = v);
81
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip--top", () => $ba73465d6d9b6556$export$d7516df59e198fc7, (v) => $ba73465d6d9b6556$export$d7516df59e198fc7 = v);
82
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip-label", () => $ba73465d6d9b6556$export$f4096e0dc445b255, (v) => $ba73465d6d9b6556$export$f4096e0dc445b255 = v);
83
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip-tip", () => $ba73465d6d9b6556$export$9deb89a7a91de30, (v) => $ba73465d6d9b6556$export$9deb89a7a91de30 = v);
84
- $parcel$export($ba73465d6d9b6556$exports, "spectrum-Tooltip-typeIcon", () => $ba73465d6d9b6556$export$ff23d46fee8272e4, (v) => $ba73465d6d9b6556$export$ff23d46fee8272e4 = v);
85
- $parcel$export($ba73465d6d9b6556$exports, "u-tooltip-showOnHover", () => $ba73465d6d9b6556$export$6ea3237f62800d00, (v) => $ba73465d6d9b6556$export$6ea3237f62800d00 = v);
86
- var $ba73465d6d9b6556$export$f39a09f249340e2a;
87
- var $ba73465d6d9b6556$export$8c4ee2c50c22c514;
88
- var $ba73465d6d9b6556$export$e7dc768d35940237;
89
- var $ba73465d6d9b6556$export$b8813cd5d7824ce7;
90
- var $ba73465d6d9b6556$export$a397eb58038aa381;
91
- var $ba73465d6d9b6556$export$a9781837241c946d;
92
- var $ba73465d6d9b6556$export$a96755f239de61ee;
93
- var $ba73465d6d9b6556$export$1f160596ffe52357;
94
- var $ba73465d6d9b6556$export$a85c0c6b6cf8598c;
95
- var $ba73465d6d9b6556$export$d6106cb3acaf56ae;
96
- var $ba73465d6d9b6556$export$85aaa87e65e040bf;
97
- var $ba73465d6d9b6556$export$8935d072812c3169;
98
- var $ba73465d6d9b6556$export$b9768db7ffc1bc2;
99
- var $ba73465d6d9b6556$export$cd4bf1e07ae86214;
100
- var $ba73465d6d9b6556$export$4109102f950813a6;
101
- var $ba73465d6d9b6556$export$24c7f46a6e3605dd;
102
- var $ba73465d6d9b6556$export$2927016961429360;
103
- var $ba73465d6d9b6556$export$39eed38e2296a1d6;
104
- var $ba73465d6d9b6556$export$f7bf7078d3d03f05;
105
- var $ba73465d6d9b6556$export$4f420a9bbb442953;
106
- var $ba73465d6d9b6556$export$2b291890a5577893;
107
- var $ba73465d6d9b6556$export$d33ca445ae528241;
108
- var $ba73465d6d9b6556$export$e995d5780591d0a8;
109
- var $ba73465d6d9b6556$export$47f060b68b4cab2c;
110
- var $ba73465d6d9b6556$export$92fe45b4260594f6;
111
- var $ba73465d6d9b6556$export$11cbf31e1b6e51ac;
112
- var $ba73465d6d9b6556$export$c094187772823b2e;
113
- var $ba73465d6d9b6556$export$4eae622bc9b08cac;
114
- var $ba73465d6d9b6556$export$d7516df59e198fc7;
115
- var $ba73465d6d9b6556$export$f4096e0dc445b255;
116
- var $ba73465d6d9b6556$export$9deb89a7a91de30;
117
- var $ba73465d6d9b6556$export$ff23d46fee8272e4;
118
- var $ba73465d6d9b6556$export$6ea3237f62800d00;
119
- $ba73465d6d9b6556$export$f39a09f249340e2a = `KF3Kcq_focus-ring`;
120
- $ba73465d6d9b6556$export$8c4ee2c50c22c514 = `KF3Kcq_i18nFontFamily`;
121
- $ba73465d6d9b6556$export$e7dc768d35940237 = `KF3Kcq_is-focused`;
122
- $ba73465d6d9b6556$export$b8813cd5d7824ce7 = `KF3Kcq_is-hovered`;
123
- $ba73465d6d9b6556$export$a397eb58038aa381 = `KF3Kcq_spectrum-overlay--open`;
124
- $ba73465d6d9b6556$export$a9781837241c946d = `KF3Kcq_is-open ${$ba73465d6d9b6556$export$a397eb58038aa381}`;
125
- $ba73465d6d9b6556$export$a96755f239de61ee = `KF3Kcq_spectrum-overlay--bottom--open`;
126
- $ba73465d6d9b6556$export$1f160596ffe52357 = `KF3Kcq_is-open--bottom ${$ba73465d6d9b6556$export$a96755f239de61ee}`;
127
- $ba73465d6d9b6556$export$a85c0c6b6cf8598c = `KF3Kcq_spectrum-overlay--left--open`;
128
- $ba73465d6d9b6556$export$d6106cb3acaf56ae = `KF3Kcq_is-open--left ${$ba73465d6d9b6556$export$a85c0c6b6cf8598c}`;
129
- $ba73465d6d9b6556$export$85aaa87e65e040bf = `KF3Kcq_spectrum-overlay--right--open`;
130
- $ba73465d6d9b6556$export$8935d072812c3169 = `KF3Kcq_is-open--right ${$ba73465d6d9b6556$export$85aaa87e65e040bf}`;
131
- $ba73465d6d9b6556$export$b9768db7ffc1bc2 = `KF3Kcq_spectrum-overlay--top--open`;
132
- $ba73465d6d9b6556$export$cd4bf1e07ae86214 = `KF3Kcq_is-open--top ${$ba73465d6d9b6556$export$b9768db7ffc1bc2}`;
133
- $ba73465d6d9b6556$export$4109102f950813a6 = `KF3Kcq_spectrum-FocusRing-ring`;
134
- $ba73465d6d9b6556$export$24c7f46a6e3605dd = `KF3Kcq_spectrum-FocusRing ${$ba73465d6d9b6556$export$4109102f950813a6}`;
135
- $ba73465d6d9b6556$export$2927016961429360 = `KF3Kcq_spectrum-FocusRing--quiet`;
136
- $ba73465d6d9b6556$export$39eed38e2296a1d6 = `KF3Kcq_spectrum-overlay`;
137
- $ba73465d6d9b6556$export$f7bf7078d3d03f05 = `KF3Kcq_spectrum-Tooltip ${$ba73465d6d9b6556$export$39eed38e2296a1d6}`;
138
- $ba73465d6d9b6556$export$4f420a9bbb442953 = `KF3Kcq_spectrum-Tooltip--bottom`;
139
- $ba73465d6d9b6556$export$2b291890a5577893 = `KF3Kcq_spectrum-Tooltip--error`;
140
- $ba73465d6d9b6556$export$d33ca445ae528241 = `KF3Kcq_spectrum-Tooltip--help`;
141
- $ba73465d6d9b6556$export$e995d5780591d0a8 = `KF3Kcq_spectrum-Tooltip--info`;
142
- $ba73465d6d9b6556$export$47f060b68b4cab2c = `KF3Kcq_spectrum-Tooltip--left`;
143
- $ba73465d6d9b6556$export$92fe45b4260594f6 = `KF3Kcq_spectrum-Tooltip--negative`;
144
- $ba73465d6d9b6556$export$11cbf31e1b6e51ac = `KF3Kcq_spectrum-Tooltip--positive`;
145
- $ba73465d6d9b6556$export$c094187772823b2e = `KF3Kcq_spectrum-Tooltip--right`;
146
- $ba73465d6d9b6556$export$4eae622bc9b08cac = `KF3Kcq_spectrum-Tooltip--success`;
147
- $ba73465d6d9b6556$export$d7516df59e198fc7 = `KF3Kcq_spectrum-Tooltip--top`;
148
- $ba73465d6d9b6556$export$f4096e0dc445b255 = `KF3Kcq_spectrum-Tooltip-label`;
149
- $ba73465d6d9b6556$export$9deb89a7a91de30 = `KF3Kcq_spectrum-Tooltip-tip`;
150
- $ba73465d6d9b6556$export$ff23d46fee8272e4 = `KF3Kcq_spectrum-Tooltip-typeIcon`;
151
- $ba73465d6d9b6556$export$6ea3237f62800d00 = `KF3Kcq_u-tooltip-showOnHover`;
152
-
153
-
154
-
155
- /*
156
- * Copyright 2020 Adobe. All rights reserved.
157
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
158
- * you may not use this file except in compliance with the License. You may obtain a copy
159
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
160
- *
161
- * Unless required by applicable law or agreed to in writing, software distributed under
162
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
163
- * OF ANY KIND, either express or implied. See the License for the specific language
164
- * governing permissions and limitations under the License.
165
- */
166
- const $ed2e56c8503433b4$export$39ae08fa83328b12 = (0, ($parcel$interopDefault($kAvU8$react))).createContext({});
167
-
168
-
169
-
170
- let $55bd11986fcffc6f$var$iconMap = {
171
- info: (0, ($parcel$interopDefault($kAvU8$spectrumiconsuiInfoSmall))),
172
- positive: (0, ($parcel$interopDefault($kAvU8$spectrumiconsuiSuccessSmall))),
173
- negative: (0, ($parcel$interopDefault($kAvU8$spectrumiconsuiAlertSmall)))
174
- };
175
- function $55bd11986fcffc6f$var$Tooltip(props, ref) {
176
- let { ref: overlayRef, arrowProps: arrowProps, state: state, arrowRef: arrowRef, ...tooltipProviderProps } = (0, $kAvU8$react.useContext)((0, $ed2e56c8503433b4$export$39ae08fa83328b12));
177
- let defaultRef = (0, $kAvU8$react.useRef)();
178
- overlayRef = overlayRef || defaultRef;
179
- props = (0, $kAvU8$reactariautils.mergeProps)(props, tooltipProviderProps);
180
- let { variant: variant = "neutral", placement: placement = "top", isOpen: isOpen, showIcon: showIcon, ...otherProps } = props;
181
- let { styleProps: styleProps } = (0, $kAvU8$reactspectrumutils.useStyleProps)(otherProps);
182
- let { tooltipProps: tooltipProps } = (0, $kAvU8$reactariatooltip.useTooltip)(props, state);
183
- // Sync ref with overlayRef from context.
184
- (0, $kAvU8$react.useImperativeHandle)(ref, ()=>(0, $kAvU8$reactspectrumutils.createDOMRef)(overlayRef));
185
- let Icon = $55bd11986fcffc6f$var$iconMap[variant];
186
- return /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement("div", {
187
- ...styleProps,
188
- ...tooltipProps,
189
- className: (0, $kAvU8$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ba73465d6d9b6556$exports))), "spectrum-Tooltip", `spectrum-Tooltip--${variant}`, `spectrum-Tooltip--${placement}`, {
190
- "is-open": isOpen,
191
- [`is-open--${placement}`]: isOpen
192
- }, styleProps.className),
193
- ref: overlayRef
194
- }, showIcon && variant !== "neutral" && /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement(Icon, {
195
- UNSAFE_className: (0, $kAvU8$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ba73465d6d9b6556$exports))), "spectrum-Tooltip-typeIcon"),
196
- "aria-hidden": true
197
- }), props.children && /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement("span", {
198
- className: (0, $kAvU8$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ba73465d6d9b6556$exports))), "spectrum-Tooltip-label")
199
- }, props.children), /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement("span", {
200
- ...arrowProps,
201
- ref: arrowRef,
202
- className: (0, $kAvU8$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ba73465d6d9b6556$exports))), "spectrum-Tooltip-tip")
203
- }));
204
- }
205
- /**
206
- * Display container for Tooltip content. Has a directional arrow dependent on its placement.
207
- */ let $55bd11986fcffc6f$export$28c660c63b792dea = /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).forwardRef($55bd11986fcffc6f$var$Tooltip);
208
-
209
-
210
- /*
211
- * Copyright 2020 Adobe. All rights reserved.
212
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
213
- * you may not use this file except in compliance with the License. You may obtain a copy
214
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
215
- *
216
- * Unless required by applicable law or agreed to in writing, software distributed under
217
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
218
- * OF ANY KIND, either express or implied. See the License for the specific language
219
- * governing permissions and limitations under the License.
220
- */
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
- const $19f06480c1c1a932$var$DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button
229
- const $19f06480c1c1a932$var$DEFAULT_CROSS_OFFSET = 0;
230
- function $19f06480c1c1a932$var$TooltipTrigger(props) {
231
- let { children: children, crossOffset: crossOffset = $19f06480c1c1a932$var$DEFAULT_CROSS_OFFSET, isDisabled: isDisabled, offset: offset = $19f06480c1c1a932$var$DEFAULT_OFFSET, trigger: triggerAction } = props;
232
- let [trigger, tooltip] = (0, ($parcel$interopDefault($kAvU8$react))).Children.toArray(children);
233
- let state = (0, $kAvU8$reactstatelytooltip.useTooltipTriggerState)(props);
234
- let tooltipTriggerRef = (0, $kAvU8$react.useRef)();
235
- let overlayRef = (0, $kAvU8$react.useRef)();
236
- let { triggerProps: triggerProps, tooltipProps: tooltipProps } = (0, $kAvU8$reactariatooltip.useTooltipTrigger)({
237
- isDisabled: isDisabled,
238
- trigger: triggerAction
239
- }, state, tooltipTriggerRef);
240
- let [borderRadius, setBorderRadius] = (0, $kAvU8$react.useState)(0);
241
- (0, $kAvU8$reactariautils.useLayoutEffect)(()=>{
242
- if (overlayRef.current && state.isOpen) {
243
- let spectrumBorderRadius = window.getComputedStyle(overlayRef.current).borderRadius;
244
- if (spectrumBorderRadius !== "") setBorderRadius(parseInt(spectrumBorderRadius, 10));
245
- }
246
- }, [
247
- state.isOpen,
248
- overlayRef
249
- ]);
250
- let arrowRef = (0, $kAvU8$react.useRef)(null);
251
- let [arrowWidth, setArrowWidth] = (0, $kAvU8$react.useState)(0);
252
- (0, $kAvU8$reactariautils.useLayoutEffect)(()=>{
253
- if (arrowRef.current && state.isOpen) setArrowWidth(arrowRef.current.getBoundingClientRect().width);
254
- }, [
255
- state.isOpen,
256
- arrowRef
257
- ]);
258
- let { overlayProps: overlayProps, arrowProps: arrowProps, placement: placement } = (0, $kAvU8$reactariaoverlays.useOverlayPosition)({
259
- placement: props.placement || "top",
260
- targetRef: tooltipTriggerRef,
261
- overlayRef: overlayRef,
262
- offset: offset,
263
- crossOffset: crossOffset,
264
- isOpen: state.isOpen,
265
- shouldFlip: props.shouldFlip,
266
- containerPadding: props.containerPadding,
267
- arrowSize: arrowWidth,
268
- arrowBoundaryOffset: borderRadius
269
- });
270
- return /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement((0, $kAvU8$reactariafocus.FocusableProvider), {
271
- ...triggerProps,
272
- ref: tooltipTriggerRef
273
- }, trigger, /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement((0, $ed2e56c8503433b4$export$39ae08fa83328b12).Provider, {
274
- value: {
275
- state: state,
276
- placement: placement,
277
- ref: overlayRef,
278
- UNSAFE_style: overlayProps.style,
279
- arrowProps: arrowProps,
280
- arrowRef: arrowRef,
281
- ...tooltipProps
282
- }
283
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement((0, $kAvU8$reactspectrumoverlays.Overlay), {
284
- isOpen: state.isOpen,
285
- nodeRef: overlayRef
286
- }, tooltip)));
287
- }
288
- // Support TooltipTrigger inside components using CollectionBuilder.
289
- $19f06480c1c1a932$var$TooltipTrigger.getCollectionNode = function*(props) {
290
- // Replaced the use of React.Childern.toArray because it mutates the key prop.
291
- let childArray = [];
292
- (0, ($parcel$interopDefault($kAvU8$react))).Children.forEach(props.children, (child)=>{
293
- if (/*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).isValidElement(child)) childArray.push(child);
294
- });
295
- let [trigger, tooltip] = childArray;
296
- yield {
297
- element: trigger,
298
- wrapper: (element)=>/*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement($19f06480c1c1a932$var$TooltipTrigger, {
299
- key: element.key,
300
- ...props
301
- }, element, tooltip)
302
- };
303
- };
304
- /**
305
- * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing
306
- * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip
307
- * relative to the trigger.
308
- */ // We don't want getCollectionNode to show up in the type definition
309
- let $19f06480c1c1a932$export$8c610744efcf8a1d = $19f06480c1c1a932$var$TooltipTrigger;
310
22
 
311
23
 
312
24
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;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G;IACzB,MAAM;QACJ,SAAS;QACT,SAAS,CAAC,wBACR,0DAAC;gBAAe,KAAK,QAAQ,GAAG;gBAAG,GAAG,KAAK;eACxC,SACA;IAGP;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAkB;;","sources":["packages/@react-spectrum/tooltip/src/index.ts","packages/@react-spectrum/tooltip/src/Tooltip.tsx","packages/@adobe/spectrum-css-temp/components/tooltip/vars.css","packages/@react-spectrum/tooltip/src/context.ts","packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Tooltip} from './Tooltip';\nexport {TooltipTrigger} from './TooltipTrigger';\nexport type {SpectrumTooltipProps, SpectrumTooltipTriggerProps} from '@react-types/tooltip';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertSmall from '@spectrum-icons/ui/AlertSmall';\nimport {classNames, createDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport InfoSmall from '@spectrum-icons/ui/InfoSmall';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTooltipProps} from '@react-types/tooltip';\nimport styles from '@adobe/spectrum-css-temp/components/tooltip/vars.css';\nimport SuccessSmall from '@spectrum-icons/ui/SuccessSmall';\nimport {TooltipContext} from './context';\nimport {useTooltip} from '@react-aria/tooltip';\n\nlet iconMap = {\n info: InfoSmall,\n positive: SuccessSmall,\n negative: AlertSmall\n};\n\nfunction Tooltip(props: SpectrumTooltipProps, ref: DOMRef) {\n let {ref: overlayRef, arrowProps, state, arrowRef, ...tooltipProviderProps} = useContext(TooltipContext);\n let defaultRef = useRef();\n overlayRef = overlayRef || defaultRef;\n props = mergeProps(props, tooltipProviderProps);\n let {\n variant = 'neutral',\n placement = 'top',\n isOpen,\n showIcon,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {tooltipProps} = useTooltip(props, state);\n\n // Sync ref with overlayRef from context.\n useImperativeHandle(ref, () => createDOMRef(overlayRef));\n\n let Icon = iconMap[variant];\n\n return (\n <div\n {...styleProps}\n {...tooltipProps}\n className={classNames(\n styles,\n 'spectrum-Tooltip',\n `spectrum-Tooltip--${variant}`,\n `spectrum-Tooltip--${placement}`,\n {\n 'is-open': isOpen,\n [`is-open--${placement}`]: isOpen\n },\n styleProps.className\n )}\n ref={overlayRef}>\n {showIcon && variant !== 'neutral' && <Icon UNSAFE_className={classNames(styles, 'spectrum-Tooltip-typeIcon')} aria-hidden />}\n {props.children && (\n <span className={classNames(styles, 'spectrum-Tooltip-label')}>\n {props.children}\n </span>\n )}\n <span {...arrowProps} ref={arrowRef} className={classNames(styles, 'spectrum-Tooltip-tip')} />\n </div>\n );\n}\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = React.forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PlacementAxis} from '@react-types/overlays';\nimport React, {HTMLAttributes, RefObject} from 'react';\nimport {StyleProps} from '@react-types/shared';\nimport {TooltipTriggerState} from '@react-stately/tooltip';\n\ninterface TooltipContextProps extends StyleProps {\n state?: TooltipTriggerState,\n ref?: RefObject<HTMLDivElement>,\n placement?: PlacementAxis,\n arrowProps?: HTMLAttributes<HTMLElement>,\n arrowRef?: RefObject<HTMLElement>\n}\n\nexport const TooltipContext = React.createContext<TooltipContextProps>({});\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableProvider} from '@react-aria/focus';\nimport {Overlay} from '@react-spectrum/overlays';\nimport React, {JSX, ReactElement, useRef, useState} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useOverlayPosition} from '@react-aria/overlays';\nimport {useTooltipTrigger} from '@react-aria/tooltip';\nimport {useTooltipTriggerState} from '@react-stately/tooltip';\n\nconst DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button\nconst DEFAULT_CROSS_OFFSET = 0;\n\nfunction TooltipTrigger(props: SpectrumTooltipTriggerProps) {\n let {\n children,\n crossOffset = DEFAULT_CROSS_OFFSET,\n isDisabled,\n offset = DEFAULT_OFFSET,\n trigger: triggerAction\n } = props;\n\n let [trigger, tooltip] = React.Children.toArray(children) as [ReactElement, ReactElement];\n let state = useTooltipTriggerState(props);\n\n let tooltipTriggerRef = useRef<HTMLElement>();\n let overlayRef = useRef<HTMLDivElement>();\n\n let {triggerProps, tooltipProps} = useTooltipTrigger({\n isDisabled,\n trigger: triggerAction\n }, state, tooltipTriggerRef);\n\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (overlayRef.current && state.isOpen) {\n let spectrumBorderRadius = window.getComputedStyle(overlayRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [state.isOpen, overlayRef]);\n let arrowRef = useRef(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {overlayProps, arrowProps, placement} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: tooltipTriggerRef,\n overlayRef,\n offset,\n crossOffset,\n isOpen: state.isOpen,\n shouldFlip: props.shouldFlip,\n containerPadding: props.containerPadding,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: borderRadius\n });\n\n return (\n <FocusableProvider\n {...triggerProps}\n ref={tooltipTriggerRef}>\n {trigger}\n <TooltipContext.Provider\n value={{\n state,\n placement,\n ref: overlayRef,\n UNSAFE_style: overlayProps.style,\n arrowProps,\n arrowRef: arrowRef,\n ...tooltipProps\n }}>\n <Overlay isOpen={state.isOpen} nodeRef={overlayRef}>\n {tooltip}\n </Overlay>\n </TooltipContext.Provider>\n </FocusableProvider>\n );\n}\n\n// Support TooltipTrigger inside components using CollectionBuilder.\nTooltipTrigger.getCollectionNode = function* (props: SpectrumTooltipTriggerProps) {\n // Replaced the use of React.Childern.toArray because it mutates the key prop.\n let childArray: ReactElement[] = [];\n React.Children.forEach(props.children, child => {\n if (React.isValidElement(child)) {\n childArray.push(child);\n }\n });\n let [trigger, tooltip] = childArray;\n yield {\n element: trigger,\n wrapper: (element) => (\n <TooltipTrigger key={element.key} {...props}>\n {element}\n {tooltip}\n </TooltipTrigger>\n )\n };\n};\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TooltipTrigger = TooltipTrigger as (props: SpectrumTooltipTriggerProps) => JSX.Element;\nexport {_TooltipTrigger as TooltipTrigger};\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/tooltip/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Tooltip} from './Tooltip';\nexport {TooltipTrigger} from './TooltipTrigger';\nexport type {SpectrumTooltipProps, SpectrumTooltipTriggerProps} from '@react-types/tooltip';\n"],"names":[],"version":3,"file":"main.js.map"}