import EmblaCarousel from 'embla-carousel'; import type { EmblaCarouselType, EmblaOptionsType, EmblaPluginType, } from 'embla-carousel'; export type { EmblaCarouselType, EmblaOptionsType, EmblaPluginType }; /** * Single entry point for creating an Embla engine instance across `@42/core`. * * Centralizing the import means: * - the dependency is referenced from one place (easy to externalize / swap), * - components share a consistent way to spin up the scroll/snap engine, * - tests can mock `embla-carousel` in one spot. * * Embla owns the physics (drag, momentum, snap, loop wrapping, resize, axis); * the consuming controller stays responsible for ARIA, indicators and events. * * @param viewport The clipping element (its first child is the slide container). * @param options Embla options (loop, axis, align, slidesToScroll, dragFree…). * @param plugins Optional Embla plugins. */ export function createEmbla( viewport: HTMLElement, options: EmblaOptionsType = {}, plugins: EmblaPluginType[] = [], ): EmblaCarouselType { return EmblaCarousel(viewport, options, plugins); }