import type { MouseEvent as ReactMouseEvent, ReactNode } from 'react'; import type { OpenMenu } from '../components/ContextMenu.js'; import { type MenuEntry } from '../components/MenuEntries.js'; import type { ListView, ListViewChrome } from './listView.js'; import { type RowAction } from './rowMenu.js'; export declare function ListRowActionsProvider({ view, children, }: { view?: ListViewChrome | undefined; children: ReactNode; }): import("react").JSX.Element; export interface ListPageProps { /** Reaches past the host's content padding (`p-4`) to the container's * edges, for a host whose page container is padded. A list runs edge to * edge so its rows' hover and dividers span the page. */ bleed?: boolean | undefined; /** The list's search, filters and view controls, above the rows, such as a * `ListToolbar`. The page's trail and actions, "+ Add" among them, go in * its `PageHeader`. With `total`, it hides while the list is empty. Once * the page shows the count under its rows, the toolbar sits at the end of * the filter chips' first line, or takes the line alone while no chip * shows. */ toolbar?: ReactNode; /** Under the toolbar: the chips of the list's active filters. By default the view's own * `ListFilterBar`, shown while a filter is on; pass one to add a trailing slot, such as Save * view, or `null` to leave it out. */ filterBar?: ReactNode; /** Omit on pages without a list view — rows show all actions by default. */ view?: ListViewChrome | undefined; /** Still loading: a sketch of rows in place of the list. */ loading?: boolean | undefined; /** Why the list couldn't load. Shown only while there is nothing to show * from before, so a failed refresh keeps the rows on screen. */ error?: unknown; /** What failed to load, as the error names it: "Couldn't load clusters". */ errorNoun?: string | undefined; /** How many rows there are before any search or filter. Given, the page * picks its body: the rows, `empty` while there are none, and `noMatches` * while a search or filter leaves none. */ total?: number | undefined; /** How many rows the search and filters leave; `total` by default. */ matches?: number | undefined; /** What shows while there is nothing in the list yet. */ empty?: ListPageEmpty | undefined; /** What shows while a search or filter leaves nothing, such as "No clusters * match". */ noMatches?: ReactNode; /** Keeps the toolbar while the list is empty, for one whose controls still * matter then, such as a filter set by default that hides everything. */ toolbarWhenEmpty?: boolean | undefined; /** Names what the list counts. With `total` (and `matches`), the page * shows the count under its last row: "7 tokens", or "2 of 7 tokens" * while a search or filter narrows the list. It shows only while there * are rows: the empty and no-matches states say enough. A `ListToolbar`'s * own `count` shows there too. */ count?: ListPageCount | undefined; /** Under the last row, on the count's line: a `Pagination`, or a "Load * more" button. */ pager?: ReactNode; children: ReactNode; } /** What a list's count calls its rows. */ export interface ListPageCount { noun: string; nounPlural: string; /** Whether a search or filter narrows the list, so the count reads "2 of * 7". By default, whether the view's filters are on or `matches` differs * from `total`; pass it for a search the page holds. */ filterActive?: boolean | undefined; } /** A list's empty state: what is missing, and what to do about it. */ export interface ListPageEmpty { /** A glyph for what the list holds, drawn faded above the title. */ icon?: ReactNode; title: ReactNode; description?: ReactNode; /** Such as a link to the docs; the page's "+ Add" stays in its header. */ action?: ReactNode; } /** A list filling the page: its toolbar stays put while only the rows scroll. * Given `total`, it also shows the list's states in one shared look: a * sketch while loading, the error when loading failed, the empty state with * the toolbar hidden, the no-matches state, or the rows. */ export declare function ListPage({ bleed, toolbar, filterBar, view, loading, error, errorNoun, total, matches, empty, noMatches, toolbarWhenEmpty, count, pager, children, }: ListPageProps): import("react").JSX.Element; export declare function ListRow({ href, onActivate, items, goTo, openMenu, pinnedActions, selected, selectionActive, onRowSelect, leading, className, children, }: { /** Where the row goes. Its `NameCell` with the same href is the row's link, * and a click on the rest of the row goes there too, in a new tab with a * middle or modified click, unless it ends selecting text in the row. */ href: string | null; /** Plain-click handler for rows that open something in place instead of navigating. */ onActivate?: (() => void) | undefined; items: MenuEntry[]; goTo: (to: string) => void; openMenu: OpenMenu; /** Actions shown as buttons on the row, beside the menu. */ pinnedActions?: RowAction[] | undefined; className?: string; /** Tints the whole row to mark it as part of a multi-selection. */ selected?: boolean; /** When multi-selection is active, plain row click toggles selection instead of navigating. */ selectionActive?: boolean; onRowSelect?: ((e: ReactMouseEvent) => void) | undefined; /** Non-column cell rendered before the column cells; kept out of `children` so they stay aligned with `columns`. */ leading?: ReactNode; children: ReactNode; }): import("react").JSX.Element; export interface ListGroupProps { /** The group's header: a `GroupRow`, or a component of the host's that renders one. Its * row holds the toggle. */ header: ReactNode; /** Names the group to the list's view, which remembers it collapsed or expanded under its * `storageKey` and counts it in Collapse all and Expand all. Unique among the list's groups. */ groupKey?: string | undefined; /** Collapsed, held by the host; with it, the view neither remembers nor collapses the group. */ collapsed?: boolean | undefined; /** Collapsed until the reader opens it, the first time the group shows. */ defaultCollapsed?: boolean | undefined; onCollapsedChange?: ((collapsed: boolean) => void) | undefined; /** The group's rows. */ children?: ReactNode; } /** * A group of a list's rows under a header that collapses them: a click on the header, other * than on a link or button in it, or the chevron's button, which Tab reaches, folds the rows * away and brings them back. A collapsed group's header still shows its count, and the list * still counts its rows. * * It renders ``s of its own, so it goes straight among a `Table`'s children, as * `groups.map((g) => …)`, not inside a fragment. */ export declare function ListGroup({ header, groupKey, collapsed, defaultCollapsed, onCollapsedChange, children, }: ListGroupProps): import("react").JSX.Element; export declare namespace ListGroup { var isTableSection: boolean; } /** * A group's header row in a list: its label, such as a status or a cluster, * and, against the row's far end, what sums it up, such as "2/3 running". * * Inside a `ListPage` with a view, it has one cell per column, each hiding * with its column as the list narrows, so a group never holds a hidden * column's width open; its content lays out across the row's visible width * from the first cell. Elsewhere it is one cell spanning `colSpan` columns. */ export declare function GroupRow({ label, detail, count, trailing, children, leading, colSpan, className, }: { /** The group's name: text, or an icon, a name with its tooltip, badges. */ label?: ReactNode; /** A secondary detail after the label, such as an ID, that gives way first: it shows only * where the list is at least 36rem wide, and truncates before the label does. */ detail?: ReactNode; /** How many rows the group holds, shown after the label. */ count?: number | undefined; /** Set against the row's far end, such as "2/3 running". */ trailing?: ReactNode; /** The whole header, laid out in a row, in place of `label`, `count` and `trailing`. */ children?: ReactNode; /** Cells the list's rows have before its columns, such as a selection checkbox. */ leading?: number | undefined; /** Outside a list view, the columns the row spans. */ colSpan?: number | undefined; className?: string | undefined; }): import("react").JSX.Element; /** Name column min-width is by role, not position, so a leading checkbox * doesn't shift it. A column with an `orderBy` the view offers sorts by it. * While the view's column headers are off, the header row collapses: its * cells still size the columns, but nobody sees or hears them, as with any * other display option that is off. */ export declare function ListColumns({ view }: { view: ListView; }): import("react").JSX.Element; export declare namespace ListColumns { var isTableHeader: boolean; } /** Stable `goTo` for whole-row navigation (`rowNavProps`, `ListRow`). */ export declare function useListNavigate(): (to: string) => void;