@foldkit/ui 0.127.0 → 0.128.1

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 (79) hide show
  1. package/README.md +2 -2
  2. package/dist/calendar/index.d.ts +17 -23
  3. package/dist/calendar/index.d.ts.map +1 -1
  4. package/dist/calendar/index.js +16 -25
  5. package/dist/calendar/public.d.ts +1 -1
  6. package/dist/calendar/public.d.ts.map +1 -1
  7. package/dist/calendar/public.js +1 -1
  8. package/dist/checkbox/index.d.ts +47 -104
  9. package/dist/checkbox/index.d.ts.map +1 -1
  10. package/dist/checkbox/index.js +48 -87
  11. package/dist/checkbox/public.d.ts +2 -2
  12. package/dist/checkbox/public.d.ts.map +1 -1
  13. package/dist/checkbox/public.js +1 -1
  14. package/dist/combobox/multi.d.ts +19 -30
  15. package/dist/combobox/multi.d.ts.map +1 -1
  16. package/dist/combobox/multi.js +32 -53
  17. package/dist/combobox/public.d.ts +2 -2
  18. package/dist/combobox/public.d.ts.map +1 -1
  19. package/dist/combobox/public.js +1 -1
  20. package/dist/combobox/shared.d.ts +59 -35
  21. package/dist/combobox/shared.d.ts.map +1 -1
  22. package/dist/combobox/shared.js +58 -45
  23. package/dist/combobox/single.d.ts +36 -48
  24. package/dist/combobox/single.d.ts.map +1 -1
  25. package/dist/combobox/single.js +49 -76
  26. package/dist/datePicker/index.d.ts +33 -41
  27. package/dist/datePicker/index.d.ts.map +1 -1
  28. package/dist/datePicker/index.js +31 -40
  29. package/dist/datePicker/public.d.ts +1 -1
  30. package/dist/datePicker/public.d.ts.map +1 -1
  31. package/dist/datePicker/public.js +1 -1
  32. package/dist/disclosure/index.d.ts +49 -113
  33. package/dist/disclosure/index.d.ts.map +1 -1
  34. package/dist/disclosure/index.js +35 -92
  35. package/dist/disclosure/public.d.ts +2 -2
  36. package/dist/disclosure/public.d.ts.map +1 -1
  37. package/dist/disclosure/public.js +1 -1
  38. package/dist/listbox/multi.d.ts +7 -21
  39. package/dist/listbox/multi.d.ts.map +1 -1
  40. package/dist/listbox/multi.js +12 -36
  41. package/dist/listbox/public.d.ts +1 -1
  42. package/dist/listbox/public.d.ts.map +1 -1
  43. package/dist/listbox/shared.d.ts +28 -20
  44. package/dist/listbox/shared.d.ts.map +1 -1
  45. package/dist/listbox/shared.js +6 -7
  46. package/dist/listbox/single.d.ts +17 -27
  47. package/dist/listbox/single.d.ts.map +1 -1
  48. package/dist/listbox/single.js +18 -30
  49. package/dist/radioGroup/index.d.ts +57 -142
  50. package/dist/radioGroup/index.d.ts.map +1 -1
  51. package/dist/radioGroup/index.js +44 -119
  52. package/dist/radioGroup/public.d.ts +2 -2
  53. package/dist/radioGroup/public.d.ts.map +1 -1
  54. package/dist/radioGroup/public.js +1 -1
  55. package/dist/slider/index.d.ts +51 -27
  56. package/dist/slider/index.d.ts.map +1 -1
  57. package/dist/slider/index.js +66 -66
  58. package/dist/slider/public.d.ts +1 -1
  59. package/dist/slider/public.d.ts.map +1 -1
  60. package/dist/slider/public.js +1 -1
  61. package/dist/switch/index.d.ts +45 -92
  62. package/dist/switch/index.d.ts.map +1 -1
  63. package/dist/switch/index.js +36 -81
  64. package/dist/switch/public.d.ts +2 -2
  65. package/dist/switch/public.d.ts.map +1 -1
  66. package/dist/switch/public.js +1 -1
  67. package/dist/tabs/index.d.ts +33 -33
  68. package/dist/tabs/index.d.ts.map +1 -1
  69. package/dist/tabs/index.js +36 -49
  70. package/dist/toast/index.d.ts +1 -0
  71. package/dist/toast/index.d.ts.map +1 -1
  72. package/dist/toast/index.js +1 -0
  73. package/dist/toast/public.d.ts +2 -0
  74. package/dist/toast/public.d.ts.map +1 -1
  75. package/dist/toast/public.js +1 -0
  76. package/dist/toast/test.d.ts +41 -0
  77. package/dist/toast/test.d.ts.map +1 -0
  78. package/dist/toast/test.js +36 -0
  79. package/package.json +5 -5
