welcome-ui 8.0.0 → 8.0.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.
Files changed (90) hide show
  1. package/dist/AXB53BZF-BOEe01VW.mjs +25 -0
  2. package/dist/Accordion.mjs +17 -17
  3. package/dist/Alert.mjs +19 -19
  4. package/dist/{BYC7LY2E-CVjUW1dr.mjs → BYC7LY2E-B1IDizRs.mjs} +298 -295
  5. package/dist/Badge.mjs +1 -1
  6. package/dist/Breadcrumb.mjs +27 -26
  7. package/dist/Button.mjs +2 -2
  8. package/dist/Checkbox.mjs +1 -1
  9. package/dist/{CustomInput-D_13Gd_3.mjs → CustomInput-IA_gVoXd.mjs} +2991 -2859
  10. package/dist/DatePicker.mjs +4 -4
  11. package/dist/DateTimePicker.mjs +9 -9
  12. package/dist/DateTimePickerCommon.mjs +1 -1
  13. package/dist/Drawer.mjs +7 -7
  14. package/dist/DropdownMenu.mjs +262 -262
  15. package/dist/Field.mjs +25 -25
  16. package/dist/FileDrop.mjs +273 -267
  17. package/dist/FileUpload.mjs +26 -26
  18. package/dist/Files.mjs +1 -1
  19. package/dist/Hint.mjs +1 -1
  20. package/dist/{ITI7HKP4-BONrZ9Pq.mjs → ITI7HKP4-EL9KXYBU.mjs} +150 -150
  21. package/dist/Icons.mjs +88 -88
  22. package/dist/IconsFont.mjs +159 -159
  23. package/dist/InputText.mjs +1 -1
  24. package/dist/{JC64G2H7-Dey-8h60.mjs → JC64G2H7-BzklVBKM.mjs} +70 -70
  25. package/dist/KUU7WJ55-CS4NemC6.mjs +61 -0
  26. package/dist/{LVA2YJMS-qFC9J-lt.mjs → LVA2YJMS-DDEmK0pp.mjs} +491 -488
  27. package/dist/Label.mjs +2 -2
  28. package/dist/Link.mjs +3 -3
  29. package/dist/MTZPJQMC-CMjAwC0N.mjs +15 -0
  30. package/dist/Modal.mjs +13 -13
  31. package/dist/NLEBE274-QOMV1l7e.mjs +84 -0
  32. package/dist/P2CTZE2T-Cl2w7OLV.mjs +300 -0
  33. package/dist/P4IRICAX-DezbJY4s.mjs +37 -0
  34. package/dist/Pagination.mjs +22 -22
  35. package/dist/Picker.mjs +2 -2
  36. package/dist/Popover.mjs +2 -2
  37. package/dist/QYJ6MIDR-Bb0O5xUM.mjs +97 -0
  38. package/dist/Radio.mjs +18 -18
  39. package/dist/RadioGroup.mjs +15 -15
  40. package/dist/RadioTab.mjs +9 -9
  41. package/dist/{SYRFVSLH-cVmYtx36.mjs → SYRFVSLH-jn06-eLy.mjs} +17 -17
  42. package/dist/Search.mjs +2 -2
  43. package/dist/Select.mjs +719 -716
  44. package/dist/Shape.mjs +1 -1
  45. package/dist/Slider.mjs +1 -1
  46. package/dist/Swiper.mjs +284 -278
  47. package/dist/Tabs.mjs +128 -128
  48. package/dist/Tag.mjs +16 -16
  49. package/dist/Text.mjs +1 -1
  50. package/dist/Textarea.mjs +4 -4
  51. package/dist/TimePicker.mjs +6 -6
  52. package/dist/Toast.mjs +69 -69
  53. package/dist/Toggle.mjs +2 -2
  54. package/dist/Tooltip.mjs +60 -60
  55. package/dist/UniversalLink.mjs +8 -8
  56. package/dist/VEVQD5MH-CuegL0m0.mjs +20 -0
  57. package/dist/{VGCJ63VH-B39w1tBw.mjs → VGCJ63VH-BMzoZtCu.mjs} +31 -33
  58. package/dist/VariantIcon.mjs +4 -4
  59. package/dist/WelcomeLoader.mjs +4862 -9223
  60. package/dist/X5NMLKT6-CvSCix-_.mjs +25 -0
  61. package/dist/YV4JVR4I-Bh7B7TET.mjs +344 -0
  62. package/dist/downshift.esm-D0ns_SQs.mjs +1082 -0
  63. package/dist/{field-styles-DLIhqG_8.mjs → field-styles-CfVLcVQp.mjs} +1 -1
  64. package/dist/{index-BDeIsk2X.mjs → index-5PUh49rV.mjs} +56 -56
  65. package/dist/{index-DEJJvyGk.mjs → index-B0gDDiFm.mjs} +7 -7
  66. package/dist/{index-CExLVjET.mjs → index-B22SHR8h.mjs} +4 -4
  67. package/dist/index-BhcLigYU.mjs +77 -0
  68. package/dist/{index-BJAZgeHL.mjs → index-Bkl89twW.mjs} +4 -4
  69. package/dist/{index-BYdkhqH4.mjs → index-CBBbX29m.mjs} +3652 -3584
  70. package/dist/{index-BpRjq7lj.mjs → index-CQD9fgf_.mjs} +3 -3
  71. package/dist/{index-BRDOakbf.mjs → index-CmsWSKKs.mjs} +5 -5
  72. package/dist/{index-SbQUT2mU.mjs → index-DgSynio4.mjs} +244 -239
  73. package/dist/{index-BrfXjmHY.mjs → index-wr_b5GSV.mjs} +6 -6
  74. package/dist/radio-group-RFyDp0KD.mjs +51 -0
  75. package/dist/theme.mjs +670 -615
  76. package/dist/{use-viewport-m3glsbna.mjs → use-viewport-CfklieD-.mjs} +5 -5
  77. package/dist/utils.mjs +29 -91
  78. package/package.json +13 -13
  79. package/dist/AXB53BZF-CGoc4K3d.mjs +0 -25
  80. package/dist/KUU7WJ55-3sP-w1F1.mjs +0 -61
  81. package/dist/MTZPJQMC-C0Xe_WK4.mjs +0 -13
  82. package/dist/NLEBE274-C94QU78N.mjs +0 -84
  83. package/dist/P2CTZE2T-YPes1GXe.mjs +0 -297
  84. package/dist/P4IRICAX-DzXqUYe-.mjs +0 -37
  85. package/dist/QYJ6MIDR-BLLqyXdd.mjs +0 -97
  86. package/dist/VEVQD5MH-ZMnHV8ZJ.mjs +0 -20
  87. package/dist/X5NMLKT6-uFSu0Lii.mjs +0 -25
  88. package/dist/YV4JVR4I-BGfUf3Nu.mjs +0 -341
  89. package/dist/downshift.esm-CEHW4VDy.mjs +0 -1085
  90. package/dist/radio-group-CGC6DTFJ.mjs +0 -51
