@activecollab/components
Version:
ActiveCollab Components
64 lines • 3.04 kB
TypeScript
import { ReactElement } from "react";
/**
* ProjectCard — a project as a stacked card.
*
* The sixth content type, and the second one that mirrors a project-management
* record rather than something authored on the surface (TaskCard is the first).
* It composes the same shell and the same rows; nothing in `components/StackedCard`
* knows it exists.
*
* The face is the app's Projects page, read off `ProjectListGroup.jsx`:
* - the NAME is the card's title (`Header3`, as in the grid card);
* - the CLIENT sits under it — `Entity.Property "entity-property-client"`, the
* company the project is for;
* - the DESCRIPTION is the project's `body`, the grid card's `Body2` tertiary
* excerpt, clamped because the whole text lives on the project and this is a
* reference to it, not a copy;
* - the LEADER and the LABEL share one row. The label is a FILLED pill whose
* background is the label's own colour and whose text is a darker shade of
* it (`ProjectLabel.jsx`: `EntityLabel` with `backgroundColor: label.color`,
* `color: label.darker_text_color`) — the design system's `Chip`, not the
* colour-text `Tag` the column cards use for task labels.
*
* There is deliberately NO progress indicator. A single percentage is the one
* number on a project that cannot be read without knowing how it was computed,
* and a card is a place people put a project to talk ABOUT it — the number
* invites a conversation about the number instead.
*/
export interface ProjectCardPerson {
name: string;
initials: string;
/** Avatar colours stand in for the server-rendered avatar: data, not theme. */
color: string;
}
/** A project label carries both of the colours the app stores for it. */
export interface ProjectCardLabel {
text: string;
/** `label.color` — the pill's background. */
color: string;
/** `label.darker_text_color` — the pill's text. */
textColor: string;
}
/**
* What an internal project's client line says.
*
* A project with no client belongs to the account's own company, and printing
* that company's name back at someone who works there says nothing. So the line
* states the fact instead.
*/
export declare const INTERNAL_CLIENT_LABEL = "Internal";
/** One rule for the client line, so no surface can label the same project twice. */
export declare const projectClientLine: (client: string | null | undefined) => string;
export interface ProjectCardProps {
name?: string;
/** The client company. `null` is an internal project — the line reads "Internal". */
client?: string | null;
/** The project's `body`; the excerpt row exists only when it has one. */
description?: string;
/** A project need not have a leader. */
leader?: ProjectCardPerson;
/** A project need not have a label. */
label?: ProjectCardLabel;
}
export declare const ProjectCard: ({ name, client, description, leader, label, }: ProjectCardProps) => ReactElement;
//# sourceMappingURL=ProjectCard.d.ts.map