@ids-group-ltd/ids-design-system 0.10.0 → 0.10.1

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
@@ -8,6 +8,227 @@ While the package is on `0.x`, minor releases may contain breaking changes.
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 0.10.1 — 2026-08-20
12
+
13
+ ### Removed
14
+
15
+ - **`--opacity-muted` is gone from the token scale.** It was the last token in the file that no
16
+ component read: the disabled states moved onto `--text-disabled` + `--opacity-disabled` in
17
+ 0.10.0, and it had been sitting there since, labelled a legacy alias. Keeping a dead number in a
18
+ purpose-named scale is worse than removing it — it invites exactly the override that 0.10.0's
19
+ DELETE-LIST had to warn about twice, where a consumer retunes it on `ds-button` /
20
+ `ds-icon-button` and gets a silent no-op. **Nothing in the library changes.** If you set it, drop
21
+ the declaration; if you READ it in your own CSS, inline the 0.6 or move to the token that names
22
+ the job — `--opacity-disabled` (0.5) for a disabled state where opacity is the only signal,
23
+ `--opacity-text-disabled` (0.38) for disabled text. The comment above the block claims every
24
+ token in it has a real consumer; that is true again.
25
+
26
+ ### Added
27
+
28
+ - **`ds-segmented` joins the form systems, and gains a label and a message row.** It carried a value
29
+ and no form could bind it — no `NG_VALUE_ACCESSOR`, so `[(ngModel)]`, a `formControlName` and
30
+ signal forms all slid off it. It now extends `DsControlValueAccessor` and resolves its message
31
+ through the same `resolveFieldMessage` as every other field, mirroring `ds-radio-group`: `label`,
32
+ `hint`, `error`, `warning` and `errors` all behave as they do elsewhere, and `disabled` folds
33
+ together with the form's own disabled state. **The DOM grew a level to fit them:** the pill moved
34
+ off `:host` onto an inner `.track`, so the host can stack label, pill and message. The pill's own
35
+ tokens stayed on `:host` and inherit down, so a token override is unaffected — but a
36
+ `::ng-deep` rule written against the host AS the pill (a background, a border-radius, a grid) now
37
+ targets the stack instead, and wants `.track`.
38
+
39
+ - **`invalid` paints the error state only — it no longer promotes `hint` to the error message.**
40
+ Every state carries its own text now, and `hint` is never recoloured into somebody else's state.
41
+ **BREAKING:** `[invalid]="true" hint="Must be before end date"` used to render that hint in red,
42
+ through `role="alert"`. It now renders a red border with a **grey** hint. Use
43
+ `error="Must be before end date"` instead — the state and the message come together.
44
+ **Why, beyond tidiness.** The idiom lost the actual hint: when both were set, the help text the
45
+ author wrote was replaced by the error rather than shown alongside it. It also announced help text
46
+ as an alert, and it made a template unreadable — whether `hint="…"` was a hint or an error depended
47
+ on a different attribute. It was the last input that borrowed another one's text; `success` stopped
48
+ doing it in the same release.
49
+ **`invalid` is not going away and still has its own job:** the error state with NO message, for when
50
+ the text lives elsewhere — a form-level error summary, or one message covering a whole
51
+ `ds-field-group` — plus `aria-invalid` for that case. Carbon and Material split the boolean from
52
+ the text the same way.
53
+ Our own docs taught the old idiom on 13 components (14 of 19 `[invalid]` bindings also bound
54
+ `hint`); all of them now use `error`.
55
+
56
+ - **A form model can now raise a WARNING, not only an error** — `DS_FIELD_WARNING_KIND`, newly
57
+ exported. A validation error whose `kind` is `'warning'` paints the field's warning state and shows
58
+ its message, but leaves the control **valid**: `aria-invalid` stays off and a submit guard reading
59
+ validity is not blocked.
60
+ **Why it had to ride inside `errors`.** Angular's `AbstractControl` has no channel for an advisory
61
+ remark — it exposes `errors` and the validity derived from them, and nothing else. So there was no
62
+ way for a form to say "this is worth mentioning but not wrong": `warning` and `success` could only
63
+ be bound by hand from the consumer's own state.
64
+ **It works from both form systems with no new plumbing**, which is the point. A reactive or
65
+ template-driven validator returning `{ warning: 'Long runs of capitals are hard to scan' }` has its
66
+ KEY read as the kind; signal forms assigns its own `ValidationError[]`, which already carries a
67
+ `kind`. Both land in the same `errors` signal.
68
+ Ranked below the explicit `warning` input — the consumer's own string wins, exactly as `error` beats
69
+ `errors` — and shown only after the user has interacted, like any other validation message.
70
+ **`DsFieldError` and `DsFieldErrorsInput` are exported too**, so a typed validator can be written
71
+ against the shape the input accepts. Reserved-kind caveat: a validator already using the key
72
+ `warning` for a BLOCKING error now reads as advisory. Rename that key if you have one.
73
+
74
+ - **`success` exists on all nine bordered fields, and it is now a STRING that carries its own text.**
75
+ Added to `ds-textarea`, `ds-select`, `ds-multi-select`, `ds-autocomplete`, `ds-date-picker`,
76
+ `ds-time-picker`, `ds-otp-input` and `ds-color-picker` — it was on `ds-input` alone, so a form could
77
+ not use the state consistently. The three box-less controls (`ds-checkbox`, `ds-radio-group`,
78
+ `ds-switch`) and `ds-slider` deliberately do NOT get it: they have no box for a border to appear on,
79
+ so the state would show in the message line alone and read as a different treatment.
80
+ **BREAKING for `ds-input`, the one field that already had it:** `success` was
81
+ `input(false, { transform: booleanAttribute })` and is now `input<string>('')`. Replace
82
+ `[success]="true" hint="Available"` with `success="Available"`.
83
+ **Why the type changed rather than staying a flag.** It was the only state that could not say
84
+ anything: `error` and `warning` carry their own text, and `success` was a boolean that recoloured
85
+ the `hint` green. So `success` was the one state whose message had to be smuggled through a
86
+ different input, and a reader of the template could not tell a green hint from a grey one. It is now
87
+ a fourth rung in the same ladder — `error` → `errors` → `warning` → **`success`** → `hint` — and
88
+ reads exactly like `warning`: the text IS the state, no second binding.
89
+ **What this removes:** a success border with no message, which is no longer expressible — exactly as
90
+ it never was for `warning`. `invalid` still exists as the flag partner of `error`, for the
91
+ `[invalid]="…" [hint]="…"` idiom that predates `error`.
92
+
93
+ - **`ds-list-item` can hold its own controls: `[leading]` and `[trailing]` render OUTSIDE the row's
94
+ button.** A row with a checkbox AND a row-level action had no shape here — every projected node went
95
+ inside `<button class="activator">`, where a nested control is invalid HTML, its click bubbles into
96
+ `activated`, and a screen reader folds it into the button's name and never announces its checked
97
+ state. Dropping `clickable` was no answer either: `cursor`, `:hover`, `:focus-visible` and
98
+ `aria-current` all hung off that button. The row is now the flex container and the button wraps only
99
+ the text, so the master–detail shape works — a checkbox per row for a bulk action, the row itself
100
+ choosing what a detail pane shows, two independent targets.
101
+ **This stays a `role="list"`, deliberately not a `listbox`:** the ARIA spec is explicit that a
102
+ `listbox` option cannot hold interactive content, so a real listbox would have made the pattern
103
+ impossible rather than easier. `role="listitem"` carries no such restriction.
104
+ **`selected` also works properly now.** It set `aria-current` on the inner button, so it did nothing
105
+ at all unless `clickable` was on; `aria-current` sits on the host, which is the row that is current.
106
+ **BREAKING for CSS overrides only** — no API changed. `.activator` no longer carries the row's
107
+ padding, gap or hover tint: those moved to the host. A `::ng-deep .activator { padding: … }` now pads
108
+ the text alone, and a `::ng-deep .activator:hover` no longer paints the full row.
109
+
110
+ - **Per-side padding on `ds-modal` / `ds-modal-card`.** Each region resolved ONE `pad-y` applied to
111
+ both of its edges, so a layout whose header pads only at the top and whose actions row pads only
112
+ at the bottom — the body's own padding carrying the whole gap between them — could not be said
113
+ through the API at all. mm-broker has held three `!important` rules on `.modal > .header` /
114
+ `> .body` / `> .actions` for exactly this, reaching past the component into its internal class
115
+ names, and `DS_CONFIG.modal.dividers` could not retire them. Six new tokens —
116
+ `--ds-modal-header-pad-top` / `-pad-bottom` and the same for `body` and `actions` — each fall back
117
+ to their region's existing `pad-y`, so **nothing moves unless you set one**, and `--ds-modal-*-pad-y`
118
+ keeps working as the shorthand for both edges.
119
+
120
+ - **`ds-table`'s own icon buttons are themeable.** The row-action kebab and the column-picker trigger
121
+ hardcoded `--icon-default`, `--icon-strong` on hover and an `--accent` focus outline, and neither is a
122
+ `ds-icon-button`, so the icon-button tokens never reached them — a consumer whose design calls for a
123
+ teal row menu had no supported way to get one short of repainting `--icon-default` for the whole app.
124
+ Three resolvers now cover both: `--ds-table-icon-btn-color`, `--ds-table-icon-btn-color-hover` and
125
+ `--ds-table-icon-btn-focus-color`, defaulting to exactly what was hardcoded, so nothing moves unless
126
+ you set them.
127
+
128
+ ### Fixed
129
+
130
+ - **`ds-field-message`'s docs claimed `state` picks an icon. It never did.** The input's docblock
131
+ said it "decides colour and icon" and `icon`'s said it "overrides the glyph the `state` would
132
+ pick" — but `icon` is a plain `input<IconName | null>(null)` with no per-state default, so a
133
+ consumer following the reference got a colour and no glyph. **Nothing in the library changes**: the
134
+ JSDoc and the generated API reference now say what the code does — `state` sets the colour, and a
135
+ field that wants an icon passes one.
136
+
137
+ - **A nullable binding on a message input no longer throws.** `hint`, `error`, `warning` and
138
+ `success` took a bare `string`, and the resolver called `.trim()` on whatever arrived — so
139
+ `[error]="form.errors?.message"` put `null` in and crashed the render with a `TypeError` the
140
+ moment the expression was empty. All four now transform at the input boundary, absorbing
141
+ `null`/`undefined` to `''` and trimming, so a blank binding simply means "no message". **You can
142
+ now delete** the `?? ''` you wrapped such a binding in.
143
+
144
+ - **A `ds-menu` inside a `ds-popover` clips its rows to the panel's rounded corners.** The first and
145
+ last row's fill — a hover tint, or the red of a destructive item — painted through the panel's
146
+ corner, so a destructive last item showed **two square red corners under a rounded popover**.
147
+ **The cause was not a missing clip; it was a clip of the wrong shape.** `ds-menu` has
148
+ `overflow: hidden`, and that is what rounds the edge rows for a bare menu. But its
149
+ `:host-context(.popover)` block flattened `border-radius` to `--radius-flat` while leaving `overflow`
150
+ in force, so inside a popover the menu clipped its rows **square** and the panel's 12px corner
151
+ showed that square fill through it. The popover now publishes `--ds-menu-clip-radius` — its own
152
+ radius less the border it contains — and the menu clips to that, concentric at 11px inside a 12px
153
+ panel. A brand overriding `--ds-popover-radius` is followed automatically.
154
+ **Not fixed with `overflow: hidden` on the panel**, which was the obvious move: a submenu is a CDK
155
+ overlay portaled to `body`, so clipping the panel would not have reached it, and the panel's clip
156
+ would have cut an edge row's focus ring — the same defect fixed in `ds-filter-bar` this month.
157
+ Nothing else changes: the item radius token `--ds-menu-item-radius` still defaults to 0, because the
158
+ MENU owns the edge corners, not the row.
159
+
160
+ - **Clearing or replacing `ds-date-picker`'s `value` from outside now clears the picker's own typing
161
+ error.** `typedInvalid` / `rangeInvalid` were set by the typing paths and cleared only by those and
162
+ `applyPreset`, so `value.set(null)` re-rendered the field to empty and left **"Enter a valid date
163
+ (MM/DD/YYYY)" standing over it**. `[error]` was no help: a consumer who has just cleared the field
164
+ has no error of its own to bind, and an empty string falls straight back to the picker's.
165
+ The `value → text` effect now clears both flags. It is the right place because every typing path
166
+ holds an `editing` guard while it runs, so reaching the effect means the value did NOT come from the
167
+ keyboard — and a leftover error no longer describes what the field is about to show. Verified that
168
+ neither typing path writes `value` on the invalid branch, so blur validation still stands.
169
+ **This retires two consumer workarounds.** One app was tearing down a whole modal body on `closed`
170
+ purely to get a fresh picker — and that had a hole, since reopening inside the 300 ms leave animation
171
+ cancels the close, `closed` never fires and the stale error survived. A second dialog had no
172
+ workaround at all, so a mistyped date of birth read "Enter a valid date" over an empty field the next
173
+ time it opened.
174
+
175
+ - **A disabled `ds-button` with `variant="ghost"`, `variant="text"` or `variant="outline"` mixes its
176
+ label toward the surface instead of taking the shared fixed-lightness recipe.** New default:
177
+ `color-mix(in srgb, <label> 40%, var(--surface-default))`. These three share one accent source and
178
+ have no fill that could carry the state, so the label is the whole signal — and the shared recipe
179
+ was failing it, badly in dark. Measured against the enabled label: light **2.54 → 3.41:1**, dark
180
+ **1.11 → 2.91:1**. `outline` does have a border, but its disabled border resolves to only
181
+ **1.30:1** against the page — less than its own *enabled* border at 1.49:1 — so it never covered
182
+ for the label.
183
+ **The dark number is the real defect.** `--primary-strong` there is already light (OKLCH L 67.9%),
184
+ so a recipe pinning the disabled label at L 70% landed two points from the enabled one and the two
185
+ differed in chroma alone. A fixed lightness cannot serve both themes: in light, disabled is
186
+ lighter than the accent; in dark the accent is already light, so disabled has to go darker. The
187
+ surface knows that direction and a constant does not — which is the whole reason the mix target is
188
+ `--surface-default` rather than a number.
189
+ **The trade:** the disabled label is fainter against its own ground — **2.00:1** light, 1.99:1
190
+ dark, where the old recipe gave 2.69 / 6.45. Disabled text is exempt from WCAG 1.4.3 and 1.4.11
191
+ and Material ships its equivalent at 1.93:1, so this is inside practice. Chroma rises with the
192
+ mix (0.036 → 0.099 light), so the disabled label stays tinted rather than going grey; that was
193
+ chosen deliberately over a desaturating variant after looking at both.
194
+ **`solid` and `tonal` are unchanged**, deliberately: a white label mixed into a white surface does
195
+ not move, and tonal's disabled fill already carries the state on its own. **Known limitation:** the
196
+ mix target is `--surface-default`, a stand-in for "whatever is behind" — CSS cannot read the actual
197
+ backdrop, so on a tinted ground (a card at `--surface-secondary`, an alert) the disabled label is
198
+ computed against the page colour rather than that ground. Consumers who set
199
+ `--ds-button-label-color-disabled` are unaffected.
200
+ ### Changed
201
+
202
+ - **A disabled `ds-icon-button variant="standard"` mixes its glyph toward the surface too.** It is
203
+ the only icon-button variant with neither a fill nor a border, so the glyph's colour is the whole
204
+ disabled signal — and the shared fixed-lightness recipe could not carry it in dark, where the
205
+ enabled icon is already light (OKLCH L 80%) and a disabled one pinned at L 70% sat **1.46:1** away.
206
+ The new default is `color-mix(in srgb, <icon> 40%, var(--surface-default))`, the same mix the
207
+ borderless button variants take, which picks its direction per theme: light **4.17 → 5.19:1**, dark
208
+ **1.46 → 3.58:1**. Scoped to `standard` deliberately — `filled`'s icon is `--c-on`, and white
209
+ mixed into a white surface does not move at all. `--ds-icon-button-icon-color-disabled` is the same
210
+ hook as before and still wins; only the default under it changed.
211
+
212
+ - **If you EXTEND a DS field component, read this before trusting `class-surface`.** The report
213
+ against 0.10.0 says fourteen field components LOST eight members each — `hint`, `error`,
214
+ `warning`, `errors`, `invalid`, `touched`, `reserveMessage` and `reserveMessageResolved`.
215
+ **Nothing was removed.** Those inputs were declared once per component and are now declared once in
216
+ total, on a new internal `DsFieldBase`, which every field reaches either directly or through
217
+ `DsControlValueAccessor` / `DsBooleanControlValueAccessor`. All fourteen still carry all eight by
218
+ inheritance, so a template binding, a TS read and an existing `override` all behave exactly as
219
+ before. The tool counts declarations per FILE, and `migrations/AUTHORING.md` already names a member
220
+ that moved to a base class as one of the two things it cannot see — this release is that case.
221
+ What genuinely grew is smaller: **eight bordered fields gained `success`** (`ds-autocomplete`,
222
+ `ds-color-picker`, `ds-date-picker`, `ds-multi-select`, `ds-otp-input`, `ds-select`,
223
+ `ds-textarea`, `ds-time-picker`), `ds-input` having had it all along. `ds-segmented`
224
+ is the tenth grown class and the one with real new surface — joining the form systems gave it
225
+ `label`, `disabled`, `isDisabled`, `message`, `invalidResolved`, `fieldMessage`, `hintId` and
226
+ `uid`. A subclass declaring
227
+ `success` on one of those eight now fails with TS4114; declaring any of the eight moved names still
228
+ collides exactly as it did, because an inherited member collides the same way an own one does.
229
+ `DsFieldBase` is internal and deliberately not exported — it holds only the inputs every field has,
230
+ which is why `success`, `label`, `required` and `optional` stayed on the components.
231
+
11
232
  ## 0.10.0 — 2026-08-18
