export type SourcesPanelVariant = 'full' | 'simple'; /** * A single step in a source's setup progress (e.g. Connectivity, Data selection, * Transformations). Rendered as a row of dashes in the `full` variant only. */ export interface SourcesPanelProgressItem { label: string; done: boolean; } export interface SourcesPanelSourceItem { id: string; /** * Display name. The view renders a placeholder (e.g. "Untitled source") * when this is empty. */ name: string; /** Database/source type label, e.g. "PostgreSQL". */ type: string; /** Whether every step for this source has been completed. */ isComplete: boolean; /** * When true, this source is read-only (e.g. already deployed in the add-source * flow) — its delete control is not rendered even when the panel provides `onRemove`. */ isReadonly?: boolean; /** * Per-step progress used to render the dash indicator. Only rendered in * the `full` variant. */ progress?: SourcesPanelProgressItem[]; } export interface SourcesPanelProps { sources: SourcesPanelSourceItem[]; activeSourceId: string; onSelect: (id: string) => void; /** Disables source selection without changing the selected source. */ isSelectDisabled?: boolean; /** Tooltip shown on source cards while selection is disabled. */ selectDisabledHint?: string; /** * `full` renders the add-source control, per-source progress dashes and * the footer completion counter. `simple` renders a plain selectable list. */ variant: SourcesPanelVariant; /** * Called when the add-source control is activated. Only rendered when * `variant` is `full` and `onAdd` is provided. */ onAdd?: () => void; /** Label for the add-source control. Defaults to "Add source". */ addLabel?: string; /** Disables the add-source control (e.g. until the active source is named and typed). */ isAddDisabled?: boolean; /** Tooltip shown on the add-source control while it is disabled. */ addDisabledHint?: string; /** * Called when a source's delete control is activated. Only rendered when * provided; the control does not trigger source selection. */ onRemove?: (id: string) => void; /** Disables every delete control (e.g. when only one source remains). */ isRemoveDisabled?: boolean; /** Tooltip shown on the delete control while it is disabled. */ removeDisabledHint?: string; /** Accessible label for the delete control. Defaults to "Delete source". */ removeAriaLabel?: string; }