foldkit 0.62.0 → 0.64.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 (72) hide show
  1. package/dist/devtools/overlay.d.ts.map +1 -1
  2. package/dist/devtools/overlay.js +16 -1
  3. package/dist/html/dragZoneTracking.d.ts +48 -0
  4. package/dist/html/dragZoneTracking.d.ts.map +1 -0
  5. package/dist/html/dragZoneTracking.js +75 -0
  6. package/dist/html/index.d.ts +6 -0
  7. package/dist/html/index.d.ts.map +1 -1
  8. package/dist/html/index.js +40 -3
  9. package/dist/ui/calendar/index.d.ts +17 -0
  10. package/dist/ui/calendar/index.d.ts.map +1 -1
  11. package/dist/ui/calendar/index.js +17 -0
  12. package/dist/ui/calendar/public.d.ts +1 -1
  13. package/dist/ui/calendar/public.d.ts.map +1 -1
  14. package/dist/ui/calendar/public.js +1 -1
  15. package/dist/ui/combobox/multi.d.ts +17 -11
  16. package/dist/ui/combobox/multi.d.ts.map +1 -1
  17. package/dist/ui/combobox/multi.js +8 -2
  18. package/dist/ui/combobox/multiPublic.d.ts +1 -1
  19. package/dist/ui/combobox/multiPublic.d.ts.map +1 -1
  20. package/dist/ui/combobox/multiPublic.js +1 -1
  21. package/dist/ui/combobox/public.d.ts +1 -1
  22. package/dist/ui/combobox/public.d.ts.map +1 -1
  23. package/dist/ui/combobox/public.js +1 -1
  24. package/dist/ui/combobox/single.d.ts +8 -2
  25. package/dist/ui/combobox/single.d.ts.map +1 -1
  26. package/dist/ui/combobox/single.js +7 -1
  27. package/dist/ui/datePicker/index.d.ts +20 -0
  28. package/dist/ui/datePicker/index.d.ts.map +1 -1
  29. package/dist/ui/datePicker/index.js +28 -0
  30. package/dist/ui/datePicker/public.d.ts +1 -1
  31. package/dist/ui/datePicker/public.d.ts.map +1 -1
  32. package/dist/ui/datePicker/public.js +1 -1
  33. package/dist/ui/dialog/index.d.ts +3 -0
  34. package/dist/ui/dialog/index.d.ts.map +1 -1
  35. package/dist/ui/dialog/index.js +3 -0
  36. package/dist/ui/dialog/public.d.ts +1 -1
  37. package/dist/ui/dialog/public.d.ts.map +1 -1
  38. package/dist/ui/dialog/public.js +1 -1
  39. package/dist/ui/disclosure/index.d.ts +3 -0
  40. package/dist/ui/disclosure/index.d.ts.map +1 -1
  41. package/dist/ui/disclosure/index.js +3 -0
  42. package/dist/ui/disclosure/public.d.ts +1 -1
  43. package/dist/ui/disclosure/public.d.ts.map +1 -1
  44. package/dist/ui/disclosure/public.js +1 -1
  45. package/dist/ui/fileDrop/index.d.ts +102 -0
  46. package/dist/ui/fileDrop/index.d.ts.map +1 -0
  47. package/dist/ui/fileDrop/index.js +113 -0
  48. package/dist/ui/fileDrop/public.d.ts +3 -0
  49. package/dist/ui/fileDrop/public.d.ts.map +1 -0
  50. package/dist/ui/fileDrop/public.js +1 -0
  51. package/dist/ui/index.d.ts +1 -0
  52. package/dist/ui/index.d.ts.map +1 -1
  53. package/dist/ui/index.js +1 -0
  54. package/dist/ui/listbox/multi.d.ts +8 -2
  55. package/dist/ui/listbox/multi.d.ts.map +1 -1
  56. package/dist/ui/listbox/multi.js +7 -1
  57. package/dist/ui/listbox/multiPublic.d.ts +1 -1
  58. package/dist/ui/listbox/multiPublic.d.ts.map +1 -1
  59. package/dist/ui/listbox/multiPublic.js +1 -1
  60. package/dist/ui/listbox/public.d.ts +1 -1
  61. package/dist/ui/listbox/public.d.ts.map +1 -1
  62. package/dist/ui/listbox/public.js +1 -1
  63. package/dist/ui/listbox/single.d.ts +8 -2
  64. package/dist/ui/listbox/single.d.ts.map +1 -1
  65. package/dist/ui/listbox/single.js +7 -1
  66. package/dist/ui/menu/index.d.ts +6 -0
  67. package/dist/ui/menu/index.d.ts.map +1 -1
  68. package/dist/ui/menu/index.js +6 -0
  69. package/dist/ui/menu/public.d.ts +1 -1
  70. package/dist/ui/menu/public.d.ts.map +1 -1
  71. package/dist/ui/menu/public.js +1 -1
  72. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { Schema as S } from 'effect';
1
+ import { Option, Schema as S } from 'effect';
2
2
  import type * as Command from '../../command';
3
3
  import { type Html } from '../../html';
4
- import { type BaseInitConfig, type BaseViewConfig, type Message, SelectedItem } from './shared';
4
+ import { type BaseInitConfig, type BaseViewConfig, Closed, type Message, Opened, SelectedItem } from './shared';
5
5
  /** Schema for the multi-select combobox component's state, tracking open/closed status, active item, input value, and selected items. */
6
6
  export declare const Model: S.extend<S.Struct<{
7
7
  id: typeof S.String;
@@ -44,9 +44,9 @@ export declare const update: (model: {
44
44
  readonly isShowing: boolean;
45
45
  readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
46
46
  };
47
- readonly maybeActiveItemIndex: import("effect/Option").Option<number>;
47
+ readonly maybeActiveItemIndex: Option.Option<number>;
48
48
  readonly activationTrigger: "Pointer" | "Keyboard";
49
- readonly maybeLastPointerPosition: import("effect/Option").Option<{
49
+ readonly maybeLastPointerPosition: Option.Option<{
50
50
  readonly screenX: number;
51
51
  readonly screenY: number;
52
52
  }>;
@@ -66,9 +66,9 @@ export declare const update: (model: {
66
66
  readonly isShowing: boolean;
67
67
  readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
68
68
  };
69
- readonly maybeActiveItemIndex: import("effect/Option").Option<number>;
69
+ readonly maybeActiveItemIndex: Option.Option<number>;
70
70
  readonly activationTrigger: "Pointer" | "Keyboard";
71
- readonly maybeLastPointerPosition: import("effect/Option").Option<{
71
+ readonly maybeLastPointerPosition: Option.Option<{
72
72
  readonly screenX: number;
73
73
  readonly screenY: number;
74
74
  }>;
@@ -100,12 +100,12 @@ export declare const update: (model: {
100
100
  readonly _tag: "CompletedClickItem";
101
101
  } | {
102
102
  readonly _tag: "Opened";
103
- readonly maybeActiveItemIndex: import("effect/Option").Option<number>;
103
+ readonly maybeActiveItemIndex: Option.Option<number>;
104
104
  } | {
105
105
  readonly _tag: "ActivatedItem";
106
106
  readonly activationTrigger: "Pointer" | "Keyboard";
107
107
  readonly index: number;
108
- readonly maybeImmediateSelection: import("effect/Option").Option<{
108
+ readonly maybeImmediateSelection: Option.Option<{
109
109
  readonly item: string;
110
110
  readonly displayText: string;
111
111
  }>;
@@ -141,6 +141,12 @@ export declare const update: (model: {
141
141
  readonly _tag: "PressedToggleButton";
142
142
  }, never, never>;
143
143
  }>[]];
144
+ /** Programmatically opens the combobox, updating the model and returning
145
+ * focus and modal commands. Use this in domain-event handlers to open the combobox. */
146
+ export declare const open: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
147
+ /** Programmatically closes the combobox, updating the model and returning
148
+ * focus and modal commands. Use this in domain-event handlers to close the combobox. */
149
+ export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
144
150
  /** Programmatically toggles an item in the multi-select combobox. Use this in domain-event handlers when the combobox uses `onSelectedItem`. */
145
151
  export declare const selectItem: (model: Model, item: string) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
146
152
  /** Configuration for rendering a multi-select combobox with `view`. */
@@ -157,9 +163,9 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
157
163
  readonly isShowing: boolean;
158
164
  readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
159
165
  };
160
- readonly maybeActiveItemIndex: import("effect/Option").Option<number>;
166
+ readonly maybeActiveItemIndex: Option.Option<number>;
161
167
  readonly activationTrigger: "Pointer" | "Keyboard";
162
- readonly maybeLastPointerPosition: import("effect/Option").Option<{
168
+ readonly maybeLastPointerPosition: Option.Option<{
163
169
  readonly screenX: number;
164
170
  readonly screenY: number;
165
171
  }>;
@@ -170,7 +176,7 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
170
176
  } & {
171
177
  readonly selectedItems: readonly string[];
172
178
  };
173
- toParentMessage: (message: import("./shared").Opened | import("./shared").Closed | import("./shared").ClosedByTab | import("./shared").ActivatedItem | import("./shared").DeactivatedItem | SelectedItem | import("./shared").MovedPointerOverItem | import("./shared").RequestedItemClick | import("./shared").UpdatedInputValue | import("./shared").PressedToggleButton) => Message;
179
+ toParentMessage: (message: Opened | Closed | import("./shared").ClosedByTab | import("./shared").ActivatedItem | import("./shared").DeactivatedItem | SelectedItem | import("./shared").MovedPointerOverItem | import("./shared").RequestedItemClick | import("./shared").UpdatedInputValue | import("./shared").PressedToggleButton) => Message;
174
180
  onSelectedItem?: (value: string) => Message;
175
181
  items: readonly Item[];
176
182
  itemToConfig: (item: Item, context: Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/multi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE3C,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAA;AAElD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,YAAY,EAKb,MAAM,UAAU,CAAA;AAIjB,yIAAyI;AACzI,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;GAEjB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,8RAA8R;AAC9R,MAAM,MAAM,UAAU,GAAG,cAAc,GACrC,QAAQ,CAAC;IACP,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CACtC,CAAC,CAAA;AAEJ,2IAA2I;AAC3I,eAAO,MAAM,IAAI,GAAI,QAAQ,UAAU,KAAG,KAGxC,CAAA;AAcF,yJAAyJ;AACzJ,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwBjB,CA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,MAAM,IAAI,GAAI,OAAO,EAAE,IAAI,SAAS,MAAM,EAC/C,cAAc,IAAI,CAChB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,gBAAgB,CAC/C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,iBAAiB,CAAC,KACrE,IAAI,CAoBR,CAAA"}
@@ -1,7 +1,7 @@
1
- import { Array, Schema as S } from 'effect';
1
+ import { Array, Option, Schema as S } from 'effect';
2
2
  import { createLazy } from '../../html';
3
3
  import { evo } from '../../struct';
4
- import { BaseModel, SelectedItem, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared';
4
+ import { BaseModel, Closed, Opened, SelectedItem, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared';
5
5
  // MODEL
6
6
  /** Schema for the multi-select combobox component's state, tracking open/closed status, active item, input value, and selected items. */
7
7
  export const Model = BaseModel.pipe(S.extend(S.Struct({ selectedItems: S.Array(S.String) })));
@@ -36,6 +36,12 @@ export const update = makeUpdate({
36
36
  selectedItems: () => toggleItem(model.selectedItems, item),
37
37
  }),
38
38
  });
39
+ /** Programmatically opens the combobox, updating the model and returning
40
+ * focus and modal commands. Use this in domain-event handlers to open the combobox. */
41
+ export const open = (model) => update(model, Opened({ maybeActiveItemIndex: Option.none() }));
42
+ /** Programmatically closes the combobox, updating the model and returning
43
+ * focus and modal commands. Use this in domain-event handlers to close the combobox. */
44
+ export const close = (model) => update(model, Closed());
39
45
  /** Programmatically toggles an item in the multi-select combobox. Use this in domain-event handlers when the combobox uses `onSelectedItem`. */
40
46
  export const selectItem = (model, item) => update(model, SelectedItem({ item, displayText: item }));
41
47
  /** Renders a headless multi-select combobox with keyboard navigation, selection tracking, and aria-activedescendant focus management. */
@@ -1,3 +1,3 @@
1
- export { init, update, selectItem, view, lazy, Model } from './multi';
1
+ export { init, update, open, close, selectItem, view, lazy, Model, } from './multi';
2
2
  export type { InitConfig, ViewConfig } from './multi';
3
3
  //# sourceMappingURL=multiPublic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiPublic.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/multiPublic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACrE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"multiPublic.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/multiPublic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,KAAK,GACN,MAAM,SAAS,CAAA;AAChB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +1 @@
1
- export { init, update, selectItem, view, lazy, Model } from './multi';
1
+ export { init, update, open, close, selectItem, view, lazy, Model, } from './multi';
@@ -1,4 +1,4 @@
1
- export { init, update, selectItem, view, lazy, Model } from './single';
1
+ export { init, update, open, close, selectItem, view, lazy, Model, } from './single';
2
2
  export { Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, GotTransitionMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrTransitionEnd, } from './shared';
3
3
  export type { ActivationTrigger, Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, UpdatedInputValue, PressedToggleButton, ItemConfig, GroupHeading, } from './shared';
4
4
  export type { InitConfig, ViewConfig } from './single';
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEtE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,6BAA6B,GAC9B,MAAM,UAAU,CAAA;AAEjB,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,YAAY,GACb,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAEtD,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,KAAK,GACN,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,6BAA6B,GAC9B,MAAM,UAAU,CAAA;AAEjB,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,YAAY,GACb,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAEtD,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA"}
@@ -1,3 +1,3 @@
1
- export { init, update, selectItem, view, lazy, Model } from './single';
1
+ export { init, update, open, close, selectItem, view, lazy, Model, } from './single';
2
2
  export { Message, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, GotTransitionMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrTransitionEnd, } from './shared';
3
3
  export * as Multi from './multiPublic';
@@ -1,7 +1,7 @@
1
1
  import { Option, Schema as S } from 'effect';
2
2
  import type * as Command from '../../command';
3
3
  import { type Html } from '../../html';
4
- import { type BaseInitConfig, type BaseViewConfig, type Message, SelectedItem } from './shared';
4
+ import { type BaseInitConfig, type BaseViewConfig, Closed, type Message, Opened, SelectedItem } from './shared';
5
5
  /** Schema for the single-select combobox component's state, tracking open/closed status, active item, input value, selected item, and display text. */
6
6
  export declare const Model: S.extend<S.Struct<{
7
7
  id: typeof S.String;
@@ -145,6 +145,12 @@ export declare const update: (model: {
145
145
  readonly _tag: "PressedToggleButton";
146
146
  }, never, never>;
147
147
  }>[]];
148
+ /** Programmatically opens the combobox, updating the model and returning
149
+ * focus and modal commands. Use this in domain-event handlers to open the combobox. */
150
+ export declare const open: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
151
+ /** Programmatically closes the combobox, updating the model and returning
152
+ * focus and modal commands. Use this in domain-event handlers to close the combobox. */
153
+ export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
148
154
  /** Programmatically selects an item in the single-select combobox, closing the combobox and returning
149
155
  * focus commands. Use this in domain-event handlers when the combobox uses `onSelectedItem`. */
150
156
  export declare const selectItem: (model: Model, item: string, displayText: string) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
@@ -176,7 +182,7 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
176
182
  readonly maybeSelectedItem: Option.Option<string>;
177
183
  readonly maybeSelectedDisplayText: Option.Option<string>;
178
184
  };
179
- toParentMessage: (message: import("./shared").Opened | import("./shared").Closed | import("./shared").ClosedByTab | import("./shared").ActivatedItem | import("./shared").DeactivatedItem | SelectedItem | import("./shared").MovedPointerOverItem | import("./shared").RequestedItemClick | import("./shared").UpdatedInputValue | import("./shared").PressedToggleButton) => Message;
185
+ toParentMessage: (message: Opened | Closed | import("./shared").ClosedByTab | import("./shared").ActivatedItem | import("./shared").DeactivatedItem | SelectedItem | import("./shared").MovedPointerOverItem | import("./shared").RequestedItemClick | import("./shared").UpdatedInputValue | import("./shared").PressedToggleButton) => Message;
180
186
  onSelectedItem?: (value: string) => Message;
181
187
  items: readonly Item[];
182
188
  itemToConfig: (item: Item, context: Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAEzD,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAA;AAElD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,YAAY,EAKb,MAAM,UAAU,CAAA;AAIjB,uJAAuJ;AACvJ,eAAO,MAAM,KAAK;;;;;;;;;;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,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB;iGACiG;AACjG,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,EACZ,MAAM,MAAM,EACZ,aAAa,MAAM,KAClB,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CACP,CAAA;AAIpD,wEAAwE;AACxE,MAAM,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,SAAS,MAAM,IAAI,cAAc,CACnE,OAAO,EACP,IAAI,EACJ,KAAK,CACN,CAAA;AAED,0IAA0I;AAC1I,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAOf,CAAA;AAEF;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,IAAI,SAAS,MAAM,EAC/C,cAAc,IAAI,CAChB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,gBAAgB,CAC/C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,iBAAiB,CAAC,KACrE,IAAI,CAoBR,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { Array, Option, Schema as S, pipe } from 'effect';
2
2
  import { createLazy } from '../../html';
3
3
  import { evo } from '../../struct';
4
- import { BaseModel, SelectedItem, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared';
4
+ import { BaseModel, Closed, Opened, SelectedItem, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared';
5
5
  // MODEL
6
6
  /** Schema for the single-select combobox component's state, tracking open/closed status, active item, input value, selected item, and display text. */
7
7
  export const Model = BaseModel.pipe(S.extend(S.Struct({
@@ -52,6 +52,12 @@ export const update = makeUpdate({
52
52
  maybeSelectedDisplayText: () => Option.some(displayText),
53
53
  }),
54
54
  });
55
+ /** Programmatically opens the combobox, updating the model and returning
56
+ * focus and modal commands. Use this in domain-event handlers to open the combobox. */
57
+ export const open = (model) => update(model, Opened({ maybeActiveItemIndex: Option.none() }));
58
+ /** Programmatically closes the combobox, updating the model and returning
59
+ * focus and modal commands. Use this in domain-event handlers to close the combobox. */
60
+ export const close = (model) => update(model, Closed());
55
61
  /** Programmatically selects an item in the single-select combobox, closing the combobox and returning
56
62
  * focus commands. Use this in domain-event handlers when the combobox uses `onSelectedItem`. */
57
63
  export const selectItem = (model, item, displayText) => update(model, SelectedItem({ item, displayText }));
@@ -181,6 +181,26 @@ export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Com
181
181
  export declare const selectDate: (model: Model, date: CalendarDate) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
182
182
  /** Programmatically clears the selected date. */
183
183
  export declare const clear: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
184
+ /** Sets the minimum selectable date on the embedded calendar. Pass
185
+ * `Option.none()` to remove the minimum. Use this when the minimum derives
186
+ * from other Model state (e.g. a start date field whose current selection
187
+ * constrains an end date picker).
188
+ *
189
+ * Does NOT reconcile the current selection — if a previously-selected date
190
+ * is now below the new minimum, it remains selected. Callers should `clear`
191
+ * or reassign the selection explicitly if their domain requires it. */
192
+ export declare const setMinDate: (model: Model, maybeMinDate: Option.Option<CalendarDate>) => Model;
193
+ /** Sets the maximum selectable date on the embedded calendar. Pass
194
+ * `Option.none()` to remove the maximum. Does NOT reconcile the current
195
+ * selection. */
196
+ export declare const setMaxDate: (model: Model, maybeMaxDate: Option.Option<CalendarDate>) => Model;
197
+ /** Sets the list of individually-disabled dates on the embedded calendar.
198
+ * Pass an empty array to clear. Does NOT reconcile the current selection. */
199
+ export declare const setDisabledDates: (model: Model, disabledDates: ReadonlyArray<CalendarDate>) => Model;
200
+ /** Sets the days of the week that are disabled on the embedded calendar
201
+ * (e.g. weekends). Pass an empty array to clear. Does NOT reconcile the
202
+ * current selection. */
203
+ export declare const setDisabledDaysOfWeek: (model: Model, disabledDaysOfWeek: ReadonlyArray<Calendar.DayOfWeek>) => Model;
184
204
  /** Configuration for rendering a date picker with `view`. */
185
205
  export type ViewConfig<ParentMessage> = Readonly<{
186
206
  model: Model;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/datePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAoB,MAAM,YAAY,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,UAAU,MAAM,aAAa,CAAA;AAKzC;;mDAEmD;AACnD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,wDAAwD;AACxD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAE7B,CAAA;AACF,uDAAuD;AACvD,eAAO,MAAM,iBAAiB;;;;;;;EAE5B,CAAA;AACF;gEACgE;AAChE,eAAO,MAAM,YAAY;;;;;;EAAqD,CAAA;AAC9E,+EAA+E;AAC/E,eAAO,MAAM,OAAO,4DAAe,CAAA;AACnC;4EAC4E;AAC5E,eAAO,MAAM,MAAM,2DAAc,CAAA;AACjC;kCACkC;AAClC,eAAO,MAAM,MAA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,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IACzD,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CAC7D,CAAC,CAAA;AAEF;;;;gEAIgE;AAChE,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAuEF,CAAA;AAED;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,KACzE,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,KAC1D,IAAI,CAgBR,CAAA"}
@@ -164,6 +164,34 @@ export const clear = (model) => {
164
164
  const [nextModel, commands] = toModelAndCommands(update(model, Cleared()));
165
165
  return [nextModel, commands];
166
166
  };
167
+ /** Sets the minimum selectable date on the embedded calendar. Pass
168
+ * `Option.none()` to remove the minimum. Use this when the minimum derives
169
+ * from other Model state (e.g. a start date field whose current selection
170
+ * constrains an end date picker).
171
+ *
172
+ * Does NOT reconcile the current selection — if a previously-selected date
173
+ * is now below the new minimum, it remains selected. Callers should `clear`
174
+ * or reassign the selection explicitly if their domain requires it. */
175
+ export const setMinDate = (model, maybeMinDate) => evo(model, {
176
+ calendar: () => UiCalendar.setMinDate(model.calendar, maybeMinDate),
177
+ });
178
+ /** Sets the maximum selectable date on the embedded calendar. Pass
179
+ * `Option.none()` to remove the maximum. Does NOT reconcile the current
180
+ * selection. */
181
+ export const setMaxDate = (model, maybeMaxDate) => evo(model, {
182
+ calendar: () => UiCalendar.setMaxDate(model.calendar, maybeMaxDate),
183
+ });
184
+ /** Sets the list of individually-disabled dates on the embedded calendar.
185
+ * Pass an empty array to clear. Does NOT reconcile the current selection. */
186
+ export const setDisabledDates = (model, disabledDates) => evo(model, {
187
+ calendar: () => UiCalendar.setDisabledDates(model.calendar, disabledDates),
188
+ });
189
+ /** Sets the days of the week that are disabled on the embedded calendar
190
+ * (e.g. weekends). Pass an empty array to clear. Does NOT reconcile the
191
+ * current selection. */
192
+ export const setDisabledDaysOfWeek = (model, disabledDaysOfWeek) => evo(model, {
193
+ calendar: () => UiCalendar.setDisabledDaysOfWeek(model.calendar, disabledDaysOfWeek),
194
+ });
167
195
  const toModelAndCommands = (result) => {
168
196
  const [nextModel, commands] = result;
169
197
  return [nextModel, commands];
@@ -1,3 +1,3 @@
1
- export { init, update, view, lazy, open, close, selectDate, clear, Model, Message, OutMessage, GotCalendarMessage, GotPopoverMessage, SelectedDate, Cleared, Opened, Closed, ChangedViewMonth, } from './index';
1
+ export { init, update, view, lazy, open, close, selectDate, clear, setMinDate, setMaxDate, setDisabledDates, setDisabledDaysOfWeek, Model, Message, OutMessage, GotCalendarMessage, GotPopoverMessage, SelectedDate, Cleared, Opened, Closed, ChangedViewMonth, } from './index';
2
2
  export type { InitConfig, ViewConfig } from './index';
3
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/datePicker/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,MAAM,EACN,MAAM,EACN,gBAAgB,GACjB,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/datePicker/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,UAAU,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,MAAM,EACN,MAAM,EACN,gBAAgB,GACjB,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +1 @@
1
- export { init, update, view, lazy, open, close, selectDate, clear, Model, Message, OutMessage, GotCalendarMessage, GotPopoverMessage, SelectedDate, Cleared, Opened, Closed, ChangedViewMonth, } from './index';
1
+ export { init, update, view, lazy, open, close, selectDate, clear, setMinDate, setMaxDate, setDisabledDates, setDisabledDaysOfWeek, Model, Message, OutMessage, GotCalendarMessage, GotPopoverMessage, SelectedDate, Cleared, Opened, Closed, ChangedViewMonth, } from './index';
@@ -76,6 +76,9 @@ export type ViewConfig<Message> = Readonly<{
76
76
  className?: string;
77
77
  attributes?: ReadonlyArray<Attribute<Message>>;
78
78
  }>;
79
+ /** Programmatically opens the dialog, updating the model and returning
80
+ * show commands. Use this in domain-event handlers to open the dialog. */
81
+ export declare const open: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
79
82
  /** Programmatically closes the dialog, updating the model and returning
80
83
  * close commands. Use this in domain-event handlers when the dialog uses `onClosed`. */
81
84
  export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,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AAE,IAAI,KACf,IAAI,CAkBR,CAAA"}
@@ -110,6 +110,9 @@ export const update = (model, message) => M.value(message).pipe(withUpdateReturn
110
110
  export const titleId = (model) => `${model.id}-title`;
111
111
  /** Returns the ID used for `aria-describedby` on the dialog. Apply this to your description element. */
112
112
  export const descriptionId = (model) => `${model.id}-description`;
113
+ /** Programmatically opens the dialog, updating the model and returning
114
+ * show commands. Use this in domain-event handlers to open the dialog. */
115
+ export const open = (model) => update(model, Opened());
113
116
  /** Programmatically closes the dialog, updating the model and returning
114
117
  * close commands. Use this in domain-event handlers when the dialog uses `onClosed`. */
115
118
  export const close = (model) => update(model, Closed());
@@ -1,3 +1,3 @@
1
- export { init, update, close, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, GotTransitionMessage, ShowDialog, CloseDialog, } from './index';
1
+ export { init, update, open, close, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, GotTransitionMessage, ShowDialog, CloseDialog, } from './index';
2
2
  export type { InitConfig, ViewConfig } from './index';
3
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +1 @@
1
- export { init, update, close, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, GotTransitionMessage, ShowDialog, CloseDialog, } from './index';
1
+ export { init, update, open, close, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, GotTransitionMessage, ShowDialog, CloseDialog, } from './index';
@@ -57,6 +57,9 @@ export type ViewConfig<Message> = Readonly<{
57
57
  /** Programmatically toggles the disclosure, updating the model and returning
58
58
  * focus commands. Use this in domain-event handlers when the disclosure uses `onToggled`. */
59
59
  export declare const toggle: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
60
+ /** Programmatically closes the disclosure, updating the model and returning
61
+ * focus commands. Use this in domain-event handlers to close the disclosure. */
62
+ export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
60
63
  /** Renders a headless disclosure component with accessible ARIA attributes and keyboard support. */
61
64
  export declare const view: <Message>(config: ViewConfig<Message>) => Html;
62
65
  /** Creates a memoized disclosure view. Static config is captured in a closure;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/disclosure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,OAAO,EAGb,MAAM,YAAY,CAAA;AAOnB,kGAAkG;AAClG,eAAO,MAAM,KAAK;;;EAGhB,CAA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CAAC,KAAG,IAoG3D,CAAA;AAED;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,OAAO,EAC1B,cAAc,IAAI,CAChB,UAAU,CAAC,OAAO,CAAC,EACnB,OAAO,GAAG,iBAAiB,GAAG,WAAW,CAC1C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,KACpD,IAAI,CAgBR,CAAA"}
@@ -48,6 +48,9 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
48
48
  /** Programmatically toggles the disclosure, updating the model and returning
49
49
  * focus commands. Use this in domain-event handlers when the disclosure uses `onToggled`. */
50
50
  export const toggle = (model) => update(model, Toggled());
51
+ /** Programmatically closes the disclosure, updating the model and returning
52
+ * focus commands. Use this in domain-event handlers to close the disclosure. */
53
+ export const close = (model) => update(model, Closed());
51
54
  /** Renders a headless disclosure component with accessible ARIA attributes and keyboard support. */
52
55
  export const view = (config) => {
53
56
  const { div, empty, AriaControls, AriaDisabled, AriaExpanded, Class, DataAttribute, Disabled, Hidden, Id, OnClick, OnKeyDownPreventDefault, Tabindex, Type, keyed, } = html();
@@ -1,3 +1,3 @@
1
- export { init, update, toggle, view, lazy, Model, Message, Toggled, Closed, CompletedFocusButton, FocusButton, } from './index';
1
+ export { init, update, toggle, close, view, lazy, Model, Message, Toggled, Closed, CompletedFocusButton, FocusButton, } from './index';
2
2
  export type { InitConfig, ViewConfig } from './index';
3
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/disclosure/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,WAAW,GACZ,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/disclosure/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,WAAW,GACZ,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +1 @@
1
- export { init, update, toggle, view, lazy, Model, Message, Toggled, Closed, CompletedFocusButton, FocusButton, } from './index';
1
+ export { init, update, toggle, close, view, lazy, Model, Message, Toggled, Closed, CompletedFocusButton, FocusButton, } from './index';
@@ -0,0 +1,102 @@
1
+ import { Option, Schema as S } from 'effect';
2
+ import * as Command from '../../command';
3
+ import { type Attribute, type Html } from '../../html';
4
+ /** Schema for the file-drop component's state.
5
+ *
6
+ * `isDragOver` controls the `data-drag-over` attribute on the root while a
7
+ * drag is hovering. The html layer's `OnDragEnter`/`OnDragLeave` handlers
8
+ * track the per-element active state internally so transitions between
9
+ * children of the zone do not flicker the boolean off-and-on. */
10
+ export declare const Model: S.Struct<{
11
+ id: typeof S.String;
12
+ isDragOver: typeof S.Boolean;
13
+ }>;
14
+ export type Model = typeof Model.Type;
15
+ /** Sent when a drag enters the drop zone. Flips `isDragOver` to true so
16
+ * the consumer's styling can highlight the zone. */
17
+ export declare const EnteredDragZone: import("../../schema").CallableTaggedStruct<"EnteredDragZone", {}>;
18
+ /** Sent when a drag leaves the drop zone without dropping. Flips
19
+ * `isDragOver` back to false. */
20
+ export declare const LeftDragZone: import("../../schema").CallableTaggedStruct<"LeftDragZone", {}>;
21
+ /** Sent when the user drops files on the zone or selects them via the
22
+ * hidden `<input type="file">`. Carries the raw `File` objects, resets
23
+ * `isDragOver`, and emits `ReceivedFiles` as an OutMessage. */
24
+ export declare const DroppedFiles: import("../../schema").CallableTaggedStruct<"DroppedFiles", {
25
+ files: S.Array$<S.Schema<File, File, never>>;
26
+ }>;
27
+ /** Union of all messages the file-drop component can produce. */
28
+ export declare const Message: S.Union<[import("../../schema").CallableTaggedStruct<"EnteredDragZone", {}>, import("../../schema").CallableTaggedStruct<"LeftDragZone", {}>, import("../../schema").CallableTaggedStruct<"DroppedFiles", {
29
+ files: S.Array$<S.Schema<File, File, never>>;
30
+ }>]>;
31
+ export type Message = typeof Message.Type;
32
+ /** Emitted when files arrive via drop or input-change. The consumer's
33
+ * parent update handles this to process the files (validate, upload,
34
+ * store in Model, etc.). */
35
+ export declare const ReceivedFiles: import("../../schema").CallableTaggedStruct<"ReceivedFiles", {
36
+ files: S.Array$<S.Schema<File, File, never>>;
37
+ }>;
38
+ /** The file-drop component's OutMessage, narrowed to `ReceivedFiles`. */
39
+ export declare const OutMessage: import("../../schema").CallableTaggedStruct<"ReceivedFiles", {
40
+ files: S.Array$<S.Schema<File, File, never>>;
41
+ }>;
42
+ export type OutMessage = typeof OutMessage.Type;
43
+ /** Configuration for creating a file-drop model with `init`. */
44
+ export type InitConfig = Readonly<{
45
+ id: string;
46
+ }>;
47
+ /** Creates an initial file-drop model. Drag state starts cleared. */
48
+ export declare const init: (config: InitConfig) => Model;
49
+ type UpdateReturn = readonly [
50
+ Model,
51
+ ReadonlyArray<Command.Command<Message>>,
52
+ Option.Option<OutMessage>
53
+ ];
54
+ /** Processes a file-drop message and returns the next model, commands,
55
+ * and optional OutMessage. */
56
+ export declare const update: (model: Model, message: Message) => UpdateReturn;
57
+ /** Attribute groups the file-drop component provides to the consumer's
58
+ * `toView` callback. Spread each group onto the element that plays that
59
+ * role: `root` typically goes on a `<label>` so clicking it focuses the
60
+ * hidden input, `input` on the `<input type="file">`. */
61
+ export type FileDropAttributes<ParentMessage> = Readonly<{
62
+ /** Attributes for the outer drop zone element (typically a `<label>`):
63
+ * drag-and-drop handlers, `data-drag-over` while a drag hovers, and
64
+ * `data-disabled` when disabled. */
65
+ root: ReadonlyArray<Attribute<ParentMessage>>;
66
+ /** Attributes for a hidden `<input type="file">` nested inside the
67
+ * root: file-change handler, `type`, `id`, `multiple`, `accept`, and
68
+ * `sr-only` class. */
69
+ input: ReadonlyArray<Attribute<ParentMessage>>;
70
+ }>;
71
+ /** Configuration for rendering a file-drop with `view`.
72
+ *
73
+ * The `ParentMessage` type parameter is your parent's Message type, not
74
+ * FileDrop's. `toParentMessage` receives a FileDrop message and returns
75
+ * your parent message. */
76
+ export type ViewConfig<ParentMessage> = Readonly<{
77
+ model: Model;
78
+ toParentMessage: (message: Message) => ParentMessage;
79
+ toView: (attributes: FileDropAttributes<ParentMessage>) => Html;
80
+ /** List of accepted MIME types or file extensions (e.g.
81
+ * `['application/pdf', '.doc']`). Joined with commas and forwarded to
82
+ * the hidden input's `accept` attribute. Omit or pass an empty array
83
+ * to accept any file type. */
84
+ accept?: ReadonlyArray<string>;
85
+ /** When true, the hidden input accepts multiple files per selection. */
86
+ multiple?: boolean;
87
+ /** When true, drag handlers are stripped from the root and the input
88
+ * is disabled. Styling can react via `data-disabled` on the root. */
89
+ isDisabled?: boolean;
90
+ }>;
91
+ /** Renders an accessible file-drop zone by building attribute groups for
92
+ * a `<label>`-wrapped hidden file input. The consumer's `toView` callback
93
+ * composes those groups into concrete markup. The component owns the
94
+ * drag-state and file-arrival messaging; the consumer owns the visual
95
+ * rendering. */
96
+ export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
97
+ /** Creates a memoized file-drop view. Static config is captured in a
98
+ * closure; only `model` and `toParentMessage` are compared per render via
99
+ * `createLazy`. */
100
+ export declare const lazy: <ParentMessage>(staticConfig: Omit<ViewConfig<ParentMessage>, "model" | "toParentMessage">) => ((model: Model, toParentMessage: ViewConfig<ParentMessage>["toParentMessage"]) => Html);
101
+ export {};
102
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources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