@nysds/components 1.11.0 → 1.11.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/nysds.es.js CHANGED
@@ -2,12 +2,12 @@ import { css as u, LitElement as y, html as l } from "lit";
2
2
  import { property as r, query as u1, state as $ } from "lit/decorators.js";
3
3
  import { ifDefined as d } from "lit/directives/if-defined.js";
4
4
  /*!
5
- * New York State Design System (v1.11.0)
5
+ * New York State Design System (v1.11.1)
6
6
  * Description: A design system for New York State's digital products.
7
7
  * Repository: https://github.com/its-hcd/nysds
8
8
  * License: MIT
9
9
  */
10
- const i1 = u`
10
+ const a1 = u`
11
11
  :host {
12
12
  /* Anything that can be overridden should be defined here */
13
13
 
@@ -229,7 +229,7 @@ const Ne = class Ne extends y {
229
229
  </div>`;
230
230
  }
231
231
  };
232
- Ne.styles = i1;
232
+ Ne.styles = a1;
233
233
  let le = Ne;
234
234
  De([
235
235
  r({ type: String })
@@ -295,7 +295,7 @@ const Fe = class Fe extends y {
295
295
  </div>`;
296
296
  }
297
297
  };
298
- Fe.styles = i1;
298
+ Fe.styles = a1;
299
299
  let Ce = Fe;
300
300
  Ue([
301
301
  r({ type: String })
@@ -551,7 +551,7 @@ var _1 = Object.defineProperty, C1 = Object.getOwnPropertyDescriptor, P = (a, e,
551
551
  };
552
552
  let m1 = 0;
553
553
  var ne;
554
- const H = (ne = class extends y {
554
+ const A = (ne = class extends y {
555
555
  constructor() {
556
556
  super(...arguments), this.id = "", this.heading = "", this.icon = "", this.dismissible = !1, this.duration = 0, this.text = "", this.primaryAction = "", this.secondaryAction = "", this.primaryLabel = "Learn more", this.secondaryLabel = "Dismiss", this._alertClosed = !1, this._slotHasContent = !0, this._type = "base", this._timeoutId = null;
557
557
  }
@@ -668,44 +668,44 @@ const H = (ne = class extends y {
668
668
  ], ne);
669
669
  P([
670
670
  r({ type: String })
671
- ], H.prototype, "id", 2);
671
+ ], A.prototype, "id", 2);
672
672
  P([
673
673
  r({ type: String })
674
- ], H.prototype, "heading", 2);
674
+ ], A.prototype, "heading", 2);
675
675
  P([
676
676
  r({ type: String })
677
- ], H.prototype, "icon", 2);
677
+ ], A.prototype, "icon", 2);
678
678
  P([
679
679
  r({ type: Boolean, reflect: !0 })
680
- ], H.prototype, "dismissible", 2);
680
+ ], A.prototype, "dismissible", 2);
681
681
  P([
682
682
  r({ type: Number, reflect: !0 })
683
- ], H.prototype, "duration", 2);
683
+ ], A.prototype, "duration", 2);
684
684
  P([
685
685
  r({ type: String })
686
- ], H.prototype, "text", 2);
686
+ ], A.prototype, "text", 2);
687
687
  P([
688
688
  r({ type: String })
689
- ], H.prototype, "primaryAction", 2);
689
+ ], A.prototype, "primaryAction", 2);
690
690
  P([
691
691
  r({ type: String })
692
- ], H.prototype, "secondaryAction", 2);
692
+ ], A.prototype, "secondaryAction", 2);
693
693
  P([
694
694
  r({ type: String })
695
- ], H.prototype, "primaryLabel", 2);
695
+ ], A.prototype, "primaryLabel", 2);
696
696
  P([
697
697
  r({ type: String })
698
- ], H.prototype, "secondaryLabel", 2);
698
+ ], A.prototype, "secondaryLabel", 2);
699
699
  P([
700
700
  $()
701
- ], H.prototype, "_alertClosed", 2);
701
+ ], A.prototype, "_alertClosed", 2);
702
702
  P([
703
703
  $()
704
- ], H.prototype, "_slotHasContent", 2);
704
+ ], A.prototype, "_slotHasContent", 2);
705
705
  P([
706
706
  r({ reflect: !0 })
707
- ], H.prototype, "type", 1);
708
- let x1 = H;
707
+ ], A.prototype, "type", 1);
708
+ let x1 = A;
709
709
  customElements.get("nys-alert") || customElements.define("nys-alert", x1);
710
710
  const w1 = u`
711
711
  :host {
@@ -809,7 +809,7 @@ const w1 = u`
809
809
  fill: currentColor;
810
810
  }
811
811
  `;
812
- var k1 = Object.defineProperty, K = (a, e, t, o) => {
812
+ var k1 = Object.defineProperty, W = (a, e, t, o) => {
813
813
  for (var s = void 0, n = a.length - 1, i; n >= 0; n--)
814
814
  (i = a[n]) && (s = i(e, t, s) || s);
815
815
  return s && k1(e, t, s), s;
@@ -849,8 +849,8 @@ const je = class je extends y {
849
849
  document.body.removeChild(n);
850
850
  const c = i.match(/\d+/g);
851
851
  if (!c) return;
852
- const p = Number(c[0]), h = Number(c[1]), V = Number(c[2]), j = (0.299 * p + 0.587 * h + 0.114 * V) / 255 < 0.5;
853
- return this.initials?.length > 0 ? j ? s : o : j ? t : e;
852
+ const p = Number(c[0]), h = Number(c[1]), V = Number(c[2]), T = (0.299 * p + 0.587 * h + 0.114 * V) / 255 < 0.5;
853
+ return this.initials?.length > 0 ? T ? s : o : T ? t : e;
854
854
  }
855
855
  render() {
856
856
  return l`
