diff --git a/package.json b/package.json index 436fe6a0..f1064d13 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "files": [ "dist" ], - "main": "dist/index.cjs", - "module": "dist/index.js", + "main": "./dist/index.cjs", + "module": "./dist/index.js", "exports": { ".": { "import": "./dist/index.es.js", diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx new file mode 100644 index 00000000..0f162496 --- /dev/null +++ b/src/components/ui/avatar.tsx @@ -0,0 +1,48 @@ +"use client" + +import * as React from "react" +import * as AvatarPrimitive from "@radix-ui/react-avatar" + +import { cn } from "@/lib/utils" + +export const Avatar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +Avatar.displayName = AvatarPrimitive.Root.displayName + +export const AvatarImage = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarImage.displayName = AvatarPrimitive.Image.displayName + +export const AvatarFallback = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName diff --git a/src/index.ts b/src/index.ts index 4ccde67d..7ab746b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,3 +15,4 @@ export { SheetTitle, SheetDescription, } from '@/components/ui/sheet' +export { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' diff --git a/src/showroom/components/avatar.tsx b/src/showroom/components/avatar.tsx new file mode 100644 index 00000000..58ec509d --- /dev/null +++ b/src/showroom/components/avatar.tsx @@ -0,0 +1,31 @@ +import { + Avatar, + AvatarFallback, + AvatarImage, +} from '@/components/ui/avatar' +import { Header } from '../header' +import { Code } from '../code' + +export function AvatarExample() { + return <> +
Avatar
+ +
+ + + ELE + +
+ + + + TT + +`} /> + +}