@ids-group-ltd/ids-design-system 0.7.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,17 @@
5
5
  // declares the matching rules so the portaled panel renders styled.
6
6
 
7
7
  .ds-dropdown-panel {
8
+ /* The selected row used to paint straight from the theme roles, so a brand that
9
+ wanted a different selected treatment had to RETARGET --primary-* inside this
10
+ panel — and then track which other content in it read the same role. Named
11
+ hooks instead; the defaults are those roles, so nothing moves and a retuned
12
+ palette still flows through. Panel-level, not per-component: one partial
13
+ paints the rows for select, autocomplete and multi-select alike. */
14
+ --_option-selected-bg-color: var(--ds-option-selected-bg-color, var(--primary-subtitle));
15
+ --_option-selected-label-color: var(--ds-option-selected-label-color, var(--primary-strong));
16
+ --_option-selected-bg-color-hover: var(--ds-option-selected-bg-color-hover, var(--primary-muted));
17
+ --_option-check-color: var(--ds-option-check-color, var(--primary));
18
+
8
19
  .dropdown-panel {
9
20
  // Fill the cdk-overlay-pane width (set from trigger.getBoundingClientRect()
10
21
  // in dropdown.component.ts). Without `width: 100%` the panel is a flex
@@ -12,7 +23,7 @@
12
23
  width: 100%;
13
24
  background: var(--surface-overlay);
14
25
  border: var(--border-width-default) solid var(--border-default);
15
- border-radius: var(--radius-md);
26
+ border-radius: var(--ds-radius-panel);
16
27
  box-shadow: var(--shadow-popover);
17
28
  padding: var(--space-1);
18
29
  max-height: 320px;
@@ -70,7 +81,7 @@
70
81
  font: var(--font-weight-medium) var(--font-size-s) / var(--line-height-flat) var(--font-sans);
71
82
  color: var(--text-primary);
72
83
  cursor: pointer;
73
- border-radius: var(--radius-sm);
84
+ border-radius: var(--ds-radius-inner);
74
85
  text-align: left;
75
86
  transition: background-color var(--duration-fast) var(--ease-standard);
76
87
 
@@ -88,7 +99,7 @@
88
99
  }
89
100
 
90
101
  .option-check {
91
- color: var(--primary);
102
+ color: var(--_option-check-color);
92
103
  flex: 0 0 auto;
93
104
  }
94
105
 
@@ -101,20 +112,36 @@
101
112
  background: var(--surface-secondary);
102
113
  }
103
114
 
115
+ // Pressed. The equivalent rows elsewhere (ds-menu-item, ds-list-item) have
116
+ // had one since 2026-07-02; the picker panels were left with hover only, so
117
+ // a tap on a phone — where there is no hover at all — gave no feedback that
118
+ // the row had been hit. One rule here covers select, autocomplete and
119
+ // multi-select, which all render their options through this partial.
120
+ &:active:not(.is-disabled) {
121
+ background: var(--surface-muted);
122
+ }
123
+
104
124
  &:focus-visible {
105
125
  outline: none;
106
126
  box-shadow: var(--ds-control-focus-shadow);
107
127
  }
108
128
 
109
129
  &.is-selected {
110
- background: var(--primary-subtitle);
111
- color: var(--primary-strong);
130
+ background: var(--_option-selected-bg-color);
131
+ color: var(--_option-selected-label-color);
112
132
 
113
- .option-icon { color: var(--primary-strong); }
133
+ .option-icon { color: var(--_option-selected-label-color); }
114
134
 
115
135
  &:hover:not(.is-disabled),
116
136
  &.is-active:not(.is-disabled) {
117
- background: var(--primary-muted);
137
+ background: var(--_option-selected-bg-color-hover);
138
+ }
139
+
140
+ // Selected rows keep the brand family when pressed, for the same reason
141
+ // the hover above exists: falling back to the neutral pressed fill would
142
+ // strand the selected label colour on it.
143
+ &:active:not(.is-disabled) {
144
+ background: var(--_option-selected-bg-color);
118
145
  }
119
146
  }
