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

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);
@@ -778,19 +826,32 @@
778
826
  --background-success-default: color-mix(in srgb, var(--primitive-green-600) 24%, var(--primitive-blue-1000));
779
827
  --background-error-default: color-mix(in srgb, var(--primitive-red-600) 24%, var(--primitive-blue-1000));
780
828
  --background-warning-default: color-mix(in srgb, var(--primitive-amber-600) 24%, var(--primitive-blue-1000));
829
+ /* The demo marker joins the status tints in dark. It had no override at
830
+ all, so it kept its light ember-50 cream and read as a light chip on a
831
+ dark canvas next to Won/Lost/Pending. Same 24%-over-canvas recipe;
832
+ ember's base step is 500, not 600 — it is a game accent. */
833
+ --background-demo-default: color-mix(in srgb, var(--primitive-ember-500) 24%, var(--primitive-blue-1000));
781
834
  --background-information-default: color-mix(in srgb, var(--primitive-azure-600) 24%, var(--primitive-blue-1000));
782
835
  --background-overlay-default: var(--primitive-black-alpha-64);
783
836
 
784
837
  /* Border */
785
838
  --border-default-default: var(--primitive-white-alpha-12);
786
839
  --border-prominent-default: var(--primitive-mono-50);
840
+ /* Matched to light's perceived weight: 1.83:1 here vs 1.71:1 there. */
841
+ --border-control-default: var(--primitive-white-alpha-20);
842
+ --border-disabled-default: var(--primitive-white-alpha-8);
787
843
  --border-neutral-default: var(--primitive-white-alpha-24);
788
844
 
789
845
  /* Text */
790
846
  --text-prominent-default: var(--primitive-mono-50);
791
847
  --text-subtle-default: var(--primitive-mono-600);
792
- --text-disabled-default: var(--primitive-mono-800);
848
+ --text-disabled-default: var(--primitive-mono-900);
849
+ --text-on-brand-disabled-default: var(--primitive-white-alpha-24);
850
+ /* Inverse mirrors the light page ladder here — see the note in the light
851
+ block. mono 1100 · 800 · 400, same values light's PAGE row carries. */
793
852
  --text-prominent-inverse: var(--primitive-mono-1100);
853
+ --text-subtle-inverse: var(--primitive-mono-800);
854
+ --text-disabled-inverse: var(--primitive-mono-400);
794
855
  /* status + on-brand + brand-container are static — no overrides */
795
856
 
796
857
  /* Ring */
@@ -1019,6 +1080,22 @@
1019
1080
  --input-otp-font-size: var(--primitive-font-size-20);
1020
1081
  --input-otp-font-weight: var(--primitive-font-weight-semibold);
1021
1082
  --input-otp-line-height: var(--primitive-line-height-28);
1083
+
1084
+ /* ── Result Snackbar — component type tokens (private) ──
1085
+ The figure is the whole point of the surface, so the amount keeps the
1086
+ Refined spec's bold 700 — the one sanctioned exception to the semibold
1087
+ ceiling, documented on the Typography foundation page. Sizes are the
1088
+ named steps (18 / 14 / 12); the shipped Rise/Fall values were 17/13/11
1089
+ and sat off the scale. */
1090
+ --result-snackbar-amount-font-size: var(--primitive-font-size-18);
1091
+ --result-snackbar-amount-font-weight: var(--primitive-font-weight-bold);
1092
+ --result-snackbar-amount-line-height: var(--primitive-line-height-24);
1093
+ --result-snackbar-currency-font-size: var(--primitive-font-size-14);
1094
+ --result-snackbar-currency-font-weight: var(--primitive-font-weight-semibold);
1095
+ --result-snackbar-currency-line-height: var(--primitive-line-height-20);
1096
+ --result-snackbar-terms-font-size: var(--primitive-font-size-12);
1097
+ --result-snackbar-terms-font-weight: var(--primitive-font-weight-semibold);
1098
+ --result-snackbar-terms-line-height: var(--primitive-line-height-16);
1022
1099
  /* ── Native Select — component type tokens (private) ──
1023
1100
  Same ladder as Input (12/14/16, regular). */
