{children}
);
}
export function PageHeader({
icon,
title,
subtitle,
subtitleClassName,
subtitleTone = "tertiary",
actions,
dense = false,
titleTrailing,
uiId,
}: {
icon?: ReactNode;
title: ReactNode;
subtitle?: ReactNode;
subtitleClassName?: string;
subtitleTone?: "secondary" | "tertiary";
actions?: ReactNode;
/**
* Compact header bar: smaller bar height and a smaller heading, for a screen
* whose own controls (not a description) say what is being shown. A subtitle
* still fits — it sits directly under the heading and keeps the bar to two
* short lines.
*/
dense?: boolean;
/** Controls that belong to the heading itself, split off by a vertical rule (dense only). */
titleTrailing?: ReactNode;
uiId?: string;
}): React.JSX.Element {
const heading = (
{icon}
);
if (dense) {
return (
{title}
{/* `gap-1.5`: the subtitle of a dense header is a chip, not a text line —
without air between the two it reads as part of the heading. */}
{actions ?
);
}
return (
{heading}
{titleTrailing ? (
<>
{titleTrailing}
>
) : null}
{subtitle ? (
{subtitle}
) : null}{actions}
: null}
{heading}
{subtitle ? (
{actions ? {subtitle}
) : null}{actions}
: null}
{children}
);
}
/** Canonical back navigation for subpages: tertiary button with a left arrow, placed at the top of PageBody. */
export function PageBackLink({ to, label, uiId }: { to: string; label: ReactNode; uiId?: string }): React.JSX.Element {
return (
}>
{label}
);
}
/**
* Description line for a screen that renders inside a settings hub (AK-SET-01).
*
* A hub already owns the page's single and its tab bar names the section, * so an embedded screen must not render a second PageHeader. Its description is * still worth keeping — this is where it goes. */ export function PageIntro({ children, uiId }: { children: ReactNode; uiId?: string }): React.JSX.Element { return (
{children}
); } /** Content area below the header bar: 24px page padding (16px on mobile, matching the header edge). */ export function PageBody({ className, uiId, children, }: { className?: string; uiId?: string; children: ReactNode; }): React.JSX.Element { return (
{children}
);
}