@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.
Files changed (225) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/README.md +16 -1
  3. package/dist/animated-number/index.js +14 -14
  4. package/dist/breadcrumbs/index.js +14 -14
  5. package/dist/calendar/index.js +29 -29
  6. package/dist/calendar-heatmap/index.js +12 -12
  7. package/dist/canvas/index.js +19 -19
  8. package/dist/carousel/index.d.ts.map +1 -1
  9. package/dist/carousel/index.js +29 -29
  10. package/dist/chart/index.js +7 -7
  11. package/dist/code-block/index.js +5 -5
  12. package/dist/collapse/index.js +6 -6
  13. package/dist/color-picker/index.js +10 -10
  14. package/dist/combobox/index.js +61 -61
  15. package/dist/command-palette/index.js +5 -5
  16. package/dist/confirm-dialog/index.js +4 -4
  17. package/dist/date-picker/index.js +15 -15
  18. package/dist/dialog/index.d.ts.map +1 -1
  19. package/dist/dialog/index.js +45 -65
  20. package/dist/docs/README.md +205 -0
  21. package/dist/docs/accordion.md +122 -0
  22. package/dist/docs/alert.md +69 -0
  23. package/dist/docs/animated-number.md +105 -0
  24. package/dist/docs/avatar.md +91 -0
  25. package/dist/docs/backdrop.md +94 -0
  26. package/dist/docs/badge.md +37 -0
  27. package/dist/docs/breadcrumbs.md +44 -0
  28. package/dist/docs/button-group.md +76 -0
  29. package/dist/docs/button.md +131 -0
  30. package/dist/docs/calendar-heatmap.md +73 -0
  31. package/dist/docs/calendar.md +101 -0
  32. package/dist/docs/canvas.md +584 -0
  33. package/dist/docs/card.md +180 -0
  34. package/dist/docs/carousel.md +162 -0
  35. package/dist/docs/chart.md +325 -0
  36. package/dist/docs/checkbox.md +88 -0
  37. package/dist/docs/chip.md +52 -0
  38. package/dist/docs/code-block.md +116 -0
  39. package/dist/docs/code-input.md +52 -0
  40. package/dist/docs/collapse.md +46 -0
  41. package/dist/docs/color-picker.md +145 -0
  42. package/dist/docs/combobox.md +208 -0
  43. package/dist/docs/command-palette.md +65 -0
  44. package/dist/docs/date-picker.md +167 -0
  45. package/dist/docs/dialog.md +271 -0
  46. package/dist/docs/disclosure.md +88 -0
  47. package/dist/docs/editable-cell.md +90 -0
  48. package/dist/docs/empty-state.md +46 -0
  49. package/dist/docs/field.md +82 -0
  50. package/dist/docs/file-drop.md +44 -0
  51. package/dist/docs/filter-bar.md +66 -0
  52. package/dist/docs/header.md +51 -0
  53. package/dist/docs/hover-card.md +110 -0
  54. package/dist/docs/icon-picker.md +65 -0
  55. package/dist/docs/input-group.md +89 -0
  56. package/dist/docs/input.md +33 -0
  57. package/dist/docs/inset.md +57 -0
  58. package/dist/docs/kbd.md +34 -0
  59. package/dist/docs/keypad.md +51 -0
  60. package/dist/docs/load-more.md +66 -0
  61. package/dist/docs/locale-provider.md +99 -0
  62. package/dist/docs/marquee.md +86 -0
  63. package/dist/docs/menu.md +456 -0
  64. package/dist/docs/meter.md +102 -0
  65. package/dist/docs/money-input.md +169 -0
  66. package/dist/docs/month-picker.md +80 -0
  67. package/dist/docs/navigation-menu.md +157 -0
  68. package/dist/docs/number-field.md +129 -0
  69. package/dist/docs/page-header.md +44 -0
  70. package/dist/docs/page-transition.md +93 -0
  71. package/dist/docs/pagination.md +42 -0
  72. package/dist/docs/pills.md +85 -0
  73. package/dist/docs/player-bar.md +158 -0
  74. package/dist/docs/popover.md +200 -0
  75. package/dist/docs/progress-ring.md +70 -0
  76. package/dist/docs/radio-cards.md +82 -0
  77. package/dist/docs/radio-group.md +86 -0
  78. package/dist/docs/range-slider.md +64 -0
  79. package/dist/docs/repeat-picker.md +44 -0
  80. package/dist/docs/resizable.md +107 -0
  81. package/dist/docs/seek-bar.md +97 -0
  82. package/dist/docs/segmented.md +89 -0
  83. package/dist/docs/select.md +148 -0
  84. package/dist/docs/separator.md +76 -0
  85. package/dist/docs/side-nav.md +75 -0
  86. package/dist/docs/skeleton.md +89 -0
  87. package/dist/docs/slider.md +87 -0
  88. package/dist/docs/sortable.md +244 -0
  89. package/dist/docs/sparkline.md +56 -0
  90. package/dist/docs/spinner.md +69 -0
  91. package/dist/docs/status-pill.md +81 -0
  92. package/dist/docs/stepper.md +59 -0
  93. package/dist/docs/tab-bar.md +78 -0
  94. package/dist/docs/table-of-contents.md +43 -0
  95. package/dist/docs/table.md +714 -0
  96. package/dist/docs/tabs.md +140 -0
  97. package/dist/docs/tag-input.md +45 -0
  98. package/dist/docs/textarea.md +25 -0
  99. package/dist/docs/theme-toggle.md +85 -0
  100. package/dist/docs/theming.md +193 -0
  101. package/dist/docs/time-field.md +71 -0
  102. package/dist/docs/timeline.md +50 -0
  103. package/dist/docs/toast.md +53 -0
  104. package/dist/docs/toggle-group.md +83 -0
  105. package/dist/docs/toggle.md +38 -0
  106. package/dist/docs/toolbar.md +97 -0
  107. package/dist/docs/tooltip.md +102 -0
  108. package/dist/docs/tree.md +295 -0
  109. package/dist/docs/trend.md +50 -0
  110. package/dist/filter-bar/index.js +6 -6
  111. package/dist/header/index.js +6 -6
  112. package/dist/icon-picker/index.js +5 -5
  113. package/dist/icons/arrow-path.d.ts +3 -0
  114. package/dist/icons/arrow-path.d.ts.map +1 -0
  115. package/dist/icons/arrows-right-left.d.ts +3 -0
  116. package/dist/icons/arrows-right-left.d.ts.map +1 -0
  117. package/dist/icons/backward.d.ts +3 -0
  118. package/dist/icons/backward.d.ts.map +1 -0
  119. package/dist/icons/forward.d.ts +3 -0
  120. package/dist/icons/forward.d.ts.map +1 -0
  121. package/dist/icons/heart-solid.d.ts +3 -0
  122. package/dist/icons/heart-solid.d.ts.map +1 -0
  123. package/dist/icons/heart.d.ts +3 -0
  124. package/dist/icons/heart.d.ts.map +1 -0
  125. package/dist/icons/musical-note.d.ts +3 -0
  126. package/dist/icons/musical-note.d.ts.map +1 -0
  127. package/dist/icons/pause.d.ts +3 -0
  128. package/dist/icons/pause.d.ts.map +1 -0
  129. package/dist/icons/play.d.ts +3 -0
  130. package/dist/icons/play.d.ts.map +1 -0
  131. package/dist/icons/queue-list.d.ts +3 -0
  132. package/dist/icons/queue-list.d.ts.map +1 -0
  133. package/dist/icons/speaker-wave.d.ts +3 -0
  134. package/dist/icons/speaker-wave.d.ts.map +1 -0
  135. package/dist/icons/speaker-x-mark.d.ts +3 -0
  136. package/dist/icons/speaker-x-mark.d.ts.map +1 -0
  137. package/dist/index.d.ts +7 -1
  138. package/dist/index.d.ts.map +1 -1
  139. package/dist/keypad/index.js +5 -5
  140. package/dist/lib.js +86 -80
  141. package/dist/load-more/index.js +5 -5
  142. package/dist/marquee/index.d.ts +15 -0
  143. package/dist/marquee/index.d.ts.map +1 -0
  144. package/dist/marquee/index.js +90 -0
  145. package/dist/menu/index.d.ts +7 -1
  146. package/dist/menu/index.d.ts.map +1 -1
  147. package/dist/menu/index.js +222 -178
  148. package/dist/money-input/index.js +54 -54
  149. package/dist/month-picker/index.js +11 -11
  150. package/dist/number-field/index.js +5 -5
  151. package/dist/pagination/index.js +12 -12
  152. package/dist/player-bar/index.d.ts +11 -0
  153. package/dist/player-bar/index.d.ts.map +1 -0
  154. package/dist/player-bar/index.js +17 -0
  155. package/dist/radio-cards/index.d.ts +2 -1
  156. package/dist/radio-cards/index.d.ts.map +1 -1
  157. package/dist/radio-cards/index.js +3 -3
  158. package/dist/range-slider/index.js +11 -11
  159. package/dist/repeat-picker/index.js +5 -5
  160. package/dist/resizable/index.js +22 -22
  161. package/dist/seek-bar/index.d.ts +26 -0
  162. package/dist/seek-bar/index.d.ts.map +1 -0
  163. package/dist/seek-bar/index.js +121 -0
  164. package/dist/segmented/index.d.ts +3 -2
  165. package/dist/segmented/index.d.ts.map +1 -1
  166. package/dist/segmented/index.js +19 -18
  167. package/dist/select/index.js +21 -21
  168. package/dist/slider/index.d.ts +2 -1
  169. package/dist/slider/index.d.ts.map +1 -1
  170. package/dist/sortable/index.d.ts +13 -1
  171. package/dist/sortable/index.d.ts.map +1 -1
  172. package/dist/sortable/index.js +74 -55
  173. package/dist/sortable/shared.js +14 -14
  174. package/dist/sortable/tree.js +17 -17
  175. package/dist/sparkline/index.js +4 -4
  176. package/dist/stepper/index.js +13 -13
  177. package/dist/tab-bar/index.d.ts +4 -2
  178. package/dist/tab-bar/index.d.ts.map +1 -1
  179. package/dist/tab-bar/index.js +24 -19
  180. package/dist/table/index.js +26 -26
  181. package/dist/table/selection.js +9 -9
  182. package/dist/table-of-contents/index.js +11 -11
  183. package/dist/tag-input/index.js +5 -5
  184. package/dist/textarea/index.d.ts +6 -2
  185. package/dist/textarea/index.d.ts.map +1 -1
  186. package/dist/textarea/index.js +2 -1
  187. package/dist/theme-toggle/index.js +4 -4
  188. package/dist/theme.css +143 -0
  189. package/dist/time-field/index.js +21 -21
  190. package/dist/toast/index.d.ts.map +1 -1
  191. package/dist/toast/index.js +41 -41
  192. package/dist/tooltip/index.d.ts +9 -3
  193. package/dist/tooltip/index.d.ts.map +1 -1
  194. package/dist/tooltip/index.js +19 -16
  195. package/dist/tree/index.js +34 -34
  196. package/dist/trend/index.js +5 -5
  197. package/dist/utils/duration.d.ts +3 -0
  198. package/dist/utils/duration.d.ts.map +1 -0
  199. package/dist/utils/duration.js +7 -0
  200. package/dist/utils/messages.d.ts +3 -0
  201. package/dist/utils/messages.d.ts.map +1 -1
  202. package/dist/utils/messages.js +4 -1
  203. package/dist/utils/slot.d.ts +5 -2
  204. package/dist/utils/slot.d.ts.map +1 -1
  205. package/dist/utils/slot.js +16 -11
  206. package/dist/utils/swipe.d.ts +7 -0
  207. package/dist/utils/swipe.d.ts.map +1 -1
  208. package/dist/utils/swipe.js +45 -25
  209. package/dist/utils/useAnchoredPopup.d.ts +2 -1
  210. package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
  211. package/dist/utils/useAnchoredPopup.js +10 -5
  212. package/dist/utils/useHeightVar.d.ts +7 -0
  213. package/dist/utils/useHeightVar.d.ts.map +1 -0
  214. package/dist/utils/useHeightVar.js +17 -0
  215. package/dist/utils/useMediaPlayer.d.ts +38 -0
  216. package/dist/utils/useMediaPlayer.d.ts.map +1 -0
  217. package/dist/utils/useMediaPlayer.js +91 -0
  218. package/dist/utils/useMediaSession.d.ts +24 -0
  219. package/dist/utils/useMediaSession.d.ts.map +1 -0
  220. package/dist/utils/useMediaSession.js +76 -0
  221. package/dist/utils/useVirtualList.d.ts +6 -1
  222. package/dist/utils/useVirtualList.d.ts.map +1 -1
  223. package/dist/utils/useVirtualList.js +12 -12
  224. package/dist/zen.css +1 -1
  225. package/package.json +4 -2
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { useMergedRefs as t } from "../utils/refs.js";
4
- import { Slot as n } from "../utils/slot.js";
5
- import { useMessages as r } from "../locale-provider/index.js";
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, asChild: p, className: m, children: h, ref: g, ...C }) {
17
- let w = _(null), T = t(w, g), [E, D] = v(null), O = r(), { say: k, region: A } = f(w), j = _(null), M = _(null), N = () => [...w.current?.querySelectorAll(":scope > [data-sortable-id]") ?? []], P = (e) => {
18
- j.current = d(N()), o(e);
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 = j.current;
22
- j.current = null, e && l(N(), e);
23
- }, [a]);
24
- let F = (e, t) => {
25
- if (e.button !== 0 || E) return;
26
- let n = N(), r = n.findIndex((e) => e.dataset.sortableId === t), i = n[r];
27
- if (!i) return;
28
- e.preventDefault();
29
- let o = e.currentTarget;
30
- o.setPointerCapture?.(e.pointerId);
31
- let f = c(w.current), p = f.scrollTop, m = e.clientY, h = n.map((e) => e.getBoundingClientRect()), g = h.length > 1 ? h[1].top - h[0].bottom : 0, _ = h[r].height + g, v = h.map((e) => e.top + e.height / 2), y = r, b = e.clientY;
32
- i.dataset.dragging = "", w.current.dataset.sorting = "";
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 - m + f.scrollTop - p;
35
- u(i, e);
36
- let t = v[r] + e, a = y;
37
- for (y = r; y < n.length - 1 && t > v[y + 1];) y++;
38
- for (; y > 0 && t < v[y - 1];) y--;
39
- y !== a && navigator.vibrate?.(5), n.forEach((e, t) => {
40
- if (t === r) return;
41
- let n = r < t && t <= y ? -_ : y <= t && t < r ? _ : 0;
42
- u(e, n);
43
- });
44
- }, C = s(f, x), T = (t) => {
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
- }, D = (t) => {
47
- t.pointerId === e.pointerId && (o.removeEventListener("pointermove", T), o.removeEventListener("pointerup", D), o.removeEventListener("pointercancel", D), C.stop(), delete i.dataset.dragging, delete w.current?.dataset.sorting, t.type === "pointerup" && y !== r ? P(S(a, r, y)) : l(n, d(n)));
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
- o.addEventListener("pointermove", T), o.addEventListener("pointerup", D), o.addEventListener("pointercancel", D);
50
- }, I = (e, t, n) => {
51
- let r = a.indexOf(t), i = O.place(r + 1, a.length);
52
- if (e.key === " " || e.key === "Enter") e.preventDefault(), E === t ? (D(null), M.current = null, k(O.dropped(n, i))) : E || (D(t), M.current = a, k(O.pickedUp(n, i)));
53
- else if (E === t && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
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
- P(S(a, r, t)), k(O.movedTo(n, O.place(t + 1, a.length)));
58
- } else if (E === t && e.key === "Escape") {
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 = M.current ?? a;
61
- D(null), M.current = null, r !== a && P([...r]), k(O.putBack(n, O.place(r.indexOf(t) + 1, r.length)));
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
- }, L = {
64
- ...C,
65
- ref: T
82
+ }, B = {
83
+ ...T,
84
+ ref: D
66
85
  };
67
86
  return /* @__PURE__ */ b(i.Provider, {
68
87
  value: {
69
- grab: F,
70
- key: I,
71
- lifted: E
88
+ grab: R,
89
+ key: z,
90
+ lifted: O
72
91
  },
73
- children: [p ? /* @__PURE__ */ y(n, {
74
- ...L,
75
- className: e("zen__sortable", m),
76
- children: h
92
+ children: [h ? /* @__PURE__ */ y(r, {
93
+ ...B,
94
+ className: t("zen__sortable", g),
95
+ children: C
77
96
  }) : /* @__PURE__ */ y("ul", {
78
- ...L,
79
- className: e("zen__sortable relative flex flex-col", m),
80
- children: h
81
- }), A]
97
+ ...B,
98
+ className: t("zen__sortable relative flex flex-col", g),
99
+ children: C
100
+ }), M]
82
101
  });
83
102
  }
