@foldkit/ui 0.156.0 → 0.157.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/anchor/anchor.d.ts +18 -18
- package/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/anchor/anchor.js +16 -16
- package/dist/animation/index.d.ts +4 -4
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +8 -8
- package/dist/animation/public.d.ts +1 -1
- package/dist/animation/public.d.ts.map +1 -1
- package/dist/animation/public.js +1 -1
- package/dist/animation/schema.d.ts +6 -6
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +5 -5
- package/dist/animation/update.d.ts +8 -2
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +22 -9
- package/dist/calendar/index.d.ts +56 -56
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +49 -37
- package/dist/checkbox/index.js +2 -2
- package/dist/combobox/multi.d.ts +19 -19
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/multi.js +2 -2
- package/dist/combobox/shared.d.ts +61 -61
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +74 -62
- package/dist/combobox/single.d.ts +19 -19
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/combobox/single.js +2 -2
- package/dist/datePicker/index.d.ts +72 -72
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +12 -12
- package/dist/dialog/index.d.ts +14 -14
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +35 -23
- package/dist/disclosure/index.js +2 -2
- package/dist/dragAndDrop/index.d.ts +61 -61
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +85 -85
- package/dist/fileDrop/index.d.ts +6 -6
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/fileDrop/index.js +6 -6
- package/dist/hoverIntent/hoverIntent.d.ts +15 -15
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.js +17 -17
- package/dist/hoverIntent/message.d.ts +4 -4
- package/dist/hoverIntent/message.d.ts.map +1 -1
- package/dist/hoverIntent/message.js +4 -4
- package/dist/keyboard.js +2 -2
- package/dist/listbox/multi.d.ts +19 -19
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/multi.js +2 -2
- package/dist/listbox/shared.d.ts +58 -58
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +74 -62
- package/dist/listbox/single.d.ts +19 -19
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/listbox/single.js +2 -2
- package/dist/menu/index.d.ts +67 -67
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +82 -67
- package/dist/popover/index.d.ts +34 -34
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +49 -37
- package/dist/radioGroup/index.d.ts +12 -12
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/radioGroup/index.js +16 -16
- package/dist/slider/index.d.ts +14 -14
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +31 -31
- package/dist/switch/index.js +2 -2
- package/dist/tabs/index.d.ts +14 -14
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +18 -18
- package/dist/test/apps/disabledButton.d.ts +12 -12
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +5 -5
- package/dist/textarea/index.d.ts +2 -2
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/toast/index.d.ts +63 -63
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +19 -19
- package/dist/toast/schema.d.ts +55 -55
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +29 -29
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/test.js +3 -3
- package/dist/toast/update.d.ts +61 -61
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +13 -13
- package/dist/tooltip/message.d.ts +3 -3
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/message.js +3 -3
- package/dist/tooltip/tooltip.d.ts +24 -24
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +13 -13
- package/dist/typeahead.d.ts.map +1 -1
- package/dist/typeahead.js +3 -3
- package/dist/virtualList/index.d.ts +16 -16
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +13 -13
- package/package.json +3 -3
package/dist/toast/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { type ChildAttribute, type Html } from 'foldkit/html';
|
|
3
3
|
import { Message, Position, Variant } from './schema.js';
|
|
4
4
|
import { WaitBeforeDismissal } from './update.js';
|
|
@@ -34,80 +34,80 @@ export type EntryHandlers = Readonly<{
|
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```ts
|
|
37
|
-
* const ToastPayload =
|
|
38
|
-
* bodyText:
|
|
39
|
-
* maybeLink:
|
|
40
|
-
* href:
|
|
41
|
-
* text:
|
|
37
|
+
* const ToastPayload = Schema.Struct({
|
|
38
|
+
* bodyText: Schema.String,
|
|
39
|
+
* maybeLink: Schema.Option(Schema.Struct({
|
|
40
|
+
* href: Schema.String,
|
|
41
|
+
* text: Schema.String,
|
|
42
42
|
* })),
|
|
43
43
|
* })
|
|
44
44
|
* export const Toast = Toast.make(ToastPayload)
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
|
-
export declare const make: <A, I>(payloadSchema:
|
|
48
|
-
readonly Entry:
|
|
49
|
-
readonly id:
|
|
50
|
-
readonly variant:
|
|
51
|
-
readonly animation:
|
|
52
|
-
readonly id:
|
|
53
|
-
readonly isShowing:
|
|
54
|
-
readonly transitionState:
|
|
47
|
+
export declare const make: <A, I>(payloadSchema: Schema.Codec<A, I>) => {
|
|
48
|
+
readonly Entry: Schema.Struct<{
|
|
49
|
+
readonly id: Schema.String;
|
|
50
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
51
|
+
readonly animation: Schema.Struct<{
|
|
52
|
+
readonly id: Schema.String;
|
|
53
|
+
readonly isShowing: Schema.Boolean;
|
|
54
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
55
55
|
}>;
|
|
56
|
-
readonly maybeDuration:
|
|
57
|
-
readonly pendingDismissVersion:
|
|
58
|
-
readonly isHovered:
|
|
59
|
-
readonly payload:
|
|
56
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
57
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
58
|
+
readonly isHovered: Schema.Boolean;
|
|
59
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
60
60
|
}>;
|
|
61
|
-
readonly Model:
|
|
62
|
-
readonly id:
|
|
63
|
-
readonly defaultDuration:
|
|
64
|
-
readonly entries:
|
|
65
|
-
readonly id:
|
|
66
|
-
readonly variant:
|
|
67
|
-
readonly animation:
|
|
68
|
-
readonly id:
|
|
69
|
-
readonly isShowing:
|
|
70
|
-
readonly transitionState:
|
|
61
|
+
readonly Model: Schema.Struct<{
|
|
62
|
+
readonly id: Schema.String;
|
|
63
|
+
readonly defaultDuration: Schema.DurationFromMillis;
|
|
64
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
65
|
+
readonly id: Schema.String;
|
|
66
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
67
|
+
readonly animation: Schema.Struct<{
|
|
68
|
+
readonly id: Schema.String;
|
|
69
|
+
readonly isShowing: Schema.Boolean;
|
|
70
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
71
71
|
}>;
|
|
72
|
-
readonly maybeDuration:
|
|
73
|
-
readonly pendingDismissVersion:
|
|
74
|
-
readonly isHovered:
|
|
75
|
-
readonly payload:
|
|
72
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
73
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
74
|
+
readonly isHovered: Schema.Boolean;
|
|
75
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
76
76
|
}>>;
|
|
77
|
-
readonly nextEntryKey:
|
|
77
|
+
readonly nextEntryKey: Schema.Number;
|
|
78
78
|
}>;
|
|
79
79
|
readonly Message: import("foldkit/message").MessageUnion<{
|
|
80
80
|
readonly Added: {
|
|
81
|
-
readonly entry:
|
|
82
|
-
readonly id:
|
|
83
|
-
readonly variant:
|
|
84
|
-
readonly animation:
|
|
85
|
-
readonly id:
|
|
86
|
-
readonly isShowing:
|
|
87
|
-
readonly transitionState:
|
|
81
|
+
readonly entry: Schema.Struct<{
|
|
82
|
+
readonly id: Schema.String;
|
|
83
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
84
|
+
readonly animation: Schema.Struct<{
|
|
85
|
+
readonly id: Schema.String;
|
|
86
|
+
readonly isShowing: Schema.Boolean;
|
|
87
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
88
88
|
}>;
|
|
89
|
-
readonly maybeDuration:
|
|
90
|
-
readonly pendingDismissVersion:
|
|
91
|
-
readonly isHovered:
|
|
92
|
-
readonly payload:
|
|
89
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
90
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
91
|
+
readonly isHovered: Schema.Boolean;
|
|
92
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
93
93
|
}>;
|
|
94
94
|
};
|
|
95
95
|
readonly Dismissed: {
|
|
96
|
-
entryId:
|
|
96
|
+
entryId: Schema.String;
|
|
97
97
|
};
|
|
98
98
|
readonly DismissedAll: {};
|
|
99
99
|
readonly CompletedWaitBeforeDismissal: {
|
|
100
|
-
entryId:
|
|
101
|
-
version:
|
|
100
|
+
entryId: Schema.String;
|
|
101
|
+
version: Schema.Number;
|
|
102
102
|
};
|
|
103
103
|
readonly HoveredEntry: {
|
|
104
|
-
entryId:
|
|
104
|
+
entryId: Schema.String;
|
|
105
105
|
};
|
|
106
106
|
readonly LeftEntry: {
|
|
107
|
-
entryId:
|
|
107
|
+
entryId: Schema.String;
|
|
108
108
|
};
|
|
109
109
|
readonly GotAnimationMessage: {
|
|
110
|
-
entryId:
|
|
110
|
+
entryId: Schema.String;
|
|
111
111
|
message: import("foldkit/message").MessageUnion<{
|
|
112
112
|
readonly Showed: {};
|
|
113
113
|
readonly Hid: {};
|
|
@@ -118,26 +118,26 @@ export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
118
118
|
}>;
|
|
119
119
|
readonly OutMessage: import("foldkit/message").MessageUnion<{
|
|
120
120
|
readonly DismissedToast: {
|
|
121
|
-
readonly payload:
|
|
121
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
122
122
|
};
|
|
123
123
|
}>;
|
|
124
124
|
readonly Added: import("foldkit/schema").CallableTaggedStruct<"Added", {
|
|
125
|
-
readonly entry:
|
|
126
|
-
readonly id:
|
|
127
|
-
readonly variant:
|
|
128
|
-
readonly animation:
|
|
129
|
-
readonly id:
|
|
130
|
-
readonly isShowing:
|
|
131
|
-
readonly transitionState:
|
|
125
|
+
readonly entry: Schema.Struct<{
|
|
126
|
+
readonly id: Schema.String;
|
|
127
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
128
|
+
readonly animation: Schema.Struct<{
|
|
129
|
+
readonly id: Schema.String;
|
|
130
|
+
readonly isShowing: Schema.Boolean;
|
|
131
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
132
132
|
}>;
|
|
133
|
-
readonly maybeDuration:
|
|
134
|
-
readonly pendingDismissVersion:
|
|
135
|
-
readonly isHovered:
|
|
136
|
-
readonly payload:
|
|
133
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
134
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
135
|
+
readonly isHovered: Schema.Boolean;
|
|
136
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
137
137
|
}>;
|
|
138
138
|
}>;
|
|
139
139
|
readonly DismissedToast: import("foldkit/schema").CallableTaggedStruct<"DismissedToast", {
|
|
140
|
-
readonly payload:
|
|
140
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
141
141
|
}>;
|
|
142
142
|
readonly init: (config: Readonly<{
|
|
143
143
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAG9E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAe,MAAM,aAAa,CAAA;AAE9D,YAAY,EACV,4BAA4B,EAC5B,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAA;AA0E1D;;;;qDAIqD;AACrD,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;CACvC,CAAC,CAAA;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAU9C,QAAQ;qBACL,CAAC,KAAK;;;;;;;;;;;;SAAO,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI;oBAChD,MAAM;6BACG,MAAM;yBACV,MAAM;;CAyF1B,CAAA"}
|
package/dist/toast/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Match
|
|
2
|
+
import { Match } from 'effect';
|
|
3
3
|
import { childAttributes } from 'foldkit/html';
|
|
4
4
|
import { defineView } from 'foldkit/submodel';
|
|
5
5
|
import { Message, Position, Variant } from './schema.js';
|
|
6
6
|
import { WaitBeforeDismissal, makeRuntime } from './update.js';
|
|
7
7
|
export * as test from './test.js';
|
|
8
8
|
export { Message, Variant, Position, WaitBeforeDismissal };
|
|
9
|
-
const variantToRole = (variant) => __foldkitBrandViewResult((
|
|
9
|
+
const variantToRole = (variant) => __foldkitBrandViewResult((Match.value(variant).pipe(Match.withReturnType(), Match.when('Info', () => __foldkitBrandViewResult(('status'), "@foldkit/ui/toast/index.js#anonymous")), Match.when('Success', () => __foldkitBrandViewResult(('status'), "@foldkit/ui/toast/index.js#anonymous~2")), Match.when('Warning', () => __foldkitBrandViewResult(('alert'), "@foldkit/ui/toast/index.js#anonymous~3")), Match.when('Error', () => __foldkitBrandViewResult(('alert'), "@foldkit/ui/toast/index.js#anonymous~4")), Match.exhaustive)), "@foldkit/ui/toast/index.js#variantToRole");
|
|
10
10
|
const positionToContainerStyle = (position) => {
|
|
11
11
|
const base = {
|
|
12
12
|
position: 'fixed',
|
|
@@ -18,39 +18,39 @@ const positionToContainerStyle = (position) => {
|
|
|
18
18
|
pointerEvents: 'none',
|
|
19
19
|
zIndex: '2147483600',
|
|
20
20
|
};
|
|
21
|
-
return __foldkitBrandViewResult((
|
|
21
|
+
return __foldkitBrandViewResult((Match.value(position).pipe(Match.withReturnType(), Match.when('TopLeft', () => (__foldkitBrandViewResult(({
|
|
22
22
|
...base,
|
|
23
23
|
top: '0',
|
|
24
24
|
left: '0',
|
|
25
25
|
flexDirection: 'column-reverse',
|
|
26
|
-
}), "@foldkit/ui/toast/index.js#anonymous~5"))),
|
|
26
|
+
}), "@foldkit/ui/toast/index.js#anonymous~5"))), Match.when('TopCenter', () => (__foldkitBrandViewResult(({
|
|
27
27
|
...base,
|
|
28
28
|
top: '0',
|
|
29
29
|
left: '50%',
|
|
30
30
|
transform: 'translateX(-50%)',
|
|
31
31
|
flexDirection: 'column-reverse',
|
|
32
|
-
}), "@foldkit/ui/toast/index.js#anonymous~6"))),
|
|
32
|
+
}), "@foldkit/ui/toast/index.js#anonymous~6"))), Match.when('TopRight', () => (__foldkitBrandViewResult(({
|
|
33
33
|
...base,
|
|
34
34
|
top: '0',
|
|
35
35
|
right: '0',
|
|
36
36
|
flexDirection: 'column-reverse',
|
|
37
|
-
}), "@foldkit/ui/toast/index.js#anonymous~7"))),
|
|
37
|
+
}), "@foldkit/ui/toast/index.js#anonymous~7"))), Match.when('BottomLeft', () => (__foldkitBrandViewResult(({
|
|
38
38
|
...base,
|
|
39
39
|
bottom: '0',
|
|
40
40
|
left: '0',
|
|
41
41
|
flexDirection: 'column',
|
|
42
|
-
}), "@foldkit/ui/toast/index.js#anonymous~8"))),
|
|
42
|
+
}), "@foldkit/ui/toast/index.js#anonymous~8"))), Match.when('BottomCenter', () => (__foldkitBrandViewResult(({
|
|
43
43
|
...base,
|
|
44
44
|
bottom: '0',
|
|
45
45
|
left: '50%',
|
|
46
46
|
transform: 'translateX(-50%)',
|
|
47
47
|
flexDirection: 'column',
|
|
48
|
-
}), "@foldkit/ui/toast/index.js#anonymous~9"))),
|
|
48
|
+
}), "@foldkit/ui/toast/index.js#anonymous~9"))), Match.when('BottomRight', () => (__foldkitBrandViewResult(({
|
|
49
49
|
...base,
|
|
50
50
|
bottom: '0',
|
|
51
51
|
right: '0',
|
|
52
52
|
flexDirection: 'column',
|
|
53
|
-
}), "@foldkit/ui/toast/index.js#anonymous~10"))),
|
|
53
|
+
}), "@foldkit/ui/toast/index.js#anonymous~10"))), Match.exhaustive)), "@foldkit/ui/toast/index.js#positionToContainerStyle");
|
|
54
54
|
};
|
|
55
55
|
const DEFAULT_ARIA_LABEL = 'Notifications';
|
|
56
56
|
/** Factory that binds `Toast` to a user-provided payload schema. The
|
|
@@ -73,11 +73,11 @@ const DEFAULT_ARIA_LABEL = 'Notifications';
|
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
75
75
|
* ```ts
|
|
76
|
-
* const ToastPayload =
|
|
77
|
-
* bodyText:
|
|
78
|
-
* maybeLink:
|
|
79
|
-
* href:
|
|
80
|
-
* text:
|
|
76
|
+
* const ToastPayload = Schema.Struct({
|
|
77
|
+
* bodyText: Schema.String,
|
|
78
|
+
* maybeLink: Schema.Option(Schema.Struct({
|
|
79
|
+
* href: Schema.String,
|
|
80
|
+
* text: Schema.String,
|
|
81
81
|
* })),
|
|
82
82
|
* })
|
|
83
83
|
* export const Toast = Toast.make(ToastPayload)
|
|
@@ -104,21 +104,21 @@ export const make = (payloadSchema) => {
|
|
|
104
104
|
];
|
|
105
105
|
const renderEntryItem = (entry) => {
|
|
106
106
|
const { transitionState } = entry.animation;
|
|
107
|
-
const animationAttributes =
|
|
107
|
+
const animationAttributes = Match.value(transitionState).pipe(Match.when('EnterStart', () => __foldkitBrandViewResult(([
|
|
108
108
|
h.DataAttribute('closed', ''),
|
|
109
109
|
h.DataAttribute('enter', ''),
|
|
110
110
|
h.DataAttribute('transition', ''),
|
|
111
|
-
]), "@foldkit/ui/toast/index.js#anonymous~12")),
|
|
111
|
+
]), "@foldkit/ui/toast/index.js#anonymous~12")), Match.when('EnterAnimating', () => __foldkitBrandViewResult(([
|
|
112
112
|
h.DataAttribute('enter', ''),
|
|
113
113
|
h.DataAttribute('transition', ''),
|
|
114
|
-
]), "@foldkit/ui/toast/index.js#anonymous~13")),
|
|
114
|
+
]), "@foldkit/ui/toast/index.js#anonymous~13")), Match.when('LeaveStart', () => __foldkitBrandViewResult(([
|
|
115
115
|
h.DataAttribute('leave', ''),
|
|
116
116
|
h.DataAttribute('transition', ''),
|
|
117
|
-
]), "@foldkit/ui/toast/index.js#anonymous~14")),
|
|
117
|
+
]), "@foldkit/ui/toast/index.js#anonymous~14")), Match.when('LeaveAnimating', () => __foldkitBrandViewResult(([
|
|
118
118
|
h.DataAttribute('closed', ''),
|
|
119
119
|
h.DataAttribute('leave', ''),
|
|
120
120
|
h.DataAttribute('transition', ''),
|
|
121
|
-
]), "@foldkit/ui/toast/index.js#anonymous~15")),
|
|
121
|
+
]), "@foldkit/ui/toast/index.js#anonymous~15")), Match.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/toast/index.js#anonymous~16")));
|
|
122
122
|
const itemAttributes = [
|
|
123
123
|
h.Id(entry.id),
|
|
124
124
|
h.Role(variantToRole(entry.variant)),
|
package/dist/toast/schema.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Duration, Schema
|
|
1
|
+
import { Duration, Schema } from 'effect';
|
|
2
2
|
/** Semantic category of a toast. Drives the default ARIA role: `status` for
|
|
3
3
|
* `Info` / `Success`, `alert` for `Warning` / `Error`. Also surfaced as
|
|
4
4
|
* `data-variant` on each entry for per-variant CSS. This is the only
|
|
5
5
|
* content-adjacent field the component owns. The rest of the entry's
|
|
6
6
|
* content lives in the user-provided payload. */
|
|
7
|
-
export declare const Variant:
|
|
7
|
+
export declare const Variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
8
8
|
export type Variant = typeof Variant.Type;
|
|
9
9
|
/** Where the toast viewport is anchored on the screen and how entries stack. */
|
|
10
|
-
export declare const Position:
|
|
10
|
+
export declare const Position: Schema.Literals<readonly ["TopLeft", "TopCenter", "TopRight", "BottomLeft", "BottomCenter", "BottomRight"]>;
|
|
11
11
|
export type Position = typeof Position.Type;
|
|
12
12
|
/** Schema factory for a single toast entry. `payloadSchema` is user-provided
|
|
13
13
|
* and defines the shape of per-entry content, whatever the consumer wants
|
|
@@ -15,60 +15,60 @@ export type Position = typeof Position.Type;
|
|
|
15
15
|
* `variant` (for ARIA role), `animation`, `maybeDuration`,
|
|
16
16
|
* `pendingDismissVersion` (for cancellable auto-dismiss), and `isHovered`
|
|
17
17
|
* (for pause-on-hover). */
|
|
18
|
-
export declare const makeEntry: <A, I>(payloadSchema:
|
|
19
|
-
readonly id:
|
|
20
|
-
readonly variant:
|
|
21
|
-
readonly animation:
|
|
22
|
-
readonly id:
|
|
23
|
-
readonly isShowing:
|
|
24
|
-
readonly transitionState:
|
|
18
|
+
export declare const makeEntry: <A, I>(payloadSchema: Schema.Codec<A, I>) => Schema.Struct<{
|
|
19
|
+
readonly id: Schema.String;
|
|
20
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
21
|
+
readonly animation: Schema.Struct<{
|
|
22
|
+
readonly id: Schema.String;
|
|
23
|
+
readonly isShowing: Schema.Boolean;
|
|
24
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
25
25
|
}>;
|
|
26
|
-
readonly maybeDuration:
|
|
27
|
-
readonly pendingDismissVersion:
|
|
28
|
-
readonly isHovered:
|
|
29
|
-
readonly payload:
|
|
26
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
27
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
28
|
+
readonly isHovered: Schema.Boolean;
|
|
29
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
30
30
|
}>;
|
|
31
31
|
/** Schema factory for the toast container's state. `nextEntryKey` is a
|
|
32
32
|
* monotonic counter used to generate unique entry IDs purely from Model
|
|
33
33
|
* state. Thread the updated model through successive `show()` calls.
|
|
34
34
|
* Calling `show()` twice against the same pre-update model in the same tick
|
|
35
35
|
* will produce duplicate entry IDs. */
|
|
36
|
-
export declare const makeModel: <A, I>(payloadSchema:
|
|
37
|
-
readonly id:
|
|
38
|
-
readonly defaultDuration:
|
|
39
|
-
readonly entries:
|
|
40
|
-
readonly id:
|
|
41
|
-
readonly variant:
|
|
42
|
-
readonly animation:
|
|
43
|
-
readonly id:
|
|
44
|
-
readonly isShowing:
|
|
45
|
-
readonly transitionState:
|
|
36
|
+
export declare const makeModel: <A, I>(payloadSchema: Schema.Codec<A, I>) => Schema.Struct<{
|
|
37
|
+
readonly id: Schema.String;
|
|
38
|
+
readonly defaultDuration: Schema.DurationFromMillis;
|
|
39
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
40
|
+
readonly id: Schema.String;
|
|
41
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
42
|
+
readonly animation: Schema.Struct<{
|
|
43
|
+
readonly id: Schema.String;
|
|
44
|
+
readonly isShowing: Schema.Boolean;
|
|
45
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
46
46
|
}>;
|
|
47
|
-
readonly maybeDuration:
|
|
48
|
-
readonly pendingDismissVersion:
|
|
49
|
-
readonly isHovered:
|
|
50
|
-
readonly payload:
|
|
47
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
48
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
49
|
+
readonly isHovered: Schema.Boolean;
|
|
50
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
51
51
|
}>>;
|
|
52
|
-
readonly nextEntryKey:
|
|
52
|
+
readonly nextEntryKey: Schema.Number;
|
|
53
53
|
}>;
|
|
54
54
|
/** Payload-independent Message variants shared by every bound Toast module. */
|
|
55
55
|
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
56
56
|
readonly Dismissed: {
|
|
57
|
-
entryId:
|
|
57
|
+
entryId: Schema.String;
|
|
58
58
|
};
|
|
59
59
|
readonly DismissedAll: {};
|
|
60
60
|
readonly CompletedWaitBeforeDismissal: {
|
|
61
|
-
entryId:
|
|
62
|
-
version:
|
|
61
|
+
entryId: Schema.String;
|
|
62
|
+
version: Schema.Number;
|
|
63
63
|
};
|
|
64
64
|
readonly HoveredEntry: {
|
|
65
|
-
entryId:
|
|
65
|
+
entryId: Schema.String;
|
|
66
66
|
};
|
|
67
67
|
readonly LeftEntry: {
|
|
68
|
-
entryId:
|
|
68
|
+
entryId: Schema.String;
|
|
69
69
|
};
|
|
70
70
|
readonly GotAnimationMessage: {
|
|
71
|
-
entryId:
|
|
71
|
+
entryId: Schema.String;
|
|
72
72
|
message: import("foldkit/message").MessageUnion<{
|
|
73
73
|
readonly Showed: {};
|
|
74
74
|
readonly Hid: {};
|
|
@@ -84,38 +84,38 @@ export type HoveredEntry = typeof Message.HoveredEntry.Type;
|
|
|
84
84
|
export type LeftEntry = typeof Message.LeftEntry.Type;
|
|
85
85
|
export type GotAnimationMessage = typeof Message.GotAnimationMessage.Type;
|
|
86
86
|
/** Factory for the union of all messages the toast component can produce. */
|
|
87
|
-
export declare const makeMessage: <A, I>(payloadSchema:
|
|
87
|
+
export declare const makeMessage: <A, I>(payloadSchema: Schema.Codec<A, I>) => import("foldkit/message").MessageUnion<{
|
|
88
88
|
readonly Added: {
|
|
89
|
-
entry:
|
|
90
|
-
readonly id:
|
|
91
|
-
readonly variant:
|
|
92
|
-
readonly animation:
|
|
93
|
-
readonly id:
|
|
94
|
-
readonly isShowing:
|
|
95
|
-
readonly transitionState:
|
|
89
|
+
entry: Schema.Struct<{
|
|
90
|
+
readonly id: Schema.String;
|
|
91
|
+
readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
92
|
+
readonly animation: Schema.Struct<{
|
|
93
|
+
readonly id: Schema.String;
|
|
94
|
+
readonly isShowing: Schema.Boolean;
|
|
95
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
96
96
|
}>;
|
|
97
|
-
readonly maybeDuration:
|
|
98
|
-
readonly pendingDismissVersion:
|
|
99
|
-
readonly isHovered:
|
|
100
|
-
readonly payload:
|
|
97
|
+
readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
|
|
98
|
+
readonly pendingDismissVersion: Schema.Number;
|
|
99
|
+
readonly isHovered: Schema.Boolean;
|
|
100
|
+
readonly payload: Schema.Codec<A, I, never, never>;
|
|
101
101
|
}>;
|
|
102
102
|
};
|
|
103
103
|
readonly Dismissed: {
|
|
104
|
-
entryId:
|
|
104
|
+
entryId: Schema.String;
|
|
105
105
|
};
|
|
106
106
|
readonly DismissedAll: {};
|
|
107
107
|
readonly CompletedWaitBeforeDismissal: {
|
|
108
|
-
entryId:
|
|
109
|
-
version:
|
|
108
|
+
entryId: Schema.String;
|
|
109
|
+
version: Schema.Number;
|
|
110
110
|
};
|
|
111
111
|
readonly HoveredEntry: {
|
|
112
|
-
entryId:
|
|
112
|
+
entryId: Schema.String;
|
|
113
113
|
};
|
|
114
114
|
readonly LeftEntry: {
|
|
115
|
-
entryId:
|
|
115
|
+
entryId: Schema.String;
|
|
116
116
|
};
|
|
117
117
|
readonly GotAnimationMessage: {
|
|
118
|
-
entryId:
|
|
118
|
+
entryId: Schema.String;
|
|
119
119
|
message: import("foldkit/message").MessageUnion<{
|
|
120
120
|
readonly Showed: {};
|
|
121
121
|
readonly Hid: {};
|
|
@@ -125,9 +125,9 @@ export declare const makeMessage: <A, I>(payloadSchema: S.Codec<A, I>) => import
|
|
|
125
125
|
};
|
|
126
126
|
}>;
|
|
127
127
|
/** Factory for the union of out-messages the toast component can produce. */
|
|
128
|
-
export declare const makeOutMessage: <A, I>(payloadSchema:
|
|
128
|
+
export declare const makeOutMessage: <A, I>(payloadSchema: Schema.Codec<A, I>) => import("foldkit/message").MessageUnion<{
|
|
129
129
|
readonly DismissedToast: {
|
|
130
|
-
payload:
|
|
130
|
+
payload: Schema.Codec<A, I, never, never>;
|
|
131
131
|
};
|
|
132
132
|
}>;
|
|
133
133
|
/** Configuration for creating a toast container model. `defaultDuration` is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/toast/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/toast/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAOzC;;;;kDAIkD;AAClD,eAAO,MAAM,OAAO,mEAA2D,CAAA;AAC/E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,gFAAgF;AAChF,eAAO,MAAM,QAAQ,6GAOnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAI3C;;;;;4BAK4B;AAC5B,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;EAS7D,CAAA;AAIJ;;;;wCAIwC;AACxC,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;EAM7D,CAAA;AAIJ,+EAA+E;AAC/E,eAAO,MAAM,OAAO;;QACL,OAAO;;;;QAGlB,OAAO;QACP,OAAO;;;QAEO,OAAO;;;QACV,OAAO;;;QAElB,OAAO;QACP,OAAO;;;;;;;EAET,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,CAAA;AACrD,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAA;AAC3D,MAAM,MAAM,4BAA4B,GACtC,OAAO,OAAO,CAAC,4BAA4B,CAAC,IAAI,CAAA;AAClD,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAA;AAC3D,MAAM,MAAM,SAAS,GAAG,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,CAAA;AACrD,MAAM,MAAM,mBAAmB,GAAG,OAAO,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAA;AAEzE,6EAA6E;AAC7E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;QAEtD,KAAK;;;;;;;;;;;;;;;QACD,OAAO;;;;QAGlB,OAAO;QACP,OAAO;;;QAEO,OAAO;;;QACV,OAAO;;;QAElB,OAAO;QACP,OAAO;;;;;;;EAET,CAAA;AAEJ,6EAA6E;AAC7E,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;QAC7B,OAAO;;EAAoB,CAAA;AAIpE;;;mCAGmC;AACnC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,eAAe,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;CACjC,CAAC,CAAA;AAEF,eAAO,MAAM,gBAAgB,mBAAsB,CAAA"}
|
package/dist/toast/schema.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Duration, Schema
|
|
2
|
+
import { Duration, Schema } from 'effect';
|
|
3
3
|
import { defineMessageUnion } from 'foldkit/message';
|
|
4
|
-
import
|
|
4
|
+
import * as Animation from '../animation/schema.js';
|
|
5
5
|
// VARIANT
|
|
6
6
|
/** Semantic category of a toast. Drives the default ARIA role: `status` for
|
|
7
7
|
* `Info` / `Success`, `alert` for `Warning` / `Error`. Also surfaced as
|
|
8
8
|
* `data-variant` on each entry for per-variant CSS. This is the only
|
|
9
9
|
* content-adjacent field the component owns. The rest of the entry's
|
|
10
10
|
* content lives in the user-provided payload. */
|
|
11
|
-
export const Variant =
|
|
11
|
+
export const Variant = Schema.Literals(['Info', 'Success', 'Warning', 'Error']);
|
|
12
12
|
// POSITION
|
|
13
13
|
/** Where the toast viewport is anchored on the screen and how entries stack. */
|
|
14
|
-
export const Position =
|
|
14
|
+
export const Position = Schema.Literals([
|
|
15
15
|
'TopLeft',
|
|
16
16
|
'TopCenter',
|
|
17
17
|
'TopRight',
|
|
@@ -26,13 +26,13 @@ export const Position = S.Literals([
|
|
|
26
26
|
* `variant` (for ARIA role), `animation`, `maybeDuration`,
|
|
27
27
|
* `pendingDismissVersion` (for cancellable auto-dismiss), and `isHovered`
|
|
28
28
|
* (for pause-on-hover). */
|
|
29
|
-
export const makeEntry = (payloadSchema) => __foldkitBrandViewResult((
|
|
30
|
-
id:
|
|
29
|
+
export const makeEntry = (payloadSchema) => __foldkitBrandViewResult((Schema.Struct({
|
|
30
|
+
id: Schema.String,
|
|
31
31
|
variant: Variant,
|
|
32
|
-
animation:
|
|
33
|
-
maybeDuration:
|
|
34
|
-
pendingDismissVersion:
|
|
35
|
-
isHovered:
|
|
32
|
+
animation: Animation.Model,
|
|
33
|
+
maybeDuration: Schema.Option(Schema.DurationFromMillis),
|
|
34
|
+
pendingDismissVersion: Schema.Number,
|
|
35
|
+
isHovered: Schema.Boolean,
|
|
36
36
|
payload: payloadSchema,
|
|
37
37
|
})), "@foldkit/ui/toast/schema.js#makeEntry");
|
|
38
38
|
// MODEL
|
|
@@ -41,42 +41,42 @@ export const makeEntry = (payloadSchema) => __foldkitBrandViewResult((S.Struct({
|
|
|
41
41
|
* state. Thread the updated model through successive `show()` calls.
|
|
42
42
|
* Calling `show()` twice against the same pre-update model in the same tick
|
|
43
43
|
* will produce duplicate entry IDs. */
|
|
44
|
-
export const makeModel = (payloadSchema) => __foldkitBrandViewResult((
|
|
45
|
-
id:
|
|
46
|
-
defaultDuration:
|
|
47
|
-
entries:
|
|
48
|
-
nextEntryKey:
|
|
44
|
+
export const makeModel = (payloadSchema) => __foldkitBrandViewResult((Schema.Struct({
|
|
45
|
+
id: Schema.String,
|
|
46
|
+
defaultDuration: Schema.DurationFromMillis,
|
|
47
|
+
entries: Schema.Array(makeEntry(payloadSchema)),
|
|
48
|
+
nextEntryKey: Schema.Number,
|
|
49
49
|
})), "@foldkit/ui/toast/schema.js#makeModel");
|
|
50
50
|
// MESSAGE
|
|
51
51
|
/** Payload-independent Message variants shared by every bound Toast module. */
|
|
52
52
|
export const Message = defineMessageUnion({
|
|
53
|
-
Dismissed: { entryId:
|
|
53
|
+
Dismissed: { entryId: Schema.String },
|
|
54
54
|
DismissedAll: {},
|
|
55
55
|
CompletedWaitBeforeDismissal: {
|
|
56
|
-
entryId:
|
|
57
|
-
version:
|
|
56
|
+
entryId: Schema.String,
|
|
57
|
+
version: Schema.Number,
|
|
58
58
|
},
|
|
59
|
-
HoveredEntry: { entryId:
|
|
60
|
-
LeftEntry: { entryId:
|
|
59
|
+
HoveredEntry: { entryId: Schema.String },
|
|
60
|
+
LeftEntry: { entryId: Schema.String },
|
|
61
61
|
GotAnimationMessage: {
|
|
62
|
-
entryId:
|
|
63
|
-
message:
|
|
62
|
+
entryId: Schema.String,
|
|
63
|
+
message: Animation.Message,
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
66
|
/** Factory for the union of all messages the toast component can produce. */
|
|
67
67
|
export const makeMessage = (payloadSchema) => __foldkitBrandViewResult((defineMessageUnion({
|
|
68
68
|
Added: { entry: makeEntry(payloadSchema) },
|
|
69
|
-
Dismissed: { entryId:
|
|
69
|
+
Dismissed: { entryId: Schema.String },
|
|
70
70
|
DismissedAll: {},
|
|
71
71
|
CompletedWaitBeforeDismissal: {
|
|
72
|
-
entryId:
|
|
73
|
-
version:
|
|
72
|
+
entryId: Schema.String,
|
|
73
|
+
version: Schema.Number,
|
|
74
74
|
},
|
|
75
|
-
HoveredEntry: { entryId:
|
|
76
|
-
LeftEntry: { entryId:
|
|
75
|
+
HoveredEntry: { entryId: Schema.String },
|
|
76
|
+
LeftEntry: { entryId: Schema.String },
|
|
77
77
|
GotAnimationMessage: {
|
|
78
|
-
entryId:
|
|
79
|
-
message:
|
|
78
|
+
entryId: Schema.String,
|
|
79
|
+
message: Animation.Message,
|
|
80
80
|
},
|
|
81
81
|
})), "@foldkit/ui/toast/schema.js#makeMessage");
|
|
82
82
|
/** Factory for the union of out-messages the toast component can produce. */
|
package/dist/toast/test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/toast/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/toast/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAMtC;;;2BAG2B;AAC3B,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAC,CAAA;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,UAAU,0BAGpB,eAAe,iKAUf,CAAA"}
|
package/dist/toast/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import * as Story from 'foldkit/story';
|
|
3
|
-
import
|
|
3
|
+
import * as Animation from '../animation/index.js';
|
|
4
4
|
import { Message } from './schema.js';
|
|
5
5
|
import { WaitBeforeDismissal } from './update.js';
|
|
6
6
|
const DEFAULT_VERSION = 0;
|
|
@@ -35,7 +35,7 @@ const DEFAULT_VERSION = 0;
|
|
|
35
35
|
* )
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
export const drainEntry = ({ entryId, version = DEFAULT_VERSION, }) => __foldkitBrandViewResult((Story.Command.resolveAll([WaitForPaint,
|
|
38
|
+
export const drainEntry = ({ entryId, version = DEFAULT_VERSION, }) => __foldkitBrandViewResult((Story.Command.resolveAll([Animation.WaitForPaint, Animation.Message.CompletedWaitForPaint()], [Animation.WaitForAnimationSettled, Animation.Message.EndedAnimation()], [
|
|
39
39
|
WaitBeforeDismissal,
|
|
40
40
|
Message.CompletedWaitBeforeDismissal({ entryId, version }),
|
|
41
|
-
], [WaitForPaint,
|
|
41
|
+
], [Animation.WaitForPaint, Animation.Message.CompletedWaitForPaint()], [Animation.WaitForAnimationSettled, Animation.Message.EndedAnimation()])), "@foldkit/ui/toast/test.js#drainEntry");
|