prometeo-design-system 4.7.4 → 4.7.5

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/dist/Avatar.es.js CHANGED
@@ -1,17 +1,19 @@
1
- import { j as t } from "./jsx-runtime-GkKLlHH4.js";
2
- import { g as v } from "./useLabelBackground-D5SzHhl_.js";
3
- import { c as x } from "./cn-B6yFEsav.js";
4
- import { useState as C, useRef as u, useLayoutEffect as N } from "react";
5
- import { UserAvatar as y } from "./Icons/UserAvatar.es.js";
6
- function I({
7
- imageUrl: s,
1
+ import { j as e } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { g as C } from "./useLabelBackground-D5SzHhl_.js";
3
+ import { c as r } from "./cn-B6yFEsav.js";
4
+ import { useState as N, useRef as d, useLayoutEffect as S } from "react";
5
+ import y from "./Skeleton.es.js";
6
+ import { UserAvatar as A } from "./Icons/UserAvatar.es.js";
7
+ function B({
8
+ imageUrl: l,
8
9
  sizeImage: n = "md",
9
- sizeFallback: e = "md",
10
- fallbackText: d = "",
10
+ sizeFallback: t = "md",
11
+ fallbackText: f = "",
11
12
  subImageUrl: i,
12
- fallbackType: c = "initials"
13
+ fallbackType: c = "initials",
14
+ isLoading: h = !1
13
15
  }) {
14
- const [f, h] = C(!1), m = s && s.trim() !== "" && !f, g = (a) => a.split(" ").map((j) => j.charAt(0)).join("").toUpperCase().slice(0, 2), r = {
16
+ const [g, p] = N(!1), m = l && l.trim() !== "" && !g, w = (x) => x.split(" ").map((v) => v.charAt(0)).join("").toUpperCase().slice(0, 2), s = {
15
17
  xxxs: "w-6.5 h-6.5",
16
18
  xxs: "w-8 h-8",
17
19
  xs: "w-10 h-10",
@@ -19,7 +21,7 @@ function I({
19
21
  md: "w-24 h-24",
20
22
  lg: "w-32 h-32",
21
23
  xl: "w-40 h-40"
22
- }, p = {
24
+ }, b = {
23
25
  xxxs: "text-[12px]",
24
26
  xxs: "text-xs",
25
27
  xs: "text-sm",
@@ -27,7 +29,7 @@ function I({
27
29
  md: "text-2xl",
28
30
  lg: "text-3xl",
29
31
  xl: "text-4xl"
30
- }, w = {
32
+ }, j = {
31
33
  xxxs: "w-3 h-3",
32
34
  xxs: "w-[18px] h-[18px] bottom-0 right-0 translate-x-1/3 translate-y-1/3",
33
35
  xs: "w-5 h-5",
@@ -35,50 +37,50 @@ function I({
35
37
  md: "w-12 h-12 border-3",
36
38
  lg: "w-16 h-16 border-4",
37
39
  xl: "w-20 h-20 border-5"
38
- }, b = m ? n : e, o = u(null), l = u(null);
39
- return N(() => {
40
- if (!o.current || !l.current) return;
41
- const a = v(o.current);
42
- l.current.style.borderColor = a;
43
- }, []), /* @__PURE__ */ t.jsxs("div", { className: "relative inline-block min-w-max ", ref: o, children: [
44
- m ? /* @__PURE__ */ t.jsx(
40
+ }, u = m ? n : t, o = d(null), a = d(null);
41
+ return S(() => {
42
+ if (!o.current || !a.current) return;
43
+ const x = C(o.current);
44
+ a.current.style.borderColor = x;
45
+ }, []), h ? /* @__PURE__ */ e.jsx(y, { shape: "circle", className: r(s[u]) }) : /* @__PURE__ */ e.jsxs("div", { className: "relative inline-block min-w-max ", ref: o, children: [
46
+ m ? /* @__PURE__ */ e.jsx(
45
47
  "img",
46
48
  {
47
49
  onError: () => {
48
- h(!0);
50
+ p(!0);
49
51
  },
50
- src: s,
51
- className: `rounded-full object-cover ${r[n]}`,
52
+ src: l,
53
+ className: `rounded-full object-cover ${s[n]}`,
52
54
  alt: "Profile",
53
55
  draggable: !1
54
56
  }
55
- ) : c === "initials" ? /* @__PURE__ */ t.jsx(
57
+ ) : c === "initials" ? /* @__PURE__ */ e.jsx(
56
58
  "div",
57
59
  {
58
- className: ` flex items-center justify-center rounded-full aspect-square ${r[e]}`,
60
+ className: ` flex items-center justify-center rounded-full aspect-square ${s[t]}`,
59
61
  style: { backgroundColor: "#C6D2FF" },
60
- children: /* @__PURE__ */ t.jsx(
62
+ children: /* @__PURE__ */ e.jsx(
61
63
  "span",
62
64
  {
63
- className: x(
65
+ className: r(
64
66
  "text-[#312C85] font-semibold",
65
- p[e]
67
+ b[t]
66
68
  ),
67
- children: g(d)
69
+ children: w(f)
68
70
  }
69
71
  )
70
72
  },
71
73
  "initials"
72
- ) : c === "defaultAvatar" && /* @__PURE__ */ t.jsx(y, { className: x(r[e], "fill-[#D4D4D8] text-(--neutral-700)") }),
73
- i && /* @__PURE__ */ t.jsx(
74
+ ) : c === "defaultAvatar" && /* @__PURE__ */ e.jsx(A, { className: r(s[t], "fill-[#D4D4D8] text-(--neutral-700)") }),
75
+ i && /* @__PURE__ */ e.jsx(
74
76
  "div",
75
77
  {
76
- className: x(
78
+ className: r(
77
79
  "absolute bottom-[-10px] right-[-10px] rounded-full border overflow-hidden bg-gray-900",
78
- w[b]
80
+ j[u]
79
81
  ),
80
- ref: l,
81
- children: /* @__PURE__ */ t.jsx(
82
+ ref: a,
83
+ children: /* @__PURE__ */ e.jsx(
82
84
  "img",
83
85
  {
84
86
  draggable: !1,
@@ -92,5 +94,5 @@ function I({
92
94
  ] });
93
95
  }
94
96
  export {
95
- I as default
97
+ B as default
96
98
  };