@faskai/ui-commons 0.0.0-alpha.25 → 0.0.0-alpha.27

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,19 +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 lucide_react_1 = require("lucide-react");
8
- const app_icon_1 = require("./app-icon");
9
- const badge_1 = require("../ui/badge");
10
- const button_1 = require("../ui/button");
11
- function AppSearchGrid({ connectedAppKeys, onSearch, onConnect, connecting, initialApps, }) {
12
- const [query, setQuery] = (0, react_1.useState)('');
13
- const [apps, setApps] = (0, react_1.useState)(initialApps || []);
14
- const [searching, setSearching] = (0, react_1.useState)(false);
15
- const debounceRef = (0, react_1.useRef)(null);
16
- (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(() => {
17
14
  if (debounceRef.current)
18
15
  clearTimeout(debounceRef.current);
19
16
  debounceRef.current = setTimeout(async () => {
@@ -34,5 +31,5 @@ function AppSearchGrid({ connectedAppKeys, onSearch, onConnect, connecting, init
34
31
  function isConnected(slug) {
35
32
  return connectedAppKeys.includes(slug);
36
33
  }
37
- 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.jsx)(lucide_react_1.Loader2, { className: "size-4 animate-spin" }), (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)(badge_1.Badge, { children: "Connected" })) : ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: () => onConnect(app), disabled: connecting === app.name_slug, children: [connecting === app.name_slug && ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "animate-spin" })), "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))) }))] }));
38
35
  }
@@ -1,18 +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 lucide_react_1 = require("lucide-react");
7
- const app_icon_1 = require("./app-icon");
8
- const card_1 = require("../ui/card");
9
- const button_1 = require("../ui/button");
10
- 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, }) {
11
8
  const available = connections.filter((c) => c.status !== 'connected');
12
9
  if (available.length === 0)
13
10
  return null;
14
- return ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: available.map((conn) => {
11
+ return (_jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: available.map((conn) => {
15
12
  const isConnecting = connecting === conn.appKey;
16
- return ((0, jsx_runtime_1.jsxs)(card_1.Card, { className: "gap-4 py-4", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { className: "flex-row 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)("p", { className: "min-w-0 flex-1 truncate text-base font-semibold", children: conn.app?.name })] }), (0, jsx_runtime_1.jsx)(card_1.CardFooter, { children: (0, jsx_runtime_1.jsxs)(button_1.Button, { className: "w-full", onClick: () => onConnect(conn), disabled: isConnecting, children: [isConnecting ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "animate-spin" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Link, {})), isConnecting ? 'Connecting...' : 'Connect'] }) })] }, conn.id || 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));
17
14
  }) }));
18
15
  }
@@ -1,24 +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 lucide_react_1 = require("lucide-react");
7
- const app_icon_1 = require("./app-icon");
8
- const card_1 = require("../ui/card");
9
- const badge_1 = require("../ui/badge");
10
- const button_1 = require("../ui/button");
11
- 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, }) {
12
9
  const connected = connections.filter((c) => c.status === 'connected');
13
10
  if (connected.length === 0)
14
11
  return null;
15
12
  if (variant === 'badges') {
16
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-wrap gap-2", children: connected.map((conn) => ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { 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))) }));
17
14
  }
18
15
  // cards variant
19
- return ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: connected.map((conn) => {
16
+ return (_jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: connected.map((conn) => {
20
17
  const isReimporting = reimporting === (conn.providerConnectionId || conn.appKey);
21
18
  const isDisconnecting = disconnecting === (conn.id || conn.appKey);
22
- return ((0, jsx_runtime_1.jsxs)(card_1.Card, { className: "gap-4 py-4", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { className: "flex-row 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)("p", { className: "min-w-0 flex-1 truncate text-base font-semibold", children: conn.app?.name }), (0, jsx_runtime_1.jsx)(card_1.CardAction, { children: (0, jsx_runtime_1.jsxs)(badge_1.Badge, { variant: "outline", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "size-3" }), "Connected"] }) })] }), (0, jsx_runtime_1.jsxs)(card_1.CardFooter, { className: "gap-2", children: [onReimport && ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: () => onReimport(conn), disabled: isReimporting, children: [isReimporting ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "animate-spin" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, {})), isReimporting ? 'Reimporting...' : 'Reimport'] })), onDisconnect && ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "text-destructive hover:text-destructive", onClick: () => onDisconnect(conn), disabled: isDisconnecting, children: [isDisconnecting ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "animate-spin" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Unlink, {})), isDisconnecting ? 'Disconnecting...' : 'Disconnect'] }))] })] }, 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));
23
20
  }) }));
24
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,8 +1,7 @@
1
1
  import type { FaskConnection } from '../../types/connections';
2
2
  interface ConnectionsPanelProps {
3
3
  variant: 'full-page' | 'compact';
4
- showSearch?: boolean;
5
4
  onConnectionsLoaded?: (connections: FaskConnection[]) => void;
6
5
  }
7
- export declare function ConnectionsPanel({ variant, showSearch, onConnectionsLoaded, }: ConnectionsPanelProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ConnectionsPanel({ variant, onConnectionsLoaded, }: ConnectionsPanelProps): import("react/jsx-runtime").JSX.Element;
8
7
  export {};
@@ -1,48 +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
- const app_icon_1 = require("./app-icon");
12
- const badge_1 = require("../ui/badge");
13
- const card_1 = require("../ui/card");
14
- function ConnectionsPanel({ variant, showSearch, onConnectionsLoaded, }) {
15
- const api = (0, connections_api_provider_1.useConnectionsApi)();
16
- const [connections, setConnections] = (0, react_1.useState)([]);
17
- const [loading, setLoading] = (0, react_1.useState)(true);
18
- const [connecting, setConnecting] = (0, react_1.useState)(null);
19
- const [disconnecting, setDisconnecting] = (0, react_1.useState)(null);
20
- const prevConnectionsRef = (0, react_1.useRef)([]);
21
- const pollIntervalRef = (0, react_1.useRef)(null);
22
- const loadData = (0, react_1.useCallback)(async () => {
23
- 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 () => {
24
18
  const conns = await api.getConnections();
25
- // Salesforce polling detection
26
- const wasConnected = prevConnectionsRef.current.some((c) => c.appKey === 'salesforce' && c.status === 'connected');
27
- const isConnected = conns.some((c) => c.appKey === 'salesforce' && c.status === 'connected');
28
- if (prevConnectionsRef.current.length > 0 &&
29
- !wasConnected &&
30
- isConnected) {
31
- if (pollIntervalRef.current)
32
- clearInterval(pollIntervalRef.current);
33
- }
34
- prevConnectionsRef.current = conns;
35
19
  setConnections(conns);
36
20
  onConnectionsLoaded?.(conns);
37
- setLoading(false);
38
21
  }, [api, onConnectionsLoaded]);
39
- (0, react_1.useEffect)(() => {
40
- loadData();
41
- return () => {
42
- if (pollIntervalRef.current)
43
- clearInterval(pollIntervalRef.current);
44
- };
45
- }, [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]);
46
34
  const connectedAppKeys = connections
47
35
  .filter((c) => c.status === 'connected')
48
36
  .map((c) => c.appKey);
@@ -50,19 +38,23 @@ function ConnectionsPanel({ variant, showSearch, onConnectionsLoaded, }) {
50
38
  const appKey = 'appKey' in app ? app.appKey : app.name_slug;
51
39
  setConnecting(appKey);
52
40
  try {
53
- const response = await api.connect(app);
54
- window.open(response.connect_link, '_blank', 'width=600,height=700');
55
- if (appKey === 'salesforce') {
56
- prevConnectionsRef.current = connections;
57
- pollIntervalRef.current = setInterval(loadData, 2000);
58
- setTimeout(() => {
59
- if (pollIntervalRef.current)
60
- clearInterval(pollIntervalRef.current);
61
- }, 60000);
62
- }
63
- else {
64
- setTimeout(loadData, 3000);
65
- }
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();
66
58
  }
67
59
  finally {
68
60
  setConnecting(null);
@@ -79,19 +71,11 @@ function ConnectionsPanel({ variant, showSearch, onConnectionsLoaded, }) {
79
71
  setDisconnecting(null);
80
72
  }
81
73
  }
82
- async function handleSearchConnect(app) {
83
- await handleConnect(app);
84
- }
85
74
  if (loading) {
86
- return ((0, jsx_runtime_1.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: [1, 2, 3].map((i) => ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "h-28 animate-pulse bg-muted/50" }, 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))) }));
87
76
  }
88
77
  if (variant === 'compact') {
89
- const availableAppsWithActions = connections.filter((c) => c.status !== 'connected' && c.actions && c.actions.length > 0);
90
- return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-6", children: [(connectedAppKeys.length > 0 ||
91
- 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
92
- .filter((c) => c.status === 'connected')
93
- .map((conn) => ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { 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))), availableAppsWithActions.map((conn) => ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { variant: "secondary", className: "opacity-60", 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, (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 })] }))] }));
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 })] }));
94
79
  }
