import "./activity_indicator.css"; import type * as React from "react"; import { Progress as Base } from "@base-ui/react/progress"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; import { type InkColor } from "./text_ink"; interface ActivityIndicatorBase extends StyleProps { /** The mark's ink ROLE. Left out, it takes the default ink. */ color?: InkColor; /** * The mark's OWN measure in px — the ring's outer diameter (default 24), or * one dot's (default 8). Each variant's default is its own, because a ring and * a dot are not the same thing measured two ways. */ size?: number; testID?: string; ref?: React.Ref; } /** The RING, which announces. */ interface ActivityIndicatorSpinnerProps extends ActivityIndicatorBase { variant?: "spinner"; /** The ring is a Base UI `Progress`, so its render prop is that part's — the * rhythm is a bare element and takes the plain one. */ render?: Base.Root.Props["render"]; /** What is running, where the spinner is the ONLY thing saying so. `progressbar` * is name-required, and a bare ring announces as one either way — so a spinner * standing alone in a region takes a name, and one inside a control that already * reports busy (a `Button`'s) takes none. */ accessibilityLabel?: string; /** What the ring announces INSTEAD of a figure, since it has none ("Working…"). * Defaults to the locale pack's wording. */ valueLabel?: string; } /** The three-dot rhythm, DECORATIVE and out of the accessibility tree. */ interface ActivityIndicatorDotsProps extends ActivityIndicatorBase { variant: "dots"; accessibilityLabel?: never; valueLabel?: never; render?: useRender.RenderProp; } export type ActivityIndicatorProps = ActivityIndicatorSpinnerProps | ActivityIndicatorDotsProps; /** * WORK IN FLIGHT, with no known duration. Determinate work is a `Progress`; a * whole region in flight is a `RegionState` or a `Skeleton`. * * `spinner` (the default) is the ring that ANNOUNCES: a Base UI `Progress` with * no `value`, which is what "still running" spells in ARIA — the role, the * bounds and the absent `aria-valuenow` all come from the part rather than from * three attributes written by hand. That role is name-required, so a spinner * standing alone in a region takes an `accessibilityLabel`; one inside a control * that already reports busy does not. Base UI's own stand-in for the missing * figure is the English string "indeterminate progress", which a localized app * would ship untranslated, so the wording comes from the locale pack. * * `dots` is the bare three-dot rhythm — the "working / thinking / typing" pulse * beside a caption that already says what is happening. DECORATIVE, and out of * the accessibility tree: a bare rhythm announces nothing on its own, and the * thing that owns it is what speaks. */ export declare function ActivityIndicator(props: ActivityIndicatorProps): React.JSX.Element; export {};