@arcadeai/design-system 2.1.1 → 2.3.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/index.js +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/components/ui/molecules/index.js +1 -1
- package/dist/components/ui/molecules/requirement-badges.js +1 -1
- package/dist/components/ui/molecules/tool-card.js +24 -24
- package/dist/components/ui/molecules/toolkit-card.js +1 -1
- package/dist/components/ui/molecules/toolkit-selection-summary.js +1 -1
- package/dist/components/ui/organisms/toolkit-picker/components/action-buttons.d.ts +6 -0
- package/dist/components/ui/organisms/toolkit-picker/components/action-buttons.js +54 -0
- package/dist/components/ui/organisms/toolkit-picker/components/filter-badges.d.ts +1 -0
- package/dist/components/ui/organisms/toolkit-picker/components/filter-badges.js +92 -0
- package/dist/components/ui/organisms/toolkit-picker/components/search-input.js +52 -18
- package/dist/components/ui/organisms/toolkit-picker/components/select-button.js +1 -1
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-card-with-selection.js +1 -1
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-list.d.ts +6 -0
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-list.js +90 -0
- package/dist/components/ui/organisms/toolkit-picker/components/tools-list.d.ts +6 -0
- package/dist/components/ui/organisms/toolkit-picker/components/tools-list.js +97 -0
- package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.js +105 -302
- package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.test.js +642 -622
- package/dist/main.js +1 -1
- package/dist/{toolkit-card-DgjPGtsJ.js → toolkit-card-BWuG_NJi.js} +27 -27
- package/package.json +1 -1
|
@@ -1,71 +1,64 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { X as
|
|
3
|
-
import {
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Dialog as
|
|
6
|
-
import { Arcade as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import "
|
|
18
|
-
|
|
19
|
-
import { FooterSummary as te } from "./components/footer-summary.js";
|
|
20
|
-
import { SearchInput as ae } from "./components/search-input.js";
|
|
21
|
-
import { SelectButton as le } from "./components/select-button.js";
|
|
22
|
-
import { ToolkitCardWithSelection as re } from "./components/toolkit-card-with-selection.js";
|
|
23
|
-
const Se = (T) => {
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { X as T, Package as _, Wrench as C } from "lucide-react";
|
|
3
|
+
import { useState as z } from "react";
|
|
4
|
+
import { Button as n } from "../../atoms/button.js";
|
|
5
|
+
import { Dialog as D, DialogTrigger as S, DialogContent as j, DialogHeader as A, DialogTitle as B, DialogDescription as M, DialogClose as d, DialogFooter as P } from "../../atoms/dialog.js";
|
|
6
|
+
import { Arcade as F } from "../../atoms/icons/arcade.js";
|
|
7
|
+
import { MobileTooltipProvider as L } from "../../atoms/mobile-tooltip.js";
|
|
8
|
+
import { Tabs as E, TabsList as X, TabsTrigger as m, TabsContent as c } from "../../atoms/tabs.js";
|
|
9
|
+
import { Tooltip as G, TooltipTrigger as H, TooltipContent as I } from "../../atoms/tooltip.js";
|
|
10
|
+
import { ActionButtons as O } from "./components/action-buttons.js";
|
|
11
|
+
import { FilterBadges as Q } from "./components/filter-badges.js";
|
|
12
|
+
import { FooterSummary as R } from "./components/footer-summary.js";
|
|
13
|
+
import { SearchInput as V } from "./components/search-input.js";
|
|
14
|
+
import { SelectButton as W } from "./components/select-button.js";
|
|
15
|
+
import { ToolkitList as Y } from "./components/toolkit-list.js";
|
|
16
|
+
import { ToolsList as $ } from "./components/tools-list.js";
|
|
17
|
+
import { useToolkitPicker as q } from "./hooks/use-toolkit-picker.js";
|
|
18
|
+
const J = /Mac/i, xe = (p) => {
|
|
24
19
|
const {
|
|
25
|
-
description:
|
|
26
|
-
children:
|
|
27
|
-
selectionMode:
|
|
28
|
-
onSelectionChange:
|
|
29
|
-
} =
|
|
20
|
+
description: h = "Select toolkits and tools",
|
|
21
|
+
children: x,
|
|
22
|
+
selectionMode: a = "multi",
|
|
23
|
+
onSelectionChange: s
|
|
24
|
+
} = p, [g, r] = z(!1), {
|
|
30
25
|
state: {
|
|
31
|
-
selectedToolkits:
|
|
26
|
+
selectedToolkits: u,
|
|
32
27
|
selectedTools: i,
|
|
33
|
-
activeTab:
|
|
34
|
-
filteredToolkits:
|
|
35
|
-
filteredTools:
|
|
36
|
-
toolkitFilter: c,
|
|
37
|
-
searchQuery: f
|
|
28
|
+
activeTab: f,
|
|
29
|
+
filteredToolkits: b,
|
|
30
|
+
filteredTools: k
|
|
38
31
|
},
|
|
39
|
-
setActiveTab:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
W,
|
|
32
|
+
setActiveTab: o,
|
|
33
|
+
clearSearchQuery: v,
|
|
34
|
+
commitSelections: N,
|
|
35
|
+
restoreCommittedState: w
|
|
36
|
+
} = q(), y = () => {
|
|
37
|
+
N(), s && s({
|
|
38
|
+
selectedToolkits: Array.from(u.keys()),
|
|
39
|
+
selectedTools: Array.from(i.keys())
|
|
40
|
+
}), r(!1);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ e(L, { children: /* @__PURE__ */ t(
|
|
43
|
+
D,
|
|
52
44
|
{
|
|
53
|
-
onOpenChange: (
|
|
54
|
-
|
|
45
|
+
onOpenChange: (l) => {
|
|
46
|
+
r(l), l && (w(), v(), o("toolkits"));
|
|
55
47
|
},
|
|
48
|
+
open: g,
|
|
56
49
|
children: [
|
|
57
|
-
/* @__PURE__ */ e(
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
50
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: x }),
|
|
51
|
+
/* @__PURE__ */ t(
|
|
52
|
+
j,
|
|
60
53
|
{
|
|
61
54
|
className: "flex max-h-[80vh] min-h-80 w-[95vw] max-w-xl flex-col gap-2 p-0 sm:max-w-2xl md:max-w-3xl lg:max-w-4xl xl:max-w-5xl 2xl:max-w-7xl",
|
|
62
55
|
"data-testid": "toolkit-picker-dialog",
|
|
63
56
|
showCloseButton: !1,
|
|
64
57
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ t(A, { className: "shrink-0 p-4 pb-0 sm:p-6 sm:pb-0", children: [
|
|
59
|
+
/* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
|
|
60
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
|
|
61
|
+
/* @__PURE__ */ t("div", { className: "relative flex size-10 items-center justify-center overflow-hidden rounded-xl shadow-lg ring-1 ring-black/5 sm:size-12", children: [
|
|
69
62
|
/* @__PURE__ */ e(
|
|
70
63
|
"span",
|
|
71
64
|
{
|
|
@@ -80,283 +73,97 @@ const Se = (T) => {
|
|
|
80
73
|
className: "pointer-events-none absolute inset-0 z-10 bg-[repeating-conic-gradient(from_0deg_at_100%_0%,rgba(0,0,0,0.25)_0deg_1deg,transparent_1deg_12deg)] opacity-30"
|
|
81
74
|
}
|
|
82
75
|
),
|
|
83
|
-
/* @__PURE__ */ e("span", { className: "relative z-20", children: /* @__PURE__ */ e(
|
|
76
|
+
/* @__PURE__ */ e("span", { className: "relative z-20", children: /* @__PURE__ */ e(F, { className: "size-5 sm:size-7" }) })
|
|
84
77
|
] }),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
/* @__PURE__ */ e(
|
|
78
|
+
/* @__PURE__ */ t("div", { className: "ml-1 text-left", children: [
|
|
79
|
+
/* @__PURE__ */ e(B, { className: "font-bold text-lg sm:text-xl", children: "Choose Your Tools" }),
|
|
80
|
+
/* @__PURE__ */ e(M, { className: "hidden sm:block", children: h })
|
|
88
81
|
] })
|
|
89
82
|
] }),
|
|
90
|
-
/* @__PURE__ */ e(
|
|
91
|
-
|
|
83
|
+
/* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(
|
|
84
|
+
n,
|
|
92
85
|
{
|
|
93
86
|
className: "h-8 w-8 rounded-full p-0",
|
|
94
87
|
"data-testid": "toolkit-picker-close",
|
|
95
88
|
size: "sm",
|
|
96
89
|
variant: "ghost",
|
|
97
|
-
children: /* @__PURE__ */ e(
|
|
90
|
+
children: /* @__PURE__ */ e(T, { className: "h-4 w-4" })
|
|
98
91
|
}
|
|
99
92
|
) })
|
|
100
93
|
] }),
|
|
101
|
-
/* @__PURE__ */ e("div", { className: "mb-2 space-y-2 pt-2 sm:space-y-4 sm:pt-4", children: /* @__PURE__ */ e(
|
|
94
|
+
/* @__PURE__ */ e("div", { className: "mb-2 space-y-2 pt-2 sm:space-y-4 sm:pt-4", children: /* @__PURE__ */ e(V, {}) })
|
|
102
95
|
] }),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
96
|
+
/* @__PURE__ */ t(
|
|
97
|
+
E,
|
|
105
98
|
{
|
|
106
|
-
className: "flex min-h-0 flex-1 flex-col",
|
|
107
|
-
onValueChange: (
|
|
108
|
-
value:
|
|
99
|
+
className: "flex min-h-0 flex-1 flex-col gap-0.5",
|
|
100
|
+
onValueChange: (l) => o(l),
|
|
101
|
+
value: f,
|
|
109
102
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
103
|
+
/* @__PURE__ */ t("div", { className: "shrink-0 space-y-2 px-4 sm:space-y-3 sm:px-6", children: [
|
|
104
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
105
|
+
/* @__PURE__ */ t(X, { className: "h-10 w-auto gap-1 rounded-md border border-neutral-200 bg-white/60 p-1 shadow-sm dark:border-neutral-800 dark:bg-neutral-900/60", children: [
|
|
106
|
+
/* @__PURE__ */ t(
|
|
107
|
+
m,
|
|
115
108
|
{
|
|
116
109
|
className: "h-8 rounded-md px-3 font-medium text-neutral-600 text-sm hover:bg-black/5 data-[state=active]:bg-white data-[state=active]:text-neutral-900 dark:text-neutral-300 dark:data-[state=active]:bg-neutral-800 dark:data-[state=active]:text-white dark:hover:bg-white/10",
|
|
117
110
|
"data-testid": "toolkits-tab",
|
|
118
111
|
value: "toolkits",
|
|
119
112
|
children: [
|
|
120
|
-
/* @__PURE__ */ e(
|
|
113
|
+
/* @__PURE__ */ e(_, { className: "h-4 w-4" }),
|
|
121
114
|
/* @__PURE__ */ e("span", { children: "Toolkits" }),
|
|
122
|
-
/* @__PURE__ */ e("span", { className: "ml-1 rounded-full bg-emerald-300 px-1.5 py-0.5 text-emerald-900 text-xs dark:bg-emerald-500/25 dark:text-emerald-200", children:
|
|
115
|
+
/* @__PURE__ */ e("span", { className: "ml-1 rounded-full bg-emerald-300 px-1.5 py-0.5 text-emerald-900 text-xs dark:bg-emerald-500/25 dark:text-emerald-200", children: b.size })
|
|
123
116
|
]
|
|
124
117
|
}
|
|
125
118
|
),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
119
|
+
/* @__PURE__ */ t(
|
|
120
|
+
m,
|
|
128
121
|
{
|
|
129
122
|
className: "h-8 rounded-md px-3 font-medium text-neutral-600 text-sm hover:bg-black/5 data-[state=active]:bg-white data-[state=active]:text-neutral-900 dark:text-neutral-300 dark:data-[state=active]:bg-neutral-800 dark:data-[state=active]:text-white dark:hover:bg-white/10",
|
|
130
123
|
"data-testid": "tools-tab",
|
|
131
124
|
value: "tools",
|
|
132
125
|
children: [
|
|
133
|
-
/* @__PURE__ */ e(
|
|
126
|
+
/* @__PURE__ */ e(C, { className: "h-4 w-4" }),
|
|
134
127
|
/* @__PURE__ */ e("span", { children: "Tools" }),
|
|
135
|
-
/* @__PURE__ */ e("span", { className: "ml-1 rounded-full bg-emerald-300 px-1.5 py-0.5 text-emerald-900 text-xs dark:bg-emerald-500/25 dark:text-emerald-200", children:
|
|
128
|
+
/* @__PURE__ */ e("span", { className: "ml-1 rounded-full bg-emerald-300 px-1.5 py-0.5 text-emerald-900 text-xs dark:bg-emerald-500/25 dark:text-emerald-200", children: k.size })
|
|
136
129
|
]
|
|
137
130
|
}
|
|
138
131
|
)
|
|
139
132
|
] }),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
(g.size > 0 || i.size > 0) && /* @__PURE__ */ a(
|
|
142
|
-
p,
|
|
143
|
-
{
|
|
144
|
-
className: "h-8 border-neutral-300 text-neutral-700 hover:bg-neutral-50 hover:text-neutral-900 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-900/40 dark:hover:text-neutral-100",
|
|
145
|
-
"data-testid": "clear-selections",
|
|
146
|
-
onClick: A,
|
|
147
|
-
size: "sm",
|
|
148
|
-
variant: "outline",
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ e(m, { className: "h-4 w-4 text-red-600 dark:text-red-400" }),
|
|
151
|
-
"Clear All"
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
),
|
|
155
|
-
r === "multi" && (() => {
|
|
156
|
-
const t = x === "toolkits" ? Array.from(s).flatMap(
|
|
157
|
-
(l) => l.tools.map((h) => h.fully_qualified_name)
|
|
158
|
-
) : Array.from(n).map(
|
|
159
|
-
(l) => l.fully_qualified_name
|
|
160
|
-
);
|
|
161
|
-
return t.length > 0 && t.every((l) => i.has(l)) ? null : /* @__PURE__ */ a(
|
|
162
|
-
p,
|
|
163
|
-
{
|
|
164
|
-
className: "h-8",
|
|
165
|
-
"data-testid": "select-all",
|
|
166
|
-
onClick: () => {
|
|
167
|
-
j(t);
|
|
168
|
-
},
|
|
169
|
-
size: "sm",
|
|
170
|
-
variant: "outline",
|
|
171
|
-
children: [
|
|
172
|
-
/* @__PURE__ */ e(V, { className: "h-4 w-4" }),
|
|
173
|
-
"Select all"
|
|
174
|
-
]
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
})()
|
|
178
|
-
] })
|
|
133
|
+
/* @__PURE__ */ e(O, { selectionMode: a })
|
|
179
134
|
] }),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
c && /* @__PURE__ */ a(
|
|
182
|
-
v,
|
|
183
|
-
{
|
|
184
|
-
className: "h-8 border border-purple-200 bg-purple-50 pr-1.5 pl-2 text-purple-800 shadow-sm ring-1 ring-purple-200/50 dark:border-purple-800/60 dark:bg-purple-950/40 dark:text-purple-200 dark:ring-purple-800/30",
|
|
185
|
-
variant: "secondary",
|
|
186
|
-
children: [
|
|
187
|
-
/* @__PURE__ */ a("span", { className: "mr-1.5 inline-flex items-center gap-1 rounded-full bg-purple-100 px-1.5 py-0.5 text-[10px] text-purple-700 dark:bg-purple-800/60 dark:text-purple-200", children: [
|
|
188
|
-
/* @__PURE__ */ e(M, { className: "h-3 w-3" }),
|
|
189
|
-
"Filter"
|
|
190
|
-
] }),
|
|
191
|
-
/* @__PURE__ */ a(
|
|
192
|
-
"button",
|
|
193
|
-
{
|
|
194
|
-
className: "inline-flex h-full items-center gap-1.5",
|
|
195
|
-
"data-testid": "filter-badge",
|
|
196
|
-
onClick: () => d("toolkits"),
|
|
197
|
-
type: "button",
|
|
198
|
-
children: [
|
|
199
|
-
(() => {
|
|
200
|
-
const t = Array.from(
|
|
201
|
-
s
|
|
202
|
-
).find((l) => l.name === c), o = G({
|
|
203
|
-
metadataIcon: t?.metadata?.icon,
|
|
204
|
-
toolkitName: c
|
|
205
|
-
});
|
|
206
|
-
return /* @__PURE__ */ e(o, { className: "h-3.5 w-3.5" });
|
|
207
|
-
})(),
|
|
208
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-xs", children: c })
|
|
209
|
-
]
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
/* @__PURE__ */ e(
|
|
213
|
-
"button",
|
|
214
|
-
{
|
|
215
|
-
"aria-label": "Clear toolkit filter",
|
|
216
|
-
className: "ml-1 inline-flex h-5 w-5 items-center justify-center rounded-full bg-purple-100 text-red-600 hover:bg-red-100 hover:text-red-700 focus-visible:ring-[3px] focus-visible:ring-red-200 dark:bg-purple-800/60 dark:text-red-400 dark:hover:bg-red-950/40 dark:hover:text-red-300",
|
|
217
|
-
"data-testid": "clear-filter",
|
|
218
|
-
onClick: D,
|
|
219
|
-
type: "button",
|
|
220
|
-
children: /* @__PURE__ */ e(m, { className: "h-3.5 w-3.5" })
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
]
|
|
224
|
-
}
|
|
225
|
-
),
|
|
226
|
-
f && /* @__PURE__ */ a(
|
|
227
|
-
v,
|
|
228
|
-
{
|
|
229
|
-
className: "h-8 border border-teal-200 bg-teal-50 pr-1.5 pl-2 text-teal-800 shadow-sm ring-1 ring-teal-200/50 dark:border-teal-800/60 dark:bg-teal-950/40 dark:text-teal-200 dark:ring-teal-800/30",
|
|
230
|
-
variant: "secondary",
|
|
231
|
-
children: [
|
|
232
|
-
/* @__PURE__ */ a("span", { className: "mr-1.5 inline-flex items-center gap-1 rounded-full bg-teal-100 px-1.5 py-0.5 text-[10px] text-teal-700 dark:bg-teal-800/60 dark:text-teal-200", children: [
|
|
233
|
-
/* @__PURE__ */ e(Q, { className: "h-3 w-3" }),
|
|
234
|
-
"Search"
|
|
235
|
-
] }),
|
|
236
|
-
/* @__PURE__ */ a("span", { className: "font-medium text-xs", children: [
|
|
237
|
-
'"',
|
|
238
|
-
f,
|
|
239
|
-
'"'
|
|
240
|
-
] }),
|
|
241
|
-
/* @__PURE__ */ e(
|
|
242
|
-
"button",
|
|
243
|
-
{
|
|
244
|
-
"aria-label": "Clear search query",
|
|
245
|
-
className: "ml-1 inline-flex h-5 w-5 items-center justify-center rounded-full bg-teal-100 text-red-600 hover:bg-red-100 hover:text-red-700 focus-visible:ring-[3px] focus-visible:ring-red-200 dark:bg-teal-800/60 dark:text-red-400 dark:hover:bg-red-950/40 dark:hover:text-red-300",
|
|
246
|
-
"data-testid": "clear-search",
|
|
247
|
-
onClick: k,
|
|
248
|
-
type: "button",
|
|
249
|
-
children: /* @__PURE__ */ e(m, { className: "h-3.5 w-3.5" })
|
|
250
|
-
}
|
|
251
|
-
)
|
|
252
|
-
]
|
|
253
|
-
}
|
|
254
|
-
)
|
|
255
|
-
] })
|
|
135
|
+
/* @__PURE__ */ e(Q, {})
|
|
256
136
|
] }),
|
|
257
137
|
/* @__PURE__ */ e(
|
|
258
|
-
|
|
138
|
+
c,
|
|
259
139
|
{
|
|
260
140
|
className: "min-h-0 flex-1 overflow-y-auto px-4 py-2 sm:px-6",
|
|
261
141
|
"data-testid": "content-area",
|
|
262
142
|
value: "toolkits",
|
|
263
|
-
children: /* @__PURE__ */
|
|
264
|
-
s.size === 0 && /* @__PURE__ */ e(
|
|
265
|
-
_,
|
|
266
|
-
{
|
|
267
|
-
"data-testid": "empty-toolkits",
|
|
268
|
-
description: "Try a different search term",
|
|
269
|
-
title: "No toolkits found"
|
|
270
|
-
}
|
|
271
|
-
),
|
|
272
|
-
/* @__PURE__ */ e(
|
|
273
|
-
"div",
|
|
274
|
-
{
|
|
275
|
-
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
276
|
-
"data-testid": "toolkits-grid",
|
|
277
|
-
children: Array.from(s).map((t) => /* @__PURE__ */ e(
|
|
278
|
-
re,
|
|
279
|
-
{
|
|
280
|
-
onSelect: () => {
|
|
281
|
-
if (r === "single") {
|
|
282
|
-
d("tools"), b(t.name);
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
z(t);
|
|
286
|
-
},
|
|
287
|
-
onView: () => {
|
|
288
|
-
b(t.name), d("tools");
|
|
289
|
-
},
|
|
290
|
-
selectedTools: new Set(i.keys()),
|
|
291
|
-
selectionMode: r,
|
|
292
|
-
toolkit: t
|
|
293
|
-
},
|
|
294
|
-
t.name
|
|
295
|
-
))
|
|
296
|
-
}
|
|
297
|
-
)
|
|
298
|
-
] })
|
|
143
|
+
children: /* @__PURE__ */ e("div", { className: "space-y-3", children: /* @__PURE__ */ e(Y, { selectionMode: a }) })
|
|
299
144
|
}
|
|
300
145
|
),
|
|
301
146
|
/* @__PURE__ */ e(
|
|
302
|
-
|
|
147
|
+
c,
|
|
303
148
|
{
|
|
304
149
|
className: "min-h-0 flex-1 overflow-y-auto px-4 py-2 sm:px-6",
|
|
305
150
|
"data-testid": "content-area",
|
|
306
151
|
value: "tools",
|
|
307
|
-
children: /* @__PURE__ */
|
|
308
|
-
n.size === 0 && /* @__PURE__ */ e(
|
|
309
|
-
_,
|
|
310
|
-
{
|
|
311
|
-
"data-testid": "empty-tools",
|
|
312
|
-
description: "Try a different search term",
|
|
313
|
-
title: "No tools found"
|
|
314
|
-
}
|
|
315
|
-
),
|
|
316
|
-
/* @__PURE__ */ e(
|
|
317
|
-
"div",
|
|
318
|
-
{
|
|
319
|
-
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
320
|
-
"data-testid": "tools-grid",
|
|
321
|
-
children: Array.from(n).map((t) => {
|
|
322
|
-
const l = Array.from(s).find(
|
|
323
|
-
(h) => h.name === t.toolkit.name
|
|
324
|
-
)?.metadata?.icon ?? J(t.toolkit.name);
|
|
325
|
-
return /* @__PURE__ */ e(
|
|
326
|
-
Z,
|
|
327
|
-
{
|
|
328
|
-
"data-testid": `tool-card-${t.fully_qualified_name}`,
|
|
329
|
-
description: t.description,
|
|
330
|
-
fully_qualified_name: t.fully_qualified_name,
|
|
331
|
-
hideCheckbox: r === "single",
|
|
332
|
-
Icon: l,
|
|
333
|
-
isSelected: i.has(
|
|
334
|
-
t.fully_qualified_name
|
|
335
|
-
),
|
|
336
|
-
name: t.name,
|
|
337
|
-
onSelect: () => q(t),
|
|
338
|
-
toolkitName: t.toolkit.name
|
|
339
|
-
},
|
|
340
|
-
t.fully_qualified_name
|
|
341
|
-
);
|
|
342
|
-
})
|
|
343
|
-
}
|
|
344
|
-
)
|
|
345
|
-
] })
|
|
152
|
+
children: /* @__PURE__ */ e("div", { className: "space-y-3", children: /* @__PURE__ */ e($, { selectionMode: a }) })
|
|
346
153
|
}
|
|
347
154
|
)
|
|
348
155
|
]
|
|
349
156
|
}
|
|
350
157
|
),
|
|
351
|
-
/* @__PURE__ */ e(
|
|
158
|
+
/* @__PURE__ */ e(P, { className: "shrink-0 border-t bg-white px-4 py-3 sm:px-6 sm:py-4 dark:bg-neutral-950", children: /* @__PURE__ */ t(
|
|
352
159
|
"div",
|
|
353
160
|
{
|
|
354
|
-
className: `${
|
|
161
|
+
className: `${a === "single" ? "sm:justify-end" : "sm:justify-between"} flex w-full flex-col gap-3 sm:flex-row sm:items-center`,
|
|
355
162
|
children: [
|
|
356
|
-
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */ e(
|
|
359
|
-
|
|
163
|
+
a === "multi" && /* @__PURE__ */ e(R, {}),
|
|
164
|
+
/* @__PURE__ */ t("div", { className: "mt-2 flex gap-2 sm:mt-0 sm:gap-2", children: [
|
|
165
|
+
/* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(
|
|
166
|
+
n,
|
|
360
167
|
{
|
|
361
168
|
className: "flex-1 sm:flex-none",
|
|
362
169
|
"data-testid": "cancel-button",
|
|
@@ -365,29 +172,25 @@ const Se = (T) => {
|
|
|
365
172
|
children: "Cancel"
|
|
366
173
|
}
|
|
367
174
|
) }),
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
selectedCount: i.size,
|
|
388
|
-
selectionMode: r
|
|
389
|
-
}
|
|
390
|
-
)
|
|
175
|
+
/* @__PURE__ */ t(G, { delayDuration: 350, children: [
|
|
176
|
+
/* @__PURE__ */ e(H, { asChild: !0, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
177
|
+
W,
|
|
178
|
+
{
|
|
179
|
+
className: "flex-1 sm:flex-none",
|
|
180
|
+
onCommit: y,
|
|
181
|
+
selectedCount: i.size,
|
|
182
|
+
selectionMode: a
|
|
183
|
+
}
|
|
184
|
+
) }) }),
|
|
185
|
+
/* @__PURE__ */ e(I, { children: /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
186
|
+
/* @__PURE__ */ e("span", { children: "Submit selection" }),
|
|
187
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
|
|
188
|
+
/* @__PURE__ */ e("kbd", { className: "inline-flex h-4 items-center rounded border bg-muted px-1 font-mono text-[10px]", children: typeof window < "u" && J.test(navigator.userAgent) ? "⌘" : "Ctrl" }),
|
|
189
|
+
/* @__PURE__ */ e("span", { className: "text-xs", children: "+" }),
|
|
190
|
+
/* @__PURE__ */ e("kbd", { className: "inline-flex h-4 items-center rounded border bg-muted px-1 font-mono text-[10px]", children: "↵" })
|
|
191
|
+
] })
|
|
192
|
+
] }) })
|
|
193
|
+
] })
|
|
391
194
|
] })
|
|
392
195
|
]
|
|
393
196
|
}
|
|
@@ -400,5 +203,5 @@ const Se = (T) => {
|
|
|
400
203
|
) });
|
|
401
204
|
};
|
|
402
205
|
export {
|
|
403
|
-
|
|
206
|
+
xe as ToolkitPickerDialog
|
|
404
207
|
};
|