@proximus/lavender-cell 1.0.0-alpha.12

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 +886 -0
  2. package/package.json +40 -0
package/dist/index.js ADDED
@@ -0,0 +1,886 @@
1
+ import { WithFlexAttributes as b, backgroundColorValues as v } from "@proximus/lavender-common";
2
+ const w = "::slotted(*[grow]){flex-grow:var(--flex-grow-value)}::slotted(*[shrink]){flex-shrink:var(--flex-shrink-value)}::slotted(*[basis]){flex-basis:var(--flex-basis-value)}::slotted(*[align-self]){align-self:var(--flex-align-self-value)}::slotted(*[grow--mobile]){flex-grow:var(--flex-grow--mobile-value)}::slotted(*[shrink--mobile]){flex-shrink:var(--flex-shrink--mobile-value)}::slotted(*[basis--mobile]){flex-basis:var(--flex-basis--mobile-value)}::slotted(*[align-self--mobile]){align-self:var(--flex-align-self--mobile-value)}@media screen and (min-width: 768px){::slotted(*[grow--tablet]){flex-grow:var(--flex-grow--tablet-value)}::slotted(*[shrink--tablet]){flex-shrink:var(--flex-shrink--tablet-value)}::slotted(*[basis--tablet]){flex-basis:var(--flex-basis--tablet-value)}::slotted(*[align-self--tablet]){align-self:var(--flex-align-self--tablet-value)}}@media screen and (min-width: 1025px){::slotted(*[grow--laptop]){flex-grow:var(--flex-grow--laptop-value)}::slotted(*[shrink--laptop]){flex-shrink:var(--flex-shrink--laptop-value)}::slotted(*[basis--laptop]){flex-basis:var(--flex-basis--laptop-value)}::slotted(*[align-self--laptop]){align-self:var(--flex-align-self--laptop-value)}}@media screen and (min-width: 1441px){::slotted(*[grow--desktop]){flex-grow:var(--flex-grow--desktop-value)}::slotted(*[shrink--desktop]){flex-shrink:var(--flex-shrink--desktop-value)}::slotted(*[basis--desktop]){flex-basis:var(--flex-basis--desktop-value)}::slotted(*[align-self--desktop]){align-self:var(--flex-align-self--desktop-value)}}@media only screen and (min-width: 0px) and (max-width: 767px){::slotted(*[hidden--mobile]){display:none}}@media only screen and (min-width: 768px) and (max-width: 1024px){::slotted(*[hidden--tablet]){display:none}}@media only screen and (min-width: 1025px) and (max-width: 1440px){::slotted(*[hidden--laptop]){display:none}}@media only screen and (min-width: 1441px){::slotted(*[hidden--desktop]){display:none}}", h = new CSSStyleSheet();
3
+ h.replaceSync(w);
4
+ class c extends HTMLElement {
5
+ static get observedAttributes() {
6
+ return [
7
+ "grow",
8
+ "grow--tablet",
9
+ "grow--laptop",
10
+ "grow--desktop",
11
+ "shrink",
12
+ "shrink--mobile",
13
+ "shrink--tablet",
14
+ "shrink--laptop",
15
+ "shrink--desktop",
16
+ "basis",
17
+ "basis--mobile",
18
+ "basis--tablet",
19
+ "basis--laptop",
20
+ "basis--desktop",
21
+ "align-self",
22
+ "hidden--mobile",
23
+ "hidden--tablet",
24
+ "hidden--laptop",
25
+ "hidden--desktop"
26
+ ];
27
+ }
28
+ constructor(...t) {
29
+ super(), this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.adoptedStyleSheets = [
30
+ h,
31
+ ...t
32
+ ];
33
+ }
34
+ attributeChangedCallback(t, e, i) {
35
+ if (c.observedAttributes.indexOf(t) !== -1)
36
+ if (i === null)
37
+ this.style.removeProperty(t);
38
+ else
39
+ switch (t) {
40
+ case "grow":
41
+ case "shrink":
42
+ case "basis":
43
+ case "grow--mobile":
44
+ case "grow--tablet":
45
+ case "grow--laptop":
46
+ case "grow--desktop":
47
+ case "shrink--mobile":
48
+ case "shrink--tablet":
49
+ case "shrink--laptop":
50
+ case "shrink--desktop":
51
+ case "basis--mobile":
52
+ case "basis--tablet":
53
+ case "basis--laptop":
54
+ case "basis--desktop":
55
+ case "align-self":
56
+ this.style.setProperty(`--flex-${t}-value`, i);
57
+ break;
58
+ }
59
+ }
60
+ get grow() {
61
+ return this.getAttribute("grow");
62
+ }
63
+ set grow(t) {
64
+ this.setAttribute("grow", t);
65
+ }
66
+ get shrink() {
67
+ return this.getAttribute("shrink");
68
+ }
69
+ set shrink(t) {
70
+ this.setAttribute("shrink", t);
71
+ }
72
+ get basis() {
73
+ return this.getAttribute("basis");
74
+ }
75
+ set basis(t) {
76
+ this.setAttribute("basis", t);
77
+ }
78
+ get growMobile() {
79
+ return this.getAttribute("grow--mobile");
80
+ }
81
+ set growMobile(t) {
82
+ this.setAttribute("grow--mobile", t);
83
+ }
84
+ get growTablet() {
85
+ return this.getAttribute("grow--tablet");
86
+ }
87
+ set growTablet(t) {
88
+ this.setAttribute("grow--tablet", t);
89
+ }
90
+ get growLaptop() {
91
+ return this.getAttribute("grow--laptop");
92
+ }
93
+ set growLaptop(t) {
94
+ this.setAttribute("grow--laptop", t);
95
+ }
96
+ get growDesktop() {
97
+ return this.getAttribute("grow--desktop");
98
+ }
99
+ set growDesktop(t) {
100
+ this.setAttribute("grow--desktop", t);
101
+ }
102
+ get shrinkMobile() {
103
+ return this.getAttribute("shrink--mobile");
104
+ }
105
+ set shrinkMobile(t) {
106
+ this.setAttribute("shrink--mobile", t);
107
+ }
108
+ get shrinkTablet() {
109
+ return this.getAttribute("shrink--tablet");
110
+ }
111
+ set shrinkTablet(t) {
112
+ this.setAttribute("shrink--tablet", t);
113
+ }
114
+ get shrinkLaptop() {
115
+ return this.getAttribute("shrink--laptop");
116
+ }
117
+ set shrinkLaptop(t) {
118
+ this.setAttribute("shrink--laptop", t);
119
+ }
120
+ get shrinkDesktop() {
121
+ return this.getAttribute("shrink--desktop");
122
+ }
123
+ set shrinkDesktop(t) {
124
+ this.setAttribute("shrink--desktop", t);
125
+ }
126
+ get basisMobile() {
127
+ return this.getAttribute("basis--mobile");
128
+ }
129
+ set basisMobile(t) {
130
+ this.setAttribute("basis--mobile", t);
131
+ }
132
+ get basisTablet() {
133
+ return this.getAttribute("basis--tablet");
134
+ }
135
+ set basisTablet(t) {
136
+ this.setAttribute("basis--tablet", t);
137
+ }
138
+ get basisLaptop() {
139
+ return this.getAttribute("basis--laptop");
140
+ }
141
+ set basisLaptop(t) {
142
+ this.setAttribute("basis--laptop", t);
143
+ }
144
+ get basisDesktop() {
145
+ return this.getAttribute("basis--desktop");
146
+ }
147
+ set basisDesktop(t) {
148
+ this.setAttribute("basis--desktop", t);
149
+ }
150
+ get alignSelf() {
151
+ return this.getAttribute("align-self");
152
+ }
153
+ set alignSelf(t) {
154
+ this.setAttribute("align-self", t);
155
+ }
156
+ get $el() {
157
+ return this;
158
+ }
159
+ get hiddenMobile() {
160
+ return this.getAttribute("hidden--mobile");
161
+ }
162
+ set hiddenMobile(t) {
163
+ this.setAttribute("hidden--mobile", t);
164
+ }
165
+ get hiddenTablet() {
166
+ return this.getAttribute("hidden--tablet");
167
+ }
168
+ set hiddenTablet(t) {
169
+ this.setAttribute("hidden--tablet", t);
170
+ }
171
+ get hiddenLaptop() {
172
+ return this.getAttribute("hidden--laptop");
173
+ }
174
+ set hiddenLaptop(t) {
175
+ this.setAttribute("hidden--laptop", t);
176
+ }
177
+ get hiddenDesktop() {
178
+ return this.getAttribute("hidden--desktop");
179
+ }
180
+ set hiddenDesktop(t) {
181
+ this.setAttribute("hidden--desktop", t);
182
+ }
183
+ }
184
+ const y = ".flex-container{display:flex;height:100%;width:100%;box-sizing:border-box;flex-direction:var(--flex-direction--mobile-value);gap:var(--flex-gap--mobile-value);flex-wrap:var(--flex-wrap--mobile-value);justify-content:var(--flex-justify-content--mobile-value);align-items:var(--flex-align-items--mobile-value)}@media screen and (min-width: 768px){.flex-container{flex-direction:var(--flex-direction--tablet-value);gap:var(--flex-gap--tablet-value);flex-wrap:var(--flex-wrap--tablet-value);justify-content:var(--flex-justify-content--tablet-value);align-items:var(--flex-align-items--tablet-value)}}@media screen and (min-width: 1025px){.flex-container{flex-direction:var(--flex-direction--laptop-value);gap:var(--flex-gap--laptop-value);flex-wrap:var(--flex-wrap--laptop-value);justify-content:var(--flex-justify-content--laptop-value);align-items:var(--flex-align-items--laptop-value)}}@media screen and (min-width: 1441px){.flex-container{flex-direction:var(--flex-direction--desktop-value);gap:var(--flex-gap--desktop-value);flex-wrap:var(--flex-wrap--desktop-value);justify-content:var(--flex-justify-content--desktop-value);align-items:var(--flex-align-items--desktop-value)}}", f = new CSSStyleSheet();
185
+ f.replaceSync(y);
186
+ const A = [
187
+ "after-element-none",
188
+ "after-element-2xs",
189
+ "after-element-xs",
190
+ "after-element-s",
191
+ "after-element-default",
192
+ "after-element-l",
193
+ "heading-to-subtitle",
194
+ "heading-to-content",
195
+ "inside-section-none",
196
+ "inside-section-xs",
197
+ "inside-section-s",
198
+ "inside-section-default",
199
+ "inside-section-l",
200
+ "between-sections"
201
+ ], S = [
202
+ "",
203
+ "default",
204
+ "row",
205
+ "row-reverse",
206
+ "column",
207
+ "column-reverse"
208
+ ], C = [
209
+ "",
210
+ "default",
211
+ "stretch",
212
+ "flex-start",
213
+ "flex-end",
214
+ "center",
215
+ "baseline"
216
+ ], $ = [
217
+ "",
218
+ "default",
219
+ "flex-start",
220
+ "flex-end",
221
+ "center",
222
+ "space-between",
223
+ "space-around",
224
+ "space-evenly"
225
+ ], _ = ["", "default", "nowrap", "wrap", "wrap-reverse"];
226
+ class p extends b {
227
+ constructor() {
228
+ super(f), this.template = `<div class="flex-container">
229
+ <slot></slot>
230
+ </div>`, this.shadowRoot.innerHTML = this.template;
231
+ }
232
+ connectedCallback() {
233
+ this.hasAttribute("direction") || (this.direction = "row"), this.hasAttribute("gap") || (this.gap = "inside-section-none"), this.hasAttribute("align-items") || (this.alignItems = "stretch"), this.hasAttribute("justify-content") || (this.justifyContent = "flex-start"), this.hasAttribute("wrap") || (this.wrap = "nowrap");
234
+ }
235
+ static get observedAttributes() {
236
+ return [
237
+ ...super.observedAttributes,
238
+ "direction",
239
+ "direction--mobile",
240
+ "direction--tablet",
241
+ "direction--laptop",
242
+ "direction--desktop",
243
+ "gap",
244
+ "gap--mobile",
245
+ "gap--tablet",
246
+ "gap--laptop",
247
+ "gap--desktop",
248
+ "justify-content",
249
+ "justify-content--mobile",
250
+ "justify-content--tablet",
251
+ "justify-content--laptop",
252
+ "justify-content--desktop",
253
+ "align-items",
254
+ "align-items--mobile",
255
+ "align-items--tablet",
256
+ "align-items--laptop",
257
+ "align-items--desktop",
258
+ "wrap",
259
+ "wrap--mobile",
260
+ "wrap--tablet",
261
+ "wrap--laptop",
262
+ "wrap--desktop"
263
+ ];
264
+ }
265
+ attributeChangedCallback(t, e, i) {
266
+ if (t.indexOf("direction") > -1 && !["column", "row"].includes(i))
267
+ throw new Error("Invalid direction");
268
+ switch (t) {
269
+ case "gap":
270
+ case "gap--mobile":
271
+ case "gap--tablet":
272
+ case "gap--laptop":
273
+ case "gap--desktop":
274
+ this.updateFlexProperties(t, e, i, A);
275
+ break;
276
+ case "justify-content":
277
+ case "justify-content--mobile":
278
+ case "justify-content--tablet":
279
+ case "justify-content--laptop":
280
+ case "justify-content--desktop":
281
+ this.updateFlexProperties(
282
+ t,
283
+ e,
284
+ i,
285
+ $
286
+ );
287
+ break;
288
+ case "align-items":
289
+ case "align-items--mobile":
290
+ case "align-items--tablet":
291
+ case "align-items--laptop":
292
+ case "align-items--desktop":
293
+ this.updateFlexProperties(t, e, i, C);
294
+ break;
295
+ case "wrap":
296
+ case "wrap--mobile":
297
+ case "wrap--tablet":
298
+ case "wrap--laptop":
299
+ case "wrap--desktop":
300
+ this.updateFlexProperties(t, e, i, _);
301
+ break;
302
+ case "direction":
303
+ case "direction--mobile":
304
+ case "direction--tablet":
305
+ case "direction--laptop":
306
+ case "direction--desktop":
307
+ this.updateFlexProperties(t, e, i, S);
308
+ break;
309
+ default:
310
+ super.attributeChangedCallback(t, e, i);
311
+ break;
312
+ }
313
+ }
314
+ updateFlexProperties(t, e, i, s) {
315
+ this.checkName(s, i) || console.error(`Bad ${t} value for`, this.$el);
316
+ const l = t.indexOf("--") > -1, a = l ? t.split("--")[0] : t, o = [];
317
+ if (!l)
318
+ this.getAttribute(a + "--mobile") || o.push("mobile"), this.getAttribute(a + "--tablet") || o.push("tablet"), this.getAttribute(a + "--laptop") || o.push("laptop"), this.getAttribute(a + "--desktop") || o.push("desktop"), o.forEach((n) => {
319
+ this.updateStyle(a, n, e, s), this.updateStyle(a, n, i, s);
320
+ });
321
+ else {
322
+ const n = t.split("--")[1];
323
+ this.updateStyle(a, n, e, s), this.updateStyle(a, n, i, s);
324
+ }
325
+ }
326
+ updateStyle(t, e, i, s) {
327
+ i !== null && i !== "" && i !== "default" && (t === "gap" && s.includes(i) ? this.$el.style.setProperty(
328
+ `--flex-${t}--${e}-value`,
329
+ `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
330
+ ) : this.$el.style.setProperty(
331
+ `--flex-${t}--${e}-value`,
332
+ i
333
+ ));
334
+ }
335
+ checkName(t, e) {
336
+ return t.includes(e);
337
+ }
338
+ get direction() {
339
+ return this.getAttribute("direction");
340
+ }
341
+ set direction(t) {
342
+ this.setAttribute("direction", t);
343
+ }
344
+ get directionMobile() {
345
+ return this.getAttribute("direction--mobile");
346
+ }
347
+ set directionMobile(t) {
348
+ this.setAttribute("direction--mobile", t);
349
+ }
350
+ get directionTablet() {
351
+ return this.getAttribute("direction--tablet");
352
+ }
353
+ set directionTablet(t) {
354
+ this.setAttribute("direction--tablet", t);
355
+ }
356
+ get directionLaptop() {
357
+ return this.getAttribute("direction--laptop");
358
+ }
359
+ set directionLaptop(t) {
360
+ this.setAttribute("direction--laptop", t);
361
+ }
362
+ get directionDesktop() {
363
+ return this.getAttribute("direction--desktop");
364
+ }
365
+ set directionDesktop(t) {
366
+ this.setAttribute("direction--desktop", t);
367
+ }
368
+ get gap() {
369
+ return this.getAttribute("gap");
370
+ }
371
+ set gap(t) {
372
+ this.setAttribute("gap", t);
373
+ }
374
+ get gapMobile() {
375
+ return this.getAttribute("gap--mobile");
376
+ }
377
+ set gapMobile(t) {
378
+ this.setAttribute("gap--mobile", t);
379
+ }
380
+ get gapTablet() {
381
+ return this.getAttribute("gap--tablet");
382
+ }
383
+ set gapTablet(t) {
384
+ this.setAttribute("gap--tablet", t);
385
+ }
386
+ get gapLaptop() {
387
+ return this.getAttribute("gap--laptop");
388
+ }
389
+ set gapLaptop(t) {
390
+ this.setAttribute("gap--laptop", t);
391
+ }
392
+ get justifyContent() {
393
+ return this.getAttribute("justify-content");
394
+ }
395
+ set justifyContent(t) {
396
+ this.setAttribute("justify-content", t);
397
+ }
398
+ get justifyContentMobile() {
399
+ return this.getAttribute("justify-content--mobile");
400
+ }
401
+ set justifyContentMobile(t) {
402
+ this.setAttribute("justify-content--mobile", t);
403
+ }
404
+ get justifyContentTablet() {
405
+ return this.getAttribute("justify-content--tablet");
406
+ }
407
+ set justifyContentTablet(t) {
408
+ this.setAttribute("justify-content--tablet", t);
409
+ }
410
+ get justifyContentLaptop() {
411
+ return this.getAttribute("justify-content--laptop");
412
+ }
413
+ set justifyContentLaptop(t) {
414
+ this.setAttribute("justify-content--laptop", t);
415
+ }
416
+ get justifyContentDesktop() {
417
+ return this.getAttribute("justify-content--desktop");
418
+ }
419
+ set justifyContentDesktop(t) {
420
+ this.setAttribute("justify-content--desktop", t);
421
+ }
422
+ get alignItems() {
423
+ return this.getAttribute("align-items");
424
+ }
425
+ set alignItems(t) {
426
+ this.setAttribute("align-items", t);
427
+ }
428
+ get alignItemsMobile() {
429
+ return this.getAttribute("align-items--mobile");
430
+ }
431
+ set alignItemsMobile(t) {
432
+ this.setAttribute("align-items--mobile", t);
433
+ }
434
+ get alignItemsTablet() {
435
+ return this.getAttribute("align-items--tablet");
436
+ }
437
+ set alignItemsTablet(t) {
438
+ this.setAttribute("align-items--tablet", t);
439
+ }
440
+ get alignItemsLaptop() {
441
+ return this.getAttribute("align-items--laptop");
442
+ }
443
+ set alignItemsLaptop(t) {
444
+ this.setAttribute("align-items--laptop", t);
445
+ }
446
+ get alignItemsDesktop() {
447
+ return this.getAttribute("align-items--desktop");
448
+ }
449
+ set alignItemsDesktop(t) {
450
+ this.setAttribute("align-items--desktop", t);
451
+ }
452
+ get wrap() {
453
+ return this.getAttribute("wrap");
454
+ }
455
+ set wrap(t) {
456
+ this.setAttribute("wrap", t);
457
+ }
458
+ get wrapMobile() {
459
+ return this.getAttribute("wrap--mobile");
460
+ }
461
+ set wrapMobile(t) {
462
+ this.setAttribute("wrap--mobile", t);
463
+ }
464
+ get wrapTablet() {
465
+ return this.getAttribute("wrap--tablet");
466
+ }
467
+ set wrapTablet(t) {
468
+ this.setAttribute("wrap--tablet", t);
469
+ }
470
+ get wrapLaptop() {
471
+ return this.getAttribute("wrap--laptop");
472
+ }
473
+ set wrapLaptop(t) {
474
+ this.setAttribute("wrap--laptop", t);
475
+ }
476
+ get wrapDesktop() {
477
+ return this.getAttribute("wrap--desktop");
478
+ }
479
+ set wrapDesktop(t) {
480
+ this.setAttribute("wrap--desktop", t);
481
+ }
482
+ get $el() {
483
+ return this.shadowRoot.querySelector(".flex-container");
484
+ }
485
+ }
486
+ customElements.get("px-stack") || customElements.define("px-stack", p);
487
+ class j extends p {
488
+ constructor() {
489
+ super();
490
+ }
491
+ connectedCallback() {
492
+ super.connectedCallback(), this.direction = "column", this.directionMobile = "column", this.directionTablet = "column", this.directionLaptop = "column", this.directionDesktop = "column";
493
+ }
494
+ }
495
+ customElements.get("px-vstack") || customElements.define("px-vstack", j);
496
+ class z extends p {
497
+ constructor() {
498
+ super();
499
+ }
500
+ connectedCallback() {
501
+ super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
502
+ }
503
+ }
504
+ customElements.get("px-hstack") || customElements.define("px-hstack", z);
505
+ class I extends HTMLElement {
506
+ constructor() {
507
+ super();
508
+ }
509
+ static get observedAttributes() {
510
+ return ["grow"];
511
+ }
512
+ attributeChangedCallback(t, e, i) {
513
+ t === "grow" && (this.style.flexGrow = i);
514
+ }
515
+ connectedCallback() {
516
+ this.style.flexGrow = this.getAttribute("grow") || "1";
517
+ }
518
+ get grow() {
519
+ return this.getAttribute("grow");
520
+ }
521
+ set grow(t) {
522
+ this.setAttribute("grow", t);
523
+ }
524
+ }
525
+ customElements.define("px-spacer", I);
526
+ const L = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5rem}", x = new CSSStyleSheet();
527
+ x.replaceSync(L);
528
+ class H extends b {
529
+ constructor() {
530
+ super(x), this.template = (t) => `
531
+ <px-container border-radius="none" padding="none">
532
+ <px-vstack>
533
+ <px-container id="header-container" border-radius="none">
534
+ <px-hstack>
535
+ <px-spacer></px-spacer>
536
+ <px-vstack
537
+ id="header-vstack-container"
538
+ gap="1rem"
539
+ grow="${this.grow}"
540
+ basis="${this.basis}"
541
+ >
542
+ <slot name="header-container"></slot>
543
+ </px-vstack>
544
+ <px-spacer></px-spacer>
545
+ </px-hstack>
546
+ </px-container>
547
+ <px-container
548
+ id="image-container"
549
+ border-radius="none"
550
+ padding="none"
551
+ padding-top="xl"
552
+ id="image-box"
553
+ background-size="cover"
554
+ background-position="top center"
555
+ padding-bottom="xl"
556
+ border-radius="none"
557
+ bgimg="${this.backgroundImage}"
558
+ >
559
+ <px-hstack>
560
+ <px-spacer></px-spacer>
561
+ <px-vstack grow="${this.grow}" basis="${this.basis}">
562
+ <slot name="image-container"></slot>
563
+ </px-vstack>
564
+ <px-spacer></px-spacer>
565
+ </px-hstack>
566
+ </px-container>
567
+ ${t ? ` <px-hstack>
568
+ <px-spacer></px-spacer>
569
+ <px-container border-radius="none" box-shadow="xl" id="image-sticky-box" border="s" grow="${this.grow}" basis="${this.basis}" border-radius="m">
570
+ <px-vstack gap="1rem">
571
+ <slot name="image-sticky-container"></slot>
572
+ </px-vstack>
573
+ </px-container>
574
+ <px-spacer></px-spacer>
575
+ </px-hstack>` : ""}
576
+ <px-container
577
+ id="body-container"
578
+ id="main"
579
+ background-color="${this.backgroundColor}"
580
+ padding="none"
581
+ padding-top="xl"
582
+ padding-bottom="xl"
583
+ >
584
+ <px-hstack>
585
+ <px-spacer></px-spacer>
586
+ <px-vstack
587
+ id="body-vstack-container"
588
+ gap="3rem"
589
+ grow="${this.grow}"
590
+ basis="${this.basis}"
591
+ >
592
+ <slot name="body-container"></slot>
593
+ </px-vstack>
594
+ <px-spacer></px-spacer>
595
+ </px-hstack>
596
+ </px-container>
597
+ <px-container
598
+ id="contact-container"
599
+ border-radius="none"
600
+ id="main"
601
+ background-color="container-weak"
602
+ padding="none"
603
+ padding-top="xl"
604
+ padding-bottom="xl"
605
+ >
606
+ <px-hstack>
607
+ <px-spacer></px-spacer>
608
+ <px-vstack gap="3rem" grow="${this.grow}" basis="${this.basis}">
609
+ <slot name="contact-container"></slot>
610
+ </px-vstack>
611
+ <px-spacer></px-spacer>
612
+ </px-hstack>
613
+ </px-container>
614
+ <px-container
615
+ id="footer-container"
616
+ background-color="none"
617
+ border-radius="none"
618
+ style="background-color: rgb(108, 66, 156)"
619
+ padding-top="xl"
620
+ padding-bottom="xl"
621
+ >
622
+ <px-hstack>
623
+ <px-spacer></px-spacer>
624
+ <px-vstack gap="3rem" grow="${this.grow}" basis="${this.basis}">
625
+ <slot name="footer-container"></slot>
626
+ </px-vstack>
627
+ <px-spacer></px-spacer>
628
+ </px-hstack>
629
+ </px-container>
630
+ </px-vstack>
631
+ </px-container>
632
+ `, this.shadowRoot.innerHTML = this.template(!!this.$imageStickySlot);
633
+ }
634
+ static get observedAttributes() {
635
+ return [
636
+ ...super.observedAttributes,
637
+ "background-image",
638
+ "gap",
639
+ "background-color",
640
+ "padding-vertical",
641
+ "padding-horizontal"
642
+ ];
643
+ }
644
+ get $wideImage() {
645
+ return this.shadowRoot.querySelector("#image-box");
646
+ }
647
+ get $bodyVStackContainer() {
648
+ return this.shadowRoot.querySelector("#header-vstack-container");
649
+ }
650
+ get $bodyContainer() {
651
+ return this.shadowRoot.querySelector("#body-container");
652
+ }
653
+ get $contactContainer() {
654
+ return this.shadowRoot.querySelector("#contact-container");
655
+ }
656
+ get $footerContainer() {
657
+ return this.shadowRoot.querySelector("#footer-container");
658
+ }
659
+ get $headerContainer() {
660
+ return this.shadowRoot.querySelector("#header-container");
661
+ }
662
+ get $imageContainer() {
663
+ return this.shadowRoot.querySelector("#image-container");
664
+ }
665
+ get backgroundImage() {
666
+ return this.getAttribute("background-image");
667
+ }
668
+ get $imageStickySlot() {
669
+ return this.querySelector('*[slot="image-sticky-container"]');
670
+ }
671
+ get $main() {
672
+ return this.shadowRoot.querySelector("#main");
673
+ }
674
+ get backgroundColor() {
675
+ return this.getAttribute("background-color") || "none";
676
+ }
677
+ get paddingVertical() {
678
+ return this.getAttribute("padding-vertical");
679
+ }
680
+ get paddingHorizontal() {
681
+ return this.getAttribute("padding-horizontal");
682
+ }
683
+ set paddingVertical(t) {
684
+ this.setAttribute("padding-vertical", t);
685
+ }
686
+ set paddingHorizontal(t) {
687
+ this.setAttribute("padding-horizontal", t);
688
+ }
689
+ get gap() {
690
+ return this.getAttribute("gap");
691
+ }
692
+ connectedCallback() {
693
+ this.handlePaddingVerticalChange(this.paddingVertical), this.handlePaddingHorizontalChange(this.paddingHorizontal);
694
+ }
695
+ attributeChangedCallback(t, e, i) {
696
+ if (e !== i)
697
+ switch (t) {
698
+ case "background-image":
699
+ this.$imageContainer.setAttribute("background-image", i);
700
+ break;
701
+ case "gap":
702
+ this.$bodyVStackContainer.setAttribute("gap", i);
703
+ break;
704
+ case "background-color":
705
+ this.$bodyContainer.setAttribute(
706
+ "background-color",
707
+ v.indexOf(i) > 0 ? i : "none"
708
+ );
709
+ break;
710
+ case "padding-vertical":
711
+ this.handlePaddingVerticalChange(i);
712
+ break;
713
+ case "padding-horizontal":
714
+ this.handlePaddingHorizontalChange(i);
715
+ break;
716
+ default:
717
+ super.attributeChangedCallback(t, e, i);
718
+ }
719
+ }
720
+ handlePaddingVerticalChange(t) {
721
+ this.$headerContainer.setAttribute("padding-top", t), this.$footerContainer.setAttribute("padding-bottom", t);
722
+ }
723
+ handlePaddingHorizontalChange(t) {
724
+ this.$headerContainer.paddingLeft = t, this.$headerContainer.paddingRight = t, this.$bodyContainer.paddingLeft = t, this.$bodyContainer.paddingRight = t, this.$contactContainer.paddingLeft = t, this.$contactContainer.paddingRight = t, this.$footerContainer.paddingLeft = t, this.$footerContainer.paddingRight = t, this.$imageContainer.paddingLeft = t, this.$imageContainer.paddingRight = t;
725
+ }
726
+ }
727
+ customElements.get("px-page") === void 0 && customElements.define("px-page", H);
728
+ const M = '.cell__container{font-family:var(--px-font-family);line-height:var(--px-line-height-m);font-size:var(--px-text-size-label-l-mobile);font-weight:700;color:var(--px-text-color-heading-neutral-default);padding:var(--px-padding-s-mobile)}.cell__container,.cell__container *{box-sizing:border-box}.cell__container ::slotted([slot="description"]){font-weight:400;font-size:var(--px-text-size-label-m-mobile)}.cell__container ::slotted([slot="suffix"]){text-align:right}@media only screen and (min-width: 768px){.cell__container{font-size:var(--px-text-size-label-l-tablet);padding:var(--px-padding-s-tablet)}.cell__container ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-tablet)}}@media only screen and (min-width: 1025px){.cell__container{font-size:var(--px-text-size-label-l-desktop);padding:var(--px-padding-s-desktop)}.cell__container ::slotted([slot="description"]){font-size:var(--px-text-size-label-m-desktop)}}:host([inverted]) .cell__container{color:var(--px-text-color-heading-neutral-inverted)}', R = '.tile__container{display:flex;flex-direction:column;font-family:var(--px-font-family);line-height:var(--px-line-height-m);font-size:var(--px-text-size-label-m-mobile);font-weight:700;color:var(--px-text-color-action-neutral-default)}.tile__container,.tile__container *{box-sizing:border-box}.tile__container .tile__header:not(.tile__header--empty)+.tile__content:not(.tile__content--empty){margin-top:var(--px-spacing-inside-section-default-mobile)}.tile__container ::slotted([slot="prefix"]){font-weight:400}.tile__container ::slotted([slot="description"]){font-weight:400}@media only screen and (min-width: 768px){.tile__container{font-size:var(--px-text-size-label-m-tablet)}.tile__container .tile__header:not(.tile__header--empty)+.tile__content:not(.tile__content--empty){margin-top:var(--px-spacing-inside-section-default-tablet)}}@media only screen and (min-width: 1025px){.tile__container{font-size:var(--px-text-size-label-m-desktop)}.tile__container .tile__header:not(.tile__header--empty)+.tile__content:not(.tile__content--empty){margin-top:var(--px-spacing-inside-section-default-desktop)}}:host([inverted]) .tile__container{color:var(--px-text-color-action-neutral-inverted)}', T = new CSSStyleSheet();
729
+ T.replaceSync(R);
730
+ const d = ["", "default", "xs", "s", "l", "2xl"], g = ["", "default", "s", "m", "l"], m = new CSSStyleSheet();
731
+ m.replaceSync(M);
732
+ const P = ["", "default", "naked", "contained"], u = ["secondary"];
733
+ class q extends c {
734
+ template() {
735
+ return `
736
+ <div class="cell__container">
737
+ <px-hstack gap="after-element-s" justify-content="space-between" align-items="center">
738
+ <px-hstack gap="after-element-s" align-items="center">
739
+ <slot name="prefix"></slot>
740
+ <slot name="visual"></slot>
741
+ <px-vstack gap="after-element-2xs">
742
+ <slot></slot>
743
+ <slot name="description"></slot>
744
+ </px-vstack>
745
+ </px-hstack>
746
+ <px-hstack gap="after-element-s" align-items="center" class="cell__suffix-action-container">
747
+ <px-stack direction="column" gap="after-element-2xs" align-items="flex-end" class="cell__suffix-container">
748
+ <slot name="suffix"></slot>
749
+ </px-stack>
750
+ <span class="cell__action-indicator"></span>
751
+ </px-hstack>
752
+ </px-hstack>
753
+ </div>
754
+ `;
755
+ }
756
+ constructor() {
757
+ super(m), this.shadowRoot.innerHTML = this.template();
758
+ }
759
+ connectedCallback() {
760
+ if (this.$slotVisual) {
761
+ const t = this.querySelector("px-icon"), e = this.querySelector("px-img");
762
+ t && this.configurePrefixIcon(t), e && this.configurePrefixImg(e);
763
+ }
764
+ this.$slotSuffix && this.configureSlotSuffix(), this.$actionIndicator.textContent.trim() || (this.$suffixActionContainer.gap = "after-element-none");
765
+ }
766
+ static get observedAttributes() {
767
+ return [...super.observedAttributes, "inverted", "variant"];
768
+ }
769
+ attributeChangedCallback(t, e, i) {
770
+ if (super.attributeChangedCallback(t, e, i), e !== i)
771
+ switch (t) {
772
+ case "variant":
773
+ this.updateVariant(e, i, P);
774
+ break;
775
+ default:
776
+ super.attributeChangedCallback(t, e, i);
777
+ break;
778
+ }
779
+ }
780
+ configureSlotSuffix() {
781
+ const t = this.querySelectorAll("px-button-icon"), e = t.length > 0;
782
+ t.length > 1 && (this.$suffixContainer.gap = "after-element-s", this.$suffixContainer.direction = "row", this.$suffixContainer.alignItems = "center"), e && t.forEach((s) => {
783
+ s.hasAttribute("variant") ? u.includes(
784
+ s.getAttribute("variant")
785
+ ) || (console.error(
786
+ `Wrong button-icon variant value for suffix. Allowed values are: ${u.join(
787
+ ", "
788
+ )}.`
789
+ ), s.setAttribute("variant", "secondary")) : s.setAttribute("variant", "secondary");
790
+ });
791
+ }
792
+ configurePrefixIcon(t) {
793
+ t.hasAttribute("size") ? d.includes(
794
+ t.getAttribute("size")
795
+ ) ? (t.getAttribute("size") === "" || t.getAttribute("size") === "default") && t.setAttribute("size", "s") : (console.error(
796
+ `Wrong icon size value for prefix. Allowed values are: ${d.join(
797
+ ", "
798
+ )}.`
799
+ ), t.setAttribute("size", "s")) : t.setAttribute("size", "s"), t.setAttribute("color", "content-brand");
800
+ }
801
+ configurePrefixImg(t) {
802
+ t.hasAttribute("width") ? g.includes(
803
+ t.getAttribute("width")
804
+ ) ? (t.getAttribute("width") === "" || t.getAttribute("width") === "default") && t.setAttribute("width", "s") : (console.error(
805
+ `Wrong img width value for prefix. Allowed values are: ${g.join(
806
+ ", "
807
+ )}.`
808
+ ), t.setAttribute("width", "s")) : t.setAttribute("width", "s"), t.setAttribute("border-radius", "pill");
809
+ }
810
+ checkName(t, e) {
811
+ return t.includes(e);
812
+ }
813
+ _toggleClass(t, e) {
814
+ t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(t), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(e);
815
+ }
816
+ updateVariant(t, e, i) {
817
+ if (!this.checkName(i, e)) {
818
+ console.error(
819
+ `${e} is not an allowed variant value for ${this.$el}.`
820
+ );
821
+ return;
822
+ }
823
+ this._toggleClass(t, e);
824
+ }
825
+ get $suffixContainer() {
826
+ return this.shadowRoot.querySelector(".cell__suffix-container");
827
+ }
828
+ get $actionIndicator() {
829
+ return this.shadowRoot.querySelector(
830
+ ".cell__action-indicator"
831
+ );
832
+ }
833
+ get $suffixActionContainer() {
834
+ return this.shadowRoot.querySelector(
835
+ ".cell__suffix-action-container"
836
+ );
837
+ }
838
+ get $slotPrefix() {
839
+ return this.querySelector('[slot="prefix"]');
840
+ }
841
+ get $slotVisual() {
842
+ return this.querySelector('[slot="visual"]');
843
+ }
844
+ get $slotDescription() {
845
+ return this.querySelector('[slot="description"]');
846
+ }
847
+ get $slotSuffix() {
848
+ return this.querySelector('[slot="suffix"]');
849
+ }
850
+ get inverted() {
851
+ return this.getAttribute("inverted");
852
+ }
853
+ set inverted(t) {
854
+ this.setAttribute("inverted", t);
855
+ }
856
+ get variant() {
857
+ return this.getAttribute("variant");
858
+ }
859
+ set variant(t) {
860
+ this.setAttribute("variant", t);
861
+ }
862
+ }
863
+ const D = ":host{display:block}.cell{background-color:transparent}.cell,.cell *{box-sizing:border-box}.contained{background-color:var(--px-color-background-action-neutral-bare-default);border-radius:var(--px-radius-main)}:host([inverted]) .cell{background-color:transparent}:host([inverted]) .contained{background-color:var(--px-color-background-action-neutral-bare-inverted)}", k = new CSSStyleSheet();
864
+ k.replaceSync(D);
865
+ class E extends q {
866
+ template() {
867
+ return `
868
+ <div class="cell">
869
+ ${super.template()}
870
+ </div>
871
+ `;
872
+ }
873
+ constructor() {
874
+ super(), this.shadowRoot.adoptedStyleSheets = [
875
+ ...this.shadowRoot.adoptedStyleSheets,
876
+ k
877
+ ];
878
+ }
879
+ get $el() {
880
+ return this.shadowRoot.querySelector(".cell");
881
+ }
882
+ }
883
+ customElements.define("px-cell", E);
884
+ export {
885
+ E as Cell
886
+ };
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@proximus/lavender-cell",
3
+ "version": "1.0.0-alpha.12",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./src/index.ts",
9
+ "development": "./src/index.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./src/*.css": {
13
+ "development": "src/*.css"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "type": "module",
20
+ "scripts": {
21
+ "build": "rm -rf dist;tsc; vite build",
22
+ "test": "vitest run --coverage"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "gitHead": "2e2d845407e7c36959a31fd015a416e598d2d5a9",
28
+ "lerna": {
29
+ "command": {
30
+ "publish": {
31
+ "assets": [
32
+ "CHANGELOG.md",
33
+ "package.json",
34
+ "dist/*.js",
35
+ "dist/css/**/*.css"
36
+ ]
37
+ }
38
+ }
39
+ }
40
+ }