@foldkit/ui 0.156.0 → 0.157.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) 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 +8 -2
  14. package/dist/animation/update.d.ts.map +1 -1
  15. package/dist/animation/update.js +22 -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 +74 -62
  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 +35 -23
  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 +15 -15
  43. package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
  44. package/dist/hoverIntent/hoverIntent.js +17 -17
  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/keyboard.js +2 -2
  49. package/dist/listbox/multi.d.ts +19 -19
  50. package/dist/listbox/multi.d.ts.map +1 -1
  51. package/dist/listbox/multi.js +2 -2
  52. package/dist/listbox/shared.d.ts +58 -58
  53. package/dist/listbox/shared.d.ts.map +1 -1
  54. package/dist/listbox/shared.js +74 -62
  55. package/dist/listbox/single.d.ts +19 -19
  56. package/dist/listbox/single.d.ts.map +1 -1
  57. package/dist/listbox/single.js +2 -2
  58. package/dist/menu/index.d.ts +67 -67
  59. package/dist/menu/index.d.ts.map +1 -1
  60. package/dist/menu/index.js +82 -67
  61. package/dist/popover/index.d.ts +34 -34
  62. package/dist/popover/index.d.ts.map +1 -1
  63. package/dist/popover/index.js +49 -37
  64. package/dist/radioGroup/index.d.ts +12 -12
  65. package/dist/radioGroup/index.d.ts.map +1 -1
  66. package/dist/radioGroup/index.js +16 -16
  67. package/dist/slider/index.d.ts +14 -14
  68. package/dist/slider/index.d.ts.map +1 -1
  69. package/dist/slider/index.js +31 -31
  70. package/dist/switch/index.js +2 -2
  71. package/dist/tabs/index.d.ts +14 -14
  72. package/dist/tabs/index.d.ts.map +1 -1
  73. package/dist/tabs/index.js +18 -18
  74. package/dist/test/apps/disabledButton.d.ts +12 -12
  75. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  76. package/dist/test/apps/disabledButton.js +5 -5
  77. package/dist/textarea/index.d.ts +2 -2
  78. package/dist/textarea/index.d.ts.map +1 -1
  79. package/dist/toast/index.d.ts +63 -63
  80. package/dist/toast/index.d.ts.map +1 -1
  81. package/dist/toast/index.js +19 -19
  82. package/dist/toast/schema.d.ts +55 -55
  83. package/dist/toast/schema.d.ts.map +1 -1
  84. package/dist/toast/schema.js +29 -29
  85. package/dist/toast/test.d.ts.map +1 -1
  86. package/dist/toast/test.js +3 -3
  87. package/dist/toast/update.d.ts +61 -61
  88. package/dist/toast/update.d.ts.map +1 -1
  89. package/dist/toast/update.js +13 -13
  90. package/dist/tooltip/message.d.ts +3 -3
  91. package/dist/tooltip/message.d.ts.map +1 -1
  92. package/dist/tooltip/message.js +3 -3
  93. package/dist/tooltip/tooltip.d.ts +24 -24
  94. package/dist/tooltip/tooltip.d.ts.map +1 -1
  95. package/dist/tooltip/tooltip.js +13 -13
  96. package/dist/typeahead.d.ts.map +1 -1
  97. package/dist/typeahead.js +3 -3
  98. package/dist/virtualList/index.d.ts +16 -16
  99. package/dist/virtualList/index.d.ts.map +1 -1
  100. package/dist/virtualList/index.js +13 -13
  101. package/package.json +3 -3
