-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Added icon on project links && Added custom error page && Fixed mys…
…terious vanishing of cursor when out of content height
- Loading branch information
Showing
7 changed files
with
147 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div class={cn("text-sm [&_p]:leading-relaxed", className)} {...$$restProps}> | ||
<slot /> | ||
</div> |
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,21 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import type { HeadingLevel } from "./index.js"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = HTMLAttributes<HTMLHeadingElement> & { | ||
level?: HeadingLevel; | ||
}; | ||
let className: $$Props["class"] = undefined; | ||
export let level: $$Props["level"] = "h5"; | ||
export { className as class }; | ||
</script> | ||
|
||
<svelte:element | ||
this={level} | ||
class={cn("mb-1 font-medium leading-none tracking-tight", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</svelte:element> |
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,17 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { type Variant, alertVariants } from "./index.js"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = HTMLAttributes<HTMLDivElement> & { | ||
variant?: Variant; | ||
}; | ||
let className: $$Props["class"] = undefined; | ||
export let variant: $$Props["variant"] = "default"; | ||
export { className as class }; | ||
</script> | ||
|
||
<div class={cn(alertVariants({ variant }), className)} {...$$restProps} role="alert"> | ||
<slot /> | ||
</div> |
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,33 @@ | ||
import { type VariantProps, tv } from "tailwind-variants"; | ||
|
||
import Root from "./alert.svelte"; | ||
import Description from "./alert-description.svelte"; | ||
import Title from "./alert-title.svelte"; | ||
|
||
export const alertVariants = tv({ | ||
base: "[&>svg]:text-foreground relative w-full rounded-lg border p-4 [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4", | ||
|
||
variants: { | ||
variant: { | ||
default: "bg-background text-foreground", | ||
destructive: | ||
"border-destructive/50 text-destructive text-destructive dark:border-destructive [&>svg]:text-destructive", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
}, | ||
}); | ||
|
||
export type Variant = VariantProps<typeof alertVariants>["variant"]; | ||
export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; | ||
|
||
export { | ||
Root, | ||
Description, | ||
Title, | ||
// | ||
Root as Alert, | ||
Description as AlertDescription, | ||
Title as AlertTitle, | ||
}; |
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,14 @@ | ||
<script lang="ts"> | ||
import * as Alert from '$lib/components/ui/alert'; | ||
import { page } from '$app/stores'; | ||
import { CircleAlert } from 'lucide-svelte'; | ||
</script> | ||
|
||
<Alert.Root> | ||
<CircleAlert class="h-4 w-4" /> | ||
<Alert.Title>Error: {$page.status} - {$page.error?.message || 'Unknown Error'}</Alert.Title> | ||
<Alert.Description> | ||
<p>URL: <code>{$page.url}</code></p> | ||
<p>Timestamp: {new Date().toLocaleString()}</p> | ||
</Alert.Description> | ||
</Alert.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
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