-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add light mode and mode switcher
- Loading branch information
Showing
7 changed files
with
124 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script lang="ts"> | ||
import { Avatar as AvatarPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/ui/utils.js"; | ||
type $$Props = AvatarPrimitive.FallbackProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<AvatarPrimitive.Fallback | ||
class={cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</AvatarPrimitive.Fallback> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script lang="ts"> | ||
import { Avatar as AvatarPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/ui/utils.js"; | ||
type $$Props = AvatarPrimitive.ImageProps; | ||
let className: $$Props["class"] = undefined; | ||
export let src: $$Props["src"] = undefined; | ||
export let alt: $$Props["alt"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<AvatarPrimitive.Image | ||
{src} | ||
{alt} | ||
class={cn("aspect-square h-full w-full", className)} | ||
{...$$restProps} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script lang="ts"> | ||
import { Avatar as AvatarPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/ui/utils.js"; | ||
type $$Props = AvatarPrimitive.Props; | ||
let className: $$Props["class"] = undefined; | ||
export let delayMs: $$Props["delayMs"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<AvatarPrimitive.Root | ||
{delayMs} | ||
class={cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</AvatarPrimitive.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters