@meteo28093/equinox-ui 0.0.6 → 0.0.7

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.
@@ -688,7 +688,7 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
688
688
  .map.dark-mode {
689
689
  filter: invert(1) hue-rotate(180deg);
690
690
  }
691
- `,this.shadowRoot.appendChild(a);let t=document.createElement("link");t.rel="stylesheet",t.href=ak,this.shadowRoot.appendChild(t),this._mapContainer=document.createElement("div"),this._mapContainer.className="map-container",this._mapContainer.part="container",this.shadowRoot.appendChild(this._mapContainer)}connectedCallback(){this._initializeMap()}disconnectedCallback(){this._map&&(this._map.remove(),this._map=this._marker=this._mapEl=null)}attributeChangedCallback(a,t,e){t!==e&&this._map&&this._updateMap()}async _geocode(){try{let a=await A.geocodeNominatim(this.address);if(console.log(a),a)return[a.latitude,a.longitude]}catch{}return[50,0]}async _initializeMap(){let a=await ek();if(!this.isConnected)return;this._mapContainer.innerHTML="",this._mapEl=document.createElement("div"),this._mapEl.className="map"+(this.darkMode?" dark-mode":""),this._mapEl.part="map",this._mapContainer.appendChild(this._mapEl);let[t,e]=await this._geocode();if(!this.isConnected)return;this._map=a.map(this._mapEl).setView([t,e],this.zoom),a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(this._map);let r=a.divIcon({className:"",html:'<div style="width:14px;height:14px;background:#3b82f6;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 2px #3b82f6"></div>',iconSize:[14,14],iconAnchor:[7,7],popupAnchor:[0,-12]});this._marker=a.marker([t,e],{icon:r}).addTo(this._map).bindPopup(this.address||"Location"),this.dispatchEvent(new CustomEvent("map-ready",{bubbles:!0,composed:!0,detail:{lat:t,lng:e}}))}async _updateMap(){if(!this._map)return;let[a,t]=await this._geocode();this._map&&(this._map.setView([a,t],this.zoom),this._marker?.setLatLng([a,t]),this._marker?.setPopupContent(this.address||"Location"),this._mapEl&&(this._mapEl.className="map"+(this.darkMode?" dark-mode":"")),this.dispatchEvent(new CustomEvent("map-update",{bubbles:!0,composed:!0,detail:{address:this.address,zoom:this.zoom,darkMode:this.darkMode}})))}get address(){return this.getAttribute("address")||""}set address(a){this.setAttribute("address",a)}get zoom(){return parseInt(this.getAttribute("zoom"))||13}set zoom(a){this.setAttribute("zoom",a.toString())}get darkMode(){return this.hasAttribute("dark-mode")}set darkMode(a){a?this.setAttribute("dark-mode",""):this.removeAttribute("dark-mode")}};customElements.get("ee-map")||customElements.define("ee-map",N1);var Z1=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._outsideClickHandler=this._handleOutsideClick.bind(this),this._popstateHandler=()=>this._updateActive()}static get observedAttributes(){return["items"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render(),document.addEventListener("click",this._outsideClickHandler),window.addEventListener("popstate",this._popstateHandler)}disconnectedCallback(){document.removeEventListener("click",this._outsideClickHandler),window.removeEventListener("popstate",this._popstateHandler)}_handleOutsideClick(a){this.contains(a.target)||this._closeMenu()}_closeMenu(){let a=this.shadowRoot?.querySelector(".mobile-menu"),t=this.shadowRoot?.querySelector(".hamburger-button");a?.classList.remove("open"),t?.setAttribute("aria-expanded","false")}_updateActive(){let a=location.pathname;this.shadowRoot.querySelectorAll("a.navlink").forEach(t=>{let e=t.getAttribute("href")===a||a==="/home"&&t.getAttribute("href")==="/";t.classList.toggle("active",e)})}render(){let a=this.getItems();this.shadowRoot.innerHTML=`
691
+ `,this.shadowRoot.appendChild(a);let t=document.createElement("link");t.rel="stylesheet",t.href=ak,this.shadowRoot.appendChild(t),this._mapContainer=document.createElement("div"),this._mapContainer.className="map-container",this._mapContainer.part="container",this.shadowRoot.appendChild(this._mapContainer)}connectedCallback(){this._initializeMap()}disconnectedCallback(){this._map&&(this._map.remove(),this._map=this._marker=this._mapEl=null)}attributeChangedCallback(a,t,e){t!==e&&this._map&&this._updateMap()}async _geocode(){try{let a=await A.geocodeNominatim(this.address);if(console.log(a),a)return[a.latitude,a.longitude]}catch{}return[50,0]}async _initializeMap(){let a=await ek();if(!this.isConnected)return;this._mapContainer.innerHTML="",this._mapEl=document.createElement("div"),this._mapEl.className="map"+(this.darkMode?" dark-mode":""),this._mapEl.part="map",this._mapContainer.appendChild(this._mapEl);let[t,e]=await this._geocode();if(!this.isConnected)return;this._map=a.map(this._mapEl).setView([t,e],this.zoom),a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(this._map);let r=a.divIcon({className:"",html:'<div style="width:14px;height:14px;background:#3b82f6;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 2px #3b82f6"></div>',iconSize:[14,14],iconAnchor:[7,7],popupAnchor:[0,-12]});this._marker=a.marker([t,e],{icon:r}).addTo(this._map).bindPopup(this.address||"Location"),this.dispatchEvent(new CustomEvent("map-ready",{bubbles:!0,composed:!0,detail:{lat:t,lng:e}}))}async _updateMap(){if(!this._map)return;let[a,t]=await this._geocode();this._map&&(this._map.setView([a,t],this.zoom),this._marker?.setLatLng([a,t]),this._marker?.setPopupContent(this.address||"Location"),this._mapEl&&(this._mapEl.className="map"+(this.darkMode?" dark-mode":"")),this.dispatchEvent(new CustomEvent("map-update",{bubbles:!0,composed:!0,detail:{address:this.address,zoom:this.zoom,darkMode:this.darkMode}})))}get address(){return this.getAttribute("address")||""}set address(a){this.setAttribute("address",a)}get zoom(){return parseInt(this.getAttribute("zoom"))||13}set zoom(a){this.setAttribute("zoom",a.toString())}get darkMode(){return this.hasAttribute("dark-mode")}set darkMode(a){a?this.setAttribute("dark-mode",""):this.removeAttribute("dark-mode")}};customElements.get("ee-map")||customElements.define("ee-map",N1);var Z1=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._outsideClickHandler=this._handleOutsideClick.bind(this),this._popstateHandler=()=>this._updateActive()}static get observedAttributes(){return["items","logopath"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render(),document.addEventListener("click",this._outsideClickHandler),window.addEventListener("popstate",this._popstateHandler)}disconnectedCallback(){document.removeEventListener("click",this._outsideClickHandler),window.removeEventListener("popstate",this._popstateHandler)}_handleOutsideClick(a){this.contains(a.target)||this._closeMenu()}_closeMenu(){let a=this.shadowRoot?.querySelector(".mobile-menu"),t=this.shadowRoot?.querySelector(".hamburger-button");a?.classList.remove("open"),t?.setAttribute("aria-expanded","false")}_updateActive(){let a=location.pathname;this.shadowRoot.querySelectorAll("a.navlink").forEach(t=>{let e=t.getAttribute("href")===a||a==="/home"&&t.getAttribute("href")==="/";t.classList.toggle("active",e)})}render(){let a=this.getItems(),t=this.getAttribute("logopath");this.shadowRoot.innerHTML=`
692
692
  <style>
