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.
Files changed (39) hide show
  1. package/dist/components/ui/badge.d.ts +1 -1
  2. package/dist/components/ui/badge.js +12 -11
  3. package/dist/components/ui/breadcrumb.js +25 -20
  4. package/dist/components/ui/command-palette/command-palette-layout.d.ts +28 -0
  5. package/dist/components/ui/command-palette/command-palette-layout.js +59 -0
  6. package/dist/components/ui/command-palette/command-palette.d.ts +5 -2
  7. package/dist/components/ui/command-palette/command-palette.js +271 -264
  8. package/dist/components/ui/command-palette/index.d.ts +1 -1
  9. package/dist/components/ui/command-palette/index.js +42 -41
  10. package/dist/components/ui/command-palette/shortcut-settings.d.ts +3 -3
  11. package/dist/components/ui/command-palette/shortcut-settings.js +112 -107
  12. package/dist/components/ui/command-palette/utils.d.ts +6 -1
  13. package/dist/components/ui/command-palette/utils.js +81 -74
  14. package/dist/components/ui/data-table/data-table.js +51 -40
  15. package/dist/components/ui/dialog.js +2 -5
  16. package/dist/components/ui/empty-container.js +72 -65
  17. package/dist/components/ui/filter-panel/filter-panel.d.ts +2 -2
  18. package/dist/components/ui/filter-panel/filter-panel.js +154 -76
  19. package/dist/components/ui/filter-strip/filter-summary.js +30 -32
  20. package/dist/components/ui/header.d.ts +7 -3
  21. package/dist/components/ui/header.js +46 -44
  22. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +1 -1
  23. package/dist/components/ui/select/select.js +84 -88
  24. package/dist/components/ui/sidebar.js +341 -305
  25. package/dist/components/ui/types/filter-panel.types.d.ts +3 -0
  26. package/dist/components/ui/types/horizontal-scroller.types.d.ts +1 -1
  27. package/dist/i18n/defaultMessages.d.ts +1 -0
  28. package/dist/i18n/defaultMessages.js +1 -0
  29. package/dist/i18n/locales/de.js +1 -0
  30. package/dist/i18n/locales/es.js +1 -0
  31. package/dist/i18n/locales/hi.js +1 -0
  32. package/dist/i18n/locales/kn.js +1 -0
  33. package/dist/icons/assets/clock.svg.js +5 -0
  34. package/dist/icons/index.d.ts +1 -0
  35. package/dist/icons/index.js +159 -157
  36. package/dist/impact-nova.css +1 -1
  37. package/dist/index.js +106 -105
  38. package/package.json +1 -1
  39. package/tailwind.config.js +14 -1
@@ -1,172 +1,172 @@
1
- import { jsx as t, jsxs as f, Fragment as le } from "react/jsx-runtime";
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 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 de } from "./command-palette-context.js";
7
- import { Kbd as S } from "./kbd.js";
8
- import { fuzzyFilter as me, keybindingToSymbols as fe } from "./utils.js";
9
- const D = r.createContext({
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
- flatItems: [],
21
+ orderedCommands: [],
17
22
  onExecute: () => {
18
23
  }
19
24
  });
