@smwb/ui-react 2.1.2 → 2.1.3

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 +1 @@
1
- .smwb-carousel{max-width:var(--smwb-carousel-max-width, 412px)}.smwb-carousel__inner{position:relative}.smwb-carousel__track{text-align:center;overflow:hidden;cursor:pointer;margin-left:calc(-1 * var(--smwb-carousel-gap, 4px));margin-right:calc(-1 * var(--smwb-carousel-gap, 4px));touch-action:pan-y}.smwb-carousel__layer{width:100%;height:100%;display:flex;will-change:transform}.smwb-carousel__slide{flex-shrink:0;padding-left:var(--smwb-carousel-gap, 4px);padding-right:var(--smwb-carousel-gap, 4px)}.smwb-carousel__slide-inner{border-radius:28px;overflow:hidden;will-change:width}.smwb-carousel__slide-inner_clickable{cursor:zoom-in}.smwb-carousel__slide-inner img{height:var(--smwb-carousel-cell-height, 205px);aspect-ratio:var(--smwb-carousel-aspect-ratio, .9);object-fit:cover;width:100%;user-select:none;-webkit-user-drag:none}.smwb-carousel__navigation{display:flex;justify-content:center}.smwb-carousel__navigation .current{background-color:var(--smui-onPrimaryContainerActive)}.smwb-carousel__navigation__dot{margin:3px;width:10px;height:10px;border-radius:50%;border:1px solid var(--smui-onPrimaryContainer)}.smwb-carousel__arrow{cursor:pointer;position:absolute;background:var(--smui-onPrimaryContainerActive);color:var(--smui-onPrimaryContainer);border-radius:50%;z-index:1;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-content{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-stage{display:flex;align-items:center;justify-content:center;max-width:100%;max-height:100%}.smwb-carousel__fullscreen-stage img{max-width:96vw;max-height:92vh;width:auto;height:auto;object-fit:contain;user-select:none;-webkit-user-drag:none}.smwb-carousel__fullscreen-arrow,.smwb-carousel__fullscreen-close{position:absolute;z-index:1;cursor:pointer;color:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.6))}.smwb-carousel__fullscreen-arrow{top:50%;transform:translateY(-50%)}.smwb-carousel__fullscreen-arrow_prev{left:16px}.smwb-carousel__fullscreen-arrow_next{right:16px}.smwb-carousel__fullscreen-close{top:16px;right:16px}
1
+ .smwb-carousel{max-width:var(--smwb-carousel-max-width, 412px)}.smwb-carousel__inner{position:relative}.smwb-carousel__track{text-align:center;overflow:hidden;cursor:pointer;margin-left:calc(-1 * var(--smwb-carousel-gap, 4px));margin-right:calc(-1 * var(--smwb-carousel-gap, 4px));touch-action:pan-y}.smwb-carousel__layer{width:100%;height:100%;display:flex;will-change:transform}.smwb-carousel__slide{flex-shrink:0;padding-left:var(--smwb-carousel-gap, 4px);padding-right:var(--smwb-carousel-gap, 4px)}.smwb-carousel__slide-inner{border-radius:28px;overflow:hidden;will-change:width}.smwb-carousel__slide-inner_clickable{cursor:zoom-in}.smwb-carousel__slide-inner img{height:var(--smwb-carousel-cell-height, 205px);aspect-ratio:var(--smwb-carousel-aspect-ratio, .9);object-fit:cover;width:100%;user-select:none;-webkit-user-drag:none}.smwb-carousel__navigation{display:flex;justify-content:center}.smwb-carousel__navigation .current{background-color:var(--smui-onPrimaryContainerActive)}.smwb-carousel__navigation__dot{margin:3px;width:10px;height:10px;border-radius:50%;border:1px solid var(--smui-onPrimaryContainer)}.smwb-carousel__arrow{cursor:pointer;position:absolute;background:var(--smui-onPrimaryContainerActive);color:var(--smui-onPrimaryContainer);border-radius:50%;z-index:1;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-content{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-stage{position:relative;width:100%;height:100%;overflow:hidden;touch-action:pan-y}.smwb-carousel__fullscreen-track{display:flex;width:100%;height:100%;will-change:transform}.smwb-carousel__fullscreen-slide{flex:0 0 100%;display:flex;align-items:center;justify-content:center}.smwb-carousel__fullscreen-slide img{max-width:96vw;max-height:92vh;width:auto;height:auto;object-fit:contain;user-select:none;-webkit-user-drag:none}.smwb-carousel__fullscreen-arrow,.smwb-carousel__fullscreen-close{position:absolute;z-index:1;cursor:pointer;color:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.6))}.smwb-carousel__fullscreen-arrow{top:50%;transform:translateY(-50%)}.smwb-carousel__fullscreen-arrow_prev{left:16px}.smwb-carousel__fullscreen-arrow_next{right:16px}.smwb-carousel__fullscreen-close{top:16px;right:16px}
@@ -1,14 +1,14 @@
1
- import { jsx as a, Fragment as ie, jsxs as j } from "react/jsx-runtime";
1
+ import { jsx as a, Fragment as de, jsxs as j } from "react/jsx-runtime";
2
2
  import '../../../assets/styles/less/components/carousel/carousel.entry.css';/* empty css */