@@ -1,10 +1,9 @@
1
1
  import { Option, Schema as S } from 'effect';
2
2
  import type * as Command from 'foldkit/command';
3
- import type { Reflect, View as SubmodelView } from 'foldkit/submodel';
4
- import { type BaseInitConfig, type BaseViewInputs, type Message, type OutMessage } from './shared.js';
5
- /** Schema for the listbox component's state, tracking open/closed status, active item, selected item, activation trigger, and typeahead search. */
3
+ import { type View as SubmodelView } from 'foldkit/submodel';
4
+ import { type BaseInitConfig, type BaseViewInputsCommon, type ItemToValueInput, type Message, type OutMessage } from './shared.js';
5
+ /** Schema for the single-select listbox's private interaction state (open/closed status, active item, activation trigger, typeahead search). The selection is owned by the parent and passed in via `ViewInputs.maybeSelectedValue`. */
6
6
  export declare const Model: S.Struct<{
7
- readonly maybeSelectedItem: S.Option<S.String>;
8
7
  readonly id: S.String;
9
8
  readonly isOpen: S.Boolean;
10
9
  readonly isAnimated: S.Boolean;
@@ -26,15 +25,12 @@ export declare const Model: S.Struct<{
26
25
  readonly maybeLastButtonPointerType: S.Option<S.String>;
27
26
  }>;
28
27
  export type Model = typeof Model.Type;
29
- /** Configuration for creating a single-select listbox model with `init`. `isAnimated` enables CSS transition coordination (default `false`). `isModal` locks page scroll and inerts other elements when open (default `false`). `selectedItem` sets the initial selection (default none). */
30
- export type InitConfig = BaseInitConfig & Readonly<{
31
- selectedItem?: string;
32
- }>;
33
- /** Creates an initial single-select listbox model from a config. Defaults to closed with no active item and no selection. */
28
+ /** Configuration for creating a single-select listbox model with `init`. `isAnimated` enables CSS transition coordination (default `false`). `isModal` locks page scroll and inerts other elements when open (default `false`). */
29
+ export type InitConfig = BaseInitConfig;
30
+ /** Creates an initial single-select listbox model from a config. Defaults to closed with no active item. */
34
31
  export declare const init: (config: InitConfig) => Model;
35
- /** Processes a listbox message and returns the next model, commands, and optional OutMessage. Closes the listbox on selection (single-select behavior); emits a `Selected({ value, wasAdded: true })` OutMessage. */
32
+ /** Processes a listbox message and returns the next model, commands, and optional OutMessage. Closes the listbox on selection (single-select behavior); emits a `Selected({ value })` OutMessage the parent stores as the selection. */
36
33
  export declare const update: (model: S.Struct.ReadonlySide<{
37
- readonly maybeSelectedItem: S.Option<S.String>;
38
34
  readonly id: S.String;
39
35
  readonly isOpen: S.Boolean;
40
36
  readonly isAnimated: S.Boolean;
@@ -55,7 +51,6 @@ export declare const update: (model: S.Struct.ReadonlySide<{
55
51
  }>>;
56
52
  readonly maybeLastButtonPointerType: S.Option<S.String>;
57
53
  }, "Type">, message: Message) => readonly [S.Struct.ReadonlySide<{
58
- readonly maybeSelectedItem: S.Option<S.String>;
59
54
  readonly id: S.String;
60
55
  readonly isOpen: S.Boolean;
61
56
  readonly isAnimated: S.Boolean;
@@ -144,7 +139,6 @@ export declare const update: (model: S.Struct.ReadonlySide<{
144
139
  }>[], Option.Option<Readonly<{
145
140
  readonly _tag: "Selected";
146
141
  readonly value: string;
147
- readonly wasAdded: boolean;
148
142
  }>>];
149
143
  type UpdateReturn = ReturnType<typeof update>;
150
144
  /** Programmatically opens the listbox, updating the model and returning
@@ -153,20 +147,17 @@ export declare const open: (model: Model) => UpdateReturn;
153
147
  /** Programmatically closes the listbox, updating the model and returning
154
148
  * focus and modal commands. Use this in domain-event handlers to close the listbox. */
155
149
  export declare const close: (model: Model) => UpdateReturn;
156
- /** Programmatically selects an item in the single-select listbox, closing the listbox and emitting a `Selected({ value, wasAdded: true })` OutMessage. */
150
+ /** Programmatically selects an item in the single-select listbox, closing the listbox and emitting a `Selected({ value })` OutMessage. */
157
151
  export declare const selectItem: (model: Model, item: string) => UpdateReturn;
158
- /** Reflects an externally-sourced selection onto the model without
159
- * emitting an OutMessage or running the user-selection side effects (no
160
- * close, no focus). Use this to mirror external truth (a URL parameter,
161
- * restored storage, a server push) onto the listbox's selection.
162
- * Contrast with `selectItem`, which represents a user or programmatic
163
- * *choice*: it closes the listbox, restores focus, and emits `Selected`.
164
- * `reflect` returns the model directly because it produces no commands and
165
- * no OutMessage, so a parent reflecting external state cannot
166
- * accidentally echo it back out. */
167
- export declare const reflectSelectedItem: Reflect<Model, Option.Option<string>>;
168
152
  /** Per-render view inputs passed to the view via `h.submodel`'s `viewInputs` field. */
169
- export type ViewInputs<Item, Value extends string = string> = BaseViewInputs<Item, Value>;
153
+ export type ViewInputs<Item, Value extends string = string> = BaseViewInputsCommon<Item> & Readonly<{
154
+ /** The selection the parent owns, passed in fresh on every render.
155
+ * `Option` because a single-select listbox may have no selection yet.
156
+ * Drives `aria-selected` and `data-selected` on items, which item the
157
+ * Listbox highlights when it opens onto a selection, and the hidden
158
+ * form input submitted under `name`. */
159
+ maybeSelectedValue: Option.Option<Value>;
160
+ }> & ItemToValueInput<Item, Value>;
170
161
  /** Pairs the single-select listbox's `view` and `update` (and programmatic
171
162
  * helpers) behind a single Item-typed entry point. Declaring the listbox
172
163
  * once at module scope ensures the view's `Item` type and the update's
@@ -188,12 +179,11 @@ export type ViewInputs<Item, Value extends string = string> = BaseViewInputs<Ite
188
179
  * extracted value is a plain string. `Value` defaults to `Item` when
189
180
  * `Item extends string`, else defaults to `string`. */
190
181
  export declare const create: <Item = string, Value extends string = Item extends string ? Item : string>() => Readonly<{
191
- view: SubmodelView<Model, Message, BaseViewInputs<Item, Value>>;
182
+ view: SubmodelView<Model, Message, ViewInputs<Item, Value>>;
192
183
  update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Value>>];
193
184
  selectItem: (model: Model, item: Value) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Value>>];
194
185
  open: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Value>>];
195
186
  close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Value>>];
196
- reflectSelectedItem: Reflect<Model, Option.Option<Value>>;
197
187
  }>;
