@trading-game/design-intelligence-layer 1.0.3 → 1.0.4

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/src/styles.css CHANGED
@@ -23,6 +23,7 @@
23
23
  --color-background-primary-canvas: var(--background-primary-canvas);
24
24
  --color-background-primary-surface: var(--background-primary-surface);
25
25
  --color-background-secondary-surface: var(--background-secondary-surface);
26
+ --color-background-disabled-default: var(--background-disabled-default);
26
27
  --color-background-hover-default: var(--background-hover-default);
27
28
  --color-background-pressed-default: var(--background-pressed-default);
28
29
  --color-background-brand-default: var(--background-brand-default);
@@ -53,6 +54,8 @@
53
54
  --color-border-default-default: var(--border-default-default);
54
55
  --color-border-prominent-default: var(--border-prominent-default);
55
56
  --color-border-neutral-default: var(--border-neutral-default);
57
+ --color-border-control-default: var(--border-control-default);
58
+ --color-border-disabled-default: var(--border-disabled-default);
56
59
  --color-border-success-default: var(--border-success-default);
57
60
  --color-border-error-default: var(--border-error-default);
58
61
  --color-border-warning-default: var(--border-warning-default);
@@ -62,7 +65,10 @@
62
65
  --color-text-disabled-default: var(--text-disabled-default);
63
66
  --color-text-prominent-inverse: var(--text-prominent-inverse);
64
67
  --color-text-subtle-inverse: var(--text-subtle-inverse);
68
+ --color-text-disabled-inverse: var(--text-disabled-inverse);
65
69
  --color-text-on-brand-static: var(--text-on-brand-static);
70
+ --color-text-on-brand-subtle-static: var(--text-on-brand-subtle-static);
71
+ --color-text-on-brand-disabled-default: var(--text-on-brand-disabled-default);
66
72
  --color-text-brand-container-static: var(--text-brand-container-static);
67
73
  --color-text-success-default: var(--text-success-default);
68
74
  --color-text-error-default: var(--text-error-default);
@@ -75,6 +81,7 @@
75
81
  --color-icon-error-default: var(--icon-error-default);
76
82
  --color-icon-warning-default: var(--icon-warning-default);
77
83
  --color-icon-information-default: var(--icon-information-default);
84
+ --color-icon-on-brand-static: var(--icon-on-brand-static);
78
85
  --color-ring-focus-default: var(--ring-focus-default);
79
86
  --color-ring-focus-strong: var(--ring-focus-strong);
80
87
  --color-ring-focus-soft: var(--ring-focus-soft);
@@ -538,6 +545,15 @@
538
545
  --background-primary-canvas: var(--primitive-blue-25);
539
546
  --background-primary-surface: var(--primitive-mono-50);
540
547
  --background-secondary-surface: var(--primitive-mono-100);
548
+ /* The disabled glaze — an alpha layer laid OVER whatever fill the control
549
+ already has, so every variant keeps its own identity while draining.
550
+ Consume it on background-image, never background-color, or it replaces
551
+ the fill instead of washing it.
552
+ Polarity is the inverse of hover: hover advances (black in light, white
553
+ in dark), disabled recedes (white in light, black in dark). The strengths
554
+ differ because the ground does — white moves fast against a near-white
555
+ page, black moves slowly against a near-black canvas. */
556
+ --background-disabled-default: var(--primitive-white-alpha-24);
541
557
  --background-hover-default: var(--primitive-black-alpha-4);
542
558
  --background-pressed-default: var(--primitive-black-alpha-8);
543
559
  --background-brand-default: var(--primitive-blue-600);
@@ -623,6 +639,17 @@
623
639
  /* Border */
624
640
  --border-default-default: var(--primitive-mono-200);
625
641
  --border-prominent-default: var(--primitive-mono-1100);
642
+ /* The outline edge on a bordered control. One step firmer than the
643
+ shared hairline, because a control's edge has to hold its own label:
644
+ Button secondary's fill barely separates from the canvas (1.06:1), so
645
+ the border does the containing. Deliberately NOT border-default-default
646
+ (that hairline is shared with Card, Input, Table, Chip) and NOT
647
+ border-neutral-default (Steps connectors own that). */
648
+ --border-control-default: var(--primitive-mono-400);
649
+ /* A disabled control keeps its edge so the shape still reads, one step
650
+ quieter than the enabled hairline. The glaze washes the fill; the border
651
+ is a separate colour, so it needs its own rung. */
652
+ --border-disabled-default: var(--primitive-mono-300);
626
653
 
627
654
  /* Status borders — solid status-600 outline, same in both themes */
628
655
  --border-neutral-default: var(--primitive-mono-500);
@@ -634,13 +661,30 @@
634
661
 
635
662
  /* Text */
636
663
  --text-prominent-default: var(--primitive-mono-1100);
