@telefonica/mistica 14.4.0 → 14.5.0
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/css/mistica.css +1 -1
- package/dist/button.css-mistica.js +1 -1
- package/dist/button.css.d.ts +1 -1
- package/dist/card.d.ts +19 -0
- package/dist/card.js +237 -142
- package/dist/carousel.js +116 -115
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/list.css-mistica.js +9 -8
- package/dist/list.css.d.ts +1 -0
- package/dist/list.d.ts +1 -0
- package/dist/list.js +126 -89
- package/dist/package-version.js +1 -1
- package/dist/progress-bar.css-mistica.js +5 -3
- package/dist/progress-bar.css.d.ts +2 -0
- package/dist/progress-bar.d.ts +1 -0
- package/dist/progress-bar.js +12 -6
- package/dist-es/button.css-mistica.js +1 -1
- package/dist-es/card.js +291 -197
- package/dist-es/carousel.js +164 -163
- package/dist-es/index.js +1703 -1703
- package/dist-es/list.css-mistica.js +2 -2
- package/dist-es/list.js +191 -154
- package/dist-es/package-version.js +1 -1
- package/dist-es/progress-bar.css-mistica.js +2 -2
- package/dist-es/progress-bar.js +13 -12
- package/dist-es/style.css +1 -1
- package/package.json +2 -2
package/dist-es/carousel.js
CHANGED
|
@@ -51,33 +51,33 @@ function _objectSpreadProps(target, source) {
|
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
53
|
import * as c from "react";
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import { useScreenSize as
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import { BaseTouchable as
|
|
60
|
-
import
|
|
61
|
-
import { useIsInverseVariant as
|
|
62
|
-
import { MediaBorderRadiusProvider as
|
|
63
|
-
import { listenResize as
|
|
64
|
-
import { isAndroid as
|
|
65
|
-
import { useDocumentVisibility as
|
|
66
|
-
import { slideshowContainer as
|
|
67
|
-
import { assignInlineVars as
|
|
68
|
-
import { sprinkles as
|
|
69
|
-
import { useDesktopContainerType as
|
|
54
|
+
import $ from "./generated/mistica-icons/icon-chevron-left-regular.js";
|
|
55
|
+
import ee from "./generated/mistica-icons/icon-chevron-right-regular.js";
|
|
56
|
+
import { useScreenSize as te, useTheme as se, useIsInViewport as be, useIsomorphicLayoutEffect as ve } from "./hooks.js";
|
|
57
|
+
import Ie from "./inline.js";
|
|
58
|
+
import Pe from "./stack.js";
|
|
59
|
+
import { BaseTouchable as M } from "./touchable.js";
|
|
60
|
+
import Q from "classnames";
|
|
61
|
+
import { useIsInverseVariant as xe, ThemeVariant as A } from "./theme-variant-context.js";
|
|
62
|
+
import { MediaBorderRadiusProvider as we } from "./image.js";
|
|
63
|
+
import { listenResize as oe, getPrefixedDataAttributes as Se } from "./utils/dom.js";
|
|
64
|
+
import { isAndroid as re } from "./utils/platform.js";
|
|
65
|
+
import { useDocumentVisibility as ke } from "./utils/document-visibility.js";
|
|
66
|
+
import { slideshowContainer as Le, slideshowPrevArrowButton as Ce, slideshow as Ne, slideshowItem as Re, slideshowNextArrowButton as Ae, slideshowBullets as Me, bulletActiveInverse as Be, bulletInverse as Ee, bulletActive as Te, bullet as ye, carouselContainer as We, carouselPrevArrowButton as De, carousel as Ve, centeredCarousel as ze, carouselWithScroll as Oe, vars as _, carouselItem as je, carouselNextArrowButton as _e, carouselBullets as Fe } from "./carousel.css-mistica.js";
|
|
67
|
+
import { assignInlineVars as Ue } from "@vanilla-extract/dynamic";
|
|
68
|
+
import { sprinkles as qe } from "./sprinkles.css-mistica.js";
|
|
69
|
+
import { useDesktopContainerType as Ye } from "./desktop-container-type-context.js";
|
|
70
70
|
import { jsx as s, jsxs as G } from "./_virtual/jsx-runtime.js";
|
|
71
|
-
const
|
|
72
|
-
const t =
|
|
73
|
-
return
|
|
74
|
-
},
|
|
71
|
+
const le = (e, r)=>{
|
|
72
|
+
const t = ke();
|
|
73
|
+
return be(r, !1) && t && !!e;
|
|
74
|
+
}, ne = (param)=>{
|
|
75
75
|
let { currentIndex: e , numPages: r , onPress: t } = param;
|
|
76
|
-
const o =
|
|
77
|
-
const
|
|
78
|
-
return o ?
|
|
76
|
+
const o = xe(), { isDesktopOrBigger: u } = te(), m = (P)=>{
|
|
77
|
+
const f = P === e;
|
|
78
|
+
return o ? f ? Be : Ee : f ? Te : ye;
|
|
79
79
|
};
|
|
80
|
-
return /* @__PURE__ */ s(
|
|
80
|
+
return /* @__PURE__ */ s(Ie, {
|
|
81
81
|
space: u ? 16 : 8,
|
|
82
82
|
alignItems: "center",
|
|
83
83
|
dataAttributes: {
|
|
@@ -85,21 +85,21 @@ const oe = (e, r)=>{
|
|
|
85
85
|
},
|
|
86
86
|
children: Array.from({
|
|
87
87
|
length: r
|
|
88
|
-
}, (P,
|
|
89
|
-
className:
|
|
88
|
+
}, (P, f)=>/* @__PURE__ */ s(M, {
|
|
89
|
+
className: qe({
|
|
90
90
|
display: "block",
|
|
91
91
|
padding: 0,
|
|
92
92
|
border: "none",
|
|
93
93
|
background: "transparent"
|
|
94
94
|
}),
|
|
95
95
|
maybe: !0,
|
|
96
|
-
onPress: u && t ? ()=>t(
|
|
96
|
+
onPress: u && t ? ()=>t(f) : void 0,
|
|
97
97
|
children: /* @__PURE__ */ s("div", {
|
|
98
|
-
className:
|
|
98
|
+
className: m(f)
|
|
99
99
|
})
|
|
100
|
-
},
|
|
100
|
+
}, f))
|
|
101
101
|
});
|
|
102
|
-
},
|
|
102
|
+
}, X = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], Ge = (e, r)=>{
|
|
103
103
|
const t = {
|
|
104
104
|
mobile: 1,
|
|
105
105
|
tablet: 2,
|
|
@@ -110,54 +110,54 @@ const oe = (e, r)=>{
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
if (!r) return _objectSpreadProps(_objectSpread({}, t), {
|
|
113
|
-
desktop:
|
|
113
|
+
desktop: X(e, t.desktop)
|
|
114
114
|
});
|
|
115
115
|
if (typeof r == "number") return {
|
|
116
116
|
mobile: r,
|
|
117
117
|
tablet: r,
|
|
118
118
|
desktop: r
|
|
119
119
|
};
|
|
120
|
-
const o =
|
|
120
|
+
const o = X(e, t.desktop, r.desktop);
|
|
121
121
|
return _objectSpreadProps(_objectSpread({}, t, r), {
|
|
122
122
|
desktop: o
|
|
123
123
|
});
|
|
124
|
-
},
|
|
124
|
+
}, Z = (e, r)=>{
|
|
125
125
|
if (e.length === 0) return [];
|
|
126
126
|
const t = Math.ceil(e.length / r), o = [];
|
|
127
127
|
for(let u = 0; u < e.length; u += t)o.push(e[u]);
|
|
128
128
|
return o[o.length - 1] = e[e.length - t], o;
|
|
129
|
-
},
|
|
129
|
+
}, He = (e, r)=>{
|
|
130
130
|
const t = [];
|
|
131
131
|
for(let o = 0; o < r.length; o++)o === 0 ? t.push(r[0]) : t.push((r[o] + r[o - 1]) / 2);
|
|
132
132
|
for(let o1 = t.length - 1; o1 >= 0; o1--)if (e - t[o1] >= -1) return o1;
|
|
133
133
|
return 0;
|
|
134
|
-
},
|
|
135
|
-
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem:
|
|
136
|
-
const { texts: E , platformOverrides: F } =
|
|
134
|
+
}, ce = 5e3, ie = (param)=>{
|
|
135
|
+
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem: m , itemsPerPage: P , itemsToScroll: f , gap: d , free: B , centered: w , autoplay: x , onPageChange: k , dataAttributes: L } = param;
|
|
136
|
+
const { texts: E , platformOverrides: F } = se(), C = Ye(), p = Ge(C || "large", P), { isDesktopOrBigger: n , isTablet: b } = te(), N = b ? p.tablet : p.mobile, g = Math.max(Math.floor(n ? p.desktop : N), 1), v = c.useRef(null), I = Math.ceil(e.length / g), [{ scrollLeft: T , scrollRight: U }, ue] = c.useState({
|
|
137
137
|
scrollLeft: 0,
|
|
138
138
|
scrollRight: 0
|
|
139
|
-
}), [q,
|
|
139
|
+
}), [q, fe] = c.useState([]), y = c.useMemo(()=>Z(q, I), [
|
|
140
140
|
q,
|
|
141
|
-
|
|
142
|
-
]), W =
|
|
143
|
-
|
|
141
|
+
I
|
|
142
|
+
]), W = f ? Z(q, Math.ceil(e.length / f)) : y, de = U !== 0, he = T !== 0;
|
|
143
|
+
ve(()=>{
|
|
144
144
|
if (v.current) {
|
|
145
145
|
const l = v.current, i = ()=>{
|
|
146
|
-
const { scrollWidth:
|
|
147
|
-
|
|
148
|
-
scrollLeft:
|
|
146
|
+
const { scrollWidth: z , clientWidth: R } = l, O = Math.round(l.scrollLeft), j = Math.round(z - (O + R));
|
|
147
|
+
ue({
|
|
148
|
+
scrollLeft: O,
|
|
149
149
|
scrollRight: j
|
|
150
150
|
});
|
|
151
151
|
}, a = ()=>{
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
if (
|
|
155
|
-
const j =
|
|
156
|
-
return Math.min(
|
|
152
|
+
const z = l.scrollWidth - l.clientWidth;
|
|
153
|
+
fe(Array.from(l.querySelectorAll("[data-item]")).map((R, O)=>{
|
|
154
|
+
if (O === e.length - 1) return z;
|
|
155
|
+
const j = R.offsetLeft, pe = parseInt(getComputedStyle(R).scrollMargin), ge = w && !n ? j - R.clientWidth / 2 : j;
|
|
156
|
+
return Math.min(ge - pe - l.offsetLeft, z);
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
i(), a(), l.addEventListener("scroll", i);
|
|
160
|
-
const h =
|
|
160
|
+
const h = oe(l, ()=>{
|
|
161
161
|
i(), a();
|
|
162
162
|
});
|
|
163
163
|
return ()=>{
|
|
@@ -166,11 +166,11 @@ const oe = (e, r)=>{
|
|
|
166
166
|
}
|
|
167
167
|
return ()=>{};
|
|
168
168
|
}, [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
p.desktop,
|
|
170
|
+
p.tablet,
|
|
171
|
+
p.mobile,
|
|
172
|
+
I,
|
|
173
|
+
d,
|
|
174
174
|
w,
|
|
175
175
|
n,
|
|
176
176
|
e.length
|
|
@@ -179,15 +179,15 @@ const oe = (e, r)=>{
|
|
|
179
179
|
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
180
180
|
const a = v.current;
|
|
181
181
|
if (a) {
|
|
182
|
-
const h =
|
|
182
|
+
const h = y[l];
|
|
183
183
|
a.scrollTo({
|
|
184
184
|
left: h,
|
|
185
185
|
behavior: i ? "smooth" : "auto"
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
}, [
|
|
189
|
-
|
|
190
|
-
]),
|
|
189
|
+
y
|
|
190
|
+
]), me = c.useCallback(()=>{
|
|
191
191
|
const l = v.current;
|
|
192
192
|
if (l) {
|
|
193
193
|
const { scrollLeft: i } = l, a = [
|
|
@@ -211,16 +211,16 @@ const oe = (e, r)=>{
|
|
|
211
211
|
}
|
|
212
212
|
}, [
|
|
213
213
|
W
|
|
214
|
-
]), H =
|
|
214
|
+
]), H = le(!!x, v);
|
|
215
215
|
c.useEffect(()=>{
|
|
216
|
-
|
|
216
|
+
m !== void 0 && D(Math.floor(m / g), !1);
|
|
217
217
|
}, [
|
|
218
|
-
|
|
218
|
+
m,
|
|
219
219
|
D,
|
|
220
|
-
|
|
220
|
+
g
|
|
221
221
|
]), c.useEffect(()=>{
|
|
222
222
|
if (H && x) {
|
|
223
|
-
const l = typeof x == "boolean" ?
|
|
223
|
+
const l = typeof x == "boolean" ? ce : x.time, i = typeof x == "object" && x.loop, a = setInterval(()=>{
|
|
224
224
|
var h;
|
|
225
225
|
U !== 0 ? Y() : i && ((h = v.current) == null || h.scrollTo({
|
|
226
226
|
left: 0,
|
|
@@ -235,98 +235,99 @@ const oe = (e, r)=>{
|
|
|
235
235
|
U,
|
|
236
236
|
H
|
|
237
237
|
]);
|
|
238
|
-
const
|
|
238
|
+
const S = He(T, y), J = c.useRef(!m), K = c.useRef(0);
|
|
239
239
|
c.useEffect(()=>{
|
|
240
|
-
if (
|
|
241
|
-
const l = Math.min((
|
|
242
|
-
for(let a = 0; a <
|
|
240
|
+
if (k) {
|
|
241
|
+
const l = Math.min((S + 1) * g - 1, e.length - 1), i = [];
|
|
242
|
+
for(let a = 0; a < g; a++){
|
|
243
243
|
const h = l - a;
|
|
244
244
|
h >= 0 && i.unshift(h);
|
|
245
245
|
}
|
|
246
|
-
S({
|
|
247
|
-
pageIndex:
|
|
246
|
+
J.current ? K.current !== S && k({
|
|
247
|
+
pageIndex: S,
|
|
248
248
|
shownItemIndexes: i
|
|
249
|
-
});
|
|
249
|
+
}) : J.current = i.includes(m || 0), K.current = S;
|
|
250
250
|
}
|
|
251
251
|
}, [
|
|
252
|
-
|
|
252
|
+
S,
|
|
253
253
|
e.length,
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
g,
|
|
255
|
+
m,
|
|
256
|
+
k
|
|
256
257
|
]);
|
|
257
258
|
let V = null;
|
|
258
259
|
return u ? V = u({
|
|
259
|
-
numPages:
|
|
260
|
-
currentIndex:
|
|
260
|
+
numPages: I,
|
|
261
|
+
currentIndex: S,
|
|
261
262
|
onPress: D
|
|
262
|
-
}) : o && (V =
|
|
263
|
-
numPages:
|
|
264
|
-
currentIndex:
|
|
263
|
+
}) : o && (V = I > 1 && /* @__PURE__ */ s(ne, {
|
|
264
|
+
numPages: I,
|
|
265
|
+
currentIndex: S,
|
|
265
266
|
onPress: D
|
|
266
|
-
})), /* @__PURE__ */ G(
|
|
267
|
+
})), /* @__PURE__ */ G(Pe, {
|
|
267
268
|
space: 24,
|
|
268
269
|
dataAttributes: _objectSpread({
|
|
269
270
|
"component-name": "Carousel"
|
|
270
|
-
},
|
|
271
|
+
}, L),
|
|
271
272
|
children: [
|
|
272
273
|
/* @__PURE__ */ G("div", {
|
|
273
|
-
className:
|
|
274
|
+
className: We,
|
|
274
275
|
children: [
|
|
275
|
-
/* @__PURE__ */ s(
|
|
276
|
+
/* @__PURE__ */ s(A, {
|
|
276
277
|
isInverse: !1,
|
|
277
|
-
children: /* @__PURE__ */ s(
|
|
278
|
-
className:
|
|
278
|
+
children: /* @__PURE__ */ s(M, {
|
|
279
|
+
className: De,
|
|
279
280
|
"aria-label": E.carouselPrevButton,
|
|
280
|
-
onPress:
|
|
281
|
-
disabled: !
|
|
282
|
-
children: /* @__PURE__ */ s(
|
|
281
|
+
onPress: me,
|
|
282
|
+
disabled: !he,
|
|
283
|
+
children: /* @__PURE__ */ s($, {})
|
|
283
284
|
})
|
|
284
285
|
}),
|
|
285
286
|
/* @__PURE__ */ s("div", {
|
|
286
|
-
className:
|
|
287
|
-
[
|
|
288
|
-
[
|
|
287
|
+
className: Q(Ve, {
|
|
288
|
+
[ze]: w,
|
|
289
|
+
[Oe]: I > 1
|
|
289
290
|
}),
|
|
290
|
-
style: _objectSpreadProps(_objectSpread({},
|
|
291
|
-
[_.itemsPerPageDesktop]: String(
|
|
292
|
-
[_.itemsPerPageTablet]: String(
|
|
293
|
-
[_.itemsPerPageMobile]: String(
|
|
294
|
-
},
|
|
295
|
-
[_.gap]: String(
|
|
291
|
+
style: _objectSpreadProps(_objectSpread({}, Ue(_objectSpread({
|
|
292
|
+
[_.itemsPerPageDesktop]: String(p.desktop),
|
|
293
|
+
[_.itemsPerPageTablet]: String(p.tablet),
|
|
294
|
+
[_.itemsPerPageMobile]: String(p.mobile)
|
|
295
|
+
}, d !== void 0 ? {
|
|
296
|
+
[_.gap]: String(d)
|
|
296
297
|
} : {}))), {
|
|
297
298
|
scrollSnapType: B ? "initial" : "x mandatory"
|
|
298
299
|
}),
|
|
299
300
|
ref: v,
|
|
300
301
|
children: e.map((l, i)=>/* @__PURE__ */ s("div", {
|
|
301
|
-
className:
|
|
302
|
+
className: Q(je, t),
|
|
302
303
|
style: _objectSpreadProps(_objectSpread({}, r), {
|
|
303
|
-
scrollSnapStop:
|
|
304
|
+
scrollSnapStop: re(F) ? "always" : "normal"
|
|
304
305
|
}),
|
|
305
306
|
"data-item": !0,
|
|
306
307
|
children: l
|
|
307
308
|
}, i))
|
|
308
309
|
}),
|
|
309
|
-
/* @__PURE__ */ s(
|
|
310
|
+
/* @__PURE__ */ s(A, {
|
|
310
311
|
isInverse: !1,
|
|
311
|
-
children: /* @__PURE__ */ s(
|
|
312
|
-
className:
|
|
312
|
+
children: /* @__PURE__ */ s(M, {
|
|
313
|
+
className: _e,
|
|
313
314
|
"aria-label": E.carouselNextButton,
|
|
314
315
|
onPress: Y,
|
|
315
|
-
disabled: !
|
|
316
|
-
children: /* @__PURE__ */ s(
|
|
316
|
+
disabled: !de,
|
|
317
|
+
children: /* @__PURE__ */ s(ee, {})
|
|
317
318
|
})
|
|
318
319
|
})
|
|
319
320
|
]
|
|
320
321
|
}),
|
|
321
322
|
V && /* @__PURE__ */ s("div", {
|
|
322
|
-
className:
|
|
323
|
+
className: Fe,
|
|
323
324
|
children: V
|
|
324
325
|
})
|
|
325
326
|
]
|
|
326
327
|
});
|
|
327
|
-
},
|
|
328
|
-
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem:
|
|
329
|
-
return s(
|
|
328
|
+
}, dt = (e)=>/* @__PURE__ */ s(ie, _objectSpread({}, e)), ht = (param)=>/* @__PURE__ */ {
|
|
329
|
+
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem: m , onPageChange: P , dataAttributes: f } = param;
|
|
330
|
+
return s(ie, {
|
|
330
331
|
items: e,
|
|
331
332
|
itemStyle: r,
|
|
332
333
|
itemClassName: t,
|
|
@@ -340,121 +341,121 @@ const oe = (e, r)=>{
|
|
|
340
341
|
gap: 0,
|
|
341
342
|
withBullets: o,
|
|
342
343
|
renderBullets: u,
|
|
343
|
-
initialActiveItem:
|
|
344
|
+
initialActiveItem: m,
|
|
344
345
|
onPageChange: P,
|
|
345
|
-
dataAttributes:
|
|
346
|
+
dataAttributes: f
|
|
346
347
|
});
|
|
347
|
-
},
|
|
348
|
+
}, ae = /*#__PURE__*/ c.createContext(!1), mt = ()=>c.useContext(ae), Je = (param)=>/* @__PURE__ */ {
|
|
348
349
|
let { children: e } = param;
|
|
349
|
-
return s(
|
|
350
|
+
return s(ae.Provider, {
|
|
350
351
|
value: !0,
|
|
351
352
|
children: e
|
|
352
353
|
});
|
|
353
|
-
},
|
|
354
|
-
let { items: e , withBullets: r , autoplay: t , onPageChange: o , dataAttributes: u , inverseBullets:
|
|
355
|
-
const { texts: P , platformOverrides:
|
|
354
|
+
}, pt = (param)=>{
|
|
355
|
+
let { items: e , withBullets: r , autoplay: t , onPageChange: o , dataAttributes: u , inverseBullets: m = !0 } = param;
|
|
356
|
+
const { texts: P , platformOverrides: f } = se(), d = c.useRef(null), [{ scrollLeft: B , scrollRight: w }, x] = c.useState({
|
|
356
357
|
scrollLeft: 0,
|
|
357
358
|
scrollRight: 0
|
|
358
|
-
}),
|
|
359
|
-
const n =
|
|
359
|
+
}), k = c.useCallback(()=>{
|
|
360
|
+
const n = d.current;
|
|
360
361
|
n && n.scrollBy({
|
|
361
362
|
left: -n.clientWidth,
|
|
362
363
|
behavior: "smooth"
|
|
363
364
|
});
|
|
364
|
-
}, []),
|
|
365
|
-
const n =
|
|
365
|
+
}, []), L = c.useCallback(()=>{
|
|
366
|
+
const n = d.current;
|
|
366
367
|
n && n.scrollBy({
|
|
367
368
|
left: n.clientWidth,
|
|
368
369
|
behavior: "smooth"
|
|
369
370
|
});
|
|
370
|
-
}, []), E = w !== 0, F = B !== 0,
|
|
371
|
+
}, []), E = w !== 0, F = B !== 0, C = d.current ? Math.floor((B + d.current.clientWidth / 2) / d.current.clientWidth) : 0;
|
|
371
372
|
c.useLayoutEffect(()=>{
|
|
372
|
-
const n =
|
|
373
|
+
const n = d.current;
|
|
373
374
|
if (n) {
|
|
374
|
-
const
|
|
375
|
-
const { scrollWidth:
|
|
375
|
+
const b = ()=>{
|
|
376
|
+
const { scrollWidth: g , clientWidth: v } = n, I = Math.round(n.scrollLeft), T = Math.round(g - (I + v));
|
|
376
377
|
x({
|
|
377
|
-
scrollLeft:
|
|
378
|
-
scrollRight:
|
|
378
|
+
scrollLeft: I,
|
|
379
|
+
scrollRight: T
|
|
379
380
|
});
|
|
380
381
|
};
|
|
381
|
-
|
|
382
|
-
const
|
|
382
|
+
b(), n.addEventListener("scroll", b);
|
|
383
|
+
const N = oe(n, b);
|
|
383
384
|
return ()=>{
|
|
384
|
-
n.removeEventListener("scroll",
|
|
385
|
+
n.removeEventListener("scroll", b), N();
|
|
385
386
|
};
|
|
386
387
|
}
|
|
387
388
|
}, [
|
|
388
389
|
e.length
|
|
389
390
|
]);
|
|
390
|
-
const
|
|
391
|
+
const p = le(!!t, d);
|
|
391
392
|
return c.useEffect(()=>{
|
|
392
|
-
if (
|
|
393
|
-
const n = typeof t == "boolean" ?
|
|
394
|
-
var
|
|
395
|
-
w !== 0 ?
|
|
393
|
+
if (p && t) {
|
|
394
|
+
const n = typeof t == "boolean" ? ce : t.time, b = typeof t == "object" && t.loop, N = setInterval(()=>{
|
|
395
|
+
var g;
|
|
396
|
+
w !== 0 ? L() : b && ((g = d.current) == null || g.scrollTo({
|
|
396
397
|
left: 0,
|
|
397
398
|
behavior: "smooth"
|
|
398
399
|
}));
|
|
399
400
|
}, n);
|
|
400
|
-
return ()=>clearInterval(
|
|
401
|
+
return ()=>clearInterval(N);
|
|
401
402
|
}
|
|
402
403
|
}, [
|
|
403
404
|
t,
|
|
404
|
-
|
|
405
|
+
L,
|
|
405
406
|
w,
|
|
406
|
-
|
|
407
|
+
p
|
|
407
408
|
]), c.useEffect(()=>{
|
|
408
|
-
o && o(
|
|
409
|
+
o && o(C);
|
|
409
410
|
}, [
|
|
410
|
-
|
|
411
|
+
C,
|
|
411
412
|
o
|
|
412
|
-
]), /* @__PURE__ */ s(
|
|
413
|
+
]), /* @__PURE__ */ s(Je, {
|
|
413
414
|
children: /* @__PURE__ */ G("div", _objectSpreadProps(_objectSpread({
|
|
414
|
-
className:
|
|
415
|
-
},
|
|
415
|
+
className: Le
|
|
416
|
+
}, Se(u, "SlideShow")), {
|
|
416
417
|
children: [
|
|
417
|
-
/* @__PURE__ */ s(
|
|
418
|
+
/* @__PURE__ */ s(A, {
|
|
418
419
|
isInverse: !1,
|
|
419
|
-
children: /* @__PURE__ */ s(
|
|
420
|
-
className:
|
|
420
|
+
children: /* @__PURE__ */ s(M, {
|
|
421
|
+
className: Ce,
|
|
421
422
|
"aria-label": P.carouselPrevButton,
|
|
422
|
-
onPress:
|
|
423
|
+
onPress: k,
|
|
423
424
|
disabled: !F,
|
|
424
|
-
children: /* @__PURE__ */ s(
|
|
425
|
+
children: /* @__PURE__ */ s($, {})
|
|
425
426
|
})
|
|
426
427
|
}),
|
|
427
|
-
/* @__PURE__ */ s(
|
|
428
|
+
/* @__PURE__ */ s(we, {
|
|
428
429
|
value: !1,
|
|
429
430
|
children: /* @__PURE__ */ s("div", {
|
|
430
|
-
className:
|
|
431
|
-
ref:
|
|
432
|
-
children: e.map((n,
|
|
433
|
-
className:
|
|
431
|
+
className: Ne,
|
|
432
|
+
ref: d,
|
|
433
|
+
children: e.map((n, b)=>/* @__PURE__ */ s("div", {
|
|
434
|
+
className: Re,
|
|
434
435
|
style: {
|
|
435
|
-
scrollSnapStop:
|
|
436
|
+
scrollSnapStop: re(f) ? "always" : "normal"
|
|
436
437
|
},
|
|
437
438
|
children: n
|
|
438
|
-
},
|
|
439
|
+
}, b))
|
|
439
440
|
})
|
|
440
441
|
}),
|
|
441
|
-
/* @__PURE__ */ s(
|
|
442
|
+
/* @__PURE__ */ s(A, {
|
|
442
443
|
isInverse: !1,
|
|
443
|
-
children: /* @__PURE__ */ s(
|
|
444
|
-
className:
|
|
444
|
+
children: /* @__PURE__ */ s(M, {
|
|
445
|
+
className: Ae,
|
|
445
446
|
"aria-label": P.carouselNextButton,
|
|
446
|
-
onPress:
|
|
447
|
+
onPress: L,
|
|
447
448
|
disabled: !E,
|
|
448
|
-
children: /* @__PURE__ */ s(
|
|
449
|
+
children: /* @__PURE__ */ s(ee, {})
|
|
449
450
|
})
|
|
450
451
|
}),
|
|
451
|
-
r && e.length > 1 && /* @__PURE__ */ s(
|
|
452
|
-
isInverse:
|
|
452
|
+
r && e.length > 1 && /* @__PURE__ */ s(A, {
|
|
453
|
+
isInverse: m,
|
|
453
454
|
children: /* @__PURE__ */ s("div", {
|
|
454
|
-
className:
|
|
455
|
-
children: /* @__PURE__ */ s(
|
|
455
|
+
className: Me,
|
|
456
|
+
children: /* @__PURE__ */ s(ne, {
|
|
456
457
|
numPages: e.length,
|
|
457
|
-
currentIndex:
|
|
458
|
+
currentIndex: C
|
|
458
459
|
})
|
|
459
460
|
})
|
|
460
461
|
})
|
|
@@ -462,4 +463,4 @@ const oe = (e, r)=>{
|
|
|
462
463
|
}))
|
|
463
464
|
});
|
|
464
465
|
};
|
|
465
|
-
export {
|
|
466
|
+
export { dt as Carousel, ht as CenteredCarousel, Je as IsInsideSlideshowProvider, ne as PageBullets, pt as Slideshow, mt as useIsInsideSlideshowContext };
|