@sensiblestats/widget-react 0.41.0 → 0.42.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.42.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Two-tier layout for betting-insight cards so nothing truncates on a narrow panel: the competition, kickoff and match pin sit on a quiet meta line above a full-width fixture line (long club names no longer clip), and the market label gets its own line above the selection · odds · slip · pin pick row. The market-odds card's fixture line adopts the same hero weight so both card types read consistently.
8
+
3
9
  ## 0.41.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1940,55 +1940,60 @@ function InsightCard({ it, ui, slip, monitor }) {
1940
1940
  const kickoff = it.kickoffUtc && ui?.bettingKickoff ? ui.bettingKickoff(it.kickoffUtc) : void 0;
1941
1941
  const hasNamedTeams = !!it.homeTeamName && !!it.awayTeamName;
1942
1942
  const leftIsFixture = hasNamedTeams || !!it.fixture;
1943
- const compInMeta = leftIsFixture && !!it.competition;
1944
1943
  const showPin = !!monitor && it.pinEnabled;
1945
1944
  const showHeader = leftIsFixture || !!it.competition || live || !!kickoff || showPin;
1945
+ const headerControls = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1946
+ live ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-live", children: [
1947
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-live-dot", "aria-hidden": "true" }),
1948
+ ui?.liveLabel ?? "Live"
1949
+ ] }) : null,
1950
+ kickoff ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-kick", children: [
1951
+ kickoff.dayLabel,
1952
+ " ",
1953
+ kickoff.time
1954
+ ] }) : null,
1955
+ showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: it.matchId } }) : null
1956
+ ] });
1946
1957
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-binsight", children: [
1947
- showHeader ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-header", children: [
1958
+ showHeader ? leftIsFixture ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-head", children: [
1959
+ it.competition || live || kickoff || showPin ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-meta", children: [
1960
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-meta-left", children: it.competition ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1961
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Crest2, { kind: "comp", url: it.competitionCrest, name: it.competition }),
1962
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-comp", children: it.competition })
1963
+ ] }) : null }),
1964
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-meta-right", children: headerControls })
1965
+ ] }) : null,
1966
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "ss-w-bi-fixture-line", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CardFixture, { it }) })
1967
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-header", children: [
1948
1968
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-header-left", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CardFixture, { it }) }),
1949
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-header-right", children: [
1950
- live ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-live", children: [
1951
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-live-dot", "aria-hidden": "true" }),
1952
- ui?.liveLabel ?? "Live"
1953
- ] }) : null,
1954
- compInMeta ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-comp-meta", title: it.competition, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Crest2, { kind: "comp", url: it.competitionCrest, name: it.competition }) }) : null,
1955
- kickoff ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-kick", children: [
1956
- kickoff.dayLabel,
1957
- " ",
1958
- kickoff.time
1959
- ] }) : null,
1960
- showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: it.matchId } }) : null
1961
- ] })
1969
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-header-right", children: headerControls })
1962
1970
  ] }) : null,
1963
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-action-row", children: [
1964
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-pick", children: [
1965
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-market", children: it.market }),
1966
- it.selection ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1967
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-pick-dot", "aria-hidden": "true", children: "\xB7" }),
1968
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-sel", children: it.selection })
1969
- ] }) : null
1970
- ] }),
1971
- it.odds ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-odds", children: [
1972
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: it.odds }),
1973
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OddsMovementBadge, { previous: it.previousOdds, current: it.odds, direction: it.movementDirection, ui }),
1974
- it.bookmaker ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-book", children: it.bookmaker }) : null
1975
- ] }) : null,
1976
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AddToSlipButton, { it, slip, ui }),
1977
- showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1978
- PinToggle,
1979
- {
1980
- ui,
1981
- monitor,
1982
- pin: {
1983
- kind: "selection",
1984
- matchId: it.matchId,
1985
- marketDeveloperName: it.marketDeveloperName,
1986
- selectionLabel: it.selectionLabel,
1987
- line: it.line,
1988
- matchOddsId: it.matchOddsId
1971
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-action", children: [
1972
+ it.market ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-market", children: it.market }) : null,
1973
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-bi-pick-row", children: [
1974
+ it.selection ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-sel", children: it.selection }) : null,
1975
+ it.odds ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "ss-w-bi-odds", children: [
1976
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: it.odds }),
1977
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OddsMovementBadge, { previous: it.previousOdds, current: it.odds, direction: it.movementDirection, ui }),
1978
+ it.bookmaker ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-book", children: it.bookmaker }) : null
1979
+ ] }) : null,
1980
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AddToSlipButton, { it, slip, ui }),
1981
+ showPin && ui ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1982
+ PinToggle,
1983
+ {
1984
+ ui,
1985
+ monitor,
1986
+ pin: {
1987
+ kind: "selection",
1988
+ matchId: it.matchId,
1989
+ marketDeveloperName: it.marketDeveloperName,
1990
+ selectionLabel: it.selectionLabel,
1991
+ line: it.line,
1992
+ matchOddsId: it.matchOddsId
1993
+ }
1989
1994
  }
