@topconsultnpm/sdkui-react-beta 6.12.56 → 6.12.58

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,7 @@
1
- declare const TMUserAvatar: ({ name, returnType }: {
1
+ interface TMUserAvatarProps {
2
2
  name: string;
3
- returnType?: "jsx" | "svg";
4
- }) => string | import("react/jsx-runtime").JSX.Element;
3
+ tooltipName?: string;
4
+ returnType?: 'jsx' | 'svg';
5
+ }
6
+ declare const TMUserAvatar: (props: TMUserAvatarProps) => string | import("react/jsx-runtime").JSX.Element;
5
7
  export default TMUserAvatar;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import TMTooltip from './TMTooltip';
3
- const TMUserAvatar = ({ name, returnType = 'jsx' }) => {
3
+ const TMUserAvatar = (props) => {
4
+ const { name, tooltipName, returnType } = props;
4
5
  // Helper function to generate dark color from name
5
6
  const generateDarkColorFromName = (str) => {
6
7
  let hash = 0;
@@ -27,7 +28,7 @@ const TMUserAvatar = ({ name, returnType = 'jsx' }) => {
27
28
  };
28
29
  // Helper function to extract initials from name
29
30
  const extractInitialsFromName = (name) => {
30
- if (name.length >= 3) {
31
+ if (name.length >= 2) {
31
32
  const lettersOnly = name.replace(/[^a-zA-Z]/g, '');
32
33
  return lettersOnly.substring(0, 3).toUpperCase();
33
34
  }
@@ -45,7 +46,7 @@ const TMUserAvatar = ({ name, returnType = 'jsx' }) => {
45
46
  </svg>
46
47
  `.trim();
47
48
  }
48
- return (_jsx(TMTooltip, { content: name ?? '-', children: _jsx("div", { style: {
49
+ return (_jsx(TMTooltip, { content: tooltipName ?? name, children: _jsx("div", { style: {
49
50
  width: "40px",
50
51
  height: "40px",
51
52
  borderRadius: "50%",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.12.56",
3
+ "version": "6.12.58",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",