mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-20 00:54:19 +02:00
working on the frontend
This commit is contained in:
16
web/src/lib/components/ui/avatar/avatar-fallback.svelte
Normal file
16
web/src/lib/components/ui/avatar/avatar-fallback.svelte
Normal file
@@ -0,0 +1,16 @@
|
||||
<script lang="ts">
|
||||
import {Avatar as AvatarPrimitive} from "bits-ui";
|
||||
import {cn} from "$lib/utils.js";
|
||||
|
||||
let {
|
||||
class: className,
|
||||
ref = $bindable(null),
|
||||
...restProps
|
||||
}: AvatarPrimitive.FallbackProps = $props();
|
||||
</script>
|
||||
|
||||
<AvatarPrimitive.Fallback
|
||||
{...restProps}
|
||||
bind:ref
|
||||
class={cn("bg-muted flex size-full items-center justify-center", className)}
|
||||
/>
|
||||
20
web/src/lib/components/ui/avatar/avatar-image.svelte
Normal file
20
web/src/lib/components/ui/avatar/avatar-image.svelte
Normal file
@@ -0,0 +1,20 @@
|
||||
<script lang="ts">
|
||||
import {Avatar as AvatarPrimitive} from "bits-ui";
|
||||
import {cn} from "$lib/utils.js";
|
||||
|
||||
let {
|
||||
class: className,
|
||||
src,
|
||||
alt,
|
||||
ref = $bindable(null),
|
||||
...restProps
|
||||
}: AvatarPrimitive.ImageProps = $props();
|
||||
</script>
|
||||
|
||||
<AvatarPrimitive.Image
|
||||
{...restProps}
|
||||
{alt}
|
||||
bind:ref
|
||||
class={cn("aspect-square size-full", className)}
|
||||
{src}
|
||||
/>
|
||||
18
web/src/lib/components/ui/avatar/avatar.svelte
Normal file
18
web/src/lib/components/ui/avatar/avatar.svelte
Normal file
@@ -0,0 +1,18 @@
|
||||
<script lang="ts">
|
||||
import {Avatar as AvatarPrimitive} from "bits-ui";
|
||||
import {cn} from "$lib/utils.js";
|
||||
|
||||
let {
|
||||
class: className,
|
||||
ref = $bindable(null),
|
||||
loadingStatus = $bindable("loading"),
|
||||
...restProps
|
||||
}: AvatarPrimitive.RootProps = $props();
|
||||
</script>
|
||||
|
||||
<AvatarPrimitive.Root
|
||||
{...restProps}
|
||||
bind:loadingStatus
|
||||
bind:ref
|
||||
class={cn("relative flex size-10 shrink-0 overflow-hidden rounded-full", className)}
|
||||
/>
|
||||
13
web/src/lib/components/ui/avatar/index.ts
Normal file
13
web/src/lib/components/ui/avatar/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import Root from "./avatar.svelte";
|
||||
import Image from "./avatar-image.svelte";
|
||||
import Fallback from "./avatar-fallback.svelte";
|
||||
|
||||
export {
|
||||
Root,
|
||||
Image,
|
||||
Fallback,
|
||||
//
|
||||
Root as Avatar,
|
||||
Image as AvatarImage,
|
||||
Fallback as AvatarFallback,
|
||||
};
|
||||
Reference in New Issue
Block a user