@proximus/lavender-selectablebox 2.0.0-alpha.16 → 2.0.0-alpha.160

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 v, gapValues as m, checkName as k, log as h, backgroundColorValues as y } from "@proximus/lavender-common";
2
- const A = ':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))}}', b = new CSSStyleSheet();
3
- b.replaceSync(A);
4
- const w = [
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
- ], C = [
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
- ], $ = [
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
- ], S = ["", "default", "nowrap", "wrap", "wrap-reverse"], _ = ["", "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(b), this.overflowXAttributeDelegate = new v(
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, m);
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
- $
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, C);
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, S);
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, w);
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, _);
129
+ this.updateOverflowX(t, e, i, E);
126
130
  break;
127
131
  default:
128
132
  super.attributeChangedCallback(t, e, i);
@@ -130,9 +134,9 @@ class c extends n {
130
134
  }
131
135
  }
132
136
  updateOverflowX(t, e, i, o) {
133
- if (!k(o, i)) {
137
+ if (!A(o, i)) {
134
138
  h(
135
- `${i} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
139
+ `"${i}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
136
140
  );
137
141
  return;
138
142
  }
@@ -144,23 +148,26 @@ class c extends n {
144
148
  }
145
149
  updateFlexProperties(t, e, i, o) {
146
150
  this.checkName(o, i) || h(
147
- `${i} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
151
+ `"${i}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
148
152
  );
149
- const d = t.indexOf("--") > -1, s = d ? t.split("--")[0] : t, a = [];
150
- if (!d)
151
- 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) => {
152
- this.updateStyle(s, l, e, o), this.updateStyle(s, l, i, o);
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);
153
157
  });
154
158
  else {
155
- const l = t.split("--")[1];
156
- 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);
157
161
  }
158
162
  }
