@proximus/lavender-action-button 2.0.0-alpha.165 → 2.0.0-alpha.169

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.
@@ -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 a, transferAccessibilityAttributes as l } from "@proximus/lavender-common";
5
- const p = "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{background-color:transparent;border-color:var(--px-color-border-state-hover-default)}@media only screen and (min-width: 64.0625rem){button{border-radius:var(--px-radius-main);width:inherit;height:inherit}}", c = ":host{display:block}:host *{box-sizing:border-box}:host(:not([promoted])){display:none}a,button{display:block;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;text-decoration:none;color:var(--px-color-text-brand-default);--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition)}a px-span,button px-span{font-size:var(--px-text-size-label-s-mobile);line-height:var(--px-line-height-ratio-l)}a:hover,button:hover{background-color:var(--px-color-background-container-secondary-default)}a:focus-visible,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 (min-width: 48rem){a,button{padding:var(--px-padding-xs-tablet)}a px-span,button px-span{font-size:var(--px-text-size-label-s-tablet)}a:focus-visible,button:focus-visible{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}}@media only screen and (min-width: 64.0625rem){a,button{min-width:65px;padding:var(--px-padding-xs-laptop)}a px-span,button px-span{font-size:var(--px-text-size-label-s-laptop)}a:focus-visible,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 (min-width: 90.0625rem){a,button{padding:var(--px-padding-xs-desktop)}a px-span,button px-span{font-size:var(--px-text-size-label-s-desktop)}a:focus-visible,button:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}", r = new CSSStyleSheet(), s = new CSSStyleSheet();
6
- r.replaceSync(p);
7
- s.replaceSync(c);
8
- const i = class i extends a {
9
- constructor() {
10
- super(s, r), this.template = () => `
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
- static get observedAttributes() {
27
- return [...super.observedAttributes, "icon-name", "icon-from", "promoted"];
28
- }
29
- connectedCallback() {
30
- var t;
31
- ((t = this.parentElement) == null ? void 0 : t.localName) === "px-header" && this.setAttribute("slot", "header-actions"), l(this, this.$el, !1);
32
- }
33
- attributeChangedCallback(t, n, e) {
34
- if (n !== e)
35
- switch (t) {
36
- case "icon-name":
37
- this.$icon.setAttribute("name", e);
38
- break;
39
- case "icon-from":
40
- this.$icon.setAttribute("from", e);
41
- break;
42
- default:
43
- super.attributeChangedCallback(t, n, e);
44
- break;
45
- }
46
- }
47
- get $icon() {
48
- return this.shadowRoot.querySelector("px-icon");
49
- }
50
- get $dropdown() {
51
- return this.shadowRoot.querySelector("px-dropdown");
52
- }
53
- get iconName() {
54
- return this.getAttribute("icon-name");
55
- }
56
- set iconName(t) {
57
- this.setAttribute("icon-name", t);
58
- }
59
- get iconFrom() {
60
- return this.getAttribute("icon-from");
61
- }
62
- set iconFrom(t) {
63
- this.setAttribute("icon-from", t);
64
- }
65
- get promoted() {
66
- return this.hasAttribute("promoted");
67
- }
68
- set promoted(t) {
69
- t ? this.setAttribute("promoted", "") : this.removeAttribute("promoted");
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
- export {
76
- o as ActionButton
77
- };
77
+ //#endregion
78
+ export { o as ActionButton };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-action-button",
3
- "version": "2.0.0-alpha.165",
3
+ "version": "2.0.0-alpha.169",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",