@zag-js/toast 1.0.0 → 1.0.1
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 +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +3 -5
- package/dist/index.mjs +3 -5
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _zag_js_core from '@zag-js/core';
|
|
2
|
-
import { Service, EventObject } from '@zag-js/core';
|
|
2
|
+
import { Service, Machine, EventObject } from '@zag-js/core';
|
|
3
3
|
import { CommonProperties, Direction, DirectionProperty, Required, PropTypes, RequiredBy, NormalizeProps } from '@zag-js/types';
|
|
4
4
|
import * as _zag_js_anatomy from '@zag-js/anatomy';
|
|
5
5
|
|
|
@@ -117,6 +117,7 @@ type ToastSchema<O = any> = {
|
|
|
117
117
|
event: EventObject;
|
|
118
118
|
};
|
|
119
119
|
type ToastService = Service<ToastSchema>;
|
|
120
|
+
type ToastMachine = Machine<ToastSchema>;
|
|
120
121
|
interface ToastStoreProps {
|
|
121
122
|
/**
|
|
122
123
|
* The placement of the toast
|
|
@@ -194,6 +195,7 @@ type ToastGroupSchema = {
|
|
|
194
195
|
event: EventObject;
|
|
195
196
|
};
|
|
196
197
|
type ToastGroupService = Service<ToastGroupSchema>;
|
|
198
|
+
type ToastGroupMachine = Machine<ToastGroupSchema>;
|
|
197
199
|
interface ToastStore<V = any> {
|
|
198
200
|
/**
|
|
199
201
|
* The attributes of the toast store
|
|
@@ -355,13 +357,13 @@ declare const anatomy: _zag_js_anatomy.AnatomyInstance<"title" | "description" |
|
|
|
355
357
|
|
|
356
358
|
declare function connect<T extends PropTypes, O>(service: Service<ToastSchema<O>>, normalize: NormalizeProps<T>): ToastApi<T, O>;
|
|
357
359
|
|
|
358
|
-
declare const machine: _zag_js_core.
|
|
360
|
+
declare const machine: _zag_js_core.Machine<ToastSchema>;
|
|
359
361
|
|
|
360
362
|
declare function createToastStore<V = any>(props: ToastStoreProps): ToastStore<V>;
|
|
361
363
|
|
|
362
364
|
declare const group: {
|
|
363
365
|
connect: typeof groupConnect;
|
|
364
|
-
machine: _zag_js_core.
|
|
366
|
+
machine: _zag_js_core.Machine<ToastGroupSchema>;
|
|
365
367
|
};
|
|
366
368
|
|
|
367
|
-
export { type ActionOptions, type ToastApi as Api, type ToastGroupApi as GroupApi, type ToastGroupProps as GroupProps, type ToastGroupService as GroupService, 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 Type, anatomy, connect, createToastStore as createStore, group, machine };
|
|
369
|
+
export { type ActionOptions, type ToastApi as Api, type ToastGroupApi as GroupApi, type ToastGroupMachine as GroupMachine, type ToastGroupProps as GroupProps, type ToastGroupService as GroupService, 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 Type, anatomy, connect, createToastStore as createStore, group, machine };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _zag_js_core from '@zag-js/core';
|
|
2
|
-
import { Service, EventObject } from '@zag-js/core';
|
|
2
|
+
import { Service, Machine, EventObject } from '@zag-js/core';
|
|
3
3
|
import { CommonProperties, Direction, DirectionProperty, Required, PropTypes, RequiredBy, NormalizeProps } from '@zag-js/types';
|
|
4
4
|
import * as _zag_js_anatomy from '@zag-js/anatomy';
|
|
5
5
|
|
|
@@ -117,6 +117,7 @@ type ToastSchema<O = any> = {
|
|
|
117
117
|
event: EventObject;
|
|
118
118
|
};
|
|
119
119
|
type ToastService = Service<ToastSchema>;
|
|
120
|
+
type ToastMachine = Machine<ToastSchema>;
|
|
120
121
|
interface ToastStoreProps {
|
|
121
122
|
/**
|
|
122
123
|
* The placement of the toast
|
|
@@ -194,6 +195,7 @@ type ToastGroupSchema = {
|
|
|
194
195
|
event: EventObject;
|
|
195
196
|
};
|
|
196
197
|
type ToastGroupService = Service<ToastGroupSchema>;
|
|
198
|
+
type ToastGroupMachine = Machine<ToastGroupSchema>;
|
|
197
199
|
interface ToastStore<V = any> {
|
|
198
200
|
/**
|
|
199
201
|
* The attributes of the toast store
|
|
@@ -355,13 +357,13 @@ declare const anatomy: _zag_js_anatomy.AnatomyInstance<"title" | "description" |
|
|
|
355
357
|
|
|
356
358
|
declare function connect<T extends PropTypes, O>(service: Service<ToastSchema<O>>, normalize: NormalizeProps<T>): ToastApi<T, O>;
|
|
357
359
|
|
|
358
|
-
declare const machine: _zag_js_core.
|
|
360
|
+
declare const machine: _zag_js_core.Machine<ToastSchema>;
|
|
359
361
|
|
|
360
362
|
declare function createToastStore<V = any>(props: ToastStoreProps): ToastStore<V>;
|
|
361
363
|
|
|
362
364
|
declare const group: {
|
|
363
365
|
connect: typeof groupConnect;
|
|
364
|
-
machine: _zag_js_core.
|
|
366
|
+
machine: _zag_js_core.Machine<ToastGroupSchema>;
|
|
365
367
|
};
|
|
366
368
|
|
|
367
|
-
export { type ActionOptions, type ToastApi as Api, type ToastGroupApi as GroupApi, type ToastGroupProps as GroupProps, type ToastGroupService as GroupService, 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 Type, anatomy, connect, createToastStore as createStore, group, machine };
|
|
369
|
+
export { type ActionOptions, type ToastApi as Api, type ToastGroupApi as GroupApi, type ToastGroupMachine as GroupMachine, type ToastGroupProps as GroupProps, type ToastGroupService as GroupService, 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 Type, anatomy, connect, createToastStore as createStore, group, machine };
|
package/dist/index.js
CHANGED
|
@@ -229,11 +229,9 @@ function groupConnect(service, normalize) {
|
|
|
229
229
|
send({ type: "REGION.FOCUS", target: event.relatedTarget });
|
|
230
230
|
},
|
|
231
231
|
onBlur(event) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
});
|
|
232
|
+
if (refs.get("isFocusWithin") && !domQuery.contains(event.currentTarget, event.relatedTarget)) {
|
|
233
|
+
queueMicrotask(() => send({ type: "REGION.BLUR" }));
|
|
234
|
+
}
|
|
237
235
|
}
|
|
238
236
|
});
|
|
239
237
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -227,11 +227,9 @@ function groupConnect(service, normalize) {
|
|
|
227
227
|
send({ type: "REGION.FOCUS", target: event.relatedTarget });
|
|
228
228
|
},
|
|
229
229
|
onBlur(event) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
});
|
|
230
|
+
if (refs.get("isFocusWithin") && !contains(event.currentTarget, event.relatedTarget)) {
|
|
231
|
+
queueMicrotask(() => send({ type: "REGION.BLUR" }));
|
|
232
|
+
}
|
|
235
233
|
}
|
|
236
234
|
});
|
|
237
235
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/toast",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Core logic for the toast widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zag-js/anatomy": "1.0.
|
|
30
|
-
"@zag-js/
|
|
31
|
-
"@zag-js/
|
|
32
|
-
"@zag-js/dismissable": "1.0.
|
|
33
|
-
"@zag-js/utils": "1.0.
|
|
34
|
-
"@zag-js/types": "1.0.
|
|
29
|
+
"@zag-js/anatomy": "1.0.1",
|
|
30
|
+
"@zag-js/core": "1.0.1",
|
|
31
|
+
"@zag-js/dom-query": "1.0.1",
|
|
32
|
+
"@zag-js/dismissable": "1.0.1",
|
|
33
|
+
"@zag-js/utils": "1.0.1",
|
|
34
|
+
"@zag-js/types": "1.0.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"clean-package": "2.2.0"
|