@react-spectrum/tooltip 3.3.4 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,241 @@
1
+ import "./main.css";
2
+ import $lbkGW$spectrumiconsuiAlertSmall from "@spectrum-icons/ui/AlertSmall";
3
+ import {useStyleProps as $lbkGW$useStyleProps, createDOMRef as $lbkGW$createDOMRef, classNames as $lbkGW$classNames} from "@react-spectrum/utils";
4
+ import $lbkGW$spectrumiconsuiInfoSmall from "@spectrum-icons/ui/InfoSmall";
5
+ import {mergeProps as $lbkGW$mergeProps} from "@react-aria/utils";
6
+ import $lbkGW$react, {useContext as $lbkGW$useContext, useRef as $lbkGW$useRef, useImperativeHandle as $lbkGW$useImperativeHandle} from "react";
7
+ import $lbkGW$spectrumiconsuiSuccessSmall from "@spectrum-icons/ui/SuccessSmall";
8
+ import {useTooltip as $lbkGW$useTooltip, useTooltipTrigger as $lbkGW$useTooltipTrigger} from "@react-aria/tooltip";
9
+ import {FocusableProvider as $lbkGW$FocusableProvider} from "@react-aria/focus";
10
+ import {Overlay as $lbkGW$Overlay} from "@react-spectrum/overlays";
11
+ import {useOverlayPosition as $lbkGW$useOverlayPosition} from "@react-aria/overlays";
12
+ import {useTooltipTriggerState as $lbkGW$useTooltipTriggerState} from "@react-stately/tooltip";
13
+
14
+ function $parcel$interopDefault(a) {
15
+ return a && a.__esModule ? a.default : a;
16
+ }
17
+ function $parcel$export(e, n, v, s) {
18
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
19
+ }
20
+ /*
21
+ * Copyright 2020 Adobe. All rights reserved.
22
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
+ * you may not use this file except in compliance with the License. You may obtain a copy
24
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software distributed under
27
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
28
+ * OF ANY KIND, either express or implied. See the License for the specific language
29
+ * governing permissions and limitations under the License.
30
+ */ /// <reference types="css-module-types" />
31
+ /*
32
+ * Copyright 2020 Adobe. All rights reserved.
33
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
34
+ * you may not use this file except in compliance with the License. You may obtain a copy
35
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
36
+ *
37
+ * Unless required by applicable law or agreed to in writing, software distributed under
38
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
39
+ * OF ANY KIND, either express or implied. See the License for the specific language
40
+ * governing permissions and limitations under the License.
41
+ */
42
+
43
+
44
+
45
+
46
+ var $1e9110aec8886b85$exports = {};
47
+
48
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip", () => $1e9110aec8886b85$export$f7bf7078d3d03f05, (v) => $1e9110aec8886b85$export$f7bf7078d3d03f05 = v);
49
+ $parcel$export($1e9110aec8886b85$exports, "is-open", () => $1e9110aec8886b85$export$a9781837241c946d, (v) => $1e9110aec8886b85$export$a9781837241c946d = v);
50
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--bottom", () => $1e9110aec8886b85$export$4f420a9bbb442953, (v) => $1e9110aec8886b85$export$4f420a9bbb442953 = v);
51
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--top", () => $1e9110aec8886b85$export$d7516df59e198fc7, (v) => $1e9110aec8886b85$export$d7516df59e198fc7 = v);
52
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--right", () => $1e9110aec8886b85$export$c094187772823b2e, (v) => $1e9110aec8886b85$export$c094187772823b2e = v);
53
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--left", () => $1e9110aec8886b85$export$47f060b68b4cab2c, (v) => $1e9110aec8886b85$export$47f060b68b4cab2c = v);
54
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip-tip", () => $1e9110aec8886b85$export$9deb89a7a91de30, (v) => $1e9110aec8886b85$export$9deb89a7a91de30 = v);
55
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip-typeIcon", () => $1e9110aec8886b85$export$ff23d46fee8272e4, (v) => $1e9110aec8886b85$export$ff23d46fee8272e4 = v);
56
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip-label", () => $1e9110aec8886b85$export$f4096e0dc445b255, (v) => $1e9110aec8886b85$export$f4096e0dc445b255 = v);
57
+ $parcel$export($1e9110aec8886b85$exports, "u-tooltip-showOnHover", () => $1e9110aec8886b85$export$6ea3237f62800d00, (v) => $1e9110aec8886b85$export$6ea3237f62800d00 = v);
58
+ $parcel$export($1e9110aec8886b85$exports, "is-hovered", () => $1e9110aec8886b85$export$b8813cd5d7824ce7, (v) => $1e9110aec8886b85$export$b8813cd5d7824ce7 = v);
59
+ $parcel$export($1e9110aec8886b85$exports, "is-focused", () => $1e9110aec8886b85$export$e7dc768d35940237, (v) => $1e9110aec8886b85$export$e7dc768d35940237 = v);
60
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--negative", () => $1e9110aec8886b85$export$92fe45b4260594f6, (v) => $1e9110aec8886b85$export$92fe45b4260594f6 = v);
61
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--error", () => $1e9110aec8886b85$export$2b291890a5577893, (v) => $1e9110aec8886b85$export$2b291890a5577893 = v);
62
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--info", () => $1e9110aec8886b85$export$e995d5780591d0a8, (v) => $1e9110aec8886b85$export$e995d5780591d0a8 = v);
63
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--help", () => $1e9110aec8886b85$export$d33ca445ae528241, (v) => $1e9110aec8886b85$export$d33ca445ae528241 = v);
64
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--positive", () => $1e9110aec8886b85$export$11cbf31e1b6e51ac, (v) => $1e9110aec8886b85$export$11cbf31e1b6e51ac = v);
65
+ $parcel$export($1e9110aec8886b85$exports, "spectrum-Tooltip--success", () => $1e9110aec8886b85$export$4eae622bc9b08cac, (v) => $1e9110aec8886b85$export$4eae622bc9b08cac = v);
66
+ var $1e9110aec8886b85$export$f7bf7078d3d03f05;
67
+ var $1e9110aec8886b85$export$a9781837241c946d;
68
+ var $1e9110aec8886b85$export$4f420a9bbb442953;
69
+ var $1e9110aec8886b85$export$d7516df59e198fc7;
70
+ var $1e9110aec8886b85$export$c094187772823b2e;
71
+ var $1e9110aec8886b85$export$47f060b68b4cab2c;
72
+ var $1e9110aec8886b85$export$9deb89a7a91de30;
73
+ var $1e9110aec8886b85$export$ff23d46fee8272e4;
74
+ var $1e9110aec8886b85$export$f4096e0dc445b255;
75
+ var $1e9110aec8886b85$export$6ea3237f62800d00;
76
+ var $1e9110aec8886b85$export$b8813cd5d7824ce7;
77
+ var $1e9110aec8886b85$export$e7dc768d35940237;
78
+ var $1e9110aec8886b85$export$92fe45b4260594f6;
79
+ var $1e9110aec8886b85$export$2b291890a5577893;
80
+ var $1e9110aec8886b85$export$e995d5780591d0a8;
81
+ var $1e9110aec8886b85$export$d33ca445ae528241;
82
+ var $1e9110aec8886b85$export$11cbf31e1b6e51ac;
83
+ var $1e9110aec8886b85$export$4eae622bc9b08cac;
84
+ $1e9110aec8886b85$export$f7bf7078d3d03f05 = "spectrum-Tooltip_22ae94";
85
+ $1e9110aec8886b85$export$a9781837241c946d = "is-open_22ae94";
86
+ $1e9110aec8886b85$export$4f420a9bbb442953 = "spectrum-Tooltip--bottom_22ae94";
87
+ $1e9110aec8886b85$export$d7516df59e198fc7 = "spectrum-Tooltip--top_22ae94";
88
+ $1e9110aec8886b85$export$c094187772823b2e = "spectrum-Tooltip--right_22ae94";
89
+ $1e9110aec8886b85$export$47f060b68b4cab2c = "spectrum-Tooltip--left_22ae94";
90
+ $1e9110aec8886b85$export$9deb89a7a91de30 = "spectrum-Tooltip-tip_22ae94";
91
+ $1e9110aec8886b85$export$ff23d46fee8272e4 = "spectrum-Tooltip-typeIcon_22ae94";
92
+ $1e9110aec8886b85$export$f4096e0dc445b255 = "spectrum-Tooltip-label_22ae94";
93
+ $1e9110aec8886b85$export$6ea3237f62800d00 = "u-tooltip-showOnHover_22ae94";
94
+ $1e9110aec8886b85$export$b8813cd5d7824ce7 = "is-hovered_22ae94";
95
+ $1e9110aec8886b85$export$e7dc768d35940237 = "is-focused_22ae94";
96
+ $1e9110aec8886b85$export$92fe45b4260594f6 = "spectrum-Tooltip--negative_22ae94";
97
+ $1e9110aec8886b85$export$2b291890a5577893 = "spectrum-Tooltip--error_22ae94";
98
+ $1e9110aec8886b85$export$e995d5780591d0a8 = "spectrum-Tooltip--info_22ae94";
99
+ $1e9110aec8886b85$export$d33ca445ae528241 = "spectrum-Tooltip--help_22ae94";
100
+ $1e9110aec8886b85$export$11cbf31e1b6e51ac = "spectrum-Tooltip--positive_22ae94";
101
+ $1e9110aec8886b85$export$4eae622bc9b08cac = "spectrum-Tooltip--success_22ae94";
102
+
103
+
104
+
105
+ /*
106
+ * Copyright 2020 Adobe. All rights reserved.
107
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
108
+ * you may not use this file except in compliance with the License. You may obtain a copy
109
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
110
+ *
111
+ * Unless required by applicable law or agreed to in writing, software distributed under
112
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
113
+ * OF ANY KIND, either express or implied. See the License for the specific language
114
+ * governing permissions and limitations under the License.
115
+ */
116
+ const $b8c00169fae46ac7$export$39ae08fa83328b12 = (0, $lbkGW$react).createContext({});
117
+
118
+
119
+
120
+ let $dc9e2a6f9971fb04$var$iconMap = {
121
+ info: (0, $lbkGW$spectrumiconsuiInfoSmall),
122
+ positive: (0, $lbkGW$spectrumiconsuiSuccessSmall),
123
+ negative: (0, $lbkGW$spectrumiconsuiAlertSmall)
124
+ };
125
+ function $dc9e2a6f9971fb04$var$Tooltip(props, ref) {
126
+ let { ref: overlayRef , arrowProps: arrowProps , state: state , ...tooltipProviderProps } = (0, $lbkGW$useContext)((0, $b8c00169fae46ac7$export$39ae08fa83328b12));
127
+ let defaultRef = (0, $lbkGW$useRef)();
128
+ overlayRef = overlayRef || defaultRef;
129
+ props = (0, $lbkGW$mergeProps)(props, tooltipProviderProps);
130
+ let { variant: variant = "neutral" , placement: placement = "top" , isOpen: isOpen , showIcon: showIcon , ...otherProps } = props;
131
+ let { styleProps: styleProps } = (0, $lbkGW$useStyleProps)(otherProps);
132
+ let { tooltipProps: tooltipProps } = (0, $lbkGW$useTooltip)(props, state);
133
+ // Sync ref with overlayRef from context.
134
+ (0, $lbkGW$useImperativeHandle)(ref, ()=>(0, $lbkGW$createDOMRef)(overlayRef));
135
+ let Icon = $dc9e2a6f9971fb04$var$iconMap[variant];
136
+ return /*#__PURE__*/ (0, $lbkGW$react).createElement("div", {
137
+ ...styleProps,
138
+ ...tooltipProps,
139
+ className: (0, $lbkGW$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e9110aec8886b85$exports))), "spectrum-Tooltip", `spectrum-Tooltip--${variant}`, `spectrum-Tooltip--${placement}`, {
140
+ "is-open": isOpen
141
+ }, styleProps.className),
142
+ ref: overlayRef
143
+ }, showIcon && variant !== "neutral" && /*#__PURE__*/ (0, $lbkGW$react).createElement(Icon, {
144
+ UNSAFE_className: (0, $lbkGW$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e9110aec8886b85$exports))), "spectrum-Tooltip-typeIcon"),
145
+ "aria-hidden": true
146
+ }), props.children && /*#__PURE__*/ (0, $lbkGW$react).createElement("span", {
147
+ className: (0, $lbkGW$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e9110aec8886b85$exports))), "spectrum-Tooltip-label")
148
+ }, props.children), /*#__PURE__*/ (0, $lbkGW$react).createElement("span", {
149
+ ...arrowProps,
150
+ className: (0, $lbkGW$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($1e9110aec8886b85$exports))), "spectrum-Tooltip-tip")
151
+ }));
152
+ }
153
+ /**
154
+ * Display container for Tooltip content. Has a directional arrow dependent on its placement.
155
+ */ let $dc9e2a6f9971fb04$export$28c660c63b792dea = /*#__PURE__*/ (0, $lbkGW$react).forwardRef($dc9e2a6f9971fb04$var$Tooltip);
156
+
157
+
158
+ /*
159
+ * Copyright 2020 Adobe. All rights reserved.
160
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
161
+ * you may not use this file except in compliance with the License. You may obtain a copy
162
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
163
+ *
164
+ * Unless required by applicable law or agreed to in writing, software distributed under
165
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
166
+ * OF ANY KIND, either express or implied. See the License for the specific language
167
+ * governing permissions and limitations under the License.
168
+ */
169
+
170
+
171
+
172
+
173
+
174
+
175
+ const $019364e6919ef1db$var$DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button
176
+ const $019364e6919ef1db$var$DEFAULT_CROSS_OFFSET = 0;
177
+ function $019364e6919ef1db$var$TooltipTrigger(props) {
178
+ let { children: children , crossOffset: crossOffset = $019364e6919ef1db$var$DEFAULT_CROSS_OFFSET , isDisabled: isDisabled , offset: offset = $019364e6919ef1db$var$DEFAULT_OFFSET , trigger: triggerAction } = props;
179
+ let [trigger, tooltip] = (0, $lbkGW$react).Children.toArray(children);
180
+ let state = (0, $lbkGW$useTooltipTriggerState)(props);
181
+ let tooltipTriggerRef = (0, $lbkGW$useRef)();
182
+ let overlayRef = (0, $lbkGW$useRef)();
183
+ let { triggerProps: triggerProps , tooltipProps: tooltipProps } = (0, $lbkGW$useTooltipTrigger)({
184
+ isDisabled: isDisabled,
185
+ trigger: triggerAction
186
+ }, state, tooltipTriggerRef);
187
+ let { overlayProps: overlayProps , arrowProps: arrowProps , placement: placement } = (0, $lbkGW$useOverlayPosition)({
188
+ placement: props.placement || "top",
189
+ targetRef: tooltipTriggerRef,
190
+ overlayRef: overlayRef,
191
+ offset: offset,
192
+ crossOffset: crossOffset,
193
+ isOpen: state.isOpen,
194
+ shouldFlip: props.shouldFlip,
195
+ containerPadding: props.containerPadding
196
+ });
197
+ return /*#__PURE__*/ (0, $lbkGW$react).createElement((0, $lbkGW$FocusableProvider), {
198
+ ...triggerProps,
199
+ ref: tooltipTriggerRef
200
+ }, trigger, /*#__PURE__*/ (0, $lbkGW$react).createElement((0, $b8c00169fae46ac7$export$39ae08fa83328b12).Provider, {
201
+ value: {
202
+ state: state,
203
+ placement: placement,
204
+ ref: overlayRef,
205
+ UNSAFE_style: overlayProps.style,
206
+ arrowProps: arrowProps,
207
+ ...tooltipProps
208
+ }
209
+ }, /*#__PURE__*/ (0, $lbkGW$react).createElement((0, $lbkGW$Overlay), {
210
+ isOpen: state.isOpen,
211
+ nodeRef: overlayRef
212
+ }, tooltip)));
213
+ }
214
+ // Support TooltipTrigger inside components using CollectionBuilder.
215
+ $019364e6919ef1db$var$TooltipTrigger.getCollectionNode = function*(props) {
216
+ // Replaced the use of React.Childern.toArray because it mutates the key prop.
217
+ let childArray = [];
218
+ (0, $lbkGW$react).Children.forEach(props.children, (child)=>{
219
+ if (/*#__PURE__*/ (0, $lbkGW$react).isValidElement(child)) childArray.push(child);
220
+ });
221
+ let [trigger, tooltip] = childArray;
222
+ yield {
223
+ element: trigger,
224
+ wrapper: (element)=>/*#__PURE__*/ (0, $lbkGW$react).createElement($019364e6919ef1db$var$TooltipTrigger, {
225
+ key: element.key,
226
+ ...props
227
+ }, element, tooltip)
228
+ };
229
+ };
230
+ /**
231
+ * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing
232
+ * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip
233
+ * relative to the trigger.
234
+ */ // We don't want getCollectionNode to show up in the type definition
235
+ let $019364e6919ef1db$export$8c610744efcf8a1d = $019364e6919ef1db$var$TooltipTrigger;
236
+
237
+
238
+
239
+
240
+ export {$dc9e2a6f9971fb04$export$28c660c63b792dea as Tooltip, $019364e6919ef1db$export$8c610744efcf8a1d as TooltipTrigger};
241
+ //# sourceMappingURL=module.js.map
package/dist/main.css CHANGED
@@ -1 +1 @@
1
- .spectrum-Tooltip_22ae94{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Tooltip_22ae94.is-open_22ae94{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}.spectrum-Tooltip--bottom_22ae94.is-open_22ae94{transform:translateY(var(--spectrum-overlay-positive-transform-distance))}.spectrum-Tooltip--top_22ae94.is-open_22ae94{transform:translateY(var(--spectrum-overlay-negative-transform-distance))}.spectrum-Tooltip--right_22ae94.is-open_22ae94{transform:translateX(var(--spectrum-overlay-positive-transform-distance))}.spectrum-Tooltip--left_22ae94.is-open_22ae94{transform:translateX(var(--spectrum-overlay-negative-transform-distance))}.spectrum-Tooltip_22ae94{box-sizing:border-box;vertical-align:top;width:auto;padding:var(--spectrum-tooltip-padding-top,var(--spectrum-global-dimension-size-50))var(--spectrum-tooltip-padding-x,var(--spectrum-global-dimension-size-125));border-radius:var(--spectrum-alias-border-radius-regular,var(--spectrum-global-dimension-size-50));min-height:var(--spectrum-tooltip-min-height,var(--spectrum-global-dimension-size-300));font-size:var(--spectrum-tooltip-text-size,var(--spectrum-global-dimension-font-size-75));font-weight:var(--spectrum-tooltip-text-font-weight,var(--spectrum-global-font-weight-regular));line-height:var(--spectrum-tooltip-text-line-height,var(--spectrum-global-dimension-font-size-200));word-break:break-word;-webkit-font-smoothing:antialiased;cursor:default;-webkit-user-select:none;user-select:none;flex-direction:row;align-items:center;display:inline-flex;position:relative}.spectrum-Tooltip_22ae94 p{margin:0}.spectrum-Tooltip-tip_22ae94{height:0;width:0;border-width:var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50));border-style:solid;border-bottom-color:#0000;border-left-color:#0000;border-right-color:#0000;position:absolute}.spectrum-Tooltip--right_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--left_22ae94 .spectrum-Tooltip-tip_22ae94{margin-top:calc(var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50))*-1);top:50%}.spectrum-Tooltip--right_22ae94{margin-left:var(--spectrum-global-dimension-size-40)}.spectrum-Tooltip--right_22ae94 .spectrum-Tooltip-tip_22ae94{right:100%;transform:rotate(90deg)}.spectrum-Tooltip--left_22ae94{margin-right:var(--spectrum-global-dimension-size-40)}.spectrum-Tooltip--left_22ae94 .spectrum-Tooltip-tip_22ae94{left:100%;transform:rotate(-90deg)}.spectrum-Tooltip--top_22ae94{margin-bottom:var(--spectrum-global-dimension-size-40)}.spectrum-Tooltip--top_22ae94 .spectrum-Tooltip-tip_22ae94{top:100%}.spectrum-Tooltip--bottom_22ae94{margin-top:var(--spectrum-global-dimension-size-40)}.spectrum-Tooltip--bottom_22ae94 .spectrum-Tooltip-tip_22ae94{bottom:100%;transform:rotate(-180deg)}.spectrum-Tooltip--bottom_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--top_22ae94 .spectrum-Tooltip-tip_22ae94{margin-left:calc(var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50))*-1);left:50%}[dir=ltr] .spectrum-Tooltip-typeIcon_22ae94{margin-left:calc(var(--spectrum-tooltip-icon-margin-x,var(--spectrum-global-dimension-size-100)) - var(--spectrum-tooltip-padding-x,var(--spectrum-global-dimension-size-125)))}[dir=rtl] .spectrum-Tooltip-typeIcon_22ae94{margin-right:calc(var(--spectrum-tooltip-icon-margin-x,var(--spectrum-global-dimension-size-100)) - var(--spectrum-tooltip-padding-x,var(--spectrum-global-dimension-size-125)))}[dir=ltr] .spectrum-Tooltip-typeIcon_22ae94{margin-right:var(--spectrum-tooltip-icon-margin-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-Tooltip-typeIcon_22ae94{margin-left:var(--spectrum-tooltip-icon-margin-x,var(--spectrum-global-dimension-size-100))}.spectrum-Tooltip-typeIcon_22ae94{width:var(--spectrum-tooltip-icon-size,var(--spectrum-global-dimension-size-175));height:var(--spectrum-tooltip-icon-size,var(--spectrum-global-dimension-size-175));align-self:flex-start;margin-top:1px}.spectrum-Tooltip-label_22ae94{max-width:var(--spectrum-tooltip-content-max-width);line-height:var(--spectrum-tooltip-text-line-height,var(--spectrum-global-dimension-font-size-200))}.u-tooltip-showOnHover_22ae94{display:inline-block;position:relative}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip_22ae94{white-space:nowrap;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out;position:absolute;top:-100%;visibility:visible!important}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip-label_22ae94{max-width:none}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--right_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--left_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--right_22ae94 .spectrum-Tooltip-tip_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--left_22ae94 .spectrum-Tooltip-tip_22ae94{top:50%}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--right_22ae94{left:100%;transform:translateY(-50%)}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--left_22ae94{transform:translate(-100%,-50%)}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--bottom_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--top_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--bottom_22ae94 .spectrum-Tooltip-tip_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--top_22ae94 .spectrum-Tooltip-tip_22ae94{left:50%}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--bottom_22ae94{transform:translate(-50%,calc(var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50))*-1));top:100%}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--top_22ae94{transform:translate(-50%,var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50)))}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94{opacity:1}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--bottom_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--bottom_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--bottom_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--bottom_22ae94{transform:translate(-50%)}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--top_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--top_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--top_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--top_22ae94{transform:translate(-50%,calc(var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50))*-1))}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--left_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--left_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--left_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--left_22ae94{transform:translate(calc(-100% - var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50))),-50%)}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--right_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--right_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--right_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--right_22ae94{transform:translate(var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50)),-50%)}.spectrum-Tooltip_22ae94{--spectrum-tooltip-negative-background-color:var(--spectrum-negative-background-color-default);--spectrum-tooltip-positive-background-color:var(--spectrum-positive-background-color-default);--spectrum-tooltip-info-background-color:var(--spectrum-informative-background-color-default);background-color:var(--spectrum-tooltip-background-color,var(--spectrum-global-color-static-gray-700));color:var(--spectrum-tooltip-text-color,var(--spectrum-global-color-static-white));filter:var(--spectrum-tooltip-dropshadow);-webkit-filter:var(--spectrum-tooltip-dropshadow);will-change:filter}.spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-background-color,var(--spectrum-global-color-static-gray-700))}.spectrum-Tooltip--negative_22ae94,.spectrum-Tooltip--error_22ae94{background-color:var(--spectrum-tooltip-negative-background-color,var(--spectrum-global-color-static-red-700))}.spectrum-Tooltip--negative_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--error_22ae94 .spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-negative-background-color,var(--spectrum-global-color-static-red-700))}.spectrum-Tooltip--info_22ae94,.spectrum-Tooltip--help_22ae94{background-color:var(--spectrum-tooltip-info-background-color,var(--spectrum-global-color-static-blue-700))}.spectrum-Tooltip--info_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--help_22ae94 .spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-info-background-color,var(--spectrum-global-color-static-blue-700))}.spectrum-Tooltip--positive_22ae94,.spectrum-Tooltip--success_22ae94{background-color:var(--spectrum-tooltip-positive-background-color,var(--spectrum-global-color-static-green-700))}.spectrum-Tooltip--positive_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--success_22ae94 .spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-positive-background-color,var(--spectrum-global-color-static-green-700))}@media (forced-colors:active){.spectrum-Tooltip_22ae94{border:1px solid #0000}.spectrum-Tooltip-tip_22ae94{forced-color-adjust:none;--spectrum-tooltip-background-color:CanvasText;--spectrum-tooltip-negative-background-color:Highlight;--spectrum-tooltip-info-background-color:Highlight;--spectrum-tooltip-positive-background-color:Highlight}}
1
+ .spectrum-Tooltip_22ae94{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Tooltip_22ae94.is-open_22ae94{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}.spectrum-Tooltip--bottom_22ae94.is-open_22ae94{transform:translateY(var(--spectrum-overlay-positive-transform-distance))}.spectrum-Tooltip--top_22ae94.is-open_22ae94{transform:translateY(var(--spectrum-overlay-negative-transform-distance))}.spectrum-Tooltip--right_22ae94.is-open_22ae94{transform:translateX(var(--spectrum-overlay-positive-transform-distance))}.spectrum-Tooltip--left_22ae94.is-open_22ae94{transform:translateX(var(--spectrum-overlay-negative-transform-distance))}.spectrum-Tooltip_22ae94{box-sizing:border-box;vertical-align:top;width:auto;padding:var(--spectrum-tooltip-padding-top,var(--spectrum-global-dimension-size-50))var(--spectrum-tooltip-padding-x,var(--spectrum-global-dimension-size-125));border-radius:var(--spectrum-alias-border-radius-regular,var(--spectrum-global-dimension-size-50));min-height:var(--spectrum-tooltip-min-height,var(--spectrum-global-dimension-size-300));font-size:var(--spectrum-tooltip-text-size,var(--spectrum-global-dimension-font-size-75));font-weight:var(--spectrum-tooltip-text-font-weight,var(--spectrum-global-font-weight-regular));line-height:var(--spectrum-tooltip-text-line-height,var(--spectrum-global-dimension-font-size-200));word-break:break-word;-webkit-font-smoothing:antialiased;cursor:default;-webkit-user-select:none;user-select:none;flex-direction:row;align-items:center;display:inline-flex;position:relative}.spectrum-Tooltip_22ae94 p{margin:0}.spectrum-Tooltip-tip_22ae94{height:0;width:0;border-width:var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50));border-style:solid;border-bottom-color:#0000;border-left-color:#0000;border-right-color:#0000;position:absolute}.spectrum-Tooltip--right_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--left_22ae94 .spectrum-Tooltip-tip_22ae94{margin-top:calc(var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50))*-1);top:50%}.spectrum-Tooltip--right_22ae94{margin-left:var(--spectrum-global-dimension-size-40)}.spectrum-Tooltip--right_22ae94 .spectrum-Tooltip-tip_22ae94{right:100%;transform:rotate(90deg)}.spectrum-Tooltip--left_22ae94{margin-right:var(--spectrum-global-dimension-size-40)}.spectrum-Tooltip--left_22ae94 .spectrum-Tooltip-tip_22ae94{left:100%;transform:rotate(-90deg)}.spectrum-Tooltip--top_22ae94{margin-bottom:var(--spectrum-global-dimension-size-40)}.spectrum-Tooltip--top_22ae94 .spectrum-Tooltip-tip_22ae94{top:100%}.spectrum-Tooltip--bottom_22ae94{margin-top:var(--spectrum-global-dimension-size-40)}.spectrum-Tooltip--bottom_22ae94 .spectrum-Tooltip-tip_22ae94{bottom:100%;transform:rotate(-180deg)}.spectrum-Tooltip--bottom_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--top_22ae94 .spectrum-Tooltip-tip_22ae94{margin-left:calc(var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50))*-1);left:50%}[dir=ltr] .spectrum-Tooltip-typeIcon_22ae94{margin-left:calc(var(--spectrum-tooltip-icon-margin-x,var(--spectrum-global-dimension-size-100)) - var(--spectrum-tooltip-padding-x,var(--spectrum-global-dimension-size-125)))}[dir=rtl] .spectrum-Tooltip-typeIcon_22ae94{margin-right:calc(var(--spectrum-tooltip-icon-margin-x,var(--spectrum-global-dimension-size-100)) - var(--spectrum-tooltip-padding-x,var(--spectrum-global-dimension-size-125)))}[dir=ltr] .spectrum-Tooltip-typeIcon_22ae94{margin-right:var(--spectrum-tooltip-icon-margin-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-Tooltip-typeIcon_22ae94{margin-left:var(--spectrum-tooltip-icon-margin-x,var(--spectrum-global-dimension-size-100))}.spectrum-Tooltip-typeIcon_22ae94{width:var(--spectrum-tooltip-icon-size,var(--spectrum-global-dimension-size-175));height:var(--spectrum-tooltip-icon-size,var(--spectrum-global-dimension-size-175));align-self:flex-start;margin-top:1px}.spectrum-Tooltip-label_22ae94{max-width:var(--spectrum-tooltip-content-max-width);line-height:var(--spectrum-tooltip-text-line-height,var(--spectrum-global-dimension-font-size-200))}.u-tooltip-showOnHover_22ae94{display:inline-block;position:relative}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip_22ae94{white-space:nowrap;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out;position:absolute;top:-100%;visibility:visible!important}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip-label_22ae94{max-width:none}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--right_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--left_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--right_22ae94 .spectrum-Tooltip-tip_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--left_22ae94 .spectrum-Tooltip-tip_22ae94{top:50%}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--right_22ae94{left:100%;transform:translateY(-50%)}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--left_22ae94{transform:translate(-100%,-50%)}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--bottom_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--top_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--bottom_22ae94 .spectrum-Tooltip-tip_22ae94,.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--top_22ae94 .spectrum-Tooltip-tip_22ae94{left:50%}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--bottom_22ae94{transform:translate(-50%,calc(var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50))*-1));top:100%}.u-tooltip-showOnHover_22ae94 .spectrum-Tooltip--top_22ae94{transform:translate(-50%,var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50)))}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94{opacity:1}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--bottom_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--bottom_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--bottom_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--bottom_22ae94{transform:translate(-50%)}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--top_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--top_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--top_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--top_22ae94{transform:translate(-50%,calc(var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50))*-1))}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--left_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--left_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--left_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--left_22ae94{transform:translate(calc(-100% - var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50))),-50%)}.u-tooltip-showOnHover_22ae94.is-hovered_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--right_22ae94,.u-tooltip-showOnHover_22ae94:focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--right_22ae94,.u-tooltip-showOnHover_22ae94.is-focused_22ae94 .spectrum-Tooltip_22ae94.spectrum-Tooltip--right_22ae94,.u-tooltip-showOnHover_22ae94 :focus .spectrum-Tooltip_22ae94.spectrum-Tooltip--right_22ae94{transform:translate(var(--spectrum-tooltip-tip-margin,var(--spectrum-global-dimension-size-50)),-50%)}.spectrum-Tooltip_22ae94{--spectrum-tooltip-background-color:var(--spectrum-alias-neutral-background-color);--spectrum-tooltip-negative-background-color:var(--spectrum-negative-background-color-default);--spectrum-tooltip-positive-background-color:var(--spectrum-positive-background-color-default);--spectrum-tooltip-info-background-color:var(--spectrum-informative-background-color-default);background-color:var(--spectrum-tooltip-background-color,var(--spectrum-global-color-static-gray-700));color:var(--spectrum-tooltip-text-color,var(--spectrum-global-color-static-white));filter:var(--spectrum-tooltip-dropshadow);-webkit-filter:var(--spectrum-tooltip-dropshadow);will-change:filter}.spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-background-color,var(--spectrum-global-color-static-gray-700))}.spectrum-Tooltip--negative_22ae94,.spectrum-Tooltip--error_22ae94{background-color:var(--spectrum-tooltip-negative-background-color,var(--spectrum-global-color-static-red-700))}.spectrum-Tooltip--negative_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--error_22ae94 .spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-negative-background-color,var(--spectrum-global-color-static-red-700))}.spectrum-Tooltip--info_22ae94,.spectrum-Tooltip--help_22ae94{background-color:var(--spectrum-tooltip-info-background-color,var(--spectrum-global-color-static-blue-700))}.spectrum-Tooltip--info_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--help_22ae94 .spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-info-background-color,var(--spectrum-global-color-static-blue-700))}.spectrum-Tooltip--positive_22ae94,.spectrum-Tooltip--success_22ae94{background-color:var(--spectrum-tooltip-positive-background-color,var(--spectrum-global-color-static-green-700))}.spectrum-Tooltip--positive_22ae94 .spectrum-Tooltip-tip_22ae94,.spectrum-Tooltip--success_22ae94 .spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-positive-background-color,var(--spectrum-global-color-static-green-700))}@media (forced-colors:active){.spectrum-Tooltip_22ae94{border:1px solid #0000}.spectrum-Tooltip-tip_22ae94{forced-color-adjust:none;--spectrum-tooltip-background-color:CanvasText;--spectrum-tooltip-negative-background-color:Highlight;--spectrum-tooltip-info-background-color:Highlight;--spectrum-tooltip-positive-background-color:Highlight}}
package/dist/main.js CHANGED
@@ -210,7 +210,8 @@ function $19f06480c1c1a932$var$TooltipTrigger(props) {
210
210
  ...tooltipProps
211
211
  }
