import { AdapterDomain, AdapterStatusInfo, DomainAdapterConfig, AdapterStatusType, DbAdapter, AuthAdapter, PaymentsAdapter, AiAdapter, FileStorageAdapter, AdminAdapter, LoggerAdapter, AdapterError } from '@geenius/adapters'; import { JSX, ReactNode } from 'react'; /** * @module AdapterCard * @package @geenius/adapters/react-css * @description Renders the vanilla CSS adapter summary card for the React CSS * variant. The card surfaces provider status, latency, and domain metadata for * one adapter domain in the dashboard views. */ /** * Props for rendering a single adapter summary card in the React CSS dashboard grid. * * @property domain Adapter domain represented by the card. * @property status Current provider health and metadata for the domain. * @property onClick Optional callback fired when the card is activated. * @property className Optional class name merged into the card container. */ interface AdapterCardProps { domain: AdapterDomain; status: AdapterStatusInfo; onClick?: () => void; className?: string; } /** * Renders a clickable React CSS summary card for one adapter domain. * * @param props Card props including the adapter domain, status payload, and click handler. * @returns A focusable article when selectable, otherwise a static article. */ declare function AdapterCard({ domain, status, onClick, className, }: AdapterCardProps): JSX.Element; /** * @module AdapterConfigForm * @package @geenius/adapters/react-css * @description Renders the vanilla CSS adapter configuration form for the React * adapter package. This form lets consumers choose a provider and supply the * credentials required to persist a domain-specific adapter configuration. */ /** * Props accepted by the React CSS adapter configuration form. * * @property domain Adapter domain being configured in the current dialog * @property initialConfig Existing configuration values used to hydrate the form * @property onSave Async or sync handler that persists the submitted configuration * @property onCancel Optional callback invoked when the user dismisses the form * @property className Optional class name merged onto the form root * @property titleId Optional identifier applied to the form title for dialog labelling */ interface AdapterConfigFormProps { domain: AdapterDomain; initialConfig?: DomainAdapterConfig; onSave: (config: DomainAdapterConfig) => Promise | void; onCancel?: () => void; className?: string; titleId?: string; } /** * Renders the adapter configuration workflow for a single adapter domain. * * @param props Component props controlling the selected domain and form callbacks * @returns A provider chooser and credential form styled with the CSS variant * @example * ```tsx * saveConfig('auth', config)} * onCancel={() => setOpen(false)} * /> * ``` */ declare function AdapterConfigForm({ domain, initialConfig, onSave, onCancel, className, titleId, }: AdapterConfigFormProps): JSX.Element; /** * @module AdapterList * @package @geenius/adapters/react-css * @description Renders the searchable vanilla CSS adapter grid for the React * CSS variant. The list consumes provider status from context and delegates * selection events to the hosting page. */ /** * Props for rendering the React CSS adapter list and optional status filter controls. * * @property onSelect Optional callback invoked when a domain card is selected. * @property onConfigure Optional callback invoked from the empty-state CTA when no adapters are configured. * @property filterStatus Optional status filter applied before rendering the grid. * @property className Optional class name merged into the outer wrapper. */ interface AdapterListProps { onSelect?: (domain: AdapterDomain) => void; onConfigure?: () => void; filterStatus?: AdapterStatusType; className?: string; } /** * Renders the searchable React CSS adapter list backed by shared provider state. * * @param props List props including selection callback, status filtering, and wrapper class names. * @returns The adapter grid or an empty/loading state when no entries are available. */ declare function AdapterList({ onSelect, onConfigure, filterStatus, className, }: AdapterListProps): JSX.Element; /** * @module AdapterStatusBadge * @package @geenius/adapters/react-css * @description Renders the vanilla CSS adapter status badge for the React CSS * variant. The badge exposes the shared adapter status vocabulary in a compact, * themeable visual treatment. */ /** * Props for rendering the React CSS adapter status badge. * * @property status Shared adapter status vocabulary value to display. * @property showLabel Whether the human-readable label should be rendered. * @property size Visual size variant — `sm` for list cells, `md` for detail headers (mirrors the React reference's size axis). * @property className Optional class name merged into the badge wrapper. */ interface AdapterStatusBadgeProps { status: AdapterStatusType; showLabel?: boolean; size?: "sm" | "md"; className?: string; } /** * Renders a compact React CSS badge for the current adapter lifecycle state. * * @param props Badge props including the status token, optional label visibility, and size variant. * @returns A styled badge element that mirrors the shared adapter status taxonomy. */ declare function AdapterStatusBadge({ status, showLabel, size, className, }: AdapterStatusBadgeProps): JSX.Element; /** * @module index * @package @geenius/adapters/react-css * @description Defines the React CSS adapter hooks for reading adapter instances * and adapter status state from the React CSS provider context. These hooks are * part of the public React CSS runtime package and avoid unpublished shared * framework subpaths. */ /** * Reads the configured database adapter from the current React CSS adapter context. * * @returns The active database adapter implementation for the provider tree. * @throws {AdapterContextError} When no React CSS adapter provider is mounted. * * @example * ```tsx * function Users() { * const db = useDb() * return null * } * ``` */ declare function useDb(): DbAdapter; /** * Reads the configured authentication adapter from the current React CSS context. * * @returns The active authentication adapter implementation. * @throws {AdapterContextError} When the auth adapter is unavailable. */ declare function useAuth(): AuthAdapter; /** * Reads the configured authentication adapter from the current React CSS context. * * @returns The active authentication adapter implementation. * @throws {AdapterContextError} When the auth adapter is unavailable. */ declare function useAuthAdapter(): AuthAdapter; /** * Reads the configured payments adapter from the current React CSS context. * * @returns The active payments adapter implementation. * @throws {AdapterContextError} When the payments adapter is unavailable. */ declare function usePayments(): PaymentsAdapter; /** * Reads the configured AI adapter from the current React CSS context. * * @returns The active AI adapter implementation. * @throws {AdapterContextError} When the AI adapter is unavailable. */ declare function useAi(): AiAdapter; /** * Reads the configured file-storage adapter from the current React CSS context. * * @returns The active file-storage adapter implementation. * @throws {AdapterContextError} When the storage adapter is unavailable. */ declare function useFileStorage(): FileStorageAdapter; /** * Reads the configured file-storage adapter from the current React CSS context. * * @returns The active file-storage adapter implementation. * @throws {AdapterContextError} When the storage adapter is unavailable. */ declare function useStorage(): FileStorageAdapter; /** * Reads the configured admin adapter from the current React CSS context. * * @returns The active admin adapter implementation. * @throws {AdapterContextError} When the admin adapter is unavailable. */ declare function useAdmin(): AdminAdapter; /** * Reads the configured logger adapter from the current React CSS context. * * @returns The active logger adapter implementation. * @throws {AdapterContextError} When the logger adapter is unavailable. */ declare function useLogger(): LoggerAdapter; /** * Returns the full adapter status record from the current React CSS context. * * @returns A status object keyed by adapter domain. */ declare function useAdapterStatuses(): Record; /** * Returns the current status for a single adapter domain. * * @param domain Adapter domain whose status should be returned. * @returns The latest status snapshot for the requested domain. */ declare function useAdapterStatus(domain: AdapterDomain): AdapterStatusInfo; /** * Reports whether a specific adapter domain is configured and connected. * * @param domain Adapter domain to inspect. * @returns `true` when the domain is ready for consumer use. */ declare function useIsAdapterReady(domain: AdapterDomain): boolean; /** * Accesses every adapter and status helper from the current provider context. * * @returns A memoized snapshot of adapters, statuses, and loading helpers. */ declare function useAdapters(): { db: DbAdapter; auth: AuthAdapter; payments: PaymentsAdapter; ai: AiAdapter; fileStorage: FileStorageAdapter; storage: FileStorageAdapter; admin: AdminAdapter; logger: LoggerAdapter; statuses: Record; isLoading: boolean; isReady: (domain: AdapterDomain) => boolean; }; /** * @module cx * @package @geenius/adapters/react-css * @description Provides the lightweight class name composition helper used by * the React CSS variant. The helper keeps conditional CSS class assembly terse * without introducing Tailwind-specific dependencies. * * @param classes Class value strings, arrays, and object maps where falsy values are ignored * @returns A space-delimited class name string with duplicate tokens removed * * @example * ```ts * cx('button', 'button-primary') // 'button button-primary' * cx('button', isActive && 'button-active') // 'button button-active' or 'button' * cx('base', null, undefined, false, 'modifier') // 'base modifier' * cx('base', ['nested'], { 'is-active': true }) // 'base nested is-active' * ``` */ type ClassValue = string | number | boolean | null | undefined | readonly ClassValue[] | { readonly [className: string]: unknown; }; declare function cx(...classes: ClassValue[]): string; /** * @module AdapterDetailPage * @package @geenius/adapters/react-css * @description Renders the vanilla CSS single-domain adapter detail view for * the React CSS variant. The page surfaces current provider health, available * providers, and inline configuration for one adapter domain. */ /** * Props for rendering the React CSS single-domain adapter detail page. * * @property domain Adapter domain whose provider details should be displayed. * @property onBack Optional callback for returning to the dashboard view. * @property onConfigure Optional callback used to persist submitted provider configuration. * @property initialConfig Existing configuration value used to hydrate the inline form. * @property className Optional class name merged into the page container. */ interface AdapterDetailPageProps { domain: AdapterDomain; onBack?: () => void; onConfigure?: (domain: AdapterDomain, config: DomainAdapterConfig) => Promise | void; initialConfig?: DomainAdapterConfig; className?: string; } /** * Renders the React CSS adapter detail page for one adapter domain. * * @param props Page props including the selected domain and optional back-navigation handler. * @returns The detail view with provider health, available providers, and configuration affordances. */ declare function AdapterDetailPage(props: AdapterDetailPageProps): JSX.Element; /** * @module AdaptersPage * @package @geenius/adapters/react-css * @description Renders the vanilla CSS adapters overview for the React package. * The page summarizes adapter health, supports status filtering, and provides * an accessible modal workflow for configuring each adapter domain. */ type RegistryEntry = { domain: AdapterDomain; provider: string; status: AdapterStatusType; }; /** * Props accepted by the React CSS adapters overview page. * * @property onNavigateDetail Optional callback used instead of opening the inline modal * @property onConfigure Optional callback used to persist submitted provider configuration * @property configByDomain Optional configuration snapshot used to hydrate modal forms (parity with React variant) * @property initialConfigs Back-compat alias for {@link AdaptersPageProps.configByDomain}; `configByDomain` wins when both are set * @property className Optional class name merged onto the page root * @property registryEntries Optional adapter registry snapshot rendered above the grid */ interface AdaptersPageProps { onNavigateDetail?: (domain: AdapterDomain) => void; onConfigure?: (domain: AdapterDomain, config: DomainAdapterConfig) => Promise | void; configByDomain?: Partial>; initialConfigs?: Partial>; className?: string; registryEntries?: RegistryEntry[]; } /** * Renders the adapter management dashboard for the React CSS variant. * * @param props Page props controlling navigation overrides and registry data * @returns A dashboard with status filters, adapter cards, and a modal editor * @example * ```tsx * navigate(`/adapters/${domain}`)} /> * ``` */ declare function AdaptersPage(props: AdaptersPageProps): JSX.Element; /** * @module index * @package @geenius/adapters/react-css * @description Implements the React CSS adapter provider and context access * helpers. This module owns adapter status initialization for the React CSS * runtime package while keeping the shared package framework-agnostic. */ type AnyAdapter = DbAdapter | AuthAdapter | PaymentsAdapter | AiAdapter | FileStorageAdapter | AdminAdapter | LoggerAdapter; type AdapterForDomain = D extends "db" ? DbAdapter : D extends "auth" ? AuthAdapter : D extends "payments" ? PaymentsAdapter : D extends "ai" ? AiAdapter : D extends "storage" ? FileStorageAdapter : D extends "admin" ? AdminAdapter : D extends "logger" ? LoggerAdapter : never; type AdapterByDomain = { [D in AdapterDomain]: AdapterForDomain; }; type ResolvedAdapterSet = AdapterByDomain & { fileStorage: FileStorageAdapter; }; /** * React CSS adapter bag keyed by domain. * * @property db Database adapter implementation when configured. * @property auth Authentication adapter implementation when configured. * @property payments Payments adapter implementation when configured. * @property ai AI adapter implementation when configured. * @property storage File-storage adapter implementation when configured. * @property fileStorage File-storage adapter alias accepted by the public React CSS provider. * @property admin Admin adapter implementation when configured. * @property logger Logger adapter implementation when configured. */ interface AdapterSet extends Partial> { db?: DbAdapter; auth?: AuthAdapter; payments?: PaymentsAdapter; ai?: AiAdapter; storage?: FileStorageAdapter; fileStorage?: FileStorageAdapter; admin?: AdminAdapter; logger?: LoggerAdapter; } /** Registry shape accepted by the public React CSS provider. */ type AdapterRegistry = AdapterSet; /** * React CSS adapter context value exposed to hooks and provider consumers. * * @property adapters Adapter bag passed into the provider. * @property statuses Current status record for each adapter domain. * @property getAdapter Returns a configured adapter for a specific domain or throws when missing. * @property isReady Reports whether a domain is configured and connected. * @property isLoading Indicates whether initial health checks are still running. */ interface AdapterContextValue { adapters: ResolvedAdapterSet; statuses: Record; getAdapter: (domain: K) => AdapterByDomain[K]; isReady: (domain: AdapterDomain) => boolean; isLoading: boolean; } type AdapterHealthProbeMap = Partial<{ [D in AdapterDomain]: (adapter: AdapterByDomain[D], adapters: ResolvedAdapterSet) => Promise | void; }>; /** * Props accepted by the React CSS adapter provider. * * @property adapters Optional adapter bag made available to descendant hooks and components. * @property registry Optional registry alias for adapter overrides. * @property db Optional direct database adapter override. * @property auth Optional direct auth adapter override. * @property payments Optional direct payments adapter override. * @property ai Optional direct AI adapter override. * @property storage Optional direct file-storage adapter override. * @property fileStorage Optional public file-storage adapter alias. * @property admin Optional direct admin adapter override. * @property logger Optional direct logger adapter override. * @property children React subtree that should receive adapter context. * @property healthCheck Whether the provider should probe configured adapters on mount. * @property healthProbes Optional domain-specific health probes supplied by the host app. * @property statusOverrides Optional deterministic status overrides for tests and previews. * @property onError Optional typed error callback invoked when provider lifecycle checks fail. */ interface AdapterProviderProps extends Partial { adapters?: AdapterSet; registry?: Partial; children: ReactNode; healthCheck?: boolean; healthProbes?: AdapterHealthProbeMap; statusOverrides?: Partial>>; onError?: (error: AdapterError) => void; } /** * Provides the React CSS adapter context and optional health-check lifecycle. * * @param props Provider props including the adapter bag, child tree, and optional health-check settings. * @returns A React CSS context provider that exposes adapters and derived status metadata. */ declare function AdapterProvider(props: AdapterProviderProps): JSX.Element; /** * Plural provider alias matching the public `@geenius/adapters/react-css` contract. */ declare const AdaptersProvider: typeof AdapterProvider; /** * Reads the React CSS adapter context from the nearest provider. * * @returns The active adapter context value with adapters, statuses, and readiness helpers. * @throws {AdapterContextError} When called outside of an `` tree. */ declare function useAdapterContext(): AdapterContextValue; export { AdapterCard, type AdapterCardProps, AdapterConfigForm, type AdapterConfigFormProps, type AdapterContextValue, AdapterDetailPage, type AdapterDetailPageProps, type AdapterHealthProbeMap, AdapterList, type AdapterListProps, AdapterProvider, type AdapterProviderProps, type AdapterRegistry, type AdapterSet, AdapterStatusBadge, type AdapterStatusBadgeProps, AdaptersPage, type AdaptersPageProps, AdaptersProvider, cx as cn, useAdapterContext, useAdapterStatus, useAdapterStatuses, useAdapters, useAdmin, useAi, useAuth, useAuthAdapter, useDb, useFileStorage, useIsAdapterReady, useLogger, usePayments, useStorage };