package/dist/Swiper.mjs CHANGED
@@ -1,119 +1,125 @@
1
1
  "use client";
2
- import A, { useRef as rt, useEffect as z, useState as K, useMemo as ft, Children as Y, cloneElement as ht, useCallback as D } from "react";
3
- import { c as V, g as gt } from "./_commonjsHelpers-CXJ7dpIk.mjs";
4
- import M, { system as ot, css as b, th as Z, useTheme as mt } from "@xstyled/styled-components";
5
- import { u as pt } from "./use-viewport-m3glsbna.mjs";
6
- import { Button as wt } from "./Button.mjs";
7
- import { IconsFont as tt } from "./IconsFont.mjs";
8
- var $t = "Expected a function", et = NaN, bt = "[object Symbol]", yt = /^\s+|\s+$/g, vt = /^[-+]0x[0-9a-f]+$/i, St = /^0b[01]+$/i, xt = /^0o[0-7]+$/i, Pt = parseInt, Rt = typeof V == "object" && V && V.Object === Object && V, Lt = typeof self == "object" && self && self.Object === Object && self, kt = Rt || Lt || Function("return this")(), Et = Object.prototype, At = Et.toString, jt = Math.max, Ct = Math.min, X = function() {
9
- return kt.Date.now();
10
- };
11
- function Tt(t, e, n) {
12
- var o, r, s, c, a, w, h = 0, C = !1, y = !1, R = !0;
13
- if (typeof t != "function")
14
- throw new TypeError($t);
15
- e = nt(e) || 0, q(n) && (C = !!n.leading, y = "maxWait" in n, s = y ? jt(nt(n.maxWait) || 0, e) : s, R = "trailing" in n ? !!n.trailing : R);
16
- function d(i) {
17
- var f = o, x = r;
18
- return o = r = void 0, h = i, c = t.apply(x, f), c;
19
- }
20
- function O(i) {
21
- return h = i, a = setTimeout(p, e), C ? d(i) : c;
22
- }
23
- function v(i) {
24
- var f = i - w, x = i - h, W = e - f;
25
- return y ? Ct(W, s - x) : W;
26
- }
27
- function L(i) {
28
- var f = i - w, x = i - h;
29
- return w === void 0 || f >= e || f < 0 || y && x >= s;
30
- }
31
- function p() {
32
- var i = X();
33
- if (L(i))
34
- return T(i);
35
- a = setTimeout(p, v(i));
2
+ import C, { useRef as lt, useEffect as X, useState as tt, useMemo as ut, Children as it, cloneElement as ft, useCallback as Q } from "react";
3
+ import { c as Y, g as ht } from "./_commonjsHelpers-CXJ7dpIk.mjs";
4
+ import B, { system as ct, css as P, th as rt, useTheme as gt } from "@xstyled/styled-components";
5
+ import { u as mt } from "./use-viewport-CfklieD-.mjs";
6
+ import { Button as pt } from "./Button.mjs";
7
+ import { IconsFont as ot } from "./IconsFont.mjs";
8
+ var et, st;
9
+ function wt() {
10
+ if (st) return et;
11
+ st = 1;
12
+ var i = "Expected a function", e = NaN, a = "[object Symbol]", f = /^\s+|\s+$/g, s = /^[-+]0x[0-9a-f]+$/i, d = /^0b[01]+$/i, g = /^0o[0-7]+$/i, S = parseInt, D = typeof Y == "object" && Y && Y.Object === Object && Y, L = typeof self == "object" && self && self.Object === Object && self, V = D || L || Function("return this")(), N = Object.prototype, z = N.toString, h = Math.max, H = Math.min, $ = function() {
13
+ return V.Date.now();
14
+ };
15
+ function T(t, r, u) {
16
+ var R, A, W, m, p, x, O = 0, J = !1, j = !1, G = !0;
17
+ if (typeof t != "function")
18
+ throw new TypeError(i);
19
+ r = M(r) || 0, y(u) && (J = !!u.leading, j = "maxWait" in u, W = j ? h(M(u.maxWait) || 0, r) : W, G = "trailing" in u ? !!u.trailing : G);
20
+ function K(n) {
21
+ var b = R, I = A;
22
+ return R = A = void 0, O = n, m = t.apply(I, b), m;
23
+ }
24
+ function E(n) {
25
+ return O = n, p = setTimeout(l, r), J ? K(n) : m;
26
+ }
27
+ function _(n) {
28
+ var b = n - x, I = n - O, Z = r - b;
29
+ return j ? H(Z, W - I) : Z;
30
+ }
31
+ function F(n) {
32
+ var b = n - x, I = n - O;
33
+ return x === void 0 || b >= r || b < 0 || j && I >= W;
34
+ }
35
+ function l() {
36
+ var n = $();
37
+ if (F(n))
38
+ return o(n);
39
+ p = setTimeout(l, _(n));
40
+ }
41
+ function o(n) {
42
+ return p = void 0, G && R ? K(n) : (R = A = void 0, m);
43
+ }
44
+ function c() {
45
+ p !== void 0 && clearTimeout(p), O = 0, R = x = A = p = void 0;
46
+ }
47
+ function w() {
48
+ return p === void 0 ? m : o($());
49
+ }
50
+ function v() {
51
+ var n = $(), b = F(n);
52
+ if (R = arguments, A = this, x = n, b) {
53
+ if (p === void 0)
54
+ return E(x);
55
+ if (j)
56
+ return p = setTimeout(l, r), K(x);
57
+ }
58
+ return p === void 0 && (p = setTimeout(l, r)), m;
59
+ }
60
+ return v.cancel = c, v.flush = w, v;
36
61
  }
37
- function T(i) {
38
- return a = void 0, R && o ? d(i) : (o = r = void 0, c);
62
+ function y(t) {
63
+ var r = typeof t;
64
+ return !!t && (r == "object" || r == "function");
39
65
  }
40
- function I() {
41
- a !== void 0 && clearTimeout(a), h = 0, o = w = r = a = void 0;
66
+ function U(t) {
67
+ return !!t && typeof t == "object";
42
68
  }
43
- function N() {
44
- return a === void 0 ? c : T(X());
69
+ function q(t) {
70
+ return typeof t == "symbol" || U(t) && z.call(t) == a;
45
71
  }
46
- function g() {
47
- var i = X(), f = L(i);
48
- if (o = arguments, r = this, w = i, f) {
49
- if (a === void 0)
50
- return O(w);
51
- if (y)
52
- return a = setTimeout(p, e), d(w);
72
+ function M(t) {
73
+ if (typeof t == "number")
74
+ return t;
75
+ if (q(t))
76
+ return e;
77
+ if (y(t)) {
78
+ var r = typeof t.valueOf == "function" ? t.valueOf() : t;
79
+ t = y(r) ? r + "" : r;
53
80
  }
54
- return a === void 0 && (a = setTimeout(p, e)), c;
81
+ if (typeof t != "string")
82
+ return t === 0 ? t : +t;
83
+ t = t.replace(f, "");
84
+ var u = d.test(t);
85
+ return u || g.test(t) ? S(t.slice(2), u ? 2 : 8) : s.test(t) ? e : +t;
55
86
  }
56
- return g.cancel = I, g.flush = N, g;
57
- }
58
- function q(t) {
59
- var e = typeof t;
60
- return !!t && (e == "object" || e == "function");
61
- }
62
- function Wt(t) {
63
- return !!t && typeof t == "object";
87
+ return et = T, et;
64
88
  }
65
- function Ot(t) {
66
- return typeof t == "symbol" || Wt(t) && At.call(t) == bt;
67
- }
68
- function nt(t) {
69
- if (typeof t == "number")
70
- return t;
71
- if (Ot(t))
72
- return et;
73
- if (q(t)) {
74
- var e = typeof t.valueOf == "function" ? t.valueOf() : t;
75
- t = q(e) ? e + "" : e;
76
- }
77
- if (typeof t != "string")
78
- return t === 0 ? t : +t;
79
- t = t.replace(yt, "");
80
- var n = St.test(t);
81
- return n || xt.test(t) ? Pt(t.slice(2), n ? 2 : 8) : vt.test(t) ? et : +t;
82
- }
83
- var It = Tt;
84
- const Nt = /* @__PURE__ */ gt(It), zt = (t, e) => {
85
- const n = rt();
86
- z(() => {
87
- n.current = t;
88
- }, [t]), z(() => {
89
- function o() {
90
- n.current();
89
+ var bt = wt();
90
+ const $t = /* @__PURE__ */ ht(bt), yt = (i, e) => {
91
+ const a = lt();
92
+ X(() => {
93
+ a.current = i;
94
+ }, [i]), X(() => {
95
+ function f() {
96
+ a.current();
91
97
  }
92
98
  if (e !== null) {
93
- const r = setInterval(o, e);
94
- return () => clearInterval(r);
99
+ const s = setInterval(f, e);
100
+ return () => clearInterval(s);
95
101
  }
96
102
  }, [e]);
97
- }, S = (t = 3, e, n) => {
103
+ }, k = (i = 3, e, a) => {
98
104
  if (e === 0)
99
- return `${100 / t}%`;
100
- const r = n(e * (t === 1 ? 4 : 2));
101
- return `calc(${100 / t}% - ${r})`;
102
- }, st = M.div`
105
+ return `${100 / i}%`;
106
+ const s = a(e * (i === 1 ? 4 : 2));
107
+ return `calc(${100 / i}% - ${s})`;
108
+ }, dt = B.div`
103
109
  overflow-y: hidden;
104
110
  position: relative;
105
111
  width: 100%;
106
112
  height: 100%;
107
113
 
108
- ${ot}
109
- `, it = M(wt)(
110
- ({ disabled: t, withDarkUI: e, withNavigation: { desktop: n, mobile: o } }) => b`
114
+ ${ct}
115
+ `, at = B(pt)(
116
+ ({ disabled: i, withDarkUI: e, withNavigation: { desktop: a, mobile: f } }) => P`
111
117
  top: 50%;
112
118
  transform: translate3d(0, -50%, 0);
113
- z-index: ${o ? 1 : -1};
114
- display: ${o ? "flex" : "none"};
119
+ z-index: ${f ? 1 : -1};
120
+ display: ${f ? "flex" : "none"};
115
121
 
116
- ${!e && b`
122
+ ${!e && P`
117
123
  background-color: neutral-10 !important;
118
124
 
119
125
  &:hover {
@@ -122,17 +128,17 @@ const Nt = /* @__PURE__ */ gt(It), zt = (t, e) => {
122
128
  `}
123
129
 
124
130
  @media (min-width: md) {
125
- z-index: ${n ? 1 : -1};
126
- display: ${n ? "flex" : "none"};
131
+ z-index: ${a ? 1 : -1};
132
+ display: ${a ? "flex" : "none"};
127
133
  }
128
134
 
129
- ${t && b`
135
+ ${i && P`
130
136
  opacity: 0;
131
137
  z-index: -1;
132
138
  `};
133
139
  `
134
- ), Mt = M.divBox(
135
- ({ withPagination: { desktop: t, mobile: e } }) => b`
140
+ ), vt = B.divBox(
141
+ ({ withPagination: { desktop: i, mobile: e } }) => P`
136
142
  justify-content: center;
137
143
  position: absolute;
138
144
  bottom: 0;
@@ -143,24 +149,24 @@ const Nt = /* @__PURE__ */ gt(It), zt = (t, e) => {
143
149
  display: ${e ? "flex" : "none"};
144
150
 
145
151
  @media (min-width: md) {
146
- z-index: ${t ? 1 : -1};
147
- display: ${t ? "flex" : "none"};
152
+ z-index: ${i ? 1 : -1};
153
+ display: ${i ? "flex" : "none"};
148
154
  }
149
155
  `
150
- ), Ft = M.div(
151
- ({ active: t, withDarkUI: e }) => b`
156
+ ), St = B.div(
157
+ ({ active: i, withDarkUI: e }) => P`
152
158
  height: 10;
153
159
  width: 10;
154
160
  border-radius: 50%;
155
161
  cursor: pointer;
156
162
  margin: 0 xxs;
157
- ${t ? Z("swipers.navigation.bullet.active") : Z("swipers.navigation.bullet.default")}
158
- ${e && b`
159
- background-color: ${t ? "neutral-90" : "neutral-50"};
163
+ ${i ? rt("swipers.navigation.bullet.active") : rt("swipers.navigation.bullet.default")}
164
+ ${e && P`
165
+ background-color: ${i ? "neutral-90" : "neutral-50"};
160
166
  `}
161
- ${ot}
167
+ ${ct}
162
168
  `
163
- ), _t = M.ulBox(({ fullWidth: t, slidesPerView: { desktop: e, mobile: n, tablet: o }, spaceBetween: r, theme: s }) => b`
169
+ ), xt = B.ulBox(({ fullWidth: i, slidesPerView: { desktop: e, mobile: a, tablet: f }, spaceBetween: s, theme: d }) => P`
164
170
  scroll-snap-type: x mandatory;
165
171
  display: flex;
166
172
  -webkit-overflow-scrolling: touch;
@@ -182,9 +188,9 @@ const Nt = /* @__PURE__ */ gt(It), zt = (t, e) => {
182
188
 
183
189
  > * {
184
190
  list-style-type: none;
185
- margin-right: ${r};
186
- min-width: ${S(n, r, s.toRem)};
187
- max-width: ${S(n, r, s.toRem)};
191
+ margin-right: ${s};
192
+ min-width: ${k(a, s, d.toRem)};
193
+ max-width: ${k(a, s, d.toRem)};
188
194
  flex: 1;
189
195
 
190
196
  &:last-child {
@@ -193,12 +199,12 @@ const Nt = /* @__PURE__ */ gt(It), zt = (t, e) => {
193
199
  }
194
200
 
195
201
  @media (min-width: sm) {
196
- ${n && b`
202
+ ${a && P`
197
203
  > * {
198
- min-width: ${S(n, r, s.toRem)};
199
- max-width: ${S(n, r, s.toRem)};
204
+ min-width: ${k(a, s, d.toRem)};
205
+ max-width: ${k(a, s, d.toRem)};
200
206
 
201
- &:nth-of-type(${n}n + 1) {
207
+ &:nth-of-type(${a}n + 1) {
202
208
  scroll-snap-align: start;
203
209
  }
204
210
  }
@@ -206,12 +212,12 @@ const Nt = /* @__PURE__ */ gt(It), zt = (t, e) => {
206
212
  }
207
213
 
208
214
  @media (min-width: md) {
209
- ${o && b`
215
+ ${f && P`
210
216
  > * {
211
- min-width: ${S(o, r, s.toRem)};
212
- max-width: ${S(o, r, s.toRem)};
217
+ min-width: ${k(f, s, d.toRem)};
218
+ max-width: ${k(f, s, d.toRem)};
213
219
 
214
- &:nth-of-type(${o}n + 1) {
220
+ &:nth-of-type(${f}n + 1) {
215
221
  scroll-snap-align: start;
216
222
  }
217
223
  }
@@ -219,10 +225,10 @@ const Nt = /* @__PURE__ */ gt(It), zt = (t, e) => {
219
225
  }
220
226
 
221
227
  @media (min-width: lg) {
222
- ${e && b`
228
+ ${e && P`
223
229
  > * {
224
- min-width: ${S(e, r, s.toRem)};
225
- max-width: ${S(e, r, s.toRem)};
230
+ min-width: ${k(e, s, d.toRem)};
231
+ max-width: ${k(e, s, d.toRem)};
226
232
 
227
233
  scroll-snap-align: unset;
228
234
 
@@ -238,213 +244,213 @@ const Nt = /* @__PURE__ */ gt(It), zt = (t, e) => {
238
244
  }
239
245
 
240
246
  @media (min-width: xl) {
241
- ${e && t && b`
247
+ ${e && i && P`
242
248
  > * {
243
- min-width: ${S(e + 2, r, s.toRem)};
244
- max-width: ${S(e + 2, r, s.toRem)};
249
+ min-width: ${k(e + 2, s, d.toRem)};
250
+ max-width: ${k(e + 2, s, d.toRem)};
245
251
  }
246
252
  `}
247
253
  }
248
- `), Bt = (t = {}) => {
254
+ `), Ct = (i = {}) => {
249
255
  const {
250
256
  autoplay: e = !1,
251
- centeredSlides: n = !1,
252
- duration: o = 5e3,
253
- firstSlideToShow: r = 0,
254
- fullWidth: s = !1,
255
- id: c = "swiper",
256
- loop: a = !1,
257
- navigationSize: w = "md",
258
- slidesPerView: h = { mobile: 1, tablet: 1, desktop: 1 },
259
- spaceBetween: C = 20,
260
- withDarkUI: y = !1,
261
- withNavigation: R = { mobile: !0, desktop: !0 },
262
- withPagination: d = { mobile: !1, desktop: !1 }
263
- } = t, O = a || e, { width: v } = pt(), [L, p] = K(0), [T, I] = K(!1), [N, g] = K(!1), i = rt(), { screens: f } = mt(), x = ft(() => v <= f.md ? h.mobile : v <= f.lg ? h.tablet : v >= f["4xl"] && s ? h.desktop + 2 : h.desktop, [s, v, f, h]);
257
+ centeredSlides: a = !1,
258
+ duration: f = 5e3,
259
+ firstSlideToShow: s = 0,
260
+ fullWidth: d = !1,
261
+ id: g = "swiper",
262
+ loop: S = !1,
263
+ navigationSize: D = "md",
264
+ slidesPerView: L = { mobile: 1, tablet: 1, desktop: 1 },
265
+ spaceBetween: V = 20,
266
+ withDarkUI: N = !1,
267
+ withNavigation: z = { mobile: !0, desktop: !0 },
268
+ withPagination: h = { mobile: !1, desktop: !1 }
269
+ } = i, H = S || e, { width: $ } = mt(), [T, y] = tt(0), [U, q] = tt(!1), [M, t] = tt(!1), r = lt(), { screens: u } = gt(), R = ut(() => $ <= u.md ? L.mobile : $ <= u.lg ? L.tablet : $ >= u["4xl"] && d ? L.desktop + 2 : L.desktop, [d, $, u, L]);
264
270
  return {
265
- centeredSlides: n,
266
- firstSlideToShow: r,
267
- currentSlidesPerView: x,
268
- currentPage: L,
269
- setCurrentPage: p,
270
- fullWidth: s,
271
- id: c,
272
- navigationSize: w,
273
- slidesPerView: h,
274
- spaceBetween: C,
275
- withNavigation: R,
276
- withPagination: d,
271
+ centeredSlides: a,
272
+ firstSlideToShow: s,
273
+ currentSlidesPerView: R,
274
+ currentPage: T,
275
+ setCurrentPage: y,
276
+ fullWidth: d,
277
+ id: g,
278
+ navigationSize: D,
279
+ slidesPerView: L,
280
+ spaceBetween: V,
281
+ withNavigation: z,
282
+ withPagination: h,
277
283
  autoplay: e,
278
- shouldLoop: O,
279
- duration: o,
280
- withDarkUI: y,
281
- ref: i,
282
- setShowLeftArrow: I,
283
- setShowRightArrow: g,
284
- showLeftArrow: T,
285
- showRightArrow: N
284
+ shouldLoop: H,
285
+ duration: f,
286
+ withDarkUI: N,
287
+ ref: r,
288
+ setShowLeftArrow: q,
289
+ setShowRightArrow: t,
290
+ showLeftArrow: U,
291
+ showRightArrow: M
286
292
  };
287
- }, Dt = ({ children: t, dataTestId: e, store: n, ...o }) => {
293
+ }, Pt = ({ children: i, dataTestId: e, store: a, ...f }) => {
288
294
  const {
289
- autoplay: r,
290
- centeredSlides: s,
291
- currentPage: c,
292
- currentSlidesPerView: a,
293
- duration: w,
294
- firstSlideToShow: h,
295
- fullWidth: C,
296
- id: y,
297
- navigationSize: R,
298
- ref: d,
299
- setCurrentPage: O,
300
- setShowLeftArrow: v,
301
- setShowRightArrow: L,
302
- shouldLoop: p,
303
- showLeftArrow: T,
304
- showRightArrow: I,
305
- slidesPerView: N,
306
- spaceBetween: g,
307
- withDarkUI: i,
308
- withNavigation: f,
309
- withPagination: x
310
- } = n, W = Y.toArray(t).length, B = Math.ceil(W / a), j = Array.from(Array(B).keys()), J = c === 0, H = c === j.length - 1, at = Y.map(t, (m, l) => {
311
- const u = `${y}-${l}`, $ = l + 1, E = Math.ceil($ / a) - 1, P = H ? W - $ >= a : E !== c;
312
- return ht(m, {
313
- ...m.props,
314
- id: u,
315
- key: u,
316
- "aria-hidden": P,
295
+ autoplay: s,
296
+ centeredSlides: d,
297
+ currentPage: g,
298
+ currentSlidesPerView: S,
299
+ duration: D,
300
+ firstSlideToShow: L,
301
+ fullWidth: V,
302
+ id: N,
303
+ navigationSize: z,
304
+ ref: h,
305
+ setCurrentPage: H,
306
+ setShowLeftArrow: $,
307
+ setShowRightArrow: T,
308
+ shouldLoop: y,
309
+ showLeftArrow: U,
310
+ showRightArrow: q,
311
+ slidesPerView: M,
312
+ spaceBetween: t,
313
+ withDarkUI: r,
314
+ withNavigation: u,
315
+ withPagination: R
316
+ } = a, A = it.toArray(i).length, W = Math.ceil(A / S), m = Array.from(Array(W).keys()), p = g === 0, x = g === m.length - 1, O = it.map(i, (l, o) => {
317
+ const c = `${N}-${o}`, w = o + 1, v = Math.ceil(w / S) - 1, n = x ? A - w >= S : v !== g;
318
+ return ft(l, {
319
+ ...l.props,
320
+ id: c,
321
+ key: c,
322
+ "aria-hidden": n,
317
323
  "aria-roledescription": "slide",
318
- "aria-label": `${$} of ${W}`
324
+ "aria-label": `${w} of ${A}`
319
325
  });
320
- }), lt = s ? (
326
+ }), J = d ? (
321
327
  // if centeredSlides is true, we calculate which number is the middle page
322
- Math.floor(B / 2)
328
+ Math.floor(W / 2)
323
329
  ) : (
324
330
  // if centeredSlides is false, we calculate on which page the number in firstSlideToShow props is
325
- Math.ceil(h / a) - 1
326
- ), U = D(() => {
327
- const m = d == null ? void 0 : d.current;
328
- if (m && !p) {
329
- const { offsetWidth: l, scrollLeft: u, scrollWidth: $ } = m, E = !(u > g), P = !($ - (u + l) > g);
330
- v(!E), L(!P);
331
+ Math.ceil(L / S) - 1
332
+ ), j = Q(() => {
333
+ const l = h == null ? void 0 : h.current;
334
+ if (l && !y) {
335
+ const { offsetWidth: o, scrollLeft: c, scrollWidth: w } = l, v = !(c > t), n = !(w - (c + o) > t);
336
+ $(!v), T(!n);
331
337
  } else
332
- v(!0), L(!0);
333
- }, [d, v, L, p, g]), ct = () => {
334
- var l, u;
335
- const m = d == null ? void 0 : d.current;
336
- if (m) {
337
- const { children: $, offsetWidth: E, scrollLeft: P, scrollWidth: _ } = m, ut = (u = (l = $ == null ? void 0 : $[0]) == null ? void 0 : l.getBoundingClientRect()) == null ? void 0 : u.width, Q = !(_ - (P + E) > g) ? j.length - 1 : Math.round(P / ((ut + g) * a));
338
- Q !== c && O(Q);
338
+ $(!0), T(!0);
339
+ }, [h, $, T, y, t]), G = () => {
340
+ var o, c;
341
+ const l = h == null ? void 0 : h.current;
342
+ if (l) {
343
+ const { children: w, offsetWidth: v, scrollLeft: n, scrollWidth: b } = l, I = (c = (o = w == null ? void 0 : w[0]) == null ? void 0 : o.getBoundingClientRect()) == null ? void 0 : c.width, nt = !(b - (n + v) > t) ? m.length - 1 : Math.round(n / ((I + t) * S));
344
+ nt !== g && H(nt);
339
345
  }
340
- }, dt = Nt(() => {
341
- U(), ct();
342
- }, 100), k = D(
343
- (m, l = !1) => {
344
- var E, P, _;
345
- const u = d == null ? void 0 : d.current, $ = (_ = (P = (E = u == null ? void 0 : u.children) == null ? void 0 : E[0]) == null ? void 0 : P.getBoundingClientRect()) == null ? void 0 : _.width;
346
- u == null || u.scrollTo({
347
- left: m * ($ + g) * a,
346
+ }, K = $t(() => {
347
+ j(), G();
348
+ }, 100), E = Q(
349
+ (l, o = !1) => {
350
+ var v, n, b;
351
+ const c = h == null ? void 0 : h.current, w = (b = (n = (v = c == null ? void 0 : c.children) == null ? void 0 : v[0]) == null ? void 0 : n.getBoundingClientRect()) == null ? void 0 : b.width;
352
+ c == null || c.scrollTo({
353
+ left: l * (w + t) * S,
348
354
  top: 0,
349
355
  // We don't want to have a scroll effect when we first render the swiper
350
- behavior: l ? "auto" : "smooth"
356
+ behavior: o ? "auto" : "smooth"
351
357
  });
352
358
  },
353
- [a, g, d]
354
- ), F = D(() => {
355
- k(p && H ? 0 : c + 1);
356
- }, [c, k, H, p]), G = D(() => {
357
- k(J && p ? j.length - 1 : c - 1);
358
- }, [j.length, c, k, J, p]);
359
- return zt(
359
+ [S, t, h]
360
+ ), _ = Q(() => {
361
+ E(y && x ? 0 : g + 1);
362
+ }, [g, E, x, y]), F = Q(() => {
363
+ E(p && y ? m.length - 1 : g - 1);
364
+ }, [m.length, g, E, p, y]);
365
+ return yt(
360
366
  () => {
361
- r && F();
367
+ s && _();
362
368
  },
363
- r ? w : null
364
- ), z(() => {
365
- const m = (l) => {
366
- l.code === "ArrowLeft" && G(), l.code === "ArrowRight" && F();
369
+ s ? D : null
370
+ ), X(() => {
371
+ const l = (o) => {
372
+ o.code === "ArrowLeft" && F(), o.code === "ArrowRight" && _();
367
373
  };
368
- return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
369
- }, [G, F]), z(() => {
370
- k(lt, !0);
371
- }, []), z(() => {
372
- U();
373
- }, [U, t]), /* @__PURE__ */ A.createElement(st, { "data-testid": e, ...o }, /* @__PURE__ */ A.createElement(
374
- _t,
374
+ return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
375
+ }, [F, _]), X(() => {
376
+ E(J, !0);
377
+ }, []), X(() => {
378
+ j();
379
+ }, [j, i]), /* @__PURE__ */ C.createElement(dt, { "data-testid": e, ...f }, /* @__PURE__ */ C.createElement(
380
+ xt,
375
381
  {
376
- fullWidth: C,
377
- onScroll: dt,
378
- ref: d,
379
- slidesPerView: N,
380
- spaceBetween: g
382
+ fullWidth: V,
383
+ onScroll: K,
384
+ ref: h,
385
+ slidesPerView: M,
386
+ spaceBetween: t
381
387
  },
382
- at
383
- ), /* @__PURE__ */ A.createElement(
384
- it,
388
+ O
389
+ ), /* @__PURE__ */ C.createElement(
390
+ at,
385
391
  {
386
392
  "aria-label": "Previous slide",
387
393
  "data-testid": e && `${e}-prev-button`,
388
- disabled: !T,
394
+ disabled: !U,
389
395
  left: 10,
390
- onClick: G,
396
+ onClick: F,
391
397
  position: "absolute",
392
398
  shape: "circle",
393
- size: R,
394
- variant: i ? "secondary" : "ghost",
395
- withDarkUI: i,
396
- withNavigation: f
399
+ size: z,
400
+ variant: r ? "secondary" : "ghost",
401
+ withDarkUI: r,
402
+ withNavigation: u
397
403
  },
398
- /* @__PURE__ */ A.createElement(tt.Left, null)
399
- ), /* @__PURE__ */ A.createElement(
400
- it,
404
+ /* @__PURE__ */ C.createElement(ot.Left, null)
405
+ ), /* @__PURE__ */ C.createElement(
406
+ at,
401
407
  {
402
408
  "aria-label": "Next slide",
403
409
  "data-testid": e && `${e}-next-button`,
404
- disabled: !I,
405
- onClick: F,
410
+ disabled: !q,
411
+ onClick: _,
406
412
  position: "absolute",
407
413
  right: 10,
408
414
  shape: "circle",
409
- size: R,
410
- variant: i ? "secondary" : "ghost",
411
- withDarkUI: i,
412
- withNavigation: f
415
+ size: z,
416
+ variant: r ? "secondary" : "ghost",
417
+ withDarkUI: r,
418
+ withNavigation: u
413
419
  },
414
- /* @__PURE__ */ A.createElement(tt.Right, null)
415
- ), /* @__PURE__ */ A.createElement(
416
- Mt,
420
+ /* @__PURE__ */ C.createElement(ot.Right, null)
421
+ ), /* @__PURE__ */ C.createElement(
422
+ vt,
417
423
  {
418
424
  className: "swiper-pagination",
419
425
  "data-testid": e && `${e}-pagination`,
420
426
  role: "tablist",
421
- withPagination: x
427
+ withPagination: R
422
428
  },
423
- j.length > 1 && j.map((m, l) => {
424
- const u = {
425
- idx: l,
429
+ m.length > 1 && m.map((l, o) => {
430
+ const c = {
431
+ idx: o,
426
432
  role: "tab",
427
- "aria-controls": `${y}-${l}`,
428
- "aria-label": `${l + 1} of ${j.length}`,
429
- "aria-selected": l === c,
430
- onClick: () => k(l)
433
+ "aria-controls": `${N}-${o}`,
434
+ "aria-label": `${o + 1} of ${m.length}`,
435
+ "aria-selected": o === g,
436
+ onClick: () => E(o)
431
437
  };
432
- return /* @__PURE__ */ A.createElement(
433
- Ft,
438
+ return /* @__PURE__ */ C.createElement(
439
+ St,
434
440
  {
435
- active: l === c,
436
- key: `bullet-${l + 1}`,
437
- withDarkUI: i,
438
- ...u
441
+ active: o === g,
442
+ key: `bullet-${o + 1}`,
443
+ withDarkUI: r,
444
+ ...c
439
445
  }
440
446
  );
441
447
  })
442
448
  ));
443
449
  };
444
- Dt.displayName = "Swiper";
445
- const Jt = st;
450
+ Pt.displayName = "Swiper";
451
+ const Tt = dt;
446
452
  export {
447
- Jt as StyledSwiper,
448
- Dt as Swiper,
449
- Bt as useSwiper
453
+ Tt as StyledSwiper,
454
+ Pt as Swiper,
455
+ Ct as useSwiper
450
456
  };