@devalok/shilp-sutra 0.52.0 → 0.53.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/MIGRATION.md +6 -0
- package/dist/_chunks/motion-provider.js +7 -6
- package/dist/_chunks/motion-provider.js.map +1 -1
- package/dist/_chunks/success.js +53 -53
- package/dist/ai/command-bar.js +158 -158
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.js +5 -5
- package/dist/composed/command-palette.js +17 -17
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/priority-indicator.d.ts +15 -6
- package/dist/composed/priority-indicator.d.ts.map +1 -1
- package/dist/composed/priority-indicator.js +37 -88
- package/dist/composed/priority-indicator.js.map +1 -1
- package/dist/composed/schedule-view.d.ts +17 -2
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/composed/schedule-view.js +163 -64
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/motion/motion-provider.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.d.ts +32 -6
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +156 -129
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/tokens/primitives.css +6 -2
- package/dist/tokens/utilities.css +6 -0
- package/dist/ui/autocomplete.d.ts +34 -32
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +115 -110
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/combobox.js +4 -4
- package/dist/ui/index.js +30 -30
- package/dist/ui/search-input.js +4 -4
- package/dist/ui/sidebar.js +7 -7
- package/docs/components/composed/priority-indicator.md +22 -11
- package/docs/components/composed/schedule-view.md +20 -5
- package/docs/components/shell/bottom-navbar.md +24 -5
- package/docs/components/ui/autocomplete.md +26 -10
- package/llms.txt +1 -1
- package/mcp-manifest.json +179 -26
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/components.md +1 -1
package/dist/ai/command-bar.js
CHANGED
|
@@ -3,21 +3,21 @@ import { IconProvider as e } from "../ui/icon-context.js";
|
|
|
3
3
|
import { springs as t, tweens as n } from "../ui/lib/motion.js";
|
|
4
4
|
import { cn as r } from "../ui/lib/utils.js";
|
|
5
5
|
import { Icon as i } from "../ui/icon.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { getIsMac as
|
|
11
|
-
import * as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { IconArrowDown as
|
|
14
|
-
import { AnimatePresence as
|
|
6
|
+
import { useMotion as a } from "../_chunks/motion-provider.js";
|
|
7
|
+
import { normalizeIcon as o } from "../_chunks/normalize-icon.js";
|
|
8
|
+
import { Dialog as s, DialogContentRaw as ee, DialogDescription as te, DialogOverlay as ne, DialogPortal as re, DialogTitle as ie } from "../ui/dialog.js";
|
|
9
|
+
import { VisuallyHidden as ae } from "../ui/visually-hidden.js";
|
|
10
|
+
import { getIsMac as oe, getModifierDisplay as se, matchesKeybinding as ce } from "../_chunks/keybinding.js";
|
|
11
|
+
import * as c from "react";
|
|
12
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
import { IconArrowDown as le, IconArrowUp as ue, IconCornerDownLeft as de, IconLoader2 as fe, IconSearch as pe, IconX as me } from "@tabler/icons-react";
|
|
14
|
+
import { AnimatePresence as f, motion as p } from "framer-motion";
|
|
15
15
|
//#region src/ai/command-bar.tsx
|
|
16
|
-
function
|
|
17
|
-
return e ? n ? /* @__PURE__ */
|
|
16
|
+
function he({ active: e, rounded: t, reducedMotion: n, children: i }) {
|
|
17
|
+
return e ? n ? /* @__PURE__ */ u("div", {
|
|
18
18
|
className: r("p-[1.5px] bg-accent-9", t),
|
|
19
19
|
children: i
|
|
20
|
-
}) : /* @__PURE__ */
|
|
20
|
+
}) : /* @__PURE__ */ u(p.div, {
|
|
21
21
|
className: r("relative p-[1.5px]", t),
|
|
22
22
|
style: {
|
|
23
23
|
background: "linear-gradient(var(--gradient-angle, 0deg), #D33163, #9B5DE5, #C850C0, #D33163)",
|
|
@@ -34,32 +34,32 @@ function me({ active: e, rounded: t, reducedMotion: n, children: i }) {
|
|
|
34
34
|
ease: "linear"
|
|
35
35
|
} },
|
|
36
36
|
children: i
|
|
37
|
-
}) : /* @__PURE__ */
|
|
37
|
+
}) : /* @__PURE__ */ u(l, { children: i });
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ge(e) {
|
|
40
40
|
return e.filterValue ? e.filterValue : typeof e.label == "string" ? e.label : "";
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function _e(e) {
|
|
43
43
|
return typeof e.description == "string" ? e.description : "";
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
let [i,
|
|
47
|
-
return
|
|
45
|
+
function ve({ placeholders: e, interval: t, paused: r }) {
|
|
46
|
+
let [i, o] = c.useState(0), { reducedMotion: s } = a();
|
|
47
|
+
return c.useEffect(() => {
|
|
48
48
|
if (r || e.length <= 1) return;
|
|
49
49
|
let n = setInterval(() => {
|
|
50
|
-
|
|
50
|
+
o((t) => (t + 1) % e.length);
|
|
51
51
|
}, t);
|
|
52
52
|
return () => clearInterval(n);
|
|
53
53
|
}, [
|
|
54
54
|
r,
|
|
55
55
|
e.length,
|
|
56
56
|
t
|
|
57
|
-
]),
|
|
57
|
+
]), s ? /* @__PURE__ */ u("span", {
|
|
58
58
|
className: "pointer-events-none absolute text-surface-fg-subtle",
|
|
59
59
|
children: e[i]
|
|
60
|
-
}) : /* @__PURE__ */
|
|
60
|
+
}) : /* @__PURE__ */ u(f, {
|
|
61
61
|
mode: "wait",
|
|
62
|
-
children: /* @__PURE__ */
|
|
62
|
+
children: /* @__PURE__ */ u(p.span, {
|
|
63
63
|
initial: {
|
|
64
64
|
opacity: 0,
|
|
65
65
|
y: -4
|
|
@@ -78,78 +78,78 @@ function _e({ placeholders: e, interval: t, paused: r }) {
|
|
|
78
78
|
}, e[i])
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
var
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
let
|
|
85
|
-
let t = typeof e == "function" ? e(
|
|
86
|
-
|
|
87
|
-
}, [
|
|
81
|
+
var m = c.forwardRef(function({ onSubmit: l, state: m = "idle", groups: h = [], onSearch: ye, emptyMessage: be = "No results found.", emptyState: xe, variant: g = "hero", placeholder: _ = "Ask anything...", placeholderInterval: Se = 5e3, greeting: v, hints: y, agentName: b, agentIcon: Ce, open: x, defaultOpen: we, onOpenChange: S, keybinding: C = "mod+j", disabled: w = !1, maxHeight: T = "320px", children: E, className: D, ...O }, k) {
|
|
82
|
+
let A = x !== void 0, [Te, Ee] = c.useState(we ?? !1), j = A ? x : Te, M = c.useRef(j);
|
|
83
|
+
M.current = j;
|
|
84
|
+
let N = c.useCallback((e) => {
|
|
85
|
+
let t = typeof e == "function" ? e(M.current) : e;
|
|
86
|
+
A || Ee(t), S?.(t);
|
|
87
|
+
}, [A, S]), [P, F] = c.useState(""), [I, L] = c.useState(-1), [De, Oe] = c.useState(""), [R, ke] = c.useState(!1), [z, Ae] = c.useState(!1), B = c.useRef(null), je = c.useRef(null), V = c.useId(), Me = `command-bar-listbox-${V}`, { reducedMotion: H } = a(), U = { duration: 0 }, Ne = c.useMemo(() => oe(), []), W = c.useMemo(() => Array.isArray(_) ? _ : [_], [_]), G = h.length > 0, K = c.useMemo(() => {
|
|
88
88
|
if (!G) return [];
|
|
89
|
-
if (!
|
|
90
|
-
let e =
|
|
91
|
-
return
|
|
89
|
+
if (!P.trim()) return h;
|
|
90
|
+
let e = P.toLowerCase();
|
|
91
|
+
return h.map((t) => ({
|
|
92
92
|
...t,
|
|
93
|
-
items: t.items.filter((t) =>
|
|
93
|
+
items: t.items.filter((t) => ge(t).toLowerCase().includes(e) || _e(t).toLowerCase().includes(e))
|
|
94
94
|
})).filter((e) => e.items.length > 0);
|
|
95
95
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
h,
|
|
97
|
+
P,
|
|
98
98
|
G
|
|
99
|
-
]), q =
|
|
99
|
+
]), q = c.useMemo(() => K.flatMap((e) => e.items), [K]), Pe = c.useMemo(() => {
|
|
100
100
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
101
101
|
for (let n of K) for (let r of n.items) e.set(r.id, t++);
|
|
102
102
|
return e;
|
|
103
|
-
}, [K]), Fe = typeof
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
let e = Array.isArray(
|
|
103
|
+
}, [K]), Fe = typeof T == "number" ? `${T}px` : T;
|
|
104
|
+
c.useEffect(() => {
|
|
105
|
+
if (g !== "floating" || C === !1) return;
|
|
106
|
+
let e = Array.isArray(C) ? C : [C];
|
|
107
107
|
function t(t) {
|
|
108
|
-
for (let n of e) if (
|
|
109
|
-
t.preventDefault(),
|
|
108
|
+
for (let n of e) if (ce(t, n)) {
|
|
109
|
+
t.preventDefault(), N((e) => !e);
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
114
114
|
}, [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
]),
|
|
119
|
-
|
|
115
|
+
g,
|
|
116
|
+
C,
|
|
117
|
+
N
|
|
118
|
+
]), c.useEffect(() => {
|
|
119
|
+
g === "floating" && j && (F(""), L(-1), requestAnimationFrame(() => {
|
|
120
120
|
B.current?.focus();
|
|
121
121
|
}));
|
|
122
|
-
}, [
|
|
123
|
-
|
|
124
|
-
}, [
|
|
122
|
+
}, [g, j]), c.useEffect(() => {
|
|
123
|
+
I < 0 || (je.current?.querySelector(`[data-command-index="${I}"]`))?.scrollIntoView({ block: "nearest" });
|
|
124
|
+
}, [I]);
|
|
125
125
|
let Ie = (e) => {
|
|
126
|
-
|
|
127
|
-
}, Le =
|
|
128
|
-
!
|
|
126
|
+
F(e), L(G && e.trim() ? 0 : -1), ye?.(e);
|
|
127
|
+
}, Le = c.useCallback(() => {
|
|
128
|
+
!P.trim() || w || (Oe(P), l?.(P));
|
|
129
129
|
}, [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
P,
|
|
131
|
+
w,
|
|
132
|
+
l
|
|
133
133
|
]), Re = (e) => {
|
|
134
134
|
switch (e.key) {
|
|
135
135
|
case "ArrowDown":
|
|
136
136
|
if (!G || q.length === 0) return;
|
|
137
|
-
e.preventDefault(),
|
|
137
|
+
e.preventDefault(), L((e) => e < q.length - 1 ? e + 1 : 0);
|
|
138
138
|
break;
|
|
139
139
|
case "ArrowUp":
|
|
140
|
-
G && q.length > 0 ? (e.preventDefault(),
|
|
140
|
+
G && q.length > 0 ? (e.preventDefault(), L((e) => e > 0 ? e - 1 : q.length - 1)) : !G && !P && De && (e.preventDefault(), F(De));
|
|
141
141
|
break;
|
|
142
142
|
case "Enter":
|
|
143
|
-
e.preventDefault(), e.metaKey || e.ctrlKey ? Le() : G &&
|
|
143
|
+
e.preventDefault(), e.metaKey || e.ctrlKey ? Le() : G && I >= 0 && q[I] ? (q[I].onSelect(), g === "floating" && N(!1)) : Le();
|
|
144
144
|
break;
|
|
145
145
|
case "Escape":
|
|
146
|
-
e.preventDefault(),
|
|
146
|
+
e.preventDefault(), m === "responded" ? F("") : g === "floating" ? N(!1) : B.current?.blur();
|
|
147
147
|
break;
|
|
148
148
|
}
|
|
149
149
|
}, ze = () => {
|
|
150
|
-
|
|
150
|
+
F(""), L(-1), B.current?.focus();
|
|
151
151
|
};
|
|
152
|
-
|
|
152
|
+
c.useEffect(() => {
|
|
153
153
|
if (z) {
|
|
154
154
|
let e = setTimeout(() => Ae(!1), 500);
|
|
155
155
|
return () => clearTimeout(e);
|
|
@@ -159,95 +159,95 @@ var h = l.forwardRef(function({ onSubmit: u, state: h = "idle", groups: g = [],
|
|
|
159
159
|
opacity: 1,
|
|
160
160
|
scale: 1,
|
|
161
161
|
y: 0
|
|
162
|
-
} : void 0, X =
|
|
162
|
+
} : void 0, X = g === "inline", Z = m === "processing", Be = m === "responded", Q = () => /* @__PURE__ */ u(he, {
|
|
163
163
|
active: Z,
|
|
164
164
|
rounded: X ? "rounded-control" : "rounded-surface",
|
|
165
165
|
reducedMotion: H,
|
|
166
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ d("div", {
|
|
167
167
|
className: r("flex items-center gap-ds-04 border bg-surface-overlay transition-colors transition-shadow duration-fast-02 ease-productive-standard", X ? "rounded-control px-ds-04" : "rounded-surface px-ds-05", Z ? "border-transparent" : "border-surface-border-strong", R && !Z && "border-accent-7 shadow-ring", z && "animate-shake"),
|
|
168
168
|
children: [
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
icon:
|
|
169
|
+
/* @__PURE__ */ u(i, {
|
|
170
|
+
icon: pe,
|
|
171
171
|
size: X ? "xs" : "sm",
|
|
172
172
|
stroke: "light",
|
|
173
173
|
className: r("shrink-0 transition-colors duration-fast-02 ease-productive-standard", R ? "text-accent-9" : "text-surface-fg-subtle")
|
|
174
174
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ d("div", {
|
|
176
176
|
className: "relative flex flex-1 items-center",
|
|
177
|
-
children: [!
|
|
177
|
+
children: [!P && !R && W.length > 1 && /* @__PURE__ */ u(ve, {
|
|
178
178
|
placeholders: W,
|
|
179
|
-
interval:
|
|
180
|
-
paused: R || !!
|
|
181
|
-
}), /* @__PURE__ */
|
|
179
|
+
interval: Se,
|
|
180
|
+
paused: R || !!P
|
|
181
|
+
}), /* @__PURE__ */ u("input", {
|
|
182
182
|
ref: B,
|
|
183
|
-
value:
|
|
183
|
+
value: P,
|
|
184
184
|
onChange: (e) => Ie(e.target.value),
|
|
185
185
|
onFocus: () => ke(!0),
|
|
186
186
|
onBlur: () => ke(!1),
|
|
187
187
|
onKeyDown: Re,
|
|
188
188
|
placeholder: W.length === 1 || R ? W[0] : "",
|
|
189
189
|
readOnly: Z,
|
|
190
|
-
disabled:
|
|
190
|
+
disabled: w,
|
|
191
191
|
role: "combobox",
|
|
192
192
|
"aria-expanded": G && q.length > 0,
|
|
193
193
|
"aria-controls": G ? Me : void 0,
|
|
194
|
-
"aria-activedescendant": G &&
|
|
194
|
+
"aria-activedescendant": G && I >= 0 && q[I] ? `command-bar-item-${V}-${q[I].id}` : void 0,
|
|
195
195
|
"aria-autocomplete": G ? "list" : void 0,
|
|
196
|
-
"aria-label":
|
|
197
|
-
className: r("flex-1 bg-transparent text-surface-fg outline-hidden", "placeholder:text-surface-fg-subtle", X ? "h-9 text-body-sm" : "h-12 text-body-lg", Z && "cursor-wait",
|
|
196
|
+
"aria-label": b ? `Ask ${b}` : "AI Command Bar",
|
|
197
|
+
className: r("flex-1 bg-transparent text-surface-fg outline-hidden", "placeholder:text-surface-fg-subtle", X ? "h-9 text-body-sm" : "h-12 text-body-lg", Z && "cursor-wait", w && "cursor-not-allowed opacity-50"),
|
|
198
198
|
autoComplete: "off",
|
|
199
199
|
autoCorrect: "off",
|
|
200
200
|
spellCheck: !1
|
|
201
201
|
})]
|
|
202
202
|
}),
|
|
203
|
-
Z ? /* @__PURE__ */
|
|
203
|
+
Z ? /* @__PURE__ */ u("span", {
|
|
204
204
|
"data-testid": "command-bar-spinner",
|
|
205
205
|
className: "shrink-0",
|
|
206
|
-
children: /* @__PURE__ */
|
|
207
|
-
icon:
|
|
206
|
+
children: /* @__PURE__ */ u(i, {
|
|
207
|
+
icon: fe,
|
|
208
208
|
size: X ? "xs" : "sm",
|
|
209
209
|
stroke: "light",
|
|
210
210
|
animate: "spin",
|
|
211
211
|
className: "text-accent-9"
|
|
212
212
|
})
|
|
213
|
-
}) : Be ? /* @__PURE__ */
|
|
213
|
+
}) : Be ? /* @__PURE__ */ u("button", {
|
|
214
214
|
type: "button",
|
|
215
215
|
onClick: ze,
|
|
216
216
|
className: "shrink-0 rounded-control-inner p-ds-01 text-surface-fg-subtle transition-colors duration-fast-01 hover:bg-surface-raised-hover hover:text-surface-fg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9",
|
|
217
217
|
"aria-label": "Clear",
|
|
218
218
|
title: "Clear",
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
-
icon:
|
|
219
|
+
children: /* @__PURE__ */ u(i, {
|
|
220
|
+
icon: me,
|
|
221
221
|
size: X ? "xs" : "sm",
|
|
222
222
|
stroke: "light"
|
|
223
223
|
})
|
|
224
|
-
}) :
|
|
224
|
+
}) : g === "hero" ? /* @__PURE__ */ u(f, { children: !R && /* @__PURE__ */ d(p.kbd, {
|
|
225
225
|
initial: Y ?? { opacity: 0 },
|
|
226
226
|
animate: { opacity: 1 },
|
|
227
227
|
exit: H ? void 0 : { opacity: 0 },
|
|
228
228
|
transition: J,
|
|
229
229
|
className: "hidden shrink-0 select-none rounded-control border border-card-strong bg-surface-raised px-ds-02b py-ds-01 text-body-sm font-medium text-surface-fg-subtle shadow-kbd sm:inline-flex",
|
|
230
|
-
children: [
|
|
230
|
+
children: [se(Ne), "J"]
|
|
231
231
|
}) }) : null
|
|
232
232
|
]
|
|
233
233
|
})
|
|
234
|
-
}), $ = () => !G || !(q.length > 0 ||
|
|
234
|
+
}), $ = () => !G || !(q.length > 0 || P.trim() && K.length === 0) && !P.trim() ? null : /* @__PURE__ */ d("div", {
|
|
235
235
|
ref: je,
|
|
236
236
|
id: Me,
|
|
237
237
|
role: "listbox",
|
|
238
238
|
"aria-label": "Command results",
|
|
239
239
|
className: "overflow-y-auto px-ds-03 py-ds-03",
|
|
240
240
|
style: { maxHeight: Fe },
|
|
241
|
-
children: [K.length === 0 &&
|
|
241
|
+
children: [K.length === 0 && P.trim() && /* @__PURE__ */ u(p.div, {
|
|
242
242
|
initial: Y ?? { opacity: 0 },
|
|
243
243
|
animate: { opacity: 1 },
|
|
244
244
|
transition: J,
|
|
245
245
|
className: "flex items-center justify-center py-ds-07",
|
|
246
|
-
children:
|
|
246
|
+
children: xe ?? /* @__PURE__ */ u("p", {
|
|
247
247
|
className: "text-body-md text-surface-fg-subtle",
|
|
248
|
-
children:
|
|
248
|
+
children: be
|
|
249
249
|
})
|
|
250
|
-
}), K.map((
|
|
250
|
+
}), K.map((a, s) => /* @__PURE__ */ d(p.div, {
|
|
251
251
|
initial: Y ?? { opacity: 0 },
|
|
252
252
|
animate: { opacity: 1 },
|
|
253
253
|
transition: H ? U : {
|
|
@@ -255,20 +255,20 @@ var h = l.forwardRef(function({ onSubmit: u, state: h = "idle", groups: g = [],
|
|
|
255
255
|
delay: s * .06
|
|
256
256
|
},
|
|
257
257
|
className: "mb-ds-02",
|
|
258
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ u("div", {
|
|
259
259
|
className: "px-ds-03 pb-ds-02 pt-ds-03",
|
|
260
|
-
children: /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ u("span", {
|
|
261
261
|
className: "text-label-xs font-semibold uppercase tracking-wider text-surface-fg-subtle",
|
|
262
|
-
children:
|
|
262
|
+
children: a.label
|
|
263
263
|
})
|
|
264
|
-
}),
|
|
265
|
-
let
|
|
266
|
-
return /* @__PURE__ */
|
|
264
|
+
}), a.items.map((n) => {
|
|
265
|
+
let a = Pe.get(n.id) ?? 0, s = a === I;
|
|
266
|
+
return /* @__PURE__ */ d(p.button, {
|
|
267
267
|
id: `command-bar-item-${V}-${n.id}`,
|
|
268
268
|
type: "button",
|
|
269
269
|
role: "option",
|
|
270
270
|
"aria-selected": s,
|
|
271
|
-
"data-command-index":
|
|
271
|
+
"data-command-index": a,
|
|
272
272
|
initial: Y ?? {
|
|
273
273
|
opacity: 0,
|
|
274
274
|
y: 4
|
|
@@ -279,40 +279,40 @@ var h = l.forwardRef(function({ onSubmit: u, state: h = "idle", groups: g = [],
|
|
|
279
279
|
},
|
|
280
280
|
transition: H ? U : {
|
|
281
281
|
...t.snappy,
|
|
282
|
-
delay:
|
|
282
|
+
delay: a * .03
|
|
283
283
|
},
|
|
284
284
|
onClick: () => {
|
|
285
|
-
n.onSelect(),
|
|
285
|
+
n.onSelect(), g === "floating" && N(!1);
|
|
286
286
|
},
|
|
287
|
-
onMouseEnter: () =>
|
|
287
|
+
onMouseEnter: () => L(a),
|
|
288
288
|
className: r("flex w-full items-center gap-ds-04 rounded-surface px-ds-03 py-ds-03 text-left transition-[color,background-color] duration-fast-02 ease-productive-standard", s ? "bg-surface-raised-hover text-surface-fg" : "text-surface-fg-muted hover:bg-surface-raised"),
|
|
289
289
|
children: [
|
|
290
|
-
n.icon && /* @__PURE__ */
|
|
290
|
+
n.icon && /* @__PURE__ */ u("span", {
|
|
291
291
|
className: r("[&>svg]:h-ico-sm [&>svg]:w-ico-sm shrink-0 transition-colors duration-fast-02 ease-productive-standard", s ? "text-accent-11" : "text-surface-fg-subtle"),
|
|
292
292
|
"aria-hidden": "true",
|
|
293
|
-
children: /* @__PURE__ */
|
|
293
|
+
children: /* @__PURE__ */ u(e, {
|
|
294
294
|
size: "sm",
|
|
295
|
-
children:
|
|
295
|
+
children: o(n.icon)
|
|
296
296
|
})
|
|
297
297
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ d("div", {
|
|
299
299
|
className: "flex flex-1 flex-col",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ u("span", {
|
|
301
301
|
className: "text-body-md",
|
|
302
|
-
children: n.renderLabel ? n.renderLabel(
|
|
303
|
-
}), n.description && /* @__PURE__ */
|
|
302
|
+
children: n.renderLabel ? n.renderLabel(P) : n.label
|
|
303
|
+
}), n.description && /* @__PURE__ */ u("span", {
|
|
304
304
|
className: "text-body-sm text-surface-fg-subtle",
|
|
305
305
|
children: n.description
|
|
306
306
|
})]
|
|
307
307
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ u(f, { children: s && /* @__PURE__ */ u(p.span, {
|
|
309
309
|
initial: H ? void 0 : { opacity: 0 },
|
|
310
310
|
animate: { opacity: 1 },
|
|
311
311
|
exit: H ? void 0 : { opacity: 0 },
|
|
312
312
|
transition: J,
|
|
313
313
|
className: "inline-flex shrink-0",
|
|
314
|
-
children: /* @__PURE__ */
|
|
315
|
-
icon:
|
|
314
|
+
children: /* @__PURE__ */ u(i, {
|
|
315
|
+
icon: de,
|
|
316
316
|
size: "sm",
|
|
317
317
|
stroke: "light",
|
|
318
318
|
className: "text-surface-fg-subtle"
|
|
@@ -321,119 +321,119 @@ var h = l.forwardRef(function({ onSubmit: u, state: h = "idle", groups: g = [],
|
|
|
321
321
|
]
|
|
322
322
|
}, n.id);
|
|
323
323
|
})]
|
|
324
|
-
},
|
|
324
|
+
}, a.label))]
|
|
325
325
|
});
|
|
326
|
-
return
|
|
327
|
-
ref:
|
|
326
|
+
return g === "hero" ? /* @__PURE__ */ d("div", {
|
|
327
|
+
ref: k,
|
|
328
328
|
role: "search",
|
|
329
|
-
className: r("bg-surface-raised rounded-overlay-lg shadow-raised p-ds-07",
|
|
330
|
-
...
|
|
329
|
+
className: r("bg-surface-raised rounded-overlay-lg shadow-raised p-ds-07", D),
|
|
330
|
+
...O,
|
|
331
331
|
children: [
|
|
332
|
-
|
|
332
|
+
v && /* @__PURE__ */ u("p", {
|
|
333
333
|
className: "text-heading-xs text-surface-fg-muted mb-ds-04",
|
|
334
|
-
children:
|
|
334
|
+
children: v
|
|
335
335
|
}),
|
|
336
336
|
Q(),
|
|
337
337
|
$(),
|
|
338
|
-
|
|
338
|
+
y && y.length > 0 && /* @__PURE__ */ u("div", {
|
|
339
339
|
className: "mt-ds-04 flex flex-wrap gap-ds-02b",
|
|
340
|
-
children:
|
|
340
|
+
children: y.map((e) => /* @__PURE__ */ u("button", {
|
|
341
341
|
type: "button",
|
|
342
342
|
onClick: () => {
|
|
343
|
-
|
|
343
|
+
F(e), ye?.(e), B.current?.focus();
|
|
344
344
|
},
|
|
345
345
|
className: "rounded-control border border-card-strong bg-surface-overlay px-ds-03 py-ds-01 text-body-sm text-surface-fg-subtle transition-colors duration-fast-02 ease-productive-standard hover:bg-surface-raised-hover hover:text-surface-fg-muted",
|
|
346
346
|
children: e
|
|
347
347
|
}, e))
|
|
348
348
|
}),
|
|
349
|
-
|
|
349
|
+
E && /* @__PURE__ */ u("div", {
|
|
350
350
|
className: "mt-ds-05",
|
|
351
|
-
children:
|
|
351
|
+
children: E
|
|
352
352
|
})
|
|
353
353
|
]
|
|
354
|
-
}) :
|
|
355
|
-
ref:
|
|
354
|
+
}) : g === "inline" ? /* @__PURE__ */ d("div", {
|
|
355
|
+
ref: k,
|
|
356
356
|
role: "search",
|
|
357
|
-
className: r("w-full",
|
|
358
|
-
...
|
|
357
|
+
className: r("w-full", D),
|
|
358
|
+
...O,
|
|
359
359
|
children: [
|
|
360
360
|
Q(),
|
|
361
361
|
$(),
|
|
362
|
-
|
|
362
|
+
E && /* @__PURE__ */ u("div", {
|
|
363
363
|
className: "mt-ds-03",
|
|
364
|
-
children:
|
|
364
|
+
children: E
|
|
365
365
|
})
|
|
366
366
|
]
|
|
367
|
-
}) : /* @__PURE__ */
|
|
368
|
-
open:
|
|
367
|
+
}) : /* @__PURE__ */ u(s, {
|
|
368
|
+
open: j,
|
|
369
369
|
onOpenChange: (e) => {
|
|
370
|
-
|
|
370
|
+
N(e);
|
|
371
371
|
},
|
|
372
|
-
children: /* @__PURE__ */
|
|
373
|
-
ref:
|
|
374
|
-
...
|
|
375
|
-
className: r("fixed left-1/2 top-[20%] z-modal w-full max-w-[560px] -translate-x-1/2", "overflow-hidden rounded-overlay-lg bg-surface-overlay shadow-overlay", "duration-moderate-02 data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2", "data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2",
|
|
372
|
+
children: /* @__PURE__ */ d(re, { children: [/* @__PURE__ */ u(ne, { className: "fixed inset-0 z-overlay bg-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }), /* @__PURE__ */ d(ee, {
|
|
373
|
+
ref: k,
|
|
374
|
+
...O,
|
|
375
|
+
className: r("fixed left-1/2 top-[20%] z-modal w-full max-w-[560px] -translate-x-1/2", "overflow-hidden rounded-overlay-lg bg-surface-overlay shadow-overlay", "duration-moderate-02 data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2", "data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2", D),
|
|
376
376
|
children: [
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ d(ae, { children: [/* @__PURE__ */ u(ie, { children: "AI Command Bar" }), /* @__PURE__ */ u(te, { children: "Search commands or ask a question" })] }),
|
|
378
|
+
/* @__PURE__ */ u("div", {
|
|
379
379
|
className: "p-ds-04",
|
|
380
380
|
children: Q()
|
|
381
381
|
}),
|
|
382
382
|
$(),
|
|
383
|
-
|
|
383
|
+
E && /* @__PURE__ */ u("div", {
|
|
384
384
|
className: "border-t border-surface-border-strong p-ds-04",
|
|
385
|
-
children:
|
|
385
|
+
children: E
|
|
386
386
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ d(p.div, {
|
|
388
388
|
initial: Y ?? { opacity: 0 },
|
|
389
389
|
animate: { opacity: 1 },
|
|
390
390
|
transition: J,
|
|
391
391
|
className: "flex items-center gap-ds-05 border-t border-surface-border-strong px-ds-05 py-ds-03",
|
|
392
392
|
children: [
|
|
393
|
-
G && /* @__PURE__ */
|
|
393
|
+
G && /* @__PURE__ */ d("div", {
|
|
394
394
|
className: "flex items-center gap-ds-02b",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ d("div", {
|
|
396
396
|
className: "flex items-center gap-ds-01",
|
|
397
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ u("kbd", {
|
|
398
398
|
className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-card-strong bg-surface-raised shadow-kbd",
|
|
399
|
-
children: /* @__PURE__ */
|
|
400
|
-
icon:
|
|
399
|
+
children: /* @__PURE__ */ u(i, {
|
|
400
|
+
icon: ue,
|
|
401
401
|
size: "xs",
|
|
402
402
|
className: "text-surface-fg-subtle"
|
|
403
403
|
})
|
|
404
|
-
}), /* @__PURE__ */
|
|
404
|
+
}), /* @__PURE__ */ u("kbd", {
|
|
405
405
|
className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-card-strong bg-surface-raised shadow-kbd",
|
|
406
|
-
children: /* @__PURE__ */
|
|
407
|
-
icon:
|
|
406
|
+
children: /* @__PURE__ */ u(i, {
|
|
407
|
+
icon: le,
|
|
408
408
|
size: "xs",
|
|
409
409
|
className: "text-surface-fg-subtle"
|
|
410
410
|
})
|
|
411
411
|
})]
|
|
412
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ u("span", {
|
|
413
413
|
className: "text-caption text-surface-fg-subtle",
|
|
414
414
|
children: "Navigate"
|
|
415
415
|
})]
|
|
416
416
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ d("div", {
|
|
418
418
|
className: "flex items-center gap-ds-02b",
|
|
419
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ u("kbd", {
|
|
420
420
|
className: "inline-flex h-[20px] items-center justify-center rounded-control border border-card-strong bg-surface-raised px-ds-02b shadow-kbd",
|
|
421
|
-
children: /* @__PURE__ */
|
|
422
|
-
icon:
|
|
421
|
+
children: /* @__PURE__ */ u(i, {
|
|
422
|
+
icon: de,
|
|
423
423
|
size: "xs",
|
|
424
424
|
className: "text-surface-fg-subtle"
|
|
425
425
|
})
|
|
426
|
-
}), /* @__PURE__ */
|
|
426
|
+
}), /* @__PURE__ */ u("span", {
|
|
427
427
|
className: "text-caption text-surface-fg-subtle",
|
|
428
428
|
children: "Submit"
|
|
429
429
|
})]
|
|
430
430
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ d("div", {
|
|
432
432
|
className: "flex items-center gap-ds-02b",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
433
|
+
children: [/* @__PURE__ */ u("kbd", {
|
|
434
434
|
className: "inline-flex h-[20px] items-center justify-center rounded-control border border-card-strong bg-surface-raised px-ds-02b text-caption font-medium text-surface-fg-subtle shadow-kbd",
|
|
435
435
|
children: "Esc"
|
|
436
|
-
}), /* @__PURE__ */
|
|
436
|
+
}), /* @__PURE__ */ u("span", {
|
|
437
437
|
className: "text-caption text-surface-fg-subtle",
|
|
438
438
|
children: "Close"
|
|
439
439
|
})]
|
|
@@ -444,6 +444,6 @@ var h = l.forwardRef(function({ onSubmit: u, state: h = "idle", groups: g = [],
|
|
|
444
444
|
})] })
|
|
445
445
|
});
|
|
446
446
|
});
|
|
447
|
-
|
|
447
|
+
m.displayName = "CommandBar";
|
|
448
448
|
//#endregion
|
|
449
|
-
export {
|
|
449
|
+
export { m as CommandBar };
|