colibri-ui 0.7.145 → 0.7.147

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.
@@ -1,5 +1,6 @@
1
1
  .avatar {
2
2
  border-radius: 100%;
3
+ cursor: pointer;
3
4
  box-sizing: border-box;
4
5
  transition: border-color 0.15s ease;
5
6
  }
package/Avatar/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var React = require('react');
6
7
  var classNames = require('classnames/bind');
7
8
  var constants = require('./constants.js');
@@ -17,27 +18,31 @@ var classNames__default = /*#__PURE__*/_interopDefault(classNames);
17
18
  var styles__default = /*#__PURE__*/_interopDefault(styles);
18
19
 
19
20
  var clx = classNames__default.default.bind(styles__default.default);
21
+ var getStubImage = function getStubImage(type) {
22
+ return type === index_props.AccountType.Organization ? orgCircle.default : userCircle.default;
23
+ };
20
24
  var Avatar = /*#__PURE__*/React.memo(function (props) {
21
25
  var avatarURL = props.avatarURL,
26
+ style = props.style,
22
27
  _a = props.size,
23
28
  size = _a === void 0 ? constants.AvatarSizes.M : _a,
24
29
  className = props.className,
25
30
  bordered = props.bordered,
26
- _b = props.title,
27
- title = _b === void 0 ? "" : _b,
31
+ _b = props.alt,
32
+ alt = _b === void 0 ? "profile image" : _b,
28
33
  _c = props.accountType,
29
34
  accountType = _c === void 0 ? index_props.AccountType.Organization : _c;
30
- var isOrg = accountType === index_props.AccountType.Organization;
31
- var stubImageURL = isOrg ? orgCircle.default : userCircle.default;
32
- return /*#__PURE__*/React__default.default.createElement("img", {
33
- alt: title,
35
+ var stubImageURL = getStubImage(accountType);
36
+ return /*#__PURE__*/React__default.default.createElement("img", tslib.__assign({
37
+ alt: alt,
34
38
  src: avatarURL || stubImageURL,
35
39
  width: size,
36
40
  height: size,
41
+ style: style,
37
42
  className: clx(styles__default.default.avatar, {
38
43
  avatar_bordered: !!bordered
39
44
  }, [className])
40
- });
45
+ }, props));
41
46
  });
42
47
 
43
48
  exports.default = Avatar;
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from "react";
1
2
  import type { AvatarSizes } from "./constants";
2
3
  export declare enum AccountType {
3
4
  Person = "person",
@@ -5,7 +6,8 @@ export declare enum AccountType {
5
6
  }
6
7
  export type AvatarProps = {
7
8
  accountType?: AccountType;
8
- title?: string;
9
+ style?: CSSProperties;
10
+ alt?: string;
9
11
  size?: AvatarSizes | number;
10
12
  avatarURL?: string;
11
13
  bordered?: boolean;
@@ -27,7 +27,6 @@
27
27
  overflow: hidden;
28
28
  padding: 5px 10px;
29
29
  position: relative;
30
- width: 100%;
31
30
  }
32
31
 
33
32
  .variant_primary {
@@ -1,5 +1,6 @@
1
1
  .avatar {
2
2
  border-radius: 100%;
3
+ cursor: pointer;
3
4
  box-sizing: border-box;
4
5
  transition: border-color 0.15s ease;
5
6
  }
@@ -1,3 +1,4 @@
1
+ import { __assign } from 'tslib';
1
2
  import React__default, { memo } from 'react';
2
3
  import classNames from 'classnames/bind';
3
4
  import { AvatarSizes } from './constants.js';
@@ -7,27 +8,31 @@ import styles from './Avatar.module.css';
7
8
  import { AccountType } from './index.props.js';
8
9
 
9
10
  var clx = classNames.bind(styles);
11
+ var getStubImage = function getStubImage(type) {
12
+ return type === AccountType.Organization ? orgCircleUrl : userCircleUrl;
13
+ };
10
14
  var Avatar = /*#__PURE__*/memo(function (props) {
11
15
  var avatarURL = props.avatarURL,
16
+ style = props.style,
12
17
  _a = props.size,
13
18
  size = _a === void 0 ? AvatarSizes.M : _a,
14
19
  className = props.className,
15
20
  bordered = props.bordered,
16
- _b = props.title,
17
- title = _b === void 0 ? "" : _b,
21
+ _b = props.alt,
22
+ alt = _b === void 0 ? "profile image" : _b,
18
23
  _c = props.accountType,
19
24
  accountType = _c === void 0 ? AccountType.Organization : _c;
20
- var isOrg = accountType === AccountType.Organization;
21
- var stubImageURL = isOrg ? orgCircleUrl : userCircleUrl;
22
- return /*#__PURE__*/React__default.createElement("img", {
23
- alt: title,
25
+ var stubImageURL = getStubImage(accountType);
26
+ return /*#__PURE__*/React__default.createElement("img", __assign({
27
+ alt: alt,
24
28
  src: avatarURL || stubImageURL,
25
29
  width: size,
26
30
  height: size,
31
+ style: style,
27
32
  className: clx(styles.avatar, {
28
33
  avatar_bordered: !!bordered
29
34
  }, [className])
30
- });
35
+ }, props));
31
36
  });
32
37
 
33
38
  export { Avatar as default };
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from "react";
1
2
  import type { AvatarSizes } from "./constants";
2
3
  export declare enum AccountType {
3
4
  Person = "person",
@@ -5,7 +6,8 @@ export declare enum AccountType {
5
6
  }
6
7
  export type AvatarProps = {
7
8
  accountType?: AccountType;
8
- title?: string;
9
+ style?: CSSProperties;
10
+ alt?: string;
9
11
  size?: AvatarSizes | number;
10
12
  avatarURL?: string;
11
13
  bordered?: boolean;
@@ -27,7 +27,6 @@
27
27
  overflow: hidden;
28
28
  padding: 5px 10px;
29
29
  position: relative;
30
- width: 100%;
31
30
  }
32
31
 
33
32
  .variant_primary {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colibri-ui",
3
- "version": "0.7.145",
3
+ "version": "0.7.147",
4
4
  "description": "React UI components library",
5
5
  "main": "index.js",
6
6
  "scripts": {},