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.
svelte-kit-vice/src/uix/eidos/components/carousel/carousel-context.ts

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);
}

Powered by TurnKey Linux.