@zag-js/tooltip 0.3.0 → 0.5.0

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.
@@ -34,7 +34,8 @@ function machine(userContext) {
34
34
  hasAriaLabel: (ctx2) => !!ctx2["aria-label"]
35
35
  },
36
36
  watch: {
37
- disabled: ["closeIfDisabled"]
37
+ disabled: ["closeIfDisabled"],
38
+ open: ["toggleVisibility"]
38
39
  },
39
40
  on: {
40
41
  OPEN: "open",
@@ -219,6 +220,9 @@ function machine(userContext) {
219
220
  listeners: false
220
221
  });
221
222
  });
223
+ },
224
+ toggleVisibility(ctx2, _evt, { send }) {
225
+ send({ type: ctx2.open ? "OPEN" : "CLOSE", src: "controlled" });
222
226
  }
223
227
  },
224
228
  guards: {
package/dist/index.js CHANGED
@@ -212,7 +212,8 @@ function machine(userContext) {
212
212
  hasAriaLabel: (ctx2) => !!ctx2["aria-label"]
213
213
  },
214
214
  watch: {
215
- disabled: ["closeIfDisabled"]
215
+ disabled: ["closeIfDisabled"],
216
+ open: ["toggleVisibility"]
216
217
  },
217
218
  on: {
218
219
  OPEN: "open",
@@ -397,6 +398,9 @@ function machine(userContext) {
397
398
  listeners: false
398
399
  });
399
400
  });
401
+ },
402
+ toggleVisibility(ctx2, _evt, { send }) {
403
+ send({ type: ctx2.open ? "OPEN" : "CLOSE", src: "controlled" });
400
404
  }
401
405
  },
402
406
  guards: {
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-RRQRIZBA.mjs";
7
7
  import {
8
8
  machine
9
- } from "./chunk-SAHH7E72.mjs";
9
+ } from "./chunk-YRDFBCFW.mjs";
10
10
  import "./chunk-3LXHM7BW.mjs";
11
11
  import "./chunk-GQYNO326.mjs";
12
12
  export {
@@ -78,7 +78,8 @@ function machine(userContext) {
78
78
  hasAriaLabel: (ctx2) => !!ctx2["aria-label"]
79
79
  },
80
80
  watch: {
81
- disabled: ["closeIfDisabled"]
81
+ disabled: ["closeIfDisabled"],
82
+ open: ["toggleVisibility"]
82
83
  },
83
84
  on: {
84
85
  OPEN: "open",
@@ -263,6 +264,9 @@ function machine(userContext) {
263
264
  listeners: false
264
265
  });
265
266
  });
267
+ },
268
+ toggleVisibility(ctx2, _evt, { send }) {
269
+ send({ type: ctx2.open ? "OPEN" : "CLOSE", src: "controlled" });
266
270
  }
267
271
  },
268
272
  guards: {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  machine
3
- } from "./chunk-SAHH7E72.mjs";
3
+ } from "./chunk-YRDFBCFW.mjs";
4
4
  import "./chunk-3LXHM7BW.mjs";
5
5
  import "./chunk-GQYNO326.mjs";
6
6
  export {
@@ -57,6 +57,10 @@ type PublicContext = CommonProperties & {
57
57
  * Whether the tooltip is disabled
58
58
  */
59
59
  disabled?: boolean;
60
+ /**
61
+ * Whether the tooltip is open
62
+ */
63
+ open?: boolean;
60
64
  };
61
65
  type UserDefinedContext = RequiredBy<PublicContext, "id">;
62
66
  type ComputedContext = Readonly<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/tooltip",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Core logic for the tooltip widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -26,14 +26,14 @@
26
26
  "url": "https://github.com/chakra-ui/zag/issues"
27
27
  },
28
28
  "dependencies": {
29
- "@zag-js/core": "0.2.12",
30
- "@zag-js/utils": "0.3.4",
31
29
  "@zag-js/anatomy": "0.1.4",
30
+ "@zag-js/core": "0.5.0",
32
31
  "@zag-js/popper": "0.2.7",
33
- "@zag-js/dom-event": "0.0.1",
32
+ "@zag-js/dom-query": "0.1.4",
33
+ "@zag-js/dom-event": "0.5.0",
34
+ "@zag-js/utils": "0.3.4",
34
35
  "@zag-js/visually-hidden": "0.0.1",
35
- "@zag-js/types": "0.3.4",
36
- "@zag-js/dom-query": "0.1.4"
36
+ "@zag-js/types": "0.5.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "clean-package": "2.2.0"