quirk-ui 0.0.44 → 0.0.45
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/assets/index31.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
._carousel_okw4o_1{width:100%}._trackContainer_okw4o_5{overflow:hidden;width:100%}._track_okw4o_5{display:flex;transition:transform .3s ease;will-change:transform}._page_okw4o_16{display:flex;gap:var(--spacing-md);padding:0 var(--spacing-sm)}._slide_okw4o_22{background-color:red}._controls_okw4o_26{display:flex;justify-content:space-between;align-items:center;margin-top:var(--spacing-md);padding:0 var(--spacing-md);width:100%}@media (max-width: 767px){._controls_okw4o_26{width:var(--card-width);margin-left:auto;margin-right:auto}}._indicators_okw4o_43{display:flex;flex-wrap:wrap;max-width:125px;gap:var(--spacing-sm)}._indicator_okw4o_43{width:10px;height:10px;border-radius:50%;background-color:#e0e0e0;border:none;cursor:pointer;transition:background-color .3s}._indicator_okw4o_43._active_okw4o_60{background-color:var(--color-primary)}._buttons_okw4o_64{display:flex;gap:var(--spacing-md)}._prev_okw4o_69._disabled_okw4o_69,._next_okw4o_70._disabled_okw4o_69{opacity:.5;pointer-events:none}._buttons_okw4o_64 button:not(._disabled_okw4o_69):hover{background-color:var(--color-primary);color:#fff}._prev_okw4o_69,._next_okw4o_70{background-color:#e0e0e0;color:var(--color-text-primary);border:none;padding:var(--spacing-sm);cursor:pointer;transition:background-color .3s,color .3s;border-radius:50%;width:40px;height:40px;display:flex;justify-content:center;align-items:center}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { jsxs as t, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
3
|
-
import { Carousel as
|
|
2
|
+
import { d as a, a as i, i as o, r as n, g as l, s as c } from "../../vi.ClIskdbk-CZ8iFAMK.js";
|
|
3
|
+
import { Carousel as d } from "./index.js";
|
|
4
4
|
import "../../index-BBIdMcpm.js";
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
a("Carousel", () => {
|
|
6
|
+
const r = Array.from({ length: 6 }, (m, e) => /* @__PURE__ */ t("div", { "data-testid": "carousel-item", children: [
|
|
7
|
+
"Item ",
|
|
8
|
+
e + 1
|
|
9
|
+
] }, e));
|
|
10
10
|
beforeEach(() => {
|
|
11
11
|
Object.defineProperty(window, "innerWidth", {
|
|
12
12
|
writable: !0,
|
|
13
13
|
configurable: !0,
|
|
14
14
|
value: 1024
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
}), i(() => {
|
|
16
|
+
window.dispatchEvent(new Event("resize"));
|
|
17
|
+
}), global.ResizeObserver = class {
|
|
18
|
+
observe() {
|
|
19
|
+
}
|
|
20
|
+
unobserve() {
|
|
21
|
+
}
|
|
22
|
+
disconnect() {
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}), o("renders without crashing", () => {
|
|
26
|
+
n(/* @__PURE__ */ s(d, { items: r, itemsPerPage: 3, itemsPerRow: 1 })), l(c.getAllByTestId("carousel-item").length).toBeGreaterThan(0);
|
|
20
27
|
});
|
|
21
28
|
});
|
|
@@ -1,113 +1,130 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { A as
|
|
4
|
-
import { A as
|
|
5
|
-
import '../../assets/index31.css';const L = "
|
|
6
|
-
carousel:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useRef as $, useEffect as k } from "react";
|
|
3
|
+
import { A as T } from "../../arrow-left-BIJvHwNQ.js";
|
|
4
|
+
import { A as W } from "../../arrow-right-QEwnX3Sk.js";
|
|
5
|
+
import '../../assets/index31.css';const E = "_carousel_okw4o_1", L = "_trackContainer_okw4o_5", j = "_track_okw4o_5", X = "_page_okw4o_16", D = "_slide_okw4o_22", G = "_controls_okw4o_26", O = "_indicators_okw4o_43", S = "_indicator_okw4o_43", q = "_active_okw4o_60", B = "_buttons_okw4o_64", F = "_prev_okw4o_69", H = "_disabled_okw4o_69", J = "_next_okw4o_70", t = {
|
|
6
|
+
carousel: E,
|
|
7
|
+
trackContainer: L,
|
|
8
|
+
track: j,
|
|
9
|
+
page: X,
|
|
10
|
+
slide: D,
|
|
11
|
+
controls: G,
|
|
12
|
+
indicators: O,
|
|
13
|
+
indicator: S,
|
|
14
|
+
active: q,
|
|
15
|
+
buttons: B,
|
|
15
16
|
prev: F,
|
|
16
17
|
disabled: H,
|
|
17
18
|
next: J
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
-
items:
|
|
21
|
-
itemsPerPage:
|
|
22
|
-
itemsPerRow:
|
|
20
|
+
function Y({
|
|
21
|
+
items: b,
|
|
22
|
+
itemsPerPage: m = 3,
|
|
23
|
+
itemsPerRow: N = 3,
|
|
23
24
|
autoPlay: r = !1,
|
|
24
|
-
autoPlayInterval:
|
|
25
|
-
className:
|
|
25
|
+
autoPlayInterval: g = 3e3,
|
|
26
|
+
className: C
|
|
26
27
|
}) {
|
|
27
|
-
const [
|
|
28
|
-
const
|
|
29
|
-
for (let
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
|
|
28
|
+
const [c, d] = v(0), [l, R] = v(0), [i, I] = v(m), u = $(null), p = $(null), M = (e, n) => {
|
|
29
|
+
const o = [];
|
|
30
|
+
for (let a = 0; a < e.length; a += n)
|
|
31
|
+
o.push(e.slice(a, a + n));
|
|
32
|
+
return o;
|
|
33
|
+
};
|
|
34
|
+
k(() => {
|
|
34
35
|
const e = () => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
q(s), N(s ? 1 : 3);
|
|
36
|
+
const n = window.innerWidth < 768;
|
|
37
|
+
I(n ? 1 : m);
|
|
38
38
|
};
|
|
39
39
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
40
|
+
}, [m]);
|
|
41
|
+
const _ = Math.ceil(i / N), x = M(b, i), h = x.length;
|
|
42
|
+
k(() => {
|
|
43
|
+
const e = new ResizeObserver((n) => {
|
|
44
|
+
for (let o of n)
|
|
45
|
+
o.contentRect && (R(o.contentRect.width), d(0));
|
|
46
|
+
});
|
|
47
|
+
return u.current && e.observe(u.current), () => e.disconnect();
|
|
40
48
|
}, []);
|
|
41
|
-
const
|
|
42
|
-
(
|
|
43
|
-
},
|
|
44
|
-
(
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}), [r,
|
|
51
|
-
|
|
52
|
-
return /* @__PURE__ */ p("div", { className: `${j ?? ""} ${t.carousel}`, children: [
|
|
53
|
-
/* @__PURE__ */ i(
|
|
49
|
+
const w = () => {
|
|
50
|
+
d((e) => Math.min(e + 1, h - 1));
|
|
51
|
+
}, z = () => {
|
|
52
|
+
d((e) => Math.max(e - 1, 0));
|
|
53
|
+
}, A = (e) => {
|
|
54
|
+
d(e);
|
|
55
|
+
}, y = () => l ? `translateX(-${c * l}px)` : "translateX(0px)";
|
|
56
|
+
return k(() => (r && (p.current = setInterval(w, g)), () => {
|
|
57
|
+
p.current && clearInterval(p.current);
|
|
58
|
+
}), [r, g, w]), /* @__PURE__ */ f("div", { className: `${C ?? ""} ${t.carousel}`, ref: u, children: [
|
|
59
|
+
/* @__PURE__ */ s(
|
|
54
60
|
"div",
|
|
55
61
|
{
|
|
56
|
-
className: t.
|
|
57
|
-
style: {
|
|
58
|
-
|
|
59
|
-
transform: M()
|
|
60
|
-
},
|
|
61
|
-
role: "list",
|
|
62
|
-
children: g.map((e, s) => /* @__PURE__ */ i(
|
|
62
|
+
className: t.trackContainer,
|
|
63
|
+
style: { maxWidth: `${l}px` },
|
|
64
|
+
children: /* @__PURE__ */ s(
|
|
63
65
|
"div",
|
|
64
66
|
{
|
|
65
|
-
className: t.
|
|
66
|
-
style:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
className: t.track,
|
|
68
|
+
style: { width: `${h * 100}%`, transform: y() },
|
|
69
|
+
children: x.map((e, n) => /* @__PURE__ */ s(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: t.page,
|
|
73
|
+
style: {
|
|
74
|
+
display: Math.ceil(i / _) > 1 ? "grid" : "flex",
|
|
75
|
+
gridTemplateColumns: `repeat(${Math.ceil(
|
|
76
|
+
i / _
|
|
77
|
+
)}, 1fr)`,
|
|
78
|
+
gridTemplateRows: `repeat(${_}, auto)`,
|
|
79
|
+
width: `${l}px`
|
|
80
|
+
},
|
|
81
|
+
children: e.map((o, a) => /* @__PURE__ */ s(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
className: t.slide,
|
|
85
|
+
style: {
|
|
86
|
+
width: `${l / Math.ceil(i / _) - 16}px`
|
|
87
|
+
},
|
|
88
|
+
children: o
|
|
89
|
+
},
|
|
90
|
+
a
|
|
91
|
+
))
|
|
92
|
+
},
|
|
93
|
+
n
|
|
94
|
+
))
|
|
95
|
+
}
|
|
96
|
+
)
|
|
80
97
|
}
|
|
81
98
|
),
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ f("div", { className: t.controls, children: [
|
|
100
|
+
/* @__PURE__ */ s("div", { className: t.indicators, children: Array.from({ length: h }).map((e, n) => /* @__PURE__ */ s(
|
|
84
101
|
"button",
|
|
85
102
|
{
|
|
86
|
-
className: `${t.indicator} ${
|
|
87
|
-
onClick: () =>
|
|
88
|
-
"aria-label": `Go to group ${
|
|
103
|
+
className: `${t.indicator} ${n === c ? t.active : ""}`,
|
|
104
|
+
onClick: () => A(n),
|
|
105
|
+
"aria-label": `Go to group ${n + 1}`
|
|
89
106
|
},
|
|
90
|
-
|
|
107
|
+
n
|
|
91
108
|
)) }),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ f("div", { className: t.buttons, children: [
|
|
110
|
+
/* @__PURE__ */ s(
|
|
94
111
|
"button",
|
|
95
112
|
{
|
|
96
|
-
className: `${t.prev} ${!r && n === 0 ? t.disabled : ""}`,
|
|
97
|
-
onClick: C,
|
|
98
113
|
"aria-label": "Previous slide",
|
|
99
|
-
|
|
100
|
-
|
|
114
|
+
className: `${t.prev} ${!r && c === 0 ? t.disabled : ""}`,
|
|
115
|
+
onClick: z,
|
|
116
|
+
disabled: !r && c === 0,
|
|
117
|
+
children: /* @__PURE__ */ s(T, { size: 36 })
|
|
101
118
|
}
|
|
102
119
|
),
|
|
103
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ s(
|
|
104
121
|
"button",
|
|
105
122
|
{
|
|
106
|
-
className: `${t.next} ${!r && n === c - 1 ? t.disabled : ""}`,
|
|
107
|
-
onClick: u,
|
|
108
123
|
"aria-label": "Next slide",
|
|
109
|
-
|
|
110
|
-
|
|
124
|
+
className: `${t.next} ${!r && c >= h - 1 ? t.disabled : ""}`,
|
|
125
|
+
onClick: w,
|
|
126
|
+
disabled: !r && c >= b.length - i,
|
|
127
|
+
children: /* @__PURE__ */ s(W, { size: 36 })
|
|
111
128
|
}
|
|
112
129
|
)
|
|
113
130
|
] })
|
|
@@ -115,5 +132,5 @@ function Z({
|
|
|
115
132
|
] });
|
|
116
133
|
}
|
|
117
134
|
export {
|
|
118
|
-
|
|
135
|
+
Y as Carousel
|
|
119
136
|
};
|
package/dist/styles.css
CHANGED
|
@@ -28,7 +28,7 @@ ul._list_4w9h5_1{list-style-type:none;padding:0;margin:0}ol._list_4w9h5_1{list-s
|
|
|
28
28
|
._notification_1txoc_1{display:flex;align-items:center;padding:var(--spacing-md);background-color:var(--color-secondary);color:var(--color-text-primaray);box-shadow:0 4px 8px #0000001a;border-radius:var(--radius-md);font-size:var(--font-size-md);font-weight:var(--font-weight-semibold);gap:var(--spacing-sm);animation:_slideIn_1txoc_1 .3s ease forwards;opacity:1;transform-origin:right center;width:fit-content}._enter_1txoc_18{opacity:1;transform:translate(0)}._exiting_1txoc_23{animation:_slideOut_1txoc_1 .3s ease forwards}._info_1txoc_27{background-color:var(--color-info-bg);color:var(--color-info-text)}._success_1txoc_32{background-color:var(--color-success-bg);color:var(--color-success-text)}._warning_1txoc_37{background-color:var(--color-warning-bg);color:var(--color-warning-text)}._error_1txoc_42{background-color:var(--color-error-bg);color:var(--color-error-text)}._closeButton_1txoc_47{background:none;border:none;cursor:pointer;color:#fff;padding:0;margin-left:auto;display:flex;align-items:center}@keyframes _slideIn_1txoc_1{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes _slideOut_1txoc_1{0%{transform:translate(0);opacity:1}to{transform:translate(100%);opacity:0}}
|
|
29
29
|
._container_61msx_1{position:fixed;bottom:1rem;right:1rem;display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-end;gap:.5rem;z-index:1000}
|
|
30
30
|
._progressBarContainer_a1m8u_1{display:flex;align-items:center;justify-content:center;gap:.25rem;width:100%}._progressBar_a1m8u_1{flex:1;height:12px;background-color:#f0f0f0;border-radius:4px;overflow:hidden;position:relative}._fill_a1m8u_18{height:100%;transition:width .3s ease;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;border-radius:4px}._primary_a1m8u_29 ._fill_a1m8u_18{background-color:var(--color-primary)}._success_a1m8u_33 ._fill_a1m8u_18{background-color:var(--color-success)}._warning_a1m8u_37 ._fill_a1m8u_18{background-color:var(--color-warning)}._danger_a1m8u_41 ._fill_a1m8u_18{background-color:var(--color-error)}._label_a1m8u_45{flex:.1;position:relative;width:auto;text-align:center;color:var(--color-text-primary);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold)}
|
|
31
|
-
|
|
31
|
+
._carousel_okw4o_1{width:100%}._trackContainer_okw4o_5{overflow:hidden;width:100%}._track_okw4o_5{display:flex;transition:transform .3s ease;will-change:transform}._page_okw4o_16{display:flex;gap:var(--spacing-md);padding:0 var(--spacing-sm)}._slide_okw4o_22{background-color:red}._controls_okw4o_26{display:flex;justify-content:space-between;align-items:center;margin-top:var(--spacing-md);padding:0 var(--spacing-md);width:100%}@media (max-width: 767px){._controls_okw4o_26{width:var(--card-width);margin-left:auto;margin-right:auto}}._indicators_okw4o_43{display:flex;flex-wrap:wrap;max-width:125px;gap:var(--spacing-sm)}._indicator_okw4o_43{width:10px;height:10px;border-radius:50%;background-color:#e0e0e0;border:none;cursor:pointer;transition:background-color .3s}._indicator_okw4o_43._active_okw4o_60{background-color:var(--color-primary)}._buttons_okw4o_64{display:flex;gap:var(--spacing-md)}._prev_okw4o_69._disabled_okw4o_69,._next_okw4o_70._disabled_okw4o_69{opacity:.5;pointer-events:none}._buttons_okw4o_64 button:not(._disabled_okw4o_69):hover{background-color:var(--color-primary);color:#fff}._prev_okw4o_69,._next_okw4o_70{background-color:#e0e0e0;color:var(--color-text-primary);border:none;padding:var(--spacing-sm);cursor:pointer;transition:background-color .3s,color .3s;border-radius:50%;width:40px;height:40px;display:flex;justify-content:center;align-items:center}
|
|
32
32
|
._drawer_55xty_1{position:fixed;background-color:var(--color-background);transition:transform .3s ease-in-out;z-index:1000;width:300px;height:100%;box-shadow:0 0 10px #00000026;padding:var(--spacing-md)}._right_55xty_12{top:0;right:0;transform:translate(100%)}._left_55xty_18{top:0;left:0;transform:translate(-100%)}._top_55xty_24{top:0;left:0;width:100%;height:auto;transform:translateY(-100%)}._bottom_55xty_32{bottom:0;left:0;width:100%;height:auto;transform:translateY(100%)}._open_55xty_40._right_55xty_12,._open_55xty_40._left_55xty_18{transform:translate(0)}._open_55xty_40._top_55xty_24,._open_55xty_40._bottom_55xty_32{transform:translateY(0)}._overlay_55xty_50{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0000004d;opacity:0;pointer-events:none;transition:opacity .3s ease-in-out;z-index:999}._overlay_55xty_50._show_55xty_60{opacity:1;pointer-events:all}
|
|
33
33
|
._tabs_f06du_1{display:flex;flex-direction:column;width:100%}._tabsList_f06du_7{display:flex;border-bottom:2px solid var(--color-border)}._left_f06du_12{justify-content:flex-start}._center_f06du_16{justify-content:center}._right_f06du_20{justify-content:flex-end}._tabsTrigger_f06du_24{padding:var(--spacing-md);border:none;border-bottom:2px solid transparent;background:none;cursor:pointer;color:var(--color-muted);font-weight:var(--font-weight-semibold);font-size:var(--font-size-md);transition:color .3s ease,border-color .3s ease;position:relative;top:2px}._tabsTrigger_f06du_24._active_f06du_38{border-color:var(--color-primary);color:var(--color-primary)}._tabsPanelWrapper_f06du_43{position:relative;min-height:100px}._tabsPanel_f06du_43{animation:_fadeSlide_f06du_1 .3s ease both;position:absolute;width:100%;top:0;left:0;padding:var(--spacing-md);color:var(--color-text-primary)}@keyframes _fadeSlide_f06du_1{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
|
|
34
34
|
._breadcrumbs_1nbgu_1{display:block;font-size:var(--font-size-sm);line-height:1.5}._list_1nbgu_7{display:flex;flex-wrap:wrap;list-style:none;padding:0;margin:0}._item_1nbgu_15{display:flex;align-items:center}._separator_1nbgu_20{margin:0 var(--spacing-xs);color:var(--color-muted)}._link_1nbgu_25{color:var(--color-muted);text-decoration:none;transition:color .3s ease}._link_1nbgu_25:hover{color:var(--color-primary)}._label_1nbgu_35{color:var(--color-muted)}._active_1nbgu_39{font-weight:var(--font-weight-bold);color:var(--color-primary)}
|