@synerise/ds-avatar 0.16.5 → 0.17.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 +19 -0
- package/dist/Avatar.styles.d.ts +1 -1
- package/dist/Avatar.styles.js +26 -3
- package/dist/index.d.ts +1 -1
- package/package.json +8 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.17.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-avatar@0.16.6...@synerise/ds-avatar@0.17.0) (2024-07-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **badge:** added IconBadge ([4f44b60](https://github.com/synerise/synerise-design/commit/4f44b60b3eff77eb6c21b9ba0ec0cdf745100eff))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.16.6](https://github.com/synerise/synerise-design/compare/@synerise/ds-avatar@0.16.5...@synerise/ds-avatar@0.16.6) (2024-07-02)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-avatar
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.16.5](https://github.com/synerise/synerise-design/compare/@synerise/ds-avatar@0.16.4...@synerise/ds-avatar@0.16.5) (2024-06-27)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-avatar
|
package/dist/Avatar.styles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare const TooltipGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
declare const _default: import("styled-components").StyledComponent<({ backgroundColorHue, backgroundColor, onClick, hasStatus, hasTooltip, ...rest }: any) => React.JSX.Element, any, {}, never>;
|
|
4
4
|
export default _default;
|
package/dist/Avatar.styles.js
CHANGED
|
@@ -4,10 +4,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import React from 'react';
|
|
8
8
|
import styled, { css } from 'styled-components';
|
|
9
9
|
import Avatar from 'antd/lib/avatar';
|
|
10
10
|
import { macro } from '@synerise/ds-typography';
|
|
11
|
+
import { IconBadgeIcon } from '@synerise/ds-badge/dist/IconBadge/IconBadge.styles';
|
|
11
12
|
export var TooltipGroup = styled.div.withConfig({
|
|
12
13
|
displayName: "Avatarstyles__TooltipGroup",
|
|
13
14
|
componentId: "xcn5o4-0"
|
|
@@ -31,6 +32,16 @@ var BADGE_POSITION = {
|
|
|
31
32
|
squarelarge: '3px',
|
|
32
33
|
squareextraLarge: '3px'
|
|
33
34
|
};
|
|
35
|
+
var ICON_BADGE_POSITION = {
|
|
36
|
+
circlesmall: '-10px',
|
|
37
|
+
circlemedium: '-8px',
|
|
38
|
+
circlelarge: '-2px',
|
|
39
|
+
circleextraLarge: '4px',
|
|
40
|
+
squaresmall: '-11px',
|
|
41
|
+
squaremedium: '-11px',
|
|
42
|
+
squarelarge: '-11px',
|
|
43
|
+
squareextraLarge: '-11px'
|
|
44
|
+
};
|
|
34
45
|
var FONT_SIZE = {
|
|
35
46
|
small: 'xsAvatar',
|
|
36
47
|
medium: 'small',
|
|
@@ -38,8 +49,20 @@ var FONT_SIZE = {
|
|
|
38
49
|
extraLarge: 'xlAvatar'
|
|
39
50
|
};
|
|
40
51
|
|
|
52
|
+
var applyIconBadgePosition = function applyIconBadgePosition(props) {
|
|
53
|
+
var _props$shape = props.shape,
|
|
54
|
+
shape = _props$shape === void 0 ? 'circle' : _props$shape,
|
|
55
|
+
_props$size = props.size,
|
|
56
|
+
size = _props$size === void 0 ? 'medium' : _props$size;
|
|
57
|
+
return css(["top:", ";right:", ";"], ICON_BADGE_POSITION["" + shape + size] || '0', ICON_BADGE_POSITION["" + shape + size] || '0');
|
|
58
|
+
};
|
|
59
|
+
|
|
41
60
|
var applyBadgePosition = function applyBadgePosition(props) {
|
|
42
|
-
|
|
61
|
+
var _props$shape2 = props.shape,
|
|
62
|
+
shape = _props$shape2 === void 0 ? 'circle' : _props$shape2,
|
|
63
|
+
_props$size2 = props.size,
|
|
64
|
+
size = _props$size2 === void 0 ? 'medium' : _props$size2;
|
|
65
|
+
return css(["top:", ";right:", ";"], BADGE_POSITION["" + shape + size] || '0', BADGE_POSITION["" + shape + size] || '0');
|
|
43
66
|
};
|
|
44
67
|
|
|
45
68
|
var applyFontSize = function applyFontSize(props) {
|
|
@@ -74,7 +97,7 @@ export default styled(function (_ref) {
|
|
|
74
97
|
}, function (props) {
|
|
75
98
|
return props.onClick ? css(["cursor:pointer;&:active{&::before{opacity:0.1;}}"]) : false;
|
|
76
99
|
}, function (props) {
|
|
77
|
-
return props.hasStatus && css(["& + .ant-badge-dot{display:flex;border:2px solid ", ";box-sizing:border-box;width:10px;height:10px;box-shadow:none;", ";}"], props.theme.palette.white, applyBadgePosition(props));
|
|
100
|
+
return props.hasStatus && css(["& + .ant-badge-dot{display:flex;border:2px solid ", ";box-sizing:border-box;width:10px;height:10px;box-shadow:none;", ";}& + ", "{", ";}"], props.theme.palette.white, applyBadgePosition(props), IconBadgeIcon, applyIconBadgePosition(props));
|
|
78
101
|
}, function (props) {
|
|
79
102
|
return props.size === 'medium' && css(["width:40px;min-width:40px;height:40px;.ant-avatar-string{line-height:40px;}", ";"], props.icon && css(["&.ant-avatar-icon{", ";", "}"], macro.xlAvatarIcon, macro.flexCentered));
|
|
80
103
|
}, function (props) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default } from './Avatar';
|
|
2
2
|
export { default as ObjectAvatar } from './ObjectAvatar';
|
|
3
3
|
export { default as UserAvatar } from './UserAvatar';
|
|
4
|
-
export type { AvatarProps, UserAvatar as UserAvatarType, UserAvatarProps, ObjectAvatar as ObjectAvatarType, ObjectAvatarProps, TooltipObject, } from './Avatar.types';
|
|
4
|
+
export type { AvatarProps, UserAvatar as UserAvatarType, UserAvatarProps, ObjectAvatar as ObjectAvatarType, ObjectAvatarProps, TooltipObject, Size as AvatarSize, } from './Avatar.types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-avatar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Avatar UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -33,21 +33,17 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-badge": "^0.
|
|
37
|
-
"@synerise/ds-icon": "^0.
|
|
38
|
-
"@synerise/ds-status": "^0.6.
|
|
39
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
40
|
-
"@synerise/ds-typography": "^0.15.
|
|
36
|
+
"@synerise/ds-badge": "^0.8.0",
|
|
37
|
+
"@synerise/ds-icon": "^0.64.0",
|
|
38
|
+
"@synerise/ds-status": "^0.6.12",
|
|
39
|
+
"@synerise/ds-tooltip": "^0.14.32",
|
|
40
|
+
"@synerise/ds-typography": "^0.15.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@synerise/ds-core": "*",
|
|
44
44
|
"antd": "4.7.0",
|
|
45
|
-
"react": ">=16.9.0
|
|
45
|
+
"react": ">=16.9.0 <= 17.0.2",
|
|
46
46
|
"styled-components": "5.0.1"
|
|
47
47
|
},
|
|
48
|
-
"
|
|
49
|
-
"@synerise/ds-utils": "^0.27.0",
|
|
50
|
-
"@testing-library/jest-dom": "5.1.1"
|
|
51
|
-
},
|
|
52
|
-
"gitHead": "587eb113074985ae21e4f0c25ec33c3e3e2e072b"
|
|
48
|
+
"gitHead": "6e5e5202d6c6f1c2caf6bfef799009813b437b3d"
|
|
53
49
|
}
|