20
- function ue({
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: l = "No results found",
26
- emptyDescription: y = "Try a different search term",
27
- recentGroupLabel: d = "Recently Used",
28
- defaultGroupLabel: C = "Commands",
29
- navigateLabel: O = "Navigate",
30
- runLabel: A = "Run",
31
- closeLabel: F = "Close",
32
- onCommandExecute: j,
33
- onOpenChange: G
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: M, setOpen: L, getPaletteCommands: ee, getEffectiveKeybinding: te, registry: k } = de(), [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 e = me(
37
- T,
38
- w,
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 (!w.trim()) {
42
- const s = k.getRecentCommandIds(), E = new Set(s), p = [], b = [];
43
- for (const x of e)
44
- E.has(x.item.id) ? p.push(x) : b.push(x);
45
- return p.sort((x, z) => s.indexOf(x.item.id) - s.indexOf(z.item.id)), [...p, ...b];
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
- const E = { modal: 4, page: 3, module: 2, global: 1 }, p = { user: 2, "ag-grid": 1, browser: 0, system: 0 }, b = /* @__PURE__ */ new Map();
65
- for (const [m, h] of e.entries()) {
66
- let g = -1;
67
- for (const P of h) {
68
- const ie = E[P.scope] ?? 1, ce = p[P.source ?? "user"] ?? 0;
69
- g = Math.max(g, ie * 10 + ce);
70
- }
71
- b.set(m, g);
72
- }
73
- const x = /* @__PURE__ */ new Map(), z = e.get(d);
74
- z && x.set(d, z);
75
- const oe = Array.from(e.entries()).filter(([m]) => m !== d).sort(([m], [h]) => (b.get(h) ?? 0) - (b.get(m) ?? 0));
76
- for (const [m, h] of oe)
77
- x.set(m, h);
78
- return x;
79
- }, [u, w, k, d, C]);
80
- r.useEffect(() => {
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
- }, [M]);
85
- const Q = (e) => {
86
- L(e), G?.(e);
87
- }, I = r.useCallback((e) => {
88
- e.handler(), k.addRecentCommand(e.id), j?.(e), Q(!1);
89
- }, [k, j]), ne = r.useCallback((e) => {
90
- switch (e.key) {
91
- case "ArrowDown": {
92
- e.preventDefault(), N((s) => Math.min(s + 1, u.length - 1));
93
- break;
94
- }
95
- case "ArrowUp": {
96
- e.preventDefault(), N((s) => Math.max(s - 1, 0));
97
- break;
98
- }
99
- case "Enter": {
100
- e.preventDefault();
101
- const s = u[v];
102
- s && I(s);
103
- break;
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
- case "Home": {
106
- e.preventDefault(), N(0);
107
- break;
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
- N(0);
117
- }, [w]), r.useEffect(() => {
118
- const e = K.current;
119
- if (!e) return;
120
- const s = e.querySelector('[data-selected="true"]');
121
- s && s.scrollIntoView({ block: "nearest" });
122
- }, [v]);
123
- const se = r.useMemo(
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: w,
126
- setQuery: q,
127
- selectedIndex: v,
128
- setSelectedIndex: N,
129
- flatItems: u,
130
- onExecute: I,
123
+ query: y,
124
+ setQuery: $,
125
+ selectedIndex: w,
126
+ setSelectedIndex: h,
127
+ orderedCommands: g,
128
+ onExecute: v,
131
129
  placeholder: i,
132
- emptyTitle: l,
133
- emptyDescription: y,
134
- recentGroupLabel: d,
135
- defaultGroupLabel: C,
136
- navigateLabel: O,
137
- runLabel: A,
138
- closeLabel: F
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
- l,
147
- y,
145
+ m,
146
+ u,
147
+ f,
148
148
  d,
149
- C,
150
- O,
151
- A,
152
- F
149
+ I,
150
+ z,
151
+ M,
152
+ D
153
153
  ]
154
154
  ), re = r.Children.count(a) > 0;
155
- return /* @__PURE__ */ t(R.Root, { open: M, onOpenChange: Q, children: /* @__PURE__ */ f(R.Portal, { children: [
156
- /* @__PURE__ */ t(
157
- R.Overlay,
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__ */ f(
163
- R.Content,
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: ne,
169
- className: c(
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__ */ t(R.Title, { className: "sr-only", children: "Command Palette" }),
183
- /* @__PURE__ */ t(D.Provider, { value: se, children: re ? a : /* @__PURE__ */ f(le, { children: [
184
- /* @__PURE__ */ t(
185
- W,
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__ */ t(H, { ref: K, children: u.length === 0 ? /* @__PURE__ */ t(X, {}) : Array.from(ae.entries()).map(([e, s], E) => /* @__PURE__ */ f(r.Fragment, { children: [
192
- E > 0 && /* @__PURE__ */ t(Y, {}),
193
- /* @__PURE__ */ t(V, { heading: e, children: s.map((p) => {
194
- const b = u.indexOf(p), x = te(p.id);
195
- return /* @__PURE__ */ t(
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: p,
199
- isSelected: b === v,
200
- onSelect: () => I(p),
201
- onMouseEnter: () => N(b),
198
+ command: b,
199
+ isSelected: C === w,
200
+ onSelect: () => v(b),
201
+ onMouseEnter: () => h(C),
202
202
  keybinding: x
203
203
  },
204
- p.id
204
+ b.id
205
205
  );
206
206
  }) })
207
- ] }, e)) }),
208
- /* @__PURE__ */ t(Z, {})
207
+ ] }, `${t.heading}-${t.rowStart}`)) }),
208
+ /* @__PURE__ */ e(J, {})
209
209
  ] }) })
210
210
  ]
211
211
  }
212
212
  )
213
213
  ] }) });