693
693
  :host {
694
694
  display: block;
@@ -752,6 +752,12 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
752
752
  stroke: currentColor;
753
753
  }
754
754
 
755
+ .nav-logo img {
756
+ max-height: 1.5rem;
757
+ width: auto;
758
+ display: block;
759
+ }
760
+
755
761
  /* \u2500\u2500 Hamburger (hidden on desktop) \u2500\u2500 */
756
762
  .hamburger-container {
757
763
  display: none;
@@ -877,11 +883,12 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
877
883
 
878
884
  <!-- Desktop nav -->
879
885
  <ul class="nav-desktop" role="list">
880
- ${a.map(r=>`
886
+ ${t?`<li class="nav-logo"><a href="/" class="navlink"><img src="${t}" alt="Logo"></a></li>`:""}
887
+ ${a.map(i=>`
881
888
  <li>
882
- <a class="navlink ${r.active?"active":""}" href="${r.href}">
883
- ${r.icon?`<span class="navlink-icon"><ee-lucide name="${r.icon}"></ee-lucide></span>`:""}
884
- <span class="navlink-text">${r.text}</span>
889
+ <a class="navlink ${i.active?"active":""}" href="${i.href}">
890
+ ${i.icon?`<span class="navlink-icon"><ee-lucide name="${i.icon}"></ee-lucide></span>`:""}
891
+ <span class="navlink-text">${i.text}</span>
885
892
  </a>
886
893
  </li>
887
894
  `).join("")}
@@ -899,13 +906,14 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
899
906
  </button>
900
907
  <div class="mobile-menu" role="menu">
901
908
  <ul role="list">
902
- ${a.map(r=>`
909
+ ${t?`<li class="nav-logo"><a href="/" class="navlink"><img src="${t}" alt="Logo"></a></li>`:""}
910
+ ${a.map(i=>`
903
911
  <li role="none">
904
- <a class="navlink ${r.active?"active":""}" href="${r.href}" role="menuitem">
905
- ${r.icon?`<span class="navlink-icon"><ee-lucide name="${r.icon}"></ee-lucide></span>`:""}
912
+ <a class="navlink ${i.active?"active":""}" href="${i.href}" role="menuitem">
913
+ ${i.icon?`<span class="navlink-icon"><ee-lucide name="${i.icon}"></ee-lucide></span>`:""}
906
914
  <span class="navlink-info">
907
- <span class="navlink-text">${r.text}</span>
908
- ${r.subtitle?`<span class="navlink-subtitle">${r.subtitle}</span>`:""}
915
+ <span class="navlink-text">${i.text}</span>
916
+ ${i.subtitle?`<span class="navlink-subtitle">${i.subtitle}</span>`:""}
909
917
  </span>
910
918
  </a>
911
919
  </li>
@@ -913,7 +921,7 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
913
921
  </ul>
914
922
  </div>
915
923
  </div>
916
- `;let t=this.shadowRoot.querySelector(".hamburger-button"),e=this.shadowRoot.querySelector(".mobile-menu");t?.addEventListener("click",r=>{r.stopPropagation();let i=e.classList.toggle("open");t.setAttribute("aria-expanded",String(i))}),e?.addEventListener("click",()=>this._closeMenu()),this.shadowRoot.addEventListener("click",r=>{r.composedPath().find(s=>s.matches?.("a.navlink"))&&requestAnimationFrame(()=>this._updateActive())})}getItems(){let a=this.getAttribute("items");if(a)try{return JSON.parse(a)}catch(t){return console.warn("Invalid items attribute:",t),[]}return[]}};customElements.get("ee-nav")||customElements.define("ee-nav",Z1);var G1=class extends HTMLElement{connectedCallback(){this.style.display=this.style.display||"inline-block",this.style.fontVariantNumeric="tabular-nums",this.style.fontWeight=this.style.fontWeight||"700",this._current=0;let a=this.getAttribute("ee-var");if(a){this._unsub=window.EE.on(a,e=>this.#t(+e));let t=window.EE.get(a);t!==void 0&&this.#t(+t)}else this.hasAttribute("value")&&this.#t(+this.getAttribute("value"))}disconnectedCallback(){this._unsub?.(),this._raf&&cancelAnimationFrame(this._raf)}#a(a){let t=this.getAttribute("format")||"int",e=this.hasAttribute("decimals")?+this.getAttribute("decimals"):t==="float"||t==="percent"?1:0,r;return t==="percent"?r=(a*100).toFixed(e)+"%":t==="comma"?r=Math.round(a).toLocaleString():t==="float"?r=a.toFixed(e):t==="int"?r=String(Math.round(a)):r=t.replace("{v}",e>0?a.toFixed(e):String(Math.round(a))),r}#t(a){if(!Number.isFinite(a))return;let t=+this.getAttribute("duration"),e=Number.isFinite(t)?t:600;if(e<=0){this._current=a,this.textContent=this.#a(a);return}let r=this._current??0,i=performance.now();this._raf&&cancelAnimationFrame(this._raf);let s=d=>{let o=Math.min(1,(d-i)/e),n=1-Math.pow(1-o,3),p=r+(a-r)*n;this._current=p,this.textContent=this.#a(p),o<1?this._raf=requestAnimationFrame(s):this._current=a};this._raf=requestAnimationFrame(s)}};customElements.get("ee-number")||customElements.define("ee-number",G1);var W1=class extends HTMLElement{static get observedAttributes(){return["image","height"]}constructor(){super(),this.attachShadow({mode:"open"}),this._height="500px";let a=document.createElement("style");a.textContent=`
924
+ `;let e=this.shadowRoot.querySelector(".hamburger-button"),r=this.shadowRoot.querySelector(".mobile-menu");e?.addEventListener("click",i=>{i.stopPropagation();let s=r.classList.toggle("open");e.setAttribute("aria-expanded",String(s))}),r?.addEventListener("click",()=>this._closeMenu()),this.shadowRoot.addEventListener("click",i=>{i.composedPath().find(d=>d.matches?.("a.navlink"))&&requestAnimationFrame(()=>this._updateActive())})}getItems(){let a=this.getAttribute("items");if(a)try{return JSON.parse(a)}catch(t){return console.warn("Invalid items attribute:",t),[]}return[]}};customElements.get("ee-nav")||customElements.define("ee-nav",Z1);var G1=class extends HTMLElement{connectedCallback(){this.style.display=this.style.display||"inline-block",this.style.fontVariantNumeric="tabular-nums",this.style.fontWeight=this.style.fontWeight||"700",this._current=0;let a=this.getAttribute("ee-var");if(a){this._unsub=window.EE.on(a,e=>this.#t(+e));let t=window.EE.get(a);t!==void 0&&this.#t(+t)}else this.hasAttribute("value")&&this.#t(+this.getAttribute("value"))}disconnectedCallback(){this._unsub?.(),this._raf&&cancelAnimationFrame(this._raf)}#a(a){let t=this.getAttribute("format")||"int",e=this.hasAttribute("decimals")?+this.getAttribute("decimals"):t==="float"||t==="percent"?1:0,r;return t==="percent"?r=(a*100).toFixed(e)+"%":t==="comma"?r=Math.round(a).toLocaleString():t==="float"?r=a.toFixed(e):t==="int"?r=String(Math.round(a)):r=t.replace("{v}",e>0?a.toFixed(e):String(Math.round(a))),r}#t(a){if(!Number.isFinite(a))return;let t=+this.getAttribute("duration"),e=Number.isFinite(t)?t:600;if(e<=0){this._current=a,this.textContent=this.#a(a);return}let r=this._current??0,i=performance.now();this._raf&&cancelAnimationFrame(this._raf);let s=d=>{let o=Math.min(1,(d-i)/e),n=1-Math.pow(1-o,3),p=r+(a-r)*n;this._current=p,this.textContent=this.#a(p),o<1?this._raf=requestAnimationFrame(s):this._current=a};this._raf=requestAnimationFrame(s)}};customElements.get("ee-number")||customElements.define("ee-number",G1);var W1=class extends HTMLElement{static get observedAttributes(){return["image","height"]}constructor(){super(),this.attachShadow({mode:"open"}),this._height="500px";let a=document.createElement("style");a.textContent=`
917
925
  :host {
918
926
  display: block;
919
927
  color: inherit;
@@ -2440,8 +2448,6 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
2440
2448
  .top-item {
2441
2449
  display: flex;
2442
2450
  align-items: center;
2443
- padding: 12px;
2444
- border: 1px solid var(--border, currentColor);
2445
2451
  }
2446
2452
  .rank {
2447
2453
  font-weight: bold;
@@ -2466,8 +2472,6 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
2466
2472
  </style>
2467
2473
  <div class="container">
2468
2474
  <div class="top-list">
2469
- <h4>Languages</h4>
2470
- <p>Top 10 spoken languages visiting this website.</p>
2471
2475
  <div id="top-flags-container"></div>
2472
2476
  </div>
2473
2477
  </div>
@@ -688,7 +688,7 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
688
688
  .map.dark-mode {
689
689
  filter: invert(1) hue-rotate(180deg);
690
690
  }
691
- `,this.shadowRoot.appendChild(a);let t=document.createElement("link");t.rel="stylesheet",t.href=nk,this.shadowRoot.appendChild(t),this._mapContainer=document.createElement("div"),this._mapContainer.className="map-container",this._mapContainer.part="container",this.shadowRoot.appendChild(this._mapContainer)}connectedCallback(){this._initializeMap()}disconnectedCallback(){this._map&&(this._map.remove(),this._map=this._marker=this._mapEl=null)}attributeChangedCallback(a,t,e){t!==e&&this._map&&this._updateMap()}async _geocode(){try{let a=await A.geocodeNominatim(this.address);if(console.log(a),a)return[a.latitude,a.longitude]}catch{}return[50,0]}async _initializeMap(){let a=await pk();if(!this.isConnected)return;this._mapContainer.innerHTML="",this._mapEl=document.createElement("div"),this._mapEl.className="map"+(this.darkMode?" dark-mode":""),this._mapEl.part="map",this._mapContainer.appendChild(this._mapEl);let[t,e]=await this._geocode();if(!this.isConnected)return;this._map=a.map(this._mapEl).setView([t,e],this.zoom),a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(this._map);let r=a.divIcon({className:"",html:'<div style="width:14px;height:14px;background:#3b82f6;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 2px #3b82f6"></div>',iconSize:[14,14],iconAnchor:[7,7],popupAnchor:[0,-12]});this._marker=a.marker([t,e],{icon:r}).addTo(this._map).bindPopup(this.address||"Location"),this.dispatchEvent(new CustomEvent("map-ready",{bubbles:!0,composed:!0,detail:{lat:t,lng:e}}))}async _updateMap(){if(!this._map)return;let[a,t]=await this._geocode();this._map&&(this._map.setView([a,t],this.zoom),this._marker?.setLatLng([a,t]),this._marker?.setPopupContent(this.address||"Location"),this._mapEl&&(this._mapEl.className="map"+(this.darkMode?" dark-mode":"")),this.dispatchEvent(new CustomEvent("map-update",{bubbles:!0,composed:!0,detail:{address:this.address,zoom:this.zoom,darkMode:this.darkMode}})))}get address(){return this.getAttribute("address")||""}set address(a){this.setAttribute("address",a)}get zoom(){return parseInt(this.getAttribute("zoom"))||13}set zoom(a){this.setAttribute("zoom",a.toString())}get darkMode(){return this.hasAttribute("dark-mode")}set darkMode(a){a?this.setAttribute("dark-mode",""):this.removeAttribute("dark-mode")}};customElements.get("ee-map")||customElements.define("ee-map",Z1);var G1=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._outsideClickHandler=this._handleOutsideClick.bind(this),this._popstateHandler=()=>this._updateActive()}static get observedAttributes(){return["items"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render(),document.addEventListener("click",this._outsideClickHandler),window.addEventListener("popstate",this._popstateHandler)}disconnectedCallback(){document.removeEventListener("click",this._outsideClickHandler),window.removeEventListener("popstate",this._popstateHandler)}_handleOutsideClick(a){this.contains(a.target)||this._closeMenu()}_closeMenu(){let a=this.shadowRoot?.querySelector(".mobile-menu"),t=this.shadowRoot?.querySelector(".hamburger-button");a?.classList.remove("open"),t?.setAttribute("aria-expanded","false")}_updateActive(){let a=location.pathname;this.shadowRoot.querySelectorAll("a.navlink").forEach(t=>{let e=t.getAttribute("href")===a||a==="/home"&&t.getAttribute("href")==="/";t.classList.toggle("active",e)})}render(){let a=this.getItems();this.shadowRoot.innerHTML=`
691
+ `,this.shadowRoot.appendChild(a);let t=document.createElement("link");t.rel="stylesheet",t.href=nk,this.shadowRoot.appendChild(t),this._mapContainer=document.createElement("div"),this._mapContainer.className="map-container",this._mapContainer.part="container",this.shadowRoot.appendChild(this._mapContainer)}connectedCallback(){this._initializeMap()}disconnectedCallback(){this._map&&(this._map.remove(),this._map=this._marker=this._mapEl=null)}attributeChangedCallback(a,t,e){t!==e&&this._map&&this._updateMap()}async _geocode(){try{let a=await A.geocodeNominatim(this.address);if(console.log(a),a)return[a.latitude,a.longitude]}catch{}return[50,0]}async _initializeMap(){let a=await pk();if(!this.isConnected)return;this._mapContainer.innerHTML="",this._mapEl=document.createElement("div"),this._mapEl.className="map"+(this.darkMode?" dark-mode":""),this._mapEl.part="map",this._mapContainer.appendChild(this._mapEl);let[t,e]=await this._geocode();if(!this.isConnected)return;this._map=a.map(this._mapEl).setView([t,e],this.zoom),a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(this._map);let r=a.divIcon({className:"",html:'<div style="width:14px;height:14px;background:#3b82f6;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 2px #3b82f6"></div>',iconSize:[14,14],iconAnchor:[7,7],popupAnchor:[0,-12]});this._marker=a.marker([t,e],{icon:r}).addTo(this._map).bindPopup(this.address||"Location"),this.dispatchEvent(new CustomEvent("map-ready",{bubbles:!0,composed:!0,detail:{lat:t,lng:e}}))}async _updateMap(){if(!this._map)return;let[a,t]=await this._geocode();this._map&&(this._map.setView([a,t],this.zoom),this._marker?.setLatLng([a,t]),this._marker?.setPopupContent(this.address||"Location"),this._mapEl&&(this._mapEl.className="map"+(this.darkMode?" dark-mode":"")),this.dispatchEvent(new CustomEvent("map-update",{bubbles:!0,composed:!0,detail:{address:this.address,zoom:this.zoom,darkMode:this.darkMode}})))}get address(){return this.getAttribute("address")||""}set address(a){this.setAttribute("address",a)}get zoom(){return parseInt(this.getAttribute("zoom"))||13}set zoom(a){this.setAttribute("zoom",a.toString())}get darkMode(){return this.hasAttribute("dark-mode")}set darkMode(a){a?this.setAttribute("dark-mode",""):this.removeAttribute("dark-mode")}};customElements.get("ee-map")||customElements.define("ee-map",Z1);var G1=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this._outsideClickHandler=this._handleOutsideClick.bind(this),this._popstateHandler=()=>this._updateActive()}static get observedAttributes(){return["items","logopath"]}attributeChangedCallback(){this.render()}connectedCallback(){this.render(),document.addEventListener("click",this._outsideClickHandler),window.addEventListener("popstate",this._popstateHandler)}disconnectedCallback(){document.removeEventListener("click",this._outsideClickHandler),window.removeEventListener("popstate",this._popstateHandler)}_handleOutsideClick(a){this.contains(a.target)||this._closeMenu()}_closeMenu(){let a=this.shadowRoot?.querySelector(".mobile-menu"),t=this.shadowRoot?.querySelector(".hamburger-button");a?.classList.remove("open"),t?.setAttribute("aria-expanded","false")}_updateActive(){let a=location.pathname;this.shadowRoot.querySelectorAll("a.navlink").forEach(t=>{let e=t.getAttribute("href")===a||a==="/home"&&t.getAttribute("href")==="/";t.classList.toggle("active",e)})}render(){let a=this.getItems(),t=this.getAttribute("logopath");this.shadowRoot.innerHTML=`
692
692
  <style>
693
693
  :host {
694
694
  display: block;
@@ -752,6 +752,12 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
752
752
  stroke: currentColor;
753
753
  }
754
754
 
755
+ .nav-logo img {
756
+ max-height: 1.5rem;
757
+ width: auto;
758
+ display: block;
759
+ }
760
+
755
761
  /* \u2500\u2500 Hamburger (hidden on desktop) \u2500\u2500 */
756
762
  .hamburger-container {
757
763
  display: none;
@@ -877,11 +883,12 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
877
883
 
878
884
  <!-- Desktop nav -->
879
885
  <ul class="nav-desktop" role="list">
880
- ${a.map(r=>`
886
+ ${t?`<li class="nav-logo"><a href="/" class="navlink"><img src="${t}" alt="Logo"></a></li>`:""}
887
+ ${a.map(i=>`
881
888
  <li>
882
- <a class="navlink ${r.active?"active":""}" href="${r.href}">
883
- ${r.icon?`<span class="navlink-icon"><ee-lucide name="${r.icon}"></ee-lucide></span>`:""}
884
- <span class="navlink-text">${r.text}</span>
889
+ <a class="navlink ${i.active?"active":""}" href="${i.href}">
890
+ ${i.icon?`<span class="navlink-icon"><ee-lucide name="${i.icon}"></ee-lucide></span>`:""}
891
+ <span class="navlink-text">${i.text}</span>
885
892
  </a>
886
893
  </li>
887
894
  `).join("")}
@@ -899,13 +906,14 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
899
906
  </button>
900
907
  <div class="mobile-menu" role="menu">
901
908
  <ul role="list">
902
- ${a.map(r=>`
909
+ ${t?`<li class="nav-logo"><a href="/" class="navlink"><img src="${t}" alt="Logo"></a></li>`:""}
910
+ ${a.map(i=>`
903
911
  <li role="none">
904
- <a class="navlink ${r.active?"active":""}" href="${r.href}" role="menuitem">
905
- ${r.icon?`<span class="navlink-icon"><ee-lucide name="${r.icon}"></ee-lucide></span>`:""}
912
+ <a class="navlink ${i.active?"active":""}" href="${i.href}" role="menuitem">
913
+ ${i.icon?`<span class="navlink-icon"><ee-lucide name="${i.icon}"></ee-lucide></span>`:""}
906
914
  <span class="navlink-info">
907
- <span class="navlink-text">${r.text}</span>
908
- ${r.subtitle?`<span class="navlink-subtitle">${r.subtitle}</span>`:""}
915
+ <span class="navlink-text">${i.text}</span>
916
+ ${i.subtitle?`<span class="navlink-subtitle">${i.subtitle}</span>`:""}
909
917
  </span>
910
918
  </a>
911
919
  </li>
@@ -913,7 +921,7 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
913
921
  </ul>
914
922
  </div>
915
923
  </div>
916
- `;let t=this.shadowRoot.querySelector(".hamburger-button"),e=this.shadowRoot.querySelector(".mobile-menu");t?.addEventListener("click",r=>{r.stopPropagation();let i=e.classList.toggle("open");t.setAttribute("aria-expanded",String(i))}),e?.addEventListener("click",()=>this._closeMenu()),this.shadowRoot.addEventListener("click",r=>{r.composedPath().find(s=>s.matches?.("a.navlink"))&&requestAnimationFrame(()=>this._updateActive())})}getItems(){let a=this.getAttribute("items");if(a)try{return JSON.parse(a)}catch(t){return console.warn("Invalid items attribute:",t),[]}return[]}};customElements.get("ee-nav")||customElements.define("ee-nav",G1);var W1=class extends HTMLElement{connectedCallback(){this.style.display=this.style.display||"inline-block",this.style.fontVariantNumeric="tabular-nums",this.style.fontWeight=this.style.fontWeight||"700",this._current=0;let a=this.getAttribute("ee-var");if(a){this._unsub=window.EE.on(a,e=>this.#t(+e));let t=window.EE.get(a);t!==void 0&&this.#t(+t)}else this.hasAttribute("value")&&this.#t(+this.getAttribute("value"))}disconnectedCallback(){this._unsub?.(),this._raf&&cancelAnimationFrame(this._raf)}#a(a){let t=this.getAttribute("format")||"int",e=this.hasAttribute("decimals")?+this.getAttribute("decimals"):t==="float"||t==="percent"?1:0,r;return t==="percent"?r=(a*100).toFixed(e)+"%":t==="comma"?r=Math.round(a).toLocaleString():t==="float"?r=a.toFixed(e):t==="int"?r=String(Math.round(a)):r=t.replace("{v}",e>0?a.toFixed(e):String(Math.round(a))),r}#t(a){if(!Number.isFinite(a))return;let t=+this.getAttribute("duration"),e=Number.isFinite(t)?t:600;if(e<=0){this._current=a,this.textContent=this.#a(a);return}let r=this._current??0,i=performance.now();this._raf&&cancelAnimationFrame(this._raf);let s=d=>{let o=Math.min(1,(d-i)/e),n=1-Math.pow(1-o,3),p=r+(a-r)*n;this._current=p,this.textContent=this.#a(p),o<1?this._raf=requestAnimationFrame(s):this._current=a};this._raf=requestAnimationFrame(s)}};customElements.get("ee-number")||customElements.define("ee-number",W1);var j1=class extends HTMLElement{static get observedAttributes(){return["image","height"]}constructor(){super(),this.attachShadow({mode:"open"}),this._height="500px";let a=document.createElement("style");a.textContent=`
924
+ `;let e=this.shadowRoot.querySelector(".hamburger-button"),r=this.shadowRoot.querySelector(".mobile-menu");e?.addEventListener("click",i=>{i.stopPropagation();let s=r.classList.toggle("open");e.setAttribute("aria-expanded",String(s))}),r?.addEventListener("click",()=>this._closeMenu()),this.shadowRoot.addEventListener("click",i=>{i.composedPath().find(d=>d.matches?.("a.navlink"))&&requestAnimationFrame(()=>this._updateActive())})}getItems(){let a=this.getAttribute("items");if(a)try{return JSON.parse(a)}catch(t){return console.warn("Invalid items attribute:",t),[]}return[]}};customElements.get("ee-nav")||customElements.define("ee-nav",G1);var W1=class extends HTMLElement{connectedCallback(){this.style.display=this.style.display||"inline-block",this.style.fontVariantNumeric="tabular-nums",this.style.fontWeight=this.style.fontWeight||"700",this._current=0;let a=this.getAttribute("ee-var");if(a){this._unsub=window.EE.on(a,e=>this.#t(+e));let t=window.EE.get(a);t!==void 0&&this.#t(+t)}else this.hasAttribute("value")&&this.#t(+this.getAttribute("value"))}disconnectedCallback(){this._unsub?.(),this._raf&&cancelAnimationFrame(this._raf)}#a(a){let t=this.getAttribute("format")||"int",e=this.hasAttribute("decimals")?+this.getAttribute("decimals"):t==="float"||t==="percent"?1:0,r;return t==="percent"?r=(a*100).toFixed(e)+"%":t==="comma"?r=Math.round(a).toLocaleString():t==="float"?r=a.toFixed(e):t==="int"?r=String(Math.round(a)):r=t.replace("{v}",e>0?a.toFixed(e):String(Math.round(a))),r}#t(a){if(!Number.isFinite(a))return;let t=+this.getAttribute("duration"),e=Number.isFinite(t)?t:600;if(e<=0){this._current=a,this.textContent=this.#a(a);return}let r=this._current??0,i=performance.now();this._raf&&cancelAnimationFrame(this._raf);let s=d=>{let o=Math.min(1,(d-i)/e),n=1-Math.pow(1-o,3),p=r+(a-r)*n;this._current=p,this.textContent=this.#a(p),o<1?this._raf=requestAnimationFrame(s):this._current=a};this._raf=requestAnimationFrame(s)}};customElements.get("ee-number")||customElements.define("ee-number",W1);var j1=class extends HTMLElement{static get observedAttributes(){return["image","height"]}constructor(){super(),this.attachShadow({mode:"open"}),this._height="500px";let a=document.createElement("style");a.textContent=`
917
925
  :host {
918
926
  display: block;
919
927
  color: inherit;
@@ -2440,8 +2448,6 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
2440
2448
  .top-item {
2441
2449
  display: flex;
2442
2450
  align-items: center;
2443
- padding: 12px;
2444
- border: 1px solid var(--border, currentColor);
2445
2451
  }
2446
2452
  .rank {
2447
2453
  font-weight: bold;
@@ -2466,8 +2472,6 @@ lucide.createIcons({icons});\``);if(e===void 0)throw new Error("`createIcons()`
2466
2472
  </style>
2467
2473
  <div class="container">
2468
2474
  <div class="top-list">
2469
- <h4>Languages</h4>
2470
- <p>Top 10 spoken languages visiting this website.</p>
2471
2475
  <div id="top-flags-container"></div>
2472
2476
  </div>
2473
2477
  </div>
package/equinox.css CHANGED
@@ -51,6 +51,7 @@ body {
51
51
  margin: 0 auto;
52
52
  background-color: var(--background);
53
53
  padding: var(--padding-md);
54
+ line-height: 1.5;
54
55
  }
55
56
  a {
56
57
  color: var(--links);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meteo28093/equinox-ui",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "A collection of Web Components for building modern UIs",
5
5
  "main": "dist/equinox-ui.esm.js",
6
6
  "module": "dist/equinox-ui.esm.js",