@enya-learning/nova 0.5.0 → 0.6.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 (113) hide show
  1. package/README.md +8 -10
  2. package/dist/chunks/dist-fahbq1psobj0ox6s.js.map +1 -1
  3. package/dist/components/accordion.js +23 -20
  4. package/dist/components/accordion.js.map +1 -1
  5. package/dist/components/alert-dialog.js +2 -2
  6. package/dist/components/alert-dialog.js.map +1 -1
  7. package/dist/components/avatar.js +24 -24
  8. package/dist/components/avatar.js.map +1 -1
  9. package/dist/components/badge.js +12 -12
  10. package/dist/components/badge.js.map +1 -1
  11. package/dist/components/box.js +16 -0
  12. package/dist/components/box.js.map +1 -0
  13. package/dist/components/breadcrumb.js +28 -24
  14. package/dist/components/breadcrumb.js.map +1 -1
  15. package/dist/components/button-group.js +2 -2
  16. package/dist/components/button-group.js.map +1 -1
  17. package/dist/components/button.js +10 -10
  18. package/dist/components/button.js.map +1 -1
  19. package/dist/components/calendar.js +491 -487
  20. package/dist/components/calendar.js.map +1 -1
  21. package/dist/components/carousel.js +105 -98
  22. package/dist/components/carousel.js.map +1 -1
  23. package/dist/components/chart.js +2 -2
  24. package/dist/components/chart.js.map +1 -1
  25. package/dist/components/checkbox.js +7 -6
  26. package/dist/components/checkbox.js.map +1 -1
  27. package/dist/components/combobox.js +64 -51
  28. package/dist/components/combobox.js.map +1 -1
  29. package/dist/components/command.js +167 -160
  30. package/dist/components/command.js.map +1 -1
  31. package/dist/components/context-menu.js +40 -36
  32. package/dist/components/context-menu.js.map +1 -1
  33. package/dist/components/dialog.js +25 -24
  34. package/dist/components/dialog.js.map +1 -1
  35. package/dist/components/drawer.js +2 -2
  36. package/dist/components/drawer.js.map +1 -1
  37. package/dist/components/dropdown-menu.js +39 -35
  38. package/dist/components/dropdown-menu.js.map +1 -1
  39. package/dist/components/empty.js +1 -1
  40. package/dist/components/empty.js.map +1 -1
  41. package/dist/components/field.js +1 -1
  42. package/dist/components/field.js.map +1 -1
  43. package/dist/components/heading.js +39 -0
  44. package/dist/components/heading.js.map +1 -0
  45. package/dist/components/input-group.js +14 -14
  46. package/dist/components/input-group.js.map +1 -1
  47. package/dist/components/input-otp.js +28 -27
  48. package/dist/components/input-otp.js.map +1 -1
  49. package/dist/components/input.js +1 -1
  50. package/dist/components/input.js.map +1 -1
  51. package/dist/components/item.js +34 -34
  52. package/dist/components/item.js.map +1 -1
  53. package/dist/components/kbd.js +7 -7
  54. package/dist/components/kbd.js.map +1 -1
  55. package/dist/components/menubar.js +52 -51
  56. package/dist/components/menubar.js.map +1 -1
  57. package/dist/components/native-select.js +21 -19
  58. package/dist/components/native-select.js.map +1 -1
  59. package/dist/components/navigation-menu.js +21 -19
  60. package/dist/components/navigation-menu.js.map +1 -1
  61. package/dist/components/pagination.js +33 -30
  62. package/dist/components/pagination.js.map +1 -1
  63. package/dist/components/progress.js +4 -4
  64. package/dist/components/progress.js.map +1 -1
  65. package/dist/components/radio-group.js +14 -14
  66. package/dist/components/radio-group.js.map +1 -1
  67. package/dist/components/resizable.js +1 -1
  68. package/dist/components/resizable.js.map +1 -1
  69. package/dist/components/select.js +64 -57
  70. package/dist/components/select.js.map +1 -1
  71. package/dist/components/sheet.js +22 -21
  72. package/dist/components/sheet.js.map +1 -1
  73. package/dist/components/sidebar.js +83 -79
  74. package/dist/components/sidebar.js.map +1 -1
  75. package/dist/components/skeleton.js +1 -1
  76. package/dist/components/skeleton.js.map +1 -1
  77. package/dist/components/slider.js +7 -7
  78. package/dist/components/slider.js.map +1 -1
  79. package/dist/components/sonner.js +137 -121
  80. package/dist/components/sonner.js.map +1 -1
  81. package/dist/components/spinner.js +10 -8
  82. package/dist/components/spinner.js.map +1 -1
  83. package/dist/components/switch.js +5 -5
  84. package/dist/components/switch.js.map +1 -1
  85. package/dist/components/table.js +14 -14
  86. package/dist/components/table.js.map +1 -1
  87. package/dist/components/tabs.js +15 -15
  88. package/dist/components/tabs.js.map +1 -1
  89. package/dist/components/text.js +47 -0
  90. package/dist/components/text.js.map +1 -0
  91. package/dist/components/textarea.js +5 -5
  92. package/dist/components/textarea.js.map +1 -1
  93. package/dist/components/toggle-group.js +1 -1
  94. package/dist/components/toggle-group.js.map +1 -1
  95. package/dist/components/toggle.js +7 -7
  96. package/dist/components/toggle.js.map +1 -1
  97. package/dist/components/tooltip.js +5 -5
  98. package/dist/components/tooltip.js.map +1 -1
  99. package/dist/index.js +22 -14
  100. package/dist/src/components/box/box.d.ts +7 -0
  101. package/dist/src/components/box/index.d.ts +1 -0
  102. package/dist/src/components/heading/heading.d.ts +15 -0
  103. package/dist/src/components/heading/index.d.ts +1 -0
  104. package/dist/src/components/spinner/spinner.d.ts +2 -1
  105. package/dist/src/components/text/index.d.ts +1 -0
  106. package/dist/src/components/text/text.d.ts +13 -0
  107. package/dist/src/index.d.ts +3 -0
  108. package/dist/styles/nova-binding.css +264 -266
  109. package/dist/styles/nova.css +158 -49
  110. package/dist/styles/typography.css +3 -123
  111. package/package.json +15 -2
  112. package/src/eslint/no-primitive-colors.js +2 -2
  113. package/dist/styles/theme-nova.css +0 -197
