@faskai/ui-commons 0.0.0-alpha.24 → 0.0.0-alpha.26

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.
@@ -1,24 +1,21 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AppIcon = AppIcon;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const lucide_react_1 = require("lucide-react");
7
- const utils_1 = require("../../lib/utils");
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Blocks, Landmark, Building2, CreditCard, ShoppingCart, Calendar, Mail, MessageSquare, } from 'lucide-react';
4
+ import { cn } from '../../lib/utils';
8
5
  const iconMap = {
9
- landmark: lucide_react_1.Landmark,
10
- building2: lucide_react_1.Building2,
11
- 'credit-card': lucide_react_1.CreditCard,
12
- 'shopping-cart': lucide_react_1.ShoppingCart,
13
- calendar: lucide_react_1.Calendar,
14
- mail: lucide_react_1.Mail,
15
- 'message-square': lucide_react_1.MessageSquare,
6
+ landmark: Landmark,
7
+ building2: Building2,
8
+ 'credit-card': CreditCard,
9
+ 'shopping-cart': ShoppingCart,
10
+ calendar: Calendar,
11
+ mail: Mail,
12
+ 'message-square': MessageSquare,
16
13
  };
17
- const FallbackIcon = lucide_react_1.Blocks;
18
- function AppIcon({ src, icon, alt, className }) {
14
+ const FallbackIcon = Blocks;
15
+ export function AppIcon({ src, icon, alt, className }) {
19
16
  if (src) {
20
- return (0, jsx_runtime_1.jsx)("img", { src: src, alt: alt, className: (0, utils_1.cn)('rounded', className) });
17
+ return _jsx("img", { src: src, alt: alt, className: cn('rounded', className) });
21
18
  }
22
19
  const Icon = (icon && iconMap[icon]) || FallbackIcon;
23
- return (0, jsx_runtime_1.jsx)(Icon, { className: (0, utils_1.cn)('text-muted-foreground', className) });
20
+ return _jsx(Icon, { className: cn('text-muted-foreground', className) });
24
21
  }
@@ -1,17 +1,16 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AppSearchGrid = AppSearchGrid;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const utils_1 = require("../../lib/utils");
8
- const app_icon_1 = require("./app-icon");
9
- function AppSearchGrid({ connectedAppKeys, onSearch, onConnect, connecting, initialApps, }) {
10
- const [query, setQuery] = (0, react_1.useState)('');
11
- const [apps, setApps] = (0, react_1.useState)(initialApps || []);
12
- const [searching, setSearching] = (0, react_1.useState)(false);
13
- const debounceRef = (0, react_1.useRef)(null);
14
- (0, react_1.useEffect)(() => {
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from 'react';
4
+ import { Loader2 } from 'lucide-react';
5
+ import { AppIcon } from './app-icon';
6
+ import { Badge } from '../ui/badge';
7
+ import { Button } from '../ui/button';
8
+ export function AppSearchGrid({ connectedAppKeys, onSearch, onConnect, connecting, initialApps, }) {
9
+ const [query, setQuery] = useState('');
10
+ const [apps, setApps] = useState(initialApps || []);
11
+ const [searching, setSearching] = useState(false);
12
+ const debounceRef = useRef(null);
13
+ useEffect(() => {
15
14
  if (debounceRef.current)
16
15
  clearTimeout(debounceRef.current);
17
16
  debounceRef.current = setTimeout(async () => {
@@ -32,5 +31,5 @@ function AppSearchGrid({ connectedAppKeys, onSearch, onConnect, connecting, init
32
31
  function isConnected(slug) {
33
32
  return connectedAppKeys.includes(slug);
34
33
  }
35
- return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-sm font-medium", children: "Connect Apps" }), (0, jsx_runtime_1.jsx)("p", { className: "text-muted-foreground text-xs", children: "Search and connect apps for your agent." })] }), (0, jsx_runtime_1.jsx)("input", { className: "border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-sm transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", placeholder: "Search apps (e.g. Slack, Google Sheets, HubSpot)...", value: query, onChange: (e) => setQuery(e.target.value) }), searching && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 py-4", children: [(0, jsx_runtime_1.jsxs)("svg", { className: "size-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), (0, jsx_runtime_1.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground text-sm", children: "Searching..." })] })), apps.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-2 sm:grid-cols-2 lg:grid-cols-3", children: apps.map((app) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 rounded-lg border p-3", children: [(0, jsx_runtime_1.jsx)(app_icon_1.AppIcon, { src: app.img_src, alt: app.name, className: "size-8" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("p", { className: "truncate text-sm font-medium", children: app.name }), isConnected(app.name_slug) && ((0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground text-xs", children: "Connected" }))] }), isConnected(app.name_slug) ? ((0, jsx_runtime_1.jsx)("span", { className: "bg-primary text-primary-foreground inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-medium", children: "Connected" })) : ((0, jsx_runtime_1.jsxs)("button", { className: (0, utils_1.cn)('inline-flex items-center rounded-md border px-3 py-1.5 text-sm font-medium', 'hover:bg-accent disabled:opacity-50'), onClick: () => onConnect(app), disabled: connecting === app.name_slug, children: [connecting === app.name_slug && ((0, jsx_runtime_1.jsxs)("svg", { className: "mr-1 size-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), (0, jsx_runtime_1.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })] })), "Connect"] }))] }, app.name_slug))) }))] }));
34
+ return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-medium", children: "Connect Apps" }), _jsx("p", { className: "text-muted-foreground text-xs", children: "Search and connect apps for your agent." })] }), _jsx("input", { className: "border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-sm transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", placeholder: "Search apps (e.g. Slack, Google Sheets, HubSpot)...", value: query, onChange: (e) => setQuery(e.target.value) }), searching && (_jsxs("div", { className: "flex items-center gap-2 py-4", children: [_jsx(Loader2, { className: "size-4 animate-spin" }), _jsx("span", { className: "text-muted-foreground text-sm", children: "Searching..." })] })), apps.length > 0 && (_jsx("div", { className: "grid gap-2 sm:grid-cols-2 lg:grid-cols-3", children: apps.map((app) => (_jsxs("div", { className: "flex items-center gap-3 rounded-lg border p-3", children: [_jsx(AppIcon, { src: app.img_src, alt: app.name, className: "size-8" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate text-sm font-medium", children: app.name }), isConnected(app.name_slug) && (_jsx("span", { className: "text-muted-foreground text-xs", children: "Connected" }))] }), isConnected(app.name_slug) ? (_jsx(Badge, { children: "Connected" })) : (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => onConnect(app), disabled: connecting === app.name_slug, children: [connecting === app.name_slug && (_jsx(Loader2, { className: "animate-spin" })), "Connect"] }))] }, app.name_slug))) }))] }));
36
35
  }
