import { type HTMLAttributes, type ReactNode } from 'react';
import { type VariantProps } from 'class-variance-authority';
import { type PatientField, type PatientFieldEditType, type PatientFieldEditValue, type PatientFieldOption, type PatientFieldSection } from '../_shared/patient-fields';
declare const rootVariants: (props?: ({
density?: "comfortable" | "compact" | null | undefined;
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
export type { PatientField, PatientFieldSection, PatientFieldOption, PatientFieldEditType, PatientFieldEditValue, } from '../_shared/patient-fields';
/** A label→value patient field. Alias of the shared {@link PatientField}. */
export type PatientDetailsField = PatientField;
/** A labelled, collapsible group of fields. Alias of {@link PatientFieldSection}. */
export type PatientDetailsSection = PatientFieldSection;
/** Alias of the shared {@link PatientFieldOption}. */
export type PatientDetailsFieldOption = PatientFieldOption;
/** Alias of the shared {@link PatientFieldEditType}. */
export type PatientDetailsEditType = PatientFieldEditType;
/** Alias of the shared {@link PatientFieldEditValue}. */
export type PatientDetailsEditValue = PatientFieldEditValue;
/**
* Imperative handle the agent adapter drives. Exposes only field KEYS and
* an opaque `patientId` for reads; `updateField` routes writes through the
* same `onFieldSave` path as a human inline edit (no second channel).
*/
export interface PatientDetailsHandle {
/** The current ordered list of visible field ids. */
getVisibleFieldOrder: () => string[];
/** Opaque patient id (no PHI). */
getPatientId: () => string | undefined;
/** Replace the visible set, preserving the given order (filtered to known fields). */
setVisibleFields: (fieldIds: string[]) => void;
/** Replace the full ordered visible list (filtered to known fields). */
setFieldOrder: (orderedIds: string[]) => void;
/** Write a field value — delegates to `onFieldSave`. Rejects if no handler. */
updateField: (fieldId: string, value: unknown) => Promise;
}
export interface PatientDetailsProps extends Omit, 'title' | 'children'> {
/** Patient display name — the panel heading. */
title: ReactNode;
/** The sectioned field catalogue (consumer-mapped from DoctorPatient). */
sections: PatientDetailsSection[];
/**
* Header avatar photo / initials override. The panel always fronts the name
* with an Avatar — initials derive from a string `title` by default; pass
* `src` for a photo, or `name` to override the initials source.
*/
avatar?: {
src?: string;
name?: string;
};
/** At-a-glance chips under the name (consumer-composed Badge/Tag/Chip row). */
headerChips?: ReactNode;
/**
* Frame the identity header and each section in its own elevated `Card`,
* for a "control-room" rail that reads as a stack of cards rather than one
* flat panel. Default `false` (the flat panel with a header rule + eyebrow
* section headings). When framed, the header rule is dropped — the cards
* provide the separation.
*/
framed?: boolean;
/** Master switch — show edit affordances on `editable` fields. */
editable?: boolean;
/**
* Persist a field edit. Resolve ⇒ committed; reject(Error) ⇒ the message
* is shown inline and the row stays in edit mode. Also the single channel
* the agent's `update_field` uses.
*/
onFieldSave?: (fieldId: string, value: unknown) => Promise;
/** Domain validation — return an error message, or `null` when valid. */
validate?: (fieldId: string, value: unknown) => string | null;
/**
* Controlled ordered list of visible field ids. `undefined` ⇒ every field
* visible; an explicit `[]` ⇒ none (a panel that starts collapsed).
*/
visibleFieldOrder?: string[];
/** Uncontrolled initial order. Omit both ⇒ every field visible, in declaration order. */
defaultVisibleFieldOrder?: string[];
/** Fired whenever the user shows/hides/reorders fields via the cog. */
onVisibleFieldsChange?: (orderedIds: string[]) => void;
/** Render the loading skeleton. */
loading?: boolean;
/** Shown when there are no sections / no patient. Defaults to a localised hint. */
emptyState?: ReactNode;
/** Opaque patient id — emitted as `data-patient-id` + agent stateRead. No PHI. */
patientId?: string;
/** Agent-readiness instance id, surfaced as `data-component-id`. */
id?: string;
/** BCP-47 locale override (currency / number editors). */
locale?: string;
/** Override the cog trigger's accessible name. */
cogLabel?: string;
/**
* Visible panel-chrome heading (the sticky PanelHeader title). Defaults
* to the kit's localised "Patient details". Pass an app-translated
* string when the panel fronts a different record built from the same
* chrome — "Appointment details", "Task details" — so the header names
* what is actually shown. Also the `aria-label` fallback.
*/
panelTitle?: string;
/** Override the panel region's accessible name (defaults to the heading). */
'aria-label'?: string;
}
export declare const PatientDetails: import("react").ForwardRefExoticComponent>;
/** Density variant union re-exported for downstream typing. */
export type PatientDetailsDensity = NonNullable['density']>;
//# sourceMappingURL=patient-details.d.ts.map