UNPKG

@aotearoan/neon

Version:

Neon is a lightweight design library of Vue 3 components with minimal dependencies.

3 lines (2 loc) 2.37 kB
"use strict";const r=require("./NeonLink.cjs.js"),n=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),a={class:"neon-link__label"},k=["href"],p={class:"neon-link__label"},d={class:"neon-link__label"};function u(e,o,c,C,w,m){const i=n.resolveComponent("router-link"),t=n.resolveComponent("neon-icon");return e.routerUrl?(n.openBlock(),n.createBlock(i,n.mergeProps({key:0,class:[[{"neon-link--no-style":e.noStyle,"neon-link--active":e.activeRoute,"neon-link--exact-active":e.exactRoute},`neon-link--outline-${e.outlineStyle}`],"neon-link neon-link--router-link"],to:e.routerUrl,tabindex:"0"},e.sanitizedAttributes,{onClick:e.onClick,onKeydown:[n.withKeys(e.onClick,["enter"]),n.withKeys(n.withModifiers(e.onSpace,["prevent"]),["space"])]}),{default:n.withCtx(()=>[n.createElementVNode("span",a,[n.renderSlot(e.$slots,"default")])]),_:3},16,["class","to","onClick","onKeydown"])):e.href?(n.openBlock(),n.createElementBlock("a",n.mergeProps({key:1,class:[[{"neon-link--no-style":e.noStyle,"neon-link--with-external-indicator":e.externalIndicator,"neon-link--active":e.activeRoute,"neon-link--exact-active":e.exactRoute},`neon-link--outline-${e.outlineStyle}`],"neon-link neon-link--external-link"],href:e.href,rel:"noopener",tabindex:"0"},e.sanitizedAttributes,{onClick:o[0]||(o[0]=(...l)=>e.onClick&&e.onClick(...l)),onKeydown:[o[1]||(o[1]=n.withKeys((...l)=>e.onClick&&e.onClick(...l),["enter"])),o[2]||(o[2]=n.withKeys(n.withModifiers((...l)=>e.onSpace&&e.onSpace(...l),["prevent"]),["space"]))]}),[n.createElementVNode("span",p,[n.renderSlot(e.$slots,"default"),e.externalIndicator?(n.openBlock(),n.createBlock(t,{key:0,class:"neon-link__external-indicator",color:"low-contrast",name:"link-external"})):n.createCommentVNode("",!0)])],16,k)):(n.openBlock(),n.createElementBlock("a",n.mergeProps({key:2,class:[[{"neon-link--no-style":e.noStyle},`neon-link--outline-${e.outlineStyle}`],"neon-link"],tabindex:"0"},e.sanitizedAttributes,{onClick:o[3]||(o[3]=(...l)=>e.onClick&&e.onClick(...l)),onKeydown:[o[4]||(o[4]=n.withKeys((...l)=>e.onClick&&e.onClick(...l),["enter"])),o[5]||(o[5]=n.withKeys(n.withModifiers((...l)=>e.onSpace&&e.onSpace(...l),["prevent"]),["space"]))]}),[n.createElementVNode("span",d,[n.renderSlot(e.$slots,"default")])],16))}const y=s(r,[["render",u]]);module.exports=y; //# sourceMappingURL=NeonLink.vue.cjs.js.map