@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/dist/index.js CHANGED
@@ -4810,6 +4810,9 @@ function nationalityFlag(nationality) {
4810
4810
  const key = nationality.trim().toLowerCase();
4811
4811
  return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
4812
4812
  }
4813
+ function isNationCode(flag) {
4814
+ return /^[A-Z]{1,3}$/.test(flag);
4815
+ }
4813
4816
 
4814
4817
  // src/components/games/PlayerAvatar.tsx
4815
4818
  import { useState as useState24 } from "react";
@@ -5879,15 +5882,17 @@ function GuessTheXiGame({
5879
5882
  /* @__PURE__ */ jsx73("div", { className: "ss-g-gxi-rows", children: rows.map((row, r) => /* @__PURE__ */ jsx73("div", { className: "ss-g-gxi-row", children: row.map((pos, c) => {
5880
5883
  const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
5881
5884
  const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
5885
+ const flag = nationalityFlag(pos.nationality);
5882
5886
  return /* @__PURE__ */ jsxs61("div", { className: "ss-g-gxi-node", "data-revealed": name ? "true" : void 0, children: [
5883
5887
  /* @__PURE__ */ jsx73(
5884
5888
  "span",
5885
5889
  {
5886
5890
  className: "ss-g-gxi-disc",
5891
+ "data-code": isNationCode(flag) ? "true" : void 0,
5887
5892
  role: "img",
5888
5893
  title: pos.nationality,
5889
5894
  "aria-label": `${posLabel ? posLabel + " \u2014 " : ""}${pos.nationality}${name ? " \u2014 " + name : ""}`,
5890
- children: nationalityFlag(pos.nationality)
5895
+ children: flag
5891
5896
  }
5892
5897
  ),
5893
5898
  name ? /* @__PURE__ */ jsx73("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(name).last }) : posLabel && /* @__PURE__ */ jsx73("span", { className: "ss-g-gxi-pos", children: posLabel })
@@ -8349,6 +8354,16 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
8349
8354
  /* Labels stay on one line: Turkish "DAHA FAZLA" wrapped to two in a ~115px button. */
8350
8355
  .ss-g-hl-btns .ss-g-btn { font-weight: 800; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
8351
8356
  .ss-g-hl-btns .ss-g-btn svg { flex: none; }
8357
+ /* Phone-width cards: the info column is ~230px, too narrow for "DAHA FAZLA" + icon side by side.
8358
+ Drop the icons and tighten the type first; stack the buttons only when even that cannot fit. */
8359
+ .ss-g-hl-info { container: hlinfo / inline-size; }
8360
+ @container hlinfo (max-width: 280px) {
8361
+ .ss-g-hl-btns .ss-g-btn svg { display: none; }
8362
+ .ss-g-hl-btns .ss-g-btn { font-size: 12px; letter-spacing: 0; padding: 0 4px; }
8363
+ }
8364
+ @container hlinfo (max-width: 180px) {
8365
+ .ss-g-hl-btns { flex-direction: column; }
8366
+ }
8352
8367
  .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); }
8353
8368
  /* Clear the VS badge that straddles the seam between the two cards. */
8354
8369
  .ss-g-hl-pair > .ss-g-hl-card:first-child .ss-g-hl-info { padding-bottom: 24px; }
@@ -8385,6 +8400,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
8385
8400
  .ss-g-gxi-node { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; max-width: 72px; }
8386
8401
  .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; }
8387
8402
  .ss-g-gxi-node[data-revealed] .ss-g-gxi-disc { border-color: var(--ss-w-accent); }
8403
+ .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); }
8388
8404
  .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; }
8389
8405
  .ss-g-gxi-pos--name { color: var(--ss-w-accent); text-transform: uppercase; }
8390
8406
  .ss-g-gxi-wrong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }