import { type ComponentType } from 'react'; import type { MenuEntry } from './MenuEntries.js'; type Target = { href: string; external?: boolean | undefined; /** Loads the page instead of routing, for paths the host's router doesn't serve. */ reloadDocument?: boolean | undefined; onClick?: never; menu?: never; } | { onClick: () => void; href?: never; external?: never; reloadDocument?: never; menu?: never; } | { menu: MenuEntry[]; href?: never; external?: never; reloadDocument?: never; onClick?: never; }; export type PageHeaderActionProps = Target & { icon: ComponentType<{ className?: string; }>; /** The visible text, or with `iconOnly` the name its tooltip shows. */ label: string; /** A fuller name for assistive technology than the visible label, such as * "Save organization flags" for "Save". */ ariaLabel?: string | undefined; /** The icon alone, named by its tooltip, such as an edit pencil beside the title. */ iconOnly?: boolean | undefined; disabled?: boolean | undefined; disabledReason?: string | undefined; /** A hint shown on hover and focus while it can be pressed. */ tooltip?: string | undefined; /** How a labeled action reads in the bar: `outline`, the page's small * secondary button, as "+ Add" is; or `link`, text in the link color, for a * page that keeps the older look. On a narrow bar the label folds into the * tooltip and the outline stays, so the action is an outlined icon. An * `iconOnly` action, such as a pencil beside the title, is always bare. */ variant?: 'outline' | 'link' | undefined; /** For an action that removes or breaks something: in the error color where * it is a menu entry, in the header's "…" menu. In the bar it reads as the * others do; a page's destructive actions belong in its menu. */ destructive?: boolean | undefined; /** A toggle's state, such as a favorite: set, it reads as pressed. Buttons only. */ pressed?: boolean | undefined; /** Busy with what it started, such as a run starting: a spinner takes the * icon's place, and it keeps focus but can't be pressed again until done. */ loading?: boolean | undefined; }; /** * An action in the page header: a link (`href`, `external` for a new tab, * `reloadDocument` for a path the router doesn't serve), a * button (`onClick`) or a menu (`menu`). A labeled action is a small outline * button, as "+ Add" is, so the page's commands stand apart from the trail. */ export declare function PageHeaderAction({ icon: Icon, label, ariaLabel, iconOnly, variant, disabled, disabledReason, tooltip, destructive, pressed, loading, ...target }: PageHeaderActionProps): import("react").JSX.Element; export type PageHeaderAddButtonProps = Target & { /** The full action, such as "New cluster": the tooltip and accessible name. */ label: string; /** The visible verb. */ word?: 'add' | 'create' | undefined; disabled?: boolean | undefined; disabledReason?: string | undefined; /** Busy making it: a spinner takes the plus's place, and it can't be pressed again until done. */ loading?: boolean | undefined; }; /** The page's "+ Add" or "+ Create": with `menu`, a chooser of what to make. */ export declare function PageHeaderAddButton({ label, word, disabled, disabledReason, loading, ...target }: PageHeaderAddButtonProps): import("react").JSX.Element; /** The "…" menu of actions on the page's subject. Renders nothing without items. */ export declare function PageHeaderMenu({ items, label, }: { items: MenuEntry[]; /** Defaults to the strings' "Actions". */ label?: string | undefined; }): import("react").JSX.Element | null; export {};