@typed/ui 1.0.0-beta.4 → 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 +196 -53
  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 +45 -18
  153. package/src/HttpRouter.test.ts +0 -256
  154. package/src/HttpRouter.ts +0 -165
  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,529 @@
1
+ /**
2
+ * Select keeps popover visibility, active option, and selected value separate. A native button
3
+ * targets manual-popover listbox content; keyboard movement and typeahead update active state
4
+ * before selection closes the popover.
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 * 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 Select.
27
+ *
28
+ * @remarks
29
+ * ## Why
30
+ *
31
+ * Applications can inspect, update, and test Select 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/Select";` Extend the [Select.makeState
41
+ * runnable setup](/reference/%40typed%2Fui%2FSelect%23makeState). Inside the linked program,
42
+ * `const snapshot: State = yield* state` exposes popup identity, selected value, open state, and
43
+ * active option.
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 | null;
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 Select values. The caller supplies id; value and activeId default null, open false, and
75
+ * loop true.
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/Select";` Extend the [Select.makeState
90
+ * runnable setup](/reference/%40typed%2Fui%2FSelect%23makeState). Construct state with
91
+ * `const initial: InitialState = { id: "timezone", value: null, open: false }; const state = yield* Select.makeState(initial)`.
92
+ * @since 1.0.0
93
+ * @category models
94
+ */
95
+ export interface InitialState {
96
+ /**
97
+ * Stable id used for collection identity and ARIA relationships.
98
+ * @since 1.0.0
99
+ * @category models
100
+ */
101
+ readonly id: string;
102
+ /**
103
+ * Current semantic value selected or edited by the widget.
104
+ * @since 1.0.0
105
+ * @category models
106
+ */
107
+ readonly value?: string | null;
108
+ /**
109
+ * Whether the associated native popover is open.
110
+ * @since 1.0.0
111
+ * @category models
112
+ */
113
+ readonly open?: boolean;
114
+ /**
115
+ * Id currently active for keyboard navigation; null means no active item.
116
+ * @since 1.0.0
117
+ * @category models
118
+ */
119
+ readonly activeId?: string | null;
120
+ /**
121
+ * Whether movement wraps between the first and last enabled items.
122
+ * @since 1.0.0
123
+ * @category models
124
+ */
125
+ readonly loop?: boolean;
126
+ }
127
+ /**
128
+ * Effect Schema used by makeState to encode, decode, and hydrate Select state.
129
+ *
130
+ * @remarks
131
+ * ## Why
132
+ *
133
+ * A public schema makes hydration and serialized state use the same runtime validation as direct
134
+ * construction.
135
+ *
136
+ * ## Ownership and lifetime
137
+ *
138
+ * This declaration is data or schema metadata and acquires no resources.
139
+ *
140
+ * @example
141
+ * ```ts
142
+ * import * as Schema from "effect/Schema";
143
+ * import * as Select from "@typed/ui/Select";
144
+ *
145
+ * const decodeState = Schema.decodeUnknownEffect(Select.StateSchema);
146
+ * ```
147
+ * @since 1.0.0
148
+ * @category schemas
149
+ */
150
+ export declare const StateSchema: Schema.Struct<{
151
+ readonly id: Schema.String;
152
+ readonly value: Schema.NullOr<Schema.String>;
153
+ readonly open: Schema.Boolean;
154
+ readonly activeId: Schema.NullOr<Schema.String>;
155
+ readonly orientation: Schema.Literals<readonly ["vertical"]>;
156
+ readonly loop: Schema.Boolean;
157
+ readonly rtl: Schema.Boolean;
158
+ readonly virtualFocus: Schema.Boolean;
159
+ }>;
160
+ /**
161
+ * Creates hydrated Select state. The caller supplies id; value and activeId default null, open
162
+ * false, and loop true.
163
+ *
164
+ * @remarks
165
+ * ## Why
166
+ *
167
+ * State and collection ownership can be composed and tested independently from any renderer.
168
+ *
169
+ * ## Ownership and lifetime
170
+ *
171
+ * The returned Effect creates the RefSubject when run. That state is renderer-independent;
172
+ * collection registrations belong to the separate Scope that runs register or ref, not to state
173
+ * creation.
174
+ *
175
+ * @example
176
+ * ```ts
177
+ * import * as Effect from "effect/Effect";
178
+ * import * as Select from "@typed/ui/Select";
179
+ *
180
+ * const program = Effect.scoped(
181
+ * Effect.gen(function* () {
182
+ * const state = yield* Select.makeState({ id: "timezone" });
183
+ * const collection = yield* Select.makeCollection();
184
+ * return { state: yield* state, collection: yield* collection };
185
+ * }),
186
+ * );
187
+ * ```
188
+ * @since 1.0.0
189
+ * @category constructors
190
+ */
191
+ export declare function makeState(initial: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
192
+ readonly id: string;
193
+ readonly value: string | null;
194
+ readonly open: boolean;
195
+ readonly activeId: string | null;
196
+ readonly orientation: "vertical";
197
+ readonly loop: boolean;
198
+ readonly rtl: boolean;
199
+ readonly virtualFocus: boolean;
200
+ }, Schema.SchemaError, never, never>, never, Scope.Scope>;
201
+ /**
202
+ * Creates a scoped Collection for Select items.
203
+ *
204
+ * @remarks
205
+ * ## Why
206
+ *
207
+ * State and collection ownership can be composed and tested independently from any renderer.
208
+ *
209
+ * ## Ownership and lifetime
210
+ *
211
+ * The returned Effect allocates the RefSubject in the caller's Scope. Each later registration is
212
+ * owned by the Scope that runs register, independently of this construction Effect.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * import * as Effect from "effect/Effect";
217
+ * import * as Select from "@typed/ui/Select";
218
+ *
219
+ * const program = Effect.scoped(
220
+ * Effect.gen(function* () {
221
+ * const collection = yield* Select.makeCollection();
222
+ * return yield* collection;
223
+ * }),
224
+ * );
225
+ * ```
226
+ * @since 1.0.0
227
+ * @category constructors
228
+ */
229
+ export declare const makeCollection: (initial?: Collection.State<string, Element>) => Effect.Effect<RefSubject.RefSubject<Collection.State<string, Element>, never, never>, never, Scope.Scope>;
230
+ /**
231
+ * Sets selected value and active id, then closes the popover.
232
+ *
233
+ * @remarks
234
+ * ## Why
235
+ *
236
+ * The operation exposes Select's transition directly so callers can compose it in Effect programs
237
+ * and native event handlers.
238
+ *
239
+ * ## Ownership and lifetime
240
+ *
241
+ * The returned Effect performs the update or DOM side effect only when run, preserves the declared
242
+ * error and service channels, and retains no resources after completion.
243
+ *
244
+ * ## Example
245
+ *
246
+ * Import with `import { select } from "@typed/ui/Select";` Extend the [Select.makeState runnable
247
+ * setup](/reference/%40typed%2Fui%2FSelect%23makeState). Inside the linked Effect program invoke
248
+ * `yield* select(state, "utc", "UTC")`, then read state to observe selection and active focus
249
+ * update together while the popup closes.
250
+ * @since 1.0.0
251
+ * @category combinators
252
+ */
253
+ export declare function select<E, R>(state: RefSubject.RefSubject<State, E, R>, id: string, value: string): Effect.Effect<State, E, R>;
254
+ /**
255
+ * Inputs accepted by Select.Trigger in addition to the shared DOM host options.
256
+ *
257
+ * @remarks
258
+ * ## Why
259
+ *
260
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
261
+ * visible before rendering.
262
+ *
263
+ * ## Ownership and lifetime
264
+ *
265
+ * This declaration is data or schema metadata and acquires no resources.
266
+ *
267
+ * ## Example
268
+ *
269
+ * Import with `import type { TriggerOptions } from "@typed/ui/Select";` Extend the
270
+ * [Select.makeState runnable setup](/reference/%40typed%2Fui%2FSelect%23makeState). A native
271
+ * popover trigger accepts `const options: TriggerOptions = { state, content: "Choose timezone" }`.
272
+ * @since 1.0.0
273
+ * @category models
274
+ */
275
+ export interface TriggerOptions extends Dom.HostOptions<HTMLButtonElement> {
276
+ /**
277
+ * Renderer-independent RefSubject state consumed by this component or operation.
278
+ * @since 1.0.0
279
+ * @category models
280
+ */
281
+ readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
282
+ /**
283
+ * Renderable child content for the component host.
284
+ * @since 1.0.0
285
+ * @category models
286
+ */
287
+ readonly content: Renderable.Any;
288
+ }
289
+ declare function triggerProps<const Options extends TriggerOptions>(options: Options): () => {
290
+ readonly id: RefSubject.Computed<string, Schema.SchemaError, never>;
291
+ readonly type: "button";
292
+ readonly popovertarget: RefSubject.Computed<string, Schema.SchemaError, never>;
293
+ readonly popovertargetaction: "toggle";
294
+ readonly "aria-haspopup": "listbox";
295
+ readonly "aria-expanded": RefSubject.Computed<boolean, Schema.SchemaError, never>;
296
+ readonly onkeydown: EventHandler.EventHandler<KeyboardEvent, never, never>;
297
+ readonly ref: import("./Dom/Refs.js").ComposedRef<RefSubject.HydratedRefSubject<State, Schema.SchemaError, never, never>, (element: globalThis.Element) => Effect.Effect<void, never, Scope.Scope>> | undefined;
298
+ };
299
+ type TriggerProps<Options extends TriggerOptions> = ReturnType<ReturnType<typeof triggerProps<Options>>>;
300
+ /**
301
+ * Renders the native button that targets listbox popover content and opens it on ArrowDown.
302
+ *
303
+ * @remarks
304
+ * ## Why
305
+ *
306
+ * The component applies the family behavior while leaving callers free to supply a custom host
307
+ * through the shared DOM boundary.
308
+ *
309
+ * ## Ownership and lifetime
310
+ *
311
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
312
+ * collection registrations only when rendered. The rendering Scope removes those resources;
313
+ * unrelated nodes and attributes remain caller-owned.
314
+ *
315
+ * ## Example
316
+ *
317
+ * Import with `import { Trigger } from "@typed/ui/Select";` Extend the [Select.makeState runnable
318
+ * setup](/reference/%40typed%2Fui%2FSelect%23makeState). Replace the linked program's final
319
+ * snapshot read with `Trigger({ state, content: "Choose timezone" })`; render that Fx before the
320
+ * same Scope closes.
321
+ * @since 1.0.0
322
+ * @category components
323
+ */
324
+ export declare function Trigger<const Options extends TriggerOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, TriggerProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
325
+ /**
326
+ * Consumer-facing alias of the canonical Select component with identical behavior and lifetime.
327
+ *
328
+ * @remarks
329
+ * ## Why
330
+ *
331
+ * The component applies the family behavior while leaving callers free to supply a custom host
332
+ * through the shared DOM boundary.
333
+ *
334
+ * ## Ownership and lifetime
335
+ *
336
+ * The alias acquires nothing. Rendering it has exactly the canonical component's Scope and DOM
337
+ * ownership contract.
338
+ *
339
+ * ## Example
340
+ *
341
+ * Import with `import { Select } from "@typed/ui/Select";` Extend the [Select.makeState runnable
342
+ * setup](/reference/%40typed%2Fui%2FSelect%23makeState). Replace the linked program's final
343
+ * snapshot read with `Select({ state, content: "Choose timezone" })`; render that Fx before the
344
+ * same Scope closes.
345
+ * @since 1.0.0
346
+ * @category components
347
+ */
348
+ export declare const Select: typeof Trigger;
349
+ /**
350
+ * Inputs accepted by Select.Content in addition to the shared DOM host options.
351
+ *
352
+ * @remarks
353
+ * ## Why
354
+ *
355
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
356
+ * visible before rendering.
357
+ *
358
+ * ## Ownership and lifetime
359
+ *
360
+ * This declaration is data or schema metadata and acquires no resources.
361
+ *
362
+ * ## Example
363
+ *
364
+ * Import with `import type { ContentOptions } from "@typed/ui/Select";` Extend the
365
+ * [Select.makeState runnable setup](/reference/%40typed%2Fui%2FSelect%23makeState). Enable listbox
366
+ * movement with `const options: ContentOptions = { state, collection, content: "Timezones" }`.
367
+ * @since 1.0.0
368
+ * @category models
369
+ */
370
+ export interface ContentOptions extends Dom.HostOptions<HTMLDivElement> {
371
+ /**
372
+ * Renderer-independent RefSubject state consumed by this component or operation.
373
+ * @since 1.0.0
374
+ * @category models
375
+ */
376
+ readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
377
+ /**
378
+ * Item registry used for collection-driven keyboard behavior and mounted ordering.
379
+ * @since 1.0.0
380
+ * @category models
381
+ */
382
+ readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
383
+ /**
384
+ * Renderable child content for the component host.
385
+ * @since 1.0.0
386
+ * @category models
387
+ */
388
+ readonly content: Renderable.Any;
389
+ }
390
+ declare function contentProps<const Options extends ContentOptions>(options: Options): () => {
391
+ readonly id: RefSubject.Computed<string, Schema.SchemaError, never>;
392
+ readonly role: "listbox";
393
+ readonly "aria-labelledby": RefSubject.Computed<string, Schema.SchemaError, never>;
394
+ readonly popover: "manual";
395
+ readonly "aria-activedescendant": RefSubject.Computed<string | undefined, Schema.SchemaError, never>;
396
+ readonly onkeydown: EventHandler.EventHandler<KeyboardEvent, Schema.SchemaError, never> | undefined;
397
+ readonly ontoggle: EventHandler.EventHandler<Event, Schema.SchemaError, never>;
398
+ readonly ref: import("./Dom/Refs.js").ComposedRef<RefSubject.HydratedRefSubject<State, Schema.SchemaError, never, never>, (element: HTMLElement) => Effect.Effect<void, Schema.SchemaError, Scope.Scope>> | undefined;
399
+ };
400
+ type ContentProps<Options extends ContentOptions> = ReturnType<ReturnType<typeof contentProps<Options>>>;
401
+ /**
402
+ * Renders manual-popover listbox content and handles Arrow keys, Enter, Escape, and typeahead.
403
+ *
404
+ * @remarks
405
+ * ## Why
406
+ *
407
+ * The component applies the family behavior while leaving callers free to supply a custom host
408
+ * through the shared DOM boundary.
409
+ *
410
+ * ## Ownership and lifetime
411
+ *
412
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
413
+ * collection registrations only when rendered. The rendering Scope removes those resources;
414
+ * unrelated nodes and attributes remain caller-owned.
415
+ *
416
+ * ## Example
417
+ *
418
+ * Import with `import { Content } from "@typed/ui/Select";` Extend the [Select.makeState runnable
419
+ * setup](/reference/%40typed%2Fui%2FSelect%23makeState). Replace the linked program's final
420
+ * snapshot read with `Content({ state, content: "Timezones" })`; render that Fx before the same
421
+ * Scope closes.
422
+ * @since 1.0.0
423
+ * @category components
424
+ */
425
+ export declare function Content<const Options extends ContentOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, ContentProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
426
+ /**
427
+ * Inputs accepted by Select.Option in addition to the shared DOM host options.
428
+ *
429
+ * @remarks
430
+ * ## Why
431
+ *
432
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
433
+ * visible before rendering.
434
+ *
435
+ * ## Ownership and lifetime
436
+ *
437
+ * This declaration is data or schema metadata and acquires no resources.
438
+ *
439
+ * ## Example
440
+ *
441
+ * Import with `import type { OptionOptions } from "@typed/ui/Select";` Extend the [Select.makeState
442
+ * runnable setup](/reference/%40typed%2Fui%2FSelect%23makeState). A selectable option is
443
+ * `const options: OptionOptions = { state, collection, id: "utc", value: "UTC", content: "UTC" }`.
444
+ * @since 1.0.0
445
+ * @category models
446
+ */
447
+ export interface OptionOptions extends Dom.HostOptions<HTMLDivElement> {
448
+ /**
449
+ * Renderer-independent RefSubject state consumed by this component or operation.
450
+ * @since 1.0.0
451
+ * @category models
452
+ */
453
+ readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
454
+ /**
455
+ * Item registry used for collection-driven keyboard behavior and mounted ordering.
456
+ * @since 1.0.0
457
+ * @category models
458
+ */
459
+ readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
460
+ /**
461
+ * Stable id used for collection identity and ARIA relationships.
462
+ * @since 1.0.0
463
+ * @category models
464
+ */
465
+ readonly id: string;
466
+ /**
467
+ * Current semantic value selected or edited by the widget.
468
+ * @since 1.0.0
469
+ * @category models
470
+ */
471
+ readonly value: string;
472
+ /**
473
+ * Renderable child content for the component host.
474
+ * @since 1.0.0
475
+ * @category models
476
+ */
477
+ readonly content: Renderable.Any;
478
+ /**
479
+ * Search text used by typeahead independently of rendered markup.
480
+ * @since 1.0.0
481
+ * @category models
482
+ */
483
+ readonly textValue?: string;
484
+ /**
485
+ * Flag used by collection movement and widget handlers to skip activation by default.
486
+ * @since 1.0.0
487
+ * @category models
488
+ */
489
+ readonly disabled?: boolean;
490
+ }
491
+ declare function optionProps<const Options extends OptionOptions>(options: Options): () => {
492
+ readonly id: string;
493
+ readonly role: "option";
494
+ readonly "aria-selected": RefSubject.Computed<boolean, Schema.SchemaError, never>;
495
+ readonly "aria-disabled": boolean;
496
+ readonly tabindex: RefSubject.Computed<-1 | 0, Schema.SchemaError, never>;
497
+ readonly onclick: Effect.Effect<void, never, never> | Effect.Effect<State, Schema.SchemaError, never>;
498
+ readonly onfocus: Effect.Effect<void, never, never> | Effect.Effect<State, Schema.SchemaError, never>;
499
+ readonly ref: ((element: Element & HTMLDivElement & RefSubject.HydrationElement) => Effect.Effect<void, any, any>) | undefined;
500
+ };
501
+ type OptionProps<Options extends OptionOptions> = ReturnType<ReturnType<typeof optionProps<Options>>>;
502
+ /**
503
+ * Renders and optionally registers a selectable option; focus updates activeId and click selects
504
+ * unless disabled.
505
+ *
506
+ * @remarks
507
+ * ## Why
508
+ *
509
+ * The component applies the family behavior while leaving callers free to supply a custom host
510
+ * through the shared DOM boundary.
511
+ *
512
+ * ## Ownership and lifetime
513
+ *
514
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
515
+ * collection registrations only when rendered. The rendering Scope removes those resources;
516
+ * unrelated nodes and attributes remain caller-owned.
517
+ *
518
+ * ## Example
519
+ *
520
+ * Import with `import { Option } from "@typed/ui/Select";` Extend the [Select.makeState runnable
521
+ * setup](/reference/%40typed%2Fui%2FSelect%23makeState). Replace the linked program's final
522
+ * snapshot read with `Option({ state, id: "utc", value: "UTC", content: "UTC" })`; render that Fx
523
+ * before the same Scope closes.
524
+ * @since 1.0.0
525
+ * @category components
526
+ */
527
+ export declare function Option<const Options extends OptionOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, OptionProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
528
+ export {};
529
+ //# sourceMappingURL=Select.d.ts.map
@@ -0,0 +1 @@
1
+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