@proximus/lavender-status-card 1.4.16-beta.3 → 1.4.16-beta.5
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/StatusCard.d.ts +1 -1
- package/dist/custom-elements.json +7 -9
- package/dist/index.es.js +23 -20
- package/dist/web-types.json +2 -3
- package/package.json +1 -1
package/dist/StatusCard.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { PxElement } from '@proximus/lavender-common';
|
|
|
5
5
|
export declare const statusCardStateValues: string[];
|
|
6
6
|
export declare const statusCardBackgroundColorValues: string[];
|
|
7
7
|
export declare class StatusCard extends PxElement<HTMLDivElement> {
|
|
8
|
+
protected static readonly template: HTMLTemplateElement;
|
|
8
9
|
static nativeName: string;
|
|
9
|
-
private template;
|
|
10
10
|
constructor();
|
|
11
11
|
static get observedAttributes(): string[];
|
|
12
12
|
connectedCallback(): void;
|
|
@@ -27,6 +27,13 @@
|
|
|
27
27
|
"description": "",
|
|
28
28
|
"name": "StatusCard",
|
|
29
29
|
"members": [
|
|
30
|
+
{
|
|
31
|
+
"kind": "field",
|
|
32
|
+
"name": "template",
|
|
33
|
+
"privacy": "protected",
|
|
34
|
+
"static": true,
|
|
35
|
+
"readonly": true
|
|
36
|
+
},
|
|
30
37
|
{
|
|
31
38
|
"kind": "field",
|
|
32
39
|
"name": "nativeName",
|
|
@@ -36,11 +43,6 @@
|
|
|
36
43
|
"static": true,
|
|
37
44
|
"default": "'div'"
|
|
38
45
|
},
|
|
39
|
-
{
|
|
40
|
-
"kind": "field",
|
|
41
|
-
"name": "template",
|
|
42
|
-
"privacy": "private"
|
|
43
|
-
},
|
|
44
46
|
{
|
|
45
47
|
"kind": "method",
|
|
46
48
|
"name": "updateBackgroundColor",
|
|
@@ -113,10 +115,6 @@
|
|
|
113
115
|
"type": {
|
|
114
116
|
"text": "string | null"
|
|
115
117
|
}
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"kind": "field",
|
|
119
|
-
"name": "innerHTML"
|
|
120
118
|
}
|
|
121
119
|
],
|
|
122
120
|
"events": [
|
package/dist/index.es.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import { PxElement as e,
|
|
1
|
+
import { PxElement as e, createTemplate as t, log as n, renderTemplate as r } from "@proximus/lavender-common";
|
|
2
2
|
//#region src/statuscard.css?inline
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
3
|
+
var i = ":host,:host>*{box-sizing:border-box;display:block}px-container{height:100%}.status-card{position:relative}.status-card:before{content:\"\";border-left:5px solid var(--px-color-border-brand-default);border-radius:var(--px-radius-main) 0 0 var(--px-radius-main);height:100%;display:block;position:absolute;top:0;left:0}.status-card.success:before{border-color:var(--px-color-border-purpose-success-default)}.status-card.warning:before,.status-card.ongoing:before{border-color:var(--px-color-border-purpose-warning-default)}.status-card.error:before{border-color:var(--px-color-border-purpose-error-default)}::slotted([slot=title]){font-size:var(--px-text-size-heading-s-mobile);font-weight:var(--px-font-weight-title);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-neutral-default);display:block}:host([inverted]) .status-card:before{border-color:var(--px-color-border-brand-inverted)}:host([inverted]) .status-card.success:before{border-color:var(--px-color-border-purpose-success-inverted)}:host([inverted]) .status-card.warning:before,:host([inverted]) .status-card.ongoing:before{border-color:var(--px-color-border-purpose-warning-inverted)}:host([inverted]) .status-card.error:before{border-color:var(--px-color-border-purpose-error-inverted)}:host([inverted]) ::slotted([slot=title]){color:var(--px-color-text-neutral-inverted)}@media screen and (width<=47.938rem){.status-card-content{margin-top:3px}}@media screen and (width>=48rem){::slotted([slot=title]){font-size:var(--px-text-size-heading-s-tablet)}}@media screen and (width>=64.0625rem){::slotted([slot=title]){font-size:var(--px-text-size-heading-s-laptop)}}", a = new CSSStyleSheet();
|
|
4
|
+
a.replaceSync(i);
|
|
5
|
+
var o = [
|
|
6
6
|
"",
|
|
7
7
|
"info",
|
|
8
8
|
"success",
|
|
9
9
|
"warning",
|
|
10
10
|
"error",
|
|
11
11
|
"ongoing"
|
|
12
|
-
],
|
|
12
|
+
], s = [
|
|
13
13
|
"",
|
|
14
14
|
"container-light",
|
|
15
15
|
"container-default"
|
|
16
|
-
],
|
|
16
|
+
], c = "px.lavender.modal.close", l = class i extends e {
|
|
17
|
+
static {
|
|
18
|
+
this.template = t("<div class=\"status-card\"><px-container padding=\"s\" background-color=\"container-default\"><px-hstack gap=\"s\" align-items=\"flex-start\"><px-icon name=\"information_fill\" from=\"lavender\" size=\"m\" color=\"brand\"></px-icon><px-vstack gap=\"s\" grow=\"1\" class=\"status-card-content\"><px-vstack gap=\"xs\"><slot name=\"title\"></slot><slot></slot></px-vstack><slot name=\"action\"></slot></px-vstack><slot name=\"close-button\"></slot></px-hstack></px-container></div>");
|
|
19
|
+
}
|
|
17
20
|
static {
|
|
18
21
|
this.nativeName = "div";
|
|
19
22
|
}
|
|
20
23
|
constructor() {
|
|
21
|
-
super(
|
|
24
|
+
super(a), r(this.shadowRoot, i.template);
|
|
22
25
|
}
|
|
23
26
|
static get observedAttributes() {
|
|
24
27
|
return [
|
|
@@ -47,25 +50,25 @@ var i = [
|
|
|
47
50
|
this.statusIconAriaLabel ? this.$statusIcon.setAttribute("aria-label", this.statusIconAriaLabel) : this.$statusIcon.removeAttribute("aria-label");
|
|
48
51
|
break;
|
|
49
52
|
case "background-color":
|
|
50
|
-
this.backgroundColor && this.updateBackgroundColor(n,
|
|
53
|
+
this.backgroundColor && this.updateBackgroundColor(n, s);
|
|
51
54
|
break;
|
|
52
55
|
default: super.attributeChangedCallback(e, t, n);
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
updateBackgroundColor(e,
|
|
56
|
-
if (!this.checkName(
|
|
57
|
-
|
|
58
|
-
Allowed values are: "${
|
|
58
|
+
updateBackgroundColor(e, t) {
|
|
59
|
+
if (!this.checkName(t, e)) {
|
|
60
|
+
n(`"${e}" is not a valid background-color value for ${this.tagName.toLowerCase()}.
|
|
61
|
+
Allowed values are: "${t.join("\", \"")}".`);
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
64
|
e === null || e === "" ? this.$container.setAttribute("background-color", "container-default") : this.$container.setAttribute("background-color", e);
|
|
62
65
|
}
|
|
63
66
|
updateState(e) {
|
|
64
|
-
if (!this.checkName(
|
|
65
|
-
|
|
67
|
+
if (!this.checkName(o, e)) {
|
|
68
|
+
n(`"${e}" is not a valid state value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join("\", \"")}".`);
|
|
66
69
|
return;
|
|
67
70
|
}
|
|
68
|
-
let
|
|
71
|
+
let t = {
|
|
69
72
|
info: {
|
|
70
73
|
name: "information_fill",
|
|
71
74
|
color: "brand"
|
|
@@ -86,11 +89,11 @@ var i = [
|
|
|
86
89
|
name: "clock_fill",
|
|
87
90
|
color: "purpose-warning"
|
|
88
91
|
}
|
|
89
|
-
}, { name: r, color:
|
|
90
|
-
this.$statusIcon.name = r, this.$statusIcon.color =
|
|
92
|
+
}, { name: r, color: i } = t[e] || t.info;
|
|
93
|
+
this.$statusIcon.name = r, this.$statusIcon.color = i;
|
|
91
94
|
}
|
|
92
95
|
close() {
|
|
93
|
-
this.remove(), this.dispatchEvent(new CustomEvent(
|
|
96
|
+
this.remove(), this.dispatchEvent(new CustomEvent(c, {
|
|
94
97
|
bubbles: !0,
|
|
95
98
|
composed: !0
|
|
96
99
|
}));
|
|
@@ -132,6 +135,6 @@ var i = [
|
|
|
132
135
|
this._updateAttribute("background-color", e);
|
|
133
136
|
}
|
|
134
137
|
};
|
|
135
|
-
customElements.get("px-status-card") || customElements.define("px-status-card",
|
|
138
|
+
customElements.get("px-status-card") || customElements.define("px-status-card", l);
|
|
136
139
|
//#endregion
|
|
137
|
-
export {
|
|
140
|
+
export { l as StatusCard, s as statusCardBackgroundColorValues, o as statusCardStateValues };
|
package/dist/web-types.json
CHANGED
|
@@ -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-status-card",
|
|
4
|
-
"version": "1.4.16-beta.
|
|
4
|
+
"version": "1.4.16-beta.5",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
{ "name": "state" },
|
|
27
27
|
{ "name": "inverted" },
|
|
28
28
|
{ "name": "statusIconAriaLabel" },
|
|
29
|
-
{ "name": "backgroundColor", "type": "string | null" }
|
|
30
|
-
{ "name": "innerHTML" }
|
|
29
|
+
{ "name": "backgroundColor", "type": "string | null" }
|
|
31
30
|
],
|
|
32
31
|
"events": [{ "name": "CLOSE_EVENT", "type": "CustomEvent" }]
|
|
33
32
|
}
|