84
103
  //#endregion
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { Slot as t } from "../utils/slot.js";
4
- import { useMessages as n } from "../locale-provider/index.js";
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: n, label: r, asChild: i, className: a, ...o }) {
61
+ function x({ id: e, label: r, asChild: i, className: a, ...o }) {
62
62
  let { lifted: s } = p("SortableItem");
63
- return /* @__PURE__ */ c(i ? t : "li", {
64
- "data-sortable-id": n,
63
+ return /* @__PURE__ */ c(i ? n : "li", {
64
+ "data-sortable-id": e,
65
65
  "data-sortable-label": r,
66
- "data-lifted": s === n || void 0,
67
- className: e("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),
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: t, label: r, className: i, children: a, ...o }) {
72
- let { grab: s, key: l, lifted: u } = p("SortableHandle"), d = n();
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 === t,
78
- onPointerDown: (e) => s(e, t),
79
- onKeyDown: (e) => l(e, t, r),
80
- className: e("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),
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,
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { readingKey as t } from "../utils/direction.js";
4
- import { useMergedRefs as n } from "../utils/refs.js";
5
- import { Slot as r } from "../utils/slot.js";
6
- import { useMessages as i } from "../locale-provider/index.js";
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 = n(F, N), [L, R] = b(null), z = i(), { 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) => {
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, n, r) => {
76
+ }, Q = (e, t, r) => {
77
77
  if (e.key === " " || e.key === "Enter") {
78
- e.preventDefault(), L === n ? (R(null), W.current = null, B(z.dropped(r, Y(_, n)))) : L || (R(n), W.current = _, B(z.pickedUp(r, Y(_, n))));
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 !== n) return;
81
+ if (L !== t) return;
82
82
  if (e.key === "Escape") {
83
83
  e.preventDefault();
84
- let t = W.current ?? _;
85
- R(null), W.current = null, t !== _ && q(t), B(z.putBack(r, Y(t, n)));
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 = t(e.key, e.currentTarget);
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(n), o = a.slots.find((e) => T(e, a.place));
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, n)));
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(r, {
119
+ children: [A ? /* @__PURE__ */ x(i, {
120
120
  ...$,
121
- className: e("zen__sortable", j),
121
+ className: t("zen__sortable", j),
122
122
  children: M
123
123
  }) : /* @__PURE__ */ x("ul", {
124
124
  ...$,
125
- className: e("zen__sortable relative flex flex-col", j),
125
+ className: t("zen__sortable relative flex flex-col", j),
126
126
  children: M
127
127
  }), V]
128
128
  });
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { useMessages as t } from "../locale-provider/index.js";
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 = t(), h = r(), g = i(null), _ = n(g);
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: e("zen__sparkline h-8 w-24 overflow-visible", d),
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", {
@@ -1,17 +1,17 @@
1
1
  "use client";
2
- import e from "../icons/micro/check.js";
3
- import { cx as t } from "../utils/cx.js";
4
- import { useMessages as n } from "../locale-provider/index.js";
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 = n(), p = u ?? f.progress, m = r.toArray(l).filter(i);
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: t("zen__stepper flex w-full items-start", c),
12
+ className: n("zen__stepper flex w-full items-start", c),
13
13
  ...d,
14
- children: m.map((n, r) => {
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: t("bg-primary ease-out-soft block h-full origin-left transition-transform rtl:origin-right duration-500", i === "upcoming" && "scale-x-0") })
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: t("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(e, { className: "size-3.5" }) : r + 1
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
- n,
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
- }, n.key ?? r);
37
+ }, e.key ?? r);
38
38
  })
39
39
  });
