@burdenoff/microfe-integrations 2026.624.1 → 2026.624.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrations/IntegrationsAdminRoutes.js +5 -5
- package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.js +5 -5
- package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +64 -64
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/ConfirmDialog.js +30 -43
- package/dist/integrations/components/ConfirmDialog.js.map +1 -1
- package/dist/integrations/components/ConnectionCard.js +15 -15
- package/dist/integrations/components/ConnectionCard.js.map +1 -1
- package/dist/integrations/components/CredentialStorageSelector.js +19 -19
- package/dist/integrations/components/CredentialStorageSelector.js.map +1 -1
- package/dist/integrations/components/ProviderCard.js +15 -15
- package/dist/integrations/components/ProviderCard.js.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +49 -49
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +271 -277
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.js +35 -35
- package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +27 -27
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +34 -34
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.js +26 -26
- package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +29 -29
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.js +46 -46
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.js +44 -44
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/dist/integrations/utils/appearance.js +7 -7
- package/dist/integrations/utils/appearance.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsOverview.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsOverview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n Plug,\n Link2,\n AlertCircle,\n Clock,\n Store,\n Plus,\n ArrowRight,\n RefreshCw,\n Loader2,\n CheckCircle2,\n XCircle,\n LayoutDashboard,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { joinPath } from '../utils/navigation';\nimport { formatLastUsed, getStatusDotColor } from '../utils/integrationsHelpers';\nimport type { IntegrationConnection, IntegrationProvider } from '../types';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { getAccentClasses } from '../utils/appearance';\nimport { mapConnection, mapProvider } from '../utils/mappers';\n\nconst OVERVIEW_QUERY = gql`\n query IntegrationsOverviewQuery {\n getProviders(pagination: { limit: 100 }) {\n total\n items {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n getConnections(pagination: { limit: 100 }) {\n total\n items {\n id\n name\n description\n status\n lastHealthCheck\n lastUsedAt\n errorMessage\n externalAccountId\n externalAccountEmail\n externalAccountName\n grantedScopes\n config\n metadata\n createdBy\n createdAt\n updatedAt\n provider {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface OverviewQueryData {\n getProviders?: { total?: number; items?: Array<Record<string, unknown>> };\n getConnections?: { total?: number; items?: Array<Record<string, unknown>> };\n}\n\nfunction useOverviewData() {\n const { data, loading, error, refetch } = useQuery<OverviewQueryData>(OVERVIEW_QUERY, {\n errorPolicy: 'all',\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const providers = (data?.getProviders?.items ?? []).map((item: Record<string, unknown>) =>\n mapProvider(item)\n );\n const connections = (data?.getConnections?.items ?? []).map((item: Record<string, unknown>) =>\n mapConnection(item)\n );\n\n return {\n providers,\n connections,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Stat card for overview metrics\n */\nfunction StatCard({\n label,\n value,\n icon,\n tone = 'primary',\n onClick,\n}: {\n label: string;\n value: number;\n icon: React.ReactNode;\n tone?: 'primary' | 'success' | 'warning' | 'info' | 'neutral';\n onClick?: () => void;\n}) {\n const accent = getAccentClasses(tone);\n\n return (\n <div\n className={cn(\n 'relative overflow-hidden rounded-xl border border-border/50 bg-card p-5',\n 'hover:shadow-md hover:border-primary/30 transition-all duration-200',\n onClick && 'cursor-pointer'\n )}\n onClick={onClick}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-muted-foreground\">{label}</p>\n <p className=\"text-3xl font-bold text-foreground mt-1\">{value}</p>\n </div>\n <div className={cn('p-3 rounded-xl', accent.surface)}>{icon}</div>\n </div>\n <div className=\"absolute bottom-0 right-0 size-32 bg-gradient-to-tl from-primary/5 to-transparent rounded-full blur-2xl -z-0\" />\n </div>\n );\n}\n\n/**\n * Integrations Overview — Dashboard page with stats, recent connections, and quick actions.\n */\nexport function IntegrationsOverview() {\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { addConnectionDialogOpen, openAddConnectionDialog, closeAddConnectionDialog } =\n useIntegrationsStore();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreateConnection =\n !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n const { providers, connections, loading, error, refetch } = useOverviewData();\n\n // Compute stats\n const stats = useMemo(() => {\n const totalProviders = (providers ?? []).length;\n const installedProviders = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed'\n ).length;\n const activeConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'active'\n ).length;\n const pendingAuth = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'pending_auth'\n ).length;\n const errorConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'error'\n ).length;\n\n return { totalProviders, installedProviders, activeConnections, pendingAuth, errorConnections };\n }, [providers, connections]);\n\n // Recent connections (last 5 by updatedAt)\n const recentConnections = useMemo(() => {\n return [...(connections ?? [])]\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())\n .slice(0, 5);\n }, [connections]);\n\n const handleNavigate = (path: string) => {\n if (!navigate) return;\n navigate(joinPath(basePath, path));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm\"\n data-tour=\"integrations-overview-header\"\n >\n <div className=\"relative z-10 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-primary/10 backdrop-blur-sm\">\n <LayoutDashboard size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-foreground\">\n {tx('integrations.overview.title', 'Integrations')}\n </h1>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n {tx(\n 'integrations.overview.subtitle',\n 'Connect your workspace to external services and tools'\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"p-2 rounded-lg hover:bg-accent transition-colors\"\n aria-label={tx('integrations.overview.actions.refreshAriaLabel', 'Refresh')}\n >\n <RefreshCw size={18} className=\"text-muted-foreground\" />\n </button>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n {/* Error State */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-300\">\n <div className=\"p-2.5 rounded-lg bg-status-error-bg-subtle\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tx('integrations.overview.error.title', 'Failed to load integrations data')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />\n {tx('integrations.overview.error.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border/50 bg-card p-5 animate-pulse\">\n <div className=\"flex items-center justify-between\">\n <div className=\"space-y-2\">\n <div className=\"h-3 w-20 bg-muted rounded\" />\n <div className=\"h-8 w-12 bg-muted rounded\" />\n </div>\n <div className=\"size-12 bg-muted rounded-xl\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Stats Cards */}\n {!loading && !error && (\n <div\n className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\"\n data-tour=\"integrations-stats-cards\"\n >\n <StatCard\n label={tx('integrations.overview.stats.installedProviders', 'Installed Providers')}\n value={stats.installedProviders}\n icon={<Store size={24} className=\"text-primary\" />}\n tone=\"primary\"\n onClick={() => handleNavigate('providers')}\n />\n <StatCard\n label={tx('integrations.overview.stats.activeConnections', 'Active Connections')}\n value={stats.activeConnections}\n icon={<CheckCircle2 size={24} className=\"text-status-success-text\" />}\n tone=\"success\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.pendingAuth', 'Pending Auth')}\n value={stats.pendingAuth}\n icon={<Clock size={24} className=\"text-status-warning-text\" />}\n tone=\"warning\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.errors', 'Errors')}\n value={stats.errorConnections}\n icon={<XCircle size={24} className=\"text-status-error-text\" />}\n tone=\"neutral\"\n onClick={() => handleNavigate('connections')}\n />\n </div>\n )}\n\n {/* Quick Actions */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\" data-tour=\"integrations-quick-actions\">\n <button\n type=\"button\"\n onClick={() => handleNavigate('providers')}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border/50 bg-card',\n 'hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'text-left transition-all duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-primary/10\">\n <Store size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-foreground\">\n {tx('integrations.overview.quickActions.browseProviders.title', 'Browse Providers')}\n </h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.browseProviders.description',\n 'Discover and install integration plugins'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-muted-foreground group-hover:text-primary transition-colors\"\n />\n </button>\n\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border/50 bg-card',\n 'hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'text-left transition-all duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-status-success-bg-subtle\">\n <Plus size={24} className=\"text-status-success-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-foreground\">\n {tx('integrations.overview.quickActions.addConnection.title', 'Add Connection')}\n </h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.addConnection.description',\n 'Connect to an external service'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-muted-foreground group-hover:text-primary transition-colors\"\n />\n </button>\n )}\n </div>\n\n {/* Recent Connections */}\n <div\n className=\"rounded-xl border border-border/50 bg-card overflow-hidden\"\n data-tour=\"integrations-recent-connections\"\n >\n <div className=\"flex items-center justify-between p-5 border-b border-border/50\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-foreground\">\n {tx('integrations.overview.recentConnections.title', 'Recent Connections')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => handleNavigate('connections')}\n className=\"text-sm text-primary hover:underline\"\n >\n {tx('integrations.overview.recentConnections.viewAll', 'View all')}\n </button>\n </div>\n\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-muted-foreground\" />\n </div>\n )}\n\n {!loading && recentConnections.length === 0 && (\n <div className=\"flex flex-col items-center justify-center py-12 px-6 text-center\">\n <div className=\"p-4 rounded-full bg-muted/50 mb-4\">\n <Plug size={32} className=\"text-muted-foreground\" />\n </div>\n <h3 className=\"font-semibold text-foreground mb-1\">\n {tx('integrations.overview.empty.title', 'No connections yet')}\n </h3>\n <p className=\"text-sm text-muted-foreground mb-4 max-w-sm\">\n {canCreateConnection\n ? tx(\n 'integrations.overview.empty.canCreateDescription',\n 'Create your first connection to start integrating with external services.'\n )\n : tx(\n 'integrations.overview.empty.readOnlyDescription',\n 'No connections have been configured yet.'\n )}\n </p>\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n <Plus size={16} />\n {tx('integrations.overview.actions.addConnection', 'Add Connection')}\n </button>\n )}\n </div>\n )}\n\n {!loading && recentConnections.length > 0 && (\n <div className=\"divide-y divide-border/50\">\n {recentConnections.map((conn) => (\n <div\n key={conn.id}\n className=\"flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors\"\n onClick={() => handleNavigate(`connections/${conn.id}`)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleNavigate(`connections/${conn.id}`);\n }\n }}\n >\n <div className=\"size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-primary/10\">\n <Plug size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-foreground truncate\">{conn.name}</p>\n <p className=\"text-xs text-muted-foreground truncate\">{conn.provider.name}</p>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <span className={cn('size-2 rounded-full', getStatusDotColor(conn.status))} />\n <span className=\"text-xs text-muted-foreground\">\n {formatLastUsed(conn.lastUsedAt)}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6BA,IAAM,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8E1B,SAAS,IAAkB;CACzB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA4B,GAAgB;EACpF,aAAa;EACb,aAAa;EACb,iBAAiB;EAClB,CAAC;AASF,QAAO;EACL,YARiB,GAAM,cAAc,SAAS,EAAE,EAAE,KAAK,MACvD,EAAY,EAAK,CAClB;EAOC,cANmB,GAAM,gBAAgB,SAAS,EAAE,EAAE,KAAK,MAC3D,EAAc,EAAK,CACpB;EAKC;EACA;EACA;EACD;;AAMH,SAAS,EAAS,EAChB,UACA,UACA,SACA,UAAO,WACP,cAOC;CACD,IAAM,IAAS,EAAiB,EAAK;AAErC,QACE,kBAAC,OAAD;EACE,WAAW,EACT,2EACA,uEACA,KAAW,iBACZ;EACQ;EACT,MAAM,IAAU,WAAW,KAAA;EAC3B,UAAU,IAAU,IAAI,KAAA;EACxB,WACE,KACK,MAAM;AACL,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,GAAS;MAGb,KAAA;YAjBR,CAoBE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;IAAG,WAAU;cAA6C;IAAU,CAAA,EACpE,kBAAC,KAAD;IAAG,WAAU;cAA2C;IAAU,CAAA,CAC9D,EAAA,CAAA,EACN,kBAAC,OAAD;IAAK,WAAW,EAAG,kBAAkB,EAAO,QAAQ;cAAG;IAAW,CAAA,CAC9D;MACN,kBAAC,OA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,EAC9E,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAe,EAAK,WAAW;UAC3B,CAAA,CACH;;QACF;SAzBC,EAAK,GAyBN,CACN;MACE,CAAA;KAEJ;;GAGN,kBAAC,GAAD;IACE,MAAM;IACN,SAAS;IACT,2BAA2B;AACpB,QAAS;;IAEhB,CAAA;GACE"}
|
|
1
|
+
{"version":3,"file":"IntegrationsOverview.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsOverview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n Plug,\n Link2,\n AlertCircle,\n Clock,\n Store,\n Plus,\n ArrowRight,\n RefreshCw,\n Loader2,\n CheckCircle2,\n XCircle,\n LayoutDashboard,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { joinPath } from '../utils/navigation';\nimport { formatLastUsed, getStatusDotColor } from '../utils/integrationsHelpers';\nimport type { IntegrationConnection, IntegrationProvider } from '../types';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { getAccentClasses } from '../utils/appearance';\nimport { mapConnection, mapProvider } from '../utils/mappers';\n\nconst OVERVIEW_QUERY = gql`\n query IntegrationsOverviewQuery {\n getProviders(pagination: { limit: 100 }) {\n total\n items {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n getConnections(pagination: { limit: 100 }) {\n total\n items {\n id\n name\n description\n status\n lastHealthCheck\n lastUsedAt\n errorMessage\n externalAccountId\n externalAccountEmail\n externalAccountName\n grantedScopes\n config\n metadata\n createdBy\n createdAt\n updatedAt\n provider {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface OverviewQueryData {\n getProviders?: { total?: number; items?: Array<Record<string, unknown>> };\n getConnections?: { total?: number; items?: Array<Record<string, unknown>> };\n}\n\nfunction useOverviewData() {\n const { data, loading, error, refetch } = useQuery<OverviewQueryData>(OVERVIEW_QUERY, {\n errorPolicy: 'all',\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const providers = (data?.getProviders?.items ?? []).map((item: Record<string, unknown>) =>\n mapProvider(item)\n );\n const connections = (data?.getConnections?.items ?? []).map((item: Record<string, unknown>) =>\n mapConnection(item)\n );\n\n return {\n providers,\n connections,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Stat card for overview metrics\n */\nfunction StatCard({\n label,\n value,\n icon,\n tone = 'primary',\n onClick,\n}: {\n label: string;\n value: number;\n icon: React.ReactNode;\n tone?: 'primary' | 'success' | 'warning' | 'info' | 'neutral';\n onClick?: () => void;\n}) {\n const accent = getAccentClasses(tone);\n\n return (\n <div\n className={cn(\n 'relative overflow-hidden rounded-xl border border-border-subtle/50 bg-bg-surface p-5',\n 'hover:shadow-md hover:border-primary/30 transition-all duration-200',\n onClick && 'cursor-pointer'\n )}\n onClick={onClick}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-secondary\">{label}</p>\n <p className=\"text-3xl font-bold text-text-primary mt-1 tabular-nums\">{value}</p>\n </div>\n <div className={cn('p-3 rounded-xl', accent.surface)}>{icon}</div>\n </div>\n <div className=\"absolute bottom-0 right-0 size-32 bg-gradient-to-tl from-primary/5 to-transparent rounded-full blur-2xl -z-0\" />\n </div>\n );\n}\n\n/**\n * Integrations Overview — Dashboard page with stats, recent connections, and quick actions.\n */\nexport function IntegrationsOverview() {\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { addConnectionDialogOpen, openAddConnectionDialog, closeAddConnectionDialog } =\n useIntegrationsStore();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreateConnection =\n !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n const { providers, connections, loading, error, refetch } = useOverviewData();\n\n // Compute stats\n const stats = useMemo(() => {\n const totalProviders = (providers ?? []).length;\n const installedProviders = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed'\n ).length;\n const activeConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'active'\n ).length;\n const pendingAuth = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'pending_auth'\n ).length;\n const errorConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'error'\n ).length;\n\n return { totalProviders, installedProviders, activeConnections, pendingAuth, errorConnections };\n }, [providers, connections]);\n\n // Recent connections (last 5 by updatedAt)\n const recentConnections = useMemo(() => {\n return [...(connections ?? [])]\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())\n .slice(0, 5);\n }, [connections]);\n\n const handleNavigate = (path: string) => {\n if (!navigate) return;\n navigate(joinPath(basePath, path));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm\"\n data-tour=\"integrations-overview-header\"\n >\n <div className=\"relative z-10 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10 backdrop-blur-sm\">\n <LayoutDashboard size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tx('integrations.overview.title', 'Integrations')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.subtitle',\n 'Connect your workspace to external services and tools'\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"p-2 rounded-lg hover:bg-accent transition-colors\"\n aria-label={tx('integrations.overview.actions.refreshAriaLabel', 'Refresh')}\n >\n <RefreshCw size={18} className=\"text-text-secondary\" />\n </button>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n {/* Error State */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-200\">\n <div className=\"p-2.5 rounded-lg bg-status-error-bg-subtle\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tx('integrations.overview.error.title', 'Failed to load integrations data')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />\n {tx('integrations.overview.error.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 animate-pulse\">\n <div className=\"flex items-center justify-between\">\n <div className=\"space-y-2\">\n <div className=\"h-3 w-20 bg-bg-sunken rounded\" />\n <div className=\"h-8 w-12 bg-bg-sunken rounded\" />\n </div>\n <div className=\"size-12 bg-bg-sunken rounded-xl\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Stats Cards */}\n {!loading && !error && (\n <div\n className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\"\n data-tour=\"integrations-stats-cards\"\n >\n <StatCard\n label={tx('integrations.overview.stats.installedProviders', 'Installed Providers')}\n value={stats.installedProviders}\n icon={<Store size={24} className=\"text-primary\" />}\n tone=\"primary\"\n onClick={() => handleNavigate('providers')}\n />\n <StatCard\n label={tx('integrations.overview.stats.activeConnections', 'Active Connections')}\n value={stats.activeConnections}\n icon={<CheckCircle2 size={24} className=\"text-status-success-text\" />}\n tone=\"success\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.pendingAuth', 'Pending Auth')}\n value={stats.pendingAuth}\n icon={<Clock size={24} className=\"text-status-warning-text\" />}\n tone=\"warning\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.errors', 'Errors')}\n value={stats.errorConnections}\n icon={<XCircle size={24} className=\"text-status-error-text\" />}\n tone=\"neutral\"\n onClick={() => handleNavigate('connections')}\n />\n </div>\n )}\n\n {/* Quick Actions */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\" data-tour=\"integrations-quick-actions\">\n <button\n type=\"button\"\n onClick={() => handleNavigate('providers')}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-subtle/50 bg-bg-surface',\n 'hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'text-left transition-all duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-action-primary-bg/10\">\n <Store size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.quickActions.browseProviders.title', 'Browse Providers')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.browseProviders.description',\n 'Discover and install integration plugins'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-subtle/50 bg-bg-surface',\n 'hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'text-left transition-all duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-status-success-bg-subtle\">\n <Plus size={24} className=\"text-status-success-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.quickActions.addConnection.title', 'Add Connection')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.addConnection.description',\n 'Connect to an external service'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n )}\n </div>\n\n {/* Recent Connections */}\n <div\n className=\"rounded-xl border border-border-subtle/50 bg-bg-surface overflow-hidden\"\n data-tour=\"integrations-recent-connections\"\n >\n <div className=\"flex items-center justify-between p-5 border-b border-border-subtle/50\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.recentConnections.title', 'Recent Connections')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => handleNavigate('connections')}\n className=\"text-sm text-primary hover:underline\"\n >\n {tx('integrations.overview.recentConnections.viewAll', 'View all')}\n </button>\n </div>\n\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {!loading && recentConnections.length === 0 && (\n <div className=\"flex flex-col items-center justify-center py-12 px-6 text-center\">\n <div className=\"p-4 rounded-full bg-bg-sunken/50 mb-4\">\n <Plug size={32} className=\"text-text-secondary\" />\n </div>\n <h3 className=\"font-semibold text-text-primary mb-1\">\n {tx('integrations.overview.empty.title', 'No connections yet')}\n </h3>\n <p className=\"text-sm text-text-secondary mb-4 max-w-sm\">\n {canCreateConnection\n ? tx(\n 'integrations.overview.empty.canCreateDescription',\n 'Create your first connection to start integrating with external services.'\n )\n : tx(\n 'integrations.overview.empty.readOnlyDescription',\n 'No connections have been configured yet.'\n )}\n </p>\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <Plus size={16} />\n {tx('integrations.overview.actions.addConnection', 'Add Connection')}\n </button>\n )}\n </div>\n )}\n\n {!loading && recentConnections.length > 0 && (\n <div className=\"divide-y divide-border/50\">\n {recentConnections.map((conn) => (\n <div\n key={conn.id}\n className=\"flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors\"\n onClick={() => handleNavigate(`connections/${conn.id}`)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleNavigate(`connections/${conn.id}`);\n }\n }}\n >\n <div className=\"size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <Plug size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{conn.name}</p>\n <p className=\"text-xs text-text-secondary truncate\">{conn.provider.name}</p>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <span className={cn('size-2 rounded-full', getStatusDotColor(conn.status))} />\n <span className=\"text-xs text-text-secondary\">\n {formatLastUsed(conn.lastUsedAt)}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6BA,IAAM,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8E1B,SAAS,IAAkB;CACzB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA4B,GAAgB;EACpF,aAAa;EACb,aAAa;EACb,iBAAiB;EAClB,CAAC;AASF,QAAO;EACL,YARiB,GAAM,cAAc,SAAS,EAAE,EAAE,KAAK,MACvD,EAAY,EAAK,CAClB;EAOC,cANmB,GAAM,gBAAgB,SAAS,EAAE,EAAE,KAAK,MAC3D,EAAc,EAAK,CACpB;EAKC;EACA;EACA;EACD;;AAMH,SAAS,EAAS,EAChB,UACA,UACA,SACA,UAAO,WACP,cAOC;CACD,IAAM,IAAS,EAAiB,EAAK;AAErC,QACE,kBAAC,OAAD;EACE,WAAW,EACT,wFACA,uEACA,KAAW,iBACZ;EACQ;EACT,MAAM,IAAU,WAAW,KAAA;EAC3B,UAAU,IAAU,IAAI,KAAA;EACxB,WACE,KACK,MAAM;AACL,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,GAAS;MAGb,KAAA;YAjBR,CAoBE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;IAAG,WAAU;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C7E,kBAAC,KAAD;UAAG,WAAU;oBAAwC,EAAK,SAAS;UAAS,CAAA,CACxE;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD,EAAM,WAAW,EAAG,uBAAuB,EAAkB,EAAK,OAAO,CAAC,EAAI,CAAA,EAC9E,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAe,EAAK,WAAW;UAC3B,CAAA,CACH;;QACF;SAzBC,EAAK,GAyBN,CACN;MACE,CAAA;KAEJ;;GAGN,kBAAC,GAAD;IACE,MAAM;IACN,SAAS;IACT,2BAA2B;AACpB,QAAS;;IAEhB,CAAA;GACE"}
|
|
@@ -22,7 +22,7 @@ function b() {
|
|
|
22
22
|
className: "space-y-6 p-6 max-w-4xl mx-auto",
|
|
23
23
|
children: [
|
|
24
24
|
/* @__PURE__ */ y("div", {
|
|
25
|
-
className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm",
|
|
25
|
+
className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm",
|
|
26
26
|
children: [/* @__PURE__ */ y("div", {
|
|
27
27
|
className: "relative z-10 flex items-center gap-4",
|
|
28
28
|
children: [
|
|
@@ -34,26 +34,26 @@ function b() {
|
|
|
34
34
|
children: /* @__PURE__ */ v(o, { size: 20 })
|
|
35
35
|
}),
|
|
36
36
|
/* @__PURE__ */ v("div", {
|
|
37
|
-
className: "p-2.5 rounded-lg bg-primary/10",
|
|
37
|
+
className: "p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
38
38
|
children: /* @__PURE__ */ v(m, {
|
|
39
39
|
size: 24,
|
|
40
40
|
className: "text-primary"
|
|
41
41
|
})
|
|
42
42
|
}),
|
|
43
43
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
44
|
-
className: "text-2xl sm:text-3xl font-bold text-
|
|
44
|
+
className: "text-2xl sm:text-3xl font-bold text-text-primary",
|
|
45
45
|
children: w("integrations.settings.title", "Integrations Settings")
|
|
46
46
|
}), /* @__PURE__ */ v("p", {
|
|
47
|
-
className: "text-sm text-
|
|
47
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
48
48
|
children: w("integrations.settings.subtitle", "Configure integration module behavior")
|
|
49
49
|
})] })
|
|
50
50
|
]
|
|
51
51
|
}), /* @__PURE__ */ v("div", { className: "absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0" })]
|
|
52
52
|
}),
|
|
53
53
|
/* @__PURE__ */ y("div", {
|
|
54
|
-
className: "rounded-xl border border-border/50 bg-
|
|
54
|
+
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4",
|
|
55
55
|
children: [/* @__PURE__ */ y("h2", {
|
|
56
|
-
className: "font-semibold text-
|
|
56
|
+
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
57
57
|
children: [/* @__PURE__ */ v(d, {
|
|
58
58
|
size: 18,
|
|
59
59
|
className: "text-primary"
|
|
@@ -62,17 +62,17 @@ function b() {
|
|
|
62
62
|
className: "space-y-2",
|
|
63
63
|
children: [
|
|
64
64
|
/* @__PURE__ */ v("label", {
|
|
65
|
-
className: "block text-sm font-medium text-
|
|
65
|
+
className: "block text-sm font-medium text-text-primary",
|
|
66
66
|
children: w("integrations.settings.oauth.redirectUriLabel", "Default OAuth Redirect URI")
|
|
67
67
|
}),
|
|
68
68
|
/* @__PURE__ */ v("p", {
|
|
69
|
-
className: "text-xs text-
|
|
69
|
+
className: "text-xs text-text-secondary mb-2",
|
|
70
70
|
children: w("integrations.settings.oauth.redirectUriDescription", "Use this URL as the redirect/callback URI when configuring OAuth applications with providers.")
|
|
71
71
|
}),
|
|
72
72
|
/* @__PURE__ */ y("div", {
|
|
73
73
|
className: "flex items-center gap-2",
|
|
74
74
|
children: [/* @__PURE__ */ v("div", {
|
|
75
|
-
className: "flex-1 px-4 py-2.5 border border-border rounded-lg bg-
|
|
75
|
+
className: "flex-1 px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-sunken/30 font-mono text-sm text-text-primary break-all",
|
|
76
76
|
children: B
|
|
77
77
|
}), /* @__PURE__ */ v("button", {
|
|
78
78
|
type: "button",
|
|
@@ -83,7 +83,7 @@ function b() {
|
|
|
83
83
|
}
|
|
84
84
|
z(!0), setTimeout(() => z(!1), 2e3);
|
|
85
85
|
},
|
|
86
|
-
className: "p-2.5 rounded-lg border border-border hover:bg-accent transition-colors flex-shrink-0",
|
|
86
|
+
className: "p-2.5 rounded-lg border border-border-subtle hover:bg-accent transition-colors flex-shrink-0",
|
|
87
87
|
"aria-label": w("integrations.settings.oauth.copyAriaLabel", "Copy redirect URI"),
|
|
88
88
|
children: R ? /* @__PURE__ */ v(s, {
|
|
89
89
|
size: 16,
|
|
@@ -95,9 +95,9 @@ function b() {
|
|
|
95
95
|
})]
|
|
96
96
|
}),
|
|
97
97
|
/* @__PURE__ */ y("div", {
|
|
98
|
-
className: "rounded-xl border border-border/50 bg-
|
|
98
|
+
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4",
|
|
99
99
|
children: [/* @__PURE__ */ y("h2", {
|
|
100
|
-
className: "font-semibold text-
|
|
100
|
+
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
101
101
|
children: [/* @__PURE__ */ v(l, {
|
|
102
102
|
size: 18,
|
|
103
103
|
className: "text-primary"
|
|
@@ -111,7 +111,7 @@ function b() {
|
|
|
111
111
|
children: w("integrations.settings.connection.timeoutLabel", "Connection Timeout (seconds)")
|
|
112
112
|
}),
|
|
113
113
|
/* @__PURE__ */ v("p", {
|
|
114
|
-
className: "text-xs text-
|
|
114
|
+
className: "text-xs text-text-secondary mb-2",
|
|
115
115
|
children: w("integrations.settings.connection.timeoutDescription", "Maximum time to wait when testing or using a connection.")
|
|
116
116
|
}),
|
|
117
117
|
/* @__PURE__ */ v("input", {
|
|
@@ -122,7 +122,7 @@ function b() {
|
|
|
122
122
|
min: 5,
|
|
123
123
|
max: 120,
|
|
124
124
|
"aria-label": w("integrations.settings.connection.timeoutLabel", "Connection Timeout (seconds)"),
|
|
125
|
-
className: "w-full max-w-[200px] px-4 py-2.5 border border-border rounded-lg bg-
|
|
125
|
+
className: "w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
126
126
|
})
|
|
127
127
|
] }), /* @__PURE__ */ y("div", { children: [
|
|
128
128
|
/* @__PURE__ */ v("label", {
|
|
@@ -131,7 +131,7 @@ function b() {
|
|
|
131
131
|
children: w("integrations.settings.connection.healthCheckLabel", "Health Check Interval (minutes)")
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ v("p", {
|
|
134
|
-
className: "text-xs text-
|
|
134
|
+
className: "text-xs text-text-secondary mb-2",
|
|
135
135
|
children: w("integrations.settings.connection.healthCheckDescription", "How often to automatically check connection health.")
|
|
136
136
|
}),
|
|
137
137
|
/* @__PURE__ */ v("input", {
|
|
@@ -142,15 +142,15 @@ function b() {
|
|
|
142
142
|
min: 5,
|
|
143
143
|
max: 1440,
|
|
144
144
|
"aria-label": w("integrations.settings.connection.healthCheckLabel", "Health Check Interval (minutes)"),
|
|
145
|
-
className: "w-full max-w-[200px] px-4 py-2.5 border border-border rounded-lg bg-
|
|
145
|
+
className: "w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
146
146
|
})
|
|
147
147
|
] })]
|
|
148
148
|
})]
|
|
149
149
|
}),
|
|
150
150
|
/* @__PURE__ */ y("div", {
|
|
151
|
-
className: "rounded-xl border border-border/50 bg-
|
|
151
|
+
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4",
|
|
152
152
|
children: [/* @__PURE__ */ y("h2", {
|
|
153
|
-
className: "font-semibold text-
|
|
153
|
+
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
154
154
|
children: [/* @__PURE__ */ v(h, {
|
|
155
155
|
size: 18,
|
|
156
156
|
className: "text-primary"
|
|
@@ -161,10 +161,10 @@ function b() {
|
|
|
161
161
|
className: "flex items-center justify-between",
|
|
162
162
|
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
163
163
|
htmlFor: "auto-refresh",
|
|
164
|
-
className: "text-sm font-semibold text-
|
|
164
|
+
className: "text-sm font-semibold text-text-primary",
|
|
165
165
|
children: w("integrations.settings.security.autoRefreshLabel", "Auto-refresh OAuth Tokens")
|
|
166
166
|
}), /* @__PURE__ */ v("p", {
|
|
167
|
-
className: "text-xs text-
|
|
167
|
+
className: "text-xs text-text-secondary mt-0.5",
|
|
168
168
|
children: w("integrations.settings.security.autoRefreshDescription", "Automatically refresh tokens before they expire.")
|
|
169
169
|
})] }), /* @__PURE__ */ v("button", {
|
|
170
170
|
type: "button",
|
|
@@ -173,7 +173,7 @@ function b() {
|
|
|
173
173
|
"aria-checked": M,
|
|
174
174
|
"aria-label": w("integrations.settings.security.autoRefreshLabel", "Auto-refresh OAuth Tokens"),
|
|
175
175
|
onClick: () => N(!M),
|
|
176
|
-
className: t("relative w-11 h-6 rounded-full transition-colors flex-shrink-0", M ? "bg-primary" : "bg-
|
|
176
|
+
className: t("relative w-11 h-6 rounded-full transition-colors flex-shrink-0", M ? "bg-action-primary-bg" : "bg-bg-sunken"),
|
|
177
177
|
children: /* @__PURE__ */ v("span", { className: t("absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform", M && "translate-x-5") })
|
|
178
178
|
})]
|
|
179
179
|
})
|
|
@@ -187,7 +187,7 @@ function b() {
|
|
|
187
187
|
F(!0), await new Promise((e) => setTimeout(e, 1e3)), F(!1), L(!0), setTimeout(() => L(!1), 3e3);
|
|
188
188
|
},
|
|
189
189
|
disabled: P,
|
|
190
|
-
className: "inline-flex items-center gap-2 px-6 py-3 text-sm font-medium rounded-lg bg-primary text-primary-
|
|
190
|
+
className: "inline-flex items-center gap-2 px-6 py-3 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-all disabled:opacity-50",
|
|
191
191
|
children: [P ? /* @__PURE__ */ v(f, {
|
|
192
192
|
size: 16,
|
|
193
193
|
className: "animate-spin"
|
|
@@ -200,20 +200,20 @@ function b() {
|
|
|
200
200
|
children: [
|
|
201
201
|
/* @__PURE__ */ v(h, {
|
|
202
202
|
size: 48,
|
|
203
|
-
className: "text-
|
|
203
|
+
className: "text-text-secondary mb-4"
|
|
204
204
|
}),
|
|
205
205
|
/* @__PURE__ */ v("h2", {
|
|
206
|
-
className: "text-xl font-bold text-
|
|
206
|
+
className: "text-xl font-bold text-text-primary mb-2",
|
|
207
207
|
children: w("integrations.settings.accessDenied.title", "Access Denied")
|
|
208
208
|
}),
|
|
209
209
|
/* @__PURE__ */ v("p", {
|
|
210
|
-
className: "text-sm text-
|
|
210
|
+
className: "text-sm text-text-secondary mb-6 max-w-sm",
|
|
211
211
|
children: w("integrations.settings.accessDenied.description", "You don't have permission to manage integration settings.")
|
|
212
212
|
}),
|
|
213
213
|
/* @__PURE__ */ y("button", {
|
|
214
214
|
type: "button",
|
|
215
215
|
onClick: () => x?.(b),
|
|
216
|
-
className: "inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors",
|
|
216
|
+
className: "inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors",
|
|
217
217
|
children: [
|
|
218
218
|
/* @__PURE__ */ v(o, { size: 16 }),
|
|
219
219
|
" ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsSettings.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsSettings.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Settings,\n ArrowLeft,\n Globe,\n Clock,\n Shield,\n Save,\n Loader2,\n CheckCircle2,\n Copy,\n Check,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { nativeCopyText, nativeImpact } from '../../utils/nativeBridge';\n\n/**\n * Integrations Settings — module configuration page.\n */\nexport function IntegrationsSettings() {\n const { basePath = '/', navigate, apiGatewayUrl } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canWrite = hasPermission(INTEGRATION_PERMISSIONS.INTEGRATION_WRITE);\n\n const [connectionTimeout, setConnectionTimeout] = useState(30);\n const [healthCheckInterval, setHealthCheckInterval] = useState(60);\n const [autoRefreshTokens, setAutoRefreshTokens] = useState(true);\n const [saving, setSaving] = useState(false);\n const [saved, setSaved] = useState(false);\n const [copiedRedirectUri, setCopiedRedirectUri] = useState(false);\n\n // Compute the default OAuth redirect URI based on the gateway URL\n const oauthRedirectUri = apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : `${typeof window !== 'undefined' ? window.location.origin : ''}/integrations/oauth/callback`;\n\n const handleSave = async () => {\n setSaving(true);\n // Simulated save — in production this would call a GraphQL mutation\n await new Promise((resolve) => setTimeout(resolve, 1000));\n setSaving(false);\n setSaved(true);\n setTimeout(() => setSaved(false), 3000);\n };\n\n const handleCopyRedirectUri = async () => {\n void nativeImpact('light');\n const ok = await nativeCopyText(oauthRedirectUri);\n if (!ok) {\n // Last-resort fallback for very old browsers without clipboard or execCommand support\n const input = document.createElement('input');\n input.value = oauthRedirectUri;\n document.body.appendChild(input);\n input.select();\n document.execCommand('copy');\n document.body.removeChild(input);\n }\n setCopiedRedirectUri(true);\n setTimeout(() => setCopiedRedirectUri(false), 2000);\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!canWrite) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <Shield size={48} className=\"text-muted-foreground mb-4\" />\n <h2 className=\"text-xl font-bold text-foreground mb-2\">\n {tx('integrations.settings.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-muted-foreground mb-6 max-w-sm\">\n {tx(\n 'integrations.settings.accessDenied.description',\n \"You don't have permission to manage integration settings.\"\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={16} />{' '}\n {tx('integrations.settings.accessDenied.back', 'Back to Overview')}\n </button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl mx-auto\">\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all\"\n aria-label={tx('integrations.settings.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"p-2.5 rounded-lg bg-primary/10\">\n <Settings size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-foreground\">\n {tx('integrations.settings.title', 'Integrations Settings')}\n </h1>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n {tx('integrations.settings.subtitle', 'Configure integration module behavior')}\n </p>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n {/* OAuth Redirect URI */}\n <div className=\"rounded-xl border border-border/50 bg-card p-5 space-y-4\">\n <h2 className=\"font-semibold text-foreground flex items-center gap-2\">\n <Globe size={18} className=\"text-primary\" />\n {tx('integrations.settings.oauth.title', 'OAuth Configuration')}\n </h2>\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-foreground\">\n {tx('integrations.settings.oauth.redirectUriLabel', 'Default OAuth Redirect URI')}\n </label>\n <p className=\"text-xs text-muted-foreground mb-2\">\n {tx(\n 'integrations.settings.oauth.redirectUriDescription',\n 'Use this URL as the redirect/callback URI when configuring OAuth applications with providers.'\n )}\n </p>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 px-4 py-2.5 border border-border rounded-lg bg-muted/30 font-mono text-sm text-foreground break-all\">\n {oauthRedirectUri}\n </div>\n <button\n type=\"button\"\n onClick={handleCopyRedirectUri}\n className=\"p-2.5 rounded-lg border border-border hover:bg-accent transition-colors flex-shrink-0\"\n aria-label={tx('integrations.settings.oauth.copyAriaLabel', 'Copy redirect URI')}\n >\n {copiedRedirectUri ? (\n <Check size={16} className=\"text-status-success-text\" />\n ) : (\n <Copy size={16} />\n )}\n </button>\n </div>\n </div>\n </div>\n\n {/* Connection Settings */}\n <div className=\"rounded-xl border border-border/50 bg-card p-5 space-y-4\">\n <h2 className=\"font-semibold text-foreground flex items-center gap-2\">\n <Clock size={18} className=\"text-primary\" />\n {tx('integrations.settings.connection.title', 'Connection Settings')}\n </h2>\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"conn-timeout\" className=\"block text-sm font-semibold mb-2\">\n {tx('integrations.settings.connection.timeoutLabel', 'Connection Timeout (seconds)')}\n </label>\n <p className=\"text-xs text-muted-foreground mb-2\">\n {tx(\n 'integrations.settings.connection.timeoutDescription',\n 'Maximum time to wait when testing or using a connection.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"conn-timeout\"\n value={connectionTimeout}\n onChange={(e) => setConnectionTimeout(Number(e.target.value))}\n min={5}\n max={120}\n aria-label={tx(\n 'integrations.settings.connection.timeoutLabel',\n 'Connection Timeout (seconds)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n <div>\n <label htmlFor=\"health-interval\" className=\"block text-sm font-semibold mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n </label>\n <p className=\"text-xs text-muted-foreground mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckDescription',\n 'How often to automatically check connection health.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"health-interval\"\n value={healthCheckInterval}\n onChange={(e) => setHealthCheckInterval(Number(e.target.value))}\n min={5}\n max={1440}\n aria-label={tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n </div>\n </div>\n\n {/* Security Settings */}\n <div className=\"rounded-xl border border-border/50 bg-card p-5 space-y-4\">\n <h2 className=\"font-semibold text-foreground flex items-center gap-2\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.settings.security.title', 'Security')}\n </h2>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <label htmlFor=\"auto-refresh\" className=\"text-sm font-semibold text-foreground\">\n {tx('integrations.settings.security.autoRefreshLabel', 'Auto-refresh OAuth Tokens')}\n </label>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {tx(\n 'integrations.settings.security.autoRefreshDescription',\n 'Automatically refresh tokens before they expire.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n id=\"auto-refresh\"\n role=\"switch\"\n aria-checked={autoRefreshTokens}\n aria-label={tx(\n 'integrations.settings.security.autoRefreshLabel',\n 'Auto-refresh OAuth Tokens'\n )}\n onClick={() => setAutoRefreshTokens(!autoRefreshTokens)}\n className={cn(\n 'relative w-11 h-6 rounded-full transition-colors flex-shrink-0',\n autoRefreshTokens ? 'bg-primary' : 'bg-muted'\n )}\n >\n <span\n className={cn(\n 'absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform',\n autoRefreshTokens && 'translate-x-5'\n )}\n />\n </button>\n </div>\n </div>\n </div>\n\n {/* Save Button */}\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={saving}\n className=\"inline-flex items-center gap-2 px-6 py-3 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-all disabled:opacity-50\"\n >\n {saving ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : saved ? (\n <CheckCircle2 size={16} />\n ) : (\n <Save size={16} />\n )}\n {saving\n ? tx('integrations.settings.actions.saving', 'Saving...')\n : saved\n ? tx('integrations.settings.actions.saved', 'Saved!')\n : tx('integrations.settings.actions.save', 'Save Settings')}\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAgB,IAAuB;CACrC,IAAM,EAAE,cAAW,KAAK,aAAU,qBAAkB,GAAiB,EAC/D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,GAAkB,MAA6C;EACtF,IAAM,IAAa,EAAE,GAAK,EAAO;AAIjC,SAHI,MAAe,IACd,IAEE,OAAO,QAAQ,EAAO,CAAC,QAC3B,GAAO,CAAC,GAAU,OACjB,EACG,QAAQ,KAAK,EAAS,KAAK,OAAO,EAAW,CAAC,CAC9C,QAAQ,IAAI,EAAS,IAAI,OAAO,EAAW,CAAC,EACjD,EACD,GARmB,IADW;IAW3B,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,IAAW,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;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,MAAK;KACL,SAxOW,YAAY;AAM7B,MALA,EAAU,GAAK,EAEf,MAAM,IAAI,SAAS,MAAY,WAAW,GAAS,IAAK,CAAC,EACzD,EAAU,GAAM,EAChB,EAAS,GAAK,EACd,iBAAiB,EAAS,GAAM,EAAE,IAAK;;KAmOjC,UAAU;KACV,WAAU;eAJZ,CAMG,IACC,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,GAE9C,EADE,IACD,IAEA,GAFD,EAAc,MAAM,IAAM,CAER,EAEnB,IACG,EAAG,wCAAwC,YAAY,GACvD,IACE,EAAG,uCAAuC,SAAS,GACnD,EAAG,sCAAsC,gBAAgB,CACxD;;IACL,CAAA;GACF;MAvNJ,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IAAQ,MAAM;IAAI,WAAU;IAA+B,CAAA;GAC3D,kBAAC,MAAD;IAAI,WAAU;cACX,EAAG,4CAA4C,gBAAgB;IAC7D,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,kDACA,4DACD;IACC,CAAA;GACJ,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,IAAW,EAAS;IACnC,WAAU;cAHZ;KAKE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAAC;KACvB,EAAG,2CAA2C,mBAAmB;KAC3D;;GACL"}
|
|
1
|
+
{"version":3,"file":"IntegrationsSettings.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsSettings.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Settings,\n ArrowLeft,\n Globe,\n Clock,\n Shield,\n Save,\n Loader2,\n CheckCircle2,\n Copy,\n Check,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { nativeCopyText, nativeImpact } from '../../utils/nativeBridge';\n\n/**\n * Integrations Settings — module configuration page.\n */\nexport function IntegrationsSettings() {\n const { basePath = '/', navigate, apiGatewayUrl } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canWrite = hasPermission(INTEGRATION_PERMISSIONS.INTEGRATION_WRITE);\n\n const [connectionTimeout, setConnectionTimeout] = useState(30);\n const [healthCheckInterval, setHealthCheckInterval] = useState(60);\n const [autoRefreshTokens, setAutoRefreshTokens] = useState(true);\n const [saving, setSaving] = useState(false);\n const [saved, setSaved] = useState(false);\n const [copiedRedirectUri, setCopiedRedirectUri] = useState(false);\n\n // Compute the default OAuth redirect URI based on the gateway URL\n const oauthRedirectUri = apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : `${typeof window !== 'undefined' ? window.location.origin : ''}/integrations/oauth/callback`;\n\n const handleSave = async () => {\n setSaving(true);\n // Simulated save — in production this would call a GraphQL mutation\n await new Promise((resolve) => setTimeout(resolve, 1000));\n setSaving(false);\n setSaved(true);\n setTimeout(() => setSaved(false), 3000);\n };\n\n const handleCopyRedirectUri = async () => {\n void nativeImpact('light');\n const ok = await nativeCopyText(oauthRedirectUri);\n if (!ok) {\n // Last-resort fallback for very old browsers without clipboard or execCommand support\n const input = document.createElement('input');\n input.value = oauthRedirectUri;\n document.body.appendChild(input);\n input.select();\n document.execCommand('copy');\n document.body.removeChild(input);\n }\n setCopiedRedirectUri(true);\n setTimeout(() => setCopiedRedirectUri(false), 2000);\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!canWrite) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <Shield size={48} className=\"text-text-secondary mb-4\" />\n <h2 className=\"text-xl font-bold text-text-primary mb-2\">\n {tx('integrations.settings.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-6 max-w-sm\">\n {tx(\n 'integrations.settings.accessDenied.description',\n \"You don't have permission to manage integration settings.\"\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={16} />{' '}\n {tx('integrations.settings.accessDenied.back', 'Back to Overview')}\n </button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl mx-auto\">\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all\"\n aria-label={tx('integrations.settings.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Settings size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tx('integrations.settings.title', 'Integrations Settings')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx('integrations.settings.subtitle', 'Configure integration module behavior')}\n </p>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n {/* OAuth Redirect URI */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Globe size={18} className=\"text-primary\" />\n {tx('integrations.settings.oauth.title', 'OAuth Configuration')}\n </h2>\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-text-primary\">\n {tx('integrations.settings.oauth.redirectUriLabel', 'Default OAuth Redirect URI')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.oauth.redirectUriDescription',\n 'Use this URL as the redirect/callback URI when configuring OAuth applications with providers.'\n )}\n </p>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-sunken/30 font-mono text-sm text-text-primary break-all\">\n {oauthRedirectUri}\n </div>\n <button\n type=\"button\"\n onClick={handleCopyRedirectUri}\n className=\"p-2.5 rounded-lg border border-border-subtle hover:bg-accent transition-colors flex-shrink-0\"\n aria-label={tx('integrations.settings.oauth.copyAriaLabel', 'Copy redirect URI')}\n >\n {copiedRedirectUri ? (\n <Check size={16} className=\"text-status-success-text\" />\n ) : (\n <Copy size={16} />\n )}\n </button>\n </div>\n </div>\n </div>\n\n {/* Connection Settings */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Clock size={18} className=\"text-primary\" />\n {tx('integrations.settings.connection.title', 'Connection Settings')}\n </h2>\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"conn-timeout\" className=\"block text-sm font-semibold mb-2\">\n {tx('integrations.settings.connection.timeoutLabel', 'Connection Timeout (seconds)')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.connection.timeoutDescription',\n 'Maximum time to wait when testing or using a connection.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"conn-timeout\"\n value={connectionTimeout}\n onChange={(e) => setConnectionTimeout(Number(e.target.value))}\n min={5}\n max={120}\n aria-label={tx(\n 'integrations.settings.connection.timeoutLabel',\n 'Connection Timeout (seconds)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n <div>\n <label htmlFor=\"health-interval\" className=\"block text-sm font-semibold mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckDescription',\n 'How often to automatically check connection health.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"health-interval\"\n value={healthCheckInterval}\n onChange={(e) => setHealthCheckInterval(Number(e.target.value))}\n min={5}\n max={1440}\n aria-label={tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n </div>\n </div>\n\n {/* Security Settings */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.settings.security.title', 'Security')}\n </h2>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <label htmlFor=\"auto-refresh\" className=\"text-sm font-semibold text-text-primary\">\n {tx('integrations.settings.security.autoRefreshLabel', 'Auto-refresh OAuth Tokens')}\n </label>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tx(\n 'integrations.settings.security.autoRefreshDescription',\n 'Automatically refresh tokens before they expire.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n id=\"auto-refresh\"\n role=\"switch\"\n aria-checked={autoRefreshTokens}\n aria-label={tx(\n 'integrations.settings.security.autoRefreshLabel',\n 'Auto-refresh OAuth Tokens'\n )}\n onClick={() => setAutoRefreshTokens(!autoRefreshTokens)}\n className={cn(\n 'relative w-11 h-6 rounded-full transition-colors flex-shrink-0',\n autoRefreshTokens ? 'bg-action-primary-bg' : 'bg-bg-sunken'\n )}\n >\n <span\n className={cn(\n 'absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform',\n autoRefreshTokens && 'translate-x-5'\n )}\n />\n </button>\n </div>\n </div>\n </div>\n\n {/* Save Button */}\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={saving}\n className=\"inline-flex items-center gap-2 px-6 py-3 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-all disabled:opacity-50\"\n >\n {saving ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : saved ? (\n <CheckCircle2 size={16} />\n ) : (\n <Save size={16} />\n )}\n {saving\n ? tx('integrations.settings.actions.saving', 'Saving...')\n : saved\n ? tx('integrations.settings.actions.saved', 'Saved!')\n : tx('integrations.settings.actions.save', 'Save Settings')}\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAgB,IAAuB;CACrC,IAAM,EAAE,cAAW,KAAK,aAAU,qBAAkB,GAAiB,EAC/D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,GAAkB,MAA6C;EACtF,IAAM,IAAa,EAAE,GAAK,EAAO;AAIjC,SAHI,MAAe,IACd,IAEE,OAAO,QAAQ,EAAO,CAAC,QAC3B,GAAO,CAAC,GAAU,OACjB,EACG,QAAQ,KAAK,EAAS,KAAK,OAAO,EAAW,CAAC,CAC9C,QAAQ,IAAI,EAAS,IAAI,OAAO,EAAW,CAAC,EACjD,EACD,GARmB,IADW;IAW3B,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,IAAW,EAAc,EAAwB,kBAAkB,EAEnE,CAAC,GAAmB,KAAwB,EAAS,GAAG,EACxD,CAAC,GAAqB,KAA0B,EAAS,GAAG,EAC5D,CAAC,GA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Y,WAAW,GAAS,IAAK,CAAC,EACzD,EAAU,GAAM,EAChB,EAAS,GAAK,EACd,iBAAiB,EAAS,GAAM,EAAE,IAAK;;KAmOjC,UAAU;KACV,WAAU;eAJZ,CAMG,IACC,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,GAE9C,EADE,IACD,IAEA,GAFD,EAAc,MAAM,IAAM,CAER,EAEnB,IACG,EAAG,wCAAwC,YAAY,GACvD,IACE,EAAG,uCAAuC,SAAS,GACnD,EAAG,sCAAsC,gBAAgB,CACxD;;IACL,CAAA;GACF;MAvNJ,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IAAQ,MAAM;IAAI,WAAU;IAA6B,CAAA;GACzD,kBAAC,MAAD;IAAI,WAAU;cACX,EAAG,4CAA4C,gBAAgB;IAC7D,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,kDACA,4DACD;IACC,CAAA;GACJ,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,IAAW,EAAS;IACnC,WAAU;cAHZ;KAKE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAAC;KACvB,EAAG,2CAA2C,mBAAmB;KAC3D;;GACL"}
|
|
@@ -82,7 +82,7 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
82
82
|
className: "space-y-6 p-6 max-w-7xl mx-auto",
|
|
83
83
|
children: [
|
|
84
84
|
/* @__PURE__ */ S("div", {
|
|
85
|
-
className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm",
|
|
85
|
+
className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm",
|
|
86
86
|
"data-tour": "integrations-providers-header",
|
|
87
87
|
children: [/* @__PURE__ */ S("div", {
|
|
88
88
|
className: "relative z-10 flex items-center gap-4",
|
|
@@ -95,23 +95,23 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
95
95
|
children: /* @__PURE__ */ x(d, { size: 20 })
|
|
96
96
|
}),
|
|
97
97
|
/* @__PURE__ */ x("div", {
|
|
98
|
-
className: "p-2.5 rounded-lg bg-primary/10 backdrop-blur-sm",
|
|
98
|
+
className: "p-2.5 rounded-lg bg-action-primary-bg/10 backdrop-blur-sm",
|
|
99
99
|
children: /* @__PURE__ */ x(_, {
|
|
100
100
|
size: 24,
|
|
101
101
|
className: "text-primary"
|
|
102
102
|
})
|
|
103
103
|
}),
|
|
104
104
|
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h1", {
|
|
105
|
-
className: "text-2xl sm:text-3xl font-bold text-
|
|
105
|
+
className: "text-2xl sm:text-3xl font-bold text-text-primary",
|
|
106
106
|
children: D("integrations.providerCatalog.title", "Provider Catalog")
|
|
107
107
|
}), /* @__PURE__ */ x("p", {
|
|
108
|
-
className: "text-sm text-
|
|
108
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
109
109
|
children: D("integrations.providerCatalog.subtitle", "Browse, install, and manage integration providers")
|
|
110
110
|
})] }),
|
|
111
111
|
C && U && /* @__PURE__ */ S("button", {
|
|
112
112
|
type: "button",
|
|
113
113
|
onClick: () => T?.(i(w, "providers/new")),
|
|
114
|
-
className: "ml-auto inline-flex items-center gap-2 px-4 py-2.5 rounded-lg bg-primary text-primary-
|
|
114
|
+
className: "ml-auto inline-flex items-center gap-2 px-4 py-2.5 rounded-lg bg-action-primary-bg text-action-primary-text text-sm font-medium hover:bg-action-primary-bg/90 transition-colors",
|
|
115
115
|
children: [/* @__PURE__ */ x(_, { size: 16 }), D("integrations.providerCatalog.actions.addProvider", "Add Provider")]
|
|
116
116
|
})
|
|
117
117
|
]
|
|
@@ -127,20 +127,20 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
127
127
|
"data-tour": "integrations-providers-search",
|
|
128
128
|
children: [/* @__PURE__ */ x(g, {
|
|
129
129
|
size: 18,
|
|
130
|
-
className: "absolute left-3 top-1/2 -translate-y-1/2 text-
|
|
130
|
+
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors"
|
|
131
131
|
}), /* @__PURE__ */ x("input", {
|
|
132
132
|
type: "text",
|
|
133
133
|
placeholder: D("integrations.providerCatalog.search.placeholder", "Search providers by name, description, or key..."),
|
|
134
134
|
value: A.search,
|
|
135
135
|
onChange: (e) => j({ search: e.target.value }),
|
|
136
|
-
className: "w-full pl-10 pr-4 py-2.5 border border-border rounded-lg bg-
|
|
136
|
+
className: "w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
|
|
137
137
|
"aria-label": D("integrations.providerCatalog.search.ariaLabel", "Search providers")
|
|
138
138
|
})]
|
|
139
139
|
}),
|
|
140
140
|
/* @__PURE__ */ S("button", {
|
|
141
141
|
type: "button",
|
|
142
142
|
onClick: () => G(!W),
|
|
143
|
-
className: t("inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all", W || Y ? "bg-primary text-primary-
|
|
143
|
+
className: t("inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all", W || Y ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface text-text-primary border-border-subtle hover:bg-accent"),
|
|
144
144
|
children: [
|
|
145
145
|
/* @__PURE__ */ x(f, { size: 16 }),
|
|
146
146
|
W ? D("integrations.providerCatalog.filters.hide", "Hide") : D("integrations.providerCatalog.filters.show", "Filter"),
|
|
@@ -155,28 +155,28 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
155
155
|
]
|
|
156
156
|
}),
|
|
157
157
|
/* @__PURE__ */ S("div", {
|
|
158
|
-
className: "flex items-center border border-border rounded-lg overflow-hidden",
|
|
158
|
+
className: "flex items-center border border-border-subtle rounded-lg overflow-hidden",
|
|
159
159
|
children: [/* @__PURE__ */ x("button", {
|
|
160
160
|
type: "button",
|
|
161
161
|
onClick: () => k("grid"),
|
|
162
|
-
className: t("p-2.5 transition-colors", O === "grid" ? "bg-primary text-primary-
|
|
162
|
+
className: t("p-2.5 transition-colors", O === "grid" ? "bg-action-primary-bg text-action-primary-text" : "hover:bg-accent"),
|
|
163
163
|
"aria-label": D("integrations.providerCatalog.view.gridAriaLabel", "Grid view"),
|
|
164
164
|
children: /* @__PURE__ */ x(p, { size: 16 })
|
|
165
165
|
}), /* @__PURE__ */ x("button", {
|
|
166
166
|
type: "button",
|
|
167
167
|
onClick: () => k("list"),
|
|
168
|
-
className: t("p-2.5 transition-colors", O === "list" ? "bg-primary text-primary-
|
|
168
|
+
className: t("p-2.5 transition-colors", O === "list" ? "bg-action-primary-bg text-action-primary-text" : "hover:bg-accent"),
|
|
169
169
|
"aria-label": D("integrations.providerCatalog.view.listAriaLabel", "List view"),
|
|
170
170
|
children: /* @__PURE__ */ x(m, { size: 16 })
|
|
171
171
|
})]
|
|
172
172
|
})
|
|
173
173
|
]
|
|
174
174
|
}), W && /* @__PURE__ */ S("div", {
|
|
175
|
-
className: "rounded-xl border border-border/50 bg-
|
|
175
|
+
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200",
|
|
176
176
|
children: [/* @__PURE__ */ S("div", {
|
|
177
177
|
className: "flex items-center justify-between mb-4",
|
|
178
178
|
children: [/* @__PURE__ */ S("h3", {
|
|
179
|
-
className: "font-semibold text-
|
|
179
|
+
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
180
180
|
children: [/* @__PURE__ */ x(f, {
|
|
181
181
|
size: 16,
|
|
182
182
|
className: "text-primary"
|
|
@@ -184,7 +184,7 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
184
184
|
}), Y && /* @__PURE__ */ S("button", {
|
|
185
185
|
type: "button",
|
|
186
186
|
onClick: X,
|
|
187
|
-
className: "text-sm text-
|
|
187
|
+
className: "text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1",
|
|
188
188
|
children: [/* @__PURE__ */ x(v, { size: 14 }), D("integrations.providerCatalog.filters.clearAll", "Clear All")]
|
|
189
189
|
})]
|
|
190
190
|
}), /* @__PURE__ */ S("div", {
|
|
@@ -193,12 +193,12 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
193
193
|
/* @__PURE__ */ S("div", {
|
|
194
194
|
className: "space-y-2",
|
|
195
195
|
children: [/* @__PURE__ */ x("label", {
|
|
196
|
-
className: "block text-sm font-medium text-
|
|
196
|
+
className: "block text-sm font-medium text-text-primary",
|
|
197
197
|
children: D("integrations.providerCatalog.filters.category.label", "Category")
|
|
198
198
|
}), /* @__PURE__ */ S("select", {
|
|
199
199
|
value: A.category,
|
|
200
200
|
onChange: (e) => j({ category: e.target.value }),
|
|
201
|
-
className: "w-full px-3 py-2 border border-border rounded-lg bg-
|
|
201
|
+
className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
202
202
|
children: [/* @__PURE__ */ x("option", {
|
|
203
203
|
value: "all",
|
|
204
204
|
children: Z("all")
|
|
@@ -211,12 +211,12 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
211
211
|
/* @__PURE__ */ S("div", {
|
|
212
212
|
className: "space-y-2",
|
|
213
213
|
children: [/* @__PURE__ */ x("label", {
|
|
214
|
-
className: "block text-sm font-medium text-
|
|
214
|
+
className: "block text-sm font-medium text-text-primary",
|
|
215
215
|
children: D("integrations.providerCatalog.filters.authType.label", "Auth Type")
|
|
216
216
|
}), /* @__PURE__ */ S("select", {
|
|
217
217
|
value: K,
|
|
218
218
|
onChange: (e) => q(e.target.value),
|
|
219
|
-
className: "w-full px-3 py-2 border border-border rounded-lg bg-
|
|
219
|
+
className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
220
220
|
children: [/* @__PURE__ */ x("option", {
|
|
221
221
|
value: "all",
|
|
222
222
|
children: Q("all")
|
|
@@ -229,12 +229,12 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
229
229
|
/* @__PURE__ */ S("div", {
|
|
230
230
|
className: "space-y-2",
|
|
231
231
|
children: [/* @__PURE__ */ x("label", {
|
|
232
|
-
className: "block text-sm font-medium text-
|
|
232
|
+
className: "block text-sm font-medium text-text-primary",
|
|
233
233
|
children: D("integrations.providerCatalog.filters.pluginStatus.label", "Plugin Status")
|
|
234
234
|
}), /* @__PURE__ */ S("select", {
|
|
235
235
|
value: A.pluginStatus,
|
|
236
236
|
onChange: (e) => j({ pluginStatus: e.target.value }),
|
|
237
|
-
className: "w-full px-3 py-2 border border-border rounded-lg bg-
|
|
237
|
+
className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
238
238
|
children: [/* @__PURE__ */ x("option", {
|
|
239
239
|
value: "all",
|
|
240
240
|
children: $("all")
|
|
@@ -283,16 +283,16 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
283
283
|
,
|
|
284
284
|
,
|
|
285
285
|
]].map((e, t) => /* @__PURE__ */ S("div", {
|
|
286
|
-
className: "rounded-xl border border-border/50 bg-
|
|
286
|
+
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5 animate-pulse",
|
|
287
287
|
children: [/* @__PURE__ */ S("div", {
|
|
288
288
|
className: "flex items-start gap-3",
|
|
289
|
-
children: [/* @__PURE__ */ x("div", { className: "size-12 bg-
|
|
289
|
+
children: [/* @__PURE__ */ x("div", { className: "size-12 bg-bg-sunken rounded-xl" }), /* @__PURE__ */ S("div", {
|
|
290
290
|
className: "flex-1 space-y-2",
|
|
291
|
-
children: [/* @__PURE__ */ x("div", { className: "h-4 w-3/4 bg-
|
|
291
|
+
children: [/* @__PURE__ */ x("div", { className: "h-4 w-3/4 bg-bg-sunken rounded" }), /* @__PURE__ */ x("div", { className: "h-3 w-full bg-bg-sunken rounded" })]
|
|
292
292
|
})]
|
|
293
293
|
}), /* @__PURE__ */ S("div", {
|
|
294
294
|
className: "flex gap-2 mt-4",
|
|
295
|
-
children: [/* @__PURE__ */ x("div", { className: "h-5 w-16 bg-
|
|
295
|
+
children: [/* @__PURE__ */ x("div", { className: "h-5 w-16 bg-bg-sunken rounded-full" }), /* @__PURE__ */ x("div", { className: "h-5 w-20 bg-bg-sunken rounded-full" })]
|
|
296
296
|
})]
|
|
297
297
|
}, t))
|
|
298
298
|
}),
|
|
@@ -311,24 +311,24 @@ function C({ showCreateProviderButton: C = !1 }) {
|
|
|
311
311
|
className: "flex flex-col items-center justify-center py-16 text-center",
|
|
312
312
|
children: [
|
|
313
313
|
/* @__PURE__ */ x("div", {
|
|
314
|
-
className: "p-4 rounded-full bg-
|
|
314
|
+
className: "p-4 rounded-full bg-bg-sunken/50 mb-4",
|
|
315
315
|
children: x(Y ? g : _, {
|
|
316
316
|
size: 32,
|
|
317
|
-
className: "text-
|
|
317
|
+
className: "text-text-secondary"
|
|
318
318
|
})
|
|
319
319
|
}),
|
|
320
320
|
/* @__PURE__ */ x("h3", {
|
|
321
|
-
className: "font-semibold text-
|
|
321
|
+
className: "font-semibold text-text-primary mb-1",
|
|
322
322
|
children: Y ? D("integrations.providerCatalog.empty.filteredTitle", "No matching providers") : D("integrations.providerCatalog.empty.title", "No providers available")
|
|
323
323
|
}),
|
|
324
324
|
/* @__PURE__ */ x("p", {
|
|
325
|
-
className: "text-sm text-
|
|
325
|
+
className: "text-sm text-text-secondary max-w-sm",
|
|
326
326
|
children: Y ? D("integrations.providerCatalog.empty.filteredDescription", "Try adjusting your search or filters.") : D("integrations.providerCatalog.empty.description", "Integration providers will appear here once configured.")
|
|
327
327
|
}),
|
|
328
328
|
Y && /* @__PURE__ */ S("button", {
|
|
329
329
|
type: "button",
|
|
330
330
|
onClick: X,
|
|
331
|
-
className: "mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors",
|
|
331
|
+
className: "mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors",
|
|
332
332
|
children: [/* @__PURE__ */ x(v, { size: 14 }), D("integrations.providerCatalog.empty.clearFilters", "Clear Filters")]
|
|
333
333
|
})
|
|
334
334
|
]
|