@@ -1,12 +1,15 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AvailableAppsList = AvailableAppsList;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const app_icon_1 = require("./app-icon");
7
- function AvailableAppsList({ connections, onConnect, connecting, }) {
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Link, Loader2 } from 'lucide-react';
4
+ import { AppIcon } from './app-icon';
5
+ import { Card, CardHeader, CardFooter } from '../ui/card';
6
+ import { Button } from '../ui/button';
7
+ export function AvailableAppsList({ connections, onConnect, connecting, }) {
8
8
  const available = connections.filter((c) => c.status !== 'connected');
9
9
  if (available.length === 0)
10
10
  return null;
11
- return ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: available.map((conn) => ((0, jsx_runtime_1.jsxs)("div", { className: "rounded-lg border p-4 transition-all hover:shadow-md", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-background flex size-12 shrink-0 items-center justify-center rounded-lg border p-2", children: (0, jsx_runtime_1.jsx)(app_icon_1.AppIcon, { src: conn.app?.img, icon: conn.app?.icon, alt: conn.app?.name, className: "size-full object-contain" }) }), (0, jsx_runtime_1.jsx)("div", { className: "min-w-0 flex-1", children: (0, jsx_runtime_1.jsx)("p", { className: "truncate text-base font-semibold", children: conn.app?.name }) })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => onConnect(conn), disabled: connecting === conn.appKey, className: "bg-primary text-primary-foreground hover:bg-primary/90 flex w-full items-center justify-center gap-2 rounded-md px-3 py-2 text-sm font-medium disabled:opacity-50", children: [(0, jsx_runtime_1.jsx)("svg", { className: "size-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" }) }), connecting === conn.appKey ? 'Connecting...' : 'Connect'] })] }, conn.id || conn.appKey))) }));
11
+ return (_jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: available.map((conn) => {
12
+ const isConnecting = connecting === conn.appKey;
13
+ return (_jsxs(Card, { className: "gap-4 py-4", children: [_jsxs(CardHeader, { className: "flex-row items-center gap-3", children: [_jsx("div", { className: "bg-background flex size-12 shrink-0 items-center justify-center rounded-lg border p-2", children: _jsx(AppIcon, { src: conn.app?.img, icon: conn.app?.icon, alt: conn.app?.name, className: "size-full object-contain" }) }), _jsx("p", { className: "min-w-0 flex-1 truncate text-base font-semibold", children: conn.app?.name })] }), _jsx(CardFooter, { children: _jsxs(Button, { className: "w-full", onClick: () => onConnect(conn), disabled: isConnecting, children: [isConnecting ? (_jsx(Loader2, { className: "animate-spin" })) : (_jsx(Link, {})), isConnecting ? 'Connecting...' : 'Connect'] }) })] }, conn.id || conn.appKey));
14
+ }) }));
12
15
  }
@@ -1,22 +1,21 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ConnectedAppsList = ConnectedAppsList;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const utils_1 = require("../../lib/utils");
7
- const app_icon_1 = require("./app-icon");
8
- function ConnectedAppsList({ connections, variant, onReimport, onDisconnect, reimporting, disconnecting, }) {
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Check, Loader2, RefreshCw, Unlink } from 'lucide-react';
4
+ import { AppIcon } from './app-icon';
5
+ import { Card, CardHeader, CardFooter, CardAction } from '../ui/card';
6
+ import { Badge } from '../ui/badge';
7
+ import { Button } from '../ui/button';
8
+ export function ConnectedAppsList({ connections, variant, onReimport, onDisconnect, reimporting, disconnecting, }) {
9
9
  const connected = connections.filter((c) => c.status === 'connected');
10
10
  if (connected.length === 0)
11
11
  return null;
12
12
  if (variant === 'badges') {
13
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-wrap gap-2", children: connected.map((conn) => ((0, jsx_runtime_1.jsxs)("span", { className: "bg-primary text-primary-foreground inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium", children: [(0, jsx_runtime_1.jsx)(app_icon_1.AppIcon, { src: conn.app?.img, icon: conn.app?.icon, alt: conn.app?.name, className: "size-4" }), conn.app?.name] }, conn.appKey))) }));
13
+ return (_jsx("div", { className: "flex flex-wrap gap-2", children: connected.map((conn) => (_jsxs(Badge, { children: [_jsx(AppIcon, { src: conn.app?.img, icon: conn.app?.icon, alt: conn.app?.name, className: "size-4" }), conn.app?.name] }, conn.appKey))) }));
14
14
  }
15
15
  // cards variant
16
- return ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: connected.map((conn) => ((0, jsx_runtime_1.jsxs)("div", { className: "relative rounded-lg border p-4 transition-all hover:shadow-md", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute top-0 right-0", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-primary/10 rounded-bl-lg p-2", children: (0, jsx_runtime_1.jsx)("svg", { className: "text-primary size-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-background flex size-12 shrink-0 items-center justify-center rounded-lg border p-2", children: (0, jsx_runtime_1.jsx)(app_icon_1.AppIcon, { src: conn.app?.img, icon: conn.app?.icon, alt: conn.app?.name, className: "size-full object-contain" }) }), (0, jsx_runtime_1.jsx)("div", { className: "min-w-0 flex-1", children: (0, jsx_runtime_1.jsx)("p", { className: "truncate text-base font-semibold", children: conn.app?.name }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "inline-flex w-full items-center justify-center rounded-md border px-2.5 py-0.5 text-xs font-medium", children: "Connected" }), onReimport && ((0, jsx_runtime_1.jsxs)("button", { onClick: () => onReimport(conn), disabled: reimporting === (conn.providerConnectionId || conn.appKey), className: (0, utils_1.cn)('flex w-full items-center justify-center gap-2 rounded-md border px-3 py-1.5 text-sm', 'hover:bg-accent disabled:opacity-50'), children: [(0, jsx_runtime_1.jsx)("svg", { className: (0, utils_1.cn)('size-4', reimporting === (conn.providerConnectionId || conn.appKey) &&
17
- 'animate-spin'), fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }) }), reimporting === (conn.providerConnectionId || conn.appKey)
18
- ? 'Reimporting...'
19
- : 'Reimport'] })), onDisconnect && ((0, jsx_runtime_1.jsxs)("button", { onClick: () => onDisconnect(conn), disabled: disconnecting === (conn.id || conn.appKey), className: (0, utils_1.cn)('text-destructive hover:text-destructive flex w-full items-center justify-center gap-2 rounded-md border px-3 py-1.5 text-sm', 'hover:bg-accent disabled:opacity-50'), children: [(0, jsx_runtime_1.jsx)("svg", { className: "size-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13.181 8.68a4 4 0 00-5.5-5.5M6.5 12.5l-2-2m8 8l-2-2m2-6l6 6m-2-6l2 2" }) }), disconnecting === (conn.id || conn.appKey)
20
- ? 'Disconnecting...'
21
- : 'Disconnect'] }))] })] }, conn.id || conn.appKey))) }));
16
+ return (_jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: connected.map((conn) => {
17
+ const isReimporting = reimporting === (conn.providerConnectionId || conn.appKey);
18
+ const isDisconnecting = disconnecting === (conn.id || conn.appKey);
19
+ return (_jsxs(Card, { className: "gap-4 py-4", children: [_jsxs(CardHeader, { className: "flex-row items-center gap-3", children: [_jsx("div", { className: "bg-background flex size-12 shrink-0 items-center justify-center rounded-lg border p-2", children: _jsx(AppIcon, { src: conn.app?.img, icon: conn.app?.icon, alt: conn.app?.name, className: "size-full object-contain" }) }), _jsx("p", { className: "min-w-0 flex-1 truncate text-base font-semibold", children: conn.app?.name }), _jsx(CardAction, { children: _jsxs(Badge, { variant: "outline", children: [_jsx(Check, { className: "size-3" }), "Connected"] }) })] }), _jsxs(CardFooter, { className: "gap-2", children: [onReimport && (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => onReimport(conn), disabled: isReimporting, children: [isReimporting ? (_jsx(Loader2, { className: "animate-spin" })) : (_jsx(RefreshCw, {})), isReimporting ? 'Reimporting...' : 'Reimport'] })), onDisconnect && (_jsxs(Button, { variant: "outline", size: "sm", className: "text-destructive hover:text-destructive", onClick: () => onDisconnect(conn), disabled: isDisconnecting, children: [isDisconnecting ? (_jsx(Loader2, { className: "animate-spin" })) : (_jsx(Unlink, {})), isDisconnecting ? 'Disconnecting...' : 'Disconnect'] }))] })] }, conn.id || conn.appKey));
20
+ }) }));
22
21
  }
