@foldkit/ui 0.142.1 → 0.144.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.
@@ -29,7 +29,7 @@ export type Model = typeof Model.Type;
29
29
  export type InitConfig = BaseInitConfig;
30
30
  /** Creates an initial multi-select combobox model from a config. Defaults to closed with no active item and an empty input. */
31
31
  export declare const init: (config: InitConfig) => Model;
32
- /** Processes a combobox message and returns the next model, commands, and optional OutMessage. Stays open on selection (multi-select behavior); emits a `Selected({ value })` OutMessage the parent folds by toggling the value's membership, and `ClearedSelection` when a nullable combobox closes with an empty input. The multi-select input always rests empty on close, so it ignores the message's `restingInputValue`; multi consumers pass `''`. */
32
+ /** Processes a combobox message and returns the next model, commands, and optional OutMessage. Stays open on selection (multi-select behavior) and emits a `Selected({ value })` OutMessage the parent folds by toggling the value's membership. Closing never emits `ClearedSelection`: the multi-select input rests empty by design, so an empty input on close carries no intent to clear. Clearing a multi-select is toggling its values off, one `Selected` at a time. The input always rests empty on close, so this ignores the message's `restingInputValue`; multi consumers pass `''`. */
33
33
  export declare const update: (model: {
34
34
  readonly id: string;
35
35
  readonly isOpen: boolean;
@@ -88,9 +88,11 @@ export declare const update: (model: {
88
88
  } | {
89
89
  readonly _tag: "Closed";
90
90
  readonly restingInputValue: string;
91
+ readonly isClearable: boolean;
91
92
  } | {
92
93
  readonly _tag: "BlurredInput";
93
94
  readonly restingInputValue: string;
95
+ readonly isClearable: boolean;
94
96
  } | {
95
97
  readonly _tag: "ActivatedItem";
96
98
  readonly index: number;
@@ -113,6 +115,8 @@ export declare const update: (model: {
113
115
  } | {
114
116
  readonly _tag: "RequestedItemClick";
115
117
  readonly index: number;
118
+ } | {
119
+ readonly _tag: "SuppressedItemCommit";
116
120
  } | {
117
121
  readonly _tag: "CompletedFocusInput";
118
122
  } | {
@@ -125,6 +129,7 @@ export declare const update: (model: {
125
129
  } | {
126
130
  readonly _tag: "PressedToggleButton";
127
131
  readonly restingInputValue: string;
132
+ readonly isClearable: boolean;
128
133
  } | {
129
134
  readonly _tag: "CompletedAnchorCombobox";
130
135
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../src/combobox/multi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE/C,OAAO,KAAK,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE5D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAGnB,KAAK,OAAO,EAEZ,KAAK,UAAU,EAOhB,MAAM,aAAa,CAAA;AAIpB,qOAAqO;AACrO,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;EAEhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,mOAAmO;AACnO,MAAM,MAAM,UAAU,GAAG,cAAc,CAAA;AAEvC,+HAA+H;AAC/H,eAAO,MAAM,IAAI,GAAI,QAAQ,UAAU,KAAG,KAAyB,CAAA;AAInE,6bAA6b;AAC7b,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAyBjB,CAAA;AAEF,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAA;AAE7C;wFACwF;AACxF,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,KAAG,YAC4B,CAAA;AAEhE;;sEAEsE;AACtE,eAAO,MAAM,KAAK,GAAI,OAAO,KAAK,KAAG,YACa,CAAA;AAElD;wEACwE;AACxE,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,EAAE,MAAM,MAAM,KAAG,YAC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andViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
2
  import { Option, Schema as S } from 'effect';
3
3
  import { evo } from 'foldkit/struct';
4
- import { BaseModel, ClearedSelection, Closed, Opened, SelectedItem, Selected as SharedSelected, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared.js';
4
+ import { BaseModel, Closed, Opened, SelectedItem, Selected as SharedSelected, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared.js';
5
5
  // MODEL
6
6
  /** Schema for the multi-select combobox's private interaction state (open/closed status, active item, activation trigger, typed input value). The selection is owned by the parent and passed in via `ViewInputs.selectedValues`. */
7
7
  export const Model = S.Struct({
@@ -10,20 +10,12 @@ export const Model = S.Struct({
10
10
  /** Creates an initial multi-select combobox model from a config. Defaults to closed with no active item and an empty input. */
11
11
  export const init = (config) => __foldkitBrandViewResult((baseInit(config)), "@foldkit/ui/combobox/multi.js#init");
12
12
  // UPDATE
13
- /** Processes a combobox message and returns the next model, commands, and optional OutMessage. Stays open on selection (multi-select behavior); emits a `Selected({ value })` OutMessage the parent folds by toggling the value's membership, and `ClearedSelection` when a nullable combobox closes with an empty input. The multi-select input always rests empty on close, so it ignores the message's `restingInputValue`; multi consumers pass `''`. */
13
+ /** Processes a combobox message and returns the next model, commands, and optional OutMessage. Stays open on selection (multi-select behavior) and emits a `Selected({ value })` OutMessage the parent folds by toggling the value's membership. Closing never emits `ClearedSelection`: the multi-select input rests empty by design, so an empty input on close carries no intent to clear. Clearing a multi-select is toggling its values off, one `Selected` at a time. The input always rests empty on close, so this ignores the message's `restingInputValue`; multi consumers pass `''`. */
14
14
  export const update = makeUpdate({
15
- handleClose: model => {
16
- if (model.nullable && model.inputValue === '') {
17
- return __foldkitBrandViewResult(([
18
- evo(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/multi.js#inputValue") }),
19
- Option.some(ClearedSelection()),
20
- ]), "@foldkit/ui/combobox/multi.js#handleClose");
21
- }
22
- return __foldkitBrandViewResult(([
23
- evo(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/multi.js#inputValue~2") }),
24
- Option.none(),
25
- ]), "@foldkit/ui/combobox/multi.js#handleClose");
26
- },
15
+ handleClose: model => __foldkitBrandViewResult(([
16
+ evo(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/multi.js#inputValue") }),
17
+ Option.none(),
18
+ ]), "@foldkit/ui/combobox/multi.js#handleClose"),
27
19
  handleSelectedItem: (model, item) => __foldkitBrandViewResult(([
28
20
  model,
29
21
  [],
@@ -40,7 +32,7 @@ export const open = (model) => __foldkitBrandViewResult((update(model, Opened({
40
32
  /** Programmatically closes the combobox, updating the model and returning
41
33
  * focus and modal commands. The multi-select input always rests empty on
42
34
  * close. Use this in domain-event handlers to close the combobox. */
43
- export const close = (model) => __foldkitBrandViewResult((update(model, Closed({ restingInputValue: '' }))), "@foldkit/ui/combobox/multi.js#close");
35
+ export const close = (model) => __foldkitBrandViewResult((update(model, Closed({ restingInputValue: '', isClearable: true }))), "@foldkit/ui/combobox/multi.js#close");
44
36
  /** Programmatically activates an item in the multi-select combobox. Emits
45
37
  * `Selected({ value })`; the parent toggles the value's membership. */
46
38
  export const selectItem = (model, item) => __foldkitBrandViewResult((update(model, SelectedItem({ item, displayText: item, wasSelected: false }))), "@foldkit/ui/combobox/multi.js#selectItem");
@@ -56,6 +48,6 @@ export const create = () => {
56
48
  update: typedUpdate,
57
49
  selectItem: (model, item) => __foldkitBrandViewResult((typedUpdate(model, SelectedItem({ item, displayText: item, wasSelected: false }))), "@foldkit/ui/combobox/multi.js#selectItem~2"),
58
50
  open: model => __foldkitBrandViewResult((typedUpdate(model, Opened({ maybeActiveItemIndex: Option.none() }))), "@foldkit/ui/combobox/multi.js#open~2"),
59
- close: model => __foldkitBrandViewResult((typedUpdate(model, Closed({ restingInputValue: '' }))), "@foldkit/ui/combobox/multi.js#close~2"),
51
+ close: model => __foldkitBrandViewResult((typedUpdate(model, Closed({ restingInputValue: '', isClearable: true }))), "@foldkit/ui/combobox/multi.js#close~2"),
60
52
  }), "@foldkit/ui/combobox/multi.js#create");
61
53
  };
@@ -1,6 +1,6 @@
1
1
  export { init, create, Model } from './single.js';
2
2
  export { inputId } from './shared.js';
3
- export { Message, OutMessage, Selected, ClearedSelection, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedInertOthers, CompletedRestoreInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorCombobox, CompletedAttachComboboxPreventBlur, CompletedAttachComboboxSelectOnFocus, CompletedPortalComboboxBackdrop, AnchorCombobox, AttachComboboxPreventBlur, AttachComboboxSelectOnFocus, PortalComboboxBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, Opened, Closed, BlurredInput, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, UpdatedInputValue, PressedToggleButton, } from './shared.js';
3
+ export { Message, OutMessage, Selected, ClearedSelection, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedInertOthers, CompletedRestoreInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorCombobox, CompletedAttachComboboxPreventBlur, CompletedAttachComboboxSelectOnFocus, CompletedPortalComboboxBackdrop, AnchorCombobox, AttachComboboxPreventBlur, AttachComboboxSelectOnFocus, PortalComboboxBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, Opened, Closed, BlurredInput, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, SuppressedItemCommit, UpdatedInputValue, PressedToggleButton, } from './shared.js';
4
4
  export type { ActivationTrigger, ItemConfig, GroupHeading, BaseViewInputsCommon, } from './shared.js';
5
5
  export type { Bundle, InitConfig, ViewInputs } from './single.js';
6
6
  export type { AnchorConfig } from '../anchor.js';
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/combobox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EACL,OAAO,EACP,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,EAC/B,cAAc,EACd,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,4BAA4B,EAC5B,MAAM,EACN,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,oBAAoB,GACrB,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEjE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/combobox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EACL,OAAO,EACP,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,EAC/B,cAAc,EACd,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,4BAA4B,EAC5B,MAAM,EACN,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,oBAAoB,GACrB,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEjE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA"}
@@ -1,4 +1,4 @@
1
1
  export { init, create, Model } from './single.js';
2
2
  export { inputId } from './shared.js';
3
- export { Message, OutMessage, Selected, ClearedSelection, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedInertOthers, CompletedRestoreInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorCombobox, CompletedAttachComboboxPreventBlur, CompletedAttachComboboxSelectOnFocus, CompletedPortalComboboxBackdrop, AnchorCombobox, AttachComboboxPreventBlur, AttachComboboxSelectOnFocus, PortalComboboxBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, Opened, Closed, BlurredInput, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, UpdatedInputValue, PressedToggleButton, } from './shared.js';
3
+ export { Message, OutMessage, Selected, ClearedSelection, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedInertOthers, CompletedRestoreInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorCombobox, CompletedAttachComboboxPreventBlur, CompletedAttachComboboxSelectOnFocus, CompletedPortalComboboxBackdrop, AnchorCombobox, AttachComboboxPreventBlur, AttachComboboxSelectOnFocus, PortalComboboxBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, Opened, Closed, BlurredInput, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, SuppressedItemCommit, UpdatedInputValue, PressedToggleButton, } from './shared.js';
4
4
  export * as Multi from './multiPublic.js';
@@ -52,13 +52,15 @@ export declare const baseInit: (config: BaseInitConfig) => BaseModel;
52
52
  export declare const Opened: import("foldkit/schema").CallableTaggedStruct<"Opened", {
53
53
  maybeActiveItemIndex: S.Option<S.Number>;
54
54
  }>;
55
- /** Sent when the combobox closes via Escape key or backdrop click. `restingInputValue` is what the input returns to on close (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. */
55
+ /** Sent when the combobox closes via Escape key or backdrop click. `restingInputValue` is what the input returns to on close (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. `isClearable` carries whether this close may emit `ClearedSelection`, which a read-only combobox denies; the view holds `isReadOnly` and the update does not. */
56
56
  export declare const Closed: import("foldkit/schema").CallableTaggedStruct<"Closed", {
57
57
  restingInputValue: S.String;
58
+ isClearable: S.Boolean;
58
59
  }>;
59
- /** Sent when the combobox input loses focus. `restingInputValue` is what the input returns to on close (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. */
60
+ /** Sent when the combobox input loses focus. `restingInputValue` is what the input returns to on close (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. `isClearable` carries whether this close may emit `ClearedSelection`, which a read-only combobox denies. */
60
61
  export declare const BlurredInput: import("foldkit/schema").CallableTaggedStruct<"BlurredInput", {
61
62
  restingInputValue: S.String;
63
+ isClearable: S.Boolean;
62
64
  }>;
63
65
  /** Sent when an item is highlighted via arrow keys or mouse hover. Includes activation trigger and optional immediate selection info. */
64
66
  export declare const ActivatedItem: import("foldkit/schema").CallableTaggedStruct<"ActivatedItem", {
@@ -86,6 +88,8 @@ export declare const MovedPointerOverItem: import("foldkit/schema").CallableTagg
86
88
  export declare const RequestedItemClick: import("foldkit/schema").CallableTaggedStruct<"RequestedItemClick", {
87
89
  index: S.Number;
88
90
  }>;
91
+ /** Sent when Enter is pressed on the active item of a read-only combobox. Update no-ops; the Message exists so the keydown handler returns `Option.some` and calls `preventDefault`, which stops a surrounding form from submitting, and so the keypress stays visible for DevTools. */
92
+ export declare const SuppressedItemCommit: import("foldkit/schema").CallableTaggedStruct<"SuppressedItemCommit", {}>;
89
93
  /** Sent when the scroll lock command completes. */
90
94
  export declare const CompletedLockScroll: import("foldkit/schema").CallableTaggedStruct<"CompletedLockScroll", {}>;
91
95
  /** Sent when the scroll unlock command completes. */
@@ -116,9 +120,10 @@ export declare const GotAnimationMessage: import("foldkit/schema").CallableTagge
116
120
  export declare const UpdatedInputValue: import("foldkit/schema").CallableTaggedStruct<"UpdatedInputValue", {
117
121
  value: S.String;
118
122
  }>;
119
- /** Sent when the optional toggle button is clicked. `restingInputValue` is what the input returns to when the press closes the combobox (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. */
123
+ /** Sent when the optional toggle button is clicked. `restingInputValue` is what the input returns to when the press closes the combobox (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. `isClearable` carries whether a close from this press may emit `ClearedSelection`, which a read-only combobox denies. */
120
124
  export declare const PressedToggleButton: import("foldkit/schema").CallableTaggedStruct<"PressedToggleButton", {
121
125
  restingInputValue: S.String;
126
+ isClearable: S.Boolean;
122
127
  }>;
123
128
  /** Union of all messages the combobox component can produce. */
124
129
  export declare const Message: S.Union<[
@@ -130,6 +135,7 @@ export declare const Message: S.Union<[
130
135
  typeof SelectedItem,
131
136
  typeof MovedPointerOverItem,
132
137
  typeof RequestedItemClick,
138
+ typeof SuppressedItemCommit,
133
139
  typeof CompletedLockScroll,
134
140
  typeof CompletedUnlockScroll,
135
141
  typeof CompletedInertOthers,
@@ -153,6 +159,7 @@ export type DeactivatedItem = typeof DeactivatedItem.Type;
153
159
  export type SelectedItem = typeof SelectedItem.Type;
154
160
  export type MovedPointerOverItem = typeof MovedPointerOverItem.Type;
155
161
  export type RequestedItemClick = typeof RequestedItemClick.Type;
162
+ export type SuppressedItemCommit = typeof SuppressedItemCommit.Type;
156
163
  export type CompletedLockScroll = typeof CompletedLockScroll.Type;
157
164
  export type CompletedUnlockScroll = typeof CompletedUnlockScroll.Type;
158
165
  export type CompletedInertOthers = typeof CompletedInertOthers.Type;
@@ -260,7 +267,7 @@ export declare const DetectMovementOrAnimationEnd: Command.CommandDefinitionWith
260
267
  }, never, never>>;
261
268
  /** Creates a combobox update function from variant-specific handlers. Shared logic (open, close, activate, transition) is handled internally; only close, selection, and immediate-activation behavior varies by variant. */
262
269
  export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
263
- handleClose: (model: Model, restingInputValue: string) => readonly [Model, Option.Option<OutMessage>];
270
+ handleClose: (model: Model, restingInputValue: string, isClearable: boolean) => readonly [Model, Option.Option<OutMessage>];
264
271
  handleSelectedItem: (model: Model, item: string, displayText: string, wasSelected: boolean, context: SelectedItemContext<Model>) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage>];
265
272
  handleImmediateActivation: (model: Model, item: string) => readonly [Model, Option.Option<OutMessage>];
266
273
  }>) => (model: Model, message: Message) => readonly [Model, readonly Readonly<{
@@ -281,9 +288,11 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
281
288
  } | {
282
289
  readonly _tag: "Closed";
283
290
  readonly restingInputValue: string;
291
+ readonly isClearable: boolean;
284
292
  } | {
285
293
  readonly _tag: "BlurredInput";
286
294
  readonly restingInputValue: string;
295
+ readonly isClearable: boolean;
287
296
  } | {
288
297
  readonly _tag: "ActivatedItem";
289
298
  readonly index: number;
@@ -306,6 +315,8 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
306
315
  } | {
307
316
  readonly _tag: "RequestedItemClick";
308
317
  readonly index: number;
318
+ } | {
319
+ readonly _tag: "SuppressedItemCommit";
309
320
  } | {
310
321
  readonly _tag: "CompletedFocusInput";
311
322
  } | {
@@ -318,6 +329,7 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
318
329
  } | {
319
330
  readonly _tag: "PressedToggleButton";
320
331
  readonly restingInputValue: string;
332
+ readonly isClearable: boolean;
321
333
  } | {
322
334
  readonly _tag: "CompletedAnchorCombobox";
323
335
  } | {
@@ -404,6 +416,9 @@ export type BaseViewInputsCommon<Item extends string> = Readonly<{
404
416
  itemToConfig: (item: Item, context: Readonly<{
405
417
  isActive: boolean;
406
418
  isDisabled: boolean;
419
+ /** Mirrors the view input of the same name, so `itemToConfig` can
420
+ * style items for read-only state without closing over `viewInputs`. */
421
+ isReadOnly: boolean;
407
422
  isSelected: boolean;
408
423
  }>) => ItemConfig;
409
424
  itemToValue: (item: Item, index: number) => Item;
@@ -426,7 +441,21 @@ export type BaseViewInputsCommon<Item extends string> = Readonly<{
426
441
  buttonClassName?: string;
427
442
  buttonAttributes?: ReadonlyArray<ChildAttribute>;
428
443
  formName?: string;
444
+ /** Marks the Combobox unavailable with `aria-disabled="true"` on the input
445
+ * and the toggle button and `data-disabled` on both plus the wrapper, and
446
+ * removes their handlers so the dropdown cannot be opened. */
429
447
  isDisabled?: boolean;
448
+ /** Prevents committing a selection while exposing read-only semantics with
449
+ * the native `readonly` attribute plus `aria-readonly="true"` on the input,
450
+ * `aria-readonly="true"` on the items panel, and `data-readonly` on the
451
+ * wrapper, input, toggle button, items panel, and every item. The Combobox
452
+ * still opens, navigates, and closes, and the input still takes focus and
453
+ * allows text selection and copying. Typing is frozen, since the input
454
+ * value doubles as the display of the selection. Independent of
455
+ * `isDisabled`: setting both emits both attribute sets, and `isDisabled`
456
+ * still wins for interaction, since it drops every handler, so a Combobox
457
+ * that is both read-only and disabled cannot be opened at all. */
458
+ isReadOnly?: boolean;
430
459
  isInvalid?: boolean;
431
460
  openOnFocus?: boolean;
432
461
  itemGroupKey?: (item: Item, index: number) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/combobox/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EAEN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAExD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAEtC,OAAO,EAAE,KAAK,IAAI,IAAI,YAAY,EAAc,MAAM,kBAAkB,CAAA;AAGxE,OAAO,EAAE,YAAY,EAAuC,MAAM,cAAc,CAAA;AAchF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAK7C,OAAO,EAAE,eAAe,EAAE,CAAA;AAI1B,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,8CAAsC,CAAA;AACpE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,oKAAoK;AACpK,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;EAepB,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,EAAE,EAAE,MAAM,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IAAI,SAAS,MAAM,IAAI,oBAAoB,CAAC,IAAI,CAAC,GAC1E,QAAQ,CAAC;IACP;;sCAEkC;IAClC,cAAc,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;CACpC,CAAC,CAAA;AAIJ,qFAAqF;AACrF,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAA;CAC7B,CAAC,CAAA;AAEF,2NAA2N;AAC3N,eAAO,MAAM,QAAQ,GAAI,KAAK,SAAS,SAAS,EAAE,UAAU,YAAY,MA2hB9D,IAAI,SAAS,MAAM,OAEN,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,CACvE,CAAA"}
@@ -56,11 +56,15 @@ export const baseInit = (config) => (__foldkitBrandViewResult(({
56
56
  export const Opened = m('Opened', {
57
57
  maybeActiveItemIndex: S.Option(S.Number),
58
58
  });
59
- /** Sent when the combobox closes via Escape key or backdrop click. `restingInputValue` is what the input returns to on close (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. */
60
- export const Closed = m('Closed', { restingInputValue: S.String });
61
- /** Sent when the combobox input loses focus. `restingInputValue` is what the input returns to on close (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. */
59
+ /** Sent when the combobox closes via Escape key or backdrop click. `restingInputValue` is what the input returns to on close (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. `isClearable` carries whether this close may emit `ClearedSelection`, which a read-only combobox denies; the view holds `isReadOnly` and the update does not. */
60
+ export const Closed = m('Closed', {
61
+ restingInputValue: S.String,
62
+ isClearable: S.Boolean,
63
+ });
64
+ /** Sent when the combobox input loses focus. `restingInputValue` is what the input returns to on close (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. `isClearable` carries whether this close may emit `ClearedSelection`, which a read-only combobox denies. */
62
65
  export const BlurredInput = m('BlurredInput', {
63
66
  restingInputValue: S.String,
67
+ isClearable: S.Boolean,
64
68
  });
65
69
  /** Sent when an item is highlighted via arrow keys or mouse hover. Includes activation trigger and optional immediate selection info. */
66
70
  export const ActivatedItem = m('ActivatedItem', {
@@ -86,6 +90,8 @@ export const MovedPointerOverItem = m('MovedPointerOverItem', {
86
90
  export const RequestedItemClick = m('RequestedItemClick', {
87
91
  index: S.Number,
88
92
  });
93
+ /** Sent when Enter is pressed on the active item of a read-only combobox. Update no-ops; the Message exists so the keydown handler returns `Option.some` and calls `preventDefault`, which stops a surrounding form from submitting, and so the keypress stays visible for DevTools. */
94
+ export const SuppressedItemCommit = m('SuppressedItemCommit');
89
95
  /** Sent when the scroll lock command completes. */
90
96
  export const CompletedLockScroll = m('CompletedLockScroll');
91
97
  /** Sent when the scroll unlock command completes. */
@@ -116,9 +122,10 @@ export const GotAnimationMessage = m('GotAnimationMessage', {
116
122
  export const UpdatedInputValue = m('UpdatedInputValue', {
117
123
  value: S.String,
118
124
  });
119
- /** Sent when the optional toggle button is clicked. `restingInputValue` is what the input returns to when the press closes the combobox (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. */
125
+ /** Sent when the optional toggle button is clicked. `restingInputValue` is what the input returns to when the press closes the combobox (the parent-owned selection's display text, or empty), computed by the view from `ViewInputs.restingInputValue`. `isClearable` carries whether a close from this press may emit `ClearedSelection`, which a read-only combobox denies. */
120
126
  export const PressedToggleButton = m('PressedToggleButton', {
121
127
  restingInputValue: S.String,
128
+ isClearable: S.Boolean,
122
129
  });
123
130
  /** Union of all messages the combobox component can produce. */
124
131
  export const Message = S.Union([
@@ -130,6 +137,7 @@ export const Message = S.Union([
130
137
  SelectedItem,
131
138
  MovedPointerOverItem,
132
139
  RequestedItemClick,
140
+ SuppressedItemCommit,
133
141
  CompletedLockScroll,
134
142
  CompletedUnlockScroll,
135
143
  CompletedInertOthers,
@@ -284,8 +292,8 @@ export const makeUpdate = (handlers) => {
284
292
  Option.none(),
285
293
  ]), "@foldkit/ui/combobox/shared.js#openCombobox");
286
294
  };
287
- const closeCombobox = (baseModel, commands, restingInputValue) => {
288
- const [closed, maybeCloseOutMessage] = handlers.handleClose(baseModel, restingInputValue);
295
+ const closeCombobox = (baseModel, commands, restingInputValue, isClearable) => {
296
+ const [closed, maybeCloseOutMessage] = handlers.handleClose(baseModel, restingInputValue, isClearable);
289
297
  if (model.isAnimated) {
290
298
  const [nextModel, animationCommands] = foldAnimation(closed, AnimationHid());
291
299
  return __foldkitBrandViewResult(([
@@ -296,7 +304,7 @@ export const makeUpdate = (handlers) => {
296
304
  }
297
305
  return __foldkitBrandViewResult(([closed, commands, maybeCloseOutMessage]), "@foldkit/ui/combobox/shared.js#closeCombobox");
298
306
  };
299
- return __foldkitBrandViewResult((M.value(message).pipe(withUpdateReturn, M.tag('CompletedLockScroll', 'CompletedUnlockScroll', 'CompletedInertOthers', 'CompletedRestoreInert', 'CompletedFocusInput', 'CompletedScrollIntoView', 'CompletedClickItem', 'CompletedAnchorCombobox', 'CompletedAttachComboboxPreventBlur', 'CompletedAttachComboboxSelectOnFocus', 'CompletedPortalComboboxBackdrop', () => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/combobox/shared.js#anonymous~3")), M.tagsExhaustive({
307
+ return __foldkitBrandViewResult((M.value(message).pipe(withUpdateReturn, M.tag('CompletedLockScroll', 'CompletedUnlockScroll', 'CompletedInertOthers', 'CompletedRestoreInert', 'CompletedFocusInput', 'CompletedScrollIntoView', 'CompletedClickItem', 'SuppressedItemCommit', 'CompletedAnchorCombobox', 'CompletedAttachComboboxPreventBlur', 'CompletedAttachComboboxSelectOnFocus', 'CompletedPortalComboboxBackdrop', () => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/combobox/shared.js#anonymous~3")), M.tagsExhaustive({
300
308
  Opened: ({ maybeActiveItemIndex }) => __foldkitBrandViewResult((openCombobox(constrainedEvo(model, {
301
309
  maybeActiveItemIndex: () => __foldkitBrandViewResult((maybeActiveItemIndex), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~2"),
302
310
  activationTrigger: () => __foldkitBrandViewResult((Option.match(maybeActiveItemIndex, {
@@ -309,11 +317,11 @@ export const makeUpdate = (handlers) => {
309
317
  // render (a sub-frame blur after a selection already closed the
310
318
  // combobox) cannot rewrite inputValue with an outdated
311
319
  // restingInputValue or re-emit ClearedSelection while closed.
312
- Closed: ({ restingInputValue }) => __foldkitBrandViewResult((model.isOpen
313
- ? closeCombobox(model, closeWithFocusCommands, restingInputValue)
320
+ Closed: ({ restingInputValue, isClearable }) => __foldkitBrandViewResult((model.isOpen
321
+ ? closeCombobox(model, closeWithFocusCommands, restingInputValue, isClearable)
314
322
  : [model, [], Option.none()]), "@foldkit/ui/combobox/shared.js#Closed"),
315
- BlurredInput: ({ restingInputValue }) => __foldkitBrandViewResult((model.isOpen
316
- ? closeCombobox(model, closeWithoutFocusCommands, restingInputValue)
323
+ BlurredInput: ({ restingInputValue, isClearable }) => __foldkitBrandViewResult((model.isOpen
324
+ ? closeCombobox(model, closeWithoutFocusCommands, restingInputValue, isClearable)
317
325
  : [model, [], Option.none()]), "@foldkit/ui/combobox/shared.js#BlurredInput"),
318
326
  ActivatedItem: ({ index, activationTrigger, maybeImmediateSelection, }) => {
319
327
  const highlightedModel = constrainedEvo(model, {
@@ -384,9 +392,9 @@ export const makeUpdate = (handlers) => {
384
392
  maybeLastPointerPosition: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#maybeLastPointerPosition~4"),
385
393
  }))), "@foldkit/ui/combobox/shared.js#UpdatedInputValue");
386
394
  },
387
- PressedToggleButton: ({ restingInputValue }) => {
395
+ PressedToggleButton: ({ restingInputValue, isClearable }) => {
388
396
  if (model.isOpen) {
389
- return __foldkitBrandViewResult((closeCombobox(model, closeWithFocusCommands, restingInputValue)), "@foldkit/ui/combobox/shared.js#PressedToggleButton");
397
+ return __foldkitBrandViewResult((closeCombobox(model, closeWithFocusCommands, restingInputValue, isClearable)), "@foldkit/ui/combobox/shared.js#PressedToggleButton");
390
398
  }
391
399
  const [nextModel, commands] = openCombobox(constrainedEvo(model, {
392
400
  maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~8"),
@@ -472,7 +480,7 @@ export const PortalComboboxBackdrop = Mount.define('PortalComboboxBackdrop', Com
472
480
  export const makeView = (behavior) => {
473
481
  const impl = defineView((model, viewInputs, h) => {
474
482
  const { id, isOpen, immediate, animation: { transitionState }, maybeActiveItemIndex, } = model;
475
- const { items, selectedValues, restingInputValue, itemToConfig, itemToValue, itemToDisplayText, isItemDisabled, inputClassName, inputAttributes = [], inputPlaceholder, inputWrapperClassName, inputWrapperAttributes = [], itemsClassName, itemsAttributes = [], itemsScrollClassName, itemsScrollAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], buttonContent, buttonClassName, buttonAttributes = [], formName, isDisabled, isInvalid, openOnFocus, itemGroupKey, groupToHeading, groupClassName, groupAttributes = [], separatorClassName, separatorAttributes = [], anchor = {}, ariaLabel, ariaLabelledBy, } = viewInputs;
483
+ const { items, selectedValues, restingInputValue, itemToConfig, itemToValue, itemToDisplayText, isItemDisabled, inputClassName, inputAttributes = [], inputPlaceholder, inputWrapperClassName, inputWrapperAttributes = [], itemsClassName, itemsAttributes = [], itemsScrollClassName, itemsScrollAttributes = [], backdropClassName, backdropAttributes = [], className, attributes = [], buttonContent, buttonClassName, buttonAttributes = [], formName, isDisabled, isReadOnly = false, isInvalid, openOnFocus, itemGroupKey, groupToHeading, groupClassName, groupAttributes = [], separatorClassName, separatorAttributes = [], anchor = {}, ariaLabel, ariaLabelledBy, } = viewInputs;
476
484
  const resolveInputLabel = () => {
477
485
  if (Predicate.isNotUndefined(ariaLabel)) {
478
486
  return __foldkitBrandViewResult(([h.AriaLabel(ariaLabel)]), "@foldkit/ui/combobox/shared.js#resolveInputLabel");
@@ -508,43 +516,58 @@ export const makeView = (behavior) => {
508
516
  const firstEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabledAtIndex)(0, 1);
509
517
  const lastEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabledAtIndex)(items.length - 1, -1);
510
518
  const resolveActiveIndex = keyToIndex('ArrowDown', 'ArrowUp', items.length, Option.getOrElse(maybeActiveItemIndex, () => __foldkitBrandViewResult((-1), "@foldkit/ui/combobox/shared.js#anonymous~32")), isDisabledAtIndex);
511
- const resolveImmediateSelection = (targetIndex) => __foldkitBrandViewResult((pipe(OptionExt.when(immediate, targetIndex), Option.flatMap(index => __foldkitBrandViewResult((Array.get(items, index)), "@foldkit/ui/combobox/shared.js#anonymous~33")), Option.map(targetItem => (__foldkitBrandViewResult(({
512
- item: itemToValue(targetItem, targetIndex),
513
- }), "@foldkit/ui/combobox/shared.js#anonymous~34"))))), "@foldkit/ui/combobox/shared.js#resolveImmediateSelection");
519
+ const resolveImmediateSelection = (targetIndex) => {
520
+ if (isReadOnly) {
521
+ return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#resolveImmediateSelection");
522
+ }
523
+ else {
524
+ return __foldkitBrandViewResult((pipe(OptionExt.when(immediate, targetIndex), Option.flatMap(index => __foldkitBrandViewResult((Array.get(items, index)), "@foldkit/ui/combobox/shared.js#anonymous~33")), Option.map(targetItem => (__foldkitBrandViewResult(({
525
+ item: itemToValue(targetItem, targetIndex),
526
+ }), "@foldkit/ui/combobox/shared.js#anonymous~34"))))), "@foldkit/ui/combobox/shared.js#resolveImmediateSelection");
527
+ }
528
+ };
529
+ const resolveCommitMessage = () => {
530
+ if (isReadOnly) {
531
+ return __foldkitBrandViewResult((Option.as(maybeActiveItemIndex, SuppressedItemCommit())), "@foldkit/ui/combobox/shared.js#resolveCommitMessage");
532
+ }
533
+ else {
534
+ return __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((RequestedItemClick({ index })), "@foldkit/ui/combobox/shared.js#anonymous~35"))), "@foldkit/ui/combobox/shared.js#resolveCommitMessage");
535
+ }
536
+ };
514
537
  const handleInputKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('ArrowDown', () => {
515
538
  if (!isOpen) {
516
539
  return __foldkitBrandViewResult((Option.some(Opened({
517
540
  maybeActiveItemIndex: Option.some(firstEnabledIndex),
518
- }))), "@foldkit/ui/combobox/shared.js#anonymous~35");
541
+ }))), "@foldkit/ui/combobox/shared.js#anonymous~36");
519
542
  }
520
543
  const targetIndex = resolveActiveIndex('ArrowDown');
521
544
  return __foldkitBrandViewResult((Option.some(ActivatedItem({
522
545
  index: targetIndex,
523
546
  activationTrigger: 'Keyboard',
524
547
  maybeImmediateSelection: resolveImmediateSelection(targetIndex),
525
- }))), "@foldkit/ui/combobox/shared.js#anonymous~35");
548
+ }))), "@foldkit/ui/combobox/shared.js#anonymous~36");
526
549
  }), M.when('ArrowUp', () => {
527
550
  if (!isOpen) {
528
551
  return __foldkitBrandViewResult((Option.some(Opened({
529
552
  maybeActiveItemIndex: Option.some(lastEnabledIndex),
530
- }))), "@foldkit/ui/combobox/shared.js#anonymous~36");
553
+ }))), "@foldkit/ui/combobox/shared.js#anonymous~37");
531
554
  }
532
555
  const targetIndex = resolveActiveIndex('ArrowUp');
533
556
  return __foldkitBrandViewResult((Option.some(ActivatedItem({
534
557
  index: targetIndex,
535
558
  activationTrigger: 'Keyboard',
536
559
  maybeImmediateSelection: resolveImmediateSelection(targetIndex),
537
- }))), "@foldkit/ui/combobox/shared.js#anonymous~36");
560
+ }))), "@foldkit/ui/combobox/shared.js#anonymous~37");
538
561
  }), M.when('Enter', () => {
539
562
  if (!isOpen) {
540
- return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~37");
563
+ return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~38");
541
564
  }
542
- return __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((RequestedItemClick({ index })), "@foldkit/ui/combobox/shared.js#anonymous~38"))), "@foldkit/ui/combobox/shared.js#anonymous~37");
565
+ return __foldkitBrandViewResult((resolveCommitMessage()), "@foldkit/ui/combobox/shared.js#anonymous~38");
543
566
  }), M.when('Escape', () => {
544
567
  if (!isOpen) {
545
568
  return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~39");
546
569
  }
547
- return __foldkitBrandViewResult((Option.some(Closed({ restingInputValue }))), "@foldkit/ui/combobox/shared.js#anonymous~39");
570
+ return __foldkitBrandViewResult((Option.some(Closed({ restingInputValue, isClearable: !isReadOnly }))), "@foldkit/ui/combobox/shared.js#anonymous~39");
548
571
  }), M.whenOr('Home', 'End', () => {
549
572
  if (!isOpen) {
550
573
  return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~40");
@@ -560,6 +583,9 @@ export const makeView = (behavior) => {
560
583
  onNone: () => __foldkitBrandViewResult(([]), "@foldkit/ui/combobox/shared.js#onNone~3"),
561
584
  onSome: index => __foldkitBrandViewResult(([h.AriaActiveDescendant(itemId(id, index))]), "@foldkit/ui/combobox/shared.js#onSome~3"),
562
585
  });
586
+ const onInputAttributes = isReadOnly
587
+ ? []
588
+ : [h.OnInput(value => __foldkitBrandViewResult((UpdatedInputValue({ value })), "@foldkit/ui/combobox/shared.js#anonymous~42"))];
563
589
  const resolvedInputAttributes = [
564
590
  h.Id(`${id}-input`),
565
591
  h.Role('combobox'),
@@ -575,13 +601,20 @@ export const makeView = (behavior) => {
575
601
  ...(isDisabled
576
602
  ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]
577
603
  : [
578
- h.OnInput(value => __foldkitBrandViewResult((UpdatedInputValue({ value })), "@foldkit/ui/combobox/shared.js#anonymous~42")),
604
+ ...onInputAttributes,
579
605
  h.OnKeyDownPreventDefault(handleInputKeyDown),
580
- h.OnBlur(BlurredInput({ restingInputValue })),
606
+ h.OnBlur(BlurredInput({ restingInputValue, isClearable: !isReadOnly })),
581
607
  ...(openOnFocus
582
608
  ? [h.OnFocus(Opened({ maybeActiveItemIndex: Option.none() }))]
583
609
  : []),
584
610
  ]),
611
+ ...(isReadOnly
612
+ ? [
613
+ h.Readonly(true),
614
+ h.AriaReadonly(true),
615
+ h.DataAttribute('readonly', ''),
616
+ ]
617
+ : []),
585
618
  ...(isInvalid
586
619
  ? [h.AriaInvalid(true), h.DataAttribute('invalid', '')]
587
620
  : []),
@@ -609,6 +642,9 @@ export const makeView = (behavior) => {
609
642
  ...(behavior.ariaMultiSelectable ? [h.AriaMultiSelectable(true)] : []),
610
643
  h.AriaLabelledBy(`${id}-input`),
611
644
  h.Tabindex(-1),
645
+ ...(isReadOnly
646
+ ? [h.AriaReadonly(true), h.DataAttribute('readonly', '')]
647
+ : []),
612
648
  ...anchorAttributes,
613
649
  ...animationAttributes,
614
650
  ...(itemsClassName ? [h.Class(itemsClassName)] : []),
@@ -621,9 +657,11 @@ export const makeView = (behavior) => {
621
657
  const itemConfig = itemToConfig(item, {
622
658
  isActive: isActiveItem,
623
659
  isDisabled: isDisabledItem,
660
+ isReadOnly,
624
661
  isSelected: isSelectedItem,
625
662
  });
626
- const isInteractive = !isDisabledItem && !isLeaving;
663
+ const isHoverable = !isDisabledItem && !isLeaving;
664
+ const isClickable = isHoverable && !isReadOnly;
627
665
  return __foldkitBrandViewResult((h.keyed('div')(itemId(id, index), [
628
666
  h.Id(itemId(id, index)),
629
667
  h.Role('option'),
@@ -633,13 +671,18 @@ export const makeView = (behavior) => {
633
671
  ...(isDisabledItem
634
672
  ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]
635
673
  : []),
636
- ...(isInteractive
674
+ ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),
675
+ ...(isClickable
637
676
  ? [
638
677
  h.OnClick(SelectedItem({
639
678
  item: itemToValue(item, index),
640
679
  displayText: itemToDisplayText(item, index),
641
680
  wasSelected: isValueSelected(itemToValue(item, index)),
642
681
  })),
682
+ ]
683
+ : []),
684
+ ...(isHoverable
685
+ ? [
643
686
  ...(isActiveItem
644
687
  ? []
645
688
  : [
@@ -699,7 +742,11 @@ export const makeView = (behavior) => {
699
742
  };
700
743
  const backdrop = h.keyed('div')(`${id}-backdrop`, [
701
744
  h.OnMount(PortalComboboxBackdrop()),
702
- ...(isLeaving ? [] : [h.OnClick(Closed({ restingInputValue }))]),
745
+ ...(isLeaving
746
+ ? []
747
+ : [
748
+ h.OnClick(Closed({ restingInputValue, isClearable: !isReadOnly })),
749
+ ]),
703
750
  ...(backdropClassName ? [h.Class(backdropClassName)] : []),
704
751
  ...backdropAttributes,
705
752
  ]);
@@ -735,7 +782,13 @@ export const makeView = (behavior) => {
735
782
  h.Attribute('aria-haspopup', 'listbox'),
736
783
  ...(isDisabled
737
784
  ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]
738
- : [h.OnClick(PressedToggleButton({ restingInputValue }))]),
785
+ : [
786
+ h.OnClick(PressedToggleButton({
787
+ restingInputValue,
788
+ isClearable: !isReadOnly,
789
+ })),
790
+ ]),
791
+ ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),
739
792
  h.OnMount(AttachComboboxPreventBlur()),
740
793
  ...(buttonClassName ? [h.Class(buttonClassName)] : []),
741
794
  ...buttonAttributes,
@@ -757,6 +810,7 @@ export const makeView = (behavior) => {
757
810
  ...attributes,
758
811
  ...(isVisible ? [h.DataAttribute('open', '')] : []),
759
812
  ...(isDisabled ? [h.DataAttribute('disabled', '')] : []),
813
+ ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),
760
814
  ...(isInvalid ? [h.DataAttribute('invalid', '')] : []),
761
815
  ];
762
816
  return __foldkitBrandViewResult((h.div(wrapperAttributes, [
@@ -88,9 +88,11 @@ export declare const update: (model: {
88
88
  } | {
89
89
  readonly _tag: "Closed";
90
90
  readonly restingInputValue: string;
91
+ readonly isClearable: boolean;
91
92
  } | {
92
93
  readonly _tag: "BlurredInput";
93
94
  readonly restingInputValue: string;
95
+ readonly isClearable: boolean;
94
96
  } | {
95
97
  readonly _tag: "ActivatedItem";
96
98
  readonly index: number;
@@ -113,6 +115,8 @@ export declare const update: (model: {
113
115
  } | {
114
116
  readonly _tag: "RequestedItemClick";
115
117
  readonly index: number;
118
+ } | {
119
+ readonly _tag: "SuppressedItemCommit";
116
120
  } | {
117
121
  readonly _tag: "CompletedFocusInput";
118
122
  } | {
@@ -125,6 +129,7 @@ export declare const update: (model: {
125
129
  } | {
126
130
  readonly _tag: "PressedToggleButton";
127
131
  readonly restingInputValue: string;
132
+ readonly isClearable: boolean;
128
133
  } | {
129
134
  readonly _tag: "CompletedAnchorCombobox";
130
135
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../src/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE/C,OAAO,EAAE,KAAK,IAAI,IAAI,YAAY,EAAc,MAAM,kBAAkB,CAAA;AAExE,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAGzB,KAAK,OAAO,EAEZ,KAAK,UAAU,EAOhB,MAAM,aAAa,CAAA;AAIpB,0OAA0O;AAC1O,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;EAEhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,oOAAoO;AACpO,MAAM,MAAM,UAAU,GAAG,cAAc,CAAA;AAEvC,gIAAgI;AAChI,eAAO,MAAM,IAAI,GAAI,QAAQ,UAAU,KAAG,KAAyB,CAAA;AAInE,8RAA8R;AAC9R,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA8BjB,CAAA;AAEF,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aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAChC,CAAA;IACD,IAAI,EAAE,CACJ,KAAK,EAAE,KAAK,KACT,SAAS;QACZ,KAAK;QACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAChC,CAAA;IACD,KAAK,EAAE,CACL,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,MAAM,KACtB,SAAS;QACZ,KAAK;QACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAChC,CAAA;CACF,CAAC,CAAA;AAEF;;;;;wDAKwD;AACxD,eAAO,MAAM,MAAM,GAAI,IAAI,SAAS,MAAM,GAAG,MAAM,OAAK,MAAM,CAAC,IAAI,CAiClE,CAAA"}
@@ -13,8 +13,8 @@ export const init = (config) => __foldkitBrandViewResult((baseInit(config)), "@f
13
13
  // UPDATE
14
14
  /** Processes a combobox message and returns the next model, commands, and optional OutMessage. Closes the combobox on selection (single-select behavior); emits `Selected({ value })` for the parent to store, and `ClearedSelection` when a nullable combobox closes with an empty input. */
15
15
  export const update = makeUpdate({
16
- handleClose: (model, restingInputValue) => {
17
- if (model.nullable && model.inputValue === '') {
16
+ handleClose: (model, restingInputValue, isClearable) => {
17
+ if (isClearable && model.nullable && model.inputValue === '') {
18
18
  return __foldkitBrandViewResult(([
19
19
  evo(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/single.js#inputValue") }),
20
20
  Option.some(ClearedSelection()),
@@ -43,7 +43,7 @@ export const open = (model) => __foldkitBrandViewResult((update(model, Opened({
43
43
  * focus and modal commands. `restingInputValue` is the text the input
44
44
  * returns to (the parent-owned selection's display text, or empty). Use
45
45
  * this in domain-event handlers to close the combobox. */
46
- export const close = (model, restingInputValue) => __foldkitBrandViewResult((update(model, Closed({ restingInputValue }))), "@foldkit/ui/combobox/single.js#close");
46
+ export const close = (model, restingInputValue) => __foldkitBrandViewResult((update(model, Closed({ restingInputValue, isClearable: true }))), "@foldkit/ui/combobox/single.js#close");
47
47
  /** Programmatically selects an item in the single-select combobox, closing
48
48
  * the combobox and emitting `Selected({ value })`. The Submodel treats the
49
49
  * select as fresh (`wasSelected: false`), so the input rests on
@@ -71,6 +71,6 @@ export const create = () => {
71
71
  update: typedUpdate,
72
72
  selectItem: (model, item, displayText) => __foldkitBrandViewResult((typedUpdate(model, SelectedItem({ item, displayText, wasSelected: false }))), "@foldkit/ui/combobox/single.js#selectItem~2"),
73
73
  open: model => __foldkitBrandViewResult((typedUpdate(model, Opened({ maybeActiveItemIndex: Option.none() }))), "@foldkit/ui/combobox/single.js#open~2"),
74
- close: (model, restingInputValue) => __foldkitBrandViewResult((typedUpdate(model, Closed({ restingInputValue }))), "@foldkit/ui/combobox/single.js#close~2"),
74
+ close: (model, restingInputValue) => __foldkitBrandViewResult((typedUpdate(model, Closed({ restingInputValue, isClearable: true }))), "@foldkit/ui/combobox/single.js#close~2"),
75
75
  }), "@foldkit/ui/combobox/single.js#create");
76
76
  };
@@ -92,6 +92,8 @@ export declare const update: (model: {
92
92
  readonly _tag: "Closed";
93
93
  } | {
94
94
  readonly _tag: "DeactivatedItem";
95
+ } | {
96
+ readonly _tag: "SuppressedItemCommit";
95
97
  } | {
96
98
  readonly _tag: "CompletedScrollIntoView";
97
99
  } | {
@@ -123,8 +125,6 @@ export declare const update: (model: {
123
125
  } | {
124
126
  readonly _tag: "CompletedDelayClearSearch";
125
127
  readonly version: number;
126
- } | {
127
- readonly _tag: "SuppressedItemCommit";
128
128
  } | {
129
129
  readonly _tag: "PressedPointerOnButton";
130
130
  readonly pointerType: string;
@@ -292,6 +292,8 @@ export declare const makeUpdate: <Model extends BaseModel>(handleSelectedItem: (
292
292
  readonly _tag: "Closed";
293
293
  } | {
294
294
  readonly _tag: "DeactivatedItem";
295
+ } | {
296
+ readonly _tag: "SuppressedItemCommit";
295
297
  } | {
296
298
  readonly _tag: "CompletedScrollIntoView";
297
299
  } | {
@@ -323,8 +325,6 @@ export declare const makeUpdate: <Model extends BaseModel>(handleSelectedItem: (
323
325
  } | {
324
326
  readonly _tag: "CompletedDelayClearSearch";
325
327
  readonly version: number;
326
- } | {
327
- readonly _tag: "SuppressedItemCommit";
328
328
  } | {
329
329
  readonly _tag: "PressedPointerOnButton";
330
330
  readonly pointerType: string;
@@ -92,6 +92,8 @@ export declare const update: (model: {
92
92
  readonly _tag: "Closed";
93
93
  } | {
94
94
  readonly _tag: "DeactivatedItem";
95
+ } | {
96
+ readonly _tag: "SuppressedItemCommit";
95
97
  } | {
96
98
  readonly _tag: "CompletedScrollIntoView";
97
99
  } | {
@@ -123,8 +125,6 @@ export declare const update: (model: {
123
125
  } | {
124
126
  readonly _tag: "CompletedDelayClearSearch";
125
127
  readonly version: number;
126
- } | {
127
- readonly _tag: "SuppressedItemCommit";
128
128
  } | {
129
129
  readonly _tag: "PressedPointerOnButton";
130
130
  readonly pointerType: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/ui",
3
- "version": "0.142.1",
3
+ "version": "0.144.0",
4
4
  "description": "Headless, accessible UI components for Foldkit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -113,22 +113,22 @@
113
113
  "dist"
114
114
  ],
115
115
  "peerDependencies": {
116
- "effect": "4.0.0-beta.107",
116
+ "effect": "4.0.0-rc.108",
117
117
  "foldkit": "^0"
118
118
  },
119
119
  "dependencies": {
120
120
  "@floating-ui/dom": "^1.7.6"
121
121
  },
122
122
  "devDependencies": {
123
- "@effect/vitest": "4.0.0-beta.107",
124
- "effect": "4.0.0-beta.107",
123
+ "@effect/vitest": "4.0.0-rc.108",
124
+ "effect": "4.0.0-rc.108",
125
125
  "happy-dom": "^20.10.4",
126
126
  "rimraf": "^6.1.3",
127
127
  "typedoc": "^0.28.19",
128
128
  "typescript": "^6.0.3",
129
129
  "vitest": "^4.1.9",
130
- "@foldkit/vite-plugin": "0.12.3",
131
- "foldkit": "0.142.1"
130
+ "foldkit": "0.144.0",
131
+ "@foldkit/vite-plugin": "0.13.0"
132
132
  },
133
133
  "keywords": [
134
134
  "foldkit",