@rinzai/zen 0.14.0 → 0.16.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/CHANGELOG.md +153 -0
- package/README.md +16 -1
- package/dist/animated-number/index.js +14 -14
- package/dist/breadcrumbs/index.js +14 -14
- package/dist/calendar/index.js +29 -29
- package/dist/calendar-heatmap/index.js +12 -12
- package/dist/canvas/index.js +19 -19
- package/dist/carousel/index.d.ts.map +1 -1
- package/dist/carousel/index.js +29 -29
- package/dist/chart/index.js +7 -7
- package/dist/code-block/index.js +5 -5
- package/dist/collapse/index.js +6 -6
- package/dist/color-picker/index.js +10 -10
- package/dist/combobox/index.js +61 -61
- package/dist/command-palette/index.js +5 -5
- package/dist/confirm-dialog/index.js +4 -4
- package/dist/date-picker/index.js +15 -15
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +45 -65
- package/dist/docs/README.md +205 -0
- package/dist/docs/accordion.md +122 -0
- package/dist/docs/alert.md +69 -0
- package/dist/docs/animated-number.md +105 -0
- package/dist/docs/avatar.md +91 -0
- package/dist/docs/backdrop.md +94 -0
- package/dist/docs/badge.md +37 -0
- package/dist/docs/breadcrumbs.md +44 -0
- package/dist/docs/button-group.md +76 -0
- package/dist/docs/button.md +131 -0
- package/dist/docs/calendar-heatmap.md +73 -0
- package/dist/docs/calendar.md +101 -0
- package/dist/docs/canvas.md +584 -0
- package/dist/docs/card.md +180 -0
- package/dist/docs/carousel.md +162 -0
- package/dist/docs/chart.md +325 -0
- package/dist/docs/checkbox.md +88 -0
- package/dist/docs/chip.md +52 -0
- package/dist/docs/code-block.md +116 -0
- package/dist/docs/code-input.md +52 -0
- package/dist/docs/collapse.md +46 -0
- package/dist/docs/color-picker.md +145 -0
- package/dist/docs/combobox.md +208 -0
- package/dist/docs/command-palette.md +65 -0
- package/dist/docs/date-picker.md +167 -0
- package/dist/docs/dialog.md +271 -0
- package/dist/docs/disclosure.md +88 -0
- package/dist/docs/editable-cell.md +90 -0
- package/dist/docs/empty-state.md +46 -0
- package/dist/docs/field.md +82 -0
- package/dist/docs/file-drop.md +44 -0
- package/dist/docs/filter-bar.md +66 -0
- package/dist/docs/header.md +51 -0
- package/dist/docs/hover-card.md +110 -0
- package/dist/docs/icon-picker.md +65 -0
- package/dist/docs/input-group.md +89 -0
- package/dist/docs/input.md +33 -0
- package/dist/docs/inset.md +57 -0
- package/dist/docs/kbd.md +34 -0
- package/dist/docs/keypad.md +51 -0
- package/dist/docs/load-more.md +66 -0
- package/dist/docs/locale-provider.md +99 -0
- package/dist/docs/marquee.md +86 -0
- package/dist/docs/menu.md +456 -0
- package/dist/docs/meter.md +102 -0
- package/dist/docs/money-input.md +169 -0
- package/dist/docs/month-picker.md +80 -0
- package/dist/docs/navigation-menu.md +157 -0
- package/dist/docs/number-field.md +129 -0
- package/dist/docs/page-header.md +44 -0
- package/dist/docs/page-transition.md +93 -0
- package/dist/docs/pagination.md +42 -0
- package/dist/docs/pills.md +85 -0
- package/dist/docs/player-bar.md +158 -0
- package/dist/docs/popover.md +200 -0
- package/dist/docs/progress-ring.md +70 -0
- package/dist/docs/radio-cards.md +82 -0
- package/dist/docs/radio-group.md +86 -0
- package/dist/docs/range-slider.md +64 -0
- package/dist/docs/repeat-picker.md +44 -0
- package/dist/docs/resizable.md +107 -0
- package/dist/docs/seek-bar.md +97 -0
- package/dist/docs/segmented.md +89 -0
- package/dist/docs/select.md +148 -0
- package/dist/docs/separator.md +76 -0
- package/dist/docs/side-nav.md +75 -0
- package/dist/docs/skeleton.md +89 -0
- package/dist/docs/slider.md +87 -0
- package/dist/docs/sortable.md +244 -0
- package/dist/docs/sparkline.md +56 -0
- package/dist/docs/spinner.md +69 -0
- package/dist/docs/status-pill.md +81 -0
- package/dist/docs/stepper.md +59 -0
- package/dist/docs/tab-bar.md +78 -0
- package/dist/docs/table-of-contents.md +43 -0
- package/dist/docs/table.md +714 -0
- package/dist/docs/tabs.md +140 -0
- package/dist/docs/tag-input.md +45 -0
- package/dist/docs/textarea.md +25 -0
- package/dist/docs/theme-toggle.md +85 -0
- package/dist/docs/theming.md +193 -0
- package/dist/docs/time-field.md +71 -0
- package/dist/docs/timeline.md +50 -0
- package/dist/docs/toast.md +53 -0
- package/dist/docs/toggle-group.md +83 -0
- package/dist/docs/toggle.md +38 -0
- package/dist/docs/toolbar.md +97 -0
- package/dist/docs/tooltip.md +102 -0
- package/dist/docs/tree.md +295 -0
- package/dist/docs/trend.md +50 -0
- package/dist/filter-bar/index.js +6 -6
- package/dist/header/index.js +6 -6
- package/dist/icon-picker/index.js +5 -5
- package/dist/icons/arrow-path.d.ts +3 -0
- package/dist/icons/arrow-path.d.ts.map +1 -0
- package/dist/icons/arrows-right-left.d.ts +3 -0
- package/dist/icons/arrows-right-left.d.ts.map +1 -0
- package/dist/icons/backward.d.ts +3 -0
- package/dist/icons/backward.d.ts.map +1 -0
- package/dist/icons/forward.d.ts +3 -0
- package/dist/icons/forward.d.ts.map +1 -0
- package/dist/icons/heart-solid.d.ts +3 -0
- package/dist/icons/heart-solid.d.ts.map +1 -0
- package/dist/icons/heart.d.ts +3 -0
- package/dist/icons/heart.d.ts.map +1 -0
- package/dist/icons/musical-note.d.ts +3 -0
- package/dist/icons/musical-note.d.ts.map +1 -0
- package/dist/icons/pause.d.ts +3 -0
- package/dist/icons/pause.d.ts.map +1 -0
- package/dist/icons/play.d.ts +3 -0
- package/dist/icons/play.d.ts.map +1 -0
- package/dist/icons/queue-list.d.ts +3 -0
- package/dist/icons/queue-list.d.ts.map +1 -0
- package/dist/icons/speaker-wave.d.ts +3 -0
- package/dist/icons/speaker-wave.d.ts.map +1 -0
- package/dist/icons/speaker-x-mark.d.ts +3 -0
- package/dist/icons/speaker-x-mark.d.ts.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/keypad/index.js +5 -5
- package/dist/lib.js +86 -80
- package/dist/load-more/index.js +5 -5
- package/dist/marquee/index.d.ts +15 -0
- package/dist/marquee/index.d.ts.map +1 -0
- package/dist/marquee/index.js +90 -0
- package/dist/menu/index.d.ts +7 -1
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +222 -178
- package/dist/money-input/index.js +54 -54
- package/dist/month-picker/index.js +11 -11
- package/dist/number-field/index.js +5 -5
- package/dist/pagination/index.js +12 -12
- package/dist/player-bar/index.d.ts +11 -0
- package/dist/player-bar/index.d.ts.map +1 -0
- package/dist/player-bar/index.js +17 -0
- package/dist/radio-cards/index.d.ts +2 -1
- package/dist/radio-cards/index.d.ts.map +1 -1
- package/dist/radio-cards/index.js +3 -3
- package/dist/range-slider/index.js +11 -11
- package/dist/repeat-picker/index.js +5 -5
- package/dist/resizable/index.js +22 -22
- package/dist/seek-bar/index.d.ts +26 -0
- package/dist/seek-bar/index.d.ts.map +1 -0
- package/dist/seek-bar/index.js +121 -0
- package/dist/segmented/index.d.ts +3 -2
- package/dist/segmented/index.d.ts.map +1 -1
- package/dist/segmented/index.js +19 -18
- package/dist/select/index.js +21 -21
- package/dist/slider/index.d.ts +2 -1
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/sortable/index.d.ts +13 -1
- package/dist/sortable/index.d.ts.map +1 -1
- package/dist/sortable/index.js +74 -55
- package/dist/sortable/shared.js +14 -14
- package/dist/sortable/tree.js +17 -17
- package/dist/sparkline/index.js +4 -4
- package/dist/stepper/index.js +13 -13
- package/dist/tab-bar/index.d.ts +4 -2
- package/dist/tab-bar/index.d.ts.map +1 -1
- package/dist/tab-bar/index.js +24 -19
- package/dist/table/index.js +26 -26
- package/dist/table/selection.js +9 -9
- package/dist/table-of-contents/index.js +11 -11
- package/dist/tag-input/index.js +5 -5
- package/dist/textarea/index.d.ts +6 -2
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/textarea/index.js +2 -1
- package/dist/theme-toggle/index.js +4 -4
- package/dist/theme.css +143 -0
- package/dist/time-field/index.js +21 -21
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +41 -41
- package/dist/tooltip/index.d.ts +9 -3
- package/dist/tooltip/index.d.ts.map +1 -1
- package/dist/tooltip/index.js +19 -16
- package/dist/tree/index.js +34 -34
- package/dist/trend/index.js +5 -5
- package/dist/utils/duration.d.ts +3 -0
- package/dist/utils/duration.d.ts.map +1 -0
- package/dist/utils/duration.js +7 -0
- package/dist/utils/messages.d.ts +3 -0
- package/dist/utils/messages.d.ts.map +1 -1
- package/dist/utils/messages.js +4 -1
- package/dist/utils/slot.d.ts +5 -2
- package/dist/utils/slot.d.ts.map +1 -1
- package/dist/utils/slot.js +16 -11
- package/dist/utils/swipe.d.ts +7 -0
- package/dist/utils/swipe.d.ts.map +1 -1
- package/dist/utils/swipe.js +45 -25
- package/dist/utils/useAnchoredPopup.d.ts +2 -1
- package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
- package/dist/utils/useAnchoredPopup.js +10 -5
- package/dist/utils/useHeightVar.d.ts +7 -0
- package/dist/utils/useHeightVar.d.ts.map +1 -0
- package/dist/utils/useHeightVar.js +17 -0
- package/dist/utils/useMediaPlayer.d.ts +38 -0
- package/dist/utils/useMediaPlayer.d.ts.map +1 -0
- package/dist/utils/useMediaPlayer.js +91 -0
- package/dist/utils/useMediaSession.d.ts +24 -0
- package/dist/utils/useMediaSession.d.ts.map +1 -0
- package/dist/utils/useMediaSession.js +76 -0
- package/dist/utils/useVirtualList.d.ts +6 -1
- package/dist/utils/useVirtualList.d.ts.map +1 -1
- package/dist/utils/useVirtualList.js +12 -12
- package/dist/zen.css +1 -1
- package/package.json +4 -2
package/dist/sortable/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useMessages as e } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as t } from "../utils/cx.js";
|
|
4
|
+
import { useMergedRefs as n } from "../utils/refs.js";
|
|
5
|
+
import { Slot as r } from "../utils/slot.js";
|
|
6
6
|
import { SortableContext as i, SortableHandle as a, SortableItem as o, edgeScroll as s, scrollerOf as c, settle as l, shift as u, topsOf as d, useAnnouncer as f } from "./shared.js";
|
|
7
7
|
import { flattenTree as p } from "./tree-model.js";
|
|
8
8
|
import m from "./tree.js";
|
|
@@ -13,72 +13,91 @@ var x = typeof window > "u" ? h : g, S = (e, t, n) => {
|
|
|
13
13
|
let r = [...e];
|
|
14
14
|
return r.splice(n, 0, ...r.splice(t, 1)), r;
|
|
15
15
|
};
|
|
16
|
-
function C({ value: a, onValueChange: o,
|
|
17
|
-
let
|
|
18
|
-
|
|
16
|
+
function C({ value: a, onValueChange: o, itemHeight: p, onLiftedChange: m, asChild: h, className: g, children: C, ref: w, ...T }) {
|
|
17
|
+
let E = _(null), D = n(E, w), [O, k] = v(null), A = e(), { say: j, region: M } = f(E), N = _(null), P = _(null), F = _(null), I = () => [...E.current?.querySelectorAll(":scope > [data-sortable-id]") ?? []], L = (e) => {
|
|
18
|
+
N.current = d(I()), o(e);
|
|
19
19
|
};
|
|
20
20
|
x(() => {
|
|
21
|
-
let e =
|
|
22
|
-
|
|
23
|
-
}, [a]);
|
|
24
|
-
let
|
|
25
|
-
if (e.button !== 0 ||
|
|
26
|
-
let n =
|
|
27
|
-
if (!i) return;
|
|
28
|
-
e.preventDefault();
|
|
29
|
-
let o = e.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
let e = N.current;
|
|
22
|
+
N.current = null, e && l(I(), e), O && I().find((e) => e.dataset.sortableId === O)?.scrollIntoView?.({ block: "nearest" });
|
|
23
|
+
}, [a]), x(() => F.current?.());
|
|
24
|
+
let R = (e, t) => {
|
|
25
|
+
if (e.button !== 0 || O) return;
|
|
26
|
+
let n = I(), r = a.indexOf(t), i = n.find((e) => e.dataset.sortableId === t);
|
|
27
|
+
if (r < 0 || !i) return;
|
|
28
|
+
e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
29
|
+
let o = c(E.current), f = o.scrollTop, h = e.clientY, g = new Map(a.map((e, t) => [e, t])), _, v;
|
|
30
|
+
if (p) _ = p, v = (e) => Math.max(0, Math.min(r + Math.trunc(e / _), a.length - 1));
|
|
31
|
+
else {
|
|
32
|
+
let e = n.map((e) => e.getBoundingClientRect()), t = e.length > 1 ? e[1].top - e[0].bottom : 0;
|
|
33
|
+
_ = e[r].height + t;
|
|
34
|
+
let i = e.map((e) => e.top + e.height / 2);
|
|
35
|
+
v = (e) => {
|
|
36
|
+
let t = i[r] + e, a = r;
|
|
37
|
+
for (; a < n.length - 1 && t > i[a + 1];) a++;
|
|
38
|
+
for (; a > 0 && t < i[a - 1];) a--;
|
|
39
|
+
return a;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
let y = r, b = e.clientY;
|
|
43
|
+
E.current.dataset.sorting = "", m?.(t);
|
|
33
44
|
let x = () => {
|
|
34
|
-
let e = b -
|
|
35
|
-
|
|
36
|
-
let t
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
let e = b - h + o.scrollTop - f, t = y;
|
|
46
|
+
y = v(e), y !== t && navigator.vibrate?.(5);
|
|
47
|
+
for (let t of I()) {
|
|
48
|
+
let n = g.get(t.dataset.sortableId);
|
|
49
|
+
if (n !== void 0) {
|
|
50
|
+
if (n === r) {
|
|
51
|
+
t.dataset.dragging = "", u(t, e);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
u(t, r < n && n <= y ? -_ : y <= n && n < r ? _ : 0);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
F.current = x;
|
|
59
|
+
let C = s(o, x), w = (t) => {
|
|
45
60
|
t.pointerId === e.pointerId && (b = t.clientY, x(), C.at(b));
|
|
46
|
-
},
|
|
47
|
-
t.pointerId
|
|
61
|
+
}, T = (t) => {
|
|
62
|
+
if (t.pointerId !== e.pointerId) return;
|
|
63
|
+
removeEventListener("pointermove", w), removeEventListener("pointerup", T), removeEventListener("pointercancel", T), C.stop(), F.current = null;
|
|
64
|
+
let n = I();
|
|
65
|
+
for (let e of n) delete e.dataset.dragging;
|
|
66
|
+
delete E.current?.dataset.sorting, m?.(null), t.type === "pointerup" && y !== r ? L(S(a, r, y)) : l(n, d(n));
|
|
48
67
|
};
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
let r = a.indexOf(t), i =
|
|
52
|
-
if (e.key === " " || e.key === "Enter") e.preventDefault(),
|
|
53
|
-
else if (
|
|
68
|
+
addEventListener("pointermove", w), addEventListener("pointerup", T), addEventListener("pointercancel", T);
|
|
69
|
+
}, z = (e, t, n) => {
|
|
70
|
+
let r = a.indexOf(t), i = A.place(r + 1, a.length);
|
|
71
|
+
if (e.key === " " || e.key === "Enter") e.preventDefault(), O === t ? (k(null), P.current = null, m?.(null), j(A.dropped(n, i))) : O || (k(t), P.current = a, m?.(t), j(A.pickedUp(n, i)));
|
|
72
|
+
else if (O === t && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
54
73
|
e.preventDefault();
|
|
55
74
|
let t = r + (e.key === "ArrowUp" ? -1 : 1);
|
|
56
75
|
if (t < 0 || t >= a.length) return;
|
|
57
|
-
|
|
58
|
-
} else if (
|
|
76
|
+
L(S(a, r, t)), j(A.movedTo(n, A.place(t + 1, a.length)));
|
|
77
|
+
} else if (O === t && e.key === "Escape") {
|
|
59
78
|
e.preventDefault();
|
|
60
|
-
let r =
|
|
61
|
-
|
|
79
|
+
let r = P.current ?? a;
|
|
80
|
+
k(null), P.current = null, m?.(null), r !== a && L([...r]), j(A.putBack(n, A.place(r.indexOf(t) + 1, r.length)));
|
|
62
81
|
}
|
|
63
|
-
},
|
|
64
|
-
...
|
|
65
|
-
ref:
|
|
82
|
+
}, B = {
|
|
83
|
+
...T,
|
|
84
|
+
ref: D
|
|
66
85
|
};
|
|
67
86
|
return /* @__PURE__ */ b(i.Provider, {
|
|
68
87
|
value: {
|
|
69
|
-
grab:
|
|
70
|
-
key:
|
|
71
|
-
lifted:
|
|
88
|
+
grab: R,
|
|
89
|
+
key: z,
|
|
90
|
+
lifted: O
|
|
72
91
|
},
|
|
73
|
-
children: [
|
|
74
|
-
...
|
|
75
|
-
className:
|
|
76
|
-
children:
|
|
92
|
+
children: [h ? /* @__PURE__ */ y(r, {
|
|
93
|
+
...B,
|
|
94
|
+
className: t("zen__sortable", g),
|
|
95
|
+
children: C
|
|
77
96
|
}) : /* @__PURE__ */ y("ul", {
|
|
78
|
-
...
|
|
79
|
-
className:
|
|
80
|
-
children:
|
|
81
|
-
}),
|
|
97
|
+
...B,
|
|
98
|
+
className: t("zen__sortable relative flex flex-col", g),
|
|
99
|
+
children: C
|
|
100
|
+
}), M]
|
|
82
101
|
});
|
|
83
102
|
}
|
|
84
103
|
//#endregion
|
package/dist/sortable/shared.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useMessages as e } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as t } from "../utils/cx.js";
|
|
4
|
+
import { Slot as n } from "../utils/slot.js";
|
|
5
5
|
import { reducedMotion as r } from "../utils/motion.js";
|
|
6
6
|
import { createContext as i, useContext as a, useEffect as o, useState as s } from "react";
|
|
7
7
|
import { jsx as c } from "react/jsx-runtime";
|
|
@@ -58,26 +58,26 @@ function b(e) {
|
|
|
58
58
|
host: r
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
function x({ id:
|
|
61
|
+
function x({ id: e, label: r, asChild: i, className: a, ...o }) {
|
|
62
62
|
let { lifted: s } = p("SortableItem");
|
|
63
|
-
return /* @__PURE__ */ c(i ?
|
|
64
|
-
"data-sortable-id":
|
|
63
|
+
return /* @__PURE__ */ c(i ? n : "li", {
|
|
64
|
+
"data-sortable-id": e,
|
|
65
65
|
"data-sortable-label": r,
|
|
66
|
-
"data-lifted": s ===
|
|
67
|
-
className:
|
|
66
|
+
"data-lifted": s === e || void 0,
|
|
67
|
+
className: t("zen__sortable-item transition-[box-shadow,scale,background-color] duration-200 [&:not(tr)]:relative", "[&:not(tr)]:data-dragging:bg-card [&:not(tr)]:data-dragging:z-10 [&:not(tr)]:data-dragging:rounded-xl [&:not(tr)]:data-dragging:scale-[1.02] [&:not(tr)]:data-dragging:shadow-[0_0_0_1px_oklch(var(--tint)/0.08),0_12px_32px_-12px_oklch(0_0_0/0.6)]", "[&:not(tr)]:data-lifted:bg-card [&:not(tr)]:data-lifted:z-10 [&:not(tr)]:data-lifted:rounded-xl [&:not(tr)]:data-lifted:shadow-[0_0_0_2px_oklch(var(--primary)/0.6)]", "[&:not(tr)]:data-carried:z-10 [&:not(tr)]:data-carried:bg-card data-drop-target:bg-primary/[0.07] [&[data-drop-target]>td]:[background-image:linear-gradient(oklch(var(--primary)/0.09),oklch(var(--primary)/0.09))]", "[&:is([data-dragging],[data-carried])>td]:z-20 [&:is([data-dragging],[data-carried])>td]:bg-card/80 [&:is([data-dragging],[data-carried])>td]:glass-blur [&:is([data-dragging],[data-carried])>td:not(.sticky)]:relative", "[&[data-lifted]>td]:[background-image:linear-gradient(oklch(var(--primary)/0.09),oklch(var(--primary)/0.09))] [&[data-lifted]>td]:shadow-[inset_0_2px_0_oklch(var(--primary)/0.6),inset_0_-2px_0_oklch(var(--primary)/0.6)]", a),
|
|
68
68
|
...o
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
function S({ id:
|
|
72
|
-
let { grab: s, key: l, lifted: u } = p("SortableHandle"), d =
|
|
71
|
+
function S({ id: n, label: r, className: i, children: a, ...o }) {
|
|
72
|
+
let { grab: s, key: l, lifted: u } = p("SortableHandle"), d = e();
|
|
73
73
|
return /* @__PURE__ */ c("button", {
|
|
74
74
|
type: "button",
|
|
75
75
|
"aria-label": d.reorder(r),
|
|
76
76
|
"data-sortable-label": r,
|
|
77
|
-
"aria-pressed": u ===
|
|
78
|
-
onPointerDown: (e) => s(e,
|
|
79
|
-
onKeyDown: (e) => l(e,
|
|
80
|
-
className:
|
|
77
|
+
"aria-pressed": u === n,
|
|
78
|
+
onPointerDown: (e) => s(e, n),
|
|
79
|
+
onKeyDown: (e) => l(e, n, r),
|
|
80
|
+
className: t("text-muted-foreground hover:text-foreground grid size-8 shrink-0 cursor-grab touch-none place-items-center rounded-md outline-hidden select-none focus-ring active:cursor-grabbing", i),
|
|
81
81
|
...o,
|
|
82
82
|
children: a ?? /* @__PURE__ */ c("svg", {
|
|
83
83
|
"aria-hidden": !0,
|
package/dist/sortable/tree.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useMessages as e } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as t } from "../utils/cx.js";
|
|
4
|
+
import { readingKey as n } from "../utils/direction.js";
|
|
5
|
+
import { useMergedRefs as r } from "../utils/refs.js";
|
|
6
|
+
import { Slot as i } from "../utils/slot.js";
|
|
7
7
|
import { SortableContext as a, edgeScroll as o, scrollerOf as s, settle as c, shift as l, topsOf as u, useAnnouncer as d } from "./shared.js";
|
|
8
8
|
import { indexTree as f, insertNode as p, nearestSlot as m, removeNode as h, treeSlots as g } from "./tree-model.js";
|
|
9
9
|
import { useEffect as _, useLayoutEffect as v, useRef as y, useState as b } from "react";
|
|
@@ -11,7 +11,7 @@ import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
|
11
11
|
//#region packages/sortable/tree.tsx
|
|
12
12
|
var C = typeof window > "u" ? _ : v, w = "pointer-events-none fixed z-50 h-0.5 rounded-full bg-primary shadow-[0_0_10px_oklch(var(--glow)/calc(0.9*var(--glow-k)))] transition-[top,left,width] duration-100 before:absolute before:-top-[3px] before:-start-1 before:size-2 before:rounded-full before:border-2 before:border-primary before:bg-background", T = (e, t) => e.parentId === t.parentId && e.index === t.index;
|
|
13
13
|
function E({ value: _, onValueChange: v, accepts: E, indent: k = 24, asChild: A, className: j, children: M, ref: N, ...P }) {
|
|
14
|
-
let F = y(null), I =
|
|
14
|
+
let F = y(null), I = r(F, N), [L, R] = b(null), z = e(), { say: B, region: V, host: H } = d(F), U = y(null), W = y(null), G = () => [...F.current?.querySelectorAll("[data-sortable-id]") ?? []].filter((e) => e.parentElement?.closest(".zen__sortable") === F.current), K = (e) => G().find((t) => t.dataset.sortableId === e), q = (e) => {
|
|
15
15
|
U.current = u(G()), v(e);
|
|
16
16
|
};
|
|
17
17
|
C(() => {
|
|
@@ -73,19 +73,19 @@ function E({ value: _, onValueChange: v, accepts: E, indent: k = 24, asChild: A,
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
r.addEventListener("pointermove", A), r.addEventListener("pointerup", j), r.addEventListener("pointercancel", j);
|
|
76
|
-
}, Q = (e,
|
|
76
|
+
}, Q = (e, t, r) => {
|
|
77
77
|
if (e.key === " " || e.key === "Enter") {
|
|
78
|
-
e.preventDefault(), L ===
|
|
78
|
+
e.preventDefault(), L === t ? (R(null), W.current = null, B(z.dropped(r, Y(_, t)))) : L || (R(t), W.current = _, B(z.pickedUp(r, Y(_, t))));
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
if (L !==
|
|
81
|
+
if (L !== t) return;
|
|
82
82
|
if (e.key === "Escape") {
|
|
83
83
|
e.preventDefault();
|
|
84
|
-
let
|
|
85
|
-
R(null), W.current = null,
|
|
84
|
+
let n = W.current ?? _;
|
|
85
|
+
R(null), W.current = null, n !== _ && q(n), B(z.putBack(r, Y(n, t)));
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
let i =
|
|
88
|
+
let i = n(e.key, e.currentTarget);
|
|
89
89
|
if (![
|
|
90
90
|
"ArrowUp",
|
|
91
91
|
"ArrowDown",
|
|
@@ -93,7 +93,7 @@ function E({ value: _, onValueChange: v, accepts: E, indent: k = 24, asChild: A,
|
|
|
93
93
|
"ArrowRight"
|
|
94
94
|
].includes(i)) return;
|
|
95
95
|
e.preventDefault();
|
|
96
|
-
let a = X(
|
|
96
|
+
let a = X(t), o = a.slots.find((e) => T(e, a.place));
|
|
97
97
|
if (!o) return;
|
|
98
98
|
let s;
|
|
99
99
|
if (i === "ArrowLeft" || i === "ArrowRight") {
|
|
@@ -105,7 +105,7 @@ function E({ value: _, onValueChange: v, accepts: E, indent: k = 24, asChild: A,
|
|
|
105
105
|
}
|
|
106
106
|
if (!s) return;
|
|
107
107
|
let c = p(a.tree, s, a.node);
|
|
108
|
-
q(c), B(z.movedTo(r, Y(c,
|
|
108
|
+
q(c), B(z.movedTo(r, Y(c, t)));
|
|
109
109
|
}, $ = {
|
|
110
110
|
...P,
|
|
111
111
|
ref: I
|
|
@@ -116,13 +116,13 @@ function E({ value: _, onValueChange: v, accepts: E, indent: k = 24, asChild: A,
|
|
|
116
116
|
key: Q,
|
|
117
117
|
lifted: L
|
|
118
118
|
},
|
|
119
|
-
children: [A ? /* @__PURE__ */ x(
|
|
119
|
+
children: [A ? /* @__PURE__ */ x(i, {
|
|
120
120
|
...$,
|
|
121
|
-
className:
|
|
121
|
+
className: t("zen__sortable", j),
|
|
122
122
|
children: M
|
|
123
123
|
}) : /* @__PURE__ */ x("ul", {
|
|
124
124
|
...$,
|
|
125
|
-
className:
|
|
125
|
+
className: t("zen__sortable relative flex flex-col", j),
|
|
126
126
|
children: M
|
|
127
127
|
}), V]
|
|
128
128
|
});
|
package/dist/sparkline/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMessages as e } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as t } from "../utils/cx.js";
|
|
4
4
|
import { useSeen as n } from "../utils/useSeen.js";
|
|
5
5
|
import { useId as r, useRef as i } from "react";
|
|
6
6
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
//#region packages/sparkline/index.tsx
|
|
8
8
|
function c({ values: c, area: l = !0, tone: u = "default", className: d, ref: f, ...p }) {
|
|
9
|
-
let m =
|
|
9
|
+
let m = e(), h = r(), g = i(null), _ = n(g);
|
|
10
10
|
if (c.length < 2) return null;
|
|
11
11
|
let v = Math.min(...c), y = Math.max(...c) - v || 1, b = c.map((e, t) => [t / (c.length - 1) * 100, 38 - (e - v) / y * 36]).map(([e, t], n) => `${n ? "L" : "M"}${e.toFixed(2)},${t.toFixed(2)}`).join(""), x = u === "default" ? "var(--color-primary)" : u === "negative" ? "var(--color-destructive)" : "var(--color-muted-foreground)", S = c[0], C = c[c.length - 1];
|
|
12
12
|
return /* @__PURE__ */ s("svg", {
|
|
@@ -19,7 +19,7 @@ function c({ values: c, area: l = !0, tone: u = "default", className: d, ref: f,
|
|
|
19
19
|
"aria-label": m.fromTo(String(S), String(C)),
|
|
20
20
|
viewBox: "0 0 100 40",
|
|
21
21
|
preserveAspectRatio: "none",
|
|
22
|
-
className:
|
|
22
|
+
className: t("zen__sparkline h-8 w-24 overflow-visible", d),
|
|
23
23
|
style: { color: x },
|
|
24
24
|
...p,
|
|
25
25
|
children: [l && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ s("linearGradient", {
|
package/dist/stepper/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from "../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { useMessages as e } from "../locale-provider/index.js";
|
|
3
|
+
import t from "../icons/micro/check.js";
|
|
4
|
+
import { cx as n } from "../utils/cx.js";
|
|
5
5
|
import { Children as r, isValidElement as i } from "react";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region packages/stepper/index.tsx
|
|
8
8
|
function s({ value: s, className: c, children: l, "aria-label": u, ...d }) {
|
|
9
|
-
let f =
|
|
9
|
+
let f = e(), p = u ?? f.progress, m = r.toArray(l).filter(i);
|
|
10
10
|
return /* @__PURE__ */ a("ol", {
|
|
11
11
|
"aria-label": p,
|
|
12
|
-
className:
|
|
12
|
+
className: n("zen__stepper flex w-full items-start", c),
|
|
13
13
|
...d,
|
|
14
|
-
children: m.map((
|
|
14
|
+
children: m.map((e, r) => {
|
|
15
15
|
let i = r < s ? "done" : r === s ? "current" : "upcoming";
|
|
16
16
|
return /* @__PURE__ */ o("li", {
|
|
17
17
|
"data-state": i,
|
|
@@ -21,26 +21,26 @@ function s({ value: s, className: c, children: l, "aria-label": u, ...d }) {
|
|
|
21
21
|
r > 0 && /* @__PURE__ */ a("span", {
|
|
22
22
|
"aria-hidden": !0,
|
|
23
23
|
className: "bg-tint/10 absolute start-[calc(-50%+1.25rem)] end-[calc(50%+1.25rem)] top-3.5 h-px overflow-hidden",
|
|
24
|
-
children: /* @__PURE__ */ a("span", { className:
|
|
24
|
+
children: /* @__PURE__ */ a("span", { className: n("bg-primary ease-out-soft block h-full origin-left transition-transform rtl:origin-right duration-500", i === "upcoming" && "scale-x-0") })
|
|
25
25
|
}),
|
|
26
26
|
/* @__PURE__ */ a("span", {
|
|
27
27
|
"aria-hidden": !0,
|
|
28
|
-
className:
|
|
29
|
-
children: i === "done" ? /* @__PURE__ */ a(
|
|
28
|
+
className: n("grid size-7 place-items-center rounded-full text-xs font-semibold tabular-nums transition-[background-color,color,box-shadow] duration-300", i === "upcoming" && "bg-tint/[0.05] text-muted-foreground shadow-[inset_0_0_0_1px_oklch(var(--tint)/0.12)]", i === "current" && "bg-primary/15 text-foreground shadow-[inset_0_0_0_1px_oklch(var(--primary)/0.5),0_0_18px_-2px_oklch(var(--glow)/calc(0.7*var(--glow-k)))]", i === "done" && "bg-primary text-primary-foreground"),
|
|
29
|
+
children: i === "done" ? /* @__PURE__ */ a(t, { className: "size-3.5" }) : r + 1
|
|
30
30
|
}),
|
|
31
|
-
|
|
31
|
+
e,
|
|
32
32
|
/* @__PURE__ */ a("span", {
|
|
33
33
|
className: "sr-only",
|
|
34
34
|
children: i === "done" ? ", done" : i === "upcoming" ? ", not started" : ""
|
|
35
35
|
})
|
|
36
36
|
]
|
|
37
|
-
},
|
|
37
|
+
}, e.key ?? r);
|
|
38
38
|
})
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function c({ description: e, className:
|
|
41
|
+
function c({ description: e, className: t, children: r }) {
|
|
42
42
|
return /* @__PURE__ */ o("span", {
|
|
43
|
-
className:
|
|
43
|
+
className: n("flex flex-col gap-0.5 px-1", t),
|
|
44
44
|
children: [/* @__PURE__ */ a("span", {
|
|
45
45
|
className: "text-muted-foreground group-data-[state=current]/step:text-foreground group-data-[state=done]/step:text-foreground text-sm font-medium",
|
|
46
46
|
children: r
|
package/dist/tab-bar/index.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Phone navigation: a glass bar fixed to the bottom, clear of the home
|
|
4
4
|
* indicator, hidden from `hideFrom` up (default md). Fill it with TabBarItems.
|
|
5
|
+
* Its height is kept in `--zen-tab-bar-height` on its parent (0px while
|
|
6
|
+
* hidden): a PlayerBar beside it sits on it, and the page can pad its end by it.
|
|
5
7
|
* Inside a rounded frame, round the bar to match (className, e.g.
|
|
6
8
|
* rounded-b-[15px]): with GPU compositing, Chrome doesn't clip a blurred
|
|
7
9
|
* backdrop to an ancestor's rounded corners, only to the element's own.
|
|
8
10
|
*/
|
|
9
|
-
export default function TabBar({ hideFrom, className, children, ...rest }: TabBarProps): import('react').JSX.Element;
|
|
11
|
+
export default function TabBar({ hideFrom, className, children, ref, ...rest }: TabBarProps): import('react').JSX.Element;
|
|
10
12
|
/**
|
|
11
13
|
* One destination: an icon over a label. `active` marks the current page; with
|
|
12
14
|
* `asChild`, the styles go onto your own link (e.g. a router's NavLink, which
|
|
@@ -20,7 +22,7 @@ export interface TabBarProps extends ComponentProps<'nav'> {
|
|
|
20
22
|
export interface TabBarItemProps extends ComponentProps<'a'> {
|
|
21
23
|
icon?: ReactNode;
|
|
22
24
|
active?: boolean;
|
|
23
|
-
/** Style the single child element (a router link holding the
|
|
25
|
+
/** Style the single child element (a router link holding the label) instead of rendering an <a>; `icon` goes inside it. */
|
|
24
26
|
asChild?: boolean;
|
|
25
27
|
}
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/tab-bar/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/tab-bar/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAE,SAAS,EAAU,MAAM,OAAO,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAoBjG;AAOD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,+BAgBlG;AAED,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,KAAK,CAAC;IACtD,iEAAiE;IACjE,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;CACzC;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,GAAG,CAAC;IACxD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2HAA2H;IAC3H,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
package/dist/tab-bar/index.js
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cx as e } from "../utils/cx.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useMergedRefs as t } from "../utils/refs.js";
|
|
4
|
+
import { Slot as n } from "../utils/slot.js";
|
|
5
|
+
import { useHeightVar as r } from "../utils/useHeightVar.js";
|
|
6
|
+
import { Children as i, useRef as a } from "react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
8
|
//#region packages/tab-bar/index.tsx
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
function c({ hideFrom: n = "md", className: s, children: c, ref: l, ...u }) {
|
|
10
|
+
let d = a(null);
|
|
11
|
+
return r(d, "--zen-tab-bar-height"), /* @__PURE__ */ o("nav", {
|
|
12
|
+
ref: t(d, l),
|
|
13
|
+
className: e("zen__tab-bar glass glass-blur glow-edge fixed inset-x-0 bottom-0 z-40 rounded-none border-x-0! border-b-0! pb-[env(safe-area-inset-bottom)]", n === "sm" && "sm:hidden", n === "md" && "md:hidden", n === "lg" && "lg:hidden", s),
|
|
14
|
+
...u,
|
|
15
|
+
children: /* @__PURE__ */ o("div", {
|
|
12
16
|
className: "grid",
|
|
13
|
-
style: { gridTemplateColumns: `repeat(${
|
|
14
|
-
children:
|
|
17
|
+
style: { gridTemplateColumns: `repeat(${i.count(c)}, 1fr)` },
|
|
18
|
+
children: c
|
|
15
19
|
})
|
|
16
20
|
});
|
|
17
21
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
22
|
+
var l = e("flex flex-col items-center gap-1 py-2.5 text-2xs outline-hidden transition-colors duration-200 focus-ring focus-visible:ring-inset", "text-muted-foreground aria-[current=page]:text-primary [&_svg]:size-5 aria-[current=page]:[&_svg]:drop-shadow-[0_0_8px_oklch(var(--glow)/calc(0.8*var(--glow-k)))]");
|
|
23
|
+
function u({ icon: t, active: r, asChild: i, className: a, children: c, ...u }) {
|
|
20
24
|
let d = {
|
|
21
25
|
...u,
|
|
22
|
-
"aria-current":
|
|
23
|
-
className: e(
|
|
26
|
+
"aria-current": r ? "page" : void 0,
|
|
27
|
+
className: e(l, a)
|
|
24
28
|
};
|
|
25
|
-
return
|
|
29
|
+
return i ? (r || delete d["aria-current"], /* @__PURE__ */ o(n, {
|
|
26
30
|
...d,
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
before: t,
|
|
32
|
+
children: c
|
|
33
|
+
})) : /* @__PURE__ */ s("a", {
|
|
29
34
|
...d,
|
|
30
|
-
children: [
|
|
35
|
+
children: [t, c]
|
|
31
36
|
});
|
|
32
37
|
}
|
|
33
38
|
//#endregion
|
|
34
|
-
export {
|
|
39
|
+
export { u as TabBarItem, c as default };
|
package/dist/table/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMessages as e } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as t } from "../utils/cx.js";
|
|
4
4
|
import { reducedMotion as n } from "../utils/motion.js";
|
|
5
5
|
import r from "../icons/chevron-down.js";
|
|
6
6
|
import i from "../icons/chevron-up.js";
|
|
@@ -9,7 +9,7 @@ import { TableSwipeAction as l, TableSwipeRow as u } from "./swipe.js";
|
|
|
9
9
|
import { useCallback as d, useEffect as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
10
10
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
11
11
|
//#region packages/table/index.tsx
|
|
12
|
-
function y({ label:
|
|
12
|
+
function y({ label: e, className: n, ref: r, onScroll: i, ...a }) {
|
|
13
13
|
let o = h(null), s = d(() => {
|
|
14
14
|
let e = o.current;
|
|
15
15
|
if (!e) return;
|
|
@@ -23,7 +23,7 @@ function y({ label: t, className: n, ref: r, onScroll: i, ...a }) {
|
|
|
23
23
|
let t = typeof ResizeObserver > "u" ? null : new ResizeObserver(s);
|
|
24
24
|
return t?.observe(e), e.firstElementChild && t?.observe(e.firstElementChild), () => t?.disconnect();
|
|
25
25
|
}, [s]), /* @__PURE__ */ _("div", {
|
|
26
|
-
className:
|
|
26
|
+
className: t("zen__table-panel glass glow-edge isolate flex flex-col overflow-hidden rounded-xl", n),
|
|
27
27
|
children: /* @__PURE__ */ _("div", {
|
|
28
28
|
ref: (e) => {
|
|
29
29
|
o.current = e, typeof r == "function" ? r(e) : r && (r.current = e);
|
|
@@ -31,23 +31,23 @@ function y({ label: t, className: n, ref: r, onScroll: i, ...a }) {
|
|
|
31
31
|
onScroll: (e) => {
|
|
32
32
|
s(), i?.(e);
|
|
33
33
|
},
|
|
34
|
-
role:
|
|
35
|
-
"aria-label":
|
|
36
|
-
tabIndex:
|
|
34
|
+
role: e ? "region" : void 0,
|
|
35
|
+
"aria-label": e,
|
|
36
|
+
tabIndex: e ? 0 : void 0,
|
|
37
37
|
className: "zen__table-container focus-ring relative min-h-0 overflow-auto rounded-[inherit] outline-hidden will-change-scroll focus-visible:ring-inset",
|
|
38
38
|
...a
|
|
39
39
|
})
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function b({ className:
|
|
42
|
+
function b({ className: e, ...n }) {
|
|
43
43
|
return /* @__PURE__ */ _("table", {
|
|
44
|
-
className:
|
|
44
|
+
className: t("zen__table w-full border-separate border-spacing-0 text-sm", e),
|
|
45
45
|
...n
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
function x({ className:
|
|
48
|
+
function x({ className: e, ...n }) {
|
|
49
49
|
return /* @__PURE__ */ _("thead", {
|
|
50
|
-
className:
|
|
50
|
+
className: t("zen__sticky-top sticky top-0 z-20", e),
|
|
51
51
|
...n
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -113,29 +113,29 @@ var w = typeof window > "u" ? f : p, T = {
|
|
|
113
113
|
duration: 260,
|
|
114
114
|
easing: "ease-out"
|
|
115
115
|
};
|
|
116
|
-
function O({ className:
|
|
116
|
+
function O({ className: e, ...n }) {
|
|
117
117
|
return /* @__PURE__ */ _("tfoot", {
|
|
118
|
-
className:
|
|
118
|
+
className: t("zen__sticky-bottom sticky bottom-0 z-20", e),
|
|
119
119
|
...n
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
function k({ selected:
|
|
122
|
+
function k({ selected: e, className: n, ...r }) {
|
|
123
123
|
return /* @__PURE__ */ _("tr", {
|
|
124
|
-
"data-selected":
|
|
125
|
-
className:
|
|
124
|
+
"data-selected": e || void 0,
|
|
125
|
+
className: t("group", n),
|
|
126
126
|
...r
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function A({ numeric:
|
|
129
|
+
function A({ numeric: e, sticky: n, sortDirection: a, onSort: o, scope: s = "col", className: c, children: l, ...u }) {
|
|
130
130
|
return /* @__PURE__ */ _("th", {
|
|
131
131
|
scope: s,
|
|
132
132
|
"aria-sort": a === "asc" ? "ascending" : a === "desc" ? "descending" : void 0,
|
|
133
|
-
className:
|
|
133
|
+
className: t("border-tint/[0.07] text-muted-foreground border-b px-3 py-2.5 align-middle text-xs leading-5 font-medium tracking-wider whitespace-nowrap uppercase", n === "start" && "zen__sticky-start sticky start-0 z-10", e ? "text-end" : "text-start", c),
|
|
134
134
|
...u,
|
|
135
135
|
children: o ? /* @__PURE__ */ v("button", {
|
|
136
136
|
type: "button",
|
|
137
137
|
onClick: o,
|
|
138
|
-
className:
|
|
138
|
+
className: t("hover:text-foreground touch-target inline-flex cursor-pointer items-center gap-1 align-middle leading-5 tracking-wider uppercase", e && "flex-row-reverse"),
|
|
139
139
|
children: [l, /* @__PURE__ */ _("span", {
|
|
140
140
|
"aria-hidden": !0,
|
|
141
141
|
className: "inline-flex w-3",
|
|
@@ -150,15 +150,15 @@ function A({ numeric: t, sticky: n, sortDirection: a, onSort: o, scope: s = "col
|
|
|
150
150
|
}) : l
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
function j({ numeric:
|
|
153
|
+
function j({ numeric: e, sticky: n, className: r, ...i }) {
|
|
154
154
|
return /* @__PURE__ */ _("td", {
|
|
155
|
-
className:
|
|
155
|
+
className: t("border-tint/[0.045] border-b px-3 py-2.5 transition-colors duration-150", "group-hover:[background-image:linear-gradient(oklch(var(--tint)/0.035),oklch(var(--tint)/0.035))]", "group-data-selected:[background-image:linear-gradient(oklch(var(--primary)/0.09),oklch(var(--primary)/0.09))]", n === "start" && "zen__sticky-start sticky start-0 z-10 shadow-[inset_-1px_0_0_oklch(var(--tint)/0.06)] rtl:shadow-[inset_1px_0_0_oklch(var(--tint)/0.06)]", e && "text-end tabular-nums", r),
|
|
156
156
|
...i
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
-
function M({ numeric:
|
|
159
|
+
function M({ numeric: e, sticky: n, className: r, ...i }) {
|
|
160
160
|
return /* @__PURE__ */ _("td", {
|
|
161
|
-
className:
|
|
161
|
+
className: t("border-tint/[0.07] h-9 border-t px-3 font-medium whitespace-nowrap", n === "start" && "zen__sticky-start sticky start-0 z-10 shadow-[inset_-1px_0_0_oklch(var(--tint)/0.06)] rtl:shadow-[inset_1px_0_0_oklch(var(--tint)/0.06)]", e && "text-end tabular-nums", r),
|
|
162
162
|
...i
|
|
163
163
|
});
|
|
164
164
|
}
|
|
@@ -176,10 +176,10 @@ function N({ height: e, colSpan: t }) {
|
|
|
176
176
|
})
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
function P({ colSpan:
|
|
180
|
-
let r =
|
|
179
|
+
function P({ colSpan: t, children: n }) {
|
|
180
|
+
let r = e();
|
|
181
181
|
return /* @__PURE__ */ _("tr", { children: /* @__PURE__ */ _("td", {
|
|
182
|
-
colSpan:
|
|
182
|
+
colSpan: t,
|
|
183
183
|
className: "text-muted-foreground px-3 py-8 text-center",
|
|
184
184
|
children: n ?? r.nothingHere
|
|
185
185
|
}) });
|