import { BreakpointCustomizable, SelectedAriaAttributes } from '../../types'; export type { CarouselScrollMarkerPosition, CarouselScrollMarkerVariant, } from './CarouselScrollMarker.utils'; export type CarouselAriaAttributes = 'aria-label' | 'aria-labelledby'; export type CarouselVariant = 'single' | 'multi'; export type CarouselNavigationControlsPosition = 'outside' | 'inside'; export type CarouselNavigationControlsVariant = 'filled' | 'inverse'; export type CarouselLayout = 'flex' | 'grid'; export type CarouselNavigationControls = { show?: BreakpointCustomizable; position?: BreakpointCustomizable; variant?: BreakpointCustomizable; previousButtonProps?: { [key: `data-${string}`]: string | undefined; }; nextButtonProps?: { [key: `data-${string}`]: string | undefined; }; }; export type CarouselGridArea = 'extended' | 'main'; export declare const CAROUSEL_PEEK_SIZE = "10%"; export declare const CAROUSEL_TAP_ZONE_IGNORED_TARGETS: string; export declare const isPointInsideElement: (element: HTMLElement | null, x: number, y: number) => boolean; export type CarouselTranslations = { /** * Label for the "previous item" navigation button. * * ICU MessageFormat. Placeholder: `{count}` = number of items to scroll. * * @example '{count, plural, one {Previous item} other {Previous {count} items}}' */ previousItem: string; /** * Label for the "next item" navigation button. * * ICU MessageFormat. Placeholder: `{count}` = number of items to scroll. * * @example '{count, plural, one {Next item} other {Next {count} items}}' */ nextItem: string; /** * Aria label for each item. * * Placeholders: `{current}` = item number, `{total}` = total items. */ itemLabel: string; /** * Scroll marker label. * * Placeholders: `{current}` = item number, `{total}` = total items. */ goToItem: string; /** Aria label for the scroll marker tablist. */ itemNavigation: string; /** * Live region announcement for single variant. * * Placeholders: `{current}` = item number, `{total}` = total items. */ itemAnnouncement: string; /** * Live region announcement for multi variant (range of visible items). * * ICU MessageFormat. Placeholders: `{count}` = number of visible items, * `{from}` = first visible item, `{to}` = last visible item, `{total}` = total items. * * @example '{count, plural, one {Item {from} of {total}} other {Items {from} to {to} of {total}}}' */ itemRangeAnnouncement: string; }; export declare const DS_CAROUSEL_TRANSLATIONS_EN: CarouselTranslations; export declare const DS_CAROUSEL_TRANSLATIONS_DE: CarouselTranslations; export declare const DS_CAROUSEL_TRANSLATIONS: Record; type ValidationProps = { aria?: SelectedAriaAttributes; childCount?: number; defaultIndex?: number; itemsToScroll?: BreakpointCustomizable; layout?: CarouselLayout; navigationControls?: { show?: BreakpointCustomizable; variant?: BreakpointCustomizable; position?: BreakpointCustomizable; previousButtonProps?: { [key: `data-${string}`]: string | undefined; }; nextButtonProps?: { [key: `data-${string}`]: string | undefined; }; }; peek?: BreakpointCustomizable; variant?: CarouselVariant; }; /** * Validates the given properties of the DSCarousel component for common configuration errors. * This function is intended to be used in development mode. */ export declare const validateCarouselProps: ({ aria, childCount, defaultIndex, itemsToScroll, layout, navigationControls, peek, variant, }: ValidationProps) => void; export type CarouselTranslateFunction = (key: keyof CarouselTranslations, values?: Record) => string; /** * Generates an accessible item label like "1 of 4". */ export declare const getItemLabel: (index: number, total: number, t: CarouselTranslateFunction) => string; /** * Generates an accessible scroll marker label like "Go to item 1 of 4". */ export declare const getScrollMarkerLabel: (index: number, total: number, t: CarouselTranslateFunction) => string; /** * Generates an accessible label for navigation buttons. */ export declare const getNavigationControlsLabel: (direction: "previous" | "next", t: CarouselTranslateFunction, count?: number) => string; /** * Snapshot of Embla's internal scroll engine state. * * We derive this on every Embla event so that React can re-render * based on the current scroll position, visible items, and * boundary conditions (can scroll prev/next). */ export type CarouselEngineState = { /** Index of the currently selected scroll snap point. */ selectedSnap: number; /** Total number of snap points (may differ from item count in multi-item mode). */ snapCount: number; /** Whether scrolling backwards is possible (false at the first snap). */ canScrollPrevious: boolean; /** Whether scrolling forward is possible (false at the last snap). */ canScrollNext: boolean; /** Indexes of items currently within the visible viewport. */ visibleIndexes: number[]; /** Total number of item elements. */ itemCount: number; }; export type UseEmblaCarouselAdapterOptions = { variant: CarouselVariant; defaultIndex: number; direction: 'ltr' | 'rtl'; /** Number of items to scroll per navigation action (matches itemsPerView in multi-item). */ itemsToScroll: number; }; export type UseEmblaCarouselAdapterResult = { /** Callback ref to attach to the viewport element; Embla uses this to observe the container. */ viewportRef: (node: HTMLElement | null) => void; state: CarouselEngineState; scrollPrevious: () => void; scrollNext: () => void; scrollTo: (index: number) => void; }; /** * Adapter hook that wraps Embla Carousel's React binding. * * It translates Embla's imperative API into a declarative React state model * (CarouselEngineState) that the component tree can consume via context. * * Key Embla configuration choices: * - `loop: false`: No infinite scrolling; carousel stops at boundaries. * - `dragFree: false`: Snaps to discrete positions after drag. * - `containScroll: 'trimSnaps'`: Prevents empty space at the end by * removing excess snap points when items don't fill the viewport. * - `skipSnaps: false`: Prevents skipping snap points during fast swipes. * - `align`: 'center' for single-item (centers the active item), * 'start' for multi-item (aligns items to the leading edge). * - `itemsToScroll`: In single-item mode always 1; in multi-item mode * matches the visible itemsPerView so a full "page" of items scrolls at once. */ export declare const useEmblaCarouselAdapter: ({ variant, defaultIndex, direction, itemsToScroll, }: UseEmblaCarouselAdapterOptions) => UseEmblaCarouselAdapterResult;