212
212
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($kAvU8$react))).createElement((0, $kAvU8$reactspectrumoverlays.Overlay), {
213
- isOpen: state.isOpen
213
+ isOpen: state.isOpen,
214
+ nodeRef: overlayRef
214
215
  }, tooltip)));
215
216
  }
216
217
  // Support TooltipTrigger inside components using CollectionBuilder.
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;ACZA,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;AAjBA,4CAAqC;AACrC,4CAA4B;AAC5B,4CAA6C;AAC7C,4CAA0C;AAC1C,4CAA4C;AAC5C,4CAA2C;AAC3C,2CAAyC;AACzC,4CAA8C;AAC9C,4CAA2C;AAC3C,4CAA0C;AAC1C,4CAA+B;AAC/B,4CAA+B;AAC/B,4CAA+C;AAC/C,4CAA4C;AAC5C,4CAA2C;AAC3C,4CAA2C;AAC3C,4CAA+C;AAC/C,4CAA8C;;;;ACjB9C;;;;;;;;;;CAUC,GAED;AAYO,MAAM,4CAAiB,CAAA,GAAA,sCAAK,AAAD,EAAE,aAAa,CAAsB,CAAC;;;;AFAxE,IAAI,gCAAU;IACZ,MAAM,CAAA,GAAA,yDAAS,AAAD;IACd,UAAU,CAAA,GAAA,yDAAY,GAAD;IACrB,UAAU,CAAA,GAAA,yDAAU,CAAD;AACrB;AAEA,SAAS,8BAAQ,KAA2B,EAAE,GAAW,EAAE;IACzD,IAAI,EAAC,KAAK,WAAU,cAAE,WAAU,SAAE,MAAK,EAAE,GAAG,sBAAqB,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,yCAAc,AAAD;IAC5F,IAAI,aAAa,CA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vB,WAAW,IAAI,CAAC;IAEpB;IACA,IAAI,CAAC,SAAS,QAAQ,GAAG;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, ...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 },\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} 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}\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, {ReactElement, useRef} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\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);\n\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 {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 });\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 ...tooltipProps\n }}>\n <Overlay isOpen={state.isOpen}>\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;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;ACZA,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;AAjBA,4CAAqC;AACrC,4CAA4B;AAC5B,4CAA6C;AAC7C,4CAA0C;AAC1C,4CAA4C;AAC5C,4CAA2C;AAC3C,2CAAyC;AACzC,4CAA8C;AAC9C,4CAA2C;AAC3C,4CAA0C;AAC1C,4CAA+B;AAC/B,4CAA+B;AAC/B,4CAA+C;AAC/C,4CAA4C;AAC5C,4CAA2C;AAC3C,4CAA2C;AAC3C,4CAA+C;AAC/C,4CAA8C;;;;ACjB9C;;;;;;;;;;CAUC,GAED;AAYO,MAAM,4CAAiB,CAAA,GAAA,sCAAK,AAAD,EAAE,aAAa,CAAsB,CAAC;;;;AFAxE,IAAI,gCAAU;IACZ,MAAM,CAAA,GAAA,yDAAS,AAAD;IACd,UAAU,CAAA,GAAA,yDAAY,GAAD;IACrB,UAAU,CAAA,GAAA,yDAAU,CAAD;AACrB;AAEA,SAAS,8BAAQ,KAA2B,EAAE,GAAW,EAAE;IACzD,IAAI,EAAC,KAAK,WAAU,cAAE,WAAU,SAAE,MAAK,EAAE,GAAG,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AAO,CAAC,MAAM,QAAQ,EAAE,CAAA,QAAS;QAC9C,kBAAI,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC,QACvB,WAAW,IAAI,CAAC;IAEpB;IACA,IAAI,CAAC,SAAS,QAAQ,GAAG;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, ...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 },\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} 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}\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, {ReactElement, useRef} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\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 {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 });\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 ...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"}
package/dist/module.js CHANGED
@@ -207,7 +207,8 @@ function $019364e6919ef1db$var$TooltipTrigger(props) {
207
207
  ...tooltipProps
208
208
  }
