UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

64 lines (63 loc) 2.06 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const vue3 = require("@dialpad/dialtone-icons/vue3"); const notice_constants = require("./notice_constants.cjs"); const common_utils = require("../../common/utils.cjs"); const vue = require("vue"); const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.cjs"); const kindToIcon = /* @__PURE__ */ new Map([ ["info", vue3.DtIconInfo], ["success", vue3.DtIconCheckCircle], ["warning", vue3.DtIconAlertTriangle], ["error", vue3.DtIconAlertCircle], ["base", vue3.DtIconBell] ]); const _sfc_main = { compatConfig: { MODE: 3 }, name: "DtNoticeIcon", components: { DtIconInfo: vue3.DtIconInfo, DtIconCheckCircle: vue3.DtIconCheckCircle, DtIconAlertTriangle: vue3.DtIconAlertTriangle, DtIconAlertCircle: vue3.DtIconAlertCircle, DtIconBell: vue3.DtIconBell }, props: { /** * Kind of icon * @values base, error, info, success, warning */ kind: { type: String, default: "base", validate(kind) { return notice_constants.NOTICE_KINDS.includes(kind); } } }, data() { return { hasSlotContent: common_utils.hasSlotContent }; }, computed: { defaultIcon() { return kindToIcon.get(this.kind); } } }; const _hoisted_1 = { key: 0, "aria-hidden": "true", class: "d-notice__icon" }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return $options.defaultIcon || $data.hasSlotContent(_ctx.$slots.default) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.renderSlot(_ctx.$slots, "default", {}, () => [ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($options.defaultIcon), { size: "400" })) ]) ])) : vue.createCommentVNode("", true); } const DtNoticeIcon = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]); exports.default = DtNoticeIcon; //# sourceMappingURL=notice_icon.vue.cjs.map