1 | import * as React from "react";
|
2 | import { AbstractPureComponent2 } from "../../common";
|
3 | import { IntentProps, Props } from "../../common/props";
|
4 | export declare enum SpinnerSize {
|
5 | SMALL = 20,
|
6 | STANDARD = 50,
|
7 | LARGE = 100
|
8 | }
|
9 | export declare type SpinnerProps = ISpinnerProps;
|
10 | /** @deprecated use SpinnerProps */
|
11 | export interface ISpinnerProps extends Props, IntentProps {
|
12 | /**
|
13 | * Width and height of the spinner in pixels. The size cannot be less than
|
14 | * 10px.
|
15 | *
|
16 | * Constants are available for common sizes:
|
17 | * - `SpinnerSize.SMALL = 20px`
|
18 | * - `SpinnerSize.STANDARD = 50px`
|
19 | * - `SpinnerSize.LARGE = 100px`
|
20 | *
|
21 | * @default SpinnerSize.STANDARD = 50
|
22 | */
|
23 | size?: number;
|
24 | /**
|
25 | * HTML tag for the two wrapper elements. If rendering a `<Spinner>` inside
|
26 | * an `<svg>`, change this to an SVG element like `"g"`.
|
27 | *
|
28 | * @default "div"
|
29 | */
|
30 | tagName?: keyof JSX.IntrinsicElements;
|
31 | /**
|
32 | * A value between 0 and 1 (inclusive) representing how far along the operation is.
|
33 | * Values below 0 or above 1 will be interpreted as 0 or 1 respectively.
|
34 | * Omitting this prop will result in an "indeterminate" spinner where the head spins indefinitely.
|
35 | */
|
36 | value?: number;
|
37 | }
|
38 | export declare class Spinner extends AbstractPureComponent2<SpinnerProps> {
|
39 | static displayName: string;
|
40 | componentDidUpdate(prevProps: SpinnerProps): void;
|
41 | render(): React.ReactElement<{
|
42 | className: string;
|
43 | role: string;
|
44 | }, string | React.JSXElementConstructor<any>>;
|
45 | protected validateProps({ className, size }: SpinnerProps): void;
|
46 | /**
|
47 | * Resolve size to a pixel value.
|
48 | * Size can be set by className, props, default, or minimum constant.
|
49 | */
|
50 | private getSize;
|
51 | /** Compute viewbox such that stroked track sits exactly at edge of image frame. */
|
52 | private getViewBox;
|
53 | }
|