@proximus/lavender-spinner 1.4.14-beta.3 → 1.4.14
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 +7 -6
- package/dist/index.es.js +69 -63
- package/package.json +1 -1
package/dist/Spinner.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare class Spinner extends HTMLElement {
|
|
2
|
+
ariaHiddenValue: string;
|
|
2
3
|
protected internals: ElementInternals;
|
|
3
4
|
private template;
|
|
4
5
|
constructor();
|
|
@@ -9,10 +10,10 @@ export declare class Spinner extends HTMLElement {
|
|
|
9
10
|
updateAttribute(attrName: string, oldValue: string, newValue: string, attrValues: string[]): void;
|
|
10
11
|
checkName(values: string[], value: string): boolean;
|
|
11
12
|
get $el(): Element;
|
|
12
|
-
get size(): string
|
|
13
|
-
set size(value: string
|
|
14
|
-
get inverted():
|
|
15
|
-
set inverted(value:
|
|
16
|
-
get timeout(): string
|
|
17
|
-
set timeout(value: string
|
|
13
|
+
get size(): string;
|
|
14
|
+
set size(value: string);
|
|
15
|
+
get inverted(): string;
|
|
16
|
+
set inverted(value: string);
|
|
17
|
+
get timeout(): string;
|
|
18
|
+
set timeout(value: string);
|
|
18
19
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,64 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
1
|
+
import { iconSizeValuesKC as r, log as a } from "@proximus/lavender-common";
|
|
2
|
+
const l = ".spinner{display:inline-block;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 transparent;border-radius:50%;animation:anim-spinner .7s linear infinite}.spinner,.spinner *{box-sizing:border-box}@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 (min-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 (min-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)}}", x = ".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 (min-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 (min-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 (min-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)}", s = new CSSStyleSheet(), n = new CSSStyleSheet();
|
|
3
|
+
s.replaceSync(l);
|
|
4
|
+
n.replaceSync(x);
|
|
5
|
+
class p extends HTMLElement {
|
|
6
|
+
template() {
|
|
7
|
+
return `
|
|
8
|
+
<div class="spinner">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</div>
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
var e;
|
|
15
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.internals = (e = this.attachInternals) == null ? void 0 : e.call(this), this.shadowRoot.adoptedStyleSheets = [s, n];
|
|
16
|
+
}
|
|
17
|
+
static get observedAttributes() {
|
|
18
|
+
return ["size", "inverted", "timeout", "aria-label"];
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
!this.ariaLabel && this.internals && (this.internals.ariaHidden = "true", this.ariaHidden = "true");
|
|
22
|
+
}
|
|
23
|
+
attributeChangedCallback(e, t, i) {
|
|
24
|
+
if (t !== i)
|
|
25
|
+
switch (e) {
|
|
26
|
+
case "size":
|
|
27
|
+
this.updateAttribute(e, t, i, r);
|
|
28
|
+
break;
|
|
29
|
+
case "aria-label":
|
|
30
|
+
i !== "" && (this.internals.ariaHidden = "false", this.ariaHidden = "false", this.internals.role = "status", this.role = "status");
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
configureAccessibility(e) {
|
|
35
|
+
this.internals.ariaHidden = e, this.ariaHidden = e;
|
|
36
|
+
}
|
|
37
|
+
updateAttribute(e, t, i, o) {
|
|
38
|
+
t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`${e}-${t}`), i !== null && i !== "" && t !== "default" && this.$el.classList.toggle(`${e}-${i}`), this.checkName(o, i) || a(
|
|
39
|
+
`"${i}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${o.join('", "')}".`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
checkName(e, t) {
|
|
43
|
+
return e.includes(t);
|
|
44
|
+
}
|
|
45
|
+
get $el() {
|
|
46
|
+
return this.shadowRoot.querySelector(".spinner");
|
|
47
|
+
}
|
|
48
|
+
get size() {
|
|
49
|
+
return this.getAttribute("size");
|
|
50
|
+
}
|
|
51
|
+
set size(e) {
|
|
52
|
+
this.setAttribute("size", e);
|
|
53
|
+
}
|
|
54
|
+
get inverted() {
|
|
55
|
+
return this.getAttribute("inverted");
|
|
56
|
+
}
|
|
57
|
+
set inverted(e) {
|
|
58
|
+
this.setAttribute("inverted", e);
|
|
59
|
+
}
|
|
60
|
+
get timeout() {
|
|
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
|
|
61
70
|
};
|
|
62
|
-
customElements.get("px-spinner") || customElements.define("px-spinner", c);
|
|
63
|
-
//#endregion
|
|
64
|
-
export { c as Spinner };
|