@zag-js/tooltip 1.41.2 → 1.43.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.
@@ -100,7 +100,7 @@ function connect(service, normalize) {
100
100
  if (disabled) return;
101
101
  if (id !== import_tooltip2.store.get("id")) return;
102
102
  const activeEl = event.relatedTarget ?? scope.getDoc().activeElement;
103
- const focusedAnotherTrigger = activeEl?.closest(`[data-ownedby="${scope.id}"]`) != null;
103
+ const focusedAnotherTrigger = activeEl?.closest((0, import_dom_query.getByOwnerId)(scope.id)) != null;
104
104
  if (!focusedAnotherTrigger) {
105
105
  send({ type: "close", src: "trigger.blur", value, triggerId });
106
106
  }
@@ -1,5 +1,5 @@
1
1
  // src/tooltip.connect.ts
2
- import { dataAttr, isLeftClick } from "@zag-js/dom-query";
2
+ import { dataAttr, getByOwnerId, isLeftClick } from "@zag-js/dom-query";
3
3
  import { isFocusVisible } from "@zag-js/focus-visible";
4
4
  import { getPlacementSide, getPlacementStyles } from "@zag-js/popper";
5
5
  import { parts } from "./tooltip.anatomy.mjs";
@@ -66,7 +66,7 @@ function connect(service, normalize) {
66
66
  if (disabled) return;
67
67
  if (id !== store.get("id")) return;
68
68
  const activeEl = event.relatedTarget ?? scope.getDoc().activeElement;
69
- const focusedAnotherTrigger = activeEl?.closest(`[data-ownedby="${scope.id}"]`) != null;
69
+ const focusedAnotherTrigger = activeEl?.closest(getByOwnerId(scope.id)) != null;
70
70
  if (!focusedAnotherTrigger) {
71
71
  send({ type: "close", src: "trigger.blur", value, triggerId });
72
72
  }
@@ -46,7 +46,7 @@ var getTriggerEl = (scope) => scope.getById(getTriggerId(scope));
46
46
  var getContentEl = (scope) => scope.getById(getContentId(scope));
47
47
  var getPositionerEl = (scope) => scope.getById(getPositionerId(scope));
48
48
  var getArrowEl = (scope) => scope.getById(getArrowId(scope));
49
- var getTriggerEls = (scope) => (0, import_dom_query.queryAll)(scope.getRootNode(), `[data-scope="tooltip"][data-part="trigger"][data-ownedby="${scope.id}"]`);
49
+ var getTriggerEls = (scope) => (0, import_dom_query.queryAll)(scope.getRootNode(), `[data-scope="tooltip"][data-part="trigger"]${(0, import_dom_query.getByOwnerId)(scope.id)}`);
50
50
  var getActiveTriggerEl = (scope, value) => {
51
51
  if (value == null) {
52
52
  return getTriggerEl(scope) ?? getTriggerEls(scope)[0];
@@ -1,5 +1,5 @@
1
1
  // src/tooltip.dom.ts
2
- import { queryAll } from "@zag-js/dom-query";
2
+ import { getByOwnerId, queryAll } from "@zag-js/dom-query";
3
3
  import { isFunction } from "@zag-js/utils";
4
4
  var getTriggerId = (scope, value) => {
5
5
  const customId = scope.ids?.trigger;
@@ -13,7 +13,7 @@ var getTriggerEl = (scope) => scope.getById(getTriggerId(scope));
13
13
  var getContentEl = (scope) => scope.getById(getContentId(scope));
14
14
  var getPositionerEl = (scope) => scope.getById(getPositionerId(scope));
15
15
  var getArrowEl = (scope) => scope.getById(getArrowId(scope));
16
- var getTriggerEls = (scope) => queryAll(scope.getRootNode(), `[data-scope="tooltip"][data-part="trigger"][data-ownedby="${scope.id}"]`);
16
+ var getTriggerEls = (scope) => queryAll(scope.getRootNode(), `[data-scope="tooltip"][data-part="trigger"]${getByOwnerId(scope.id)}`);
17
17
  var getActiveTriggerEl = (scope, value) => {
18
18
  if (value == null) {
19
19
  return getTriggerEl(scope) ?? getTriggerEls(scope)[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/tooltip",
3
- "version": "1.41.2",
3
+ "version": "1.43.0",
4
4
  "description": "Core logic for the tooltip widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -14,7 +14,10 @@
14
14
  "author": "Segun Adebayo <sage@adebayosegun.com>",
15
15
  "homepage": "https://github.com/chakra-ui/zag#readme",
16
16
  "license": "MIT",
17
- "repository": "https://github.com/chakra-ui/zag/tree/main/packages/tooltip",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/chakra-ui/zag/tree/main/packages/tooltip"
20
+ },
18
21
  "sideEffects": false,
19
22
  "files": [
20
23
  "dist"
@@ -26,13 +29,13 @@
26
29
  "url": "https://github.com/chakra-ui/zag/issues"
27
30
  },
28
31
  "dependencies": {
29
- "@zag-js/anatomy": "1.41.2",
30
- "@zag-js/core": "1.41.2",
31
- "@zag-js/popper": "1.41.2",
32
- "@zag-js/focus-visible": "1.41.2",
33
- "@zag-js/dom-query": "1.41.2",
34
- "@zag-js/utils": "1.41.2",
35
- "@zag-js/types": "1.41.2"
32
+ "@zag-js/anatomy": "1.43.0",
33
+ "@zag-js/core": "1.43.0",
34
+ "@zag-js/popper": "1.43.0",
35
+ "@zag-js/focus-visible": "1.43.0",
36
+ "@zag-js/dom-query": "1.43.0",
37
+ "@zag-js/utils": "1.43.0",
38
+ "@zag-js/types": "1.43.0"
36
39
  },
37
40
  "devDependencies": {
38
41
  "clean-package": "2.2.0"