@activecollab/components
Version:
ActiveCollab Components
91 lines • 4.49 kB
TypeScript
import React, { ReactElement } from "react";
/**
* TaskCard — the baseline-preservation card.
*
* This is the replacement for today's column card, so it must reproduce every
* behavior that card has (note 52104 §B2) — none of them are optional, each is
* a silent-regression risk. Every one is a prop here so the story can toggle it:
*
* - task-number prefix in the title (config-gated, mirrors `show_task_id`)
* - overdue date colouring (red ONLY when overdue AND not completed)
* - dependency counter (behind a feature-flag prop)
* - hidden-from-clients signifier (shown only when it DIFFERS from the
* project default)
* - inline assignee affordance (avatar, or an add-assignee placeholder)
* - completed (teal tint, no "…" menu, no overdue colour)
* - assignees appear ONCE (in the info line when the card has no
* date range, in the date row when it
* has one — never in both)
*
* The pending/optimistic and priority states are SHELL states (dimmed +
* pointer-events off; red left bar), so the card is wrapped in a `<StackedCard
* pending>` / `<StackedCard priorityColor>` by the host — they are not the
* card's own concern and live on the shell, not here.
*
* Everything is measured against the app: `ColumnCardBody.jsx`,
* `ColumnCardBodyInfo.jsx`, `ColumnCardDate.jsx` and
* `view.project_tasks_column_mode.less`.
*/
export interface TaskCardLabel {
text: string;
/** The label's own colour — data, not theme. */
color: string;
}
export interface TaskCardPerson {
name: string;
initials: string;
/** Avatar colours stand in for the server-rendered avatar: data, not theme. */
color: string;
}
export interface TaskCardProps {
title?: string;
/** Optional cover — task cards in a column usually have none. */
cover?: boolean;
playable?: boolean;
coverControls?: boolean;
/** Config-gated task-number prefix (mirrors `show_task_id`). */
showTaskId?: boolean;
taskId?: number;
/**
* The project the task lives in, above the title. Off by default: in a column
* the column already says it, and only a surface that mixes projects (a
* canvas) needs the line.
*/
showProjectName?: boolean;
projectName?: string;
/**
* The task's labels. Up to two read as colour text (`Tag`, the column card's
* treatment); more collapse to coloured dots plus an overflow count, which is
* what the design system maps ">2 labels" to. An empty array means the card
* has no labels — and then the info line must not open with a separator.
*/
labels?: TaskCardLabel[];
/** Open-subtask and comment counters; each shows only when it is non-zero. */
subtaskCount?: number;
commentCount?: number;
/**
* The date range. `null` (or empty) means the task has none — the date row
* disappears and the assignees move up into the info line, so they still
* appear exactly once.
*/
dateLabel?: string | null;
/** Overdue date — colours the date red, but only when NOT completed. */
overdue?: boolean;
/** Dependency counter, gated behind a feature flag. */
showDependencies?: boolean;
dependencyCount?: number;
/** The task's hidden-from-clients flag. */
hiddenFromClients?: boolean;
/** The project default for client visibility; the signifier shows on a diff. */
projectDefaultHidden?: boolean;
/** Whether the task has an assignee (avatar) or shows the add affordance. */
assigned?: boolean;
/** The actual assignees, when the host has them. Limited to 3, as in the app. */
assignees?: TaskCardPerson[];
/** Completed — teal tint, no "…" menu, no overdue colour. */
completed?: boolean;
}
export declare const TaskCard: ({ title, cover, playable, coverControls, showTaskId, taskId, showProjectName, projectName, labels, subtaskCount, commentCount, dateLabel, overdue, showDependencies, dependencyCount, hiddenFromClients, projectDefaultHidden, assigned, assignees, completed, }: TaskCardProps) => ReactElement;
export declare const TaskPlaceholder: (props: React.ButtonHTMLAttributes<HTMLButtonElement>) => ReactElement;
export declare const TaskSkeleton: () => ReactElement;
//# sourceMappingURL=TaskCard.d.ts.map