@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
64 lines (63 loc) • 1.45 kB
JavaScript
import { t as e } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
import { LINK_KIND_MODIFIERS as t, LINK_VARIANTS as n, getLinkKindModifier as r } from "./link-constants.js";
import { createBlock as i, mergeProps as a, openBlock as o, renderSlot as s, resolveComponent as c, resolveDynamicComponent as l, withCtx as u } from "vue";
//#region components/link/link.vue
var d = {
compatConfig: { MODE: 3 },
name: "DtLink",
props: {
kind: {
type: String,
default: "",
validator(e) {
return n.includes(e);
}
},
inverted: {
type: Boolean,
default: !1
},
href: {
type: String,
default: null
},
to: {
type: [String, Object],
default: null
},
replace: {
type: Boolean,
default: !1
}
},
data() {
return { LINK_KIND_MODIFIERS: t };
},
computed: {
computedTag() {
return this.to ? c("RouterLink") : "a";
},
computedAttrs() {
return this.to ? {
to: this.to,
replace: this.replace
} : { href: this.href || "javascript:void(0)" };
}
},
methods: { getLinkClasses() {
return ["d-link", r(this.kind, this.inverted)];
} }
};
function f(e, t, n, r, c, d) {
return o(), i(l(d.computedTag), a({
class: d.getLinkClasses(),
"data-qa": "dt-link"
}, d.computedAttrs), {
default: u(() => [s(e.$slots, "default")]),
_: 3
}, 16, ["class"]);
}
var p = /* @__PURE__ */ e(d, [["render", f]]);
//#endregion
export { p as default };
//# sourceMappingURL=link.js.map