@proximus/lavender-separator 1.4.1 → 1.4.3-alpha.1

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.es.js +25 -19
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { PxElement as p } from "@proximus/lavender-common";
2
- const h = ".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}}", l = new CSSStyleSheet();
3
- l.replaceSync(h);
4
- const b = [
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
- ], u = ["", "default", "none", "s", "m", "l"], v = [
9
+ ], g = ["", "default", "none", "s", "m", "l"], v = [
10
10
  "",
11
11
  "main",
12
12
  "brand",
@@ -18,11 +18,11 @@ const b = [
18
18
  "purpose-unlimited",
19
19
  "state-hover",
20
20
  "state-active"
21
- ], c = class c extends p {
21
+ ], n = class n extends h {
22
22
  constructor() {
23
23
  var r;
24
- super(l);
25
- const t = document.createElement(this.nativeName);
24
+ super(p);
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
  }
28
28
  static get observedAttributes() {
@@ -50,11 +50,11 @@ const b = [
50
50
  t,
51
51
  r,
52
52
  e,
53
- b
53
+ u
54
54
  );
55
55
  break;
56
56
  case "size":
57
- this.updateSize(t, r, e, u);
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)) : console.error(`${e} is not a valid value for ${t}`);
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)) : console.error(`${e} is not a valid value for ${t}`);
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
- console.error(`${e} is not a valid value for ${t}`);
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(
@@ -156,12 +162,12 @@ const b = [
156
162
  this.setAttribute("inverted", t);
157
163
  }
158
164
  };
159
- c.nativeName = "hr";
160
- let n = c;
161
- customElements.get("px-separator") || customElements.define("px-separator", n);
165
+ n.nativeName = "hr";
166
+ let l = n;
167
+ customElements.get("px-separator") || customElements.define("px-separator", l);
162
168
  export {
163
- n as Separator,
169
+ l as Separator,
164
170
  v as separatorColorValues,
165
- b as separatorDirectionValues,
166
- u as separatorSizeValues
171
+ u as separatorDirectionValues,
172
+ g as separatorSizeValues
167
173
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-separator",
3
- "version": "1.4.1",
3
+ "version": "1.4.3-alpha.1",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",