aria: improve semantics
This commit is contained in:
19 files changed
+175
-172
No files matched your search
@@ -40,14 +40,14 @@
|
||||
clazz,
|
||||
]}
|
||||
>
|
||||
<span class="font-medium text-left">
|
||||
<h3 class="font-medium text-left">
|
||||
{@render children?.()}
|
||||
</span>
|
||||
<hr
|
||||
</h3>
|
||||
<div
|
||||
class={[
|
||||
'flex-1 border-slate-200 dark:border-zinc-800',
|
||||
'flex-1 border-slate-200 dark:border-zinc-800 border-b',
|
||||
!border && 'opacity-0',
|
||||
]}
|
||||
/>
|
||||
></div>
|
||||
{@render action?.()}
|
||||
</div>
|
||||
@@ -63,7 +63,6 @@
|
||||
class="text-inherit dark:text-inherit border-0 border-r p-2"
|
||||
disabled={(cursor?.back == undefined && cursor?.next != undefined) ||
|
||||
page <= 1}
|
||||
data-sveltekit-preload-data="off"
|
||||
>
|
||||
{#snippet suffix()}
|
||||
<Icon src={ChevronLeft} size="24" mini />
|
||||
@@ -95,7 +94,6 @@
|
||||
rounding="none"
|
||||
class="text-inherit dark:text-inherit border-0 border-l p-2"
|
||||
disabled={!hasMore}
|
||||
data-sveltekit-preload-data="off"
|
||||
>
|
||||
{#snippet suffix()}
|
||||
<Icon src={ChevronRight} size="24" mini />
|
||||
|
||||
@@ -35,43 +35,47 @@
|
||||
<svelte:window {onscroll} />
|
||||
|
||||
{@render children?.()}
|
||||
<div
|
||||
class={[
|
||||
'fixed lg:sticky bottom-0 lg:top-0',
|
||||
!dockVisible && 'max-lg:-bottom-24',
|
||||
'max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
|
||||
'w-full z-50 pointer-events-none',
|
||||
]}
|
||||
style="transition: bottom .4s cubic-bezier(0.075, 0.82, 0.165, 1);"
|
||||
>
|
||||
{@render navbar?.({
|
||||
class: [
|
||||
'bg-slate-100/70 dark:bg-zinc-950/90 border-slate-200/50 dark:border-zinc-900',
|
||||
'pointer-events-auto backdrop-blur-xl border lg:border-t-0 lg:border-x-0',
|
||||
'rounded-full lg:rounded-none',
|
||||
],
|
||||
style: '',
|
||||
})}
|
||||
</div>
|
||||
<div class={['content flex-1', settings.newWidth && 'limit-width']}>
|
||||
{@render sidebar?.({
|
||||
class: `hidden md:flex sticky top-0 lg:top-16 left-0 h-max bg-slate-100 dark:bg-zinc-950 z-40 max-h-[calc(100vh-4rem)] min-h-[calc(100vh-4rem)]`,
|
||||
style: 'grid-area: sidebar; width: 100% !important;',
|
||||
})}
|
||||
{@render main?.({
|
||||
class: `w-full bg-slate-50 dark:bg-zinc-925 justify-self-center border-x border-slate-200 dark:border-zinc-900 max-lg:pb-22 pb-3 sm:pb-6`,
|
||||
style: 'grid-area: main',
|
||||
})}
|
||||
{@render suffix?.({
|
||||
class: `max-lg:hidden w-full sticky lg:top-16 h-max max-h-screen overflow-auto left-0 bg-slate-100 dark:bg-zinc-950 z-40`,
|
||||
style: 'grid-area: suffix;',
|
||||
})}
|
||||
<div class="min-h-screen flex flex-col">
|
||||
<div
|
||||
class={[
|
||||
'fixed lg:sticky bottom-0 lg:top-0',
|
||||
!dockVisible && 'max-lg:-bottom-24',
|
||||
'max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
|
||||
'w-full z-50 pointer-events-none',
|
||||
]}
|
||||
style="transition: bottom .4s cubic-bezier(0.075, 0.82, 0.165, 1);"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{@render navbar?.({
|
||||
class: [
|
||||
'bg-slate-100/70 dark:bg-zinc-950/90 border-slate-200/50 dark:border-zinc-900',
|
||||
'pointer-events-auto backdrop-blur-xl border lg:border-t-0 lg:border-x-0',
|
||||
'rounded-full lg:rounded-none',
|
||||
],
|
||||
style: '',
|
||||
})}
|
||||
</div>
|
||||
<div class={['content flex-1', settings.newWidth && 'limit-width']}>
|
||||
{@render sidebar?.({
|
||||
class: `hidden md:flex sticky top-0 lg:top-16 left-0 max-h-[calc(100vh-4rem)] bg-slate-100 dark:bg-zinc-950 z-40`,
|
||||
style: 'grid-area: sidebar; width: 100% !important;',
|
||||
})}
|
||||
{@render main?.({
|
||||
class: `w-full bg-slate-50 dark:bg-zinc-925 justify-self-center border-x border-slate-200 dark:border-zinc-900 max-lg:pb-22 pb-3 sm:pb-6`,
|
||||
style: 'grid-area: main',
|
||||
})}
|
||||
{@render suffix?.({
|
||||
class: `max-lg:hidden w-full sticky lg:top-16 h-max max-h-screen overflow-auto left-0 bg-slate-100 dark:bg-zinc-950 z-40`,
|
||||
style: 'grid-area: suffix;',
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
height: 100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
grid-area: content;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/i18n/translations'
|
||||
|
||||
const sizes = {
|
||||
sm: 'text-2xl',
|
||||
md: 'text-3xl',
|
||||
@@ -25,7 +27,7 @@
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<div
|
||||
<header
|
||||
class={[
|
||||
pageHeader &&
|
||||
`w-[calc(100%+1.5rem)] sm:w-[calc(100%+3rem)]
|
||||
@@ -33,6 +35,7 @@
|
||||
border-b border-slate-200 dark:border-zinc-900 margin z-0`,
|
||||
]}
|
||||
{style}
|
||||
aria-label={$t('aria.element.pageHeader')}
|
||||
>
|
||||
<h1
|
||||
class={[sizes[size], 'flex gap-2 w-full tracking-tight font-medium', clazz]}
|
||||
@@ -44,4 +47,4 @@
|
||||
{@render extended?.()}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</header>
|
||||
@@ -32,6 +32,7 @@
|
||||
size="md"
|
||||
rounding="xl"
|
||||
class="flex flex-row gap-2 items-center"
|
||||
aria-label={$t('aria.sidebar.accounts')}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Avatar
|
||||
|
||||
@@ -35,7 +35,11 @@
|
||||
let { style = '', class: clazz = '' }: Props = $props()
|
||||
</script>
|
||||
|
||||
<nav class={['flex flex-col overflow-auto gap-1', clazz]} {style}>
|
||||
<nav
|
||||
aria-label={$t('aria.sidebar.title')}
|
||||
class={['flex flex-col overflow-auto gap-1', clazz]}
|
||||
{style}
|
||||
>
|
||||
<ProfileSelection profiles={profile.meta.profiles} />
|
||||
<EndPlaceholder size="xs">{$t('profile.profile')}</EndPlaceholder>
|
||||
{#if profile.current?.jwt}
|
||||
|
||||
Reference in new issue
Block a user