@tangle-network/sandbox-ui 0.133.4 → 0.133.5

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.
@@ -148,6 +148,12 @@ interface IntegrationsCatalogProps {
148
148
  /** Compact facade reserves its context line before any account has loaded. */
149
149
  reserveConnectionContext?: boolean;
150
150
  skeletonCount?: number;
151
+ /**
152
+ * Rows shown before "Show all": a Hub catalog lists hundreds of providers, and drawing every tile made a
153
+ * page tens of thousands of pixels tall that shifted everything below it once the catalog loaded.
154
+ * Connected rows always show. Defaults to 12 cards or 24 tiles; the loading skeleton uses the same count.
155
+ */
156
+ pageSize?: number;
151
157
  emptyCatalogLabel?: string;
152
158
  title?: string;
153
159
  description?: string;
@@ -260,7 +266,7 @@ export declare function integrationTileStatus(row: IntegrationsCatalogRow, { con
260
266
  };
261
267
  export declare function catalogRowActive(row: IntegrationsCatalogRow): boolean;
262
268
  /** Platform's catalog presentation, with app-owned state, destinations and effects. */
263
- export declare function IntegrationsCatalog({ rows, query, onQueryChange, categoryFilter, onCategoryFilterChange, sort, onSortChange, onSelectConnection, onConnect, onManage, onDisconnect, onRequestIntegration, onRetry, loading, error, actionError, connectError, busyProviderId, reserveConnectionContext, skeletonCount, emptyCatalogLabel, title, description, layout, className }: IntegrationsCatalogProps): import("react").JSX.Element;
269
+ export declare function IntegrationsCatalog({ rows, query, onQueryChange, categoryFilter, onCategoryFilterChange, sort, onSortChange, onSelectConnection, onConnect, onManage, onDisconnect, onRequestIntegration, onRetry, loading, error, actionError, connectError, busyProviderId, reserveConnectionContext, skeletonCount, pageSize, emptyCatalogLabel, title, description, layout, className }: IntegrationsCatalogProps): import("react").JSX.Element;
264
270
  //#endregion
265
271
  //#region src/integrations/connection-detail.d.ts
266
272
  /** Platform's permission layout, without its fetching, defaults or persistence. */
@@ -2,6 +2,7 @@ import { n as normalizeProviderId, r as providerLogoCandidates, t as ProviderIco
2
2
  import { Button, Card, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, StatusPill } from "@tangle-network/ui/primitives";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import * as React$1 from "react";
5
+ import { useState } from "react";
5
6
  import { ExternalLink, MoreVertical, Search, Unplug } from "lucide-react";
6
7
  import { cn, focusFieldWithin, focusRing } from "@tangle-network/ui/utils";
7
8
  //#region src/integrations/integrations-catalog.tsx
@@ -132,12 +133,15 @@ function ConnectionMenu({ row, connection, onManage, onDisconnect, compact }) {
132
133
  })] });
133
134
  }
134
135
  /** Platform's catalog presentation, with app-owned state, destinations and effects. */
135
- function IntegrationsCatalog({ rows, query, onQueryChange, categoryFilter = "", onCategoryFilterChange, sort, onSortChange, onSelectConnection, onConnect, onManage, onDisconnect, onRequestIntegration, onRetry, loading = false, error, actionError, connectError, busyProviderId, reserveConnectionContext = false, skeletonCount, emptyCatalogLabel = "No integrations are available to connect yet.", title, description, layout = "cards", className }) {
136
+ function IntegrationsCatalog({ rows, query, onQueryChange, categoryFilter = "", onCategoryFilterChange, sort, onSortChange, onSelectConnection, onConnect, onManage, onDisconnect, onRequestIntegration, onRetry, loading = false, error, actionError, connectError, busyProviderId, reserveConnectionContext = false, skeletonCount, pageSize, emptyCatalogLabel = "No integrations are available to connect yet.", title, description, layout = "cards", className }) {
136
137
  const compact = layout === "tiles";
137
138
  const categories = [...new Set(rows.flatMap((row) => row.category ? [row.category] : []))].sort();
138
139
  const q = query.trim().toLowerCase();
139
140
  const filtered = rows.filter((row) => (!categoryFilter || row.category === categoryFilter) && (!q || `${row.title} ${row.providerId} ${row.description ?? ""}`.toLowerCase().includes(q)));
140
141
  const hiddenActive = rows.filter((row) => catalogRowActive(row) && !filtered.includes(row)).length;
142
+ const limit = pageSize ?? (compact ? 24 : 12);
143
+ const [showAll, setShowAll] = useState(false);
144
+ const visible = showAll ? filtered : filtered.filter((row, index) => index < limit || catalogRowActive(row));
141
145
  const state = error ? "error" : loading && rows.length === 0 ? "loading" : rows.length === 0 ? "empty" : "loaded";
142
146
  const gridClass = compact ? "grid grid-cols-2 gap-3 @md:grid-cols-3 @xl:grid-cols-4 @3xl:grid-cols-5 @4xl:grid-cols-6" : "grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3";
143
147
  const boxClass = cn(compact ? "flex min-w-0 aspect-square flex-col items-center justify-center gap-2 rounded-xl border p-3 text-center" : "flex min-w-0 min-h-[200px] flex-col gap-3 rounded-xl border p-4 text-left", compact && reserveConnectionContext && "w-full min-h-[136px]");
@@ -244,7 +248,7 @@ function IntegrationsCatalog({ rows, query, onQueryChange, categoryFilter = "",
244
248
  /* @__PURE__ */ jsx("div", {
245
249
  className: gridClass,
246
250
  "data-testid": "integrations-catalog-grid",
247
- children: state === "loading" ? Array.from({ length: skeletonCount ?? (compact ? 12 : 6) }, (_, i) => /* @__PURE__ */ jsxs(Card, {
251
+ children: state === "loading" ? Array.from({ length: skeletonCount ?? limit }, (_, i) => /* @__PURE__ */ jsxs(Card, {
248
252
  "aria-hidden": "true",
249
253
  className: cn(boxClass, "animate-pulse"),
250
254
  children: [
@@ -294,7 +298,7 @@ function IntegrationsCatalog({ rows, query, onQueryChange, categoryFilter = "",
294
298
  children: "Clear filters"
295
299
  })]
296
300
  }) : null]
297
- }) : filtered.map((row) => {
301
+ }) : visible.map((row) => {
298
302
  const provider = row.kind === "provider" ? row : void 0;
299
303
  const connection = provider?.connections.find((item) => item.id === provider.selectedConnectionId);
300
304
  const active = catalogRowActive(row);
@@ -433,7 +437,20 @@ function IntegrationsCatalog({ rows, query, onQueryChange, categoryFilter = "",
433
437
  ]
434
438
  }, `${row.kind}:${row.providerId}`);
435
439
  })
436
- })
440
+ }),
441
+ state === "loaded" && visible.length < filtered.length ? /* @__PURE__ */ jsx("div", {
442
+ className: "flex justify-center",
443
+ children: /* @__PURE__ */ jsxs(Button, {
444
+ variant: "outline",
445
+ onClick: () => setShowAll(true),
446
+ "data-testid": "integrations-show-all",
447
+ children: [
448
+ "Show all ",
449
+ filtered.length,
450
+ " integrations"
451
+ ]
452
+ })
453
+ }) : null
437
454
  ]
438
455
  });
439
456
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.133.4",
3
+ "version": "0.133.5",
4
4
  "license": "MIT",
5
5
  "description": "Unified UI component library for Tangle Sandbox — primitives, chat, dashboard, terminal, editor, and workspace components",
6
6
  "repository": {