@zag-js/tooltip 0.1.9 → 0.1.12
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/LICENSE +21 -0
- package/dist/index.d.ts +93 -3
- package/dist/index.js +250 -272
- package/dist/index.mjs +246 -276
- package/package.json +15 -11
- package/dist/tooltip.connect.d.ts +0 -18
- package/dist/tooltip.dom.d.ts +0 -18
- package/dist/tooltip.machine.d.ts +0 -2
- package/dist/tooltip.store.d.ts +0 -8
- package/dist/tooltip.types.d.ts +0 -82
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
2
|
-
import type { Send, State } from "./tooltip.types";
|
|
3
|
-
export declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
open(): void;
|
|
6
|
-
close(): void;
|
|
7
|
-
getAnimationState(): {
|
|
8
|
-
enter: boolean;
|
|
9
|
-
exit: boolean;
|
|
10
|
-
};
|
|
11
|
-
triggerProps: T["button"];
|
|
12
|
-
arrowProps: T["element"];
|
|
13
|
-
innerArrowProps: T["element"];
|
|
14
|
-
positionerProps: T["element"];
|
|
15
|
-
contentProps: T["element"];
|
|
16
|
-
labelProps: T["element"];
|
|
17
|
-
createPortal(): HTMLElement;
|
|
18
|
-
};
|
package/dist/tooltip.dom.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { MachineContext as Ctx } from "./tooltip.types";
|
|
2
|
-
export declare const dom: {
|
|
3
|
-
getDoc: (ctx: Ctx) => Document;
|
|
4
|
-
getWin: (ctx: Ctx) => Window & typeof globalThis;
|
|
5
|
-
getRootNode: (ctx: Ctx) => Document | ShadowRoot;
|
|
6
|
-
getTriggerId: (ctx: Ctx) => string;
|
|
7
|
-
getContentId: (ctx: Ctx) => string;
|
|
8
|
-
getArrowId: (ctx: Ctx) => string;
|
|
9
|
-
getPositionerId: (ctx: Ctx) => string;
|
|
10
|
-
portalId: string;
|
|
11
|
-
getTriggerEl: (ctx: Ctx) => HTMLElement;
|
|
12
|
-
getContentEl: (ctx: Ctx) => HTMLElement;
|
|
13
|
-
getPositionerEl: (ctx: Ctx) => HTMLElement;
|
|
14
|
-
getArrowEl: (ctx: Ctx) => HTMLElement;
|
|
15
|
-
getScrollParent: (ctx: Ctx) => HTMLElement;
|
|
16
|
-
getPortalEl: (ctx: Ctx) => HTMLElement;
|
|
17
|
-
createPortalEl: (ctx: Ctx) => HTMLElement;
|
|
18
|
-
};
|
package/dist/tooltip.store.d.ts
DELETED
package/dist/tooltip.types.d.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { StateMachine as S } from "@zag-js/core";
|
|
2
|
-
import type { Placement, PositioningOptions } from "@zag-js/popper";
|
|
3
|
-
import type { RootProperties } from "@zag-js/types";
|
|
4
|
-
declare type ElementIds = Partial<{
|
|
5
|
-
trigger: string;
|
|
6
|
-
content: string;
|
|
7
|
-
}>;
|
|
8
|
-
declare type PublicContext = {
|
|
9
|
-
/**
|
|
10
|
-
* The ids of the elements in the tooltip. Useful for composition.
|
|
11
|
-
*/
|
|
12
|
-
ids?: ElementIds;
|
|
13
|
-
/**
|
|
14
|
-
* The `id` of the tooltip.
|
|
15
|
-
*/
|
|
16
|
-
id: string;
|
|
17
|
-
/**
|
|
18
|
-
* The open delay of the tooltip.
|
|
19
|
-
*/
|
|
20
|
-
openDelay: number;
|
|
21
|
-
/**
|
|
22
|
-
* The close delay of the tooltip.
|
|
23
|
-
*/
|
|
24
|
-
closeDelay: number;
|
|
25
|
-
/**
|
|
26
|
-
* Whether to close the tooltip on pointerdown.
|
|
27
|
-
*/
|
|
28
|
-
closeOnPointerDown: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Whether to close the tooltip when the Escape key is pressed.
|
|
31
|
-
*/
|
|
32
|
-
closeOnEsc?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Whether the tooltip's content is interactive.
|
|
35
|
-
* In this mode, the tooltip will remain open when user hovers over the content.
|
|
36
|
-
* @see https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus
|
|
37
|
-
*/
|
|
38
|
-
interactive: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Function called when the tooltip is opened.
|
|
41
|
-
*/
|
|
42
|
-
onOpen?: VoidFunction;
|
|
43
|
-
/**
|
|
44
|
-
* Function called when the tooltip is closed.
|
|
45
|
-
*/
|
|
46
|
-
onClose?: VoidFunction;
|
|
47
|
-
/**
|
|
48
|
-
* Custom label for the tooltip.
|
|
49
|
-
*/
|
|
50
|
-
"aria-label"?: string;
|
|
51
|
-
/**
|
|
52
|
-
* The user provided options used to position the popover content
|
|
53
|
-
*/
|
|
54
|
-
positioning: PositioningOptions;
|
|
55
|
-
};
|
|
56
|
-
export declare type UserDefinedContext = Partial<PublicContext>;
|
|
57
|
-
declare type ComputedContext = Readonly<{
|
|
58
|
-
/**
|
|
59
|
-
* @computed Whether an `aria-label` is set.
|
|
60
|
-
*/
|
|
61
|
-
readonly hasAriaLabel: boolean;
|
|
62
|
-
}>;
|
|
63
|
-
declare type PrivateContext = RootProperties & {
|
|
64
|
-
/**
|
|
65
|
-
* @internal
|
|
66
|
-
* The computed placement of the tooltip.
|
|
67
|
-
*/
|
|
68
|
-
currentPlacement?: Placement;
|
|
69
|
-
/**
|
|
70
|
-
* @internal
|
|
71
|
-
* Whether the dynamic placement has been computed
|
|
72
|
-
*/
|
|
73
|
-
isPlacementComplete?: boolean;
|
|
74
|
-
};
|
|
75
|
-
export declare type MachineContext = PublicContext & ComputedContext & PrivateContext;
|
|
76
|
-
export declare type MachineState = {
|
|
77
|
-
value: "unknown" | "opening" | "open" | "closing" | "closed";
|
|
78
|
-
tags: "open" | "closed";
|
|
79
|
-
};
|
|
80
|
-
export declare type State = S.State<MachineContext, MachineState>;
|
|
81
|
-
export declare type Send = S.Send<S.AnyEventObject>;
|
|
82
|
-
export {};
|