You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
<script lang="ts">
|
|
/**
|
|
* Eidos `Calendar.PrevButton` — composes the system `<IconButton>` (which itself
|
|
* composes `<Button>`) via soma's `child` snippet, instead of styling a bespoke
|
|
* native `<button>`. The back-chevron glyph plus sizing / hover / focus /
|
|
* disabled / a11y all come from the primitive — no duplicated chrome.
|
|
*/
|
|
import { ActiveEidos } from '$uix/eidos';
|
|
import * as Calendar from '$soma/components/calendar';
|
|
import { IconButton } from '$uix/eidos/components/icon-button';
|
|
import { ChevronLeft } from '$uix/eidos/components/icon';
|
|
import type { CalendarPrevButtonProps } from './types';
|
|
|
|
let {
|
|
'aria-label': ariaLabel,
|
|
children: bodyContent,
|
|
...rest
|
|
}: CalendarPrevButtonProps = $props();
|
|
|
|
const eidos = ActiveEidos.require();
|
|
const label = $derived(ariaLabel ?? eidos.langs.ts('#?common.calendar.prev-month|Previous month'));
|
|
</script>
|
|
|
|
<Calendar.PrevButton {...rest}>
|
|
{#snippet child({ props }: { props: Record<string, unknown> })}
|
|
<IconButton {...props} variant="ghost" size="sm" aria-label={label}>
|
|
{#if bodyContent}{@render bodyContent()}{:else}<ChevronLeft />{/if}
|
|
</IconButton>
|
|
{/snippet}
|
|
</Calendar.PrevButton>
|