@jobber/components 8.24.0 → 8.24.1

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.
@@ -41,6 +41,7 @@ function deconstructCssCustomProperty(color) {
41
41
  .trim();
42
42
  }
43
43
 
44
+ const MAX_VISIBLE_INITIALS = 3;
44
45
  function Avatar({ imageUrl, name, initials, size = "base", color, UNSAFE_className = {}, UNSAFE_style = {}, }) {
45
46
  const style = Object.assign({ backgroundColor: color, borderColor: color }, UNSAFE_style.container);
46
47
  if (imageUrl) {
@@ -72,9 +73,9 @@ function Initials({ initials, iconColor = "textReverse", iconSize = "base", UNSA
72
73
  return (React.createElement(Icon.Icon, { name: "person", color: iconColor, size: iconSize, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.fallbackIcon, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.fallbackIcon }));
73
74
  }
74
75
  const className = classnames(styles.initials, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.initials, {
75
- [styles.smallInitials]: initials.length > 2,
76
+ [styles.smallInitials]: initials.length >= MAX_VISIBLE_INITIALS,
76
77
  });
77
- return (React.createElement("span", { className: className, style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.initials }, initials.substr(0, 3)));
78
+ return (React.createElement("span", { className: className, style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.initials }, initials.slice(0, MAX_VISIBLE_INITIALS)));
78
79
  }
79
80
 
80
81
  exports.Avatar = Avatar;
package/dist/Avatar-es.js CHANGED
@@ -39,6 +39,7 @@ function deconstructCssCustomProperty(color) {
39
39
  .trim();
40
40
  }
41
41
 
42
+ const MAX_VISIBLE_INITIALS = 3;
42
43
  function Avatar({ imageUrl, name, initials, size = "base", color, UNSAFE_className = {}, UNSAFE_style = {}, }) {
43
44
  const style = Object.assign({ backgroundColor: color, borderColor: color }, UNSAFE_style.container);
44
45
  if (imageUrl) {
@@ -70,9 +71,9 @@ function Initials({ initials, iconColor = "textReverse", iconSize = "base", UNSA
70
71
  return (React__default.createElement(Icon, { name: "person", color: iconColor, size: iconSize, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.fallbackIcon, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.fallbackIcon }));
71
72
  }
72
73
  const className = classnames(styles.initials, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.initials, {
73
- [styles.smallInitials]: initials.length > 2,
74
+ [styles.smallInitials]: initials.length >= MAX_VISIBLE_INITIALS,
74
75
  });
75
- return (React__default.createElement("span", { className: className, style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.initials }, initials.substr(0, 3)));
76
+ return (React__default.createElement("span", { className: className, style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.initials }, initials.slice(0, MAX_VISIBLE_INITIALS)));
76
77
  }
77
78
 
78
79
  export { Avatar as A };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "8.24.0",
3
+ "version": "8.24.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -540,5 +540,5 @@
540
540
  "> 1%",
541
541
  "IE 10"
542
542
  ],
543
- "gitHead": "a0a4e20fd87528ebfff6970e6566a1b94b927578"
543
+ "gitHead": "b17211eb3d332daef1d38c66b5677c30598331f3"
544
544
  }