@ids-group-ltd/ids-design-system 0.11.3 → 0.11.4
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 +200 -10
- package/components.md +12 -4
- package/docs/agent/INDEX.md +1 -0
- package/docs/agent/platform/body-scroll-lock-service.md +12 -0
- package/docs/agent/platform/toast-service.md +4 -6
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +689 -452
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.11.4.json +241 -0
- package/migrations/0.8.0.json +6 -5
- package/package.json +1 -1
- package/styles/_control-label.scss +18 -0
- package/styles/_ds-color.scss +6 -0
- package/styles/_focus.scss +16 -0
- package/styles/_skeleton-shimmer.scss +10 -26
- package/themes/_semantic.scss +11 -2
- package/types/ids-group-ltd-ids-design-system.d.ts +100 -50
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,197 @@ While the package is on `0.x`, minor releases may contain breaking changes.
|
|
|
8
8
|
|
|
9
9
|
## Unreleased
|
|
10
10
|
|
|
11
|
+
## 0.11.4 — 2026-09-03
|
|
12
|
+
|
|
13
|
+
### Breaking
|
|
14
|
+
|
|
15
|
+
- **`ds-banner` and `ds-alert` no longer announce themselves unless asked.** Both applied `role` and
|
|
16
|
+
`aria-live` unconditionally, and an `alert` region fires on INSERTION — so a static "maintenance on
|
|
17
|
+
Sunday" strip interrupted a screen reader on every client-side route into the page. MDN says it
|
|
18
|
+
outright: do not use `alert` on content the user has not interacted with. Measured on this site's own
|
|
19
|
+
pages: 12 assertive regions before, 0 now. Pass `[announce]="true"` for a banner the app raises in
|
|
20
|
+
response to an event; for anything transient use `ToastService`, which owns a region built for it.
|
|
21
|
+
|
|
22
|
+
- **`<ds-toast>`'s `message` input is now `body`**, matching `ToastOptions.body` and `ToastEntry.body`.
|
|
23
|
+
One concept had three spellings across the family; `body` wins because it is the one every consumer
|
|
24
|
+
already passes to the service.
|
|
25
|
+
|
|
26
|
+
- **Five toast border tokens gain the `-color` the rest of the library uses**:
|
|
27
|
+
`--ds-toast-border` → `--ds-toast-border-color`, and the four variant suffixes with it. They are
|
|
28
|
+
colours, and they were the last holdouts of the old naming.
|
|
29
|
+
|
|
30
|
+
- **`maxVisible` defaults to 5 instead of unlimited.** An uncapped stack was more permissive than any
|
|
31
|
+
system this component is measured against — Material shows one snackbar and dismisses the previous,
|
|
32
|
+
Carbon and Halstack stack but expect a ceiling. `provideDsConfig({ toast: { maxVisible: n } })` still sets it, and `0` still means
|
|
33
|
+
no cap; a configured `0` is now forwarded rather than skipped, since it is the only way left to ask
|
|
34
|
+
for one.
|
|
35
|
+
|
|
36
|
+
- **A screen reader was told nothing about a toast, for three of the five variants.** `aria-live` sat
|
|
37
|
+
on each toast, and a live region has to exist in the DOM *before* its text arrives — a node created
|
|
38
|
+
with its message already inside it is the one case NVDA and JAWS reliably do not announce. The
|
|
39
|
+
region host was `role="region"`, a landmark, not a live region. Announcements now go through the CDK
|
|
40
|
+
`LiveAnnouncer`, whose region is built once at service construction and only has its text replaced.
|
|
41
|
+
`error` and `warning` announce assertively, the rest politely. WCAG 2.2 SC 4.1.3.
|
|
42
|
+
|
|
43
|
+
A burst is coalesced into one announcement rather than queued, and that is forced rather than
|
|
44
|
+
chosen: `announce()` clears its region synchronously and writes on a 120ms timeout, resolving its
|
|
45
|
+
promise inside that callback — so even a strictly serialised chain loses all but the last message.
|
|
46
|
+
Measured: five announcements each landed and were cleared again in the same millisecond.
|
|
47
|
+
|
|
48
|
+
A `<ds-toast>` you place yourself is now silent to a reader. It is a specimen, not an event; use
|
|
49
|
+
`ToastService` for anything that should be announced.
|
|
50
|
+
|
|
51
|
+
- **Toast defaults move into `provideDsConfig`, and the two toast tokens are gone.**
|
|
52
|
+
`DS_TOAST_CONFIG` and `DS_TOAST_POSITION` were the only configuration in the library that did not
|
|
53
|
+
go through `DsConfig` — thirteen other areas already did — so an app set everything in one call and
|
|
54
|
+
then remembered two bare `InjectionToken` providers for toasts. They are now
|
|
55
|
+
`provideDsConfig({ toast: { maxVisible, position } })`, and the `DsToastConfig` interface is
|
|
56
|
+
removed with its token.
|
|
57
|
+
`position` is PARTIAL and merged field by field over `right` / `top` / `var(--space-6)`: the old
|
|
58
|
+
token's type required all three fields, so moving the stack to the bottom meant restating the other
|
|
59
|
+
two. `DS_TOAST_POSITION_DEFAULT` is unchanged and still exported. One caveat, and it is not new:
|
|
60
|
+
`ToastService` is `providedIn: 'root'`, so the `toast` section resolves only at the root injector —
|
|
61
|
+
a route-level `provideDsConfig` cannot narrow it, unlike every other section.
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- **Toast and table class internals moved again — only matters if you SUBCLASS one of them.**
|
|
66
|
+
Every name here is a `private` or `protected` internal, not public API and not a signal, but
|
|
67
|
+
`private` collides with TS2415 exactly as a public name does, so a member of yours sharing one
|
|
68
|
+
still stops the build. `ToastComponent` **lost `role`** — the component no longer sets one, so
|
|
69
|
+
an `override role` overrides nothing. `ToastRegionComponent` gained `leaveTimers`,
|
|
70
|
+
`slideNeighbours`, `toastNodes`, `measureTops` and `leaveDuration`, and **renamed
|
|
71
|
+
`promoteFromQueue` to `drainQueue`**; an override of the old name now runs never, so move it.
|
|
72
|
+
`ToastService` gained `announcer`, `pendingAnnouncements`, `pendingAssertive`, `announceTimer`,
|
|
73
|
+
`scrimWatcher`, `announce` and `keepAboveScrims`, and **lost `position`** with the token it
|
|
74
|
+
read. `TableComponent` gained `eventsAtExport`,
|
|
75
|
+
`eventMessages`, `tableHead`, `hostElement` and `announceExport`; its inputs, outputs, models
|
|
76
|
+
and exported types are unchanged. `BannerComponent` and `AlertComponent` each gained
|
|
77
|
+
`announce`, and their `ariaRole` and `ariaLive` now return `null` as well — a subclass that
|
|
78
|
+
narrowed either type back, or code that assumed the getter is never null, stops compiling.
|
|
79
|
+
The compiler enumerates every collision, so building after the upgrade is the whole check.
|
|
80
|
+
|
|
81
|
+
- **The stack no longer jumps when a toast is added.** Its neighbours are put back where they were
|
|
82
|
+
with a `transform` and released, so the re-stack runs on the compositor instead of the browser
|
|
83
|
+
moving them all in one frame. Two new tokens tune it: `--ds-toast-shift-duration` (default
|
|
84
|
+
`--duration-fast`) and `--ds-toast-shift-easing`. A dismissal keeps its own, longer timing — a
|
|
85
|
+
re-stack and a leave are different motions.
|
|
86
|
+
|
|
87
|
+
### Fixed
|
|
88
|
+
|
|
89
|
+
- **A click between a boolean control and its label hit nothing.** `ds-radio`, `ds-checkbox` and
|
|
90
|
+
`ds-switch` set the space between control and label with a flex `gap`, which belongs to neither
|
|
91
|
+
box — so the 8px strip between them swallowed the click instead of toggling. That space is now
|
|
92
|
+
padding on the label, which extends its clickable box across the strip: the target grows from
|
|
93
|
+
18px to 26px tall while the text's start position and the row height stay put. No API or token
|
|
94
|
+
change.
|
|
95
|
+
|
|
96
|
+
- **`ds-table`'s bulk-actions bar rendered its buttons invisible.** The bar is an inverted
|
|
97
|
+
surface, and its buttons were coloured through a bare `.button` rule that stopped applying once
|
|
98
|
+
the button became `ds-button` — which takes its label from `--ds-button-label-color` and ignores
|
|
99
|
+
inherited `color`, so the label sat on the bar's own colour and disappeared. The bar now sets
|
|
100
|
+
ds-button's public tokens for an inverted surface: label to `--text-inverted`, background to
|
|
101
|
+
`transparent`, and hover and active backgrounds to `--surface-inverted-hover`. No new token —
|
|
102
|
+
these are ds-button's existing hooks.
|
|
103
|
+
|
|
104
|
+
- **The skeleton shimmer stepped instead of sweeping, on any page but a light one.** The travel was
|
|
105
|
+
`--skeleton-shimmer-x`, one animated, registered, INHERITED custom property on `:root` that
|
|
106
|
+
every skeleton read through `mask-position`. A registered custom property is a computed value, so changing it invalidated
|
|
107
|
+
style for the ENTIRE document on every frame and then repainted — fine on the docs site, visibly
|
|
108
|
+
jerky inside a heavy host application. The animation moved onto each skeleton's own band,
|
|
109
|
+
animating `mask-position` per element; `--skeleton-shimmer-x` and the `:root` animation that drove
|
|
110
|
+
it are gone, so anything that referenced it now resolves to nothing. The trade is that a skeleton mounted mid-cycle starts its own pass instead
|
|
111
|
+
of joining the one in flight; the old lock-step was never viewport-anchored anyway, because
|
|
112
|
+
`mask-position` is measured from the host's own box.
|
|
113
|
+
- **A focused row drew TWO rings, and neither was the focus colour.** `ds-list-item`, `ds-tree`,
|
|
114
|
+
`ds-tag`, `ds-description-list` and `ds-color-picker` each drew their own `outline` on
|
|
115
|
+
`:focus-visible` while the blanket `:where(:focus-visible)` shadow kept painting under it — an
|
|
116
|
+
accent halo outside, their own outline inside. Worse, that outline asked for
|
|
117
|
+
`--focus-ring-color`, which **nothing defined**, so all seven call sites fell through to
|
|
118
|
+
`currentColor` and ringed themselves in their own text colour: near-black on a list row, grey on
|
|
119
|
+
a tree node. The token is defined now, from the same hue channels as the ring's outer halo, and
|
|
120
|
+
the seven sites share a `focus.outline-indicator` mixin that silences the shadow. The colour is
|
|
121
|
+
`--accent`, so it is the brand hue by default and the family's hue inside a `ds-color` zone —
|
|
122
|
+
measured: `hsl(229 100% 59%)` outside, `hsl(0 75% 49%)` under `[ds-color="error"]`. Override it
|
|
123
|
+
per brand with `--focus-ring-color`.
|
|
124
|
+
- **A selected `ds-list-item` or `ds-tree` node retinted its label and left its icon behind.**
|
|
125
|
+
On the list the icon stayed on its resting colour beside an accent label; on the tree the row
|
|
126
|
+
set `color` correctly but `.node-icon` declared its own and won. Both follow the label now,
|
|
127
|
+
through new
|
|
128
|
+
`--ds-list-item-selected-icon-color` / `--ds-tree-row-selected-icon-color` hooks that default to
|
|
129
|
+
the selected label colour.
|
|
130
|
+
- **`ds-avatar-group` and `ds-button-group` styled their children by tag name, so a host that
|
|
131
|
+
renames the tag got neither.** Both pierced encapsulation with `::ng-deep ds-avatar` /
|
|
132
|
+
`::ng-deep ds-button`. Measured through the custom-element build, where a tag nested inside
|
|
133
|
+
another component's template has to be renamed (angular/angular#24536), all three
|
|
134
|
+
avatars came back `margin-left: 0` with no ring, and the joined buttons lost their overlap
|
|
135
|
+
margin and every flattened radius. They match the direct child now, so the grouping holds whatever the child is rendered
|
|
136
|
+
as. Computed output in an ordinary Angular app is unchanged — verified identical before and
|
|
137
|
+
after.
|
|
138
|
+
|
|
139
|
+
- **Six connected-panel tokens did nothing when scoped to one picker.** `--ds-option-padding`,
|
|
140
|
+
`-gap`, `-radius`, `-row-gap`, `--ds-option-bg-color-active` and `--ds-dropdown-panel-maxh` are read
|
|
141
|
+
on the panel, which the CDK portals outside the component, so they only ever resolved from a global
|
|
142
|
+
declaration: `ds-select { --ds-option-padding: … }` was silently ignored while
|
|
143
|
+
`ds-select { --ds-dropdown-panel-radius: … }` beside it worked, because that one was on the
|
|
144
|
+
forwarded list and these were not. They join the shared list every connected picker forwards, so the
|
|
145
|
+
family behaves one way. `--ds-dropdown-panel-maxh` was also the one token `ds-autocomplete` forwarded
|
|
146
|
+
and its two siblings did not. Nothing moves unless you had written one of these on an element, where
|
|
147
|
+
it now takes effect — if you reached for a global declaration because the scoped one did nothing, the
|
|
148
|
+
scoped one is the narrower fix.
|
|
149
|
+
|
|
150
|
+
- **`ds-split-button`'s hover left its label unreadable inside a status zone.** The hover background defaulted to the family's readable ON-TINT colour — the one meant for text on light surfaces — and this was the only place in the library using it as a background, so the label landed at 1.87:1 on `success` in dark and 2.46:1 on `error`. It now defaults to `--accent-hover`, the family base mixed toward black in light and white in dark, so the hover follows the rest state instead of jumping to another hue: error 5.94 light / 4.22 dark, success 4.17 / 2.85, warning 9.11 / 12.31. `--ds-split-button-bg-hover-color` still overrides it.
|
|
151
|
+
|
|
152
|
+
This does not close the whole problem. The label colour on a family's solid background already falls below 4.5:1 at REST for `success` (3.30) and `secondary` (3.31), in both themes and on every solid button — a palette question, not this component's.
|
|
153
|
+
|
|
154
|
+
- **A chip row could drop a chip, or fail to, when the field sat in a box that sizes itself to its content.** The budget for how many chips fit comes off the trigger's parent, which is only a fixed quantity while that parent takes its width from somewhere else. A parent at `fit-content`, an `inline-block` one, or a flex item that cannot grow all take their width from the chips instead, so the cut was reading back its own result. The parent is now asked whether its width depends on the trigger, and the trigger's own width is used only when it cannot answer. Affects `ds-multi-select` and `ds-autocomplete`.
|
|
155
|
+
|
|
156
|
+
- **Eight defects the two-wave review confirmed and nobody had acted on.** The toast region and its
|
|
157
|
+
service never tore anything down, so every pending timer fired into a destroyed component — harmless
|
|
158
|
+
in a long-lived app, a stream of "N timers still in the queue" in a consumer's `fakeAsync` tests. The
|
|
159
|
+
180 ms leave timer was untracked and survived `dismissAll()`. `remove()` had no existence guard, so a
|
|
160
|
+
stale `ToastRef.dismiss()` ran the whole leave path on an id nothing held. `LEAVE_DURATION_MS` was
|
|
161
|
+
hardcoded against `--ds-toast-leave-duration`, a public token: the leave length is now READ off the
|
|
162
|
+
node, measured at 964 ms with the token set to 900, where it used to be 180 whatever the consumer
|
|
163
|
+
asked for. Raising `maxVisible` at runtime promoted nothing until the next dismissal; promotion is a
|
|
164
|
+
drain loop now. A negative `maxVisible` said the opposite of what it did and warns in dev. The
|
|
165
|
+
spinner inside a `loading` toast carried its own `role="status"`, which — now that announcements have
|
|
166
|
+
moved to the announcer — was the only live node left in there, so it is `aria-hidden`. And
|
|
167
|
+
`ToastPromiseMessages` is generic, so `promise<T>` stops discarding `T` and a `success` callback
|
|
168
|
+
receives the resolved value instead of `unknown`.
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
- **A modal, drawer, confirm or bottom sheet opened after a toast covered it and swallowed its action
|
|
172
|
+
button.** `--layer-toast: 1500` could not prevent it and never could: CDK 21 gives every overlay host
|
|
173
|
+
`popover="manual"` and calls `showPopover()`, so hosts live in the browser's top layer, which paints
|
|
174
|
+
strictly in the order things were shown and ignores z-index and stacking contexts. The toast host is
|
|
175
|
+
now re-shown when a scrimmed overlay appears, which is the only thing that moves it back to the
|
|
176
|
+
front. Measured before and after on the same probe: the scrim was the topmost element at the toast's
|
|
177
|
+
centre, and is not any more.
|
|
178
|
+
|
|
179
|
+
Only *scrimmed* overlays trigger it. A tooltip or dropdown neither covers the toast meaningfully nor
|
|
180
|
+
eats a click, and the documented scale deliberately puts `--layer-tooltip` above the toast.
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
- **Typing on a CLOSED `ds-select` did nothing.** Type-ahead landed with the jump wired only for
|
|
184
|
+
an open panel: the closed branch of the key handler returned before reaching it, so a letter
|
|
185
|
+
pressed on a collapsed trigger neither jumped nor committed. It now commits the first
|
|
186
|
+
matching option without opening the panel — `value` is a `model`, so `valueChange` fires —
|
|
187
|
+
the way a native `<select>` does; a key that matches nothing is ignored.
|
|
188
|
+
- **A `ds-table` loading scrim covered the top of the first row, or overlapped the header.**
|
|
189
|
+
Its top edge assumed a 40px header. The header is 42.89px at the default density and
|
|
190
|
+
26.89px under `[data-density="ultra-compact"]`, so it cut 2.89px into the header normally
|
|
191
|
+
and started 13.11px too low under that density, where the first row showed through it. The
|
|
192
|
+
header is measured now, so the edge lands on it at every density and at any header font size
|
|
193
|
+
you set. `--ds-table-head-h` still overrides it if you set that, which you should no longer
|
|
194
|
+
need to.
|
|
195
|
+
- **One export left `ds-table`'s live region stuck for the rest of the page's life.** The export
|
|
196
|
+
status outranked the sort, row-range and row-expansion lines and was never cleared, so from the
|
|
197
|
+
first export onwards a screen reader heard "Export ready" and nothing else: every later sort,
|
|
198
|
+
page change and bulk expansion was swallowed. The export line now holds the region only until
|
|
199
|
+
one of those lines has something new to say, so "Export failed" still stands until the reader
|
|
200
|
+
moves on, and everything after it is announced again.
|
|
201
|
+
|
|
11
202
|
## 0.11.3 — 2026-09-02
|
|
12
203
|
|
|
13
204
|
### Breaking
|
|
@@ -2855,6 +3046,15 @@ genuine gap worth reporting.
|
|
|
2855
3046
|
- **Fields no longer expose a `protected messageState`;** the resolved `message` (text + state) and
|
|
2856
3047
|
`invalidResolved` replace it. Only reachable by subclassing a field component, which is not a
|
|
2857
3048
|
supported extension point, but noted for parity with the class-member changes in 0.7.0.
|
|
3049
|
+
- **The `ds-time-picker` panel lost its corner radius.** It had drawn `--radius-md` (8px) while every
|
|
3050
|
+
other floating surface — popovers, cards, modals and `ds-date-picker`'s own calendar — resolves the panel
|
|
3051
|
+
role. The move onto that role reads a private `:host` token, which a CDK-portaled panel cannot see, so
|
|
3052
|
+
`border-radius` resolves to its initial `0` and the panel renders SQUARE. The new
|
|
3053
|
+
`--ds-time-picker-panel-radius` hook is inert for the same reason. Force the corner back with a global
|
|
3054
|
+
`.cdk-overlay-container { --_time-picker-panel-radius: var(--radius-md); }`. It declares the
|
|
3055
|
+
private token the panel already reads on an ancestor the panel DOES have, so it inherits down;
|
|
3056
|
+
fighting the component’s own rule with a selector is not needed. A rule scoped under
|
|
3057
|
+
`ds-time-picker` cannot reach the portaled panel at all. The trigger's radius is untouched.
|
|
2858
3058
|
|
|
2859
3059
|
### Fixed
|
|
2860
3060
|
|
|
@@ -2890,16 +3090,6 @@ genuine gap worth reporting.
|
|
|
2890
3090
|
layout's open rail instead of beneath it. The host now sets `isolation: isolate`, giving each
|
|
2891
3091
|
`ds-app-layout` its own stacking context — the same fix `ds-drawer` already carries. Nothing changes
|
|
2892
3092
|
for a full-viewport shell with no layout embedded inside it.
|
|
2893
|
-
- **The `ds-time-picker` panel drew the CONTROL radius, so it did not match the date picker beside it.**
|
|
2894
|
-
Its dropdown was the one floating panel left on `--radius-md` (8px) while every other surface — menus,
|
|
2895
|
-
popovers, cards, modals, and `ds-date-picker`'s own calendar — resolves the panel role. Two pickers in
|
|
2896
|
-
one form therefore rendered different corners. The panel now reads
|
|
2897
|
-
`var(--ds-time-picker-panel-radius, var(--ds-radius-panel))`, which is 12px, and the new hook is
|
|
2898
|
-
FORWARDED onto the portaled pane — a token declared without being forwarded is dead for per-instance
|
|
2899
|
-
overrides, which is exactly the `--ds-overlay-enter-scale` bug fixed elsewhere in this release. It was
|
|
2900
|
-
also the only property on that element without a hook, since fill, border and shadow all had one.
|
|
2901
|
-
Restore the old corner with `ds-time-picker { --ds-time-picker-panel-radius: var(--radius-md); }`; the
|
|
2902
|
-
trigger's radius is untouched.
|
|
2903
3093
|
- **A path change that only mirrors the reader's position no longer resets the content scroll.** A docs shell whose scroll spy rewrites `/area/section` as the user scrolls hit a loop: the rewrite looked like a page change, the layout scrolled to top, the spy saw the first section again and rewrote the path back. Such a navigation must now carry `state: { dsSamePage: true }`, which the layout skips for both the scroll reset and the rail close. Read from `Router.lastSuccessfulNavigation()` — `getCurrentNavigation()` is already cleared when `NavigationEnd` reaches a subscriber.
|
|
2904
3094
|
- **Closing the rail by NAVIGATING no longer pulls focus back to the burger.** Restoring focus to the trigger is right for a dismissal — Escape, the scrim — and wrong for a link: the reader activated it, so focus belongs wherever the router put it, and handing it back announced "Open navigation" instead of the page they asked for. Dismissal keeps the restore; the navigation and breakpoint paths now clear `railOpen` directly. The breakpoint path had also depended on `compact` being written one line earlier to avoid focusing a trigger that is hidden on desktop — that ordering trap is gone with it.
|
|
2905
3095
|
- **A closed compact `ds-app-layout` rail no longer holds focus behind the screen.** Below the
|
package/components.md
CHANGED
|
@@ -587,14 +587,22 @@ this.crumbs.clear();
|
|
|
587
587
|
- `promise<T>(source: Promise<T>, messages: ToastPromiseMessages): Promise<T>` — shows a `loading` toast, then patches it in place to `success` or `error` when `source` settles. Returns `source` itself, so an un-`catch`ed call still produces an unhandled rejection. The settled toast dismisses after a hard-coded 4s (success) or 6s (error), counted from the moment it becomes visible and not overridable; `dismissAll()` cancels it like any other.
|
|
588
588
|
- `dismissAll(): void`
|
|
589
589
|
|
|
590
|
-
Defaults
|
|
591
|
-
- `
|
|
592
|
-
- `
|
|
590
|
+
Defaults come from `provideDsConfig({ toast: … })`:
|
|
591
|
+
- `maxVisible?: number` — cap on concurrently visible toasts. Default `5`; `0` means unlimited. Extras queue and appear as earlier ones dismiss.
|
|
592
|
+
- `position?: { horizontalPosition?: 'left' | 'center' | 'right', verticalPosition?: 'top' | 'bottom', offset?: string }` — merged field by field over `right` / `top` / `var(--space-6)`, so naming one key keeps the other two.
|
|
593
593
|
|
|
594
|
-
|
|
594
|
+
The `toast` section resolves **once, at the root injector**, when the service is first used — unlike every other section, which a `Route` or a component can narrow. `ToastService` is `providedIn: 'root'`, so a route-level `provideDsConfig` never reaches it, and the position cannot change after the first `show()`.
|
|
595
595
|
|
|
596
596
|
On first `show()` the service lazily creates a CDK overlay and mounts a `<ds-toast-region>` into it. **Do not place `<ds-toast-region>` yourself** — the service only ever talks to the instance it created, so a hand-placed one is an invisible empty box that never receives a toast, with no warning. It appears in the generated API table only because the extractor lists every exported component.
|
|
597
597
|
|
|
598
|
+
#### `BodyScrollLockService`
|
|
599
|
+
|
|
600
|
+
`@Injectable({ providedIn: 'root' })`. Ref-counted lock on `document.body` scroll, shared by every overlay that covers the viewport — `ds-modal`, `ds-drawer`, `ds-bottom-sheet` all take one. Exported since 0.7.0 so a consumer's own full-screen overlay can participate in the same lock instead of fighting it.
|
|
601
|
+
- `lock(): void` — the FIRST call saves the current `body` overflow and hides it.
|
|
602
|
+
- `unlock(): void` — only the LAST one restores it, so closing one overlay cannot re-enable page scroll under another still open above it.
|
|
603
|
+
|
|
604
|
+
Calls must be paired: one `unlock()` per `lock()`. An unmatched `unlock()` is a no-op rather than an error, so a leaked `lock()` leaves the page unscrollable with nothing to show why.
|
|
605
|
+
|
|
598
606
|
---
|
|
599
607
|
|
|
600
608
|
## Migration tips
|
package/docs/agent/INDEX.md
CHANGED
|
@@ -87,6 +87,7 @@ and token names.** These leaves are for orientation and usage.
|
|
|
87
87
|
- [DS_CONFIG / provideDsConfig(config)](platform/ds-config.md) — Inject DS_CONFIG token (default factory returns {}) to set library-wide defaults that consumer-level component
|
|
88
88
|
- [BreadcrumbsService](platform/breadcrumbs-service.md) — @Injectable({ providedIn: 'root' }). Signal-based state primitive — apps push crumbs, <ds-breadcrumbs> reads f
|
|
89
89
|
- [ToastService](platform/toast-service.md) — @Injectable({ providedIn: 'root' }). Inject and call:
|
|
90
|
+
- [BodyScrollLockService](platform/body-scroll-lock-service.md) — @Injectable({ providedIn: 'root' }). Ref-counted lock on document.body scroll, shared by every overlay that co
|
|
90
91
|
|
|
91
92
|
## surfaces
|
|
92
93
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- GENERATED by tools/split-agent-catalogue.mjs from components.md. Do not edit. -->
|
|
2
|
+
# `BodyScrollLockService`
|
|
3
|
+
|
|
4
|
+
Section: Services
|
|
5
|
+
|
|
6
|
+
`@Injectable({ providedIn: 'root' })`. Ref-counted lock on `document.body` scroll, shared by every overlay that covers the viewport — `ds-modal`, `ds-drawer`, `ds-bottom-sheet` all take one. Exported since 0.7.0 so a consumer's own full-screen overlay can participate in the same lock instead of fighting it.
|
|
7
|
+
- `lock(): void` — the FIRST call saves the current `body` overflow and hides it.
|
|
8
|
+
- `unlock(): void` — only the LAST one restores it, so closing one overlay cannot re-enable page scroll under another still open above it.
|
|
9
|
+
|
|
10
|
+
Calls must be paired: one `unlock()` per `lock()`. An unmatched `unlock()` is a no-op rather than an error, so a leaked `lock()` leaves the page unscrollable with nothing to show why.
|
|
11
|
+
|
|
12
|
+
---
|
|
@@ -8,12 +8,10 @@ Section: Services
|
|
|
8
8
|
- `promise<T>(source: Promise<T>, messages: ToastPromiseMessages): Promise<T>` — shows a `loading` toast, then patches it in place to `success` or `error` when `source` settles. Returns `source` itself, so an un-`catch`ed call still produces an unhandled rejection. The settled toast dismisses after a hard-coded 4s (success) or 6s (error), counted from the moment it becomes visible and not overridable; `dismissAll()` cancels it like any other.
|
|
9
9
|
- `dismissAll(): void`
|
|
10
10
|
|
|
11
|
-
Defaults
|
|
12
|
-
- `
|
|
13
|
-
- `
|
|
11
|
+
Defaults come from `provideDsConfig({ toast: … })`:
|
|
12
|
+
- `maxVisible?: number` — cap on concurrently visible toasts. Default `5`; `0` means unlimited. Extras queue and appear as earlier ones dismiss.
|
|
13
|
+
- `position?: { horizontalPosition?: 'left' | 'center' | 'right', verticalPosition?: 'top' | 'bottom', offset?: string }` — merged field by field over `right` / `top` / `var(--space-6)`, so naming one key keeps the other two.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The `toast` section resolves **once, at the root injector**, when the service is first used — unlike every other section, which a `Route` or a component can narrow. `ToastService` is `providedIn: 'root'`, so a route-level `provideDsConfig` never reaches it, and the position cannot change after the first `show()`.
|
|
16
16
|
|
|
17
17
|
On first `show()` the service lazily creates a CDK overlay and mounts a `<ds-toast-region>` into it. **Do not place `<ds-toast-region>` yourself** — the service only ever talks to the instance it created, so a hand-placed one is an invisible empty box that never receives a toast, with no warning. It appears in the generated API table only because the extractor lists every exported component.
|
|
18
|
-
|
|
19
|
-
---
|