chore(web): migration svelte 5 syntax (#13883)

This commit is contained in:
Alex 2024-11-14 08:43:25 -06:00 committed by GitHub
parent 9203a61709
commit 0b3742cf13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
310 changed files with 6435 additions and 4176 deletions

View file

@ -2,13 +2,17 @@
import { t } from 'svelte-i18n';
import Button from './button.svelte';
/**
* Target for the skip link to move focus to.
*/
export let target: string = 'main';
export let text: string = $t('skip_to_content');
interface Props {
/**
* Target for the skip link to move focus to.
*/
target?: string;
text?: string;
}
let isFocused = false;
let { target = 'main', text = $t('skip_to_content') }: Props = $props();
let isFocused = $state(false);
const moveFocus = () => {
const targetEl = document.querySelector<HTMLElement>(target);
@ -20,9 +24,9 @@
<Button
size={'sm'}
rounded="none"
on:click={moveFocus}
on:focus={() => (isFocused = true)}
on:blur={() => (isFocused = false)}
onclick={moveFocus}
onfocus={() => (isFocused = true)}
onblur={() => (isFocused = false)}
>
{text}
</Button>