637
- --text-subtle-default: var(--primitive-mono-900);
638
- --text-disabled-default: var(--primitive-mono-500);
664
+ /* One step lighter than mono-900 so the drop off prominent widens from
665
+ 2.3x to 3.5x. Clears AA on surface (4.9:1) and canvas (4.6:1); 4.3:1 on
666
+ secondary-surface is a marginal miss, accepted because mono-900 collapses
667
+ the drop back. Dark keeps its own value — this is not a mirrored pair. */
668
+ --text-subtle-default: var(--primitive-mono-800);
669
+ --text-disabled-default: var(--primitive-mono-400);
670
+ /* Inverse is not its own palette — it is the *opposite theme's* page ladder,
671
+ because that is literally what the inverse surface is. So these three
672
+ mirror prominent/subtle/disabled from the other side: light inverse ==
673
+ dark page (mono 50 · 600 · 900), dark inverse == light page. Replaces the
674
+ old color-mix for subtle, which landed on #CDCDCD — not a ramp step, and
675
+ brighter than the dark page's own subtle. */
639
676
  --text-prominent-inverse: var(--primitive-mono-50);
640
- --text-subtle-inverse: color-mix(in srgb, var(--text-prominent-inverse) 78%, var(--background-inverse-surface));
641
- /* supporting copy on the inverse surface (Toast description) — a real
642
- mixed ink, not an opacity hack; the ingredients flip per theme. */
677
+ --text-subtle-inverse: var(--primitive-mono-600);
678
+ --text-disabled-inverse: var(--primitive-mono-900);
643
679
  --text-on-brand-static: var(--primitive-mono-50);
680
+ /* On a brand fill the ladder inverts: it descends from white through the
681
+ alpha rungs rather than climbing the mono ramp. Static, like the rest of
682
+ the on-brand family — the fill is a fixed colour. */
683
+ --text-on-brand-subtle-static: var(--primitive-white-alpha-64);
684
+ /* Disabled on brand is NOT static: the fill flips blue-600 → blue-400, and
685
+ blue-400 caps white at 4.3:1, so the rung has to come down with it.
686
+ 32 over blue-600 = 1.8:1, 24 over blue-400 = 1.5:1 — matched perception. */
687
+ --text-on-brand-disabled-default: var(--primitive-white-alpha-32);
644
688
  --text-brand-container-static: var(--primitive-blue-600);
645
689
  --text-success-default: var(--primitive-green-600);
646
690
  --text-error-default: var(--primitive-red-600);
@@ -656,6 +700,9 @@
656
700
  --icon-error-default: var(--text-error-default);
657
701
  --icon-warning-default: var(--text-warning-default);
658
702
  --icon-information-default: var(--text-information-default);
703
+ /* The namespace's on-brand member — an icon on a brand fill had no token,
704
+ so components reached for text-on-brand-static or a raw alpha primitive. */
705
+ --icon-on-brand-static: var(--text-on-brand-static);
659
706
 
660
707
  /* Ring */
661
708
  --ring-focus-default: var(--primitive-blue-600);
@@ -765,6 +812,7 @@
765
812
  --background-primary-canvas: var(--primitive-blue-1000);
766
813
  --background-primary-surface: color-mix(in srgb, white 6%, var(--primitive-blue-1000));
767
814
  --background-secondary-surface: color-mix(in srgb, white 12%, var(--primitive-blue-1000));
815
+ --background-disabled-default: var(--primitive-black-alpha-50);
768
816
  /* solid #1F1F3A — one glaze step above the card (6%) */
769
817
  /* solid #0F0F2C — base + white glaze, flattened */
770
818
  --background-hover-default: var(--primitive-white-alpha-12);
@@ -784,13 +832,21 @@
784
832
  /* Border */
785
833
  --border-default-default: var(--primitive-white-alpha-12);
786
834
  --border-prominent-default: var(--primitive-mono-50);
835
+ /* Matched to light's perceived weight: 1.83:1 here vs 1.71:1 there. */
836
+ --border-control-default: var(--primitive-white-alpha-20);
837
+ --border-disabled-default: var(--primitive-white-alpha-8);
787
838
  --border-neutral-default: var(--primitive-white-alpha-24);
788
839
 
789
840
  /* Text */
790
841
  --text-prominent-default: var(--primitive-mono-50);
791
842
  --text-subtle-default: var(--primitive-mono-600);
792
- --text-disabled-default: var(--primitive-mono-800);
843
+ --text-disabled-default: var(--primitive-mono-900);
844
+ --text-on-brand-disabled-default: var(--primitive-white-alpha-24);
845
+ /* Inverse mirrors the light page ladder here — see the note in the light
846
+ block. mono 1100 · 800 · 400, same values light's PAGE row carries. */
793
847
  --text-prominent-inverse: var(--primitive-mono-1100);
848
+ --text-subtle-inverse: var(--primitive-mono-800);
849
+ --text-disabled-inverse: var(--primitive-mono-400);
794
850
  /* status + on-brand + brand-container are static — no overrides */
795
851
 
796
852
  /* Ring */
@@ -1019,6 +1075,22 @@
1019
1075
  --input-otp-font-size: var(--primitive-font-size-20);
1020
1076
  --input-otp-font-weight: var(--primitive-font-weight-semibold);
1021
1077
  --input-otp-line-height: var(--primitive-line-height-28);
