@rinzai/zen 0.15.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 (78) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/animated-number/index.js +14 -14
  3. package/dist/breadcrumbs/index.js +14 -14
  4. package/dist/calendar/index.js +29 -29
  5. package/dist/calendar-heatmap/index.js +12 -12
  6. package/dist/canvas/index.js +19 -19
  7. package/dist/carousel/index.js +24 -24
  8. package/dist/chart/index.js +7 -7
  9. package/dist/code-block/index.js +5 -5
  10. package/dist/collapse/index.js +6 -6
  11. package/dist/color-picker/index.js +10 -10
  12. package/dist/combobox/index.js +61 -61
  13. package/dist/command-palette/index.js +5 -5
  14. package/dist/confirm-dialog/index.js +4 -4
  15. package/dist/date-picker/index.js +15 -15
  16. package/dist/dialog/index.d.ts.map +1 -1
  17. package/dist/dialog/index.js +45 -65
  18. package/dist/docs/README.md +4 -4
  19. package/dist/docs/locale-provider.md +1 -1
  20. package/dist/docs/menu.md +54 -1
  21. package/dist/docs/seek-bar.md +30 -1
  22. package/dist/docs/sortable.md +63 -1
  23. package/dist/docs/tooltip.md +45 -3
  24. package/dist/filter-bar/index.js +6 -6
  25. package/dist/header/index.js +6 -6
  26. package/dist/icon-picker/index.js +5 -5
  27. package/dist/keypad/index.js +5 -5
  28. package/dist/lib.js +7 -7
  29. package/dist/load-more/index.js +5 -5
  30. package/dist/menu/index.d.ts +7 -1
  31. package/dist/menu/index.d.ts.map +1 -1
  32. package/dist/menu/index.js +217 -174
  33. package/dist/money-input/index.js +54 -54
  34. package/dist/month-picker/index.js +11 -11
  35. package/dist/number-field/index.js +5 -5
  36. package/dist/pagination/index.js +12 -12
  37. package/dist/range-slider/index.js +11 -11
  38. package/dist/repeat-picker/index.js +5 -5
  39. package/dist/resizable/index.js +22 -22
  40. package/dist/seek-bar/index.d.ts +3 -1
  41. package/dist/seek-bar/index.d.ts.map +1 -1
  42. package/dist/seek-bar/index.js +41 -40
  43. package/dist/select/index.js +21 -21
  44. package/dist/sortable/index.d.ts +13 -1
  45. package/dist/sortable/index.d.ts.map +1 -1
  46. package/dist/sortable/index.js +74 -55
  47. package/dist/sortable/shared.js +14 -14
  48. package/dist/sortable/tree.js +17 -17
  49. package/dist/sparkline/index.js +4 -4
  50. package/dist/stepper/index.js +13 -13
  51. package/dist/table/index.js +26 -26
  52. package/dist/table/selection.js +9 -9
  53. package/dist/table-of-contents/index.js +11 -11
  54. package/dist/tag-input/index.js +5 -5
  55. package/dist/theme-toggle/index.js +4 -4
  56. package/dist/theme.css +103 -0
  57. package/dist/time-field/index.js +21 -21
  58. package/dist/toast/index.d.ts.map +1 -1
  59. package/dist/toast/index.js +41 -41
  60. package/dist/tooltip/index.d.ts +9 -3
  61. package/dist/tooltip/index.d.ts.map +1 -1
  62. package/dist/tooltip/index.js +19 -16
  63. package/dist/tree/index.js +34 -34
  64. package/dist/trend/index.js +5 -5
  65. package/dist/utils/messages.d.ts +1 -0
  66. package/dist/utils/messages.d.ts.map +1 -1
  67. package/dist/utils/messages.js +1 -0
  68. package/dist/utils/swipe.d.ts +7 -0
  69. package/dist/utils/swipe.d.ts.map +1 -1
  70. package/dist/utils/swipe.js +45 -25
  71. package/dist/utils/useAnchoredPopup.d.ts +2 -1
  72. package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
  73. package/dist/utils/useAnchoredPopup.js +9 -5
  74. package/dist/utils/useVirtualList.d.ts +6 -1
  75. package/dist/utils/useVirtualList.d.ts.map +1 -1
  76. package/dist/utils/useVirtualList.js +12 -12
  77. package/dist/zen.css +1 -1
  78. package/package.json +1 -1
@@ -1,19 +1,19 @@
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 { useCopyToClipboard as n } from "../utils/useCopyToClipboard.js";
5
5
  import { useEffect as r, useRef as i, useState as a } from "react";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region packages/code-block/index.tsx