120
147
 
@@ -0,0 +1,22 @@
1
+ // One control-box height for the field family.
2
+ //
3
+ // `--field-h-sm`/`-md`/`-lg` have shipped as the field height scale since the
4
+ // token file was written, but only `-lg` was ever read: every field spelled the
5
+ // other two as the raw `var(--hit-min)` / `var(--hit-cozy)` instead. A consumer
6
+ // retuning `--field-h-md` — the obvious lever, and the one the token name
7
+ // advertises — therefore changed nothing. Same values, so routing through the
8
+ // scale is visually neutral; it just makes the knob real.
9
+ //
10
+ // `--ds-field-height` is the public override and beats the size class, because a
11
+ // consumer setting it has already decided. Per-instance is CSS-variable scoping:
12
+ // `ds-select { --ds-field-height: 44px; }`.
13
+ // `$prop` is `min-height` for a box that must be able to grow — autocomplete and
14
+ // multi-select wrap chips onto a second line, and a fixed height would clip them.
15
+ // `--_field-box-height` holds the RESOLVED height, so a control that derives other
16
+ // geometry from it (number-stepper sizes its buttons off its own height) can read
17
+ // it back instead of restating the fallback chain.
18
+ @mixin field-box-height($size: md, $prop: height) {
19
+ --_field-box-height: var(--ds-field-height, var(--field-h-#{$size}));
20
+
21
+ #{$prop}: var(--_field-box-height);
22
+ }
@@ -0,0 +1,34 @@
1
+ // One label contract for the field family.
2
+ //
3
+ // Five components hard-coded the identical rule and ds-select named its element
4
+ // `.select-label`, so a form mixing a select with an input rendered labels in two
5
+ // sizes and colours out of the box, and retuning them from an app needed
6
+ // `.field.field .label.label, .select-label.select-label` to out-rank the shimmed
7
+ // component rule. One class (`.label`), one token set, resolved here.
8
+ //
9
+ // A MIXIN, not a global rule: a global `.label` would match consumer markup that
10
+ // happens to use the same class name — the leak that global `.field`/`.check`
11
+ // specimens caused in ds-docs. Each field pays ~6 declarations of its own CSS.
12
+ //
13
+ // Per-instance retune is CSS-variable scoping, so no per-component token set is
14
+ // needed: `ds-select { --ds-field-label-transform: uppercase; }` reaches exactly
15
+ // one component. ds-input keeps its older `--ds-input-label-*` trio winning above
16
+ // this, since those shipped in 0.7.x.
17
+ @mixin field-label {
18
+ --_field-label-font-size: var(--ds-field-label-font-size, var(--font-size-xs));
19
+ --_field-label-weight: var(--ds-field-label-weight, var(--font-weight-bold));
20
+ --_field-label-color: var(--ds-field-label-color, var(--text-secondary));
21
+ --_field-label-transform: var(--ds-field-label-transform, none);
22
+ --_field-label-tracking: var(--ds-field-label-tracking, normal);
23
+
24
+ display: flex;
25
+ align-items: center;
26
+
27
+ // --field-gap-req is the label↔asterisk token; the old rules all spelled its
28
+ // value out as var(--space-1) instead of naming it.
29
+ gap: var(--field-gap-req);
30
+ font: var(--_field-label-weight) var(--_field-label-font-size) / var(--line-height-base) var(--font-sans);
31
+ color: var(--_field-label-color);
32
+ text-transform: var(--_field-label-transform);
33
+ letter-spacing: var(--_field-label-tracking);
34
+ }
@@ -0,0 +1,58 @@
1
+ // Focus-indicator style, switched in ONE place: `<html data-focus="…">`.
2
+ //
3
+ // The library ships two families — a soft halo on fields (`--focus-field`) and a
4
+ // crisp double ring on controls (`--focus-ring`) — and 20 components already
5
+ // resolve through the `--ds-field-focus-shadow` / `--ds-control-focus-shadow`
6
+ // roles, so retargeting the roles is all a brand-wide switch needs. Absent
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.
17
+
18
+ :root[data-focus='ring'] {
19
+ --ds-field-focus-shadow: var(--focus-ring);
20
+ --ds-field-focus-shadow-error: var(--focus-ring-error);
21
+ }
22
+
23
+ :root[data-focus='field'] {
24
+ --ds-control-focus-shadow: var(--focus-field);
25
+ --ds-control-focus-shadow-error: var(--focus-field-error);
26
+ }
27
+
28
+ // Contiguous primary edge — a hairline flush against the element, no gap, from
29
+ // the pin-475 prototype.
30
+ :root[data-focus='edge'] {
31
+ --ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);
32
+ --ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error);
33
+ --ds-control-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);
34
+ --ds-control-focus-shadow-error: 0 0 0 var(--border-width-default)
35
+ var(--error);
36
+ }
37
+
38
+ :root[data-focus='outline'] {
39
+ --ds-field-focus-shadow: none;
40
+ --ds-field-focus-shadow-error: none;
41
+ --ds-control-focus-shadow: none;
42
+ --ds-control-focus-shadow-error: none;
43
+ }
44
+
45
+ :root[data-focus='outline'] :where(:focus-visible) {
46
+ outline: var(--border-width-strong) solid var(--primary);
47
+ outline-offset: var(--focus-ring-offset);
48
+ }
49
+
50
+ @media (forced-colors: active) {
51
+ // CanvasText, not a brand colour: forced-colors replaces the palette, and a
52
+ // system keyword is the only value guaranteed to contrast with the forced
53
+ // background.
54
+ :where(:focus-visible) {
55
+ outline: var(--border-width-strong) solid CanvasText;
56
+ outline-offset: var(--focus-ring-offset);
57
+ }
58
+ }
@@ -19,11 +19,14 @@
19
19
  .cdk-overlay-pane.ds-overlay-pane {
20
20
  /* Public --ds-overlay-* are read with fallbacks, never declared — consumer overrides inherit in. */
21
21
  --_overlay-enter-keyframes: var(--ds-overlay-enter-keyframes, ds-slide-in);
22
- --_overlay-enter-duration: var(--ds-overlay-enter-duration, var(--duration-fast));
23
- --_overlay-enter-easing: var(--ds-overlay-enter-easing, var(--ease-decelerate));
22
+ --_overlay-enter-duration: var(--ds-overlay-enter-duration, var(--ds-motion-enter-panel-duration));
23
+ --_overlay-enter-easing: var(--ds-overlay-enter-easing, var(--ds-motion-enter-panel-easing));
24
24
  --_overlay-enter-offset: var(--ds-overlay-enter-offset, 4px);
25
25
  --_ds-enter-scale: var(--ds-overlay-enter-scale, 0.96);
26
26
 
27
+ --_overlay-leave-duration: var(--ds-overlay-leave-duration, var(--ds-motion-exit-duration));
28
+ --_overlay-leave-easing: var(--ds-overlay-leave-easing, var(--ds-motion-exit-easing));
29
+
27
30
  --_ds-enter-x: 0px;
28
31
  --_ds-enter-y: calc(-1 * var(--_overlay-enter-offset));
29
32
  --_overlay-enter-origin: top center;
@@ -55,4 +58,31 @@
55
58
  animation-timing-function: var(--_overlay-enter-easing);
56
59
  transform-origin: var(--_overlay-enter-origin);
57
60
  }
