@proximus/lavender-section 1.0.0-alpha.16 → 1.0.0-alpha.17
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.
- package/dist/index.js +12 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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 =
|
|
5
|
-
|
|
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-spacing-inside-section-overlapped-mobile) * -1)}::slotted([slot="overlap"]){margin-top:var(--px-spacing-inside-section-overlapped-mobile)}@media only screen and (min-width: 768px){.overlapped{margin-bottom:calc(var(--px-spacing-inside-section-overlapped-tablet) * -1)}::slotted([slot="overlap"]){margin-top:var(--px-spacing-inside-section-overlapped-tablet)}}@media only screen and (min-width: 1025px){.overlapped{margin-bottom:calc(var(--px-spacing-inside-section-overlapped-desktop) * -1)}::slotted([slot="overlap"]){margin-top:var(--px-spacing-inside-section-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
13
|
<px-vstack gap="after-element-none">
|
|
@@ -16,7 +16,10 @@ class r extends HTMLElement {
|
|
|
16
16
|
</px-vstack>
|
|
17
17
|
</div>
|
|
18
18
|
</px-container>
|
|
19
|
-
|
|
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"]');
|
|
@@ -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,
|
|
58
|
-
if (
|
|
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.
|
|
3
|
+
"version": "1.0.0-alpha.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "2fc1887049a9bd838575a81ee8d8d2d63929df11"
|
|
46
46
|
}
|