@mantine/carousel 9.0.0-alpha.5 → 9.0.0-alpha.7

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.
Files changed (34) hide show
  1. package/cjs/Carousel.cjs +279 -332
  2. package/cjs/Carousel.cjs.map +1 -1
  3. package/cjs/Carousel.context.cjs +7 -10
  4. package/cjs/Carousel.context.cjs.map +1 -1
  5. package/cjs/Carousel.module.cjs +16 -0
  6. package/cjs/Carousel.module.cjs.map +1 -0
  7. package/cjs/CarouselSlide/CarouselSlide.cjs +27 -29
  8. package/cjs/CarouselSlide/CarouselSlide.cjs.map +1 -1
  9. package/cjs/CarouselVariables/CarouselVariables.cjs +53 -71
  10. package/cjs/CarouselVariables/CarouselVariables.cjs.map +1 -1
  11. package/cjs/_virtual/_rolldown/runtime.cjs +24 -0
  12. package/cjs/get-chevron-rotation.cjs +7 -9
  13. package/cjs/get-chevron-rotation.cjs.map +1 -1
  14. package/cjs/index.cjs +7 -12
  15. package/esm/Carousel.context.mjs +7 -8
  16. package/esm/Carousel.context.mjs.map +1 -1
  17. package/esm/Carousel.mjs +275 -324
  18. package/esm/Carousel.mjs.map +1 -1
  19. package/esm/Carousel.module.mjs +16 -0
  20. package/esm/Carousel.module.mjs.map +1 -0
  21. package/esm/CarouselSlide/CarouselSlide.mjs +25 -26
  22. package/esm/CarouselSlide/CarouselSlide.mjs.map +1 -1
  23. package/esm/CarouselVariables/CarouselVariables.mjs +52 -69
  24. package/esm/CarouselVariables/CarouselVariables.mjs.map +1 -1
  25. package/esm/get-chevron-rotation.mjs +7 -7
  26. package/esm/get-chevron-rotation.mjs.map +1 -1
  27. package/esm/index.mjs +4 -4
  28. package/package.json +3 -3
  29. package/cjs/Carousel.module.css.cjs +0 -7
  30. package/cjs/Carousel.module.css.cjs.map +0 -1
  31. package/cjs/index.cjs.map +0 -1
  32. package/esm/Carousel.module.css.mjs +0 -5
  33. package/esm/Carousel.module.css.mjs.map +0 -1
  34. package/esm/index.mjs.map +0 -1
package/esm/Carousel.mjs CHANGED
@@ -1,334 +1,285 @@
1
- 'use client';
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { useState, useCallback, useEffect, Children, createElement } from 'react';
4
- import useEmblaCarousel from 'embla-carousel-react';
5
- import { createVarsResolver, getSpacing, rem, factory, useProps, useStyles, useRandomClassName, useDirection, UnstyledButton, Box, VisuallyHidden, AccordionChevron } from '@mantine/core';
6
- import { useId, clamp } from '@mantine/hooks';
7
- import { CarouselProvider } from './Carousel.context.mjs';
8
- import { CarouselSlide } from './CarouselSlide/CarouselSlide.mjs';
9
- import { CarouselContainerVariables, CarouselVariables } from './CarouselVariables/CarouselVariables.mjs';
10
- import { getChevronRotation } from './get-chevron-rotation.mjs';
11
- import classes from './Carousel.module.css.mjs';
12
-
1
+ "use client";
2
+ import { CarouselProvider } from "./Carousel.context.mjs";
3
+ import Carousel_module_default from "./Carousel.module.mjs";
4
+ import { CarouselSlide } from "./CarouselSlide/CarouselSlide.mjs";
5
+ import { CarouselContainerVariables, CarouselVariables } from "./CarouselVariables/CarouselVariables.mjs";
6
+ import { getChevronRotation } from "./get-chevron-rotation.mjs";
7
+ import { Children, createElement, useCallback, useEffect, useState } from "react";
8
+ import useEmblaCarousel from "embla-carousel-react";
9
+ import { AccordionChevron, Box, UnstyledButton, VisuallyHidden, createVarsResolver, factory, getSpacing, rem, useDirection, useProps, useRandomClassName, useStyles } from "@mantine/core";
10
+ import { clamp, useId } from "@mantine/hooks";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ //#region packages/@mantine/carousel/src/Carousel.tsx
13
13
  const defaultProps = {
14
- controlSize: 26,
15
- controlsOffset: "sm",
16
- slideSize: "100%",
17
- slideGap: 0,
18
- orientation: "horizontal",
19
- includeGapInSize: true,
20
- initialSlide: 0,
21
- withControls: true,
22
- withIndicators: false,
23
- withKeyboardEvents: true,
24
- type: "media"
14
+ controlSize: 26,
15
+ controlsOffset: "sm",
16
+ slideSize: "100%",
17
+ slideGap: 0,
18
+ orientation: "horizontal",
19
+ includeGapInSize: true,
20
+ initialSlide: 0,
21
+ withControls: true,
22
+ withIndicators: false,
23
+ withKeyboardEvents: true,
24
+ type: "media"
25
25
  };
