@sensiblestats/widget-react 0.37.0 → 0.37.2

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,17 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.37.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Match odds accordion: add a per-row market pin. Each accordion market row now shows the PinToggle on the right of its header (visible collapsed or expanded); tapping pins that market ({kind:'market', matchId, marketDeveloperName}) to the Odds tab, mirroring the pin on chat betting cards. The row header splits into an expand button + the pin button so the two actions stay independent.
8
+
9
+ ## 0.37.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Match odds accordion polish: add a gap between the pinned-match card and the accordion; keep the "Add to slip" button on one line (long selection labels wrap instead); and render the expanded odds card bare inside the accordion so odds rows aren't double-bordered (the standalone market-odds card on the Odds/Chat tabs keeps its border).
14
+
3
15
  ## 0.37.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1807,7 +1807,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader }) {
1807
1807
  const hasNamedTeams = !!vm.homeTeamName && !!vm.awayTeamName;
1808
1808
  const showPin = !!monitor && vm.pinEnabled;
1809
1809
  const showHeader = !!vm.competition || vm.isLive || !!kickoff || showPin;
1810
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ss-w-mocard", children: [
1810
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: hideHeader ? "ss-w-mocard ss-w-mocard--bare" : "ss-w-mocard", children: [
1811
1811
  !hideHeader && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
1812
1812
  showHeader ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "ss-w-bi-header", children: [
1813
1813
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-bi-header-left", children: vm.competition ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
@@ -2980,20 +2980,31 @@ function MarketAccordion({ match, monitor, ui, slip }) {
2980
2980
  const key = `${match.matchId}:${m.marketDeveloperName}`;
2981
2981
  const entry = monitor.marketOdds[key];
2982
2982
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: isOpen ? "ss-w-acc-row ss-w-acc-row-open" : "ss-w-acc-row", children: [
2983
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
2984
- "button",
2985
- {
2986
- type: "button",
2987
- className: "ss-w-acc-head",
2988
- onClick: () => monitor.toggleMarket(match.matchId, m.marketDeveloperName),
2989
- children: [
2990
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-chevron", children: isOpen ? "\u25BE" : "\u25B8" }),
2991
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-label", children: m.marketLabel }),
2992
- m.hasInsight && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-badge", children: "\u2605" }),
2993
- m.suspended && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-susp", children: ui.accordionSuspended })
2994
- ]
2995
- }
2996
- ),
2983
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "ss-w-acc-head", children: [
2984
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
2985
+ "button",
2986
+ {
2987
+ type: "button",
2988
+ className: "ss-w-acc-toggle",
2989
+ "aria-expanded": isOpen,
2990
+ onClick: () => monitor.toggleMarket(match.matchId, m.marketDeveloperName),
2991
+ children: [
2992
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-chevron", children: isOpen ? "\u25BE" : "\u25B8" }),
2993
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-label", children: m.marketLabel }),
2994
+ m.hasInsight && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-badge", children: "\u2605" }),
2995
+ m.suspended && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ss-w-acc-susp", children: ui.accordionSuspended })
2996
+ ]
2997
+ }
2998
+ ),
2999
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3000
+ PinToggle,
3001
+ {
3002
+ ui,
3003
+ monitor,
3004
+ pin: { kind: "market", matchId: match.matchId, marketDeveloperName: m.marketDeveloperName }
3005
+ }
3006
+ )
3007
+ ] }),
2997
3008
  isOpen && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "ss-w-acc-panel", children: [
2998
3009
  entry?.error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2999
3010
  "div",
@@ -3513,6 +3524,9 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3513
3524
  /* market odds card */
3514
3525
  .ss-w-mocards { display: flex; flex-direction: column; gap: 7px; }
3515
3526
  .ss-w-mocard { 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: 6px; }
3527
+ /* Embedded inside the market accordion, which already provides the card frame + accent rail --
3528
+ drop the inner frame so odds rows aren't double-bordered. */
3529
+ .ss-w-mocard--bare { border: none; border-radius: 0; padding: 0; background: none; }
3516
3530
  .ss-w-mo-sub { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
3517
3531
  .ss-w-mo-teams { font-size: 13px; font-weight: 650; color: var(--ss-w-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3518
3532
  .ss-w-mo-market { font-size: 11.5px; font-weight: 600; color: var(--ss-w-faint); }
@@ -3523,7 +3537,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3523
3537
  .ss-w-mo-rows { display: flex; flex-direction: column; gap: 4px; }
3524
3538
  .ss-w-mo-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--ss-w-line); }
3525
3539
  .ss-w-mo-row:last-child { border-bottom: none; }
3526
- .ss-w-mo-sel { font-size: 12.5px; font-weight: 600; color: var(--ss-w-ink); }
3540
+ .ss-w-mo-sel { font-size: 12.5px; font-weight: 600; color: var(--ss-w-ink); flex: 1; min-width: 0; }
3527
3541
  .ss-w-mo-price { margin-left: auto; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; color: var(--ss-w-accent); }
3528
3542
  /* Movement: BOTH directions share --ss-w-faint on purpose. Green-good/red-bad would frame a
3529
3543
  shortening price as a discount, which inverts what it actually means for the bettor. */
@@ -3534,7 +3548,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3534
3548
  a flex row, and must NOT follow the badge into the insight card's odds column. */
3535
3549
  .ss-w-mo-row .ss-w-move { margin-left: auto; }
3536
3550
  .ss-w-mo-row .ss-w-move + .ss-w-mo-price { margin-left: 0; }
3537
- .ss-w-mo-row .ss-w-slip { margin: 0; }
3551
+ .ss-w-mo-row .ss-w-slip { margin: 0; flex: none; }
3538
3552
  .ss-w-mo-foot { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--ss-w-faint); }
3539
3553
 
3540
3554
  /* odds movement card */
@@ -3586,7 +3600,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3586
3600
 
3587
3601
  /* add to slip */
3588
3602
  .ss-w-slip { position: relative; display: flex; }
3589
- .ss-w-slip-btn { font-size: 11.5px; font-weight: 620; color: var(--ss-w-cta-ink); background: var(--ss-w-cta); border: 1px solid var(--ss-w-cta); border-radius: 14px; padding: 5px 12px; cursor: pointer; }
3603
+ .ss-w-slip-btn { font-size: 11.5px; font-weight: 620; color: var(--ss-w-cta-ink); background: var(--ss-w-cta); border: 1px solid var(--ss-w-cta); border-radius: 14px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
3590
3604
  .ss-w-slip-btn:disabled { opacity: .6; cursor: default; background: var(--ss-w-bubble); color: var(--ss-w-faint); border-color: var(--ss-w-line); }
3591
3605
  /* Anchored to the RIGHT of its (narrow) button wrapper and sized by content, growing leftward
3592
3606
  into the card -- inheriting the wrapper's width squeezes the text to one character per line.
@@ -4051,13 +4065,17 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
4051
4065
 
4052
4066
  /* market accordion (Task 9): one collapsed row per available market, expanding into a reused
4053
4067
  MarketOddsCardList ladder (hideHeader -- the row header already carries the market label). */
4068
+ /* Pinned-match tile: the match card + its odds accordion, spaced apart. */
4069
+ .ss-w-mon-item { display: flex; flex-direction: column; gap: 10px; }
4054
4070
  .ss-w-acc { display: flex; flex-direction: column; gap: 6px; }
4055
4071
  .ss-w-acc-row { background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 12px; border-left: 3px solid var(--ss-w-accent); overflow: hidden; }
4056
- .ss-w-acc-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 11px; background: none; border: none; cursor: pointer; text-align: left; font: inherit; color: var(--ss-w-ink); }
4057
- .ss-w-acc-chevron { color: var(--ss-w-faint); font-size: 11px; }
4058
- .ss-w-acc-label { font-size: 12.5px; font-weight: 600; }
4059
- .ss-w-acc-badge { font-size: 10.5px; font-weight: 700; color: var(--ss-w-accent); }
4060
- .ss-w-acc-susp { margin-left: auto; font-size: 10.5px; color: var(--ss-w-faint); }
4072
+ /* Row header: expand toggle (flex:1) + the market PinToggle as a sibling (no nested buttons). */
4073
+ .ss-w-acc-head { display: flex; align-items: center; gap: 8px; padding: 6px 9px 6px 11px; }
4074
+ .ss-w-acc-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; text-align: left; font: inherit; color: var(--ss-w-ink); padding: 5px 0; }
4075
+ .ss-w-acc-chevron { color: var(--ss-w-faint); font-size: 11px; flex: none; }
4076
+ .ss-w-acc-label { font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
4077
+ .ss-w-acc-badge { font-size: 10.5px; font-weight: 700; color: var(--ss-w-accent); flex: none; }
4078
+ .ss-w-acc-susp { margin-left: auto; font-size: 10.5px; color: var(--ss-w-faint); flex: none; }
4061
4079
  .ss-w-acc-panel { padding: 0 11px 10px; display: flex; flex-direction: column; gap: 8px; }
4062
4080
  .ss-w-acc-insight { font-size: 12px; color: var(--ss-w-ink); background: color-mix(in srgb, var(--ss-w-accent) 9%, var(--ss-w-panel)); border-radius: 8px; padding: 7px 9px; }
4063
4081
  .ss-w-acc-retry { font-size: 12px; color: var(--ss-w-neg); cursor: pointer; padding: 6px 0; }