najm-kit 0.0.18 → 0.0.19
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/index.mjs +3 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3867,6 +3867,7 @@ function NAvatar({
|
|
|
3867
3867
|
const hasText = Boolean(title || subtitle || meta);
|
|
3868
3868
|
const fallbackText = fallback && !title ? fallback : label ? getInitials(label) : "?";
|
|
3869
3869
|
const shapeClass = SHAPE_CLASSES[shape];
|
|
3870
|
+
const [imgLoaded, setImgLoaded] = React__default.useState(false);
|
|
3870
3871
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3", classNames?.root, className), children: [
|
|
3871
3872
|
/* @__PURE__ */ jsxs(
|
|
3872
3873
|
Avatar,
|
|
@@ -3878,10 +3879,11 @@ function NAvatar({
|
|
|
3878
3879
|
{
|
|
3879
3880
|
src: imageSrc,
|
|
3880
3881
|
alt: alt || label,
|
|
3882
|
+
onLoadingStatusChange: (status) => setImgLoaded(status === "loaded"),
|
|
3881
3883
|
className: cn("absolute inset-0 z-10 object-cover", classNames?.image)
|
|
3882
3884
|
}
|
|
3883
3885
|
),
|
|
3884
|
-
/* @__PURE__ */ jsx(
|
|
3886
|
+
!imgLoaded && /* @__PURE__ */ jsx(
|
|
3885
3887
|
AvatarFallback,
|
|
3886
3888
|
{
|
|
3887
3889
|
style: { backgroundColor: bg, color: text },
|