import "./region_state.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type IconName } from "./icon"; import { type StyleProps } from "./style_props"; interface RegionStateBase extends StyleProps { testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } interface LoadingRegion extends RegionStateBase { state: "loading"; } interface EmptyBase extends RegionStateBase { state: "empty"; message: string; detail?: string; /** Where the filling content lives elsewhere — a press, not an `href`, since apps run in a frame without * `allow-popups`. */ link?: { label: string; onPress: () => void; }; } interface EmptyRegion extends EmptyBase { compact?: false; icon?: IconName; /** The one act, region-wide only: a band's add rides its heading ({@link EmptyBand}), while an empty * register has no such row, so this carries its New. */ action?: React.ReactNode; } /** One band's empty, not the region's. No glyph: lucide's 20/24 fill has no size both legible and aligned * beside `sm` text. Its act rides the same line — omitted where the heading carries the add, but a band * that is the surface has nowhere else for it. */ interface EmptyBand extends EmptyBase { compact: true; icon?: never; action?: React.ReactNode; } interface ErrorRegion extends RegionStateBase { state: "error"; message: string; /** The known cause — never a stack trace or bare code. */ detail?: string; /** Omit where retry is pointless (denied, not found); the pack words the button. */ onRetry?: () => void; } interface DoneRegion extends RegionStateBase { state: "done"; message: string; detail?: string; /** Defaults to a success check. */ icon?: IconName; /** What-next `Button`s, centred below. */ children?: React.ReactNode; } export type RegionStateProps = LoadingRegion | EmptyRegion | EmptyBand | ErrorRegion | DoneRegion; /** What a region has instead of content, by what it can assert: `loading`, `error`, `empty` (found nothing * — a retry returns the same), `done`. A band's empty has no verb; the region-wide one takes one * (`action`). Prefer `Skeleton` when the arriving shape is known, and `Callout tone="error"` for a * failure beside working content. */ export declare function RegionState(props: RegionStateProps): React.ReactElement>; export {};