@proximus/lavender-banner 2.0.0-alpha.2 → 2.0.0-alpha.20

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 CHANGED
@@ -1,7 +1,9 @@
1
- import { Container } from '@proximus/lavender-container';
2
- import { Grid } from '@proximus/lavender-grid';
3
- import { PxElement } from '@proximus/lavender-common';
4
- export declare class Banner extends PxElement<HTMLDivElement> {
1
+ import type { Container } from '@proximus/lavender-container';
2
+ import '@proximus/lavender-container';
3
+ import type { Grid } from '@proximus/lavender-grid';
4
+ import '@proximus/lavender-grid';
5
+ import { VerticallyExtendedElement } from '@proximus/lavender-common';
6
+ export declare class Banner extends VerticallyExtendedElement<HTMLDivElement> {
5
7
  static nativeName: string;
6
8
  private template;
7
9
  constructor();
@@ -9,7 +11,7 @@ export declare class Banner extends PxElement<HTMLDivElement> {
9
11
  connectedCallback(): void;
10
12
  attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
11
13
  createGridTemplateAreas(): void;
12
- createGridding(): void;
14
+ createGridding(value?: string): void;
13
15
  get $grid(): Grid;
14
16
  get $container(): Container;
15
17
  get $children(): NodeListOf<Element>;
package/dist/index.es.js CHANGED
@@ -1,13 +1,328 @@
1
- import { PxElement as d, backgroundSizeValues as g, gradientValues as c, backgroundColorValues as l } from "@proximus/lavender-common";
2
- const b = ':host{position:relative}:host,:host>*{display:block;box-sizing:border-box}.banner{position:relative;min-height:8em}.banner[reduced]{min-height:5em}px-container{height:100%}.banner-content{display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,auto);row-gap:var(--px-spacing-s-mobile);z-index:2;position:relative}[reduced] .banner-content{grid-template-columns:min-content minmax(0,1fr);column-gap:var(--px-spacing-default-mobile)}::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}:host(:not([reduced])) ::slotted([slot="action"]){grid-area:action;margin-top:calc(var(--px-spacing-default-mobile) - var(--px-spacing-s-mobile))}.contrast-helper{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:none;display:none;border-radius:var(--px-radius-main)}[contrast-helper-gradient] .contrast-helper{display:block;background-image:linear-gradient(90deg,#fff 23.43%,#fff0 81.69%)}[inverted] :is([contrast-helper-gradient] .contrast-helper){background-image:linear-gradient(90deg,#000 23.43%,#0000 81.69%)}[contrast-helper-overlay] .contrast-helper{display:block;background-color:#ffffffb3}[inverted] :is([contrast-helper-overlay] .contrast-helper){background-color:#0006}@media only screen and (min-width: 48em){.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 only screen and (min-width: 64.0625em){.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))}}', s = new CSSStyleSheet();
3
- s.replaceSync(b);
4
- const o = class o extends d {
1
+ import "@proximus/lavender-container";
2
+ import { cssTokenBreakpoints as b, gapValues as m, PxElement as h, log as c, VerticallyExtendedElement as f, backgroundSizeValues as y, gradientValues as j, backgroundColorValues as k } from "@proximus/lavender-common";
3
+ const A = ':host{position:relative}:host,:host>*{display:block;box-sizing:border-box}.banner{position:relative;min-height:8em}.banner[reduced]{min-height:5em}px-container{height:100%}.banner-content{display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,auto);row-gap:var(--px-spacing-s-mobile);z-index:2;position:relative}[reduced] .banner-content{grid-template-columns:min-content minmax(0,1fr);column-gap:var(--px-spacing-default-mobile)}::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}:host(:not([reduced])) ::slotted([slot="action"]){grid-area:action;margin-top:calc(var(--px-spacing-default-mobile) - var(--px-spacing-s-mobile))}.contrast-helper{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:none;display:none;border-radius:var(--px-radius-main)}[contrast-helper-gradient] .contrast-helper{display:block;background-image:linear-gradient(90deg,#fff 23.43%,#fff0 81.69%)}[inverted] :is([contrast-helper-gradient] .contrast-helper){background-image:linear-gradient(90deg,#000 23.43%,#0000 81.69%)}[contrast-helper-overlay] .contrast-helper{display:block;background-color:#ffffffb3}[inverted] :is([contrast-helper-overlay] .contrast-helper){background-color:#0006}@media only screen and (min-width: 48em){.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 only screen and (min-width: 64.0625em){.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))}}', v = ":host{display:block;--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}.grid{display: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)}.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 only screen and (max-width: 767px){.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 only screen and (min-width: 48em) and (max-width: 64em){.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 only screen and (min-width: 64.0625em){.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}}", g = new CSSStyleSheet();
4
+ g.replaceSync(v);
5
+ const C = [
6
+ "1",
7
+ "2",
8
+ "3",
9
+ "4",
10
+ "5",
11
+ "6",
12
+ "7",
13
+ "8",
14
+ "9",
15
+ "10",
16
+ "11",
17
+ "12"
18
+ ], x = [
19
+ "",
20
+ "start",
21
+ "end",
22
+ "center",
23
+ "space-between",
24
+ "space-around",
25
+ "space-evenly",
26
+ "stretch"
27
+ ], $ = ["", "start", "end", "center", "stretch"], I = (u, t, i) => `:host([${u}${i ? `--${i}` : ""}='${t}']) .grid`, S = "px-spacing", T = b(
28
+ "gap",
29
+ I,
30
+ m,
31
+ S,
32
+ "--grid-gap"
33
+ ), o = class o extends h {
5
34
  constructor() {
6
- super(s), this.template = () => `<div class="banner">
35
+ super(g, T), this.template = () => `<div class="grid">
36
+ <slot></slot>
37
+ </div>`, this.shadowRoot.innerHTML = this.template();
38
+ }
39
+ static get observedAttributes() {
40
+ return [
41
+ ...super.observedAttributes,
42
+ "grid-cols",
43
+ "grid-cols--mobile",
44
+ "grid-cols--tablet",
45
+ "grid-cols--laptop",
46
+ "justify-content",
47
+ "justify-items",
48
+ "align-content",
49
+ "align-items",
50
+ "justify-content--mobile",
51
+ "justify-items--mobile",
52
+ "align-content--mobile",
53
+ "align-items--mobile",
54
+ "justify-content--tablet",
55
+ "justify-items--tablet",
56
+ "align-content--tablet",
57
+ "align-items--tablet",
58
+ "justify-content--laptop",
59
+ "justify-items--laptop",
60
+ "align-content--laptop",
61
+ "align-items--laptop",
62
+ "justify-content--desktop",
63
+ "justify-items--desktop",
64
+ "align-content--desktop",
65
+ "align-items--desktop"
66
+ ];
67
+ }
68
+ connectedCallback() {
69
+ this.gap || (this.gap = "default"), this.alignItems || (this.alignItems = "stretch");
70
+ }
71
+ attributeChangedCallback(t, i, e) {
72
+ if (i !== e)
73
+ switch (t) {
74
+ case "grid-cols":
75
+ case "grid-cols--mobile":
76
+ case "grid-cols--tablet":
77
+ case "grid-cols--laptop":
78
+ this.updateAttribute(t, i, e, C);
79
+ break;
80
+ case "justify-content":
81
+ case "align-content":
82
+ case "justify-content--mobile":
83
+ case "align-content--mobile":
84
+ case "justify-content--tablet":
85
+ case "align-content--tablet":
86
+ case "justify-content--laptop":
87
+ case "align-content--laptop":
88
+ case "justify-content--desktop":
89
+ case "align-content--desktop":
90
+ this.updateAttribute(
91
+ t,
92
+ i,
93
+ e,
94
+ x
95
+ );
96
+ break;
97
+ case "justify-items":
98
+ case "align-items":
99
+ case "justify-items--mobile":
100
+ case "align-items--mobile":
101
+ case "justify-items--tablet":
102
+ case "align-items--tablet":
103
+ case "justify-items--laptop":
104
+ case "align-items--laptop":
105
+ case "justify-items--desktop":
106
+ case "align-items--desktop":
107
+ this.updateAttribute(
108
+ t,
109
+ i,
110
+ e,
111
+ $
112
+ );
113
+ break;
114
+ default:
115
+ super.attributeChangedCallback(t, i, e);
116
+ break;
117
+ }
118
+ }
119
+ updateGap(t, i, e) {
120
+ if (!this.checkName(e, i)) {
121
+ c(
122
+ `${i} is not an allowed gap value for ${this.tagName.toLowerCase()}`
123
+ );
124
+ return;
125
+ }
126
+ const n = (s) => {
127
+ s !== null && s !== "" && s !== "default" && (this.$el.style.setProperty(
128
+ "--grid-gap--mobile",
129
+ `var(--px-spacing-${s}-mobile)`
130
+ ), this.$el.style.setProperty(
131
+ "--grid-gap--tablet",
132
+ `var(--px-spacing-${s}-tablet)`
133
+ ), this.$el.style.setProperty(
134
+ "--grid-gap--laptop",
135
+ `var(--px-spacing-${s}-laptop)`
136
+ ));
137
+ };
138
+ n(t), n(i);
139
+ }
140
+ updateAttribute(t, i, e, n) {
141
+ this.checkName(n, e) ? t === "grid-cols" || t === "grid-cols--mobile" || t === "grid-cols--tablet" || t === "grid-cols--laptop" || t === "grid-cols--desktop" ? this.$el.style.setProperty(`--${t}`, e) : (i !== null && i !== "" && i !== "default" && this.$el.classList.toggle(`${t}-${i}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`${t}-${e}`)) : c(
142
+ `${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
143
+ );
144
+ }
145
+ get gap() {
146
+ return this.getAttribute("gap");
147
+ }
148
+ set gap(t) {
149
+ this.setAttribute("gap", t);
150
+ }
151
+ get gapMobile() {
152
+ return this.getAttribute("gap--mobile");
153
+ }
154
+ set gapMobile(t) {
155
+ this.setAttribute("gap--mobile", t);
156
+ }
157
+ get gapTablet() {
158
+ return this.getAttribute("gap--tablet");
159
+ }
160
+ set gapTablet(t) {
161
+ this.setAttribute("gap--tablet", t);
162
+ }
163
+ get gapLaptop() {
164
+ return this.getAttribute("gap--laptop");
165
+ }
166
+ set gapLaptop(t) {
167
+ this.setAttribute("gap--laptop", t);
168
+ }
169
+ get gridCols() {
170
+ return this.getAttribute("grid-cols");
171
+ }
172
+ set gridCols(t) {
173
+ this.setAttribute("grid-cols", t);
174
+ }
175
+ get gridColsMobile() {
176
+ return this.getAttribute("grid-cols--mobile");
177
+ }
178
+ set gridColsMobile(t) {
179
+ this.setAttribute("grid-cols--mobile", t);
180
+ }
181
+ get gridColsTablet() {
182
+ return this.getAttribute("grid-cols--tablet");
183
+ }
184
+ set gridColsTablet(t) {
185
+ this.setAttribute("grid-cols--tablet", t);
186
+ }
187
+ get gridColsLaptop() {
188
+ return this.getAttribute("grid-cols--laptop");
189
+ }
190
+ set gridColsLaptop(t) {
191
+ this.setAttribute("grid-cols--laptop", t);
192
+ }
193
+ get justifyContent() {
194
+ return this.getAttribute("justify-content");
195
+ }
196
+ set justifyContent(t) {
197
+ this.setAttribute("justify-content", t);
198
+ }
199
+ get justifyItems() {
200
+ return this.getAttribute("justify-items");
201
+ }
202
+ set justifyItems(t) {
203
+ this.setAttribute("justify-items", t);
204
+ }
205
+ get alignContent() {
206
+ return this.getAttribute("align-content");
207
+ }
208
+ set alignContent(t) {
209
+ this.setAttribute("align-content", t);
210
+ }
211
+ get alignItems() {
212
+ return this.getAttribute("align-items");
213
+ }
214
+ set alignItems(t) {
215
+ this.setAttribute("align-items", t);
216
+ }
217
+ get justifyContentMobile() {
218
+ return this.getAttribute("justify-content--mobile");
219
+ }
220
+ set justifyContentMobile(t) {
221
+ this.setAttribute("justify-content--mobile", t);
222
+ }
223
+ get justifyItemsMobile() {
224
+ return this.getAttribute("justify-items--mobile");
225
+ }
226
+ set justifyItemsMobile(t) {
227
+ this.setAttribute("justify-items--mobile", t);
228
+ }
229
+ get alignContentMobile() {
230
+ return this.getAttribute("align-content--mobile");
231
+ }
232
+ set alignContentMobile(t) {
233
+ this.setAttribute("align-content--mobile", t);
234
+ }
235
+ get alignItemsMobile() {
236
+ return this.getAttribute("align-items--mobile");
237
+ }
238
+ set alignItemsMobile(t) {
239
+ this.setAttribute("align-items--mobile", t);
240
+ }
241
+ get justifyContentTablet() {
242
+ return this.getAttribute("justify-content--tablet");
243
+ }
244
+ set justifyContentTablet(t) {
245
+ this.setAttribute("justify-content--tablet", t);
246
+ }
247
+ get justifyItemsTablet() {
248
+ return this.getAttribute("justify-items--tablet");
249
+ }
250
+ set justifyItemsTablet(t) {
251
+ this.setAttribute("justify-items--tablet", t);
252
+ }
253
+ get alignContentTablet() {
254
+ return this.getAttribute("align-content--tablet");
255
+ }
256
+ set alignContentTablet(t) {
257
+ this.setAttribute("align-content--tablet", t);
258
+ }
259
+ get alignItemsTablet() {
260
+ return this.getAttribute("align-items--tablet");
261
+ }
262
+ set alignItemsTablet(t) {
263
+ this.setAttribute("align-items--tablet", t);
264
+ }
265
+ get justifyContentLaptop() {
266
+ return this.getAttribute("justify-content--laptop");
267
+ }
268
+ set justifyContentLaptop(t) {
269
+ this.setAttribute("justify-content--laptop", t);
270
+ }
271
+ get justifyItemsLaptop() {
272
+ return this.getAttribute("justify-items--laptop");
273
+ }
274
+ set justifyItemsLaptop(t) {
275
+ this.setAttribute("justify-items--laptop", t);
276
+ }
277
+ get alignContentLaptop() {
278
+ return this.getAttribute("align-content--laptop");
279
+ }
280
+ set alignContentLaptop(t) {
281
+ this.setAttribute("align-content--laptop", t);
282
+ }
283
+ get alignItemsLaptop() {
284
+ return this.getAttribute("align-items--laptop");
285
+ }
286
+ set alignItemsLaptop(t) {
287
+ this.setAttribute("align-items--laptop", t);
288
+ }
289
+ get justifyContentDesktop() {
290
+ return this.getAttribute("justify-content--desktop");
291
+ }
292
+ set justifyContentDesktop(t) {
293
+ this.setAttribute("justify-content--desktop", t);
294
+ }
295
+ get justifyItemsDesktop() {
296
+ return this.getAttribute("justify-items--desktop");
297
+ }
298
+ set justifyItemsDesktop(t) {
299
+ this.setAttribute("justify-items--desktop", t);
300
+ }
301
+ get alignContentDesktop() {
302
+ return this.getAttribute("align-content--desktop");
303
+ }
304
+ set alignContentDesktop(t) {
305
+ this.setAttribute("align-content--desktop", t);
306
+ }
307
+ get alignItemsDesktop() {
308
+ return this.getAttribute("align-items--desktop");
309
+ }
310
+ set alignItemsDesktop(t) {
311
+ this.setAttribute("align-items--desktop", t);
312
+ }
313
+ };
314
+ o.nativeName = "div";
315
+ let a = o;
316
+ customElements.get("px-grid") || customElements.define("px-grid", a);
317
+ const d = new CSSStyleSheet();
318
+ d.replaceSync(A);
319
+ const l = class l extends f {
320
+ constructor() {
321
+ super(d), this.template = () => `<div class="banner">
7
322
  <div class="contrast-helper"></div>
8
- <px-container class="banner-container" padding="${this.reduced ? "m" : "l"}" padding--mobile="m" border-radius="main" >
323
+ <px-container class="banner-container" padding--mobile="m" border-radius="main" >
9
324
  <px-grid gap="none">
10
- <px-container padding="none" background-color="none" background-image="none" background-image--mobile="none" background-image--tablet="none" background-image--laptop="none" >
325
+ <px-container padding="none" background-color="none">
11
326
  <div class="banner-content">
12
327
  <slot name="tag"></slot>
13
328
  <slot name="media"></slot>
@@ -43,16 +358,16 @@ const o = class o extends d {
43
358
  }
44
359
  connectedCallback() {
45
360
  var t;
46
- (t = super.connectedCallback) == null || t.call(this), this.createGridTemplateAreas(), this.createGridding();
361
+ (t = super.connectedCallback) == null || t.call(this), this.reduced ? this.$container.setAttribute("padding", "m") : this.$container.setAttribute("padding", "l"), this.createGridTemplateAreas(), this.createGridding();
47
362
  }
48
363
  attributeChangedCallback(t, i, e) {
49
364
  if (i !== e)
50
365
  switch (t) {
51
366
  case "background-color":
52
- this.$container.backgroundColor = l.indexOf(e) > 0 ? e : "none";
367
+ this.$container.backgroundColor = k.indexOf(e) > 0 ? e : "none";
53
368
  break;
54
369
  case "background-gradient":
55
- this.$container.gradient = c.indexOf(e) > 0 ? e : "none";
370
+ this.$container.gradient = j.indexOf(e) > 0 ? e : "none";
56
371
  break;
57
372
  case "background-image":
58
373
  this.$container.backgroundImage = e;
@@ -67,7 +382,7 @@ const o = class o extends d {
67
382
  this.$container.backgroundImageLaptop = e;
68
383
  break;
69
384
  case "background-size":
70
- this.$container.backgroundSize = g.indexOf(e) > 0 ? e : "";
385
+ this.$container.backgroundSize = y.indexOf(e) > 0 ? e : "";
71
386
  break;
72
387
  case "background-position":
73
388
  this.$container.backgroundPosition = e;
@@ -79,11 +394,11 @@ const o = class o extends d {
79
394
  case "has-gridding--mobile":
80
395
  case "has-gridding--tablet":
81
396
  case "has-gridding--laptop":
82
- this.createGridding();
397
+ this.createGridding(e);
83
398
  break;
84
399
  case "inverted":
85
- for (let r = 0; r < this.$children.length; r++)
86
- this.$children[r].hasAttribute("inverted") || this.$children[r].toggleAttribute("inverted");
400
+ for (let n = 0; n < this.$children.length; n++)
401
+ this.$children[n].hasAttribute("inverted") || this.$children[n].toggleAttribute("inverted");
87
402
  this.$el.toggleAttribute("inverted", e !== null);
88
403
  break;
89
404
  default:
@@ -96,46 +411,48 @@ const o = class o extends d {
96
411
  ".banner-content"
97
412
  ), i = ["tag", "media", "title", "description", "content", "action"];
98
413
  let e = "";
99
- this.reduced ? i.forEach((r) => {
100
- const a = this.shadowRoot.querySelector(
101
- `slot[name="${r}"]`
414
+ this.reduced ? i.forEach((n) => {
415
+ const s = this.shadowRoot.querySelector(
416
+ `slot[name="${n}"]`
102
417
  );
103
- if (a && a.assignedElements().length > 0) {
104
- if (r === "media") return;
105
- e += `'media ${r}'
418
+ if (s && s.assignedElements().length > 0) {
419
+ if (n === "media") return;
420
+ e += `'media ${n}'
106
421
  `;
107
422
  }
108
- }) : i.forEach((r) => {
109
- const a = this.shadowRoot.querySelector(
110
- `slot[name="${r}"]`
423
+ }) : i.forEach((n) => {
424
+ const s = this.shadowRoot.querySelector(
425
+ `slot[name="${n}"]`
111
426
  );
112
- a && a.assignedElements().length > 0 && (e += `'${r}'
427
+ s && s.assignedElements().length > 0 && (e += `'${n}'
113
428
  `);
114
429
  }), e || (e = "'content'"), t.style.gridTemplateAreas = e;
115
430
  }
116
- createGridding() {
117
- const t = [
118
- { prop: "hasGridding", gridProp: "gridCols", attr: "col-span" },
431
+ createGridding(t) {
432
+ const i = [
433
+ { prop: "hasGridding", gridAttr: "grid-cols", attr: "col-span" },
119
434
  {
120
435
  prop: "hasGriddingMobile",
121
- gridProp: "gridColsMobile",
436
+ gridAttr: "grid-cols--mobile",
122
437
  attr: "col-span--mobile"
123
438
  },
124
439
  {
125
440
  prop: "hasGriddingTablet",
126
- gridProp: "gridColsTablet",
441
+ gridAttr: "grid-cols--tablet",
127
442
  attr: "col-span--tablet"
128
443
  },
129
444
  {
130
445
  prop: "hasGriddingLaptop",
131
- gridProp: "gridColsLaptop",
446
+ gridAttr: "grid-cols--laptop",
132
447
  attr: "col-span--laptop"
133
448
  }
134
- ], i = this.shadowRoot.querySelector(
449
+ ], e = this.shadowRoot.querySelector(
135
450
  "px-grid > px-container"
136
451
  );
137
- t.forEach(({ prop: e, gridProp: r, attr: a }) => {
138
- this[e] && (this.$grid[r] = "3", i.setAttribute(a, "2"));
452
+ t !== null ? i.forEach(({ prop: n, gridAttr: s, attr: p }) => {
453
+ this[n] && (this.$grid.setAttribute(s, "3"), e == null || e.setAttribute(p, "2"));
454
+ }) : i.forEach(({ gridAttr: n, attr: s }) => {
455
+ this.$grid.setAttribute(n, "1"), e == null || e.setAttribute(s, "1");
139
456
  });
140
457
  }
141
458
  get $grid() {
@@ -244,9 +561,9 @@ const o = class o extends d {
244
561
  t ? this.setAttribute("has-gridding--laptop", "") : this.removeAttribute("has-gridding--laptop");
245
562
  }
246
563
  };
247
- o.nativeName = "div";
248
- let n = o;
249
- customElements.get("px-banner") || customElements.define("px-banner", n);
564
+ l.nativeName = "div";
565
+ let r = l;
566
+ customElements.get("px-banner") || customElements.define("px-banner", r);
250
567
  export {
251
- n as Banner
568
+ r as Banner
252
569
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-banner",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.20",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist"