@nextui-org/avatar
Advanced tools
Comparing version 2.0.28 to 2.0.29
@@ -198,2 +198,3 @@ "use client"; | ||
const isImgLoaded = imageStatus === "loaded"; | ||
const shouldFilterDOMProps = typeof ImgComponent === "string"; | ||
const showFallback = (!src || !isImgLoaded) && showFallbackProp; | ||
@@ -247,8 +248,13 @@ const slots = (0, import_react2.useMemo)( | ||
src, | ||
disableAnimation, | ||
"data-loaded": (0, import_shared_utils2.dataAttr)(isImgLoaded), | ||
className: slots.img({ class: classNames == null ? void 0 : classNames.img }), | ||
...(0, import_utils.mergeProps)(imgProps, props) | ||
...(0, import_utils.mergeProps)( | ||
imgProps, | ||
props, | ||
(0, import_react_utils4.filterDOMProps)({ disableAnimation }, { | ||
enabled: shouldFilterDOMProps | ||
}) | ||
) | ||
}), | ||
[slots, isImgLoaded, imgProps, disableAnimation, src, imgRef] | ||
[slots, isImgLoaded, imgProps, disableAnimation, src, imgRef, shouldFilterDOMProps] | ||
); | ||
@@ -255,0 +261,0 @@ return { |
@@ -117,2 +117,3 @@ "use client"; | ||
const isImgLoaded = imageStatus === "loaded"; | ||
const shouldFilterDOMProps = typeof ImgComponent === "string"; | ||
const showFallback = (!src || !isImgLoaded) && showFallbackProp; | ||
@@ -166,8 +167,13 @@ const slots = (0, import_react.useMemo)( | ||
src, | ||
disableAnimation, | ||
"data-loaded": (0, import_shared_utils.dataAttr)(isImgLoaded), | ||
className: slots.img({ class: classNames == null ? void 0 : classNames.img }), | ||
...(0, import_utils.mergeProps)(imgProps, props) | ||
...(0, import_utils.mergeProps)( | ||
imgProps, | ||
props, | ||
(0, import_react_utils2.filterDOMProps)({ disableAnimation }, { | ||
enabled: shouldFilterDOMProps | ||
}) | ||
) | ||
}), | ||
[slots, isImgLoaded, imgProps, disableAnimation, src, imgRef] | ||
[slots, isImgLoaded, imgProps, disableAnimation, src, imgRef, shouldFilterDOMProps] | ||
); | ||
@@ -174,0 +180,0 @@ return { |
@@ -125,2 +125,3 @@ "use client"; | ||
const isImgLoaded = imageStatus === "loaded"; | ||
const shouldFilterDOMProps = typeof ImgComponent === "string"; | ||
const showFallback = (!src || !isImgLoaded) && showFallbackProp; | ||
@@ -174,8 +175,13 @@ const slots = (0, import_react.useMemo)( | ||
src, | ||
disableAnimation, | ||
"data-loaded": (0, import_shared_utils.dataAttr)(isImgLoaded), | ||
className: slots.img({ class: classNames == null ? void 0 : classNames.img }), | ||
...(0, import_utils.mergeProps)(imgProps, props) | ||
...(0, import_utils.mergeProps)( | ||
imgProps, | ||
props, | ||
(0, import_react_utils2.filterDOMProps)({ disableAnimation }, { | ||
enabled: shouldFilterDOMProps | ||
}) | ||
) | ||
}), | ||
[slots, isImgLoaded, imgProps, disableAnimation, src, imgRef] | ||
[slots, isImgLoaded, imgProps, disableAnimation, src, imgRef, shouldFilterDOMProps] | ||
); | ||
@@ -182,0 +188,0 @@ return { |
import * as tailwind_variants from 'tailwind-variants'; | ||
import * as react from 'react'; | ||
import * as _nextui_org_system from '@nextui-org/system'; | ||
import { PropGetter, HTMLNextUIProps } from '@nextui-org/system'; | ||
import { PropGetter, DOMAttributes, DOMElement, HTMLNextUIProps } from '@nextui-org/system'; | ||
import { AvatarVariantProps, SlotsToClasses, AvatarSlots } from '@nextui-org/theme'; | ||
@@ -202,4 +202,4 @@ import { ReactRef } from '@nextui-org/react-utils'; | ||
getInitials: (text: string) => string; | ||
getAvatarProps: PropGetter<Record<string, unknown>, _nextui_org_system.DOMAttributes<_nextui_org_system.DOMElement>>; | ||
getImageProps: PropGetter<Record<string, unknown>, _nextui_org_system.DOMAttributes<_nextui_org_system.DOMElement>>; | ||
getAvatarProps: PropGetter<Record<string, unknown>, DOMAttributes<DOMElement>>; | ||
getImageProps: PropGetter<Record<string, unknown>, DOMAttributes<DOMElement>>; | ||
}; | ||
@@ -206,0 +206,0 @@ type UseAvatarReturn = ReturnType<typeof useAvatar>; |
@@ -83,2 +83,3 @@ "use client"; | ||
const isImgLoaded = imageStatus === "loaded"; | ||
const shouldFilterDOMProps = typeof ImgComponent === "string"; | ||
const showFallback = (!src || !isImgLoaded) && showFallbackProp; | ||
@@ -132,8 +133,13 @@ const slots = (0, import_react.useMemo)( | ||
src, | ||
disableAnimation, | ||
"data-loaded": (0, import_shared_utils.dataAttr)(isImgLoaded), | ||
className: slots.img({ class: classNames == null ? void 0 : classNames.img }), | ||
...(0, import_utils.mergeProps)(imgProps, props) | ||
...(0, import_utils.mergeProps)( | ||
imgProps, | ||
props, | ||
(0, import_react_utils2.filterDOMProps)({ disableAnimation }, { | ||
enabled: shouldFilterDOMProps | ||
}) | ||
) | ||
}), | ||
[slots, isImgLoaded, imgProps, disableAnimation, src, imgRef] | ||
[slots, isImgLoaded, imgProps, disableAnimation, src, imgRef, shouldFilterDOMProps] | ||
); | ||
@@ -140,0 +146,0 @@ return { |
{ | ||
"name": "@nextui-org/avatar", | ||
"version": "2.0.28", | ||
"version": "2.0.29", | ||
"description": "The Avatar component is used to represent a user, and displays the profile picture, initials or fallback icon.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74944
2025