0.1.5 • Published 4 years ago
@bbielawa/translations v0.1.5
VCC Translations for Configuration Manager
Installation
$ yarn add @8x8/oxygen-avatar
$ npm install @8x8/oxygen-avatar
Usage
import Avatar from '@8x8/oxygen-avatar';
<Avatar name="Example Name" />
Props
Name | Type | Default | Description |
---|---|---|---|
children | node | null | Custom content to be rendered inside of the Avatar. Can be an Oxygen Icon, text, anything really |
theme | object | Avatar theme object, default value provided by the internal Oxygen theme provider via @8x8/oxygen-config and @8x8/oxygen-constants | |
size | oneOf('3xsmall', '2xsmall', 'xsmall', 'small', 'medium', 'large', 'xlarge', '2xlarge', '3xlarge') | 'medium' | Specifies the size of the avatar |
userStatus | element OR oneOf('available', 'away', 'busy', 'doNotDisturb', 'onBreak', 'onCall', 'offline', 'workingOffline') | null | Specifies the user status or a render-able element. User status is available only for sizes between xs and 2xl |
isGroup | bool | false | Specifies if the group placeholder should be used |
name | string | '' | Specifies the name after which the initials are computed |
onClick | func | noop | Callback for the avatar on-click event |
onEdit | func | noop | Callback for the edit overlay on-click event |
src | string | '' | Specifies the image source |
showEditOverlay | bool | false | Specifies if the edit overlay should be displayed. The edit overlay is available only for sizes between l and 3xl |
testId | string | 'AVATAR' | Test ID DOM attribute value |
Theme
const avatar = {
size3xsmall: '16px',
size2xsmall: '24px',
sizeXsmall: '32px',
sizeSmall: '40px',
sizeMedium: '48px',
sizeLarge: '64px',
sizeXlarge: '72px',
size2xlarge: '80px',
size3xlarge: '160px',
font3xsmall: '7px',
font2xsmall: '10px',
fontXsmall: '12px',
fontSmall: '13px',
fontMedium: '15px',
fontLarge: '15px',
fontXlarge: '19px',
font2xlarge: '19px',
font3xlarge: '36px',
icon3xsmall: 10,
icon2xsmall: 14,
iconXsmall: 19,
iconSmall: 24,
iconMedium: 28,
iconLarge: 38,
iconXlarge: 44,
icon2xlarge: 44,
icon3xlarge: 76,
initialsColor: '#1C2025',
initialsFontFamily: "'Nunito','Helvetica Neue',Helvetica,Arial,sans-serif",
placeholderIconColor: '#5E6D7A',
editOverlayColor: '#5E6D7A',
avatarBackgroundColor: '#A4B8D1',
accentColor: '#5E6D7A',
editIconColor: '#FFF',
editIconSmallSize: '16px',
editIconLargeSize: '24px',
};