1078
+
1079
+ /* ── Result Snackbar — component type tokens (private) ──
1080
+ The figure is the whole point of the surface, so the amount keeps the
1081
+ Refined spec's bold 700 — the one sanctioned exception to the semibold
1082
+ ceiling, documented on the Typography foundation page. Sizes are the
1083
+ named steps (18 / 14 / 12); the shipped Rise/Fall values were 17/13/11
1084
+ and sat off the scale. */
1085
+ --result-snackbar-amount-font-size: var(--primitive-font-size-18);
1086
+ --result-snackbar-amount-font-weight: var(--primitive-font-weight-bold);
1087
+ --result-snackbar-amount-line-height: var(--primitive-line-height-24);
1088
+ --result-snackbar-currency-font-size: var(--primitive-font-size-14);
1089
+ --result-snackbar-currency-font-weight: var(--primitive-font-weight-semibold);
1090
+ --result-snackbar-currency-line-height: var(--primitive-line-height-20);
1091
+ --result-snackbar-terms-font-size: var(--primitive-font-size-12);
1092
+ --result-snackbar-terms-font-weight: var(--primitive-font-weight-semibold);
1093
+ --result-snackbar-terms-line-height: var(--primitive-line-height-16);
1022
1094
  /* ── Native Select — component type tokens (private) ──
1023
1095
  Same ladder as Input (12/14/16, regular). */
1024
1096
  --native-select-font-size-sm: var(--primitive-font-size-12);
@@ -1676,6 +1748,25 @@
1676
1748
  font-weight: var(--input-otp-font-weight);
1677
1749
  }
1678
1750
 
1751
+ .type-result-snackbar-amount {
1752
+ font-size: var(--result-snackbar-amount-font-size);
1753
+ line-height: var(--result-snackbar-amount-line-height);
1754
+ font-weight: var(--result-snackbar-amount-font-weight);
1755
+ font-variant-numeric: tabular-nums;
1756
+ }
1757
+
1758
+ .type-result-snackbar-currency {
1759
+ font-size: var(--result-snackbar-currency-font-size);
1760
+ line-height: var(--result-snackbar-currency-line-height);
1761
+ font-weight: var(--result-snackbar-currency-font-weight);
1762
+ }
1763
+
1764
+ .type-result-snackbar-terms {
1765
+ font-size: var(--result-snackbar-terms-font-size);
1766
+ line-height: var(--result-snackbar-terms-line-height);
1767
+ font-weight: var(--result-snackbar-terms-font-weight);
1768
+ }
1769
+
1679
1770
  .type-native-select-sm {
1680
1771
  font-size: var(--native-select-font-size-sm);
1681
1772
  line-height: var(--native-select-line-height-sm);
@@ -2079,4 +2170,49 @@
2079
2170
  }
2080
2171
  @media (prefers-reduced-motion: reduce) {
2081
2172
  [data-results-motion] { animation: none !important; }
2082
- }
2173
+ }
2174
+
2175
+ /* Result Snackbar — enters from beyond its own height with a slight
2176
+ overshoot, and reverses to leave. Reduced motion swaps both for a fade
2177
+ (handled in the component, so the card never travels). */
2178
+ @keyframes result-snackbar-in-top {
2179
+ from { transform: translateY(-130%); }
2180
+ 60% { transform: translateY(6%); }
2181
+ to { transform: translateY(0); }
2182
+ }
2183
+ @keyframes result-snackbar-out-top {
2184
+ from { transform: translateY(0); }
2185
+ to { transform: translateY(-130%); }
2186
+ }
2187
+ @keyframes result-snackbar-in-bottom {
2188
+ from { transform: translateY(130%); }
2189
+ 60% { transform: translateY(-6%); }
2190
+ to { transform: translateY(0); }
2191
+ }
2192
+ @keyframes result-snackbar-out-bottom {
2193
+ from { transform: translateY(0); }
2194
+ to { transform: translateY(130%); }
2195
+ }
2196
+ /* The illustration pops in after the card lands, untwisting in the
2197
+ direction of its outcome. */
2198
+ @keyframes result-snackbar-icon-win {
2199
+ from { transform: scale(0) rotate(-18deg); }
2200
+ 60% { transform: scale(1.18) rotate(4deg); }
2201
+ to { transform: scale(1) rotate(0); }
2202
+ }
2203
+ @keyframes result-snackbar-icon-loss {
2204
+ from { transform: scale(0) rotate(18deg); }
2205
+ 60% { transform: scale(1.18) rotate(-4deg); }
2206
+ to { transform: scale(1) rotate(0); }
2207
+ }
2208
+ /* Drain — the dwell made legible, so the dismissal reads as a timer
2209
+ expiring rather than the message being lost. */
2210
+ @keyframes result-snackbar-drain {
2211
+ from { transform: scaleX(1); }
2212
+ to { transform: scaleX(0); }
2213
+ }
2214
+ /* Reduced motion: the card fades instead of travelling. */
2215
+ @keyframes result-snackbar-fade {
2216
+ from { opacity: 0; }
2217
+ to { opacity: 1; }
2218
+ }