ics-ui-kit 0.1.0-alpha.73 → 0.1.0-alpha.75

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,4 +1,4 @@
1
- import { jsx as x, jsxs as ae } from "react/jsx-runtime";
1
+ import { jsx as w, jsxs as ae } from "react/jsx-runtime";
2
2
  import * as a from "react";
3
3
  import { R as Re, P as Ne, O as De, a as Ae } from "./index-CQD-Njgt.js";
4
4
  import { P as A } from "./index-CFaU3UXv.js";
@@ -10,16 +10,16 @@ import { m as $e } from "./MenuItemShortcut-DgPol9Nz.js";
10
10
  import { m as _e } from "./MenuItemText-7uPl9P3z.js";
11
11
  import { I as Le } from "./Icon-DH3ev9GK.js";
12
12
  import { u as M } from "./ComponentVariantProvider-B0SFUaXB.js";
13
- import { b as Fe, g as je, a as Pe, D as Ke, e as Ve } from "./Dialog-Dthc9c-1.js";
13
+ import { b as Fe, g as je, a as Pe, D as Ke, e as Ve } from "./Dialog-ByiJIDhl.js";
14
14
  import { S as qe } from "./ScrollShadowContainer-DdrnF8qU.js";
15
15
  import { S as Oe } from "./search-CDdgqSGg.js";
