@tangle-network/sandbox-ui 0.91.3 → 0.91.4

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/globals.css CHANGED
@@ -1945,6 +1945,12 @@
1945
1945
  border-color: color-mix(in oklab, var(--color-destructive) 30%, transparent);
1946
1946
  }
1947
1947
  }
1948
+ .border-destructive\/40 {
1949
+ border-color: color-mix(in srgb, hsl(var(--destructive)) 40%, transparent);
1950
+ @supports (color: color-mix(in lab, red, red)) {
1951
+ border-color: color-mix(in oklab, var(--color-destructive) 40%, transparent);
1952
+ }
1953
+ }
1948
1954
  .border-destructive\/50 {
1949
1955
  border-color: color-mix(in srgb, hsl(var(--destructive)) 50%, transparent);
1950
1956
  @supports (color: color-mix(in lab, red, red)) {
@@ -147,6 +147,39 @@ function IntegrationsPanel({
147
147
  setDisconnectTarget(null);
148
148
  setDisconnectError(null);
149
149
  }, []);
150
+ const [connectingId, setConnectingId] = React.useState(null);
151
+ const [connectError, setConnectError] = React.useState(null);
152
+ const activeConnect = React.useRef(0);
153
+ const startConnect = React.useCallback(
154
+ async (input) => {
155
+ const reqId = activeConnect.current += 1;
156
+ setConnectError(null);
157
+ let pending;
158
+ try {
159
+ pending = onConnect(input);
160
+ } catch (e) {
161
+ setConnectError(
162
+ e instanceof Error ? e.message : "Failed to start the connection."
163
+ );
164
+ return;
165
+ }
166
+ if (typeof pending?.then !== "function") {
167
+ return;
168
+ }
169
+ setConnectingId(input.providerId);
170
+ try {
171
+ await pending;
172
+ } catch (e) {
173
+ if (activeConnect.current !== reqId) return;
174
+ setConnectError(
175
+ e instanceof Error ? e.message : "Failed to start the connection."
176
+ );
177
+ } finally {
178
+ if (activeConnect.current === reqId) setConnectingId(null);
179
+ }
180
+ },
181
+ [onConnect]
182
+ );
150
183
  const confirmDisconnect = React.useCallback(async () => {
151
184
  if (!disconnectTarget) return;
152
185
  const reqId = activeDisconnect.current += 1;
@@ -245,6 +278,15 @@ function IntegrationsPanel({
245
278
  }
246
279
  )
247
280
  ] }),
281
+ connectError ? /* @__PURE__ */ jsx(
282
+ "div",
283
+ {
284
+ role: "alert",
285
+ "data-testid": "integration-connect-error",
286
+ className: "mb-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive",
287
+ children: connectError
288
+ }
289
+ ) : null,
248
290
  visible.length === 0 ? /* @__PURE__ */ jsx(
249
291
  EmptyState,
250
292
  {
@@ -393,7 +435,15 @@ function IntegrationsPanel({
393
435
  type: "button",
394
436
  "data-testid": `integration-${provider.providerId}`,
395
437
  "data-connected": "false",
396
- onClick: () => onConnect({ providerId: provider.providerId, connectorId }),
438
+ "data-connecting": connectingId === provider.providerId ? "true" : void 0,
439
+ disabled: connectingId === provider.providerId,
440
+ "aria-busy": connectingId === provider.providerId,
441
+ onClick: () => {
442
+ void startConnect({
443
+ providerId: provider.providerId,
444
+ connectorId
445
+ });
446
+ },
397
447
  title: provider.description ? provider.description : `Connect ${name}`,
398
448
  className: cn(
399
449
  "group flex min-w-0 aspect-square flex-col items-center justify-center gap-2 rounded-xl border border-border bg-card p-3 text-center transition-all",
package/dist/styles.css CHANGED
@@ -1945,6 +1945,12 @@
1945
1945
  border-color: color-mix(in oklab, var(--color-destructive) 30%, transparent);
1946
1946
  }
1947
1947
  }
1948
+ .border-destructive\/40 {
1949
+ border-color: color-mix(in srgb, hsl(var(--destructive)) 40%, transparent);
1950
+ @supports (color: color-mix(in lab, red, red)) {
1951
+ border-color: color-mix(in oklab, var(--color-destructive) 40%, transparent);
1952
+ }
1953
+ }
1948
1954
  .border-destructive\/50 {
1949
1955
  border-color: color-mix(in srgb, hsl(var(--destructive)) 50%, transparent);
1950
1956
  @supports (color: color-mix(in lab, red, red)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.91.3",
3
+ "version": "0.91.4",
4
4
  "description": "Unified UI component library for Tangle Sandbox — primitives, chat, dashboard, terminal, editor, and workspace components",
5
5
  "repository": {
6
6
  "type": "git",