superdesk-ui-framework 3.1.14 → 3.1.15
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/app/img/AvatarDefaultImage.svg +6 -0
- package/app/styles/_avatar.scss +28 -6
- package/app/styles/design-tokens/_new-colors.scss +32 -17
- package/app-typescript/components/Button.tsx +1 -1
- package/app-typescript/components/DatePicker.tsx +6 -0
- package/app-typescript/components/avatar/avatar-group.tsx +2 -1
- package/app-typescript/components/avatar/avatar-image.tsx +1 -1
- package/app-typescript/components/avatar/avatar-placeholder.tsx +0 -1
- package/app-typescript/components/avatar/avatar-wrapper.tsx +14 -2
- package/app-typescript/components/avatar/avatar.tsx +8 -1
- package/dist/components/Avatar.tsx +97 -40
- package/dist/components/Buttons.tsx +5 -3
- package/dist/components/Index.tsx +151 -127
- package/dist/examples.bundle.js +189 -156
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +30 -10
- package/dist/superdesk-ui.bundle.css +55 -20
- package/dist/superdesk-ui.bundle.js +15 -9
- package/examples/pages/components/Avatar.tsx +97 -40
- package/examples/pages/components/Buttons.tsx +5 -3
- package/examples/pages/components/Index.tsx +151 -127
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +30 -10
- package/package.json +1 -1
- package/react/components/Button.js +1 -1
- package/react/components/DatePicker.js +4 -0
- package/react/components/avatar/avatar-group.js +2 -2
- package/react/components/avatar/avatar-image.js +1 -1
- package/react/components/avatar/avatar-placeholder.js +1 -1
- package/react/components/avatar/avatar-wrapper.d.ts +4 -1
- package/react/components/avatar/avatar-wrapper.js +4 -2
- package/react/components/avatar/avatar.d.ts +4 -0
- package/react/components/avatar/avatar.js +2 -2
@@ -56,6 +56,7 @@ var AvatarWrapper = /** @class */ (function (_super) {
|
|
56
56
|
AvatarWrapper.prototype.render = function () {
|
57
57
|
var _a, _b, _c;
|
58
58
|
var icon = this.props.icon;
|
59
|
+
var statusDot = this.props.statusDot;
|
59
60
|
return (React.createElement("span", { className: (0, classnames_1.default)('sd-avatar', {
|
60
61
|
'sd-avatar--x-small': this.props.size === 'x-small',
|
61
62
|
'sd-avatar--small': this.props.size === 'small',
|
@@ -65,14 +66,15 @@ var AvatarWrapper = /** @class */ (function (_super) {
|
|
65
66
|
'sd-avatar--xx-large': this.props.size === 'xx-large',
|
66
67
|
'sd-avatar--indicator-status--online': ((_a = this.props.statusIndicator) === null || _a === void 0 ? void 0 : _a.status) === 'online',
|
67
68
|
'sd-avatar--indicator-status--offline': ((_b = this.props.statusIndicator) === null || _b === void 0 ? void 0 : _b.status) === 'offline',
|
68
|
-
'sd-avatar--empty-light': this.props.
|
69
|
+
'sd-avatar--empty-light': this.props.noAvatarPlaceholderColor === 'subtle',
|
69
70
|
}), "data-test-id": this.props['data-test-id'], title: this.props.statusIndicator != null ? this.props.statusIndicator.tooltipText : "" },
|
70
71
|
this.props.children,
|
71
72
|
((_c = this.props.administratorIndicator) === null || _c === void 0 ? void 0 : _c.enabled) === true
|
72
73
|
? (React.createElement("i", { className: "icon-settings sd-avatar--indicator-admin", title: this.props.administratorIndicator.tooltipText }))
|
73
74
|
: null,
|
74
75
|
icon != null && (React.createElement("span", { className: "sd-avatar__icon" },
|
75
|
-
React.createElement(Icon_1.Icon, { name: icon.name, color: icon.color })))
|
76
|
+
React.createElement(Icon_1.Icon, { name: icon.name, color: icon.color }))),
|
77
|
+
statusDot != null && (React.createElement("span", { style: { backgroundColor: statusDot.color }, className: "sd-avatar__coverage-state" }))));
|
76
78
|
};
|
77
79
|
return AvatarWrapper;
|
78
80
|
}(React.PureComponent));
|
@@ -11,6 +11,10 @@ export interface IPropsAvatar {
|
|
11
11
|
name: string;
|
12
12
|
color?: string;
|
13
13
|
};
|
14
|
+
statusDot?: {
|
15
|
+
color?: string;
|
16
|
+
};
|
17
|
+
noAvatarPlaceholderColor?: 'subtle' | 'strong';
|
14
18
|
/**
|
15
19
|
* displayName is shown as tooltip by default
|
16
20
|
* use this if you need to add additional information (it will be added on a new line)
|
@@ -49,10 +49,10 @@ var Avatar = /** @class */ (function (_super) {
|
|
49
49
|
return _super !== null && _super.apply(this, arguments) || this;
|
50
50
|
}
|
51
51
|
Avatar.prototype.render = function () {
|
52
|
-
var _a = this.props, imageUrl = _a.imageUrl, initials = _a.initials, size = _a.size, statusIndicator = _a.statusIndicator, administratorIndicator = _a.administratorIndicator, icon = _a.icon, displayName = _a.displayName, customContent = _a.customContent;
|
52
|
+
var _a = this.props, imageUrl = _a.imageUrl, initials = _a.initials, size = _a.size, statusIndicator = _a.statusIndicator, administratorIndicator = _a.administratorIndicator, icon = _a.icon, noAvatarPlaceholderColor = _a.noAvatarPlaceholderColor, displayName = _a.displayName, customContent = _a.customContent, statusDot = _a.statusDot;
|
53
53
|
var tooltipCombined = [displayName, this.props.tooltip]
|
54
54
|
.filter(function (str) { return (str !== null && str !== void 0 ? str : '').trim().length > 0; }).join('\n');
|
55
|
-
return (React.createElement(avatar_wrapper_1.AvatarWrapper, { size: size, statusIndicator: statusIndicator ? { status: statusIndicator, tooltipText: '' } : undefined, administratorIndicator: administratorIndicator ? { enabled: true, tooltipText: '' } : undefined, icon: icon,
|
55
|
+
return (React.createElement(avatar_wrapper_1.AvatarWrapper, { size: size, statusIndicator: statusIndicator ? { status: statusIndicator, tooltipText: '' } : undefined, administratorIndicator: administratorIndicator ? { enabled: true, tooltipText: '' } : undefined, icon: icon, statusDot: statusDot, noAvatarPlaceholderColor: noAvatarPlaceholderColor }, (function () {
|
56
56
|
if (customContent != null) {
|
57
57
|
return customContent;
|
58
58
|
}
|