@ids-group-ltd/ids-design-system 0.4.0 → 0.5.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.
@@ -0,0 +1,57 @@
1
+ // =========================================================================
2
+ // Status colour wiring for ds-badge / ds-status-dot.
3
+ //
4
+ // The DS ships NO statuses — a consumer declares their own vocabulary here and
5
+ // wires each to a colour (a palette token, recommended, or a raw value). The
6
+ // component keys off [data-status]; these rules set the public --ds-badge-* /
7
+ // --ds-status-dot-* tokens the components already read.
8
+ //
9
+ // @use 'styles/status' as status; // ds-docs (loadPaths: src/lib)
10
+ // // @use '@ids-group-ltd/ids-design-system/styles/status' as status; // external consumer
11
+ // @include status.semantic-preset; // optional universal set
12
+ // @include status.define((
13
+ // confirmed: (bg: var(--primary-subtitle), text: var(--primary-strong), dot: var(--accent)),
14
+ // shipped: (bg: #E1EFFF, text: #0A6DB3),
15
+ // ));
16
+ //
17
+ // Map entry shape: (bg:, text?:, dot?:). `bg` required (badge fill). `text`
18
+ // optional (badge label; unset → component's --text-secondary fallback). `dot`
19
+ // optional (ds-status-dot colour; unset → falls back to `text`).
20
+ // =========================================================================
21
+
22
+ @use 'sass:map';
23
+
24
+ @mixin define($statuses) {
25
+ @each $name, $spec in $statuses {
26
+ $bg: map.get($spec, bg);
27
+ $text: map.get($spec, text);
28
+ $dot: map.get($spec, dot);
29
+
30
+ ds-badge[data-status='#{$name}'] {
31
+ --ds-badge-bg-color: #{$bg};
32
+ @if $text {
33
+ --ds-badge-label-color: #{$text};
34
+ }
35
+ }
36
+
37
+ ds-status-dot[data-status='#{$name}'] {
38
+ @if $dot {
39
+ --ds-status-dot-color: #{$dot};
40
+ } @else if $text {
41
+ --ds-status-dot-color: #{$text};
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ // Opt-in: the universal semantics wired to the DS semantic token families.
48
+ // Not emitted unless called — nothing is predefined at the factory.
49
+ @mixin semantic-preset {
50
+ @include define((
51
+ info: (bg: var(--info-subtitle), text: var(--info-text), dot: var(--info)),
52
+ success: (bg: var(--success-subtitle), text: var(--success-text), dot: var(--success)),
53
+ warning: (bg: var(--warning-subtitle), text: var(--warning-text), dot: var(--warning)),
54
+ error: (bg: var(--error-subtitle), text: var(--error-text), dot: var(--error)),
55
+ neutral: (bg: var(--surface-secondary), text: var(--text-secondary),dot: var(--icon-muted)),
56
+ ));
57
+ }
@@ -81,6 +81,10 @@
81
81
  --border-width-default: 1px; /* every border, divider, field outline */
82
82
  --border-width-strong: 2px; /* radio dot, slider thumb, tabs underline, focus ring inner band, dropzone dash */
83
83
 
84
+ /* Focus outline-offset — gap between an element edge and its focus ring;
85
+ unifies the 2px offset repeated across stepper/table/dropzone/color-picker. */
86
+ --focus-ring-offset: 2px;
87
+
84
88
  /* ============================================================
85
89
  Elevation
86
90
  Channel-split substrate so a re-skin can re-tint shadows.
@@ -306,6 +310,10 @@
306
310
  --check-indet-h: 2px;
307
311
  --radio-dot-size: 10px;
308
312
  --radio-bw-checked: var(--border-width-strong);
313
+ --check-glyph-sm: 14px; /* .size-sm / .size-lg control box — fixed, not density-scaled */
314
+ --check-glyph-lg: 24px;
315
+ --radio-glyph-sm: 14px;
316
+ --radio-glyph-lg: 24px;
309
317
 
310
318
  /* Switch */
311
319
  --switch-track-w: 36px;
@@ -371,8 +379,12 @@
371
379
  --modal-w-sm: 480px;
372
380
  --modal-w-md: 640px;
373
381
  --modal-w-lg: 800px;
382
+ --modal-w-xl: 1024px;
383
+ --modal-w-fullscreen: calc(100vw - var(--space-6));
384
+ --modal-h-fullscreen: calc(100vh - var(--space-6));
374
385
 
375
386
  /* Drawer */
387
+ --drawer-w-sm: 320px;
376
388
  --drawer-w-md: 480px;
377
389
  --drawer-w-lg: 640px;
378
390
 
@@ -394,7 +406,6 @@
394
406
 
395
407
  /* Search */
396
408
  --search-h: var(--hit-md);
397
- --search-maxw: 320px;
398
409
 
399
410
  /* OTP / PIN input — one box per digit. */
400
411
  --otp-cell-w: var(--space-12); /* 48px */
@@ -424,6 +435,7 @@
424
435
  --sidenav-logo-size: var(--hit-sm); /* 28px — square brand mark */
425
436
  --sidenav-collapsed-item: var(--hit-cozy); /* 40px — collapsed nav-item hit area */
426
437
  --sidenav-section-pad-b: var(--space-1-5); /* nav-section bottom padding */
438
+ --sidenav-item-rail-width: 3px; /* active-item left rail */
427
439
 
428
440
  /* Form section grid */
429
441
  --form-section-label-w: 280px; /* labels column width */
@@ -431,6 +443,10 @@
431
443
  /* Page header */
432
444
  --page-header-sub-mt: var(--space-1); /* subtitle top margin */
433
445
 
446
+ /* Bottom sheet */
447
+ --bottom-sheet-handle-w: 36px; /* drag-handle bar */
448
+ --bottom-sheet-handle-h: 4px;
449
+
434
450
  /* Field internals */
435
451
  --field-textarea-rows-min: 60px; /* min-h for inline textarea inside the field wrapper */
436
452
  --field-floating-pad-t: 18px; /* top padding when --floating, leaves room for label */
@@ -440,6 +456,7 @@
440
456
  /* Button group */
441
457
  --btn-group-overlap: calc(var(--border-width-default) * -1); /* -1px — collapses adjacent borders */
442
458
  --btn-link-uloff: 3px; /* underline-offset on link buttons */
459
+ --breadcrumbs-link-uloff: 2px; /* underline-offset on breadcrumb links */
443
460
 
444
461
  /* Card */
445
462
  --card-hover-lift: 1px; /* translateY on .card--hover */
@@ -448,6 +465,7 @@
448
465
  /* Sort icon (table headers) */
449
466
  --sort-ic-size: var(--icon-xs); /* 12px */
450
467
  --sort-ic-gap: var(--space-1-5); /* 6px */
468
+ --sort-ic-opacity-idle: 0.4; /* unsorted column icon */
451
469
 
452
470
  /* Tag close glyph (when literal svg sits inside .tag .x) */
453
471
  --tag-close-glyph: var(--icon-xs); /* 12px */
@@ -494,9 +512,9 @@
494
512
  --cmdk-list-maxh: var(--popover-maxh); /* alias — keeps cmdk + popover synced */
495
513
 
496
514
  /* Datepicker */
497
- --datepicker-w: 280px;
498
- --datepicker-cell-gap: var(--space-0-5); /* 2px — grid gap between day cells */
499
- --datepicker-nav-size: var(--hit-xs); /* 24px — month-step buttons */
515
+ --date-picker-w: 280px;
516
+ --date-picker-cell-gap: var(--space-0-5); /* 2px — grid gap between day cells */
517
+ --date-picker-nav-size: var(--hit-xs); /* 24px — month-step buttons */
500
518
 
501
519
  /* Modal close button */
502
520
  --modal-close-size: var(--hit-xs); /* 24px */
@@ -621,8 +639,16 @@
621
639
  --hit-min: 24px;
622
640
  --check-size: 14px;
623
641
  --switch-track-w: 24px;
624
- --switch-thumb-size: 12px;
642
+ --switch-track-h: 14px;
643
+ --switch-thumb-size: 10px;
644
+ --switch-thumb-travel: 10px;
645
+ --avatar-md: 20px;
646
+ --badge-dot-size: 4px;
647
+ --status-dot-size: 5px;
648
+ --sidenav-w: 200px;
649
+ --field-floating-label-top: 4px;
625
650
  --segmented-btn-h: 20px;
651
+ /* Ultra also compresses field + table padding (tighter than compact/comfy). */
626
652
  --field-pad-x: var(--space-2);
627
653
  --field-pad-y: var(--space-1);
628
654
  --table-cell-pad-x: var(--space-2);
@@ -77,6 +77,9 @@
77
77
  // -----------------------------------------------------------------------
78
78
  // Orange — focus / secondary signal
79
79
  // -----------------------------------------------------------------------
80
+ // HSL channels (additive — --secondary composes its fill + tints from these).
81
+ // Reproduce --orange-500 ≈ #FF7A2E; ramp stops below stay hand-picked hex.
82
+ --orange-h: 22; --orange-s: 100%; --orange-l: 59%;
80
83
  --orange-50: #FFF7F0;
81
84
  --orange-100: #FFEEDF;
82
85
  --orange-200: #FFD9B8;
@@ -148,6 +151,13 @@
148
151
  --sky-600: #2563EB;
149
152
  --sky-700: #1D4ED8;
150
153
 
154
+ // -----------------------------------------------------------------------
155
+ // Violet — tertiary brand hue. Channel-split only (--tertiary composes its
156
+ // fill + tints from these); no discrete ramp stops yet — add hand-picked hex
157
+ // if a component ever needs stepped violet swatches.
158
+ // -----------------------------------------------------------------------
159
+ --violet-h: 262; --violet-s: 70%; --violet-l: 56%;
160
+
151
161
  // -----------------------------------------------------------------------
152
162
  // Shadow tint — channel-split substrate h/s only. The lightness (-l) is
153
163
  // per-theme: light uses 7%, dark uses 95% (so the same alphas read as soft
@@ -157,10 +167,11 @@
157
167
  --shadow-tint-s: 39%;
158
168
 
159
169
  // -----------------------------------------------------------------------
160
- // Theme-stable contrast anchors — never flip with the theme. On-fill text/
161
- // icon roles point here so a dark theme keeps white-on-coloured-fill correct.
170
+ // Theme-stable ink anchor — never flips with the theme. On-DARK-fill text
171
+ // (e.g. text on the yellow warning fill) points here so it stays dark in
172
+ // both themes. On-LIGHT-fill text uses the literal `white` keyword directly
173
+ // (a token would be pure indirection — var(--x) === white for a constant).
162
174
  // -----------------------------------------------------------------------
163
- --static-white: #FFF;
164
175
  --static-ink: #161A28;
165
176
 
166
177
  // -----------------------------------------------------------------------
@@ -65,22 +65,22 @@
65
65
 
66
66
  /* Text overlaid on arbitrary imagery (camera feeds, photos) — pairs a
67
67
  guaranteed-light colour with a contrast shadow. */
68
- --text-on-media: var(--static-white);
68
+ --text-on-media: white;
69
69
  --text-on-media-shadow: 0 1px 3px hsl(0deg 0% 0% / 70%);
70
70
  --text-link: var(--blue-700);
71
- --text-on-primary: var(--static-white);
72
- --text-on-success: var(--static-white);
71
+ --text-on-primary: white;
72
+ --text-on-success: white;
73
73
 
74
74
  /* Warning fill is yellow (--yellow-400 #F4D43A) — white text on it is only
75
75
  ~1.5:1 (fails WCAG). On-warning text is the darkest neutral (~10:1). */
76
76
  --text-on-warning: var(--static-ink);
77
- --text-on-error: var(--static-white);
77
+ --text-on-error: white;
78
78
 
79
79
  /* Icons */
80
80
  --icon-default: var(--neutral-500);
81
81
  --icon-strong: var(--neutral-700);
82
82
  --icon-muted: var(--neutral-400);
83
- --icon-on-primary: var(--static-white);
83
+ --icon-on-primary: white;
84
84
 
85
85
  /* Semantic → palette bridge. The lib knows colours by PURPOSE; the theme
86
86
  (themes/light/_theme.scss) ships the concrete ramps + HSL channels. This
@@ -115,16 +115,16 @@
115
115
  --primary-muted: var(--blue-100);
116
116
  --primary-muted-strong: var(--blue-200);
117
117
  --primary-strong: var(--blue-700);
118
- --primary-on: var(--static-white);
118
+ --primary-on: white;
119
119
 
120
- /* Accent / secondary role — composed from --secondary-h/s/l channels.
121
- Channels default to brand values so unbranded apps render identical to
122
- --primary. Override --secondary-h/s/l per-brand (or via the tweaks panel)
123
- to introduce a true secondary hue — --secondary recomposes automatically.
124
- Hover/pressed derive from --secondary so any hue change propagates. */
125
- --secondary-h: var(--primary-h);
126
- --secondary-s: var(--primary-s);
127
- --secondary-l: var(--primary-l);
120
+ /* Accent / secondary role — maps onto the palette --orange family (Tier-1),
121
+ kept distinct from --primary so the brand slots read apart. Override
122
+ --secondary-h/s/l per-brand (or via the tweaks panel) to reskin it —
123
+ --secondary recomposes automatically. Hover/pressed derive from --secondary
124
+ so any hue change propagates. */
125
+ --secondary-h: var(--orange-h);
126
+ --secondary-s: var(--orange-s);
127
+ --secondary-l: var(--orange-l);
128
128
 
129
129
  --secondary: hsl(var(--secondary-h) var(--secondary-s) var(--secondary-l));
130
130
  --secondary-hover: color-mix(in srgb, var(--secondary) 88%, black);
@@ -139,12 +139,12 @@
139
139
  tonal accents (decorative chips, hierarchy tones, indicators). Mirrors
140
140
  the --primary / --secondary token-family shape: HSL channels for halo
141
141
  composition, hover/pressed via color-mix, subtle/muted ramps for tonal
142
- surfaces. Defaults to --primary channels so single-hue themes render
143
- identical to primary. Multi-hue brands override --tertiary-h/s/l (or
144
- --tertiary directly for non-HSL values). */
145
- --tertiary-h: var(--primary-h);
146
- --tertiary-s: var(--primary-s);
147
- --tertiary-l: var(--primary-l);
142
+ surfaces. Maps onto the palette --violet family (Tier-1), distinct from
143
+ --primary / --secondary. Brands override --tertiary-h/s/l (or --tertiary
144
+ directly for non-HSL values) to reskin it. */
145
+ --tertiary-h: var(--violet-h);
146
+ --tertiary-s: var(--violet-s);
147
+ --tertiary-l: var(--violet-l);
148
148
 
149
149
  --tertiary: hsl(var(--tertiary-h) var(--tertiary-s) var(--tertiary-l));
150
150
  --tertiary-hover: color-mix(in srgb, var(--tertiary) 88%, black);
@@ -200,24 +200,6 @@
200
200
  --info-border: var(--sky-200);
201
201
  --info-text: var(--sky-700);
202
202
 
203
- /* Status pills (event lifecycle).
204
- DECISION: --status-confirmed-* chains through --primary-* so a
205
- brand re-skin moves Confirmed with it. The other lifecycle
206
- stages are deliberately neutral/green/dark to keep semantic
207
- distance from brand. */
208
-
209
- /* Status pills — canonical (single system).
210
- Legacy classes `.badge--active` (single) and ad-hoc semantic
211
- pills are unified in the Badge component to consume these tokens. */
212
- --status-planning-bg-color: var(--neutral-150);
213
- --status-planning-text-color: var(--neutral-700);
214
- --status-confirmed-bg-color: var(--primary-subtitle);
215
- --status-confirmed-text-color: var(--primary-strong);
216
- --status-active-bg-color: var(--green-50);
217
- --status-active-text-color: var(--green-700);
218
- --status-completed-bg-color: var(--neutral-900);
219
- --status-completed-text-color: var(--neutral-0);
220
-
221
203
  /* Focus rings.
222
204
  Outer halos use hsla() composed from brand/danger HSL channels
223
205
  so re-skinning --primary-h propagates into focus state.
@@ -12,7 +12,7 @@
12
12
  // follow the flip: tint/subtle surfaces (near-white *-50 picks → dark hue
13
13
  // tints), on-tint text (*-text / *-strong → lighter stops), hover/pressed
14
14
  // direction, scrim (must stay dark), focus halo alpha, and charts.
15
- // On-fill text already points at theme-stable --static-white/--static-ink.
15
+ // On-dark-fill text points at --static-ink; on-light-fill uses literal white.
16
16
  // =========================================================================
17
17
 
18
18
  @use 'palette';
@@ -84,12 +84,6 @@
84
84
  --info-border: hsl(217deg 38% 32%);
85
85
  --info-text: hsl(217deg 90% 74%);
86
86
 
87
- // Status pills that referenced palette stops directly (green-50/700) — repoint
88
- // to the dark status roles so the lifecycle pill reads on dark. (planning →
89
- // neutral, confirmed → primary-*, completed → neutral all follow flips.)
90
- --status-active-bg-color: var(--success-subtitle);
91
- --status-active-text-color: var(--success-text);
92
-
93
87
  // Scrim stays dark — must NOT follow --shadow-tint-l: 95%.
94
88
  --surface-scrim: hsl(225deg 39% 4% / 70%);
95
89