@heroui/avatar 2.2.19-beta.0 → 2.2.19-beta.2
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-group.js +9 -3
- package/dist/avatar-group.mjs +3 -3
- package/dist/avatar.js +9 -3
- package/dist/avatar.mjs +2 -2
- package/dist/{chunk-URUA6GTV.mjs → chunk-D6GKTNAY.mjs} +9 -3
- package/dist/{chunk-3FFVP3PC.mjs → chunk-RHCEY3MN.mjs} +1 -1
- package/dist/{chunk-224FR5UN.mjs → chunk-X2BFRYAX.mjs} +1 -1
- package/dist/index.js +9 -3
- package/dist/index.mjs +3 -3
- package/dist/use-avatar.js +9 -3
- package/dist/use-avatar.mjs +1 -1
- package/package.json +4 -4
package/dist/avatar-group.js
CHANGED
|
@@ -157,7 +157,7 @@ var import_react2 = require("react");
|
|
|
157
157
|
var import_use_image = require("@heroui/use-image");
|
|
158
158
|
var import_interactions = require("@react-aria/interactions");
|
|
159
159
|
function useAvatar(originalProps = {}) {
|
|
160
|
-
var _a, _b, _c, _d, _e, _f;
|
|
160
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
161
161
|
const globalContext = (0, import_system.useProviderContext)();
|
|
162
162
|
const groupContext = useAvatarGroupContext();
|
|
163
163
|
const isInGroup = !!groupContext;
|
|
@@ -193,9 +193,15 @@ function useAvatar(originalProps = {}) {
|
|
|
193
193
|
const { isFocusVisible, isFocused, focusProps } = (0, import_focus.useFocusRing)();
|
|
194
194
|
const { isHovered, hoverProps } = (0, import_interactions.useHover)({ isDisabled });
|
|
195
195
|
const disableAnimation = (_f = disableAnimationProp != null ? disableAnimationProp : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _f : false;
|
|
196
|
-
const
|
|
196
|
+
const isHeroImage = (_h = typeof ImgComponent === "object" && ((_g = ImgComponent == null ? void 0 : ImgComponent.displayName) == null ? void 0 : _g.includes("HeroUI"))) != null ? _h : false;
|
|
197
|
+
const imageStatus = (0, import_use_image.useImage)({
|
|
198
|
+
src,
|
|
199
|
+
onError,
|
|
200
|
+
ignoreFallback,
|
|
201
|
+
shouldBypassImageLoad: as !== void 0 || !isHeroImage
|
|
202
|
+
});
|
|
197
203
|
const isImgLoaded = imageStatus === "loaded";
|
|
198
|
-
const shouldFilterDOMProps =
|
|
204
|
+
const shouldFilterDOMProps = !isHeroImage;
|
|
199
205
|
const showFallback = (!src || !isImgLoaded) && showFallbackProp;
|
|
200
206
|
const slots = (0, import_react2.useMemo)(
|
|
201
207
|
() => {
|
package/dist/avatar-group.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
avatar_group_default
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-X2BFRYAX.mjs";
|
|
5
|
+
import "./chunk-RHCEY3MN.mjs";
|
|
6
6
|
import "./chunk-25E6VDTZ.mjs";
|
|
7
7
|
import "./chunk-QH65JCLF.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-D6GKTNAY.mjs";
|
|
9
9
|
import "./chunk-JUJ53SJZ.mjs";
|
|
10
10
|
export {
|
|
11
11
|
avatar_group_default as default
|
package/dist/avatar.js
CHANGED
|
@@ -76,7 +76,7 @@ var [AvatarGroupProvider, useAvatarGroupContext] = (0, import_react_utils.create
|
|
|
76
76
|
|
|
77
77
|
// src/use-avatar.ts
|
|
78
78
|
function useAvatar(originalProps = {}) {
|
|
79
|
-
var _a, _b, _c, _d, _e, _f;
|
|
79
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
80
80
|
const globalContext = (0, import_system.useProviderContext)();
|
|
81
81
|
const groupContext = useAvatarGroupContext();
|
|
82
82
|
const isInGroup = !!groupContext;
|
|
@@ -112,9 +112,15 @@ function useAvatar(originalProps = {}) {
|
|
|
112
112
|
const { isFocusVisible, isFocused, focusProps } = (0, import_focus.useFocusRing)();
|
|
113
113
|
const { isHovered, hoverProps } = (0, import_interactions.useHover)({ isDisabled });
|
|
114
114
|
const disableAnimation = (_f = disableAnimationProp != null ? disableAnimationProp : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _f : false;
|
|
115
|
-
const
|
|
115
|
+
const isHeroImage = (_h = typeof ImgComponent === "object" && ((_g = ImgComponent == null ? void 0 : ImgComponent.displayName) == null ? void 0 : _g.includes("HeroUI"))) != null ? _h : false;
|
|
116
|
+
const imageStatus = (0, import_use_image.useImage)({
|
|
117
|
+
src,
|
|
118
|
+
onError,
|
|
119
|
+
ignoreFallback,
|
|
120
|
+
shouldBypassImageLoad: as !== void 0 || !isHeroImage
|
|
121
|
+
});
|
|
116
122
|
const isImgLoaded = imageStatus === "loaded";
|
|
117
|
-
const shouldFilterDOMProps =
|
|
123
|
+
const shouldFilterDOMProps = !isHeroImage;
|
|
118
124
|
const showFallback = (!src || !isImgLoaded) && showFallbackProp;
|
|
119
125
|
const slots = (0, import_react.useMemo)(
|
|
120
126
|
() => {
|
package/dist/avatar.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
avatar_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RHCEY3MN.mjs";
|
|
5
5
|
import "./chunk-25E6VDTZ.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-D6GKTNAY.mjs";
|
|
7
7
|
import "./chunk-JUJ53SJZ.mjs";
|
|
8
8
|
export {
|
|
9
9
|
avatar_default as default
|
|
@@ -13,7 +13,7 @@ import { useMemo, useCallback } from "react";
|
|
|
13
13
|
import { useImage } from "@heroui/use-image";
|
|
14
14
|
import { useHover } from "@react-aria/interactions";
|
|
15
15
|
function useAvatar(originalProps = {}) {
|
|
16
|
-
var _a, _b, _c, _d, _e, _f;
|
|
16
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
17
17
|
const globalContext = useProviderContext();
|
|
18
18
|
const groupContext = useAvatarGroupContext();
|
|
19
19
|
const isInGroup = !!groupContext;
|
|
@@ -49,9 +49,15 @@ function useAvatar(originalProps = {}) {
|
|
|
49
49
|
const { isFocusVisible, isFocused, focusProps } = useFocusRing();
|
|
50
50
|
const { isHovered, hoverProps } = useHover({ isDisabled });
|
|
51
51
|
const disableAnimation = (_f = disableAnimationProp != null ? disableAnimationProp : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _f : false;
|
|
52
|
-
const
|
|
52
|
+
const isHeroImage = (_h = typeof ImgComponent === "object" && ((_g = ImgComponent == null ? void 0 : ImgComponent.displayName) == null ? void 0 : _g.includes("HeroUI"))) != null ? _h : false;
|
|
53
|
+
const imageStatus = useImage({
|
|
54
|
+
src,
|
|
55
|
+
onError,
|
|
56
|
+
ignoreFallback,
|
|
57
|
+
shouldBypassImageLoad: as !== void 0 || !isHeroImage
|
|
58
|
+
});
|
|
53
59
|
const isImgLoaded = imageStatus === "loaded";
|
|
54
|
-
const shouldFilterDOMProps =
|
|
60
|
+
const shouldFilterDOMProps = !isHeroImage;
|
|
55
61
|
const showFallback = (!src || !isImgLoaded) && showFallbackProp;
|
|
56
62
|
const slots = useMemo(
|
|
57
63
|
() => {
|
package/dist/index.js
CHANGED
|
@@ -84,7 +84,7 @@ var [AvatarGroupProvider, useAvatarGroupContext] = (0, import_react_utils.create
|
|
|
84
84
|
|
|
85
85
|
// src/use-avatar.ts
|
|
86
86
|
function useAvatar(originalProps = {}) {
|
|
87
|
-
var _a, _b, _c, _d, _e, _f;
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
88
88
|
const globalContext = (0, import_system.useProviderContext)();
|
|
89
89
|
const groupContext = useAvatarGroupContext();
|
|
90
90
|
const isInGroup = !!groupContext;
|
|
@@ -120,9 +120,15 @@ function useAvatar(originalProps = {}) {
|
|
|
120
120
|
const { isFocusVisible, isFocused, focusProps } = (0, import_focus.useFocusRing)();
|
|
121
121
|
const { isHovered, hoverProps } = (0, import_interactions.useHover)({ isDisabled });
|
|
122
122
|
const disableAnimation = (_f = disableAnimationProp != null ? disableAnimationProp : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _f : false;
|
|
123
|
-
const
|
|
123
|
+
const isHeroImage = (_h = typeof ImgComponent === "object" && ((_g = ImgComponent == null ? void 0 : ImgComponent.displayName) == null ? void 0 : _g.includes("HeroUI"))) != null ? _h : false;
|
|
124
|
+
const imageStatus = (0, import_use_image.useImage)({
|
|
125
|
+
src,
|
|
126
|
+
onError,
|
|
127
|
+
ignoreFallback,
|
|
128
|
+
shouldBypassImageLoad: as !== void 0 || !isHeroImage
|
|
129
|
+
});
|
|
124
130
|
const isImgLoaded = imageStatus === "loaded";
|
|
125
|
-
const shouldFilterDOMProps =
|
|
131
|
+
const shouldFilterDOMProps = !isHeroImage;
|
|
126
132
|
const showFallback = (!src || !isImgLoaded) && showFallbackProp;
|
|
127
133
|
const slots = (0, import_react.useMemo)(
|
|
128
134
|
() => {
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
avatar_group_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-X2BFRYAX.mjs";
|
|
5
5
|
import {
|
|
6
6
|
avatar_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RHCEY3MN.mjs";
|
|
8
8
|
import {
|
|
9
9
|
AvatarIcon
|
|
10
10
|
} from "./chunk-25E6VDTZ.mjs";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-QH65JCLF.mjs";
|
|
14
14
|
import {
|
|
15
15
|
useAvatar
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-D6GKTNAY.mjs";
|
|
17
17
|
import {
|
|
18
18
|
AvatarGroupProvider,
|
|
19
19
|
useAvatarGroupContext
|
package/dist/use-avatar.js
CHANGED
|
@@ -42,7 +42,7 @@ var [AvatarGroupProvider, useAvatarGroupContext] = (0, import_react_utils.create
|
|
|
42
42
|
|
|
43
43
|
// src/use-avatar.ts
|
|
44
44
|
function useAvatar(originalProps = {}) {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f;
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
46
46
|
const globalContext = (0, import_system.useProviderContext)();
|
|
47
47
|
const groupContext = useAvatarGroupContext();
|
|
48
48
|
const isInGroup = !!groupContext;
|
|
@@ -78,9 +78,15 @@ function useAvatar(originalProps = {}) {
|
|
|
78
78
|
const { isFocusVisible, isFocused, focusProps } = (0, import_focus.useFocusRing)();
|
|
79
79
|
const { isHovered, hoverProps } = (0, import_interactions.useHover)({ isDisabled });
|
|
80
80
|
const disableAnimation = (_f = disableAnimationProp != null ? disableAnimationProp : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _f : false;
|
|
81
|
-
const
|
|
81
|
+
const isHeroImage = (_h = typeof ImgComponent === "object" && ((_g = ImgComponent == null ? void 0 : ImgComponent.displayName) == null ? void 0 : _g.includes("HeroUI"))) != null ? _h : false;
|
|
82
|
+
const imageStatus = (0, import_use_image.useImage)({
|
|
83
|
+
src,
|
|
84
|
+
onError,
|
|
85
|
+
ignoreFallback,
|
|
86
|
+
shouldBypassImageLoad: as !== void 0 || !isHeroImage
|
|
87
|
+
});
|
|
82
88
|
const isImgLoaded = imageStatus === "loaded";
|
|
83
|
-
const shouldFilterDOMProps =
|
|
89
|
+
const shouldFilterDOMProps = !isHeroImage;
|
|
84
90
|
const showFallback = (!src || !isImgLoaded) && showFallbackProp;
|
|
85
91
|
const slots = (0, import_react.useMemo)(
|
|
86
92
|
() => {
|
package/dist/use-avatar.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroui/avatar",
|
|
3
|
-
"version": "2.2.19-beta.
|
|
3
|
+
"version": "2.2.19-beta.2",
|
|
4
4
|
"description": "The Avatar component is used to represent a user, and displays the profile picture, initials or fallback icon.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"avatar"
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@react-aria/interactions": "3.25.3",
|
|
35
35
|
"@react-aria/focus": "3.20.5",
|
|
36
|
-
"@heroui/shared-utils": "2.1.10-beta.
|
|
37
|
-
"@heroui/react-utils": "2.1.12-beta.
|
|
38
|
-
"@heroui/use-image": "2.1.11-beta.
|
|
36
|
+
"@heroui/shared-utils": "2.1.10-beta.6",
|
|
37
|
+
"@heroui/react-utils": "2.1.12-beta.4",
|
|
38
|
+
"@heroui/use-image": "2.1.11-beta.5"
|
|
39
39
|
},
|
|
40
40
|
"clean-package": "../../../clean-package.config.json",
|
|
41
41
|
"module": "dist/index.mjs",
|