/** * @fileoverview Carousel primitive — scrollable content carousel with navigation controls. * Built on Embla Carousel. Supports horizontal and vertical orientation, * keyboard navigation, and plugin extensibility. * Part of the Saasflare base component layer. * @module packages/ui/components/ui/carousel * @layer core * * @requires embla-carousel-react — peer dependency. Shipped via the `/carousel` * subpath: `import { Carousel } from "@saasflare/ui/carousel"`. * * @component * @example * import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext } from '@saasflare/ui/carousel'; * * * Slide 1 * Slide 2 * * * * */ import * as React from "react"; import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react"; import { type SaasflareComponentProps } from "../../providers"; import { Button } from "./button"; /** Embla carousel API instance, handed to consumers via the `setApi` prop for imperative control (`scrollTo`, `on`/`off` events, …). */ type CarouselApi = UseEmblaCarouselType[1]; type UseCarouselParameters = Parameters; type CarouselOptions = UseCarouselParameters[0]; type CarouselPlugin = UseCarouselParameters[1]; type CarouselProps = SaasflareComponentProps & { /** Embla Carousel options (loop, align, dragFree, etc.). */ opts?: CarouselOptions; /** Embla Carousel plugins (autoplay, wheel gestures, etc.). */ plugins?: CarouselPlugin; /** Scroll direction of the carousel. Drives Embla's axis. @default "horizontal" */ orientation?: "horizontal" | "vertical"; /** Receives the Embla API instance once initialized, for imperative control. */ setApi?: (api: CarouselApi) => void; }; /** * Carousel root — provides the Embla context and the carousel region. * Owns the design-system axes (`surface`, `radius`, `animated`, `iconWeight`) * and emits the corresponding data attributes on its root element. * * @example * * * Slide 1 * * * * */ declare function Carousel({ orientation, opts, setApi, plugins, className, children, surface, radius, animated, iconWeight, ...props }: Omit, keyof SaasflareComponentProps> & CarouselProps): import("react/jsx-runtime").JSX.Element; /** * Carousel viewport + scroll track. Wraps {@link CarouselItem}s and binds the * Embla ref. Lays items out along the active orientation. */ declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element; /** * A single carousel slide. Renders as a full-basis flex child with * orientation-aware spacing. */ declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element; /** * Navigates to the previous slide. Disabled when there is no previous slide. * Inherits the provider `iconWeight` for its arrow icon. */ declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps): import("react/jsx-runtime").JSX.Element; /** * Navigates to the next slide. Disabled when there is no next slide. * Inherits the provider `iconWeight` for its arrow icon. */ declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps): import("react/jsx-runtime").JSX.Element; export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };