@proximus/lavender-section 1.0.0-alpha.16 → 1.0.0-alpha.18

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.js +14 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,26 +1,29 @@
1
1
  import { backgroundColorValues as a } from "@proximus/lavender-common";
2
2
  import "@proximus/lavender-container";
3
3
  import "@proximus/lavender-layout";
4
- const d = ":host,:host *{box-sizing:border-box}:host .content-wrapper{margin-inline:var(--px-padding-s-mobile);max-width:1200px}@media only screen and (min-width: 1232px){:host .content-wrapper{margin-inline:auto}}", i = new CSSStyleSheet();
5
- i.replaceSync(d);
4
+ const d = ':host{display:block}:host,:host *{box-sizing:border-box}.content-wrapper{margin-inline:var(--px-padding-s-mobile);max-width:1200px}@media only screen and (min-width: 1232px){.content-wrapper{margin-inline:auto}}.overlapped{margin-bottom:calc(var(--px-overlapped-mobile) * -1)}::slotted([slot="overlap"]){margin-top:var(--px-overlapped-mobile)}@media only screen and (min-width: 768px){.overlapped{margin-bottom:calc(var(--px-overlapped-desktop) * -1)}::slotted([slot="overlap"]){margin-top:var(--px-overlapped-desktop)}}@media only screen and (min-width: 1025px){.overlapped{margin-bottom:calc(var(--px-overlapped-desktop) * -1)}::slotted([slot="overlap"]){margin-top:var(--px-overlapped-desktop)}}', o = new CSSStyleSheet();
5
+ o.replaceSync(d);
6
6
  class r extends HTMLElement {
7
7
  constructor() {
8
8
  super(), this.template = () => `
9
9
  <px-container border-radius="none" padding-inline="none" background-color="${this.backgroundColor}">
10
- <div class="content-wrapper">
10
+ <div class="content-wrapper ${this.$slotOverlap ? "overlapped" : ""}">
11
11
  <px-vstack gap="heading-to-content">
12
12
  <slot name="heading"></slot>
13
- <px-vstack gap="after-element-none">
13
+ <px-vstack gap="none">
14
14
  <slot></slot>
15
15
  </px-vstack>
16
16
  </px-vstack>
17
17
  </div>
18
18
  </px-container>
19
- `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [i];
19
+ <div class="content-wrapper">
20
+ <slot name="overlap"></slot>
21
+ </div>
22
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [o];
20
23
  }
21
24
  connectedCallback() {
22
25
  const t = this.querySelector('[slot="heading"]');
23
- !this.paddingBlock && !this.paddingTop && !this.paddingBottom && !this.paddingBlockMobile && !this.paddingTopMobile && !this.paddingBottomMobile && !this.paddingBlockTablet && !this.paddingTopTablet && !this.paddingBottomTablet && !this.paddingBlockLaptop && !this.paddingTopLaptop && !this.paddingBottomLaptop && (this.$container.paddingBlock = "none"), t || this.shadowRoot.querySelector("px-vstack").setAttribute("gap", "after-element-none");
26
+ !this.paddingBlock && !this.paddingTop && !this.paddingBottom && !this.paddingBlockMobile && !this.paddingTopMobile && !this.paddingBottomMobile && !this.paddingBlockTablet && !this.paddingTopTablet && !this.paddingBottomTablet && !this.paddingBlockLaptop && !this.paddingTopLaptop && !this.paddingBottomLaptop && (this.$container.paddingBlock = "none"), t || this.shadowRoot.querySelector("px-vstack").setAttribute("gap", "none");
24
27
  }
25
28
  static get observedAttributes() {
26
29
  return [
@@ -54,8 +57,8 @@ class r extends HTMLElement {
54
57
  get $container() {
55
58
  return this.shadowRoot.querySelector("px-container");
56
59
  }
57
- attributeChangedCallback(t, o, e) {
58
- if (o !== e)
60
+ attributeChangedCallback(t, i, e) {
61
+ if (i !== e)
59
62
  switch (t) {
60
63
  case "background-color":
61
64
  this.$container.backgroundColor = a.indexOf(e) > 0 ? e : "none";
@@ -134,6 +137,9 @@ class r extends HTMLElement {
134
137
  break;
135
138
  }
136
139
  }
140
+ get $slotOverlap() {
141
+ return this.querySelector('[slot="overlap"]');
142
+ }
137
143
  get backgroundColor() {
138
144
  return this.getAttribute("background-color") || "none";
139
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-section",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.18",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -42,5 +42,5 @@
42
42
  }
43
43
  }
44
44
  },
45
- "gitHead": "3ca2d46ec9e634abc9692e3f2aac0feafb120da1"
45
+ "gitHead": "7683b6952d1da07fe58b0f4ddef292e3954ab85d"
46
46
  }