@proximus/lavender-action-link 2.0.0-alpha.19 → 2.0.0-alpha.190
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/ActionLink.d.ts +7 -6
- package/dist/index.es.js +54 -50
- package/package.json +2 -2
package/dist/ActionLink.d.ts
CHANGED
|
@@ -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():
|
|
14
|
-
get $anchor():
|
|
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
|
|
6
|
-
|
|
7
|
-
s.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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="
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
63
|
-
|
|
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.
|
|
3
|
+
"version": "2.0.0-alpha.190",
|
|
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
|
|
16
|
+
"wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|