@@ -1,18 +1,14 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useConnectionsApi = useConnectionsApi;
5
- exports.ConnectionsApiProvider = ConnectionsApiProvider;
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- const react_1 = require("react");
8
- const ConnectionsApiContext = (0, react_1.createContext)(null);
9
- function useConnectionsApi() {
10
- const api = (0, react_1.useContext)(ConnectionsApiContext);
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createContext, useContext } from 'react';
4
+ const ConnectionsApiContext = createContext(null);
5
+ export function useConnectionsApi() {
6
+ const api = useContext(ConnectionsApiContext);
11
7
  if (!api) {
12
8
  throw new Error('useConnectionsApi must be used within a ConnectionsApiProvider');
13
9
  }
14
10
  return api;
15
11
  }
16
- function ConnectionsApiProvider({ api, children, }) {
17
- return ((0, jsx_runtime_1.jsx)(ConnectionsApiContext.Provider, { value: api, children: children }));
12
+ export function ConnectionsApiProvider({ api, children, }) {
13
+ return (_jsx(ConnectionsApiContext.Provider, { value: api, children: children }));
18
14
  }
@@ -1,9 +1,7 @@
1
1
  import type { FaskConnection } from '../../types/connections';
2
2
  interface ConnectionsPanelProps {
3
3
  variant: 'full-page' | 'compact';
4
- showSearch?: boolean;
5
- showReimport?: boolean;
6
4
  onConnectionsLoaded?: (connections: FaskConnection[]) => void;
7
5
  }
8
- export declare function ConnectionsPanel({ variant, showSearch, showReimport, onConnectionsLoaded, }: ConnectionsPanelProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ConnectionsPanel({ variant, onConnectionsLoaded, }: ConnectionsPanelProps): import("react/jsx-runtime").JSX.Element;
9
7
  export {};
@@ -1,46 +1,36 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ConnectionsPanel = ConnectionsPanel;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const connections_api_provider_1 = require("./connections-api-provider");
8
- const connected_apps_list_1 = require("./connected-apps-list");
9
- const available_apps_list_1 = require("./available-apps-list");
10
- const app_search_grid_1 = require("./app-search-grid");
11
- function ConnectionsPanel({ variant, showSearch, showReimport, onConnectionsLoaded, }) {
12
- const api = (0, connections_api_provider_1.useConnectionsApi)();
13
- const [connections, setConnections] = (0, react_1.useState)([]);
14
- const [loading, setLoading] = (0, react_1.useState)(true);
15
- const [connecting, setConnecting] = (0, react_1.useState)(null);
16
- const [reimporting, setReimporting] = (0, react_1.useState)(null);
17
- const [disconnecting, setDisconnecting] = (0, react_1.useState)(null);
18
- const prevConnectionsRef = (0, react_1.useRef)([]);
19
- const pollIntervalRef = (0, react_1.useRef)(null);
20
- const loadData = (0, react_1.useCallback)(async () => {
21
- setLoading(true);
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useState } from 'react';
4
+ import { createFrontendClient } from '@pipedream/sdk/browser';
5
+ import { useConnectionsApi } from './connections-api-provider';
6
+ import { ConnectedAppsList } from './connected-apps-list';
7
+ import { AvailableAppsList } from './available-apps-list';
8
+ import { AppSearchGrid } from './app-search-grid';
9
+ import { Card } from '../ui/card';
10
+ export function ConnectionsPanel({ variant, onConnectionsLoaded, }) {
11
+ const api = useConnectionsApi();
12
+ const [connections, setConnections] = useState([]);
13
+ const [initialApps, setInitialApps] = useState([]);
14
+ const [loading, setLoading] = useState(true);
15
+ const [connecting, setConnecting] = useState(null);
16
+ const [disconnecting, setDisconnecting] = useState(null);
17
+ const loadData = useCallback(async () => {
22
18
  const conns = await api.getConnections();
23
- // Salesforce polling detection
24
- const wasConnected = prevConnectionsRef.current.some((c) => c.appKey === 'salesforce' && c.status === 'connected');
25
- const isConnected = conns.some((c) => c.appKey === 'salesforce' && c.status === 'connected');
26
- if (prevConnectionsRef.current.length > 0 &&
27
- !wasConnected &&
28
- isConnected) {
29
- if (pollIntervalRef.current)
30
- clearInterval(pollIntervalRef.current);
31
- }
32
- prevConnectionsRef.current = conns;
33
19
  setConnections(conns);
34
20
  onConnectionsLoaded?.(conns);
35
- setLoading(false);
36
21
  }, [api, onConnectionsLoaded]);
37
- (0, react_1.useEffect)(() => {
38
- loadData();
39
- return () => {
40
- if (pollIntervalRef.current)
41
- clearInterval(pollIntervalRef.current);
42
- };
43
- }, [loadData]);
22
+ useEffect(() => {
23
+ async function init() {
24
+ setLoading(true);
25
+ const [, apps] = await Promise.all([
26
+ loadData(),
27
+ api.searchApps(''),
28
+ ]);
29
+ setInitialApps(apps);
30
+ setLoading(false);
31
+ }
32
+ init();
33
+ }, [loadData, api]);
44
34
  const connectedAppKeys = connections
45
35
  .filter((c) => c.status === 'connected')
46
36
  .map((c) => c.appKey);
@@ -48,34 +38,28 @@ function ConnectionsPanel({ variant, showSearch, showReimport, onConnectionsLoad
48
38
  const appKey = 'appKey' in app ? app.appKey : app.name_slug;
49
39
  setConnecting(appKey);
50
40
  try {
51
- const response = await api.connect(app);
52
- window.open(response.connect_link, '_blank', 'width=600,height=700');
53
- if (appKey === 'salesforce') {
54
- prevConnectionsRef.current = connections;
55
- pollIntervalRef.current = setInterval(loadData, 2000);
56
- setTimeout(() => {
57
- if (pollIntervalRef.current)
58
- clearInterval(pollIntervalRef.current);
59
- }, 60000);
60
- }
61
- else {
62
- setTimeout(loadData, 3000);
63
- }
41
+ const { token, expiresAt } = await api.getConnectToken(appKey);
42
+ const pd = createFrontendClient({
43
+ externalUserId: 'user',
44
+ tokenCallback: async () => ({
45
+ token,
46
+ expiresAt: new Date(expiresAt),
47
+ connectLinkUrl: '',
48
+ }),
49
+ });
50
+ await new Promise((resolve, reject) => {
51
+ pd.connectAccount({
52
+ app: appKey,
53
+ onSuccess: () => resolve(),
54
+ onError: (err) => reject(err),
55
+ });
56
+ });
57
+ await loadData();
64
58
  }
65
59
  finally {
66
60
  setConnecting(null);
67
61
  }
68
62
  }
69
- async function handleReimport(conn) {
70
- const key = conn.providerConnectionId || conn.appKey;
71
- setReimporting(key);
72
- try {
73
- await api.reimport?.(conn.providerConnectionId, conn.appKey);
74
- }
75
- finally {
76
- setReimporting(null);
77
- }
78
- }
79
63
  async function handleDisconnect(conn) {
80
64
  const key = conn.id || conn.appKey;
81
65
  setDisconnecting(key);
@@ -87,29 +71,11 @@ function ConnectionsPanel({ variant, showSearch, showReimport, onConnectionsLoad
87
71
  setDisconnecting(null);
88
72
  }
89
73
  }
90
- async function handleSearchConnect(app) {
91
- await handleConnect(app);
92
- }
93
74
  if (loading) {
94
- return ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: [1, 2, 3].map((i) => ((0, jsx_runtime_1.jsx)("div", { className: "bg-muted/50 h-20 animate-pulse rounded-lg" }, i))) }));
75
+ return (_jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: [1, 2, 3].map((i) => (_jsx(Card, { className: "h-28 animate-pulse bg-muted/50" }, i))) }));
95
76
  }
96
77
  if (variant === 'compact') {
97
- const availableAppsWithActions = connections.filter((c) => c.status !== 'connected' && c.actions && c.actions.length > 0);
98
- return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-6", children: [(connectedAppKeys.length > 0 ||
99
- availableAppsWithActions.length > 0) && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-sm font-medium", children: "Connected Apps" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-2", children: [connections
100
- .filter((c) => c.status === 'connected')
101
- .map((conn) => ((0, jsx_runtime_1.jsxs)("span", { className: "bg-primary text-primary-foreground inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium", children: [(0, jsx_runtime_1.jsx)(AppIconInline, { src: conn.app?.img, icon: conn.app?.icon, alt: conn.app?.name }), conn.app?.name] }, conn.appKey))), availableAppsWithActions.map((conn) => ((0, jsx_runtime_1.jsxs)("span", { className: "bg-secondary text-secondary-foreground inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium opacity-60", children: [(0, jsx_runtime_1.jsx)(AppIconInline, { src: conn.app?.img, icon: conn.app?.icon, alt: conn.app?.name }), conn.app?.name, (0, jsx_runtime_1.jsx)("span", { className: "text-[10px]", children: "Not connected" })] }, conn.appKey)))] })] })), showSearch && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("hr", { className: "border-border" }), (0, jsx_runtime_1.jsx)(app_search_grid_1.AppSearchGrid, { connectedAppKeys: connectedAppKeys, onSearch: (q) => api.searchApps(q), onConnect: handleSearchConnect, connecting: connecting })] }))] }));
102
- }
103
- // full-page variant
104
- return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-6", children: [(0, jsx_runtime_1.jsx)(connected_apps_list_1.ConnectedAppsList, { connections: connections, variant: "cards", onReimport: showReimport ? handleReimport : undefined, onDisconnect: handleDisconnect, reimporting: reimporting, disconnecting: disconnecting }), (0, jsx_runtime_1.jsx)(available_apps_list_1.AvailableAppsList, { connections: connections, onConnect: handleConnect, connecting: connecting }), showSearch && ((0, jsx_runtime_1.jsx)(app_search_grid_1.AppSearchGrid, { connectedAppKeys: connectedAppKeys, onSearch: (q) => api.searchApps(q), onConnect: handleSearchConnect, connecting: connecting }))] }));
105
- }
106
- /**
107
- * Tiny inline icon for badge usage (avoids importing the full AppIcon component tree).
108
- */
109
- function AppIconInline({ src, icon, alt, }) {
110
- if (src) {
111
- return (0, jsx_runtime_1.jsx)("img", { src: src, alt: alt, className: "size-4 rounded" });
78
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(ConnectedAppsList, { connections: connections, variant: "badges", onDisconnect: handleDisconnect, disconnecting: disconnecting }), _jsx(AppSearchGrid, { connectedAppKeys: connectedAppKeys, onSearch: (q) => api.searchApps(q), onConnect: (app) => handleConnect(app), connecting: connecting, initialApps: initialApps })] }));
112
79
  }