198
188
  export {};
199
189
  //# sourceMappingURL=single.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../src/listbox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM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A;IACD,KAAK,EAAE,CACL,KAAK,EAAE,KAAK,KACT,SAAS,CACZ,KAAK,EACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CACjC,CAAA;CACF,CAuBA,CAAA"}
@@ -1,43 +1,30 @@
1
- import { Array, Function, Option, Schema as S } from 'effect';
2
- import { evo } from 'foldkit/struct';
1
+ import { Option, Schema as S } from 'effect';
2
+ import { defineView } from 'foldkit/submodel';
3
3
  import { BaseModel, Closed, Opened, SelectedItem, Selected as SharedSelected, baseInit, makeUpdate, makeView, } from './shared.js';
4
4
  // MODEL
5
- /** Schema for the listbox component's state, tracking open/closed status, active item, selected item, activation trigger, and typeahead search. */
5
+ /** Schema for the single-select listbox's private interaction state (open/closed status, active item, activation trigger, typeahead search). The selection is owned by the parent and passed in via `ViewInputs.maybeSelectedValue`. */
6
6
  export const Model = S.Struct({
7
7
  ...BaseModel.fields,
8
- maybeSelectedItem: S.Option(S.String),
9
- });
10
- /** Creates an initial single-select listbox model from a config. Defaults to closed with no active item and no selection. */
11
- export const init = (config) => ({
12
- ...baseInit(config),
13
- maybeSelectedItem: Option.fromNullishOr(config.selectedItem),
14
8
  });