1024
1101
  --native-select-font-size-sm: var(--primitive-font-size-12);
@@ -1676,6 +1753,25 @@
1676
1753
  font-weight: var(--input-otp-font-weight);
1677
1754
  }
1678
1755
 
1756
+ .type-result-snackbar-amount {
1757
+ font-size: var(--result-snackbar-amount-font-size);
1758
+ line-height: var(--result-snackbar-amount-line-height);
1759
+ font-weight: var(--result-snackbar-amount-font-weight);
1760
+ font-variant-numeric: tabular-nums;
1761
+ }
1762
+
1763
+ .type-result-snackbar-currency {
1764
+ font-size: var(--result-snackbar-currency-font-size);
1765
+ line-height: var(--result-snackbar-currency-line-height);
1766
+ font-weight: var(--result-snackbar-currency-font-weight);
1767
+ }
1768
+
1769
+ .type-result-snackbar-terms {
1770
+ font-size: var(--result-snackbar-terms-font-size);
1771
+ line-height: var(--result-snackbar-terms-line-height);
1772
+ font-weight: var(--result-snackbar-terms-font-weight);
1773
+ }
1774
+
1679
1775
  .type-native-select-sm {
1680
1776
  font-size: var(--native-select-font-size-sm);
1681
1777
  line-height: var(--native-select-line-height-sm);
@@ -2079,4 +2175,49 @@
2079
2175
  }
2080
2176
  @media (prefers-reduced-motion: reduce) {
2081
2177
  [data-results-motion] { animation: none !important; }
2082
- }
2178
+ }
2179
+
2180
+ /* Result Snackbar — enters from beyond its own height with a slight
2181
+ overshoot, and reverses to leave. Reduced motion swaps both for a fade
2182
+ (handled in the component, so the card never travels). */
2183
+ @keyframes result-snackbar-in-top {
2184
+ from { transform: translateY(-130%); }
2185
+ 60% { transform: translateY(6%); }
2186
+ to { transform: translateY(0); }
2187
+ }
2188
+ @keyframes result-snackbar-out-top {
2189
+ from { transform: translateY(0); }
2190
+ to { transform: translateY(-130%); }
2191
+ }
2192
+ @keyframes result-snackbar-in-bottom {
2193
+ from { transform: translateY(130%); }
2194
+ 60% { transform: translateY(-6%); }
2195
+ to { transform: translateY(0); }
2196
+ }
2197
+ @keyframes result-snackbar-out-bottom {
2198
+ from { transform: translateY(0); }
2199
+ to { transform: translateY(130%); }
2200
+ }
2201
+ /* The illustration pops in after the card lands, untwisting in the
2202
+ direction of its outcome. */
2203
+ @keyframes result-snackbar-icon-win {
2204
+ from { transform: scale(0) rotate(-18deg); }
2205
+ 60% { transform: scale(1.18) rotate(4deg); }
2206
+ to { transform: scale(1) rotate(0); }
2207
+ }
2208
+ @keyframes result-snackbar-icon-loss {
2209
+ from { transform: scale(0) rotate(18deg); }
2210
+ 60% { transform: scale(1.18) rotate(-4deg); }
2211
+ to { transform: scale(1) rotate(0); }
2212
+ }
2213
+ /* Drain — the dwell made legible, so the dismissal reads as a timer
2214
+ expiring rather than the message being lost. */
2215
+ @keyframes result-snackbar-drain {
2216
+ from { transform: scaleX(1); }
2217
+ to { transform: scaleX(0); }
2218
+ }
2219
+ /* Reduced motion: the card fades instead of travelling. */
2220
+ @keyframes result-snackbar-fade {
2221
+ from { opacity: 0; }
2222
+ to { opacity: 1; }
2223
+ }