@@ -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,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,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,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAyK3C,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuHG,SAAS,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB/C,CAAA"}
@@ -1,10 +1,10 @@
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';
7
- import { defaultLeaveCommand as animationDefaultLeaveCommand, update as animationUpdate, } from '../animation/update.js';
6
+ import * as Animation from '../animation/schema.js';
7
+ import { defaultLeaveCommand as animationDefaultLeaveCommand, hide as animationHide, show as animationShow, 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';
10
10
  /** Schedules an auto-dismiss timer for an entry. The result Message carries a
@@ -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: animationShow,
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: animationHide,
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,
@@ -202,7 +202,7 @@ export const makeRuntime = (payloadSchema) => {
202
202
  })), "@foldkit/ui/toast/update.js#LeftEntry");
203
203
  },
204
204
  GotAnimationMessage: ({ entryId, message: animationMessage }) => __foldkitBrandViewResult((delegateToEntryAnimation(model, entryId, animationMessage)), "@foldkit/ui/toast/update.js#GotAnimationMessage"),
205
- })), "@foldkit/ui/toast/update.js#update~3");
205
+ })), "@foldkit/ui/toast/update.js#update");
206
206
  /** Adds a new toast entry. */
207
207
  const show = (model, input) => __foldkitBrandViewResult((update(model, MessageSchema.Added({ entry: createEntry(model, input) }))), "@foldkit/ui/toast/update.js#show");
208
208
  /** Begins dismissing a specific entry. */
@@ -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+D;AAC/D,eAAO,MAAM,OAAO;;;;;;;QAMS,WAAW;;;QACR,OAAO;;;EAErC,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,WAAW,GAAG,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAA;AACzD,MAAM,MAAM,cAAc,GAAG,OAAO,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
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/tooltip/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAK/B,+DAA+D;AAC/D,eAAO,MAAM,OAAO;;;;;;;QAMS,WAAW;;;QACR,OAAO;;;EAErC,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,WAAW,GAAG,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAA;AACzD,MAAM,MAAM,cAAc,GAAG,OAAO,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
@@ -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 { type ChildAttribute, type Html } from 'foldkit/html';
4
4
  import * as Mount from 'foldkit/mount';
@@ -7,15 +7,15 @@ import * as Update from 'foldkit/update';
7
7
  import { AnchorConfig } from '../anchor/index.js';
8
8
  import { Message, OutMessage } from './message.js';
9
9
  /** Schema for the tooltip component's state. `isOpen` is visibility; `isHovered` tracks pointer on trigger; `isFocused` tracks tooltip-affirming focus on the trigger (focus arriving without a preceding mouse press, like keyboard, touch, or pen; mouse-click-induced focus is excluded since it doesn't affirm the user wants the tooltip visible); `isDismissed` suppresses re-opening after the user dismissed the tooltip (via Escape) until they disengage (leave or blur). `showDelay` is the hover-to-show duration. `maybeLastPointerType` records the most recent pointer type that pressed the trigger, so a mouse-click-induced focus can be distinguished from other focus. */
10
- export declare const Model: S.Struct<{
11
- readonly id: S.String;
12
- readonly isOpen: S.Boolean;
13
- readonly isHovered: S.Boolean;
14
- readonly isFocused: S.Boolean;
15
- readonly isDismissed: S.Boolean;
16
- readonly showDelay: S.DurationFromMillis;
17
- readonly pendingShowVersion: S.Number;
18
- readonly maybeLastPointerType: S.Option<S.String>;
10
+ export declare const Model: Schema.Struct<{
11
+ readonly id: Schema.String;
12
+ readonly isOpen: Schema.Boolean;
13
+ readonly isHovered: Schema.Boolean;
14
+ readonly isFocused: Schema.Boolean;
15
+ readonly isDismissed: Schema.Boolean;
16
+ readonly showDelay: Schema.DurationFromMillis;
17
+ readonly pendingShowVersion: Schema.Number;
18
+ readonly maybeLastPointerType: Schema.Option<Schema.String>;
19
19
  }>;
20
20
  export type Model = typeof Model.Type;
21
21
  /** Returns the bare DOM id of the tooltip trigger button, derived from the
@@ -33,27 +33,27 @@ export declare const init: (config: InitConfig) => Model;
33
33
  /** Waits for the tooltip's show delay before emitting
34
34
  * `CompletedWaitBeforeShowing`. */
35
35
  export declare const WaitBeforeShowing: Command.CommandDefinitionWithArgs<"WaitBeforeShowing", {
36
- delay: S.DurationFromMillis;
37
- version: S.Number;
36
+ delay: Schema.DurationFromMillis;
37
+ version: Schema.Number;
38
38
  }, Effect.Effect<{
39
39
  readonly _tag: "CompletedWaitBeforeShowing";
40
40
  readonly version: number;
41
41
  }, never, never>>;
42
42
  /** The anchor-positioning Mount this Tooltip renders on its panel. */
43
43
  export declare const AnchorTooltip: Mount.MountDefinitionWithArgs<"AnchorTooltip", {
44
- buttonId: S.String;
45
- anchor: S.Struct<{
46
- readonly placement: S.optional<S.Literals<readonly ["top", "right", "bottom", "left", "top-start", "top-end", "right-start", "right-end", "bottom-start", "bottom-end", "left-start", "left-end"]>>;
47
- readonly gap: S.optional<S.Number>;
48
- readonly offset: S.optional<S.Number>;
49
- readonly padding: S.optional<S.Union<readonly [S.Number, S.Struct<{
50
- readonly top: S.optionalKey<S.Number>;
51
- readonly right: S.optionalKey<S.Number>;
52
- readonly bottom: S.optionalKey<S.Number>;
53
- readonly left: S.optionalKey<S.Number>;
44
+ buttonId: Schema.String;
45
+ anchor: Schema.Struct<{
46
+ readonly placement: Schema.optional<Schema.Literals<readonly ["top", "right", "bottom", "left", "top-start", "top-end", "right-start", "right-end", "bottom-start", "bottom-end", "left-start", "left-end"]>>;
47
+ readonly gap: Schema.optional<Schema.Number>;
48
+ readonly offset: Schema.optional<Schema.Number>;
49
+ readonly padding: Schema.optional<Schema.Union<readonly [Schema.Number, Schema.Struct<{
50
+ readonly top: Schema.optionalKey<Schema.Number>;
51
+ readonly right: Schema.optionalKey<Schema.Number>;
52
+ readonly bottom: Schema.optionalKey<Schema.Number>;
53
+ readonly left: Schema.optionalKey<Schema.Number>;
54
54
  }>]>>;
55
- readonly portal: S.optional<S.Boolean>;
56
- readonly isPlacementLocked: S.optional<S.Boolean>;
55
+ readonly portal: Schema.optional<Schema.Boolean>;
56
+ readonly isPlacementLocked: Schema.optional<Schema.Boolean>;
57
57
  }>;
58
58
  }, {
59
59
  readonly _tag: "CompletedAnchorTooltip";
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/tooltip/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,MAAM,EAKN,MAAM,EAEN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAC9E,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAEtC,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAA;AAE9D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAIlD,8pBAA8pB;AAC9pB,eAAO,MAAM,KAAK;;;;;;;;;EAShB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC;;;mCAGmC;AACnC,eAAO,MAAM,SAAS,OAAQ,MAAM,KAAG,MAAyB,CAAA;AAQhE,8DAA8D;AAC9D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;CAC3B,CAAC,CAAA;AAEF,0E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;AACzC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACtC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACpC,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;IACpC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF;;uEAEuE;AACvE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAVP,YAAY;YACZ,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI;iBACvB,OAAO;gBACR,MAAM;qBACD,MAAM;GA2ExB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
- import { Duration, Effect, Equal, Function, Match as M, Number, Option, Predicate, Schema as S, pipe, } from 'effect';
2
+ import { Duration, Effect, Equal, Function, Match, Number, Option, Predicate, Schema, pipe, } from 'effect';
3
3
  import * as Command from 'foldkit/command';
4
4
  import { childAttributes } from 'foldkit/html';
5
5
  import * as Mount from 'foldkit/mount';
@@ -11,15 +11,15 @@ import * as OptionExt from '../internal/optionExtensions.js';
11
11
  import { Message, OutMessage } from './message.js';
12
12
  // MODEL
13
13
  /** Schema for the tooltip component's state. `isOpen` is visibility; `isHovered` tracks pointer on trigger; `isFocused` tracks tooltip-affirming focus on the trigger (focus arriving without a preceding mouse press, like keyboard, touch, or pen; mouse-click-induced focus is excluded since it doesn't affirm the user wants the tooltip visible); `isDismissed` suppresses re-opening after the user dismissed the tooltip (via Escape) until they disengage (leave or blur). `showDelay` is the hover-to-show duration. `maybeLastPointerType` records the most recent pointer type that pressed the trigger, so a mouse-click-induced focus can be distinguished from other focus. */
14
- export const Model = S.Struct({
15
- id: S.String,
16
- isOpen: S.Boolean,
17
- isHovered: S.Boolean,
18
- isFocused: S.Boolean,
19
- isDismissed: S.Boolean,
20
- showDelay: S.DurationFromMillis,
21
- pendingShowVersion: S.Number,
22
- maybeLastPointerType: S.Option(S.String),
14
+ export const Model = Schema.Struct({
15
+ id: Schema.String,
16
+ isOpen: Schema.Boolean,
17
+ isHovered: Schema.Boolean,
18
+ isFocused: Schema.Boolean,
19
+ isDismissed: Schema.Boolean,
20
+ showDelay: Schema.DurationFromMillis,
21
+ pendingShowVersion: Schema.Number,
22
+ maybeLastPointerType: Schema.Option(Schema.String),
23
23
  });
24
24
  // SELECTORS
25
25
  /** Returns the bare DOM id of the tooltip trigger button, derived from the
@@ -47,13 +47,13 @@ export const init = (config) => (__foldkitBrandViewResult(({
47
47
  /** Waits for the tooltip's show delay before emitting
48
48
  * `CompletedWaitBeforeShowing`. */
49
49
  export const WaitBeforeShowing = Command.define('WaitBeforeShowing', {
50
- args: { delay: S.DurationFromMillis, version: S.Number },
50
+ args: { delay: Schema.DurationFromMillis, version: Schema.Number },
51
51
  messages: [Message.CompletedWaitBeforeShowing],
52
52
  execute: ({ delay, version }) => __foldkitBrandViewResult((Effect.sleep(delay).pipe(Effect.as(Message.CompletedWaitBeforeShowing({ version })))), "@foldkit/ui/tooltip/tooltip.js#execute"),
53
53
  });
54
54
  /** The anchor-positioning Mount this Tooltip renders on its panel. */
55
55
  export const AnchorTooltip = Mount.define('AnchorTooltip', {
56
- args: { buttonId: S.String, anchor: AnchorConfig },
56
+ args: { buttonId: Schema.String, anchor: AnchorConfig },
57
57
  messages: [Message.CompletedAnchorTooltip],
58
58
  execute: ({ element, buttonId, anchor }) => __foldkitBrandViewResult((Effect.gen(function* () {
59
59
  yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((anchorSetup(element, {
@@ -187,7 +187,7 @@ export const view = defineView((model, viewInputs, h) => {
187
187
  }
188
188
  };
189
189
  const triggerLabelAttributes = resolveTriggerLabel();
190
- const handleTriggerKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((OptionExt.when(isOpen, Message.PressedEscape())), "@foldkit/ui/tooltip/tooltip.js#anonymous~6")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tooltip/tooltip.js#anonymous~7")))), "@foldkit/ui/tooltip/tooltip.js#handleTriggerKeyDown");
190
+ const handleTriggerKeyDown = (key) => __foldkitBrandViewResult((Match.value(key).pipe(Match.when('Escape', () => __foldkitBrandViewResult((OptionExt.when(isOpen, Message.PressedEscape())), "@foldkit/ui/tooltip/tooltip.js#anonymous~6")), Match.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tooltip/tooltip.js#anonymous~7")))), "@foldkit/ui/tooltip/tooltip.js#handleTriggerKeyDown");
191
191
  const handleTriggerPointerDown = (pointerType) => __foldkitBrandViewResult((Option.some(Message.PressedPointerOnTrigger({ pointerType }))), "@foldkit/ui/tooltip/tooltip.js#handleTriggerPointerDown");
192
192
  const triggerAttributes = [
193
193
  h.Id(triggerId(id)),
@@ -1 +1 @@
1
- {"version":3,"file":"typeahead.d.ts","sourceRoot":"","sources":["../src/typeahead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAuB,MAAM,QAAQ,CAAA;AAI3D,oOAAoO;AACpO,eAAO,MAAM,qBAAqB,GAAI,IAAI,SACjC,aAAa,CAAC,IAAI,CAAC,SACnB,MAAM,wBACS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAC/B,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,oBACpB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,gBACzC,OAAO,KACpB,MAAM,CAAC,MAAM,CAAC,MAAM,CA4BtB,CAAA"}
1
+ {"version":3,"file":"typeahead.d.ts","sourceRoot":"","sources":["../src/typeahead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAgB,MAAM,QAAQ,CAAA;AAIpD,oOAAoO;AACpO,eAAO,MAAM,qBAAqB,GAAI,IAAI,SACjC,aAAa,CAAC,IAAI,CAAC,SACnB,MAAM,wBACS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAC/B,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,oBACpB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,gBACzC,OAAO,KACpB,MAAM,CAAC,MAAM,CAAC,MAAM,CA4BtB,CAAA"}
package/dist/typeahead.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
- import { Array, Option, String as Str, pipe } from 'effect';
2
+ import { Array, Option, String, pipe } from 'effect';
3
3
  import { wrapIndex } from './keyboard.js';
4
4
  /** Finds the first enabled item whose search text starts with the query, searching forward from the active item and wrapping around. On a fresh search, starts after the active item; on a refinement, includes the active item. */
5
5
  export const resolveTypeaheadMatch = (items, query, maybeActiveItemIndex, isDisabled, itemToSearchText, isRefinement) => {
6
- const lowerQuery = Str.toLowerCase(query);
6
+ const lowerQuery = String.toLowerCase(query);
7
7
  const offset = isRefinement ? 0 : 1;
8
8
  const startIndex = Option.match(maybeActiveItemIndex, {
9
9
  onNone: () => __foldkitBrandViewResult((0), "@foldkit/ui/typeahead.js#onNone"),
10
10
  onSome: index => __foldkitBrandViewResult((index + offset), "@foldkit/ui/typeahead.js#onSome"),
11
11
  });
12
12
  const isEnabledMatch = (index) => __foldkitBrandViewResult((!isDisabled(index) &&
13
- pipe(items, Array.get(index), Option.exists(item => __foldkitBrandViewResult((pipe(itemToSearchText(item, index), Str.toLowerCase, Str.startsWith(lowerQuery))), "@foldkit/ui/typeahead.js#anonymous")))), "@foldkit/ui/typeahead.js#isEnabledMatch");
13
+ pipe(items, Array.get(index), Option.exists(item => __foldkitBrandViewResult((pipe(itemToSearchText(item, index), String.toLowerCase, String.startsWith(lowerQuery))), "@foldkit/ui/typeahead.js#anonymous")))), "@foldkit/ui/typeahead.js#isEnabledMatch");
14
14
  return __foldkitBrandViewResult((pipe(items, Array.length, Array.makeBy(step => __foldkitBrandViewResult((wrapIndex(startIndex + step, items.length)), "@foldkit/ui/typeahead.js#anonymous~2")), Array.findFirst(isEnabledMatch))), "@foldkit/ui/typeahead.js#resolveTypeaheadMatch");
15
15
  };
@@ -1,4 +1,4 @@
1
- import { Effect, Option, Schema as S } from 'effect';
1
+ import { Effect, Option, Schema } from 'effect';
2
2
  import { type Update } from 'foldkit';
3
3
  import * as Command from 'foldkit/command';
4
4
  import { type ChildAttribute, type Html, type TagName } from 'foldkit/html';
@@ -6,36 +6,36 @@ import { type View as SubmodelView } from 'foldkit/submodel';
6
6
  import * as Subscription from 'foldkit/subscription';
7
7
  /** Schema for the virtual list's state. Tracks scroll position, container
8
8
  * measurement, and any in-flight programmatic scroll. */
9
- export declare const Model: S.Struct<{
10
- readonly id: S.String;
11
- readonly rowHeightPx: S.Number;
12
- readonly scrollTop: S.Number;
9
+ export declare const Model: Schema.Struct<{
10
+ readonly id: Schema.String;
11
+ readonly rowHeightPx: Schema.Number;
12
+ readonly scrollTop: Schema.Number;
13
13
  readonly measurement: import("foldkit/schema").TaggedUnion<{
14
14
  readonly Unmeasured: {};
15
15
  readonly Measured: {
16
- containerHeight: S.Number;
16
+ containerHeight: Schema.Number;
17
17
  };
18
18
  }>;
19
19
  readonly pendingScroll: import("foldkit/schema").TaggedUnion<{
20
20
  readonly Idle: {};
21
21
  readonly ScrollingToIndex: {
22
- index: S.Number;
23
- version: S.Number;
22
+ index: Schema.Number;
23
+ version: Schema.Number;
24
24
  };
25
25
  }>;
26
- readonly pendingScrollVersion: S.Number;
26
+ readonly pendingScrollVersion: Schema.Number;
27
27
  }>;
28
28
  export type Model = typeof Model.Type;
29
29
  /** Union of all messages the virtual list component can produce. */
30
30
  export declare const Message: import("foldkit/message").MessageUnion<{
31
31
  readonly ScrolledContainer: {
32
- scrollTop: S.Number;
32
+ scrollTop: Schema.Number;
33
33
  };
34
34
  readonly MeasuredContainer: {
35
- containerHeight: S.Number;
35
+ containerHeight: Schema.Number;
36
36
  };
37
37
  readonly CompletedApplyScroll: {
38
- version: S.Number;
38
+ version: Schema.Number;
39
39
  };
40
40
  }>;
41
41
  export type ScrolledContainer = typeof Message.ScrolledContainer.Type;
@@ -52,9 +52,9 @@ export type InitConfig = Readonly<{
52
52
  * `Measured`. */
53
53
  export declare const init: (config: InitConfig) => Model;
54
54
  export declare const ApplyScroll: Command.CommandDefinitionWithArgs<"ApplyScroll", {
55
- id: S.String;
56
- scrollTop: S.Number;
57
- version: S.Number;
55
+ id: Schema.String;
56
+ scrollTop: Schema.Number;
57
+ version: Schema.Number;
58
58
  }, Effect.Effect<{
59
59
  readonly _tag: "CompletedApplyScroll";
60
60
  readonly version: number;
@@ -215,7 +215,7 @@ export type ViewInputs<Item> = Readonly<{
215
215
  itemToView: (item: Item, index: number) => Html;
216
216
  itemToRowHeightPx?: (item: Item, index: number) => number;
217
217
  overscan?: number;
218
- rowElement?: TagName;
218
+ rowElement?: Exclude<TagName, 'textarea'>;
219
219
  containerClassName?: string;
220
220
  containerAttributes?: ReadonlyArray<ChildAttribute>;
221
221
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/virtualList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EAEN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,OAAO,EAEb,MAAM,cAAc,CAAA;AAIrB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