@situaction/traq-ui-ste 1.2.18 → 1.2.20
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.
|
@@ -1,319 +1,329 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import '../../styles/Carousel.css';const
|
|
4
|
-
root:
|
|
5
|
-
viewport:
|
|
6
|
-
dragEnabled:
|
|
7
|
-
dragging:
|
|
8
|
-
slide:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as fe, jsx as p, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
+
import Fe, { forwardRef as qe, useMemo as de, useRef as u, useState as O, useCallback as i, useEffect as B, useImperativeHandle as He } from "react";
|
|
3
|
+
import '../../styles/Carousel.css';const Oe = "_root_zgsjf_6", Xe = "_viewport_zgsjf_11", Ue = "_dragEnabled_zgsjf_27", Ve = "_dragging_zgsjf_32", Ke = "_slide_zgsjf_39", Ye = "_navButtonCtn_zgsjf_46", Ge = "_navButton_zgsjf_46", Je = "_defaultBtn_zgsjf_64", Qe = "_navPrev_zgsjf_81", Ze = "_navNext_zgsjf_86", f = {
|
|
4
|
+
root: Oe,
|
|
5
|
+
viewport: Xe,
|
|
6
|
+
dragEnabled: Ue,
|
|
7
|
+
dragging: Ve,
|
|
8
|
+
slide: Ke,
|
|
9
|
+
navButtonCtn: Ye,
|
|
10
|
+
navButton: Ge,
|
|
11
|
+
defaultBtn: Je,
|
|
12
|
+
navPrev: Qe,
|
|
13
|
+
navNext: Ze
|
|
14
|
+
}, T = (...P) => P.filter(Boolean).join(" "), rt = qe(
|
|
13
15
|
({
|
|
14
|
-
children:
|
|
15
|
-
className:
|
|
16
|
-
viewportClassName:
|
|
17
|
-
slideClassName:
|
|
18
|
-
style:
|
|
19
|
-
slideSize:
|
|
20
|
-
gap:
|
|
21
|
-
align:
|
|
22
|
-
showArrows:
|
|
23
|
-
dragEnabled:
|
|
24
|
-
snapOnRelease:
|
|
25
|
-
keyboardNavigation:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
16
|
+
children: P,
|
|
17
|
+
className: ve,
|
|
18
|
+
viewportClassName: me,
|
|
19
|
+
slideClassName: pe,
|
|
20
|
+
style: ge,
|
|
21
|
+
slideSize: we = "30%",
|
|
22
|
+
gap: he = 12,
|
|
23
|
+
align: w = "center",
|
|
24
|
+
showArrows: _e = !0,
|
|
25
|
+
dragEnabled: N = !0,
|
|
26
|
+
snapOnRelease: ee = !0,
|
|
27
|
+
keyboardNavigation: xe = !0,
|
|
28
|
+
btnGradientColor: Ie,
|
|
29
|
+
step: Le = 1,
|
|
30
|
+
initialIndex: te = 0,
|
|
31
|
+
loop: k = !1,
|
|
32
|
+
ariaLabel: re = "Carousel",
|
|
33
|
+
iconLeft: Re,
|
|
34
|
+
iconRight: be,
|
|
35
|
+
onIndexChange: X
|
|
36
|
+
}, ye) => {
|
|
37
|
+
const h = de(() => Fe.Children.toArray(P), [P]), c = h.length, s = k && c > 1, M = Math.max(1, Math.min(Le, Math.max(1, c))), v = s ? c : 0, _ = de(() => {
|
|
38
|
+
if (!s)
|
|
39
|
+
return h.map((n, o) => ({
|
|
37
40
|
key: `real-${o}`,
|
|
38
41
|
node: n,
|
|
39
42
|
realIndex: o,
|
|
40
43
|
isClone: !1
|
|
41
44
|
}));
|
|
42
|
-
const e =
|
|
45
|
+
const e = h.map((n, o) => ({
|
|
43
46
|
key: `clone-head-${o}`,
|
|
44
47
|
node: n,
|
|
45
48
|
realIndex: o,
|
|
46
49
|
isClone: !0
|
|
47
|
-
})), t =
|
|
50
|
+
})), t = h.map((n, o) => ({
|
|
48
51
|
key: `real-${o}`,
|
|
49
52
|
node: n,
|
|
50
53
|
realIndex: o,
|
|
51
54
|
isClone: !1
|
|
52
|
-
})), r =
|
|
55
|
+
})), r = h.map((n, o) => ({
|
|
53
56
|
key: `clone-tail-${o}`,
|
|
54
57
|
node: n,
|
|
55
58
|
realIndex: o,
|
|
56
59
|
isClone: !0
|
|
57
60
|
}));
|
|
58
61
|
return [...e, ...t, ...r];
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
}, [s, h]), U = _.length, a = u(null), x = u([]), [Ce, Ne] = O(0), I = u(0), [ke, ne] = O(!1), [Se, oe] = O(!1), L = u(!1), ce = u(0), V = u(0), K = u(!1), Y = u(!1), [ze, se] = O(!1), j = u(X), A = u(!1), R = u(null), G = i(() => {
|
|
63
|
+
A.current = !0, R.current != null && window.clearTimeout(R.current), R.current = window.setTimeout(() => {
|
|
64
|
+
A.current = !1, R.current = null;
|
|
65
|
+
}, 120);
|
|
66
|
+
}, []);
|
|
67
|
+
B(() => () => {
|
|
68
|
+
R.current != null && window.clearTimeout(R.current);
|
|
69
|
+
}, []), B(() => {
|
|
70
|
+
j.current = X;
|
|
71
|
+
}, [X]);
|
|
63
72
|
const m = i((e) => {
|
|
64
73
|
var t;
|
|
65
|
-
|
|
66
|
-
}, []),
|
|
74
|
+
e !== I.current && (I.current = e, Ne(e), (t = j.current) == null || t.call(j, e));
|
|
75
|
+
}, []), ae = i((e) => {
|
|
67
76
|
const t = a.current;
|
|
68
77
|
t && (t.style.scrollSnapType = e ? "x mandatory" : "none", t.style.scrollBehavior = e ? "smooth" : "auto");
|
|
69
|
-
}, []),
|
|
70
|
-
(e, t) =>
|
|
71
|
-
[
|
|
72
|
-
),
|
|
78
|
+
}, []), S = i(
|
|
79
|
+
(e, t) => w === "center" ? t.offsetLeft - (e.clientWidth - t.offsetWidth) / 2 : t.offsetLeft,
|
|
80
|
+
[w]
|
|
81
|
+
), b = i(
|
|
73
82
|
(e, t = "smooth") => {
|
|
74
83
|
const r = a.current, n = x.current[e];
|
|
75
84
|
if (!r || !n) return;
|
|
76
|
-
const o =
|
|
85
|
+
const o = S(r, n);
|
|
77
86
|
r.scrollTo({ left: o, behavior: t });
|
|
78
87
|
},
|
|
79
|
-
[
|
|
80
|
-
), q = i(
|
|
81
|
-
(e) => s === 0 ? 0 : N ? (e % s + s) % s : Math.max(0, Math.min(s - 1, e)),
|
|
82
|
-
[N, s]
|
|
88
|
+
[S]
|
|
83
89
|
), D = i(
|
|
84
|
-
(e) => c ?
|
|
85
|
-
[
|
|
86
|
-
),
|
|
90
|
+
(e) => c === 0 ? 0 : k ? (e % c + c) % c : Math.max(0, Math.min(c - 1, e)),
|
|
91
|
+
[k, c]
|
|
92
|
+
), $ = i(
|
|
93
|
+
(e) => s ? v + e : e,
|
|
94
|
+
[s, v]
|
|
95
|
+
), y = i(
|
|
87
96
|
(e, t = "smooth") => {
|
|
88
|
-
const r =
|
|
89
|
-
|
|
97
|
+
const r = D(e), n = $(r);
|
|
98
|
+
t === "smooth" && G(), b(n, t), m(r);
|
|
90
99
|
},
|
|
91
|
-
[
|
|
100
|
+
[D, $, b, m, G]
|
|
92
101
|
), W = i(() => {
|
|
93
102
|
const e = a.current;
|
|
94
|
-
if (!e ||
|
|
95
|
-
const t = e.scrollLeft, r =
|
|
103
|
+
if (!e || U === 0) return 0;
|
|
104
|
+
const t = e.scrollLeft, r = w === "center" ? t + e.clientWidth / 2 : t;
|
|
96
105
|
let n = 0, o = Number.POSITIVE_INFINITY;
|
|
97
|
-
for (let
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
100
|
-
const
|
|
101
|
-
|
|
106
|
+
for (let d = 0; d < U; d++) {
|
|
107
|
+
const l = x.current[d];
|
|
108
|
+
if (!l) continue;
|
|
109
|
+
const g = w === "center" ? l.offsetLeft + l.offsetWidth / 2 : l.offsetLeft, H = Math.abs(g - r);
|
|
110
|
+
H < o && (o = H, n = d);
|
|
102
111
|
}
|
|
103
112
|
return n;
|
|
104
|
-
}, [
|
|
105
|
-
(e) =>
|
|
106
|
-
[
|
|
107
|
-
),
|
|
113
|
+
}, [w, U]), E = i(
|
|
114
|
+
(e) => s ? e < v ? e + c : e >= v + c ? e - c : e : e,
|
|
115
|
+
[s, v, c]
|
|
116
|
+
), ie = u({
|
|
108
117
|
middleStart: 0,
|
|
109
118
|
groupWidth: 0
|
|
110
|
-
}),
|
|
111
|
-
if (!
|
|
119
|
+
}), C = i(() => {
|
|
120
|
+
if (!s) return;
|
|
112
121
|
const e = a.current;
|
|
113
122
|
if (!e) return;
|
|
114
|
-
const t = x.current[
|
|
123
|
+
const t = x.current[v], r = x.current[v + c];
|
|
115
124
|
if (!t || !r) return;
|
|
116
|
-
const n =
|
|
117
|
-
|
|
125
|
+
const n = S(e, t), o = S(e, r);
|
|
126
|
+
ie.current = {
|
|
118
127
|
middleStart: n,
|
|
119
128
|
groupWidth: o - n
|
|
120
129
|
};
|
|
121
|
-
}, [
|
|
130
|
+
}, [s, v, c, S]), J = u(!1), Q = i(
|
|
122
131
|
(e) => {
|
|
123
|
-
if (!
|
|
132
|
+
if (!s) return;
|
|
124
133
|
const t = a.current;
|
|
125
134
|
if (!t) return;
|
|
126
|
-
const { middleStart: r, groupWidth: n } =
|
|
135
|
+
const { middleStart: r, groupWidth: n } = ie.current;
|
|
127
136
|
if (n <= 0) return;
|
|
128
|
-
const o = r,
|
|
129
|
-
let
|
|
130
|
-
|
|
137
|
+
const o = r, d = r + n;
|
|
138
|
+
let l = t.scrollLeft, g = 0;
|
|
139
|
+
l < o ? g = Math.ceil((o - l) / n) * n : l > d && (g = -Math.ceil((l - d) / n) * n), g !== 0 && (J.current = !0, t.scrollLeft = l + g, e === "drag" && (V.current += g), J.current = !1);
|
|
131
140
|
},
|
|
132
|
-
[
|
|
133
|
-
),
|
|
134
|
-
if (
|
|
135
|
-
|
|
141
|
+
[s]
|
|
142
|
+
), z = i(() => {
|
|
143
|
+
if (k) {
|
|
144
|
+
ne(c > 1), oe(c > 1);
|
|
136
145
|
return;
|
|
137
146
|
}
|
|
138
147
|
const e = a.current;
|
|
139
148
|
if (!e) return;
|
|
140
149
|
const t = e.scrollWidth - e.clientWidth, r = 1;
|
|
141
|
-
|
|
142
|
-
}, [
|
|
143
|
-
|
|
144
|
-
}, [
|
|
145
|
-
|
|
146
|
-
}, [
|
|
150
|
+
ne(t > r && e.scrollLeft > r), oe(t > r && e.scrollLeft < t - r);
|
|
151
|
+
}, [k, c]), F = i(() => {
|
|
152
|
+
c <= 1 || y(I.current + M);
|
|
153
|
+
}, [y, c, M]), q = i(() => {
|
|
154
|
+
c <= 1 || y(I.current - M);
|
|
155
|
+
}, [y, c, M]), Be = i(() => {
|
|
147
156
|
var n;
|
|
148
|
-
if (!
|
|
149
|
-
const e = W(), t =
|
|
150
|
-
|
|
151
|
-
const r = ((n =
|
|
157
|
+
if (!ee) return;
|
|
158
|
+
const e = W(), t = E(e);
|
|
159
|
+
b(t, "smooth");
|
|
160
|
+
const r = ((n = _[t]) == null ? void 0 : n.realIndex) ?? 0;
|
|
152
161
|
m(r);
|
|
153
162
|
}, [
|
|
154
|
-
|
|
163
|
+
ee,
|
|
155
164
|
W,
|
|
156
|
-
|
|
165
|
+
E,
|
|
166
|
+
b,
|
|
157
167
|
_,
|
|
158
|
-
h,
|
|
159
168
|
m
|
|
160
169
|
]);
|
|
161
|
-
|
|
162
|
-
|
|
170
|
+
He(
|
|
171
|
+
ye,
|
|
163
172
|
() => ({
|
|
164
|
-
next:
|
|
165
|
-
prev:
|
|
166
|
-
goTo:
|
|
167
|
-
getIndex: () =>
|
|
168
|
-
getLength: () =>
|
|
173
|
+
next: F,
|
|
174
|
+
prev: q,
|
|
175
|
+
goTo: y,
|
|
176
|
+
getIndex: () => I.current,
|
|
177
|
+
getLength: () => c
|
|
169
178
|
}),
|
|
170
|
-
[
|
|
171
|
-
),
|
|
172
|
-
if (
|
|
173
|
-
const e =
|
|
174
|
-
|
|
179
|
+
[y, F, q, c]
|
|
180
|
+
), B(() => {
|
|
181
|
+
if (c === 0) return;
|
|
182
|
+
const e = D(te), t = $(e), r = window.requestAnimationFrame(() => {
|
|
183
|
+
C(), b(t, "auto"), m(e), z();
|
|
175
184
|
});
|
|
176
185
|
return () => window.cancelAnimationFrame(r);
|
|
177
186
|
}, [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
q,
|
|
187
|
+
c,
|
|
188
|
+
te,
|
|
181
189
|
D,
|
|
182
|
-
|
|
190
|
+
$,
|
|
191
|
+
b,
|
|
183
192
|
m,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
]),
|
|
187
|
-
if (!
|
|
193
|
+
z,
|
|
194
|
+
C
|
|
195
|
+
]), B(() => {
|
|
196
|
+
if (!s) return;
|
|
188
197
|
const e = a.current;
|
|
189
198
|
if (!e) return;
|
|
190
199
|
const t = typeof ResizeObserver < "u" ? new ResizeObserver(() => {
|
|
191
|
-
|
|
200
|
+
C();
|
|
192
201
|
}) : null;
|
|
193
202
|
t == null || t.observe(e), x.current.forEach((o) => o && (t == null ? void 0 : t.observe(o)));
|
|
194
|
-
const r = () =>
|
|
203
|
+
const r = () => C();
|
|
195
204
|
window.addEventListener("resize", r);
|
|
196
|
-
const n = window.requestAnimationFrame(() =>
|
|
205
|
+
const n = window.requestAnimationFrame(() => C());
|
|
197
206
|
return () => {
|
|
198
207
|
window.removeEventListener("resize", r), window.cancelAnimationFrame(n), t == null || t.disconnect();
|
|
199
208
|
};
|
|
200
|
-
}, [
|
|
209
|
+
}, [s, C]), B(() => {
|
|
201
210
|
const e = a.current;
|
|
202
211
|
if (!e) return;
|
|
203
212
|
const t = { current: 0 }, r = () => {
|
|
204
|
-
|
|
205
|
-
var
|
|
213
|
+
J.current || (s && !L.current && Q("scroll"), z(), !t.current && (A.current && G(), t.current = window.requestAnimationFrame(() => {
|
|
214
|
+
var l;
|
|
206
215
|
t.current = 0;
|
|
207
|
-
const n = W(), o =
|
|
208
|
-
|
|
216
|
+
const n = W(), o = E(n), d = ((l = _[o]) == null ? void 0 : l.realIndex) ?? 0;
|
|
217
|
+
A.current || d !== I.current && m(d);
|
|
209
218
|
})));
|
|
210
219
|
};
|
|
211
220
|
return e.addEventListener("scroll", r, { passive: !0 }), () => {
|
|
212
221
|
e.removeEventListener("scroll", r), t.current && window.cancelAnimationFrame(t.current);
|
|
213
222
|
};
|
|
214
223
|
}, [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
P,
|
|
218
|
-
W,
|
|
224
|
+
s,
|
|
225
|
+
Q,
|
|
219
226
|
z,
|
|
220
|
-
|
|
227
|
+
W,
|
|
228
|
+
E,
|
|
229
|
+
_,
|
|
221
230
|
m
|
|
222
231
|
]);
|
|
223
|
-
const
|
|
232
|
+
const Te = (e) => e instanceof HTMLElement ? !!e.closest(
|
|
224
233
|
'button, a, input, textarea, select, option, [role="button"], [data-carousel-no-drag="true"]'
|
|
225
|
-
) : !1,
|
|
234
|
+
) : !1, Z = u(null), ue = u(0), Pe = (e) => {
|
|
226
235
|
var t, r, n, o;
|
|
227
|
-
|
|
228
|
-
},
|
|
229
|
-
if (!
|
|
230
|
-
const r = e.clientX -
|
|
231
|
-
Math.abs(r) > 4 && (
|
|
232
|
-
const n =
|
|
233
|
-
|
|
234
|
-
|
|
236
|
+
N && a.current && (Te(e.target) || e.pointerType === "mouse" && e.button !== 0 || (e.preventDefault(), ae(!1), L.current = !0, K.current = !1, ce.current = e.clientX, V.current = a.current.scrollLeft, se(!0), (r = (t = a.current).focus) == null || r.call(t), (o = (n = a.current).setPointerCapture) == null || o.call(n, e.pointerId)));
|
|
237
|
+
}, Me = (e) => {
|
|
238
|
+
if (!N || !L.current || (e.preventDefault(), !a.current)) return;
|
|
239
|
+
const r = e.clientX - ce.current;
|
|
240
|
+
Math.abs(r) > 4 && (K.current = !0);
|
|
241
|
+
const n = V.current - r;
|
|
242
|
+
ue.current = n, Z.current == null && (Z.current = window.requestAnimationFrame(() => {
|
|
243
|
+
Z.current = null;
|
|
235
244
|
const o = a.current;
|
|
236
|
-
o && (o.scrollLeft =
|
|
245
|
+
o && (o.scrollLeft = ue.current, s && Q("drag"));
|
|
237
246
|
}));
|
|
238
|
-
},
|
|
247
|
+
}, le = (e) => {
|
|
239
248
|
var r;
|
|
240
249
|
const t = a.current;
|
|
241
|
-
if (
|
|
250
|
+
if (L.current = !1, se(!1), t && e != null)
|
|
242
251
|
try {
|
|
243
252
|
(r = t.releasePointerCapture) == null || r.call(t, e);
|
|
244
253
|
} catch {
|
|
245
254
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}, 0)),
|
|
249
|
-
},
|
|
250
|
-
|
|
255
|
+
K.current && (Y.current = !0, window.setTimeout(() => {
|
|
256
|
+
Y.current = !1;
|
|
257
|
+
}, 0)), ae(!0), Be(), z();
|
|
258
|
+
}, je = (e) => {
|
|
259
|
+
N && L.current && le(e.pointerId);
|
|
251
260
|
}, Ae = (e) => {
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
},
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
...
|
|
259
|
-
"--carousel-gap": `${
|
|
260
|
-
"--carousel-slide-size":
|
|
261
|
-
"--carousel-snap-align":
|
|
261
|
+
N && L.current && le(e.pointerId);
|
|
262
|
+
}, De = (e) => {
|
|
263
|
+
Y.current && (e.preventDefault(), e.stopPropagation());
|
|
264
|
+
}, $e = (e) => {
|
|
265
|
+
xe && (e.key === "ArrowLeft" ? (e.preventDefault(), q()) : e.key === "ArrowRight" && (e.preventDefault(), F()));
|
|
266
|
+
}, We = {
|
|
267
|
+
...ge ?? {},
|
|
268
|
+
"--carousel-gap": `${he}px`,
|
|
269
|
+
"--carousel-slide-size": we,
|
|
270
|
+
"--carousel-snap-align": w,
|
|
271
|
+
"--carousel-button-gradient": Ie
|
|
262
272
|
};
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
|
|
265
|
-
|
|
273
|
+
return /* @__PURE__ */ fe("div", { className: T(f.root, ve), style: We, "aria-label": re, children: [
|
|
274
|
+
_e && c > 1 && /* @__PURE__ */ fe(Ee, { children: [
|
|
275
|
+
ke && /* @__PURE__ */ p("div", { className: `fullHeight ${f.navButtonCtn} ${f.navPrev}`, children: /* @__PURE__ */ p(
|
|
266
276
|
"button",
|
|
267
277
|
{
|
|
268
278
|
type: "button",
|
|
269
|
-
className:
|
|
270
|
-
onClick:
|
|
279
|
+
className: T(f.navButton),
|
|
280
|
+
onClick: q,
|
|
271
281
|
"aria-label": "Précédent",
|
|
272
|
-
children:
|
|
282
|
+
children: Re ?? /* @__PURE__ */ p("div", { className: f.defaultBtn, "aria-hidden": !0, children: "‹" })
|
|
273
283
|
}
|
|
274
|
-
),
|
|
275
|
-
|
|
284
|
+
) }),
|
|
285
|
+
Se && /* @__PURE__ */ p("div", { className: `fullHeight ${f.navButtonCtn} ${f.navNext}`, children: /* @__PURE__ */ p(
|
|
276
286
|
"button",
|
|
277
287
|
{
|
|
278
288
|
type: "button",
|
|
279
|
-
className:
|
|
280
|
-
onClick:
|
|
289
|
+
className: T(f.navButton),
|
|
290
|
+
onClick: F,
|
|
281
291
|
"aria-label": "Suivant",
|
|
282
|
-
children:
|
|
292
|
+
children: be ?? /* @__PURE__ */ p("div", { className: f.defaultBtn, "aria-hidden": !0, children: "›" })
|
|
283
293
|
}
|
|
284
|
-
)
|
|
294
|
+
) })
|
|
285
295
|
] }),
|
|
286
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ p(
|
|
287
297
|
"div",
|
|
288
298
|
{
|
|
289
299
|
ref: a,
|
|
290
|
-
className:
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
300
|
+
className: T(
|
|
301
|
+
f.viewport,
|
|
302
|
+
N && f.dragEnabled,
|
|
303
|
+
ze && f.dragging,
|
|
304
|
+
me
|
|
295
305
|
),
|
|
296
306
|
tabIndex: 0,
|
|
297
307
|
role: "region",
|
|
298
308
|
"aria-roledescription": "carousel",
|
|
299
|
-
"aria-label":
|
|
300
|
-
onKeyDown:
|
|
309
|
+
"aria-label": re,
|
|
310
|
+
onKeyDown: $e,
|
|
301
311
|
onPointerDown: Pe,
|
|
302
|
-
onPointerMove:
|
|
303
|
-
onPointerUp:
|
|
312
|
+
onPointerMove: Me,
|
|
313
|
+
onPointerUp: je,
|
|
304
314
|
onPointerCancel: Ae,
|
|
305
|
-
onClickCapture:
|
|
306
|
-
children:
|
|
315
|
+
onClickCapture: De,
|
|
316
|
+
children: _.map((e, t) => /* @__PURE__ */ p(
|
|
307
317
|
"div",
|
|
308
318
|
{
|
|
309
319
|
ref: (r) => {
|
|
310
320
|
x.current[t] = r;
|
|
311
321
|
},
|
|
312
|
-
className:
|
|
322
|
+
className: T(f.slide, pe),
|
|
313
323
|
"data-carousel-slide": !0,
|
|
314
324
|
"data-carousel-clone": e.isClone ? "true" : "false",
|
|
315
|
-
"aria-label": `Item ${e.realIndex + 1} sur ${
|
|
316
|
-
"aria-current": e.realIndex ===
|
|
325
|
+
"aria-label": `Item ${e.realIndex + 1} sur ${c}`,
|
|
326
|
+
"aria-current": e.realIndex === Ce,
|
|
317
327
|
children: e.node
|
|
318
328
|
},
|
|
319
329
|
e.key
|
|
@@ -324,5 +334,5 @@ import '../../styles/Carousel.css';const Be = "_root_36mqp_6", $e = "_viewport_3
|
|
|
324
334
|
}
|
|
325
335
|
);
|
|
326
336
|
export {
|
|
327
|
-
|
|
337
|
+
rt as Carousel
|
|
328
338
|
};
|
package/dist/styles/Carousel.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._root_zgsjf_6{position:relative;width:100%}._viewport_zgsjf_11{display:flex;gap:var(--carousel-gap, 12px);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;padding:4px;scrollbar-width:none}._viewport_zgsjf_11::-webkit-scrollbar{display:none}._dragEnabled_zgsjf_27{cursor:grab;touch-action:pan-y}._dragging_zgsjf_32{cursor:grabbing;scroll-behavior:auto;scroll-snap-type:none;-webkit-user-select:none;user-select:none}._slide_zgsjf_39{flex:0 0 var(--carousel-slide-size, 280px);width:var(--carousel-slide-size, 280px);scroll-snap-align:var(--carousel-snap-align, start);min-width:0}._navButtonCtn_zgsjf_46{z-index:2;display:flex;justify-content:center;align-items:center;position:absolute;height:100%;width:54px}._navButton_zgsjf_46{z-index:2;background:none;border:none;cursor:pointer;-webkit-user-select:none;user-select:none}._defaultBtn_zgsjf_64{z-index:2;width:36px;height:36px;color:var(--button-tertiary-default-border);font-size:18px;border:1px solid var(--button-tertiary-default-border);border-radius:999px;display:flex;align-items:center;justify-content:center;background:var(--carousel-button-background, var(--background-primary));box-shadow:0 2px 8px #00000026;cursor:pointer;-webkit-user-select:none;user-select:none}._navPrev_zgsjf_81{background:linear-gradient(90deg,var(--carousel-button-gradient) 0%,rgba(255,255,255,0) 100%);left:0}._navNext_zgsjf_86{background:linear-gradient(90deg,rgba(255,255,255,0) 0%,var(--carousel-button-gradient) 100%);right:0}
|