8
8
  function c({ code: c, language: l, highlight: u, copyable: d = !0, variant: f = "glass", className: p, ...m }) {
9
- let h = t(), g = c.trim(), { copy: _, copied: v } = n(), y = i(null), [b, x] = a(!1);
9
+ let h = e(), g = c.trim(), { copy: _, copied: v } = n(), y = i(null), [b, x] = a(!1);
10
10
  return r(() => {
11
11
  let e = y.current;
12
12
  if (!e || typeof ResizeObserver > "u") return;
13
13
  let t = new ResizeObserver(() => x(e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight));
14
14
  return t.observe(e), () => t.disconnect();
15
15
  }, []), /* @__PURE__ */ s("div", {
16
- className: e("zen__code-block group relative flex flex-col", f === "glass" && "glass glow-edge overflow-hidden rounded-xl", p),
16
+ className: t("zen__code-block group relative flex flex-col", f === "glass" && "glass glow-edge overflow-hidden rounded-xl", p),
17
17
  "data-language": l,
18
18
  ...m,
19
19
  children: [/* @__PURE__ */ o("pre", {
@@ -31,7 +31,7 @@ function c({ code: c, language: l, highlight: u, copyable: d = !0, variant: f =
31
31
  }), d && /* @__PURE__ */ o("button", {
32
32
  type: "button",
33
33
  onClick: () => _(g),
34
- className: e("zen__code-copy inline-flex items-center justify-center text-muted-foreground hover:bg-tint/[0.07] hover:text-foreground absolute top-2.5 end-2.5 cursor-pointer rounded-lg px-2.5 py-1 text-xs font-medium outline-hidden transition-[opacity,background-color,color] focus-ring", "opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:min-h-11 pointer-coarse:min-w-11 [@media(hover:none)]:bg-card/90 [@media(hover:none)]:opacity-100", v && "text-primary opacity-100"),
34
+ className: t("zen__code-copy inline-flex items-center justify-center text-muted-foreground hover:bg-tint/[0.07] hover:text-foreground absolute top-2.5 end-2.5 cursor-pointer rounded-lg px-2.5 py-1 text-xs font-medium outline-hidden transition-[opacity,background-color,color] focus-ring", "opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:min-h-11 pointer-coarse:min-w-11 [@media(hover:none)]:bg-card/90 [@media(hover:none)]:opacity-100", v && "text-primary opacity-100"),
35
35
  children: v ? h.copied : h.copy
36
36
  })]
37
37
  });
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { useMergedRefs as t } from "../utils/refs.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 { useMergedRefs as n } from "../utils/refs.js";
5
5
  import r from "../badge/index.js";
6
6
  import i, { PopoverContent as a, PopoverTrigger as o } from "../popover/index.js";
7
7
  import { useEffect as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
8
8
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  //#region packages/collapse/index.tsx
10
10
  function p({ items: p, data: m, children: h, moreLabel: g = "", badgeVariant: _ = "secondary", badgeClassName: v, className: y, ref: b, ...x }) {
11
- let S = n(), C = l(null), w = t(C, b), [T, E] = u(null), D = l({
11
+ let S = e(), C = l(null), w = n(C, b), [T, E] = u(null), D = l({
12
12
  items: [],
13
13
  more: 0,
14
14
  gap: 0
@@ -45,7 +45,7 @@ function p({ items: p, data: m, children: h, moreLabel: g = "", badgeVariant: _
45
45
  return /* @__PURE__ */ f("div", {
46
46
  ...x,
47
47
  ref: w,
48
- className: e("zen__collapse flex min-w-0 items-center overflow-hidden [contain:inline-size]", y),
48
+ className: t("zen__collapse flex min-w-0 items-center overflow-hidden [contain:inline-size]", y),
49
49
  children: [p.slice(0, k).map((e, t) => /* @__PURE__ */ d("span", {
50
50
  "data-collapse-item": !0,
51
51
  className: "flex shrink-0",
@@ -66,7 +66,7 @@ function p({ items: p, data: m, children: h, moreLabel: g = "", badgeVariant: _
66
66
  "aria-label": S.showMore(j(A.length).slice(1)),
67
67
  children: /* @__PURE__ */ d(r, {
68
68
  variant: _,
69
- className: e("cursor-pointer", v),
69
+ className: t("cursor-pointer", v),
70
70
  children: j(A.length)
71
71
  })
72
72
  }), /* @__PURE__ */ d(a, {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { useControllable as t } from "../utils/useControllable.js";
4
- import { useAnchoredPopup as n } from "../utils/useAnchoredPopup.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 { useControllable as n } from "../utils/useControllable.js";
5
+ import { useAnchoredPopup as r } from "../utils/useAnchoredPopup.js";
6
6
  import { useFieldProps as i } from "../field/index.js";
7
7
  import { FIELD_SIZE as a, POPUP as o, TRIGGER as s } from "../utils/styles.js";
8
8
  import c from "../input/index.js";
@@ -39,8 +39,8 @@ function w(e, t) {
39
39
  a: 1
40
40
  }) : null;
41
41
  }
42
- function T({ value: n, defaultValue: i = "#000000", onValueChange: a, onValueCommit: o, alpha: s = !1, swatches: l, className: p, ...g }) {
43
- let T = r(), [E, D] = t(n, i, a), O = m(), [k, A] = h(() => d(E) ?? y), [j, M] = h(E);
42
+ function T({ value: r, defaultValue: i = "#000000", onValueChange: a, onValueCommit: o, alpha: s = !1, swatches: l, className: p, ...g }) {
43
+ let T = e(), [E, D] = n(r, i, a), O = m(), [k, A] = h(() => d(E) ?? y), [j, M] = h(E);
44
44
  if (E !== j) {
45
45
  M(E);
46
46
  let e = w(E, s);
@@ -76,7 +76,7 @@ function T({ value: n, defaultValue: i = "#000000", onValueChange: a, onValueCom
76
76
  I(null), e && e !== N && (A(d(e)), D(e), R(e));
77
77
  };
78
78
  return /* @__PURE__ */ v("div", {
79
- className: e("zen__color-panel flex w-64 flex-col gap-3", p),
79
+ className: t("zen__color-panel flex w-64 flex-col gap-3", p),
80
80
  ...g,
81
81
  children: [
82
82
  /* @__PURE__ */ _("div", {
@@ -168,7 +168,7 @@ function T({ value: n, defaultValue: i = "#000000", onValueChange: a, onValueCom
168
168
  });
169
169
  }
170
170
  function E({ value: c, defaultValue: u = "#000000", onValueChange: d, onValueCommit: f, alpha: m, swatches: h, name: y, size: x = "default", id: S, disabled: C, className: w, style: E, ...D }) {
171
- let O = r(), [k, A, j] = t(c, u, d), M = n(), N = i({
171
+ let O = e(), [k, A, j] = n(c, u, d), M = r(), N = i({
172
172
  ...D,
173
173
  id: S
174
174
  });
@@ -184,7 +184,7 @@ function E({ value: c, defaultValue: u = "#000000", onValueChange: d, onValueCom
184
184
  ...M.triggerProps.style,
185
185
  ...E
186
186
  },
187
- className: e("zen__color-picker group", s, a[x], "w-full", M.open && "border-glow/60 [--glow-border-color:transparent] shadow-glow-focus", w),
187
+ className: t("zen__color-picker group", s, a[x], "w-full", M.open && "border-glow/60 [--glow-border-color:transparent] shadow-glow-focus", w),
188
188
  children: [/* @__PURE__ */ v("span", {
189
189
  className: "flex min-w-0 items-center gap-2.5",
190
190
  children: [/* @__PURE__ */ _("span", {
@@ -206,7 +206,7 @@ function E({ value: c, defaultValue: u = "#000000", onValueChange: d, onValueCom
206
206
  ...M.popupProps,
207
207
  role: "dialog",
208
208
  "aria-label": O.chooseColour,
209
- className: e("zen__popover", o, "p-3"),
209
+ className: t("zen__popover", o, "p-3"),
210
210
  children: /* @__PURE__ */ _(T, {
211
211
  value: k,
212
212
  onValueChange: A,
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { useControllable as t } from "../utils/useControllable.js";
4
- import { anchoredStyle as n, useAnchoredPopup as r } from "../utils/useAnchoredPopup.js";
5
- 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 { useControllable as n } from "../utils/useControllable.js";
5
+ import { anchoredStyle as r, useAnchoredPopup as i } from "../utils/useAnchoredPopup.js";
6
6
  import a from "../badge/index.js";
7
7
  import o from "../button/index.js";
8
8
  import { CheckIcon as s } from "../utils/status-icons.js";
@@ -24,17 +24,17 @@ var A = x(null), j = () => {
24
24
  return e;
25
25
  };
26
26
  function M(e) {
27
- let { items: n, itemKey: i = (e) => e.key, itemText: a = (e) => e.text, filter: o = (e, t) => a(e).toLowerCase().includes(t.toLowerCase()), selectedItems: s = [], name: c, children: l } = e, u = e.multiple === !0, [d, f, m] = t(e.value, e.defaultValue ?? (u ? [] : null), e.onValueChange), h = typeof d == "string" ? [d] : d ?? [], [g, _] = E(""), [v, y] = E(null), [b, x] = E(), S = T(null), C = T(null), D = T(null), j = T(35), M = w(() => g ? n.filter((e) => o(e, g)) : n, [
28
- n,
27
+ let { items: t, itemKey: r = (e) => e.key, itemText: a = (e) => e.text, filter: o = (e, t) => a(e).toLowerCase().includes(t.toLowerCase()), selectedItems: s = [], name: c, children: l } = e, u = e.multiple === !0, [d, f, m] = n(e.value, e.defaultValue ?? (u ? [] : null), e.onValueChange), h = typeof d == "string" ? [d] : d ?? [], [g, _] = E(""), [v, y] = E(null), [b, x] = E(), S = T(null), C = T(null), D = T(null), j = T(35), M = w(() => g ? t.filter((e) => o(e, g)) : t, [
28
+ t,
29
29
  g,
30
30
  o
31
- ]), N = r({ onOpenChange: (e) => {
31
+ ]), N = i({ onOpenChange: (e) => {
32
32
  e || (y(null), _(""), N.popupRef.current?.contains(document.activeElement) && C.current?.focus());
33
33
  } }), P = {
34
34
  multiple: u,
35
- keyOf: i,
35
+ keyOf: r,
36
36
  textOf: a,
37
- items: n,
37
+ items: t,
38
38
  selectedItems: s,
39
39
  matches: M,
40
40
  chosen: h,
@@ -66,23 +66,23 @@ function M(e) {
66
66
  })]
67
67
  });
68
68
  }
69
- function N({ placeholder: t, disabled: n, size: r = "default", className: a, style: o, children: s, ...u }) {
70
- let d = i(), p = t ?? d.selectPlaceholder, h = j(), { popup: g } = h, _ = c(), v = u.id ?? _?.id ?? `${g.id}-field`, y = u["aria-labelledby"] ?? (u["aria-label"] ? v : _?.labelId), { setListLabelledBy: b } = h;
69
+ function N({ placeholder: n, disabled: r, size: i = "default", className: a, style: o, children: s, ...u }) {
70
+ let d = e(), p = n ?? d.selectPlaceholder, h = j(), { popup: g } = h, _ = c(), v = u.id ?? _?.id ?? `${g.id}-field`, y = u["aria-labelledby"] ?? (u["aria-label"] ? v : _?.labelId), { setListLabelledBy: b } = h;
71
71
  C(() => b(y), [y, b]);
72
- let x = T(!1), S = () => !n && g.setOpen(!0);
72
+ let x = T(!1), S = () => !r && g.setOpen(!0);
73
73
  return /* @__PURE__ */ k("div", {
74
74
  id: v,
75
75
  "aria-labelledby": u["aria-label"] ? void 0 : _?.labelId,
76
76
  "aria-invalid": _?.["aria-invalid"],
77
77
  ...u,
78
- "aria-describedby": e(_?.["aria-describedby"], u["aria-describedby"]).trim() || void 0,
78
+ "aria-describedby": t(_?.["aria-describedby"], u["aria-describedby"]).trim() || void 0,
79
79
  ref: h.triggerRef,
80
80
  role: "combobox",
81
- tabIndex: n ? -1 : 0,
81
+ tabIndex: r ? -1 : 0,
82
82
  "aria-haspopup": "listbox",
83
83
  "aria-expanded": g.open,
84
84
  "aria-controls": g.id,
85
- "aria-disabled": n || void 0,
85
+ "aria-disabled": r || void 0,
86
86
  "data-popup-open": g.triggerProps["data-popup-open"],
87
87
  "data-zen-anchor": g.triggerProps["data-zen-anchor"],
88
88
  style: {
@@ -102,86 +102,86 @@ function N({ placeholder: t, disabled: n, size: r = "default", className: a, sty
102
102
  "ArrowDown"
103
103
  ].includes(e.key) && (e.preventDefault(), S());
104
104
  },
105
- className: e(f, l[r], "w-56 shrink-0", n ? "cursor-not-allowed opacity-50" : "cursor-pointer", g.open && "border-glow/60 [--glow-border-color:transparent] shadow-glow-focus", a),
105
+ className: t(f, l[i], "w-56 shrink-0", r ? "cursor-not-allowed opacity-50" : "cursor-pointer", g.open && "border-glow/60 [--glow-border-color:transparent] shadow-glow-focus", a),
106
106
  children: [/* @__PURE__ */ O("div", {
107
- className: e("flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm", n ? "text-muted-foreground" : "text-foreground"),
107
+ className: t("flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm", r ? "text-muted-foreground" : "text-foreground"),
108
108
  children: s ?? /* @__PURE__ */ O(P, { placeholder: p })
109
109
  }), /* @__PURE__ */ O(m, { open: g.open })]
110
110
  });
111
111
  }
112
- function P({ placeholder: e }) {
113
- let t = j(), n = i(), r = new Map([...t.selectedItems, ...t.items].map((e) => [t.keyOf(e), e])), s = t.chosen.flatMap((e) => {
114
- let n = r.has(e) ? t.textOf(r.get(e)) : void 0;
115
- return n ? [{
112
+ function P({ placeholder: t }) {
113
+ let n = j(), r = e(), i = new Map([...n.selectedItems, ...n.items].map((e) => [n.keyOf(e), e])), s = n.chosen.flatMap((e) => {
114
+ let t = i.has(e) ? n.textOf(i.get(e)) : void 0;
115
+ return t ? [{
116
116
  key: e,
117
- text: n
117
+ text: t
118
118
  }] : [];
119
119
  });
120
- return s.length ? t.multiple ? /* @__PURE__ */ O(h, {
120
+ return s.length ? n.multiple ? /* @__PURE__ */ O(h, {
121
121
  items: s.map((e) => e.text),
122
122
  data: s,
123
123
  badgeVariant: "secondary",
124
124
  badgeClassName: "h-6 min-w-min gap-2",
125
125
  className: "w-full gap-1",
126
- children: (e, r, i) => /* @__PURE__ */ k(a, {
126
+ children: (e, t, i) => /* @__PURE__ */ k(a, {
127
127
  className: "flex h-6 min-w-min gap-2 pe-1",
128
128
  variant: "secondary",
129
129
  children: [e, /* @__PURE__ */ O(o, {
130
- "aria-label": n.remove(e),
130
+ "aria-label": r.remove(e),
131
131
  onClick: (e) => {
132
- e.stopPropagation(), i && t.toggle(i.key);
132
+ e.stopPropagation(), i && n.toggle(i.key);
133
133
  },
134
134
  variant: "ghost",
135
135
  size: "icon",
136
136
  className: "group relative -top-px size-4 rounded-sm p-0.5",
137
137
  children: /* @__PURE__ */ O(_, { className: "zen__combobox-remove-icon size-3 transition duration-300 group-hover:rotate-90" })
138
138
  })]
139
- }, i?.key ?? r)
139
+ }, i?.key ?? t)
140
140
  }) : /* @__PURE__ */ O(D, { children: s[0].text }) : /* @__PURE__ */ O("span", {
141
141
  className: u,
142
- children: e
142
+ children: t
143
143
  });
144
144
  }
145
- function F({ className: t, children: r }) {
145
+ function F({ className: e, children: n }) {
146
146
  let { popup: i } = j();
147
147
  return /* @__PURE__ */ O("div", {
148
148
  ...i.popupProps,
149
- style: n(i.id, {
149
+ style: r(i.id, {
150
150
  offset: 5,
151
151
  width: "match"
152
152
  }),
153
- className: e("zen__popover", d, "overflow-visible p-0", t),
153
+ className: t("zen__popover", d, "overflow-visible p-0", e),
154
154
  children: /* @__PURE__ */ O("div", {
155
155
  className: "divide-tint/10 flex w-full flex-col divide-y overflow-hidden rounded-xl",
156
- children: r
156
+ children: n
157
157
  })
158
158
  });
159
159
  }
160
- function I({ placeholder: e, "aria-label": t }) {
161
- let n = j(), r = i(), a = T(null);
160
+ function I({ placeholder: t, "aria-label": n }) {
161
+ let r = j(), i = e(), a = T(null);
162
162
  C(() => {
163
- n.popup.open && a.current?.focus();
164
- }, [n.popup.open]);
165
- let o = n.matches.map(n.keyOf);
163
+ r.popup.open && a.current?.focus();
164
+ }, [r.popup.open]);
165
+ let o = r.matches.map(r.keyOf);
166
166
  return /* @__PURE__ */ k("div", {
167
167
  className: "flex h-10 grow items-center gap-2 px-3",
168
168
  children: [/* @__PURE__ */ O(v, { children: /* @__PURE__ */ O(g, {}) }), /* @__PURE__ */ O(y, {
169
169
  ref: a,
170
- placeholder: e ?? r.search,
171
- "aria-label": t ?? r.searchOptions,
172
- "aria-controls": `${n.popup.id}-list`,
173
- "aria-activedescendant": n.active === null ? void 0 : n.optionId(n.active),
174
- value: n.query,
170
+ placeholder: t ?? i.search,
171
+ "aria-label": n ?? i.searchOptions,
172
+ "aria-controls": `${r.popup.id}-list`,
173
+ "aria-activedescendant": r.active === null ? void 0 : r.optionId(r.active),
174
+ value: r.query,
175
175
  onChange: (e) => {
176
- n.setQuery(e.target.value), n.setActive(null);
176
+ r.setQuery(e.target.value), r.setActive(null);
177
177
  },
178
178
  onKeyDown: (e) => {
179
- let t = n.active === null ? -1 : o.indexOf(n.active), r = (t) => {
179
+ let t = r.active === null ? -1 : o.indexOf(r.active), n = (t) => {
180
180
  if (e.preventDefault(), !o.length) return;
181
- let r = o[(t + o.length) % o.length];
182
- n.setActive(r), L(n.listRef.current, o.indexOf(r), n.itemHeight.current);
181
+ let n = o[(t + o.length) % o.length];
182
+ r.setActive(n), L(r.listRef.current, o.indexOf(n), r.itemHeight.current);
183
183
  };
184
- e.key === "ArrowDown" ? r(t + 1) : e.key === "ArrowUp" ? r(t === -1 ? o.length - 1 : t - 1) : e.key === "Enter" && (e.preventDefault(), n.active === null ? !o.length && n.query && n.create.current && (n.create.current(n.query), n.setQuery("")) : n.toggle(n.active));
184
+ e.key === "ArrowDown" ? n(t + 1) : e.key === "ArrowUp" ? n(t === -1 ? o.length - 1 : t - 1) : e.key === "Enter" && (e.preventDefault(), r.active === null ? !o.length && r.query && r.create.current && (r.create.current(r.query), r.setQuery("")) : r.toggle(r.active));
185
185
  }
186
186
  })]
187
187
  });
@@ -227,8 +227,8 @@ function z({ renderItem: e, itemHeight: t = 35, children: n }) {
227
227
  }), n]
228
228
  });
229
229
  }
230
- function B({ item: t, className: n, children: r }) {
231
- let i = j(), a = S(R), o = i.keyOf(t), c = i.chosen.includes(o);
230
+ function B({ item: e, className: n, children: r }) {
231
+ let i = j(), a = S(R), o = i.keyOf(e), c = i.chosen.includes(o);
232
232
  return /* @__PURE__ */ k("li", {
233
233
  id: i.optionId(o),
234
234
  role: "option",
@@ -240,36 +240,36 @@ function B({ item: t, className: n, children: r }) {
240
240
  } : void 0,
241
241
  onMouseMove: () => i.active !== o && i.setActive(o),
242
242
  onClick: () => i.toggle(o),
243
- className: e("hover:bg-muted data-highlighted:bg-muted grid w-full cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 px-3 py-2 text-sm outline-hidden select-none", a && "absolute top-0 left-0", n),
243
+ className: t("hover:bg-muted data-highlighted:bg-muted grid w-full cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 px-3 py-2 text-sm outline-hidden select-none", a && "absolute top-0 left-0", n),
244
244
  children: [/* @__PURE__ */ O("span", {
245
245
  className: "text-primary col-start-1",
246
246
  "aria-hidden": !0,
247
247
  children: c && /* @__PURE__ */ O(s, {})
248
248
  }), /* @__PURE__ */ O("span", {
249
249
  className: "col-start-2 truncate",
250
- children: r ?? i.textOf(t)
250
+ children: r ?? i.textOf(e)
251
251
  })]
252
252
  });
253
253
  }
254
- function V({ children: e }) {
255
- let t = j(), n = i();
256
- return !t.query || t.matches.length ? null : /* @__PURE__ */ O("li", {
254
+ function V({ children: t }) {
255
+ let n = j(), r = e();
256
+ return !n.query || n.matches.length ? null : /* @__PURE__ */ O("li", {
257
257
  className: "text-muted-foreground cursor-not-allowed px-3 py-2 text-sm",
258
- children: e ?? n.noResults
258
+ children: t ?? r.noResults
259
259
  });
260
260
  }
261
- function H({ onCreate: e, children: t }) {
262
- let n = j(), r = i(), { create: a } = n;
263
- return C(() => (a.current = e, () => {
261
+ function H({ onCreate: t, children: n }) {
262
+ let r = j(), i = e(), { create: a } = r;
263
+ return C(() => (a.current = t, () => {
264
264
  a.current = null;
265
- }), [a, e]), !n.query || n.matches.length ? null : /* @__PURE__ */ O("li", {
265
+ }), [a, t]), !r.query || r.matches.length ? null : /* @__PURE__ */ O("li", {
266
266
  role: "option",
267
267
  "aria-selected": !1,
268
268
  className: "hover:bg-muted cursor-pointer px-3 py-2 text-sm select-none",
269
269
  onClick: () => {
270
- e(n.query), n.setQuery("");
270
+ t(r.query), r.setQuery("");
271
271
  },
272
- children: (t ?? r.add)(n.query)
272
+ children: (n ?? i.add)(r.query)
273
273
  });
274
274
  }
275
275
  //#endregion
@@ -1,13 +1,13 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { useMergedRefs as t } from "../utils/refs.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 { useMergedRefs as n } from "../utils/refs.js";
5
5
  import { useModal as r } from "../dialog/index.js";
6
6
  import { useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
7
7
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  //#region packages/command-palette/index.tsx
9
9
  function d({ open: d, onOpenChange: p, items: m, placeholder: h, empty: g, label: _, className: v, ref: y, ...b }) {
10
- let x = n(), S = h ?? x.search, C = g ?? x.noResults, w = _ ?? x.commands, T = s(null), E = t(T, y), D = s(null), O = s(null), k = a(), [A, j] = c(""), [M, N] = c(0);
10
+ let x = e(), S = h ?? x.search, C = g ?? x.noResults, w = _ ?? x.commands, T = s(null), E = n(T, y), D = s(null), O = s(null), k = a(), [A, j] = c(""), [M, N] = c(0);
11
11
  r(T, d, D);
12
12
  let [P, F] = c(d);
13
13
  d !== P && (F(d), d && (j(""), N(0)));
@@ -34,7 +34,7 @@ function d({ open: d, onOpenChange: p, items: m, placeholder: h, empty: g, label
34
34
  ...b,
35
35
  ref: E,
36
36
  "aria-label": w,
37
- className: e("zen__dialog zen__command-palette glass glass-blur glow-edge text-card-foreground bg-card/90! overflow-hidden p-0", "mx-auto mt-[12dvh] mb-auto w-[36rem] max-w-[calc(100vw-2rem)] rounded-xl", "backdrop:bg-[color:var(--backdrop-scrim,oklch(0_0_0/0.5))] backdrop:backdrop-blur-sm pointer-coarse:backdrop:backdrop-blur-none", v),
37
+ className: t("zen__dialog zen__command-palette glass glass-blur glow-edge text-card-foreground bg-card/90! overflow-hidden p-0", "mx-auto mt-[12dvh] mb-auto w-[36rem] max-w-[calc(100vw-2rem)] rounded-xl", "backdrop:bg-[color:var(--backdrop-scrim,oklch(0_0_0/0.5))] backdrop:backdrop-blur-sm pointer-coarse:backdrop:backdrop-blur-none", v),
38
38
  onCancel: (e) => {
39
39
  e.preventDefault(), p(!1);
40
40
  },
@@ -1,11 +1,11 @@
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 n, { DialogClose as r, DialogFooter as i } from "../dialog/index.js";
5
5
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
6
  //#region packages/confirm-dialog/index.tsx
7
7
  function s({ open: s, onOpenChange: c, title: l, description: u, confirmLabel: d, cancelLabel: f, tone: p = "default", onConfirm: m, className: h, ...g }) {
8
- let _ = t(), v = f ?? _.cancel;
8
+ let _ = e(), v = f ?? _.cancel;
9
9
  return /* @__PURE__ */ a(n, {
10
10
  ...g,
11
11
  role: "alertdialog",
@@ -13,7 +13,7 @@ function s({ open: s, onOpenChange: c, title: l, description: u, confirmLabel: d
13
13
  onOpenChange: c,
14
14
  title: l,
15
15
  description: u,
16
- className: e("w-[26rem]", h),
16
+ className: t("w-[26rem]", h),
17
17
  children: /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(r, {
18
18
  variant: "outline",
19
19
  autoFocus: !0,
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { cx as e } from "../utils/cx.js";
3
- import { useControllable as t } from "../utils/useControllable.js";
4
- import { useAnchoredPopup as n } from "../utils/useAnchoredPopup.js";
5
- import { useLocale as r, useMessages as i } from "../locale-provider/index.js";
2
+ import { useLocale as e, useMessages as t } from "../locale-provider/index.js";
3
+ import { cx as n } from "../utils/cx.js";
4
+ import { useControllable as r } from "../utils/useControllable.js";
5
+ import { useAnchoredPopup as i } from "../utils/useAnchoredPopup.js";
6
6
  import { useFieldProps as a } from "../field/index.js";
7
7
  import { FIELD_SIZE as o, POPUP as s, TRIGGER as c } from "../utils/styles.js";
8
8
  import { FormValue as l } from "../utils/form-value.js";
@@ -11,8 +11,8 @@ import f from "../calendar/index.js";
11
11
  import p from "../icons/micro/calendar.js";
12
12
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
13
13
  //#region packages/date-picker/index.tsx
14
- function _({ value: e, defaultValue: n = null, onValueChange: a, locale: o, min: s, max: c, isDisabled: l, weekStartsOn: d, placeholder: p, clearable: m = !1, clearLabel: g, ..._ }) {
15
- let v = i(), b = p ?? v.pickDate, x = g ?? v.clear, S = r(o), [C, w, T] = t(e, n, a);
14
+ function _({ value: n, defaultValue: i = null, onValueChange: a, locale: o, min: s, max: c, isDisabled: l, weekStartsOn: d, placeholder: p, clearable: m = !1, clearLabel: g, ..._ }) {
15
+ let v = t(), b = p ?? v.pickDate, x = g ?? v.clear, S = e(o), [C, w, T] = r(n, i, a);
16
16
  return /* @__PURE__ */ h(y, {
17
17
  ..._,
18
18
  shown: C ? u(C, S) : null,
@@ -36,8 +36,8 @@ function _({ value: e, defaultValue: n = null, onValueChange: a, locale: o, min:
36
36
  })
37
37
  });
38
38
  }
39
- function v({ value: e, defaultValue: n = null, onValueChange: a, locale: o, min: s, max: c, isDisabled: l, weekStartsOn: p, months: m = 1, placeholder: _, clearable: v = !1, clearLabel: b, presets: x, ...S }) {
40
- let C = i(), w = _ ?? C.pickDates, T = b ?? C.clear, E = r(o), [D, O, k] = t(e, n, a), A = D ? D.end ? d(D.start, D.end, E) : `${u(D.start, E)} – …` : null;
39
+ function v({ value: n, defaultValue: i = null, onValueChange: a, locale: o, min: s, max: c, isDisabled: l, weekStartsOn: p, months: m = 1, placeholder: _, clearable: v = !1, clearLabel: b, presets: x, ...S }) {
40
+ let C = t(), w = _ ?? C.pickDates, T = b ?? C.clear, E = e(o), [D, O, k] = r(n, i, a), A = D ? D.end ? d(D.start, D.end, E) : `${u(D.start, E)} – …` : null;
41
41
  return /* @__PURE__ */ h(y, {
42
42
  ...S,
43
43
  shown: A,
@@ -85,8 +85,8 @@ function v({ value: e, defaultValue: n = null, onValueChange: a, locale: o, min:
85
85
  }
86
86
  });
87
87
  }
88
- function y({ shown: t, placeholder: r, label: i, calendar: u, onClear: d, clearLabel: f, name: p, formValue: _, onReset: v, size: y = "default", id: x, className: S, disabled: C = !1, style: w, ...T }) {
89
- let E = n(), D = a({
88
+ function y({ shown: e, placeholder: t, label: r, calendar: u, onClear: d, clearLabel: f, name: p, formValue: _, onReset: v, size: y = "default", id: x, className: S, disabled: C = !1, style: w, ...T }) {
89
+ let E = i(), D = a({
90
90
  ...T,
91
91
  id: x
92
92
  }), O = () => E.setOpen(!1);
@@ -102,10 +102,10 @@ function y({ shown: t, placeholder: r, label: i, calendar: u, onClear: d, clearL
102
102
  ...E.triggerProps.style,
103
103
  ...w
104
104
  },
105
- className: e("zen__date-picker group", c, o[y], "w-full", E.open && "border-glow/60 [--glow-border-color:transparent] shadow-glow-focus", S),
105
+ className: n("zen__date-picker group", c, o[y], "w-full", E.open && "border-glow/60 [--glow-border-color:transparent] shadow-glow-focus", S),
106
106
  children: [/* @__PURE__ */ h("span", {
107
- className: e("truncate", !t && "text-[color:oklch(var(--muted-foreground)/var(--zen-placeholder))]"),
108
- children: t ?? r
107
+ className: n("truncate", !e && "text-[color:oklch(var(--muted-foreground)/var(--zen-placeholder))]"),
108
+ children: e ?? t
109
109
  }), /* @__PURE__ */ h(b, {})]
110
110
  }),
111
111
  /* @__PURE__ */ h(l, {
@@ -116,8 +116,8 @@ function y({ shown: t, placeholder: r, label: i, calendar: u, onClear: d, clearL
116
116
  /* @__PURE__ */ g("div", {
117
117
  ...E.popupProps,
118
118
  role: "dialog",
119
- "aria-label": i,
120
- className: e("zen__popover", s, "p-3"),
119
+ "aria-label": r,
120
+ className: n("zen__popover", s, "p-3"),
121
121
  children: [E.open && u(O), d && /* @__PURE__ */ h("button", {
122
122
  type: "button",
123
123
  onClick: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/dialog/index.tsx"],"names":[],"mappings":"AAIA,OAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAIlD,OAAO,EACH,cAAc,EAGd,SAAS,EACT,SAAS,EAKZ,MAAM,OAAO,CAAC;AAKf;;;;;;GAMG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