@sensiblestats/widget-react 0.73.0 → 0.73.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.73.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Goal dashboard rows are compact cards: 60px tall with 8px corners, and a tile's badge shows as a price column on the right instead of a pill under the subtitle.
8
+
3
9
  ## 0.73.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -4200,11 +4200,13 @@ function HeroTile({ tile, onTap, oddsLabel }) {
4200
4200
  ] })
4201
4201
  ] });
4202
4202
  }
4203
- function DashboardTile({ tile, onTap, oddsLabel = "Odds" }) {
4203
+ function DashboardTile({ tile, onTap, oddsLabel = "Odds", badgePlacement = "meta" }) {
4204
4204
  if (tile.emphasis === "hero") return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(HeroTile, { tile, onTap, oddsLabel });
4205
4205
  const spanClass = tile.span === "full" ? "ss-w-dash-tile--full" : "ss-w-dash-tile--half";
4206
4206
  const crests = (tile.imageUrls ?? []).slice(0, MAX_CRESTS);
4207
- const hasMeta = Boolean(tile.badgeText) || crests.length > 0;
4207
+ const endBadge = badgePlacement === "end" && tile.badgeText ? tile.badgeText : null;
4208
+ const metaBadge = endBadge ? null : tile.badgeText;
4209
+ const hasMeta = Boolean(metaBadge) || crests.length > 0;
4208
4210
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: `ss-w-dash-tile ${spanClass}`, onClick: onTap, children: [
4209
4211
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ss-w-dash-tile-icon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DashboardIcon, { name: tile.icon }) }),
4210
4212
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "ss-w-dash-tile-body", children: [
@@ -4215,12 +4217,12 @@ function DashboardTile({ tile, onTap, oddsLabel = "Odds" }) {
4215
4217
  // icon/chevron row -- at the half-span tile's ~180px width a nowrap badge alone
4216
4218
  // (~70px) left the title column at ~22px and forced character-by-character wrapping.
4217
4219
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "ss-w-dash-tile-meta", children: [
4218
- tile.badgeText ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ss-w-dash-tile-badge", children: tile.badgeText }) : null,
4220
+ metaBadge ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ss-w-dash-tile-badge", children: metaBadge }) : null,
4219
4221
  crests.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ss-w-dash-tile-crests", children: crests.map((url, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ss-w-dash-tile-crest", style: { backgroundImage: `url(${url})` }, "aria-hidden": "true" }, `${url}-${i}`)) }) : null
4220
4222
  ] })
4221
4223
  ) : null
4222
4224
  ] }),
4223
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ss-w-dash-tile-chevron", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChevronIcon, {}) })
4225
+ endBadge ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ss-w-dash-tile-value", children: endBadge }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ss-w-dash-tile-chevron", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChevronIcon, {}) })
4224
4226
  ] });
4225
4227
  }
4226
4228
 
@@ -4235,12 +4237,14 @@ function layoutClass(layout) {
4235
4237
  return Object.prototype.hasOwnProperty.call(LAYOUT_CLASSES, layout) ? LAYOUT_CLASSES[layout] : LAYOUT_CLASSES.goal;
4236
4238
  }
4237
4239
  function GreetingDashboard({ dashboard, onTap, oddsLabel }) {
4238
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `ss-w-dash ${layoutClass(dashboard.layout)}`, children: [
4240
+ const layout = layoutClass(dashboard.layout);
4241
+ const badgePlacement = layout === LAYOUT_CLASSES.goal ? "end" : "meta";
4242
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `ss-w-dash ${layout}`, children: [
4239
4243
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "ss-w-dash-head", children: [
4240
4244
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "ss-w-dash-title", children: dashboard.title }),
4241
4245
  dashboard.subtitle ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "ss-w-dash-subtitle", children: dashboard.subtitle }) : null
4242
4246
  ] }),
4243
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ss-w-dash-grid", children: dashboard.tiles.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DashboardTile, { tile: t, onTap: () => onTap(t, i), oddsLabel }, `${t.title}-${i}`)) }),
4247
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ss-w-dash-grid", children: dashboard.tiles.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DashboardTile, { tile: t, onTap: () => onTap(t, i), oddsLabel, badgePlacement }, `${t.title}-${i}`)) }),
4244
4248
  dashboard.footerTip ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "ss-w-dash-foot", children: dashboard.footerTip }) : null
4245
4249
  ] });
4246
4250
  }
@@ -9873,9 +9877,21 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
9873
9877
  part of that visual language rather than a plain unstyled button. */
9874
9878
  .ss-w-dash--market .ss-w-dash-tile { border-left: 3px solid var(--ss-w-accent); }
9875
9879
 
9876
- /* Goal: one column of pill rows. */
9880
+ /* Goal: one column of compact cards, 60px tall with the badge as a price column on the right.
9881
+ The value ink is accent mixed toward ink (as on the hero price): plain light accent on the
9882
+ panel is 3.9:1, under the 4.5:1 small text needs. */
9877
9883
  .ss-w-dash--goal .ss-w-dash-grid { grid-template-columns: 1fr; }
9878
- .ss-w-dash--goal .ss-w-dash-tile { border-radius: 999px; padding: 10px 14px; }
9884
+ .ss-w-dash--goal .ss-w-dash-tile { gap: 12px; min-height: 60px; padding: 8px 12px 8px 14px; border-radius: 8px; }
9885
+ .ss-w-dash--goal .ss-w-dash-tile:hover { background: var(--ss-w-bubble); }
9886
+ .ss-w-dash--goal .ss-w-dash-tile-icon { width: 24px; height: 24px; font-size: 20px; }
9887
+ .ss-w-dash--goal .ss-w-dash-tile-body { gap: 1px; }
9888
+ .ss-w-dash--goal .ss-w-dash-tile-title { font-size: 15px; line-height: 1.25; }
9889
+ .ss-w-dash--goal .ss-w-dash-tile-subtitle { font-size: 13px; line-height: 1.3; overflow-wrap: break-word; }
9890
+ .ss-w-dash-tile-value {
9891
+ flex: none; margin-left: auto; max-width: 40%; text-align: right;
9892
+ font-size: 16px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
9893
+ color: color-mix(in srgb, var(--ss-w-accent) 70%, var(--ss-w-ink));
9894
+ }
9879
9895
 
9880
9896
  /* Discovery: tinted bento cards. Stacked (icon over text) so a two- or three-word title gets
9881
9897
  the tile's full width instead of the ~100px left of a horizontal icon+chevron -- that narrow