import type { RowAction } from './rowMenu.js'; /** A toolbar button, which moves into the `…` menu as a row when the toolbar runs out of room. */ export type ToolbarAction = RowAction & { /** A hint on the enabled button. */ tooltip?: string | undefined; /** The one action the view leads to, filled in the accent. Give it to one * action at most: the rest are outlined, so it stands out. */ primary?: boolean | undefined; hidden?: boolean; /** Busy with what it started, such as a refresh: a spinner takes the icon's * place, and it keeps focus but can't be pressed again until done, in the * toolbar or as a row of its `…` menu. */ loading?: boolean | undefined; }; /** A pre-rendered element (e.g. a button component that owns its modal). */ interface ToolbarElement { key: string; element: React.ReactNode; hidden?: boolean; } export type ToolbarItem = ToolbarAction | ToolbarElement; /** A toolbar action as a button: a link with `href`, a toggle with `checked`. * In an ActionToolbar it is one of its items, reached with the arrow keys. */ export declare function ToolbarButton({ action }: { action: ToolbarAction; }): import("react").JSX.Element; /** How the toolbar fits its row: the items whose labels fold to their icons, * and those moved into the `…` menu, by key. */ export interface ToolbarFit { folded: readonly string[]; overflow: readonly string[]; } /** An item's widths with its label and folded to its icon. */ export interface ItemWidth { key: string; full: number; folded: number; primary: boolean; } /** * Fits a toolbar to `available` pixels one item at a time, stopping as soon as * it fits, so it keeps every label the width allows. Items go lowest priority * first: the right-hand ones, then the last group's, and so on, each from the * end. First their labels fold to their icons, one by one; then, all folded, * they move into the `…` menu in the same order; the primary action never * moves, and its label folds only once nothing else is left to try. */ export declare function fitToolbar(groups: ItemWidth[][], right: ItemWidth[], available: number): ToolbarFit; /** A view's controls in one WAI-ARIA toolbar: a single tab stop, with the arrow * keys moving between its items, the `…` menu and disabled ones included, so * their reasons stay reachable. Action groups sit on the left and `right` holds * secondary actions at the end. It stays one row: when it runs out of room * labels fold to their icons one at a time, then actions move into a `…` menu, * the right-hand ones first and the primary action never. Give each action its * own icon, since a folded one is known by it, and mark the one action the * view leads to `primary`. */ export declare function ActionToolbar({ groups, right, sticky, label, }: { groups: ToolbarItem[][]; right?: ToolbarItem[]; /** Pins it as the page scrolls, just below whatever the page's scroller * already pins at the top, such as the page header. */ sticky?: boolean; /** Names the toolbar for assistive technology, such as "Log controls"; * defaults to "Actions". */ label?: string | undefined; }): import("react").JSX.Element; export {};