@instructure/ui-spinner 8.45.1-snapshot-3 → 8.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -2
- package/es/Spinner/__new-tests__/Spinner.test.js +46 -0
- package/es/Spinner/index.js +19 -1
- package/es/Spinner/props.js +2 -1
- package/lib/Spinner/__new-tests__/Spinner.test.js +49 -0
- package/lib/Spinner/index.js +19 -1
- package/lib/Spinner/props.js +2 -1
- package/package.json +16 -14
- package/src/Spinner/README.md +17 -1
- package/src/Spinner/__new-tests__/Spinner.test.tsx +52 -0
- package/src/Spinner/index.tsx +23 -3
- package/src/Spinner/props.ts +23 -10
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Spinner/__new-tests__/Spinner.test.d.ts +2 -0
- package/types/Spinner/__new-tests__/Spinner.test.d.ts.map +1 -0
- package/types/Spinner/index.d.ts +16 -11
- package/types/Spinner/index.d.ts.map +1 -1
- package/types/Spinner/props.d.ts +20 -10
- package/types/Spinner/props.d.ts.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.test.d.ts","sourceRoot":"","sources":["../../../src/Spinner/__new-tests__/Spinner.test.tsx"],"names":[],"mappings":"AA0BA,OAAO,yCAAyC,CAAA"}
|
package/types/Spinner/index.d.ts
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import { jsx } from '@instructure/emotion';
|
|
4
|
-
import type { SpinnerProps } from './props';
|
|
4
|
+
import type { SpinnerProps, SpinnerState } from './props';
|
|
5
5
|
/**
|
|
6
6
|
---
|
|
7
7
|
category: components
|
|
8
8
|
---
|
|
9
9
|
@tsProps
|
|
10
10
|
**/
|
|
11
|
-
declare class Spinner extends Component<SpinnerProps> {
|
|
11
|
+
declare class Spinner extends Component<SpinnerProps, SpinnerState> {
|
|
12
12
|
static readonly componentId = "Spinner";
|
|
13
13
|
static allowedProps: readonly (keyof {
|
|
14
|
+
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
15
|
+
delay?: number | undefined;
|
|
16
|
+
elementRef?: ((element: Element | null) => void) | undefined;
|
|
17
|
+
margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
14
18
|
renderTitle?: import("@instructure/shared-types").Renderable;
|
|
15
|
-
size?: "small" | "
|
|
19
|
+
size?: "small" | "medium" | "large" | "x-small" | undefined;
|
|
16
20
|
variant?: "default" | "inverse" | undefined;
|
|
17
|
-
margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
18
|
-
elementRef?: ((element: Element | null) => void) | undefined;
|
|
19
|
-
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
20
21
|
})[];
|
|
21
22
|
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
23
|
+
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
24
|
+
delay?: number | undefined;
|
|
25
|
+
elementRef?: ((element: Element | null) => void) | undefined;
|
|
26
|
+
margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
22
27
|
renderTitle?: import("@instructure/shared-types").Renderable;
|
|
23
|
-
size?: "small" | "
|
|
28
|
+
size?: "small" | "medium" | "large" | "x-small" | undefined;
|
|
24
29
|
variant?: "default" | "inverse" | undefined;
|
|
25
|
-
margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
|
|
26
|
-
elementRef?: ((element: Element | null) => void) | undefined;
|
|
27
|
-
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
28
30
|
}>;
|
|
29
31
|
static defaultProps: {
|
|
30
32
|
as: string;
|
|
@@ -33,12 +35,15 @@ declare class Spinner extends Component<SpinnerProps> {
|
|
|
33
35
|
};
|
|
34
36
|
ref: Element | null;
|
|
35
37
|
private readonly titleId?;
|
|
38
|
+
private delayTimeout?;
|
|
36
39
|
handleRef: (el: Element | null) => void;
|
|
37
40
|
constructor(props: SpinnerProps);
|
|
38
41
|
componentDidMount(): void;
|
|
39
42
|
componentDidUpdate(): void;
|
|
43
|
+
componentWillUnmount(): void;
|
|
40
44
|
radius(): "0.5em" | "1em" | "2.25em" | "1.75em";
|
|
41
|
-
|
|
45
|
+
renderSpinner(): jsx.JSX.Element;
|
|
46
|
+
render(): jsx.JSX.Element | null;
|
|
42
47
|
}
|
|
43
48
|
export default Spinner;
|
|
44
49
|
export { Spinner };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Spinner/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Spinner/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAGzD;;;;;GAKG;AACH,cAGM,OAAQ,SAAQ,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IACzD,MAAM,CAAC,QAAQ,CAAC,WAAW,aAAY;IACvC,MAAM,CAAC,YAAY;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;MAIlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAQ;IACjC,OAAO,CAAC,YAAY,CAAC,CAAgB;IAErC,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;gBAEW,KAAK,EAAE,YAAY;IAU/B,iBAAiB;IAWjB,kBAAkB;IAIlB,oBAAoB;IAIpB,MAAM;IAaN,aAAa;IAkDb,MAAM;CAGP;AAED,eAAe,OAAO,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
package/types/Spinner/props.d.ts
CHANGED
|
@@ -4,17 +4,17 @@ import type { WithDeterministicIdProps } from '@instructure/ui-react-utils';
|
|
|
4
4
|
import { Renderable } from '@instructure/shared-types';
|
|
5
5
|
type SpinnerOwnProps = {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Render Spinner "as" another HTML element
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
as?: AsElementType;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* delay spinner rendering for a time (in ms). Used to prevent flickering in case of very fast load times
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
delay?: number;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* provides a reference to the underlying html root element
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
elementRef?: (element: Element | null) => void;
|
|
18
18
|
/**
|
|
19
19
|
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
20
20
|
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
@@ -22,17 +22,27 @@ type SpinnerOwnProps = {
|
|
|
22
22
|
*/
|
|
23
23
|
margin?: Spacing;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Give the spinner a title to be read by screenreaders
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
renderTitle?: Renderable;
|
|
28
|
+
/**
|
|
29
|
+
* Different-sized spinners
|
|
30
|
+
*/
|
|
31
|
+
size?: 'x-small' | 'small' | 'medium' | 'large';
|
|
32
|
+
/**
|
|
33
|
+
* Different color schemes for use with light or dark backgrounds
|
|
34
|
+
*/
|
|
35
|
+
variant?: 'default' | 'inverse';
|
|
29
36
|
};
|
|
30
37
|
type PropKeys = keyof SpinnerOwnProps;
|
|
31
38
|
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
32
39
|
type SpinnerProps = SpinnerOwnProps & WithStyleProps<SpinnerTheme, SpinnerStyle> & OtherHTMLAttributes<SpinnerOwnProps> & WithDeterministicIdProps;
|
|
40
|
+
type SpinnerState = {
|
|
41
|
+
shouldRender: boolean;
|
|
42
|
+
};
|
|
33
43
|
type SpinnerStyle = ComponentStyle<'spinner' | 'circle' | 'circleTrack' | 'circleSpin'>;
|
|
34
44
|
declare const propTypes: PropValidators<PropKeys>;
|
|
35
45
|
declare const allowedProps: AllowedPropKeys;
|
|
36
|
-
export type { SpinnerProps, SpinnerStyle };
|
|
46
|
+
export type { SpinnerProps, SpinnerState, SpinnerStyle };
|
|
37
47
|
export { propTypes, allowedProps };
|
|
38
48
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Spinner/props.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,YAAY,EACb,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAEtD,KAAK,eAAe,GAAG;IACrB;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Spinner/props.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MA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