@typed/ui 1.0.0-beta.6 → 1.0.0-beta.8

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 (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/dist/Alert.d.ts +35 -41
  4. package/dist/Alert.d.ts.map +1 -1
  5. package/dist/Alert.js +23 -20
  6. package/dist/Button.d.ts +34 -78
  7. package/dist/Button.d.ts.map +1 -1
  8. package/dist/Button.js +16 -12
  9. package/dist/Carousel.d.ts +35 -236
  10. package/dist/Carousel.d.ts.map +1 -1
  11. package/dist/Carousel.js +13 -136
  12. package/dist/Checkbox.d.ts +55 -90
  13. package/dist/Checkbox.d.ts.map +1 -1
  14. package/dist/Checkbox.js +44 -38
  15. package/dist/Collection.d.ts +15 -15
  16. package/dist/Collection.js +7 -7
  17. package/dist/Combobox.d.ts +38 -187
  18. package/dist/Combobox.d.ts.map +1 -1
  19. package/dist/Combobox.js +9 -80
  20. package/dist/Component.d.ts +30 -24
  21. package/dist/Component.d.ts.map +1 -1
  22. package/dist/Component.js +23 -12
  23. package/dist/Composite.d.ts +50 -50
  24. package/dist/Composite.js +20 -20
  25. package/dist/Dialog.d.ts +34 -34
  26. package/dist/Dialog.d.ts.map +1 -1
  27. package/dist/Dialog.js +16 -14
  28. package/dist/Disclosure.d.ts +15 -15
  29. package/dist/Disclosure.js +6 -6
  30. package/dist/Dom/Events.d.ts +4 -4
  31. package/dist/Dom/Events.js +4 -4
  32. package/dist/Dom/Props.d.ts +9 -9
  33. package/dist/Dom/Props.js +4 -4
  34. package/dist/Dom/Refs.d.ts +2 -2
  35. package/dist/Dom/Refs.js +1 -1
  36. package/dist/Dom/Render.d.ts +2 -2
  37. package/dist/Dom/Render.js +2 -2
  38. package/dist/Dom/Types.d.ts +33 -33
  39. package/dist/Dom/index.d.ts +5 -5
  40. package/dist/Dom/index.d.ts.map +1 -1
  41. package/dist/Dom/index.js +4 -4
  42. package/dist/Dom.d.ts +1 -1
  43. package/dist/Dom.js +1 -1
  44. package/dist/Focusable.d.ts +5 -5
  45. package/dist/Focusable.js +1 -1
  46. package/dist/Form.d.ts +565 -533
  47. package/dist/Form.d.ts.map +1 -1
  48. package/dist/Form.js +350 -195
  49. package/dist/Grid.d.ts +39 -220
  50. package/dist/Grid.d.ts.map +1 -1
  51. package/dist/Grid.js +12 -107
  52. package/dist/Group.d.ts +50 -69
  53. package/dist/Group.d.ts.map +1 -1
  54. package/dist/Group.js +33 -25
  55. package/dist/Heading.d.ts +41 -40
  56. package/dist/Heading.d.ts.map +1 -1
  57. package/dist/Heading.js +26 -16
  58. package/dist/Hovercard.d.ts +18 -18
  59. package/dist/Hovercard.js +6 -6
  60. package/dist/HttpRouter.d.ts +3 -3
  61. package/dist/HttpRouter.js +5 -5
  62. package/dist/Link.d.ts +17 -21
  63. package/dist/Link.d.ts.map +1 -1
  64. package/dist/Link.js +11 -0
  65. package/dist/Listbox.d.ts +31 -163
  66. package/dist/Listbox.d.ts.map +1 -1
  67. package/dist/Listbox.js +9 -80
  68. package/dist/Menu.d.ts +67 -376
  69. package/dist/Menu.d.ts.map +1 -1
  70. package/dist/Menu.js +17 -179
  71. package/dist/Menubar.d.ts +24 -142
  72. package/dist/Menubar.d.ts.map +1 -1
  73. package/dist/Menubar.js +8 -66
  74. package/dist/Meter.d.ts +72 -132
  75. package/dist/Meter.d.ts.map +1 -1
  76. package/dist/Meter.js +35 -42
  77. package/dist/NativeDetails.d.ts +1 -1
  78. package/dist/NativeDetails.js +1 -1
  79. package/dist/NativeDialog.d.ts +7 -5
  80. package/dist/NativeDialog.d.ts.map +1 -1
  81. package/dist/NativeDialog.js +42 -4
  82. package/dist/NativePopover.d.ts +6 -4
  83. package/dist/NativePopover.d.ts.map +1 -1
  84. package/dist/NativePopover.js +43 -5
  85. package/dist/Popover.d.ts +18 -19
  86. package/dist/Popover.d.ts.map +1 -1
  87. package/dist/Popover.js +7 -8
  88. package/dist/RadioGroup.d.ts +86 -188
  89. package/dist/RadioGroup.d.ts.map +1 -1
  90. package/dist/RadioGroup.js +55 -105
  91. package/dist/Role.d.ts +4 -4
  92. package/dist/Role.js +1 -1
  93. package/dist/Select.d.ts +109 -220
  94. package/dist/Select.d.ts.map +1 -1
  95. package/dist/Select.js +67 -117
  96. package/dist/Separator.d.ts +30 -26
  97. package/dist/Separator.d.ts.map +1 -1
  98. package/dist/Separator.js +16 -10
  99. package/dist/Slider.d.ts +64 -111
  100. package/dist/Slider.d.ts.map +1 -1
  101. package/dist/Slider.js +47 -42
  102. package/dist/SpinButton.d.ts +64 -111
  103. package/dist/SpinButton.d.ts.map +1 -1
  104. package/dist/SpinButton.js +47 -42
  105. package/dist/Storybook.d.ts +2 -2
  106. package/dist/Storybook.js +1 -1
  107. package/dist/Switch.d.ts +52 -91
  108. package/dist/Switch.d.ts.map +1 -1
  109. package/dist/Switch.js +30 -36
  110. package/dist/Tabs.d.ts +44 -224
  111. package/dist/Tabs.d.ts.map +1 -1
  112. package/dist/Tabs.js +10 -94
  113. package/dist/Toolbar.d.ts +24 -142
  114. package/dist/Toolbar.d.ts.map +1 -1
  115. package/dist/Toolbar.js +8 -66
  116. package/dist/Tooltip.d.ts +20 -20
  117. package/dist/Tooltip.js +6 -6
  118. package/dist/Tree.d.ts +43 -229
  119. package/dist/Tree.d.ts.map +1 -1
  120. package/dist/Tree.js +12 -113
  121. package/dist/TreeGrid.d.ts +45 -264
  122. package/dist/TreeGrid.d.ts.map +1 -1
  123. package/dist/TreeGrid.js +13 -125
  124. package/dist/VisuallyHidden.d.ts +41 -27
  125. package/dist/VisuallyHidden.d.ts.map +1 -1
  126. package/dist/VisuallyHidden.js +27 -10
  127. package/dist/WindowSplitter.d.ts +68 -108
  128. package/dist/WindowSplitter.d.ts.map +1 -1
  129. package/dist/WindowSplitter.js +106 -23
  130. package/package.json +13 -12
package/dist/Menubar.d.ts CHANGED
@@ -7,6 +7,8 @@
7
7
  * the state and pure operations without mounting UI, or supply custom hosts without replacing native
8
8
  * events and browser-owned focus.
9
9
  *
10
+ * Learn the interaction in the [Menubar guide](/explore/ui-menubar).
11
+ *
10
12
  * @since 1.0.0
11
13
  * @category modules
12
14
  * @packageDocumentation
@@ -22,64 +24,25 @@ import * as Composite from "./Composite.js";
22
24
  import * as Dom from "./Dom.js";
23
25
  import type { HostResult } from "./Dom/Types.js";
24
26
  /**
25
- * Complete renderer-independent state for Menubar.
26
- *
27
- * @remarks
28
- * ## Why
29
- *
30
- * Applications can inspect, update, and test Menubar 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.
27
+ * The active top-level command and horizontal navigation policy.
28
+ * Child menu visibility belongs to the separate Menu state connected by its submenu trigger.
36
29
  *
37
- * ## Example
38
- *
39
- * Import with `import type { State } from "@typed/ui/Menubar";` Extend the [Menubar.makeState
40
- * runnable setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Inside the linked program,
41
- * `const snapshot: State = yield* state` exposes the shared composite focus policy.
42
30
  * @since 1.0.0
43
- * @category models
31
+ * @category Command focus
44
32
  */
45
33
  export interface State extends Composite.State {
46
34
  }
47
35
  /**
48
36
  * Initial Menubar values. Uses Composite defaults unless overridden.
49
37
  *
50
- * @remarks
51
- * ## Why
52
- *
53
- * Making initialization explicit documents hydration-sensitive defaults and lets servers and
54
- * clients construct matching state.
55
- *
56
- * ## Ownership and lifetime
57
- *
58
- * This declaration is data or schema metadata and acquires no resources.
59
- *
60
- * ## Example
61
- *
62
- * Import with `import type { InitialState } from "@typed/ui/Menubar";` Extend the
63
- * [Menubar.makeState runnable setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Construct a
64
- * horizontal menubar with
65
- * `const initial: InitialState = { orientation: "horizontal" }; const state = yield* Menubar.makeState(initial)`.
66
38
  * @since 1.0.0
67
- * @category models
39
+ * @category Command focus
68
40
  */
69
41
  export type InitialState = Composite.InitialState;
70
42
  /**
71
43
  * Effect Schema used by makeState to encode, decode, and hydrate Menubar state.
72
44
  *
73
45
  * @remarks
74
- * ## Why
75
- *
76
- * A public schema makes hydration and serialized state use the same runtime validation as direct
77
- * construction.
78
- *
79
- * ## Ownership and lifetime
80
- *
81
- * This declaration is data or schema metadata and acquires no resources.
82
- *
83
46
  * @example
84
47
  * ```ts
85
48
  * import * as Schema from "effect/Schema";
@@ -88,7 +51,7 @@ export type InitialState = Composite.InitialState;
88
51
  * const decodeState = Schema.decodeUnknownEffect(Menubar.StateSchema);
89
52
  * ```
90
53
  * @since 1.0.0
91
- * @category schemas
54
+ * @category Command focus
92
55
  */
93
56
  export declare const StateSchema: Schema.Struct<{
94
57
  readonly activeId: Schema.NullOr<Schema.String>;
@@ -101,12 +64,6 @@ export declare const StateSchema: Schema.Struct<{
101
64
  * Creates hydrated Menubar state. Uses Composite defaults unless overridden.
102
65
  *
103
66
  * @remarks
104
- * ## Why
105
- *
106
- * State and collection ownership can be composed and tested independently from any renderer.
107
- *
108
- * ## Ownership and lifetime
109
- *
110
67
  * The returned Effect creates the RefSubject when run. That state is renderer-independent;
111
68
  * collection registrations belong to the separate Scope that runs register or ref, not to state
112
69
  * creation.
@@ -125,7 +82,7 @@ export declare const StateSchema: Schema.Struct<{
125
82
  * );
126
83
  * ```
127
84
  * @since 1.0.0
128
- * @category constructors
85
+ * @category Command focus
129
86
  */
130
87
  export declare function makeState(initial?: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
131
88
  readonly activeId: string | null;
@@ -138,12 +95,6 @@ export declare function makeState(initial?: InitialState): Effect.Effect<RefSubj
138
95
  * Creates a scoped Collection for Menubar items.
139
96
  *
140
97
  * @remarks
141
- * ## Why
142
- *
143
- * State and collection ownership can be composed and tested independently from any renderer.
144
- *
145
- * ## Ownership and lifetime
146
- *
147
98
  * The returned Effect allocates the RefSubject in the caller's Scope. Each later registration is
148
99
  * owned by the Scope that runs register, independently of this construction Effect.
149
100
  *
@@ -160,53 +111,38 @@ export declare function makeState(initial?: InitialState): Effect.Effect<RefSubj
160
111
  * );
161
112
  * ```
162
113
  * @since 1.0.0
163
- * @category constructors
114
+ * @category Command registration
164
115
  */
165
116
  export declare const makeCollection: (initial?: Collection.State<string, Element>) => Effect.Effect<RefSubject.RefSubject<Collection.State<string, Element>, never, never>, never, Scope.Scope>;
166
117
  /**
167
118
  * Inputs accepted by Menubar.Root in addition to the shared DOM host options.
168
119
  *
169
- * @remarks
170
- * ## Why
171
- *
172
- * The options type makes required state, content, accessible relationships, and custom-host inputs
173
- * visible before rendering.
174
- *
175
- * ## Ownership and lifetime
176
- *
177
- * This declaration is data or schema metadata and acquires no resources.
178
- *
179
- * ## Example
180
- *
181
- * Import with `import type { RootOptions } from "@typed/ui/Menubar";` Extend the [Menubar.makeState
182
- * runnable setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Enable top-level menu movement
183
- * with `const options: RootOptions = { state, collection, label: "Application", content: "Menus" }`.
184
120
  * @since 1.0.0
185
- * @category models
121
+ * @category Menubar surface
186
122
  */
187
123
  export interface RootOptions extends Dom.HostOptions<HTMLDivElement> {
188
124
  /**
189
125
  * Renderer-independent RefSubject state consumed by this component or operation.
190
126
  * @since 1.0.0
191
- * @category models
127
+ * @category State connection
192
128
  */
193
129
  readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
194
130
  /**
195
131
  * Item registry used for collection-driven keyboard behavior and mounted ordering.
196
132
  * @since 1.0.0
197
- * @category models
133
+ * @category Item registration
198
134
  */
199
135
  readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
200
136
  /**
201
137
  * Renderable child content for the component host.
202
138
  * @since 1.0.0
203
- * @category models
139
+ * @category Rendered content
204
140
  */
205
141
  readonly content: Renderable.Any;
206
142
  /**
207
143
  * Accessible label rendered through aria-label.
208
144
  * @since 1.0.0
209
- * @category models
145
+ * @category Accessible naming
210
146
  */
211
147
  readonly label?: Renderable.Any<string | null | undefined>;
212
148
  }
@@ -224,107 +160,66 @@ type RootProps<Options extends RootOptions> = ReturnType<ReturnType<typeof rootP
224
160
  * Renders the persistent menubar root with roving focus, orientation-aware keys, and typeahead.
225
161
  *
226
162
  * @remarks
227
- * ## Why
228
- *
229
- * The component applies the family behavior while leaving callers free to supply a custom host
230
- * through the shared DOM boundary.
231
- *
232
- * ## Ownership and lifetime
233
- *
234
163
  * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
235
164
  * collection registrations only when rendered. The rendering Scope removes those resources;
236
165
  * unrelated nodes and attributes remain caller-owned.
237
166
  *
238
- * ## Example
239
- *
240
- * Import with `import { Root } from "@typed/ui/Menubar";` Extend the [Menubar.makeState runnable
241
- * setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Replace the linked program's final
242
- * snapshot read with `Root({ state, label: "Application", content: "Menus" })`; render that Fx
243
- * before the same Scope closes.
244
167
  * @since 1.0.0
245
- * @category components
168
+ * @category Menubar surface
246
169
  */
247
170
  export declare function Root<const Options extends RootOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, RootProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
248
171
  /**
249
172
  * Consumer-facing alias of the canonical Menubar component with identical behavior and lifetime.
250
173
  *
251
174
  * @remarks
252
- * ## Why
253
- *
254
- * The component applies the family behavior while leaving callers free to supply a custom host
255
- * through the shared DOM boundary.
256
- *
257
- * ## Ownership and lifetime
258
- *
259
175
  * The alias acquires nothing. Rendering it has exactly the canonical component's Scope and DOM
260
176
  * ownership contract.
261
177
  *
262
- * ## Example
263
- *
264
- * Import with `import { Menubar } from "@typed/ui/Menubar";` Extend the [Menubar.makeState runnable
265
- * setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Replace the linked program's final
266
- * snapshot read with `Menubar({ state, label: "Application", content: "Menus" })`; render that Fx
267
- * before the same Scope closes.
268
178
  * @since 1.0.0
269
- * @category components
179
+ * @category Menubar surface
270
180
  */
271
181
  export declare const Menubar: typeof Root;
272
182
  /**
273
183
  * Inputs accepted by Menubar.Item in addition to the shared DOM host options.
274
184
  *
275
- * @remarks
276
- * ## Why
277
- *
278
- * The options type makes required state, content, accessible relationships, and custom-host inputs
279
- * visible before rendering.
280
- *
281
- * ## Ownership and lifetime
282
- *
283
- * This declaration is data or schema metadata and acquires no resources.
284
- *
285
- * ## Example
286
- *
287
- * Import with `import type { ItemOptions } from "@typed/ui/Menubar";` Extend the [Menubar.makeState
288
- * runnable setup](/reference/%40typed%2Fui%2FMenubar%23makeState). A top-level menu item is
289
- * `const options: ItemOptions = { state, collection, id: "file", content: "File" }`.
290
185
  * @since 1.0.0
291
- * @category models
186
+ * @category Top-level commands
292
187
  */
293
188
  export interface ItemOptions extends Dom.HostOptions<HTMLDivElement> {
294
189
  /**
295
190
  * Renderer-independent RefSubject state consumed by this component or operation.
296
191
  * @since 1.0.0
297
- * @category models
192
+ * @category State connection
298
193
  */
299
194
  readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
300
195
  /**
301
196
  * Item registry used for collection-driven keyboard behavior and mounted ordering.
302
197
  * @since 1.0.0
303
- * @category models
198
+ * @category Item registration
304
199
  */
305
200
  readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
306
201
  /**
307
202
  * Stable id used for collection identity and ARIA relationships.
308
203
  * @since 1.0.0
309
- * @category models
204
+ * @category Identity and relationships
310
205
  */
311
206
  readonly id: string;
312
207
  /**
313
208
  * Renderable child content for the component host.
314
209
  * @since 1.0.0
315
- * @category models
210
+ * @category Rendered content
316
211
  */
317
212
  readonly content: Renderable.Any;
318
213
  /**
319
214
  * Search text used by typeahead independently of rendered markup.
320
215
  * @since 1.0.0
321
- * @category models
216
+ * @category Text matching
322
217
  */
323
218
  readonly textValue?: string;
324
219
  /**
325
220
  * Flag used by collection movement and widget handlers to skip activation by default.
326
221
  * @since 1.0.0
327
- * @category models
222
+ * @category Availability
328
223
  */
329
224
  readonly disabled?: boolean;
330
225
  }
@@ -342,25 +237,12 @@ type ItemProps<Options extends ItemOptions> = ReturnType<ReturnType<typeof itemP
342
237
  * Renders a registered menuitem and runs onActivate for native focus or click unless disabled.
343
238
  *
344
239
  * @remarks
345
- * ## Why
346
- *
347
- * The component applies the family behavior while leaving callers free to supply a custom host
348
- * through the shared DOM boundary.
349
- *
350
- * ## Ownership and lifetime
351
- *
352
240
  * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
353
241
  * collection registrations only when rendered. The rendering Scope removes those resources;
354
242
  * unrelated nodes and attributes remain caller-owned.
355
243
  *
356
- * ## Example
357
- *
358
- * Import with `import { Item } from "@typed/ui/Menubar";` Extend the [Menubar.makeState runnable
359
- * setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Replace the linked program's final
360
- * snapshot read with `Item({ state, id: "file", content: "File" })`; render that Fx before the same
361
- * Scope closes.
362
244
  * @since 1.0.0
363
- * @category components
245
+ * @category Top-level commands
364
246
  */
365
247
  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>;
366
248
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Menubar.d.ts","sourceRoot":"","sources":["../src/Menubar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;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,EACL,YAAY,EAEZ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAA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,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,iBAAS,SAAS,CAAC,KAAK,CAAC,OAAO,SAAS,WAAW,EAAE,OAAO,EAAE,OAAO;aAiBhE,EAAE;aACF,IAAI,EAAE,UAAU;aAChB,eAAe;aACf,QAAQ;aACR,OAAO;aACP,OAAO;aACP,GAAG;EAER;AACD,KAAK,SAAS,CAAC,OAAO,SAAS,WAAW,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAEhG;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,KAAK,CAAC,OAAO,SAAS,WAAW,EAAE,KAAK,CAAC,IAAI,SAAS,UAAU,GAAG,KAAK,EAC3F,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,GAAG,CAAC,YAAY,CACrB,GAAG,CAAC,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,EAChD,OAAO,CAAC,SAAS,CAAC,EAClB,IAAI,CACL,GACA,EAAE,CACH,WAAW,EACX,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,EAChC,UAAU,CAAC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,cAAc,CACnE,CAcA"}
package/dist/Menubar.js CHANGED
@@ -7,6 +7,8 @@
7
7
  * the state and pure operations without mounting UI, or supply custom hosts without replacing native
8
8
  * events and browser-owned focus.
9
9
  *
10
+ * Learn the interaction in the [Menubar guide](/explore/ui-menubar).
11
+ *
10
12
  * @since 1.0.0
11
13
  * @category modules
12
14
  * @packageDocumentation
@@ -21,15 +23,6 @@ import * as Dom from "./Dom.js";
21
23
  * Effect Schema used by makeState to encode, decode, and hydrate Menubar state.
22
24
  *
23
25
  * @remarks
24
- * ## Why
25
- *
26
- * A public schema makes hydration and serialized state use the same runtime validation as direct
27
- * construction.
28
- *
29
- * ## Ownership and lifetime
30
- *
31
- * This declaration is data or schema metadata and acquires no resources.
32
- *
33
26
  * @example
34
27
  * ```ts
35
28
  * import * as Schema from "effect/Schema";
@@ -38,19 +31,13 @@ import * as Dom from "./Dom.js";
38
31
  * const decodeState = Schema.decodeUnknownEffect(Menubar.StateSchema);
39
32
  * ```
40
33
  * @since 1.0.0
41
- * @category schemas
34
+ * @category Command focus
42
35
  */
43
36
  export const StateSchema = Composite.StateSchema;
44
37
  /**
45
38
  * Creates hydrated Menubar state. Uses Composite defaults unless overridden.
46
39
  *
47
40
  * @remarks
48
- * ## Why
49
- *
50
- * State and collection ownership can be composed and tested independently from any renderer.
51
- *
52
- * ## Ownership and lifetime
53
- *
54
41
  * The returned Effect creates the RefSubject when run. That state is renderer-independent;
55
42
  * collection registrations belong to the separate Scope that runs register or ref, not to state
56
43
  * creation.
@@ -69,7 +56,7 @@ export const StateSchema = Composite.StateSchema;
69
56
  * );
70
57
  * ```
71
58
  * @since 1.0.0
72
- * @category constructors
59
+ * @category Command focus
73
60
  */
74
61
  export function makeState(initial = {}) {
75
62
  return Composite.makeState({ ...initial, orientation: initial.orientation ?? "horizontal" });
@@ -78,12 +65,6 @@ export function makeState(initial = {}) {
78
65
  * Creates a scoped Collection for Menubar items.
79
66
  *
80
67
  * @remarks
81
- * ## Why
82
- *
83
- * State and collection ownership can be composed and tested independently from any renderer.
84
- *
85
- * ## Ownership and lifetime
86
- *
87
68
  * The returned Effect allocates the RefSubject in the caller's Scope. Each later registration is
88
69
  * owned by the Scope that runs register, independently of this construction Effect.
89
70
  *
@@ -100,7 +81,7 @@ export function makeState(initial = {}) {
100
81
  * );
101
82
  * ```
102
83
  * @since 1.0.0
103
- * @category constructors
84
+ * @category Command registration
104
85
  */
105
86
  export const makeCollection = Collection.makeState;
106
87
  function rootProps(options) {
@@ -164,25 +145,12 @@ function rootProps(options) {
164
145
  * Renders the persistent menubar root with roving focus, orientation-aware keys, and typeahead.
165
146
  *
166
147
  * @remarks
167
- * ## Why
168
- *
169
- * The component applies the family behavior while leaving callers free to supply a custom host
170
- * through the shared DOM boundary.
171
- *
172
- * ## Ownership and lifetime
173
- *
174
148
  * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
175
149
  * collection registrations only when rendered. The rendering Scope removes those resources;
176
150
  * unrelated nodes and attributes remain caller-owned.
177
151
  *
178
- * ## Example
179
- *
180
- * Import with `import { Root } from "@typed/ui/Menubar";` Extend the [Menubar.makeState runnable
181
- * setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Replace the linked program's final
182
- * snapshot read with `Root({ state, label: "Application", content: "Menus" })`; render that Fx
183
- * before the same Scope closes.
184
152
  * @since 1.0.0
185
- * @category components
153
+ * @category Menubar surface
186
154
  */
187
155
  export function Root(options, host) {
188
156
  return Dom.renderHost()(options, host, rootProps(options), options.content, (props, content) => {
@@ -193,24 +161,11 @@ export function Root(options, host) {
193
161
  * Consumer-facing alias of the canonical Menubar component with identical behavior and lifetime.
194
162
  *
195
163
  * @remarks
196
- * ## Why
197
- *
198
- * The component applies the family behavior while leaving callers free to supply a custom host
199
- * through the shared DOM boundary.
200
- *
201
- * ## Ownership and lifetime
202
- *
203
164
  * The alias acquires nothing. Rendering it has exactly the canonical component's Scope and DOM
204
165
  * ownership contract.
205
166
  *
206
- * ## Example
207
- *
208
- * Import with `import { Menubar } from "@typed/ui/Menubar";` Extend the [Menubar.makeState runnable
209
- * setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Replace the linked program's final
210
- * snapshot read with `Menubar({ state, label: "Application", content: "Menus" })`; render that Fx
211
- * before the same Scope closes.
212
167
  * @since 1.0.0
213
- * @category components
168
+ * @category Menubar surface
214
169
  */
215
170
  export const Menubar = Root;
216
171
  function itemProps(options) {
@@ -240,25 +195,12 @@ function itemProps(options) {
240
195
  * Renders a registered menuitem and runs onActivate for native focus or click unless disabled.
241
196
  *
242
197
  * @remarks
243
- * ## Why
244
- *
245
- * The component applies the family behavior while leaving callers free to supply a custom host
246
- * through the shared DOM boundary.
247
- *
248
- * ## Ownership and lifetime
249
- *
250
198
  * The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
251
199
  * collection registrations only when rendered. The rendering Scope removes those resources;
252
200
  * unrelated nodes and attributes remain caller-owned.
253
201
  *
254
- * ## Example
255
- *
256
- * Import with `import { Item } from "@typed/ui/Menubar";` Extend the [Menubar.makeState runnable
257
- * setup](/reference/%40typed%2Fui%2FMenubar%23makeState). Replace the linked program's final
258
- * snapshot read with `Item({ state, id: "file", content: "File" })`; render that Fx before the same
259
- * Scope closes.
260
202
  * @since 1.0.0
261
- * @category components
203
+ * @category Top-level commands
262
204
  */
263
205
  export function Item(options, host) {
264
206
  return Dom.renderHost()(options, host, itemProps(options), options.content, (props, content) => html `<div ...${props}>${content}</div>`);