migrate: convert most components to svelte 5
This commit is contained in:
1 parent
d670f39f0a
commit
10ef4123da
225 files changed
+5441
-3341
No files matched your search
@@ -1,9 +1,19 @@
|
||||
<script lang="ts">
|
||||
import { Material, Popover } from 'mono-svelte'
|
||||
|
||||
export let href: string
|
||||
export let size: keyof typeof sizes = 'medium'
|
||||
export let title: string = ''
|
||||
interface Props {
|
||||
href: string;
|
||||
size?: keyof typeof sizes;
|
||||
title?: string;
|
||||
children?: import('svelte').Snippet;
|
||||
}
|
||||
|
||||
let {
|
||||
href,
|
||||
size = 'medium',
|
||||
title = '',
|
||||
children
|
||||
}: Props = $props();
|
||||
|
||||
const sizes = {
|
||||
large: 'h-24',
|
||||
@@ -13,17 +23,21 @@
|
||||
</script>
|
||||
|
||||
<Popover openOnHover placement="right">
|
||||
<a {href} slot="target">
|
||||
<slot />
|
||||
</a>
|
||||
<Material
|
||||
slot="popover"
|
||||
padding="none"
|
||||
rounding="xl"
|
||||
elevation="medium"
|
||||
class="px-3 py-2 font-medium"
|
||||
>
|
||||
{title}
|
||||
</Material>
|
||||
{#snippet target()}
|
||||
<a {href} >
|
||||
{@render children?.()}
|
||||
</a>
|
||||
{/snippet}
|
||||
{#snippet popover()}
|
||||
<Material
|
||||
|
||||
padding="none"
|
||||
rounding="xl"
|
||||
elevation="medium"
|
||||
class="px-3 py-2 font-medium"
|
||||
>
|
||||
{title}
|
||||
</Material>
|
||||
{/snippet}
|
||||
</Popover>
|
||||
<div class="{sizes[size]} border-l self-center"></div>
|
||||
Reference in new issue
Block a user