2024-06-13 17:36:43 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { Calendar as CalendarPrimitive } from "bits-ui";
|
2025-06-21 21:07:36 +02:00
|
|
|
import ChevronLeftIcon from "@lucide/svelte/icons/chevron-left";
|
|
|
|
|
import { buttonVariants, type ButtonVariant } from "$lib/components/ui/button/index.js";
|
2024-06-13 17:36:43 +02:00
|
|
|
import { cn } from "$lib/utils.js";
|
|
|
|
|
|
2025-06-08 16:32:41 +02:00
|
|
|
let {
|
|
|
|
|
ref = $bindable(null),
|
|
|
|
|
class: className,
|
|
|
|
|
children,
|
2025-06-21 21:07:36 +02:00
|
|
|
variant = "ghost",
|
2025-06-08 16:32:41 +02:00
|
|
|
...restProps
|
2025-06-21 21:07:36 +02:00
|
|
|
}: CalendarPrimitive.PrevButtonProps & {
|
|
|
|
|
variant?: ButtonVariant;
|
|
|
|
|
} = $props();
|
2024-06-13 17:36:43 +02:00
|
|
|
</script>
|
|
|
|
|
|
2025-06-08 16:32:41 +02:00
|
|
|
{#snippet Fallback()}
|
2025-06-21 21:07:36 +02:00
|
|
|
<ChevronLeftIcon class="size-4" />
|
2025-06-08 16:32:41 +02:00
|
|
|
{/snippet}
|
|
|
|
|
|
2024-06-13 17:36:43 +02:00
|
|
|
<CalendarPrimitive.PrevButton
|
2025-06-08 16:32:41 +02:00
|
|
|
bind:ref
|
2024-06-13 17:36:43 +02:00
|
|
|
class={cn(
|
2025-06-21 21:07:36 +02:00
|
|
|
buttonVariants({ variant }),
|
2026-04-06 18:22:01 +02:00
|
|
|
"size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50 rtl:rotate-180",
|
2024-06-13 17:36:43 +02:00
|
|
|
className
|
|
|
|
|
)}
|
2025-06-08 16:32:41 +02:00
|
|
|
{...restProps}
|
2026-04-06 18:22:01 +02:00
|
|
|
>
|
|
|
|
|
{#if children}
|
|
|
|
|
{@render children?.()}
|
|
|
|
|
{:else}
|
|
|
|
|
{@render Fallback()}
|
|
|
|
|
{/if}
|
|
|
|
|
</CalendarPrimitive.PrevButton>
|