impact-nova 1.5.13 → 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 +242 -225
- 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
|
|
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,156 +21,159 @@ const D = 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
|
|
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
|
-
return
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
52
|
+
return t;
|
|
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
|
|
52
|
-
const
|
|
53
|
-
|
|
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
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
for (const
|
|
60
|
-
const P =
|
|
61
|
-
|
|
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 [
|
|
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
|
-
z &&
|
|
75
|
-
const
|
|
76
|
-
for (const [
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
}, [
|
|
80
|
-
|
|
81
|
-
M && (
|
|
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(() => {
|
|
82
87
|
$.current?.focus();
|
|
83
88
|
}));
|
|
84
89
|
}, [M]);
|
|
85
|
-
const Q = (
|
|
86
|
-
|
|
87
|
-
}, I =
|
|
88
|
-
|
|
89
|
-
}, [k,
|
|
90
|
-
switch (
|
|
90
|
+
const Q = (t) => {
|
|
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) => {
|
|
95
|
+
switch (t.key) {
|
|
91
96
|
case "ArrowDown": {
|
|
92
|
-
|
|
97
|
+
t.preventDefault(), N((r) => Math.min(r + 1, p.length - 1));
|
|
93
98
|
break;
|
|
94
99
|
}
|
|
95
100
|
case "ArrowUp": {
|
|
96
|
-
|
|
101
|
+
t.preventDefault(), N((r) => Math.max(r - 1, 0));
|
|
97
102
|
break;
|
|
98
103
|
}
|
|
99
104
|
case "Enter": {
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
105
|
+
t.preventDefault();
|
|
106
|
+
const r = p[v];
|
|
107
|
+
r && I(r);
|
|
103
108
|
break;
|
|
104
109
|
}
|
|
105
110
|
case "Home": {
|
|
106
|
-
|
|
111
|
+
t.preventDefault(), N(0);
|
|
107
112
|
break;
|
|
108
113
|
}
|
|
109
114
|
case "End": {
|
|
110
|
-
|
|
115
|
+
t.preventDefault(), N(Math.max(p.length - 1, 0));
|
|
111
116
|
break;
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
|
-
}, [
|
|
115
|
-
|
|
119
|
+
}, [p, v, I]);
|
|
120
|
+
o.useEffect(() => {
|
|
116
121
|
N(0);
|
|
117
|
-
}, [w]),
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
+
}, [w]), o.useEffect(() => {
|
|
123
|
+
const t = K.current;
|
|
124
|
+
if (!t) return;
|
|
125
|
+
const r = t.querySelector('[data-selected="true"]');
|
|
126
|
+
r && r.scrollIntoView({ block: "nearest" });
|
|
122
127
|
}, [v]);
|
|
123
|
-
const
|
|
128
|
+
const re = o.useMemo(
|
|
124
129
|
() => ({
|
|
125
130
|
query: w,
|
|
126
|
-
setQuery:
|
|
131
|
+
setQuery: T,
|
|
127
132
|
selectedIndex: v,
|
|
128
133
|
setSelectedIndex: N,
|
|
129
|
-
flatItems:
|
|
134
|
+
flatItems: p,
|
|
130
135
|
onExecute: I,
|
|
131
136
|
placeholder: i,
|
|
132
|
-
emptyTitle:
|
|
133
|
-
emptyDescription:
|
|
134
|
-
recentGroupLabel:
|
|
135
|
-
defaultGroupLabel:
|
|
137
|
+
emptyTitle: f,
|
|
138
|
+
emptyDescription: x,
|
|
139
|
+
recentGroupLabel: l,
|
|
140
|
+
defaultGroupLabel: c,
|
|
136
141
|
navigateLabel: O,
|
|
137
142
|
runLabel: A,
|
|
138
|
-
closeLabel: F
|
|
143
|
+
closeLabel: F,
|
|
144
|
+
configureShortcutsLabel: j
|
|
139
145
|
}),
|
|
140
146
|
[
|
|
141
147
|
w,
|
|
142
148
|
v,
|
|
143
|
-
|
|
149
|
+
p,
|
|
144
150
|
I,
|
|
145
151
|
i,
|
|
152
|
+
f,
|
|
153
|
+
x,
|
|
146
154
|
l,
|
|
147
|
-
|
|
148
|
-
d,
|
|
149
|
-
C,
|
|
155
|
+
c,
|
|
150
156
|
O,
|
|
151
157
|
A,
|
|
152
|
-
F
|
|
158
|
+
F,
|
|
159
|
+
j
|
|
153
160
|
]
|
|
154
|
-
),
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
|
|
161
|
+
), oe = o.Children.count(a) > 0;
|
|
162
|
+
return /* @__PURE__ */ e(S.Root, { open: M, onOpenChange: Q, children: /* @__PURE__ */ m(S.Portal, { children: [
|
|
163
|
+
/* @__PURE__ */ e(
|
|
164
|
+
S.Overlay,
|
|
158
165
|
{
|
|
159
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"
|
|
160
167
|
}
|
|
161
168
|
),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
|
|
169
|
+
/* @__PURE__ */ m(
|
|
170
|
+
S.Content,
|
|
164
171
|
{
|
|
165
172
|
"aria-describedby": void 0,
|
|
166
173
|
"data-command-palette": !0,
|
|
167
174
|
"data-component": "command-palette",
|
|
168
|
-
onKeyDown:
|
|
169
|
-
className:
|
|
175
|
+
onKeyDown: se,
|
|
176
|
+
className: d(
|
|
170
177
|
"fixed left-[50%] top-[20%] z-50 w-full max-w-[640px] -translate-x-1/2",
|
|
171
178
|
"rounded-xl border border-[#d1d5db] bg-white shadow-2xl overflow-hidden",
|
|
172
179
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
@@ -175,78 +182,78 @@ function ue({
|
|
|
175
182
|
// Pin translate-x at -50% during animation so it stays centered (no horizontal slide)
|
|
176
183
|
"data-[state=open]:slide-in-from-left-1/2 data-[state=closed]:slide-out-to-left-1/2",
|
|
177
184
|
"duration-150",
|
|
178
|
-
|
|
185
|
+
s
|
|
179
186
|
),
|
|
180
187
|
style: { transformOrigin: "top center" },
|
|
181
188
|
children: [
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
|
|
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: [
|
|
191
|
+
/* @__PURE__ */ e(
|
|
192
|
+
_,
|
|
186
193
|
{
|
|
187
194
|
ref: $,
|
|
188
195
|
placeholder: i
|
|
189
196
|
}
|
|
190
197
|
),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
const
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
|
|
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);
|
|
202
|
+
return /* @__PURE__ */ e(
|
|
203
|
+
X,
|
|
197
204
|
{
|
|
198
|
-
command:
|
|
199
|
-
isSelected:
|
|
200
|
-
onSelect: () => I(
|
|
201
|
-
onMouseEnter: () => N(
|
|
202
|
-
keybinding:
|
|
205
|
+
command: h,
|
|
206
|
+
isSelected: C === v,
|
|
207
|
+
onSelect: () => I(h),
|
|
208
|
+
onMouseEnter: () => N(C),
|
|
209
|
+
keybinding: g
|
|
203
210
|
},
|
|
204
|
-
|
|
211
|
+
h.id
|
|
205
212
|
);
|
|
206
213
|
}) })
|
|
207
|
-
] },
|
|
208
|
-
/* @__PURE__ */
|
|
214
|
+
] }, t)) }),
|
|
215
|
+
/* @__PURE__ */ e(G, {})
|
|
209
216
|
] }) })
|
|
210
217
|
]
|
|
211
218
|
}
|
|
212
219
|
)
|
|
213
220
|
] }) });
|
|
214
221
|
}
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
({ className:
|
|
218
|
-
const { query:
|
|
219
|
-
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(
|
|
220
227
|
"div",
|
|
221
228
|
{
|
|
222
|
-
className:
|
|
229
|
+
className: d(
|
|
223
230
|
"flex items-center gap-3 border-b border-[#e5e7eb] px-4",
|
|
224
|
-
|
|
231
|
+
s
|
|
225
232
|
),
|
|
226
233
|
"data-command-palette-input": !0,
|
|
227
234
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ e(W, { className: "h-4 w-4 shrink-0 text-[#9ca3af]" }),
|
|
236
|
+
/* @__PURE__ */ e(
|
|
230
237
|
"input",
|
|
231
238
|
{
|
|
232
|
-
ref:
|
|
233
|
-
value:
|
|
234
|
-
onChange: (
|
|
235
|
-
|
|
239
|
+
ref: f,
|
|
240
|
+
value: x,
|
|
241
|
+
onChange: (c) => {
|
|
242
|
+
l(c.target.value), n?.(c.target.value);
|
|
236
243
|
},
|
|
237
244
|
placeholder: a,
|
|
238
245
|
autoComplete: "off",
|
|
239
246
|
autoCorrect: "off",
|
|
240
247
|
spellCheck: !1,
|
|
241
|
-
className:
|
|
248
|
+
className: d(
|
|
242
249
|
"flex h-12 w-full bg-transparent py-3 text-sm font-medium outline-none",
|
|
243
250
|
"placeholder:text-[#9ca3af]"
|
|
244
251
|
),
|
|
245
252
|
...i
|
|
246
253
|
}
|
|
247
254
|
),
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
|
|
255
|
+
/* @__PURE__ */ e(
|
|
256
|
+
E,
|
|
250
257
|
{
|
|
251
258
|
keybinding: { key: "Escape" },
|
|
252
259
|
size: "sm",
|
|
@@ -259,52 +266,52 @@ const W = r.forwardRef(
|
|
|
259
266
|
);
|
|
260
267
|
}
|
|
261
268
|
);
|
|
262
|
-
|
|
263
|
-
const H =
|
|
269
|
+
_.displayName = "CommandPaletteInput";
|
|
270
|
+
const H = o.forwardRef(({ className: s, children: a, ...n }, i) => /* @__PURE__ */ e(
|
|
264
271
|
"div",
|
|
265
272
|
{
|
|
266
273
|
ref: i,
|
|
267
274
|
role: "listbox",
|
|
268
275
|
"data-command-palette-list": !0,
|
|
269
|
-
className:
|
|
276
|
+
className: d(
|
|
270
277
|
"max-h-[360px] overflow-y-auto overscroll-contain py-1",
|
|
271
|
-
|
|
278
|
+
s
|
|
272
279
|
),
|
|
273
280
|
...n,
|
|
274
281
|
children: a
|
|
275
282
|
}
|
|
276
283
|
));
|
|
277
284
|
H.displayName = "CommandPaletteList";
|
|
278
|
-
const V =
|
|
279
|
-
({ className:
|
|
285
|
+
const V = o.forwardRef(
|
|
286
|
+
({ className: s, heading: a, children: n, ...i }, f) => /* @__PURE__ */ m(
|
|
280
287
|
"div",
|
|
281
288
|
{
|
|
282
|
-
ref:
|
|
289
|
+
ref: f,
|
|
283
290
|
role: "group",
|
|
284
291
|
"aria-label": a,
|
|
285
292
|
"data-command-palette-group": !0,
|
|
286
|
-
className:
|
|
293
|
+
className: d("py-1", s),
|
|
287
294
|
...i,
|
|
288
295
|
children: [
|
|
289
|
-
a && /* @__PURE__ */
|
|
296
|
+
a && /* @__PURE__ */ e("div", { className: "px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-[#9ca3af]", children: a }),
|
|
290
297
|
n
|
|
291
298
|
]
|
|
292
299
|
}
|
|
293
300
|
)
|
|
294
301
|
);
|
|
295
302
|
V.displayName = "CommandPaletteGroup";
|
|
296
|
-
const
|
|
303
|
+
const ge = {
|
|
297
304
|
browser: "Browser",
|
|
298
305
|
"ag-grid": "AG Grid",
|
|
299
306
|
system: "System"
|
|
300
307
|
};
|
|
301
|
-
function
|
|
302
|
-
if (!
|
|
303
|
-
const n =
|
|
304
|
-
return n ? /* @__PURE__ */
|
|
308
|
+
function ye({ source: s, isSelected: a }) {
|
|
309
|
+
if (!s || s === "user") return null;
|
|
310
|
+
const n = ge[s];
|
|
311
|
+
return n ? /* @__PURE__ */ e(
|
|
305
312
|
"span",
|
|
306
313
|
{
|
|
307
|
-
className:
|
|
314
|
+
className: d(
|
|
308
315
|
"shrink-0 rounded px-1.5 py-px text-[9px] font-medium leading-tight tracking-wide",
|
|
309
316
|
a ? "text-white/50" : "text-[#9ca3af] border border-[#e5e7eb]"
|
|
310
317
|
),
|
|
@@ -312,135 +319,145 @@ function xe({ source: o, isSelected: a }) {
|
|
|
312
319
|
}
|
|
313
320
|
) : null;
|
|
314
321
|
}
|
|
315
|
-
const
|
|
316
|
-
({ className:
|
|
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
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
+
}
|
|
350
363
|
);
|
|
351
|
-
|
|
352
|
-
function J({ keybinding:
|
|
353
|
-
const
|
|
354
|
-
return /* @__PURE__ */
|
|
364
|
+
X.displayName = "CommandPaletteItem";
|
|
365
|
+
function J({ keybinding: s, isSelected: a, external: n, className: i, ...f }) {
|
|
366
|
+
const x = ue(s);
|
|
367
|
+
return /* @__PURE__ */ e(
|
|
355
368
|
"span",
|
|
356
369
|
{
|
|
357
|
-
className:
|
|
370
|
+
className: d("ml-auto flex items-center gap-0.5 shrink-0", i),
|
|
358
371
|
"data-command-palette-shortcut": !0,
|
|
359
|
-
...
|
|
360
|
-
children:
|
|
372
|
+
...f,
|
|
373
|
+
children: x.map((l, c) => /* @__PURE__ */ e(
|
|
361
374
|
"kbd",
|
|
362
375
|
{
|
|
363
|
-
className:
|
|
376
|
+
className: d(
|
|
364
377
|
"inline-flex min-w-[20px] items-center justify-center rounded px-1 h-[20px] text-[10px] font-mono leading-none",
|
|
365
|
-
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]"
|
|
366
379
|
),
|
|
367
|
-
children:
|
|
380
|
+
children: l
|
|
368
381
|
},
|
|
369
|
-
`${
|
|
382
|
+
`${l}-${c}`
|
|
370
383
|
))
|
|
371
384
|
}
|
|
372
385
|
);
|
|
373
386
|
}
|
|
374
387
|
J.displayName = "CommandPaletteShortcut";
|
|
375
|
-
function
|
|
376
|
-
const { emptyTitle: n, emptyDescription: i } =
|
|
377
|
-
return /* @__PURE__ */
|
|
388
|
+
function Y({ className: s, ...a }) {
|
|
389
|
+
const { emptyTitle: n, emptyDescription: i } = o.useContext(D);
|
|
390
|
+
return /* @__PURE__ */ m(
|
|
378
391
|
"div",
|
|
379
392
|
{
|
|
380
393
|
"data-command-palette-empty": !0,
|
|
381
|
-
className:
|
|
394
|
+
className: d(
|
|
382
395
|
"flex flex-col items-center justify-center py-12 text-center text-sm text-[#9ca3af]",
|
|
383
|
-
|
|
396
|
+
s
|
|
384
397
|
),
|
|
385
398
|
...a,
|
|
386
399
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ e(W, { className: "h-8 w-8 mb-3 text-[#d1d5db]" }),
|
|
401
|
+
/* @__PURE__ */ e("p", { className: "font-medium", children: n }),
|
|
402
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i })
|
|
390
403
|
]
|
|
391
404
|
}
|
|
392
405
|
);
|
|
393
406
|
}
|
|
394
|
-
|
|
395
|
-
function
|
|
396
|
-
return /* @__PURE__ */
|
|
407
|
+
Y.displayName = "CommandPaletteEmpty";
|
|
408
|
+
function Z({ className: s, ...a }) {
|
|
409
|
+
return /* @__PURE__ */ e(
|
|
397
410
|
"div",
|
|
398
411
|
{
|
|
399
412
|
"data-command-palette-separator": !0,
|
|
400
|
-
className:
|
|
413
|
+
className: d("h-px bg-[#e5e7eb] mx-2", s),
|
|
401
414
|
...a
|
|
402
415
|
}
|
|
403
416
|
);
|
|
404
417
|
}
|
|
405
|
-
|
|
406
|
-
function
|
|
407
|
-
const { navigateLabel: n, runLabel: i, closeLabel:
|
|
408
|
-
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(
|
|
409
422
|
"div",
|
|
410
423
|
{
|
|
411
424
|
"data-command-palette-footer": !0,
|
|
412
|
-
className:
|
|
425
|
+
className: d(
|
|
413
426
|
"flex items-center gap-4 border-t border-[#e5e7eb] px-4 py-2 text-[11px] text-[#9ca3af]",
|
|
414
|
-
|
|
427
|
+
s
|
|
415
428
|
),
|
|
416
429
|
...a,
|
|
417
430
|
children: [
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
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" }),
|
|
434
|
+
/* @__PURE__ */ e("span", { children: n })
|
|
435
|
+
] }),
|
|
436
|
+
/* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1", children: [
|
|
437
|
+
/* @__PURE__ */ e(E, { keys: ["↵"], size: "sm", variant: "muted" }),
|
|
438
|
+
/* @__PURE__ */ e("span", { children: i })
|
|
422
439
|
] }),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
/* @__PURE__ */
|
|
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 })
|
|
426
443
|
] }),
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
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 })
|
|
430
447
|
] })
|
|
431
448
|
]
|
|
432
449
|
}
|
|
433
450
|
);
|
|
434
451
|
}
|
|
435
|
-
|
|
452
|
+
G.displayName = "CommandPaletteFooter";
|
|
436
453
|
export {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
454
|
+
he as CommandPalette,
|
|
455
|
+
Y as CommandPaletteEmpty,
|
|
456
|
+
G as CommandPaletteFooter,
|
|
440
457
|
V as CommandPaletteGroup,
|
|
441
|
-
|
|
442
|
-
|
|
458
|
+
_ as CommandPaletteInput,
|
|
459
|
+
X as CommandPaletteItem,
|
|
443
460
|
H as CommandPaletteList,
|
|
444
|
-
|
|
461
|
+
Z as CommandPaletteSeparator,
|
|
445
462
|
J as CommandPaletteShortcut
|
|
446
463
|
};
|