@proximus/lavender-separator 1.4.2-beta.1 → 1.4.3-alpha.2
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.es.js +23 -17
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PxElement as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { PxElement as h, log as c } from "@proximus/lavender-common";
|
|
2
|
+
const b = ".separator{--separator-size: var(--px-size-border-m);--separator-direction--mobile-border-width: var(--separator-size) 0 0;--separator-direction--mobile-width: initial;--separator-direction--mobile-height: initial;clear:both;margin:0;border-style:solid;border-color:var( --separator-color-default, var(--px-color-border-main-default) );border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-horizontal--mobile{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--mobile{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}:host([inverted]) .separator{border-color:var( --separator-color-inverted, var(--px-color-border-main-inverted) )}@media only screen and (min-width: 768px){.separator-direction-horizontal--tablet{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--tablet{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}}@media only screen and (min-width: 1025px){.separator-direction-horizontal--laptop{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--laptop{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}}@media only screen and (min-width: 1441px){.separator-direction-horizontal--desktop{border-width:var(--separator-size) 0 0;width:initial;height:initial}.separator-direction-vertical--desktop{width:var(--separator-size);height:100%;border-width:0 var(--separator-size) 0 0}}", p = new CSSStyleSheet();
|
|
3
|
+
p.replaceSync(b);
|
|
4
|
+
const u = [
|
|
5
5
|
"",
|
|
6
6
|
"default",
|
|
7
7
|
"horizontal",
|
|
8
8
|
"vertical"
|
|
9
|
-
],
|
|
9
|
+
], g = ["", "default", "none", "s", "m", "l"], v = [
|
|
10
10
|
"",
|
|
11
11
|
"main",
|
|
12
12
|
"brand",
|
|
@@ -18,10 +18,10 @@ const b = [
|
|
|
18
18
|
"purpose-unlimited",
|
|
19
19
|
"state-hover",
|
|
20
20
|
"state-active"
|
|
21
|
-
], n = class n extends
|
|
21
|
+
], n = class n extends h {
|
|
22
22
|
constructor() {
|
|
23
23
|
var r;
|
|
24
|
-
super(
|
|
24
|
+
super(p);
|
|
25
25
|
const t = document.createElement(n.nativeName);
|
|
26
26
|
t.classList.add("separator"), this.internals = (r = this.attachInternals) == null ? void 0 : r.call(this), this.shadowRoot.appendChild(t);
|
|
27
27
|
}
|
|
@@ -50,11 +50,11 @@ const b = [
|
|
|
50
50
|
t,
|
|
51
51
|
r,
|
|
52
52
|
e,
|
|
53
|
-
|
|
53
|
+
u
|
|
54
54
|
);
|
|
55
55
|
break;
|
|
56
56
|
case "size":
|
|
57
|
-
this.updateSize(t, r, e,
|
|
57
|
+
this.updateSize(t, r, e, g);
|
|
58
58
|
break;
|
|
59
59
|
case "color":
|
|
60
60
|
this.updateColor(t, r, e, v);
|
|
@@ -71,7 +71,9 @@ const b = [
|
|
|
71
71
|
`var(--px-size-border-${i})`
|
|
72
72
|
);
|
|
73
73
|
};
|
|
74
|
-
this.checkName(a, e) ? (o(r), o(e)) :
|
|
74
|
+
this.checkName(a, e) ? (o(r), o(e)) : c(
|
|
75
|
+
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
76
|
+
);
|
|
75
77
|
}
|
|
76
78
|
updateColor(t, r, e, a) {
|
|
77
79
|
const o = (i) => {
|
|
@@ -83,14 +85,18 @@ const b = [
|
|
|
83
85
|
`var(--px-color-border-${i}-inverted)`
|
|
84
86
|
));
|
|
85
87
|
};
|
|
86
|
-
this.checkName(a, e) ? (o(r), o(e)) :
|
|
88
|
+
this.checkName(a, e) ? (o(r), o(e)) : c(
|
|
89
|
+
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
90
|
+
);
|
|
87
91
|
}
|
|
88
92
|
updateDirection(t, r, e, a) {
|
|
89
93
|
const o = (i, s) => {
|
|
90
94
|
s !== null && s !== "" && s !== "default" && this.$el.classList.add(`separator-direction-${s}--${i}`);
|
|
91
95
|
};
|
|
92
96
|
if (!this.checkName(a, e))
|
|
93
|
-
|
|
97
|
+
c(
|
|
98
|
+
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
99
|
+
);
|
|
94
100
|
else if (t === "direction")
|
|
95
101
|
["mobile", "tablet", "laptop", "desktop"].forEach((i) => {
|
|
96
102
|
Array.from(this.$el.classList).find(
|
|
@@ -157,11 +163,11 @@ const b = [
|
|
|
157
163
|
}
|
|
158
164
|
};
|
|
159
165
|
n.nativeName = "hr";
|
|
160
|
-
let
|
|
161
|
-
customElements.get("px-separator") || customElements.define("px-separator",
|
|
166
|
+
let l = n;
|
|
167
|
+
customElements.get("px-separator") || customElements.define("px-separator", l);
|
|
162
168
|
export {
|
|
163
|
-
|
|
169
|
+
l as Separator,
|
|
164
170
|
v as separatorColorValues,
|
|
165
|
-
|
|
166
|
-
|
|
171
|
+
u as separatorDirectionValues,
|
|
172
|
+
g as separatorSizeValues
|
|
167
173
|
};
|