@dloizides/ui-forms 1.28.1 → 1.29.0

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/CHANGELOG.md CHANGED
@@ -1,495 +1,505 @@
1
- # Changelog
2
-
3
- ## 1.28.1
4
-
5
- INVOICE-FU-22 "To and Cc dropdown of saved people".
6
-
7
- - Every `SelectControl` trigger sets `aria-haspopup="listbox"`, which `useEscapeKey` in `ui-layout` reads to give Escape to the open menu.
8
-
9
- ## 1.28.0
10
-
11
- INVOICE-FU-22 "To and Cc dropdown of saved people", D-FU22-5 "Review findings are fixed in the packages".
12
-
13
- - `SelectControl` gains `menuAnchor` (`listboxLabel`, `anchorRef`): the menu stays on screen, focus stays on the trigger, arrows, Enter and Space work from it, and the trigger is a combobox with `aria-activedescendant`. Callers without it are unchanged.
14
- - `AnchoredMenu` gains `placement`; `AnchoredMenuListbox.highlightedValue` is optional.
15
- - `nextHighlight` is exported.
16
-
17
- ## 1.27.0
18
-
19
- DATE-INPUT-1 "Every date or date-time field uses the shared input".
20
-
21
- - New `DateField` (`YYYY-MM-DD`) and `DateTimeField` (`YYYY-MM-DDTHH:mm`), rendered through `Field`; a real `<input type>` on web.
22
-
23
- ## 1.26.0
24
-
25
- INVOICE-3 "Invoice interface over a user-chosen folder": owner picks.
26
-
27
- - `SelectControl` trigger fills with `surfaceElevated`, like an editable field, so it differs from read-only.
28
- - Read-only `useThemedInput` draws the rest border, so the box shows on a form of the same fill.
29
- - Placeholder is solid `textSecondary`: 0.6 alpha measured 2.38 against the 4.5 AA floor.
30
- - `FormField` gains `inputRef`.
31
-
32
- ## 1.25.0
33
-
34
- INVOICE-3 "Invoice interface over a user-chosen folder": extracted from invoice-web.
35
-
36
- - New `SelectField`: `Field` + `SelectControl`, its accessible name carries the selection.
37
-
38
- ## 1.24.0
39
-
40
- BEAD-3 "Report form: searchable pattern field": review fix.
41
-
42
- - New `useKeepInView(trigger)`, moved from Jinx: scrolls the returned view into sight each time `trigger` takes a new value, as far as needed and no further. Web only; a no-op on native.
43
-
44
- ## 1.23.0
45
-
46
- BEAD-3 "Report form: searchable pattern field and shared form feedback".
47
-
48
- - `TypeaheadControl` takes `search` instead of `options` for async results: `load(query, signal)`, `onPick(option | null)`, loading, empty and error text, 250 ms debounce, stale responses ignored, editing after a pick clears it.
49
- - `TypeaheadControl` is a WAI-ARIA combobox in both modes: Down, Up, Enter, Esc, `aria-activedescendant`, a ref to its input. Its rows change role from `menuitem` to `option`; testIDs are unchanged.
50
- - `ControlOption` gains an optional `detail`, shown under the title on a phone and beside it from 768 px.
51
- - `AnchoredMenu` fits its height above the on-screen keyboard through `visualViewport`; new `listbox` prop for listbox roles and a status line.
52
- - New `FormStatusLine` and `useFocusFirstInvalid`.
53
-
54
- ## 1.22.0
55
-
56
- KEFI-EDITOR-UI-2 "Extract stepper and upload-with-link field to @dloizides/ui-forms", extracted from kefi-web.
57
-
58
- - New `StepperTabs`, `StepperNav` and pure `resolveStepNeighbours`: step tabs sharing the row width, back and next under the step. Generic over the step key; every string is a prop.
59
- - New `UploadWithLinkField`: preview, an upload control slot and a link input revealed on request. The slot keeps ui-forms free of ui-media; pass `ImagePickerButton`.
60
-
61
- ## 1.20.0
62
-
63
- **Horizontal form fields line up (D-ALL-22 "Horizontal form fields are aligned").**
64
-
65
- - `FormGrid` rows set `alignItems: flex-start`: every cell starts on one top edge and a tall cell (hint, error) no longer stretches its neighbours.
66
- - New `AlignToControl`: an aria-hidden label line with the same font and spacing model as `Field`, so a button beside labelled fields sits on the input line, not the label line. `FormCell alignToControl` applies it to a cell.
67
- - New `InlineFieldRow` (extracted from kefi-web): a field and its action stacked below `inlineMinWidth` (default 1024) and on one row above it, the action placed by `AlignToControl` instead of a hand-measured offset.
68
-
69
- ## 1.18.7
70
-
71
- - Focused inputs draw the fleet focus ring (`@dloizides/design-tokens` 1.14 `FOCUS_RING`: 2 px solid outline, 2 px offset, contrast-checked colour; error colour when errored) instead of the 3 px 16% box-shadow halo (FOCUS-RING-1 "One focus ring across the shared kit").
72
-
73
- ## 1.18.6
74
-
75
- **ChipSelector: a short chip (e.g. "All") is at least 44 px wide, not only 44 px tall (KEFI-FIT-1 "kefi-web fit and hit-box fixes").**
76
-
77
- `chip` and `chipOutline` get `minWidth: 44` next to the existing `minHeight: 44`; measured 42x44 on kefi-web approvals at 360.
78
-
79
- ## 1.18.3
80
-
81
- **FormCheckbox: the hint/description is now announced by screen readers.**
82
-
83
- The hint Text gets a stable per-instance id (`useFieldIds().hintId`, as `Field` does) and the role=checkbox
84
- Pressable sets `aria-describedby` to it when a hint is present; with no hint the attribute is omitted.
85
-
86
- ## 1.18.2
87
-
88
- **FormSwitch: the switch now sits in a 44x44 (MIN_TOUCH_TARGET_PX) pressable slot on web.**
89
-
90
- Visual QA on kefi-web Site settings (360 and 1280) measured the switch at 40x20: react-native-web sizes the
91
- native input to the Switch root, and `hitSlop` is inert on web. The switch is now centred in a slot with
92
- `minWidth`/`minHeight` MIN_TOUCH_TARGET_PX inside the pressable row, so the row stays at least 44 tall even when a
93
- `containerStyle` overrides `minHeight`. The track and thumb are unchanged; the switch gains a few px of horizontal gutter.
94
- New testID: `<testID>-hitbox`.
95
-
96
- ## 1.17.0
97
-
98
- **Chips now have a 44px minimum touch target on web. `hitSlop` never did that — it is native-only.**
99
-
100
- `CHIP_HIT_SLOP` was documented as expanding the chip's touch area toward the WCAG ≥44px floor
101
- "without changing the rendered pill size". Measured in headless Chromium at 360x640 on 2026-09-21:
102
- a chip's box is 33px tall (`paddingVertical: 6`), and `document.elementFromPoint(68, 35)` — 5px
103
- above a top edge at y=40, inside `CHIP_HIT_SLOP.top: 10` — returns the PARENT element, not the
104
- chip. react-native-web 0.21.2 references `hitSlop` only inside the legacy `Touchable` mixin's
105
- press-RETENTION path (after the responder is already granted) and not at all in `Pressable`, so on
106
- web the rendered box is the entire tappable area. The chips were a 33px target in all seven portals.
107
-
108
- - `chipStyles.chip` and `chipStyles.chipOutline` gain `minHeight: 44` + `justifyContent: 'center'`.
109
- Chip width is unchanged (56.7px and 68px before and after for the same labels), so wrapping and
110
- `CHIP_GUTTER` spacing are untouched; a chip row grows 33px → 44px tall.
111
- - `CHIP_HIT_SLOP` is kept and still helps iOS/Android. Its doc comment now states the web result
112
- instead of claiming one.
113
- - Consumers with a dense chip strip should re-check row spacing: the pill itself is taller now.
114
-
115
- ## 1.15.0
116
-
117
- **`FormSwitch` now emits `aria-checked` / `aria-disabled` on web; `ChipSelector` gained an option icon slot and opt-in radio semantics.**
118
-
119
- `FormSwitch` (A11Y-ARIA-CHECKED-1): react-native-web 0.21 emits nothing from `accessibilityState` on web, so the
120
- switch wrapper rendered `role="switch"` with no `aria-checked` - an invalid switch that announced no state. The
121
- state is now passed as literal `aria-checked` (always) and `aria-disabled` (only when disabled) web props;
122
- `accessibilityState` also carries `disabled` for native.
123
-
124
- `ChipSelector`:
125
- - `ChipOption.icon?: React.ReactNode` - rendered before the label inside the chip, wrapped `aria-hidden`. Options
126
- without an icon render the exact same tree as before.
127
- - `singleSelectRole?: 'button' | 'radio'` (type `ChipSingleSelectRole`). Default `button` = unchanged. With
128
- `radio` and `multiple` unset, the group is `role="radiogroup"` and each chip `role="radio"` + `aria-checked`.
129
- Ignored for multi-select. Trade-off: RN-web renders a radio chip as a `<div>`, which activates on Enter but not
130
- Space and has no arrow-key roving focus.
131
-
132
- **Additive and backward-compatible.** No prop set = identical DOM for every existing consumer.
133
-
134
- ## 1.14.0
135
-
136
- **`FormField` gained an opt-in `recentKey` — remember the last N submitted values and offer them on focus.**
137
-
138
- A search / filter / lookup box that the user retypes the same handful of values into now gets a
139
- "recent values" dropdown for free. Set `recentKey="<namespace>"` on a `FormField` and the values it
140
- submits are remembered (per key) and surfaced in a menu on focus; picking one fills the input. A
141
- value is recorded on submit (Enter) **and** on blur-with-content, so both "hit enter" and "typed then
142
- moved on" are captured. The dropdown reuses the kit's `AnchoredMenu` (portalled to `document.body`, so
143
- it is never painted behind a table / card / the next field) with full a11y (menu name, per-row label +
144
- hint + role).
145
-
146
- Persistence is `localStorage` under `@dloizides/ui-forms:recent:<recentKey>`; the list de-dupes
147
- case-insensitively, promotes a repeat to the front, and caps at `recentMax` (default 10). On native /
148
- SSR / when storage is disabled it is a silent no-op (recents are always `[]`), and every storage
149
- access is wrapped so a quota or privacy-mode failure can never throw into render.
150
-
151
- **Additive and backward-compatible.** Leave `recentKey` unset — the default — and the field behaves
152
- exactly as before: nothing rendered, no state/refs/effects, no storage touched. NEVER set it on a
153
- password / secure field. The engine is also exported standalone as `useRecentValues(key, max?)` for
154
- bespoke recents surfaces, and `AnchoredMenu` gained an optional `accessibilityLabel` for naming the menu.
155
-
156
- ## 1.13.3
157
-
158
- **Placeholder text was too dark — it read like an already-filled value.**
159
-
160
- `useThemedInput` painted the placeholder with the theme's `textSecondary` — a deliberately
161
- dark, accessible grey (design-tokens UX-11) that also renders readable secondary *copy*. At
162
- full strength a placeholder (e.g. `follower` in a "Dance role" box) was hard to tell apart
163
- from entered text. It is now `textSecondary` composited toward the field background at 0.6
164
- alpha, so a hint reads clearly lighter than the solid entered text (`colors.text`) while
165
- keeping the theme hue — and it works in dark mode too (it composites toward whatever the
166
- field background is). The field's visible label still carries the accessible name, so this
167
- is a usability win, not an a11y regression. Affects every `@dloizides/ui-forms`-driven input
168
- (`FormField`, `Field`, `ThemedTextInput`, the `ui-tables` `Filters` search box) across all
169
- seven portals.
170
-
171
- ## 1.12.0
172
-
173
- **`FormField` gained `labelHidden` — hide the visible label, keep the accessible name.**
174
-
175
- A field whose placeholder already names it (a toolbar search box, an inline filter) does
176
- not want a stacked visible label: the label wastes a row and, worse, pushes the input a
177
- label-row lower than a bare button beside it, so the two misalign. Until now the only way
178
- to drop the visible label was to blank `label` — which ALSO blanked the input's
179
- `accessibilityLabel`, silently stripping the accessible name.
180
-
181
- `labelHidden` removes ONLY the visible `<label>` row: `label` stays required and the input
182
- keeps `accessibilityLabel={label}`, so a screen reader reads the same name and the field
183
- still resolves by role + name. Additive and backward-compatible — default `false`, every
184
- existing call renders unchanged.
185
-
186
- ## 1.11.1
187
-
188
- **`ThemedTextInput` shipped no metrics, so every direct caller got a raw 19px input.**
189
-
190
- It documented itself as "the ONE source of truth for the input look" while shipping
191
- only **colours** — no border, radius, padding or height. `FormField` quietly passed its
192
- own private duplicate of those metrics, so anything reached *through* `FormField` looked
193
- correct and the gap was invisible. Every **direct** caller — the documented, blessed
194
- usage — got a raw browser input.
195
-
196
- Measured live in the Digital Kin CMS before: **10/10 inputs below the 48px floor**, text
197
- inputs 19px, textareas 38px. After: **0/10**, at 48/96px.
198
-
199
- **Label association was absent entirely** (0 `label[for]`, 0 ids). Two defects only a
200
- real browser could find, both fixed here:
201
-
202
- - **`htmlFor` is silently dropped by react-native-web** — it is not on the prop
203
- allowlist, the same family as the dropped `accessibilityHint`. A prop-level assertion
204
- passes against the broken build; only a DOM-level test catches it, so that is what the
205
- new tests assert.
206
- - **Dangling `for`.** `Field` assumed render-function children place the id they are
207
- handed, but `SelectControl` uses `aria-labelledby` instead — so the difficulty label
208
- shipped `for="field-control-3"` pointing at **nothing**, passing every structural check
209
- while focusing no field. `useHtmlFor` now sets `for` only when the target is genuinely
210
- in the document.
211
-
212
- > ⚠️ **Cross-fleet visual change.** `controlStyles.input` gaining `minHeight: 48` lifts
213
- > dense filter inputs and select triggers in `aml-v2`/`agora-web` from ~38-41px to 48px.
214
- > This cannot be avoided: the input floor is what fixes the 19px defect, and nothing
215
- > fixes that without also lifting inputs that already had padding. Owner-approved.
216
-
217
-
218
- ## 1.9.0
219
-
220
- **Campaign F3 — `Field`'s spacing model, and the layout primitives.** `Field` hard-coded a 16px
221
- bottom margin on its container. That is the pre-flexbox model — the CHILD owns the space after
222
- itself — and in a `gap`-laid-out parent, which is how every modern form row in this fleet is
223
- written, the margin STACKS on the parent's gap. So consumers cancelled it by hand: **16
224
- `containerStyle={{ marginBottom: 0 }}` sites across the fleet**, 13 of them in aml-v2, each with an
225
- apologetic comment. AML v1 got this right in CSS years ago (`.ui-field { display: flex;
226
- flex-direction: column; gap: 6px; }`) and wrote the contract down in `shared/FORMS.md`.
227
-
228
- **This release moves NO pixels for any existing consumer.** The fix is opt-in, not a 2.0.0 — see
229
- "Why not a major bump" below.
230
-
231
- - **Add `FormGrid` + `FormCell`** — the wrapping form row, extracted from the copy the fleet
232
- re-declares verbatim (`{ flexDirection: 'row', flexWrap: 'wrap', gap: 12 }` +
233
- `{ minWidth: 220, flexGrow: 1, flexBasis: 260 }`), with the min-width/basis parameterised. Cell
234
- metrics live on the GRID, so the common call site is a bare `<FormCell>` and only the genuine
235
- one-offs (`<FormCell basis={160} grow={false} minWidth={140}>`) carry props.
236
- - **Add `FormSection`** — the fieldset/legend grouping only v1 had. react-native-web has no
237
- `fieldset` mapping, so this is the ARIA equivalent: `role="group"` + `aria-labelledby` pointing
238
- at the legend. The legend reuses `resolveLabelVariantStyle` — the SAME function `Field` uses — so
239
- a section heading cannot drift into a third label voice.
240
- - **Add `Field.spacing` (`'stack' | 'gap'`)** — the two spacing models. `stack` is the historical
241
- 16px margin + 4px child margins, byte-identical to 1.8.0, and remains the default. `gap` is the
242
- FORMS.md contract: no bottom margin, one uniform 6px internal gap, parent owns the rhythm.
243
- - **`Field` inside a `FormGrid` or `FormSection` resolves to `gap` automatically.** Adopting the
244
- shared grid IS the opt-in: a consumer deletes its hand-rolled `grid`/`field` styles AND its
245
- `marginBottom: 0` cancel in the same edit. An explicit `spacing` prop beats the context in both
246
- directions.
247
- - **`ChipSelector`**: the chip row now spaces with `gap: 8` instead of per-chip margins plus a
248
- compensating `marginBottom: -8`. Rendered box is byte-identical. Also gains a `spacing`
249
- passthrough, and `containerStyle` widens to `StyleProp<ViewStyle>` to match `Field`'s.
250
-
251
- ### Why not a major bump
252
-
253
- The brief for this work allowed a breaking 2.0.0. It was rejected. Switching every `Field` to the
254
- gap model in one publish moves pixels on every form in seven portals simultaneously — which is
255
- precisely the change you cannot visually QA, because no app remains on the old behaviour to compare
256
- against, and a regression surfaces as "some form somewhere looks slightly wrong" with seven
257
- suspects. The context-aware opt-in gives the identical end state via a per-app rollout, each step
258
- behind visual QA, with `git revert` scoped to one app. The cost is that both models live in the
259
- code until the fleet has migrated; that is a smaller price than an un-QA-able fleet-wide pixel
260
- change.
261
-
262
- ### Correction to the campaign premise
263
-
264
- `ChipSelector`'s `marginBottom: -CHIP_GUTTER` was documented — and briefed — as compensation for
265
- `Field`'s 16px margin, load-bearing enough that changing one without the other would break chip
266
- spacing in 7+ sites. **That was wrong.** The -8 cancelled the chips' OWN bottom gutter hanging off
267
- the last wrapped row; it behaved identically whatever `Field` contributed. It has been replaced with
268
- `gap` regardless, because a margin/negative-margin pair is fragile and leaks a negative margin onto
269
- the block's box. `fieldSpacing.test.tsx` now pins `Field` and `ChipSelector` to the same box in both
270
- models, so the relationship is checkable rather than folkloric.
271
-
272
-
273
- ## 1.8.0
274
-
275
- **Campaign F2 — the dense CONTROLS arrive.** `@dloizides/ui-tables` shipped a complete, themed,
276
- a11y-wired set of form controls inside its `Filters` bar and exported NONE of them: its
277
- `src/index.ts` exposed only `Filters`, `useFilterDraft`, `suggestOptions`, `isUnmatched` and
278
- types. Six portals could SEE those controls working and none could import them, so the fleet
279
- reimplemented them — **6 independent select implementations, 5 date fields, 2 typeaheads**. Same
280
- shape as `MultiTenancy.EntityFrameworkCore` shipping no EF Core. This release makes them public.
281
-
282
- Nothing here moves a pixel for an existing consumer: the metrics are the promoted originals,
283
- unchanged. `CONTAINER_MARGIN_BOTTOM` and `ChipSelector`'s compensating `marginBottom:
284
- -CHIP_GUTTER` remain deliberately untouched.
285
-
286
- - **Add `SelectControl`** — single-select enum/status dropdown. Bordered trigger + chevron opening
287
- the shared `AnchoredMenu`.
288
- - **Add `TypeaheadControl`** — search-as-you-type combobox (aml-v2's CountryPicker, generalized).
289
- Free typing is preserved (the value is raw text the caller normalises at query time); picking a
290
- suggestion fills the canonical LABEL, not the value.
291
- - **Add `DateRangeControl`** — inclusive from/to pair. Editing one side patches ONLY that side.
292
- - **Add `AnchoredMenu`** — the floating option list both of the above compose. Kept in-tree with
293
- NO `ui-layout` dependency; that was a considered choice in `ui-tables` and it still holds, since
294
- depending on the higher-level `ModalDropdown` would invert the graph for every consumer.
295
- - **Add `controlStyles`** — the tuned metrics, promoted verbatim. `ui-tables`' `Filters/styles.ts`
296
- said the quiet part out loud in its own header: it "reconcile[d] the per-field styles that were
297
- copy-pasted across aml-v2's filter files into one shared source" — and then locked the
298
- reconciliation inside one bar where no other surface could reach it.
299
- - **Add `suggestOptions` / `isUnmatched`** — the ranked substring matcher behind the typeahead.
300
- - **Add `ControlOption` / `DateRangeValue`** types. `ui-tables` now ALIASES its long-standing
301
- public `FilterOption` / `DateRangeValue` onto these, so there is one definition rather than two
302
- structurally-compatible twins free to drift.
303
-
304
- ### The controls are LABEL-FREE, on purpose
305
-
306
- They render the control only. Compose them inside `Field` — with `labelVariant="control"` on a
307
- dense surface — to get the label, hint and error slots. That is what retires `ui-tables`' private
308
- `FieldShell` fork (see `@dloizides/ui-tables` 1.14.0) and leaves ONE label implementation for
309
- every control instead of one per control.
310
-
311
- ### i18n: this package still never calls `t`
312
-
313
- Every string — `accessibilityLabel`, `placeholder`, `optionHint`, `error`, `fromLabel`/`toLabel`
314
- — is a PRE-LOCALIZED prop. This is load-bearing, not stylistic: aml-v2 localizes through
315
- `@dloizides/i18n` with positional `{0}` while the other six portals use i18next `{{p1}}`, so a
316
- component that localized internally could not serve both. `SelectControl`'s `accessibilityLabel`
317
- is therefore composed BY THE CALLER — it must carry the selection ("Status: Active", not
318
- "Status"), and building that string needs a `t` call this package must not make.
319
-
320
- ### Fixed — a WCAG defect carried in by the promoted code
321
-
322
- `AnchoredMenu` marked the current option with `accessibilityState={{ selected }}` alone.
323
- **react-native-web does not read `accessibilityState` at all** (verified against
324
- `react-native-web@0.21`'s `createDOMProps`, which enumerates `aria-selected` /
325
- `accessibilitySelected` and never `accessibilityState`), so on web the selected option was
326
- distinguished by colour and font-weight ONLY — no screen reader could tell which option was
327
- current (WCAG 1.4.1, use of colour). `aria-selected` is now passed alongside, so each platform
328
- gets the channel it honours. The trigger already paired `aria-expanded` with `accessibilityState`;
329
- the option row was simply missed when that was done. A test asserts it, and that test FAILED
330
- before the fix.
331
-
332
- ## 1.7.0
333
-
334
- Additive wave implementing the shared cross-stack forms contract now written down at
335
- `PROOViD/AMLService/AMLService/wwwroot/shared/FORMS.md`. **Nothing in this release moves a pixel
336
- for an existing consumer**: every addition is opt-in and every default is the previous behaviour.
337
- `CONTAINER_MARGIN_BOTTOM` and `ChipSelector`'s compensating `marginBottom: -CHIP_GUTTER` are
338
- deliberately untouched — they are load-bearing and move together in a later, visual-QA-gated wave.
339
-
340
- - **Add `FormActions` — the submit/cancel row.** Promoted from the BYTE-IDENTICAL
341
- `erevna-web/src/components/Forms/FormActions.tsx` and `katalogos-web/.../FormActions.tsx`
342
- (68 lines each; `diff` returns nothing). All seven portals hand-roll this row; aml-v2, agora,
343
- kefi, ichnos and zygos each inline their own variant. The primary action is LAST in DOM order so
344
- tab reaches Cancel before Save, and `saving` drives the primary button's spinner rather than
345
- disabling-and-relabelling it. `saveDisabled` blocks Save WITHOUT blocking Cancel — an invalid
346
- form stays escapable. testIDs default to the twins' `save-button` / `cancel-button`, so existing
347
- Playwright selectors keep matching.
348
- - **`Field` gains `hint`.** ~21 hand-rolled copies of `{fontSize:12, marginTop:4, color:
349
- textSecondary}` exist across the fleet; aml-v2 alone declares a local `hint` style in 8 files.
350
- Because `Field` had no hint slot, consumers rendered the hint as a SIBLING, where it lands past
351
- the container's 16px bottom margin and detaches from the control it explains (see the apologetic
352
- comment in `aml-v2/src/screens/screening/CoverageSelector.tsx`). The hint renders UNDER the
353
- control and ABOVE the error, and hint and error COEXIST — both are reachable from the control via
354
- a composed `aria-describedby` (hint id then error id, in reading order). Only the error is a
355
- `role="alert"` live region; a hint that announced itself would interrupt on every focus.
356
- - **`Field` gains `optional` + `optionalLabel`.** Mutually exclusive with `required`; when a caller
357
- sets both, `required` WINS — the safe direction, since an under-marked required field sends the
358
- user into a failed submit. Enforced at runtime in `resolveFieldMarker` rather than in the type
359
- system, so a caller spreading a computed props object still gets a defined single-marker result
360
- instead of a compile error it cannot act on. Like the asterisk, the optional text is decorative
361
- (`aria-hidden`) — "optional" is the ABSENCE of `aria-required`, which assistive tech already
362
- conveys.
363
- - **`Field` gains `labelVariant` (+ `labelStyle` as the escape hatch).** `Field` hard-coded
364
- 13/600/sentence-case, which is exactly why kefi-web refused it and why `@dloizides/ui-tables`'
365
- private `FieldShell` forked to 11/700/uppercase. `labelVariant` makes the contract's TWO
366
- legitimate voices first-class and named: `field` (13/600 sentence case — a label that is READ)
367
- and `control` (11/700 UPPERCASE + letter-spacing — a label that is SCANNED, for dense filter bars
368
- and toolbars). An absent variant resolves to `field`, so every existing consumer renders
369
- byte-identically. `labelStyle` applies AFTER the variant for the genuine one-off.
370
- - **`Field`'s `containerStyle` widens `ViewStyle` -> `StyleProp<ViewStyle>`.** The narrow type was a
371
- documented pain: `aml-v2/src/screens/leaders/CountryPicker.tsx` has to build a COMPLETE style per
372
- variant because it cannot compose an array.
373
- - **`useThemedInput`: a focused errored field now keeps a RED focus ring.** It previously computed
374
- `isFocused && !hasError`, so an errored field got NO focus ring at all — removing the focus
375
- indicator (WCAG 2.4.7) from precisely the field the user was sent back to fix, at the moment they
376
- are most likely navigating by keyboard. It now always rings on focus and only changes the ring's
377
- COLOUR, matching v1's `input.invalid:focus { box-shadow: 0 0 0 3px var(--danger-tint) }`.
378
- One pre-existing test necessarily changed: it asserted `boxShadow === 'none'` for this state,
379
- i.e. it encoded the defect as intended behaviour.
380
- - **New peer dependency `@dloizides/ui-buttons >= 1.4.0`**, required by `FormActions` so the estate
381
- keeps exactly one button implementation rather than forking one here.
382
- - No i18n runtime is introduced: all user-visible copy (`saveLabel`, `cancelLabel`, `optionalLabel`,
383
- `hint`, `error`) arrives pre-localized. aml-v2 localizes via `@dloizides/i18n` with positional
384
- `{0}` params while the other six apps use i18next `{{p1}}`, and nothing bridges them, so a
385
- component that localized internally could not serve both.
386
- - Also shipping in this tarball, from a CONCURRENT workstream (commit `13bd281`, not part of this
387
- wave): `ChipSelector` gains `chipTestIDPrefix`, `optionAccessibilityHint` and `multiple`
388
- toggle semantics, and reads its on-primary ink from the theme's `onBrand` scale instead of a
389
- hardcoded `#fff`. All opt-in; the `chip-selector-chip-<value>` testID default is frozen.
390
-
391
- ## 1.6.0
392
-
393
- - **`ChipSelector` now composes `Field` internally — its label was drifting.** It rendered its OWN
394
- `<Text>` label whose metrics differed from `Field`'s on three of four axes: `marginBottom: 8`
395
- (vs 4), NO `fontSize` at all so it fell back to RN's ~14 (vs 13), and `colors.text`
396
- (vs `textSecondary`). A `ChipSelector` next to a `FormField` in a row/grid therefore started a
397
- different distance down the column and read as a different weight of text. Found at 4 sites in
398
- aml-v2 (`TenantWatchlistsEditor`, `CoverageSelector`, `CustomCoverageFields`,
399
- `AdvancedMatching`); fixing it in the package fixes every consumer with zero app churn.
400
- The local label styles are deleted — there is now exactly one label implementation in the kit.
401
- - **`ChipSelectorProps` is unchanged and fully backward-compatible** — every existing prop keeps
402
- its name, type and default, and `label` stays OPTIONAL. With no label (or an empty one) NO label
403
- row is rendered, so composing `Field` cannot introduce a phantom gap above the chips.
404
- - **`ChipSelector` gains `required`, `error` and `testID`** (all optional, all additive) now that
405
- `Field` provides them for free. `error` renders the same `role="alert"` line as `FormField` and
406
- is tied to the chip group via `aria-describedby` + `aria-invalid` (web only; no-op on native).
407
- - **Spacing:** a `ChipSelector` now carries `Field`'s `marginBottom: 16` like every other field
408
- (it previously had none). The chips' own 8px trailing gutter is cancelled on the group so the
409
- block's total bottom spacing is exactly 16 — the same as a `FormField`, not 24. Pass
410
- `containerStyle` to override, as before.
411
- - **`Field`'s `label` is now optional** (widened from `label: string`, so existing callers are
412
- unaffected). An absent or empty label renders no label row, letting a control whose label lives
413
- elsewhere still use the shared shell for its error line and spacing.
414
- - `FormSwitch` / `FormCheckbox` are deliberately NOT changed — see `src/labelRoles.test.tsx`.
415
- Their labels are INLINE control labels (beside the control in a row, the row's primary text),
416
- not field headers stacked above a control, so they have no alignment defect to fix and `Field`'s
417
- smaller/dimmer header treatment would be a regression. They were already identical to each
418
- other; a new test now enforces that they stay so.
419
-
420
- ## 1.5.0
421
-
422
- - **Add `Field` — the generic label-over-control wrapper.** `FormField` is hard-wired to a text
423
- input (`FormFieldProps extends Omit<TextInputProps,'style'>`), so any NON-text control (a
424
- dropdown, a date picker, a chip selector) had no shared way to get a label — and ended up
425
- visually misaligned next to its `FormField` siblings: the control's box started ~21px higher
426
- (no label row) and it missed `FormField`'s `marginBottom: 16`, so wrapped rows lost their
427
- vertical rhythm. This was hand-rolled in 5 places across zygos-web and aml-v2.
428
- `Field` takes `{ label, required?, error?, children, containerStyle?, testID? }` and renders the
429
- same label row / required mark / error line / spacing.
430
- - **`FormField` now composes `Field` internally**, so the two can never drift apart — the metrics
431
- live in exactly one place. `FormFieldProps` and every rendered attribute (`form-field-input`
432
- testID, `aria-invalid` / `aria-describedby` / `aria-required`, the `role="alert"` error line)
433
- are unchanged: fully backward-compatible.
434
- - `Field`'s `children` may be a plain node (the common case) or a render function receiving
435
- `{ describedById, hasError }`, so a custom control can wire the error line into its own
436
- `aria-describedby` / invalid state exactly the way `FormField` does.
437
-
438
- ## 1.4.0
439
-
440
- - **Accessibility (WCAG 2.1 AA) hardening — additive + backward-compatible.**
441
- - `FormField`: the error message is now programmatically tied to the input — the input gets
442
- `aria-invalid` when errored and `aria-describedby` pointing at the error line (which is a
443
- `role="alert"` live region), and `aria-required` when `required`. The required `*` is marked
444
- decorative (`aria-hidden` / `accessibilityElementsHidden`) so a screen reader hears "required"
445
- (via `aria-required`) instead of "star".
446
- - `ThemedTextInput`: new optional `describedById` + `requiredField` props forward
447
- `aria-describedby` / `aria-required`, and it emits `aria-invalid` from `hasError` (web only;
448
- no-ops on native). Existing callers are unaffected.
449
- - `FormCheckbox`: now keyboard-operable — the `role="checkbox"` Pressable renders a `<div>`
450
- (no free Enter/Space), so an explicit web-only Enter/Space handler toggles it (WCAG 2.1.1).
451
- - `ChipSelector`: chips gain a `hitSlop` so the touch target reaches ~44px WITHOUT changing the
452
- rendered pill size, and expose `accessibilityState.disabled` when the selector is disabled.
453
- - `useThemedInput`: the focus/hover CSS transition now collapses to instant when the user
454
- requests `prefers-reduced-motion: reduce` (WCAG 2.3.3, web only).
455
-
456
- ## 1.3.0
457
-
458
- - `ChipSelector` gains a `variant` prop (`'solid' | 'outline'`, default `'solid'`). `solid` is the
459
- original filled-pill look (selected = solid brand fill, white ink) — existing consumers
460
- (erevna / katalogos / kefi) render **identically**, no change. `outline` is the AML v1 console
461
- look: an outlined pill on a muted fill where the **selected** state is a subtle tinted-outline
462
- (brand border + brand ink + a low-alpha brand wash), NOT a solid fill; on web, hover lifts the
463
- border + ink to the brand colour. Fully theme-driven (brand colour + alpha, border/text from the
464
- theme), so it re-themes per tenant. Additive + backward-compatible.
465
-
466
- ## 1.2.0
467
-
468
- - Add `ThemedTextInput` + `useThemedInput` — the shared "readable + lively" text-input treatment,
469
- driven entirely by the active theme (re-themes per tenant, no hard-coded hex). At rest: dark
470
- readable text on a subtle off-white surface with a soft border. On hover (web): the border
471
- strengthens a touch. On focus: the border becomes the brand primary, the background brightens to
472
- the plain surface (white), and a soft 3px brand-tinted focus ring fades in. The animation is a
473
- pure GPU-cheap CSS transition on `border-color`/`background-color`/`box-shadow` (the ring is a
474
- `box-shadow`, so no layout/reflow) — NO `Animated`/`LayoutAnimation`/JS timers. Web-only style
475
- keys and the mouse-hover handlers are guarded behind `Platform.OS === 'web'`, so it stays
476
- native-safe (native applies the state-driven colours instantly).
477
- - `FormField` now renders `ThemedTextInput`, so every field gets the treatment for free; its label
478
- uses `textSecondary` at 13px/600 for readability. Props/behaviour (label, hint, error, testID,
479
- a11y, `onFocus`/`onBlur` pass-through) are backward-compatible.
480
-
481
- ## 1.1.0
482
-
483
- - Add `FormCheckbox` — a native-safe (`Pressable`-based, RN-web + native) themed checkbox: a rounded
484
- square that fills with the brand colour and shows a check glyph when on, with a label and optional
485
- hint. Mirrors `FormSwitch`'s prop shape (`value`, `onValueChange`/`onChange`, `label`, `hint`,
486
- `disabled`, `testID`, a11y) so it is a drop-in for boolean toggles that should read as checkboxes.
487
- Exposes `role="checkbox"` + `aria-checked` / `accessibilityState={{ checked }}`.
488
-
489
- ## 1.0.0
490
-
491
- Initial release. Extracted the proven duplicated form components from erevna-web ↔ katalogos-web
492
- (Capability Wave C1, batch 2).
493
-
494
- - `FormField`, `ChipSelector`, `FormSwitch` — share the `@dloizides/ui-feedback` UI context (`useUi`).
495
- - `FormActions` deferred (depends on a not-yet-shared `core/Button`).
1
+ # Changelog
2
+
3
+ ## 1.29.0
4
+
5
+ FINREG-BRAND-1 "Logo without its background and one palette from the logo": error and status TEXT reads `semanticText` when the theme provides it, readable in dark mode. Unchanged without it.
6
+
7
+ ## 1.28.2
8
+
9
+ INVOICE-FU-22 "To and Cc dropdown of saved people".
10
+
11
+ - A `SelectControl` without `menuAnchor` sets `aria-haspopup="menu"`, matching its `role=menu` popup; with `menuAnchor` it stays `"listbox"`.
12
+
13
+ ## 1.28.1
14
+
15
+ INVOICE-FU-22 "To and Cc dropdown of saved people".
16
+
17
+ - Every `SelectControl` trigger sets `aria-haspopup="listbox"`, which `useEscapeKey` in `ui-layout` reads to give Escape to the open menu.
18
+
19
+ ## 1.28.0
20
+
21
+ INVOICE-FU-22 "To and Cc dropdown of saved people", D-FU22-5 "Review findings are fixed in the packages".
22
+
23
+ - `SelectControl` gains `menuAnchor` (`listboxLabel`, `anchorRef`): the menu stays on screen, focus stays on the trigger, arrows, Enter and Space work from it, and the trigger is a combobox with `aria-activedescendant`. Callers without it are unchanged.
24
+ - `AnchoredMenu` gains `placement`; `AnchoredMenuListbox.highlightedValue` is optional.
25
+ - `nextHighlight` is exported.
26
+
27
+ ## 1.27.0
28
+
29
+ DATE-INPUT-1 "Every date or date-time field uses the shared input".
30
+
31
+ - New `DateField` (`YYYY-MM-DD`) and `DateTimeField` (`YYYY-MM-DDTHH:mm`), rendered through `Field`; a real `<input type>` on web.
32
+
33
+ ## 1.26.0
34
+
35
+ INVOICE-3 "Invoice interface over a user-chosen folder": owner picks.
36
+
37
+ - `SelectControl` trigger fills with `surfaceElevated`, like an editable field, so it differs from read-only.
38
+ - Read-only `useThemedInput` draws the rest border, so the box shows on a form of the same fill.
39
+ - Placeholder is solid `textSecondary`: 0.6 alpha measured 2.38 against the 4.5 AA floor.
40
+ - `FormField` gains `inputRef`.
41
+
42
+ ## 1.25.0
43
+
44
+ INVOICE-3 "Invoice interface over a user-chosen folder": extracted from invoice-web.
45
+
46
+ - New `SelectField`: `Field` + `SelectControl`, its accessible name carries the selection.
47
+
48
+ ## 1.24.0
49
+
50
+ BEAD-3 "Report form: searchable pattern field": review fix.
51
+
52
+ - New `useKeepInView(trigger)`, moved from Jinx: scrolls the returned view into sight each time `trigger` takes a new value, as far as needed and no further. Web only; a no-op on native.
53
+
54
+ ## 1.23.0
55
+
56
+ BEAD-3 "Report form: searchable pattern field and shared form feedback".
57
+
58
+ - `TypeaheadControl` takes `search` instead of `options` for async results: `load(query, signal)`, `onPick(option | null)`, loading, empty and error text, 250 ms debounce, stale responses ignored, editing after a pick clears it.
59
+ - `TypeaheadControl` is a WAI-ARIA combobox in both modes: Down, Up, Enter, Esc, `aria-activedescendant`, a ref to its input. Its rows change role from `menuitem` to `option`; testIDs are unchanged.
60
+ - `ControlOption` gains an optional `detail`, shown under the title on a phone and beside it from 768 px.
61
+ - `AnchoredMenu` fits its height above the on-screen keyboard through `visualViewport`; new `listbox` prop for listbox roles and a status line.
62
+ - New `FormStatusLine` and `useFocusFirstInvalid`.
63
+
64
+ ## 1.22.0
65
+
66
+ KEFI-EDITOR-UI-2 "Extract stepper and upload-with-link field to @dloizides/ui-forms", extracted from kefi-web.
67
+
68
+ - New `StepperTabs`, `StepperNav` and pure `resolveStepNeighbours`: step tabs sharing the row width, back and next under the step. Generic over the step key; every string is a prop.
69
+ - New `UploadWithLinkField`: preview, an upload control slot and a link input revealed on request. The slot keeps ui-forms free of ui-media; pass `ImagePickerButton`.
70
+
71
+ ## 1.20.0
72
+
73
+ **Horizontal form fields line up (D-ALL-22 "Horizontal form fields are aligned").**
74
+
75
+ - `FormGrid` rows set `alignItems: flex-start`: every cell starts on one top edge and a tall cell (hint, error) no longer stretches its neighbours.
76
+ - New `AlignToControl`: an aria-hidden label line with the same font and spacing model as `Field`, so a button beside labelled fields sits on the input line, not the label line. `FormCell alignToControl` applies it to a cell.
77
+ - New `InlineFieldRow` (extracted from kefi-web): a field and its action stacked below `inlineMinWidth` (default 1024) and on one row above it, the action placed by `AlignToControl` instead of a hand-measured offset.
78
+
79
+ ## 1.18.7
80
+
81
+ - Focused inputs draw the fleet focus ring (`@dloizides/design-tokens` 1.14 `FOCUS_RING`: 2 px solid outline, 2 px offset, contrast-checked colour; error colour when errored) instead of the 3 px 16% box-shadow halo (FOCUS-RING-1 "One focus ring across the shared kit").
82
+
83
+ ## 1.18.6
84
+
85
+ **ChipSelector: a short chip (e.g. "All") is at least 44 px wide, not only 44 px tall (KEFI-FIT-1 "kefi-web fit and hit-box fixes").**
86
+
87
+ `chip` and `chipOutline` get `minWidth: 44` next to the existing `minHeight: 44`; measured 42x44 on kefi-web approvals at 360.
88
+
89
+ ## 1.18.3
90
+
91
+ **FormCheckbox: the hint/description is now announced by screen readers.**
92
+
93
+ The hint Text gets a stable per-instance id (`useFieldIds().hintId`, as `Field` does) and the role=checkbox
94
+ Pressable sets `aria-describedby` to it when a hint is present; with no hint the attribute is omitted.
95
+
96
+ ## 1.18.2
97
+
98
+ **FormSwitch: the switch now sits in a 44x44 (MIN_TOUCH_TARGET_PX) pressable slot on web.**
99
+
100
+ Visual QA on kefi-web Site settings (360 and 1280) measured the switch at 40x20: react-native-web sizes the
101
+ native input to the Switch root, and `hitSlop` is inert on web. The switch is now centred in a slot with
102
+ `minWidth`/`minHeight` MIN_TOUCH_TARGET_PX inside the pressable row, so the row stays at least 44 tall even when a
103
+ `containerStyle` overrides `minHeight`. The track and thumb are unchanged; the switch gains a few px of horizontal gutter.
104
+ New testID: `<testID>-hitbox`.
105
+
106
+ ## 1.17.0
107
+
108
+ **Chips now have a 44px minimum touch target on web. `hitSlop` never did that — it is native-only.**
109
+
110
+ `CHIP_HIT_SLOP` was documented as expanding the chip's touch area toward the WCAG ≥44px floor
111
+ "without changing the rendered pill size". Measured in headless Chromium at 360x640 on 2026-09-21:
112
+ a chip's box is 33px tall (`paddingVertical: 6`), and `document.elementFromPoint(68, 35)` — 5px
113
+ above a top edge at y=40, inside `CHIP_HIT_SLOP.top: 10` — returns the PARENT element, not the
114
+ chip. react-native-web 0.21.2 references `hitSlop` only inside the legacy `Touchable` mixin's
115
+ press-RETENTION path (after the responder is already granted) and not at all in `Pressable`, so on
116
+ web the rendered box is the entire tappable area. The chips were a 33px target in all seven portals.
117
+
118
+ - `chipStyles.chip` and `chipStyles.chipOutline` gain `minHeight: 44` + `justifyContent: 'center'`.
119
+ Chip width is unchanged (56.7px and 68px before and after for the same labels), so wrapping and
120
+ `CHIP_GUTTER` spacing are untouched; a chip row grows 33px → 44px tall.
121
+ - `CHIP_HIT_SLOP` is kept and still helps iOS/Android. Its doc comment now states the web result
122
+ instead of claiming one.
123
+ - Consumers with a dense chip strip should re-check row spacing: the pill itself is taller now.
124
+
125
+ ## 1.15.0
126
+
127
+ **`FormSwitch` now emits `aria-checked` / `aria-disabled` on web; `ChipSelector` gained an option icon slot and opt-in radio semantics.**
128
+
129
+ `FormSwitch` (A11Y-ARIA-CHECKED-1): react-native-web 0.21 emits nothing from `accessibilityState` on web, so the
130
+ switch wrapper rendered `role="switch"` with no `aria-checked` - an invalid switch that announced no state. The
131
+ state is now passed as literal `aria-checked` (always) and `aria-disabled` (only when disabled) web props;
132
+ `accessibilityState` also carries `disabled` for native.
133
+
134
+ `ChipSelector`:
135
+ - `ChipOption.icon?: React.ReactNode` - rendered before the label inside the chip, wrapped `aria-hidden`. Options
136
+ without an icon render the exact same tree as before.
137
+ - `singleSelectRole?: 'button' | 'radio'` (type `ChipSingleSelectRole`). Default `button` = unchanged. With
138
+ `radio` and `multiple` unset, the group is `role="radiogroup"` and each chip `role="radio"` + `aria-checked`.
139
+ Ignored for multi-select. Trade-off: RN-web renders a radio chip as a `<div>`, which activates on Enter but not
140
+ Space and has no arrow-key roving focus.
141
+
142
+ **Additive and backward-compatible.** No prop set = identical DOM for every existing consumer.
143
+
144
+ ## 1.14.0
145
+
146
+ **`FormField` gained an opt-in `recentKey` — remember the last N submitted values and offer them on focus.**
147
+
148
+ A search / filter / lookup box that the user retypes the same handful of values into now gets a
149
+ "recent values" dropdown for free. Set `recentKey="<namespace>"` on a `FormField` and the values it
150
+ submits are remembered (per key) and surfaced in a menu on focus; picking one fills the input. A
151
+ value is recorded on submit (Enter) **and** on blur-with-content, so both "hit enter" and "typed then
152
+ moved on" are captured. The dropdown reuses the kit's `AnchoredMenu` (portalled to `document.body`, so
153
+ it is never painted behind a table / card / the next field) with full a11y (menu name, per-row label +
154
+ hint + role).
155
+
156
+ Persistence is `localStorage` under `@dloizides/ui-forms:recent:<recentKey>`; the list de-dupes
157
+ case-insensitively, promotes a repeat to the front, and caps at `recentMax` (default 10). On native /
158
+ SSR / when storage is disabled it is a silent no-op (recents are always `[]`), and every storage
159
+ access is wrapped so a quota or privacy-mode failure can never throw into render.
160
+
161
+ **Additive and backward-compatible.** Leave `recentKey` unset — the default — and the field behaves
162
+ exactly as before: nothing rendered, no state/refs/effects, no storage touched. NEVER set it on a
163
+ password / secure field. The engine is also exported standalone as `useRecentValues(key, max?)` for
164
+ bespoke recents surfaces, and `AnchoredMenu` gained an optional `accessibilityLabel` for naming the menu.
165
+
166
+ ## 1.13.3
167
+
168
+ **Placeholder text was too dark — it read like an already-filled value.**
169
+
170
+ `useThemedInput` painted the placeholder with the theme's `textSecondary` — a deliberately
171
+ dark, accessible grey (design-tokens UX-11) that also renders readable secondary *copy*. At
172
+ full strength a placeholder (e.g. `follower` in a "Dance role" box) was hard to tell apart
173
+ from entered text. It is now `textSecondary` composited toward the field background at 0.6
174
+ alpha, so a hint reads clearly lighter than the solid entered text (`colors.text`) while
175
+ keeping the theme hue — and it works in dark mode too (it composites toward whatever the
176
+ field background is). The field's visible label still carries the accessible name, so this
177
+ is a usability win, not an a11y regression. Affects every `@dloizides/ui-forms`-driven input
178
+ (`FormField`, `Field`, `ThemedTextInput`, the `ui-tables` `Filters` search box) across all
179
+ seven portals.
180
+
181
+ ## 1.12.0
182
+
183
+ **`FormField` gained `labelHidden` — hide the visible label, keep the accessible name.**
184
+
185
+ A field whose placeholder already names it (a toolbar search box, an inline filter) does
186
+ not want a stacked visible label: the label wastes a row and, worse, pushes the input a
187
+ label-row lower than a bare button beside it, so the two misalign. Until now the only way
188
+ to drop the visible label was to blank `label` — which ALSO blanked the input's
189
+ `accessibilityLabel`, silently stripping the accessible name.
190
+
191
+ `labelHidden` removes ONLY the visible `<label>` row: `label` stays required and the input
192
+ keeps `accessibilityLabel={label}`, so a screen reader reads the same name and the field
193
+ still resolves by role + name. Additive and backward-compatible — default `false`, every
194
+ existing call renders unchanged.
195
+
196
+ ## 1.11.1
197
+
198
+ **`ThemedTextInput` shipped no metrics, so every direct caller got a raw 19px input.**
199
+
200
+ It documented itself as "the ONE source of truth for the input look" while shipping
201
+ only **colours** — no border, radius, padding or height. `FormField` quietly passed its
202
+ own private duplicate of those metrics, so anything reached *through* `FormField` looked
203
+ correct and the gap was invisible. Every **direct** caller — the documented, blessed
204
+ usage — got a raw browser input.
205
+
206
+ Measured live in the Digital Kin CMS before: **10/10 inputs below the 48px floor**, text
207
+ inputs 19px, textareas 38px. After: **0/10**, at 48/96px.
208
+
209
+ **Label association was absent entirely** (0 `label[for]`, 0 ids). Two defects only a
210
+ real browser could find, both fixed here:
211
+
212
+ - **`htmlFor` is silently dropped by react-native-web** — it is not on the prop
213
+ allowlist, the same family as the dropped `accessibilityHint`. A prop-level assertion
214
+ passes against the broken build; only a DOM-level test catches it, so that is what the
215
+ new tests assert.
216
+ - **Dangling `for`.** `Field` assumed render-function children place the id they are
217
+ handed, but `SelectControl` uses `aria-labelledby` instead — so the difficulty label
218
+ shipped `for="field-control-3"` pointing at **nothing**, passing every structural check
219
+ while focusing no field. `useHtmlFor` now sets `for` only when the target is genuinely
220
+ in the document.
221
+
222
+ > ⚠️ **Cross-fleet visual change.** `controlStyles.input` gaining `minHeight: 48` lifts
223
+ > dense filter inputs and select triggers in `aml-v2`/`agora-web` from ~38-41px to 48px.
224
+ > This cannot be avoided: the input floor is what fixes the 19px defect, and nothing
225
+ > fixes that without also lifting inputs that already had padding. Owner-approved.
226
+
227
+
228
+ ## 1.9.0
229
+
230
+ **Campaign F3 — `Field`'s spacing model, and the layout primitives.** `Field` hard-coded a 16px
231
+ bottom margin on its container. That is the pre-flexbox model — the CHILD owns the space after
232
+ itself — and in a `gap`-laid-out parent, which is how every modern form row in this fleet is
233
+ written, the margin STACKS on the parent's gap. So consumers cancelled it by hand: **16
234
+ `containerStyle={{ marginBottom: 0 }}` sites across the fleet**, 13 of them in aml-v2, each with an
235
+ apologetic comment. AML v1 got this right in CSS years ago (`.ui-field { display: flex;
236
+ flex-direction: column; gap: 6px; }`) and wrote the contract down in `shared/FORMS.md`.
237
+
238
+ **This release moves NO pixels for any existing consumer.** The fix is opt-in, not a 2.0.0 — see
239
+ "Why not a major bump" below.
240
+
241
+ - **Add `FormGrid` + `FormCell`** — the wrapping form row, extracted from the copy the fleet
242
+ re-declares verbatim (`{ flexDirection: 'row', flexWrap: 'wrap', gap: 12 }` +
243
+ `{ minWidth: 220, flexGrow: 1, flexBasis: 260 }`), with the min-width/basis parameterised. Cell
244
+ metrics live on the GRID, so the common call site is a bare `<FormCell>` and only the genuine
245
+ one-offs (`<FormCell basis={160} grow={false} minWidth={140}>`) carry props.
246
+ - **Add `FormSection`** — the fieldset/legend grouping only v1 had. react-native-web has no
247
+ `fieldset` mapping, so this is the ARIA equivalent: `role="group"` + `aria-labelledby` pointing
248
+ at the legend. The legend reuses `resolveLabelVariantStyle` — the SAME function `Field` uses — so
249
+ a section heading cannot drift into a third label voice.
250
+ - **Add `Field.spacing` (`'stack' | 'gap'`)** — the two spacing models. `stack` is the historical
251
+ 16px margin + 4px child margins, byte-identical to 1.8.0, and remains the default. `gap` is the
252
+ FORMS.md contract: no bottom margin, one uniform 6px internal gap, parent owns the rhythm.
253
+ - **`Field` inside a `FormGrid` or `FormSection` resolves to `gap` automatically.** Adopting the
254
+ shared grid IS the opt-in: a consumer deletes its hand-rolled `grid`/`field` styles AND its
255
+ `marginBottom: 0` cancel in the same edit. An explicit `spacing` prop beats the context in both
256
+ directions.
257
+ - **`ChipSelector`**: the chip row now spaces with `gap: 8` instead of per-chip margins plus a
258
+ compensating `marginBottom: -8`. Rendered box is byte-identical. Also gains a `spacing`
259
+ passthrough, and `containerStyle` widens to `StyleProp<ViewStyle>` to match `Field`'s.
260
+
261
+ ### Why not a major bump
262
+
263
+ The brief for this work allowed a breaking 2.0.0. It was rejected. Switching every `Field` to the
264
+ gap model in one publish moves pixels on every form in seven portals simultaneously — which is
265
+ precisely the change you cannot visually QA, because no app remains on the old behaviour to compare
266
+ against, and a regression surfaces as "some form somewhere looks slightly wrong" with seven
267
+ suspects. The context-aware opt-in gives the identical end state via a per-app rollout, each step
268
+ behind visual QA, with `git revert` scoped to one app. The cost is that both models live in the
269
+ code until the fleet has migrated; that is a smaller price than an un-QA-able fleet-wide pixel
270
+ change.
271
+
272
+ ### Correction to the campaign premise
273
+
274
+ `ChipSelector`'s `marginBottom: -CHIP_GUTTER` was documented — and briefed — as compensation for
275
+ `Field`'s 16px margin, load-bearing enough that changing one without the other would break chip
276
+ spacing in 7+ sites. **That was wrong.** The -8 cancelled the chips' OWN bottom gutter hanging off
277
+ the last wrapped row; it behaved identically whatever `Field` contributed. It has been replaced with
278
+ `gap` regardless, because a margin/negative-margin pair is fragile and leaks a negative margin onto
279
+ the block's box. `fieldSpacing.test.tsx` now pins `Field` and `ChipSelector` to the same box in both
280
+ models, so the relationship is checkable rather than folkloric.
281
+
282
+
283
+ ## 1.8.0
284
+
285
+ **Campaign F2 — the dense CONTROLS arrive.** `@dloizides/ui-tables` shipped a complete, themed,
286
+ a11y-wired set of form controls inside its `Filters` bar and exported NONE of them: its
287
+ `src/index.ts` exposed only `Filters`, `useFilterDraft`, `suggestOptions`, `isUnmatched` and
288
+ types. Six portals could SEE those controls working and none could import them, so the fleet
289
+ reimplemented them — **6 independent select implementations, 5 date fields, 2 typeaheads**. Same
290
+ shape as `MultiTenancy.EntityFrameworkCore` shipping no EF Core. This release makes them public.
291
+
292
+ Nothing here moves a pixel for an existing consumer: the metrics are the promoted originals,
293
+ unchanged. `CONTAINER_MARGIN_BOTTOM` and `ChipSelector`'s compensating `marginBottom:
294
+ -CHIP_GUTTER` remain deliberately untouched.
295
+
296
+ - **Add `SelectControl`** — single-select enum/status dropdown. Bordered trigger + chevron opening
297
+ the shared `AnchoredMenu`.
298
+ - **Add `TypeaheadControl`** — search-as-you-type combobox (aml-v2's CountryPicker, generalized).
299
+ Free typing is preserved (the value is raw text the caller normalises at query time); picking a
300
+ suggestion fills the canonical LABEL, not the value.
301
+ - **Add `DateRangeControl`** — inclusive from/to pair. Editing one side patches ONLY that side.
302
+ - **Add `AnchoredMenu`** — the floating option list both of the above compose. Kept in-tree with
303
+ NO `ui-layout` dependency; that was a considered choice in `ui-tables` and it still holds, since
304
+ depending on the higher-level `ModalDropdown` would invert the graph for every consumer.
305
+ - **Add `controlStyles`** — the tuned metrics, promoted verbatim. `ui-tables`' `Filters/styles.ts`
306
+ said the quiet part out loud in its own header: it "reconcile[d] the per-field styles that were
307
+ copy-pasted across aml-v2's filter files into one shared source" — and then locked the
308
+ reconciliation inside one bar where no other surface could reach it.
309
+ - **Add `suggestOptions` / `isUnmatched`** — the ranked substring matcher behind the typeahead.
310
+ - **Add `ControlOption` / `DateRangeValue`** types. `ui-tables` now ALIASES its long-standing
311
+ public `FilterOption` / `DateRangeValue` onto these, so there is one definition rather than two
312
+ structurally-compatible twins free to drift.
313
+
314
+ ### The controls are LABEL-FREE, on purpose
315
+
316
+ They render the control only. Compose them inside `Field` — with `labelVariant="control"` on a
317
+ dense surface — to get the label, hint and error slots. That is what retires `ui-tables`' private
318
+ `FieldShell` fork (see `@dloizides/ui-tables` 1.14.0) and leaves ONE label implementation for
319
+ every control instead of one per control.
320
+
321
+ ### i18n: this package still never calls `t`
322
+
323
+ Every string — `accessibilityLabel`, `placeholder`, `optionHint`, `error`, `fromLabel`/`toLabel`
324
+ — is a PRE-LOCALIZED prop. This is load-bearing, not stylistic: aml-v2 localizes through
325
+ `@dloizides/i18n` with positional `{0}` while the other six portals use i18next `{{p1}}`, so a
326
+ component that localized internally could not serve both. `SelectControl`'s `accessibilityLabel`
327
+ is therefore composed BY THE CALLER — it must carry the selection ("Status: Active", not
328
+ "Status"), and building that string needs a `t` call this package must not make.
329
+
330
+ ### Fixed — a WCAG defect carried in by the promoted code
331
+
332
+ `AnchoredMenu` marked the current option with `accessibilityState={{ selected }}` alone.
333
+ **react-native-web does not read `accessibilityState` at all** (verified against
334
+ `react-native-web@0.21`'s `createDOMProps`, which enumerates `aria-selected` /
335
+ `accessibilitySelected` and never `accessibilityState`), so on web the selected option was
336
+ distinguished by colour and font-weight ONLY — no screen reader could tell which option was
337
+ current (WCAG 1.4.1, use of colour). `aria-selected` is now passed alongside, so each platform
338
+ gets the channel it honours. The trigger already paired `aria-expanded` with `accessibilityState`;
339
+ the option row was simply missed when that was done. A test asserts it, and that test FAILED
340
+ before the fix.
341
+
342
+ ## 1.7.0
343
+
344
+ Additive wave implementing the shared cross-stack forms contract now written down at
345
+ `PROOViD/AMLService/AMLService/wwwroot/shared/FORMS.md`. **Nothing in this release moves a pixel
346
+ for an existing consumer**: every addition is opt-in and every default is the previous behaviour.
347
+ `CONTAINER_MARGIN_BOTTOM` and `ChipSelector`'s compensating `marginBottom: -CHIP_GUTTER` are
348
+ deliberately untouched — they are load-bearing and move together in a later, visual-QA-gated wave.
349
+
350
+ - **Add `FormActions` — the submit/cancel row.** Promoted from the BYTE-IDENTICAL
351
+ `erevna-web/src/components/Forms/FormActions.tsx` and `katalogos-web/.../FormActions.tsx`
352
+ (68 lines each; `diff` returns nothing). All seven portals hand-roll this row; aml-v2, agora,
353
+ kefi, ichnos and zygos each inline their own variant. The primary action is LAST in DOM order so
354
+ tab reaches Cancel before Save, and `saving` drives the primary button's spinner rather than
355
+ disabling-and-relabelling it. `saveDisabled` blocks Save WITHOUT blocking Cancel — an invalid
356
+ form stays escapable. testIDs default to the twins' `save-button` / `cancel-button`, so existing
357
+ Playwright selectors keep matching.
358
+ - **`Field` gains `hint`.** ~21 hand-rolled copies of `{fontSize:12, marginTop:4, color:
359
+ textSecondary}` exist across the fleet; aml-v2 alone declares a local `hint` style in 8 files.
360
+ Because `Field` had no hint slot, consumers rendered the hint as a SIBLING, where it lands past
361
+ the container's 16px bottom margin and detaches from the control it explains (see the apologetic
362
+ comment in `aml-v2/src/screens/screening/CoverageSelector.tsx`). The hint renders UNDER the
363
+ control and ABOVE the error, and hint and error COEXIST — both are reachable from the control via
364
+ a composed `aria-describedby` (hint id then error id, in reading order). Only the error is a
365
+ `role="alert"` live region; a hint that announced itself would interrupt on every focus.
366
+ - **`Field` gains `optional` + `optionalLabel`.** Mutually exclusive with `required`; when a caller
367
+ sets both, `required` WINS — the safe direction, since an under-marked required field sends the
368
+ user into a failed submit. Enforced at runtime in `resolveFieldMarker` rather than in the type
369
+ system, so a caller spreading a computed props object still gets a defined single-marker result
370
+ instead of a compile error it cannot act on. Like the asterisk, the optional text is decorative
371
+ (`aria-hidden`) — "optional" is the ABSENCE of `aria-required`, which assistive tech already
372
+ conveys.
373
+ - **`Field` gains `labelVariant` (+ `labelStyle` as the escape hatch).** `Field` hard-coded
374
+ 13/600/sentence-case, which is exactly why kefi-web refused it and why `@dloizides/ui-tables`'
375
+ private `FieldShell` forked to 11/700/uppercase. `labelVariant` makes the contract's TWO
376
+ legitimate voices first-class and named: `field` (13/600 sentence case — a label that is READ)
377
+ and `control` (11/700 UPPERCASE + letter-spacing — a label that is SCANNED, for dense filter bars
378
+ and toolbars). An absent variant resolves to `field`, so every existing consumer renders
379
+ byte-identically. `labelStyle` applies AFTER the variant for the genuine one-off.
380
+ - **`Field`'s `containerStyle` widens `ViewStyle` -> `StyleProp<ViewStyle>`.** The narrow type was a
381
+ documented pain: `aml-v2/src/screens/leaders/CountryPicker.tsx` has to build a COMPLETE style per
382
+ variant because it cannot compose an array.
383
+ - **`useThemedInput`: a focused errored field now keeps a RED focus ring.** It previously computed
384
+ `isFocused && !hasError`, so an errored field got NO focus ring at all — removing the focus
385
+ indicator (WCAG 2.4.7) from precisely the field the user was sent back to fix, at the moment they
386
+ are most likely navigating by keyboard. It now always rings on focus and only changes the ring's
387
+ COLOUR, matching v1's `input.invalid:focus { box-shadow: 0 0 0 3px var(--danger-tint) }`.
388
+ One pre-existing test necessarily changed: it asserted `boxShadow === 'none'` for this state,
389
+ i.e. it encoded the defect as intended behaviour.
390
+ - **New peer dependency `@dloizides/ui-buttons >= 1.4.0`**, required by `FormActions` so the estate
391
+ keeps exactly one button implementation rather than forking one here.
392
+ - No i18n runtime is introduced: all user-visible copy (`saveLabel`, `cancelLabel`, `optionalLabel`,
393
+ `hint`, `error`) arrives pre-localized. aml-v2 localizes via `@dloizides/i18n` with positional
394
+ `{0}` params while the other six apps use i18next `{{p1}}`, and nothing bridges them, so a
395
+ component that localized internally could not serve both.
396
+ - Also shipping in this tarball, from a CONCURRENT workstream (commit `13bd281`, not part of this
397
+ wave): `ChipSelector` gains `chipTestIDPrefix`, `optionAccessibilityHint` and `multiple`
398
+ toggle semantics, and reads its on-primary ink from the theme's `onBrand` scale instead of a
399
+ hardcoded `#fff`. All opt-in; the `chip-selector-chip-<value>` testID default is frozen.
400
+
401
+ ## 1.6.0
402
+
403
+ - **`ChipSelector` now composes `Field` internally — its label was drifting.** It rendered its OWN
404
+ `<Text>` label whose metrics differed from `Field`'s on three of four axes: `marginBottom: 8`
405
+ (vs 4), NO `fontSize` at all so it fell back to RN's ~14 (vs 13), and `colors.text`
406
+ (vs `textSecondary`). A `ChipSelector` next to a `FormField` in a row/grid therefore started a
407
+ different distance down the column and read as a different weight of text. Found at 4 sites in
408
+ aml-v2 (`TenantWatchlistsEditor`, `CoverageSelector`, `CustomCoverageFields`,
409
+ `AdvancedMatching`); fixing it in the package fixes every consumer with zero app churn.
410
+ The local label styles are deleted — there is now exactly one label implementation in the kit.
411
+ - **`ChipSelectorProps` is unchanged and fully backward-compatible** — every existing prop keeps
412
+ its name, type and default, and `label` stays OPTIONAL. With no label (or an empty one) NO label
413
+ row is rendered, so composing `Field` cannot introduce a phantom gap above the chips.
414
+ - **`ChipSelector` gains `required`, `error` and `testID`** (all optional, all additive) now that
415
+ `Field` provides them for free. `error` renders the same `role="alert"` line as `FormField` and
416
+ is tied to the chip group via `aria-describedby` + `aria-invalid` (web only; no-op on native).
417
+ - **Spacing:** a `ChipSelector` now carries `Field`'s `marginBottom: 16` like every other field
418
+ (it previously had none). The chips' own 8px trailing gutter is cancelled on the group so the
419
+ block's total bottom spacing is exactly 16 — the same as a `FormField`, not 24. Pass
420
+ `containerStyle` to override, as before.
421
+ - **`Field`'s `label` is now optional** (widened from `label: string`, so existing callers are
422
+ unaffected). An absent or empty label renders no label row, letting a control whose label lives
423
+ elsewhere still use the shared shell for its error line and spacing.
424
+ - `FormSwitch` / `FormCheckbox` are deliberately NOT changed — see `src/labelRoles.test.tsx`.
425
+ Their labels are INLINE control labels (beside the control in a row, the row's primary text),
426
+ not field headers stacked above a control, so they have no alignment defect to fix and `Field`'s
427
+ smaller/dimmer header treatment would be a regression. They were already identical to each
428
+ other; a new test now enforces that they stay so.
429
+
430
+ ## 1.5.0
431
+
432
+ - **Add `Field` — the generic label-over-control wrapper.** `FormField` is hard-wired to a text
433
+ input (`FormFieldProps extends Omit<TextInputProps,'style'>`), so any NON-text control (a
434
+ dropdown, a date picker, a chip selector) had no shared way to get a label — and ended up
435
+ visually misaligned next to its `FormField` siblings: the control's box started ~21px higher
436
+ (no label row) and it missed `FormField`'s `marginBottom: 16`, so wrapped rows lost their
437
+ vertical rhythm. This was hand-rolled in 5 places across zygos-web and aml-v2.
438
+ `Field` takes `{ label, required?, error?, children, containerStyle?, testID? }` and renders the
439
+ same label row / required mark / error line / spacing.
440
+ - **`FormField` now composes `Field` internally**, so the two can never drift apart — the metrics
441
+ live in exactly one place. `FormFieldProps` and every rendered attribute (`form-field-input`
442
+ testID, `aria-invalid` / `aria-describedby` / `aria-required`, the `role="alert"` error line)
443
+ are unchanged: fully backward-compatible.
444
+ - `Field`'s `children` may be a plain node (the common case) or a render function receiving
445
+ `{ describedById, hasError }`, so a custom control can wire the error line into its own
446
+ `aria-describedby` / invalid state exactly the way `FormField` does.
447
+
448
+ ## 1.4.0
449
+
450
+ - **Accessibility (WCAG 2.1 AA) hardening — additive + backward-compatible.**
451
+ - `FormField`: the error message is now programmatically tied to the input — the input gets
452
+ `aria-invalid` when errored and `aria-describedby` pointing at the error line (which is a
453
+ `role="alert"` live region), and `aria-required` when `required`. The required `*` is marked
454
+ decorative (`aria-hidden` / `accessibilityElementsHidden`) so a screen reader hears "required"
455
+ (via `aria-required`) instead of "star".
456
+ - `ThemedTextInput`: new optional `describedById` + `requiredField` props forward
457
+ `aria-describedby` / `aria-required`, and it emits `aria-invalid` from `hasError` (web only;
458
+ no-ops on native). Existing callers are unaffected.
459
+ - `FormCheckbox`: now keyboard-operable — the `role="checkbox"` Pressable renders a `<div>`
460
+ (no free Enter/Space), so an explicit web-only Enter/Space handler toggles it (WCAG 2.1.1).
461
+ - `ChipSelector`: chips gain a `hitSlop` so the touch target reaches ~44px WITHOUT changing the
462
+ rendered pill size, and expose `accessibilityState.disabled` when the selector is disabled.
463
+ - `useThemedInput`: the focus/hover CSS transition now collapses to instant when the user
464
+ requests `prefers-reduced-motion: reduce` (WCAG 2.3.3, web only).
465
+
466
+ ## 1.3.0
467
+
468
+ - `ChipSelector` gains a `variant` prop (`'solid' | 'outline'`, default `'solid'`). `solid` is the
469
+ original filled-pill look (selected = solid brand fill, white ink) — existing consumers
470
+ (erevna / katalogos / kefi) render **identically**, no change. `outline` is the AML v1 console
471
+ look: an outlined pill on a muted fill where the **selected** state is a subtle tinted-outline
472
+ (brand border + brand ink + a low-alpha brand wash), NOT a solid fill; on web, hover lifts the
473
+ border + ink to the brand colour. Fully theme-driven (brand colour + alpha, border/text from the
474
+ theme), so it re-themes per tenant. Additive + backward-compatible.
475
+
476
+ ## 1.2.0
477
+
478
+ - Add `ThemedTextInput` + `useThemedInput` — the shared "readable + lively" text-input treatment,
479
+ driven entirely by the active theme (re-themes per tenant, no hard-coded hex). At rest: dark
480
+ readable text on a subtle off-white surface with a soft border. On hover (web): the border
481
+ strengthens a touch. On focus: the border becomes the brand primary, the background brightens to
482
+ the plain surface (white), and a soft 3px brand-tinted focus ring fades in. The animation is a
483
+ pure GPU-cheap CSS transition on `border-color`/`background-color`/`box-shadow` (the ring is a
484
+ `box-shadow`, so no layout/reflow) — NO `Animated`/`LayoutAnimation`/JS timers. Web-only style
485
+ keys and the mouse-hover handlers are guarded behind `Platform.OS === 'web'`, so it stays
486
+ native-safe (native applies the state-driven colours instantly).
487
+ - `FormField` now renders `ThemedTextInput`, so every field gets the treatment for free; its label
488
+ uses `textSecondary` at 13px/600 for readability. Props/behaviour (label, hint, error, testID,
489
+ a11y, `onFocus`/`onBlur` pass-through) are backward-compatible.
490
+
491
+ ## 1.1.0
492
+
493
+ - Add `FormCheckbox` — a native-safe (`Pressable`-based, RN-web + native) themed checkbox: a rounded
494
+ square that fills with the brand colour and shows a check glyph when on, with a label and optional
495
+ hint. Mirrors `FormSwitch`'s prop shape (`value`, `onValueChange`/`onChange`, `label`, `hint`,
496
+ `disabled`, `testID`, a11y) so it is a drop-in for boolean toggles that should read as checkboxes.
497
+ Exposes `role="checkbox"` + `aria-checked` / `accessibilityState={{ checked }}`.
498
+
499
+ ## 1.0.0
500
+
501
+ Initial release. Extracted the proven duplicated form components from erevna-web ↔ katalogos-web
502
+ (Capability Wave C1, batch 2).
503
+
504
+ - `FormField`, `ChipSelector`, `FormSwitch` — share the `@dloizides/ui-feedback` UI context (`useUi`).
505
+ - `FormActions` deferred (depends on a not-yet-shared `core/Button`).