12
233
 
13
234
  ### Added
@@ -558,6 +779,35 @@ While the package is on `0.x`, minor releases may contain breaking changes.
558
779
 
559
780
  ### Changed
560
781
 
782
+ - **The seven inputs every field shares are declared once, in `DsFieldBase`.** `hint`, `error`,
783
+ `warning`, `errors`, `invalid`, `touched` and `reserveMessage` — plus the `reserveMessageResolved`
784
+ helper — were hand-copied into all fourteen fields, 98 declarations. **Nothing about the public API
785
+ changed:** every input keeps its name, type, default and documentation, and the docs API tables are
786
+ byte-identical apart from the eight new `success` rows (verified by diffing the generated
787
+ reference: 0 lost, 8 gained).
788
+ **Why it is worth knowing anyway:** the duplication had already drifted twice — `success` was
789
+ missing from eight fields, and `ds-date-picker` had quietly moved to a different `invalid` source.
790
+ A new state added to the base now reaches every field at once.
791
+ `DsControlValueAccessor` and `DsBooleanControlValueAccessor` extend the base (so single inheritance
792
+ still holds for the thirteen fields that already extended one of them) and `ds-radio` extends it
793
+ directly. Only the UNIVERSAL inputs moved: `success`, `label`, `required` and `optional` stay on the
794
+ components, because they exist on 9, 9, 7 and 5 fields respectively and lifting them would hand a
795
+ checkbox a `success` or a slider a `label` it never had.
796
+
797
+ - **`ds-icon-button` with `variant="standard"` mixes its disabled glyph toward the surface too.**
798
+ New default on that variant only: `color-mix(in srgb, <icon colour> 40%, var(--surface-default))`.
799
+ Same defect as ghost, and it matters more here — there is no word to read, just a 16px glyph.
800
+ Measured: light **4.17 → 5.19:1**, dark **1.46 → 3.58:1**. Light was already healthy, because the
801
+ enabled glyph is `--text-secondary` at OKLCH L 35% and the old recipe moved it to L 70%; **dark was
802
+ the break**, where the enabled glyph is L 80% and a disabled one pinned at L 70% left ten points
803
+ and a 1.46:1 gap.
804
+ **Scoped to `standard` deliberately, and this is the trap worth knowing:** the resolver is declared
805
+ once on the base and no variant overrode it, so touching the base would have hit `filled` too —
806
+ whose glyph is `--c-on`, i.e. white, and white mixed into a white surface does not move at all,
807
+ which would have put an invisible white glyph on a pale disabled fill. `filled`, `tonal` and
808
+ `outlined` keep the base recipe unchanged. Consumers who set
809
+ `--ds-icon-button-icon-color-disabled` are unaffected.
810
+
561
811
  - **`avatarTint` switches from OKLCH to `hsl(H 50% 62%)` with white initials, always.** The seeded
562
812
  tints read as dull, and every set of initials came out black. The auto-contrast was not the fault:
563
813
  measured across the hue circle, the old `oklch(62% 0.14 h)` put every hue's luminance between 0.218