@typed/ui 1.0.0-beta.3 → 1.0.0-beta.5

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 (157) hide show
  1. package/README.md +53 -9
  2. package/dist/Alert.d.ts +78 -0
  3. package/dist/Alert.d.ts.map +1 -0
  4. package/dist/Alert.js +37 -0
  5. package/dist/Button.d.ts +144 -0
  6. package/dist/Button.d.ts.map +1 -0
  7. package/dist/Button.js +38 -0
  8. package/dist/Carousel.d.ts +547 -0
  9. package/dist/Carousel.d.ts.map +1 -0
  10. package/dist/Carousel.js +387 -0
  11. package/dist/Checkbox.d.ts +203 -0
  12. package/dist/Checkbox.d.ts.map +1 -0
  13. package/dist/Checkbox.js +140 -0
  14. package/dist/Collection.d.ts +254 -0
  15. package/dist/Collection.d.ts.map +1 -0
  16. package/dist/Collection.js +218 -0
  17. package/dist/Combobox.d.ts +516 -0
  18. package/dist/Combobox.d.ts.map +1 -0
  19. package/dist/Combobox.js +371 -0
  20. package/dist/Component.d.ts +127 -0
  21. package/dist/Component.d.ts.map +1 -0
  22. package/dist/Component.js +60 -0
  23. package/dist/Composite.d.ts +823 -0
  24. package/dist/Composite.d.ts.map +1 -0
  25. package/dist/Composite.js +615 -0
  26. package/dist/Dialog.d.ts +544 -0
  27. package/dist/Dialog.d.ts.map +1 -0
  28. package/dist/Dialog.js +355 -0
  29. package/dist/Disclosure.d.ts +219 -0
  30. package/dist/Disclosure.d.ts.map +1 -0
  31. package/dist/Disclosure.js +128 -0
  32. package/dist/Dom/Events.d.ts +122 -0
  33. package/dist/Dom/Events.d.ts.map +1 -0
  34. package/dist/Dom/Events.js +192 -0
  35. package/dist/Dom/Props.d.ts +161 -0
  36. package/dist/Dom/Props.d.ts.map +1 -0
  37. package/dist/Dom/Props.js +110 -0
  38. package/dist/Dom/Refs.d.ts +58 -0
  39. package/dist/Dom/Refs.d.ts.map +1 -0
  40. package/dist/Dom/Refs.js +61 -0
  41. package/dist/Dom/Render.d.ts +59 -0
  42. package/dist/Dom/Render.d.ts.map +1 -0
  43. package/dist/Dom/Render.js +71 -0
  44. package/dist/Dom/Types.d.ts +570 -0
  45. package/dist/Dom/Types.d.ts.map +1 -0
  46. package/dist/Dom/Types.js +1 -0
  47. package/dist/Dom/index.d.ts +20 -0
  48. package/dist/Dom/index.d.ts.map +1 -0
  49. package/dist/Dom/index.js +8 -0
  50. package/dist/Dom.d.ts +14 -0
  51. package/dist/Dom.d.ts.map +1 -0
  52. package/dist/Dom.js +13 -0
  53. package/dist/Focusable.d.ts +85 -0
  54. package/dist/Focusable.d.ts.map +1 -0
  55. package/dist/Focusable.js +35 -0
  56. package/dist/Form.d.ts +1695 -0
  57. package/dist/Form.d.ts.map +1 -0
  58. package/dist/Form.js +987 -0
  59. package/dist/Grid.d.ts +569 -0
  60. package/dist/Grid.d.ts.map +1 -0
  61. package/dist/Grid.js +379 -0
  62. package/dist/Group.d.ts +147 -0
  63. package/dist/Group.d.ts.map +1 -0
  64. package/dist/Group.js +63 -0
  65. package/dist/Heading.d.ts +86 -0
  66. package/dist/Heading.d.ts.map +1 -0
  67. package/dist/Heading.js +48 -0
  68. package/dist/Hovercard.d.ts +297 -0
  69. package/dist/Hovercard.d.ts.map +1 -0
  70. package/dist/Hovercard.js +188 -0
  71. package/dist/HttpRouter.d.ts +129 -6
  72. package/dist/HttpRouter.d.ts.map +1 -1
  73. package/dist/HttpRouter.js +197 -54
  74. package/dist/Link.d.ts +67 -28
  75. package/dist/Link.d.ts.map +1 -1
  76. package/dist/Link.js +91 -37
  77. package/dist/Listbox.d.ts +437 -0
  78. package/dist/Listbox.d.ts.map +1 -0
  79. package/dist/Listbox.js +316 -0
  80. package/dist/Menu.d.ts +972 -0
  81. package/dist/Menu.d.ts.map +1 -0
  82. package/dist/Menu.js +731 -0
  83. package/dist/Menubar.d.ts +367 -0
  84. package/dist/Menubar.d.ts.map +1 -0
  85. package/dist/Menubar.js +265 -0
  86. package/dist/Meter.d.ts +217 -0
  87. package/dist/Meter.d.ts.map +1 -0
  88. package/dist/Meter.js +94 -0
  89. package/dist/NativeDetails.d.ts +41 -0
  90. package/dist/NativeDetails.d.ts.map +1 -0
  91. package/dist/NativeDetails.js +40 -0
  92. package/dist/NativeDialog.d.ts +64 -0
  93. package/dist/NativeDialog.d.ts.map +1 -0
  94. package/dist/NativeDialog.js +50 -0
  95. package/dist/NativePopover.d.ts +41 -0
  96. package/dist/NativePopover.d.ts.map +1 -0
  97. package/dist/NativePopover.js +46 -0
  98. package/dist/Popover.d.ts +241 -0
  99. package/dist/Popover.d.ts.map +1 -0
  100. package/dist/Popover.js +141 -0
  101. package/dist/RadioGroup.d.ts +432 -0
  102. package/dist/RadioGroup.d.ts.map +1 -0
  103. package/dist/RadioGroup.js +291 -0
  104. package/dist/Role.d.ts +64 -0
  105. package/dist/Role.d.ts.map +1 -0
  106. package/dist/Role.js +27 -0
  107. package/dist/Select.d.ts +529 -0
  108. package/dist/Select.d.ts.map +1 -0
  109. package/dist/Select.js +407 -0
  110. package/dist/Separator.d.ts +54 -0
  111. package/dist/Separator.d.ts.map +1 -0
  112. package/dist/Separator.js +26 -0
  113. package/dist/Slider.d.ts +188 -0
  114. package/dist/Slider.d.ts.map +1 -0
  115. package/dist/Slider.js +96 -0
  116. package/dist/SpinButton.d.ts +188 -0
  117. package/dist/SpinButton.d.ts.map +1 -0
  118. package/dist/SpinButton.js +96 -0
  119. package/dist/Storybook.d.ts +76 -0
  120. package/dist/Storybook.d.ts.map +1 -0
  121. package/dist/Storybook.js +102 -0
  122. package/dist/Switch.d.ts +187 -0
  123. package/dist/Switch.d.ts.map +1 -0
  124. package/dist/Switch.js +116 -0
  125. package/dist/Tab.d.ts +26 -0
  126. package/dist/Tab.d.ts.map +1 -0
  127. package/dist/Tab.js +25 -0
  128. package/dist/Tabs.d.ts +591 -0
  129. package/dist/Tabs.d.ts.map +1 -0
  130. package/dist/Tabs.js +346 -0
  131. package/dist/Toolbar.d.ts +366 -0
  132. package/dist/Toolbar.d.ts.map +1 -0
  133. package/dist/Toolbar.js +245 -0
  134. package/dist/Tooltip.d.ts +296 -0
  135. package/dist/Tooltip.d.ts.map +1 -0
  136. package/dist/Tooltip.js +172 -0
  137. package/dist/Tree.d.ts +591 -0
  138. package/dist/Tree.d.ts.map +1 -0
  139. package/dist/Tree.js +434 -0
  140. package/dist/TreeGrid.d.ts +645 -0
  141. package/dist/TreeGrid.d.ts.map +1 -0
  142. package/dist/TreeGrid.js +420 -0
  143. package/dist/VisuallyHidden.d.ts +54 -0
  144. package/dist/VisuallyHidden.d.ts.map +1 -0
  145. package/dist/VisuallyHidden.js +27 -0
  146. package/dist/WindowSplitter.d.ts +376 -0
  147. package/dist/WindowSplitter.d.ts.map +1 -0
  148. package/dist/WindowSplitter.js +222 -0
  149. package/dist/index.d.ts +49 -0
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +49 -0
  152. package/package.json +42 -15
  153. package/src/HttpRouter.test.ts +0 -294
  154. package/src/HttpRouter.ts +0 -168
  155. package/src/Link.test.ts +0 -84
  156. package/src/Link.ts +0 -107
  157. package/src/index.ts +0 -2
