@postnord/web-components
Version:
PostNord Web Components
51 lines (45 loc) • 3.37 kB
JavaScript
/*!
* Built with Stencil
* By PostNord.
*/
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-78a59ba0.js');
const pnTextLinkCss = "pn-text-link{display:inline}pn-text-link .pn-text-link{border-radius:0.25em;color:#005d92;font-weight:500;text-decoration:underline;font-size:1em;transition-property:color, outline-color, text-decoration-color;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1);outline:0.2rem solid transparent;outline-offset:0.2rem}pn-text-link .pn-text-link:focus-visible{outline-color:#005d92}pn-text-link .pn-text-link:hover{color:#0d234b}pn-text-link .pn-text-link[data-icon]{display:inline-flex;gap:0.25em;align-items:center;text-decoration-color:transparent;padding:0.1em;border-radius:0.5em}pn-text-link .pn-text-link[data-icon] .pn-icon-svg path{fill:#005d92;transition-property:fill;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.7, 0, 0.3, 1)}pn-text-link .pn-text-link[data-icon]:hover{text-decoration-color:#0d234b}pn-text-link .pn-text-link[data-icon]:hover .pn-icon-svg path,pn-text-link .pn-text-link[data-icon]:focus-visible .pn-icon-svg path{fill:#0d234b}pn-text-link .pn-text-link[data-icon][data-icon-left]{flex-direction:row-reverse}pn-text-link .pn-text-link[data-light]{color:#ffffff}pn-text-link .pn-text-link[data-light]:focus-visible{outline-color:#ffffff}pn-text-link .pn-text-link[data-light]:hover{text-decoration-color:#ffffff}pn-text-link .pn-text-link[data-light][data-icon] pn-icon .pn-icon-svg path{fill:#ffffff}";
const PnTextLinkStyle0 = pnTextLinkCss;
const PnTextLink = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
}
get hostElement() { return index.getElement(this); }
/** The link text. */
label;
/** The URL string. */
href;
/** Use the light version of the link. @category Visual */
light = false;
/** SVG content of the icon. @category Visual */
icon;
/** Align the icon on the left. @category Visual */
leftIcon = false;
/** Treat the link as a download link. @category Link attributes */
download;
/** Set the hreflang of the URL destination. @category Link attributes */
hreflang;
/** Link media. @category Link attributes */
media;
/** Set referrerpolicy on the link. @category Link attributes */
referrerpolicy;
/** Set the rel of the link. @category Link attributes */
rel = 'noopener noreferrer';
/** Set the target of the link. @category Link attributes */
target;
/** Set a unique html ID of the a element. @category Link attributes */
linkid;
render() {
return (index.h("a", { key: '00ec79f634394a7a7aa40d0b5545cd45454851dd', id: this.linkid, class: "pn-text-link", href: this.href, rel: this.rel, target: this.target, download: this.download, hreflang: this.hreflang, media: this.media, referrerPolicy: this.referrerpolicy, "data-icon": !!this.icon, "data-icon-left": this.leftIcon, "data-light": this.light }, this.label, index.h("slot", { key: '9ac17c4c1c8e3866937eaf28a7cedcf1e2a41d0a' }), this.icon && index.h("pn-icon", { key: '29cd69e85bf4a3190f5e42a54e0b87ecd9a59745', icon: this.icon })));
}
};
PnTextLink.style = PnTextLinkStyle0;
exports.pn_text_link = PnTextLink;
//# sourceMappingURL=pn-text-link.cjs.entry.js.map