@nysds/nys-breadcrumbs 1.21.1 → 1.22.0

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.
@@ -1,5 +1,11 @@
1
1
  import { NysElement } from "@nysds/internals";
2
2
  import "@nysds/nys-icon";
3
+ /** Detail payload for the `nys-expand` event fired by `nys-breadcrumbs`. */
4
+ export interface NysBreadcrumbsExpandDetail {
5
+ id: string;
6
+ }
7
+ /** The `nys-expand` event fired by `nys-breadcrumbs`. */
8
+ export type NysBreadcrumbsExpandEvent = CustomEvent<NysBreadcrumbsExpandDetail>;
3
9
  /**
4
10
  * A breadcrumb navigation trail composed of `li` elements.
5
11
  * Collapses when the trail exceeds 5 items on desktop or 3 items on mobile,
@@ -11,7 +17,22 @@ import "@nysds/nys-icon";
11
17
  *
12
18
  * @slot - One or more `li` elements defining the trail.
13
19
  *
14
- * @fires nys-breadcrumbs-expand - Fired when the user clicks the ellipsis to expand the trail.
20
+ * @cssprop [--nys-max-width--content] - Overrides the inner content max width across the grid, header, footer, and breadcrumb. Set at a higher level like `:root` to apply to all instances. Takes priority over the size-specific variable.
21
+ *
22
+ * @fires {NysBreadcrumbsExpandEvent} nys-expand - Fired when the user clicks the ellipsis to expand the trail. Detail: `{id}`.
23
+ *
24
+ * @usagedos
25
+ * - Use on pages at level 2 and deeper in a site hierarchy. If a level 2 page has child pages, all pages starting at that level should include a breadcrumb.
26
+ * - Place breadcrumb below the header and above the main content.
27
+ * - Show the site hierarchy, not the path a user took.
28
+ * - For the home page of a site, use a specific label rather than a generic "Home." This differentiates the main site home from other landing pages (e.g., "myBenefits Home" instead of just "Home").
29
+ *
30
+ * @usagedonts
31
+ * - Use on top-level pages, or on sites with only one or two levels of hierarchy.
32
+ * - Make the current page clickable.
33
+ * - Use breadcrumbs as the only navigation method.
34
+ * - Use breadcrumbs for sequential processes like multi-step forms or wizards. Use a stepper instead.
35
+ * - Add breadcrumbs when they don't provide meaningful context or navigation value.
15
36
  *
16
37
  * @example Basic
17
38
  * ```html
@@ -6,13 +6,13 @@ import "@nysds/nys-icon";
6
6
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
7
7
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
8
8
  *
9
- * Breadcrumbs Component v1.21.1
9
+ * Breadcrumbs Component v1.22.0
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.1
15
+ * New York State Design System v1.22.0
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
@@ -40,9 +40,9 @@ var I = Object.defineProperty, l = (d, e, s, t) => {
40
40
  (m = d[a]) && (r = m(e, s, r) || r);
41
41
  return r && I(e, s, r), r;
42
42
  };
43
- let y = null;
43
+ let h = null;
44
44
  function z() {
45
- y || typeof document > "u" || (y = new CSSStyleSheet(), y.replaceSync(P), document.adoptedStyleSheets = [...document.adoptedStyleSheets, y]);
45
+ h || typeof document > "u" || (h = new CSSStyleSheet(), h.replaceSync(P), document.adoptedStyleSheets = [...document.adoptedStyleSheets, h]);
46
46
  }
47
47
  const u = "data-nys-injected", _ = class _ extends T {
48
48
  /**
@@ -92,7 +92,12 @@ const u = "data-nys-injected", _ = class _ extends T {
92
92
  return t.setAttribute("name", e), t.setAttribute("size", s), t.setAttribute(u, "true"), t;
93
93
  }
94
94
  _resetItem(e) {
95
- e.className = "", e.removeAttribute("aria-current"), e.querySelectorAll(`[${u}]`).forEach((t) => t.remove());
95
+ e.classList.remove(
96
+ "nys-breadcrumbitem",
97
+ "back-to-parent",
98
+ "hide",
99
+ "intermediate"
100
+ ), e.removeAttribute("aria-current"), e.querySelectorAll(`[${u}]`).forEach((t) => t.remove());
96
101
  const s = this._getAnchor(e);
97
102
  s && (s.removeAttribute("aria-disabled"), s.removeAttribute("tabindex"));
98
103
  }
@@ -151,13 +156,13 @@ const u = "data-nys-injected", _ = class _ extends T {
151
156
  });
152
157
  return;
153
158
  }
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(
159
+ const r = !this._manuallyExpanded && t.length > this._collapseThreshold, a = this.collapsed || r, m = t[t.length - 1], g = this._isCurrentPage(m), y = Math.min(1, t.length - 1), v = Math.min(
155
160
  g ? 2 : 1,
156
- t.length - h
161
+ t.length - y
157
162
  );
158
163
  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);
164
+ const c = b < y, p = b >= t.length - v, f = c || p, x = a && !f;
165
+ this._applyCrumbStyle(n, this._isCurrentPage(n)), x && n.classList.add("hide"), f || n.classList.add("intermediate"), b === y - 1 && a && t.length > 2 && this._insertEllipsis(n);
161
166
  });
162
167
  }
163
168
  _moveFocusToFirstExpandCrumb() {
@@ -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.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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ement as u } from \"lit\";\n/*!\n * New York State Design System v1.22.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 */\nlet y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nfunction N(e, t, s) {\n e.dispatchEvent(\n new CustomEvent(t, { detail: s, bubbles: !0, composed: !0 })\n );\n}\nfunction I(e, t) {\n e.dispatchEvent(\n new Event(`nys-${t}`, { bubbles: !0, composed: !0 })\n );\n}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, g = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction _(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction E(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction A(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction w(e, t, s) {\n const n = d(s), i = E(t);\n n.length ? e.setAttribute(i, A(n).join(\" \")) : e.removeAttribute(i);\n}\nfunction x(e, t, s, n, i) {\n const r = d(n), a = p[s], l = t;\n if (a && _(t)) {\n l[a] = r.length ? r : null;\n return;\n }\n const o = g[s];\n if (!o) return;\n const c = i ?? (r.length ? r.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n s === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n s === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst R = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, V = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, s) {\n const n = d(s), i = R[t], r = V[t], a = e;\n if (i && i in e && (a[i] = n.length ? n : null), !r) return;\n const l = n.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(r, l) : e.removeAttribute(r);\n}\nconst h = (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__ */ h(u), b = (e) => {\n class t extends h(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(n, i) {\n const r = this.internals;\n if (r && n in r) {\n r[n] = i;\n return;\n }\n const a = v(n);\n i === null ? this.removeAttribute(a) : this.setAttribute(a, i);\n }\n reflectDefaultSemantics() {\n const n = this.defaultRole;\n n && this.setHostAria(\"role\", n);\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__ */ b(u), C = (e) => {\n const s = class s extends b(e) {\n constructor() {\n super(...arguments), this.__internalValidationMessage = \"\";\n }\n get internalValidationMessage() {\n return this.__internalValidationMessage;\n }\n set internalValidationMessage(i) {\n i !== this.__internalValidationMessage && (this.__internalValidationMessage = i, this.requestUpdate(\"internalValidationMessage\"));\n }\n resolvedErrorMessage() {\n return this.errorMessage || this.internalValidationMessage;\n }\n setFormValue(i) {\n this.internals?.setFormValue(i ?? null);\n }\n setValidityFromState(i, r, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(i).some(Boolean);\n o ? l.setValidity(i, r ?? \"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.internalValidationMessage = \"\", this.clearValidity();\n }\n };\n s.formAssociated = !0;\n let t = s;\n return t;\n}, O = /* @__PURE__ */ C(u);\nfunction B(e) {\n const t = e.tagName.toLowerCase(), s = /* @__PURE__ */ new Set(), n = (i) => {\n i.querySelectorAll(\"*\").forEach((r) => {\n const a = r.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && s.add(a), r.shadowRoot && n(r.shadowRoot);\n });\n };\n return e.shadowRoot && n(e.shadowRoot), n(e), [...s].sort();\n}\nexport {\n C as FormControlMixin,\n h as IdentifiedMixin,\n P as NysElement,\n O as NysFormControlElement,\n T as NysReflectsAriaElement,\n b as ReflectsAriaMixin,\n w as associateControl,\n L as associateControlRefs,\n x as associateHost,\n N as dispatchNysEvent,\n I as dispatchNysFocusBlur,\n B as findUnregisteredChildren,\n f as generateId,\n _ 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/** Detail payload for the `nys-expand` event fired by `nys-breadcrumbs`. */\nexport interface NysBreadcrumbsExpandDetail {\n id: string;\n}\n\n/** The `nys-expand` event fired by `nys-breadcrumbs`. */\nexport type NysBreadcrumbsExpandEvent = CustomEvent<NysBreadcrumbsExpandDetail>;\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 * @cssprop [--nys-max-width--content] - Overrides the inner content max width across the grid, header, footer, and breadcrumb. Set at a higher level like `:root` to apply to all instances. Takes priority over the size-specific variable.\n *\n * @fires {NysBreadcrumbsExpandEvent} nys-expand - Fired when the user clicks the ellipsis to expand the trail. Detail: `{id}`.\n *\n * @usagedos\n * - Use on pages at level 2 and deeper in a site hierarchy. If a level 2 page has child pages, all pages starting at that level should include a breadcrumb.\n * - Place breadcrumb below the header and above the main content.\n * - Show the site hierarchy, not the path a user took.\n * - For the home page of a site, use a specific label rather than a generic \"Home.\" This differentiates the main site home from other landing pages (e.g., \"myBenefits Home\" instead of just \"Home\").\n *\n * @usagedonts\n * - Use on top-level pages, or on sites with only one or two levels of hierarchy.\n * - Make the current page clickable.\n * - Use breadcrumbs as the only navigation method.\n * - Use breadcrumbs for sequential processes like multi-step forms or wizards. Use a stepper instead.\n * - Add breadcrumbs when they don't provide meaningful context or navigation value.\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.classList.remove(\n \"nys-breadcrumbitem\",\n \"back-to-parent\",\n \"hide\",\n \"intermediate\",\n );\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","h","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;AA+DK,MAACG,IAAI,CAACD,MAAM;AAAA,EACf,MAAME,UAAUF,EAAE;AAAA,IAChB,IAAI,WAAW;AACb,aAAO,KAAK,aAAa;AAAA,IAC3B;AAAA,IACA,WAAW;AACT,WAAK,OAAO,KAAK,KAAKD,EAAE,KAAK,QAAQ;AAAA,IACvC;AAAA,IACA,oBAAoB;AAClB,YAAM,kBAAiB,GAAI,KAAK,SAAQ;AAAA,IAC1C;AAAA,EACJ;AACE,SAAOG;AACT,GAAGC,IAAoB,gBAAAF,EAAEG,CAAC;;;;;;ACzE1B,IAAIC,IAAoC;AAExC,SAASC,IAAmB;AAC1B,EAAID,KAAe,OAAO,WAAa,QACvCA,IAAc,IAAI,cAAA,GAClBA,EAAY,YAAYE,CAAW,GACnC,SAAS,qBAAqB,CAAC,GAAG,SAAS,oBAAoBF,CAAW;AAC5E;AAEA,MAAMG,IAAgB,qBAyITC,IAAN,MAAMA,UAAuBC,EAAW;AAAA;AAAA;AAAA;AAAA;AAAA,EAwD7C,cAAc;AACZ,UAAA,GAnDyC,KAAA,KAAK,IA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7C,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;AAoTzC,eAAe,IAAI,iBAAiB,KACvC,eAAe,OAAO,mBAAmBA,CAAc;"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nysds/nys-breadcrumbs",
3
- "version": "1.21.1",
3
+ "version": "1.22.0",
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",
7
7
  "exports": {
8
8
  ".": {
9
- "import": "./dist/nys-breadcrumbs.js",
10
- "types": "./dist/index.d.ts"
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/nys-breadcrumbs.js"
11
11
  }
12
12
  },
13
13
  "type": "module",
@@ -23,10 +23,10 @@
23
23
  "lit-analyze": "lit-analyzer 'src/**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.21.1"
26
+ "@nysds/nys-icon": "^1.22.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@nysds/internals": "^1.21.1",
29
+ "@nysds/internals": "^1.22.0",
30
30
  "lit": "^3.3.1",
31
31
  "typescript": "^5.9.3",
32
32
  "vite": "^7.3.1"