@proximus/lavender-skeleton 2.0.0-alpha.203 → 2.0.0-alpha.204

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.
@@ -2,8 +2,8 @@ import { Container } from '@proximus/lavender-container';
2
2
  import { PxElement } from '@proximus/lavender-common';
3
3
  export declare const skeletonsVariantValues: string[];
4
4
  export declare class Skeleton extends PxElement<HTMLDivElement> {
5
+ protected static readonly template: HTMLTemplateElement;
5
6
  static nativeName: string;
6
- private template;
7
7
  constructor();
8
8
  static get observedAttributes(): string[];
9
9
  connectedCallback(): void;
@@ -19,6 +19,13 @@
19
19
  "description": "",
20
20
  "name": "Skeleton",
21
21
  "members": [
22
+ {
23
+ "kind": "field",
24
+ "name": "template",
25
+ "privacy": "protected",
26
+ "static": true,
27
+ "readonly": true
28
+ },
22
29
  {
23
30
  "kind": "field",
24
31
  "name": "nativeName",
@@ -28,11 +35,6 @@
28
35
  "static": true,
29
36
  "default": "'div'"
30
37
  },
31
- {
32
- "kind": "field",
33
- "name": "template",
34
- "privacy": "private"
35
- },
36
38
  {
37
39
  "kind": "method",
38
40
  "name": "updateVariant",
@@ -57,10 +59,6 @@
57
59
  {
58
60
  "kind": "field",
59
61
  "name": "inverted"
60
- },
61
- {
62
- "kind": "field",
63
- "name": "innerHTML"
64
62
  }
65
63
  ],
66
64
  "attributes": [
package/dist/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
- import { PxElement as e, log as t } from "@proximus/lavender-common";
1
+ import { PxElement as e, createTemplate as t, log as n, renderTemplate as r } from "@proximus/lavender-common";
2
2
  //#region src/skeleton.css?inline
3
- var n = ":host,:host>*{box-sizing:border-box;display:block}.skeleton-wrapper{flex-direction:column;align-items:flex-start;gap:10px;min-width:40px;min-height:16px;display:flex}.skeleton{border-radius:var(--px-radius-main);background-color:var(--px-color-background-state-disabled-default);background-image:linear-gradient(-80deg,#0000 0% 25%,#ffffff3d 40% 55%,#0000 75% 100%);background-size:200% 100%;align-self:stretch;height:16px;animation:1.5s ease-in-out infinite skeletonLoading}[inverted] .skeleton{background-color:var(--px-color-background-state-disabled-inverted);background-image:linear-gradient(-80deg,#fff0 0% 25%,#0000001a 40% 55%,#fff0 75% 100%)}.skeleton.heading-s,.skeleton.heading-m,.skeleton.heading-l{max-width:240px}.skeleton.heading-s{height:24px}.skeleton.heading-m{height:32px}.skeleton.heading-l{height:40px}.skeleton.body,.skeleton.body-block{width:300px}.skeleton.body{height:16px}.skeleton.body-block{height:16px}.skeleton.body-block:nth-of-type(3){width:180px}.skeleton.action-s,.skeleton.action-l{border-radius:var(--px-radius-pill);height:40px}.skeleton.action-s{width:40px}.skeleton.action-l{width:160px}.skeleton.asset-s{width:40px;height:40px}.skeleton.asset-l{width:80px;height:80px}.skeleton.panel{width:300px;height:200px}@keyframes skeletonLoading{0%{background-position-x:150%}40%{background-position-x:-50%}to{background-position-x:-50%}}", r = new CSSStyleSheet();
4
- r.replaceSync(n);
5
- var i = [
3
+ var i = ":host,:host>*{box-sizing:border-box;display:block}.skeleton-wrapper{flex-direction:column;align-items:flex-start;gap:10px;min-width:40px;min-height:16px;display:flex}.skeleton{border-radius:var(--px-radius-main);background-color:var(--px-color-background-state-disabled-default);background-image:linear-gradient(-80deg,#0000 0% 25%,#ffffff3d 40% 55%,#0000 75% 100%);background-size:200% 100%;align-self:stretch;height:16px;animation:1.5s ease-in-out infinite skeletonLoading}[inverted] .skeleton{background-color:var(--px-color-background-state-disabled-inverted);background-image:linear-gradient(-80deg,#fff0 0% 25%,#0000001a 40% 55%,#fff0 75% 100%)}.skeleton.heading-s,.skeleton.heading-m,.skeleton.heading-l{max-width:240px}.skeleton.heading-s{height:24px}.skeleton.heading-m{height:32px}.skeleton.heading-l{height:40px}.skeleton.body,.skeleton.body-block{width:300px}.skeleton.body{height:16px}.skeleton.body-block{height:16px}.skeleton.body-block:nth-of-type(3){width:180px}.skeleton.action-s,.skeleton.action-l{border-radius:var(--px-radius-pill);height:40px}.skeleton.action-s{width:40px}.skeleton.action-l{width:160px}.skeleton.asset-s{width:40px;height:40px}.skeleton.asset-l{width:80px;height:80px}.skeleton.panel{width:300px;height:200px}@keyframes skeletonLoading{0%{background-position-x:150%}40%{background-position-x:-50%}to{background-position-x:-50%}}", a = new CSSStyleSheet();
4
+ a.replaceSync(i);
5
+ var o = [
6
6
  "heading-s",
7
7
  "heading-m",
8
8
  "heading-l",
@@ -13,12 +13,15 @@ var i = [
13
13
  "asset-s",
14
14
  "asset-l",
15
15
  "panel"
16
- ], a = class extends e {
16
+ ], s = class i extends e {
17
+ static {
18
+ this.template = t("<div class=\"skeleton-wrapper\"><div class=\"skeleton\" aria-hidden=\"true\"></div><slot name=\"skeleton-text\"></slot></div>");
19
+ }
17
20
  static {
18
21
  this.nativeName = "div";
19
22
  }
20
23
  constructor() {
21
- super(r), this.template = () => "<div class=\"skeleton-wrapper\">\n <div class=\"skeleton\" aria-hidden=\"true\"></div>\n <slot name=\"skeleton-text\"></slot>\n </div>", this.shadowRoot.innerHTML = this.template();
24
+ super(a), r(this.shadowRoot, i.template);
22
25
  }
23
26
  static get observedAttributes() {
24
27
  return ["variant", "inverted"];
@@ -44,8 +47,8 @@ var i = [
44
47
  }
45
48
  }
46
49
  updateVariant(e) {
47
- if (!this.checkName(i, e)) {
48
- t(`"${e}" is not a valid variant value for ${this.tagName.toLowerCase()}. Allowed values are: "${i.join("\", \"")}".`);
50
+ if (!this.checkName(o, e)) {
51
+ n(`"${e}" is not a valid variant value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join("\", \"")}".`);
49
52
  return;
50
53
  }
51
54
  }
@@ -65,6 +68,6 @@ var i = [
65
68
  this._updateBooleanAttribute("inverted", e);
66
69
  }
67
70
  };
68
- customElements.get("px-skeleton") || customElements.define("px-skeleton", a);
71
+ customElements.get("px-skeleton") || customElements.define("px-skeleton", s);
69
72
  //#endregion
70
- export { a as Skeleton, i as skeletonsVariantValues };
73
+ export { s as Skeleton, o as skeletonsVariantValues };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@proximus/lavender-skeleton",
4
- "version": "2.0.0-alpha.203",
4
+ "version": "2.0.0-alpha.204",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -19,8 +19,7 @@
19
19
  "properties": [
20
20
  { "name": "$container" },
21
21
  { "name": "variant" },
22
- { "name": "inverted" },
23
- { "name": "innerHTML" }
22
+ { "name": "inverted" }
24
23
  ],
25
24
  "events": []
26
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-skeleton",
3
- "version": "2.0.0-alpha.203",
3
+ "version": "2.0.0-alpha.204",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",