@@ -866,7 +866,9 @@ const je = class je extends y {
866
866
  aria-label=${d(
867
867
  this.image ? void 0 : this.ariaLabel ? this.ariaLabel : "avatar"
868
868
  )}
869
- tabindex=${this.interactive && !this.disabled ? "0" : d(void 0)}
869
+ tabindex=${d(
870
+ this.interactive && !this.disabled ? 0 : void 0
871
+ )}
870
872
  >
871
873
  ${this.image?.length > 0 ? l`<img
872
874
  part="nys-avatar__image"
@@ -895,34 +897,34 @@ const je = class je extends y {
895
897
  };
896
898
  je.styles = w1;
897
899
  let I = je;
898
- K([
900
+ W([
899
901
  r({ type: String })
900
902
  ], I.prototype, "id");
901
- K([
903
+ W([
902
904
  r({ type: String })
903
905
  ], I.prototype, "ariaLabel");
904
- K([
906
+ W([
905
907
  r({ type: String })
906
908
  ], I.prototype, "image");
907
- K([
909
+ W([
908
910
  r({ type: String })
909
911
  ], I.prototype, "initials");
910
- K([
912
+ W([
911
913
  r({ type: String })
912
914
  ], I.prototype, "icon");
913
- K([
915
+ W([
914
916
  r({ type: String })
915
917
  ], I.prototype, "color");
916
- K([
918
+ W([
917
919
  r({ type: Boolean, reflect: !0 })
918
920
  ], I.prototype, "interactive");
919
- K([
921
+ W([
920
922
  r({ type: Boolean, reflect: !0 })
921
923
  ], I.prototype, "disabled");
922
- K([
924
+ W([
923
925
  r({ type: Boolean, reflect: !0 })
924
926
  ], I.prototype, "lazy");
925
- K([
927
+ W([
926
928
  $()
927
929
  ], I.prototype, "_slotHasContent");
928
930
  customElements.get("nys-avatar") || customElements.define("nys-avatar", I);
@@ -1679,8 +1681,7 @@ var S;
1679
1681
  const b = (S = class extends y {
1680
1682
  // allows use of elementInternals' API
1681
1683
  constructor() {
1682
- super(), this.id = "", this.name = "", this._size = "md", this.fullWidth = !1, this._variant = "filled", this.inverted = !1, this.label = "", this.ariaLabel = "", this.ariaControls = "", this.prefixIcon = "", this.suffixIcon = "", this.circle = !1, this.icon = "", this.disabled = !1, this.form = null, this.value = "", this.ariaDescription = "", this._type = "button", this.onClick = () => {
1683
- }, this.href = "", this._target = "_self", this._internals = this.attachInternals();
1684
+ super(), this.id = "", this.name = "", this._size = "md", this.fullWidth = !1, this._variant = "filled", this.inverted = !1, this.label = "", this.ariaLabel = "", this.ariaControls = "", this.prefixIcon = "", this.suffixIcon = "", this.circle = !1, this.icon = "", this.disabled = !1, this.form = null, this.value = "", this.ariaDescription = "", this._type = "button", this.onClick = null, this.href = "", this._target = "_self", this._internals = this.attachInternals();
1684
1685
  }
1685
1686
  get size() {
1686
1687
  return this._size;
@@ -1729,7 +1730,7 @@ const b = (S = class extends y {
1729
1730
  return `nys-button-${Date.now()}-${z1++}`;
1730
1731
  }
1731
1732
  _manageFormAction() {
1732
- typeof this.onClick == "function" && this.click();
1733
+ typeof this.onClick == "function" && this.onClick !== null && this.onClick(new Event("click"));
1733
1734
  const e = this._internals.form;
1734
1735
  if (e)
1735
1736
  switch (this.type) {
@@ -1767,9 +1768,19 @@ const b = (S = class extends y {
1767
1768
  );
1768
1769
  t && t.click();
1769
1770
  } else
1770
- this._handleClick(e);
1771
+ this._handleAnyAttributeFunction(), this._handleClick(e);
1771
1772
  }
1772
1773
  }
1774
+ /**
1775
+ * Vanilla JS & Native HTML keydown solution:
1776
+ * The <nys-button onClick="doFunction();"></nys-button> onClick is an attribute here.
1777
+ * Thus, we call it here. Otherwise, at this point, this.onClick is null as it isn't props, but a string attribute
1778
+ * In vanilla HTML/JS, clicking with execute the attribute function, BUT now with keydown, hence this solution.
1779
+ */
1780
+ _handleAnyAttributeFunction() {
1781
+ const e = this.getAttribute("onClick");
1782
+ e && new Function("return " + e)();
1783
+ }
1773
1784
  /******************** Public Methods ********************/
1774
1785
  focus(e) {
1775
1786
  const t = this.renderRoot.querySelector(
@@ -1830,7 +1841,6 @@ const b = (S = class extends y {
1830
1841
  this.ariaLabel || this.label || (this.circle ? this.icon : null) || this.prefixIcon || this.suffixIcon || "button"
1831
1842
  )}
1832
1843
  aria-description=${d(this.ariaDescription || void 0)}
1833
- onclick="${this.onClick}"
1834
1844
  @click=${this._handleClick}
1835
1845
  @focus="${this._handleFocus}"
1836
1846
  @blur="${this._handleBlur}"
@@ -1931,7 +1941,7 @@ _([
1931
1941
  ], b.prototype, "target", 1);
1932
1942
  let V1 = b;
1933
1943
  customElements.get("nys-button") || customElements.define("nys-button", V1);
1934
- const H1 = u`
1944
+ const A1 = u`
1935
1945
  :host {
1936
1946
  /* Anything that can be overridden should be defined here */
1937
1947
 
@@ -2011,10 +2021,10 @@ const H1 = u`
2011
2021
  font-weight: var(--_nys-badge-prefix-font-weight);
2012
2022
  }
2013
2023
  `;
2014
- var A1 = Object.defineProperty, B1 = Object.getOwnPropertyDescriptor, ue = (a, e, t, o) => {
2024
+ var H1 = Object.defineProperty, B1 = Object.getOwnPropertyDescriptor, ue = (a, e, t, o) => {
2015
2025
  for (var s = o > 1 ? void 0 : o ? B1(e, t) : e, n = a.length - 1, i; n >= 0; n--)
2016
2026
  (i = a[n]) && (s = (o ? i(e, t, s) : i(s)) || s);
2017
- return o && s && A1(e, t, s), s;
2027
+ return o && s && H1(e, t, s), s;
2018
2028
  }, q;
2019
2029
  const oe = (q = class extends y {
2020
2030
  constructor() {
@@ -2074,7 +2084,7 @@ const oe = (q = class extends y {
2074
2084
  "error",
2075
2085
  "success",
2076
2086
  "warning"
2077
- ], q.styles = H1, q.DEFAULT_ICONS = {
2087
+ ], q.styles = A1, q.DEFAULT_ICONS = {
2078
2088
  neutral: "info",
2079
2089
  error: "emergency_home",
2080
2090
  success: "check_circle",
@@ -2106,7 +2116,7 @@ ue([
2106
2116
  ], oe.prototype, "suffixIcon", 1);
2107
2117
  let I1 = oe;
2108
2118
  customElements.get("nys-badge") || customElements.define("nys-badge", I1);
2109
- const a1 = u`
2119
+ const l1 = u`
2110
2120
  :host {
2111
2121
  /* Anything that can be overridden should be defined here */
2112
2122
 
@@ -2489,14 +2499,14 @@ const a1 = u`
2489
2499
  border: 0;
2490
2500
  }
