foldkit 0.111.0 → 0.112.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.
Files changed (222) hide show
  1. package/README.md +2 -2
  2. package/dist/devTools/host.d.ts +6 -0
  3. package/dist/devTools/host.d.ts.map +1 -0
  4. package/dist/devTools/host.js +4 -0
  5. package/dist/dom/dom.d.ts +6 -1
  6. package/dist/dom/dom.d.ts.map +1 -1
  7. package/dist/dom/dom.js +24 -1
  8. package/dist/html/index.d.ts +4 -3
  9. package/dist/html/index.d.ts.map +1 -1
  10. package/dist/html/index.js +4 -3
  11. package/dist/html/submodel.d.ts +2 -2
  12. package/dist/html/submodel.d.ts.map +1 -1
  13. package/dist/index.d.ts +0 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +0 -1
  16. package/dist/runtime/public.d.ts +1 -1
  17. package/dist/runtime/public.d.ts.map +1 -1
  18. package/dist/runtime/runtime.d.ts +14 -1
  19. package/dist/runtime/runtime.d.ts.map +1 -1
  20. package/dist/runtime/runtime.js +7 -4
  21. package/dist/runtime/subscription.d.ts +1 -1
  22. package/dist/subscription/public.d.ts +1 -1
  23. package/dist/subscription/public.d.ts.map +1 -1
  24. package/package.json +12 -93
  25. package/dist/devTools/overlay-styles.d.ts +0 -3
  26. package/dist/devTools/overlay-styles.d.ts.map +0 -1
  27. package/dist/devTools/overlay-styles.js +0 -706
  28. package/dist/devTools/overlay.d.ts +0 -63
  29. package/dist/devTools/overlay.d.ts.map +0 -1
  30. package/dist/devTools/overlay.js +0 -1244
  31. package/dist/test/apps/disabledButton.d.ts +0 -38
  32. package/dist/test/apps/disabledButton.d.ts.map +0 -1
  33. package/dist/test/apps/disabledButton.js +0 -71
  34. package/dist/ui/anchor.d.ts +0 -38
  35. package/dist/ui/anchor.d.ts.map +0 -1
  36. package/dist/ui/anchor.js +0 -142
  37. package/dist/ui/animation/index.d.ts +0 -49
  38. package/dist/ui/animation/index.d.ts.map +0 -1
  39. package/dist/ui/animation/index.js +0 -74
  40. package/dist/ui/animation/public.d.ts +0 -3
  41. package/dist/ui/animation/public.d.ts.map +0 -1
  42. package/dist/ui/animation/public.js +0 -1
  43. package/dist/ui/animation/schema.d.ts +0 -43
  44. package/dist/ui/animation/schema.d.ts.map +0 -1
  45. package/dist/ui/animation/schema.js +0 -41
  46. package/dist/ui/animation/update.d.ts +0 -24
  47. package/dist/ui/animation/update.d.ts.map +0 -1
  48. package/dist/ui/animation/update.js +0 -67
  49. package/dist/ui/button/index.d.ts +0 -17
  50. package/dist/ui/button/index.d.ts.map +0 -1
  51. package/dist/ui/button/index.js +0 -22
  52. package/dist/ui/button/public.d.ts +0 -3
  53. package/dist/ui/button/public.d.ts.map +0 -1
  54. package/dist/ui/button/public.js +0 -1
  55. package/dist/ui/calendar/index.d.ts +0 -462
  56. package/dist/ui/calendar/index.d.ts.map +0 -1
  57. package/dist/ui/calendar/index.js +0 -824
  58. package/dist/ui/calendar/public.d.ts +0 -3
  59. package/dist/ui/calendar/public.d.ts.map +0 -1
  60. package/dist/ui/calendar/public.js +0 -1
  61. package/dist/ui/checkbox/index.d.ts +0 -119
  62. package/dist/ui/checkbox/index.d.ts.map +0 -1
  63. package/dist/ui/checkbox/index.js +0 -110
  64. package/dist/ui/checkbox/public.d.ts +0 -3
  65. package/dist/ui/checkbox/public.d.ts.map +0 -1
  66. package/dist/ui/checkbox/public.js +0 -1
  67. package/dist/ui/combobox/multi.d.ts +0 -184
  68. package/dist/ui/combobox/multi.d.ts.map +0 -1
  69. package/dist/ui/combobox/multi.js +0 -81
  70. package/dist/ui/combobox/multiPublic.d.ts +0 -3
  71. package/dist/ui/combobox/multiPublic.d.ts.map +0 -1
  72. package/dist/ui/combobox/multiPublic.js +0 -1
  73. package/dist/ui/combobox/public.d.ts +0 -7
  74. package/dist/ui/combobox/public.d.ts.map +0 -1
  75. package/dist/ui/combobox/public.js +0 -3
  76. package/dist/ui/combobox/shared.d.ts +0 -422
  77. package/dist/ui/combobox/shared.d.ts.map +0 -1
  78. package/dist/ui/combobox/shared.js +0 -707
  79. package/dist/ui/combobox/single.d.ts +0 -199
  80. package/dist/ui/combobox/single.d.ts.map +0 -1
  81. package/dist/ui/combobox/single.js +0 -106
  82. package/dist/ui/datePicker/index.d.ts +0 -457
  83. package/dist/ui/datePicker/index.d.ts.map +0 -1
  84. package/dist/ui/datePicker/index.js +0 -317
  85. package/dist/ui/datePicker/public.d.ts +0 -3
  86. package/dist/ui/datePicker/public.d.ts.map +0 -1
  87. package/dist/ui/datePicker/public.js +0 -1
  88. package/dist/ui/dialog/index.d.ts +0 -155
  89. package/dist/ui/dialog/index.d.ts.map +0 -1
  90. package/dist/ui/dialog/index.js +0 -208
  91. package/dist/ui/dialog/public.d.ts +0 -3
  92. package/dist/ui/dialog/public.d.ts.map +0 -1
  93. package/dist/ui/dialog/public.js +0 -1
  94. package/dist/ui/disclosure/index.d.ts +0 -110
  95. package/dist/ui/disclosure/index.d.ts.map +0 -1
  96. package/dist/ui/disclosure/index.js +0 -110
  97. package/dist/ui/disclosure/public.d.ts +0 -3
  98. package/dist/ui/disclosure/public.d.ts.map +0 -1
  99. package/dist/ui/disclosure/public.js +0 -1
  100. package/dist/ui/dragAndDrop/index.d.ts +0 -540
  101. package/dist/ui/dragAndDrop/index.d.ts.map +0 -1
  102. package/dist/ui/dragAndDrop/index.js +0 -535
  103. package/dist/ui/dragAndDrop/public.d.ts +0 -3
  104. package/dist/ui/dragAndDrop/public.d.ts.map +0 -1
  105. package/dist/ui/dragAndDrop/public.js +0 -1
  106. package/dist/ui/fieldset/index.d.ts +0 -21
  107. package/dist/ui/fieldset/index.d.ts.map +0 -1
  108. package/dist/ui/fieldset/index.js +0 -25
  109. package/dist/ui/fieldset/public.d.ts +0 -3
  110. package/dist/ui/fieldset/public.d.ts.map +0 -1
  111. package/dist/ui/fieldset/public.js +0 -1
  112. package/dist/ui/fileDrop/index.d.ts +0 -109
  113. package/dist/ui/fileDrop/index.d.ts.map +0 -1
  114. package/dist/ui/fileDrop/index.js +0 -126
  115. package/dist/ui/fileDrop/public.d.ts +0 -3
  116. package/dist/ui/fileDrop/public.d.ts.map +0 -1
  117. package/dist/ui/fileDrop/public.js +0 -1
  118. package/dist/ui/group.d.ts +0 -8
  119. package/dist/ui/group.d.ts.map +0 -1
  120. package/dist/ui/group.js +0 -13
  121. package/dist/ui/index.d.ts +0 -25
  122. package/dist/ui/index.d.ts.map +0 -1
  123. package/dist/ui/index.js +0 -24
  124. package/dist/ui/input/index.d.ts +0 -26
  125. package/dist/ui/input/index.d.ts.map +0 -1
  126. package/dist/ui/input/index.js +0 -43
  127. package/dist/ui/input/public.d.ts +0 -3
  128. package/dist/ui/input/public.d.ts.map +0 -1
  129. package/dist/ui/input/public.js +0 -1
  130. package/dist/ui/keyboard.d.ts +0 -6
  131. package/dist/ui/keyboard.d.ts.map +0 -1
  132. package/dist/ui/keyboard.js +0 -9
  133. package/dist/ui/listbox/multi.d.ts +0 -190
  134. package/dist/ui/listbox/multi.d.ts.map +0 -1
  135. package/dist/ui/listbox/multi.js +0 -65
  136. package/dist/ui/listbox/multiPublic.d.ts +0 -3
  137. package/dist/ui/listbox/multiPublic.d.ts.map +0 -1
  138. package/dist/ui/listbox/multiPublic.js +0 -1
  139. package/dist/ui/listbox/public.d.ts +0 -7
  140. package/dist/ui/listbox/public.d.ts.map +0 -1
  141. package/dist/ui/listbox/public.js +0 -3
  142. package/dist/ui/listbox/shared.d.ts +0 -431
  143. package/dist/ui/listbox/shared.d.ts.map +0 -1
  144. package/dist/ui/listbox/shared.js +0 -669
  145. package/dist/ui/listbox/single.d.ts +0 -208
  146. package/dist/ui/listbox/single.d.ts.map +0 -1
  147. package/dist/ui/listbox/single.js +0 -73
  148. package/dist/ui/menu/index.d.ts +0 -367
  149. package/dist/ui/menu/index.d.ts.map +0 -1
  150. package/dist/ui/menu/index.js +0 -681
  151. package/dist/ui/menu/public.d.ts +0 -4
  152. package/dist/ui/menu/public.d.ts.map +0 -1
  153. package/dist/ui/menu/public.js +0 -1
  154. package/dist/ui/popover/index.d.ts +0 -267
  155. package/dist/ui/popover/index.d.ts.map +0 -1
  156. package/dist/ui/popover/index.js +0 -345
  157. package/dist/ui/popover/public.d.ts +0 -4
  158. package/dist/ui/popover/public.d.ts.map +0 -1
  159. package/dist/ui/popover/public.js +0 -1
  160. package/dist/ui/radioGroup/index.d.ts +0 -169
  161. package/dist/ui/radioGroup/index.d.ts.map +0 -1
  162. package/dist/ui/radioGroup/index.js +0 -196
  163. package/dist/ui/radioGroup/public.d.ts +0 -3
  164. package/dist/ui/radioGroup/public.d.ts.map +0 -1
  165. package/dist/ui/radioGroup/public.js +0 -1
  166. package/dist/ui/select/index.d.ts +0 -24
  167. package/dist/ui/select/index.d.ts.map +0 -1
  168. package/dist/ui/select/index.js +0 -40
  169. package/dist/ui/select/public.d.ts +0 -3
  170. package/dist/ui/select/public.d.ts.map +0 -1
  171. package/dist/ui/select/public.js +0 -1
  172. package/dist/ui/slider/index.d.ts +0 -318
  173. package/dist/ui/slider/index.d.ts.map +0 -1
  174. package/dist/ui/slider/index.js +0 -336
  175. package/dist/ui/slider/public.d.ts +0 -3
  176. package/dist/ui/slider/public.d.ts.map +0 -1
  177. package/dist/ui/slider/public.js +0 -1
  178. package/dist/ui/switch/index.d.ts +0 -99
  179. package/dist/ui/switch/index.d.ts.map +0 -1
  180. package/dist/ui/switch/index.js +0 -106
  181. package/dist/ui/switch/public.d.ts +0 -3
  182. package/dist/ui/switch/public.d.ts.map +0 -1
  183. package/dist/ui/switch/public.js +0 -1
  184. package/dist/ui/tabs/index.d.ts +0 -155
  185. package/dist/ui/tabs/index.d.ts.map +0 -1
  186. package/dist/ui/tabs/index.js +0 -184
  187. package/dist/ui/tabs/public.d.ts +0 -3
  188. package/dist/ui/tabs/public.d.ts.map +0 -1
  189. package/dist/ui/tabs/public.js +0 -1
  190. package/dist/ui/textarea/index.d.ts +0 -26
  191. package/dist/ui/textarea/index.d.ts.map +0 -1
  192. package/dist/ui/textarea/index.js +0 -44
  193. package/dist/ui/textarea/public.d.ts +0 -3
  194. package/dist/ui/textarea/public.d.ts.map +0 -1
  195. package/dist/ui/textarea/public.js +0 -1
  196. package/dist/ui/toast/index.d.ts +0 -608
  197. package/dist/ui/toast/index.d.ts.map +0 -1
  198. package/dist/ui/toast/index.js +0 -145
  199. package/dist/ui/toast/public.d.ts +0 -4
  200. package/dist/ui/toast/public.d.ts.map +0 -1
  201. package/dist/ui/toast/public.js +0 -1
  202. package/dist/ui/toast/schema.d.ts +0 -154
  203. package/dist/ui/toast/schema.d.ts.map +0 -1
  204. package/dist/ui/toast/schema.js +0 -93
  205. package/dist/ui/toast/update.d.ts +0 -510
  206. package/dist/ui/toast/update.d.ts.map +0 -1
  207. package/dist/ui/toast/update.js +0 -225
  208. package/dist/ui/tooltip/index.d.ts +0 -170
  209. package/dist/ui/tooltip/index.d.ts.map +0 -1
  210. package/dist/ui/tooltip/index.js +0 -252
  211. package/dist/ui/tooltip/public.d.ts +0 -4
  212. package/dist/ui/tooltip/public.d.ts.map +0 -1
  213. package/dist/ui/tooltip/public.js +0 -1
  214. package/dist/ui/typeahead.d.ts +0 -4
  215. package/dist/ui/typeahead.d.ts.map +0 -1
  216. package/dist/ui/typeahead.js +0 -14
  217. package/dist/ui/virtualList/index.d.ts +0 -202
  218. package/dist/ui/virtualList/index.d.ts.map +0 -1
  219. package/dist/ui/virtualList/index.js +0 -391
  220. package/dist/ui/virtualList/public.d.ts +0 -3
  221. package/dist/ui/virtualList/public.d.ts.map +0 -1
  222. package/dist/ui/virtualList/public.js +0 -1
