@proximus/lavender-selectablebox 2.0.0-alpha.12 → 2.0.0-alpha.120

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.
@@ -2,6 +2,8 @@ import { WithExtraAttributes } from '@proximus/lavender-common';
2
2
  import '@proximus/lavender-layout';
3
3
  import { SelectableBox } from './SelectableBox';
4
4
  import { type Radio } from '@proximus/lavender-radio-group';
5
+ export declare const SELECTABLE_BOX_RADIO_CONNECTED_EVENT = "px-selectable-box-radio-connected";
6
+ export declare const SELECTABLE_BOX_RADIO_DISCONNECTED_EVENT = "px-selectable-box-radio-disconnected";
5
7
  export declare class SelectableBoxRadio extends WithExtraAttributes {
6
8
  protected internals: ElementInternals;
7
9
  protected template(): string;
@@ -0,0 +1 @@
1
+ export declare function shouldIgnoreSelectableBoxClick(event: MouseEvent, host: HTMLElement, ignoredTags?: string[]): boolean;
package/dist/index.es.js CHANGED
@@ -1,34 +1,38 @@
1
- import { WithExtraAttributes as n, AttributeBreakpointHandlerDelegate as x, 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 A, log as h, backgroundColorValues as y } 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 screen and (max-width: 47.938rem){.flex-container{overflow-x:var(--overflow-x-all-mobile, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media screen and (min-width: 48rem){.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 screen and (min-width: 48rem) and (max-width: 64rem){.flex-container{overflow-x:var(--overflow-x-all-tablet, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media screen and (min-width: 64.0625rem){.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 screen and (min-width: 64.0625rem) and (max-width: 90rem){.flex-container{overflow-x:var(--overflow-x-all-laptop, var(--overflow-x-all))}}@media screen and (min-width: 90.0625rem){.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",
15
15
  "flex-start",
16
+ "start",
16
17
  "flex-end",
18
+ "end",
17
19
  "center",
18
20
  "baseline"
19
- ], C = [
21
+ ], S = [
20
22
  "",
21
23
  "default",
22
24
  "flex-start",
25
+ "start",
23
26
  "flex-end",
27
+ "end",
24
28
  "center",
25
29
  "space-between",
26
30
  "space-around",
27
31
  "space-evenly"
28
- ], $ = ["", "default", "nowrap", "wrap", "wrap-reverse"], S = ["", "visible", "hidden", "scroll", "auto"];
29
- class c extends n {
32
+ ], _ = ["", "default", "nowrap", "wrap", "wrap-reverse"], E = ["", "visible", "hidden", "scroll", "auto"];
33
+ class d extends c {
30
34
  constructor() {
31
- super(h), this.overflowXAttributeDelegate = new x(
35
+ super(b), this.overflowXAttributeDelegate = new m(
32
36
  this,
33
37
  "overflow-x",
34
38
  (t) => t,
@@ -82,7 +86,7 @@ class c extends n {
82
86
  case "gap--tablet":
83
87
  case "gap--laptop":
84
88
  case "gap--desktop":
85
- this.updateFlexProperties(t, e, i, v);
89
+ this.updateFlexProperties(t, e, i, k);
86
90
  break;
87
91
  case "justify-content":
88
92
  case "justify-content--mobile":
@@ -93,7 +97,7 @@ class c extends n {
93
97
  t,
94
98
  e,
95
99
  i,
96
- C
100
+ S
97
101
  );
98
102
  break;
99
103
  case "align-items":
@@ -101,28 +105,28 @@ class c extends n {
101
105
  case "align-items--tablet":
102
106
  case "align-items--laptop":
103
107
  case "align-items--desktop":
104
- this.updateFlexProperties(t, e, i, w);
108
+ this.updateFlexProperties(t, e, i, $);
105
109
  break;
106
110
  case "wrap":
107
111
  case "wrap--mobile":
108
112
  case "wrap--tablet":
109
113
  case "wrap--laptop":
110
114
  case "wrap--desktop":
111
- this.updateFlexProperties(t, e, i, $);
115
+ this.updateFlexProperties(t, e, i, _);
112
116
  break;
113
117
  case "direction":
114
118
  case "direction--mobile":
115
119
  case "direction--tablet":
116
120
  case "direction--laptop":
117
121
  case "direction--desktop":
118
- this.updateFlexProperties(t, e, i, A);
122
+ this.updateFlexProperties(t, e, i, C);
119
123
  break;
120
124
  case "overflow-x":
121
125
  case "overflow-x--mobile":
122
126
  case "overflow-x--tablet":
123
127
  case "overflow-x--laptop":
124
128
  case "overflow-x--desktop":
125
- this.updateOverflowX(t, e, i, S);
129
+ this.updateOverflowX(t, e, i, E);
126
130
  break;
127
131
  default:
128
132
  super.attributeChangedCallback(t, e, i);
@@ -130,8 +134,10 @@ class c extends n {
130
134
  }
131
135
  }
132
136
  updateOverflowX(t, e, i, o) {
133
- if (!m(o, i)) {
134
- console.error(`${i} is not an allowed ${t} value`);
137
+ if (!A(o, i)) {
138
+ h(
139
+ `"${i}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
140
+ );
135
141
  return;
136
142
  }
137
143
  this.overflowXAttributeDelegate.attributeChangedCallback(
@@ -141,22 +147,27 @@ class c extends n {
141
147
  );
142
148
  }
143
149
  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);
150
+ this.checkName(o, i) || h(
151
+ `"${i}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
152
+ );
153
+ const r = t.indexOf("--") > -1, a = r ? t.split("--")[0] : t, l = [];
154
+ if (!r)
155
+ 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) => {
156
+ this.updateStyle(a, n, e, o), this.updateStyle(a, n, i, o);
149
157
  });
150
158
  else {
151
- const l = t.split("--")[1];
152
- this.updateStyle(s, l, e, o), this.updateStyle(s, l, i, o);
159
+ const n = t.split("--")[1];
160
+ this.updateStyle(a, n, e, o), this.updateStyle(a, n, i, o);
153
161
  }
154
162
  }
155
163
  updateStyle(t, e, i, o) {
156
- i && (t === "gap" && o && o.includes(i) ? this.$el.style.setProperty(
164
+ i && (t === "gap" && o && o.includes(i) ? (this.$el.style.setProperty(
157
165
  `--flex-${t}--${e}-value`,
158
166
  `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
159
- ) : this.$el.style.setProperty(
167
+ ), this.style.setProperty(
168
+ `--host-gap--${e}`,
169
+ `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
170
+ )) : this.$el.style.setProperty(
160
171
  `--flex-${t}--${e}-value`,
161
172
  i
162
173
  ));
@@ -345,8 +356,8 @@ class c extends n {
345
356
  return this.shadowRoot.querySelector(".flex-container");
346
357
  }
347
358
  }
348
- customElements.get("px-stack") || customElements.define("px-stack", c);
349
- class _ extends c {
359
+ customElements.get("px-stack") || customElements.define("px-stack", d);
360
+ class L extends d {
350
361
  constructor() {
351
362
  super();
352
363
  }
@@ -354,8 +365,8 @@ class _ extends c {
354
365
  super.connectedCallback(), this.direction = "column", this.directionMobile = "column", this.directionTablet = "column", this.directionLaptop = "column", this.directionDesktop = "column";
355
366
  }
356
367
  }
357
- customElements.get("px-vstack") || customElements.define("px-vstack", _);
358
- class E extends c {
368
+ customElements.get("px-vstack") || customElements.define("px-vstack", L);
369
+ class D extends d {
359
370
  constructor() {
360
371
  super();
361
372
  }
@@ -363,7 +374,7 @@ class E extends c {
363
374
  super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
364
375
  }
365
376
  }
366
- customElements.get("px-hstack") || customElements.define("px-hstack", E);
377
+ customElements.get("px-hstack") || customElements.define("px-hstack", D);
367
378
  class z extends HTMLElement {
368
379
  constructor() {
369
380
  super(), this.isZeroSized = !1, this.growValue = "1", this.isVertical = !1;
@@ -412,11 +423,11 @@ class z extends HTMLElement {
412
423
  }
413
424
  }
414
425
  customElements.get("px-spacer") || customElements.define("px-spacer", z);
415
- 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();
416
- b.replaceSync(L);
417
- class D extends n {
426
+ const j = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5rem}", p = new CSSStyleSheet();
427
+ p.replaceSync(j);
428
+ class R extends c {
418
429
  constructor() {
419
- super(b), this.template = (t) => `
430
+ super(p), this.template = (t) => `
420
431
  <px-container border-radius="none" padding="none">
421
432
  <px-vstack>
422
433
  <px-container id="header-container" border-radius="none">
@@ -593,7 +604,7 @@ class D extends n {
593
604
  case "background-color":
594
605
  this.$bodyContainer.setAttribute(
595
606
  "background-color",
596
- k.indexOf(i) > 0 ? i : "none"
607
+ y.indexOf(i) > 0 ? i : "none"
597
608
  );
598
609
  break;
599
610
  case "padding-vertical":
@@ -613,10 +624,10 @@ class D extends n {
613
624
  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;
614
625
  }
615
626
  }
616
- customElements.get("px-page") === void 0 && customElements.define("px-page", D);
617
- const j = ':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();
618
- p.replaceSync(j);
619
- class R extends n {
627
+ customElements.get("px-page") === void 0 && customElements.define("px-page", R);
628
+ 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-s-mobile);flex-grow:1}.info .info__body .header{display:flex;align-items:center;gap:var(--px-spacing-s-mobile)}.info .info__body .header ::slotted([slot="action"]),.info .info__body .header ::slotted([slot="icon"]),.info .info__body .header ::slotted([slot="logo"]){flex-shrink:0}.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 screen and (min-width: 48rem){.info{flex-direction:column}.info .info__body{flex-basis:auto;gap:var(--px-spacing-default-tablet);padding:var(--px-padding-s-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 screen and (min-width: 64.0625rem){.info .info__body{gap:var(--px-spacing-default-laptop);padding:var(--px-padding-s-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 screen and (min-width: 90.0625rem){.info .info__body{gap:var(--px-spacing-default-desktop);padding:var(--px-padding-s-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();
629
+ u.replaceSync(F);
630
+ class H extends c {
620
631
  template() {
621
632
  return `
622
633
  <div class="selectable-box">
@@ -642,7 +653,7 @@ class R extends n {
642
653
  `;
643
654
  }
644
655
  constructor() {
645
- super(p), this.shadowRoot.innerHTML = this.template();
656
+ super(u), this.shadowRoot.innerHTML = this.template();
646
657
  }
647
658
  static get observedAttributes() {
648
659
  return [...super.observedAttributes, "inverted", "hide-footer"];
@@ -671,19 +682,28 @@ class R extends n {
671
682
  t ? this.setAttribute("hide-footer", "") : this.removeAttribute("hide-footer");
672
683
  }
673
684
  }
674
- customElements.get("px-selectable-box") || customElements.define("px-selectable-box", R);
675
- 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();
676
- g.replaceSync(u);
677
- class F extends n {
685
+ customElements.get("px-selectable-box") || customElements.define("px-selectable-box", H);
686
+ const T = ["px-a", "px-button"];
687
+ function g(s, t, e = T) {
688
+ const i = new Set(e), o = s.composedPath();
689
+ for (const r of o) {
690
+ if (r === t)
691
+ break;
692
+ if (r instanceof Element && i.has(r.tagName.toLowerCase()))
693
+ return !0;
694
+ }
695
+ return !1;
696
+ }
697
+ 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 screen and (min-width: 48rem){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-tablet)}}@media screen and (min-width: 64.0625rem){.selectable-box-checkbox,.selectable-box-radio{outline-width:var(--px-focus-outline-laptop)}}@media screen and (min-width: 90.0625rem){.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();
698
+ f.replaceSync(x);
699
+ class I extends c {
678
700
  template() {
679
701
  return `
680
702
  <div class="selectable-box-checkbox">
681
703
  <px-selectable-box>
682
704
  <slot name="media" slot="media"></slot>
683
705
  <px-checkbox
684
- slot="action" aria-hidden="true" tabindex="-1"
685
- name="${this.name}"
686
- value="${this.value}"
706
+ slot="action" inert
687
707
  ></px-checkbox>
688
708
  <slot name="icon" slot="icon"></slot>
689
709
  <slot name="logo" slot="logo"></slot>
@@ -697,13 +717,13 @@ class F extends n {
697
717
  }
698
718
  constructor() {
699
719
  var t;
700
- 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.role = "checkbox", this.internals && (this.internals.role = "checkbox", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`;
720
+ super(f), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
701
721
  }
702
722
  connectedCallback() {
703
- this.tabIndex = 0, this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
723
+ this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.role = "checkbox", this.internals && (this.internals.role = "checkbox"), this.tabIndex = 0, this.ariaChecked = "false", this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
704
724
  "slotchange",
705
725
  this.toggleFooterVisibility
706
- ), 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);
726
+ ), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent);
707
727
  }
708
728
  static get observedAttributes() {
709
729
  return [
@@ -756,7 +776,7 @@ class F extends n {
756
776
  }
757
777
  }
758
778
  setClickEvent(t) {
759
- this.checked = !this.checked, t.stopPropagation(), t.preventDefault();
779
+ g(t, this) || (this.checked = !this.checked, t.stopPropagation(), t.preventDefault());
760
780
  }
761
781
  toggleFooterVisibility() {
762
782
  this.$slottedFooter ? this.$selectableBox.removeAttribute("hide-footer") : this.$selectableBox.setAttribute("hide-footer", "");
@@ -766,13 +786,13 @@ class F extends n {
766
786
  }
767
787
  handleCheckedAttributeChange(t) {
768
788
  var e;
769
- (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(
789
+ (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(
770
790
  new Event("change", {
771
791
  bubbles: !0,
772
792
  composed: !0
773
793
  // Allow the event to pass through shadow DOM boundaries
774
794
  })
775
- ));
795
+ );
776
796
  }
777
797
  // Form-associated callbacks
778
798
  static get formAssociated() {
@@ -841,19 +861,18 @@ class F extends n {
841
861
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
842
862
  }
843
863
  }
844
- customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", F);
845
- const f = new CSSStyleSheet();
846
- f.replaceSync(u);
847
- class H extends n {
864
+ customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", I);
865
+ const v = new CSSStyleSheet();
866
+ v.replaceSync(x);
867
+ const P = "px-selectable-box-radio-connected", q = "px-selectable-box-radio-disconnected";
868
+ class B extends c {
848
869
  template() {
849
870
  return `
850
871
  <div class="selectable-box-radio">
851
872
  <px-selectable-box>
852
873
  <slot name="media" slot="media"></slot>
853
874
  <px-radio
854
- slot="action" aria-hidden="true" tabindex="-1"
855
- name="${this.name}"
856
- value="${this.value}"
875
+ slot="action" inert
857
876
  ></px-radio>
858
877
  <slot name="icon" slot="icon"></slot>
859
878
  <slot name="logo" slot="logo"></slot>
@@ -867,14 +886,18 @@ class H extends n {
867
886
  }
868
887
  constructor() {
869
888
  var t;
870
- super(f), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this), this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.role = "radio", this.internals && (this.internals.role = "radio", this.internals.ariaChecked = `${this.checked}`), this.ariaChecked = `${this.checked}`;
889
+ super(v), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
871
890
  }
872
891
  connectedCallback() {
873
- var t;
874
- this.tabIndex = ((t = this.parentElement) == null ? void 0 : t.firstElementChild) === this ? 0 : -1, this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
892
+ this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.role = "radio", this.internals && (this.internals.role = "radio"), this.dispatchEvent(
893
+ new CustomEvent(P, {
894
+ bubbles: !0,
895
+ composed: !0
896
+ })
897
+ ), this.ariaChecked = "false", this.toggleFooterVisibility(), this.$slotFooter.addEventListener(
875
898
  "slotchange",
876
899
  this.toggleFooterVisibility
877
- ), 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);
900
+ ), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent);
878
901
  }
879
902
  static get observedAttributes() {
880
903
  return [
@@ -911,7 +934,12 @@ class H extends n {
911
934
  this.$slotFooter.removeEventListener(
912
935
  "slotchange",
913
936
  this.toggleFooterVisibility
914
- ), this.removeEventListener("mouseover", this.setHoverAttribute), this.removeEventListener("mouseout", this.removeHoverAttribute), this.removeEventListener("keypress", this.setKeypressEvent), this.removeEventListener("click", this.setClickEvent);
937
+ ), this.removeEventListener("mouseover", this.setHoverAttribute), this.removeEventListener("mouseout", this.removeHoverAttribute), this.removeEventListener("keypress", this.setKeypressEvent), this.removeEventListener("click", this.setClickEvent), this.dispatchEvent(
938
+ new CustomEvent(q, {
939
+ bubbles: !0,
940
+ composed: !0
941
+ })
942
+ );
915
943
  }
916
944
  removeHoverAttribute() {
917
945
  this.$radio.removeAttribute("hover");
@@ -927,7 +955,7 @@ class H extends n {
927
955
  }
928
956
  }
929
957
  setClickEvent(t) {
930
- this.checked || (this.checked = !0), t.stopPropagation(), t.preventDefault();
958
+ g(t, this) || (this.checked || (this.checked = !0), t.stopPropagation(), t.preventDefault());
931
959
  }
932
960
  toggleFooterVisibility() {
933
961
  this.$slottedFooter ? this.$selectableBox.removeAttribute("hide-footer") : this.$selectableBox.setAttribute("hide-footer", "");
@@ -937,7 +965,7 @@ class H extends n {
937
965
  }
938
966
  handleCheckedAttributeChange(t) {
939
967
  var e;
940
- (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(
968
+ (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(
941
969
  new Event("change", {
942
970
  bubbles: !0,
943
971
  composed: !0
@@ -1012,9 +1040,11 @@ class H extends n {
1012
1040
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
1013
1041
  }
1014
1042
  }
1015
- customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", H);
1043
+ customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", B);
1016
1044
  export {
1017
- R as SelectableBox,
1018
- F as SelectableBoxCheckbox,
1019
- H as SelectableBoxRadio
1045
+ P as SELECTABLE_BOX_RADIO_CONNECTED_EVENT,
1046
+ q as SELECTABLE_BOX_RADIO_DISCONNECTED_EVENT,
1047
+ H as SelectableBox,
1048
+ I as SelectableBoxCheckbox,
1049
+ B as SelectableBoxRadio
1020
1050
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-selectablebox",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.120",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",