9
+ /** Creates an initial single-select listbox model from a config. Defaults to closed with no active item. */
10
+ export const init = (config) => baseInit(config);
15
11
  // UPDATE
16
- /** Processes a listbox message and returns the next model, commands, and optional OutMessage. Closes the listbox on selection (single-select behavior); emits a `Selected({ value, wasAdded: true })` OutMessage. */
17
- export const update = makeUpdate((model, item, context) => context.closeWithFocus(evo(model, { maybeSelectedItem: () => Option.some(item) }), Option.some(SharedSelected({ value: item, wasAdded: true }))));
12
+ /** Processes a listbox message and returns the next model, commands, and optional OutMessage. Closes the listbox on selection (single-select behavior); emits a `Selected({ value })` OutMessage the parent stores as the selection. */
13
+ export const update = makeUpdate((model, item, context) => context.closeWithFocus(model, Option.some(SharedSelected({ value: item }))));
18
14
  /** Programmatically opens the listbox, updating the model and returning
19
15
  * focus and modal commands. Use this in domain-event handlers to open the listbox. */
20
16
  export const open = (model) => update(model, Opened({ maybeActiveItemIndex: Option.none() }));
21
17
  /** Programmatically closes the listbox, updating the model and returning
22
18
  * focus and modal commands. Use this in domain-event handlers to close the listbox. */
23
19
  export const close = (model) => update(model, Closed());
24
- /** Programmatically selects an item in the single-select listbox, closing the listbox and emitting a `Selected({ value, wasAdded: true })` OutMessage. */
20
+ /** Programmatically selects an item in the single-select listbox, closing the listbox and emitting a `Selected({ value })` OutMessage. */
25
21
  export const selectItem = (model, item) => update(model, SelectedItem({ item }));
