@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.
- package/dist/tooltip.connect.js +1 -1
- package/dist/tooltip.connect.mjs +2 -2
- package/dist/tooltip.dom.js +1 -1
- package/dist/tooltip.dom.mjs +2 -2
- package/package.json +12 -9
package/dist/tooltip.connect.js
CHANGED
|
@@ -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(
|
|
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
|
}
|
package/dist/tooltip.connect.mjs
CHANGED
|
@@ -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(
|
|
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
|
}
|
package/dist/tooltip.dom.js
CHANGED
|
@@ -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"]
|
|
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];
|
package/dist/tooltip.dom.mjs
CHANGED
|
@@ -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"]
|
|
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.
|
|
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":
|
|
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.
|
|
30
|
-
"@zag-js/core": "1.
|
|
31
|
-
"@zag-js/popper": "1.
|
|
32
|
-
"@zag-js/focus-visible": "1.
|
|
33
|
-
"@zag-js/dom-query": "1.
|
|
34
|
-
"@zag-js/utils": "1.
|
|
35
|
-
"@zag-js/types": "1.
|
|
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"
|