@arcadeai/design-system 2.1.0 → 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/assets/index.css +1 -1
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/variables.css +1 -1
- package/dist/components/index.js +211 -209
- package/dist/components/ui/atoms/icons/index.d.ts +1 -0
- package/dist/components/ui/atoms/icons/index.js +94 -92
- package/dist/components/ui/atoms/icons/mongodb.d.ts +3 -0
- package/dist/components/ui/atoms/icons/mongodb.js +39 -0
- package/dist/components/ui/atoms/index.js +187 -185
- package/dist/components/ui/index.js +211 -209
- 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 +218 -216
- package/dist/metadata/toolkits.js +98 -82
- package/dist/{toolkit-card-DgjPGtsJ.js → toolkit-card-BWuG_NJi.js} +27 -27
- package/package.json +4 -3
|
@@ -6,7 +6,7 @@ import "../atoms/card.js";
|
|
|
6
6
|
import "../atoms/checkbox.js";
|
|
7
7
|
import "../atoms/view-tools-control.js";
|
|
8
8
|
import "../../../utils-Db4QWi-E.js";
|
|
9
|
-
import { T as k } from "../../../toolkit-card-
|
|
9
|
+
import { T as k } from "../../../toolkit-card-BWuG_NJi.js";
|
|
10
10
|
import "../utils/memo.js";
|
|
11
11
|
export {
|
|
12
12
|
k as ToolkitCard
|
|
@@ -7,7 +7,7 @@ import "../../../react-resizable-panels.browser-DggUboAp.js";
|
|
|
7
7
|
import "../atoms/sidebar.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "../atoms/table.js";
|
|
10
|
-
import "../../../toolkit-card-
|
|
10
|
+
import "../../../toolkit-card-BWuG_NJi.js";
|
|
11
11
|
import "./tool-card.js";
|
|
12
12
|
import { getToolkitIcon as z } from "../atoms/icons/utils.js";
|
|
13
13
|
import "../organisms/toolkit-picker/hooks/use-toolkit-picker.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { X as v, CheckSquare as x } from "lucide-react";
|
|
3
|
+
import { Button as s } from "../../../atoms/button.js";
|
|
4
|
+
import { useToolkitPicker as b } from "../hooks/use-toolkit-picker.js";
|
|
5
|
+
function y({ selectionMode: o }) {
|
|
6
|
+
const {
|
|
7
|
+
state: {
|
|
8
|
+
selectedToolkits: i,
|
|
9
|
+
selectedTools: a,
|
|
10
|
+
activeTab: n,
|
|
11
|
+
filteredToolkits: c,
|
|
12
|
+
filteredTools: d
|
|
13
|
+
},
|
|
14
|
+
clearSelections: m,
|
|
15
|
+
selectAll: u
|
|
16
|
+
} = b(), h = i.size > 0 || a.size > 0, t = n === "toolkits" ? Array.from(c).flatMap(
|
|
17
|
+
(e) => e.tools.map((k) => k.fully_qualified_name)
|
|
18
|
+
) : Array.from(d).map((e) => e.fully_qualified_name), f = t.length > 0 && t.every((e) => a.has(e));
|
|
19
|
+
return /* @__PURE__ */ l("div", { className: "hidden items-center gap-2 sm:flex", children: [
|
|
20
|
+
h && /* @__PURE__ */ l(
|
|
21
|
+
s,
|
|
22
|
+
{
|
|
23
|
+
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",
|
|
24
|
+
"data-testid": "clear-selections",
|
|
25
|
+
onClick: m,
|
|
26
|
+
size: "sm",
|
|
27
|
+
variant: "outline",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ r(v, { className: "h-4 w-4 text-red-600 dark:text-red-400" }),
|
|
30
|
+
"Clear All"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
o === "multi" && !f && /* @__PURE__ */ l(
|
|
35
|
+
s,
|
|
36
|
+
{
|
|
37
|
+
className: "h-8",
|
|
38
|
+
"data-testid": "select-all",
|
|
39
|
+
onClick: () => {
|
|
40
|
+
u(t);
|
|
41
|
+
},
|
|
42
|
+
size: "sm",
|
|
43
|
+
variant: "outline",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ r(x, { className: "h-4 w-4" }),
|
|
46
|
+
"Select all"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
y as ActionButtons
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FilterBadges(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { FilterIcon as u, X as l, Search as x } from "lucide-react";
|
|
3
|
+
import { Badge as i } from "../../../atoms/badge.js";
|
|
4
|
+
import { getToolkitIcon as b } from "../../../atoms/icons/utils.js";
|
|
5
|
+
import { useToolkitPicker as h } from "../hooks/use-toolkit-picker.js";
|
|
6
|
+
function y() {
|
|
7
|
+
const {
|
|
8
|
+
state: { toolkitFilter: t, searchQuery: a, filteredToolkits: d },
|
|
9
|
+
setActiveTab: n,
|
|
10
|
+
clearFilter: s,
|
|
11
|
+
clearSearchQuery: o
|
|
12
|
+
} = h();
|
|
13
|
+
return t || a ? /* @__PURE__ */ r("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
14
|
+
t && /* @__PURE__ */ r(
|
|
15
|
+
i,
|
|
16
|
+
{
|
|
17
|
+
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",
|
|
18
|
+
variant: "secondary",
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ r("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: [
|
|
21
|
+
/* @__PURE__ */ e(u, { className: "h-3 w-3" }),
|
|
22
|
+
"Filter"
|
|
23
|
+
] }),
|
|
24
|
+
/* @__PURE__ */ r(
|
|
25
|
+
"button",
|
|
26
|
+
{
|
|
27
|
+
className: "inline-flex h-full items-center gap-1.5",
|
|
28
|
+
"data-testid": "filter-badge",
|
|
29
|
+
onClick: () => n("toolkits"),
|
|
30
|
+
type: "button",
|
|
31
|
+
children: [
|
|
32
|
+
(() => {
|
|
33
|
+
const c = Array.from(d).find(
|
|
34
|
+
(m) => m.name === t
|
|
35
|
+
), p = b({
|
|
36
|
+
metadataIcon: c?.metadata?.icon,
|
|
37
|
+
toolkitName: t
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ e(p, { className: "h-3.5 w-3.5" });
|
|
40
|
+
})(),
|
|
41
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-xs", children: t })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
"aria-label": "Clear toolkit filter",
|
|
49
|
+
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",
|
|
50
|
+
"data-testid": "clear-filter",
|
|
51
|
+
onClick: s,
|
|
52
|
+
type: "button",
|
|
53
|
+
children: /* @__PURE__ */ e(l, { className: "h-3.5 w-3.5" })
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
a && /* @__PURE__ */ r(
|
|
60
|
+
i,
|
|
61
|
+
{
|
|
62
|
+
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",
|
|
63
|
+
variant: "secondary",
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ r("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: [
|
|
66
|
+
/* @__PURE__ */ e(x, { className: "h-3 w-3" }),
|
|
67
|
+
"Search"
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-xs", children: [
|
|
70
|
+
'"',
|
|
71
|
+
a,
|
|
72
|
+
'"'
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ e(
|
|
75
|
+
"button",
|
|
76
|
+
{
|
|
77
|
+
"aria-label": "Clear search query",
|
|
78
|
+
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",
|
|
79
|
+
"data-testid": "clear-search",
|
|
80
|
+
onClick: o,
|
|
81
|
+
type: "button",
|
|
82
|
+
children: /* @__PURE__ */ e(l, { className: "h-3.5 w-3.5" })
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] }) : null;
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
y as FilterBadges
|
|
92
|
+
};
|
|
@@ -1,35 +1,69 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Search as
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Search as y } from "lucide-react";
|
|
3
|
+
import { useRef as T } from "react";
|
|
3
4
|
import "../../../atoms/mobile-tooltip.js";
|
|
4
5
|
import "../../../atoms/chart.js";
|
|
5
|
-
import { Input as
|
|
6
|
+
import { Input as k } from "../../../atoms/input.js";
|
|
6
7
|
import "../../../../../react-resizable-panels.browser-DggUboAp.js";
|
|
7
8
|
import "../../../atoms/sidebar.js";
|
|
8
|
-
import "react";
|
|
9
9
|
import "../../../atoms/table.js";
|
|
10
|
-
import "../../../../../toolkit-card-
|
|
10
|
+
import "../../../../../toolkit-card-BWuG_NJi.js";
|
|
11
11
|
import "../../../molecules/tool-card.js";
|
|
12
12
|
import "../../../../../metadata/toolkits.js";
|
|
13
|
-
import { useToolkitPicker as
|
|
14
|
-
function
|
|
15
|
-
const {
|
|
16
|
-
state: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
import { useToolkitPicker as g } from "../hooks/use-toolkit-picker.js";
|
|
14
|
+
function z() {
|
|
15
|
+
const r = T(null), {
|
|
16
|
+
state: {
|
|
17
|
+
searchQuery: o,
|
|
18
|
+
activeTab: i,
|
|
19
|
+
filteredToolkits: s,
|
|
20
|
+
filteredTools: l,
|
|
21
|
+
selectionMode: a
|
|
22
|
+
},
|
|
23
|
+
setSearchQuery: n,
|
|
24
|
+
toggleToolkit: c,
|
|
25
|
+
toggleTool: u,
|
|
26
|
+
setActiveTab: m,
|
|
27
|
+
setToolkitFilter: f
|
|
28
|
+
} = g(), p = () => {
|
|
29
|
+
const t = Array.from(s)[0];
|
|
30
|
+
if (t) {
|
|
31
|
+
if (a === "single") {
|
|
32
|
+
f(t.name), m("tools");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
c(t);
|
|
36
|
+
}
|
|
37
|
+
}, h = () => {
|
|
38
|
+
const t = Array.from(l)[0];
|
|
39
|
+
t && u(t);
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ d("div", { className: "relative flex-1", children: [
|
|
42
|
+
/* @__PURE__ */ e(y, { className: "-translate-y-1/2 absolute top-1/2 left-3.5 size-4 text-gray-400" }),
|
|
43
|
+
/* @__PURE__ */ e(
|
|
44
|
+
k,
|
|
23
45
|
{
|
|
46
|
+
"aria-label": "Search toolkits and tools",
|
|
47
|
+
autoFocus: !0,
|
|
24
48
|
className: "h-9 pl-10",
|
|
25
49
|
"data-testid": "search-input",
|
|
26
|
-
onChange: (
|
|
50
|
+
onChange: (t) => n(t.target.value),
|
|
51
|
+
onKeyDown: (t) => {
|
|
52
|
+
if (!(t.key !== "Enter" || !(o.trim().length > 0))) {
|
|
53
|
+
if (t.preventDefault(), t.stopPropagation(), i === "toolkits") {
|
|
54
|
+
p();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
h();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
27
60
|
placeholder: "Search toolkits and tools",
|
|
28
|
-
|
|
61
|
+
ref: r,
|
|
62
|
+
value: o
|
|
29
63
|
}
|
|
30
64
|
)
|
|
31
65
|
] });
|
|
32
66
|
}
|
|
33
67
|
export {
|
|
34
|
-
|
|
68
|
+
z as SearchInput
|
|
35
69
|
};
|
|
@@ -7,7 +7,7 @@ import "../../../../../react-resizable-panels.browser-DggUboAp.js";
|
|
|
7
7
|
import "../../../atoms/sidebar.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "../../../atoms/table.js";
|
|
10
|
-
import "../../../../../toolkit-card-
|
|
10
|
+
import "../../../../../toolkit-card-BWuG_NJi.js";
|
|
11
11
|
import "../../../molecules/tool-card.js";
|
|
12
12
|
import "../../../../../metadata/toolkits.js";
|
|
13
13
|
import "../hooks/use-toolkit-picker.js";
|
package/dist/components/ui/organisms/toolkit-picker/components/toolkit-card-with-selection.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { getToolkitIcon as c } from "../../../atoms/icons/utils.js";
|
|
3
|
-
import { T as d } from "../../../../../toolkit-card-
|
|
3
|
+
import { T as d } from "../../../../../toolkit-card-BWuG_NJi.js";
|
|
4
4
|
function g({
|
|
5
5
|
toolkit: e,
|
|
6
6
|
selectedTools: o,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { EmptyState as k } from "../../../molecules/empty-state.js";
|
|
3
|
+
import "../../../../../toolkit-card-BWuG_NJi.js";
|
|
4
|
+
import "../../../molecules/tool-card.js";
|
|
5
|
+
import "lucide-react";
|
|
6
|
+
import "../../../../../metadata/toolkits.js";
|
|
7
|
+
import { useToolkitPicker as f } from "../hooks/use-toolkit-picker.js";
|
|
8
|
+
import "../../../atoms/mobile-tooltip.js";
|
|
9
|
+
import "../../../atoms/chart.js";
|
|
10
|
+
import "../../../../../react-resizable-panels.browser-DggUboAp.js";
|
|
11
|
+
import "../../../atoms/sidebar.js";
|
|
12
|
+
import "react";
|
|
13
|
+
import "../../../atoms/table.js";
|
|
14
|
+
import { ToolkitCardWithSelection as h } from "./toolkit-card-with-selection.js";
|
|
15
|
+
function F({ selectionMode: s }) {
|
|
16
|
+
const {
|
|
17
|
+
state: { filteredToolkits: i, selectedToolkits: r, selectedTools: a },
|
|
18
|
+
toggleToolkit: x,
|
|
19
|
+
setActiveTab: d,
|
|
20
|
+
setToolkitFilter: n
|
|
21
|
+
} = f();
|
|
22
|
+
if (i.size === 0)
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
k,
|
|
25
|
+
{
|
|
26
|
+
"data-testid": "empty-toolkits",
|
|
27
|
+
description: "Try a different search term",
|
|
28
|
+
title: "No toolkits found"
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
const m = Array.from(i), o = m.filter(
|
|
32
|
+
(e) => r.has(e.name)
|
|
33
|
+
), c = m.filter(
|
|
34
|
+
(e) => !r.has(e.name)
|
|
35
|
+
), p = (e) => (u) => {
|
|
36
|
+
if (s === "single") {
|
|
37
|
+
d("tools"), n(e.name);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
x(e);
|
|
41
|
+
}, g = (e) => () => {
|
|
42
|
+
n(e.name), d("tools");
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ l("div", { className: "space-y-4", "data-testid": "toolkits-grid", children: [
|
|
45
|
+
o.length > 0 && /* @__PURE__ */ l(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: "mt-0.5 space-y-2",
|
|
49
|
+
"data-testid": "selected-toolkits-section",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
52
|
+
/* @__PURE__ */ t("h3", { className: "font-semibold text-neutral-700 text-sm dark:text-neutral-200", children: "Selected" }),
|
|
53
|
+
/* @__PURE__ */ t("span", { className: "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.length })
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ t("div", { className: "mt-3 grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3", children: o.map((e) => /* @__PURE__ */ t(
|
|
56
|
+
h,
|
|
57
|
+
{
|
|
58
|
+
onSelect: p(e),
|
|
59
|
+
onView: g(e),
|
|
60
|
+
selectedTools: new Set(a.keys()),
|
|
61
|
+
selectionMode: s,
|
|
62
|
+
toolkit: e
|
|
63
|
+
},
|
|
64
|
+
e.name
|
|
65
|
+
)) })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ l("div", { className: "space-y-2", children: [
|
|
70
|
+
o.length > 0 && /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
71
|
+
/* @__PURE__ */ t("h3", { className: "font-semibold text-neutral-700 text-sm dark:text-neutral-200", children: "All toolkits" }),
|
|
72
|
+
/* @__PURE__ */ t("span", { className: "rounded-full bg-neutral-200 px-1.5 py-0.5 text-neutral-800 text-xs dark:bg-neutral-800 dark:text-neutral-200", children: c.length })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ t("div", { className: "mt-2 grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3", children: c.map((e) => /* @__PURE__ */ t(
|
|
75
|
+
h,
|
|
76
|
+
{
|
|
77
|
+
onSelect: p(e),
|
|
78
|
+
onView: g(e),
|
|
79
|
+
selectedTools: new Set(a.keys()),
|
|
80
|
+
selectionMode: s,
|
|
81
|
+
toolkit: e
|
|
82
|
+
},
|
|
83
|
+
e.name
|
|
84
|
+
)) })
|
|
85
|
+
] })
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
F as ToolkitList
|
|
90
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { getToolIconByToolkitName as u } from "../../../atoms/icons/utils.js";
|
|
3
|
+
import { EmptyState as h } from "../../../molecules/empty-state.js";
|
|
4
|
+
import "../../../../../toolkit-card-BWuG_NJi.js";
|
|
5
|
+
import { ToolCard as p } from "../../../molecules/tool-card.js";
|
|
6
|
+
import "lucide-react";
|
|
7
|
+
import { useToolkitPicker as x } from "../hooks/use-toolkit-picker.js";
|
|
8
|
+
import "../../../atoms/mobile-tooltip.js";
|
|
9
|
+
import "../../../atoms/chart.js";
|
|
10
|
+
import "../../../../../react-resizable-panels.browser-DggUboAp.js";
|
|
11
|
+
import "../../../atoms/sidebar.js";
|
|
12
|
+
import "react";
|
|
13
|
+
import "../../../atoms/table.js";
|
|
14
|
+
function $({ selectionMode: d }) {
|
|
15
|
+
const {
|
|
16
|
+
state: { filteredTools: n, filteredToolkits: o, selectedTools: l },
|
|
17
|
+
toggleTool: m
|
|
18
|
+
} = x();
|
|
19
|
+
if (n.size === 0)
|
|
20
|
+
return /* @__PURE__ */ t(
|
|
21
|
+
h,
|
|
22
|
+
{
|
|
23
|
+
"data-testid": "empty-tools",
|
|
24
|
+
description: "Try a different search term",
|
|
25
|
+
title: "No tools found"
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
const c = Array.from(n), i = c.filter(
|
|
29
|
+
(e) => l.has(e.fully_qualified_name)
|
|
30
|
+
), f = c.filter(
|
|
31
|
+
(e) => !l.has(e.fully_qualified_name)
|
|
32
|
+
);
|
|
33
|
+
return /* @__PURE__ */ a("div", { className: "space-y-4", "data-testid": "tools-grid", children: [
|
|
34
|
+
i.length > 0 && /* @__PURE__ */ a("div", { className: "mt-0.5 space-y-2", "data-testid": "selected-tools-section", children: [
|
|
35
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
|
|
36
|
+
/* @__PURE__ */ t("h3", { className: "font-semibold text-neutral-700 text-sm dark:text-neutral-200", children: "Selected" }),
|
|
37
|
+
/* @__PURE__ */ t("span", { className: "rounded-full bg-emerald-300 px-1.5 py-0.5 text-emerald-900 text-xs dark:bg-emerald-600 dark:text-emerald-200", children: i.length })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ t(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: "mt-3 grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
43
|
+
"data-testid": "selected-tools-grid",
|
|
44
|
+
children: i.map((e) => {
|
|
45
|
+
const r = Array.from(o).find(
|
|
46
|
+
(s) => s.name === e.toolkit.name
|
|
47
|
+
)?.metadata?.icon ?? u(e.toolkit.name);
|
|
48
|
+
return /* @__PURE__ */ t(
|
|
49
|
+
p,
|
|
50
|
+
{
|
|
51
|
+
"data-testid": `tool-card-${e.fully_qualified_name}`,
|
|
52
|
+
description: e.description,
|
|
53
|
+
fully_qualified_name: e.fully_qualified_name,
|
|
54
|
+
hideCheckbox: d === "single",
|
|
55
|
+
Icon: r,
|
|
56
|
+
isSelected: l.has(e.fully_qualified_name),
|
|
57
|
+
name: e.name,
|
|
58
|
+
onSelect: () => m(e),
|
|
59
|
+
toolkitName: e.toolkit.name
|
|
60
|
+
},
|
|
61
|
+
e.fully_qualified_name
|
|
62
|
+
);
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
68
|
+
i.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
|
|
69
|
+
/* @__PURE__ */ t("h3", { className: "font-semibold text-neutral-700 text-sm dark:text-neutral-200", children: "All tools" }),
|
|
70
|
+
/* @__PURE__ */ t("span", { className: "rounded-full bg-neutral-200 px-1.5 py-0.5 text-neutral-800 text-xs dark:bg-neutral-800 dark:text-neutral-200", children: f.length })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ t("div", { className: "mt-2 grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3", children: f.map((e) => {
|
|
73
|
+
const r = Array.from(o).find(
|
|
74
|
+
(s) => s.name === e.toolkit.name
|
|
75
|
+
)?.metadata?.icon ?? u(e.toolkit.name);
|
|
76
|
+
return /* @__PURE__ */ t(
|
|
77
|
+
p,
|
|
78
|
+
{
|
|
79
|
+
"data-testid": `tool-card-${e.fully_qualified_name}`,
|
|
80
|
+
description: e.description,
|
|
81
|
+
fully_qualified_name: e.fully_qualified_name,
|
|
82
|
+
hideCheckbox: d === "single",
|
|
83
|
+
Icon: r,
|
|
84
|
+
isSelected: l.has(e.fully_qualified_name),
|
|
85
|
+
name: e.name,
|
|
86
|
+
onSelect: () => m(e),
|
|
87
|
+
toolkitName: e.toolkit.name
|
|
88
|
+
},
|
|
89
|
+
e.fully_qualified_name
|
|
90
|
+
);
|
|
91
|
+
}) })
|
|
92
|
+
] })
|
|
93
|
+
] });
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
$ as ToolsList
|
|
97
|
+
};
|