209
209
  }, /*#__PURE__*/ (0, $lbkGW$react).createElement((0, $lbkGW$Overlay), {
210
- isOpen: state.isOpen
210
+ isOpen: state.isOpen,
211
+ nodeRef: overlayRef
211
212
  }, tooltip)));
212
213
  }
213
214
  // Support TooltipTrigger inside components using CollectionBuilder.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;ACZA,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;AAjBA,4CAAqC;AACrC,4CAA4B;AAC5B,4CAA6C;AAC7C,4CAA0C;AAC1C,4CAA4C;AAC5C,4CAA2C;AAC3C,2CAAyC;AACzC,4CAA8C;AAC9C,4CAA2C;AAC3C,4CAA0C;AAC1C,4CAA+B;AAC/B,4CAA+B;AAC/B,4CAA+C;AAC/C,4CAA4C;AAC5C,4CAA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ChB,KAAK;OACJ,uBACD,gCAAC,CAAA,GAAA,yCAAa,EAAE,QAAQ;QACtB,OAAO;mBACL;uBACA;YACA,KAAK;YACL,cAAc,aAAa,KAAK;wBAChC;YACA,GAAG,YAAY;QACjB;qBACA,gCAAC,CAAA,GAAA,cAAM;QAAE,QAAQ,MAAM,MAAM;OAC1B;AAKX;AAEA,oEAAoE;AACpE,qCAAe,iBAAiB,GAAG,UAAW,KAAkC,EAAE;IAChF,8EAA8E;IAC9E,IAAI,aAA6B,EAAE;IACnC,CAAA,GAAA,YAAK,AAAD,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,CAAA,QAAS;QAC9C,kBAAI,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC,QACvB,WAAW,IAAI,CAAC;IAEpB;IACA,IAAI,CAAC,SAAS,QAAQ,GAAG;IACzB,MAAM;QACJ,SAAS;QACT,SAAS,CAAC,wBACR,gCAAC;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, ...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 },\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} 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}\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, {ReactElement, useRef} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\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);\n\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 {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 });\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 ...tooltipProps\n }}>\n <Overlay isOpen={state.isOpen}>\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":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;ACZA,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;AAjBA,4CAAqC;AACrC,4CAA4B;AAC5B,4CAA6C;AAC7C,4CAA0C;AAC1C,4CAA4C;AAC5C,4CAA2C;AAC3C,2CAAyC;AACzC,4CAA8C;AAC9C,4CAA2C;AAC3C,4CAA0C;AAC1C,4CAA+B;AAC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,gCAAC,CAAA,GAAA,wBAAiB,AAAD;QACd,GAAG,YAAY;QAChB,KAAK;OACJ,uBACD,gCAAC,CAAA,GAAA,yCAAa,EAAE,QAAQ;QACtB,OAAO;mBACL;uBACA;YACA,KAAK;YACL,cAAc,aAAa,KAAK;wBAChC;YACA,GAAG,YAAY;QACjB;qBACA,gCAAC,CAAA,GAAA,cAAM;QAAE,QAAQ,MAAM,MAAM;QAAE,SAAS;OACrC;AAKX;AAEA,oEAAoE;AACpE,qCAAe,iBAAiB,GAAG,UAAW,KAAkC,EAAE;IAChF,8EAA8E;IAC9E,IAAI,aAA6B,EAAE;IACnC,CAAA,GAAA,YAAK,AAAD,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,CAAA,QAAS;QAC9C,kBAAI,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC,QACvB,WAAW,IAAI,CAAC;IAEpB;IACA,IAAI,CAAC,SAAS,QAAQ,GAAG;IACzB,MAAM;QACJ,SAAS;QACT,SAAS,CAAC,wBACR,gCAAC;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, ...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 },\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} 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}\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, {ReactElement, useRef} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\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 {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 });\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 ...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":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;AC4EA;;GAEG;AACH,OAAA,IAAI,4IAAoC,CAAC;ACoBzC;;;;GAIG;AAEH,OAAA,IAAI,wBAA4C,2BAA2B,KAAK,WAAW,CAAC;ACzF5F,YAAY,EAAC,oBAAoB,EAAE,2BAA2B,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/context.ts","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/Tooltip.tsx","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/index.ts","packages/@react-spectrum/tooltip/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\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":"types.d.ts.map"}