40
40
  }
41
- function c({ description: e, className: n, children: r }) {
41
+ function c({ description: e, className: t, children: r }) {
42
42
  return /* @__PURE__ */ o("span", {
43
- className: t("flex flex-col gap-0.5 px-1", n),
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
@@ -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 icon and label) instead of rendering an <a>. */
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":"AAEA,OAAO,EAAY,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAiB5F;AAOD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,+BAYlG;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,6GAA6G;IAC7G,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
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"}
@@ -1,34 +1,39 @@
1
1
  "use client";
2
2
  import { cx as e } from "../utils/cx.js";
3
- import { Slot as t } from "../utils/slot.js";
4
- import { Children as n } from "react";
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
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 a({ hideFrom: t = "md", className: i, children: a, ...o }) {
8
- return /* @__PURE__ */ r("nav", {
9
- 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)]", t === "sm" && "sm:hidden", t === "md" && "md:hidden", t === "lg" && "lg:hidden", i),
10
- ...o,
11
- children: /* @__PURE__ */ r("div", {
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(${n.count(a)}, 1fr)` },
14
- children: a
17
+ style: { gridTemplateColumns: `repeat(${i.count(c)}, 1fr)` },
18
+ children: c
15
19
  })
16
20
  });
17
21
  }
18
- var o = 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)))]");
19
- function s({ icon: n, active: a, asChild: s, className: c, children: l, ...u }) {
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": a ? "page" : void 0,
23
- className: e(o, c)
26
+ "aria-current": r ? "page" : void 0,
27
+ className: e(l, a)
24
28
  };
25
- return s ? (a || delete d["aria-current"], /* @__PURE__ */ r(t, {
29
+ return i ? (r || delete d["aria-current"], /* @__PURE__ */ o(n, {
26
30
  ...d,
27
- children: l
28
- })) : /* @__PURE__ */ i("a", {
31
+ before: t,
32
+ children: c
33
+ })) : /* @__PURE__ */ s("a", {
29
34
  ...d,
30
- children: [n, l]
35
+ children: [t, c]
31
36
  });
32
37
  }
33
38
  //#endregion
34
- export { s as TabBarItem, a as default };
39
+ export { u as TabBarItem, c as default };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { useMessages as t } from "../locale-provider/index.js";
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: t, className: n, ref: r, onScroll: i, ...a }) {
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: e("zen__table-panel glass glow-edge isolate flex flex-col overflow-hidden rounded-xl", n),
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: t ? "region" : void 0,
35
- "aria-label": t,
36
- tabIndex: t ? 0 : void 0,
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: t, ...n }) {
42
+ function b({ className: e, ...n }) {
43
43
  return /* @__PURE__ */ _("table", {
44
- className: e("zen__table w-full border-separate border-spacing-0 text-sm", t),
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: t, ...n }) {
48
+ function x({ className: e, ...n }) {
49
49
  return /* @__PURE__ */ _("thead", {
50
- className: e("zen__sticky-top sticky top-0 z-20", t),
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: t, ...n }) {
116
+ function O({ className: e, ...n }) {
117
117
  return /* @__PURE__ */ _("tfoot", {
118
- className: e("zen__sticky-bottom sticky bottom-0 z-20", t),
118
+ className: t("zen__sticky-bottom sticky bottom-0 z-20", e),
119
119
  ...n
120
120
  });
121
121
  }
122
- function k({ selected: t, className: n, ...r }) {
122
+ function k({ selected: e, className: n, ...r }) {
123
123
  return /* @__PURE__ */ _("tr", {
124
- "data-selected": t || void 0,
125
- className: e("group", n),
124
+ "data-selected": e || void 0,
125
+ className: t("group", n),
126
126
  ...r
127
127
  });
128
128
  }
129
- function A({ numeric: t, sticky: n, sortDirection: a, onSort: o, scope: s = "col", className: c, children: l, ...u }) {
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: e("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", t ? "text-end" : "text-start", c),
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: e("hover:text-foreground touch-target inline-flex cursor-pointer items-center gap-1 align-middle leading-5 tracking-wider uppercase", t && "flex-row-reverse"),
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: t, sticky: n, className: r, ...i }) {
153
+ function j({ numeric: e, sticky: n, className: r, ...i }) {
154
154
  return /* @__PURE__ */ _("td", {
155
- className: e("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)]", t && "text-end tabular-nums", r),
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: t, sticky: n, className: r, ...i }) {
159
+ function M({ numeric: e, sticky: n, className: r, ...i }) {
160
160
  return /* @__PURE__ */ _("td", {
161
- className: e("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)]", t && "text-end tabular-nums", r),
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: e, children: n }) {
180
- let r = t();
179
+ function P({ colSpan: t, children: n }) {
180
+ let r = e();
181
181
  return /* @__PURE__ */ _("tr", { children: /* @__PURE__ */ _("td", {
182
- colSpan: e,
182
+ colSpan: t,
183
183
  className: "text-muted-foreground px-3 py-8 text-center",
184
184
  children: n ?? r.nothingHere
185
185
  }) });