@burdenoff/microfe-integrations 2026.929.3 → 2026.930.1

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 +1 @@
1
- {"version":3,"file":"AddConnectionDialog.js","names":[],"sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"sourcesContent":["/**\n * AddConnectionDialog -- n8n-style popup for creating new connections.\n *\n * Replaces the full-page AddConnectionWizard with an inline modal dialog.\n * Uses the same hooks and GraphQL operations that already exist in\n * microfe-integrations (useCreateConnection, useInitiateOAuth, etc.).\n *\n * Opens from any page via Zustand store state, so there is no navigation\n * to /connections/add — the dialog overlays the current page.\n */\n\nimport { useState, useMemo, useCallback, useEffect, useRef, useId } from 'react';\nimport {\n X,\n Check,\n Loader2,\n AlertCircle,\n CheckCircle2,\n Search,\n ExternalLink,\n Shield,\n Link2,\n Info,\n Copy,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../hooks/useTr';\nimport { useCategoryLabel, useAuthTypeLabel } from '../hooks/useLabel';\nimport { legacyFlowForAuthType } from '../utils/integrationsHelpers';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useProviders, useProvider } from '../hooks/useProviders';\nimport {\n useCreateConnection,\n useInitiateOAuth,\n useAuthenticateConnection,\n useAuthenticateWithServiceAccount,\n} from '../hooks/useConnections';\nimport { useGetConnectionLazyQuery } from '../../generated/wspace-operations';\nimport { waitForOAuthPopupCompletion } from '../utils/oauthPopup';\nimport {\n CredentialStorageSelector,\n type CredentialStorageState,\n} from './CredentialStorageSelector';\nimport { AuthMethodNotice, AuthMethodSelector } from './AuthMethodSelector';\nimport { ProviderIcon } from './ProviderIcon';\nimport {\n SchemaForm,\n initialValuesFromSchema,\n isSchemaComplete,\n parseFormSchema,\n visibleValues,\n} from './SchemaForm';\nimport type { IntegrationProvider } from '../types';\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface AddConnectionDialogProps {\n /** Whether the dialog is open */\n open: boolean;\n /** Callback to close the dialog */\n onClose: () => void;\n /** Pre-selected provider ID (skips provider picker step) */\n preselectedProviderId?: string | null;\n /** Callback when a connection is successfully created */\n onConnectionCreated?: (connectionId: string) => void;\n}\n\ntype DialogTab = 'connection' | 'details';\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Above the app shell's header (`z-index: 100`).\n *\n * The dialog used to sit at Tailwind's `z-50`, so the shell header painted over\n * its top edge and swallowed the title and the Method control — the dialog\n * looked \"cut off\" no matter how its height was constrained. A modal must\n * out-rank the chrome it covers, and Tailwind's scale stops well below it.\n */\nconst OVERLAY_Z = 1100;\nconst DIALOG_Z = 1101;\n\nexport function AddConnectionDialog({\n open,\n onClose,\n preselectedProviderId,\n onConnectionCreated,\n}: AddConnectionDialogProps) {\n // Provider data\n const tr = useTr();\n const getCategoryLabel = useCategoryLabel();\n const getAuthTypeLabel = useAuthTypeLabel();\n const { apiGatewayUrl } = useIntegrations();\n const { providers, loading: providersLoading } = useProviders();\n // A preselected id may not be in the catalog page (disabled provider linked\n // from its own detail page). Resolve such ids via a direct by-id fetch so the\n // dialog never dead-ends on a blank body.\n const providerInList = useMemo(\n () =>\n preselectedProviderId\n ? ((providers ?? []).find((p: IntegrationProvider) => p.id === preselectedProviderId) ??\n null)\n : null,\n [providers, preselectedProviderId]\n );\n // Only fetch once the catalog has loaded and confirmed the id isn't in the\n // filtered list — avoids a redundant GetProvider for visible providers.\n const { provider: fetchedPreselectedProvider, loading: fetchedPreselectedLoading } = useProvider(\n !providersLoading && preselectedProviderId && !providerInList ? preselectedProviderId : ''\n );\n const resolvedPreselectedProvider = providerInList ?? fetchedPreselectedProvider;\n // True while a preselected provider is still being resolved (catalog load or\n // the by-id fallback fetch) — keeps the body showing a spinner, not blank.\n const preselectedResolving =\n !!preselectedProviderId &&\n !resolvedPreselectedProvider &&\n (providersLoading || fetchedPreselectedLoading);\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreate = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n // Mutations\n const { createConnection, loading: creating } = useCreateConnection();\n const { initiateOAuth, loading: oauthLoading } = useInitiateOAuth();\n const { authenticateConnection, loading: authenticating } = useAuthenticateConnection();\n const { authenticateWithServiceAccount, loading: serviceAccountLoading } =\n useAuthenticateWithServiceAccount();\n const [fetchConnection] = useGetConnectionLazyQuery({ fetchPolicy: 'network-only' });\n\n // State\n const [selectedProvider, setSelectedProvider] = useState<IntegrationProvider | null>(null);\n const [showPicker, setShowPicker] = useState(!preselectedProviderId);\n const [activeTab, setActiveTab] = useState<DialogTab>('connection');\n const [searchQuery, setSearchQuery] = useState('');\n const [connectionName, setConnectionName] = useState('');\n const [connectionDescription, setConnectionDescription] = useState('');\n /** Auth method the user picked; null until a provider is selected. */\n const [selectedAuthMethodKey, setSelectedAuthMethodKey] = useState<string | null>(null);\n /** Values for the selected method's schema-described fields. */\n const [fieldValues, setFieldValues] = useState<Record<string, unknown>>({});\n const [credentialStorage, setCredentialStorage] = useState<CredentialStorageState>({\n mode: 'managed',\n vaultId: '',\n secretId: '',\n managedSecretName: '',\n });\n const [errorMessage, setErrorMessage] = useState('');\n const [redirectCopied, setRedirectCopied] = useState(false);\n const [success, setSuccess] = useState(false);\n const [oauthWaiting, setOauthWaiting] = useState(false);\n const [, setCreatedConnectionId] = useState<string | null>(null);\n\n const oauthPopupRef = useRef<Window | null>(null);\n const oauthCleanupRef = useRef<(() => void) | null>(null);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const idPrefix = useId();\n const fieldId = (name: string) => `${idPrefix}-${name}`;\n\n // ── Auth method resolution ────────────────────────────────────────────────\n // Everything the auth section renders and submits derives from the selected\n // method. Providers with a single method behave exactly as before.\n const authMethods = useMemo(\n () => (selectedProvider?.authMethods ?? []).filter((method) => method.isEnabled),\n [selectedProvider]\n );\n const selectedAuthMethod = useMemo(\n () =>\n authMethods.find((method) => method.key === selectedAuthMethodKey) ?? authMethods[0] ?? null,\n [authMethods, selectedAuthMethodKey]\n );\n // Fall back to the provider's own authType for providers whose methods have\n // not been fetched (older fragments) or backfilled yet.\n const authFlow = selectedAuthMethod?.flow ?? legacyFlowForAuthType(selectedProvider?.authType);\n const authTypeForMethod = selectedAuthMethod?.authType ?? selectedProvider?.authType;\n\n // The exact value the provider will compare against at the callback. Built\n // here rather than only at submit time so the dialog can show the user what\n // to register in their own OAuth app.\n const oauthCallbackUrl = apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : '/integrations/oauth/callback';\n // Memoized: a fresh array each render would re-create handleSubmit's\n // useCallback on every render.\n const authScopes = useMemo(\n () =>\n selectedAuthMethod?.defaultScopes?.length\n ? selectedAuthMethod.defaultScopes\n : (selectedProvider?.defaultScopes ?? []),\n [selectedAuthMethod, selectedProvider]\n );\n const activeSchema = useMemo(\n () => parseFormSchema(selectedAuthMethod?.configSchema ?? selectedProvider?.configSchema),\n [selectedAuthMethod, selectedProvider]\n );\n\n // Selecting a different method must not carry the previous method's values\n // over — they belong to a different credential shape entirely.\n useEffect(() => {\n // Seeded from the schema's declared defaults, not empty: a rendered control\n // shows its default as selected, so leaving state empty made validation\n // treat a visible value as missing and dropped it from the submission.\n setFieldValues(initialValuesFromSchema(activeSchema));\n setErrorMessage('');\n // activeSchema is derived from these two, so it is not an extra trigger.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedAuthMethodKey, selectedProvider?.id]);\n\n useEffect(() => {\n if (!open) return undefined;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onClose();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [open, onClose]);\n\n // Cleanup OAuth listener and popup on unmount.\n useEffect(() => {\n return () => {\n oauthCleanupRef.current?.();\n if (oauthPopupRef.current && !oauthPopupRef.current.closed) {\n oauthPopupRef.current.close();\n }\n };\n }, []);\n\n // Reset state when dialog opens\n useEffect(() => {\n if (open) {\n setActiveTab('connection');\n setSearchQuery('');\n setConnectionName('');\n setConnectionDescription('');\n setSelectedAuthMethodKey(null);\n setFieldValues({});\n setCredentialStorage({ mode: 'managed', vaultId: '', secretId: '', managedSecretName: '' });\n setErrorMessage('');\n setSuccess(false);\n setOauthWaiting(false);\n setCreatedConnectionId(null);\n\n if (preselectedProviderId) {\n setShowPicker(false);\n setSelectedProvider(null); // will be set by effect below\n } else {\n setShowPicker(true);\n setSelectedProvider(null);\n }\n }\n }, [open, preselectedProviderId]);\n\n // Find and set preselected provider (from the filtered list or, for hidden\n // built-ins, the direct by-id fetch above).\n useEffect(() => {\n if (open && preselectedProviderId && resolvedPreselectedProvider && !selectedProvider) {\n setSelectedProvider(resolvedPreselectedProvider);\n setConnectionName(`${resolvedPreselectedProvider.name} Connection`);\n setShowPicker(false);\n }\n }, [open, preselectedProviderId, resolvedPreselectedProvider, selectedProvider]);\n\n // Auto-focus search input when picker is shown\n useEffect(() => {\n if (open && showPicker) {\n const timeoutId = setTimeout(() => searchInputRef.current?.focus(), 100);\n return () => clearTimeout(timeoutId);\n }\n return undefined;\n }, [open, showPicker]);\n // True for \"Custom OAuth 2.0\" and the generic OAuth provider — the methods\n // where the user brings an app of their own and therefore needs the redirect\n // URL. Derived from the schema rather than a hardcoded method key so an\n // admin-authored method that asks for a client id gets the same help.\n const collectsOwnClientId = Boolean(\n activeSchema && Object.prototype.hasOwnProperty.call(activeSchema.properties ?? {}, 'clientId')\n );\n\n // Filter providers for picker\n const filteredProviders = useMemo(() => {\n const installed = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed' && p.isEnabled\n );\n if (!searchQuery.trim()) return installed;\n const q = searchQuery.toLowerCase();\n return installed.filter(\n (p: IntegrationProvider) =>\n p.name.toLowerCase().includes(q) ||\n (p.description ?? '').toLowerCase().includes(q) ||\n p.key.toLowerCase().includes(q)\n );\n }, [providers, searchQuery]);\n\n // Group providers by category\n const groupedProviders = useMemo(() => {\n const groups: Record<string, IntegrationProvider[]> = {};\n filteredProviders.forEach((p: IntegrationProvider) => {\n const cat = p.category;\n if (!groups[cat]) groups[cat] = [];\n groups[cat].push(p);\n });\n return groups;\n }, [filteredProviders]);\n\n const handleSelectProvider = useCallback((provider: IntegrationProvider) => {\n setSelectedProvider(provider);\n setConnectionName(`${provider.name} Connection`);\n setShowPicker(false);\n setErrorMessage('');\n }, []);\n\n const isAuthenticating =\n creating || oauthLoading || oauthWaiting || authenticating || serviceAccountLoading;\n\n // Main submit handler\n const handleSubmit = useCallback(async () => {\n if (!selectedProvider || !connectionName.trim()) return;\n\n // Methods that mint tokens on demand store no credential, so they need no\n // vault/secret — skip the credential-storage requirement entirely.\n const isServiceAccount = authFlow === 'minted';\n\n if (!isServiceAccount) {\n if (!credentialStorage.vaultId) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.errors.vaultRequired',\n 'Please select a vault for storing or referencing credentials'\n )\n );\n return;\n }\n if (credentialStorage.mode === 'existing' && !credentialStorage.secretId) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.errors.secretRequired',\n 'Please select an existing vault secret to reuse'\n )\n );\n return;\n }\n }\n\n if (authFlow === 'oauth2' && activeSchema && !isSchemaComplete(activeSchema, fieldValues)) {\n setErrorMessage(\n tr('integrations.addConnection.errors.fieldsRequired', 'Please fill in all required fields')\n );\n return;\n }\n\n if (selectedAuthMethod && !selectedAuthMethod.isConfigured) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.authentication.methodNotConfigured',\n 'This authentication method is not configured in this environment. Ask an administrator to add its credentials, or pick another method.'\n )\n );\n return;\n }\n\n try {\n setErrorMessage('');\n\n // Step 1: Create the connection\n const connId = await createConnection({\n name: connectionName.trim(),\n description: connectionDescription.trim() || undefined,\n providerId: selectedProvider.id,\n authMethodKey: selectedAuthMethodKey ?? undefined,\n // OAuth methods collect non-secret routing settings (tenant subdomain,\n // base URL) rather than a credential, so they belong on the connection\n // config, which getConnectionToken already reads for baseUrl.\n ...(authFlow === 'oauth2' && activeSchema\n ? { config: visibleValues(activeSchema, fieldValues) as Record<string, unknown> }\n : {}),\n ...(isServiceAccount\n ? {}\n : {\n vaultId: credentialStorage.vaultId,\n credentialSecretId:\n credentialStorage.mode === 'existing' ? credentialStorage.secretId : undefined,\n managedSecretName:\n credentialStorage.mode === 'managed'\n ? credentialStorage.managedSecretName.trim() || undefined\n : undefined,\n }),\n });\n\n if (!connId) {\n setErrorMessage(\n tr('integrations.addConnection.errors.createFailed', 'Failed to create connection')\n );\n return;\n }\n\n setCreatedConnectionId(connId);\n\n // Step 2: Authenticate. Driven by the auth method's *flow*, not by a\n // per-auth-type branch: FIELDS methods all submit their schema values\n // through one generic mutation, so adding an auth type needs no new case\n // here and no new mutation to call.\n switch (authFlow) {\n case 'oauth2': {\n const result = await initiateOAuth(connId, oauthCallbackUrl, selectedProvider.key);\n if (result?.redirectUrl) {\n const width = 600;\n const height = 700;\n const left = window.screenX + (window.innerWidth - width) / 2;\n const top = window.screenY + (window.innerHeight - height) / 2;\n const popup = window.open(\n result.redirectUrl,\n 'oauth_popup',\n `width=${width},height=${height},left=${left},top=${top},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`\n );\n if (!popup) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.authentication.popupBlocked',\n 'Popup was blocked. Please allow popups for this site and try again.'\n )\n );\n return;\n }\n oauthPopupRef.current = popup;\n setOauthWaiting(true);\n\n oauthCleanupRef.current?.();\n oauthCleanupRef.current = waitForOAuthPopupCompletion({\n connectionId: connId,\n popup,\n fetchConnectionStatus: async () => {\n const { data } = await fetchConnection({ variables: { id: connId } });\n return data?.getConnection ?? null;\n },\n onSuccess: () => {\n setSuccess(true);\n onConnectionCreated?.(connId);\n },\n onError: setErrorMessage,\n onSettled: () => {\n oauthCleanupRef.current = null;\n oauthPopupRef.current = null;\n setOauthWaiting(false);\n },\n });\n\n return;\n }\n setSuccess(true);\n onConnectionCreated?.(connId);\n break;\n }\n case 'minted': {\n // Nothing to collect and nothing stored. SERVICE_ACCOUNT still records\n // the user's delegation for the reserved app; WORKSPACE_APP_TOKEN\n // connections are pure config and are already usable.\n if (authTypeForMethod === 'service_account') {\n await authenticateWithServiceAccount(\n connId,\n authScopes.length > 0 ? authScopes : undefined\n );\n }\n setSuccess(true);\n onConnectionCreated?.(connId);\n break;\n }\n default: {\n // FIELDS: submit whatever the method's schema asked for.\n if (activeSchema) {\n if (!isSchemaComplete(activeSchema, fieldValues)) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.errors.fieldsRequired',\n 'Please fill in all required fields'\n )\n );\n return;\n }\n }\n // Only fields the user can currently see: a `showIf` field that was\n // filled and then hidden must not be submitted, or we would store a\n // credential the user no longer intends to send.\n const values: Record<string, unknown> = {};\n for (const [field, value] of Object.entries(visibleValues(activeSchema, fieldValues))) {\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (trimmed) values[field] = trimmed;\n } else if (value !== undefined && value !== null) {\n values[field] = value;\n }\n }\n await authenticateConnection(connId, selectedAuthMethodKey ?? undefined, values);\n setSuccess(true);\n onConnectionCreated?.(connId);\n }\n }\n } catch (err) {\n setErrorMessage(\n err instanceof Error\n ? err.message\n : tr('integrations.addConnection.errors.authFailed', 'Authentication failed')\n );\n }\n }, [\n selectedProvider,\n connectionName,\n connectionDescription,\n selectedAuthMethodKey,\n authFlow,\n authTypeForMethod,\n authScopes,\n activeSchema,\n fieldValues,\n selectedAuthMethod,\n createConnection,\n initiateOAuth,\n fetchConnection,\n authenticateConnection,\n authenticateWithServiceAccount,\n apiGatewayUrl,\n onConnectionCreated,\n credentialStorage,\n tr,\n ]);\n\n // Tab items\n const tabs: { key: DialogTab; label: string; icon: typeof Link2 }[] = [\n {\n key: 'connection',\n label: tr('integrations.addConnection.tabs.connection', 'Connection'),\n icon: Link2,\n },\n { key: 'details', label: tr('integrations.addConnection.tabs.details', 'Details'), icon: Info },\n ];\n\n if (!open) return null;\n\n if (!canCreate && !permissionsLoading) {\n return (\n <>\n <div\n style={{ zIndex: OVERLAY_Z }}\n className=\"fixed inset-0 bg-bg-overlay animate-in fade-in-0 duration-200\"\n onClick={onClose}\n />\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"add-connection-denied-title\"\n style={{ zIndex: DIALOG_Z }}\n className=\"fixed inset-x-4 top-1/2 mx-auto flex max-w-md -translate-y-1/2 flex-col items-center gap-4 rounded-xl border border-border-subtle bg-bg-surface p-8 shadow-2xl text-center\"\n >\n <Shield size={40} className=\"text-text-secondary\" />\n <h2 id=\"add-connection-denied-title\" className=\"text-lg font-semibold text-text-primary\">\n {tr('integrations.addConnection.denied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'integrations.addConnection.denied.description',\n \"You don't have permission to create connections.\"\n )}\n </p>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors\"\n >\n {tr('integrations.common.close', 'Close')}\n </button>\n </div>\n </>\n );\n }\n\n return (\n <>\n {/* Backdrop */}\n <div\n style={{ zIndex: OVERLAY_Z }}\n className=\"fixed inset-0 bg-bg-overlay animate-in fade-in-0 duration-200\"\n onClick={onClose}\n />\n\n {/* Dialog */}\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"add-connection-dialog-title\"\n /* `sm:` centres the dialog with `top-1/2 bottom-auto`, which leaves its\n height unbounded — a tall provider form grew past the viewport and was\n clipped at BOTH ends, taking the title and the Save button with it.\n The max-height puts the overflow back where it belongs: the scrollable\n body below. */\n style={{ zIndex: DIALOG_Z }}\n className=\"fixed inset-x-4 top-4 bottom-4 mx-auto flex w-auto max-w-3xl flex-col overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl animate-in fade-in-0 zoom-in-95 duration-200 sm:inset-x-6 sm:top-1/2 sm:bottom-auto sm:max-h-[min(90vh,56rem)] sm:w-full sm:-translate-y-1/2\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0\">\n <div className=\"flex items-center gap-3\">\n {selectedProvider && !showPicker ? (\n <>\n <ProviderIcon provider={selectedProvider} size={32} />\n <div>\n <h2\n id=\"add-connection-dialog-title\"\n className=\"text-base font-semibold text-text-primary\"\n >\n {tr('integrations.addConnection.dialog.accountTitle', '{{provider}} account', {\n provider: selectedProvider.name,\n })}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {getAuthTypeLabel(selectedProvider.authType)}\n </p>\n </div>\n </>\n ) : (\n <div>\n <h2\n id=\"add-connection-dialog-title\"\n className=\"text-base font-semibold text-text-primary\"\n >\n {tr('integrations.addConnection.dialog.title', 'Add new credential')}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'integrations.addConnection.dialog.subtitle',\n 'Select an app or service to connect to'\n )}\n </p>\n </div>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {selectedProvider && !showPicker && !success && (\n <button\n type=\"button\"\n onClick={handleSubmit}\n disabled={isAuthenticating || !connectionName.trim()}\n className=\"inline-flex items-center gap-1.5 px-4 py-1.5 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50\"\n >\n {isAuthenticating ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Check size={14} />\n )}\n {oauthWaiting\n ? tr('integrations.addConnection.actions.waiting', 'Waiting...')\n : /* ★ \"Connect\", not \"Save\". This dialog only ever CREATES a\n connection, and a user told to \"find the Connect button\"\n could not: the word appeared nowhere in the flow. Reported\n from production, and confirmed by driving it — the only\n action control read \"Save\".\n\n ★ A dedicated key, not `integrations.common.save`, which\n ProviderEditorPage also uses. Repurposing the shared key\n would rename that button too, and re-pointing a seeded key\n leaves already-translated locales showing the old word. */\n tr('integrations.addConnection.actions.connect', 'Connect')}\n </button>\n )}\n <button\n type=\"button\"\n onClick={onClose}\n className=\"p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary\"\n aria-label={tr('integrations.addConnection.actions.close', 'Close dialog')}\n >\n <X size={20} />\n </button>\n </div>\n </div>\n\n {/* Body */}\n <div className=\"flex flex-1 min-h-0 overflow-hidden\">\n {/* Provider Picker Mode */}\n {showPicker && !selectedProvider && (\n <div className=\"flex-1 p-5 overflow-y-auto\">\n <p className=\"text-sm text-text-secondary mb-3\">\n {tr(\n 'integrations.addConnection.dialog.subtitle',\n 'Select an app or service to connect to'\n )}\n </p>\n <div className=\"relative mb-4\">\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n ref={searchInputRef}\n type=\"text\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n placeholder={tr(\n 'integrations.addConnection.search.placeholder',\n 'Search installed providers...'\n )}\n aria-label={tr(\n 'integrations.addConnection.search.ariaLabel',\n 'Search installed providers'\n )}\n className=\"w-full pl-9 pr-3 py-2.5 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n\n {providersLoading ? (\n <div className=\"flex items-center justify-center py-8\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n ) : filteredProviders.length === 0 ? (\n <IllustratedEmptyState\n illustration={searchQuery ? 'empty-search' : 'empty-data'}\n title={\n searchQuery\n ? tr(\n 'integrations.addConnection.empty.noMatchingProviders',\n 'No matching providers'\n )\n : tr(\n 'integrations.addConnection.empty.noInstalledProviders',\n 'No installed providers yet'\n )\n }\n description={\n searchQuery\n ? tr(\n 'integrations.addConnection.empty.matchingDescription',\n 'No installed provider matches your search. Try a different term or install one from the catalog.',\n { query: searchQuery }\n )\n : tr(\n 'integrations.addConnection.empty.installedDescription',\n 'You need at least one installed, enabled provider before you can create a connection. Install one from the catalog to get started.'\n )\n }\n />\n ) : (\n <div className=\"max-h-[400px] overflow-y-auto space-y-1\">\n {Object.entries(groupedProviders).map(([category, categoryProviders]) => (\n <div key={category}>\n <div className=\"px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider\">\n {getCategoryLabel(category as IntegrationProvider['category'])}\n </div>\n {categoryProviders.map((provider) => (\n <button\n key={provider.id}\n type=\"button\"\n onClick={() => handleSelectProvider(provider)}\n className=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left\"\n >\n <ProviderIcon provider={provider} size={32} />\n <div className=\"flex-1 min-w-0\">\n <div className=\"text-sm font-medium text-text-primary\">\n {provider.name}\n </div>\n <div className=\"text-xs text-text-secondary\">\n {getAuthTypeLabel(provider.authType)}\n </div>\n </div>\n </button>\n ))}\n </div>\n ))}\n </div>\n )}\n </div>\n )}\n\n {/* Loading preselected provider (catalog load or by-id fallback fetch) */}\n {!showPicker && !selectedProvider && preselectedResolving && (\n <div className=\"flex-1 flex items-center justify-center\">\n <Loader2 size={32} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {/* Preselected provider couldn't be resolved (invalid id / fetch error) */}\n {!showPicker && !selectedProvider && !preselectedResolving && preselectedProviderId && (\n <div className=\"flex-1 flex flex-col items-center justify-center p-8 text-center\">\n <AlertCircle size={32} className=\"text-text-secondary mb-3\" />\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'integrations.addConnection.providerUnavailable',\n \"This provider isn't available.\"\n )}\n </p>\n </div>\n )}\n\n {/* Success State */}\n {success && selectedProvider && (\n <div className=\"flex-1 flex flex-col items-center justify-center p-8 text-center\">\n <div className=\"p-3 rounded-full bg-status-success-bg-subtle mb-4\">\n <CheckCircle2 size={48} className=\"text-status-success-text\" />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-1\">\n {tr('integrations.addConnection.success.title', 'Connection Created!')}\n </h3>\n <p className=\"text-sm text-text-secondary mb-6\">\n {tr(\n 'integrations.addConnection.success.description',\n 'Your {{provider}} connection has been set up successfully.',\n { provider: selectedProvider.name }\n )}\n </p>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n {tr('integrations.addConnection.actions.close', 'Close dialog')}\n </button>\n </div>\n )}\n\n {/* Form Mode (with sidebar tabs) */}\n {selectedProvider && !showPicker && !success && (\n <>\n {/* Left Sidebar Tabs */}\n <div className=\"w-full border-b border-border-subtle sm:w-40 sm:border-b-0 sm:border-r flex-shrink-0 py-3 overflow-x-auto\">\n {tabs.map((tab) => {\n const TabIcon = tab.icon;\n return (\n <button\n key={tab.key}\n type=\"button\"\n onClick={() => setActiveTab(tab.key)}\n className={cn(\n 'flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full',\n activeTab === tab.key\n ? 'text-text-primary bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2'\n : 'text-text-secondary hover:text-text-primary hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2'\n )}\n >\n <TabIcon size={16} />\n {tab.label}\n </button>\n );\n })}\n </div>\n\n {/* Main Content Area */}\n <div className=\"flex-1 p-5 overflow-y-auto\">\n {/* Connection Tab */}\n {activeTab === 'connection' && (\n <div className=\"space-y-5\">\n {/* Error Banner */}\n {errorMessage && (\n <div className=\"flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20\">\n <AlertCircle size={16} className=\"text-status-error-text flex-shrink-0\" />\n <span className=\"text-sm text-status-error-text\">{errorMessage}</span>\n </div>\n )}\n\n {/* Connection Name */}\n <div>\n <label\n htmlFor={fieldId('conn-name')}\n className=\"block text-sm font-medium text-text-primary mb-1.5\"\n >\n {tr('integrations.addConnection.fields.connectionName', 'Connection Name')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n id={fieldId('conn-name')}\n aria-label={tr(\n 'integrations.addConnection.fields.connectionName',\n 'Connection Name'\n )}\n type=\"text\"\n value={connectionName}\n onChange={(e) => setConnectionName(e.target.value)}\n placeholder={tr(\n 'integrations.addConnection.fields.connectionNamePlaceholder',\n 'e.g., My {{provider}} Connection',\n { provider: selectedProvider.name }\n )}\n disabled={isAuthenticating}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50\"\n />\n </div>\n\n {/* Description */}\n <div>\n <label\n htmlFor={fieldId('conn-desc')}\n className=\"block text-sm font-medium text-text-primary mb-1.5\"\n >\n {tr('integrations.addConnection.fields.description', 'Description')}\n </label>\n <input\n id={fieldId('conn-desc')}\n aria-label={tr(\n 'integrations.addConnection.fields.description',\n 'Description'\n )}\n type=\"text\"\n value={connectionDescription}\n onChange={(e) => setConnectionDescription(e.target.value)}\n placeholder={tr(\n 'integrations.addConnection.fields.descriptionPlaceholder',\n 'Optional description...'\n )}\n disabled={isAuthenticating}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50\"\n />\n </div>\n\n {/* First-party SERVICE_ACCOUNT connections store no\n credential, so they need no vault/secret picker. */}\n {selectedProvider.authType !== 'service_account' && (\n <CredentialStorageSelector\n value={credentialStorage}\n onChange={setCredentialStorage}\n providerAuthType={selectedProvider.authType}\n />\n )}\n\n {/* Authentication — entirely data-driven.\n The method dropdown appears only when the provider offers\n a choice; the fields below come from that method's\n configSchema, so no provider or auth type has bespoke\n markup here. */}\n <div className=\"rounded-md border border-border-subtle/50 bg-bg-surface p-4 space-y-3\">\n {/* The method sits on the heading row, right-aligned —\n it decides what every field below it is, so it belongs\n with the section title rather than among the fields it\n governs. Single-method providers show the method's\n name here instead, since there is nothing to choose. */}\n <div className=\"flex items-center justify-between gap-3\">\n <h3 className=\"font-medium text-text-primary flex items-center gap-2 text-sm\">\n <Shield size={16} className=\"text-primary\" />\n {tr('integrations.addConnection.authentication.title', 'Authentication')}\n {authMethods.length <= 1 && (\n <span className=\"text-text-secondary font-normal\">\n &middot;{' '}\n {selectedAuthMethod?.displayName ??\n getAuthTypeLabel(selectedProvider.authType)}\n </span>\n )}\n </h3>\n <AuthMethodSelector\n methods={authMethods}\n // Raw key, not the resolved method: the selector needs\n // to see null vs stale itself, or its placeholder can\n // never render.\n selectedKey={selectedAuthMethodKey}\n onSelect={setSelectedAuthMethodKey}\n disabled={isAuthenticating}\n idPrefix={fieldId('auth-method')}\n compact\n />\n </div>\n\n {/* What the chosen method means, kept beside the fields\n it governs. */}\n <div className=\"space-y-2\">\n <AuthMethodNotice method={selectedAuthMethod} />\n </div>\n\n {authFlow === 'oauth2' && (\n <>\n {/* An OAuth method may still declare fields — a tenant\n subdomain, a base URL, bring-your-own-app settings.\n Rendering them only for the `fields` flow made such\n methods impossible to use: the inputs never\n appeared and nothing was ever collected. */}\n {activeSchema && (\n <SchemaForm\n schema={activeSchema}\n values={fieldValues}\n onChange={setFieldValues}\n disabled={isAuthenticating}\n idPrefix={fieldId('oauth-cfg')}\n />\n )}\n {/* A user supplying their own OAuth app has to\n register this exact URL in it, or the provider\n rejects the handshake with a redirect_uri\n mismatch — the single most common way a\n bring-your-own-app setup fails. Shown only for\n methods that ask for a client id, since it is\n noise for the managed ones. */}\n {collectsOwnClientId && (\n <div className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 space-y-1.5\">\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"text-xs font-medium text-text-primary\">\n {tr(\n 'integrations.addConnection.authentication.redirectUriLabel',\n 'Redirect URL to register in your app'\n )}\n </span>\n <button\n type=\"button\"\n onClick={() => {\n void navigator.clipboard?.writeText(oauthCallbackUrl);\n setRedirectCopied(true);\n window.setTimeout(() => setRedirectCopied(false), 2000);\n }}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline\"\n >\n <Copy size={12} />\n {redirectCopied\n ? tr(\n 'integrations.addConnection.authentication.copied',\n 'Copied'\n )\n : tr('integrations.addConnection.authentication.copy', 'Copy')}\n </button>\n </div>\n <code className=\"block break-all text-xs text-text-secondary\">\n {oauthCallbackUrl}\n </code>\n </div>\n )}\n <div className=\"flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default\">\n <ExternalLink\n size={14}\n className=\"text-status-info-text flex-shrink-0\"\n />\n <span className=\"text-xs text-status-info-text\">\n {tr(\n 'integrations.addConnection.authentication.oauthPopupInfo',\n 'A popup window will open for {{provider}} sign-in',\n { provider: selectedProvider.name }\n )}\n </span>\n </div>\n </>\n )}\n\n {authFlow === 'minted' && (\n <div className=\"flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default\">\n <Shield size={14} className=\"text-status-info-text flex-shrink-0\" />\n <span className=\"text-xs text-status-info-text\">\n {tr(\n 'integrations.addConnection.authentication.serviceAccount.description',\n 'No credentials to enter — access is granted on your behalf and tokens are issued per use.',\n { provider: selectedProvider.name }\n )}\n </span>\n </div>\n )}\n\n {authFlow === 'fields' &&\n (activeSchema ? (\n <>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'integrations.addConnection.authentication.secretsEncrypted',\n 'Secret values are stored encrypted and never shown again.'\n )}\n </p>\n <SchemaForm\n schema={activeSchema}\n values={fieldValues}\n onChange={setFieldValues}\n disabled={isAuthenticating}\n idPrefix={fieldId('cred')}\n />\n </>\n ) : (\n <div className=\"flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default\">\n <AlertCircle\n size={16}\n className=\"text-status-error-text flex-shrink-0\"\n />\n <span className=\"text-sm text-status-error-text\">\n {tr(\n 'integrations.addConnection.authentication.noForm',\n 'This authentication method does not declare a configuration form.'\n )}\n </span>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Details Tab */}\n {activeTab === 'details' && (\n <div className=\"space-y-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {tr('integrations.addConnection.tabs.details', 'Details')}\n </h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-3 p-3 rounded-md border border-border-subtle\">\n <ProviderIcon provider={selectedProvider} size={40} />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {selectedProvider.name}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {getAuthTypeLabel(selectedProvider.authType)} &middot;{' '}\n {getCategoryLabel(selectedProvider.category)}\n </p>\n </div>\n </div>\n {selectedProvider.description && (\n <div>\n <div className=\"text-xs font-medium text-text-secondary uppercase tracking-wider\">\n {tr('integrations.addConnection.fields.description', 'Description')}\n </div>\n <p className=\"text-sm text-text-primary mt-1\">\n {selectedProvider.description}\n </p>\n </div>\n )}\n {selectedProvider.website && (\n <div>\n <div className=\"text-xs font-medium text-text-secondary uppercase tracking-wider\">\n {tr('integrations.providerDetail.sections.website', 'Website')}\n </div>\n <a\n href={selectedProvider.website}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"block text-sm text-primary hover:underline mt-1\"\n >\n {selectedProvider.website}\n </a>\n </div>\n )}\n {selectedProvider.docsUrl && (\n <div>\n <div className=\"text-xs font-medium text-text-secondary uppercase tracking-wider\">\n {tr(\n 'integrations.providerDetail.sections.documentation',\n 'Documentation'\n )}\n </div>\n <a\n href={selectedProvider.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"block text-sm text-primary hover:underline mt-1\"\n >\n {selectedProvider.docsUrl}\n </a>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n </>\n )}\n </div>\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsFA,IAAM,KAAY,MACZ,KAAW;AAEjB,SAAgB,EAAoB,EAClC,SACA,YACA,0BACA,0BAC2B;CAE3B,IAAM,IAAK,GAAO,EACZ,KAAmB,IAAkB,EACrC,IAAmB,IAAkB,EACrC,E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,EACN,kBAAC,KAAD;SACE,MAAM,EAAiB;SACvB,QAAO;SACP,KAAI;SACJ,WAAU;mBAET,EAAiB;SAChB,CAAA,CACA,EAAA,CAAA;QAEP,EAAiB,WAChB,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,OAAD;SAAK,WAAU;mBACZ,EACC,sDACA,gBACD;SACG,CAAA,EACN,kBAAC,KAAD;SACE,MAAM,EAAiB;SACvB,QAAO;SACP,KAAI;SACJ,WAAU;mBAET,EAAiB;SAChB,CAAA,CACA,EAAA,CAAA;QAEJ;SACF;QAEJ;OACL,EAAA,CAAA;IAED;KACF;IACL,EAAA,CAAA,GArmBa"}
1
+ {"version":3,"file":"AddConnectionDialog.js","names":[],"sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"sourcesContent":["/**\n * AddConnectionDialog -- n8n-style popup for creating new connections.\n *\n * Replaces the full-page AddConnectionWizard with an inline modal dialog.\n * Uses the same hooks and GraphQL operations that already exist in\n * microfe-integrations (useCreateConnection, useInitiateOAuth, etc.).\n *\n * Opens from any page via Zustand store state, so there is no navigation\n * to /connections/add — the dialog overlays the current page.\n *\n * Layout (BOFF-8158): header, then a body that scrolls, then a footer that\n * never does. The footer holds the one primary action, so \"Connect\" is reachable\n * at every size without scrolling past the fields. Below `sm` the body stacks\n * vertically and the Connection / Details rail becomes a horizontal tab strip:\n * as a row, the full-width rail left the form pane 0 px wide on phones.\n */\n\nimport {\n useState,\n useMemo,\n useCallback,\n useEffect,\n useRef,\n useId,\n type KeyboardEvent,\n} from 'react';\nimport {\n X,\n Check,\n Loader2,\n AlertCircle,\n CheckCircle2,\n Search,\n ExternalLink,\n Shield,\n Link2,\n Info,\n Copy,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../hooks/useTr';\nimport { useCategoryLabel, useAuthTypeLabel } from '../hooks/useLabel';\nimport { legacyFlowForAuthType } from '../utils/integrationsHelpers';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useProviders, useProvider } from '../hooks/useProviders';\nimport {\n useCreateConnection,\n useInitiateOAuth,\n useAuthenticateConnection,\n useAuthenticateWithServiceAccount,\n} from '../hooks/useConnections';\nimport { useGetConnectionLazyQuery } from '../../generated/wspace-operations';\nimport { waitForOAuthPopupCompletion } from '../utils/oauthPopup';\nimport {\n CredentialStorageSelector,\n type CredentialStorageState,\n} from './CredentialStorageSelector';\nimport { AuthMethodNotice, AuthMethodSelector } from './AuthMethodSelector';\nimport { ProviderIcon } from './ProviderIcon';\nimport { ConnectionModalFrame, type ConnectionModalPresentation } from './ConnectionModalFrame';\nimport {\n SchemaForm,\n initialValuesFromSchema,\n isSchemaComplete,\n parseFormSchema,\n visibleValues,\n} from './SchemaForm';\nimport type { IntegrationProvider } from '../types';\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface AddConnectionDialogProps {\n /** Whether the dialog is open */\n open: boolean;\n /** Callback to close the dialog */\n onClose: () => void;\n /** Pre-selected provider ID (skips provider picker step) */\n preselectedProviderId?: string | null;\n /** Callback when a connection is successfully created */\n onConnectionCreated?: (connectionId: string) => void;\n /**\n * `dialog` (default): a centred dialog from `sm`. `sheet`: a bottom sheet\n * below `md`, centred from `md` — what `ConnectSourceDialog` uses.\n */\n presentation?: ConnectionModalPresentation;\n /** Heading while the provider picker shows. Defaults to \"Add new credential\". */\n pickerTitle?: string;\n}\n\ntype DialogTab = 'connection' | 'details';\n\nconst DIALOG_TABS: readonly DialogTab[] = ['connection', 'details'];\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function AddConnectionDialog({\n open,\n onClose,\n preselectedProviderId,\n onConnectionCreated,\n presentation = 'dialog',\n pickerTitle,\n}: AddConnectionDialogProps) {\n // Provider data\n const tr = useTr();\n const getCategoryLabel = useCategoryLabel();\n const getAuthTypeLabel = useAuthTypeLabel();\n const { apiGatewayUrl } = useIntegrations();\n const { providers, loading: providersLoading } = useProviders();\n // A preselected id may not be in the catalog page (disabled provider linked\n // from its own detail page). Resolve such ids via a direct by-id fetch so the\n // dialog never dead-ends on a blank body.\n const providerInList = useMemo(\n () =>\n preselectedProviderId\n ? ((providers ?? []).find((p: IntegrationProvider) => p.id === preselectedProviderId) ??\n null)\n : null,\n [providers, preselectedProviderId]\n );\n // Only fetch once the catalog has loaded and confirmed the id isn't in the\n // filtered list — avoids a redundant GetProvider for visible providers.\n const { provider: fetchedPreselectedProvider, loading: fetchedPreselectedLoading } = useProvider(\n !providersLoading && preselectedProviderId && !providerInList ? preselectedProviderId : ''\n );\n const resolvedPreselectedProvider = providerInList ?? fetchedPreselectedProvider;\n // True while a preselected provider is still being resolved (catalog load or\n // the by-id fallback fetch) — keeps the body showing a spinner, not blank.\n const preselectedResolving =\n !!preselectedProviderId &&\n !resolvedPreselectedProvider &&\n (providersLoading || fetchedPreselectedLoading);\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreate = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n // Mutations\n const { createConnection, loading: creating } = useCreateConnection();\n const { initiateOAuth, loading: oauthLoading } = useInitiateOAuth();\n const { authenticateConnection, loading: authenticating } = useAuthenticateConnection();\n const { authenticateWithServiceAccount, loading: serviceAccountLoading } =\n useAuthenticateWithServiceAccount();\n const [fetchConnection] = useGetConnectionLazyQuery({ fetchPolicy: 'network-only' });\n\n // State\n const [selectedProvider, setSelectedProvider] = useState<IntegrationProvider | null>(null);\n const [showPicker, setShowPicker] = useState(!preselectedProviderId);\n const [activeTab, setActiveTab] = useState<DialogTab>('connection');\n const [searchQuery, setSearchQuery] = useState('');\n const [connectionName, setConnectionName] = useState('');\n const [connectionDescription, setConnectionDescription] = useState('');\n /** Auth method the user picked; null until a provider is selected. */\n const [selectedAuthMethodKey, setSelectedAuthMethodKey] = useState<string | null>(null);\n /** Values for the selected method's schema-described fields. */\n const [fieldValues, setFieldValues] = useState<Record<string, unknown>>({});\n const [credentialStorage, setCredentialStorage] = useState<CredentialStorageState>({\n mode: 'managed',\n vaultId: '',\n secretId: '',\n managedSecretName: '',\n });\n const [errorMessage, setErrorMessage] = useState('');\n const [redirectCopied, setRedirectCopied] = useState(false);\n const [success, setSuccess] = useState(false);\n const [oauthWaiting, setOauthWaiting] = useState(false);\n const [, setCreatedConnectionId] = useState<string | null>(null);\n\n const oauthPopupRef = useRef<Window | null>(null);\n const oauthCleanupRef = useRef<(() => void) | null>(null);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const idPrefix = useId();\n const fieldId = (name: string) => `${idPrefix}-${name}`;\n\n // ── Auth method resolution ────────────────────────────────────────────────\n // Everything the auth section renders and submits derives from the selected\n // method. Providers with a single method behave exactly as before.\n const authMethods = useMemo(\n () => (selectedProvider?.authMethods ?? []).filter((method) => method.isEnabled),\n [selectedProvider]\n );\n const selectedAuthMethod = useMemo(\n () =>\n authMethods.find((method) => method.key === selectedAuthMethodKey) ?? authMethods[0] ?? null,\n [authMethods, selectedAuthMethodKey]\n );\n // Fall back to the provider's own authType for providers whose methods have\n // not been fetched (older fragments) or backfilled yet.\n const authFlow = selectedAuthMethod?.flow ?? legacyFlowForAuthType(selectedProvider?.authType);\n const authTypeForMethod = selectedAuthMethod?.authType ?? selectedProvider?.authType;\n\n // The exact value the provider will compare against at the callback. Built\n // here rather than only at submit time so the dialog can show the user what\n // to register in their own OAuth app.\n const oauthCallbackUrl = apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : '/integrations/oauth/callback';\n // Memoized: a fresh array each render would re-create handleSubmit's\n // useCallback on every render.\n const authScopes = useMemo(\n () =>\n selectedAuthMethod?.defaultScopes?.length\n ? selectedAuthMethod.defaultScopes\n : (selectedProvider?.defaultScopes ?? []),\n [selectedAuthMethod, selectedProvider]\n );\n const activeSchema = useMemo(\n () => parseFormSchema(selectedAuthMethod?.configSchema ?? selectedProvider?.configSchema),\n [selectedAuthMethod, selectedProvider]\n );\n\n // Selecting a different method must not carry the previous method's values\n // over — they belong to a different credential shape entirely.\n useEffect(() => {\n // Seeded from the schema's declared defaults, not empty: a rendered control\n // shows its default as selected, so leaving state empty made validation\n // treat a visible value as missing and dropped it from the submission.\n setFieldValues(initialValuesFromSchema(activeSchema));\n setErrorMessage('');\n // activeSchema is derived from these two, so it is not an extra trigger.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedAuthMethodKey, selectedProvider?.id]);\n\n // Cleanup OAuth listener and popup on unmount.\n useEffect(() => {\n return () => {\n oauthCleanupRef.current?.();\n if (oauthPopupRef.current && !oauthPopupRef.current.closed) {\n oauthPopupRef.current.close();\n }\n };\n }, []);\n\n // Reset state when dialog opens\n useEffect(() => {\n if (open) {\n setActiveTab('connection');\n setSearchQuery('');\n setConnectionName('');\n setConnectionDescription('');\n setSelectedAuthMethodKey(null);\n setFieldValues({});\n setCredentialStorage({ mode: 'managed', vaultId: '', secretId: '', managedSecretName: '' });\n setErrorMessage('');\n setSuccess(false);\n setOauthWaiting(false);\n setCreatedConnectionId(null);\n\n if (preselectedProviderId) {\n setShowPicker(false);\n setSelectedProvider(null); // will be set by effect below\n } else {\n setShowPicker(true);\n setSelectedProvider(null);\n }\n }\n }, [open, preselectedProviderId]);\n\n // Find and set preselected provider (from the filtered list or, for hidden\n // built-ins, the direct by-id fetch above).\n useEffect(() => {\n if (open && preselectedProviderId && resolvedPreselectedProvider && !selectedProvider) {\n setSelectedProvider(resolvedPreselectedProvider);\n setConnectionName(`${resolvedPreselectedProvider.name} Connection`);\n setShowPicker(false);\n }\n }, [open, preselectedProviderId, resolvedPreselectedProvider, selectedProvider]);\n\n // Auto-focus search input when picker is shown\n useEffect(() => {\n if (open && showPicker) {\n const timeoutId = setTimeout(() => searchInputRef.current?.focus(), 100);\n return () => clearTimeout(timeoutId);\n }\n return undefined;\n }, [open, showPicker]);\n // True for \"Custom OAuth 2.0\" and the generic OAuth provider — the methods\n // where the user brings an app of their own and therefore needs the redirect\n // URL. Derived from the schema rather than a hardcoded method key so an\n // admin-authored method that asks for a client id gets the same help.\n const collectsOwnClientId = Boolean(\n activeSchema && Object.prototype.hasOwnProperty.call(activeSchema.properties ?? {}, 'clientId')\n );\n\n // Filter providers for picker\n const filteredProviders = useMemo(() => {\n const installed = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed' && p.isEnabled\n );\n if (!searchQuery.trim()) return installed;\n const q = searchQuery.toLowerCase();\n return installed.filter(\n (p: IntegrationProvider) =>\n p.name.toLowerCase().includes(q) ||\n (p.description ?? '').toLowerCase().includes(q) ||\n p.key.toLowerCase().includes(q)\n );\n }, [providers, searchQuery]);\n\n // Group providers by category\n const groupedProviders = useMemo(() => {\n const groups: Record<string, IntegrationProvider[]> = {};\n filteredProviders.forEach((p: IntegrationProvider) => {\n const cat = p.category;\n if (!groups[cat]) groups[cat] = [];\n groups[cat].push(p);\n });\n return groups;\n }, [filteredProviders]);\n\n const handleSelectProvider = useCallback((provider: IntegrationProvider) => {\n setSelectedProvider(provider);\n setConnectionName(`${provider.name} Connection`);\n setShowPicker(false);\n setErrorMessage('');\n }, []);\n\n const isAuthenticating =\n creating || oauthLoading || oauthWaiting || authenticating || serviceAccountLoading;\n\n // Main submit handler\n const handleSubmit = useCallback(async () => {\n if (!selectedProvider || !connectionName.trim()) return;\n\n // Methods that mint tokens on demand store no credential, so they need no\n // vault/secret — skip the credential-storage requirement entirely.\n const isServiceAccount = authFlow === 'minted';\n\n if (!isServiceAccount) {\n if (!credentialStorage.vaultId) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.errors.vaultRequired',\n 'Please select a vault for storing or referencing credentials'\n )\n );\n return;\n }\n if (credentialStorage.mode === 'existing' && !credentialStorage.secretId) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.errors.secretRequired',\n 'Please select an existing vault secret to reuse'\n )\n );\n return;\n }\n }\n\n if (authFlow === 'oauth2' && activeSchema && !isSchemaComplete(activeSchema, fieldValues)) {\n setErrorMessage(\n tr('integrations.addConnection.errors.fieldsRequired', 'Please fill in all required fields')\n );\n return;\n }\n\n if (selectedAuthMethod && !selectedAuthMethod.isConfigured) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.authentication.methodNotConfigured',\n 'This authentication method is not configured in this environment. Ask an administrator to add its credentials, or pick another method.'\n )\n );\n return;\n }\n\n try {\n setErrorMessage('');\n\n // Step 1: Create the connection\n const connId = await createConnection({\n name: connectionName.trim(),\n description: connectionDescription.trim() || undefined,\n providerId: selectedProvider.id,\n authMethodKey: selectedAuthMethodKey ?? undefined,\n // OAuth methods collect non-secret routing settings (tenant subdomain,\n // base URL) rather than a credential, so they belong on the connection\n // config, which getConnectionToken already reads for baseUrl.\n ...(authFlow === 'oauth2' && activeSchema\n ? { config: visibleValues(activeSchema, fieldValues) as Record<string, unknown> }\n : {}),\n ...(isServiceAccount\n ? {}\n : {\n vaultId: credentialStorage.vaultId,\n credentialSecretId:\n credentialStorage.mode === 'existing' ? credentialStorage.secretId : undefined,\n managedSecretName:\n credentialStorage.mode === 'managed'\n ? credentialStorage.managedSecretName.trim() || undefined\n : undefined,\n }),\n });\n\n if (!connId) {\n setErrorMessage(\n tr('integrations.addConnection.errors.createFailed', 'Failed to create connection')\n );\n return;\n }\n\n setCreatedConnectionId(connId);\n\n // Step 2: Authenticate. Driven by the auth method's *flow*, not by a\n // per-auth-type branch: FIELDS methods all submit their schema values\n // through one generic mutation, so adding an auth type needs no new case\n // here and no new mutation to call.\n switch (authFlow) {\n case 'oauth2': {\n const result = await initiateOAuth(connId, oauthCallbackUrl, selectedProvider.key);\n if (result?.redirectUrl) {\n const width = 600;\n const height = 700;\n const left = window.screenX + (window.innerWidth - width) / 2;\n const top = window.screenY + (window.innerHeight - height) / 2;\n const popup = window.open(\n result.redirectUrl,\n 'oauth_popup',\n `width=${width},height=${height},left=${left},top=${top},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`\n );\n if (!popup) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.authentication.popupBlocked',\n 'Popup was blocked. Please allow popups for this site and try again.'\n )\n );\n return;\n }\n oauthPopupRef.current = popup;\n setOauthWaiting(true);\n\n oauthCleanupRef.current?.();\n oauthCleanupRef.current = waitForOAuthPopupCompletion({\n connectionId: connId,\n popup,\n fetchConnectionStatus: async () => {\n const { data } = await fetchConnection({ variables: { id: connId } });\n return data?.getConnection ?? null;\n },\n onSuccess: () => {\n setSuccess(true);\n onConnectionCreated?.(connId);\n },\n onError: setErrorMessage,\n onSettled: () => {\n oauthCleanupRef.current = null;\n oauthPopupRef.current = null;\n setOauthWaiting(false);\n },\n });\n\n return;\n }\n setSuccess(true);\n onConnectionCreated?.(connId);\n break;\n }\n case 'minted': {\n // Nothing to collect and nothing stored. SERVICE_ACCOUNT still records\n // the user's delegation for the reserved app; WORKSPACE_APP_TOKEN\n // connections are pure config and are already usable.\n if (authTypeForMethod === 'service_account') {\n await authenticateWithServiceAccount(\n connId,\n authScopes.length > 0 ? authScopes : undefined\n );\n }\n setSuccess(true);\n onConnectionCreated?.(connId);\n break;\n }\n default: {\n // FIELDS: submit whatever the method's schema asked for.\n if (activeSchema) {\n if (!isSchemaComplete(activeSchema, fieldValues)) {\n setErrorMessage(\n tr(\n 'integrations.addConnection.errors.fieldsRequired',\n 'Please fill in all required fields'\n )\n );\n return;\n }\n }\n // Only fields the user can currently see: a `showIf` field that was\n // filled and then hidden must not be submitted, or we would store a\n // credential the user no longer intends to send.\n const values: Record<string, unknown> = {};\n for (const [field, value] of Object.entries(visibleValues(activeSchema, fieldValues))) {\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (trimmed) values[field] = trimmed;\n } else if (value !== undefined && value !== null) {\n values[field] = value;\n }\n }\n await authenticateConnection(connId, selectedAuthMethodKey ?? undefined, values);\n setSuccess(true);\n onConnectionCreated?.(connId);\n }\n }\n } catch (err) {\n setErrorMessage(\n err instanceof Error\n ? err.message\n : tr('integrations.addConnection.errors.authFailed', 'Authentication failed')\n );\n }\n }, [\n selectedProvider,\n connectionName,\n connectionDescription,\n selectedAuthMethodKey,\n authFlow,\n authTypeForMethod,\n authScopes,\n activeSchema,\n fieldValues,\n selectedAuthMethod,\n createConnection,\n initiateOAuth,\n fetchConnection,\n authenticateConnection,\n authenticateWithServiceAccount,\n apiGatewayUrl,\n onConnectionCreated,\n credentialStorage,\n tr,\n ]);\n\n // Tab items\n const tabs: { key: DialogTab; label: string; icon: typeof Link2 }[] = [\n {\n key: 'connection',\n label: tr('integrations.addConnection.tabs.connection', 'Connection'),\n icon: Link2,\n },\n { key: 'details', label: tr('integrations.addConnection.tabs.details', 'Details'), icon: Info },\n ];\n const tabId = (key: DialogTab) => fieldId(`tab-${key}`);\n const tabPanelId = fieldId('tabpanel');\n\n // Arrow keys move between the tabs (the WAI-ARIA tabs pattern); Tab itself\n // leaves the strip for the panel. Both orientations, since the strip is\n // horizontal on phones and a vertical rail from `sm`.\n const handleTabKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n const index = DIALOG_TABS.indexOf(activeTab);\n let next: DialogTab | undefined;\n if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n next = DIALOG_TABS[(index + 1) % DIALOG_TABS.length];\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n next = DIALOG_TABS[(index - 1 + DIALOG_TABS.length) % DIALOG_TABS.length];\n } else if (event.key === 'Home') {\n next = DIALOG_TABS[0];\n } else if (event.key === 'End') {\n next = DIALOG_TABS[DIALOG_TABS.length - 1];\n }\n if (!next) return;\n event.preventDefault();\n setActiveTab(next);\n document.getElementById(tabId(next))?.focus();\n };\n\n if (!open) return null;\n\n // Fixed ids, not useId(): verification harnesses select the dialog by its\n // `aria-labelledby`, and only one add-connection dialog is ever open.\n const titleId = 'add-connection-dialog-title';\n const deniedTitleId = 'add-connection-denied-title';\n const showForm = !!selectedProvider && !showPicker && !success;\n\n if (!canCreate && !permissionsLoading) {\n return (\n <ConnectionModalFrame\n onClose={onClose}\n labelledBy={deniedTitleId}\n presentation={presentation}\n size=\"notice\"\n testId=\"add-connection-dialog\"\n >\n <Shield size={40} className=\"text-text-secondary\" />\n <h2 id={deniedTitleId} className=\"text-lg font-semibold text-text-primary\">\n {tr('integrations.addConnection.denied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'integrations.addConnection.denied.description',\n \"You don't have permission to create connections.\"\n )}\n </p>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors\"\n >\n {tr('integrations.common.close', 'Close')}\n </button>\n </ConnectionModalFrame>\n );\n }\n\n return (\n <ConnectionModalFrame\n onClose={onClose}\n labelledBy={titleId}\n presentation={presentation}\n size=\"form\"\n testId=\"add-connection-dialog\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0\">\n <div className=\"flex items-center gap-3 min-w-0\">\n {selectedProvider && !showPicker ? (\n <>\n <ProviderIcon provider={selectedProvider} size={32} />\n <div className=\"min-w-0\">\n <h2 id={titleId} className=\"text-base font-semibold text-text-primary\">\n {tr('integrations.addConnection.dialog.accountTitle', '{{provider}} account', {\n provider: selectedProvider.name,\n })}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {getAuthTypeLabel(selectedProvider.authType)}\n </p>\n </div>\n </>\n ) : (\n <div className=\"min-w-0\">\n <h2 id={titleId} className=\"text-base font-semibold text-text-primary\">\n {pickerTitle ?? tr('integrations.addConnection.dialog.title', 'Add new credential')}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'integrations.addConnection.dialog.subtitle',\n 'Select an app or service to connect to'\n )}\n </p>\n </div>\n )}\n </div>\n {/* Only the close control lives up here. The primary action moved to\n the footer (BOFF-8158): a header \"Connect\" beside the X sat above\n the fields it submits, and a second copy in a footer would have\n made two primaries. */}\n <button\n type=\"button\"\n onClick={onClose}\n className=\"flex-shrink-0 p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary\"\n aria-label={tr('integrations.addConnection.actions.close', 'Close dialog')}\n >\n <X size={20} />\n </button>\n </div>\n\n {/* Body. A column below `sm`, a row (rail beside the pane) from `sm`.\n As a row on a phone, the full-width rail took all the width and\n the pane got 0 px: no field, error or OAuth note was visible. */}\n <div\n data-testid=\"add-connection-body\"\n className=\"flex flex-1 min-h-0 flex-col overflow-hidden sm:flex-row\"\n >\n {/* Provider Picker Mode */}\n {showPicker && !selectedProvider && (\n <div className=\"flex-1 min-h-0 p-5 overflow-y-auto\">\n <p className=\"text-sm text-text-secondary mb-3\">\n {tr(\n 'integrations.addConnection.dialog.subtitle',\n 'Select an app or service to connect to'\n )}\n </p>\n <div className=\"relative mb-4\">\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n ref={searchInputRef}\n type=\"text\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n placeholder={tr(\n 'integrations.addConnection.search.placeholder',\n 'Search installed providers...'\n )}\n aria-label={tr(\n 'integrations.addConnection.search.ariaLabel',\n 'Search installed providers'\n )}\n className=\"w-full pl-9 pr-3 py-2.5 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n\n {providersLoading ? (\n <div className=\"flex items-center justify-center py-8\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n ) : filteredProviders.length === 0 ? (\n <IllustratedEmptyState\n illustration={searchQuery ? 'empty-search' : 'empty-data'}\n title={\n searchQuery\n ? tr(\n 'integrations.addConnection.empty.noMatchingProviders',\n 'No matching providers'\n )\n : tr(\n 'integrations.addConnection.empty.noInstalledProviders',\n 'No installed providers yet'\n )\n }\n description={\n searchQuery\n ? tr(\n 'integrations.addConnection.empty.matchingDescription',\n 'No installed provider matches your search. Try a different term or install one from the catalog.',\n { query: searchQuery }\n )\n : tr(\n 'integrations.addConnection.empty.installedDescription',\n 'You need at least one installed, enabled provider before you can create a connection. Install one from the catalog to get started.'\n )\n }\n />\n ) : (\n <div className=\"max-h-[400px] overflow-y-auto space-y-1\">\n {Object.entries(groupedProviders).map(([category, categoryProviders]) => (\n <div key={category}>\n <div className=\"px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider\">\n {getCategoryLabel(category as IntegrationProvider['category'])}\n </div>\n {categoryProviders.map((provider) => (\n <button\n key={provider.id}\n type=\"button\"\n onClick={() => handleSelectProvider(provider)}\n className=\"w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left\"\n >\n <ProviderIcon provider={provider} size={32} />\n <div className=\"flex-1 min-w-0\">\n <div className=\"text-sm font-medium text-text-primary\">\n {provider.name}\n </div>\n <div className=\"text-xs text-text-secondary\">\n {getAuthTypeLabel(provider.authType)}\n </div>\n </div>\n </button>\n ))}\n </div>\n ))}\n </div>\n )}\n </div>\n )}\n\n {/* Loading preselected provider (catalog load or by-id fallback fetch) */}\n {!showPicker && !selectedProvider && preselectedResolving && (\n <div className=\"flex-1 flex items-center justify-center\">\n <Loader2 size={32} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {/* Preselected provider couldn't be resolved (invalid id / fetch error) */}\n {!showPicker && !selectedProvider && !preselectedResolving && preselectedProviderId && (\n <div className=\"flex-1 flex flex-col items-center justify-center p-8 text-center\">\n <AlertCircle size={32} className=\"text-text-secondary mb-3\" />\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'integrations.addConnection.providerUnavailable',\n \"This provider isn't available.\"\n )}\n </p>\n </div>\n )}\n\n {/* Success State */}\n {success && selectedProvider && (\n <div className=\"flex-1 flex flex-col items-center justify-center p-8 text-center\">\n <div className=\"p-3 rounded-full bg-status-success-bg-subtle mb-4\">\n <CheckCircle2 size={48} className=\"text-status-success-text\" />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-1\">\n {tr('integrations.addConnection.success.title', 'Connection Created!')}\n </h3>\n <p className=\"text-sm text-text-secondary mb-6\">\n {tr(\n 'integrations.addConnection.success.description',\n 'Your {{provider}} connection has been set up successfully.',\n { provider: selectedProvider.name }\n )}\n </p>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n {tr('integrations.addConnection.actions.close', 'Close dialog')}\n </button>\n </div>\n )}\n\n {/* Form Mode (with sidebar tabs) */}\n {selectedProvider && showForm && (\n <>\n {/* Tabs: a horizontal strip below `sm`, a vertical rail from `sm`.\n No base `w-full`: in the old row layout it starved the pane. */}\n <div\n role=\"tablist\"\n aria-labelledby={titleId}\n data-testid=\"add-connection-tabs\"\n className=\"flex flex-shrink-0 overflow-x-auto border-b border-border-subtle sm:block sm:w-40 sm:overflow-x-visible sm:border-b-0 sm:border-r sm:py-3\"\n >\n {tabs.map((tab) => {\n const TabIcon = tab.icon;\n const selected = activeTab === tab.key;\n return (\n <button\n key={tab.key}\n id={tabId(tab.key)}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={tabPanelId}\n tabIndex={selected ? 0 : -1}\n onClick={() => setActiveTab(tab.key)}\n onKeyDown={handleTabKeyDown}\n className={cn(\n 'flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full',\n selected\n ? 'text-text-primary bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2'\n : 'text-text-secondary hover:text-text-primary hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2'\n )}\n >\n <TabIcon size={16} aria-hidden=\"true\" />\n {tab.label}\n </button>\n );\n })}\n </div>\n\n {/* Main Content Area: the only scroller in form mode. */}\n <div\n id={tabPanelId}\n role=\"tabpanel\"\n aria-labelledby={tabId(activeTab)}\n data-testid=\"add-connection-pane\"\n className=\"flex-1 min-h-0 min-w-0 p-5 overflow-y-auto\"\n >\n {/* Connection Tab */}\n {activeTab === 'connection' && (\n <div className=\"space-y-5\">\n {/* Error Banner */}\n {errorMessage && (\n <div className=\"flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20\">\n <AlertCircle size={16} className=\"text-status-error-text flex-shrink-0\" />\n <span className=\"text-sm text-status-error-text\">{errorMessage}</span>\n </div>\n )}\n\n {/* Connection Name */}\n <div>\n <label\n htmlFor={fieldId('conn-name')}\n className=\"block text-sm font-medium text-text-primary mb-1.5\"\n >\n {tr('integrations.addConnection.fields.connectionName', 'Connection Name')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n id={fieldId('conn-name')}\n aria-label={tr(\n 'integrations.addConnection.fields.connectionName',\n 'Connection Name'\n )}\n type=\"text\"\n value={connectionName}\n onChange={(e) => setConnectionName(e.target.value)}\n placeholder={tr(\n 'integrations.addConnection.fields.connectionNamePlaceholder',\n 'e.g., My {{provider}} Connection',\n { provider: selectedProvider.name }\n )}\n disabled={isAuthenticating}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50\"\n />\n </div>\n\n {/* Description */}\n <div>\n <label\n htmlFor={fieldId('conn-desc')}\n className=\"block text-sm font-medium text-text-primary mb-1.5\"\n >\n {tr('integrations.addConnection.fields.description', 'Description')}\n </label>\n <input\n id={fieldId('conn-desc')}\n aria-label={tr(\n 'integrations.addConnection.fields.description',\n 'Description'\n )}\n type=\"text\"\n value={connectionDescription}\n onChange={(e) => setConnectionDescription(e.target.value)}\n placeholder={tr(\n 'integrations.addConnection.fields.descriptionPlaceholder',\n 'Optional description...'\n )}\n disabled={isAuthenticating}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50\"\n />\n </div>\n\n {/* First-party SERVICE_ACCOUNT connections store no\n credential, so they need no vault/secret picker. */}\n {selectedProvider.authType !== 'service_account' && (\n <CredentialStorageSelector\n value={credentialStorage}\n onChange={setCredentialStorage}\n providerAuthType={selectedProvider.authType}\n />\n )}\n\n {/* Authentication — entirely data-driven.\n The method dropdown appears only when the provider offers\n a choice; the fields below come from that method's\n configSchema, so no provider or auth type has bespoke\n markup here. */}\n <div className=\"rounded-md border border-border-subtle/50 bg-bg-surface p-4 space-y-3\">\n {/* The method sits on the heading row, right-aligned —\n it decides what every field below it is, so it belongs\n with the section title rather than among the fields it\n governs. Single-method providers show the method's\n name here instead, since there is nothing to choose. */}\n <div className=\"flex items-center justify-between gap-3\">\n <h3 className=\"font-medium text-text-primary flex items-center gap-2 text-sm\">\n <Shield size={16} className=\"text-primary\" />\n {tr('integrations.addConnection.authentication.title', 'Authentication')}\n {authMethods.length <= 1 && (\n <span className=\"text-text-secondary font-normal\">\n &middot;{' '}\n {selectedAuthMethod?.displayName ??\n getAuthTypeLabel(selectedProvider.authType)}\n </span>\n )}\n </h3>\n <AuthMethodSelector\n methods={authMethods}\n // Raw key, not the resolved method: the selector needs\n // to see null vs stale itself, or its placeholder can\n // never render.\n selectedKey={selectedAuthMethodKey}\n onSelect={setSelectedAuthMethodKey}\n disabled={isAuthenticating}\n idPrefix={fieldId('auth-method')}\n compact\n />\n </div>\n\n {/* What the chosen method means, kept beside the fields\n it governs. */}\n <div className=\"space-y-2\">\n <AuthMethodNotice method={selectedAuthMethod} />\n </div>\n\n {authFlow === 'oauth2' && (\n <>\n {/* An OAuth method may still declare fields — a tenant\n subdomain, a base URL, bring-your-own-app settings.\n Rendering them only for the `fields` flow made such\n methods impossible to use: the inputs never\n appeared and nothing was ever collected. */}\n {activeSchema && (\n <SchemaForm\n schema={activeSchema}\n values={fieldValues}\n onChange={setFieldValues}\n disabled={isAuthenticating}\n idPrefix={fieldId('oauth-cfg')}\n />\n )}\n {/* A user supplying their own OAuth app has to\n register this exact URL in it, or the provider\n rejects the handshake with a redirect_uri\n mismatch — the single most common way a\n bring-your-own-app setup fails. Shown only for\n methods that ask for a client id, since it is\n noise for the managed ones. */}\n {collectsOwnClientId && (\n <div className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 space-y-1.5\">\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"text-xs font-medium text-text-primary\">\n {tr(\n 'integrations.addConnection.authentication.redirectUriLabel',\n 'Redirect URL to register in your app'\n )}\n </span>\n <button\n type=\"button\"\n onClick={() => {\n void navigator.clipboard?.writeText(oauthCallbackUrl);\n setRedirectCopied(true);\n window.setTimeout(() => setRedirectCopied(false), 2000);\n }}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline\"\n >\n <Copy size={12} />\n {redirectCopied\n ? tr('integrations.addConnection.authentication.copied', 'Copied')\n : tr('integrations.addConnection.authentication.copy', 'Copy')}\n </button>\n </div>\n <code className=\"block break-all text-xs text-text-secondary\">\n {oauthCallbackUrl}\n </code>\n </div>\n )}\n <div className=\"flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default\">\n <ExternalLink size={14} className=\"text-status-info-text flex-shrink-0\" />\n <span className=\"text-xs text-status-info-text\">\n {tr(\n 'integrations.addConnection.authentication.oauthPopupInfo',\n 'A popup window will open for {{provider}} sign-in',\n { provider: selectedProvider.name }\n )}\n </span>\n </div>\n </>\n )}\n\n {authFlow === 'minted' && (\n <div className=\"flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default\">\n <Shield size={14} className=\"text-status-info-text flex-shrink-0\" />\n <span className=\"text-xs text-status-info-text\">\n {tr(\n 'integrations.addConnection.authentication.serviceAccount.description',\n 'No credentials to enter — access is granted on your behalf and tokens are issued per use.',\n { provider: selectedProvider.name }\n )}\n </span>\n </div>\n )}\n\n {authFlow === 'fields' &&\n (activeSchema ? (\n <>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'integrations.addConnection.authentication.secretsEncrypted',\n 'Secret values are stored encrypted and never shown again.'\n )}\n </p>\n <SchemaForm\n schema={activeSchema}\n values={fieldValues}\n onChange={setFieldValues}\n disabled={isAuthenticating}\n idPrefix={fieldId('cred')}\n />\n </>\n ) : (\n <div className=\"flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default\">\n <AlertCircle size={16} className=\"text-status-error-text flex-shrink-0\" />\n <span className=\"text-sm text-status-error-text\">\n {tr(\n 'integrations.addConnection.authentication.noForm',\n 'This authentication method does not declare a configuration form.'\n )}\n </span>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Details Tab */}\n {activeTab === 'details' && (\n <div className=\"space-y-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {tr('integrations.addConnection.tabs.details', 'Details')}\n </h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-3 p-3 rounded-md border border-border-subtle\">\n <ProviderIcon provider={selectedProvider} size={40} />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {selectedProvider.name}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {getAuthTypeLabel(selectedProvider.authType)} &middot;{' '}\n {getCategoryLabel(selectedProvider.category)}\n </p>\n </div>\n </div>\n {selectedProvider.description && (\n <div>\n <div className=\"text-xs font-medium text-text-secondary uppercase tracking-wider\">\n {tr('integrations.addConnection.fields.description', 'Description')}\n </div>\n <p className=\"text-sm text-text-primary mt-1\">\n {selectedProvider.description}\n </p>\n </div>\n )}\n {selectedProvider.website && (\n <div>\n <div className=\"text-xs font-medium text-text-secondary uppercase tracking-wider\">\n {tr('integrations.providerDetail.sections.website', 'Website')}\n </div>\n <a\n href={selectedProvider.website}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"block text-sm text-primary hover:underline mt-1\"\n >\n {selectedProvider.website}\n </a>\n </div>\n )}\n {selectedProvider.docsUrl && (\n <div>\n <div className=\"text-xs font-medium text-text-secondary uppercase tracking-wider\">\n {tr(\n 'integrations.providerDetail.sections.documentation',\n 'Documentation'\n )}\n </div>\n <a\n href={selectedProvider.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"block text-sm text-primary hover:underline mt-1\"\n >\n {selectedProvider.docsUrl}\n </a>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n </>\n )}\n </div>\n\n {/* Footer: outside the scroller, so it is always on screen. It holds the\n dialog's ONE primary action. */}\n {selectedProvider && showForm && (\n <div\n data-testid=\"add-connection-footer\"\n className=\"flex flex-shrink-0 items-center justify-end gap-2 border-t border-border-subtle px-5 py-3\"\n >\n <button\n type=\"button\"\n onClick={onClose}\n className=\"px-4 py-2 text-sm font-medium rounded-md border border-border-subtle text-text-primary hover:bg-accent transition-colors\"\n >\n {tr('integrations.addConnection.actions.cancel', 'Cancel')}\n </button>\n <button\n type=\"button\"\n data-testid=\"add-connection-submit\"\n onClick={handleSubmit}\n disabled={isAuthenticating || !connectionName.trim()}\n className=\"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50\"\n >\n {isAuthenticating ? (\n <Loader2 size={14} className=\"animate-spin\" aria-hidden=\"true\" />\n ) : (\n <Check size={14} aria-hidden=\"true\" />\n )}\n {oauthWaiting\n ? tr('integrations.addConnection.actions.waiting', 'Waiting...')\n : /* ★ \"Connect\", not \"Save\". This dialog only ever CREATES a\n connection, and a user told to \"find the Connect button\"\n could not: the word appeared nowhere in the flow. Reported\n from production, and confirmed by driving it — the only\n action control read \"Save\".\n\n ★ A dedicated key, not `integrations.common.save`, which\n ProviderEditorPage also uses. Repurposing the shared key\n would rename that button too, and re-pointing a seeded key\n leaves already-translated locales showing the old word. */\n tr('integrations.addConnection.actions.connect', 'Connect')}\n </button>\n </div>\n )}\n </ConnectionModalFrame>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgGA,IAAM,IAAoC,CAAC,cAAc,UAAU;AAMnE,SAAgB,E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,EAAiB,WAChB,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,OAAD;UAAK,WAAU;oBACZ,EAAG,gDAAgD,UAAU;UAC1D,CAAA,EACN,kBAAC,KAAD;UACE,MAAM,EAAiB;UACvB,QAAO;UACP,KAAI;UACJ,WAAU;oBAET,EAAiB;UAChB,CAAA,CACA,EAAA,CAAA;SAEP,EAAiB,WAChB,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,OAAD;UAAK,WAAU;oBACZ,EACC,sDACA,gBACD;UACG,CAAA,EACN,kBAAC,KAAD;UACE,MAAM,EAAiB;UACvB,QAAO;UACP,KAAI;UACJ,WAAU;oBAET,EAAiB;UAChB,CAAA,CACA,EAAA,CAAA;SAEJ;UACF;SAEJ;QACL,EAAA,CAAA;KAED;;GAIL,KAAoB,MACnB,kBAAC,OAAD;IACE,eAAY;IACZ,WAAU;cAFZ,CAIE,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;eAET,EAAG,6CAA6C,SAAS;KACnD,CAAA,EACT,kBAAC,UAAD;KACE,MAAK;KACL,eAAY;KACZ,SAAS;KACT,UAAU,KAAoB,CAAC,EAAe,MAAM;KACpD,WAAU;eALZ,CAOG,IACC,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAe,eAAY;MAAS,CAAA,GAEjE,kBAAC,IAAD;MAAO,MAAM;MAAI,eAAY;MAAS,CAAA,EAEvC,KACG,EAAG,8CAA8C,aAAa,GAW9D,EAAG,8CAA8C,UAAU,CACxD;OACL;;GAEa"}
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export type ConnectionModalPresentation = 'dialog' | 'sheet';
4
+ /** `form` holds the picker and the credential form; `notice` a short message. */
5
+ export type ConnectionModalSize = 'form' | 'notice';
6
+ /**
7
+ * Above the app shell's header (`z-index: 100`) and the assistant panel
8
+ * (`z-50`).
9
+ *
10
+ * The dialog used to sit at Tailwind's `z-50`, so the shell header painted over
11
+ * its top edge and swallowed the title and the Method control — the dialog
12
+ * looked "cut off" no matter how its height was constrained. A modal must
13
+ * out-rank the chrome it covers, and Tailwind's scale stops well below it.
14
+ */
15
+ export declare const OVERLAY_Z = 1100;
16
+ export declare const DIALOG_Z = 1101;
17
+ /**
18
+ * Exported so tests can pin the layout contract as classes: happy-dom does no
19
+ * layout, so "bottom sheet below md" can only be asserted as the classes that
20
+ * produce it.
21
+ */
22
+ export declare const FRAME_CLASSES: Record<ConnectionModalPresentation, Record<ConnectionModalSize, string>>;
23
+ export interface ConnectionModalFrameProps {
24
+ onClose: () => void;
25
+ /** Id of the element that names the dialog. */
26
+ labelledBy: string;
27
+ presentation?: ConnectionModalPresentation;
28
+ size?: ConnectionModalSize;
29
+ testId?: string;
30
+ children: ReactNode;
31
+ }
32
+ /**
33
+ * Mount it only while the dialog is open: mounting is "open" (focus moves in,
34
+ * Escape is armed) and unmounting is "close" (focus returns to whatever held it
35
+ * before).
36
+ */
37
+ export declare function ConnectionModalFrame({ onClose, labelledBy, presentation, size, testId, children, }: ConnectionModalFrameProps): import('react').ReactPortal | null;
38
+ //# sourceMappingURL=ConnectionModalFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionModalFrame.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/ConnectionModalFrame.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI9E,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7D,iFAAiF;AACjF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B,eAAO,MAAM,QAAQ,OAAO,CAAC;AAI7B;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAChC,2BAA2B,EAC3B,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAqBpC,CAAC;AAWF,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,2BAA2B,CAAC;IAC3C,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,UAAU,EACV,YAAuB,EACvB,IAAa,EACb,MAAM,EACN,QAAQ,GACT,EAAE,yBAAyB,sCA8E3B"}
@@ -0,0 +1,64 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { useEffect as t, useRef as n } from "react";
3
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ import { createPortal as o } from "react-dom";
5
+ //#region src/integrations/components/ConnectionModalFrame.tsx
6
+ var s = 1100, c = 1101, l = "border border-border-subtle bg-bg-surface shadow-2xl focus:outline-none", u = {
7
+ dialog: {
8
+ form: "fixed inset-x-4 top-4 bottom-4 mx-auto flex w-auto max-w-3xl flex-col overflow-hidden rounded-xl animate-in fade-in-0 zoom-in-95 duration-200 sm:inset-x-6 sm:top-1/2 sm:bottom-auto sm:max-h-[min(90vh,56rem)] sm:w-full sm:-translate-y-1/2",
9
+ notice: "fixed inset-x-4 top-1/2 mx-auto flex max-w-md -translate-y-1/2 flex-col items-center gap-4 rounded-xl p-8 text-center"
10
+ },
11
+ sheet: {
12
+ form: "fixed inset-x-0 bottom-0 flex max-h-[90dvh] w-full flex-col overflow-hidden rounded-t-2xl border-b-0 pb-[env(safe-area-inset-bottom)] animate-in fade-in-0 duration-200 md:inset-x-6 md:top-1/2 md:bottom-auto md:mx-auto md:max-h-[min(90vh,56rem)] md:max-w-3xl md:-translate-y-1/2 md:rounded-xl md:border-b md:pb-0 md:zoom-in-95",
13
+ notice: "fixed inset-x-0 bottom-0 flex w-full flex-col items-center gap-4 rounded-t-2xl border-b-0 p-8 pb-[max(2rem,env(safe-area-inset-bottom))] text-center md:inset-x-4 md:top-1/2 md:bottom-auto md:mx-auto md:max-w-md md:-translate-y-1/2 md:rounded-xl md:border-b md:pb-8"
14
+ }
15
+ }, d = "a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]";
16
+ function f(e) {
17
+ return Array.from(e.querySelectorAll(d)).filter((e) => !e.closest("[hidden], [inert], [aria-hidden=\"true\"]"));
18
+ }
19
+ function p({ onClose: d, labelledBy: p, presentation: m = "dialog", size: h = "form", testId: g, children: _ }) {
20
+ let v = n(null);
21
+ return t(() => {
22
+ let e = (e) => {
23
+ e.key === "Escape" && d();
24
+ };
25
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
26
+ }, [d]), t(() => {
27
+ let e = v.current, t = document.activeElement instanceof HTMLElement ? document.activeElement : null;
28
+ return e && !e.contains(document.activeElement) && e.focus({ preventScroll: !0 }), () => {
29
+ t && t.isConnected && t !== document.body && t.focus({ preventScroll: !0 });
30
+ };
31
+ }, []), typeof document > "u" ? null : o(/* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("div", {
32
+ "aria-hidden": "true",
33
+ "data-testid": g ? `${g}-backdrop` : void 0,
34
+ style: { zIndex: s },
35
+ className: "fixed inset-0 bg-bg-overlay animate-in fade-in-0 duration-200",
36
+ onClick: d
37
+ }), /* @__PURE__ */ i("div", {
38
+ ref: v,
39
+ role: "dialog",
40
+ "aria-modal": "true",
41
+ "aria-labelledby": p,
42
+ tabIndex: -1,
43
+ "data-testid": g,
44
+ "data-presentation": m,
45
+ style: { zIndex: c },
46
+ className: e(l, u[m][h]),
47
+ onKeyDown: (e) => {
48
+ let t = v.current;
49
+ if (e.key !== "Tab" || e.defaultPrevented || !t || !(e.target instanceof Node) || !t.contains(e.target)) return;
50
+ let n = f(t);
51
+ if (n.length === 0) {
52
+ e.preventDefault(), t.focus({ preventScroll: !0 });
53
+ return;
54
+ }
55
+ let r = n[0], i = n[n.length - 1], a = document.activeElement;
56
+ e.shiftKey && (a === r || a === t) ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
57
+ },
58
+ children: _
59
+ })] }), document.body);
60
+ }
61
+ //#endregion
62
+ export { p as ConnectionModalFrame };
63
+
64
+ //# sourceMappingURL=ConnectionModalFrame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionModalFrame.js","names":[],"sources":["../../../src/integrations/components/ConnectionModalFrame.tsx"],"sourcesContent":["/**\n * ConnectionModalFrame: the backdrop, the dialog box, and the modal behaviour\n * shared by `AddConnectionDialog` and `ConnectSourceDialog`.\n *\n * ★★ PORTALED TO `document.body`, ALWAYS (BOFF-8158, B4). The dialog is\n * `position: fixed`. Rendered inline, any ancestor with a transform or a\n * `translate` becomes its containing block. VibeControls and HealthyBowl host\n * the connections screen inside a Radix dialog whose content carries\n * `translate: -50% -50%`, so this dialog was sized and centred against that\n * 512 px box instead of the viewport, and its z-index was trapped in the host's\n * `z-50` stacking context, below the app header. A portal escapes both, for any\n * host, whatever it wraps us in.\n *\n * ★ A consequence hosts must respect: do NOT render this module's screens inside\n * another modal. A host modal's focus trap and outside-click handling treat a\n * portaled layer as \"outside\" and fight it. Hosts that want connections over\n * the current page render `ConnectSourceDialog`, which IS the modal.\n *\n * Presentations:\n * - `dialog`: the classic add-connection box, a near-full-height card on\n * phones and a centred dialog from `sm`.\n * - `sheet`: a bottom sheet below `md`, a centred dialog from `md`. This is\n * what the assistant's \"Connect a source\" uses, so a phone user keeps the\n * conversation's context above the sheet.\n */\n\nimport { useEffect, useRef, type KeyboardEvent, type ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../utils/cn';\n\nexport type ConnectionModalPresentation = 'dialog' | 'sheet';\n\n/** `form` holds the picker and the credential form; `notice` a short message. */\nexport type ConnectionModalSize = 'form' | 'notice';\n\n/**\n * Above the app shell's header (`z-index: 100`) and the assistant panel\n * (`z-50`).\n *\n * The dialog used to sit at Tailwind's `z-50`, so the shell header painted over\n * its top edge and swallowed the title and the Method control — the dialog\n * looked \"cut off\" no matter how its height was constrained. A modal must\n * out-rank the chrome it covers, and Tailwind's scale stops well below it.\n */\nexport const OVERLAY_Z = 1100;\nexport const DIALOG_Z = 1101;\n\nconst SURFACE = 'border border-border-subtle bg-bg-surface shadow-2xl focus:outline-none';\n\n/**\n * Exported so tests can pin the layout contract as classes: happy-dom does no\n * layout, so \"bottom sheet below md\" can only be asserted as the classes that\n * produce it.\n */\nexport const FRAME_CLASSES: Record<\n ConnectionModalPresentation,\n Record<ConnectionModalSize, string>\n> = {\n dialog: {\n /* `sm:` centres the dialog with `top-1/2 bottom-auto`, which leaves its\n height unbounded — a tall provider form grew past the viewport and was\n clipped at BOTH ends, taking the title and the primary action with it.\n The max-height puts the overflow back where it belongs: the scrollable\n body below. */\n form: 'fixed inset-x-4 top-4 bottom-4 mx-auto flex w-auto max-w-3xl flex-col overflow-hidden rounded-xl animate-in fade-in-0 zoom-in-95 duration-200 sm:inset-x-6 sm:top-1/2 sm:bottom-auto sm:max-h-[min(90vh,56rem)] sm:w-full sm:-translate-y-1/2',\n notice:\n 'fixed inset-x-4 top-1/2 mx-auto flex max-w-md -translate-y-1/2 flex-col items-center gap-4 rounded-xl p-8 text-center',\n },\n sheet: {\n /* Below `md` the sheet is pinned to the bottom edge and grows with its\n content up to 90dvh (dvh, so a phone's collapsing URL bar cannot push\n the footer off-screen). From `md` it is the same centred dialog as\n `dialog`. */\n form: 'fixed inset-x-0 bottom-0 flex max-h-[90dvh] w-full flex-col overflow-hidden rounded-t-2xl border-b-0 pb-[env(safe-area-inset-bottom)] animate-in fade-in-0 duration-200 md:inset-x-6 md:top-1/2 md:bottom-auto md:mx-auto md:max-h-[min(90vh,56rem)] md:max-w-3xl md:-translate-y-1/2 md:rounded-xl md:border-b md:pb-0 md:zoom-in-95',\n notice:\n 'fixed inset-x-0 bottom-0 flex w-full flex-col items-center gap-4 rounded-t-2xl border-b-0 p-8 pb-[max(2rem,env(safe-area-inset-bottom))] text-center md:inset-x-4 md:top-1/2 md:bottom-auto md:mx-auto md:max-w-md md:-translate-y-1/2 md:rounded-xl md:border-b md:pb-8',\n },\n};\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\nfunction focusableWithin(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (el) => !el.closest('[hidden], [inert], [aria-hidden=\"true\"]')\n );\n}\n\nexport interface ConnectionModalFrameProps {\n onClose: () => void;\n /** Id of the element that names the dialog. */\n labelledBy: string;\n presentation?: ConnectionModalPresentation;\n size?: ConnectionModalSize;\n testId?: string;\n children: ReactNode;\n}\n\n/**\n * Mount it only while the dialog is open: mounting is \"open\" (focus moves in,\n * Escape is armed) and unmounting is \"close\" (focus returns to whatever held it\n * before).\n */\nexport function ConnectionModalFrame({\n onClose,\n labelledBy,\n presentation = 'dialog',\n size = 'form',\n testId,\n children,\n}: ConnectionModalFrameProps) {\n const dialogRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleKeyDown = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') onClose();\n };\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [onClose]);\n\n // Focus moves into the dialog on open and back to the opener on close.\n useEffect(() => {\n const dialog = dialogRef.current;\n const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n if (dialog && !dialog.contains(document.activeElement)) {\n dialog.focus({ preventScroll: true });\n }\n return () => {\n if (opener && opener.isConnected && opener !== document.body) {\n opener.focus({ preventScroll: true });\n }\n };\n }, []);\n\n // Tab and Shift+Tab cycle inside the dialog. Scoped to the dialog's own DOM:\n // a portaled popover (a select's option list) handles its own keys, and\n // pulling focus back out of it would close it mid-choice.\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const dialog = dialogRef.current;\n if (event.key !== 'Tab' || event.defaultPrevented || !dialog) return;\n if (!(event.target instanceof Node) || !dialog.contains(event.target)) return;\n const items = focusableWithin(dialog);\n if (items.length === 0) {\n event.preventDefault();\n dialog.focus({ preventScroll: true });\n return;\n }\n const first = items[0];\n const last = items[items.length - 1];\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === dialog)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n if (typeof document === 'undefined') return null;\n\n return createPortal(\n <>\n <div\n aria-hidden=\"true\"\n data-testid={testId ? `${testId}-backdrop` : undefined}\n style={{ zIndex: OVERLAY_Z }}\n className=\"fixed inset-0 bg-bg-overlay animate-in fade-in-0 duration-200\"\n onClick={onClose}\n />\n <div\n ref={dialogRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={labelledBy}\n tabIndex={-1}\n data-testid={testId}\n data-presentation={presentation}\n style={{ zIndex: DIALOG_Z }}\n className={cn(SURFACE, FRAME_CLASSES[presentation][size])}\n onKeyDown={handleKeyDown}\n >\n {children}\n </div>\n </>,\n document.body\n );\n}\n"],"mappings":";;;;;AA4CA,IAAa,IAAY,MACZ,IAAW,MAElB,IAAU,2EAOH,IAGT;CACF,QAAQ;EAMN,MAAM;EACN,QACE;EACH;CACD,OAAO;EAKL,MAAM;EACN,QACE;EACH;CACF,EAEK,IACJ;AAEF,SAAS,EAAgB,GAAuC;AAC9D,QAAO,MAAM,KAAK,EAAU,iBAA8B,EAAU,CAAC,CAAC,QACnE,MAAO,CAAC,EAAG,QAAQ,4CAA0C,CAC/D;;AAkBH,SAAgB,EAAqB,EACnC,YAC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AM,IAAQ,EAAM,IACd,IAAO,EAAM,EAAM,SAAS,IAC5B,IAAS,SAAS;AACxB,GAAI,EAAM,aAAa,MAAW,KAAS,MAAW,MACpD,EAAM,gBAAgB,EACtB,EAAK,OAAO,IACH,CAAC,EAAM,YAAY,MAAW,MACvC,EAAM,gBAAgB,EACtB,EAAM,OAAO;;EA2BV;EACG,CAAA,CACL,EAAA,CAAA,EACH,SAAS,KACV"}
@@ -25,6 +25,8 @@
25
25
  export { IntegrationsRoot } from './IntegrationsRoot';
26
26
  export { ConnectionsPanel } from './ConnectionsPanel';
27
27
  export type { ConnectionsPanelProps } from './ConnectionsPanel';
28
+ export { ConnectSourceDialog } from './ConnectSourceDialog';
29
+ export type { ConnectSourceDialogProps } from './ConnectSourceDialog';
28
30
  export { IntegrationsAdminRoot } from './IntegrationsAdminRoot';
29
31
  export type { IntegrationsRootProps, IntegrationProvider, IntegrationConnection } from './types';
30
32
  export { useIntegrations } from './providers/IntegrationsProvider';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -3,5 +3,6 @@ import "./constants/permissions.js";
3
3
  import "./store/integrationsStore.js";
4
4
  import "./IntegrationsRoot.js";
5
5
  import "./ConnectionsPanel.js";
6
+ import "./ConnectSourceDialog.js";
6
7
  import "./IntegrationsAdminRoot.js";
7
8
  import "./pages/AddConnectionWizard.js";
@@ -420,6 +420,9 @@ export declare const enTranslations: {
420
420
  cancel: string;
421
421
  };
422
422
  };
423
+ connectSource: {
424
+ title: string;
425
+ };
423
426
  addConnection: {
424
427
  title: string;
425
428
  botChannelSetup: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/integrations/translations/en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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmzB1B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,OAAO,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-integrations",
3
- "version": "2026.929.3",
3
+ "version": "2026.930.1",
4
4
  "description": "Burdenoff Integrations Microfrontend - Plugin-based provider and connection management interface",
5
5
  "type": "module",
6
6
  "files": [
@@ -28,7 +28,8 @@
28
28
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
29
29
  "format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
30
30
  "type:check": "bash scripts/build-limits.sh tsc --noEmit",
31
- "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run lint:sanity && bun run format && bun run type:check && bun run build'",
31
+ "test": "bun test --preload ./tests/setup/happy-dom.ts ./tests",
32
+ "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run lint:sanity && bun run format && bun run type:check && bun run test && bun run build'",
32
33
  "schema:pull": "graphql-codegen --project schema-wspace && graphql-codegen --project schema-global",
33
34
  "codegen": "graphql-codegen --project wspace && graphql-codegen --project global",
34
35
  "codegen:all": "bun run schema:pull && bun run codegen",
@@ -61,6 +62,7 @@
61
62
  "@graphql-codegen/typescript": "^4.0.0",
62
63
  "@graphql-codegen/typescript-operations": "^4.0.0",
63
64
  "@graphql-codegen/typescript-react-apollo": "^4.0.0",
65
+ "@happy-dom/global-registrator": "^20.14.5",
64
66
  "@types/react": "^19.0.2",
65
67
  "@types/react-dom": "^19.0.2",
66
68
  "@vitejs/plugin-react": "^4.3.4",