2491
2501
  `;
2492
- var P1 = Object.defineProperty, Z1 = Object.getOwnPropertyDescriptor, A = (a, e, t, o) => {
2502
+ var P1 = Object.defineProperty, Z1 = Object.getOwnPropertyDescriptor, H = (a, e, t, o) => {
2493
2503
  for (var s = o > 1 ? void 0 : o ? Z1(e, t) : e, n = a.length - 1, i; n >= 0; n--)
2494
2504
  (i = a[n]) && (s = (o ? i(e, t, s) : i(s)) || s);
2495
2505
  return o && s && P1(e, t, s), s;
2496
2506
  };
2497
2507
  let q1 = 0;
2498
- var W;
2499
- const E = (W = class extends y {
2508
+ var K;
2509
+ const E = (K = class extends y {
2500
2510
  // allows use of elementInternals' API
2501
2511
  constructor() {
2502
2512
  super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.tile = !1, this._tooltip = "", this.inverted = !1, this.form = null, this._slottedDescriptionText = "", this._size = "md", this._internals = this.attachInternals();
@@ -2505,7 +2515,7 @@ const E = (W = class extends y {
2505
2515
  return this._size;
2506
2516
  }
2507
2517
  set size(e) {
2508
- this._size = W.VALID_SIZES.includes(
2518
+ this._size = K.VALID_SIZES.includes(
2509
2519
  e
2510
2520
  ) ? e : "md";
2511
2521
  }
@@ -2636,47 +2646,47 @@ const E = (W = class extends y {
2636
2646
  </div>
2637
2647
  `;
2638
2648
  }
2639
- }, W.VALID_SIZES = ["sm", "md"], W.styles = a1, W.formAssociated = !0, W);
2640
- A([
2649
+ }, K.VALID_SIZES = ["sm", "md"], K.styles = l1, K.formAssociated = !0, K);
2650
+ H([
2641
2651
  r({ type: String })
2642
2652
  ], E.prototype, "id", 2);
