@snack-uikit/avatar 0.5.1 → 0.6.1-preview-0a44b2fc.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 CHANGED
@@ -3,6 +3,17 @@
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.6.0 (2024-03-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **FF-4448:** avatar accept decimals ([8800f1d](https://github.com/cloud-ru-tech/snack-uikit/commit/8800f1d760231c19bec6a76eac641e4cc1d890d7))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 0.5.1 (2024-02-20)
7
18
 
8
19
  ### Only dependencies have been changed
@@ -1,7 +1,7 @@
1
1
  const SPACE = ' ';
2
2
  export const getAbbreviation = (str, abbreviationLength) => {
3
- var _a, _b;
4
- const trimStr = (_a = str.replace(/[^a-zа-яё\s]/gi, '').trim()) !== null && _a !== void 0 ? _a : str.replace(/[^\d]/gi, '');
3
+ var _a;
4
+ const trimStr = str.replace(/[^a-zа-яё\d\s]/gi, '').trim();
5
5
  if (!trimStr || trimStr.length < abbreviationLength) {
6
6
  return trimStr.toUpperCase();
7
7
  }
@@ -9,7 +9,7 @@ export const getAbbreviation = (str, abbreviationLength) => {
9
9
  let abbreviation = trimStr;
10
10
  if (strParts.length > 1) {
11
11
  const firstLetter = strParts[0].charAt(0);
12
- const secondLetter = (_b = strParts[strParts.length - 1]) === null || _b === void 0 ? void 0 : _b.charAt(0);
12
+ const secondLetter = (_a = strParts[strParts.length - 1]) === null || _a === void 0 ? void 0 : _a.charAt(0);
13
13
  abbreviation = `${firstLetter}${secondLetter}`.toUpperCase();
14
14
  }
15
15
  return abbreviation.slice(0, abbreviationLength).toUpperCase();
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Avatar",
7
- "version": "0.5.1",
7
+ "version": "0.6.1-preview-0a44b2fc.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -31,9 +31,9 @@
31
31
  ],
32
32
  "license": "Apache-2.0",
33
33
  "dependencies": {
34
- "@snack-uikit/status": "0.5.1",
35
- "@snack-uikit/utils": "3.2.0",
34
+ "@snack-uikit/status": "0.5.2-preview-0a44b2fc.0",
35
+ "@snack-uikit/utils": "3.2.1-preview-0a44b2fc.0",
36
36
  "classnames": "2.3.2"
37
37
  },
38
- "gitHead": "fd079dd3acbfe935d0b88d9efd863047f25e5824"
38
+ "gitHead": "318167bcb09619d0d40263ec844b38b1014838f4"
39
39
  }
@@ -1,7 +1,7 @@
1
1
  const SPACE = ' ';
2
2
 
3
3
  export const getAbbreviation = (str: string, abbreviationLength: 1 | 2): string => {
4
- const trimStr = str.replace(/[^a-zа-яё\s]/gi, '').trim() ?? str.replace(/[^\d]/gi, '');
4
+ const trimStr = str.replace(/[^a-zа-яё\d\s]/gi, '').trim();
5
5
 
6
6
  if (!trimStr || trimStr.length < abbreviationLength) {
7
7
  return trimStr.toUpperCase();