impact-nova 1.5.12 → 1.5.14
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.
- package/dist/components/ui/calendar.js +2 -3
- package/dist/components/ui/command-palette/command-palette.d.ts +5 -2
- package/dist/components/ui/command-palette/command-palette.js +221 -202
- package/dist/components/ui/command-palette/shortcut-registry.d.ts +1 -0
- package/dist/components/ui/command-palette/shortcut-registry.js +30 -20
- package/dist/components/ui/command-palette/shortcut-settings.js +69 -58
- package/dist/components/ui/sidebar.js +145 -152
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { Search as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { useCommandPalette as
|
|
7
|
-
import { Kbd as
|
|
8
|
-
import { fuzzyFilter as
|
|
9
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as m, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import * as S from "@radix-ui/react-dialog";
|
|
4
|
+
import { Search as W } from "lucide-react";
|
|
5
|
+
import { cn as d } from "../../../lib/utils.js";
|
|
6
|
+
import { useCommandPalette as me } from "./command-palette-context.js";
|
|
7
|
+
import { Kbd as E } from "./kbd.js";
|
|
8
|
+
import { fuzzyFilter as fe, keybindingToSymbols as ue } from "./utils.js";
|
|
9
|
+
const pe = /* @__PURE__ */ new Set(["browser", "system", "ag-grid"]);
|
|
10
|
+
function xe(s) {
|
|
11
|
+
return !!s && pe.has(s);
|
|
12
|
+
}
|
|
13
|
+
const D = o.createContext({
|
|
10
14
|
query: "",
|
|
11
15
|
setQuery: () => {
|
|
12
16
|
},
|
|
@@ -17,87 +21,90 @@ const z = r.createContext({
|
|
|
17
21
|
onExecute: () => {
|
|
18
22
|
}
|
|
19
23
|
});
|
|
20
|
-
function
|
|
21
|
-
className:
|
|
24
|
+
function he({
|
|
25
|
+
className: s,
|
|
22
26
|
children: a,
|
|
23
27
|
commands: n,
|
|
24
28
|
placeholder: i = "Type a command or search...",
|
|
25
|
-
emptyTitle:
|
|
26
|
-
emptyDescription:
|
|
27
|
-
recentGroupLabel:
|
|
28
|
-
defaultGroupLabel:
|
|
29
|
+
emptyTitle: f = "No results found",
|
|
30
|
+
emptyDescription: x = "Try a different search term",
|
|
31
|
+
recentGroupLabel: l = "Recently Used",
|
|
32
|
+
defaultGroupLabel: c = "Commands",
|
|
29
33
|
navigateLabel: O = "Navigate",
|
|
30
34
|
runLabel: A = "Run",
|
|
31
35
|
closeLabel: F = "Close",
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
configureShortcutsLabel: j = "Configure Shortcuts",
|
|
37
|
+
onCommandExecute: q,
|
|
38
|
+
onOpenChange: L
|
|
34
39
|
}) {
|
|
35
|
-
const { open: M, setOpen:
|
|
36
|
-
const t =
|
|
37
|
-
|
|
40
|
+
const { open: M, setOpen: ee, getPaletteCommands: te, getEffectiveKeybinding: ae, registry: k } = me(), [w, T] = o.useState(""), [v, N] = o.useState(0), $ = o.useRef(null), K = o.useRef(null), U = o.useMemo(() => n ?? te(), [n, M]), B = o.useMemo(() => {
|
|
41
|
+
const t = fe(
|
|
42
|
+
U,
|
|
38
43
|
w,
|
|
39
|
-
(
|
|
44
|
+
(r) => `${r.category ? r.category + ": " : ""}${r.label}${r.description ? " " + r.description : ""}`
|
|
40
45
|
);
|
|
41
46
|
if (!w.trim()) {
|
|
42
|
-
const
|
|
43
|
-
for (const
|
|
44
|
-
|
|
45
|
-
return
|
|
47
|
+
const r = k.getRecentCommandIds(), R = new Set(r), h = [], C = [];
|
|
48
|
+
for (const g of t)
|
|
49
|
+
R.has(g.item.id) ? h.push(g) : C.push(g);
|
|
50
|
+
return h.sort((g, z) => r.indexOf(g.item.id) - r.indexOf(z.item.id)), [...h, ...C];
|
|
46
51
|
}
|
|
47
52
|
return t;
|
|
48
|
-
}, [
|
|
49
|
-
const t = /* @__PURE__ */ new Map(),
|
|
53
|
+
}, [U, w, k]), p = o.useMemo(() => B.map((t) => t.item), [B]), ne = o.useMemo(() => {
|
|
54
|
+
const t = /* @__PURE__ */ new Map(), r = new Set(k.getRecentCommandIds());
|
|
50
55
|
if (w.trim())
|
|
51
|
-
for (const u of
|
|
52
|
-
const
|
|
53
|
-
t.has(
|
|
56
|
+
for (const u of p) {
|
|
57
|
+
const y = u.category || c;
|
|
58
|
+
t.has(y) || t.set(y, []), t.get(y).push(u);
|
|
54
59
|
}
|
|
55
60
|
else {
|
|
56
|
-
const u =
|
|
57
|
-
u.length > 0 && t.set(
|
|
58
|
-
const
|
|
59
|
-
for (const
|
|
60
|
-
const P =
|
|
61
|
-
t.has(P) || t.set(P, []), t.get(P).push(
|
|
61
|
+
const u = p.filter((b) => r.has(b.id));
|
|
62
|
+
u.length > 0 && t.set(l, u);
|
|
63
|
+
const y = p.filter((b) => !r.has(b.id));
|
|
64
|
+
for (const b of y) {
|
|
65
|
+
const P = b.category || c;
|
|
66
|
+
t.has(P) || t.set(P, []), t.get(P).push(b);
|
|
62
67
|
}
|
|
63
68
|
}
|
|
64
|
-
const
|
|
65
|
-
for (const [u,
|
|
66
|
-
let
|
|
67
|
-
for (const P of
|
|
68
|
-
const
|
|
69
|
-
|
|
69
|
+
const R = { modal: 4, page: 3, module: 2, global: 1 }, h = { user: 2, "ag-grid": 1, browser: 0, system: 0 }, C = /* @__PURE__ */ new Map();
|
|
70
|
+
for (const [u, y] of t.entries()) {
|
|
71
|
+
let b = -1;
|
|
72
|
+
for (const P of y) {
|
|
73
|
+
const ce = R[P.scope] ?? 1, de = h[P.source ?? "user"] ?? 0;
|
|
74
|
+
b = Math.max(b, ce * 10 + de);
|
|
70
75
|
}
|
|
71
|
-
|
|
76
|
+
C.set(u, b);
|
|
72
77
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
const g = /* @__PURE__ */ new Map(), z = t.get(l);
|
|
79
|
+
z && g.set(l, z);
|
|
80
|
+
const ie = Array.from(t.entries()).filter(([u]) => u !== l).sort(([u], [y]) => (C.get(y) ?? 0) - (C.get(u) ?? 0));
|
|
81
|
+
for (const [u, y] of ie)
|
|
82
|
+
g.set(u, y);
|
|
83
|
+
return g;
|
|
84
|
+
}, [p, w, k, l, c]);
|
|
85
|
+
o.useEffect(() => {
|
|
86
|
+
M && (T(""), N(0), requestAnimationFrame(() => {
|
|
80
87
|
$.current?.focus();
|
|
81
88
|
}));
|
|
82
89
|
}, [M]);
|
|
83
90
|
const Q = (t) => {
|
|
84
|
-
|
|
85
|
-
}, I =
|
|
86
|
-
t.handler(), k.addRecentCommand(t.id),
|
|
87
|
-
}, [k,
|
|
91
|
+
ee(t), L?.(t);
|
|
92
|
+
}, I = o.useCallback((t) => {
|
|
93
|
+
t.handler(), k.addRecentCommand(t.id), q?.(t), Q(!1);
|
|
94
|
+
}, [k, q]), se = o.useCallback((t) => {
|
|
88
95
|
switch (t.key) {
|
|
89
96
|
case "ArrowDown": {
|
|
90
|
-
t.preventDefault(), N((
|
|
97
|
+
t.preventDefault(), N((r) => Math.min(r + 1, p.length - 1));
|
|
91
98
|
break;
|
|
92
99
|
}
|
|
93
100
|
case "ArrowUp": {
|
|
94
|
-
t.preventDefault(), N((
|
|
101
|
+
t.preventDefault(), N((r) => Math.max(r - 1, 0));
|
|
95
102
|
break;
|
|
96
103
|
}
|
|
97
104
|
case "Enter": {
|
|
98
105
|
t.preventDefault();
|
|
99
|
-
const
|
|
100
|
-
|
|
106
|
+
const r = p[v];
|
|
107
|
+
r && I(r);
|
|
101
108
|
break;
|
|
102
109
|
}
|
|
103
110
|
case "Home": {
|
|
@@ -105,66 +112,68 @@ function fe({
|
|
|
105
112
|
break;
|
|
106
113
|
}
|
|
107
114
|
case "End": {
|
|
108
|
-
t.preventDefault(), N(Math.max(
|
|
115
|
+
t.preventDefault(), N(Math.max(p.length - 1, 0));
|
|
109
116
|
break;
|
|
110
117
|
}
|
|
111
118
|
}
|
|
112
|
-
}, [
|
|
113
|
-
|
|
119
|
+
}, [p, v, I]);
|
|
120
|
+
o.useEffect(() => {
|
|
114
121
|
N(0);
|
|
115
|
-
}, [w]),
|
|
122
|
+
}, [w]), o.useEffect(() => {
|
|
116
123
|
const t = K.current;
|
|
117
124
|
if (!t) return;
|
|
118
|
-
const
|
|
119
|
-
|
|
125
|
+
const r = t.querySelector('[data-selected="true"]');
|
|
126
|
+
r && r.scrollIntoView({ block: "nearest" });
|
|
120
127
|
}, [v]);
|
|
121
|
-
const
|
|
128
|
+
const re = o.useMemo(
|
|
122
129
|
() => ({
|
|
123
130
|
query: w,
|
|
124
|
-
setQuery:
|
|
131
|
+
setQuery: T,
|
|
125
132
|
selectedIndex: v,
|
|
126
133
|
setSelectedIndex: N,
|
|
127
|
-
flatItems:
|
|
134
|
+
flatItems: p,
|
|
128
135
|
onExecute: I,
|
|
129
136
|
placeholder: i,
|
|
130
|
-
emptyTitle:
|
|
131
|
-
emptyDescription:
|
|
132
|
-
recentGroupLabel:
|
|
133
|
-
defaultGroupLabel:
|
|
137
|
+
emptyTitle: f,
|
|
138
|
+
emptyDescription: x,
|
|
139
|
+
recentGroupLabel: l,
|
|
140
|
+
defaultGroupLabel: c,
|
|
134
141
|
navigateLabel: O,
|
|
135
142
|
runLabel: A,
|
|
136
|
-
closeLabel: F
|
|
143
|
+
closeLabel: F,
|
|
144
|
+
configureShortcutsLabel: j
|
|
137
145
|
}),
|
|
138
146
|
[
|
|
139
147
|
w,
|
|
140
148
|
v,
|
|
141
|
-
|
|
149
|
+
p,
|
|
142
150
|
I,
|
|
143
151
|
i,
|
|
144
|
-
|
|
145
|
-
y,
|
|
152
|
+
f,
|
|
146
153
|
x,
|
|
147
|
-
|
|
154
|
+
l,
|
|
155
|
+
c,
|
|
148
156
|
O,
|
|
149
157
|
A,
|
|
150
|
-
F
|
|
158
|
+
F,
|
|
159
|
+
j
|
|
151
160
|
]
|
|
152
|
-
),
|
|
153
|
-
return /* @__PURE__ */ e(
|
|
161
|
+
), oe = o.Children.count(a) > 0;
|
|
162
|
+
return /* @__PURE__ */ e(S.Root, { open: M, onOpenChange: Q, children: /* @__PURE__ */ m(S.Portal, { children: [
|
|
154
163
|
/* @__PURE__ */ e(
|
|
155
|
-
|
|
164
|
+
S.Overlay,
|
|
156
165
|
{
|
|
157
166
|
className: "fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
158
167
|
}
|
|
159
168
|
),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
|
|
169
|
+
/* @__PURE__ */ m(
|
|
170
|
+
S.Content,
|
|
162
171
|
{
|
|
163
172
|
"aria-describedby": void 0,
|
|
164
173
|
"data-command-palette": !0,
|
|
165
174
|
"data-component": "command-palette",
|
|
166
|
-
onKeyDown:
|
|
167
|
-
className:
|
|
175
|
+
onKeyDown: se,
|
|
176
|
+
className: d(
|
|
168
177
|
"fixed left-[50%] top-[20%] z-50 w-full max-w-[640px] -translate-x-1/2",
|
|
169
178
|
"rounded-xl border border-[#d1d5db] bg-white shadow-2xl overflow-hidden",
|
|
170
179
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
@@ -173,70 +182,70 @@ function fe({
|
|
|
173
182
|
// Pin translate-x at -50% during animation so it stays centered (no horizontal slide)
|
|
174
183
|
"data-[state=open]:slide-in-from-left-1/2 data-[state=closed]:slide-out-to-left-1/2",
|
|
175
184
|
"duration-150",
|
|
176
|
-
|
|
185
|
+
s
|
|
177
186
|
),
|
|
178
187
|
style: { transformOrigin: "top center" },
|
|
179
188
|
children: [
|
|
180
|
-
/* @__PURE__ */ e(
|
|
181
|
-
/* @__PURE__ */ e(
|
|
189
|
+
/* @__PURE__ */ e(S.Title, { className: "sr-only", children: "Command Palette" }),
|
|
190
|
+
/* @__PURE__ */ e(D.Provider, { value: re, children: oe ? a : /* @__PURE__ */ m(le, { children: [
|
|
182
191
|
/* @__PURE__ */ e(
|
|
183
|
-
|
|
192
|
+
_,
|
|
184
193
|
{
|
|
185
194
|
ref: $,
|
|
186
195
|
placeholder: i
|
|
187
196
|
}
|
|
188
197
|
),
|
|
189
|
-
/* @__PURE__ */ e(H, { ref: K, children:
|
|
190
|
-
|
|
191
|
-
/* @__PURE__ */ e(V, { heading: t, children:
|
|
192
|
-
const
|
|
198
|
+
/* @__PURE__ */ e(H, { ref: K, children: p.length === 0 ? /* @__PURE__ */ e(Y, {}) : Array.from(ne.entries()).map(([t, r], R) => /* @__PURE__ */ m(o.Fragment, { children: [
|
|
199
|
+
R > 0 && /* @__PURE__ */ e(Z, {}),
|
|
200
|
+
/* @__PURE__ */ e(V, { heading: t, children: r.map((h) => {
|
|
201
|
+
const C = p.indexOf(h), g = ae(h.id);
|
|
193
202
|
return /* @__PURE__ */ e(
|
|
194
|
-
|
|
203
|
+
X,
|
|
195
204
|
{
|
|
196
|
-
command:
|
|
197
|
-
isSelected:
|
|
198
|
-
onSelect: () => I(
|
|
199
|
-
onMouseEnter: () => N(
|
|
200
|
-
keybinding:
|
|
205
|
+
command: h,
|
|
206
|
+
isSelected: C === v,
|
|
207
|
+
onSelect: () => I(h),
|
|
208
|
+
onMouseEnter: () => N(C),
|
|
209
|
+
keybinding: g
|
|
201
210
|
},
|
|
202
|
-
|
|
211
|
+
h.id
|
|
203
212
|
);
|
|
204
213
|
}) })
|
|
205
214
|
] }, t)) }),
|
|
206
|
-
/* @__PURE__ */ e(
|
|
215
|
+
/* @__PURE__ */ e(G, {})
|
|
207
216
|
] }) })
|
|
208
217
|
]
|
|
209
218
|
}
|
|
210
219
|
)
|
|
211
220
|
] }) });
|
|
212
221
|
}
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
({ className:
|
|
216
|
-
const { query:
|
|
217
|
-
return /* @__PURE__ */
|
|
222
|
+
he.displayName = "CommandPalette";
|
|
223
|
+
const _ = o.forwardRef(
|
|
224
|
+
({ className: s, placeholder: a, onValueChange: n, ...i }, f) => {
|
|
225
|
+
const { query: x, setQuery: l } = o.useContext(D);
|
|
226
|
+
return /* @__PURE__ */ m(
|
|
218
227
|
"div",
|
|
219
228
|
{
|
|
220
|
-
className:
|
|
229
|
+
className: d(
|
|
221
230
|
"flex items-center gap-3 border-b border-[#e5e7eb] px-4",
|
|
222
|
-
|
|
231
|
+
s
|
|
223
232
|
),
|
|
224
233
|
"data-command-palette-input": !0,
|
|
225
234
|
children: [
|
|
226
|
-
/* @__PURE__ */ e(
|
|
235
|
+
/* @__PURE__ */ e(W, { className: "h-4 w-4 shrink-0 text-[#9ca3af]" }),
|
|
227
236
|
/* @__PURE__ */ e(
|
|
228
237
|
"input",
|
|
229
238
|
{
|
|
230
|
-
ref:
|
|
231
|
-
value:
|
|
232
|
-
onChange: (
|
|
233
|
-
|
|
239
|
+
ref: f,
|
|
240
|
+
value: x,
|
|
241
|
+
onChange: (c) => {
|
|
242
|
+
l(c.target.value), n?.(c.target.value);
|
|
234
243
|
},
|
|
235
244
|
placeholder: a,
|
|
236
245
|
autoComplete: "off",
|
|
237
246
|
autoCorrect: "off",
|
|
238
247
|
spellCheck: !1,
|
|
239
|
-
className:
|
|
248
|
+
className: d(
|
|
240
249
|
"flex h-12 w-full bg-transparent py-3 text-sm font-medium outline-none",
|
|
241
250
|
"placeholder:text-[#9ca3af]"
|
|
242
251
|
),
|
|
@@ -244,7 +253,7 @@ const W = r.forwardRef(
|
|
|
244
253
|
}
|
|
245
254
|
),
|
|
246
255
|
/* @__PURE__ */ e(
|
|
247
|
-
|
|
256
|
+
E,
|
|
248
257
|
{
|
|
249
258
|
keybinding: { key: "Escape" },
|
|
250
259
|
size: "sm",
|
|
@@ -257,31 +266,31 @@ const W = r.forwardRef(
|
|
|
257
266
|
);
|
|
258
267
|
}
|
|
259
268
|
);
|
|
260
|
-
|
|
261
|
-
const H =
|
|
269
|
+
_.displayName = "CommandPaletteInput";
|
|
270
|
+
const H = o.forwardRef(({ className: s, children: a, ...n }, i) => /* @__PURE__ */ e(
|
|
262
271
|
"div",
|
|
263
272
|
{
|
|
264
273
|
ref: i,
|
|
265
274
|
role: "listbox",
|
|
266
275
|
"data-command-palette-list": !0,
|
|
267
|
-
className:
|
|
276
|
+
className: d(
|
|
268
277
|
"max-h-[360px] overflow-y-auto overscroll-contain py-1",
|
|
269
|
-
|
|
278
|
+
s
|
|
270
279
|
),
|
|
271
280
|
...n,
|
|
272
281
|
children: a
|
|
273
282
|
}
|
|
274
283
|
));
|
|
275
284
|
H.displayName = "CommandPaletteList";
|
|
276
|
-
const V =
|
|
277
|
-
({ className:
|
|
285
|
+
const V = o.forwardRef(
|
|
286
|
+
({ className: s, heading: a, children: n, ...i }, f) => /* @__PURE__ */ m(
|
|
278
287
|
"div",
|
|
279
288
|
{
|
|
280
|
-
ref:
|
|
289
|
+
ref: f,
|
|
281
290
|
role: "group",
|
|
282
291
|
"aria-label": a,
|
|
283
292
|
"data-command-palette-group": !0,
|
|
284
|
-
className:
|
|
293
|
+
className: d("py-1", s),
|
|
285
294
|
...i,
|
|
286
295
|
children: [
|
|
287
296
|
a && /* @__PURE__ */ e("div", { className: "px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-[#9ca3af]", children: a }),
|
|
@@ -291,18 +300,18 @@ const V = r.forwardRef(
|
|
|
291
300
|
)
|
|
292
301
|
);
|
|
293
302
|
V.displayName = "CommandPaletteGroup";
|
|
294
|
-
const
|
|
303
|
+
const ge = {
|
|
295
304
|
browser: "Browser",
|
|
296
305
|
"ag-grid": "AG Grid",
|
|
297
306
|
system: "System"
|
|
298
307
|
};
|
|
299
|
-
function
|
|
300
|
-
if (!
|
|
301
|
-
const n =
|
|
308
|
+
function ye({ source: s, isSelected: a }) {
|
|
309
|
+
if (!s || s === "user") return null;
|
|
310
|
+
const n = ge[s];
|
|
302
311
|
return n ? /* @__PURE__ */ e(
|
|
303
312
|
"span",
|
|
304
313
|
{
|
|
305
|
-
className:
|
|
314
|
+
className: d(
|
|
306
315
|
"shrink-0 rounded px-1.5 py-px text-[9px] font-medium leading-tight tracking-wide",
|
|
307
316
|
a ? "text-white/50" : "text-[#9ca3af] border border-[#e5e7eb]"
|
|
308
317
|
),
|
|
@@ -310,135 +319,145 @@ function pe({ source: o, isSelected: a }) {
|
|
|
310
319
|
}
|
|
311
320
|
) : null;
|
|
312
321
|
}
|
|
313
|
-
const
|
|
314
|
-
({ className:
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
322
|
+
const X = o.forwardRef(
|
|
323
|
+
({ className: s, command: a, isSelected: n, onSelect: i, keybinding: f, ...x }, l) => {
|
|
324
|
+
const c = xe(a.source);
|
|
325
|
+
return /* @__PURE__ */ m(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
ref: l,
|
|
329
|
+
role: "option",
|
|
330
|
+
"aria-selected": n,
|
|
331
|
+
"data-selected": n,
|
|
332
|
+
"data-command-palette-item": !0,
|
|
333
|
+
"data-command-id": a.id,
|
|
334
|
+
onClick: i,
|
|
335
|
+
className: d(
|
|
336
|
+
"flex items-center gap-3 cursor-pointer px-4 py-2 text-sm",
|
|
337
|
+
"transition-colors duration-75",
|
|
338
|
+
n ? "bg-[#4259ee] text-white" : c ? "text-[#9ca3af] hover:bg-[#f9fafb]" : "text-[#374151] hover:bg-[#f3f4f6]",
|
|
339
|
+
s
|
|
340
|
+
),
|
|
341
|
+
...x,
|
|
342
|
+
children: [
|
|
343
|
+
a.icon && /* @__PURE__ */ e("span", { className: d(
|
|
344
|
+
"flex h-4 w-4 shrink-0 items-center justify-center",
|
|
345
|
+
n ? "text-white" : c ? "text-[#d1d5db]" : "text-[#6b7280]"
|
|
346
|
+
), children: a.icon }),
|
|
347
|
+
/* @__PURE__ */ m("div", { className: "flex flex-1 flex-col min-w-0", children: [
|
|
348
|
+
/* @__PURE__ */ e("span", { className: d(
|
|
349
|
+
"truncate",
|
|
350
|
+
c && !n ? "font-normal" : "font-medium"
|
|
351
|
+
), children: a.label }),
|
|
352
|
+
a.description && /* @__PURE__ */ e("span", { className: d(
|
|
353
|
+
"truncate text-xs",
|
|
354
|
+
n ? "text-white/70" : c ? "text-[#d1d5db]" : "text-[#9ca3af]"
|
|
355
|
+
), children: a.description })
|
|
356
|
+
] }),
|
|
357
|
+
/* @__PURE__ */ e(ye, { source: a.source, isSelected: n }),
|
|
358
|
+
f && /* @__PURE__ */ e(J, { keybinding: f, isSelected: n, external: c })
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
}
|
|
348
363
|
);
|
|
349
|
-
|
|
350
|
-
function J({ keybinding:
|
|
351
|
-
const
|
|
364
|
+
X.displayName = "CommandPaletteItem";
|
|
365
|
+
function J({ keybinding: s, isSelected: a, external: n, className: i, ...f }) {
|
|
366
|
+
const x = ue(s);
|
|
352
367
|
return /* @__PURE__ */ e(
|
|
353
368
|
"span",
|
|
354
369
|
{
|
|
355
|
-
className:
|
|
370
|
+
className: d("ml-auto flex items-center gap-0.5 shrink-0", i),
|
|
356
371
|
"data-command-palette-shortcut": !0,
|
|
357
|
-
...
|
|
358
|
-
children:
|
|
372
|
+
...f,
|
|
373
|
+
children: x.map((l, c) => /* @__PURE__ */ e(
|
|
359
374
|
"kbd",
|
|
360
375
|
{
|
|
361
|
-
className:
|
|
376
|
+
className: d(
|
|
362
377
|
"inline-flex min-w-[20px] items-center justify-center rounded px-1 h-[20px] text-[10px] font-mono leading-none",
|
|
363
|
-
a ? "bg-white/20 text-white border border-white/30" : "bg-[#f4f5f7] text-[#6b7280] border border-[#d1d5db]"
|
|
378
|
+
a ? "bg-white/20 text-white border border-white/30" : n ? "bg-[#f9fafb] text-[#d1d5db] border border-[#e5e7eb]" : "bg-[#f4f5f7] text-[#6b7280] border border-[#d1d5db]"
|
|
364
379
|
),
|
|
365
|
-
children:
|
|
380
|
+
children: l
|
|
366
381
|
},
|
|
367
|
-
`${
|
|
382
|
+
`${l}-${c}`
|
|
368
383
|
))
|
|
369
384
|
}
|
|
370
385
|
);
|
|
371
386
|
}
|
|
372
387
|
J.displayName = "CommandPaletteShortcut";
|
|
373
|
-
function
|
|
374
|
-
const { emptyTitle: n, emptyDescription: i } =
|
|
375
|
-
return /* @__PURE__ */
|
|
388
|
+
function Y({ className: s, ...a }) {
|
|
389
|
+
const { emptyTitle: n, emptyDescription: i } = o.useContext(D);
|
|
390
|
+
return /* @__PURE__ */ m(
|
|
376
391
|
"div",
|
|
377
392
|
{
|
|
378
393
|
"data-command-palette-empty": !0,
|
|
379
|
-
className:
|
|
394
|
+
className: d(
|
|
380
395
|
"flex flex-col items-center justify-center py-12 text-center text-sm text-[#9ca3af]",
|
|
381
|
-
|
|
396
|
+
s
|
|
382
397
|
),
|
|
383
398
|
...a,
|
|
384
399
|
children: [
|
|
385
|
-
/* @__PURE__ */ e(
|
|
400
|
+
/* @__PURE__ */ e(W, { className: "h-8 w-8 mb-3 text-[#d1d5db]" }),
|
|
386
401
|
/* @__PURE__ */ e("p", { className: "font-medium", children: n }),
|
|
387
402
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i })
|
|
388
403
|
]
|
|
389
404
|
}
|
|
390
405
|
);
|
|
391
406
|
}
|
|
392
|
-
|
|
393
|
-
function
|
|
407
|
+
Y.displayName = "CommandPaletteEmpty";
|
|
408
|
+
function Z({ className: s, ...a }) {
|
|
394
409
|
return /* @__PURE__ */ e(
|
|
395
410
|
"div",
|
|
396
411
|
{
|
|
397
412
|
"data-command-palette-separator": !0,
|
|
398
|
-
className:
|
|
413
|
+
className: d("h-px bg-[#e5e7eb] mx-2", s),
|
|
399
414
|
...a
|
|
400
415
|
}
|
|
401
416
|
);
|
|
402
417
|
}
|
|
403
|
-
|
|
404
|
-
function
|
|
405
|
-
const { navigateLabel: n, runLabel: i, closeLabel:
|
|
406
|
-
return /* @__PURE__ */
|
|
418
|
+
Z.displayName = "CommandPaletteSeparator";
|
|
419
|
+
function G({ className: s, ...a }) {
|
|
420
|
+
const { navigateLabel: n, runLabel: i, closeLabel: f, configureShortcutsLabel: x } = o.useContext(D);
|
|
421
|
+
return /* @__PURE__ */ m(
|
|
407
422
|
"div",
|
|
408
423
|
{
|
|
409
424
|
"data-command-palette-footer": !0,
|
|
410
|
-
className:
|
|
425
|
+
className: d(
|
|
411
426
|
"flex items-center gap-4 border-t border-[#e5e7eb] px-4 py-2 text-[11px] text-[#9ca3af]",
|
|
412
|
-
|
|
427
|
+
s
|
|
413
428
|
),
|
|
414
429
|
...a,
|
|
415
430
|
children: [
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */ e(
|
|
418
|
-
/* @__PURE__ */ e(
|
|
431
|
+
/* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1", children: [
|
|
432
|
+
/* @__PURE__ */ e(E, { keys: ["↑"], size: "sm", variant: "muted" }),
|
|
433
|
+
/* @__PURE__ */ e(E, { keys: ["↓"], size: "sm", variant: "muted" }),
|
|
419
434
|
/* @__PURE__ */ e("span", { children: n })
|
|
420
435
|
] }),
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */ e(
|
|
436
|
+
/* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1", children: [
|
|
437
|
+
/* @__PURE__ */ e(E, { keys: ["↵"], size: "sm", variant: "muted" }),
|
|
423
438
|
/* @__PURE__ */ e("span", { children: i })
|
|
424
439
|
] }),
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
/* @__PURE__ */ e(
|
|
427
|
-
/* @__PURE__ */ e("span", { children:
|
|
440
|
+
/* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1", children: [
|
|
441
|
+
/* @__PURE__ */ e(E, { keys: ["Escape"], size: "sm", variant: "muted" }),
|
|
442
|
+
/* @__PURE__ */ e("span", { children: f })
|
|
443
|
+
] }),
|
|
444
|
+
x && /* @__PURE__ */ m("span", { className: "ml-auto inline-flex items-center gap-1", children: [
|
|
445
|
+
/* @__PURE__ */ e(E, { keybinding: { key: "k", alt: !0 }, size: "sm", variant: "muted" }),
|
|
446
|
+
/* @__PURE__ */ e("span", { children: x })
|
|
428
447
|
] })
|
|
429
448
|
]
|
|
430
449
|
}
|
|
431
450
|
);
|
|
432
451
|
}
|
|
433
|
-
|
|
452
|
+
G.displayName = "CommandPaletteFooter";
|
|
434
453
|
export {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
454
|
+
he as CommandPalette,
|
|
455
|
+
Y as CommandPaletteEmpty,
|
|
456
|
+
G as CommandPaletteFooter,
|
|
438
457
|
V as CommandPaletteGroup,
|
|
439
|
-
|
|
440
|
-
|
|
458
|
+
_ as CommandPaletteInput,
|
|
459
|
+
X as CommandPaletteItem,
|
|
441
460
|
H as CommandPaletteList,
|
|
442
|
-
|
|
461
|
+
Z as CommandPaletteSeparator,
|
|
443
462
|
J as CommandPaletteShortcut
|
|
444
463
|
};
|