@activecollab/components
Version:
ActiveCollab Components
59 lines • 2.64 kB
TypeScript
import React, { ReactElement } from "react";
export type ConnectionService = "github" | "gitlab";
export interface Connection {
id: string;
/** Org / group name, e.g. "ActiveCollab" or "a51-ops". */
name: string;
service: ConnectionService;
}
/** Human-readable provider label used in the group header "name (type)". */
export declare const serviceLabel: (service: ConnectionService) => string;
/** Provider glyph for a connection: GitHub / GitLab, Git for anything else. */
export declare const connectionIcon: (service?: ConnectionService) => ReactElement;
export interface Repository {
id: string;
/** Full repository path, e.g. activecollab/backend. */
name: string;
connectionId: string;
}
export declare const CONNECTIONS: Connection[];
/** Repositories already connected to the project (shown in link pickers). */
export declare const PROJECT_REPOSITORIES: Repository[];
/** Repositories available to connect (not yet linked to the project). */
export declare const CONNECTABLE_REPOSITORIES: Repository[];
/**
* Build grouped Select options — groups and options both sorted by name. Each
* repository option carries a leading provider icon (GitHub / GitLab / Git) via
* the Select's `icon` slot; the group header is just the connection name, since
* the icon now conveys the service (no "(GitHub)" / "(GitLab)" suffix).
*/
export declare const buildRepoOptions: (repositories: Repository[], connections: Connection[]) => {
id: string;
name: string;
options: {
id: string;
name: string;
icon: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
}[];
}[];
export interface RepositorySelectProps {
repositories: Repository[];
connections: Connection[];
selected: string | null;
onChange: (id: string) => void;
invalid?: boolean;
placeholder?: string;
className?: string;
}
export declare const RepositorySelect: ({ repositories, connections, selected, onChange, invalid, placeholder, className, }: RepositorySelectProps) => ReactElement;
export interface ConnectRepositoryDialogProps {
open: boolean;
onClose: () => void;
/** Called with the connected repository when the user confirms. */
onConnect: (repository: Repository) => void;
/** Repositories that can be connected (defaults to the mock connectable set). */
repositories?: Repository[];
connections?: Connection[];
}
export declare const ConnectRepositoryDialog: ({ open, onClose, onConnect, repositories, connections, }: ConnectRepositoryDialogProps) => ReactElement;
//# sourceMappingURL=ConnectRepositoryDialog.d.ts.map