@wistia/ui 0.4.6 → 0.4.7
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.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.4.
|
|
3
|
+
* @license @wistia/ui v0.4.7
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -5959,17 +5959,17 @@ var Avatar = ({
|
|
|
5959
5959
|
onImageLoad,
|
|
5960
5960
|
...otherProps
|
|
5961
5961
|
}) => {
|
|
5962
|
-
const [imageLoadState, setImageLoadState] = (0, import_react14.useState)(
|
|
5962
|
+
const [imageLoadState, setImageLoadState] = (0, import_react14.useState)("loading");
|
|
5963
5963
|
(0, import_react14.useEffect)(() => {
|
|
5964
|
-
setImageLoadState(
|
|
5964
|
+
setImageLoadState("loading");
|
|
5965
5965
|
}, [imageUrl]);
|
|
5966
5966
|
const handleImageLoad = () => {
|
|
5967
5967
|
setImageLoadState("loaded");
|
|
5968
|
-
onImageLoad?.("image");
|
|
5968
|
+
onImageLoad?.({ state: "loaded", type: "image" });
|
|
5969
5969
|
};
|
|
5970
5970
|
const handleImageLoadError = () => {
|
|
5971
5971
|
setImageLoadState("error");
|
|
5972
|
-
onImageLoad?.("initials");
|
|
5972
|
+
onImageLoad?.({ state: "error", type: "initials" });
|
|
5973
5973
|
};
|
|
5974
5974
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
5975
5975
|
const avatarColor = (0, import_react14.useMemo)(() => chooseColorScheme(name), [name]);
|