@proximus/lavender-header 2.0.0-alpha.101 → 2.0.0-alpha.102

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.
@@ -14,6 +14,8 @@ export declare class HeaderItem extends WithExtraAttributes {
14
14
  set for(value: string);
15
15
  get checked(): boolean;
16
16
  set checked(value: boolean);
17
+ get current(): boolean;
18
+ set current(value: boolean);
17
19
  get $button(): HTMLButtonElement;
18
20
  get $a(): HTMLAnchorElement;
19
21
  }
package/dist/index.es.js CHANGED
@@ -10,7 +10,7 @@ import "@proximus/lavender-layout";
10
10
  import "@proximus/lavender-container";
11
11
  import "@proximus/lavender-button";
12
12
  import "@proximus/lavender-section";
13
- const Lt = ":host{display:block}:host *{box-sizing:border-box}button,a{display:block;font-family:var(--px-font-family);font-size:var(--px-text-size-label-m-mobile);line-height:var(--px-font-line-height-l);color:var(--px-color-text-neutral-default);text-align:center;cursor:pointer;padding:32px 0;height:100%}button:after,a:after{content:attr(data-label);display:block;height:0;width:auto;visibility:hidden;overflow:hidden;-webkit-user-select:none;user-select:none;pointer-events:none;font-weight:var(--px-font-weight-title)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-mobile);outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default)}button:hover,a:hover{font-weight:var(--px-font-weight-title);color:var(--px-color-background-container-primary-default);padding-block:30px}button{margin:0;border:0;border-bottom:2px solid rgba(0,0,0,0);outline:0;background:inherit}button[aria-expanded=true]{font-weight:var(--px-font-weight-title);color:var(--px-color-background-container-primary-default);border-bottom-color:var(--px-color-background-container-primary-default)}a{text-decoration:none}@media screen and (min-width: 48rem){button,a{font-size:var(--px-text-size-label-m-tablet)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}}@media screen and (min-width: 64.0625rem){button,a{font-size:var(--px-text-size-label-m-laptop)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-laptop);outline-width:var(--px-focus-outline-laptop)}}@media screen and (min-width: 90.0625rem){button,a{font-size:var(--px-text-size-label-m-desktop)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}", at = new CSSStyleSheet();
13
+ const Lt = ":host{display:block}:host *{box-sizing:border-box}button,a{display:block;font-family:var(--px-font-family);font-size:var(--px-text-size-label-m-mobile);line-height:var(--px-font-line-height-l);color:var(--px-color-text-neutral-default);text-align:center;cursor:pointer;padding:32px 0;height:100%}button:after,a:after{content:attr(data-label);display:block;height:0;width:auto;visibility:hidden;overflow:hidden;-webkit-user-select:none;user-select:none;pointer-events:none;font-weight:var(--px-font-weight-title)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-mobile);outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default)}:host([current]) button,button:hover,:host([current]) a,a:hover{font-weight:var(--px-font-weight-title);color:var(--px-color-background-container-primary-default);padding-block:30px}button{margin:0;border:0;border-bottom:2px solid rgba(0,0,0,0);outline:0;background:inherit}button[aria-expanded=true]{font-weight:var(--px-font-weight-title);color:var(--px-color-background-container-primary-default);border-bottom-color:var(--px-color-background-container-primary-default)}a{text-decoration:none}@media screen and (min-width: 48rem){button,a{font-size:var(--px-text-size-label-m-tablet)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}}@media screen and (min-width: 64.0625rem){button,a{font-size:var(--px-text-size-label-m-laptop)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-laptop);outline-width:var(--px-focus-outline-laptop)}}@media screen and (min-width: 90.0625rem){button,a{font-size:var(--px-text-size-label-m-desktop)}button:focus-visible,a:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}", at = new CSSStyleSheet();
14
14
  at.replaceSync(Lt);
15
15
  class Mt extends X {
16
16
  constructor() {
@@ -20,7 +20,7 @@ class Mt extends X {
20
20
  </a>` : `<button data-label="${this.textContent}"><slot></slot></button>`}`, this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [at], this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.role = "listitem", this.internals && (this.internals.role = "listitem");
21
21
  }
22
22
  static get observedAttributes() {
23
- return ["for", "href"];
23
+ return ["for", "href", "current"];
24
24
  }
25
25
  connectedCallback() {
26
26
  this.setAttribute("slot", "header-entries"), this.$button && this.setupButtonA11y(), this.contentObserver = new MutationObserver(() => {
@@ -35,7 +35,7 @@ class Mt extends X {
35
35
  this.contentObserver.disconnect();
36
36
  }
37
37
  attributeChangedCallback(t, e, o) {
38
- super.attributeChangedCallback(t, e, o), t === "href" && this.$a && o ? this.shadowRoot.innerHTML = this.template() : t === "for" && this.$button && o && (this.shadowRoot.innerHTML = this.template(), this.setupButtonA11y());
38
+ super.attributeChangedCallback(t, e, o), t === "href" && e !== o ? this.shadowRoot.innerHTML = this.template() : t === "for" && e !== o && this.$button && (this.shadowRoot.innerHTML = this.template(), this.setupButtonA11y());
39
39
  }
40
40
  setupButtonA11y() {
41
41
  this.$button.ariaExpanded = "false", this.$button.setAttribute("aria-controls", this.for || "");
@@ -57,6 +57,12 @@ class Mt extends X {
57
57
  throw new Error("checked must be a boolean");
58
58
  this.$button && (this.$button.ariaExpanded = `${!!t}`, this.$button.setAttribute("aria-controls", this.for));
59
59
  }
60
+ get current() {
61
+ return this.hasAttribute("current");
62
+ }
63
+ set current(t) {
64
+ t ? this.setAttribute("current", "") : this.removeAttribute("current");
65
+ }
60
66
  get $button() {
61
67
  return this.shadowRoot.querySelector("button");
62
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-header",
3
- "version": "2.0.0-alpha.101",
3
+ "version": "2.0.0-alpha.102",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",