@proximus/lavender 1.4.9-beta.1 → 1.4.10-alpha.2

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.
@@ -3880,7 +3880,6 @@ const _Banner = class _Banner extends VerticallyExtendedElement {
3880
3880
  <slot name="title"></slot>
3881
3881
  <slot name="description"></slot>
3882
3882
  <slot name="content"></slot>
3883
-
3884
3883
  </div>
3885
3884
  </px-container>
3886
3885
  </px-grid>
@@ -4016,20 +4015,20 @@ const _Banner = class _Banner extends VerticallyExtendedElement {
4016
4015
  }
4017
4016
  createGridding(value) {
4018
4017
  const breakpoints = [
4019
- { prop: "hasGridding", gridProp: "gridCols", attr: "col-span" },
4018
+ { prop: "hasGridding", gridAttr: "grid-cols", attr: "col-span" },
4020
4019
  {
4021
4020
  prop: "hasGriddingMobile",
4022
- gridProp: "gridColsMobile",
4021
+ gridAttr: "grid-cols--mobile",
4023
4022
  attr: "col-span--mobile"
4024
4023
  },
4025
4024
  {
4026
4025
  prop: "hasGriddingTablet",
4027
- gridProp: "gridColsTablet",
4026
+ gridAttr: "grid-cols--tablet",
4028
4027
  attr: "col-span--tablet"
4029
4028
  },
4030
4029
  {
4031
4030
  prop: "hasGriddingLaptop",
4032
- gridProp: "gridColsLaptop",
4031
+ gridAttr: "grid-cols--laptop",
4033
4032
  attr: "col-span--laptop"
4034
4033
  }
4035
4034
  ];
@@ -4037,16 +4036,16 @@ const _Banner = class _Banner extends VerticallyExtendedElement {
4037
4036
  "px-grid > px-container"
4038
4037
  );
4039
4038
  if (value !== null) {
4040
- breakpoints.forEach(({ prop, gridProp, attr }) => {
4039
+ breakpoints.forEach(({ prop, gridAttr, attr }) => {
4041
4040
  if (this[prop]) {
4042
- this.$grid[gridProp] = "3";
4043
- spanElement.setAttribute(attr, "2");
4041
+ this.$grid.setAttribute(gridAttr, "3");
4042
+ spanElement == null ? void 0 : spanElement.setAttribute(attr, "2");
4044
4043
  }
4045
4044
  });
4046
4045
  } else {
4047
- breakpoints.forEach(({ gridProp, attr }) => {
4048
- this.$grid[gridProp] = "1";
4049
- spanElement.removeAttribute(attr);
4046
+ breakpoints.forEach(({ gridAttr, attr }) => {
4047
+ this.$grid.setAttribute(gridAttr, "1");
4048
+ spanElement == null ? void 0 : spanElement.setAttribute(attr, "1");
4050
4049
  });
4051
4050
  }
4052
4051
  }
@@ -7123,7 +7122,7 @@ class CellSwitch extends WithExtraAttributes {
7123
7122
  return `
7124
7123
  <div class="cell-switch">
7125
7124
  <px-cell hoverable>
7126
- <px-switch slot="action-indicator" aria-hidden="true" tabindex="-1"></px-switch>
7125
+ <px-switch slot="action-indicator" inert></px-switch>
7127
7126
  <slot name="visual" slot="visual"></slot>
7128
7127
  <slot name="label" slot="label"></slot>
7129
7128
  <slot name="description" slot="description"></slot>
@@ -8017,7 +8016,7 @@ class CellRadio extends WithExtraAttributes {
8017
8016
  return `
8018
8017
  <div class="cell-radio">
8019
8018
  <px-cell hoverable>
8020
- <px-radio slot="prefix" aria-hidden="true" tabindex="-1"></px-radio>
8019
+ <px-radio slot="prefix" inert></px-radio>
8021
8020
  <slot name="visual" slot="visual"></slot>
8022
8021
  <slot name="label" slot="label"></slot>
8023
8022
  <slot name="description" slot="description"></slot>
@@ -8647,17 +8646,20 @@ class Section extends HTMLElement {
8647
8646
  this.shadowRoot.adoptedStyleSheets = [styleSheet$t];
8648
8647
  }
8649
8648
  connectedCallback() {
8649
+ var _a, _b;
8650
8650
  this.$container.setAttribute("background-color", this.backgroundColor);
8651
- if (this.$slotOverlap) {
8652
- this.shadowRoot.firstElementChild.querySelector(".content-wrapper").classList.add("overlapped");
8653
- }
8654
- const headingSlot = this.querySelector('[slot="heading"]');
8655
8651
  if (!this.paddingBlock && !this.paddingTop && !this.paddingBottom && !this.paddingBlockMobile && !this.paddingTopMobile && !this.paddingBottomMobile && !this.paddingBlockTablet && !this.paddingTopTablet && !this.paddingBottomTablet && !this.paddingBlockLaptop && !this.paddingTopLaptop && !this.paddingBottomLaptop) {
8656
8652
  this.$container.paddingBlock = "none";
8657
8653
  }
8658
- if (!headingSlot) {
8659
- this.shadowRoot.querySelector("px-vstack").setAttribute("gap", "none");
8660
- }
8654
+ this.setHeadingSpacing = this.setHeadingSpacing.bind(this);
8655
+ this.setHeadingSpacing();
8656
+ (_a = this.$slotHeading) == null ? void 0 : _a.addEventListener("slotchange", this.setHeadingSpacing);
8657
+ this.toggleOverlapSpacing = this.toggleOverlapSpacing.bind(this);
8658
+ this.toggleOverlapSpacing();
8659
+ (_b = this.$slotOverlap) == null ? void 0 : _b.addEventListener(
8660
+ "slotchange",
8661
+ this.toggleOverlapSpacing
8662
+ );
8661
8663
  }
8662
8664
  static get observedAttributes() {
8663
8665
  return [
@@ -8688,9 +8690,6 @@ class Section extends HTMLElement {
8688
8690
  "border-side--laptop"
8689
8691
  ];
8690
8692
  }
8691
- get $container() {
8692
- return this.shadowRoot.querySelector("px-container");
8693
- }
8694
8693
  attributeChangedCallback(name, oldValue, newValue) {
8695
8694
  if (oldValue !== newValue) {
8696
8695
  switch (name) {
@@ -8772,9 +8771,71 @@ class Section extends HTMLElement {
8772
8771
  }
8773
8772
  }
8774
8773
  }
8774
+ disconnectedCallback() {
8775
+ var _a, _b;
8776
+ (_a = this.$slotHeading) == null ? void 0 : _a.removeEventListener(
8777
+ "slotchange",
8778
+ this.setHeadingSpacing
8779
+ );
8780
+ (_b = this.$slotOverlap) == null ? void 0 : _b.removeEventListener(
8781
+ "slotchange",
8782
+ this.toggleOverlapSpacing
8783
+ );
8784
+ }
8785
+ toggleOverlapSpacing() {
8786
+ const overlapSlot = this.$slotOverlap;
8787
+ const mainContentWrapper = this.$mainContentWrapper;
8788
+ if (!overlapSlot || !mainContentWrapper) return;
8789
+ const assignedNodes = overlapSlot.assignedNodes({ flatten: true });
8790
+ const hasOverlapContent = assignedNodes.some(this.isNotEmptyNode);
8791
+ mainContentWrapper.classList.toggle("overlapped", hasOverlapContent);
8792
+ }
8793
+ isNotEmptyNode(node) {
8794
+ if (node.nodeType === Node.ELEMENT_NODE) return true;
8795
+ if (node.nodeType === Node.TEXT_NODE) {
8796
+ return (node.textContent ?? "").trim().length > 0;
8797
+ }
8798
+ return false;
8799
+ }
8800
+ setHeadingSpacing() {
8801
+ var _a;
8802
+ const headingSlot = this.$slotHeading;
8803
+ const vStack = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("px-vstack");
8804
+ if (headingSlot && vStack) {
8805
+ const hasHeadingContent = headingSlot.assignedElements().length > 0;
8806
+ if (hasHeadingContent) {
8807
+ vStack.setAttribute("gap", "heading-to-content");
8808
+ } else {
8809
+ vStack.setAttribute("gap", "none");
8810
+ }
8811
+ }
8812
+ }
8813
+ get $container() {
8814
+ var _a;
8815
+ return (_a = this.shadowRoot) == null ? void 0 : _a.querySelector("px-container");
8816
+ }
8817
+ get $mainContentWrapper() {
8818
+ var _a;
8819
+ return (_a = this.$container) == null ? void 0 : _a.querySelector(".content-wrapper");
8820
+ }
8775
8821
  get $slotOverlap() {
8822
+ var _a;
8823
+ return (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(
8824
+ 'slot[name="overlap"]'
8825
+ );
8826
+ }
8827
+ get $slottedOverlap() {
8776
8828
  return this.querySelector('[slot="overlap"]');
8777
8829
  }
8830
+ get $slotHeading() {
8831
+ var _a;
8832
+ return (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(
8833
+ 'slot[name="heading"]'
8834
+ );
8835
+ }
8836
+ get $slottedHeading() {
8837
+ return this.querySelector('[slot="heading"]');
8838
+ }
8778
8839
  get backgroundColor() {
8779
8840
  return this.getAttribute("background-color") || "none";
8780
8841
  }
@@ -9182,6 +9243,7 @@ const _ContentHeader = class _ContentHeader extends PxElement {
9182
9243
  </div>
9183
9244
  </px-container>
9184
9245
  </px-grid>
9246
+ <slot name="overlap" slot="overlap"></slot>
9185
9247
  </px-section>
9186
9248
  </div>`;
9187
9249
  this.shadowRoot.innerHTML = this.template();
@@ -9218,12 +9280,6 @@ const _ContentHeader = class _ContentHeader extends PxElement {
9218
9280
  </px-stack>`
9219
9281
  );
9220
9282
  }
9221
- if (this.$overlapSlot) {
9222
- this.shadowRoot.querySelector("px-section").insertAdjacentHTML(
9223
- "beforeend",
9224
- `<slot name="overlap" slot="overlap"></slot>`
9225
- );
9226
- }
9227
9283
  if (this.$subtitleSlot) {
9228
9284
  this.$subtitleSlot.setAttribute("variant", "subtitle");
9229
9285
  }
@@ -16500,7 +16556,7 @@ class TileCheckbox extends WithExtraAttributes {
16500
16556
  <div class="tile-checkbox">
16501
16557
  <px-tile hoverable>
16502
16558
  <slot name="prefix" slot="prefix"></slot>
16503
- <px-checkbox slot="suffix" aria-hidden="true" tabindex="-1"></px-checkbox>
16559
+ <px-checkbox slot="suffix" inert></px-checkbox>
16504
16560
  <slot name="label" slot="label"></slot>
16505
16561
  <slot name="description" slot="description"></slot>
16506
16562
  </px-tile>
@@ -16780,7 +16836,7 @@ class TileRadio extends WithExtraAttributes {
16780
16836
  <div class="tile-radio">
16781
16837
  <px-tile hoverable>
16782
16838
  <slot name="prefix" slot="prefix"></slot>
16783
- <px-radio slot="suffix" aria-hidden="true" tabindex="-1"></px-radio>
16839
+ <px-radio slot="suffix" inert></px-radio>
16784
16840
  <slot name="label" slot="label"></slot>
16785
16841
  <slot name="description" slot="description"></slot>
16786
16842
  </px-tile>
@@ -17222,7 +17278,7 @@ class TileSwitch extends WithExtraAttributes {
17222
17278
  <div class="tile-switch">
17223
17279
  <px-tile hoverable>
17224
17280
  <slot name="prefix" slot="prefix"></slot>
17225
- <px-switch slot="suffix" aria-hidden="true" tabindex="-1"></px-switch>
17281
+ <px-switch slot="suffix" inert></px-switch>
17226
17282
  <slot name="label" slot="label"></slot>
17227
17283
  <slot name="description" slot="description"></slot>
17228
17284
  </px-tile>