@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
124 lines (123 loc) • 2.63 kB
JavaScript
import { t as e } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
import { NOTICE_KINDS as t, NOTICE_ROLES as n } from "./notice-constants.js";
import r from "./notice-icon.js";
import i from "./notice-content.js";
import a from "./notice-action.js";
import { createBlock as o, createCommentVNode as s, createElementBlock as c, createVNode as l, normalizeClass as u, openBlock as d, renderSlot as f, resolveComponent as p, withCtx as m } from "vue";
//#region components/notice/notice.vue
var h = {
compatConfig: { MODE: 3 },
name: "DtNotice",
components: {
DtNoticeIcon: r,
DtNoticeContent: i,
DtNoticeAction: a
},
props: {
titleId: {
type: String,
default: void 0
},
contentId: {
type: String,
default: void 0
},
title: {
type: String,
default: ""
},
role: {
type: String,
default: "status",
validate(e) {
return n.includes(e);
}
},
important: {
type: Boolean,
default: !1
},
kind: {
type: String,
default: "base",
validate(e) {
return t.includes(e);
}
},
hideClose: {
type: Boolean,
default: !1
},
hideIcon: {
type: Boolean,
default: !1
},
hideAction: {
type: Boolean,
default: !1
},
truncateText: {
type: Boolean,
default: !1
}
},
emits: ["close", "click"],
computed: { noticeClass() {
return [
"d-notice",
{
error: "d-notice--error",
info: "d-notice--info",
success: "d-notice--success",
warning: "d-notice--warning",
base: "d-notice--base"
}[this.kind],
{
"d-notice--important": this.important,
"d-notice--truncate": this.truncateText
}
];
} }
};
function g(e, t, n, r, i, a) {
let h = p("dt-notice-icon"), g = p("dt-notice-content"), _ = p("dt-notice-action");
return d(), c("aside", {
class: u(a.noticeClass),
"data-qa": "notice"
}, [
n.hideIcon ? s("", !0) : (d(), o(h, {
key: 0,
kind: n.kind
}, {
default: m(() => [f(e.$slots, "icon")]),
_: 3
}, 8, ["kind"])),
l(g, {
"title-id": n.titleId,
"content-id": n.contentId,
title: n.title,
role: n.role
}, {
titleOverride: m(() => [f(e.$slots, "titleOverride")]),
default: m(() => [f(e.$slots, "default")]),
_: 3
}, 8, [
"title-id",
"content-id",
"title",
"role"
]),
l(_, {
"hide-action": n.hideAction,
"hide-close": n.hideClose,
onClose: t[0] || (t[0] = (t) => e.$emit("close"))
}, {
default: m(() => [f(e.$slots, "action")]),
_: 3
}, 8, ["hide-action", "hide-close"])
], 2);
}
var _ = /* @__PURE__ */ e(h, [["render", g]]);
//#endregion
export { _ as default };
//# sourceMappingURL=notice.js.map