@sensiblestats/widget-react 0.60.5 → 0.60.6

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.60.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Games: Higher/Lower buttons fit phone-width cards (icons drop and type tightens on narrow cards, stacking below 180px), and Guess the XI shows a nationality's three-letter code at a size that fits its disc when there is no flag.
8
+
3
9
  ## 0.60.5
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -4847,6 +4847,9 @@ function nationalityFlag(nationality) {
4847
4847
  const key = nationality.trim().toLowerCase();
4848
4848
  return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
4849
4849
  }
4850
+ function isNationCode(flag) {
4851
+ return /^[A-Z]{1,3}$/.test(flag);
4852
+ }
4850
4853
 
4851
4854
  // src/components/games/PlayerAvatar.tsx
4852
4855
  var import_react30 = require("react");
@@ -5916,15 +5919,17 @@ function GuessTheXiGame({
5916
5919
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "ss-g-gxi-rows", children: rows.map((row, r) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "ss-g-gxi-row", children: row.map((pos, c) => {
5917
5920
  const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
5918
5921
  const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
5922
+ const flag = nationalityFlag(pos.nationality);
5919
5923
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-gxi-node", "data-revealed": name ? "true" : void 0, children: [
5920
5924
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5921
5925
  "span",
5922
5926
  {
5923
5927
  className: "ss-g-gxi-disc",
5928
+ "data-code": isNationCode(flag) ? "true" : void 0,
5924
5929
  role: "img",
5925
5930
  title: pos.nationality,
5926
5931
  "aria-label": `${posLabel ? posLabel + " \u2014 " : ""}${pos.nationality}${name ? " \u2014 " + name : ""}`,
5927
- children: nationalityFlag(pos.nationality)
5932
+ children: flag
5928
5933
  }
5929
5934
  ),
5930
5935
  name ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(name).last }) : posLabel && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-gxi-pos", children: posLabel })
@@ -8386,6 +8391,16 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
8386
8391
  /* Labels stay on one line: Turkish "DAHA FAZLA" wrapped to two in a ~115px button. */
8387
8392
  .ss-g-hl-btns .ss-g-btn { font-weight: 800; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
8388
8393
  .ss-g-hl-btns .ss-g-btn svg { flex: none; }
8394
+ /* Phone-width cards: the info column is ~230px, too narrow for "DAHA FAZLA" + icon side by side.
8395
+ Drop the icons and tighten the type first; stack the buttons only when even that cannot fit. */
8396
+ .ss-g-hl-info { container: hlinfo / inline-size; }
8397
+ @container hlinfo (max-width: 280px) {
8398
+ .ss-g-hl-btns .ss-g-btn svg { display: none; }
8399
+ .ss-g-hl-btns .ss-g-btn { font-size: 12px; letter-spacing: 0; padding: 0 4px; }
8400
+ }
8401
+ @container hlinfo (max-width: 180px) {
8402
+ .ss-g-hl-btns { flex-direction: column; }
8403
+ }
8389
8404
  .ss-g-hl-vs { position: relative; z-index: 1; flex: none; align-self: center; width: 44px; height: 44px; margin: -28px 0; border-radius: 50%; display: grid; place-items: center; background: var(--ss-g-ground); border: 2px solid var(--ss-g-line-warm); color: var(--ss-w-accent); font: 800 18px var(--ss-g-font-display); }
8390
8405
  /* Clear the VS badge that straddles the seam between the two cards. */
8391
8406
  .ss-g-hl-pair > .ss-g-hl-card:first-child .ss-g-hl-info { padding-bottom: 24px; }
@@ -8422,6 +8437,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
8422
8437
  .ss-g-gxi-node { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; max-width: 72px; }
8423
8438
  .ss-g-gxi-disc { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ss-g-pitch-chip); border: 2px solid var(--ss-g-pitch-ink); font-size: 22px; line-height: 1; }
8424
8439
  .ss-g-gxi-node[data-revealed] .ss-g-gxi-disc { border-color: var(--ss-w-accent); }
8440
+ .ss-g-gxi-disc[data-code] { font-family: var(--ss-g-font-body); font-size: 11px; font-weight: 800; letter-spacing: .02em; color: var(--ss-g-pitch-ink); }
8425
8441
  .ss-g-gxi-pos { max-width: 100%; padding: 1px 6px; border-radius: 4px; background: var(--ss-g-pitch-chip); color: var(--ss-g-pitch-ink); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
8426
8442
  .ss-g-gxi-pos--name { color: var(--ss-w-accent); text-transform: uppercase; }
8427
8443
  .ss-g-gxi-wrong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }