@rovula/ui 0.1.27 → 0.1.28
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/cjs/bundle.css +12 -0
- package/dist/cjs/bundle.js +2 -2
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/Avatar/Avatar.d.ts +1 -1
- package/dist/cjs/types/components/Avatar/Avatar.stories.d.ts +1 -1
- package/dist/cjs/types/components/Avatar/Avatar.styles.d.ts +1 -0
- package/dist/components/Avatar/Avatar.js +2 -1
- package/dist/components/Avatar/Avatar.styles.js +3 -0
- package/dist/components/Avatar/AvatarBase.js +1 -1
- package/dist/esm/bundle.css +12 -0
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/Avatar/Avatar.d.ts +1 -1
- package/dist/esm/types/components/Avatar/Avatar.stories.d.ts +1 -1
- package/dist/esm/types/components/Avatar/Avatar.styles.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/src/theme/global.css +15 -0
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.styles.ts +4 -1
- package/src/components/Avatar/Avatar.tsx +3 -2
- package/src/components/Avatar/AvatarBase.tsx +3 -3
|
@@ -22,7 +22,7 @@ type AvatarImageProps = {
|
|
|
22
22
|
type: "image";
|
|
23
23
|
} & BaseAvatarProps;
|
|
24
24
|
type AvatarIconProps = {
|
|
25
|
-
icon:
|
|
25
|
+
icon: React.ReactNode;
|
|
26
26
|
type: "icon";
|
|
27
27
|
} & BaseAvatarProps;
|
|
28
28
|
export type AvatarProps = AvatarTextProps | AvatarImageProps | AvatarIconProps;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const avatarVariants: (props?: ({
|
|
2
2
|
size?: "sm" | "md" | "lg" | "xxs" | "xs" | null | undefined;
|
|
3
3
|
rounded?: "none" | "normal" | "full" | null | undefined;
|
|
4
|
+
hasImage?: boolean | null | undefined;
|
|
4
5
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -542,7 +542,7 @@ type AvatarImageProps = {
|
|
|
542
542
|
type: "image";
|
|
543
543
|
} & BaseAvatarProps;
|
|
544
544
|
type AvatarIconProps = {
|
|
545
|
-
icon:
|
|
545
|
+
icon: React.ReactNode;
|
|
546
546
|
type: "icon";
|
|
547
547
|
} & BaseAvatarProps;
|
|
548
548
|
type AvatarProps = AvatarTextProps | AvatarImageProps | AvatarIconProps;
|
|
@@ -7055,6 +7055,11 @@ input[type=number] {
|
|
|
7055
7055
|
background-color: color-mix(in srgb, var(--transparent-warning-8) calc(100% * var(--tw-bg-opacity, 1)), transparent);
|
|
7056
7056
|
}
|
|
7057
7057
|
|
|
7058
|
+
.bg-white {
|
|
7059
|
+
--tw-bg-opacity: 1;
|
|
7060
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
7061
|
+
}
|
|
7062
|
+
|
|
7058
7063
|
.bg-white-transparent-12 {
|
|
7059
7064
|
--tw-bg-opacity: 1;
|
|
7060
7065
|
background-color: color-mix(in srgb, var(--transparent-white-12) calc(100% * var(--tw-bg-opacity, 1)), transparent);
|
|
@@ -7325,6 +7330,16 @@ input[type=number] {
|
|
|
7325
7330
|
stroke: color-mix(in srgb, var(--state-primary-default) calc(100% * 1), transparent);
|
|
7326
7331
|
}
|
|
7327
7332
|
|
|
7333
|
+
.object-cover {
|
|
7334
|
+
-o-object-fit: cover;
|
|
7335
|
+
object-fit: cover;
|
|
7336
|
+
}
|
|
7337
|
+
|
|
7338
|
+
.object-top {
|
|
7339
|
+
-o-object-position: top;
|
|
7340
|
+
object-position: top;
|
|
7341
|
+
}
|
|
7342
|
+
|
|
7328
7343
|
.\!p-0 {
|
|
7329
7344
|
padding: 0px !important;
|
|
7330
7345
|
}
|
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ type AvatarImageProps = {
|
|
|
31
31
|
} & BaseAvatarProps;
|
|
32
32
|
|
|
33
33
|
type AvatarIconProps = {
|
|
34
|
-
icon:
|
|
34
|
+
icon: React.ReactNode;
|
|
35
35
|
type: "icon";
|
|
36
36
|
} & BaseAvatarProps;
|
|
37
37
|
|
|
@@ -61,7 +61,8 @@ const Avatar: React.FC<AvatarProps> = ({
|
|
|
61
61
|
children,
|
|
62
62
|
style,
|
|
63
63
|
}) => {
|
|
64
|
-
const
|
|
64
|
+
const hasImage = !!imageUrl;
|
|
65
|
+
const avatarClassname = avatarVariants({ size, rounded, hasImage });
|
|
65
66
|
|
|
66
67
|
return (
|
|
67
68
|
<AvatarBase className={cn(avatarClassname, className)} style={style}>
|
|
@@ -13,7 +13,7 @@ const AvatarBase = React.forwardRef<
|
|
|
13
13
|
ref={ref}
|
|
14
14
|
className={cn(
|
|
15
15
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
16
|
-
className
|
|
16
|
+
className,
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
@@ -26,7 +26,7 @@ const AvatarImage = React.forwardRef<
|
|
|
26
26
|
>(({ className, ...props }, ref) => (
|
|
27
27
|
<AvatarPrimitive.Image
|
|
28
28
|
ref={ref}
|
|
29
|
-
className={cn("
|
|
29
|
+
className={cn("object-cover object-top h-full w-full", className)}
|
|
30
30
|
{...props}
|
|
31
31
|
/>
|
|
32
32
|
));
|
|
@@ -40,7 +40,7 @@ const AvatarFallback = React.forwardRef<
|
|
|
40
40
|
ref={ref}
|
|
41
41
|
className={cn(
|
|
42
42
|
"flex h-full w-full items-center justify-center rounded-full bg-inherit text-inherit",
|
|
43
|
-
className
|
|
43
|
+
className,
|
|
44
44
|
)}
|
|
45
45
|
{...props}
|
|
46
46
|
/>
|