UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

145 lines (144 loc) 5.78 kB
import DtItemLayout from "../../../components/item_layout/item_layout.vue.js"; import DtAvatar from "../../../components/avatar/avatar.vue.js"; import normalizeComponent from "../../../_virtual/_plugin-vue2_normalizer.js"; const _sfc_main = { name: "DtRecipeContactInfo", components: { DtAvatar, DtItemLayout }, /* inheritAttrs: false is generally an option we want to set on library components. This allows any attributes passed in that are not recognized as props to be passed down to another element or component using v-bind:$attrs more info: https://vuejs.org/v2/api/#inheritAttrs */ // inheritAttrs: false, props: { /** * String to use for the item's role. */ role: { type: String, default: "" }, /** * Display avatar if `showAvatar` property is true. */ showAvatar: { type: Boolean, default: true }, /** * Optional avatar image url. */ avatarSrc: { type: String, default: "" }, /** * Avatar seed, set this to the user's ID to get the same avatar background gradient each time it is displayed. */ avatarSeed: { type: String, default: null }, /** * Avatar's full name, used to extract initials * to display in avatar if `avatarSrc` and `avatarIcon` are empty. */ avatarFullName: { type: String, default: "" }, /** * The size of the avatar * @values xs, sm, md, lg, xl */ avatarSize: { type: String, default: "lg" }, /** * The aria-labelledby of the button containing avatars */ avatarLabelledBy: { type: String, default: "" }, /** * Avatar color to display if `avatarSrc` is empty. */ avatarColor: { type: String, default: null }, /** * Determines whether to show the presence indicator for * Avatar - accepts PRESENCE_STATES values: 'busy', 'away', 'offline', * or 'active'. By default, it's null and nothing is shown. * @values null, busy, away, offline, active */ presence: { type: String, default: null }, /** * Showing multiple avatars in contact info. * The props of array items are: <br> * `src` - avatar image url (optional) <br> * `fullName` - full name, used to extract initials to display in avatar<br> * if `avatarSrc` and `avatarIcon` are empty<br> * `seed` - determines uniqueness of avatar background <br> * `text` - text that overlays the avatar (optional) <br> * `icon` - icon that overlays the avatar (optional) <br> * `halo` - halo highlight around the avatar. boolean true/false */ avatarList: { type: Array, default: null } }, emits: ["avatar-click"], methods: { avatarClick() { this.$emit("avatar-click"); } } }; var _sfc_render = function render() { var _vm = this, _c = _vm._self._c; return _c("dt-item-layout", { staticClass: "d-recipe-contact-info", attrs: { "role": _vm.role, "data-qa": "contact-info", "content-class": "d-recipe-contact-info__content", "right-class": "d-recipe-contact-info__right", "unstyled": "" }, scopedSlots: _vm._u([_vm.showAvatar ? { key: "left", fn: function() { return [_c("button", { staticClass: "d-recipe-contact-info__left", attrs: { "data-qa": "contact-info-left", "aria-labelledby": _vm.avatarLabelledBy }, on: { "click": _vm.avatarClick } }, [_vm.avatarList ? _c("span", { staticClass: "d-recipe-contact-info__avatars" }, _vm._l(_vm.avatarList, function(avatar, index) { return _c("dt-avatar", { key: index, attrs: { "size": _vm.avatarSize, "seed": avatar.seed, "full-name": avatar.fullName, "image-src": avatar.src, "image-alt": "", "overlay-text": avatar.text, "avatar-class": [ { "d-recipe-contact-info__avatar-stacked": index > 0, "d-recipe-contact-info__avatar-halo": !!avatar.halo } ] }, scopedSlots: _vm._u([{ key: "icon", fn: function({ iconSize }) { return [_vm._t("avatarIcon", null, { "iconSize": iconSize })]; } }, avatar.icon ? { key: "overlayIcon", fn: function() { return [_c(avatar.icon, { tag: "component" })]; }, proxy: true } : null], null, true) }); }), 1) : _c("dt-avatar", { attrs: { "size": _vm.avatarSize, "full-name": _vm.avatarFullName, "image-src": _vm.avatarSrc, "image-alt": "", "seed": _vm.avatarSeed, "color": _vm.avatarColor, "presence": _vm.presence }, scopedSlots: _vm._u([{ key: "icon", fn: function({ iconSize }) { return [_vm._t("avatarIcon", null, { "iconSize": iconSize })]; } }], null, true) })], 1)]; }, proxy: true } : null, { key: "default", fn: function() { return [_c("div", { staticClass: "d-recipe-contact-info__header", attrs: { "data-qa": "contact-info-header" } }, [_vm._t("header")], 2)]; }, proxy: true }, { key: "subtitle", fn: function() { return [_c("div", { staticClass: "d-recipe-contact-info__subtitle", attrs: { "data-qa": "contact-info-subtitle" } }, [_vm._t("subtitle")], 2)]; }, proxy: true }, _vm.$slots.bottom ? { key: "bottom", fn: function() { return [_c("div", { staticClass: "d-recipe-contact-info__bottom", attrs: { "data-qa": "contact-info-bottom" } }, [_vm._t("bottom")], 2)]; }, proxy: true } : null, _vm.$slots.right ? { key: "right", fn: function() { return [_c("div", { attrs: { "data-qa": "contact-info-right" } }, [_vm._t("right")], 2)]; }, proxy: true } : null], null, true) }); }; var _sfc_staticRenderFns = []; var __component__ = /* @__PURE__ */ normalizeComponent( _sfc_main, _sfc_render, _sfc_staticRenderFns ); const contact_info = __component__.exports; export { contact_info as default }; //# sourceMappingURL=contact_info.vue.js.map