@proximus/lavender-span 1.2.0-alpha.37 → 1.2.0-alpha.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +41 -39
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PxElement as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
1
|
+
import { PxElement as l, fontweightValues as d, fontsizeValues as x, colorValues as p, isFalsy as c } from "@proximus/lavender-common";
|
|
2
|
+
const h = "span,::slotted(span){font-family:var(--px-font-family);color:var(--px-text-color-body-neutral-strong-default);font-size:var(--px-text-size-body-m-mobile);line-height:var(--px-line-height-m)}:host([inverted]) span,:host([inverted]) ::slotted(span){color:var(--px-text-color-body-neutral-strong-inverted)}span.link{text-decoration:underline}@media only screen and (min-width: 768px){span,::slotted(span){font-size:var(--px-text-size-body-m-tablet)}}@media only screen and (min-width: 1025px){span,::slotted(span){font-size:var(--px-text-size-body-m-desktop)}}", f = ":host>*:first-child{--font-weight-light: 300;--font-weight-regular: 400;--font-weight-bold: 700;--font-weight-extrabold: 900}.color-inherit{color:inherit}.color-action-brand{color:var(--px-text-color-action-brand-default)}.color-action-neutral{color:var(--px-text-color-action-neutral-default)}.color-action-hover{color:var(--px-text-color-action-hover-default)}.color-action-active{color:var(--px-text-color-action-active-default)}.color-action-disabled{color:var(--px-text-color-action-disabled-default)}.color-body-neutral-strong{color:var(--px-text-color-body-neutral-strong-default)}.color-body-neutral-weak{color:var(--px-text-color-body-neutral-weak-default)}.color-heading-brand{color:var(--px-text-color-heading-brand-default)}.color-heading-neutral{color:var(--px-text-color-heading-neutral-default)}.color-purpose-success{color:var(--px-text-color-purpose-success-default)}.color-purpose-warning{color:var(--px-text-color-purpose-warning-default)}.color-purpose-error{color:var(--px-text-color-purpose-error-default)}.color-purpose-unlimited{color:var(--px-text-color-purpose-unlimited-default)}.color-purpose-promo{color:var(--px-text-color-purpose-promo-default)}:host([inverted]) .color-inherit{color:inherit}:host([inverted]) .color-action-brand{color:var(--px-text-color-action-brand-inverted)}:host([inverted]) .color-action-neutral{color:var(--px-text-color-action-neutral-inverted)}:host([inverted]) .color-action-hover{color:var(--px-text-color-action-hover-inverted)}:host([inverted]) .color-action-active{color:var(--px-text-color-action-active-inverted)}:host([inverted]) .color-action-disabled{color:var(--px-text-color-action-disabled-inverted)}:host([inverted]) .color-body-neutral-strong{color:var(--px-text-color-body-neutral-strong-inverted)}:host([inverted]) .color-body-neutral-weak{color:var(--px-text-color-body-neutral-weak-inverted)}:host([inverted]) .color-heading-brand{color:var(--px-text-color-heading-brand-inverted)}:host([inverted]) .color-heading-neutral{color:var(--px-text-color-heading-neutral-inverted)}:host([inverted]) .color-purpose-success{color:var(--px-text-color-purpose-success-inverted)}:host([inverted]) .color-purpose-warning{color:var(--px-text-color-purpose-warning-inverted)}:host([inverted]) .color-purpose-error{color:var(--px-text-color-purpose-error-inverted)}:host([inverted]) .color-purpose-unlimited{color:var(--px-text-color-purpose-unlimited-inverted)}:host([inverted]) .color-purpose-promo{color:var(--px-text-color-purpose-promo-inverted)}.font-size-inherit{font-size:inherit;line-height:inherit}.font-size-body-l{font-size:var(--px-text-size-body-l-mobile)}.font-size-body-m{font-size:var(--px-text-size-body-m-mobile)}.font-size-body-s{font-size:var(--px-text-size-body-s-mobile)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-mobile)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-mobile)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-mobile)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-mobile)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-mobile)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-mobile)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-mobile)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-mobile)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-mobile)}@media only screen and (min-width: 768px){.font-size-body-l{font-size:var(--px-text-size-body-l-tablet)}.font-size-body-m{font-size:var(--px-text-size-body-m-tablet)}.font-size-body-s{font-size:var(--px-text-size-body-s-tablet)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-tablet)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-tablet)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-tablet)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-tablet)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-tablet)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-tablet)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-tablet)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-tablet)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-tablet)}}@media only screen and (min-width: 1025px){.font-size-body-l{font-size:var(--px-text-size-body-l-desktop)}.font-size-body-m{font-size:var(--px-text-size-body-m-desktop)}.font-size-body-s{font-size:var(--px-text-size-body-s-desktop)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-desktop)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-desktop)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-desktop)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-desktop)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-desktop)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-desktop)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-desktop)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-desktop)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-desktop)}}.font-weight-inherit{font-weight:inherit}.font-weight-normal{font-weight:var(--font-weight-regular)}.font-weight-bold{font-weight:var(--font-weight-bold)}.font-weight-extrabold{font-weight:var(--font-weight-extrabold)}.font-weight-light{font-weight:var(--font-weight-light)}", n = new CSSStyleSheet(), s = new CSSStyleSheet();
|
|
3
|
+
n.replaceSync(h);
|
|
4
|
+
s.replaceSync(f);
|
|
5
|
+
const r = class r extends l {
|
|
6
6
|
constructor() {
|
|
7
|
-
super(
|
|
7
|
+
super(n, s), this.template = () => `<span>
|
|
8
8
|
<slot name="before"></slot>
|
|
9
9
|
<slot></slot>
|
|
10
10
|
<slot name="after"></slot>
|
|
@@ -19,56 +19,58 @@ const s = class s extends x {
|
|
|
19
19
|
"inverted"
|
|
20
20
|
];
|
|
21
21
|
}
|
|
22
|
+
attributeChangedCallback(e, t, o) {
|
|
23
|
+
if (t !== o)
|
|
24
|
+
switch (e) {
|
|
25
|
+
case "color":
|
|
26
|
+
this.updateTypography(e, t, o, p);
|
|
27
|
+
break;
|
|
28
|
+
case "font-size":
|
|
29
|
+
this.updateTypography(e, t, o, x);
|
|
30
|
+
break;
|
|
31
|
+
case "font-weight":
|
|
32
|
+
this.updateTypography(e, t, o, d);
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
super.attributeChangedCallback(e, t, o);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
checkName(e, t) {
|
|
40
|
+
return e.includes(t);
|
|
41
|
+
}
|
|
42
|
+
updateTypography(e, t, o, a) {
|
|
43
|
+
t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`${e}-${t}`), o !== null && o !== "" && o !== "default" && this.$el.classList.toggle(`${e}-${o}`), this.checkName(a, o) || console.error(
|
|
44
|
+
`${o} is not an allowed ${e} value for ${this.$el}`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
22
47
|
get color() {
|
|
23
48
|
return this.getAttribute("color");
|
|
24
49
|
}
|
|
25
|
-
set color(
|
|
26
|
-
this.setAttribute("color",
|
|
50
|
+
set color(e) {
|
|
51
|
+
this.setAttribute("color", e);
|
|
27
52
|
}
|
|
28
53
|
get fontsize() {
|
|
29
54
|
return this.getAttribute("font-size");
|
|
30
55
|
}
|
|
31
|
-
set fontsize(
|
|
32
|
-
this.setAttribute("font-size",
|
|
56
|
+
set fontsize(e) {
|
|
57
|
+
this.setAttribute("font-size", e);
|
|
33
58
|
}
|
|
34
59
|
get fontweight() {
|
|
35
60
|
return this.getAttribute("font-weight");
|
|
36
61
|
}
|
|
37
|
-
set fontweight(
|
|
38
|
-
this.setAttribute("font-weight",
|
|
62
|
+
set fontweight(e) {
|
|
63
|
+
this.setAttribute("font-weight", e);
|
|
39
64
|
}
|
|
40
65
|
get inverted() {
|
|
41
66
|
return this.getAttribute("inverted");
|
|
42
67
|
}
|
|
43
|
-
set inverted(
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
attributeChangedCallback(t, e, o) {
|
|
47
|
-
if (e !== o)
|
|
48
|
-
switch (t) {
|
|
49
|
-
case "color":
|
|
50
|
-
this.updateTypography(t, e, o, p);
|
|
51
|
-
break;
|
|
52
|
-
case "font-size":
|
|
53
|
-
this.updateTypography(t, e, o, z);
|
|
54
|
-
break;
|
|
55
|
-
case "font-weight":
|
|
56
|
-
this.updateTypography(t, e, o, f);
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
super.attributeChangedCallback(t, e, o);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
checkName(t, e) {
|
|
64
|
-
return t.includes(e);
|
|
65
|
-
}
|
|
66
|
-
updateTypography(t, e, o, n) {
|
|
67
|
-
e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`${t}-${e}`), o !== null && o !== "" && o !== "default" && this.$el.classList.toggle(`${t}-${o}`), this.checkName(n, o) || console.error(`Bad ${t} value for ${this.$el}`);
|
|
68
|
+
set inverted(e) {
|
|
69
|
+
c(e) ? this.removeAttribute("inverted") : this.setAttribute("inverted", e);
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
|
-
|
|
71
|
-
let i =
|
|
72
|
+
r.nativeName = "span";
|
|
73
|
+
let i = r;
|
|
72
74
|
customElements.define("px-span", i);
|
|
73
75
|
export {
|
|
74
76
|
i as Span
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-span",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.38",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "671fab7ee21d1c0ec6498b45b0bb2fd47e6e6c84",
|
|
28
28
|
"lerna": {
|
|
29
29
|
"command": {
|
|
30
30
|
"publish": {
|