@primitiv-ui/core 0.1.55 → 0.1.56
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/tooltip/policy.d.ts +18 -0
- package/dist/tooltip/policy.js +13 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export { collapsibleKeydown, collapsibleToggle, type CollapsibleKeyOutcome, type
|
|
|
7
7
|
export { FOCUSABLE_SELECTOR } from "./focus/focusable.js";
|
|
8
8
|
export { modalPointerOutside, modalTabKeydown, type ModalBox, type ModalTabOutcome, type ModalTabState, } from "./modal/policy.js";
|
|
9
9
|
export { popoverKeydown, popoverPressDismisses, type PopoverKeyOutcome, type PopoverPress, } from "./popover/policy.js";
|
|
10
|
+
export { TOOLTIP_GRACE_MS, tooltipOpenDelay, type TooltipDelayState } from "./tooltip/policy.js";
|
package/dist/index.js
CHANGED
|
@@ -7,3 +7,4 @@ export { collapsibleKeydown, collapsibleToggle, } from "./collapsible/policy.js"
|
|
|
7
7
|
export { FOCUSABLE_SELECTOR } from "./focus/focusable.js";
|
|
8
8
|
export { modalPointerOutside, modalTabKeydown, } from "./modal/policy.js";
|
|
9
9
|
export { popoverKeydown, popoverPressDismisses, } from "./popover/policy.js";
|
|
10
|
+
export { TOOLTIP_GRACE_MS, tooltipOpenDelay } from "./tooltip/policy.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long the pointer has, after leaving a tooltip's trigger, to cross onto
|
|
3
|
+
* the tooltip itself before it closes — so hoverable content can be reached.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TOOLTIP_GRACE_MS: number;
|
|
6
|
+
/** What the open delay depends on. */
|
|
7
|
+
export type TooltipDelayState = {
|
|
8
|
+
/** Whether a tooltip in the same group closed within the group's skip-delay window. */
|
|
9
|
+
groupOpen: boolean;
|
|
10
|
+
/** The delay before opening on hover, in milliseconds. */
|
|
11
|
+
delay: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The delay before a hovered tooltip opens: its own delay, or none while the
|
|
15
|
+
* group is still in its skip-delay window — so moving along a row of triggers
|
|
16
|
+
* opens each next tooltip at once rather than waiting every time.
|
|
17
|
+
*/
|
|
18
|
+
export declare function tooltipOpenDelay({ groupOpen, delay }: TooltipDelayState): number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long the pointer has, after leaving a tooltip's trigger, to cross onto
|
|
3
|
+
* the tooltip itself before it closes — so hoverable content can be reached.
|
|
4
|
+
*/
|
|
5
|
+
export const TOOLTIP_GRACE_MS = 100;
|
|
6
|
+
/**
|
|
7
|
+
* The delay before a hovered tooltip opens: its own delay, or none while the
|
|
8
|
+
* group is still in its skip-delay window — so moving along a row of triggers
|
|
9
|
+
* opens each next tooltip at once rather than waiting every time.
|
|
10
|
+
*/
|
|
11
|
+
export function tooltipOpenDelay({ groupOpen, delay }) {
|
|
12
|
+
return groupOpen ? 0 : delay;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitiv-ui/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.56",
|
|
4
4
|
"description": "The framework-free behaviour core shared by every Primitiv surface — keyboard maps, roving-focus targets, id derivation and per-component policy, as pure functions with no DOM and no dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|