1990
- }
1991
- ) : null
1995
+ ) : null
1996
+ ] })
1992
1997
  ] }),
1993
1998
  it.isMarketFloor ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-bi-floor", children: ui?.marketFloorLabel ?? "Market price \xB7 not a value pick" }) : null,
1994
1999
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ReasonStrip, { it, ui }),
@@ -3698,10 +3703,18 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3698
3703
  .ss-w-binsights { display: flex; flex-direction: column; gap: 7px; }
3699
3704
  .ss-w-binsight { background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 12px; border-left: 3px solid var(--ss-w-accent); padding: 9px 11px; display: flex; flex-direction: column; gap: 8px; }
3700
3705
 
3701
- /* row 1: competition logo + name on the left, live badge + kickoff on the right */
3706
+ /* header, competition-hero fallback: comp on the left, live badge + kickoff + pin on the right,
3707
+ all on one line (used when there is no fixture, and by MarketOddsCardList) */
3702
3708
  .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); }
3703
3709
  .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); }
3704
3710
  .ss-w-bi-header-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
3711
+ /* two-tier header: a quiet meta line (competition + kickoff + match pin) stacked above the
3712
+ fixture, so long club names get the whole width to themselves and stop truncating (u350) */
3713
+ .ss-w-bi-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 7px; border-bottom: 1px solid var(--ss-w-line); }
3714
+ .ss-w-bi-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
3715
+ .ss-w-bi-meta-left { display: inline-flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
3716
+ .ss-w-bi-meta-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
3717
+ .ss-w-bi-fixture-line { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 700; color: var(--ss-w-ink); }
3705
3718
  .ss-w-bi-comp { font-size: 10.5px; color: var(--ss-w-faint); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
3706
3719
  .ss-w-bi-kick { font-size: 10.5px; font-weight: 600; color: var(--ss-w-faint); white-space: nowrap; flex: none; }
3707
3720
  .ss-w-bi-live { font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: #c0392b; border-radius: 4px; padding: 1px 5px; display: inline-flex; align-items: center; gap: 4px; flex: none; }
@@ -3713,24 +3726,24 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3713
3726
  .ss-w-bi-crest { width: 24px; height: 24px; flex: none; display: block; border-radius: 50%; object-fit: contain; }
3714
3727
  .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)); }
3715
3728
 
3716
- /* header fixture atoms (team hero lives in .ss-w-bi-header-left; comp demotes to the meta) */
3729
+ /* fixture atoms -- crest-flanked team pair; shared by the insight fixture line and MarketOddsCardList */
3717
3730
  .ss-w-bi-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3718
3731
  .ss-w-bi-vs { font-size: 10px; font-weight: 600; color: var(--ss-w-faint); flex: none; }
3719
3732
  .ss-w-bi-fixture-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3720
- .ss-w-bi-comp-meta { display: inline-flex; align-items: center; gap: 5px; flex: none; min-width: 0; }
3721
- /* shared crest-flanked team row, still consumed by MarketOddsCardList */
3722
- .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); }
3723
-
3724
- /* row 2: one action line -- market \xB7 selection (left, market ellipsises first), odds, slip button */
3725
- .ss-w-bi-action-row { display: flex; align-items: center; gap: 9px; }
3726
- .ss-w-bi-pick { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
3727
- .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; }
3728
- .ss-w-bi-pick-dot { flex: none; color: var(--ss-w-faint); font-weight: 700; }
3729
- .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; }
3730
- .ss-w-bi-odds { flex: none; display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
3733
+ /* shared crest-flanked team row (MarketOddsCardList); matches .ss-w-bi-fixture-line's hero weight
3734
+ so the fixture reads the same on both card types (u350) */
3735
+ .ss-w-bi-fixture { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 13px; font-weight: 700; color: var(--ss-w-ink); }
3736
+
3737
+ /* row 2, two-tier: the market label owns a full-width line above the pick row (selection grows
3738
+ left, odds + slip + pin sit right), so neither the market name nor the fixture clips (u350) */
3739
+ .ss-w-bi-action { display: flex; flex-direction: column; gap: 6px; }
3740
+ .ss-w-bi-market { font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); min-width: 0; }
3741
+ .ss-w-bi-pick-row { display: flex; align-items: center; gap: 9px; }
3742
+ .ss-w-bi-sel { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
3743
+ .ss-w-bi-odds { flex: none; margin-left: auto; display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
3731
3744
  .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; }
3732
3745
  .ss-w-bi-book { font-size: 9.5px; color: var(--ss-w-faint); }
3733
- .ss-w-bi-action-row .ss-w-slip { flex: none; }
3746
+ .ss-w-bi-pick-row .ss-w-slip { flex: none; }
3734
3747
 
3735
3748
  /* row 3: bar-chart glyph + reasoning prose + stats-expander chevron, in a subtle strip */
3736
3749
  .ss-w-bi-reason { display: flex; align-items: flex-start; gap: 8px; background: var(--ss-w-bubble); border-radius: 10px; padding: 8px 10px; }