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