@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
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.11.4",
|
|
3
|
+
"items": [
|
|
4
|
+
{
|
|
5
|
+
"id": "toast-promise-messages-generic",
|
|
6
|
+
"kind": "type-rename",
|
|
7
|
+
"old": "ToastPromiseMessages",
|
|
8
|
+
"new": "ToastPromiseMessages<T>",
|
|
9
|
+
"appliesWhen": "You name the type explicitly, e.g. in a variable or a helper that builds the messages object. Calling toast.promise(p, {...}) inline needs no change - T is inferred.",
|
|
10
|
+
"pitfall": "The parameter defaults to unknown, so an un-parameterised annotation still compiles - and still hands your success callback `unknown`, which is the defect. Passing the type is what fixes it, not the compile.",
|
|
11
|
+
"searchHints": [
|
|
12
|
+
"ToastPromiseMessages"
|
|
13
|
+
],
|
|
14
|
+
"surface": "typescript",
|
|
15
|
+
"detect": [
|
|
16
|
+
"ToastPromiseMessages"
|
|
17
|
+
],
|
|
18
|
+
"verify": "A success callback receives the resolved value with its real type: toast.promise(loadOrder(), { success: (order) => `Saved #${order.id}` }) compiles without a cast.",
|
|
19
|
+
"restore": null,
|
|
20
|
+
"note": "promise<T> declared a type parameter and then threw it away, because the messages interface hardcoded unknown. Every call site that wanted the resolved value had to cast.",
|
|
21
|
+
"action": "Annotate as ToastPromiseMessages<T> where you name the type; inline object literals need no change."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "toast-message-input-renamed-body",
|
|
25
|
+
"kind": "input-rename",
|
|
26
|
+
"old": "message",
|
|
27
|
+
"new": "body",
|
|
28
|
+
"appliesWhen": "You render <ds-toast> yourself and bind message. ToastService callers pass body already and change nothing.",
|
|
29
|
+
"pitfall": "An unknown input on a component is a template error under strictTemplates, but a plain attribute is not - message=\"…\" without brackets keeps compiling and silently renders an empty toast.",
|
|
30
|
+
"searchHints": [
|
|
31
|
+
"ds-toast",
|
|
32
|
+
"message"
|
|
33
|
+
],
|
|
34
|
+
"surface": "template",
|
|
35
|
+
"detect": [
|
|
36
|
+
"[message]",
|
|
37
|
+
"message="
|
|
38
|
+
],
|
|
39
|
+
"verify": "A hand-placed <ds-toast [body]=\"…\"> renders its text; nothing in your templates still binds message on ds-toast.",
|
|
40
|
+
"restore": null,
|
|
41
|
+
"note": "ToastOptions and ToastEntry always called the text body; only the component input said message, so one concept had two names either side of the same service.",
|
|
42
|
+
"action": "Rename the ds-toast input from message to body."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "toast-border-tokens-gain-color",
|
|
46
|
+
"kind": "token-rename",
|
|
47
|
+
"old": "--ds-toast-border, --ds-toast-border-info, --ds-toast-border-success, --ds-toast-border-warning, --ds-toast-border-error",
|
|
48
|
+
"new": "--ds-toast-border-color, --ds-toast-border-color-info, --ds-toast-border-color-success, --ds-toast-border-color-warning, --ds-toast-border-color-error",
|
|
49
|
+
"appliesWhen": "You set any of the five anywhere - :root, a theme file, or a per-instance ds-toast block.",
|
|
50
|
+
"pitfall": "The old name simply stops resolving, and the declaration it sits in is dropped whole - so a toast loses its border rather than falling back to a default. Nothing errors.",
|
|
51
|
+
"searchHints": [
|
|
52
|
+
"ds-toast-border"
|
|
53
|
+
],
|
|
54
|
+
"surface": "style",
|
|
55
|
+
"detect": [
|
|
56
|
+
"--ds-toast-border"
|
|
57
|
+
],
|
|
58
|
+
"verify": "A :root override of --ds-toast-border-color repaints the toast border, and no rule in your styles still names --ds-toast-border.",
|
|
59
|
+
"restore": null,
|
|
60
|
+
"note": "They are colours, and every other border token in the library already carries -color. These five were the last holdouts of the pre-rename naming.",
|
|
61
|
+
"action": "Add -color after -border in all five token names."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "banner-alert-announce-opt-in",
|
|
65
|
+
"kind": "behavior",
|
|
66
|
+
"old": "role and aria-live always present",
|
|
67
|
+
"new": null,
|
|
68
|
+
"appliesWhen": "You rely on a ds-banner or ds-alert being announced by a screen reader when it appears. A banner that is page furniture needs no change - silence is now the correct behaviour for it.",
|
|
69
|
+
"pitfall": "Nothing breaks visibly and no build fails, so a regression here is invisible without a screen reader: an app that raised an error banner in response to a request and relied on the alert firing now shows it silently.",
|
|
70
|
+
"searchHints": [
|
|
71
|
+
"ds-banner",
|
|
72
|
+
"ds-alert"
|
|
73
|
+
],
|
|
74
|
+
"surface": "template",
|
|
75
|
+
"detect": [
|
|
76
|
+
"ds-banner",
|
|
77
|
+
"ds-alert"
|
|
78
|
+
],
|
|
79
|
+
"verify": "A banner your app raises in response to an event carries announce and is spoken; a static strip carries none and is silent on route change.",
|
|
80
|
+
"restore": "Pass [announce]=\"true\" to get the previous behaviour on a given instance.",
|
|
81
|
+
"note": "An alert region fires on insertion, so a statically-placed strip interrupted the reader on every client-side route into its page - 12 such regions on this library's own docs. MDN advises against alert on content the user has not interacted with, and the DS convention is that a new capability is off by default.",
|
|
82
|
+
"action": "Add [announce]=\"true\" to any ds-banner or ds-alert that should be announced when it appears."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "toast-config-token-removed",
|
|
86
|
+
"kind": "removed-api",
|
|
87
|
+
"old": "DS_TOAST_CONFIG",
|
|
88
|
+
"new": "provideDsConfig({ toast: { maxVisible: 5 } })",
|
|
89
|
+
"appliesWhen": "You provide DS_TOAST_CONFIG anywhere - app.config.ts, a Route's providers, or a component's.",
|
|
90
|
+
"pitfall": "The import stops resolving, so this one fails the build rather than going quiet. The DsToastConfig interface went with the token.",
|
|
91
|
+
"searchHints": [
|
|
92
|
+
"DS_TOAST_CONFIG",
|
|
93
|
+
"DsToastConfig",
|
|
94
|
+
"maxVisible"
|
|
95
|
+
],
|
|
96
|
+
"surface": "typescript",
|
|
97
|
+
"detect": [
|
|
98
|
+
"DS_TOAST_CONFIG"
|
|
99
|
+
],
|
|
100
|
+
"verify": "Raising more toasts at once than the cap queues the extras, with the cap read from provideDsConfig and no token provider left in the app.",
|
|
101
|
+
"restore": null,
|
|
102
|
+
"note": "The two toast tokens were the only configuration in the library that did not go through DsConfig, so an app set thirteen other areas in one provideDsConfig call and then remembered two bare InjectionToken providers for toasts.",
|
|
103
|
+
"action": "Replace the { provide: DS_TOAST_CONFIG, useValue: { maxVisible: n } } provider with provideDsConfig({ toast: { maxVisible: n } }), and drop the DS_TOAST_CONFIG and DsToastConfig imports."
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "toast-position-token-removed",
|
|
107
|
+
"kind": "removed-api",
|
|
108
|
+
"old": "DS_TOAST_POSITION",
|
|
109
|
+
"new": "provideDsConfig({ toast: { position: { verticalPosition: 'bottom' } } })",
|
|
110
|
+
"appliesWhen": "You provide DS_TOAST_POSITION to move the stack off its default top-right corner.",
|
|
111
|
+
"pitfall": "The import stops resolving, so the build fails rather than the toasts quietly moving. DS_TOAST_POSITION_DEFAULT is unchanged and still exported.",
|
|
112
|
+
"searchHints": [
|
|
113
|
+
"DS_TOAST_POSITION",
|
|
114
|
+
"horizontalPosition",
|
|
115
|
+
"verticalPosition"
|
|
116
|
+
],
|
|
117
|
+
"surface": "typescript",
|
|
118
|
+
"detect": [
|
|
119
|
+
"DS_TOAST_POSITION"
|
|
120
|
+
],
|
|
121
|
+
"verify": "A toast appears at the corner named in provideDsConfig, and naming only verticalPosition keeps the default horizontal side and offset.",
|
|
122
|
+
"restore": null,
|
|
123
|
+
"note": "position is now partial and merged field by field over right / top / var(--space-6). The old token's type required all three fields, so moving the stack to the bottom meant restating the other two; naming one key is now enough.",
|
|
124
|
+
"action": "Replace the { provide: DS_TOAST_POSITION, useValue: {...} } provider with provideDsConfig({ toast: { position: {...} } }), keeping only the fields you actually change."
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "toast-max-visible-default-5",
|
|
128
|
+
"kind": "behavior",
|
|
129
|
+
"old": "provideDsConfig without a toast.maxVisible",
|
|
130
|
+
"new": null,
|
|
131
|
+
"appliesWhen": "You raise more than five toasts at once and expect every one to be on screen together. An app that shows one or two at a time needs nothing.",
|
|
132
|
+
"pitfall": "Nothing is dropped and nothing errors, so this reads as toasts \"not appearing\": the sixth is queued and shows as an earlier one dismisses. A cap of 0 is the only way left to ask for an uncapped stack, and 0 no longer means \"unset\" - it is forwarded.",
|
|
133
|
+
"searchHints": [
|
|
134
|
+
"provideDsConfig",
|
|
135
|
+
"maxVisible",
|
|
136
|
+
"ToastService"
|
|
137
|
+
],
|
|
138
|
+
"surface": "config",
|
|
139
|
+
"detect": [
|
|
140
|
+
"maxVisible"
|
|
141
|
+
],
|
|
142
|
+
"verify": "Raise six toasts at once: with maxVisible 0 all six are on screen, and with the default five are, the sixth arriving as one dismisses.",
|
|
143
|
+
"restore": "Pass provideDsConfig({ toast: { maxVisible: 0 } }).",
|
|
144
|
+
"note": "The default moved from unlimited to 5. A negative value means unlimited too and warns in development, because 0 already says it.",
|
|
145
|
+
"action": "Decide whether an uncapped stack was deliberate. If it was, pass provideDsConfig({ toast: { maxVisible: 0 } }); otherwise change nothing."
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "toast-standalone-no-longer-announced",
|
|
149
|
+
"kind": "behavior",
|
|
150
|
+
"old": "<ds-toast>",
|
|
151
|
+
"new": null,
|
|
152
|
+
"appliesWhen": "You place <ds-toast> in a template yourself and rely on a screen reader announcing it. Calling ToastService needs nothing - it announces through its own region.",
|
|
153
|
+
"pitfall": "The toast still renders and still looks right, so nothing signals the loss; only a screen reader shows it, and only for the markup you placed by hand.",
|
|
154
|
+
"searchHints": [
|
|
155
|
+
"<ds-toast",
|
|
156
|
+
"ds-toast",
|
|
157
|
+
"aria-live",
|
|
158
|
+
"role=\"alert\"",
|
|
159
|
+
"role=\"status\""
|
|
160
|
+
],
|
|
161
|
+
"surface": "template",
|
|
162
|
+
"detect": [
|
|
163
|
+
"<ds-toast"
|
|
164
|
+
],
|
|
165
|
+
"verify": "A hand-placed <ds-toast> carries no role or aria-live in the DOM, and a toast raised through ToastService is announced once.",
|
|
166
|
+
"restore": null,
|
|
167
|
+
"note": "<ds-toast> no longer sets role, aria-live or aria-atomic: a node created with its text already inside it is the case screen readers do not announce, so announcing moved to a region that exists first. The markup is a specimen.",
|
|
168
|
+
"action": "Raise anything that should be announced through ToastService. Keep <ds-toast> in a template only for a static specimen, or add your own live region around it."
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "toast-table-subclass-members-moved",
|
|
172
|
+
"kind": "behavior",
|
|
173
|
+
"old": "class MyThing extends ToastComponent | ToastRegionComponent | ToastService | TableComponent | BannerComponent | AlertComponent",
|
|
174
|
+
"new": null,
|
|
175
|
+
"appliesWhen": "Only a class that extends one of those six. Template users and service callers need nothing.",
|
|
176
|
+
"pitfall": "Every new name is private or protected, which is no protection - a redeclared private fails with TS2415 exactly as a public collision does. And an `override promoteFromQueue` or `override role` now overrides nothing: it compiles clean and silently never runs.",
|
|
177
|
+
"searchHints": [
|
|
178
|
+
"extends ToastComponent",
|
|
179
|
+
"extends ToastRegionComponent",
|
|
180
|
+
"extends ToastService",
|
|
181
|
+
"extends TableComponent",
|
|
182
|
+
"promoteFromQueue",
|
|
183
|
+
"override role",
|
|
184
|
+
"TS2415",
|
|
185
|
+
"TS4114",
|
|
186
|
+
"extends BannerComponent",
|
|
187
|
+
"extends AlertComponent"
|
|
188
|
+
],
|
|
189
|
+
"surface": "typescript",
|
|
190
|
+
"detect": [
|
|
191
|
+
"extends ToastComponent",
|
|
192
|
+
"extends ToastRegionComponent",
|
|
193
|
+
"extends ToastService",
|
|
194
|
+
"extends TableComponent",
|
|
195
|
+
"override promoteFromQueue",
|
|
196
|
+
"override role",
|
|
197
|
+
"extends BannerComponent",
|
|
198
|
+
"extends AlertComponent"
|
|
199
|
+
],
|
|
200
|
+
"verify": "The app builds with no TS4114 / TS2415 / TS2416 naming any of the six classes, and no override of promoteFromQueue, role or message remains in your source.",
|
|
201
|
+
"restore": null,
|
|
202
|
+
"note": "ToastComponent lost `role`. ToastRegionComponent gained `leaveTimers`, `slideNeighbours`, `toastNodes`, `measureTops` and `leaveDuration`, and renamed `promoteFromQueue` to `drainQueue`. ToastService gained `announcer`, `pendingAnnouncements`, `pendingAssertive`, `announceTimer`, `scrimWatcher`, `announce` and `keepAboveScrims`. TableComponent gained `eventsAtExport`, `eventMessages`, `tableHead`, `hostElement` and `announceExport`. None is public API or a signal. BannerComponent and AlertComponent each gained `announce`. ToastComponent also gained `body` and lost `message`, which is the input rename listed separately.",
|
|
203
|
+
"action": "Build after upgrading. Rename or mark `override` every member the compiler reports as colliding, and DELETE any `override promoteFromQueue` or `override role` - neither member exists any more, so the override is dead code."
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"id": "banner-alert-aria-getters-nullable",
|
|
207
|
+
"kind": "behavior",
|
|
208
|
+
"old": "protected get ariaRole(): 'alert' | 'status'",
|
|
209
|
+
"new": null,
|
|
210
|
+
"appliesWhen": "Only a class extending BannerComponent or AlertComponent that reads or overrides ariaRole or ariaLive. Nothing in a template sees these.",
|
|
211
|
+
"pitfall": "A widening breaks the READER, not the writer: an override that still declares the narrow return type fails, and code that fed the value somewhere non-nullable fails too, both at a site that did not change.",
|
|
212
|
+
"searchHints": [
|
|
213
|
+
"ariaRole",
|
|
214
|
+
"ariaLive",
|
|
215
|
+
"extends BannerComponent",
|
|
216
|
+
"extends AlertComponent",
|
|
217
|
+
"TS2416"
|
|
218
|
+
],
|
|
219
|
+
"surface": "typescript",
|
|
220
|
+
"detect": [
|
|
221
|
+
"ariaRole",
|
|
222
|
+
"ariaLive"
|
|
223
|
+
],
|
|
224
|
+
"verify": "The app builds with no TS2416 naming ariaRole or ariaLive, and any code consuming either handles null.",
|
|
225
|
+
"restore": null,
|
|
226
|
+
"note": "Both getters widened from `'alert' | 'status'` and `'assertive' | 'polite'` to include `null`, and return null while `announce` is false, which is the default - that is how the attribute is left off entirely rather than set to an empty value.",
|
|
227
|
+
"action": "Widen your own declaration to include null, and handle null wherever you read either getter."
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"informational": [
|
|
231
|
+
"Typing on a closed ds-select now commits the type-ahead jump, as a native <select> does. The path existed but was unreachable, so nothing that worked before changes. NO ACTION.",
|
|
232
|
+
"A chip row's guard against a parent that hugs its content was unreachable and is removed; the measurement is unchanged. NO ACTION.",
|
|
233
|
+
"A queued toast is not lost: it appears as an earlier one dismisses. The stack also animates when a toast is added rather than jumping, and --ds-toast-shift-duration and --ds-toast-shift-easing tune that. NO ACTION.",
|
|
234
|
+
"Info, success and loading toasts raised through ToastService are now announced at all, where before only error and warning were. NO ACTION.",
|
|
235
|
+
"Six tokens the connected panel reads - --ds-option-padding, -gap, -radius, -row-gap, --ds-option-bg-color-active and --ds-dropdown-panel-maxh - now take effect when scoped to one picker (ds-select { ... }), where before only a global declaration reached them. The panel is portaled outside the component, so a host-scoped value arrives only if the token is on the forwarded list, and these six were not; --ds-dropdown-panel-maxh reached ds-autocomplete and neither of its siblings. NO ACTION, and nothing moves on its own: it changes only where such a declaration is already written on an element and was being ignored. If you widened one to a global rule because the scoped form did nothing, the scoped form is now the narrower way to say it.",
|
|
236
|
+
"A click in the strip between a boolean control and its label now toggles the control, where it previously hit nothing. Affects ds-radio, ds-checkbox and ds-switch. The label’s clickable box grew 8px taller; its laid-out size, the text position and the row height are unchanged, so nothing in your layout moves. NO ACTION.",
|
|
237
|
+
"The buttons inside ds-table’s bulk-actions bar are visible again — their label was the same colour as the inverted bar behind it. A pressed state now has a fill where it had none. NO ACTION.",
|
|
238
|
+
"The skeleton shimmer is driven per element instead of by one registered custom property on :root, so skeletons no longer travel in lock-step with one another. The property that drove it, --skeleton-shimmer-x, no longer exists: it was never a --ds-* hook, but if you referenced it, it now resolves to nothing. NO ACTION otherwise."
|
|
239
|
+
],
|
|
240
|
+
"deleteList": []
|
|
241
|
+
}
|
package/migrations/0.8.0.json
CHANGED
|
@@ -154,13 +154,14 @@
|
|
|
154
154
|
"verify": "Every menu that uses ds-menu-divider reads as intended with the line taking one row's place instead of adding a second gap."
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
|
-
"id": "time-picker-panel-
|
|
157
|
+
"id": "time-picker-panel-lost-its-radius",
|
|
158
158
|
"kind": "behavior",
|
|
159
159
|
"old": "ds-time-picker",
|
|
160
160
|
"new": null,
|
|
161
|
-
"action": "None unless
|
|
161
|
+
"action": "None, unless a square dropdown is unacceptable — then apply `restore`.",
|
|
162
162
|
"appliesWhen": "The open dropdown only. The trigger radius is unchanged and still resolves through `--ds-time-picker-trigger-radius`.",
|
|
163
|
-
"note": "The panel
|
|
163
|
+
"note": "The panel renders square, where it drew an 8px corner before. Its rule reads a private token declared on `:host` and the CDK portals the panel out of that host, so the `var()` does not resolve and `border-radius` takes its initial `0`. The public `--ds-time-picker-panel-radius` hook is forwarded onto the pane but read by no rule, so setting it changes nothing.",
|
|
164
|
+
"pitfall": "The obvious override does nothing, and does it silently: `ds-time-picker { --ds-time-picker-panel-radius: … }` cannot reach the panel, the panel being portaled out of that element. Do not reach for a selector instead — a single `.time-panel { border-radius: … }` loses to the component’s own rule, which view encapsulation shims to `.time-panel[_ngcontent-…]`, and matching its two classes only ties, with the tie going to whichever comes later. `restore` declares the PRIVATE token the panel already reads on an ancestor it does have — the CDK overlay container — so it inherits down and no specificity is contested.",
|
|
164
165
|
"searchHints": [
|
|
165
166
|
"ds-time-picker",
|
|
166
167
|
"--ds-time-picker-panel-radius",
|
|
@@ -169,8 +170,8 @@
|
|
|
169
170
|
"time-picker"
|
|
170
171
|
],
|
|
171
172
|
"surface": "style",
|
|
172
|
-
"restore": "
|
|
173
|
-
"verify": "
|
|
173
|
+
"restore": "`.cdk-overlay-container { --_time-picker-panel-radius: var(--radius-md); }`, in a global stylesheet.",
|
|
174
|
+
"verify": "Open the time picker: the panel draws square corners, or the 8px corner if you applied `restore`."
|
|
174
175
|
},
|
|
175
176
|
{
|
|
176
177
|
"id": "focus-partial-needs-use-line",
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// The label of a boolean control is part of its hit area, and the separation between
|
|
2
|
+
// control and label has to live INSIDE that area.
|
|
3
|
+
//
|
|
4
|
+
// A flex `gap` cannot do it: a gap is dead space neither element covers, so a click in
|
|
5
|
+
// those few pixels did nothing. Measured on checkbox/radio/switch — an 8px vertical
|
|
6
|
+
// strip beside every label was inert. The label carries the separation as padding
|
|
7
|
+
// instead, and the block padding widens the target past the text line, cancelled by a
|
|
8
|
+
// negative block margin so no layout moves.
|
|
9
|
+
//
|
|
10
|
+
// Usage — @include inside the label's own selector, and give the row NO gap:
|
|
11
|
+
// @use '../../styles/control-label' as control-label;
|
|
12
|
+
// .control-line { display: flex; align-items: center; } // no gap
|
|
13
|
+
// .control-text { @include control-label.hit-area; }
|
|
14
|
+
@mixin hit-area {
|
|
15
|
+
padding-inline-start: var(--space-2);
|
|
16
|
+
padding-block: var(--space-1);
|
|
17
|
+
margin-block: calc(var(--space-1) * -1);
|
|
18
|
+
}
|
package/styles/_ds-color.scss
CHANGED
|
@@ -30,6 +30,12 @@ $families: secondary, tertiary, error, success, warning;
|
|
|
30
30
|
--accent-focus-ring: var(--focus-ring-#{$family}, var(--focus-ring));
|
|
31
31
|
--accent-focus-field: var(--focus-field-#{$family}, var(--focus-field));
|
|
32
32
|
--accent-surface-tint: var(--#{$family}-subtitle, var(--#{$family}-muted));
|
|
33
|
+
|
|
34
|
+
// Re-declared rather than left to inherit: `--focus-ring-color: var(--accent)` on :root
|
|
35
|
+
// substitutes ON :root, so the brand hue is what reaches this subtree already resolved. The flat
|
|
36
|
+
// outline colour has to be written again where the accent actually changed, or a focused row
|
|
37
|
+
// inside an error zone rings brand-blue while every other accent around it is red.
|
|
38
|
+
--focus-ring-color: var(--#{$family});
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
/// Recolour the DS accent for a type or scope from consumer SCSS, e.g.
|
package/styles/_focus.scss
CHANGED
|
@@ -25,6 +25,22 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// The indicator for something that must ring with an `outline` rather than the shadow — a
|
|
29
|
+
// row inside a clipping list, a swatch in a grid — where the outset halo is eaten by the
|
|
30
|
+
// `overflow` ancestor.
|
|
31
|
+
//
|
|
32
|
+
// `box-shadow: none` is the load-bearing line: the blanket rule above still paints, so five
|
|
33
|
+
// components drew BOTH, an accent halo outside and their own outline inside it.
|
|
34
|
+
//
|
|
35
|
+
// Usage — @include inside the element's own `&:focus-visible` block:
|
|
36
|
+
// @use '../../styles/focus' as focus;
|
|
37
|
+
// &:focus-visible { @include focus.outline-indicator(calc(-1 * var(--border-width-strong))); }
|
|
38
|
+
@mixin outline-indicator($offset: var(--focus-ring-offset)) {
|
|
39
|
+
outline: var(--border-width-strong) solid var(--focus-ring-color);
|
|
40
|
+
outline-offset: $offset;
|
|
41
|
+
box-shadow: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
28
44
|
:root[data-focus='ring'] {
|
|
29
45
|
--ds-field-focus-shadow: var(--focus-ring);
|
|
30
46
|
--ds-field-focus-shadow-error: var(--focus-ring-error);
|
|
@@ -1,32 +1,16 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Reduced-motion opt-out for the skeleton shimmer.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// every other — no per-element animation timers drifting against each other.
|
|
3
|
+
// The travel itself is a per-element animation declared in skeleton.component.scss. Only this rule
|
|
4
|
+
// has to be global: the media query is a document-level preference, and a component stylesheet
|
|
5
|
+
// cannot express "stop wherever a skeleton appears" without one.
|
|
7
6
|
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
syntax: '<length>';
|
|
14
|
-
inherits: true;
|
|
15
|
-
initial-value: 100vw;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:root {
|
|
19
|
-
animation: ds-skeleton-shimmer-loop var(--duration-loop-slow, 1400ms) linear infinite;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@keyframes ds-skeleton-shimmer-loop {
|
|
23
|
-
0% { --skeleton-shimmer-x: 100vw; }
|
|
24
|
-
100% { --skeleton-shimmer-x: -100vw; }
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Honour the user's reduced-motion preference — no shimmer travel.
|
|
7
|
+
// Do NOT drive it from one animated custom property on :root instead, however tempting the
|
|
8
|
+
// phase-lock between skeletons is: a REGISTERED custom property is a computed value, so animating
|
|
9
|
+
// one invalidates the style of every element that could inherit it — the whole document, every
|
|
10
|
+
// frame. And the phase-lock buys no viewport anchoring anyway, because `mask-position` measures
|
|
11
|
+
// from the host's own box.
|
|
28
12
|
@media (prefers-reduced-motion: reduce) {
|
|
29
|
-
|
|
13
|
+
ds-skeleton::after {
|
|
30
14
|
animation: none;
|
|
31
15
|
}
|
|
32
16
|
}
|
package/themes/_semantic.scss
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// =========================================================================
|
|
2
1
|
// Shared role structure — Tier 2 semantic role ASSIGNMENTS.
|
|
3
2
|
//
|
|
4
3
|
// Exposes @mixin roles: the role map whose structure is identical across
|
|
@@ -10,7 +9,6 @@
|
|
|
10
9
|
// This mixin is an authoring-DRY device. At runtime, exactly one theme block
|
|
11
10
|
// matches (`:not([data-theme='dark'])` vs `[data-theme='dark']`), and that
|
|
12
11
|
// block declares the complete token set itself (palette + roles + overrides).
|
|
13
|
-
// =========================================================================
|
|
14
12
|
|
|
15
13
|
@mixin roles {
|
|
16
14
|
/* Surfaces — six-stop scale.
|
|
@@ -219,6 +217,17 @@
|
|
|
219
217
|
--focus-ring-outer-l: var(--primary-l);
|
|
220
218
|
--focus-ring-outer-alpha: 1;
|
|
221
219
|
|
|
220
|
+
/* A flat focus colour, for components that draw an `outline` instead of a shadow (a row
|
|
221
|
+
inside a clipping list, a swatch grid). It must stay DEFINED: an `outline-color` that
|
|
222
|
+
falls through resolves to `currentColor`, so a row rings itself in its own text colour.
|
|
223
|
+
|
|
224
|
+
`--accent`, not the ring's own primary channels: outside a zone it IS `--primary`, and
|
|
225
|
+
inside `[ds-color="error"]` it becomes that family, which is the same adaptivity the
|
|
226
|
+
zone already gives the shadow ring through `--accent-focus-ring`. Composing it from
|
|
227
|
+
`--focus-ring-outer-*` would have pinned the outline to the brand hue in a zone whose
|
|
228
|
+
every other accent had moved. */
|
|
229
|
+
--focus-ring-color: var(--accent);
|
|
230
|
+
|
|
222
231
|
--focus-ring:
|
|
223
232
|
0 0 0 2px var(--focus-ring-inner),
|
|
224
233
|
0 0 0 4px hsl(var(--focus-ring-outer-h) var(--focus-ring-outer-s) var(--focus-ring-outer-l) / var(--focus-ring-outer-alpha));
|