@sensiblestats/widget-react 0.27.0 → 0.29.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.
package/dist/styles.css CHANGED
@@ -6,6 +6,7 @@
6
6
  --ss-w-ink: #14181d; --ss-w-faint: #6b7580; --ss-w-line: #e4e8ec;
7
7
  --ss-w-panel: #ffffff; --ss-w-bubble: #f3f5f7; --ss-w-nav: #0e1622;
8
8
  --ss-w-pos: #1aa563; --ss-w-neg: #e0524b;
9
+ --ss-w-home: #3a63a8; --ss-w-away: #c8102e; --ss-w-track: #e9edf1;
9
10
  --ss-w-radius: 16px; --ss-w-offset-x: 20px; --ss-w-offset-y: 20px;
10
11
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
11
12
  font-size: 13px; line-height: 1.5; color: var(--ss-w-ink);
@@ -16,6 +17,7 @@
16
17
  --ss-w-ink: #e8edf2; --ss-w-faint: #8b95a1;
17
18
  --ss-w-line: #2a3441; --ss-w-panel: #141b24; --ss-w-bubble: #1e2732; --ss-w-nav: #0a0f16;
18
19
  --ss-w-pos: #37c891; --ss-w-neg: #f0655d;
20
+ --ss-w-home: #5b83c8; --ss-w-away: #e8384f; --ss-w-track: #232d3a;
19
21
  }
20
22
  }
21
23
  .ss-w-root[data-ss-w-theme="dark"] {
@@ -23,11 +25,13 @@
23
25
  --ss-w-ink: #e8edf2; --ss-w-faint: #8b95a1;
24
26
  --ss-w-line: #2a3441; --ss-w-panel: #141b24; --ss-w-bubble: #1e2732; --ss-w-nav: #0a0f16;
25
27
  --ss-w-pos: #37c891; --ss-w-neg: #f0655d;
28
+ --ss-w-home: #5b83c8; --ss-w-away: #e8384f; --ss-w-track: #232d3a;
26
29
  }
27
30
  .ss-w-root[data-ss-w-theme="light"] {
28
31
  --ss-w-accent: #17936a; --ss-w-cta: #f5a623; --ss-w-cta-ink: #1b1300;
29
32
  --ss-w-ink: #14181d; --ss-w-faint: #6b7580;
30
33
  --ss-w-line: #e4e8ec; --ss-w-panel: #ffffff; --ss-w-bubble: #f3f5f7; --ss-w-nav: #0e1622;
34
+ --ss-w-home: #3a63a8; --ss-w-away: #c8102e; --ss-w-track: #e9edf1;
31
35
  }
32
36
 
33
37
  /* launcher */
@@ -142,7 +146,7 @@
142
146
 
143
147
  /* row 1: competition logo + name on the left, live badge + kickoff on the right */
144
148
  .ss-w-bi-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding-bottom: 7px; border-bottom: 1px solid var(--ss-w-line); }
