@proximus/lavender-patch 1.0.0-alpha.23 → 1.0.0-alpha.25
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 +21 -21
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const o = ".patch{display:inline-flex;align-items:center;padding:0 var(--px-padding-s);height:1.625rem;border:var(--px-border-m) solid transparent;border-radius:var(--px-radius-patch-big) var(--px-radius-patch-big) var(--px-radius-patch-big) var(--px-radius-patch-small);font-family:var(--px-font-family);font-weight:700;font-size:var(--px-text-size-
|
|
2
|
-
|
|
1
|
+
const o = ".patch{display:inline-flex;align-items:center;padding:0 var(--px-padding-s-mobile);height:1.625rem;border:var(--px-border-size-m) solid transparent;border-radius:var(--px-radius-patch-big) var(--px-radius-patch-big) var(--px-radius-patch-big) var(--px-radius-patch-small);font-family:var(--px-font-family);font-weight:700;font-size:var(--px-text-size-label-m-mobile);line-height:var(--px-line-height-m);text-align:center;background-color:var(--px-background-color-purpose-promo-default);color:var(--px-text-color-action-neutral-inverted)}.patch,.patch *{box-sizing:border-box}.bottom-right{border-radius:var(--px-radius-patch-big) var(--px-radius-patch-big) var(--px-radius-patch-small) var(--px-radius-patch-big)}.bottom-left{border-radius:var(--px-radius-patch-big) var(--px-radius-patch-big) var(--px-radius-patch-big) var(--px-radius-patch-small)}.info{background-color:var(--px-background-color-purpose-info-default);color:var(--px-text-color-action-neutral-default)}.black-friday{background-color:var(--px-background-color-container-neutral-rich-default);color:var(--px-text-color-action-neutral-inverted)}.eco{background-color:var(--px-background-color-purpose-success-default);color:var(--px-text-color-action-neutral-inverted)}.greyed{background-color:var(--px-background-color-action-disabled-default);color:var(--px-text-color-action-disabled-default)}:host([inverted]) .patch{background-color:var(--px-background-color-purpose-promo-inverted);color:var(--px-text-color-action-neutral-inverted)}:host([inverted]) .info{background-color:var(--px-background-color-purpose-info-inverted);color:var(--px-text-color-action-neutral-default)}:host([inverted]) .black-friday{background-color:var(--px-background-color-container-neutral-bare-default);color:var(--px-text-color-action-neutral-default)}:host([inverted]) .eco{background-color:var(--px-background-color-purpose-success-inverted);color:var(--px-text-color-action-neutral-default)}:host([inverted]) .greyed{background-color:var(--px-background-color-action-disabled-inverted);color:var(--px-text-color-action-disabled-inverted)}@media only screen and (min-width: 768px){.patch{padding:0 var(--px-padding-s-tablet);font-size:var(--px-text-size-label-m-tablet)}}@media only screen and (min-width: 1025px){.patch{padding:0 var(--px-padding-s-desktop);font-size:var(--px-text-size-label-m-desktop)}}@media only screen and (min-width: 1441px){.patch{padding:0 var(--px-padding-s-desktop);font-size:var(--px-text-size-label-m-desktop)}}", r = new CSSStyleSheet();
|
|
2
|
+
r.replaceSync(o);
|
|
3
3
|
const i = [
|
|
4
4
|
"",
|
|
5
5
|
"default",
|
|
@@ -7,8 +7,8 @@ const i = [
|
|
|
7
7
|
"black-friday",
|
|
8
8
|
"eco",
|
|
9
9
|
"greyed"
|
|
10
|
-
],
|
|
11
|
-
class
|
|
10
|
+
], c = ["", "default", "bottom-right", "bottom-left"];
|
|
11
|
+
class s extends HTMLElement {
|
|
12
12
|
template() {
|
|
13
13
|
return `
|
|
14
14
|
<div class="patch">
|
|
@@ -17,33 +17,33 @@ class c extends HTMLElement {
|
|
|
17
17
|
`;
|
|
18
18
|
}
|
|
19
19
|
constructor() {
|
|
20
|
-
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [
|
|
20
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [r];
|
|
21
21
|
}
|
|
22
22
|
static get observedAttributes() {
|
|
23
23
|
return ["variant", "shape", "inverted"];
|
|
24
24
|
}
|
|
25
|
-
attributeChangedCallback(t,
|
|
26
|
-
if (
|
|
25
|
+
attributeChangedCallback(t, e, a) {
|
|
26
|
+
if (e !== a)
|
|
27
27
|
switch (t) {
|
|
28
28
|
case "variant":
|
|
29
|
-
this.updateVariant(
|
|
29
|
+
this.updateVariant(e, a);
|
|
30
30
|
break;
|
|
31
31
|
case "shape":
|
|
32
|
-
this.updateShape(
|
|
32
|
+
this.updateShape(e, a);
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
_toggleClass(t,
|
|
37
|
-
t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(t),
|
|
36
|
+
_toggleClass(t, e) {
|
|
37
|
+
t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(t), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(e);
|
|
38
38
|
}
|
|
39
|
-
checkName(t,
|
|
40
|
-
return t.includes(
|
|
39
|
+
checkName(t, e) {
|
|
40
|
+
return t.includes(e);
|
|
41
41
|
}
|
|
42
|
-
updateVariant(t,
|
|
43
|
-
this._toggleClass(t,
|
|
42
|
+
updateVariant(t, e) {
|
|
43
|
+
this._toggleClass(t, e), this.checkName(i, e) || console.error('Bad "variant" value for patch');
|
|
44
44
|
}
|
|
45
|
-
updateShape(t,
|
|
46
|
-
this._toggleClass(t,
|
|
45
|
+
updateShape(t, e) {
|
|
46
|
+
this._toggleClass(t, e), this.checkName(c, e) || console.error('Bad "shape" value for patch');
|
|
47
47
|
}
|
|
48
48
|
get $el() {
|
|
49
49
|
return this.shadowRoot.querySelector(".patch");
|
|
@@ -67,9 +67,9 @@ class c extends HTMLElement {
|
|
|
67
67
|
this.setAttribute("inverted", t);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
customElements.get("px-patch") || customElements.define("px-patch",
|
|
70
|
+
customElements.get("px-patch") || customElements.define("px-patch", s);
|
|
71
71
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
i as
|
|
72
|
+
s as Patch,
|
|
73
|
+
c as patchShapeValues,
|
|
74
|
+
i as patchVariantValues
|
|
75
75
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-patch",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.25",
|
|
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": {
|