@rinzai/zen 0.11.0 → 0.13.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 (289) hide show
  1. package/README.md +37 -7
  2. package/dist/accordion/index.d.ts +41 -0
  3. package/dist/accordion/index.d.ts.map +1 -0
  4. package/dist/accordion/index.js +81 -0
  5. package/dist/animated-number/index.d.ts +3 -2
  6. package/dist/animated-number/index.d.ts.map +1 -1
  7. package/dist/animated-number/index.js +40 -38
  8. package/dist/avatar/index.d.ts +7 -2
  9. package/dist/avatar/index.d.ts.map +1 -1
  10. package/dist/avatar/index.js +17 -11
  11. package/dist/backdrop/index.d.ts +4 -4
  12. package/dist/backdrop/index.d.ts.map +1 -1
  13. package/dist/backdrop/index.js +41 -39
  14. package/dist/badge/index.d.ts +4 -2
  15. package/dist/badge/index.d.ts.map +1 -1
  16. package/dist/badge/index.js +20 -11
  17. package/dist/base.css +4 -0
  18. package/dist/breadcrumbs/index.d.ts +1 -1
  19. package/dist/breadcrumbs/index.d.ts.map +1 -1
  20. package/dist/breadcrumbs/index.js +25 -24
  21. package/dist/button/index.d.ts +3 -3
  22. package/dist/button/index.d.ts.map +1 -1
  23. package/dist/button/index.js +16 -11
  24. package/dist/button-group/index.d.ts +13 -0
  25. package/dist/button-group/index.d.ts.map +1 -0
  26. package/dist/button-group/index.js +14 -0
  27. package/dist/calendar/index.d.ts +15 -8
  28. package/dist/calendar/index.d.ts.map +1 -1
  29. package/dist/calendar/index.js +97 -91
  30. package/dist/calendar-heatmap/index.d.ts +7 -5
  31. package/dist/calendar-heatmap/index.d.ts.map +1 -1
  32. package/dist/calendar-heatmap/index.js +32 -30
  33. package/dist/canvas/geometry.js +0 -1
  34. package/dist/canvas/index.d.ts +6 -6
  35. package/dist/canvas/index.d.ts.map +1 -1
  36. package/dist/canvas/index.js +135 -133
  37. package/dist/carousel/index.d.ts +27 -0
  38. package/dist/carousel/index.d.ts.map +1 -0
  39. package/dist/carousel/index.js +162 -0
  40. package/dist/chart/index.d.ts +5 -4
  41. package/dist/chart/index.d.ts.map +1 -1
  42. package/dist/chart/index.js +137 -135
  43. package/dist/chart/palette.js +0 -1
  44. package/dist/checkbox/index.d.ts +3 -3
  45. package/dist/checkbox/index.d.ts.map +1 -1
  46. package/dist/checkbox/index.js +33 -30
  47. package/dist/chip/index.js +1 -1
  48. package/dist/code-block/index.d.ts.map +1 -1
  49. package/dist/code-block/index.js +27 -25
  50. package/dist/code-input/index.d.ts.map +1 -1
  51. package/dist/code-input/index.js +30 -24
  52. package/dist/collapse/index.d.ts +4 -3
  53. package/dist/collapse/index.d.ts.map +1 -1
  54. package/dist/collapse/index.js +42 -39
  55. package/dist/color-picker/index.d.ts +14 -7
  56. package/dist/color-picker/index.d.ts.map +1 -1
  57. package/dist/color-picker/index.js +139 -128
  58. package/dist/combobox/index.d.ts +14 -6
  59. package/dist/combobox/index.d.ts.map +1 -1
  60. package/dist/combobox/index.js +158 -146
  61. package/dist/command-palette/index.d.ts +4 -3
  62. package/dist/command-palette/index.d.ts.map +1 -1
  63. package/dist/command-palette/index.js +60 -57
  64. package/dist/confirm-dialog/index.d.ts +6 -7
  65. package/dist/confirm-dialog/index.d.ts.map +1 -1
  66. package/dist/confirm-dialog/index.js +20 -16
  67. package/dist/date-picker/index.d.ts +23 -14
  68. package/dist/date-picker/index.d.ts.map +1 -1
  69. package/dist/date-picker/index.js +109 -93
  70. package/dist/dialog/index.d.ts +3 -4
  71. package/dist/dialog/index.d.ts.map +1 -1
  72. package/dist/dialog/index.js +58 -55
  73. package/dist/disclosure/index.d.ts +8 -0
  74. package/dist/disclosure/index.d.ts.map +1 -1
  75. package/dist/disclosure/index.js +31 -32
  76. package/dist/editable-cell/index.d.ts +4 -5
  77. package/dist/editable-cell/index.d.ts.map +1 -1
  78. package/dist/editable-cell/index.js +23 -22
  79. package/dist/field/index.d.ts +8 -8
  80. package/dist/field/index.d.ts.map +1 -1
  81. package/dist/field/index.js +20 -18
  82. package/dist/filter-bar/index.d.ts +2 -2
  83. package/dist/filter-bar/index.d.ts.map +1 -1
  84. package/dist/filter-bar/index.js +38 -36
  85. package/dist/header/index.d.ts +1 -1
  86. package/dist/header/index.d.ts.map +1 -1
  87. package/dist/header/index.js +13 -11
  88. package/dist/hover-card/index.d.ts +32 -0
  89. package/dist/hover-card/index.d.ts.map +1 -0
  90. package/dist/hover-card/index.js +84 -0
  91. package/dist/icon-picker/index.d.ts +16 -5
  92. package/dist/icon-picker/index.d.ts.map +1 -1
  93. package/dist/icon-picker/index.js +42 -47
  94. package/dist/icons/micro/plus.d.ts +3 -0
  95. package/dist/icons/micro/plus.d.ts.map +1 -0
  96. package/dist/icons/micro/plus.js +17 -0
  97. package/dist/index.d.ts +37 -24
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/input/index.d.ts +5 -1
  100. package/dist/input/index.d.ts.map +1 -1
  101. package/dist/input/index.js +9 -9
  102. package/dist/input-group/index.d.ts +4 -1
  103. package/dist/input-group/index.d.ts.map +1 -1
  104. package/dist/input-group/index.js +14 -14
  105. package/dist/keypad/index.d.ts +9 -7
  106. package/dist/keypad/index.d.ts.map +1 -1
  107. package/dist/keypad/index.js +22 -19
  108. package/dist/lib.js +112 -97
  109. package/dist/load-more/index.d.ts +4 -2
  110. package/dist/load-more/index.d.ts.map +1 -1
  111. package/dist/load-more/index.js +26 -23
  112. package/dist/locale-provider/index.d.ts +23 -0
  113. package/dist/locale-provider/index.d.ts.map +1 -0
  114. package/dist/locale-provider/index.js +35 -0
  115. package/dist/menu/index.d.ts +62 -9
  116. package/dist/menu/index.d.ts.map +1 -1
  117. package/dist/menu/index.js +371 -128
  118. package/dist/meter/index.d.ts +2 -2
  119. package/dist/meter/index.d.ts.map +1 -1
  120. package/dist/meter/index.js +4 -4
  121. package/dist/money-input/index.d.ts +20 -10
  122. package/dist/money-input/index.d.ts.map +1 -1
  123. package/dist/money-input/index.js +199 -190
  124. package/dist/month-picker/index.d.ts +17 -10
  125. package/dist/month-picker/index.d.ts.map +1 -1
  126. package/dist/month-picker/index.js +97 -86
  127. package/dist/navigation-menu/index.d.ts +42 -0
  128. package/dist/navigation-menu/index.d.ts.map +1 -0
  129. package/dist/navigation-menu/index.js +144 -0
  130. package/dist/number-field/index.d.ts +34 -0
  131. package/dist/number-field/index.d.ts.map +1 -0
  132. package/dist/number-field/index.js +119 -0
  133. package/dist/page-header/index.d.ts +4 -3
  134. package/dist/page-header/index.d.ts.map +1 -1
  135. package/dist/page-header/index.js +2 -1
  136. package/dist/pagination/index.d.ts +1 -1
  137. package/dist/pagination/index.d.ts.map +1 -1
  138. package/dist/pagination/index.js +35 -33
  139. package/dist/progress-ring/index.d.ts +4 -3
  140. package/dist/progress-ring/index.d.ts.map +1 -1
  141. package/dist/progress-ring/index.js +11 -10
  142. package/dist/radio-cards/index.d.ts +9 -5
  143. package/dist/radio-cards/index.d.ts.map +1 -1
  144. package/dist/radio-cards/index.js +26 -24
  145. package/dist/radio-group/index.d.ts +9 -8
  146. package/dist/radio-group/index.d.ts.map +1 -1
  147. package/dist/radio-group/index.js +35 -34
  148. package/dist/range-slider/index.d.ts +10 -4
  149. package/dist/range-slider/index.d.ts.map +1 -1
  150. package/dist/range-slider/index.js +43 -31
  151. package/dist/repeat-picker/index.d.ts +13 -6
  152. package/dist/repeat-picker/index.d.ts.map +1 -1
  153. package/dist/repeat-picker/index.js +73 -61
  154. package/dist/resizable/index.d.ts +29 -0
  155. package/dist/resizable/index.d.ts.map +1 -0
  156. package/dist/resizable/index.js +135 -0
  157. package/dist/segmented/index.d.ts +8 -5
  158. package/dist/segmented/index.d.ts.map +1 -1
  159. package/dist/segmented/index.js +36 -34
  160. package/dist/select/index.d.ts +9 -3
  161. package/dist/select/index.d.ts.map +1 -1
  162. package/dist/select/index.js +99 -96
  163. package/dist/separator/index.d.ts +14 -0
  164. package/dist/separator/index.d.ts.map +1 -0
  165. package/dist/separator/index.js +15 -0
  166. package/dist/side-nav/index.js +1 -1
  167. package/dist/skeleton/index.d.ts +4 -4
  168. package/dist/skeleton/index.d.ts.map +1 -1
  169. package/dist/skeleton/index.js +4 -3
  170. package/dist/slider/index.d.ts +6 -3
  171. package/dist/slider/index.d.ts.map +1 -1
  172. package/dist/slider/index.js +29 -23
  173. package/dist/sortable/index.d.ts +10 -20
  174. package/dist/sortable/index.d.ts.map +1 -1
  175. package/dist/sortable/index.js +72 -134
  176. package/dist/sortable/shared.d.ts +56 -0
  177. package/dist/sortable/shared.d.ts.map +1 -0
  178. package/dist/sortable/shared.js +104 -0
  179. package/dist/sortable/tree-model.d.ts +46 -0
  180. package/dist/sortable/tree-model.d.ts.map +1 -0
  181. package/dist/sortable/tree-model.js +87 -0
  182. package/dist/sortable/tree.d.ts +31 -0
  183. package/dist/sortable/tree.d.ts.map +1 -0
  184. package/dist/sortable/tree.js +150 -0
  185. package/dist/sparkline/index.d.ts +1 -1
  186. package/dist/sparkline/index.d.ts.map +1 -1
  187. package/dist/sparkline/index.js +26 -25
  188. package/dist/spinner/index.d.ts +4 -3
  189. package/dist/spinner/index.d.ts.map +1 -1
  190. package/dist/spinner/index.js +2 -1
  191. package/dist/status-pill/index.d.ts.map +1 -1
  192. package/dist/status-pill/index.js +1 -1
  193. package/dist/stepper/index.d.ts +1 -1
  194. package/dist/stepper/index.d.ts.map +1 -1
  195. package/dist/stepper/index.js +31 -30
  196. package/dist/tab-bar/index.js +1 -1
  197. package/dist/table/index.d.ts +5 -5
  198. package/dist/table/index.d.ts.map +1 -1
  199. package/dist/table/index.js +66 -64
  200. package/dist/table/selection.d.ts +2 -2
  201. package/dist/table/selection.d.ts.map +1 -1
  202. package/dist/table/selection.js +41 -38
  203. package/dist/table/swipe.d.ts +1 -1
  204. package/dist/table/swipe.d.ts.map +1 -1
  205. package/dist/table/swipe.js +1 -1
  206. package/dist/table-of-contents/index.d.ts +4 -2
  207. package/dist/table-of-contents/index.d.ts.map +1 -1
  208. package/dist/table-of-contents/index.js +27 -25
  209. package/dist/tabs/index.d.ts.map +1 -1
  210. package/dist/tabs/index.js +90 -88
  211. package/dist/tag-input/index.d.ts +3 -1
  212. package/dist/tag-input/index.d.ts.map +1 -1
  213. package/dist/tag-input/index.js +61 -52
  214. package/dist/theme-toggle/index.d.ts +9 -8
  215. package/dist/theme-toggle/index.d.ts.map +1 -1
  216. package/dist/theme-toggle/index.js +30 -28
  217. package/dist/theme.css +90 -12
  218. package/dist/time-field/index.d.ts +31 -0
  219. package/dist/time-field/index.d.ts.map +1 -0
  220. package/dist/time-field/index.js +175 -0
  221. package/dist/timeline/index.js +1 -1
  222. package/dist/toast/index.d.ts +1 -1
  223. package/dist/toast/index.d.ts.map +1 -1
  224. package/dist/toast/index.js +127 -125
  225. package/dist/toggle/index.d.ts +2 -2
  226. package/dist/toggle/index.d.ts.map +1 -1
  227. package/dist/toggle/index.js +8 -6
  228. package/dist/toggle-group/index.d.ts +35 -0
  229. package/dist/toggle-group/index.d.ts.map +1 -0
  230. package/dist/toggle-group/index.js +53 -0
  231. package/dist/toolbar/index.d.ts +19 -0
  232. package/dist/toolbar/index.d.ts.map +1 -0
  233. package/dist/toolbar/index.js +36 -0
  234. package/dist/tooltip/index.d.ts.map +1 -1
  235. package/dist/tooltip/index.js +40 -74
  236. package/dist/tree/index.d.ts.map +1 -1
  237. package/dist/tree/index.js +105 -102
  238. package/dist/trend/index.d.ts +2 -2
  239. package/dist/trend/index.d.ts.map +1 -1
  240. package/dist/trend/index.js +20 -19
  241. package/dist/utils/color.js +0 -1
  242. package/dist/utils/cva.js +0 -1
  243. package/dist/utils/cx.js +0 -1
  244. package/dist/utils/date.d.ts +6 -0
  245. package/dist/utils/date.d.ts.map +1 -1
  246. package/dist/utils/date.js +1 -2
  247. package/dist/utils/direction.d.ts +7 -0
  248. package/dist/utils/direction.d.ts.map +1 -0
  249. package/dist/utils/direction.js +6 -0
  250. package/dist/utils/form-value.d.ts +15 -0
  251. package/dist/utils/form-value.d.ts.map +1 -0
  252. package/dist/utils/form-value.js +29 -0
  253. package/dist/utils/fx.js +0 -1
  254. package/dist/utils/merge.js +0 -1
  255. package/dist/utils/messages.d.ts +137 -0
  256. package/dist/utils/messages.d.ts.map +1 -0
  257. package/dist/utils/messages.js +133 -0
  258. package/dist/utils/money.js +0 -1
  259. package/dist/utils/month.js +0 -1
  260. package/dist/utils/motion.js +0 -1
  261. package/dist/utils/refs.d.ts +6 -0
  262. package/dist/utils/refs.d.ts.map +1 -0
  263. package/dist/utils/refs.js +13 -0
  264. package/dist/utils/repeat.d.ts +3 -1
  265. package/dist/utils/repeat.d.ts.map +1 -1
  266. package/dist/utils/repeat.js +28 -25
  267. package/dist/utils/roving.d.ts +17 -0
  268. package/dist/utils/roving.d.ts.map +1 -0
  269. package/dist/utils/roving.js +35 -0
  270. package/dist/utils/section-link.js +0 -1
  271. package/dist/utils/slot.d.ts.map +1 -1
  272. package/dist/utils/slot.js +7 -11
  273. package/dist/utils/status-icons.js +7 -7
  274. package/dist/utils/styles.d.ts +9 -2
  275. package/dist/utils/styles.d.ts.map +1 -1
  276. package/dist/utils/styles.js +6 -3
  277. package/dist/utils/theme-wave.js +0 -1
  278. package/dist/utils/theme.js +0 -1
  279. package/dist/utils/useAnchoredPopup.d.ts +7 -4
  280. package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
  281. package/dist/utils/useAnchoredPopup.js +18 -11
  282. package/dist/utils/useControllable.d.ts +9 -0
  283. package/dist/utils/useControllable.d.ts.map +1 -0
  284. package/dist/utils/useControllable.js +15 -0
  285. package/dist/utils/useHoverPopup.d.ts +39 -0
  286. package/dist/utils/useHoverPopup.d.ts.map +1 -0
  287. package/dist/utils/useHoverPopup.js +64 -0
  288. package/dist/zen.css +1 -1
  289. package/package.json +1 -1
