@oslokommune/punkt-elements
Version:
Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo
39 lines (38 loc) • 1.43 kB
JavaScript
import { c as e, d as t, r as n, s as r, t as i } from "./element-cZ85T_aa.js";
import "./icon-Co72KtgF.js";
import { t as a } from "./if-defined-Cjj8qN-Z.js";
//#region src/components/backlink/backlink.ts
var o = class extends i {
constructor(...e) {
super(...e), this.href = "", this.text = "Forsiden", this.ariaLabel = "";
}
attributeChangedCallback(e, t, n) {
e === "arialabel" && this.removeAttribute("arialabel"), e === "href" && this.removeAttribute("href"), e === "text" && this.removeAttribute("text"), super.attributeChangedCallback(e, t, n);
}
render() {
return t`<nav
class="pkt-back-link"
aria-label=${this.ariaLabel || "Gå tilbake til forrige side"}
>
<a href=${a(this.href || "/")} class="pkt-link pkt-link--icon-left"
><pkt-icon
class="pkt-back-link__icon pkt-icon pkt-link__icon"
name="chevron-thin-left"
aria-hidden="true"
></pkt-icon
><span class="pkt-back-link__text">${this.text}</span></a
>
</nav>`;
}
};
n([r({ type: String })], o.prototype, "href", void 0), n([r({ type: String })], o.prototype, "text", void 0), n([r({ type: String })], o.prototype, "ariaLabel", void 0);
try {
e("pkt-backlink")(o);
} catch {
console.warn("Forsøker å definere <pkt-backlink>, men den er allerede definert");
}
//#endregion
//#region src/components/backlink/index.ts
var s = o;
//#endregion
export { o as n, s as t };