@foldkit/ui 0.148.2 → 0.149.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/animation/index.d.ts +3 -3
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +2 -2
- 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 +12 -21
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +11 -15
- package/dist/animation/update.d.ts +1 -1
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +9 -9
- package/dist/calendar/index.d.ts +50 -105
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +61 -98
- package/dist/calendar/public.d.ts +1 -1
- package/dist/calendar/public.d.ts.map +1 -1
- package/dist/calendar/public.js +1 -1
- package/dist/combobox/multi.d.ts +9 -9
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/multi.js +9 -9
- package/dist/combobox/public.d.ts +1 -1
- package/dist/combobox/public.d.ts.map +1 -1
- package/dist/combobox/public.js +1 -1
- package/dist/combobox/shared.d.ts +93 -137
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +108 -153
- package/dist/combobox/single.d.ts +9 -9
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/combobox/single.js +10 -10
- package/dist/datePicker/index.d.ts +88 -84
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +33 -63
- package/dist/datePicker/public.d.ts +1 -1
- package/dist/datePicker/public.d.ts.map +1 -1
- package/dist/datePicker/public.js +1 -1
- package/dist/dialog/index.d.ts +28 -49
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +39 -67
- package/dist/dialog/public.d.ts +1 -1
- package/dist/dialog/public.d.ts.map +1 -1
- package/dist/dialog/public.js +1 -1
- package/dist/dragAndDrop/index.d.ts +45 -72
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +72 -93
- package/dist/dragAndDrop/public.d.ts +1 -1
- package/dist/dragAndDrop/public.d.ts.map +1 -1
- package/dist/dragAndDrop/public.js +1 -1
- package/dist/fileDrop/index.d.ts +14 -35
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/fileDrop/index.js +20 -46
- package/dist/fileDrop/public.d.ts +1 -1
- package/dist/fileDrop/public.d.ts.map +1 -1
- package/dist/fileDrop/public.js +1 -1
- package/dist/listbox/multi.d.ts +7 -7
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/multi.js +8 -8
- package/dist/listbox/public.d.ts +1 -1
- package/dist/listbox/public.d.ts.map +1 -1
- package/dist/listbox/public.js +1 -1
- package/dist/listbox/shared.d.ts +80 -127
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +92 -149
- package/dist/listbox/single.d.ts +7 -7
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/listbox/single.js +8 -8
- package/dist/menu/index.d.ts +86 -134
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +141 -189
- package/dist/menu/public.d.ts +1 -1
- package/dist/menu/public.d.ts.map +1 -1
- package/dist/menu/public.js +1 -1
- package/dist/popover/index.d.ts +39 -65
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +68 -98
- package/dist/popover/public.d.ts +1 -1
- package/dist/popover/public.d.ts.map +1 -1
- package/dist/popover/public.js +1 -1
- package/dist/radioGroup/index.d.ts +18 -29
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/radioGroup/index.js +22 -27
- package/dist/radioGroup/public.d.ts +1 -1
- package/dist/radioGroup/public.d.ts.map +1 -1
- package/dist/radioGroup/public.js +1 -1
- package/dist/slider/index.d.ts +29 -51
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +36 -56
- package/dist/slider/public.d.ts +1 -1
- package/dist/slider/public.d.ts.map +1 -1
- package/dist/slider/public.js +1 -1
- package/dist/tabs/index.d.ts +18 -28
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +22 -26
- package/dist/tabs/public.d.ts +1 -1
- package/dist/tabs/public.d.ts.map +1 -1
- package/dist/tabs/public.js +1 -1
- package/dist/test/apps/disabledButton.d.ts +71 -14
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +14 -13
- package/dist/toast/index.d.ts +124 -109
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +5 -5
- package/dist/toast/public.d.ts +1 -1
- package/dist/toast/public.d.ts.map +1 -1
- package/dist/toast/public.js +1 -1
- package/dist/toast/schema.d.ts +72 -84
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +31 -41
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/test.js +6 -3
- package/dist/toast/update.d.ts +104 -89
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +19 -20
- package/dist/tooltip/message.d.ts +26 -47
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/message.js +15 -40
- package/dist/tooltip/public.d.ts +1 -1
- package/dist/tooltip/public.d.ts.map +1 -1
- package/dist/tooltip/public.js +1 -1
- package/dist/tooltip/tooltip.d.ts +1 -1
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +15 -16
- package/dist/virtualList/index.d.ts +46 -23
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +12 -23
- package/dist/virtualList/public.d.ts +1 -1
- package/dist/virtualList/public.d.ts.map +1 -1
- package/dist/virtualList/public.js +1 -1
- package/package.json +3 -3
package/dist/toast/schema.d.ts
CHANGED
|
@@ -51,97 +51,85 @@ export declare const makeModel: <A, I>(payloadSchema: S.Codec<A, I>) => S.Struct
|
|
|
51
51
|
}>>;
|
|
52
52
|
readonly nextEntryKey: S.Number;
|
|
53
53
|
}>;
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}>;
|
|
78
|
-
/** Wraps a single entry's Animation submodel message for delegation. */
|
|
79
|
-
export declare const GotAnimationMessage: import("foldkit/schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
80
|
-
entryId: S.String;
|
|
81
|
-
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitForPaint", {}>, import("foldkit/schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
82
|
-
}>;
|
|
83
|
-
export type Dismissed = typeof Dismissed.Type;
|
|
84
|
-
export type DismissedAll = typeof DismissedAll.Type;
|
|
85
|
-
export type CompletedWaitBeforeDismissal = typeof CompletedWaitBeforeDismissal.Type;
|
|
86
|
-
export type HoveredEntry = typeof HoveredEntry.Type;
|
|
87
|
-
export type LeftEntry = typeof LeftEntry.Type;
|
|
88
|
-
export type GotAnimationMessage = typeof GotAnimationMessage.Type;
|
|
89
|
-
/** Factory for the `Added` message, which carries a fully-constructed entry
|
|
90
|
-
* whose shape depends on the user-provided payload. */
|
|
91
|
-
export declare const makeAdded: <A, I>(payloadSchema: S.Codec<A, I>) => import("foldkit/schema").CallableTaggedStruct<"Added", {
|
|
92
|
-
entry: S.Struct<{
|
|
93
|
-
readonly id: S.String;
|
|
94
|
-
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
95
|
-
readonly animation: S.Struct<{
|
|
96
|
-
readonly id: S.String;
|
|
97
|
-
readonly isShowing: S.Boolean;
|
|
98
|
-
readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
54
|
+
/** Payload-independent Message variants shared by every bound Toast module. */
|
|
55
|
+
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
56
|
+
readonly Dismissed: {
|
|
57
|
+
readonly entryId: S.String;
|
|
58
|
+
};
|
|
59
|
+
readonly DismissedAll: {};
|
|
60
|
+
readonly CompletedWaitBeforeDismissal: {
|
|
61
|
+
readonly entryId: S.String;
|
|
62
|
+
readonly version: S.Number;
|
|
63
|
+
};
|
|
64
|
+
readonly HoveredEntry: {
|
|
65
|
+
readonly entryId: S.String;
|
|
66
|
+
};
|
|
67
|
+
readonly LeftEntry: {
|
|
68
|
+
readonly entryId: S.String;
|
|
69
|
+
};
|
|
70
|
+
readonly GotAnimationMessage: {
|
|
71
|
+
readonly entryId: S.String;
|
|
72
|
+
readonly message: import("foldkit/message").MessageUnion<{
|
|
73
|
+
readonly Showed: {};
|
|
74
|
+
readonly Hid: {};
|
|
75
|
+
readonly CompletedWaitForPaint: {};
|
|
76
|
+
readonly EndedAnimation: {};
|
|
99
77
|
}>;
|
|
100
|
-
|
|
101
|
-
readonly pendingDismissVersion: S.Number;
|
|
102
|
-
readonly isHovered: S.Boolean;
|
|
103
|
-
readonly payload: S.Codec<A, I, never, never>;
|
|
104
|
-
}>;
|
|
78
|
+
};
|
|
105
79
|
}>;
|
|
80
|
+
export type Dismissed = typeof Message.Dismissed.Type;
|
|
81
|
+
export type DismissedAll = typeof Message.DismissedAll.Type;
|
|
82
|
+
export type CompletedWaitBeforeDismissal = typeof Message.CompletedWaitBeforeDismissal.Type;
|
|
83
|
+
export type HoveredEntry = typeof Message.HoveredEntry.Type;
|
|
84
|
+
export type LeftEntry = typeof Message.LeftEntry.Type;
|
|
85
|
+
export type GotAnimationMessage = typeof Message.GotAnimationMessage.Type;
|
|
106
86
|
/** Factory for the union of all messages the toast component can produce. */
|
|
107
|
-
export declare const makeMessage: <A, I>(payloadSchema: S.Codec<A, I>) =>
|
|
108
|
-
|
|
109
|
-
readonly
|
|
110
|
-
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
111
|
-
readonly animation: S.Struct<{
|
|
87
|
+
export declare const makeMessage: <A, I>(payloadSchema: S.Codec<A, I>) => import("foldkit/message").MessageUnion<{
|
|
88
|
+
readonly Added: {
|
|
89
|
+
readonly entry: S.Struct<{
|
|
112
90
|
readonly id: S.String;
|
|
113
|
-
readonly
|
|
114
|
-
readonly
|
|
91
|
+
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
92
|
+
readonly animation: S.Struct<{
|
|
93
|
+
readonly id: S.String;
|
|
94
|
+
readonly isShowing: S.Boolean;
|
|
95
|
+
readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
96
|
+
}>;
|
|
97
|
+
readonly maybeDuration: S.Option<S.DurationFromMillis>;
|
|
98
|
+
readonly pendingDismissVersion: S.Number;
|
|
99
|
+
readonly isHovered: S.Boolean;
|
|
100
|
+
readonly payload: S.Codec<A, I, never, never>;
|
|
115
101
|
}>;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
readonly
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
102
|
+
};
|
|
103
|
+
readonly Dismissed: {
|
|
104
|
+
readonly entryId: S.String;
|
|
105
|
+
};
|
|
106
|
+
readonly DismissedAll: {};
|
|
107
|
+
readonly CompletedWaitBeforeDismissal: {
|
|
108
|
+
readonly entryId: S.String;
|
|
109
|
+
readonly version: S.Number;
|
|
110
|
+
};
|
|
111
|
+
readonly HoveredEntry: {
|
|
112
|
+
readonly entryId: S.String;
|
|
113
|
+
};
|
|
114
|
+
readonly LeftEntry: {
|
|
115
|
+
readonly entryId: S.String;
|
|
116
|
+
};
|
|
117
|
+
readonly GotAnimationMessage: {
|
|
118
|
+
readonly entryId: S.String;
|
|
119
|
+
readonly message: import("foldkit/message").MessageUnion<{
|
|
120
|
+
readonly Showed: {};
|
|
121
|
+
readonly Hid: {};
|
|
122
|
+
readonly CompletedWaitForPaint: {};
|
|
123
|
+
readonly EndedAnimation: {};
|
|
124
|
+
}>;
|
|
125
|
+
};
|
|
140
126
|
}>;
|
|
141
127
|
/** Factory for the union of out-messages the toast component can produce. */
|
|
142
|
-
export declare const makeOutMessage: <A, I>(payloadSchema: S.Codec<A, I>) =>
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
export declare const makeOutMessage: <A, I>(payloadSchema: S.Codec<A, I>) => import("foldkit/message").MessageUnion<{
|
|
129
|
+
readonly DismissedToast: {
|
|
130
|
+
readonly payload: S.Codec<A, I, never, never>;
|
|
131
|
+
};
|
|
132
|
+
}>;
|
|
145
133
|
/** Configuration for creating a toast container model. `defaultDuration` is
|
|
146
134
|
* applied to any `show()` call that doesn't provide its own `duration` or
|
|
147
135
|
* pass `sticky: true`. Accepts any Effect Duration input; a bare number is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/toast/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAU9C;;;;kDAIkD;AAClD,eAAO,MAAM,OAAO,8DAAsD,CAAA;AAC1E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,gFAAgF;AAChF,eAAO,MAAM,QAAQ,wGAOnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAI3C;;;;;4BAK4B;AAC5B,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;EASxD,CAAA;AAIJ;;;;wCAIwC;AACxC,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;EAMxD,CAAA;AAIJ;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/toast/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAU9C;;;;kDAIkD;AAClD,eAAO,MAAM,OAAO,8DAAsD,CAAA;AAC1E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,gFAAgF;AAChF,eAAO,MAAM,QAAQ,wGAOnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAI3C;;;;;4BAK4B;AAC5B,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;EASxD,CAAA;AAIJ;;;;wCAIwC;AACxC,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;EAMxD,CAAA;AAIJ,+EAA+E;AAC/E,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;EAalB,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,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe1D,CAAA;AAEJ,6EAA6E;AAC7E,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;EACG,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,6 +1,6 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import { Duration, Schema as S } from 'effect';
|
|
3
|
-
import {
|
|
3
|
+
import { defineMessageUnion } from 'foldkit/message';
|
|
4
4
|
import { Message as AnimationMessage, Model as AnimationModel, } from '../animation/schema.js';
|
|
5
5
|
// VARIANT
|
|
6
6
|
/** Semantic category of a toast. Drives the default ARIA role: `status` for
|
|
@@ -48,47 +48,37 @@ export const makeModel = (payloadSchema) => __foldkitBrandViewResult((S.Struct({
|
|
|
48
48
|
nextEntryKey: S.Number,
|
|
49
49
|
})), "@foldkit/ui/toast/schema.js#makeModel");
|
|
50
50
|
// MESSAGE
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
entryId: S.String,
|
|
61
|
-
|
|
51
|
+
/** Payload-independent Message variants shared by every bound Toast module. */
|
|
52
|
+
export const Message = defineMessageUnion({
|
|
53
|
+
Dismissed: { entryId: S.String },
|
|
54
|
+
DismissedAll: {},
|
|
55
|
+
CompletedWaitBeforeDismissal: {
|
|
56
|
+
entryId: S.String,
|
|
57
|
+
version: S.Number,
|
|
58
|
+
},
|
|
59
|
+
HoveredEntry: { entryId: S.String },
|
|
60
|
+
LeftEntry: { entryId: S.String },
|
|
61
|
+
GotAnimationMessage: {
|
|
62
|
+
entryId: S.String,
|
|
63
|
+
message: AnimationMessage,
|
|
64
|
+
},
|
|
62
65
|
});
|
|
63
|
-
/** Sent when the pointer enters an entry. Pauses the auto-dismiss timer by
|
|
64
|
-
* advancing the entry's version. */
|
|
65
|
-
export const HoveredEntry = m('HoveredEntry', { entryId: S.String });
|
|
66
|
-
/** Sent when the pointer leaves an entry. Restarts the auto-dismiss timer
|
|
67
|
-
* with the entry's full duration. */
|
|
68
|
-
export const LeftEntry = m('LeftEntry', { entryId: S.String });
|
|
69
|
-
/** Wraps a single entry's Animation submodel message for delegation. */
|
|
70
|
-
export const GotAnimationMessage = m('GotAnimationMessage', {
|
|
71
|
-
entryId: S.String,
|
|
72
|
-
message: AnimationMessage,
|
|
73
|
-
});
|
|
74
|
-
/** Factory for the `Added` message, which carries a fully-constructed entry
|
|
75
|
-
* whose shape depends on the user-provided payload. */
|
|
76
|
-
export const makeAdded = (payloadSchema) => __foldkitBrandViewResult((m('Added', { entry: makeEntry(payloadSchema) })), "@foldkit/ui/toast/schema.js#makeAdded");
|
|
77
66
|
/** Factory for the union of all messages the toast component can produce. */
|
|
78
|
-
export const makeMessage = (payloadSchema) => __foldkitBrandViewResult((
|
|
79
|
-
|
|
80
|
-
Dismissed,
|
|
81
|
-
DismissedAll,
|
|
82
|
-
CompletedWaitBeforeDismissal
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
67
|
+
export const makeMessage = (payloadSchema) => __foldkitBrandViewResult((defineMessageUnion({
|
|
68
|
+
Added: { entry: makeEntry(payloadSchema) },
|
|
69
|
+
Dismissed: { entryId: S.String },
|
|
70
|
+
DismissedAll: {},
|
|
71
|
+
CompletedWaitBeforeDismissal: {
|
|
72
|
+
entryId: S.String,
|
|
73
|
+
version: S.Number,
|
|
74
|
+
},
|
|
75
|
+
HoveredEntry: { entryId: S.String },
|
|
76
|
+
LeftEntry: { entryId: S.String },
|
|
77
|
+
GotAnimationMessage: {
|
|
78
|
+
entryId: S.String,
|
|
79
|
+
message: AnimationMessage,
|
|
80
|
+
},
|
|
81
|
+
})), "@foldkit/ui/toast/schema.js#makeMessage");
|
|
92
82
|
/** Factory for the union of out-messages the toast component can produce. */
|
|
93
|
-
export const makeOutMessage = (payloadSchema) => __foldkitBrandViewResult((
|
|
83
|
+
export const makeOutMessage = (payloadSchema) => __foldkitBrandViewResult((defineMessageUnion({ DismissedToast: { payload: payloadSchema } })), "@foldkit/ui/toast/schema.js#makeOutMessage");
|
|
94
84
|
export const DEFAULT_DURATION = Duration.seconds(4);
|
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;AAUtC;;;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,GAAI,uBAGxB,eAAe,iKAUf,CAAA"}
|
package/dist/toast/test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import * as Story from 'foldkit/story';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Message as AnimationMessage, WaitForAnimationSettled, WaitForPaint, } from '../animation/index.js';
|
|
4
|
+
import { Message } from './schema.js';
|
|
5
5
|
import { WaitBeforeDismissal } from './update.js';
|
|
6
6
|
const DEFAULT_VERSION = 0;
|
|
7
7
|
/** Builds a {@link Story.Command.resolveAll} step that drains a single toast
|
|
@@ -35,4 +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, CompletedWaitForPaint()], [WaitForAnimationSettled, EndedAnimation()], [
|
|
38
|
+
export const drainEntry = ({ entryId, version = DEFAULT_VERSION, }) => __foldkitBrandViewResult((Story.Command.resolveAll([WaitForPaint, AnimationMessage.CompletedWaitForPaint()], [WaitForAnimationSettled, AnimationMessage.EndedAnimation()], [
|
|
39
|
+
WaitBeforeDismissal,
|
|
40
|
+
Message.CompletedWaitBeforeDismissal({ entryId, version }),
|
|
41
|
+
], [WaitForPaint, AnimationMessage.CompletedWaitForPaint()], [WaitForAnimationSettled, AnimationMessage.EndedAnimation()])), "@foldkit/ui/toast/test.js#drainEntry");
|
package/dist/toast/update.d.ts
CHANGED
|
@@ -62,38 +62,53 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
62
62
|
}>>;
|
|
63
63
|
readonly nextEntryKey: S.Number;
|
|
64
64
|
}>;
|
|
65
|
-
readonly Message:
|
|
66
|
-
|
|
67
|
-
readonly
|
|
68
|
-
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
69
|
-
readonly animation: S.Struct<{
|
|
65
|
+
readonly Message: import("foldkit/message").MessageUnion<{
|
|
66
|
+
readonly Added: {
|
|
67
|
+
readonly entry: S.Struct<{
|
|
70
68
|
readonly id: S.String;
|
|
71
|
-
readonly
|
|
72
|
-
readonly
|
|
69
|
+
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
70
|
+
readonly animation: S.Struct<{
|
|
71
|
+
readonly id: S.String;
|
|
72
|
+
readonly isShowing: S.Boolean;
|
|
73
|
+
readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
74
|
+
}>;
|
|
75
|
+
readonly maybeDuration: S.Option<S.DurationFromMillis>;
|
|
76
|
+
readonly pendingDismissVersion: S.Number;
|
|
77
|
+
readonly isHovered: S.Boolean;
|
|
78
|
+
readonly payload: S.Codec<A, I, never, never>;
|
|
73
79
|
}>;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
readonly
|
|
80
|
+
};
|
|
81
|
+
readonly Dismissed: {
|
|
82
|
+
readonly entryId: S.String;
|
|
83
|
+
};
|
|
84
|
+
readonly DismissedAll: {};
|
|
85
|
+
readonly CompletedWaitBeforeDismissal: {
|
|
86
|
+
readonly entryId: S.String;
|
|
87
|
+
readonly version: S.Number;
|
|
88
|
+
};
|
|
89
|
+
readonly HoveredEntry: {
|
|
90
|
+
readonly entryId: S.String;
|
|
91
|
+
};
|
|
92
|
+
readonly LeftEntry: {
|
|
93
|
+
readonly entryId: S.String;
|
|
94
|
+
};
|
|
95
|
+
readonly GotAnimationMessage: {
|
|
96
|
+
readonly entryId: S.String;
|
|
97
|
+
readonly message: import("foldkit/message").MessageUnion<{
|
|
98
|
+
readonly Showed: {};
|
|
99
|
+
readonly Hid: {};
|
|
100
|
+
readonly CompletedWaitForPaint: {};
|
|
101
|
+
readonly EndedAnimation: {};
|
|
102
|
+
}>;
|
|
103
|
+
};
|
|
104
|
+
}>;
|
|
105
|
+
readonly OutMessage: import("foldkit/message").MessageUnion<{
|
|
106
|
+
readonly DismissedToast: {
|
|
77
107
|
readonly payload: S.Codec<A, I, never, never>;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
entryId: S.String;
|
|
81
|
-
}>, import("foldkit/schema").CallableTaggedStruct<"DismissedAll", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitBeforeDismissal", {
|
|
82
|
-
entryId: S.String;
|
|
83
|
-
version: S.Number;
|
|
84
|
-
}>, import("foldkit/schema").CallableTaggedStruct<"HoveredEntry", {
|
|
85
|
-
entryId: S.String;
|
|
86
|
-
}>, import("foldkit/schema").CallableTaggedStruct<"LeftEntry", {
|
|
87
|
-
entryId: S.String;
|
|
88
|
-
}>, import("foldkit/schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
89
|
-
entryId: S.String;
|
|
90
|
-
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitForPaint", {}>, import("foldkit/schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
91
|
-
}>]>;
|
|
92
|
-
readonly OutMessage: S.Union<readonly [import("foldkit/schema").CallableTaggedStruct<"DismissedToast", {
|
|
93
|
-
payload: S.Codec<A, I, never, never>;
|
|
94
|
-
}>]>;
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
95
110
|
readonly Added: import("foldkit/schema").CallableTaggedStruct<"Added", {
|
|
96
|
-
entry: S.Struct<{
|
|
111
|
+
readonly entry: S.Struct<{
|
|
97
112
|
readonly id: S.String;
|
|
98
113
|
readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
|
|
99
114
|
readonly animation: S.Struct<{
|
|
@@ -108,7 +123,7 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
108
123
|
}>;
|
|
109
124
|
}>;
|
|
110
125
|
readonly DismissedToast: import("foldkit/schema").CallableTaggedStruct<"DismissedToast", {
|
|
111
|
-
payload: S.Codec<A, I, never, never>;
|
|
126
|
+
readonly payload: S.Codec<A, I, never, never>;
|
|
112
127
|
}>;
|
|
113
128
|
readonly init: (config: InitConfig) => {
|
|
114
129
|
readonly id: string;
|
|
@@ -146,6 +161,18 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
146
161
|
}[];
|
|
147
162
|
readonly nextEntryKey: number;
|
|
148
163
|
}, message: {
|
|
164
|
+
readonly _tag: "GotAnimationMessage";
|
|
165
|
+
readonly entryId: string;
|
|
166
|
+
readonly message: {
|
|
167
|
+
readonly _tag: "Showed";
|
|
168
|
+
} | {
|
|
169
|
+
readonly _tag: "Hid";
|
|
170
|
+
} | {
|
|
171
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
172
|
+
} | {
|
|
173
|
+
readonly _tag: "EndedAnimation";
|
|
174
|
+
};
|
|
175
|
+
} | {
|
|
149
176
|
readonly _tag: "Dismissed";
|
|
150
177
|
readonly entryId: string;
|
|
151
178
|
} | {
|
|
@@ -160,18 +187,6 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
160
187
|
} | {
|
|
161
188
|
readonly _tag: "LeftEntry";
|
|
162
189
|
readonly entryId: string;
|
|
163
|
-
} | {
|
|
164
|
-
readonly _tag: "GotAnimationMessage";
|
|
165
|
-
readonly entryId: string;
|
|
166
|
-
readonly message: {
|
|
167
|
-
readonly _tag: "Showed";
|
|
168
|
-
} | {
|
|
169
|
-
readonly _tag: "Hid";
|
|
170
|
-
} | {
|
|
171
|
-
readonly _tag: "CompletedWaitForPaint";
|
|
172
|
-
} | {
|
|
173
|
-
readonly _tag: "EndedAnimation";
|
|
174
|
-
};
|
|
175
190
|
} | {
|
|
176
191
|
readonly _tag: "Added";
|
|
177
192
|
readonly entry: {
|
|
@@ -209,6 +224,18 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
209
224
|
args?: Record<string, unknown>;
|
|
210
225
|
key?: string;
|
|
211
226
|
effect: Effect.Effect<{
|
|
227
|
+
readonly _tag: "GotAnimationMessage";
|
|
228
|
+
readonly entryId: string;
|
|
229
|
+
readonly message: {
|
|
230
|
+
readonly _tag: "Showed";
|
|
231
|
+
} | {
|
|
232
|
+
readonly _tag: "Hid";
|
|
233
|
+
} | {
|
|
234
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
235
|
+
} | {
|
|
236
|
+
readonly _tag: "EndedAnimation";
|
|
237
|
+
};
|
|
238
|
+
} | {
|
|
212
239
|
readonly _tag: "Dismissed";
|
|
213
240
|
readonly entryId: string;
|
|
214
241
|
} | {
|
|
@@ -223,18 +250,6 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
223
250
|
} | {
|
|
224
251
|
readonly _tag: "LeftEntry";
|
|
225
252
|
readonly entryId: string;
|
|
226
|
-
} | {
|
|
227
|
-
readonly _tag: "GotAnimationMessage";
|
|
228
|
-
readonly entryId: string;
|
|
229
|
-
readonly message: {
|
|
230
|
-
readonly _tag: "Showed";
|
|
231
|
-
} | {
|
|
232
|
-
readonly _tag: "Hid";
|
|
233
|
-
} | {
|
|
234
|
-
readonly _tag: "CompletedWaitForPaint";
|
|
235
|
-
} | {
|
|
236
|
-
readonly _tag: "EndedAnimation";
|
|
237
|
-
};
|
|
238
253
|
} | {
|
|
239
254
|
readonly _tag: "Added";
|
|
240
255
|
readonly entry: {
|
|
@@ -294,6 +309,18 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
294
309
|
args?: Record<string, unknown>;
|
|
295
310
|
key?: string;
|
|
296
311
|
effect: Effect.Effect<{
|
|
312
|
+
readonly _tag: "GotAnimationMessage";
|
|
313
|
+
readonly entryId: string;
|
|
314
|
+
readonly message: {
|
|
315
|
+
readonly _tag: "Showed";
|
|
316
|
+
} | {
|
|
317
|
+
readonly _tag: "Hid";
|
|
318
|
+
} | {
|
|
319
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
320
|
+
} | {
|
|
321
|
+
readonly _tag: "EndedAnimation";
|
|
322
|
+
};
|
|
323
|
+
} | {
|
|
297
324
|
readonly _tag: "Dismissed";
|
|
298
325
|
readonly entryId: string;
|
|
299
326
|
} | {
|
|
@@ -308,18 +335,6 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
308
335
|
} | {
|
|
309
336
|
readonly _tag: "LeftEntry";
|
|
310
337
|
readonly entryId: string;
|
|
311
|
-
} | {
|
|
312
|
-
readonly _tag: "GotAnimationMessage";
|
|
313
|
-
readonly entryId: string;
|
|
314
|
-
readonly message: {
|
|
315
|
-
readonly _tag: "Showed";
|
|
316
|
-
} | {
|
|
317
|
-
readonly _tag: "Hid";
|
|
318
|
-
} | {
|
|
319
|
-
readonly _tag: "CompletedWaitForPaint";
|
|
320
|
-
} | {
|
|
321
|
-
readonly _tag: "EndedAnimation";
|
|
322
|
-
};
|
|
323
338
|
} | {
|
|
324
339
|
readonly _tag: "Added";
|
|
325
340
|
readonly entry: {
|
|
@@ -379,6 +394,18 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
379
394
|
args?: Record<string, unknown>;
|
|
380
395
|
key?: string;
|
|
381
396
|
effect: Effect.Effect<{
|
|
397
|
+
readonly _tag: "GotAnimationMessage";
|
|
398
|
+
readonly entryId: string;
|
|
399
|
+
readonly message: {
|
|
400
|
+
readonly _tag: "Showed";
|
|
401
|
+
} | {
|
|
402
|
+
readonly _tag: "Hid";
|
|
403
|
+
} | {
|
|
404
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
405
|
+
} | {
|
|
406
|
+
readonly _tag: "EndedAnimation";
|
|
407
|
+
};
|
|
408
|
+
} | {
|
|
382
409
|
readonly _tag: "Dismissed";
|
|
383
410
|
readonly entryId: string;
|
|
384
411
|
} | {
|
|
@@ -393,18 +420,6 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
393
420
|
} | {
|
|
394
421
|
readonly _tag: "LeftEntry";
|
|
395
422
|
readonly entryId: string;
|
|
396
|
-
} | {
|
|
397
|
-
readonly _tag: "GotAnimationMessage";
|
|
398
|
-
readonly entryId: string;
|
|
399
|
-
readonly message: {
|
|
400
|
-
readonly _tag: "Showed";
|
|
401
|
-
} | {
|
|
402
|
-
readonly _tag: "Hid";
|
|
403
|
-
} | {
|
|
404
|
-
readonly _tag: "CompletedWaitForPaint";
|
|
405
|
-
} | {
|
|
406
|
-
readonly _tag: "EndedAnimation";
|
|
407
|
-
};
|
|
408
423
|
} | {
|
|
409
424
|
readonly _tag: "Added";
|
|
410
425
|
readonly entry: {
|
|
@@ -464,6 +479,18 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
464
479
|
args?: Record<string, unknown>;
|
|
465
480
|
key?: string;
|
|
466
481
|
effect: Effect.Effect<{
|
|
482
|
+
readonly _tag: "GotAnimationMessage";
|
|
483
|
+
readonly entryId: string;
|
|
484
|
+
readonly message: {
|
|
485
|
+
readonly _tag: "Showed";
|
|
486
|
+
} | {
|
|
487
|
+
readonly _tag: "Hid";
|
|
488
|
+
} | {
|
|
489
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
490
|
+
} | {
|
|
491
|
+
readonly _tag: "EndedAnimation";
|
|
492
|
+
};
|
|
493
|
+
} | {
|
|
467
494
|
readonly _tag: "Dismissed";
|
|
468
495
|
readonly entryId: string;
|
|
469
496
|
} | {
|
|
@@ -478,18 +505,6 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
|
|
|
478
505
|
} | {
|
|
479
506
|
readonly _tag: "LeftEntry";
|
|
480
507
|
readonly entryId: string;
|
|
481
|
-
} | {
|
|
482
|
-
readonly _tag: "GotAnimationMessage";
|
|
483
|
-
readonly entryId: string;
|
|
484
|
-
readonly message: {
|
|
485
|
-
readonly _tag: "Showed";
|
|
486
|
-
} | {
|
|
487
|
-
readonly _tag: "Hid";
|
|
488
|
-
} | {
|
|
489
|
-
readonly _tag: "CompletedWaitForPaint";
|
|
490
|
-
} | {
|
|
491
|
-
readonly _tag: "EndedAnimation";
|
|
492
|
-
};
|
|
493
508
|
} | {
|
|
494
509
|
readonly _tag: "Added";
|
|
495
510
|
readonly entry: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/toast/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAc1C,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,OAAO,EAKb,MAAM,aAAa,CAAA;AAIpB;;oDAEoD;AACpD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC;IAClC,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAEF;;;eAGe;AACf,eAAO,MAAM,mBAAmB;;;;;;;;iBAa9B,CAAA;AAIF;;;;;;4EAM4E;AAC5E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAiKtC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoJG,SAAS,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB/C,CAAA"}
|