@react-stately/tooltip
Advanced tools
Comparing version 3.0.0-nightly.2375 to 3.0.0-nightly.2376
@@ -6,15 +6,11 @@ var { | ||
var { | ||
useId | ||
} = require("@react-aria/utils"); | ||
var { | ||
useEffect | ||
useEffect, | ||
useMemo | ||
} = require("react"); | ||
const TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design | ||
const $dbf206483fc3f3f5862f69116107e0c$var$TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design | ||
exports.TOOLTIP_DELAY = TOOLTIP_DELAY; | ||
const TOOLTIP_COOLDOWN = 500; | ||
exports.TOOLTIP_COOLDOWN = TOOLTIP_COOLDOWN; | ||
const $dbf206483fc3f3f5862f69116107e0c$var$TOOLTIP_COOLDOWN = 500; | ||
let $dbf206483fc3f3f5862f69116107e0c$var$tooltips = {}; | ||
let $dbf206483fc3f3f5862f69116107e0c$var$tooltipId = 0; | ||
let $dbf206483fc3f3f5862f69116107e0c$var$globalWarmedUp = false; | ||
@@ -26,3 +22,3 @@ let $dbf206483fc3f3f5862f69116107e0c$var$globalWarmUpTimeout = null; | ||
let { | ||
delay = TOOLTIP_DELAY | ||
delay = $dbf206483fc3f3f5862f69116107e0c$var$TOOLTIP_DELAY | ||
} = props; | ||
@@ -33,6 +29,5 @@ let { | ||
close | ||
} = useOverlayTriggerState(props); // this is a unique id for the tooltips in the map, it's not a dom id | ||
} = useOverlayTriggerState(props); | ||
let id = useMemo(() => "" + ++$dbf206483fc3f3f5862f69116107e0c$var$tooltipId, []); | ||
let id = useId(); | ||
let ensureTooltipEntry = () => { | ||
@@ -85,3 +80,3 @@ $dbf206483fc3f3f5862f69116107e0c$var$tooltips[id] = hideTooltip; | ||
$dbf206483fc3f3f5862f69116107e0c$var$globalWarmedUp = false; | ||
}, TOOLTIP_COOLDOWN); | ||
}, $dbf206483fc3f3f5862f69116107e0c$var$TOOLTIP_COOLDOWN); | ||
} | ||
@@ -99,3 +94,3 @@ }; | ||
showTooltip(); | ||
}, TOOLTIP_DELAY); | ||
}, $dbf206483fc3f3f5862f69116107e0c$var$TOOLTIP_DELAY); | ||
} else if (!isOpen) { | ||
@@ -102,0 +97,0 @@ showTooltip(); |
import { useOverlayTriggerState } from "@react-stately/overlays"; | ||
import { useId } from "@react-aria/utils"; | ||
import { useEffect } from "react"; | ||
export const TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design | ||
import { useEffect, useMemo } from "react"; | ||
const $af9cde49ea815e766aeca6386e9$var$TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design | ||
export const TOOLTIP_COOLDOWN = 500; | ||
const $af9cde49ea815e766aeca6386e9$var$TOOLTIP_COOLDOWN = 500; | ||
let $af9cde49ea815e766aeca6386e9$var$tooltips = {}; | ||
let $af9cde49ea815e766aeca6386e9$var$tooltipId = 0; | ||
let $af9cde49ea815e766aeca6386e9$var$globalWarmedUp = false; | ||
@@ -13,3 +13,3 @@ let $af9cde49ea815e766aeca6386e9$var$globalWarmUpTimeout = null; | ||
let { | ||
delay = TOOLTIP_DELAY | ||
delay = $af9cde49ea815e766aeca6386e9$var$TOOLTIP_DELAY | ||
} = props; | ||
@@ -20,6 +20,5 @@ let { | ||
close | ||
} = useOverlayTriggerState(props); // this is a unique id for the tooltips in the map, it's not a dom id | ||
} = useOverlayTriggerState(props); | ||
let id = useMemo(() => "" + ++$af9cde49ea815e766aeca6386e9$var$tooltipId, []); | ||
let id = useId(); | ||
let ensureTooltipEntry = () => { | ||
@@ -72,3 +71,3 @@ $af9cde49ea815e766aeca6386e9$var$tooltips[id] = hideTooltip; | ||
$af9cde49ea815e766aeca6386e9$var$globalWarmedUp = false; | ||
}, TOOLTIP_COOLDOWN); | ||
}, $af9cde49ea815e766aeca6386e9$var$TOOLTIP_COOLDOWN); | ||
} | ||
@@ -86,3 +85,3 @@ }; | ||
showTooltip(); | ||
}, TOOLTIP_DELAY); | ||
}, $af9cde49ea815e766aeca6386e9$var$TOOLTIP_DELAY); | ||
} else if (!isOpen) { | ||
@@ -89,0 +88,0 @@ showTooltip(); |
import { TooltipTriggerProps } from "@react-types/tooltip"; | ||
export const TOOLTIP_DELAY = 1500; | ||
export const TOOLTIP_COOLDOWN = 500; | ||
interface TooltipTriggerStateProps extends TooltipTriggerProps { | ||
} | ||
export interface TooltipTriggerState { | ||
@@ -11,4 +7,4 @@ isOpen: boolean; | ||
} | ||
export function useTooltipTriggerState(props: TooltipTriggerStateProps): TooltipTriggerState; | ||
export function useTooltipTriggerState(props: TooltipTriggerProps): TooltipTriggerState; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@react-stately/tooltip", | ||
"version": "3.0.0-nightly.2375+b8e7a96e", | ||
"version": "3.0.0-nightly.2376+1aa1058d", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,6 +21,5 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/utils": "3.0.0-nightly.697+b8e7a96e", | ||
"@react-stately/overlays": "3.1.1-nightly.2375+b8e7a96e", | ||
"@react-stately/utils": "3.0.0-nightly.697+b8e7a96e", | ||
"@react-types/tooltip": "3.0.0-nightly.2375+b8e7a96e" | ||
"@react-stately/overlays": "3.1.1-nightly.2376+1aa1058d", | ||
"@react-stately/utils": "3.0.0-nightly.698+1aa1058d", | ||
"@react-types/tooltip": "3.0.0-nightly.2376+1aa1058d" | ||
}, | ||
@@ -33,3 +32,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "b8e7a96e0b55f9875146f58484f97a1d9c1b04d8" | ||
"gitHead": "1aa1058d2bef892d4ecf411cfaeec5ba24440cde" | ||
} |
@@ -14,11 +14,8 @@ /* | ||
import {TooltipTriggerProps} from '@react-types/tooltip'; | ||
import {useEffect} from 'react'; | ||
import {useId} from '@react-aria/utils'; | ||
import {useEffect, useMemo} from 'react'; | ||
import {useOverlayTriggerState} from '@react-stately/overlays'; | ||
export const TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design | ||
export const TOOLTIP_COOLDOWN = 500; | ||
const TOOLTIP_DELAY = 1500; // this seems to be a 1.5 second delay, check with design | ||
const TOOLTIP_COOLDOWN = 500; | ||
interface TooltipTriggerStateProps extends TooltipTriggerProps {} | ||
export interface TooltipTriggerState { | ||
@@ -31,2 +28,3 @@ isOpen: boolean, | ||
let tooltips = {}; | ||
let tooltipId = 0; | ||
let globalWarmedUp = false; | ||
@@ -36,8 +34,6 @@ let globalWarmUpTimeout = null; | ||
export function useTooltipTriggerState(props: TooltipTriggerStateProps): TooltipTriggerState { | ||
export function useTooltipTriggerState(props: TooltipTriggerProps): TooltipTriggerState { | ||
let {delay = TOOLTIP_DELAY} = props; | ||
let {isOpen, open, close} = useOverlayTriggerState(props); | ||
// this is a unique id for the tooltips in the map, it's not a dom id | ||
let id = useId(); | ||
let id = useMemo(() => `${++tooltipId}`, []); | ||
@@ -44,0 +40,0 @@ let ensureTooltipEntry = () => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
5
37159
328