@arcadeai/design-system 0.7.4 → 0.7.5

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.
@@ -1,53 +1,43 @@
1
1
  import { jsx as C, jsxs as ne } from "react/jsx-runtime";
2
- import { R as Se, P as Ie, O as Re, a as _e } from "../../../index-DLfXSskr.js";
2
+ import { R as Se, P as Ie, O as Re, a as Ae } from "../../../index-toVHZ337.js";
3
3
  import * as l from "react";
4
- import { P as _ } from "../../../index-CpDnqHCm.js";
5
- import { u as K } from "../../../index-Cv867SGx.js";
4
+ import { P as A } from "../../../index-CpDnqHCm.js";
5
+ import { u as j } from "../../../index-Cv867SGx.js";
6
6
  import { b as V } from "../../../index-5Bhkapwi.js";
7
- import { Dialog as Ae, DialogHeader as De, DialogTitle as Me, DialogDescription as Ne, DialogContent as $e } from "./dialog.js";
8
- import { c as A } from "../../../utils-CRiPKpXj.js";
9
- import { c as je } from "../../../createLucideIcon-XRdN60yz.js";
10
- /**
11
- * @license lucide-react v0.525.0 - ISC
12
- *
13
- * This source code is licensed under the ISC license.
14
- * See the LICENSE file in the root directory of this source tree.
15
- */
16
- const Pe = [
17
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
18
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
19
- ], Fe = je("search", Pe);
20
- var pe = 1, Ke = 0.9, Le = 0.8, qe = 0.17, ee = 0.1, te = 0.999, Ve = 0.9999, ze = 0.99, Oe = /[\\\/_+.#"@\[\(\{&]/, Be = /[\\\/_+.#"@\[\(\{&]/g, Ge = /[\s-]/, he = /[\s-]/g;
21
- function le(e, n, r, s, o, i, d) {
22
- if (i === n.length) return o === e.length ? pe : ze;
7
+ import { SearchIcon as De } from "lucide-react";
8
+ import { Dialog as _e, DialogHeader as Me, DialogTitle as $e, DialogDescription as Ne, DialogContent as Pe } from "./dialog.js";
9
+ import { c as D } from "../../../utils-CRiPKpXj.js";
10
+ var pe = 1, Fe = 0.9, Ke = 0.8, je = 0.17, ee = 0.1, te = 0.999, Le = 0.9999, qe = 0.99, Ve = /[\\\/_+.#"@\[\(\{&]/, ze = /[\\\/_+.#"@\[\(\{&]/g, Oe = /[\s-]/, he = /[\s-]/g;
11
+ function le(e, n, r, s, o, i, c) {
12
+ if (i === n.length) return o === e.length ? pe : qe;
23
13
  var f = `${o},${i}`;
24
- if (d[f] !== void 0) return d[f];
25
- for (var b = s.charAt(i), u = r.indexOf(b, o), v = 0, g, S, y, I; u >= 0; ) g = le(e, n, r, s, u + 1, i + 1, d), g > v && (u === o ? g *= pe : Oe.test(e.charAt(u - 1)) ? (g *= Le, y = e.slice(o, u - 1).match(Be), y && o > 0 && (g *= Math.pow(te, y.length))) : Ge.test(e.charAt(u - 1)) ? (g *= Ke, I = e.slice(o, u - 1).match(he), I && o > 0 && (g *= Math.pow(te, I.length))) : (g *= qe, o > 0 && (g *= Math.pow(te, u - o))), e.charAt(u) !== n.charAt(i) && (g *= Ve)), (g < ee && r.charAt(u - 1) === s.charAt(i + 1) || s.charAt(i + 1) === s.charAt(i) && r.charAt(u - 1) !== s.charAt(i)) && (S = le(e, n, r, s, u + 1, i + 2, d), S * ee > g && (g = S * ee)), g > v && (v = g), u = r.indexOf(b, u + 1);
26
- return d[f] = v, v;
14
+ if (c[f] !== void 0) return c[f];
15
+ for (var b = s.charAt(i), u = r.indexOf(b, o), v = 0, g, S, w, I; u >= 0; ) g = le(e, n, r, s, u + 1, i + 1, c), g > v && (u === o ? g *= pe : Ve.test(e.charAt(u - 1)) ? (g *= Ke, w = e.slice(o, u - 1).match(ze), w && o > 0 && (g *= Math.pow(te, w.length))) : Oe.test(e.charAt(u - 1)) ? (g *= Fe, I = e.slice(o, u - 1).match(he), I && o > 0 && (g *= Math.pow(te, I.length))) : (g *= je, o > 0 && (g *= Math.pow(te, u - o))), e.charAt(u) !== n.charAt(i) && (g *= Le)), (g < ee && r.charAt(u - 1) === s.charAt(i + 1) || s.charAt(i + 1) === s.charAt(i) && r.charAt(u - 1) !== s.charAt(i)) && (S = le(e, n, r, s, u + 1, i + 2, c), S * ee > g && (g = S * ee)), g > v && (v = g), u = r.indexOf(b, u + 1);
16
+ return c[f] = v, v;
27
17
  }
28
18
  function ve(e) {
29
19
  return e.toLowerCase().replace(he, " ");
30
20
  }
31
- function He(e, n, r) {
21
+ function Be(e, n, r) {
32
22
  return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, le(e, n, ve(e), ve(n), 0, 0, {});
33
23
  }
34
- var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-heading=""]', be = '[cmdk-item=""]', ge = `${be}:not([aria-disabled="true"])`, ae = "cmdk-item-select", P = "data-value", Ue = (e, n, r) => He(e, n, r), xe = l.createContext(void 0), z = () => l.useContext(xe), ke = l.createContext(void 0), oe = () => l.useContext(ke), ye = l.createContext(void 0), we = l.forwardRef((e, n) => {
35
- let r = F(() => {
36
- var t, c;
37
- return { search: "", value: (c = (t = e.value) != null ? t : e.defaultValue) != null ? c : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
38
- }), s = F(() => /* @__PURE__ */ new Set()), o = F(() => /* @__PURE__ */ new Map()), i = F(() => /* @__PURE__ */ new Map()), d = F(() => /* @__PURE__ */ new Set()), f = Ee(e), { label: b, children: u, value: v, onValueChange: g, filter: S, shouldFilter: y, loop: I, disablePointerSelection: H = !1, vimBindings: D = !0, ...O } = e, T = K(), ue = K(), U = K(), M = l.useRef(null), x = lt();
39
- N(() => {
24
+ var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Ge = '[cmdk-group-heading=""]', be = '[cmdk-item=""]', ge = `${be}:not([aria-disabled="true"])`, ae = "cmdk-item-select", F = "data-value", He = (e, n, r) => Be(e, n, r), xe = l.createContext(void 0), z = () => l.useContext(xe), ke = l.createContext(void 0), oe = () => l.useContext(ke), we = l.createContext(void 0), ye = l.forwardRef((e, n) => {
25
+ let r = K(() => {
26
+ var t, d;
27
+ return { search: "", value: (d = (t = e.value) != null ? t : e.defaultValue) != null ? d : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
28
+ }), s = K(() => /* @__PURE__ */ new Set()), o = K(() => /* @__PURE__ */ new Map()), i = K(() => /* @__PURE__ */ new Map()), c = K(() => /* @__PURE__ */ new Set()), f = Ee(e), { label: b, children: u, value: v, onValueChange: g, filter: S, shouldFilter: w, loop: I, disablePointerSelection: H = !1, vimBindings: _ = !0, ...O } = e, T = j(), ue = j(), U = j(), M = l.useRef(null), x = rt();
29
+ $(() => {
40
30
  if (v !== void 0) {
41
31
  let t = v.trim();
42
- r.current.value = t, w.emit();
32
+ r.current.value = t, y.emit();
43
33
  }
44
- }, [v]), N(() => {
45
- x(6, ce);
34
+ }, [v]), $(() => {
35
+ x(6, de);
46
36
  }, []);
47
- let w = l.useMemo(() => ({ subscribe: (t) => (d.current.add(t), () => d.current.delete(t)), snapshot: () => r.current, setState: (t, c, m) => {
37
+ let y = l.useMemo(() => ({ subscribe: (t) => (c.current.add(t), () => c.current.delete(t)), snapshot: () => r.current, setState: (t, d, m) => {
48
38
  var a, p, h, E;
49
- if (!Object.is(r.current[t], c)) {
50
- if (r.current[t] = c, t === "search") Y(), J(), x(1, X);
39
+ if (!Object.is(r.current[t], d)) {
40
+ if (r.current[t] = d, t === "search") Y(), J(), x(1, X);
51
41
  else if (t === "value") {
52
42
  if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
53
43
  let k = document.getElementById(U);
@@ -55,47 +45,47 @@ var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-headi
55
45
  }
56
46
  if (x(7, () => {
57
47
  var k;
58
- r.current.selectedItemId = (k = j()) == null ? void 0 : k.id, w.emit();
59
- }), m || x(5, ce), ((p = f.current) == null ? void 0 : p.value) !== void 0) {
60
- let k = c ?? "";
48
+ r.current.selectedItemId = (k = P()) == null ? void 0 : k.id, y.emit();
49
+ }), m || x(5, de), ((p = f.current) == null ? void 0 : p.value) !== void 0) {
50
+ let k = d ?? "";
61
51
  (E = (h = f.current).onValueChange) == null || E.call(h, k);
62
52
  return;
63
53
  }
64
54
  }
65
- w.emit();
55
+ y.emit();
66
56
  }
67
57
  }, emit: () => {
68
- d.current.forEach((t) => t());
69
- } }), []), W = l.useMemo(() => ({ value: (t, c, m) => {
58
+ c.current.forEach((t) => t());
59
+ } }), []), W = l.useMemo(() => ({ value: (t, d, m) => {
70
60
  var a;
71
- c !== ((a = i.current.get(t)) == null ? void 0 : a.value) && (i.current.set(t, { value: c, keywords: m }), r.current.filtered.items.set(t, ie(c, m)), x(2, () => {
72
- J(), w.emit();
61
+ d !== ((a = i.current.get(t)) == null ? void 0 : a.value) && (i.current.set(t, { value: d, keywords: m }), r.current.filtered.items.set(t, ie(d, m)), x(2, () => {
62
+ J(), y.emit();
73
63
  }));
74
- }, item: (t, c) => (s.current.add(t), c && (o.current.has(c) ? o.current.get(c).add(t) : o.current.set(c, /* @__PURE__ */ new Set([t]))), x(3, () => {
75
- Y(), J(), r.current.value || X(), w.emit();
64
+ }, item: (t, d) => (s.current.add(t), d && (o.current.has(d) ? o.current.get(d).add(t) : o.current.set(d, /* @__PURE__ */ new Set([t]))), x(3, () => {
65
+ Y(), J(), r.current.value || X(), y.emit();
76
66
  }), () => {
77
67
  i.current.delete(t), s.current.delete(t), r.current.filtered.items.delete(t);
78
- let m = j();
68
+ let m = P();
79
69
  x(4, () => {
80
- Y(), m?.getAttribute("id") === t && X(), w.emit();
70
+ Y(), m?.getAttribute("id") === t && X(), y.emit();
81
71
  });
82
72
  }), group: (t) => (o.current.has(t) || o.current.set(t, /* @__PURE__ */ new Set()), () => {
83
73
  i.current.delete(t), o.current.delete(t);
84
74
  }), filter: () => f.current.shouldFilter, label: b || e["aria-label"], getDisablePointerSelection: () => f.current.disablePointerSelection, listId: T, inputId: U, labelId: ue, listInnerRef: M }), []);
85
- function ie(t, c) {
75
+ function ie(t, d) {
86
76
  var m, a;
87
- let p = (a = (m = f.current) == null ? void 0 : m.filter) != null ? a : Ue;
88
- return t ? p(t, r.current.search, c) : 0;
77
+ let p = (a = (m = f.current) == null ? void 0 : m.filter) != null ? a : He;
78
+ return t ? p(t, r.current.search, d) : 0;
89
79
  }
90
80
  function J() {
91
81
  if (!r.current.search || f.current.shouldFilter === !1) return;
92
- let t = r.current.filtered.items, c = [];
82
+ let t = r.current.filtered.items, d = [];
93
83
  r.current.filtered.groups.forEach((a) => {
94
84
  let p = o.current.get(a), h = 0;
95
85
  p.forEach((E) => {
96
86
  let k = t.get(E);
97
87
  h = Math.max(k, h);
98
- }), c.push([a, h]);
88
+ }), d.push([a, h]);
99
89
  });
100
90
  let m = M.current;
101
91
  L().sort((a, p) => {
@@ -105,18 +95,18 @@ var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-headi
105
95
  }).forEach((a) => {
106
96
  let p = a.closest(re);
107
97
  p ? p.appendChild(a.parentElement === p ? a : a.closest(`${re} > *`)) : m.appendChild(a.parentElement === m ? a : a.closest(`${re} > *`));
108
- }), c.sort((a, p) => p[1] - a[1]).forEach((a) => {
98
+ }), d.sort((a, p) => p[1] - a[1]).forEach((a) => {
109
99
  var p;
110
- let h = (p = M.current) == null ? void 0 : p.querySelector(`${q}[${P}="${encodeURIComponent(a[0])}"]`);
100
+ let h = (p = M.current) == null ? void 0 : p.querySelector(`${q}[${F}="${encodeURIComponent(a[0])}"]`);
111
101
  h?.parentElement.appendChild(h);
112
102
  });
113
103
  }
114
104
  function X() {
115
- let t = L().find((m) => m.getAttribute("aria-disabled") !== "true"), c = t?.getAttribute(P);
116
- w.setState("value", c || void 0);
105
+ let t = L().find((m) => m.getAttribute("aria-disabled") !== "true"), d = t?.getAttribute(F);
106
+ y.setState("value", d || void 0);
117
107
  }
118
108
  function Y() {
119
- var t, c, m, a;
109
+ var t, d, m, a;
120
110
  if (!r.current.search || f.current.shouldFilter === !1) {
121
111
  r.current.filtered.count = s.current.size;
122
112
  return;
@@ -124,7 +114,7 @@ var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-headi
124
114
  r.current.filtered.groups = /* @__PURE__ */ new Set();
125
115
  let p = 0;
126
116
  for (let h of s.current) {
127
- let E = (c = (t = i.current.get(h)) == null ? void 0 : t.value) != null ? c : "", k = (a = (m = i.current.get(h)) == null ? void 0 : m.keywords) != null ? a : [], B = ie(E, k);
117
+ let E = (d = (t = i.current.get(h)) == null ? void 0 : t.value) != null ? d : "", k = (a = (m = i.current.get(h)) == null ? void 0 : m.keywords) != null ? a : [], B = ie(E, k);
128
118
  r.current.filtered.items.set(h, B), B > 0 && p++;
129
119
  }
130
120
  for (let [h, E] of o.current) for (let k of E) if (r.current.filtered.items.get(k) > 0) {
@@ -133,12 +123,12 @@ var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-headi
133
123
  }
134
124
  r.current.filtered.count = p;
135
125
  }
136
- function ce() {
137
- var t, c, m;
138
- let a = j();
139
- a && (((t = a.parentElement) == null ? void 0 : t.firstChild) === a && ((m = (c = a.closest(q)) == null ? void 0 : c.querySelector(Te)) == null || m.scrollIntoView({ block: "nearest" })), a.scrollIntoView({ block: "nearest" }));
126
+ function de() {
127
+ var t, d, m;
128
+ let a = P();
129
+ a && (((t = a.parentElement) == null ? void 0 : t.firstChild) === a && ((m = (d = a.closest(q)) == null ? void 0 : d.querySelector(Ge)) == null || m.scrollIntoView({ block: "nearest" })), a.scrollIntoView({ block: "nearest" }));
140
130
  }
141
- function j() {
131
+ function P() {
142
132
  var t;
143
133
  return (t = M.current) == null ? void 0 : t.querySelector(`${be}[aria-selected="true"]`);
144
134
  }
@@ -147,32 +137,32 @@ var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-headi
147
137
  return Array.from(((t = M.current) == null ? void 0 : t.querySelectorAll(ge)) || []);
148
138
  }
149
139
  function Q(t) {
150
- let c = L()[t];
151
- c && w.setState("value", c.getAttribute(P));
140
+ let d = L()[t];
141
+ d && y.setState("value", d.getAttribute(F));
152
142
  }
153
143
  function Z(t) {
154
- var c;
155
- let m = j(), a = L(), p = a.findIndex((E) => E === m), h = a[p + t];
156
- (c = f.current) != null && c.loop && (h = p + t < 0 ? a[a.length - 1] : p + t === a.length ? a[0] : a[p + t]), h && w.setState("value", h.getAttribute(P));
144
+ var d;
145
+ let m = P(), a = L(), p = a.findIndex((E) => E === m), h = a[p + t];
146
+ (d = f.current) != null && d.loop && (h = p + t < 0 ? a[a.length - 1] : p + t === a.length ? a[0] : a[p + t]), h && y.setState("value", h.getAttribute(F));
157
147
  }
158
- function de(t) {
159
- let c = j(), m = c?.closest(q), a;
160
- for (; m && !a; ) m = t > 0 ? rt(m, q) : nt(m, q), a = m?.querySelector(ge);
161
- a ? w.setState("value", a.getAttribute(P)) : Z(t);
148
+ function ce(t) {
149
+ let d = P(), m = d?.closest(q), a;
150
+ for (; m && !a; ) m = t > 0 ? et(m, q) : tt(m, q), a = m?.querySelector(ge);
151
+ a ? y.setState("value", a.getAttribute(F)) : Z(t);
162
152
  }
163
153
  let se = () => Q(L().length - 1), me = (t) => {
164
- t.preventDefault(), t.metaKey ? se() : t.altKey ? de(1) : Z(1);
154
+ t.preventDefault(), t.metaKey ? se() : t.altKey ? ce(1) : Z(1);
165
155
  }, fe = (t) => {
166
- t.preventDefault(), t.metaKey ? Q(0) : t.altKey ? de(-1) : Z(-1);
156
+ t.preventDefault(), t.metaKey ? Q(0) : t.altKey ? ce(-1) : Z(-1);
167
157
  };
168
- return l.createElement(_.div, { ref: n, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (t) => {
169
- var c;
170
- (c = O.onKeyDown) == null || c.call(O, t);
158
+ return l.createElement(A.div, { ref: n, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (t) => {
159
+ var d;
160
+ (d = O.onKeyDown) == null || d.call(O, t);
171
161
  let m = t.nativeEvent.isComposing || t.keyCode === 229;
172
162
  if (!(t.defaultPrevented || m)) switch (t.key) {
173
163
  case "n":
174
164
  case "j": {
175
- D && t.ctrlKey && me(t);
165
+ _ && t.ctrlKey && me(t);
176
166
  break;
177
167
  }
178
168
  case "ArrowDown": {
@@ -181,7 +171,7 @@ var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-headi
181
171
  }
182
172
  case "p":
183
173
  case "k": {
184
- D && t.ctrlKey && fe(t);
174
+ _ && t.ctrlKey && fe(t);
185
175
  break;
186
176
  }
187
177
  case "ArrowUp": {
@@ -198,80 +188,80 @@ var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-headi
198
188
  }
199
189
  case "Enter": {
200
190
  t.preventDefault();
201
- let a = j();
191
+ let a = P();
202
192
  if (a) {
203
193
  let p = new Event(ae);
204
194
  a.dispatchEvent(p);
205
195
  }
206
196
  }
207
197
  }
208
- } }, l.createElement("label", { "cmdk-label": "", htmlFor: W.inputId, id: W.labelId, style: ot }, b), G(e, (t) => l.createElement(ke.Provider, { value: w }, l.createElement(xe.Provider, { value: W }, t))));
209
- }), We = l.forwardRef((e, n) => {
198
+ } }, l.createElement("label", { "cmdk-label": "", htmlFor: W.inputId, id: W.labelId, style: lt }, b), G(e, (t) => l.createElement(ke.Provider, { value: y }, l.createElement(xe.Provider, { value: W }, t))));
199
+ }), Te = l.forwardRef((e, n) => {
210
200
  var r, s;
211
- let o = K(), i = l.useRef(null), d = l.useContext(ye), f = z(), b = Ee(e), u = (s = (r = b.current) == null ? void 0 : r.forceMount) != null ? s : d?.forceMount;
212
- N(() => {
213
- if (!u) return f.item(o, d?.id);
201
+ let o = j(), i = l.useRef(null), c = l.useContext(we), f = z(), b = Ee(e), u = (s = (r = b.current) == null ? void 0 : r.forceMount) != null ? s : c?.forceMount;
202
+ $(() => {
203
+ if (!u) return f.item(o, c?.id);
214
204
  }, [u]);
215
- let v = Ce(o, i, [e.value, e.children, i], e.keywords), g = oe(), S = R((x) => x.value && x.value === v.current), y = R((x) => u || f.filter() === !1 ? !0 : x.search ? x.filtered.items.get(o) > 0 : !0);
205
+ let v = Ce(o, i, [e.value, e.children, i], e.keywords), g = oe(), S = R((x) => x.value && x.value === v.current), w = R((x) => u || f.filter() === !1 ? !0 : x.search ? x.filtered.items.get(o) > 0 : !0);
216
206
  l.useEffect(() => {
217
207
  let x = i.current;
218
208
  if (!(!x || e.disabled)) return x.addEventListener(ae, I), () => x.removeEventListener(ae, I);
219
- }, [y, e.onSelect, e.disabled]);
209
+ }, [w, e.onSelect, e.disabled]);
220
210
  function I() {
221
- var x, w;
222
- H(), (w = (x = b.current).onSelect) == null || w.call(x, v.current);
211
+ var x, y;
212
+ H(), (y = (x = b.current).onSelect) == null || y.call(x, v.current);
223
213
  }
224
214
  function H() {
225
215
  g.setState("value", v.current, !0);
226
216
  }
227
- if (!y) return null;
228
- let { disabled: D, value: O, onSelect: T, forceMount: ue, keywords: U, ...M } = e;
229
- return l.createElement(_.div, { ref: V(i, n), ...M, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!D, "aria-selected": !!S, "data-disabled": !!D, "data-selected": !!S, onPointerMove: D || f.getDisablePointerSelection() ? void 0 : H, onClick: D ? void 0 : I }, e.children);
217
+ if (!w) return null;
218
+ let { disabled: _, value: O, onSelect: T, forceMount: ue, keywords: U, ...M } = e;
219
+ return l.createElement(A.div, { ref: V(i, n), ...M, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!_, "aria-selected": !!S, "data-disabled": !!_, "data-selected": !!S, onPointerMove: _ || f.getDisablePointerSelection() ? void 0 : H, onClick: _ ? void 0 : I }, e.children);
220
+ }), Ue = l.forwardRef((e, n) => {
221
+ let { heading: r, children: s, forceMount: o, ...i } = e, c = j(), f = l.useRef(null), b = l.useRef(null), u = j(), v = z(), g = R((w) => o || v.filter() === !1 ? !0 : w.search ? w.filtered.groups.has(c) : !0);
222
+ $(() => v.group(c), []), Ce(c, f, [e.value, e.heading, b]);
223
+ let S = l.useMemo(() => ({ id: c, forceMount: o }), [o]);
224
+ return l.createElement(A.div, { ref: V(f, n), ...i, "cmdk-group": "", role: "presentation", hidden: g ? void 0 : !0 }, r && l.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, r), G(e, (w) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? u : void 0 }, l.createElement(we.Provider, { value: S }, w))));
225
+ }), We = l.forwardRef((e, n) => {
226
+ let { alwaysRender: r, ...s } = e, o = l.useRef(null), i = R((c) => !c.search);
227
+ return !r && !i ? null : l.createElement(A.div, { ref: V(o, n), ...s, "cmdk-separator": "", role: "separator" });
230
228
  }), Je = l.forwardRef((e, n) => {
231
- let { heading: r, children: s, forceMount: o, ...i } = e, d = K(), f = l.useRef(null), b = l.useRef(null), u = K(), v = z(), g = R((y) => o || v.filter() === !1 ? !0 : y.search ? y.filtered.groups.has(d) : !0);
232
- N(() => v.group(d), []), Ce(d, f, [e.value, e.heading, b]);
233
- let S = l.useMemo(() => ({ id: d, forceMount: o }), [o]);
234
- return l.createElement(_.div, { ref: V(f, n), ...i, "cmdk-group": "", role: "presentation", hidden: g ? void 0 : !0 }, r && l.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, r), G(e, (y) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? u : void 0 }, l.createElement(ye.Provider, { value: S }, y))));
235
- }), Xe = l.forwardRef((e, n) => {
236
- let { alwaysRender: r, ...s } = e, o = l.useRef(null), i = R((d) => !d.search);
237
- return !r && !i ? null : l.createElement(_.div, { ref: V(o, n), ...s, "cmdk-separator": "", role: "separator" });
238
- }), Ye = l.forwardRef((e, n) => {
239
- let { onValueChange: r, ...s } = e, o = e.value != null, i = oe(), d = R((u) => u.search), f = R((u) => u.selectedItemId), b = z();
229
+ let { onValueChange: r, ...s } = e, o = e.value != null, i = oe(), c = R((u) => u.search), f = R((u) => u.selectedItemId), b = z();
240
230
  return l.useEffect(() => {
241
231
  e.value != null && i.setState("search", e.value);
242
- }, [e.value]), l.createElement(_.input, { ref: n, ...s, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": f, id: b.inputId, type: "text", value: o ? e.value : d, onChange: (u) => {
232
+ }, [e.value]), l.createElement(A.input, { ref: n, ...s, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": f, id: b.inputId, type: "text", value: o ? e.value : c, onChange: (u) => {
243
233
  o || i.setState("search", u.target.value), r?.(u.target.value);
244
234
  } });
245
- }), Qe = l.forwardRef((e, n) => {
246
- let { children: r, label: s = "Suggestions", ...o } = e, i = l.useRef(null), d = l.useRef(null), f = R((u) => u.selectedItemId), b = z();
235
+ }), Xe = l.forwardRef((e, n) => {
236
+ let { children: r, label: s = "Suggestions", ...o } = e, i = l.useRef(null), c = l.useRef(null), f = R((u) => u.selectedItemId), b = z();
247
237
  return l.useEffect(() => {
248
- if (d.current && i.current) {
249
- let u = d.current, v = i.current, g, S = new ResizeObserver(() => {
238
+ if (c.current && i.current) {
239
+ let u = c.current, v = i.current, g, S = new ResizeObserver(() => {
250
240
  g = requestAnimationFrame(() => {
251
- let y = u.offsetHeight;
252
- v.style.setProperty("--cmdk-list-height", y.toFixed(1) + "px");
241
+ let w = u.offsetHeight;
242
+ v.style.setProperty("--cmdk-list-height", w.toFixed(1) + "px");
253
243
  });
254
244
  });
255
245
  return S.observe(u), () => {
256
246
  cancelAnimationFrame(g), S.unobserve(u);
257
247
  };
258
248
  }
259
- }, []), l.createElement(_.div, { ref: V(i, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": f, "aria-label": s, id: b.listId }, G(e, (u) => l.createElement("div", { ref: V(d, b.listInnerRef), "cmdk-list-sizer": "" }, u)));
260
- }), Ze = l.forwardRef((e, n) => {
261
- let { open: r, onOpenChange: s, overlayClassName: o, contentClassName: i, container: d, ...f } = e;
262
- return l.createElement(Se, { open: r, onOpenChange: s }, l.createElement(Ie, { container: d }, l.createElement(Re, { "cmdk-overlay": "", className: o }), l.createElement(_e, { "aria-label": e.label, "cmdk-dialog": "", className: i }, l.createElement(we, { ref: n, ...f }))));
263
- }), et = l.forwardRef((e, n) => R((r) => r.filtered.count === 0) ? l.createElement(_.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), tt = l.forwardRef((e, n) => {
249
+ }, []), l.createElement(A.div, { ref: V(i, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": f, "aria-label": s, id: b.listId }, G(e, (u) => l.createElement("div", { ref: V(c, b.listInnerRef), "cmdk-list-sizer": "" }, u)));
250
+ }), Ye = l.forwardRef((e, n) => {
251
+ let { open: r, onOpenChange: s, overlayClassName: o, contentClassName: i, container: c, ...f } = e;
252
+ return l.createElement(Se, { open: r, onOpenChange: s }, l.createElement(Ie, { container: c }, l.createElement(Re, { "cmdk-overlay": "", className: o }), l.createElement(Ae, { "aria-label": e.label, "cmdk-dialog": "", className: i }, l.createElement(ye, { ref: n, ...f }))));
253
+ }), Qe = l.forwardRef((e, n) => R((r) => r.filtered.count === 0) ? l.createElement(A.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), Ze = l.forwardRef((e, n) => {
264
254
  let { progress: r, children: s, label: o = "Loading...", ...i } = e;
265
- return l.createElement(_.div, { ref: n, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, G(e, (d) => l.createElement("div", { "aria-hidden": !0 }, d)));
266
- }), $ = Object.assign(we, { List: Qe, Item: We, Input: Ye, Group: Je, Separator: Xe, Dialog: Ze, Empty: et, Loading: tt });
267
- function rt(e, n) {
255
+ return l.createElement(A.div, { ref: n, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, G(e, (c) => l.createElement("div", { "aria-hidden": !0 }, c)));
256
+ }), N = Object.assign(ye, { List: Xe, Item: Te, Input: Je, Group: Ue, Separator: We, Dialog: Ye, Empty: Qe, Loading: Ze });
257
+ function et(e, n) {
268
258
  let r = e.nextElementSibling;
269
259
  for (; r; ) {
270
260
  if (r.matches(n)) return r;
271
261
  r = r.nextElementSibling;
272
262
  }
273
263
  }
274
- function nt(e, n) {
264
+ function tt(e, n) {
275
265
  let r = e.previousElementSibling;
276
266
  for (; r; ) {
277
267
  if (r.matches(n)) return r;
@@ -280,12 +270,12 @@ function nt(e, n) {
280
270
  }
281
271
  function Ee(e) {
282
272
  let n = l.useRef(e);
283
- return N(() => {
273
+ return $(() => {
284
274
  n.current = e;
285
275
  }), n;
286
276
  }
287
- var N = typeof window > "u" ? l.useEffect : l.useLayoutEffect;
288
- function F(e) {
277
+ var $ = typeof window > "u" ? l.useEffect : l.useLayoutEffect;
278
+ function K(e) {
289
279
  let n = l.useRef();
290
280
  return n.current === void 0 && (n.current = e()), n;
291
281
  }
@@ -295,8 +285,8 @@ function R(e) {
295
285
  }
296
286
  function Ce(e, n, r, s = []) {
297
287
  let o = l.useRef(), i = z();
298
- return N(() => {
299
- var d;
288
+ return $(() => {
289
+ var c;
300
290
  let f = (() => {
301
291
  var u;
302
292
  for (let v of r) {
@@ -304,33 +294,33 @@ function Ce(e, n, r, s = []) {
304
294
  if (typeof v == "object" && "current" in v) return v.current ? (u = v.current.textContent) == null ? void 0 : u.trim() : o.current;
305
295
  }
306
296
  })(), b = s.map((u) => u.trim());
307
- i.value(e, f, b), (d = n.current) == null || d.setAttribute(P, f), o.current = f;
297
+ i.value(e, f, b), (c = n.current) == null || c.setAttribute(F, f), o.current = f;
308
298
  }), o;
309
299
  }
310
- var lt = () => {
311
- let [e, n] = l.useState(), r = F(() => /* @__PURE__ */ new Map());
312
- return N(() => {
300
+ var rt = () => {
301
+ let [e, n] = l.useState(), r = K(() => /* @__PURE__ */ new Map());
302
+ return $(() => {
313
303
  r.current.forEach((s) => s()), r.current = /* @__PURE__ */ new Map();
314
304
  }, [e]), (s, o) => {
315
305
  r.current.set(s, o), n({});
316
306
  };
317
307
  };
318
- function at(e) {
308
+ function nt(e) {
319
309
  let n = e.type;
320
310
  return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
321
311
  }
322
312
  function G({ asChild: e, children: n }, r) {
323
- return e && l.isValidElement(n) ? l.cloneElement(at(n), { ref: n.ref }, r(n.props.children)) : r(n);
313
+ return e && l.isValidElement(n) ? l.cloneElement(nt(n), { ref: n.ref }, r(n.props.children)) : r(n);
324
314
  }
325
- var ot = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
326
- function ut({
315
+ var lt = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
316
+ function at({
327
317
  className: e,
328
318
  ...n
329
319
  }) {
330
320
  return /* @__PURE__ */ C(
331
- $,
321
+ N,
332
322
  {
333
- className: A(
323
+ className: D(
334
324
  "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
335
325
  e
336
326
  ),
@@ -339,7 +329,7 @@ function ut({
339
329
  }
340
330
  );
341
331
  }
342
- function gt({
332
+ function pt({
343
333
  title: e = "Command Palette",
344
334
  description: n = "Search for a command to run...",
345
335
  children: r,
@@ -347,22 +337,22 @@ function gt({
347
337
  showCloseButton: o = !0,
348
338
  ...i
349
339
  }) {
350
- return /* @__PURE__ */ ne(Ae, { ...i, children: [
351
- /* @__PURE__ */ ne(De, { className: "sr-only", children: [
352
- /* @__PURE__ */ C(Me, { children: e }),
340
+ return /* @__PURE__ */ ne(_e, { ...i, children: [
341
+ /* @__PURE__ */ ne(Me, { className: "sr-only", children: [
342
+ /* @__PURE__ */ C($e, { children: e }),
353
343
  /* @__PURE__ */ C(Ne, { children: n })
354
344
  ] }),
355
345
  /* @__PURE__ */ C(
356
- $e,
346
+ Pe,
357
347
  {
358
- className: A("overflow-hidden p-0", s),
348
+ className: D("overflow-hidden p-0", s),
359
349
  showCloseButton: o,
360
- children: /* @__PURE__ */ C(ut, { className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: r })
350
+ children: /* @__PURE__ */ C(at, { className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: r })
361
351
  }
362
352
  )
363
353
  ] });
364
354
  }
365
- function ht({
355
+ function vt({
366
356
  className: e,
367
357
  ...n
368
358
  }) {
@@ -372,11 +362,11 @@ function ht({
372
362
  className: "flex h-9 items-center gap-2 border-b px-3",
373
363
  "data-slot": "command-input-wrapper",
374
364
  children: [
375
- /* @__PURE__ */ C(Fe, { className: "size-4 shrink-0 opacity-50" }),
365
+ /* @__PURE__ */ C(De, { className: "size-4 shrink-0 opacity-50" }),
376
366
  /* @__PURE__ */ C(
377
- $.Input,
367
+ N.Input,
378
368
  {
379
- className: A(
369
+ className: D(
380
370
  "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
381
371
  e
382
372
  ),
@@ -388,14 +378,14 @@ function ht({
388
378
  }
389
379
  );
390
380
  }
391
- function bt({
381
+ function gt({
392
382
  className: e,
393
383
  ...n
394
384
  }) {
395
385
  return /* @__PURE__ */ C(
396
- $.List,
386
+ N.List,
397
387
  {
398
- className: A(
388
+ className: D(
399
389
  "max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",
400
390
  e
401
391
  ),
@@ -404,11 +394,11 @@ function bt({
404
394
  }
405
395
  );
406
396
  }
407
- function xt({
397
+ function ht({
408
398
  ...e
409
399
  }) {
410
400
  return /* @__PURE__ */ C(
411
- $.Empty,
401
+ N.Empty,
412
402
  {
413
403
  className: "py-6 text-center text-sm",
414
404
  "data-slot": "command-empty",
@@ -416,14 +406,14 @@ function xt({
416
406
  }
417
407
  );
418
408
  }
419
- function kt({
409
+ function bt({
420
410
  className: e,
421
411
  ...n
422
412
  }) {
423
413
  return /* @__PURE__ */ C(
424
- $.Group,
414
+ N.Group,
425
415
  {
426
- className: A(
416
+ className: D(
427
417
  "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",
428
418
  e
429
419
  ),
@@ -432,27 +422,27 @@ function kt({
432
422
  }
433
423
  );
434
424
  }
435
- function yt({
425
+ function xt({
436
426
  className: e,
437
427
  ...n
438
428
  }) {
439
429
  return /* @__PURE__ */ C(
440
- $.Separator,
430
+ N.Separator,
441
431
  {
442
- className: A("-mx-1 h-px bg-border", e),
432
+ className: D("-mx-1 h-px bg-border", e),
443
433
  "data-slot": "command-separator",
444
434
  ...n
445
435
  }
446
436
  );
447
437
  }
448
- function wt({
438
+ function kt({
449
439
  className: e,
450
440
  ...n
451
441
  }) {
452
442
  return /* @__PURE__ */ C(
453
- $.Item,
443
+ N.Item,
454
444
  {
455
- className: A(
445
+ className: D(
456
446
  "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
457
447
  e
458
448
  ),
@@ -461,14 +451,14 @@ function wt({
461
451
  }
462
452
  );
463
453
  }
464
- function Et({
454
+ function wt({
465
455
  className: e,
466
456
  ...n
467
457
  }) {
468
458
  return /* @__PURE__ */ C(
469
459
  "span",
470
460
  {
471
- className: A(
461
+ className: D(
472
462
  "ml-auto text-muted-foreground text-xs tracking-widest",
473
463
  e
474
464
  ),
@@ -478,13 +468,13 @@ function Et({
478
468
  );
479
469
  }
480
470
  export {
481
- ut as Command,
482
- gt as CommandDialog,
483
- xt as CommandEmpty,
484
- kt as CommandGroup,
485
- ht as CommandInput,
486
- wt as CommandItem,
487
- bt as CommandList,
488
- yt as CommandSeparator,
489
- Et as CommandShortcut
471
+ at as Command,
472
+ pt as CommandDialog,
473
+ ht as CommandEmpty,
474
+ bt as CommandGroup,
475
+ vt as CommandInput,
476
+ kt as CommandItem,
477
+ gt as CommandList,
478
+ xt as CommandSeparator,
479
+ wt as CommandShortcut
490
480
  };