@arcadeai/design-system 1.2.0 → 1.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.
Files changed (113) hide show
  1. package/dist/arcade-49z5mR1G.js +1541 -0
  2. package/dist/assets/icons/arcade.d.ts +3 -0
  3. package/dist/assets/icons/arcade.js +33 -0
  4. package/dist/assets/icons/google-docs.js +110 -120
  5. package/dist/assets/icons/index.d.ts +1 -0
  6. package/dist/assets/icons/index.js +124 -122
  7. package/dist/assets/icons/utils.d.ts +26 -0
  8. package/dist/assets/icons/utils.js +155 -138
  9. package/dist/components/index.js +62 -48
  10. package/dist/components/ui/atoms/accordion.js +1 -1
  11. package/dist/components/ui/atoms/alert.js +2 -2
  12. package/dist/components/ui/atoms/avatar.js +1 -1
  13. package/dist/components/ui/atoms/badge.js +2 -2
  14. package/dist/components/ui/atoms/breadcrumb.js +13 -15
  15. package/dist/components/ui/atoms/button.js +2 -2
  16. package/dist/components/ui/atoms/byoc-badge.js +2 -2
  17. package/dist/components/ui/atoms/card.js +1 -1
  18. package/dist/components/ui/atoms/chart.js +1 -1
  19. package/dist/components/ui/atoms/checkbox.js +1 -1
  20. package/dist/components/ui/atoms/command.js +2 -2
  21. package/dist/components/ui/atoms/dialog.js +8 -8
  22. package/dist/components/ui/atoms/dropdown-menu.js +2 -2
  23. package/dist/components/ui/atoms/form.d.ts +1 -1
  24. package/dist/components/ui/atoms/form.js +8 -7
  25. package/dist/components/ui/atoms/hover-card.js +2 -2
  26. package/dist/components/ui/atoms/index.js +14 -13
  27. package/dist/components/ui/atoms/input.js +1 -1
  28. package/dist/components/ui/atoms/label.js +1 -1
  29. package/dist/components/ui/atoms/popover.js +2 -2
  30. package/dist/components/ui/atoms/pro-badge.js +2 -2
  31. package/dist/components/ui/atoms/progress.js +1 -1
  32. package/dist/components/ui/atoms/radio-group.js +1 -1
  33. package/dist/components/ui/atoms/resizable.js +24 -1527
  34. package/dist/components/ui/atoms/scroll-area.js +1 -1
  35. package/dist/components/ui/atoms/select.js +2 -2
  36. package/dist/components/ui/atoms/separator.js +1 -1
  37. package/dist/components/ui/atoms/sheet.js +2 -2
  38. package/dist/components/ui/atoms/sidebar.js +3 -3
  39. package/dist/components/ui/atoms/skeleton.js +1 -1
  40. package/dist/components/ui/atoms/slider.js +1 -1
  41. package/dist/components/ui/atoms/switch.js +1 -1
  42. package/dist/components/ui/atoms/table.js +1 -1
  43. package/dist/components/ui/atoms/tabs.js +1 -1
  44. package/dist/components/ui/atoms/textarea.js +1 -1
  45. package/dist/components/ui/atoms/toggle.js +2 -2
  46. package/dist/components/ui/atoms/tooltip.js +60 -60
  47. package/dist/components/ui/atoms/view-tools-control.d.ts +12 -0
  48. package/dist/components/ui/atoms/view-tools-control.js +53 -0
  49. package/dist/components/ui/index.d.ts +2 -0
  50. package/dist/components/ui/index.js +62 -48
  51. package/dist/components/ui/molecules/empty-state.d.ts +5 -0
  52. package/dist/components/ui/molecules/empty-state.js +25 -0
  53. package/dist/components/ui/molecules/index.d.ts +6 -0
  54. package/dist/components/ui/molecules/index.js +13 -0
  55. package/dist/components/ui/molecules/requirement-badges.d.ts +29 -0
  56. package/dist/components/ui/molecules/requirement-badges.js +24 -0
  57. package/dist/components/ui/molecules/tool-card.d.ts +17 -0
  58. package/dist/components/ui/molecules/tool-card.js +127 -0
  59. package/dist/components/ui/molecules/toolkit-card.d.ts +24 -0
  60. package/dist/components/ui/molecules/toolkit-card.js +13 -0
  61. package/dist/components/ui/molecules/toolkit-picker-trigger.d.ts +8 -0
  62. package/dist/components/ui/molecules/toolkit-picker-trigger.js +96 -0
  63. package/dist/components/ui/molecules/toolkit-selection-summary.d.ts +10 -0
  64. package/dist/components/ui/molecules/toolkit-selection-summary.js +117 -0
  65. package/dist/components/ui/organisms/index.d.ts +1 -0
  66. package/dist/components/ui/organisms/index.js +4 -0
  67. package/dist/components/ui/organisms/toolkit-picker/components/footer-summary.d.ts +1 -0
  68. package/dist/components/ui/organisms/toolkit-picker/components/footer-summary.js +36 -0
  69. package/dist/components/ui/organisms/toolkit-picker/components/mobile-filter-badges.d.ts +1 -0
  70. package/dist/components/ui/organisms/toolkit-picker/components/mobile-filter-badges.js +96 -0
  71. package/dist/components/ui/organisms/toolkit-picker/components/search-input.d.ts +1 -0
  72. package/dist/components/ui/organisms/toolkit-picker/components/search-input.js +36 -0
  73. package/dist/components/ui/organisms/toolkit-picker/components/select-button.d.ts +9 -0
  74. package/dist/components/ui/organisms/toolkit-picker/components/select-button.js +35 -0
  75. package/dist/components/ui/organisms/toolkit-picker/components/toolkit-card-with-selection.d.ts +9 -0
  76. package/dist/components/ui/organisms/toolkit-picker/components/toolkit-card-with-selection.js +36 -0
  77. package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-filter.test.d.ts +1 -0
  78. package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-filter.test.js +44 -0
  79. package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-search.test.d.ts +1 -0
  80. package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-search.test.js +46 -0
  81. package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-selection.test.d.ts +1 -0
  82. package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-selection.test.js +28 -0
  83. package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker.d.ts +40 -0
  84. package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker.js +267 -0
  85. package/dist/components/ui/organisms/toolkit-picker/index.d.ts +14 -0
  86. package/dist/components/ui/organisms/toolkit-picker/index.js +16 -0
  87. package/dist/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.d.ts +7 -0
  88. package/dist/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.js +432 -0
  89. package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.d.ts +2 -0
  90. package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.js +395 -0
  91. package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.test.d.ts +0 -0
  92. package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.test.js +12832 -0
  93. package/dist/components/ui/utils/memo.d.ts +2 -0
  94. package/dist/components/ui/utils/memo.js +25 -0
  95. package/dist/{index-CQhYMnjT.js → index-BDE30rcJ.js} +1 -1
  96. package/dist/{index-PlrlSrPo.js → index-DEJd-dpa.js} +1 -1
  97. package/dist/{index-BSWzylXR.js → index-Ez2mlmzx.js} +2 -2
  98. package/dist/lib/arcade/arcade.d.ts +100 -0
  99. package/dist/lib/arcade/arcade.js +5 -0
  100. package/dist/lib/arcade/arcade.test.d.ts +1 -0
  101. package/dist/lib/arcade/arcade.test.js +299 -0
  102. package/dist/lib/arcade/mocks.d.ts +2 -0
  103. package/dist/lib/arcade/mocks.js +547 -0
  104. package/dist/lib/utils.d.ts +1 -0
  105. package/dist/lib/utils.js +3 -2
  106. package/dist/magic-string.es-BQ9KnLz-.js +659 -0
  107. package/dist/main.js +62 -48
  108. package/dist/react-resizable-panels.browser-ZHjTH32c.js +1509 -0
  109. package/dist/react.esm-369wBsAv.js +35565 -0
  110. package/dist/toolkit-card-GhM_oj4G.js +304 -0
  111. package/dist/{utils-CRiPKpXj.js → utils-Db4QWi-E.js} +204 -189
  112. package/dist/vi.bdSIJ99Y-CZgZQPWH.js +11996 -0
  113. package/package.json +49 -39
