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