@synerise/ds-avatar 0.14.78 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/Avatar.types.d.ts +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.15.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-avatar@0.14.78...@synerise/ds-avatar@0.15.0) (2023-08-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **avatar:** background color accepts colorName-hue ([f3a8ce4](https://github.com/synerise/synerise-design/commit/f3a8ce48cae9ea7cc19ef4ca7913259c080b2b87))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.14.78](https://github.com/synerise/synerise-design/compare/@synerise/ds-avatar@0.14.77...@synerise/ds-avatar@0.14.78) (2023-08-25)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-avatar
|
package/dist/Avatar.types.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface AvatarProps extends Omit<AntAvatarProps, 'size' | 'icon'> {
|
|
|
29
29
|
/**
|
|
30
30
|
* Background color of the avatar
|
|
31
31
|
*/
|
|
32
|
-
backgroundColor?: Color;
|
|
32
|
+
backgroundColor?: Color | string;
|
|
33
33
|
/**
|
|
34
34
|
* Hue of the avatar background color
|
|
35
35
|
*/
|
|
@@ -44,7 +44,7 @@ export interface AvatarProps extends Omit<AntAvatarProps, 'size' | 'icon'> {
|
|
|
44
44
|
tooltip?: TooltipObject | boolean;
|
|
45
45
|
}
|
|
46
46
|
declare type DefinedAvatarProps = Pick<AvatarProps, 'style' | 'disabled' | 'iconComponent' | 'size' | 'src'> & {
|
|
47
|
-
backgroundColor?: 'auto' | Color;
|
|
47
|
+
backgroundColor?: 'auto' | Color | string;
|
|
48
48
|
badgeStatus?: string;
|
|
49
49
|
text?: string;
|
|
50
50
|
tooltip?: TooltipObject | boolean;
|
package/dist/utils.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export declare function getUserText(user: UserAvatar, src?: string | null, text?
|
|
|
4
4
|
export declare function isIconComponent(component: React.ReactNode | undefined): boolean;
|
|
5
5
|
export declare function getObjectName(name?: string | null, text?: string): string | null;
|
|
6
6
|
export declare function addIconColor(iconComponent: React.ReactNode, color: string): React.ReactElement;
|
|
7
|
-
export declare function getColorByText(text: string | null, backgroundColor?: 'auto' | Color): [Color, ColorHue];
|
|
7
|
+
export declare function getColorByText(text: string | null, backgroundColor?: 'auto' | Color | string): [Color, ColorHue];
|
|
8
8
|
export declare function getTooltipProps(tooltip: AvatarProps['tooltip']): TooltipObject;
|
package/dist/utils.js
CHANGED
|
@@ -67,6 +67,7 @@ export function addIconColor(iconComponent, color) {
|
|
|
67
67
|
export function getColorByText(text, backgroundColor) {
|
|
68
68
|
var _ref;
|
|
69
69
|
|
|
70
|
+
if (backgroundColor && backgroundColor.indexOf('-') !== -1) return backgroundColor.split('-');
|
|
70
71
|
var autoColor = ((_ref = typeof text === 'string' ? selectColorByLetter(text.slice(0, 1), true) : {}) == null ? void 0 : _ref.color) || 'grey';
|
|
71
72
|
var color = text && backgroundColor && backgroundColor !== 'auto' ? backgroundColor : autoColor;
|
|
72
73
|
var hue = text ? '500' : '100';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-avatar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Avatar UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-badge": "^0.6.
|
|
35
|
+
"@synerise/ds-badge": "^0.6.34",
|
|
36
36
|
"@synerise/ds-icon": "^0.58.0",
|
|
37
|
-
"@synerise/ds-status": "^0.5.
|
|
37
|
+
"@synerise/ds-status": "^0.5.79",
|
|
38
38
|
"@synerise/ds-tooltip": "^0.14.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@synerise/ds-utils": "^0.19.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "291e114ff38d1a8e9d5ad8d9e499add6c6f25ee5"
|
|
49
49
|
}
|