159
163
  updateStyle(t, e, i, o) {
160
- i && (t === "gap" && o && o.includes(i) ? this.$el.style.setProperty(
164
+ i && (t === "gap" && o && o.includes(i) ? (this.$el.style.setProperty(
161
165
  `--flex-${t}--${e}-value`,
162
166
  `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
163
- ) : 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(
164
171
  `--flex-${t}--${e}-value`,
165
172
  i
166
173
  ));
@@ -349,8 +356,8 @@ class c extends n {
349
356
  return this.shadowRoot.querySelector(".flex-container");
350
357
  }
351
358
  }
352
- customElements.get("px-stack") || customElements.define("px-stack", c);
353
- class E extends c {
359
+ customElements.get("px-stack") || customElements.define("px-stack", d);
360
+ class L extends d {
354
361
  constructor() {
355
362
  super();
356
363
  }
@@ -358,8 +365,8 @@ class E extends c {
358
365
  super.connectedCallback(), this.direction = "column", this.directionMobile = "column", this.directionTablet = "column", this.directionLaptop = "column", this.directionDesktop = "column";
359
366
  }
360
367
  }
361
- customElements.get("px-vstack") || customElements.define("px-vstack", E);
362
- class z extends c {
368
+ customElements.get("px-vstack") || customElements.define("px-vstack", L);
369
+ class D extends d {
363
370
  constructor() {
364
371
  super();
365
372
  }
@@ -367,8 +374,8 @@ class z extends c {
367
374
  super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
368
375
  }
369
376
  }
370
- customElements.get("px-hstack") || customElements.define("px-hstack", z);
371
- class L extends HTMLElement {
377
+ customElements.get("px-hstack") || customElements.define("px-hstack", D);
378
+ class z extends HTMLElement {
372
379
  constructor() {
373
380
  super(), this.isZeroSized = !1, this.growValue = "1", this.isVertical = !1;
374
381
  }
@@ -415,10 +422,10 @@ class L extends HTMLElement {
415
422
  t ? this.setAttribute("nogap", "") : this.removeAttribute("nogap");
416
423
  }
417
424
  }
418
- customElements.get("px-spacer") || customElements.define("px-spacer", L);
419
- const D = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5em}", p = new CSSStyleSheet();
420
- p.replaceSync(D);
421
- class j extends n {
425
+ customElements.get("px-spacer") || customElements.define("px-spacer", z);
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 {
422
429
  constructor() {
423
430
  super(p), this.template = (t) => `
424
431
  <px-container border-radius="none" padding="none">
@@ -617,10 +624,10 @@ class j extends n {
617
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;
618
625
  }
619
626
  }
620
- customElements.get("px-page") === void 0 && customElements.define("px-page", j);
621
- 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)}', u = new CSSStyleSheet();
622
- u.replaceSync(R);
623
- class F 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:7 1 0;gap:var(--px-spacing-default-mobile);padding:var(--px-padding-s-mobile)}.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;flex:3 1 0;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{flex:none;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 {
624
631
  template() {
625
632
  return `
626
633
  <div class="selectable-box">
@@ -675,10 +682,21 @@ class F extends n {
675
682
  t ? this.setAttribute("hide-footer", "") : this.removeAttribute("hide-footer");
676
683
  }
677
684
  }
678
- customElements.get("px-selectable-box") || customElements.define("px-selectable-box", F);
679
- const g = ':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)}', f = new CSSStyleSheet();
680
- f.replaceSync(g);
681
- class H 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 {
682
700
  template() {
683
701
  return `
684
702
  <div class="selectable-box-checkbox">
@@ -686,8 +704,6 @@ class H extends n {
686
704
  <slot name="media" slot="media"></slot>
687
705
  <px-checkbox
688
706
  slot="action" inert
689
- name="${this.name}"
690
- value="${this.value}"
691
707
  ></px-checkbox>
692
708
  <slot name="icon" slot="icon"></slot>
693
709
  <slot name="logo" slot="logo"></slot>
@@ -701,13 +717,13 @@ class H extends n {
701
717
  }
702
718
  constructor() {
703
719
  var t;
704
- 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 = "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);
705
721
  }
706
722
  connectedCallback() {
707
- 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(
708
724
  "slotchange",
709
725
  this.toggleFooterVisibility
710
- ), 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);
711
727
  }
712
728
  static get observedAttributes() {
713
729
  return [
@@ -760,7 +776,7 @@ class H extends n {
760
776
  }
761
777
  }
762
778
  setClickEvent(t) {
763
- this.checked = !this.checked, t.stopPropagation(), t.preventDefault();
779
+ g(t, this) || (this.checked = !this.checked, t.stopPropagation(), t.preventDefault());
764
780
  }
765
781
  toggleFooterVisibility() {
766
782
  this.$slottedFooter ? this.$selectableBox.removeAttribute("hide-footer") : this.$selectableBox.setAttribute("hide-footer", "");
@@ -770,13 +786,13 @@ class H extends n {
770
786
  }
771
787
  handleCheckedAttributeChange(t) {
772
788
  var e;
773
- (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(
774
790
  new Event("change", {
775
791
  bubbles: !0,
776
792
  composed: !0
777
793
  // Allow the event to pass through shadow DOM boundaries
778
794
  })
779
- ));
795
+ );
780
796
  }
781
797
  // Form-associated callbacks
782
798
  static get formAssociated() {
@@ -845,10 +861,11 @@ class H extends n {
845
861
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
846
862
  }
847
863
  }
848
- customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", H);
849
- const x = new CSSStyleSheet();
850
- x.replaceSync(g);
851
- class q 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 {
852
869
  template() {
853
870
  return `
854
871
  <div class="selectable-box-radio">
@@ -856,8 +873,6 @@ class q extends n {
856
873
  <slot name="media" slot="media"></slot>
857
874
  <px-radio
858
875
  slot="action" inert
859
- name="${this.name}"
860
- value="${this.value}"
861
876
  ></px-radio>
862
877
  <slot name="icon" slot="icon"></slot>
863
878
  <slot name="logo" slot="logo"></slot>
@@ -871,14 +886,18 @@ class q extends n {
871
886
  }
872
887
  constructor() {
873
888
  var t;
874
- 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.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);
875
890
  }
876
891
  connectedCallback() {
877
- var t;
878
- 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(
879
898
  "slotchange",
880
899
  this.toggleFooterVisibility
881
- ), 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);
882
901
  }
883
902
  static get observedAttributes() {
884
903
  return [
@@ -915,7 +934,12 @@ class q extends n {
915
934
  this.$slotFooter.removeEventListener(
916
935
  "slotchange",
917
936
  this.toggleFooterVisibility
918
- ), 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
+ );
919
943
  }
920
944
  removeHoverAttribute() {
921
945
  this.$radio.removeAttribute("hover");
@@ -931,7 +955,7 @@ class q extends n {
931
955
  }
932
956
  }
933
957
  setClickEvent(t) {
934
- this.checked || (this.checked = !0), t.stopPropagation(), t.preventDefault();
958
+ g(t, this) || (this.checked || (this.checked = !0), t.stopPropagation(), t.preventDefault());
935
959
  }
936
960
  toggleFooterVisibility() {
937
961
  this.$slottedFooter ? this.$selectableBox.removeAttribute("hide-footer") : this.$selectableBox.setAttribute("hide-footer", "");
@@ -941,7 +965,7 @@ class q extends n {
941
965
  }
942
966
  handleCheckedAttributeChange(t) {
943
967
  var e;
944
- (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(
945
969
  new Event("change", {
946
970
  bubbles: !0,
947
971
  composed: !0
@@ -1016,9 +1040,11 @@ class q extends n {
1016
1040
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
1017
1041
  }
1018
1042
  }
1019
- customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", q);
1043
+ customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", B);
1020
1044
  export {
1021
- F as SelectableBox,
1022
- H as SelectableBoxCheckbox,
1023
- q 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
1024
1050
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-selectablebox",
3
- "version": "2.0.0-alpha.16",
3
+ "version": "2.0.0-alpha.160",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",