@szum-tech/design-system
Version:
Szum-Tech design system with tailwindcss support
37 lines (34 loc) • 1.12 kB
JavaScript
import { cn } from './chunk-ZD2QRAOX.js';
import { Avatar as Avatar$1 } from 'radix-ui';
import { cva } from 'class-variance-authority';
import { jsx } from 'react/jsx-runtime';
var avatarCva = cva("relative flex shrink-0 overflow-hidden rounded text-gray-100", {
variants: {
size: {
sm: "size-6 text-xs",
md: "size-10 text-lg",
lg: "size-14 text-2xl"
}
},
defaultVariants: {
size: "md"
}
});
function Avatar({ className, size = "md", ref, ...props }) {
const avatarStyles = avatarCva({ size });
return /* @__PURE__ */ jsx(Avatar$1.Root, { ref, className: cn(avatarStyles, className), ...props });
}
function AvatarImage({ className, ref, ...props }) {
return /* @__PURE__ */ jsx(Avatar$1.Image, { ref, className: cn("aspect-square h-full w-full", className), ...props });
}
function AvatarFallback({ className, ref, ...props }) {
return /* @__PURE__ */ jsx(
Avatar$1.Fallback,
{
ref,
className: cn("flex h-full w-full items-center justify-center bg-gray-600", className),
...props
}
);
}
export { Avatar, AvatarFallback, AvatarImage };