@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
76 lines (75 loc) • 2.63 kB
JavaScript
import f from "./NeonLink.es.js";
import { resolveComponent as s, openBlock as l, createBlock as a, mergeProps as t, withKeys as i, withModifiers as r, withCtx as y, renderSlot as k, createElementBlock as u, createCommentVNode as C } from "vue";
import m from "../../../_virtual/_plugin-vue_export-helper.es.js";
const S = ["href"];
function v(n, e, $, w, b, K) {
const d = s("router-link"), p = s("neon-icon");
return n.routerUrl ? (l(), a(d, t({
key: 0,
ref: "neonLink",
class: [[
{ "neon-link--no-style": n.noStyle, "neon-link--active": n.activeRoute, "neon-link--exact-active": n.exactRoute },
`neon-link--outline-${n.outlineStyle}`
], "neon-link neon-link--router-link"],
to: n.routerUrl,
tabindex: "0"
}, n.sanitizedAttributes, {
onClick: n.onClick,
onKeydown: [
i(n.onClick, ["enter"]),
i(r(n.onSpace, ["prevent"]), ["space"])
]
}), {
default: y(() => [
k(n.$slots, "default")
]),
_: 3
}, 16, ["class", "to", "onClick", "onKeydown"])) : n.href ? (l(), u("a", t({
key: 1,
ref: "neonLink",
class: [[
{
"neon-link--no-style": n.noStyle,
"neon-link--with-external-indicator": n.externalIndicator,
"neon-link--active": n.activeRoute,
"neon-link--exact-active": n.exactRoute
},
`neon-link--outline-${n.outlineStyle}`
], "neon-link neon-link--external-link"],
href: n.href,
rel: "noopener",
tabindex: "0"
}, n.sanitizedAttributes, {
onClick: e[0] || (e[0] = (...o) => n.onClick && n.onClick(...o)),
onKeydown: [
e[1] || (e[1] = i((...o) => n.onClick && n.onClick(...o), ["enter"])),
e[2] || (e[2] = i(r((...o) => n.onSpace && n.onSpace(...o), ["prevent"]), ["space"]))
]
}), [
k(n.$slots, "default"),
n.externalIndicator ? (l(), a(p, {
key: 0,
class: "neon-link__external-indicator",
color: "low-contrast",
name: "share-external-link-1"
})) : C("", !0)
], 16, S)) : (l(), u("a", t({
key: 2,
ref: "neonLink",
class: [[{ "neon-link--no-style": n.noStyle }, `neon-link--outline-${n.outlineStyle}`], "neon-link"],
tabindex: "0"
}, n.sanitizedAttributes, {
onClick: e[3] || (e[3] = (...o) => n.onClick && n.onClick(...o)),
onKeydown: [
e[4] || (e[4] = i((...o) => n.onClick && n.onClick(...o), ["enter"])),
e[5] || (e[5] = i(r((...o) => n.onSpace && n.onSpace(...o), ["prevent"]), ["space"]))
]
}), [
k(n.$slots, "default")
], 16));
}
const z = /* @__PURE__ */ m(f, [["render", v]]);
export {
z as default
};
//# sourceMappingURL=NeonLink.vue.es.js.map