@zag-js/toast 0.0.0-dev-20221212111455 → 0.0.0-dev-20221212123305

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +22 -22
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -2,9 +2,9 @@ import * as _zag_js_core from '@zag-js/core';
2
2
  import { Machine, StateMachine } from '@zag-js/core';
3
3
  import { RootProperties, CommonProperties, Direction, DirectionProperty, Context, RequiredBy, PropTypes, NormalizeProps } from '@zag-js/types';
4
4
 
5
- declare type Type = "success" | "error" | "loading" | "info" | "custom";
6
- declare type Placement = "top-start" | "top" | "top-end" | "bottom-start" | "bottom" | "bottom-end";
7
- declare type SharedContext = {
5
+ type Type = "success" | "error" | "loading" | "info" | "custom";
6
+ type Placement = "top-start" | "top" | "top-end" | "bottom-start" | "bottom" | "bottom-end";
7
+ type SharedContext = {
8
8
  /**
9
9
  * Whether to pause toast when the user leaves the browser tab
10
10
  */
@@ -14,7 +14,7 @@ declare type SharedContext = {
14
14
  */
15
15
  pauseOnInteraction?: boolean;
16
16
  };
17
- declare type ToastOptions = {
17
+ type ToastOptions = {
18
18
  /**
19
19
  * The unique id of the toast
20
20
  */
@@ -65,11 +65,11 @@ declare type ToastOptions = {
65
65
  */
66
66
  onUpdate?: VoidFunction;
67
67
  };
68
- declare type Options = Partial<ToastOptions>;
69
- declare type RenderOptions = Omit<ToastOptions, "render"> & {
68
+ type Options = Partial<ToastOptions>;
69
+ type RenderOptions = Omit<ToastOptions, "render"> & {
70
70
  dismiss(): void;
71
71
  };
72
- declare type MachineContext = SharedContext & RootProperties & CommonProperties & Omit<ToastOptions, "removeDelay"> & {
72
+ type MachineContext = SharedContext & RootProperties & CommonProperties & Omit<ToastOptions, "removeDelay"> & {
73
73
  /**
74
74
  * The duration for the toast to kept alive before it is removed.
75
75
  * Useful for exit transitions.
@@ -88,14 +88,14 @@ declare type MachineContext = SharedContext & RootProperties & CommonProperties
88
88
  */
89
89
  remaining: number;
90
90
  };
91
- declare type MachineState = {
91
+ type MachineState = {
92
92
  value: "active" | "active:temp" | "dismissing" | "inactive" | "persist";
93
93
  tags: "visible" | "paused" | "updating";
94
94
  };
95
- declare type State = StateMachine.State<MachineContext, MachineState>;
96
- declare type Send = StateMachine.Send;
97
- declare type Service = Machine<MachineContext, MachineState>;
98
- declare type GroupPublicContext = SharedContext & DirectionProperty & CommonProperties & {
95
+ type State = StateMachine.State<MachineContext, MachineState>;
96
+ type Send = StateMachine.Send;
97
+ type Service = Machine<MachineContext, MachineState>;
98
+ type GroupPublicContext = SharedContext & DirectionProperty & CommonProperties & {
99
99
  /**
100
100
  * The gutter or spacing between toasts
101
101
  */
@@ -113,29 +113,29 @@ declare type GroupPublicContext = SharedContext & DirectionProperty & CommonProp
113
113
  */
114
114
  offsets: string | Record<"left" | "right" | "bottom" | "top", string>;
115
115
  };
116
- declare type UserDefinedGroupContext = RequiredBy<GroupPublicContext, "id">;
117
- declare type GroupComputedContext = Readonly<{
116
+ type UserDefinedGroupContext = RequiredBy<GroupPublicContext, "id">;
117
+ type GroupComputedContext = Readonly<{
118
118
  /**
119
119
  * @computed
120
120
  * The total number of toasts in the group
121
121
  */
122
122
  readonly count: number;
123
123
  }>;
124
- declare type GroupPrivateContext = Context<{}>;
125
- declare type GroupMachineContext = GroupPublicContext & GroupComputedContext & GroupPrivateContext;
126
- declare type GroupState = StateMachine.State<GroupMachineContext>;
127
- declare type GroupSend = (event: StateMachine.Event<StateMachine.AnyEventObject>) => void;
128
- declare type MaybeFunction<Value, Args> = Value | ((arg: Args) => Value);
129
- declare type PromiseOptions<Value> = {
124
+ type GroupPrivateContext = Context<{}>;
125
+ type GroupMachineContext = GroupPublicContext & GroupComputedContext & GroupPrivateContext;
126
+ type GroupState = StateMachine.State<GroupMachineContext>;
127
+ type GroupSend = (event: StateMachine.Event<StateMachine.AnyEventObject>) => void;
128
+ type MaybeFunction<Value, Args> = Value | ((arg: Args) => Value);
129
+ type PromiseOptions<Value> = {
130
130
  loading: ToastOptions;
131
131
  success: MaybeFunction<ToastOptions, Value>;
132
132
  error: MaybeFunction<ToastOptions, Error>;
133
133
  };
134
- declare type GroupProps = {
134
+ type GroupProps = {
135
135
  placement: Placement;
136
136
  label?: string;
137
137
  };
138
- declare type Toaster = {
138
+ type Toaster = {
139
139
  count: number;
140
140
  isVisible(id: string): boolean;
141
141
  upsert(options: ToastOptions): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/toast",
3
- "version": "0.0.0-dev-20221212111455",
3
+ "version": "0.0.0-dev-20221212123305",
4
4
  "description": "Core logic for the toast widget implemented as a state machine",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@zag-js/anatomy": "0.1.1",
33
- "@zag-js/core": "0.2.2",
33
+ "@zag-js/core": "0.0.0-dev-20221212123305",
34
34
  "@zag-js/types": "0.3.1"
35
35
  },
36
36
  "devDependencies": {