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