61
+
62
+ /* Leave, on an AMBIENT DISMISS only — Escape, a press outside, a scroll —
63
+ which `disposeWithLeave` marks by adding `ds-leaving`. Picking an option
64
+ still closes instantly: a fade on a deliberate choice reads as the panel
65
+ lagging behind it, which is why the old unconditional leave was cut. Opacity
66
+ only, no travel: a dismissal has nowhere to travel to, and movement would
67
+ re-add exactly the lag this avoids. Reduced motion zeroes the duration at
68
+ `:root`, so the animation still runs and `animationend` still tears down. */
69
+ &.ds-leaving {
70
+ /* A fading panel must not swallow the click aimed at what is behind it. */
71
+ pointer-events: none;
72
+
73
+ > * {
74
+ animation-name: ds-overlay-out;
75
+ animation-duration: var(--_overlay-leave-duration);
76
+ animation-timing-function: var(--_overlay-leave-easing);
77
+ animation-fill-mode: forwards;
78
+ }
79
+ }
80
+ }
81
+
82
+ /* Global, like the enter presets: a keyframe declared in a component stylesheet
83
+ is renamed by emulated encapsulation. */
84
+ @keyframes ds-overlay-out {
85
+ to {
86
+ opacity: 0;
87
+ }
58
88
  }
