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