2643
- A([
2653
+ H([
2644
2654
  r({ type: String, reflect: !0 })
2645
2655
  ], E.prototype, "name", 2);
2646
- A([
2656
+ H([
2647
2657
  r({ type: Boolean, reflect: !0 })
2648
2658
  ], E.prototype, "required", 2);
2649
- A([
2659
+ H([
2650
2660
  r({ type: Boolean, reflect: !0 })
2651
2661
  ], E.prototype, "optional", 2);
2652
- A([
2662
+ H([
2653
2663
  r({ type: Boolean, reflect: !0 })
2654
2664
  ], E.prototype, "showError", 2);
2655
- A([
2665
+ H([
2656
2666
  r({ type: String })
2657
2667
  ], E.prototype, "errorMessage", 2);
2658
- A([
2668
+ H([
2659
2669
  r({ type: String })
2660
2670
  ], E.prototype, "label", 2);
2661
- A([
2671
+ H([
2662
2672
  r({ type: String })
2663
2673
  ], E.prototype, "description", 2);
2664
- A([
2674
+ H([
2665
2675
  r({ type: Boolean, reflect: !0 })
2666
2676
  ], E.prototype, "tile", 2);
2667
- A([
2677
+ H([
2668
2678
  r({ type: String })
2669
2679
  ], E.prototype, "_tooltip", 2);
2670
- A([
2680
+ H([
2671
2681
  r({ type: Boolean, reflect: !0 })
2672
2682
  ], E.prototype, "inverted", 2);
2673
- A([
2683
+ H([
2674
2684
  r({ type: String, reflect: !0 })
2675
2685
  ], E.prototype, "form", 2);
2676
- A([
2686
+ H([
2677
2687
  $()
2678
2688
  ], E.prototype, "_slottedDescriptionText", 2);
2679
- A([
2689
+ H([
2680
2690
  r({ reflect: !0 })
2681
2691
  ], E.prototype, "size", 1);
2682
2692
  let O1 = E;
@@ -2847,7 +2857,7 @@ const w = (X = class extends y {
2847
2857
  ></nys-errormessage>` : ""}
2848
2858
  `;
2849
2859
  }
2850
- }, X.VALID_SIZES = ["sm", "md"], X.styles = a1, X.formAssociated = !0, X);
2860
+ }, X.VALID_SIZES = ["sm", "md"], X.styles = l1, X.formAssociated = !0, X);
2851
2861
  D([
2852
2862
  r({ type: Boolean, reflect: !0 })
2853
2863
  ], w.prototype, "checked", 2);
@@ -2987,10 +2997,10 @@ const Y1 = u`
2987
2997
  var(--_nys-errormessage-color);
2988
2998
  }
2989
2999
  `;
2990
- var K1 = Object.defineProperty, Te = (a, e, t, o) => {
3000
+ var W1 = Object.defineProperty, Te = (a, e, t, o) => {
2991
3001
  for (var s = void 0, n = a.length - 1, i; n >= 0; n--)
2992
3002
  (i = a[n]) && (s = i(e, t, s) || s);
2993
- return s && K1(e, t, s), s;
3003
+ return s && W1(e, t, s), s;
2994
3004
  };
2995
3005
  const Ie = class Ie extends y {
2996
3006
  // allows use of elementInternals' API
@@ -3016,7 +3026,7 @@ Te([
3016
3026
  r({ type: Boolean, reflect: !0 })
3017
3027
  ], me.prototype, "showDivider");
3018
3028
  customElements.get("nys-errormessage") || customElements.define("nys-errormessage", me);
3019
- async function W1(a, e) {
3029
+ async function K1(a, e) {
3020
3030
  if (!e || e.trim() === "") return !0;
3021
3031
  const t = e.toLowerCase().split(",").map((n) => n.trim()), o = a.name.toLowerCase(), s = o.includes(".") ? o.split(".").pop() : "";
3022
3032
  for (const n of t)
@@ -3308,7 +3318,7 @@ var J1 = Object.defineProperty, qe = (a, e, t, o) => {
3308
3318
  (i = a[n]) && (s = i(e, t, s) || s);
3309
3319
  return s && J1(e, t, s), s;
3310
3320
  };
3311
- const Ke = class Ke extends y {
3321
+ const We = class We extends y {
3312
3322
  constructor() {
3313
3323
  super(...arguments), this.filename = "", this.status = "pending", this.progress = 0, this.errorMessage = "";
3314
3324
  }
@@ -3381,8 +3391,8 @@ const Ke = class Ke extends y {
3381
3391
  `;
3382
3392
  }
3383
3393
  };
3384
- Ke.styles = Q1;
3385
- let fe = Ke;
3394
+ We.styles = Q1;
3395
+ let fe = We;
3386
3396
  qe([
3387
3397
  r({ type: String })
3388
3398
  ], fe.prototype, "filename");
@@ -3516,7 +3526,7 @@ const Pe = class Pe extends y {
3516
3526
  async _processFile(e) {
3517
3527
  e.status = "processing";
3518
3528
  try {
3519
- if (!await W1(e.file, this.accept)) {
3529
+ if (!await K1(e.file, this.accept)) {
3520
3530
  e.status = "error", e.errorMsg = "File type is invalid.", this.requestUpdate();
3521
3531
  return;
3522
3532
  }
@@ -4632,7 +4642,7 @@ var lt = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, ke = (a, e
4632
4642
  (i = a[n]) && (s = (o ? i(e, t, s) : i(s)) || s);
4633
4643
  return o && s && lt(e, t, s), s;
4634
4644
  };
4635
- const We = class We extends y {
4645
+ const Ke = class Ke extends y {
4636
4646
  constructor() {
4637
4647
  super(...arguments), this.for = "", this.label = "", this.description = "", this.flag = "", this.inverted = !1, this._tooltip = "";
4638
4648
  }
@@ -4669,8 +4679,8 @@ const We = class We extends y {
4669
4679
  `;
4670
4680
  }
4671
4681
  };
4672
- We.styles = at;
4673
- let te = We;
4682
+ Ke.styles = at;
4683
+ let te = Ke;
4674
4684
  ke([
4675
4685
  r({ type: String })
4676
4686
  ], te.prototype, "for", 2);
@@ -4890,9 +4900,9 @@ const re = (ae = class extends y {
4890
4900
  async _restorePrevFocused() {
4891
4901
  const e = this._prevFocusedElement;
4892
4902
  if (e && e.tagName.toLowerCase() === "nys-button") {
4893
- const t = await e.getButtonElement();
4894
- if (t) {
4895
- t.focus();
4903
+ const o = await e.getButtonElement();
4904
+ if (o) {
4905
+ o.focus();
4896
4906
  return;
4897
4907
  }
4898
4908
  } else
@@ -4980,10 +4990,10 @@ const re = (ae = class extends y {
4980
4990
  let h = document.activeElement, V = s.indexOf(h);
4981
4991
  if (e.shiftKey) {
4982
4992
  e.preventDefault();
4983
- let F = V - 1;
4984
- F < 0 && (F = s.length - 1);
4985
- const j = s[F];
4986
- s[F].tagName.toLowerCase() === "nys-button" ? (await j.getButtonElement())?.focus() : j.focus();
4993
+ let j = V - 1;
4994
+ j < 0 && (j = s.length - 1);
4995
+ const T = s[j];
4996
+ s[j].tagName.toLowerCase() === "nys-button" ? (await T.getButtonElement())?.focus() : T.focus();
4987
4997
  } else
4988
4998
  h === p && (e.preventDefault(), c.tagName.toLowerCase() === "nys-button" ? (await c.getButtonElement())?.focus() : c.focus());
4989
4999
  }
@@ -5318,7 +5328,7 @@ Me([
5318
5328
  r({ type: Boolean, reflect: !0 })
5319
5329
  ], ce.prototype, "_twoBeforeLast");
5320
5330
  customElements.get("nys-pagination") || customElements.define("nys-pagination", ce);
5321
- const l1 = u`
5331
+ const c1 = u`
5322
5332
  :host {
5323
5333
  /* Global Radiobutton Styles */
5324
5334
  --_nys-radiobutton-size: var(--nys-size-400, 32px);
@@ -5748,7 +5758,9 @@ const L = (Q = class extends y {
5748
5758
  }
5749
5759
  /********************** Core Keyboard & Click Logic **********************/
5750
5760
  _getAllRadios() {
5751
- return Array.from(this.querySelectorAll("nys-radiobutton"));
5761
+ return Array.from(
5762
+ this.querySelectorAll("nys-radiobutton")
5763
+ );
5752
5764
  }
5753
5765
  // Arrow / Space / Enter navigation at group level
5754
5766
  async _handleKeyDown(e) {
@@ -5822,7 +5834,9 @@ const L = (Q = class extends y {
5822
5834
  async _handleInvalid(e) {
5823
5835
  if (e.preventDefault(), this._internals.validity.valueMissing) {
5824
5836
  this.showError = !0, this._manageRequire();
5825
- const t = this.querySelector("nys-radiobutton");
5837
+ const t = this.querySelector(
5838
+ "nys-radiobutton"
5839
+ );
5826
5840
  if (t) {
5827
5841
  const o = this._internals.form;
5828
5842
  o ? Array.from(o.elements).find(
@@ -5858,7 +5872,7 @@ const L = (Q = class extends y {
5858
5872
  ></nys-errormessage>
5859
5873
  </div>`;
5860
5874
  }
5861
- }, Q.VALID_SIZES = ["sm", "md"], Q.styles = l1, Q.formAssociated = !0, Q);
5875
+ }, Q.VALID_SIZES = ["sm", "md"], Q.styles = c1, Q.formAssociated = !0, Q);
5862
5876
  M([
5863
5877
  r({ type: String })
5864
5878
  ], L.prototype, "id", 2);
@@ -6018,7 +6032,7 @@ const Z = (g = class extends y {
6018
6032
  </label>
6019
6033
  `;
6020
6034
  }
6021
- }, g.VALID_SIZES = ["sm", "md"], g.buttonGroup = {}, g.styles = l1, g);
6035
+ }, g.VALID_SIZES = ["sm", "md"], g.buttonGroup = {}, g.styles = c1, g);
6022
6036
  O([
6023
6037
  r({ type: Boolean, reflect: !0 })
6024
6038
  ], Z.prototype, "checked", 2);
@@ -6544,10 +6558,10 @@ const Vt = u`
6544
6558
  outline: none;
6545
6559
  }
6546
6560
  `;
6547
- var Ht = Object.defineProperty, c1 = (a, e, t, o) => {
6561
+ var At = Object.defineProperty, d1 = (a, e, t, o) => {
6548
6562
  for (var s = void 0, n = a.length - 1, i; n >= 0; n--)
6549
6563
  (i = a[n]) && (s = i(e, t, s) || s);
6550
- return s && Ht(e, t, s), s;
6564
+ return s && At(e, t, s), s;
6551
6565
  };
6552
6566
  const Qe = class Qe extends y {
6553
6567
  constructor() {
@@ -6588,14 +6602,14 @@ const Qe = class Qe extends y {
6588
6602
  };
6589
6603
  Qe.styles = Vt;
6590
6604
  let Ee = Qe;
6591
- c1([
6605
+ d1([
6592
6606
  r({ type: String })
6593
6607
  ], Ee.prototype, "id");
6594
- c1([
6608
+ d1([
6595
6609
  r({ type: String })
6596
6610
  ], Ee.prototype, "href");
6597
6611
  customElements.get("nys-skipnav") || customElements.define("nys-skipnav", Ee);
6598
- const d1 = u`
6612
+ const h1 = u`
6599
6613
  :host {
6600
6614
  /* Anything that can be overridden should be defined here */
6601
6615
 
@@ -6949,10 +6963,10 @@ const d1 = u`
6949
6963
  }
6950
6964
  }
6951
6965
  `;
6952
- var At = Object.defineProperty, be = (a, e, t, o) => {
6966
+ var Ht = Object.defineProperty, be = (a, e, t, o) => {
6953
6967
  for (var s = void 0, n = a.length - 1, i; n >= 0; n--)
6954
6968
  (i = a[n]) && (s = i(e, t, s) || s);
6955
- return s && At(e, t, s), s;
6969
+ return s && Ht(e, t, s), s;
6956
6970
  };
6957
6971
  const Je = class Je extends y {
6958
6972
  constructor() {
@@ -7002,7 +7016,7 @@ const Je = class Je extends y {
7002
7016
  `;
7003
7017
  }
7004
7018
  };
7005
- Je.styles = d1;
7019
+ Je.styles = h1;
7006
7020
  let G = Je;
7007
7021
  be([
7008
7022
  r({ type: Boolean, reflect: !0 })
@@ -7020,7 +7034,7 @@ be([
7020
7034
  r({ type: Boolean })
7021
7035
  ], G.prototype, "isCompactExpanded");
7022
7036
  be([
7023
- r({ type: Function })
7037
+ r({ attribute: !1 })
7024
7038
  ], G.prototype, "onClick");
7025
7039
  be([
7026
7040
  r({ type: Number })
@@ -7129,7 +7143,7 @@ const e1 = class e1 extends y {
7129
7143
  `;
7130
7144
  }
7131
7145
  };
7132
- e1.styles = d1;
7146
+ e1.styles = h1;
7133
7147
  let he = e1;
7134
7148
  Ve([
7135
7149
  r({ type: String })
@@ -7293,8 +7307,8 @@ var Pt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, x = (a, e,
7293
7307
  return o && s && Pt(e, t, s), s;
7294
7308
  };
7295
7309
  let qt = 0;
7296
- var T;
7297
- const C = (T = class extends y {
7310
+ var R;
7311
+ const C = (R = class extends y {
7298
7312
  // allows use of elementInternals' API
7299
7313
  constructor() {
7300
7314
  super(), this.id = "", this.name = "", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this._tooltip = "", this.inverted = !1, this.form = null, this.maxlength = null, this.width = "full", this.rows = 4, this._resize = "vertical", this.showError = !1, this.errorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
@@ -7303,12 +7317,12 @@ const C = (T = class extends y {
7303
7317
  return this._resize;
7304
7318
  }
7305
7319
  set resize(e) {
7306
- this._resize = T.VALID_RESIZE.includes(
7320
+ this._resize = R.VALID_RESIZE.includes(
7307
7321
  e
7308
7322
  ) ? e : "vertical";
7309
7323
  }
7310
7324
  async updated(e) {
7311
- await Promise.resolve(), e.has("width") && (this.width = T.VALID_WIDTHS.includes(this.width) ? this.width : "full"), e.has("rows") && (this.rows = this.rows ?? 4);
7325
+ await Promise.resolve(), e.has("width") && (this.width = R.VALID_WIDTHS.includes(this.width) ? this.width : "full"), e.has("rows") && (this.rows = this.rows ?? 4);
7312
7326
  }
7313
7327
  // Generate a unique ID if one is not provided
7314
7328
  connectedCallback() {
@@ -7449,7 +7463,7 @@ ${this.value}</textarea
7449
7463
  </label>
7450
7464
  `;
7451
7465
  }
7452
- }, T.VALID_WIDTHS = ["sm", "md", "lg", "full"], T.VALID_RESIZE = ["vertical", "none"], T.styles = It, T.formAssociated = !0, T);
7466
+ }, R.VALID_WIDTHS = ["sm", "md", "lg", "full"], R.VALID_RESIZE = ["vertical", "none"], R.styles = It, R.formAssociated = !0, R);
7453
7467
  x([
7454
7468
  r({ type: String })
7455
7469
  ], C.prototype, "id", 2);
@@ -7754,8 +7768,8 @@ var Tt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, f = (a, e,
7754
7768
  return o && s && Tt(e, t, s), s;
7755
7769
  };
7756
7770
  let Nt = 0;
7757
- var R;
7758
- const v = (R = class extends y {
7771
+ var N;
7772
+ const v = (N = class extends y {
7759
7773
  // allows use of elementInternals' API
7760
7774
  constructor() {
7761
7775
  super(), this.id = "", this.name = "", this._type = "text", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this._tooltip = "", this.form = null, this.pattern = "", this.maxlength = null, this.width = "full", this.step = null, this.min = null, this.max = null, this.inverted = !1, this.showError = !1, this.errorMessage = "", this.showPassword = !1, this._originalErrorMessage = "", this._hasUserInteracted = !1, this._maskPatterns = {
@@ -7766,7 +7780,7 @@ const v = (R = class extends y {
7766
7780
  return this._type;
7767
7781
  }
7768
7782
  set type(e) {
7769
- this._type = R.VALID_TYPES.includes(
7783
+ this._type = N.VALID_TYPES.includes(
7770
7784
  e
7771
7785
  ) ? e : "text";
7772
7786
  }
@@ -7782,7 +7796,7 @@ const v = (R = class extends y {
7782
7796
  }
7783
7797
  // Ensure the "width" property is valid after updates
7784
7798
  async updated(e) {
7785
- if (e.has("width") && (await Promise.resolve(), this.width = R.VALID_WIDTHS.includes(this.width) ? this.width : "full"), e.has("disabled") && (this._validateButtonSlot("startButton"), this._validateButtonSlot("endButton")), e.has("type")) {
7799
+ if (e.has("width") && (await Promise.resolve(), this.width = N.VALID_WIDTHS.includes(this.width) ? this.width : "full"), e.has("disabled") && (this._validateButtonSlot("startButton"), this._validateButtonSlot("endButton")), e.has("type")) {
7786
7800
  const t = this._maskPatterns[this.type], o = this.shadowRoot?.querySelector("input");
7787
7801
  if (o)
7788
7802
  if (t)
@@ -7980,7 +7994,7 @@ const v = (R = class extends y {
7980
7994
  </div>
7981
7995
  `;
7982
7996
  }
7983
- }, R.VALID_TYPES = [
7997
+ }, N.VALID_TYPES = [
7984
7998
  "email",
7985
7999
  "number",
7986
8000
  "password",
@@ -7988,7 +8002,7 @@ const v = (R = class extends y {
7988
8002
  "tel",
7989
8003
  "text",
7990
8004
  "url"
7991
- ], R.VALID_WIDTHS = ["sm", "md", "lg", "full"], R.styles = Ut, R.formAssociated = !0, R);
8005
+ ], N.VALID_WIDTHS = ["sm", "md", "lg", "full"], N.styles = Ut, N.formAssociated = !0, N);
7992
8006
  f([
7993
8007
  r({ type: String })
7994
8008
  ], v.prototype, "id", 2);
@@ -8331,12 +8345,12 @@ const jt = u`
8331
8345
  }
8332
8346
  }
8333
8347
  `;
8334
- var Gt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, N = (a, e, t, o) => {
8348
+ var Gt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, F = (a, e, t, o) => {
8335
8349
  for (var s = o > 1 ? void 0 : o ? Yt(e, t) : e, n = a.length - 1, i; n >= 0; n--)
8336
8350
  (i = a[n]) && (s = (o ? i(e, t, s) : i(s)) || s);
8337
8351
  return o && s && Gt(e, t, s), s;
8338
8352
  };
8339
- let Kt = 0;
8353
+ let Wt = 0;
8340
8354
  var ee;
8341
8355
  const U = (ee = class extends y {
8342
8356
  // allows use of elementInternals' API
@@ -8353,7 +8367,7 @@ const U = (ee = class extends y {
8353
8367
  }
8354
8368
  // Generate a unique ID if one is not provided
8355
8369
  connectedCallback() {
8356
- super.connectedCallback(), this.id || (this.id = `nys-toggle-${Date.now()}-${Kt++}`);
8370
+ super.connectedCallback(), this.id || (this.id = `nys-toggle-${Date.now()}-${Wt++}`);
8357
8371
  }
8358
8372
  /********************** Form Integration **********************/
8359
8373
  // Update the internals whenever `checked` or `value` changes.
@@ -8425,41 +8439,41 @@ const U = (ee = class extends y {
8425
8439
  `;
8426
8440
  }
8427
8441
  }, ee.VALID_SIZES = ["sm", "md"], ee.styles = jt, ee.formAssociated = !0, ee);
8428
- N([
8442
+ F([
8429
8443
  r({ type: String })
8430
8444
  ], U.prototype, "id", 2);
8431
- N([
8445
+ F([
8432
8446
  r({ type: String, reflect: !0 })
8433
8447
  ], U.prototype, "name", 2);
8434
- N([
8448
+ F([
8435
8449
  r({ type: String })
8436
8450
  ], U.prototype, "value", 2);
8437
- N([
8451
+ F([
8438
8452
  r({ type: String })
8439
8453
  ], U.prototype, "label", 2);
8440
- N([
8454
+ F([
8441
8455
  r({ type: String })
8442
8456
  ], U.prototype, "description", 2);
8443
- N([
8457
+ F([
8444
8458
  r({ type: String, reflect: !0 })
8445
8459
  ], U.prototype, "form", 2);
8446
- N([
8460
+ F([
8447
8461
  r({ type: Boolean, reflect: !0 })
8448
8462
  ], U.prototype, "checked", 2);
8449
- N([
8463
+ F([
8450
8464
  r({ type: Boolean, reflect: !0 })
8451
8465
  ], U.prototype, "disabled", 2);
8452
- N([
8466
+ F([
8453
8467
  r({ type: Boolean })
8454
8468
  ], U.prototype, "noIcon", 2);
8455
- N([
8469
+ F([
8456
8470
  r({ type: Boolean, reflect: !0 })
8457
8471
  ], U.prototype, "inverted", 2);
8458
- N([
8472
+ F([
8459
8473
  r({ reflect: !0 })
8460
8474
  ], U.prototype, "size", 1);
8461
- let Wt = U;
8462
- customElements.get("nys-toggle") || customElements.define("nys-toggle", Wt);
8475
+ let Kt = U;
8476
+ customElements.get("nys-toggle") || customElements.define("nys-toggle", Kt);
8463
8477
  const Xt = u`
8464
8478
  :host {
8465
8479
  /* Global Tooltip Styles */
@@ -9134,7 +9148,7 @@ const ts = u`
9134
9148
  flex-direction: column;
9135
9149
  }
9136
9150
 
9137
- #nys-unavheader__translate:not([circle]),
9151
+ #nys-unavheader__translate--desktop,
9138
9152
  #nys-unavheader__searchbar {
9139
9153
  display: none;
9140
9154
  }
@@ -9277,16 +9291,14 @@ const s1 = class s1 extends y {
9277
9291
  _getNysLogo() {
9278
9292
  return new DOMParser().parseFromString(ss, "image/svg+xml").documentElement;
9279
9293
  }
9280
- _toggleTrustbar() {
9281
- this.trustbarVisible = !this.trustbarVisible, this.trustbarVisible ? (this.languageVisible = !1, this.searchDropdownVisible = !1, this.updateComplete.then(() => {
9282
- this.shadowRoot?.getElementById(
9283
- "nys-unavheader__closetrustbar"
9284
- )?.focus();
9285
- })) : this.updateComplete.then(() => {
9286
- this.shadowRoot?.getElementById(
9287
- "nys-unavheader__know--inline"
9288
- )?.focus();
9289
- });
9294
+ _toggleTrustbar(e) {
9295
+ if (this.trustbarVisible = !this.trustbarVisible, this.trustbarVisible && (this.languageVisible = !1, this.searchDropdownVisible = !1), e === "no focus") return;
9296
+ if (e === "nys-unavheader__know--inline" || !e) {
9297
+ const o = this.trustbarVisible ? "nys-unavheader__closetrustbar" : "nys-unavheader__know--inline";
9298
+ this.updateComplete.then(() => {
9299
+ this.shadowRoot?.getElementById(o)?.focus();
9300
+ });
9301
+ }
9290
9302
  }
9291
9303
  _toggleLanguageList() {
9292
9304
  this.languageVisible = !this.languageVisible, this.languageVisible && (this.trustbarVisible = !1, this.searchDropdownVisible = !1);
@@ -9326,7 +9338,9 @@ const s1 = class s1 extends y {
9326
9338
  <header class="nys-unavheader">
9327
9339
  <div
9328
9340
  class="nys-unavheader__trustbar wrapper"
9329
- @click="${this._toggleTrustbar}"
9341
+ @click="${(e) => {
9342
+ e.target.closest("nys-button") || this._toggleTrustbar("no focus");
9343
+ }}"
9330
9344
  >
9331
9345
  <div class="content">
9332
9346
  <label id="nys-unavheader__official"
@@ -9339,8 +9353,8 @@ const s1 = class s1 extends y {
9339
9353
  variant="ghost"
9340
9354
  size="sm"
9341
9355
  suffixIcon="slotted"
9342
- @keydown="${(e) => {
9343
- (e.code === "Enter" || e.code === "Space" || e.key === "Enter" || e.key === " ") && this._toggleTrustbar();
9356
+ @nys-click="${(e) => {
9357
+ e.preventDefault(), e.stopPropagation(), this._toggleTrustbar("nys-unavheader__know");
9344
9358
  }}"
9345
9359
  >
9346
9360
  <nys-icon
@@ -9364,7 +9378,7 @@ const s1 = class s1 extends y {
9364
9378
  icon="close"
9365
9379
  size="sm"
9366
9380
  ariaLabel="Close this notice"
9367
- @nys-click="${this._toggleTrustbar}"
9381
+ @nys-click="${() => this._toggleTrustbar("nys-unavheader__know--inline")}"
9368
9382
  ></nys-button>
9369
9383
  <div class="nys-unavheader__messagewrapper">
9370
9384
  <div
@@ -9414,7 +9428,7 @@ const s1 = class s1 extends y {
9414
9428
  variant="ghost"
9415
9429
  size="sm"
9416
9430
  suffixIcon="slotted"
9417
- @nys-click="${this._toggleTrustbar}"
9431
+ @nys-click="${() => this._toggleTrustbar("nys-unavheader__know--inline")}"
9418
9432
  >
9419
9433
  <nys-icon
9420
9434
  slot="suffix-icon"
@@ -9706,7 +9720,7 @@ const rs = u`
9706
9720
  font-weight: var(--_nys-globalheader-font-weight);
9707
9721
  line-height: var(--_nys-globalheader-line-height);
9708
9722
  letter-spacing: var(--_nys-globalheader-letter-spacing);
9709
- text-wrap: wrap;
9723
+ overflow-wrap: break-word; /* note: we use this bc text-wrap: wrap; is not a standard CSS property (yet). */
9710
9724
  }
9711
9725
 
9712
9726
  .nys-globalheader__agencyName {
@@ -9868,7 +9882,7 @@ const rs = u`
9868
9882
  }
9869
9883
  }
9870
9884
  `;
9871
- var ns = Object.defineProperty, He = (a, e, t, o) => {
9885
+ var ns = Object.defineProperty, Ae = (a, e, t, o) => {
9872
9886
  for (var s = void 0, n = a.length - 1, i; n >= 0; n--)
9873
9887
  (i = a[n]) && (s = i(e, t, s) || s);
9874
9888
  return s && ns(e, t, s), s;
@@ -9901,18 +9915,18 @@ const o1 = class o1 extends y {
9901
9915
  t.forEach((i) => {
9902
9916
  if (i.nodeType === Node.ELEMENT_NODE) {
9903
9917
  const c = i.cloneNode(!0), p = i.cloneNode(!0);
9904
- ["script", "iframe", "object", "embed, img"].forEach((F) => {
9905
- c.querySelectorAll(F).forEach((j) => j.remove());
9918
+ ["script", "iframe", "object", "embed, img"].forEach((j) => {
9919
+ c.querySelectorAll(j).forEach((T) => T.remove());
9906
9920
  });
9907
- const V = (F) => {
9908
- const j = Array.from(F.querySelectorAll("a"));
9921
+ const V = (j) => {
9922
+ const T = Array.from(j.querySelectorAll("a"));
9909
9923
  let Se = {
9910
9924
  li: null,
9911
9925
  length: 0
9912
9926
  };
9913
- j.forEach((Ae) => {
9914
- const h1 = Ae.getAttribute("href"), $e = this._normalizePath(h1);
9915
- $e && ($e === "/" && n === "/" ? Se = { li: Ae.closest("li"), length: 1 } : n?.startsWith($e) && $e.length > Se.length && (Se = { li: Ae.closest("li"), length: $e.length }), j.forEach((y1) => y1.closest("li")?.classList.remove("active")), Se.li?.classList.add("active"));
9927
+ T.forEach((He) => {
9928
+ const i1 = He.getAttribute("href"), $e = this._normalizePath(i1);
9929
+ $e && ($e === "/" && n === "/" ? Se = { li: He.closest("li"), length: 1 } : n?.startsWith($e) && $e.length > Se.length && (Se = { li: He.closest("li"), length: $e.length }), T.forEach((y1) => y1.closest("li")?.classList.remove("active")), Se.li?.classList.add("active"));
9916
9930
  });
9917
9931
  };
9918
9932
  V(c), V(p), o.appendChild(c), s.appendChild(p), i.remove();
@@ -10011,19 +10025,19 @@ const o1 = class o1 extends y {
10011
10025
  };
10012
10026
  o1.styles = rs;
10013
10027
  let ye = o1;
10014
- He([
10028
+ Ae([
10015
10029
  r({ type: String })
10016
10030
  ], ye.prototype, "appName");
10017
- He([
10031
+ Ae([
10018
10032
  r({ type: String })
10019
10033
  ], ye.prototype, "agencyName");
10020
- He([
10034
+ Ae([
10021
10035
  r({ type: String })
10022
10036
  ], ye.prototype, "homepageLink");
10023
- He([
10037
+ Ae([
10024
10038
  $()
10025
10039
  ], ye.prototype, "slotHasContent");
10026
- He([
10040
+ Ae([
10027
10041
  $()
10028
10042
  ], ye.prototype, "isMobileMenuOpen");
10029
10043
  customElements.get("nys-globalheader") || customElements.define("nys-globalheader", ye);
@@ -10523,7 +10537,7 @@ export {
10523
10537
  he as NysStepper,
10524
10538
  Ot as NysTextarea,
10525
10539
  Ft as NysTextinput,
10526
- Wt as NysToggle,
10540
+ Kt as NysToggle,
10527
10541
  se as NysTooltip,
10528
10542
  Oe as NysUnavFooter,
10529
10543
  Y as NysUnavHeader