@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.
- package/cjs/Carousel.cjs +279 -332
- package/cjs/Carousel.cjs.map +1 -1
- package/cjs/Carousel.context.cjs +7 -10
- package/cjs/Carousel.context.cjs.map +1 -1
- package/cjs/Carousel.module.cjs +16 -0
- package/cjs/Carousel.module.cjs.map +1 -0
- package/cjs/CarouselSlide/CarouselSlide.cjs +27 -29
- package/cjs/CarouselSlide/CarouselSlide.cjs.map +1 -1
- package/cjs/CarouselVariables/CarouselVariables.cjs +53 -71
- package/cjs/CarouselVariables/CarouselVariables.cjs.map +1 -1
- package/cjs/_virtual/_rolldown/runtime.cjs +24 -0
- package/cjs/get-chevron-rotation.cjs +7 -9
- package/cjs/get-chevron-rotation.cjs.map +1 -1
- package/cjs/index.cjs +7 -12
- package/esm/Carousel.context.mjs +7 -8
- package/esm/Carousel.context.mjs.map +1 -1
- package/esm/Carousel.mjs +275 -324
- package/esm/Carousel.mjs.map +1 -1
- package/esm/Carousel.module.mjs +16 -0
- package/esm/Carousel.module.mjs.map +1 -0
- package/esm/CarouselSlide/CarouselSlide.mjs +25 -26
- package/esm/CarouselSlide/CarouselSlide.mjs.map +1 -1
- package/esm/CarouselVariables/CarouselVariables.mjs +52 -69
- package/esm/CarouselVariables/CarouselVariables.mjs.map +1 -1
- package/esm/get-chevron-rotation.mjs +7 -7
- package/esm/get-chevron-rotation.mjs.map +1 -1
- package/esm/index.mjs +4 -4
- package/package.json +7 -7
- package/cjs/Carousel.module.css.cjs +0 -7
- package/cjs/Carousel.module.css.cjs.map +0 -1
- package/cjs/index.cjs.map +0 -1
- package/esm/Carousel.module.css.mjs +0 -5
- package/esm/Carousel.module.css.mjs.map +0 -1
- package/esm/index.mjs.map +0 -1
package/cjs/Carousel.cjs
CHANGED
|
@@ -1,340 +1,287 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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 =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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 =
|
|
280
|
+
Carousel.classes = require_Carousel_module.default;
|
|
335
281
|
Carousel.varsResolver = varsResolver;
|
|
336
282
|
Carousel.displayName = "@mantine/carousel/Carousel";
|
|
337
|
-
Carousel.Slide =
|
|
338
|
-
|
|
283
|
+
Carousel.Slide = require_CarouselSlide.CarouselSlide;
|
|
284
|
+
//#endregion
|
|
339
285
|
exports.Carousel = Carousel;
|
|
340
|
-
|
|
286
|
+
|
|
287
|
+
//# sourceMappingURL=Carousel.cjs.map
|