@proximus/lavender-action-button 2.0.0-alpha.168 → 2.0.0-alpha.170
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/ActionButton.d.ts +4 -4
- package/dist/index.es.js +59 -58
- package/package.json +1 -1
package/dist/ActionButton.d.ts
CHANGED
|
@@ -11,10 +11,10 @@ export declare class ActionButton extends PxElement<HTMLButtonElement> {
|
|
|
11
11
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
12
12
|
get $icon(): HTMLElement;
|
|
13
13
|
get $dropdown(): HTMLElement;
|
|
14
|
-
get iconName(): string;
|
|
15
|
-
set iconName(value: string);
|
|
16
|
-
get iconFrom(): string;
|
|
17
|
-
set iconFrom(value: string);
|
|
14
|
+
get iconName(): string | null;
|
|
15
|
+
set iconName(value: string | null);
|
|
16
|
+
get iconFrom(): string | null;
|
|
17
|
+
set iconFrom(value: string | null);
|
|
18
18
|
get promoted(): boolean;
|
|
19
19
|
set promoted(value: boolean);
|
|
20
20
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import "@proximus/lavender-layout";
|
|
2
2
|
import "@proximus/lavender-icon";
|
|
3
3
|
import "@proximus/lavender-span";
|
|
4
|
-
import { PxElement as
|
|
5
|
-
|
|
6
|
-
r.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { PxElement as e, transferAccessibilityAttributes as t } from "@proximus/lavender-common";
|
|
5
|
+
//#region src/action-button.css?inline
|
|
6
|
+
var n = "button{border-radius:var(--px-radius-pill);background-color:var(--px-color-background-container-secondary-default);width:var(--px-size-l);height:var(--px-size-l)}button:hover{border-color:var(--px-color-border-state-hover-default);background-color:#0000}@media only screen and (width>=64.0625rem){button{border-radius:var(--px-radius-main);width:inherit;height:inherit}}", r = ":host{display:block}:host *{box-sizing:border-box}:host(:not([promoted])){display:none}a,button{font-family:var(--px-font-family);padding:var(--px-padding-xs-mobile);cursor:pointer;border-radius:var(--px-radius-main);border:var(--px-size-border-m) solid transparent;color:var(--px-color-text-brand-default);--btn-transition:all .2s ease-in-out 0s;transition:var(--btn-transition);text-decoration:none;display:block}:is(a,button) px-span{font-size:var(--px-text-size-label-s-mobile);line-height:var(--px-line-height-ratio-l)}:is(a,button):hover{background-color:var(--px-color-background-container-secondary-default)}:is(a,button):focus-visible{outline-offset:var(--px-focus-offset-mobile);outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default)}@media only screen and (width>=48rem){a,button{padding:var(--px-padding-xs-tablet)}:is(a,button) px-span{font-size:var(--px-text-size-label-s-tablet)}:is(a,button):focus-visible{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}}@media only screen and (width>=64.0625rem){a,button{min-width:65px;padding:var(--px-padding-xs-laptop)}:is(a,button) px-span{font-size:var(--px-text-size-label-s-laptop)}:is(a,button):focus-visible{outline-offset:var(--px-focus-offset-laptop);outline-width:var(--px-focus-outline-laptop)}:host(:not([promoted])){display:block}}@media only screen and (width>=90.0625rem){a,button{padding:var(--px-padding-xs-desktop)}:is(a,button) px-span{font-size:var(--px-text-size-label-s-desktop)}:is(a,button):focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}", i = new CSSStyleSheet(), a = new CSSStyleSheet();
|
|
7
|
+
i.replaceSync(n), a.replaceSync(r);
|
|
8
|
+
var o = class extends e {
|
|
9
|
+
static {
|
|
10
|
+
this.nativeName = "button";
|
|
11
|
+
}
|
|
12
|
+
constructor() {
|
|
13
|
+
super(a, i), this.template = () => `
|
|
11
14
|
<button class="action-button">
|
|
12
15
|
<px-vstack gap="none" align-items="center" justify-content="center">
|
|
13
16
|
<px-icon
|
|
@@ -22,56 +25,54 @@ const i = class i extends a {
|
|
|
22
25
|
</px-vstack>
|
|
23
26
|
</button>
|
|
24
27
|
`, this.shadowRoot.innerHTML = this.template();
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
28
|
+
}
|
|
29
|
+
static get observedAttributes() {
|
|
30
|
+
return [
|
|
31
|
+
...super.observedAttributes,
|
|
32
|
+
"icon-name",
|
|
33
|
+
"icon-from",
|
|
34
|
+
"promoted"
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
this.parentElement?.localName === "px-header" && this.setAttribute("slot", "header-actions"), t(this, this.$el, !1);
|
|
39
|
+
}
|
|
40
|
+
attributeChangedCallback(e, t, n) {
|
|
41
|
+
if (t !== n) switch (e) {
|
|
42
|
+
case "icon-name":
|
|
43
|
+
this.$icon.setAttribute("name", n);
|
|
44
|
+
break;
|
|
45
|
+
case "icon-from":
|
|
46
|
+
this.$icon.setAttribute("from", n);
|
|
47
|
+
break;
|
|
48
|
+
default: super.attributeChangedCallback(e, t, n);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
get $icon() {
|
|
52
|
+
return this.shadowRoot.querySelector("px-icon");
|
|
53
|
+
}
|
|
54
|
+
get $dropdown() {
|
|
55
|
+
return this.shadowRoot.querySelector("px-dropdown");
|
|
56
|
+
}
|
|
57
|
+
get iconName() {
|
|
58
|
+
return this.getAttribute("icon-name");
|
|
59
|
+
}
|
|
60
|
+
set iconName(e) {
|
|
61
|
+
this._updateAttribute("icon-name", e);
|
|
62
|
+
}
|
|
63
|
+
get iconFrom() {
|
|
64
|
+
return this.getAttribute("icon-from");
|
|
65
|
+
}
|
|
66
|
+
set iconFrom(e) {
|
|
67
|
+
this._updateAttribute("icon-from", e);
|
|
68
|
+
}
|
|
69
|
+
get promoted() {
|
|
70
|
+
return this.hasAttribute("promoted");
|
|
71
|
+
}
|
|
72
|
+
set promoted(e) {
|
|
73
|
+
this._updateBooleanAttribute("promoted", e);
|
|
74
|
+
}
|
|
71
75
|
};
|
|
72
|
-
i.nativeName = "button";
|
|
73
|
-
let o = i;
|
|
74
76
|
customElements.get("px-action-button") || customElements.define("px-action-button", o);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { o as ActionButton };
|