26
- /** Reflects an externally-sourced selection onto the model without
27
- * emitting an OutMessage or running the user-selection side effects (no
28
- * close, no focus). Use this to mirror external truth (a URL parameter,
29
- * restored storage, a server push) onto the listbox's selection.
30
- * Contrast with `selectItem`, which represents a user or programmatic
31
- * *choice*: it closes the listbox, restores focus, and emits `Selected`.
32
- * `reflect` returns the model directly because it produces no commands and
33
- * no OutMessage, so a parent reflecting external state cannot
34
- * accidentally echo it back out. */
35
- export const reflectSelectedItem = Function.dual(2, (model, maybeItem) => evo(model, { maybeSelectedItem: () => maybeItem }));
36
- const internalView = makeView({
37
- isItemSelected: (model, itemValue) => Option.exists(model.maybeSelectedItem, selectedItem => selectedItem === itemValue),
38
- selectedItemIndex: (model, items, itemToValue) => Option.flatMap(model.maybeSelectedItem, selectedItem => Array.findFirstIndex(items, item => itemToValue(item) === selectedItem)),
39
- ariaMultiSelectable: false,
40
- });
22
+ const internalView = makeView({ ariaMultiSelectable: false });
23
+ const arrayBasedView = internalView();
24
+ const singleViewImpl = defineView((model, { maybeSelectedValue, ...baseInputs }) => arrayBasedView(model, {
25
+ ...baseInputs,
26
+ selectedValues: Option.toArray(maybeSelectedValue),
27
+ }));
41
28
  /** Pairs the single-select listbox's `view` and `update` (and programmatic
42
29
  * helpers) behind a single Item-typed entry point. Declaring the listbox
43
30
  * once at module scope ensures the view's `Item` type and the update's
@@ -61,13 +48,14 @@ const internalView = makeView({
61
48
  export const create = () => {
62
49
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
63
50
  const typedUpdate = update;
51
+ const view =
52
+ /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
53
+ singleViewImpl;
64
54
  return {
65
- view: internalView(),
55
+ view,
66
56
  update: typedUpdate,
67
57
  selectItem: (model, item) => typedUpdate(model, SelectedItem({ item })),
68
58
  open: model => typedUpdate(model, Opened({ maybeActiveItemIndex: Option.none() })),
69
59
  close: model => typedUpdate(model, Closed()),
70
- /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
71
- reflectSelectedItem: reflectSelectedItem,
72
60
  };
73
61
  };
@@ -1,169 +1,84 @@
1
- import { Effect, Option, Schema as S } from 'effect';
2
- import * as Command from 'foldkit/command';
3
- import { type ChildAttribute, type Html } from 'foldkit/html';
4
- import { type Reflect, type View as SubmodelView } from 'foldkit/submodel';
1
+ import { Option, Schema as S } from 'effect';
2
+ import { type Attribute, type Html } from 'foldkit/html';
5
3
  /** Controls the radio group layout direction and which arrow keys navigate between options. */
6
4
  export declare const Orientation: S.Literals<readonly ["Horizontal", "Vertical"]>;
7
5
  export type Orientation = typeof Orientation.Type;