26
26
  const defaultEmblaOptions = {
27
- align: "center",
28
- loop: false,
29
- slidesToScroll: 1,
30
- dragFree: false,
31
- inViewThreshold: 0,
32
- skipSnaps: false,
33
- containScroll: "trimSnaps"
27
+ align: "center",
28
+ loop: false,
29
+ slidesToScroll: 1,
30
+ dragFree: false,
31
+ inViewThreshold: 0,
32
+ skipSnaps: false,
33
+ containScroll: "trimSnaps"
34
34
  };
35
- const varsResolver = createVarsResolver(
36
- (_, { height, controlSize, controlsOffset }) => ({
37
- root: {
38
- "--carousel-height": rem(height),
39
- "--carousel-control-size": rem(controlSize),
40
- "--carousel-controls-offset": getSpacing(controlsOffset)
41
- }
42
- })
43
- );
35
+ const varsResolver = createVarsResolver((_, { height, controlSize, controlsOffset }) => ({ root: {
36
+ "--carousel-height": rem(height),
37
+ "--carousel-control-size": rem(controlSize),
38
+ "--carousel-controls-offset": getSpacing(controlsOffset)
39
+ } }));
44
40
  const Carousel = factory((_props) => {
45
- const props = useProps("Carousel", defaultProps, _props);
46
- const {
47
- classNames,
48
- className,
49
- style,
50
- styles,
51
- unstyled,
52
- vars,
53
- children,
54
- getEmblaApi,
55
- onNextSlide,
56
- onPreviousSlide,
57
- onSlideChange,
58
- nextControlProps,
59
- previousControlProps,
60
- controlSize,
61
- controlsOffset,
62
- slideSize,
63
- slideGap,
64
- orientation,
65
- height,
66
- includeGapInSize,
67
- draggable,
68
- initialSlide,
69
- withControls,
70
- withIndicators,
71
- plugins,
72
- nextControlIcon,
73
- previousControlIcon,
74
- withKeyboardEvents,
75
- mod,
76
- type,
77
- emblaOptions,
78
- attributes,
79
- getIndicatorProps,
80
- id,
81
- ...others
82
- } = props;
83
- const getStyles = useStyles({
84
- name: "Carousel",
85
- classes,
86
- props,
87
- className,
88
- style,
89
- classNames,
90
- styles,
91
- unstyled,
92
- attributes,
93
- vars,
94
- varsResolver
95
- });
96
- const _id = useId(id);
97
- const responsiveClassName = useRandomClassName();
98
- const { dir } = useDirection();
99
- const [emblaRefElement, embla] = useEmblaCarousel(
100
- {
101
- axis: orientation === "horizontal" ? "x" : "y",
102
- direction: orientation === "horizontal" ? dir : void 0,
103
- startIndex: initialSlide,
104
- ...defaultEmblaOptions,
105
- ...emblaOptions
106
- },
107
- plugins
108
- );
109
- const [selected, setSelected] = useState(0);
110
- const [slidesCount, setSlidesCount] = useState(0);
111
- const handleScroll = useCallback((index) => embla && embla.scrollTo(index), [embla]);
112
- const handleSelect = useCallback(() => {
113
- if (!embla) {
114
- return;
115
- }
116
- const slide = embla.selectedScrollSnap();
117
- setSelected(slide);
118
- slide !== selected && onSlideChange?.(slide);
119
- }, [embla, setSelected, onSlideChange, selected]);
120
- const handlePrevious = useCallback(() => {
121
- embla?.scrollPrev();
122
- onPreviousSlide?.();
123
- }, [embla]);
124
- const handleNext = useCallback(() => {
125
- embla?.scrollNext();
126
- onNextSlide?.();
127
- }, [embla]);
128
- const handleKeydown = useCallback(
129
- (event) => {
130
- if (withKeyboardEvents) {
131
- if (event.key === "ArrowRight") {
132
- event.preventDefault();
133
- handleNext();
134
- }
135
- if (event.key === "ArrowLeft") {
136
- event.preventDefault();
137
- handlePrevious();
138
- }
139
- if (event.key === "Home") {
140
- event.preventDefault();
141
- embla?.scrollTo(0);
142
- }
143
- if (event.key === "End") {
144
- event.preventDefault();
145
- embla?.scrollTo(embla.scrollSnapList().length - 1);
146
- }
147
- }
148
- },
149
- [embla, handleNext, handlePrevious]
150
- );
151
- useEffect(() => {
152
- if (embla) {
153
- getEmblaApi?.(embla);
154
- handleSelect();
155
- setSlidesCount(embla.scrollSnapList().length);
156
- embla.on("select", handleSelect);
157
- return () => {
158
- embla.off("select", handleSelect);
159
- };
160
- }
161
- return void 0;
162
- }, [embla, emblaOptions?.slidesToScroll, handleSelect]);
163
- useEffect(() => {
164
- if (embla) {
165
- embla.reInit();
166
- setSlidesCount(embla.scrollSnapList().length);
167
- setSelected(
168
- (currentSelected) => clamp(currentSelected, 0, Children.toArray(children).length - 1)
169
- );
170
- }
171
- }, [Children.toArray(children).length, emblaOptions?.slidesToScroll]);
172
- const canScrollPrev = embla?.canScrollPrev() || false;
173
- const canScrollNext = embla?.canScrollNext() || false;
174
- const handleIndicatorKeyDown = useCallback(
175
- (event, index) => {
176
- const isHorizontal = orientation === "horizontal";
177
- const nextKey = isHorizontal ? "ArrowRight" : "ArrowDown";
178
- const prevKey = isHorizontal ? "ArrowLeft" : "ArrowUp";
179
- if (event.key === nextKey) {
180
- event.preventDefault();
181
- const nextIndex = index < slidesCount - 1 ? index + 1 : 0;
182
- handleScroll(nextIndex);
183
- const nextIndicator = event.currentTarget.parentElement?.children[nextIndex];
184
- nextIndicator?.focus();
185
- }
186
- if (event.key === prevKey) {
187
- event.preventDefault();
188
- const prevIndex = index > 0 ? index - 1 : slidesCount - 1;
189
- handleScroll(prevIndex);
190
- const prevIndicator = event.currentTarget.parentElement?.children[prevIndex];
191
- prevIndicator?.focus();
192
- }
193
- if (event.key === "Home") {
194
- event.preventDefault();
195
- handleScroll(0);
196
- const firstIndicator = event.currentTarget.parentElement?.children[0];
197
- firstIndicator?.focus();
198
- }
199
- if (event.key === "End") {
200
- event.preventDefault();
201
- handleScroll(slidesCount - 1);
202
- const lastIndicator = event.currentTarget.parentElement?.children[slidesCount - 1];
203
- lastIndicator?.focus();
204
- }
205
- },
206
- [orientation, slidesCount, handleScroll]
207
- );
208
- const indicators = Array(slidesCount).fill(0).map((_, index) => /* @__PURE__ */ createElement(
209
- UnstyledButton,
210
- {
211
- ...getStyles("indicator"),
212
- key: index,
213
- role: "tab",
214
- "aria-label": `Go to slide ${index + 1}`,
215
- "aria-selected": index === selected,
216
- tabIndex: index === selected ? 0 : -1,
217
- "data-active": index === selected || void 0,
218
- onClick: () => handleScroll(index),
219
- onKeyDown: (event) => handleIndicatorKeyDown(event, index),
220
- "data-orientation": orientation,
221
- onMouseDown: (event) => event.preventDefault(),
222
- ...getIndicatorProps?.(index)
223
- }
224
- ));
225
- return /* @__PURE__ */ jsxs(CarouselProvider, { value: { getStyles, orientation }, children: [
226
- type === "container" ? /* @__PURE__ */ jsx(CarouselContainerVariables, { ...props, selector: `.${responsiveClassName}` }) : /* @__PURE__ */ jsx(CarouselVariables, { ...props, selector: `.${responsiveClassName}` }),
227
- /* @__PURE__ */ jsxs(
228
- Box,
229
- {
230
- role: "region",
231
- "aria-roledescription": "carousel",
232
- ...getStyles("root", { className: responsiveClassName }),
233
- ...others,
234
- id: _id,
235
- mod: [{ orientation, "include-gap-in-size": includeGapInSize }, mod],
236
- onKeyDownCapture: handleKeydown,
237
- children: [
238
- /* @__PURE__ */ jsx(VisuallyHidden, { role: "status", "aria-live": "polite", "aria-atomic": "true", children: slidesCount > 0 && `Slide ${selected + 1} of ${slidesCount}` }),
239
- withControls && /* @__PURE__ */ jsxs("div", { ...getStyles("controls"), "data-orientation": orientation, children: [
240
- /* @__PURE__ */ jsx(
241
- UnstyledButton,
242
- {
243
- "aria-controls": _id,
244
- "aria-label": "Previous slide",
245
- "aria-disabled": !canScrollPrev,
246
- "data-inactive": !canScrollPrev || void 0,
247
- "data-type": "previous",
248
- tabIndex: canScrollPrev ? 0 : -1,
249
- ...previousControlProps,
250
- ...getStyles("control", {
251
- className: previousControlProps?.className,
252
- style: previousControlProps?.style
253
- }),
254
- onClick: (event) => {
255
- handlePrevious();
256
- previousControlProps?.onClick?.(event);
257
- },
258
- children: typeof previousControlIcon !== "undefined" ? previousControlIcon : /* @__PURE__ */ jsx(
259
- AccordionChevron,
260
- {
261
- style: {
262
- transform: `rotate(${getChevronRotation({
263
- dir,
264
- orientation,
265
- direction: "previous"
266
- })}deg)`
267
- }
268
- }
269
- )
270
- }
271
- ),
272
- /* @__PURE__ */ jsx(
273
- UnstyledButton,
274
- {
275
- "aria-controls": _id,
276
- "aria-label": "Next slide",
277
- "aria-disabled": !canScrollNext,
278
- "data-inactive": !canScrollNext || void 0,
279
- "data-type": "next",
280
- tabIndex: canScrollNext ? 0 : -1,
281
- ...getStyles("control", {
282
- className: nextControlProps?.className,
283
- style: nextControlProps?.style
284
- }),
285
- ...nextControlProps,
286
- onClick: (event) => {
287
- handleNext();
288
- nextControlProps?.onClick?.(event);
289
- },
290
- children: typeof nextControlIcon !== "undefined" ? nextControlIcon : /* @__PURE__ */ jsx(
291
- AccordionChevron,
292
- {
293
- style: {
294
- transform: `rotate(${getChevronRotation({
295
- dir,
296
- orientation,
297
- direction: "next"
298
- })}deg)`
299
- }
300
- }
301
- )
302
- }
303
- )
304
- ] }),
305
- /* @__PURE__ */ jsx("div", { ...getStyles("viewport"), ref: emblaRefElement, "data-type": type, children: /* @__PURE__ */ jsx(
306
- "div",
307
- {
308
- ...getStyles("container", { className: responsiveClassName }),
309
- "data-orientation": orientation,
310
- children
311
- }
312
- ) }),
313
- withIndicators && /* @__PURE__ */ jsx(
314
- "div",
315
- {
316
- ...getStyles("indicators"),
317
- role: "tablist",
318
- "aria-label": "Slides",
319
- "data-orientation": orientation,
320
- children: indicators
321
- }
322
- )
323
- ]
324
- }
325
- )
326
- ] });
41
+ const props = useProps("Carousel", defaultProps, _props);
42
+ const { classNames, className, style, styles, unstyled, vars, children, getEmblaApi, onNextSlide, onPreviousSlide, onSlideChange, nextControlProps, previousControlProps, controlSize, controlsOffset, slideSize, slideGap, orientation, height, includeGapInSize, draggable, initialSlide, withControls, withIndicators, plugins, nextControlIcon, previousControlIcon, withKeyboardEvents, mod, type, emblaOptions, attributes, getIndicatorProps, id, ...others } = props;
43
+ const getStyles = useStyles({
44
+ name: "Carousel",
45
+ classes: Carousel_module_default,
46
+ props,
47
+ className,
48
+ style,
49
+ classNames,
50
+ styles,
51
+ unstyled,
52
+ attributes,
53
+ vars,
54
+ varsResolver
55
+ });
56
+ const _id = useId(id);
57
+ const responsiveClassName = useRandomClassName();
58
+ const { dir } = useDirection();
59
+ const [emblaRefElement, embla] = useEmblaCarousel({
60
+ axis: orientation === "horizontal" ? "x" : "y",
61
+ direction: orientation === "horizontal" ? dir : void 0,
62
+ startIndex: initialSlide,
63
+ ...defaultEmblaOptions,
64
+ ...emblaOptions
65
+ }, plugins);
66
+ const [selected, setSelected] = useState(0);
67
+ const [slidesCount, setSlidesCount] = useState(0);
68
+ const handleScroll = useCallback((index) => embla && embla.scrollTo(index), [embla]);
69
+ const handleSelect = useCallback(() => {
70
+ if (!embla) return;
71
+ const slide = embla.selectedScrollSnap();
72
+ setSelected(slide);
73
+ slide !== selected && onSlideChange?.(slide);
74
+ }, [
75
+ embla,
76
+ setSelected,
77
+ onSlideChange,
78
+ selected
79
+ ]);
80
+ const handlePrevious = useCallback(() => {
81
+ embla?.scrollPrev();
82
+ onPreviousSlide?.();
83
+ }, [embla]);
84
+ const handleNext = useCallback(() => {
85
+ embla?.scrollNext();
86
+ onNextSlide?.();
87
+ }, [embla]);
88
+ const handleKeydown = useCallback((event) => {
89
+ if (withKeyboardEvents) {
90
+ if (event.key === "ArrowRight") {
91
+ event.preventDefault();
92
+ handleNext();
93
+ }
94
+ if (event.key === "ArrowLeft") {
95
+ event.preventDefault();
96
+ handlePrevious();
97
+ }
98
+ if (event.key === "Home") {
99
+ event.preventDefault();
100
+ embla?.scrollTo(0);
101
+ }
102
+ if (event.key === "End") {
103
+ event.preventDefault();
104
+ embla?.scrollTo(embla.scrollSnapList().length - 1);
105
+ }
106
+ }
107
+ }, [
108
+ embla,
109
+ handleNext,
110
+ handlePrevious
111
+ ]);
112
+ useEffect(() => {
113
+ if (embla) {
114
+ getEmblaApi?.(embla);
115
+ handleSelect();
116
+ setSlidesCount(embla.scrollSnapList().length);
117
+ embla.on("select", handleSelect);
118
+ return () => {
119
+ embla.off("select", handleSelect);
120
+ };
121
+ }
122
+ }, [
123
+ embla,
124
+ emblaOptions?.slidesToScroll,
125
+ handleSelect
126
+ ]);
127
+ useEffect(() => {
128
+ if (embla) {
129
+ embla.reInit();
130
+ setSlidesCount(embla.scrollSnapList().length);
131
+ setSelected((currentSelected) => clamp(currentSelected, 0, Children.toArray(children).length - 1));
132
+ }
133
+ }, [Children.toArray(children).length, emblaOptions?.slidesToScroll]);
134
+ const canScrollPrev = embla?.canScrollPrev() || false;
135
+ const canScrollNext = embla?.canScrollNext() || false;
136
+ const handleIndicatorKeyDown = useCallback((event, index) => {
137
+ const isHorizontal = orientation === "horizontal";
138
+ const nextKey = isHorizontal ? "ArrowRight" : "ArrowDown";
139
+ const prevKey = isHorizontal ? "ArrowLeft" : "ArrowUp";
140
+ if (event.key === nextKey) {
141
+ event.preventDefault();
142
+ const nextIndex = index < slidesCount - 1 ? index + 1 : 0;
143
+ handleScroll(nextIndex);
144
+ (event.currentTarget.parentElement?.children[nextIndex])?.focus();
145
+ }
146
+ if (event.key === prevKey) {
147
+ event.preventDefault();
148
+ const prevIndex = index > 0 ? index - 1 : slidesCount - 1;
149
+ handleScroll(prevIndex);
150
+ (event.currentTarget.parentElement?.children[prevIndex])?.focus();
151
+ }
152
+ if (event.key === "Home") {
153
+ event.preventDefault();
154
+ handleScroll(0);
155
+ (event.currentTarget.parentElement?.children[0])?.focus();
156
+ }
157
+ if (event.key === "End") {
158
+ event.preventDefault();
159
+ handleScroll(slidesCount - 1);
160
+ (event.currentTarget.parentElement?.children[slidesCount - 1])?.focus();
161
+ }
162
+ }, [
163
+ orientation,
164
+ slidesCount,
165
+ handleScroll
166
+ ]);
167
+ const indicators = Array(slidesCount).fill(0).map((_, index) => /* @__PURE__ */ createElement(UnstyledButton, {
168
+ ...getStyles("indicator"),
169
+ key: index,
170
+ role: "tab",
171
+ "aria-label": `Go to slide ${index + 1}`,
172
+ "aria-selected": index === selected,
173
+ tabIndex: index === selected ? 0 : -1,
174
+ "data-active": index === selected || void 0,
175
+ onClick: () => handleScroll(index),
176
+ onKeyDown: (event) => handleIndicatorKeyDown(event, index),
177
+ "data-orientation": orientation,
178
+ onMouseDown: (event) => event.preventDefault(),
179
+ ...getIndicatorProps?.(index)
180
+ }));
181
+ return /* @__PURE__ */ jsxs(CarouselProvider, {
182
+ value: {
183
+ getStyles,
184
+ orientation
185
+ },
186
+ children: [type === "container" ? /* @__PURE__ */ jsx(CarouselContainerVariables, {
187
+ ...props,
188
+ selector: `.${responsiveClassName}`
189
+ }) : /* @__PURE__ */ jsx(CarouselVariables, {
190
+ ...props,
191
+ selector: `.${responsiveClassName}`
192
+ }), /* @__PURE__ */ jsxs(Box, {
193
+ role: "region",
194
+ "aria-roledescription": "carousel",
195
+ ...getStyles("root", { className: responsiveClassName }),
196
+ ...others,
197
+ id: _id,
198
+ mod: [{
199
+ orientation,
200
+ "include-gap-in-size": includeGapInSize
201
+ }, mod],
202
+ onKeyDownCapture: handleKeydown,
203
+ children: [
204
+ /* @__PURE__ */ jsx(VisuallyHidden, {
205
+ role: "status",
206
+ "aria-live": "polite",
207
+ "aria-atomic": "true",
208
+ children: slidesCount > 0 && `Slide ${selected + 1} of ${slidesCount}`
209
+ }),
210
+ withControls && /* @__PURE__ */ jsxs("div", {
211
+ ...getStyles("controls"),
212
+ "data-orientation": orientation,
213
+ children: [/* @__PURE__ */ jsx(UnstyledButton, {
214
+ "aria-controls": _id,
215
+ "aria-label": "Previous slide",
216
+ "aria-disabled": !canScrollPrev,
217
+ "data-inactive": !canScrollPrev || void 0,
218
+ "data-type": "previous",
219
+ tabIndex: canScrollPrev ? 0 : -1,
220
+ ...previousControlProps,
221
+ ...getStyles("control", {
222
+ className: previousControlProps?.className,
223
+ style: previousControlProps?.style
224
+ }),
225
+ onClick: (event) => {
226
+ handlePrevious();
227
+ previousControlProps?.onClick?.(event);
228
+ },
229
+ children: typeof previousControlIcon !== "undefined" ? previousControlIcon : /* @__PURE__ */ jsx(AccordionChevron, { style: { transform: `rotate(${getChevronRotation({
230
+ dir,
231
+ orientation,
232
+ direction: "previous"
233
+ })}deg)` } })
234
+ }), /* @__PURE__ */ jsx(UnstyledButton, {
235
+ "aria-controls": _id,
236
+ "aria-label": "Next slide",
237
+ "aria-disabled": !canScrollNext,
238
+ "data-inactive": !canScrollNext || void 0,
239
+ "data-type": "next",
240
+ tabIndex: canScrollNext ? 0 : -1,
241
+ ...getStyles("control", {
242
+ className: nextControlProps?.className,
243
+ style: nextControlProps?.style
244
+ }),
245
+ ...nextControlProps,
246
+ onClick: (event) => {
247
+ handleNext();
248
+ nextControlProps?.onClick?.(event);
249
+ },
250
+ children: typeof nextControlIcon !== "undefined" ? nextControlIcon : /* @__PURE__ */ jsx(AccordionChevron, { style: { transform: `rotate(${getChevronRotation({
251
+ dir,
252
+ orientation,
253
+ direction: "next"
254
+ })}deg)` } })
255
+ })]
256
+ }),
257
+ /* @__PURE__ */ jsx("div", {
258
+ ...getStyles("viewport"),
259
+ ref: emblaRefElement,
260
+ "data-type": type,
261
+ children: /* @__PURE__ */ jsx("div", {
262
+ ...getStyles("container", { className: responsiveClassName }),
263
+ "data-orientation": orientation,
264
+ children
265
+ })
266
+ }),
267
+ withIndicators && /* @__PURE__ */ jsx("div", {
268
+ ...getStyles("indicators"),
269
+ role: "tablist",
270
+ "aria-label": "Slides",
271
+ "data-orientation": orientation,
272
+ children: indicators
273
+ })
274
+ ]
275
+ })]
276
+ });
327
277
  });
328
- Carousel.classes = classes;
278
+ Carousel.classes = Carousel_module_default;
329
279
  Carousel.varsResolver = varsResolver;
330
280
  Carousel.displayName = "@mantine/carousel/Carousel";
331
281
  Carousel.Slide = CarouselSlide;
332
-
282
+ //#endregion
333
283
  export { Carousel };
334
- //# sourceMappingURL=Carousel.mjs.map
284
+
285
+ //# sourceMappingURL=Carousel.mjs.map