@zag-js/toast 1.47.0 → 1.48.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/index.d.mts +10 -17
- package/dist/index.d.ts +10 -17
- package/dist/index.js +18 -45
- package/dist/index.mjs +5 -11
- package/dist/toast-group.connect.d.mts +4 -8
- package/dist/toast-group.connect.d.ts +4 -8
- package/dist/toast-group.connect.js +73 -97
- package/dist/toast-group.connect.mjs +68 -61
- package/dist/toast-group.machine.d.mts +2 -8
- package/dist/toast-group.machine.d.ts +2 -8
- package/dist/toast-group.machine.js +292 -346
- package/dist/toast-group.machine.mjs +287 -310
- package/dist/toast.anatomy.d.mts +2 -6
- package/dist/toast.anatomy.d.ts +2 -6
- package/dist/toast.anatomy.js +8 -40
- package/dist/toast.anatomy.mjs +4 -14
- package/dist/toast.connect.d.mts +4 -8
- package/dist/toast.connect.d.ts +4 -8
- package/dist/toast.connect.js +133 -158
- package/dist/toast.connect.mjs +128 -122
- package/dist/toast.dom.d.mts +19 -23
- package/dist/toast.dom.d.ts +19 -23
- package/dist/toast.dom.js +54 -83
- package/dist/toast.dom.mjs +39 -47
- package/dist/toast.machine.d.mts +2 -8
- package/dist/toast.machine.d.ts +2 -8
- package/dist/toast.machine.js +272 -300
- package/dist/toast.machine.mjs +267 -264
- package/dist/toast.store.d.mts +2 -8
- package/dist/toast.store.d.ts +2 -8
- package/dist/toast.store.js +344 -306
- package/dist/toast.store.mjs +340 -281
- package/dist/toast.types.d.mts +372 -374
- package/dist/toast.types.d.ts +372 -374
- package/dist/toast.types.js +4 -18
- package/dist/toast.types.mjs +1 -0
- package/dist/toast.utils.d.mts +10 -14
- package/dist/toast.utils.d.ts +10 -14
- package/dist/toast.utils.js +167 -217
- package/dist/toast.utils.mjs +157 -186
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import '@zag-js/dom-query';
|
|
11
|
-
import '@zag-js/anatomy';
|
|
12
|
-
|
|
13
|
-
declare const group: {
|
|
14
|
-
connect: typeof groupConnect;
|
|
15
|
-
machine: _zag_js_core.Machine<ToastGroupSchema>;
|
|
1
|
+
import { ActionOptions, IntlTranslations, Options, Placement, PromiseOptions, Status, StatusChangeDetails, ToastApi, ToastGroupApi, ToastGroupMachine, ToastGroupProps, ToastGroupSchema, ToastGroupService, ToastHeight, ToastMachine, ToastProps, ToastQueuePriority, ToastService, ToastStore, ToastStoreProps, Type } from "./toast.types.mjs";
|
|
2
|
+
import { groupConnect } from "./toast-group.connect.mjs";
|
|
3
|
+
import { anatomy } from "./toast.anatomy.mjs";
|
|
4
|
+
import { connect } from "./toast.connect.mjs";
|
|
5
|
+
import { machine } from "./toast.machine.mjs";
|
|
6
|
+
import { createToastStore } from "./toast.store.mjs";
|
|
7
|
+
export declare const group: {
|
|
8
|
+
connect: typeof groupConnect;
|
|
9
|
+
machine: import("@zag-js/core").Machine<ToastGroupSchema>;
|
|
16
10
|
};
|
|
17
|
-
|
|
18
|
-
export { group };
|
|
11
|
+
export { type ActionOptions, type ToastApi as Api, type ToastGroupApi as GroupApi, type ToastGroupMachine as GroupMachine, type ToastGroupProps as GroupProps, type ToastGroupService as GroupService, type IntlTranslations, type ToastMachine as Machine, type Options, type Placement, type PromiseOptions, type ToastProps as Props, type ToastService as Service, type Status, type StatusChangeDetails, type ToastStore as Store, type ToastStoreProps as StoreProps, type ToastHeight, type ToastQueuePriority, type Type, anatomy, connect, createToastStore as createStore, machine };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import '@zag-js/dom-query';
|
|
11
|
-
import '@zag-js/anatomy';
|
|
12
|
-
|
|
13
|
-
declare const group: {
|
|
14
|
-
connect: typeof groupConnect;
|
|
15
|
-
machine: _zag_js_core.Machine<ToastGroupSchema>;
|
|
1
|
+
import { ActionOptions, IntlTranslations, Options, Placement, PromiseOptions, Status, StatusChangeDetails, ToastApi, ToastGroupApi, ToastGroupMachine, ToastGroupProps, ToastGroupSchema, ToastGroupService, ToastHeight, ToastMachine, ToastProps, ToastQueuePriority, ToastService, ToastStore, ToastStoreProps, Type } from "./toast.types.js";
|
|
2
|
+
import { groupConnect } from "./toast-group.connect.js";
|
|
3
|
+
import { anatomy } from "./toast.anatomy.js";
|
|
4
|
+
import { connect } from "./toast.connect.js";
|
|
5
|
+
import { machine } from "./toast.machine.js";
|
|
6
|
+
import { createToastStore } from "./toast.store.js";
|
|
7
|
+
export declare const group: {
|
|
8
|
+
connect: typeof groupConnect;
|
|
9
|
+
machine: import("@zag-js/core").Machine<ToastGroupSchema>;
|
|
16
10
|
};
|
|
17
|
-
|
|
18
|
-
export { group };
|
|
11
|
+
export { type ActionOptions, type ToastApi as Api, type ToastGroupApi as GroupApi, type ToastGroupMachine as GroupMachine, type ToastGroupProps as GroupProps, type ToastGroupService as GroupService, type IntlTranslations, type ToastMachine as Machine, type Options, type Placement, type PromiseOptions, type ToastProps as Props, type ToastService as Service, type Status, type StatusChangeDetails, type ToastStore as Store, type ToastStoreProps as StoreProps, type ToastHeight, type ToastQueuePriority, type Type, anatomy, connect, createToastStore as createStore, machine };
|
package/dist/index.js
CHANGED
|
@@ -1,47 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
anatomy: () => import_toast.anatomy,
|
|
24
|
-
connect: () => import_toast2.connect,
|
|
25
|
-
createStore: () => import_toast4.createToastStore,
|
|
26
|
-
group: () => group,
|
|
27
|
-
machine: () => import_toast3.machine
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
28
4
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
5
|
+
const require_toast_group_connect = require("./toast-group.connect.js");
|
|
6
|
+
const require_toast_group_machine = require("./toast-group.machine.js");
|
|
7
|
+
const require_toast_anatomy = require("./toast.anatomy.js");
|
|
8
|
+
const require_toast_connect = require("./toast.connect.js");
|
|
9
|
+
const require_toast_machine = require("./toast.machine.js");
|
|
10
|
+
const require_toast_store = require("./toast.store.js");
|
|
11
|
+
// src/index.ts
|
|
12
|
+
const group = {
|
|
13
|
+
connect: require_toast_group_connect.groupConnect,
|
|
14
|
+
machine: require_toast_group_machine.groupMachine
|
|
39
15
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
group,
|
|
46
|
-
machine
|
|
47
|
-
});
|
|
16
|
+
exports.anatomy = require_toast_anatomy.anatomy;
|
|
17
|
+
exports.connect = require_toast_connect.connect;
|
|
18
|
+
exports.createStore = require_toast_store.createToastStore;
|
|
19
|
+
exports.group = group;
|
|
20
|
+
exports.machine = require_toast_machine.machine;
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
1
|
import { groupConnect } from "./toast-group.connect.mjs";
|
|
3
2
|
import { groupMachine } from "./toast-group.machine.mjs";
|
|
4
3
|
import { anatomy } from "./toast.anatomy.mjs";
|
|
5
4
|
import { connect } from "./toast.connect.mjs";
|
|
6
5
|
import { machine } from "./toast.machine.mjs";
|
|
7
6
|
import { createToastStore } from "./toast.store.mjs";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
anatomy,
|
|
14
|
-
connect,
|
|
15
|
-
createToastStore as createStore,
|
|
16
|
-
group,
|
|
17
|
-
machine
|
|
7
|
+
// src/index.ts
|
|
8
|
+
const group = {
|
|
9
|
+
connect: groupConnect,
|
|
10
|
+
machine: groupMachine
|
|
18
11
|
};
|
|
12
|
+
export { anatomy, connect, createToastStore as createStore, group, machine };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare function groupConnect<T extends PropTypes, O = any>(service: Service<ToastGroupSchema>, normalize: NormalizeProps<T>): ToastGroupApi<T, O>;
|
|
7
|
-
|
|
8
|
-
export { groupConnect };
|
|
1
|
+
import { ToastGroupApi, ToastGroupSchema } from "./toast.types.mjs";
|
|
2
|
+
import { Service } from "@zag-js/core";
|
|
3
|
+
import { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
4
|
+
export declare function groupConnect<T extends PropTypes, O = any>(service: Service<ToastGroupSchema>, normalize: NormalizeProps<T>): ToastGroupApi<T, O>;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare function groupConnect<T extends PropTypes, O = any>(service: Service<ToastGroupSchema>, normalize: NormalizeProps<T>): ToastGroupApi<T, O>;
|
|
7
|
-
|
|
8
|
-
export { groupConnect };
|
|
1
|
+
import { ToastGroupApi, ToastGroupSchema } from "./toast.types.js";
|
|
2
|
+
import { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
3
|
+
import { Service } from "@zag-js/core";
|
|
4
|
+
export declare function groupConnect<T extends PropTypes, O = any>(service: Service<ToastGroupSchema>, normalize: NormalizeProps<T>): ToastGroupApi<T, O>;
|
|
@@ -1,100 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/toast-group.connect.ts
|
|
31
|
-
var toast_group_connect_exports = {};
|
|
32
|
-
__export(toast_group_connect_exports, {
|
|
33
|
-
groupConnect: () => groupConnect
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
34
4
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
5
|
+
const require_toast_anatomy = require("./toast.anatomy.js");
|
|
6
|
+
const require_toast_dom = require("./toast.dom.js");
|
|
7
|
+
const require_toast_utils = require("./toast.utils.js");
|
|
8
|
+
let _zag_js_dom_query = require("@zag-js/dom-query");
|
|
9
|
+
// src/toast-group.connect.ts
|
|
40
10
|
function groupConnect(service, normalize) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
11
|
+
const { context, prop, send, refs, computed } = service;
|
|
12
|
+
return {
|
|
13
|
+
getCount() {
|
|
14
|
+
return context.get("toasts").length;
|
|
15
|
+
},
|
|
16
|
+
getToasts() {
|
|
17
|
+
return context.get("toasts");
|
|
18
|
+
},
|
|
19
|
+
getGroupProps(options = {}) {
|
|
20
|
+
const { label = "Notifications" } = options;
|
|
21
|
+
const { hotkey } = prop("store").attrs;
|
|
22
|
+
const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
|
|
23
|
+
const placement = computed("placement");
|
|
24
|
+
const [side, align = "center"] = placement.split("-");
|
|
25
|
+
return normalize.element({
|
|
26
|
+
...require_toast_anatomy.parts.group.attrs,
|
|
27
|
+
dir: prop("dir"),
|
|
28
|
+
tabIndex: -1,
|
|
29
|
+
role: "region",
|
|
30
|
+
"aria-label": `${label}, ${placement} (${hotkeyLabel})`,
|
|
31
|
+
id: require_toast_dom.getRegionId(placement),
|
|
32
|
+
"data-placement": placement,
|
|
33
|
+
"data-side": side,
|
|
34
|
+
"data-align": align,
|
|
35
|
+
"aria-live": "polite",
|
|
36
|
+
"aria-relevant": "additions text",
|
|
37
|
+
"aria-atomic": "false",
|
|
38
|
+
style: require_toast_utils.getGroupPlacementStyle(service, placement),
|
|
39
|
+
onMouseEnter() {
|
|
40
|
+
if (refs.get("ignoreMouseTimer").isActive()) return;
|
|
41
|
+
send({
|
|
42
|
+
type: "REGION.POINTER_ENTER",
|
|
43
|
+
placement
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
onMouseMove() {
|
|
47
|
+
if (refs.get("ignoreMouseTimer").isActive()) return;
|
|
48
|
+
send({
|
|
49
|
+
type: "REGION.POINTER_ENTER",
|
|
50
|
+
placement
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
onMouseLeave() {
|
|
54
|
+
if (refs.get("ignoreMouseTimer").isActive()) return;
|
|
55
|
+
send({
|
|
56
|
+
type: "REGION.POINTER_LEAVE",
|
|
57
|
+
placement
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
onFocus(event) {
|
|
61
|
+
send({
|
|
62
|
+
type: "REGION.FOCUS",
|
|
63
|
+
target: event.relatedTarget
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
onBlur(event) {
|
|
67
|
+
if (refs.get("isFocusWithin") && !(0, _zag_js_dom_query.contains)(event.currentTarget, event.relatedTarget)) queueMicrotask(() => send({ type: "REGION.BLUR" }));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
subscribe(fn) {
|
|
72
|
+
return prop("store").subscribe(() => fn(context.get("toasts")));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
96
75
|
}
|
|
97
|
-
|
|
98
|
-
0 && (module.exports = {
|
|
99
|
-
groupConnect
|
|
100
|
-
});
|
|
76
|
+
exports.groupConnect = groupConnect;
|
|
@@ -1,65 +1,72 @@
|
|
|
1
|
-
// src/toast-group.connect.ts
|
|
2
|
-
import { contains } from "@zag-js/dom-query";
|
|
3
1
|
import { parts } from "./toast.anatomy.mjs";
|
|
4
|
-
import
|
|
2
|
+
import { getRegionId } from "./toast.dom.mjs";
|
|
5
3
|
import { getGroupPlacementStyle } from "./toast.utils.mjs";
|
|
4
|
+
import { contains } from "@zag-js/dom-query";
|
|
5
|
+
// src/toast-group.connect.ts
|
|
6
6
|
function groupConnect(service, normalize) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
7
|
+
const { context, prop, send, refs, computed } = service;
|
|
8
|
+
return {
|
|
9
|
+
getCount() {
|
|
10
|
+
return context.get("toasts").length;
|
|
11
|
+
},
|
|
12
|
+
getToasts() {
|
|
13
|
+
return context.get("toasts");
|
|
14
|
+
},
|
|
15
|
+
getGroupProps(options = {}) {
|
|
16
|
+
const { label = "Notifications" } = options;
|
|
17
|
+
const { hotkey } = prop("store").attrs;
|
|
18
|
+
const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
|
|
19
|
+
const placement = computed("placement");
|
|
20
|
+
const [side, align = "center"] = placement.split("-");
|
|
21
|
+
return normalize.element({
|
|
22
|
+
...parts.group.attrs,
|
|
23
|
+
dir: prop("dir"),
|
|
24
|
+
tabIndex: -1,
|
|
25
|
+
role: "region",
|
|
26
|
+
"aria-label": `${label}, ${placement} (${hotkeyLabel})`,
|
|
27
|
+
id: getRegionId(placement),
|
|
28
|
+
"data-placement": placement,
|
|
29
|
+
"data-side": side,
|
|
30
|
+
"data-align": align,
|
|
31
|
+
"aria-live": "polite",
|
|
32
|
+
"aria-relevant": "additions text",
|
|
33
|
+
"aria-atomic": "false",
|
|
34
|
+
style: getGroupPlacementStyle(service, placement),
|
|
35
|
+
onMouseEnter() {
|
|
36
|
+
if (refs.get("ignoreMouseTimer").isActive()) return;
|
|
37
|
+
send({
|
|
38
|
+
type: "REGION.POINTER_ENTER",
|
|
39
|
+
placement
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
onMouseMove() {
|
|
43
|
+
if (refs.get("ignoreMouseTimer").isActive()) return;
|
|
44
|
+
send({
|
|
45
|
+
type: "REGION.POINTER_ENTER",
|
|
46
|
+
placement
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
onMouseLeave() {
|
|
50
|
+
if (refs.get("ignoreMouseTimer").isActive()) return;
|
|
51
|
+
send({
|
|
52
|
+
type: "REGION.POINTER_LEAVE",
|
|
53
|
+
placement
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
onFocus(event) {
|
|
57
|
+
send({
|
|
58
|
+
type: "REGION.FOCUS",
|
|
59
|
+
target: event.relatedTarget
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
onBlur(event) {
|
|
63
|
+
if (refs.get("isFocusWithin") && !contains(event.currentTarget, event.relatedTarget)) queueMicrotask(() => send({ type: "REGION.BLUR" }));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
subscribe(fn) {
|
|
68
|
+
return prop("store").subscribe(() => fn(context.get("toasts")));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
62
71
|
}
|
|
63
|
-
export {
|
|
64
|
-
groupConnect
|
|
65
|
-
};
|
|
72
|
+
export { groupConnect };
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import '@zag-js/types';
|
|
4
|
-
import '@zag-js/dom-query';
|
|
5
|
-
|
|
6
|
-
declare const groupMachine: _zag_js_core.Machine<ToastGroupSchema>;
|
|
7
|
-
|
|
8
|
-
export { groupMachine };
|
|
1
|
+
import { ToastGroupSchema } from "./toast.types.mjs";
|
|
2
|
+
export declare const groupMachine: import("@zag-js/core").Machine<ToastGroupSchema>;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import '@zag-js/types';
|
|
4
|
-
import '@zag-js/dom-query';
|
|
5
|
-
|
|
6
|
-
declare const groupMachine: _zag_js_core.Machine<ToastGroupSchema>;
|
|
7
|
-
|
|
8
|
-
export { groupMachine };
|
|
1
|
+
import { ToastGroupSchema } from "./toast.types.js";
|
|
2
|
+
export declare const groupMachine: import("@zag-js/core").Machine<ToastGroupSchema>;
|