diff --git a/apps/dialtone-documentation/docs/components/avatar.md b/apps/dialtone-documentation/docs/components/avatar.md
index cb011ef279..0cde67071e 100644
--- a/apps/dialtone-documentation/docs/components/avatar.md
+++ b/apps/dialtone-documentation/docs/components/avatar.md
@@ -9,18 +9,22 @@ figma_url: https://www.figma.com/file/2adf7JhZOncRyjYiy2joil/DT-Core%3A-Componen
---
import { getUniqueString, getRandomElement } from '@/common/utils';
import { DtPresence } from '../presence';
-import { DtIcon } from '@/components/icon';
import {
AVATAR_KIND_MODIFIERS,
AVATAR_SIZE_MODIFIERS,
@@ -84,19 +88,16 @@ import {
AVATAR_GROUP_VALIDATOR,
AVATAR_ICON_SIZES,
} from './avatar_constants';
-import { getIconNames } from '@/common/storybook_utils.js';
import { ICON_SIZE_MODIFIERS } from '@/components/icon/icon_constants.js';
import { extractInitialsFromName } from './utils';
-const ICONS_LIST = getIconNames();
-
/**
* An avatar is a visual representation of a user or object.
* @see https://dialtone.dialpad.com/components/avatar.html
*/
export default {
name: 'DtAvatar',
- components: { DtPresence, DtIcon },
+ components: { DtPresence },
inheritAttrs: false,
@@ -194,14 +195,6 @@ export default {
validator: (group) => AVATAR_GROUP_VALIDATOR(group),
},
- /**
- * The icon that overlays the avatar
- */
- overlayIcon: {
- type: String,
- default: '',
- },
-
/**
* The text that overlays the avatar
*/
@@ -236,15 +229,6 @@ export default {
default: undefined,
},
- /**
- * Icon name to be displayed on the avatar
- */
- iconName: {
- type: String,
- default: undefined,
- validator: (name) => ICONS_LIST.includes(name),
- },
-
/**
* Icon size to be displayed on the avatar
* @values 100, 200, 300, 400, 500, 600, 700, 800
@@ -305,8 +289,16 @@ export default {
},
computed: {
- isNotIconType () {
- return !this.iconName;
+ isIconType () {
+ return this.$scopedSlots.icon && this.$scopedSlots.icon();
+ },
+
+ hasOverlayIcon () {
+ return !!this.$slots.overlayIcon;
+ },
+
+ iconDataQa () {
+ return 'dt-avatar-icon';
},
avatarClasses () {
@@ -316,7 +308,7 @@ export default {
this.avatarClass,
{
'd-avatar--group': this.showGroup,
- [`d-avatar--color-${this.getColor()}`]: this.isNotIconType,
+ [`d-avatar--color-${this.getColor()}`]: !this.isIconType,
'd-avatar--clickable': this.clickable,
},
];
@@ -326,6 +318,7 @@ export default {
return [
'd-avatar__overlay',
this.overlayClass,
+ { 'd-avatar__overlay-icon': this.hasOverlayIcon },
];
},
diff --git a/packages/dialtone-vue2/components/avatar/avatar_variants.story.vue b/packages/dialtone-vue2/components/avatar/avatar_variants.story.vue
index b2ac1db739..cc07088d20 100644
--- a/packages/dialtone-vue2/components/avatar/avatar_variants.story.vue
+++ b/packages/dialtone-vue2/components/avatar/avatar_variants.story.vue
@@ -35,8 +35,11 @@
:seed="$attrs.seed"
:size="size"
full-name="Avatar Icon"
- icon-name="user"
- />
+ >
+
+
+ Group call with icon +
++ Group call with icon +
+