foldkit 0.69.0 → 0.71.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/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +2 -0
- package/dist/ui/toast/index.d.ts +620 -0
- package/dist/ui/toast/index.d.ts.map +1 -0
- package/dist/ui/toast/index.js +158 -0
- package/dist/ui/toast/public.d.ts +4 -0
- package/dist/ui/toast/public.d.ts.map +1 -0
- package/dist/ui/toast/public.js +1 -0
- package/dist/ui/toast/schema.d.ts +143 -0
- package/dist/ui/toast/schema.d.ts.map +1 -0
- package/dist/ui/toast/schema.js +71 -0
- package/dist/ui/toast/update.d.ts +484 -0
- package/dist/ui/toast/update.d.ts.map +1 -0
- package/dist/ui/toast/update.js +203 -0
- package/dist/ui/tooltip/index.d.ts +96 -0
- package/dist/ui/tooltip/index.d.ts.map +1 -0
- package/dist/ui/tooltip/index.js +244 -0
- package/dist/ui/tooltip/public.d.ts +4 -0
- package/dist/ui/tooltip/public.d.ts.map +1 -0
- package/dist/ui/tooltip/public.js +1 -0
- package/package.json +9 -1
package/dist/ui/index.d.ts
CHANGED
|
@@ -17,5 +17,7 @@ export * as Select from './select/public';
|
|
|
17
17
|
export * as Switch from './switch/public';
|
|
18
18
|
export * as Textarea from './textarea/public';
|
|
19
19
|
export * as Tabs from './tabs/public';
|
|
20
|
+
export * as Toast from './toast/public';
|
|
21
|
+
export * as Tooltip from './tooltip/public';
|
|
20
22
|
export * as Transition from './transition/public';
|
|
21
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,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,qBAAqB,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA"}
|
package/dist/ui/index.js
CHANGED
|
@@ -17,4 +17,6 @@ export * as Select from './select/public';
|
|
|
17
17
|
export * as Switch from './switch/public';
|
|
18
18
|
export * as Textarea from './textarea/public';
|
|
19
19
|
export * as Tabs from './tabs/public';
|
|
20
|
+
export * as Toast from './toast/public';
|
|
21
|
+
export * as Tooltip from './tooltip/public';
|
|
20
22
|
export * as Transition from './transition/public';
|
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
import { Schema as S } from 'effect';
|
|
2
|
+
import { type Attribute, type Html } from '../../html';
|
|
3
|
+
import { Dismissed, DismissedAll, ElapsedDuration, GotTransitionMessage, HoveredEntry, LeftEntry, Position, Variant } from './schema';
|
|
4
|
+
import { DismissAfter } from './update';
|
|
5
|
+
export type { InitConfig } from './schema';
|
|
6
|
+
export type { ShowInput } from './update';
|
|
7
|
+
export { Variant, Position, Dismissed, DismissedAll, ElapsedDuration, HoveredEntry, LeftEntry, GotTransitionMessage, DismissAfter, };
|
|
8
|
+
/** Handlers passed to `renderEntry`. Attach `dismiss` to a close button's
|
|
9
|
+
* `OnClick` to let users dismiss the entry manually. */
|
|
10
|
+
export type EntryHandlers<ParentMessage> = Readonly<{
|
|
11
|
+
dismiss: ParentMessage;
|
|
12
|
+
}>;
|
|
13
|
+
/** Factory that binds `Ui.Toast` to a user-provided payload schema. The
|
|
14
|
+
* returned module contains everything needed to wire a toast stack into an
|
|
15
|
+
* app: `Model`, `Message`, `Entry`, `Added`, `init`, `update`, `show` /
|
|
16
|
+
* `dismiss` / `dismissAll` helpers, and the headless `view`.
|
|
17
|
+
*
|
|
18
|
+
* The payload is whatever content shape the consumer supplies via Schema.
|
|
19
|
+
* The component never reads it — it flows through to `renderEntry`. The
|
|
20
|
+
* component itself owns only lifecycle and a11y fields (id, variant,
|
|
21
|
+
* transition, dismiss timer, hover state).
|
|
22
|
+
*
|
|
23
|
+
* Consume the bound module's exports everywhere — `Toast.Model` in your app
|
|
24
|
+
* Model, `Toast.Message` in your parent Message union, `Toast.show` /
|
|
25
|
+
* `Toast.dismiss` in your update, `Toast.view` in your view. The top-level
|
|
26
|
+
* exports (`Variant`, `Position`, static message tags, `DismissAfter`) are
|
|
27
|
+
* payload-independent and safe to reference when you need them without a
|
|
28
|
+
* bound module, but the typical path is through the factory return.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const ToastPayload = S.Struct({
|
|
33
|
+
* bodyText: S.String,
|
|
34
|
+
* maybeLink: S.OptionFromSelf(S.Struct({
|
|
35
|
+
* href: S.String,
|
|
36
|
+
* text: S.String,
|
|
37
|
+
* })),
|
|
38
|
+
* })
|
|
39
|
+
* export const Toast = Ui.Toast.make(ToastPayload)
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare const make: <A, I>(payloadSchema: S.Schema<A, I>) => {
|
|
43
|
+
readonly view: <ParentMessage>(config: Readonly<{
|
|
44
|
+
model: {
|
|
45
|
+
readonly entries: readonly {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly transition: {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly isShowing: boolean;
|
|
50
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
51
|
+
};
|
|
52
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
53
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
54
|
+
readonly pendingDismissVersion: number;
|
|
55
|
+
readonly isHovered: boolean;
|
|
56
|
+
readonly payload: A;
|
|
57
|
+
}[];
|
|
58
|
+
readonly id: string;
|
|
59
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
60
|
+
readonly nextEntryKey: number;
|
|
61
|
+
};
|
|
62
|
+
position: Position;
|
|
63
|
+
toParentMessage: (message: Dismissed | HoveredEntry | LeftEntry) => ParentMessage;
|
|
64
|
+
renderEntry: (entry: {
|
|
65
|
+
readonly id: string;
|
|
66
|
+
readonly transition: {
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly isShowing: boolean;
|
|
69
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
70
|
+
};
|
|
71
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
72
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
73
|
+
readonly pendingDismissVersion: number;
|
|
74
|
+
readonly isHovered: boolean;
|
|
75
|
+
readonly payload: A;
|
|
76
|
+
}, handlers: Readonly<{
|
|
77
|
+
dismiss: ParentMessage;
|
|
78
|
+
}>) => Html;
|
|
79
|
+
ariaLabel?: string;
|
|
80
|
+
className?: string;
|
|
81
|
+
attributes?: readonly Attribute<ParentMessage>[];
|
|
82
|
+
entryClassName?: string;
|
|
83
|
+
entryAttributes?: readonly Attribute<ParentMessage>[];
|
|
84
|
+
}>) => Html;
|
|
85
|
+
readonly lazy: <ParentMessage>(staticConfig: Omit<Readonly<{
|
|
86
|
+
model: {
|
|
87
|
+
readonly entries: readonly {
|
|
88
|
+
readonly id: string;
|
|
89
|
+
readonly transition: {
|
|
90
|
+
readonly id: string;
|
|
91
|
+
readonly isShowing: boolean;
|
|
92
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
93
|
+
};
|
|
94
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
95
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
96
|
+
readonly pendingDismissVersion: number;
|
|
97
|
+
readonly isHovered: boolean;
|
|
98
|
+
readonly payload: A;
|
|
99
|
+
}[];
|
|
100
|
+
readonly id: string;
|
|
101
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
102
|
+
readonly nextEntryKey: number;
|
|
103
|
+
};
|
|
104
|
+
position: Position;
|
|
105
|
+
toParentMessage: (message: Dismissed | HoveredEntry | LeftEntry) => ParentMessage;
|
|
106
|
+
renderEntry: (entry: {
|
|
107
|
+
readonly id: string;
|
|
108
|
+
readonly transition: {
|
|
109
|
+
readonly id: string;
|
|
110
|
+
readonly isShowing: boolean;
|
|
111
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
112
|
+
};
|
|
113
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
114
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
115
|
+
readonly pendingDismissVersion: number;
|
|
116
|
+
readonly isHovered: boolean;
|
|
117
|
+
readonly payload: A;
|
|
118
|
+
}, handlers: Readonly<{
|
|
119
|
+
dismiss: ParentMessage;
|
|
120
|
+
}>) => Html;
|
|
121
|
+
ariaLabel?: string;
|
|
122
|
+
className?: string;
|
|
123
|
+
attributes?: readonly Attribute<ParentMessage>[];
|
|
124
|
+
entryClassName?: string;
|
|
125
|
+
entryAttributes?: readonly Attribute<ParentMessage>[];
|
|
126
|
+
}>, "model" | "toParentMessage" | "renderEntry">) => ((model: {
|
|
127
|
+
readonly entries: readonly {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly transition: {
|
|
130
|
+
readonly id: string;
|
|
131
|
+
readonly isShowing: boolean;
|
|
132
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
133
|
+
};
|
|
134
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
135
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
136
|
+
readonly pendingDismissVersion: number;
|
|
137
|
+
readonly isHovered: boolean;
|
|
138
|
+
readonly payload: A;
|
|
139
|
+
}[];
|
|
140
|
+
readonly id: string;
|
|
141
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
142
|
+
readonly nextEntryKey: number;
|
|
143
|
+
}, toParentMessage: (message: Dismissed | HoveredEntry | LeftEntry) => ParentMessage, renderEntry: (entry: {
|
|
144
|
+
readonly id: string;
|
|
145
|
+
readonly transition: {
|
|
146
|
+
readonly id: string;
|
|
147
|
+
readonly isShowing: boolean;
|
|
148
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
149
|
+
};
|
|
150
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
151
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
152
|
+
readonly pendingDismissVersion: number;
|
|
153
|
+
readonly isHovered: boolean;
|
|
154
|
+
readonly payload: A;
|
|
155
|
+
}, handlers: Readonly<{
|
|
156
|
+
dismiss: ParentMessage;
|
|
157
|
+
}>) => Html) => Html);
|
|
158
|
+
readonly Entry: S.Struct<{
|
|
159
|
+
id: typeof S.String;
|
|
160
|
+
variant: S.Literal<["Info", "Success", "Warning", "Error"]>;
|
|
161
|
+
transition: S.Struct<{
|
|
162
|
+
id: typeof S.String;
|
|
163
|
+
isShowing: typeof S.Boolean;
|
|
164
|
+
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
165
|
+
}>;
|
|
166
|
+
maybeDuration: S.OptionFromSelf<typeof S.DurationFromMillis>;
|
|
167
|
+
pendingDismissVersion: typeof S.Number;
|
|
168
|
+
isHovered: typeof S.Boolean;
|
|
169
|
+
payload: S.Schema<A, I, never>;
|
|
170
|
+
}>;
|
|
171
|
+
readonly Model: S.Struct<{
|
|
172
|
+
id: typeof S.String;
|
|
173
|
+
defaultDuration: typeof S.DurationFromMillis;
|
|
174
|
+
entries: S.Array$<S.Struct<{
|
|
175
|
+
id: typeof S.String;
|
|
176
|
+
variant: S.Literal<["Info", "Success", "Warning", "Error"]>;
|
|
177
|
+
transition: S.Struct<{
|
|
178
|
+
id: typeof S.String;
|
|
179
|
+
isShowing: typeof S.Boolean;
|
|
180
|
+
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
181
|
+
}>;
|
|
182
|
+
maybeDuration: S.OptionFromSelf<typeof S.DurationFromMillis>;
|
|
183
|
+
pendingDismissVersion: typeof S.Number;
|
|
184
|
+
isHovered: typeof S.Boolean;
|
|
185
|
+
payload: S.Schema<A, I, never>;
|
|
186
|
+
}>>;
|
|
187
|
+
nextEntryKey: typeof S.Number;
|
|
188
|
+
}>;
|
|
189
|
+
readonly Message: S.Union<[import("../../schema").CallableTaggedStruct<"Added", {
|
|
190
|
+
entry: S.Struct<{
|
|
191
|
+
id: typeof S.String;
|
|
192
|
+
variant: S.Literal<["Info", "Success", "Warning", "Error"]>;
|
|
193
|
+
transition: S.Struct<{
|
|
194
|
+
id: typeof S.String;
|
|
195
|
+
isShowing: typeof S.Boolean;
|
|
196
|
+
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
197
|
+
}>;
|
|
198
|
+
maybeDuration: S.OptionFromSelf<typeof S.DurationFromMillis>;
|
|
199
|
+
pendingDismissVersion: typeof S.Number;
|
|
200
|
+
isHovered: typeof S.Boolean;
|
|
201
|
+
payload: S.Schema<A, I, never>;
|
|
202
|
+
}>;
|
|
203
|
+
}>, import("../../schema").CallableTaggedStruct<"Dismissed", {
|
|
204
|
+
entryId: typeof S.String;
|
|
205
|
+
}>, import("../../schema").CallableTaggedStruct<"DismissedAll", {}>, import("../../schema").CallableTaggedStruct<"ElapsedDuration", {
|
|
206
|
+
entryId: typeof S.String;
|
|
207
|
+
version: typeof S.Number;
|
|
208
|
+
}>, import("../../schema").CallableTaggedStruct<"HoveredEntry", {
|
|
209
|
+
entryId: typeof S.String;
|
|
210
|
+
}>, import("../../schema").CallableTaggedStruct<"LeftEntry", {
|
|
211
|
+
entryId: typeof S.String;
|
|
212
|
+
}>, import("../../schema").CallableTaggedStruct<"GotTransitionMessage", {
|
|
213
|
+
entryId: typeof S.String;
|
|
214
|
+
message: S.Union<[import("../../schema").CallableTaggedStruct<"Showed", {}>, import("../../schema").CallableTaggedStruct<"Hid", {}>, import("../../schema").CallableTaggedStruct<"AdvancedTransitionFrame", {}>, import("../../schema").CallableTaggedStruct<"EndedTransition", {}>]>;
|
|
215
|
+
}>]>;
|
|
216
|
+
readonly Added: import("../../schema").CallableTaggedStruct<"Added", {
|
|
217
|
+
entry: S.Struct<{
|
|
218
|
+
id: typeof S.String;
|
|
219
|
+
variant: S.Literal<["Info", "Success", "Warning", "Error"]>;
|
|
220
|
+
transition: S.Struct<{
|
|
221
|
+
id: typeof S.String;
|
|
222
|
+
isShowing: typeof S.Boolean;
|
|
223
|
+
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
224
|
+
}>;
|
|
225
|
+
maybeDuration: S.OptionFromSelf<typeof S.DurationFromMillis>;
|
|
226
|
+
pendingDismissVersion: typeof S.Number;
|
|
227
|
+
isHovered: typeof S.Boolean;
|
|
228
|
+
payload: S.Schema<A, I, never>;
|
|
229
|
+
}>;
|
|
230
|
+
}>;
|
|
231
|
+
readonly init: (config: Readonly<{
|
|
232
|
+
id: string;
|
|
233
|
+
defaultDuration?: import("effect/Duration").DurationInput;
|
|
234
|
+
}>) => {
|
|
235
|
+
readonly entries: readonly {
|
|
236
|
+
readonly id: string;
|
|
237
|
+
readonly transition: {
|
|
238
|
+
readonly id: string;
|
|
239
|
+
readonly isShowing: boolean;
|
|
240
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
241
|
+
};
|
|
242
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
243
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
244
|
+
readonly pendingDismissVersion: number;
|
|
245
|
+
readonly isHovered: boolean;
|
|
246
|
+
readonly payload: A;
|
|
247
|
+
}[];
|
|
248
|
+
readonly id: string;
|
|
249
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
250
|
+
readonly nextEntryKey: number;
|
|
251
|
+
};
|
|
252
|
+
readonly update: (model: {
|
|
253
|
+
readonly entries: readonly {
|
|
254
|
+
readonly id: string;
|
|
255
|
+
readonly transition: {
|
|
256
|
+
readonly id: string;
|
|
257
|
+
readonly isShowing: boolean;
|
|
258
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
259
|
+
};
|
|
260
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
261
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
262
|
+
readonly pendingDismissVersion: number;
|
|
263
|
+
readonly isHovered: boolean;
|
|
264
|
+
readonly payload: A;
|
|
265
|
+
}[];
|
|
266
|
+
readonly id: string;
|
|
267
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
268
|
+
readonly nextEntryKey: number;
|
|
269
|
+
}, message: {
|
|
270
|
+
readonly _tag: "Dismissed";
|
|
271
|
+
readonly entryId: string;
|
|
272
|
+
} | {
|
|
273
|
+
readonly _tag: "DismissedAll";
|
|
274
|
+
} | {
|
|
275
|
+
readonly _tag: "ElapsedDuration";
|
|
276
|
+
readonly version: number;
|
|
277
|
+
readonly entryId: string;
|
|
278
|
+
} | {
|
|
279
|
+
readonly _tag: "HoveredEntry";
|
|
280
|
+
readonly entryId: string;
|
|
281
|
+
} | {
|
|
282
|
+
readonly _tag: "LeftEntry";
|
|
283
|
+
readonly entryId: string;
|
|
284
|
+
} | {
|
|
285
|
+
readonly _tag: "GotTransitionMessage";
|
|
286
|
+
readonly message: {
|
|
287
|
+
readonly _tag: "Showed";
|
|
288
|
+
} | {
|
|
289
|
+
readonly _tag: "Hid";
|
|
290
|
+
} | {
|
|
291
|
+
readonly _tag: "AdvancedTransitionFrame";
|
|
292
|
+
} | {
|
|
293
|
+
readonly _tag: "EndedTransition";
|
|
294
|
+
};
|
|
295
|
+
readonly entryId: string;
|
|
296
|
+
} | {
|
|
297
|
+
readonly _tag: "Added";
|
|
298
|
+
readonly entry: {
|
|
299
|
+
readonly id: string;
|
|
300
|
+
readonly transition: {
|
|
301
|
+
readonly id: string;
|
|
302
|
+
readonly isShowing: boolean;
|
|
303
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
304
|
+
};
|
|
305
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
306
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
307
|
+
readonly pendingDismissVersion: number;
|
|
308
|
+
readonly isHovered: boolean;
|
|
309
|
+
readonly payload: A;
|
|
310
|
+
};
|
|
311
|
+
}) => readonly [{
|
|
312
|
+
readonly entries: readonly {
|
|
313
|
+
readonly id: string;
|
|
314
|
+
readonly transition: {
|
|
315
|
+
readonly id: string;
|
|
316
|
+
readonly isShowing: boolean;
|
|
317
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
318
|
+
};
|
|
319
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
320
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
321
|
+
readonly pendingDismissVersion: number;
|
|
322
|
+
readonly isHovered: boolean;
|
|
323
|
+
readonly payload: A;
|
|
324
|
+
}[];
|
|
325
|
+
readonly id: string;
|
|
326
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
327
|
+
readonly nextEntryKey: number;
|
|
328
|
+
}, readonly Readonly<{
|
|
329
|
+
name: string;
|
|
330
|
+
effect: import("effect/Effect").Effect<{
|
|
331
|
+
readonly _tag: "Dismissed";
|
|
332
|
+
readonly entryId: string;
|
|
333
|
+
} | {
|
|
334
|
+
readonly _tag: "DismissedAll";
|
|
335
|
+
} | {
|
|
336
|
+
readonly _tag: "ElapsedDuration";
|
|
337
|
+
readonly version: number;
|
|
338
|
+
readonly entryId: string;
|
|
339
|
+
} | {
|
|
340
|
+
readonly _tag: "HoveredEntry";
|
|
341
|
+
readonly entryId: string;
|
|
342
|
+
} | {
|
|
343
|
+
readonly _tag: "LeftEntry";
|
|
344
|
+
readonly entryId: string;
|
|
345
|
+
} | {
|
|
346
|
+
readonly _tag: "GotTransitionMessage";
|
|
347
|
+
readonly message: {
|
|
348
|
+
readonly _tag: "Showed";
|
|
349
|
+
} | {
|
|
350
|
+
readonly _tag: "Hid";
|
|
351
|
+
} | {
|
|
352
|
+
readonly _tag: "AdvancedTransitionFrame";
|
|
353
|
+
} | {
|
|
354
|
+
readonly _tag: "EndedTransition";
|
|
355
|
+
};
|
|
356
|
+
readonly entryId: string;
|
|
357
|
+
} | {
|
|
358
|
+
readonly _tag: "Added";
|
|
359
|
+
readonly entry: {
|
|
360
|
+
readonly id: string;
|
|
361
|
+
readonly transition: {
|
|
362
|
+
readonly id: string;
|
|
363
|
+
readonly isShowing: boolean;
|
|
364
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
365
|
+
};
|
|
366
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
367
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
368
|
+
readonly pendingDismissVersion: number;
|
|
369
|
+
readonly isHovered: boolean;
|
|
370
|
+
readonly payload: A;
|
|
371
|
+
};
|
|
372
|
+
}, never, never>;
|
|
373
|
+
}>[]];
|
|
374
|
+
readonly show: (model: {
|
|
375
|
+
readonly entries: readonly {
|
|
376
|
+
readonly id: string;
|
|
377
|
+
readonly transition: {
|
|
378
|
+
readonly id: string;
|
|
379
|
+
readonly isShowing: boolean;
|
|
380
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
381
|
+
};
|
|
382
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
383
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
384
|
+
readonly pendingDismissVersion: number;
|
|
385
|
+
readonly isHovered: boolean;
|
|
386
|
+
readonly payload: A;
|
|
387
|
+
}[];
|
|
388
|
+
readonly id: string;
|
|
389
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
390
|
+
readonly nextEntryKey: number;
|
|
391
|
+
}, input: Readonly<{
|
|
392
|
+
payload: A;
|
|
393
|
+
variant?: Variant;
|
|
394
|
+
duration?: import("effect/Duration").DurationInput;
|
|
395
|
+
sticky?: boolean;
|
|
396
|
+
}>) => readonly [{
|
|
397
|
+
readonly entries: readonly {
|
|
398
|
+
readonly id: string;
|
|
399
|
+
readonly transition: {
|
|
400
|
+
readonly id: string;
|
|
401
|
+
readonly isShowing: boolean;
|
|
402
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
403
|
+
};
|
|
404
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
405
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
406
|
+
readonly pendingDismissVersion: number;
|
|
407
|
+
readonly isHovered: boolean;
|
|
408
|
+
readonly payload: A;
|
|
409
|
+
}[];
|
|
410
|
+
readonly id: string;
|
|
411
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
412
|
+
readonly nextEntryKey: number;
|
|
413
|
+
}, readonly Readonly<{
|
|
414
|
+
name: string;
|
|
415
|
+
effect: import("effect/Effect").Effect<{
|
|
416
|
+
readonly _tag: "Dismissed";
|
|
417
|
+
readonly entryId: string;
|
|
418
|
+
} | {
|
|
419
|
+
readonly _tag: "DismissedAll";
|
|
420
|
+
} | {
|
|
421
|
+
readonly _tag: "ElapsedDuration";
|
|
422
|
+
readonly version: number;
|
|
423
|
+
readonly entryId: string;
|
|
424
|
+
} | {
|
|
425
|
+
readonly _tag: "HoveredEntry";
|
|
426
|
+
readonly entryId: string;
|
|
427
|
+
} | {
|
|
428
|
+
readonly _tag: "LeftEntry";
|
|
429
|
+
readonly entryId: string;
|
|
430
|
+
} | {
|
|
431
|
+
readonly _tag: "GotTransitionMessage";
|
|
432
|
+
readonly message: {
|
|
433
|
+
readonly _tag: "Showed";
|
|
434
|
+
} | {
|
|
435
|
+
readonly _tag: "Hid";
|
|
436
|
+
} | {
|
|
437
|
+
readonly _tag: "AdvancedTransitionFrame";
|
|
438
|
+
} | {
|
|
439
|
+
readonly _tag: "EndedTransition";
|
|
440
|
+
};
|
|
441
|
+
readonly entryId: string;
|
|
442
|
+
} | {
|
|
443
|
+
readonly _tag: "Added";
|
|
444
|
+
readonly entry: {
|
|
445
|
+
readonly id: string;
|
|
446
|
+
readonly transition: {
|
|
447
|
+
readonly id: string;
|
|
448
|
+
readonly isShowing: boolean;
|
|
449
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
450
|
+
};
|
|
451
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
452
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
453
|
+
readonly pendingDismissVersion: number;
|
|
454
|
+
readonly isHovered: boolean;
|
|
455
|
+
readonly payload: A;
|
|
456
|
+
};
|
|
457
|
+
}, never, never>;
|
|
458
|
+
}>[]];
|
|
459
|
+
readonly dismiss: (model: {
|
|
460
|
+
readonly entries: readonly {
|
|
461
|
+
readonly id: string;
|
|
462
|
+
readonly transition: {
|
|
463
|
+
readonly id: string;
|
|
464
|
+
readonly isShowing: boolean;
|
|
465
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
466
|
+
};
|
|
467
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
468
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
469
|
+
readonly pendingDismissVersion: number;
|
|
470
|
+
readonly isHovered: boolean;
|
|
471
|
+
readonly payload: A;
|
|
472
|
+
}[];
|
|
473
|
+
readonly id: string;
|
|
474
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
475
|
+
readonly nextEntryKey: number;
|
|
476
|
+
}, entryId: string) => readonly [{
|
|
477
|
+
readonly entries: readonly {
|
|
478
|
+
readonly id: string;
|
|
479
|
+
readonly transition: {
|
|
480
|
+
readonly id: string;
|
|
481
|
+
readonly isShowing: boolean;
|
|
482
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
483
|
+
};
|
|
484
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
485
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
486
|
+
readonly pendingDismissVersion: number;
|
|
487
|
+
readonly isHovered: boolean;
|
|
488
|
+
readonly payload: A;
|
|
489
|
+
}[];
|
|
490
|
+
readonly id: string;
|
|
491
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
492
|
+
readonly nextEntryKey: number;
|
|
493
|
+
}, readonly Readonly<{
|
|
494
|
+
name: string;
|
|
495
|
+
effect: import("effect/Effect").Effect<{
|
|
496
|
+
readonly _tag: "Dismissed";
|
|
497
|
+
readonly entryId: string;
|
|
498
|
+
} | {
|
|
499
|
+
readonly _tag: "DismissedAll";
|
|
500
|
+
} | {
|
|
501
|
+
readonly _tag: "ElapsedDuration";
|
|
502
|
+
readonly version: number;
|
|
503
|
+
readonly entryId: string;
|
|
504
|
+
} | {
|
|
505
|
+
readonly _tag: "HoveredEntry";
|
|
506
|
+
readonly entryId: string;
|
|
507
|
+
} | {
|
|
508
|
+
readonly _tag: "LeftEntry";
|
|
509
|
+
readonly entryId: string;
|
|
510
|
+
} | {
|
|
511
|
+
readonly _tag: "GotTransitionMessage";
|
|
512
|
+
readonly message: {
|
|
513
|
+
readonly _tag: "Showed";
|
|
514
|
+
} | {
|
|
515
|
+
readonly _tag: "Hid";
|
|
516
|
+
} | {
|
|
517
|
+
readonly _tag: "AdvancedTransitionFrame";
|
|
518
|
+
} | {
|
|
519
|
+
readonly _tag: "EndedTransition";
|
|
520
|
+
};
|
|
521
|
+
readonly entryId: string;
|
|
522
|
+
} | {
|
|
523
|
+
readonly _tag: "Added";
|
|
524
|
+
readonly entry: {
|
|
525
|
+
readonly id: string;
|
|
526
|
+
readonly transition: {
|
|
527
|
+
readonly id: string;
|
|
528
|
+
readonly isShowing: boolean;
|
|
529
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
530
|
+
};
|
|
531
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
532
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
533
|
+
readonly pendingDismissVersion: number;
|
|
534
|
+
readonly isHovered: boolean;
|
|
535
|
+
readonly payload: A;
|
|
536
|
+
};
|
|
537
|
+
}, never, never>;
|
|
538
|
+
}>[]];
|
|
539
|
+
readonly dismissAll: (model: {
|
|
540
|
+
readonly entries: readonly {
|
|
541
|
+
readonly id: string;
|
|
542
|
+
readonly transition: {
|
|
543
|
+
readonly id: string;
|
|
544
|
+
readonly isShowing: boolean;
|
|
545
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
546
|
+
};
|
|
547
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
548
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
549
|
+
readonly pendingDismissVersion: number;
|
|
550
|
+
readonly isHovered: boolean;
|
|
551
|
+
readonly payload: A;
|
|
552
|
+
}[];
|
|
553
|
+
readonly id: string;
|
|
554
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
555
|
+
readonly nextEntryKey: number;
|
|
556
|
+
}) => readonly [{
|
|
557
|
+
readonly entries: readonly {
|
|
558
|
+
readonly id: string;
|
|
559
|
+
readonly transition: {
|
|
560
|
+
readonly id: string;
|
|
561
|
+
readonly isShowing: boolean;
|
|
562
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
563
|
+
};
|
|
564
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
565
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
566
|
+
readonly pendingDismissVersion: number;
|
|
567
|
+
readonly isHovered: boolean;
|
|
568
|
+
readonly payload: A;
|
|
569
|
+
}[];
|
|
570
|
+
readonly id: string;
|
|
571
|
+
readonly defaultDuration: import("effect/Duration").Duration;
|
|
572
|
+
readonly nextEntryKey: number;
|
|
573
|
+
}, readonly Readonly<{
|
|
574
|
+
name: string;
|
|
575
|
+
effect: import("effect/Effect").Effect<{
|
|
576
|
+
readonly _tag: "Dismissed";
|
|
577
|
+
readonly entryId: string;
|
|
578
|
+
} | {
|
|
579
|
+
readonly _tag: "DismissedAll";
|
|
580
|
+
} | {
|
|
581
|
+
readonly _tag: "ElapsedDuration";
|
|
582
|
+
readonly version: number;
|
|
583
|
+
readonly entryId: string;
|
|
584
|
+
} | {
|
|
585
|
+
readonly _tag: "HoveredEntry";
|
|
586
|
+
readonly entryId: string;
|
|
587
|
+
} | {
|
|
588
|
+
readonly _tag: "LeftEntry";
|
|
589
|
+
readonly entryId: string;
|
|
590
|
+
} | {
|
|
591
|
+
readonly _tag: "GotTransitionMessage";
|
|
592
|
+
readonly message: {
|
|
593
|
+
readonly _tag: "Showed";
|
|
594
|
+
} | {
|
|
595
|
+
readonly _tag: "Hid";
|
|
596
|
+
} | {
|
|
597
|
+
readonly _tag: "AdvancedTransitionFrame";
|
|
598
|
+
} | {
|
|
599
|
+
readonly _tag: "EndedTransition";
|
|
600
|
+
};
|
|
601
|
+
readonly entryId: string;
|
|
602
|
+
} | {
|
|
603
|
+
readonly _tag: "Added";
|
|
604
|
+
readonly entry: {
|
|
605
|
+
readonly id: string;
|
|
606
|
+
readonly transition: {
|
|
607
|
+
readonly id: string;
|
|
608
|
+
readonly isShowing: boolean;
|
|
609
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
610
|
+
};
|
|
611
|
+
readonly variant: "Info" | "Success" | "Warning" | "Error";
|
|
612
|
+
readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
|
|
613
|
+
readonly pendingDismissVersion: number;
|
|
614
|
+
readonly isHovered: boolean;
|
|
615
|
+
readonly payload: A;
|
|
616
|
+
};
|
|
617
|
+
}, never, never>;
|
|
618
|
+
}>[]];
|
|
619
|
+
};
|
|
620
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CA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