UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

1 lines 2.5 kB
{"version":3,"file":"unread-pill.cjs","sources":["../../../recipes/leftbar/unread_pill/unread_pill.vue"],"sourcesContent":["<template>\n <button\n :class=\"['d-recipe-leftbar-unread-pill', `d-recipe-leftbar-unread-pill-${kind}`]\"\n type=\"button\"\n data-qa=\"dt-recipe-leftbar-unread-pill\"\n v-on=\"$listeners\"\n >\n <dt-icon-arrow-up\n v-if=\"direction === 'up'\"\n size=\"300\"\n />\n <dt-icon-arrow-down\n v-else\n size=\"300\"\n />\n <span data-qa=\"dt-recipe-leftbar-unread-pill__label\">\n <slot>\n {{ text }}\n </slot>\n </span>\n </button>\n</template>\n\n<script>\nimport { DtIconArrowUp, DtIconArrowDown } from '@dialpad/dialtone-icons/vue2';\nimport { UNREAD_PILL_DIRECTIONS, UNREAD_PILL_KINDS } from './unread_pill_constants';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtRecipeUnreadPill',\n\n components: {\n DtIconArrowUp,\n DtIconArrowDown,\n },\n\n props: {\n /**\n * The kind of unread pill which determines the styling\n * @values 'mentions', 'messages'\n **/\n kind: {\n type: String,\n required: true,\n validator: (kind) => UNREAD_PILL_KINDS.includes(kind),\n },\n\n /**\n * The direction of the arrow icon\n * @values 'up', 'down'\n **/\n direction: {\n type: String,\n required: true,\n validator: (dir) => UNREAD_PILL_DIRECTIONS.includes(dir),\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n text () {\n return this.kind === 'mentions'\n ? this.i18n.$t('DIALTONE_UNREAD_PILL_MENTIONS_TEXT')\n : this.i18n.$t('DIALTONE_UNREAD_PILL_MESSAGES_TEXT');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconArrowUp","DtIconArrowDown","kind","UNREAD_PILL_KINDS","dir","UNREAD_PILL_DIRECTIONS","DialtoneLocalization"],"mappings":"uSA4BAA,EAAA,CACA,KAAA,qBAEA,WAAA,CACA,cAAAC,EAAAA,cACA,gBAAAC,EAAAA,eACA,EAEA,MAAA,CAKA,KAAA,CACA,KAAA,OACA,SAAA,GACA,UAAAC,GAAAC,oBAAA,SAAAD,CAAA,CACA,EAMA,UAAA,CACA,KAAA,OACA,SAAA,GACA,UAAAE,GAAAC,yBAAA,SAAAD,CAAA,CACA,CACA,EAEA,MAAA,CAOA,OACA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,IAAAE,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,MAAA,CACA,OAAA,KAAA,OAAA,WACA,KAAA,KAAA,GAAA,oCAAA,EACA,KAAA,KAAA,GAAA,oCAAA,CACA,CACA,CACA"}