@react-spectrum/tooltip 3.6.11 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,10 +45,12 @@ let $55bd11986fcffc6f$var$iconMap = {
45
45
  };
46
46
  function $55bd11986fcffc6f$var$Tooltip(props, ref) {
47
47
  let { ref: overlayRef, arrowProps: arrowProps, state: state, arrowRef: arrowRef, ...tooltipProviderProps } = (0, $l0Ry0$react.useContext)((0, $ed2e56c8503433b4$exports.TooltipContext));
48
- let defaultRef = (0, $l0Ry0$react.useRef)(undefined);
48
+ let defaultRef = (0, $l0Ry0$react.useRef)(null);
49
49
  overlayRef = overlayRef || defaultRef;
50
+ let backupPlacement = props.placement;
50
51
  props = (0, $l0Ry0$reactariautils.mergeProps)(props, tooltipProviderProps);
51
- let { variant: variant = 'neutral', placement: placement = 'top', isOpen: isOpen, showIcon: showIcon, ...otherProps } = props;
52
+ let { variant: variant = 'neutral', placement: placement, isOpen: isOpen, showIcon: showIcon, ...otherProps } = props;
53
+ if (placement == null) placement = backupPlacement !== null && backupPlacement !== void 0 ? backupPlacement : 'top';
52
54
  let { styleProps: styleProps } = (0, $l0Ry0$reactspectrumutils.useStyleProps)(otherProps);
53
55
  let { tooltipProps: tooltipProps } = (0, $l0Ry0$reactariatooltip.useTooltip)(props, state);
54
56
  // Sync ref with overlayRef from context.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAcD,IAAI,gCAAU;IACZ,MAAM,CAAA,GAAA,yDAAQ;IACd,UAAU,CAAA,GAAA,4DAAW;IACrB,UAAU,CAAA,GAAA,0DAAS;AACrB;AAEA,SAAS,8BAAQ,KAA2B,EAAE,GAAW;IACvD,IAAI,EAAC,KAAK,UAAU,cAAE,UAAU,SAAE,KAAK,YAAE,QAAQ,EAAE,GAAG,sBAAqB,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GA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2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertSmall from '@spectrum-icons/ui/AlertSmall';\nimport {classNames, createDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport InfoSmall from '@spectrum-icons/ui/InfoSmall';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTooltipProps} from '@react-types/tooltip';\nimport styles from '@adobe/spectrum-css-temp/components/tooltip/vars.css';\nimport SuccessSmall from '@spectrum-icons/ui/SuccessSmall';\nimport {TooltipContext} from './context';\nimport {useTooltip} from '@react-aria/tooltip';\n\nlet iconMap = {\n info: InfoSmall,\n positive: SuccessSmall,\n negative: AlertSmall\n};\n\nfunction Tooltip(props: SpectrumTooltipProps, ref: DOMRef) {\n let {ref: overlayRef, arrowProps, state, arrowRef, ...tooltipProviderProps} = useContext(TooltipContext);\n let defaultRef = useRef(undefined);\n overlayRef = overlayRef || defaultRef;\n props = mergeProps(props, tooltipProviderProps);\n let {\n variant = 'neutral',\n placement = 'top',\n isOpen,\n showIcon,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {tooltipProps} = useTooltip(props, state);\n\n // Sync ref with overlayRef from context.\n useImperativeHandle(ref, () => createDOMRef(overlayRef));\n\n let Icon = iconMap[variant];\n\n return (\n <div\n {...styleProps}\n {...tooltipProps}\n className={classNames(\n styles,\n 'spectrum-Tooltip',\n `spectrum-Tooltip--${variant}`,\n `spectrum-Tooltip--${placement}`,\n {\n 'is-open': isOpen,\n [`is-open--${placement}`]: isOpen\n },\n styleProps.className\n )}\n ref={overlayRef}>\n {showIcon && variant !== 'neutral' && <Icon UNSAFE_className={classNames(styles, 'spectrum-Tooltip-typeIcon')} aria-hidden />}\n {props.children && (\n <span className={classNames(styles, 'spectrum-Tooltip-label')}>\n {props.children}\n </span>\n )}\n <span {...arrowProps} ref={arrowRef} className={classNames(styles, 'spectrum-Tooltip-tip')} />\n </div>\n );\n}\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = React.forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n"],"names":[],"version":3,"file":"Tooltip.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAcD,IAAI,gCAAU;IACZ,MAAM,CAAA,GAAA,yDAAQ;IACd,UAAU,CAAA,GAAA,4DAAW;IACrB,UAAU,CAAA,GAAA,0DAAS;AACrB;AAEA,SAAS,8BAAQ,KAA2B,EAAE,GAAW;IACvD,IAAI,EAAC,KAAK,UAAU,cAAE,UAAU,SAAE,KAAK,YAAE,QAAQ,EAAE,GAAG,sBAAqB,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,wCAAa;IACtG,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAE;IACxB,aAAa,cAAc;IAC3B,IAAI,kBAAkB,MAAM,SAAS;IACrC,QAAQ,CAAA,GAAA,gCAAS,EAAE,OAAO;IAC1B,IAAI,WACF,UAAU,sBACV,SAAS,UACT,MAAM,YACN,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,aAAa,MACf,YAAY,4BAAA,6BAAA,kBAAmB;IAEjC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,kCAAS,EAAE,OAAO;IAEvC,yCAAyC;IACzC,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAM,CAAA,GAAA,sCAAW,EAAE;IAE5C,IAAI,OAAO,6BAAO,CAAC,QAAQ;IAE3B,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,YAAY;QAChB,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,oBACA,CAAC,kBAAkB,EAAE,SAAS,EAC9B,CAAC,kBAAkB,EAAE,WAAW,EAChC;YACE,WAAW;YACX,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE;QAC7B,GACA,WAAW,SAAS;QAEtB,KAAK;OACJ,YAAY,YAAY,2BAAa,0DAAC;QAAK,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAA8B,eAAA;QAC9G,MAAM,QAAQ,kBACb,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OACjC,MAAM,QAAQ,iBAGnB,0DAAC;QAAM,GAAG,UAAU;QAAE,KAAK;QAAU,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAGzE;AAEA;;CAEC,GACD,IAAI,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/tooltip/src/Tooltip.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\nimport AlertSmall from '@spectrum-icons/ui/AlertSmall';\nimport {classNames, createDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport InfoSmall from '@spectrum-icons/ui/InfoSmall';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTooltipProps} from '@react-types/tooltip';\nimport styles from '@adobe/spectrum-css-temp/components/tooltip/vars.css';\nimport SuccessSmall from '@spectrum-icons/ui/SuccessSmall';\nimport {TooltipContext} from './context';\nimport {useTooltip} from '@react-aria/tooltip';\n\nlet iconMap = {\n info: InfoSmall,\n positive: SuccessSmall,\n negative: AlertSmall\n};\n\nfunction Tooltip(props: SpectrumTooltipProps, ref: DOMRef) {\n let {ref: overlayRef, arrowProps, state, arrowRef, ...tooltipProviderProps} = useContext(TooltipContext);\n let defaultRef = useRef(null);\n overlayRef = overlayRef || defaultRef;\n let backupPlacement = props.placement;\n props = mergeProps(props, tooltipProviderProps);\n let {\n variant = 'neutral',\n placement,\n isOpen,\n showIcon,\n ...otherProps\n } = props;\n if (placement == null) {\n placement = backupPlacement ?? 'top';\n }\n let {styleProps} = useStyleProps(otherProps);\n let {tooltipProps} = useTooltip(props, state);\n\n // Sync ref with overlayRef from context.\n useImperativeHandle(ref, () => createDOMRef(overlayRef));\n\n let Icon = iconMap[variant];\n\n return (\n <div\n {...styleProps}\n {...tooltipProps}\n className={classNames(\n styles,\n 'spectrum-Tooltip',\n `spectrum-Tooltip--${variant}`,\n `spectrum-Tooltip--${placement}`,\n {\n 'is-open': isOpen,\n [`is-open--${placement}`]: isOpen\n },\n styleProps.className\n )}\n ref={overlayRef}>\n {showIcon && variant !== 'neutral' && <Icon UNSAFE_className={classNames(styles, 'spectrum-Tooltip-typeIcon')} aria-hidden />}\n {props.children && (\n <span className={classNames(styles, 'spectrum-Tooltip-label')}>\n {props.children}\n </span>\n )}\n <span {...arrowProps} ref={arrowRef} className={classNames(styles, 'spectrum-Tooltip-tip')} />\n </div>\n );\n}\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = React.forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n"],"names":[],"version":3,"file":"Tooltip.main.js.map"}
package/dist/Tooltip.mjs CHANGED
@@ -39,10 +39,12 @@ let $dc9e2a6f9971fb04$var$iconMap = {
39
39
  };
40
40
  function $dc9e2a6f9971fb04$var$Tooltip(props, ref) {
41
41
  let { ref: overlayRef, arrowProps: arrowProps, state: state, arrowRef: arrowRef, ...tooltipProviderProps } = (0, $dcNtB$useContext)((0, $b8c00169fae46ac7$export$39ae08fa83328b12));
42
- let defaultRef = (0, $dcNtB$useRef)(undefined);
42
+ let defaultRef = (0, $dcNtB$useRef)(null);
43
43
  overlayRef = overlayRef || defaultRef;
44
+ let backupPlacement = props.placement;
44
45
  props = (0, $dcNtB$mergeProps)(props, tooltipProviderProps);
45
- let { variant: variant = 'neutral', placement: placement = 'top', isOpen: isOpen, showIcon: showIcon, ...otherProps } = props;
46
+ let { variant: variant = 'neutral', placement: placement, isOpen: isOpen, showIcon: showIcon, ...otherProps } = props;
47
+ if (placement == null) placement = backupPlacement !== null && backupPlacement !== void 0 ? backupPlacement : 'top';
46
48
  let { styleProps: styleProps } = (0, $dcNtB$useStyleProps)(otherProps);
47
49
  let { tooltipProps: tooltipProps } = (0, $dcNtB$useTooltip)(props, state);
48
50
  // Sync ref with overlayRef from context.
@@ -39,10 +39,12 @@ let $dc9e2a6f9971fb04$var$iconMap = {
39
39
  };
40
40
  function $dc9e2a6f9971fb04$var$Tooltip(props, ref) {
41
41
  let { ref: overlayRef, arrowProps: arrowProps, state: state, arrowRef: arrowRef, ...tooltipProviderProps } = (0, $dcNtB$useContext)((0, $b8c00169fae46ac7$export$39ae08fa83328b12));
42
- let defaultRef = (0, $dcNtB$useRef)(undefined);
42
+ let defaultRef = (0, $dcNtB$useRef)(null);
43
43
  overlayRef = overlayRef || defaultRef;
44
+ let backupPlacement = props.placement;
44
45
  props = (0, $dcNtB$mergeProps)(props, tooltipProviderProps);
45
- let { variant: variant = 'neutral', placement: placement = 'top', isOpen: isOpen, showIcon: showIcon, ...otherProps } = props;
46
+ let { variant: variant = 'neutral', placement: placement, isOpen: isOpen, showIcon: showIcon, ...otherProps } = props;
47
+ if (placement == null) placement = backupPlacement !== null && backupPlacement !== void 0 ? backupPlacement : 'top';
46
48
  let { styleProps: styleProps } = (0, $dcNtB$useStyleProps)(otherProps);
47
49
  let { tooltipProps: tooltipProps } = (0, $dcNtB$useTooltip)(props, state);
48
50
  // Sync ref with overlayRef from context.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAcD,IAAI,gCAAU;IACZ,MAAM,CAAA,GAAA,+BAAQ;IACd,UAAU,CAAA,GAAA,kCAAW;IACrB,UAAU,CAAA,GAAA,gCAAS;AACrB;AAEA,SAAS,8BAAQ,KAA2B,EAAE,GAAW;IACvD,IAAI,EAAC,KAAK,UAAU,cAAE,UAAU,SAAE,KAAK,YAAE,QAAQ,EAAE,GAAG,sBAAqB,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAa;IACtG,IAAI,aAAa,CAAA,GAAA,aAAK,EAAE;IACxB,aAAa,cAAc;IAC3B,QAAQ,CAAA,GAAA,iBAAS,EAAE,OAAO;IAC1B,IAAI,WACF,UAAU,sBACV,YAAY,eACZ,MAAM,YACN,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,OAAO;IAEvC,yCAAyC;IACzC,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,CAAA,GAAA,mBAAW,EAAE;IAE5C,IAAI,OAAO,6BAAO,CAAC,QAAQ;IAE3B,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,YAAY;QAChB,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,yDAAK,GACL,oBACA,CAAC,kBAAkB,EAAE,QAAQ,CAAC,EAC9B,CAAC,kBAAkB,EAAE,UAAU,CAAC,EAChC;YACE,WAAW;YACX,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,EAAE;QAC7B,GACA,WAAW,SAAS;QAEtB,KAAK;OACJ,YAAY,YAAY,2BAAa,gCAAC;QAAK,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAK,GAAG;QAA8B,eAAA;QAC9G,MAAM,QAAQ,kBACb,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAK,GAAG;OACjC,MAAM,QAAQ,iBAGnB,gCAAC;QAAM,GAAG,UAAU;QAAE,KAAK;QAAU,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAK,GAAG;;AAGzE;AAEA;;CAEC,GACD,IAAI,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/tooltip/src/Tooltip.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\nimport AlertSmall from '@spectrum-icons/ui/AlertSmall';\nimport {classNames, createDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport InfoSmall from '@spectrum-icons/ui/InfoSmall';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTooltipProps} from '@react-types/tooltip';\nimport styles from '@adobe/spectrum-css-temp/components/tooltip/vars.css';\nimport SuccessSmall from '@spectrum-icons/ui/SuccessSmall';\nimport {TooltipContext} from './context';\nimport {useTooltip} from '@react-aria/tooltip';\n\nlet iconMap = {\n info: InfoSmall,\n positive: SuccessSmall,\n negative: AlertSmall\n};\n\nfunction Tooltip(props: SpectrumTooltipProps, ref: DOMRef) {\n let {ref: overlayRef, arrowProps, state, arrowRef, ...tooltipProviderProps} = useContext(TooltipContext);\n let defaultRef = useRef(undefined);\n overlayRef = overlayRef || defaultRef;\n props = mergeProps(props, tooltipProviderProps);\n let {\n variant = 'neutral',\n placement = 'top',\n isOpen,\n showIcon,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let {tooltipProps} = useTooltip(props, state);\n\n // Sync ref with overlayRef from context.\n useImperativeHandle(ref, () => createDOMRef(overlayRef));\n\n let Icon = iconMap[variant];\n\n return (\n <div\n {...styleProps}\n {...tooltipProps}\n className={classNames(\n styles,\n 'spectrum-Tooltip',\n `spectrum-Tooltip--${variant}`,\n `spectrum-Tooltip--${placement}`,\n {\n 'is-open': isOpen,\n [`is-open--${placement}`]: isOpen\n },\n styleProps.className\n )}\n ref={overlayRef}>\n {showIcon && variant !== 'neutral' && <Icon UNSAFE_className={classNames(styles, 'spectrum-Tooltip-typeIcon')} aria-hidden />}\n {props.children && (\n <span className={classNames(styles, 'spectrum-Tooltip-label')}>\n {props.children}\n </span>\n )}\n <span {...arrowProps} ref={arrowRef} className={classNames(styles, 'spectrum-Tooltip-tip')} />\n </div>\n );\n}\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = React.forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n"],"names":[],"version":3,"file":"Tooltip.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAcD,IAAI,gCAAU;IACZ,MAAM,CAAA,GAAA,+BAAQ;IACd,UAAU,CAAA,GAAA,kCAAW;IACrB,UAAU,CAAA,GAAA,gCAAS;AACrB;AAEA,SAAS,8BAAQ,KAA2B,EAAE,GAAW;IACvD,IAAI,EAAC,KAAK,UAAU,cA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GAAA,yDAAK,GAAG;;AAGzE;AAEA;;CAEC,GACD,IAAI,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/tooltip/src/Tooltip.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\nimport AlertSmall from '@spectrum-icons/ui/AlertSmall';\nimport {classNames, createDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport InfoSmall from '@spectrum-icons/ui/InfoSmall';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTooltipProps} from '@react-types/tooltip';\nimport styles from '@adobe/spectrum-css-temp/components/tooltip/vars.css';\nimport SuccessSmall from '@spectrum-icons/ui/SuccessSmall';\nimport {TooltipContext} from './context';\nimport {useTooltip} from '@react-aria/tooltip';\n\nlet iconMap = {\n info: InfoSmall,\n positive: SuccessSmall,\n negative: AlertSmall\n};\n\nfunction Tooltip(props: SpectrumTooltipProps, ref: DOMRef) {\n let {ref: overlayRef, arrowProps, state, arrowRef, ...tooltipProviderProps} = useContext(TooltipContext);\n let defaultRef = useRef(null);\n overlayRef = overlayRef || defaultRef;\n let backupPlacement = props.placement;\n props = mergeProps(props, tooltipProviderProps);\n let {\n variant = 'neutral',\n placement,\n isOpen,\n showIcon,\n ...otherProps\n } = props;\n if (placement == null) {\n placement = backupPlacement ?? 'top';\n }\n let {styleProps} = useStyleProps(otherProps);\n let {tooltipProps} = useTooltip(props, state);\n\n // Sync ref with overlayRef from context.\n useImperativeHandle(ref, () => createDOMRef(overlayRef));\n\n let Icon = iconMap[variant];\n\n return (\n <div\n {...styleProps}\n {...tooltipProps}\n className={classNames(\n styles,\n 'spectrum-Tooltip',\n `spectrum-Tooltip--${variant}`,\n `spectrum-Tooltip--${placement}`,\n {\n 'is-open': isOpen,\n [`is-open--${placement}`]: isOpen\n },\n styleProps.className\n )}\n ref={overlayRef}>\n {showIcon && variant !== 'neutral' && <Icon UNSAFE_className={classNames(styles, 'spectrum-Tooltip-typeIcon')} aria-hidden />}\n {props.children && (\n <span className={classNames(styles, 'spectrum-Tooltip-label')}>\n {props.children}\n </span>\n )}\n <span {...arrowProps} ref={arrowRef} className={classNames(styles, 'spectrum-Tooltip-tip')} />\n </div>\n );\n}\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = React.forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n"],"names":[],"version":3,"file":"Tooltip.module.js.map"}
@@ -41,8 +41,8 @@ function $19f06480c1c1a932$var$TooltipTrigger(props) {
41
41
  let { children: children, crossOffset: crossOffset = $19f06480c1c1a932$var$DEFAULT_CROSS_OFFSET, isDisabled: isDisabled, offset: offset = $19f06480c1c1a932$var$DEFAULT_OFFSET, trigger: triggerAction } = props;
42
42
  let [trigger, tooltip] = (0, ($parcel$interopDefault($1fBML$react))).Children.toArray(children);
43
43
  let state = (0, $1fBML$reactstatelytooltip.useTooltipTriggerState)(props);
44
- let tooltipTriggerRef = (0, $1fBML$react.useRef)(undefined);
45
- let overlayRef = (0, $1fBML$react.useRef)(undefined);
44
+ let tooltipTriggerRef = (0, $1fBML$react.useRef)(null);
45
+ let overlayRef = (0, $1fBML$react.useRef)(null);
46
46
  let { triggerProps: triggerProps, tooltipProps: tooltipProps } = (0, $1fBML$reactariatooltip.useTooltipTrigger)({
47
47
  isDisabled: isDisabled,
48
48
  trigger: triggerAction
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;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,WAAW;oBACX;gBACA;qBACA;QACA,QAAQ,MAAM,MAAM;QACpB,YAAY,MAAM,UAAU;QAC5B,kBAAkB,MAAM,gBAAgB;QACxC,WAAW;QACX,qBAAqB;QACrB,SAAS,IAAM,MAAM,KAAK,CAAC;IAC7B;IAEA,qBACE,0DAAC,CAAA,GAAA,uCAAgB;QACd,GAAG,YAAY;QAChB,KAAK;OACJ,uBACD,0DAAC,CAAA,GAAA,wCAAa,EAAE,QAAQ;QACtB,OAAO;mBACL;uBACA;YACA,KAAK;YACL,cAAc,aAAa,KAAK;wBAChC;YACA,UAAU;YACV,GAAG,YAAY;QACjB;qBACA,0DAAC,CAAA,GAAA,oCAAM;QAAE,QAAQ,MAAM,MAAM;QAAE,SAAS;OACrC;AAKX;AAEA,oEAAoE;AACpE,qCAAe,iBAAiB,GAAG,UAAW,KAAkC;IAC9E,8EAA8E;IAC9E,IAAI,aAA6B,EAAE;IACnC,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,CAAA;QACrC,kBAAI,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC,QACvB,WAAW,IAAI,CAAC;IAEpB;IACA,IAAI,CAAC,SAAS,QAAQ,GAAG;IACzB,MAAM;QACJ,SAAS;QACT,SAAS,CAAC,wBACR,0DAAC;gBAAe,KAAK,QAAQ,GAAG;gBAAG,GAAG,KAAK;eACxC,SACA;IAGP;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAkB","sources":["packages/@react-spectrum/tooltip/src/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\nimport {FocusableProvider} from '@react-aria/focus';\nimport {Overlay} from '@react-spectrum/overlays';\nimport React, {JSX, ReactElement, useRef, useState} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useOverlayPosition} from '@react-aria/overlays';\nimport {useTooltipTrigger} from '@react-aria/tooltip';\nimport {useTooltipTriggerState} from '@react-stately/tooltip';\n\nconst DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button\nconst DEFAULT_CROSS_OFFSET = 0;\n\nfunction TooltipTrigger(props: SpectrumTooltipTriggerProps) {\n let {\n children,\n crossOffset = DEFAULT_CROSS_OFFSET,\n isDisabled,\n offset = DEFAULT_OFFSET,\n trigger: triggerAction\n } = props;\n\n let [trigger, tooltip] = React.Children.toArray(children) as [ReactElement, ReactElement];\n let state = useTooltipTriggerState(props);\n\n let tooltipTriggerRef = useRef<HTMLElement>(undefined);\n let overlayRef = useRef<HTMLDivElement>(undefined);\n\n let {triggerProps, tooltipProps} = useTooltipTrigger({\n isDisabled,\n trigger: triggerAction\n }, state, tooltipTriggerRef);\n\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (overlayRef.current && state.isOpen) {\n let spectrumBorderRadius = window.getComputedStyle(overlayRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [state.isOpen, overlayRef]);\n let arrowRef = useRef(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {overlayProps, arrowProps, placement} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: tooltipTriggerRef,\n overlayRef,\n offset,\n crossOffset,\n isOpen: state.isOpen,\n shouldFlip: props.shouldFlip,\n containerPadding: props.containerPadding,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: borderRadius,\n onClose: () => state.close(true)\n });\n\n return (\n <FocusableProvider\n {...triggerProps}\n ref={tooltipTriggerRef}>\n {trigger}\n <TooltipContext.Provider\n value={{\n state,\n placement,\n ref: overlayRef,\n UNSAFE_style: overlayProps.style,\n arrowProps,\n arrowRef: arrowRef,\n ...tooltipProps\n }}>\n <Overlay isOpen={state.isOpen} nodeRef={overlayRef}>\n {tooltip}\n </Overlay>\n </TooltipContext.Provider>\n </FocusableProvider>\n );\n}\n\n// Support TooltipTrigger inside components using CollectionBuilder.\nTooltipTrigger.getCollectionNode = function* (props: SpectrumTooltipTriggerProps) {\n // Replaced the use of React.Children.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":"TooltipTrigger.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAYD,MAAM,uCAAiB,IAAI,yFAAyF;AACpH,MAAM,6CAAuB;AAE7B,SAAS,qCAAe,KAAkC;IACxD,IAAI,YACF,QAAQ,eACR,cAAc,wDACd,UAAU,UACV,SAAS,sCACT,SAAS,aAAa,EACvB,GAAG;IAEJ,IAAI,CA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,uCAAgB;QACd,GAAG,YAAY;QAChB,KAAK;OACJ,uBACD,0DAAC,CAAA,GAAA,wCAAa,EAAE,QAAQ;QACtB,OAAO;mBACL;uBACA;YACA,KAAK;YACL,cAAc,aAAa,KAAK;wBAChC;YACA,UAAU;YACV,GAAG,YAAY;QACjB;qBACA,0DAAC,CAAA,GAAA,oCAAM;QAAE,QAAQ,MAAM,MAAM;QAAE,SAAS;OACrC;AAKX;AAEA,oEAAoE;AACpE,qCAAe,iBAAiB,GAAG,UAAW,KAAkC;IAC9E,8EAA8E;IAC9E,IAAI,aAA6B,EAAE;IACnC,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,CAAA;QACrC,kBAAI,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC,QACvB,WAAW,IAAI,CAAC;IAEpB;IACA,IAAI,CAAC,SAAS,QAAQ,GAAG;IACzB,MAAM;QACJ,SAAS;QACT,SAAS,CAAC,wBACR,0DAAC;gBAAe,KAAK,QAAQ,GAAG;gBAAG,GAAG,KAAK;eACxC,SACA;IAGP;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAkB","sources":["packages/@react-spectrum/tooltip/src/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\nimport {FocusableProvider} from '@react-aria/focus';\nimport {Overlay} from '@react-spectrum/overlays';\nimport React, {JSX, ReactElement, useRef, useState} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useOverlayPosition} from '@react-aria/overlays';\nimport {useTooltipTrigger} from '@react-aria/tooltip';\nimport {useTooltipTriggerState} from '@react-stately/tooltip';\n\nconst DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button\nconst DEFAULT_CROSS_OFFSET = 0;\n\nfunction TooltipTrigger(props: SpectrumTooltipTriggerProps) {\n let {\n children,\n crossOffset = DEFAULT_CROSS_OFFSET,\n isDisabled,\n offset = DEFAULT_OFFSET,\n trigger: triggerAction\n } = props;\n\n let [trigger, tooltip] = React.Children.toArray(children) as [ReactElement, ReactElement];\n let state = useTooltipTriggerState(props);\n\n let tooltipTriggerRef = useRef<HTMLElement>(null);\n let overlayRef = useRef<HTMLDivElement>(null);\n\n let {triggerProps, tooltipProps} = useTooltipTrigger({\n isDisabled,\n trigger: triggerAction\n }, state, tooltipTriggerRef);\n\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (overlayRef.current && state.isOpen) {\n let spectrumBorderRadius = window.getComputedStyle(overlayRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [state.isOpen, overlayRef]);\n let arrowRef = useRef<HTMLElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {overlayProps, arrowProps, placement} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: tooltipTriggerRef,\n overlayRef,\n offset,\n crossOffset,\n isOpen: state.isOpen,\n shouldFlip: props.shouldFlip,\n containerPadding: props.containerPadding,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: borderRadius,\n onClose: () => state.close(true)\n });\n\n return (\n <FocusableProvider\n {...triggerProps}\n ref={tooltipTriggerRef}>\n {trigger}\n <TooltipContext.Provider\n value={{\n state,\n placement,\n ref: overlayRef,\n UNSAFE_style: overlayProps.style,\n arrowProps,\n arrowRef: arrowRef,\n ...tooltipProps\n }}>\n <Overlay isOpen={state.isOpen} nodeRef={overlayRef}>\n {tooltip}\n </Overlay>\n </TooltipContext.Provider>\n </FocusableProvider>\n );\n}\n\n// Support TooltipTrigger inside components using CollectionBuilder.\nTooltipTrigger.getCollectionNode = function* (props: SpectrumTooltipTriggerProps) {\n // Replaced the use of React.Children.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":"TooltipTrigger.main.js.map"}
@@ -31,8 +31,8 @@ function $019364e6919ef1db$var$TooltipTrigger(props) {
31
31
  let { children: children, crossOffset: crossOffset = $019364e6919ef1db$var$DEFAULT_CROSS_OFFSET, isDisabled: isDisabled, offset: offset = $019364e6919ef1db$var$DEFAULT_OFFSET, trigger: triggerAction } = props;
32
32
  let [trigger, tooltip] = (0, $cQFGy$react).Children.toArray(children);
33
33
  let state = (0, $cQFGy$useTooltipTriggerState)(props);
34
- let tooltipTriggerRef = (0, $cQFGy$useRef)(undefined);
35
- let overlayRef = (0, $cQFGy$useRef)(undefined);
34
+ let tooltipTriggerRef = (0, $cQFGy$useRef)(null);
35
+ let overlayRef = (0, $cQFGy$useRef)(null);
36
36
  let { triggerProps: triggerProps, tooltipProps: tooltipProps } = (0, $cQFGy$useTooltipTrigger)({
37
37
  isDisabled: isDisabled,
38
38
  trigger: triggerAction
@@ -31,8 +31,8 @@ function $019364e6919ef1db$var$TooltipTrigger(props) {
31
31
  let { children: children, crossOffset: crossOffset = $019364e6919ef1db$var$DEFAULT_CROSS_OFFSET, isDisabled: isDisabled, offset: offset = $019364e6919ef1db$var$DEFAULT_OFFSET, trigger: triggerAction } = props;
32
32
  let [trigger, tooltip] = (0, $cQFGy$react).Children.toArray(children);
33
33
  let state = (0, $cQFGy$useTooltipTriggerState)(props);
34
- let tooltipTriggerRef = (0, $cQFGy$useRef)(undefined);
35
- let overlayRef = (0, $cQFGy$useRef)(undefined);
34
+ let tooltipTriggerRef = (0, $cQFGy$useRef)(null);
35
+ let overlayRef = (0, $cQFGy$useRef)(null);
36
36
  let { triggerProps: triggerProps, tooltipProps: tooltipProps } = (0, $cQFGy$useTooltipTrigger)({
37
37
  isDisabled: isDisabled,
38
38
  trigger: triggerAction
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAYD,MAAM,uCAAiB,IAAI,yFAAyF;AACpH,MAAM,6CAAuB;AAE7B,SAAS,qCAAe,KAAkC;IACxD,IAAI,YACF,QAAQ,eACR,cAAc,wDACd,UAAU,UACV,SAAS,sCACT,SAAS,aAAa,EACvB,GAAG;IAEJ,IAAI,CAAC,SAAS,QAAQ,GAAG,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;IAChD,IAAI,QAAQ,CAAA,GAAA,6BAAqB,EAAE;IAEnC,IAAI,oBAAoB,CAAA,GAAA,aAAK,EAAe;IAC5C,IAAI,aAAa,CAAA,GAAA,aAAK,EAAkB;IAExC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;oBACnD;QACA,SAAS;IACX,GAAG,OAAO;IAEV,IAAI,CAAC,cAAc,gBAAgB,GAAG,C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IACnC,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,CAAA;QACrC,kBAAI,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC,QACvB,WAAW,IAAI,CAAC;IAEpB;IACA,IAAI,CAAC,SAAS,QAAQ,GAAG;IACzB,MAAM;QACJ,SAAS;QACT,SAAS,CAAC,wBACR,gCAAC;gBAAe,KAAK,QAAQ,GAAG;gBAAG,GAAG,KAAK;eACxC,SACA;IAGP;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAkB","sources":["packages/@react-spectrum/tooltip/src/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\nimport {FocusableProvider} from '@react-aria/focus';\nimport {Overlay} from '@react-spectrum/overlays';\nimport React, {JSX, ReactElement, useRef, useState} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useOverlayPosition} from '@react-aria/overlays';\nimport {useTooltipTrigger} from '@react-aria/tooltip';\nimport {useTooltipTriggerState} from '@react-stately/tooltip';\n\nconst DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button\nconst DEFAULT_CROSS_OFFSET = 0;\n\nfunction TooltipTrigger(props: SpectrumTooltipTriggerProps) {\n let {\n children,\n crossOffset = DEFAULT_CROSS_OFFSET,\n isDisabled,\n offset = DEFAULT_OFFSET,\n trigger: triggerAction\n } = props;\n\n let [trigger, tooltip] = React.Children.toArray(children) as [ReactElement, ReactElement];\n let state = useTooltipTriggerState(props);\n\n let tooltipTriggerRef = useRef<HTMLElement>(undefined);\n let overlayRef = useRef<HTMLDivElement>(undefined);\n\n let {triggerProps, tooltipProps} = useTooltipTrigger({\n isDisabled,\n trigger: triggerAction\n }, state, tooltipTriggerRef);\n\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (overlayRef.current && state.isOpen) {\n let spectrumBorderRadius = window.getComputedStyle(overlayRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [state.isOpen, overlayRef]);\n let arrowRef = useRef(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {overlayProps, arrowProps, placement} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: tooltipTriggerRef,\n overlayRef,\n offset,\n crossOffset,\n isOpen: state.isOpen,\n shouldFlip: props.shouldFlip,\n containerPadding: props.containerPadding,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: borderRadius,\n onClose: () => state.close(true)\n });\n\n return (\n <FocusableProvider\n {...triggerProps}\n ref={tooltipTriggerRef}>\n {trigger}\n <TooltipContext.Provider\n value={{\n state,\n placement,\n ref: overlayRef,\n UNSAFE_style: overlayProps.style,\n arrowProps,\n arrowRef: arrowRef,\n ...tooltipProps\n }}>\n <Overlay isOpen={state.isOpen} nodeRef={overlayRef}>\n {tooltip}\n </Overlay>\n </TooltipContext.Provider>\n </FocusableProvider>\n );\n}\n\n// Support TooltipTrigger inside components using CollectionBuilder.\nTooltipTrigger.getCollectionNode = function* (props: SpectrumTooltipTriggerProps) {\n // Replaced the use of React.Children.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":"TooltipTrigger.module.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAYD,MAAM,uCAAiB,IAAI,yFAAyF;AACpH,MAAM,6CAAuB;AAE7B,SAAS,qCAAe,KAAkC;IACxD,IAAI,YACF,QAAQ,eACR,cAAc,wDACd,UAAU,UACV,SAAS,sCACT,SAAS,aAAa,EACvB,GAAG;IAEJ,IAAI,CAAC,SAAS,QAAQ,GAAG,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;IAChD,IAAI,QAAQ,CAAA,GAAA,6BAAqB,EAAE;IAEnC,IAAI,oBAAoB,CAAA,GAAA,aAAK,EAAe;IAC5C,IAAI,aAAa,CAAA,GAAA,aAAK,EAAkB;IAExC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;oBACnD;QACA,SAAS;IACX,GAAG,OAAO;IAEV,IAAI,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,eAAO,EAAE;IAC/C,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,WAAW,OAAO,IAAI,MAAM,MAAM,EAAE;YACtC,IAAI,uBAAuB,OAAO,gBAAgB,CAAC,WAAW,OAAO,EAAE,YAAY;YACnF,IAAI,yBAAyB,IAC3B,gBAAgB,SAAS,sBAAsB;QAEnD;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,SAAS,CAAC,wBACR,gCAAC;gBAAe,KAAK,QAAQ,GAAG;gBAAG,GAAG,KAAK;eACxC,SACA;IAGP;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAkB","sources":["packages/@react-spectrum/tooltip/src/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\nimport {FocusableProvider} from '@react-aria/focus';\nimport {Overlay} from '@react-spectrum/overlays';\nimport React, {JSX, ReactElement, useRef, useState} from 'react';\nimport {SpectrumTooltipTriggerProps} from '@react-types/tooltip';\nimport {TooltipContext} from './context';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useOverlayPosition} from '@react-aria/overlays';\nimport {useTooltipTrigger} from '@react-aria/tooltip';\nimport {useTooltipTriggerState} from '@react-stately/tooltip';\n\nconst DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button\nconst DEFAULT_CROSS_OFFSET = 0;\n\nfunction TooltipTrigger(props: SpectrumTooltipTriggerProps) {\n let {\n children,\n crossOffset = DEFAULT_CROSS_OFFSET,\n isDisabled,\n offset = DEFAULT_OFFSET,\n trigger: triggerAction\n } = props;\n\n let [trigger, tooltip] = React.Children.toArray(children) as [ReactElement, ReactElement];\n let state = useTooltipTriggerState(props);\n\n let tooltipTriggerRef = useRef<HTMLElement>(null);\n let overlayRef = useRef<HTMLDivElement>(null);\n\n let {triggerProps, tooltipProps} = useTooltipTrigger({\n isDisabled,\n trigger: triggerAction\n }, state, tooltipTriggerRef);\n\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (overlayRef.current && state.isOpen) {\n let spectrumBorderRadius = window.getComputedStyle(overlayRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [state.isOpen, overlayRef]);\n let arrowRef = useRef<HTMLElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {overlayProps, arrowProps, placement} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: tooltipTriggerRef,\n overlayRef,\n offset,\n crossOffset,\n isOpen: state.isOpen,\n shouldFlip: props.shouldFlip,\n containerPadding: props.containerPadding,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: borderRadius,\n onClose: () => state.close(true)\n });\n\n return (\n <FocusableProvider\n {...triggerProps}\n ref={tooltipTriggerRef}>\n {trigger}\n <TooltipContext.Provider\n value={{\n state,\n placement,\n ref: overlayRef,\n UNSAFE_style: overlayProps.style,\n arrowProps,\n arrowRef: arrowRef,\n ...tooltipProps\n }}>\n <Overlay isOpen={state.isOpen} nodeRef={overlayRef}>\n {tooltip}\n </Overlay>\n </TooltipContext.Provider>\n </FocusableProvider>\n );\n}\n\n// Support TooltipTrigger inside components using CollectionBuilder.\nTooltipTrigger.getCollectionNode = function* (props: SpectrumTooltipTriggerProps) {\n // Replaced the use of React.Children.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":"TooltipTrigger.module.js.map"}
@@ -21,7 +21,9 @@ $parcel$export(module.exports, "TooltipContext", () => $ed2e56c8503433b4$export$
21
21
  * OF ANY KIND, either express or implied. See the License for the specific language
22
22
  * governing permissions and limitations under the License.
23
23
  */
24
- const $ed2e56c8503433b4$export$39ae08fa83328b12 = (0, ($parcel$interopDefault($aZ3Gf$react))).createContext({});
24
+ const $ed2e56c8503433b4$export$39ae08fa83328b12 = (0, ($parcel$interopDefault($aZ3Gf$react))).createContext({
25
+ placement: null
26
+ });
25
27
 
26
28
 
27
29
  //# sourceMappingURL=context.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAeM,MAAM,4CAAiB,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAsB,CAAC","sources":["packages/@react-spectrum/tooltip/src/context.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PlacementAxis} from '@react-types/overlays';\nimport React, {HTMLAttributes} from 'react';\nimport {RefObject, StyleProps} from '@react-types/shared';\nimport {TooltipTriggerState} from '@react-stately/tooltip';\n\ninterface TooltipContextProps extends StyleProps {\n state?: TooltipTriggerState,\n ref?: RefObject<HTMLDivElement | null>,\n placement?: PlacementAxis,\n arrowProps?: HTMLAttributes<HTMLElement>,\n arrowRef?: RefObject<HTMLElement | null>\n}\n\nexport const TooltipContext = React.createContext<TooltipContextProps>({});\n"],"names":[],"version":3,"file":"context.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAeM,MAAM,4CAAiB,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAsB;IAAC,WAAW;AAAI","sources":["packages/@react-spectrum/tooltip/src/context.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PlacementAxis} from '@react-types/overlays';\nimport React, {HTMLAttributes} from 'react';\nimport {RefObject, StyleProps} from '@react-types/shared';\nimport {TooltipTriggerState} from '@react-stately/tooltip';\n\ninterface TooltipContextProps extends StyleProps {\n state?: TooltipTriggerState,\n ref?: RefObject<HTMLDivElement | null>,\n placement: PlacementAxis | null,\n arrowProps?: HTMLAttributes<HTMLElement>,\n arrowRef?: RefObject<HTMLElement | null>\n}\n\nexport const TooltipContext = React.createContext<TooltipContextProps>({placement: null});\n"],"names":[],"version":3,"file":"context.main.js.map"}
package/dist/context.mjs CHANGED
@@ -11,7 +11,9 @@ import $kNnxj$react from "react";
11
11
  * OF ANY KIND, either express or implied. See the License for the specific language
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
- const $b8c00169fae46ac7$export$39ae08fa83328b12 = (0, $kNnxj$react).createContext({});
14
+ const $b8c00169fae46ac7$export$39ae08fa83328b12 = (0, $kNnxj$react).createContext({
15
+ placement: null
16
+ });
15
17
 
16
18
 
17
19
  export {$b8c00169fae46ac7$export$39ae08fa83328b12 as TooltipContext};
@@ -11,7 +11,9 @@ import $kNnxj$react from "react";
11
11
  * OF ANY KIND, either express or implied. See the License for the specific language
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
- const $b8c00169fae46ac7$export$39ae08fa83328b12 = (0, $kNnxj$react).createContext({});
14
+ const $b8c00169fae46ac7$export$39ae08fa83328b12 = (0, $kNnxj$react).createContext({
15
+ placement: null
16
+ });
15
17
 
16
18
 
17
19
  export {$b8c00169fae46ac7$export$39ae08fa83328b12 as TooltipContext};
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAeM,MAAM,4CAAiB,CAAA,GAAA,YAAI,EAAE,aAAa,CAAsB,CAAC","sources":["packages/@react-spectrum/tooltip/src/context.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PlacementAxis} from '@react-types/overlays';\nimport React, {HTMLAttributes} from 'react';\nimport {RefObject, StyleProps} from '@react-types/shared';\nimport {TooltipTriggerState} from '@react-stately/tooltip';\n\ninterface TooltipContextProps extends StyleProps {\n state?: TooltipTriggerState,\n ref?: RefObject<HTMLDivElement | null>,\n placement?: PlacementAxis,\n arrowProps?: HTMLAttributes<HTMLElement>,\n arrowRef?: RefObject<HTMLElement | null>\n}\n\nexport const TooltipContext = React.createContext<TooltipContextProps>({});\n"],"names":[],"version":3,"file":"context.module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAeM,MAAM,4CAAiB,CAAA,GAAA,YAAI,EAAE,aAAa,CAAsB;IAAC,WAAW;AAAI","sources":["packages/@react-spectrum/tooltip/src/context.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PlacementAxis} from '@react-types/overlays';\nimport React, {HTMLAttributes} from 'react';\nimport {RefObject, StyleProps} from '@react-types/shared';\nimport {TooltipTriggerState} from '@react-stately/tooltip';\n\ninterface TooltipContextProps extends StyleProps {\n state?: TooltipTriggerState,\n ref?: RefObject<HTMLDivElement | null>,\n placement: PlacementAxis | null,\n arrowProps?: HTMLAttributes<HTMLElement>,\n arrowRef?: RefObject<HTMLElement | null>\n}\n\nexport const TooltipContext = React.createContext<TooltipContextProps>({placement: null});\n"],"names":[],"version":3,"file":"context.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAhCA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA4B,CAAC,eAAe,EAAE,0CAAyC,CAAC;AACxF,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAoC,CAAC,uBAAuB,EAAE,0CAAiD,CAAC;AAChH,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkC,CAAC,qBAAqB,EAAE,0CAA+C,CAAC;AAC1G,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAmC,CAAC,sBAAsB,EAAE,0CAAgD,CAAC;AAC7G,2CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiC,CAAC,oBAAoB,EAAE,yCAA8C,CAAC;AACvG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAqC,CAAC,uBAAuB,CAAC;AAC9D,4CAAqC,CAAC,wBAAwB,EAAE,0CAAmC,CAAC;AACpG,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,2CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/tooltip/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"tooltip_vars_css.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAhCA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA4B,CAAC,eAAe,EAAE,2CAA0C;AACxF,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAoC,CAAC,uBAAuB,EAAE,2CAAkD;AAChH,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkC,CAAC,qBAAqB,EAAE,2CAAgD;AAC1G,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAmC,CAAC,sBAAsB,EAAE,2CAAiD;AAC7G,2CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiC,CAAC,oBAAoB,EAAE,0CAA+C;AACvG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAqC,CAAC,uBAAuB,CAAC;AAC9D,4CAAqC,CAAC,wBAAwB,EAAE,2CAAoC;AACpG,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,2CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/tooltip/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"tooltip_vars_css.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA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2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,2CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/tooltip/vars.css"],"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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"tooltip_vars_css.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAhCA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAA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. 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"],"names":[],"version":3,"file":"tooltip_vars_css.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;AC6EA;;GAEG;AACH,OAAA,IAAI,8GAAoC,CAAC;ACwCzC;;;;GAIG;AAEH,OAAA,IAAI,gBAAoC,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,OAAO,CAAC;AC9G5F,YAAY,EAAC,oBAAoB,EAAE,2BAA2B,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/context.ts","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/Tooltip.tsx","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/index.ts","packages/@react-spectrum/tooltip/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Tooltip} from './Tooltip';\nexport {TooltipTrigger} from './TooltipTrigger';\nexport type {SpectrumTooltipProps, SpectrumTooltipTriggerProps} from '@react-types/tooltip';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;ACiFA;;GAEG;AACH,OAAA,IAAI,8GAAoC,CAAC;ACoCzC;;;;GAIG;AAEH,OAAA,IAAI,gBAAoC,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,OAAO,CAAC;AC9G5F,YAAY,EAAC,oBAAoB,EAAE,2BAA2B,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/context.ts","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/Tooltip.tsx","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx","packages/@react-spectrum/tooltip/src/packages/@react-spectrum/tooltip/src/index.ts","packages/@react-spectrum/tooltip/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Tooltip} from './Tooltip';\nexport {TooltipTrigger} from './TooltipTrigger';\nexport type {SpectrumTooltipProps, SpectrumTooltipTriggerProps} from '@react-types/tooltip';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/tooltip",
3
- "version": "3.6.11",
3
+ "version": "3.7.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,17 +36,17 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/focus": "^3.18.4",
40
- "@react-aria/overlays": "^3.23.4",
41
- "@react-aria/tooltip": "^3.7.9",
42
- "@react-aria/utils": "^3.25.3",
43
- "@react-spectrum/overlays": "^5.6.5",
44
- "@react-spectrum/utils": "^3.11.11",
45
- "@react-stately/tooltip": "^3.4.13",
46
- "@react-types/overlays": "^3.8.10",
47
- "@react-types/shared": "^3.25.0",
48
- "@react-types/tooltip": "^3.4.12",
49
- "@spectrum-icons/ui": "^3.6.10",
39
+ "@react-aria/focus": "^3.19.0",
40
+ "@react-aria/overlays": "^3.24.0",
41
+ "@react-aria/tooltip": "^3.7.10",
42
+ "@react-aria/utils": "^3.26.0",
43
+ "@react-spectrum/overlays": "^5.7.0",
44
+ "@react-spectrum/utils": "^3.12.0",
45
+ "@react-stately/tooltip": "^3.5.0",
46
+ "@react-types/overlays": "^3.8.11",
47
+ "@react-types/shared": "^3.26.0",
48
+ "@react-types/tooltip": "^3.4.13",
49
+ "@spectrum-icons/ui": "^3.6.11",
50
50
  "@swc/helpers": "^0.5.0"
51
51
  },
52
52
  "devDependencies": {
@@ -54,11 +54,11 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@react-spectrum/provider": "^3.0.0",
57
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
58
- "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
57
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
58
+ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "8e0a28d188cdbdbd2b32296fa034b1b02ddde229"
63
+ "gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
64
64
  }
package/src/Tooltip.tsx CHANGED
@@ -30,16 +30,20 @@ let iconMap = {
30
30
 
31
31
  function Tooltip(props: SpectrumTooltipProps, ref: DOMRef) {
32
32
  let {ref: overlayRef, arrowProps, state, arrowRef, ...tooltipProviderProps} = useContext(TooltipContext);
33
- let defaultRef = useRef(undefined);
33
+ let defaultRef = useRef(null);
34
34
  overlayRef = overlayRef || defaultRef;
35
+ let backupPlacement = props.placement;
35
36
  props = mergeProps(props, tooltipProviderProps);
36
37
  let {
37
38
  variant = 'neutral',
38
- placement = 'top',
39
+ placement,
39
40
  isOpen,
40
41
  showIcon,
41
42
  ...otherProps
42
43
  } = props;
44
+ if (placement == null) {
45
+ placement = backupPlacement ?? 'top';
46
+ }
43
47
  let {styleProps} = useStyleProps(otherProps);
44
48
  let {tooltipProps} = useTooltip(props, state);
45
49
 
@@ -35,8 +35,8 @@ function TooltipTrigger(props: SpectrumTooltipTriggerProps) {
35
35
  let [trigger, tooltip] = React.Children.toArray(children) as [ReactElement, ReactElement];
36
36
  let state = useTooltipTriggerState(props);
37
37
 
38
- let tooltipTriggerRef = useRef<HTMLElement>(undefined);
39
- let overlayRef = useRef<HTMLDivElement>(undefined);
38
+ let tooltipTriggerRef = useRef<HTMLElement>(null);
39
+ let overlayRef = useRef<HTMLDivElement>(null);
40
40
 
41
41
  let {triggerProps, tooltipProps} = useTooltipTrigger({
42
42
  isDisabled,
@@ -52,7 +52,7 @@ function TooltipTrigger(props: SpectrumTooltipTriggerProps) {
52
52
  }
53
53
  }
54
54
  }, [state.isOpen, overlayRef]);
55
- let arrowRef = useRef(null);
55
+ let arrowRef = useRef<HTMLElement>(null);
56
56
  let [arrowWidth, setArrowWidth] = useState(0);
57
57
  useLayoutEffect(() => {
58
58
  if (arrowRef.current && state.isOpen) {
package/src/context.ts CHANGED
@@ -18,9 +18,9 @@ import {TooltipTriggerState} from '@react-stately/tooltip';
18
18
  interface TooltipContextProps extends StyleProps {
19
19
  state?: TooltipTriggerState,
20
20
  ref?: RefObject<HTMLDivElement | null>,
21
- placement?: PlacementAxis,
21
+ placement: PlacementAxis | null,
22
22
  arrowProps?: HTMLAttributes<HTMLElement>,
23
23
  arrowRef?: RefObject<HTMLElement | null>
24
24
  }
25
25
 
26
- export const TooltipContext = React.createContext<TooltipContextProps>({});
26
+ export const TooltipContext = React.createContext<TooltipContextProps>({placement: null});