@burdenoff/microfe-integrations 2026.625.3 → 2026.626.1
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/integrations/components/AddConnectionDialog.js +287 -289
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +260 -256
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +187 -152
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.js +118 -105
- package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +108 -77
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +79 -46
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.js +52 -48
- package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +121 -98
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.js +211 -190
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.js +147 -143
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -10,8 +10,8 @@ import { ConnectionCard as l } from "../components/ConnectionCard.js";
|
|
|
10
10
|
import { useId as u, useMemo as d, useState as f } from "react";
|
|
11
11
|
import { AlertCircle as p, ArrowLeft as m, Filter as h, Grid3x3 as g, Link2 as _, List as v, Plus as y, RefreshCw as b, Search as x, X as S } from "lucide-react";
|
|
12
12
|
import { usePermissions as C } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
13
|
-
import {
|
|
14
|
-
import { Button as D, IllustratedEmptyState as O } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
14
|
+
import { Button as E, EmphasisPanel as D, IllustratedEmptyState as O, PagePurpose as ee } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/integrations/pages/ConnectionsList.tsx
|
|
16
16
|
function k() {
|
|
17
17
|
let { basePath: k = "/", navigate: A, onConnectionSelect: j } = e(), { viewMode: M, setViewMode: N, connectionFilter: P, updateConnectionFilter: F, addConnectionDialogOpen: I, openAddConnectionDialog: L, closeAddConnectionDialog: R } = r(), { connections: z, loading: B, error: V, refetch: H } = s(), { hasPermission: U, isLoading: W } = C(), G = !W && U(n.CONNECTION_CREATE), [K, q] = f(!1), J = u(), Y = `${J}-status`, X = `${J}-category`, Z = d(() => {
|
|
@@ -28,60 +28,64 @@ function k() {
|
|
|
28
28
|
providerId: null,
|
|
29
29
|
category: "all"
|
|
30
30
|
});
|
|
31
|
-
},
|
|
31
|
+
}, te = (e) => {
|
|
32
32
|
j?.(e), A?.(i(k, `connections/${e.id}`));
|
|
33
33
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ T("div", {
|
|
35
35
|
className: "space-y-6 p-6 max-w-7xl mx-auto",
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ w("div", {
|
|
38
38
|
className: "rounded-xl border border-border-seam bg-accent-wash p-6",
|
|
39
39
|
"data-tour": "integrations-connections-header",
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ T("div", {
|
|
41
41
|
className: "flex items-center justify-between gap-4",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ T("div", {
|
|
43
43
|
className: "flex items-center gap-4",
|
|
44
44
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ w(E, {
|
|
46
46
|
variant: "ghost",
|
|
47
47
|
size: "icon",
|
|
48
48
|
onClick: () => A?.(k),
|
|
49
49
|
"aria-label": "Back to overview",
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ w(m, { size: 20 })
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ w("div", {
|
|
53
53
|
className: "p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
54
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ w(_, {
|
|
55
55
|
size: 24,
|
|
56
56
|
className: "text-primary"
|
|
57
57
|
})
|
|
58
58
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h1", {
|
|
60
60
|
className: "text-2xl sm:text-3xl font-bold text-text-primary",
|
|
61
61
|
children: "Connections"
|
|
62
|
-
}), /* @__PURE__ */
|
|
62
|
+
}), /* @__PURE__ */ w("p", {
|
|
63
63
|
className: "text-sm text-text-secondary mt-0.5",
|
|
64
64
|
children: "Manage your integration connections"
|
|
65
65
|
})] })
|
|
66
66
|
]
|
|
67
|
-
}), G && /* @__PURE__ */ E
|
|
67
|
+
}), G && /* @__PURE__ */ T(E, {
|
|
68
68
|
onClick: () => L(),
|
|
69
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ w(y, { size: 16 }), "Add Connection"]
|
|
70
70
|
})]
|
|
71
71
|
})
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ w(ee, {
|
|
74
|
+
icon: /* @__PURE__ */ w(_, { size: 16 }),
|
|
75
|
+
children: "A connection is one authenticated link between your workspace and an external service (for example, “Marketing Slack” or “Finance Google Drive”). Use this page to see every connection at a glance, check its health, search by provider or account, and open one to test, refresh, or revoke its access."
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ T("div", {
|
|
74
78
|
className: "space-y-4",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ T("div", {
|
|
76
80
|
className: "flex flex-col sm:flex-row gap-3",
|
|
77
81
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ T("div", {
|
|
79
83
|
className: "flex-1 relative group",
|
|
80
84
|
"data-tour": "integrations-connections-search",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ w(x, {
|
|
82
86
|
size: 18,
|
|
83
87
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors"
|
|
84
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ w("input", {
|
|
85
89
|
type: "text",
|
|
86
90
|
placeholder: "Search connections...",
|
|
87
91
|
value: P.search,
|
|
@@ -90,82 +94,82 @@ function k() {
|
|
|
90
94
|
"aria-label": "Search connections"
|
|
91
95
|
})]
|
|
92
96
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ T("button", {
|
|
94
98
|
type: "button",
|
|
95
99
|
onClick: () => q(!K),
|
|
96
100
|
className: t("inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all", K || Q ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface text-text-primary border-border-subtle hover:bg-accent"),
|
|
97
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ w(h, { size: 16 }), "Filter"]
|
|
98
102
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ T("div", {
|
|
100
104
|
className: "flex items-center border border-border-subtle rounded-lg overflow-hidden",
|
|
101
105
|
"data-tour": "integrations-connections-view-toggle",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ w("button", {
|
|
103
107
|
type: "button",
|
|
104
108
|
onClick: () => N("grid"),
|
|
105
109
|
className: t("p-2.5 transition-colors", M === "grid" ? "bg-action-primary-bg text-action-primary-text" : "hover:bg-accent"),
|
|
106
110
|
"aria-label": "Grid view",
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
}), /* @__PURE__ */
|
|
111
|
+
children: /* @__PURE__ */ w(g, { size: 16 })
|
|
112
|
+
}), /* @__PURE__ */ w("button", {
|
|
109
113
|
type: "button",
|
|
110
114
|
onClick: () => N("list"),
|
|
111
115
|
className: t("p-2.5 transition-colors", M === "list" ? "bg-action-primary-bg text-action-primary-text" : "hover:bg-accent"),
|
|
112
116
|
"aria-label": "List view",
|
|
113
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ w(v, { size: 16 })
|
|
114
118
|
})]
|
|
115
119
|
})
|
|
116
120
|
]
|
|
117
|
-
}), K && /* @__PURE__ */
|
|
121
|
+
}), K && /* @__PURE__ */ T("div", {
|
|
118
122
|
className: "rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ T("div", {
|
|
120
124
|
className: "flex items-center justify-between mb-4",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
122
126
|
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ w(h, {
|
|
124
128
|
size: 16,
|
|
125
129
|
className: "text-primary"
|
|
126
130
|
}), "Filters"]
|
|
127
|
-
}), Q && /* @__PURE__ */
|
|
131
|
+
}), Q && /* @__PURE__ */ T("button", {
|
|
128
132
|
type: "button",
|
|
129
133
|
onClick: $,
|
|
130
134
|
className: "text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ w(S, { size: 14 }), " Clear All"]
|
|
132
136
|
})]
|
|
133
|
-
}), /* @__PURE__ */
|
|
137
|
+
}), /* @__PURE__ */ T("div", {
|
|
134
138
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ T("div", {
|
|
136
140
|
className: "space-y-2",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ w("label", {
|
|
138
142
|
htmlFor: Y,
|
|
139
143
|
className: "block text-sm font-medium text-text-primary",
|
|
140
144
|
children: "Status"
|
|
141
|
-
}), /* @__PURE__ */
|
|
145
|
+
}), /* @__PURE__ */ T("select", {
|
|
142
146
|
id: Y,
|
|
143
147
|
value: P.status,
|
|
144
148
|
onChange: (e) => F({ status: e.target.value }),
|
|
145
149
|
className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ w("option", {
|
|
147
151
|
value: "all",
|
|
148
152
|
children: "All Statuses"
|
|
149
|
-
}), a.map((e) => /* @__PURE__ */
|
|
153
|
+
}), a.map((e) => /* @__PURE__ */ w("option", {
|
|
150
154
|
value: e.value,
|
|
151
155
|
children: e.label
|
|
152
156
|
}, e.value))]
|
|
153
157
|
})]
|
|
154
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ T("div", {
|
|
155
159
|
className: "space-y-2",
|
|
156
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ w("label", {
|
|
157
161
|
htmlFor: X,
|
|
158
162
|
className: "block text-sm font-medium text-text-primary",
|
|
159
163
|
children: "Category"
|
|
160
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ T("select", {
|
|
161
165
|
id: X,
|
|
162
166
|
value: P.category,
|
|
163
167
|
onChange: (e) => F({ category: e.target.value }),
|
|
164
168
|
className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ w("option", {
|
|
166
170
|
value: "all",
|
|
167
171
|
children: "All Categories"
|
|
168
|
-
}), o.map((e) => /* @__PURE__ */
|
|
172
|
+
}), o.map((e) => /* @__PURE__ */ w("option", {
|
|
169
173
|
value: e.value,
|
|
170
174
|
children: e.label
|
|
171
175
|
}, e.value))]
|
|
@@ -174,32 +178,32 @@ function k() {
|
|
|
174
178
|
})]
|
|
175
179
|
})]
|
|
176
180
|
}),
|
|
177
|
-
V && /* @__PURE__ */
|
|
181
|
+
V && /* @__PURE__ */ T("div", {
|
|
178
182
|
className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ w(p, {
|
|
180
184
|
size: 24,
|
|
181
185
|
className: "text-status-error-text flex-shrink-0"
|
|
182
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ T("div", {
|
|
183
187
|
className: "flex-1",
|
|
184
188
|
children: [
|
|
185
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ w("h3", {
|
|
186
190
|
className: "font-semibold text-status-error-text mb-1",
|
|
187
191
|
children: "Error loading connections"
|
|
188
192
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ w("p", {
|
|
190
194
|
className: "text-sm text-status-error-text mb-3",
|
|
191
195
|
children: V.message
|
|
192
196
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ T("button", {
|
|
194
198
|
type: "button",
|
|
195
199
|
onClick: () => H(),
|
|
196
200
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors",
|
|
197
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ w(b, { size: 14 }), " Try Again"]
|
|
198
202
|
})
|
|
199
203
|
]
|
|
200
204
|
})]
|
|
201
205
|
}),
|
|
202
|
-
B && /* @__PURE__ */
|
|
206
|
+
B && /* @__PURE__ */ w("div", {
|
|
203
207
|
className: t(M === "grid" ? "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4" : "space-y-3"),
|
|
204
208
|
children: [...[
|
|
205
209
|
,
|
|
@@ -208,38 +212,65 @@ function k() {
|
|
|
208
212
|
,
|
|
209
213
|
,
|
|
210
214
|
,
|
|
211
|
-
]].map((e, t) => /* @__PURE__ */
|
|
215
|
+
]].map((e, t) => /* @__PURE__ */ w("div", {
|
|
212
216
|
className: "rounded-xl border border-border-seam bg-bg-surface p-5",
|
|
213
|
-
children: /* @__PURE__ */
|
|
217
|
+
children: /* @__PURE__ */ T("div", {
|
|
214
218
|
className: "flex items-start gap-3",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ w("div", { className: "size-11 bg-bg-sunken rounded-xl animate-vc-shimmer" }), /* @__PURE__ */ T("div", {
|
|
216
220
|
className: "flex-1 space-y-2",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ w("div", { className: "h-4 w-3/4 bg-bg-sunken rounded animate-vc-shimmer" }), /* @__PURE__ */ w("div", { className: "h-3 w-1/2 bg-bg-sunken rounded animate-vc-shimmer" })]
|
|
218
222
|
})]
|
|
219
223
|
})
|
|
220
224
|
}, t))
|
|
221
225
|
}),
|
|
222
|
-
!B && !V && /* @__PURE__ */ T(
|
|
223
|
-
className:
|
|
224
|
-
children:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
226
|
+
!B && !V && /* @__PURE__ */ T(D, {
|
|
227
|
+
className: "overflow-hidden p-0",
|
|
228
|
+
children: [/* @__PURE__ */ T("div", {
|
|
229
|
+
className: "flex items-center justify-between gap-2 p-5 border-b border-border-seam",
|
|
230
|
+
children: [/* @__PURE__ */ T("div", {
|
|
231
|
+
className: "flex items-center gap-2",
|
|
232
|
+
children: [/* @__PURE__ */ w(_, {
|
|
233
|
+
size: 18,
|
|
234
|
+
className: "text-primary"
|
|
235
|
+
}), /* @__PURE__ */ T("h2", {
|
|
236
|
+
className: "font-semibold text-text-primary",
|
|
237
|
+
children: ["Your Connections", Z.length > 0 && /* @__PURE__ */ T("span", {
|
|
238
|
+
className: "ml-2 text-sm font-normal text-text-secondary tabular-nums",
|
|
239
|
+
children: [
|
|
240
|
+
"(",
|
|
241
|
+
Z.length,
|
|
242
|
+
")"
|
|
243
|
+
]
|
|
244
|
+
})]
|
|
245
|
+
})]
|
|
246
|
+
}), G && Z.length > 0 && /* @__PURE__ */ T(E, {
|
|
247
|
+
size: "sm",
|
|
248
|
+
variant: "outline",
|
|
249
|
+
onClick: () => L(),
|
|
250
|
+
children: [/* @__PURE__ */ w(y, { size: 14 }), " Add"]
|
|
251
|
+
})]
|
|
252
|
+
}), Z.length > 0 ? /* @__PURE__ */ w("div", {
|
|
253
|
+
className: t("p-5", M === "grid" ? "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4" : "space-y-3"),
|
|
254
|
+
children: Z.map((e) => /* @__PURE__ */ w(l, {
|
|
255
|
+
connection: e,
|
|
256
|
+
displayMode: M,
|
|
257
|
+
onClick: te
|
|
258
|
+
}, e.id))
|
|
259
|
+
}) : /* @__PURE__ */ w(O, {
|
|
260
|
+
illustration: Q ? "empty-search" : "empty-data",
|
|
261
|
+
title: Q ? "No matching connections" : "No connections yet",
|
|
262
|
+
description: Q ? "Try adjusting your search or filters." : G ? "Add a connection to start integrating with external services." : "No connections are configured yet. Contact your workspace admin to add one.",
|
|
263
|
+
action: Q ? /* @__PURE__ */ T(E, {
|
|
264
|
+
variant: "outline",
|
|
265
|
+
onClick: $,
|
|
266
|
+
children: [/* @__PURE__ */ w(S, { size: 14 }), " Clear Filters"]
|
|
267
|
+
}) : G ? /* @__PURE__ */ T(E, {
|
|
268
|
+
onClick: () => L(),
|
|
269
|
+
children: [/* @__PURE__ */ w(y, { size: 14 }), " Add Connection"]
|
|
270
|
+
}) : void 0
|
|
271
|
+
})]
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ w(c, {
|
|
243
274
|
open: I,
|
|
244
275
|
onClose: R,
|
|
245
276
|
onConnectionCreated: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionsList.js","names":[],"sources":["../../../src/integrations/pages/ConnectionsList.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n Search,\n Filter,\n X,\n Grid3x3,\n List,\n Plus,\n Link2,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { useConnections } from '../hooks/useConnections';\nimport { joinPath } from '../utils/navigation';\nimport { ConnectionCard } from '../components/ConnectionCard';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { CONNECTION_STATUS_OPTIONS, PROVIDER_CATEGORIES } from '../utils/constants';\nimport type { IntegrationConnection, ConnectionStatus, ProviderCategory } from '../types';\nimport { Button, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\n\n/**\n * Connections List — list of all connections with search and status filter.\n */\nexport function ConnectionsList() {\n const { basePath = '/', navigate, onConnectionSelect } = useIntegrations();\n const {\n viewMode,\n setViewMode,\n connectionFilter,\n updateConnectionFilter,\n addConnectionDialogOpen,\n openAddConnectionDialog,\n closeAddConnectionDialog,\n } = useIntegrationsStore();\n\n const { connections, loading, error, refetch } = useConnections();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreate = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n const [showFilters, setShowFilters] = useState(false);\n const idPrefix = useId();\n const statusFilterId = `${idPrefix}-status`;\n const categoryFilterId = `${idPrefix}-category`;\n\n const filteredConnections = useMemo(() => {\n let result = connections ?? [];\n\n if (connectionFilter.search) {\n const q = connectionFilter.search.toLowerCase();\n result = result.filter(\n (c: IntegrationConnection) =>\n c.name.toLowerCase().includes(q) ||\n c.provider.name.toLowerCase().includes(q) ||\n (c.externalAccountEmail?.toLowerCase().includes(q) ?? false)\n );\n }\n\n if (connectionFilter.status !== 'all') {\n result = result.filter((c: IntegrationConnection) => c.status === connectionFilter.status);\n }\n\n if (connectionFilter.providerId) {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.id === connectionFilter.providerId\n );\n }\n\n if (connectionFilter.category !== 'all') {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.category === connectionFilter.category\n );\n }\n\n return result.sort(\n (a: IntegrationConnection, b: IntegrationConnection) =>\n new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()\n );\n }, [connections, connectionFilter]);\n\n const hasActiveFilters =\n connectionFilter.search ||\n connectionFilter.status !== 'all' ||\n connectionFilter.providerId ||\n connectionFilter.category !== 'all';\n\n const handleClearFilters = () => {\n updateConnectionFilter({ search: '', status: 'all', providerId: null, category: 'all' });\n };\n\n const handleConnectionClick = (connection: IntegrationConnection) => {\n onConnectionSelect?.(connection);\n navigate?.(joinPath(basePath, `connections/${connection.id}`));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-connections-header\"\n >\n <div className=\"flex items-center justify-between gap-4\">\n <div className=\"flex items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => navigate?.(basePath)}\n aria-label=\"Back to overview\"\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Link2 size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">Connections</h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n Manage your integration connections\n </p>\n </div>\n </div>\n {canCreate && (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n Add Connection\n </Button>\n )}\n </div>\n </div>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\" data-tour=\"integrations-connections-search\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors\"\n />\n <input\n type=\"text\"\n placeholder=\"Search connections...\"\n value={connectionFilter.search}\n onChange={(e) => updateConnectionFilter({ search: e.target.value })}\n className=\"w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n aria-label=\"Search connections\"\n />\n </div>\n\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} />\n Filter\n </button>\n\n <div\n className=\"flex items-center border border-border-subtle rounded-lg overflow-hidden\"\n data-tour=\"integrations-connections-view-toggle\"\n >\n <button\n type=\"button\"\n onClick={() => setViewMode('grid')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'grid'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label=\"Grid view\"\n >\n <Grid3x3 size={16} />\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode('list')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'list'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label=\"List view\"\n >\n <List size={16} />\n </button>\n </div>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" />\n Filters\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1\"\n >\n <X size={14} /> Clear All\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={statusFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n Status\n </label>\n <select\n id={statusFilterId}\n value={connectionFilter.status}\n onChange={(e) =>\n updateConnectionFilter({ status: e.target.value as ConnectionStatus | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"all\">All Statuses</option>\n {CONNECTION_STATUS_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={categoryFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n Category\n </label>\n <select\n id={categoryFilterId}\n value={connectionFilter.category}\n onChange={(e) =>\n updateConnectionFilter({ category: e.target.value as ProviderCategory | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"all\">All Categories</option>\n {PROVIDER_CATEGORIES.map((cat) => (\n <option key={cat.value} value={cat.value}>\n {cat.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">Error loading connections</h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} /> Try Again\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\n {loading && (\n <div\n className={cn(\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {[...Array(6)].map((_, i) => (\n <div\n key={i}\n className=\"rounded-xl border border-border-seam bg-bg-surface p-5\"\n >\n <div className=\"flex items-start gap-3\">\n <div className=\"size-11 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-3 w-1/2 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Connections */}\n {!loading && !error && (\n <>\n {filteredConnections.length > 0 ? (\n <div\n className={cn(\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {filteredConnections.map((conn: IntegrationConnection) => (\n <ConnectionCard\n key={conn.id}\n connection={conn}\n displayMode={viewMode}\n onClick={handleConnectionClick}\n />\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-data'}\n title={hasActiveFilters ? 'No matching connections' : 'No connections yet'}\n description={\n hasActiveFilters\n ? 'Try adjusting your search or filters.'\n : canCreate\n ? 'Add a connection to start integrating with external services.'\n : 'No connections are configured yet. Contact your workspace admin to add one.'\n }\n action={\n hasActiveFilters ? (\n <Button variant=\"outline\" onClick={handleClearFilters}>\n <X size={14} /> Clear Filters\n </Button>\n ) : canCreate ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={14} /> Add Connection\n </Button>\n ) : undefined\n }\n />\n )}\n </>\n )}\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,SAAgB,IAAkB;CAChC,IAAM,EAAE,cAAW,KAAK,aAAU,0BAAuB,GAAiB,EACpE,EACJ,aACA,gBACA,qBACA,2BACA,4BACA,4BACA,gCACE,GAAsB,EAEpB,EAAE,gBAAa,YAAS,UAAO,eAAY,GAAgB,EAC3D,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,IAAY,CAAC,KAAsB,EAAc,EAAwB,kBAAkB,EAC3F,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,IAAW,GAAO,EAClB,IAAiB,GAAG,EAAS,UAC7B,IAAmB,GAAG,EAAS,YAE/B,IAAsB,QAAc;EACxC,IAAI,IAAS,KAAe,EAAE;AAE9B,MAAI,EAAiB,QAAQ;GAC3B,IAAM,IAAI,EAAiB,OAAO,aAAa;AAC/C,OAAS,EAAO,QACb,MACC,EAAE,KAAK,aAAa,CAAC,SAAS,EAAE,IAChC,EAAE,SAAS,KAAK,aAAa,CAAC,SAAS,EAAE,KACxC,EAAE,sBAAsB,aAA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Z,CAKE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA,EAAA,aAChB;;MACL;OACF;;GAIP,KACC,kBAAC,OAAD;IACE,WAAW,EACT,MAAa,SACT,yDACA,YACL;cAEA,CAAC,GAAG;;;;;;;KAAQ,CAAC,CAAC,KAAK,GAAG,MACrB,kBAAC,OAAD;KAEE,WAAU;eAEV,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,OAAD,EAAK,WAAU,sDAAuD,CAAA,EACtE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,OAAD,EAAK,WAAU,qDAAsD,CAAA,EACrE,kBAAC,OAAD,EAAK,WAAU,qDAAsD,CAAA,CACjE;SACF;;KACF,EAVC,EAUD,CACN;IACE,CAAA;GAIP,CAAC,KAAW,CAAC,KACZ,kBAAA,GAAA,EAAA,UACG,EAAoB,SAAS,IAC5B,kBAAC,OAAD;IACE,WAAW,EACT,MAAa,SACT,yDACA,YACL;cAEA,EAAoB,KAAK,MACxB,kBAAC,GAAD;KAEE,YAAY;KACZ,aAAa;KACb,SAAS;KACT,EAJK,EAAK,GAIV,CACF;IACE,CAAA,GAEN,kBAAC,GAAD;IACE,cAAc,IAAmB,iBAAiB;IAClD,OAAO,IAAmB,4BAA4B;IACtD,aACE,IACI,0CACA,IACE,kEACA;IAER,QACE,IACE,kBAAC,GAAD;KAAQ,SAAQ;KAAU,SAAS;eAAnC,CACE,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA,EAAA,iBACR;SACP,IACF,kBAAC,GAAD;KAAQ,eAAe,GAAyB;eAAhD,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EAAA,kBACX;SACP,KAAA;IAEN,CAAA,EAEH,CAAA;GAGL,kBAAC,GAAD;IACE,MAAM;IACN,SAAS;IACT,2BAA2B;AACzB,QAAS;;IAEX,CAAA;GACE"}
|
|
1
|
+
{"version":3,"file":"ConnectionsList.js","names":[],"sources":["../../../src/integrations/pages/ConnectionsList.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n Search,\n Filter,\n X,\n Grid3x3,\n List,\n Plus,\n Link2,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { useConnections } from '../hooks/useConnections';\nimport { joinPath } from '../utils/navigation';\nimport { ConnectionCard } from '../components/ConnectionCard';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { CONNECTION_STATUS_OPTIONS, PROVIDER_CATEGORIES } from '../utils/constants';\nimport type { IntegrationConnection, ConnectionStatus, ProviderCategory } from '../types';\nimport { Button, EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\n/**\n * Connections List — list of all connections with search and status filter.\n */\nexport function ConnectionsList() {\n const { basePath = '/', navigate, onConnectionSelect } = useIntegrations();\n const {\n viewMode,\n setViewMode,\n connectionFilter,\n updateConnectionFilter,\n addConnectionDialogOpen,\n openAddConnectionDialog,\n closeAddConnectionDialog,\n } = useIntegrationsStore();\n\n const { connections, loading, error, refetch } = useConnections();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreate = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n const [showFilters, setShowFilters] = useState(false);\n const idPrefix = useId();\n const statusFilterId = `${idPrefix}-status`;\n const categoryFilterId = `${idPrefix}-category`;\n\n const filteredConnections = useMemo(() => {\n let result = connections ?? [];\n\n if (connectionFilter.search) {\n const q = connectionFilter.search.toLowerCase();\n result = result.filter(\n (c: IntegrationConnection) =>\n c.name.toLowerCase().includes(q) ||\n c.provider.name.toLowerCase().includes(q) ||\n (c.externalAccountEmail?.toLowerCase().includes(q) ?? false)\n );\n }\n\n if (connectionFilter.status !== 'all') {\n result = result.filter((c: IntegrationConnection) => c.status === connectionFilter.status);\n }\n\n if (connectionFilter.providerId) {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.id === connectionFilter.providerId\n );\n }\n\n if (connectionFilter.category !== 'all') {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.category === connectionFilter.category\n );\n }\n\n return result.sort(\n (a: IntegrationConnection, b: IntegrationConnection) =>\n new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()\n );\n }, [connections, connectionFilter]);\n\n const hasActiveFilters =\n connectionFilter.search ||\n connectionFilter.status !== 'all' ||\n connectionFilter.providerId ||\n connectionFilter.category !== 'all';\n\n const handleClearFilters = () => {\n updateConnectionFilter({ search: '', status: 'all', providerId: null, category: 'all' });\n };\n\n const handleConnectionClick = (connection: IntegrationConnection) => {\n onConnectionSelect?.(connection);\n navigate?.(joinPath(basePath, `connections/${connection.id}`));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-connections-header\"\n >\n <div className=\"flex items-center justify-between gap-4\">\n <div className=\"flex items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => navigate?.(basePath)}\n aria-label=\"Back to overview\"\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Link2 size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">Connections</h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n Manage your integration connections\n </p>\n </div>\n </div>\n {canCreate && (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n Add Connection\n </Button>\n )}\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Link2 size={16} />}>\n A connection is one authenticated link between your workspace and an external service (for\n example, “Marketing Slack” or “Finance Google Drive”). Use this page\n to see every connection at a glance, check its health, search by provider or account, and\n open one to test, refresh, or revoke its access.\n </PagePurpose>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\" data-tour=\"integrations-connections-search\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors\"\n />\n <input\n type=\"text\"\n placeholder=\"Search connections...\"\n value={connectionFilter.search}\n onChange={(e) => updateConnectionFilter({ search: e.target.value })}\n className=\"w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n aria-label=\"Search connections\"\n />\n </div>\n\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} />\n Filter\n </button>\n\n <div\n className=\"flex items-center border border-border-subtle rounded-lg overflow-hidden\"\n data-tour=\"integrations-connections-view-toggle\"\n >\n <button\n type=\"button\"\n onClick={() => setViewMode('grid')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'grid'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label=\"Grid view\"\n >\n <Grid3x3 size={16} />\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode('list')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'list'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label=\"List view\"\n >\n <List size={16} />\n </button>\n </div>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" />\n Filters\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1\"\n >\n <X size={14} /> Clear All\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={statusFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n Status\n </label>\n <select\n id={statusFilterId}\n value={connectionFilter.status}\n onChange={(e) =>\n updateConnectionFilter({ status: e.target.value as ConnectionStatus | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"all\">All Statuses</option>\n {CONNECTION_STATUS_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={categoryFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n Category\n </label>\n <select\n id={categoryFilterId}\n value={connectionFilter.category}\n onChange={(e) =>\n updateConnectionFilter({ category: e.target.value as ProviderCategory | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n >\n <option value=\"all\">All Categories</option>\n {PROVIDER_CATEGORIES.map((cat) => (\n <option key={cat.value} value={cat.value}>\n {cat.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">Error loading connections</h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} /> Try Again\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\n {loading && (\n <div\n className={cn(\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {[...Array(6)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-11 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-3 w-1/2 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Connections — the page's primary emphasis zone */}\n {!loading && !error && (\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"flex items-center justify-between gap-2 p-5 border-b border-border-seam\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n Your Connections\n {filteredConnections.length > 0 && (\n <span className=\"ml-2 text-sm font-normal text-text-secondary tabular-nums\">\n ({filteredConnections.length})\n </span>\n )}\n </h2>\n </div>\n {canCreate && filteredConnections.length > 0 && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => openAddConnectionDialog()}>\n <Plus size={14} /> Add\n </Button>\n )}\n </div>\n\n {filteredConnections.length > 0 ? (\n <div\n className={cn(\n 'p-5',\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {filteredConnections.map((conn: IntegrationConnection) => (\n <ConnectionCard\n key={conn.id}\n connection={conn}\n displayMode={viewMode}\n onClick={handleConnectionClick}\n />\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-data'}\n title={hasActiveFilters ? 'No matching connections' : 'No connections yet'}\n description={\n hasActiveFilters\n ? 'Try adjusting your search or filters.'\n : canCreate\n ? 'Add a connection to start integrating with external services.'\n : 'No connections are configured yet. Contact your workspace admin to add one.'\n }\n action={\n hasActiveFilters ? (\n <Button variant=\"outline\" onClick={handleClearFilters}>\n <X size={14} /> Clear Filters\n </Button>\n ) : canCreate ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={14} /> Add Connection\n </Button>\n ) : undefined\n }\n />\n )}\n </EmphasisPanel>\n )}\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,SAAgB,IAAkB;CAChC,IAAM,EAAE,cAAW,KAAK,aAAU,0BAAuB,GAAiB,EACpE,EACJ,aACA,gBACA,qBACA,2BACA,4BACA,4BACA,gCACE,GAAsB,EAEpB,EAAE,gBAAa,YAAS,UAAO,eAAY,GAAgB,EAC3D,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,IAAY,CAAC,KAAsB,EAAc,EAAwB,kBAAkB,EAC3F,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,IAAW,GAAO,EAClB,IAAiB,GAAG,EAAS,UAC7B,IAAmB,GAAG,EAAS,YAE/B,IAAsB,QAAc;EACxC,IAAI,IAAS,KAAe,EAAE;AAE9B,MAAI,EAAiB,QAAQ;GAC3B,IAAM,IAAI,EAAiB,OAAO,aAAa;AAC/C,OAAS,EAAO,QACb,MACC,EAAE,KAAK,aAAa,CAAC,SAAS,EA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