3
- import O, { forwardRef as Oe, useState as x, useRef as T, useId as ze, useEffect as ue } from "react";
4
- import m from "clsx";
5
- import { useForkRef as Be } from "../../../hooks/useForkRef.js";
6
- import { dragPrevent as de, getStartSlide as He, getSlidesToShow as Ke, isMouseEvent as fe, coordX as z, coordY as me, getSlideStyle as Ge, isTouchEvent as qe, getSlideWidth as Je, clamp as Qe, toCssLength as B, toCssNumber as Ue, getSlideIndexForMultipleParts as he } from "./utils.js";
7
- import { useSafeLayoutEffect as _e } from "../../../hooks/useSafeLayoutEffect.js";
3
+ import z, { forwardRef as qe, useState as _, useRef as N, useId as Je, useEffect as fe } from "react";
4
+ import h from "clsx";
5
+ import { useForkRef as Qe } from "../../../hooks/useForkRef.js";
6
+ import { dragPrevent as me, getStartSlide as Ue, getSlidesToShow as Ze, isMouseEvent as he, coordX as O, coordY as _e, getSlideStyle as et, isTouchEvent as tt, getSlideWidth as st, clamp as rt, toCssLength as B, toCssNumber as nt, getSlideIndexForMultipleParts as we } from "./utils.js";
7
+ import { useSafeLayoutEffect as ge } from "../../../hooks/useSafeLayoutEffect.js";
8
8
  import { useEventCallback as H } from "../../../hooks/useEventCallback.js";