113
- // For badges, just show a small placeholder square
114
- return ((0, jsx_runtime_1.jsx)("span", { className: "bg-muted-foreground/20 inline-block size-4 rounded" }));
80
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(ConnectedAppsList, { connections: connections, variant: "cards", onDisconnect: handleDisconnect, disconnecting: disconnecting }), _jsx(AvailableAppsList, { connections: connections, onConnect: handleConnect, connecting: connecting }), _jsx(AppSearchGrid, { connectedAppKeys: connectedAppKeys, onSearch: (q) => api.searchApps(q), onConnect: (app) => handleConnect(app), connecting: connecting, initialApps: initialApps })] }));
115
81
  }
@@ -1,17 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.GTMProvider = GTMProvider;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const script_1 = __importDefault(require("next/script"));
9
- function GTMProvider({ gtmId, children }) {
10
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(script_1.default, { id: "gtm-head", strategy: "afterInteractive", children: `
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Script from 'next/script';
3
+ export function GTMProvider({ gtmId, children }) {
4
+ return (_jsxs(_Fragment, { children: [_jsx(Script, { id: "gtm-head", strategy: "afterInteractive", children: `
11
5
  (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
12
6
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
13
7
  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
14
8
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
15
9
  })(window,document,'script','dataLayer','${gtmId}');
16
- ` }), (0, jsx_runtime_1.jsx)("noscript", { children: (0, jsx_runtime_1.jsx)("iframe", { src: `https://www.googletagmanager.com/ns.html?id=${gtmId}`, height: "0", width: "0", style: { display: 'none', visibility: 'hidden' } }) }), children] }));
10
+ ` }), _jsx("noscript", { children: _jsx("iframe", { src: `https://www.googletagmanager.com/ns.html?id=${gtmId}`, height: "0", width: "0", style: { display: 'none', visibility: 'hidden' } }) }), children] }));
17
11
  }
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
+ asChild?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import { cva } from 'class-variance-authority';
4
+ import { cn } from '../../lib/utils';
5
+ const badgeVariants = cva('inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
6
+ variants: {
7
+ variant: {
8
+ default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
9
+ secondary: 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
10
+ destructive: 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
11
+ outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
12
+ },
13
+ },
14
+ defaultVariants: {
15
+ variant: 'default',
16
+ },
17
+ });
18
+ function Badge({ className, variant, asChild = false, ...props }) {
19
+ const Comp = asChild ? Slot : 'span';
20
+ return (_jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props }));
21
+ }
22
+ export { Badge, badgeVariants };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
5
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import { cva } from 'class-variance-authority';
4
+ import { cn } from '../../lib/utils';
5
+ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
6
+ variants: {
7
+ variant: {
8
+ default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
9
+ destructive: 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
10
+ outline: 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
11
+ secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
12
+ ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
13
+ link: 'text-primary underline-offset-4 hover:underline',
14
+ },
15
+ size: {
16
+ default: 'h-9 px-4 py-2 has-[>svg]:px-3',
17
+ sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
18
+ lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
19
+ icon: 'size-9',
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ variant: 'default',
24
+ size: 'default',
25
+ },
26
+ });
27
+ function Button({ className, variant, size, asChild = false, ...props }) {
28
+ const Comp = asChild ? Slot : 'button';
29
+ return (_jsx(Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
30
+ }
31
+ export { Button, buttonVariants };
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ declare function Card({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
3
+ declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
4
+ declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
5
+ declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
6
+ declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
7
+ declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
8
+ declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
9
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ function Card({ className, ...props }) {
4
+ return (_jsx("div", { "data-slot": "card", className: cn('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className), ...props }));
5
+ }
6
+ function CardHeader({ className, ...props }) {
7
+ return (_jsx("div", { "data-slot": "card-header", className: cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6', className), ...props }));
8
+ }
9
+ function CardTitle({ className, ...props }) {
10
+ return (_jsx("div", { "data-slot": "card-title", className: cn('leading-none font-semibold', className), ...props }));
11
+ }
12
+ function CardDescription({ className, ...props }) {
13
+ return (_jsx("div", { "data-slot": "card-description", className: cn('text-muted-foreground text-sm', className), ...props }));
14
+ }
15
+ function CardAction({ className, ...props }) {
16
+ return (_jsx("div", { "data-slot": "card-action", className: cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className), ...props }));
17
+ }
18
+ function CardContent({ className, ...props }) {
19
+ return (_jsx("div", { "data-slot": "card-content", className: cn('px-6', className), ...props }));
20
+ }
21
+ function CardFooter({ className, ...props }) {
22
+ return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center px-6 [.border-t]:pt-6', className), ...props }));
23
+ }
24
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.betaOfferData = void 0;
4
- exports.betaOfferData = {
1
+ export const betaOfferData = {
5
2
  badge: 'LIMITED TIME',
6
3
  title: 'Beta Launch Special',
7
4
  description: 'Join our exclusive Beta program and get direct access to our founders.',
package/dist/index.d.ts CHANGED
@@ -8,4 +8,7 @@ export { AppSearchGrid } from './components/connections/app-search-grid';
8
8
  export { ConnectionsPanel } from './components/connections/connections-panel';
9
9
  export type { FaskConnection, FaskSearchableApp } from './types/connections';
10
10
  export type { ConnectionsApi } from './types/connections-api';
11
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from './components/ui/card';
12
+ export { Badge, badgeVariants } from './components/ui/badge';
13
+ export { Button, buttonVariants } from './components/ui/button';
11
14
  export { cn } from './lib/utils';
package/dist/index.js CHANGED
@@ -1,24 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cn = exports.ConnectionsPanel = exports.AppSearchGrid = exports.AvailableAppsList = exports.ConnectedAppsList = exports.AppIcon = exports.useConnectionsApi = exports.ConnectionsApiProvider = exports.betaOfferData = exports.GTMProvider = void 0;
4
- var gtm_provider_1 = require("./components/gtm/gtm-provider");
5
- Object.defineProperty(exports, "GTMProvider", { enumerable: true, get: function () { return gtm_provider_1.GTMProvider; } });
6
- var betaMarketingData_1 = require("./data/betaMarketingData");
7
- Object.defineProperty(exports, "betaOfferData", { enumerable: true, get: function () { return betaMarketingData_1.betaOfferData; } });
1
+ export { GTMProvider } from './components/gtm/gtm-provider';
2
+ export { betaOfferData } from './data/betaMarketingData';
8
3
  // Connections
9
- var connections_api_provider_1 = require("./components/connections/connections-api-provider");
10
- Object.defineProperty(exports, "ConnectionsApiProvider", { enumerable: true, get: function () { return connections_api_provider_1.ConnectionsApiProvider; } });
11
- Object.defineProperty(exports, "useConnectionsApi", { enumerable: true, get: function () { return connections_api_provider_1.useConnectionsApi; } });
12
- var app_icon_1 = require("./components/connections/app-icon");
13
- Object.defineProperty(exports, "AppIcon", { enumerable: true, get: function () { return app_icon_1.AppIcon; } });
14
- var connected_apps_list_1 = require("./components/connections/connected-apps-list");
15
- Object.defineProperty(exports, "ConnectedAppsList", { enumerable: true, get: function () { return connected_apps_list_1.ConnectedAppsList; } });
16
- var available_apps_list_1 = require("./components/connections/available-apps-list");
17
- Object.defineProperty(exports, "AvailableAppsList", { enumerable: true, get: function () { return available_apps_list_1.AvailableAppsList; } });
18
- var app_search_grid_1 = require("./components/connections/app-search-grid");
19
- Object.defineProperty(exports, "AppSearchGrid", { enumerable: true, get: function () { return app_search_grid_1.AppSearchGrid; } });
20
- var connections_panel_1 = require("./components/connections/connections-panel");
21
- Object.defineProperty(exports, "ConnectionsPanel", { enumerable: true, get: function () { return connections_panel_1.ConnectionsPanel; } });
4
+ export { ConnectionsApiProvider, useConnectionsApi, } from './components/connections/connections-api-provider';
5
+ export { AppIcon } from './components/connections/app-icon';
6
+ export { ConnectedAppsList } from './components/connections/connected-apps-list';
7
+ export { AvailableAppsList } from './components/connections/available-apps-list';
8
+ export { AppSearchGrid } from './components/connections/app-search-grid';
9
+ export { ConnectionsPanel } from './components/connections/connections-panel';
10
+ // UI primitives (shadcn)
11
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from './components/ui/card';
12
+ export { Badge, badgeVariants } from './components/ui/badge';
13
+ export { Button, buttonVariants } from './components/ui/button';
22
14
  // Utilities
23
- var utils_1 = require("./lib/utils");
24
- Object.defineProperty(exports, "cn", { enumerable: true, get: function () { return utils_1.cn; } });
15
+ export { cn } from './lib/utils';
package/dist/lib/utils.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cn = cn;
4
- const clsx_1 = require("clsx");
5
- const tailwind_merge_1 = require("tailwind-merge");
6
- function cn(...inputs) {
7
- return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
8
5
  }
@@ -2,9 +2,9 @@ import type { FaskConnection, FaskSearchableApp } from './connections';
2
2
  export interface ConnectionsApi {
3
3
  getConnections(): Promise<FaskConnection[]>;
4
4
  searchApps(query: string): Promise<FaskSearchableApp[]>;
5
- connect(app: FaskConnection | FaskSearchableApp): Promise<{
6
- connect_link: string;
5
+ getConnectToken(appKey: string): Promise<{
6
+ token: string;
7
+ expiresAt: string;
7
8
  }>;
8
9
  disconnect(connectionId: string): Promise<void>;
9
- reimport?(connectionId: string, appKey: string): Promise<void>;
10
10
  }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@faskai/ui-commons",
3
3
  "author": "Fask AI <arko@fask.ai>",
4
- "version": "0.0.0-alpha.24",
4
+ "version": "0.0.0-alpha.26",
5
5
  "description": "Common UI components for Fask applications.",
6
6
  "private": false,
7
7
  "main": "dist/index.js",
@@ -14,6 +14,9 @@
14
14
  "build": "tsc"
15
15
  },
16
16
  "peerDependencies": {
17
+ "@pipedream/sdk": ">=2.3.0",
18
+ "@radix-ui/react-slot": ">=1.0.0",
19
+ "class-variance-authority": ">=0.7.0",
17
20
  "clsx": ">=2.0.0",
18
21
  "lucide-react": ">=0.300.0",
19
22
  "next": ">=13.0.0",
@@ -21,7 +24,10 @@
21
24
  "tailwind-merge": ">=2.0.0"
22
25
  },
23
26
  "devDependencies": {
27
+ "@pipedream/sdk": "^2.3.6",
28
+ "@radix-ui/react-slot": "^1.1.0",
24
29
  "@types/react": "^18.0.0",
30
+ "class-variance-authority": "^0.7.0",
25
31
  "clsx": "^2.1.0",
26
32
  "lucide-react": "^0.400.0",
27
33
  "next": "^14.0.0",