@foldkit/ui 0.155.0 → 0.156.0-canary.13f4f703eb6a

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 (104) hide show
  1. package/dist/anchor/anchor.d.ts +18 -18
  2. package/dist/anchor/anchor.d.ts.map +1 -1
  3. package/dist/anchor/anchor.js +16 -16
  4. package/dist/animation/index.d.ts +4 -4
  5. package/dist/animation/index.d.ts.map +1 -1
  6. package/dist/animation/index.js +8 -8
  7. package/dist/animation/public.d.ts +1 -1
  8. package/dist/animation/public.d.ts.map +1 -1
  9. package/dist/animation/public.js +1 -1
  10. package/dist/animation/schema.d.ts +6 -6
  11. package/dist/animation/schema.d.ts.map +1 -1
  12. package/dist/animation/schema.js +5 -5
  13. package/dist/animation/update.d.ts +4 -2
  14. package/dist/animation/update.d.ts.map +1 -1
  15. package/dist/animation/update.js +18 -9
  16. package/dist/calendar/index.d.ts +56 -56
  17. package/dist/calendar/index.d.ts.map +1 -1
  18. package/dist/calendar/index.js +49 -37
  19. package/dist/checkbox/index.js +2 -2
  20. package/dist/combobox/multi.d.ts +19 -19
  21. package/dist/combobox/multi.d.ts.map +1 -1
  22. package/dist/combobox/multi.js +2 -2
  23. package/dist/combobox/shared.d.ts +61 -61
  24. package/dist/combobox/shared.d.ts.map +1 -1
  25. package/dist/combobox/shared.js +61 -61
  26. package/dist/combobox/single.d.ts +19 -19
  27. package/dist/combobox/single.d.ts.map +1 -1
  28. package/dist/combobox/single.js +2 -2
  29. package/dist/datePicker/index.d.ts +72 -72
  30. package/dist/datePicker/index.d.ts.map +1 -1
  31. package/dist/datePicker/index.js +12 -12
  32. package/dist/dialog/index.d.ts +14 -14
  33. package/dist/dialog/index.d.ts.map +1 -1
  34. package/dist/dialog/index.js +22 -22
  35. package/dist/disclosure/index.js +2 -2
  36. package/dist/dragAndDrop/index.d.ts +61 -61
  37. package/dist/dragAndDrop/index.d.ts.map +1 -1
  38. package/dist/dragAndDrop/index.js +85 -85
  39. package/dist/fileDrop/index.d.ts +6 -6
  40. package/dist/fileDrop/index.d.ts.map +1 -1
  41. package/dist/fileDrop/index.js +6 -6
  42. package/dist/hoverIntent/hoverIntent.d.ts +19 -16
  43. package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
  44. package/dist/hoverIntent/hoverIntent.js +49 -46
  45. package/dist/hoverIntent/message.d.ts +4 -4
  46. package/dist/hoverIntent/message.d.ts.map +1 -1
  47. package/dist/hoverIntent/message.js +4 -4
  48. package/dist/hoverIntent/public.d.ts +1 -1
  49. package/dist/hoverIntent/public.d.ts.map +1 -1
  50. package/dist/hoverIntent/public.js +1 -1
  51. package/dist/keyboard.js +2 -2
  52. package/dist/listbox/multi.d.ts +19 -19
  53. package/dist/listbox/multi.d.ts.map +1 -1
  54. package/dist/listbox/multi.js +2 -2
  55. package/dist/listbox/shared.d.ts +58 -58
  56. package/dist/listbox/shared.d.ts.map +1 -1
  57. package/dist/listbox/shared.js +61 -61
  58. package/dist/listbox/single.d.ts +19 -19
  59. package/dist/listbox/single.d.ts.map +1 -1
  60. package/dist/listbox/single.js +2 -2
  61. package/dist/menu/index.d.ts +67 -67
  62. package/dist/menu/index.d.ts.map +1 -1
  63. package/dist/menu/index.js +69 -66
  64. package/dist/popover/index.d.ts +34 -34
  65. package/dist/popover/index.d.ts.map +1 -1
  66. package/dist/popover/index.js +36 -36
  67. package/dist/radioGroup/index.d.ts +12 -12
  68. package/dist/radioGroup/index.d.ts.map +1 -1
  69. package/dist/radioGroup/index.js +16 -16
  70. package/dist/slider/index.d.ts +14 -14
  71. package/dist/slider/index.d.ts.map +1 -1
  72. package/dist/slider/index.js +31 -31
  73. package/dist/switch/index.js +2 -2
  74. package/dist/tabs/index.d.ts +14 -14
  75. package/dist/tabs/index.d.ts.map +1 -1
  76. package/dist/tabs/index.js +18 -18
  77. package/dist/test/apps/disabledButton.d.ts +12 -12
  78. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  79. package/dist/test/apps/disabledButton.js +5 -5
  80. package/dist/textarea/index.d.ts +2 -2
  81. package/dist/textarea/index.d.ts.map +1 -1
  82. package/dist/toast/index.d.ts +63 -63
  83. package/dist/toast/index.d.ts.map +1 -1
  84. package/dist/toast/index.js +19 -19
  85. package/dist/toast/schema.d.ts +55 -55
  86. package/dist/toast/schema.d.ts.map +1 -1
  87. package/dist/toast/schema.js +29 -29
  88. package/dist/toast/test.d.ts.map +1 -1
  89. package/dist/toast/test.js +3 -3
  90. package/dist/toast/update.d.ts +61 -61
  91. package/dist/toast/update.d.ts.map +1 -1
  92. package/dist/toast/update.js +11 -11
  93. package/dist/tooltip/message.d.ts +3 -3
  94. package/dist/tooltip/message.d.ts.map +1 -1
  95. package/dist/tooltip/message.js +3 -3
  96. package/dist/tooltip/tooltip.d.ts +24 -24
  97. package/dist/tooltip/tooltip.d.ts.map +1 -1
  98. package/dist/tooltip/tooltip.js +13 -13
  99. package/dist/typeahead.d.ts.map +1 -1
  100. package/dist/typeahead.js +3 -3
  101. package/dist/virtualList/index.d.ts +16 -16
  102. package/dist/virtualList/index.d.ts.map +1 -1
  103. package/dist/virtualList/index.js +13 -13
  104. package/package.json +4 -4
