Files
gpx.studio/website/src/lib/components/ui/calendar/calendar-prev-button.svelte

32 lines
777 B
Svelte
Raw Normal View History

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 }),
"size-(--cell-size) select-none bg-transparent p-0 disabled:opacity-50 rtl:rotate-180",
2024-06-13 17:36:43 +02:00
className
)}
2025-06-08 16:32:41 +02:00
children={children || Fallback}
{...restProps}
/>