@proximus/lavender-selectablebox 1.4.11-alpha.1 → 1.4.11-alpha.11

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;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { WithExtraAttributes as c, AttributeBreakpointHandlerDelegate as m, gapValues as k, checkName as y, log as h, backgroundColorValues as A } from "@proximus/lavender-common";
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
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
3
  b.replaceSync(w);
4
4
  const C = [
@@ -134,7 +134,7 @@ class d extends c {
134
134
  }
135
135
  }
136
136
  updateOverflowX(t, e, i, o) {
137
- if (!y(o, i)) {
137
+ if (!A(o, i)) {
138
138
  h(
139
139
  `"${i}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
140
140
  );
@@ -366,7 +366,7 @@ class L extends d {
366
366
  }
367
367
  }
368
368
  customElements.get("px-vstack") || customElements.define("px-vstack", L);
369
- class z extends d {
369
+ class D extends d {
370
370
  constructor() {
371
371
  super();
372
372
  }
@@ -374,8 +374,8 @@ class z extends d {
374
374
  super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
375
375
  }
376
376
  }
377
- customElements.get("px-hstack") || customElements.define("px-hstack", z);
378
- class D extends HTMLElement {
377
+ customElements.get("px-hstack") || customElements.define("px-hstack", D);
378
+ class z extends HTMLElement {
379
379
  constructor() {
380
380
  super(), this.isZeroSized = !1, this.growValue = "1", this.isVertical = !1;
381
381
  }
@@ -422,7 +422,7 @@ class D extends HTMLElement {
422
422
  t ? this.setAttribute("nogap", "") : this.removeAttribute("nogap");
423
423
  }
424
424
  }
425
- customElements.get("px-spacer") || customElements.define("px-spacer", D);
425
+ customElements.get("px-spacer") || customElements.define("px-spacer", z);
426
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
427
  p.replaceSync(j);
428
428
  class R extends c {
@@ -604,7 +604,7 @@ class R extends c {
604
604
  case "background-color":
605
605
  this.$bodyContainer.setAttribute(
606
606
  "background-color",
607
- A.indexOf(i) > 0 ? i : "none"
607
+ y.indexOf(i) > 0 ? i : "none"
608
608
  );
609
609
  break;
610
610
  case "padding-vertical":
@@ -683,8 +683,8 @@ class H extends c {
683
683
  }
684
684
  }
685
685
  customElements.get("px-selectable-box") || customElements.define("px-selectable-box", H);
686
- const P = ["px-a", "px-button"];
687
- function g(s, t, e = P) {
686
+ const T = ["px-a", "px-button"];
687
+ function g(s, t, e = T) {
688
688
  const i = new Set(e), o = s.composedPath();
689
689
  for (const r of o) {
690
690
  if (r === t)
@@ -696,7 +696,7 @@ function g(s, t, e = P) {
696
696
  }
697
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
698
  f.replaceSync(x);
699
- class q extends c {
699
+ class I extends c {
700
700
  template() {
701
701
  return `
702
702
  <div class="selectable-box-checkbox">
@@ -861,10 +861,11 @@ class q extends c {
861
861
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
862
862
  }
863
863
  }
864
- customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", q);
864
+ customElements.get("px-selectable-box-checkbox") || customElements.define("px-selectable-box-checkbox", I);
865
865
  const v = new CSSStyleSheet();
866
866
  v.replaceSync(x);
867
- class I extends c {
867
+ const P = "px-selectable-box-radio-connected", q = "px-selectable-box-radio-disconnected";
868
+ class B extends c {
868
869
  template() {
869
870
  return `
870
871
  <div class="selectable-box-radio">
@@ -888,8 +889,12 @@ class I extends c {
888
889
  super(v), this.shadowRoot.innerHTML = this.template(), this.internals = (t = this.attachInternals) == null ? void 0 : t.call(this);
889
890
  }
890
891
  connectedCallback() {
891
- var t;
892
- this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.role = "radio", this.internals && (this.internals.role = "radio"), this.tabIndex = ((t = this.parentElement) == null ? void 0 : t.querySelector("px-selectable-box-radio")) === this ? 0 : -1, this.ariaChecked = "false", 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(
893
898
  "slotchange",
894
899
  this.toggleFooterVisibility
895
900
  ), this.addEventListener("mouseover", this.setHoverAttribute), this.addEventListener("mouseout", this.removeHoverAttribute), this.addEventListener("keypress", this.setKeypressEvent), this.addEventListener("click", this.setClickEvent);
@@ -929,7 +934,12 @@ class I extends c {
929
934
  this.$slotFooter.removeEventListener(
930
935
  "slotchange",
931
936
  this.toggleFooterVisibility
932
- ), 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
+ );
933
943
  }
934
944
  removeHoverAttribute() {
935
945
  this.$radio.removeAttribute("hover");
@@ -955,7 +965,7 @@ class I extends c {
955
965
  }
956
966
  handleCheckedAttributeChange(t) {
957
967
  var e;
958
- (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(
959
969
  new Event("change", {
960
970
  bubbles: !0,
961
971
  composed: !0
@@ -1030,9 +1040,11 @@ class I extends c {
1030
1040
  t ? this.setAttribute("value", t) : this.removeAttribute("value");
1031
1041
  }
1032
1042
  }
1033
- customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", I);
1043
+ customElements.get("px-selectable-box-radio") || customElements.define("px-selectable-box-radio", B);
1034
1044
  export {
1045
+ P as SELECTABLE_BOX_RADIO_CONNECTED_EVENT,
1046
+ q as SELECTABLE_BOX_RADIO_DISCONNECTED_EVENT,
1035
1047
  H as SelectableBox,
1036
- q as SelectableBoxCheckbox,
1037
- I as SelectableBoxRadio
1048
+ I as SelectableBoxCheckbox,
1049
+ B as SelectableBoxRadio
1038
1050
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-selectablebox",
3
- "version": "1.4.11-alpha.1",
3
+ "version": "1.4.11-alpha.11",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",