@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,304 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { c as v } from "./index-BDE30rcJ.js";
3
+ import { Key as R, Fingerprint as j, Wrench as O, Package as $ } from "lucide-react";
4
+ import * as f from "react";
5
+ import { Card as P, CardContent as D } from "./components/ui/atoms/card.js";
6
+ import { Checkbox as K } from "./components/ui/atoms/checkbox.js";
7
+ import { ViewToolsControl as S } from "./components/ui/atoms/view-tools-control.js";
8
+ import { c as u } from "./utils-Db4QWi-E.js";
9
+ import { Badge as N } from "./components/ui/atoms/badge.js";
10
+ import { ByocBadge as z } from "./components/ui/atoms/byoc-badge.js";
11
+ import "./components/ui/atoms/chart.js";
12
+ import "./components/ui/atoms/form.js";
13
+ import "./components/ui/atoms/mobile-tooltip.js";
14
+ import { ProBadge as U } from "./components/ui/atoms/pro-badge.js";
15
+ import "./react-resizable-panels.browser-ZHjTH32c.js";
16
+ import "./components/ui/atoms/sidebar.js";
17
+ import "./components/ui/atoms/table.js";
18
+ import { Tooltip as y, TooltipTrigger as w, TooltipContent as C } from "./components/ui/atoms/tooltip.js";
19
+ import "./components/ui/molecules/tool-card.js";
20
+ import { areStringArraysEqual as x, createPropsComparator as B } from "./components/ui/utils/memo.js";
21
+ import "./assets/icons/utils.js";
22
+ import "./components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker.js";
23
+ const _ = ({ secrets: r }) => {
24
+ const a = (r.pending?.length ?? 0) > 0, s = /* @__PURE__ */ o("div", { className: "space-y-2", children: [
25
+ /* @__PURE__ */ e("div", { className: "font-medium text-gray-900 dark:text-gray-100", children: "API Keys & Secrets" }),
26
+ (r.configured?.length ?? 0) > 0 && /* @__PURE__ */ o("div", { children: [
27
+ /* @__PURE__ */ e("div", { className: "mb-1 font-medium text-emerald-700 text-xs dark:text-emerald-300", children: "Configured" }),
28
+ /* @__PURE__ */ e("ul", { className: "list-disc pl-4 text-gray-700 text-xs dark:text-gray-300", children: r.configured?.map((t) => /* @__PURE__ */ e("li", { children: t }, `cfg-${t}`)) })
29
+ ] }),
30
+ (r.pending?.length ?? 0) > 0 && /* @__PURE__ */ o("div", { children: [
31
+ /* @__PURE__ */ e("div", { className: "mb-1 font-medium text-red-700 text-xs dark:text-red-300", children: "Pending" }),
32
+ /* @__PURE__ */ e("ul", { className: "list-disc pl-4 text-gray-700 text-xs dark:text-gray-300", children: r.pending?.map((t) => /* @__PURE__ */ e("li", { children: t }, `pen-${t}`)) })
33
+ ] })
34
+ ] });
35
+ return /* @__PURE__ */ o(y, { children: [
36
+ /* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ o(
37
+ N,
38
+ {
39
+ className: u(
40
+ "gap-1.5 bg-stone-700",
41
+ a && "border-l-2 border-l-yellow-600"
42
+ ),
43
+ variant: "secondary",
44
+ children: [
45
+ /* @__PURE__ */ e(R, { className: "h-3.5 w-3.5" }),
46
+ "Secrets"
47
+ ]
48
+ }
49
+ ) }),
50
+ /* @__PURE__ */ e(C, { className: "max-w-xs text-sm", sideOffset: 8, children: s })
51
+ ] });
52
+ }, F = ({ oauth: r }) => {
53
+ const a = r.providers.filter((i) => i.status === "active").length, t = r.providers.length - a > 0, n = /* @__PURE__ */ o("div", { className: "space-y-2", children: [
54
+ /* @__PURE__ */ e("div", { className: "font-medium text-gray-900 dark:text-gray-100", children: "OAuth Authorization" }),
55
+ r.providers.map((i) => /* @__PURE__ */ o("div", { className: "text-gray-700 text-xs dark:text-gray-300", children: [
56
+ /* @__PURE__ */ e("span", { className: "font-medium", children: i.id }),
57
+ " ",
58
+ i.status === "active" ? /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-300", children: "(active)" }) : /* @__PURE__ */ e("span", { className: "text-red-700 dark:text-red-300", children: "(inactive)" }),
59
+ i.scopes.length > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 pl-3 text-gray-600 dark:text-gray-400", children: i.scopes.join(", ") })
60
+ ] }, i.id))
61
+ ] });
62
+ return /* @__PURE__ */ o(y, { children: [
63
+ /* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ o(
64
+ N,
65
+ {
66
+ className: u(
67
+ "gap-1.5 bg-slate-800",
68
+ t && "border-l-2 border-l-yellow-600"
69
+ ),
70
+ variant: "secondary",
71
+ children: [
72
+ /* @__PURE__ */ e(j, { className: "h-3.5 w-3.5" }),
73
+ "OAuth"
74
+ ]
75
+ }
76
+ ) }),
77
+ /* @__PURE__ */ e(C, { className: "max-w-xs text-sm", sideOffset: 8, children: n })
78
+ ] });
79
+ };
80
+ function W({
81
+ requirementsSummary: r,
82
+ isByoc: a = !1,
83
+ isPro: s = !1
84
+ }) {
85
+ if (!(r?.secrets || r?.oauth || a || s))
86
+ return null;
87
+ const { secrets: t, oauth: n } = r;
88
+ return /* @__PURE__ */ o("div", { className: "flex w-full flex-wrap items-center gap-1.5", children: [
89
+ t && /* @__PURE__ */ e(G, { secrets: t }),
90
+ n && /* @__PURE__ */ e(H, { oauth: n }),
91
+ a && /* @__PURE__ */ e(z, { className: "gap-1.5 rounded-md" }),
92
+ s && /* @__PURE__ */ e(U, { className: "gap-1.5 rounded-md" })
93
+ ] });
94
+ }
95
+ const G = f.memo(_, (r, a) => r.secrets === a.secrets ? !0 : !(!(r.secrets && a.secrets) || !x(
96
+ r.secrets.configured,
97
+ a.secrets.configured
98
+ ) || !x(
99
+ r.secrets.pending,
100
+ a.secrets.pending
101
+ ))), H = f.memo(F, (r, a) => {
102
+ if (r.oauth === a.oauth)
103
+ return !0;
104
+ if (!(r.oauth && a.oauth))
105
+ return !1;
106
+ const s = r.oauth.providers, t = a.oauth.providers;
107
+ if (s === t)
108
+ return !0;
109
+ if (s.length !== t.length)
110
+ return !1;
111
+ for (let n = 0; n < s.length; n++) {
112
+ const i = s[n], c = t[n];
113
+ if (!(i.id === c.id && i.status === c.status) || !x(i.scopes, c.scopes))
114
+ return !1;
115
+ }
116
+ return !0;
117
+ }), J = f.memo(
118
+ W,
119
+ B(["requirementsSummary", "isByoc", "isPro"])
120
+ ), L = v("", {
121
+ variants: {
122
+ selected: {
123
+ true: "border-emerald-300 ring-2 ring-emerald-500 ring-offset-2 ring-offset-white dark:border-emerald-900/60 dark:ring-offset-neutral-950",
124
+ false: ""
125
+ },
126
+ partial: {
127
+ true: "border-amber-300 ring-2 ring-amber-500 ring-offset-2 ring-offset-white dark:border-amber-900/60 dark:ring-offset-neutral-950",
128
+ false: ""
129
+ }
130
+ },
131
+ compoundVariants: [
132
+ {
133
+ selected: !1,
134
+ partial: !1,
135
+ class: "border-neutral-200 hover:border-neutral-300 dark:border-neutral-800 dark:hover:border-neutral-700"
136
+ }
137
+ ]
138
+ }), M = (r, a, s, t) => r && !a && s > 0 ? `${s}/${t} tools` : `${t} tool${t !== 1 ? "s" : ""}`, Q = v(
139
+ "inline-flex items-center gap-1 rounded-full px-2 py-1 font-medium text-xs",
140
+ {
141
+ variants: {
142
+ indeterminate: {
143
+ true: "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-200",
144
+ false: "bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-200"
145
+ }
146
+ }
147
+ }
148
+ );
149
+ function X({
150
+ name: r,
151
+ version: a,
152
+ toolsCount: s,
153
+ Icon: t = (g) => /* @__PURE__ */ e($, { ...g }),
154
+ isSelected: n = !1,
155
+ isPartiallySelected: i = !1,
156
+ selectedToolsCount: c = 0,
157
+ requirementsSummary: k,
158
+ onSelect: h,
159
+ onView: d,
160
+ hideCheckbox: m = !1,
161
+ isByoc: A,
162
+ isPro: I,
163
+ ...q
164
+ }) {
165
+ const g = f.useCallback(() => {
166
+ if (m && d) {
167
+ d();
168
+ return;
169
+ }
170
+ h?.(!n);
171
+ }, [m, n, h, d]), T = (l) => {
172
+ const p = l.key === "Enter" || l.code === "Enter", E = l.key === " " || l.key === "Spacebar" || l.code === "Space";
173
+ (p || E) && (l.preventDefault(), g()), (l.key === "ArrowRight" || l.code === "ArrowRight") && d && (l.preventDefault(), d());
174
+ }, b = i && !n;
175
+ return /* @__PURE__ */ e(
176
+ P,
177
+ {
178
+ ...q,
179
+ "aria-description": "Click card to select this toolkit. Use the View tools control to see its tools.",
180
+ "aria-label": `Select toolkit ${r}`,
181
+ className: u(
182
+ "group",
183
+ "relative",
184
+ "cursor-pointer",
185
+ "overflow-hidden",
186
+ "rounded-lg",
187
+ "border",
188
+ "py-3.5",
189
+ "transition-all",
190
+ "duration-200",
191
+ "bg-white/50",
192
+ "hover:bg-white/70",
193
+ "dark:bg-neutral-900/50",
194
+ "dark:hover:bg-neutral-900/70",
195
+ "hover:shadow-lg",
196
+ L({
197
+ selected: n,
198
+ partial: i
199
+ })
200
+ ),
201
+ onClick: g,
202
+ onKeyDown: T,
203
+ tabIndex: 0,
204
+ children: /* @__PURE__ */ e(D, { className: "px-3", children: /* @__PURE__ */ o("div", { className: "space-y-3", children: [
205
+ /* @__PURE__ */ o(
206
+ "div",
207
+ {
208
+ className: u(
209
+ "grid items-center gap-2",
210
+ "grid-cols-[20px_1fr_auto]",
211
+ m && "grid-cols-[1fr_auto]"
212
+ ),
213
+ children: [
214
+ !m && /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
215
+ K,
216
+ {
217
+ checked: n,
218
+ onCheckedChange: (l) => h?.(!!l),
219
+ onClick: (l) => l.stopPropagation(),
220
+ ref: (l) => {
221
+ if (l && i && !n) {
222
+ const p = l.querySelector(
223
+ 'input[type="checkbox"]'
224
+ );
225
+ p && (p.indeterminate = !0);
226
+ }
227
+ },
228
+ tabIndex: -1
229
+ }
230
+ ) }),
231
+ /* @__PURE__ */ e("div", { className: "mr-1.5 min-w-0", children: /* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-3", children: [
232
+ /* @__PURE__ */ e("div", { className: "flex size-9 items-center justify-center rounded bg-gradient-to-b from-neutral-200 to-neutral-100 ring-1 ring-black/5 dark:from-neutral-800 dark:to-neutral-900 dark:ring-white/5", children: /* @__PURE__ */ e(t, { className: "size-6 text-neutral-700 dark:text-neutral-200" }) }),
233
+ /* @__PURE__ */ o("div", { className: "flex h-9 min-w-0 flex-col justify-center space-y-0.5", children: [
234
+ /* @__PURE__ */ e("h3", { className: "truncate font-semibold text-base text-neutral-900 leading-tight dark:text-neutral-100", children: r }),
235
+ a && /* @__PURE__ */ o("span", { className: "font-medium text-neutral-500 text-xs leading-tight dark:text-neutral-400", children: [
236
+ "v",
237
+ a
238
+ ] })
239
+ ] })
240
+ ] }) }),
241
+ /* @__PURE__ */ e("div", { className: "mt-0.5 self-center justify-self-end", children: d ? /* @__PURE__ */ e(
242
+ S,
243
+ {
244
+ indeterminate: b,
245
+ name: r,
246
+ onClick: () => d(),
247
+ selectedCount: c,
248
+ toolsCount: s
249
+ }
250
+ ) : /* @__PURE__ */ o(
251
+ "div",
252
+ {
253
+ className: Q({
254
+ indeterminate: b
255
+ }),
256
+ children: [
257
+ /* @__PURE__ */ e(O, { className: "h-3 w-3" }),
258
+ /* @__PURE__ */ e("span", { children: M(
259
+ i,
260
+ n,
261
+ c,
262
+ s
263
+ ) })
264
+ ]
265
+ }
266
+ ) })
267
+ ]
268
+ }
269
+ ),
270
+ /* @__PURE__ */ e("div", { className: u(m ? "ml-0" : "ml-8"), children: /* @__PURE__ */ e(
271
+ J,
272
+ {
273
+ isByoc: A,
274
+ isPro: I,
275
+ requirementsSummary: k
276
+ }
277
+ ) })
278
+ ] }) })
279
+ }
280
+ );
281
+ }
282
+ const Y = B([
283
+ "name",
284
+ "version",
285
+ "description",
286
+ "toolsCount",
287
+ "isSelected",
288
+ "isPartiallySelected",
289
+ "selectedToolsCount",
290
+ "Icon",
291
+ "requirementsSummary",
292
+ "isByoc",
293
+ "isPro",
294
+ "hideCheckbox"
295
+ ]), be = f.memo(
296
+ X,
297
+ Y
298
+ );
299
+ export {
300
+ H as O,
301
+ J as R,
302
+ G as S,
303
+ be as T
304
+ };