@@ -0,0 +1,395 @@
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import { X as n, Package as I, Wrench as P, CheckSquare as V, FilterIcon as M, Search as Q } from "lucide-react";
3
+ import { Arcade as W } from "../../../../assets/icons/arcade.js";
4
+ import { getToolkitIconByName as $, getToolIconByToolkitName as E } from "../../../../assets/icons/utils.js";
5
+ import { Badge as k } from "../../atoms/badge.js";
6
+ import { Button as c } from "../../atoms/button.js";
7
+ import { Dialog as H, DialogTrigger as L, DialogContent as O, DialogHeader as X, DialogTitle as Y, DialogDescription as G, DialogClose as v, DialogFooter as J } from "../../atoms/dialog.js";
8
+ import { MobileTooltipProvider as K } from "../../atoms/mobile-tooltip.js";
9
+ import { Tabs as R, TabsList as U, TabsTrigger as N, TabsContent as y } from "../../atoms/tabs.js";
10
+ import { EmptyState as w } from "../../molecules/empty-state.js";
11
+ import "../../../../toolkit-card-GhM_oj4G.js";
12
+ import { ToolCard as Z } from "../../molecules/tool-card.js";
13
+ import { useToolkitPicker as ee } from "./hooks/use-toolkit-picker.js";
14
+ import "../../atoms/chart.js";
15
+ import "../../atoms/form.js";
16
+ import "../../../../react-resizable-panels.browser-ZHjTH32c.js";
17
+ import "../../atoms/sidebar.js";
18
+ import "react";
19
+ import "../../atoms/table.js";
20
+ import { FooterSummary as te } from "./components/footer-summary.js";
21
+ import { SearchInput as ae } from "./components/search-input.js";
22
+ import { SelectButton as le } from "./components/select-button.js";
23
+ import { ToolkitCardWithSelection as re } from "./components/toolkit-card-with-selection.js";
24
+ const ze = (_) => {
25
+ const {
26
+ description: T = "Select toolkits and tools",
27
+ children: C,
28
+ selectionMode: l = "multi",
29
+ onSelectionChange: h
30
+ } = _, {
31
+ state: {
32
+ selectedToolkits: u,
33
+ selectedTools: r,
34
+ activeTab: g,
35
+ filteredToolkits: o,
36
+ filteredTools: d,
37
+ toolkitFilter: m,
38
+ searchQuery: x
39
+ },
40
+ setActiveTab: i,
41
+ toggleToolkit: S,
42
+ toggleTool: z,
43
+ clearSelections: q,
44
+ clearSearchQuery: f,
45
+ clearFilter: A,
46
+ selectAll: D,
47
+ commitSelections: j,
48
+ restoreCommittedState: F,
49
+ setToolkitFilter: b
50
+ } = ee();
51
+ return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ a(
52
+ H,
53
+ {
54
+ onOpenChange: (t) => {
55
+ t && (F(), f(), i("toolkits"));
56
+ },
57
+ children: [
58
+ /* @__PURE__ */ e(L, { asChild: !0, children: C }),
59
+ /* @__PURE__ */ a(
60
+ O,
61
+ {
62
+ 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",
63
+ "data-testid": "toolkit-picker-dialog",
64
+ showCloseButton: !1,
65
+ children: [
66
+ /* @__PURE__ */ a(X, { className: "shrink-0 p-4 pb-0 sm:p-6 sm:pb-0", children: [
67
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
68
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
69
+ /* @__PURE__ */ a("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: [
70
+ /* @__PURE__ */ e(
71
+ "span",
72
+ {
73
+ "aria-hidden": !0,
74
+ className: "pointer-events-none absolute inset-0 z-0 rounded-xl bg-[radial-gradient(at_15%_20%,rgba(249,115,22,0.9),transparent_45%),radial-gradient(at_10%_85%,rgba(14,165,233,0.9),transparent_45%),radial-gradient(at_95%_25%,rgba(236,72,153,0.9),transparent_40%),linear-gradient(135deg,rgba(14,165,233,0.6)_0%,rgba(236,72,153,0.6)_50%,rgba(249,115,22,0.6)_100%)]"
75
+ }
76
+ ),
77
+ /* @__PURE__ */ e(
78
+ "span",
79
+ {
80
+ "aria-hidden": !0,
81
+ 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"
82
+ }
83
+ ),
84
+ /* @__PURE__ */ e("span", { className: "relative z-20", children: /* @__PURE__ */ e(W, { className: "size-5 sm:size-7" }) })
85
+ ] }),
86
+ /* @__PURE__ */ a("div", { className: "ml-1 text-left", children: [
87
+ /* @__PURE__ */ e(Y, { className: "font-bold text-lg sm:text-xl", children: "Choose Your Tools" }),
88
+ /* @__PURE__ */ e(G, { className: "hidden sm:block", children: T })
89
+ ] })
90
+ ] }),
91
+ /* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(
92
+ c,
93
+ {
94
+ className: "h-8 w-8 rounded-full p-0",
95
+ "data-testid": "toolkit-picker-close",
96
+ size: "sm",
97
+ variant: "ghost",
98
+ children: /* @__PURE__ */ e(n, { className: "h-4 w-4" })
99
+ }
100
+ ) })
101
+ ] }),
102
+ /* @__PURE__ */ e("div", { className: "mb-2 space-y-2 pt-2 sm:space-y-4 sm:pt-4", children: /* @__PURE__ */ e(ae, {}) })
103
+ ] }),
104
+ /* @__PURE__ */ a(
105
+ R,
106
+ {
107
+ className: "flex min-h-0 flex-1 flex-col",
108
+ onValueChange: (t) => i(t),
109
+ value: g,
110
+ children: [
111
+ /* @__PURE__ */ a("div", { className: "shrink-0 space-y-2 px-4 sm:space-y-3 sm:px-6", children: [
112
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
113
+ /* @__PURE__ */ a(U, { 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: [
114
+ /* @__PURE__ */ a(
115
+ N,
116
+ {
117
+ 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",
118
+ "data-testid": "toolkits-tab",
119
+ value: "toolkits",
120
+ children: [
121
+ /* @__PURE__ */ e(I, { className: "h-4 w-4" }),
122
+ /* @__PURE__ */ e("span", { children: "Toolkits" }),
123
+ /* @__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: o.size })
124
+ ]
125
+ }
126
+ ),
127
+ /* @__PURE__ */ a(
128
+ N,
129
+ {
130
+ 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",
131
+ "data-testid": "tools-tab",
132
+ value: "tools",
133
+ children: [
134
+ /* @__PURE__ */ e(P, { className: "h-4 w-4" }),
135
+ /* @__PURE__ */ e("span", { children: "Tools" }),
136
+ /* @__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: d.size })
137
+ ]
138
+ }
139
+ )
140
+ ] }),
141
+ /* @__PURE__ */ a("div", { className: "hidden items-center gap-2 sm:flex", children: [
142
+ (u.size > 0 || r.size > 0) && /* @__PURE__ */ a(
143
+ c,
144
+ {
145
+ 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",
146
+ "data-testid": "clear-selections",
147
+ onClick: q,
148
+ size: "sm",
149
+ variant: "outline",
150
+ children: [
151
+ /* @__PURE__ */ e(n, { className: "h-4 w-4 text-red-600 dark:text-red-400" }),
152
+ "Clear All"
153
+ ]
154
+ }
155
+ ),
156
+ l === "multi" && (() => {
157
+ const t = g === "toolkits" ? Array.from(o).flatMap(
158
+ (s) => s.tools.map((B) => B.fully_qualified_name)
159
+ ) : Array.from(d).map(
160
+ (s) => s.fully_qualified_name
161
+ );
162
+ return t.length > 0 && t.every((s) => r.has(s)) ? null : /* @__PURE__ */ a(
163
+ c,
164
+ {
165
+ className: "h-8",
166
+ "data-testid": "select-all",
167
+ onClick: () => {
168
+ D(t);
169
+ },
170
+ size: "sm",
171
+ variant: "outline",
172
+ children: [
173
+ /* @__PURE__ */ e(V, { className: "h-4 w-4" }),
174
+ "Select all"
175
+ ]
176
+ }
177
+ );
178
+ })()
179
+ ] })
180
+ ] }),
181
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
182
+ m && /* @__PURE__ */ a(
183
+ k,
184
+ {
185
+ 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",
186
+ variant: "secondary",
187
+ children: [
188
+ /* @__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: [
189
+ /* @__PURE__ */ e(M, { className: "h-3 w-3" }),
190
+ "Filter"
191
+ ] }),
192
+ /* @__PURE__ */ a(
193
+ "button",
194
+ {
195
+ className: "inline-flex h-full items-center gap-1.5",
196
+ "data-testid": "filter-badge",
197
+ onClick: () => i("toolkits"),
198
+ type: "button",
199
+ children: [
200
+ (() => {
201
+ const t = $(
202
+ m
203
+ );
204
+ return /* @__PURE__ */ e(t, { className: "h-3.5 w-3.5" });
205
+ })(),
206
+ /* @__PURE__ */ e("span", { className: "font-medium text-xs", children: m })
207
+ ]
208
+ }
209
+ ),
210
+ /* @__PURE__ */ e(
211
+ "button",
212
+ {
213
+ "aria-label": "Clear toolkit filter",
214
+ 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",
215
+ "data-testid": "clear-filter",
216
+ onClick: A,
217
+ type: "button",
218
+ children: /* @__PURE__ */ e(n, { className: "h-3.5 w-3.5" })
219
+ }
220
+ )
221
+ ]
222
+ }
223
+ ),
224
+ x && /* @__PURE__ */ a(
225
+ k,
226
+ {
227
+ 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",
228
+ variant: "secondary",
229
+ children: [
230
+ /* @__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: [
231
+ /* @__PURE__ */ e(Q, { className: "h-3 w-3" }),
232
+ "Search"
233
+ ] }),
234
+ /* @__PURE__ */ a("span", { className: "font-medium text-xs", children: [
235
+ '"',
236
+ x,
237
+ '"'
238
+ ] }),
239
+ /* @__PURE__ */ e(
240
+ "button",
241
+ {
242
+ "aria-label": "Clear search query",
243
+ 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",
244
+ "data-testid": "clear-search",
245
+ onClick: f,
246
+ type: "button",
247
+ children: /* @__PURE__ */ e(n, { className: "h-3.5 w-3.5" })
248
+ }
249
+ )
250
+ ]
251
+ }
252
+ )
253
+ ] })
254
+ ] }),
255
+ /* @__PURE__ */ e(
256
+ y,
257
+ {
258
+ className: "min-h-0 flex-1 overflow-y-auto px-4 py-2 sm:px-6",
259
+ "data-testid": "content-area",
260
+ value: "toolkits",
261
+ children: /* @__PURE__ */ a("div", { className: "space-y-3", children: [
262
+ o.size === 0 && /* @__PURE__ */ e(
263
+ w,
264
+ {
265
+ "data-testid": "empty-toolkits",
266
+ description: "Try a different search term",
267
+ title: "No toolkits found"
268
+ }
269
+ ),
270
+ /* @__PURE__ */ e(
271
+ "div",
272
+ {
273
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
274
+ "data-testid": "toolkits-grid",
275
+ children: Array.from(o).map((t) => /* @__PURE__ */ e(
276
+ re,
277
+ {
278
+ onSelect: () => {
279
+ if (l === "single") {
280
+ i("tools"), b(t.name);
281
+ return;
282
+ }
283
+ S(t);
284
+ },
285
+ onView: () => {
286
+ b(t.name), i("tools");
287
+ },
288
+ selectedTools: new Set(r.keys()),
289
+ selectionMode: l,
290
+ toolkit: t
291
+ },
292
+ t.name
293
+ ))
294
+ }
295
+ )
296
+ ] })
297
+ }
298
+ ),
299
+ /* @__PURE__ */ e(
300
+ y,
301
+ {
302
+ className: "min-h-0 flex-1 overflow-y-auto px-4 py-2 sm:px-6",
303
+ "data-testid": "content-area",
304
+ value: "tools",
305
+ children: /* @__PURE__ */ a("div", { className: "space-y-3", children: [
306
+ d.size === 0 && /* @__PURE__ */ e(
307
+ w,
308
+ {
309
+ "data-testid": "empty-tools",
310
+ description: "Try a different search term",
311
+ title: "No tools found"
312
+ }
313
+ ),
314
+ /* @__PURE__ */ e(
315
+ "div",
316
+ {
317
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
318
+ "data-testid": "tools-grid",
319
+ children: Array.from(d).map((t) => /* @__PURE__ */ e(
320
+ Z,
321
+ {
322
+ "data-testid": `tool-card-${t.fully_qualified_name}`,
323
+ description: t.description,
324
+ fully_qualified_name: t.fully_qualified_name,
325
+ hideCheckbox: l === "single",
326
+ Icon: E(t.toolkit.name),
327
+ isSelected: r.has(t.fully_qualified_name),
328
+ name: t.name,
329
+ onSelect: () => z(t),
330
+ toolkitName: t.toolkit.name
331
+ },
332
+ t.fully_qualified_name
333
+ ))
334
+ }
335
+ )
336
+ ] })
337
+ }
338
+ )
339
+ ]
340
+ }
341
+ ),
342
+ /* @__PURE__ */ e(J, { className: "shrink-0 border-t bg-white px-4 py-3 sm:px-6 sm:py-4 dark:bg-neutral-950", children: /* @__PURE__ */ a(
343
+ "div",
344
+ {
345
+ className: `${l === "single" ? "sm:justify-end" : "sm:justify-between"} flex w-full flex-col gap-3 sm:flex-row sm:items-center`,
346
+ children: [
347
+ l === "multi" && /* @__PURE__ */ e(te, {}),
348
+ /* @__PURE__ */ a("div", { className: "mt-2 flex gap-2 sm:mt-0 sm:gap-2", children: [
349
+ /* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(
350
+ c,
351
+ {
352
+ className: "flex-1 sm:flex-none",
353
+ "data-testid": "cancel-button",
354
+ size: "sm",
355
+ variant: "outline",
356
+ children: "Cancel"
357
+ }
358
+ ) }),
359
+ /* @__PURE__ */ e(
360
+ le,
361
+ {
362
+ className: "flex-1 sm:flex-none",
363
+ onCommit: () => {
364
+ j(), h && h({
365
+ selectedToolkits: Array.from(u.keys()),
366
+ selectedTools: Array.from(r.keys())
367
+ });
368
+ const t = document.querySelector(
369
+ '[data-testid="toolkit-picker-dialog"]'
370
+ );
371
+ if (t) {
372
+ const p = t.querySelector(
373
+ '[data-testid="toolkit-picker-close"]'
374
+ );
375
+ p && p.click();
376
+ }
377
+ },
378
+ selectedCount: r.size,
379
+ selectionMode: l
380
+ }
381
+ )
382
+ ] })
383
+ ]
384
+ }
385
+ ) })
386
+ ]
387
+ }
388
+ )
389
+ ]
390
+ }
391
+ ) });
392
+ };
393
+ export {
394
+ ze as ToolkitPickerDialog
395
+ };