@editora/ui-react 0.1.22 → 0.1.23
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/Card.cjs.js +4 -4
- package/dist/Card.esm.js +25 -21
- package/dist/Carousel.cjs.js +1 -1
- package/dist/Carousel.esm.js +173 -170
- package/dist/DataViewToolbar.cjs.js +1 -1
- package/dist/DataViewToolbar.esm.js +1 -1
- package/dist/Dock.cjs.js +1 -1
- package/dist/Dock.esm.js +41 -38
- package/dist/IconCloud.cjs.js +1 -1
- package/dist/IconCloud.esm.js +40 -40
- package/dist/Kbd.cjs.js +1 -1
- package/dist/Kbd.esm.js +1 -1
- package/dist/Orbiter.cjs.js +1 -1
- package/dist/Orbiter.esm.js +25 -25
- package/dist/PageHeader.cjs.js +1 -1
- package/dist/PageHeader.esm.js +2 -2
- package/dist/RecordHeader.cjs.js +1 -1
- package/dist/RecordHeader.esm.js +1 -1
- package/dist/Sidebar.cjs.js +1 -1
- package/dist/Sidebar.esm.js +1 -1
- package/dist/Sortable.cjs.js +1 -1
- package/dist/Sortable.esm.js +47 -47
- package/dist/Stat.cjs.js +1 -1
- package/dist/Stat.esm.js +14 -14
- package/dist/ThemeProvider.cjs.js +1 -1
- package/dist/ThemeProvider.esm.js +19 -17
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/Carousel.d.ts.map +1 -1
- package/dist/components/Dock.d.ts.map +1 -1
- package/dist/components/IconCloud.d.ts.map +1 -1
- package/dist/components/Orbiter.d.ts.map +1 -1
- package/dist/components/Sortable.d.ts.map +1 -1
- package/dist/components/Stat.d.ts +4 -4
- package/dist/components/ThemeProvider.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/Carousel.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import e from "react";
|
|
3
|
-
import { Button as
|
|
4
|
-
const
|
|
3
|
+
import { Button as ne } from "./Button.esm.js";
|
|
4
|
+
const Be = [
|
|
5
5
|
"a[href]",
|
|
6
6
|
"area[href]",
|
|
7
7
|
"button:not([disabled])",
|
|
@@ -12,40 +12,40 @@ const je = [
|
|
|
12
12
|
'[contenteditable="true"]',
|
|
13
13
|
"[tabindex]"
|
|
14
14
|
].join(", ");
|
|
15
|
-
function
|
|
16
|
-
const [
|
|
15
|
+
function We() {
|
|
16
|
+
const [l, a] = e.useState(!1);
|
|
17
17
|
return e.useEffect(() => {
|
|
18
18
|
if (typeof window > "u" || typeof window.matchMedia != "function") return;
|
|
19
|
-
const
|
|
20
|
-
return b(), typeof
|
|
21
|
-
}, []),
|
|
19
|
+
const o = window.matchMedia("(prefers-reduced-motion: reduce)"), b = () => a(o.matches);
|
|
20
|
+
return b(), typeof o.addEventListener == "function" ? (o.addEventListener("change", b), () => o.removeEventListener("change", b)) : (o.addListener?.(b), () => o.removeListener?.(b));
|
|
21
|
+
}, []), l;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function ie(l) {
|
|
24
24
|
const a = [];
|
|
25
|
-
return e.Children.forEach(
|
|
26
|
-
if (!(
|
|
27
|
-
if (e.isValidElement(
|
|
28
|
-
a.push(...
|
|
25
|
+
return e.Children.forEach(l, (o) => {
|
|
26
|
+
if (!(o == null || typeof o == "boolean")) {
|
|
27
|
+
if (e.isValidElement(o) && o.type === e.Fragment) {
|
|
28
|
+
a.push(...ie(o.props.children));
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
a.push(
|
|
31
|
+
a.push(o);
|
|
32
32
|
}
|
|
33
33
|
}), a;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return a <= 1 ? 0 : Math.max(0, Math.min(a - 1,
|
|
35
|
+
function L(l, a) {
|
|
36
|
+
return a <= 1 ? 0 : Math.max(0, Math.min(a - 1, l));
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return a <= 1 ? 0 : (
|
|
38
|
+
function Fe(l, a) {
|
|
39
|
+
return a <= 1 ? 0 : (l % a + a) % a;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
if (e.isValidElement(
|
|
43
|
-
const
|
|
44
|
-
if (typeof
|
|
41
|
+
function ae(l, a) {
|
|
42
|
+
if (e.isValidElement(l) && typeof l.props == "object" && l.props && "label" in l.props) {
|
|
43
|
+
const o = l.props.label;
|
|
44
|
+
if (typeof o == "string" && o.trim()) return o;
|
|
45
45
|
}
|
|
46
46
|
return `Slide ${a + 1}`;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function oe(l, a) {
|
|
49
49
|
return /* @__PURE__ */ e.createElement(
|
|
50
50
|
"svg",
|
|
51
51
|
{
|
|
@@ -59,11 +59,11 @@ function re(o, a) {
|
|
|
59
59
|
viewBox: "0 0 24 24",
|
|
60
60
|
width: "16"
|
|
61
61
|
},
|
|
62
|
-
a === "vertical" ?
|
|
62
|
+
a === "vertical" ? l === "previous" ? /* @__PURE__ */ e.createElement("path", { d: "M18 15l-6-6-6 6" }) : /* @__PURE__ */ e.createElement("path", { d: "M6 9l6 6 6-6" }) : l === "previous" ? /* @__PURE__ */ e.createElement("path", { d: "M15 18l-6-6 6-6" }) : /* @__PURE__ */ e.createElement("path", { d: "M9 6l6 6-6 6" })
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function Ne(l, a, o) {
|
|
66
|
+
return l === "line" ? o === "vertical" ? {
|
|
67
67
|
borderRadius: 999,
|
|
68
68
|
blockSize: a ? 36 : 24,
|
|
69
69
|
inlineSize: 4
|
|
@@ -71,7 +71,7 @@ function Fe(o, a, i) {
|
|
|
71
71
|
borderRadius: 999,
|
|
72
72
|
blockSize: 4,
|
|
73
73
|
inlineSize: a ? 36 : 24
|
|
74
|
-
} :
|
|
74
|
+
} : l === "pill" ? o === "vertical" ? {
|
|
75
75
|
borderRadius: 999,
|
|
76
76
|
blockSize: a ? 28 : 18,
|
|
77
77
|
inlineSize: 10
|
|
@@ -85,95 +85,95 @@ function Fe(o, a, i) {
|
|
|
85
85
|
inlineSize: a ? 28 : 10
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
const
|
|
89
|
-
return /* @__PURE__ */ e.createElement("div", { ...b, ref:
|
|
88
|
+
const le = e.forwardRef(function({ label: a, children: o, ...b }, x) {
|
|
89
|
+
return /* @__PURE__ */ e.createElement("div", { ...b, ref: x }, o);
|
|
90
90
|
});
|
|
91
|
-
|
|
92
|
-
const
|
|
91
|
+
le.displayName = "Carousel.Item";
|
|
92
|
+
const se = e.forwardRef(function({
|
|
93
93
|
children: a,
|
|
94
|
-
defaultIndex:
|
|
94
|
+
defaultIndex: o = 0,
|
|
95
95
|
index: b,
|
|
96
|
-
onIndexChange:
|
|
96
|
+
onIndexChange: x,
|
|
97
97
|
loop: z = !0,
|
|
98
|
-
autoPlay:
|
|
99
|
-
interval:
|
|
98
|
+
autoPlay: B = !1,
|
|
99
|
+
interval: W = 5e3,
|
|
100
100
|
pauseOnHover: g = !0,
|
|
101
|
-
showControls:
|
|
102
|
-
showIndicators:
|
|
103
|
-
controlsVariant:
|
|
101
|
+
showControls: ue = !0,
|
|
102
|
+
showIndicators: F = !0,
|
|
103
|
+
controlsVariant: C = "button",
|
|
104
104
|
controlsPosition: p = "top",
|
|
105
|
-
controlsAlign:
|
|
106
|
-
controlsVisibility:
|
|
107
|
-
indicatorsVariant:
|
|
105
|
+
controlsAlign: ce = "space-between",
|
|
106
|
+
controlsVisibility: de = "always",
|
|
107
|
+
indicatorsVariant: fe = "dot",
|
|
108
108
|
direction: n = "horizontal",
|
|
109
109
|
transition: y = "slide",
|
|
110
|
-
previousLabel:
|
|
111
|
-
nextLabel:
|
|
112
|
-
label:
|
|
113
|
-
className:
|
|
114
|
-
style:
|
|
115
|
-
onKeyDown:
|
|
116
|
-
onMouseEnter:
|
|
117
|
-
onMouseLeave:
|
|
118
|
-
...
|
|
119
|
-
},
|
|
120
|
-
const
|
|
110
|
+
previousLabel: N = "Previous",
|
|
111
|
+
nextLabel: Y = "Next",
|
|
112
|
+
label: X = "Carousel",
|
|
113
|
+
className: be,
|
|
114
|
+
style: pe,
|
|
115
|
+
onKeyDown: _,
|
|
116
|
+
onMouseEnter: O,
|
|
117
|
+
onMouseLeave: U,
|
|
118
|
+
...me
|
|
119
|
+
}, he) {
|
|
120
|
+
const T = ie(a), s = T.length, E = typeof b == "number", [ve, V] = e.useState(() => L(o, s)), [$, P] = e.useState(!1), [D, q] = e.useState(!1), [G, K] = e.useState(null), [ge, Q] = e.useState(0), c = L(E ? b ?? 0 : ve, s), k = e.useRef(c), M = e.useRef([]), j = e.useRef(null), J = e.useId(), R = We();
|
|
121
121
|
e.useEffect(() => {
|
|
122
|
-
|
|
123
|
-
}, [
|
|
124
|
-
|
|
125
|
-
}, [
|
|
122
|
+
k.current = c;
|
|
123
|
+
}, [c]), e.useEffect(() => {
|
|
124
|
+
E || s <= 0 || V((t) => L(t, s));
|
|
125
|
+
}, [E, s]), e.useEffect(() => {
|
|
126
126
|
if (n !== "vertical" || y !== "slide") {
|
|
127
|
-
|
|
127
|
+
K(null), Q(0);
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
const t =
|
|
130
|
+
const t = M.current[c];
|
|
131
131
|
if (!t) return;
|
|
132
132
|
const r = () => {
|
|
133
|
-
const
|
|
134
|
-
|
|
133
|
+
const i = t.offsetHeight, u = t.offsetTop;
|
|
134
|
+
i > 0 && K(i), Q(u);
|
|
135
135
|
};
|
|
136
136
|
if (r(), typeof ResizeObserver > "u") return;
|
|
137
137
|
const f = new ResizeObserver(() => {
|
|
138
138
|
r();
|
|
139
139
|
});
|
|
140
|
-
return
|
|
141
|
-
|
|
140
|
+
return M.current.forEach((i) => {
|
|
141
|
+
i && f.observe(i);
|
|
142
142
|
}), () => f.disconnect();
|
|
143
|
-
}, [
|
|
143
|
+
}, [c, n, s, y]);
|
|
144
144
|
const m = e.useCallback((t) => {
|
|
145
|
-
const r = z ?
|
|
146
|
-
r !== f && (
|
|
147
|
-
}, [
|
|
148
|
-
m(
|
|
145
|
+
const r = z ? Fe(t, s) : L(t, s), f = k.current;
|
|
146
|
+
r !== f && (E || V(r), x?.(r));
|
|
147
|
+
}, [E, z, x, s]), h = e.useCallback(() => {
|
|
148
|
+
m(k.current - 1);
|
|
149
149
|
}, [m]), v = e.useCallback(() => {
|
|
150
|
-
m(
|
|
150
|
+
m(k.current + 1);
|
|
151
151
|
}, [m]);
|
|
152
152
|
e.useEffect(() => {
|
|
153
|
-
if (!
|
|
153
|
+
if (!B || s <= 1 || R || g && $ || D || typeof window > "u") return;
|
|
154
154
|
const t = window.setInterval(() => {
|
|
155
|
-
m(
|
|
156
|
-
}, Math.max(
|
|
155
|
+
m(k.current + 1);
|
|
156
|
+
}, Math.max(W, 1200));
|
|
157
157
|
return () => window.clearInterval(t);
|
|
158
|
-
}, [
|
|
159
|
-
|
|
158
|
+
}, [B, W, D, $, g, R, m, s]), e.useEffect(() => {
|
|
159
|
+
M.current.forEach((t, r) => {
|
|
160
160
|
if (!t) return;
|
|
161
|
-
const f = r ===
|
|
161
|
+
const f = r === c, i = t.querySelectorAll(Be);
|
|
162
162
|
if (f) {
|
|
163
|
-
t.removeAttribute("inert"),
|
|
164
|
-
if (!
|
|
165
|
-
const
|
|
166
|
-
|
|
163
|
+
t.removeAttribute("inert"), i.forEach((u) => {
|
|
164
|
+
if (!u.hasAttribute("data-carousel-tabindex")) return;
|
|
165
|
+
const I = u.getAttribute("data-carousel-tabindex");
|
|
166
|
+
I ? u.setAttribute("tabindex", I) : u.removeAttribute("tabindex"), u.removeAttribute("data-carousel-tabindex");
|
|
167
167
|
});
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
t.setAttribute("inert", ""),
|
|
171
|
-
|
|
170
|
+
t.setAttribute("inert", ""), i.forEach((u) => {
|
|
171
|
+
u.hasAttribute("data-carousel-tabindex") || u.setAttribute("data-carousel-tabindex", u.getAttribute("tabindex") ?? ""), u.setAttribute("tabindex", "-1");
|
|
172
172
|
});
|
|
173
173
|
});
|
|
174
|
-
}, [
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
174
|
+
}, [c, s]);
|
|
175
|
+
const ye = e.useCallback((t) => {
|
|
176
|
+
if (_?.(t), !t.defaultPrevented) {
|
|
177
177
|
if (n === "vertical" && t.key === "ArrowUp") {
|
|
178
178
|
t.preventDefault(), h();
|
|
179
179
|
return;
|
|
@@ -188,54 +188,54 @@ const ie = e.forwardRef(function({
|
|
|
188
188
|
}
|
|
189
189
|
n === "horizontal" && t.key === "ArrowRight" && (t.preventDefault(), v());
|
|
190
190
|
}
|
|
191
|
-
}, [n, v, h,
|
|
192
|
-
|
|
193
|
-
}, [
|
|
194
|
-
|
|
195
|
-
}, [
|
|
196
|
-
|
|
197
|
-
}, []), Ce = e.useCallback((t) => {
|
|
198
|
-
const r = t.relatedTarget;
|
|
199
|
-
r instanceof Node && t.currentTarget.contains(r) || O(!1);
|
|
191
|
+
}, [n, v, h, _]), we = e.useCallback((t) => {
|
|
192
|
+
O?.(t), g && P(!0);
|
|
193
|
+
}, [O, g]), Se = e.useCallback((t) => {
|
|
194
|
+
U?.(t), g && P(!1);
|
|
195
|
+
}, [U, g]), Ce = e.useCallback(() => {
|
|
196
|
+
q(!0);
|
|
200
197
|
}, []), Ee = e.useCallback((t) => {
|
|
201
|
-
const r = t.
|
|
202
|
-
r && (
|
|
198
|
+
const r = t.relatedTarget;
|
|
199
|
+
r instanceof Node && t.currentTarget.contains(r) || q(!1);
|
|
203
200
|
}, []), ke = e.useCallback((t) => {
|
|
204
|
-
const r =
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
const r = t.touches[0];
|
|
202
|
+
r && (j.current = { x: r.clientX, y: r.clientY });
|
|
203
|
+
}, []), xe = e.useCallback((t) => {
|
|
204
|
+
const r = j.current, f = t.changedTouches[0];
|
|
205
|
+
if (j.current = null, !r || !f) return;
|
|
206
|
+
const i = f.clientX - r.x, u = f.clientY - r.y;
|
|
207
207
|
if (n === "vertical") {
|
|
208
|
-
if (Math.abs(
|
|
208
|
+
if (Math.abs(u) < 40 || Math.abs(u) <= Math.abs(i))
|
|
209
209
|
return;
|
|
210
|
-
if (
|
|
210
|
+
if (u < 0) {
|
|
211
211
|
v();
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
h();
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
|
-
if (!(Math.abs(
|
|
218
|
-
if (
|
|
217
|
+
if (!(Math.abs(i) < 40 || Math.abs(i) <= Math.abs(u))) {
|
|
218
|
+
if (i < 0) {
|
|
219
219
|
v();
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
h();
|
|
223
223
|
}
|
|
224
|
-
}, [n, v, h]), A =
|
|
224
|
+
}, [n, v, h]), A = s <= 1, Z = ue ? de : "hidden", w = Z !== "hidden" && s > 1, ze = A || !z && c <= 0, Me = A || !z && c >= s - 1, Re = w && n === "vertical", Ae = w && p === "top" && n === "horizontal" ? 68 : 20, Ie = w && p === "bottom" && n === "horizontal" ? 68 : 20, Le = w && p === "center" && n === "horizontal" ? 68 : 20, Te = Re ? 84 : w && p === "center" && n === "horizontal" ? 68 : 20, S = y === "fade", $e = y === "slide", H = Z === "always" || $ || D, d = {
|
|
225
225
|
alignItems: "center",
|
|
226
226
|
display: "flex",
|
|
227
227
|
flexDirection: n === "vertical" ? "column" : "row",
|
|
228
228
|
gap: 8,
|
|
229
|
-
opacity:
|
|
229
|
+
opacity: H ? 1 : 0,
|
|
230
230
|
pointerEvents: "none",
|
|
231
231
|
position: "absolute",
|
|
232
232
|
transition: "opacity 180ms ease",
|
|
233
233
|
zIndex: 1
|
|
234
234
|
};
|
|
235
|
-
n === "vertical" ? (d.right = 12, p === "center" ? (d.bottom = 12, d.justifyContent = "space-between", d.top = 12) : (d.justifyContent = "center", d[p === "bottom" ? "bottom" : "top"] = 12)) : p === "center" ? (d.justifyContent = "space-between", d.left = 12, d.right = 12, d.top = "50%", d.transform = "translateY(-50%)") : (d.justifyContent =
|
|
236
|
-
const
|
|
237
|
-
pointerEvents:
|
|
238
|
-
},
|
|
235
|
+
n === "vertical" ? (d.right = 12, p === "center" ? (d.bottom = 12, d.justifyContent = "space-between", d.top = 12) : (d.justifyContent = "center", d[p === "bottom" ? "bottom" : "top"] = 12)) : p === "center" ? (d.justifyContent = "space-between", d.left = 12, d.right = 12, d.top = "50%", d.transform = "translateY(-50%)") : (d.justifyContent = ce === "center" ? "center" : "space-between", d.left = 12, d.right = 12, d[p === "bottom" ? "bottom" : "top"] = 12);
|
|
236
|
+
const ee = {
|
|
237
|
+
pointerEvents: H ? "auto" : "none"
|
|
238
|
+
}, te = {
|
|
239
239
|
alignItems: "center",
|
|
240
240
|
blockSize: 36,
|
|
241
241
|
borderRadius: 999,
|
|
@@ -243,60 +243,60 @@ const ie = e.forwardRef(function({
|
|
|
243
243
|
justifyContent: "center",
|
|
244
244
|
minInlineSize: 36,
|
|
245
245
|
padding: 0
|
|
246
|
-
}, $
|
|
247
|
-
|
|
246
|
+
}, re = (t, r) => C === "arrow" || r.toLowerCase().includes(t.trim().toLowerCase()) ? r : `${t.trim()}, ${r.toLowerCase()}`, De = /* @__PURE__ */ e.createElement(
|
|
247
|
+
ne,
|
|
248
248
|
{
|
|
249
|
-
ariaLabel: "Previous slide",
|
|
249
|
+
ariaLabel: re(N, "Previous slide"),
|
|
250
250
|
disabled: ze,
|
|
251
251
|
recipe: "outline",
|
|
252
252
|
size: "sm",
|
|
253
253
|
style: {
|
|
254
|
-
...
|
|
255
|
-
...
|
|
254
|
+
...ee,
|
|
255
|
+
...C === "arrow" ? te : null
|
|
256
256
|
},
|
|
257
257
|
variant: "secondary",
|
|
258
258
|
onClick: h
|
|
259
259
|
},
|
|
260
|
-
|
|
261
|
-
),
|
|
262
|
-
|
|
260
|
+
C === "arrow" ? oe("previous", n) : N
|
|
261
|
+
), je = /* @__PURE__ */ e.createElement(
|
|
262
|
+
ne,
|
|
263
263
|
{
|
|
264
|
-
ariaLabel: "Next slide",
|
|
265
|
-
disabled:
|
|
264
|
+
ariaLabel: re(Y, "Next slide"),
|
|
265
|
+
disabled: Me,
|
|
266
266
|
recipe: "outline",
|
|
267
267
|
size: "sm",
|
|
268
268
|
style: {
|
|
269
|
-
...
|
|
270
|
-
...
|
|
269
|
+
...ee,
|
|
270
|
+
...C === "arrow" ? te : null
|
|
271
271
|
},
|
|
272
272
|
variant: "secondary",
|
|
273
273
|
onClick: v
|
|
274
274
|
},
|
|
275
|
-
|
|
275
|
+
C === "arrow" ? oe("next", n) : Y
|
|
276
276
|
);
|
|
277
277
|
return /* @__PURE__ */ e.createElement(
|
|
278
278
|
"div",
|
|
279
279
|
{
|
|
280
|
-
...
|
|
281
|
-
ref:
|
|
282
|
-
"aria-label":
|
|
280
|
+
...me,
|
|
281
|
+
ref: he,
|
|
282
|
+
"aria-label": X,
|
|
283
283
|
"aria-roledescription": "carousel",
|
|
284
|
-
className:
|
|
284
|
+
className: be,
|
|
285
285
|
role: "region",
|
|
286
286
|
style: {
|
|
287
287
|
display: "grid",
|
|
288
288
|
gap: 12,
|
|
289
|
-
gridTemplateColumns: n === "vertical" &&
|
|
289
|
+
gridTemplateColumns: n === "vertical" && F && s > 1 ? "minmax(0, 1fr) auto" : void 0,
|
|
290
290
|
alignItems: n === "vertical" ? "start" : void 0,
|
|
291
291
|
minWidth: 0,
|
|
292
|
-
...
|
|
292
|
+
...pe
|
|
293
293
|
},
|
|
294
294
|
tabIndex: 0,
|
|
295
|
-
onBlurCapture:
|
|
296
|
-
onFocusCapture:
|
|
297
|
-
onKeyDown:
|
|
298
|
-
onMouseEnter:
|
|
299
|
-
onMouseLeave:
|
|
295
|
+
onBlurCapture: Ee,
|
|
296
|
+
onFocusCapture: Ce,
|
|
297
|
+
onKeyDown: ye,
|
|
298
|
+
onMouseEnter: we,
|
|
299
|
+
onMouseLeave: Se
|
|
300
300
|
},
|
|
301
301
|
/* @__PURE__ */ e.createElement(
|
|
302
302
|
"div",
|
|
@@ -315,11 +315,11 @@ const ie = e.forwardRef(function({
|
|
|
315
315
|
"div",
|
|
316
316
|
{
|
|
317
317
|
style: {
|
|
318
|
-
blockSize: n === "vertical" &&
|
|
318
|
+
blockSize: n === "vertical" && G != null ? G : void 0,
|
|
319
319
|
overflow: "hidden"
|
|
320
320
|
},
|
|
321
|
-
onTouchEnd:
|
|
322
|
-
onTouchStart:
|
|
321
|
+
onTouchEnd: xe,
|
|
322
|
+
onTouchStart: ke
|
|
323
323
|
},
|
|
324
324
|
/* @__PURE__ */ e.createElement(
|
|
325
325
|
"div",
|
|
@@ -328,24 +328,24 @@ const ie = e.forwardRef(function({
|
|
|
328
328
|
display: S ? "grid" : "flex",
|
|
329
329
|
flexDirection: n === "vertical" ? "column" : "row",
|
|
330
330
|
minWidth: 0,
|
|
331
|
-
transform: S ? void 0 : n === "vertical" ? `translateY(-${
|
|
332
|
-
transition:
|
|
333
|
-
width: n === "horizontal" && !S ? `${Math.max(
|
|
331
|
+
transform: S ? void 0 : n === "vertical" ? `translateY(-${ge}px)` : `translateX(-${c * 100}%)`,
|
|
332
|
+
transition: R || y === "none" ? "none" : $e ? "transform 320ms ease" : void 0,
|
|
333
|
+
width: n === "horizontal" && !S ? `${Math.max(s, 1) * 100}%` : "100%"
|
|
334
334
|
}
|
|
335
335
|
},
|
|
336
|
-
|
|
337
|
-
const f =
|
|
336
|
+
T.map((t, r) => {
|
|
337
|
+
const f = ae(t, r);
|
|
338
338
|
return /* @__PURE__ */ e.createElement(
|
|
339
339
|
"div",
|
|
340
340
|
{
|
|
341
341
|
key: r,
|
|
342
|
-
"aria-hidden": r !==
|
|
343
|
-
"aria-label": `${r + 1} of ${
|
|
342
|
+
"aria-hidden": r !== c,
|
|
343
|
+
"aria-label": `${r + 1} of ${s}: ${f}`,
|
|
344
344
|
"aria-roledescription": "slide",
|
|
345
|
-
"data-active": r ===
|
|
346
|
-
id: `${
|
|
347
|
-
ref: (
|
|
348
|
-
|
|
345
|
+
"data-active": r === c ? "" : void 0,
|
|
346
|
+
id: `${J}-slide-${r}`,
|
|
347
|
+
ref: (i) => {
|
|
348
|
+
M.current[r] = i;
|
|
349
349
|
},
|
|
350
350
|
role: "group",
|
|
351
351
|
style: {
|
|
@@ -354,13 +354,13 @@ const ie = e.forwardRef(function({
|
|
|
354
354
|
gridArea: S ? "1 / 1" : void 0,
|
|
355
355
|
minHeight: 220,
|
|
356
356
|
minWidth: 0,
|
|
357
|
-
opacity: r ===
|
|
358
|
-
paddingBlockEnd:
|
|
359
|
-
paddingBlockStart:
|
|
360
|
-
paddingInlineEnd:
|
|
361
|
-
paddingInlineStart:
|
|
362
|
-
pointerEvents: r ===
|
|
363
|
-
transition:
|
|
357
|
+
opacity: r === c ? 1 : S ? 0 : 0.56,
|
|
358
|
+
paddingBlockEnd: Ie,
|
|
359
|
+
paddingBlockStart: Ae,
|
|
360
|
+
paddingInlineEnd: Te,
|
|
361
|
+
paddingInlineStart: Le,
|
|
362
|
+
pointerEvents: r === c ? "auto" : "none",
|
|
363
|
+
transition: R || y === "none" ? "none" : "opacity 240ms ease",
|
|
364
364
|
width: "100%"
|
|
365
365
|
}
|
|
366
366
|
},
|
|
@@ -369,43 +369,46 @@ const ie = e.forwardRef(function({
|
|
|
369
369
|
})
|
|
370
370
|
)
|
|
371
371
|
),
|
|
372
|
-
w ? /* @__PURE__ */ e.createElement("div", { style: d },
|
|
372
|
+
w ? /* @__PURE__ */ e.createElement("div", { style: d }, De, je) : null
|
|
373
373
|
),
|
|
374
|
-
|
|
374
|
+
F && s > 1 ? /* @__PURE__ */ e.createElement(
|
|
375
375
|
"div",
|
|
376
376
|
{
|
|
377
|
-
"aria-label": `${
|
|
377
|
+
"aria-label": `${X} slides`,
|
|
378
378
|
style: {
|
|
379
379
|
alignItems: "center",
|
|
380
380
|
display: "flex",
|
|
381
381
|
flexDirection: n === "vertical" ? "column" : "row",
|
|
382
382
|
flexWrap: n === "vertical" ? "nowrap" : "wrap",
|
|
383
|
-
gap:
|
|
383
|
+
gap: 0,
|
|
384
384
|
gridColumn: n === "vertical" ? "2 / 3" : void 0,
|
|
385
385
|
justifyContent: "center",
|
|
386
386
|
justifySelf: n === "vertical" ? "start" : void 0
|
|
387
387
|
}
|
|
388
388
|
},
|
|
389
|
-
|
|
390
|
-
const f =
|
|
389
|
+
T.map((t, r) => {
|
|
390
|
+
const f = ae(t, r), i = Ne(fe, r === c, n), u = Math.max(0, Math.ceil((24 - i.inlineSize) / 2)), I = Math.max(0, Math.ceil((24 - i.blockSize) / 2));
|
|
391
391
|
return /* @__PURE__ */ e.createElement(
|
|
392
392
|
"button",
|
|
393
393
|
{
|
|
394
394
|
key: r,
|
|
395
|
-
"aria-controls": `${
|
|
396
|
-
"aria-current": r ===
|
|
395
|
+
"aria-controls": `${J}-slide-${r}`,
|
|
396
|
+
"aria-current": r === c ? "true" : void 0,
|
|
397
397
|
"aria-label": `Go to ${f}`,
|
|
398
398
|
disabled: A,
|
|
399
399
|
style: {
|
|
400
|
-
background: r ===
|
|
400
|
+
background: r === c ? "var(--ui-color-info, #2563eb)" : "rgba(148, 163, 184, 0.4)",
|
|
401
|
+
backgroundClip: "content-box",
|
|
401
402
|
border: "none",
|
|
402
|
-
borderRadius:
|
|
403
|
+
borderRadius: i.borderRadius,
|
|
404
|
+
boxSizing: "content-box",
|
|
403
405
|
cursor: A ? "default" : "pointer",
|
|
404
|
-
height:
|
|
405
|
-
inlineSize:
|
|
406
|
-
|
|
406
|
+
height: i.blockSize,
|
|
407
|
+
inlineSize: i.inlineSize,
|
|
408
|
+
margin: 0,
|
|
409
|
+
padding: `${I}px ${u}px`,
|
|
407
410
|
transition: "all 180ms ease",
|
|
408
|
-
width:
|
|
411
|
+
width: i.inlineSize
|
|
409
412
|
},
|
|
410
413
|
type: "button",
|
|
411
414
|
onClick: () => m(r)
|
|
@@ -415,11 +418,11 @@ const ie = e.forwardRef(function({
|
|
|
415
418
|
) : null
|
|
416
419
|
);
|
|
417
420
|
});
|
|
418
|
-
|
|
419
|
-
const
|
|
420
|
-
Item:
|
|
421
|
+
se.displayName = "Carousel";
|
|
422
|
+
const _e = Object.assign(se, {
|
|
423
|
+
Item: le
|
|
421
424
|
});
|
|
422
425
|
export {
|
|
423
|
-
|
|
424
|
-
|
|
426
|
+
_e as Carousel,
|
|
427
|
+
_e as default
|
|
425
428
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("react"),q=require("./FiltersBar.cjs.js"),B=e=>e&&e.__esModule?e:{default:e},l=B(k);function F(e,t,a){return e===1?t:a||`${t}s`}function I(e,t,a,n){const r=[];return typeof e=="number"&&r.push(`${e} selected`),typeof t=="number"&&r.push(`${t} ${F(t,a,n)}`),r.length>0?r.join(" • "):null}const u=l.default.forwardRef(function({title:t,description:a,summary:n,selectedCount:r,totalCount:f,itemLabel:s="record",itemLabelPlural:c,actions:i,filtersExtra:m,footer:o,search:p,onSearchChange:g,searchPlaceholder:y,searchLabel:b,searchName:v,searchClearable:h,searchDebounce:w,status:E,statusOptions:S,statusLabel:x,statusPlaceholder:W,onStatusChange:_,clearLabel:D,clearDisabled:T,onClear:j,children:z,className:R,style:V,...$},H){const d=n??I(r,f,s,c),M=!!(t||a||d||i);return l.default.createElement("div",{...$,ref:H,className:R,style:{background:"linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%)",border:"1px solid rgba(148, 163, 184, 0.28)",borderRadius:18,display:"grid",gap:12,minWidth:0,padding:12,...V}},M?l.default.createElement("div",{style:{alignItems:"flex-start",display:"flex",flexWrap:"wrap",gap:12,justifyContent:"space-between",minWidth:0}},l.default.createElement("div",{style:{display:"grid",gap:4,minWidth:0}},t?l.default.createElement("div",{style:{fontSize:16,fontWeight:700,letterSpacing:"-0.01em",lineHeight:1.2}},t):null,a?l.default.createElement("div",{style:{color:"var(--ui-color-muted, #
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("react"),q=require("./FiltersBar.cjs.js"),B=e=>e&&e.__esModule?e:{default:e},l=B(k);function F(e,t,a){return e===1?t:a||`${t}s`}function I(e,t,a,n){const r=[];return typeof e=="number"&&r.push(`${e} selected`),typeof t=="number"&&r.push(`${t} ${F(t,a,n)}`),r.length>0?r.join(" • "):null}const u=l.default.forwardRef(function({title:t,description:a,summary:n,selectedCount:r,totalCount:f,itemLabel:s="record",itemLabelPlural:c,actions:i,filtersExtra:m,footer:o,search:p,onSearchChange:g,searchPlaceholder:y,searchLabel:b,searchName:v,searchClearable:h,searchDebounce:w,status:E,statusOptions:S,statusLabel:x,statusPlaceholder:W,onStatusChange:_,clearLabel:D,clearDisabled:T,onClear:j,children:z,className:R,style:V,...$},H){const d=n??I(r,f,s,c),M=!!(t||a||d||i);return l.default.createElement("div",{...$,ref:H,className:R,style:{background:"linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%)",border:"1px solid rgba(148, 163, 184, 0.28)",borderRadius:18,display:"grid",gap:12,minWidth:0,padding:12,...V}},M?l.default.createElement("div",{style:{alignItems:"flex-start",display:"flex",flexWrap:"wrap",gap:12,justifyContent:"space-between",minWidth:0}},l.default.createElement("div",{style:{display:"grid",gap:4,minWidth:0}},t?l.default.createElement("div",{style:{fontSize:16,fontWeight:700,letterSpacing:"-0.01em",lineHeight:1.2}},t):null,a?l.default.createElement("div",{style:{color:"var(--ui-color-muted, #526175)",fontSize:14,lineHeight:1.45}},a):null,d?l.default.createElement("div",{style:{color:"var(--ui-color-muted, #475569)",fontSize:12,fontWeight:600,letterSpacing:"0.02em"}},d):null),i?l.default.createElement("div",{style:{alignItems:"center",display:"flex",flexWrap:"wrap",gap:8,justifyContent:"flex-end"}},i):null):null,l.default.createElement(q.FiltersBar,{clearDisabled:T,clearLabel:D,extra:m,search:p,searchClearable:h,searchDebounce:w,searchLabel:b,searchName:v,searchPlaceholder:y,status:E,statusLabel:x,statusOptions:S,statusPlaceholder:W,style:{background:"transparent",border:"none",padding:0},onClear:j,onSearchChange:g,onStatusChange:_},z),o?l.default.createElement("div",null,o):null)});u.displayName="DataViewToolbar";exports.DataViewToolbar=u;exports.default=u;
|
|
@@ -69,7 +69,7 @@ const F = t.forwardRef(function({
|
|
|
69
69
|
minWidth: 0
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
/* @__PURE__ */ t.createElement("div", { style: { display: "grid", gap: 4, minWidth: 0 } }, e ? /* @__PURE__ */ t.createElement("div", { style: { fontSize: 16, fontWeight: 700, letterSpacing: "-0.01em", lineHeight: 1.2 } }, e) : null, r ? /* @__PURE__ */ t.createElement("div", { style: { color: "var(--ui-color-muted, #
|
|
72
|
+
/* @__PURE__ */ t.createElement("div", { style: { display: "grid", gap: 4, minWidth: 0 } }, e ? /* @__PURE__ */ t.createElement("div", { style: { fontSize: 16, fontWeight: 700, letterSpacing: "-0.01em", lineHeight: 1.2 } }, e) : null, r ? /* @__PURE__ */ t.createElement("div", { style: { color: "var(--ui-color-muted, #526175)", fontSize: 14, lineHeight: 1.45 } }, r) : null, d ? /* @__PURE__ */ t.createElement("div", { style: { color: "var(--ui-color-muted, #475569)", fontSize: 12, fontWeight: 600, letterSpacing: "0.02em" } }, d) : null),
|
|
73
73
|
i ? /* @__PURE__ */ t.createElement(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
package/dist/Dock.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const O=require("react");require("@editora/ui-core/dock");const q=require("./_internals-BIT_j6Nr.js"),T=l=>l&&l.__esModule?l:{default:l},n=T(O),x=typeof window<"u"?n.default.useLayoutEffect:n.default.useEffect;function L(l){if(l==null||l==="")return null;if(typeof l=="number")return`${l}px`;const r=l.split(/\s+/).filter(Boolean);return r.length?r.map(u=>/^-?\d+(\.\d+)?$/.test(u)?`${u}px`:u).join(" "):null}const N=n.default.forwardRef(function({orientation:r,magnification:u,distance:s,idleScale:i,lift:
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const O=require("react");require("@editora/ui-core/dock");const q=require("./_internals-BIT_j6Nr.js"),T=l=>l&&l.__esModule?l:{default:l},n=T(O),x=typeof window<"u"?n.default.useLayoutEffect:n.default.useEffect;function L(l){if(l==null||l==="")return null;if(typeof l=="number")return`${l}px`;const r=l.split(/\s+/).filter(Boolean);return r.length?r.map(u=>/^-?\d+(\.\d+)?$/.test(u)?`${u}px`:u).join(" "):null}const N=n.default.forwardRef(function({orientation:r,magnification:u,distance:s,idleScale:i,lift:f,smoothing:a,animation:p,gap:I,padding:o,itemSize:k,labelMode:m,labelPlacement:g,variant:y,tone:b,size:d,radius:D,elevation:c,children:_,...E},t){const w=n.default.useRef(null);return n.default.useImperativeHandle(t,()=>w.current),n.default.useEffect(()=>{q.warnIfElementNotRegistered("ui-dock","Dock")},[]),x(()=>{const R=w.current;if(!R)return;const e=(S,A)=>{const j=R.getAttribute(S);if(A==null){j!=null&&R.removeAttribute(S);return}j!==A&&R.setAttribute(S,A)};e("orientation",r&&r!=="horizontal"?r:null),e("magnification",u==null||u===""?null:String(u)),e("distance",s==null||s===""?null:String(s)),e("idle-scale",i==null||i===""?null:String(i)),e("lift",f==null||f===""?null:String(f)),e("smoothing",a==null||a===""?null:String(a)),e("animation",p&&p!=="smooth"?p:null),e("gap",L(I)),e("padding",L(o)),e("item-size",L(k)),e("label-mode",m&&m!=="hover"?m:null),e("label-placement",g&&g!=="auto"?g:null),e("variant",y&&y!=="surface"?y:null),e("tone",b&&b!=="brand"?b:null),e("size",d&&d!=="md"&&d!=="2"?d:null),e("radius",D==null||D===""?null:String(D)),e("elevation",c&&c!=="low"?c:null)},[r,u,s,i,f,a,p,I,o,k,m,g,y,b,d,D,c]),q.createUIElement("ui-dock",{ref:w,...E},_)});N.displayName="Dock";const $=n.default.forwardRef(function({as:r,href:u,target:s,rel:i,value:f,active:a,disabled:p,icon:I,label:o,badge:k,iconProps:m,labelProps:g,badgeProps:y,children:b,...d},D){const c=r||(u?"a":"button"),_=I??b,E=typeof o=="string"||typeof o=="number"?String(o):void 0,t={ref:D,"data-ui-dock-item":"",...d};return f!=null&&f!==""&&(t["data-value"]=String(f)),a&&(t["data-active"]="",u&&(t["aria-current"]="page")),E&&t["aria-label"]==null&&(t["aria-label"]=E),E&&t.title==null&&(t.title=E),u&&(t.href=u,s&&(t.target=s),i&&(t.rel=i)),p?c==="button"?t.disabled=!0:(t["aria-disabled"]=!0,t.tabIndex=-1):c==="button"&&t.type==null&&(t.type="button"),n.default.createElement(c,t,_!=null?n.default.createElement("span",{"data-ui-dock-icon":"",...m},_):null,o!=null?n.default.createElement("span",{"data-ui-dock-label":"",...g},o):null,o!=null&&k!=null?" ":null,k!=null?n.default.createElement("span",{"data-ui-dock-badge":"",...y},k):null)});$.displayName="Dock.Item";const h=Object.assign(N,{Item:$});exports.Dock=h;exports.default=h;
|