@nysds/nys-breadcrumbs 1.21.0 → 1.21.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.
@@ -167,12 +167,17 @@ export declare class NysBreadcrumbs extends NysElement {
167
167
  * --------------------------------------------------------------------------
168
168
  */
169
169
  private _updateCollapseThreshold;
170
+ private _boundDisabledClickGuard;
170
171
  private _getSlottedOl;
171
172
  private _getSlottedItems;
172
173
  private _getAnchor;
173
174
  private _isCurrentPage;
174
- private _createBackToParentElement;
175
- private _createCrumbElement;
175
+ private _createIcon;
176
+ private _resetItem;
177
+ private _applyDisabledState;
178
+ private _applyBackToParentStyle;
179
+ private _applyCrumbStyle;
180
+ private _insertEllipsis;
176
181
  /**
177
182
  * Main logic for cloning and handling user slots.
178
183
  * New <ol>, <li>, and <a> tags are created and rendered out as crumbs for the breadcrumbs trail.
@@ -1,47 +1,50 @@
1
- import { LitElement as T, unsafeCSS as S, html as P } from "lit";
2
- import { property as d } from "lit/decorators.js";
1
+ import { LitElement as w, unsafeCSS as S, html as k } from "lit";
2
+ import { property as o } from "lit/decorators.js";
3
3
  import "@nysds/nys-icon";
4
4
  /*!
5
5
  * █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
6
6
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
7
7
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
8
8
  *
9
- * Breadcrumbs Component v1.21.0
9
+ * Breadcrumbs Component v1.21.1
10
10
  * Part of the New York State Design System
11
11
  * Repository: https://github.com/its-hcd/nysds
12
12
  * License: MIT
13
13
  */
14
14
  /*!
15
- * New York State Design System v1.21.0
15
+ * New York State Design System v1.21.1
16
16
  * Description: A design system for New York State's digital products.
17
17
  * Repository: https://github.com/its-hcd/nysds
18
18
  * License: MIT
19
19
  */
20
- var L = 0;
21
- function B(b) {
22
- return `${b}-${Date.now()}-${L++}`;
20
+ let C = 0;
21
+ function E(d) {
22
+ return `${d}-${Date.now()}-${C++}`;
23
23
  }
24
- var z = (b) => {
25
- class e extends b {
24
+ const A = (d) => {
25
+ class e extends d {
26
26
  get idPrefix() {
27
27
  return this.localName || "nys-element";
28
28
  }
29
29
  ensureId() {
30
- this.id || (this.id = B(this.idPrefix));
30
+ this.id || (this.id = E(this.idPrefix));
31
31
  }
32
32
  connectedCallback() {
33
33
  super.connectedCallback(), this.ensureId();
34
34
  }
35
35
  }
36
36
  return e;
37
- }, I = /* @__PURE__ */ z(T);
38
- const M = '@charset "UTF-8";:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-250, 20px);--_nys-breadcrumbs-gap: var(--nys-space-100, 8px);--_nys-breadcrumbs-background: transparent;--_nys-breadcrumbitem-gap: var(--nys-space-50, 4px);--_nys-breadcrumbitem-color: var(--nys-color-text-weak, #4a4d4f);--_nys-breadcrumbitem-color--focus: var(--nys-color-focus, #004dd1);--_nys-breadcrumbitem-outline-width: var(--nys-border-width-md, 2px);--_nys-breadcrumbitem-outline-radius: var(--nys-radius-md, 4px);--_nys-breadcrumb-gap--ellipsis: var(--nys-space-100, 8px);--_nys-breadcrumb-color--ellipsis: var(--nys-color-text-weak, #4a4d4f);--_nys-breadcrumbs-font-size: var(--nys-font-size-ui-md, 16px);--_nys-breadcrumbs-font-weight: var(--nys-font-weight-semibold, 600);--_nys-breadcrumbs-font-weight--current: var(--nys-font-weight-regular, 400);--_nys-breadcrumbs-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-breadcrumbs-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-breadcrumbs-max-width--content: var( --nys-max-width--content, var(--nys-breadcrumbs-max-width--content, 1280px) )}.nys-breadcrumbs{padding:var(--_nys-breadcrumbs-padding);font-family:var(--_nys-breadcrumbs-font-family);font-size:var(--_nys-breadcrumbs-font-size);font-weight:var(--_nys-breadcrumbs-font-weight);line-height:var(--_nys-breadcrumbs-line-height);background:var(--_nys-breadcrumbs-background);display:flex;justify-content:center}.nys-breadcrumbs.nys-breadcrumbs--background-bar{--_nys-breadcrumbs-background: var(--nys-color-theme-faint, #f7fafd)}.nys-breadcrumbs ol{padding:0;margin:0;display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:var(--_nys-breadcrumbs-gap);list-style:none;max-width:var(--_nys-breadcrumbs-max-width--content);width:100%}:host([size=sm]){--_nys-breadcrumbs-font-size: var(--nys-font-size-ui-sm, 14px)}:host([disabled]) .nys-breadcrumbitem a{cursor:not-allowed;--_nys-breadcrumbitem-color: var(--nys-color-text-disabled, #cec0c1)}:host([disabled]) .nys-breadcrumbitem a:hover{text-decoration:none}:host([disabled]) .nys-breadcrumbs__ellipsis .ellipsis-btn{cursor:not-allowed;opacity:.4;pointer-events:none}:host([disabled]) .nys-breadcrumbs__ellipsis .ellipsis-btn:hover{text-decoration:none}:host([disabled]) nys-icon{color:var(--nys-color-text-disabled, #cec0c1)}.nys-breadcrumbitem{padding:0;display:flex;align-items:center;gap:var(--_nys-breadcrumbitem-gap);color:var(--_nys-breadcrumbitem-color);font-weight:var(--_nys-breadcrumbs-font-weight--current);white-space:nowrap}.nys-breadcrumbitem.hide{display:none}.nys-breadcrumbitem a{text-decoration:none;color:var(--_nys-breadcrumbitem-color);font-weight:var(--_nys-breadcrumbs-font-weight)}.nys-breadcrumbitem a:hover{text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:14%;text-underline-offset:auto}.nys-breadcrumbitem a:active{text-decoration-thickness:14%;--_nys-breadcrumbitem-color: var(--nys-color-text)}.nys-breadcrumbitem a:focus-visible{border-radius:var(--_nys-breadcrumbitem-outline-radius);outline:var(--_nys-breadcrumbitem-outline-width) solid var(--_nys-breadcrumbitem-color--focus);outline-offset:2px}.nys-breadcrumbs__ellipsis{display:flex;gap:var(--_nys-breadcrumb-gap--ellipsis);margin:0;align-items:center;color:var(--_nys-breadcrumb-color--ellipsis)}.nys-breadcrumbs__ellipsis .ellipsis-btn{border:none;padding:0;background-color:inherit;text-decoration:none;font-family:var(--_nys-breadcrumbs-font-family);font-size:var(--_nys-breadcrumbs-font-size);font-weight:var(--_nys-breadcrumbs-font-weight);line-height:var(--_nys-breadcrumbs-line-height);color:var(--_nys-breadcrumb-color--ellipsis);cursor:pointer}.nys-breadcrumbs__ellipsis .ellipsis-btn:hover{text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:auto}.nys-breadcrumbs__ellipsis .ellipsis-btn:active{text-decoration-thickness:14%}.nys-breadcrumbs__ellipsis .ellipsis-btn:focus-visible{border-radius:var(--_nys-breadcrumbitem-outline-radius);outline:var(--_nys-breadcrumbitem-outline-width) solid var(--_nys-breadcrumbitem-color--focus);outline-offset:2px}.nys-breadcrumbs__ellipsis nys-icon{margin-top:-3px}:host-context([dir=rtl]) nys-icon{transform:scaleX(-1)}@media(min-width:480px){:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-250, 20px)}}@media(min-width:768px){:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-400, 32px)}}@media(min-width:1024px){:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-400, 32px)}}@media(min-width:1280px){:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-800, 64px)}}';
39
- var Q = Object.defineProperty, c = (b, e, s, t) => {
40
- for (var r = void 0, a = b.length - 1, n; a >= 0; a--)
41
- (n = b[a]) && (r = n(e, s, r) || r);
42
- return r && Q(e, s, r), r;
37
+ }, T = /* @__PURE__ */ A(w), L = '@charset "UTF-8";:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-250, 20px);--_nys-breadcrumbs-gap: var(--nys-space-100, 8px);--_nys-breadcrumbs-background: transparent;--_nys-breadcrumbitem-gap: var(--nys-space-50, 4px);--_nys-breadcrumbitem-color: var(--nys-color-text-weak, #4a4d4f);--_nys-breadcrumbitem-color--focus: var(--nys-color-focus, #004dd1);--_nys-breadcrumbitem-outline-width: var(--nys-border-width-md, 2px);--_nys-breadcrumbitem-outline-radius: var(--nys-radius-md, 4px);--_nys-breadcrumb-gap--ellipsis: var(--nys-space-100, 8px);--_nys-breadcrumb-color--ellipsis: var(--nys-color-text-weak, #4a4d4f);--_nys-breadcrumbs-font-size: var(--nys-font-size-ui-md, 16px);--_nys-breadcrumbs-font-weight: var(--nys-font-weight-semibold, 600);--_nys-breadcrumbs-font-weight--current: var(--nys-font-weight-regular, 400);--_nys-breadcrumbs-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-breadcrumbs-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-breadcrumbs-max-width--content: var( --nys-max-width--content, var(--nys-breadcrumbs-max-width--content, 1280px) )}.nys-breadcrumbs{padding:var(--_nys-breadcrumbs-padding);background:var(--_nys-breadcrumbs-background);display:flex;justify-content:center}.nys-breadcrumbs.nys-breadcrumbs--background-bar{--_nys-breadcrumbs-background: var(--nys-color-theme-faint, #f7fafd)}:host([size=sm]){--_nys-breadcrumbs-font-size: var(--nys-font-size-ui-sm, 14px)}@media(min-width:480px){:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-250, 20px)}}@media(min-width:768px){:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-400, 32px)}}@media(min-width:1024px){:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-400, 32px)}}@media(min-width:1280px){:host{--_nys-breadcrumbs-padding: var(--nys-space-150, 12px) var(--nys-space-800, 64px)}}', P = "nys-breadcrumbs:not(#_) ol{padding:0;margin:0;display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:var(--_nys-breadcrumbs-gap);list-style:none;max-width:var(--_nys-breadcrumbs-max-width--content);width:100%}nys-breadcrumbs:not(#_) li{margin:0}nys-breadcrumbs:not(#_) .nys-breadcrumbitem{padding:0;display:flex;align-items:center;gap:var(--_nys-breadcrumbitem-gap);color:var(--_nys-breadcrumbitem-color);font-family:var(--_nys-breadcrumbs-font-family);font-size:var(--_nys-breadcrumbs-font-size);font-weight:var(--_nys-breadcrumbs-font-weight--current);line-height:var(--_nys-breadcrumbs-line-height);white-space:nowrap}nys-breadcrumbs:not(#_) .nys-breadcrumbitem.hide{display:none}nys-breadcrumbs:not(#_) .nys-breadcrumbitem a{text-decoration:none;color:var(--_nys-breadcrumbitem-color);font-family:var(--_nys-breadcrumbs-font-family);font-size:var(--_nys-breadcrumbs-font-size);font-weight:var(--_nys-breadcrumbs-font-weight);line-height:var(--_nys-breadcrumbs-line-height)}nys-breadcrumbs:not(#_) .nys-breadcrumbitem a:visited{color:var(--_nys-breadcrumbitem-color)}nys-breadcrumbs:not(#_) .nys-breadcrumbitem a:hover{color:var(--_nys-breadcrumbitem-color);text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:14%;text-underline-offset:auto}nys-breadcrumbs:not(#_) .nys-breadcrumbitem a:active{color:var(--nys-color-text);text-decoration-thickness:14%}nys-breadcrumbs:not(#_) .nys-breadcrumbitem a:focus-visible{border-radius:var(--_nys-breadcrumbitem-outline-radius);outline:var(--_nys-breadcrumbitem-outline-width) solid var(--_nys-breadcrumbitem-color--focus);outline-offset:2px}nys-breadcrumbs:not(#_) .nys-breadcrumbitem a[aria-disabled=true]{cursor:not-allowed;color:var(--nys-color-text-disabled, #cec0c1)}nys-breadcrumbs:not(#_) .nys-breadcrumbitem a[aria-disabled=true]:hover{text-decoration:none}nys-breadcrumbs:not(#_) .nys-breadcrumbs__ellipsis{display:flex;gap:var(--_nys-breadcrumb-gap--ellipsis);margin:0;align-items:center;color:var(--_nys-breadcrumb-color--ellipsis)}nys-breadcrumbs:not(#_) .nys-breadcrumbs__ellipsis .ellipsis-btn{border:none;padding:0;background-color:inherit;text-decoration:none;font-family:var(--_nys-breadcrumbs-font-family);font-size:var(--_nys-breadcrumbs-font-size);font-weight:var(--_nys-breadcrumbs-font-weight);line-height:var(--_nys-breadcrumbs-line-height);color:var(--_nys-breadcrumb-color--ellipsis);cursor:pointer}nys-breadcrumbs:not(#_) .nys-breadcrumbs__ellipsis .ellipsis-btn:visited{color:var(--_nys-breadcrumb-color--ellipsis)}nys-breadcrumbs:not(#_) .nys-breadcrumbs__ellipsis .ellipsis-btn:hover{color:var(--_nys-breadcrumb-color--ellipsis);text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:auto}nys-breadcrumbs:not(#_) .nys-breadcrumbs__ellipsis .ellipsis-btn:active{color:var(--_nys-breadcrumb-color--ellipsis);text-decoration-thickness:14%}nys-breadcrumbs:not(#_) .nys-breadcrumbs__ellipsis .ellipsis-btn:focus{color:var(--_nys-breadcrumb-color--ellipsis)}nys-breadcrumbs:not(#_) .nys-breadcrumbs__ellipsis .ellipsis-btn:focus-visible{border-radius:var(--_nys-breadcrumbitem-outline-radius);outline:var(--_nys-breadcrumbitem-outline-width) solid var(--_nys-breadcrumbitem-color--focus);outline-offset:2px}nys-breadcrumbs:not(#_) .nys-breadcrumbs__ellipsis nys-icon{margin-top:-3px}nys-breadcrumbs:not(#_)[disabled] nys-icon{color:var(--nys-color-text-disabled, #cec0c1)}nys-breadcrumbs:not(#_)[disabled] .nys-breadcrumbs__ellipsis .ellipsis-btn{cursor:not-allowed;opacity:.4;pointer-events:none}nys-breadcrumbs:not(#_)[disabled] .nys-breadcrumbs__ellipsis .ellipsis-btn:hover{text-decoration:none}[dir=rtl] nys-breadcrumbs nys-icon{transform:scaleX(-1)}";
38
+ var I = Object.defineProperty, l = (d, e, s, t) => {
39
+ for (var r = void 0, a = d.length - 1, m; a >= 0; a--)
40
+ (m = d[a]) && (r = m(e, s, r) || r);
41
+ return r && I(e, s, r), r;
43
42
  };
44
- const x = class x extends I {
43
+ let y = null;
44
+ function z() {
45
+ y || typeof document > "u" || (y = new CSSStyleSheet(), y.replaceSync(P), document.adoptedStyleSheets = [...document.adoptedStyleSheets, y]);
46
+ }
47
+ const u = "data-nys-injected", _ = class _ extends T {
45
48
  /**
46
49
  * Lifecycle methods
47
50
  * --------------------------------------------------------------------------
@@ -50,10 +53,12 @@ const x = class x extends I {
50
53
  super(), this.id = "", this.ariaLabel = "", this.size = "md", this.backToParent = !1, this.collapsed = !1, this.backgroundBar = !1, this.disabled = !1, this._collapseThreshold = 5, this._manuallyExpanded = !1, this._mediaQuery = null, this._updateCollapseThreshold = () => {
51
54
  const s = this._mediaQuery?.matches ?? window.innerWidth < 768 ? 3 : 5;
52
55
  s !== this._collapseThreshold && (this._collapseThreshold = s, this._manuallyExpanded = !1, this._handleSlotChange());
56
+ }, this._boundDisabledClickGuard = (e) => {
57
+ e.target?.closest?.("a")?.getAttribute("aria-disabled") === "true" && e.preventDefault();
53
58
  };
54
59
  }
55
60
  connectedCallback() {
56
- super.connectedCallback(), this._mediaQuery = window.matchMedia("(max-width: 767px)"), this._mediaQuery.addEventListener("change", this._updateCollapseThreshold);
61
+ super.connectedCallback(), z(), this._mediaQuery = window.matchMedia("(max-width: 767px)"), this._mediaQuery.addEventListener("change", this._updateCollapseThreshold);
57
62
  }
58
63
  disconnectedCallback() {
59
64
  super.disconnectedCallback(), this._mediaQuery?.removeEventListener(
@@ -62,21 +67,19 @@ const x = class x extends I {
62
67
  ), this._mediaQuery = null;
63
68
  }
64
69
  firstUpdated() {
65
- this._handleSlotChange();
70
+ const e = this.shadowRoot?.querySelector("slot");
71
+ e?.addEventListener("slotchange", () => this._handleSlotChange()), e?.addEventListener("click", this._boundDisabledClickGuard), this._handleSlotChange();
66
72
  }
67
73
  updated(e) {
68
74
  (e.has("collapsed") || e.has("backToParent") || e.has("disabled")) && this._handleSlotChange();
69
75
  }
70
76
  _getSlottedOl() {
71
- return (this.shadowRoot?.querySelector(
72
- "slot"
73
- )?.assignedElements({ flatten: !0 }) ?? []).find((t) => t.tagName === "OL") ?? null;
77
+ return (this.shadowRoot?.querySelector("slot")?.assignedElements({ flatten: !0 }) ?? []).find((t) => t.tagName === "OL") ?? null;
74
78
  }
75
- _getSlottedItems() {
76
- const e = this._getSlottedOl();
77
- return e ? Array.from(e.children).filter(
78
- (s) => s.tagName === "LI"
79
- ) : [];
79
+ _getSlottedItems(e) {
80
+ return Array.from(e.children).filter(
81
+ (s) => s.tagName === "LI" && !s.hasAttribute(u)
82
+ );
80
83
  }
81
84
  _getAnchor(e) {
82
85
  return e.querySelector("a");
@@ -84,71 +87,82 @@ const x = class x extends I {
84
87
  _isCurrentPage(e) {
85
88
  return !this._getAnchor(e);
86
89
  }
87
- _createBackToParentElement(e) {
88
- const s = this._getAnchor(e), t = s?.getAttribute("href") ?? "", r = s?.textContent?.trim() ?? e.textContent?.trim() ?? "", a = document.createElement("li");
89
- a.className = "nys-breadcrumbitem";
90
- const n = document.createElement("nys-icon");
91
- n.setAttribute("name", "arrow_back"), n.setAttribute("size", "16");
92
- const i = document.createElement("a");
93
- return this.disabled || (i.href = t), i.textContent = r, this.disabled && i.setAttribute("aria-disabled", "true"), a.appendChild(n), a.appendChild(i), a;
94
- }
95
- _createCrumbElement(e, s) {
96
- const t = this._getAnchor(e), r = t?.getAttribute("href") ?? "", a = t?.textContent?.trim() ?? e.textContent?.trim() ?? "", n = document.createElement("li");
97
- if (n.className = "nys-breadcrumbitem", s)
98
- return n.setAttribute("aria-current", "page"), n.textContent = a, n;
99
- const i = document.createElement("a");
100
- this.disabled || (i.href = r), i.textContent = a, this.disabled && i.setAttribute("aria-disabled", "true");
101
- const m = document.createElement("nys-icon");
102
- return m.setAttribute("name", "chevron_right"), m.setAttribute("size", "14"), n.appendChild(i), n.appendChild(m), n;
90
+ _createIcon(e, s) {
91
+ const t = document.createElement("nys-icon");
92
+ return t.setAttribute("name", e), t.setAttribute("size", s), t.setAttribute(u, "true"), t;
93
+ }
94
+ _resetItem(e) {
95
+ e.className = "", e.removeAttribute("aria-current"), e.querySelectorAll(`[${u}]`).forEach((t) => t.remove());
96
+ const s = this._getAnchor(e);
97
+ s && (s.removeAttribute("aria-disabled"), s.removeAttribute("tabindex"));
98
+ }
99
+ _applyDisabledState(e) {
100
+ this.disabled && (e.setAttribute("aria-disabled", "true"), e.setAttribute("tabindex", "-1"));
101
+ }
102
+ _applyBackToParentStyle(e) {
103
+ e.classList.add("nys-breadcrumbitem", "back-to-parent");
104
+ const s = this._getAnchor(e);
105
+ s && (this._applyDisabledState(s), s.insertAdjacentElement(
106
+ "beforebegin",
107
+ this._createIcon("arrow_back", "16")
108
+ ));
109
+ }
110
+ _applyCrumbStyle(e, s) {
111
+ if (e.classList.add("nys-breadcrumbitem"), s) {
112
+ e.setAttribute("aria-current", "page");
113
+ return;
114
+ }
115
+ const t = this._getAnchor(e);
116
+ t && (this._applyDisabledState(t), t.insertAdjacentElement(
117
+ "afterend",
118
+ this._createIcon("chevron_right", "14")
119
+ ));
120
+ }
121
+ _insertEllipsis(e) {
122
+ const s = document.createElement("li");
123
+ s.classList.add("nys-breadcrumbs__ellipsis"), s.setAttribute(u, "true");
124
+ const t = document.createElement("a");
125
+ t.classList.add("ellipsis-btn"), t.setAttribute("aria-label", "Show more links"), t.setAttribute("role", "button"), t.setAttribute("href", "#"), t.textContent = "…";
126
+ const r = (a) => {
127
+ a.preventDefault(), this._manuallyExpanded = !0, this.collapsed = !1, this._handleSlotChange(), this._dispatchExpandEvent(), this._moveFocusToFirstExpandCrumb();
128
+ };
129
+ t.addEventListener("click", r), t.addEventListener("keydown", (a) => {
130
+ a.key === " " && r(a);
131
+ }), s.appendChild(t), s.appendChild(this._createIcon("chevron_right", "14")), e.insertAdjacentElement("afterend", s);
103
132
  }
104
133
  /**
105
134
  * Main logic for cloning and handling user slots.
106
135
  * New <ol>, <li>, and <a> tags are created and rendered out as crumbs for the breadcrumbs trail.
107
136
  */
108
137
  _handleSlotChange() {
109
- const e = this._mediaQuery?.matches ?? window.innerWidth < 768, s = this.shadowRoot?.getElementById("crumb-list");
138
+ const e = this._mediaQuery?.matches ?? window.innerWidth < 768, s = this._getSlottedOl();
110
139
  if (!s) return;
111
- const t = this._getSlottedItems();
140
+ s.querySelectorAll(`li[${u}]`).forEach((n) => n.remove());
141
+ const t = this._getSlottedItems(s);
112
142
  if (t.length === 0) return;
113
- s.innerHTML = "";
114
- const r = (u = 0) => {
115
- const h = t[u].cloneNode(!0), g = this._createBackToParentElement(h);
116
- s.appendChild(g);
117
- };
118
- if (t.length === 1) {
119
- r();
143
+ if (t.forEach((n) => this._resetItem(n)), t.length === 1) {
144
+ this._applyBackToParentStyle(t[0]);
120
145
  return;
121
146
  }
122
147
  if (e && this.backToParent) {
123
- const u = this._isCurrentPage(t[t.length - 1]);
124
- r(u ? t.length - 2 : t.length - 1);
148
+ const b = this._isCurrentPage(t[t.length - 1]) ? t.length - 2 : t.length - 1;
149
+ t.forEach((c, p) => {
150
+ p === b ? this._applyBackToParentStyle(c) : (this._applyCrumbStyle(c, this._isCurrentPage(c)), c.classList.add("hide"));
151
+ });
125
152
  return;
126
153
  }
127
- const a = !this._manuallyExpanded && t.length > this._collapseThreshold, n = this.collapsed || a, i = t[t.length - 1], m = this._isCurrentPage(i), _ = Math.min(1, t.length - 1), k = Math.min(
128
- m ? 2 : 1,
129
- t.length - _
154
+ const r = !this._manuallyExpanded && t.length > this._collapseThreshold, a = this.collapsed || r, m = t[t.length - 1], g = this._isCurrentPage(m), h = Math.min(1, t.length - 1), v = Math.min(
155
+ g ? 2 : 1,
156
+ t.length - h
130
157
  );
131
- t.forEach((u, h) => {
132
- const g = h < _, E = h >= t.length - k, C = g || E, A = n && !C, p = this._createCrumbElement(u, this._isCurrentPage(u));
133
- if (p.setAttribute("data-cloned", "true"), A && p.classList.add("hide"), C || p.classList.add("intermediate"), s.appendChild(p), h === _ - 1 && n && t.length > 2) {
134
- const y = document.createElement("li");
135
- y.classList.add("nys-breadcrumbs__ellipsis");
136
- const l = document.createElement("a");
137
- l.classList.add("ellipsis-btn"), l.setAttribute("aria-label", "Show more links"), l.setAttribute("role", "button"), l.setAttribute("href", "#"), l.textContent = "…";
138
- const w = (f) => {
139
- f.preventDefault(), this._manuallyExpanded = !0, this.collapsed = !1, this._handleSlotChange(), this._dispatchExpandEvent(), this._moveFocusToFirstExpandCrumb();
140
- };
141
- l.addEventListener("click", w), l.addEventListener("keydown", (f) => {
142
- f.key === " " && w(f);
143
- });
144
- const v = document.createElement("nys-icon");
145
- v.setAttribute("name", "chevron_right"), v.setAttribute("size", "14"), y.appendChild(l), y.appendChild(v), s.appendChild(y);
146
- }
158
+ t.forEach((n, b) => {
159
+ const c = b < h, p = b >= t.length - v, f = c || p, x = a && !f;
160
+ this._applyCrumbStyle(n, this._isCurrentPage(n)), x && n.classList.add("hide"), f || n.classList.add("intermediate"), b === h - 1 && a && t.length > 2 && this._insertEllipsis(n);
147
161
  });
148
162
  }
149
163
  _moveFocusToFirstExpandCrumb() {
150
164
  setTimeout(() => {
151
- this.shadowRoot?.getElementById("crumb-list")?.querySelector("li[data-cloned].intermediate")?.querySelector("a")?.focus();
165
+ this._getSlottedOl()?.querySelector("li.intermediate")?.querySelector("a")?.focus();
152
166
  }, 0);
153
167
  }
154
168
  /**
@@ -165,40 +179,39 @@ const x = class x extends I {
165
179
  );
166
180
  }
167
181
  render() {
168
- return P`<nav
182
+ return k`<nav
169
183
  class="nys-breadcrumbs ${this.backgroundBar ? "nys-breadcrumbs--background-bar" : ""}"
170
184
  aria-label=${this.ariaLabel || "Breadcrumb"}
171
185
  >
172
- <ol id="crumb-list"></ol>
173
- <slot style="display: none;" @slotchange=${this._handleSlotChange}></slot>
186
+ <slot @slotchange=${this._handleSlotChange}></slot>
174
187
  </nav>`;
175
188
  }
176
189
  };
177
- x.styles = S(M);
178
- let o = x;
179
- c([
180
- d({ type: String, reflect: !0 })
181
- ], o.prototype, "id");
182
- c([
183
- d({ type: String })
184
- ], o.prototype, "ariaLabel");
185
- c([
186
- d({ type: String, reflect: !0 })
187
- ], o.prototype, "size");
188
- c([
189
- d({ type: Boolean })
190
- ], o.prototype, "backToParent");
191
- c([
192
- d({ type: Boolean })
193
- ], o.prototype, "collapsed");
194
- c([
195
- d({ type: Boolean })
196
- ], o.prototype, "backgroundBar");
197
- c([
198
- d({ type: Boolean, reflect: !0 })
199
- ], o.prototype, "disabled");
200
- customElements.get("nys-breadcrumbs") || customElements.define("nys-breadcrumbs", o);
190
+ _.styles = S(L);
191
+ let i = _;
192
+ l([
193
+ o({ type: String, reflect: !0 })
194
+ ], i.prototype, "id");
195
+ l([
196
+ o({ type: String })
197
+ ], i.prototype, "ariaLabel");
198
+ l([
199
+ o({ type: String, reflect: !0 })
200
+ ], i.prototype, "size");
201
+ l([
202
+ o({ type: Boolean })
203
+ ], i.prototype, "backToParent");
204
+ l([
205
+ o({ type: Boolean })
206
+ ], i.prototype, "collapsed");
207
+ l([
208
+ o({ type: Boolean })
209
+ ], i.prototype, "backgroundBar");
210
+ l([
211
+ o({ type: Boolean, reflect: !0 })
212
+ ], i.prototype, "disabled");
213
+ customElements.get("nys-breadcrumbs") || customElements.define("nys-breadcrumbs", i);
201
214
  export {
202
- o as NysBreadcrumbs
215
+ i as NysBreadcrumbs
203
216
  };
204
217
  //# sourceMappingURL=nys-breadcrumbs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nys-breadcrumbs.js","sources":["../../internals/dist/index.js","../src/nys-breadcrumbs.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.21.0\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nvar y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nvar p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, v = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction A(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction R(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((r) => !!r);\n}\nfunction _(e) {\n return e.map((r) => (r.id || (r.id = f(\"nys-ref\")), r.id));\n}\nfunction V(e, r, a) {\n const t = d(a), n = R(r);\n t.length ? e.setAttribute(n, _(t).join(\" \")) : e.removeAttribute(n);\n}\nfunction x(e, r, a, t, n) {\n const i = d(t), s = p[a], l = r;\n if (s && A(r)) {\n l[s] = i.length ? i : null;\n return;\n }\n const o = v[a];\n if (!o) return;\n const c = n ?? (i.length ? i.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(a === \"labelledby\" ? \"aria-label\" : \"aria-description\", c) : e.removeAttribute(a === \"labelledby\" ? \"aria-label\" : \"aria-description\");\n}\nvar E = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, C = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, r, a) {\n const t = d(a), n = E[r], i = C[r], s = e;\n if (n && n in e && (s[n] = t.length ? t : null), !i) return;\n const l = t.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(i, l) : e.removeAttribute(i);\n}\nvar b = (e) => {\n class r extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return r;\n}, P = /* @__PURE__ */ b(u), h = (e) => {\n class r extends b(e) {\n constructor(...t) {\n super(...t), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\") try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(t, n) {\n const i = this.internals;\n if (i && t in i) {\n i[t] = n;\n return;\n }\n const s = g(t);\n n === null ? this.removeAttribute(s) : this.setAttribute(s, n);\n }\n reflectDefaultSemantics() {\n const t = this.defaultRole;\n t && this.setHostAria(\"role\", t);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return r;\n};\nfunction g(e) {\n if (e === \"role\") return \"role\";\n const r = e.replace(/^aria/, \"\");\n return \"aria-\" + r.charAt(0).toLowerCase() + r.slice(1);\n}\nvar T = /* @__PURE__ */ h(u), I = (e) => {\n class r extends h(e) {\n static {\n this.formAssociated = !0;\n }\n setFormValue(t) {\n this.internals?.setFormValue(t ?? null);\n }\n setValidityFromState(t, n, i) {\n const s = this.internals;\n if (!s) return;\n const l = Object.values(t).some(Boolean);\n l ? s.setValidity(t, n ?? \"Invalid value\", i) : s.setValidity({}), this.setHostAria(\"ariaInvalid\", l ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.clearValidity();\n }\n }\n return r;\n}, w = /* @__PURE__ */ I(u);\nfunction O(e) {\n const r = e.tagName.toLowerCase(), a = /* @__PURE__ */ new Set(), t = (n) => {\n n.querySelectorAll(\"*\").forEach((i) => {\n const s = i.tagName.toLowerCase();\n s.startsWith(\"nys-\") && s !== r && !customElements.get(s) && a.add(s), i.shadowRoot && t(i.shadowRoot);\n });\n };\n return e.shadowRoot && t(e.shadowRoot), t(e), [...a].sort();\n}\nexport {\n I as FormControlMixin,\n b as IdentifiedMixin,\n P as NysElement,\n w as NysFormControlElement,\n T as NysReflectsAriaElement,\n h as ReflectsAriaMixin,\n V as associateControl,\n L as associateControlRefs,\n x as associateHost,\n O as findUnregisteredChildren,\n f as generateId,\n A as supportsElementRefs\n};\n\n//# sourceMappingURL=index.js.map","import { html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { NysElement } from \"@nysds/internals\";\n// This element is created imperatively (document.createElement) for the\n// back-to-parent arrow, the trailing chevrons, and the collapsed-trail\n// ellipsis, so it must be registered whenever nys-breadcrumbs is used.\n// Importing it here (intentional side effect) guarantees it always renders.\nimport \"@nysds/nys-icon\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-breadcrumbs.scss?inline\";\n\n/**\n * A breadcrumb navigation trail composed of `li` elements.\n * Collapses when the trail exceeds 5 items on desktop or 3 items on mobile,\n * showing the first, last, and item before the current page, with an ellipsis to expand.\n * A single item renders as a back-to-parent link instead of a trail.\n *\n * @summary Breadcrumb navigation trail with responsive collapse support.\n * @element nys-breadcrumbs\n *\n * @slot - One or more `li` elements defining the trail.\n *\n * @fires nys-breadcrumbs-expand - Fired when the user clicks the ellipsis to expand the trail.\n *\n * @example Basic\n * ```html\n * <nys-breadcrumbs>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/services\">Services</a></li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Current page\n * ```html\n * <nys-breadcrumbs>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/services\">Services</a></li>\n * <li>Current Page</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Single item list\n * ```html\n * <nys-breadcrumbs>\n * <ol>\n * <li><a href=\"/services\">Services</a></li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Long list\n * ```html\n * <nys-breadcrumbs>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/government\">Government</a></li>\n * <li><a href=\"/government/agencies\">Agencies</a></li>\n * <li><a href=\"/government/agencies/parks\">Parks & Recreation</a></li>\n * <li><a href=\"/parks/state-parks\">State Parks</a></li>\n * <li><a href=\"/parks/state-parks/delaware\">Delaware Region</a></li>\n * <li><a href=\"/parks/state-parks/delaware/water-gap\">Delaware Water Gap</a></li>\n * <li>Trail Conditions</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Size small\n * ```html\n * <nys-breadcrumbs size=\"sm\">\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/government\">Government</a></li>\n * <li><a href=\"/government/agencies\">Agencies</a></li>\n * <li>Parks & Recreation</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Back to parent (mobile)\n * ```html\n * <nys-breadcrumbs backToParent>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/government\">Government</a></li>\n * <li><a href=\"/government/agencies\">Agencies</a></li>\n * <li><a href=\"/government/agencies/parks\">Parks & Recreation</a></li>\n * <li><a href=\"/parks/state-parks\">State Parks</a></li>\n * <li><a href=\"/parks/state-parks/delaware\">Delaware Region</a></li>\n * <li><a href=\"/parks/state-parks/delaware/water-gap\">Delaware Water Gap</a></li>\n * <li>Trail Conditions</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Background bar\n * ```html\n * <nys-breadcrumbs backgroundBar>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/services\">Services</a></li>\n * <li><a href=\"/tickets\">Ticket System</a></li>\n * <li>Del Water Gap</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Disabled\n * ```html\n * <nys-breadcrumbs disabled>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/services\">Services</a></li>\n * <li><a href=\"/tickets\">Ticket System</a></li>\n * <li>Del Water Gap</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n */\n\nexport class NysBreadcrumbs extends NysElement {\n static styles = unsafeCSS(styles);\n\n /**\n * Unique identifier. Auto-generated if not provided.\n */\n @property({ type: String, reflect: true }) id = \"\";\n\n /**\n * Accessible label for the `<nav>` landmark. Defaults to \"Breadcrumb\" if not set.\n * Override when multiple crumbs exist on the same page.\n */\n @property({ type: String }) ariaLabel = \"\";\n\n /**\n * Controls the visual size of the breadcrumb text and spacing: `sm` for dense layouts, `md` (default) for standard use.\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" = \"md\";\n\n /**\n * On mobile, renders the trail as a single back-to-parent link pointing to the item before the current page.\n * Has no effect on desktop or when only one item is present (which always renders as a back link).\n * @default false\n */\n @property({ type: Boolean }) backToParent = false;\n\n /**\n * Forces the trail into its collapsed state.\n * It shows only the first item, an ellipsis, and the last two items.\n * The user can still expand the trail by clicking the ellipsis.\n * @default false\n */\n @property({ type: Boolean }) collapsed = false;\n\n /**\n * Renders a filled light theme background bar behind the breadcrumb trail.\n * @default false\n */\n @property({ type: Boolean }) backgroundBar = false;\n\n /**\n * Prevents interaction.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n private _collapseThreshold = 5; // default for desktop\n private _manuallyExpanded = false;\n private _mediaQuery: MediaQueryList | null = null;\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n */\n\n constructor() {\n super();\n }\n\n connectedCallback() {\n // super.connectedCallback() (NysElement) auto-assigns an id when\n // one is not provided (prefix = localName, shape \"nys-breadcrumbs-<ts>-<n>\").\n // The breadcrumb's navigation role lives on the inner <nav> landmark (with an\n // accessible name), so defaultRole stays null and no host role is reflected.\n super.connectedCallback();\n\n this._mediaQuery = window.matchMedia(\"(max-width: 767px)\");\n this._mediaQuery.addEventListener(\"change\", this._updateCollapseThreshold);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._mediaQuery?.removeEventListener(\n \"change\",\n this._updateCollapseThreshold,\n );\n this._mediaQuery = null;\n }\n\n firstUpdated() {\n this._handleSlotChange();\n }\n\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n if (\n changedProperties.has(\"collapsed\") ||\n changedProperties.has(\"backToParent\") ||\n changedProperties.has(\"disabled\")\n ) {\n this._handleSlotChange();\n }\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n private _updateCollapseThreshold = () => {\n const isMobile = this._mediaQuery?.matches ?? window.innerWidth < 768; // NYSDS sets anything below 768px as mobile. Desktop and Tablet is above 768px.\n const newThreshold = isMobile ? 3 : 5;\n\n if (newThreshold !== this._collapseThreshold) {\n this._collapseThreshold = newThreshold;\n this._manuallyExpanded = false;\n this._handleSlotChange();\n }\n };\n\n private _getSlottedOl(): HTMLOListElement | null {\n const slot = this.shadowRoot?.querySelector(\n \"slot\",\n ) as HTMLSlotElement | null;\n const assigned = slot?.assignedElements({ flatten: true }) ?? [];\n return (\n (assigned.find((el) => el.tagName === \"OL\") as HTMLOListElement) ?? null\n );\n }\n\n private _getSlottedItems(): HTMLLIElement[] {\n const ol = this._getSlottedOl();\n if (!ol) return [];\n return Array.from(ol.children).filter(\n (el) => el.tagName === \"LI\",\n ) as HTMLLIElement[];\n }\n\n private _getAnchor(li: HTMLLIElement): HTMLAnchorElement | null {\n return li.querySelector(\"a\");\n }\n\n private _isCurrentPage(li: HTMLLIElement): boolean {\n const a = this._getAnchor(li);\n if (!a) return true;\n return false;\n }\n\n private _createBackToParentElement(li: HTMLLIElement) {\n const anchor = this._getAnchor(li);\n const link = anchor?.getAttribute(\"href\") ?? \"\";\n const label = anchor?.textContent?.trim() ?? li.textContent?.trim() ?? \"\";\n\n const liEL = document.createElement(\"li\");\n liEL.className = \"nys-breadcrumbitem\";\n\n const icon = document.createElement(\"nys-icon\");\n icon.setAttribute(\"name\", \"arrow_back\");\n icon.setAttribute(\"size\", \"16\");\n\n const a = document.createElement(\"a\");\n if (!this.disabled) {\n a.href = link;\n }\n a.textContent = label;\n if (this.disabled) {\n a.setAttribute(\"aria-disabled\", \"true\");\n }\n\n liEL.appendChild(icon);\n liEL.appendChild(a);\n\n return liEL;\n }\n\n private _createCrumbElement(li: HTMLLIElement, isCurrentPage: boolean) {\n const anchor = this._getAnchor(li);\n const link = anchor?.getAttribute(\"href\") ?? \"\";\n const label = anchor?.textContent?.trim() ?? li.textContent?.trim() ?? \"\";\n\n const liEl = document.createElement(\"li\");\n liEl.className = \"nys-breadcrumbitem\";\n\n if (isCurrentPage) {\n // WCAG 4.1.2 / WAI-ARIA breadcrumb pattern: the current page must be\n // programmatically identified so assistive tech announces \"current page\".\n liEl.setAttribute(\"aria-current\", \"page\");\n liEl.textContent = label;\n return liEl;\n }\n\n const a = document.createElement(\"a\");\n if (!this.disabled) {\n a.href = link;\n }\n a.textContent = label;\n if (this.disabled) {\n a.setAttribute(\"aria-disabled\", \"true\");\n }\n\n const icon = document.createElement(\"nys-icon\");\n icon.setAttribute(\"name\", \"chevron_right\");\n icon.setAttribute(\"size\", \"14\");\n\n liEl.appendChild(a);\n liEl.appendChild(icon);\n return liEl;\n }\n\n /**\n * Main logic for cloning and handling user slots.\n * New <ol>, <li>, and <a> tags are created and rendered out as crumbs for the breadcrumbs trail.\n */\n private _handleSlotChange() {\n const isMobile = this._mediaQuery?.matches ?? window.innerWidth < 768;\n const ol = this.shadowRoot?.getElementById(\"crumb-list\");\n if (!ol) return;\n\n const items = this._getSlottedItems();\n if (items.length === 0) return;\n\n ol.innerHTML = \"\";\n\n // ---------------------------------------------------------\n\n const setCrumbAsBackToParentBtn = (index = 0) => {\n const clone = items[index].cloneNode(true) as HTMLLIElement;\n\n const backToParentBtn = this._createBackToParentElement(clone);\n ol.appendChild(backToParentBtn);\n };\n\n // Single breadcrumb item OR backToParent=true for mobile - render as backToParent button\n if (items.length === 1) {\n setCrumbAsBackToParentBtn();\n return;\n }\n\n if (isMobile && this.backToParent) {\n const currentPageExist = this._isCurrentPage(items[items.length - 1]);\n\n if (currentPageExist) {\n setCrumbAsBackToParentBtn(items.length - 2);\n } else {\n setCrumbAsBackToParentBtn(items.length - 1);\n }\n return;\n }\n\n // ---------------------------------------------------------\n const shouldAutoCollapse =\n !this._manuallyExpanded && items.length > this._collapseThreshold;\n const collapseTrail = this.collapsed || shouldAutoCollapse;\n\n const lastItem = items[items.length - 1];\n const hasCurrentPage = this._isCurrentPage(lastItem);\n const itemsBeforeCollapse = Math.min(1, items.length - 1);\n const itemsAfterCollapse = Math.min(\n hasCurrentPage ? 2 : 1,\n items.length - itemsBeforeCollapse,\n );\n\n // Normal multi-item breadcrumb trail\n items.forEach((crumb, index) => {\n const crumbIsBeforeCollapse = index < itemsBeforeCollapse;\n const crumbIsAfterCollapse = index >= items.length - itemsAfterCollapse;\n const isAlwaysVisible = crumbIsBeforeCollapse || crumbIsAfterCollapse;\n const shouldHide = collapseTrail && !isAlwaysVisible; // Determines which of the crumbs is hidden\n\n const liEl = this._createCrumbElement(crumb, this._isCurrentPage(crumb));\n liEl.setAttribute(\"data-cloned\", \"true\");\n\n if (shouldHide) {\n liEl.classList.add(\"hide\");\n }\n\n if (!isAlwaysVisible) {\n // Assigning which crumb is an intermediate item (aka hidable) allows us to later redirect focus on the first of these intermediates.\n liEl.classList.add(\"intermediate\");\n }\n\n ol.appendChild(liEl);\n\n // Insert ellipsis before the first hidden cloned item when collapsed\n if (\n index === itemsBeforeCollapse - 1 &&\n collapseTrail &&\n items.length > 2\n ) {\n const ellipsis = document.createElement(\"li\");\n ellipsis.classList.add(\"nys-breadcrumbs__ellipsis\");\n\n // Ellipse button\n const button = document.createElement(\"a\");\n button.classList.add(\"ellipsis-btn\");\n button.setAttribute(\"aria-label\", \"Show more links\");\n button.setAttribute(\"role\", \"button\");\n button.setAttribute(\"href\", \"#\");\n button.textContent = \"…\";\n\n const expandTrail = (e: Event) => {\n e.preventDefault();\n this._manuallyExpanded = true;\n this.collapsed = false;\n this._handleSlotChange();\n this._dispatchExpandEvent();\n this._moveFocusToFirstExpandCrumb();\n };\n\n button.addEventListener(\"click\", expandTrail);\n button.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.key === \" \") expandTrail(e);\n });\n\n // Chevron Icon\n const icon = document.createElement(\"nys-icon\");\n icon.setAttribute(\"name\", \"chevron_right\");\n icon.setAttribute(\"size\", \"14\");\n\n ellipsis.appendChild(button);\n ellipsis.appendChild(icon);\n ol.appendChild(ellipsis);\n }\n });\n }\n\n private _moveFocusToFirstExpandCrumb() {\n setTimeout(() => {\n const ol = this.shadowRoot?.getElementById(\"crumb-list\");\n const firstClone = ol?.querySelector(\"li[data-cloned].intermediate\");\n firstClone?.querySelector<HTMLAnchorElement>(\"a\")?.focus();\n }, 0);\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n private _dispatchExpandEvent() {\n this.dispatchEvent(\n new CustomEvent(\"nys-expand\", {\n detail: { id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n render() {\n return html`<nav\n class=\"nys-breadcrumbs ${this.backgroundBar\n ? \"nys-breadcrumbs--background-bar\"\n : \"\"}\"\n aria-label=${this.ariaLabel || \"Breadcrumb\"}\n >\n <ol id=\"crumb-list\"></ol>\n <slot style=\"display: none;\" @slotchange=${this._handleSlotChange}></slot>\n </nav>`;\n }\n}\n\nif (!customElements.get(\"nys-breadcrumbs\")) {\n customElements.define(\"nys-breadcrumbs\", NysBreadcrumbs);\n}\n"],"names":["LitElement","unsafeCSS","html","property","y","f","e","b","r","P","u","_NysBreadcrumbs","NysElement","newThreshold","changedProperties","el","ol","li","anchor","link","label","liEL","icon","a","isCurrentPage","liEl","isMobile","items","setCrumbAsBackToParentBtn","index","clone","backToParentBtn","currentPageExist","shouldAutoCollapse","collapseTrail","lastItem","hasCurrentPage","itemsBeforeCollapse","itemsAfterCollapse","crumb","crumbIsBeforeCollapse","crumbIsAfterCollapse","isAlwaysVisible","shouldHide","ellipsis","button","expandTrail","styles","NysBreadcrumbs","__decorateClass"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF,GAAG;AAClC;AAgDG,IAACG,IAAI,CAAC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AS;AAAA,GAzBhB6C,EAyBkB,WAAA,cAAA;AAQAC,EAAA;AAAA,EAA5B9C,EAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAjChB6C,EAiCkB,WAAA,WAAA;AAMAC,EAAA;AAAA,EAA5B9C,EAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAvChB6C,EAuCkB,WAAA,eAAA;AAMeC,EAAA;AAAA,EAA3C9C,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GA7C/B6C,EA6CiC,WAAA,UAAA;AAkTzC,eAAe,IAAI,iBAAiB,KACvC,eAAe,OAAO,mBAAmBA,CAAc;"}
1
+ {"version":3,"file":"nys-breadcrumbs.js","sources":["../../internals/dist/index.js","../src/nys-breadcrumbs.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.21.1\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nlet y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, A = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction R(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction _(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction E(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction V(e, t, n) {\n const i = d(n), r = _(t);\n i.length ? e.setAttribute(r, E(i).join(\" \")) : e.removeAttribute(r);\n}\nfunction x(e, t, n, i, r) {\n const s = d(i), a = p[n], l = t;\n if (a && R(t)) {\n l[a] = s.length ? s : null;\n return;\n }\n const o = A[n];\n if (!o) return;\n const c = r ?? (s.length ? s.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst g = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, C = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, n) {\n const i = d(n), r = g[t], s = C[t], a = e;\n if (r && r in e && (a[r] = i.length ? i : null), !s) return;\n const l = i.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(s, l) : e.removeAttribute(s);\n}\nconst b = (e) => {\n class t extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return t;\n}, P = /* @__PURE__ */ b(u), h = (e) => {\n class t extends b(e) {\n constructor() {\n super(...arguments), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\")\n try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(i, r) {\n const s = this.internals;\n if (s && i in s) {\n s[i] = r;\n return;\n }\n const a = v(i);\n r === null ? this.removeAttribute(a) : this.setAttribute(a, r);\n }\n reflectDefaultSemantics() {\n const i = this.defaultRole;\n i && this.setHostAria(\"role\", i);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return t;\n};\nfunction v(e) {\n if (e === \"role\") return \"role\";\n const t = e.replace(/^aria/, \"\");\n return \"aria-\" + t.charAt(0).toLowerCase() + t.slice(1);\n}\nconst T = /* @__PURE__ */ h(u), I = (e) => {\n const n = class n extends h(e) {\n setFormValue(r) {\n this.internals?.setFormValue(r ?? null);\n }\n setValidityFromState(r, s, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(r).some(Boolean);\n o ? l.setValidity(r, s ?? \"Invalid value\", a) : l.setValidity({}), this.setHostAria(\"ariaInvalid\", o ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.clearValidity();\n }\n };\n n.formAssociated = !0;\n let t = n;\n return t;\n}, w = /* @__PURE__ */ I(u);\nfunction O(e) {\n const t = e.tagName.toLowerCase(), n = /* @__PURE__ */ new Set(), i = (r) => {\n r.querySelectorAll(\"*\").forEach((s) => {\n const a = s.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && n.add(a), s.shadowRoot && i(s.shadowRoot);\n });\n };\n return e.shadowRoot && i(e.shadowRoot), i(e), [...n].sort();\n}\nexport {\n I as FormControlMixin,\n b as IdentifiedMixin,\n P as NysElement,\n w as NysFormControlElement,\n T as NysReflectsAriaElement,\n h as ReflectsAriaMixin,\n V as associateControl,\n L as associateControlRefs,\n x as associateHost,\n O as findUnregisteredChildren,\n f as generateId,\n R as supportsElementRefs\n};\n//# sourceMappingURL=index.js.map\n","import { html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { NysElement } from \"@nysds/internals\";\n// This element is created imperatively (document.createElement) for the\n// back-to-parent arrow, the trailing chevrons, and the collapsed-trail\n// ellipsis, so it must be registered whenever nys-breadcrumbs is used.\n// Importing it here (intentional side effect) guarantees it always renders.\nimport \"@nysds/nys-icon\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-breadcrumbs.scss?inline\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport lightStyles from \"./nys-breadcrumbs.light.scss?inline\";\n\nlet _lightSheet: CSSStyleSheet | null = null;\n// Injects the lightDOM styling for the scss into the adopted/constructed stylesheet.\nfunction adoptLightStyles() {\n if (_lightSheet || typeof document === \"undefined\") return;\n _lightSheet = new CSSStyleSheet();\n _lightSheet.replaceSync(lightStyles);\n document.adoptedStyleSheets = [...document.adoptedStyleSheets, _lightSheet];\n}\n\nconst INJECTED_ATTR = \"data-nys-injected\";\n\n/**\n * A breadcrumb navigation trail composed of `li` elements.\n * Collapses when the trail exceeds 5 items on desktop or 3 items on mobile,\n * showing the first, last, and item before the current page, with an ellipsis to expand.\n * A single item renders as a back-to-parent link instead of a trail.\n *\n * @summary Breadcrumb navigation trail with responsive collapse support.\n * @element nys-breadcrumbs\n *\n * @slot - One or more `li` elements defining the trail.\n *\n * @fires nys-breadcrumbs-expand - Fired when the user clicks the ellipsis to expand the trail.\n *\n * @example Basic\n * ```html\n * <nys-breadcrumbs>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/services\">Services</a></li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Current page\n * ```html\n * <nys-breadcrumbs>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/services\">Services</a></li>\n * <li>Current Page</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Single item list\n * ```html\n * <nys-breadcrumbs>\n * <ol>\n * <li><a href=\"/services\">Services</a></li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Long list\n * ```html\n * <nys-breadcrumbs>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/government\">Government</a></li>\n * <li><a href=\"/government/agencies\">Agencies</a></li>\n * <li><a href=\"/government/agencies/parks\">Parks & Recreation</a></li>\n * <li><a href=\"/parks/state-parks\">State Parks</a></li>\n * <li><a href=\"/parks/state-parks/delaware\">Delaware Region</a></li>\n * <li><a href=\"/parks/state-parks/delaware/water-gap\">Delaware Water Gap</a></li>\n * <li>Trail Conditions</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Size small\n * ```html\n * <nys-breadcrumbs size=\"sm\">\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/government\">Government</a></li>\n * <li><a href=\"/government/agencies\">Agencies</a></li>\n * <li>Parks & Recreation</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Back to parent (mobile)\n * ```html\n * <nys-breadcrumbs backToParent>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/government\">Government</a></li>\n * <li><a href=\"/government/agencies\">Agencies</a></li>\n * <li><a href=\"/government/agencies/parks\">Parks & Recreation</a></li>\n * <li><a href=\"/parks/state-parks\">State Parks</a></li>\n * <li><a href=\"/parks/state-parks/delaware\">Delaware Region</a></li>\n * <li><a href=\"/parks/state-parks/delaware/water-gap\">Delaware Water Gap</a></li>\n * <li>Trail Conditions</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Background bar\n * ```html\n * <nys-breadcrumbs backgroundBar>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/services\">Services</a></li>\n * <li><a href=\"/tickets\">Ticket System</a></li>\n * <li>Del Water Gap</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n *\n * @example Disabled\n * ```html\n * <nys-breadcrumbs disabled>\n * <ol>\n * <li><a href=\"/\">Home</a></li>\n * <li><a href=\"/services\">Services</a></li>\n * <li><a href=\"/tickets\">Ticket System</a></li>\n * <li>Del Water Gap</li>\n * </ol>\n * </nys-breadcrumbs>\n * ```\n */\n\nexport class NysBreadcrumbs extends NysElement {\n static styles = unsafeCSS(styles);\n\n /**\n * Unique identifier. Auto-generated if not provided.\n */\n @property({ type: String, reflect: true }) id = \"\";\n\n /**\n * Accessible label for the `<nav>` landmark. Defaults to \"Breadcrumb\" if not set.\n * Override when multiple crumbs exist on the same page.\n */\n @property({ type: String }) ariaLabel = \"\";\n\n /**\n * Controls the visual size of the breadcrumb text and spacing: `sm` for dense layouts, `md` (default) for standard use.\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" = \"md\";\n\n /**\n * On mobile, renders the trail as a single back-to-parent link pointing to the item before the current page.\n * Has no effect on desktop or when only one item is present (which always renders as a back link).\n * @default false\n */\n @property({ type: Boolean }) backToParent = false;\n\n /**\n * Forces the trail into its collapsed state.\n * It shows only the first item, an ellipsis, and the last two items.\n * The user can still expand the trail by clicking the ellipsis.\n * @default false\n */\n @property({ type: Boolean }) collapsed = false;\n\n /**\n * Renders a filled light theme background bar behind the breadcrumb trail.\n * @default false\n */\n @property({ type: Boolean }) backgroundBar = false;\n\n /**\n * Prevents interaction.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n private _collapseThreshold = 5; // default for desktop\n private _manuallyExpanded = false;\n private _mediaQuery: MediaQueryList | null = null;\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n */\n\n constructor() {\n super();\n }\n\n connectedCallback() {\n // super.connectedCallback() (NysElement) auto-assigns an id when\n // one is not provided (prefix = localName, shape \"nys-breadcrumbs-<ts>-<n>\").\n // The breadcrumb's navigation role lives on the inner <nav> landmark (with an\n // accessible name), so defaultRole stays null and no host role is reflected.\n super.connectedCallback();\n\n adoptLightStyles();\n\n this._mediaQuery = window.matchMedia(\"(max-width: 767px)\");\n this._mediaQuery.addEventListener(\"change\", this._updateCollapseThreshold);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._mediaQuery?.removeEventListener(\n \"change\",\n this._updateCollapseThreshold,\n );\n this._mediaQuery = null;\n }\n\n firstUpdated() {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>(\"slot\");\n slot?.addEventListener(\"slotchange\", () => this._handleSlotChange());\n slot?.addEventListener(\"click\", this._boundDisabledClickGuard);\n this._handleSlotChange();\n }\n\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n if (\n changedProperties.has(\"collapsed\") ||\n changedProperties.has(\"backToParent\") ||\n changedProperties.has(\"disabled\")\n ) {\n this._handleSlotChange();\n }\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n private _updateCollapseThreshold = () => {\n const isMobile = this._mediaQuery?.matches ?? window.innerWidth < 768; // NYSDS sets anything below 768px as mobile. Desktop and Tablet is above 768px.\n const newThreshold = isMobile ? 3 : 5;\n\n if (newThreshold !== this._collapseThreshold) {\n this._collapseThreshold = newThreshold;\n this._manuallyExpanded = false;\n this._handleSlotChange();\n }\n };\n\n private _boundDisabledClickGuard = (e: Event) => {\n const a = (e.target as HTMLElement)?.closest?.(\"a\");\n if (a?.getAttribute(\"aria-disabled\") === \"true\") {\n e.preventDefault();\n }\n };\n\n private _getSlottedOl(): HTMLOListElement | null {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>(\"slot\");\n const assigned = slot?.assignedElements({ flatten: true }) ?? [];\n return (\n (assigned.find((el) => el.tagName === \"OL\") as HTMLOListElement) ?? null\n );\n }\n\n private _getSlottedItems(ol: HTMLOListElement): HTMLLIElement[] {\n return Array.from(ol.children).filter(\n (el) => el.tagName === \"LI\" && !el.hasAttribute(INJECTED_ATTR),\n ) as HTMLLIElement[];\n }\n\n private _getAnchor(li: HTMLLIElement): HTMLAnchorElement | null {\n return li.querySelector(\"a\");\n }\n\n private _isCurrentPage(li: HTMLLIElement): boolean {\n return !this._getAnchor(li);\n }\n\n private _createIcon(name: string, size: string): HTMLElement {\n const icon = document.createElement(\"nys-icon\");\n icon.setAttribute(\"name\", name);\n icon.setAttribute(\"size\", size);\n icon.setAttribute(INJECTED_ATTR, \"true\");\n return icon;\n }\n\n private _resetItem(li: HTMLLIElement) {\n li.className = \"\";\n li.removeAttribute(\"aria-current\");\n\n li.querySelectorAll(`[${INJECTED_ATTR}]`).forEach((el) => el.remove());\n\n const a = this._getAnchor(li);\n if (a) {\n a.removeAttribute(\"aria-disabled\");\n a.removeAttribute(\"tabindex\");\n }\n }\n\n private _applyDisabledState(a: HTMLAnchorElement) {\n if (!this.disabled) return;\n a.setAttribute(\"aria-disabled\", \"true\");\n a.setAttribute(\"tabindex\", \"-1\");\n }\n\n private _applyBackToParentStyle(li: HTMLLIElement) {\n li.classList.add(\"nys-breadcrumbitem\", \"back-to-parent\");\n const a = this._getAnchor(li);\n if (a) {\n this._applyDisabledState(a);\n a.insertAdjacentElement(\n \"beforebegin\",\n this._createIcon(\"arrow_back\", \"16\"),\n );\n }\n }\n\n private _applyCrumbStyle(li: HTMLLIElement, isCurrentPage: boolean) {\n li.classList.add(\"nys-breadcrumbitem\");\n\n if (isCurrentPage) {\n // WCAG 4.1.2 / WAI-ARIA breadcrumb pattern: the current page must be\n // programmatically identified so assistive tech announces \"current page\".\n li.setAttribute(\"aria-current\", \"page\");\n return;\n }\n\n const a = this._getAnchor(li);\n if (a) {\n this._applyDisabledState(a);\n a.insertAdjacentElement(\n \"afterend\",\n this._createIcon(\"chevron_right\", \"14\"),\n );\n }\n }\n\n private _insertEllipsis(referenceLi: HTMLLIElement) {\n const ellipsis = document.createElement(\"li\");\n ellipsis.classList.add(\"nys-breadcrumbs__ellipsis\");\n ellipsis.setAttribute(INJECTED_ATTR, \"true\");\n\n const button = document.createElement(\"a\");\n button.classList.add(\"ellipsis-btn\");\n button.setAttribute(\"aria-label\", \"Show more links\");\n button.setAttribute(\"role\", \"button\");\n button.setAttribute(\"href\", \"#\");\n button.textContent = \"…\";\n\n const expandTrail = (e: Event) => {\n e.preventDefault();\n this._manuallyExpanded = true;\n this.collapsed = false;\n this._handleSlotChange();\n this._dispatchExpandEvent();\n this._moveFocusToFirstExpandCrumb();\n };\n\n button.addEventListener(\"click\", expandTrail);\n button.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.key === \" \") expandTrail(e);\n });\n\n ellipsis.appendChild(button);\n ellipsis.appendChild(this._createIcon(\"chevron_right\", \"14\"));\n\n referenceLi.insertAdjacentElement(\"afterend\", ellipsis);\n }\n\n /**\n * Main logic for cloning and handling user slots.\n * New <ol>, <li>, and <a> tags are created and rendered out as crumbs for the breadcrumbs trail.\n */\n private _handleSlotChange() {\n const isMobile = this._mediaQuery?.matches ?? window.innerWidth < 768;\n const ol = this._getSlottedOl();\n if (!ol) return;\n\n // Reset to remove injected elements\n ol.querySelectorAll(`li[${INJECTED_ATTR}]`).forEach((el) => el.remove());\n\n const items = this._getSlottedItems(ol);\n if (items.length === 0) return;\n\n items.forEach((li) => this._resetItem(li));\n\n // ---------------------------------------------------------\n\n // Single breadcrumb item - always render as backToParent style\n if (items.length === 1) {\n this._applyBackToParentStyle(items[0]);\n return;\n }\n\n // The backToParent=true for mobile - render as backToParent button\n if (isMobile && this.backToParent) {\n const currentPageExists = this._isCurrentPage(items[items.length - 1]);\n const targetIndex = currentPageExists\n ? items.length - 2\n : items.length - 1;\n\n items.forEach((li, index) => {\n if (index === targetIndex) {\n this._applyBackToParentStyle(li);\n } else {\n this._applyCrumbStyle(li, this._isCurrentPage(li));\n li.classList.add(\"hide\");\n }\n });\n return;\n }\n\n // ---------------------------------------------------------\n const shouldAutoCollapse =\n !this._manuallyExpanded && items.length > this._collapseThreshold;\n const collapseTrail = this.collapsed || shouldAutoCollapse;\n\n const lastItem = items[items.length - 1];\n const hasCurrentPage = this._isCurrentPage(lastItem);\n const itemsBeforeCollapse = Math.min(1, items.length - 1);\n const itemsAfterCollapse = Math.min(\n hasCurrentPage ? 2 : 1,\n items.length - itemsBeforeCollapse,\n );\n\n // Normal multi-item breadcrumb trail\n items.forEach((li, index) => {\n const isBeforeCollapse = index < itemsBeforeCollapse;\n const isAfterCollapse = index >= items.length - itemsAfterCollapse;\n const isAlwaysVisible = isBeforeCollapse || isAfterCollapse;\n const shouldHide = collapseTrail && !isAlwaysVisible; // Determines which of the crumbs is hidden\n\n this._applyCrumbStyle(li, this._isCurrentPage(li));\n\n if (shouldHide) li.classList.add(\"hide\");\n if (!isAlwaysVisible) li.classList.add(\"intermediate\");\n\n // Insert ellipsis before the first hidden cloned item when collapsed\n if (\n index === itemsBeforeCollapse - 1 &&\n collapseTrail &&\n items.length > 2\n ) {\n this._insertEllipsis(li);\n }\n });\n }\n\n private _moveFocusToFirstExpandCrumb() {\n setTimeout(() => {\n const ol = this._getSlottedOl();\n const firstIntermediate = ol?.querySelector(\"li.intermediate\");\n firstIntermediate?.querySelector<HTMLAnchorElement>(\"a\")?.focus();\n }, 0);\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n private _dispatchExpandEvent() {\n this.dispatchEvent(\n new CustomEvent(\"nys-expand\", {\n detail: { id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n render() {\n return html`<nav\n class=\"nys-breadcrumbs ${this.backgroundBar\n ? \"nys-breadcrumbs--background-bar\"\n : \"\"}\"\n aria-label=${this.ariaLabel || \"Breadcrumb\"}\n >\n <slot @slotchange=${this._handleSlotChange}></slot>\n </nav>`;\n }\n}\n\nif (!customElements.get(\"nys-breadcrumbs\")) {\n customElements.define(\"nys-breadcrumbs\", NysBreadcrumbs);\n}\n"],"names":["LitElement","unsafeCSS","html","property","y","f","e","b","t","P","u","_lightSheet","adoptLightStyles","lightStyles","INJECTED_ATTR","_NysBreadcrumbs","NysElement","newThreshold","slot","changedProperties","el","ol","li","name","size","icon","a","isCurrentPage","referenceLi","ellipsis","button","expandTrail","isMobile","items","targetIndex","index","shouldAutoCollapse","collapseTrail","lastItem","hasCurrentPage","itemsBeforeCollapse","itemsAfterCollapse","isBeforeCollapse","isAfterCollapse","isAlwaysVisible","shouldHide","styles","NysBreadcrumbs","__decorateClass"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF,GAAG;AAClC;AAqDK,MAACG,IAAI,CAACD,MAAM;AAAA,EACf,MAAME,UAAUF,EAAE;AAAA,IAChB,IAAI,WAAW;AACb,aAAO,KAAK,aAAa;AAAA,IAC3B;AAA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;AACF;AAzVEa,EAAO,SAASd,EAAU6C,CAAM;AAD3B,IAAMC,IAANhC;AAMsCiC,EAAA;AAAA,EAA1C7C,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAN9B4C,EAMgC,WAAA,IAAA;AAMfC,EAAA;AAAA,EAA3B7C,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAZf4C,EAYiB,WAAA,WAAA;AAMeC,EAAA;AAAA,EAA1C7C,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAlB9B4C,EAkBgC,WAAA,MAAA;AAOdC,EAAA;AAAA,EAA5B7C,EAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAzBhB4C,EAyBkB,WAAA,cAAA;AAQAC,EAAA;AAAA,EAA5B7C,EAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAjChB4C,EAiCkB,WAAA,WAAA;AAMAC,EAAA;AAAA,EAA5B7C,EAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAvChB4C,EAuCkB,WAAA,eAAA;AAMeC,EAAA;AAAA,EAA3C7C,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GA7C/B4C,EA6CiC,WAAA,UAAA;AA+SzC,eAAe,IAAI,iBAAiB,KACvC,eAAe,OAAO,mBAAmBA,CAAc;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-breadcrumbs",
3
- "version": "1.21.0",
3
+ "version": "1.21.1",
4
4
  "description": "The Breadcrumbs component from the NYS Design System.",
5
5
  "module": "dist/nys-breadcrumbs.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,10 +23,10 @@
23
23
  "lit-analyze": "lit-analyzer 'src/**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.21.0"
26
+ "@nysds/nys-icon": "^1.21.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@nysds/internals": "^1.21.0",
29
+ "@nysds/internals": "^1.21.1",
30
30
  "lit": "^3.3.1",
31
31
  "typescript": "^5.9.3",
32
32
  "vite": "^7.3.1"