@dialpad/dialtone-vue
Version:
Vue component library for Dialpad's design system Dialtone
56 lines (55 loc) • 1.56 kB
JavaScript
import { DtIconInfo, DtIconCheckCircle, DtIconAlertTriangle, DtIconAlertCircle, DtIconBell } from "@dialpad/dialtone-icons/vue2";
import { NOTICE_KINDS } from "./notice_constants.js";
import normalizeComponent from "../../_virtual/_plugin-vue2_normalizer.js";
const kindToIcon = /* @__PURE__ */ new Map([
["info", DtIconInfo],
["success", DtIconCheckCircle],
["warning", DtIconAlertTriangle],
["error", DtIconAlertCircle],
["base", DtIconBell]
]);
const _sfc_main = {
name: "DtNoticeIcon",
components: {
DtIconInfo,
DtIconCheckCircle,
DtIconAlertTriangle,
DtIconAlertCircle,
DtIconBell
},
props: {
/**
* Kind of icon
* @values base, error, info, success, warning
*/
kind: {
type: String,
default: "base",
validate(kind) {
return NOTICE_KINDS.includes(kind);
}
}
},
computed: {
defaultIcon() {
return kindToIcon.get(this.kind);
}
}
};
var _sfc_render = function render() {
var _vm = this, _c = _vm._self._c;
return _vm.defaultIcon || _vm.$slots.default ? _c("div", { staticClass: "d-notice__icon", attrs: { "aria-hidden": "true" } }, [_vm._t("default", function() {
return [_c(_vm.defaultIcon, { tag: "component", attrs: { "size": "400" } })];
})], 2) : _vm._e();
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns
);
const DtNoticeIcon = __component__.exports;
export {
DtNoticeIcon as default
};
//# sourceMappingURL=notice_icon.vue.js.map