@@ -0,0 +1,516 @@
1
+ /**
2
+ * Combobox keeps focus on its native input and exposes the active option through
3
+ * aria-activedescendant. Input, a manual native popover, and options share explicit value, open,
4
+ * and active state.
5
+ *
6
+ * @remarks
7
+ * The module keeps policy, state transitions, and DOM rendering separable so applications can use
8
+ * the state and pure operations without mounting UI, or supply custom hosts without replacing native
9
+ * events and browser-owned focus.
10
+ *
11
+ * @since 1.0.0
12
+ * @category modules
13
+ * @packageDocumentation
14
+ */
15
+ import * as Effect from "effect/Effect";
16
+ import type * as Scope from "effect/Scope";
17
+ import * as Schema from "effect/Schema";
18
+ import type { Fx } from "@typed/fx/Fx";
19
+ import { RefSubject } from "@typed/fx";
20
+ import { EventHandler, type Renderable, type RenderEvent, type RenderTemplate } from "@typed/template";
21
+ import * as Collection from "./Collection.js";
22
+ import * as Composite from "./Composite.js";
23
+ import * as Dom from "./Dom.js";
24
+ import type { HostResult } from "./Dom/Types.js";
25
+ /**
26
+ * Complete renderer-independent state for Combobox.
27
+ *
28
+ * @remarks
29
+ * ## Why
30
+ *
31
+ * Applications can inspect, update, and test Combobox behavior without mounting or coupling the
32
+ * state to a renderer.
33
+ *
34
+ * ## Ownership and lifetime
35
+ *
36
+ * This declaration is data or schema metadata and acquires no resources.
37
+ *
38
+ * ## Example
39
+ *
40
+ * Import with `import type { State } from "@typed/ui/Combobox";` Extend the [Combobox.makeState
41
+ * runnable setup](/reference/%40typed%2Fui%2FCombobox%23makeState). Inside the linked program,
42
+ * `const snapshot: State = yield* state` exposes the current id, value, open state, and composite
43
+ * focus state.
44
+ * @since 1.0.0
45
+ * @category models
46
+ */
47
+ export interface State extends Omit<Composite.State, "orientation"> {
48
+ /**
49
+ * Axis used to interpret Arrow-key movement.
50
+ * @since 1.0.0
51
+ * @category models
52
+ */
53
+ readonly orientation: "vertical";
54
+ /**
55
+ * Stable id used for collection identity and ARIA relationships.
56
+ * @since 1.0.0
57
+ * @category models
58
+ */
59
+ readonly id: string;
60
+ /**
61
+ * Current semantic value selected or edited by the widget.
62
+ * @since 1.0.0
63
+ * @category models
64
+ */
65
+ readonly value: string;
66
+ /**
67
+ * Whether the associated native popover is open.
68
+ * @since 1.0.0
69
+ * @category models
70
+ */
71
+ readonly open: boolean;
72
+ }
73
+ /**
74
+ * Initial Combobox values. value defaults to an empty string, open to false, activeId to null,
75
+ * loop to true, and virtual focus is enabled.
76
+ *
77
+ * @remarks
78
+ * ## Why
79
+ *
80
+ * Making initialization explicit documents hydration-sensitive defaults and lets servers and
81
+ * clients construct matching state.
82
+ *
83
+ * ## Ownership and lifetime
84
+ *
85
+ * This declaration is data or schema metadata and acquires no resources.
86
+ *
87
+ * ## Example
88
+ *
89
+ * Import with `import type { InitialState } from "@typed/ui/Combobox";` Extend the
90
+ * [Combobox.makeState runnable setup](/reference/%40typed%2Fui%2FCombobox%23makeState). Construct
91
+ * state with
92
+ * `const initial: InitialState = { id: "city", value: "", open: false }; const state = yield* Combobox.makeState(initial)`.
93
+ * @since 1.0.0
94
+ * @category models
95
+ */
96
+ export interface InitialState {
97
+ /**
98
+ * Stable id used for collection identity and ARIA relationships.
99
+ * @since 1.0.0
100
+ * @category models
101
+ */
102
+ readonly id: string;
103
+ /**
104
+ * Current semantic value selected or edited by the widget.
105
+ * @since 1.0.0
106
+ * @category models
107
+ */
108
+ readonly value?: string;
109
+ /**
110
+ * Whether the associated native popover is open.
111
+ * @since 1.0.0
112
+ * @category models
113
+ */
114
+ readonly open?: boolean;
115
+ /**
116
+ * Id currently active for keyboard navigation; null means no active item.
117
+ * @since 1.0.0
118
+ * @category models
119
+ */
120
+ readonly activeId?: string | null;
121
+ /**
122
+ * Whether movement wraps between the first and last enabled items.
123
+ * @since 1.0.0
124
+ * @category models
125
+ */
126
+ readonly loop?: boolean;
127
+ }
128
+ /**
129
+ * Effect Schema used by makeState to encode, decode, and hydrate Combobox state.
130
+ *
131
+ * @remarks
132
+ * ## Why
133
+ *
134
+ * A public schema makes hydration and serialized state use the same runtime validation as direct
135
+ * construction.
136
+ *
137
+ * ## Ownership and lifetime
138
+ *
139
+ * This declaration is data or schema metadata and acquires no resources.
140
+ *
141
+ * @example
142
+ * ```ts
143
+ * import * as Schema from "effect/Schema";
144
+ * import * as Combobox from "@typed/ui/Combobox";
145
+ *
146
+ * const decodeState = Schema.decodeUnknownEffect(Combobox.StateSchema);
147
+ * ```
148
+ * @since 1.0.0
149
+ * @category schemas
150
+ */
151
+ export declare const StateSchema: Schema.Struct<{
152
+ readonly id: Schema.String;
153
+ readonly value: Schema.String;
154
+ readonly open: Schema.Boolean;
155
+ readonly activeId: Schema.NullOr<Schema.String>;
156
+ readonly orientation: Schema.Literals<readonly ["vertical"]>;
157
+ readonly loop: Schema.Boolean;
158
+ readonly rtl: Schema.Boolean;
159
+ readonly virtualFocus: Schema.Boolean;
160
+ }>;
161
+ /**
162
+ * Creates hydrated Combobox state. value defaults to an empty string, open to false, activeId to
163
+ * null, loop to true, and virtual focus is enabled.
164
+ *
165
+ * @remarks
166
+ * ## Why
167
+ *
168
+ * State and collection ownership can be composed and tested independently from any renderer.
169
+ *
170
+ * ## Ownership and lifetime
171
+ *
172
+ * The returned Effect creates the RefSubject when run. That state is renderer-independent;
173
+ * collection registrations belong to the separate Scope that runs register or ref, not to state
174
+ * creation.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * import * as Effect from "effect/Effect";
179
+ * import * as Combobox from "@typed/ui/Combobox";
180
+ *
181
+ * const program = Effect.scoped(
182
+ * Effect.gen(function* () {
183
+ * const state = yield* Combobox.makeState({ id: "city" });
184
+ * const collection = yield* Combobox.makeCollection();
185
+ * return { state: yield* state, collection: yield* collection };
186
+ * }),
187
+ * );
188
+ * ```
189
+ * @since 1.0.0
190
+ * @category constructors
191
+ */
192
+ export declare function makeState(initial: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
193
+ readonly id: string;
194
+ readonly value: string;
195
+ readonly open: boolean;
196
+ readonly activeId: string | null;
197
+ readonly orientation: "vertical";
198
+ readonly loop: boolean;
199
+ readonly rtl: boolean;
200
+ readonly virtualFocus: boolean;
201
+ }, Schema.SchemaError, never, never>, never, Scope.Scope>;
202
+ /**
203
+ * Creates a scoped Collection for Combobox items.
204
+ *
205
+ * @remarks
206
+ * ## Why
207
+ *
208
+ * State and collection ownership can be composed and tested independently from any renderer.
209
+ *
210
+ * ## Ownership and lifetime
211
+ *
212
+ * The returned Effect allocates the RefSubject in the caller's Scope. Each later registration is
213
+ * owned by the Scope that runs register, independently of this construction Effect.
214
+ *
215
+ * @example
216
+ * ```ts
217
+ * import * as Effect from "effect/Effect";
218
+ * import * as Combobox from "@typed/ui/Combobox";
219
+ *
220
+ * const program = Effect.scoped(
221
+ * Effect.gen(function* () {
222
+ * const collection = yield* Combobox.makeCollection();
223
+ * return yield* collection;
224
+ * }),
225
+ * );
226
+ * ```
227
+ * @since 1.0.0
228
+ * @category constructors
229
+ */
230
+ export declare const makeCollection: (initial?: Collection.State<string, Element>) => Effect.Effect<RefSubject.RefSubject<Collection.State<string, Element>, never, never>, never, Scope.Scope>;
231
+ /**
232
+ * Stores the input value, clears activeId, and opens the popup in one state update.
233
+ *
234
+ * @remarks
235
+ * ## Why
236
+ *
237
+ * The operation exposes Combobox's transition directly so callers can compose it in Effect
238
+ * programs and native event handlers.
239
+ *
240
+ * ## Ownership and lifetime
241
+ *
242
+ * The returned Effect performs the update or DOM side effect only when run, preserves the declared
243
+ * error and service channels, and retains no resources after completion.
244
+ *
245
+ * ## Example
246
+ *
247
+ * Import with `import { setValue } from "@typed/ui/Combobox";` Extend the [Combobox.makeState
248
+ * runnable setup](/reference/%40typed%2Fui%2FCombobox%23makeState). Inside the linked Effect
249
+ * program invoke `yield* setValue(state, "New York")`, then read state to observe that value,
250
+ * `activeId: null`, and `open: true`.
251
+ * @since 1.0.0
252
+ * @category combinators
253
+ */
254
+ export declare function setValue<E, R>(state: RefSubject.RefSubject<State, E, R>, value: string): Effect.Effect<State, E, R>;
255
+ /**
256
+ * Inputs accepted by Combobox.Input in addition to the shared DOM host options.
257
+ *
258
+ * @remarks
259
+ * ## Why
260
+ *
261
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
262
+ * visible before rendering.
263
+ *
264
+ * ## Ownership and lifetime
265
+ *
266
+ * This declaration is data or schema metadata and acquires no resources.
267
+ *
268
+ * ## Example
269
+ *
270
+ * Import with `import type { InputOptions } from "@typed/ui/Combobox";` Extend the
271
+ * [Combobox.makeState runnable setup](/reference/%40typed%2Fui%2FCombobox%23makeState). Enable
272
+ * collection-driven keys with
273
+ * `const options: InputOptions = { state, collection, placeholder: "Choose a city" }`.
274
+ * @since 1.0.0
275
+ * @category models
276
+ */
277
+ export interface InputOptions extends Dom.HostOptions<HTMLInputElement> {
278
+ /**
279
+ * Renderer-independent RefSubject state consumed by this component or operation.
280
+ * @since 1.0.0
281
+ * @category models
282
+ */
283
+ readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
284
+ /**
285
+ * Item registry used for collection-driven keyboard behavior and mounted ordering.
286
+ * @since 1.0.0
287
+ * @category models
288
+ */
289
+ readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
290
+ /**
291
+ * Native input placeholder text.
292
+ * @since 1.0.0
293
+ * @category models
294
+ */
295
+ readonly placeholder?: string;
296
+ }
297
+ declare function inputProps<const Options extends InputOptions>(options: Options): () => {
298
+ readonly id: RefSubject.Computed<string, Schema.SchemaError, never>;
299
+ readonly role: "combobox";
300
+ readonly "aria-autocomplete": "list";
301
+ readonly "aria-controls": RefSubject.Computed<string, Schema.SchemaError, never>;
302
+ readonly "aria-expanded": RefSubject.Computed<boolean, Schema.SchemaError, never>;
303
+ readonly "aria-activedescendant": RefSubject.Computed<string | undefined, Schema.SchemaError, never>;
304
+ readonly placeholder: string | undefined;
305
+ readonly ".value": RefSubject.Computed<string, Schema.SchemaError, never>;
306
+ readonly oninput: EventHandler.EventHandler<Event, Schema.SchemaError, never>;
307
+ readonly onfocus: Effect.Effect<State, Schema.SchemaError, never>;
308
+ readonly onkeydown: EventHandler.EventHandler<KeyboardEvent, Schema.SchemaError, never> | undefined;
309
+ };
310
+ type InputProps<Options extends InputOptions> = ReturnType<ReturnType<typeof inputProps<Options>>>;
311
+ /**
312
+ * Renders the native combobox input, keeps its value property synchronized, opens on focus, and
313
+ * handles Arrow, Enter, and Escape when a collection is supplied.
314
+ *
315
+ * @remarks
316
+ * ## Why
317
+ *
318
+ * The component applies the family behavior while leaving callers free to supply a custom host
319
+ * through the shared DOM boundary.
320
+ *
321
+ * ## Ownership and lifetime
322
+ *
323
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
324
+ * collection registrations only when rendered. The rendering Scope removes those resources;
325
+ * unrelated nodes and attributes remain caller-owned.
326
+ *
327
+ * ## Example
328
+ *
329
+ * Import with `import { Input } from "@typed/ui/Combobox";` Extend the [Combobox.makeState runnable
330
+ * setup](/reference/%40typed%2Fui%2FCombobox%23makeState). Replace the linked program's final
331
+ * snapshot read with `Input({ state, placeholder: "Choose a city" })`; render that Fx before the
332
+ * same Scope closes.
333
+ * @since 1.0.0
334
+ * @category components
335
+ */
336
+ export declare function Input<const Options extends InputOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, InputProps<Options>>, "", Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
337
+ /**
338
+ * Inputs accepted by Combobox.Popover in addition to the shared DOM host options.
339
+ *
340
+ * @remarks
341
+ * ## Why
342
+ *
343
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
344
+ * visible before rendering.
345
+ *
346
+ * ## Ownership and lifetime
347
+ *
348
+ * This declaration is data or schema metadata and acquires no resources.
349
+ *
350
+ * ## Example
351
+ *
352
+ * Import with `import type { PopoverOptions } from "@typed/ui/Combobox";` Extend the
353
+ * [Combobox.makeState runnable setup](/reference/%40typed%2Fui%2FCombobox%23makeState). The popup
354
+ * input is `const options: PopoverOptions = { state, collection, content: "Cities" }`.
355
+ * @since 1.0.0
356
+ * @category models
357
+ */
358
+ export interface PopoverOptions extends Dom.HostOptions<HTMLDivElement> {
359
+ /**
360
+ * Renderer-independent RefSubject state consumed by this component or operation.
361
+ * @since 1.0.0
362
+ * @category models
363
+ */
364
+ readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
365
+ /**
366
+ * Item registry used for collection-driven keyboard behavior and mounted ordering.
367
+ * @since 1.0.0
368
+ * @category models
369
+ */
370
+ readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
371
+ /**
372
+ * Renderable child content for the component host.
373
+ * @since 1.0.0
374
+ * @category models
375
+ */
376
+ readonly content: Renderable.Any;
377
+ }
378
+ declare function popoverProps<const Options extends PopoverOptions>(options: Options): () => {
379
+ readonly id: RefSubject.Computed<string, Schema.SchemaError, never>;
380
+ readonly role: "listbox";
381
+ readonly "aria-labelledby": RefSubject.Computed<string, Schema.SchemaError, never>;
382
+ readonly popover: "manual";
383
+ readonly ontoggle: EventHandler.EventHandler<Event, Schema.SchemaError, never>;
384
+ readonly ref: import("./Dom/Refs.js").ComposedRef<RefSubject.HydratedRefSubject<State, Schema.SchemaError, never, never>, (element: HTMLElement) => Effect.Effect<void, Schema.SchemaError, Scope.Scope>> | undefined;
385
+ };
386
+ type PopoverProps<Options extends PopoverOptions> = ReturnType<ReturnType<typeof popoverProps<Options>>>;
387
+ /**
388
+ * Renders manual-popover listbox content, mirrors native toggle events into open state, and
389
+ * scrolls the selected option when opened.
390
+ *
391
+ * @remarks
392
+ * ## Why
393
+ *
394
+ * The component applies the family behavior while leaving callers free to supply a custom host
395
+ * through the shared DOM boundary.
396
+ *
397
+ * ## Ownership and lifetime
398
+ *
399
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
400
+ * collection registrations only when rendered. The rendering Scope removes those resources;
401
+ * unrelated nodes and attributes remain caller-owned.
402
+ *
403
+ * ## Example
404
+ *
405
+ * Import with `import { Popover } from "@typed/ui/Combobox";` Extend the [Combobox.makeState
406
+ * runnable setup](/reference/%40typed%2Fui%2FCombobox%23makeState). Replace the linked program's
407
+ * final snapshot read with `Popover({ state, content: "Cities" })`; render that Fx before the same
408
+ * Scope closes.
409
+ * @since 1.0.0
410
+ * @category components
411
+ */
412
+ export declare function Popover<const Options extends PopoverOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, PopoverProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
413
+ /**
414
+ * Inputs accepted by Combobox.Item in addition to the shared DOM host options.
415
+ *
416
+ * @remarks
417
+ * ## Why
418
+ *
419
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
420
+ * visible before rendering.
421
+ *
422
+ * ## Ownership and lifetime
423
+ *
424
+ * This declaration is data or schema metadata and acquires no resources.
425
+ *
426
+ * ## Example
427
+ *
428
+ * Import with `import type { ItemOptions } from "@typed/ui/Combobox";` Extend the
429
+ * [Combobox.makeState runnable setup](/reference/%40typed%2Fui%2FCombobox%23makeState). A
430
+ * selectable choice is
431
+ * `const options: ItemOptions = { state, collection, id: "nyc", value: "New York", content: "New York" }`.
432
+ * @since 1.0.0
433
+ * @category models
434
+ */
435
+ export interface ItemOptions extends Dom.HostOptions<HTMLDivElement> {
436
+ /**
437
+ * Renderer-independent RefSubject state consumed by this component or operation.
438
+ * @since 1.0.0
439
+ * @category models
440
+ */
441
+ readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
442
+ /**
443
+ * Item registry used for collection-driven keyboard behavior and mounted ordering.
444
+ * @since 1.0.0
445
+ * @category models
446
+ */
447
+ readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
448
+ /**
449
+ * Stable id used for collection identity and ARIA relationships.
450
+ * @since 1.0.0
451
+ * @category models
452
+ */
453
+ readonly id: string;
454
+ /**
455
+ * Current semantic value selected or edited by the widget.
456
+ * @since 1.0.0
457
+ * @category models
458
+ */
459
+ readonly value: string;
460
+ /**
461
+ * Renderable child content for the component host.
462
+ * @since 1.0.0
463
+ * @category models
464
+ */
465
+ readonly content: Renderable.Any;
466
+ /**
467
+ * Search text used by typeahead independently of rendered markup.
468
+ * @since 1.0.0
469
+ * @category models
470
+ */
471
+ readonly textValue?: string;
472
+ /**
473
+ * Flag used by collection movement and widget handlers to skip activation by default.
474
+ * @since 1.0.0
475
+ * @category models
476
+ */
477
+ readonly disabled?: boolean;
478
+ }
479
+ declare function itemProps<const Options extends ItemOptions>(options: Options): () => {
480
+ readonly id: string;
481
+ readonly role: "option";
482
+ readonly "aria-selected": RefSubject.Computed<boolean, Schema.SchemaError, never>;
483
+ readonly "aria-disabled": boolean;
484
+ readonly tabindex: RefSubject.Computed<-1 | 0, Schema.SchemaError, never>;
485
+ readonly onclick: Effect.Effect<void, never, never> | Effect.Effect<State, Schema.SchemaError, never>;
486
+ readonly ref: ((element: Element & HTMLDivElement & RefSubject.HydrationElement) => Effect.Effect<void, any, any>) | undefined;
487
+ };
488
+ type ItemProps<Options extends ItemOptions> = ReturnType<ReturnType<typeof itemProps<Options>>>;
489
+ /**
490
+ * Renders and optionally registers one option; disabled options expose aria-disabled and do not
491
+ * select on click.
492
+ *
493
+ * @remarks
494
+ * ## Why
495
+ *
496
+ * The component applies the family behavior while leaving callers free to supply a custom host
497
+ * through the shared DOM boundary.
498
+ *
499
+ * ## Ownership and lifetime
500
+ *
501
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
502
+ * collection registrations only when rendered. The rendering Scope removes those resources;
503
+ * unrelated nodes and attributes remain caller-owned.
504
+ *
505
+ * ## Example
506
+ *
507
+ * Import with `import { Item } from "@typed/ui/Combobox";` Extend the [Combobox.makeState runnable
508
+ * setup](/reference/%40typed%2Fui%2FCombobox%23makeState). Replace the linked program's final
509
+ * snapshot read with `Item({ state, id: "nyc", value: "New York", content: "New York" })`; render
510
+ * that Fx before the same Scope closes.
511
+ * @since 1.0.0
512
+ * @category components
513
+ */
514
+ export declare function Item<const Options extends ItemOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, ItemProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
515
+ export {};
516
+ //# sourceMappingURL=Combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../src/Combobox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU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