@proximus/lavender-action-link 2.0.0-alpha.19 → 2.0.0-alpha.191

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.
@@ -3,6 +3,7 @@ import '@proximus/lavender-icon';
3
3
  import '@proximus/lavender-span';
4
4
  import '@proximus/lavender-container';
5
5
  import { PxElement } from '@proximus/lavender-common';
6
+ import { type Icon } from '@proximus/lavender-icon-common';
6
7
  export declare class ActionLink extends PxElement<HTMLAnchorElement> implements Partial<HTMLAnchorElement> {
7
8
  static nativeName: string;
8
9
  template: () => string;
@@ -10,12 +11,12 @@ export declare class ActionLink extends PxElement<HTMLAnchorElement> implements
10
11
  static get observedAttributes(): string[];
11
12
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
12
13
  connectedCallback(): void;
13
- get $icon(): HTMLElement;
14
- get $anchor(): HTMLElement;
15
- get iconName(): string;
16
- set iconName(value: string);
17
- get iconFrom(): string;
18
- set iconFrom(value: string);
14
+ get $icon(): Icon | null;
15
+ get $anchor(): HTMLAnchorElement | null;
16
+ get iconName(): string | null;
17
+ set iconName(value: string | null);
18
+ get iconFrom(): string | null;
19
+ set iconFrom(value: string | null);
19
20
  get promoted(): boolean;
20
21
  set promoted(value: boolean);
21
22
  }
package/dist/index.es.js CHANGED
@@ -2,63 +2,67 @@ import "@proximus/lavender-layout";
2
2
  import "@proximus/lavender-icon";
3
3
  import "@proximus/lavender-span";
4
4
  import "@proximus/lavender-container";
