@zag-js/tooltip 0.2.0 → 0.2.2
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 -1
- package/dist/index.js +15 -1
- package/dist/index.mjs +15 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,6 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
|
|
|
92
92
|
createPortal(): HTMLElement;
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
declare function machine(
|
|
95
|
+
declare function machine(userContext: UserDefinedContext): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
|
|
96
96
|
|
|
97
97
|
export { UserDefinedContext as Context, connect, machine };
|
package/dist/index.js
CHANGED
|
@@ -401,7 +401,21 @@ function connect(state, send, normalize) {
|
|
|
401
401
|
// src/tooltip.machine.ts
|
|
402
402
|
var import_core2 = require("@zag-js/core");
|
|
403
403
|
var import_popper2 = require("@zag-js/popper");
|
|
404
|
-
|
|
404
|
+
|
|
405
|
+
// ../../utilities/core/dist/index.mjs
|
|
406
|
+
var isArray2 = (v) => Array.isArray(v);
|
|
407
|
+
var isObject2 = (v) => !(v == null || typeof v !== "object" || isArray2(v));
|
|
408
|
+
function compact(obj) {
|
|
409
|
+
if (obj === void 0)
|
|
410
|
+
return obj;
|
|
411
|
+
return Object.fromEntries(
|
|
412
|
+
Object.entries(obj).filter(([, value]) => value !== void 0).map(([key, value]) => [key, isObject2(value) ? compact(value) : value])
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// src/tooltip.machine.ts
|
|
417
|
+
function machine(userContext) {
|
|
418
|
+
const ctx = compact(userContext);
|
|
405
419
|
return (0, import_core2.createMachine)(
|
|
406
420
|
{
|
|
407
421
|
id: "tooltip",
|
package/dist/index.mjs
CHANGED
|
@@ -374,7 +374,21 @@ function connect(state, send, normalize) {
|
|
|
374
374
|
// src/tooltip.machine.ts
|
|
375
375
|
import { createMachine, subscribe } from "@zag-js/core";
|
|
376
376
|
import { getPlacement } from "@zag-js/popper";
|
|
377
|
-
|
|
377
|
+
|
|
378
|
+
// ../../utilities/core/dist/index.mjs
|
|
379
|
+
var isArray2 = (v) => Array.isArray(v);
|
|
380
|
+
var isObject2 = (v) => !(v == null || typeof v !== "object" || isArray2(v));
|
|
381
|
+
function compact(obj) {
|
|
382
|
+
if (obj === void 0)
|
|
383
|
+
return obj;
|
|
384
|
+
return Object.fromEntries(
|
|
385
|
+
Object.entries(obj).filter(([, value]) => value !== void 0).map(([key, value]) => [key, isObject2(value) ? compact(value) : value])
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// src/tooltip.machine.ts
|
|
390
|
+
function machine(userContext) {
|
|
391
|
+
const ctx = compact(userContext);
|
|
378
392
|
return createMachine(
|
|
379
393
|
{
|
|
380
394
|
id: "tooltip",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/tooltip",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Core logic for the tooltip widget implemented as a state machine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zag-js/core": "0.2.
|
|
32
|
+
"@zag-js/core": "0.2.2",
|
|
33
33
|
"@zag-js/popper": "0.2.0",
|
|
34
|
-
"@zag-js/types": "0.3.
|
|
34
|
+
"@zag-js/types": "0.3.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@zag-js/dom-utils": "0.2.
|
|
38
|
-
"@zag-js/utils": "0.
|
|
37
|
+
"@zag-js/dom-utils": "0.2.1",
|
|
38
|
+
"@zag-js/utils": "0.3.1"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build-fast": "tsup src/index.ts --format=esm,cjs",
|