UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

57 lines (56 loc) 1.92 kB
import { t as e } from "../../_plugin-vue_export-helper-BTgDAbhb.js"; import { DialtoneLocalization as t } from "../../localization/index.js"; import { UNREAD_PILL_DIRECTIONS as n, UNREAD_PILL_KINDS as r } from "./unread-pill-constants.js"; import { createBlock as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, mergeProps as c, openBlock as l, renderSlot as u, resolveComponent as d, toDisplayString as f, toHandlers as p } from "vue"; import { DtIconArrowDown as m, DtIconArrowUp as h } from "@dialpad/dialtone-icons/vue3"; //#region recipes/leftbar/unread_pill/unread_pill.vue var g = { compatConfig: { MODE: 3 }, name: "DtRecipeUnreadPill", components: { DtIconArrowUp: h, DtIconArrowDown: m }, props: { kind: { type: String, required: !0, validator: (e) => r.includes(e) }, direction: { type: String, required: !0, validator: (e) => n.includes(e) } }, emits: ["click"], data() { return { i18n: new t() }; }, computed: { text() { return this.kind === "mentions" ? this.i18n.$t("DIALTONE_UNREAD_PILL_MENTIONS_TEXT") : this.i18n.$t("DIALTONE_UNREAD_PILL_MESSAGES_TEXT"); }, unreadChipListeners() { return { click: (e) => this.$emit("click", e) }; } } }, _ = { "data-qa": "dt-recipe-leftbar-unread-pill__label" }; function v(e, t, n, r, m, h) { let g = d("dt-icon-arrow-up"), v = d("dt-icon-arrow-down"); return l(), a("button", c({ class: ["d-recipe-leftbar-unread-pill", `d-recipe-leftbar-unread-pill-${n.kind}`], type: "button", "data-qa": "dt-recipe-leftbar-unread-pill" }, p(h.unreadChipListeners, !0)), [n.direction === "up" ? (l(), i(g, { key: 0, size: "300" })) : (l(), i(v, { key: 1, size: "300" })), o("span", _, [u(e.$slots, "default", {}, () => [s(f(h.text), 1)])])], 16); } var y = /* @__PURE__ */ e(g, [["render", v]]); //#endregion export { y as default }; //# sourceMappingURL=unread-pill.js.map