@@ -1,29 +1,30 @@
1
1
  "use client";
2
2
  import { cx as e } from "../utils/cx.js";
3
- import { reducedMotion as t } from "../utils/motion.js";
4
- import n from "../icons/chevron-down.js";
5
- import r from "../icons/chevron-up.js";
6
- import { SelectionBar as i, TableSelectCell as a, TableSelectHead as o, useSelection as s } from "./selection.js";
7
- import { TableSwipeAction as c, TableSwipeRow as l } from "./swipe.js";
8
- import { useCallback as u, useEffect as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
9
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
3
+ import { useMessages as t } from "../locale-provider/index.js";
4
+ import { reducedMotion as n } from "../utils/motion.js";
5
+ import r from "../icons/chevron-down.js";
6
+ import i from "../icons/chevron-up.js";
7
+ import { SelectionBar as a, TableSelectCell as o, TableSelectHead as s, useSelection as c } from "./selection.js";
8
+ import { TableSwipeAction as l, TableSwipeRow as u } from "./swipe.js";
9
+ import { useCallback as d, useEffect as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
10
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
10
11
  //#region packages/table/index.tsx
11
- function v({ label: t, className: n, ref: r, onScroll: i, ...a }) {
12
- let o = m(null), s = u(() => {
12
+ function y({ label: t, className: n, ref: r, onScroll: i, ...a }) {
13
+ let o = h(null), s = d(() => {
13
14
  let e = o.current;
14
15
  if (!e) return;
15
16
  let t = (t, n) => n !== e.hasAttribute(t) && e.toggleAttribute(t, n);
16
- t("data-under-top", e.scrollTop > 0), t("data-under-left", e.scrollLeft > 0), t("data-under-bottom", e.scrollTop + e.clientHeight < e.scrollHeight - 1);
17
+ t("data-under-top", e.scrollTop > 0), t("data-under-start", Math.abs(e.scrollLeft) > 0), t("data-under-bottom", e.scrollTop + e.clientHeight < e.scrollHeight - 1);
17
18
  }, []);
18
- return d(() => {
19
+ return f(() => {
19
20
  let e = o.current;
20
21
  if (!e) return;
21
22
  s();
22
23
  let t = typeof ResizeObserver > "u" ? null : new ResizeObserver(s);
23
24
  return t?.observe(e), e.firstElementChild && t?.observe(e.firstElementChild), () => t?.disconnect();
24
- }, [s]), /* @__PURE__ */ g("div", {
25
+ }, [s]), /* @__PURE__ */ _("div", {
25
26
  className: e("zen__table-panel glass glow-edge isolate flex flex-col overflow-hidden rounded-xl", n),
26
- children: /* @__PURE__ */ g("div", {
27
+ children: /* @__PURE__ */ _("div", {
27
28
  ref: (e) => {
28
29
  o.current = e, typeof r == "function" ? r(e) : r && (r.current = e);
29
30
  },
@@ -33,55 +34,55 @@ function v({ label: t, className: n, ref: r, onScroll: i, ...a }) {
33
34
  role: t ? "region" : void 0,
34
35
  "aria-label": t,
35
36
  tabIndex: t ? 0 : void 0,
36
- className: "zen__table-container focus-visible:ring-ring/30 relative min-h-0 overflow-auto rounded-[inherit] outline-hidden will-change-scroll focus-visible:ring-2 focus-visible:ring-inset",
37
+ className: "zen__table-container focus-ring relative min-h-0 overflow-auto rounded-[inherit] outline-hidden will-change-scroll focus-visible:ring-inset",
37
38
  ...a
38
39
  })
39
40
  });
40
41
  }
41
- function y({ className: t, ...n }) {
42
- return /* @__PURE__ */ g("table", {
42
+ function b({ className: t, ...n }) {
43
+ return /* @__PURE__ */ _("table", {
43
44
  className: e("zen__table w-full border-separate border-spacing-0 text-sm", t),
44
45
  ...n
45
46
  });
46
47
  }
47
- function b({ className: t, ...n }) {
48
- return /* @__PURE__ */ g("thead", {
48
+ function x({ className: t, ...n }) {
49
+ return /* @__PURE__ */ _("thead", {
49
50
  className: e("zen__sticky-top sticky top-0 z-20", t),
50
51
  ...n
51
52
  });
52
53
  }
53
- function x({ ref: e, ...n }) {
54
- let r = m(null), i = m(null);
55
- return C(() => {
54
+ function S({ ref: e, ...t }) {
55
+ let r = h(null), i = h(null);
56
+ return w(() => {
56
57
  let e = r.current;
57
58
  if (!e) return;
58
- let n = [...e.rows], a = i.current;
59
- if (a && n.length === a.rows.length && n.every((e, t) => e === a.rows[t])) return;
60
- let o = new Map(n.map((e) => [e, e.offsetTop]));
59
+ let t = [...e.rows], a = i.current;
60
+ if (a && t.length === a.rows.length && t.every((e, t) => e === a.rows[t])) return;
61
+ let o = new Map(t.map((e) => [e, e.offsetTop]));
61
62
  if (i.current = {
62
- rows: n,
63
+ rows: t,
63
64
  tops: o
64
- }, !a || t() || e.querySelector("[data-zen-spacer]")) return;
65
+ }, !a || n() || e.querySelector("[data-zen-spacer]")) return;
65
66
  let s = a.rows.filter((e) => !e.isConnected), c = (e) => e.matches(".zen__tree-row-enter, .zen__tree-row-exit");
66
- if (!(n.some((e) => !a.tops.has(e) && c(e)) || s.some(c))) {
67
- if (n.some((e) => a.tops.has(e))) for (let t of s) S(t, a.tops.get(t), e, n);
68
- for (let e of n) {
67
+ if (!(t.some((e) => !a.tops.has(e) && c(e)) || s.some(c))) {
68
+ if (t.some((e) => a.tops.has(e))) for (let n of s) C(n, a.tops.get(n), e, t);
69
+ for (let e of t) {
69
70
  let t = a.tops.get(e);
70
71
  t === void 0 ? e.animate?.({
71
72
  opacity: [0, 1],
72
73
  translate: ["0 -6px", "0 0"]
73
- }, E) : t !== o.get(e) && e.animate?.({ translate: [`0 ${t - o.get(e)}px`, "0 0"] }, T);
74
+ }, D) : t !== o.get(e) && e.animate?.({ translate: [`0 ${t - o.get(e)}px`, "0 0"] }, E);
74
75
  }
75
76
  }
76
- }), /* @__PURE__ */ g("tbody", {
77
+ }), /* @__PURE__ */ _("tbody", {
77
78
  ref: (t) => {
78
79
  if (r.current = t, typeof e == "function") return e(t);
79
80
  e && (e.current = t);
80
81
  },
81
- ...n
82
+ ...t
82
83
  });
83
84
  }
84
- function S(e, t, n, r) {
85
+ function C(e, t, n, r) {
85
86
  let i = n.closest("table"), a = n.closest(".zen__table-container"), o = r.find((t) => t.cells.length === e.cells.length);
86
87
  if (!i || !a || !o) return;
87
88
  let s = a.getBoundingClientRect(), c = i.getBoundingClientRect(), l = document.createElement("table");
@@ -99,49 +100,49 @@ function S(e, t, n, r) {
99
100
  let d = l.animate?.({
100
101
  opacity: [1, 0],
101
102
  translate: ["0 0", "-12px 0"]
102
- }, w);
103
+ }, T);
103
104
  d ? d.onfinish = d.oncancel = () => l.remove() : l.remove();
104
105
  }
105
- var C = typeof window > "u" ? d : f, w = {
106
+ var w = typeof window > "u" ? f : p, T = {
106
107
  duration: 220,
107
108
  easing: "ease-in"
108
- }, T = {
109
+ }, E = {
109
110
  duration: 320,
110
111
  easing: "cubic-bezier(0.2, 0.8, 0.2, 1)"
111
- }, E = {
112
+ }, D = {
112
113
  duration: 260,
113
114
  easing: "ease-out"
114
115
  };
115
- function D({ className: t, ...n }) {
116
- return /* @__PURE__ */ g("tfoot", {
116
+ function O({ className: t, ...n }) {
117
+ return /* @__PURE__ */ _("tfoot", {
117
118
  className: e("zen__sticky-bottom sticky bottom-0 z-20", t),
118
119
  ...n
119
120
  });
120
121
  }
121
- function O({ selected: t, className: n, ...r }) {
122
- return /* @__PURE__ */ g("tr", {
122
+ function k({ selected: t, className: n, ...r }) {
123
+ return /* @__PURE__ */ _("tr", {
123
124
  "data-selected": t || void 0,
124
125
  className: e("group", n),
125
126
  ...r
126
127
  });
127
128
  }
128
- function k({ numeric: t, sticky: i, sortDirection: a, onSort: o, scope: s = "col", className: c, children: l, ...u }) {
129
- return /* @__PURE__ */ g("th", {
129
+ function A({ numeric: t, sticky: n, sortDirection: a, onSort: o, scope: s = "col", className: c, children: l, ...u }) {
130
+ return /* @__PURE__ */ _("th", {
130
131
  scope: s,
131
132
  "aria-sort": a === "asc" ? "ascending" : a === "desc" ? "descending" : void 0,
132
- 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", i === "left" && "zen__sticky-left sticky left-0 z-10", t ? "text-right" : "text-left", c),
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
134
  ...u,
134
- children: o ? /* @__PURE__ */ _("button", {
135
+ children: o ? /* @__PURE__ */ v("button", {
135
136
  type: "button",
136
137
  onClick: o,
137
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
- children: [l, /* @__PURE__ */ g("span", {
139
+ children: [l, /* @__PURE__ */ _("span", {
139
140
  "aria-hidden": !0,
140
141
  className: "inline-flex w-3",
141
- children: a === "asc" ? /* @__PURE__ */ g(r, {
142
+ children: a === "asc" ? /* @__PURE__ */ _(i, {
142
143
  className: "size-3",
143
144
  strokeWidth: 2.5
144
- }) : a === "desc" ? /* @__PURE__ */ g(n, {
145
+ }) : a === "desc" ? /* @__PURE__ */ _(r, {
145
146
  className: "size-3",
146
147
  strokeWidth: 2.5
147
148
  }) : null
@@ -149,23 +150,23 @@ function k({ numeric: t, sticky: i, sortDirection: a, onSort: o, scope: s = "col
149
150
  }) : l
150
151
  });
151
152
  }
152
- function A({ numeric: t, sticky: n, className: r, ...i }) {
153
- return /* @__PURE__ */ g("td", {
154
- 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 === "left" && "zen__sticky-left sticky left-0 z-10 shadow-[inset_-1px_0_0_oklch(var(--tint)/0.06)]", t && "text-right tabular-nums", r),
153
+ function j({ numeric: t, sticky: n, className: r, ...i }) {
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
156
  ...i
156
157
  });
157
158
  }
158
- function j({ numeric: t, sticky: n, className: r, ...i }) {
159
- return /* @__PURE__ */ g("td", {
160
- className: e("border-tint/[0.07] h-9 border-t px-3 font-medium whitespace-nowrap", n === "left" && "zen__sticky-left sticky left-0 z-10 shadow-[inset_-1px_0_0_oklch(var(--tint)/0.06)]", t && "text-right tabular-nums", r),
159
+ function M({ numeric: t, sticky: n, className: r, ...i }) {
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
162
  ...i
162
163
  });
163
164
  }
164
- function M({ height: e, colSpan: t }) {
165
- return e <= 0 ? null : /* @__PURE__ */ g("tr", {
165
+ function N({ height: e, colSpan: t }) {
166
+ return e <= 0 ? null : /* @__PURE__ */ _("tr", {
166
167
  "aria-hidden": !0,
167
168
  "data-zen-spacer": !0,
168
- children: /* @__PURE__ */ g("td", {
169
+ children: /* @__PURE__ */ _("td", {
169
170
  colSpan: t,
170
171
  style: {
171
172
  height: e,
@@ -175,17 +176,18 @@ function M({ height: e, colSpan: t }) {
175
176
  })
176
177
  });
177
178
  }
178
- function N({ colSpan: e, children: t = "Nothing here yet." }) {
179
- return /* @__PURE__ */ g("tr", { children: /* @__PURE__ */ g("td", {
179
+ function P({ colSpan: e, children: n }) {
180
+ let r = t();
181
+ return /* @__PURE__ */ _("tr", { children: /* @__PURE__ */ _("td", {
180
182
  colSpan: e,
181
183
  className: "text-muted-foreground px-3 py-8 text-center",
182
- children: t
184
+ children: n ?? r.nothingHere
183
185
  }) });
184
186
  }
185
- function P(e, t, n) {
186
- let [r, i] = h(n ?? null);
187
+ function F(e, t, n) {
188
+ let [r, i] = g(n ?? null);
187
189
  return {
188
- rows: p(() => {
190
+ rows: m(() => {
189
191
  if (!r) return e;
190
192
  let n = t[r.key], i = [...e].sort(n);
191
193
  return r.direction === "desc" ? i.reverse() : i;
@@ -209,4 +211,4 @@ function P(e, t, n) {
209
211
  };
210
212
  }
211
213
  //#endregion
212
- export { i as SelectionBar, x as TableBody, A as TableCell, v as TableContainer, N as TableEmpty, D as TableFooter, j as TableFooterCell, k as TableHead, b as TableHeader, O as TableRow, a as TableSelectCell, o as TableSelectHead, M as TableSpacerRow, c as TableSwipeAction, l as TableSwipeRow, y as default, s as useSelection, P as useSort };
214
+ export { a as SelectionBar, S as TableBody, j as TableCell, y as TableContainer, P as TableEmpty, O as TableFooter, M as TableFooterCell, A as TableHead, x as TableHeader, k as TableRow, o as TableSelectCell, s as TableSelectHead, N as TableSpacerRow, l as TableSwipeAction, u as TableSwipeRow, b as default, c as useSelection, F as useSort };
@@ -22,13 +22,13 @@ export declare function useSelection<K>(keys: readonly K[]): {
22
22
  /** A row's checkbox cell; spread `rowProps(key)` from useSelection into it. */
23
23
  export declare function TableSelectCell({ checked, onSelect, label, className, ...rest }: TableSelectCellProps): import('react').JSX.Element;
24
24
  /** The header's checkbox, for every row at once; spread `allProps()` from useSelection into it. */
25
- export declare function TableSelectHead({ checked, indeterminate, onSelect, label, className, ...rest }: TableSelectHeadProps): import('react').JSX.Element;
25
+ export declare function TableSelectHead({ checked, indeterminate, onSelect, label: labelProp, className, ...rest }: TableSelectHeadProps): import('react').JSX.Element;
26
26
  /**
27
27
  * What to do with the selected rows: their count, your actions, and a × to
28
28
  * clear the selection. Floats at the bottom of the screen while any are
29
29
  * selected (move it with className).
30
30
  */
31
- export declare function SelectionBar({ count, onClear, label, clearLabel, className, children, }: SelectionBarProps): import('react').JSX.Element | null;
31
+ export declare function SelectionBar({ count, onClear, label: labelProp, clearLabel: clearLabelProp, className, children, }: SelectionBarProps): import('react').JSX.Element | null;
32
32
  export interface TableSelectCellProps extends Omit<ComponentProps<'td'>, 'onSelect'> {
33
33
  checked: boolean;
34
34
  /** With `range` when shift was held. */
@@ -1 +1 @@
1
- {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../packages/table/selection.tsx"],"names":[],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,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAChF,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gDAAgD;IAChD,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB"}
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { cx as e } from "../utils/cx.js";
3
- import t from "../icons/micro/x-mark.js";
4
- import n from "../checkbox/index.js";
5
- import { useRef as r, useState as i } from "react";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
+ import { useMessages as t } from "../locale-provider/index.js";
4
+ import n from "../icons/micro/x-mark.js";
5
+ import r from "../checkbox/index.js";
6
+ import { useRef as i, useState as a } from "react";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
8
  //#region packages/table/selection.tsx
8
- function s(e) {
9
- let [t, n] = i(() => /* @__PURE__ */ new Set()), a = r(null), o = new Set(e), s = new Set([...t].filter((e) => o.has(e))), c = e.length > 0 && s.size === e.length, l = (e, t) => n((n) => {
9
+ function c(e) {
10
+ let [t, n] = a(() => /* @__PURE__ */ new Set()), r = i(null), o = new Set(e), s = new Set([...t].filter((e) => o.has(e))), c = e.length > 0 && s.size === e.length, l = (e, t) => n((n) => {
10
11
  let r = new Set([...n].filter((e) => o.has(e)));
11
12
  for (let n of e) t ? r.add(n) : r.delete(n);
12
13
  return r;
@@ -16,9 +17,9 @@ function s(e) {
16
17
  clear: () => n(/* @__PURE__ */ new Set()),
17
18
  rowProps: (t) => ({
18
19
  checked: s.has(t),
19
- onSelect: (n, r) => {
20
- let i = r && a.current !== null ? e.indexOf(a.current) : -1, o = e.indexOf(t);
21
- l(i === -1 ? [t] : e.slice(Math.min(i, o), Math.max(i, o) + 1), n), a.current = t;
20
+ onSelect: (n, i) => {
21
+ let a = i && r.current !== null ? e.indexOf(r.current) : -1, o = e.indexOf(t);
22
+ l(a === -1 ? [t] : e.slice(Math.min(a, o), Math.max(a, o) + 1), n), r.current = t;
22
23
  }
23
24
  }),
24
25
  allProps: () => ({
@@ -28,56 +29,58 @@ function s(e) {
28
29
  })
29
30
  };
30
31
  }
31
- function c({ checked: t, onSelect: r, label: i, className: o, ...s }) {
32
- return /* @__PURE__ */ a("td", {
33
- className: e("border-tint/[0.045] w-10 border-b py-2.5 pr-0 pl-3", o),
32
+ function l({ checked: t, onSelect: n, label: i, className: a, ...s }) {
33
+ return /* @__PURE__ */ o("td", {
34
+ className: e("border-tint/[0.045] w-10 border-b py-2.5 ps-3 pe-0", a),
34
35
  ...s,
35
- children: /* @__PURE__ */ a(n, {
36
+ children: /* @__PURE__ */ o(r, {
36
37
  "aria-label": i,
37
38
  checked: t,
38
- onClick: (e) => r(e.currentTarget.checked, e.shiftKey),
39
- onChange: () => {},
39
+ onClick: (e) => n(e.currentTarget.checked, e.shiftKey),
40
+ onCheckedChange: () => {},
40
41
  className: "touch-target grid"
41
42
  })
42
43
  });
43
44
  }
44
- function l({ checked: t, indeterminate: r, onSelect: i, label: o = "Select all", className: s, ...c }) {
45
- return /* @__PURE__ */ a("th", {
46
- className: e("w-10 py-2.5 pr-0 pl-3", s),
47
- ...c,
48
- children: /* @__PURE__ */ a(n, {
49
- "aria-label": o,
50
- checked: t,
51
- indeterminate: r,
52
- onChange: (e) => i(!r && e),
45
+ function u({ checked: n, indeterminate: i, onSelect: a, label: s, className: c, ...l }) {
46
+ let u = t(), d = s ?? u.selectAll;
47
+ return /* @__PURE__ */ o("th", {
48
+ className: e("w-10 py-2.5 ps-3 pe-0", c),
49
+ ...l,
50
+ children: /* @__PURE__ */ o(r, {
51
+ "aria-label": d,
52
+ checked: n,
53
+ indeterminate: i,
54
+ onCheckedChange: (e) => a(!i && e),
53
55
  className: "touch-target grid"
54
56
  })
55
57
  });
56
58
  }
57
- function u({ count: n, onClear: r, label: i = (e) => `${e} selected`, clearLabel: s = "Clear selection", className: c, children: l }) {
58
- return n === 0 ? null : /* @__PURE__ */ o("div", {
59
+ function d({ count: r, onClear: i, label: a, clearLabel: c, className: l, children: u }) {
60
+ let d = t(), f = a ?? d.selectedCount, p = c ?? d.clearSelection;
61
+ return r === 0 ? null : /* @__PURE__ */ s("div", {
59
62
  role: "toolbar",
60
- "aria-label": "Selection",
61
- className: e("zen__selection-bar glass glass-blur glow-edge fixed inset-x-0 bottom-6 z-40 mx-auto flex w-fit max-w-[calc(100vw-2rem)] items-center gap-2 rounded-2xl py-2 pr-2 pl-4 shadow-[0_12px_40px_-12px_oklch(0_0_0/0.6)]", c),
63
+ "aria-label": d.selection,
64
+ className: e("zen__selection-bar glass glass-blur glow-edge fixed inset-x-0 bottom-6 z-40 mx-auto flex w-fit max-w-[calc(100vw-2rem)] items-center gap-2 rounded-2xl py-2 ps-4 pe-2 shadow-[0_12px_40px_-12px_oklch(0_0_0/0.6)]", l),
62
65
  children: [
63
- /* @__PURE__ */ a("span", {
66
+ /* @__PURE__ */ o("span", {
64
67
  className: "text-sm font-medium whitespace-nowrap tabular-nums",
65
68
  "aria-live": "polite",
66
- children: i(n)
69
+ children: f(r)
67
70
  }),
68
- /* @__PURE__ */ a("span", {
71
+ /* @__PURE__ */ o("span", {
69
72
  className: "flex items-center gap-1",
70
- children: l
73
+ children: u
71
74
  }),
72
- /* @__PURE__ */ a("button", {
75
+ /* @__PURE__ */ o("button", {
73
76
  type: "button",
74
- "aria-label": s,
75
- onClick: r,
76
- className: "text-muted-foreground hover:text-foreground hover:bg-tint/10 focus-visible:ring-ring/50 touch-target grid size-8 cursor-pointer place-items-center rounded-lg outline-hidden focus-visible:ring-2",
77
- children: /* @__PURE__ */ a(t, { className: "size-4" })
77
+ "aria-label": p,
78
+ onClick: i,
79
+ className: "text-muted-foreground hover:text-foreground hover:bg-tint/10 touch-target focus-ring grid size-8 cursor-pointer place-items-center rounded-lg outline-hidden",
80
+ children: /* @__PURE__ */ o(n, { className: "size-4" })
78
81
  })
79
82
  ]
80
83
  });
81
84
  }
82
85
  //#endregion
83
- export { u as SelectionBar, c as TableSelectCell, l as TableSelectHead, s as useSelection };
86
+ export { d as SelectionBar, l as TableSelectCell, u as TableSelectHead, c as useSelection };
@@ -8,7 +8,7 @@ export declare function TableSwipeRow({ actions, ref, className, children, onCli
8
8
  /** One of a swipe row's actions: fills the row's height, flush with its end. */
9
9
  export declare function TableSwipeAction({ tone, className, ...rest }: TableSwipeActionProps): import('react').JSX.Element;
10
10
  export interface TableSwipeActionProps extends ComponentProps<'button'> {
11
- tone?: 'default' | 'destructive';
11
+ tone?: 'default' | 'negative';
12
12
  }
13
13
  export interface TableSwipeRowProps extends ComponentProps<'tr'> {
14
14
  /** What's behind the row: TableSwipeActions, e.g. Edit and Delete. */
@@ -1 +1 @@
1
- {"version":3,"file":"swipe.d.ts","sourceRoot":"","sources":["../../packages/table/swipe.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAoB,MAAM,OAAO,CAAC;AAIpE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC1B,OAAO,EACP,GAAG,EACH,SAAS,EACT,QAAQ,EACR,cAAc,EACd,MAAM,EACN,GAAG,IAAI,EACV,EAAE,kBAAkB,+BA2DpB;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,EAAE,IAAgB,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,qBAAqB,+BAc/F;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IACnE,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACpC;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,IAAI,CAAC;IAC5D,sEAAsE;IACtE,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
1
+ {"version":3,"file":"swipe.d.ts","sourceRoot":"","sources":["../../packages/table/swipe.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAoB,MAAM,OAAO,CAAC;AAIpE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC1B,OAAO,EACP,GAAG,EACH,SAAS,EACT,QAAQ,EACR,cAAc,EACd,MAAM,EACN,GAAG,IAAI,EACV,EAAE,kBAAkB,+BA2DpB;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,EAAE,IAAgB,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,qBAAqB,+BAc/F;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IACnE,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CACjC;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,IAAI,CAAC;IAC5D,sEAAsE;IACtE,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -45,7 +45,7 @@ function s({ actions: s, ref: c, className: l, children: u, onClickCapture: d, o
45
45
  function c({ tone: t = "default", className: n, ...r }) {
46
46
  return /* @__PURE__ */ a("button", {
47
47
  type: "button",
48
- className: e("focus-visible:ring-ring/60 cursor-pointer px-4 text-sm font-medium whitespace-nowrap outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-inset", t === "destructive" ? "bg-destructive/90 text-destructive-foreground hover:bg-destructive" : "bg-tint/[0.09] hover:bg-tint/[0.14]", n),
48
+ className: e(" cursor-pointer px-4 text-sm font-medium whitespace-nowrap outline-hidden transition-colors focus-ring focus-visible:ring-inset", t === "negative" ? "bg-destructive/90 text-destructive-foreground hover:bg-destructive" : "bg-tint/[0.09] hover:bg-tint/[0.14]", n),
49
49
  ...r
50
50
  });
51
51
  }
@@ -1,8 +1,9 @@
1
+ import { ComponentProps } from 'react';
1
2
  /**
2
3
  * "On this page": links to the page's headings, highlighting the section being
3
4
  * read. Items point at element ids; nested items (depth 2) are indented.
4
5
  */
5
- export default function TableOfContents({ items, title, className }: TableOfContentsProps): import('react').JSX.Element | null;
6
+ export default function TableOfContents({ items, title: titleProp, className, ...rest }: TableOfContentsProps): import('react').JSX.Element | null;
6
7
  export interface TableOfContentsItem {
7
8
  /** Id of the heading (or section) to link to. */
8
9
  id: string;
@@ -10,7 +11,8 @@ export interface TableOfContentsItem {
10
11
  /** 1 (default) or 2 for a nested entry. */
11
12
  depth?: 1 | 2;
12
13
  }
13
- export interface TableOfContentsProps {
14
+ /** Other props (data-*, an id) go on the <nav>. */
15
+ export interface TableOfContentsProps extends Omit<ComponentProps<'nav'>, 'title' | 'children'> {
14
16
  items: TableOfContentsItem[];
15
17
  /** Shown above the list, and names it. Empty: no heading shown (e.g. under a trigger that says it). */
16
18
  title?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/table-of-contents/index.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,KAAsB,EAAE,SAAS,EAAE,EAAE,oBAAoB,sCA8CzG;AAED,MAAM,WAAW,mBAAmB;IAChC,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACjC,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,uGAAuG;IACvG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/table-of-contents/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,oBAAoB,sCAgD5G;AAED,MAAM,WAAW,mBAAmB;IAChC,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,mDAAmD;AACnD,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3F,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,uGAAuG;IACvG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -1,39 +1,41 @@
1
1
  "use client";
2
2
  import { cx as e } from "../utils/cx.js";
3
- import { followSectionLink as t } from "../utils/section-link.js";
4
- import { useEffect as n, useState as r } from "react";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
3
+ import { useMessages as t } from "../locale-provider/index.js";
4
+ import { followSectionLink as n } from "../utils/section-link.js";
5
+ import { useEffect as r, useState as i } from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
7
  //#region packages/table-of-contents/index.tsx
7
- function o({ items: o, title: s = "On this page", className: c }) {
8
- let [l, u] = r();
9
- return n(() => {
8
+ function s({ items: s, title: c, className: l, ...u }) {
9
+ let d = t(), f = c ?? d.onThisPage, [p, m] = i();
10
+ return r(() => {
10
11
  if (typeof IntersectionObserver > "u") return;
11
- let e = o.map((e) => document.getElementById(e.id)).filter((e) => !!e), t = /* @__PURE__ */ new Set(), n = new IntersectionObserver((e) => {
12
+ let e = s.map((e) => document.getElementById(e.id)).filter((e) => !!e), t = /* @__PURE__ */ new Set(), n = new IntersectionObserver((e) => {
12
13
  for (let n of e) n.isIntersecting ? t.add(n.target.id) : t.delete(n.target.id);
13
- let n = o.find((e) => t.has(e.id));
14
- n && u(n.id);
14
+ let n = s.find((e) => t.has(e.id));
15
+ n && m(n.id);
15
16
  }, { rootMargin: "0px 0px -65% 0px" });
16
17
  return e.forEach((e) => n.observe(e)), () => n.disconnect();
17
- }, [o]), o.length ? /* @__PURE__ */ a("nav", {
18
- "aria-label": s || "On this page",
19
- className: e("zen__toc flex flex-col gap-3", c),
20
- children: [s && /* @__PURE__ */ i("p", {
18
+ }, [s]), s.length ? /* @__PURE__ */ o("nav", {
19
+ "aria-label": f || d.onThisPage,
20
+ ...u,
21
+ className: e("zen__toc flex flex-col gap-3", l),
22
+ children: [f && /* @__PURE__ */ a("p", {
21
23
  className: "text-muted-foreground text-2xs mt-0! tracking-widest uppercase",
22
- children: s
23
- }), /* @__PURE__ */ i("ul", {
24
+ children: f
25
+ }), /* @__PURE__ */ a("ul", {
24
26
  className: "border-tint/[0.07] flex flex-col gap-2 border-l text-sm",
25
- children: o.map((n) => /* @__PURE__ */ i("li", {
26
- className: e("-ml-px", n.depth === 2 && "pl-3"),
27
- children: /* @__PURE__ */ i("a", {
28
- href: `#${n.id}`,
29
- onClick: t,
30
- "aria-current": n.id === l ? "location" : void 0,
31
- className: e("text-muted-foreground hover:text-foreground block border-l border-transparent pl-3 transition-colors pointer-coarse:py-1.5", "aria-[current=location]:border-primary aria-[current=location]:text-foreground"),
32
- children: n.label
27
+ children: s.map((t) => /* @__PURE__ */ a("li", {
28
+ className: e("-ms-px", t.depth === 2 && "ps-3"),
29
+ children: /* @__PURE__ */ a("a", {
30
+ href: `#${t.id}`,
31
+ onClick: n,
32
+ "aria-current": t.id === p ? "location" : void 0,
33
+ className: e("text-muted-foreground hover:text-foreground block border-s border-transparent ps-3 transition-colors pointer-coarse:py-1.5", "aria-[current=location]:border-primary aria-[current=location]:text-foreground"),
34
+ children: t.label
33
35
  })
34
- }, n.id))
36
+ }, t.id))
35
37
  })]
36
38
  }) : null;
37
39
  }
38
40
  //#endregion
39
- export { o as default };
41
+ export { s as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/tabs/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EACH,cAAc,EASjB,MAAM,OAAO,CAAC;AAsBf,6GAA6G;AAC7G,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,KAAK,EAAE,YAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAuBtG;AAID;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,OAAqB,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,YAAY,+BAiC5F;AAiCD,wBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,+BA0BnE;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,sCA6BpE;AA4DD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,MAAM,MAAM,c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