@@ -13,9 +13,15 @@
13
13
  // `--ds-<surface>-enter-offset` / `-scale`. One keyframe therefore serves every
14
14
  // surface, and swapping presets never loses the surface's own geometry.
15
15
  //
16
- // Leave motion is deliberately absent: a closing modal/drawer/bottom-sheet is
17
- // torn down on `animationend` matched BY NAME, so those keyframes stay local to
18
- // their component and are not swappable.
16
+ // Exit presets mirror the entrances and are swappable the same way, via
17
+ // `--ds-<surface>-leave-keyframes`. They were absent until 2026-08-10 for a real
18
+ // reason — teardown matched the animation NAME, so renaming the keyframe broke
19
+ // closing entirely — and the guard now checks that the event came from the
20
+ // animated element rather than from something inside it, which frees the name.
21
+ //
22
+ // An exit reads `--_ds-exit-*` and falls back to the matching `--_ds-enter-*`, so
23
+ // a surface that leaves the way it arrived declares nothing: one preset replaces
24
+ // the drawer's four direction-specific keyframes.
19
25
 
20
26
  /* Opacity only — the calmest entrance. */
21
27
  @keyframes ds-fade-in {
@@ -48,3 +54,42 @@
48
54
  transform: translate(var(--_ds-enter-x, 0), var(--_ds-enter-y, 0));
49
55
  }
50
56
  }
57
+
58
+ /* ── Exits ───────────────────────────────────────────────────────────────── */
59
+
60
+ /* Opacity only — the calmest exit, and what a scrim wants. */
61
+ @keyframes ds-fade-out {
62
+ to {
63
+ opacity: 0;
64
+ }
65
+ }
66
+
67
+ /* Shrinks away as it fades — the mirror of ds-scale-in. */
68
+ @keyframes ds-scale-out {
69
+ to {
70
+ opacity: 0;
71
+ transform: scale(var(--_ds-exit-scale, var(--_ds-enter-scale, 0.96)));
72
+ }
73
+ }
74
+
75
+ /* Travels a short distance while fading — the mirror of ds-slide-in. */
76
+ @keyframes ds-slide-out {
77
+ to {
78
+ opacity: 0;
79
+ transform: translate(
80
+ var(--_ds-exit-x, var(--_ds-enter-x, 0)),
81
+ var(--_ds-exit-y, var(--_ds-enter-y, 0))
82
+ );
83
+ }
84
+ }
85
+
86
+ /* Edge-anchored travel with NO fade, for panels that slide fully off-screen
87
+ (drawer, bottom-sheet) where a fade would read as a flicker. */
88
+ @keyframes ds-slide-edge-out {
89
+ to {
90
+ transform: translate(
91
+ var(--_ds-exit-x, var(--_ds-enter-x, 0)),
92
+ var(--_ds-exit-y, var(--_ds-enter-y, 0))
93
+ );
94
+ }
95
+ }
@@ -68,6 +68,19 @@
68
68
  --radius-pill-value: 999px;
