@proximus/lavender-button-icon 2.0.0-alpha.203 → 2.0.0-alpha.205
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/ButtonIcon.d.ts +1 -1
- package/dist/custom-elements.json +7 -9
- package/dist/index.es.js +14 -13
- package/dist/web-types.json +2 -3
- package/package.json +1 -1
package/dist/ButtonIcon.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export type ButtonIconVariant = (typeof buttonIconVariantValues)[number];
|
|
|
11
11
|
* @attr {boolean} disabled - Whether the button is disabled.
|
|
12
12
|
*/
|
|
13
13
|
export declare class ButtonIcon extends PxElement<HTMLButtonElement> {
|
|
14
|
+
protected static readonly template: HTMLTemplateElement;
|
|
14
15
|
static nativeName: string;
|
|
15
|
-
private template;
|
|
16
16
|
constructor();
|
|
17
17
|
static get observedAttributes(): string[];
|
|
18
18
|
connectedCallback(): void;
|
|
@@ -27,6 +27,13 @@
|
|
|
27
27
|
"description": "",
|
|
28
28
|
"name": "ButtonIcon",
|
|
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": "'button'"
|
|
38
45
|
},
|
|
39
|
-
{
|
|
40
|
-
"kind": "field",
|
|
41
|
-
"name": "template",
|
|
42
|
-
"privacy": "private"
|
|
43
|
-
},
|
|
44
46
|
{
|
|
45
47
|
"kind": "method",
|
|
46
48
|
"name": "_toggleClass",
|
|
@@ -118,10 +120,6 @@
|
|
|
118
120
|
{
|
|
119
121
|
"kind": "field",
|
|
120
122
|
"name": "ariaExpanded"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"kind": "field",
|
|
124
|
-
"name": "innerHTML"
|
|
125
123
|
}
|
|
126
124
|
],
|
|
127
125
|
"attributes": [
|
package/dist/index.es.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { PxElement as e, accessibilityAttributes as t,
|
|
1
|
+
import { PxElement as e, accessibilityAttributes as t, createTemplate as n, log as r, renderTemplate as i } from "@proximus/lavender-common";
|
|
2
2
|
//#region src/buttonicon.css?inline
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
3
|
+
var a = ".btn-icon,.btn-icon *{box-sizing:border-box}.btn-icon{font-size:var(--px-font-size-base);width:var(--px-size-l);height:var(--px-size-l);vertical-align:middle;cursor:pointer;--btn-transition:all .2s ease-in-out 0s;transition:var(--btn-transition);background:var(--px-color-background-container-primary-default);color:var(--px-color-icon-brand-inverted);border-radius:var(--px-radius-pill);padding:var(--px-padding-xs-mobile);border:var(--px-size-border-m) solid transparent;justify-content:center;align-items:center;display:inline-flex}.btn-icon ::slotted(px-icon){line-height:0}.btn-icon:hover:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-bordered-default);color:var(--px-color-icon-brand-default);border-color:var(--px-color-border-state-hover-default)}.btn-icon:active:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-active-inverted);color:var(--px-color-icon-state-active-default);border-color:var(--px-color-border-state-active-default)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-mobile);outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default)}.btn-icon[disabled],.btn-icon[aria-disabled=true]{background:var(--px-color-background-state-disabled-default);color:var(--px-color-icon-state-disabled-default);cursor:default;pointer-events:none}.btn-icon.btn-icon--state-loading{background:var(--px-color-background-state-disabled-default);color:var(--px-color-icon-brand-default);cursor:inherit}.btn-icon--size-small{padding:var(--px-padding-2xs-mobile);width:var(--px-size-m);height:var(--px-size-m)}.btn-icon--variant-secondary{background-color:var(--px-color-background-container-secondary-default);color:var(--px-color-icon-brand-default)}.btn-icon--variant-naked{color:var(--px-color-icon-brand-default);background-color:#0000;width:auto;height:auto}:host([inverted]) .btn-icon{background:var(--px-color-background-container-primary-inverted);color:var(--px-color-icon-brand-default)}:host([inverted]) .btn-icon:hover:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-bordered-inverted);color:var(--px-color-icon-brand-inverted);border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]) .btn-icon:active:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-default);color:var(--px-color-icon-state-active-inverted);border-color:var(--px-color-border-state-active-inverted)}:host([inverted]) .btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-color:var(--px-color-border-focus-outline-inverted)}:host([inverted]) .btn-icon[disabled],:host([inverted]) .btn-icon[aria-disabled=true]{background:var(--px-color-background-state-disabled-inverted);color:var(--px-color-icon-state-disabled-inverted)}:host([inverted]) .btn-icon.btn-icon--state-loading{background:var(--px-color-background-state-disabled-inverted);color:var(--px-color-icon-brand-inverted);border-color:#0000}:host([inverted]) .btn-icon.btn-icon--variant-naked{color:var(--px-color-icon-brand-inverted);background-color:#0000}:host([inverted]) .btn-icon--variant-secondary{background-color:var(--px-color-background-container-secondary-inverted);color:var(--px-color-icon-brand-inverted)}@media screen and (width>=48rem){.btn-icon{padding:var(--px-padding-xs-desktop)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}.btn-icon--size-small{padding:var(--px-padding-2xs-desktop)}}@media screen and (width>=64.0625rem){.btn-icon{padding:var(--px-padding-xs-desktop)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}.btn-icon--size-small{padding:var(--px-padding-2xs-desktop)}}", o = new CSSStyleSheet();
|
|
4
|
+
o.replaceSync(a);
|
|
5
|
+
var s = [
|
|
6
6
|
"",
|
|
7
7
|
"default",
|
|
8
8
|
"small"
|
|
9
|
-
],
|
|
9
|
+
], c = [
|
|
10
10
|
"",
|
|
11
11
|
"default",
|
|
12
12
|
"secondary",
|
|
13
13
|
"naked"
|
|
14
|
-
],
|
|
14
|
+
], l = class a extends e {
|
|
15
|
+
static {
|
|
16
|
+
this.template = n("<button class=\"btn-icon\"><slot></slot></button>");
|
|
17
|
+
}
|
|
15
18
|
static {
|
|
16
19
|
this.nativeName = "button";
|
|
17
20
|
}
|
|
18
21
|
constructor() {
|
|
19
|
-
super(
|
|
20
|
-
let e = document.createElement(r.nativeName);
|
|
21
|
-
e.classList.add("btn-icon"), e.innerHTML = this.template(), this.shadowRoot.appendChild(e);
|
|
22
|
+
super(o), i(this.shadowRoot, a.template);
|
|
22
23
|
}
|
|
23
24
|
static get observedAttributes() {
|
|
24
25
|
return [
|
|
@@ -64,10 +65,10 @@ var a = [
|
|
|
64
65
|
this.$el.classList.toggle("btn-icon--state-loading");
|
|
65
66
|
}
|
|
66
67
|
updateSize(e, t) {
|
|
67
|
-
this.checkName(
|
|
68
|
+
this.checkName(s, t) ? (e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`btn-icon--size-${e}`), t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`btn-icon--size-${t}`)) : r(`"${t}" is not a valid size value for ${this.tagName.toLowerCase()}. Allowed values are: "${s.join("\", \"")}".`);
|
|
68
69
|
}
|
|
69
70
|
updateVariant(e, t) {
|
|
70
|
-
this.checkName(
|
|
71
|
+
this.checkName(c, t) ? (e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`btn-icon--variant-${e}`), t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`btn-icon--variant-${t}`)) : r(`"${t}" is not a valid variant value for ${this.tagName.toLowerCase()}. Allowed values are: "${c.join("\", \"")}".`);
|
|
71
72
|
}
|
|
72
73
|
get inverted() {
|
|
73
74
|
return this.hasAttribute("inverted");
|
|
@@ -100,6 +101,6 @@ var a = [
|
|
|
100
101
|
this._updateAttribute("aria-expanded", e);
|
|
101
102
|
}
|
|
102
103
|
};
|
|
103
|
-
customElements.get("px-button-icon") || customElements.define("px-button-icon",
|
|
104
|
+
customElements.get("px-button-icon") || customElements.define("px-button-icon", l);
|
|
104
105
|
//#endregion
|
|
105
|
-
export {
|
|
106
|
+
export { l as ButtonIcon, s as buttonIconSizeValues, c as buttonIconVariantValues };
|
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-button-icon",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.205",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
{ "name": "loading" },
|
|
45
45
|
{ "name": "size" },
|
|
46
46
|
{ "name": "variant" },
|
|
47
|
-
{ "name": "ariaExpanded" }
|
|
48
|
-
{ "name": "innerHTML" }
|
|
47
|
+
{ "name": "ariaExpanded" }
|
|
49
48
|
],
|
|
50
49
|
"events": []
|
|
51
50
|
}
|