You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
822 B
26 lines
822 B
import { getContext, setContext } from 'svelte';
|
|
import type { CarouselColor, CarouselSize, CarouselVariant } from './types';
|
|
import type { Orientation } from '$soma/components/carousel';
|
|
|
|
/**
|
|
* Eidos-only context: visual concerns shared from the Provider down to
|
|
* sub-parts (prev/next triggers consume `size` + `orientation` so their
|
|
* chevron rotates correctly; indicators consume `size` + `color`).
|
|
*/
|
|
export type CarouselEidosContext = {
|
|
size: CarouselSize;
|
|
variant: CarouselVariant;
|
|
color: CarouselColor;
|
|
orientation: Orientation;
|
|
};
|
|
|
|
const KEY = Symbol('eidos:carousel');
|
|
|
|
export function setCarouselEidosContext(ctx: CarouselEidosContext) {
|
|
setContext(KEY, ctx);
|
|
}
|
|
|
|
export function getCarouselEidosContext(): CarouselEidosContext | undefined {
|
|
return getContext<CarouselEidosContext | undefined>(KEY);
|
|
}
|