@@ -1,44 +0,0 @@
1
- import { Predicate } from 'effect';
2
- import { html } from '../../html/index.js';
3
- /** Generates the description element ID from the textarea's base ID. */
4
- export const descriptionId = (id) => `${id}-description`;
5
- /** Renders an accessible textarea by building ARIA attribute groups and delegating layout to the consumer's `toView` callback. */
6
- export const view = (config) => {
7
- const h = html();
8
- const { toView, id, onInput, value, isDisabled = false, isInvalid = false, isAutofocus = false, name, rows, placeholder, } = config;
9
- const disabledAttributes = isDisabled
10
- ? [h.AriaDisabled(true), h.Disabled(true), h.DataAttribute('disabled', '')]
11
- : [];
12
- const invalidAttributes = isInvalid
13
- ? [h.AriaInvalid(true), h.DataAttribute('invalid', '')]
14
- : [];
15
- const inputAttributes = Predicate.isNotUndefined(onInput) && !isDisabled ? [h.OnInput(onInput)] : [];
16
- const valueAttributes = Predicate.isNotUndefined(value)
17
- ? [h.Value(value)]
18
- : [];
19
- const autofocusAttributes = isAutofocus ? [h.Autofocus(true)] : [];
20
- const nameAttributes = Predicate.isNotUndefined(name) ? [h.Name(name)] : [];
21
- const rowsAttributes = Predicate.isNotUndefined(rows) ? [h.Rows(rows)] : [];
22
- const placeholderAttributes = Predicate.isNotUndefined(placeholder)
23
- ? [h.Placeholder(placeholder)]
24
- : [];
25
- const allTextareaAttributes = [
26
- h.Id(id),
27
- h.AriaDescribedBy(descriptionId(id)),
28
- ...disabledAttributes,
29
- ...invalidAttributes,
30
- ...inputAttributes,
31
- ...valueAttributes,
32
- ...autofocusAttributes,
33
- ...nameAttributes,
34
- ...rowsAttributes,
35
- ...placeholderAttributes,
36
- ];
37
- const labelAttributes = [h.For(id)];
38
- const descriptionAttributes = [h.Id(descriptionId(id))];
39
- return toView({
40
- textarea: allTextareaAttributes,
41
- label: labelAttributes,
42
- description: descriptionAttributes,
43
- });
44
- };
@@ -1,3 +0,0 @@
1
- export { view, descriptionId } from './index.js';
2
- export type { ViewConfig, TextareaAttributes } from './index.js';
3
- //# sourceMappingURL=public.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/textarea/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAEhD,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA"}
@@ -1 +0,0 @@
1
- export { view, descriptionId } from './index.js';
@@ -1,608 +0,0 @@
1
- import { Schema as S } from 'effect';
2
- import { type ChildAttribute, type Html } from '../../html/index.js';
3
- import { Dismissed, DismissedAll, ElapsedDuration, GotAnimationMessage, HoveredEntry, LeftEntry, Position, Variant } from './schema.js';
4
- import { DismissAfter } from './update.js';
5
- export type { InitConfig } from './schema.js';
6
- export type { ShowInput } from './update.js';
7
- export { Variant, Position, Dismissed, DismissedAll, ElapsedDuration, HoveredEntry, LeftEntry, GotAnimationMessage, DismissAfter, };
8
- /** Handlers passed to `entryToView`. Spread `dismiss` onto a close
9
- * button's attribute array (typically inside `h.button([...dismiss])`)
10
- * to let users dismiss the entry manually. The attribute carries the
11
- * Toast's dismiss handler bound to this entry's id; it routes through
12
- * the Toast boundary's wrap chain at click time. */
13
- export type EntryHandlers = Readonly<{
14
- dismiss: ReadonlyArray<ChildAttribute>;
15
- }>;
16
- /** Factory that binds `Ui.Toast` to a user-provided payload schema. The
17
- * returned module contains everything needed to wire a toast stack into an
18
- * app: `Model`, `Message`, `Entry`, `Added`, `init`, `update`, `show` /
19
- * `dismiss` / `dismissAll` helpers, and the headless `view`.
20
- *
21
- * The payload is whatever content shape the consumer supplies via Schema.
22
- * The component never reads it. It flows through to `entryToView`. The
23
- * component itself owns only lifecycle and a11y fields (id, variant,
24
- * animation, dismiss timer, hover state).
25
- *
26
- * Consume the bound module's exports everywhere. `Toast.Model` in your app
27
- * Model, `Toast.Message` in your parent Message union, `Toast.show` /
28
- * `Toast.dismiss` in your update, `Toast.view` in your view. The top-level
29
- * exports (`Variant`, `Position`, static message tags, `DismissAfter`) are
30
- * payload-independent and safe to reference when you need them without a
31
- * bound module, but the typical path is through the factory return.
32
- *
33
- * @example
34
- * ```ts
35
- * const ToastPayload = S.Struct({
36
- * bodyText: S.String,
37
- * maybeLink: S.Option(S.Struct({
38
- * href: S.String,
39
- * text: S.String,
40
- * })),
41
- * })
42
- * export const Toast = Ui.Toast.make(ToastPayload)
43
- * ```
44
- */
45
- export declare const make: <A, I>(payloadSchema: S.Codec<A, I>) => {
46
- readonly view: import("../../html/submodel.js").SubmodelView<{
47
- readonly id: string;
48
- readonly defaultDuration: import("effect/Duration").Duration;
49
- readonly entries: readonly {
50
- readonly id: string;
51
- readonly variant: "Error" | "Success" | "Info" | "Warning";
52
- readonly animation: {
53
- readonly id: string;
54
- readonly isShowing: boolean;
55
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
56
- };
57
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
58
- readonly pendingDismissVersion: number;
59
- readonly isHovered: boolean;
60
- readonly payload: A;
61
- }[];
62
- readonly nextEntryKey: number;
63
- }, {
64
- readonly _tag: "Dismissed";
65
- readonly entryId: string;
66
- } | {
67
- readonly _tag: "DismissedAll";
68
- } | {
69
- readonly _tag: "ElapsedDuration";
70
- readonly entryId: string;
71
- readonly version: number;
72
- } | {
73
- readonly _tag: "HoveredEntry";
74
- readonly entryId: string;
75
- } | {
76
- readonly _tag: "LeftEntry";
77
- readonly entryId: string;
78
- } | {
79
- readonly _tag: "GotAnimationMessage";
80
- readonly entryId: string;
81
- readonly message: {
82
- readonly _tag: "Showed";
83
- } | {
84
- readonly _tag: "Hid";
85
- } | {
86
- readonly _tag: "AdvancedAnimationFrame";
87
- } | {
88
- readonly _tag: "EndedAnimation";
89
- };
90
- } | {
91
- readonly _tag: "Added";
92
- readonly entry: {
93
- readonly id: string;
94
- readonly variant: "Error" | "Success" | "Info" | "Warning";
95
- readonly animation: {
96
- readonly id: string;
97
- readonly isShowing: boolean;
98
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
99
- };
100
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
101
- readonly pendingDismissVersion: number;
102
- readonly isHovered: boolean;
103
- readonly payload: A;
104
- };
105
- }, Readonly<{
106
- position: Position;
107
- entryToView: (entry: {
108
- readonly id: string;
109
- readonly variant: "Error" | "Success" | "Info" | "Warning";
110
- readonly animation: {
111
- readonly id: string;
112
- readonly isShowing: boolean;
113
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
114
- };
115
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
116
- readonly pendingDismissVersion: number;
117
- readonly isHovered: boolean;
118
- readonly payload: A;
119
- }, handlers: EntryHandlers) => Html;
120
- ariaLabel?: string;
121
- containerClassName?: string;
122
- entryClassName?: string;
123
- }>>;
124
- readonly Entry: S.Struct<{
125
- readonly id: S.String;
126
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
127
- readonly animation: S.Struct<{
128
- readonly id: S.String;
129
- readonly isShowing: S.Boolean;
130
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
131
- }>;
132
- readonly maybeDuration: S.Option<S.DurationFromMillis>;
133
- readonly pendingDismissVersion: S.Number;
134
- readonly isHovered: S.Boolean;
135
- readonly payload: S.Codec<A, I, never, never>;
136
- }>;
137
- readonly Model: S.Struct<{
138
- readonly id: S.String;
139
- readonly defaultDuration: S.DurationFromMillis;
140
- readonly entries: S.$Array<S.Struct<{
141
- readonly id: S.String;
142
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
143
- readonly animation: S.Struct<{
144
- readonly id: S.String;
145
- readonly isShowing: S.Boolean;
146
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
147
- }>;
148
- readonly maybeDuration: S.Option<S.DurationFromMillis>;
149
- readonly pendingDismissVersion: S.Number;
150
- readonly isHovered: S.Boolean;
151
- readonly payload: S.Codec<A, I, never, never>;
152
- }>>;
153
- readonly nextEntryKey: S.Number;
154
- }>;
155
- readonly Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"Added", {
156
- entry: S.Struct<{
157
- readonly id: S.String;
158
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
159
- readonly animation: S.Struct<{
160
- readonly id: S.String;
161
- readonly isShowing: S.Boolean;
162
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
163
- }>;
164
- readonly maybeDuration: S.Option<S.DurationFromMillis>;
165
- readonly pendingDismissVersion: S.Number;
166
- readonly isHovered: S.Boolean;
167
- readonly payload: S.Codec<A, I, never, never>;
168
- }>;
169
- }>, import("../../schema/index.js").CallableTaggedStruct<"Dismissed", {
170
- entryId: S.String;
171
- }>, import("../../schema/index.js").CallableTaggedStruct<"DismissedAll", {}>, import("../../schema/index.js").CallableTaggedStruct<"ElapsedDuration", {
172
- entryId: S.String;
173
- version: S.Number;
174
- }>, import("../../schema/index.js").CallableTaggedStruct<"HoveredEntry", {
175
- entryId: S.String;
176
- }>, import("../../schema/index.js").CallableTaggedStruct<"LeftEntry", {
177
- entryId: S.String;
178
- }>, import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
179
- entryId: S.String;
180
- message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Showed", {}>, import("../../schema/index.js").CallableTaggedStruct<"Hid", {}>, import("../../schema/index.js").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema/index.js").CallableTaggedStruct<"EndedAnimation", {}>]>;
181
- }>]>;
182
- readonly OutMessage: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"DismissedToast", {
183
- payload: S.Codec<A, I, never, never>;
184
- }>]>;
185
- readonly Added: import("../../schema/index.js").CallableTaggedStruct<"Added", {
186
- entry: S.Struct<{
187
- readonly id: S.String;
188
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
189
- readonly animation: S.Struct<{
190
- readonly id: S.String;
191
- readonly isShowing: S.Boolean;
192
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
193
- }>;
194
- readonly maybeDuration: S.Option<S.DurationFromMillis>;
195
- readonly pendingDismissVersion: S.Number;
196
- readonly isHovered: S.Boolean;
197
- readonly payload: S.Codec<A, I, never, never>;
198
- }>;
199
- }>;
200
- readonly DismissedToast: import("../../schema/index.js").CallableTaggedStruct<"DismissedToast", {
201
- payload: S.Codec<A, I, never, never>;
202
- }>;
203
- readonly init: (config: Readonly<{
204
- id: string;
205
- defaultDuration?: import("effect/Duration").Input;
206
- }>) => {
207
- readonly id: string;
208
- readonly defaultDuration: import("effect/Duration").Duration;
209
- readonly entries: readonly {
210
- readonly id: string;
211
- readonly variant: "Error" | "Success" | "Info" | "Warning";
212
- readonly animation: {
213
- readonly id: string;
214
- readonly isShowing: boolean;
215
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
216
- };
217
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
218
- readonly pendingDismissVersion: number;
219
- readonly isHovered: boolean;
220
- readonly payload: A;
221
- }[];
222
- readonly nextEntryKey: number;
223
- };
224
- readonly update: (model: {
225
- readonly id: string;
226
- readonly defaultDuration: import("effect/Duration").Duration;
227
- readonly entries: readonly {
228
- readonly id: string;
229
- readonly variant: "Error" | "Success" | "Info" | "Warning";
230
- readonly animation: {
231
- readonly id: string;
232
- readonly isShowing: boolean;
233
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
234
- };
235
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
236
- readonly pendingDismissVersion: number;
237
- readonly isHovered: boolean;
238
- readonly payload: A;
239
- }[];
240
- readonly nextEntryKey: number;
241
- }, message: {
242
- readonly _tag: "Dismissed";
243
- readonly entryId: string;
244
- } | {
245
- readonly _tag: "DismissedAll";
246
- } | {
247
- readonly _tag: "ElapsedDuration";
248
- readonly entryId: string;
249
- readonly version: number;
250
- } | {
251
- readonly _tag: "HoveredEntry";
252
- readonly entryId: string;
253
- } | {
254
- readonly _tag: "LeftEntry";
255
- readonly entryId: string;
256
- } | {
257
- readonly _tag: "GotAnimationMessage";
258
- readonly entryId: string;
259
- readonly message: {
260
- readonly _tag: "Showed";
261
- } | {
262
- readonly _tag: "Hid";
263
- } | {
264
- readonly _tag: "AdvancedAnimationFrame";
265
- } | {
266
- readonly _tag: "EndedAnimation";
267
- };
268
- } | {
269
- readonly _tag: "Added";
270
- readonly entry: {
271
- readonly id: string;
272
- readonly variant: "Error" | "Success" | "Info" | "Warning";
273
- readonly animation: {
274
- readonly id: string;
275
- readonly isShowing: boolean;
276
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
277
- };
278
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
279
- readonly pendingDismissVersion: number;
280
- readonly isHovered: boolean;
281
- readonly payload: A;
282
- };
283
- }) => readonly [{
284
- readonly id: string;
285
- readonly defaultDuration: import("effect/Duration").Duration;
286
- readonly entries: readonly {
287
- readonly id: string;
288
- readonly variant: "Error" | "Success" | "Info" | "Warning";
289
- readonly animation: {
290
- readonly id: string;
291
- readonly isShowing: boolean;
292
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
293
- };
294
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
295
- readonly pendingDismissVersion: number;
296
- readonly isHovered: boolean;
297
- readonly payload: A;
298
- }[];
299
- readonly nextEntryKey: number;
300
- }, readonly Readonly<{
301
- name: string;
302
- args?: Record<string, unknown>;
303
- effect: import("effect/Effect").Effect<{
304
- readonly _tag: "Dismissed";
305
- readonly entryId: string;
306
- } | {
307
- readonly _tag: "DismissedAll";
308
- } | {
309
- readonly _tag: "ElapsedDuration";
310
- readonly entryId: string;
311
- readonly version: number;
312
- } | {
313
- readonly _tag: "HoveredEntry";
314
- readonly entryId: string;
315
- } | {
316
- readonly _tag: "LeftEntry";
317
- readonly entryId: string;
318
- } | {
319
- readonly _tag: "GotAnimationMessage";
320
- readonly entryId: string;
321
- readonly message: {
322
- readonly _tag: "Showed";
323
- } | {
324
- readonly _tag: "Hid";
325
- } | {
326
- readonly _tag: "AdvancedAnimationFrame";
327
- } | {
328
- readonly _tag: "EndedAnimation";
329
- };
330
- } | {
331
- readonly _tag: "Added";
332
- readonly entry: {
333
- readonly id: string;
334
- readonly variant: "Error" | "Success" | "Info" | "Warning";
335
- readonly animation: {
336
- readonly id: string;
337
- readonly isShowing: boolean;
338
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
339
- };
340
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
341
- readonly pendingDismissVersion: number;
342
- readonly isHovered: boolean;
343
- readonly payload: A;
344
- };
345
- }, never, never>;
346
- }>[], import("effect/Option").Option<{
347
- readonly _tag: "DismissedToast";
348
- readonly payload: A;
349
- }>];
350
- readonly show: (model: {
351
- readonly id: string;
352
- readonly defaultDuration: import("effect/Duration").Duration;
353
- readonly entries: readonly {
354
- readonly id: string;
355
- readonly variant: "Error" | "Success" | "Info" | "Warning";
356
- readonly animation: {
357
- readonly id: string;
358
- readonly isShowing: boolean;
359
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
360
- };
361
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
362
- readonly pendingDismissVersion: number;
363
- readonly isHovered: boolean;
364
- readonly payload: A;
365
- }[];
366
- readonly nextEntryKey: number;
367
- }, input: Readonly<{
368
- payload: A;
369
- variant?: Variant;
370
- duration?: import("effect/Duration").Input;
371
- sticky?: boolean;
372
- }>) => readonly [{
373
- readonly id: string;
374
- readonly defaultDuration: import("effect/Duration").Duration;
375
- readonly entries: readonly {
376
- readonly id: string;
377
- readonly variant: "Error" | "Success" | "Info" | "Warning";
378
- readonly animation: {
379
- readonly id: string;
380
- readonly isShowing: boolean;
381
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
382
- };
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 nextEntryKey: number;
389
- }, readonly Readonly<{
390
- name: string;
391
- args?: Record<string, unknown>;
392
- effect: import("effect/Effect").Effect<{
393
- readonly _tag: "Dismissed";
394
- readonly entryId: string;
395
- } | {
396
- readonly _tag: "DismissedAll";
397
- } | {
398
- readonly _tag: "ElapsedDuration";
399
- readonly entryId: string;
400
- readonly version: number;
401
- } | {
402
- readonly _tag: "HoveredEntry";
403
- readonly entryId: string;
404
- } | {
405
- readonly _tag: "LeftEntry";
406
- readonly entryId: string;
407
- } | {
408
- readonly _tag: "GotAnimationMessage";
409
- readonly entryId: string;
410
- readonly message: {
411
- readonly _tag: "Showed";
412
- } | {
413
- readonly _tag: "Hid";
414
- } | {
415
- readonly _tag: "AdvancedAnimationFrame";
416
- } | {
417
- readonly _tag: "EndedAnimation";
418
- };
419
- } | {
420
- readonly _tag: "Added";
421
- readonly entry: {
422
- readonly id: string;
423
- readonly variant: "Error" | "Success" | "Info" | "Warning";
424
- readonly animation: {
425
- readonly id: string;
426
- readonly isShowing: boolean;
427
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
428
- };
429
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
430
- readonly pendingDismissVersion: number;
431
- readonly isHovered: boolean;
432
- readonly payload: A;
433
- };
434
- }, never, never>;
435
- }>[], import("effect/Option").Option<{
436
- readonly _tag: "DismissedToast";
437
- readonly payload: A;
438
- }>];
439
- readonly dismiss: (model: {
440
- readonly id: string;
441
- readonly defaultDuration: import("effect/Duration").Duration;
442
- readonly entries: readonly {
443
- readonly id: string;
444
- readonly variant: "Error" | "Success" | "Info" | "Warning";
445
- readonly animation: {
446
- readonly id: string;
447
- readonly isShowing: boolean;
448
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
449
- };
450
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
451
- readonly pendingDismissVersion: number;
452
- readonly isHovered: boolean;
453
- readonly payload: A;
454
- }[];
455
- readonly nextEntryKey: number;
456
- }, entryId: string) => readonly [{
457
- readonly id: string;
458
- readonly defaultDuration: import("effect/Duration").Duration;
459
- readonly entries: readonly {
460
- readonly id: string;
461
- readonly variant: "Error" | "Success" | "Info" | "Warning";
462
- readonly animation: {
463
- readonly id: string;
464
- readonly isShowing: boolean;
465
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
466
- };
467
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
468
- readonly pendingDismissVersion: number;
469
- readonly isHovered: boolean;
470
- readonly payload: A;
471
- }[];
472
- readonly nextEntryKey: number;
473
- }, readonly Readonly<{
474
- name: string;
475
- args?: Record<string, unknown>;
476
- effect: import("effect/Effect").Effect<{
477
- readonly _tag: "Dismissed";
478
- readonly entryId: string;
479
- } | {
480
- readonly _tag: "DismissedAll";
481
- } | {
482
- readonly _tag: "ElapsedDuration";
483
- readonly entryId: string;
484
- readonly version: number;
485
- } | {
486
- readonly _tag: "HoveredEntry";
487
- readonly entryId: string;
488
- } | {
489
- readonly _tag: "LeftEntry";
490
- readonly entryId: string;
491
- } | {
492
- readonly _tag: "GotAnimationMessage";
493
- readonly entryId: string;
494
- readonly message: {
495
- readonly _tag: "Showed";
496
- } | {
497
- readonly _tag: "Hid";
498
- } | {
499
- readonly _tag: "AdvancedAnimationFrame";
500
- } | {
501
- readonly _tag: "EndedAnimation";
502
- };
503
- } | {
504
- readonly _tag: "Added";
505
- readonly entry: {
506
- readonly id: string;
507
- readonly variant: "Error" | "Success" | "Info" | "Warning";
508
- readonly animation: {
509
- readonly id: string;
510
- readonly isShowing: boolean;
511
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
512
- };
513
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
514
- readonly pendingDismissVersion: number;
515
- readonly isHovered: boolean;
516
- readonly payload: A;
517
- };
518
- }, never, never>;
519
- }>[], import("effect/Option").Option<{
520
- readonly _tag: "DismissedToast";
521
- readonly payload: A;
522
- }>];
523
- readonly dismissAll: (model: {
524
- readonly id: string;
525
- readonly defaultDuration: import("effect/Duration").Duration;
526
- readonly entries: readonly {
527
- readonly id: string;
528
- readonly variant: "Error" | "Success" | "Info" | "Warning";
529
- readonly animation: {
530
- readonly id: string;
531
- readonly isShowing: boolean;
532
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
533
- };
534
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
535
- readonly pendingDismissVersion: number;
536
- readonly isHovered: boolean;
537
- readonly payload: A;
538
- }[];
539
- readonly nextEntryKey: number;
540
- }) => readonly [{
541
- readonly id: string;
542
- readonly defaultDuration: import("effect/Duration").Duration;
543
- readonly entries: readonly {
544
- readonly id: string;
545
- readonly variant: "Error" | "Success" | "Info" | "Warning";
546
- readonly animation: {
547
- readonly id: string;
548
- readonly isShowing: boolean;
549
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
550
- };
551
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
552
- readonly pendingDismissVersion: number;
553
- readonly isHovered: boolean;
554
- readonly payload: A;
555
- }[];
556
- readonly nextEntryKey: number;
557
- }, readonly Readonly<{
558
- name: string;
559
- args?: Record<string, unknown>;
560
- effect: import("effect/Effect").Effect<{
561
- readonly _tag: "Dismissed";
562
- readonly entryId: string;
563
- } | {
564
- readonly _tag: "DismissedAll";
565
- } | {
566
- readonly _tag: "ElapsedDuration";
567
- readonly entryId: string;
568
- readonly version: number;
569
- } | {
570
- readonly _tag: "HoveredEntry";
571
- readonly entryId: string;
572
- } | {
573
- readonly _tag: "LeftEntry";
574
- readonly entryId: string;
575
- } | {
576
- readonly _tag: "GotAnimationMessage";
577
- readonly entryId: string;
578
- readonly message: {
579
- readonly _tag: "Showed";
580
- } | {
581
- readonly _tag: "Hid";
582
- } | {
583
- readonly _tag: "AdvancedAnimationFrame";
584
- } | {
585
- readonly _tag: "EndedAnimation";
586
- };
587
- } | {
588
- readonly _tag: "Added";
589
- readonly entry: {
590
- readonly id: string;
591
- readonly variant: "Error" | "Success" | "Info" | "Warning";
592
- readonly animation: {
593
- readonly id: string;
594
- readonly isShowing: boolean;
595
- readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
596
- };
597
- readonly maybeDuration: import("effect/Option").Option<import("effect/Duration").Duration>;
598
- readonly pendingDismissVersion: number;
599
- readonly isHovered: boolean;
600
- readonly payload: A;
601
- };
602
- }, never, never>;
603
- }>[], import("effect/Option").Option<{
604
- readonly _tag: "DismissedToast";
605
- readonly payload: A;
606
- }>];
607
- };
608
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,CAAA;AAEhD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EAIV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,YAAY,EAAe,MAAM,aAAa,CAAA;AAEvD,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,YAAY,GACb,CAAA;AA0ED;;;;qDAIqD;AACrD,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;CACvC,CAAC,CAAA;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUzC,QAAQ;qBACL,CAAC,KAAK;;;;;;;;;;;;SAAO,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI;oBAChD,MAAM;6BACG,MAAM;yBACV,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F1B,CAAA"}