@zag-js/toast 0.45.0 → 0.46.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 CHANGED
@@ -3,36 +3,23 @@ import * as _zag_js_core from '@zag-js/core';
3
3
  import { Machine, StateMachine } from '@zag-js/core';
4
4
  import * as _zag_js_anatomy from '@zag-js/anatomy';
5
5
 
6
- type Type = "success" | "error" | "loading" | "info" | "custom";
6
+ type Type = "success" | "error" | "loading" | "info" | (string & {});
7
7
  type Placement = "top-start" | "top" | "top-end" | "bottom-start" | "bottom" | "bottom-end";
8
- interface GenericOptions {
9
- render?: (api: any) => any;
10
- title?: any;
11
- description?: any;
12
- }
13
- interface DefaultGenericOptions {
14
- /**
15
- * Custom function to render the toast element.
16
- */
17
- render?: (api: MachineApi<any, DefaultGenericOptions>) => any;
8
+ type Status = "visible" | "dismissing" | "unmounted";
9
+ interface GenericOptions<T = string> {
18
10
  /**
19
11
  * The title of the toast.
20
12
  */
21
- title?: string;
13
+ title?: T;
22
14
  /**
23
15
  * The description of the toast.
24
16
  */
25
- description?: string;
17
+ description?: T;
26
18
  }
27
- type GlobalToastOptions<T extends GenericOptions> = Pick<T, "render"> & {
28
- /**
29
- * Whether to pause toast when the user leaves the browser tab
30
- */
31
- pauseOnPageIdle?: boolean;
32
- /**
33
- * Whether to pause the toast when interacted with
34
- */
35
- pauseOnInteraction?: boolean;
19
+ interface StatusChangeDetails {
20
+ status: Status;
21
+ }
22
+ interface Options<T> extends GenericOptions<T> {
36
23
  /**
37
24
  * The duration the toast will be visible
38
25
  */
@@ -46,35 +33,24 @@ type GlobalToastOptions<T extends GenericOptions> = Pick<T, "render"> & {
46
33
  * The placement of the toast
47
34
  */
48
35
  placement?: Placement;
49
- };
50
- type ToastOptions<T extends GenericOptions = DefaultGenericOptions> = T & {
51
36
  /**
52
37
  * The unique id of the toast
53
38
  */
54
- id: string;
39
+ id?: string;
55
40
  /**
56
41
  * The type of the toast
57
42
  */
58
43
  type: Type;
59
44
  /**
60
- * Function called when the toast has been closed and removed
61
- */
62
- onClose?: VoidFunction;
63
- /**
64
- * Function called when the toast is leaving
45
+ * Function called when the toast is visible
65
46
  */
66
- onClosing?: VoidFunction;
47
+ onStatusChange?(details: StatusChangeDetails): void;
67
48
  /**
68
- * Function called when the toast is shown
49
+ * The metadata of the toast
69
50
  */
70
- onOpen?: VoidFunction;
71
- /**
72
- * Function called when the toast is updated
73
- */
74
- onUpdate?: VoidFunction;
75
- };
76
- type Options<T extends GenericOptions> = Partial<ToastOptions<T> & GlobalToastOptions<T>>;
77
- type MachineContext<T extends GenericOptions = DefaultGenericOptions> = GlobalToastOptions<T> & CommonProperties & Omit<ToastOptions<T>, "removeDelay"> & {
51
+ meta?: Record<string, unknown>;
52
+ }
53
+ interface MachineContext<T = any> extends Omit<CommonProperties, "id">, MachinePrivateContext, Omit<Options<T>, "removeDelay"> {
78
54
  /**
79
55
  * The duration for the toast to kept alive before it is removed.
80
56
  * Useful for exit transitions.
@@ -92,23 +68,25 @@ type MachineContext<T extends GenericOptions = DefaultGenericOptions> = GlobalTo
92
68
  * The time left before the toast is removed
93
69
  */
94
70
  remaining: number;
95
- };
71
+ }
72
+ interface MachinePrivateContext {
73
+ }
96
74
  interface MachineState {
97
- value: "active" | "active:temp" | "dismissing" | "inactive" | "persist";
75
+ value: "visible" | "visible:updating" | "dismissing" | "unmounted" | "visible:persist";
98
76
  tags: "visible" | "paused" | "updating";
99
77
  }
100
- type State<T extends GenericOptions = DefaultGenericOptions> = StateMachine.State<MachineContext<T>, MachineState>;
78
+ type State<T = any> = StateMachine.State<MachineContext<T>, MachineState>;
101
79
  type Send = StateMachine.Send;
102
- type Service<T extends GenericOptions = DefaultGenericOptions> = Machine<MachineContext<T>, MachineState>;
103
- type GroupPublicContext<T extends GenericOptions> = GlobalToastOptions<T> & DirectionProperty & CommonProperties & {
80
+ type Service<T = any> = Machine<MachineContext<T>, MachineState>;
81
+ interface GroupPublicContext extends DirectionProperty, CommonProperties {
104
82
  /**
105
- * The gutter or spacing between toasts
83
+ * Whether to pause toast when the user leaves the browser tab
106
84
  */
107
- gutter: string;
85
+ pauseOnPageIdle: boolean;
108
86
  /**
109
- * The z-index applied to each toast group
87
+ * The gap or spacing between toasts
110
88
  */
111
- zIndex: number;
89
+ gap: number;
112
90
  /**
113
91
  * The maximum number of toasts that can be shown at once
114
92
  */
@@ -117,8 +95,30 @@ type GroupPublicContext<T extends GenericOptions> = GlobalToastOptions<T> & Dire
117
95
  * The offset from the safe environment edge of the viewport
118
96
  */
119
97
  offsets: string | Record<"left" | "right" | "bottom" | "top", string>;
120
- };
121
- type UserDefinedGroupContext<T extends GenericOptions> = RequiredBy<GroupPublicContext<T>, "id">;
98
+ /**
99
+ * The hotkey that will move focus to the toast group
100
+ */
101
+ hotkey: string[];
102
+ /**
103
+ * Whether the toasts should overlap each other
104
+ */
105
+ overlap?: boolean;
106
+ /**
107
+ * The placement of the toast
108
+ */
109
+ placement: Placement;
110
+ /**
111
+ * The duration for the toast to kept alive before it is removed.
112
+ * Useful for exit transitions.
113
+ */
114
+ removeDelay: number;
115
+ /**
116
+ * The duration the toast will be visible
117
+ */
118
+ duration?: number;
119
+ }
120
+ interface UserDefinedGroupContext extends RequiredBy<GroupPublicContext, "id"> {
121
+ }
122
122
  type GroupComputedContext = Readonly<{
123
123
  /**
124
124
  * @computed
@@ -126,35 +126,46 @@ type GroupComputedContext = Readonly<{
126
126
  */
127
127
  count: number;
128
128
  }>;
129
- interface GroupPrivateContext<T extends GenericOptions> {
129
+ interface GroupPrivateContext<T> extends GenericOptions<T> {
130
+ }
131
+ interface GroupMachineContext<T = any> extends GroupPublicContext, GroupPrivateContext<T>, GroupComputedContext {
130
132
  }
131
- interface GroupMachineContext<T extends GenericOptions = DefaultGenericOptions> extends GroupPublicContext<T>, GroupComputedContext, GroupPrivateContext<T> {
133
+ interface GroupMachineState {
134
+ value: "stack" | "overlap";
132
135
  }
133
- type GroupState<T extends GenericOptions = DefaultGenericOptions> = StateMachine.State<GroupMachineContext<T>>;
136
+ type GroupState<T = any> = StateMachine.State<GroupMachineContext<T>>;
134
137
  type GroupSend = StateMachine.Send;
138
+ type GroupService<T = any> = Machine<GroupMachineContext<T>, GroupMachineState>;
135
139
  type MaybeFunction<Value, Args> = Value | ((arg: Args) => Value);
136
- interface PromiseOptions<V, O extends GenericOptions = DefaultGenericOptions> {
137
- loading: ToastOptions<O>;
138
- success: MaybeFunction<ToastOptions<O>, V>;
139
- error: MaybeFunction<ToastOptions<O>, Error>;
140
+ interface PromiseOptions<V, O = any> {
141
+ loading: Options<O>;
142
+ success: MaybeFunction<Options<O>, V>;
143
+ error: MaybeFunction<Options<O>, Error>;
144
+ finally?: () => void | Promise<void>;
140
145
  }
141
146
  interface GroupProps {
147
+ /**
148
+ * The placement of the toast region
149
+ */
142
150
  placement: Placement;
151
+ /**
152
+ * The human-readable label for the toast region
153
+ */
143
154
  label?: string;
144
155
  }
145
- interface GroupMachineApi<T extends PropTypes = PropTypes, O extends GenericOptions = DefaultGenericOptions> {
156
+ interface GroupMachineApi<T extends PropTypes = PropTypes, O = any> {
146
157
  /**
147
158
  * The total number of toasts
148
159
  */
149
- count: number;
160
+ getCount(): number;
150
161
  /**
151
162
  * The active toasts
152
163
  */
153
- toasts: Service<O>[];
164
+ getToasts(): Service<O>[];
154
165
  /**
155
166
  * The active toasts by placement
156
167
  */
157
- toastsByPlacement: Partial<Record<Placement, Service<O>[]>>;
168
+ getToastsByPlacement(): Partial<Record<Placement, Service<O>[]>>;
158
169
  /**
159
170
  * Returns whether the toast id is visible
160
171
  */
@@ -210,14 +221,14 @@ interface GroupMachineApi<T extends PropTypes = PropTypes, O extends GenericOpti
210
221
  * - When the promise resolves, the toast will be updated with the success options.
211
222
  * - When the promise rejects, the toast will be updated with the error options.
212
223
  */
213
- promise<T>(promise: Promise<T>, options: PromiseOptions<T, O>, shared?: Partial<ToastOptions<O>>): Promise<T>;
224
+ promise<T>(promise: Promise<T> | (() => Promise<T>), options: PromiseOptions<T, O>, shared?: Partial<Options<O>>): string;
214
225
  /**
215
226
  * Function to subscribe to the toast group.
216
227
  */
217
- subscribe(callback: (toasts: Service<O>[]) => void): VoidFunction;
228
+ subscribe(callback: (toasts: Options<O>[]) => void): VoidFunction;
218
229
  getGroupProps(options: GroupProps): T["element"];
219
230
  }
220
- type MachineApi<T extends PropTypes = PropTypes, O extends GenericOptions = DefaultGenericOptions> = Pick<O, "title" | "description"> & {
231
+ interface MachineApi<T extends PropTypes = PropTypes, O = any> extends GenericOptions<O> {
221
232
  /**
222
233
  * The type of the toast.
223
234
  */
@@ -252,23 +263,26 @@ type MachineApi<T extends PropTypes = PropTypes, O extends GenericOptions = Defa
252
263
  dismiss(): void;
253
264
  rootProps: T["element"];
254
265
  titleProps: T["element"];
266
+ ghostBeforeProps: T["element"];
267
+ ghostAfterProps: T["element"];
255
268
  descriptionProps: T["element"];
256
269
  closeTriggerProps: T["button"];
257
- };
270
+ actionTriggerProps: T["button"];
271
+ }
258
272
 
259
- declare function groupConnect<T extends PropTypes, O extends GenericOptions = DefaultGenericOptions>(state: GroupState<O>, send: GroupSend, normalize: NormalizeProps<T>): GroupMachineApi<T, O>;
273
+ declare function groupConnect<T extends PropTypes, O = any>(serviceOrState: GroupState<O> | GroupService<O>, send: GroupSend, normalize: NormalizeProps<T>): GroupMachineApi<T, O>;
260
274
 
261
- declare function groupMachine<T extends GenericOptions>(userContext: UserDefinedGroupContext<T>): _zag_js_core.Machine<GroupMachineContext<T>, _zag_js_core.StateMachine.StateSchema, _zag_js_core.StateMachine.AnyEventObject>;
275
+ declare function groupMachine<T = any>(userContext: UserDefinedGroupContext): _zag_js_core.Machine<GroupMachineContext<T>, GroupMachineState, _zag_js_core.StateMachine.AnyEventObject>;
262
276
 
263
- declare function createToastMachine<T extends GenericOptions = DefaultGenericOptions>(options?: Options<T>): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
277
+ declare function createToastMachine<T>(options: Options<T>): _zag_js_core.Machine<MachineContext<T>, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
264
278
 
265
- declare const anatomy: _zag_js_anatomy.AnatomyInstance<"group" | "title" | "root" | "description" | "closeTrigger">;
279
+ declare const anatomy: _zag_js_anatomy.AnatomyInstance<"title" | "group" | "root" | "ghost" | "description" | "actionTrigger" | "closeTrigger">;
266
280
 
267
- declare function connect<T extends PropTypes, O extends GenericOptions>(state: State<O>, send: Send, normalize: NormalizeProps<T>): MachineApi<T, O>;
281
+ declare function connect<T extends PropTypes, O>(state: State<O>, send: Send, normalize: NormalizeProps<T>): MachineApi<T, O>;
268
282
 
269
283
  declare const group: {
270
284
  connect: typeof groupConnect;
271
285
  machine: typeof groupMachine;
272
286
  };
273
287
 
274
- export { type MachineApi as Api, type DefaultGenericOptions, type GenericOptions, type GroupMachineApi as GroupApi, type GroupMachineContext, type GroupProps, type GroupState, type MachineContext, type Placement, type PromiseOptions, type Service, type ToastOptions, type Type, anatomy, connect, createToastMachine as createMachine, group };
288
+ export { type MachineApi as Api, type GenericOptions, type GroupMachineApi as GroupApi, type GroupMachineContext, type GroupProps, type GroupService, type GroupState, type MachineContext, type Options, type Placement, type PromiseOptions, type Service, type Status, type StatusChangeDetails, type Type, anatomy, connect, createToastMachine as createMachine, group };
package/dist/index.d.ts CHANGED
@@ -3,36 +3,23 @@ import * as _zag_js_core from '@zag-js/core';
3
3
  import { Machine, StateMachine } from '@zag-js/core';
4
4
  import * as _zag_js_anatomy from '@zag-js/anatomy';
5
5
 
6
- type Type = "success" | "error" | "loading" | "info" | "custom";
6
+ type Type = "success" | "error" | "loading" | "info" | (string & {});
7
7
  type Placement = "top-start" | "top" | "top-end" | "bottom-start" | "bottom" | "bottom-end";
8
- interface GenericOptions {
9
- render?: (api: any) => any;
10
- title?: any;
11
- description?: any;
12
- }
13
- interface DefaultGenericOptions {
14
- /**
15
- * Custom function to render the toast element.
16
- */
17
- render?: (api: MachineApi<any, DefaultGenericOptions>) => any;
8
+ type Status = "visible" | "dismissing" | "unmounted";
9
+ interface GenericOptions<T = string> {
18
10
  /**
19
11
  * The title of the toast.
20
12
  */
21
- title?: string;
13
+ title?: T;
22
14
  /**
23
15
  * The description of the toast.
24
16
  */
25
- description?: string;
17
+ description?: T;
26
18
  }
27
- type GlobalToastOptions<T extends GenericOptions> = Pick<T, "render"> & {
28
- /**
29
- * Whether to pause toast when the user leaves the browser tab
30
- */
31
- pauseOnPageIdle?: boolean;
32
- /**
33
- * Whether to pause the toast when interacted with
34
- */
35
- pauseOnInteraction?: boolean;
19
+ interface StatusChangeDetails {
20
+ status: Status;
21
+ }
22
+ interface Options<T> extends GenericOptions<T> {
36
23
  /**
37
24
  * The duration the toast will be visible
38
25
  */
@@ -46,35 +33,24 @@ type GlobalToastOptions<T extends GenericOptions> = Pick<T, "render"> & {
46
33
  * The placement of the toast
47
34
  */
48
35
  placement?: Placement;
49
- };
50
- type ToastOptions<T extends GenericOptions = DefaultGenericOptions> = T & {
51
36
  /**
52
37
  * The unique id of the toast
53
38
  */
54
- id: string;
39
+ id?: string;
55
40
  /**
56
41
  * The type of the toast
57
42
  */
58
43
  type: Type;
59
44
  /**
60
- * Function called when the toast has been closed and removed
61
- */
62
- onClose?: VoidFunction;
63
- /**
64
- * Function called when the toast is leaving
45
+ * Function called when the toast is visible
65
46
  */
66
- onClosing?: VoidFunction;
47
+ onStatusChange?(details: StatusChangeDetails): void;
67
48
  /**
68
- * Function called when the toast is shown
49
+ * The metadata of the toast
69
50
  */
70
- onOpen?: VoidFunction;
71
- /**
72
- * Function called when the toast is updated
73
- */
74
- onUpdate?: VoidFunction;
75
- };
76
- type Options<T extends GenericOptions> = Partial<ToastOptions<T> & GlobalToastOptions<T>>;
77
- type MachineContext<T extends GenericOptions = DefaultGenericOptions> = GlobalToastOptions<T> & CommonProperties & Omit<ToastOptions<T>, "removeDelay"> & {
51
+ meta?: Record<string, unknown>;
52
+ }
53
+ interface MachineContext<T = any> extends Omit<CommonProperties, "id">, MachinePrivateContext, Omit<Options<T>, "removeDelay"> {
78
54
  /**
79
55
  * The duration for the toast to kept alive before it is removed.
80
56
  * Useful for exit transitions.
@@ -92,23 +68,25 @@ type MachineContext<T extends GenericOptions = DefaultGenericOptions> = GlobalTo
92
68
  * The time left before the toast is removed
93
69
  */
94
70
  remaining: number;
95
- };
71
+ }
72
+ interface MachinePrivateContext {
73
+ }
96
74
  interface MachineState {
97
- value: "active" | "active:temp" | "dismissing" | "inactive" | "persist";
75
+ value: "visible" | "visible:updating" | "dismissing" | "unmounted" | "visible:persist";
98
76
  tags: "visible" | "paused" | "updating";
99
77
  }
100
- type State<T extends GenericOptions = DefaultGenericOptions> = StateMachine.State<MachineContext<T>, MachineState>;
78
+ type State<T = any> = StateMachine.State<MachineContext<T>, MachineState>;
101
79
  type Send = StateMachine.Send;
102
- type Service<T extends GenericOptions = DefaultGenericOptions> = Machine<MachineContext<T>, MachineState>;
103
- type GroupPublicContext<T extends GenericOptions> = GlobalToastOptions<T> & DirectionProperty & CommonProperties & {
80
+ type Service<T = any> = Machine<MachineContext<T>, MachineState>;
81
+ interface GroupPublicContext extends DirectionProperty, CommonProperties {
104
82
  /**
105
- * The gutter or spacing between toasts
83
+ * Whether to pause toast when the user leaves the browser tab
106
84
  */
107
- gutter: string;
85
+ pauseOnPageIdle: boolean;
108
86
  /**
109
- * The z-index applied to each toast group
87
+ * The gap or spacing between toasts
110
88
  */
111
- zIndex: number;
89
+ gap: number;
112
90
  /**
113
91
  * The maximum number of toasts that can be shown at once
114
92
  */
@@ -117,8 +95,30 @@ type GroupPublicContext<T extends GenericOptions> = GlobalToastOptions<T> & Dire
117
95
  * The offset from the safe environment edge of the viewport
118
96
  */
119
97
  offsets: string | Record<"left" | "right" | "bottom" | "top", string>;
120
- };
121
- type UserDefinedGroupContext<T extends GenericOptions> = RequiredBy<GroupPublicContext<T>, "id">;
98
+ /**
99
+ * The hotkey that will move focus to the toast group
100
+ */
101
+ hotkey: string[];
102
+ /**
103
+ * Whether the toasts should overlap each other
104
+ */
105
+ overlap?: boolean;
106
+ /**
107
+ * The placement of the toast
108
+ */
109
+ placement: Placement;
110
+ /**
111
+ * The duration for the toast to kept alive before it is removed.
112
+ * Useful for exit transitions.
113
+ */
114
+ removeDelay: number;
115
+ /**
116
+ * The duration the toast will be visible
117
+ */
118
+ duration?: number;
119
+ }
120
+ interface UserDefinedGroupContext extends RequiredBy<GroupPublicContext, "id"> {
121
+ }
122
122
  type GroupComputedContext = Readonly<{
123
123
  /**
124
124
  * @computed
@@ -126,35 +126,46 @@ type GroupComputedContext = Readonly<{
126
126
  */
127
127
  count: number;
128
128
  }>;
129
- interface GroupPrivateContext<T extends GenericOptions> {
129
+ interface GroupPrivateContext<T> extends GenericOptions<T> {
130
+ }
131
+ interface GroupMachineContext<T = any> extends GroupPublicContext, GroupPrivateContext<T>, GroupComputedContext {
130
132
  }
131
- interface GroupMachineContext<T extends GenericOptions = DefaultGenericOptions> extends GroupPublicContext<T>, GroupComputedContext, GroupPrivateContext<T> {
133
+ interface GroupMachineState {
134
+ value: "stack" | "overlap";
132
135
  }
133
- type GroupState<T extends GenericOptions = DefaultGenericOptions> = StateMachine.State<GroupMachineContext<T>>;
136
+ type GroupState<T = any> = StateMachine.State<GroupMachineContext<T>>;
134
137
  type GroupSend = StateMachine.Send;
138
+ type GroupService<T = any> = Machine<GroupMachineContext<T>, GroupMachineState>;
135
139
  type MaybeFunction<Value, Args> = Value | ((arg: Args) => Value);
136
- interface PromiseOptions<V, O extends GenericOptions = DefaultGenericOptions> {
137
- loading: ToastOptions<O>;
138
- success: MaybeFunction<ToastOptions<O>, V>;
139
- error: MaybeFunction<ToastOptions<O>, Error>;
140
+ interface PromiseOptions<V, O = any> {
141
+ loading: Options<O>;
142
+ success: MaybeFunction<Options<O>, V>;
143
+ error: MaybeFunction<Options<O>, Error>;
144
+ finally?: () => void | Promise<void>;
140
145
  }
141
146
  interface GroupProps {
147
+ /**
148
+ * The placement of the toast region
149
+ */
142
150
  placement: Placement;
151
+ /**
152
+ * The human-readable label for the toast region
153
+ */
143
154
  label?: string;
144
155
  }
145
- interface GroupMachineApi<T extends PropTypes = PropTypes, O extends GenericOptions = DefaultGenericOptions> {
156
+ interface GroupMachineApi<T extends PropTypes = PropTypes, O = any> {
146
157
  /**
147
158
  * The total number of toasts
148
159
  */
149
- count: number;
160
+ getCount(): number;
150
161
  /**
151
162
  * The active toasts
152
163
  */
153
- toasts: Service<O>[];
164
+ getToasts(): Service<O>[];
154
165
  /**
155
166
  * The active toasts by placement
156
167
  */
157
- toastsByPlacement: Partial<Record<Placement, Service<O>[]>>;
168
+ getToastsByPlacement(): Partial<Record<Placement, Service<O>[]>>;
158
169
  /**
159
170
  * Returns whether the toast id is visible
160
171
  */
@@ -210,14 +221,14 @@ interface GroupMachineApi<T extends PropTypes = PropTypes, O extends GenericOpti
210
221
  * - When the promise resolves, the toast will be updated with the success options.
211
222
  * - When the promise rejects, the toast will be updated with the error options.
212
223
  */
213
- promise<T>(promise: Promise<T>, options: PromiseOptions<T, O>, shared?: Partial<ToastOptions<O>>): Promise<T>;
224
+ promise<T>(promise: Promise<T> | (() => Promise<T>), options: PromiseOptions<T, O>, shared?: Partial<Options<O>>): string;
214
225
  /**
215
226
  * Function to subscribe to the toast group.
216
227
  */
217
- subscribe(callback: (toasts: Service<O>[]) => void): VoidFunction;
228
+ subscribe(callback: (toasts: Options<O>[]) => void): VoidFunction;
218
229
  getGroupProps(options: GroupProps): T["element"];
219
230
  }
220
- type MachineApi<T extends PropTypes = PropTypes, O extends GenericOptions = DefaultGenericOptions> = Pick<O, "title" | "description"> & {
231
+ interface MachineApi<T extends PropTypes = PropTypes, O = any> extends GenericOptions<O> {
221
232
  /**
222
233
  * The type of the toast.
223
234
  */
@@ -252,23 +263,26 @@ type MachineApi<T extends PropTypes = PropTypes, O extends GenericOptions = Defa
252
263
  dismiss(): void;
253
264
  rootProps: T["element"];
254
265
  titleProps: T["element"];
266
+ ghostBeforeProps: T["element"];
267
+ ghostAfterProps: T["element"];
255
268
  descriptionProps: T["element"];
256
269
  closeTriggerProps: T["button"];
257
- };
270
+ actionTriggerProps: T["button"];
271
+ }
258
272
 
259
- declare function groupConnect<T extends PropTypes, O extends GenericOptions = DefaultGenericOptions>(state: GroupState<O>, send: GroupSend, normalize: NormalizeProps<T>): GroupMachineApi<T, O>;
273
+ declare function groupConnect<T extends PropTypes, O = any>(serviceOrState: GroupState<O> | GroupService<O>, send: GroupSend, normalize: NormalizeProps<T>): GroupMachineApi<T, O>;
260
274
 
261
- declare function groupMachine<T extends GenericOptions>(userContext: UserDefinedGroupContext<T>): _zag_js_core.Machine<GroupMachineContext<T>, _zag_js_core.StateMachine.StateSchema, _zag_js_core.StateMachine.AnyEventObject>;
275
+ declare function groupMachine<T = any>(userContext: UserDefinedGroupContext): _zag_js_core.Machine<GroupMachineContext<T>, GroupMachineState, _zag_js_core.StateMachine.AnyEventObject>;
262
276
 
263
- declare function createToastMachine<T extends GenericOptions = DefaultGenericOptions>(options?: Options<T>): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
277
+ declare function createToastMachine<T>(options: Options<T>): _zag_js_core.Machine<MachineContext<T>, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
264
278
 
265
- declare const anatomy: _zag_js_anatomy.AnatomyInstance<"group" | "title" | "root" | "description" | "closeTrigger">;
279
+ declare const anatomy: _zag_js_anatomy.AnatomyInstance<"title" | "group" | "root" | "ghost" | "description" | "actionTrigger" | "closeTrigger">;
266
280
 
267
- declare function connect<T extends PropTypes, O extends GenericOptions>(state: State<O>, send: Send, normalize: NormalizeProps<T>): MachineApi<T, O>;
281
+ declare function connect<T extends PropTypes, O>(state: State<O>, send: Send, normalize: NormalizeProps<T>): MachineApi<T, O>;
268
282
 
269
283
  declare const group: {
270
284
  connect: typeof groupConnect;
271
285
  machine: typeof groupMachine;
272
286
  };
273
287
 
274
- export { type MachineApi as Api, type DefaultGenericOptions, type GenericOptions, type GroupMachineApi as GroupApi, type GroupMachineContext, type GroupProps, type GroupState, type MachineContext, type Placement, type PromiseOptions, type Service, type ToastOptions, type Type, anatomy, connect, createToastMachine as createMachine, group };
288
+ export { type MachineApi as Api, type GenericOptions, type GroupMachineApi as GroupApi, type GroupMachineContext, type GroupProps, type GroupService, type GroupState, type MachineContext, type Options, type Placement, type PromiseOptions, type Service, type Status, type StatusChangeDetails, type Type, anatomy, connect, createToastMachine as createMachine, group };