@react-stately/tooltip 3.2.4-nightly.3598 → 3.2.4-nightly.3600

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -6,23 +6,40 @@ function $parcel$export(e, n, v, s) {
6
6
  }
7
7
 
8
8
  $parcel$export(module.exports, "useTooltipTriggerState", () => $3391baedd777a697$export$4d40659c25ecb50b);
9
-
9
+ /*
10
+ * Copyright 2020 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */ /*
20
+ * Copyright 2020 Adobe. All rights reserved.
21
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
22
+ * you may not use this file except in compliance with the License. You may obtain a copy
23
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
24
+ *
25
+ * Unless required by applicable law or agreed to in writing, software distributed under
26
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
27
+ * OF ANY KIND, either express or implied. See the License for the specific language
28
+ * governing permissions and limitations under the License.
29
+ */
10
30
 
11
31
  const $3391baedd777a697$var$TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design
12
32
  const $3391baedd777a697$var$TOOLTIP_COOLDOWN = 500;
13
- let $3391baedd777a697$var$tooltips = {
14
- };
33
+ let $3391baedd777a697$var$tooltips = {};
15
34
  let $3391baedd777a697$var$tooltipId = 0;
16
35
  let $3391baedd777a697$var$globalWarmedUp = false;
17
36
  let $3391baedd777a697$var$globalWarmUpTimeout = null;
18
37
  let $3391baedd777a697$var$globalCooldownTimeout = null;