145
- .ss-w-bi-header-left { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
149
+ .ss-w-bi-header-left { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 12.5px; font-weight: 650; color: var(--ss-w-ink); }
146
150
  .ss-w-bi-header-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
147
151
  .ss-w-bi-comp { font-size: 10.5px; color: var(--ss-w-faint); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
148
152
  .ss-w-bi-kick { font-size: 10.5px; font-weight: 600; color: var(--ss-w-faint); white-space: nowrap; flex: none; }
@@ -155,23 +159,26 @@
155
159
  .ss-w-bi-crest { width: 24px; height: 24px; flex: none; display: block; border-radius: 50%; object-fit: contain; }
156
160
  .ss-w-bi-crest-mono { display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 16%, var(--ss-w-panel)); }
157
161
 
158
- /* row 2: crest-flanked fixture on the left, boxed action panel on the right */
159
- .ss-w-bi-body { display: flex; align-items: center; gap: 10px; }
160
- .ss-w-bi-fixture { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 12px; font-weight: 650; color: var(--ss-w-ink); }
162
+ /* header fixture atoms (team hero lives in .ss-w-bi-header-left; comp demotes to the meta) */
161
163
  .ss-w-bi-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
162
164
  .ss-w-bi-vs { font-size: 10px; font-weight: 600; color: var(--ss-w-faint); flex: none; }
163
165
  .ss-w-bi-fixture-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
164
- .ss-w-bi-action { margin-left: auto; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
165
- .ss-w-bi-action .ss-w-slip { width: 100%; }
166
- .ss-w-bi-action .ss-w-slip > button { flex: 1; width: 100%; text-align: center; border-radius: 8px; }
167
- /* The action column is narrow; let its toast size to its own text and anchor to the card's right edge instead of being clipped to the button width. */
168
- .ss-w-bi-action .ss-w-toast { left: auto; right: 0; width: max-content; max-width: 210px; white-space: normal; }
169
- .ss-w-bi-mkt { display: flex; flex-direction: column; gap: 1px; min-width: 0; align-items: flex-end; text-align: right; }
170
- .ss-w-bi-market { font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ss-w-faint); white-space: nowrap; }
171
- .ss-w-bi-sel { font-size: 11px; line-height: 1.25; color: var(--ss-w-faint); }
166
+ .ss-w-bi-comp-meta { display: inline-flex; align-items: center; gap: 5px; flex: none; min-width: 0; }
167
+ /* shared crest-flanked team row, still consumed by MarketOddsCardList */
168
+ .ss-w-bi-fixture { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 12px; font-weight: 650; color: var(--ss-w-ink); }
169
+
170
+ /* row 2: one action line -- market · selection (left, market ellipsises first), odds, slip button */
171
+ .ss-w-bi-action-row { display: flex; align-items: center; gap: 9px; }
172
+ .ss-w-bi-pick { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
173
+ .ss-w-bi-market { font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ss-w-faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
174
+ .ss-w-bi-pick-dot { flex: none; color: var(--ss-w-faint); font-weight: 700; }
175
+ .ss-w-bi-sel { flex: none; font-size: 12.5px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); white-space: nowrap; }
172
176
  .ss-w-bi-odds { flex: none; display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
173
- .ss-w-bi-odds b { font-size: 23px; font-family: ui-monospace, monospace; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ss-w-accent); line-height: 1.05; }
177
+ .ss-w-bi-odds b { font-size: 20px; font-family: ui-monospace, monospace; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ss-w-accent); line-height: 1.05; }
174
178
  .ss-w-bi-book { font-size: 9.5px; color: var(--ss-w-faint); }
179
+ .ss-w-bi-action-row .ss-w-slip { flex: none; }
180
+ /* let the slip toast size to its own text and anchor to the card's right edge, not the button width */
181
+ .ss-w-bi-action-row .ss-w-toast { left: auto; right: 0; width: max-content; max-width: 210px; white-space: normal; }
175
182
 
176
183
  /* row 3: bar-chart glyph + reasoning prose + stats-expander chevron, in a subtle strip */
177
184
  .ss-w-bi-reason { display: flex; align-items: flex-start; gap: 8px; background: var(--ss-w-bubble); border-radius: 10px; padding: 8px 10px; }
@@ -513,27 +520,83 @@
513
520
  /* resting form: reuses the fixture last-five pill classes (ss-w-fandash-form / -form-pill) */
514
521
  .ss-w-fandash-resting-form .ss-w-fandash-form { margin-top: 2px; }
515
522
 
516
- /* live score: reuses the post-match scoreboard classes for the team/score row, with its own
517
- meta row -- minute called out in the accent color, status and competition beside it */
518
- .ss-w-fandash-live-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--ss-w-faint); }
519
- .ss-w-fandash-live-minute { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ss-w-accent); }
520
- .ss-w-fandash-live-status { font-weight: 650; color: var(--ss-w-ink); }
521
- .ss-w-fandash-live-competition { color: var(--ss-w-faint); }
522
-
523
- /* live timeline: a plain event list, the club's own events picked out in the accent color --
524
- same mechanism as the post-match goal list, plus a minute column */
525
- .ss-w-fandash-live-event-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
526
- .ss-w-fandash-live-event { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--ss-w-faint); }
527
- .ss-w-fandash-live-event--club { color: var(--ss-w-ink); font-weight: 650; }
528
- .ss-w-fandash-live-event-minute { flex: none; font-variant-numeric: tabular-nums; color: var(--ss-w-faint); }
529
- .ss-w-fandash-live-event--club .ss-w-fandash-live-event-minute { color: var(--ss-w-accent); }
530
- .ss-w-fandash-live-event-text { min-width: 0; }
531
-
532
- /* live stats: club value / stat label / opponent value, same 3-column layout as post-match
533
- stats, plus an optional momentum line underneath */
534
- .ss-w-fandash-live-stat-rows { display: flex; flex-direction: column; gap: 5px; }
535
- .ss-w-fandash-live-stat-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
523
+ /* live score: pulsing Live pill, crests (real image or a coloured initials fallback), a big
524
+ tabular score, and an optional scorers line. Also where the shared home/away venue-colour
525
+ tokens (--ss-w-home / --ss-w-away / --ss-w-track) are defined above -- the timeline and stats
526
+ cards reuse them. */
527
+ .ss-w-fandash-live-top { display: flex; align-items: center; gap: 8px; }
528
+ .ss-w-fandash-live-pill { display: inline-flex; flex: none; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--ss-w-neg); border-radius: 6px; padding: 3px 7px; }
529
+ .ss-w-fandash-live-dot { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: ss-w-fandash-live-pulse 1.3s ease-in-out infinite; }
530
+ @keyframes ss-w-fandash-live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
531
+ @media (prefers-reduced-motion: reduce) {
532
+ .ss-w-fandash-live-dot { animation: none; }
533
+ }
534
+ .ss-w-fandash-live-minute { flex: none; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
535
+ .ss-w-fandash-live-competition { margin-left: auto; font-size: 11px; font-weight: 650; color: var(--ss-w-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
536
+ .ss-w-fandash-live-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
537
+ .ss-w-fandash-live-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
538
+ .ss-w-fandash-live-side--away { flex-direction: row-reverse; text-align: right; }
539
+ .ss-w-fandash-live-crest { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 10.5px; object-fit: cover; }
540
+ .ss-w-fandash-live-crest--fallback.ss-w-fandash-live-crest--home { background: var(--ss-w-home); }
541
+ .ss-w-fandash-live-crest--fallback.ss-w-fandash-live-crest--away { background: var(--ss-w-away); }
542
+ .ss-w-fandash-live-team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--ss-w-ink); }
543
+ .ss-w-fandash-live-score-main { display: flex; align-items: baseline; justify-content: center; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; color: var(--ss-w-ink); }
544
+ .ss-w-fandash-live-score-sep { color: var(--ss-w-faint); font-weight: 500; margin: 0 4px; }
545
+ .ss-w-fandash-live-scorers { margin-top: 2px; display: flex; justify-content: flex-end; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ss-w-faint); overflow-wrap: anywhere; }
546
+ .ss-w-fandash-live-scorers-icon { flex: none; color: var(--ss-w-away); }
547
+
548
+ /* live timeline: a compact two-sided event list down a centre spine -- each club's events sit on
549
+ its own side (home left, away right), most-recent 3 shown with a "See more" toggle for the
550
+ rest. A 3-column grid (txt | badge | txt) per row; the spine itself is a ::before on the list. */
551
+ .ss-w-fandash-live-tl { position: relative; display: flex; flex-direction: column; gap: 6px; }
552
+ .ss-w-fandash-live-tl::before { content: ""; position: absolute; left: 50%; top: 1px; bottom: 1px; width: 2px; background: var(--ss-w-line); transform: translateX(-1px); }
553
+ .ss-w-fandash-live-tl-ev { display: grid; grid-template-columns: 1fr 32px 1fr; align-items: center; gap: 6px; }
554
+ .ss-w-fandash-live-tl-txt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
555
+ .ss-w-fandash-live-tl-ev--home .ss-w-fandash-live-tl-txt { grid-column: 1; justify-content: flex-end; }
556
+ .ss-w-fandash-live-tl-ev--away .ss-w-fandash-live-tl-txt { grid-column: 3; justify-content: flex-start; flex-direction: row-reverse; }
557
+ .ss-w-fandash-live-tl-who { font-weight: 650; color: var(--ss-w-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
558
+ .ss-w-fandash-live-tl-off { font-weight: 500; color: var(--ss-w-faint); }
559
+ .ss-w-fandash-live-tl-ev--goal .ss-w-fandash-live-tl-who { font-weight: 800; }
560
+ .ss-w-fandash-live-tl-badge { grid-column: 2; justify-self: center; min-width: 27px; height: 18px; padding: 0 4px; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: var(--ss-w-ink); background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); font-variant-numeric: tabular-nums; z-index: 1; }
561
+ .ss-w-fandash-live-tl-ev--goal .ss-w-fandash-live-tl-badge { background: var(--ss-w-accent); color: #fff; border-color: transparent; }
562
+ .ss-w-fandash-live-tl-ico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
563
+ .ss-w-fandash-live-tl-ico--goal { border-radius: 50%; background: color-mix(in srgb, var(--ss-w-away) 16%, transparent); }
564
+ .ss-w-fandash-live-tl-ball { width: 11px; height: 11px; border-radius: 50%; background: var(--ss-w-ink); border: 1px solid var(--ss-w-ink); }
565
+ .ss-w-fandash-live-tl-card { width: 8px; height: 11px; border-radius: 2px; display: block; }
566
+ .ss-w-fandash-live-tl-card--yellow { background: var(--ss-w-cta); }
567
+ .ss-w-fandash-live-tl-card--red { background: var(--ss-w-away); }
568
+ .ss-w-fandash-live-tl-subarrows { font-size: 11px; font-weight: 900; line-height: 1; letter-spacing: -1px; color: var(--ss-w-accent); }
569
+ .ss-w-fandash-live-tl-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ss-w-faint); }
570
+ .ss-w-fandash-live-tl-more { margin-top: 4px; width: 100%; background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); border-radius: 9px; padding: 7px; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--ss-w-accent); cursor: pointer; }
571
+ .ss-w-fandash-live-tl-more:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
572
+
573
+ /* live stats: club value / stat label / opponent value, each row backed by a home/away split
574
+ bar, plus an optional momentum wave (or its text fallback) and a club/opponent colour legend.
575
+ No side signal reaches this card, so the club is always the home token and the opponent is
576
+ always the away token -- see LiveStatsCard.tsx. */
577
+ .ss-w-fandash-live-stat-rows { display: flex; flex-direction: column; gap: 14px; }
578
+ .ss-w-fandash-live-stat { display: flex; flex-direction: column; gap: 6px; }
579
+ .ss-w-fandash-live-stat-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 8px; }
536
580
  .ss-w-fandash-live-stat-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
