UNPKG

@aotearoan/neon

Version:

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

3 lines (2 loc) 1.48 kB
"use strict";const t=require("./NeonChip.cjs.js"),n=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),l=["aria-disabled","role","tabindex"],p={class:"neon-chip__label"};function a(e,o,c,u,k,m){const r=n.resolveComponent("neon-icon");return n.openBlock(),n.createBlock(n.Transition,{name:"neon-transition-chip"},{default:n.withCtx(()=>[e.open?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,ref:"chip","aria-disabled":e.disabled,class:[[`neon-chip--${e.size}`,`neon-chip--${e.color}`,`neon-chip--${e.action}`,{"neon-chip--disabled":e.disabled,"neon-chip--active":e.active}],"no-style neon-chip"],role:e.role,tabindex:e.disabled?void 0:0},e.attrs,{onClick:o[0]||(o[0]=i=>e.clicked()),onKeyup:o[1]||(o[1]=(...i)=>e.keyUp&&e.keyUp(...i)),onKeydown:[o[2]||(o[2]=n.withKeys(n.withModifiers(i=>e.keyDown(),["prevent"]),["space"])),o[3]||(o[3]=n.withKeys(i=>e.keyDown(),["enter"])),o[4]||(o[4]=n.withKeys(i=>e.action==="remove"&&e.keyDown(),["delete"]))]}),[e.icon?(n.openBlock(),n.createBlock(r,{key:0,color:e.color,name:e.icon,class:"neon-chip__icon"},null,8,["color","name"])):n.createCommentVNode("",!0),n.createElementVNode("span",p,n.toDisplayString(e.label),1),e.action==="remove"?(n.openBlock(),n.createBlock(r,{key:1,class:"neon-chip__close",color:"neutral",name:"times"})):n.createCommentVNode("",!0)],16,l)):n.createCommentVNode("",!0)]),_:1})}const d=s(t,[["render",a]]);module.exports=d; //# sourceMappingURL=NeonChip.vue.cjs.js.map