import type { ReactNode } from 'react';
import type { TFunction } from 'i18next';
import type { OpenAnamnesisNote, Visit } from './anamnesis-types';
import type { VisitColumn } from './anamnesis-window';
/** Static class literals — Tailwind has to see every arbitrary value at build
* time, and a class built by interpolation emits no CSS at all. */
/** Floored at the longest parameter label + its unit and reference range on
* ONE line — measured across en / ar / ja under `.theme-accessible`, whose
* larger type is the widest case (ja "HDLコレステロール", 147px + 16px of cell
* padding). Below that the label wraps and the cell goes to three lines. */
export declare const MATRIX_IDENTITY_CLASS = "ds:min-w-[11rem]";
/** Floored by the editable cell, not by the number it shows: `NumberInput`
* spends 56px on its two spinners and 16px on input padding before a digit is
* drawn, so 128px of column is 40px of readable value. It cannot go lower. */
export declare const MATRIX_VISIT_COLUMN_CLASS = "ds:min-w-[8rem]";
/**
* A PERCENTAGE, not a rem cap — that is what redirects the spare pixels.
*
* Under `table-layout: auto` the spare width of a table narrower than its
* container goes to whichever columns declare no width, and `max-width` on a
* table cell is only honoured while some other column is left to absorb. The
* old `w-[9rem] max-w-[10rem]` therefore pinned the trend at 160px and handed
* everything else to the identity and value columns — 325px and 443px of
* mostly whitespace at 1440px wide. Claiming a share instead inverts that.
* When the table DOES overflow, the percentage stops applying and the
* min-width is what the trend gets.
*/
export declare const MATRIX_TREND_COLUMN_CLASS = "ds:w-[40%] ds:min-w-[14rem]";
/** Apply to every `
` a surface hands to `trailing`, so the column sticks
* as one piece rather than only in its header. */
export declare const MATRIX_TRAILING_CELL_CLASS = "ds:sticky ds:end-0 ds:z-[1] ds:bg-[color:var(--card)] ds:shadow-[var(--shadow-chrome-start)]";
/** Every body cell in a value column. Exported so both surfaces open from the
* same padding / alignment rather than each picking its own. */
export declare const MATRIX_CELL_CLASS = "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:align-top";
export interface MatrixVisitHeaderProps {
column: VisitColumn;
t: TFunction;
/** Muted fill — the column is one of the compared pair/set. */
emphasised?: boolean;
/** Adds the "Editable" chip; compile mode's newest column only. */
editable?: boolean;
/** Render this visit's note popover already open (demo hook). */
defaultOpenNoteVisitId?: string;
/** Offer the note affordance. The compare panel sets this `false`: its
* columns repeat the grid's, and two note triggers with the same accessible
* name on one screen is a control the reader has to disambiguate. */
withNote?: boolean;
/** Route the note to the host's side panel instead of opening it in place. */
onOpenNote?: OpenAnamnesisNote;
/** The first visits this column merges, oldest first. Set only on the
* synthetic baseline column: the header then lists them instead of one
* date, and offers no note trigger (there is no single visit to open). */
mergedFrom?: readonly Visit[];
}
/** One visit's ` | `, identical wherever the visit is a column. */
export declare function MatrixVisitHeader({ column, t, emphasised, editable, defaultOpenNoteVisitId, withNote, onOpenNote, mergedFrom, }: MatrixVisitHeaderProps): import("react/jsx-runtime").JSX.Element;
export interface MatrixRowSpec {
key: string;
/** Full-width group banner. When set, every other field is ignored. */
banner?: string;
/** The row's ` | ` element. */
header?: ReactNode;
/** One ` | ` per visit column, in column order. */
cells?: readonly ReactNode[];
/** The ` | ` under the trend column. */
trend?: ReactNode;
/** The ` | ` under the trailing column, where the table declares one. */
trailing?: ReactNode;
}
export interface AnamnesisMatrixProps {
captionId: string;
/** Screen-reader caption naming what the table holds. */
caption: string;
/** Header of the sticky identity column. */
identityLabel: string;
/** Header of the trend column. */
trendLabel: string;
/** Test hook on the trend header. Only one matrix on screen may claim it,
* so the grid takes it and the compare panel below goes without. */
trendTestId?: string;
/** One ` | ` per visit column — build them with
* `MatrixVisitHeader` so the two surfaces cannot disagree. */
visitHeaders: readonly ReactNode[];
/** Header of a column rendered after every visit. Omitted = no such column. */
trailingLabel?: string;
/** Test hook on the trailing header — the surface names it, not the shell. */
trailingTestId?: string;
rows: readonly MatrixRowSpec[];
/** Draw the outer border + surface. `false` inside a card, to avoid a
* box-in-a-box. */
framed?: boolean;
testId?: string;
}
export declare function AnamnesisMatrix({ captionId, caption, identityLabel, trendLabel, trendTestId, visitHeaders, trailingLabel, trailingTestId, rows, framed, testId, }: AnamnesisMatrixProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=anamnesis-matrix.d.ts.map |