diff --git a/apps/web/app/global.css b/apps/web/app/global.css index 17069a75..7e37911e 100644 --- a/apps/web/app/global.css +++ b/apps/web/app/global.css @@ -39,6 +39,9 @@ --ring: 215 20.2% 65.1%; --radius: 0.5rem; + + --button: #8a5df6; + --button-foreground: #ffffff; } .dark { diff --git a/apps/web/components/ColorConfig.tsx b/apps/web/components/ColorConfig.tsx index 542c6b21..bdf58e5d 100644 --- a/apps/web/components/ColorConfig.tsx +++ b/apps/web/components/ColorConfig.tsx @@ -5,6 +5,8 @@ import {useState} from 'react' interface ThemeColors { background: string border: string + button: string + buttonForeground: string foreground: string primary: string primaryForeground: string @@ -14,7 +16,7 @@ interface ThemeColors { cardForeground: string } -const defaultThemeColors: ThemeColors = { +const defaultThemeColors: Partial = { background: '0 0% 100%', border: '214.3 31.8% 91.4%', card: '0 0% 100%', diff --git a/apps/web/tailwind.config.ts b/apps/web/tailwind.config.ts index abacbe8a..a9b81589 100644 --- a/apps/web/tailwind.config.ts +++ b/apps/web/tailwind.config.ts @@ -1,6 +1,5 @@ import type {Config} from 'tailwindcss' import defaultTheme from 'tailwindcss/defaultTheme' - import {VeniceTheme} from './themes' export default { @@ -83,6 +82,10 @@ export default { colors: { // --- Begin shadcn tailwind config border: 'hsl(var(--border))', + button: { + DEFAULT: 'var(--button)', + foreground: 'var(--button-foreground)', + }, input: 'hsl(var(--input))', ring: 'hsl(var(--ring))', background: 'hsl(var(--background))', diff --git a/packages/engine-frontend/components/ConnectionPortal.tsx b/packages/engine-frontend/components/ConnectionPortal.tsx index e946a387..0b0b8e43 100644 --- a/packages/engine-frontend/components/ConnectionPortal.tsx +++ b/packages/engine-frontend/components/ConnectionPortal.tsx @@ -1,11 +1,10 @@ 'use client' -import {Link, Loader, Settings} from 'lucide-react' +import {Loader, Settings} from 'lucide-react' import type {Id} from '@openint/cdk' import type {UIPropsNoChildren} from '@openint/ui' import { Badge, - Card, ConnectorLogo, DropdownMenu, DropdownMenuContent, @@ -14,6 +13,7 @@ import { Separator, useToast, } from '@openint/ui' +import {Tabs, TabsContent, TabsList, TabsTrigger} from '@openint/ui/shadcn/Tabs' import {cn} from '@openint/ui/utils' import {R} from '@openint/util' import {WithConnectConfig} from '../hocs/WithConnectConfig' @@ -80,97 +80,131 @@ export function ConnectionPortal({className}: ConnectionPortalProps) { return (
{/* Listing by categories */} - 0} /> - -
- -

- Connectors -

-
- {listConnectionsRes.isLoading ? ( -
- -
- ) : ( - categoriesWithConnections.map((category) => ( -
- {category.connections.map((conn) => ( - <> + + + + My Connections ({connectionCount}) + + + Add a Connection + + + + {connectionCount === 0 ? ( +
+
+

+ No connections yet +

+

+ Add a connection to get started +

+
+ +
+ ) : ( +
+ {listConnectionsRes.isLoading ? ( +
+ +
+ ) : ( + categoriesWithConnections.map((category) => (
-
- -
-
-

- {conn.connectorName.charAt(0).toUpperCase() + - conn.connectorName.slice(1)} -

- - {category.name} - -
- {conn.pipelineIds.length > 0 && ( -
- {conn.syncInProgress ? ( -
- -

Syncing...

+ key={category.name} + className="flex flex-col space-y-4"> + {category.connections.map((conn) => ( + <> +
+
+ +
+
+

+ {conn.connectorName + .charAt(0) + .toUpperCase() + + conn.connectorName.slice(1)} +

+ + {category.name} +
- ) : ( -

Successfully synced

- )} + {conn.pipelineIds.length > 0 && ( +
+ {conn.syncInProgress ? ( +
+ +

+ Syncing... +

+
+ ) : ( +

Successfully synced

+ )} +
+ )} +
- )} -
-
- - - - - - - deleteResource.mutate({id: conn.id}) - }> - - Delete - - - - + + + + + + + deleteResource.mutate({id: conn.id}) + }> + + Delete + + + + +
+ {/* TODO: Improve the condition to hide the separator for the last item, right now it iterates + over all categories and all connections, would be good to have a single array of connections with the category + information included already */} + + + ))}
- {/* TODO: Improve the condition to hide the separator for the last item, right now it iterates - over all categories and all connections, would be good to have a single array of connections with the category - information included already */} - - - ))} + )) + )}
- )) - )} - - + )} + + +
+
+

+ Setup a new Connection +

+

+ Choose a connector config to start +

+
+ +
+
+
) }} ) } - -const NewConnectionCard = ({hasExisting}: {hasExisting: boolean}) => ( -
-

- {hasExisting ? 'Connect another integration' : 'No integration connected'} -

-
-) diff --git a/packages/ui/shadcn/Tabs.tsx b/packages/ui/shadcn/Tabs.tsx new file mode 100644 index 00000000..3da9d009 --- /dev/null +++ b/packages/ui/shadcn/Tabs.tsx @@ -0,0 +1,55 @@ +import * as TabsPrimitive from '@radix-ui/react-tabs' +import React from 'react' +import {cn} from '../utils' + +const Tabs = TabsPrimitive.Root + +const TabsList = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({className, ...props}, ref) => ( + +)) +TabsList.displayName = TabsPrimitive.List.displayName + +const TabsTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({className, ...props}, ref) => ( + +)) +TabsTrigger.displayName = TabsPrimitive.Trigger.displayName + +const TabsContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({className, ...props}, ref) => ( + +)) +TabsContent.displayName = TabsPrimitive.Content.displayName + +export {Tabs, TabsList, TabsTrigger, TabsContent}