@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 +6 -0
- package/dist/index.cjs +24 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/dist/styles.css +14 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4162,11 +4162,13 @@ function HeroTile({ tile, onTap, oddsLabel }) {
|
|
|
4162
4162
|
] })
|
|
4163
4163
|
] });
|
|
4164
4164
|
}
|
|
4165
|
-
function DashboardTile({ tile, onTap, oddsLabel = "Odds" }) {
|
|
4165
|
+
function DashboardTile({ tile, onTap, oddsLabel = "Odds", badgePlacement = "meta" }) {
|
|
4166
4166
|
if (tile.emphasis === "hero") return /* @__PURE__ */ jsx20(HeroTile, { tile, onTap, oddsLabel });
|
|
4167
4167
|
const spanClass = tile.span === "full" ? "ss-w-dash-tile--full" : "ss-w-dash-tile--half";
|
|
4168
4168
|
const crests = (tile.imageUrls ?? []).slice(0, MAX_CRESTS);
|
|
4169
|
-
const
|
|
4169
|
+
const endBadge = badgePlacement === "end" && tile.badgeText ? tile.badgeText : null;
|
|
4170
|
+
const metaBadge = endBadge ? null : tile.badgeText;
|
|
4171
|
+
const hasMeta = Boolean(metaBadge) || crests.length > 0;
|
|
4170
4172
|
return /* @__PURE__ */ jsxs16("button", { type: "button", className: `ss-w-dash-tile ${spanClass}`, onClick: onTap, children: [
|
|
4171
4173
|
/* @__PURE__ */ jsx20("span", { className: "ss-w-dash-tile-icon", children: /* @__PURE__ */ jsx20(DashboardIcon, { name: tile.icon }) }),
|
|
4172
4174
|
/* @__PURE__ */ jsxs16("span", { className: "ss-w-dash-tile-body", children: [
|
|
@@ -4177,12 +4179,12 @@ function DashboardTile({ tile, onTap, oddsLabel = "Odds" }) {
|
|
|
4177
4179
|
// icon/chevron row -- at the half-span tile's ~180px width a nowrap badge alone
|
|
4178
4180
|
// (~70px) left the title column at ~22px and forced character-by-character wrapping.
|
|
4179
4181
|
/* @__PURE__ */ jsxs16("span", { className: "ss-w-dash-tile-meta", children: [
|
|
4180
|
-
|
|
4182
|
+
metaBadge ? /* @__PURE__ */ jsx20("span", { className: "ss-w-dash-tile-badge", children: metaBadge }) : null,
|
|
4181
4183
|
crests.length > 0 ? /* @__PURE__ */ jsx20("span", { className: "ss-w-dash-tile-crests", children: crests.map((url, i) => /* @__PURE__ */ jsx20("span", { className: "ss-w-dash-tile-crest", style: { backgroundImage: `url(${url})` }, "aria-hidden": "true" }, `${url}-${i}`)) }) : null
|
|
4182
4184
|
] })
|
|
4183
4185
|
) : null
|
|
4184
4186
|
] }),
|
|
4185
|
-
/* @__PURE__ */ jsx20("span", { className: "ss-w-dash-tile-chevron", children: /* @__PURE__ */ jsx20(ChevronIcon, {}) })
|
|
4187
|
+
endBadge ? /* @__PURE__ */ jsx20("span", { className: "ss-w-dash-tile-value", children: endBadge }) : /* @__PURE__ */ jsx20("span", { className: "ss-w-dash-tile-chevron", children: /* @__PURE__ */ jsx20(ChevronIcon, {}) })
|
|
4186
4188
|
] });
|
|
4187
4189
|
}
|
|
4188
4190
|
|
|
@@ -4197,12 +4199,14 @@ function layoutClass(layout) {
|
|
|
4197
4199
|
return Object.prototype.hasOwnProperty.call(LAYOUT_CLASSES, layout) ? LAYOUT_CLASSES[layout] : LAYOUT_CLASSES.goal;
|
|
4198
4200
|
}
|
|
4199
4201
|
function GreetingDashboard({ dashboard, onTap, oddsLabel }) {
|
|
4200
|
-
|
|
4202
|
+
const layout = layoutClass(dashboard.layout);
|
|
4203
|
+
const badgePlacement = layout === LAYOUT_CLASSES.goal ? "end" : "meta";
|
|
4204
|
+
return /* @__PURE__ */ jsxs17("div", { className: `ss-w-dash ${layout}`, children: [
|
|
4201
4205
|
/* @__PURE__ */ jsxs17("div", { className: "ss-w-dash-head", children: [
|
|
4202
4206
|
/* @__PURE__ */ jsx21("span", { className: "ss-w-dash-title", children: dashboard.title }),
|
|
4203
4207
|
dashboard.subtitle ? /* @__PURE__ */ jsx21("span", { className: "ss-w-dash-subtitle", children: dashboard.subtitle }) : null
|
|
4204
4208
|
] }),
|
|
4205
|
-
/* @__PURE__ */ jsx21("div", { className: "ss-w-dash-grid", children: dashboard.tiles.map((t, i) => /* @__PURE__ */ jsx21(DashboardTile, { tile: t, onTap: () => onTap(t, i), oddsLabel }, `${t.title}-${i}`)) }),
|
|
4209
|
+
/* @__PURE__ */ jsx21("div", { className: "ss-w-dash-grid", children: dashboard.tiles.map((t, i) => /* @__PURE__ */ jsx21(DashboardTile, { tile: t, onTap: () => onTap(t, i), oddsLabel, badgePlacement }, `${t.title}-${i}`)) }),
|
|
4206
4210
|
dashboard.footerTip ? /* @__PURE__ */ jsx21("span", { className: "ss-w-dash-foot", children: dashboard.footerTip }) : null
|
|
4207
4211
|
] });
|
|
4208
4212
|
}
|
|
@@ -9835,9 +9839,21 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
9835
9839
|
part of that visual language rather than a plain unstyled button. */
|
|
9836
9840
|
.ss-w-dash--market .ss-w-dash-tile { border-left: 3px solid var(--ss-w-accent); }
|
|
9837
9841
|
|
|
9838
|
-
/* Goal: one column of
|
|
9842
|
+
/* Goal: one column of compact cards, 60px tall with the badge as a price column on the right.
|
|
9843
|
+
The value ink is accent mixed toward ink (as on the hero price): plain light accent on the
|
|
9844
|
+
panel is 3.9:1, under the 4.5:1 small text needs. */
|
|
9839
9845
|
.ss-w-dash--goal .ss-w-dash-grid { grid-template-columns: 1fr; }
|
|
9840
|
-
.ss-w-dash--goal .ss-w-dash-tile {
|
|
9846
|
+
.ss-w-dash--goal .ss-w-dash-tile { gap: 12px; min-height: 60px; padding: 8px 12px 8px 14px; border-radius: 8px; }
|
|
9847
|
+
.ss-w-dash--goal .ss-w-dash-tile:hover { background: var(--ss-w-bubble); }
|
|
9848
|
+
.ss-w-dash--goal .ss-w-dash-tile-icon { width: 24px; height: 24px; font-size: 20px; }
|
|
9849
|
+
.ss-w-dash--goal .ss-w-dash-tile-body { gap: 1px; }
|
|
9850
|
+
.ss-w-dash--goal .ss-w-dash-tile-title { font-size: 15px; line-height: 1.25; }
|
|
9851
|
+
.ss-w-dash--goal .ss-w-dash-tile-subtitle { font-size: 13px; line-height: 1.3; overflow-wrap: break-word; }
|
|
9852
|
+
.ss-w-dash-tile-value {
|
|
9853
|
+
flex: none; margin-left: auto; max-width: 40%; text-align: right;
|
|
9854
|
+
font-size: 16px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
|
|
9855
|
+
color: color-mix(in srgb, var(--ss-w-accent) 70%, var(--ss-w-ink));
|
|
9856
|
+
}
|
|
9841
9857
|
|
|
9842
9858
|
/* Discovery: tinted bento cards. Stacked (icon over text) so a two- or three-word title gets
|
|
9843
9859
|
the tile's full width instead of the ~100px left of a horizontal icon+chevron -- that narrow
|