214
214
  }
215
- ue.displayName = "CommandPalette";
216
- const W = r.forwardRef(
217
- ({ className: o, placeholder: a, onValueChange: n, ...i }, l) => {
218
- const { query: y, setQuery: d } = r.useContext(D);
219
- return /* @__PURE__ */ f(
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: c(
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__ */ t(U, { className: "h-4 w-4 shrink-0 text-[#9ca3af]" }),
229
- /* @__PURE__ */ t(
228
+ /* @__PURE__ */ e(Q, { className: "h-4 w-4 shrink-0 text-[#9ca3af]" }),
229
+ /* @__PURE__ */ e(
230
230
  "input",
231
231
  {
232
- ref: l,
233
- value: y,
234
- onChange: (C) => {
235
- d(C.target.value), n?.(C.target.value);
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: c(
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__ */ t(
249
- S,
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
- W.displayName = "CommandPaletteInput";
263
- const H = r.forwardRef(({ className: o, children: a, ...n }, i) => /* @__PURE__ */ t(
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: c(
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
- H.displayName = "CommandPaletteList";
278
- const V = r.forwardRef(
279
- ({ className: o, heading: a, children: n, ...i }, l) => /* @__PURE__ */ f(
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: l,
282
+ ref: m,
283
283
  role: "group",
284
284
  "aria-label": a,
285
285
  "data-command-palette-group": !0,
286
- className: c("py-1", o),
286
+ className: l("py-1", o),
287
287
  ...i,
288
288
  children: [
289
- a && /* @__PURE__ */ t("div", { className: "px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-[#9ca3af]", children: a }),
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
- V.displayName = "CommandPaletteGroup";
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 = pe[o];
304
- return n ? /* @__PURE__ */ t(
298
+ const n = me[o];
299
+ return n ? /* @__PURE__ */ e(
305
300
  "span",
306
301
  {
307
- className: c(
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 _ = r.forwardRef(
316
- ({ className: o, command: a, isSelected: n, onSelect: i, keybinding: l, ...y }, d) => /* @__PURE__ */ f(
317
- "div",
318
- {
319
- ref: d,
320
- role: "option",
321
- "aria-selected": n,
322
- "data-selected": n,
323
- "data-command-palette-item": !0,
324
- "data-command-id": a.id,
325
- onClick: i,
326
- className: c(
327
- "flex items-center gap-3 cursor-pointer px-4 py-2 text-sm",
328
- "transition-colors duration-75",
329
- n ? "bg-[#4259ee] text-white" : "text-[#374151] hover:bg-[#f3f4f6]",
330
- o
331
- ),
332
- ...y,
333
- children: [
334
- a.icon && /* @__PURE__ */ t("span", { className: c(
335
- "flex h-4 w-4 shrink-0 items-center justify-center",
336
- n ? "text-white" : "text-[#6b7280]"
337
- ), children: a.icon }),
338
- /* @__PURE__ */ f("div", { className: "flex flex-1 flex-col min-w-0", children: [
339
- /* @__PURE__ */ t("span", { className: "truncate font-medium", children: a.label }),
340
- a.description && /* @__PURE__ */ t("span", { className: c(
341
- "truncate text-xs",
342
- n ? "text-white/70" : "text-[#9ca3af]"
343
- ), children: a.description })
344
- ] }),
345
- /* @__PURE__ */ t(xe, { source: a.source, isSelected: n }),
346
- l && /* @__PURE__ */ t(J, { keybinding: l, isSelected: n })
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
- _.displayName = "CommandPaletteItem";
352
- function J({ keybinding: o, isSelected: a, className: n, ...i }) {
353
- const l = fe(o);
354
- return /* @__PURE__ */ t(
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: c("ml-auto flex items-center gap-0.5 shrink-0", n),
359
+ className: l("ml-auto flex items-center gap-0.5 shrink-0", i),
358
360
  "data-command-palette-shortcut": !0,
359
- ...i,
360
- children: l.map((y, d) => /* @__PURE__ */ t(
361
+ ...m,
362
+ children: u.map((f, d) => /* @__PURE__ */ e(
361
363
  "kbd",
362
364
  {
363
- className: c(
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
- a ? "bg-white/20 text-white border border-white/30" : "bg-[#f4f5f7] text-[#6b7280] border border-[#d1d5db]"
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: y
370
+ children: f
368
371
  },
369
- `${y}-${d}`
372
+ `${f}-${d}`
370
373
  ))
371
374
  }
372
375
  );
373
376
  }
374
- J.displayName = "CommandPaletteShortcut";
375
- function X({ className: o, ...a }) {
376
- const { emptyTitle: n, emptyDescription: i } = r.useContext(D);
377
- return /* @__PURE__ */ f(
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: c(
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__ */ t(U, { className: "h-8 w-8 mb-3 text-[#d1d5db]" }),
388
- /* @__PURE__ */ t("p", { className: "font-medium", children: n }),
389
- /* @__PURE__ */ t("p", { className: "text-xs mt-1", children: i })
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
- X.displayName = "CommandPaletteEmpty";
395
- function Y({ className: o, ...a }) {
396
- return /* @__PURE__ */ t(
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: c("h-px bg-[#e5e7eb] mx-2", o),
403
+ className: l("h-px bg-[#e5e7eb] mx-2", o),
401
404
  ...a
402
405
  }
403
406
  );
404
407
  }
405
- Y.displayName = "CommandPaletteSeparator";
406
- function Z({ className: o, ...a }) {
407
- const { navigateLabel: n, runLabel: i, closeLabel: l } = r.useContext(D);
408
- return /* @__PURE__ */ f(
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: c(
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__ */ f("span", { className: "inline-flex items-center gap-1", children: [
419
- /* @__PURE__ */ t(S, { keys: ["↑"], size: "sm", variant: "muted" }),
420
- /* @__PURE__ */ t(S, { keys: ["↓"], size: "sm", variant: "muted" }),
421
- /* @__PURE__ */ t("span", { children: n })
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__ */ f("span", { className: "inline-flex items-center gap-1", children: [
424
- /* @__PURE__ */ t(S, { keys: [""], size: "sm", variant: "muted" }),
425
- /* @__PURE__ */ t("span", { children: i })
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__ */ f("span", { className: "inline-flex items-center gap-1", children: [
428
- /* @__PURE__ */ t(S, { keys: ["Escape"], size: "sm", variant: "muted" }),
429
- /* @__PURE__ */ t("span", { children: l })
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
- Z.displayName = "CommandPaletteFooter";
442
+ J.displayName = "CommandPaletteFooter";
436
443
  export {
437
- ue as CommandPalette,
438
- X as CommandPaletteEmpty,
439
- Z as CommandPaletteFooter,
440
- V as CommandPaletteGroup,
441
- W as CommandPaletteInput,
442
- _ as CommandPaletteItem,
443
- H as CommandPaletteList,
444
- Y as CommandPaletteSeparator,
445
- J as CommandPaletteShortcut
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
  };