@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.
- package/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/Alert.d.ts +35 -41
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Alert.js +23 -20
- package/dist/Button.d.ts +34 -78
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +16 -12
- package/dist/Carousel.d.ts +35 -236
- package/dist/Carousel.d.ts.map +1 -1
- package/dist/Carousel.js +13 -136
- package/dist/Checkbox.d.ts +55 -90
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +44 -38
- package/dist/Collection.d.ts +15 -15
- package/dist/Collection.js +7 -7
- package/dist/Combobox.d.ts +38 -187
- package/dist/Combobox.d.ts.map +1 -1
- package/dist/Combobox.js +9 -80
- package/dist/Component.d.ts +30 -24
- package/dist/Component.d.ts.map +1 -1
- package/dist/Component.js +23 -12
- package/dist/Composite.d.ts +50 -50
- package/dist/Composite.js +20 -20
- package/dist/Dialog.d.ts +34 -34
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +16 -14
- package/dist/Disclosure.d.ts +15 -15
- package/dist/Disclosure.js +6 -6
- package/dist/Dom/Events.d.ts +4 -4
- package/dist/Dom/Events.js +4 -4
- package/dist/Dom/Props.d.ts +9 -9
- package/dist/Dom/Props.js +4 -4
- package/dist/Dom/Refs.d.ts +2 -2
- package/dist/Dom/Refs.js +1 -1
- package/dist/Dom/Render.d.ts +2 -2
- package/dist/Dom/Render.js +2 -2
- package/dist/Dom/Types.d.ts +33 -33
- package/dist/Dom/index.d.ts +5 -5
- package/dist/Dom/index.d.ts.map +1 -1
- package/dist/Dom/index.js +4 -4
- package/dist/Dom.d.ts +1 -1
- package/dist/Dom.js +1 -1
- package/dist/Focusable.d.ts +5 -5
- package/dist/Focusable.js +1 -1
- package/dist/Form.d.ts +565 -533
- package/dist/Form.d.ts.map +1 -1
- package/dist/Form.js +350 -195
- package/dist/Grid.d.ts +39 -220
- package/dist/Grid.d.ts.map +1 -1
- package/dist/Grid.js +12 -107
- package/dist/Group.d.ts +50 -69
- package/dist/Group.d.ts.map +1 -1
- package/dist/Group.js +33 -25
- package/dist/Heading.d.ts +41 -40
- package/dist/Heading.d.ts.map +1 -1
- package/dist/Heading.js +26 -16
- package/dist/Hovercard.d.ts +18 -18
- package/dist/Hovercard.js +6 -6
- package/dist/HttpRouter.d.ts +3 -3
- package/dist/HttpRouter.js +5 -5
- package/dist/Link.d.ts +17 -21
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +11 -0
- package/dist/Listbox.d.ts +31 -163
- package/dist/Listbox.d.ts.map +1 -1
- package/dist/Listbox.js +9 -80
- package/dist/Menu.d.ts +67 -376
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +17 -179
- package/dist/Menubar.d.ts +24 -142
- package/dist/Menubar.d.ts.map +1 -1
- package/dist/Menubar.js +8 -66
- package/dist/Meter.d.ts +72 -132
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +35 -42
- package/dist/NativeDetails.d.ts +1 -1
- package/dist/NativeDetails.js +1 -1
- package/dist/NativeDialog.d.ts +7 -5
- package/dist/NativeDialog.d.ts.map +1 -1
- package/dist/NativeDialog.js +42 -4
- package/dist/NativePopover.d.ts +6 -4
- package/dist/NativePopover.d.ts.map +1 -1
- package/dist/NativePopover.js +43 -5
- package/dist/Popover.d.ts +18 -19
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +7 -8
- package/dist/RadioGroup.d.ts +86 -188
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +55 -105
- package/dist/Role.d.ts +4 -4
- package/dist/Role.js +1 -1
- package/dist/Select.d.ts +109 -220
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +67 -117
- package/dist/Separator.d.ts +30 -26
- package/dist/Separator.d.ts.map +1 -1
- package/dist/Separator.js +16 -10
- package/dist/Slider.d.ts +64 -111
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +47 -42
- package/dist/SpinButton.d.ts +64 -111
- package/dist/SpinButton.d.ts.map +1 -1
- package/dist/SpinButton.js +47 -42
- package/dist/Storybook.d.ts +2 -2
- package/dist/Storybook.js +1 -1
- package/dist/Switch.d.ts +52 -91
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +30 -36
- package/dist/Tabs.d.ts +44 -224
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +10 -94
- package/dist/Toolbar.d.ts +24 -142
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar.js +8 -66
- package/dist/Tooltip.d.ts +20 -20
- package/dist/Tooltip.js +6 -6
- package/dist/Tree.d.ts +43 -229
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +12 -113
- package/dist/TreeGrid.d.ts +45 -264
- package/dist/TreeGrid.d.ts.map +1 -1
- package/dist/TreeGrid.js +13 -125
- package/dist/VisuallyHidden.d.ts +41 -27
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +27 -10
- package/dist/WindowSplitter.d.ts +68 -108
- package/dist/WindowSplitter.d.ts.map +1 -1
- package/dist/WindowSplitter.js +106 -23
- package/package.json +13 -12
package/dist/RadioGroup.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* ARIA state.
|
|
2
|
+
* Native radio selection with optional registered keyboard movement.
|
|
3
|
+
* Choice values, element IDs, and shared native names have distinct responsibilities.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
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.
|
|
5
|
+
* Read the [RadioGroup guide](/explore/ui-radio-group) for a complete example.
|
|
10
6
|
*
|
|
7
|
+
* [APG interaction reference](https://www.w3.org/WAI/ARIA/apg/patterns/radio/).
|
|
11
8
|
* @since 1.0.0
|
|
12
|
-
* @category
|
|
9
|
+
* @category Overview
|
|
13
10
|
* @packageDocumentation
|
|
14
11
|
*/
|
|
15
12
|
import * as Effect from "effect/Effect";
|
|
@@ -23,80 +20,54 @@ import * as Composite from "./Composite.js";
|
|
|
23
20
|
import * as Dom from "./Dom.js";
|
|
24
21
|
import type { HostResult } from "./Dom/Types.js";
|
|
25
22
|
/**
|
|
26
|
-
*
|
|
23
|
+
* Selected choice plus the active element used for keyboard movement.
|
|
27
24
|
*
|
|
28
25
|
* @remarks
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* Applications can inspect, update, and test RadioGroup 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/RadioGroup";` Extend the [RadioGroup.makeState
|
|
41
|
-
* runnable setup](/reference/%40typed%2Fui%2FRadioGroup%23makeState). Inside the linked program,
|
|
42
|
-
* `const snapshot: State = yield* state` exposes the checked value and roving-focus id.
|
|
26
|
+
* value need not equal activeId. Orientation is vertical, virtualFocus is false, and the native
|
|
27
|
+
* inputs retain their own browser grouping by name.
|
|
43
28
|
* @since 1.0.0
|
|
44
|
-
* @category models
|
|
29
|
+
* @category State models
|
|
45
30
|
*/
|
|
46
31
|
export interface State extends Omit<Composite.State, "orientation"> {
|
|
47
32
|
/**
|
|
48
33
|
* Axis used to interpret Arrow-key movement.
|
|
49
34
|
* @since 1.0.0
|
|
50
|
-
* @category
|
|
35
|
+
* @category Keyboard navigation
|
|
51
36
|
*/
|
|
52
37
|
readonly orientation: "vertical";
|
|
53
38
|
/**
|
|
54
39
|
* Current semantic value selected or edited by the widget.
|
|
55
40
|
* @since 1.0.0
|
|
56
|
-
* @category
|
|
41
|
+
* @category Value state
|
|
57
42
|
*/
|
|
58
43
|
readonly value: string;
|
|
59
44
|
}
|
|
60
45
|
/**
|
|
61
|
-
*
|
|
62
|
-
* defaults true.
|
|
46
|
+
* Required selected value with optional initial active ID and wrap policy.
|
|
63
47
|
*
|
|
64
48
|
* @remarks
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* Making initialization explicit documents hydration-sensitive defaults and lets servers and
|
|
68
|
-
* clients construct matching state.
|
|
69
|
-
*
|
|
70
|
-
* ## Ownership and lifetime
|
|
71
|
-
*
|
|
72
|
-
* This declaration is data or schema metadata and acquires no resources.
|
|
73
|
-
*
|
|
74
|
-
* ## Example
|
|
75
|
-
*
|
|
76
|
-
* Import with `import type { InitialState } from "@typed/ui/RadioGroup";` Extend the
|
|
77
|
-
* [RadioGroup.makeState runnable setup](/reference/%40typed%2Fui%2FRadioGroup%23makeState).
|
|
78
|
-
* Construct state with
|
|
79
|
-
* `const initial: InitialState = { value: "email", activeId: "email" }; const state = yield* RadioGroup.makeState(initial)`.
|
|
49
|
+
* activeId defaults to null; loop defaults to true. Supply an element ID only when the initial
|
|
50
|
+
* active choice is known.
|
|
80
51
|
* @since 1.0.0
|
|
81
|
-
* @category models
|
|
52
|
+
* @category State models
|
|
82
53
|
*/
|
|
83
54
|
export interface InitialState {
|
|
84
55
|
/**
|
|
85
56
|
* Current semantic value selected or edited by the widget.
|
|
86
57
|
* @since 1.0.0
|
|
87
|
-
* @category
|
|
58
|
+
* @category Value state
|
|
88
59
|
*/
|
|
89
60
|
readonly value: string;
|
|
90
61
|
/**
|
|
91
62
|
* Id currently active for keyboard navigation; null means no active item.
|
|
92
63
|
* @since 1.0.0
|
|
93
|
-
* @category
|
|
64
|
+
* @category Keyboard focus
|
|
94
65
|
*/
|
|
95
66
|
readonly activeId?: string | null;
|
|
96
67
|
/**
|
|
97
68
|
* Whether movement wraps between the first and last enabled items.
|
|
98
69
|
* @since 1.0.0
|
|
99
|
-
* @category
|
|
70
|
+
* @category Keyboard navigation
|
|
100
71
|
*/
|
|
101
72
|
readonly loop?: boolean;
|
|
102
73
|
}
|
|
@@ -104,15 +75,9 @@ export interface InitialState {
|
|
|
104
75
|
* Effect Schema used by makeState to encode, decode, and hydrate RadioGroup state.
|
|
105
76
|
*
|
|
106
77
|
* @remarks
|
|
107
|
-
* ## Why
|
|
108
|
-
*
|
|
109
78
|
* A public schema makes hydration and serialized state use the same runtime validation as direct
|
|
110
79
|
* construction.
|
|
111
80
|
*
|
|
112
|
-
* ## Ownership and lifetime
|
|
113
|
-
*
|
|
114
|
-
* This declaration is data or schema metadata and acquires no resources.
|
|
115
|
-
*
|
|
116
81
|
* @example
|
|
117
82
|
* ```ts
|
|
118
83
|
* import * as Schema from "effect/Schema";
|
|
@@ -121,7 +86,7 @@ export interface InitialState {
|
|
|
121
86
|
* const decodeState = Schema.decodeUnknownEffect(RadioGroup.StateSchema);
|
|
122
87
|
* ```
|
|
123
88
|
* @since 1.0.0
|
|
124
|
-
* @category schemas
|
|
89
|
+
* @category Hydration schemas
|
|
125
90
|
*/
|
|
126
91
|
export declare const StateSchema: Schema.Struct<{
|
|
127
92
|
readonly value: Schema.String;
|
|
@@ -132,19 +97,13 @@ export declare const StateSchema: Schema.Struct<{
|
|
|
132
97
|
readonly virtualFocus: Schema.Boolean;
|
|
133
98
|
}>;
|
|
134
99
|
/**
|
|
135
|
-
* Creates hydrated
|
|
136
|
-
*
|
|
100
|
+
* Creates hydrated radio selection with a required value, null active ID, and looping enabled by
|
|
101
|
+
* default.
|
|
137
102
|
*
|
|
138
103
|
* @remarks
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* ## Ownership and lifetime
|
|
144
|
-
*
|
|
145
|
-
* The returned Effect creates the RefSubject when run. That state is renderer-independent;
|
|
146
|
-
* collection registrations belong to the separate Scope that runs register or ref, not to state
|
|
147
|
-
* creation.
|
|
104
|
+
* The selected value and element ID are separate. The first keyboard movement can resolve the
|
|
105
|
+
* selected value against the mounted collection. Creation requires Scope; renderers borrow the
|
|
106
|
+
* returned subject.
|
|
148
107
|
*
|
|
149
108
|
* @example
|
|
150
109
|
* ```ts
|
|
@@ -160,7 +119,7 @@ export declare const StateSchema: Schema.Struct<{
|
|
|
160
119
|
* );
|
|
161
120
|
* ```
|
|
162
121
|
* @since 1.0.0
|
|
163
|
-
* @category
|
|
122
|
+
* @category State construction
|
|
164
123
|
*/
|
|
165
124
|
export declare function makeState(initial: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
|
|
166
125
|
readonly value: string;
|
|
@@ -174,12 +133,8 @@ export declare function makeState(initial: InitialState): Effect.Effect<RefSubje
|
|
|
174
133
|
* Creates a scoped Collection for RadioGroup items.
|
|
175
134
|
*
|
|
176
135
|
* @remarks
|
|
177
|
-
* ## Why
|
|
178
|
-
*
|
|
179
136
|
* State and collection ownership can be composed and tested independently from any renderer.
|
|
180
137
|
*
|
|
181
|
-
* ## Ownership and lifetime
|
|
182
|
-
*
|
|
183
138
|
* The returned Effect allocates the RefSubject in the caller's Scope. Each later registration is
|
|
184
139
|
* owned by the Scope that runs register, independently of this construction Effect.
|
|
185
140
|
*
|
|
@@ -196,78 +151,51 @@ export declare function makeState(initial: InitialState): Effect.Effect<RefSubje
|
|
|
196
151
|
* );
|
|
197
152
|
* ```
|
|
198
153
|
* @since 1.0.0
|
|
199
|
-
* @category
|
|
154
|
+
* @category State construction
|
|
200
155
|
*/
|
|
201
156
|
export declare const makeCollection: (initial?: Collection.State<string, Element>) => Effect.Effect<RefSubject.RefSubject<Collection.State<string, Element>, never, never>, never, Scope.Scope>;
|
|
202
157
|
/**
|
|
203
|
-
* Sets selected value and
|
|
158
|
+
* Sets the selected value and optionally the active element ID.
|
|
204
159
|
*
|
|
205
160
|
* @remarks
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* The operation exposes RadioGroup's transition directly so callers can compose it in Effect
|
|
209
|
-
* programs and native event handlers.
|
|
210
|
-
*
|
|
211
|
-
* ## Ownership and lifetime
|
|
212
|
-
*
|
|
213
|
-
* The returned Effect performs the update or DOM side effect only when run, preserves the declared
|
|
214
|
-
* error and service channels, and retains no resources after completion.
|
|
215
|
-
*
|
|
216
|
-
* ## Example
|
|
217
|
-
*
|
|
218
|
-
* Import with `import { setValue } from "@typed/ui/RadioGroup";` Extend the [RadioGroup.makeState
|
|
219
|
-
* runnable setup](/reference/%40typed%2Fui%2FRadioGroup%23makeState). Inside the linked Effect
|
|
220
|
-
* program invoke `yield* setValue(state, "phone", "phone")`, then read state to observe the checked
|
|
221
|
-
* value and active roving-focus id update together.
|
|
161
|
+
* Omitting activeId preserves the previous active ID. This state update does not look up an
|
|
162
|
+
* item, move DOM focus, or verify that the value belongs to the group.
|
|
222
163
|
* @since 1.0.0
|
|
223
|
-
* @category
|
|
164
|
+
* @category State transitions
|
|
224
165
|
*/
|
|
225
166
|
export declare function setValue<E, R>(state: RefSubject.RefSubject<State, E, R>, value: string, activeId?: string): Effect.Effect<State, E, R>;
|
|
226
167
|
/**
|
|
227
|
-
*
|
|
168
|
+
* State, optional navigation collection, child content, and group name.
|
|
228
169
|
*
|
|
229
170
|
* @remarks
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* The options type makes required state, content, accessible relationships, and custom-host inputs
|
|
233
|
-
* visible before rendering.
|
|
234
|
-
*
|
|
235
|
-
* ## Ownership and lifetime
|
|
236
|
-
*
|
|
237
|
-
* This declaration is data or schema metadata and acquires no resources.
|
|
238
|
-
*
|
|
239
|
-
* ## Example
|
|
240
|
-
*
|
|
241
|
-
* Import with `import type { RootOptions } from "@typed/ui/RadioGroup";` Extend the
|
|
242
|
-
* [RadioGroup.makeState runnable setup](/reference/%40typed%2Fui%2FRadioGroup%23makeState). Enable
|
|
243
|
-
* Arrow-key selection with
|
|
244
|
-
* `const options: RootOptions = { state, collection, label: "Contact method", content: "Choices" }`.
|
|
171
|
+
* Share the same collection with Item to enable registered keyboard movement. label names the
|
|
172
|
+
* group; each item still needs its own label.
|
|
245
173
|
* @since 1.0.0
|
|
246
|
-
* @category
|
|
174
|
+
* @category Component options
|
|
247
175
|
*/
|
|
248
176
|
export interface RootOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
249
177
|
/**
|
|
250
178
|
* Renderer-independent RefSubject state consumed by this component or operation.
|
|
251
179
|
* @since 1.0.0
|
|
252
|
-
* @category
|
|
180
|
+
* @category State connection
|
|
253
181
|
*/
|
|
254
182
|
readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
|
|
255
183
|
/**
|
|
256
184
|
* Item registry used for collection-driven keyboard behavior and mounted ordering.
|
|
257
185
|
* @since 1.0.0
|
|
258
|
-
* @category
|
|
186
|
+
* @category Item registration
|
|
259
187
|
*/
|
|
260
188
|
readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
|
|
261
189
|
/**
|
|
262
190
|
* Renderable child content for the component host.
|
|
263
191
|
* @since 1.0.0
|
|
264
|
-
* @category
|
|
192
|
+
* @category Rendered content
|
|
265
193
|
*/
|
|
266
194
|
readonly content: Renderable.Any;
|
|
267
195
|
/**
|
|
268
196
|
* Accessible label rendered through aria-label.
|
|
269
197
|
* @since 1.0.0
|
|
270
|
-
* @category
|
|
198
|
+
* @category Accessible naming
|
|
271
199
|
*/
|
|
272
200
|
readonly label?: Renderable.Any<string | null | undefined>;
|
|
273
201
|
}
|
|
@@ -279,87 +207,86 @@ declare function rootInternalProps<const Options extends RootOptions>(options: O
|
|
|
279
207
|
};
|
|
280
208
|
type RootInternalProps<Options extends RootOptions> = ReturnType<ReturnType<typeof rootInternalProps<Options>>>;
|
|
281
209
|
/**
|
|
282
|
-
* Renders
|
|
210
|
+
* Renders a named radiogroup around native radio items.
|
|
283
211
|
*
|
|
284
212
|
* @remarks
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
* ## Ownership and lifetime
|
|
291
|
-
*
|
|
292
|
-
* The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
|
|
293
|
-
* collection registrations only when rendered. The rendering Scope removes those resources;
|
|
294
|
-
* unrelated nodes and attributes remain caller-owned.
|
|
213
|
+
* Pass the same state to every item and the same native name to items in one group. With a
|
|
214
|
+
* collection, the root handles vertical arrow movement and Home/End, skips disabled
|
|
215
|
+
* registrations, updates selection, and moves real focus. Without a collection, native input
|
|
216
|
+
* behavior remains the keyboard boundary.
|
|
295
217
|
*
|
|
296
|
-
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```ts
|
|
220
|
+
* import { html } from "@typed/template";
|
|
221
|
+
* import { component } from "@typed/ui/Component";
|
|
222
|
+
* import * as RadioGroup from "@typed/ui/RadioGroup";
|
|
297
223
|
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
224
|
+
* export const DeliveryChoice = component(function* () {
|
|
225
|
+
* const state = yield* RadioGroup.makeState({ value: "standard" });
|
|
226
|
+
* const collection = yield* RadioGroup.makeCollection();
|
|
227
|
+
* return RadioGroup.Root({
|
|
228
|
+
* state,
|
|
229
|
+
* collection,
|
|
230
|
+
* label: "Delivery speed",
|
|
231
|
+
* content: html`
|
|
232
|
+
* <label>${RadioGroup.Item({
|
|
233
|
+
* state, collection, id: "delivery-standard", name: "delivery", value: "standard",
|
|
234
|
+
* })} Standard delivery</label>
|
|
235
|
+
* <label>${RadioGroup.Item({
|
|
236
|
+
* state, collection, id: "delivery-express", name: "delivery", value: "express",
|
|
237
|
+
* })} Express delivery</label>
|
|
238
|
+
* `,
|
|
239
|
+
* });
|
|
240
|
+
* });
|
|
241
|
+
* ```
|
|
302
242
|
* @since 1.0.0
|
|
303
|
-
* @category
|
|
243
|
+
* @category Native controls
|
|
304
244
|
*/
|
|
305
245
|
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>;
|
|
306
246
|
/**
|
|
307
|
-
*
|
|
247
|
+
* One native choice with stable element ID, application value, and native group name.
|
|
308
248
|
*
|
|
309
249
|
* @remarks
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
* The options type makes required state, content, accessible relationships, and custom-host inputs
|
|
313
|
-
* visible before rendering.
|
|
314
|
-
*
|
|
315
|
-
* ## Ownership and lifetime
|
|
316
|
-
*
|
|
317
|
-
* This declaration is data or schema metadata and acquires no resources.
|
|
318
|
-
*
|
|
319
|
-
* ## Example
|
|
320
|
-
*
|
|
321
|
-
* Import with `import type { ItemOptions } from "@typed/ui/RadioGroup";` Extend the
|
|
322
|
-
* [RadioGroup.makeState runnable setup](/reference/%40typed%2Fui%2FRadioGroup%23makeState). A
|
|
323
|
-
* native radio input is
|
|
324
|
-
* `const options: ItemOptions = { state, collection, id: "email", value: "email", name: "contact" }`.
|
|
250
|
+
* Use the same state and name across one radio group, unique IDs across the document, and distinct
|
|
251
|
+
* values across choices. disabled is a boolean used by both rendering and registration.
|
|
325
252
|
* @since 1.0.0
|
|
326
|
-
* @category
|
|
253
|
+
* @category Component options
|
|
327
254
|
*/
|
|
328
255
|
export interface ItemOptions extends Dom.HostOptions<HTMLInputElement> {
|
|
329
256
|
/**
|
|
330
257
|
* Renderer-independent RefSubject state consumed by this component or operation.
|
|
331
258
|
* @since 1.0.0
|
|
332
|
-
* @category
|
|
259
|
+
* @category State connection
|
|
333
260
|
*/
|
|
334
261
|
readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
|
|
335
262
|
/**
|
|
336
263
|
* Item registry used for collection-driven keyboard behavior and mounted ordering.
|
|
337
264
|
* @since 1.0.0
|
|
338
|
-
* @category
|
|
265
|
+
* @category Item registration
|
|
339
266
|
*/
|
|
340
267
|
readonly collection?: RefSubject.RefSubject<Collection.State<string>>;
|
|
341
268
|
/**
|
|
342
269
|
* Stable id used for collection identity and ARIA relationships.
|
|
343
270
|
* @since 1.0.0
|
|
344
|
-
* @category
|
|
271
|
+
* @category Identity and relationships
|
|
345
272
|
*/
|
|
346
273
|
readonly id: string;
|
|
347
274
|
/**
|
|
348
275
|
* Current semantic value selected or edited by the widget.
|
|
349
276
|
* @since 1.0.0
|
|
350
|
-
* @category
|
|
277
|
+
* @category Value state
|
|
351
278
|
*/
|
|
352
279
|
readonly value: string;
|
|
353
280
|
/**
|
|
354
281
|
* Native radio-group form name shared by related input items.
|
|
355
282
|
* @since 1.0.0
|
|
356
|
-
* @category
|
|
283
|
+
* @category Native form data
|
|
357
284
|
*/
|
|
358
285
|
readonly name?: string;
|
|
359
286
|
/**
|
|
360
287
|
* Flag used by collection movement and widget handlers to skip activation by default.
|
|
361
288
|
* @since 1.0.0
|
|
362
|
-
* @category
|
|
289
|
+
* @category Availability
|
|
363
290
|
*/
|
|
364
291
|
readonly disabled?: boolean;
|
|
365
292
|
}
|
|
@@ -379,53 +306,24 @@ declare function itemInternalProps<const Options extends ItemOptions>(options: O
|
|
|
379
306
|
};
|
|
380
307
|
type ItemInternalProps<Options extends ItemOptions> = ReturnType<ReturnType<typeof itemInternalProps<Options>>>;
|
|
381
308
|
/**
|
|
382
|
-
* Renders
|
|
309
|
+
* Renders one native radio input and optionally registers it for group navigation.
|
|
383
310
|
*
|
|
384
311
|
* @remarks
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* through the shared DOM boundary.
|
|
389
|
-
*
|
|
390
|
-
* ## Ownership and lifetime
|
|
391
|
-
*
|
|
392
|
-
* The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
|
|
393
|
-
* collection registrations only when rendered. The rendering Scope removes those resources;
|
|
394
|
-
* unrelated nodes and attributes remain caller-owned.
|
|
395
|
-
*
|
|
396
|
-
* ## Example
|
|
397
|
-
*
|
|
398
|
-
* Import with `import { Item } from "@typed/ui/RadioGroup";` Extend the [RadioGroup.makeState
|
|
399
|
-
* runnable setup](/reference/%40typed%2Fui%2FRadioGroup%23makeState). Replace the linked program's
|
|
400
|
-
* final snapshot read with `Item({ state, id: "email", value: "email", name: "contact" })`; render
|
|
401
|
-
* that Fx before the same Scope closes.
|
|
312
|
+
* id identifies the element; value identifies the choice; name establishes the native browser
|
|
313
|
+
* group. A native change updates the selected value and active ID. Supply a wrapping label or an
|
|
314
|
+
* external label linked to id. Registration ends with the rendered Scope.
|
|
402
315
|
* @since 1.0.0
|
|
403
|
-
* @category
|
|
316
|
+
* @category Native controls
|
|
404
317
|
*/
|
|
405
318
|
export declare function Item<const Options extends ItemOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, ItemInternalProps<Options>>, "", Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
|
|
406
319
|
/**
|
|
407
|
-
*
|
|
408
|
-
* lifetime.
|
|
320
|
+
* Alias of Root.
|
|
409
321
|
*
|
|
410
322
|
* @remarks
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
* The component applies the family behavior while leaving callers free to supply a custom host
|
|
414
|
-
* through the shared DOM boundary.
|
|
415
|
-
*
|
|
416
|
-
* ## Ownership and lifetime
|
|
417
|
-
*
|
|
418
|
-
* The alias acquires nothing. Rendering it has exactly the canonical component's Scope and DOM
|
|
419
|
-
* ownership contract.
|
|
420
|
-
*
|
|
421
|
-
* ## Example
|
|
422
|
-
*
|
|
423
|
-
* Import with `import { RadioGroup } from "@typed/ui/RadioGroup";` Extend the [RadioGroup.makeState
|
|
424
|
-
* runnable setup](/reference/%40typed%2Fui%2FRadioGroup%23makeState). Replace the linked program's
|
|
425
|
-
* final snapshot read with `RadioGroup({ state, label: "Contact method", content: "Choices" })`;
|
|
426
|
-
* render that Fx before the same Scope closes.
|
|
323
|
+
* The alias exposes the same native-input grouping and optional collection behavior; it introduces
|
|
324
|
+
* no additional state or focus policy.
|
|
427
325
|
* @since 1.0.0
|
|
428
|
-
* @category
|
|
326
|
+
* @category Native controls
|
|
429
327
|
*/
|
|
430
328
|
export declare const RadioGroup: typeof Root;
|
|
431
329
|
export {};
|
package/dist/RadioGroup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../src/RadioGroup.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../src/RadioGroup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;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,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAM,SAAQ,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC;IACjE;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B;;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