@zag-js/tooltip 1.34.1 → 1.35.1
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.mts +8 -129
- package/dist/index.d.ts +8 -129
- package/dist/index.js +36 -533
- package/dist/index.mjs +10 -530
- package/dist/tooltip.anatomy.d.mts +6 -0
- package/dist/tooltip.anatomy.d.ts +6 -0
- package/dist/tooltip.anatomy.js +34 -0
- package/dist/tooltip.anatomy.mjs +8 -0
- package/dist/tooltip.connect.d.mts +8 -0
- package/dist/tooltip.connect.d.ts +8 -0
- package/dist/tooltip.connect.js +177 -0
- package/dist/tooltip.connect.mjs +142 -0
- package/dist/tooltip.dom.d.mts +12 -0
- package/dist/tooltip.dom.d.ts +12 -0
- package/dist/tooltip.dom.js +51 -0
- package/dist/tooltip.dom.mjs +19 -0
- package/dist/tooltip.machine.d.mts +8 -0
- package/dist/tooltip.machine.d.ts +8 -0
- package/dist/tooltip.machine.js +396 -0
- package/dist/tooltip.machine.mjs +361 -0
- package/dist/tooltip.props.d.mts +9 -0
- package/dist/tooltip.props.d.ts +9 -0
- package/dist/tooltip.props.js +53 -0
- package/dist/tooltip.props.mjs +27 -0
- package/dist/tooltip.store.d.mts +9 -0
- package/dist/tooltip.store.d.ts +9 -0
- package/dist/tooltip.store.js +35 -0
- package/dist/tooltip.store.mjs +10 -0
- package/dist/tooltip.types.d.mts +119 -0
- package/dist/tooltip.types.d.ts +119 -0
- package/dist/tooltip.types.js +18 -0
- package/dist/tooltip.types.mjs +0 -0
- package/package.json +19 -9
package/dist/index.d.mts
CHANGED
|
@@ -1,130 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export { anatomy } from './tooltip.anatomy.mjs';
|
|
2
|
+
export { connect } from './tooltip.connect.mjs';
|
|
3
|
+
export { machine } from './tooltip.machine.mjs';
|
|
4
|
+
export { props, splitProps } from './tooltip.props.mjs';
|
|
5
|
+
export { TooltipApi as Api, ElementIds, TooltipMachine as Machine, OpenChangeDetails, TooltipProps as Props, TooltipService as Service } from './tooltip.types.mjs';
|
|
6
6
|
export { Placement, PositioningOptions } from '@zag-js/popper';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
interface OpenChangeDetails {
|
|
11
|
-
open: boolean;
|
|
12
|
-
}
|
|
13
|
-
type ElementIds = Partial<{
|
|
14
|
-
trigger: string;
|
|
15
|
-
content: string;
|
|
16
|
-
arrow: string;
|
|
17
|
-
positioner: string;
|
|
18
|
-
}>;
|
|
19
|
-
interface TooltipProps extends DirectionProperty, CommonProperties {
|
|
20
|
-
/**
|
|
21
|
-
* The ids of the elements in the tooltip. Useful for composition.
|
|
22
|
-
*/
|
|
23
|
-
ids?: ElementIds | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* The open delay of the tooltip.
|
|
26
|
-
* @default 400
|
|
27
|
-
*/
|
|
28
|
-
openDelay?: number | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* The close delay of the tooltip.
|
|
31
|
-
* @default 150
|
|
32
|
-
*/
|
|
33
|
-
closeDelay?: number | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Whether to close the tooltip on pointerdown.
|
|
36
|
-
* @default true
|
|
37
|
-
*/
|
|
38
|
-
closeOnPointerDown?: boolean | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Whether to close the tooltip when the Escape key is pressed.
|
|
41
|
-
* @default true
|
|
42
|
-
*/
|
|
43
|
-
closeOnEscape?: boolean | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Whether the tooltip should close on scroll
|
|
46
|
-
* @default true
|
|
47
|
-
*/
|
|
48
|
-
closeOnScroll?: boolean | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Whether the tooltip should close on click
|
|
51
|
-
* @default true
|
|
52
|
-
*/
|
|
53
|
-
closeOnClick?: boolean | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Whether the tooltip's content is interactive.
|
|
56
|
-
* In this mode, the tooltip will remain open when user hovers over the content.
|
|
57
|
-
* @see https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus
|
|
58
|
-
*
|
|
59
|
-
* @default false
|
|
60
|
-
*/
|
|
61
|
-
interactive?: boolean | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Function called when the tooltip is opened.
|
|
64
|
-
*/
|
|
65
|
-
onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Custom label for the tooltip.
|
|
68
|
-
*/
|
|
69
|
-
"aria-label"?: string | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* The user provided options used to position the popover content
|
|
72
|
-
*/
|
|
73
|
-
positioning?: PositioningOptions | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Whether the tooltip is disabled
|
|
76
|
-
*/
|
|
77
|
-
disabled?: boolean | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* The controlled open state of the tooltip
|
|
80
|
-
*/
|
|
81
|
-
open?: boolean | undefined;
|
|
82
|
-
/**
|
|
83
|
-
* The initial open state of the tooltip when rendered.
|
|
84
|
-
* Use when you don't need to control the open state of the tooltip.
|
|
85
|
-
*/
|
|
86
|
-
defaultOpen?: boolean | undefined;
|
|
87
|
-
}
|
|
88
|
-
type PropsWithDefault = "openDelay" | "closeDelay" | "closeOnPointerDown" | "closeOnEscape" | "closeOnScroll" | "closeOnClick" | "interactive" | "id" | "positioning";
|
|
89
|
-
interface TooltipSchema {
|
|
90
|
-
state: "open" | "closed" | "opening" | "closing";
|
|
91
|
-
props: RequiredBy<TooltipProps, PropsWithDefault>;
|
|
92
|
-
context: {
|
|
93
|
-
currentPlacement: Placement | undefined;
|
|
94
|
-
hasPointerMoveOpened: boolean;
|
|
95
|
-
};
|
|
96
|
-
event: EventObject;
|
|
97
|
-
action: string;
|
|
98
|
-
effect: string;
|
|
99
|
-
guard: string;
|
|
100
|
-
}
|
|
101
|
-
type TooltipService = Service<TooltipSchema>;
|
|
102
|
-
type TooltipMachine = Machine<TooltipSchema>;
|
|
103
|
-
interface TooltipApi<T extends PropTypes = PropTypes> {
|
|
104
|
-
/**
|
|
105
|
-
* Whether the tooltip is open.
|
|
106
|
-
*/
|
|
107
|
-
open: boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Function to open the tooltip.
|
|
110
|
-
*/
|
|
111
|
-
setOpen: (open: boolean) => void;
|
|
112
|
-
/**
|
|
113
|
-
* Function to reposition the popover
|
|
114
|
-
*/
|
|
115
|
-
reposition: (options?: Partial<PositioningOptions>) => void;
|
|
116
|
-
getTriggerProps: () => T["button"];
|
|
117
|
-
getArrowProps: () => T["element"];
|
|
118
|
-
getArrowTipProps: () => T["element"];
|
|
119
|
-
getPositionerProps: () => T["element"];
|
|
120
|
-
getContentProps: () => T["element"];
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
declare function connect<P extends PropTypes>(service: Service<TooltipSchema>, normalize: NormalizeProps<P>): TooltipApi<P>;
|
|
124
|
-
|
|
125
|
-
declare const machine: _zag_js_core.Machine<TooltipSchema>;
|
|
126
|
-
|
|
127
|
-
declare const props: (keyof TooltipProps)[];
|
|
128
|
-
declare const splitProps: <Props extends Partial<TooltipProps>>(props: Props) => [Partial<TooltipProps>, Omit<Props, keyof TooltipProps>];
|
|
129
|
-
|
|
130
|
-
export { type TooltipApi as Api, type ElementIds, type TooltipMachine as Machine, type OpenChangeDetails, type TooltipProps as Props, type TooltipService as Service, anatomy, connect, machine, props, splitProps };
|
|
7
|
+
import '@zag-js/anatomy';
|
|
8
|
+
import '@zag-js/core';
|
|
9
|
+
import '@zag-js/types';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,130 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export { anatomy } from './tooltip.anatomy.js';
|
|
2
|
+
export { connect } from './tooltip.connect.js';
|
|
3
|
+
export { machine } from './tooltip.machine.js';
|
|
4
|
+
export { props, splitProps } from './tooltip.props.js';
|
|
5
|
+
export { TooltipApi as Api, ElementIds, TooltipMachine as Machine, OpenChangeDetails, TooltipProps as Props, TooltipService as Service } from './tooltip.types.js';
|
|
6
6
|
export { Placement, PositioningOptions } from '@zag-js/popper';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
interface OpenChangeDetails {
|
|
11
|
-
open: boolean;
|
|
12
|
-
}
|
|
13
|
-
type ElementIds = Partial<{
|
|
14
|
-
trigger: string;
|
|
15
|
-
content: string;
|
|
16
|
-
arrow: string;
|
|
17
|
-
positioner: string;
|
|
18
|
-
}>;
|
|
19
|
-
interface TooltipProps extends DirectionProperty, CommonProperties {
|
|
20
|
-
/**
|
|
21
|
-
* The ids of the elements in the tooltip. Useful for composition.
|
|
22
|
-
*/
|
|
23
|
-
ids?: ElementIds | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* The open delay of the tooltip.
|
|
26
|
-
* @default 400
|
|
27
|
-
*/
|
|
28
|
-
openDelay?: number | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* The close delay of the tooltip.
|
|
31
|
-
* @default 150
|
|
32
|
-
*/
|
|
33
|
-
closeDelay?: number | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Whether to close the tooltip on pointerdown.
|
|
36
|
-
* @default true
|
|
37
|
-
*/
|
|
38
|
-
closeOnPointerDown?: boolean | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Whether to close the tooltip when the Escape key is pressed.
|
|
41
|
-
* @default true
|
|
42
|
-
*/
|
|
43
|
-
closeOnEscape?: boolean | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Whether the tooltip should close on scroll
|
|
46
|
-
* @default true
|
|
47
|
-
*/
|
|
48
|
-
closeOnScroll?: boolean | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Whether the tooltip should close on click
|
|
51
|
-
* @default true
|
|
52
|
-
*/
|
|
53
|
-
closeOnClick?: boolean | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Whether the tooltip's content is interactive.
|
|
56
|
-
* In this mode, the tooltip will remain open when user hovers over the content.
|
|
57
|
-
* @see https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus
|
|
58
|
-
*
|
|
59
|
-
* @default false
|
|
60
|
-
*/
|
|
61
|
-
interactive?: boolean | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Function called when the tooltip is opened.
|
|
64
|
-
*/
|
|
65
|
-
onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Custom label for the tooltip.
|
|
68
|
-
*/
|
|
69
|
-
"aria-label"?: string | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* The user provided options used to position the popover content
|
|
72
|
-
*/
|
|
73
|
-
positioning?: PositioningOptions | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Whether the tooltip is disabled
|
|
76
|
-
*/
|
|
77
|
-
disabled?: boolean | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* The controlled open state of the tooltip
|
|
80
|
-
*/
|
|
81
|
-
open?: boolean | undefined;
|
|
82
|
-
/**
|
|
83
|
-
* The initial open state of the tooltip when rendered.
|
|
84
|
-
* Use when you don't need to control the open state of the tooltip.
|
|
85
|
-
*/
|
|
86
|
-
defaultOpen?: boolean | undefined;
|
|
87
|
-
}
|
|
88
|
-
type PropsWithDefault = "openDelay" | "closeDelay" | "closeOnPointerDown" | "closeOnEscape" | "closeOnScroll" | "closeOnClick" | "interactive" | "id" | "positioning";
|
|
89
|
-
interface TooltipSchema {
|
|
90
|
-
state: "open" | "closed" | "opening" | "closing";
|
|
91
|
-
props: RequiredBy<TooltipProps, PropsWithDefault>;
|
|
92
|
-
context: {
|
|
93
|
-
currentPlacement: Placement | undefined;
|
|
94
|
-
hasPointerMoveOpened: boolean;
|
|
95
|
-
};
|
|
96
|
-
event: EventObject;
|
|
97
|
-
action: string;
|
|
98
|
-
effect: string;
|
|
99
|
-
guard: string;
|
|
100
|
-
}
|
|
101
|
-
type TooltipService = Service<TooltipSchema>;
|
|
102
|
-
type TooltipMachine = Machine<TooltipSchema>;
|
|
103
|
-
interface TooltipApi<T extends PropTypes = PropTypes> {
|
|
104
|
-
/**
|
|
105
|
-
* Whether the tooltip is open.
|
|
106
|
-
*/
|
|
107
|
-
open: boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Function to open the tooltip.
|
|
110
|
-
*/
|
|
111
|
-
setOpen: (open: boolean) => void;
|
|
112
|
-
/**
|
|
113
|
-
* Function to reposition the popover
|
|
114
|
-
*/
|
|
115
|
-
reposition: (options?: Partial<PositioningOptions>) => void;
|
|
116
|
-
getTriggerProps: () => T["button"];
|
|
117
|
-
getArrowProps: () => T["element"];
|
|
118
|
-
getArrowTipProps: () => T["element"];
|
|
119
|
-
getPositionerProps: () => T["element"];
|
|
120
|
-
getContentProps: () => T["element"];
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
declare function connect<P extends PropTypes>(service: Service<TooltipSchema>, normalize: NormalizeProps<P>): TooltipApi<P>;
|
|
124
|
-
|
|
125
|
-
declare const machine: _zag_js_core.Machine<TooltipSchema>;
|
|
126
|
-
|
|
127
|
-
declare const props: (keyof TooltipProps)[];
|
|
128
|
-
declare const splitProps: <Props extends Partial<TooltipProps>>(props: Props) => [Partial<TooltipProps>, Omit<Props, keyof TooltipProps>];
|
|
129
|
-
|
|
130
|
-
export { type TooltipApi as Api, type ElementIds, type TooltipMachine as Machine, type OpenChangeDetails, type TooltipProps as Props, type TooltipService as Service, anatomy, connect, machine, props, splitProps };
|
|
7
|
+
import '@zag-js/anatomy';
|
|
8
|
+
import '@zag-js/core';
|
|
9
|
+
import '@zag-js/types';
|