@proximus/lavender-selectablebox 1.3.0-alpha.1 → 1.3.0-beta.1

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.
Files changed (2) hide show
  1. package/dist/index.es.js +76 -97
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
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);
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))}}', b = new CSSStyleSheet();
3
+ b.replaceSync(y);
4
4
  const A = [
5
5
  "",
6
6
  "default",
@@ -28,7 +28,7 @@ const A = [
28
28
  ], C = ["", "default", "nowrap", "wrap", "wrap-reverse"], S = ["", "visible", "hidden", "scroll", "auto"];
29
29
  class c extends n {
30
30
  constructor() {
31
- super(h), this.overflowXAttributeDelegate = new f(
31
+ super(b), this.overflowXAttributeDelegate = new f(
32
32
  this,
33
33
  "overflow-x",
34
34
  (t) => t,
@@ -75,14 +75,14 @@ class c extends n {
75
75
  "overflow-x--desktop"
76
76
  ];
77
77
  }
78
- attributeChangedCallback(t, e, i) {
78
+ attributeChangedCallback(t, i, e) {
79
79
  switch (t) {
80
80
  case "gap":
81
81
  case "gap--mobile":
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, i, e, v);
86
86
  break;
87
87
  case "justify-content":
88
88
  case "justify-content--mobile":
@@ -91,8 +91,8 @@ class c extends n {
91
91
  case "justify-content--desktop":
92
92
  this.updateFlexProperties(
93
93
  t,
94
- e,
95
94
  i,
95
+ e,
96
96
  $
97
97
  );
98
98
  break;
@@ -101,64 +101,64 @@ 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, i, e, w);
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, i, e, C);
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, i, e, A);
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, i, e, S);
126
126
  break;
127
127
  default:
128
- super.attributeChangedCallback(t, e, i);
128
+ super.attributeChangedCallback(t, i, e);
129
129
  break;
130
130
  }
131
131
  }
132
- updateOverflowX(t, e, i, o) {
133
- if (!m(o, i)) {
134
- console.error(`${i} is not an allowed ${t} value`);
132
+ updateOverflowX(t, i, e, o) {
133
+ if (!m(o, e)) {
134
+ console.error(`${e} is not an allowed ${t} value`);
135
135
  return;
136
136
  }
137
137
  this.overflowXAttributeDelegate.attributeChangedCallback(
138
138
  t,
139
- e,
140
- i
139
+ i,
140
+ e
141
141
  );
142
142
  }
143
- updateFlexProperties(t, e, i, o) {
144
- this.checkName(o, i) || console.error(`${i} is not a valid value for ${o}`);
143
+ updateFlexProperties(t, i, e, o) {
144
+ this.checkName(o, e) || console.error(`${e} is not a valid value for ${o}`);
145
145
  const d = t.indexOf("--") > -1, s = d ? t.split("--")[0] : t, a = [];
146
146
  if (!d)
147
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);
148
+ this.updateStyle(s, l, i, o), this.updateStyle(s, l, e, o);
149
149
  });
150
150
  else {
151
151
  const l = t.split("--")[1];
152
- this.updateStyle(s, l, e, o), this.updateStyle(s, l, i, o);
152
+ this.updateStyle(s, l, i, o), this.updateStyle(s, l, e, o);
153
153
  }
154
154
  }
155
- updateStyle(t, e, i, o) {
156
- i && (t === "gap" && o && o.includes(i) ? this.$el.style.setProperty(
157
- `--flex-${t}--${e}-value`,
158
- `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
155
+ updateStyle(t, i, e, o) {
156
+ e && (t === "gap" && o && o.includes(e) ? this.$el.style.setProperty(
157
+ `--flex-${t}--${i}-value`,
158
+ `var(--px-spacing-${e}-${i === "laptop" ? "desktop" : i})`
159
159
  ) : this.$el.style.setProperty(
160
- `--flex-${t}--${e}-value`,
161
- i
160
+ `--flex-${t}--${i}-value`,
161
+ e
162
162
  ));
163
163
  }
164
164
  get direction() {
@@ -364,24 +364,18 @@ class E extends c {
364
364
  }
365
365
  }
366
366
  customElements.get("px-hstack") || customElements.define("px-hstack", E);
367
- class z extends HTMLElement {
367
+ class L extends HTMLElement {
368
368
  constructor() {
369
- super(), this.isZeroSized = !1, this.growValue = "1", this.isVertical = !1;
369
+ super();
370
370
  }
371
371
  static get observedAttributes() {
372
372
  return ["grow"];
373
373
  }
374
- attributeChangedCallback(t, e, i) {
375
- t === "grow" && (this.growValue = i || "1", this.isZeroSized || (this.style.flexGrow = this.growValue), this.scheduleRecheck());
374
+ attributeChangedCallback(t, i, e) {
375
+ t === "grow" && (this.style.flexGrow = e);
376
376
  }
377
377
  connectedCallback() {
378
- this.growValue = this.getAttribute("grow") || "1", this.style.flexGrow = this.growValue, this.resizeObserver = new ResizeObserver(() => {
379
- this.handleSizeChange();
380
- }), this.isVertical = this.parentElement.localName === "px-vstack" || this.parentElement.style.flexDirection === "column", this.resizeObserver.observe(this), this.scheduleRecheck();
381
- }
382
- disconnectedCallback() {
383
- var t;
384
- (t = this.resizeObserver) == null || t.disconnect(), this.recheckHandle && (cancelAnimationFrame(this.recheckHandle), this.recheckHandle = void 0);
378
+ this.style.flexGrow = this.getAttribute("grow") || "1";
385
379
  }
386
380
  get grow() {
387
381
  return this.getAttribute("grow");
@@ -389,28 +383,13 @@ class z extends HTMLElement {
389
383
  set grow(t) {
390
384
  this.setAttribute("grow", t);
391
385
  }
392
- scheduleRecheck() {
393
- this.recheckHandle && cancelAnimationFrame(this.recheckHandle), this.recheckHandle = requestAnimationFrame(() => {
394
- this.recheckHandle = void 0, this.recalculateVisibility();
395
- });
396
- }
397
- recalculateVisibility() {
398
- this.isConnected && (this.style.display = "", this.style.flexGrow = this.growValue, this.handleSizeChange());
399
- }
400
- handleSizeChange() {
401
- const t = this.getBoundingClientRect(), e = t.width === 0 && !this.isVertical || t.height === 0 && this.isVertical;
402
- this.isZeroSized !== e && (this.isZeroSized = e, this.updateParticipation());
403
- }
404
- updateParticipation() {
405
- this.isZeroSized ? (this.style.display = "none", this.style.flexGrow = "0") : (this.style.display = "", this.style.flexGrow = this.growValue);
406
- }
407
386
  }
408
- customElements.get("px-spacer") || customElements.define("px-spacer", z);
409
- 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();
410
- b.replaceSync(L);
411
- class j extends n {
387
+ customElements.get("px-spacer") || customElements.define("px-spacer", L);
388
+ const j = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5em}", h = new CSSStyleSheet();
389
+ h.replaceSync(j);
390
+ class D extends n {
412
391
  constructor() {
413
- super(b), this.template = (t) => `
392
+ super(h), this.template = (t) => `
414
393
  <px-container border-radius="none" padding="none">
415
394
  <px-vstack>
416
395
  <px-container id="header-container" border-radius="none">
@@ -575,29 +554,29 @@ class j extends n {
575
554
  connectedCallback() {
576
555
  this.handlePaddingVerticalChange(this.paddingVertical), this.handlePaddingHorizontalChange(this.paddingHorizontal);
577
556
  }
578
- attributeChangedCallback(t, e, i) {
579
- if (e !== i)
557
+ attributeChangedCallback(t, i, e) {
558
+ if (i !== e)
580
559
  switch (t) {
581
560
  case "background-image":
582
- this.$imageContainer.setAttribute("background-image", i);
561
+ this.$imageContainer.setAttribute("background-image", e);
583
562
  break;
584
563
  case "gap":
585
- this.$bodyVStackContainer.setAttribute("gap", i);
564
+ this.$bodyVStackContainer.setAttribute("gap", e);
586
565
  break;
587
566
  case "background-color":
588
567
  this.$bodyContainer.setAttribute(
589
568
  "background-color",
590
- k.indexOf(i) > 0 ? i : "none"
569
+ k.indexOf(e) > 0 ? e : "none"
591
570
  );
592
571
  break;
593
572
  case "padding-vertical":
594
- this.handlePaddingVerticalChange(i);
573
+ this.handlePaddingVerticalChange(e);
595
574
  break;
596
575
  case "padding-horizontal":
597
- this.handlePaddingHorizontalChange(i);
576
+ this.handlePaddingHorizontalChange(e);
598
577
  break;
599
578
  default:
600
- super.attributeChangedCallback(t, e, i);
579
+ super.attributeChangedCallback(t, i, e);
601
580
  }
602
581
  }
603
582
  handlePaddingVerticalChange(t) {
@@ -607,10 +586,10 @@ class j extends n {
607
586
  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;
608
587
  }
609
588
  }
610
- customElements.get("px-page") === void 0 && customElements.define("px-page", j);
611
- const D = ':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();
612
- p.replaceSync(D);
613
- class R extends n {
589
+ customElements.get("px-page") === void 0 && customElements.define("px-page", D);
590
+ const z = ':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);flex-grow:1}.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();
591
+ p.replaceSync(z);
592
+ class F extends n {
614
593
  template() {
615
594
  return `
616
595
  <div class="selectable-box">
@@ -641,11 +620,11 @@ class R extends n {
641
620
  static get observedAttributes() {
642
621
  return [...super.observedAttributes, "inverted", "hide-footer"];
643
622
  }
644
- attributeChangedCallback(t, e, i) {
645
- if (e !== i)
623
+ attributeChangedCallback(t, i, e) {
624
+ if (i !== e)
646
625
  switch (t) {
647
626
  default:
648
- super.attributeChangedCallback(t, e, i);
627
+ super.attributeChangedCallback(t, i, e);
649
628
  break;
650
629
  }
651
630
  }
@@ -665,10 +644,10 @@ class R extends n {
665
644
  t ? this.setAttribute("hide-footer", "") : this.removeAttribute("hide-footer");
666
645
  }
667
646
  }
668
- customElements.get("px-selectable-box") || customElements.define("px-selectable-box", R);
647
+ customElements.get("px-selectable-box") || customElements.define("px-selectable-box", F);
669
648
  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();
670
649
  g.replaceSync(u);
671
- class F extends n {
650
+ class R extends n {
672
651
  template() {
673
652
  return `
674
653
  <div class="selectable-box-checkbox">
@@ -709,24 +688,24 @@ class F extends n {
709
688
  "disabled"
710
689
  ];
711
690
  }
712
- attributeChangedCallback(t, e, i) {
713
- if (e !== i)
691
+ attributeChangedCallback(t, i, e) {
692
+ if (i !== e)
714
693
  switch (t) {
715
694
  case "inverted":
716
695
  this.inverted ? (this.$selectableBox.setAttribute("inverted", ""), this.$checkbox.setAttribute("inverted", "")) : (this.$selectableBox.removeAttribute("inverted"), this.$checkbox.removeAttribute("inverted"));
717
696
  break;
718
697
  case "name":
719
698
  case "value":
720
- this.$checkbox && this.$checkbox.setAttribute(t, i);
699
+ this.$checkbox && this.$checkbox.setAttribute(t, e);
721
700
  break;
722
701
  case "disabled":
723
- this.handleDisabledAttributeChange(i !== null);
702
+ this.handleDisabledAttributeChange(e !== null);
724
703
  break;
725
704
  case "checked":
726
- this.handleCheckedAttributeChange(i);
705
+ this.handleCheckedAttributeChange(e);
727
706
  break;
728
707
  default:
729
- super.attributeChangedCallback(t, e, i);
708
+ super.attributeChangedCallback(t, i, e);
730
709
  break;
731
710
  }
732
711
  }
@@ -759,8 +738,8 @@ class F extends n {
759
738
  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"));
760
739
  }
761
740
  handleCheckedAttributeChange(t) {
762
- var e;
763
- (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(
741
+ var i;
742
+ (i = this.internals) == null || i.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(
764
743
  new Event("change", {
765
744
  bubbles: !0,
766
745
  composed: !0
@@ -781,8 +760,8 @@ class F extends n {
781
760
  }
782
761
  formData() {
783
762
  if (this.name) {
784
- const t = new FormData(), e = this.getAttribute("name");
785
- return e && (this.checked ? t.set(e, this.value) : t.delete(e)), t;
763
+ const t = new FormData(), i = this.getAttribute("name");
764
+ return i && (this.checked ? t.set(i, this.value) : t.delete(i)), t;
786
765
  }
787
766
  }
788
767
  get $el() {
@@ -835,7 +814,7 @@ class F extends n {
835
814
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
836
815
  }
837
816
  }
838
- customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", F);
817
+ customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", R);
839
818
  const x = new CSSStyleSheet();
840
819
  x.replaceSync(u);
841
820
  class H extends n {
@@ -880,24 +859,24 @@ class H extends n {
880
859
  "disabled"
881
860
  ];
882
861
  }
883
- attributeChangedCallback(t, e, i) {
884
- if (e !== i)
862
+ attributeChangedCallback(t, i, e) {
863
+ if (i !== e)
885
864
  switch (t) {
886
865
  case "inverted":
887
866
  this.inverted ? (this.$selectableBox.setAttribute("inverted", ""), this.$radio.setAttribute("inverted", "")) : (this.$selectableBox.removeAttribute("inverted"), this.$radio.removeAttribute("inverted"));
888
867
  break;
889
868
  case "name":
890
869
  case "value":
891
- this.$radio && this.$radio.setAttribute(t, i);
870
+ this.$radio && this.$radio.setAttribute(t, e);
892
871
  break;
893
872
  case "disabled":
894
- this.handleDisabledAttributeChange(i !== null);
873
+ this.handleDisabledAttributeChange(e !== null);
895
874
  break;
896
875
  case "checked":
897
- this.handleCheckedAttributeChange(i);
876
+ this.handleCheckedAttributeChange(e);
898
877
  break;
899
878
  default:
900
- super.attributeChangedCallback(t, e, i);
879
+ super.attributeChangedCallback(t, i, e);
901
880
  break;
902
881
  }
903
882
  }
@@ -930,8 +909,8 @@ class H extends n {
930
909
  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"));
931
910
  }
932
911
  handleCheckedAttributeChange(t) {
933
- var e;
934
- (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(
912
+ var i;
913
+ (i = this.internals) == null || i.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(
935
914
  new Event("change", {
936
915
  bubbles: !0,
937
916
  composed: !0
@@ -952,8 +931,8 @@ class H extends n {
952
931
  }
953
932
  formData() {
954
933
  if (this.name) {
955
- const t = new FormData(), e = this.getAttribute("name");
956
- return e && (this.checked ? t.set(e, this.value) : t.delete(e)), t;
934
+ const t = new FormData(), i = this.getAttribute("name");
935
+ return i && (this.checked ? t.set(i, this.value) : t.delete(i)), t;
957
936
  }
958
937
  }
959
938
  get $el() {
@@ -1008,7 +987,7 @@ class H extends n {
1008
987
  }
1009
988
  customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", H);
1010
989
  export {
1011
- R as SelectableBox,
1012
- F as SelectableBoxCheckbox,
990
+ F as SelectableBox,
991
+ R as SelectableBoxCheckbox,
1013
992
  H as SelectableBoxRadio
1014
993
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-selectablebox",
3
- "version": "1.3.0-alpha.1",
3
+ "version": "1.3.0-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",