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