@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
79 lines (78 loc) • 1.78 kB
JavaScript
import { LINK_VARIANTS, LINK_KIND_MODIFIERS, getLinkKindModifier } from "./link_constants.js";
import normalizeComponent from "../../_virtual/_plugin-vue2_normalizer.js";
const _sfc_main = {
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
}
},
emits: [
/**
* Native click event
*
* @event click
* @type {PointerEvent | KeyboardEvent}
*/
"click",
/**
* Native focus in event
*
* @event focusin
* @type {FocusEvent}
*/
"focusin",
/**
* Native focus out event
*
* @event focusout
* @type {FocusEvent}
*/
"focusout"
],
data() {
return {
LINK_KIND_MODIFIERS
};
},
methods: {
getLinkClasses() {
return [
"d-link",
getLinkKindModifier(this.kind, this.inverted)
];
}
}
};
var _sfc_render = function render() {
var _vm = this, _c = _vm._self._c;
return _c("a", _vm._g({ class: _vm.getLinkClasses(), attrs: { "data-qa": "dt-link", "href": "href" in _vm.$attrs ? _vm.$attrs.href : "javascript:void(0)" } }, _vm.$listeners), [_vm._t("default")], 2);
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns
);
const DtLink = __component__.exports;
export {
DtLink as default
};
//# sourceMappingURL=link.vue.js.map