UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

58 lines (57 loc) 1.51 kB
import { LINK_VARIANTS, LINK_KIND_MODIFIERS, getLinkKindModifier } from "./link_constants.js"; import { openBlock, createElementBlock, normalizeClass, renderSlot } from "vue"; import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js"; const _sfc_main = { compatConfig: { MODE: 3 }, name: "DtLink", props: { /** * Applies the link variant styles * @values null, danger, warning, success, muted, mention */ kind: { type: String, default: "", validator(kind) { return LINK_VARIANTS.includes(kind); } }, /** * Determines whether the link should have inverted styling * default is false. * @values true, false */ inverted: { type: Boolean, default: false } }, data() { return { LINK_KIND_MODIFIERS }; }, methods: { getLinkClasses() { return [ "d-link", getLinkKindModifier(this.kind, this.inverted) ]; } } }; const _hoisted_1 = ["href"]; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("a", { class: normalizeClass($options.getLinkClasses()), "data-qa": "dt-link", href: "href" in _ctx.$attrs ? _ctx.$attrs.href : "javascript:void(0)" }, [ renderSlot(_ctx.$slots, "default") ], 10, _hoisted_1); } const DtLink = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { DtLink as default }; //# sourceMappingURL=link.vue.js.map