@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,547 @@
1
+ /**
2
+ * Carousel state keeps the active slide and rotation pause policy outside the renderer. Root
3
+ * pauses rotation on focus and pointer entry; slides retain DOM identity while hidden; controls
4
+ * use native button clicks.
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 { type Renderable, type RenderEvent, type RenderTemplate } from "@typed/template";
21
+ import * as Collection from "./Collection.js";
22
+ import * as Dom from "./Dom.js";
23
+ import type { HostResult } from "./Dom/Types.js";
24
+ /**
25
+ * Complete renderer-independent state for Carousel.
26
+ *
27
+ * @remarks
28
+ * ## Why
29
+ *
30
+ * Applications can inspect, update, and test Carousel behavior without mounting or coupling the
31
+ * state to a renderer.
32
+ *
33
+ * ## Ownership and lifetime
34
+ *
35
+ * This declaration is data or schema metadata and acquires no resources.
36
+ *
37
+ * ## Example
38
+ *
39
+ * Import with `import type { State } from "@typed/ui/Carousel";` Extend the [Carousel.makeState
40
+ * runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Inside the linked program,
41
+ * `const snapshot: State = yield* state` exposes `activeId` and `paused` as a renderer-independent
42
+ * value.
43
+ * @since 1.0.0
44
+ * @category models
45
+ */
46
+ export interface State {
47
+ /**
48
+ * Id currently active for keyboard navigation; null means no active item.
49
+ * @since 1.0.0
50
+ * @category models
51
+ */
52
+ readonly activeId: string;
53
+ /**
54
+ * Whether automatic carousel rotation is suspended.
55
+ * @since 1.0.0
56
+ * @category models
57
+ */
58
+ readonly paused: boolean;
59
+ }
60
+ /**
61
+ * Initial Carousel values. activeId is required and paused defaults to true.
62
+ *
63
+ * @remarks
64
+ * ## Why
65
+ *
66
+ * Making initialization explicit documents hydration-sensitive defaults and lets servers and
67
+ * clients construct matching state.
68
+ *
69
+ * ## Ownership and lifetime
70
+ *
71
+ * This declaration is data or schema metadata and acquires no resources.
72
+ *
73
+ * ## Example
74
+ *
75
+ * Import with `import type { InitialState } from "@typed/ui/Carousel";` Extend the
76
+ * [Carousel.makeState runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Construct
77
+ * state with
78
+ * `const initial: InitialState = { activeId: "slide-1", paused: true }; const state = yield* Carousel.makeState(initial)`.
79
+ * @since 1.0.0
80
+ * @category models
81
+ */
82
+ export interface InitialState {
83
+ /**
84
+ * Id currently active for keyboard navigation; null means no active item.
85
+ * @since 1.0.0
86
+ * @category models
87
+ */
88
+ readonly activeId: string;
89
+ /**
90
+ * Whether automatic carousel rotation is suspended.
91
+ * @since 1.0.0
92
+ * @category models
93
+ */
94
+ readonly paused?: boolean;
95
+ }
96
+ /**
97
+ * Effect Schema used by makeState to encode, decode, and hydrate Carousel state.
98
+ *
99
+ * @remarks
100
+ * ## Why
101
+ *
102
+ * A public schema makes hydration and serialized state use the same runtime validation as direct
103
+ * construction.
104
+ *
105
+ * ## Ownership and lifetime
106
+ *
107
+ * This declaration is data or schema metadata and acquires no resources.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * import * as Schema from "effect/Schema";
112
+ * import * as Carousel from "@typed/ui/Carousel";
113
+ *
114
+ * const decodeState = Schema.decodeUnknownEffect(Carousel.StateSchema);
115
+ * ```
116
+ * @since 1.0.0
117
+ * @category schemas
118
+ */
119
+ export declare const StateSchema: Schema.Struct<{
120
+ readonly activeId: Schema.String;
121
+ readonly paused: Schema.Boolean;
122
+ }>;
123
+ /**
124
+ * Creates hydrated Carousel state. activeId is required and paused defaults to true.
125
+ *
126
+ * @remarks
127
+ * ## Why
128
+ *
129
+ * State and collection ownership can be composed and tested independently from any renderer.
130
+ *
131
+ * ## Ownership and lifetime
132
+ *
133
+ * The returned Effect creates the RefSubject when run. That state is renderer-independent;
134
+ * collection registrations belong to the separate Scope that runs register or ref, not to state
135
+ * creation.
136
+ *
137
+ * @example
138
+ * ```ts
139
+ * import * as Effect from "effect/Effect";
140
+ * import * as Carousel from "@typed/ui/Carousel";
141
+ *
142
+ * const program = Effect.scoped(
143
+ * Effect.gen(function* () {
144
+ * const state = yield* Carousel.makeState({ activeId: "slide-1" });
145
+ * const collection = yield* Carousel.makeCollection();
146
+ * return { state: yield* state, collection: yield* collection };
147
+ * }),
148
+ * );
149
+ * ```
150
+ * @since 1.0.0
151
+ * @category constructors
152
+ */
153
+ export declare function makeState(initial: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
154
+ readonly activeId: string;
155
+ readonly paused: boolean;
156
+ }, Schema.SchemaError, never, never>, never, Scope.Scope>;
157
+ /**
158
+ * Creates a scoped Collection for Carousel items.
159
+ *
160
+ * @remarks
161
+ * ## Why
162
+ *
163
+ * State and collection ownership can be composed and tested independently from any renderer.
164
+ *
165
+ * ## Ownership and lifetime
166
+ *
167
+ * The returned Effect allocates the RefSubject in the caller's Scope. Each later registration is
168
+ * owned by the Scope that runs register, independently of this construction Effect.
169
+ *
170
+ * @example
171
+ * ```ts
172
+ * import * as Effect from "effect/Effect";
173
+ * import * as Carousel from "@typed/ui/Carousel";
174
+ *
175
+ * const program = Effect.scoped(
176
+ * Effect.gen(function* () {
177
+ * const collection = yield* Carousel.makeCollection();
178
+ * return yield* collection;
179
+ * }),
180
+ * );
181
+ * ```
182
+ * @since 1.0.0
183
+ * @category constructors
184
+ */
185
+ export declare const makeCollection: (initial?: Collection.State<string, Element>) => Effect.Effect<RefSubject.RefSubject<Collection.State<string, Element>, never, never>, never, Scope.Scope>;
186
+ /**
187
+ * Sets activeId without changing paused state.
188
+ *
189
+ * @remarks
190
+ * ## Why
191
+ *
192
+ * The operation exposes Carousel's transition directly so callers can compose it in Effect
193
+ * programs and native event handlers.
194
+ *
195
+ * ## Ownership and lifetime
196
+ *
197
+ * The returned Effect performs the update or DOM side effect only when run, preserves the declared
198
+ * error and service channels, and retains no resources after completion.
199
+ *
200
+ * ## Example
201
+ *
202
+ * Import with `import { select } from "@typed/ui/Carousel";` Extend the [Carousel.makeState
203
+ * runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Inside the linked Effect
204
+ * program invoke `yield* select(state, "slide-2")`, then read state to observe `activeId` become
205
+ * `"slide-2"` without changing `paused`.
206
+ * @since 1.0.0
207
+ * @category combinators
208
+ */
209
+ export declare function select<E, R>(state: RefSubject.RefSubject<State, E, R>, activeId: string): Effect.Effect<State, E, R>;
210
+ /**
211
+ * Selects the previous or next enabled registered slide; movement wraps and leaves state unchanged
212
+ * for an empty collection.
213
+ *
214
+ * @remarks
215
+ * ## Why
216
+ *
217
+ * The operation exposes Carousel's transition directly so callers can compose it in Effect
218
+ * programs and native event handlers.
219
+ *
220
+ * ## Ownership and lifetime
221
+ *
222
+ * The returned Effect performs the update or DOM side effect only when run, preserves the declared
223
+ * error and service channels, and retains no resources after completion.
224
+ *
225
+ * ## Example
226
+ *
227
+ * Import with `import { move } from "@typed/ui/Carousel";` Extend the [Carousel.makeState runnable
228
+ * setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Inside the linked Effect program invoke
229
+ * `yield* move(state, collection, "next")`, then read the state snapshot to observe the transition
230
+ * described above.
231
+ * @since 1.0.0
232
+ * @category combinators
233
+ */
234
+ export declare function move<E, R, E2, R2>(state: RefSubject.RefSubject<State, E, R>, collection: RefSubject.RefSubject<Collection.State<string>, E2, R2>, direction: "next" | "previous"): Effect.Effect<State, E | E2, R | R2>;
235
+ /**
236
+ * Flips paused and preserves activeId.
237
+ *
238
+ * @remarks
239
+ * ## Why
240
+ *
241
+ * The operation exposes Carousel's transition directly so callers can compose it in Effect
242
+ * programs and native event handlers.
243
+ *
244
+ * ## Ownership and lifetime
245
+ *
246
+ * The returned Effect performs the update or DOM side effect only when run, preserves the declared
247
+ * error and service channels, and retains no resources after completion.
248
+ *
249
+ * ## Example
250
+ *
251
+ * Import with `import { toggleRotation } from "@typed/ui/Carousel";` Extend the [Carousel.makeState
252
+ * runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Inside the linked Effect
253
+ * program invoke `yield* toggleRotation(state)`, then read state to observe `paused` invert without
254
+ * changing `activeId`.
255
+ * @since 1.0.0
256
+ * @category combinators
257
+ */
258
+ export declare function toggleRotation<E, R>(state: RefSubject.RefSubject<State, E, R>): Effect.Effect<State, E, R>;
259
+ /**
260
+ * Inputs accepted by Carousel.Root in addition to the shared DOM host options.
261
+ *
262
+ * @remarks
263
+ * ## Why
264
+ *
265
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
266
+ * visible before rendering.
267
+ *
268
+ * ## Ownership and lifetime
269
+ *
270
+ * This declaration is data or schema metadata and acquires no resources.
271
+ *
272
+ * ## Example
273
+ *
274
+ * Import with `import type { RootOptions } from "@typed/ui/Carousel";` Extend the
275
+ * [Carousel.makeState runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). The root
276
+ * input is concrete: `const options: RootOptions = { state, label: "Featured", content: "Slides" }`.
277
+ * @since 1.0.0
278
+ * @category models
279
+ */
280
+ export interface RootOptions extends Dom.HostOptions<HTMLDivElement> {
281
+ /**
282
+ * Renderer-independent RefSubject state consumed by this component or operation.
283
+ * @since 1.0.0
284
+ * @category models
285
+ */
286
+ readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
287
+ /**
288
+ * Renderable child content for the component host.
289
+ * @since 1.0.0
290
+ * @category models
291
+ */
292
+ readonly content: Renderable.Any;
293
+ /**
294
+ * Accessible label rendered through aria-label.
295
+ * @since 1.0.0
296
+ * @category models
297
+ */
298
+ readonly label: Renderable.Any<string | null | undefined>;
299
+ }
300
+ declare function rootInternalProps<const Options extends RootOptions>(options: Options): ({ property }: Dom.InternalPropsHelpers<Options>) => {
301
+ readonly role: "region";
302
+ readonly "aria-roledescription": "carousel";
303
+ readonly "aria-label": Exclude<Dom.Property<Options, "label">, Dom.Nullish> | undefined;
304
+ readonly onfocusin: Effect.Effect<State, Schema.SchemaError, never>;
305
+ readonly onmouseenter: Effect.Effect<State, Schema.SchemaError, never>;
306
+ readonly onmouseleave: Effect.Effect<void, Schema.SchemaError, never>;
307
+ readonly ref: RefSubject.HydratedRefSubject<State, Schema.SchemaError, never, never>;
308
+ };
309
+ type RootInternalProps<Options extends RootOptions> = ReturnType<ReturnType<typeof rootInternalProps<Options>>>;
310
+ /**
311
+ * Renders the carousel region and pauses automatic rotation on focus or pointer entry without
312
+ * replacing its child nodes.
313
+ *
314
+ * @remarks
315
+ * ## Why
316
+ *
317
+ * The component applies the family behavior while leaving callers free to supply a custom host
318
+ * through the shared DOM boundary.
319
+ *
320
+ * ## Ownership and lifetime
321
+ *
322
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
323
+ * collection registrations only when rendered. The rendering Scope removes those resources;
324
+ * unrelated nodes and attributes remain caller-owned.
325
+ *
326
+ * ## Example
327
+ *
328
+ * Import with `import { Root } from "@typed/ui/Carousel";` Extend the [Carousel.makeState runnable
329
+ * setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Replace the linked program's final
330
+ * snapshot read with `Root({ state, content: "Slides", label: "Featured" })`; render that Fx before
331
+ * the same Scope closes.
332
+ * @since 1.0.0
333
+ * @category components
334
+ */
335
+ export declare function Root<const Options extends RootOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, RootInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
336
+ /**
337
+ * Inputs accepted by Carousel.Slide in addition to the shared DOM host options.
338
+ *
339
+ * @remarks
340
+ * ## Why
341
+ *
342
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
343
+ * visible before rendering.
344
+ *
345
+ * ## Ownership and lifetime
346
+ *
347
+ * This declaration is data or schema metadata and acquires no resources.
348
+ *
349
+ * ## Example
350
+ *
351
+ * Import with `import type { SlideOptions } from "@typed/ui/Carousel";` Extend the
352
+ * [Carousel.makeState runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Register a
353
+ * slide when desired with
354
+ * `const options: SlideOptions = { state, collection, id: "slide-1", label: "1 of 3", content: "First slide" }`.
355
+ * @since 1.0.0
356
+ * @category models
357
+ */
358
+ export interface SlideOptions 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
+ * Stable id used for collection identity and ARIA relationships.
373
+ * @since 1.0.0
374
+ * @category models
375
+ */
376
+ readonly id: string;
377
+ /**
378
+ * Accessible label rendered through aria-label.
379
+ * @since 1.0.0
380
+ * @category models
381
+ */
382
+ readonly label: Renderable.Any<string | null | undefined>;
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 slideInternalProps<const Options extends SlideOptions>(options: Options): ({ property }: Dom.InternalPropsHelpers<Options>) => {
391
+ readonly id: string;
392
+ readonly role: "group";
393
+ readonly "aria-roledescription": "slide";
394
+ readonly "aria-label": Exclude<Dom.Property<Options, "label">, Dom.Nullish> | undefined;
395
+ readonly "?hidden": RefSubject.Computed<boolean, Schema.SchemaError, never>;
396
+ readonly ref: ((element: Element) => Effect.Effect<void, never, Scope.Scope>) | undefined;
397
+ };
398
+ type SlideInternalProps<Options extends SlideOptions> = ReturnType<ReturnType<typeof slideInternalProps<Options>>>;
399
+ /**
400
+ * Renders one labelled slide, registers it when a collection is supplied, and toggles hidden from
401
+ * activeId.
402
+ *
403
+ * @remarks
404
+ * ## Why
405
+ *
406
+ * The component applies the family behavior while leaving callers free to supply a custom host
407
+ * through the shared DOM boundary.
408
+ *
409
+ * ## Ownership and lifetime
410
+ *
411
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
412
+ * collection registrations only when rendered. The rendering Scope removes those resources;
413
+ * unrelated nodes and attributes remain caller-owned.
414
+ *
415
+ * ## Example
416
+ *
417
+ * Import with `import { Slide } from "@typed/ui/Carousel";` Extend the [Carousel.makeState runnable
418
+ * setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Replace the linked program's final
419
+ * snapshot read with `Slide({ state, id: "slide-1", label: "1 of 3", content: "First slide" })`;
420
+ * render that Fx before the same Scope closes.
421
+ * @since 1.0.0
422
+ * @category components
423
+ */
424
+ export declare function Slide<const Options extends SlideOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, SlideInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
425
+ /**
426
+ * Inputs accepted by Carousel.Control in addition to the shared DOM host options.
427
+ *
428
+ * @remarks
429
+ * ## Why
430
+ *
431
+ * The options type makes required state, content, accessible relationships, and custom-host inputs
432
+ * visible before rendering.
433
+ *
434
+ * ## Ownership and lifetime
435
+ *
436
+ * This declaration is data or schema metadata and acquires no resources.
437
+ *
438
+ * ## Example
439
+ *
440
+ * Import with `import type { ControlOptions } from "@typed/ui/Carousel";` Extend the
441
+ * [Carousel.makeState runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). A
442
+ * collection is optional for controls:
443
+ * `const options: ControlOptions = { state, collection, content: "Next" }`.
444
+ * @since 1.0.0
445
+ * @category models
446
+ */
447
+ export interface ControlOptions extends Dom.HostOptions<HTMLButtonElement> {
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
+ * Renderable child content for the component host.
462
+ * @since 1.0.0
463
+ * @category models
464
+ */
465
+ readonly content: Renderable.Any;
466
+ }
467
+ declare function controlInternalProps<const Options extends ControlOptions>(options: Options, action: Effect.Effect<unknown, Schema.SchemaError>): () => {
468
+ readonly type: "button";
469
+ readonly onclick: Effect.Effect<unknown, Schema.SchemaError, never>;
470
+ };
471
+ /**
472
+ * Renders a button whose native click selects the previous registered slide with wrapping enabled.
473
+ *
474
+ * @remarks
475
+ * ## Why
476
+ *
477
+ * The component applies the family behavior while leaving callers free to supply a custom host
478
+ * through the shared DOM boundary.
479
+ *
480
+ * ## Ownership and lifetime
481
+ *
482
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
483
+ * collection registrations only when rendered. The rendering Scope removes those resources;
484
+ * unrelated nodes and attributes remain caller-owned.
485
+ *
486
+ * ## Example
487
+ *
488
+ * Import with `import { Previous } from "@typed/ui/Carousel";` Extend the [Carousel.makeState
489
+ * runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Replace the linked program's
490
+ * final snapshot read with `Previous({ state, content: "Previous" })`; render that Fx before the
491
+ * same Scope closes.
492
+ * @since 1.0.0
493
+ * @category components
494
+ */
495
+ export declare function Previous<const Options extends ControlOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, ReturnType<ReturnType<typeof controlInternalProps<Options>>>>, Options["content"], Host>): import("./Dom/Types.js").HostComponent<Host | Options>;
496
+ /**
497
+ * Renders a button whose native click selects the next registered slide with wrapping enabled.
498
+ *
499
+ * @remarks
500
+ * ## Why
501
+ *
502
+ * The component applies the family behavior while leaving callers free to supply a custom host
503
+ * through the shared DOM boundary.
504
+ *
505
+ * ## Ownership and lifetime
506
+ *
507
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
508
+ * collection registrations only when rendered. The rendering Scope removes those resources;
509
+ * unrelated nodes and attributes remain caller-owned.
510
+ *
511
+ * ## Example
512
+ *
513
+ * Import with `import { Next } from "@typed/ui/Carousel";` Extend the [Carousel.makeState runnable
514
+ * setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Replace the linked program's final
515
+ * snapshot read with `Next({ state, content: "Next" })`; render that Fx before the same Scope
516
+ * closes.
517
+ * @since 1.0.0
518
+ * @category components
519
+ */
520
+ export declare function Next<const Options extends ControlOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, ReturnType<ReturnType<typeof controlInternalProps<Options>>>>, Options["content"], Host>): import("./Dom/Types.js").HostComponent<Host | Options>;
521
+ /**
522
+ * Renders a button whose native click toggles the explicit paused state.
523
+ *
524
+ * @remarks
525
+ * ## Why
526
+ *
527
+ * The component applies the family behavior while leaving callers free to supply a custom host
528
+ * through the shared DOM boundary.
529
+ *
530
+ * ## Ownership and lifetime
531
+ *
532
+ * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
533
+ * collection registrations only when rendered. The rendering Scope removes those resources;
534
+ * unrelated nodes and attributes remain caller-owned.
535
+ *
536
+ * ## Example
537
+ *
538
+ * Import with `import { RotationControl } from "@typed/ui/Carousel";` Extend the
539
+ * [Carousel.makeState runnable setup](/reference/%40typed%2Fui%2FCarousel%23makeState). Replace the
540
+ * linked program's final snapshot read with `RotationControl({ state, content: "Pause rotation"
541
+ * })`; render that Fx before the same Scope closes.
542
+ * @since 1.0.0
543
+ * @category components
544
+ */
545
+ export declare function RotationControl<const Options extends Omit<ControlOptions, "collection">, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, ReturnType<ReturnType<typeof controlInternalProps<Options>>>>, Options["content"], Host>): import("./Dom/Types.js").HostComponent<Host | Options>;
546
+ export {};
547
+ //# sourceMappingURL=Carousel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../src/Carousel.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,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAA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