@zag-js/tooltip 0.0.0-dev-20220929201450 → 0.0.0-dev-20221005154850

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 CHANGED
@@ -54,6 +54,10 @@ declare type PublicContext = CommonProperties & {
54
54
  * The user provided options used to position the popover content
55
55
  */
56
56
  positioning: PositioningOptions;
57
+ /**
58
+ * Whether the tooltip is disabled
59
+ */
60
+ disabled?: boolean;
57
61
  };
58
62
  declare type UserDefinedContext = RequiredBy<PublicContext, "id">;
59
63
  declare type ComputedContext = Readonly<{
package/dist/index.js CHANGED
@@ -264,6 +264,7 @@ function connect(state, send, normalize) {
264
264
  const isOpen = state.hasTag("open");
265
265
  const triggerId = dom.getTriggerId(state.context);
266
266
  const contentId = dom.getContentId(state.context);
267
+ const isDisabled = state.context.disabled;
267
268
  const popperStyles = (0, import_popper.getPlacementStyles)({
268
269
  measured: !!state.context.isPlacementComplete,
269
270
  placement: state.context.currentPlacement
@@ -299,17 +300,25 @@ function connect(state, send, normalize) {
299
300
  }
300
301
  },
301
302
  onPointerDown() {
303
+ if (isDisabled)
304
+ return;
302
305
  if (id === store.id) {
303
306
  send("POINTER_DOWN");
304
307
  }
305
308
  },
306
309
  onPointerMove() {
310
+ if (isDisabled)
311
+ return;
307
312
  send("POINTER_ENTER");
308
313
  },
309
314
  onPointerLeave() {
315
+ if (isDisabled)
316
+ return;
310
317
  send("POINTER_LEAVE");
311
318
  },
312
319
  onPointerCancel() {
320
+ if (isDisabled)
321
+ return;
313
322
  send("POINTER_LEAVE");
314
323
  }
315
324
  }),
package/dist/index.mjs CHANGED
@@ -237,6 +237,7 @@ function connect(state, send, normalize) {
237
237
  const isOpen = state.hasTag("open");
238
238
  const triggerId = dom.getTriggerId(state.context);
239
239
  const contentId = dom.getContentId(state.context);
240
+ const isDisabled = state.context.disabled;
240
241
  const popperStyles = getPlacementStyles({
241
242
  measured: !!state.context.isPlacementComplete,
242
243
  placement: state.context.currentPlacement
@@ -272,17 +273,25 @@ function connect(state, send, normalize) {
272
273
  }
273
274
  },
274
275
  onPointerDown() {
276
+ if (isDisabled)
277
+ return;
275
278
  if (id === store.id) {
276
279
  send("POINTER_DOWN");
277
280
  }
278
281
  },
279
282
  onPointerMove() {
283
+ if (isDisabled)
284
+ return;
280
285
  send("POINTER_ENTER");
281
286
  },
282
287
  onPointerLeave() {
288
+ if (isDisabled)
289
+ return;
283
290
  send("POINTER_LEAVE");
284
291
  },
285
292
  onPointerCancel() {
293
+ if (isDisabled)
294
+ return;
286
295
  send("POINTER_LEAVE");
287
296
  }
288
297
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/tooltip",
3
- "version": "0.0.0-dev-20220929201450",
3
+ "version": "0.0.0-dev-20221005154850",
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.0.0-dev-20220929201450",
33
- "@zag-js/popper": "0.0.0-dev-20220929201450",
34
- "@zag-js/types": "0.0.0-dev-20220929201450"
32
+ "@zag-js/core": "0.0.0-dev-20221005154850",
33
+ "@zag-js/popper": "0.0.0-dev-20221005154850",
34
+ "@zag-js/types": "0.0.0-dev-20221005154850"
35
35
  },
36
36
  "devDependencies": {
37
- "@zag-js/dom-utils": "0.0.0-dev-20220929201450",
38
- "@zag-js/utils": "0.0.0-dev-20220929201450"
37
+ "@zag-js/dom-utils": "0.0.0-dev-20221005154850",
38
+ "@zag-js/utils": "0.0.0-dev-20221005154850"
39
39
  },
40
40
  "scripts": {
41
41
  "build-fast": "tsup src/index.ts --format=esm,cjs",