@proximus/lavender-table 1.2.0-alpha.37

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 +656 -0
  2. package/package.json +40 -0
package/dist/index.js ADDED
@@ -0,0 +1,656 @@
1
+ import { WithFlexAttributes as a, backgroundColorValues as b } from "@proximus/lavender-common";
2
+ const u = ":host{display:table;width:100%}", r = new CSSStyleSheet();
3
+ r.replaceSync(u);
4
+ class x extends HTMLElement {
5
+ constructor() {
6
+ super(), this.template = () => `
7
+ <slot></slot>
8
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [r];
9
+ }
10
+ connectedCallback() {
11
+ this.style.display = "table", this.setAttribute("role", "table");
12
+ }
13
+ }
14
+ customElements.get("px-table") || customElements.define("px-table", x);
15
+ const m = ":host{display:table-header-group}::slotted(px-tr){background-color:var(--px-background-color-container-weak-default)}", l = new CSSStyleSheet();
16
+ l.replaceSync(m);
17
+ class y extends HTMLElement {
18
+ constructor() {
19
+ super(), this.template = () => `
20
+ <slot></slot>
21
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [l];
22
+ }
23
+ connectedCallback() {
24
+ this.style.display = "table-header-group", this.setAttribute("role", "rowgroup");
25
+ }
26
+ }
27
+ customElements.get("px-thead") || customElements.define("px-thead", y);
28
+ const f = ":host{display:table-row}", n = new CSSStyleSheet();
29
+ n.replaceSync(f);
30
+ class v extends HTMLElement {
31
+ constructor() {
32
+ super(), this.template = () => `
33
+ <slot></slot>
34
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [n];
35
+ }
36
+ connectedCallback() {
37
+ this.style.display = "table-row", this.setAttribute("role", "row");
38
+ }
39
+ }
40
+ customElements.get("px-tr") || customElements.define("px-tr", v);
41
+ const k = ':host{display:table-cell;vertical-align:middle;border-bottom:var(--px-border-size-l) solid var( --th-border-color-default, var(--px-border-color-container-main-default) )}.th{padding:var(--px-padding-s-mobile) var(--px-padding-xs-mobile);font-family:var(--px-font-family);font-weight:400;font-size:var(--px-text-size-body-m-mobile);line-height:var(--px-line-height-m);color:var(--px-text-color-body-neutral-strong-default)}.th ::slotted([slot="description"]){font-size:var(--px-text-size-body-s-mobile);color:var(--px-text-color-body-neutral-weak-default)}@media only screen and (min-width: 768px){.th{padding:var(--px-padding-s-tablet) var(--px-padding-xs-tablet);font-size:var(--px-text-size-body-m-tablet)}.th ::slotted([slot="description"]){font-size:var(--px-text-size-body-s-tablet)}}@media only screen and (min-width: 1025px){.th{padding:var(--px-padding-s-desktop) var(--px-padding-xs-desktop);font-size:var(--px-text-size-body-m-desktop)}.th ::slotted([slot="description"]){font-size:var(--px-text-size-body-s-desktop)}}', p = new CSSStyleSheet();
42
+ p.replaceSync(k);
43
+ class w extends HTMLElement {
44
+ constructor() {
45
+ super(), this.template = () => `
46
+ <div class="th">
47
+ <px-vstack gap="after-element-none">
48
+ <px-hstack gap="after-element-2xs" align-items="center">
49
+ <slot></slot>
50
+ <slot name="info"></slot>
51
+ </px-hstack>
52
+ <slot name="description"></slot>
53
+ </px-vstack>
54
+ </div>
55
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [p];
56
+ }
57
+ connectedCallback() {
58
+ this.style.display = "table-cell", this.style.verticalAlign = "middle", this.style.borderBottom = "var(--px-border-size-l) solid var(--th-border-color-default)", this.setAttribute("role", "columnheader");
59
+ const t = this.querySelector('[slot="info"]');
60
+ t && (t.setAttribute("size", "xs"), t.setAttribute("color", "content-brand"));
61
+ }
62
+ }
63
+ customElements.get("px-th") || customElements.define("px-th", w);
64
+ const S = ":host{display:table-row-group}::slotted(px-tr){background-color:var(--px-background-color-container-weak-default)}::slotted(px-tr:hover){background-color:var(--px-background-color-action-neutral-hover-default)}", d = new CSSStyleSheet();
65
+ d.replaceSync(S);
66
+ class $ extends HTMLElement {
67
+ constructor() {
68
+ super(), this.template = () => `
69
+ <slot></slot>
70
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [d];
71
+ }
72
+ connectedCallback() {
73
+ this.style.display = "table-row-group", this.setAttribute("role", "rowgroup");
74
+ }
75
+ }
76
+ customElements.get("px-tbody") || customElements.define("px-tbody", $);
77
+ const A = ':host{display:table-cell;vertical-align:middle;border-bottom:var(--px-border-size-m) solid var( --td-border-color-default, var(--px-border-color-container-main-default) )}.td{height:100%;padding:var(--px-padding-s-mobile) var(--px-padding-xs-mobile);font-family:var(--px-font-family);font-weight:400;font-size:var(--px-text-size-body-m-mobile);line-height:var(--px-line-height-m);color:var(--px-text-color-body-neutral-strong-default)}.td ::slotted([slot="description"]){font-size:var(--px-text-size-body-s-mobile);color:var(--px-text-color-body-neutral-weak-default)}@media only screen and (min-width: 768px){.td{padding:var(--px-padding-s-tablet) var(--px-padding-xs-tablet);font-size:var(--px-text-size-body-m-tablet)}.td ::slotted([slot="description"]){font-size:var(--px-text-size-body-s-tablet)}}@media only screen and (min-width: 1025px){.td{padding:var(--px-padding-s-desktop) var(--px-padding-xs-desktop);font-size:var(--px-text-size-body-m-tablet)}.td ::slotted([slot="description"]){font-size:var(--px-text-size-body-s-desktop)}}', C = ".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)}}", c = new CSSStyleSheet();
78
+ c.replaceSync(C);
79
+ const j = [
80
+ "after-element-none",
81
+ "after-element-2xs",
82
+ "after-element-xs",
83
+ "after-element-s",
84
+ "after-element-default",
85
+ "after-element-l",
86
+ "heading-to-subtitle",
87
+ "heading-to-content",
88
+ "inside-section-none",
89
+ "inside-section-xs",
90
+ "inside-section-s",
91
+ "inside-section-default",
92
+ "inside-section-l",
93
+ "between-sections"
94
+ ];
95
+ class o extends a {
96
+ constructor() {
97
+ super(c), this.template = `<div class="flex-container">
98
+ <slot></slot>
99
+ </div>`, this.shadowRoot.innerHTML = this.template;
100
+ }
101
+ connectedCallback() {
102
+ this.hasAttribute("direction") || (this.direction = "row");
103
+ }
104
+ static get observedAttributes() {
105
+ return [
106
+ ...super.observedAttributes,
107
+ "direction",
108
+ "direction--mobile",
109
+ "direction--tablet",
110
+ "direction--laptop",
111
+ "direction--desktop",
112
+ "gap",
113
+ "justify-content",
114
+ "justify-content--mobile",
115
+ "justify-content--tablet",
116
+ "justify-content--laptop",
117
+ "justify-content--desktop",
118
+ "align-items",
119
+ "align-items--mobile",
120
+ "align-items--tablet",
121
+ "align-items--laptop",
122
+ "align-items--desktop",
123
+ "wrap",
124
+ "wrap-mobile",
125
+ "wrap-tablet",
126
+ "wrap-laptop",
127
+ "wrap-desktop"
128
+ ];
129
+ }
130
+ attributeChangedCallback(t, i, e) {
131
+ if (t.indexOf("direction") > -1 && !["column", "row"].includes(e))
132
+ throw new Error("Invalid direction");
133
+ switch (t) {
134
+ case "gap":
135
+ this.$el.style.setProperty(
136
+ "--flex-gap-mobile-value",
137
+ this.getGapCSSVariable(e, "mobile")
138
+ ), this.$el.style.setProperty(
139
+ "--flex-gap-tablet-value",
140
+ this.getGapCSSVariable(e, "tablet")
141
+ ), this.$el.style.setProperty(
142
+ "--flex-gap-laptop-value",
143
+ this.getGapCSSVariable(e, "desktop")
144
+ ), this.$el.style.setProperty(
145
+ "--flex-gap-desktop-value",
146
+ this.getGapCSSVariable(e, "desktop")
147
+ );
148
+ break;
149
+ case "direction":
150
+ this.$el.style.getPropertyValue("--flex-direction--mobile-value") || this.$el.style.setProperty(
151
+ "--flex-direction--mobile-value",
152
+ e
153
+ ), this.$el.style.getPropertyValue("--flex-direction--tablet-value") || this.$el.style.setProperty(
154
+ "--flex-direction--tablet-value",
155
+ e
156
+ ), this.$el.style.getPropertyValue("--flex-direction--laptop-value") || this.$el.style.setProperty(
157
+ "--flex-direction--laptop-value",
158
+ e
159
+ ), this.$el.style.getPropertyValue("--flex-direction--desktop-value") || this.$el.style.setProperty(
160
+ "--flex-direction--desktop-value",
161
+ e
162
+ );
163
+ break;
164
+ case "justify-content":
165
+ this.$el.style.getPropertyValue(
166
+ "--flex-justify-content--mobile-value"
167
+ ) || this.$el.style.setProperty(
168
+ "--flex-justify-content--mobile-value",
169
+ e
170
+ ), this.$el.style.getPropertyValue(
171
+ "--flex-justify-content--tablet-value"
172
+ ) || this.$el.style.setProperty(
173
+ "--flex-justify-content--tablet-value",
174
+ e
175
+ ), this.$el.style.getPropertyValue(
176
+ "--flex-justify-content--laptop-value"
177
+ ) || this.$el.style.setProperty(
178
+ "--flex-justify-content--laptop-value",
179
+ e
180
+ ), this.$el.style.getPropertyValue(
181
+ "--flex-justify-content--desktop-value"
182
+ ) || this.$el.style.setProperty(
183
+ "--flex-justify-content--desktop-value",
184
+ e
185
+ );
186
+ break;
187
+ case "align-items":
188
+ this.$el.style.getPropertyValue("--flex-align-items--mobile-value") || this.$el.style.setProperty(
189
+ "--flex-align-items--mobile-value",
190
+ e
191
+ ), this.$el.style.getPropertyValue("--flex-align-items--tablet-value") || this.$el.style.setProperty(
192
+ "--flex-align-items--tablet-value",
193
+ e
194
+ ), this.$el.style.getPropertyValue("--flex-align-items--laptop-value") || this.$el.style.setProperty(
195
+ "--flex-align-items--laptop-value",
196
+ e
197
+ ), this.$el.style.getPropertyValue("--flex-align-items--desktop-value") || this.$el.style.setProperty(
198
+ "--flex-align-items--desktop-value",
199
+ e
200
+ );
201
+ break;
202
+ case "wrap":
203
+ this.$el.style.getPropertyValue("--flex-wrap-mobile-value") || this.$el.style.setProperty("--flex-wrap-mobile-value", e), this.$el.style.getPropertyValue("--flex-wrap-tablet-value") || this.$el.style.setProperty("--flex-wrap-tablet-value", e), this.$el.style.getPropertyValue("--flex-wrap-laptop-value") || this.$el.style.setProperty("--flex-wrap-laptop-value", e), this.$el.style.getPropertyValue("--flex-wrap-desktop-value") || this.$el.style.setProperty("--flex-wrap-desktop-value", e);
204
+ break;
205
+ case "direction--mobile":
206
+ case "direction--tablet":
207
+ case "direction--laptop":
208
+ case "direction--desktop":
209
+ case "justify-content--mobile":
210
+ case "justify-content--tablet":
211
+ case "justify-content--laptop":
212
+ case "justify-content--desktop":
213
+ case "align-items--mobile":
214
+ case "align-items--tablet":
215
+ case "align-items--laptop":
216
+ case "align-items--desktop":
217
+ case "wrap-mobile":
218
+ case "wrap-tablet":
219
+ case "wrap-laptop":
220
+ case "wrap-desktop":
221
+ this.$el.style.setProperty(`--flex-${t}-value`, e);
222
+ break;
223
+ default:
224
+ super.attributeChangedCallback(t, i, e);
225
+ break;
226
+ }
227
+ }
228
+ getGapCSSVariable(t, i = "mobile") {
229
+ return j.includes(t) ? `var(--px-spacing-${t}-${i})` : t;
230
+ }
231
+ get direction() {
232
+ return this.getAttribute("direction");
233
+ }
234
+ set direction(t) {
235
+ this.setAttribute("direction", t);
236
+ }
237
+ get directionMobile() {
238
+ return this.getAttribute("direction--mobile");
239
+ }
240
+ set directionMobile(t) {
241
+ this.setAttribute("direction--mobile", t);
242
+ }
243
+ get directionTablet() {
244
+ return this.getAttribute("direction--tablet");
245
+ }
246
+ set directionTablet(t) {
247
+ this.setAttribute("direction--tablet", t);
248
+ }
249
+ get directionLaptop() {
250
+ return this.getAttribute("direction--laptop");
251
+ }
252
+ set directionLaptop(t) {
253
+ this.setAttribute("direction--laptop", t);
254
+ }
255
+ get directionDesktop() {
256
+ return this.getAttribute("direction--desktop");
257
+ }
258
+ set directionDesktop(t) {
259
+ this.setAttribute("direction--desktop", t);
260
+ }
261
+ get gap() {
262
+ return this.getAttribute("gap");
263
+ }
264
+ set gap(t) {
265
+ this.setAttribute("gap", t);
266
+ }
267
+ get gapMobile() {
268
+ return this.getAttribute("gap--mobile");
269
+ }
270
+ set gapMobile(t) {
271
+ this.setAttribute("gap--mobile", t);
272
+ }
273
+ get gapTablet() {
274
+ return this.getAttribute("gap--tablet");
275
+ }
276
+ set gapTablet(t) {
277
+ this.setAttribute("gap--tablet", t);
278
+ }
279
+ get gapLaptop() {
280
+ return this.getAttribute("gap--laptop");
281
+ }
282
+ set gapLaptop(t) {
283
+ this.setAttribute("gap--laptop", t);
284
+ }
285
+ get justifyContent() {
286
+ return this.getAttribute("justify-content");
287
+ }
288
+ set justifyContent(t) {
289
+ this.setAttribute("justify-content", t);
290
+ }
291
+ get justifyContentMobile() {
292
+ return this.getAttribute("justify-content--mobile");
293
+ }
294
+ set justifyContentMobile(t) {
295
+ this.setAttribute("justify-content--mobile", t);
296
+ }
297
+ get justifyContentTablet() {
298
+ return this.getAttribute("justify-content--tablet");
299
+ }
300
+ set justifyContentTablet(t) {
301
+ this.setAttribute("justify-content--tablet", t);
302
+ }
303
+ get justifyContentLaptop() {
304
+ return this.getAttribute("justify-content--laptop");
305
+ }
306
+ set justifyContentLaptop(t) {
307
+ this.setAttribute("justify-content--laptop", t);
308
+ }
309
+ get justifyContentDesktop() {
310
+ return this.getAttribute("justify-content--desktop");
311
+ }
312
+ set justifyContentDesktop(t) {
313
+ this.setAttribute("justify-content--desktop", t);
314
+ }
315
+ get alignItems() {
316
+ return this.getAttribute("align-items");
317
+ }
318
+ set alignItems(t) {
319
+ this.setAttribute("align-items", t);
320
+ }
321
+ get alignItemsMobile() {
322
+ return this.getAttribute("align-items--mobile");
323
+ }
324
+ set alignItemsMobile(t) {
325
+ this.setAttribute("align-items--mobile", t);
326
+ }
327
+ get alignItemsTablet() {
328
+ return this.getAttribute("align-items--tablet");
329
+ }
330
+ set alignItemsTablet(t) {
331
+ this.setAttribute("align-items--tablet", t);
332
+ }
333
+ get alignItemsLaptop() {
334
+ return this.getAttribute("align-items--laptop");
335
+ }
336
+ set alignItemsLaptop(t) {
337
+ this.setAttribute("align-items--laptop", t);
338
+ }
339
+ get alignItemsDesktop() {
340
+ return this.getAttribute("align-items--desktop");
341
+ }
342
+ set alignItemsDesktop(t) {
343
+ this.setAttribute("align-items--desktop", t);
344
+ }
345
+ get wrap() {
346
+ return this.getAttribute("wrap");
347
+ }
348
+ set wrap(t) {
349
+ this.setAttribute("wrap", t);
350
+ }
351
+ get wrapMobile() {
352
+ return this.getAttribute("wrap-mobile");
353
+ }
354
+ set wrapMobile(t) {
355
+ this.setAttribute("wrap-mobile", t);
356
+ }
357
+ get wrapTablet() {
358
+ return this.getAttribute("wrap-tablet");
359
+ }
360
+ set wrapTablet(t) {
361
+ this.setAttribute("wrap-tablet", t);
362
+ }
363
+ get wrapLaptop() {
364
+ return this.getAttribute("wrap-laptop");
365
+ }
366
+ set wrapLaptop(t) {
367
+ this.setAttribute("wrap-laptop", t);
368
+ }
369
+ get wrapDesktop() {
370
+ return this.getAttribute("wrap-desktop");
371
+ }
372
+ set wrapDesktop(t) {
373
+ this.setAttribute("wrap-desktop", t);
374
+ }
375
+ get $el() {
376
+ return this.shadowRoot.querySelector(".flex-container");
377
+ }
378
+ }
379
+ customElements.get("px-stack") || customElements.define("px-stack", o);
380
+ class z extends o {
381
+ constructor() {
382
+ super();
383
+ }
384
+ connectedCallback() {
385
+ super.connectedCallback(), this.direction = "column", this.directionMobile = "column", this.directionTablet = "column", this.directionLaptop = "column", this.directionDesktop = "column";
386
+ }
387
+ }
388
+ customElements.get("px-vstack") || customElements.define("px-vstack", z);
389
+ class P extends o {
390
+ constructor() {
391
+ super();
392
+ }
393
+ connectedCallback() {
394
+ super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
395
+ }
396
+ }
397
+ customElements.get("px-hstack") || customElements.define("px-hstack", P);
398
+ class T extends HTMLElement {
399
+ constructor() {
400
+ super();
401
+ }
402
+ static get observedAttributes() {
403
+ return ["grow"];
404
+ }
405
+ attributeChangedCallback(t, i, e) {
406
+ t === "grow" && (this.style.flexGrow = e);
407
+ }
408
+ connectedCallback() {
409
+ this.style.flexGrow = this.getAttribute("grow") || "1";
410
+ }
411
+ get grow() {
412
+ return this.getAttribute("grow");
413
+ }
414
+ set grow(t) {
415
+ this.setAttribute("grow", t);
416
+ }
417
+ }
418
+ customElements.define("px-spacer", T);
419
+ const L = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5rem}", h = new CSSStyleSheet();
420
+ h.replaceSync(L);
421
+ class E extends a {
422
+ constructor() {
423
+ super(h), this.template = (t) => `
424
+ <px-container border-radius="none" padding="none">
425
+ <px-vstack>
426
+ <px-container id="header-container" border-radius="none">
427
+ <px-hstack>
428
+ <px-spacer></px-spacer>
429
+ <px-vstack
430
+ id="header-vstack-container"
431
+ gap="1rem"
432
+ grow="${this.grow}"
433
+ basis="${this.basis}"
434
+ >
435
+ <slot name="header-container"></slot>
436
+ </px-vstack>
437
+ <px-spacer></px-spacer>
438
+ </px-hstack>
439
+ </px-container>
440
+ <px-container
441
+ id="image-container"
442
+ border-radius="none"
443
+ padding="none"
444
+ padding-top="xl"
445
+ id="image-box"
446
+ background-size="cover"
447
+ background-position="top center"
448
+ padding-bottom="xl"
449
+ border-radius="none"
450
+ bgimg="${this.backgroundImage}"
451
+ >
452
+ <px-hstack>
453
+ <px-spacer></px-spacer>
454
+ <px-vstack grow="${this.grow}" basis="${this.basis}">
455
+ <slot name="image-container"></slot>
456
+ </px-vstack>
457
+ <px-spacer></px-spacer>
458
+ </px-hstack>
459
+ </px-container>
460
+ ${t ? ` <px-hstack>
461
+ <px-spacer></px-spacer>
462
+ <px-container border-radius="none" box-shadow="xl" id="image-sticky-box" border="s" grow="${this.grow}" basis="${this.basis}" border-radius="m">
463
+ <px-vstack gap="1rem">
464
+ <slot name="image-sticky-container"></slot>
465
+ </px-vstack>
466
+ </px-container>
467
+ <px-spacer></px-spacer>
468
+ </px-hstack>` : ""}
469
+ <px-container
470
+ id="body-container"
471
+ id="main"
472
+ background-color="${this.backgroundColor}"
473
+ padding="none"
474
+ padding-top="xl"
475
+ padding-bottom="xl"
476
+ >
477
+ <px-hstack>
478
+ <px-spacer></px-spacer>
479
+ <px-vstack
480
+ id="body-vstack-container"
481
+ gap="3rem"
482
+ grow="${this.grow}"
483
+ basis="${this.basis}"
484
+ >
485
+ <slot name="body-container"></slot>
486
+ </px-vstack>
487
+ <px-spacer></px-spacer>
488
+ </px-hstack>
489
+ </px-container>
490
+ <px-container
491
+ id="contact-container"
492
+ border-radius="none"
493
+ id="main"
494
+ background-color="container-weak"
495
+ padding="none"
496
+ padding-top="xl"
497
+ padding-bottom="xl"
498
+ >
499
+ <px-hstack>
500
+ <px-spacer></px-spacer>
501
+ <px-vstack gap="3rem" grow="${this.grow}" basis="${this.basis}">
502
+ <slot name="contact-container"></slot>
503
+ </px-vstack>
504
+ <px-spacer></px-spacer>
505
+ </px-hstack>
506
+ </px-container>
507
+ <px-container
508
+ id="footer-container"
509
+ background-color="none"
510
+ border-radius="none"
511
+ style="background-color: rgb(108, 66, 156)"
512
+ padding-top="xl"
513
+ padding-bottom="xl"
514
+ >
515
+ <px-hstack>
516
+ <px-spacer></px-spacer>
517
+ <px-vstack gap="3rem" grow="${this.grow}" basis="${this.basis}">
518
+ <slot name="footer-container"></slot>
519
+ </px-vstack>
520
+ <px-spacer></px-spacer>
521
+ </px-hstack>
522
+ </px-container>
523
+ </px-vstack>
524
+ </px-container>
525
+ `, this.shadowRoot.innerHTML = this.template(!!this.$imageStickySlot);
526
+ }
527
+ static get observedAttributes() {
528
+ return [
529
+ ...super.observedAttributes,
530
+ "background-image",
531
+ "gap",
532
+ "background-color",
533
+ "padding-vertical",
534
+ "padding-horizontal"
535
+ ];
536
+ }
537
+ get $wideImage() {
538
+ return this.shadowRoot.querySelector("#image-box");
539
+ }
540
+ get $bodyVStackContainer() {
541
+ return this.shadowRoot.querySelector("#header-vstack-container");
542
+ }
543
+ get $bodyContainer() {
544
+ return this.shadowRoot.querySelector("#body-container");
545
+ }
546
+ get $contactContainer() {
547
+ return this.shadowRoot.querySelector("#contact-container");
548
+ }
549
+ get $footerContainer() {
550
+ return this.shadowRoot.querySelector("#footer-container");
551
+ }
552
+ get $headerContainer() {
553
+ return this.shadowRoot.querySelector("#header-container");
554
+ }
555
+ get $imageContainer() {
556
+ return this.shadowRoot.querySelector("#image-container");
557
+ }
558
+ get backgroundImage() {
559
+ return this.getAttribute("background-image");
560
+ }
561
+ get $imageStickySlot() {
562
+ return this.querySelector('*[slot="image-sticky-container"]');
563
+ }
564
+ get $main() {
565
+ return this.shadowRoot.querySelector("#main");
566
+ }
567
+ get backgroundColor() {
568
+ return this.getAttribute("background-color") || "none";
569
+ }
570
+ get paddingVertical() {
571
+ return this.getAttribute("padding-vertical");
572
+ }
573
+ get paddingHorizontal() {
574
+ return this.getAttribute("padding-horizontal");
575
+ }
576
+ set paddingVertical(t) {
577
+ this.setAttribute("padding-vertical", t);
578
+ }
579
+ set paddingHorizontal(t) {
580
+ this.setAttribute("padding-horizontal", t);
581
+ }
582
+ get gap() {
583
+ return this.getAttribute("gap");
584
+ }
585
+ connectedCallback() {
586
+ this.handlePaddingVerticalChange(this.paddingVertical), this.handlePaddingHorizontalChange(this.paddingHorizontal);
587
+ }
588
+ attributeChangedCallback(t, i, e) {
589
+ if (i !== e)
590
+ switch (t) {
591
+ case "background-image":
592
+ this.$imageContainer.setAttribute("background-image", e);
593
+ break;
594
+ case "gap":
595
+ this.$bodyVStackContainer.setAttribute("gap", e);
596
+ break;
597
+ case "background-color":
598
+ this.$bodyContainer.setAttribute(
599
+ "background-color",
600
+ b.indexOf(e) > 0 ? e : "none"
601
+ );
602
+ break;
603
+ case "padding-vertical":
604
+ this.handlePaddingVerticalChange(e);
605
+ break;
606
+ case "padding-horizontal":
607
+ this.handlePaddingHorizontalChange(e);
608
+ break;
609
+ default:
610
+ super.attributeChangedCallback(t, i, e);
611
+ }
612
+ }
613
+ handlePaddingVerticalChange(t) {
614
+ this.$headerContainer.setAttribute("padding-top", t), this.$footerContainer.setAttribute("padding-bottom", t);
615
+ }
616
+ handlePaddingHorizontalChange(t) {
617
+ 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;
618
+ }
619
+ }
620
+ customElements.get("px-page") === void 0 && customElements.define("px-page", E);
621
+ const g = new CSSStyleSheet();
622
+ g.replaceSync(A);
623
+ class R extends HTMLElement {
624
+ constructor() {
625
+ super(), this.template = () => `
626
+ <div class="td">
627
+ <px-hstack gap="after-element-xs" align-items="center">
628
+ <slot name="icon"></slot>
629
+ <px-vstack gap="after-element-none" align-items="start">
630
+ <px-hstack gap="after-element-2xs" align-items="center">
631
+ <slot></slot>
632
+ <slot name="info"></slot>
633
+ </px-hstack>
634
+ <slot name="description"></slot>
635
+ </px-vstack>
636
+ </px-hstack>
637
+ </div>
638
+ `, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [g];
639
+ }
640
+ connectedCallback() {
641
+ this.style.display = "table-cell", this.style.verticalAlign = "middle", this.style.borderBottom = "var(--px-border-size-m) solid var(--td-border-color-default)", this.setAttribute("role", "cell");
642
+ const t = this.querySelector('[slot="icon"]');
643
+ t && (t.setAttribute("size", "l"), t.setAttribute("color", "content-neutral-strong"));
644
+ const i = this.querySelector('[slot="info"]');
645
+ i && (i.setAttribute("size", "xs"), i.setAttribute("color", "content-brand"));
646
+ }
647
+ }
648
+ customElements.get("px-td") || customElements.define("px-td", R);
649
+ export {
650
+ x as Table,
651
+ $ as Tbody,
652
+ R as Td,
653
+ w as Th,
654
+ y as Thead,
655
+ v as Tr
656
+ };
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@proximus/lavender-table",
3
+ "version": "1.2.0-alpha.37",
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": "386a3db8effe039dc90ab1efc481161fb6086502",
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
+ }