9
- import { Icon as E } from "../../base/icon/icon.js";
10
- import { Modal as Ze } from "../../feedBack/modal/modal.js";
11
- const et = {
9
+ import { Icon as M } from "../../base/icon/icon.js";
10
+ import { Modal as ot } from "../../feedBack/modal/modal.js";
11
+ const ct = {
12
12
  isPressed: !1,
13
13
  startX: 0,
14
14
  startY: 0,
@@ -16,272 +16,291 @@ const et = {
16
16
  lastT: 0,
17
17
  axis: null,
18
18
  dragged: !1
19
- }, we = 8, tt = 0.4, ht = Oe(function({
20
- slidesToShow: ve = 3,
21
- startSlide: ge = 0,
22
- children: w,
23
- className: be,
24
- showNavigation: xe = !0,
25
- showArrows: pe,
19
+ }, ve = 8, at = 0.4, xt = qe(function({
20
+ slidesToShow: be = 3,
21
+ startSlide: xe = 0,
22
+ children: g,
23
+ className: pe,
24
+ showNavigation: Se = !0,
25
+ showArrows: ye,
26
26
  arrowsSize: v = 30,
27
- navigationClassName: Se,
28
- onSlideChange: g,
27
+ navigationClassName: Ie,
28
+ onSlideChange: b,
29
29
  navigationDotRenderer: K,
30
- "aria-label": Ie = "Carousel",
30
+ "aria-label": Te = "Carousel",
31
31
  autoplay: G = !1,
32
32
  autoplayInterval: q = 4e3,
33
- pauseOnHover: M = !0,
34
- cellHeight: ye,
35
- aspectRatio: Ne,
36
- gap: Te,
33
+ pauseOnHover: k = !0,
34
+ cellHeight: Ne,
35
+ aspectRatio: Me,
36
+ gap: ke,
37
37
  maxWidth: Ee,
38
- enableFullscreen: k = !1
39
- }, Me) {
40
- const s = O.Children.count(w), n = Ke(ve, s), L = He(ge, s), J = pe && s > 1, X = Math.max(0, s - n), [l, Q] = x(L), [Y, $] = x({
38
+ enableFullscreen: E = !1
39
+ }, Xe) {
40
+ const s = z.Children.count(g), o = Ze(be, s), X = Ue(xe, s), J = ye && s > 1, L = Math.max(0, s - o), [l, Q] = _(X), [F, Y] = _({
41
41
  animation: void 0
42
- }), [ke, U] = x(0), [Le, Z] = x(!1), [h, A] = x(null), P = T(null), Xe = T(null), Ae = Be(Me, Xe), f = T(null), [ee, te] = x(!1), i = T({ ...et });
43
- _e(() => {
44
- $((e) => ({
42
+ }), [Le, U] = _(0), [Pe, Z] = _(!1), [u, P] = _(null), [De, ee] = _(0), [Ae, te] = _(!1), D = N(null), Ce = N(null), Re = Qe(Xe, Ce), m = N(null), [se, re] = _(!1), i = N({ ...ct });
43
+ ge(() => {
44
+ Y((e) => ({
45
45
  ...e,
46
46
  animation: !1
47
47
  }));
48
- }, [n]), _e(() => {
49
- Q(L), g == null || g(L), Y.animation !== void 0 && $((e) => ({
48
+ }, [o]), ge(() => {
49
+ Q(X), b == null || b(X), F.animation !== void 0 && Y((e) => ({
50
50
  ...e,
51
51
  animation: !0
52
52
  }));
53
- }, [L]);
54
- const F = (e) => {
53
+ }, [X]);
54
+ const $ = (e) => {
55
55
  Object.assign(i.current, e);
56
- }, V = () => typeof performance != "undefined" ? performance.now() : Date.now(), se = (e) => {
57
- const t = Qe(e, 0, X);
58
- Q(t), $((r) => ({ ...r, animation: !0 })), g == null || g(t);
59
- }, p = (e) => {
60
- A((t) => t === null ? t : (t + e + s) % s);
61
- }, S = T(null), Pe = (e) => {
62
- f.current && (f.current.removeEventListener(e ? "mousemove" : "touchmove", ne), f.current.removeEventListener(e ? "mouseup" : "touchend", b), e && f.current.removeEventListener("mouseleave", b));
63
- }, re = H((e) => {
64
- if (!f.current)
56
+ }, V = () => typeof performance != "undefined" ? performance.now() : Date.now(), ne = (e) => {
57
+ const t = rt(e, 0, L);
58
+ Q(t), Y((r) => ({ ...r, animation: !0 })), b == null || b(t);
59
+ }, S = (e) => {
60
+ P((t) => t === null ? t : (t + e + s) % s);
61
+ }, x = N(null), Fe = (e) => {
62
+ m.current && (m.current.removeEventListener(e ? "mousemove" : "touchmove", ce), m.current.removeEventListener(e ? "mouseup" : "touchend", p), e && m.current.removeEventListener("mouseleave", p));
63
+ }, oe = H((e) => {
64
+ if (!m.current)
65
65
  return;
66
- const t = fe(e);
66
+ const t = he(e);
67
67
  if (t && e.button !== 0)
68
68
  return;
69
69
  e.stopPropagation();
70
- const r = z(e), o = me(e);
71
- F({
70
+ const r = O(e), n = _e(e);
71
+ $({
72
72
  isPressed: !0,
73
73
  startX: r,
74
- startY: o,
74
+ startY: n,
75
75
  lastX: r,
76
76
  lastT: V(),
77
77
  axis: null,
78
78
  dragged: !1
79
- }), f.current.addEventListener(t ? "mousemove" : "touchmove", ne, { passive: !1 }), f.current.addEventListener(t ? "mouseup" : "touchend", b), t && f.current.addEventListener("mouseleave", b);
80
- }), ne = H((e) => {
81
- if (!P.current || !i.current.isPressed)
79
+ }), m.current.addEventListener(t ? "mousemove" : "touchmove", ce, { passive: !1 }), m.current.addEventListener(t ? "mouseup" : "touchend", p), t && m.current.addEventListener("mouseleave", p);
80
+ }), ce = H((e) => {
81
+ if (!D.current || !i.current.isPressed)
82
82
  return;
83
- if (qe(e) && e.touches.length > 1)
84
- return b(e);
85
- const t = z(e), r = me(e), o = t - i.current.startX, c = r - i.current.startY;
83
+ if (tt(e) && e.touches.length > 1)
84
+ return p(e);
85
+ const t = O(e), r = _e(e), n = t - i.current.startX, c = r - i.current.startY;
86
86
  if (i.current.axis === null) {
87
- if (Math.abs(o) < we && Math.abs(c) < we)
87
+ if (Math.abs(n) < ve && Math.abs(c) < ve)
88
88
  return;
89
- const u = Math.abs(o) >= Math.abs(c) ? "x" : "y";
90
- if (F({ axis: u, dragged: !0 }), u === "y")
91
- return b(e);
89
+ const d = Math.abs(n) >= Math.abs(c) ? "x" : "y";
90
+ if ($({ axis: d, dragged: !0 }), d === "y")
91
+ return p(e);
92
92
  s > 1 && Z(!0);
93
93
  }
94
94
  if (i.current.axis === "x") {
95
95
  if (e.preventDefault(), e.stopPropagation(), s > 1) {
96
- const u = l <= 0, d = l >= X, _ = u && o > 0 || d && o < 0 ? o * 0.35 : o;
97
- U(_);
96
+ const d = l <= 0, f = l >= L, w = d && n > 0 || f && n < 0 ? n * 0.35 : n;
97
+ U(w);
98
98
  }
99
99
  i.current.lastX = t, i.current.lastT = V();
100
100
  }
101
- }), b = H((e) => {
101
+ }), p = H((e) => {
102
102
  if (!i.current.isPressed)
103
103
  return;
104
- const t = fe(e);
105
- Pe(t);
106
- const { axis: r, dragged: o, startX: c, lastX: u, lastT: d } = i.current;
107
- if (F({ isPressed: !1 }), Z(!1), r === "x" && o && s > 1 && P.current) {
108
- const _ = z(e), D = _ - c, y = P.current.offsetWidth / n, R = d ? (_ - u) / Math.max(1, V() - d) : 0;
109
- let N = y > 0 ? Math.round(-D / y) : 0;
110
- N === 0 && Math.abs(R) > tt && (N = R < 0 ? 1 : -1), se(l + N);
104
+ const t = he(e);
105
+ Fe(t);
106
+ const { axis: r, dragged: n, startX: c, lastX: d, lastT: f } = i.current;
107
+ if ($({ isPressed: !1 }), Z(!1), r === "x" && n && s > 1 && D.current) {
108
+ const w = O(e), C = w - c, I = D.current.offsetWidth / o, R = f ? (w - d) / Math.max(1, V() - f) : 0;
109
+ let T = I > 0 ? Math.round(-C / I) : 0;
110
+ T === 0 && Math.abs(R) > at && (T = R < 0 ? 1 : -1), ne(l + T);
111
111
  }
112
112
  U(0);
113
- }), Ce = (e) => () => {
114
- i.current.dragged || k && A(e);
115
- }, C = (e) => () => se(e), W = (e) => {
116
- const t = n === 1, r = t ? s : Math.ceil(s / n), o = l + n, c = s - n <= l, d = (he(o, n, s, c) + e + r) % r;
117
- return t ? d : d * n;
118
- }, De = () => {
119
- if (!xe)
120
- return /* @__PURE__ */ a(ie, {});
121
- const e = s - n <= l, t = n === 1, r = t ? s : Math.ceil(s / n), o = [];
113
+ }), Ye = (e) => () => {
114
+ i.current.dragged || E && P(e);
115
+ }, A = (e) => () => ne(e), W = (e) => {
116
+ const t = o === 1, r = t ? s : Math.ceil(s / o), n = l + o, c = s - o <= l, f = (we(n, o, s, c) + e + r) % r;
117
+ return t ? f : f * o;
118
+ }, $e = () => {
119
+ if (!Se)
120
+ return /* @__PURE__ */ a(de, {});
121
+ const e = s - o <= l, t = o === 1, r = t ? s : Math.ceil(s / o), n = [];
122
122
  for (let c = 0; c < r; c++) {
123
- let u = c, d = l;
123
+ let d = c, f = l;
124
124
  if (!t) {
125
- const R = c === r - 1, N = l + n;
126
- u = R ? s - n : c * n, d = he(N, n, s, e);
125
+ const R = c === r - 1, T = l + o;
126
+ d = R ? s - o : c * o, f = we(T, o, s, e);
127
127
  }
128
- const _ = d === c, D = C(u);
129
- let y = /* @__PURE__ */ a("div", { className: m("smwb-carousel__navigation__dot", _ && "current"), onClick: D }, c);
130
- K && (y = K(c, _, D)), o.push(y);
128
+ const w = f === c, C = A(d);
129
+ let I = /* @__PURE__ */ a("div", { className: h("smwb-carousel__navigation__dot", w && "current"), onClick: C }, c);
130
+ K && (I = K(c, w, C)), n.push(I);
131
131
  }
132
- return /* @__PURE__ */ a("div", { className: m("smwb-carousel__navigation", Se), children: o });
133
- }, Re = () => {
134
- const e = l > X ? X : l;
135
- return Je(n) * e;
136
- }, Ye = ze(), $e = Ge(n), Fe = {
137
- transform: `translateX(calc(-${Re()}% + ${ke}px))`,
138
- transition: Le || Y.animation === void 0 ? "none" : Y.animation ? "transform 500ms cubic-bezier(.1, 0, .25, 1)" : "none"
139
- }, I = {}, oe = B(ye), ce = Ue(Ne), ae = B(Te), le = B(Ee);
140
- if (oe && (I["--smwb-carousel-cell-height"] = oe), ce && (I["--smwb-carousel-aspect-ratio"] = ce), ae && (I["--smwb-carousel-gap"] = ae), le && (I["--smwb-carousel-max-width"] = le), O.useEffect(() => {
141
- Array.isArray(w) || console.error("SMWB Material: The `children` prop was passed invalidly. It should contain an array of elements.");
142
- }, [w]), ue(() => {
143
- if (!G || s <= 1 || M && ee || h !== null)
132
+ return /* @__PURE__ */ a("div", { className: h("smwb-carousel__navigation", Ie), children: n });
133
+ }, Ve = () => {
134
+ const e = l > L ? L : l;
135
+ return st(o) * e;
136
+ }, We = Je(), je = et(o), ze = {
137
+ transform: `translateX(calc(-${Ve()}% + ${Le}px))`,
138
+ transition: Pe || F.animation === void 0 ? "none" : F.animation ? "transform 500ms cubic-bezier(.1, 0, .25, 1)" : "none"
139
+ }, y = {}, ae = B(Ne), le = nt(Me), ie = B(ke), ue = B(Ee);
140
+ if (ae && (y["--smwb-carousel-cell-height"] = ae), le && (y["--smwb-carousel-aspect-ratio"] = le), ie && (y["--smwb-carousel-gap"] = ie), ue && (y["--smwb-carousel-max-width"] = ue), z.useEffect(() => {
141
+ Array.isArray(g) || console.error("SMWB Material: The `children` prop was passed invalidly. It should contain an array of elements.");
142
+ }, [g]), fe(() => {
143
+ if (!G || s <= 1 || k && se || u !== null)
144
144
  return;
145
145
  const e = window.setInterval(() => {
146
- C(W(1))();
146
+ A(W(1))();
147
147
  }, q);
148
148
  return () => window.clearInterval(e);
149
149
  }, [
150
150
  G,
151
151
  q,
152
- M,
153
- ee,
152
+ k,
153
+ se,
154
154
  s,
155
155
  l,
156
- n,
157
- h
158
- ]), ue(() => {
159
- if (h === null || s <= 1)
156
+ o,
157
+ u
158
+ ]), fe(() => {
159
+ if (u === null || s <= 1)
160
160
  return;
161
161
  const e = (t) => {
162
- t.key === "ArrowLeft" ? p(-1) : t.key === "ArrowRight" && p(1);
162
+ t.key === "ArrowLeft" ? S(-1) : t.key === "ArrowRight" && S(1);
163
163
  };
164
164
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
165
- }, [h, s]), !Array.isArray(w))
166
- return /* @__PURE__ */ a(ie, {});
167
- const Ve = w, We = (e) => {
165
+ }, [u, s]), !Array.isArray(g))
166
+ return /* @__PURE__ */ a(de, {});
167
+ const Oe = g, Be = (e) => {
168
168
  var t, r;
169
- S.current = (r = (t = e.touches[0]) == null ? void 0 : t.clientX) != null ? r : null;
170
- }, je = (e) => {
171
- var r, o;
172
- if (S.current === null || s <= 1)
169
+ x.current = (r = (t = e.touches[0]) == null ? void 0 : t.clientX) != null ? r : null;
170
+ }, He = (e) => {
171
+ var r, n;
172
+ if (x.current === null || s <= 1)
173
173
  return;
174
- const t = ((o = (r = e.changedTouches[0]) == null ? void 0 : r.clientX) != null ? o : S.current) - S.current;
175
- S.current = null, Math.abs(t) > 40 && p(t < 0 ? 1 : -1);
174
+ const t = ((n = (r = e.touches[0]) == null ? void 0 : r.clientX) != null ? n : x.current) - x.current;
175
+ te(!0), ee(t);
176
+ }, Ke = (e) => {
177
+ var n, c;
178
+ const t = x.current;
179
+ if (x.current = null, te(!1), ee(0), t === null || s <= 1)
180
+ return;
181
+ const r = ((c = (n = e.changedTouches[0]) == null ? void 0 : n.clientX) != null ? c : t) - t;
182
+ Math.abs(r) > 40 && S(r < 0 ? 1 : -1);
183
+ }, Ge = {
184
+ transform: `translateX(calc(-${(u != null ? u : 0) * 100}% + ${De}px))`,
185
+ transition: Ae ? "none" : "transform 350ms cubic-bezier(.22, .61, .36, 1)"
176
186
  };
177
187
  return /* @__PURE__ */ j(
178
188
  "div",
179
189
  {
180
- className: m("smwb-carousel", be),
190
+ className: h("smwb-carousel", pe),
181
191
  "data-testid": "carousel",
182
- ref: Ae,
192
+ ref: Re,
183
193
  role: "region",
184
194
  "aria-roledescription": "carousel",
185
- "aria-label": Ie,
186
- style: I,
187
- onMouseEnter: M ? () => te(!0) : void 0,
188
- onMouseLeave: M ? () => te(!1) : void 0,
195
+ "aria-label": Te,
196
+ style: y,
197
+ onMouseEnter: k ? () => re(!0) : void 0,
198
+ onMouseLeave: k ? () => re(!1) : void 0,
189
199
  children: [
190
- /* @__PURE__ */ j("div", { className: m("smwb-carousel__inner"), ref: P, children: [
200
+ /* @__PURE__ */ j("div", { className: h("smwb-carousel__inner"), ref: D, children: [
191
201
  J && /* @__PURE__ */ a(
192
- E,
202
+ M,
193
203
  {
194
204
  name: "chevron_left",
195
205
  size: v,
196
- className: m("smwb-carousel__arrow", "smwb-carousel__arrow_prev"),
206
+ className: h("smwb-carousel__arrow", "smwb-carousel__arrow_prev"),
197
207
  style: {
198
208
  top: `calc(50% - ${v / 2}px)`,
199
209
  left: -v / 2
200
210
  },
201
- onClick: () => C(W(-1))()
211
+ onClick: () => A(W(-1))()
202
212
  }
203
213
  ),
204
214
  /* @__PURE__ */ a(
205
215
  "div",
206
216
  {
207
- ref: f,
217
+ ref: m,
208
218
  className: "smwb-carousel__track",
209
- onMouseDown: re,
210
- onTouchStart: re,
211
- onDragStart: de,
212
- onDragEnd: de,
213
- children: /* @__PURE__ */ a("div", { className: "smwb-carousel__layer", style: Fe, children: O.Children.map(w, (e, t) => /* @__PURE__ */ a("div", { id: `${Ye}${t}`, className: "smwb-carousel__slide", style: $e, children: /* @__PURE__ */ a(
219
+ onMouseDown: oe,
220
+ onTouchStart: oe,
221
+ onDragStart: me,
222
+ onDragEnd: me,
223
+ children: /* @__PURE__ */ a("div", { className: "smwb-carousel__layer", style: ze, children: z.Children.map(g, (e, t) => /* @__PURE__ */ a("div", { id: `${We}${t}`, className: "smwb-carousel__slide", style: je, children: /* @__PURE__ */ a(
214
224
  "div",
215
225
  {
216
- className: m(
226
+ className: h(
217
227
  "smwb-carousel__slide-inner",
218
- k && "smwb-carousel__slide-inner_clickable"
228
+ E && "smwb-carousel__slide-inner_clickable"
219
229
  ),
220
- onClick: k ? Ce(t) : void 0,
230
+ onClick: E ? Ye(t) : void 0,
221
231
  children: e
222
232
  }
223
233
  ) }, t)) })
224
234
  }
225
235
  ),
226
236
  J && /* @__PURE__ */ a(
227
- E,
237
+ M,
228
238
  {
229
239
  name: "chevron_right",
230
240
  size: v,
231
- className: m("smwb-carousel__arrow", "smwb-carousel__arrow_next"),
241
+ className: h("smwb-carousel__arrow", "smwb-carousel__arrow_next"),
232
242
  style: {
233
243
  top: `calc(50% - ${v / 2}px)`,
234
244
  right: -v / 2
235
245
  },
236
- onClick: () => C(W(1))()
246
+ onClick: () => A(W(1))()
237
247
  }
238
248
  )
239
249
  ] }),
240
- De(),
241
- k && /* @__PURE__ */ a(
242
- Ze,
250
+ $e(),
251
+ E && /* @__PURE__ */ a(
252
+ ot,
243
253
  {
244
- open: h !== null,
254
+ open: u !== null,
245
255
  size: "fullscreen",
246
256
  backdrop: "darkBlured",
247
257
  className: "smwb-carousel__fullscreen",
248
- onClose: () => A(null),
258
+ onClose: () => P(null),
249
259
  "aria-label": "Image viewer",
250
- children: h !== null && /* @__PURE__ */ j("div", { className: "smwb-carousel__fullscreen-content", children: [
260
+ children: u !== null && /* @__PURE__ */ j("div", { className: "smwb-carousel__fullscreen-content", children: [
251
261
  s > 1 && /* @__PURE__ */ a(
252
- E,
262
+ M,
253
263
  {
254
264
  name: "chevron_left",
255
265
  size: 40,
256
- className: m("smwb-carousel__fullscreen-arrow", "smwb-carousel__fullscreen-arrow_prev"),
257
- onClick: () => p(-1)
266
+ className: h("smwb-carousel__fullscreen-arrow", "smwb-carousel__fullscreen-arrow_prev"),
267
+ onClick: () => S(-1)
258
268
  }
259
269
  ),
260
270
  /* @__PURE__ */ a(
261
271
  "div",
262
272
  {
263
273
  className: "smwb-carousel__fullscreen-stage",
264
- onTouchStart: We,
265
- onTouchEnd: je,
266
- children: Ve[h]
274
+ onTouchStart: Be,
275
+ onTouchMove: He,
276
+ onTouchEnd: Ke,
277
+ children: /* @__PURE__ */ a("div", { className: "smwb-carousel__fullscreen-track", style: Ge, children: Oe.map((e, t) => /* @__PURE__ */ a(
278
+ "div",
279
+ {
280
+ className: "smwb-carousel__fullscreen-slide",
281
+ "aria-hidden": t !== u,
282
+ children: e
283
+ },
284
+ t
285
+ )) })
267
286
  }
268
287
  ),
269
288
  s > 1 && /* @__PURE__ */ a(
270
- E,
289
+ M,
271
290
  {
272
291
  name: "chevron_right",
273
292
  size: 40,
274
- className: m("smwb-carousel__fullscreen-arrow", "smwb-carousel__fullscreen-arrow_next"),
275
- onClick: () => p(1)
293
+ className: h("smwb-carousel__fullscreen-arrow", "smwb-carousel__fullscreen-arrow_next"),
294
+ onClick: () => S(1)
276
295
  }
277
296
  ),
278
297
  /* @__PURE__ */ a(
279
- E,
298
+ M,
280
299
  {
281
300
  name: "close",
282
301
  size: 32,
283
302
  className: "smwb-carousel__fullscreen-close",
284
- onClick: () => A(null)
303
+ onClick: () => P(null)
285
304
  }
286
305
  )
287
306
  ] })
@@ -292,6 +311,6 @@ const et = {
292
311
  );
293
312
  });
294
313
  export {
295
- ht as Carousel
314
+ xt as Carousel
296
315
  };
297
316
  //# sourceMappingURL=carousel.js.map