8
- /** Schema for the radio group component's state, tracking the selected value and orientation. */
9
- export declare const Model: S.Struct<{
10
- readonly id: S.String;
11
- readonly selectedValue: S.Option<S.String>;
12
- readonly orientation: S.Literals<readonly ["Horizontal", "Vertical"]>;
13
- }>;
14
- export type Model = typeof Model.Type;
15
- /** Sent when a radio option is selected via click or keyboard navigation. */
16
- export declare const SelectedOption: import("foldkit/schema").CallableTaggedStruct<"SelectedOption", {
17
- value: S.String;
18
- index: S.Number;
19
- }>;
20
- /** Sent when the focus-option command completes. */
21
- export declare const CompletedFocusOption: import("foldkit/schema").CallableTaggedStruct<"CompletedFocusOption", {}>;
22
- /** Union of all messages the radio group component can produce. */
23
- export declare const Message: S.Union<[
24
- typeof SelectedOption,
25
- typeof CompletedFocusOption
26
- ]>;
27
- export type SelectedOption = typeof SelectedOption.Type;
28
- export type CompletedFocusOption = typeof CompletedFocusOption.Type;
29
- export type Message = typeof Message.Type;
30
- /** Sent to the parent when an option is committed. Carries the selected
31
- * value and its index. Generic over `Value extends string`: the runtime
32
- * schema stores `value: string`, but the type-level OutMessage exposes
33
- * `value: Value` so consumers who supply `options: ReadonlyArray<MyUnion>`
34
- * receive `value: MyUnion` from the factory's `update` without casting at
35
- * the call site. The cast is fenced inside this module's `update` return,
36
- * sound because the value was selected from the options array the
37
- * consumer supplied. */
38
- export declare const Selected: import("foldkit/schema").CallableTaggedStruct<"Selected", {
39
- value: S.String;
40
- index: S.Number;
41
- }>;
42
- export type Selected<Value extends string = string> = Readonly<{
43
- readonly _tag: 'Selected';
44
- readonly value: Value;
45
- readonly index: number;
46
- }>;
47
- export declare const OutMessage: S.Union<readonly [import("foldkit/schema").CallableTaggedStruct<"Selected", {
48
- value: S.String;
49
- index: S.Number;
50
- }>]>;
51
- /** Generic over `Value extends string` so consumers who create the radio
52
- * group via `RadioGroup.create<MyUnion>()` receive `value: MyUnion` in
53
- * the `Selected` OutMessage from the factory's `update`, instead of
54
- * `value: string`. Defaults to `string` for consumers that don't need the
55
- * lift. */
56
- export type OutMessage<Value extends string = string> = Selected<Value>;
57
- /** Configuration for creating a radio group model with `init`. */
58
- export type InitConfig = Readonly<{
59
- id: string;
60
- selectedValue?: string;
61
- orientation?: Orientation;
62
- }>;
63
- /** Creates an initial radio group model from a config. Defaults to no selection and vertical orientation. */
64
- export declare const init: (config: InitConfig) => Model;
65
- /** Moves focus to the radio option at the given index. */
66
- export declare const FocusOption: Command.CommandDefinitionWithArgs<"FocusOption", {
67
- id: S.String;
68
- index: S.Number;
69
- }, Effect.Effect<{
70
- readonly _tag: "CompletedFocusOption";
71
- }, never, never>>;
72
- type UpdateReturn<Value extends string = string> = readonly [
73
- Model,
74
- ReadonlyArray<Command.Command<Message>>,
75
- Option.Option<OutMessage<Value>>
76
- ];
77
- /** Processes a radio group message and returns the next model, commands, and
78
- * optional OutMessage. Generic over `Value extends string`: pass the consumer's
79
- * union type at the call site to receive `Selected({ value: MyUnion })` without
80
- * casting. Defaults to `string`. */
81
- export declare const update: <Value extends string = string>(model: Model, message: Message) => UpdateReturn<Value>;
82
- /** Programmatically selects a value in the radio group, updating the model
83
- * and returning focus commands plus a `Selected` OutMessage. */
84
- export declare const select: <Value extends string = string>(model: Model, value: Value, options: ReadonlyArray<Value>) => UpdateReturn<Value>;
85
- /** Reflects an externally-sourced selection onto the model without
86
- * emitting an OutMessage or running the focus command. Use this to mirror
87
- * external truth (a URL parameter, restored storage, a server push) onto
88
- * the radio group's selection. Contrast with `select`, which represents a
89
- * user or programmatic *choice*: it focuses the option and emits
90
- * `Selected`. Takes no `options` (unlike `select`) because it sets the
91
- * value directly rather than deriving a focus index. Returns the model
92
- * directly because it produces no commands and no OutMessage. */
93
- export declare const reflectSelectedValue: Reflect<Model, Option.Option<string>>;
94
6
  /** Per-option render info passed to the consumer's `toView`. The consumer
95
- * spreads `option`, `label`, and `description` onto whichever elements
96
- * carry that role in their layout. Generic over `Value extends string`:
97
- * when `RadioGroup.create<MyUnion>()` is declared, `option.value` is
98
- * typed `MyUnion` so the consumer can switch on it without casting. */
99
- export type OptionInfo<Value extends string = string> = Readonly<{
7
+ * spreads `option`, `label`, and `description` onto whichever elements carry
8
+ * that role in their layout. Generic over `Value extends string` so
9
+ * `option.value` carries the consumer's union type, and over `ParentMessage`
10
+ * so the attribute bundles dispatch the parent's own Message. */
11
+ export type OptionInfo<Value extends string, ParentMessage> = Readonly<{
100
12
  value: Value;
101
13
  index: number;
102
14
  isSelected: boolean;
103
15
  isActive: boolean;
104
16
  isDisabled: boolean;
105
- option: ReadonlyArray<ChildAttribute>;
106
- label: ReadonlyArray<ChildAttribute>;
107
- description: ReadonlyArray<ChildAttribute>;
17
+ option: ReadonlyArray<Attribute<ParentMessage>>;
18
+ label: ReadonlyArray<Attribute<ParentMessage>>;
19
+ description: ReadonlyArray<Attribute<ParentMessage>>;
108
20
  }>;
109
21
  /** Render-time payload published to the consumer's `toView`.
110
22
  *
111
23
  * - `group`: ARIA + role attributes for the wrapping radiogroup element.
112
- * - `options`: one entry per option in `viewInputs.options`, in the same
113
- * order. Includes the value, derived state, and the attribute bundles
114
- * for the option element, its label, and its description.
115
- * - `selectedValue`: the currently-selected value, if any. Convenient
116
- * for the consumer when rendering selected-state visuals next to the
117
- * option attributes.
118
- * - `hiddenInput`: when `viewInputs.name` was supplied, attributes for a
119
- * hidden form input carrying the selected value. The consumer
120
- * renders the `<input>` themselves. Empty array when `name` is
121
- * undefined. */
122
- export type RenderInfo<Value extends string = string> = Readonly<{
123
- group: ReadonlyArray<ChildAttribute>;
124
- options: ReadonlyArray<OptionInfo<Value>>;
24
+ * - `options`: one entry per option in `options`, in the same order. Includes
25
+ * the value, derived state, and the attribute bundles for the option
26
+ * element, its label, and its description.
27
+ * - `selectedValue`: the currently-selected value, if any. Convenient for the
28
+ * consumer when rendering selected-state visuals next to the option
29
+ * attributes.
30
+ * - `hiddenInput`: when `name` was supplied, attributes for a hidden form
31
+ * input carrying the selected value. The consumer renders the `<input>`
32
+ * themselves. Empty array when `name` is undefined. */
33
+ export type RenderInfo<Value extends string, ParentMessage> = Readonly<{
34
+ group: ReadonlyArray<Attribute<ParentMessage>>;
35
+ options: ReadonlyArray<OptionInfo<Value, ParentMessage>>;
125
36
  selectedValue: Option.Option<Value>;
126
- hiddenInput: ReadonlyArray<ChildAttribute>;
37
+ hiddenInput: ReadonlyArray<Attribute<ParentMessage>>;
127
38
  }>;
128
- /** Per-render view inputs passed to `view` via `h.submodel`'s `viewInputs` field.
129
- * Generic over `Value extends string` so consumers using
130
- * `RadioGroup.create<MyUnion>()` receive `option.value: MyUnion` in
131
- * `toView` and `(value: MyUnion, index) => boolean` in
132
- * `isOptionDisabled`, without casting. */
133
- export type ViewInputs<Value extends string = string> = Readonly<{
39
+ /** Per-render view configuration for the stateless controlled {@link view}.
40
+ * Generic over `Value extends string` (the option union) and `ParentMessage`
41
+ * (the message `onSelect` dispatches).
42
+ *
43
+ * - `selectedValue`: the current selection, read straight from the parent
44
+ * Model. The roving tabindex and checked state derive from it.
45
+ * - `onSelect`: dispatched with the chosen value when an option is clicked or
46
+ * navigated to. Handle it in the parent's `update` by storing the value.
47
+ * The radio group manages focus itself, so the handler needs to do nothing
48
+ * else.
49
+ * - `toView`: receives the {@link RenderInfo} and lays out the group. */
50
+ export type ViewConfig<Value extends string, ParentMessage> = Readonly<{
51
+ id: string;
52
+ selectedValue: Option.Option<Value>;
134
53
  options: ReadonlyArray<Value>;
54
+ onSelect: (value: Value) => ParentMessage;
135
55
  ariaLabel: string;
136
- toView: (render: RenderInfo<Value>) => Html;
56
+ toView: (render: RenderInfo<Value, ParentMessage>) => Html;
57
+ orientation?: Orientation;
137
58
  isOptionDisabled?: (value: Value, index: number) => boolean;
138
59
  isDisabled?: boolean;
139
60
  name?: string;
140
- orientation?: Orientation;
141
61
  }>;
142
- /** Pairs the radio group's `view` and `update` (and `select`) behind a
143
- * single Value-typed entry point. Declaring the radio group once at
144
- * module scope ensures the OutMessage's `value` field carries the
145
- * consumer's union type without an `as` cast at the call site:
62
+ /** Renders an accessible radio group as a stateless controlled component. The
63
+ * parent owns the selection (`selectedValue`) and receives the parent's own
64
+ * Message via `onSelect` when an option is chosen. Moving focus onto the
65
+ * newly-active option is the radio group's own concern: it happens inside the
66
+ * component's click and keydown handlers, so the parent's `update` only stores
67
+ * the value.
146
68
  *
147
69
  * ```ts
148
- * const ToolRadioGroup = RadioGroup.create<Tool>()
149
- *
150
70
  * // In view:
151
- * h.submodel({ view: ToolRadioGroup.view, ... })
71
+ * RadioGroup.view<Tool, Message>({
72
+ * id: TOOL_RADIO_GROUP_ID,
73
+ * selectedValue: Option.some(model.tool),
74
+ * options: TOOLS,
75
+ * ariaLabel: 'Tool',
76
+ * onSelect: tool => SelectedTool({ tool }),
77
+ * toView: ({ group, options }) => ...,
78
+ * })
152
79
  *
153
80
  * // In update:
154
- * const [next, commands, maybeOutMessage] = ToolRadioGroup.update(model, message)
155
- * // maybeOutMessage: Option<RadioGroup.OutMessage<Tool>>
156
- * ```
157
- *
158
- * The view's `ViewInputs.options` stays typed `ReadonlyArray<string>`;
159
- * consumers can pass a `ReadonlyArray<MyUnion>` (assignable) and the
160
- * fenced cast inside `update` types the OutMessage's `value` as
161
- * `MyUnion`. */
162
- export declare const create: <Value extends string = string>() => Readonly<{
163
- view: SubmodelView<Model, Message, ViewInputs<Value>>;
164
- update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Value>>];
165
- select: (model: Model, value: Value, options: ReadonlyArray<Value>) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Value>>];
166
- reflectSelectedValue: Reflect<Model, Option.Option<Value>>;
167
- }>;
168
- export {};
81
+ * SelectedTool: ({ tool }) => [evo(model, { tool: () => tool }), []],
82
+ * ``` */
83
+ export declare const view: <Value extends string, ParentMessage>(config: ViewConfig<Value, ParentMessage>) => Html;
169
84
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/radioGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAGN,MAAM,EAEN,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EAGV,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,IAAI,IAAI,YAAY,EAE1B,MAAM,kBAAkB,CAAA;AAOzB,+FAA+F;AAC/F,eAAO,MAAM,WAAW,iDAAyC,CAAA;AACjE,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD,iGAAiG;AACjG,eA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