@@ -1,89 +1,90 @@
1
1
  "use client";
2
2
  import { t as I } from "../chunks/utils-kyb5nny4y41y7hd8.js";
3
- import { InputGroup as Re, InputGroupAddon as Ae } from "./input-group.js";
4
- import { a as $e, i as De, l as F, n as Ne, o as Pe, u as O } from "../chunks/dist-fahbq1psobj0ox6s.js";
5
- import { Dialog as Me, DialogContent as je, DialogDescription as Le, DialogHeader as Ve, DialogTitle as Fe } from "./dialog.js";
3
+ import { InputGroup as Ae, InputGroupAddon as $e } from "./input-group.js";
4
+ import { a as De, i as Ne, l as F, n as Pe, o as Me, u as O } from "../chunks/dist-fahbq1psobj0ox6s.js";
5
+ import { Dialog as je, DialogContent as Le, DialogDescription as Ve, DialogHeader as Fe, DialogTitle as Oe } from "./dialog.js";
6
6
  import { jsx as w, jsxs as W } from "react/jsx-runtime";
7
- import { CheckIcon as Oe, SearchIcon as ze } from "lucide-react";
7
+ import { HugeiconsIcon as he } from "@hugeicons/react";
8
+ import { CheckIcon as ze, SearchIcon as Ke } from "@hugeicons/core-free-icons";
8
9
  import * as l from "react";
9
10
  import "react-dom";
