@sensiblestats/widget-react 0.118.0 → 0.118.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.
package/dist/index.js CHANGED
@@ -1528,7 +1528,7 @@ function parseOddsFormat(value) {
1528
1528
  }
1529
1529
 
1530
1530
  // src/version.generated.ts
1531
- var WIDGET_REACT_VERSION = "0.118.0";
1531
+ var WIDGET_REACT_VERSION = "0.118.1";
1532
1532
 
1533
1533
  // src/config.ts
1534
1534
  function normalizeUi(cfg) {
@@ -10289,12 +10289,13 @@ function useNbaForm(match, monitor) {
10289
10289
  return monitor.playerProps?.[monitorMatchKey(void 0, match.matchId)]?.bundle?.nbaForm ?? null;
10290
10290
  }
10291
10291
  var won = (g) => g.teamScore > g.opponentScore;
10292
- function Cell2({ abbr, team, ui }) {
10293
- if (!team) return /* @__PURE__ */ jsx73("div", { className: "ss-w-nbaform-cell" });
10292
+ function Cell2({ abbr, team, home, ui }) {
10293
+ const cls = home ? "ss-w-nbaform-cell ss-w-nbaform-cell--home" : "ss-w-nbaform-cell";
10294
+ if (!team) return /* @__PURE__ */ jsx73("div", { className: cls });
10294
10295
  const games = [...team.last5].reverse();
10295
10296
  const chip = restChip(ui, team);
10296
10297
  const letters = games.map((g) => won(g) ? ui.nba.formWin : ui.nba.formLoss).join(", ");
10297
- return /* @__PURE__ */ jsxs68("div", { className: "ss-w-nbaform-cell", children: [
10298
+ return /* @__PURE__ */ jsxs68("div", { className: cls, children: [
10298
10299
  games.length > 0 && /* @__PURE__ */ jsx73("span", { className: "ss-w-nbaform-dots", role: "img", "aria-label": ui.nba.formDotsAria(abbr, letters), children: games.map((g, i) => /* @__PURE__ */ jsx73(
10299
10300
  "span",
10300
10301
  {
@@ -10311,7 +10312,7 @@ function NbaFormStrip({ match, monitor, ui }) {
10311
10312
  if (!form || !b || !form.home && !form.away) return null;
10312
10313
  return /* @__PURE__ */ jsxs68("div", { className: "ss-w-nbaform-strip", children: [
10313
10314
  /* @__PURE__ */ jsx73(Cell2, { abbr: b.awayAbbreviation, team: form.away, ui }),
10314
- /* @__PURE__ */ jsx73(Cell2, { abbr: b.homeAbbreviation, team: form.home, ui })
10315
+ /* @__PURE__ */ jsx73(Cell2, { abbr: b.homeAbbreviation, team: form.home, home: true, ui })
10315
10316
  ] });
10316
10317
  }
10317
10318
 
@@ -10378,16 +10379,24 @@ function NbaFormSection({ match, monitor, ui }) {
10378
10379
  if (!active) return null;
10379
10380
  const { team, abbr } = active;
10380
10381
  const isHome = active.key === "home";
10381
- return /* @__PURE__ */ jsxs69("section", { className: "ss-w-nbaform-section", lang: ui.locale, children: [
10382
- /* @__PURE__ */ jsx74("button", { type: "button", className: "ss-w-nbaform-toggle", "aria-expanded": open, onClick: () => setOpen((o) => !o), children: ui.nba.formTitle }),
10383
- open && /* @__PURE__ */ jsxs69("div", { className: "ss-w-nbaform-body", children: [
10384
- /* @__PURE__ */ jsx74("div", { className: "ss-w-nbaform-tabs", role: "tablist", children: sides.map((s) => /* @__PURE__ */ jsx74(
10382
+ const record = (t) => {
10383
+ const w = t.last5.filter((g) => g.teamScore > g.opponentScore).length;
10384
+ return `${w}\u2013${t.last5.length - w}`;
10385
+ };
10386
+ const summary = sides.map((s) => `${s.abbr} ${record(s.team)}`).join(" \xB7 ");
10387
+ return /* @__PURE__ */ jsxs69("section", { className: "ss-w-acc-row ss-w-nbaform-section", lang: ui.locale, children: [
10388
+ /* @__PURE__ */ jsx74("div", { className: "ss-w-acc-head", children: /* @__PURE__ */ jsxs69("button", { type: "button", className: "ss-w-acc-toggle", "aria-expanded": open, onClick: () => setOpen((o) => !o), children: [
10389
+ /* @__PURE__ */ jsx74("span", { className: "ss-w-acc-chevron", "aria-hidden": "true", children: open ? "\u25BE" : "\u25B8" }),
10390
+ /* @__PURE__ */ jsx74("span", { className: "ss-w-acc-label", children: ui.nba.formTitle }),
10391
+ /* @__PURE__ */ jsx74("span", { className: "ss-w-nbaform-sum", children: summary })
10392
+ ] }) }),
10393
+ open && /* @__PURE__ */ jsxs69("div", { className: "ss-w-acc-panel ss-w-nbaform-body", children: [
10394
+ /* @__PURE__ */ jsx74("div", { className: `ss-w-props-seg ss-w-nbaform-seg--${sides.length}`, children: sides.map((s) => /* @__PURE__ */ jsx74(
10385
10395
  "button",
10386
10396
  {
10387
10397
  type: "button",
10388
- role: "tab",
10389
- "aria-selected": s.key === active.key,
10390
- className: s.key === active.key ? "ss-w-nbaform-tab ss-w-nbaform-tab--on" : "ss-w-nbaform-tab",
10398
+ className: "ss-w-props-side",
10399
+ "aria-pressed": s.key === active.key,
10391
10400
  onClick: () => setSide(s.key),
10392
10401
  children: ui.nba.formTab(s.abbr)
10393
10402
  },
@@ -10804,8 +10813,8 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
10804
10813
  ] })
10805
10814
  ] }),
10806
10815
  /* @__PURE__ */ jsx77(MarketAccordion, { match, monitor, ui, slip }),
10807
- /* @__PURE__ */ jsx77(NbaPropsSection, { match, monitor, ui, slip }, match.matchId),
10808
- /* @__PURE__ */ jsx77(NbaFormSection, { match, monitor, ui }, `form-${match.matchId}`)
10816
+ /* @__PURE__ */ jsx77(NbaFormSection, { match, monitor, ui }, `form-${match.matchId}`),
10817
+ /* @__PURE__ */ jsx77(NbaPropsSection, { match, monitor, ui, slip }, match.matchId)
10809
10818
  ] });
10810
10819
  }
10811
10820
 
@@ -18385,6 +18394,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18385
18394
  .ss-w-nflform-wbadge--tie { background: var(--ss-w-track); color: var(--ss-w-ink); }
18386
18395
  .ss-w-nbaform-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 6px 0 2px; }
18387
18396
  .ss-w-nbaform-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; min-height: 0; }
18397
+ .ss-w-nbaform-cell--home { align-items: flex-end; }
18388
18398
  .ss-w-nbaform-dots { display: inline-flex; gap: 4px; align-items: center; }
18389
18399
  .ss-w-nbaform-dot { width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; }
18390
18400
  .ss-w-nbaform-dot--w { background: var(--ss-w-pos); }
@@ -18393,14 +18403,11 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18393
18403
  .ss-w-nbaform-chip { padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
18394
18404
  .ss-w-nbaform-chip--dark { background: var(--ss-w-nav); color: #fff; }
18395
18405
  .ss-w-nbaform-chip--light { background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); }
18396
- .ss-w-nbaform-section { display: flex; flex-direction: column; }
18397
- .ss-w-nbaform-toggle { width: 100%; min-height: 44px; border: 0; border-top: 1px solid var(--ss-w-line); background: none; font: inherit; font-size: 12px; font-weight: 700; color: var(--ss-w-accent); text-align: left; padding: 0 12px; cursor: pointer; }
18398
- .ss-w-nbaform-toggle:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: -2px; }
18399
- .ss-w-nbaform-body { display: flex; flex-direction: column; gap: 6px; padding: 4px 12px 12px; min-width: 0; }
18400
- .ss-w-nbaform-tabs { display: flex; gap: 6px; }
18401
- .ss-w-nbaform-tab { flex: 1; min-height: 36px; border: 1px solid var(--ss-w-line); border-radius: 8px; background: var(--ss-w-bubble); font: inherit; font-size: 12px; font-weight: 700; color: var(--ss-w-ink); cursor: pointer; }
18402
- .ss-w-nbaform-tab--on { background: var(--ss-w-nav); border-color: var(--ss-w-nav); color: #fff; }
18403
- .ss-w-nbaform-tab:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 1px; }
18406
+ .ss-w-nbaform-section { min-width: 0; }
18407
+ .ss-w-nbaform-sum { margin-left: auto; flex: none; font-size: 11px; font-weight: 700; color: var(--ss-w-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
18408
+ .ss-w-nbaform-body { gap: 6px; min-width: 0; }
18409
+ .ss-w-nbaform-seg--1 { grid-template-columns: minmax(0, 1fr); }
18410
+ .ss-w-nbaform-seg--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
18404
18411
  .ss-w-nbaform-rest { margin: 0; font-size: 12px; line-height: 1.4; color: var(--ss-w-ink); }
18405
18412
  .ss-w-nbaform-row { display: flex; align-items: center; gap: 8px; min-height: 36px; border-top: 1px solid var(--ss-w-line); min-width: 0; }
18406
18413
  .ss-w-nbaform-badge { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; font-size: 10.5px; font-weight: 800; color: #fff; }