@zag-js/tooltip 2.0.0-next.3 → 2.0.0-next.4
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 +7 -9
- package/dist/index.d.ts +7 -9
- package/dist/index.js +12 -38
- package/dist/index.mjs +2 -7
- package/dist/tooltip.anatomy.d.mts +2 -6
- package/dist/tooltip.anatomy.d.ts +2 -6
- package/dist/tooltip.anatomy.js +8 -33
- package/dist/tooltip.anatomy.mjs +4 -7
- package/dist/tooltip.connect.d.mts +4 -8
- package/dist/tooltip.connect.d.ts +4 -8
- package/dist/tooltip.connect.js +255 -193
- package/dist/tooltip.connect.mjs +250 -157
- package/dist/tooltip.dom.d.mts +12 -14
- package/dist/tooltip.dom.d.ts +12 -14
- package/dist/tooltip.dom.js +39 -62
- package/dist/tooltip.dom.mjs +25 -28
- package/dist/tooltip.machine.d.mts +2 -8
- package/dist/tooltip.machine.d.ts +2 -8
- package/dist/tooltip.machine.js +606 -479
- package/dist/tooltip.machine.mjs +600 -442
- package/dist/tooltip.props.d.mts +3 -9
- package/dist/tooltip.props.d.ts +3 -9
- package/dist/tooltip.props.js +29 -54
- package/dist/tooltip.props.mjs +25 -28
- package/dist/tooltip.store.d.mts +6 -8
- package/dist/tooltip.store.d.ts +6 -8
- package/dist/tooltip.store.js +14 -33
- package/dist/tooltip.store.mjs +9 -8
- package/dist/tooltip.style.d.mts +22 -0
- package/dist/tooltip.style.d.ts +22 -0
- package/dist/tooltip.style.js +27 -0
- package/dist/tooltip.style.mjs +22 -0
- package/dist/tooltip.types.d.mts +271 -182
- package/dist/tooltip.types.d.ts +271 -182
- package/dist/tooltip.types.js +4 -18
- package/dist/tooltip.types.mjs +1 -0
- package/package.json +10 -10
package/dist/tooltip.props.d.mts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { TooltipProps } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import '@zag-js/types';
|
|
5
|
-
|
|
6
|
-
declare const props: (keyof TooltipProps)[];
|
|
7
|
-
declare const splitProps: <Props extends Partial<TooltipProps>>(props: Props) => [Partial<TooltipProps>, Omit<Props, keyof TooltipProps>];
|
|
8
|
-
|
|
9
|
-
export { props, splitProps };
|
|
1
|
+
import { TooltipProps } from "./tooltip.types.mjs";
|
|
2
|
+
export declare const props: (keyof TooltipProps)[];
|
|
3
|
+
export declare const splitProps: <Props extends Partial<TooltipProps>>(props: Props) => [Partial<TooltipProps>, Omit<Props, keyof TooltipProps>];
|
package/dist/tooltip.props.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { TooltipProps } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import '@zag-js/types';
|
|
5
|
-
|
|
6
|
-
declare const props: (keyof TooltipProps)[];
|
|
7
|
-
declare const splitProps: <Props extends Partial<TooltipProps>>(props: Props) => [Partial<TooltipProps>, Omit<Props, keyof TooltipProps>];
|
|
8
|
-
|
|
9
|
-
export { props, splitProps };
|
|
1
|
+
import { TooltipProps } from "./tooltip.types.js";
|
|
2
|
+
export declare const props: (keyof TooltipProps)[];
|
|
3
|
+
export declare const splitProps: <Props extends Partial<TooltipProps>>(props: Props) => [Partial<TooltipProps>, Omit<Props, keyof TooltipProps>];
|
package/dist/tooltip.props.js
CHANGED
|
@@ -1,56 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/tooltip.props.ts
|
|
21
|
-
var tooltip_props_exports = {};
|
|
22
|
-
__export(tooltip_props_exports, {
|
|
23
|
-
props: () => props,
|
|
24
|
-
splitProps: () => splitProps
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
25
4
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"triggerValue"
|
|
5
|
+
let _zag_js_utils = require("@zag-js/utils");
|
|
6
|
+
// src/tooltip.props.ts
|
|
7
|
+
const props = (0, require("@zag-js/types").createProps)()([
|
|
8
|
+
"aria-label",
|
|
9
|
+
"closeDelay",
|
|
10
|
+
"closeOnClick",
|
|
11
|
+
"closeOnEscape",
|
|
12
|
+
"closeOnPointerDown",
|
|
13
|
+
"closeOnScroll",
|
|
14
|
+
"defaultOpen",
|
|
15
|
+
"defaultTriggerValue",
|
|
16
|
+
"dir",
|
|
17
|
+
"disabled",
|
|
18
|
+
"getRootNode",
|
|
19
|
+
"id",
|
|
20
|
+
"ids",
|
|
21
|
+
"interactive",
|
|
22
|
+
"onOpenChange",
|
|
23
|
+
"onTriggerValueChange",
|
|
24
|
+
"open",
|
|
25
|
+
"openDelay",
|
|
26
|
+
"positioning",
|
|
27
|
+
"triggerValue"
|
|
50
28
|
]);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
props,
|
|
55
|
-
splitProps
|
|
56
|
-
});
|
|
29
|
+
const splitProps = (0, _zag_js_utils.createSplitProps)(props);
|
|
30
|
+
exports.props = props;
|
|
31
|
+
exports.splitProps = splitProps;
|
package/dist/tooltip.props.mjs
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
// src/tooltip.props.ts
|
|
2
|
-
import { createProps } from "@zag-js/types";
|
|
3
1
|
import { createSplitProps } from "@zag-js/utils";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
import { createProps } from "@zag-js/types";
|
|
3
|
+
// src/tooltip.props.ts
|
|
4
|
+
const props = createProps()([
|
|
5
|
+
"aria-label",
|
|
6
|
+
"closeDelay",
|
|
7
|
+
"closeOnClick",
|
|
8
|
+
"closeOnEscape",
|
|
9
|
+
"closeOnPointerDown",
|
|
10
|
+
"closeOnScroll",
|
|
11
|
+
"defaultOpen",
|
|
12
|
+
"defaultTriggerValue",
|
|
13
|
+
"dir",
|
|
14
|
+
"disabled",
|
|
15
|
+
"getRootNode",
|
|
16
|
+
"id",
|
|
17
|
+
"ids",
|
|
18
|
+
"interactive",
|
|
19
|
+
"onOpenChange",
|
|
20
|
+
"onTriggerValueChange",
|
|
21
|
+
"open",
|
|
22
|
+
"openDelay",
|
|
23
|
+
"positioning",
|
|
24
|
+
"triggerValue"
|
|
25
25
|
]);
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
props,
|
|
29
|
-
splitProps
|
|
30
|
-
};
|
|
26
|
+
const splitProps = createSplitProps(props);
|
|
27
|
+
export { props, splitProps };
|
package/dist/tooltip.store.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
instant: boolean;
|
|
1
|
+
export declare const store: import("@zag-js/utils").Store<{
|
|
2
|
+
id: string | null;
|
|
3
|
+
prevId: string | null;
|
|
4
|
+
instant: boolean;
|
|
5
|
+
closedAt: number;
|
|
7
6
|
}>;
|
|
8
|
-
|
|
9
|
-
export { store };
|
|
7
|
+
export declare const isWarm: () => boolean;
|
package/dist/tooltip.store.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
instant: boolean;
|
|
1
|
+
export declare const store: import("@zag-js/utils").Store<{
|
|
2
|
+
id: string | null;
|
|
3
|
+
prevId: string | null;
|
|
4
|
+
instant: boolean;
|
|
5
|
+
closedAt: number;
|
|
7
6
|
}>;
|
|
8
|
-
|
|
9
|
-
export { store };
|
|
7
|
+
export declare const isWarm: () => boolean;
|
package/dist/tooltip.store.js
CHANGED
|
@@ -1,35 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/tooltip.store.ts
|
|
21
|
-
var tooltip_store_exports = {};
|
|
22
|
-
__export(tooltip_store_exports, {
|
|
23
|
-
store: () => store
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(tooltip_store_exports);
|
|
26
|
-
var import_utils = require("@zag-js/utils");
|
|
27
|
-
var store = (0, import_utils.createStore)({
|
|
28
|
-
id: null,
|
|
29
|
-
prevId: null,
|
|
30
|
-
instant: false
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
31
4
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
5
|
+
let _zag_js_utils = require("@zag-js/utils");
|
|
6
|
+
// src/tooltip.store.ts
|
|
7
|
+
const SKIP_DELAY_WINDOW = 400;
|
|
8
|
+
const store = (0, _zag_js_utils.createStore)({
|
|
9
|
+
id: null,
|
|
10
|
+
prevId: null,
|
|
11
|
+
instant: false,
|
|
12
|
+
closedAt: 0
|
|
35
13
|
});
|
|
14
|
+
const isWarm = () => store.get("id") !== null || Date.now() - store.get("closedAt") < SKIP_DELAY_WINDOW;
|
|
15
|
+
exports.isWarm = isWarm;
|
|
16
|
+
exports.store = store;
|
package/dist/tooltip.store.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// src/tooltip.store.ts
|
|
2
1
|
import { createStore } from "@zag-js/utils";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
// src/tooltip.store.ts
|
|
3
|
+
const SKIP_DELAY_WINDOW = 400;
|
|
4
|
+
const store = createStore({
|
|
5
|
+
id: null,
|
|
6
|
+
prevId: null,
|
|
7
|
+
instant: false,
|
|
8
|
+
closedAt: 0
|
|
7
9
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
10
|
+
const isWarm = () => store.get("id") !== null || Date.now() - store.get("closedAt") < SKIP_DELAY_WINDOW;
|
|
11
|
+
export { isWarm, store };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ViewportSize } from "./tooltip.types.mjs";
|
|
2
|
+
import { PlacementSide } from "@zag-js/popper";
|
|
3
|
+
export declare function getViewportSizeStyle(size: ViewportSize | null): {
|
|
4
|
+
"--viewport-width"?: never;
|
|
5
|
+
"--viewport-height"?: never;
|
|
6
|
+
width?: never;
|
|
7
|
+
height?: never;
|
|
8
|
+
} | {
|
|
9
|
+
"--viewport-width": string;
|
|
10
|
+
"--viewport-height": string;
|
|
11
|
+
width: string;
|
|
12
|
+
height: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function getViewportStyle(side: PlacementSide | undefined): {
|
|
15
|
+
readonly position: "absolute";
|
|
16
|
+
readonly width: "var(--viewport-width)";
|
|
17
|
+
readonly height: "var(--viewport-height)";
|
|
18
|
+
readonly top: "0px" | undefined;
|
|
19
|
+
readonly bottom: "0px" | undefined;
|
|
20
|
+
readonly left: "0px" | undefined;
|
|
21
|
+
readonly right: "0px" | undefined;
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ViewportSize } from "./tooltip.types.js";
|
|
2
|
+
import { PlacementSide } from "@zag-js/popper";
|
|
3
|
+
export declare function getViewportSizeStyle(size: ViewportSize | null): {
|
|
4
|
+
"--viewport-width"?: never;
|
|
5
|
+
"--viewport-height"?: never;
|
|
6
|
+
width?: never;
|
|
7
|
+
height?: never;
|
|
8
|
+
} | {
|
|
9
|
+
"--viewport-width": string;
|
|
10
|
+
"--viewport-height": string;
|
|
11
|
+
width: string;
|
|
12
|
+
height: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function getViewportStyle(side: PlacementSide | undefined): {
|
|
15
|
+
readonly position: "absolute";
|
|
16
|
+
readonly width: "var(--viewport-width)";
|
|
17
|
+
readonly height: "var(--viewport-height)";
|
|
18
|
+
readonly top: "0px" | undefined;
|
|
19
|
+
readonly bottom: "0px" | undefined;
|
|
20
|
+
readonly left: "0px" | undefined;
|
|
21
|
+
readonly right: "0px" | undefined;
|
|
22
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
// src/tooltip.style.ts
|
|
6
|
+
function getViewportSizeStyle(size) {
|
|
7
|
+
if (!size) return {};
|
|
8
|
+
return {
|
|
9
|
+
"--viewport-width": `${size.width}px`,
|
|
10
|
+
"--viewport-height": `${size.height}px`,
|
|
11
|
+
width: "var(--viewport-width)",
|
|
12
|
+
height: "var(--viewport-height)"
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function getViewportStyle(side) {
|
|
16
|
+
return {
|
|
17
|
+
position: "absolute",
|
|
18
|
+
width: "var(--viewport-width)",
|
|
19
|
+
height: "var(--viewport-height)",
|
|
20
|
+
top: side === "top" ? void 0 : "0px",
|
|
21
|
+
bottom: side === "top" ? "0px" : void 0,
|
|
22
|
+
left: side === "left" ? void 0 : "0px",
|
|
23
|
+
right: side === "left" ? "0px" : void 0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.getViewportSizeStyle = getViewportSizeStyle;
|
|
27
|
+
exports.getViewportStyle = getViewportStyle;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/tooltip.style.ts
|
|
2
|
+
function getViewportSizeStyle(size) {
|
|
3
|
+
if (!size) return {};
|
|
4
|
+
return {
|
|
5
|
+
"--viewport-width": `${size.width}px`,
|
|
6
|
+
"--viewport-height": `${size.height}px`,
|
|
7
|
+
width: "var(--viewport-width)",
|
|
8
|
+
height: "var(--viewport-height)"
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function getViewportStyle(side) {
|
|
12
|
+
return {
|
|
13
|
+
position: "absolute",
|
|
14
|
+
width: "var(--viewport-width)",
|
|
15
|
+
height: "var(--viewport-height)",
|
|
16
|
+
top: side === "top" ? void 0 : "0px",
|
|
17
|
+
bottom: side === "top" ? "0px" : void 0,
|
|
18
|
+
left: side === "left" ? void 0 : "0px",
|
|
19
|
+
right: side === "left" ? "0px" : void 0
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export { getViewportSizeStyle, getViewportStyle };
|