16
- var ve = 1, Te = 0.9, Ge = 0.8, Be = 0.17, te = 0.1, re = 0.999, ze = 0.9999, He = 0.99, Ue = /[\\\/_+.#"@\[\(\{&]/, We = /[\\\/_+.#"@\[\(\{&]/g, Je = /[\s-]/, be = /[\s-]/g;
17
- function le(e, n, t, i, l, s, u) {
16
+ var ve = 1, Te = 0.9, Be = 0.8, Ge = 0.17, te = 0.1, re = 0.999, ze = 0.9999, He = 0.99, Ue = /[\\\/_+.#"@\[\(\{&]/, We = /[\\\/_+.#"@\[\(\{&]/g, Je = /[\s-]/, be = /[\s-]/g;
17
+ function le(e, n, t, i, l, s, c) {
18
18
  if (s === n.length) return l === e.length ? ve : He;
19
- var f = `${l},${s}`;
20
- if (u[f] !== void 0) return u[f];
21
- for (var b = i.charAt(s), d = t.indexOf(b, l), v = 0, h, I, S, N; d >= 0; ) h = le(e, n, t, i, d + 1, s + 1, u), h > v && (d === l ? h *= ve : Ue.test(e.charAt(d - 1)) ? (h *= Ge, S = e.slice(l, d - 1).match(We), S && l > 0 && (h *= Math.pow(re, S.length))) : Je.test(e.charAt(d - 1)) ? (h *= Te, N = e.slice(l, d - 1).match(be), N && l > 0 && (h *= Math.pow(re, N.length))) : (h *= Be, l > 0 && (h *= Math.pow(re, d - l))), e.charAt(d) !== n.charAt(s) && (h *= ze)), (h < te && t.charAt(d - 1) === i.charAt(s + 1) || i.charAt(s + 1) === i.charAt(s) && t.charAt(d - 1) !== i.charAt(s)) && (I = le(e, n, t, i, d + 1, s + 2, u), I * te > h && (h = I * te)), h > v && (v = h), d = t.indexOf(b, d + 1);
22
- return u[f] = v, v;
19
+ var m = `${l},${s}`;
20
+ if (c[m] !== void 0) return c[m];
21
+ for (var b = i.charAt(s), d = t.indexOf(b, l), v = 0, h, I, S, N; d >= 0; ) h = le(e, n, t, i, d + 1, s + 1, c), h > v && (d === l ? h *= ve : Ue.test(e.charAt(d - 1)) ? (h *= Be, S = e.slice(l, d - 1).match(We), S && l > 0 && (h *= Math.pow(re, S.length))) : Je.test(e.charAt(d - 1)) ? (h *= Te, N = e.slice(l, d - 1).match(be), N && l > 0 && (h *= Math.pow(re, N.length))) : (h *= Ge, l > 0 && (h *= Math.pow(re, d - l))), e.charAt(d) !== n.charAt(s) && (h *= ze)), (h < te && t.charAt(d - 1) === i.charAt(s + 1) || i.charAt(s + 1) === i.charAt(s) && t.charAt(d - 1) !== i.charAt(s)) && (I = le(e, n, t, i, d + 1, s + 2, c), I * te > h && (h = I * te)), h > v && (v = h), d = t.indexOf(b, d + 1);
22
+ return c[m] = v, v;
23
23
  }
24
24
  function he(e) {
25
25
  return e.toLowerCase().replace(be, " ");
@@ -27,112 +27,112 @@ function he(e) {
27
27
  function Xe(e, n, t) {
28
28
  return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, le(e, n, he(e), he(n), 0, 0, {});
29
29
  }
30
- var q = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', Ye = '[cmdk-group-heading=""]', ye = '[cmdk-item=""]', ge = `${ye}:not([aria-disabled="true"])`, oe = "cmdk-item-select", j = "data-value", Qe = (e, n, t) => Xe(e, n, t), xe = a.createContext(void 0), T = () => a.useContext(xe), we = a.createContext(void 0), ie = () => a.useContext(we), ke = a.createContext(void 0), Se = a.forwardRef((e, n) => {
30
+ var q = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', Ye = '[cmdk-group-heading=""]', ye = '[cmdk-item=""]', ge = `${ye}:not([aria-disabled="true"])`, oe = "cmdk-item-select", j = "data-value", Qe = (e, n, t) => Xe(e, n, t), we = a.createContext(void 0), T = () => a.useContext(we), xe = a.createContext(void 0), ie = () => a.useContext(xe), ke = a.createContext(void 0), Se = a.forwardRef((e, n) => {
31
31
  let t = P(() => {
32
- var r, c;
33
- return { search: "", value: (c = (r = e.value) != null ? r : e.defaultValue) != null ? c : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
34
- }), i = P(() => /* @__PURE__ */ new Set()), l = P(() => /* @__PURE__ */ new Map()), s = P(() => /* @__PURE__ */ new Map()), u = P(() => /* @__PURE__ */ new Set()), f = Ce(e), { label: b, children: d, value: v, onValueChange: h, filter: I, shouldFilter: S, loop: N, disablePointerSelection: H = !1, vimBindings: $ = !0, ...G } = e, U = K(), se = K(), W = K(), _ = a.useRef(null), y = dt();
32
+ var r, u;
33
+ return { search: "", value: (u = (r = e.value) != null ? r : e.defaultValue) != null ? u : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
34
+ }), i = P(() => /* @__PURE__ */ new Set()), l = P(() => /* @__PURE__ */ new Map()), s = P(() => /* @__PURE__ */ new Map()), c = P(() => /* @__PURE__ */ new Set()), m = Ce(e), { label: b, children: d, value: v, onValueChange: h, filter: I, shouldFilter: S, loop: N, disablePointerSelection: H = !1, vimBindings: $ = !0, ...B } = e, U = K(), se = K(), W = K(), _ = a.useRef(null), y = dt();
35
35
  L(() => {
36
36
  if (v !== void 0) {
37
37
  let r = v.trim();
38
38
  t.current.value = r, C.emit();
39
39
  }
40
40
  }, [v]), L(() => {
41
- y(6, ce);
41
+ y(6, ue);
42
42
  }, []);
43
- let C = a.useMemo(() => ({ subscribe: (r) => (u.current.add(r), () => u.current.delete(r)), snapshot: () => t.current, setState: (r, c, m) => {
43
+ let C = a.useMemo(() => ({ subscribe: (r) => (c.current.add(r), () => c.current.delete(r)), snapshot: () => t.current, setState: (r, u, f) => {
44
44
  var o, p, g, E;
45
- if (!Object.is(t.current[r], c)) {
46
- if (t.current[r] = c, r === "search") Q(), X(), y(1, Y);
45
+ if (!Object.is(t.current[r], u)) {
46
+ if (t.current[r] = u, r === "search") Q(), X(), y(1, Y);
47
47
  else if (r === "value") {
48
48
  if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
49
- let w = document.getElementById(W);
50
- w ? w.focus() : (o = document.getElementById(U)) == null || o.focus();
49
+ let x = document.getElementById(W);
50
+ x ? x.focus() : (o = document.getElementById(U)) == null || o.focus();
51
51
  }
52
52
  if (y(7, () => {
53
- var w;
54
- t.current.selectedItemId = (w = F()) == null ? void 0 : w.id, C.emit();
55
- }), m || y(5, ce), ((p = f.current) == null ? void 0 : p.value) !== void 0) {
56
- let w = c ?? "";
57
- (E = (g = f.current).onValueChange) == null || E.call(g, w);
53
+ var x;
54
+ t.current.selectedItemId = (x = F()) == null ? void 0 : x.id, C.emit();
55
+ }), f || y(5, ue), ((p = m.current) == null ? void 0 : p.value) !== void 0) {
56
+ let x = u ?? "";
57
+ (E = (g = m.current).onValueChange) == null || E.call(g, x);
58
58
  return;
59
59
  }
60
60
  }
61
61
  C.emit();
62
62
  }
63
63
  }, emit: () => {
64
- u.current.forEach((r) => r());
65
- } }), []), J = a.useMemo(() => ({ value: (r, c, m) => {
64
+ c.current.forEach((r) => r());
65
+ } }), []), J = a.useMemo(() => ({ value: (r, u, f) => {
66
66
  var o;
67
- c !== ((o = s.current.get(r)) == null ? void 0 : o.value) && (s.current.set(r, { value: c, keywords: m }), t.current.filtered.items.set(r, de(c, m)), y(2, () => {
67
+ u !== ((o = s.current.get(r)) == null ? void 0 : o.value) && (s.current.set(r, { value: u, keywords: f }), t.current.filtered.items.set(r, de(u, f)), y(2, () => {
68
68
  X(), C.emit();
69
69
  }));
70
- }, item: (r, c) => (i.current.add(r), c && (l.current.has(c) ? l.current.get(c).add(r) : l.current.set(c, /* @__PURE__ */ new Set([r]))), y(3, () => {
70
+ }, item: (r, u) => (i.current.add(r), u && (l.current.has(u) ? l.current.get(u).add(r) : l.current.set(u, /* @__PURE__ */ new Set([r]))), y(3, () => {
71
71
  Q(), X(), t.current.value || Y(), C.emit();
72
72
  }), () => {
73
73
  s.current.delete(r), i.current.delete(r), t.current.filtered.items.delete(r);
74
- let m = F();
74
+ let f = F();
75
75
  y(4, () => {
76
- Q(), m?.getAttribute("id") === r && Y(), C.emit();
76
+ Q(), f?.getAttribute("id") === r && Y(), C.emit();
77
77
  });
78
78
  }), group: (r) => (l.current.has(r) || l.current.set(r, /* @__PURE__ */ new Set()), () => {
79
79
  s.current.delete(r), l.current.delete(r);
80
- }), filter: () => f.current.shouldFilter, label: b || e["aria-label"], getDisablePointerSelection: () => f.current.disablePointerSelection, listId: U, inputId: W, labelId: se, listInnerRef: _ }), []);
81
- function de(r, c) {
82
- var m, o;
83
- let p = (o = (m = f.current) == null ? void 0 : m.filter) != null ? o : Qe;
84
- return r ? p(r, t.current.search, c) : 0;
80
+ }), filter: () => m.current.shouldFilter, label: b || e["aria-label"], getDisablePointerSelection: () => m.current.disablePointerSelection, listId: U, inputId: W, labelId: se, listInnerRef: _ }), []);
81
+ function de(r, u) {
82
+ var f, o;
83
+ let p = (o = (f = m.current) == null ? void 0 : f.filter) != null ? o : Qe;
84
+ return r ? p(r, t.current.search, u) : 0;
85
85
  }
86
86
  function X() {
87
- if (!t.current.search || f.current.shouldFilter === !1) return;
88
- let r = t.current.filtered.items, c = [];
87
+ if (!t.current.search || m.current.shouldFilter === !1) return;
88
+ let r = t.current.filtered.items, u = [];
89
89
  t.current.filtered.groups.forEach((o) => {
90
90
  let p = l.current.get(o), g = 0;
91
91
  p.forEach((E) => {
92
- let w = r.get(E);
93
- g = Math.max(w, g);
94
- }), c.push([o, g]);
92
+ let x = r.get(E);
93
+ g = Math.max(x, g);
94
+ }), u.push([o, g]);
95
95
  });
96
- let m = _.current;
96
+ let f = _.current;
97
97
  V().sort((o, p) => {
98
98
  var g, E;
99
- let w = o.getAttribute("id"), B = p.getAttribute("id");
100
- return ((g = r.get(B)) != null ? g : 0) - ((E = r.get(w)) != null ? E : 0);
99
+ let x = o.getAttribute("id"), G = p.getAttribute("id");
100
+ return ((g = r.get(G)) != null ? g : 0) - ((E = r.get(x)) != null ? E : 0);
101
101
  }).forEach((o) => {
102
102
  let p = o.closest(ne);
103
- p ? p.appendChild(o.parentElement === p ? o : o.closest(`${ne} > *`)) : m.appendChild(o.parentElement === m ? o : o.closest(`${ne} > *`));
104
- }), c.sort((o, p) => p[1] - o[1]).forEach((o) => {
103
+ p ? p.appendChild(o.parentElement === p ? o : o.closest(`${ne} > *`)) : f.appendChild(o.parentElement === f ? o : o.closest(`${ne} > *`));
104
+ }), u.sort((o, p) => p[1] - o[1]).forEach((o) => {
105
105
  var p;
106
106
  let g = (p = _.current) == null ? void 0 : p.querySelector(`${q}[${j}="${encodeURIComponent(o[0])}"]`);
107
107
  g?.parentElement.appendChild(g);
108
108
  });
109
109
  }
110
110
  function Y() {
111
- let r = V().find((m) => m.getAttribute("aria-disabled") !== "true"), c = r?.getAttribute(j);
112
- C.setState("value", c || void 0);
111
+ let r = V().find((f) => f.getAttribute("aria-disabled") !== "true"), u = r?.getAttribute(j);
112
+ C.setState("value", u || void 0);
113
113
  }
114
114
  function Q() {
115
- var r, c, m, o;
116
- if (!t.current.search || f.current.shouldFilter === !1) {
115
+ var r, u, f, o;
116
+ if (!t.current.search || m.current.shouldFilter === !1) {
117
117
  t.current.filtered.count = i.current.size;
118
118
  return;
119
119
  }
120
120
  t.current.filtered.groups = /* @__PURE__ */ new Set();
121
121
  let p = 0;
122
122
  for (let g of i.current) {
123
- let E = (c = (r = s.current.get(g)) == null ? void 0 : r.value) != null ? c : "", w = (o = (m = s.current.get(g)) == null ? void 0 : m.keywords) != null ? o : [], B = de(E, w);
124
- t.current.filtered.items.set(g, B), B > 0 && p++;
123
+ let E = (u = (r = s.current.get(g)) == null ? void 0 : r.value) != null ? u : "", x = (o = (f = s.current.get(g)) == null ? void 0 : f.keywords) != null ? o : [], G = de(E, x);
124
+ t.current.filtered.items.set(g, G), G > 0 && p++;
125
125
  }
126
- for (let [g, E] of l.current) for (let w of E) if (t.current.filtered.items.get(w) > 0) {
126
+ for (let [g, E] of l.current) for (let x of E) if (t.current.filtered.items.get(x) > 0) {
127
127
  t.current.filtered.groups.add(g);
128
128
  break;
129
129
  }
130
130
  t.current.filtered.count = p;
131
131
  }
132
- function ce() {
133
- var r, c, m;
132
+ function ue() {
133
+ var r, u, f;
134
134
  let o = F();
135
- o && (((r = o.parentElement) == null ? void 0 : r.firstChild) === o && ((m = (c = o.closest(q)) == null ? void 0 : c.querySelector(Ye)) == null || m.scrollIntoView({ block: "nearest" })), o.scrollIntoView({ block: "nearest" }));
135
+ o && (((r = o.parentElement) == null ? void 0 : r.firstChild) === o && ((f = (u = o.closest(q)) == null ? void 0 : u.querySelector(Ye)) == null || f.scrollIntoView({ block: "nearest" })), o.scrollIntoView({ block: "nearest" }));
136
136
  }
137
137
  function F() {
138
138
  var r;
@@ -143,29 +143,29 @@ var q = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', Ye = '[cmdk-group-headi
143
143
  return Array.from(((r = _.current) == null ? void 0 : r.querySelectorAll(ge)) || []);
144
144
  }
145
145
  function Z(r) {
146
- let c = V()[r];
147
- c && C.setState("value", c.getAttribute(j));
146
+ let u = V()[r];
147
+ u && C.setState("value", u.getAttribute(j));
148
148
  }
149
149
  function ee(r) {
150
- var c;
151
- let m = F(), o = V(), p = o.findIndex((E) => E === m), g = o[p + r];
152
- (c = f.current) != null && c.loop && (g = p + r < 0 ? o[o.length - 1] : p + r === o.length ? o[0] : o[p + r]), g && C.setState("value", g.getAttribute(j));
150
+ var u;
151
+ let f = F(), o = V(), p = o.findIndex((E) => E === f), g = o[p + r];
152
+ (u = m.current) != null && u.loop && (g = p + r < 0 ? o[o.length - 1] : p + r === o.length ? o[0] : o[p + r]), g && C.setState("value", g.getAttribute(j));
153
153
  }
154
- function ue(r) {
155
- let c = F(), m = c?.closest(q), o;
156
- for (; m && !o; ) m = r > 0 ? it(m, q) : st(m, q), o = m?.querySelector(ge);
154
+ function ce(r) {
155
+ let u = F(), f = u?.closest(q), o;
156
+ for (; f && !o; ) f = r > 0 ? it(f, q) : st(f, q), o = f?.querySelector(ge);
157
157
  o ? C.setState("value", o.getAttribute(j)) : ee(r);
158
158
  }
159
159
  let me = () => Z(V().length - 1), fe = (r) => {
160
- r.preventDefault(), r.metaKey ? me() : r.altKey ? ue(1) : ee(1);
160
+ r.preventDefault(), r.metaKey ? me() : r.altKey ? ce(1) : ee(1);
161
161
  }, pe = (r) => {
162
- r.preventDefault(), r.metaKey ? Z(0) : r.altKey ? ue(-1) : ee(-1);
162
+ r.preventDefault(), r.metaKey ? Z(0) : r.altKey ? ce(-1) : ee(-1);
163
163
  };
164
- return a.createElement(A.div, { ref: n, tabIndex: -1, ...G, "cmdk-root": "", onKeyDown: (r) => {
165
- var c;
166
- (c = G.onKeyDown) == null || c.call(G, r);
167
- let m = r.nativeEvent.isComposing || r.keyCode === 229;
168
- if (!(r.defaultPrevented || m)) switch (r.key) {
164
+ return a.createElement(A.div, { ref: n, tabIndex: -1, ...B, "cmdk-root": "", onKeyDown: (r) => {
165
+ var u;
166
+ (u = B.onKeyDown) == null || u.call(B, r);
167
+ let f = r.nativeEvent.isComposing || r.keyCode === 229;
168
+ if (!(r.defaultPrevented || f)) switch (r.key) {
169
169
  case "n":
170
170
  case "j": {
171
171
  $ && r.ctrlKey && fe(r);
@@ -201,14 +201,14 @@ var q = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', Ye = '[cmdk-group-headi
201
201
  }
202
202
  }
203
203
  }
204
- } }, a.createElement("label", { "cmdk-label": "", htmlFor: J.inputId, id: J.labelId, style: ut }, b), z(e, (r) => a.createElement(we.Provider, { value: C }, a.createElement(xe.Provider, { value: J }, r))));
204
+ } }, a.createElement("label", { "cmdk-label": "", htmlFor: J.inputId, id: J.labelId, style: ct }, b), z(e, (r) => a.createElement(xe.Provider, { value: C }, a.createElement(we.Provider, { value: J }, r))));
205
205
  }), Ze = a.forwardRef((e, n) => {
206
206
  var t, i;
207
- let l = K(), s = a.useRef(null), u = a.useContext(ke), f = T(), b = Ce(e), d = (i = (t = b.current) == null ? void 0 : t.forceMount) != null ? i : u?.forceMount;
207
+ let l = K(), s = a.useRef(null), c = a.useContext(ke), m = T(), b = Ce(e), d = (i = (t = b.current) == null ? void 0 : t.forceMount) != null ? i : c?.forceMount;
208
208
  L(() => {
209
- if (!d) return f.item(l, u?.id);
209
+ if (!d) return m.item(l, c?.id);
210
210
  }, [d]);
211
- let v = Ee(l, s, [e.value, e.children, s], e.keywords), h = ie(), I = D((y) => y.value && y.value === v.current), S = D((y) => d || f.filter() === !1 ? !0 : y.search ? y.filtered.items.get(l) > 0 : !0);
211
+ let v = Ee(l, s, [e.value, e.children, s], e.keywords), h = ie(), I = D((y) => y.value && y.value === v.current), S = D((y) => d || m.filter() === !1 ? !0 : y.search ? y.filtered.items.get(l) > 0 : !0);
212
212
  a.useEffect(() => {
213
213
  let y = s.current;
214
214
  if (!(!y || e.disabled)) return y.addEventListener(oe, N), () => y.removeEventListener(oe, N);
@@ -221,28 +221,28 @@ var q = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', Ye = '[cmdk-group-headi
221
221
  h.setState("value", v.current, !0);
222
222
  }
223
223
  if (!S) return null;
224
- let { disabled: $, value: G, onSelect: U, forceMount: se, keywords: W, ..._ } = e;
225
- return a.createElement(A.div, { ref: O(s, n), ..._, id: l, "cmdk-item": "", role: "option", "aria-disabled": !!$, "aria-selected": !!I, "data-disabled": !!$, "data-selected": !!I, onPointerMove: $ || f.getDisablePointerSelection() ? void 0 : H, onClick: $ ? void 0 : N }, e.children);
224
+ let { disabled: $, value: B, onSelect: U, forceMount: se, keywords: W, ..._ } = e;
225
+ return a.createElement(A.div, { ref: O(s, n), ..._, id: l, "cmdk-item": "", role: "option", "aria-disabled": !!$, "aria-selected": !!I, "data-disabled": !!$, "data-selected": !!I, onPointerMove: $ || m.getDisablePointerSelection() ? void 0 : H, onClick: $ ? void 0 : N }, e.children);
226
226
  }), et = a.forwardRef((e, n) => {
227
- let { heading: t, children: i, forceMount: l, ...s } = e, u = K(), f = a.useRef(null), b = a.useRef(null), d = K(), v = T(), h = D((S) => l || v.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(u) : !0);
228
- L(() => v.group(u), []), Ee(u, f, [e.value, e.heading, b]);
229
- let I = a.useMemo(() => ({ id: u, forceMount: l }), [l]);
230
- return a.createElement(A.div, { ref: O(f, n), ...s, "cmdk-group": "", role: "presentation", hidden: h ? void 0 : !0 }, t && a.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: d }, t), z(e, (S) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? d : void 0 }, a.createElement(ke.Provider, { value: I }, S))));
227
+ let { heading: t, children: i, forceMount: l, ...s } = e, c = K(), m = a.useRef(null), b = a.useRef(null), d = K(), v = T(), h = D((S) => l || v.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(c) : !0);
228
+ L(() => v.group(c), []), Ee(c, m, [e.value, e.heading, b]);
229
+ let I = a.useMemo(() => ({ id: c, forceMount: l }), [l]);
230
+ return a.createElement(A.div, { ref: O(m, n), ...s, "cmdk-group": "", role: "presentation", hidden: h ? void 0 : !0 }, t && a.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: d }, t), z(e, (S) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? d : void 0 }, a.createElement(ke.Provider, { value: I }, S))));
231
231
  }), tt = a.forwardRef((e, n) => {
232
- let { alwaysRender: t, ...i } = e, l = a.useRef(null), s = D((u) => !u.search);
232
+ let { alwaysRender: t, ...i } = e, l = a.useRef(null), s = D((c) => !c.search);
233
233
  return !t && !s ? null : a.createElement(A.div, { ref: O(l, n), ...i, "cmdk-separator": "", role: "separator" });
234
234
  }), rt = a.forwardRef((e, n) => {
235
- let { onValueChange: t, ...i } = e, l = e.value != null, s = ie(), u = D((d) => d.search), f = D((d) => d.selectedItemId), b = T();
235
+ let { onValueChange: t, ...i } = e, l = e.value != null, s = ie(), c = D((d) => d.search), m = D((d) => d.selectedItemId), b = T();
236
236
  return a.useEffect(() => {
237
237
  e.value != null && s.setState("search", e.value);
238
- }, [e.value]), a.createElement(A.input, { ref: n, ...i, "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: l ? e.value : u, onChange: (d) => {
238
+ }, [e.value]), a.createElement(A.input, { ref: n, ...i, "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": m, id: b.inputId, type: "text", value: l ? e.value : c, onChange: (d) => {
239
239
  l || s.setState("search", d.target.value), t?.(d.target.value);
240
240
  } });
241
241
  }), nt = a.forwardRef((e, n) => {
242
- let { children: t, label: i = "Suggestions", ...l } = e, s = a.useRef(null), u = a.useRef(null), f = D((d) => d.selectedItemId), b = T();
242
+ let { children: t, label: i = "Suggestions", ...l } = e, s = a.useRef(null), c = a.useRef(null), m = D((d) => d.selectedItemId), b = T();
243
243
  return a.useEffect(() => {
244
- if (u.current && s.current) {
245
- let d = u.current, v = s.current, h, I = new ResizeObserver(() => {
244
+ if (c.current && s.current) {
245
+ let d = c.current, v = s.current, h, I = new ResizeObserver(() => {
246
246
  h = requestAnimationFrame(() => {
247
247
  let S = d.offsetHeight;
248
248
  v.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
@@ -252,13 +252,13 @@ var q = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', Ye = '[cmdk-group-headi
252
252
  cancelAnimationFrame(h), I.unobserve(d);
253
253
  };
254
254
  }
255
- }, []), a.createElement(A.div, { ref: O(s, n), ...l, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": f, "aria-label": i, id: b.listId }, z(e, (d) => a.createElement("div", { ref: O(u, b.listInnerRef), "cmdk-list-sizer": "" }, d)));
255
+ }, []), a.createElement(A.div, { ref: O(s, n), ...l, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": m, "aria-label": i, id: b.listId }, z(e, (d) => a.createElement("div", { ref: O(c, b.listInnerRef), "cmdk-list-sizer": "" }, d)));
256
256
  }), at = a.forwardRef((e, n) => {
257
- let { open: t, onOpenChange: i, overlayClassName: l, contentClassName: s, container: u, ...f } = e;
258
- return a.createElement(Re, { open: t, onOpenChange: i }, a.createElement(Ne, { container: u }, a.createElement(De, { "cmdk-overlay": "", className: l }), a.createElement(Ae, { "aria-label": e.label, "cmdk-dialog": "", className: s }, a.createElement(Se, { ref: n, ...f }))));
257
+ let { open: t, onOpenChange: i, overlayClassName: l, contentClassName: s, container: c, ...m } = e;
258
+ return a.createElement(Re, { open: t, onOpenChange: i }, a.createElement(Ne, { container: c }, a.createElement(De, { "cmdk-overlay": "", className: l }), a.createElement(Ae, { "aria-label": e.label, "cmdk-dialog": "", className: s }, a.createElement(Se, { ref: n, ...m }))));
259
259
  }), lt = a.forwardRef((e, n) => D((t) => t.filtered.count === 0) ? a.createElement(A.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), ot = a.forwardRef((e, n) => {
260
260
  let { progress: t, children: i, label: l = "Loading...", ...s } = e;
261
- return a.createElement(A.div, { ref: n, ...s, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": l }, z(e, (u) => a.createElement("div", { "aria-hidden": !0 }, u)));
261
+ return a.createElement(A.div, { ref: n, ...s, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": l }, z(e, (c) => a.createElement("div", { "aria-hidden": !0 }, c)));
262
262
  }), k = Object.assign(Se, { List: nt, Item: Ze, Input: rt, Group: et, Separator: tt, Dialog: at, Empty: lt, Loading: ot });
263
263
  function it(e, n) {
264
264
  let t = e.nextElementSibling;
@@ -292,15 +292,15 @@ function D(e) {
292
292
  function Ee(e, n, t, i = []) {
293
293
  let l = a.useRef(), s = T();
294
294
  return L(() => {
295
- var u;
296
- let f = (() => {
295
+ var c;
296
+ let m = (() => {
297
297
  var d;
298
298
  for (let v of t) {
299
299
  if (typeof v == "string") return v.trim();
300
300
  if (typeof v == "object" && "current" in v) return v.current ? (d = v.current.textContent) == null ? void 0 : d.trim() : l.current;
301
301
  }
302
302
  })(), b = i.map((d) => d.trim());
303
- s.value(e, f, b), (u = n.current) == null || u.setAttribute(j, f), l.current = f;
303
+ s.value(e, m, b), (c = n.current) == null || c.setAttribute(j, m), l.current = m;
304
304
  }), l;
305
305
  }
306
306
  var dt = () => {
@@ -311,36 +311,38 @@ var dt = () => {
311
311
  t.current.set(i, l), n({});
312
312
  };
313
313
  };
314
- function ct(e) {
314
+ function ut(e) {
315
315
  let n = e.type;
316
316
  return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
317
317
  }
318
318
  function z({ asChild: e, children: n }, t) {
319
- return e && a.isValidElement(n) ? a.cloneElement(ct(n), { ref: n.ref }, t(n.props.children)) : t(n);
319
+ return e && a.isValidElement(n) ? a.cloneElement(ut(n), { ref: n.ref }, t(n.props.children)) : t(n);
320
320
  }
321
- var ut = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
321
+ var ct = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
322
322
  const mt = R({
323
- base: "flex h-full w-full flex-col overflow-hidden rounded-lg border border-secondary-border bg-secondary-bg text-primary-fg shadow-soft-md",
323
+ base: "flex h-full w-full flex-col overflow-hidden rounded-lg bg-secondary-bg text-primary-fg shadow-soft-md",
324
324
  variants: {
325
325
  theme: {
326
- inverse: "border-inverse-border bg-inverse-primary-bg text-inverse-primary-fg"
326
+ inverse: "border-inverse-border bg-inverse-primary-bg text-inverse-primary-fg shadow-hard-md"
327
327
  }
328
328
  }
329
329
  }), Ie = a.forwardRef(({ className: e, ...n }, t) => {
330
330
  const { variant: i } = M();
331
- return /* @__PURE__ */ x(k, { ref: t, "data-slot": "command", className: mt({ className: e, theme: i }), ...n });
331
+ return /* @__PURE__ */ w(k, { ref: t, "data-slot": "command", className: mt({ className: e, theme: i }), ...n });
332
332
  });
333
333
  Ie.displayName = k.displayName;
334
334
  const ft = R({
335
335
  slots: {
336
- content: "overflow-hidden border-none p-0",
336
+ content: "overflow-hidden border-none p-0 shadow-soft-2xl",
337
337
  command: [
338
338
  "rounded-xl",
339
- "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
339
+ "[&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:font-normal [&_[cmdk-group-heading]]:text-muted",
340
340
  "[&_[cmdk-group]]:px-1",
341
- "[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5",
342
- "[&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-1.5",
343
- "[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"
341
+ "[&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4",
342
+ "[&_[cmdk-input-wrapper]]:pl-4",
343
+ "[&_[cmdk-group-items]]:p-1",
344
+ "[&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-1.5",
345
+ "[&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4"
344
346
  ]
345
347
  },
346
348
  variants: {
@@ -355,15 +357,26 @@ const ft = R({
355
357
  description: n = "Search for a command to run...",
356
358
  children: t,
357
359
  className: i,
358
- ...l
360
+ overlayType: l,
361
+ overlayBlur: s,
362
+ ...c
359
363
  }) => {
360
- const s = ft();
361
- return /* @__PURE__ */ ae(Fe, { ...l, children: [
364
+ const m = ft();
365
+ return /* @__PURE__ */ ae(Fe, { ...c, children: [
362
366
  /* @__PURE__ */ ae(je, { className: "!sr-only", children: [
363
- /* @__PURE__ */ x(Pe, { children: e }),
364
- /* @__PURE__ */ x(Ke, { children: n })
367
+ /* @__PURE__ */ w(Pe, { children: e }),
368
+ /* @__PURE__ */ w(Ke, { children: n })
365
369
  ] }),
366
- /* @__PURE__ */ x(Ve, { className: s.content({ className: i }), children: /* @__PURE__ */ x(Ie, { className: s.command(), children: t }) })
370
+ /* @__PURE__ */ w(
371
+ Ve,
372
+ {
373
+ className: m.content({ className: i }),
374
+ overlayType: l,
375
+ overlayBlur: s,
376
+ showCloseButton: !1,
377
+ children: /* @__PURE__ */ w(Ie, { className: m.command(), children: t })
378
+ }
379
+ )
367
380
  ] });
368
381
  }, pt = R({
369
382
  slots: {
@@ -375,7 +388,8 @@ const ft = R({
375
388
  theme: {
376
389
  inverse: {
377
390
  wrapper: "border-inverse-border",
378
- input: "placeholder:text-inverse-muted placeholder:opacity-50"
391
+ search: "text-inverse-muted",
392
+ input: "placeholder:text-inverse-muted"
379
393
  }
380
394
  }
381
395
  }
@@ -389,8 +403,8 @@ const ft = R({
389
403
  "data-slot": "command-input-wrapper",
390
404
  "cmdk-input-wrapper": "",
391
405
  children: [
392
- /* @__PURE__ */ x(Le, { icon: Oe, className: s.search() }),
393
- /* @__PURE__ */ x(
406
+ /* @__PURE__ */ w(Le, { icon: Oe, className: s.search() }),
407
+ /* @__PURE__ */ w(
394
408
  k.Input,
395
409
  {
396
410
  ref: i,
@@ -407,35 +421,35 @@ const ft = R({
407
421
  vt.displayName = k.Input.displayName;
408
422
  const ht = R({
409
423
  base: "max-h-[300px] overflow-y-auto overflow-x-hidden outline-none"
410
- }), gt = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ x(k.List, { ref: t, "data-slot": "command-list", className: ht({ className: e }), ...n })), bt = R({
424
+ }), gt = a.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ w(k.List, { ref: t, "data-slot": "command-list", className: ht({ className: e }), ...n })), bt = R({
411
425
  base: "max-h-[300px] overflow-x-hidden outline-none"
412
- }), yt = a.forwardRef(({ className: e, containerClassName: n, shadowSize: t, ...i }, l) => /* @__PURE__ */ x(
426
+ }), yt = a.forwardRef(({ className: e, containerClassName: n, shadowSize: t, ...i }, l) => /* @__PURE__ */ w(
413
427
  qe,
414
428
  {
415
429
  className: bt({ className: n }),
416
430
  "data-slot": "command-list-scroll-shadow",
417
431
  shadowSize: t,
418
- children: /* @__PURE__ */ x(k.List, { ref: l, "data-slot": "command-list", className: e, ...i })
432
+ children: /* @__PURE__ */ w(k.List, { ref: l, "data-slot": "command-list", className: e, ...i })
419
433
  }
420
434
  ));
421
435
  gt.displayName = k.List.displayName;
422
436
  yt.displayName = "CommandListContainer";
423
- const xt = R({
437
+ const wt = R({
424
438
  extend: _e,
425
439
  base: "flex items-center justify-center px-3 py-6 text-secondary-fg"
426
- }), wt = a.forwardRef(({ className: e, ...n }, t) => {
440
+ }), xt = a.forwardRef(({ className: e, ...n }, t) => {
427
441
  const { variant: i } = M();
428
- return /* @__PURE__ */ x(
442
+ return /* @__PURE__ */ w(
429
443
  k.Empty,
430
444
  {
431
445
  ref: t,
432
446
  "data-slot": "command-empty",
433
- className: xt({ className: e, theme: i }),
447
+ className: wt({ className: e, theme: i }),
434
448
  ...n
435
449
  }
436
450
  );
437
451
  });
438
- wt.displayName = k.Empty.displayName;
452
+ xt.displayName = k.Empty.displayName;
439
453
  const kt = R({
440
454
  base: "overflow-hidden p-1 text-primary-fg [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:text-muted",
441
455
  variants: {
@@ -445,7 +459,7 @@ const kt = R({
445
459
  }
446
460
  }), St = a.forwardRef(({ className: e, ...n }, t) => {
447
461
  const { variant: i } = M();
448
- return /* @__PURE__ */ x(
462
+ return /* @__PURE__ */ w(
449
463
  k.Group,
450
464
  {
451
465
  ref: t,
@@ -465,7 +479,7 @@ const Ct = R({
465
479
  }
466
480
  }), Et = a.forwardRef(({ className: e, ...n }, t) => {
467
481
  const { variant: i } = M();
468
- return /* @__PURE__ */ x(
482
+ return /* @__PURE__ */ w(
469
483
  k.Separator,
470
484
  {
471
485
  ref: t,
@@ -481,7 +495,7 @@ const It = R({
481
495
  base: "pr-2 data-[disabled=true]:pointer-events-none data-[selected=true]:bg-secondary-bg-hover data-[selected=true]:text-primary-fg data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0"
482
496
  }), Rt = a.forwardRef(({ className: e, disabled: n, children: t, ...i }, l) => {
483
497
  const { variant: s } = M();
484
- return /* @__PURE__ */ x(
498
+ return /* @__PURE__ */ w(
485
499
  k.Item,
486
500
  {
487
501
  disabled: n,
@@ -499,7 +513,7 @@ const Nt = R({
499
513
  base: "ml-auto text-xs tracking-widest"
500
514
  }), Dt = ({ className: e, ...n }) => {
501
515
  const { variant: t } = M();
502
- return /* @__PURE__ */ x("span", { "data-slot": "command-shortcut", className: Nt({ className: e, theme: t }), ...n });
516
+ return /* @__PURE__ */ w("span", { "data-slot": "command-shortcut", className: Nt({ className: e, theme: t }), ...n });
503
517
  };
504
518
  Dt.displayName = "CommandShortcut";
505
519
  const At = R({
@@ -512,7 +526,7 @@ const At = R({
512
526
  }), Mt = a.forwardRef(
513
527
  ({ className: e, ...n }, t) => {
514
528
  const { variant: i } = M();
515
- return /* @__PURE__ */ x(
529
+ return /* @__PURE__ */ w(
516
530
  "div",
517
531
  {
518
532
  ref: t,
@@ -530,11 +544,11 @@ export {
530
544
  vt as b,
531
545
  gt as c,
532
546
  yt as d,
533
- wt as e,
547
+ xt as e,
534
548
  St as f,
535
549
  Rt as g,
536
550
  Dt as h,
537
551
  Et as i,
538
552
  Mt as j
539
553
  };
540
- //# sourceMappingURL=Command-DR9YRwlX.js.map
554
+ //# sourceMappingURL=Command-BhbfL5wm.js.map