69
69
  --radius-pill: var(--radius-pill-value);
70
70
 
71
+ /* Radius ROLES — the layer a consumer retunes. Reading the raw scale directly
72
+ meant re-rounding "panels" also re-rounded every control sharing
73
+ --radius-md. Each role defaults to the value its members already used, so
74
+ nothing moves until one is set. Components resolve
75
+ --ds-<comp>-radius -> role -> value, so a per-component override still wins.
76
+ No `field` role: fields share --radius-md with buttons, so it would either
77
+ duplicate `control` or silently re-round every field. A consumer who wants
78
+ them apart scopes the role: `ds-input { --ds-radius-control: 4px; }`. */
79
+ --ds-radius-inner: var(--radius-sm);
80
+ --ds-radius-control: var(--radius-md);
81
+ --ds-radius-panel: var(--radius-lg);
82
+ --ds-radius-pill: var(--radius-pill);
83
+
71
84
  /* Component-scoped radius — kept only when the semantic intent matters
72
85
  beyond the value itself, OR when the global scale doesn't fit. */
73
86
  --radius-flat: var(--radius-0); /* explicit "intentionally squared" — middle of btn-group, in-range datepicker */
@@ -106,10 +119,21 @@
106
119
  0 16px 32px hsl(var(--shadow-tint-h) var(--shadow-tint-s) var(--shadow-tint-l) / 14%);
107
120
  --shadow-4: 0 16px 32px hsl(var(--shadow-tint-h) var(--shadow-tint-s) var(--shadow-tint-l) / 12%),
108
121
  0 24px 48px hsl(var(--shadow-tint-h) var(--shadow-tint-s) var(--shadow-tint-l) / 18%);
109
- --shadow-popover: var(--shadow-2);
110
- --shadow-modal: var(--shadow-4);
111
- --shadow-toast: var(--shadow-3);
112
- --shadow-card: var(--shadow-1);
122
+
123
+ /* Elevation ROLES, and the older --shadow-<surface> aliases now point AT them
124
+ rather than at a step: setting a role moves every surface at that height,
125
+ while an alias still retunes one family. Four roles, not the three first
126
+ sketched — the library genuinely uses four heights, and folding toast into
127
+ `overlay` would have changed its shadow. */
128
+ --ds-elevation-raised: var(--shadow-1);
129
+ --ds-elevation-overlay: var(--shadow-2);
130
+ --ds-elevation-floating: var(--shadow-3);
131
+ --ds-elevation-modal: var(--shadow-4);
132
+
133
+ --shadow-popover: var(--ds-elevation-overlay);
134
+ --shadow-modal: var(--ds-elevation-modal);
135
+ --shadow-toast: var(--ds-elevation-floating);
136
+ --shadow-card: var(--ds-elevation-raised);
113
137
 
114
138
  /* Backdrop blur */
115
139
  --blur-sm: 4px;
@@ -168,6 +192,27 @@
168
192
  --ease-accelerate: cubic-bezier(.3, 0, 1, 1);
169
193
  --ease-spring: cubic-bezier(.5, 1.5, .5, 1);
170
194
 
