@ids-group-ltd/ids-design-system 0.6.3 → 0.7.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.
@@ -21,7 +21,7 @@
21
21
  // wanting an eased release add `filter`/`transform` to their own transition.
22
22
 
23
23
  @mixin feedback {
24
- &:active:not(:disabled):not([disabled]):not(.is-disabled) {
24
+ &:active:not(:disabled, [disabled], .is-disabled) {
25
25
  filter: brightness(var(--ds-press-brightness, 0.9));
26
26
  transform: scale(var(--ds-press-scale, 0.97));
27
27
  }
@@ -29,6 +29,7 @@
29
29
 
30
30
  ds-badge[data-status='#{$name}'] {
31
31
  --ds-badge-bg-color: #{$bg};
32
+
32
33
  @if $text {
33
34
  --ds-badge-label-color: #{$text};
34
35
  }
@@ -0,0 +1,50 @@
1
+ // Shared enter-motion presets — the vocabulary every DS surface picks from via
2
+ // `--ds-<surface>-enter-keyframes` (overlay panels, modal, drawer, bottom-sheet,
3
+ // toast, banner, alert, loading-overlay).
4
+ //
5
+ // They live GLOBALLY on purpose: emulated view encapsulation renames @keyframes
6
+ // declared inside a component stylesheet but leaves a name held in a custom
7
+ // property untouched, so a scoped default would resolve to a name that no longer
8
+ // exists. Global keyframes are also what lets a consumer point a surface at its
9
+ // own @keyframes — those must likewise be declared in global styles.
10
+ //
11
+ // Shape comes from the SURFACE, not the keyframe: each preset reads the private
12
+ // `--_ds-enter-*` hooks that a surface's token block fills from its public
13
+ // `--ds-<surface>-enter-offset` / `-scale`. One keyframe therefore serves every
14
+ // surface, and swapping presets never loses the surface's own geometry.
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.
19
+
20
+ /* Opacity only — the calmest entrance. */
21
+ @keyframes ds-fade-in {
22
+ from {
23
+ opacity: 0;
24
+ }
25
+ }
26
+
27
+ /* Grows into place from a micro-scale — reads --_ds-enter-scale, and the
28
+ surface's transform-origin decides what it grows out of. */
29
+ @keyframes ds-scale-in {
30
+ from {
31
+ opacity: 0;
32
+ transform: scale(var(--_ds-enter-scale, 0.96));
33
+ }
34
+ }
35
+
36
+ /* Travels a short distance while fading — reads --_ds-enter-x / --_ds-enter-y. */
37
+ @keyframes ds-slide-in {
38
+ from {
39
+ opacity: 0;
40
+ transform: translate(var(--_ds-enter-x, 0), var(--_ds-enter-y, 0));
41
+ }
42
+ }
43
+
44
+ /* Edge-anchored travel with NO fade, for panels that slide fully on-screen
45
+ (drawer, bottom-sheet) where a fade would read as a flicker. */
46
+ @keyframes ds-slide-edge-in {
47
+ from {
48
+ transform: translate(var(--_ds-enter-x, 0), var(--_ds-enter-y, 0));
49
+ }
50
+ }
@@ -138,9 +138,6 @@
138
138
  --btn-focus-z: var(--layer-raised);
139
139
  --btn-group-focus-z: 2; /* focused button rises above its neighbour */
140
140
 
141
- /* ============================================================
142
- Motion
143
- ============================================================ */
144
141
  --duration-instant: 80ms;
145
142
  --duration-fast: 120ms;
146
143
  --duration-base: 180ms;
@@ -203,9 +200,6 @@
203
200
  --page-margin-desktop: var(--space-8); /* 32px */
204
201
  --page-margin-wide: var(--space-10); /* 40px */
205
202
 
206
- /* ============================================================
207
- System chrome
208
- ============================================================ */
209
203
  --scrollbar-w: 10px;
210
204
  --scrollbar-thumb: var(--neutral-300);
211
205
  --scrollbar-thumb-hover: var(--neutral-400);
@@ -265,9 +259,6 @@
265
259
  --hit-comfy: 44px; /* WCAG min for touch */
266
260
  --hit-touch: 48px; /* mobile-friendly — also used by floating-label fields */
267
261
 
268
- /* ============================================================
269
- Iconography
270
- ============================================================ */
271
262
  --icon-2xs: 10px;
272
263
  --icon-xs: 12px;
273
264
  --icon-sm: 14px;
@@ -426,7 +417,7 @@
426
417
  inside component CSS. Grouped by component for readability.
427
418
  ============================================================ */
428
419
 
429
- /* Top bar / app shell */
420
+ /* Top bar / app layout */
430
421
  --topbar-h: var(--space-14); /* 56px — global app bar height */
431
422
 
432
423
  /* Sidenav internals — w / w-collapsed defined above */
@@ -598,9 +589,6 @@
598
589
  --tab-spec-dot-offset: var(--border-width-strong); /* -2px notification offset (negated inline) */
599
590
  }
600
591
 
601
- /* ============================================================
602
- Reduced motion
603
- ============================================================ */
604
592
  @media (prefers-reduced-motion: reduce) {
605
593
  :root {
606
594
  --duration-instant: 0ms;
@@ -648,6 +636,7 @@
648
636
  --sidenav-w: 200px;
649
637
  --field-floating-label-top: 4px;
650
638
  --segmented-btn-h: 20px;
639
+
651
640
  /* Ultra also compresses field + table padding (tighter than compact/comfy). */
652
641
  --field-pad-x: var(--space-2);
653
642
  --field-pad-y: var(--space-1);
package/styles/ds.scss CHANGED
@@ -30,6 +30,7 @@
30
30
  @forward 'icon-base';
31
31
  @forward 'dropdown-overlay';
32
32
  @forward 'toast-overlay';
33
+ @forward 'surface-motion';
33
34
  @forward 'overlay-motion';
34
35
  @forward 'skeleton-shimmer';
35
36
  @include bp-emit.emit-vars;
package/themes/README.md CHANGED
@@ -4,11 +4,11 @@ Colour is layered in three concerns: a **base palette** (theme-independent primi
4
4
 
5
5
  ## Architecture: three layers
6
6
 
7
- | Layer | Lives in | Examples | Applied at |
8
- | ------------------------------ | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------- |
9
- | **Base palette** (primitives) | `themes/_base-palette.scss` | `--blue-600`, `--cool-gray-*`, `--brand-gray-*`, `--red-h/s/l`, `--static-white`, fonts, `--shadow-tint-h/s` | `:root` (theme-independent) |
10
- | **Theme** (role map) | `themes/_semantic.scss` + `themes/<t>/_*.scss` | `--primary`, `--surface-canvas`, `--text-primary`, the `--neutral-*` slot, `--focus-ring` | `:root` (light) / `:root[data-theme='dark']` |
11
- | **Component / scale** | `styles/_tokens.scss`, `*.component.scss` | `--space-*`, `--radius-*`, `--ds-button-bg-color`, `--duration-fast` | `:root` (theme-independent) |
7
+ | Layer | Lives in | Examples | Applied at |
8
+ | ----------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------- |
9
+ | **Base palette** (primitives) | `themes/_base-palette.scss` | `--blue-600`, `--cool-gray-*`, `--brand-gray-*`, `--red-h/s/l`, `--static-white`, fonts, `--shadow-tint-h/s` | `:root` (theme-independent) |
10
+ | **Theme** (role map) | `themes/_semantic.scss` + `themes/<t>/_*.scss` | `--primary`, `--surface-canvas`, `--text-primary`, the `--neutral-*` slot, `--focus-ring` | `:root` (light) / `:root[data-theme='dark']` |
11
+ | **Component / scale** | `styles/_tokens.scss`, `*.component.scss` | `--space-*`, `--radius-*`, `--ds-button-bg-color`, `--duration-fast` | `:root` (theme-independent) |
12
12
 
13
13
  **Hard rule:** components NEVER consume base-palette primitives directly. `var(--blue-600)` inside `button.component.scss` is a bug — use a Tier-2 role (`--primary`, `--text-secondary`) or a component token.
14
14
 
@@ -33,8 +33,12 @@ Colour is layered in three concerns: a **base palette** (theme-independent primi
33
33
  - `<html data-theme="light">` — also light (explicit; same as the default)
34
34
 
35
35
  ```scss
36
- :root { @include light.theme; } // default
37
- :root[data-theme='dark'] { @include dark.theme; } // opt-in (complete set → fully wins)
36
+ :root {
37
+ @include light.theme;
38
+ } // default
39
+ :root[data-theme='dark'] {
40
+ @include dark.theme;
41
+ } // opt-in (complete set → fully wins)
38
42
  ```
39
43
 
40
44
  There is **no automatic `prefers-color-scheme` switch** — light is deterministic by default. To follow the OS, opt in at the app root with `provideDsTheme`: