import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
import { type VariantProps } from 'class-variance-authority';
import { entitySurfaceVariants, type CarePlanState } from '../_shared/entity-card';
export type { CarePlanState } from '../_shared/entity-card';
/** Heading element the plan name / number renders as. */
export type CarePlanHeaderHeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
/** Tone of an attention alert chip → the Badge variant it paints with. */
export type CarePlanHeaderAlertTone = 'warning' | 'error' | 'info';
/**
* One attention alert shown as a chip beneath the heading — e.g. a missing
* signature, an expired estimate. The kit owns the chip; the consumer owns the
* (already-localised) label and the meaning.
*/
export interface CarePlanHeaderAlert {
/** Stable key — identifier only, never PHI. Keys the chip + agent count. */
id: string;
/** Already-localised label (consumer-provided). */
label: ReactNode;
/** Severity tone. Defaults to `warning`. */
tone?: CarePlanHeaderAlertTone;
/** Optional leading glyph (a single lucide element). */
icon?: ReactElement;
}
/**
* One meta fact in the footer strip — operator, price list, referrer, …. The
* label is consumer-localised; the value is any node (text, an Avatar + name,
* a Link). Rendered through the shared `KeyValuePair`.
*/
export interface CarePlanHeaderMetaItem {
/** Stable key — identifier only, never PHI. */
id: string;
/** Already-localised label (consumer-provided). */
label: string;
/** Value node. */
value: ReactNode;
/** Optional leading glyph for the pair (a single lucide element). */
icon?: ReactElement | null;
}
/** Lifecycle dates — each an ISO-8601 string, rendered via `Timestamp`. */
export interface CarePlanHeaderDates {
/** Acceptance date. */
acceptedIso?: string;
/** Closure date. */
closedIso?: string;
/** Discard date. */
discardedIso?: string;
}
/**
* Imperative handle the agent adapter drives. Reads only structural state —
* the lifecycle enum and the count of alerts. Never the plan name, the meta
* values, or any patient identity.
*/
export interface CarePlanHeaderHandle {
/** The plan lifecycle state (enum, never the localised label). */
getState: () => CarePlanState;
/** How many attention alerts are showing. */
getAlertCount: () => number;
}
export interface CarePlanHeaderProps extends Omit, 'title'> {
/** Agent-readiness instance id, surfaced as `data-component-id`. */
id?: string;
/**
* Plan number — used as the heading when no `name` is given (matching
* platform's `getPresentationName()`, which falls back to `Piano #{number}`)
* and as the plan's structural identity for the agent layer.
*/
number: string | number;
/**
* Override the number-as-heading label (e.g. a consumer's own `Plan #15`),
* used ONLY when no `name` is given. Defaults to the localised
* `Care plan {{number}}` shared with `CarePlanCard`, so the two surfaces read
* alike unless a consumer opts out. With a `name` present the number is not
* shown — platform draws no separate plan-number eyebrow.
*/
numberLabel?: ReactNode;
/** Plan name — the title heading. Omit for a number-only header. */
name?: ReactNode;
/** Lifecycle state — drives the badge variant + localised label. */
state: CarePlanState;
/** Deep link for the heading. Rendered only when it passes the safe-URL gate. */
url?: string;
/** Attention alerts (e.g. signature missing) shown as chips under the heading. */
alerts?: CarePlanHeaderAlert[];
/** Consumer-labelled meta facts (operator, price list, …) in the footer. */
meta?: CarePlanHeaderMetaItem[];
/**
* Lifecycle dates. The date matching the current `state` is folded into the
* lifecycle badge (e.g. "Accepted · {date}"), making the badge self-describing;
* any other date (e.g. the acceptance date of a now-closed plan) renders as a
* muted `Timestamp` line beneath the meta.
*/
dates?: CarePlanHeaderDates;
/** Inline-end actions slot (e.g. Share / Print). */
actions?: ReactNode;
/** Heading element the name / number renders as. Defaults to `h3`. */
headingTag?: CarePlanHeaderHeadingTag;
/** `elevated` (default) paints the kit card chrome; `flat` drops it. */
surface?: 'flat' | 'elevated';
/** Internal padding density. Defaults to `comfortable`. */
density?: 'comfortable' | 'compact';
/** BCP-47 locale override for the dates. Defaults to `i18n.language`. */
locale?: string;
/** Fires when the plan deep link / heading is activated. */
onActivate?: () => void;
/** Accessible name override for the plan region (defaults to the heading). */
'aria-label'?: string;
}
export declare const CarePlanHeader: import("react").ForwardRefExoticComponent>;
/** Surface variant union re-exported for downstream typing. */
export type CarePlanHeaderSurface = NonNullable['surface']>;
//# sourceMappingURL=care-plan-header.d.ts.map