@zag-js/tooltip 0.1.9 → 0.1.10
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 +58 -43
- package/dist/index.mjs +58 -43
- package/dist/tooltip.dom.d.ts +16 -3
- package/dist/tooltip.machine.d.ts +1 -1
- package/dist/tooltip.types.d.ts +3 -3
- package/package.json +8 -5
package/dist/index.js
CHANGED
|
@@ -43,6 +43,22 @@ __export(src_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(src_exports);
|
|
44
44
|
|
|
45
45
|
// ../../utilities/dom/dist/index.mjs
|
|
46
|
+
var __defProp2 = Object.defineProperty;
|
|
47
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
48
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
49
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
50
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
51
|
+
var __spreadValues2 = (a, b) => {
|
|
52
|
+
for (var prop in b || (b = {}))
|
|
53
|
+
if (__hasOwnProp2.call(b, prop))
|
|
54
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
55
|
+
if (__getOwnPropSymbols2)
|
|
56
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
57
|
+
if (__propIsEnum2.call(b, prop))
|
|
58
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
59
|
+
}
|
|
60
|
+
return a;
|
|
61
|
+
};
|
|
46
62
|
var dataAttr = (guard) => {
|
|
47
63
|
return guard ? "" : void 0;
|
|
48
64
|
};
|
|
@@ -81,6 +97,9 @@ var pt = (v) => isDom() && v.test(getPlatform());
|
|
|
81
97
|
var vn = (v) => isDom() && v.test(navigator.vendor);
|
|
82
98
|
var isSafari = () => isApple() && vn(/apple/i);
|
|
83
99
|
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
100
|
+
function isDocument(el) {
|
|
101
|
+
return el.nodeType === Node.DOCUMENT_NODE;
|
|
102
|
+
}
|
|
84
103
|
function isWindow(value) {
|
|
85
104
|
return (value == null ? void 0 : value.toString()) === "[object Window]";
|
|
86
105
|
}
|
|
@@ -88,6 +107,8 @@ function getDocument(el) {
|
|
|
88
107
|
var _a;
|
|
89
108
|
if (isWindow(el))
|
|
90
109
|
return el.document;
|
|
110
|
+
if (isDocument(el))
|
|
111
|
+
return el;
|
|
91
112
|
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
|
|
92
113
|
}
|
|
93
114
|
function getWindow(el) {
|
|
@@ -104,6 +125,22 @@ function getParent(el) {
|
|
|
104
125
|
return el;
|
|
105
126
|
return el.assignedSlot || el.parentElement || doc.documentElement;
|
|
106
127
|
}
|
|
128
|
+
function defineDomHelpers(helpers) {
|
|
129
|
+
const dom2 = {
|
|
130
|
+
getRootNode: (ctx) => {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
return (_b = (_a = ctx.getRootNode) == null ? void 0 : _a.call(ctx)) != null ? _b : document;
|
|
133
|
+
},
|
|
134
|
+
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
135
|
+
getWin: (ctx) => {
|
|
136
|
+
var _a;
|
|
137
|
+
return (_a = dom2.getDoc(ctx).defaultView) != null ? _a : window;
|
|
138
|
+
},
|
|
139
|
+
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
140
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
141
|
+
};
|
|
142
|
+
return __spreadValues2(__spreadValues2({}, dom2), helpers);
|
|
143
|
+
}
|
|
107
144
|
function isHTMLElement(v) {
|
|
108
145
|
return typeof v === "object" && (v == null ? void 0 : v.nodeType) === Node.ELEMENT_NODE && typeof (v == null ? void 0 : v.nodeName) === "string";
|
|
109
146
|
}
|
|
@@ -175,18 +212,6 @@ function getEventName(evt) {
|
|
|
175
212
|
return mouseEventNames[evt];
|
|
176
213
|
return evt;
|
|
177
214
|
}
|
|
178
|
-
var visuallyHiddenStyle = {
|
|
179
|
-
border: "0",
|
|
180
|
-
clip: "rect(0 0 0 0)",
|
|
181
|
-
height: "1px",
|
|
182
|
-
margin: "-1px",
|
|
183
|
-
overflow: "hidden",
|
|
184
|
-
padding: "0",
|
|
185
|
-
position: "absolute",
|
|
186
|
-
width: "1px",
|
|
187
|
-
whiteSpace: "nowrap",
|
|
188
|
-
wordWrap: "normal"
|
|
189
|
-
};
|
|
190
215
|
function raf(fn) {
|
|
191
216
|
const id = globalThis.requestAnimationFrame(fn);
|
|
192
217
|
return function cleanup() {
|
|
@@ -219,24 +244,24 @@ function getScrollParents(el, list = []) {
|
|
|
219
244
|
return parents;
|
|
220
245
|
return parents.concat(getScrollParents(getParent(target)));
|
|
221
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
|
+
};
|
|
222
259
|
|
|
223
260
|
// src/tooltip.connect.ts
|
|
224
261
|
var import_popper = require("@zag-js/popper");
|
|
225
262
|
|
|
226
263
|
// src/tooltip.dom.ts
|
|
227
|
-
var dom = {
|
|
228
|
-
getDoc: (ctx) => {
|
|
229
|
-
var _a;
|
|
230
|
-
return (_a = ctx.doc) != null ? _a : document;
|
|
231
|
-
},
|
|
232
|
-
getWin: (ctx) => {
|
|
233
|
-
var _a, _b;
|
|
234
|
-
return (_b = (_a = ctx.doc) == null ? void 0 : _a.defaultView) != null ? _b : window;
|
|
235
|
-
},
|
|
236
|
-
getRootNode: (ctx) => {
|
|
237
|
-
var _a;
|
|
238
|
-
return (_a = ctx.rootNode) != null ? _a : dom.getDoc(ctx);
|
|
239
|
-
},
|
|
264
|
+
var dom = defineDomHelpers({
|
|
240
265
|
getTriggerId: (ctx) => {
|
|
241
266
|
var _a, _b;
|
|
242
267
|
return (_b = (_a = ctx.ids) == null ? void 0 : _a.trigger) != null ? _b : `tooltip:${ctx.id}:trigger`;
|
|
@@ -248,10 +273,10 @@ var dom = {
|
|
|
248
273
|
getArrowId: (ctx) => `tooltip:${ctx.id}:arrow`,
|
|
249
274
|
getPositionerId: (ctx) => `tooltip:${ctx.id}:popper`,
|
|
250
275
|
portalId: "tooltip-portal",
|
|
251
|
-
getTriggerEl: (ctx) => dom.
|
|
252
|
-
getContentEl: (ctx) => dom.
|
|
253
|
-
getPositionerEl: (ctx) => dom.
|
|
254
|
-
getArrowEl: (ctx) => dom.
|
|
276
|
+
getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),
|
|
277
|
+
getContentEl: (ctx) => dom.getById(ctx, dom.getContentId(ctx)),
|
|
278
|
+
getPositionerEl: (ctx) => dom.getById(ctx, dom.getPositionerId(ctx)),
|
|
279
|
+
getArrowEl: (ctx) => dom.getById(ctx, dom.getArrowId(ctx)),
|
|
255
280
|
getScrollParent: (ctx) => getScrollParent(dom.getTriggerEl(ctx)),
|
|
256
281
|
getPortalEl: (ctx) => dom.getDoc(ctx).getElementById(dom.portalId),
|
|
257
282
|
createPortalEl: (ctx) => {
|
|
@@ -259,7 +284,7 @@ var dom = {
|
|
|
259
284
|
portal.id = dom.portalId;
|
|
260
285
|
return portal;
|
|
261
286
|
}
|
|
262
|
-
};
|
|
287
|
+
});
|
|
263
288
|
|
|
264
289
|
// src/tooltip.store.ts
|
|
265
290
|
var import_core = require("@zag-js/core");
|
|
@@ -379,18 +404,11 @@ function connect(state, send, normalize) {
|
|
|
379
404
|
// src/tooltip.machine.ts
|
|
380
405
|
var import_core2 = require("@zag-js/core");
|
|
381
406
|
var import_popper2 = require("@zag-js/popper");
|
|
382
|
-
|
|
383
|
-
// ../../utilities/core/dist/index.mjs
|
|
384
|
-
var noop = () => {
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
// src/tooltip.machine.ts
|
|
388
|
-
function machine(ctx = {}) {
|
|
407
|
+
function machine(ctx) {
|
|
389
408
|
return (0, import_core2.createMachine)({
|
|
390
409
|
id: "tooltip",
|
|
391
410
|
initial: "unknown",
|
|
392
411
|
context: __spreadProps(__spreadValues({
|
|
393
|
-
id: "",
|
|
394
412
|
openDelay: 1e3,
|
|
395
413
|
closeDelay: 500,
|
|
396
414
|
closeOnPointerDown: true,
|
|
@@ -412,10 +430,7 @@ function machine(ctx = {}) {
|
|
|
412
430
|
states: {
|
|
413
431
|
unknown: {
|
|
414
432
|
on: {
|
|
415
|
-
SETUP:
|
|
416
|
-
target: "closed",
|
|
417
|
-
actions: "setupDocument"
|
|
418
|
-
}
|
|
433
|
+
SETUP: "closed"
|
|
419
434
|
}
|
|
420
435
|
},
|
|
421
436
|
closed: {
|
|
@@ -543,7 +558,7 @@ function machine(ctx = {}) {
|
|
|
543
558
|
},
|
|
544
559
|
trackDisabledTriggerOnSafari(ctx2, _evt, { send }) {
|
|
545
560
|
if (!isSafari())
|
|
546
|
-
return
|
|
561
|
+
return;
|
|
547
562
|
const doc = dom.getDoc(ctx2);
|
|
548
563
|
return addPointerEvent(doc, "pointermove", (event) => {
|
|
549
564
|
const selector = "[data-part=trigger][data-expanded]";
|
package/dist/index.mjs
CHANGED
|
@@ -19,6 +19,22 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
21
|
// ../../utilities/dom/dist/index.mjs
|
|
22
|
+
var __defProp2 = Object.defineProperty;
|
|
23
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
24
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
25
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
26
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
27
|
+
var __spreadValues2 = (a, b) => {
|
|
28
|
+
for (var prop in b || (b = {}))
|
|
29
|
+
if (__hasOwnProp2.call(b, prop))
|
|
30
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
31
|
+
if (__getOwnPropSymbols2)
|
|
32
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
33
|
+
if (__propIsEnum2.call(b, prop))
|
|
34
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
35
|
+
}
|
|
36
|
+
return a;
|
|
37
|
+
};
|
|
22
38
|
var dataAttr = (guard) => {
|
|
23
39
|
return guard ? "" : void 0;
|
|
24
40
|
};
|
|
@@ -57,6 +73,9 @@ var pt = (v) => isDom() && v.test(getPlatform());
|
|
|
57
73
|
var vn = (v) => isDom() && v.test(navigator.vendor);
|
|
58
74
|
var isSafari = () => isApple() && vn(/apple/i);
|
|
59
75
|
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
76
|
+
function isDocument(el) {
|
|
77
|
+
return el.nodeType === Node.DOCUMENT_NODE;
|
|
78
|
+
}
|
|
60
79
|
function isWindow(value) {
|
|
61
80
|
return (value == null ? void 0 : value.toString()) === "[object Window]";
|
|
62
81
|
}
|
|
@@ -64,6 +83,8 @@ function getDocument(el) {
|
|
|
64
83
|
var _a;
|
|
65
84
|
if (isWindow(el))
|
|
66
85
|
return el.document;
|
|
86
|
+
if (isDocument(el))
|
|
87
|
+
return el;
|
|
67
88
|
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
|
|
68
89
|
}
|
|
69
90
|
function getWindow(el) {
|
|
@@ -80,6 +101,22 @@ function getParent(el) {
|
|
|
80
101
|
return el;
|
|
81
102
|
return el.assignedSlot || el.parentElement || doc.documentElement;
|
|
82
103
|
}
|
|
104
|
+
function defineDomHelpers(helpers) {
|
|
105
|
+
const dom2 = {
|
|
106
|
+
getRootNode: (ctx) => {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
return (_b = (_a = ctx.getRootNode) == null ? void 0 : _a.call(ctx)) != null ? _b : document;
|
|
109
|
+
},
|
|
110
|
+
getDoc: (ctx) => getDocument(dom2.getRootNode(ctx)),
|
|
111
|
+
getWin: (ctx) => {
|
|
112
|
+
var _a;
|
|
113
|
+
return (_a = dom2.getDoc(ctx).defaultView) != null ? _a : window;
|
|
114
|
+
},
|
|
115
|
+
getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
|
|
116
|
+
getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
|
|
117
|
+
};
|
|
118
|
+
return __spreadValues2(__spreadValues2({}, dom2), helpers);
|
|
119
|
+
}
|
|
83
120
|
function isHTMLElement(v) {
|
|
84
121
|
return typeof v === "object" && (v == null ? void 0 : v.nodeType) === Node.ELEMENT_NODE && typeof (v == null ? void 0 : v.nodeName) === "string";
|
|
85
122
|
}
|
|
@@ -151,18 +188,6 @@ function getEventName(evt) {
|
|
|
151
188
|
return mouseEventNames[evt];
|
|
152
189
|
return evt;
|
|
153
190
|
}
|
|
154
|
-
var visuallyHiddenStyle = {
|
|
155
|
-
border: "0",
|
|
156
|
-
clip: "rect(0 0 0 0)",
|
|
157
|
-
height: "1px",
|
|
158
|
-
margin: "-1px",
|
|
159
|
-
overflow: "hidden",
|
|
160
|
-
padding: "0",
|
|
161
|
-
position: "absolute",
|
|
162
|
-
width: "1px",
|
|
163
|
-
whiteSpace: "nowrap",
|
|
164
|
-
wordWrap: "normal"
|
|
165
|
-
};
|
|
166
191
|
function raf(fn) {
|
|
167
192
|
const id = globalThis.requestAnimationFrame(fn);
|
|
168
193
|
return function cleanup() {
|
|
@@ -195,24 +220,24 @@ function getScrollParents(el, list = []) {
|
|
|
195
220
|
return parents;
|
|
196
221
|
return parents.concat(getScrollParents(getParent(target)));
|
|
197
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
|
+
};
|
|
198
235
|
|
|
199
236
|
// src/tooltip.connect.ts
|
|
200
237
|
import { getPlacementStyles } from "@zag-js/popper";
|
|
201
238
|
|
|
202
239
|
// src/tooltip.dom.ts
|
|
203
|
-
var dom = {
|
|
204
|
-
getDoc: (ctx) => {
|
|
205
|
-
var _a;
|
|
206
|
-
return (_a = ctx.doc) != null ? _a : document;
|
|
207
|
-
},
|
|
208
|
-
getWin: (ctx) => {
|
|
209
|
-
var _a, _b;
|
|
210
|
-
return (_b = (_a = ctx.doc) == null ? void 0 : _a.defaultView) != null ? _b : window;
|
|
211
|
-
},
|
|
212
|
-
getRootNode: (ctx) => {
|
|
213
|
-
var _a;
|
|
214
|
-
return (_a = ctx.rootNode) != null ? _a : dom.getDoc(ctx);
|
|
215
|
-
},
|
|
240
|
+
var dom = defineDomHelpers({
|
|
216
241
|
getTriggerId: (ctx) => {
|
|
217
242
|
var _a, _b;
|
|
218
243
|
return (_b = (_a = ctx.ids) == null ? void 0 : _a.trigger) != null ? _b : `tooltip:${ctx.id}:trigger`;
|
|
@@ -224,10 +249,10 @@ var dom = {
|
|
|
224
249
|
getArrowId: (ctx) => `tooltip:${ctx.id}:arrow`,
|
|
225
250
|
getPositionerId: (ctx) => `tooltip:${ctx.id}:popper`,
|
|
226
251
|
portalId: "tooltip-portal",
|
|
227
|
-
getTriggerEl: (ctx) => dom.
|
|
228
|
-
getContentEl: (ctx) => dom.
|
|
229
|
-
getPositionerEl: (ctx) => dom.
|
|
230
|
-
getArrowEl: (ctx) => dom.
|
|
252
|
+
getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),
|
|
253
|
+
getContentEl: (ctx) => dom.getById(ctx, dom.getContentId(ctx)),
|
|
254
|
+
getPositionerEl: (ctx) => dom.getById(ctx, dom.getPositionerId(ctx)),
|
|
255
|
+
getArrowEl: (ctx) => dom.getById(ctx, dom.getArrowId(ctx)),
|
|
231
256
|
getScrollParent: (ctx) => getScrollParent(dom.getTriggerEl(ctx)),
|
|
232
257
|
getPortalEl: (ctx) => dom.getDoc(ctx).getElementById(dom.portalId),
|
|
233
258
|
createPortalEl: (ctx) => {
|
|
@@ -235,7 +260,7 @@ var dom = {
|
|
|
235
260
|
portal.id = dom.portalId;
|
|
236
261
|
return portal;
|
|
237
262
|
}
|
|
238
|
-
};
|
|
263
|
+
});
|
|
239
264
|
|
|
240
265
|
// src/tooltip.store.ts
|
|
241
266
|
import { proxy } from "@zag-js/core";
|
|
@@ -355,18 +380,11 @@ function connect(state, send, normalize) {
|
|
|
355
380
|
// src/tooltip.machine.ts
|
|
356
381
|
import { createMachine, ref, subscribe } from "@zag-js/core";
|
|
357
382
|
import { getPlacement } from "@zag-js/popper";
|
|
358
|
-
|
|
359
|
-
// ../../utilities/core/dist/index.mjs
|
|
360
|
-
var noop = () => {
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
// src/tooltip.machine.ts
|
|
364
|
-
function machine(ctx = {}) {
|
|
383
|
+
function machine(ctx) {
|
|
365
384
|
return createMachine({
|
|
366
385
|
id: "tooltip",
|
|
367
386
|
initial: "unknown",
|
|
368
387
|
context: __spreadProps(__spreadValues({
|
|
369
|
-
id: "",
|
|
370
388
|
openDelay: 1e3,
|
|
371
389
|
closeDelay: 500,
|
|
372
390
|
closeOnPointerDown: true,
|
|
@@ -388,10 +406,7 @@ function machine(ctx = {}) {
|
|
|
388
406
|
states: {
|
|
389
407
|
unknown: {
|
|
390
408
|
on: {
|
|
391
|
-
SETUP:
|
|
392
|
-
target: "closed",
|
|
393
|
-
actions: "setupDocument"
|
|
394
|
-
}
|
|
409
|
+
SETUP: "closed"
|
|
395
410
|
}
|
|
396
411
|
},
|
|
397
412
|
closed: {
|
|
@@ -519,7 +534,7 @@ function machine(ctx = {}) {
|
|
|
519
534
|
},
|
|
520
535
|
trackDisabledTriggerOnSafari(ctx2, _evt, { send }) {
|
|
521
536
|
if (!isSafari())
|
|
522
|
-
return
|
|
537
|
+
return;
|
|
523
538
|
const doc = dom.getDoc(ctx2);
|
|
524
539
|
return addPointerEvent(doc, "pointermove", (event) => {
|
|
525
540
|
const selector = "[data-part=trigger][data-expanded]";
|
package/dist/tooltip.dom.d.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import type { MachineContext as Ctx } from "./tooltip.types";
|
|
2
2
|
export declare const dom: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
getRootNode: (ctx: {
|
|
4
|
+
getRootNode?: () => Document | Node | ShadowRoot;
|
|
5
|
+
}) => Document | ShadowRoot;
|
|
6
|
+
getDoc: (ctx: {
|
|
7
|
+
getRootNode?: () => Document | Node | ShadowRoot;
|
|
8
|
+
}) => Document;
|
|
9
|
+
getWin: (ctx: {
|
|
10
|
+
getRootNode?: () => Document | Node | ShadowRoot;
|
|
11
|
+
}) => Window & typeof globalThis;
|
|
12
|
+
getActiveElement: (ctx: {
|
|
13
|
+
getRootNode?: () => Document | Node | ShadowRoot;
|
|
14
|
+
}) => HTMLElement;
|
|
15
|
+
getById: <T_1 = HTMLElement>(ctx: {
|
|
16
|
+
getRootNode?: () => Document | Node | ShadowRoot;
|
|
17
|
+
}, id: string) => T_1;
|
|
18
|
+
} & {
|
|
6
19
|
getTriggerId: (ctx: Ctx) => string;
|
|
7
20
|
getContentId: (ctx: Ctx) => string;
|
|
8
21
|
getArrowId: (ctx: Ctx) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { MachineContext, MachineState, UserDefinedContext } from "./tooltip.types";
|
|
2
|
-
export declare function machine(ctx
|
|
2
|
+
export declare function machine(ctx: UserDefinedContext): import("@zag-js/core").Machine<MachineContext, MachineState, import("@zag-js/core").StateMachine.AnyEventObject>;
|
package/dist/tooltip.types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { StateMachine as S } from "@zag-js/core";
|
|
2
2
|
import type { Placement, PositioningOptions } from "@zag-js/popper";
|
|
3
|
-
import type { RootProperties } from "@zag-js/types";
|
|
3
|
+
import type { CommonProperties, RequiredBy, RootProperties } from "@zag-js/types";
|
|
4
4
|
declare type ElementIds = Partial<{
|
|
5
5
|
trigger: string;
|
|
6
6
|
content: string;
|
|
7
7
|
}>;
|
|
8
|
-
declare type PublicContext = {
|
|
8
|
+
declare type PublicContext = CommonProperties & {
|
|
9
9
|
/**
|
|
10
10
|
* The ids of the elements in the tooltip. Useful for composition.
|
|
11
11
|
*/
|
|
@@ -53,7 +53,7 @@ declare type PublicContext = {
|
|
|
53
53
|
*/
|
|
54
54
|
positioning: PositioningOptions;
|
|
55
55
|
};
|
|
56
|
-
export declare type UserDefinedContext =
|
|
56
|
+
export declare type UserDefinedContext = RequiredBy<PublicContext, "id">;
|
|
57
57
|
declare type ComputedContext = Readonly<{
|
|
58
58
|
/**
|
|
59
59
|
* @computed Whether an `aria-label` is set.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/tooltip",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Core logic for the tooltip widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -29,10 +29,13 @@
|
|
|
29
29
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zag-js/core": "0.1.
|
|
33
|
-
"@zag-js/
|
|
34
|
-
"@zag-js/
|
|
35
|
-
|
|
32
|
+
"@zag-js/core": "0.1.8",
|
|
33
|
+
"@zag-js/popper": "0.1.8",
|
|
34
|
+
"@zag-js/types": "0.2.2"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@zag-js/dom-utils": "0.1.7",
|
|
38
|
+
"@zag-js/utils": "0.1.2"
|
|
36
39
|
},
|
|
37
40
|
"scripts": {
|
|
38
41
|
"build:fast": "zag build",
|