@ids-group-ltd/ids-design-system 0.10.2 → 0.10.3
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 +59 -0
- package/components.md +5 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +22 -22
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.3.json +73 -0
- package/package.json +1 -1
- package/styles/_field-group-segment.scss +3 -8
- package/styles/_focus.scss +28 -30
- package/styles/_text-clip.scss +5 -10
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.10.3",
|
|
3
|
+
"items": [
|
|
4
|
+
{
|
|
5
|
+
"id": "one-focus-ring-per-field-input-textarea",
|
|
6
|
+
"kind": "behavior",
|
|
7
|
+
"old": "ds-input, ds-textarea",
|
|
8
|
+
"new": null,
|
|
9
|
+
"surface": "style",
|
|
10
|
+
"note": "APPEARANCE FIX, no action: the two shells 0.10.2's one-focus-ring-per-field pass missed. A focused ds-input or ds-textarea drew TWO rings - the 4px control ring the universal :where(:focus-visible) rule puts on the inner input/textarea, plus the 3px field halo the box paints on :focus-within. The inner one is now suppressed. ACTION only if you wrote a workaround: a rule that killed one of the two (box-shadow: none on an inner input, a re-declared --ds-input-focus-shadow meant to hide the doubling) can go. Deliberately NOT suppressed: the clear button and the password toggle inside the same box keep their own ring, because both are real tab stops the box halo cannot distinguish.",
|
|
11
|
+
"verify": "Tab into a ds-input and a ds-textarea: each shows exactly one ring, the halo around the box. Tab on to the clear button or password toggle inside that field and a second, tighter ring appears on the button - that one is intended.",
|
|
12
|
+
"searchHints": [
|
|
13
|
+
"--ds-input-focus-shadow",
|
|
14
|
+
"--ds-field-focus-shadow",
|
|
15
|
+
"--ds-control-focus-shadow",
|
|
16
|
+
"box-shadow: none",
|
|
17
|
+
"focus-visible"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "search-clear-button-focus-indicator",
|
|
22
|
+
"kind": "behavior",
|
|
23
|
+
"old": "ds-search",
|
|
24
|
+
"new": null,
|
|
25
|
+
"surface": "style",
|
|
26
|
+
"note": "ACCESSIBILITY FIX, no action: 0.10.2's ring fix silenced the base focus indicator with a shell-wide reset, which also hit .search-clear - a tabindex=0 tab stop. Tabbing from the input to the clear button changed nothing on screen (box-shadow, outline, border, background and colour all identical), so a keyboard user could not tell the button had focus: a WCAG 2.4.7 failure. Every shell now names the single control it silences, so tab stops inside a field box keep their own ring. ACTION only if you re-added a ring to that button yourself - that rule can go.",
|
|
27
|
+
"verify": "Type into a ds-search so the clear button appears, then Tab: the × shows its own ring on top of the field halo. Same for a chip close button in ds-autocomplete or ds-multi-select, and for the arrows in ds-number-stepper.",
|
|
28
|
+
"searchHints": [
|
|
29
|
+
"search-clear",
|
|
30
|
+
"ds-search",
|
|
31
|
+
"focus-visible",
|
|
32
|
+
"box-shadow"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "portaled-panel-focus-indicator",
|
|
37
|
+
"kind": "behavior",
|
|
38
|
+
"old": "ds-date-picker, ds-time-picker",
|
|
39
|
+
"new": null,
|
|
40
|
+
"surface": "style",
|
|
41
|
+
"note": "ACCESSIBILITY FIX, no action: two tabbable buttons inside the portaled panels had no focus indicator at all, and one panel had square corners. Both read a private --_*-focus-shadow token declared on :host while the panel is portaled out of the host by the CDK, so the var() resolved to nothing and box-shadow fell back to its initial value none - with outline: none beside it, nothing was left. ds-time-picker's panel border-radius read the same way and fell back to 0. ACTION only if you worked around either: a rule adding a ring to .period-trigger or .time-action, or a border-radius forced onto .time-panel, can go.",
|
|
42
|
+
"verify": "Open the ds-date-picker calendar and Tab to the month/year header: it shows a focus ring. Open the ds-time-picker panel and Tab to its action button: same. The time-picker panel has rounded corners.",
|
|
43
|
+
"searchHints": [
|
|
44
|
+
"period-trigger",
|
|
45
|
+
"time-action",
|
|
46
|
+
"time-panel",
|
|
47
|
+
"--ds-date-picker-focus-shadow",
|
|
48
|
+
"--ds-time-picker-focus-shadow",
|
|
49
|
+
"--ds-time-picker-panel-radius"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"informational": [
|
|
54
|
+
"The shell list in styles/_focus.scss is now maintained from a measurement, not from a read of the code: it had been wrong for two releases. If you add a component that paints its own ring on :focus-within, suppress the base rule on the control it speaks for - `outline: 0` cannot do it, because the base indicator is a box-shadow.",
|
|
55
|
+
"Two authoring mixins are now documented for consumers building their own composite controls: `focus.owns-the-focus-ring($control)` in styles/focus, and `text-clip.single-line-ellipsis` in styles/text-clip. Both are opt-in - no existing code changes.",
|
|
56
|
+
"A private --_* token declared on :host does not reach a CDK-portaled panel, and an unresolvable var() silently becomes the property's initial value - none for box-shadow, 0 for border-radius. If you style a DS panel from your own CSS, read the PUBLIC --ds-* token there, not the private one.",
|
|
57
|
+
"Eleven public tokens were always overridable but never reached the token reference, because the extractor searched for the literal `var(--ds-` and a resolver wrapped across lines put a newline inside it: --ds-container-pad-x, --ds-multi-select-border-color (+-focus), --ds-segmented-selected-bg-color / -label-color / --ds-segmented-radius, --ds-time-picker-option-bg-color-selected / -text-color-selected / -bg-color-hover, --ds-time-picker-trigger-bg-color / -border / -color. Nothing changed in the components - if you hand-rolled around one of these because it looked unsupported, the override works and the workaround can go."
|
|
58
|
+
],
|
|
59
|
+
"deleteList": [
|
|
60
|
+
{
|
|
61
|
+
"id": "input-double-ring-workaround",
|
|
62
|
+
"surface": "style",
|
|
63
|
+
"find": [
|
|
64
|
+
"ds-input input",
|
|
65
|
+
"ds-textarea textarea",
|
|
66
|
+
"--ds-input-focus-shadow",
|
|
67
|
+
"box-shadow: none"
|
|
68
|
+
],
|
|
69
|
+
"why": "A rule killing one of the two focus rings a ds-input or ds-textarea used to paint - typically box-shadow: none on the inner input, or --ds-input-focus-shadow re-declared as none to hide the doubling.",
|
|
70
|
+
"replaceWith": "nothing - the component now paints one ring on its own"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
package/package.json
CHANGED
|
@@ -26,13 +26,8 @@
|
|
|
26
26
|
outline: 0;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
native input inside it kept its own, so a field group painted two rings, a
|
|
33
|
-
tight one around the control and the halo around the row. */
|
|
34
|
-
:where(:focus-visible) {
|
|
35
|
-
box-shadow: none;
|
|
36
|
-
}
|
|
29
|
+
/* No blanket reset here on purpose: the block above clears the segment BOX and
|
|
30
|
+
each field silences its own control, which leaves a tab stop inside a segment
|
|
31
|
+
the ring it needs. */
|
|
37
32
|
}
|
|
38
33
|
}
|
package/styles/_focus.scss
CHANGED
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
// Focus-indicator style, switched in ONE place: `<html data-focus="…">`.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// attribute keeps today's split.
|
|
8
|
-
//
|
|
9
|
-
// `outline` cannot be a box-shadow token, which is why that style also emits a
|
|
10
|
-
// rule: the roles go to `none` and the indicator becomes a real `outline`.
|
|
11
|
-
// `:where()` keeps that rule at zero specificity so a component or a consumer
|
|
12
|
-
// still wins.
|
|
13
|
-
//
|
|
14
|
-
// The forced-colors block is not part of the switch and applies to every style:
|
|
15
|
-
// Windows High Contrast DROPS box-shadow, so a shadow-only indicator disappears
|
|
16
|
-
// entirely there. This is the one place that gap can be closed once.
|
|
3
|
+
// Two families — a soft halo on fields (`--focus-field`), a crisp double ring on
|
|
4
|
+
// controls (`--focus-ring`) — and every component resolves through the
|
|
5
|
+
// `--ds-field-focus-shadow` / `--ds-control-focus-shadow` roles, so a brand-wide
|
|
6
|
+
// switch only has to retarget two roles. No attribute keeps the default split.
|
|
17
7
|
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// component and app rule still wins.
|
|
8
|
+
// Catches anything focusable that styles nothing itself, so it cannot fall through to
|
|
9
|
+
// the browser default.
|
|
21
10
|
//
|
|
22
|
-
// CONSEQUENCE
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
// control and one round the box. The shells that do it: autocomplete, date-picker,
|
|
26
|
-
// field-group, number-stepper, search.
|
|
11
|
+
// CONSEQUENCE inside a shell that rings on `:focus-within`: the shell must silence
|
|
12
|
+
// the control, and `outline: 0` cannot do it because what this sets is a SHADOW.
|
|
13
|
+
// Leave it and the field paints two rings. `owns-the-focus-ring` below is the reset.
|
|
27
14
|
:where(:focus-visible) {
|
|
28
15
|
outline: none;
|
|
29
16
|
box-shadow: var(--ds-control-focus-shadow);
|
|
30
17
|
}
|
|
31
18
|
|
|
19
|
+
// `$control` names ONE control and must never be a blanket: a box-wide reset also
|
|
20
|
+
// silences the tab stops living in the box — a clear button, a stepper arrow — and
|
|
21
|
+
// then tabbing from the field to that button changes nothing on screen.
|
|
22
|
+
// Enforced by tools/check-focus-rings.mjs.
|
|
23
|
+
@mixin owns-the-focus-ring($control) {
|
|
24
|
+
#{$control}:where(:focus-visible) {
|
|
25
|
+
box-shadow: none;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
32
29
|
:root[data-focus='ring'] {
|
|
33
30
|
--ds-field-focus-shadow: var(--focus-ring);
|
|
34
31
|
--ds-field-focus-shadow-error: var(--focus-ring-error);
|
|
@@ -39,8 +36,7 @@
|
|
|
39
36
|
--ds-control-focus-shadow-error: var(--focus-field-error);
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
//
|
|
43
|
-
// the pin-475 prototype.
|
|
39
|
+
// A hairline flush against the element, no gap — from the pin-475 prototype.
|
|
44
40
|
:root[data-focus='edge'] {
|
|
45
41
|
--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);
|
|
46
42
|
--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error);
|
|
@@ -49,9 +45,8 @@
|
|
|
49
45
|
var(--error);
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
// The one style NOT pinned to :root
|
|
53
|
-
//
|
|
54
|
-
// clipping element and everything inside keeps an indicator instead of losing it.
|
|
48
|
+
// The one style NOT pinned to :root, because a clipping ancestor is a local problem:
|
|
49
|
+
// set it on the clipping element and everything inside keeps an indicator.
|
|
55
50
|
[data-focus='inset'] {
|
|
56
51
|
--ds-field-focus-shadow: var(--focus-ring-inset);
|
|
57
52
|
--ds-field-focus-shadow-error: var(--focus-ring-inset-error);
|
|
@@ -66,15 +61,18 @@
|
|
|
66
61
|
--ds-control-focus-shadow-error: none;
|
|
67
62
|
}
|
|
68
63
|
|
|
64
|
+
// The only style that emits a rule of its own: an `outline` cannot be carried by a
|
|
65
|
+
// box-shadow token, so the roles go to `none` above and this draws the indicator.
|
|
69
66
|
:root[data-focus='outline'] :where(:focus-visible) {
|
|
70
67
|
outline: var(--border-width-strong) solid var(--primary);
|
|
71
68
|
outline-offset: var(--focus-ring-offset);
|
|
72
69
|
}
|
|
73
70
|
|
|
71
|
+
// Not part of the switch — it applies under every style, because Windows High
|
|
72
|
+
// Contrast DROPS box-shadow and a shadow-only indicator vanishes there completely.
|
|
74
73
|
@media (forced-colors: active) {
|
|
75
|
-
// CanvasText, not a brand colour:
|
|
76
|
-
//
|
|
77
|
-
// background.
|
|
74
|
+
// CanvasText, not a brand colour: the palette is replaced, and a system keyword is
|
|
75
|
+
// the only value guaranteed to contrast with the forced background.
|
|
78
76
|
:where(:focus-visible) {
|
|
79
77
|
outline: var(--border-width-strong) solid CanvasText;
|
|
80
78
|
outline-offset: var(--focus-ring-offset);
|
package/styles/_text-clip.scss
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
// Single-line text that truncates with an ellipsis. Mixin-only, so it is NOT
|
|
2
|
-
// forwarded from `ds.scss` — components `@use` it directly, like `chip-row`.
|
|
3
|
-
|
|
4
1
|
@mixin single-line-ellipsis {
|
|
5
2
|
/* `clip` with a margin, not `hidden`: an ellipsis box needs a non-`visible`
|
|
6
|
-
overflow, and where the line box is tighter than the
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
geometry, and `text-overflow` reads any non-`visible` overflow, so the
|
|
12
|
-
ellipsis still applies. */
|
|
3
|
+
overflow, and where the line box is tighter than the glyph box that overflow
|
|
4
|
+
eats the glyph. Mulish measures 1.257em, so --line-height-flat (1) and -tight
|
|
5
|
+
(1.1) are both under it and shave EVERY label, not only the ones with
|
|
6
|
+
descenders (MBP-245). `text-overflow` reads any non-`visible` overflow, so the
|
|
7
|
+
ellipsis still applies under `clip`. */
|
|
13
8
|
overflow: clip;
|
|
14
9
|
overflow-clip-margin: var(--space-1);
|
|
15
10
|
text-overflow: ellipsis;
|