Files
illusory-iotam/apps/frontend/src/lib/components/ui/carousel/carousel-previous.svelte
user eee31e5b99 Replace front proxy with new SvelteKit frontend app
- Remove the old Hono/Bun proxy server
- Add the new `apps/frontend` SvelteKit scaffold and telemetry hook
2026-03-28 18:12:43 +02:00

39 lines
988 B
Svelte

<script lang="ts">
import ArrowLeftIcon from "@lucide/svelte/icons/arrow-left";
import type { WithoutChildren } from "bits-ui";
import { getEmblaContext } from "./context.js";
import { cn } from "$lib/utils.js";
import { Button, type Props } from "$lib/components/ui/button/index.js";
let {
ref = $bindable(null),
class: className,
variant = "outline",
size = "icon",
...restProps
}: WithoutChildren<Props> = $props();
const emblaCtx = getEmblaContext("<Carousel.Previous/>");
</script>
<Button
data-slot="carousel-previous"
{variant}
{size}
aria-disabled={!emblaCtx.canScrollPrev}
class={cn(
"absolute size-8 rounded-full",
emblaCtx.orientation === "horizontal"
? "-start-12 top-1/2 -translate-y-1/2"
: "start-1/2 -top-12 -translate-x-1/2 rotate-90",
className
)}
onclick={emblaCtx.scrollPrev}
onkeydown={emblaCtx.handleKeyDown}
{...restProps}
bind:ref
>
<ArrowLeftIcon class="size-4" />
<span class="sr-only">Previous slide</span>
</Button>