@proximus/lavender-selectablebox 2.0.0-alpha.6 → 2.0.0-alpha.60

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.
@@ -0,0 +1 @@
1
+ export declare function shouldIgnoreSelectableBoxClick(event: MouseEvent, host: HTMLElement, ignoredTags?: string[]): boolean;
package/dist/index.es.js CHANGED
@@ -1,14 +1,14 @@
1
- import { WithExtraAttributes as n, AttributeBreakpointHandlerDelegate as f, gapValues as v, checkName as m, backgroundColorValues as k } from "@proximus/lavender-common";
2
- const y = ':host{display:block}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile))}.flex-container{display:flex;height:100%;width:100%;box-sizing:border-box;flex-direction:var(--flex-direction--mobile-value);gap:var(--flex-gap--mobile-value);flex-wrap:var(--flex-wrap--mobile-value);justify-content:var(--flex-justify-content--mobile-value);align-items:var(--flex-align-items--mobile-value);overflow-x:var(--overflow-x-all)}@media only screen and (max-width: 47.9375em){.flex-container{overflow-x:var(--overflow-x-all-mobile, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 48em){.flex-container{flex-direction:var(--flex-direction--tablet-value);gap:var(--flex-gap--tablet-value);flex-wrap:var(--flex-wrap--tablet-value);justify-content:var(--flex-justify-content--tablet-value);align-items:var(--flex-align-items--tablet-value)}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet))}}@media only screen and (min-width: 48em) and (max-width: 64em){.flex-container{overflow-x:var(--overflow-x-all-tablet, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 64.0625em){.flex-container{flex-direction:var(--flex-direction--laptop-value);gap:var(--flex-gap--laptop-value);flex-wrap:var(--flex-wrap--laptop-value);justify-content:var(--flex-justify-content--laptop-value);align-items:var(--flex-align-items--laptop-value)}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop))}}@media only screen and (min-width: 64.0625em) and (max-width: 90em){.flex-container{overflow-x:var(--overflow-x-all-laptop, var(--overflow-x-all))}}@media only screen and (min-width: 90.0625em){.flex-container{flex-direction:var(--flex-direction--desktop-value);gap:var(--flex-gap--desktop-value);flex-wrap:var(--flex-wrap--desktop-value);justify-content:var(--flex-justify-content--desktop-value);align-items:var(--flex-align-items--desktop-value);overflow-x:var(--overflow-x-all-desktop, var(--overflow-x-all))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop))}}', h = new CSSStyleSheet();
3
- h.replaceSync(y);
4
- const A = [
1
+ import { WithExtraAttributes as c, AttributeBreakpointHandlerDelegate as m, gapValues as k, checkName as y, log as h, backgroundColorValues as A } from "@proximus/lavender-common";
2
+ const w = ':host{display:block}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-mobile) - var(--host-gap--mobile))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile))}.flex-container{display:flex;height:100%;width:100%;box-sizing:border-box;flex-direction:var(--flex-direction--mobile-value);gap:var(--flex-gap--mobile-value);flex-wrap:var(--flex-wrap--mobile-value);justify-content:var(--flex-justify-content--mobile-value);align-items:var(--flex-align-items--mobile-value);overflow-x:var(--overflow-x-all)}@media only screen and (max-width: 47.9375em){.flex-container{overflow-x:var(--overflow-x-all-mobile, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 48em){.flex-container{flex-direction:var(--flex-direction--tablet-value);gap:var(--flex-gap--tablet-value);flex-wrap:var(--flex-wrap--tablet-value);justify-content:var(--flex-justify-content--tablet-value);align-items:var(--flex-align-items--tablet-value)}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-tablet) - var(--host-gap--tablet))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet))}}@media only screen and (min-width: 48em) and (max-width: 64em){.flex-container{overflow-x:var(--overflow-x-all-tablet, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 64.0625em){.flex-container{flex-direction:var(--flex-direction--laptop-value);gap:var(--flex-gap--laptop-value);flex-wrap:var(--flex-wrap--laptop-value);justify-content:var(--flex-justify-content--laptop-value);align-items:var(--flex-align-items--laptop-value)}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-laptop) - var(--host-gap--laptop))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop))}}@media only screen and (min-width: 64.0625em) and (max-width: 90em){.flex-container{overflow-x:var(--overflow-x-all-laptop, var(--overflow-x-all))}}@media only screen and (min-width: 90.0625em){.flex-container{flex-direction:var(--flex-direction--desktop-value);gap:var(--flex-gap--desktop-value);flex-wrap:var(--flex-wrap--desktop-value);justify-content:var(--flex-justify-content--desktop-value);align-items:var(--flex-align-items--desktop-value);overflow-x:var(--overflow-x-all-desktop, var(--overflow-x-all))}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-desktop) - var(--host-gap--desktop))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop))}}', b = new CSSStyleSheet();
3
+ b.replaceSync(w);
4
+ const C = [
5
5
  "",
6
6
  "default",
7
7
  "row",
8
8
  "row-reverse",
9
9
  "column",
10
10
  "column-reverse"
11
- ], w = [
11
+ ], $ = [
12
12
  "",
13
13
  "default",
14
14
  "stretch",
@@ -16,7 +16,7 @@ const A = [
16
16
  "flex-end",
17
17
  "center",
18
18
  "baseline"
19
- ], $ = [
19
+ ], S = [
20
20
  "",
21
21
  "default",
22
22
  "flex-start",
@@ -25,10 +25,10 @@ const A = [
25
25
  "space-between",
26
26
  "space-around",
27
27
  "space-evenly"
28
- ], C = ["", "default", "nowrap", "wrap", "wrap-reverse"], S = ["", "visible", "hidden", "scroll", "auto"];
29
- class c extends n {
28
+ ], _ = ["", "default", "nowrap", "wrap", "wrap-reverse"], E = ["", "visible", "hidden", "scroll", "auto"];
29
+ class d extends c {
30
30
  constructor() {
31
- super(h), this.overflowXAttributeDelegate = new f(
31
+ super(b), this.overflowXAttributeDelegate = new m(
32
32
  this,
33
33
  "overflow-x",
34
34
  (t) => t,
@@ -82,7 +82,7 @@ class c extends n {
82
82
  case "gap--tablet":
83
83
  case "gap--laptop":
84
84
  case "gap--desktop":
85
- this.updateFlexProperties(t, e, i, v);
85
+ this.updateFlexProperties(t, e, i, k);
86
86
  break;
87
87
  case "justify-content":
88
88
  case "justify-content--mobile":
@@ -93,7 +93,7 @@ class c extends n {
93
93
  t,
94
94
  e,
95
95
  i,
96
- $
96
+ S
97
97
  );
98
98
  break;
99
99
  case "align-items":
@@ -101,28 +101,28 @@ class c extends n {
101
101
  case "align-items--tablet":
102
102
  case "align-items--laptop":
103
103
  case "align-items--desktop":
104
- this.updateFlexProperties(t, e, i, w);
104
+ this.updateFlexProperties(t, e, i, $);
105
105
  break;
106
106
  case "wrap":
107
107
  case "wrap--mobile":
108
108
  case "wrap--tablet":
109
109
  case "wrap--laptop":
110
110
  case "wrap--desktop":
111
- this.updateFlexProperties(t, e, i, C);
111
+ this.updateFlexProperties(t, e, i, _);
112
112
  break;
113
113
  case "direction":
114
114
  case "direction--mobile":
115
115
  case "direction--tablet":
116
116
  case "direction--laptop":
117
117
  case "direction--desktop":
118
- this.updateFlexProperties(t, e, i, A);
118
+ this.updateFlexProperties(t, e, i, C);
119
119
  break;
120
120
  case "overflow-x":
121
121
  case "overflow-x--mobile":
122
122
  case "overflow-x--tablet":
123
123
  case "overflow-x--laptop":
124
124
  case "overflow-x--desktop":
125
- this.updateOverflowX(t, e, i, S);
125
+ this.updateOverflowX(t, e, i, E);
126
126
  break;
127
127
  default:
128
128
  super.attributeChangedCallback(t, e, i);
@@ -130,8 +130,10 @@ class c extends n {
130
130
  }
131
131
  }
132
132
  updateOverflowX(t, e, i, o) {
133
- if (!m(o, i)) {
134
- console.error(`${i} is not an allowed ${t} value`);
133
+ if (!y(o, i)) {
134
+ h(
135
+ `${i} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
136
+ );
135
137
  return;
136
138
  }
137
139
  this.overflowXAttributeDelegate.attributeChangedCallback(
@@ -141,22 +143,27 @@ class c extends n {
141
143
  );
142
144
  }
143
145
  updateFlexProperties(t, e, i, o) {
144
- this.checkName(o, i) || console.error(`${i} is not a valid value for ${o}`);
145
- const d = t.indexOf("--") > -1, s = d ? t.split("--")[0] : t, a = [];
146
- if (!d)
147
- this.getAttribute(s + "--mobile") || a.push("mobile"), this.getAttribute(s + "--tablet") || a.push("tablet"), this.getAttribute(s + "--laptop") || a.push("laptop"), this.getAttribute(s + "--desktop") || a.push("desktop"), a.forEach((l) => {
148
- this.updateStyle(s, l, e, o), this.updateStyle(s, l, i, o);
146
+ this.checkName(o, i) || h(
147
+ `${i} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
148
+ );
149
+ const r = t.indexOf("--") > -1, a = r ? t.split("--")[0] : t, l = [];
150
+ if (!r)
151
+ this.getAttribute(a + "--mobile") || l.push("mobile"), this.getAttribute(a + "--tablet") || l.push("tablet"), this.getAttribute(a + "--laptop") || l.push("laptop"), this.getAttribute(a + "--desktop") || l.push("desktop"), l.forEach((n) => {
152
+ this.updateStyle(a, n, e, o), this.updateStyle(a, n, i, o);
149
153
  });
150
154
  else {
151
- const l = t.split("--")[1];
152
- this.updateStyle(s, l, e, o), this.updateStyle(s, l, i, o);
155
+ const n = t.split("--")[1];
156
+ this.updateStyle(a, n, e, o), this.updateStyle(a, n, i, o);
153
157
  }
154
158
  }
155
159
  updateStyle(t, e, i, o) {
156
- i && (t === "gap" && o && o.includes(i) ? this.$el.style.setProperty(
160
+ i && (t === "gap" && o && o.includes(i) ? (this.$el.style.setProperty(
157
161
  `--flex-${t}--${e}-value`,
158
162
  `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
159
- ) : this.$el.style.setProperty(
163
+ ), this.style.setProperty(
164
+ `--host-gap--${e}`,
165
+ `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
166
+ )) : this.$el.style.setProperty(
160
167
  `--flex-${t}--${e}-value`,
161
168
  i
162
169
  ));
@@ -345,8 +352,8 @@ class c extends n {
345
352
  return this.shadowRoot.querySelector(".flex-container");
346
353
  }
347
354
  }
348
- customElements.get("px-stack") || customElements.define("px-stack", c);
349
- class _ extends c {
355
+ customElements.get("px-stack") || customElements.define("px-stack", d);
356
+ class L extends d {
350
357
  constructor() {
351
358
  super();
352
359
  }
@@ -354,8 +361,8 @@ class _ extends c {
354
361
  super.connectedCallback(), this.direction = "column", this.directionMobile = "column", this.directionTablet = "column", this.directionLaptop = "column", this.directionDesktop = "column";
355
362
  }
356
363
  }
357
- customElements.get("px-vstack") || customElements.define("px-vstack", _);
358
- class E extends c {
364
+ customElements.get("px-vstack") || customElements.define("px-vstack", L);
365
+ class z extends d {
359
366
  constructor() {
360
367
  super();
361
368
  }
@@ -363,25 +370,21 @@ class E extends c {
363
370
  super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
364
371
  }
365
372
  }
366
- customElements.get("px-hstack") || customElements.define("px-hstack", E);
367
- class z extends HTMLElement {
373
+ customElements.get("px-hstack") || customElements.define("px-hstack", z);
374
+ class D extends HTMLElement {
368
375
  constructor() {
369
- super(), this.isZeroSized = !1, this.growValue = "1";
376
+ super(), this.isZeroSized = !1, this.growValue = "1", this.isVertical = !1;
370
377
  }
371
378
  static get observedAttributes() {
372
- return ["grow"];
379
+ return ["grow", "nogap"];
373
380
  }
374
381
  attributeChangedCallback(t, e, i) {
375
382
  t === "grow" && (this.growValue = i || "1", this.isZeroSized || (this.style.flexGrow = this.growValue), this.scheduleRecheck());
376
383
  }
377
384
  connectedCallback() {
378
- this.growValue = this.getAttribute("grow") || "1", this.style.flexGrow = this.growValue, this.resizeObserver = new ResizeObserver((t) => {
379
- t.forEach((e) => {
380
- this.handleSizeChange(
381
- e.contentRect.width === 0 || e.contentRect.height === 0
382
- );
383
- });
384
- }), this.resizeObserver.observe(this), this.scheduleRecheck();
385
+ this.growValue = this.getAttribute("grow") || "1", this.style.flexGrow = this.growValue, this.nogap && (this.resizeObserver = new ResizeObserver(() => {
386
+ this.handleSizeChange();
387
+ }), this.isVertical = this.parentElement.localName === "px-vstack" || this.parentElement.style.flexDirection === "column", this.resizeObserver.observe(this), this.scheduleRecheck());
385
388
  }
386
389
  disconnectedCallback() {
387
390
  var t;
@@ -399,25 +402,28 @@ class z extends HTMLElement {
399
402
  });
400
403
  }
401
404
  recalculateVisibility() {
402
- if (!this.isConnected)
403
- return;
404
- this.style.display = "", this.style.flexGrow = this.growValue;
405
- const t = this.getBoundingClientRect(), e = t.width === 0 || t.height === 0;
406
- this.handleSizeChange(e);
405
+ this.isConnected && (this.style.display = "", this.style.flexGrow = this.growValue, this.handleSizeChange());
407
406
  }
408
- handleSizeChange(t) {
409
- this.isZeroSized !== t && (this.isZeroSized = t, this.updateParticipation());
407
+ handleSizeChange() {
408
+ const t = this.getBoundingClientRect(), e = t.width === 0 && !this.isVertical || t.height === 0 && this.isVertical;
409
+ this.isZeroSized !== e && (this.isZeroSized = e, this.updateParticipation());
410
410
  }
411
411
  updateParticipation() {
412
412
  this.isZeroSized ? (this.style.display = "none", this.style.flexGrow = "0") : (this.style.display = "", this.style.flexGrow = this.growValue);
413
413
  }
414
+ get nogap() {
415
+ return this.hasAttribute("nogap");
416
+ }
417
+ set nogap(t) {
418
+ t ? this.setAttribute("nogap", "") : this.removeAttribute("nogap");
419
+ }
414
420
  }
415
- customElements.get("px-spacer") || customElements.define("px-spacer", z);
416
- const L = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5em}", b = new CSSStyleSheet();
417
- b.replaceSync(L);
418
- class j extends n {
421
+ customElements.get("px-spacer") || customElements.define("px-spacer", D);
422
+ const j = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5em}", p = new CSSStyleSheet();
423
+ p.replaceSync(j);
424
+ class R extends c {
419
425
  constructor() {
420
- super(b), this.template = (t) => `
426
+ super(p), this.template = (t) => `
421
427
  <px-container border-radius="none" padding="none">
422
428
  <px-vstack>
423
429
  <px-container id="header-container" border-radius="none">
@@ -594,7 +600,7 @@ class j extends n {
594
600
  case "background-color":
595
601
  this.$bodyContainer.setAttribute(
596
602
  "background-color",
597
- k.indexOf(i) > 0 ? i : "none"
603
+ A.indexOf(i) > 0 ? i : "none"
598
604
  );
599
605
  break;
600
606
  case "padding-vertical":
@@ -614,10 +620,10 @@ class j extends n {
614
620
  this.$headerContainer.paddingLeft = t, this.$headerContainer.paddingRight = t, this.$bodyContainer.paddingLeft = t, this.$bodyContainer.paddingRight = t, this.$contactContainer.paddingLeft = t, this.$contactContainer.paddingRight = t, this.$footerContainer.paddingLeft = t, this.$footerContainer.paddingRight = t, this.$imageContainer.paddingLeft = t, this.$imageContainer.paddingRight = t;
615
621
  }
616
622
  }
617
- customElements.get("px-page") === void 0 && customElements.define("px-page", j);
618
- const R = ':host{display:block;font-family:var(--px-font-family);font-size:var(--px-font-size-base)}:host *{box-sizing:border-box}.selectable-box{display:flex;flex-direction:column;height:100%}::slotted([slot="media"]){width:100%;height:auto}.info{display:flex;flex-grow:1}.info .info__body{display:flex;flex-direction:column;flex-basis:80%;gap:var(--px-spacing-default-mobile);padding:var(--px-padding-m-mobile);flex-grow:1}.info .info__body .header{display:flex;align-items:center;gap:var(--px-spacing-s-mobile)}.info .info__body .header .titles{display:flex;flex-direction:column;gap:var(--px-spacing-xs-mobile)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-mobile);font-weight:var(--px-font-weight-title);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-neutral-default);flex-grow:1}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-mobile);font-weight:var(--px-font-weight-body);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-dimmed-default);flex-grow:1}.info .info__body ::slotted([slot="content"]){color:var(--px-color-text-neutral-default)}.info .info__footer{display:flex;align-items:center;padding:var(--px-padding-s-mobile);background:var(--px-color-background-container-default-default);text-align:center}:host([hide-footer]) .info .info__body{flex-basis:auto}:host([hide-footer]) .info__footer{display:none}@media only screen and (min-width: 48em){.info{flex-direction:column}.info .info__body{flex-basis:auto;gap:var(--px-spacing-default-tablet);padding:var(--px-padding-m-tablet)}.info .info__body .header{gap:var(--px-spacing-s-tablet)}.info .info__body .header .titles{gap:var(--px-spacing-xs-tablet)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-tablet)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-tablet)}.info .info__footer{justify-content:center;padding:var(--px-padding-s-tablet)}}@media only screen and (min-width: 64.0625em){.info .info__body{gap:var(--px-spacing-default-laptop);padding:var(--px-padding-m-laptop)}.info .info__body .header{gap:var(--px-spacing-s-laptop)}.info .info__body .header .titles{gap:var(--px-spacing-xs-laptop)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-laptop)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-laptop)}.info .info__footer{padding:var(--px-padding-s-laptop)}}@media only screen and (min-width: 90.0625em){.info .info__body{gap:var(--px-spacing-default-desktop);padding:var(--px-padding-m-desktop)}.info .info__body .header{gap:var(--px-spacing-s-desktop)}.info .info__body .header .titles{gap:var(--px-spacing-xs-desktop)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-desktop)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-desktop)}.info .info__footer{padding:var(--px-padding-s-desktop)}}:host([inverted]) .info .info__body .header .titles ::slotted([slot="title"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .info .info__body .header .titles ::slotted([slot="description"]){color:var(--px-color-text-dimmed-inverted)}:host([inverted]) .info .info__body ::slotted([slot="content"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .info .info__footer{background:var(--px-color-background-container-default-inverted)}', p = new CSSStyleSheet();
619
- p.replaceSync(R);
620
- class D extends n {
623
+ customElements.get("px-page") === void 0 && customElements.define("px-page", R);
624
+ const F = ':host{display:block;font-family:var(--px-font-family);font-size:var(--px-font-size-base)}:host *{box-sizing:border-box}.selectable-box{display:flex;flex-direction:column;height:100%}::slotted([slot="media"]){width:100%;height:auto}.info{display:flex;flex-grow:1}.info .info__body{display:flex;flex-direction:column;flex-basis:80%;gap:var(--px-spacing-default-mobile);padding:var(--px-padding-m-mobile);flex-grow:1}.info .info__body .header{display:flex;align-items:center;gap:var(--px-spacing-s-mobile)}.info .info__body .header .titles{display:flex;flex-direction:column;gap:var(--px-spacing-xs-mobile)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-mobile);font-weight:var(--px-font-weight-title);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-neutral-default);flex-grow:1}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-mobile);font-weight:var(--px-font-weight-body);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-dimmed-default);flex-grow:1}.info .info__body ::slotted([slot="content"]){color:var(--px-color-text-neutral-default)}.info .info__footer{display:flex;align-items:center;padding:var(--px-padding-s-mobile);background:var(--px-color-background-container-default-default);text-align:center}:host([hide-footer]) .info .info__body{flex-basis:auto}:host([hide-footer]) .info__footer{display:none}@media only screen and (min-width: 48em){.info{flex-direction:column}.info .info__body{flex-basis:auto;gap:var(--px-spacing-default-tablet);padding:var(--px-padding-m-tablet)}.info .info__body .header{gap:var(--px-spacing-s-tablet)}.info .info__body .header .titles{gap:var(--px-spacing-xs-tablet)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-tablet)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-tablet)}.info .info__footer{justify-content:center;padding:var(--px-padding-s-tablet)}}@media only screen and (min-width: 64.0625em){.info .info__body{gap:var(--px-spacing-default-laptop);padding:var(--px-padding-m-laptop)}.info .info__body .header{gap:var(--px-spacing-s-laptop)}.info .info__body .header .titles{gap:var(--px-spacing-xs-laptop)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-laptop)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-laptop)}.info .info__footer{padding:var(--px-padding-s-laptop)}}@media only screen and (min-width: 90.0625em){.info .info__body{gap:var(--px-spacing-default-desktop);padding:var(--px-padding-m-desktop)}.info .info__body .header{gap:var(--px-spacing-s-desktop)}.info .info__body .header .titles{gap:var(--px-spacing-xs-desktop)}.info .info__body .header .titles ::slotted([slot="title"]){font-size:var(--px-text-size-label-m-desktop)}.info .info__body .header .titles ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-desktop)}.info .info__footer{padding:var(--px-padding-s-desktop)}}:host([inverted]) .info .info__body .header .titles ::slotted([slot="title"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .info .info__body .header .titles ::slotted([slot="description"]){color:var(--px-color-text-dimmed-inverted)}:host([inverted]) .info .info__body ::slotted([slot="content"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .info .info__footer{background:var(--px-color-background-container-default-inverted)}', u = new CSSStyleSheet();
625
+ u.replaceSync(F);
626
+ class H extends c {
621
627
  template() {
622
628
  return `
623
629
  <div class="selectable-box">
@@ -643,7 +649,7 @@ class D extends n {
643
649
  `;
644
650
  }
645
651
  constructor() {
646
- super(p), this.shadowRoot.innerHTML = this.template();
652
+ super(u), this.shadowRoot.innerHTML = this.template();
647
653
  }
648
654
  static get observedAttributes() {
649
655
  return [...super.observedAttributes, "inverted", "hide-footer"];
@@ -672,19 +678,28 @@ class D extends n {
672
678
  t ? this.setAttribute("hide-footer", "") : this.removeAttribute("hide-footer");
673
679
  }
674
680
  }
675
- customElements.get("px-selectable-box") || customElements.define("px-selectable-box", D);
676
- const u = ':host{display:block;outline:none}:host *{box-sizing:border-box}.selectable-box-checkbox,.selectable-box-radio{box-sizing:border-box;height:100%;cursor:pointer;border-radius:var(--px-radius-main);overflow:hidden;--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition);border:var(--px-size-border-m) solid var(--px-color-border-main-default);outline-color:var(--px-color-border-focus-outline-default);outline-width:var(--px-focus-outline-mobile)}.selectable-box-checkbox px-selectable-box,.selectable-box-radio px-selectable-box{height:100%;background-color:var(--px-color-background-container-light-default)}:host(:not([disabled])):host(:hover) .selectable-box-checkbox,:host(:not([disabled])):host(:hover) .selectable-box-radio{border-color:var(--px-color-border-state-hover-default)}:host(:not([disabled])):host(:hover) .selectable-box-checkbox px-selectable-box,:host(:not([disabled])):host(:hover) .selectable-box-radio px-selectable-box{background-color:var( --px-color-background-state-hover-bordered-default )}:host(:not([disabled])):host(:focus-visible) .selectable-box-checkbox,:host(:not([disabled])):host(:focus-visible) .selectable-box-radio{outline-offset:var(--px-focus-offset-mobile);outline-style:solid}:host([checked]) .selectable-box-checkbox,:host([checked]) .selectable-box-radio{border-color:var(--px-color-border-state-active-default)}:host([disabled]) .selectable-box-checkbox,:host([disabled]) .selectable-box-radio{cursor:default;pointer-events:none;border-color:transparent}:host([disabled]) .selectable-box-checkbox px-selectable-box,:host([disabled]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-state-disabled-default)}:host([disabled]) ::slotted([slot="title"]),:host([disabled]) ::slotted([slot="description"]),:host([disabled]) ::slotted([slot="content"]){color:var(--px-color-text-state-disabled-default)}@media only screen and (min-width: 48em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 64.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-laptop)}}@media only screen and (min-width: 90.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-desktop)}}:host([inverted]) .selectable-box-checkbox,:host([inverted]) .selectable-box-radio{border-color:var(--px-color-border-main-inverted);outline-color:var(--px-color-border-focus-outline-inverted)}:host([inverted]) .selectable-box-checkbox px-selectable-box,:host([inverted]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-container-light-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-checkbox,:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-radio{border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-checkbox px-selectable-box,:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-radio px-selectable-box{background-color:var( --px-color-background-state-hover-bordered-inverted )}:host([inverted]):host([checked]) .selectable-box-checkbox,:host([inverted]):host([checked]) .selectable-box-radio{border-color:var(--px-color-border-state-active-inverted)}:host([inverted]):host([disabled]) .selectable-box-checkbox,:host([inverted]):host([disabled]) .selectable-box-radio{border-color:transparent}:host([inverted]):host([disabled]) .selectable-box-checkbox px-selectable-box,:host([inverted]):host([disabled]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-state-disabled-inverted)}:host([inverted]):host([disabled]) ::slotted([slot="title"]),:host([inverted]):host([disabled]) ::slotted([slot="description"]),:host([inverted]):host([disabled]) ::slotted([slot="content"]){color:var(--px-color-text-state-disabled-inverted)}', g = new CSSStyleSheet();
677
- g.replaceSync(u);
678
- class F extends n {
681
+ customElements.get("px-selectable-box") || customElements.define("px-selectable-box", H);
682
+ const P = ["px-a", "px-button"];
683
+ function g(s, t, e = P) {
684
+ const i = new Set(e), o = s.composedPath();
685
+ for (const r of o) {
686
+ if (r === t)
687
+ break;
688
+ if (r instanceof Element && i.has(r.tagName.toLowerCase()))
689
+ return !0;
690
+ }
691
+ return !1;
692
+ }
693
+ const x = ':host{display:block;outline:none}:host *{box-sizing:border-box}.selectable-box-checkbox,.selectable-box-radio{box-sizing:border-box;height:100%;cursor:pointer;border-radius:var(--px-radius-main);overflow:hidden;--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition);border:var(--px-size-border-m) solid var(--px-color-border-main-default);outline-color:var(--px-color-border-focus-outline-default);outline-width:var(--px-focus-outline-mobile)}.selectable-box-checkbox px-selectable-box,.selectable-box-radio px-selectable-box{height:100%;background-color:var(--px-color-background-container-light-default)}:host([parent-has-anchor-full]) .selectable-box-checkbox,:host([parent-has-anchor-full]) .selectable-box-radio{border-radius:0 0 var(--px-radius-main) var(--px-radius-main)}:host(:not([disabled])):host(:hover) .selectable-box-checkbox,:host(:not([disabled])):host(:hover) .selectable-box-radio{border-color:var(--px-color-border-state-hover-default)}:host(:not([disabled])):host(:hover) .selectable-box-checkbox px-selectable-box,:host(:not([disabled])):host(:hover) .selectable-box-radio px-selectable-box{background-color:var( --px-color-background-state-hover-bordered-default )}:host(:not([disabled])):host(:focus-visible) .selectable-box-checkbox,:host(:not([disabled])):host(:focus-visible) .selectable-box-radio{outline-offset:var(--px-focus-offset-mobile);outline-style:solid}:host([checked]) .selectable-box-checkbox,:host([checked]) .selectable-box-radio{border-color:var(--px-color-border-state-active-default)}:host([disabled]) .selectable-box-checkbox,:host([disabled]) .selectable-box-radio{cursor:default;pointer-events:none;border-color:transparent}:host([disabled]) .selectable-box-checkbox px-selectable-box,:host([disabled]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-state-disabled-default)}:host([disabled]) ::slotted([slot="title"]),:host([disabled]) ::slotted([slot="description"]),:host([disabled]) ::slotted([slot="content"]){color:var(--px-color-text-state-disabled-default)}@media only screen and (min-width: 48em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 64.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-laptop)}}@media only screen and (min-width: 90.0625em){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-desktop)}}:host([inverted]) .selectable-box-checkbox,:host([inverted]) .selectable-box-radio{border-color:var(--px-color-border-main-inverted);outline-color:var(--px-color-border-focus-outline-inverted)}:host([inverted]) .selectable-box-checkbox px-selectable-box,:host([inverted]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-container-light-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-checkbox,:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-radio{border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-checkbox px-selectable-box,:host([inverted]):host(:not([disabled])):host(:hover) .selectable-box-radio px-selectable-box{background-color:var( --px-color-background-state-hover-bordered-inverted )}:host([inverted]):host([checked]) .selectable-box-checkbox,:host([inverted]):host([checked]) .selectable-box-radio{border-color:var(--px-color-border-state-active-inverted)}:host([inverted]):host([disabled]) .selectable-box-checkbox,:host([inverted]):host([disabled]) .selectable-box-radio{border-color:transparent}:host([inverted]):host([disabled]) .selectable-box-checkbox px-selectable-box,:host([inverted]):host([disabled]) .selectable-box-radio px-selectable-box{background-color:var(--px-color-background-state-disabled-inverted)}:host([inverted]):host([disabled]) ::slotted([slot="title"]),:host([inverted]):host([disabled]) ::slotted([slot="description"]),:host([inverted]):host([disabled]) ::slotted([slot="content"]){color:var(--px-color-text-state-disabled-inverted)}', f = new CSSStyleSheet();
694
+ f.replaceSync(x);
695
+ class q extends c {
679
696
  template() {
680
697
  return `
681
698
  <div class="selectable-box-checkbox">
682
699
  <px-selectable-box>
683
700
  <slot name="media" slot="media"></slot>
684
701
  <px-checkbox
685
- slot="action" aria-hidden="true" tabindex="-1"
686
- name="${this.name}"
687
- value="${this.value}"
702
+ slot="action" inert
688
703
  ></px-checkbox>
689
704
  <slot name="icon" slot="icon"></slot>
690
705
  <slot name="logo" slot="logo"></slot>
@@ -698,10 +713,10 @@ class F extends n {
698
713
  }
699
714
  constructor() {
700
715
  var t;
701
- super(g), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`);
716
+ super(f), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
702
717
  }
703
718
  connectedCallback() {
704
- this.tabIndex = 0, this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
719
+ this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.name && this.$checkbox.setAttribute("name", this.name), this.value && this.$checkbox.setAttribute("value", this.value), this.role = "checkbox", this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.tabIndex = 0, this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
705
720
  "slotchange",
706
721
  this.toggleFooterVisibility
707
722
  ), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent), this.hasAttribute("checked") && (this.checked = !0);
@@ -757,17 +772,17 @@ class F extends n {
757
772
  }
758
773
  }
759
774
  setClickEvent(t) {
760
- this.checked = !this.checked, t.stopPropagation(), t.preventDefault();
775
+ g(t, this) || (this.checked = !this.checked, t.stopPropagation(), t.preventDefault());
761
776
  }
762
777
  toggleFooterVisibility() {
763
778
  this.$slottedFooter ? this.$selectableBox.removeAttribute("hide-footer") : this.$selectableBox.setAttribute("hide-footer", "");
764
779
  }
765
780
  handleDisabledAttributeChange(t) {
766
- t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.$checkbox.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.$checkbox.removeAttribute("disabled"));
781
+ t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.ariaDisabled = "true", this.$checkbox.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.ariaDisabled = "false", this.$checkbox.removeAttribute("disabled"));
767
782
  }
768
783
  handleCheckedAttributeChange(t) {
769
784
  var e;
770
- (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.checked = !1, this.$checkbox && this.$checkbox.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.checked = !0, this.$checkbox && this.$checkbox.setAttribute("checked", ""), this.dispatchEvent(
785
+ (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.checked = !1, this.$checkbox && this.$checkbox.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.checked = !0, this.$checkbox && this.$checkbox.setAttribute("checked", ""), this.dispatchEvent(
771
786
  new Event("change", {
772
787
  bubbles: !0,
773
788
  composed: !0
@@ -842,19 +857,17 @@ class F extends n {
842
857
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
843
858
  }
844
859
  }
845
- customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", F);
846
- const x = new CSSStyleSheet();
847
- x.replaceSync(u);
848
- class H extends n {
860
+ customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", q);
861
+ const v = new CSSStyleSheet();
862
+ v.replaceSync(x);
863
+ class I extends c {
849
864
  template() {
850
865
  return `
851
866
  <div class="selectable-box-radio">
852
867
  <px-selectable-box>
853
868
  <slot name="media" slot="media"></slot>
854
869
  <px-radio
855
- slot="action" aria-hidden="true" tabindex="-1"
856
- name="${this.name}"
857
- value="${this.value}"
870
+ slot="action" inert
858
871
  ></px-radio>
859
872
  <slot name="icon" slot="icon"></slot>
860
873
  <slot name="logo" slot="logo"></slot>
@@ -868,11 +881,11 @@ class H extends n {
868
881
  }
869
882
  constructor() {
870
883
  var t;
871
- super(x), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`);
884
+ super(v), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
872
885
  }
873
886
  connectedCallback() {
874
887
  var t;
875
- this.tabIndex = ((t = this.parentElement) == null ? void 0 : t.firstElementChild) === this ? 0 : -1, this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
888
+ this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.name && this.$radio.setAttribute("name", this.name), this.value && this.$radio.setAttribute("value", this.value), this.role = "radio", this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`, this.tabIndex = ((t = this.parentElement) == null ? void 0 : t.querySelector("px-selectable-box-radio")) === this ? 0 : -1, this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
876
889
  "slotchange",
877
890
  this.toggleFooterVisibility
878
891
  ), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent), this.hasAttribute("checked") && (this.checked = !0);
@@ -928,17 +941,17 @@ class H extends n {
928
941
  }
929
942
  }
930
943
  setClickEvent(t) {
931
- this.checked || (this.checked = !0), t.stopPropagation(), t.preventDefault();
944
+ g(t, this) || (this.checked || (this.checked = !0), t.stopPropagation(), t.preventDefault());
932
945
  }
933
946
  toggleFooterVisibility() {
934
947
  this.$slottedFooter ? this.$selectableBox.removeAttribute("hide-footer") : this.$selectableBox.setAttribute("hide-footer", "");
935
948
  }
936
949
  handleDisabledAttributeChange(t) {
937
- t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.$radio.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.$radio.removeAttribute("disabled"));
950
+ t ? (this.disabled = !0, this.internals && (this.internals.ariaDisabled = "true"), this.ariaDisabled = "true", this.$radio.setAttribute("disabled", "")) : (this.disabled = !1, this.internals && (this.internals.ariaDisabled = "false"), this.ariaDisabled = "false", this.$radio.removeAttribute("disabled"));
938
951
  }
939
952
  handleCheckedAttributeChange(t) {
940
953
  var e;
941
- (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.tabIndex = -1, this.checked = !1, this.$radio && this.$radio.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.tabIndex = 0, this.checked = !0, this.$radio && this.$radio.setAttribute("checked", ""), this.dispatchEvent(
954
+ (e = this.internals) == null || e.setFormValue(this.formData()), t === null ? (this.internals && (this.internals.ariaChecked = "false"), this.ariaChecked = "false", this.tabIndex = -1, this.checked = !1, this.$radio && this.$radio.removeAttribute("checked")) : (this.internals && (this.internals.ariaChecked = "true"), this.ariaChecked = "true", this.tabIndex = 0, this.checked = !0, this.$radio && this.$radio.setAttribute("checked", ""), this.dispatchEvent(
942
955
  new Event("change", {
943
956
  bubbles: !0,
944
957
  composed: !0
@@ -1013,9 +1026,9 @@ class H extends n {
1013
1026
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
1014
1027
  }
1015
1028
  }
1016
- customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", H);
1029
+ customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", I);
1017
1030
  export {
1018
- D as SelectableBox,
1019
- F as SelectableBoxCheckbox,
1020
- H as SelectableBoxRadio
1031
+ H as SelectableBox,
1032
+ q as SelectableBoxCheckbox,
1033
+ I as SelectableBoxRadio
1021
1034
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-selectablebox",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.60",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",