@uni-design-system/uni-angular 8.3.0 → 8.4.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,5 +1,290 @@
1
1
  # @uni-design-system/uni-angular
2
2
 
3
+ ## 8.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1aca747`](https://github.com/uni-design-system/uni/commit/1aca747c7bdff6cf72a9fa349e77a6e7985b97c7) Thanks [@gaenglish](https://github.com/gaenglish)! - `uni-callout` and `uni-expand` now read their timing from the theme's `motion`
8
+ scale, so every animated surface in the library is retimed from one place.
9
+ They were the last two carrying their own motion options — in different units,
10
+ under different names (`transitionMs` in milliseconds, `transitionSpeed` in
11
+ seconds).
12
+
13
+ A third token joins `popup` and `panel`:
14
+
15
+ | Token | Default | Used by |
16
+ | -------- | ----------------- | --------------------- |
17
+ | `reveal` | 350ms ease-in-out | expand, expand-toggle |
18
+
19
+ `reveal` is a _base_ speed, not a final duration: `uni-expand` still scales it
20
+ by content height (√-of-height, clamped) so short regions stay snappy and tall
21
+ ones aren't rushed, and its easing now drives the reveal curve, which was
22
+ hardcoded. `uni-expand-toggle` resolves the token the same way, so the chevron
23
+ and the region cannot drift apart. `uni-callout` maps onto `panel`, whose
24
+ 250ms matches what it already used.
25
+
26
+ **Not breaking.** `transitionMs` and `transitionSpeed` are deprecated but
27
+ still honoured, and deliberately outrank `motion` — a theme that set either
28
+ keeps precisely its current timing rather than being retimed underneath it.
29
+ They are removed next major. Per-instance inputs, like `uni-expand`'s
30
+ `transitionSpeed`, still outrank everything.
31
+
32
+ Nothing moves differently by default: callout renders 0.25s ease and expand
33
+ 0.35s ease-in-out exactly as before, verified against the rendered styles.
34
+
35
+ - [`e459f91`](https://github.com/uni-design-system/uni/commit/e459f916e6f097041d04c8209e896b8fd7d11362) Thanks [@gaenglish](https://github.com/gaenglish)! - New `createAnnouncer()` in the CDK's a11y helpers: the polite live region a
36
+ form control uses for its running commentary — commits, clears, refused
37
+ entries, result counts — changes a sighted user sees but that are otherwise
38
+ silent to a screen reader.
39
+
40
+ `uni-combobox`, `uni-tag-input`, `uni-time-input`, `uni-date-input`,
41
+ `uni-calendar` and `uni-tour` now share it instead of carrying byte-identical
42
+ copies. The helper holds no DOM and no styling: the `role="status"` element
43
+ stays in each component's own template, where its placement and
44
+ visually-hidden class already belong.
45
+
46
+ This fixes a real bug in `uni-tour`, which had a plain signal rather than a
47
+ copy of the shared idiom. Assistive tech reads a live region when its content
48
+ _changes_, so writing the identical string is a no-op — its "Next available"
49
+ gate message was announced on the first step that used it and silently dropped
50
+ on every later one. `createAnnouncer` breaks the equality with a trailing
51
+ space, inaudible to a screen reader, alternating between the two forms so
52
+ nothing accumulates.
53
+
54
+ Consuming the helper directly:
55
+
56
+ ```ts
57
+ protected readonly announcer = createAnnouncer();
58
+ // this.announcer.announce('Alabama selected.');
59
+ ```
60
+
61
+ ```html
62
+ <span role="status" aria-live="polite" [class]="srOnly"> {{ announcer.message() }} </span>
63
+ ```
64
+
65
+ The region must already be in the DOM when the component renders — one added
66
+ at the moment it gains text is not reliably announced.
67
+
68
+ - [`6e2cfb1`](https://github.com/uni-design-system/uni/commit/6e2cfb1f9bfd82c7165e2a853b1729abdda5194a) Thanks [@gaenglish](https://github.com/gaenglish)! - Home and End now move the caret in the combobox-style controls —
69
+ `uni-combobox`, `uni-search-input`, `uni-tag-input` — instead of jumping to
70
+ the ends of the suggestion list. APG reserves those keys for text editing in
71
+ an editable combobox, and a field that claims them makes its own text
72
+ un-navigable exactly when you are most likely to be editing it: with the list
73
+ open. `uni-time-input` already behaved this way.
74
+
75
+ Nothing is lost. ArrowUp on a closed list already opens it on the last option,
76
+ ArrowDown on the first, and navigation wraps at both ends, so every position
77
+ Home/End reached is still one keystroke away.
78
+
79
+ `uni-multi-select-dropdown` keeps them: its roving focus rides the option
80
+ checkboxes rather than a text field, so there is no caret with a better claim.
81
+
82
+ `ListboxNavigation` carries the switch as `homeEndNavigates`, defaulting to
83
+ false — off is the right default for a control built around a text input,
84
+ which is every consumer but one. If you build on the CDK helper directly and
85
+ want the old behavior, pass `homeEndNavigates: true`.
86
+
87
+ This also fixes a sharper bug in `uni-search-input` and `uni-tag-input`, where
88
+ Home/End reached the navigation helper unconditionally: pressing either not
89
+ only moved the active option but _opened a closed suggestion list_.
90
+
91
+ - [`dd33baa`](https://github.com/uni-design-system/uni/commit/dd33baa821922f257980cc3543dcac0ba118a0c3) Thanks [@gaenglish](https://github.com/gaenglish)! - The four listbox popups — `uni-search-input`, `uni-tag-input`,
92
+ `uni-time-input` and `uni-combobox` — now render in the browser's top layer,
93
+ anchored to their field, instead of as absolutely-positioned children of it.
94
+ Put any of them inside a card, a table cell, a scroll area or a dialog and the
95
+ suggestion list is no longer clipped by that ancestor's `overflow`. The browser
96
+ tracks the field natively, so the list follows on scroll and resize with no
97
+ listeners, and flips above the field near the bottom of the viewport.
98
+
99
+ They also open the way `uni-dropdown` does now — the same 100 ms scale-and-fade
100
+ — so every popup panel in the library animates alike instead of the listboxes
101
+ alone snapping into place. The origin is measured from where the popup actually
102
+ opened, so one that flips above its field near the bottom of the viewport still
103
+ grows out of the edge it is attached to. Under `prefers-reduced-motion` there is
104
+ no transition at all.
105
+
106
+ Nothing changes in the components' APIs or in how they dismiss. The popups use
107
+ `popover="manual"`, not `auto`: these controls already own dismissal through
108
+ focusout, Escape and commit, and `auto`'s light-dismiss fires on pointerdown
109
+ outside the popup — which includes their own input, so it would close the list
110
+ on every click into the field.
111
+
112
+ Positioning is gated on CSS anchor positioning support, checked together with
113
+ the top layer rather than separately. Browsers that have `popover` but not
114
+ anchors — Safari 17 through 25 — keep the previous in-flow popup, which still
115
+ clips inside `overflow: hidden` ancestors but stays on its field; promoting it
116
+ there would strand the list a viewport height down the page, since a top-layer
117
+ element has no positioned ancestor to resolve against.
118
+
119
+ Shared plumbing lives in `components/forms/listbox-popup.ts` alongside
120
+ `listboxPopupStyles()`, which grew an optional `anchor` and now emits the
121
+ in-flow rules as the base with the anchored ones in an `@supports` block.
122
+
123
+ - [`2910c67`](https://github.com/uni-design-system/uni/commit/2910c67c9ac0c5b47be7f67c4407514aa22a4f60) Thanks [@gaenglish](https://github.com/gaenglish)! - `Option.disabled` now works in the three remaining `Options<T>` consumers, not
124
+ just `uni-combobox`: `uni-select`, `uni-multi-select-dropdown` and
125
+ `uni-multi-select`. Marking an individual choice `disabled` shows it without
126
+ offering it — the plan that needs an upgrade, the channel that needs a verified
127
+ phone number — instead of dropping it from the array and leaving the list
128
+ lying about what exists.
129
+
130
+ `uni-select` passes it to the native `<option>`, so the platform handles
131
+ skipping, greying and announcement. The two multi-selects disable the option's
132
+ checkbox and refuse the toggle even when called directly. In
133
+ `uni-multi-select-dropdown` the arrow keys step over disabled rows and Home/End
134
+ land on the nearest enabled option — `ListboxNavigation` already knew how, it
135
+ just was not being told which rows were disabled — so focus never parks on a
136
+ checkbox that cannot take it.
137
+
138
+ `selectAll()` on both multi-selects now selects only enabled options. A
139
+ disabled option is not committable, so nothing may commit one on the user's
140
+ behalf; `deselectAll()` still clears everything. If you relied on `selectAll()`
141
+ returning every value including disabled ones, note that only options you have
142
+ explicitly marked `disabled` are affected. Whole-field `disabled` is unchanged
143
+ and still disables the entire control.
144
+
145
+ - [`6f76c1d`](https://github.com/uni-design-system/uni/commit/6f76c1d3cc1ba2ed5e2747b6d2142d16cb4f537b) Thanks [@gaenglish](https://github.com/gaenglish)! - `uni-alert`, `uni-snackbar`, `uni-radio` and `uni-menu-item` now read their
146
+ timing from the theme's `motion` scale, which completes the migration: every
147
+ animated component in the library is retimed from one place.
148
+
149
+ Two tokens join `popup`, `panel` and `reveal`:
150
+
151
+ | Token | Default | Used by |
152
+ | -------------- | ----------------- | ---------------- |
153
+ | `notification` | 350ms ease-in-out | alert, snackbar |
154
+ | `control` | 300ms ease | radio, menu-item |
155
+
156
+ **One thing moves differently:** `menu-item`'s hover transition goes from
157
+ 0.35s to 0.3s, joining `radio` on the shared `control` token. The two were
158
+ never deliberately different — `radio`'s own option documented its 0.3 as
159
+ "matching menuItem", which was not true — so this corrects drift rather than
160
+ changing a decision. A theme that wants the old timing can set the deprecated
161
+ `transitionSpeed`, or retime `control`. Everything else is byte-identical,
162
+ verified against the rendered styles.
163
+
164
+ **Deprecated, still honoured, removed next major:**
165
+ `alert.transitionSpeed`, `snackbar.transitionDelay`, `radio.transitionSpeed`
166
+ and `menuItem.transitionSpeed` all still work and still outrank `motion`, so a
167
+ theme that set them keeps its exact timing. `menu-item`'s escape hatch is
168
+ intact too: with neither the option nor a token set it still renders no
169
+ transition at all, and a token with `duration: 0` is the way to ask for
170
+ instant now.
171
+
172
+ `card.transitionSpeed` and `input-box.transitionSpeed` are also deprecated,
173
+ for a different reason: **neither was ever read by its component.** Setting
174
+ them has never had any effect. They are removed next major and nothing needs
175
+ to replace them.
176
+
177
+ `uni-skeleton` is deliberately left out. Its shimmer is a loop rather than a
178
+ transition, and folding a repeating animation into a scale built around
179
+ entering and leaving would make the scale mean two different things.
180
+
181
+ - [`228c17f`](https://github.com/uni-design-system/uni/commit/228c17f9fb7a4e4eb8d6a9cd0a6301d02ddd3dd3) Thanks [@gaenglish](https://github.com/gaenglish)! - `uni-skeleton` picks up the knobs an app theme could not reach. `color`, `highlightColor` and `borderRadius` are now inputs that take a token name and fall back to the theme option, because one screen routinely needs several of each — text bars and a pill chip do not share a corner (`borderRadius="max"`), and a skeleton on a card wants a different tint than one on the page background.
182
+
183
+ The shimmer is now a band swept with `transform` rather than an animated `background-position`: it composites instead of repainting every frame, and its geometry is themeable via two new options, `direction` (`'ltr' | 'rtl'`, default `'ltr'` — the sweep previously ran right-to-left) and `highlightWidth` (band width as a percentage of the block, default `40`). Both ends of the band are the base color, so it dissolves into the block with no alpha and no fringing.
184
+
185
+ A new `label` input announces a standalone skeleton: set it and the host becomes `role="status"` with visually hidden text instead of `aria-hidden="true"`. Unlabelled skeletons stay `aria-hidden`, so container-level `aria-busy` patterns are unchanged.
186
+
187
+ - [`eb795a3`](https://github.com/uni-design-system/uni/commit/eb795a3874c4642e571651dfdebd1a392d62d5ab) Thanks [@gaenglish](https://github.com/gaenglish)! - `uni-snackbar` now renders in the browser's top layer, so it can no longer be
188
+ covered by a high `z-index` or clipped by an `overflow: hidden` or transformed
189
+ ancestor. It was the last overlay in the library still competing on stacking
190
+ order: a `<dialog>` opened with `.show()`, which is the _non-modal_ form and
191
+ never enters the top layer, left it relying on `zIndex: Z_INDEX.dialog`. That
192
+ held only because apps mount the bar near the root — anywhere else, a
193
+ confirmation of what just happened could be silently buried.
194
+
195
+ The bar is now a `popover="manual"`. Manual rather than auto because a
196
+ snackbar must not light-dismiss: a click anywhere else on the page would tear
197
+ it away from someone still reading it. It is not `showModal()` either — that
198
+ would make the rest of the page inert to announce a transient message.
199
+
200
+ `role="status"`, the auto-close timer, its pause-on-hover and pause-on-focus
201
+ behaviour, the entry and exit animations, and the `[(show)]` / `open()` /
202
+ `close()` API are all unchanged.
203
+
204
+ The element behind the component changed from `<dialog>` to `<div>`: the bar
205
+ is never modal, and `<dialog>`'s `open` attribute would have been a second,
206
+ competing notion of "shown" alongside the popover's own state. Styles that
207
+ reach inside the component to target `uni-snackbar dialog` need updating —
208
+ `uni-snackbar [role="status"]` is the stable selector.
209
+
210
+ - [`3b51ace`](https://github.com/uni-design-system/uni/commit/3b51acee92659526c1c8c91668b37db8c5933162) Thanks [@gaenglish](https://github.com/gaenglish)! - Overlay timing is now a theme token. `UniTheme` gains a `motion` scale
211
+ alongside `radii`, `shadows` and the rest, and the overlays point at it by
212
+ name instead of carrying their own hardcoded durations.
213
+
214
+ Until now a theme could slow a skeleton shimmer but not a dropdown: `expand`,
215
+ `skeleton` and `callout` each exposed their own motion option while
216
+ `uni-dropdown` hardcoded 100ms and the combobox-style listbox popups copied
217
+ that constant. Retiming the library meant editing components.
218
+
219
+ Two tokens ship, because two things genuinely move differently — a small panel
220
+ attached to a control snaps, a larger free-floating surface settles:
221
+
222
+ | Token | Default | Used by |
223
+ | ------- | ------------------ | --------------------------------------------------------------------------- |
224
+ | `popup` | 100ms linear, ×0.8 | dropdown, menu, multi-select, combobox, search-input, tag-input, time-input |
225
+ | `panel` | 250ms ease | popover |
226
+
227
+ A token carries `duration` (ms), `easing`, and an optional `scale` for panels
228
+ that grow into place — one token rather than separate duration and easing
229
+ scales, because they are one design decision: slowing a panel without
230
+ softening its curve reads as sluggish rather than calm.
231
+
232
+ ```ts
233
+ createTheme({
234
+ id: 'Calm',
235
+ name: 'Calm',
236
+ colors,
237
+ motion: { popup: { duration: 240, easing: 'ease-out', scale: 0.95 } },
238
+ });
239
+ ```
240
+
241
+ Tokens you don't restate keep their base values, and a component can still
242
+ point at a token of its own through its `motion` option.
243
+
244
+ Nothing moves differently by default — every current duration, easing and
245
+ scale is preserved exactly, verified against the rendered styles. Themes that
246
+ predate the scale keep working: `createTheme` fills it in, the validator does
247
+ not require it, and a theme registered as JSON without it resolves to the base
248
+ timing rather than failing. `motionSafe` remains the floor, so a theme decides
249
+ how overlays move for people who want movement, never whether they move at
250
+ all.
251
+
252
+ `callout`'s existing `transitionMs` option and the `expand`/`skeleton`
253
+ durations are untouched for now; folding them into this scale is a follow-up.
254
+
255
+ ### Patch Changes
256
+
257
+ - [`676ec55`](https://github.com/uni-design-system/uni/commit/676ec5549cf4b10c549538aebd8f5a56fc0cb68a) Thanks [@gaenglish](https://github.com/gaenglish)! - `uni-dropdown` now uses the CDK's overlay helpers instead of its own copies of
258
+ them. It predates `cdk/overlay`, so it had been carrying a duplicate
259
+ placement-to-`transform-origin` map, a duplicate focus-restore rule, a
260
+ duplicate discrete-transition block, and hand-written anchor and toggle-state
261
+ code. `TRANSFORM_ORIGINS` had no consumers at all as a result — the shared
262
+ constant existed while the one component that needed it used its own copy.
263
+
264
+ No behaviour change: the dropdown's 100 ms linear scale-and-fade, its measured
265
+ transform origin, its focus restore and its ARIA wiring are all identical,
266
+ verified against the rendered styles. Every export in `cdk/overlay` now has a
267
+ consumer, and the component is 35 lines shorter.
268
+
269
+ `discreteOverlayTransition()` takes an optional fourth argument, a
270
+ `transition-timing-function`. Omitted, nothing is emitted and the CSS initial
271
+ value stands, so existing callers are untouched.
272
+
273
+ One real inconsistency fixed along the way: the listbox popups
274
+ (`uni-combobox`, `uni-search-input`, `uni-tag-input`, `uni-time-input`) were
275
+ introduced to match `uni-dropdown`'s animation but ran on the default `ease`,
276
+ while the dropdown uses `linear` — so a combobox and a multi-select dropdown
277
+ in the same form opened at visibly different rates. They now share the
278
+ dropdown's easing exactly.
279
+
280
+ ## 8.3.1
281
+
282
+ ### Patch Changes
283
+
284
+ - [`66f4051`](https://github.com/uni-design-system/uni/commit/66f4051c69b6b55ed2c2b95425fd8aa1a1bccdcd) Thanks [@gaenglish](https://github.com/gaenglish)! - `uni-combobox` docs: "Allowing new values" — free text never commits implicitly (closed-set contract: typing filters, a non-matching draft reverts with `(rejected)`). The supported create-new pattern is now documented with a working story: drive `[options]` from the debounced `(query)` with `[filterLocally]="false"` and, when nothing matches exactly, append a sentinel option — `{ label: `Create "${text}"`, value: … }`. As a real option it commits through every normal path (arrow + Enter, click, Enter when the filter narrows to it alone); resolve it in `(selected)` by minting the entity and writing the model. Blur intentionally never commits the sentinel — creation takes an explicit Enter or click. Lighter alternative: listen to `(rejected: { query })` and offer creation outside the control. If most values are user-created, use `uni-tag-input` (open set) instead.
285
+
286
+ - [`dc7aef9`](https://github.com/uni-design-system/uni/commit/dc7aef994abd4e7ac73de64bdea2d3ce5cb18db3) Thanks [@gaenglish](https://github.com/gaenglish)! - `uni-dropdown` (and everything riding it — the date picker popup, menus, multi-select): the open/close scale animation now originates from the corner actually touching the trigger. The origin was mapped statically from the _requested_ placement, but `position-try-fallbacks` lets the browser flip the panel at viewport edges — so a `bottom-end` date picker repositioned above its field still animated from the top-right corner. The panel is now measured on each toggle (open and close-start) and the transform origin follows the rendered position, via the new cdk helper `transformOriginFor(panelRect, triggerRect)`.
287
+
3
288
  ## 8.3.0
4
289
 
5
290
  ### Minor Changes