@enya-learning/nova 0.5.0 → 0.6.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/README.md +8 -10
- package/dist/chunks/dist-fahbq1psobj0ox6s.js.map +1 -1
- package/dist/components/accordion.js +23 -20
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.js +2 -2
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/avatar.js +24 -24
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +12 -12
- package/dist/components/badge.js.map +1 -1
- package/dist/components/box.js +16 -0
- package/dist/components/box.js.map +1 -0
- package/dist/components/breadcrumb.js +28 -24
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.js +2 -2
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.js +10 -10
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +491 -487
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/carousel.js +105 -98
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/chart.js +2 -2
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox.js +7 -6
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.js +64 -51
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.js +167 -160
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +40 -36
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/dialog.js +25 -24
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +39 -35
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/heading.js +39 -0
- package/dist/components/heading.js.map +1 -0
- package/dist/components/input-group.js +14 -14
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.js +28 -27
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/item.js +34 -34
- package/dist/components/item.js.map +1 -1
- package/dist/components/kbd.js +7 -7
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/menubar.js +52 -51
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/native-select.js +21 -19
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/navigation-menu.js +21 -19
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/pagination.js +33 -30
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/progress.js +4 -4
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.js +14 -14
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/resizable.js +1 -1
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/select.js +64 -57
- package/dist/components/select.js.map +1 -1
- package/dist/components/sheet.js +22 -21
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +83 -79
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.js +7 -7
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sonner.js +137 -121
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.js +10 -8
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/switch.js +5 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js +14 -14
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +15 -15
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.js +47 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/textarea.js +5 -5
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +7 -7
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/tooltip.js +5 -5
- package/dist/components/tooltip.js.map +1 -1
- package/dist/index.js +22 -14
- package/dist/src/components/box/box.d.ts +7 -0
- package/dist/src/components/box/index.d.ts +1 -0
- package/dist/src/components/heading/heading.d.ts +15 -0
- package/dist/src/components/heading/index.d.ts +1 -0
- package/dist/src/components/spinner/spinner.d.ts +2 -1
- package/dist/src/components/text/index.d.ts +1 -0
- package/dist/src/components/text/text.d.ts +13 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/styles/nova-binding.css +264 -266
- package/dist/styles/nova.css +158 -49
- package/dist/styles/typography.css +3 -123
- package/package.json +15 -2
- package/src/eslint/no-primitive-colors.js +2 -2
- package/dist/styles/theme-nova.css +0 -197
|
@@ -2,29 +2,30 @@
|
|
|
2
2
|
import { t as mt } from "../chunks/utils-kyb5nny4y41y7hd8.js";
|
|
3
3
|
import { Button as Jt } from "./button.js";
|
|
4
4
|
import { jsx as Q, jsxs as Xt } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { HugeiconsIcon as Yt } from "@hugeicons/react";
|
|
6
|
+
import { ChevronLeftIcon as dn, ChevronRightIcon as pn } from "@hugeicons/core-free-icons";
|
|
6
7
|
import * as H from "react";
|
|
7
|
-
import { useCallback as
|
|
8
|
-
function
|
|
8
|
+
import { useCallback as mn, useEffect as Ct, useRef as Gt, useState as qt } from "react";
|
|
9
|
+
function gn(t) {
|
|
9
10
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
12
|
+
function $t(t) {
|
|
13
|
+
return gn(t) || Array.isArray(t);
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function hn() {
|
|
15
16
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
16
17
|
}
|
|
17
18
|
function Dt(t, n) {
|
|
18
19
|
const e = Object.keys(t), s = Object.keys(n);
|
|
19
20
|
return e.length !== s.length || JSON.stringify(Object.keys(t.breakpoints || {})) !== JSON.stringify(Object.keys(n.breakpoints || {})) ? !1 : e.every((i) => {
|
|
20
21
|
const o = t[i], r = n[i];
|
|
21
|
-
return typeof o == "function" ? `${o}` == `${r}` :
|
|
22
|
+
return typeof o == "function" ? `${o}` == `${r}` : !$t(o) || !$t(r) ? o === r : Dt(o, r);
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
function Kt(t) {
|
|
25
26
|
return t.concat().sort((n, e) => n.name > e.name ? 1 : -1).map((n) => n.options);
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function Sn(t, n) {
|
|
28
29
|
if (t.length !== n.length) return !1;
|
|
29
30
|
const e = Kt(t), s = Kt(n);
|
|
30
31
|
return e.every((i, o) => {
|
|
@@ -53,10 +54,10 @@ function Nt(t) {
|
|
|
53
54
|
function lt(t, n) {
|
|
54
55
|
return A(t - n);
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function yn(t, n) {
|
|
57
58
|
return t === 0 || n === 0 || A(t) <= A(n) ? 0 : A(lt(A(t), A(n)) / t);
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function bn(t) {
|
|
60
61
|
return Math.round(t * 100) / 100;
|
|
61
62
|
}
|
|
62
63
|
function ft(t) {
|
|
@@ -77,16 +78,16 @@ function Qt(t, n = 0) {
|
|
|
77
78
|
function dt(t) {
|
|
78
79
|
return Object.keys(t);
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function _t(t, n) {
|
|
81
82
|
return [t, n].reduce((e, s) => (dt(s).forEach((i) => {
|
|
82
83
|
const o = e[i], r = s[i];
|
|
83
|
-
e[i] = Ut(o) && Ut(r) ?
|
|
84
|
+
e[i] = Ut(o) && Ut(r) ? _t(o, r) : r;
|
|
84
85
|
}), e), {});
|
|
85
86
|
}
|
|
86
87
|
function At(t, n) {
|
|
87
88
|
return typeof n.MouseEvent < "u" && t instanceof n.MouseEvent;
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
+
function xn(t, n) {
|
|
90
91
|
const e = {
|
|
91
92
|
start: s,
|
|
92
93
|
center: i,
|
|
@@ -127,7 +128,7 @@ function pt() {
|
|
|
127
128
|
};
|
|
128
129
|
return s;
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
+
function vn(t, n, e, s) {
|
|
131
132
|
const i = pt(), o = 1e3 / 60;
|
|
132
133
|
let r = null, u = 0, c = 0;
|
|
133
134
|
function l() {
|
|
@@ -164,7 +165,7 @@ function xn(t, n, e, s) {
|
|
|
164
165
|
render: s
|
|
165
166
|
};
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function En(t, n) {
|
|
168
169
|
const e = n === "rtl", s = t === "y", i = s ? "y" : "x", o = s ? "x" : "y", r = !s && e ? -1 : 1, u = f(), c = m();
|
|
169
170
|
function l(p) {
|
|
170
171
|
const { height: d, width: h } = p;
|
|
@@ -216,7 +217,7 @@ function tt(t = 0, n = 0) {
|
|
|
216
217
|
removeOffset: u
|
|
217
218
|
};
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
+
function Zt(t, n, e) {
|
|
220
221
|
const { constrain: s } = tt(0, t), i = t + 1;
|
|
221
222
|
let o = r(n);
|
|
222
223
|
function r(g) {
|
|
@@ -232,7 +233,7 @@ function _t(t, n, e) {
|
|
|
232
233
|
return f().set(u() + g);
|
|
233
234
|
}
|
|
234
235
|
function f() {
|
|
235
|
-
return
|
|
236
|
+
return Zt(t, u(), e);
|
|
236
237
|
}
|
|
237
238
|
const m = {
|
|
238
239
|
get: u,
|
|
@@ -242,7 +243,7 @@ function _t(t, n, e) {
|
|
|
242
243
|
};
|
|
243
244
|
return m;
|
|
244
245
|
}
|
|
245
|
-
function
|
|
246
|
+
function Ln(t, n, e, s, i, o, r, u, c, l, f, m, g, p, d, h, S, a, b) {
|
|
246
247
|
const { cross: I, direction: P } = t, T = [
|
|
247
248
|
"INPUT",
|
|
248
249
|
"SELECT",
|
|
@@ -254,7 +255,7 @@ function En(t, n, e, s, i, o, r, u, c, l, f, m, g, p, d, h, S, a, b) {
|
|
|
254
255
|
mouse: 500,
|
|
255
256
|
touch: 600
|
|
256
257
|
}, k = d ? 43 : 25;
|
|
257
|
-
let V = !1, B = 0, Y = 0, _ = !1, G = !1, J = !1,
|
|
258
|
+
let V = !1, B = 0, Y = 0, _ = !1, G = !1, J = !1, q = !1;
|
|
258
259
|
function Z(y) {
|
|
259
260
|
if (!b) return;
|
|
260
261
|
function E(w) {
|
|
@@ -265,11 +266,11 @@ function En(t, n, e, s, i, o, r, u, c, l, f, m, g, p, d, h, S, a, b) {
|
|
|
265
266
|
}, x).add(L, "touchend", () => {
|
|
266
267
|
}).add(L, "touchstart", E).add(L, "mousedown", E).add(L, "touchcancel", M).add(L, "contextmenu", M).add(L, "click", et, !0);
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
+
function $() {
|
|
269
270
|
C.clear(), v.clear();
|
|
270
271
|
}
|
|
271
272
|
function nt() {
|
|
272
|
-
const y =
|
|
273
|
+
const y = q ? e : n;
|
|
273
274
|
v.add(y, "touchmove", R, x).add(y, "touchend", M).add(y, "mousemove", R, x).add(y, "mouseup", M);
|
|
274
275
|
}
|
|
275
276
|
function K(y) {
|
|
@@ -277,7 +278,7 @@ function En(t, n, e, s, i, o, r, u, c, l, f, m, g, p, d, h, S, a, b) {
|
|
|
277
278
|
return T.includes(E);
|
|
278
279
|
}
|
|
279
280
|
function it() {
|
|
280
|
-
return (d ? O : N)[
|
|
281
|
+
return (d ? O : N)[q ? "mouse" : "touch"];
|
|
281
282
|
}
|
|
282
283
|
function st(y, E) {
|
|
283
284
|
const L = m.add(Nt(y) * -1), w = f.byDistance(y, !d).distance;
|
|
@@ -285,19 +286,19 @@ function En(t, n, e, s, i, o, r, u, c, l, f, m, g, p, d, h, S, a, b) {
|
|
|
285
286
|
}
|
|
286
287
|
function F(y) {
|
|
287
288
|
const E = At(y, s);
|
|
288
|
-
|
|
289
|
+
q = E, J = d && E && !y.buttons && V, V = lt(i.get(), r.get()) >= 2, !(E && y.button !== 0) && (K(y.target) || (_ = !0, o.pointerDown(y), l.useFriction(0).useDuration(0), i.set(r), nt(), B = o.readPoint(y), Y = o.readPoint(y, I), g.emit("pointerDown")));
|
|
289
290
|
}
|
|
290
291
|
function R(y) {
|
|
291
292
|
if (!At(y, s) && y.touches.length >= 2) return M(y);
|
|
292
293
|
const E = o.readPoint(y), L = o.readPoint(y, I), w = lt(E, B), U = lt(L, Y);
|
|
293
|
-
if (!G &&
|
|
294
|
+
if (!G && !q && (!y.cancelable || (G = w > U, !G)))
|
|
294
295
|
return M(y);
|
|
295
296
|
const X = o.pointerMove(y);
|
|
296
297
|
w > h && (J = !0), l.useFriction(0.3).useDuration(0.75), u.start(), i.add(P(X)), y.preventDefault();
|
|
297
298
|
}
|
|
298
299
|
function M(y) {
|
|
299
|
-
const E = f.byDistance(0, !1).index !== m.get(), L = o.pointerUp(y) * it(), w = st(P(L), E), U =
|
|
300
|
-
G = !1, _ = !1, v.clear(), l.useDuration(X).useFriction(ct), c.distance(w, !d),
|
|
300
|
+
const E = f.byDistance(0, !1).index !== m.get(), L = o.pointerUp(y) * it(), w = st(P(L), E), U = yn(L, w), X = k - 10 * U, ct = a + U / 50;
|
|
301
|
+
G = !1, _ = !1, v.clear(), l.useDuration(X).useFriction(ct), c.distance(w, !d), q = !1, g.emit("pointerUp");
|
|
301
302
|
}
|
|
302
303
|
function et(y) {
|
|
303
304
|
J && (y.stopPropagation(), y.preventDefault(), J = !1);
|
|
@@ -307,11 +308,11 @@ function En(t, n, e, s, i, o, r, u, c, l, f, m, g, p, d, h, S, a, b) {
|
|
|
307
308
|
}
|
|
308
309
|
return {
|
|
309
310
|
init: Z,
|
|
310
|
-
destroy:
|
|
311
|
+
destroy: $,
|
|
311
312
|
pointerDown: z
|
|
312
313
|
};
|
|
313
314
|
}
|
|
314
|
-
function
|
|
315
|
+
function In(t, n) {
|
|
315
316
|
let s, i;
|
|
316
317
|
function o(f) {
|
|
317
318
|
return f.timeStamp;
|
|
@@ -339,7 +340,7 @@ function Ln(t, n) {
|
|
|
339
340
|
readPoint: r
|
|
340
341
|
};
|
|
341
342
|
}
|
|
342
|
-
function
|
|
343
|
+
function Cn() {
|
|
343
344
|
function t(n) {
|
|
344
345
|
const { offsetTop: e, offsetLeft: s, offsetWidth: i, offsetHeight: o } = n;
|
|
345
346
|
return {
|
|
@@ -353,13 +354,13 @@ function In() {
|
|
|
353
354
|
}
|
|
354
355
|
return { measure: t };
|
|
355
356
|
}
|
|
356
|
-
function
|
|
357
|
+
function Pn(t) {
|
|
357
358
|
function n(e) {
|
|
358
359
|
return t * (e / 100);
|
|
359
360
|
}
|
|
360
361
|
return { measure: n };
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
+
function An(t, n, e, s, i, o, r) {
|
|
363
364
|
const u = [t].concat(s);
|
|
364
365
|
let c, l, f = [], m = !1;
|
|
365
366
|
function g(h) {
|
|
@@ -392,7 +393,7 @@ function Pn(t, n, e, s, i, o, r) {
|
|
|
392
393
|
destroy: d
|
|
393
394
|
};
|
|
394
395
|
}
|
|
395
|
-
function
|
|
396
|
+
function Dn(t, n, e, s, i, o) {
|
|
396
397
|
let r = 0, u = 0, c = i, l = o, f = t.get(), m = 0;
|
|
397
398
|
function g() {
|
|
398
399
|
const x = s.get() - t.get(), C = !c;
|
|
@@ -436,7 +437,7 @@ function An(t, n, e, s, i, o) {
|
|
|
436
437
|
};
|
|
437
438
|
return T;
|
|
438
439
|
}
|
|
439
|
-
function
|
|
440
|
+
function Tn(t, n, e, s, i) {
|
|
440
441
|
const o = i.measure(10), r = i.measure(50), u = tt(0.1, 0.99);
|
|
441
442
|
let c = !1;
|
|
442
443
|
function l() {
|
|
@@ -456,7 +457,7 @@ function Dn(t, n, e, s, i) {
|
|
|
456
457
|
toggleActive: m
|
|
457
458
|
};
|
|
458
459
|
}
|
|
459
|
-
function
|
|
460
|
+
function Nn(t, n, e, s, i) {
|
|
460
461
|
const o = tt(-n + t, 0), r = m(), u = f(), c = g();
|
|
461
462
|
function l(p, d) {
|
|
462
463
|
return lt(p, d) <= 1;
|
|
@@ -482,11 +483,11 @@ function Tn(t, n, e, s, i) {
|
|
|
482
483
|
scrollContainLimit: u
|
|
483
484
|
};
|
|
484
485
|
}
|
|
485
|
-
function
|
|
486
|
+
function On(t, n, e) {
|
|
486
487
|
const s = n[0];
|
|
487
488
|
return { limit: tt(e ? s - t : j(n), s) };
|
|
488
489
|
}
|
|
489
|
-
function
|
|
490
|
+
function wn(t, n, e, s) {
|
|
490
491
|
const { reachedMin: o, reachedMax: r } = tt(n.min + 0.1, n.max + 0.1);
|
|
491
492
|
function u(l) {
|
|
492
493
|
return l === 1 ? r(e.get()) : l === -1 ? o(e.get()) : !1;
|
|
@@ -498,7 +499,7 @@ function On(t, n, e, s) {
|
|
|
498
499
|
}
|
|
499
500
|
return { loop: c };
|
|
500
501
|
}
|
|
501
|
-
function
|
|
502
|
+
function Mn(t) {
|
|
502
503
|
const { max: n, length: e } = t;
|
|
503
504
|
function s(i) {
|
|
504
505
|
const o = i - n;
|
|
@@ -506,7 +507,7 @@ function wn(t) {
|
|
|
506
507
|
}
|
|
507
508
|
return { get: s };
|
|
508
509
|
}
|
|
509
|
-
function
|
|
510
|
+
function kn(t, n, e, s, i) {
|
|
510
511
|
const { startEdge: o, endEdge: r } = t, { groupSlides: u } = i, c = m().map(n.measure), l = g(), f = p();
|
|
511
512
|
function m() {
|
|
512
513
|
return u(s).map((d) => j(d)[r] - d[0][o]).map(A);
|
|
@@ -522,7 +523,7 @@ function Mn(t, n, e, s, i) {
|
|
|
522
523
|
snapsAligned: f
|
|
523
524
|
};
|
|
524
525
|
}
|
|
525
|
-
function
|
|
526
|
+
function Fn(t, n, e, s, i, o) {
|
|
526
527
|
const { groupSlides: r } = i, { min: u, max: c } = s, l = f();
|
|
527
528
|
function f() {
|
|
528
529
|
const m = r(o), g = !t || n === "keepSnaps";
|
|
@@ -533,7 +534,7 @@ function kn(t, n, e, s, i, o) {
|
|
|
533
534
|
}
|
|
534
535
|
return { slideRegistry: l };
|
|
535
536
|
}
|
|
536
|
-
function
|
|
537
|
+
function zn(t, n, e, s, i) {
|
|
537
538
|
const { reachedAny: o, removeOffset: r, constrain: u } = s;
|
|
538
539
|
function c(p) {
|
|
539
540
|
return p.concat().sort((d, h) => A(d) - A(h))[0];
|
|
@@ -581,7 +582,7 @@ function Fn(t, n, e, s, i) {
|
|
|
581
582
|
shortcut: f
|
|
582
583
|
};
|
|
583
584
|
}
|
|
584
|
-
function
|
|
585
|
+
function Bn(t, n, e, s, i, o, r) {
|
|
585
586
|
function u(f) {
|
|
586
587
|
const m = f.distance, g = f.index !== n.get();
|
|
587
588
|
o.add(m), m && (s.duration() ? t.start() : (t.update(), t.render(1), t.update())), g && (e.set(n.get()), n.set(f.index), r.emit("select"));
|
|
@@ -598,7 +599,7 @@ function zn(t, n, e, s, i, o, r) {
|
|
|
598
599
|
index: l
|
|
599
600
|
};
|
|
600
601
|
}
|
|
601
|
-
function
|
|
602
|
+
function jn(t, n, e, s, i, o, r, u) {
|
|
602
603
|
const c = {
|
|
603
604
|
passive: !0,
|
|
604
605
|
capture: !0
|
|
@@ -647,7 +648,7 @@ function at(t) {
|
|
|
647
648
|
subtract: o
|
|
648
649
|
};
|
|
649
650
|
}
|
|
650
|
-
function
|
|
651
|
+
function Wt(t, n) {
|
|
651
652
|
const e = t.scroll === "x" ? r : u, s = n.style;
|
|
652
653
|
let i = null, o = !1;
|
|
653
654
|
function r(m) {
|
|
@@ -658,7 +659,7 @@ function Zt(t, n) {
|
|
|
658
659
|
}
|
|
659
660
|
function c(m) {
|
|
660
661
|
if (o) return;
|
|
661
|
-
const g =
|
|
662
|
+
const g = bn(t.direction(m));
|
|
662
663
|
g !== i && (s.transform = e(g), i = g);
|
|
663
664
|
}
|
|
664
665
|
function l(m) {
|
|
@@ -673,7 +674,7 @@ function Zt(t, n) {
|
|
|
673
674
|
toggleActive: l
|
|
674
675
|
};
|
|
675
676
|
}
|
|
676
|
-
function
|
|
677
|
+
function Vn(t, n, e, s, i, o, r, u, c) {
|
|
677
678
|
const f = ft(i), m = ft(i).reverse(), g = a().concat(b());
|
|
678
679
|
function p(x, C) {
|
|
679
680
|
return x.reduce((v, D) => v - i[D], C);
|
|
@@ -695,7 +696,7 @@ function jn(t, n, e, s, i, o, r, u, c) {
|
|
|
695
696
|
index: N,
|
|
696
697
|
loopPoint: B,
|
|
697
698
|
slideLocation: at(-1),
|
|
698
|
-
translate:
|
|
699
|
+
translate: Wt(t, c[N]),
|
|
699
700
|
target: () => u.get() > B ? O : k
|
|
700
701
|
};
|
|
701
702
|
});
|
|
@@ -726,7 +727,7 @@ function jn(t, n, e, s, i, o, r, u, c) {
|
|
|
726
727
|
loopPoints: g
|
|
727
728
|
};
|
|
728
729
|
}
|
|
729
|
-
function
|
|
730
|
+
function Rn(t, n, e) {
|
|
730
731
|
let s, i = !1;
|
|
731
732
|
function o(u) {
|
|
732
733
|
if (!e) return;
|
|
@@ -748,7 +749,7 @@ function Vn(t, n, e) {
|
|
|
748
749
|
destroy: r
|
|
749
750
|
};
|
|
750
751
|
}
|
|
751
|
-
function
|
|
752
|
+
function Hn(t, n, e, s) {
|
|
752
753
|
const i = {};
|
|
753
754
|
let o = null, r = null, u, c = !1;
|
|
754
755
|
function l() {
|
|
@@ -783,7 +784,7 @@ function Rn(t, n, e, s) {
|
|
|
783
784
|
get: g
|
|
784
785
|
};
|
|
785
786
|
}
|
|
786
|
-
function
|
|
787
|
+
function Gn(t, n, e, s, i, o) {
|
|
787
788
|
const { measureSize: r, startEdge: u, endEdge: c } = t, l = e[0] && i, f = d(), m = h(), g = e.map(r), p = S();
|
|
788
789
|
function d() {
|
|
789
790
|
if (!l) return 0;
|
|
@@ -808,7 +809,7 @@ function Hn(t, n, e, s, i, o) {
|
|
|
808
809
|
endGap: m
|
|
809
810
|
};
|
|
810
811
|
}
|
|
811
|
-
function
|
|
812
|
+
function qn(t, n, e, s, i, o, r, u, c) {
|
|
812
813
|
const { startEdge: l, endEdge: f, direction: m } = t, g = Tt(e);
|
|
813
814
|
function p(S, a) {
|
|
814
815
|
return ft(S).filter((b) => b % a === 0).map((b) => S.slice(b, b + a));
|
|
@@ -828,14 +829,14 @@ function Gn(t, n, e, s, i, o, r, u, c) {
|
|
|
828
829
|
return { groupSlides: h };
|
|
829
830
|
}
|
|
830
831
|
function $n(t, n, e, s, i, o, r) {
|
|
831
|
-
const { align: u, axis: c, direction: l, startIndex: f, loop: m, duration: g, dragFree: p, dragThreshold: d, inViewThreshold: h, slidesToScroll: S, skipSnaps: a, containScroll: b, watchResize: I, watchSlides: P, watchDrag: T, watchFocus: x } = o, C = 2, v =
|
|
832
|
+
const { align: u, axis: c, direction: l, startIndex: f, loop: m, duration: g, dragFree: p, dragThreshold: d, inViewThreshold: h, slidesToScroll: S, skipSnaps: a, containScroll: b, watchResize: I, watchSlides: P, watchDrag: T, watchFocus: x } = o, C = 2, v = Cn(), D = v.measure(n), N = e.map(v.measure), O = En(c, l), k = O.measureSize(D), V = Pn(k), B = xn(u, k), Y = !m && !!b, { slideSizes: _, slideSizesWithGaps: G, startGap: J, endGap: q } = Gn(O, D, N, e, m || !!b, i), Z = qn(O, k, S, m, D, N, J, q, C), { snaps: $, snapsAligned: nt } = kn(O, B, D, N, Z), K = -j($) + j(G), { snapsContained: it, scrollContainLimit: st } = Nn(k, K, nt, b, C), F = Y ? it : nt, { limit: R } = On(K, F, m), M = Zt(gt(F), f, m), et = M.clone(), z = ft(e), y = ({ dragHandler: ot, scrollBody: Lt, scrollBounds: It, options: { loop: ht } }) => {
|
|
832
833
|
ht || It.constrain(ot.pointerDown()), Lt.seek();
|
|
833
|
-
}, E = ({ scrollBody: ot, translate: Lt, location: It, offsetLocation: ht, previousLocation:
|
|
834
|
-
const Vt = ot.settled(),
|
|
835
|
-
Ht &&
|
|
836
|
-
const
|
|
837
|
-
ht.set(
|
|
838
|
-
}, L =
|
|
834
|
+
}, E = ({ scrollBody: ot, translate: Lt, location: It, offsetLocation: ht, previousLocation: rn, scrollLooper: on, slideLooper: sn, dragHandler: cn, animation: un, eventHandler: zt, scrollBounds: an, options: { loop: Bt } }, jt) => {
|
|
835
|
+
const Vt = ot.settled(), ln = !an.shouldConstrain(), Rt = Bt ? Vt : Vt && ln, Ht = Rt && !cn.pointerDown();
|
|
836
|
+
Ht && un.stop();
|
|
837
|
+
const fn = It.get() * jt + rn.get() * (1 - jt);
|
|
838
|
+
ht.set(fn), Bt && (on.loop(ot.direction()), sn.loop()), Lt.to(ht.get()), Ht && zt.emit("settle"), Rt || zt.emit("scroll");
|
|
839
|
+
}, L = vn(s, i, () => y(Et), (ot) => E(Et, ot)), w = 0.68, U = F[M.get()], X = at(U), ct = at(U), rt = at(U), W = at(U), ut = Dn(X, rt, ct, W, g, w), xt = zn(m, F, K, R, W), vt = Bn(L, M, et, ut, xt, W, r), Mt = Mn(R), kt = pt(), nn = Hn(n, e, r, h), { slideRegistry: Ft } = Fn(Y, b, F, st, Z, z), en = jn(t, e, Ft, vt, ut, kt, r, x), Et = {
|
|
839
840
|
ownerDocument: s,
|
|
840
841
|
ownerWindow: i,
|
|
841
842
|
eventHandler: r,
|
|
@@ -843,7 +844,7 @@ function $n(t, n, e, s, i, o, r) {
|
|
|
843
844
|
slideRects: N,
|
|
844
845
|
animation: L,
|
|
845
846
|
axis: O,
|
|
846
|
-
dragHandler:
|
|
847
|
+
dragHandler: Ln(O, t, s, i, W, In(O, i), X, L, vt, ut, xt, M, r, V, p, d, a, w, T),
|
|
847
848
|
eventStore: kt,
|
|
848
849
|
percentOfView: V,
|
|
849
850
|
index: M,
|
|
@@ -853,10 +854,10 @@ function $n(t, n, e, s, i, o, r) {
|
|
|
853
854
|
offsetLocation: rt,
|
|
854
855
|
previousLocation: ct,
|
|
855
856
|
options: o,
|
|
856
|
-
resizeHandler:
|
|
857
|
+
resizeHandler: An(n, r, i, e, O, I, v),
|
|
857
858
|
scrollBody: ut,
|
|
858
|
-
scrollBounds:
|
|
859
|
-
scrollLooper:
|
|
859
|
+
scrollBounds: Tn(R, rt, W, ut, V),
|
|
860
|
+
scrollLooper: wn(K, R, rt, [
|
|
860
861
|
X,
|
|
861
862
|
rt,
|
|
862
863
|
ct,
|
|
@@ -867,19 +868,19 @@ function $n(t, n, e, s, i, o, r) {
|
|
|
867
868
|
scrollSnaps: F,
|
|
868
869
|
scrollTarget: xt,
|
|
869
870
|
scrollTo: vt,
|
|
870
|
-
slideLooper:
|
|
871
|
-
slideFocus:
|
|
872
|
-
slidesHandler:
|
|
873
|
-
slidesInView:
|
|
871
|
+
slideLooper: Vn(O, k, K, _, G, $, F, rt, e),
|
|
872
|
+
slideFocus: en,
|
|
873
|
+
slidesHandler: Rn(n, r, P),
|
|
874
|
+
slidesInView: nn,
|
|
874
875
|
slideIndexes: z,
|
|
875
876
|
slideRegistry: Ft,
|
|
876
877
|
slidesToScroll: Z,
|
|
877
878
|
target: W,
|
|
878
|
-
translate:
|
|
879
|
+
translate: Wt(O, n)
|
|
879
880
|
};
|
|
880
881
|
return Et;
|
|
881
882
|
}
|
|
882
|
-
function
|
|
883
|
+
function Kn() {
|
|
883
884
|
let t = {}, n;
|
|
884
885
|
function e(l) {
|
|
885
886
|
n = l;
|
|
@@ -908,7 +909,7 @@ function qn() {
|
|
|
908
909
|
};
|
|
909
910
|
return c;
|
|
910
911
|
}
|
|
911
|
-
var
|
|
912
|
+
var Un = {
|
|
912
913
|
align: "center",
|
|
913
914
|
axis: "x",
|
|
914
915
|
container: null,
|
|
@@ -930,9 +931,9 @@ var Kn = {
|
|
|
930
931
|
watchSlides: !0,
|
|
931
932
|
watchFocus: !0
|
|
932
933
|
};
|
|
933
|
-
function
|
|
934
|
+
function Qn(t) {
|
|
934
935
|
function n(i, o) {
|
|
935
|
-
return
|
|
936
|
+
return _t(i, o || {});
|
|
936
937
|
}
|
|
937
938
|
function e(i) {
|
|
938
939
|
const o = i.breakpoints || {};
|
|
@@ -947,7 +948,7 @@ function Un(t) {
|
|
|
947
948
|
optionsMediaQueries: s
|
|
948
949
|
};
|
|
949
950
|
}
|
|
950
|
-
function
|
|
951
|
+
function Jn(t) {
|
|
951
952
|
let n = [];
|
|
952
953
|
function e(i, o) {
|
|
953
954
|
return n = o.filter(({ options: r }) => t.optionsAtMedia(r).active !== !1), n.forEach((r) => r.init(i, t)), o.reduce((r, u) => Object.assign(r, { [u.name]: u }), {});
|
|
@@ -961,8 +962,8 @@ function Qn(t) {
|
|
|
961
962
|
};
|
|
962
963
|
}
|
|
963
964
|
function St(t, n, e) {
|
|
964
|
-
const s = t.ownerDocument, i = s.defaultView, o =
|
|
965
|
-
let S = !1, a, b = l(
|
|
965
|
+
const s = t.ownerDocument, i = s.defaultView, o = Qn(i), r = Jn(o), u = pt(), c = Kn(), { mergeOptions: l, optionsAtMedia: f, optionsMediaQueries: m } = o, { on: g, off: p, emit: d } = c, h = O;
|
|
966
|
+
let S = !1, a, b = l(Un, St.globalOptions), I = l(b), P = [], T, x, C;
|
|
966
967
|
function v() {
|
|
967
968
|
const { container: y, slides: E } = I;
|
|
968
969
|
x = (Pt(y) ? t.querySelector(y) : y) || t.children[0];
|
|
@@ -977,7 +978,7 @@ function St(t, n, e) {
|
|
|
977
978
|
S || (b = l(b, y), I = f(b), P = E || P, v(), a = D(I), m([b, ...P.map(({ options: L }) => L)]).forEach((L) => u.add(L, "change", O)), I.active && (a.translate.to(a.location.get()), a.animation.init(), a.slidesInView.init(), a.slideFocus.init(z), a.eventHandler.init(z), a.resizeHandler.init(z), a.slidesHandler.init(z), a.options.loop && a.slideLooper.loop(), x.offsetParent && C.length && a.dragHandler.init(z), T = r.init(z, P)));
|
|
978
979
|
}
|
|
979
980
|
function O(y, E) {
|
|
980
|
-
const L =
|
|
981
|
+
const L = $();
|
|
981
982
|
k(), N(l({ startIndex: L }, y), E), c.emit("reInit");
|
|
982
983
|
}
|
|
983
984
|
function k() {
|
|
@@ -996,18 +997,18 @@ function St(t, n, e) {
|
|
|
996
997
|
B(a.index.add(-1).get(), y, 1);
|
|
997
998
|
}
|
|
998
999
|
function G() {
|
|
999
|
-
return a.index.add(1).get() !==
|
|
1000
|
+
return a.index.add(1).get() !== $();
|
|
1000
1001
|
}
|
|
1001
1002
|
function J() {
|
|
1002
|
-
return a.index.add(-1).get() !==
|
|
1003
|
+
return a.index.add(-1).get() !== $();
|
|
1003
1004
|
}
|
|
1004
|
-
function
|
|
1005
|
+
function q() {
|
|
1005
1006
|
return a.scrollSnapList;
|
|
1006
1007
|
}
|
|
1007
1008
|
function Z() {
|
|
1008
1009
|
return a.scrollProgress.get(a.offsetLocation.get());
|
|
1009
1010
|
}
|
|
1010
|
-
function
|
|
1011
|
+
function $() {
|
|
1011
1012
|
return a.index.get();
|
|
1012
1013
|
}
|
|
1013
1014
|
function nt() {
|
|
@@ -1050,9 +1051,9 @@ function St(t, n, e) {
|
|
|
1050
1051
|
scrollNext: Y,
|
|
1051
1052
|
scrollPrev: _,
|
|
1052
1053
|
scrollProgress: Z,
|
|
1053
|
-
scrollSnapList:
|
|
1054
|
+
scrollSnapList: q,
|
|
1054
1055
|
scrollTo: B,
|
|
1055
|
-
selectedScrollSnap:
|
|
1056
|
+
selectedScrollSnap: $,
|
|
1056
1057
|
slideNodes: et,
|
|
1057
1058
|
slidesInView: K,
|
|
1058
1059
|
slidesNotInView: it
|
|
@@ -1061,15 +1062,15 @@ function St(t, n, e) {
|
|
|
1061
1062
|
}
|
|
1062
1063
|
St.globalOptions = void 0;
|
|
1063
1064
|
function wt(t = {}, n = []) {
|
|
1064
|
-
const e = Gt(t), s = Gt(n), [i, o] =
|
|
1065
|
+
const e = Gt(t), s = Gt(n), [i, o] = qt(), [r, u] = qt(), c = mn(() => {
|
|
1065
1066
|
i && i.reInit(e.current, s.current);
|
|
1066
1067
|
}, [i]);
|
|
1067
1068
|
return Ct(() => {
|
|
1068
1069
|
Dt(e.current, t) || (e.current = t, c());
|
|
1069
1070
|
}, [t, c]), Ct(() => {
|
|
1070
|
-
|
|
1071
|
+
Sn(s.current, n) || (s.current = n, c());
|
|
1071
1072
|
}, [n, c]), Ct(() => {
|
|
1072
|
-
if (
|
|
1073
|
+
if (hn() && r) {
|
|
1073
1074
|
St.globalOptions = wt.globalOptions;
|
|
1074
1075
|
const l = St(r, e.current, s.current);
|
|
1075
1076
|
return o(l), () => l.destroy();
|
|
@@ -1077,13 +1078,13 @@ function wt(t = {}, n = []) {
|
|
|
1077
1078
|
}, [r, o]), [u, i];
|
|
1078
1079
|
}
|
|
1079
1080
|
wt.globalOptions = void 0;
|
|
1080
|
-
var
|
|
1081
|
+
var tn = H.createContext(null);
|
|
1081
1082
|
function bt() {
|
|
1082
|
-
const t = H.useContext(
|
|
1083
|
+
const t = H.useContext(tn);
|
|
1083
1084
|
if (!t) throw new Error("useCarousel must be used within a <Carousel />");
|
|
1084
1085
|
return t;
|
|
1085
1086
|
}
|
|
1086
|
-
function
|
|
1087
|
+
function ne({ orientation: t = "horizontal", opts: n, setApi: e, plugins: s, className: i, children: o, ...r }) {
|
|
1087
1088
|
const [u, c] = wt({
|
|
1088
1089
|
...n,
|
|
1089
1090
|
axis: t === "horizontal" ? "x" : "y"
|
|
@@ -1103,7 +1104,7 @@ function Wn({ orientation: t = "horizontal", opts: n, setApi: e, plugins: s, cla
|
|
|
1103
1104
|
return p(c), c.on("reInit", p), c.on("select", p), () => {
|
|
1104
1105
|
c?.off("select", p);
|
|
1105
1106
|
};
|
|
1106
|
-
}, [c, p]), /* @__PURE__ */ Q(
|
|
1107
|
+
}, [c, p]), /* @__PURE__ */ Q(tn.Provider, {
|
|
1107
1108
|
value: {
|
|
1108
1109
|
carouselRef: u,
|
|
1109
1110
|
api: c,
|
|
@@ -1125,7 +1126,7 @@ function Wn({ orientation: t = "horizontal", opts: n, setApi: e, plugins: s, cla
|
|
|
1125
1126
|
})
|
|
1126
1127
|
});
|
|
1127
1128
|
}
|
|
1128
|
-
function
|
|
1129
|
+
function ee({ className: t, ...n }) {
|
|
1129
1130
|
const { carouselRef: e, orientation: s } = bt();
|
|
1130
1131
|
return /* @__PURE__ */ Q("div", {
|
|
1131
1132
|
ref: e,
|
|
@@ -1137,7 +1138,7 @@ function te({ className: t, ...n }) {
|
|
|
1137
1138
|
})
|
|
1138
1139
|
});
|
|
1139
1140
|
}
|
|
1140
|
-
function
|
|
1141
|
+
function re({ className: t, ...n }) {
|
|
1141
1142
|
const { orientation: e } = bt();
|
|
1142
1143
|
return /* @__PURE__ */ Q("div", {
|
|
1143
1144
|
role: "group",
|
|
@@ -1147,7 +1148,7 @@ function ne({ className: t, ...n }) {
|
|
|
1147
1148
|
...n
|
|
1148
1149
|
});
|
|
1149
1150
|
}
|
|
1150
|
-
function
|
|
1151
|
+
function oe({ className: t, variant: n = "outline", size: e = "icon-sm", ...s }) {
|
|
1151
1152
|
const { orientation: i, scrollPrev: o, canScrollPrev: r } = bt();
|
|
1152
1153
|
return /* @__PURE__ */ Xt(Jt, {
|
|
1153
1154
|
"data-slot": "carousel-previous",
|
|
@@ -1157,13 +1158,16 @@ function ee({ className: t, variant: n = "outline", size: e = "icon-sm", ...s })
|
|
|
1157
1158
|
disabled: !r,
|
|
1158
1159
|
onClick: o,
|
|
1159
1160
|
...s,
|
|
1160
|
-
children: [/* @__PURE__ */ Q(
|
|
1161
|
+
children: [/* @__PURE__ */ Q(Yt, {
|
|
1162
|
+
icon: dn,
|
|
1163
|
+
className: "rtl:rotate-180"
|
|
1164
|
+
}), /* @__PURE__ */ Q("span", {
|
|
1161
1165
|
className: "sr-only",
|
|
1162
1166
|
children: "Previous slide"
|
|
1163
1167
|
})]
|
|
1164
1168
|
});
|
|
1165
1169
|
}
|
|
1166
|
-
function
|
|
1170
|
+
function ie({ className: t, variant: n = "outline", size: e = "icon-sm", ...s }) {
|
|
1167
1171
|
const { orientation: i, scrollNext: o, canScrollNext: r } = bt();
|
|
1168
1172
|
return /* @__PURE__ */ Xt(Jt, {
|
|
1169
1173
|
"data-slot": "carousel-next",
|
|
@@ -1173,18 +1177,21 @@ function re({ className: t, variant: n = "outline", size: e = "icon-sm", ...s })
|
|
|
1173
1177
|
disabled: !r,
|
|
1174
1178
|
onClick: o,
|
|
1175
1179
|
...s,
|
|
1176
|
-
children: [/* @__PURE__ */ Q(
|
|
1180
|
+
children: [/* @__PURE__ */ Q(Yt, {
|
|
1181
|
+
icon: pn,
|
|
1182
|
+
className: "rtl:rotate-180"
|
|
1183
|
+
}), /* @__PURE__ */ Q("span", {
|
|
1177
1184
|
className: "sr-only",
|
|
1178
1185
|
children: "Next slide"
|
|
1179
1186
|
})]
|
|
1180
1187
|
});
|
|
1181
1188
|
}
|
|
1182
1189
|
export {
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1190
|
+
ne as Carousel,
|
|
1191
|
+
ee as CarouselContent,
|
|
1192
|
+
re as CarouselItem,
|
|
1193
|
+
ie as CarouselNext,
|
|
1194
|
+
oe as CarouselPrevious,
|
|
1188
1195
|
bt as useCarousel
|
|
1189
1196
|
};
|
|
1190
1197
|
|