@mantine/carousel 9.0.0-alpha.4 → 9.0.0-alpha.6

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