@mantine-vue/carousel 2.4.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/Carousel.context.ts","../src/Carousel.module.css","../src/CarouselSlide.ts","../src/CarouselVariables.ts","../src/get-chevron-rotation.ts","../src/get-indicator-navigation.ts","../src/Carousel.ts"],"sourcesContent":["import { createSafeContext } from '@mantine-vue/core'\n\nexport interface CarouselContextValue {\n getStyles: (selector: string, options?: Record<string, any>) => Record<string, any>\n orientation: 'horizontal' | 'vertical' | undefined\n}\n\nexport const [provideCarouselContext, useCarouselContext] = createSafeContext<CarouselContextValue>(\n 'Carousel component was not found in tree',\n)\n",".root {\n --carousel-height: auto;\n position: relative;\n}\n\n.viewport {\n height: var(--carousel-height);\n overflow: hidden;\n\n &[data-type='container'] {\n container: carousel / inline-size;\n }\n}\n\n.container {\n display: flex;\n flex-direction: row;\n height: var(--carousel-height);\n\n :where([data-include-gap-in-size]) & {\n &:where([data-orientation='vertical']) {\n margin-bottom: calc(var(--carousel-slide-gap) * -1);\n }\n\n &:where([data-orientation='horizontal']) {\n margin-inline-end: calc(var(--carousel-slide-gap) * -1);\n }\n }\n\n &:where([data-orientation='vertical']) {\n flex-direction: column;\n }\n}\n\n.controls {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: space-between;\n z-index: 1;\n pointer-events: none;\n\n &:where([data-orientation='vertical']) {\n inset-inline-start: calc(50% - var(--carousel-control-size) / 2);\n top: 0;\n bottom: 0;\n flex-direction: column;\n padding: var(--carousel-controls-offset) 0;\n }\n\n &:where([data-orientation='horizontal']) {\n inset-inline-start: 0;\n inset-inline-end: 0;\n top: calc(50% - var(--carousel-control-size) / 2);\n flex-direction: row;\n padding: 0 var(--carousel-controls-offset);\n }\n}\n\n.control {\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: var(--carousel-control-size);\n min-height: var(--carousel-control-size);\n border-radius: var(--carousel-control-size);\n pointer-events: all;\n background-color: var(--mantine-color-white);\n color: var(--mantine-color-black);\n box-shadow: var(--mantine-shadow-md);\n border: 1px solid var(--mantine-color-gray-3);\n transition: opacity 100ms ease;\n\n @mixin where-light {\n opacity: 0.85;\n }\n\n @mixin where-dark {\n opacity: 0.65;\n }\n\n @mixin hover {\n opacity: 1;\n }\n}\n\n.indicators {\n position: absolute;\n display: flex;\n justify-content: center;\n gap: 8px;\n pointer-events: none;\n\n &:where([data-orientation='vertical']) {\n bottom: 0;\n top: 0;\n inset-inline-end: var(--mantine-spacing-md);\n flex-direction: column;\n }\n\n &:where([data-orientation='horizontal']) {\n bottom: var(--mantine-spacing-md);\n inset-inline-start: 0;\n inset-inline-end: 0;\n flex-direction: row;\n }\n}\n\n.indicator {\n pointer-events: all;\n border-radius: var(--mantine-radius-xl);\n box-shadow: var(--mantine-shadow-sm);\n opacity: 0.6;\n background-color: var(--mantine-color-white);\n\n @mixin hover {\n opacity: 1;\n }\n\n &:where([data-active]) {\n opacity: 1;\n }\n\n &:where([data-orientation='vertical']) {\n width: 5px;\n height: 25px;\n }\n\n &:where([data-orientation='horizontal']) {\n width: 25px;\n height: 5px;\n }\n}\n\n.slide {\n position: relative;\n flex: 0 0 var(--carousel-slide-size, 100%);\n\n .root:where([data-include-gap-in-size]) & {\n &:where([data-orientation='vertical']) {\n padding-bottom: var(--carousel-slide-gap);\n }\n\n &:where([data-orientation='horizontal']) {\n padding-inline-end: var(--carousel-slide-gap);\n }\n }\n\n .root:where(:not([data-include-gap-in-size])) & {\n &:where([data-orientation='vertical']) {\n margin-bottom: var(--carousel-slide-gap);\n }\n\n &:where([data-orientation='horizontal']) {\n margin-inline-end: var(--carousel-slide-gap);\n }\n }\n}\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, withBoxProps } from '@mantine-vue/core'\nimport { useCarouselContext } from './Carousel.context'\nimport classes from './Carousel.module.css'\n\nexport type CarouselSlideStylesNames = 'slide'\n\nexport interface CarouselSlideProps {\n classNames?: any\n styles?: any\n mod?: any\n}\n\nconst CarouselSlideBaseComponent = defineComponent({\n name: 'CarouselSlide',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n mod: { type: [Object, Array] as PropType<any>, default: undefined },\n },\n setup(props, { attrs, slots }) {\n const ctx = useCarouselContext()\n\n return () =>\n h(\n Box,\n {\n mod: [{ orientation: ctx.orientation }, props.mod],\n role: 'group',\n 'aria-roledescription': 'slide',\n 'aria-label': 'Carousel slide',\n ...attrs,\n ...ctx.getStyles('slide', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n slots,\n )\n },\n})\n\nexport const CarouselSlide = Object.assign(withBoxProps(CarouselSlideBaseComponent), { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport {\n filterProps,\n getBaseValue,\n getSortedBreakpoints,\n getSpacing,\n InlineStyles,\n keys,\n px,\n rem,\n useMantineTheme,\n} from '@mantine-vue/core'\n\ntype StyleProp<T> = T | Partial<Record<string, T>>\n\nfunction isObject(value: unknown): value is Record<string, any> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nconst sharedProps = {\n selector: { type: String, required: true },\n slideSize: {\n type: [String, Number, Object] as PropType<StyleProp<string | number>>,\n default: undefined,\n },\n slideGap: {\n type: [String, Number, Object] as PropType<StyleProp<string | number>>,\n default: undefined,\n },\n}\n\nexport const CarouselVariables = defineComponent({\n name: 'CarouselVariables',\n props: sharedProps,\n setup(props) {\n const theme = useMantineTheme()\n\n return () => {\n const baseStyles = filterProps({\n '--carousel-slide-gap': getSpacing(getBaseValue(props.slideGap)),\n '--carousel-slide-size': rem(getBaseValue(props.slideSize)),\n })\n\n const queries = keys(theme.value.breakpoints).reduce<Record<string, Record<string, any>>>(\n (acc, breakpoint) => {\n acc[breakpoint] = acc[breakpoint] ?? {}\n\n if (isObject(props.slideGap) && props.slideGap[breakpoint] !== undefined) {\n acc[breakpoint]['--carousel-slide-gap'] = getSpacing(props.slideGap[breakpoint])\n }\n\n if (isObject(props.slideSize) && props.slideSize[breakpoint] !== undefined) {\n acc[breakpoint]['--carousel-slide-size'] = rem(props.slideSize[breakpoint])\n }\n\n return acc\n },\n {},\n )\n\n const media = getSortedBreakpoints(theme.value.breakpoints).reduce<\n Record<string, Record<string, any>>\n >((acc, item) => {\n if (keys(queries[item.breakpoint] ?? {}).length > 0) {\n acc[`(min-width: ${theme.value.breakpoints[item.breakpoint]})`] = queries[item.breakpoint]\n }\n\n return acc\n }, {})\n\n return h(InlineStyles, { selector: props.selector!, styles: baseStyles, media })\n }\n },\n})\n\nfunction getBreakpoints(values: unknown) {\n return isObject(values) ? keys(values).filter((breakpoint) => breakpoint !== 'base') : []\n}\n\nfunction sortBreakpoints(breakpoints: string[]) {\n return breakpoints.sort((a, b) => px(a) - px(b))\n}\n\nexport const CarouselContainerVariables = defineComponent({\n name: 'CarouselContainerVariables',\n props: sharedProps,\n setup(props) {\n return () => {\n const baseStyles = filterProps({\n '--carousel-slide-gap': getSpacing(getBaseValue(props.slideGap)),\n '--carousel-slide-size': rem(getBaseValue(props.slideSize)),\n })\n\n const breakpoints = sortBreakpoints(\n Array.from(\n new Set([...getBreakpoints(props.slideGap), ...getBreakpoints(props.slideSize)]),\n ),\n )\n\n const container = breakpoints.reduce<Record<string, Record<string, any>>>(\n (acc, breakpoint) => {\n const key = `carousel (min-width: ${breakpoint})`\n acc[key] = {}\n\n if (isObject(props.slideGap) && props.slideGap[breakpoint] !== undefined) {\n acc[key]['--carousel-slide-gap'] = getSpacing(props.slideGap[breakpoint])\n }\n\n if (isObject(props.slideSize) && props.slideSize[breakpoint] !== undefined) {\n acc[key]['--carousel-slide-size'] = rem(props.slideSize[breakpoint])\n }\n\n return acc\n },\n {},\n )\n\n return h(InlineStyles, { selector: props.selector!, styles: baseStyles, container })\n }\n },\n})\n","// Ported verbatim from @mantine/carousel/src/get-chevron-rotation.ts – pure function, no\n// React/Vue specifics.\nexport interface GetChevronRotationOptions {\n dir: 'rtl' | 'ltr'\n orientation: 'horizontal' | 'vertical' | undefined\n direction: 'next' | 'previous'\n}\n\nexport function getChevronRotation({ dir, orientation, direction }: GetChevronRotationOptions) {\n if (direction === 'previous') {\n return orientation === 'horizontal' ? 90 * (dir === 'ltr' ? 1 : -1) : -180\n }\n\n return orientation === 'horizontal' ? 90 * (dir === 'ltr' ? -1 : 1) : 0\n}\n","// Extracted so the wrap-around index math can be unit tested without mounting a component.\nexport function getNextIndicatorIndex(index: number, total: number): number {\n return index < total - 1 ? index + 1 : 0\n}\n\nexport function getPreviousIndicatorIndex(index: number, total: number): number {\n return index > 0 ? index - 1 : total - 1\n}\n\n// Note: when `max < min` (e.g. an empty carousel), this clamps to `max`, not `min`.\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max)\n}\n","import {\n Comment,\n computed,\n defineComponent,\n h,\n ref,\n watch,\n type DefineComponent,\n type PropType,\n type VNode,\n} from 'vue'\nimport emblaCarouselVue from 'embla-carousel-vue'\nimport type { EmblaCarouselType, EmblaOptionsType, EmblaPluginType } from 'embla-carousel'\nimport { useId } from '@mantine-vue/hooks'\nimport {\n Box,\n createVarsResolver,\n getSpacing,\n rem,\n useDirection,\n useProps,\n useStyles,\n UnstyledButton,\n VisuallyHidden,\n withBoxProps,\n AccordionChevron,\n} from '@mantine-vue/core'\nimport { provideCarouselContext } from './Carousel.context'\nimport { CarouselSlide } from './CarouselSlide'\nimport { CarouselContainerVariables, CarouselVariables } from './CarouselVariables'\nimport { getChevronRotation } from './get-chevron-rotation'\nimport { clamp, getNextIndicatorIndex, getPreviousIndicatorIndex } from './get-indicator-navigation'\nimport classes from './Carousel.module.css'\n\nexport type CarouselStylesNames =\n | 'slide'\n | 'root'\n | 'viewport'\n | 'container'\n | 'controls'\n | 'control'\n | 'indicators'\n | 'indicator'\n\nexport interface CarouselProps {\n /** Options passed down to embla carousel */\n emblaOptions?: EmblaOptionsType\n /** Called when next slide is shown */\n onNextSlide?: () => void\n /** Called when previous slider is shown */\n onPreviousSlide?: () => void\n /** Called with slide index when slide changes */\n onSlideChange?: (index: number) => void\n /** Get embla API as ref */\n getEmblaApi?: (embla: EmblaCarouselType) => void\n /** Props passed down to next control */\n nextControlProps?: Record<string, any>\n /** Props passed down to previous control */\n previousControlProps?: Record<string, any>\n /** Controls size of the next and previous controls @default 26 */\n controlSize?: string | number\n /** Controls position of the next and previous controls, key of `theme.spacing` or any valid CSS value @default 'sm' */\n controlsOffset?: string | number\n /** Controls slide width based on viewport width @default '100%' */\n slideSize?: string | number | Record<string, string | number>\n /** Key of theme.spacing or number to set gap between slides */\n slideGap?: string | number | Record<string, string | number>\n /** Carousel orientation @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical'\n /** Determines type of queries used for responsive styles @default 'media' */\n type?: 'media' | 'container'\n /** Slides container `height`, required for vertical orientation */\n height?: string | number\n /** Determines whether gap between slides should be treated as part of the slide size @default true */\n includeGapInSize?: boolean\n /** Index of initial slide */\n initialSlide?: number\n /** Determines whether next/previous controls should be displayed @default true */\n withControls?: boolean\n /** Determines whether indicators should be displayed @default false */\n withIndicators?: boolean\n /** A list of embla plugins */\n plugins?: EmblaPluginType[]\n /** Icon of the next control */\n nextControlIcon?: any\n /** Icon of the previous control */\n previousControlIcon?: any\n /** Determines whether arrow key should switch slides @default true */\n withKeyboardEvents?: boolean\n /** Function to get props for indicator button */\n getIndicatorProps?: (index: number) => Record<string, any>\n id?: string\n classNames?: any\n styles?: any\n vars?: any\n unstyled?: boolean\n mod?: any\n}\n\nconst defaultProps = {\n controlSize: 26,\n controlsOffset: 'sm',\n slideSize: '100%',\n slideGap: 0,\n orientation: 'horizontal',\n includeGapInSize: true,\n initialSlide: 0,\n withControls: true,\n withIndicators: false,\n withKeyboardEvents: true,\n type: 'media',\n} as const\n\nconst defaultEmblaOptions: EmblaOptionsType = {\n align: 'center',\n loop: false,\n slidesToScroll: 1,\n dragFree: false,\n inViewThreshold: 0,\n skipSnaps: false,\n containScroll: 'trimSnaps',\n}\n\nconst varsResolver = createVarsResolver<any>((_, { height, controlSize, controlsOffset }) => ({\n root: {\n '--carousel-height': rem(height),\n '--carousel-control-size': rem(controlSize),\n '--carousel-controls-offset': getSpacing(controlsOffset),\n },\n}))\n\nfunction useRandomClassName() {\n return `__mantine-vue-carousel-${Math.random().toString(36).slice(2, 9)}`\n}\n\nfunction countRealSlides(nodes: VNode[] | undefined): number {\n if (!nodes) {\n return 0\n }\n\n return nodes.filter((node) => node.type !== Comment).length\n}\n\nconst CarouselBaseComponent = defineComponent({\n name: 'Carousel',\n inheritAttrs: false,\n props: {\n emblaOptions: { type: Object as PropType<EmblaOptionsType>, default: undefined },\n onNextSlide: { type: Function as PropType<() => void>, default: undefined },\n onPreviousSlide: { type: Function as PropType<() => void>, default: undefined },\n onSlideChange: { type: Function as PropType<(index: number) => void>, default: undefined },\n getEmblaApi: {\n type: Function as PropType<(embla: EmblaCarouselType) => void>,\n default: undefined,\n },\n nextControlProps: { type: Object as PropType<Record<string, any>>, default: undefined },\n previousControlProps: { type: Object as PropType<Record<string, any>>, default: undefined },\n controlSize: { type: [String, Number], default: undefined },\n controlsOffset: { type: [String, Number], default: undefined },\n slideSize: { type: [String, Number, Object], default: undefined },\n slideGap: { type: [String, Number, Object], default: undefined },\n orientation: { type: String as PropType<'horizontal' | 'vertical'>, default: undefined },\n type: { type: String as PropType<'media' | 'container'>, default: undefined },\n height: { type: [String, Number], default: undefined },\n includeGapInSize: { type: Boolean, default: undefined },\n initialSlide: { type: Number, default: undefined },\n withControls: { type: Boolean, default: undefined },\n withIndicators: { type: Boolean, default: undefined },\n plugins: { type: Array as PropType<EmblaPluginType[]>, default: undefined },\n nextControlIcon: { type: null, default: undefined },\n previousControlIcon: { type: null, default: undefined },\n withKeyboardEvents: { type: Boolean, default: undefined },\n getIndicatorProps: {\n type: Function as PropType<(index: number) => Record<string, any>>,\n default: undefined,\n },\n id: { type: String, default: undefined },\n mod: { type: [Object, Array] as PropType<any>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps('Carousel', defaultProps, rawProps)\n\n const getStyles = useStyles({\n name: 'Carousel',\n classes,\n props,\n get className() {\n return attrs.class\n },\n get style() {\n return attrs.style as any\n },\n get classNames() {\n return props.classNames as any\n },\n get styles() {\n return props.styles as any\n },\n get unstyled() {\n return props.unstyled\n },\n get vars() {\n return props.vars as any\n },\n varsResolver,\n })\n\n const _id = useId(props.id)\n const responsiveClassName = useRandomClassName()\n const { dir } = useDirection()\n\n const emblaOptionsRef = computed<EmblaOptionsType>(() => ({\n axis: props.orientation === 'horizontal' ? 'x' : 'y',\n direction: props.orientation === 'horizontal' ? dir.value : undefined,\n startIndex: props.initialSlide,\n ...defaultEmblaOptions,\n ...props.emblaOptions,\n }))\n const pluginsRef = computed(() => props.plugins ?? [])\n\n const [emblaNode, embla] = emblaCarouselVue(emblaOptionsRef, pluginsRef)\n\n const selected = ref(0)\n const slidesCount = ref(0)\n const slotSlideCount = ref(0)\n\n const handleScroll = (index: number) => {\n embla.value?.scrollTo(index)\n }\n\n const handleSelect = () => {\n const instance = embla.value\n if (!instance) {\n return\n }\n const slide = instance.selectedScrollSnap()\n const changed = slide !== selected.value\n selected.value = slide\n if (changed) {\n props.onSlideChange?.(slide)\n }\n }\n\n const handlePrevious = () => {\n embla.value?.scrollPrev()\n props.onPreviousSlide?.()\n }\n\n const handleNext = () => {\n embla.value?.scrollNext()\n props.onNextSlide?.()\n }\n\n const handleKeydown = (event: KeyboardEvent) => {\n if (!props.withKeyboardEvents) {\n return\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault()\n handleNext()\n }\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n handlePrevious()\n }\n\n if (event.key === 'Home') {\n event.preventDefault()\n embla.value?.scrollTo(0)\n }\n\n if (event.key === 'End') {\n event.preventDefault()\n embla.value?.scrollTo(embla.value.scrollSnapList().length - 1)\n }\n }\n\n const handleIndicatorKeyDown = (event: KeyboardEvent, index: number) => {\n const isHorizontal = props.orientation === 'horizontal'\n const nextKey = isHorizontal ? 'ArrowRight' : 'ArrowDown'\n const prevKey = isHorizontal ? 'ArrowLeft' : 'ArrowUp'\n const parent = (event.currentTarget as HTMLElement | null)?.parentElement\n\n if (event.key === nextKey) {\n event.preventDefault()\n const nextIndex = getNextIndicatorIndex(index, slidesCount.value)\n handleScroll(nextIndex)\n ;(parent?.children[nextIndex] as HTMLElement | undefined)?.focus()\n }\n\n if (event.key === prevKey) {\n event.preventDefault()\n const prevIndex = getPreviousIndicatorIndex(index, slidesCount.value)\n handleScroll(prevIndex)\n ;(parent?.children[prevIndex] as HTMLElement | undefined)?.focus()\n }\n\n if (event.key === 'Home') {\n event.preventDefault()\n handleScroll(0)\n ;(parent?.children[0] as HTMLElement | undefined)?.focus()\n }\n\n if (event.key === 'End') {\n event.preventDefault()\n handleScroll(slidesCount.value - 1)\n ;(parent?.children[slidesCount.value - 1] as HTMLElement | undefined)?.focus()\n }\n }\n\n watch(\n embla,\n (instance, _prev, onCleanup) => {\n if (!instance) {\n return\n }\n\n props.getEmblaApi?.(instance)\n handleSelect()\n slidesCount.value = instance.scrollSnapList().length\n instance.on('select', handleSelect)\n\n onCleanup(() => {\n instance.off('select', handleSelect)\n })\n },\n { immediate: true },\n )\n\n watch([slotSlideCount, () => props.emblaOptions?.slidesToScroll], ([childrenCount]) => {\n const instance = embla.value\n if (!instance) {\n return\n }\n\n instance.reInit()\n slidesCount.value = instance.scrollSnapList().length\n selected.value = clamp(selected.value, 0, childrenCount - 1)\n })\n\n provideCarouselContext({\n getStyles,\n get orientation() {\n return props.orientation\n },\n } as any)\n\n return () => {\n const canScrollPrev = embla.value?.canScrollPrev() || false\n const canScrollNext = embla.value?.canScrollNext() || false\n\n const defaultSlot = slots.default?.()\n slotSlideCount.value = countRealSlides(defaultSlot)\n\n const indicators = Array(slidesCount.value)\n .fill(0)\n .map((_, index) =>\n h(UnstyledButton, {\n ...getStyles('indicator'),\n key: index,\n role: 'tab',\n 'aria-label': `Go to slide ${index + 1}`,\n 'aria-selected': index === selected.value,\n tabindex: index === selected.value ? 0 : -1,\n 'data-active': index === selected.value || undefined,\n onClick: () => handleScroll(index),\n onKeydown: (event: KeyboardEvent) => handleIndicatorKeyDown(event, index),\n 'data-orientation': props.orientation,\n onMousedown: (event: Event) => event.preventDefault(),\n ...props.getIndicatorProps?.(index),\n }),\n )\n\n const variablesProps = {\n selector: `.${responsiveClassName}`,\n slideSize: props.slideSize,\n slideGap: props.slideGap,\n }\n\n return [\n props.type === 'container'\n ? h(CarouselContainerVariables, variablesProps)\n : h(CarouselVariables, variablesProps),\n\n h(\n Box,\n {\n role: 'region',\n 'aria-roledescription': 'carousel',\n ...attrs,\n ...getStyles('root', { className: responsiveClassName }),\n id: _id.value,\n mod: [\n { orientation: props.orientation, 'include-gap-in-size': props.includeGapInSize },\n props.mod,\n ],\n onKeydownCapture: handleKeydown,\n },\n () => [\n h(\n VisuallyHidden,\n { role: 'status', 'aria-live': 'polite', 'aria-atomic': 'true' },\n () =>\n slidesCount.value > 0 ? `Slide ${selected.value + 1} of ${slidesCount.value}` : '',\n ),\n\n props.withControls &&\n h('div', { ...getStyles('controls'), 'data-orientation': props.orientation }, [\n h(\n UnstyledButton,\n {\n 'aria-controls': _id.value,\n 'aria-label': 'Previous slide',\n 'aria-disabled': !canScrollPrev,\n 'data-inactive': !canScrollPrev || undefined,\n 'data-type': 'previous',\n tabindex: canScrollPrev ? 0 : -1,\n ...props.previousControlProps,\n ...getStyles('control', {\n className: props.previousControlProps?.className,\n style: props.previousControlProps?.style,\n }),\n onClick: (event: Event) => {\n handlePrevious()\n props.previousControlProps?.onClick?.(event)\n },\n },\n () =>\n typeof props.previousControlIcon !== 'undefined'\n ? props.previousControlIcon\n : h(AccordionChevron, {\n style: {\n transform: `rotate(${getChevronRotation({\n dir: dir.value,\n orientation: props.orientation,\n direction: 'previous',\n })}deg)`,\n },\n }),\n ),\n\n h(\n UnstyledButton,\n {\n 'aria-controls': _id.value,\n 'aria-label': 'Next slide',\n 'aria-disabled': !canScrollNext,\n 'data-inactive': !canScrollNext || undefined,\n 'data-type': 'next',\n tabindex: canScrollNext ? 0 : -1,\n ...getStyles('control', {\n className: props.nextControlProps?.className,\n style: props.nextControlProps?.style,\n }),\n ...props.nextControlProps,\n onClick: (event: Event) => {\n handleNext()\n props.nextControlProps?.onClick?.(event)\n },\n },\n () =>\n typeof props.nextControlIcon !== 'undefined'\n ? props.nextControlIcon\n : h(AccordionChevron, {\n style: {\n transform: `rotate(${getChevronRotation({\n dir: dir.value,\n orientation: props.orientation,\n direction: 'next',\n })}deg)`,\n },\n }),\n ),\n ]),\n\n h('div', { ...getStyles('viewport'), ref: emblaNode, 'data-type': props.type }, [\n h(\n 'div',\n {\n ...getStyles('container', { className: responsiveClassName }),\n 'data-orientation': props.orientation,\n },\n defaultSlot,\n ),\n ]),\n\n props.withIndicators &&\n h(\n 'div',\n {\n ...getStyles('indicators'),\n role: 'tablist',\n 'aria-label': 'Slides',\n 'data-orientation': props.orientation,\n },\n indicators,\n ),\n ],\n ),\n ]\n }\n },\n})\n\nexport const Carousel: DefineComponent<CarouselProps> & {\n classes: typeof classes\n varsResolver: typeof varsResolver\n Slide: typeof CarouselSlide\n} = Object.assign(withBoxProps(CarouselBaseComponent) as DefineComponent<CarouselProps>, {\n classes,\n varsResolver,\n Slide: CarouselSlide,\n})\n"],"mappings":";;;;;AAOA,IAAa,CAAC,wBAAwB,sBAAsB,kBAC1D,0CACF;;;;;;;;;;;;;AEIA,IAAM,6BAA6B,gBAAgB;CACjD,MAAM;CACN,cAAc;CACd,OAAO;EACL,YAAY;GAAE,MAAM,CAAC,QAAQ,QAAQ;GAAG,SAAS,KAAA;EAAU;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5B,GACA,UACF;GACJ,CACF,CACF;EACF;CACF;AACF,CAAC;AAED,IAAa,WAIT,OAAO,OAAO,aAAa,qBAAqB,GAAqC;CACvF,SAAA;CACA;CACA,OAAO;AACT,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/Carousel.context.ts","../src/components/CarouselVariables/CarouselVariables.utils.ts","../src/components/CarouselVariables/CarouselContainerVariables.vue","../src/components/CarouselVariables/CarouselContainerVariables.vue","../src/components/CarouselVariables/CarouselVariables.vue","../src/components/CarouselVariables/CarouselVariables.vue","../src/get-chevron-rotation.ts","../src/get-indicator-navigation.ts","../src/Carousel.module.css","../src/components/Carousel/Carousel.vue","../src/components/Carousel/Carousel.vue","../src/components/CarouselSlide/CarouselSlide.vue","../src/components/CarouselSlide/CarouselSlide.vue","../src/components/CarouselSlide/index.ts","../src/components/Carousel/index.ts"],"sourcesContent":["import { createSafeContext } from '@mantine-vue/core'\n\nexport interface CarouselContextValue {\n getStyles: (selector: string, options?: Record<string, any>) => Record<string, any>\n orientation: 'horizontal' | 'vertical' | undefined\n}\n\nexport const [provideCarouselContext, useCarouselContext] = createSafeContext<CarouselContextValue>(\n 'Carousel component was not found in tree',\n)\n","import { filterProps, getBaseValue, getSpacing, rem } from '@mantine-vue/core'\nimport type { CarouselVariablesProps } from './CarouselVariables.types'\nexport const isObject = (value: unknown): value is Record<string, any> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\nexport const getBaseStyles = (props: CarouselVariablesProps) =>\n filterProps({\n '--carousel-slide-gap': getSpacing(getBaseValue(props.slideGap)),\n '--carousel-slide-size': rem(getBaseValue(props.slideSize)),\n })\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { InlineStyles, keys, getSpacing, px, rem } from '@mantine-vue/core'\nimport { getBaseStyles, isObject } from './CarouselVariables.utils'\nimport type { CarouselVariablesProps } from './CarouselVariables.types'\ndefineOptions({ name: 'CarouselContainerVariables' })\nconst props = defineProps<CarouselVariablesProps>()\nconst styles = computed(() => getBaseStyles(props))\nconst container = computed(() => {\n const getBreakpoints = (value: unknown) =>\n isObject(value) ? keys(value).filter((key) => key !== 'base') : []\n const breakpoints = [\n ...new Set([...getBreakpoints(props.slideGap), ...getBreakpoints(props.slideSize)]),\n ].sort((a, b) => px(a) - px(b))\n return breakpoints.reduce<Record<string, Record<string, any>>>((result, breakpoint) => {\n const values: Record<string, any> = {}\n if (isObject(props.slideGap) && props.slideGap[breakpoint] !== undefined)\n values['--carousel-slide-gap'] = getSpacing(props.slideGap[breakpoint])\n if (isObject(props.slideSize) && props.slideSize[breakpoint] !== undefined)\n values['--carousel-slide-size'] = rem(props.slideSize[breakpoint])\n result[`carousel (min-width: ${breakpoint})`] = values\n return result\n }, {})\n})\n</script>\n<template>\n <InlineStyles :selector=\"props.selector\" :styles=\"styles\" :container=\"container\" />\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { InlineStyles, keys, getSpacing, px, rem } from '@mantine-vue/core'\nimport { getBaseStyles, isObject } from './CarouselVariables.utils'\nimport type { CarouselVariablesProps } from './CarouselVariables.types'\ndefineOptions({ name: 'CarouselContainerVariables' })\nconst props = defineProps<CarouselVariablesProps>()\nconst styles = computed(() => getBaseStyles(props))\nconst container = computed(() => {\n const getBreakpoints = (value: unknown) =>\n isObject(value) ? keys(value).filter((key) => key !== 'base') : []\n const breakpoints = [\n ...new Set([...getBreakpoints(props.slideGap), ...getBreakpoints(props.slideSize)]),\n ].sort((a, b) => px(a) - px(b))\n return breakpoints.reduce<Record<string, Record<string, any>>>((result, breakpoint) => {\n const values: Record<string, any> = {}\n if (isObject(props.slideGap) && props.slideGap[breakpoint] !== undefined)\n values['--carousel-slide-gap'] = getSpacing(props.slideGap[breakpoint])\n if (isObject(props.slideSize) && props.slideSize[breakpoint] !== undefined)\n values['--carousel-slide-size'] = rem(props.slideSize[breakpoint])\n result[`carousel (min-width: ${breakpoint})`] = values\n return result\n }, {})\n})\n</script>\n<template>\n <InlineStyles :selector=\"props.selector\" :styles=\"styles\" :container=\"container\" />\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getSortedBreakpoints,\n InlineStyles,\n keys,\n getSpacing,\n rem,\n useMantineTheme,\n} from '@mantine-vue/core'\nimport { getBaseStyles, isObject } from './CarouselVariables.utils'\nimport type { CarouselVariablesProps } from './CarouselVariables.types'\ndefineOptions({ name: 'CarouselVariables' })\nconst props = defineProps<CarouselVariablesProps>()\nconst theme = useMantineTheme()\nconst styles = computed(() => getBaseStyles(props))\nconst media = computed(() => {\n const queries = keys(theme.value.breakpoints).reduce<Record<string, Record<string, any>>>(\n (result, breakpoint) => {\n const values: Record<string, any> = {}\n if (isObject(props.slideGap) && props.slideGap[breakpoint] !== undefined)\n values['--carousel-slide-gap'] = getSpacing(props.slideGap[breakpoint])\n if (isObject(props.slideSize) && props.slideSize[breakpoint] !== undefined)\n values['--carousel-slide-size'] = rem(props.slideSize[breakpoint])\n result[breakpoint] = values\n return result\n },\n {},\n )\n return getSortedBreakpoints(theme.value.breakpoints).reduce<Record<string, Record<string, any>>>(\n (result, item) => {\n if (keys(queries[item.breakpoint] ?? {}).length)\n result[`(min-width: ${theme.value.breakpoints[item.breakpoint]})`] =\n queries[item.breakpoint]\n return result\n },\n {},\n )\n})\n</script>\n<template><InlineStyles :selector=\"props.selector\" :styles=\"styles\" :media=\"media\" /></template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n getSortedBreakpoints,\n InlineStyles,\n keys,\n getSpacing,\n rem,\n useMantineTheme,\n} from '@mantine-vue/core'\nimport { getBaseStyles, isObject } from './CarouselVariables.utils'\nimport type { CarouselVariablesProps } from './CarouselVariables.types'\ndefineOptions({ name: 'CarouselVariables' })\nconst props = defineProps<CarouselVariablesProps>()\nconst theme = useMantineTheme()\nconst styles = computed(() => getBaseStyles(props))\nconst media = computed(() => {\n const queries = keys(theme.value.breakpoints).reduce<Record<string, Record<string, any>>>(\n (result, breakpoint) => {\n const values: Record<string, any> = {}\n if (isObject(props.slideGap) && props.slideGap[breakpoint] !== undefined)\n values['--carousel-slide-gap'] = getSpacing(props.slideGap[breakpoint])\n if (isObject(props.slideSize) && props.slideSize[breakpoint] !== undefined)\n values['--carousel-slide-size'] = rem(props.slideSize[breakpoint])\n result[breakpoint] = values\n return result\n },\n {},\n )\n return getSortedBreakpoints(theme.value.breakpoints).reduce<Record<string, Record<string, any>>>(\n (result, item) => {\n if (keys(queries[item.breakpoint] ?? {}).length)\n result[`(min-width: ${theme.value.breakpoints[item.breakpoint]})`] =\n queries[item.breakpoint]\n return result\n },\n {},\n )\n})\n</script>\n<template><InlineStyles :selector=\"props.selector\" :styles=\"styles\" :media=\"media\" /></template>\n","// Ported verbatim from @mantine/carousel/src/get-chevron-rotation.ts – pure function, no\n// React/Vue specifics.\nexport interface GetChevronRotationOptions {\n dir: 'rtl' | 'ltr'\n orientation: 'horizontal' | 'vertical' | undefined\n direction: 'next' | 'previous'\n}\n\nexport function getChevronRotation({ dir, orientation, direction }: GetChevronRotationOptions) {\n if (direction === 'previous') {\n return orientation === 'horizontal' ? 90 * (dir === 'ltr' ? 1 : -1) : -180\n }\n\n return orientation === 'horizontal' ? 90 * (dir === 'ltr' ? -1 : 1) : 0\n}\n","// Extracted so the wrap-around index math can be unit tested without mounting a component.\nexport function getNextIndicatorIndex(index: number, total: number): number {\n return index < total - 1 ? index + 1 : 0\n}\n\nexport function getPreviousIndicatorIndex(index: number, total: number): number {\n return index > 0 ? index - 1 : total - 1\n}\n\n// Note: when `max < min` (e.g. an empty carousel), this clamps to `max`, not `min`.\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max)\n}\n",".root {\n --carousel-height: auto;\n position: relative;\n}\n\n.viewport {\n height: var(--carousel-height);\n overflow: hidden;\n\n &[data-type='container'] {\n container: carousel / inline-size;\n }\n}\n\n.container {\n display: flex;\n flex-direction: row;\n height: var(--carousel-height);\n\n :where([data-include-gap-in-size]) & {\n &:where([data-orientation='vertical']) {\n margin-bottom: calc(var(--carousel-slide-gap) * -1);\n }\n\n &:where([data-orientation='horizontal']) {\n margin-inline-end: calc(var(--carousel-slide-gap) * -1);\n }\n }\n\n &:where([data-orientation='vertical']) {\n flex-direction: column;\n }\n}\n\n.controls {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: space-between;\n z-index: 1;\n pointer-events: none;\n\n &:where([data-orientation='vertical']) {\n inset-inline-start: calc(50% - var(--carousel-control-size) / 2);\n top: 0;\n bottom: 0;\n flex-direction: column;\n padding: var(--carousel-controls-offset) 0;\n }\n\n &:where([data-orientation='horizontal']) {\n inset-inline-start: 0;\n inset-inline-end: 0;\n top: calc(50% - var(--carousel-control-size) / 2);\n flex-direction: row;\n padding: 0 var(--carousel-controls-offset);\n }\n}\n\n.control {\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: var(--carousel-control-size);\n min-height: var(--carousel-control-size);\n border-radius: var(--carousel-control-size);\n pointer-events: all;\n background-color: var(--mantine-color-white);\n color: var(--mantine-color-black);\n box-shadow: var(--mantine-shadow-md);\n border: 1px solid var(--mantine-color-gray-3);\n transition: opacity 100ms ease;\n\n @mixin where-light {\n opacity: 0.85;\n }\n\n @mixin where-dark {\n opacity: 0.65;\n }\n\n @mixin hover {\n opacity: 1;\n }\n}\n\n.indicators {\n position: absolute;\n display: flex;\n justify-content: center;\n gap: 8px;\n pointer-events: none;\n\n &:where([data-orientation='vertical']) {\n bottom: 0;\n top: 0;\n inset-inline-end: var(--mantine-spacing-md);\n flex-direction: column;\n }\n\n &:where([data-orientation='horizontal']) {\n bottom: var(--mantine-spacing-md);\n inset-inline-start: 0;\n inset-inline-end: 0;\n flex-direction: row;\n }\n}\n\n.indicator {\n pointer-events: all;\n border-radius: var(--mantine-radius-xl);\n box-shadow: var(--mantine-shadow-sm);\n opacity: 0.6;\n background-color: var(--mantine-color-white);\n\n @mixin hover {\n opacity: 1;\n }\n\n &:where([data-active]) {\n opacity: 1;\n }\n\n &:where([data-orientation='vertical']) {\n width: 5px;\n height: 25px;\n }\n\n &:where([data-orientation='horizontal']) {\n width: 25px;\n height: 5px;\n }\n}\n\n.slide {\n position: relative;\n flex: 0 0 var(--carousel-slide-size, 100%);\n\n .root:where([data-include-gap-in-size]) & {\n &:where([data-orientation='vertical']) {\n padding-bottom: var(--carousel-slide-gap);\n }\n\n &:where([data-orientation='horizontal']) {\n padding-inline-end: var(--carousel-slide-gap);\n }\n }\n\n .root:where(:not([data-include-gap-in-size])) & {\n &:where([data-orientation='vertical']) {\n margin-bottom: var(--carousel-slide-gap);\n }\n\n &:where([data-orientation='horizontal']) {\n margin-inline-end: var(--carousel-slide-gap);\n }\n }\n}\n","<script lang=\"ts\">\nimport { createVarsResolver, getSpacing, rem } from '@mantine-vue/core'\nconst varsResolver = createVarsResolver<any>((_, { height, controlSize, controlsOffset }) => ({\n root: {\n '--carousel-height': rem(height),\n '--carousel-control-size': rem(controlSize),\n '--carousel-controls-offset': getSpacing(controlsOffset),\n },\n}))\nexport { varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { Comment, computed, ref, useAttrs, useSlots, watch, type VNode } from 'vue'\nimport emblaCarouselVue from 'embla-carousel-vue'\nimport type { EmblaOptionsType } from 'embla-carousel'\nimport {\n AccordionChevron,\n Box,\n UnstyledButton,\n VisuallyHidden,\n useDirection,\n useProps,\n useStyles,\n} from '@mantine-vue/core'\nimport { assignRef, useId } from '@mantine-vue/hooks'\nimport { provideCarouselContext } from '../../Carousel.context'\nimport CarouselContainerVariables from '../CarouselVariables/CarouselContainerVariables.vue'\nimport CarouselVariables from '../CarouselVariables/CarouselVariables.vue'\nimport { getChevronRotation } from '../../get-chevron-rotation'\nimport {\n clamp,\n getNextIndicatorIndex,\n getPreviousIndicatorIndex,\n} from '../../get-indicator-navigation'\nimport type { CarouselEmits, CarouselProps } from './Carousel.types'\nimport classes from '../../Carousel.module.css'\n\ndefineOptions({ name: 'Carousel', inheritAttrs: false })\nconst rawProps = withDefaults(defineProps<CarouselProps>(), {\n controlSize: 26,\n controlsOffset: 'sm',\n slideSize: '100%',\n slideGap: 0,\n orientation: 'horizontal',\n includeGapInSize: true,\n initialSlide: 0,\n withControls: true,\n withIndicators: false,\n withKeyboardEvents: true,\n type: 'media',\n})\nconst props = useProps('Carousel', null, rawProps)\nconst emit = defineEmits<CarouselEmits>()\nconst attrs = useAttrs()\nconst slots = useSlots()\nconst getStyles = useStyles({\n name: 'Carousel',\n classes,\n props,\n className: attrs.class,\n style: attrs.style as any,\n classNames: props.classNames,\n styles: props.styles,\n unstyled: props.unstyled,\n vars: props.vars,\n varsResolver,\n})\nconst id = useId(props.id)\nconst responsiveClassName = `__mantine-vue-carousel-${Math.random().toString(36).slice(2, 9)}`\nconst { dir } = useDirection()\nconst defaultEmblaOptions: EmblaOptionsType = {\n align: 'center',\n loop: false,\n slidesToScroll: 1,\n dragFree: false,\n inViewThreshold: 0,\n skipSnaps: false,\n containScroll: 'trimSnaps',\n}\nconst emblaOptions = computed<EmblaOptionsType>(() => ({\n axis: props.orientation === 'horizontal' ? 'x' : 'y',\n direction: props.orientation === 'horizontal' ? dir.value : undefined,\n startIndex: props.initialSlide,\n ...defaultEmblaOptions,\n ...props.emblaOptions,\n}))\nconst plugins = computed(() => props.plugins ?? [])\nconst [emblaNode, embla] = emblaCarouselVue(emblaOptions, plugins)\nconst selected = ref(0)\nconst slidesCount = ref(0)\nconst slotSlideCount = ref(0)\nconst canScrollPrev = computed(() => (selected.value >= 0 && embla.value?.canScrollPrev()) || false)\nconst canScrollNext = computed(() => (selected.value >= 0 && embla.value?.canScrollNext()) || false)\nconst variablesProps = computed(() => ({\n selector: `.${responsiveClassName}`,\n slideSize: props.slideSize,\n slideGap: props.slideGap,\n}))\n\nfunction countRealSlides(nodes: VNode[]) {\n return nodes.filter((node) => node.type !== Comment).length\n}\nfunction renderSlides() {\n const nodes = slots.default?.() ?? []\n slotSlideCount.value = countRealSlides(nodes)\n return nodes\n}\nfunction scrollTo(index: number) {\n embla.value?.scrollTo(index)\n}\nfunction select() {\n const instance = embla.value\n if (!instance) return\n const slide = instance.selectedScrollSnap()\n const changed = slide !== selected.value\n selected.value = slide\n if (changed) emit('slide-change', slide)\n}\nfunction previous() {\n embla.value?.scrollPrev()\n emit('previous-slide')\n}\nfunction next() {\n embla.value?.scrollNext()\n emit('next-slide')\n}\nfunction keydown(event: KeyboardEvent) {\n if (!props.withKeyboardEvents) return\n if (event.key === 'ArrowRight') {\n event.preventDefault()\n next()\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n previous()\n }\n if (event.key === 'Home') {\n event.preventDefault()\n scrollTo(0)\n }\n if (event.key === 'End') {\n event.preventDefault()\n scrollTo((embla.value?.scrollSnapList().length ?? 1) - 1)\n }\n}\nfunction indicatorKeydown(event: KeyboardEvent, index: number) {\n const nextKey = props.orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown'\n const previousKey = props.orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp'\n const parent = (event.currentTarget as HTMLElement).parentElement\n let target: number | null = null\n if (event.key === nextKey) target = getNextIndicatorIndex(index, slidesCount.value)\n if (event.key === previousKey) target = getPreviousIndicatorIndex(index, slidesCount.value)\n if (event.key === 'Home') target = 0\n if (event.key === 'End') target = slidesCount.value - 1\n if (target !== null) {\n event.preventDefault()\n scrollTo(target)\n ;(parent?.children[target] as HTMLElement | undefined)?.focus()\n }\n}\nfunction indicatorAttrs(index: number) {\n return {\n ...getStyles('indicator'),\n role: 'tab',\n 'aria-label': `Go to slide ${index + 1}`,\n 'aria-selected': index === selected.value,\n tabindex: index === selected.value ? 0 : -1,\n 'data-active': index === selected.value || undefined,\n 'data-orientation': props.orientation,\n onClick: () => scrollTo(index),\n onKeydown: (event: KeyboardEvent) => indicatorKeydown(event, index),\n onMousedown: (event: Event) => event.preventDefault(),\n ...props.getIndicatorProps?.(index),\n }\n}\nfunction previousAttrs() {\n return {\n 'aria-controls': id.value,\n 'aria-label': 'Previous slide',\n 'aria-disabled': !canScrollPrev.value,\n 'data-inactive': !canScrollPrev.value || undefined,\n 'data-type': 'previous',\n tabindex: canScrollPrev.value ? 0 : -1,\n ...props.previousControlProps,\n ...getStyles('control', {\n className: props.previousControlProps?.className,\n style: props.previousControlProps?.style,\n }),\n onClick: (event: Event) => {\n previous()\n props.previousControlProps?.onClick?.(event)\n },\n }\n}\nfunction nextAttrs() {\n return {\n 'aria-controls': id.value,\n 'aria-label': 'Next slide',\n 'aria-disabled': !canScrollNext.value,\n 'data-inactive': !canScrollNext.value || undefined,\n 'data-type': 'next',\n tabindex: canScrollNext.value ? 0 : -1,\n ...getStyles('control', {\n className: props.nextControlProps?.className,\n style: props.nextControlProps?.style,\n }),\n ...props.nextControlProps,\n onClick: (event: Event) => {\n next()\n props.nextControlProps?.onClick?.(event)\n },\n }\n}\nconst renderPreviousIcon = () => props.previousControlIcon\nconst renderNextIcon = () => props.nextControlIcon\n\nwatch(\n embla,\n (instance, _previous, onCleanup) => {\n if (!instance) return\n emit('embla-api-ready', instance)\n select()\n slidesCount.value = instance.scrollSnapList().length\n instance.on('select', select)\n onCleanup(() => instance.off('select', select))\n },\n { immediate: true },\n)\nwatch([slotSlideCount, () => props.emblaOptions?.slidesToScroll], ([childrenCount]) => {\n const instance = embla.value\n if (!instance) return\n instance.reInit()\n slidesCount.value = instance.scrollSnapList().length\n selected.value = clamp(selected.value, 0, childrenCount - 1)\n})\nprovideCarouselContext({\n getStyles,\n get orientation() {\n return props.orientation\n },\n} as any)\n\nconst rootElement = ref<Element | null>(null)\n\nconst setRootRef = (node: Element | null) => {\n rootElement.value = node\n assignRef(props.rootRef, node)\n}\n\ndefineExpose({ embla, rootElement })\n</script>\n\n<template>\n <CarouselContainerVariables v-if=\"props.type === 'container'\" v-bind=\"variablesProps\" />\n <CarouselVariables v-else v-bind=\"variablesProps\" />\n <Box\n :rootRef=\"setRootRef\"\n v-bind=\"{\n role: 'region',\n 'aria-roledescription': 'carousel',\n ...attrs,\n ...getStyles('root', { className: responsiveClassName }),\n }\"\n :id=\"id\"\n :mod=\"[\n { orientation: props.orientation, 'include-gap-in-size': props.includeGapInSize },\n props.mod,\n ]\"\n @keydown.capture=\"keydown\"\n >\n <VisuallyHidden role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ slidesCount > 0 ? `Slide ${selected + 1} of ${slidesCount}` : '' }}\n </VisuallyHidden>\n <div\n v-if=\"props.withControls\"\n v-bind=\"getStyles('controls')\"\n :data-orientation=\"props.orientation\"\n >\n <UnstyledButton v-bind=\"previousAttrs()\">\n <component v-if=\"props.previousControlIcon !== undefined\" :is=\"renderPreviousIcon\" />\n <AccordionChevron\n v-else\n :style=\"{\n transform: `rotate(${getChevronRotation({ dir, orientation: props.orientation, direction: 'previous' })}deg)`,\n }\"\n />\n </UnstyledButton>\n <UnstyledButton v-bind=\"nextAttrs()\">\n <component v-if=\"props.nextControlIcon !== undefined\" :is=\"renderNextIcon\" />\n <AccordionChevron\n v-else\n :style=\"{\n transform: `rotate(${getChevronRotation({ dir, orientation: props.orientation, direction: 'next' })}deg)`,\n }\"\n />\n </UnstyledButton>\n </div>\n <div ref=\"emblaNode\" v-bind=\"getStyles('viewport')\" :data-type=\"props.type\">\n <div\n v-bind=\"getStyles('container', { className: responsiveClassName })\"\n :data-orientation=\"props.orientation\"\n >\n <component :is=\"renderSlides\" />\n </div>\n </div>\n <div\n v-if=\"props.withIndicators\"\n v-bind=\"getStyles('indicators')\"\n role=\"tablist\"\n aria-label=\"Slides\"\n :data-orientation=\"props.orientation\"\n >\n <UnstyledButton\n v-for=\"index in slidesCount\"\n :key=\"index - 1\"\n v-bind=\"indicatorAttrs(index - 1)\"\n />\n </div>\n </Box>\n</template>\n","<script lang=\"ts\">\nimport { createVarsResolver, getSpacing, rem } from '@mantine-vue/core'\nconst varsResolver = createVarsResolver<any>((_, { height, controlSize, controlsOffset }) => ({\n root: {\n '--carousel-height': rem(height),\n '--carousel-control-size': rem(controlSize),\n '--carousel-controls-offset': getSpacing(controlsOffset),\n },\n}))\nexport { varsResolver }\n</script>\n\n<script setup lang=\"ts\">\nimport { Comment, computed, ref, useAttrs, useSlots, watch, type VNode } from 'vue'\nimport emblaCarouselVue from 'embla-carousel-vue'\nimport type { EmblaOptionsType } from 'embla-carousel'\nimport {\n AccordionChevron,\n Box,\n UnstyledButton,\n VisuallyHidden,\n useDirection,\n useProps,\n useStyles,\n} from '@mantine-vue/core'\nimport { assignRef, useId } from '@mantine-vue/hooks'\nimport { provideCarouselContext } from '../../Carousel.context'\nimport CarouselContainerVariables from '../CarouselVariables/CarouselContainerVariables.vue'\nimport CarouselVariables from '../CarouselVariables/CarouselVariables.vue'\nimport { getChevronRotation } from '../../get-chevron-rotation'\nimport {\n clamp,\n getNextIndicatorIndex,\n getPreviousIndicatorIndex,\n} from '../../get-indicator-navigation'\nimport type { CarouselEmits, CarouselProps } from './Carousel.types'\nimport classes from '../../Carousel.module.css'\n\ndefineOptions({ name: 'Carousel', inheritAttrs: false })\nconst rawProps = withDefaults(defineProps<CarouselProps>(), {\n controlSize: 26,\n controlsOffset: 'sm',\n slideSize: '100%',\n slideGap: 0,\n orientation: 'horizontal',\n includeGapInSize: true,\n initialSlide: 0,\n withControls: true,\n withIndicators: false,\n withKeyboardEvents: true,\n type: 'media',\n})\nconst props = useProps('Carousel', null, rawProps)\nconst emit = defineEmits<CarouselEmits>()\nconst attrs = useAttrs()\nconst slots = useSlots()\nconst getStyles = useStyles({\n name: 'Carousel',\n classes,\n props,\n className: attrs.class,\n style: attrs.style as any,\n classNames: props.classNames,\n styles: props.styles,\n unstyled: props.unstyled,\n vars: props.vars,\n varsResolver,\n})\nconst id = useId(props.id)\nconst responsiveClassName = `__mantine-vue-carousel-${Math.random().toString(36).slice(2, 9)}`\nconst { dir } = useDirection()\nconst defaultEmblaOptions: EmblaOptionsType = {\n align: 'center',\n loop: false,\n slidesToScroll: 1,\n dragFree: false,\n inViewThreshold: 0,\n skipSnaps: false,\n containScroll: 'trimSnaps',\n}\nconst emblaOptions = computed<EmblaOptionsType>(() => ({\n axis: props.orientation === 'horizontal' ? 'x' : 'y',\n direction: props.orientation === 'horizontal' ? dir.value : undefined,\n startIndex: props.initialSlide,\n ...defaultEmblaOptions,\n ...props.emblaOptions,\n}))\nconst plugins = computed(() => props.plugins ?? [])\nconst [emblaNode, embla] = emblaCarouselVue(emblaOptions, plugins)\nconst selected = ref(0)\nconst slidesCount = ref(0)\nconst slotSlideCount = ref(0)\nconst canScrollPrev = computed(() => (selected.value >= 0 && embla.value?.canScrollPrev()) || false)\nconst canScrollNext = computed(() => (selected.value >= 0 && embla.value?.canScrollNext()) || false)\nconst variablesProps = computed(() => ({\n selector: `.${responsiveClassName}`,\n slideSize: props.slideSize,\n slideGap: props.slideGap,\n}))\n\nfunction countRealSlides(nodes: VNode[]) {\n return nodes.filter((node) => node.type !== Comment).length\n}\nfunction renderSlides() {\n const nodes = slots.default?.() ?? []\n slotSlideCount.value = countRealSlides(nodes)\n return nodes\n}\nfunction scrollTo(index: number) {\n embla.value?.scrollTo(index)\n}\nfunction select() {\n const instance = embla.value\n if (!instance) return\n const slide = instance.selectedScrollSnap()\n const changed = slide !== selected.value\n selected.value = slide\n if (changed) emit('slide-change', slide)\n}\nfunction previous() {\n embla.value?.scrollPrev()\n emit('previous-slide')\n}\nfunction next() {\n embla.value?.scrollNext()\n emit('next-slide')\n}\nfunction keydown(event: KeyboardEvent) {\n if (!props.withKeyboardEvents) return\n if (event.key === 'ArrowRight') {\n event.preventDefault()\n next()\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n previous()\n }\n if (event.key === 'Home') {\n event.preventDefault()\n scrollTo(0)\n }\n if (event.key === 'End') {\n event.preventDefault()\n scrollTo((embla.value?.scrollSnapList().length ?? 1) - 1)\n }\n}\nfunction indicatorKeydown(event: KeyboardEvent, index: number) {\n const nextKey = props.orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown'\n const previousKey = props.orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp'\n const parent = (event.currentTarget as HTMLElement).parentElement\n let target: number | null = null\n if (event.key === nextKey) target = getNextIndicatorIndex(index, slidesCount.value)\n if (event.key === previousKey) target = getPreviousIndicatorIndex(index, slidesCount.value)\n if (event.key === 'Home') target = 0\n if (event.key === 'End') target = slidesCount.value - 1\n if (target !== null) {\n event.preventDefault()\n scrollTo(target)\n ;(parent?.children[target] as HTMLElement | undefined)?.focus()\n }\n}\nfunction indicatorAttrs(index: number) {\n return {\n ...getStyles('indicator'),\n role: 'tab',\n 'aria-label': `Go to slide ${index + 1}`,\n 'aria-selected': index === selected.value,\n tabindex: index === selected.value ? 0 : -1,\n 'data-active': index === selected.value || undefined,\n 'data-orientation': props.orientation,\n onClick: () => scrollTo(index),\n onKeydown: (event: KeyboardEvent) => indicatorKeydown(event, index),\n onMousedown: (event: Event) => event.preventDefault(),\n ...props.getIndicatorProps?.(index),\n }\n}\nfunction previousAttrs() {\n return {\n 'aria-controls': id.value,\n 'aria-label': 'Previous slide',\n 'aria-disabled': !canScrollPrev.value,\n 'data-inactive': !canScrollPrev.value || undefined,\n 'data-type': 'previous',\n tabindex: canScrollPrev.value ? 0 : -1,\n ...props.previousControlProps,\n ...getStyles('control', {\n className: props.previousControlProps?.className,\n style: props.previousControlProps?.style,\n }),\n onClick: (event: Event) => {\n previous()\n props.previousControlProps?.onClick?.(event)\n },\n }\n}\nfunction nextAttrs() {\n return {\n 'aria-controls': id.value,\n 'aria-label': 'Next slide',\n 'aria-disabled': !canScrollNext.value,\n 'data-inactive': !canScrollNext.value || undefined,\n 'data-type': 'next',\n tabindex: canScrollNext.value ? 0 : -1,\n ...getStyles('control', {\n className: props.nextControlProps?.className,\n style: props.nextControlProps?.style,\n }),\n ...props.nextControlProps,\n onClick: (event: Event) => {\n next()\n props.nextControlProps?.onClick?.(event)\n },\n }\n}\nconst renderPreviousIcon = () => props.previousControlIcon\nconst renderNextIcon = () => props.nextControlIcon\n\nwatch(\n embla,\n (instance, _previous, onCleanup) => {\n if (!instance) return\n emit('embla-api-ready', instance)\n select()\n slidesCount.value = instance.scrollSnapList().length\n instance.on('select', select)\n onCleanup(() => instance.off('select', select))\n },\n { immediate: true },\n)\nwatch([slotSlideCount, () => props.emblaOptions?.slidesToScroll], ([childrenCount]) => {\n const instance = embla.value\n if (!instance) return\n instance.reInit()\n slidesCount.value = instance.scrollSnapList().length\n selected.value = clamp(selected.value, 0, childrenCount - 1)\n})\nprovideCarouselContext({\n getStyles,\n get orientation() {\n return props.orientation\n },\n} as any)\n\nconst rootElement = ref<Element | null>(null)\n\nconst setRootRef = (node: Element | null) => {\n rootElement.value = node\n assignRef(props.rootRef, node)\n}\n\ndefineExpose({ embla, rootElement })\n</script>\n\n<template>\n <CarouselContainerVariables v-if=\"props.type === 'container'\" v-bind=\"variablesProps\" />\n <CarouselVariables v-else v-bind=\"variablesProps\" />\n <Box\n :rootRef=\"setRootRef\"\n v-bind=\"{\n role: 'region',\n 'aria-roledescription': 'carousel',\n ...attrs,\n ...getStyles('root', { className: responsiveClassName }),\n }\"\n :id=\"id\"\n :mod=\"[\n { orientation: props.orientation, 'include-gap-in-size': props.includeGapInSize },\n props.mod,\n ]\"\n @keydown.capture=\"keydown\"\n >\n <VisuallyHidden role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ slidesCount > 0 ? `Slide ${selected + 1} of ${slidesCount}` : '' }}\n </VisuallyHidden>\n <div\n v-if=\"props.withControls\"\n v-bind=\"getStyles('controls')\"\n :data-orientation=\"props.orientation\"\n >\n <UnstyledButton v-bind=\"previousAttrs()\">\n <component v-if=\"props.previousControlIcon !== undefined\" :is=\"renderPreviousIcon\" />\n <AccordionChevron\n v-else\n :style=\"{\n transform: `rotate(${getChevronRotation({ dir, orientation: props.orientation, direction: 'previous' })}deg)`,\n }\"\n />\n </UnstyledButton>\n <UnstyledButton v-bind=\"nextAttrs()\">\n <component v-if=\"props.nextControlIcon !== undefined\" :is=\"renderNextIcon\" />\n <AccordionChevron\n v-else\n :style=\"{\n transform: `rotate(${getChevronRotation({ dir, orientation: props.orientation, direction: 'next' })}deg)`,\n }\"\n />\n </UnstyledButton>\n </div>\n <div ref=\"emblaNode\" v-bind=\"getStyles('viewport')\" :data-type=\"props.type\">\n <div\n v-bind=\"getStyles('container', { className: responsiveClassName })\"\n :data-orientation=\"props.orientation\"\n >\n <component :is=\"renderSlides\" />\n </div>\n </div>\n <div\n v-if=\"props.withIndicators\"\n v-bind=\"getStyles('indicators')\"\n role=\"tablist\"\n aria-label=\"Slides\"\n :data-orientation=\"props.orientation\"\n >\n <UnstyledButton\n v-for=\"index in slidesCount\"\n :key=\"index - 1\"\n v-bind=\"indicatorAttrs(index - 1)\"\n />\n </div>\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { ref, useAttrs } from 'vue'\nimport { assignRef } from '@mantine-vue/hooks'\nimport { Box } from '@mantine-vue/core'\nimport { useCarouselContext } from '../../Carousel.context'\nimport type { CarouselSlideProps } from './CarouselSlide.types'\n\ndefineOptions({ name: 'CarouselSlide', inheritAttrs: false })\nconst props = defineProps<CarouselSlideProps>()\nconst attrs = useAttrs()\nconst context = useCarouselContext()\n\nconst rootElement = ref<Element | null>(null)\n\nconst setRootRef = (node: Element | null) => {\n rootElement.value = node\n assignRef(props.rootRef, node)\n}\n\ndefineExpose({ rootElement })\n</script>\n\n<template>\n <Box\n :rootRef=\"setRootRef\"\n v-bind=\"{\n ...attrs,\n ...context.getStyles('slide', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n }\"\n :mod=\"[{ orientation: context.orientation }, props.mod]\"\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label=\"Carousel slide\"\n >\n <slot />\n </Box>\n</template>\n","<script setup lang=\"ts\">\nimport { ref, useAttrs } from 'vue'\nimport { assignRef } from '@mantine-vue/hooks'\nimport { Box } from '@mantine-vue/core'\nimport { useCarouselContext } from '../../Carousel.context'\nimport type { CarouselSlideProps } from './CarouselSlide.types'\n\ndefineOptions({ name: 'CarouselSlide', inheritAttrs: false })\nconst props = defineProps<CarouselSlideProps>()\nconst attrs = useAttrs()\nconst context = useCarouselContext()\n\nconst rootElement = ref<Element | null>(null)\n\nconst setRootRef = (node: Element | null) => {\n rootElement.value = node\n assignRef(props.rootRef, node)\n}\n\ndefineExpose({ rootElement })\n</script>\n\n<template>\n <Box\n :rootRef=\"setRootRef\"\n v-bind=\"{\n ...attrs,\n ...context.getStyles('slide', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n }\"\n :mod=\"[{ orientation: context.orientation }, props.mod]\"\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label=\"Carousel slide\"\n >\n <slot />\n </Box>\n</template>\n","import { factory } from '@mantine-vue/core'\nimport CarouselSlideComponent from './CarouselSlide.vue'\nimport type { CarouselSlideFactory } from './CarouselSlide.types'\nimport classes from '../../Carousel.module.css'\nexport const CarouselSlide = factory<CarouselSlideFactory>(CarouselSlideComponent, { classes })\nexport type {\n CarouselSlideFactory,\n CarouselSlideProps,\n CarouselSlideStylesNames,\n} from './CarouselSlide.types'\n","import { factory } from '@mantine-vue/core'\nimport CarouselComponent, { varsResolver } from './Carousel.vue'\nimport type { CarouselFactory } from './Carousel.types'\nimport { CarouselSlide } from '../CarouselSlide'\nimport classes from '../../Carousel.module.css'\nexport const Carousel = factory<CarouselFactory>(CarouselComponent, {\n classes,\n varsResolver,\n Slide: CarouselSlide,\n})\nexport type {\n CarouselCssVariables,\n CarouselEmits,\n CarouselFactory,\n CarouselProps,\n CarouselStylesNames,\n} from './Carousel.types'\n"],"mappings":";;;;;AAOA,IAAa,CAAC,wBAAwB,sBAAsB,kBAC1D,0CACF;;;ACPA,IAAa,YAAY,UACvB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AACrE,IAAa,iBAAiB,UAC5B,YAAY;CACV,wBAAwB,WAAW,aAAa,MAAM,QAAQ,CAAC;CAC/D,yBAAyB,IAAI,aAAa,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A,CAAA;;;;;CEnC+C,GAAwB,EAAE,SAAA,wBAAQ,CAAC;;;ACC9F,IAAa,WAAW,QAAyB,kBAAmB;CAClE,SAAA;CACA;CACA,OAAO;AACT,CAAC"}
@@ -0,0 +1,86 @@
1
+ import type { CarouselSlide } from '../CarouselSlide';
2
+ import type { Ref } from 'vue';
3
+ import type { Factory } from '@mantine-vue/core';
4
+ import type { VueRefTarget } from '@mantine-vue/hooks';
5
+ import type { EmblaCarouselType, EmblaOptionsType, EmblaPluginType } from 'embla-carousel';
6
+ export type CarouselStylesNames = 'slide' | 'root' | 'viewport' | 'container' | 'controls' | 'control' | 'indicators' | 'indicator';
7
+ /** Props accepted by `Carousel`. */
8
+ export interface CarouselProps {
9
+ /** Receives the root DOM node. */
10
+ rootRef?: VueRefTarget<Element>;
11
+ /** Options passed to Embla Carousel. */
12
+ emblaOptions?: EmblaOptionsType;
13
+ /** Props passed down to next control. */
14
+ nextControlProps?: Record<string, any>;
15
+ /** Props passed down to previous control. */
16
+ previousControlProps?: Record<string, any>;
17
+ /** Previous and next control size @default 26 */
18
+ controlSize?: string | number;
19
+ /** Controls offset @default 'sm' */
20
+ controlsOffset?: string | number;
21
+ /** Slide width @default '100%' */
22
+ slideSize?: string | number | Record<string, string | number>;
23
+ /** Gap between slides @default 0 */
24
+ slideGap?: string | number | Record<string, string | number>;
25
+ /** Carousel orientation @default 'horizontal' */
26
+ orientation?: 'horizontal' | 'vertical';
27
+ /** Responsive query type @default 'media' */
28
+ type?: 'media' | 'container';
29
+ /** Carousel height, required for vertical orientation. */
30
+ height?: string | number;
31
+ /** Includes gap in slide size calculations @default true */
32
+ includeGapInSize?: boolean;
33
+ /** Initial slide index @default 0 */
34
+ initialSlide?: number;
35
+ /** Displays previous and next controls @default true */
36
+ withControls?: boolean;
37
+ /** Displays slide indicators @default false */
38
+ withIndicators?: boolean;
39
+ /** A list of Embla plugins. */
40
+ plugins?: EmblaPluginType[];
41
+ /** Icon of the next control */
42
+ nextControlIcon?: any;
43
+ /** Icon of the previous control */
44
+ previousControlIcon?: any;
45
+ /** Enables arrow-key navigation @default true */
46
+ withKeyboardEvents?: boolean;
47
+ /** Function to get props for indicator button */
48
+ getIndicatorProps?: (index: number) => Record<string, any>;
49
+ /** Id assigned to the carousel root element and referenced by previous and next controls. */
50
+ id?: string;
51
+ classNames?: any;
52
+ styles?: any;
53
+ vars?: any;
54
+ unstyled?: boolean;
55
+ mod?: any;
56
+ }
57
+ /** Events emitted by `Carousel`. */
58
+ export interface CarouselEmits {
59
+ /** Emitted when the next slide control is activated. */
60
+ 'next-slide': [];
61
+ /** Emitted when the previous slide control is activated. */
62
+ 'previous-slide': [];
63
+ /** Emitted with the selected slide index. */
64
+ 'slide-change': [index: number];
65
+ /** Emitted with the Embla API instance once it becomes available. */
66
+ 'embla-api-ready': [embla: EmblaCarouselType];
67
+ }
68
+ export type CarouselCssVariables = {
69
+ root: '--carousel-height' | '--carousel-control-size' | '--carousel-controls-offset';
70
+ };
71
+ export type CarouselFactory = Factory<{
72
+ props: Omit<CarouselProps, 'rootRef'>;
73
+ emits: CarouselEmits;
74
+ ref: HTMLDivElement;
75
+ exposed: {
76
+ /** The underlying Embla instance, once the carousel has mounted. */
77
+ embla: Ref<EmblaCarouselType | undefined>;
78
+ rootElement: Element | null;
79
+ };
80
+ element: 'div';
81
+ stylesNames: CarouselStylesNames;
82
+ vars: CarouselCssVariables;
83
+ staticComponents: {
84
+ Slide: typeof CarouselSlide;
85
+ };
86
+ }>;
@@ -0,0 +1,19 @@
1
+ import type { CarouselProps } from './Carousel.types';
2
+ declare const varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
3
+ export { varsResolver };
4
+ declare const _default: typeof __VLS_export;
5
+ export default _default;
6
+ declare const __VLS_export: import("vue").DefineComponent<CarouselProps, {
7
+ embla: import("vue").Ref<import("embla-carousel").EmblaCarouselType | undefined, import("embla-carousel").EmblaCarouselType | undefined>;
8
+ rootElement: import("vue").Ref<Element | null, Element | null>;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "next-slide": () => any;
11
+ "previous-slide": () => any;
12
+ "slide-change": (index: number) => any;
13
+ "embla-api-ready": (embla: import("embla-carousel").EmblaCarouselType) => any;
14
+ }, string, import("vue").PublicProps, Readonly<CarouselProps> & Readonly<{
15
+ "onNext-slide"?: (() => any) | undefined;
16
+ "onPrevious-slide"?: (() => any) | undefined;
17
+ "onSlide-change"?: ((index: number) => any) | undefined;
18
+ "onEmbla-api-ready"?: ((embla: import("embla-carousel").EmblaCarouselType) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,17 @@
1
+ import { CarouselSlide } from '../CarouselSlide';
2
+ export declare const Carousel: import("@mantine-vue/core").MantineComponent<{
3
+ props: Omit<import("./Carousel.types").CarouselProps, "rootRef">;
4
+ emits: import("./Carousel.types").CarouselEmits;
5
+ ref: HTMLDivElement;
6
+ exposed: {
7
+ embla: import("vue").Ref<import("embla-carousel").EmblaCarouselType | undefined>;
8
+ rootElement: Element | null;
9
+ };
10
+ element: "div";
11
+ stylesNames: import("./Carousel.types").CarouselStylesNames;
12
+ vars: import("./Carousel.types").CarouselCssVariables;
13
+ staticComponents: {
14
+ Slide: typeof CarouselSlide;
15
+ };
16
+ }>;
17
+ export type { CarouselCssVariables, CarouselEmits, CarouselFactory, CarouselProps, CarouselStylesNames, } from './Carousel.types';
@@ -0,0 +1,20 @@
1
+ import type { Factory } from '@mantine-vue/core';
2
+ import type { VueRefTarget } from '@mantine-vue/hooks';
3
+ export type CarouselSlideStylesNames = 'slide';
4
+ /** Props accepted by `CarouselSlide`. */
5
+ export interface CarouselSlideProps {
6
+ /** Receives the root DOM node. */
7
+ rootRef?: VueRefTarget<Element>;
8
+ classNames?: any;
9
+ styles?: any;
10
+ mod?: any;
11
+ }
12
+ export type CarouselSlideFactory = Factory<{
13
+ props: Omit<CarouselSlideProps, 'rootRef'>;
14
+ ref: HTMLDivElement;
15
+ exposed: {
16
+ rootElement: Element | null;
17
+ };
18
+ element: 'div';
19
+ stylesNames: CarouselSlideStylesNames;
20
+ }>;
@@ -0,0 +1,16 @@
1
+ import type { CarouselSlideProps } from './CarouselSlide.types';
2
+ declare var __VLS_8: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_8) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<CarouselSlideProps, {
7
+ rootElement: import("vue").Ref<Element | null, Element | null>;
8
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CarouselSlideProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ type __VLS_WithSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };
@@ -0,0 +1,10 @@
1
+ export declare const CarouselSlide: import("@mantine-vue/core").MantineComponent<{
2
+ props: Omit<import("./CarouselSlide.types").CarouselSlideProps, "rootRef">;
3
+ ref: HTMLDivElement;
4
+ exposed: {
5
+ rootElement: Element | null;
6
+ };
7
+ element: "div";
8
+ stylesNames: import("./CarouselSlide.types").CarouselSlideStylesNames;
9
+ }>;
10
+ export type { CarouselSlideFactory, CarouselSlideProps, CarouselSlideStylesNames, } from './CarouselSlide.types';
@@ -0,0 +1,4 @@
1
+ import type { CarouselVariablesProps } from './CarouselVariables.types';
2
+ declare const __VLS_export: import("vue").DefineComponent<CarouselVariablesProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CarouselVariablesProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -0,0 +1,9 @@
1
+ export type CarouselStyleProp<T> = T | Partial<Record<string, T>>;
2
+ export interface CarouselVariablesProps {
3
+ /** CSS selector used to scope generated responsive carousel variables. */
4
+ selector: string;
5
+ /** Controls slide width based on viewport or container width. @default '100%' */
6
+ slideSize?: CarouselStyleProp<string | number>;
7
+ /** Key of `theme.spacing` or any valid CSS value to set gap between slides. @default 0 */
8
+ slideGap?: CarouselStyleProp<string | number>;
9
+ }
@@ -0,0 +1,6 @@
1
+ import type { CarouselVariablesProps } from './CarouselVariables.types';
2
+ export declare const isObject: (value: unknown) => value is Record<string, any>;
3
+ export declare const getBaseStyles: (props: CarouselVariablesProps) => Partial<{
4
+ '--carousel-slide-gap': string | undefined;
5
+ '--carousel-slide-size': string;
6
+ }>;
@@ -0,0 +1,4 @@
1
+ import type { CarouselVariablesProps } from './CarouselVariables.types';
2
+ declare const __VLS_export: import("vue").DefineComponent<CarouselVariablesProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CarouselVariablesProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export { default as CarouselVariables } from './CarouselVariables.vue';
2
+ export { default as CarouselContainerVariables } from './CarouselContainerVariables.vue';
3
+ export type { CarouselStyleProp, CarouselVariablesProps } from './CarouselVariables.types';
package/lib/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- export { Carousel } from './Carousel';
1
+ export { Carousel } from './components/Carousel';
2
2
  export { useCarouselContext } from './Carousel.context';
3
- export { CarouselSlide } from './CarouselSlide';
4
- export type { CarouselProps, CarouselStylesNames } from './Carousel';
5
- export type { CarouselSlideProps, CarouselSlideStylesNames } from './CarouselSlide';
3
+ export { CarouselSlide } from './components/CarouselSlide';
4
+ export type { CarouselEmits, CarouselProps, CarouselStylesNames } from './components/Carousel';
5
+ export type { CarouselSlideProps, CarouselSlideStylesNames } from './components/CarouselSlide';
6
6
  export type { CarouselContextValue } from './Carousel.context';
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { Carousel } from './Carousel';
1
+ export { Carousel } from './components/Carousel';
2
2
  export { useCarouselContext } from './Carousel.context';
3
- export { CarouselSlide } from './CarouselSlide';
4
- export type { CarouselProps, CarouselStylesNames } from './Carousel';
5
- export type { CarouselSlideProps, CarouselSlideStylesNames } from './CarouselSlide';
3
+ export { CarouselSlide } from './components/CarouselSlide';
4
+ export type { CarouselEmits, CarouselProps, CarouselStylesNames } from './components/Carousel';
5
+ export type { CarouselSlideProps, CarouselSlideStylesNames } from './components/CarouselSlide';
6
6
  export type { CarouselContextValue } from './Carousel.context';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine-vue/carousel",
3
- "version": "2.4.0",
3
+ "version": "3.1.0",
4
4
  "description": "Embla based carousel, Vue equivalent to @mantine/carousel",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -39,8 +39,8 @@
39
39
  "vue": "^3.5.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@mantine-vue/core": "2.4.0",
43
- "@mantine-vue/hooks": "2.4.0",
42
+ "@mantine-vue/core": "3.1.0",
43
+ "@mantine-vue/hooks": "3.1.0",
44
44
  "embla-carousel": ">=8.0.0",
45
45
  "embla-carousel-vue": ">=8.0.0",
46
46
  "vue": "^3.5.0"
package/lib/Carousel.d.ts DELETED
@@ -1,66 +0,0 @@
1
- import { type DefineComponent } from 'vue';
2
- import type { EmblaCarouselType, EmblaOptionsType, EmblaPluginType } from 'embla-carousel';
3
- import { CarouselSlide } from './CarouselSlide';
4
- import classes from './Carousel.module.css';
5
- export type CarouselStylesNames = 'slide' | 'root' | 'viewport' | 'container' | 'controls' | 'control' | 'indicators' | 'indicator';
6
- export interface CarouselProps {
7
- /** Options passed down to embla carousel */
8
- emblaOptions?: EmblaOptionsType;
9
- /** Called when next slide is shown */
10
- onNextSlide?: () => void;
11
- /** Called when previous slider is shown */
12
- onPreviousSlide?: () => void;
13
- /** Called with slide index when slide changes */
14
- onSlideChange?: (index: number) => void;
15
- /** Get embla API as ref */
16
- getEmblaApi?: (embla: EmblaCarouselType) => void;
17
- /** Props passed down to next control */
18
- nextControlProps?: Record<string, any>;
19
- /** Props passed down to previous control */
20
- previousControlProps?: Record<string, any>;
21
- /** Controls size of the next and previous controls @default 26 */
22
- controlSize?: string | number;
23
- /** Controls position of the next and previous controls, key of `theme.spacing` or any valid CSS value @default 'sm' */
24
- controlsOffset?: string | number;
25
- /** Controls slide width based on viewport width @default '100%' */
26
- slideSize?: string | number | Record<string, string | number>;
27
- /** Key of theme.spacing or number to set gap between slides */
28
- slideGap?: string | number | Record<string, string | number>;
29
- /** Carousel orientation @default 'horizontal' */
30
- orientation?: 'horizontal' | 'vertical';
31
- /** Determines type of queries used for responsive styles @default 'media' */
32
- type?: 'media' | 'container';
33
- /** Slides container `height`, required for vertical orientation */
34
- height?: string | number;
35
- /** Determines whether gap between slides should be treated as part of the slide size @default true */
36
- includeGapInSize?: boolean;
37
- /** Index of initial slide */
38
- initialSlide?: number;
39
- /** Determines whether next/previous controls should be displayed @default true */
40
- withControls?: boolean;
41
- /** Determines whether indicators should be displayed @default false */
42
- withIndicators?: boolean;
43
- /** A list of embla plugins */
44
- plugins?: EmblaPluginType[];
45
- /** Icon of the next control */
46
- nextControlIcon?: any;
47
- /** Icon of the previous control */
48
- previousControlIcon?: any;
49
- /** Determines whether arrow key should switch slides @default true */
50
- withKeyboardEvents?: boolean;
51
- /** Function to get props for indicator button */
52
- getIndicatorProps?: (index: number) => Record<string, any>;
53
- id?: string;
54
- classNames?: any;
55
- styles?: any;
56
- vars?: any;
57
- unstyled?: boolean;
58
- mod?: any;
59
- }
60
- declare const varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
61
- export declare const Carousel: DefineComponent<CarouselProps> & {
62
- classes: typeof classes;
63
- varsResolver: typeof varsResolver;
64
- Slide: typeof CarouselSlide;
65
- };
66
- export {};