95
- // full-page variant
96
- 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", onDisconnect: handleDisconnect, 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 }))] }));
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 })] }));
97
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,10 @@
1
+ import * as React from 'react';
2
+ declare const GRID_STYLES: {
3
+ readonly 2: "grid-cols-1 gap-4 sm:grid-cols-2";
4
+ readonly 3: "grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3";
5
+ readonly 4: "grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3 xl:grid-cols-4";
6
+ };
7
+ declare function Grid({ columns, className, ...props }: React.ComponentProps<'div'> & {
8
+ columns: keyof typeof GRID_STYLES;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Grid };
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ const GRID_STYLES = {
4
+ 2: 'grid-cols-1 gap-4 sm:grid-cols-2',
5
+ 3: 'grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3',
6
+ 4: 'grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3 xl:grid-cols-4',
7
+ };
8
+ function Grid({ columns, className, ...props }) {
9
+ return (_jsx("div", { "data-slot": "grid", className: cn('grid', GRID_STYLES[columns], className), ...props }));
10
+ }
11
+ export { Grid };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare function Row({ gap, fill, wrap, className, ...props }: React.ComponentProps<'div'> & {
3
+ gap?: 0 | 1 | 1.5 | 2 | 3 | 4 | 6 | 8;
4
+ fill?: boolean;
5
+ wrap?: boolean;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export { Row };
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ const GAP_MAP = {
4
+ 0: 'gap-0',
5
+ 1: 'gap-1',
6
+ 1.5: 'gap-1.5',
7
+ 2: 'gap-2',
8
+ 3: 'gap-3',
9
+ 4: 'gap-4',
10
+ 6: 'gap-6',
11
+ 8: 'gap-8',
12
+ };
13
+ function Row({ gap = 2, fill = false, wrap = false, className, ...props }) {
14
+ return (_jsx("div", { "data-slot": "row", className: cn('flex flex-row min-w-0 overflow-hidden items-center', GAP_MAP[gap], fill && 'flex-1', wrap && 'flex-wrap', className), ...props }));
15
+ }
16
+ export { Row };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ declare function SplitView({ desktop, mobile, className, ...props }: Omit<React.ComponentProps<'div'>, 'children'> & {
3
+ desktop: React.ReactNode;
4
+ mobile: React.ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export { SplitView };
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ function SplitView({ desktop, mobile, className, ...props }) {
4
+ return (_jsxs("div", { "data-slot": "split-view", className: cn('flex min-h-0 flex-1 flex-col', className), ...props, children: [_jsx("div", { className: "hidden min-h-0 flex-1 overflow-hidden lg:block", children: desktop }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col lg:hidden", children: mobile })] }));
5
+ }
6
+ export { SplitView };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ declare function Stack({ gap, fill, className, ...props }: React.ComponentProps<'div'> & {
3
+ gap?: 0 | 1 | 1.5 | 2 | 3 | 4 | 6 | 8;
4
+ fill?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export { Stack };
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ const GAP_MAP = {
4
+ 0: 'gap-0',
5
+ 1: 'gap-1',
6
+ 1.5: 'gap-1.5',
7
+ 2: 'gap-2',
8
+ 3: 'gap-3',
9
+ 4: 'gap-4',
10
+ 6: 'gap-6',
11
+ 8: 'gap-8',
12
+ };
13
+ function Stack({ gap = 4, fill = false, className, ...props }) {
14
+ return (_jsx("div", { "data-slot": "stack", className: cn('flex flex-col min-h-0 overflow-hidden', GAP_MAP[gap], fill && 'flex-1', className), ...props }));
15
+ }
16
+ export { Stack };
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const badgeVariants: (props?: ({
4
4
  variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
5
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
7
  asChild?: boolean;
8
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.badgeVariants = void 0;
4
- exports.Badge = Badge;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_slot_1 = require("@radix-ui/react-slot");
7
- const class_variance_authority_1 = require("class-variance-authority");
8
- const utils_1 = require("../../lib/utils");
9
- const badgeVariants = (0, class_variance_authority_1.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', {
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', {
10
6
  variants: {
11
7
  variant: {
12
8
  default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
@@ -19,8 +15,8 @@ const badgeVariants = (0, class_variance_authority_1.cva)('inline-flex items-cen
19
15
  variant: 'default',
20
16
  },
21
17
  });
22
- exports.badgeVariants = badgeVariants;
23
18
  function Badge({ className, variant, asChild = false, ...props }) {
24
- const Comp = asChild ? react_slot_1.Slot : 'span';
25
- return ((0, jsx_runtime_1.jsx)(Comp, { "data-slot": "badge", className: (0, utils_1.cn)(badgeVariants({ variant }), className), ...props }));
19
+ const Comp = asChild ? Slot : 'span';
20
+ return (_jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props }));
26
21
  }
22
+ export { Badge, badgeVariants };
@@ -3,7 +3,7 @@ import { type VariantProps } from 'class-variance-authority';
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
5
5
  size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
8
  asChild?: boolean;
9
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buttonVariants = void 0;
4
- exports.Button = Button;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_slot_1 = require("@radix-ui/react-slot");
7
- const class_variance_authority_1 = require("class-variance-authority");
8
- const utils_1 = require("../../lib/utils");
9
- const buttonVariants = (0, class_variance_authority_1.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", {
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", {
10
6
  variants: {
11
7
  variant: {
12
8
  default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
@@ -28,8 +24,8 @@ const buttonVariants = (0, class_variance_authority_1.cva)("inline-flex items-ce
28
24
  size: 'default',
29
25
  },
30
26
  });
31
- exports.buttonVariants = buttonVariants;
32
27
  function Button({ className, variant, size, asChild = false, ...props }) {
33
- const Comp = asChild ? react_slot_1.Slot : 'button';
34
- return ((0, jsx_runtime_1.jsx)(Comp, { "data-slot": "button", className: (0, utils_1.cn)(buttonVariants({ variant, size, className })), ...props }));
28
+ const Comp = asChild ? Slot : 'button';
29
+ return (_jsx(Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
35
30
  }
31
+ export { Button, buttonVariants };
@@ -1,32 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Card = Card;
4
- exports.CardHeader = CardHeader;
5
- exports.CardFooter = CardFooter;
6
- exports.CardTitle = CardTitle;
7
- exports.CardAction = CardAction;
8
- exports.CardDescription = CardDescription;
9
- exports.CardContent = CardContent;
10
- const jsx_runtime_1 = require("react/jsx-runtime");
11
- const utils_1 = require("../../lib/utils");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
12
3
  function Card({ className, ...props }) {
13
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card", className: (0, utils_1.cn)('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', 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 }));
14
5
  }
15
6
  function CardHeader({ className, ...props }) {
16
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-header", className: (0, utils_1.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 }));
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 }));
17
8
  }
18
9
  function CardTitle({ className, ...props }) {
19
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-title", className: (0, utils_1.cn)('leading-none font-semibold', className), ...props }));
10
+ return (_jsx("div", { "data-slot": "card-title", className: cn('leading-none font-semibold', className), ...props }));
20
11
  }
21
12
  function CardDescription({ className, ...props }) {
22
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-description", className: (0, utils_1.cn)('text-muted-foreground text-sm', className), ...props }));
13
+ return (_jsx("div", { "data-slot": "card-description", className: cn('text-muted-foreground text-sm', className), ...props }));
23
14
  }
24
15
  function CardAction({ className, ...props }) {
25
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-action", className: (0, utils_1.cn)('col-start-2 row-span-2 row-start-1 self-start justify-self-end', 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 }));
26
17
  }
27
18
  function CardContent({ className, ...props }) {
28
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-content", className: (0, utils_1.cn)('px-6', className), ...props }));
19
+ return (_jsx("div", { "data-slot": "card-content", className: cn('px-6', className), ...props }));
29
20
  }
30
21
  function CardFooter({ className, ...props }) {
31
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-footer", className: (0, utils_1.cn)('flex items-center px-6 [.border-t]:pt-6', className), ...props }));
22
+ return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center px-6 [.border-t]:pt-6', className), ...props }));
32
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
@@ -11,4 +11,8 @@ export type { ConnectionsApi } from './types/connections-api';
11
11
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from './components/ui/card';
12
12
  export { Badge, badgeVariants } from './components/ui/badge';
13
13
  export { Button, buttonVariants } from './components/ui/button';
14
+ export { Stack } from './components/layout/stack';
15
+ export { Row } from './components/layout/row';
16
+ export { Grid } from './components/layout/grid';
17
+ export { SplitView } from './components/layout/split-view';
14
18
  export { cn } from './lib/utils';
package/dist/index.js CHANGED
@@ -1,39 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cn = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.CardContent = exports.CardDescription = exports.CardAction = exports.CardTitle = exports.CardFooter = exports.CardHeader = exports.Card = 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';
22
10
  // UI primitives (shadcn)
23
- var card_1 = require("./components/ui/card");
24
- Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return card_1.Card; } });
25
- Object.defineProperty(exports, "CardHeader", { enumerable: true, get: function () { return card_1.CardHeader; } });
26
- Object.defineProperty(exports, "CardFooter", { enumerable: true, get: function () { return card_1.CardFooter; } });
27
- Object.defineProperty(exports, "CardTitle", { enumerable: true, get: function () { return card_1.CardTitle; } });
28
- Object.defineProperty(exports, "CardAction", { enumerable: true, get: function () { return card_1.CardAction; } });
29
- Object.defineProperty(exports, "CardDescription", { enumerable: true, get: function () { return card_1.CardDescription; } });
30
- Object.defineProperty(exports, "CardContent", { enumerable: true, get: function () { return card_1.CardContent; } });
31
- var badge_1 = require("./components/ui/badge");
32
- Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return badge_1.Badge; } });
33
- Object.defineProperty(exports, "badgeVariants", { enumerable: true, get: function () { return badge_1.badgeVariants; } });
34
- var button_1 = require("./components/ui/button");
35
- Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return button_1.Button; } });
36
- Object.defineProperty(exports, "buttonVariants", { enumerable: true, get: function () { return button_1.buttonVariants; } });
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';
14
+ // Layout primitives
15
+ export { Stack } from './components/layout/stack';
16
+ export { Row } from './components/layout/row';
17
+ export { Grid } from './components/layout/grid';
18
+ export { SplitView } from './components/layout/split-view';
37
19
  // Utilities
38
- var utils_1 = require("./lib/utils");
39
- Object.defineProperty(exports, "cn", { enumerable: true, get: function () { return utils_1.cn; } });
20
+ 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.25",
4
+ "version": "0.0.0-alpha.27",
5
5
  "description": "Common UI components for Fask applications.",
6
6
  "private": false,
7
7
  "main": "dist/index.js",
@@ -14,6 +14,7 @@
14
14
  "build": "tsc"
15
15
  },
16
16
  "peerDependencies": {
17
+ "@pipedream/sdk": ">=2.3.0",
17
18
  "@radix-ui/react-slot": ">=1.0.0",
18
19
  "class-variance-authority": ">=0.7.0",
19
20
  "clsx": ">=2.0.0",
@@ -23,6 +24,7 @@
23
24
  "tailwind-merge": ">=2.0.0"
24
25
  },
25
26
  "devDependencies": {
27
+ "@pipedream/sdk": "^2.3.6",
26
28
  "@radix-ui/react-slot": "^1.1.0",
27
29
  "@types/react": "^18.0.0",
28
30
  "class-variance-authority": "^0.7.0",