@react-spectrum/tooltip 3.0.0-nightly.1383 → 3.0.0-nightly.1395
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.css +1 -1
- package/dist/main.js +123 -123
- package/dist/main.js.map +1 -1
- package/dist/module.js +122 -122
- package/dist/module.js.map +1 -1
- package/package.json +16 -16
package/dist/main.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
._spectrum-Tooltip_22ae94{opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}._spectrum-Tooltip_22ae94._is-open_22ae94{opacity:.9999;pointer-events:auto;transition-delay:0ms;visibility:visible}._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{-ms-flex-align:center;-webkit-font-smoothing:antialiased;align-items:center;border-radius:var(--spectrum-tooltip-border-radius,var(--spectrum-global-dimension-size-50));box-sizing:border-box;cursor:default;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;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));min-height:var(--spectrum-tooltip-min-height,var(--spectrum-global-dimension-size-300));padding:var(--spectrum-tooltip-padding-top,var(--spectrum-global-dimension-size-50)) var(--spectrum-tooltip-padding-x,var(--spectrum-global-dimension-size-125));position:relative;-webkit-user-select:none;-ms-user-select:none;user-select:none;vertical-align:top;width:auto;word-break:break-word}._spectrum-Tooltip_22ae94 p{margin:0}._spectrum-Tooltip-tip_22ae94{border-bottom:var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50)) solid transparent;border-left:var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50)) solid transparent;border-right:var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50)) solid transparent;border-top-style:solid;border-top-width:var(--spectrum-tooltip-tip-height,var(--spectrum-global-dimension-size-50));height:0;position:absolute;width:0}._spectrum-Tooltip--left_22ae94 ._spectrum-Tooltip-tip_22ae94,._spectrum-Tooltip--right_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{left:50%;margin-left:calc(var(--spectrum-tooltip-tip-height, var(--spectrum-global-dimension-size-50)) * -1)}[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{-ms-flex-item-align:start;align-self:flex-start;height:var(--spectrum-tooltip-icon-size,var(--spectrum-global-dimension-size-175));margin-top:1px;width:var(--spectrum-tooltip-icon-size,var(--spectrum-global-dimension-size-175))}._spectrum-Tooltip-label_22ae94{line-height:var(--spectrum-tooltip-text-line-height,var(--spectrum-global-dimension-font-size-200));max-width:var(--spectrum-tooltip-content-max-width)}._u-tooltip-showOnHover_22ae94{display:inline-block;position:relative}._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip_22ae94{position:absolute;top:-100%;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out;visibility:visible!important;white-space:nowrap}._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip-label_22ae94{max-width:none}._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip--left_22ae94,._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip--left_22ae94 ._spectrum-Tooltip-tip_22ae94,._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip--right_22ae94,._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip--right_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--bottom_22ae94 ._spectrum-Tooltip-tip_22ae94,._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip--top_22ae94,._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip--top_22ae94 ._spectrum-Tooltip-tip_22ae94{left:50%}._u-tooltip-showOnHover_22ae94 ._spectrum-Tooltip--bottom_22ae94{top:100%;transform:translate(-50%,calc(var(--spectrum-tooltip-tip-margin, var(--spectrum-global-dimension-size-50)) * -1))}._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 :focus ._spectrum-Tooltip_22ae94,._u-tooltip-showOnHover_22ae94._is-focused_22ae94 ._spectrum-Tooltip_22ae94,._u-tooltip-showOnHover_22ae94._is-hovered_22ae94 ._spectrum-Tooltip_22ae94,._u-tooltip-showOnHover_22ae94:focus ._spectrum-Tooltip_22ae94{opacity:1}._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._is-hovered_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 :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._is-hovered_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 :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._is-hovered_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 :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._is-hovered_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{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))}._spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-background-color,var(--spectrum-global-color-static-gray-700))}._spectrum-Tooltip--error_22ae94,._spectrum-Tooltip--negative_22ae94{background-color:var(--spectrum-tooltip-negative-background-color,var(--spectrum-global-color-static-red-700))}._spectrum-Tooltip--error_22ae94 ._spectrum-Tooltip-tip_22ae94,._spectrum-Tooltip--negative_22ae94 ._spectrum-Tooltip-tip_22ae94{border-top-color:var(--spectrum-tooltip-negative-background-color,var(--spectrum-global-color-static-red-700))}._spectrum-Tooltip--help_22ae94,._spectrum-Tooltip--info_22ae94{background-color:var(--spectrum-tooltip-info-background-color,var(--spectrum-global-color-static-blue-700))}._spectrum-Tooltip--help_22ae94 ._spectrum-Tooltip-tip_22ae94,._spectrum-Tooltip--info_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 transparent}._spectrum-Tooltip-tip_22ae94{--spectrum-tooltip-background-color:CanvasText;--spectrum-tooltip-negative-background-color:Highlight;--spectrum-tooltip-info-background-color:Highlight;--spectrum-tooltip-positive-background-color:Highlight;forced-color-adjust:none}}
|
1
|
+
.spectrum-Tooltip_22ae94{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,130ms)ease-in-out,opacity var(--spectrum-global-animation-duration-100,130ms)ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,130ms);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-tooltip-border-radius,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,130ms)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{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))}.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
@@ -1,15 +1,15 @@
|
|
1
1
|
require("./main.css");
|
2
|
-
var $
|
3
|
-
var $
|
4
|
-
var $
|
5
|
-
var $
|
6
|
-
var $
|
7
|
-
var $
|
8
|
-
var $
|
9
|
-
var $
|
10
|
-
var $
|
11
|
-
var $
|
12
|
-
var $
|
2
|
+
var $6afbW$spectrumiconsuiAlertSmall = require("@spectrum-icons/ui/AlertSmall");
|
3
|
+
var $6afbW$reactspectrumutils = require("@react-spectrum/utils");
|
4
|
+
var $6afbW$spectrumiconsuiInfoSmall = require("@spectrum-icons/ui/InfoSmall");
|
5
|
+
var $6afbW$reactariautils = require("@react-aria/utils");
|
6
|
+
var $6afbW$react = require("react");
|
7
|
+
var $6afbW$spectrumiconsuiSuccessSmall = require("@spectrum-icons/ui/SuccessSmall");
|
8
|
+
var $6afbW$reactariatooltip = require("@react-aria/tooltip");
|
9
|
+
var $6afbW$reactariafocus = require("@react-aria/focus");
|
10
|
+
var $6afbW$reactspectrumoverlays = require("@react-spectrum/overlays");
|
11
|
+
var $6afbW$reactariaoverlays = require("@react-aria/overlays");
|
12
|
+
var $6afbW$reactstatelytooltip = require("@react-stately/tooltip");
|
13
13
|
|
14
14
|
function $parcel$exportWildcard(dest, source) {
|
15
15
|
Object.keys(source).forEach(function(key) {
|
@@ -33,121 +33,121 @@ function $parcel$interopDefault(a) {
|
|
33
33
|
function $parcel$export(e, n, v, s) {
|
34
34
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
35
35
|
}
|
36
|
-
var $
|
37
|
-
|
38
|
-
$parcel$export($
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
var $
|
45
|
-
|
46
|
-
$parcel$export($
|
47
|
-
$parcel$export($
|
48
|
-
$parcel$export($
|
49
|
-
$parcel$export($
|
50
|
-
$parcel$export($
|
51
|
-
$parcel$export($
|
52
|
-
$parcel$export($
|
53
|
-
$parcel$export($
|
54
|
-
$parcel$export($
|
55
|
-
$parcel$export($
|
56
|
-
$parcel$export($
|
57
|
-
$parcel$export($
|
58
|
-
$parcel$export($
|
59
|
-
$parcel$export($
|
60
|
-
$parcel$export($
|
61
|
-
$parcel$export($
|
62
|
-
$parcel$export($
|
63
|
-
$parcel$export($
|
64
|
-
var $
|
65
|
-
var $
|
66
|
-
var $
|
67
|
-
var $
|
68
|
-
var $
|
69
|
-
var $
|
70
|
-
var $
|
71
|
-
var $
|
72
|
-
var $
|
73
|
-
var $
|
74
|
-
var $
|
75
|
-
var $
|
76
|
-
var $
|
77
|
-
var $
|
78
|
-
var $
|
79
|
-
var $
|
80
|
-
var $
|
81
|
-
var $
|
82
|
-
$
|
83
|
-
$
|
84
|
-
$
|
85
|
-
$
|
86
|
-
$
|
87
|
-
$
|
88
|
-
$
|
89
|
-
$
|
90
|
-
$
|
91
|
-
$
|
92
|
-
$
|
93
|
-
$
|
94
|
-
$
|
95
|
-
$
|
96
|
-
$
|
97
|
-
$
|
98
|
-
$
|
99
|
-
$
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
const $
|
36
|
+
var $7f53ab52b1a88f0c$exports = {};
|
37
|
+
|
38
|
+
$parcel$export($7f53ab52b1a88f0c$exports, "Tooltip", () => $7f53ab52b1a88f0c$export$28c660c63b792dea);
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
var $6cae2acb3fea7740$exports = {};
|
45
|
+
|
46
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip", () => $6cae2acb3fea7740$export$f7bf7078d3d03f05, (v) => $6cae2acb3fea7740$export$f7bf7078d3d03f05 = v);
|
47
|
+
$parcel$export($6cae2acb3fea7740$exports, "is-open", () => $6cae2acb3fea7740$export$a9781837241c946d, (v) => $6cae2acb3fea7740$export$a9781837241c946d = v);
|
48
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--bottom", () => $6cae2acb3fea7740$export$4f420a9bbb442953, (v) => $6cae2acb3fea7740$export$4f420a9bbb442953 = v);
|
49
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--top", () => $6cae2acb3fea7740$export$d7516df59e198fc7, (v) => $6cae2acb3fea7740$export$d7516df59e198fc7 = v);
|
50
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--right", () => $6cae2acb3fea7740$export$c094187772823b2e, (v) => $6cae2acb3fea7740$export$c094187772823b2e = v);
|
51
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--left", () => $6cae2acb3fea7740$export$47f060b68b4cab2c, (v) => $6cae2acb3fea7740$export$47f060b68b4cab2c = v);
|
52
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip-tip", () => $6cae2acb3fea7740$export$9deb89a7a91de30, (v) => $6cae2acb3fea7740$export$9deb89a7a91de30 = v);
|
53
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip-typeIcon", () => $6cae2acb3fea7740$export$ff23d46fee8272e4, (v) => $6cae2acb3fea7740$export$ff23d46fee8272e4 = v);
|
54
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip-label", () => $6cae2acb3fea7740$export$f4096e0dc445b255, (v) => $6cae2acb3fea7740$export$f4096e0dc445b255 = v);
|
55
|
+
$parcel$export($6cae2acb3fea7740$exports, "u-tooltip-showOnHover", () => $6cae2acb3fea7740$export$6ea3237f62800d00, (v) => $6cae2acb3fea7740$export$6ea3237f62800d00 = v);
|
56
|
+
$parcel$export($6cae2acb3fea7740$exports, "is-hovered", () => $6cae2acb3fea7740$export$b8813cd5d7824ce7, (v) => $6cae2acb3fea7740$export$b8813cd5d7824ce7 = v);
|
57
|
+
$parcel$export($6cae2acb3fea7740$exports, "is-focused", () => $6cae2acb3fea7740$export$e7dc768d35940237, (v) => $6cae2acb3fea7740$export$e7dc768d35940237 = v);
|
58
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--negative", () => $6cae2acb3fea7740$export$92fe45b4260594f6, (v) => $6cae2acb3fea7740$export$92fe45b4260594f6 = v);
|
59
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--error", () => $6cae2acb3fea7740$export$2b291890a5577893, (v) => $6cae2acb3fea7740$export$2b291890a5577893 = v);
|
60
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--info", () => $6cae2acb3fea7740$export$e995d5780591d0a8, (v) => $6cae2acb3fea7740$export$e995d5780591d0a8 = v);
|
61
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--help", () => $6cae2acb3fea7740$export$d33ca445ae528241, (v) => $6cae2acb3fea7740$export$d33ca445ae528241 = v);
|
62
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--positive", () => $6cae2acb3fea7740$export$11cbf31e1b6e51ac, (v) => $6cae2acb3fea7740$export$11cbf31e1b6e51ac = v);
|
63
|
+
$parcel$export($6cae2acb3fea7740$exports, "spectrum-Tooltip--success", () => $6cae2acb3fea7740$export$4eae622bc9b08cac, (v) => $6cae2acb3fea7740$export$4eae622bc9b08cac = v);
|
64
|
+
var $6cae2acb3fea7740$export$f7bf7078d3d03f05;
|
65
|
+
var $6cae2acb3fea7740$export$a9781837241c946d;
|
66
|
+
var $6cae2acb3fea7740$export$4f420a9bbb442953;
|
67
|
+
var $6cae2acb3fea7740$export$d7516df59e198fc7;
|
68
|
+
var $6cae2acb3fea7740$export$c094187772823b2e;
|
69
|
+
var $6cae2acb3fea7740$export$47f060b68b4cab2c;
|
70
|
+
var $6cae2acb3fea7740$export$9deb89a7a91de30;
|
71
|
+
var $6cae2acb3fea7740$export$ff23d46fee8272e4;
|
72
|
+
var $6cae2acb3fea7740$export$f4096e0dc445b255;
|
73
|
+
var $6cae2acb3fea7740$export$6ea3237f62800d00;
|
74
|
+
var $6cae2acb3fea7740$export$b8813cd5d7824ce7;
|
75
|
+
var $6cae2acb3fea7740$export$e7dc768d35940237;
|
76
|
+
var $6cae2acb3fea7740$export$92fe45b4260594f6;
|
77
|
+
var $6cae2acb3fea7740$export$2b291890a5577893;
|
78
|
+
var $6cae2acb3fea7740$export$e995d5780591d0a8;
|
79
|
+
var $6cae2acb3fea7740$export$d33ca445ae528241;
|
80
|
+
var $6cae2acb3fea7740$export$11cbf31e1b6e51ac;
|
81
|
+
var $6cae2acb3fea7740$export$4eae622bc9b08cac;
|
82
|
+
$6cae2acb3fea7740$export$f7bf7078d3d03f05 = "spectrum-Tooltip_22ae94";
|
83
|
+
$6cae2acb3fea7740$export$a9781837241c946d = "is-open_22ae94";
|
84
|
+
$6cae2acb3fea7740$export$4f420a9bbb442953 = "spectrum-Tooltip--bottom_22ae94";
|
85
|
+
$6cae2acb3fea7740$export$d7516df59e198fc7 = "spectrum-Tooltip--top_22ae94";
|
86
|
+
$6cae2acb3fea7740$export$c094187772823b2e = "spectrum-Tooltip--right_22ae94";
|
87
|
+
$6cae2acb3fea7740$export$47f060b68b4cab2c = "spectrum-Tooltip--left_22ae94";
|
88
|
+
$6cae2acb3fea7740$export$9deb89a7a91de30 = "spectrum-Tooltip-tip_22ae94";
|
89
|
+
$6cae2acb3fea7740$export$ff23d46fee8272e4 = "spectrum-Tooltip-typeIcon_22ae94";
|
90
|
+
$6cae2acb3fea7740$export$f4096e0dc445b255 = "spectrum-Tooltip-label_22ae94";
|
91
|
+
$6cae2acb3fea7740$export$6ea3237f62800d00 = "u-tooltip-showOnHover_22ae94";
|
92
|
+
$6cae2acb3fea7740$export$b8813cd5d7824ce7 = "is-hovered_22ae94";
|
93
|
+
$6cae2acb3fea7740$export$e7dc768d35940237 = "is-focused_22ae94";
|
94
|
+
$6cae2acb3fea7740$export$92fe45b4260594f6 = "spectrum-Tooltip--negative_22ae94";
|
95
|
+
$6cae2acb3fea7740$export$2b291890a5577893 = "spectrum-Tooltip--error_22ae94";
|
96
|
+
$6cae2acb3fea7740$export$e995d5780591d0a8 = "spectrum-Tooltip--info_22ae94";
|
97
|
+
$6cae2acb3fea7740$export$d33ca445ae528241 = "spectrum-Tooltip--help_22ae94";
|
98
|
+
$6cae2acb3fea7740$export$11cbf31e1b6e51ac = "spectrum-Tooltip--positive_22ae94";
|
99
|
+
$6cae2acb3fea7740$export$4eae622bc9b08cac = "spectrum-Tooltip--success_22ae94";
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
const $4d4881daa91c71ef$export$39ae08fa83328b12 = ($parcel$interopDefault($6afbW$react)).createContext({
|
105
105
|
});
|
106
106
|
|
107
107
|
|
108
108
|
|
109
|
-
let $
|
110
|
-
info: ($parcel$interopDefault($
|
111
|
-
positive: ($parcel$interopDefault($
|
112
|
-
negative: ($parcel$interopDefault($
|
109
|
+
let $7f53ab52b1a88f0c$var$iconMap = {
|
110
|
+
info: ($parcel$interopDefault($6afbW$spectrumiconsuiInfoSmall)),
|
111
|
+
positive: ($parcel$interopDefault($6afbW$spectrumiconsuiSuccessSmall)),
|
112
|
+
negative: ($parcel$interopDefault($6afbW$spectrumiconsuiAlertSmall))
|
113
113
|
};
|
114
|
-
function $
|
115
|
-
let { ref: overlayRef , arrowProps: arrowProps , state: state , ...tooltipProviderProps } = $
|
116
|
-
let defaultRef = $
|
114
|
+
function $7f53ab52b1a88f0c$var$Tooltip(props, ref) {
|
115
|
+
let { ref: overlayRef , arrowProps: arrowProps , state: state , ...tooltipProviderProps } = $6afbW$react.useContext($4d4881daa91c71ef$export$39ae08fa83328b12);
|
116
|
+
let defaultRef = $6afbW$react.useRef();
|
117
117
|
overlayRef = overlayRef || defaultRef;
|
118
|
-
props = $
|
118
|
+
props = $6afbW$reactariautils.mergeProps(props, tooltipProviderProps);
|
119
119
|
let { variant: variant = 'neutral' , placement: placement = 'top' , isOpen: isOpen , showIcon: showIcon , ...otherProps } = props;
|
120
|
-
let { styleProps: styleProps } = $
|
121
|
-
let { tooltipProps: tooltipProps } = $
|
120
|
+
let { styleProps: styleProps } = $6afbW$reactspectrumutils.useStyleProps(otherProps);
|
121
|
+
let { tooltipProps: tooltipProps } = $6afbW$reactariatooltip.useTooltip(props, state);
|
122
122
|
// Sync ref with overlayRef from context.
|
123
|
-
$
|
123
|
+
$6afbW$react.useImperativeHandle(ref, ()=>$6afbW$reactspectrumutils.createDOMRef(overlayRef)
|
124
124
|
);
|
125
|
-
let Icon = $
|
126
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
125
|
+
let Icon = $7f53ab52b1a88f0c$var$iconMap[variant];
|
126
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).createElement("div", {
|
127
127
|
...styleProps,
|
128
128
|
...tooltipProps,
|
129
|
-
className: $
|
129
|
+
className: $6afbW$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($6cae2acb3fea7740$exports)), 'spectrum-Tooltip', `spectrum-Tooltip--${variant}`, `spectrum-Tooltip--${placement}`, {
|
130
130
|
'is-open': isOpen
|
131
131
|
}, styleProps.className),
|
132
132
|
ref: overlayRef
|
133
|
-
}, showIcon && variant !== 'neutral' && /*#__PURE__*/ ($parcel$interopDefault($
|
134
|
-
UNSAFE_className: $
|
133
|
+
}, showIcon && variant !== 'neutral' && /*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).createElement(Icon, {
|
134
|
+
UNSAFE_className: $6afbW$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($6cae2acb3fea7740$exports)), 'spectrum-Tooltip-typeIcon'),
|
135
135
|
"aria-hidden": true
|
136
|
-
}), props.children && /*#__PURE__*/ ($parcel$interopDefault($
|
137
|
-
className: $
|
138
|
-
}, props.children), /*#__PURE__*/ ($parcel$interopDefault($
|
136
|
+
}), props.children && /*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).createElement("span", {
|
137
|
+
className: $6afbW$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($6cae2acb3fea7740$exports)), 'spectrum-Tooltip-label')
|
138
|
+
}, props.children), /*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).createElement("span", {
|
139
139
|
...arrowProps,
|
140
|
-
className: $
|
140
|
+
className: $6afbW$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($6cae2acb3fea7740$exports)), 'spectrum-Tooltip-tip')
|
141
141
|
})));
|
142
142
|
}
|
143
143
|
/**
|
144
144
|
* Display container for Tooltip content. Has a directional arrow dependent on its placement.
|
145
|
-
*/ let $
|
145
|
+
*/ let $7f53ab52b1a88f0c$export$28c660c63b792dea = /*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).forwardRef($7f53ab52b1a88f0c$var$Tooltip);
|
146
146
|
|
147
147
|
|
148
|
-
var $
|
148
|
+
var $6ebffad3b1800206$exports = {};
|
149
149
|
|
150
|
-
$parcel$export($
|
150
|
+
$parcel$export($6ebffad3b1800206$exports, "TooltipTrigger", () => $6ebffad3b1800206$export$8c610744efcf8a1d);
|
151
151
|
|
152
152
|
|
153
153
|
|
@@ -155,19 +155,19 @@ $parcel$export($663806caa3ebe13a$exports, "TooltipTrigger", () => $663806caa3ebe
|
|
155
155
|
|
156
156
|
|
157
157
|
|
158
|
-
const $
|
159
|
-
const $
|
160
|
-
function $
|
161
|
-
let { children: children , crossOffset: crossOffset = $
|
162
|
-
let [trigger, tooltip] = ($parcel$interopDefault($
|
163
|
-
let state = $
|
164
|
-
let tooltipTriggerRef = $
|
165
|
-
let overlayRef = $
|
166
|
-
let { triggerProps: triggerProps , tooltipProps: tooltipProps } = $
|
158
|
+
const $6ebffad3b1800206$var$DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button
|
159
|
+
const $6ebffad3b1800206$var$DEFAULT_CROSS_OFFSET = 0;
|
160
|
+
function $6ebffad3b1800206$var$TooltipTrigger(props) {
|
161
|
+
let { children: children , crossOffset: crossOffset = $6ebffad3b1800206$var$DEFAULT_CROSS_OFFSET , isDisabled: isDisabled , offset: offset = $6ebffad3b1800206$var$DEFAULT_OFFSET , trigger: triggerAction } = props;
|
162
|
+
let [trigger, tooltip] = ($parcel$interopDefault($6afbW$react)).Children.toArray(children);
|
163
|
+
let state = $6afbW$reactstatelytooltip.useTooltipTriggerState(props);
|
164
|
+
let tooltipTriggerRef = $6afbW$react.useRef();
|
165
|
+
let overlayRef = $6afbW$react.useRef();
|
166
|
+
let { triggerProps: triggerProps , tooltipProps: tooltipProps } = $6afbW$reactariatooltip.useTooltipTrigger({
|
167
167
|
isDisabled: isDisabled,
|
168
168
|
trigger: triggerAction
|
169
169
|
}, state, tooltipTriggerRef);
|
170
|
-
let { overlayProps: overlayProps , arrowProps: arrowProps , placement: placement } = $
|
170
|
+
let { overlayProps: overlayProps , arrowProps: arrowProps , placement: placement } = $6afbW$reactariaoverlays.useOverlayPosition({
|
171
171
|
placement: props.placement || 'top',
|
172
172
|
targetRef: tooltipTriggerRef,
|
173
173
|
overlayRef: overlayRef,
|
@@ -175,10 +175,10 @@ function $663806caa3ebe13a$var$TooltipTrigger(props) {
|
|
175
175
|
crossOffset: crossOffset,
|
176
176
|
isOpen: state.isOpen
|
177
177
|
});
|
178
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
178
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).createElement($6afbW$reactariafocus.FocusableProvider, {
|
179
179
|
...triggerProps,
|
180
180
|
ref: tooltipTriggerRef
|
181
|
-
}, trigger, /*#__PURE__*/ ($parcel$interopDefault($
|
181
|
+
}, trigger, /*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).createElement($4d4881daa91c71ef$export$39ae08fa83328b12.Provider, {
|
182
182
|
value: {
|
183
183
|
state: state,
|
184
184
|
placement: placement,
|
@@ -187,21 +187,21 @@ function $663806caa3ebe13a$var$TooltipTrigger(props) {
|
|
187
187
|
arrowProps: arrowProps,
|
188
188
|
...tooltipProps
|
189
189
|
}
|
190
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
190
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).createElement($6afbW$reactspectrumoverlays.Overlay, {
|
191
191
|
isOpen: state.isOpen
|
192
192
|
}, tooltip))));
|
193
193
|
}
|
194
194
|
// Support TooltipTrigger inside components using CollectionBuilder.
|
195
|
-
$
|
195
|
+
$6ebffad3b1800206$var$TooltipTrigger.getCollectionNode = function*(props) {
|
196
196
|
// Replaced the use of React.Childern.toArray because it mutates the key prop.
|
197
197
|
let childArray = [];
|
198
|
-
($parcel$interopDefault($
|
199
|
-
if (/*#__PURE__*/ ($parcel$interopDefault($
|
198
|
+
($parcel$interopDefault($6afbW$react)).Children.forEach(props.children, (child)=>{
|
199
|
+
if (/*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).isValidElement(child)) childArray.push(child);
|
200
200
|
});
|
201
201
|
let [trigger, tooltip] = childArray;
|
202
202
|
yield {
|
203
203
|
element: trigger,
|
204
|
-
wrapper: (element)=>/*#__PURE__*/ ($parcel$interopDefault($
|
204
|
+
wrapper: (element)=>/*#__PURE__*/ ($parcel$interopDefault($6afbW$react)).createElement($6ebffad3b1800206$var$TooltipTrigger, {
|
205
205
|
key: element.key,
|
206
206
|
...props
|
207
207
|
}, element, tooltip)
|
@@ -212,11 +212,11 @@ $663806caa3ebe13a$var$TooltipTrigger.getCollectionNode = function*(props) {
|
|
212
212
|
* the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip
|
213
213
|
* relative to the trigger.
|
214
214
|
*/ // We don't want getCollectionNode to show up in the type definition
|
215
|
-
let $
|
215
|
+
let $6ebffad3b1800206$export$8c610744efcf8a1d = $6ebffad3b1800206$var$TooltipTrigger;
|
216
216
|
|
217
217
|
|
218
|
-
$parcel$exportWildcard(module.exports, $
|
219
|
-
$parcel$exportWildcard(module.exports, $
|
218
|
+
$parcel$exportWildcard(module.exports, $7f53ab52b1a88f0c$exports);
|
219
|
+
$parcel$exportWildcard(module.exports, $6ebffad3b1800206$exports);
|
220
220
|
|
221
221
|
|
222
222
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAkC;AAClC,GAAyB;AACzB,GAA0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EAAG,KAAkC,EAAE,CAAC;IACjF,EAA8E,AAA9E,4EAA8E;IAC9E,GAAG,CAAC,UAAU,GAAmB,CAAC,CAAC;IACnC,sCAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAE,KAAK,GAAI,CAAC;QAC/C,EAAE,gBAAE,sCAAK,CAAC,cAAc,CAAC,KAAK,GAC5B,UAAU,CAAC,IAAI,CAAC,KAAK;IAEzB,CAAC;IACD,GAAG,EAAE,OAAO,EAAE,OAAO,IAAI,UAAU;UAC7B,CAAC;QACL,OAAO,EAAE,OAAO;QAChB,OAAO,GAAG,OAAO,sEACd,oCAAc;gBAAC,GAAG,EAAE,OAAO,CAAC,GAAG;mBAAM,KAAK;eACxC,OAAO,EACP,OAAO;IAGd,CAAC;AACH,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAe,GAAG,oCAAc;;","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 * from './Tooltip';\nexport * from './TooltipTrigger';\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 });\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAkC;AAClC,GAAyB;AACzB,GAA0C;AAC1C,GAAuC;AACvC,GAAyC;AACzC,GAAwC;AACxC,GAAsC;AACtC,GAA2C;AAC3C,GAAwC;AACxC,GAAuC;AACvC,GAA4B;AAC5B,GAA4B;AAC5B,GAA4C;AAC5C,GAAyC;AACzC,GAAwC;AACxC,GAAwC;AACxC,GAA4C;AAC5C,GAA2C;AAjB3C,yCAAkC,GAAG,CAAyB;AAC9D,yCAAyB,GAAG,CAAgB;AAC5C,yCAA0C,GAAG,CAAiC;AAC9E,yCAAuC,GAAG,CAA8B;AACxE,yCAAyC,GAAG,CAAgC;AAC5E,yCAAwC,GAAG,CAA+B;AAC1E,wCAAsC,GAAG,CAA6B;AACtE,yCAA2C,GAAG,CAAkC;AAChF,yCAAwC,GAAG,CAA+B;AAC1E,yCAAuC,GAAG,CAA8B;AACxE,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA4C,GAAG,CAAmC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GAAG,CAAC,yCAAe,GAAG,oCAAc;;","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 * from './Tooltip';\nexport * from './TooltipTrigger';\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 });\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"}
|
package/dist/module.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import "./main.css";
|
2
|
-
import $
|
3
|
-
import {useStyleProps as $
|
4
|
-
import $
|
5
|
-
import {mergeProps as $
|
6
|
-
import $
|
7
|
-
import $
|
8
|
-
import {useTooltip as $
|
9
|
-
import {FocusableProvider as $
|
10
|
-
import {Overlay as $
|
11
|
-
import {useOverlayPosition as $
|
12
|
-
import {useTooltipTriggerState as $
|
2
|
+
import $GsYXh$spectrumiconsuiAlertSmall from "@spectrum-icons/ui/AlertSmall";
|
3
|
+
import {useStyleProps as $GsYXh$useStyleProps, createDOMRef as $GsYXh$createDOMRef, classNames as $GsYXh$classNames} from "@react-spectrum/utils";
|
4
|
+
import $GsYXh$spectrumiconsuiInfoSmall from "@spectrum-icons/ui/InfoSmall";
|
5
|
+
import {mergeProps as $GsYXh$mergeProps} from "@react-aria/utils";
|
6
|
+
import $GsYXh$react, {useContext as $GsYXh$useContext, useRef as $GsYXh$useRef, useImperativeHandle as $GsYXh$useImperativeHandle} from "react";
|
7
|
+
import $GsYXh$spectrumiconsuiSuccessSmall from "@spectrum-icons/ui/SuccessSmall";
|
8
|
+
import {useTooltip as $GsYXh$useTooltip, useTooltipTrigger as $GsYXh$useTooltipTrigger} from "@react-aria/tooltip";
|
9
|
+
import {FocusableProvider as $GsYXh$FocusableProvider} from "@react-aria/focus";
|
10
|
+
import {Overlay as $GsYXh$Overlay} from "@react-spectrum/overlays";
|
11
|
+
import {useOverlayPosition as $GsYXh$useOverlayPosition} from "@react-aria/overlays";
|
12
|
+
import {useTooltipTriggerState as $GsYXh$useTooltipTriggerState} from "@react-stately/tooltip";
|
13
13
|
|
14
14
|
function $parcel$interopDefault(a) {
|
15
15
|
return a && a.__esModule ? a.default : a;
|
@@ -17,121 +17,121 @@ function $parcel$interopDefault(a) {
|
|
17
17
|
function $parcel$export(e, n, v, s) {
|
18
18
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
19
19
|
}
|
20
|
-
var $
|
21
|
-
|
22
|
-
$parcel$export($
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
var $
|
29
|
-
|
30
|
-
$parcel$export($
|
31
|
-
$parcel$export($
|
32
|
-
$parcel$export($
|
33
|
-
$parcel$export($
|
34
|
-
$parcel$export($
|
35
|
-
$parcel$export($
|
36
|
-
$parcel$export($
|
37
|
-
$parcel$export($
|
38
|
-
$parcel$export($
|
39
|
-
$parcel$export($
|
40
|
-
$parcel$export($
|
41
|
-
$parcel$export($
|
42
|
-
$parcel$export($
|
43
|
-
$parcel$export($
|
44
|
-
$parcel$export($
|
45
|
-
$parcel$export($
|
46
|
-
$parcel$export($
|
47
|
-
$parcel$export($
|
48
|
-
var $
|
49
|
-
var $
|
50
|
-
var $
|
51
|
-
var $
|
52
|
-
var $
|
53
|
-
var $
|
54
|
-
var $
|
55
|
-
var $
|
56
|
-
var $
|
57
|
-
var $
|
58
|
-
var $
|
59
|
-
var $
|
60
|
-
var $
|
61
|
-
var $
|
62
|
-
var $
|
63
|
-
var $
|
64
|
-
var $
|
65
|
-
var $
|
66
|
-
$
|
67
|
-
$
|
68
|
-
$
|
69
|
-
$
|
70
|
-
$
|
71
|
-
$
|
72
|
-
$
|
73
|
-
$
|
74
|
-
$
|
75
|
-
$
|
76
|
-
$
|
77
|
-
$
|
78
|
-
$
|
79
|
-
$
|
80
|
-
$
|
81
|
-
$
|
82
|
-
$
|
83
|
-
$
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
const $
|
20
|
+
var $f5ff0a7b08ee263c$exports = {};
|
21
|
+
|
22
|
+
$parcel$export($f5ff0a7b08ee263c$exports, "Tooltip", () => $f5ff0a7b08ee263c$export$28c660c63b792dea);
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
var $efde1aa8ba0e052d$exports = {};
|
29
|
+
|
30
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip", () => $efde1aa8ba0e052d$export$f7bf7078d3d03f05, (v) => $efde1aa8ba0e052d$export$f7bf7078d3d03f05 = v);
|
31
|
+
$parcel$export($efde1aa8ba0e052d$exports, "is-open", () => $efde1aa8ba0e052d$export$a9781837241c946d, (v) => $efde1aa8ba0e052d$export$a9781837241c946d = v);
|
32
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--bottom", () => $efde1aa8ba0e052d$export$4f420a9bbb442953, (v) => $efde1aa8ba0e052d$export$4f420a9bbb442953 = v);
|
33
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--top", () => $efde1aa8ba0e052d$export$d7516df59e198fc7, (v) => $efde1aa8ba0e052d$export$d7516df59e198fc7 = v);
|
34
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--right", () => $efde1aa8ba0e052d$export$c094187772823b2e, (v) => $efde1aa8ba0e052d$export$c094187772823b2e = v);
|
35
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--left", () => $efde1aa8ba0e052d$export$47f060b68b4cab2c, (v) => $efde1aa8ba0e052d$export$47f060b68b4cab2c = v);
|
36
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip-tip", () => $efde1aa8ba0e052d$export$9deb89a7a91de30, (v) => $efde1aa8ba0e052d$export$9deb89a7a91de30 = v);
|
37
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip-typeIcon", () => $efde1aa8ba0e052d$export$ff23d46fee8272e4, (v) => $efde1aa8ba0e052d$export$ff23d46fee8272e4 = v);
|
38
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip-label", () => $efde1aa8ba0e052d$export$f4096e0dc445b255, (v) => $efde1aa8ba0e052d$export$f4096e0dc445b255 = v);
|
39
|
+
$parcel$export($efde1aa8ba0e052d$exports, "u-tooltip-showOnHover", () => $efde1aa8ba0e052d$export$6ea3237f62800d00, (v) => $efde1aa8ba0e052d$export$6ea3237f62800d00 = v);
|
40
|
+
$parcel$export($efde1aa8ba0e052d$exports, "is-hovered", () => $efde1aa8ba0e052d$export$b8813cd5d7824ce7, (v) => $efde1aa8ba0e052d$export$b8813cd5d7824ce7 = v);
|
41
|
+
$parcel$export($efde1aa8ba0e052d$exports, "is-focused", () => $efde1aa8ba0e052d$export$e7dc768d35940237, (v) => $efde1aa8ba0e052d$export$e7dc768d35940237 = v);
|
42
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--negative", () => $efde1aa8ba0e052d$export$92fe45b4260594f6, (v) => $efde1aa8ba0e052d$export$92fe45b4260594f6 = v);
|
43
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--error", () => $efde1aa8ba0e052d$export$2b291890a5577893, (v) => $efde1aa8ba0e052d$export$2b291890a5577893 = v);
|
44
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--info", () => $efde1aa8ba0e052d$export$e995d5780591d0a8, (v) => $efde1aa8ba0e052d$export$e995d5780591d0a8 = v);
|
45
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--help", () => $efde1aa8ba0e052d$export$d33ca445ae528241, (v) => $efde1aa8ba0e052d$export$d33ca445ae528241 = v);
|
46
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--positive", () => $efde1aa8ba0e052d$export$11cbf31e1b6e51ac, (v) => $efde1aa8ba0e052d$export$11cbf31e1b6e51ac = v);
|
47
|
+
$parcel$export($efde1aa8ba0e052d$exports, "spectrum-Tooltip--success", () => $efde1aa8ba0e052d$export$4eae622bc9b08cac, (v) => $efde1aa8ba0e052d$export$4eae622bc9b08cac = v);
|
48
|
+
var $efde1aa8ba0e052d$export$f7bf7078d3d03f05;
|
49
|
+
var $efde1aa8ba0e052d$export$a9781837241c946d;
|
50
|
+
var $efde1aa8ba0e052d$export$4f420a9bbb442953;
|
51
|
+
var $efde1aa8ba0e052d$export$d7516df59e198fc7;
|
52
|
+
var $efde1aa8ba0e052d$export$c094187772823b2e;
|
53
|
+
var $efde1aa8ba0e052d$export$47f060b68b4cab2c;
|
54
|
+
var $efde1aa8ba0e052d$export$9deb89a7a91de30;
|
55
|
+
var $efde1aa8ba0e052d$export$ff23d46fee8272e4;
|
56
|
+
var $efde1aa8ba0e052d$export$f4096e0dc445b255;
|
57
|
+
var $efde1aa8ba0e052d$export$6ea3237f62800d00;
|
58
|
+
var $efde1aa8ba0e052d$export$b8813cd5d7824ce7;
|
59
|
+
var $efde1aa8ba0e052d$export$e7dc768d35940237;
|
60
|
+
var $efde1aa8ba0e052d$export$92fe45b4260594f6;
|
61
|
+
var $efde1aa8ba0e052d$export$2b291890a5577893;
|
62
|
+
var $efde1aa8ba0e052d$export$e995d5780591d0a8;
|
63
|
+
var $efde1aa8ba0e052d$export$d33ca445ae528241;
|
64
|
+
var $efde1aa8ba0e052d$export$11cbf31e1b6e51ac;
|
65
|
+
var $efde1aa8ba0e052d$export$4eae622bc9b08cac;
|
66
|
+
$efde1aa8ba0e052d$export$f7bf7078d3d03f05 = "spectrum-Tooltip_22ae94";
|
67
|
+
$efde1aa8ba0e052d$export$a9781837241c946d = "is-open_22ae94";
|
68
|
+
$efde1aa8ba0e052d$export$4f420a9bbb442953 = "spectrum-Tooltip--bottom_22ae94";
|
69
|
+
$efde1aa8ba0e052d$export$d7516df59e198fc7 = "spectrum-Tooltip--top_22ae94";
|
70
|
+
$efde1aa8ba0e052d$export$c094187772823b2e = "spectrum-Tooltip--right_22ae94";
|
71
|
+
$efde1aa8ba0e052d$export$47f060b68b4cab2c = "spectrum-Tooltip--left_22ae94";
|
72
|
+
$efde1aa8ba0e052d$export$9deb89a7a91de30 = "spectrum-Tooltip-tip_22ae94";
|
73
|
+
$efde1aa8ba0e052d$export$ff23d46fee8272e4 = "spectrum-Tooltip-typeIcon_22ae94";
|
74
|
+
$efde1aa8ba0e052d$export$f4096e0dc445b255 = "spectrum-Tooltip-label_22ae94";
|
75
|
+
$efde1aa8ba0e052d$export$6ea3237f62800d00 = "u-tooltip-showOnHover_22ae94";
|
76
|
+
$efde1aa8ba0e052d$export$b8813cd5d7824ce7 = "is-hovered_22ae94";
|
77
|
+
$efde1aa8ba0e052d$export$e7dc768d35940237 = "is-focused_22ae94";
|
78
|
+
$efde1aa8ba0e052d$export$92fe45b4260594f6 = "spectrum-Tooltip--negative_22ae94";
|
79
|
+
$efde1aa8ba0e052d$export$2b291890a5577893 = "spectrum-Tooltip--error_22ae94";
|
80
|
+
$efde1aa8ba0e052d$export$e995d5780591d0a8 = "spectrum-Tooltip--info_22ae94";
|
81
|
+
$efde1aa8ba0e052d$export$d33ca445ae528241 = "spectrum-Tooltip--help_22ae94";
|
82
|
+
$efde1aa8ba0e052d$export$11cbf31e1b6e51ac = "spectrum-Tooltip--positive_22ae94";
|
83
|
+
$efde1aa8ba0e052d$export$4eae622bc9b08cac = "spectrum-Tooltip--success_22ae94";
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
const $aa93b9f151774347$export$39ae08fa83328b12 = $GsYXh$react.createContext({
|
89
89
|
});
|
90
90
|
|
91
91
|
|
92
92
|
|
93
|
-
let $
|
94
|
-
info: $
|
95
|
-
positive: $
|
96
|
-
negative: $
|
93
|
+
let $f5ff0a7b08ee263c$var$iconMap = {
|
94
|
+
info: $GsYXh$spectrumiconsuiInfoSmall,
|
95
|
+
positive: $GsYXh$spectrumiconsuiSuccessSmall,
|
96
|
+
negative: $GsYXh$spectrumiconsuiAlertSmall
|
97
97
|
};
|
98
|
-
function $
|
99
|
-
let { ref: overlayRef , arrowProps: arrowProps , state: state , ...tooltipProviderProps } = $
|
100
|
-
let defaultRef = $
|
98
|
+
function $f5ff0a7b08ee263c$var$Tooltip(props, ref) {
|
99
|
+
let { ref: overlayRef , arrowProps: arrowProps , state: state , ...tooltipProviderProps } = $GsYXh$useContext($aa93b9f151774347$export$39ae08fa83328b12);
|
100
|
+
let defaultRef = $GsYXh$useRef();
|
101
101
|
overlayRef = overlayRef || defaultRef;
|
102
|
-
props = $
|
102
|
+
props = $GsYXh$mergeProps(props, tooltipProviderProps);
|
103
103
|
let { variant: variant = 'neutral' , placement: placement = 'top' , isOpen: isOpen , showIcon: showIcon , ...otherProps } = props;
|
104
|
-
let { styleProps: styleProps } = $
|
105
|
-
let { tooltipProps: tooltipProps } = $
|
104
|
+
let { styleProps: styleProps } = $GsYXh$useStyleProps(otherProps);
|
105
|
+
let { tooltipProps: tooltipProps } = $GsYXh$useTooltip(props, state);
|
106
106
|
// Sync ref with overlayRef from context.
|
107
|
-
$
|
107
|
+
$GsYXh$useImperativeHandle(ref, ()=>$GsYXh$createDOMRef(overlayRef)
|
108
108
|
);
|
109
|
-
let Icon = $
|
110
|
-
return(/*#__PURE__*/ $
|
109
|
+
let Icon = $f5ff0a7b08ee263c$var$iconMap[variant];
|
110
|
+
return(/*#__PURE__*/ $GsYXh$react.createElement("div", {
|
111
111
|
...styleProps,
|
112
112
|
...tooltipProps,
|
113
|
-
className: $
|
113
|
+
className: $GsYXh$classNames((/*@__PURE__*/$parcel$interopDefault($efde1aa8ba0e052d$exports)), 'spectrum-Tooltip', `spectrum-Tooltip--${variant}`, `spectrum-Tooltip--${placement}`, {
|
114
114
|
'is-open': isOpen
|
115
115
|
}, styleProps.className),
|
116
116
|
ref: overlayRef
|
117
|
-
}, showIcon && variant !== 'neutral' && /*#__PURE__*/ $
|
118
|
-
UNSAFE_className: $
|
117
|
+
}, showIcon && variant !== 'neutral' && /*#__PURE__*/ $GsYXh$react.createElement(Icon, {
|
118
|
+
UNSAFE_className: $GsYXh$classNames((/*@__PURE__*/$parcel$interopDefault($efde1aa8ba0e052d$exports)), 'spectrum-Tooltip-typeIcon'),
|
119
119
|
"aria-hidden": true
|
120
|
-
}), props.children && /*#__PURE__*/ $
|
121
|
-
className: $
|
122
|
-
}, props.children), /*#__PURE__*/ $
|
120
|
+
}), props.children && /*#__PURE__*/ $GsYXh$react.createElement("span", {
|
121
|
+
className: $GsYXh$classNames((/*@__PURE__*/$parcel$interopDefault($efde1aa8ba0e052d$exports)), 'spectrum-Tooltip-label')
|
122
|
+
}, props.children), /*#__PURE__*/ $GsYXh$react.createElement("span", {
|
123
123
|
...arrowProps,
|
124
|
-
className: $
|
124
|
+
className: $GsYXh$classNames((/*@__PURE__*/$parcel$interopDefault($efde1aa8ba0e052d$exports)), 'spectrum-Tooltip-tip')
|
125
125
|
})));
|
126
126
|
}
|
127
127
|
/**
|
128
128
|
* Display container for Tooltip content. Has a directional arrow dependent on its placement.
|
129
|
-
*/ let $
|
129
|
+
*/ let $f5ff0a7b08ee263c$export$28c660c63b792dea = /*#__PURE__*/ $GsYXh$react.forwardRef($f5ff0a7b08ee263c$var$Tooltip);
|
130
130
|
|
131
131
|
|
132
|
-
var $
|
132
|
+
var $7fb69c4f37e1dfe6$exports = {};
|
133
133
|
|
134
|
-
$parcel$export($
|
134
|
+
$parcel$export($7fb69c4f37e1dfe6$exports, "TooltipTrigger", () => $7fb69c4f37e1dfe6$export$8c610744efcf8a1d);
|
135
135
|
|
136
136
|
|
137
137
|
|
@@ -139,19 +139,19 @@ $parcel$export($8f1dc12c02800767$exports, "TooltipTrigger", () => $8f1dc12c02800
|
|
139
139
|
|
140
140
|
|
141
141
|
|
142
|
-
const $
|
143
|
-
const $
|
144
|
-
function $
|
145
|
-
let { children: children , crossOffset: crossOffset = $
|
146
|
-
let [trigger, tooltip] = $
|
147
|
-
let state = $
|
148
|
-
let tooltipTriggerRef = $
|
149
|
-
let overlayRef = $
|
150
|
-
let { triggerProps: triggerProps , tooltipProps: tooltipProps } = $
|
142
|
+
const $7fb69c4f37e1dfe6$var$DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button
|
143
|
+
const $7fb69c4f37e1dfe6$var$DEFAULT_CROSS_OFFSET = 0;
|
144
|
+
function $7fb69c4f37e1dfe6$var$TooltipTrigger(props) {
|
145
|
+
let { children: children , crossOffset: crossOffset = $7fb69c4f37e1dfe6$var$DEFAULT_CROSS_OFFSET , isDisabled: isDisabled , offset: offset = $7fb69c4f37e1dfe6$var$DEFAULT_OFFSET , trigger: triggerAction } = props;
|
146
|
+
let [trigger, tooltip] = $GsYXh$react.Children.toArray(children);
|
147
|
+
let state = $GsYXh$useTooltipTriggerState(props);
|
148
|
+
let tooltipTriggerRef = $GsYXh$useRef();
|
149
|
+
let overlayRef = $GsYXh$useRef();
|
150
|
+
let { triggerProps: triggerProps , tooltipProps: tooltipProps } = $GsYXh$useTooltipTrigger({
|
151
151
|
isDisabled: isDisabled,
|
152
152
|
trigger: triggerAction
|
153
153
|
}, state, tooltipTriggerRef);
|
154
|
-
let { overlayProps: overlayProps , arrowProps: arrowProps , placement: placement } = $
|
154
|
+
let { overlayProps: overlayProps , arrowProps: arrowProps , placement: placement } = $GsYXh$useOverlayPosition({
|
155
155
|
placement: props.placement || 'top',
|
156
156
|
targetRef: tooltipTriggerRef,
|
157
157
|
overlayRef: overlayRef,
|
@@ -159,10 +159,10 @@ function $8f1dc12c02800767$var$TooltipTrigger(props) {
|
|
159
159
|
crossOffset: crossOffset,
|
160
160
|
isOpen: state.isOpen
|
161
161
|
});
|
162
|
-
return(/*#__PURE__*/ $
|
162
|
+
return(/*#__PURE__*/ $GsYXh$react.createElement($GsYXh$FocusableProvider, {
|
163
163
|
...triggerProps,
|
164
164
|
ref: tooltipTriggerRef
|
165
|
-
}, trigger, /*#__PURE__*/ $
|
165
|
+
}, trigger, /*#__PURE__*/ $GsYXh$react.createElement($aa93b9f151774347$export$39ae08fa83328b12.Provider, {
|
166
166
|
value: {
|
167
167
|
state: state,
|
168
168
|
placement: placement,
|
@@ -171,21 +171,21 @@ function $8f1dc12c02800767$var$TooltipTrigger(props) {
|
|
171
171
|
arrowProps: arrowProps,
|
172
172
|
...tooltipProps
|
173
173
|
}
|
174
|
-
}, /*#__PURE__*/ $
|
174
|
+
}, /*#__PURE__*/ $GsYXh$react.createElement($GsYXh$Overlay, {
|
175
175
|
isOpen: state.isOpen
|
176
176
|
}, tooltip))));
|
177
177
|
}
|
178
178
|
// Support TooltipTrigger inside components using CollectionBuilder.
|
179
|
-
$
|
179
|
+
$7fb69c4f37e1dfe6$var$TooltipTrigger.getCollectionNode = function*(props) {
|
180
180
|
// Replaced the use of React.Childern.toArray because it mutates the key prop.
|
181
181
|
let childArray = [];
|
182
|
-
$
|
183
|
-
if (/*#__PURE__*/ $
|
182
|
+
$GsYXh$react.Children.forEach(props.children, (child)=>{
|
183
|
+
if (/*#__PURE__*/ $GsYXh$react.isValidElement(child)) childArray.push(child);
|
184
184
|
});
|
185
185
|
let [trigger, tooltip] = childArray;
|
186
186
|
yield {
|
187
187
|
element: trigger,
|
188
|
-
wrapper: (element)=>/*#__PURE__*/ $
|
188
|
+
wrapper: (element)=>/*#__PURE__*/ $GsYXh$react.createElement($7fb69c4f37e1dfe6$var$TooltipTrigger, {
|
189
189
|
key: element.key,
|
190
190
|
...props
|
191
191
|
}, element, tooltip)
|
@@ -196,10 +196,10 @@ $8f1dc12c02800767$var$TooltipTrigger.getCollectionNode = function*(props) {
|
|
196
196
|
* the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip
|
197
197
|
* relative to the trigger.
|
198
198
|
*/ // We don't want getCollectionNode to show up in the type definition
|
199
|
-
let $
|
199
|
+
let $7fb69c4f37e1dfe6$export$8c610744efcf8a1d = $7fb69c4f37e1dfe6$var$TooltipTrigger;
|
200
200
|
|
201
201
|
|
202
202
|
|
203
203
|
|
204
|
-
export {$
|
204
|
+
export {$f5ff0a7b08ee263c$export$28c660c63b792dea as Tooltip, $7fb69c4f37e1dfe6$export$8c610744efcf8a1d as TooltipTrigger};
|
205
205
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAkC;AAClC,GAAyB;AACzB,GAA0C;AAC1C,GAAuC;AACvC,GAAyC;AACzC,GAAwC;AACxC,GA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,GAAG,CAAC,UAAU,GAAmB,CAAC,CAAC;IACnC,YAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAE,KAAK,GAAI,CAAC;QAC/C,EAAE,gBAAE,YAAK,CAAC,cAAc,CAAC,KAAK,GAC5B,UAAU,CAAC,IAAI,CAAC,KAAK;IAEzB,CAAC;IACD,GAAG,EAAE,OAAO,EAAE,OAAO,IAAI,UAAU;UAC7B,CAAC;QACL,OAAO,EAAE,OAAO;QAChB,OAAO,GAAG,OAAO,4CACd,oCAAc;gBAAC,GAAG,EAAE,OAAO,CAAC,GAAG;mBAAM,KAAK;eACxC,OAAO,EACP,OAAO;IAGd,CAAC;AACH,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAe,GAAG,oCAAc;;","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 * from './Tooltip';\nexport * from './TooltipTrigger';\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 });\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAkC;AAClC,GAAyB;AACzB,GAA0C;AAC1C,GAAuC;AACvC,GAAyC;AACzC,GAAwC;AACxC,GAAsC;AACtC,GAA2C;AAC3C,GAAwC;AACxC,GAAuC;AACvC,GAA4B;AAC5B,GAA4B;AAC5B,GAA4C;AAC5C,GAAyC;AACzC,GAAwC;AACxC,GAAwC;AACxC,GAA4C;AAC5C,GAA2C;AAjB3C,yCAAkC,GAAG,CAAyB;AAC9D,yCAAyB,GAAG,CAAgB;AAC5C,yCAA0C,GAAG,CAAiC;AAC9E,yCAAuC,GAAG,CAA8B;AACxE,yCAAyC,GAAG,CAAgC;AAC5E,yCAAwC,GAAG,CAA+B;AAC1E,wCAAsC,GAAG,CAA6B;AACtE,yCAA2C,GAAG,CAAkC;AAChF,yCAAwC,GAAG,CAA+B;AAC1E,yCAAuC,GAAG,CAA8B;AACxE,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA4C,GAAG,CAAmC;AAClF,yCAAyC,GAAG,CAAgC;AAC5E,yCAAwC,GAAG,CAA+B;AAC1E,yCAAwC,GAAG,CA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ltip.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 * from './Tooltip';\nexport * from './TooltipTrigger';\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 });\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"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/tooltip",
|
3
|
-
"version": "3.0.0-nightly.
|
3
|
+
"version": "3.0.0-nightly.1395+b2abc5d94",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -32,22 +32,22 @@
|
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@babel/runtime": "^7.6.2",
|
35
|
-
"@react-aria/focus": "3.0.0-nightly.
|
36
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
37
|
-
"@react-aria/overlays": "3.0.0-nightly.
|
38
|
-
"@react-aria/tooltip": "3.0.0-nightly.
|
39
|
-
"@react-aria/utils": "3.0.0-nightly.
|
40
|
-
"@react-spectrum/overlays": "3.0.0-nightly.
|
41
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
42
|
-
"@react-stately/tooltip": "3.0.6-nightly.
|
43
|
-
"@react-stately/utils": "3.0.0-nightly.
|
44
|
-
"@react-types/overlays": "3.5.2-nightly.
|
45
|
-
"@react-types/shared": "3.0.0-nightly.
|
46
|
-
"@react-types/tooltip": "3.1.3-nightly.
|
47
|
-
"@spectrum-icons/ui": "3.0.0-nightly.
|
35
|
+
"@react-aria/focus": "3.0.0-nightly.1395+b2abc5d94",
|
36
|
+
"@react-aria/interactions": "3.0.0-nightly.1395+b2abc5d94",
|
37
|
+
"@react-aria/overlays": "3.0.0-nightly.1395+b2abc5d94",
|
38
|
+
"@react-aria/tooltip": "3.0.0-nightly.1395+b2abc5d94",
|
39
|
+
"@react-aria/utils": "3.0.0-nightly.1395+b2abc5d94",
|
40
|
+
"@react-spectrum/overlays": "3.0.0-nightly.1395+b2abc5d94",
|
41
|
+
"@react-spectrum/utils": "3.0.0-nightly.1395+b2abc5d94",
|
42
|
+
"@react-stately/tooltip": "3.0.6-nightly.3086+b2abc5d94",
|
43
|
+
"@react-stately/utils": "3.0.0-nightly.1395+b2abc5d94",
|
44
|
+
"@react-types/overlays": "3.5.2-nightly.3086+b2abc5d94",
|
45
|
+
"@react-types/shared": "3.0.0-nightly.1395+b2abc5d94",
|
46
|
+
"@react-types/tooltip": "3.1.3-nightly.3086+b2abc5d94",
|
47
|
+
"@spectrum-icons/ui": "3.0.0-nightly.1395+b2abc5d94"
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
50
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.1395+b2abc5d94"
|
51
51
|
},
|
52
52
|
"peerDependencies": {
|
53
53
|
"@react-spectrum/provider": "^3.0.0",
|
@@ -57,5 +57,5 @@
|
|
57
57
|
"publishConfig": {
|
58
58
|
"access": "public"
|
59
59
|
},
|
60
|
-
"gitHead": "
|
60
|
+
"gitHead": "b2abc5d94162a7bd614fffcdf11e3d3754dc7d9f"
|
61
61
|
}
|