@illinois-toolkit/ilw-header-megamenu 1.0.2 → 1.1.6

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
- ilw-header-megamenu[compact]{--ilw-header-megamenu--background: #e8e9eb;--ilw-header-megamenu--flex-direction: column;--ilw-header-megamenu--items--position: relative;--ilw-header-megamenu--items--border: none;--ilw-header-megamenu--items--box-shadow: none;--ilw-header-megamenu--items--width: 100%;--ilw-header-megamenu--font: 600 18px / 28px var(--il-font-sans);--ilw-header-megamenu--grid-template-columns: auto 52px;--ilw-header-megamenu--link-border-left-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-left-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-left-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-color--focus: var(--il-blue);--ilw-header-megamenu--link-border-bottom-highlight: none;--ilw-header-megamenu--link-border-bottom-highlight--hover: none;--ilw-header-megamenu--link-border-bottom-highlight--focus: none;--ilw-header-megamenu--items--position: initial;--ilw-header-megamenu-section--grid-template-columns--header: auto 22px;--ilw-header-megamenu--grid-template-columns: auto 51px}ilw-header-megamenu{all:initial;display:block;background:var(--ilw-header-megamenu--background)}ilw-header-megamenu>ul{all:initial;display:flex;flex-direction:var(--ilw-header-megamenu--flex-direction)}ilw-header-megamenu>ul>li{all:initial;display:block;background:var(--ilw-header-megamenu--background)}ilw-header-megamenu>ul>li>a{all:initial;box-sizing:border-box;height:100%;display:flex;align-items:center;position:relative;padding:6px 20px;font:var(--ilw-header-megamenu--font);background:var(--ilw-header-megamenu--link-background);color:var(--ilw-header-megamenu--link-color);outline:0;cursor:pointer;border-width:0 0 3px 0;border-style:solid;border-color:transparent;border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight);border-left:var(--ilw-header-megamenu--link-border-left-highlight)}ilw-header-megamenu>ul>li>a[aria-current=true],ilw-header-megamenu>ul>li>a[aria-current=page]{border-color:var(--il-blue)}ilw-header-megamenu>ul>li>a:hover{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover);border-left:var(--ilw-header-megamenu--link-border-left-highlight--hover);color:var(--ilw-header-megamenu--link-color--hover);text-decoration:underline}ilw-header-megamenu>ul>li>a:focus{background:var(--ilw-header-megamenu--link-background--focus);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu[compact]>ul>li>a{border-bottom:1px solid var(--il-storm-lighter-3)}ilw-header-megamenu-section img{display:none}ilw-header-megamenu-section span[slot=action-right],ilw-header-megamenu-section span[slot=action-left]{position:relative}ilw-header-megamenu-section span[slot=action-right] img,ilw-header-megamenu-section span[slot=action-left] img{display:inline;margin:36px;object-fit:cover;border-radius:30px;width:calc(100% - 72px);height:auto}ilw-header-megamenu-section span[slot=action-right]:has(p+button) img,ilw-header-megamenu-section span[slot=action-left]:has(p+button) img{display:block;position:absolute;top:0;left:0;margin:36px;height:calc(100% - 72px);width:calc(100% - 72px);object-fit:cover}ilw-header-megamenu-section span[slot=action-right] p:first-of-type,ilw-header-megamenu-section span[slot=action-left] p:first-of-type{display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;font-size:21px;font-weight:700;color:var(--il-blue);font-family:Source Sans,sans-serif;margin-top:-30px;width:50%;z-index:1}ilw-header-megamenu-section span[slot=action-right] button:first-of-type,ilw-header-megamenu-section span[slot=action-left] button:first-of-type{display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1;margin-top:30px}ilw-header-megamenu-section ul{list-style:none;margin:30px 0;padding-left:0;border-right:solid 2px var(--il-storm-85, #d5d3d3)}ilw-header-megamenu-section ul li{list-style:none;padding-left:30px}ilw-header-megamenu-section ul li span{display:inline-block;text-indent:var(--ilw-header-megamenu-section--anchor--text-indent)}ilw-header-megamenu-section ul li ul{display:inherit;margin:0;border:none}ilw-header-megamenu-section ul li ul a{font-weight:400}ilw-header-megamenu-section ul li ul:nth-of-type(4n){border-right:none!important}ilw-header-megamenu-section ul li a{--ilw-header-megamenu--link-border-left-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-left-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-left-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-color--focus: var(--il-blue);--ilw-header-megamenu--link-border-bottom-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-bottom-highlight--focus: initial;--ilw-header-megamenu--link-border-bottom-highlight--hover: 4px solid transparent;all:initial;box-sizing:border-box;text-indent:var(--ilw-header-megamenu-section--anchor--text-indent);display:block;position:relative;padding:var(--ilw-header-megamenu-section--anchor--padding);font:var(--ilw-header-megamenu--font);font-weight:700;background:transparent;color:var(--ilw-header-megamenu--link-color);outline:0;cursor:pointer;border-top:var(--ilw-header-megamenu-section--anchor--border);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight)}ilw-header-megamenu-section ul li a:hover{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover);color:var(--ilw-header-megamenu--link-color--hover);text-decoration:underline}ilw-header-megamenu-section ul li a:focus{background:var(--ilw-header-megamenu--link-background--sub--focus);border-bottom:var(--ilw-header-megamenu--link-border-left-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu-section li>img{display:none}ilw-header-megamenu-section .no-border{border:none}ilw-header-megamenu-section ilw-header-megamenu-section{--ilw-header-megamenu--items--top: 0;--ilw-header-megamenu--items--left: 250px;--ilw-header-megamenu--link-border-left-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-left-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-left-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-border-bottom-highlight: initial;--ilw-header-megamenu--link-border-bottom-highlight--hover: initial;--ilw-header-megamenu--link-border-bottom-highlight--focus: initial;--ilw-header-megamenu--grid-template-columns: auto 55px;--ilw-header-megamenu-section--transform: rotate(270deg);--ilw-header-megamenu-section--transform--selected: rotate(90deg)}ilw-header-megamenu[compact] ilw-header-megamenu-section{display:block;border-bottom:1px solid var(--il-storm-lighter-3)}ilw-header-megamenu[compact] ilw-header-megamenu-section a:focus{background:var(--ilw-header-megamenu--link-background--sub--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu[compact] ilw-header-megamenu-section span[slot=action-left],ilw-header-megamenu[compact] ilw-header-megamenu-section span[slot=action-right]{display:block;min-height:250px}ilw-header-megamenu[compact] ilw-header-megamenu-section div{display:block}ilw-header-megamenu[compact] ilw-header-megamenu-section ul{display:inherit;padding:0;margin:0}ilw-header-megamenu[compact] ilw-header-megamenu-section ul li{--ilw-header-megamenu-section--anchor--text-indent: 20px;border-top:1px solid var(--il-storm-lighter-3);background:var(--il-storm-lighter-4);padding-left:0}ilw-header-megamenu[compact] ilw-header-megamenu-section ul li a{border-left:var(--ilw-header-megamenu--link-border-left-highlight);border-bottom:none}ilw-header-megamenu[compact] ilw-header-megamenu-section ul li a:focus{background:var(--ilw-header-megamenu--link-background--sub--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus);border-bottom:none;color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu[compact] ilw-header-megamenu-section ul li ul li a{padding-left:45px}ilw-header-megamenu[compact] ilw-header-megamenu-section ilw-header-megamenu-section{border-bottom:none;--ilw-header-megamenu-section--transform: none;--ilw-header-megamenu-section--transform--selected: rotate(180deg);--ilw-header-megamenu--grid-template-columns: auto 51px}ilw-header-megamenu[compact] ilw-header-megamenu-section ilw-header-megamenu-section ul a,ilw-header-megamenu[compact] ilw-header-megamenu-section ilw-header-megamenu-section ul button{--ilw-header-megamenu-section--anchor--text-indent: 40px}
1
+ ilw-header-megamenu[compact]{--ilw-header-megamenu--background: #e8e9eb;--ilw-header-megamenu--flex-direction: column;--ilw-header-megamenu--items--position: relative;--ilw-header-megamenu--items--border: none;--ilw-header-megamenu--items--box-shadow: none;--ilw-header-megamenu--items--width: 100%;--ilw-header-megamenu--font: 600 18px / 28px var(--il-font-sans);--ilw-header-megamenu--grid-template-columns: auto 52px;--ilw-header-megamenu--link-border-left-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-left-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-left-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-color--focus: var(--il-blue);--ilw-header-megamenu--link-border-bottom-highlight: none;--ilw-header-megamenu--link-border-bottom-highlight--hover: none;--ilw-header-megamenu--link-border-bottom-highlight--focus: none;--ilw-header-megamenu--items--position: initial;--ilw-header-megamenu-section--grid-template-columns--header: auto 22px;--ilw-header-megamenu--grid-template-columns: auto 51px}ilw-header-megamenu{all:initial;display:block;background:var(--ilw-header-megamenu--background)}ilw-header-megamenu>ul{all:initial;display:flex;flex-direction:var(--ilw-header-megamenu--flex-direction)}ilw-header-megamenu>ul>li{all:initial;display:block;background:var(--ilw-header-megamenu--background)}ilw-header-megamenu>ul>li>a{all:initial;box-sizing:border-box;height:100%;display:flex;align-items:center;position:relative;padding:6px 20px;font:var(--ilw-header-megamenu--font);background:var(--ilw-header-megamenu--link-background);color:var(--ilw-header-megamenu--link-color);outline:0;cursor:pointer;border-width:0 0 3px 0;border-style:solid;border-color:transparent;border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight);border-left:var(--ilw-header-megamenu--link-border-left-highlight)}ilw-header-megamenu>ul>li>a[aria-current=true],ilw-header-megamenu>ul>li>a[aria-current=page]{border-color:var(--il-blue)}ilw-header-megamenu>ul>li>a:hover{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover);border-left:var(--ilw-header-megamenu--link-border-left-highlight--hover);color:var(--ilw-header-megamenu--link-color--hover);text-decoration:underline}ilw-header-megamenu>ul>li>a:focus{background:var(--ilw-header-megamenu--link-background--focus);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu[compact]>ul>li>a{border-bottom:1px solid var(--il-storm-lighter-3)}ilw-header-megamenu-section[linked] a[slot=link]{all:initial;box-sizing:border-box;height:100%;display:flex;align-items:center;text-indent:var(--ilw-header-megamenu-section--anchor--text-indent);position:relative;font:var(--ilw-header-megamenu--font);background:var(--ilw-header-megamenu--link-background);color:var(--ilw-header-megamenu--link-color);outline:0;cursor:pointer;padding:9px 2px 6px 20px;border-width:0 0 3px 0;border-style:solid;border-color:transparent;border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight);border-left:var(--ilw-header-megamenu--link-border-left-highlight)}ilw-header-megamenu-section[linked] a[slot=link]:hover{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover);color:var(--ilw-header-megamenu--link-color--hover);text-decoration:underline}ilw-header-megamenu-section[linked] a[slot=link]:focus{background:var(--ilw-header-megamenu--link-background--focus);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu-section[linked][aria-current=page] a[slot=link]{border-color:var(--il-blue)}ilw-header-megamenu-section[linked][aria-current=page] a[slot=link]:hover{border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover)}ilw-header-megamenu-section[linked][aria-current=page] a[slot=link]:focus{border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu-section img{display:none}ilw-header-megamenu-section span[slot=action-right],ilw-header-megamenu-section span[slot=action-left]{position:relative}ilw-header-megamenu-section span[slot=action-right] img,ilw-header-megamenu-section span[slot=action-left] img{display:inline;margin:36px;object-fit:cover;border-radius:30px;width:calc(100% - 72px);height:auto}ilw-header-megamenu-section span[slot=action-right]:has(p+button) img,ilw-header-megamenu-section span[slot=action-left]:has(p+button) img{display:block;position:absolute;top:0;left:0;margin:36px;height:calc(100% - 72px);width:calc(100% - 72px);object-fit:cover}ilw-header-megamenu-section span[slot=action-right] p:first-of-type,ilw-header-megamenu-section span[slot=action-left] p:first-of-type{display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;font-size:21px;font-weight:700;color:var(--il-blue);font-family:Source Sans,sans-serif;margin-top:-30px;width:50%;z-index:1}ilw-header-megamenu-section span[slot=action-right] button:first-of-type,ilw-header-megamenu-section span[slot=action-left] button:first-of-type{display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1;margin-top:30px}ilw-header-megamenu-section ul{list-style:none;margin:30px 0;padding-left:0;border-right:solid 2px var(--il-storm-85, #d5d3d3)}ilw-header-megamenu-section ul li{list-style:none;padding:0 30px}ilw-header-megamenu-section ul li span{display:inline-block;text-indent:var(--ilw-header-megamenu-section--anchor--text-indent)}ilw-header-megamenu-section ul li ul{display:inherit;margin:0;border:none}ilw-header-megamenu-section ul li ul a{font-weight:400}ilw-header-megamenu-section ul li ul:nth-of-type(4n){border-right:none!important}ilw-header-megamenu-section ul li a{--ilw-header-megamenu--link-border-left-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-left-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-left-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-color--focus: var(--il-blue);--ilw-header-megamenu--link-border-bottom-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-bottom-highlight--focus: initial;--ilw-header-megamenu--link-border-bottom-highlight--hover: 4px solid transparent;all:initial;box-sizing:border-box;text-indent:var(--ilw-header-megamenu-section--anchor--text-indent);display:block;position:relative;padding:var(--ilw-header-megamenu-section--anchor--padding);font:var(--ilw-header-megamenu--font);font-weight:700;background:transparent;color:var(--ilw-header-megamenu--link-color);outline:0;cursor:pointer;border-top:var(--ilw-header-megamenu-section--anchor--border);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight)}ilw-header-megamenu-section ul li a:hover{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover);color:var(--ilw-header-megamenu--link-color--hover);text-decoration:underline}ilw-header-megamenu-section ul li a:focus{background:var(--ilw-header-megamenu--link-background--sub--focus);border-bottom:var(--ilw-header-megamenu--link-border-left-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu-section li>img{display:none}ilw-header-megamenu-section .no-border{border:none}ilw-header-megamenu-section ilw-header-megamenu-section{--ilw-header-megamenu--items--top: 0;--ilw-header-megamenu--items--left: 250px;--ilw-header-megamenu--link-border-left-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-left-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-left-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-border-bottom-highlight: initial;--ilw-header-megamenu--link-border-bottom-highlight--hover: initial;--ilw-header-megamenu--link-border-bottom-highlight--focus: initial;--ilw-header-megamenu--grid-template-columns: auto 55px;--ilw-header-megamenu-section--transform: rotate(270deg);--ilw-header-megamenu-section--transform--selected: rotate(90deg)}ilw-header-megamenu[compact] ilw-header-megamenu-section{display:block;border-bottom:1px solid var(--il-storm-lighter-3)}ilw-header-megamenu[compact] ilw-header-megamenu-section a:focus{background:var(--ilw-header-megamenu--link-background--sub--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu[compact] ilw-header-megamenu-section span[slot=action-left],ilw-header-megamenu[compact] ilw-header-megamenu-section span[slot=action-right]{display:block;min-height:250px}ilw-header-megamenu[compact] ilw-header-megamenu-section div{display:block}ilw-header-megamenu[compact] ilw-header-megamenu-section ul{display:inherit;padding:0;margin:0}ilw-header-megamenu[compact] ilw-header-megamenu-section ul li{--ilw-header-megamenu-section--anchor--text-indent: 20px;border-top:1px solid var(--il-storm-lighter-3);background:var(--il-storm-lighter-4);padding-left:0}ilw-header-megamenu[compact] ilw-header-megamenu-section ul li a{border-left:var(--ilw-header-megamenu--link-border-left-highlight);border-bottom:none}ilw-header-megamenu[compact] ilw-header-megamenu-section ul li a:focus{background:var(--ilw-header-megamenu--link-background--sub--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus);border-bottom:none;color:var(--ilw-header-megamenu--link-color--focus)}ilw-header-megamenu[compact] ilw-header-megamenu-section ul li ul li a{padding-left:45px}ilw-header-megamenu[compact] ilw-header-megamenu-section ilw-header-megamenu-section{border-bottom:none;--ilw-header-megamenu-section--transform: none;--ilw-header-megamenu-section--transform--selected: rotate(180deg);--ilw-header-megamenu--grid-template-columns: auto 51px}ilw-header-megamenu[compact] ilw-header-megamenu-section ilw-header-megamenu-section ul a,ilw-header-megamenu[compact] ilw-header-megamenu-section ilw-header-megamenu-section ul button{--ilw-header-megamenu-section--anchor--text-indent: 40px}
@@ -1,17 +1,17 @@
1
- import { LitElement as w, unsafeCSS as v, html as c } from "lit";
1
+ import { LitElement as v, unsafeCSS as k, html as a } from "lit";
2
2
  import { property as d, customElement as x } from "lit/decorators.js";
3
- const k = "@layer base{:host{--ilw-header-megamenu--link-color: var(--il-blue);--ilw-header-megamenu--link-color--hover: var(--il-altgeld);--ilw-header-megamenu--link-background: transparent;--ilw-header-megamenu--link-background--hover: white;--ilw-header-megamenu--link-background--focus: var(--ilw-color--focus--background);--ilw-header-megamenu--link-background--sub--focus: var(--ilw-color--focus--background);--ilw-header-megamenu--link-color--focus: var(--il-blue);--ilw-header-megamenu--link-border-bottom-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-bottom-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-bottom-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-border-left-highlight: none;--ilw-header-megamenu--link-border-left-highlight--focus: none;--ilw-header-megamenu--background: #E8E9EB;--ilw-header-megamenu--flex-direction: row;--ilw-header-megamenu--items--position: absolute;--ilw-header-megamenu--items--border: 1px solid rgb(0, 0, 0, .01);--ilw-header-megamenu--items--box-shadow: 0 0 4px #00000040;--ilw-header-megamenu--items--width: 1270px;--ilw-header-megamenu--items--top: initial;--ilw-header-megamenu--items--left: calc(var(--ilw-margin--side) - 39px);--ilw-header-megamenu--font: 700 16px/22px var(--il-font-sans);--ilw-header-megamenu--grid-template-columns: auto auto;--ilw-header-megamenu-section--grid-template-columns--header: auto 24px;--ilw-header-megamenu-section--anchor--padding: 6px 20px;--ilw-header-megamenu-section--anchor--border: none;--ilw-header-megamenu-section--anchor--text-indent: 0;--ilw-header-megamenu-section--transform: none;--ilw-header-megamenu-section--transform--selected: rotate(180deg)}}div.parent.full{padding-top:6px;margin:0 calc(var(--ilw-margin--side) - 9px)}";
4
- var y = Object.defineProperty, E = Object.getOwnPropertyDescriptor, p = (e, i, o, n) => {
5
- for (var t = n > 1 ? void 0 : n ? E(i, o) : i, l = e.length - 1, r; l >= 0; l--)
6
- (r = e[l]) && (t = (n ? r(i, o, t) : r(t)) || t);
7
- return n && t && y(i, o, t), t;
3
+ const E = "@layer base{:host{--ilw-header-megamenu--link-color: var(--il-blue);--ilw-header-megamenu--link-color--hover: var(--il-altgeld);--ilw-header-megamenu--link-background: transparent;--ilw-header-megamenu--link-background--hover: white;--ilw-header-megamenu--link-background--focus: var(--ilw-color--focus--background);--ilw-header-megamenu--link-background--sub--focus: var(--ilw-color--focus--background);--ilw-header-megamenu--link-color--focus: var(--il-blue);--ilw-header-megamenu--link-border-bottom-highlight: 4px solid transparent;--ilw-header-megamenu--link-border-bottom-highlight--hover: 4px solid var(--il-orange);--ilw-header-megamenu--link-border-bottom-highlight--focus: 4px solid var(--il-blue);--ilw-header-megamenu--link-border-left-highlight: none;--ilw-header-megamenu--link-border-left-highlight--focus: none;--ilw-header-megamenu--background: #E8E9EB;--ilw-header-megamenu--flex-direction: row;--ilw-header-megamenu--items--position: absolute;--ilw-header-megamenu--items--border: 1px solid rgb(0, 0, 0, .01);--ilw-header-megamenu--items--box-shadow: 0 0 4px #00000040;--ilw-header-megamenu--items--width: 1220px;--ilw-header-megamenu--items--top: initial;--ilw-header-megamenu--items--left: calc(var(--ilw-margin--side) - 39px);--ilw-header-megamenu--font: 700 16px/22px var(--il-font-sans);--ilw-header-megamenu--grid-template-columns: auto auto;--ilw-header-megamenu-section--grid-template-columns--header: auto 24px;--ilw-header-megamenu-section--anchor--padding: 6px 20px;--ilw-header-megamenu-section--anchor--border: none;--ilw-header-megamenu-section--anchor--text-indent: 0;--ilw-header-megamenu-section--transform: none;--ilw-header-megamenu-section--transform--selected: rotate(180deg)}}div.parent.full{padding-top:6px;margin:0 calc(var(--ilw-margin--side) - 9px)}";
4
+ var S = Object.defineProperty, A = Object.getOwnPropertyDescriptor, b = (e, t, i, o) => {
5
+ for (var n = o > 1 ? void 0 : o ? A(t, i) : t, l = e.length - 1, r; l >= 0; l--)
6
+ (r = e[l]) && (n = (o ? r(t, i, n) : r(n)) || n);
7
+ return o && n && S(t, i, n), n;
8
8
  };
9
- let m = class extends w {
9
+ let g = class extends v {
10
10
  constructor() {
11
11
  super(), this.compact = !1, this.width = 990, this.addEventListener("keydown", this.handleWindowKeydown.bind(this)), this.handleWindowResize = this.handleWindowResize.bind(this), this.handleWindowClick = this.handleWindowClick.bind(this);
12
12
  }
13
13
  static get styles() {
14
- return v(k);
14
+ return k(E);
15
15
  }
16
16
  connectedCallback() {
17
17
  super.connectedCallback(), window.addEventListener("click", this.handleWindowClick.bind(this)), window.addEventListener("resize", this.handleWindowResize), this.handleWindowResize();
@@ -23,38 +23,40 @@ let m = class extends w {
23
23
  this.contains(e.target) || this.closeAllExceptOneSections(null);
24
24
  }
25
25
  handleWindowKeydown(e) {
26
- e.key === "Escape" && this.closeAllExceptOneSections(null), e.key === "ArrowRight" && (e.preventDefault(), this.closeAllExceptOneSections(null), this.gotoNextSection()), e.key === "ArrowLeft" && (e.preventDefault(), this.closeAllExceptOneSections(null), this.gotoPreviousSection());
26
+ if (e.key === "Escape" && this.closeAllExceptOneSections(null), e.key === "ArrowRight" && (e.preventDefault(), this.closeAllExceptOneSections(null), this.gotoNextSection()), e.key === "ArrowLeft" && (e.preventDefault(), this.closeAllExceptOneSections(null), this.gotoPreviousSection()), e.key !== "Tab" || e.shiftKey) return;
27
+ const t = document.activeElement;
28
+ if (!t) return;
29
+ const i = t.closest(
30
+ "ilw-header-megamenu-section"
31
+ );
32
+ if (!i || !i.expanded) return;
33
+ const o = i.querySelectorAll(
34
+ 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])'
35
+ ), n = o[o.length - 1];
36
+ t === n && (i.expanded = !1);
27
37
  }
28
38
  handleNavigationSectionToggleClick(e) {
29
39
  this.closeAllExceptOneSections(e.target);
30
40
  }
31
41
  gotoPreviousSection() {
32
- const e = document.activeElement;
33
- if (!e) return;
34
- const i = e.closest(
35
- "ilw-header-megamenu-section"
36
- ) || e.closest("li a");
37
- if (!i) return;
38
- const n = i.parentElement?.previousElementSibling;
39
- if (!n) return;
40
- const t = n.querySelector(
41
- "ilw-header-megamenu-section"
42
- ) || n.querySelector("a");
43
- t && ("setFocus" in t ? t.setFocus() : t.focus());
42
+ let e = null, t = document.activeElement;
43
+ if (t != null) {
44
+ if (t.closest("li") && t.closest("li").previousElementSibling) {
45
+ const i = t.closest("li").previousElementSibling;
46
+ i && i.children.length > 0 && (e = i.children[0]);
47
+ }
48
+ e && e.tagName === "ILW-HEADER-MEGAMENU-SECTION" ? e.setFocus(!0) : e.focus();
49
+ }
44
50
  }
45
51
  gotoNextSection() {
46
- const e = document.activeElement;
47
- if (!e) return;
48
- const i = e.closest(
49
- "ilw-header-megamenu-section"
50
- ) || e.closest("li a");
51
- if (!i) return;
52
- const n = i.parentElement?.nextElementSibling;
53
- if (!n) return;
54
- const t = n.querySelector(
55
- "ilw-header-megamenu-section"
56
- ) || n.querySelector("a");
57
- t && ("setFocus" in t ? t.setFocus() : t.focus());
52
+ let e = null, t = document.activeElement;
53
+ if (t != null) {
54
+ if (t.closest("li") && t.closest("li").nextElementSibling) {
55
+ const i = t.closest("li").nextElementSibling;
56
+ i && i.children.length > 0 && (e = i.children[0]);
57
+ }
58
+ e && e.tagName === "ILW-HEADER-MEGAMENU-SECTION" ? e.setFocus() : e.focus();
59
+ }
58
60
  }
59
61
  handleWindowResize() {
60
62
  (this.offsetWidth == 0 ? window.innerWidth : this.offsetWidth) < this.width ? this.compact || this.setCompactTrue() : this.compact && this.setCompactFalse();
@@ -73,12 +75,12 @@ let m = class extends w {
73
75
  return this.querySelectorAll("ilw-header-megamenu-section");
74
76
  }
75
77
  closeAllExceptOneSections(e) {
76
- this.getSections().forEach((i) => {
77
- (e == null || e != i) && (i.expanded = !1);
78
+ this.getSections().forEach((t) => {
79
+ (e == null || e != t) && (t.expanded = !1);
78
80
  });
79
81
  }
80
82
  render() {
81
- return c`
83
+ return a`
82
84
  <nav aria-label="Header Menu Navigation" @ilw-header-megamenu-section-expanded=${this.handleNavigationSectionToggleClick}>
83
85
  <div class="parent ${this.compact ? "compact" : "full"}">
84
86
  <slot></slot>
@@ -87,68 +89,76 @@ let m = class extends w {
87
89
  `;
88
90
  }
89
91
  };
90
- p([
92
+ b([
91
93
  d({
92
94
  type: Boolean,
93
95
  reflect: !0
94
96
  })
95
- ], m.prototype, "compact", 2);
96
- p([
97
+ ], g.prototype, "compact", 2);
98
+ b([
97
99
  d({
98
100
  type: Number
99
101
  })
100
- ], m.prototype, "width", 2);
101
- m = p([
102
+ ], g.prototype, "width", 2);
103
+ g = b([
102
104
  x("ilw-header-megamenu")
103
- ], m);
104
- const S = '#items{display:none}#items.expanded{all:initial;box-sizing:border-box;flex-direction:column;border:var(--ilw-header-megamenu--items--border);box-shadow:var(--ilw-header-megamenu--items--box-shadow);width:var(--ilw-header-megamenu--items--width);max-width:100vw + 39px;position:var(--ilw-header-megamenu--items--position);display:grid;left:var(--ilw-header-megamenu--items--left);top:var(--ilw-header-megamenu--items--top);z-index:100;background:#fff}.parent{height:100%}button,.link{all:initial;box-sizing:border-box;display:block;position:relative;padding:var(--ilw-header-megamenu-section--anchor--padding);font:var(--ilw-header-megamenu--font);background:var(--ilw-header-megamenu--link-background);color:var(--ilw-header-megamenu--link-color);fill:var(--ilw-header-megamenu--link-color);border-width:0 0 3px 0;border-style:solid;border-color:transparent;outline:0;cursor:pointer;height:100%;width:100%;border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight);border-left:var(--ilw-header-megamenu--link-border-left-highlight)}:is(button,.link) svg{padding:2px;transform:var(--ilw-header-megamenu-section--transform)}:is(button,.link).current{border-color:var(--il-blue)}:is(button,.link):hover{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover);color:var(--ilw-header-megamenu--link-color--hover);fill:var(--ilw-header-megamenu--link-color--hover);text-decoration:underline}:is(button,.link):hover svg{outline:2px dotted var(--il-altgeld)}:is(button,.link):focus{background:var(--ilw-header-megamenu--link-background--focus);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus);fill:var(--ilw-header-megamenu--link-color--focus);outline:0}:is(button,.link):focus:hover svg{outline:2px dotted var(--il-blue)}button[aria-expanded=true]{text-decoration:underline;color:var(--ilw-header-megamenu--link-color--hover);background:var(--ilw-header-megamenu--link-background--hover)}button[aria-expanded=true]:focus{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover)}button[aria-expanded=true] svg{fill:var(--ilw-header-megamenu--link-color--hover);transform:var(--ilw-header-megamenu-section--transform--selected);background:var(--ilw-header-megamenu--link-background--hover)}button[aria-expanded=true] svg:focus{background:var(--ilw-header-megamenu--link-background--hover);color:var(--il-blue)}.header{position:relative;display:grid;grid-template-columns:var(--ilw-header-megamenu-section--grid-template-columns--header);grid-template-areas:"label icon";grid-gap:4px}.header-link.current button{border-color:var(--il-blue)}.header-link{position:relative;display:grid;grid-template-columns:var(--ilw-header-megamenu--grid-template-columns);grid-template-areas:"label icon";align-items:center;height:100%}.header-link.highlighted{background:var(--ilw-header-megamenu--link-background--hover)}.header-link .link{padding:6px 0 6px 20px}.header-link button{padding:6px 20px 6px 6px}.label,.link{box-sizing:border-box;display:block;position:relative;grid-area:label}.icon,.header-link button{align-self:center;align-items:center;justify-content:center;grid-area:icon}.icon{display:flex}.arrow{display:block;height:14px;width:14px}.submenu.parent button:hover .label ::slotted(span[slot="label"]),.submenu.parent button:focus .label ::slotted(span[slot="label"]){text-decoration:underline}.menu.parent .header-link.highlighted button,.menu.parent .header-link.highlighted ::slotted(a[slot="link"]){border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus)!important}.submenu.parent button.arrow-only:hover,.submenu.parent button.arrow-only:focus{border-left:4px solid transparent!important;color:var(--il-blue)}.menu.parent .compact button.arrow-only:hover,.menu.parent .compact button.arrow-only:focus{border-left:4px solid var(--il-blue)!important;color:var(--il-blue)}:host(.solo-list) ::slotted(ul){columns:4;break-inside:avoid;max-width:100vw}div.list-wrapper{display:grid;grid-template-columns:repeat(4,minmax(0,320px));max-width:100vw;overflow:hidden}@media(max-width:989px){div.list-wrapper{all:unset}}::slotted(ul:last-of-type){border:none!important}::slotted([slot="action-right"]){grid-column:4}::slotted([slot="action-right"].span-2){grid-column:3 / span 2;justify-self:auto}::slotted([slot="action-right"].span-3){grid-column:2 / span 3;justify-self:auto}::slotted([slot="action-left"]){grid-column:1}::slotted([slot="action-left"].span-2){grid-column:1 / span 2}::slotted([slot="action-left"].span-3){grid-column:1 / span 3}.hidden{display:none}';
105
- var A = Object.defineProperty, L = Object.getOwnPropertyDescriptor, u = (e, i, o, n) => {
106
- for (var t = n > 1 ? void 0 : n ? L(i, o) : i, l = e.length - 1, r; l >= 0; l--)
107
- (r = e[l]) && (t = (n ? r(i, o, t) : r(t)) || t);
108
- return n && t && A(i, o, t), t;
105
+ ], g);
106
+ const C = '#items{display:none}#items.expanded{all:initial;box-sizing:border-box;flex-direction:column;border:var(--ilw-header-megamenu--items--border);box-shadow:var(--ilw-header-megamenu--items--box-shadow);width:var(--ilw-header-megamenu--items--width);max-width:100vw + 39px;position:var(--ilw-header-megamenu--items--position);display:grid;left:var(--ilw-header-megamenu--items--left);top:var(--ilw-header-megamenu--items--top);z-index:100;background:#fff}.parent{height:100%}button,.link{all:initial;box-sizing:border-box;display:block;position:relative;padding:var(--ilw-header-megamenu-section--anchor--padding);font:var(--ilw-header-megamenu--font);background:var(--ilw-header-megamenu--link-background);color:var(--ilw-header-megamenu--link-color);fill:var(--ilw-header-megamenu--link-color);border-width:0 0 3px 0;border-style:solid;border-color:transparent;outline:0;cursor:pointer;height:100%;width:100%;border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight);border-left:var(--ilw-header-megamenu--link-border-left-highlight)}:is(button,.link) svg{padding:2px;transform:var(--ilw-header-megamenu-section--transform)}:is(button,.link).current{border-color:var(--il-blue)}:is(button,.link):hover{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover);color:var(--ilw-header-megamenu--link-color--hover);fill:var(--ilw-header-megamenu--link-color--hover);text-decoration:underline}:is(button,.link):hover svg{outline:2px dotted var(--il-altgeld)}:is(button,.link):focus{background:var(--ilw-header-megamenu--link-background--focus);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus);border-left:var(--ilw-header-megamenu--link-border-left-highlight--focus);color:var(--ilw-header-megamenu--link-color--focus);fill:var(--ilw-header-megamenu--link-color--focus);outline:0}:is(button,.link):focus:hover svg{outline:2px dotted var(--il-blue)}button[aria-expanded=true]{text-decoration:underline;color:var(--ilw-header-megamenu--link-color--hover);background:var(--ilw-header-megamenu--link-background--hover)}button[aria-expanded=true]:focus{background:var(--ilw-header-megamenu--link-background--hover);border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--hover)}button[aria-expanded=true] svg{fill:var(--ilw-header-megamenu--link-color--hover);transform:var(--ilw-header-megamenu-section--transform--selected);background:var(--ilw-header-megamenu--link-background--hover)}button[aria-expanded=true] svg:focus{background:var(--ilw-header-megamenu--link-background--hover);color:var(--il-blue)}.header{position:relative;display:grid;grid-template-columns:var(--ilw-header-megamenu-section--grid-template-columns--header);grid-template-areas:"label icon";grid-gap:4px}.header-link.current button{border-color:var(--il-blue)}.header-link{position:relative;display:grid;grid-template-columns:var(--ilw-header-megamenu--grid-template-columns);grid-template-areas:"label icon";align-items:center;height:100%}.header-link.highlighted{background:var(--ilw-header-megamenu--link-background--hover)}.header-link .link{padding:6px 0 6px 20px}.header-link button{padding:6px 20px 6px 6px}.label,.link{box-sizing:border-box;display:block;position:relative;grid-area:label}.icon,.header-link button{align-self:center;align-items:center;justify-content:center;grid-area:icon}.icon{display:flex}.arrow{display:block;height:14px;width:14px}.submenu.parent button:hover .label ::slotted(span[slot="label"]),.submenu.parent button:focus .label ::slotted(span[slot="label"]){text-decoration:underline}.menu.parent .header-link.highlighted button,.menu.parent .header-link.highlighted ::slotted(a[slot="link"]){border-bottom:var(--ilw-header-megamenu--link-border-bottom-highlight--focus)!important}.submenu.parent button.arrow-only:hover,.submenu.parent button.arrow-only:focus{border-left:4px solid transparent!important;color:var(--il-blue)}.menu.parent .compact button.arrow-only:hover,.menu.parent .compact button.arrow-only:focus{border-left:4px solid var(--il-blue)!important;color:var(--il-blue)}:host(.solo-list) ::slotted(ul){columns:4;break-inside:avoid;max-width:100vw}div.list-wrapper{display:grid;grid-template-columns:repeat(4,1fr);overflow:hidden}::slotted(ul:last-of-type){border:none!important}::slotted([slot="action-right"]){grid-column:4}::slotted([slot="action-right"].span-2){grid-column:3 / span 2;justify-self:auto}::slotted([slot="action-right"].span-3){grid-column:2 / span 3;justify-self:auto}::slotted([slot="action-left"]){grid-column:1}::slotted([slot="action-left"].span-2){grid-column:1 / span 2}::slotted([slot="action-left"].span-3){grid-column:1 / span 3}.hidden{display:none}';
107
+ var O = Object.defineProperty, L = Object.getOwnPropertyDescriptor, h = (e, t, i, o) => {
108
+ for (var n = o > 1 ? void 0 : o ? L(t, i) : t, l = e.length - 1, r; l >= 0; l--)
109
+ (r = e[l]) && (n = (o ? r(t, i, n) : r(n)) || n);
110
+ return o && n && O(t, i, n), n;
109
111
  };
110
- let s = class extends w {
112
+ let s = class extends v {
111
113
  constructor() {
112
- super(...arguments), this.current = !1, this.compact = !1, this.expanded = !1, this.mouseover = !1, this.limitSoloListItems = (e) => {
113
- e.currentTarget.assignedElements({ flatten: !0 }).filter((n) => n instanceof HTMLUListElement).flatMap((n) => Array.from(n.children).filter((t) => t instanceof HTMLLIElement)).slice(20).forEach((n) => {
114
- n.hidden = !0;
115
- });
116
- };
114
+ super(), this.current = !1, this.compact = !1, this.expanded = !1, this.mouseover = !1, this.linked = !1, this.addEventListener("keydown", this.handleWindowKeydown.bind(this));
117
115
  }
118
116
  static get styles() {
119
- return v(S);
117
+ return k(C);
118
+ }
119
+ connectedCallback() {
120
+ super.connectedCallback();
120
121
  }
121
122
  handleToggleClick(e) {
122
123
  this.expanded = !this.expanded, this.dispatchEvent(new CustomEvent("ilw-header-megamenu-section-expanded", { detail: !this.expanded, bubbles: !0, composed: !0 }));
123
124
  }
124
125
  handleWindowKeydown(e) {
125
- e.key === "ArrowDown" ? (e.stopPropagation(), e.preventDefault(), this.moveToNextItem(), this.closeAllExceptOneSections(e.target)) : e.key === "ArrowUp" ? (e.stopPropagation(), e.preventDefault(), this.moveToPreviousItem(), this.closeAllExceptOneSections(e.target)) : e.key === "Escape" && this.expanded && (e.stopPropagation(), this.setFocus(), this.expanded = !1);
126
+ e.key === "ArrowDown" ? (e.stopPropagation(), e.preventDefault(), this.moveToNextItem(), this.closeAllExceptOneSections(e.target)) : e.key === "ArrowRight" || e.key === "ArrowLeft" ? this.isOnAnchorInLinked() && e.key === "ArrowRight" ? (e.stopPropagation(), e.preventDefault(), this.expanded = !1, this.setFocus(!0)) : this.isOnButtonInLinked() && e.key === "ArrowLeft" ? (e.stopPropagation(), e.preventDefault(), this.expanded = !1, this.setFocus()) : this.isOnButtonInLinked() && e.key === "ArrowRight" ? this.expanded = !1 : this.isOnAnchorInLinked() && e.key === "ArrowLeft" ? this.expanded = !1 : (this.expanded = !1, this.setFocus()) : e.key === "ArrowUp" ? (e.stopPropagation(), e.preventDefault(), this.moveToPreviousItem(), this.closeAllExceptOneSections(e.target)) : e.key === "Escape" && this.expanded && (e.stopPropagation(), this.setFocus(), this.expanded = !1);
127
+ }
128
+ isEmbedded() {
129
+ return this.parentElement && this.parentElement.closest("ilw-header-megamenu-section") != null;
130
+ }
131
+ isOnAnchorInLinked() {
132
+ return this.linked && document.activeElement && document.activeElement.tagName === "A";
133
+ }
134
+ isOnButtonInLinked() {
135
+ return this.linked && document.activeElement && document.activeElement.tagName === "ILW-HEADER-MEGAMENU-SECTION";
126
136
  }
127
- setFocus() {
128
- const e = this.shadowRoot?.querySelector("button, a");
129
- e && e.focus();
137
+ setFocus(e = !1) {
138
+ let t = null;
139
+ this.linked && !e ? t = this.querySelector("a") : this.shadowRoot && (t = this.shadowRoot.querySelector("a"), t == null && (t = this.shadowRoot.querySelector("button"))), t?.focus();
130
140
  }
131
141
  moveToNextItem() {
132
- this.expanded || (this.expanded = !0);
142
+ !this.expanded && !this.isEmbedded() && (this.expanded = !0);
133
143
  const e = document.activeElement;
134
144
  if (!e) return;
135
- const i = e.closest("ILW-HEADER-MEGAMENU-SECTION");
136
- if (!i) return;
137
- const o = Array.from(i.querySelectorAll("a, button")), n = o.indexOf(e);
138
- let t = n + 1;
139
- n === -1 && (t = 0), t >= 0 && t < o.length && o[t].focus();
145
+ const t = e.closest("ILW-HEADER-MEGAMENU-SECTION");
146
+ if (!t) return;
147
+ const i = Array.from(t.querySelectorAll("a, button")), o = i.indexOf(e);
148
+ let n = o + 1;
149
+ o === -1 && (n = 0), n >= 0 && n < i.length && i[n].focus();
140
150
  }
141
151
  moveToPreviousItem() {
142
152
  const e = document.activeElement;
143
153
  if (!e) return;
144
- const i = e.closest("ILW-HEADER-MEGAMENU-SECTION");
145
- if (!i) return;
146
- const o = Array.from(i.querySelectorAll("a, button")), n = o.indexOf(e);
147
- let t = n - 1;
148
- n === -1 && (t = o.length - 1), t >= 0 && t < o.length && o[t].focus();
154
+ const t = e.closest("ILW-HEADER-MEGAMENU-SECTION");
155
+ if (!t) return;
156
+ const i = Array.from(t.querySelectorAll("a, button")), o = i.indexOf(e);
157
+ let n = o - 1;
158
+ o === -1 && (n = i.length - 1), n >= 0 && n < i.length && i[n].focus();
149
159
  }
150
160
  renderArrow() {
151
- return c`<svg class="arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.4 23.82" aria-hidden="true">
161
+ return a`<svg class="arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.4 23.82" aria-hidden="true">
152
162
  <path id="chevron" d="m39.34,1.06c-1.41-1.41-3.7-1.41-5.12,0l-14.02,14.02L6.18,1.06C4.76-.35,2.47-.35,1.06,1.06s-1.41,3.7,0,5.12l16.58,16.58c1.41,1.41,3.7,1.41,5.12,0L39.34,6.18c1.41-1.41,1.41-3.7,0-5.12Z"/>
153
163
  </svg>`;
154
164
  }
@@ -162,79 +172,95 @@ let s = class extends w {
162
172
  return this.querySelectorAll("ilw-header-megamenu-section");
163
173
  }
164
174
  closeAllExceptOneSections(e) {
165
- this.getSections().forEach((i) => {
166
- (e == null || e != i) && (i.expanded = !1);
175
+ this.getSections().forEach((t) => {
176
+ (e == null || e != t) && (t.expanded = !1);
167
177
  });
168
178
  }
169
179
  hasSlotContent(e) {
170
- const i = this.shadowRoot.querySelector(`slot[name="${e}"]`);
171
- return i ? i.assignedNodes({ flatten: !0 }).length > 0 : !1;
180
+ const t = this.shadowRoot.querySelector(`slot[name="${e}"]`);
181
+ return t ? t.assignedNodes({ flatten: !0 }).length > 0 : !1;
172
182
  }
173
183
  render() {
174
184
  const e = this.querySelector('span[slot="action-left"], span[slot="action-right"]');
175
- let i = null;
185
+ let t = null;
176
186
  if (e) {
177
- const r = e.querySelector("p")?.textContent?.trim() || "";
178
- let a = e.querySelector("a, button");
179
- r && (i = `action-${r.replace(/\s+/g, "-")}`, e.id = i), a && i && a.setAttribute("aria-describedby", i);
187
+ const u = e.querySelector("p")?.textContent?.trim() || "";
188
+ let c = e.querySelector("a, button");
189
+ u && (t = `action-${u.replace(/\s+/g, "-")}`, e.id = t), c && t && c.setAttribute("aria-describedby", t);
180
190
  }
181
- document.querySelectorAll("ilw-header-megamenu-section").forEach((r) => {
182
- const a = r.querySelectorAll("ilw-header-megamenu-section.solo-list > ul > li"), b = a.length;
183
- if (b === 5) {
184
- a.forEach((h, f) => {
185
- h.style.borderRight = "none";
191
+ document.querySelectorAll("ilw-header-megamenu-section").forEach((u) => {
192
+ const c = u.querySelectorAll("ilw-header-megamenu-section.solo-list > ul > li"), f = c.length;
193
+ if (f === 5) {
194
+ c.forEach((m, w) => {
195
+ m.style.borderRight = "none";
186
196
  });
187
197
  return;
188
198
  }
189
- let g = Math.floor(b / 5) * 5;
190
- g = Math.min(g, 15), a.forEach((h, f) => {
191
- f + 1 <= g ? h.style.borderRight = "solid 2px var(--il-storm-85, #d5d3d3)" : h.style.borderRight = "none";
199
+ let p = Math.floor(f / 5) * 5;
200
+ p = Math.min(p, 15), c.forEach((m, w) => {
201
+ w <= p ? m.style.borderRight = "solid 2px var(--il-storm-85, #d5d3d3)" : m.style.borderRight = "none";
192
202
  });
193
203
  });
194
- let n = this.parentElement != null && this.parentElement.closest("ilw-header-megamenu-section") != null;
195
- this.current = this.current || this.getAttribute("aria-current") != null && (this.getAttribute("aria-current") === "page" || this.getAttribute("aria-current") === "true");
196
- const l = !this.classList.contains("solo-list");
197
- return c`
198
- <div class="${n ? "submenu" : "menu"} parent" @ilw-header-megamenu-section-expanded=${this.handleNavigationSectionToggleClick} @keydown=${this.handleWindowKeydown}>
199
- <button class="${this.current ? "current" : ""}" @click=${this.handleToggleClick.bind(this)} aria-expanded=${this.expanded ? "true" : "false"} aria-controls="items">
200
- <div class="header">
201
- <div class="label"><slot name="label"></slot> </div>
202
- <div class="icon">${this.renderArrow()}</div>
203
- </div>
204
+ let o = this.parentElement != null && this.parentElement.closest("ilw-header-megamenu-section") != null;
205
+ this.parentElement != null && this.parentElement.closest("ilw-header-megamenu-section") != null, this.current = this.current || this.getAttribute("aria-current") != null && (this.getAttribute("aria-current") === "page" || this.getAttribute("aria-current") === "true");
206
+ var n = a`
207
+ <div class="header-link ${this.mouseover ? "highlighted" : ""} ${this.compact ? "compact" : ""} ${this.current ? "current" : ""}" @mouseover="${this.toggleMouseOver.bind(this)}" @mouseout="${this.toggleMouseOver.bind(this)}">
208
+ <slot name="link"></slot>
209
+ <button class="arrow-only" @click=${this.handleToggleClick.bind(this)} aria-expanded=${this.expanded ? "true" : "false"} aria-label=${this.querySelector('a[slot="link"]')?.textContent + " submenu"} aria-controls="items">
210
+ ${this.renderArrow()}
204
211
  </button>
212
+ </div>
213
+ `, l = a`
214
+ <button class="${this.current ? "current" : ""}" @click=${this.handleToggleClick.bind(this)} aria-expanded=${this.expanded ? "true" : "false"} aria-controls="items">
215
+ <div class="header">
216
+ <div class="label"><slot name="label"></slot> </div>
217
+ <div class="icon">${this.renderArrow()}</div>
218
+ </div>
219
+ </button>
220
+ `;
221
+ const y = !this.classList.contains("solo-list");
222
+ return a`
223
+ <div class="${o ? "submenu" : "menu"} parent" @ilw-header-megamenu-section-expanded=${this.handleNavigationSectionToggleClick}>
224
+ ${this.linked ? n : l}
205
225
  <div id="items" class="${this.expanded ? "expanded" : ""}">
206
- ${l ? c`
226
+ ${y ? a`
207
227
  <div class="list-wrapper">
208
228
  <slot name="action-left"></slot>
209
229
  <slot id="list-slot"></slot>
210
230
  <slot name="action-right"></slot>
211
231
  </div>
212
- ` : c`<slot id="list-slot" @slotchange=${this.limitSoloListItems}></slot>`}
232
+ ` : a`<slot id="list-slot"></slot>`}
213
233
  </div>
214
234
  </div>
215
235
  `;
216
236
  }
217
237
  };
218
- u([
238
+ h([
219
239
  d({
220
240
  type: Boolean
221
241
  })
222
242
  ], s.prototype, "current", 2);
223
- u([
243
+ h([
224
244
  d({
225
245
  type: Boolean
226
246
  })
227
247
  ], s.prototype, "compact", 2);
228
- u([
248
+ h([
229
249
  d({
230
250
  type: Boolean
231
251
  })
232
252
  ], s.prototype, "expanded", 2);
233
- u([
253
+ h([
234
254
  d({
235
255
  type: Boolean
236
256
  })
237
257
  ], s.prototype, "mouseover", 2);
238
- s = u([
258
+ h([
259
+ d({
260
+ reflect: !0,
261
+ type: Boolean
262
+ })
263
+ ], s.prototype, "linked", 2);
264
+ s = h([
239
265
  x("ilw-header-megamenu-section")
240
266
  ], s);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "repository": "github:web-illinois/ilw-header-megamenu",
5
5
  "private": false,
6
6
  "license": "MIT",
7
- "version": "1.0.2",
7
+ "version": "1.1.6",
8
8
  "type": "module",
9
9
  "files": [
10
10
  "src/**",
@@ -37,13 +37,14 @@
37
37
  "lit": "3.1.3"
38
38
  },
39
39
  "devDependencies": {
40
- "@illinois-toolkit/ilw-core": "^1.0.5",
40
+ "@illinois-toolkit/ilw-core": "^2.1.0",
41
41
  "@playwright/test": "^1.57.0",
42
- "@vitest/browser": "^3.2.4",
42
+ "@vitest/browser": "^5.1.2",
43
+ "@vitest/browser-playwright": "^5.1.2",
43
44
  "playwright": "^1.57.0",
44
45
  "typescript": "^5.9.2",
45
46
  "vite": "^7.2.4",
46
- "vite-plugin-dts": "^4.5.4",
47
- "vitest-browser-lit": "^0.1.0"
47
+ "vite-plugin-dts": "^5.1.2",
48
+ "vitest-browser-lit": "^1.0.1"
48
49
  }
49
50
  }
@@ -18,7 +18,7 @@
18
18
  --ilw-header-megamenu--items--position: absolute;
19
19
  --ilw-header-megamenu--items--border: 1px solid rgb(0, 0, 0, .01);
20
20
  --ilw-header-megamenu--items--box-shadow: 0 0 4px #00000040;
21
- --ilw-header-megamenu--items--width: 1270px;
21
+ --ilw-header-megamenu--items--width: 1220px;
22
22
  --ilw-header-megamenu--items--top: initial;
23
23
  --ilw-header-megamenu--items--left: calc(var(--ilw-margin--side) - 39px);
24
24
  --ilw-header-megamenu--font: 700 16px/22px var(--il-font-sans);
package/src/MegaMenu.ts CHANGED
@@ -18,7 +18,7 @@ export default class MegaMenu extends LitElement {
18
18
  type: Number
19
19
  })
20
20
  width = 990;
21
-
21
+
22
22
 
23
23
  static get styles() : CSSResultGroup {
24
24
  return unsafeCSS(styles);
@@ -47,7 +47,7 @@ export default class MegaMenu extends LitElement {
47
47
  handleWindowClick(evt: MouseEvent) {
48
48
  if (!this.contains(evt.target as HTMLElement)) this.closeAllExceptOneSections(null);
49
49
  }
50
-
50
+
51
51
  handleWindowKeydown(evt: KeyboardEvent) {
52
52
  if (evt.key === 'Escape') this.closeAllExceptOneSections(null);
53
53
  if (evt.key === 'ArrowRight') {
@@ -60,67 +60,69 @@ export default class MegaMenu extends LitElement {
60
60
  this.closeAllExceptOneSections(null);
61
61
  this.gotoPreviousSection();
62
62
  }
63
- }
64
63
 
65
- handleNavigationSectionToggleClick(evt: CustomEvent) {
66
- this.closeAllExceptOneSections(evt.target);
67
- }
64
+ if (evt.key !== 'Tab' || evt.shiftKey) return;
68
65
 
69
- gotoPreviousSection() {
70
- const activeElement = document.activeElement;
71
- if (!activeElement) return;
66
+ const activeElement = document.activeElement as HTMLElement;
67
+ if (!activeElement) return;
72
68
 
73
- const currentSection = activeElement.closest(
74
- 'ilw-header-megamenu-section'
75
- ) || activeElement.closest('li a');
69
+ const section = activeElement.closest(
70
+ 'ilw-header-megamenu-section'
71
+ ) as MegaMenuSection | null;
76
72
 
77
- if (!currentSection) return;
73
+ if (!section || !section.expanded) return;
78
74
 
79
- const parentLi = currentSection.parentElement;
80
- const previousLi = parentLi?.previousElementSibling;
75
+ const focusables = section.querySelectorAll<HTMLElement>(
76
+ 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])'
77
+ );
81
78
 
82
- if (!previousLi) return;
79
+ const lastFocusable = focusables[focusables.length - 1];
83
80
 
84
- const previousSection = previousLi.querySelector(
85
- 'ilw-header-megamenu-section'
86
- ) || previousLi.querySelector('a');
87
-
88
- if (!previousSection) return;
89
-
90
- if ('setFocus' in previousSection) {
91
- (previousSection as MegaMenuSection).setFocus();
92
- } else {
93
- (previousSection as HTMLAnchorElement).focus();
81
+ if (activeElement === lastFocusable) {
82
+ section.expanded = false;
83
+ }
94
84
  }
95
- }
96
-
97
- gotoNextSection() {
98
- const activeElement = document.activeElement;
99
- if (!activeElement) return;
100
85
 
101
- const currentSection = activeElement.closest(
102
- 'ilw-header-megamenu-section'
103
- ) || activeElement.closest('li a');
104
-
105
- if (!currentSection) return;
106
-
107
- const parentLi = currentSection.parentElement;
108
- const nextLi = parentLi?.nextElementSibling;
109
-
110
- if (!nextLi) return;
86
+ handleNavigationSectionToggleClick(evt: CustomEvent) {
87
+ this.closeAllExceptOneSections(evt.target);
88
+ }
111
89
 
112
- const nextSection = nextLi.querySelector(
113
- 'ilw-header-megamenu-section'
114
- ) || nextLi.querySelector('a');
115
90
 
116
- if (!nextSection) return;
91
+ gotoPreviousSection() {
92
+ let newNode: Element | null = null;
93
+ let activeElement = document.activeElement;
94
+ if (activeElement != null) {
95
+ if (activeElement.closest('li') && (activeElement.closest('li') as Element).previousElementSibling ) {
96
+ const previousSibling = (activeElement.closest('li') as Element).previousElementSibling;
97
+ if (previousSibling && previousSibling.children.length > 0) {
98
+ newNode = previousSibling.children[0];
99
+ }
100
+ }
101
+ if (newNode && newNode.tagName === 'ILW-HEADER-MEGAMENU-SECTION') {
102
+ (newNode as MegaMenuSection).setFocus(true);
103
+ } else {
104
+ (newNode as HTMLElement).focus();
105
+ }
106
+ }
107
+ }
117
108
 
118
- if ('setFocus' in nextSection) {
119
- (nextSection as MegaMenuSection).setFocus();
120
- } else {
121
- (nextSection as HTMLAnchorElement).focus();
109
+ gotoNextSection() {
110
+ let newNode: Element | null = null;
111
+ let activeElement = document.activeElement;
112
+ if (activeElement != null) {
113
+ if (activeElement.closest('li') && (activeElement.closest('li') as Element).nextElementSibling) {
114
+ const nextSibling = (activeElement.closest('li') as Element).nextElementSibling;
115
+ if (nextSibling && nextSibling.children.length > 0) {
116
+ newNode = nextSibling.children[0];
117
+ }
118
+ }
119
+ if (newNode && newNode.tagName === 'ILW-HEADER-MEGAMENU-SECTION') {
120
+ (newNode as MegaMenuSection).setFocus();
121
+ } else {
122
+ (newNode as HTMLElement).focus();
123
+ }
124
+ }
122
125
  }
123
- }
124
126
 
125
127
  handleWindowResize() {
126
128
  let currentWidth = this.offsetWidth == 0 ? window.innerWidth : this.offsetWidth;