@nysds/nys-globalheader 1.13.0 → 1.13.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.
@@ -1 +1 @@
1
- {"version":3,"file":"nys-globalheader.js","sources":["../src/nys-globalheader.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-globalheader.scss?inline\";\n\n/**\n * `<nys-globalheader>` renders a New York State–style global header.\n *\n * Displays an optional application name, agency name, and homepage link.\n * Supports slotted navigation content with automatic active-link detection\n * and a responsive mobile menu.\n *\n * @slot default - Primary navigation list, typically a `<ul>` with links\n * @slot user-actions - Optional user action elements such as login or profile\n *\n * Behavior:\n * - Automatically highlights the best matching link based on the current URL\n * - Duplicates navigation content for desktop and mobile layouts\n * - Provides a toggleable mobile menu when navigation content exists\n */\n\nexport class NysGlobalHeader extends LitElement {\n static styles = unsafeCSS(styles);\n\n @property({ type: String }) appName = \"\";\n @property({ type: String }) agencyName = \"\";\n @property({ type: String }) homepageLink = \"\";\n @state() private isMobileMenuOpen = false;\n @state() private hasLinkContent = false;\n\n /**\n * Lifecycle Methods\n * --------------------------------------------------------------------------\n */\n\n firstUpdated() {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>(\"slot\");\n slot?.addEventListener(\"slotchange\", () => this._handleListSlotChange());\n this._handleListSlotChange(); // run once at startup\n\n this._listenLinkClicks();\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n private _highlightActiveLink(container: HTMLElement) {\n const links = Array.from(container.querySelectorAll(\"a\"));\n const currentUrl = window.location.pathname.replace(/\\/+$/, \"\") || \"/\";\n\n let bestMatch: { li: HTMLElement | null; length: number } = {\n li: null,\n length: 0,\n };\n\n links.forEach((a) => {\n const linkPath = this._normalizePath(a.getAttribute(\"href\"));\n if (!linkPath) return;\n\n if (linkPath === \"/\" && currentUrl === \"/\") {\n bestMatch = { li: a.closest(\"li\"), length: 1 };\n } else if (\n currentUrl.startsWith(linkPath) &&\n linkPath.length > bestMatch.length\n ) {\n bestMatch = {\n li: a.closest(\"li\"),\n length: linkPath.length,\n };\n }\n });\n\n // Clear all previous actives\n links.forEach((a) => a.closest(\"li\")?.classList.remove(\"active\"));\n\n // Apply best match\n bestMatch.li?.classList.add(\"active\");\n }\n\n // Gets called when the slot content changes and directly appends the slotted elements into the shadow DOM\n private async _handleListSlotChange() {\n const slot = this.shadowRoot?.querySelector(\n 'slot:not([name=\"user-actions\"])',\n ) as HTMLSlotElement | null;\n\n if (!slot) return;\n\n const assignedNodes = slot\n .assignedNodes({ flatten: true })\n .filter((node) => node.nodeType === Node.ELEMENT_NODE) as Element[]; // Filter to elements only\n\n this.hasLinkContent = assignedNodes.length > 0;\n\n await Promise.resolve(); // Wait for current update cycle to complete before modifying reactive state (solves the lit issue \"scheduled an update\")\n\n // Get the containers to append the slotted elements\n const container = this.shadowRoot?.querySelector(\n \".nys-globalheader__content\",\n ) as HTMLElement | null;\n\n const containerMobile = this.shadowRoot?.querySelector(\n \".nys-globalheader__content-mobile\",\n ) as HTMLElement | null;\n\n if (!container || !containerMobile) return;\n\n // Clear existing children in the container\n container.innerHTML = \"\";\n containerMobile.innerHTML = \"\";\n\n // Clone and append slotted elements into the shadow DOM container\n assignedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n // need to clone the node because cannot have same node in two places in DOM\n const nodeInline = node.cloneNode(true) as HTMLElement;\n const nodeMobile = node.cloneNode(true) as HTMLElement;\n\n container.appendChild(nodeInline);\n containerMobile.appendChild(nodeMobile);\n }\n });\n\n // Highlight active links AFTER DOM is finalized\n this._highlightActiveLink(container);\n this._highlightActiveLink(containerMobile);\n }\n\n // Normalize paths so that links like \"name\", \"/name/\", and \"/\" match window.location.pathname.\n // This ensures consistent active-link behavior regardless of how hrefs are written.\n private _normalizePath(href: string | null): string | null {\n if (!href) return null;\n\n try {\n const url = new URL(href, window.location.origin);\n return url.pathname.replace(/\\/+$/, \"\") || \"/\";\n } catch {\n return null;\n }\n }\n\n private _toggleMobileMenu() {\n this.isMobileMenuOpen = !this.isMobileMenuOpen;\n }\n\n // Listens for click events on links to mark them active\n private _listenLinkClicks() {\n const containers = this.shadowRoot?.querySelectorAll(\n \".nys-globalheader__content, .nys-globalheader__content-mobile\",\n );\n\n containers?.forEach((container) => {\n container?.addEventListener(\"click\", (event) => {\n const target = event.target as HTMLElement;\n const ahref = target.closest(\"a\");\n\n if (!ahref) return;\n\n // Clear all existing active <li>\n container\n .querySelectorAll(\"li.active\")\n .forEach((li) => li.classList.remove(\"active\"));\n\n // Set active on the clicked link's <li>\n const li = ahref.closest(\"li\");\n if (li) li.classList.add(\"active\");\n });\n });\n }\n\n render() {\n return html`\n <header class=\"nys-globalheader\">\n <div class=\"nys-globalheader__main-container\">\n ${this.hasLinkContent\n ? html` <div class=\"nys-globalheader__button-container\">\n <button\n class=\"nys-globalheader__mobile-menu-button\"\n @click=\"${this._toggleMobileMenu}\"\n >\n <nys-icon\n name=\"${this.isMobileMenuOpen ? \"close\" : \"menu\"}\"\n size=\"32\"\n label=\"${this.isMobileMenuOpen ? \"close\" : \"menu\"} icon\"\n ></nys-icon>\n <span class=\"nys-globalheader__mobile-menu-button-text\"\n >${this.isMobileMenuOpen ? \"CLOSE\" : \"MENU\"}</span\n >\n </button>\n </div>`\n : \"\"}\n ${!this.homepageLink?.trim()\n ? html`\n <div class=\"nys-globalheader__name-container\">\n ${this.appName?.trim().length > 0\n ? html`<div\n class=\"nys-globalheader__appName nys-globalheader__name\"\n >\n ${this.appName}\n </div> `\n : \"\"}\n ${this.agencyName?.trim().length > 0\n ? html`<div\n class=\"nys-globalheader__agencyName nys-globalheader__name ${this.appName?.trim()\n .length > 0\n ? \"\"\n : \"main\"}\"\n >\n ${this.agencyName}\n </div> `\n : \"\"}\n </div>\n `\n : html`<a\n class=\"nys-globalheader__name-container-link\"\n href=${this.homepageLink?.trim()}\n >\n <div class=\"nys-globalheader__name-container\">\n ${this.appName?.trim().length > 0\n ? html`<div\n class=\"nys-globalheader__appName nys-globalheader__name\"\n >\n ${this.appName}\n </div> `\n : \"\"}\n ${this.agencyName?.trim().length > 0\n ? html`<div\n class=\"nys-globalheader__agencyName nys-globalheader__name ${this.appName?.trim()\n .length > 0\n ? \"\"\n : \"main\"}\"\n >\n ${this.agencyName}\n </div> `\n : \"\"}\n </div>\n </a>`}\n <div class=\"nys-globalheader__content\"></div>\n <slot\n style=\"display: none;\"\n @slotchange=\"${this._handleListSlotChange}\"\n ></slot>\n <slot name=\"user-actions\"></slot>\n </div>\n </header>\n <div\n class=\"nys-globalheader__content-mobile ${this.isMobileMenuOpen\n ? \"\"\n : \"close\"}\"\n ></div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-globalheader\")) {\n customElements.define(\"nys-globalheader\", NysGlobalHeader);\n}\n"],"names":["_NysGlobalHeader","LitElement","container","links","currentUrl","bestMatch","a","linkPath","slot","assignedNodes","node","containerMobile","nodeInline","nodeMobile","href","event","ahref","li","html","unsafeCSS","styles","NysGlobalHeader","__decorateClass","property","state"],"mappings":";;;;;;;;AAqBO,MAAMA,IAAN,MAAMA,UAAwBC,EAAW;AAAA,EAAzC,cAAA;AAAA,UAAA,GAAA,SAAA,GAGuB,KAAA,UAAU,IACV,KAAA,aAAa,IACb,KAAA,eAAe,IAClC,KAAQ,mBAAmB,IAC3B,KAAQ,iBAAiB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlC,eAAe;AAEb,IADa,KAAK,YAAY,cAA+B,MAAM,GAC7D,iBAAiB,cAAc,MAAM,KAAK,uBAAuB,GACvE,KAAK,sBAAA,GAEL,KAAK,kBAAA;AAAA,EACP;AAAA;AAAA;AAAA;AAAA;AAAA,EAOQ,qBAAqBC,GAAwB;AACnD,UAAMC,IAAQ,MAAM,KAAKD,EAAU,iBAAiB,GAAG,CAAC,GAClDE,IAAa,OAAO,SAAS,SAAS,Q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,eAAe,OAAO,oBAAoBA,CAAe;"}
1
+ {"version":3,"file":"nys-globalheader.js","sources":["../src/nys-globalheader.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-globalheader.scss?inline\";\n\n/**\n * Agency-branded header with app/agency name, navigation, and responsive mobile menu.\n *\n * Place below `nys-unavheader`. Slot navigation links as `<ul><li><a>` elements; active links\n * are auto-highlighted based on current URL. Mobile menu toggles automatically on narrow screens.\n *\n * @summary Agency header with navigation, mobile menu, and active link highlighting.\n * @element nys-globalheader\n *\n * @slot - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.\n *\n * @example Basic header\n * ```html\n * <nys-globalheader appName=\"My App\" agencyName=\"Department of Health\" homepageLink=\"/\">\n * <ul><li><a href=\"/about\">About</a></li><li><a href=\"/contact\">Contact</a></li></ul>\n * </nys-globalheader>\n * ```\n */\n\nexport class NysGlobalHeader extends LitElement {\n static styles = unsafeCSS(styles);\n\n /** Application name displayed prominently. */\n @property({ type: String }) appName = \"\";\n\n /** Agency name displayed below app name (or as main title if no appName). */\n @property({ type: String }) agencyName = \"\";\n\n /** URL for the header title link. If empty, title is not clickable. */\n @property({ type: String }) homepageLink = \"\";\n @state() private isMobileMenuOpen = false;\n @state() private hasLinkContent = false;\n\n /**\n * Lifecycle Methods\n * --------------------------------------------------------------------------\n */\n\n firstUpdated() {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>(\"slot\");\n slot?.addEventListener(\"slotchange\", () => this._handleListSlotChange());\n this._handleListSlotChange(); // run once at startup\n\n this._listenLinkClicks();\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n private _highlightActiveLink(container: HTMLElement) {\n const links = Array.from(container.querySelectorAll(\"a\"));\n const currentUrl = window.location.pathname.replace(/\\/+$/, \"\") || \"/\";\n\n let bestMatch: { li: HTMLElement | null; length: number } = {\n li: null,\n length: 0,\n };\n\n links.forEach((a) => {\n const linkPath = this._normalizePath(a.getAttribute(\"href\"));\n if (!linkPath) return;\n\n if (linkPath === \"/\" && currentUrl === \"/\") {\n bestMatch = { li: a.closest(\"li\"), length: 1 };\n } else if (\n currentUrl.startsWith(linkPath) &&\n linkPath.length > bestMatch.length\n ) {\n bestMatch = {\n li: a.closest(\"li\"),\n length: linkPath.length,\n };\n }\n });\n\n // Clear all previous actives\n links.forEach((a) => a.closest(\"li\")?.classList.remove(\"active\"));\n\n // Apply best match\n bestMatch.li?.classList.add(\"active\");\n }\n\n // Gets called when the slot content changes and directly appends the slotted elements into the shadow DOM\n private async _handleListSlotChange() {\n const slot = this.shadowRoot?.querySelector(\n 'slot:not([name=\"user-actions\"])',\n ) as HTMLSlotElement | null;\n\n if (!slot) return;\n\n const assignedNodes = slot\n .assignedNodes({ flatten: true })\n .filter((node) => node.nodeType === Node.ELEMENT_NODE) as Element[]; // Filter to elements only\n\n this.hasLinkContent = assignedNodes.length > 0;\n\n await Promise.resolve(); // Wait for current update cycle to complete before modifying reactive state (solves the lit issue \"scheduled an update\")\n\n // Get the containers to append the slotted elements\n const container = this.shadowRoot?.querySelector(\n \".nys-globalheader__content\",\n ) as HTMLElement | null;\n\n const containerMobile = this.shadowRoot?.querySelector(\n \".nys-globalheader__content-mobile\",\n ) as HTMLElement | null;\n\n if (!container || !containerMobile) return;\n\n // Clear existing children in the container\n container.innerHTML = \"\";\n containerMobile.innerHTML = \"\";\n\n // Clone and append slotted elements into the shadow DOM container\n assignedNodes.forEach((node) => {\n if (node instanceof HTMLElement) {\n // need to clone the node because cannot have same node in two places in DOM\n const nodeInline = node.cloneNode(true) as HTMLElement;\n const nodeMobile = node.cloneNode(true) as HTMLElement;\n\n container.appendChild(nodeInline);\n containerMobile.appendChild(nodeMobile);\n }\n });\n\n // Highlight active links AFTER DOM is finalized\n this._highlightActiveLink(container);\n this._highlightActiveLink(containerMobile);\n }\n\n // Normalize paths so that links like \"name\", \"/name/\", and \"/\" match window.location.pathname.\n // This ensures consistent active-link behavior regardless of how hrefs are written.\n private _normalizePath(href: string | null): string | null {\n if (!href) return null;\n\n try {\n const url = new URL(href, window.location.origin);\n return url.pathname.replace(/\\/+$/, \"\") || \"/\";\n } catch {\n return null;\n }\n }\n\n private _toggleMobileMenu() {\n this.isMobileMenuOpen = !this.isMobileMenuOpen;\n }\n\n // Listens for click events on links to mark them active\n private _listenLinkClicks() {\n const containers = this.shadowRoot?.querySelectorAll(\n \".nys-globalheader__content, .nys-globalheader__content-mobile\",\n );\n\n containers?.forEach((container) => {\n container?.addEventListener(\"click\", (event) => {\n const target = event.target as HTMLElement;\n const ahref = target.closest(\"a\");\n\n if (!ahref) return;\n\n // Clear all existing active <li>\n container\n .querySelectorAll(\"li.active\")\n .forEach((li) => li.classList.remove(\"active\"));\n\n // Set active on the clicked link's <li>\n const li = ahref.closest(\"li\");\n if (li) li.classList.add(\"active\");\n });\n });\n }\n\n render() {\n return html`\n <header class=\"nys-globalheader\">\n <div class=\"nys-globalheader__main-container\">\n ${this.hasLinkContent\n ? html` <div class=\"nys-globalheader__button-container\">\n <button\n class=\"nys-globalheader__mobile-menu-button\"\n @click=\"${this._toggleMobileMenu}\"\n >\n <nys-icon\n name=\"${this.isMobileMenuOpen ? \"close\" : \"menu\"}\"\n size=\"32\"\n label=\"${this.isMobileMenuOpen ? \"close\" : \"menu\"} icon\"\n ></nys-icon>\n <span class=\"nys-globalheader__mobile-menu-button-text\"\n >${this.isMobileMenuOpen ? \"CLOSE\" : \"MENU\"}</span\n >\n </button>\n </div>`\n : \"\"}\n ${!this.homepageLink?.trim()\n ? html`\n <div class=\"nys-globalheader__name-container\">\n ${this.appName?.trim().length > 0\n ? html`<div\n class=\"nys-globalheader__appName nys-globalheader__name\"\n >\n ${this.appName}\n </div> `\n : \"\"}\n ${this.agencyName?.trim().length > 0\n ? html`<div\n class=\"nys-globalheader__agencyName nys-globalheader__name ${this.appName?.trim()\n .length > 0\n ? \"\"\n : \"main\"}\"\n >\n ${this.agencyName}\n </div> `\n : \"\"}\n </div>\n `\n : html`<a\n class=\"nys-globalheader__name-container-link\"\n href=${this.homepageLink?.trim()}\n >\n <div class=\"nys-globalheader__name-container\">\n ${this.appName?.trim().length > 0\n ? html`<div\n class=\"nys-globalheader__appName nys-globalheader__name\"\n >\n ${this.appName}\n </div> `\n : \"\"}\n ${this.agencyName?.trim().length > 0\n ? html`<div\n class=\"nys-globalheader__agencyName nys-globalheader__name ${this.appName?.trim()\n .length > 0\n ? \"\"\n : \"main\"}\"\n >\n ${this.agencyName}\n </div> `\n : \"\"}\n </div>\n </a>`}\n <div class=\"nys-globalheader__content\"></div>\n <slot\n style=\"display: none;\"\n @slotchange=\"${this._handleListSlotChange}\"\n ></slot>\n <slot name=\"user-actions\"></slot>\n </div>\n </header>\n <div\n class=\"nys-globalheader__content-mobile ${this.isMobileMenuOpen\n ? \"\"\n : \"close\"}\"\n ></div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-globalheader\")) {\n customElements.define(\"nys-globalheader\", NysGlobalHeader);\n}\n"],"names":["_NysGlobalHeader","LitElement","container","links","currentUrl","bestMatch","a","linkPath","slot","assignedNodes","node","containerMobile","nodeInline","nodeMobile","href","event","ahref","li","html","unsafeCSS","styles","NysGlobalHeader","__decorateClass","property","state"],"mappings":";;;;;;;;AAwBO,MAAMA,IAAN,MAAMA,UAAwBC,EAAW;AAAA,EAAzC,cAAA;AAAA,UAAA,GAAA,SAAA,GAIuB,KAAA,UAAU,IAGV,KAAA,aAAa,IAGb,KAAA,eAAe,IAClC,KAAQ,mBAAmB,IAC3B,KAAQ,iBAAiB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlC,eAAe;AAEb,IADa,KAAK,YAAY,cAA+B,MAAM,GAC7D,iBAAiB,cAAc,MAAM,KAAK,uBAAuB,GACvE,KAAK,sBAAA,GAEL,KAAK,kBAAA;AAAA,EACP;AAAA;AAAA;AAAA;AAAA;AAAA,EAOQ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AWM,WAAA,kBAAA;AACAC,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAZIH,EAYM,WAAA,gBAAA;AAmOd,eAAe,IAAI,kBAAkB,KACxC,eAAe,OAAO,oBAAoBA,CAAe;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-globalheader",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "The Globalheader component from the NYS Design System.",
5
5
  "module": "dist/nys-globalheader.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.13.0"
26
+ "@nysds/nys-icon": "^1.13.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "lit": "^3.3.1",