@yamada-ui/avatar
Advanced tools
Comparing version 0.3.17 to 0.3.18
@@ -10,7 +10,7 @@ import * as _yamada_ui_core from '@yamada-ui/core'; | ||
*/ | ||
placement?: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'; | ||
placement?: "top-start" | "top-end" | "bottom-start" | "bottom-end"; | ||
}; | ||
type AvatarBadgeProps = HTMLUIProps<'div'> & AvatarBadgeOptions; | ||
type AvatarBadgeProps = HTMLUIProps<"div"> & AvatarBadgeOptions; | ||
declare const AvatarBadge: _yamada_ui_core.Component<"div", AvatarBadgeProps>; | ||
export { AvatarBadge, AvatarBadgeProps }; |
@@ -111,3 +111,3 @@ "use client" | ||
} = (0, import_core2.omitThemeProps)(mergedProps); | ||
const [isLoading, setIsLoading] = (0, import_react.useState)(true); | ||
const [isLoaded, setIsLoaded] = (0, import_react.useState)(false); | ||
const css = { | ||
@@ -129,3 +129,3 @@ position: "relative", | ||
className: (0, import_utils.cx)("ui-avatar", className), | ||
"data-loading": (0, import_utils.dataAttr)(isLoading), | ||
"data-loaded": (0, import_utils.dataAttr)(isLoaded), | ||
borderRadius, | ||
@@ -144,3 +144,3 @@ rounded, | ||
rounded, | ||
onLoad: (0, import_utils.handlerAll)(onLoad, () => setIsLoading(false)), | ||
onLoad: (0, import_utils.handlerAll)(onLoad, () => setIsLoaded(true)), | ||
onError, | ||
@@ -173,3 +173,3 @@ format, | ||
}) => { | ||
const status = (0, import_image.useImage)({ src, onError, crossOrigin, ignoreFallback }); | ||
const status = (0, import_image.useImage)({ src, onLoad, onError, crossOrigin, ignoreFallback }); | ||
const isLoaded = status === "loaded"; | ||
@@ -192,3 +192,2 @@ const isFallback = !src || !isLoaded; | ||
loading, | ||
onLoad, | ||
referrerPolicy, | ||
@@ -195,0 +194,0 @@ borderRadius, |
@@ -10,5 +10,5 @@ import * as _yamada_ui_core from '@yamada-ui/core'; | ||
}; | ||
type AvatarGroupProps = HTMLUIProps<'div'> & ThemeProps<'Avatar'> & AvatarGroupOptions; | ||
type AvatarGroupProps = HTMLUIProps<"div"> & ThemeProps<"Avatar"> & AvatarGroupOptions; | ||
declare const AvatarGroup: _yamada_ui_core.Component<"div", AvatarGroupProps>; | ||
export { AvatarGroup, AvatarGroupProps }; |
@@ -6,5 +6,5 @@ import { HTMLUIProps } from '@yamada-ui/core'; | ||
type AvatarNameProps = HTMLUIProps<'div'> & Pick<AvatarProps, 'name' | 'format'>; | ||
type AvatarNameProps = HTMLUIProps<"div"> & Pick<AvatarProps, "name" | "format">; | ||
declare const AvatarName: FC<AvatarNameProps>; | ||
export { AvatarName, AvatarNameProps }; |
@@ -90,3 +90,3 @@ "use client" | ||
} = (0, import_core.omitThemeProps)(mergedProps); | ||
const [isLoading, setIsLoading] = (0, import_react.useState)(true); | ||
const [isLoaded, setIsLoaded] = (0, import_react.useState)(false); | ||
const css = { | ||
@@ -108,3 +108,3 @@ position: "relative", | ||
className: (0, import_utils.cx)("ui-avatar", className), | ||
"data-loading": (0, import_utils.dataAttr)(isLoading), | ||
"data-loaded": (0, import_utils.dataAttr)(isLoaded), | ||
borderRadius, | ||
@@ -123,3 +123,3 @@ rounded, | ||
rounded, | ||
onLoad: (0, import_utils.handlerAll)(onLoad, () => setIsLoading(false)), | ||
onLoad: (0, import_utils.handlerAll)(onLoad, () => setIsLoaded(true)), | ||
onError, | ||
@@ -152,3 +152,3 @@ format, | ||
}) => { | ||
const status = (0, import_image.useImage)({ src, onError, crossOrigin, ignoreFallback }); | ||
const status = (0, import_image.useImage)({ src, onLoad, onError, crossOrigin, ignoreFallback }); | ||
const isLoaded = status === "loaded"; | ||
@@ -171,3 +171,2 @@ const isFallback = !src || !isLoaded; | ||
loading, | ||
onLoad, | ||
referrerPolicy, | ||
@@ -174,0 +173,0 @@ borderRadius, |
@@ -5,3 +5,3 @@ import * as _yamada_ui_core from '@yamada-ui/core'; | ||
import { ReactElement, HTMLAttributeReferrerPolicy } from 'react'; | ||
import { ImageProps } from '@yamada-ui/image'; | ||
import { UseImageProps, ImageProps } from '@yamada-ui/image'; | ||
@@ -22,11 +22,11 @@ type AvatarContext = Record<string, CSSUIObject>; | ||
*/ | ||
src?: ImageProps['src']; | ||
src?: ImageProps["src"]; | ||
/** | ||
* List of sources to use for different screen resolutions. | ||
*/ | ||
srcSet?: ImageProps['srcSet']; | ||
srcSet?: ImageProps["srcSet"]; | ||
/** | ||
* Defines loading strategy. | ||
*/ | ||
loading?: ImageProps['loading']; | ||
loading?: ImageProps["loading"]; | ||
/** | ||
@@ -37,3 +37,3 @@ * If `true`, opt out of the avatar's `fallback` logic and renders the `img` at all times. | ||
*/ | ||
ignoreFallback?: ImageProps['ignoreFallback']; | ||
ignoreFallback?: ImageProps["ignoreFallback"]; | ||
/** | ||
@@ -44,6 +44,2 @@ * The avatar icon to use. | ||
/** | ||
* Function called when image failed to load. | ||
*/ | ||
onError?: () => void; | ||
/** | ||
* Function to get the initials to display. | ||
@@ -57,5 +53,5 @@ */ | ||
}; | ||
type AvatarProps = HTMLUIProps<'span'> & ThemeProps<'Avatar'> & AvatarOptions; | ||
type AvatarProps = HTMLUIProps<"span"> & ThemeProps<"Avatar"> & AvatarOptions & Pick<UseImageProps, "onLoad" | "onError">; | ||
declare const Avatar: _yamada_ui_core.Component<"span", AvatarProps>; | ||
export { Avatar, AvatarProps, AvatarProvider, useAvatarContext }; |
@@ -109,3 +109,3 @@ "use client" | ||
} = (0, import_core2.omitThemeProps)(mergedProps); | ||
const [isLoading, setIsLoading] = (0, import_react.useState)(true); | ||
const [isLoaded, setIsLoaded] = (0, import_react.useState)(false); | ||
const css = { | ||
@@ -127,3 +127,3 @@ position: "relative", | ||
className: (0, import_utils.cx)("ui-avatar", className), | ||
"data-loading": (0, import_utils.dataAttr)(isLoading), | ||
"data-loaded": (0, import_utils.dataAttr)(isLoaded), | ||
borderRadius, | ||
@@ -142,3 +142,3 @@ rounded, | ||
rounded, | ||
onLoad: (0, import_utils.handlerAll)(onLoad, () => setIsLoading(false)), | ||
onLoad: (0, import_utils.handlerAll)(onLoad, () => setIsLoaded(true)), | ||
onError, | ||
@@ -171,3 +171,3 @@ format, | ||
}) => { | ||
const status = (0, import_image.useImage)({ src, onError, crossOrigin, ignoreFallback }); | ||
const status = (0, import_image.useImage)({ src, onLoad, onError, crossOrigin, ignoreFallback }); | ||
const isLoaded = status === "loaded"; | ||
@@ -190,3 +190,2 @@ const isFallback = !src || !isLoaded; | ||
loading, | ||
onLoad, | ||
referrerPolicy, | ||
@@ -193,0 +192,0 @@ borderRadius, |
@@ -111,3 +111,3 @@ "use client" | ||
} = (0, import_core2.omitThemeProps)(mergedProps); | ||
const [isLoading, setIsLoading] = (0, import_react.useState)(true); | ||
const [isLoaded, setIsLoaded] = (0, import_react.useState)(false); | ||
const css = { | ||
@@ -129,3 +129,3 @@ position: "relative", | ||
className: (0, import_utils.cx)("ui-avatar", className), | ||
"data-loading": (0, import_utils.dataAttr)(isLoading), | ||
"data-loaded": (0, import_utils.dataAttr)(isLoaded), | ||
borderRadius, | ||
@@ -144,3 +144,3 @@ rounded, | ||
rounded, | ||
onLoad: (0, import_utils.handlerAll)(onLoad, () => setIsLoading(false)), | ||
onLoad: (0, import_utils.handlerAll)(onLoad, () => setIsLoaded(true)), | ||
onError, | ||
@@ -173,3 +173,3 @@ format, | ||
}) => { | ||
const status = (0, import_image.useImage)({ src, onError, crossOrigin, ignoreFallback }); | ||
const status = (0, import_image.useImage)({ src, onLoad, onError, crossOrigin, ignoreFallback }); | ||
const isLoaded = status === "loaded"; | ||
@@ -192,3 +192,2 @@ const isFallback = !src || !isLoaded; | ||
loading, | ||
onLoad, | ||
referrerPolicy, | ||
@@ -195,0 +194,0 @@ borderRadius, |
{ | ||
"name": "@yamada-ui/avatar", | ||
"version": "0.3.17", | ||
"version": "0.3.18", | ||
"description": "Yamada UI avatar component", | ||
@@ -38,6 +38,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@yamada-ui/core": "0.12.5", | ||
"@yamada-ui/core": "0.12.6", | ||
"@yamada-ui/utils": "0.3.3", | ||
"@yamada-ui/image": "0.3.16", | ||
"@yamada-ui/icon": "0.3.15" | ||
"@yamada-ui/image": "0.3.17", | ||
"@yamada-ui/icon": "0.3.16" | ||
}, | ||
@@ -44,0 +44,0 @@ "devDependencies": { |
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
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
52630
1587
+ Added@yamada-ui/core@0.12.6(transitive)
+ Added@yamada-ui/icon@0.3.16(transitive)
+ Added@yamada-ui/image@0.3.17(transitive)
+ Added@yamada-ui/use-token@0.3.10(transitive)
- Removed@yamada-ui/core@0.12.5(transitive)
- Removed@yamada-ui/icon@0.3.15(transitive)
- Removed@yamada-ui/image@0.3.16(transitive)
- Removed@yamada-ui/use-token@0.3.9(transitive)
Updated@yamada-ui/core@0.12.6
Updated@yamada-ui/icon@0.3.16
Updated@yamada-ui/image@0.3.17