@proximus/lavender-spinner 1.4.14-beta.2 → 1.4.15-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/Spinner.d.ts +6 -7
- package/dist/index.es.js +63 -69
- package/package.json +1 -1
package/dist/Spinner.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare class Spinner extends HTMLElement {
|
|
2
|
-
ariaHiddenValue: string;
|
|
3
2
|
protected internals: ElementInternals;
|
|
4
3
|
private template;
|
|
5
4
|
constructor();
|
|
@@ -10,10 +9,10 @@ export declare class Spinner extends HTMLElement {
|
|
|
10
9
|
updateAttribute(attrName: string, oldValue: string, newValue: string, attrValues: string[]): void;
|
|
11
10
|
checkName(values: string[], value: string): boolean;
|
|
12
11
|
get $el(): Element;
|
|
13
|
-
get size(): string;
|
|
14
|
-
set size(value: string);
|
|
15
|
-
get inverted():
|
|
16
|
-
set inverted(value:
|
|
17
|
-
get timeout(): string;
|
|
18
|
-
set timeout(value: string);
|
|
12
|
+
get size(): string | null;
|
|
13
|
+
set size(value: string | null);
|
|
14
|
+
get inverted(): boolean;
|
|
15
|
+
set inverted(value: boolean);
|
|
16
|
+
get timeout(): string | null;
|
|
17
|
+
set timeout(value: string | null);
|
|
19
18
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,70 +1,64 @@
|
|
|
1
|
-
import { iconSizeValuesKC as
|
|
2
|
-
|
|
3
|
-
s.
|
|
4
|
-
|
|
5
|
-
class
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return this.getAttribute("timeout");
|
|
62
|
-
}
|
|
63
|
-
set timeout(e) {
|
|
64
|
-
this.setAttribute("timeout", e);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
customElements.get("px-spinner") || customElements.define("px-spinner", p);
|
|
68
|
-
export {
|
|
69
|
-
p as Spinner
|
|
1
|
+
import { booleanPropertyToAttributeSetter as e, iconSizeValuesKC as t, log as n, propertyToAttributeSetter as r } from "@proximus/lavender-common";
|
|
2
|
+
//#region src/spinner.css?inline
|
|
3
|
+
var i = ".spinner,.spinner *{box-sizing:border-box}.spinner{width:var(--px-size-icon-xs);height:var(--px-size-icon-xs);border-top:3px solid var(--px-color-text-brand-default);border-right:3px solid #0000;border-radius:50%;animation:.7s linear infinite anim-spinner;display:inline-block}@media (prefers-reduced-motion:no-preference){:host([timeout]) .spinner{animation-iteration-count:7}}:host([inverted]) .spinner{border-top-color:var(--px-color-text-brand-inverted)}@keyframes anim-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.size-xs{width:var(--px-size-icon-xs);height:var(--px-size-icon-xs)}.size-s,.size-m{width:var(--px-size-icon-s);height:var(--px-size-icon-s)}.size-l{width:var(--px-size-icon-l);height:var(--px-size-icon-l)}.size-xl{width:var(--px-size-icon-xl);height:var(--px-size-icon-xl)}@media screen and (width>=64.0625rem){.size-xs{width:var(--px-size-icon-xs);height:var(--px-size-icon-xs)}.size-s,.size-m{width:var(--px-size-icon-m);height:var(--px-size-icon-m)}.size-l{width:var(--px-size-icon-l);height:var(--px-size-icon-l)}.size-xl{width:var(--px-size-icon-xl);height:var(--px-size-icon-xl)}}@media screen and (width>=90.0625rem){.size-xs{width:var(--px-size-icon-xs);height:var(--px-size-icon-xs)}.size-s,.size-m{width:var(--px-size-icon-m);height:var(--px-size-icon-m)}.size-l{width:var(--px-size-icon-l);height:var(--px-size-icon-l)}.size-xl{width:var(--px-size-icon-xl);height:var(--px-size-icon-xl)}}", a = ".color-inherit{color:inherit!important}.color-brand{color:var(--px-color-text-brand-default)!important}.color-neutral{color:var(--px-color-text-neutral-default)!important}.color-dimmed{color:var(--px-color-text-dimmed-default)!important}.color-purpose-success{color:var(--px-color-text-purpose-success-default)!important}.color-purpose-warning{color:var(--px-color-text-purpose-warning-default)!important}.color-purpose-error{color:var(--px-color-text-purpose-error-default)!important}.color-purpose-unlimited{color:var(--px-color-text-purpose-unlimited-default)!important}.color-purpose-promo{color:var(--px-color-text-purpose-promo-default)!important}.color-state-hover{color:var(--px-color-text-state-hover-default)!important}.color-state-active{color:var(--px-color-text-state-active-default)!important}.color-state-disabled{color:var(--px-color-text-state-disabled-default)!important}:host([inverted]) .color-inherit{color:inherit!important}:host([inverted]) .color-brand{color:var(--px-color-text-brand-inverted)!important}:host([inverted]) .color-neutral{color:var(--px-color-text-neutral-inverted)!important}:host([inverted]) .color-dimmed{color:var(--px-color-text-dimmed-inverted)!important}:host([inverted]) .color-purpose-success{color:var(--px-color-text-purpose-success-inverted)!important}:host([inverted]) .color-purpose-warning{color:var(--px-color-text-purpose-warning-inverted)!important}:host([inverted]) .color-purpose-error{color:var(--px-color-text-purpose-error-inverted)!important}:host([inverted]) .color-purpose-unlimited{color:var(--px-color-text-purpose-unlimited-inverted)!important}:host([inverted]) .color-purpose-promo{color:var(--px-color-text-purpose-promo-inverted)!important}:host([inverted]) .color-state-hover{color:var(--px-color-text-state-hover-inverted)!important}:host([inverted]) .color-state-active{color:var(--px-color-text-state-active-inverted)!important}:host([inverted]) .color-state-disabled{color:var(--px-color-text-state-disabled-inverted)!important}.font-size-inherit{font-size:inherit;line-height:inherit}.font-size-body-l{font-size:var(--px-text-size-body-l-mobile)}.font-size-body-m{font-size:var(--px-text-size-body-m-mobile)}.font-size-body-s{font-size:var(--px-text-size-body-s-mobile)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-mobile)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-mobile)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-mobile)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-mobile)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-mobile)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-mobile)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-mobile)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-mobile)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-mobile)}.font-size-heading-3xl,.font-size-heading-4xl,.font-size-heading-5xl{line-height:var(--px-line-height-ratio-s)}.font-size-link-m{font-size:var(--px-text-size-link-m-mobile)}.font-size-link-s{font-size:var(--px-text-size-link-s-mobile)}@media screen and (width>=48rem){.font-size-body-l{font-size:var(--px-text-size-body-l-tablet)}.font-size-body-m{font-size:var(--px-text-size-body-m-tablet)}.font-size-body-s{font-size:var(--px-text-size-body-s-tablet)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-tablet)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-tablet)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-tablet)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-tablet)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-tablet)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-tablet)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-tablet)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-tablet)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-tablet)}.font-size-link-m{font-size:var(--px-text-size-link-m-tablet)}.font-size-link-s{font-size:var(--px-text-size-link-s-tablet)}}@media screen and (width>=64.0625rem){.font-size-body-l{font-size:var(--px-text-size-body-l-laptop)}.font-size-body-m{font-size:var(--px-text-size-body-m-laptop)}.font-size-body-s{font-size:var(--px-text-size-body-s-laptop)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-laptop)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-laptop)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-laptop)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-laptop)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-laptop)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-laptop)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-laptop)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-laptop)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-laptop)}.font-size-link-m{font-size:var(--px-text-size-link-m-laptop)}.font-size-link-s{font-size:var(--px-text-size-link-s-laptop)}}@media screen and (width>=90.0625rem){.font-size-body-l{font-size:var(--px-text-size-body-l-desktop)}.font-size-body-m{font-size:var(--px-text-size-body-m-desktop)}.font-size-body-s{font-size:var(--px-text-size-body-s-desktop)}.font-size-body-xs{font-size:var(--px-text-size-body-xs-desktop)}.font-size-heading-5xl{font-size:var(--px-text-size-heading-5xl-desktop)}.font-size-heading-4xl{font-size:var(--px-text-size-heading-4xl-desktop)}.font-size-heading-3xl{font-size:var(--px-text-size-heading-3xl-desktop)}.font-size-heading-2xl{font-size:var(--px-text-size-heading-2xl-desktop)}.font-size-heading-xl{font-size:var(--px-text-size-heading-xl-desktop)}.font-size-heading-l{font-size:var(--px-text-size-heading-l-desktop)}.font-size-heading-m{font-size:var(--px-text-size-heading-m-desktop)}.font-size-heading-s{font-size:var(--px-text-size-heading-s-desktop)}.font-size-link-m{font-size:var(--px-text-size-link-m-desktop)}.font-size-link-s{font-size:var(--px-text-size-link-s-desktop)}}.font-weight-inherit{font-weight:inherit}.font-weight-body{font-weight:var(--px-font-weight-body)}.font-weight-title{font-weight:var(--px-font-weight-title)}.font-weight-title-large{font-weight:var(--px-font-weight-title-large)}.font-weight-subtitle{font-weight:var(--px-font-weight-subtitle)}", o = new CSSStyleSheet(), s = new CSSStyleSheet();
|
|
4
|
+
o.replaceSync(i), s.replaceSync(a);
|
|
5
|
+
var c = class extends HTMLElement {
|
|
6
|
+
template() {
|
|
7
|
+
return "\n <div class=\"spinner\">\n <slot></slot>\n </div>\n ";
|
|
8
|
+
}
|
|
9
|
+
constructor() {
|
|
10
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.internals = this.attachInternals?.(), this.shadowRoot.adoptedStyleSheets = [o, s];
|
|
11
|
+
}
|
|
12
|
+
static get observedAttributes() {
|
|
13
|
+
return [
|
|
14
|
+
"size",
|
|
15
|
+
"inverted",
|
|
16
|
+
"timeout",
|
|
17
|
+
"aria-label"
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
!this.ariaLabel && this.internals && (this.internals.ariaHidden = "true", this.ariaHidden = "true");
|
|
22
|
+
}
|
|
23
|
+
attributeChangedCallback(e, n, r) {
|
|
24
|
+
if (n !== r) switch (e) {
|
|
25
|
+
case "size":
|
|
26
|
+
this.updateAttribute(e, n, r, t);
|
|
27
|
+
break;
|
|
28
|
+
case "aria-label": r !== "" && (this.internals.ariaHidden = "false", this.ariaHidden = "false", this.internals.role = "status", this.role = "status");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
configureAccessibility(e) {
|
|
32
|
+
this.internals.ariaHidden = e, this.ariaHidden = e;
|
|
33
|
+
}
|
|
34
|
+
updateAttribute(e, t, r, i) {
|
|
35
|
+
t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`${e}-${t}`), r !== null && r !== "" && t !== "default" && this.$el.classList.toggle(`${e}-${r}`), this.checkName(i, r) || n(`"${r}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${i.join("\", \"")}".`);
|
|
36
|
+
}
|
|
37
|
+
checkName(e, t) {
|
|
38
|
+
return e.includes(t);
|
|
39
|
+
}
|
|
40
|
+
get $el() {
|
|
41
|
+
return this.shadowRoot.querySelector(".spinner");
|
|
42
|
+
}
|
|
43
|
+
get size() {
|
|
44
|
+
return this.getAttribute("size");
|
|
45
|
+
}
|
|
46
|
+
set size(e) {
|
|
47
|
+
r(this, "size", e);
|
|
48
|
+
}
|
|
49
|
+
get inverted() {
|
|
50
|
+
return this.hasAttribute("inverted");
|
|
51
|
+
}
|
|
52
|
+
set inverted(t) {
|
|
53
|
+
e(this, "inverted", t);
|
|
54
|
+
}
|
|
55
|
+
get timeout() {
|
|
56
|
+
return this.getAttribute("timeout");
|
|
57
|
+
}
|
|
58
|
+
set timeout(e) {
|
|
59
|
+
r(this, "timeout", e);
|
|
60
|
+
}
|
|
70
61
|
};
|
|
62
|
+
customElements.get("px-spinner") || customElements.define("px-spinner", c);
|
|
63
|
+
//#endregion
|
|
64
|
+
export { c as Spinner };
|