1
+ {"mappings":";;AC4EA;;GAEG;AACH,OAAA,IAAI,4IAAoC,CAAC;ACmBzC;;;;GAIG;AAEH,OAAA,IAAI,wBAA4C,2BAA2B,KAAK,WAAW,CAAC;ACxF5F,YAAY,EAAC,oBAAoB,EAAE,2BAA2B,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/context.ts","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/Tooltip.tsx","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/index.ts","packages/@react-spectrum/tooltip/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\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":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-spectrum/tooltip",
3
- "version": "3.3.4",
3
+ "version": "3.4.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -31,19 +36,19 @@
31
36
  "url": "https://github.com/adobe/react-spectrum"
32
37
  },
33
38
  "dependencies": {
34
- "@react-aria/focus": "^3.10.1",
35
- "@react-aria/interactions": "^3.13.1",
36
- "@react-aria/overlays": "^3.12.1",
37
- "@react-aria/tooltip": "^3.3.4",
38
- "@react-aria/utils": "^3.14.2",
39
- "@react-spectrum/overlays": "^4.1.0",
40
- "@react-spectrum/utils": "^3.8.1",
41
- "@react-stately/tooltip": "^3.2.4",
42
- "@react-stately/utils": "^3.5.2",
43
- "@react-types/overlays": "^3.6.5",
44
- "@react-types/shared": "^3.16.0",
45
- "@react-types/tooltip": "^3.2.5",
46
- "@spectrum-icons/ui": "^3.4.1",
39
+ "@react-aria/focus": "^3.11.0",
40
+ "@react-aria/interactions": "^3.14.0",
41
+ "@react-aria/overlays": "^3.13.0",
42
+ "@react-aria/tooltip": "^3.4.0",
43
+ "@react-aria/utils": "^3.15.0",
44
+ "@react-spectrum/overlays": "^5.0.0",
45
+ "@react-spectrum/utils": "^3.9.0",
46
+ "@react-stately/tooltip": "^3.3.0",
47
+ "@react-stately/utils": "^3.6.0",
48
+ "@react-types/overlays": "^3.7.0",
49
+ "@react-types/shared": "^3.17.0",
50
+ "@react-types/tooltip": "^3.3.0",
51
+ "@spectrum-icons/ui": "^3.5.0",
47
52
  "@swc/helpers": "^0.4.14"
48
53
  },