10
- var pe = 1, Ke = 0.9, Te = 0.8, qe = 0.17, te = 0.1, re = 0.999, We = 0.9999, _e = 0.99, Be = /[\\\/_+.#"@\[\(\{&]/, Ge = /[\\\/_+.#"@\[\(\{&]/g, He = /[\s-]/, he = /[\s-]/g;
11
- function le(e, t, r, i, a, o, d) {
12
- if (o === t.length) return a === e.length ? pe : _e;
13
- var m = `${a},${o}`;
11
+ var pe = 1, Te = 0.9, qe = 0.8, We = 0.17, te = 0.1, re = 0.999, _e = 0.9999, Be = 0.99, Ge = /[\\\/_+.#"@\[\(\{&]/, He = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, be = /[\s-]/g;
12
+ function le(e, t, r, i, o, a, d) {
13
+ if (a === t.length) return o === e.length ? pe : Be;
14
+ var m = `${o},${a}`;
14
15
  if (d[m] !== void 0) return d[m];
15
- for (var g = i.charAt(o), c = r.indexOf(g, a), p = 0, h, S, x, R; c >= 0; ) h = le(e, t, r, i, c + 1, o + 1, d), h > p && (c === a ? h *= pe : Be.test(e.charAt(c - 1)) ? (h *= Te, x = e.slice(a, c - 1).match(Ge), x && a > 0 && (h *= Math.pow(re, x.length))) : He.test(e.charAt(c - 1)) ? (h *= Ke, R = e.slice(a, c - 1).match(he), R && a > 0 && (h *= Math.pow(re, R.length))) : (h *= qe, a > 0 && (h *= Math.pow(re, c - a))), e.charAt(c) !== t.charAt(o) && (h *= We)), (h < te && r.charAt(c - 1) === i.charAt(o + 1) || i.charAt(o + 1) === i.charAt(o) && r.charAt(c - 1) !== i.charAt(o)) && (S = le(e, t, r, i, c + 1, o + 2, d), S * te > h && (h = S * te)), h > p && (p = h), c = r.indexOf(g, c + 1);
16
+ for (var g = i.charAt(a), c = r.indexOf(g, o), p = 0, h, S, x, R; c >= 0; ) h = le(e, t, r, i, c + 1, a + 1, d), h > p && (c === o ? h *= pe : Ge.test(e.charAt(c - 1)) ? (h *= qe, x = e.slice(o, c - 1).match(He), x && o > 0 && (h *= Math.pow(re, x.length))) : Ue.test(e.charAt(c - 1)) ? (h *= Te, R = e.slice(o, c - 1).match(be), R && o > 0 && (h *= Math.pow(re, R.length))) : (h *= We, o > 0 && (h *= Math.pow(re, c - o))), e.charAt(c) !== t.charAt(a) && (h *= _e)), (h < te && r.charAt(c - 1) === i.charAt(a + 1) || i.charAt(a + 1) === i.charAt(a) && r.charAt(c - 1) !== i.charAt(a)) && (S = le(e, t, r, i, c + 1, a + 2, d), S * te > h && (h = S * te)), h > p && (p = h), c = r.indexOf(g, c + 1);
16
17
  return d[m] = p, p;
17
18
  }
18
19
  function ve(e) {
19
- return e.toLowerCase().replace(he, " ");
20
+ return e.toLowerCase().replace(be, " ");
20
21
  }
21
- function Ue(e, t, r) {
22
+ function Ye(e, t, r) {
22
23
  return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, le(e, t, ve(e), ve(t), 0, 0, {});
23
24
  }
24
- var Ye = /* @__PURE__ */ Symbol.for("react.lazy"), _ = l[" use ".trim().toString()];
25
- function Ze(e) {
25
+ var Ze = /* @__PURE__ */ Symbol.for("react.lazy"), _ = l[" use ".trim().toString()];
26
+ function Je(e) {
26
27
  return typeof e == "object" && e !== null && "then" in e;
27
28
  }
28
- function be(e) {
29
- return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === Ye && "_payload" in e && Ze(e._payload);
29
+ function ye(e) {
30
+ return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === Ze && "_payload" in e && Je(e._payload);
30
31
  }
31
32
  // @__NO_SIDE_EFFECTS__
32
- function Je(e) {
33
- const t = /* @__PURE__ */ Xe(e), r = l.forwardRef((i, a) => {
34
- let { children: o, ...d } = i;
35
- be(o) && typeof _ == "function" && (o = _(o._payload));
36
- const m = l.Children.toArray(o), g = m.find(et);
33
+ function Xe(e) {
34
+ const t = /* @__PURE__ */ Qe(e), r = l.forwardRef((i, o) => {
35
+ let { children: a, ...d } = i;
36
+ ye(a) && typeof _ == "function" && (a = _(a._payload));
37
+ const m = l.Children.toArray(a), g = m.find(tt);
37
38
  if (g) {
38
39
  const c = g.props.children, p = m.map((h) => h === g ? l.Children.count(c) > 1 ? l.Children.only(null) : l.isValidElement(c) ? c.props.children : null : h);
39
40
  return /* @__PURE__ */ w(t, {
40
41
  ...d,
41
- ref: a,
42
+ ref: o,
42
43
  children: l.isValidElement(c) ? l.cloneElement(c, void 0, p) : null
43
44
  });
44
45
  }
45
46
  return /* @__PURE__ */ w(t, {
46
47
  ...d,
47
- ref: a,
48
- children: o
48
+ ref: o,
49
+ children: a
49
50
  });
50
51
  });
51
52
  return r.displayName = `${e}.Slot`, r;
52
53
  }
53
54
  // @__NO_SIDE_EFFECTS__
54
- function Xe(e) {
55
+ function Qe(e) {
55
56
  const t = l.forwardRef((r, i) => {
56
- let { children: a, ...o } = r;
57
- if (be(a) && typeof _ == "function" && (a = _(a._payload)), l.isValidElement(a)) {
58
- const d = rt(a), m = tt(o, a.props);
59
- return a.type !== l.Fragment && (m.ref = i ? O(i, d) : d), l.cloneElement(a, m);
57
+ let { children: o, ...a } = r;
58
+ if (ye(o) && typeof _ == "function" && (o = _(o._payload)), l.isValidElement(o)) {
59
+ const d = nt(o), m = rt(a, o.props);
60
+ return o.type !== l.Fragment && (m.ref = i ? O(i, d) : d), l.cloneElement(o, m);
60
61
  }
61
- return l.Children.count(a) > 1 ? l.Children.only(null) : null;
62
+ return l.Children.count(o) > 1 ? l.Children.only(null) : null;
62
63
  });
63
64
  return t.displayName = `${e}.SlotClone`, t;
64
65
  }
65
- var Qe = /* @__PURE__ */ Symbol("radix.slottable");
66
- function et(e) {
67
- return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Qe;
66
+ var et = /* @__PURE__ */ Symbol("radix.slottable");
67
+ function tt(e) {
68
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === et;
68
69
  }
69
- function tt(e, t) {
70
+ function rt(e, t) {
70
71
  const r = { ...t };
71
72
  for (const i in t) {
72
- const a = e[i], o = t[i];
73
- /^on[A-Z]/.test(i) ? a && o ? r[i] = (...d) => {
74
- const m = o(...d);
75
- return a(...d), m;
76
- } : a && (r[i] = a) : i === "style" ? r[i] = {
77
- ...a,
78
- ...o
79
- } : i === "className" && (r[i] = [a, o].filter(Boolean).join(" "));
73
+ const o = e[i], a = t[i];
74
+ /^on[A-Z]/.test(i) ? o && a ? r[i] = (...d) => {
75
+ const m = a(...d);
76
+ return o(...d), m;
77
+ } : o && (r[i] = o) : i === "style" ? r[i] = {
78
+ ...o,
79
+ ...a
80
+ } : i === "className" && (r[i] = [o, a].filter(Boolean).join(" "));
80
81
  }
81
82
  return {
82
83
  ...e,
83
84
  ...r
84
85
  };
85
86
  }
86
- function rt(e) {
87
+ function nt(e) {
87
88
  let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
88
89
  return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
89
90
  }
@@ -106,18 +107,18 @@ var $ = [
106
107
  "svg",
107
108
  "ul"
108
109
  ].reduce((e, t) => {
109
- const r = /* @__PURE__ */ Je(`Primitive.${t}`), i = l.forwardRef((a, o) => {
110
- const { asChild: d, ...m } = a, g = d ? r : t;
110
+ const r = /* @__PURE__ */ Xe(`Primitive.${t}`), i = l.forwardRef((o, a) => {
111
+ const { asChild: d, ...m } = o, g = d ? r : t;
111
112
  return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ w(g, {
112
113
  ...m,
113
- ref: o
114
+ ref: a
114
115
  });
115
116
  });
116
117
  return i.displayName = `Primitive.${t}`, {
117
118
  ...e,
118
119
  [t]: i
119
120
  };
120
- }, {}), K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', nt = '[cmdk-group-heading=""]', ye = '[cmdk-item=""]', ge = `${ye}:not([aria-disabled="true"])`, ae = "cmdk-item-select", L = "data-value", lt = (e, t, r) => Ue(e, t, r), we = l.createContext(void 0), T = () => l.useContext(we), xe = l.createContext(void 0), oe = () => l.useContext(xe), Ee = l.createContext(void 0), Ce = l.forwardRef((e, t) => {
121
+ }, {}), K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', lt = '[cmdk-group-heading=""]', we = '[cmdk-item=""]', ge = `${we}:not([aria-disabled="true"])`, oe = "cmdk-item-select", L = "data-value", ot = (e, t, r) => Ye(e, t, r), xe = l.createContext(void 0), T = () => l.useContext(xe), Ee = l.createContext(void 0), ae = () => l.useContext(Ee), Ce = l.createContext(void 0), ke = l.forwardRef((e, t) => {
121
122
  let r = V(() => {
122
123
  var n, s;
123
124
  return {
@@ -130,7 +131,7 @@ var $ = [
130
131
  groups: /* @__PURE__ */ new Set()
131
132
  }
132
133
  };
133
- }), i = V(() => /* @__PURE__ */ new Set()), a = V(() => /* @__PURE__ */ new Map()), o = V(() => /* @__PURE__ */ new Map()), d = V(() => /* @__PURE__ */ new Set()), m = ke(e), { label: g, children: c, value: p, onValueChange: h, filter: S, shouldFilter: x, loop: R, disablePointerSelection: G = !1, vimBindings: D = !0, ...q } = e, H = F(), ie = F(), U = F(), N = l.useRef(null), y = vt();
134
+ }), i = V(() => /* @__PURE__ */ new Set()), o = V(() => /* @__PURE__ */ new Map()), a = V(() => /* @__PURE__ */ new Map()), d = V(() => /* @__PURE__ */ new Set()), m = Se(e), { label: g, children: c, value: p, onValueChange: h, filter: S, shouldFilter: x, loop: R, disablePointerSelection: G = !1, vimBindings: D = !0, ...q } = e, H = F(), ie = F(), U = F(), N = l.useRef(null), y = gt();
134
135
  P(() => {
135
136
  if (p !== void 0) {
136
137
  let n = p.trim();
@@ -169,24 +170,24 @@ var $ = [
169
170
  }), []), Y = l.useMemo(() => ({
170
171
  value: (n, s, f) => {
171
172
  var u;
172
- s !== ((u = o.current.get(n)) == null ? void 0 : u.value) && (o.current.set(n, {
173
+ s !== ((u = a.current.get(n)) == null ? void 0 : u.value) && (a.current.set(n, {
173
174
  value: s,
174
175
  keywords: f
175
176
  }), r.current.filtered.items.set(n, ue(s, f)), y(2, () => {
176
177
  Z(), E.emit();
177
178
  }));
178
179
  },
179
- item: (n, s) => (i.current.add(n), s && (a.current.has(s) ? a.current.get(s).add(n) : a.current.set(s, /* @__PURE__ */ new Set([n]))), y(3, () => {
180
+ item: (n, s) => (i.current.add(n), s && (o.current.has(s) ? o.current.get(s).add(n) : o.current.set(s, /* @__PURE__ */ new Set([n]))), y(3, () => {
180
181
  X(), Z(), r.current.value || J(), E.emit();
181
182
  }), () => {
182
- o.current.delete(n), i.current.delete(n), r.current.filtered.items.delete(n);
183
+ a.current.delete(n), i.current.delete(n), r.current.filtered.items.delete(n);
183
184
  let f = j();
184
185
  y(4, () => {
185
186
  X(), f?.getAttribute("id") === n && J(), E.emit();
186
187
  });
187
188
  }),
188
- group: (n) => (a.current.has(n) || a.current.set(n, /* @__PURE__ */ new Set()), () => {
189
- o.current.delete(n), a.current.delete(n);
189
+ group: (n) => (o.current.has(n) || o.current.set(n, /* @__PURE__ */ new Set()), () => {
190
+ a.current.delete(n), o.current.delete(n);
190
191
  }),
191
192
  filter: () => m.current.shouldFilter,
192
193
  label: g || e["aria-label"],
@@ -198,14 +199,14 @@ var $ = [
198
199
  }), []);
199
200
  function ue(n, s) {
200
201
  var f, u;
201
- let v = (u = (f = m.current) == null ? void 0 : f.filter) != null ? u : lt;
202
+ let v = (u = (f = m.current) == null ? void 0 : f.filter) != null ? u : ot;
202
203
  return n ? v(n, r.current.search, s) : 0;
203
204
  }
204
205
  function Z() {
205
206
  if (!r.current.search || m.current.shouldFilter === !1) return;
206
207
  let n = r.current.filtered.items, s = [];
207
208
  r.current.filtered.groups.forEach((u) => {
208
- let v = a.current.get(u), b = 0;
209
+ let v = o.current.get(u), b = 0;
209
210
  v.forEach((C) => {
210
211
  let k = n.get(C);
211
212
  b = Math.max(k, b);
@@ -214,8 +215,8 @@ var $ = [
214
215
  let f = N.current;
215
216
  z().sort((u, v) => {
216
217
  var b, C;
217
- let k = u.getAttribute("id"), Ie = v.getAttribute("id");
218
- return ((b = n.get(Ie)) != null ? b : 0) - ((C = n.get(k)) != null ? C : 0);
218
+ let k = u.getAttribute("id"), Re = v.getAttribute("id");
219
+ return ((b = n.get(Re)) != null ? b : 0) - ((C = n.get(k)) != null ? C : 0);
219
220
  }).forEach((u) => {
220
221
  let v = u.closest(ne);
221
222
  v ? v.appendChild(u.parentElement === v ? u : u.closest(`${ne} > *`)) : f.appendChild(u.parentElement === f ? u : u.closest(`${ne} > *`));
@@ -238,10 +239,10 @@ var $ = [
238
239
  r.current.filtered.groups = /* @__PURE__ */ new Set();
239
240
  let v = 0;
240
241
  for (let b of i.current) {
241
- let C = ue((s = (n = o.current.get(b)) == null ? void 0 : n.value) != null ? s : "", (u = (f = o.current.get(b)) == null ? void 0 : f.keywords) != null ? u : []);
242
+ let C = ue((s = (n = a.current.get(b)) == null ? void 0 : n.value) != null ? s : "", (u = (f = a.current.get(b)) == null ? void 0 : f.keywords) != null ? u : []);
242
243
  r.current.filtered.items.set(b, C), C > 0 && v++;
243
244
  }
244
- for (let [b, C] of a.current) for (let k of C) if (r.current.filtered.items.get(k) > 0) {
245
+ for (let [b, C] of o.current) for (let k of C) if (r.current.filtered.items.get(k) > 0) {
245
246
  r.current.filtered.groups.add(b);
246
247
  break;
247
248
  }
@@ -250,11 +251,11 @@ var $ = [
250
251
  function ce() {
251
252
  var n, s, f;
252
253
  let u = j();
253
- u && (((n = u.parentElement) == null ? void 0 : n.firstChild) === u && ((f = (s = u.closest(K)) == null ? void 0 : s.querySelector(nt)) == null || f.scrollIntoView({ block: "nearest" })), u.scrollIntoView({ block: "nearest" }));
254
+ u && (((n = u.parentElement) == null ? void 0 : n.firstChild) === u && ((f = (s = u.closest(K)) == null ? void 0 : s.querySelector(lt)) == null || f.scrollIntoView({ block: "nearest" })), u.scrollIntoView({ block: "nearest" }));
254
255
  }
255
256
  function j() {
256
257
  var n;
257
- return (n = N.current) == null ? void 0 : n.querySelector(`${ye}[aria-selected="true"]`);
258
+ return (n = N.current) == null ? void 0 : n.querySelector(`${we}[aria-selected="true"]`);
258
259
  }
259
260
  function z() {
260
261
  var n;
@@ -271,7 +272,7 @@ var $ = [
271
272
  }
272
273
  function de(n) {
273
274
  let s = j(), f = s?.closest(K), u;
274
- for (; f && !u; ) f = n > 0 ? ft(f, K) : pt(f, K), u = f?.querySelector(ge);
275
+ for (; f && !u; ) f = n > 0 ? pt(f, K) : vt(f, K), u = f?.querySelector(ge);
275
276
  u ? E.setState("value", u.getAttribute(L)) : ee(n);
276
277
  }
277
278
  let se = () => Q(z().length - 1), me = (n) => {
@@ -313,7 +314,7 @@ var $ = [
313
314
  n.preventDefault();
314
315
  let u = j();
315
316
  if (u) {
316
- let v = new Event(ae);
317
+ let v = new Event(oe);
317
318
  u.dispatchEvent(v);
318
319
  }
319
320
  }
@@ -323,22 +324,22 @@ var $ = [
323
324
  "cmdk-label": "",
324
325
  htmlFor: Y.inputId,
325
326
  id: Y.labelId,
326
- style: ht
327
- }, g), B(e, (n) => l.createElement(xe.Provider, { value: E }, l.createElement(we.Provider, { value: Y }, n))));
327
+ style: bt
328
+ }, g), B(e, (n) => l.createElement(Ee.Provider, { value: E }, l.createElement(xe.Provider, { value: Y }, n))));
328
329
  }), at = l.forwardRef((e, t) => {
329
330
  var r, i;
330
- let a = F(), o = l.useRef(null), d = l.useContext(Ee), m = T(), g = ke(e), c = (i = (r = g.current) == null ? void 0 : r.forceMount) != null ? i : d?.forceMount;
331
+ let o = F(), a = l.useRef(null), d = l.useContext(Ce), m = T(), g = Se(e), c = (i = (r = g.current) == null ? void 0 : r.forceMount) != null ? i : d?.forceMount;
331
332
  P(() => {
332
- if (!c) return m.item(a, d?.id);
333
+ if (!c) return m.item(o, d?.id);
333
334
  }, [c]);
334
- let p = Se(a, o, [
335
+ let p = Ie(o, a, [
335
336
  e.value,
336
337
  e.children,
337
- o
338
- ], e.keywords), h = oe(), S = A((y) => y.value && y.value === p.current), x = A((y) => c || m.filter() === !1 ? !0 : y.search ? y.filtered.items.get(a) > 0 : !0);
338
+ a
339
+ ], e.keywords), h = ae(), S = A((y) => y.value && y.value === p.current), x = A((y) => c || m.filter() === !1 ? !0 : y.search ? y.filtered.items.get(o) > 0 : !0);
339
340
  l.useEffect(() => {
340
- let y = o.current;
341
- if (!(!y || e.disabled)) return y.addEventListener(ae, R), () => y.removeEventListener(ae, R);
341
+ let y = a.current;
342
+ if (!(!y || e.disabled)) return y.addEventListener(oe, R), () => y.removeEventListener(oe, R);
342
343
  }, [
343
344
  x,
344
345
  e.onSelect,
@@ -354,9 +355,9 @@ var $ = [
354
355
  if (!x) return null;
355
356
  let { disabled: D, value: q, onSelect: H, forceMount: ie, keywords: U, ...N } = e;
356
357
  return l.createElement($.div, {
357
- ref: O(o, t),
358
+ ref: O(a, t),
358
359
  ...N,
359
- id: a,
360
+ id: o,
360
361
  "cmdk-item": "",
361
362
  role: "option",
362
363
  "aria-disabled": !!D,
@@ -366,20 +367,20 @@ var $ = [
366
367
  onPointerMove: D || m.getDisablePointerSelection() ? void 0 : G,
367
368
  onClick: D ? void 0 : R
368
369
  }, e.children);
369
- }), ot = l.forwardRef((e, t) => {
370
- let { heading: r, children: i, forceMount: a, ...o } = e, d = F(), m = l.useRef(null), g = l.useRef(null), c = F(), p = T(), h = A((x) => a || p.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(d) : !0);
371
- P(() => p.group(d), []), Se(d, m, [
370
+ }), it = l.forwardRef((e, t) => {
371
+ let { heading: r, children: i, forceMount: o, ...a } = e, d = F(), m = l.useRef(null), g = l.useRef(null), c = F(), p = T(), h = A((x) => o || p.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(d) : !0);
372
+ P(() => p.group(d), []), Ie(d, m, [
372
373
  e.value,
373
374
  e.heading,
374
375
  g
375
376
  ]);
376
377
  let S = l.useMemo(() => ({
377
378
  id: d,
378
- forceMount: a
379
- }), [a]);
379
+ forceMount: o
380
+ }), [o]);
380
381
  return l.createElement($.div, {
381
382
  ref: O(m, t),
382
- ...o,
383
+ ...a,
383
384
  "cmdk-group": "",
384
385
  role: "presentation",
385
386
  hidden: h ? void 0 : !0
@@ -392,19 +393,19 @@ var $ = [
392
393
  "cmdk-group-items": "",
393
394
  role: "group",
394
395
  "aria-labelledby": r ? c : void 0
395
- }, l.createElement(Ee.Provider, { value: S }, x))));
396
- }), it = l.forwardRef((e, t) => {
397
- let { alwaysRender: r, ...i } = e, a = l.useRef(null), o = A((d) => !d.search);
398
- return !r && !o ? null : l.createElement($.div, {
399
- ref: O(a, t),
396
+ }, l.createElement(Ce.Provider, { value: S }, x))));
397
+ }), ut = l.forwardRef((e, t) => {
398
+ let { alwaysRender: r, ...i } = e, o = l.useRef(null), a = A((d) => !d.search);
399
+ return !r && !a ? null : l.createElement($.div, {
400
+ ref: O(o, t),
400
401
  ...i,
401
402
  "cmdk-separator": "",
402
403
  role: "separator"
403
404
  });
404
- }), ut = l.forwardRef((e, t) => {
405
- let { onValueChange: r, ...i } = e, a = e.value != null, o = oe(), d = A((c) => c.search), m = A((c) => c.selectedItemId), g = T();
405
+ }), ct = l.forwardRef((e, t) => {
406
+ let { onValueChange: r, ...i } = e, o = e.value != null, a = ae(), d = A((c) => c.search), m = A((c) => c.selectedItemId), g = T();
406
407
  return l.useEffect(() => {
407
- e.value != null && o.setState("search", e.value);
408
+ e.value != null && a.setState("search", e.value);
408
409
  }, [e.value]), l.createElement($.input, {
409
410
  ref: t,
410
411
  ...i,
@@ -420,16 +421,16 @@ var $ = [
420
421
  "aria-activedescendant": m,
421
422
  id: g.inputId,
422
423
  type: "text",
423
- value: a ? e.value : d,
424
+ value: o ? e.value : d,
424
425
  onChange: (c) => {
425
- a || o.setState("search", c.target.value), r?.(c.target.value);
426
+ o || a.setState("search", c.target.value), r?.(c.target.value);
426
427
  }
427
428
  });
428
- }), ct = l.forwardRef((e, t) => {
429
- let { children: r, label: i = "Suggestions", ...a } = e, o = l.useRef(null), d = l.useRef(null), m = A((c) => c.selectedItemId), g = T();
429
+ }), dt = l.forwardRef((e, t) => {
430
+ let { children: r, label: i = "Suggestions", ...o } = e, a = l.useRef(null), d = l.useRef(null), m = A((c) => c.selectedItemId), g = T();
430
431
  return l.useEffect(() => {
431
- if (d.current && o.current) {
432
- let c = d.current, p = o.current, h, S = new ResizeObserver(() => {
432
+ if (d.current && a.current) {
433
+ let c = d.current, p = a.current, h, S = new ResizeObserver(() => {
433
434
  h = requestAnimationFrame(() => {
434
435
  let x = c.offsetHeight;
435
436
  p.style.setProperty("--cmdk-list-height", x.toFixed(1) + "px");
@@ -440,8 +441,8 @@ var $ = [
440
441
  };
441
442
  }
442
443
  }, []), l.createElement($.div, {
443
- ref: O(o, t),
444
- ...a,
444
+ ref: O(a, t),
445
+ ...o,
445
446
  "cmdk-list": "",
446
447
  role: "listbox",
447
448
  tabIndex: -1,
@@ -452,64 +453,64 @@ var $ = [
452
453
  ref: O(d, g.listInnerRef),
453
454
  "cmdk-list-sizer": ""
454
455
  }, c)));
455
- }), dt = l.forwardRef((e, t) => {
456
- let { open: r, onOpenChange: i, overlayClassName: a, contentClassName: o, container: d, ...m } = e;
457
- return l.createElement(Pe, {
456
+ }), st = l.forwardRef((e, t) => {
457
+ let { open: r, onOpenChange: i, overlayClassName: o, contentClassName: a, container: d, ...m } = e;
458
+ return l.createElement(Me, {
458
459
  open: r,
459
460
  onOpenChange: i
460
- }, l.createElement($e, { container: d }, l.createElement(De, {
461
+ }, l.createElement(De, { container: d }, l.createElement(Ne, {
461
462
  "cmdk-overlay": "",
462
- className: a
463
- }), l.createElement(Ne, {
463
+ className: o
464
+ }), l.createElement(Pe, {
464
465
  "aria-label": e.label,
465
466
  "cmdk-dialog": "",
466
- className: o
467
- }, l.createElement(Ce, {
467
+ className: a
468
+ }, l.createElement(ke, {
468
469
  ref: t,
469
470
  ...m
470
471
  }))));
471
- }), st = l.forwardRef((e, t) => A((r) => r.filtered.count === 0) ? l.createElement($.div, {
472
+ }), mt = l.forwardRef((e, t) => A((r) => r.filtered.count === 0) ? l.createElement($.div, {
472
473
  ref: t,
473
474
  ...e,
474
475
  "cmdk-empty": "",
475
476
  role: "presentation"
476
- }) : null), mt = l.forwardRef((e, t) => {
477
- let { progress: r, children: i, label: a = "Loading...", ...o } = e;
477
+ }) : null), ft = l.forwardRef((e, t) => {
478
+ let { progress: r, children: i, label: o = "Loading...", ...a } = e;
478
479
  return l.createElement($.div, {
479
480
  ref: t,
480
- ...o,
481
+ ...a,
481
482
  "cmdk-loading": "",
482
483
  role: "progressbar",
483
484
  "aria-valuenow": r,
484
485
  "aria-valuemin": 0,
485
486
  "aria-valuemax": 100,
486
- "aria-label": a
487
+ "aria-label": o
487
488
  }, B(e, (d) => l.createElement("div", { "aria-hidden": !0 }, d)));
488
- }), M = Object.assign(Ce, {
489
- List: ct,
489
+ }), M = Object.assign(ke, {
490
+ List: dt,
490
491
  Item: at,
491
- Input: ut,
492
- Group: ot,
493
- Separator: it,
494
- Dialog: dt,
495
- Empty: st,
496
- Loading: mt
492
+ Input: ct,
493
+ Group: it,
494
+ Separator: ut,
495
+ Dialog: st,
496
+ Empty: mt,
497
+ Loading: ft
497
498
  });
498
- function ft(e, t) {
499
+ function pt(e, t) {
499
500
  let r = e.nextElementSibling;
500
501
  for (; r; ) {
501
502
  if (r.matches(t)) return r;
502
503
  r = r.nextElementSibling;
503
504
  }
504
505
  }
505
- function pt(e, t) {
506
+ function vt(e, t) {
506
507
  let r = e.previousElementSibling;
507
508
  for (; r; ) {
508
509
  if (r.matches(t)) return r;
509
510
  r = r.previousElementSibling;
510
511
  }
511
512
  }
512
- function ke(e) {
513
+ function Se(e) {
513
514
  let t = l.useRef(e);
514
515
  return P(() => {
515
516
  t.current = e;
@@ -521,39 +522,39 @@ function V(e) {
521
522
  return t.current === void 0 && (t.current = e()), t;
522
523
  }
523
524
  function A(e) {
524
- let t = oe(), r = () => e(t.snapshot());
525
+ let t = ae(), r = () => e(t.snapshot());
525
526
  return l.useSyncExternalStore(t.subscribe, r, r);
526
527
  }
527
- function Se(e, t, r, i = []) {
528
- let a = l.useRef(), o = T();
528
+ function Ie(e, t, r, i = []) {
529
+ let o = l.useRef(), a = T();
529
530
  return P(() => {
530
531
  var d;
531
532
  let m = (() => {
532
533
  var c;
533
534
  for (let p of r) {
534
535
  if (typeof p == "string") return p.trim();
535
- if (typeof p == "object" && "current" in p) return p.current ? (c = p.current.textContent) == null ? void 0 : c.trim() : a.current;
536
+ if (typeof p == "object" && "current" in p) return p.current ? (c = p.current.textContent) == null ? void 0 : c.trim() : o.current;
536
537
  }
537
538
  })(), g = i.map((c) => c.trim());
538
- o.value(e, m, g), (d = t.current) == null || d.setAttribute(L, m), a.current = m;
539
- }), a;
539
+ a.value(e, m, g), (d = t.current) == null || d.setAttribute(L, m), o.current = m;
540
+ }), o;
540
541
  }
541
- var vt = () => {
542
+ var gt = () => {
542
543
  let [e, t] = l.useState(), r = V(() => /* @__PURE__ */ new Map());
543
544
  return P(() => {
544
545
  r.current.forEach((i) => i()), r.current = /* @__PURE__ */ new Map();
545
- }, [e]), (i, a) => {
546
- r.current.set(i, a), t({});
546
+ }, [e]), (i, o) => {
547
+ r.current.set(i, o), t({});
547
548
  };
548
549
  };
549
- function gt(e) {
550
+ function ht(e) {
550
551
  let t = e.type;
551
552
  return typeof t == "function" ? t(e.props) : "render" in t ? t.render(e.props) : e;
552
553
  }
553
554
  function B({ asChild: e, children: t }, r) {
554
- return e && l.isValidElement(t) ? l.cloneElement(gt(t), { ref: t.ref }, r(t.props.children)) : r(t);
555
+ return e && l.isValidElement(t) ? l.cloneElement(ht(t), { ref: t.ref }, r(t.props.children)) : r(t);
555
556
  }
556
- var ht = {
557
+ var bt = {
557
558
  position: "absolute",
558
559
  width: "1px",
559
560
  height: "1px",
@@ -564,77 +565,83 @@ var ht = {
564
565
  whiteSpace: "nowrap",
565
566
  borderWidth: "0"
566
567
  };
567
- function It({ className: e, ...t }) {
568
+ function At({ className: e, ...t }) {
568
569
  return /* @__PURE__ */ w(M, {
569
570
  "data-slot": "command",
570
571
  className: I("flex size-full flex-col overflow-hidden rounded-4xl bg-popover p-1 text-popover-foreground", e),
571
572
  ...t
572
573
  });
573
574
  }
574
- function Rt({ title: e = "Command Palette", description: t = "Search for a command to run...", children: r, className: i, showCloseButton: a = !1, ...o }) {
575
- return /* @__PURE__ */ W(Me, {
576
- ...o,
577
- children: [/* @__PURE__ */ W(Ve, {
575
+ function $t({ title: e = "Command Palette", description: t = "Search for a command to run...", children: r, className: i, showCloseButton: o = !1, ...a }) {
576
+ return /* @__PURE__ */ W(je, {
577
+ ...a,
578
+ children: [/* @__PURE__ */ W(Fe, {
578
579
  className: "sr-only",
579
- children: [/* @__PURE__ */ w(Fe, { children: e }), /* @__PURE__ */ w(Le, { children: t })]
580
- }), /* @__PURE__ */ w(je, {
580
+ children: [/* @__PURE__ */ w(Oe, { children: e }), /* @__PURE__ */ w(Ve, { children: t })]
581
+ }), /* @__PURE__ */ w(Le, {
581
582
  className: I("top-1/3 translate-y-0 overflow-hidden rounded-4xl! p-0", i),
582
- showCloseButton: a,
583
+ showCloseButton: o,
583
584
  children: r
584
585
  })]
585
586
  });
586
587
  }
587
- function At({ className: e, ...t }) {
588
+ function Dt({ className: e, ...t }) {
588
589
  return /* @__PURE__ */ w("div", {
589
590
  "data-slot": "command-input-wrapper",
590
591
  className: "p-1 pb-0",
591
- children: /* @__PURE__ */ W(Re, {
592
- className: "h-9 bg-input/30",
592
+ children: /* @__PURE__ */ W(Ae, {
593
+ className: "h-9 bg-border/30",
593
594
  children: [/* @__PURE__ */ w(M.Input, {
594
595
  "data-slot": "command-input",
595
596
  className: I("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", e),
596
597
  ...t
597
- }), /* @__PURE__ */ w(Ae, { children: /* @__PURE__ */ w(ze, { className: "size-4 shrink-0 opacity-50" }) })]
598
+ }), /* @__PURE__ */ w($e, { children: /* @__PURE__ */ w(he, {
599
+ icon: Ke,
600
+ className: "size-4 shrink-0 opacity-50"
601
+ }) })]
598
602
  })
599
603
  });
600
604
  }
601
- function $t({ className: e, ...t }) {
605
+ function Nt({ className: e, ...t }) {
602
606
  return /* @__PURE__ */ w(M.List, {
603
607
  "data-slot": "command-list",
604
608
  className: I("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", e),
605
609
  ...t
606
610
  });
607
611
  }
608
- function Dt({ className: e, ...t }) {
612
+ function Pt({ className: e, ...t }) {
609
613
  return /* @__PURE__ */ w(M.Empty, {
610
614
  "data-slot": "command-empty",
611
615
  className: I("py-6 text-center text-sm", e),
612
616
  ...t
613
617
  });
614
618
  }
615
- function Nt({ className: e, ...t }) {
619
+ function Mt({ className: e, ...t }) {
616
620
  return /* @__PURE__ */ w(M.Group, {
617
621
  "data-slot": "command-group",
618
622
  className: I("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-3 **:[[cmdk-group-heading]]:py-2 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground", e),
619
623
  ...t
620
624
  });
621
625
  }
622
- function Pt({ className: e, ...t }) {
626
+ function jt({ className: e, ...t }) {
623
627
  return /* @__PURE__ */ w(M.Separator, {
624
628
  "data-slot": "command-separator",
625
629
  className: I("my-1 h-px bg-border/50", e),
626
630
  ...t
627
631
  });
628
632
  }
629
- function Mt({ className: e, children: t, ...r }) {
633
+ function Lt({ className: e, children: t, ...r }) {
630
634
  return /* @__PURE__ */ W(M.Item, {
631
635
  "data-slot": "command-item",
632
- className: I("group/command-item relative flex cursor-default items-center gap-2 rounded-lg px-3 py-2 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-2xl data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", e),
636
+ className: I("group/command-item relative flex cursor-default items-center gap-2 rounded-lg px-3 py-2 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-2xl data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-surface-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", e),
633
637
  ...r,
634
- children: [t, /* @__PURE__ */ w(Oe, { className: "ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })]
638
+ children: [t, /* @__PURE__ */ w(he, {
639
+ icon: ze,
640
+ className: "ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"
641
+ })]
635
642
  });
636
643
  }
637
- function jt({ className: e, ...t }) {
644
+ function Vt({ className: e, ...t }) {
638
645
  return /* @__PURE__ */ w("span", {
639
646
  "data-slot": "command-shortcut",
640
647
  className: I("ms-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", e),
@@ -642,15 +649,15 @@ function jt({ className: e, ...t }) {
642
649
  });
643
650
  }
644
651
  export {
645
- It as Command,
646
- Rt as CommandDialog,
647
- Dt as CommandEmpty,
648
- Nt as CommandGroup,
649
- At as CommandInput,
650
- Mt as CommandItem,
651
- $t as CommandList,
652
- Pt as CommandSeparator,
653
- jt as CommandShortcut
652
+ At as Command,
653
+ $t as CommandDialog,
654
+ Pt as CommandEmpty,
655
+ Mt as CommandGroup,
656
+ Dt as CommandInput,
657
+ Lt as CommandItem,
658
+ Nt as CommandList,
659
+ jt as CommandSeparator,
660
+ Vt as CommandShortcut
654
661
  };
655
662
 
656
663
  //# sourceMappingURL=command.js.map