@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
58 lines (57 loc) • 1.65 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const link_constants = require("./link_constants.cjs");
const vue = require("vue");
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.cjs");
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_constants.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: link_constants.LINK_KIND_MODIFIERS
};
},
methods: {
getLinkClasses() {
return [
"d-link",
link_constants.getLinkKindModifier(this.kind, this.inverted)
];
}
}
};
const _hoisted_1 = ["href"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("a", {
class: vue.normalizeClass($options.getLinkClasses()),
"data-qa": "dt-link",
href: "href" in _ctx.$attrs ? _ctx.$attrs.href : "javascript:void(0)"
}, [
vue.renderSlot(_ctx.$slots, "default")
], 10, _hoisted_1);
}
const DtLink = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
exports.default = DtLink;
//# sourceMappingURL=link.vue.cjs.map