@proximus/lavender-icon-common 1.4.5-beta.1 → 1.4.5-beta.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.
Files changed (2) hide show
  1. package/dist/index.es.js +24 -28
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
- var u = (r) => {
2
- throw TypeError(r);
1
+ var u = (o) => {
2
+ throw TypeError(o);
3
3
  };
4
- var p = (r, o, e) => o.has(r) || u("Cannot " + e);
5
- var s = (r, o, e) => (p(r, o, "read from private field"), e ? e.call(r) : o.get(r)), a = (r, o, e) => o.has(r) ? u("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(r) : o.set(r, e), d = (r, o, e, t) => (p(r, o, "write to private field"), t ? t.call(r, e) : o.set(r, e), e);
4
+ var p = (o, r, e) => r.has(o) || u("Cannot " + e);
5
+ var s = (o, r, e) => (p(o, r, "read from private field"), e ? e.call(o) : r.get(o)), a = (o, r, e) => r.has(o) ? u("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(o) : r.set(o, e), d = (o, r, e, t) => (p(o, r, "write to private field"), t ? t.call(o, e) : r.set(o, e), e);
6
6
  import { WithExtraAttributes as m, iconSizeValuesKC as f, log as b } from "@proximus/lavender-common";
7
7
  class g extends HTMLElement {
8
8
  constructor() {
@@ -31,10 +31,10 @@ class g extends HTMLElement {
31
31
  }
32
32
  }
33
33
  disconnectedCallback() {
34
- const o = document.querySelector(
34
+ const r = document.querySelector(
35
35
  `style[data-name="${this.getAttribute("name")}"]`
36
36
  );
37
- o && o.remove();
37
+ r && r.remove();
38
38
  }
39
39
  }
40
40
  customElements.get("px-icon-set") || customElements.define("px-icon-set", g);
@@ -52,32 +52,32 @@ const x = [
52
52
  "StateActive",
53
53
  "StateDisabled"
54
54
  ], A = ["Inherit", ...x].map(
55
- (r) => r.replace(/([A-Z])/g, "-$1").toLowerCase().slice(1)
55
+ (o) => o.replace(/([A-Z])/g, "-$1").toLowerCase().slice(1)
56
56
  ), z = ":host{display:inline-flex;flex-direction:column;justify-content:center}svg{font-size:var(--px-size-icon-s);line-height:var(--px-font-line-height-xs);width:1em;height:1em;color:var(--px-color-icon-accent-default)}.inherit{color:inherit}.brand{color:var(--px-color-icon-brand-default)}.accent{color:var(--px-color-icon-accent-default)}.neutral{color:var(--px-color-icon-neutral-default)}.dimmed{color:var(--px-color-icon-dimmed-default)}.purpose-success{color:var(--px-color-icon-purpose-success-default)}.purpose-warning{color:var(--px-color-icon-purpose-warning-default)}.purpose-error{color:var(--px-color-icon-purpose-error-default)}.purpose-unlimited{color:var(--px-color-icon-purpose-unlimited-default)}.purpose-promo{color:var(--px-color-icon-purpose-promo-default)}.state-hover:hover{color:var(--px-color-icon-state-hover-default)}.state-active:active{color:var(--px-color-icon-state-active-default)}.state-disabled{color:var(--px-color-icon-state-disabled-default)}:host([inverted]) svg{color:var(--px-color-icon-accent-inverted)}:host([inverted]) .inherit{color:inherit}:host([inverted]) .brand{color:var(--px-color-icon-brand-inverted)}:host([inverted]) .accent{color:var(--px-color-icon-accent-inverted)}:host([inverted]) .neutral{color:var(--px-color-icon-neutral-inverted)}:host([inverted]) .dimmed{color:var(--px-color-icon-dimmed-inverted)}:host([inverted]) .purpose-success{color:var(--px-color-icon-purpose-success-inverted)}:host([inverted]) .purpose-warning{color:var(--px-color-icon-purpose-warning-inverted)}:host([inverted]) .purpose-error{color:var(--px-color-icon-purpose-error-inverted)}:host([inverted]) .purpose-unlimited{color:var(--px-color-icon-purpose-unlimited-inverted)}:host([inverted]) .purpose-promo{color:var(--px-color-icon-purpose-promo-inverted)}:host([inverted]) .state-hover:hover{color:var(--px-color-icon-state-hover-inverted)}:host([inverted]) .state-active:active{color:var(--px-color-icon-state-active-inverted)}:host([inverted]) .state-disabled{color:var(--px-color-icon-state-disabled-inverted)}.size-xs{font-size:var(--px-size-icon-xs)}.size-s{font-size:var(--px-size-icon-s)}.size-m{font-size:var(--px-size-icon-m)}.size-l{font-size:var(--px-size-icon-l)}.size-xl{font-size:var(--px-size-icon-xl)}", h = new CSSStyleSheet();
57
57
  h.replaceSync(z);
58
- const $ = [
59
- "name",
60
- "size",
61
- "color",
62
- "aria-label",
63
- "inverted",
64
- "from",
65
- "disabled"
66
- ];
67
58
  var c, n, l;
68
- class y extends m {
59
+ class $ extends m {
69
60
  constructor(...e) {
70
61
  var t;
71
62
  super(...e, h);
72
63
  a(this, c);
73
64
  a(this, n);
74
65
  a(this, l, () => `<svg aria-hidden="true">
75
- <use xlink:href=""></use>
66
+ <use></use>
76
67
  </svg>`);
77
68
  this.shadowRoot.innerHTML = s(this, l).call(this), d(this, n, (t = this.attachInternals) == null ? void 0 : t.call(this)), s(this, n) && (s(this, n).role = "img");
78
69
  }
79
70
  static get observedAttributes() {
80
- return [...super.observedAttributes, ...$];
71
+ return [
72
+ ...super.observedAttributes,
73
+ "name",
74
+ "size",
75
+ "color",
76
+ "aria-label",
77
+ "inverted",
78
+ "from",
79
+ "disabled"
80
+ ];
81
81
  }
82
82
  attributeChangedCallback(e, t, i) {
83
83
  if (t !== i)
@@ -102,10 +102,7 @@ class y extends m {
102
102
  }
103
103
  }
104
104
  connectedCallback() {
105
- this.role = "img", this.name && this.$el.firstElementChild.setAttribute(
106
- "xlink:href",
107
- `#icon-${this.name}`
108
- );
105
+ this.role = "img";
109
106
  const e = document.querySelectorAll("px-icon-set");
110
107
  e || console.log("<px-icon-set> component not found");
111
108
  for (const t of e) {
@@ -114,7 +111,7 @@ class y extends m {
114
111
  continue;
115
112
  }
116
113
  t.getAttribute("name") === this.from && t.getAttribute("type") !== "font" && (d(this, c, t.getAttribute("src")), this.$el.firstElementChild.setAttribute(
117
- "xlink:href",
114
+ "href",
118
115
  `${s(this, c)}#icon-${this.name}`
119
116
  ));
120
117
  }
@@ -127,7 +124,7 @@ class y extends m {
127
124
  }
128
125
  updateName(e, t) {
129
126
  s(this, c) && this.$el.firstElementChild.setAttribute(
130
- "xlink:href",
127
+ "href",
131
128
  `${s(this, c)}#icon-${t}`
132
129
  );
133
130
  }
@@ -178,12 +175,11 @@ class y extends m {
178
175
  }
179
176
  }
180
177
  c = new WeakMap(), n = new WeakMap(), l = new WeakMap();
181
- customElements.get("px-icon") || customElements.define("px-icon", y);
178
+ customElements.get("px-icon") || customElements.define("px-icon", $);
182
179
  export {
183
- y as Icon,
180
+ $ as Icon,
184
181
  g as IconSet,
185
182
  x as iconColorValues,
186
183
  A as iconColorValuesKC,
187
- $ as observedAttributes,
188
184
  h as styleSheet
189
185
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-icon-common",
3
- "version": "1.4.5-beta.1",
3
+ "version": "1.4.5-beta.2",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",