@eintrek/erp-theme 1.4.7 → 1.4.8
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/components/ui/avatar.d.ts +1 -1
- package/dist/index.esm.js +7 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +11 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AvatarImage({ className, src, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export { Avatar, AvatarFallback, AvatarImage };
|
package/dist/index.esm.js
CHANGED
|
@@ -163,8 +163,13 @@ function AspectRatio({ ...props }) {
|
|
|
163
163
|
function Avatar({ className, ...props }) {
|
|
164
164
|
return (jsx(AvatarPrimitive.Root, { "data-slot": "avatar", className: cn$1("relative flex size-8 shrink-0 overflow-hidden rounded-full", className), ...props }));
|
|
165
165
|
}
|
|
166
|
-
function AvatarImage({ className, ...props }) {
|
|
167
|
-
|
|
166
|
+
function AvatarImage({ className, src, ...props }) {
|
|
167
|
+
// Empty/undefined src still mounts an <img> in some browsers and shows a
|
|
168
|
+
// broken-image glyph over AvatarFallback (e.g. a black "N" badge). Skip it.
|
|
169
|
+
if (src == null || src === "") {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
return (jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", src: src, className: cn$1("aspect-square size-full", className), ...props }));
|
|
168
173
|
}
|
|
169
174
|
function AvatarFallback({ className, ...props }) {
|
|
170
175
|
return (jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn$1("bg-muted flex size-full items-center justify-center rounded-full", className), ...props }));
|