welcome-ui 10.6.1 → 10.6.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.
- package/dist/Swiper.js +360 -328
- package/dist/Window.js +57 -50
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/Modal/index.d.ts +1 -1
- package/dist/types/components/Swiper/constants.d.ts +49 -0
- package/dist/types/components/Swiper/context.d.ts +3 -0
- package/dist/types/components/Swiper/index.d.ts +10 -57
- package/dist/types/components/Swiper/types.d.ts +31 -7
- package/dist/types/components/Swiper/useInitialScroll.d.ts +18 -0
- package/dist/types/components/Swiper/useSwiper.d.ts +27 -0
- package/dist/types/components/Swiper/useSwiperViewModel.d.ts +2 -0
- package/dist/types/components/Swiper/utils.d.ts +1 -1
- package/dist/types/components/Window/components/Header.d.ts +1 -1
- package/dist/types/components/Window/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/Swiper.js
CHANGED
|
@@ -1,96 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Swiper.css';
|
|
3
|
-
import { jsx as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
4
|
+
import { c as U, a as G, g as fe, u as pe } from "./index-B6iGEm-i.js";
|
|
5
|
+
import { createContext as me, useContext as ge, useRef as W, useEffect as M, Children as ie, cloneElement as be, useCallback as R, useState as K, useMemo as Z } from "react";
|
|
6
|
+
import { Button as ae } from "./Button.js";
|
|
7
|
+
import { Icon as oe } from "./Icon.js";
|
|
6
8
|
import { u as we } from "./use-viewport-DuW6YjHT.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
function N(e, u, w) {
|
|
17
|
-
var _, L, B, O, a, g, p = 0, I = !1, P = !1, k = !0;
|
|
18
|
-
if (typeof e != "function")
|
|
19
|
-
throw new TypeError(i);
|
|
20
|
-
u = j(u) || 0, x(w) && (I = !!w.leading, P = "maxWait" in w, B = P ? V(j(w.maxWait) || 0, u) : B, k = "trailing" in w ? !!w.trailing : k);
|
|
21
|
-
function C(d) {
|
|
22
|
-
var T = _, F = L;
|
|
23
|
-
return _ = L = void 0, p = d, O = e.apply(F, T), O;
|
|
24
|
-
}
|
|
25
|
-
function J(d) {
|
|
26
|
-
return p = d, a = setTimeout(q, u), I ? C(d) : O;
|
|
27
|
-
}
|
|
28
|
-
function ne(d) {
|
|
29
|
-
var T = d - g, F = d - p, ie = u - T;
|
|
30
|
-
return P ? M(ie, B - F) : ie;
|
|
31
|
-
}
|
|
32
|
-
function R(d) {
|
|
33
|
-
var T = d - g, F = d - p;
|
|
34
|
-
return g === void 0 || T >= u || T < 0 || P && F >= B;
|
|
35
|
-
}
|
|
36
|
-
function q() {
|
|
37
|
-
var d = S();
|
|
38
|
-
if (R(d))
|
|
39
|
-
return re(d);
|
|
40
|
-
a = setTimeout(q, ne(d));
|
|
41
|
-
}
|
|
42
|
-
function re(d) {
|
|
43
|
-
return a = void 0, k && _ ? C(d) : (_ = L = void 0, O);
|
|
44
|
-
}
|
|
45
|
-
function de() {
|
|
46
|
-
a !== void 0 && clearTimeout(a), p = 0, _ = g = L = a = void 0;
|
|
47
|
-
}
|
|
48
|
-
function ue() {
|
|
49
|
-
return a === void 0 ? O : re(S());
|
|
50
|
-
}
|
|
51
|
-
function Q() {
|
|
52
|
-
var d = S(), T = R(d);
|
|
53
|
-
if (_ = arguments, L = this, g = d, T) {
|
|
54
|
-
if (a === void 0)
|
|
55
|
-
return J(g);
|
|
56
|
-
if (P)
|
|
57
|
-
return a = setTimeout(q, u), C(g);
|
|
58
|
-
}
|
|
59
|
-
return a === void 0 && (a = setTimeout(q, u)), O;
|
|
60
|
-
}
|
|
61
|
-
return Q.cancel = de, Q.flush = ue, Q;
|
|
62
|
-
}
|
|
63
|
-
function x(e) {
|
|
64
|
-
var u = typeof e;
|
|
65
|
-
return !!e && (u == "object" || u == "function");
|
|
66
|
-
}
|
|
67
|
-
function y(e) {
|
|
68
|
-
return !!e && typeof e == "object";
|
|
69
|
-
}
|
|
70
|
-
function D(e) {
|
|
71
|
-
return typeof e == "symbol" || y(e) && E.call(e) == f;
|
|
72
|
-
}
|
|
73
|
-
function j(e) {
|
|
74
|
-
if (typeof e == "number")
|
|
75
|
-
return e;
|
|
76
|
-
if (D(e))
|
|
77
|
-
return l;
|
|
78
|
-
if (x(e)) {
|
|
79
|
-
var u = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
80
|
-
e = x(u) ? u + "" : u;
|
|
81
|
-
}
|
|
82
|
-
if (typeof e != "string")
|
|
83
|
-
return e === 0 ? e : +e;
|
|
84
|
-
e = e.replace(o, "");
|
|
85
|
-
var w = m.test(e);
|
|
86
|
-
return w || t.test(e) ? n(e.slice(2), w ? 2 : 8) : s.test(e) ? l : +e;
|
|
87
|
-
}
|
|
88
|
-
return Y = N, Y;
|
|
89
|
-
}
|
|
90
|
-
var Se = he();
|
|
91
|
-
const xe = /* @__PURE__ */ pe(Se), ve = "_root_eam2c_3", _e = "_container_eam2c_11", Pe = "_arrow_eam2c_77", U = {
|
|
92
|
-
root: ve,
|
|
93
|
-
container: _e,
|
|
9
|
+
const ce = me(null), ee = () => {
|
|
10
|
+
const i = ge(ce);
|
|
11
|
+
if (!i)
|
|
12
|
+
throw new Error("Swiper components must be used within a Swiper component");
|
|
13
|
+
return i;
|
|
14
|
+
}, he = "_root_eam2c_3", Se = "_container_eam2c_11", xe = "_arrow_eam2c_77", X = {
|
|
15
|
+
root: he,
|
|
16
|
+
container: Se,
|
|
94
17
|
"container-mobile": "_container-mobile_eam2c_41",
|
|
95
18
|
"container-tablet": "_container-tablet_eam2c_50",
|
|
96
19
|
"container-desktop": "_container-desktop_eam2c_59",
|
|
@@ -99,151 +22,147 @@ const xe = /* @__PURE__ */ pe(Se), ve = "_root_eam2c_3", _e = "_container_eam2c_
|
|
|
99
22
|
"arrow-placement-side-left": "_arrow-placement-side-left_eam2c_84",
|
|
100
23
|
"arrow-placement-side-right": "_arrow-placement-side-right_eam2c_87",
|
|
101
24
|
"arrow-mobile": "_arrow-mobile_eam2c_90",
|
|
102
|
-
arrow:
|
|
25
|
+
arrow: xe,
|
|
103
26
|
"arrow-desktop": "_arrow-desktop_eam2c_99",
|
|
104
27
|
"arrow-background": "_arrow-background_eam2c_104"
|
|
105
|
-
},
|
|
28
|
+
}, ve = U(X), _e = ({
|
|
106
29
|
children: i,
|
|
107
|
-
className:
|
|
108
|
-
placement:
|
|
109
|
-
size:
|
|
110
|
-
variant:
|
|
111
|
-
...
|
|
30
|
+
className: o,
|
|
31
|
+
placement: t = "side",
|
|
32
|
+
size: s = "md",
|
|
33
|
+
variant: e,
|
|
34
|
+
...a
|
|
112
35
|
}) => {
|
|
113
36
|
const {
|
|
114
|
-
navigation: { desktop:
|
|
115
|
-
} =
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
|
|
37
|
+
navigation: { desktop: g, goNext: r, isNextDisabled: l, mobile: d }
|
|
38
|
+
} = ee();
|
|
39
|
+
return /* @__PURE__ */ E(
|
|
40
|
+
ae,
|
|
118
41
|
{
|
|
119
42
|
"aria-label": "Next slide",
|
|
120
|
-
className:
|
|
43
|
+
className: ve(
|
|
121
44
|
"arrow",
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
45
|
+
g && "arrow-desktop",
|
|
46
|
+
d && "arrow-mobile",
|
|
47
|
+
t === "side" && "arrow-placement-side",
|
|
48
|
+
t === "side" && "arrow-placement-side-right",
|
|
49
|
+
o
|
|
127
50
|
),
|
|
128
|
-
disabled:
|
|
129
|
-
onClick:
|
|
130
|
-
size:
|
|
131
|
-
variant:
|
|
132
|
-
...
|
|
133
|
-
children: i ?? /* @__PURE__ */
|
|
51
|
+
disabled: l,
|
|
52
|
+
onClick: r,
|
|
53
|
+
size: s,
|
|
54
|
+
variant: e ?? "secondary",
|
|
55
|
+
...a,
|
|
56
|
+
children: i ?? /* @__PURE__ */ E(oe, { name: "angle-right-b" })
|
|
134
57
|
}
|
|
135
58
|
);
|
|
136
|
-
},
|
|
59
|
+
}, ke = U(X), Pe = ({
|
|
137
60
|
children: i,
|
|
138
|
-
className:
|
|
139
|
-
placement:
|
|
140
|
-
size:
|
|
141
|
-
variant:
|
|
142
|
-
...
|
|
61
|
+
className: o,
|
|
62
|
+
placement: t = "side",
|
|
63
|
+
size: s = "md",
|
|
64
|
+
variant: e,
|
|
65
|
+
...a
|
|
143
66
|
}) => {
|
|
144
67
|
const {
|
|
145
|
-
navigation: { desktop:
|
|
146
|
-
} =
|
|
147
|
-
return /* @__PURE__ */
|
|
148
|
-
|
|
68
|
+
navigation: { desktop: g, goPrev: r, isPrevDisabled: l, mobile: d }
|
|
69
|
+
} = ee();
|
|
70
|
+
return /* @__PURE__ */ E(
|
|
71
|
+
ae,
|
|
149
72
|
{
|
|
150
73
|
"aria-label": "Previous slide",
|
|
151
|
-
className:
|
|
74
|
+
className: ke(
|
|
152
75
|
"arrow",
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
76
|
+
g && "arrow-mobile",
|
|
77
|
+
d && "arrow-desktop",
|
|
78
|
+
t === "side" && "arrow-placement-side",
|
|
79
|
+
t === "side" && "arrow-placement-side-left",
|
|
80
|
+
o
|
|
158
81
|
),
|
|
159
|
-
disabled:
|
|
160
|
-
onClick:
|
|
161
|
-
size:
|
|
162
|
-
variant:
|
|
163
|
-
...
|
|
164
|
-
children: i ?? /* @__PURE__ */
|
|
82
|
+
disabled: l,
|
|
83
|
+
onClick: r,
|
|
84
|
+
size: s,
|
|
85
|
+
variant: e ?? "secondary",
|
|
86
|
+
...a,
|
|
87
|
+
children: i ?? /* @__PURE__ */ E(oe, { name: "angle-left-b" })
|
|
165
88
|
}
|
|
166
89
|
);
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}, [i]),
|
|
172
|
-
function
|
|
173
|
-
|
|
90
|
+
}, ye = (i, o) => {
|
|
91
|
+
const t = W();
|
|
92
|
+
M(() => {
|
|
93
|
+
t.current = i;
|
|
94
|
+
}, [i]), M(() => {
|
|
95
|
+
function s() {
|
|
96
|
+
var e;
|
|
97
|
+
(e = t.current) == null || e.call(t);
|
|
174
98
|
}
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
return () => clearInterval(
|
|
99
|
+
if (o !== null) {
|
|
100
|
+
const e = setInterval(s, o);
|
|
101
|
+
return () => clearInterval(e);
|
|
178
102
|
}
|
|
179
|
-
}, [
|
|
180
|
-
},
|
|
181
|
-
if (
|
|
103
|
+
}, [o]);
|
|
104
|
+
}, H = (i, o) => {
|
|
105
|
+
if (o === 0)
|
|
182
106
|
return `${100 / i}%`;
|
|
183
|
-
const
|
|
184
|
-
return `calc(${100 / i}% - ${
|
|
185
|
-
},
|
|
107
|
+
const s = o * (i === 1 ? 4 : 2) / 16;
|
|
108
|
+
return `calc(${100 / i}% - ${s}rem)`;
|
|
109
|
+
}, Ie = U(X), Le = ({ children: i, className: o }) => {
|
|
186
110
|
const {
|
|
187
111
|
slides: {
|
|
188
|
-
currentPage:
|
|
189
|
-
currentSlidesPerView:
|
|
190
|
-
expandOnLargeScreens:
|
|
191
|
-
gap:
|
|
192
|
-
handleScroll:
|
|
193
|
-
id:
|
|
194
|
-
isLastPage:
|
|
195
|
-
length:
|
|
196
|
-
perView:
|
|
197
|
-
ref:
|
|
198
|
-
setLength:
|
|
112
|
+
currentPage: t,
|
|
113
|
+
currentSlidesPerView: s,
|
|
114
|
+
expandOnLargeScreens: e,
|
|
115
|
+
gap: a,
|
|
116
|
+
handleScroll: g,
|
|
117
|
+
id: r,
|
|
118
|
+
isLastPage: l,
|
|
119
|
+
length: d,
|
|
120
|
+
perView: u,
|
|
121
|
+
ref: _,
|
|
122
|
+
setLength: L
|
|
199
123
|
}
|
|
200
|
-
} =
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}, [
|
|
204
|
-
const
|
|
205
|
-
const x = `${
|
|
206
|
-
return typeof
|
|
207
|
-
...
|
|
208
|
-
"aria-hidden":
|
|
209
|
-
"aria-label": `${
|
|
124
|
+
} = ee(), y = ie.toArray(i);
|
|
125
|
+
M(() => {
|
|
126
|
+
L(y.length);
|
|
127
|
+
}, [y.length, L]);
|
|
128
|
+
const k = ie.map(y, (f, V) => {
|
|
129
|
+
const x = `${r}-${V}`, T = V + 1, j = Math.ceil(T / s) - 1, $ = l ? d - T >= s : j !== t;
|
|
130
|
+
return typeof f == "object" && f && "props" in f ? be(f, {
|
|
131
|
+
...f.props,
|
|
132
|
+
"aria-hidden": $,
|
|
133
|
+
"aria-label": `${T} of ${d}`,
|
|
210
134
|
"aria-roledescription": "slide",
|
|
211
135
|
id: x,
|
|
212
136
|
key: x
|
|
213
|
-
}) :
|
|
137
|
+
}) : f;
|
|
214
138
|
});
|
|
215
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ E(
|
|
216
140
|
"ul",
|
|
217
141
|
{
|
|
218
|
-
className:
|
|
142
|
+
className: Ie(
|
|
219
143
|
"container",
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
144
|
+
u.mobile && "container-mobile",
|
|
145
|
+
u.desktop && "container-desktop",
|
|
146
|
+
u.tablet && "container-tablet",
|
|
147
|
+
u.desktop && e && "container-full-width",
|
|
148
|
+
o
|
|
225
149
|
),
|
|
226
|
-
onScroll:
|
|
227
|
-
ref:
|
|
150
|
+
onScroll: g,
|
|
151
|
+
ref: _,
|
|
228
152
|
style: {
|
|
229
|
-
"--slideDesktop":
|
|
230
|
-
"--slideMobile":
|
|
231
|
-
"--slideTablet":
|
|
232
|
-
"--slideWidthDesktop":
|
|
233
|
-
"--slideWidthMobile":
|
|
234
|
-
"--slideWidthTablet":
|
|
235
|
-
"--slideWithDesktopFullWidth":
|
|
236
|
-
"--spaceBetween": `${
|
|
153
|
+
"--slideDesktop": u.desktop,
|
|
154
|
+
"--slideMobile": u.mobile,
|
|
155
|
+
"--slideTablet": u.tablet,
|
|
156
|
+
"--slideWidthDesktop": H(u.desktop, a),
|
|
157
|
+
"--slideWidthMobile": H(u.mobile, a),
|
|
158
|
+
"--slideWidthTablet": H(u.tablet, a),
|
|
159
|
+
"--slideWithDesktopFullWidth": H(u.desktop + 2, a),
|
|
160
|
+
"--spaceBetween": `${a / 16}rem`
|
|
237
161
|
},
|
|
238
|
-
children:
|
|
162
|
+
children: k
|
|
239
163
|
}
|
|
240
164
|
);
|
|
241
|
-
},
|
|
242
|
-
const i = be(ce);
|
|
243
|
-
if (!i)
|
|
244
|
-
throw new Error("Swiper components must be used within a Swiper component");
|
|
245
|
-
return i;
|
|
246
|
-
}, h = {
|
|
165
|
+
}, v = {
|
|
247
166
|
autoplay: { duration: 5e3, enabled: !1, loop: !1 },
|
|
248
167
|
navigation: { desktop: !0, mobile: !0 },
|
|
249
168
|
slides: {
|
|
@@ -254,168 +173,281 @@ const xe = /* @__PURE__ */ pe(Se), ve = "_root_eam2c_3", _e = "_container_eam2c_
|
|
|
254
173
|
initialIndex: 0,
|
|
255
174
|
perView: { desktop: 1, mobile: 1, tablet: 1 }
|
|
256
175
|
}
|
|
257
|
-
},
|
|
258
|
-
autoplay:
|
|
259
|
-
navigation:
|
|
176
|
+
}, Ve = {
|
|
177
|
+
autoplay: v.autoplay,
|
|
178
|
+
navigation: v.navigation,
|
|
260
179
|
slides: {
|
|
261
|
-
alignment:
|
|
180
|
+
alignment: v.slides.alignment,
|
|
262
181
|
currentPage: 0,
|
|
263
|
-
currentSlidesPerView:
|
|
264
|
-
expandOnLargeScreens:
|
|
265
|
-
gap:
|
|
266
|
-
id:
|
|
267
|
-
initialIndex:
|
|
268
|
-
perView:
|
|
182
|
+
currentSlidesPerView: v.slides.perView.desktop,
|
|
183
|
+
expandOnLargeScreens: v.slides.expandOnLargeScreens,
|
|
184
|
+
gap: v.slides.gap,
|
|
185
|
+
id: v.slides.id,
|
|
186
|
+
initialIndex: v.slides.initialIndex,
|
|
187
|
+
perView: v.slides.perView,
|
|
269
188
|
setCurrentPage: () => {
|
|
270
189
|
}
|
|
271
190
|
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
191
|
+
};
|
|
192
|
+
var Y, se;
|
|
193
|
+
function Oe() {
|
|
194
|
+
if (se) return Y;
|
|
195
|
+
se = 1;
|
|
196
|
+
var i = "Expected a function", o = NaN, t = "[object Symbol]", s = /^\s+|\s+$/g, e = /^[-+]0x[0-9a-f]+$/i, a = /^0b[01]+$/i, g = /^0o[0-7]+$/i, r = parseInt, l = typeof G == "object" && G && G.Object === Object && G, d = typeof self == "object" && self && self.Object === Object && self, u = l || d || Function("return this")(), _ = Object.prototype, L = _.toString, y = Math.max, k = Math.min, f = function() {
|
|
197
|
+
return u.Date.now();
|
|
198
|
+
};
|
|
199
|
+
function V(n, p, w) {
|
|
200
|
+
var I, F, h, b, c, S, P = 0, O = !1, N = !1, B = !0;
|
|
201
|
+
if (typeof n != "function")
|
|
202
|
+
throw new TypeError(i);
|
|
203
|
+
p = $(p) || 0, x(w) && (O = !!w.leading, N = "maxWait" in w, h = N ? y($(w.maxWait) || 0, p) : h, B = "trailing" in w ? !!w.trailing : B);
|
|
204
|
+
function A(m) {
|
|
205
|
+
var C = I, D = F;
|
|
206
|
+
return I = F = void 0, P = m, b = n.apply(D, C), b;
|
|
207
|
+
}
|
|
208
|
+
function q(m) {
|
|
209
|
+
return P = m, c = setTimeout(z, p), O ? A(m) : b;
|
|
210
|
+
}
|
|
211
|
+
function le(m) {
|
|
212
|
+
var C = m - S, D = m - P, re = p - C;
|
|
213
|
+
return N ? k(re, h - D) : re;
|
|
214
|
+
}
|
|
215
|
+
function te(m) {
|
|
216
|
+
var C = m - S, D = m - P;
|
|
217
|
+
return S === void 0 || C >= p || C < 0 || N && D >= h;
|
|
218
|
+
}
|
|
219
|
+
function z() {
|
|
220
|
+
var m = f();
|
|
221
|
+
if (te(m))
|
|
222
|
+
return ne(m);
|
|
223
|
+
c = setTimeout(z, le(m));
|
|
224
|
+
}
|
|
225
|
+
function ne(m) {
|
|
226
|
+
return c = void 0, B && I ? A(m) : (I = F = void 0, b);
|
|
227
|
+
}
|
|
228
|
+
function de() {
|
|
229
|
+
c !== void 0 && clearTimeout(c), P = 0, I = S = F = c = void 0;
|
|
230
|
+
}
|
|
231
|
+
function ue() {
|
|
232
|
+
return c === void 0 ? b : ne(f());
|
|
233
|
+
}
|
|
234
|
+
function Q() {
|
|
235
|
+
var m = f(), C = te(m);
|
|
236
|
+
if (I = arguments, F = this, S = m, C) {
|
|
237
|
+
if (c === void 0)
|
|
238
|
+
return q(S);
|
|
239
|
+
if (N)
|
|
240
|
+
return c = setTimeout(z, p), A(S);
|
|
283
241
|
}
|
|
242
|
+
return c === void 0 && (c = setTimeout(z, p)), b;
|
|
284
243
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
244
|
+
return Q.cancel = de, Q.flush = ue, Q;
|
|
245
|
+
}
|
|
246
|
+
function x(n) {
|
|
247
|
+
var p = typeof n;
|
|
248
|
+
return !!n && (p == "object" || p == "function");
|
|
249
|
+
}
|
|
250
|
+
function T(n) {
|
|
251
|
+
return !!n && typeof n == "object";
|
|
252
|
+
}
|
|
253
|
+
function j(n) {
|
|
254
|
+
return typeof n == "symbol" || T(n) && L.call(n) == t;
|
|
255
|
+
}
|
|
256
|
+
function $(n) {
|
|
257
|
+
if (typeof n == "number")
|
|
258
|
+
return n;
|
|
259
|
+
if (j(n))
|
|
260
|
+
return o;
|
|
261
|
+
if (x(n)) {
|
|
262
|
+
var p = typeof n.valueOf == "function" ? n.valueOf() : n;
|
|
263
|
+
n = x(p) ? p + "" : p;
|
|
303
264
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
265
|
+
if (typeof n != "string")
|
|
266
|
+
return n === 0 ? n : +n;
|
|
267
|
+
n = n.replace(s, "");
|
|
268
|
+
var w = a.test(n);
|
|
269
|
+
return w || g.test(n) ? r(n.slice(2), w ? 2 : 8) : e.test(n) ? o : +n;
|
|
270
|
+
}
|
|
271
|
+
return Y = V, Y;
|
|
272
|
+
}
|
|
273
|
+
var Ne = Oe();
|
|
274
|
+
const Te = /* @__PURE__ */ fe(Ne), je = ({
|
|
275
|
+
alignment: i,
|
|
276
|
+
currentPage: o,
|
|
277
|
+
currentSlidesPerView: t,
|
|
278
|
+
goTo: s,
|
|
279
|
+
initialIndex: e,
|
|
280
|
+
numberOfPage: a,
|
|
281
|
+
setCurrentPage: g,
|
|
282
|
+
slidesLength: r
|
|
310
283
|
}) => {
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
284
|
+
const l = W(!1), d = W(), u = W(!1), _ = W(!1), L = W(0), y = i === "center" ? (
|
|
285
|
+
// if centeredSlides is true, we calculate which number is the middle page
|
|
286
|
+
Math.floor(a / 2)
|
|
287
|
+
) : (
|
|
288
|
+
// if centeredSlides is false, we calculate on which page the number in firstSlideToShow props is
|
|
289
|
+
Math.ceil(e / t) - 1
|
|
290
|
+
), k = Number.isFinite(y) ? Math.min(Math.max(y, 0), a - 1) : 0;
|
|
291
|
+
return L.current = k, M(() => {
|
|
292
|
+
if (!(!r || l.current))
|
|
293
|
+
return l.current = !0, d.current = requestAnimationFrame(() => {
|
|
294
|
+
d.current = requestAnimationFrame(() => {
|
|
295
|
+
d.current = void 0;
|
|
296
|
+
const f = L.current;
|
|
297
|
+
f <= 0 || (u.current = !0, s(f, !0), g((V) => V === f ? V : (_.current = !0, f)));
|
|
298
|
+
});
|
|
299
|
+
}), () => {
|
|
300
|
+
d.current !== void 0 && (cancelAnimationFrame(d.current), d.current = void 0, l.current = !1);
|
|
301
|
+
};
|
|
302
|
+
}, [r]), M(() => {
|
|
303
|
+
if (_.current) {
|
|
304
|
+
_.current = !1;
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
l.current && s(o);
|
|
308
|
+
}, [o, s]), R(() => u.current ? (u.current = !1, !0) : !1, []);
|
|
309
|
+
}, Ce = ({ children: i, store: o }) => {
|
|
310
|
+
const { autoplay: t, navigation: s, slides: e } = o, { currentPage: a, setCurrentPage: g } = e, r = W(null), [l, d] = K(0), [u, _] = K(!1), [L, y] = K(!1), k = Math.ceil(l / e.currentSlidesPerView) || 1, f = R(() => {
|
|
311
|
+
const h = r == null ? void 0 : r.current;
|
|
312
|
+
if (h && !t.enabled) {
|
|
313
|
+
const { offsetWidth: b, scrollLeft: c, scrollWidth: S } = h, P = !(c > e.gap), O = !(S - (c + b) > e.gap);
|
|
314
|
+
_(P), y(O);
|
|
316
315
|
} else
|
|
317
|
-
|
|
318
|
-
}, [
|
|
319
|
-
var
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
const { children:
|
|
323
|
-
|
|
316
|
+
_(!1), y(!1);
|
|
317
|
+
}, [t.enabled, e.gap]), V = R(() => {
|
|
318
|
+
var b, c;
|
|
319
|
+
const h = r == null ? void 0 : r.current;
|
|
320
|
+
if (h) {
|
|
321
|
+
const { children: S, offsetWidth: P, scrollLeft: O, scrollWidth: N } = h, B = (c = (b = S == null ? void 0 : S[0]) == null ? void 0 : b.getBoundingClientRect()) == null ? void 0 : c.width, q = !(N - (O + P) > e.gap) ? k - 1 : Math.round(O / ((B + e.gap) * e.currentSlidesPerView));
|
|
322
|
+
q !== a && g(q);
|
|
324
323
|
}
|
|
325
|
-
}, [
|
|
326
|
-
(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
), e = A(
|
|
331
|
-
(a, g = !1) => {
|
|
332
|
-
var P, k, C;
|
|
333
|
-
const p = r == null ? void 0 : r.current, I = (C = (k = (P = p == null ? void 0 : p.children) == null ? void 0 : P[0]) == null ? void 0 : k.getBoundingClientRect()) == null ? void 0 : C.width;
|
|
334
|
-
p == null || p.scrollTo({
|
|
324
|
+
}, [k, a, e.currentSlidesPerView, r, g, e.gap]), x = R(
|
|
325
|
+
(h, b = !1) => {
|
|
326
|
+
var P, O, N;
|
|
327
|
+
const c = r == null ? void 0 : r.current, S = ((N = (O = (P = c == null ? void 0 : c.children) == null ? void 0 : P[0]) == null ? void 0 : O.getBoundingClientRect()) == null ? void 0 : N.width) || 0;
|
|
328
|
+
c == null || c.scrollTo({
|
|
335
329
|
// We don't want to have a scroll effect when we first render the swiper
|
|
336
|
-
behavior:
|
|
337
|
-
left:
|
|
330
|
+
behavior: b ? "auto" : "smooth",
|
|
331
|
+
left: h * (S + e.gap) * e.currentSlidesPerView,
|
|
338
332
|
top: 0
|
|
339
333
|
});
|
|
340
334
|
},
|
|
341
|
-
[
|
|
342
|
-
),
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
335
|
+
[e.currentSlidesPerView, e.gap, r]
|
|
336
|
+
), T = je({
|
|
337
|
+
alignment: e.alignment,
|
|
338
|
+
currentPage: a,
|
|
339
|
+
currentSlidesPerView: e.currentSlidesPerView,
|
|
340
|
+
goTo: x,
|
|
341
|
+
initialIndex: e.initialIndex,
|
|
342
|
+
numberOfPage: k,
|
|
343
|
+
setCurrentPage: g,
|
|
344
|
+
slidesLength: l
|
|
345
|
+
}), j = Z(
|
|
346
|
+
() => Te(() => {
|
|
347
|
+
f(), !T() && V();
|
|
348
|
+
}, 100),
|
|
349
|
+
[f, V, T]
|
|
350
|
+
), $ = W(j);
|
|
351
|
+
$.current = j, M(() => () => $.current.cancel(), []);
|
|
352
|
+
const n = a === 0, p = a === k - 1, w = R(() => {
|
|
353
|
+
t.enabled && t.loop && p ? x(0) : x(a + 1);
|
|
354
|
+
}, [a, x, p, t.enabled, t.loop]), I = R(() => {
|
|
355
|
+
n && t.enabled && t.loop ? x(k - 1) : x(a - 1);
|
|
356
|
+
}, [k, a, x, n, t.enabled, t.loop]);
|
|
357
|
+
return ye(
|
|
348
358
|
() => {
|
|
349
|
-
|
|
359
|
+
t.enabled && w();
|
|
350
360
|
},
|
|
351
|
-
|
|
352
|
-
),
|
|
353
|
-
const
|
|
354
|
-
|
|
361
|
+
t.enabled ? t.duration : null
|
|
362
|
+
), M(() => {
|
|
363
|
+
const h = (b) => {
|
|
364
|
+
b.code === "ArrowLeft" && I(), b.code === "ArrowRight" && w();
|
|
355
365
|
};
|
|
356
|
-
return window.addEventListener("keydown",
|
|
357
|
-
}, [
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
Math.floor(x / 2)
|
|
361
|
-
) : (
|
|
362
|
-
// if centeredSlides is false, we calculate on which page the number in firstSlideToShow props is
|
|
363
|
-
Math.ceil(t.initialIndex / t.currentSlidesPerView) - 1
|
|
364
|
-
);
|
|
365
|
-
W(() => {
|
|
366
|
-
v > 0 && !c.current && (e(B, !0), c.current = !0);
|
|
367
|
-
}, [v]), W(() => {
|
|
368
|
-
y();
|
|
369
|
-
}, [y, i]), W(() => {
|
|
370
|
-
c.current && e(n);
|
|
371
|
-
}, [n, e]);
|
|
372
|
-
const O = ee(
|
|
366
|
+
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
367
|
+
}, [I, w]), M(() => {
|
|
368
|
+
f();
|
|
369
|
+
}, [f, i]), Z(
|
|
373
370
|
() => ({
|
|
374
371
|
navigation: {
|
|
375
|
-
goNext:
|
|
376
|
-
goPrev:
|
|
377
|
-
isNextDisabled:
|
|
378
|
-
isPrevDisabled:
|
|
379
|
-
...
|
|
372
|
+
goNext: w,
|
|
373
|
+
goPrev: I,
|
|
374
|
+
isNextDisabled: L,
|
|
375
|
+
isPrevDisabled: u,
|
|
376
|
+
...s
|
|
380
377
|
},
|
|
381
378
|
slides: {
|
|
382
|
-
alignment:
|
|
383
|
-
currentPage:
|
|
384
|
-
currentSlidesPerView:
|
|
385
|
-
expandOnLargeScreens:
|
|
386
|
-
gap:
|
|
379
|
+
alignment: e.alignment,
|
|
380
|
+
currentPage: a,
|
|
381
|
+
currentSlidesPerView: e.currentSlidesPerView,
|
|
382
|
+
expandOnLargeScreens: e.expandOnLargeScreens,
|
|
383
|
+
gap: e.gap,
|
|
387
384
|
handleScroll: j,
|
|
388
|
-
id:
|
|
389
|
-
initialIndex:
|
|
390
|
-
isLastPage:
|
|
391
|
-
length:
|
|
392
|
-
perView:
|
|
385
|
+
id: e.id,
|
|
386
|
+
initialIndex: e.initialIndex,
|
|
387
|
+
isLastPage: p,
|
|
388
|
+
length: l,
|
|
389
|
+
perView: e.perView,
|
|
393
390
|
ref: r,
|
|
394
|
-
setLength:
|
|
391
|
+
setLength: d
|
|
395
392
|
}
|
|
396
393
|
}),
|
|
397
394
|
[
|
|
398
|
-
|
|
395
|
+
w,
|
|
396
|
+
I,
|
|
399
397
|
L,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
n,
|
|
398
|
+
u,
|
|
399
|
+
s,
|
|
400
|
+
a,
|
|
404
401
|
j,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
402
|
+
p,
|
|
403
|
+
l,
|
|
404
|
+
e
|
|
408
405
|
]
|
|
409
406
|
);
|
|
410
|
-
|
|
407
|
+
}, De = (i = v) => {
|
|
408
|
+
var _;
|
|
409
|
+
const [o, t] = K(0), s = {
|
|
410
|
+
autoplay: { ...v.autoplay, ...i.autoplay },
|
|
411
|
+
navigation: { ...v.navigation, ...i.navigation },
|
|
412
|
+
slides: {
|
|
413
|
+
...v.slides,
|
|
414
|
+
...i.slides,
|
|
415
|
+
perView: {
|
|
416
|
+
...v.slides.perView,
|
|
417
|
+
...(_ = i.slides) == null ? void 0 : _.perView
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}, {
|
|
421
|
+
autoplay: e,
|
|
422
|
+
navigation: a,
|
|
423
|
+
slides: { expandOnLargeScreens: g, perView: r }
|
|
424
|
+
} = s, { width: l } = we(), d = pe(), u = Z(() => l <= d.md ? r.mobile : l <= d.lg ? r.tablet : l >= d["4xl"] && g ? r.desktop + 2 : r.desktop, [l, d, g, r]);
|
|
425
|
+
return {
|
|
426
|
+
autoplay: e,
|
|
427
|
+
navigation: a,
|
|
428
|
+
slides: {
|
|
429
|
+
alignment: s.slides.alignment,
|
|
430
|
+
currentPage: o,
|
|
431
|
+
currentSlidesPerView: u,
|
|
432
|
+
expandOnLargeScreens: s.slides.expandOnLargeScreens,
|
|
433
|
+
gap: s.slides.gap,
|
|
434
|
+
id: s.slides.id,
|
|
435
|
+
initialIndex: s.slides.initialIndex,
|
|
436
|
+
perView: r,
|
|
437
|
+
setCurrentPage: t
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
}, We = U(X), J = ({ children: i, className: o, store: t = Ve, ...s }) => {
|
|
441
|
+
const e = Ce({ children: i, store: t });
|
|
442
|
+
return /* @__PURE__ */ E(ce.Provider, { value: e, children: /* @__PURE__ */ E("div", { className: We("root", o), ...s, children: i }) });
|
|
411
443
|
};
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
444
|
+
J.PrevButton = Pe;
|
|
445
|
+
J.NextButton = _e;
|
|
446
|
+
J.Slides = Le;
|
|
447
|
+
J.displayName = "Swiper";
|
|
416
448
|
export {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
449
|
+
J as Swiper,
|
|
450
|
+
X as swiperClasses,
|
|
451
|
+
De as useSwiper,
|
|
452
|
+
ee as useSwiperContext
|
|
421
453
|
};
|
package/dist/Window.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Window.css';
|
|
3
|
-
import { jsx as o, jsxs as
|
|
3
|
+
import { jsx as o, jsxs as _ } from "react/jsx-runtime";
|
|
4
4
|
import { c as d } from "./index-B6iGEm-i.js";
|
|
5
5
|
import { f as b } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
6
|
-
import { forwardRef as
|
|
6
|
+
import { forwardRef as m, useState as B } from "react";
|
|
7
7
|
import { T as I, a as g, b as j } from "./tab-panel-Cc3MfOBM.js";
|
|
8
8
|
import { b as A } from "./Q5W46E73-5xQblshY.js";
|
|
9
9
|
import { Badge as S } from "./Badge.js";
|
|
10
|
-
import { Icon as
|
|
10
|
+
import { Icon as x } from "./Icon.js";
|
|
11
11
|
import { Text as u } from "./Text.js";
|
|
12
12
|
const H = "_root_17x8z_2", P = "_header_17x8z_11", R = "_media_17x8z_125", c = {
|
|
13
13
|
root: H,
|
|
@@ -26,17 +26,17 @@ const H = "_root_17x8z_2", P = "_header_17x8z_11", R = "_media_17x8z_125", c = {
|
|
|
26
26
|
"size-md": "_size-md_17x8z_149",
|
|
27
27
|
"size-sm": "_size-sm_17x8z_153",
|
|
28
28
|
"size-xs": "_size-xs_17x8z_157"
|
|
29
|
-
}, k = d(c), h =
|
|
30
|
-
({ children:
|
|
29
|
+
}, k = d(c), h = m(
|
|
30
|
+
({ children: a, className: t, size: e = "md", ...s }, n) => /* @__PURE__ */ o("div", { className: k("body", `size-${e}`, t), ref: n, ...s, children: a })
|
|
31
31
|
);
|
|
32
32
|
h.displayName = "Window.Body";
|
|
33
|
-
const L = d(c), z =
|
|
34
|
-
({ children:
|
|
33
|
+
const L = d(c), z = m(
|
|
34
|
+
({ children: a, className: t, ...e }, s) => /* @__PURE__ */ o("div", { className: L("box-text", t), ref: s, ...e, children: a })
|
|
35
35
|
);
|
|
36
36
|
z.displayName = "Window.BoxText";
|
|
37
37
|
const i = d(c), p = ({
|
|
38
|
-
"aria-label":
|
|
39
|
-
className:
|
|
38
|
+
"aria-label": a,
|
|
39
|
+
className: t,
|
|
40
40
|
icon: e,
|
|
41
41
|
isActive: s,
|
|
42
42
|
onClick: n,
|
|
@@ -44,74 +44,81 @@ const i = d(c), p = ({
|
|
|
44
44
|
}) => /* @__PURE__ */ o(
|
|
45
45
|
"button",
|
|
46
46
|
{
|
|
47
|
-
"aria-label":
|
|
47
|
+
"aria-label": a,
|
|
48
48
|
"aria-pressed": s,
|
|
49
|
-
className: i("header-action-button",
|
|
49
|
+
className: i("header-action-button", t),
|
|
50
50
|
onClick: n,
|
|
51
51
|
type: "button",
|
|
52
52
|
...r,
|
|
53
|
-
children: /* @__PURE__ */ o(
|
|
53
|
+
children: /* @__PURE__ */ o(x, { name: e })
|
|
54
54
|
}
|
|
55
55
|
), w = ({
|
|
56
|
-
as:
|
|
57
|
-
className:
|
|
56
|
+
as: a,
|
|
57
|
+
className: t,
|
|
58
58
|
onClick: e
|
|
59
59
|
}) => /* @__PURE__ */ o(
|
|
60
60
|
p,
|
|
61
61
|
{
|
|
62
62
|
"aria-label": "Close window",
|
|
63
|
-
as:
|
|
64
|
-
className: i("header-close-button",
|
|
63
|
+
as: a,
|
|
64
|
+
className: i("header-close-button", t),
|
|
65
65
|
icon: "times",
|
|
66
66
|
onClick: e
|
|
67
67
|
}
|
|
68
|
-
), M = ({ children:
|
|
69
|
-
({ as:
|
|
70
|
-
const $ = A(
|
|
71
|
-
return /* @__PURE__ */
|
|
68
|
+
), M = ({ children: a, className: t, store: e, ...s }) => /* @__PURE__ */ o(g, { className: i("header-tabs", t), store: e, ...s, children: a }), O = b(
|
|
69
|
+
({ as: a, badge: t, children: e, className: s, icon: n, id: r, store: l, ...v }, W) => {
|
|
70
|
+
const $ = A(l, "selectedId") === r;
|
|
71
|
+
return /* @__PURE__ */ _(
|
|
72
72
|
I,
|
|
73
73
|
{
|
|
74
74
|
className: i("header-tab-item", s),
|
|
75
75
|
id: r,
|
|
76
76
|
ref: W,
|
|
77
|
-
render:
|
|
78
|
-
store:
|
|
77
|
+
render: a ? /* @__PURE__ */ o(a, {}) : void 0,
|
|
78
|
+
store: l,
|
|
79
79
|
...v,
|
|
80
80
|
children: [
|
|
81
|
-
n ? /* @__PURE__ */ o(
|
|
81
|
+
n ? /* @__PURE__ */ o(x, { name: n }) : null,
|
|
82
82
|
/* @__PURE__ */ o(u, { variant: "label-sm", children: e }),
|
|
83
|
-
|
|
83
|
+
t ? /* @__PURE__ */ o(S, { variant: $ ? "neutral" : "warm", children: t }) : null
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
r
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
|
-
), E = ({ children:
|
|
89
|
+
), E = ({ children: a, isClosable: t = !1, onClose: e }) => {
|
|
90
90
|
const s = () => {
|
|
91
91
|
e == null || e();
|
|
92
92
|
};
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
return /* @__PURE__ */ _("div", { className: i("header-actions"), children: [
|
|
94
|
+
a,
|
|
95
|
+
t ? /* @__PURE__ */ o(w, { onClick: s }) : null
|
|
96
96
|
] });
|
|
97
|
-
}, q = ({
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
}, q = ({
|
|
98
|
+
children: a,
|
|
99
|
+
isExpandable: t = !1,
|
|
100
|
+
onExpandChange: e
|
|
101
|
+
}) => {
|
|
102
|
+
const [s, n] = B(!1), r = () => {
|
|
103
|
+
const l = !s;
|
|
104
|
+
n(l), e == null || e(l);
|
|
101
105
|
};
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
106
|
+
return /* @__PURE__ */ _("div", { className: i("header-actions"), children: [
|
|
107
|
+
t ? /* @__PURE__ */ o(
|
|
108
|
+
"button",
|
|
109
|
+
{
|
|
110
|
+
"aria-expanded": s,
|
|
111
|
+
"aria-label": s ? "Collapse window" : "Expand window",
|
|
112
|
+
className: i("header-action-button"),
|
|
113
|
+
onClick: r,
|
|
114
|
+
type: "button",
|
|
115
|
+
children: /* @__PURE__ */ o(x, { name: s ? "compress-alt" : "arrow-resize-diagonal" })
|
|
116
|
+
}
|
|
117
|
+
) : null,
|
|
118
|
+
a
|
|
119
|
+
] });
|
|
120
|
+
}, C = ({ as: a, className: t, title: e }) => /* @__PURE__ */ o(u, { as: a, className: i("header-title", t), variant: "body-md-strong", children: e }), N = m(
|
|
121
|
+
({ children: a, className: t, ...e }, s) => /* @__PURE__ */ o("header", { className: i("header", t), ref: s, ...e, children: a })
|
|
115
122
|
);
|
|
116
123
|
N.displayName = "Window.Header";
|
|
117
124
|
const D = Object.assign(N, {
|
|
@@ -122,16 +129,16 @@ const D = Object.assign(N, {
|
|
|
122
129
|
Tab: O,
|
|
123
130
|
Tabs: M,
|
|
124
131
|
Title: C
|
|
125
|
-
}), F = d(c), f =
|
|
126
|
-
({ children:
|
|
132
|
+
}), F = d(c), f = m(
|
|
133
|
+
({ children: a, className: t, ...e }, s) => /* @__PURE__ */ o("div", { className: F("media", t), ref: s, ...e, children: a })
|
|
127
134
|
);
|
|
128
135
|
f.displayName = "Window.Media";
|
|
129
|
-
const G = d(c), y =
|
|
130
|
-
({ children:
|
|
136
|
+
const G = d(c), y = m(
|
|
137
|
+
({ children: a, store: t, tabId: e, ...s }, n) => /* @__PURE__ */ o(j, { className: G("tab-panel"), ref: n, store: t, tabId: e, ...s, children: a })
|
|
131
138
|
);
|
|
132
139
|
y.displayName = "Window.TabPanel";
|
|
133
140
|
const J = d(c), T = b(
|
|
134
|
-
({ as:
|
|
141
|
+
({ as: a = "div", children: t, className: e, role: s = "region", ...n }, r) => /* @__PURE__ */ o(a, { className: J("root", e), ref: r, role: s, ...n, children: t })
|
|
135
142
|
);
|
|
136
143
|
T.displayName = "Window";
|
|
137
144
|
const se = Object.assign(T, {
|
|
@@ -20,7 +20,7 @@ export declare const Drawer: import('react').ForwardRefExoticComponent<Omit<Draw
|
|
|
20
20
|
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
21
21
|
Button: ({ "aria-label": ariaLabel, className, icon, isActive, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('../Window/types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
CloseButton: ({ as, className, onClick, }: import('../../utils').PropsWithAs<import('../../utils').As, Omit<import('../Window/types').ActionButtonProps, "icon">>) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
LeftActions: ({ isExpandable, onExpandChange }: import('../Window/types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
LeftActions: ({ children, isExpandable, onExpandChange, }: import('../Window/types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
RightActions: ({ children, isClosable, onClose }: import('../Window/types').HeaderRightActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
Tab: import('../../utils').FunctionComponentWithAs<"button", import('../Window/types').HeaderTabItem>;
|
|
26
26
|
Tabs: ({ children, className, store, ...rest }: import('../Window/types').HeaderTabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,7 +35,7 @@ export declare const Modal: import('../../utils').FunctionComponentWithAs<"div",
|
|
|
35
35
|
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
36
36
|
Button: ({ "aria-label": ariaLabel, className, icon, isActive, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('../Window/types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
CloseButton: ({ as, className, onClick, }: import('../../utils').PropsWithAs<import('../../utils').As, Omit<import('../Window/types').ActionButtonProps, "icon">>) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
LeftActions: ({ isExpandable, onExpandChange }: import('../Window/types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
LeftActions: ({ children, isExpandable, onExpandChange, }: import('../Window/types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
RightActions: ({ children, isClosable, onClose }: import('../Window/types').HeaderRightActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
Tab: import('../../utils').FunctionComponentWithAs<"button", import('../Window/types').HeaderTabItem>;
|
|
41
41
|
Tabs: ({ children, className, store, ...rest }: import('../Window/types').HeaderTabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const defaultOptions: {
|
|
2
|
+
autoplay: {
|
|
3
|
+
duration: number;
|
|
4
|
+
enabled: false;
|
|
5
|
+
loop: false;
|
|
6
|
+
};
|
|
7
|
+
navigation: {
|
|
8
|
+
desktop: true;
|
|
9
|
+
mobile: true;
|
|
10
|
+
};
|
|
11
|
+
slides: {
|
|
12
|
+
alignment: "default";
|
|
13
|
+
expandOnLargeScreens: false;
|
|
14
|
+
gap: number;
|
|
15
|
+
id: string;
|
|
16
|
+
initialIndex: number;
|
|
17
|
+
perView: {
|
|
18
|
+
desktop: number;
|
|
19
|
+
mobile: number;
|
|
20
|
+
tablet: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const defaultStore: {
|
|
25
|
+
autoplay: {
|
|
26
|
+
duration: number;
|
|
27
|
+
enabled: false;
|
|
28
|
+
loop: false;
|
|
29
|
+
};
|
|
30
|
+
navigation: {
|
|
31
|
+
desktop: true;
|
|
32
|
+
mobile: true;
|
|
33
|
+
};
|
|
34
|
+
slides: {
|
|
35
|
+
alignment: "default";
|
|
36
|
+
currentPage: number;
|
|
37
|
+
currentSlidesPerView: number;
|
|
38
|
+
expandOnLargeScreens: false;
|
|
39
|
+
gap: number;
|
|
40
|
+
id: string;
|
|
41
|
+
initialIndex: number;
|
|
42
|
+
perView: {
|
|
43
|
+
desktop: number;
|
|
44
|
+
mobile: number;
|
|
45
|
+
tablet: number;
|
|
46
|
+
};
|
|
47
|
+
setCurrentPage: () => void;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -1,60 +1,13 @@
|
|
|
1
1
|
import { default as swiperStyles } from './swiper.module.scss';
|
|
2
|
-
import {
|
|
2
|
+
import { SwiperProps } from './types';
|
|
3
3
|
export { swiperStyles as swiperClasses };
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
slides: {
|
|
14
|
-
alignment: 'center' | 'default';
|
|
15
|
-
currentPage: number;
|
|
16
|
-
currentSlidesPerView: number;
|
|
17
|
-
expandOnLargeScreens: boolean;
|
|
18
|
-
gap: number;
|
|
19
|
-
handleScroll: () => void;
|
|
20
|
-
id: string;
|
|
21
|
-
initialIndex: number;
|
|
22
|
-
isLastPage: boolean;
|
|
23
|
-
length: number;
|
|
24
|
-
perView: {
|
|
25
|
-
desktop: number;
|
|
26
|
-
mobile: number;
|
|
27
|
-
tablet: number;
|
|
28
|
-
};
|
|
29
|
-
ref: React.RefObject<HTMLUListElement>;
|
|
30
|
-
setLength: (length: number) => void;
|
|
31
|
-
};
|
|
4
|
+
export { useSwiperContext } from './context';
|
|
5
|
+
export type { SwiperContextValue } from './types';
|
|
6
|
+
export { useSwiper } from './useSwiper';
|
|
7
|
+
export declare const Swiper: {
|
|
8
|
+
({ children, className, store, ...rest }: SwiperProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
PrevButton: ({ children, className, placement, size, variant, ...rest }: import('./types').SwiperPrevButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
NextButton: ({ children, className, placement, size, variant, ...rest }: import('./types').SwiperNextButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Slides: ({ children, className }: import('./types').SwiperSlidesProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
32
13
|
};
|
|
33
|
-
export declare const useSwiperContext: () => SwiperContextValue;
|
|
34
|
-
export declare const useSwiper: (options?: UseSwiperOptions) => {
|
|
35
|
-
autoplay: {
|
|
36
|
-
duration: number;
|
|
37
|
-
enabled: boolean;
|
|
38
|
-
loop: boolean;
|
|
39
|
-
};
|
|
40
|
-
navigation: {
|
|
41
|
-
desktop: boolean;
|
|
42
|
-
mobile: boolean;
|
|
43
|
-
};
|
|
44
|
-
slides: {
|
|
45
|
-
alignment: "center" | "default";
|
|
46
|
-
currentPage: number;
|
|
47
|
-
currentSlidesPerView: number;
|
|
48
|
-
expandOnLargeScreens: boolean;
|
|
49
|
-
gap: number;
|
|
50
|
-
id: string;
|
|
51
|
-
initialIndex: number;
|
|
52
|
-
perView: {
|
|
53
|
-
desktop: number;
|
|
54
|
-
mobile: number;
|
|
55
|
-
tablet: number;
|
|
56
|
-
};
|
|
57
|
-
setCurrentPage: React.Dispatch<React.SetStateAction<number>>;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export declare const Swiper: SwiperComponent;
|
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
import { ComponentProps,
|
|
1
|
+
import { ComponentProps, ReactNode, RefObject } from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button/types';
|
|
3
|
-
import { useSwiper } from '
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { useSwiper } from './useSwiper';
|
|
4
|
+
export type SwiperContextValue = {
|
|
5
|
+
navigation: {
|
|
6
|
+
desktop: boolean;
|
|
7
|
+
goNext: () => void;
|
|
8
|
+
goPrev: () => void;
|
|
9
|
+
isNextDisabled: boolean;
|
|
10
|
+
isPrevDisabled: boolean;
|
|
11
|
+
mobile: boolean;
|
|
12
|
+
};
|
|
13
|
+
slides: {
|
|
14
|
+
alignment: 'center' | 'default';
|
|
15
|
+
currentPage: number;
|
|
16
|
+
currentSlidesPerView: number;
|
|
17
|
+
expandOnLargeScreens: boolean;
|
|
18
|
+
gap: number;
|
|
19
|
+
handleScroll: () => void;
|
|
20
|
+
id: string;
|
|
21
|
+
initialIndex: number;
|
|
22
|
+
isLastPage: boolean;
|
|
23
|
+
length: number;
|
|
24
|
+
perView: {
|
|
25
|
+
desktop: number;
|
|
26
|
+
mobile: number;
|
|
27
|
+
tablet: number;
|
|
28
|
+
};
|
|
29
|
+
ref: RefObject<HTMLUListElement | null>;
|
|
30
|
+
setLength: (length: number) => void;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
9
33
|
export type SwiperNextButtonProps = Omit<ButtonProps, 'aria-label' | 'disabled' | 'onClick'> & {
|
|
10
34
|
placement?: 'inline' | 'side';
|
|
11
35
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type UseInitialScrollOptions = {
|
|
2
|
+
alignment: 'center' | 'default';
|
|
3
|
+
currentPage: number;
|
|
4
|
+
currentSlidesPerView: number;
|
|
5
|
+
goTo: (page: number, isFirstInit?: boolean) => void;
|
|
6
|
+
initialIndex: number;
|
|
7
|
+
numberOfPage: number;
|
|
8
|
+
setCurrentPage: React.Dispatch<React.SetStateAction<number>>;
|
|
9
|
+
slidesLength: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Owns the deferred, one-shot scroll to the initial page and the state flags
|
|
13
|
+
* that keep it from fighting the scroll handler. Returns `consumeSnapBackSkip`,
|
|
14
|
+
* which the scroll handler calls once to swallow the scroll-snap correction
|
|
15
|
+
* that follows our own initial scroll.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useInitialScroll: ({ alignment, currentPage, currentSlidesPerView, goTo, initialIndex, numberOfPage, setCurrentPage, slidesLength, }: UseInitialScrollOptions) => (() => boolean);
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UseSwiperOptions } from './types';
|
|
2
|
+
export declare const useSwiper: (options?: UseSwiperOptions) => {
|
|
3
|
+
autoplay: {
|
|
4
|
+
duration: number;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
loop: boolean;
|
|
7
|
+
};
|
|
8
|
+
navigation: {
|
|
9
|
+
desktop: boolean;
|
|
10
|
+
mobile: boolean;
|
|
11
|
+
};
|
|
12
|
+
slides: {
|
|
13
|
+
alignment: "center" | "default";
|
|
14
|
+
currentPage: number;
|
|
15
|
+
currentSlidesPerView: number;
|
|
16
|
+
expandOnLargeScreens: boolean;
|
|
17
|
+
gap: number;
|
|
18
|
+
id: string;
|
|
19
|
+
initialIndex: number;
|
|
20
|
+
perView: {
|
|
21
|
+
desktop: number;
|
|
22
|
+
mobile: number;
|
|
23
|
+
tablet: number;
|
|
24
|
+
};
|
|
25
|
+
setCurrentPage: import('react').Dispatch<import('react').SetStateAction<number>>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const useInterval: (callback: () => void, delay: number) => void;
|
|
1
|
+
export declare const useInterval: (callback: () => void, delay: null | number) => void;
|
|
2
2
|
export declare const getSlideWidth: (slidesPerView: number, spaceBetween: number) => string;
|
|
@@ -8,7 +8,7 @@ export declare const Header: import('react').ForwardRefExoticComponent<import('r
|
|
|
8
8
|
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
9
9
|
Button: ({ "aria-label": ariaLabel, className, icon, isActive, onClick, ...rest }: PropsWithAs<As, ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
CloseButton: ({ as, className, onClick, }: PropsWithAs<As, Omit<ActionButtonProps, "icon">>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
LeftActions: ({ isExpandable, onExpandChange }: HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
LeftActions: ({ children, isExpandable, onExpandChange, }: HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
RightActions: ({ children, isClosable, onClose }: HeaderRightActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
Tab: import('../../../utils').FunctionComponentWithAs<"button", HeaderTabItem>;
|
|
14
14
|
Tabs: ({ children, className, store, ...rest }: HeaderTabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,7 +13,7 @@ export declare const Window: import('../../utils').FunctionComponentWithAs<"div"
|
|
|
13
13
|
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
14
14
|
Button: ({ "aria-label": ariaLabel, className, icon, isActive, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('./types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
CloseButton: ({ as, className, onClick, }: import('../../utils').PropsWithAs<import('../../utils').As, Omit<import('./types').ActionButtonProps, "icon">>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
LeftActions: ({ isExpandable, onExpandChange }: import('./types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
LeftActions: ({ children, isExpandable, onExpandChange, }: import('./types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
RightActions: ({ children, isClosable, onClose }: import('./types').HeaderRightActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
Tab: import('../../utils').FunctionComponentWithAs<"button", import('./types').HeaderTabItem>;
|
|
19
19
|
Tabs: ({ children, className, store, ...rest }: import('./types').HeaderTabsProps) => import("react/jsx-runtime").JSX.Element;
|