5
- import { PxElement as r, log as n, transferAccessibilityAttributes as l } from "@proximus/lavender-common";
6
- const p = ":host{display:block}:host *{box-sizing:border-box}:host(:not([promoted])){display:none}a{display:block;padding:var(--px-padding-xs-mobile);cursor:pointer;border-radius:var(--px-radius-main);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{font-size:var(--px-text-size-label-s-mobile)}a:hover{background-color:var(--px-color-background-container-secondary-default)}a: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: 48em){a{padding:var(--px-padding-xs-tablet) var(--px-padding-2xs-tablet);min-width:65px}a px-span{font-size:var(--px-text-size-label-s-tablet)}a:focus-visible{outline-offset:var(--px-focus-offset-tablet);outline-width:var(--px-focus-outline-tablet)}:host(:not([promoted])){display:block}}@media only screen and (min-width: 64.0625em){a{padding:var(--px-padding-xs-laptop) var(--px-padding-2xs-laptop)}a px-span{font-size:var(--px-text-size-label-s-laptop)}a:focus-visible{outline-offset:var(--px-focus-offset-laptop);outline-width:var(--px-focus-outline-laptop)}}@media only screen and (min-width: 90.0625em){a{padding:var(--px-padding-xs-desktop) var(--px-padding-2xs-desktop)}a px-span{font-size:var(--px-text-size-label-s-desktop)}a:focus-visible{outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}}", s = new CSSStyleSheet();
7
- s.replaceSync(p);
8
- const i = class i extends r {
9
- constructor() {
10
- super(s), this.template = () => `<a href="${this.getAttribute("href")}">
5
+ import { PxElement as e, log as t, propertyToAttributeSetter as n, transferAccessibilityAttributes as r } from "@proximus/lavender-common";
6
+ //#region src/action-link.css?inline
7
+ var i = ":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)}}", a = new CSSStyleSheet();
8
+ a.replaceSync(i);
9
+ var o = class extends e {
10
+ static {
11
+ this.nativeName = "a";
12
+ }
13
+ constructor() {
14
+ super(a), this.template = () => `<a href="${this.getAttribute("href")}">
11
15
  <px-vstack gap="none" align-items="center">
12
16
  <px-icon
13
17
  name="${this.getAttribute("icon-name")}"
14
18
  from="${this.getAttribute("icon-from")}"
15
- size="s"
19
+ size="m"
16
20
  >
17
21
  </px-icon>
18
- <px-span color="brand" hidden--mobile><slot></slot></px-span>
22
+ <px-span color="brand" font-size="inherit" hidden--mobile hidden--tablet><slot></slot></px-span>
19
23
  </px-vstack>
20
24
  </a>`, this.shadowRoot.innerHTML = this.template();
21
- }
22
- static get observedAttributes() {
23
- return [...super.observedAttributes, "icon-name", "icon-from", "promoted"];
24
- }
25
- attributeChangedCallback(t, a, e) {
26
- if ((t === "icon-name" || t === "icon-from" || t === "label") && !e)
27
- throw n(`Action link needs a value from the attribute ${t}`), new Error(`Action link needs a value from the attribute ${t}`);
28
- t === "icon-name" ? this.$icon.setAttribute("name", e) : t === "icon-from" ? this.$icon.setAttribute("from", e) : super.attributeChangedCallback(t, a, e);
29
- }
30
- connectedCallback() {
31
- var t;
32
- ((t = this.parentElement) == null ? void 0 : t.localName) === "px-header" && this.setAttribute("slot", "header-actions"), this.hasAttribute("icon-from") || this.setAttribute("icon-from", "lavender"), this.hasAttribute("icon-name") || this.setAttribute("icon-name", "bug"), l(this, this.$el, !1), this.getAttribute("aria-label") || this.$el.setAttribute("aria-label", this.textContent);
33
- }
34
- get $icon() {
35
- return this.shadowRoot.querySelector("px-icon");
36
- }
37
- get $anchor() {
38
- return this.shadowRoot.querySelector("a");
39
- }
40
- get iconName() {
41
- return this.getAttribute("icon-name");
42
- }
43
- set iconName(t) {
44
- this.setAttribute("icon-name", t);
45
- }
46
- get iconFrom() {
47
- return this.getAttribute("icon-from");
48
- }
49
- set iconFrom(t) {
50
- this.setAttribute("icon-from", t);
51
- }
52
- get promoted() {
53
- return this.hasAttribute("promoted");
54
- }
55
- set promoted(t) {
56
- t ? this.setAttribute("promoted", "") : this.removeAttribute("promoted");
57
- }
25
+ }
26
+ static get observedAttributes() {
27
+ return [
28
+ ...super.observedAttributes,
29
+ "icon-name",
30
+ "icon-from",
31
+ "promoted"
32
+ ];
33
+ }
34
+ attributeChangedCallback(e, n, r) {
35
+ if ((e === "icon-name" || e === "icon-from" || e === "label") && !r) throw t(`Action link needs a value from the attribute ${e}`), Error(`Action link needs a value from the attribute ${e}`);
36
+ e === "icon-name" ? this.$icon?.setAttribute("name", r) : e === "icon-from" ? this.$icon?.setAttribute("from", r) : super.attributeChangedCallback(e, n, r);
37
+ }
38
+ connectedCallback() {
39
+ this.parentElement?.localName === "px-header" && this.setAttribute("slot", "header-actions"), this.hasAttribute("icon-from") || this.setAttribute("icon-from", "lavender"), this.hasAttribute("icon-name") || this.setAttribute("icon-name", "bug"), r(this, this.$el, !1), this.getAttribute("aria-label") || n(this.$el, "aria-label", this.textContent);
40
+ }
41
+ get $icon() {
42
+ return this.shadowRoot.querySelector("px-icon");
43
+ }
44
+ get $anchor() {
45
+ return this.shadowRoot.querySelector("a");
46
+ }
47
+ get iconName() {
48
+ return this.getAttribute("icon-name");
49
+ }
50
+ set iconName(e) {
51
+ this._updateAttribute("icon-name", e);
52
+ }
53
+ get iconFrom() {
54
+ return this.getAttribute("icon-from");
55
+ }
56
+ set iconFrom(e) {
57
+ this._updateAttribute("icon-from", e);
58
+ }
59
+ get promoted() {
60
+ return this.hasAttribute("promoted");
61
+ }
62
+ set promoted(e) {
63
+ this._updateBooleanAttribute("promoted", e);
64
+ }
58
65
  };
59
- i.nativeName = "a";
60
- let o = i;
61
66
  customElements.get("px-action-link") || customElements.define("px-action-link", o);
62
- export {
63
- o as ActionLink
64
- };
67
+ //#endregion
68
+ export { o as ActionLink };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-action-link",
3
- "version": "2.0.0-alpha.19",
3
+ "version": "2.0.0-alpha.191",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "clean": "rm -rf dist",
14
14
  "build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json && npm run wc-manifest",
15
15
  "test": "vitest run --coverage",
16
- "wc-manifest": "cem analyze --globs \"src/*\" --config ../custom-elements-manifest.config.js --outdir dist"
16
+ "wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
17
17
  },
18
18
  "publishConfig": {
19
19
  "access": "public"