@gerege-systems/eid-mongolia-sdk 0.28.0 → 0.28.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/dist/button.cjs CHANGED
@@ -395,6 +395,8 @@ var T = {
395
395
  mn: {
396
396
  button: "eID-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
397
397
  title: "eID-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
398
+ // Лого «e-ID» гэж бичигддэг тул логотой үед «eID»-г давтахгүй: [лого]-ээр нэвтрэх.
399
+ withLogo: ["", "-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445"],
398
400
  close: "\u0425\u0430\u0430\u0445",
399
401
  loading: "\u0410\u0447\u0430\u0430\u043B\u0436 \u0431\u0430\u0439\u043D\u0430",
400
402
  qrAlt: "\u041D\u044D\u0432\u0442\u0440\u044D\u0445 QR \u043A\u043E\u0434 \u2014 \u0443\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445 eID Mongolia \u0430\u043F\u043F\u0430\u0430\u0440 \u0443\u043D\u0448\u0443\u0443\u043B\u043D\u0430",
@@ -434,6 +436,7 @@ var T = {
434
436
  en: {
435
437
  button: "Log in with eID",
436
438
  title: "Log in with eID",
439
+ withLogo: ["Log in with ", ""],
437
440
  close: "Close",
438
441
  loading: "Loading",
439
442
  qrAlt: "Login QR code \u2014 scan it with the eID Mongolia app on your phone",
@@ -533,6 +536,8 @@ h2, p, ol { margin: 0; }
533
536
  .btn-outline:hover { background: var(--_eid-bg-muted); }
534
537
  .btn-sm { width: auto; min-height: 36px; padding: 0 14px; font-size: 0.8125rem; }
535
538
  .trigger { width: auto; }
539
+ .brand { display: inline-flex; align-items: center; gap: 6px; }
540
+ .brand.tight { gap: 2px; }
536
541
  .logo { display: block; flex: none; height: 16px; width: auto; aspect-ratio: 3840 / 1372; fill: var(--_eid-logo); }
537
542
  .trigger.icon-only .logo { height: 12px; }
538
543
  .trigger.icon-only { width: 44px; height: 44px; padding: 0; }
@@ -707,15 +712,28 @@ var EidLoginButton = class extends Base {
707
712
  console.warn('<eid-login-button>: icon="none" \u0431\u0430 \u0442\u0435\u043A\u0441\u0442\u0433\u04AF\u0439 (variant="icon" \u044D\u0441\u0432\u044D\u043B label="") \u2014 \u0430\u043D\u0445\u0434\u0430\u0433\u0447 \u0442\u0435\u043A\u0441\u0442\u0438\u0439\u0433 \u0445\u0430\u0440\u0443\u0443\u043B\u0430\u0432.');
708
713
  }
709
714
  }
715
+ const brand = hasIcon && !iconOnly && !label;
710
716
  const nodes = [];
711
- if (hasIcon) nodes.push(logo({ part: "icon" }));
712
- if (!iconOnly) nodes.push(el("span", { part: "label" }, text));
717
+ if (brand) nodes.push(this.brand({ part: "icon" }, { part: "label" }));
718
+ else {
719
+ if (hasIcon) nodes.push(logo({ part: "icon" }));
720
+ if (!iconOnly) nodes.push(el("span", { part: "label" }, text));
721
+ }
713
722
  this.trigger.replaceChildren(...nodes);
714
723
  this.trigger.classList.toggle("icon-only", iconOnly);
715
724
  const aria = this.getAttribute("aria-label") || (iconOnly ? text : null);
716
725
  if (aria) this.trigger.setAttribute("aria-label", aria);
717
726
  else this.trigger.removeAttribute("aria-label");
718
727
  }
728
+ /** Лого + i18n-ийн өмнөх/дараах текст. Лого aria-hidden тул уншигчид sr-only «eID» — нэр нь бүтэн «eID-ээр нэвтрэх». */
729
+ brand(logoAttrs = {}, textAttrs = {}) {
730
+ const [pre, post] = this.t.withLogo;
731
+ const box = el("span", { class: post && !pre ? "brand tight" : "brand" });
732
+ if (pre) box.append(el("span", textAttrs, pre));
733
+ box.append(logo(logoAttrs), el("span", { class: "sr-only" }, "eID"));
734
+ if (post) box.append(el("span", textAttrs, post));
735
+ return box;
736
+ }
719
737
  disconnectedCallback() {
720
738
  this.close();
721
739
  this.themeObs?.disconnect();
@@ -763,7 +781,9 @@ var EidLoginButton = class extends Base {
763
781
  const head = el("div", { class: "head" });
764
782
  const x = el("button", { type: "button", class: "x", "aria-label": this.t.close }, "\xD7");
765
783
  x.addEventListener("click", () => this.close());
766
- head.append(logo(), el("h2", { id: "eid-title" }, this.t.title), x);
784
+ const h2 = el("h2", { id: "eid-title" });
785
+ h2.append(this.brand());
786
+ head.append(h2, x);
767
787
  this.body = el("div");
768
788
  this.live = el("p", { class: "sr-only", "aria-live": "polite" });
769
789
  dlg.append(head, this.body, this.live);
package/dist/button.d.cts CHANGED
@@ -75,6 +75,8 @@ declare class EidLoginButton extends Base {
75
75
  attributeChangedCallback(name: string): void;
76
76
  /** Trigger-ийн агуулга: label / icon / variant / aria-label-аас. Хоосон товч хэзээ ч үүсгэхгүй. */
77
77
  private renderTrigger;
78
+ /** Лого + i18n-ийн өмнөх/дараах текст. Лого aria-hidden тул уншигчид sr-only «eID» — нэр нь бүтэн «eID-ээр нэвтрэх». */
79
+ private brand;
78
80
  disconnectedCallback(): void;
79
81
  /** Одоогийн бодит схем (`theme` + auto үед хуудас/OS). */
80
82
  get scheme(): Scheme;
package/dist/button.d.ts CHANGED
@@ -75,6 +75,8 @@ declare class EidLoginButton extends Base {
75
75
  attributeChangedCallback(name: string): void;
76
76
  /** Trigger-ийн агуулга: label / icon / variant / aria-label-аас. Хоосон товч хэзээ ч үүсгэхгүй. */
77
77
  private renderTrigger;
78
+ /** Лого + i18n-ийн өмнөх/дараах текст. Лого aria-hidden тул уншигчид sr-only «eID» — нэр нь бүтэн «eID-ээр нэвтрэх». */
79
+ private brand;
78
80
  disconnectedCallback(): void;
79
81
  /** Одоогийн бодит схем (`theme` + auto үед хуудас/OS). */
80
82
  get scheme(): Scheme;
package/dist/button.js CHANGED
@@ -366,6 +366,8 @@ var T = {
366
366
  mn: {
367
367
  button: "eID-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
368
368
  title: "eID-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445",
369
+ // Лого «e-ID» гэж бичигддэг тул логотой үед «eID»-г давтахгүй: [лого]-ээр нэвтрэх.
370
+ withLogo: ["", "-\u044D\u044D\u0440 \u043D\u044D\u0432\u0442\u0440\u044D\u0445"],
369
371
  close: "\u0425\u0430\u0430\u0445",
370
372
  loading: "\u0410\u0447\u0430\u0430\u043B\u0436 \u0431\u0430\u0439\u043D\u0430",
371
373
  qrAlt: "\u041D\u044D\u0432\u0442\u0440\u044D\u0445 QR \u043A\u043E\u0434 \u2014 \u0443\u0442\u0441\u0430\u043D \u0434\u044D\u044D\u0440\u0445 eID Mongolia \u0430\u043F\u043F\u0430\u0430\u0440 \u0443\u043D\u0448\u0443\u0443\u043B\u043D\u0430",
@@ -405,6 +407,7 @@ var T = {
405
407
  en: {
406
408
  button: "Log in with eID",
407
409
  title: "Log in with eID",
410
+ withLogo: ["Log in with ", ""],
408
411
  close: "Close",
409
412
  loading: "Loading",
410
413
  qrAlt: "Login QR code \u2014 scan it with the eID Mongolia app on your phone",
@@ -504,6 +507,8 @@ h2, p, ol { margin: 0; }
504
507
  .btn-outline:hover { background: var(--_eid-bg-muted); }
505
508
  .btn-sm { width: auto; min-height: 36px; padding: 0 14px; font-size: 0.8125rem; }
506
509
  .trigger { width: auto; }
510
+ .brand { display: inline-flex; align-items: center; gap: 6px; }
511
+ .brand.tight { gap: 2px; }
507
512
  .logo { display: block; flex: none; height: 16px; width: auto; aspect-ratio: 3840 / 1372; fill: var(--_eid-logo); }
508
513
  .trigger.icon-only .logo { height: 12px; }
509
514
  .trigger.icon-only { width: 44px; height: 44px; padding: 0; }
@@ -678,15 +683,28 @@ var EidLoginButton = class extends Base {
678
683
  console.warn('<eid-login-button>: icon="none" \u0431\u0430 \u0442\u0435\u043A\u0441\u0442\u0433\u04AF\u0439 (variant="icon" \u044D\u0441\u0432\u044D\u043B label="") \u2014 \u0430\u043D\u0445\u0434\u0430\u0433\u0447 \u0442\u0435\u043A\u0441\u0442\u0438\u0439\u0433 \u0445\u0430\u0440\u0443\u0443\u043B\u0430\u0432.');
679
684
  }
680
685
  }
686
+ const brand = hasIcon && !iconOnly && !label;
681
687
  const nodes = [];
682
- if (hasIcon) nodes.push(logo({ part: "icon" }));
683
- if (!iconOnly) nodes.push(el("span", { part: "label" }, text));
688
+ if (brand) nodes.push(this.brand({ part: "icon" }, { part: "label" }));
689
+ else {
690
+ if (hasIcon) nodes.push(logo({ part: "icon" }));
691
+ if (!iconOnly) nodes.push(el("span", { part: "label" }, text));
692
+ }
684
693
  this.trigger.replaceChildren(...nodes);
685
694
  this.trigger.classList.toggle("icon-only", iconOnly);
686
695
  const aria = this.getAttribute("aria-label") || (iconOnly ? text : null);
687
696
  if (aria) this.trigger.setAttribute("aria-label", aria);
688
697
  else this.trigger.removeAttribute("aria-label");
689
698
  }
699
+ /** Лого + i18n-ийн өмнөх/дараах текст. Лого aria-hidden тул уншигчид sr-only «eID» — нэр нь бүтэн «eID-ээр нэвтрэх». */
700
+ brand(logoAttrs = {}, textAttrs = {}) {
701
+ const [pre, post] = this.t.withLogo;
702
+ const box = el("span", { class: post && !pre ? "brand tight" : "brand" });
703
+ if (pre) box.append(el("span", textAttrs, pre));
704
+ box.append(logo(logoAttrs), el("span", { class: "sr-only" }, "eID"));
705
+ if (post) box.append(el("span", textAttrs, post));
706
+ return box;
707
+ }
690
708
  disconnectedCallback() {
691
709
  this.close();
692
710
  this.themeObs?.disconnect();
@@ -734,7 +752,9 @@ var EidLoginButton = class extends Base {
734
752
  const head = el("div", { class: "head" });
735
753
  const x = el("button", { type: "button", class: "x", "aria-label": this.t.close }, "\xD7");
736
754
  x.addEventListener("click", () => this.close());
737
- head.append(logo(), el("h2", { id: "eid-title" }, this.t.title), x);
755
+ const h2 = el("h2", { id: "eid-title" });
756
+ h2.append(this.brand());
757
+ head.append(h2, x);
738
758
  this.body = el("div");
739
759
  this.live = el("p", { class: "sr-only", "aria-live": "polite" });
740
760
  dlg.append(head, this.body, this.live);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gerege-systems/eid-mongolia-sdk",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "description": "e-ID Mongolia Relying Party SDK — иргэнээр утсаар нь нэвтрэлт ба хууль ёсны цахим гарын үсэг (RP-API v3, Smart-ID нийцтэй).",
5
5
  "license": "MIT",
6
6
  "type": "module",