@dloizides/ui-layout 1.11.0 → 1.12.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,228 +1,251 @@
1
- # Changelog
2
-
3
- ## 1.11.0
4
-
5
- - **Fix (HIGH — 1.10.0's out-of-view close never fired in the real runtime).** 1.10.0 added
6
- "close the menu once the trigger leaves the viewport". Repositioning worked, but the close was
7
- measured **against the viewport**, and **RN-web apps never scroll the document** — every screen
8
- renders inside a `ScrollView`, so scrolling happens in an inner `<div>` and `window.scrollY`
9
- stays 0 forever. A trigger scrolled out of that inner scroller is invisible to the user while its
10
- rect sits comfortably inside the viewport, so the check could not fire on any screen of any
11
- portal. Measured in Chrome: trigger at `top: -37` (fully above the scroller), menu still rendered.
12
- Visibility is now measured against the **clip window** — the viewport intersected with every
13
- clipping ancestor — which is what makes it work inside an inner scroll container.
14
- - **Fix: "entirely out of view" was also the wrong threshold.** When a scroll container reaches the
15
- end of its range the trigger stops with a few pixels still showing (4px in the reported case), so
16
- "fully out" was *unreachable* and the menu never closed however far the user scrolled. There is
17
- now a minimum-visible-pixel floor (`MIN_VISIBLE_PX`).
18
- - **Guard: the menu never closes on its FIRST measurement**, so opening a dropdown whose trigger is
19
- already partly clipped still works; only movement after opening can close it.
20
- - **The zero-area "not laid out yet" guard is unchanged in intent but now provably size-only** — it
21
- asks about the element's own box, never its position, so it cannot swallow a genuine hidden case.
22
- - **New: `LAYOUT_I18N`** — the manifest of every translation key this package resolves, mirroring
23
- `TABLE_I18N` / `FILTERS_I18N` from `@dloizides/ui-tables` so hosts can bind an existing
24
- missing-key guard to it with no new pattern. The kit is fallback-free, so a key a host forgets
25
- reaches users as a raw dotted name; hand-maintained key lists rot (one portal was found missing
26
- 26 kit keys, another had `common.accordionToggleHint` undefined while `Accordion` was mounted).
27
- Every `t(...)` call in the package now references the map, and the suite fails on a raw key
28
- literal or a stale entry — so the manifest cannot drift from the code.
29
- - **Fix: the 1.10.0 CHANGELOG entry was written in cp1252**, leaving the published file invalid
30
- UTF-8. Re-encoded.
31
- - **No breaking change.** `LAYOUT_I18N` is additive and the key strings are unchanged, so existing
32
- translation files keep working untouched.
33
-
34
- ## 1.10.0
35
-
36
- Two defects found by browser visual QA of the inline dropdown menu against a live app.
37
-
38
- - **Fix (HIGH, affects every consumer): the open inline menu detached from its trigger.** On web the
39
- menu is portalled to `document.body` with `position: fixed` at the trigger's measured rect.
40
- `fixed` is viewport-relative, so that coordinate is only valid until something moves the trigger.
41
- A `scroll`/`resize` listener on `window` was already in place (since 1.7.0) and does handle plain
42
- scrolling — but it left three real gaps:
43
- - **Layout changes that fire no scroll event at all** — an accordion above the trigger expanding,
44
- a sticky header resizing, a banner appearing, an async list rendering. The trigger moved, nothing
45
- scrolled, no listener fired, and the menu stayed behind. Now covered by a `ResizeObserver` on the
46
- anchor and on `document.body`.
47
- - **The trigger leaving the viewport.** Repositioning cannot help here — the menu just follows its
48
- trigger off-screen and hangs over unrelated content with nothing on screen explaining it. The
49
- menu now **closes** once the trigger is fully out of view.
50
- - **Layout thrash.** The handler ran a synchronous `getBoundingClientRect()` (a forced reflow) plus
51
- a React state update on *every* scroll event. Work is now coalesced into one
52
- `requestAnimationFrame` per frame.
53
- Scroll is now observed in the **capture** phase on `document` rather than `window`, so a scroll in
54
- any ancestor scroll container counts. Tracking moved into a dedicated `useAnchorTracking` hook.
55
- Native is unaffected (the popover is in-tree and moves with its anchor).
56
- - **Fix (a11y): `accessibilityHint` never reached a screen reader.** The prop is part of the public
57
- API and every caller passes one, but react-native-web does not map it — the trigger carried
58
- `aria-label` and `aria-expanded` and **no hint of any kind**, so the text was silently thrown away
59
- (older react-native-web versions additionally leaked it to the DOM, logging
60
- `React does not recognize the accessibilityHint prop on a DOM element`). On web the hint is now
61
- rendered into a visually-hidden node referenced by `aria-describedby` — the same wiring
62
- `@dloizides/ui-forms`' `Field` uses for its error line — and the RN-only prop is no longer passed
63
- on web at all. Native still receives `accessibilityHint` unchanged.
64
- - **No API change.** Both fixes are internal; every existing caller benefits without edits.
65
-
66
- ## 1.9.1
67
-
68
- - **Fix (keyboard a11y, affects every consumer): Enter CLOSED the inline menu instead of SELECTING
69
- the highlighted option.** The trigger keeps DOM focus while the menu is open, and react-native-web
70
- maps Enter on a focused Touchable to `onPress`. React dispatches that from its ROOT container
71
- listener — an ancestor of the trigger, but a *descendant* of `document` — so the menu's BUBBLING
72
- `document` keydown listener ran second: the trigger toggled the menu shut, React unmounted the
73
- popover, the effect cleanup removed the very listener the event was still travelling toward, and
74
- `document` never saw the Enter. Keyboard users could open a dropdown and arrow through it but
75
- could never CHOOSE with the keyboard (mouse selection was unaffected, which is why it went
76
- unnoticed).
77
- - **Fix:** the menu's key handler now runs in the **capture** phase and `stopPropagation`s the keys
78
- an open menu owns (↑/↓/Home/End/Enter/Escape), so it runs ahead of React's listener and the
79
- trigger cannot re-toggle behind it. Found while browser-verifying the AML v2 topbar dropdowns.
80
-
81
- ## 1.9.0
82
-
83
- - **`ModalDropdown`: `menuMinWidth` — a width FLOOR for the open inline menu (additive, optional).**
84
- The menu matches the TRIGGER's width, which is right for a full-width field but leaves a compact
85
- anchor (the 1.8.0 `renderTrigger` case: a locale pill, an avatar chip, an icon button) with a menu
86
- too narrow to read its own option labels — a 52px "EN ▾" pill produced a 52px menu whose rows were
87
- clipped to a dark strip. `menuMinWidth` floors it; a wider trigger still wins.
88
- - **Backward-compatible:** omitted, the width is the trigger's, exactly as before.
89
-
90
- ## 1.8.0
91
-
92
- - **`ModalDropdown`: `renderTrigger` — a custom ANCHOR slot (additive, optional).** The dropdown's
93
- default trigger is a bordered field box, which is wrong for a *menu* anchored to a compact chip
94
- (a locale pill, an avatar/user chip, an icon button). Callers can now supply
95
- `renderTrigger={({ label, isOpen }) => …}` and own the anchor's visuals entirely; the default box
96
- is then not rendered. The a11y wrapper stays with the dropdown — `role=button`, `aria-expanded`,
97
- the accessible label + hint, and the `testID` are still applied — so a custom trigger *cannot*
98
- drop the accessible contract, and the portalled, keyboard-navigable (↑/↓/Home/End/Enter/Escape),
99
- never-clipped menu comes along for free.
100
- - **`ModalDropdown`: `optionTestID` — custom per-option testIDs (additive, optional).** Options
101
- still default to `` `${testID}-option-${value}` ``; a caller turning an existing flat control into
102
- a dropdown can now keep its established selectors stable
103
- (`optionTestID={(code) => `lang-${code}`}`).
104
- - **Backward-compatible:** both props are optional and, when omitted, the render tree is unchanged —
105
- erevna / katalogos / kefi / agora are unaffected and need no markup changes.
106
-
107
- ## 1.7.1
108
-
109
- Fix: the modal-variant dismiss backdrop was a pressable WRAPPING the option buttons,
110
- producing invalid DOM on web ("<button> cannot contain a nested <button>") + a React
111
- console.error. The backdrop is now an absolute-fill SIBLING behind the dialog — same
112
- tap-to-dismiss behaviour, no nesting. No API change.
113
-
114
-
115
- ## 1.7.0
116
-
117
- - **`ModalDropdown` inline-menu (`variant={DropdownVariant.Menu}`) z-index / clipping fix.** On
118
- wide/desktop web the open inline menu painted UNDERNEATH later content (adjacent filter fields,
119
- the results table, cards) so options were hidden/clipped. Root cause: react-native-web renders
120
- **every `View`** with `position: relative; z-index: 0`, making each View its own stacking context —
121
- so the popover's `zIndex: 1000` was trapped inside its anchor / the app's field wrapper and could
122
- never rise above later-painting siblings.
123
- - **Fix:** on web the menu is now rendered in a **portal to `document.body`** with `position: fixed`
124
- at the trigger's measured viewport rect (recomputed on scroll/resize) and a high `zIndex`. A portal
125
- escapes every ancestor stacking context AND every ancestor `overflow: hidden`, so the menu always
126
- paints on top and is never clipped — the same "menu above the table" outcome as
127
- `@dloizides/ui-tables` `SizeDropdown`. The anchor wrapper is also lifted to a raised `zIndex` while
128
- open (defence-in-depth; the primary lift on native).
129
- - **Native-safe:** the portal + `document`/`window` listeners are all behind `Platform.OS === 'web'`;
130
- native keeps the in-tree `position:absolute` popover + `elevation`. `react-dom` is added as an
131
- **optional** peer (already present in every react-native-web consumer).
132
- - Outside-click dismissal now consults the portalled popover's own node too, so clicking an option
133
- still selects (a portalled option is no longer a DOM descendant of the anchor). Keyboard nav
134
- (↑/↓, Home/End, Enter, Escape), `role="menu"`/`menuitem`, `aria-expanded`/`aria-selected`, and the
135
- modal variant on narrow/native are all unchanged.
136
- - **Additive / backward-compatible:** the `ModalDropdown` API is unchanged; erevna / katalogos / kefi
137
- are unaffected.
138
-
139
- ## 1.6.0
140
-
141
- - **Accessibility (WCAG 2.1 AA) hardening — additive + backward-compatible.**
142
- - `AccordionItem`: the rotating chevron (plain) and leading ▸ marker (boxed) are purely
143
- decorative — the open/closed state is already on the header via `aria-expanded` — so they are
144
- now `aria-hidden` / `accessibilityElementsHidden` to keep them out of the screen-reader tree.
145
- - `Accordion`: the expand/collapse `LayoutAnimation` and the chevron rotation now honour
146
- `prefers-reduced-motion: reduce`, snapping instantly for users who request reduced motion
147
- (WCAG 2.3.3, web only).
148
- - `ModalDropdown`: the trigger now also emits `accessibilityState.expanded` (native parity for
149
- the existing web `aria-expanded`).
150
-
151
- ## 1.5.0
152
-
153
- - `Accordion` / `AccordionItem` gain a `variant` prop (`'plain' | 'boxed'`, default `'plain'`).
154
- `plain` is the original borderless look (hairline dividers, right-hand chevron flipping 180° on
155
- open) — existing consumers render **identically**, no change. `boxed` is the AML v1 console
156
- `<details>` look: each item is its own bordered, rounded box (spaced by a gap) with a **leading
157
- ▸ marker** that rotates 90° on open and a muted, 600-weight summary. The full API is preserved
158
- (controlled/uncontrolled, `allowMultiple`, `defaultOpen`, a11y `aria-expanded`/region, the
159
- open/close LayoutAnimation + chevron rotation). Additive + backward-compatible.
160
-
161
- ## 1.4.0
162
-
163
- - Add **`SegmentedControl`** — a single rounded pill *track* holding N mutually-exclusive
164
- segments (the iOS-style segmented / tab toggle). The selected segment lifts onto a raised
165
- surface (`colors.surface`) with a subtle shadow; the rest stay transparent over the soft
166
- track (`colors.background`). Promoted from the v1 AML console's `.lf-mode` mode switch so
167
- erevna/katalogos/kefi share ONE toggle instead of hand-rolling two primary/ghost buttons.
168
- - **Generic over the value union** (`SegmentedControl<'peps' | 'leaders'>`) for a typed
169
- `onChange`; each segment carries its own `label` / `value` / optional `testID` +
170
- `accessibilityLabel` / `accessibilityHint`.
171
- - **a11y**: the group renders as a `tablist`, each segment as a `tab` with
172
- `accessibilityState={{ selected }}` (react-native-web forwards `role` + `aria-selected`).
173
- - **Themed** entirely from the `@dloizides/ui-feedback` theme (surface / background / border /
174
- text colours); no colour literal except the selected-segment drop shadow.
175
- - **Additive / backward-compatible**: purely new exports (`SegmentedControl`,
176
- `SegmentedControlProps`, `SegmentedOption`). Existing consumers are unaffected.
177
-
178
- ## 1.3.0
179
-
180
- - Add **`Accordion`** + **`AccordionItem`** — a themed expand/collapse disclosure group that
181
- replaces per-app hand-rolled `<details>` / expanders (AML "More options" + expandable
182
- matched-candidate rows, Erevna survey groups, Katalogos menu sections…).
183
- - Compound API: an `Accordion` container owns the open state and shares it with `AccordionItem`
184
- children via context. Each item = a pressable header (title left, optional `right`
185
- adornment/badge slot, a rotating chevron) over a collapsible body `region`.
186
- - **Controlled** (`openIds` + `onOpenChange`) **and uncontrolled** (`defaultOpenIds`, plus
187
- per-item `defaultOpen`). `allowMultiple` (default `true`) vs single-open. Per-item `disabled`.
188
- - **a11y**: header is an accessible `button` (`accessibilityRole="button"`,
189
- `accessibilityState={{ expanded }}`, web `aria-expanded` + `aria-controls`); body is a
190
- `role="region"`. Renders as a native `<button>`, so **Enter / Space toggle** it.
191
- - **Themed** entirely from the `@dloizides/ui-feedback` theme (border / surface / text colours),
192
- no hardcoded palette; renders borderless so it nests inside a `Section` / `Card`.
193
- - **Animated** open/close via a guarded `LayoutAnimation` (web- and native-safe no-op fallback,
194
- never throws) + an `Animated` chevron rotation. Hook-safe (lazy `useState`, no ref reads in render).
195
- - **Additive / backward-compatible**: purely new exports (`Accordion`, `AccordionItem`,
196
- `AccordionProps`, `AccordionItemProps`). Existing consumers (erevna / katalogos / aml-v2) are
197
- unaffected.
198
-
199
- ## 1.2.0
200
-
201
- - `ModalDropdown` can now render as an **inline anchored menu** (native `<select>` feel), not only a
202
- modal. New `variant?: DropdownVariant` prop (`Menu` | `Modal`) selects the presentation per screen.
203
- - **Responsive default** (when `variant` is omitted): inline `Menu` on wide/desktop web
204
- (viewport ≥ 768px), `Modal` on narrow/mobile and on any native platform. An explicit `variant`
205
- overrides the auto choice.
206
- - The inline menu anchors under the trigger, is dismissible via click-outside / `Esc`, is
207
- keyboard-navigable (↑/↓, `Home`/`End`, `Enter`), scrolls when long, and does not push layout.
208
- The modal path is unchanged. Both variants share the same option-rendering/selection logic
209
- (`OptionRow`), so nothing is duplicated.
210
- - **Additive / backward-compatible**: existing `ModalDropdown` callers (erevna / katalogos / aml-v2)
211
- keep their exact API and now get the inline-on-desktop menu automatically. New export:
212
- `DropdownVariant` (a runtime enum — deliberately not `const enum`, which cannot cross a published
213
- package boundary under `isolatedModules`).
214
-
215
- ## 1.1.0
216
-
217
- - Add `ModalShell` — slide-up full-screen modal with a themed header (title + close) and scrollable body.
218
- Composes `Heading` (this package) + `SvgIcon` (`@dloizides/ui-icons`). This was the batch-1 deferred
219
- ModalShell, now landed (ui-icons + Heading both shared). Adds `@dloizides/ui-icons` + `react-native-svg`
220
- as peers.
221
-
222
- ## 1.0.0
223
-
224
- Initial release (Capability Wave C1, batch 5 — the ui-layout pivot after full settings-hub proved
225
- not cleanly extractable). Extracted the proven (erevna+katalogos identical) presentational primitives
226
- that the settings screens (and others) reuse: `Section`, `Heading`, `StatusBadge`, `UpgradePrompt`,
227
- `ModalDropdown` + `useFocusTrap`. Share the `@dloizides/ui-feedback` context (`useUi`). `Heading`
228
- unblocks the deferred ModalShell. `Breadcrumb` deferred (couples to the app's router + breadcrumb map).
1
+ # Changelog
2
+
3
+ ## 1.12.0
4
+
5
+ - **New: `TruncatedText`** — a single-line text/link that middle-truncates to fit its container
6
+ and cannot overflow at any width. Promoted out of the AML console, where a full adverse-media
7
+ article URL rendered as raw `<Text>` and blew out its table row.
8
+
9
+ Three things that look like they would solve this and do not, all verified against
10
+ react-native-web 0.21 rather than assumed:
11
+
12
+ 1. `numberOfLines={1}` alone truncates at the **tail** (RN-web compiles it to
13
+ `text-overflow: ellipsis`). Every URL from one publisher then collapses to the same
14
+ `timesofindia.indiatimes.com/city/de…` prefix and the reader cannot tell the articles
15
+ apart. There is no CSS for middle truncation, so it is computed in JS.
16
+ 2. `title={full}` is **silently dropped** — RN-web's `<Text>` forwards only `href`, `lang`
17
+ and `pointerEvents` beyond the shared whitelist. The tooltip is set on the host node
18
+ through a ref instead.
19
+ 3. JS truncation alone can mis-estimate an unusual glyph mix, so `numberOfLines={1}` is ALSO
20
+ applied as a hard backstop. Overflow is impossible by construction, not by tuning.
21
+
22
+ The full value always stays reachable — as the accessible name and, on web, the native
23
+ tooltip. Also exported: the pure `truncateMiddle` / `formatUrlForDisplay` helpers and
24
+ `ELLIPSIS`.
25
+
26
+ ## 1.11.0
27
+
28
+ - **Fix (HIGH — 1.10.0's out-of-view close never fired in the real runtime).** 1.10.0 added
29
+ "close the menu once the trigger leaves the viewport". Repositioning worked, but the close was
30
+ measured **against the viewport**, and **RN-web apps never scroll the document** — every screen
31
+ renders inside a `ScrollView`, so scrolling happens in an inner `<div>` and `window.scrollY`
32
+ stays 0 forever. A trigger scrolled out of that inner scroller is invisible to the user while its
33
+ rect sits comfortably inside the viewport, so the check could not fire on any screen of any
34
+ portal. Measured in Chrome: trigger at `top: -37` (fully above the scroller), menu still rendered.
35
+ Visibility is now measured against the **clip window** — the viewport intersected with every
36
+ clipping ancestor — which is what makes it work inside an inner scroll container.
37
+ - **Fix: "entirely out of view" was also the wrong threshold.** When a scroll container reaches the
38
+ end of its range the trigger stops with a few pixels still showing (4px in the reported case), so
39
+ "fully out" was *unreachable* and the menu never closed however far the user scrolled. There is
40
+ now a minimum-visible-pixel floor (`MIN_VISIBLE_PX`).
41
+ - **Guard: the menu never closes on its FIRST measurement**, so opening a dropdown whose trigger is
42
+ already partly clipped still works; only movement after opening can close it.
43
+ - **The zero-area "not laid out yet" guard is unchanged in intent but now provably size-only** — it
44
+ asks about the element's own box, never its position, so it cannot swallow a genuine hidden case.
45
+ - **New: `LAYOUT_I18N`** — the manifest of every translation key this package resolves, mirroring
46
+ `TABLE_I18N` / `FILTERS_I18N` from `@dloizides/ui-tables` so hosts can bind an existing
47
+ missing-key guard to it with no new pattern. The kit is fallback-free, so a key a host forgets
48
+ reaches users as a raw dotted name; hand-maintained key lists rot (one portal was found missing
49
+ 26 kit keys, another had `common.accordionToggleHint` undefined while `Accordion` was mounted).
50
+ Every `t(...)` call in the package now references the map, and the suite fails on a raw key
51
+ literal or a stale entry — so the manifest cannot drift from the code.
52
+ - **Fix: the 1.10.0 CHANGELOG entry was written in cp1252**, leaving the published file invalid
53
+ UTF-8. Re-encoded.
54
+ - **No breaking change.** `LAYOUT_I18N` is additive and the key strings are unchanged, so existing
55
+ translation files keep working untouched.
56
+
57
+ ## 1.10.0
58
+
59
+ Two defects found by browser visual QA of the inline dropdown menu against a live app.
60
+
61
+ - **Fix (HIGH, affects every consumer): the open inline menu detached from its trigger.** On web the
62
+ menu is portalled to `document.body` with `position: fixed` at the trigger's measured rect.
63
+ `fixed` is viewport-relative, so that coordinate is only valid until something moves the trigger.
64
+ A `scroll`/`resize` listener on `window` was already in place (since 1.7.0) and does handle plain
65
+ scrolling — but it left three real gaps:
66
+ - **Layout changes that fire no scroll event at all** — an accordion above the trigger expanding,
67
+ a sticky header resizing, a banner appearing, an async list rendering. The trigger moved, nothing
68
+ scrolled, no listener fired, and the menu stayed behind. Now covered by a `ResizeObserver` on the
69
+ anchor and on `document.body`.
70
+ - **The trigger leaving the viewport.** Repositioning cannot help here — the menu just follows its
71
+ trigger off-screen and hangs over unrelated content with nothing on screen explaining it. The
72
+ menu now **closes** once the trigger is fully out of view.
73
+ - **Layout thrash.** The handler ran a synchronous `getBoundingClientRect()` (a forced reflow) plus
74
+ a React state update on *every* scroll event. Work is now coalesced into one
75
+ `requestAnimationFrame` per frame.
76
+ Scroll is now observed in the **capture** phase on `document` rather than `window`, so a scroll in
77
+ any ancestor scroll container counts. Tracking moved into a dedicated `useAnchorTracking` hook.
78
+ Native is unaffected (the popover is in-tree and moves with its anchor).
79
+ - **Fix (a11y): `accessibilityHint` never reached a screen reader.** The prop is part of the public
80
+ API and every caller passes one, but react-native-web does not map it — the trigger carried
81
+ `aria-label` and `aria-expanded` and **no hint of any kind**, so the text was silently thrown away
82
+ (older react-native-web versions additionally leaked it to the DOM, logging
83
+ `React does not recognize the accessibilityHint prop on a DOM element`). On web the hint is now
84
+ rendered into a visually-hidden node referenced by `aria-describedby` — the same wiring
85
+ `@dloizides/ui-forms`' `Field` uses for its error line — and the RN-only prop is no longer passed
86
+ on web at all. Native still receives `accessibilityHint` unchanged.
87
+ - **No API change.** Both fixes are internal; every existing caller benefits without edits.
88
+
89
+ ## 1.9.1
90
+
91
+ - **Fix (keyboard a11y, affects every consumer): Enter CLOSED the inline menu instead of SELECTING
92
+ the highlighted option.** The trigger keeps DOM focus while the menu is open, and react-native-web
93
+ maps Enter on a focused Touchable to `onPress`. React dispatches that from its ROOT container
94
+ listener — an ancestor of the trigger, but a *descendant* of `document` — so the menu's BUBBLING
95
+ `document` keydown listener ran second: the trigger toggled the menu shut, React unmounted the
96
+ popover, the effect cleanup removed the very listener the event was still travelling toward, and
97
+ `document` never saw the Enter. Keyboard users could open a dropdown and arrow through it but
98
+ could never CHOOSE with the keyboard (mouse selection was unaffected, which is why it went
99
+ unnoticed).
100
+ - **Fix:** the menu's key handler now runs in the **capture** phase and `stopPropagation`s the keys
101
+ an open menu owns (↑/↓/Home/End/Enter/Escape), so it runs ahead of React's listener and the
102
+ trigger cannot re-toggle behind it. Found while browser-verifying the AML v2 topbar dropdowns.
103
+
104
+ ## 1.9.0
105
+
106
+ - **`ModalDropdown`: `menuMinWidth` — a width FLOOR for the open inline menu (additive, optional).**
107
+ The menu matches the TRIGGER's width, which is right for a full-width field but leaves a compact
108
+ anchor (the 1.8.0 `renderTrigger` case: a locale pill, an avatar chip, an icon button) with a menu
109
+ too narrow to read its own option labels — a 52px "EN ▾" pill produced a 52px menu whose rows were
110
+ clipped to a dark strip. `menuMinWidth` floors it; a wider trigger still wins.
111
+ - **Backward-compatible:** omitted, the width is the trigger's, exactly as before.
112
+
113
+ ## 1.8.0
114
+
115
+ - **`ModalDropdown`: `renderTrigger` — a custom ANCHOR slot (additive, optional).** The dropdown's
116
+ default trigger is a bordered field box, which is wrong for a *menu* anchored to a compact chip
117
+ (a locale pill, an avatar/user chip, an icon button). Callers can now supply
118
+ `renderTrigger={({ label, isOpen }) => …}` and own the anchor's visuals entirely; the default box
119
+ is then not rendered. The a11y wrapper stays with the dropdown — `role=button`, `aria-expanded`,
120
+ the accessible label + hint, and the `testID` are still applied — so a custom trigger *cannot*
121
+ drop the accessible contract, and the portalled, keyboard-navigable (↑/↓/Home/End/Enter/Escape),
122
+ never-clipped menu comes along for free.
123
+ - **`ModalDropdown`: `optionTestID` — custom per-option testIDs (additive, optional).** Options
124
+ still default to `` `${testID}-option-${value}` ``; a caller turning an existing flat control into
125
+ a dropdown can now keep its established selectors stable
126
+ (`optionTestID={(code) => `lang-${code}`}`).
127
+ - **Backward-compatible:** both props are optional and, when omitted, the render tree is unchanged —
128
+ erevna / katalogos / kefi / agora are unaffected and need no markup changes.
129
+
130
+ ## 1.7.1
131
+
132
+ Fix: the modal-variant dismiss backdrop was a pressable WRAPPING the option buttons,
133
+ producing invalid DOM on web ("<button> cannot contain a nested <button>") + a React
134
+ console.error. The backdrop is now an absolute-fill SIBLING behind the dialog — same
135
+ tap-to-dismiss behaviour, no nesting. No API change.
136
+
137
+
138
+ ## 1.7.0
139
+
140
+ - **`ModalDropdown` inline-menu (`variant={DropdownVariant.Menu}`) z-index / clipping fix.** On
141
+ wide/desktop web the open inline menu painted UNDERNEATH later content (adjacent filter fields,
142
+ the results table, cards) so options were hidden/clipped. Root cause: react-native-web renders
143
+ **every `View`** with `position: relative; z-index: 0`, making each View its own stacking context —
144
+ so the popover's `zIndex: 1000` was trapped inside its anchor / the app's field wrapper and could
145
+ never rise above later-painting siblings.
146
+ - **Fix:** on web the menu is now rendered in a **portal to `document.body`** with `position: fixed`
147
+ at the trigger's measured viewport rect (recomputed on scroll/resize) and a high `zIndex`. A portal
148
+ escapes every ancestor stacking context AND every ancestor `overflow: hidden`, so the menu always
149
+ paints on top and is never clipped — the same "menu above the table" outcome as
150
+ `@dloizides/ui-tables` `SizeDropdown`. The anchor wrapper is also lifted to a raised `zIndex` while
151
+ open (defence-in-depth; the primary lift on native).
152
+ - **Native-safe:** the portal + `document`/`window` listeners are all behind `Platform.OS === 'web'`;
153
+ native keeps the in-tree `position:absolute` popover + `elevation`. `react-dom` is added as an
154
+ **optional** peer (already present in every react-native-web consumer).
155
+ - Outside-click dismissal now consults the portalled popover's own node too, so clicking an option
156
+ still selects (a portalled option is no longer a DOM descendant of the anchor). Keyboard nav
157
+ (↑/↓, Home/End, Enter, Escape), `role="menu"`/`menuitem`, `aria-expanded`/`aria-selected`, and the
158
+ modal variant on narrow/native are all unchanged.
159
+ - **Additive / backward-compatible:** the `ModalDropdown` API is unchanged; erevna / katalogos / kefi
160
+ are unaffected.
161
+
162
+ ## 1.6.0
163
+
164
+ - **Accessibility (WCAG 2.1 AA) hardening — additive + backward-compatible.**
165
+ - `AccordionItem`: the rotating chevron (plain) and leading ▸ marker (boxed) are purely
166
+ decorative — the open/closed state is already on the header via `aria-expanded` — so they are
167
+ now `aria-hidden` / `accessibilityElementsHidden` to keep them out of the screen-reader tree.
168
+ - `Accordion`: the expand/collapse `LayoutAnimation` and the chevron rotation now honour
169
+ `prefers-reduced-motion: reduce`, snapping instantly for users who request reduced motion
170
+ (WCAG 2.3.3, web only).
171
+ - `ModalDropdown`: the trigger now also emits `accessibilityState.expanded` (native parity for
172
+ the existing web `aria-expanded`).
173
+
174
+ ## 1.5.0
175
+
176
+ - `Accordion` / `AccordionItem` gain a `variant` prop (`'plain' | 'boxed'`, default `'plain'`).
177
+ `plain` is the original borderless look (hairline dividers, right-hand chevron flipping 180° on
178
+ open) — existing consumers render **identically**, no change. `boxed` is the AML v1 console
179
+ `<details>` look: each item is its own bordered, rounded box (spaced by a gap) with a **leading
180
+ ▸ marker** that rotates 90° on open and a muted, 600-weight summary. The full API is preserved
181
+ (controlled/uncontrolled, `allowMultiple`, `defaultOpen`, a11y `aria-expanded`/region, the
182
+ open/close LayoutAnimation + chevron rotation). Additive + backward-compatible.
183
+
184
+ ## 1.4.0
185
+
186
+ - Add **`SegmentedControl`** — a single rounded pill *track* holding N mutually-exclusive
187
+ segments (the iOS-style segmented / tab toggle). The selected segment lifts onto a raised
188
+ surface (`colors.surface`) with a subtle shadow; the rest stay transparent over the soft
189
+ track (`colors.background`). Promoted from the v1 AML console's `.lf-mode` mode switch so
190
+ erevna/katalogos/kefi share ONE toggle instead of hand-rolling two primary/ghost buttons.
191
+ - **Generic over the value union** (`SegmentedControl<'peps' | 'leaders'>`) for a typed
192
+ `onChange`; each segment carries its own `label` / `value` / optional `testID` +
193
+ `accessibilityLabel` / `accessibilityHint`.
194
+ - **a11y**: the group renders as a `tablist`, each segment as a `tab` with
195
+ `accessibilityState={{ selected }}` (react-native-web forwards `role` + `aria-selected`).
196
+ - **Themed** entirely from the `@dloizides/ui-feedback` theme (surface / background / border /
197
+ text colours); no colour literal except the selected-segment drop shadow.
198
+ - **Additive / backward-compatible**: purely new exports (`SegmentedControl`,
199
+ `SegmentedControlProps`, `SegmentedOption`). Existing consumers are unaffected.
200
+
201
+ ## 1.3.0
202
+
203
+ - Add **`Accordion`** + **`AccordionItem`** — a themed expand/collapse disclosure group that
204
+ replaces per-app hand-rolled `<details>` / expanders (AML "More options" + expandable
205
+ matched-candidate rows, Erevna survey groups, Katalogos menu sections…).
206
+ - Compound API: an `Accordion` container owns the open state and shares it with `AccordionItem`
207
+ children via context. Each item = a pressable header (title left, optional `right`
208
+ adornment/badge slot, a rotating chevron) over a collapsible body `region`.
209
+ - **Controlled** (`openIds` + `onOpenChange`) **and uncontrolled** (`defaultOpenIds`, plus
210
+ per-item `defaultOpen`). `allowMultiple` (default `true`) vs single-open. Per-item `disabled`.
211
+ - **a11y**: header is an accessible `button` (`accessibilityRole="button"`,
212
+ `accessibilityState={{ expanded }}`, web `aria-expanded` + `aria-controls`); body is a
213
+ `role="region"`. Renders as a native `<button>`, so **Enter / Space toggle** it.
214
+ - **Themed** entirely from the `@dloizides/ui-feedback` theme (border / surface / text colours),
215
+ no hardcoded palette; renders borderless so it nests inside a `Section` / `Card`.
216
+ - **Animated** open/close via a guarded `LayoutAnimation` (web- and native-safe no-op fallback,
217
+ never throws) + an `Animated` chevron rotation. Hook-safe (lazy `useState`, no ref reads in render).
218
+ - **Additive / backward-compatible**: purely new exports (`Accordion`, `AccordionItem`,
219
+ `AccordionProps`, `AccordionItemProps`). Existing consumers (erevna / katalogos / aml-v2) are
220
+ unaffected.
221
+
222
+ ## 1.2.0
223
+
224
+ - `ModalDropdown` can now render as an **inline anchored menu** (native `<select>` feel), not only a
225
+ modal. New `variant?: DropdownVariant` prop (`Menu` | `Modal`) selects the presentation per screen.
226
+ - **Responsive default** (when `variant` is omitted): inline `Menu` on wide/desktop web
227
+ (viewport ≥ 768px), `Modal` on narrow/mobile and on any native platform. An explicit `variant`
228
+ overrides the auto choice.
229
+ - The inline menu anchors under the trigger, is dismissible via click-outside / `Esc`, is
230
+ keyboard-navigable (↑/↓, `Home`/`End`, `Enter`), scrolls when long, and does not push layout.
231
+ The modal path is unchanged. Both variants share the same option-rendering/selection logic
232
+ (`OptionRow`), so nothing is duplicated.
233
+ - **Additive / backward-compatible**: existing `ModalDropdown` callers (erevna / katalogos / aml-v2)
234
+ keep their exact API and now get the inline-on-desktop menu automatically. New export:
235
+ `DropdownVariant` (a runtime enum — deliberately not `const enum`, which cannot cross a published
236
+ package boundary under `isolatedModules`).
237
+
238
+ ## 1.1.0
239
+
240
+ - Add `ModalShell` — slide-up full-screen modal with a themed header (title + close) and scrollable body.
241
+ Composes `Heading` (this package) + `SvgIcon` (`@dloizides/ui-icons`). This was the batch-1 deferred
242
+ ModalShell, now landed (ui-icons + Heading both shared). Adds `@dloizides/ui-icons` + `react-native-svg`
243
+ as peers.
244
+
245
+ ## 1.0.0
246
+
247
+ Initial release (Capability Wave C1, batch 5 — the ui-layout pivot after full settings-hub proved
248
+ not cleanly extractable). Extracted the proven (erevna+katalogos identical) presentational primitives
249
+ that the settings screens (and others) reuse: `Section`, `Heading`, `StatusBadge`, `UpgradePrompt`,
250
+ `ModalDropdown` + `useFocusTrap`. Share the `@dloizides/ui-feedback` context (`useUi`). `Heading`
251
+ unblocks the deferred ModalShell. `Breadcrumb` deferred (couples to the app's router + breadcrumb map).