@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.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import e from "react";
3
- import { Button as ee } from "./Button.esm.js";
4
- const je = [
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 Be() {
16
- const [o, a] = e.useState(!1);
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 i = window.matchMedia("(prefers-reduced-motion: reduce)"), b = () => a(i.matches);
20
- return b(), typeof i.addEventListener == "function" ? (i.addEventListener("change", b), () => i.removeEventListener("change", b)) : (i.addListener?.(b), () => i.removeListener?.(b));
21
- }, []), o;
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 ne(o) {
23
+ function ie(l) {
24
24
  const a = [];
25
- return e.Children.forEach(o, (i) => {
26
- if (!(i == null || typeof i == "boolean")) {
27
- if (e.isValidElement(i) && i.type === e.Fragment) {
28
- a.push(...ne(i.props.children));
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(i);
31
+ a.push(o);
32
32
  }
33
33
  }), a;
34
34
  }
35
- function T(o, a) {
36
- return a <= 1 ? 0 : Math.max(0, Math.min(a - 1, o));
35
+ function L(l, a) {
36
+ return a <= 1 ? 0 : Math.max(0, Math.min(a - 1, l));
37
37
  }
38
- function We(o, a) {
39
- return a <= 1 ? 0 : (o % a + a) % a;
38
+ function Fe(l, a) {
39
+ return a <= 1 ? 0 : (l % a + a) % a;
40
40
  }
41
- function te(o, a) {
42
- if (e.isValidElement(o) && typeof o.props == "object" && o.props && "label" in o.props) {
43
- const i = o.props.label;
44
- if (typeof i == "string" && i.trim()) return i;
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 re(o, a) {
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" ? o === "previous" ? /* @__PURE__ */ e.createElement("path", { d: "M18 15l-6-6-6 6" }) : /* @__PURE__ */ e.createElement("path", { d: "M6 9l6 6 6-6" }) : o === "previous" ? /* @__PURE__ */ e.createElement("path", { d: "M15 18l-6-6 6-6" }) : /* @__PURE__ */ e.createElement("path", { d: "M9 6l6 6-6 6" })
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 Fe(o, a, i) {
66
- return o === "line" ? i === "vertical" ? {
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
- } : o === "pill" ? i === "vertical" ? {
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 ae = e.forwardRef(function({ label: a, children: i, ...b }, k) {
89
- return /* @__PURE__ */ e.createElement("div", { ...b, ref: k }, i);
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
- ae.displayName = "Carousel.Item";
92
- const ie = e.forwardRef(function({
91
+ le.displayName = "Carousel.Item";
92
+ const se = e.forwardRef(function({
93
93
  children: a,
94
- defaultIndex: i = 0,
94
+ defaultIndex: o = 0,
95
95
  index: b,
96
- onIndexChange: k,
96
+ onIndexChange: x,
97
97
  loop: z = !0,
98
- autoPlay: j = !1,
99
- interval: B = 5e3,
98
+ autoPlay: B = !1,
99
+ interval: W = 5e3,
100
100
  pauseOnHover: g = !0,
101
- showControls: oe = !0,
102
- showIndicators: W = !0,
103
- controlsVariant: x = "button",
101
+ showControls: ue = !0,
102
+ showIndicators: F = !0,
103
+ controlsVariant: C = "button",
104
104
  controlsPosition: p = "top",
105
- controlsAlign: se = "space-between",
106
- controlsVisibility: le = "always",
107
- indicatorsVariant: ue = "dot",
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: ce = "Previous",
111
- nextLabel: de = "Next",
112
- label: F = "Carousel",
113
- className: fe,
114
- style: be,
115
- onKeyDown: N,
116
- onMouseEnter: Y,
117
- onMouseLeave: V,
118
- ...pe
119
- }, me) {
120
- const I = ne(a), l = I.length, C = typeof b == "number", [he, X] = e.useState(() => T(i, l)), [L, _] = e.useState(!1), [$, O] = e.useState(!1), [U, P] = e.useState(null), [ve, q] = e.useState(0), u = T(C ? b ?? 0 : he, l), E = e.useRef(u), R = e.useRef([]), D = e.useRef(null), G = e.useId(), M = Be();
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
- E.current = u;
123
- }, [u]), e.useEffect(() => {
124
- C || l <= 0 || X((t) => T(t, l));
125
- }, [C, l]), e.useEffect(() => {
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
- P(null), q(0);
127
+ K(null), Q(0);
128
128
  return;
129
129
  }
130
- const t = R.current[u];
130
+ const t = M.current[c];
131
131
  if (!t) return;
132
132
  const r = () => {
133
- const s = t.offsetHeight, c = t.offsetTop;
134
- s > 0 && P(s), q(c);
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 R.current.forEach((s) => {
141
- s && f.observe(s);
140
+ return M.current.forEach((i) => {
141
+ i && f.observe(i);
142
142
  }), () => f.disconnect();
143
- }, [u, n, l, y]);
143
+ }, [c, n, s, y]);
144
144
  const m = e.useCallback((t) => {
145
- const r = z ? We(t, l) : T(t, l), f = E.current;
146
- r !== f && (C || X(r), k?.(r));
147
- }, [C, z, k, l]), h = e.useCallback(() => {
148
- m(E.current - 1);
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(E.current + 1);
150
+ m(k.current + 1);
151
151
  }, [m]);
152
152
  e.useEffect(() => {
153
- if (!j || l <= 1 || M || g && L || $ || typeof window > "u") return;
153
+ if (!B || s <= 1 || R || g && $ || D || typeof window > "u") return;
154
154
  const t = window.setInterval(() => {
155
- m(E.current + 1);
156
- }, Math.max(B, 1200));
155
+ m(k.current + 1);
156
+ }, Math.max(W, 1200));
157
157
  return () => window.clearInterval(t);
158
- }, [j, B, $, L, g, M, m, l]), e.useEffect(() => {
159
- R.current.forEach((t, r) => {
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 === u, s = t.querySelectorAll(je);
161
+ const f = r === c, i = t.querySelectorAll(Be);
162
162
  if (f) {
163
- t.removeAttribute("inert"), s.forEach((c) => {
164
- if (!c.hasAttribute("data-carousel-tabindex")) return;
165
- const H = c.getAttribute("data-carousel-tabindex");
166
- H ? c.setAttribute("tabindex", H) : c.removeAttribute("tabindex"), c.removeAttribute("data-carousel-tabindex");
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", ""), s.forEach((c) => {
171
- c.hasAttribute("data-carousel-tabindex") || c.setAttribute("data-carousel-tabindex", c.getAttribute("tabindex") ?? ""), c.setAttribute("tabindex", "-1");
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
- }, [u, l]);
175
- const ge = e.useCallback((t) => {
176
- if (N?.(t), !t.defaultPrevented) {
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, N]), ye = e.useCallback((t) => {
192
- Y?.(t), g && _(!0);
193
- }, [Y, g]), we = e.useCallback((t) => {
194
- V?.(t), g && _(!1);
195
- }, [V, g]), Se = e.useCallback(() => {
196
- O(!0);
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.touches[0];
202
- r && (D.current = { x: r.clientX, y: r.clientY });
198
+ const r = t.relatedTarget;
199
+ r instanceof Node && t.currentTarget.contains(r) || q(!1);
203
200
  }, []), ke = e.useCallback((t) => {
204
- const r = D.current, f = t.changedTouches[0];
205
- if (D.current = null, !r || !f) return;
206
- const s = f.clientX - r.x, c = f.clientY - r.y;
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(c) < 40 || Math.abs(c) <= Math.abs(s))
208
+ if (Math.abs(u) < 40 || Math.abs(u) <= Math.abs(i))
209
209
  return;
210
- if (c < 0) {
210
+ if (u < 0) {
211
211
  v();
212
212
  return;
213
213
  }
214
214
  h();
215
215
  return;
216
216
  }
217
- if (!(Math.abs(s) < 40 || Math.abs(s) <= Math.abs(c))) {
218
- if (s < 0) {
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 = l <= 1, K = oe ? le : "hidden", w = K !== "hidden" && l > 1, ze = A || !z && u <= 0, xe = A || !z && u >= l - 1, Re = w && n === "vertical", Me = w && p === "top" && n === "horizontal" ? 68 : 20, Ae = w && p === "bottom" && n === "horizontal" ? 68 : 20, Te = w && p === "center" && n === "horizontal" ? 68 : 20, Ie = Re ? 84 : w && p === "center" && n === "horizontal" ? 68 : 20, S = y === "fade", Le = y === "slide", Q = K === "always" || L || $, d = {
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: Q ? 1 : 0,
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 = se === "center" ? "center" : "space-between", d.left = 12, d.right = 12, d[p === "bottom" ? "bottom" : "top"] = 12);
236
- const J = {
237
- pointerEvents: Q ? "auto" : "none"
238
- }, Z = {
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
- }, $e = /* @__PURE__ */ e.createElement(
247
- ee,
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
- ...J,
255
- ...x === "arrow" ? Z : null
254
+ ...ee,
255
+ ...C === "arrow" ? te : null
256
256
  },
257
257
  variant: "secondary",
258
258
  onClick: h
259
259
  },
260
- x === "arrow" ? re("previous", n) : ce
261
- ), De = /* @__PURE__ */ e.createElement(
262
- ee,
260
+ C === "arrow" ? oe("previous", n) : N
261
+ ), je = /* @__PURE__ */ e.createElement(
262
+ ne,
263
263
  {
264
- ariaLabel: "Next slide",
265
- disabled: xe,
264
+ ariaLabel: re(Y, "Next slide"),
265
+ disabled: Me,
266
266
  recipe: "outline",
267
267
  size: "sm",
268
268
  style: {
269
- ...J,
270
- ...x === "arrow" ? Z : null
269
+ ...ee,
270
+ ...C === "arrow" ? te : null
271
271
  },
272
272
  variant: "secondary",
273
273
  onClick: v
274
274
  },
275
- x === "arrow" ? re("next", n) : de
275
+ C === "arrow" ? oe("next", n) : Y
276
276
  );
277
277
  return /* @__PURE__ */ e.createElement(
278
278
  "div",
279
279
  {
280
- ...pe,
281
- ref: me,
282
- "aria-label": F,
280
+ ...me,
281
+ ref: he,
282
+ "aria-label": X,
283
283
  "aria-roledescription": "carousel",
284
- className: fe,
284
+ className: be,
285
285
  role: "region",
286
286
  style: {
287
287
  display: "grid",
288
288
  gap: 12,
289
- gridTemplateColumns: n === "vertical" && W && l > 1 ? "minmax(0, 1fr) auto" : void 0,
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
- ...be
292
+ ...pe
293
293
  },
294
294
  tabIndex: 0,
295
- onBlurCapture: Ce,
296
- onFocusCapture: Se,
297
- onKeyDown: ge,
298
- onMouseEnter: ye,
299
- onMouseLeave: we
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" && U != null ? U : void 0,
318
+ blockSize: n === "vertical" && G != null ? G : void 0,
319
319
  overflow: "hidden"
320
320
  },
321
- onTouchEnd: ke,
322
- onTouchStart: Ee
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(-${ve}px)` : `translateX(-${u * 100}%)`,
332
- transition: M || y === "none" ? "none" : Le ? "transform 320ms ease" : void 0,
333
- width: n === "horizontal" && !S ? `${Math.max(l, 1) * 100}%` : "100%"
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
- I.map((t, r) => {
337
- const f = te(t, r);
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 !== u,
343
- "aria-label": `${r + 1} of ${l}: ${f}`,
342
+ "aria-hidden": r !== c,
343
+ "aria-label": `${r + 1} of ${s}: ${f}`,
344
344
  "aria-roledescription": "slide",
345
- "data-active": r === u ? "" : void 0,
346
- id: `${G}-slide-${r}`,
347
- ref: (s) => {
348
- R.current[r] = s;
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 === u ? 1 : S ? 0 : 0.56,
358
- paddingBlockEnd: Ae,
359
- paddingBlockStart: Me,
360
- paddingInlineEnd: Ie,
361
- paddingInlineStart: Te,
362
- pointerEvents: r === u ? "auto" : "none",
363
- transition: M || y === "none" ? "none" : "opacity 240ms ease",
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 }, $e, De) : null
372
+ w ? /* @__PURE__ */ e.createElement("div", { style: d }, De, je) : null
373
373
  ),
374
- W && l > 1 ? /* @__PURE__ */ e.createElement(
374
+ F && s > 1 ? /* @__PURE__ */ e.createElement(
375
375
  "div",
376
376
  {
377
- "aria-label": `${F} slides`,
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: 8,
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
- I.map((t, r) => {
390
- const f = te(t, r), s = Fe(ue, r === u, n);
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": `${G}-slide-${r}`,
396
- "aria-current": r === u ? "true" : void 0,
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 === u ? "var(--ui-color-info, #2563eb)" : "rgba(148, 163, 184, 0.4)",
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: s.borderRadius,
403
+ borderRadius: i.borderRadius,
404
+ boxSizing: "content-box",
403
405
  cursor: A ? "default" : "pointer",
404
- height: s.blockSize,
405
- inlineSize: s.inlineSize,
406
- padding: 0,
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: s.inlineSize
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
- ie.displayName = "Carousel";
419
- const Ve = Object.assign(ie, {
420
- Item: ae
421
+ se.displayName = "Carousel";
422
+ const _e = Object.assign(se, {
423
+ Item: le
421
424
  });
422
425
  export {
423
- Ve as Carousel,
424
- Ve as default
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, #64748b)",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;
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, #64748b)", 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),
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:o,smoothing:a,animation:p,gap:I,padding:f,itemSize:E,labelMode:k,labelPlacement:g,variant:m,tone:b,size:d,radius:y,elevation:c,children:_,...D},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",o==null||o===""?null:String(o)),e("smoothing",a==null||a===""?null:String(a)),e("animation",p&&p!=="smooth"?p:null),e("gap",L(I)),e("padding",L(f)),e("item-size",L(E)),e("label-mode",k&&k!=="hover"?k:null),e("label-placement",g&&g!=="auto"?g:null),e("variant",m&&m!=="surface"?m:null),e("tone",b&&b!=="brand"?b:null),e("size",d&&d!=="md"&&d!=="2"?d:null),e("radius",y==null||y===""?null:String(y)),e("elevation",c&&c!=="low"?c:null)},[r,u,s,i,o,a,p,I,f,E,k,g,m,b,d,y,c]),q.createUIElement("ui-dock",{ref:w,...D},_)});N.displayName="Dock";const $=n.default.forwardRef(function({as:r,href:u,target:s,rel:i,value:o,active:a,disabled:p,icon:I,label:f,badge:E,iconProps:k,labelProps:g,badgeProps:m,children:b,...d},y){const c=r||(u?"a":"button"),_=I??b,D=typeof f=="string"||typeof f=="number"?String(f):void 0,t={ref:y,"data-ui-dock-item":"",...d};return o!=null&&o!==""&&(t["data-value"]=String(o)),a&&(t["data-active"]="",u&&(t["aria-current"]="page")),D&&t["aria-label"]==null&&(t["aria-label"]=D),D&&t.title==null&&(t.title=D),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":"",...k},_):null,f!=null?n.default.createElement("span",{"data-ui-dock-label":"",...g},f):null,E!=null?n.default.createElement("span",{"data-ui-dock-badge":"",...m},E):null)});$.displayName="Dock.Item";const h=Object.assign(N,{Item:$});exports.Dock=h;exports.default=h;
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;