537
- .ss-w-fandash-live-stat-row .ss-w-fandash-live-stat-value:last-child { text-align: right; }
538
- .ss-w-fandash-live-stat-label { font-size: 10.5px; text-align: center; color: var(--ss-w-faint); text-transform: uppercase; letter-spacing: .03em; }
581
+ .ss-w-fandash-live-stat-value--home { color: var(--ss-w-home); }
582
+ .ss-w-fandash-live-stat-value--away { color: var(--ss-w-away); text-align: right; }
583
+ .ss-w-fandash-live-stat-label { font-size: 10px; font-weight: 700; text-align: center; color: var(--ss-w-faint); text-transform: uppercase; letter-spacing: .04em; }
584
+ .ss-w-fandash-live-bar { position: relative; height: 7px; border-radius: 999px; background: var(--ss-w-track); overflow: hidden; display: flex; }
585
+ .ss-w-fandash-live-bar-home { height: 100%; background: var(--ss-w-home); }
586
+ .ss-w-fandash-live-bar-away { height: 100%; background: var(--ss-w-away); margin-left: auto; }
587
+
539
588
  .ss-w-fandash-live-momentum { font-size: 11.5px; font-weight: 650; color: var(--ss-w-accent); }
589
+ .ss-w-fandash-live-mom { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--ss-w-line); }
590
+ .ss-w-fandash-live-mom-caption { display: block; margin-bottom: 5px; font-size: 10.5px; font-weight: 600; color: var(--ss-w-faint); }
591
+ .ss-w-fandash-live-mom-svg { width: 100%; height: 50px; display: block; overflow: visible; }
592
+ .ss-w-fandash-live-mom-home { fill: var(--ss-w-home); fill-opacity: .85; }
593
+ .ss-w-fandash-live-mom-away { fill: var(--ss-w-away); fill-opacity: .85; }
594
+ .ss-w-fandash-live-mom-line { fill: none; stroke: color-mix(in srgb, var(--ss-w-ink) 55%, transparent); stroke-width: 1.5; }
595
+ .ss-w-fandash-live-mom-base { stroke: var(--ss-w-line); stroke-width: 1; stroke-dasharray: 3 3; }
596
+ .ss-w-fandash-live-mom-now { fill: var(--ss-w-panel); stroke: var(--ss-w-ink); stroke-width: 1.5; }
597
+
598
+ .ss-w-fandash-live-legend { display: flex; gap: 14px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--ss-w-line); font-size: 11px; color: var(--ss-w-faint); }
599
+ .ss-w-fandash-live-legend-item { display: inline-flex; align-items: center; gap: 6px; }
600
+ .ss-w-fandash-live-legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
601
+ .ss-w-fandash-live-legend-swatch--home { background: var(--ss-w-home); }
602
+ .ss-w-fandash-live-legend-swatch--away { background: var(--ss-w-away); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sensiblestats/widget-react",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "Embeddable SensibleStats chat widget for React.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -37,7 +37,7 @@
37
37
  "prepublishOnly": "yarn build"
38
38
  },
39
39
  "dependencies": {
40
- "@sensiblestats/widget-sdk": "^0.24.0",
40
+ "@sensiblestats/widget-sdk": "^0.25.0",
41
41
  "react-markdown": "^9.0.1",
42
42
  "remark-gfm": "^4.0.0"
43
43
  },