19
- function $3391baedd777a697$export$4d40659c25ecb50b(props = {
20
- }) {
38
+ function $3391baedd777a697$export$4d40659c25ecb50b(props = {}) {
21
39
  let { delay: delay = $3391baedd777a697$var$TOOLTIP_DELAY } = props;
22
- let { isOpen: isOpen , open: open , close: close } = $8aPAr$reactstatelyoverlays.useOverlayTriggerState(props);
23
- let id = $8aPAr$react.useMemo(()=>`${++$3391baedd777a697$var$tooltipId}`
24
- , []);
25
- let closeTimeout = $8aPAr$react.useRef();
40
+ let { isOpen: isOpen , open: open , close: close } = (0, $8aPAr$reactstatelyoverlays.useOverlayTriggerState)(props);
41
+ let id = (0, $8aPAr$react.useMemo)(()=>`${++$3391baedd777a697$var$tooltipId}`, []);
42
+ let closeTimeout = (0, $8aPAr$react.useRef)();
26
43
  let ensureTooltipEntry = ()=>{
27
44
  $3391baedd777a697$var$tooltips[id] = hideTooltip;
28
45
  };
@@ -81,7 +98,7 @@ function $3391baedd777a697$export$4d40659c25ecb50b(props = {
81
98
  else if (!isOpen) showTooltip();
82
99
  };
83
100
  // eslint-disable-next-line arrow-body-style
84
- $8aPAr$react.useEffect(()=>{
101
+ (0, $8aPAr$react.useEffect)(()=>{
85
102
  return ()=>{
86
103
  clearTimeout(closeTimeout.current);
87
104
  let tooltip = $3391baedd777a697$var$tooltips[id];
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;ACgBA,KAAK,CAAC,mCAAa,GAAG,IAAI,CAAE,CAAyD,AAAzD,EAAyD,AAAzD,uDAAyD;AACrF,KAAK,CAAC,sCAAgB,GAAG,GAAG;AAe5B,GAAG,CAAC,8BAAQ,GAAG,CAAC;AAAA,CAAC;AACjB,GAAG,CAAC,+BAAS,GAAG,CAAC;AACjB,GAAG,CAAC,oCAAc,GAAG,KAAK;AAC1B,GAAG,CAAC,yCAAmB,GAAG,IAAI;AAC9B,GAAG,CAAC,2CAAqB,GAAG,IAAI;SAOhB,yCAAsB,CAAC,KAA0B,GAAG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,CAAC,OAAO,EAClD,aAAa;iBAEb,WAAW;QAEf,CAAC;QACD,KAAK,EAAE,WAAW;IACpB,CAAC;AACH,CAAC","sources":["packages/@react-stately/tooltip/src/index.ts","packages/@react-stately/tooltip/src/useTooltipTriggerState.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\nexport {useTooltipTriggerState} from './useTooltipTriggerState';\n\nexport type {TooltipTriggerProps} from '@react-types/tooltip';\nexport type {TooltipTriggerState} from './useTooltipTriggerState';\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 {TooltipTriggerProps} from '@react-types/tooltip';\nimport {useEffect, useMemo, useRef} from 'react';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\n\nconst TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design\nconst TOOLTIP_COOLDOWN = 500;\n\nexport interface TooltipTriggerState {\n /** Whether the tooltip is currently showing. */\n isOpen: boolean,\n /**\n * Shows the tooltip. By default, the tooltip becomes visible after a delay\n * depending on a global warmup timer. The `immediate` option shows the\n * tooltip immediately instead.\n */\n open(immediate?: boolean): void,\n /** Hides the tooltip. */\n close(immediate?: boolean): void\n}\n\nlet tooltips = {};\nlet tooltipId = 0;\nlet globalWarmedUp = false;\nlet globalWarmUpTimeout = null;\nlet globalCooldownTimeout = null;\n\n/**\n * Manages state for a tooltip trigger. Tracks whether the tooltip is open, and provides\n * methods to toggle this state. Ensures only one tooltip is open at a time and controls\n * the delay for showing a tooltip.\n */\nexport function useTooltipTriggerState(props: TooltipTriggerProps = {}): TooltipTriggerState {\n let {delay = TOOLTIP_DELAY} = props;\n let {isOpen, open, close} = useOverlayTriggerState(props);\n let id = useMemo(() => `${++tooltipId}`, []);\n let closeTimeout = useRef<ReturnType<typeof setTimeout>>();\n\n let ensureTooltipEntry = () => {\n tooltips[id] = hideTooltip;\n };\n\n let closeOpenTooltips = () => {\n for (let hideTooltipId in tooltips) {\n if (hideTooltipId !== id) {\n tooltips[hideTooltipId](true);\n delete tooltips[hideTooltipId];\n }\n }\n };\n\n let showTooltip = () => {\n clearTimeout(closeTimeout.current);\n closeTimeout.current = null;\n closeOpenTooltips();\n ensureTooltipEntry();\n globalWarmedUp = true;\n open();\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n globalCooldownTimeout = null;\n }\n };\n\n let hideTooltip = (immediate?: boolean) => {\n if (immediate) {\n clearTimeout(closeTimeout.current);\n closeTimeout.current = null;\n close();\n } else if (!closeTimeout.current) {\n closeTimeout.current = setTimeout(() => {\n closeTimeout.current = null;\n close();\n }, TOOLTIP_COOLDOWN);\n }\n\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalWarmedUp) {\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n }\n globalCooldownTimeout = setTimeout(() => {\n delete tooltips[id];\n globalCooldownTimeout = null;\n globalWarmedUp = false;\n }, TOOLTIP_COOLDOWN);\n }\n };\n\n let warmupTooltip = () => {\n closeOpenTooltips();\n ensureTooltipEntry();\n if (!isOpen && !globalWarmUpTimeout && !globalWarmedUp) {\n globalWarmUpTimeout = setTimeout(() => {\n globalWarmUpTimeout = null;\n globalWarmedUp = true;\n showTooltip();\n }, delay);\n } else if (!isOpen) {\n showTooltip();\n }\n };\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n clearTimeout(closeTimeout.current);\n let tooltip = tooltips[id];\n if (tooltip) {\n delete tooltips[id];\n }\n };\n }, [id]);\n\n return {\n isOpen,\n open: (immediate) => {\n if (!immediate && delay > 0 && !closeTimeout.current) {\n warmupTooltip();\n } else {\n showTooltip();\n }\n },\n close: hideTooltip\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;AAIA,MAAM,sCAAgB,MAAM,yDAAyD;AACrF,MAAM,yCAAmB;AAezB,IAAI,iCAAW,CAAC;AAChB,IAAI,kCAAY;AAChB,IAAI,uCAAiB,KAAK;AAC1B,IAAI,4CAAsB,IAAI;AAC9B,IAAI,8CAAwB,IAAI;AAOzB,SAAS,0CAAuB,QAA6B,CAAC,CAAC,EAAuB;IAC3F,IAAI,SAAC,QAAQ,sCAAc,GAAG;IAC9B,IAAI,UAAC,OAAM,QAAE,KAAI,SAAE,MAAK,EAAC,GAAG,CAAA,GAAA,kDAAqB,EAAE;IACnD,IAAI,KAAK,CAAA,GAAA,oBAAM,EAAE,IAAM,CAAC,EAAE,EAAE,gCAAU,CAAC,EAAE,EAAE;IAC3C,IAAI,eAAe,CAAA,GAAA,mBAAM,AAAD;IAExB,IAAI,qBAAqB,IAAM;QAC7B,8BAAQ,CAAC,GAAG,GAAG;IACjB;IAEA,IAAI,oBAAoB,IAAM;QAC5B,IAAK,IAAI,iBAAiB,+BACxB,IAAI,kBAAkB,IAAI;YACxB,8BAAQ,CAAC,cAAc,CAAC,IAAI;YAC5B,OAAO,8BAAQ,CAAC,cAAc;QAChC,CAAC;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D;iBAEA;QAEJ;QACA,OAAO;IACT;AACF;;CDrIC,GAED","sources":["packages/@react-stately/tooltip/src/index.ts","packages/@react-stately/tooltip/src/useTooltipTriggerState.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\nexport {useTooltipTriggerState} from './useTooltipTriggerState';\n\nexport type {TooltipTriggerProps} from '@react-types/tooltip';\nexport type {TooltipTriggerState} from './useTooltipTriggerState';\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 {TooltipTriggerProps} from '@react-types/tooltip';\nimport {useEffect, useMemo, useRef} from 'react';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\n\nconst TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design\nconst TOOLTIP_COOLDOWN = 500;\n\nexport interface TooltipTriggerState {\n /** Whether the tooltip is currently showing. */\n isOpen: boolean,\n /**\n * Shows the tooltip. By default, the tooltip becomes visible after a delay\n * depending on a global warmup timer. The `immediate` option shows the\n * tooltip immediately instead.\n */\n open(immediate?: boolean): void,\n /** Hides the tooltip. */\n close(immediate?: boolean): void\n}\n\nlet tooltips = {};\nlet tooltipId = 0;\nlet globalWarmedUp = false;\nlet globalWarmUpTimeout = null;\nlet globalCooldownTimeout = null;\n\n/**\n * Manages state for a tooltip trigger. Tracks whether the tooltip is open, and provides\n * methods to toggle this state. Ensures only one tooltip is open at a time and controls\n * the delay for showing a tooltip.\n */\nexport function useTooltipTriggerState(props: TooltipTriggerProps = {}): TooltipTriggerState {\n let {delay = TOOLTIP_DELAY} = props;\n let {isOpen, open, close} = useOverlayTriggerState(props);\n let id = useMemo(() => `${++tooltipId}`, []);\n let closeTimeout = useRef<ReturnType<typeof setTimeout>>();\n\n let ensureTooltipEntry = () => {\n tooltips[id] = hideTooltip;\n };\n\n let closeOpenTooltips = () => {\n for (let hideTooltipId in tooltips) {\n if (hideTooltipId !== id) {\n tooltips[hideTooltipId](true);\n delete tooltips[hideTooltipId];\n }\n }\n };\n\n let showTooltip = () => {\n clearTimeout(closeTimeout.current);\n closeTimeout.current = null;\n closeOpenTooltips();\n ensureTooltipEntry();\n globalWarmedUp = true;\n open();\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n globalCooldownTimeout = null;\n }\n };\n\n let hideTooltip = (immediate?: boolean) => {\n if (immediate) {\n clearTimeout(closeTimeout.current);\n closeTimeout.current = null;\n close();\n } else if (!closeTimeout.current) {\n closeTimeout.current = setTimeout(() => {\n closeTimeout.current = null;\n close();\n }, TOOLTIP_COOLDOWN);\n }\n\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalWarmedUp) {\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n }\n globalCooldownTimeout = setTimeout(() => {\n delete tooltips[id];\n globalCooldownTimeout = null;\n globalWarmedUp = false;\n }, TOOLTIP_COOLDOWN);\n }\n };\n\n let warmupTooltip = () => {\n closeOpenTooltips();\n ensureTooltipEntry();\n if (!isOpen && !globalWarmUpTimeout && !globalWarmedUp) {\n globalWarmUpTimeout = setTimeout(() => {\n globalWarmUpTimeout = null;\n globalWarmedUp = true;\n showTooltip();\n }, delay);\n } else if (!isOpen) {\n showTooltip();\n }\n };\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n clearTimeout(closeTimeout.current);\n let tooltip = tooltips[id];\n if (tooltip) {\n delete tooltips[id];\n }\n };\n }, [id]);\n\n return {\n isOpen,\n open: (immediate) => {\n if (!immediate && delay > 0 && !closeTimeout.current) {\n warmupTooltip();\n } else {\n showTooltip();\n }\n },\n close: hideTooltip\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.mjs CHANGED
@@ -1,23 +1,40 @@
1
1
  import {useMemo as $1OhDq$useMemo, useRef as $1OhDq$useRef, useEffect as $1OhDq$useEffect} from "react";
2
2
  import {useOverlayTriggerState as $1OhDq$useOverlayTriggerState} from "@react-stately/overlays";
3
3
 
4
-
4
+ /*
5
+ * Copyright 2020 Adobe. All rights reserved.
6
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License. You may obtain a copy
8
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ * OF ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ */ /*
15
+ * Copyright 2020 Adobe. All rights reserved.
16
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License. You may obtain a copy
18
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software distributed under
21
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
+ * OF ANY KIND, either express or implied. See the License for the specific language
23
+ * governing permissions and limitations under the License.
24
+ */
5
25
 
6
26
  const $8796f90736e175cb$var$TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design
7
27
  const $8796f90736e175cb$var$TOOLTIP_COOLDOWN = 500;
8
- let $8796f90736e175cb$var$tooltips = {
9
- };
28
+ let $8796f90736e175cb$var$tooltips = {};
10
29
  let $8796f90736e175cb$var$tooltipId = 0;
11
30
  let $8796f90736e175cb$var$globalWarmedUp = false;
12
31
  let $8796f90736e175cb$var$globalWarmUpTimeout = null;
13
32
  let $8796f90736e175cb$var$globalCooldownTimeout = null;
14
- function $8796f90736e175cb$export$4d40659c25ecb50b(props = {
15
- }) {
33
+ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
16
34
  let { delay: delay = $8796f90736e175cb$var$TOOLTIP_DELAY } = props;
17
- let { isOpen: isOpen , open: open , close: close } = $1OhDq$useOverlayTriggerState(props);
18
- let id = $1OhDq$useMemo(()=>`${++$8796f90736e175cb$var$tooltipId}`
19
- , []);
20
- let closeTimeout = $1OhDq$useRef();
35
+ let { isOpen: isOpen , open: open , close: close } = (0, $1OhDq$useOverlayTriggerState)(props);
36
+ let id = (0, $1OhDq$useMemo)(()=>`${++$8796f90736e175cb$var$tooltipId}`, []);
37
+ let closeTimeout = (0, $1OhDq$useRef)();
21
38
  let ensureTooltipEntry = ()=>{
22
39
  $8796f90736e175cb$var$tooltips[id] = hideTooltip;
23
40
  };
@@ -76,7 +93,7 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {
76
93
  else if (!isOpen) showTooltip();
77
94
  };
78
95
  // eslint-disable-next-line arrow-body-style
79
- $1OhDq$useEffect(()=>{
96
+ (0, $1OhDq$useEffect)(()=>{
80
97
  return ()=>{
81
98
  clearTimeout(closeTimeout.current);
82
99
  let tooltip = $8796f90736e175cb$var$tooltips[id];
@@ -1 +1 @@
1
- {"mappings":";;;;;ACgBA,KAAK,CAAC,mCAAa,GAAG,IAAI,CAAE,CAAyD,AAAzD,EAAyD,AAAzD,uDAAyD;AACrF,KAAK,CAAC,sCAAgB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ACzB,EAAE,EAAE,OAAO,EACT,MAAM,CAAC,8BAAQ,CAAC,EAAE;QAEtB,CAAC;IACH,CAAC,EAAE,CAAC;QAAA,EAAE;IAAA,CAAC;IAEP,MAAM,CAAC,CAAC;gBACN,MAAM;QACN,IAAI,GAAG,SAAS,GAAK,CAAC;YACpB,EAAE,GAAG,SAAS,IAAI,KAAK,GAAG,CAAC,KAAK,YAAY,CAAC,OAAO,EAClD,aAAa;iBAEb,WAAW;QAEf,CAAC;QACD,KAAK,EAAE,WAAW;IACpB,CAAC;AACH,CAAC","sources":["packages/@react-stately/tooltip/src/index.ts","packages/@react-stately/tooltip/src/useTooltipTriggerState.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\nexport {useTooltipTriggerState} from './useTooltipTriggerState';\n\nexport type {TooltipTriggerProps} from '@react-types/tooltip';\nexport type {TooltipTriggerState} from './useTooltipTriggerState';\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 {TooltipTriggerProps} from '@react-types/tooltip';\nimport {useEffect, useMemo, useRef} from 'react';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\n\nconst TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design\nconst TOOLTIP_COOLDOWN = 500;\n\nexport interface TooltipTriggerState {\n /** Whether the tooltip is currently showing. */\n isOpen: boolean,\n /**\n * Shows the tooltip. By default, the tooltip becomes visible after a delay\n * depending on a global warmup timer. The `immediate` option shows the\n * tooltip immediately instead.\n */\n open(immediate?: boolean): void,\n /** Hides the tooltip. */\n close(immediate?: boolean): void\n}\n\nlet tooltips = {};\nlet tooltipId = 0;\nlet globalWarmedUp = false;\nlet globalWarmUpTimeout = null;\nlet globalCooldownTimeout = null;\n\n/**\n * Manages state for a tooltip trigger. Tracks whether the tooltip is open, and provides\n * methods to toggle this state. Ensures only one tooltip is open at a time and controls\n * the delay for showing a tooltip.\n */\nexport function useTooltipTriggerState(props: TooltipTriggerProps = {}): TooltipTriggerState {\n let {delay = TOOLTIP_DELAY} = props;\n let {isOpen, open, close} = useOverlayTriggerState(props);\n let id = useMemo(() => `${++tooltipId}`, []);\n let closeTimeout = useRef<ReturnType<typeof setTimeout>>();\n\n let ensureTooltipEntry = () => {\n tooltips[id] = hideTooltip;\n };\n\n let closeOpenTooltips = () => {\n for (let hideTooltipId in tooltips) {\n if (hideTooltipId !== id) {\n tooltips[hideTooltipId](true);\n delete tooltips[hideTooltipId];\n }\n }\n };\n\n let showTooltip = () => {\n clearTimeout(closeTimeout.current);\n closeTimeout.current = null;\n closeOpenTooltips();\n ensureTooltipEntry();\n globalWarmedUp = true;\n open();\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n globalCooldownTimeout = null;\n }\n };\n\n let hideTooltip = (immediate?: boolean) => {\n if (immediate) {\n clearTimeout(closeTimeout.current);\n closeTimeout.current = null;\n close();\n } else if (!closeTimeout.current) {\n closeTimeout.current = setTimeout(() => {\n closeTimeout.current = null;\n close();\n }, TOOLTIP_COOLDOWN);\n }\n\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalWarmedUp) {\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n }\n globalCooldownTimeout = setTimeout(() => {\n delete tooltips[id];\n globalCooldownTimeout = null;\n globalWarmedUp = false;\n }, TOOLTIP_COOLDOWN);\n }\n };\n\n let warmupTooltip = () => {\n closeOpenTooltips();\n ensureTooltipEntry();\n if (!isOpen && !globalWarmUpTimeout && !globalWarmedUp) {\n globalWarmUpTimeout = setTimeout(() => {\n globalWarmUpTimeout = null;\n globalWarmedUp = true;\n showTooltip();\n }, delay);\n } else if (!isOpen) {\n showTooltip();\n }\n };\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n clearTimeout(closeTimeout.current);\n let tooltip = tooltips[id];\n if (tooltip) {\n delete tooltips[id];\n }\n };\n }, [id]);\n\n return {\n isOpen,\n open: (immediate) => {\n if (!immediate && delay > 0 && !closeTimeout.current) {\n warmupTooltip();\n } else {\n showTooltip();\n }\n },\n close: hideTooltip\n };\n}\n"],"names":[],"version":3,"file":"module.mjs.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;AAIA,MAAM,sCAAgB,MAAM,yDAAyD;AACrF,MAAM,yCAAmB;AAezB,IAAI,iCAAW,CAAC;AAChB,IAAI,kCAAY;AAChB,IAAI,uCAAiB,KAAK;AAC1B,IAAI,4CAAsB,IAAI;AAC9B,IAAI,8CAAwB,IAAI;AAOzB,SAAS,0CAAuB,QAA6B,CAAC,CAAC,EAAuB;IAC3F,IAAI,SAAC,QAAQ,sCAAc,GAAG;IAC9B,IAAI,UAAC,OAAM,QAAE,KAAI,SAAE,MAAK,EAAC,GAAG,CAAA,GAAA,6BAAqB,EAAE;IACnD,IAAI,KAAK,CAAA,GAAA,cAAM,EAAE,IAAM,CAAC,EAAE,EAAE,gCAAU,CAAC,EAAE,EAAE;IAC3C,IAAI,eAAe,CAAA,GAAA,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O,IAAM;YACX,aAAa,aAAa,OAAO;YACjC,IAAI,UAAU,8BAAQ,CAAC,GAAG;YAC1B,IAAI,SACF,OAAO,8BAAQ,CAAC,GAAG;QAEvB;IACF,GAAG;QAAC;KAAG;IAEP,OAAO;gBACL;QACA,MAAM,CAAC,YAAc;YACnB,IAAI,CAAC,aAAa,QAAQ,KAAK,CAAC,aAAa,OAAO,EAClD;iBAEA;QAEJ;QACA,OAAO;IACT;AACF;;CDrIC,GAED","sources":["packages/@react-stately/tooltip/src/index.ts","packages/@react-stately/tooltip/src/useTooltipTriggerState.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\nexport {useTooltipTriggerState} from './useTooltipTriggerState';\n\nexport type {TooltipTriggerProps} from '@react-types/tooltip';\nexport type {TooltipTriggerState} from './useTooltipTriggerState';\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 {TooltipTriggerProps} from '@react-types/tooltip';\nimport {useEffect, useMemo, useRef} from 'react';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\n\nconst TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design\nconst TOOLTIP_COOLDOWN = 500;\n\nexport interface TooltipTriggerState {\n /** Whether the tooltip is currently showing. */\n isOpen: boolean,\n /**\n * Shows the tooltip. By default, the tooltip becomes visible after a delay\n * depending on a global warmup timer. The `immediate` option shows the\n * tooltip immediately instead.\n */\n open(immediate?: boolean): void,\n /** Hides the tooltip. */\n close(immediate?: boolean): void\n}\n\nlet tooltips = {};\nlet tooltipId = 0;\nlet globalWarmedUp = false;\nlet globalWarmUpTimeout = null;\nlet globalCooldownTimeout = null;\n\n/**\n * Manages state for a tooltip trigger. Tracks whether the tooltip is open, and provides\n * methods to toggle this state. Ensures only one tooltip is open at a time and controls\n * the delay for showing a tooltip.\n */\nexport function useTooltipTriggerState(props: TooltipTriggerProps = {}): TooltipTriggerState {\n let {delay = TOOLTIP_DELAY} = props;\n let {isOpen, open, close} = useOverlayTriggerState(props);\n let id = useMemo(() => `${++tooltipId}`, []);\n let closeTimeout = useRef<ReturnType<typeof setTimeout>>();\n\n let ensureTooltipEntry = () => {\n tooltips[id] = hideTooltip;\n };\n\n let closeOpenTooltips = () => {\n for (let hideTooltipId in tooltips) {\n if (hideTooltipId !== id) {\n tooltips[hideTooltipId](true);\n delete tooltips[hideTooltipId];\n }\n }\n };\n\n let showTooltip = () => {\n clearTimeout(closeTimeout.current);\n closeTimeout.current = null;\n closeOpenTooltips();\n ensureTooltipEntry();\n globalWarmedUp = true;\n open();\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n globalCooldownTimeout = null;\n }\n };\n\n let hideTooltip = (immediate?: boolean) => {\n if (immediate) {\n clearTimeout(closeTimeout.current);\n closeTimeout.current = null;\n close();\n } else if (!closeTimeout.current) {\n closeTimeout.current = setTimeout(() => {\n closeTimeout.current = null;\n close();\n }, TOOLTIP_COOLDOWN);\n }\n\n if (globalWarmUpTimeout) {\n clearTimeout(globalWarmUpTimeout);\n globalWarmUpTimeout = null;\n }\n if (globalWarmedUp) {\n if (globalCooldownTimeout) {\n clearTimeout(globalCooldownTimeout);\n }\n globalCooldownTimeout = setTimeout(() => {\n delete tooltips[id];\n globalCooldownTimeout = null;\n globalWarmedUp = false;\n }, TOOLTIP_COOLDOWN);\n }\n };\n\n let warmupTooltip = () => {\n closeOpenTooltips();\n ensureTooltipEntry();\n if (!isOpen && !globalWarmUpTimeout && !globalWarmedUp) {\n globalWarmUpTimeout = setTimeout(() => {\n globalWarmUpTimeout = null;\n globalWarmedUp = true;\n showTooltip();\n }, delay);\n } else if (!isOpen) {\n showTooltip();\n }\n };\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => {\n clearTimeout(closeTimeout.current);\n let tooltip = tooltips[id];\n if (tooltip) {\n delete tooltips[id];\n }\n };\n }, [id]);\n\n return {\n isOpen,\n open: (immediate) => {\n if (!immediate && delay > 0 && !closeTimeout.current) {\n warmupTooltip();\n } else {\n showTooltip();\n }\n },\n close: hideTooltip\n };\n}\n"],"names":[],"version":3,"file":"module.mjs.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/tooltip",
3
- "version": "3.2.4-nightly.3598+810579b67",
3
+ "version": "3.2.4-nightly.3600+bfce84fee",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,10 +22,10 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@babel/runtime": "^7.6.2",
26
- "@react-stately/overlays": "3.4.4-nightly.3598+810579b67",
27
- "@react-stately/utils": "3.0.0-nightly.1898+810579b67",
28
- "@react-types/tooltip": "3.2.6-nightly.3598+810579b67"
25
+ "@react-stately/overlays": "3.4.4-nightly.3600+bfce84fee",
26
+ "@react-stately/utils": "3.0.0-nightly.1900+bfce84fee",
27
+ "@react-types/tooltip": "3.2.6-nightly.3600+bfce84fee",
28
+ "@swc/helpers": "^0.4.14"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "810579b671791f1593108f62cdc1893de3a220e3"
36
+ "gitHead": "bfce84fee12a027d9cbc38b43e1747e3e4b4b169"
37
37
  }