195
+ /* Motion ROLES — the per-surface --ds-<surface>-enter/leave-* hooks defaulted
196
+ straight to the raw scale, so "make every panel entrance snappier" meant
197
+ retuning each surface. A role names the intent once and every surface at that
198
+ scale follows. Defaults equal the values each surface already used, so nothing
199
+ moves until a role is set.
200
+ FIVE roles, not the four first sketched: panel LEAVES run at --duration-base,
201
+ not fast, so folding them into `exit` would have sped them up. Two resolvers
202
+ stay on the raw scale on purpose — ds-loading-overlay and the toast leave use
203
+ --ease-standard, which no role carries, and inventing a role for two sites
204
+ would be worse than naming the value. */
205
+ --ds-motion-enter-panel-duration: var(--duration-fast);
206
+ --ds-motion-enter-panel-easing: var(--ease-decelerate);
207
+ --ds-motion-enter-surface-duration: var(--duration-base);
208
+ --ds-motion-enter-surface-easing: var(--ease-decelerate);
209
+ --ds-motion-enter-large-duration: var(--duration-slow);
210
+ --ds-motion-enter-large-easing: var(--ease-decelerate);
211
+ --ds-motion-exit-duration: var(--duration-fast);
212
+ --ds-motion-exit-easing: var(--ease-accelerate);
213
+ --ds-motion-exit-large-duration: var(--duration-base);
214
+ --ds-motion-exit-large-easing: var(--ease-accelerate);
215
+
171
216
  /* Opacity — semantic, purpose-named (Material/Carbon/Polaris convention).
172
217
  Each token has a real consumer in the codebase; symmetric "unused"
173
218
  numeric stops are deliberately omitted. */
@@ -374,6 +419,9 @@
374
419
  --modal-w-fullscreen: calc(100vw - var(--space-6));
375
420
  --modal-h-fullscreen: calc(100vh - var(--space-6));
376
421
 
422
+ /* Auth layout */
423
+ --auth-card-w: 420px;
424
+
377
425
  /* Drawer */
378
426
  --drawer-w-sm: 320px;
379
427
  --drawer-w-md: 480px;
@@ -395,9 +443,6 @@
395
443
  --field-floating-label-top: 8px;
396
444
  --field-num-stepper-w: var(--space-8);
397
445
 
398
- /* Search */
399
- --search-h: var(--hit-md);
400
-
401
446
  /* OTP / PIN input — one box per digit. */
402
447
  --otp-cell-w: var(--space-12); /* 48px */
403
448
  --otp-cell-h: var(--space-14); /* 56px */
@@ -494,9 +539,9 @@
494
539
  --empty-icon-size: var(--space-16); /* 64px */
495
540
  --empty-body-maxw: 360px;
496
541
 
497
- /* Combobox */
498
- --combobox-offset: var(--space-1); /* gap below trigger */
499
- --combobox-maxh: 280px; /* listbox max height */
542
+ /* Pickers — the listbox panel shared by autocomplete and multi-select. */
543
+ --picker-offset: var(--space-1); /* gap below trigger */
544
+ --picker-maxh: 280px; /* listbox max height */
500
545
 
501
546
  /* Command palette (cmdk) */
502
547
  --cmdk-w: 560px;
@@ -153,7 +153,7 @@
153
153
  color: var(--ds-t-mono-inline-color, var(--text-primary));
154
154
  background-color: var(--ds-t-mono-inline-bg-color, var(--surface-secondary));
155
155
  padding: 1px var(--space-1);
156
- border-radius: var(--ds-t-mono-inline-radius, var(--radius-sm));
156
+ border-radius: var(--ds-t-mono-inline-radius, var(--ds-radius-inner));
157
157
  }
158
158
 
159
159
  .t-mono-block {
@@ -165,7 +165,7 @@
165
165
  border-width: var(--border-width-default);
166
166
  border-style: solid;
167
167
  border-color: var(--ds-t-mono-block-border-color, var(--border-divider));
168
- border-radius: var(--ds-t-mono-block-radius, var(--radius-md));
168
+ border-radius: var(--ds-t-mono-block-radius, var(--ds-radius-control));
169
169
  padding: var(--space-3) var(--space-4);
170
170
  max-width: 100%;
171
171
  overflow-x: auto;
package/styles/ds.scss CHANGED
@@ -23,6 +23,7 @@
23
23
  @forward 'reset';
24
24
  @forward 'typography';
25
25
  @forward 'link';
26
+ @forward 'focus';
26
27
  @forward 'ds-color';
27
28
  @forward 'layout-utils';
28
29
  @forward 'page-grid';