49
54
  "devDependencies": {
@@ -57,5 +62,5 @@
57
62
  "publishConfig": {
58
63
  "access": "public"
59
64
  },
60
- "gitHead": "5480d76bd815e239366f92852c76b6831ad2a4fd"
65
+ "gitHead": "a0efee84aa178cb1a202951dfd6d8de02b292307"
61
66
  }
@@ -31,8 +31,7 @@ function TooltipTrigger(props: SpectrumTooltipTriggerProps) {
31
31
  trigger: triggerAction
32
32
  } = props;
33
33
 
34
- let [trigger, tooltip] = React.Children.toArray(children);
35
-
34
+ let [trigger, tooltip] = React.Children.toArray(children) as [ReactElement, ReactElement];
36
35
  let state = useTooltipTriggerState(props);
37
36
 
38
37
  let tooltipTriggerRef = useRef<HTMLElement>();
@@ -68,7 +67,7 @@ function TooltipTrigger(props: SpectrumTooltipTriggerProps) {
68
67
  arrowProps,
69
68
  ...tooltipProps
70
69
  }}>
71
- <Overlay isOpen={state.isOpen}>
70
+ <Overlay isOpen={state.isOpen} nodeRef={overlayRef}>
72
71
  {tooltip}
73
72
  </Overlay>
74
73
  </TooltipContext.Provider>