@proximus/lavender-common 2.0.0-alpha.1 → 2.0.0-alpha.100

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.
@@ -1,4 +1,4 @@
1
- export declare function cssTokenBreakpoints(attributeName: string, selector: (attributeName: string, attribute: string, device?: 'mobile' | 'tablet' | 'laptop' | 'desktop') => string, attributeValues: string[], cssPropertyPrefix?: string, generatedCssPropertyName?: string): CSSStyleSheet;
1
+ export declare function cssTokenBreakpoints(attributeName: string, selector: (attributeName: string, attribute: string, device?: 'mobile' | 'tablet' | 'laptop' | 'desktop') => string, attributeValues: string[], cssPropertyPrefix?: string, generatedCssPropertyName?: string, selectorAttributeName?: string): CSSStyleSheet;
2
2
  export declare class AttributeBreakpointHandlerDelegate {
3
3
  private readonly component;
4
4
  private readonly attributeName;
package/dist/common.d.ts CHANGED
@@ -1,5 +1,24 @@
1
1
  export declare function getSupportedPropertyNames(htmlElementName: string): string[];
2
2
  export declare function getSupportedAttributeNames(htmlElementName: string): string[];
3
+ declare global {
4
+ interface Window {
5
+ isComponentDebug?: () => boolean;
6
+ }
7
+ }
8
+ export declare function isComponentDebug(): boolean;
9
+ /**
10
+ * Logs an error message to the console if the global debug flag is set.
11
+ * Usage: log('message')
12
+ */
13
+ export declare function log(message: string): void;
14
+ export declare class WrappedInteractiveStateController {
15
+ #private;
16
+ constructor(host: HTMLElement, interactiveElement: HTMLElement, canSetInteractiveState: () => boolean);
17
+ clearInteractiveState: () => void;
18
+ connect(): void;
19
+ disconnect(): void;
20
+ setInteractiveState(state: 'hover' | null): void;
21
+ }
3
22
  export declare class WithExtraAttributes extends HTMLElement {
4
23
  static get observedAttributes(): string[];
5
24
  constructor(...adoptedStylesheets: CSSStyleSheet[]);
@@ -9,8 +28,7 @@ export declare class WithExtraAttributes extends HTMLElement {
9
28
  checkName<T extends readonly string[]>(values: T, value: string): boolean;
10
29
  get $el(): Element;
11
30
  get $parentElementName(): string;
12
- get isGrid(): boolean;
13
- get isStack(): boolean;
31
+ get isInsideGridOrStack(): boolean;
14
32
  get grow(): string;
15
33
  set grow(value: string);
16
34
  get growMobile(): string;
@@ -92,12 +110,19 @@ export declare class WithExtraAttributes extends HTMLElement {
92
110
  }
93
111
  export declare abstract class PxElement<HTML_TYPE extends Element> extends WithExtraAttributes {
94
112
  static nativeName: string;
95
- nativeName: string;
113
+ static supportedPropertyNames: string[];
114
+ static accessorExclusions: string[];
96
115
  static get observedAttributes(): string[];
97
116
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
117
+ protected get ctor(): any;
98
118
  protected constructor(...adoptedStylesheets: CSSStyleSheet[]);
99
- connectedCallback(): void;
119
+ enhanceWithNativeProperties(): void;
100
120
  get $el(): HTML_TYPE;
121
+ protected _updateAttribute(name: string, value: string): void;
122
+ protected _updateBooleanAttribute(name: string, value: boolean): void;
123
+ }
124
+ export declare class VerticallyExtendedElement<HTML_TYPE extends Element> extends PxElement<HTML_TYPE> {
125
+ connectedCallback(): void;
101
126
  }
102
127
  export declare const gridGapValues: string[];
103
128
  export declare const flexboxAlignSelfValues: readonly ["", "default", "auto", "flex-start", "flex-end", "center", "baseline", "stretch"];
@@ -130,4 +155,5 @@ export declare function addGlobalStylesheet(inlineStyles: string): void;
130
155
  export declare function isFalsy(value: string | boolean): boolean;
131
156
  export declare function getViewportFormat(): "mobile" | "tablet" | "laptop";
132
157
  export declare function checkName(values: string[], value: string): boolean;
158
+ export declare const accessibilityAttributes: string[];
133
159
  export declare function transferAccessibilityAttributes(sourceElement: HTMLElement, targetElement: HTMLElement, applyLabelledBy?: boolean): void;
package/dist/index.es.js CHANGED
@@ -1,17 +1,101 @@
1
- const u = ":host([grow]){flex-grow:var(--grow-value)}:host([shrink]){flex-shrink:var(--shrink-value)}:host([basis]){flex-basis:var(--basis-value)}:host([align-self]){align-self:var(--align-self-value)}:host([col-span]){grid-column:span var(--col-span-value) / span var(--col-span-value)}:host([justify-self]){justify-self:var(--justify-value)}:host([order]),::slotted([order]){order:var(--order-value)}:host([hidden]),::slotted([hidden]){display:none}:host([shown--sr]),::slotted(*[shown--sr]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media screen and (max-width: 767px){:host([hidden--mobile]),::slotted([hidden--mobile]){display:none}:host([grow--mobile]){flex-grow:var(--grow--mobile-value)!important}:host([shrink--mobile]){flex-shrink:var(--shrink--mobile-value)!important}:host([basis--mobile]){flex-basis:var(--basis--mobile-value)!important}:host([align-self--mobile]){align-self:var(--align-self--mobile-value)!important}:host([col-span--mobile]){grid-column:span var(--col-span--mobile-value) / span var(--col-span--mobile-value)!important}:host([justify-self--mobile]){justify-self:var(--justify-self--mobile-value)!important}:host([order--mobile]),::slotted([order--mobile]){order:var(--order--mobile-value)!important}:host([shown--sr--mobile]),::slotted(*[shown--sr--mobile]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}@media screen and (min-width: 768px) and (max-width: 1024px){:host([hidden--tablet]),::slotted([hidden--tablet]){display:none}:host([grow--tablet]){flex-grow:var(--grow--tablet-value)!important}:host([shrink--tablet]){flex-shrink:var(--shrink--tablet-value)!important}:host([basis--tablet]){flex-basis:var(--basis--tablet-value)!important}:host([align-self--tablet]){align-self:var(--align-self--tablet-value)!important}:host([col-span--tablet]){grid-column:span var(--col-span--tablet-value) / span var(--col-span--tablet-value)!important}:host([justify-self--tablet]){justify-self:var(--justify-self--tablet-value)!important}:host([order--tablet]),::slotted([order--tablet]){order:var(--order--tablet-value)!important}:host([shown--sr--tablet]),::slotted(*[shown--sr--tablet]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}@media screen and (min-width: 1025px){:host([shown--sr--laptop]),::slotted(*[shown--sr--laptop]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}@media screen and (min-width: 1025px) and (max-width: 1440px){:host([hidden--laptop]),::slotted([hidden--laptop]){display:none!important}:host([grow--laptop]){flex-grow:var(--grow--laptop-value)!important}:host([shrink--laptop]){flex-shrink:var(--shrink--laptop-value)!important}:host([basis--laptop]){flex-basis:var(--basis--laptop-value)!important}:host([align-self--laptop]){align-self:var(--align-self--laptop-value)!important}:host([col-span--laptop]){grid-column:span var(--col-span--laptop-value) / span var(--col-span--laptop-value)!important}:host([justify-self--laptop]){justify-self:var(--justify-self--laptop-value)!important}:host([order--laptop]),::slotted([order--laptop]){order:var(--order--laptop-value)!important}}@media screen and (min-width: 1441px){:host([col-span--desktop]){grid-column:span var(--col-span--desktop-value) / span var(--col-span--desktop-value)!important}:host([justify-self--desktop]){justify-self:var(--justify-self--desktop-value)!important}:host([order--desktop]),::slotted([order--desktop]){order:var(--order--desktop-value)!important}:host([hidden--desktop]),::slotted([hidden--desktop]){display:none!important}:host([grow--desktop]){flex-grow:var(--grow--desktop-value)!important}:host([shrink--desktop]){flex-shrink:var(--shrink--desktop-value)!important}:host([basis--desktop]){flex-basis:var(--basis--desktop-value)!important}:host([align-self--desktop]){align-self:var(--align-self--desktop-value)!important}}";
2
- function b(i) {
1
+ var A = (i) => {
2
+ throw TypeError(i);
3
+ };
4
+ var S = (i, t, s) => t.has(i) || A("Cannot " + s);
5
+ var a = (i, t, s) => (S(i, t, "read from private field"), s ? s.call(i) : t.get(i)), d = (i, t, s) => t.has(i) ? A("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, s), p = (i, t, s, e) => (S(i, t, "write to private field"), e ? e.call(i, s) : t.set(i, s), s);
6
+ const C = ":host([grow]){flex-grow:var(--grow-value)}:host([shrink]){flex-shrink:var(--shrink-value)}:host([basis]){flex-basis:var(--basis-value)}:host([align-self]){align-self:var(--align-self-value)}:host([col-span]){grid-column:span var(--col-span-value) / span var(--col-span-value)}:host([justify-self]){justify-self:var(--justify-self-value)}:host([order]),::slotted([order]){order:var(--order-value)}:host([sticky-top]){position:sticky;top:0}:host([sticky-bottom]){position:sticky;bottom:0}:host([hidden]),::slotted([hidden]){display:none}:host([shown--sr]),::slotted(*[shown--sr]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media screen and (max-width: 47.938rem){:host([hidden--mobile]),::slotted([hidden--mobile]){display:none}:host([grow--mobile]){flex-grow:var(--grow--mobile-value)!important}:host([shrink--mobile]){flex-shrink:var(--shrink--mobile-value)!important}:host([basis--mobile]){flex-basis:var(--basis--mobile-value)!important}:host([align-self--mobile]){align-self:var(--align-self--mobile-value)!important}:host([col-span--mobile]){grid-column:span var(--col-span--mobile-value) / span var(--col-span--mobile-value)!important}:host([justify-self--mobile]){justify-self:var(--justify-self--mobile-value)!important}:host([order--mobile]),::slotted([order--mobile]){order:var(--order--mobile-value)!important}:host([shown--sr--mobile]),::slotted(*[shown--sr--mobile]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}@media screen and (min-width: 48rem) and (max-width: 64rem){:host([hidden--tablet]),::slotted([hidden--tablet]){display:none}:host([grow--tablet]){flex-grow:var(--grow--tablet-value)!important}:host([shrink--tablet]){flex-shrink:var(--shrink--tablet-value)!important}:host([basis--tablet]){flex-basis:var(--basis--tablet-value)!important}:host([align-self--tablet]){align-self:var(--align-self--tablet-value)!important}:host([col-span--tablet]){grid-column:span var(--col-span--tablet-value) / span var(--col-span--tablet-value)!important}:host([justify-self--tablet]){justify-self:var(--justify-self--tablet-value)!important}:host([order--tablet]),::slotted([order--tablet]){order:var(--order--tablet-value)!important}:host([shown--sr--tablet]),::slotted(*[shown--sr--tablet]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}@media screen and (min-width: 64.0625rem){:host([shown--sr--laptop]),::slotted(*[shown--sr--laptop]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}@media screen and (min-width: 64.0625rem){:host([hidden--laptop]),::slotted([hidden--laptop]){display:none!important}:host([grow--laptop]){flex-grow:var(--grow--laptop-value)!important}:host([shrink--laptop]){flex-shrink:var(--shrink--laptop-value)!important}:host([basis--laptop]){flex-basis:var(--basis--laptop-value)!important}:host([align-self--laptop]){align-self:var(--align-self--laptop-value)!important}:host([col-span--laptop]){grid-column:span var(--col-span--laptop-value) / span var(--col-span--laptop-value)!important}:host([justify-self--laptop]){justify-self:var(--justify-self--laptop-value)!important}:host([order--laptop]),::slotted([order--laptop]){order:var(--order--laptop-value)!important}}@media screen and (min-width: 90.0625rem){:host([col-span--desktop]){grid-column:span var(--col-span--desktop-value) / span var(--col-span--desktop-value)!important}:host([justify-self--desktop]){justify-self:var(--justify-self--desktop-value)!important}:host([order--desktop]),::slotted([order--desktop]){order:var(--order--desktop-value)!important}:host([hidden--desktop]),::slotted([hidden--desktop]){display:none!important}:host([grow--desktop]){flex-grow:var(--grow--desktop-value)!important}:host([shrink--desktop]){flex-shrink:var(--shrink--desktop-value)!important}:host([basis--desktop]){flex-basis:var(--basis--desktop-value)!important}:host([align-self--desktop]){align-self:var(--align-self--desktop-value)!important}}", L = {};
7
+ function N(i) {
3
8
  const t = document.createElement(i), s = Object.getPrototypeOf(t);
4
9
  return Object.getOwnPropertyNames(s);
5
10
  }
6
- function d(i) {
11
+ function M(i) {
7
12
  const t = document.createElement(i), s = Object.getPrototypeOf(t);
8
13
  return Object.getOwnPropertyNames(s).map(
9
14
  (e) => e.toLowerCase()
10
15
  );
11
16
  }
12
- const h = new CSSStyleSheet();
13
- h.replaceSync(u);
14
- class p extends HTMLElement {
17
+ const $ = new CSSStyleSheet();
18
+ $.replaceSync(C);
19
+ const D = typeof import.meta < "u" && typeof L < "u" && !0;
20
+ typeof window < "u" && (window.isComponentDebug = v);
21
+ function v() {
22
+ return D;
23
+ }
24
+ function T(i) {
25
+ v() && console.error(i);
26
+ }
27
+ var c, n, g, h, u, m, x;
28
+ class R {
29
+ constructor(t, s, e) {
30
+ d(this, m);
31
+ d(this, c);
32
+ d(this, n);
33
+ d(this, g);
34
+ d(this, h);
35
+ d(this, u);
36
+ p(this, h, !1), p(this, u, () => {
37
+ this.setInteractiveState("hover");
38
+ }), this.clearInteractiveState = () => {
39
+ this.setInteractiveState(null);
40
+ }, p(this, c, t), p(this, n, s), p(this, g, e);
41
+ }
42
+ connect() {
43
+ a(this, h) || (a(this, n).addEventListener(
44
+ "pointerenter",
45
+ a(this, u)
46
+ ), a(this, n).addEventListener(
47
+ "pointerleave",
48
+ this.clearInteractiveState
49
+ ), a(this, n).addEventListener(
50
+ "focusin",
51
+ a(this, u)
52
+ ), a(this, n).addEventListener(
53
+ "focusout",
54
+ this.clearInteractiveState
55
+ ), p(this, h, !0));
56
+ }
57
+ disconnect() {
58
+ a(this, h) && (a(this, n).removeEventListener(
59
+ "pointerenter",
60
+ a(this, u)
61
+ ), a(this, n).removeEventListener(
62
+ "pointerleave",
63
+ this.clearInteractiveState
64
+ ), a(this, n).removeEventListener(
65
+ "focusin",
66
+ a(this, u)
67
+ ), a(this, n).removeEventListener(
68
+ "focusout",
69
+ this.clearInteractiveState
70
+ ), p(this, h, !1));
71
+ }
72
+ setInteractiveState(t) {
73
+ const s = a(this, m, x);
74
+ if (!a(this, g).call(this)) {
75
+ s.forEach((e) => e.removeAttribute("interactive-state"));
76
+ return;
77
+ }
78
+ s.forEach((e) => {
79
+ t ? e.setAttribute("interactive-state", t) : e.removeAttribute("interactive-state");
80
+ });
81
+ }
82
+ }
83
+ c = new WeakMap(), n = new WeakMap(), g = new WeakMap(), h = new WeakMap(), u = new WeakMap(), m = new WeakSet(), x = function() {
84
+ return Array.from(a(this, c).querySelectorAll("*")).filter(
85
+ E
86
+ );
87
+ };
88
+ function E(i) {
89
+ var s;
90
+ if (i.hasAttribute("interactive-state"))
91
+ return !0;
92
+ const t = customElements.get(
93
+ i.localName
94
+ );
95
+ return ((s = t == null ? void 0 : t.observedAttributes) == null ? void 0 : s.includes("interactive-state")) ?? !1;
96
+ }
97
+ typeof window < "u" && (window.isComponentDebug = v);
98
+ class y extends HTMLElement {
15
99
  static get observedAttributes() {
16
100
  return [
17
101
  "grow",
@@ -58,17 +142,20 @@ class p extends HTMLElement {
58
142
  "order--mobile",
59
143
  "order--tablet",
60
144
  "order--laptop",
61
- "order--desktop"
145
+ "order--desktop",
146
+ "sticky-top",
147
+ "sticky-bottom"
62
148
  ];
63
149
  }
64
150
  constructor(...t) {
65
151
  super(), this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.adoptedStyleSheets = [
66
- h,
152
+ $,
67
153
  ...t
68
154
  ];
69
155
  }
70
156
  attributeChangedCallback(t, s, e) {
71
- if (p.observedAttributes.indexOf(t) !== -1)
157
+ var o;
158
+ if (y.observedAttributes.indexOf(t) !== -1)
72
159
  switch (t) {
73
160
  case "grow":
74
161
  case "grow--mobile":
@@ -96,7 +183,7 @@ class p extends HTMLElement {
96
183
  t,
97
184
  s,
98
185
  e,
99
- this.isGrid ? g : c
186
+ ((o = this.parentElement) == null ? void 0 : o.localName) === "px-grid" ? I : O
100
187
  );
101
188
  break;
102
189
  case "justify-self":
@@ -108,7 +195,7 @@ class p extends HTMLElement {
108
195
  t,
109
196
  s,
110
197
  e,
111
- f
198
+ _
112
199
  );
113
200
  break;
114
201
  case "col-span":
@@ -116,38 +203,37 @@ class p extends HTMLElement {
116
203
  case "col-span--tablet":
117
204
  case "col-span--laptop":
118
205
  case "col-span--desktop":
119
- this.updateProperties(t, s, e, m);
206
+ this.updateProperties(t, s, e, q);
120
207
  break;
121
208
  case "order":
122
209
  case "order--mobile":
123
210
  case "order--tablet":
124
211
  case "order--laptop":
125
212
  case "order--desktop":
126
- this.updateProperties(t, s, e, k);
213
+ this.updateProperties(t, s, e, P);
127
214
  break;
128
215
  }
129
216
  }
130
217
  updateProperties(t, s, e, o) {
131
- if (o && !this.checkName(o, e)) {
132
- console.error(`${e} is not a valid value for ${o}`);
133
- return;
134
- }
135
- const a = t.indexOf("--") > -1, l = a ? t.split("--")[0] : t;
136
- if (!a)
218
+ o && (this.checkName(o, e) || T(
219
+ `${e} is not an allowed ${o} value for ${this.tagName.toLowerCase()}`
220
+ ));
221
+ const l = t.indexOf("--") > -1, b = l ? t.split("--")[0] : t;
222
+ if (!l)
137
223
  this.style.setProperty(
138
- `--${l}-value`,
224
+ `--${b}-value`,
139
225
  s
140
226
  ), this.style.setProperty(
141
- `--${l}-value`,
227
+ `--${b}-value`,
142
228
  e
143
229
  );
144
230
  else {
145
- const n = t.split("--")[1];
231
+ const f = t.split("--")[1];
146
232
  this.style.setProperty(
147
- `--${l}--${n}-value`,
233
+ `--${b}--${f}-value`,
148
234
  s
149
235
  ), this.style.setProperty(
150
- `--${l}--${n}-value`,
236
+ `--${b}--${f}-value`,
151
237
  e
152
238
  );
153
239
  }
@@ -168,11 +254,18 @@ class p extends HTMLElement {
168
254
  var t;
169
255
  return (t = this.parentElement) == null ? void 0 : t.tagName.toLowerCase();
170
256
  }
171
- get isGrid() {
172
- return this.$parentElementName === "px-grid";
173
- }
174
- get isStack() {
175
- return this.$parentElementName === "px-stack";
257
+ get isInsideGridOrStack() {
258
+ let t = this.parentElement;
259
+ for (; t; ) {
260
+ if (t.localName === "px-grid" || t.localName === "px-stack" && (t == null ? void 0 : t.getAttribute("direction")) === "row")
261
+ return !0;
262
+ if (window.getComputedStyle(t).display === "contents") {
263
+ t = t.parentElement;
264
+ continue;
265
+ }
266
+ break;
267
+ }
268
+ return !1;
176
269
  }
177
270
  get grow() {
178
271
  return this.getAttribute("grow");
@@ -409,23 +502,29 @@ class p extends HTMLElement {
409
502
  this.setAttribute("order--desktop", t);
410
503
  }
411
504
  }
412
- class w extends p {
505
+ const w = class w extends y {
506
+ // nativeName: string;
413
507
  static get observedAttributes() {
414
508
  return [
415
509
  ...super.observedAttributes,
416
- ...d(this.nativeName)
510
+ ...M(this.nativeName)
417
511
  ];
418
512
  }
419
513
  attributeChangedCallback(t, s, e) {
420
514
  super.attributeChangedCallback(t, s, e), e === null ? this.$el.toggleAttribute(t) : this.$el.setAttribute(t, e);
421
515
  }
516
+ get ctor() {
517
+ return Object.getPrototypeOf(this).constructor;
518
+ }
422
519
  constructor(...t) {
423
- super(...t), this.nativeName = Object.getPrototypeOf(this).constructor.nativeName;
520
+ super(...t), this.ctor.supportedPropertyNames || (this.ctor.supportedPropertyNames = N(
521
+ this.ctor.nativeName
522
+ )), this.enhanceWithNativeProperties();
424
523
  }
425
- connectedCallback() {
524
+ enhanceWithNativeProperties() {
426
525
  var t;
427
- for (const s of b(this.nativeName))
428
- if (s !== "constructor")
526
+ for (const s of this.ctor.supportedPropertyNames)
527
+ if (!(s === "constructor" || (((t = this.ctor) == null ? void 0 : t.accessorExclusions) ?? []).includes(s)))
429
528
  try {
430
529
  Object.defineProperty(this, s, {
431
530
  get() {
@@ -438,16 +537,25 @@ class w extends p {
438
537
  } catch (e) {
439
538
  console.warn(`Could not create property ${s} for`, this.$el, e);
440
539
  }
441
- if (this.isGrid || this.isStack) {
442
- const s = (t = this.parentElement) == null ? void 0 : t.getAttribute("direction");
443
- this.$el.style.display = "block", (this.isGrid || this.isStack && s === "row") && (this.$el.style.height = "100%");
444
- }
445
540
  }
446
541
  get $el() {
447
- return this.shadowRoot.querySelector(this.nativeName);
542
+ return this.shadowRoot.querySelector(this.ctor.nativeName);
543
+ }
544
+ _updateAttribute(t, s) {
545
+ s ? this.setAttribute(t, s) : this.removeAttribute(t);
546
+ }
547
+ _updateBooleanAttribute(t, s) {
548
+ s ? this.setAttribute(t, "") : this.removeAttribute(t);
549
+ }
550
+ };
551
+ w.accessorExclusions = [];
552
+ let k = w;
553
+ class z extends k {
554
+ connectedCallback() {
555
+ this.isInsideGridOrStack && (this.$el.style.display = "block", this.$el.style.height = "100%");
448
556
  }
449
557
  }
450
- const y = ["", "default", "none", "l"], c = [
558
+ const W = ["", "default", "none", "l"], O = [
451
559
  "",
452
560
  "default",
453
561
  "auto",
@@ -456,21 +564,21 @@ const y = ["", "default", "none", "l"], c = [
456
564
  "center",
457
565
  "baseline",
458
566
  "stretch"
459
- ], g = [
567
+ ], I = [
460
568
  "",
461
569
  "default",
462
570
  "start",
463
571
  "end",
464
572
  "center",
465
573
  "stretch"
466
- ], f = [
574
+ ], _ = [
467
575
  "",
468
576
  "default",
469
577
  "start",
470
578
  "end",
471
579
  "center",
472
580
  "stretch"
473
- ], m = [
581
+ ], q = [
474
582
  "",
475
583
  "1",
476
584
  "2",
@@ -484,7 +592,7 @@ const y = ["", "default", "none", "l"], c = [
484
592
  "10",
485
593
  "11",
486
594
  "12"
487
- ], k = [
595
+ ], P = [
488
596
  "",
489
597
  "-1",
490
598
  "0",
@@ -500,7 +608,7 @@ const y = ["", "default", "none", "l"], c = [
500
608
  "10",
501
609
  "11",
502
610
  "12"
503
- ], A = [
611
+ ], H = [
504
612
  "",
505
613
  "default",
506
614
  "auto",
@@ -508,7 +616,7 @@ const y = ["", "default", "none", "l"], c = [
508
616
  "end",
509
617
  "center",
510
618
  "stretch"
511
- ], S = [
619
+ ], X = [
512
620
  "",
513
621
  "default",
514
622
  "inherit",
@@ -524,7 +632,7 @@ const y = ["", "default", "none", "l"], c = [
524
632
  "heading-l",
525
633
  "heading-m",
526
634
  "heading-s"
527
- ], $ = [
635
+ ], F = [
528
636
  "",
529
637
  "default",
530
638
  "inherit",
@@ -539,7 +647,7 @@ const y = ["", "default", "none", "l"], c = [
539
647
  "state-hover",
540
648
  "state-active",
541
649
  "state-disabled"
542
- ], x = [
650
+ ], U = [
543
651
  "",
544
652
  "default",
545
653
  "inherit",
@@ -547,11 +655,11 @@ const y = ["", "default", "none", "l"], c = [
547
655
  "title",
548
656
  "title-large",
549
657
  "subtitle"
550
- ], v = ["Xs", "S", "M", "L", "Xl"], j = [
658
+ ], G = ["Xs", "S", "M", "L", "Xl"], J = [
551
659
  "",
552
660
  "default",
553
- ...v.map((i) => i.toLowerCase())
554
- ], C = ["", "default", "left", "center", "right"], L = [
661
+ ...G.map((i) => i.toLowerCase())
662
+ ], K = ["", "default", "left", "center", "right"], Q = [
555
663
  "",
556
664
  "none",
557
665
  "3xs",
@@ -561,7 +669,7 @@ const y = ["", "default", "none", "l"], c = [
561
669
  "m",
562
670
  "l",
563
671
  "xl"
564
- ], M = ["", "none", "s", "m", "l"], T = ["", "none", "main", "pill"], D = [
672
+ ], Y = ["", "none", "s", "m", "l"], Z = ["", "none", "main", "pill"], tt = [
565
673
  "none",
566
674
  "main",
567
675
  "brand",
@@ -572,7 +680,7 @@ const y = ["", "default", "none", "l"], c = [
572
680
  "purpose-warning",
573
681
  "purpose-error",
574
682
  "purpose-unlimited"
575
- ], N = [
683
+ ], et = [
576
684
  "",
577
685
  "all",
578
686
  "top",
@@ -581,7 +689,7 @@ const y = ["", "default", "none", "l"], c = [
581
689
  "left",
582
690
  "block",
583
691
  "inline"
584
- ], O = [
692
+ ], st = [
585
693
  "",
586
694
  "none",
587
695
  "surface-light",
@@ -607,8 +715,9 @@ const y = ["", "default", "none", "l"], c = [
607
715
  "purpose-promo",
608
716
  "purpose-info",
609
717
  "purpose-eco",
610
- "purpose-notification"
611
- ], G = ["", "cover", "contain", "default"], q = ["", "none", "s", "m", "l", "xl"], P = [
718
+ "purpose-notification",
719
+ "footer-sitemap"
720
+ ], it = ["", "cover", "contain", "default"], ot = ["", "none", "s", "m", "l", "xl"], rt = [
612
721
  "",
613
722
  "default",
614
723
  "title-4xl",
@@ -619,7 +728,7 @@ const y = ["", "default", "none", "l"], c = [
619
728
  "title-m",
620
729
  "title-s",
621
730
  "subtitle"
622
- ], E = [
731
+ ], at = [
623
732
  "",
624
733
  "purple-top-red",
625
734
  "purple-top-magenta",
@@ -669,7 +778,7 @@ const y = ["", "default", "none", "l"], c = [
669
778
  "color-bottom-right-blue",
670
779
  "color-bottom-right-turquoise",
671
780
  "color-bottom-right-green"
672
- ], R = [
781
+ ], lt = [
673
782
  "none",
674
783
  "2xs",
675
784
  "xs",
@@ -679,14 +788,14 @@ const y = ["", "default", "none", "l"], c = [
679
788
  "heading-to-subtitle",
680
789
  "heading-to-content",
681
790
  "page-layout-between-sections"
682
- ], V = [
791
+ ], nt = [
683
792
  "",
684
793
  "all",
685
794
  "top",
686
795
  "right",
687
796
  "bottom",
688
797
  "left"
689
- ], z = [
798
+ ], pt = [
690
799
  "",
691
800
  "default",
692
801
  "xs",
@@ -695,117 +804,118 @@ const y = ["", "default", "none", "l"], c = [
695
804
  "l",
696
805
  "xl"
697
806
  ];
698
- function B(i) {
807
+ function ht(i) {
699
808
  const t = document.createElement("style");
700
809
  t.innerHTML = i, document.head.appendChild(t);
701
810
  }
702
- function _(i) {
811
+ function ut(i) {
703
812
  return typeof i == "string" && (i === "false" || i === "0" || i === "null") || typeof i == "boolean" && !i;
704
813
  }
705
- function H() {
814
+ function bt() {
706
815
  return window.matchMedia("only screen and (min-width: 768px)").matches ? "tablet" : window.matchMedia("only screen and (min-width: 1025px)").matches ? "laptop" : "mobile";
707
816
  }
708
- function F(i, t) {
817
+ function dt(i, t) {
709
818
  return i.includes(t);
710
819
  }
711
- function X(i, t, s = !0) {
820
+ const B = [
821
+ "aria-label",
822
+ "aria-labelledby",
823
+ "aria-describedby",
824
+ "aria-controls",
825
+ "aria-expanded",
826
+ "aria-haspopup",
827
+ "aria-pressed",
828
+ "aria-selected",
829
+ "aria-required",
830
+ "aria-disabled",
831
+ "aria-live",
832
+ "aria-atomic",
833
+ "aria-relevant",
834
+ "aria-orientation",
835
+ "aria-valuenow",
836
+ "aria-valuetext",
837
+ "aria-valuemin",
838
+ "aria-valuemax",
839
+ "aria-details",
840
+ "aria-modal",
841
+ "aria-autocomplete",
842
+ "aria-activedescendant",
843
+ "aria-colcount",
844
+ "aria-colindex",
845
+ "aria-colspan",
846
+ "aria-rowcount",
847
+ "aria-rowindex",
848
+ "aria-rowspan",
849
+ "aria-keyshortcuts",
850
+ "aria-placeholder",
851
+ "aria-invalid",
852
+ "aria-busy",
853
+ "aria-owns"
854
+ ];
855
+ function ct(i, t, s = !1) {
712
856
  var e;
713
- if ([
714
- "aria-label",
715
- "aria-labelledby",
716
- "aria-describedby",
717
- "aria-controls",
718
- "aria-expanded",
719
- "aria-haspopup",
720
- "aria-pressed",
721
- "aria-selected",
722
- "aria-required",
723
- "aria-disabled",
724
- "aria-live",
725
- "aria-atomic",
726
- "aria-relevant",
727
- "aria-orientation",
728
- "aria-valuenow",
729
- "aria-valuetext",
730
- "aria-valuemin",
731
- "aria-valuemax",
732
- "aria-details",
733
- "aria-modal",
734
- "aria-autocomplete",
735
- "aria-activedescendant",
736
- "aria-colcount",
737
- "aria-colindex",
738
- "aria-colspan",
739
- "aria-rowcount",
740
- "aria-rowindex",
741
- "aria-rowspan",
742
- "aria-keyshortcuts",
743
- "aria-placeholder",
744
- "aria-invalid",
745
- "aria-busy",
746
- "aria-owns"
747
- ].forEach((o) => {
857
+ if (B.forEach((o) => {
748
858
  i.getAttribute(o) && (t.setAttribute(o, i.getAttribute(o)), i.removeAttribute(o));
749
- }), s) {
859
+ }), s && !i.getAttribute("aria-labelledby")) {
750
860
  const o = `px-${((e = t.localName) == null ? void 0 : e.toLowerCase()) ?? "component"}-${Math.random().toString(36).substring(2, 15)}`;
751
861
  t.setAttribute("id", o), i.setAttribute("aria-labelledby", o);
752
862
  }
753
863
  }
754
- function I(i, t, s, e = "", o) {
755
- const a = new CSSStyleSheet(), l = s.reduce(
756
- (n, r) => n + `
757
- ${t(i, r)} {
864
+ function gt(i, t, s, e = "", o, l = i) {
865
+ const b = new CSSStyleSheet(), f = s.reduce(
866
+ (j, r) => j + `
867
+ ${t(l, r)} {
758
868
  ${i}: var(--${e}-${r}-desktop);
759
869
  ${o ? `${o}:var(--${e}-${r}-desktop)` : ""}
760
870
  }
761
871
  /* Mobile only - max 767px */
762
- @media only screen and (max-width: 47.938em) {
763
- ${t(i, r)} {
872
+ @media only screen and (max-width: 47.938rem) {
873
+ ${t(l, r)} {
764
874
  ${i}: var(--${e}-${r}-mobile);
765
875
  ${o ? `${o}: var(--${e}-${r}-mobile)` : ""}
766
876
  }
767
877
  }
768
- ${t(i, r, "mobile")} {
878
+ ${t(l, r, "mobile")} {
769
879
  /* Mobile only - max 767px */
770
- @media only screen and (max-width: 47.938em) {
880
+ @media only screen and (max-width: 47.938rem) {
771
881
  ${i}: var(--${e}-${r}-mobile) !important;
772
882
  ${o ? `${o}: var(--${e}-${r}-mobile)` : ""}
773
883
  }
774
884
  }
775
- ${t(i, r, "tablet")} {
885
+ ${t(l, r, "tablet")} {
776
886
  /* Tablet - min 768px max 1024px */
777
- @media only screen and (min-width: 48em) and (max-width: 64em) {
887
+ @media only screen and (min-width: 48rem) and (max-width: 64rem) {
778
888
  ${i}: var(--${e}-${r}-desktop) !important;
779
889
  ${o ? `${o}: var(--${e}-${r}-desktop)` : ""}
780
890
  }
781
891
  }
782
- ${t(i, r, "laptop")} {
892
+ ${t(l, r, "laptop")} {
783
893
  /* Laptop - 1025px*/
784
- @media only screen and (min-width: 64.0625em) {
894
+ @media only screen and (min-width: 64.0625rem) {
785
895
  ${i}: var(--${e}-${r}-desktop) !important;
786
896
  ${o ? `${o}: var(--${e}-${r}-desktop)` : ""}
787
897
  }
788
898
  }
789
- ${t(i, r, "desktop")} {
899
+ ${t(l, r, "desktop")} {
790
900
  /* Desktop - 1025px*/
791
- @media only screen and (min-width: 64.0625em) {
901
+ @media only screen and (min-width: 64.0625rem) {
792
902
  ${i}: var(--${e}-${r}-desktop) !important;
793
903
  ${o ? `${o}: var(--${e}-${r}-desktop)` : ""}
794
904
  }
795
905
  }`,
796
906
  ""
797
907
  );
798
- return a.replaceSync(l), a;
908
+ return b.replaceSync(f), b;
799
909
  }
800
- class J {
910
+ class ft {
801
911
  constructor(t, s, e, o) {
802
912
  this.component = t, this.attributeName = s, this.cssVariable = o, this.attributeNameMobile = `${this.attributeName}--mobile`, this.attributeNameTablet = `${this.attributeName}--tablet`, this.attributeNameLaptop = `${this.attributeName}--laptop`, this.attributeNameDesktop = `${this.attributeName}--desktop`, this._attributeValue = e, Object.defineProperty(
803
913
  this.component,
804
914
  this.toCamelCase(this.attributeName),
805
915
  {
806
916
  get: () => this.component.getAttribute(this.attributeName),
807
- set: (a) => {
808
- this.component.setAttribute(this.attributeName, a);
917
+ set: (l) => {
918
+ this.component.setAttribute(this.attributeName, l);
809
919
  }
810
920
  }
811
921
  );
@@ -864,12 +974,12 @@ class J {
864
974
  o,
865
975
  !1
866
976
  );
867
- const a = this.component.getAttribute(
977
+ const l = this.component.getAttribute(
868
978
  this.attributeNameDesktop
869
979
  );
870
- a && this.setCSSProperty(
980
+ l && this.setCSSProperty(
871
981
  this.attributeNameDesktop,
872
- a,
982
+ l,
873
983
  !1
874
984
  );
875
985
  }
@@ -878,41 +988,46 @@ class J {
878
988
  }
879
989
  }
880
990
  export {
881
- J as AttributeBreakpointHandlerDelegate,
882
- w as PxElement,
883
- p as WithExtraAttributes,
884
- B as addGlobalStylesheet,
885
- z as assetContainerImgWidthValues,
886
- O as backgroundColorValues,
887
- G as backgroundSizeValues,
888
- D as borderColorValues,
889
- T as borderRadiusValues,
890
- N as borderSideValues,
891
- M as borderValues,
892
- q as boxShadowValues,
893
- F as checkName,
894
- $ as colorValues,
895
- g as cssGridAlignSelfValues,
896
- m as cssGridColSpanValues,
897
- f as cssGridJustifySelfValues,
898
- k as cssGridOrderValues,
899
- A as cssGridPlaceSelfValues,
900
- I as cssTokenBreakpoints,
901
- c as flexboxAlignSelfValues,
902
- S as fontsizeValues,
903
- x as fontweightValues,
904
- R as gapValues,
905
- d as getSupportedAttributeNames,
906
- b as getSupportedPropertyNames,
907
- H as getViewportFormat,
908
- E as gradientValues,
909
- y as gridGapValues,
910
- P as headingValues,
911
- v as iconSizeValues,
912
- j as iconSizeValuesKC,
913
- _ as isFalsy,
914
- V as noBorderRadiusValues,
915
- L as paddingValues,
916
- C as textalignValues,
917
- X as transferAccessibilityAttributes
991
+ ft as AttributeBreakpointHandlerDelegate,
992
+ k as PxElement,
993
+ z as VerticallyExtendedElement,
994
+ y as WithExtraAttributes,
995
+ R as WrappedInteractiveStateController,
996
+ B as accessibilityAttributes,
997
+ ht as addGlobalStylesheet,
998
+ pt as assetContainerImgWidthValues,
999
+ st as backgroundColorValues,
1000
+ it as backgroundSizeValues,
1001
+ tt as borderColorValues,
1002
+ Z as borderRadiusValues,
1003
+ et as borderSideValues,
1004
+ Y as borderValues,
1005
+ ot as boxShadowValues,
1006
+ dt as checkName,
1007
+ F as colorValues,
1008
+ I as cssGridAlignSelfValues,
1009
+ q as cssGridColSpanValues,
1010
+ _ as cssGridJustifySelfValues,
1011
+ P as cssGridOrderValues,
1012
+ H as cssGridPlaceSelfValues,
1013
+ gt as cssTokenBreakpoints,
1014
+ O as flexboxAlignSelfValues,
1015
+ X as fontsizeValues,
1016
+ U as fontweightValues,
1017
+ lt as gapValues,
1018
+ M as getSupportedAttributeNames,
1019
+ N as getSupportedPropertyNames,
1020
+ bt as getViewportFormat,
1021
+ at as gradientValues,
1022
+ W as gridGapValues,
1023
+ rt as headingValues,
1024
+ G as iconSizeValues,
1025
+ J as iconSizeValuesKC,
1026
+ v as isComponentDebug,
1027
+ ut as isFalsy,
1028
+ T as log,
1029
+ nt as noBorderRadiusValues,
1030
+ Q as paddingValues,
1031
+ K as textalignValues,
1032
+ ct as transferAccessibilityAttributes
918
1033
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-common",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.100",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",