import { type HTMLAttributes, type ReactNode } from 'react';
import { type VariantProps } from 'class-variance-authority';
import { type NoteAttachment } from '../_shared/note-attachment';
export type { NoteAttachment };
/** Author identity — drives the avatar + visible byline. */
export interface ClinicalNoteAuthor {
/** Display name. */
name: string;
/** Optional avatar image URL. */
avatarUrl?: string;
}
/** Imperative handle exposed to the agent runtime — identifiers / flags only. */
export interface ClinicalNoteCardHandle {
/** The note's stable id, when supplied. */
getNoteId: () => string | undefined;
/** Whether the note is currently pinned. */
isPinned: () => boolean;
/** Whether the note is currently flagged. */
isFlagged: () => boolean;
/** The attachment kind the note is bound to. */
getAttachmentKind: () => NoteAttachment['kind'] | undefined;
}
export interface ClinicalNoteCardProps extends Omit, 'aria-label' | 'children' | 'content' | 'title'> {
/** Agent-readiness consumer id, surfaced as `data-component-id`. */
id?: string;
/**
* ISO-8601 timestamp the note refers to (the clinical date). Drives the
* primary ``. An empty string renders no timestamp (an undated
* imported note).
*/
dateIso: string;
/**
* ISO-8601 timestamp the note was authored, when it differs from
* `dateIso`. Rendered as a secondary "added" line.
*/
createdAtIso?: string;
/** Author identity — avatar + byline. Optional for system notes. */
author?: ClinicalNoteAuthor;
/** The operator the note is credited to: a secondary "Operator: …" byline. */
operatorName?: string;
/**
* A deleted note kept for the record. Shows a "Deleted" badge and keeps the
* body out of the DOM until the reader presses "Show deleted note". Not an
* access control: the body is one press away.
*/
deleted?: boolean;
/**
* Whether this is a clinical note (vs. an administrative one). When true a
* "Clinical" badge is shown so the note's nature is unambiguous at a glance.
*/
clinical?: boolean;
/** What the note is attached to — drives a contextual chip + optional link. */
attachedTo?: NoteAttachment;
/**
* The note body, authored in a small, safe subset of Markdown (bold,
* italic, inline code, links, line breaks, simple lists). Rendered through
* the shared `SafeHtml` helper with the `markdown` sanitiser profile —
* raw HTML and unsafe link schemes are stripped.
*/
content: string;
/**
* How `content` is authored. `'markdown'` (default) runs the small Markdown
* subset through the converter; `'html'` treats `content` as rich HTML
* (e.g. Redactor output) and renders it through SafeHtml's `rich-text`
* profile, so colours, sizes, tables and images survive sanitisation.
*/
contentFormat?: 'markdown' | 'html';
/** Pin the note to the top of a timeline — shows a "Pinned" chip. */
pinned?: boolean;
/** Flag the note for follow-up / attention — shows a "Flagged" chip. */
flagged?: boolean;
/**
* Host-owned actions for this note (edit, delete, share …), rendered
* beside the pin and flag. They belong in the same cluster: a reader
* looking for what they can do to a note should find every affordance
* in one place, not some in the card and the rest below it.
*/
headerActions?: ReactNode;
/**
* When provided, the pinned chip becomes an `aria-pressed` toggle button so
* the note can be (un)pinned in place — the pin glyph fills and tints to the
* accent when pinned (no button fill). Omit for a static, display-only card.
*/
onTogglePin?: () => void;
/** As `onTogglePin`, for the flagged state (warning-tinted when flagged). */
onToggleFlag?: () => void;
/**
* A pin write is in flight. The toggle keeps showing `pinned`, is
* `aria-disabled`, dims and ignores clicks until the host answers. Only
* with `onTogglePin`.
*/
pinPending?: boolean;
/** As `pinPending`, for the flag toggle. */
flagPending?: boolean;
/**
* Clamp the rendered body to five lines. When the body is taller than the
* clamp, a "Read more" / "Read less" disclosure toggles the full text in
* place — the note stays a read-only display surface, so this is the
* sighted-user escape hatch (assistive tech reads the full body regardless).
*/
truncate?: boolean;
/**
* `'elevated'` (default) wraps the note in ``.
* `'flat'` drops the chrome for use inside an existing Card / timeline rail.
*/
surface?: 'flat' | 'elevated';
/** Override the default region aria-label. */
'aria-label'?: string;
}
declare const rootVariants: (props?: ({
surface?: "elevated" | "flat" | null | undefined;
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
export declare const ClinicalNoteCard: import("react").ForwardRefExoticComponent>;
/** Re-export of the surface variant union for downstream typing. */
export type ClinicalNoteCardSurface = NonNullable['surface']>;
//# sourceMappingURL=clinical-note-card.d.ts.map