@@ -1,13 +1,13 @@
1
- import { Duration, Schema as S } from 'effect';
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: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
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: S.Literals<readonly ["TopLeft", "TopCenter", "TopRight", "BottomLeft", "BottomCenter", "BottomRight"]>;
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: S.Codec<A, I>) => S.Struct<{
19
- readonly id: S.String;
20
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
21
- readonly animation: S.Struct<{
22
- readonly id: S.String;
23
- readonly isShowing: S.Boolean;
24
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
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: S.Option<S.DurationFromMillis>;
27
- readonly pendingDismissVersion: S.Number;
28
- readonly isHovered: S.Boolean;
29
- readonly payload: S.Codec<A, I, never, never>;
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: S.Codec<A, I>) => S.Struct<{
37
- readonly id: S.String;
38
- readonly defaultDuration: S.DurationFromMillis;
39
- readonly entries: S.$Array<S.Struct<{
40
- readonly id: S.String;
41
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
42
- readonly animation: S.Struct<{
43
- readonly id: S.String;
44
- readonly isShowing: S.Boolean;
45
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
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: S.Option<S.DurationFromMillis>;
48
- readonly pendingDismissVersion: S.Number;
49
- readonly isHovered: S.Boolean;
50
- readonly payload: S.Codec<A, I, never, never>;
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: S.Number;
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: S.String;
57
+ entryId: Schema.String;
58
58
  };
59
59
  readonly DismissedAll: {};
60
60
  readonly CompletedWaitBeforeDismissal: {
61
- entryId: S.String;
62
- version: S.Number;
61
+ entryId: Schema.String;
62
+ version: Schema.Number;
63
63
  };
64
64
  readonly HoveredEntry: {
65
- entryId: S.String;
65
+ entryId: Schema.String;
66
66
  };
67
67
  readonly LeftEntry: {
68
- entryId: S.String;
68
+ entryId: Schema.String;
69
69
  };
70
70
  readonly GotAnimationMessage: {
71
- entryId: S.String;
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: S.Codec<A, I>) => import("foldkit/message").MessageUnion<{
87
+ export declare const makeMessage: <A, I>(payloadSchema: Schema.Codec<A, I>) => import("foldkit/message").MessageUnion<{
88
88
  readonly Added: {
89
- entry: S.Struct<{
90
- readonly id: S.String;
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"]>;
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: S.Option<S.DurationFromMillis>;
98
- readonly pendingDismissVersion: S.Number;
99
- readonly isHovered: S.Boolean;
100
- readonly payload: S.Codec<A, I, never, never>;
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: S.String;
104
+ entryId: Schema.String;
105
105
  };
106
106
  readonly DismissedAll: {};
107
107
  readonly CompletedWaitBeforeDismissal: {
108
- entryId: S.String;
109
- version: S.Number;
108
+ entryId: Schema.String;
109
+ version: Schema.Number;
110
110
  };
111
111
  readonly HoveredEntry: {
112
- entryId: S.String;
112
+ entryId: Schema.String;
113
113
  };
114
114
  readonly LeftEntry: {
115
- entryId: S.String;
115
+ entryId: Schema.String;
116
116
  };
117
117
  readonly GotAnimationMessage: {
118
- entryId: S.String;
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: S.Codec<A, I>) => import("foldkit/message").MessageUnion<{
128
+ export declare const makeOutMessage: <A, I>(payloadSchema: Schema.Codec<A, I>) => import("foldkit/message").MessageUnion<{
129
129
  readonly DismissedToast: {
130
- payload: S.Codec<A, I, never, never>;
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,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAU9C;;;;kDAIkD;AAClD,eAAO,MAAM,OAAO,8DAAsD,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Schema } from 'effect';
3
3
  import { defineMessageUnion } from 'foldkit/message';
4
- import { Message as AnimationMessage, Model as AnimationModel, } from '../animation/schema.js';
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 = S.Literals(['Info', 'Success', 'Warning', 'Error']);
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 = S.Literals([
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((S.Struct({
30
- id: S.String,
29
+ export const makeEntry = (payloadSchema) => __foldkitBrandViewResult((Schema.Struct({
30
+ id: Schema.String,
31
31
  variant: Variant,
32
- animation: AnimationModel,
33
- maybeDuration: S.Option(S.DurationFromMillis),
34
- pendingDismissVersion: S.Number,
35
- isHovered: S.Boolean,
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((S.Struct({
45
- id: S.String,
46
- defaultDuration: S.DurationFromMillis,
47
- entries: S.Array(makeEntry(payloadSchema)),
48
- nextEntryKey: S.Number,
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: S.String },
53
+ Dismissed: { entryId: Schema.String },
54
54
  DismissedAll: {},
55
55
  CompletedWaitBeforeDismissal: {
56
- entryId: S.String,
57
- version: S.Number,
56
+ entryId: Schema.String,
57
+ version: Schema.Number,
58
58
  },
59
- HoveredEntry: { entryId: S.String },
60
- LeftEntry: { entryId: S.String },
59
+ HoveredEntry: { entryId: Schema.String },
60
+ LeftEntry: { entryId: Schema.String },
61
61
  GotAnimationMessage: {
62
- entryId: S.String,
63
- message: AnimationMessage,
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: S.String },
69
+ Dismissed: { entryId: Schema.String },
70
70
  DismissedAll: {},
71
71
  CompletedWaitBeforeDismissal: {
72
- entryId: S.String,
73
- version: S.Number,
72
+ entryId: Schema.String,
73
+ version: Schema.Number,
74
74
  },
75
- HoveredEntry: { entryId: S.String },
76
- LeftEntry: { entryId: S.String },
75
+ HoveredEntry: { entryId: Schema.String },
76
+ LeftEntry: { entryId: Schema.String },
77
77
  GotAnimationMessage: {
78
- entryId: S.String,
79
- message: AnimationMessage,
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. */
@@ -1 +1 @@
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,0BAGpB,eAAe,iKAUf,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"}
@@ -1,6 +1,6 @@
1
1
  import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
2
  import * as Story from 'foldkit/story';
3
- import { Message as AnimationMessage, WaitForAnimationSettled, WaitForPaint, } from '../animation/index.js';
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, AnimationMessage.CompletedWaitForPaint()], [WaitForAnimationSettled, AnimationMessage.EndedAnimation()], [
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, AnimationMessage.CompletedWaitForPaint()], [WaitForAnimationSettled, AnimationMessage.EndedAnimation()])), "@foldkit/ui/toast/test.js#drainEntry");
41
+ ], [Animation.WaitForPaint, Animation.Message.CompletedWaitForPaint()], [Animation.WaitForAnimationSettled, Animation.Message.EndedAnimation()])), "@foldkit/ui/toast/test.js#drainEntry");
@@ -1,4 +1,4 @@
1
- import { Duration, Effect, Option, Schema as S } from 'effect';
1
+ import { Duration, Effect, Option, Schema } from 'effect';
2
2
  import * as Command from 'foldkit/command';
3
3
  import * as Update from 'foldkit/update';
4
4
  import { type InitConfig, type Variant } from './schema.js';
@@ -16,9 +16,9 @@ export type ShowInput<A> = Readonly<{
16
16
  * the update function. Static. The Command definition doesn't depend on
17
17
  * payload. */
18
18
  export declare const WaitBeforeDismissal: Command.CommandDefinitionWithArgs<"WaitBeforeDismissal", {
19
- entryId: S.String;
20
- version: S.Number;
21
- duration: S.DurationFromMillis;
19
+ entryId: Schema.String;
20
+ version: Schema.Number;
21
+ duration: Schema.DurationFromMillis;
22
22
  }, Effect.Effect<{
23
23
  readonly _tag: "CompletedWaitBeforeDismissal";
24
24
  readonly entryId: string;
@@ -31,70 +31,70 @@ export declare const WaitBeforeDismissal: Command.CommandDefinitionWithArgs<"Wai
31
31
  *
32
32
  * @internal Consumers should use `Toast.make(PayloadSchema)`. This is
33
33
  * only exported so `index.ts` can wire the view into the bound runtime. */
34
- export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
35
- readonly Entry: S.Struct<{
36
- readonly id: S.String;
37
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
38
- readonly animation: S.Struct<{
39
- readonly id: S.String;
40
- readonly isShowing: S.Boolean;
41
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
34
+ export declare const makeRuntime: <A, I>(payloadSchema: Schema.Codec<A, I>) => {
35
+ readonly Entry: Schema.Struct<{
36
+ readonly id: Schema.String;
37
+ readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
38
+ readonly animation: Schema.Struct<{
39
+ readonly id: Schema.String;
40
+ readonly isShowing: Schema.Boolean;
41
+ readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
42
42
  }>;
43
- readonly maybeDuration: S.Option<S.DurationFromMillis>;
44
- readonly pendingDismissVersion: S.Number;
45
- readonly isHovered: S.Boolean;
46
- readonly payload: S.Codec<A, I, never, never>;
43
+ readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
44
+ readonly pendingDismissVersion: Schema.Number;
45
+ readonly isHovered: Schema.Boolean;
46
+ readonly payload: Schema.Codec<A, I, never, never>;
47
47
  }>;
48
- readonly Model: S.Struct<{
49
- readonly id: S.String;
50
- readonly defaultDuration: S.DurationFromMillis;
51
- readonly entries: S.$Array<S.Struct<{
52
- readonly id: S.String;
53
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
54
- readonly animation: S.Struct<{
55
- readonly id: S.String;
56
- readonly isShowing: S.Boolean;
57
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
48
+ readonly Model: Schema.Struct<{
49
+ readonly id: Schema.String;
50
+ readonly defaultDuration: Schema.DurationFromMillis;
51
+ readonly entries: Schema.$Array<Schema.Struct<{
52
+ readonly id: Schema.String;
53
+ readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
54
+ readonly animation: Schema.Struct<{
55
+ readonly id: Schema.String;
56
+ readonly isShowing: Schema.Boolean;
57
+ readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
58
58
  }>;
59
- readonly maybeDuration: S.Option<S.DurationFromMillis>;
60
- readonly pendingDismissVersion: S.Number;
61
- readonly isHovered: S.Boolean;
62
- readonly payload: S.Codec<A, I, never, never>;
59
+ readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
60
+ readonly pendingDismissVersion: Schema.Number;
61
+ readonly isHovered: Schema.Boolean;
62
+ readonly payload: Schema.Codec<A, I, never, never>;
63
63
  }>>;
64
- readonly nextEntryKey: S.Number;
64
+ readonly nextEntryKey: Schema.Number;
65
65
  }>;
66
66
  readonly Message: import("foldkit/message").MessageUnion<{
67
67
  readonly Added: {
68
- readonly entry: S.Struct<{
69
- readonly id: S.String;
70
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
71
- readonly animation: S.Struct<{
72
- readonly id: S.String;
73
- readonly isShowing: S.Boolean;
74
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
68
+ readonly entry: Schema.Struct<{
69
+ readonly id: Schema.String;
70
+ readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
71
+ readonly animation: Schema.Struct<{
72
+ readonly id: Schema.String;
73
+ readonly isShowing: Schema.Boolean;
74
+ readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
75
75
  }>;
76
- readonly maybeDuration: S.Option<S.DurationFromMillis>;
77
- readonly pendingDismissVersion: S.Number;
78
- readonly isHovered: S.Boolean;
79
- readonly payload: S.Codec<A, I, never, never>;
76
+ readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
77
+ readonly pendingDismissVersion: Schema.Number;
78
+ readonly isHovered: Schema.Boolean;
79
+ readonly payload: Schema.Codec<A, I, never, never>;
80
80
  }>;
81
81
  };
82
82
  readonly Dismissed: {
83
- entryId: S.String;
83
+ entryId: Schema.String;
84
84
  };
85
85
  readonly DismissedAll: {};
86
86
  readonly CompletedWaitBeforeDismissal: {
87
- entryId: S.String;
88
- version: S.Number;
87
+ entryId: Schema.String;
88
+ version: Schema.Number;
89
89
  };
90
90
  readonly HoveredEntry: {
91
- entryId: S.String;
91
+ entryId: Schema.String;
92
92
  };
93
93
  readonly LeftEntry: {
94
- entryId: S.String;
94
+ entryId: Schema.String;
95
95
  };
96
96
  readonly GotAnimationMessage: {
97
- entryId: S.String;
97
+ entryId: Schema.String;
98
98
  message: import("foldkit/message").MessageUnion<{
99
99
  readonly Showed: {};
100
100
  readonly Hid: {};
@@ -105,26 +105,26 @@ export declare const makeRuntime: <A, I>(payloadSchema: S.Codec<A, I>) => {
105
105
  }>;
106
106
  readonly OutMessage: import("foldkit/message").MessageUnion<{
107
107
  readonly DismissedToast: {
108
- readonly payload: S.Codec<A, I, never, never>;
108
+ readonly payload: Schema.Codec<A, I, never, never>;
109
109
  };
110
110
  }>;
111
111
  readonly Added: import("foldkit/schema").CallableTaggedStruct<"Added", {
112
- readonly entry: S.Struct<{
113
- readonly id: S.String;
114
- readonly variant: S.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
115
- readonly animation: S.Struct<{
116
- readonly id: S.String;
117
- readonly isShowing: S.Boolean;
118
- readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
112
+ readonly entry: Schema.Struct<{
113
+ readonly id: Schema.String;
114
+ readonly variant: Schema.Literals<readonly ["Info", "Success", "Warning", "Error"]>;
115
+ readonly animation: Schema.Struct<{
116
+ readonly id: Schema.String;
117
+ readonly isShowing: Schema.Boolean;
118
+ readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
119
119
  }>;
120
- readonly maybeDuration: S.Option<S.DurationFromMillis>;
121
- readonly pendingDismissVersion: S.Number;
122
- readonly isHovered: S.Boolean;
123
- readonly payload: S.Codec<A, I, never, never>;
120
+ readonly maybeDuration: Schema.Option<Schema.DurationFromMillis>;
121
+ readonly pendingDismissVersion: Schema.Number;
122
+ readonly isHovered: Schema.Boolean;
123
+ readonly payload: Schema.Codec<A, I, never, never>;
124
124
  }>;
125
125
  }>;
126
126
  readonly DismissedToast: import("foldkit/schema").CallableTaggedStruct<"DismissedToast", {
127
- readonly payload: S.Codec<A, I, never, never>;
127
+ readonly payload: Schema.Codec<A, I, never, never>;
128
128
  }>;
129
129
  readonly init: (config: InitConfig) => {
130
130
  readonly id: string;
@@ -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;AAE1C,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAaxC,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,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC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B,CAAC,CAAA;AAEF;;;eAGe;AACf,eAAO,MAAM,mBAAmB;;;;;;;;iBAa9B,CAAA;AAIF;;;;;;4EAM4E;AAC5E,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA2K3C,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuHG,SAAS,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB/C,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
- import { Array, Duration, Effect, Match as M, Number, Option, Schema as S, pipe, } from 'effect';
2
+ import { Array, Duration, Effect, Number, Option, Schema, pipe } from 'effect';
3
3
  import * as Command from 'foldkit/command';
4
4
  import { evo } from 'foldkit/struct';
5
5
  import * as Update from 'foldkit/update';
6
- import { Message as AnimationMessage, OutMessage as AnimationOutMessage, init as animationInit, } from '../animation/schema.js';
6
+ import * as Animation from '../animation/schema.js';
7
7
  import { defaultLeaveCommand as animationDefaultLeaveCommand, update as animationUpdate, } from '../animation/update.js';
8
8
  import * as OptionExt from '../internal/optionExtensions.js';
9
9
  import { DEFAULT_DURATION, Message as StaticMessage, makeEntry, makeMessage, makeModel, makeOutMessage, } from './schema.js';
@@ -13,9 +13,9 @@ import { DEFAULT_DURATION, Message as StaticMessage, makeEntry, makeMessage, mak
13
13
  * payload. */
14
14
  export const WaitBeforeDismissal = Command.define('WaitBeforeDismissal', {
15
15
  args: {
16
- entryId: S.String,
17
- version: S.Number,
18
- duration: S.DurationFromMillis,
16
+ entryId: Schema.String,
17
+ version: Schema.Number,
18
+ duration: Schema.DurationFromMillis,
19
19
  },
20
20
  messages: [StaticMessage.CompletedWaitBeforeDismissal],
21
21
  execute: ({ entryId, version, duration }) => __foldkitBrandViewResult((Effect.sleep(duration).pipe(Effect.as(StaticMessage.CompletedWaitBeforeDismissal({ entryId, version })))), "@foldkit/ui/toast/update.js#execute"),
@@ -62,11 +62,11 @@ export const makeRuntime = (payloadSchema) => {
62
62
  const readEntryAnimation = (entryId) => __foldkitBrandViewResult(((model) => __foldkitBrandViewResult((pipe(Array.findFirst(model.entries, ({ id }) => __foldkitBrandViewResult((id === entryId), "@foldkit/ui/toast/update.js#anonymous~4")), Option.map(({ animation }) => __foldkitBrandViewResult((animation), "@foldkit/ui/toast/update.js#anonymous~5")))), "@foldkit/ui/toast/update.js#anonymous~3")), "@foldkit/ui/toast/update.js#readEntryAnimation");
63
63
  const writeEntryAnimation = (entryId) => __foldkitBrandViewResult(((model, nextAnimation) => __foldkitBrandViewResult((updateEntry(model, entryId, entry => __foldkitBrandViewResult((evo(entry, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/toast/update.js#animation") })), "@foldkit/ui/toast/update.js#anonymous~7"))), "@foldkit/ui/toast/update.js#anonymous~6")), "@foldkit/ui/toast/update.js#writeEntryAnimation");
64
64
  const toGotAnimationMessage = (entryId) => __foldkitBrandViewResult(((message) => __foldkitBrandViewResult((MessageSchema.GotAnimationMessage({ entryId, message })), "@foldkit/ui/toast/update.js#anonymous~8")), "@foldkit/ui/toast/update.js#toGotAnimationMessage");
65
- const toDismissedToastOutMessage = payload => __foldkitBrandViewResult((M.type().pipe(M.withReturnType(), M.tagsExhaustive({
65
+ const toDismissedToastOutMessage = payload => __foldkitBrandViewResult((Animation.OutMessage.match({
66
66
  StartedLeaveAnimating: () => __foldkitBrandViewResult((undefined), "@foldkit/ui/toast/update.js#StartedLeaveAnimating"),
67
67
  TransitionedOut: () => __foldkitBrandViewResult((OutMessageSchema.DismissedToast({ payload })), "@foldkit/ui/toast/update.js#TransitionedOut"),
68
- }))), "@foldkit/ui/toast/update.js#toDismissedToastOutMessage");
69
- const foldEntryAnimationOutMessage = entryId => __foldkitBrandViewResult(((outMessage, { liftCommand }) => __foldkitBrandViewResult((AnimationOutMessage.match(outMessage, {
68
+ })), "@foldkit/ui/toast/update.js#toDismissedToastOutMessage");
69
+ const foldEntryAnimationOutMessage = entryId => __foldkitBrandViewResult(((outMessage, { liftCommand }) => __foldkitBrandViewResult((Animation.OutMessage.match(outMessage, {
70
70
  StartedLeaveAnimating: () => __foldkitBrandViewResult((model => __foldkitBrandViewResult((Option.match(readEntryAnimation(entryId)(model), {
71
71
  onNone: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/toast/update.js#onNone~2")),
72
72
  onSome: animation => (__foldkitBrandViewResult(({
@@ -87,13 +87,13 @@ export const makeRuntime = (payloadSchema) => {
87
87
  foldOutMessage: foldEntryAnimationOutMessage(entry.id),
88
88
  })), "@foldkit/ui/toast/update.js#foldEntryAnimation");
89
89
  const foldEntryAnimationShow = (entry) => __foldkitBrandViewResult((Update.foldChildStep({
90
- update: (animation) => __foldkitBrandViewResult((animationUpdate(animation, AnimationMessage.Showed())), "@foldkit/ui/toast/update.js#update"),
90
+ update: (animation) => __foldkitBrandViewResult((animationUpdate(animation, Animation.Message.Showed())), "@foldkit/ui/toast/update.js#update"),
91
91
  read: readEntryAnimation(entry.id),
92
92
  write: writeEntryAnimation(entry.id),
93
93
  toParentMessage: toGotAnimationMessage(entry.id),
94
94
  })), "@foldkit/ui/toast/update.js#foldEntryAnimationShow");
95
95
  const foldEntryAnimationHide = (entry) => __foldkitBrandViewResult((Update.foldChildStep({
96
- update: (animation) => __foldkitBrandViewResult((animationUpdate(animation, AnimationMessage.Hid())), "@foldkit/ui/toast/update.js#update~2"),
96
+ update: (animation) => __foldkitBrandViewResult((animationUpdate(animation, Animation.Message.Hid())), "@foldkit/ui/toast/update.js#update~2"),
97
97
  read: readEntryAnimation(entry.id),
98
98
  write: writeEntryAnimation(entry.id),
99
99
  toParentMessage: toGotAnimationMessage(entry.id),
@@ -111,7 +111,7 @@ export const makeRuntime = (payloadSchema) => {
111
111
  return __foldkitBrandViewResult(({
112
112
  id: entryId,
113
113
  variant: input.variant ?? DEFAULT_VARIANT,
114
- animation: animationInit({ id: entryId, isShowing: false }),
114
+ animation: Animation.init({ id: entryId, isShowing: false }),
115
115
  maybeDuration,
116
116
  pendingDismissVersion: 0,
117
117
  isHovered: false,
@@ -1,4 +1,4 @@
1
- import { Schema as S } from 'effect';
1
+ import { Schema } from 'effect';
2
2
  /** Union of all messages the tooltip component can produce. */
3
3
  export declare const Message: import("foldkit/message").MessageUnion<{
4
4
  readonly EnteredTrigger: {};
@@ -7,10 +7,10 @@ export declare const Message: import("foldkit/message").MessageUnion<{
7
7
  readonly BlurredTrigger: {};
8
8
  readonly PressedEscape: {};
9
9
  readonly PressedPointerOnTrigger: {
10
- pointerType: S.String;
10
+ pointerType: Schema.String;
11
11
  };
12
12
  readonly CompletedWaitBeforeShowing: {
13
- version: S.Number;
13
+ version: Schema.Number;
14
14
  };
15
15
  readonly CompletedAnchorTooltip: {};
16
16
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/tooltip/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAKpC,+DAA+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,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,aAAa,GAAG,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,CAAA;AAC7D,MAAM,MAAM,uBAAuB,GACjC,OAAO,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAA;AAE7C,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,+DAA+D;AAC/D,eAAO,MAAM,UAAU;;;EAGrB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAA;AAChD,MAAM,MAAM,MAAM,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA;AAClD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Schema as S } from 'effect';
1
+ import { Schema } from 'effect';
2
2
  import { defineMessageUnion } from 'foldkit/message';
3
3
  // MESSAGE
4
4
  /** Union of all messages the tooltip component can produce. */
@@ -8,8 +8,8 @@ export const Message = defineMessageUnion({
8
8
  FocusedTrigger: {},
9
9
  BlurredTrigger: {},
10
10
  PressedEscape: {},
11
- PressedPointerOnTrigger: { pointerType: S.String },
12
- CompletedWaitBeforeShowing: { version: S.Number },
11
+ PressedPointerOnTrigger: { pointerType: Schema.String },
12
+ CompletedWaitBeforeShowing: { version: Schema.Number },
13
13
  CompletedAnchorTooltip: {},
14
14
  });
15
15
  // OUT MESSAGE