@proximus/lavender-banner 1.4.16-beta.3 → 1.4.16-beta.5
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/Banner.d.ts +1 -1
- package/dist/custom-elements.json +7 -9
- package/dist/index.es.js +28 -22
- package/dist/web-types.json +2 -3
- package/package.json +1 -1
package/dist/Banner.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ import '@proximus/lavender-grid';
|
|
|
5
5
|
import { VerticallyExtendedElement } from '@proximus/lavender-common';
|
|
6
6
|
export declare class Banner extends VerticallyExtendedElement<HTMLDivElement> {
|
|
7
7
|
#private;
|
|
8
|
+
protected static readonly template: HTMLTemplateElement;
|
|
8
9
|
static nativeName: string;
|
|
9
10
|
observer: MutationObserver;
|
|
10
|
-
private template;
|
|
11
11
|
constructor();
|
|
12
12
|
static get observedAttributes(): string[];
|
|
13
13
|
connectedCallback(): void;
|
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
"description": "",
|
|
12
12
|
"name": "Banner",
|
|
13
13
|
"members": [
|
|
14
|
+
{
|
|
15
|
+
"kind": "field",
|
|
16
|
+
"name": "template",
|
|
17
|
+
"privacy": "protected",
|
|
18
|
+
"static": true,
|
|
19
|
+
"readonly": true
|
|
20
|
+
},
|
|
14
21
|
{
|
|
15
22
|
"kind": "field",
|
|
16
23
|
"name": "nativeName",
|
|
@@ -25,11 +32,6 @@
|
|
|
25
32
|
"name": "observer",
|
|
26
33
|
"default": "new MutationObserver(() => { this.createGridTemplateAreas(); this.createGridding(); })"
|
|
27
34
|
},
|
|
28
|
-
{
|
|
29
|
-
"kind": "field",
|
|
30
|
-
"name": "template",
|
|
31
|
-
"privacy": "private"
|
|
32
|
-
},
|
|
33
35
|
{
|
|
34
36
|
"kind": "method",
|
|
35
37
|
"name": "#applyReducedPadding",
|
|
@@ -130,10 +132,6 @@
|
|
|
130
132
|
{
|
|
131
133
|
"kind": "field",
|
|
132
134
|
"name": "hasGriddingLaptop"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"kind": "field",
|
|
136
|
-
"name": "innerHTML"
|
|
137
135
|
}
|
|
138
136
|
],
|
|
139
137
|
"attributes": [
|
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "@proximus/lavender-container";
|
|
2
|
-
import { PxElement as e, VerticallyExtendedElement as t, backgroundColorValues as n, backgroundSizeValues as r,
|
|
2
|
+
import { PxElement as e, VerticallyExtendedElement as t, backgroundColorValues as n, backgroundSizeValues as r, createTemplate as i, cssTokenBreakpoints as a, gapValues as o, gradientValues as s, log as c, renderTemplate as l } from "@proximus/lavender-common";
|
|
3
3
|
//#region src/banner.css?inline
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
var
|
|
4
|
+
var u = ":host{position:relative}:host,:host>*{box-sizing:border-box;display:block}.banner{height:100%;min-height:8rem;position:relative}.banner[reduced]{min-height:5rem}px-container{height:100%}.banner-content{row-gap:var(--px-spacing-s-mobile);z-index:2;grid-template-rows:minmax(0,auto);grid-template-columns:1fr;display:grid;position:relative}[reduced] .banner-content{column-gap:var(--px-spacing-default-mobile);grid-template-columns:min-content minmax(0,1fr)}::slotted([slot=tag]){grid-area:tag}::slotted([slot=media]){grid-area:media;align-self:start}::slotted([slot=title]){grid-area:title}::slotted([slot=description]){grid-area:description}::slotted([slot=content]){grid-area:content}::slotted([slot=action]){z-index:2;grid-area:action}:host(:not([reduced])) ::slotted([slot=action]){margin-top:calc(var(--px-spacing-default-mobile) - var(--px-spacing-s-mobile))}.contrast-helper{z-index:1;pointer-events:none;border-radius:var(--px-radius-main);display:none;position:absolute;inset:0}[contrast-helper-gradient] .contrast-helper{background-image:linear-gradient(90deg,#fff 23.43%,#fff0 81.69%);display:block}[inverted] :is([contrast-helper-gradient] .contrast-helper){background-image:linear-gradient(90deg,#000 23.43%,#0000 81.69%)}[contrast-helper-overlay] .contrast-helper{background-color:#ffffffb3;display:block}[inverted] :is([contrast-helper-overlay] .contrast-helper){background-color:#0006}@media screen and (width>=48rem){.banner-content{row-gap:var(--px-spacing-s-desktop)}[reduced] .banner-content{column-gap:var(--px-spacing-default-desktop)}.banner-content :host(:not([reduced])) ::slotted([slot=action]){margin-top:calc(var(--px-spacing-default-desktop) - var(--px-spacing-s-desktop))}}@media screen and (width>=64.0625rem){.banner-content{row-gap:var(--px-spacing-s-desktop)}[reduced] .banner-content{column-gap:var(--px-spacing-default-desktop)}.banner-content :host(:not([reduced])) ::slotted([slot=action]){margin-top:calc(var(--px-spacing-default-desktop) - var(--px-spacing-s-desktop))}}", d = ":host{--grid-cols:initial;--grid-cols--mobile:initial;--grid-cols--tablet:initial;--grid-cols--laptop:initial;--grid-cols--desktop:initial;--justify-content:initial;--justify-items:initial;--align-content:initial;--align-items:initial;display:block}.grid{grid-template-columns:repeat(var(--grid-cols), minmax(0, 1fr));justify-content:var(--justify-content);justify-items:var(--justify-items);align-content:var(--align-content);align-items:var(--align-items);display:grid}.justify-content-normal{justify-content:normal}.justify-content-start{justify-content:start}.justify-content-end{justify-content:end}.justify-content-center{justify-content:center}.justify-content-space-between{justify-content:space-between}.justify-content-space-around{justify-content:space-around}.justify-content-space-evenly{justify-content:space-evenly}.justify-content-stretch{justify-content:stretch}.justify-items-start{justify-items:start}.justify-items-end{justify-items:end}.justify-items-center{justify-items:center}.justify-items-stretch{justify-items:stretch}.align-content-normal{align-content:normal}.align-content-start{align-content:start}.align-content-end{align-content:end}.align-content-center{align-content:center}.align-content-space-between{align-content:space-between}.align-content-space-around{align-content:space-around}.align-content-space-evenly{align-content:space-evenly}.align-content-stretch{align-content:stretch}.align-items-start{align-items:start}.align-items-end{align-items:end}.align-items-center{align-items:center}.align-items-stretch{align-items:stretch}@media screen and (width<=47.938rem){.grid{grid-template-columns:repeat(var(--grid-cols--mobile,var(--grid-cols)), minmax(0, 1fr))}.justify-content-normal-mobile{justify-content:normal}.justify-content-start-mobile{justify-content:start}.justify-content-end-mobile{justify-content:end}.justify-content-center-mobile{justify-content:center}.justify-content-space-between-mobile{justify-content:space-between}.justify-content-space-around-mobile{justify-content:space-around}.justify-content-space-evenly-mobile{justify-content:space-evenly}.justify-content-stretch-mobile{justify-content:stretch}.justify-items-start-mobile{justify-items:start}.justify-items-end-mobile{justify-items:end}.justify-items-center-mobile{justify-items:center}.justify-items-stretch-mobile{justify-items:stretch}.align-content-normal-mobile{align-content:normal}.align-content-start-mobile{align-content:start}.align-content-end-mobile{align-content:end}.align-content-center-mobile{align-content:center}.align-content-space-between-mobile{align-content:space-between}.align-content-space-around-mobile{align-content:space-around}.align-content-space-evenly-mobile{align-content:space-evenly}.align-content-stretch-mobile{align-content:stretch}.align-items-start-mobile{align-items:start}.align-items-end-mobile{align-items:end}.align-items-center-mobile{align-items:center}.align-items-stretch-mobile{align-items:stretch}}@media screen and (width>=48rem) and (width<=64rem){.grid{grid-template-columns:repeat(var(--grid-cols--tablet,var(--grid-cols)), minmax(0, 1fr))}.justify-content-normal-tablet{justify-content:normal}.justify-content-start-tablet{justify-content:start}.justify-content-end-tablet{justify-content:end}.justify-content-center-tablet{justify-content:center}.justify-content-space-between-tablet{justify-content:space-between}.justify-content-space-around-tablet{justify-content:space-around}.justify-content-space-evenly-tablet{justify-content:space-evenly}.justify-content-stretch-tablet{justify-content:stretch}.justify-items-start-tablet{justify-items:start}.justify-items-end-tablet{justify-items:end}.justify-items-center-tablet{justify-items:center}.justify-items-stretch-tablet{justify-items:stretch}.align-content-normal-tablet{align-content:normal}.align-content-start-tablet{align-content:start}.align-content-end-tablet{align-content:end}.align-content-center-tablet{align-content:center}.align-content-space-between-tablet{align-content:space-between}.align-content-space-around-tablet{align-content:space-around}.align-content-space-evenly-tablet{align-content:space-evenly}.align-content-stretch-tablet{align-content:stretch}.align-items-start-tablet{align-items:start}.align-items-end-tablet{align-items:end}.align-items-center-tablet{align-items:center}.align-items-stretch-tablet{align-items:stretch}}@media screen and (width>=64.0625rem){.grid{grid-template-columns:repeat(var(--grid-cols--laptop,var(--grid-cols)), minmax(0, 1fr))}.justify-content-normal-laptop{justify-content:normal}.justify-content-start-laptop{justify-content:start}.justify-content-end-laptop{justify-content:end}.justify-content-center-laptop{justify-content:center}.justify-content-space-between-laptop{justify-content:space-between}.justify-content-space-around-laptop{justify-content:space-around}.justify-content-space-evenly-laptop{justify-content:space-evenly}.justify-content-stretch-laptop{justify-content:stretch}.justify-items-start-laptop{justify-items:start}.justify-items-end-laptop{justify-items:end}.justify-items-center-laptop{justify-items:center}.justify-items-stretch-laptop{justify-items:stretch}.align-content-normal-laptop{align-content:normal}.align-content-start-laptop{align-content:start}.align-content-end-laptop{align-content:end}.align-content-center-laptop{align-content:center}.align-content-space-between-laptop{align-content:space-between}.align-content-space-around-laptop{align-content:space-around}.align-content-space-evenly-laptop{align-content:space-evenly}.align-content-stretch-laptop{align-content:stretch}.align-items-start-laptop{align-items:start}.align-items-end-laptop{align-items:end}.align-items-center-laptop{align-items:center}.align-items-stretch-laptop{align-items:stretch}}", f = new CSSStyleSheet();
|
|
5
|
+
f.replaceSync(d);
|
|
6
|
+
var p = [
|
|
7
7
|
"1",
|
|
8
8
|
"2",
|
|
9
9
|
"3",
|
|
@@ -16,7 +16,7 @@ var d = [
|
|
|
16
16
|
"10",
|
|
17
17
|
"11",
|
|
18
18
|
"12"
|
|
19
|
-
],
|
|
19
|
+
], m = [
|
|
20
20
|
"",
|
|
21
21
|
"start",
|
|
22
22
|
"end",
|
|
@@ -25,18 +25,21 @@ var d = [
|
|
|
25
25
|
"space-around",
|
|
26
26
|
"space-evenly",
|
|
27
27
|
"stretch"
|
|
28
|
-
],
|
|
28
|
+
], h = [
|
|
29
29
|
"",
|
|
30
30
|
"start",
|
|
31
31
|
"end",
|
|
32
32
|
"center",
|
|
33
33
|
"stretch"
|
|
34
|
-
],
|
|
34
|
+
], g = a("gap", (e, t, n) => `:host([${e}${n ? `--${n}` : ""}='${t}']) .grid`, o, "px-spacing", "--grid-gap"), _ = class t extends e {
|
|
35
|
+
static {
|
|
36
|
+
this.template = i("<div class=\"grid\"><slot></slot></div>");
|
|
37
|
+
}
|
|
35
38
|
static {
|
|
36
39
|
this.nativeName = "div";
|
|
37
40
|
}
|
|
38
41
|
constructor() {
|
|
39
|
-
super(
|
|
42
|
+
super(f, g), l(this.shadowRoot, t.template);
|
|
40
43
|
}
|
|
41
44
|
static get observedAttributes() {
|
|
42
45
|
return [
|
|
@@ -76,7 +79,7 @@ var d = [
|
|
|
76
79
|
case "grid-cols--mobile":
|
|
77
80
|
case "grid-cols--tablet":
|
|
78
81
|
case "grid-cols--laptop":
|
|
79
|
-
this.updateAttribute(e, t, n,
|
|
82
|
+
this.updateAttribute(e, t, n, p);
|
|
80
83
|
break;
|
|
81
84
|
case "justify-content":
|
|
82
85
|
case "align-content":
|
|
@@ -88,7 +91,7 @@ var d = [
|
|
|
88
91
|
case "align-content--laptop":
|
|
89
92
|
case "justify-content--desktop":
|
|
90
93
|
case "align-content--desktop":
|
|
91
|
-
this.updateAttribute(e, t, n,
|
|
94
|
+
this.updateAttribute(e, t, n, m);
|
|
92
95
|
break;
|
|
93
96
|
case "justify-items":
|
|
94
97
|
case "align-items":
|
|
@@ -100,14 +103,14 @@ var d = [
|
|
|
100
103
|
case "align-items--laptop":
|
|
101
104
|
case "justify-items--desktop":
|
|
102
105
|
case "align-items--desktop":
|
|
103
|
-
this.updateAttribute(e, t, n,
|
|
106
|
+
this.updateAttribute(e, t, n, h);
|
|
104
107
|
break;
|
|
105
108
|
default: super.attributeChangedCallback(e, t, n);
|
|
106
109
|
}
|
|
107
110
|
}
|
|
108
111
|
updateGap(e, t, n) {
|
|
109
112
|
if (!this.checkName(n, t)) {
|
|
110
|
-
|
|
113
|
+
c(`"${t}" is not a valid gap value for ${this.tagName.toLowerCase()}. Allowed values are: "${n.join("\", \"")}".`);
|
|
111
114
|
return;
|
|
112
115
|
}
|
|
113
116
|
let r = (e) => {
|
|
@@ -116,7 +119,7 @@ var d = [
|
|
|
116
119
|
r(e), r(t);
|
|
117
120
|
}
|
|
118
121
|
updateAttribute(e, t, n, r) {
|
|
119
|
-
this.checkName(r, n) ? e === "grid-cols" || e === "grid-cols--mobile" || e === "grid-cols--tablet" || e === "grid-cols--laptop" || e === "grid-cols--desktop" ? this.$el.style.setProperty(`--${e}`, n) : (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`${e}-${t}`), n !== null && n !== "" && n !== "default" && this.$el.classList.toggle(`${e}-${n}`)) :
|
|
122
|
+
this.checkName(r, n) ? e === "grid-cols" || e === "grid-cols--mobile" || e === "grid-cols--tablet" || e === "grid-cols--laptop" || e === "grid-cols--desktop" ? this.$el.style.setProperty(`--${e}`, n) : (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`${e}-${t}`), n !== null && n !== "" && n !== "default" && this.$el.classList.toggle(`${e}-${n}`)) : c(`"${n}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${r.join("\", \"")}".`);
|
|
120
123
|
}
|
|
121
124
|
get gap() {
|
|
122
125
|
return this.getAttribute("gap");
|
|
@@ -287,19 +290,22 @@ var d = [
|
|
|
287
290
|
this._updateAttribute("align-items--desktop", e);
|
|
288
291
|
}
|
|
289
292
|
};
|
|
290
|
-
customElements.get("px-grid") || customElements.define("px-grid",
|
|
293
|
+
customElements.get("px-grid") || customElements.define("px-grid", _);
|
|
291
294
|
//#endregion
|
|
292
295
|
//#region src/Banner.ts
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
var
|
|
296
|
+
var v = new CSSStyleSheet();
|
|
297
|
+
v.replaceSync(u);
|
|
298
|
+
var y = class e extends t {
|
|
299
|
+
static {
|
|
300
|
+
this.template = i("<div class=\"banner\"><div class=\"contrast-helper\"></div><px-container class=\"banner-container\" padding--mobile=\"m\" border-radius=\"main\" ><px-vstack><px-grid gap=\"none\"><px-container padding=\"none\" background-color=\"none\"><div class=\"banner-content\"><slot name=\"tag\"></slot><slot name=\"media\"></slot><slot name=\"title\"></slot><slot name=\"description\"></slot><slot name=\"content\"></slot></div></px-container></px-grid><slot name=\"action\"></slot></px-vstack></px-container></div>");
|
|
301
|
+
}
|
|
296
302
|
static {
|
|
297
303
|
this.nativeName = "div";
|
|
298
304
|
}
|
|
299
305
|
constructor() {
|
|
300
|
-
super(
|
|
306
|
+
super(v), this.observer = new MutationObserver(() => {
|
|
301
307
|
this.createGridTemplateAreas(), this.createGridding();
|
|
302
|
-
}),
|
|
308
|
+
}), l(this.shadowRoot, e.template);
|
|
303
309
|
}
|
|
304
310
|
static get observedAttributes() {
|
|
305
311
|
return [
|
|
@@ -337,7 +343,7 @@ var _ = class extends t {
|
|
|
337
343
|
this.$container.backgroundColor = n.indexOf(i) > 0 ? i : "none";
|
|
338
344
|
break;
|
|
339
345
|
case "background-gradient":
|
|
340
|
-
this.$container.gradient =
|
|
346
|
+
this.$container.gradient = s.indexOf(i) > 0 ? i : "none";
|
|
341
347
|
break;
|
|
342
348
|
case "background-image":
|
|
343
349
|
this.$container.backgroundImage = i;
|
|
@@ -531,6 +537,6 @@ var _ = class extends t {
|
|
|
531
537
|
this._updateBooleanAttribute("has-gridding--laptop", e);
|
|
532
538
|
}
|
|
533
539
|
};
|
|
534
|
-
customElements.get("px-banner") || customElements.define("px-banner",
|
|
540
|
+
customElements.get("px-banner") || customElements.define("px-banner", y);
|
|
535
541
|
//#endregion
|
|
536
|
-
export {
|
|
542
|
+
export { y as Banner };
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@proximus/lavender-banner",
|
|
4
|
-
"version": "1.4.16-beta.
|
|
4
|
+
"version": "1.4.16-beta.5",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -65,8 +65,7 @@
|
|
|
65
65
|
{ "name": "hasGridding" },
|
|
66
66
|
{ "name": "hasGriddingMobile" },
|
|
67
67
|
{ "name": "hasGriddingTablet" },
|
|
68
|
-
{ "name": "hasGriddingLaptop" }
|
|
69
|
-
{ "name": "innerHTML" }
|
|
68
|
+
{ "name": "hasGriddingLaptop" }
|
|
70
69
|
],
|
|
71
70
|
"events": []
|
|
72
71
|
}
|