@zag-js/tooltip 0.0.0-dev-20220709145914 → 0.0.0-dev-20220710093812
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.js +15 -20
- package/dist/index.mjs +15 -20
- package/dist/tooltip.dom.d.ts +3 -0
- package/package.json +7 -4
package/dist/index.js
CHANGED
|
@@ -136,7 +136,8 @@ function defineDomHelpers(domUtils) {
|
|
|
136
136
|
var _a;
|
|
137
137
|
return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
|
|
138
138
|
},
|
|
139
|
-
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
|
|
139
|
+
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement,
|
|
140
|
+
getById: (ctx, id) => roots.getRootNode(ctx).getElementById(id)
|
|
140
141
|
};
|
|
141
142
|
return __spreadValues2(__spreadValues2({}, roots), domUtils);
|
|
142
143
|
}
|
|
@@ -211,18 +212,6 @@ function getEventName(evt) {
|
|
|
211
212
|
return mouseEventNames[evt];
|
|
212
213
|
return evt;
|
|
213
214
|
}
|
|
214
|
-
var visuallyHiddenStyle = {
|
|
215
|
-
border: "0",
|
|
216
|
-
clip: "rect(0 0 0 0)",
|
|
217
|
-
height: "1px",
|
|
218
|
-
margin: "-1px",
|
|
219
|
-
overflow: "hidden",
|
|
220
|
-
padding: "0",
|
|
221
|
-
position: "absolute",
|
|
222
|
-
width: "1px",
|
|
223
|
-
whiteSpace: "nowrap",
|
|
224
|
-
wordWrap: "normal"
|
|
225
|
-
};
|
|
226
215
|
function raf(fn) {
|
|
227
216
|
const id = globalThis.requestAnimationFrame(fn);
|
|
228
217
|
return function cleanup() {
|
|
@@ -255,6 +244,18 @@ function getScrollParents(el, list = []) {
|
|
|
255
244
|
return parents;
|
|
256
245
|
return parents.concat(getScrollParents(getParent(target)));
|
|
257
246
|
}
|
|
247
|
+
var visuallyHiddenStyle = {
|
|
248
|
+
border: "0",
|
|
249
|
+
clip: "rect(0 0 0 0)",
|
|
250
|
+
height: "1px",
|
|
251
|
+
margin: "-1px",
|
|
252
|
+
overflow: "hidden",
|
|
253
|
+
padding: "0",
|
|
254
|
+
position: "absolute",
|
|
255
|
+
width: "1px",
|
|
256
|
+
whiteSpace: "nowrap",
|
|
257
|
+
wordWrap: "normal"
|
|
258
|
+
};
|
|
258
259
|
|
|
259
260
|
// src/tooltip.connect.ts
|
|
260
261
|
var import_popper = require("@zag-js/popper");
|
|
@@ -403,12 +404,6 @@ function connect(state, send, normalize) {
|
|
|
403
404
|
// src/tooltip.machine.ts
|
|
404
405
|
var import_core2 = require("@zag-js/core");
|
|
405
406
|
var import_popper2 = require("@zag-js/popper");
|
|
406
|
-
|
|
407
|
-
// ../../utilities/core/dist/index.mjs
|
|
408
|
-
var noop = () => {
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
// src/tooltip.machine.ts
|
|
412
407
|
function machine(ctx) {
|
|
413
408
|
return (0, import_core2.createMachine)({
|
|
414
409
|
id: "tooltip",
|
|
@@ -563,7 +558,7 @@ function machine(ctx) {
|
|
|
563
558
|
},
|
|
564
559
|
trackDisabledTriggerOnSafari(ctx2, _evt, { send }) {
|
|
565
560
|
if (!isSafari())
|
|
566
|
-
return
|
|
561
|
+
return;
|
|
567
562
|
const doc = dom.getDoc(ctx2);
|
|
568
563
|
return addPointerEvent(doc, "pointermove", (event) => {
|
|
569
564
|
const selector = "[data-part=trigger][data-expanded]";
|
package/dist/index.mjs
CHANGED
|
@@ -112,7 +112,8 @@ function defineDomHelpers(domUtils) {
|
|
|
112
112
|
var _a;
|
|
113
113
|
return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
|
|
114
114
|
},
|
|
115
|
-
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
|
|
115
|
+
getActiveElement: (ctx) => roots.getDoc(ctx).activeElement,
|
|
116
|
+
getById: (ctx, id) => roots.getRootNode(ctx).getElementById(id)
|
|
116
117
|
};
|
|
117
118
|
return __spreadValues2(__spreadValues2({}, roots), domUtils);
|
|
118
119
|
}
|
|
@@ -187,18 +188,6 @@ function getEventName(evt) {
|
|
|
187
188
|
return mouseEventNames[evt];
|
|
188
189
|
return evt;
|
|
189
190
|
}
|
|
190
|
-
var visuallyHiddenStyle = {
|
|
191
|
-
border: "0",
|
|
192
|
-
clip: "rect(0 0 0 0)",
|
|
193
|
-
height: "1px",
|
|
194
|
-
margin: "-1px",
|
|
195
|
-
overflow: "hidden",
|
|
196
|
-
padding: "0",
|
|
197
|
-
position: "absolute",
|
|
198
|
-
width: "1px",
|
|
199
|
-
whiteSpace: "nowrap",
|
|
200
|
-
wordWrap: "normal"
|
|
201
|
-
};
|
|
202
191
|
function raf(fn) {
|
|
203
192
|
const id = globalThis.requestAnimationFrame(fn);
|
|
204
193
|
return function cleanup() {
|
|
@@ -231,6 +220,18 @@ function getScrollParents(el, list = []) {
|
|
|
231
220
|
return parents;
|
|
232
221
|
return parents.concat(getScrollParents(getParent(target)));
|
|
233
222
|
}
|
|
223
|
+
var visuallyHiddenStyle = {
|
|
224
|
+
border: "0",
|
|
225
|
+
clip: "rect(0 0 0 0)",
|
|
226
|
+
height: "1px",
|
|
227
|
+
margin: "-1px",
|
|
228
|
+
overflow: "hidden",
|
|
229
|
+
padding: "0",
|
|
230
|
+
position: "absolute",
|
|
231
|
+
width: "1px",
|
|
232
|
+
whiteSpace: "nowrap",
|
|
233
|
+
wordWrap: "normal"
|
|
234
|
+
};
|
|
234
235
|
|
|
235
236
|
// src/tooltip.connect.ts
|
|
236
237
|
import { getPlacementStyles } from "@zag-js/popper";
|
|
@@ -379,12 +380,6 @@ function connect(state, send, normalize) {
|
|
|
379
380
|
// src/tooltip.machine.ts
|
|
380
381
|
import { createMachine, ref, subscribe } from "@zag-js/core";
|
|
381
382
|
import { getPlacement } from "@zag-js/popper";
|
|
382
|
-
|
|
383
|
-
// ../../utilities/core/dist/index.mjs
|
|
384
|
-
var noop = () => {
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
// src/tooltip.machine.ts
|
|
388
383
|
function machine(ctx) {
|
|
389
384
|
return createMachine({
|
|
390
385
|
id: "tooltip",
|
|
@@ -539,7 +534,7 @@ function machine(ctx) {
|
|
|
539
534
|
},
|
|
540
535
|
trackDisabledTriggerOnSafari(ctx2, _evt, { send }) {
|
|
541
536
|
if (!isSafari())
|
|
542
|
-
return
|
|
537
|
+
return;
|
|
543
538
|
const doc = dom.getDoc(ctx2);
|
|
544
539
|
return addPointerEvent(doc, "pointermove", (event) => {
|
|
545
540
|
const selector = "[data-part=trigger][data-expanded]";
|
package/dist/tooltip.dom.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ export declare const dom: {
|
|
|
12
12
|
getActiveElement: (ctx: {
|
|
13
13
|
getRootNode?: () => Document | Node | ShadowRoot;
|
|
14
14
|
}) => HTMLElement;
|
|
15
|
+
getById: (ctx: {
|
|
16
|
+
getRootNode?: () => Document | Node | ShadowRoot;
|
|
17
|
+
}, id: string) => HTMLElement;
|
|
15
18
|
} & {
|
|
16
19
|
getTriggerId: (ctx: Ctx) => string;
|
|
17
20
|
getContentId: (ctx: Ctx) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/tooltip",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20220710093812",
|
|
4
4
|
"description": "Core logic for the tooltip widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -30,9 +30,12 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@zag-js/core": "0.1.7",
|
|
33
|
-
"@zag-js/
|
|
34
|
-
"@zag-js/
|
|
35
|
-
|
|
33
|
+
"@zag-js/popper": "0.0.0-dev-20220710093812",
|
|
34
|
+
"@zag-js/types": "0.0.0-dev-20220710093812"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@zag-js/dom-utils": "0.0.0-dev-20220710093812",
|
|
38
|
+
"@zag-js/utils": "0.1.2"
|
|
36
39
|
},
|
|
37
40
|
"scripts": {
|
|
38
41
|
"build:fast": "zag build",
|