colibri-ui 0.7.145 → 0.7.146

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
@@ -17,8 +17,12 @@ var classNames__default = /*#__PURE__*/_interopDefault(classNames);
17
17
  var styles__default = /*#__PURE__*/_interopDefault(styles);
18
18
 
19
19
  var clx = classNames__default.default.bind(styles__default.default);
20
+ var getStubImage = function getStubImage(type) {
21
+ return type === index_props.AccountType.Organization ? orgCircle.default : userCircle.default;
22
+ };
20
23
  var Avatar = /*#__PURE__*/React.memo(function (props) {
21
24
  var avatarURL = props.avatarURL,
25
+ style = props.style,
22
26
  _a = props.size,
23
27
  size = _a === void 0 ? constants.AvatarSizes.M : _a,
24
28
  className = props.className,
@@ -27,13 +31,13 @@ var Avatar = /*#__PURE__*/React.memo(function (props) {
27
31
  title = _b === void 0 ? "" : _b,
28
32
  _c = props.accountType,
29
33
  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;
34
+ var stubImageURL = getStubImage(accountType);
32
35
  return /*#__PURE__*/React__default.default.createElement("img", {
33
36
  alt: title,
34
37
  src: avatarURL || stubImageURL,
35
38
  width: size,
36
39
  height: size,
40
+ style: style,
37
41
  className: clx(styles__default.default.avatar, {
38
42
  avatar_bordered: !!bordered
39
43
  }, [className])
@@ -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,6 +6,7 @@ export declare enum AccountType {
5
6
  }
6
7
  export type AvatarProps = {
7
8
  accountType?: AccountType;
9
+ style?: CSSProperties;
8
10
  title?: string;
9
11
  size?: AvatarSizes | number;
10
12
  avatarURL?: string;
@@ -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
  }
@@ -7,8 +7,12 @@ import styles from './Avatar.module.css';
7
7
  import { AccountType } from './index.props.js';
8
8
 
9
9
  var clx = classNames.bind(styles);
10
+ var getStubImage = function getStubImage(type) {
11
+ return type === AccountType.Organization ? orgCircleUrl : userCircleUrl;
12
+ };
10
13
  var Avatar = /*#__PURE__*/memo(function (props) {
11
14
  var avatarURL = props.avatarURL,
15
+ style = props.style,
12
16
  _a = props.size,
13
17
  size = _a === void 0 ? AvatarSizes.M : _a,
14
18
  className = props.className,
@@ -17,13 +21,13 @@ var Avatar = /*#__PURE__*/memo(function (props) {
17
21
  title = _b === void 0 ? "" : _b,
18
22
  _c = props.accountType,
19
23
  accountType = _c === void 0 ? AccountType.Organization : _c;
20
- var isOrg = accountType === AccountType.Organization;
21
- var stubImageURL = isOrg ? orgCircleUrl : userCircleUrl;
24
+ var stubImageURL = getStubImage(accountType);
22
25
  return /*#__PURE__*/React__default.createElement("img", {
23
26
  alt: title,
24
27
  src: avatarURL || stubImageURL,
25
28
  width: size,
26
29
  height: size,
30
+ style: style,
27
31
  className: clx(styles.avatar, {
28
32
  avatar_bordered: !!bordered
29
33
  }, [className])
@@ -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,6 +6,7 @@ export declare enum AccountType {
5
6
  }
6
7
  export type AvatarProps = {
7
8
  accountType?: AccountType;
9
+ style?: CSSProperties;
8
10
  title?: string;
9
11
  size?: AvatarSizes | number;
10
12
  avatarURL?: string;
@@ -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.146",
4
4
  "description": "React UI components library",
5
5
  "main": "index.js",
6
6
  "scripts": {},