@fluentui-react-native/experimental-activity-indicator 0.11.0 → 0.11.3
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 +26 -0
- package/lib/ActivityIndicator.android.d.ts +1 -1
- package/lib/ActivityIndicator.android.js +1 -1
- package/lib/ActivityIndicator.d.ts +1 -1
- package/lib/ActivityIndicator.ios.d.ts +1 -1
- package/lib/ActivityIndicator.ios.js +1 -1
- package/lib/ActivityIndicator.js +1 -1
- package/lib/ActivityIndicator.mobile.d.ts +2 -7
- package/lib/ActivityIndicator.mobile.js +86 -89
- package/lib/ActivityIndicator.mobile.js.map +1 -1
- package/lib/ActivityIndicator.styling.d.ts +5 -15
- package/lib/ActivityIndicator.styling.js +67 -76
- package/lib/ActivityIndicator.types.d.ts +36 -36
- package/lib/ActivityIndicator.types.js +1 -1
- package/lib/CoreActivityIndicator.d.ts +2 -7
- package/lib/CoreActivityIndicator.js +11 -11
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib-commonjs/ActivityIndicator.android.d.ts +1 -1
- package/lib-commonjs/ActivityIndicator.android.js +6 -11
- package/lib-commonjs/ActivityIndicator.d.ts +1 -1
- package/lib-commonjs/ActivityIndicator.ios.d.ts +1 -1
- package/lib-commonjs/ActivityIndicator.ios.js +6 -11
- package/lib-commonjs/ActivityIndicator.js +6 -11
- package/lib-commonjs/ActivityIndicator.mobile.d.ts +2 -7
- package/lib-commonjs/ActivityIndicator.mobile.js +94 -106
- package/lib-commonjs/ActivityIndicator.mobile.js.map +1 -1
- package/lib-commonjs/ActivityIndicator.styling.d.ts +5 -15
- package/lib-commonjs/ActivityIndicator.styling.js +76 -87
- package/lib-commonjs/ActivityIndicator.types.d.ts +36 -36
- package/lib-commonjs/ActivityIndicator.types.js +3 -3
- package/lib-commonjs/CoreActivityIndicator.d.ts +2 -7
- package/lib-commonjs/CoreActivityIndicator.js +17 -17
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js +5 -10
- package/package.json +21 -20
- package/src/ActivityIndicator.mobile.tsx +2 -2
- package/eslint.config.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/experimental-activity-indicator
|
|
2
2
|
|
|
3
|
+
## 0.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9cf4444: Migrate from ESLint to oxlint
|
|
8
|
+
- Updated dependencies [9cf4444]
|
|
9
|
+
- @fluentui-react-native/framework@0.15.3
|
|
10
|
+
|
|
11
|
+
## 0.11.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 8a7b549: Update to the latest rnx-kit versions, fix some typing issues, and correct the vscode settings
|
|
16
|
+
- Updated dependencies [8a7b549]
|
|
17
|
+
- @fluentui-react-native/framework@0.15.2
|
|
18
|
+
|
|
19
|
+
## 0.11.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 0d6e9c1: chore: migrate to `oxfmt`
|
|
24
|
+
- ac6e7af: Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering
|
|
25
|
+
- Updated dependencies [0d6e9c1]
|
|
26
|
+
- Updated dependencies [ac6e7af]
|
|
27
|
+
- @fluentui-react-native/framework@0.15.1
|
|
28
|
+
|
|
3
29
|
## 0.11.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
2
2
|
export { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
3
3
|
export default ActivityIndicator;
|
|
4
|
-
//# sourceMappingURL=ActivityIndicator.android.d.ts.map
|
|
4
|
+
//# sourceMappingURL=ActivityIndicator.android.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
2
2
|
export { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
3
3
|
export default ActivityIndicator;
|
|
4
|
-
//# sourceMappingURL=ActivityIndicator.android.js.map
|
|
4
|
+
//# sourceMappingURL=ActivityIndicator.android.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
2
2
|
export { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
3
3
|
export default ActivityIndicator;
|
|
4
|
-
//# sourceMappingURL=ActivityIndicator.ios.d.ts.map
|
|
4
|
+
//# sourceMappingURL=ActivityIndicator.ios.d.ts.map
|
package/lib/ActivityIndicator.js
CHANGED
|
@@ -2,10 +2,5 @@ import { Animated } from 'react-native';
|
|
|
2
2
|
import { Svg } from 'react-native-svg';
|
|
3
3
|
import type { ActivityIndicatorProps } from './ActivityIndicator.types';
|
|
4
4
|
export declare const AnimatedSvg: Animated.AnimatedComponent<typeof Svg>;
|
|
5
|
-
export declare const ActivityIndicator: import(
|
|
6
|
-
|
|
7
|
-
import('./ActivityIndicator.types').FluentActivityIndicatorSlotProps,
|
|
8
|
-
import('./ActivityIndicator.types').ActivityIndicatorTokens,
|
|
9
|
-
import('@fluentui-react-native/framework-base').ObjectBase
|
|
10
|
-
>;
|
|
11
|
-
//# sourceMappingURL=ActivityIndicator.mobile.d.ts.map
|
|
5
|
+
export declare const ActivityIndicator: import("@fluentui-react-native/framework").ComposableComponent<ActivityIndicatorProps, import("./ActivityIndicator.types").FluentActivityIndicatorSlotProps, import("./ActivityIndicator.types").ActivityIndicatorTokens, import("@fluentui-react-native/framework-base").ObjectBase>;
|
|
6
|
+
//# sourceMappingURL=ActivityIndicator.mobile.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from
|
|
1
|
+
import { jsx as _jsx } from "@fluentui-react-native/framework-base/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
3
3
|
import { useRef, useEffect, useCallback } from 'react';
|
|
4
4
|
import { Animated, Easing, View } from 'react-native';
|
|
@@ -7,97 +7,94 @@ import { Svg, Path } from 'react-native-svg';
|
|
|
7
7
|
import { diameterSizeMap, lineThicknessSizeMap, stylingSettings } from './ActivityIndicator.styling';
|
|
8
8
|
import { activityIndicatorName } from './ActivityIndicator.types';
|
|
9
9
|
const getActivityIndicatorPath = (diameter, width, color) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const start = {
|
|
11
|
+
x: width / 2,
|
|
12
|
+
y: diameter / 2,
|
|
13
|
+
};
|
|
14
|
+
const innerRadius = diameter / 2 - width / 2;
|
|
15
|
+
const path = `M${start.x} ${start.y} a${innerRadius} ${innerRadius} 0 1 1 ${innerRadius} ${innerRadius}`;
|
|
16
|
+
return _jsx(Path, { d: path, stroke: color, strokeWidth: width, strokeLinecap: "round", fill: 'transparent' });
|
|
17
17
|
};
|
|
18
18
|
export const AnimatedSvg = Animated.createAnimatedComponent(Svg);
|
|
19
19
|
const useStyling = buildUseStyling(stylingSettings);
|
|
20
20
|
export const ActivityIndicator = compose({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
21
|
+
displayName: activityIndicatorName,
|
|
22
|
+
...stylingSettings,
|
|
23
|
+
slots: {
|
|
24
|
+
root: View,
|
|
25
|
+
svg: AnimatedSvg,
|
|
26
|
+
},
|
|
27
|
+
useRender: (props, useSlots) => {
|
|
28
|
+
const Slots = useSlots(props);
|
|
29
|
+
const slotProps = useStyling(props);
|
|
30
|
+
const animating = props.animating != undefined ? props.animating : true;
|
|
31
|
+
const hidesWhenStopped = props.hidesWhenStopped != undefined ? props.hidesWhenStopped : true;
|
|
32
|
+
// React Native ActivityIndicator still takes up space when hidden, so to perfectly match would use opacity
|
|
33
|
+
// hiding opacity makes the screen reader on iOS and Android skip over it
|
|
34
|
+
const hideOpacity = animating == false && hidesWhenStopped == true ? 0 : 1;
|
|
35
|
+
const rotationAngle = useRef(new Animated.Value(0)).current;
|
|
36
|
+
const rotationAnimation = useRef(undefined);
|
|
37
|
+
/**
|
|
38
|
+
* https://github.com/facebook/react-native/pull/29585
|
|
39
|
+
* For Animated.loop() to work with the native driver, React Native needs this fix.
|
|
40
|
+
* It's only available in React Native 0.66+, and React Native macOS 0.62+
|
|
41
|
+
* To workaround this, let's just rerun the loop everytime the animation finishes
|
|
42
|
+
*/
|
|
43
|
+
const startRotation = useCallback(() => {
|
|
44
|
+
if (rotationAnimation.current) {
|
|
45
|
+
rotationAngle.setValue(0);
|
|
46
|
+
rotationAnimation.current.reset();
|
|
47
|
+
rotationAnimation.current.start((result) => {
|
|
48
|
+
if (result.finished) {
|
|
49
|
+
startRotation();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, [rotationAngle]);
|
|
54
|
+
const stopRotation = () => {
|
|
55
|
+
if (rotationAnimation.current) {
|
|
56
|
+
rotationAnimation.current.stop();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (rotationAnimation.current === undefined) {
|
|
61
|
+
rotationAnimation.current = Animated.sequence([
|
|
62
|
+
Animated.timing(rotationAngle, {
|
|
63
|
+
toValue: 359,
|
|
64
|
+
duration: 750,
|
|
65
|
+
useNativeDriver: true,
|
|
66
|
+
easing: Easing.linear,
|
|
67
|
+
}),
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
if (animating) {
|
|
71
|
+
startRotation();
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
stopRotation();
|
|
75
|
+
}
|
|
76
|
+
}, [animating, rotationAngle, startRotation]);
|
|
77
|
+
const interpolateSpin = rotationAngle.interpolate({
|
|
78
|
+
inputRange: [0, 359],
|
|
79
|
+
outputRange: ['0deg', '359deg'],
|
|
51
80
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (animating) {
|
|
71
|
-
startRotation();
|
|
72
|
-
} else {
|
|
73
|
-
stopRotation();
|
|
74
|
-
}
|
|
75
|
-
}, [animating, hidesWhenStopped, rotationAngle]);
|
|
76
|
-
const interpolateSpin = rotationAngle.interpolate({
|
|
77
|
-
inputRange: [0, 359],
|
|
78
|
-
outputRange: ['0deg', '359deg'],
|
|
79
|
-
});
|
|
80
|
-
const path = getActivityIndicatorPath(
|
|
81
|
-
diameterSizeMap[slotProps.root.size],
|
|
82
|
-
lineThicknessSizeMap[slotProps.root.lineThickness],
|
|
83
|
-
slotProps.root.activityIndicatorColor,
|
|
84
|
-
);
|
|
85
|
-
// perspective is needed for animations to work on Android. See https://reactnative.dev/docs/animations#bear-in-mind
|
|
86
|
-
const animatedSvgProps = {
|
|
87
|
-
style: {
|
|
88
|
-
transform: [{ rotateZ: interpolateSpin }, { perspective: 10 }],
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
const otherRootProps = {
|
|
92
|
-
style: {
|
|
93
|
-
opacity: hideOpacity,
|
|
94
|
-
},
|
|
95
|
-
accessibilityState: { busy: animating },
|
|
96
|
-
};
|
|
97
|
-
return (rest) => {
|
|
98
|
-
const { ...mergedProps } = mergeProps(props, rest, otherRootProps);
|
|
99
|
-
return _jsx(Slots.root, { ...mergedProps, children: _jsx(Slots.svg, { ...animatedSvgProps, children: path }) });
|
|
100
|
-
};
|
|
101
|
-
},
|
|
81
|
+
const path = getActivityIndicatorPath(diameterSizeMap[slotProps.root.size], lineThicknessSizeMap[slotProps.root.lineThickness], slotProps.root.activityIndicatorColor);
|
|
82
|
+
// perspective is needed for animations to work on Android. See https://reactnative.dev/docs/animations#bear-in-mind
|
|
83
|
+
const animatedSvgProps = {
|
|
84
|
+
style: {
|
|
85
|
+
transform: [{ rotateZ: interpolateSpin }, { perspective: 10 }],
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
const otherRootProps = {
|
|
89
|
+
style: {
|
|
90
|
+
opacity: hideOpacity,
|
|
91
|
+
},
|
|
92
|
+
accessibilityState: { busy: animating },
|
|
93
|
+
};
|
|
94
|
+
return (rest) => {
|
|
95
|
+
const { ...mergedProps } = mergeProps(props, rest, otherRootProps);
|
|
96
|
+
return (_jsx(Slots.root, { ...mergedProps, children: _jsx(Slots.svg, { ...animatedSvgProps, children: path }) }));
|
|
97
|
+
};
|
|
98
|
+
},
|
|
102
99
|
});
|
|
103
|
-
//# sourceMappingURL=ActivityIndicator.mobile.js.map
|
|
100
|
+
//# sourceMappingURL=ActivityIndicator.mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.mobile.js","sourceRoot":"","sources":["../src/ActivityIndicator.mobile.tsx"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGtD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,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ACD,kBAAkB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SACxC,CAAC;QACF,OAAO,CAAC,IAA4B,EAAE,EAAE,CAAC;YACvC,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;YACnE,OAAO,CACL,KAAC,KAAK,CAAC,IAAI,OAAK,WAAW,YACzB,KAAC,KAAK,CAAC,GAAG,OAAK,gBAAgB,YAAG,IAAI,GAAa,GACxC,CACd,CAAC;QAAA,CACH,CAAC;IAAA,CACH;CACF,CAAC,CAAC"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import type { ActivityIndicatorProps as CoreActivityIndicatorProps } from 'react-native';
|
|
2
2
|
import type { UseStylingOptions } from '@fluentui-react-native/framework';
|
|
3
|
-
import type {
|
|
4
|
-
ActivityIndicatorProps,
|
|
5
|
-
FluentActivityIndicatorSlotProps,
|
|
6
|
-
ActivityIndicatorTokens,
|
|
7
|
-
CoreActivityIndicatorSlotProps,
|
|
8
|
-
ActivityIndicatorSize,
|
|
9
|
-
} from './ActivityIndicator.types';
|
|
3
|
+
import type { ActivityIndicatorProps, FluentActivityIndicatorSlotProps, ActivityIndicatorTokens, CoreActivityIndicatorSlotProps, ActivityIndicatorSize } from './ActivityIndicator.types';
|
|
10
4
|
export declare const diameterSizeMap: {
|
|
11
|
-
|
|
5
|
+
[key: string]: number;
|
|
12
6
|
};
|
|
13
7
|
export declare const lineThicknessSizeMap: {
|
|
14
|
-
|
|
8
|
+
[key: string]: number;
|
|
15
9
|
};
|
|
16
10
|
export declare function coreSizeFromFluentSize(fluentSize: ActivityIndicatorSize): CoreActivityIndicatorProps['size'];
|
|
17
11
|
export declare const stylingSettings: UseStylingOptions<ActivityIndicatorProps, FluentActivityIndicatorSlotProps, ActivityIndicatorTokens>;
|
|
18
|
-
export declare const coreStylingSettings: UseStylingOptions<
|
|
19
|
-
|
|
20
|
-
CoreActivityIndicatorSlotProps,
|
|
21
|
-
ActivityIndicatorTokens
|
|
22
|
-
>;
|
|
23
|
-
//# sourceMappingURL=ActivityIndicator.styling.d.ts.map
|
|
12
|
+
export declare const coreStylingSettings: UseStylingOptions<ActivityIndicatorProps, CoreActivityIndicatorSlotProps, ActivityIndicatorTokens>;
|
|
13
|
+
//# sourceMappingURL=ActivityIndicator.styling.d.ts.map
|
|
@@ -3,90 +3,81 @@ import { buildProps } from '@fluentui-react-native/framework';
|
|
|
3
3
|
import assertNever from 'assert-never';
|
|
4
4
|
import { activityIndicatorName } from './ActivityIndicator.types';
|
|
5
5
|
export const diameterSizeMap = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
xSmall: 12,
|
|
7
|
+
small: 16,
|
|
8
|
+
medium: 24,
|
|
9
|
+
large: 32,
|
|
10
|
+
xLarge: 36,
|
|
11
11
|
};
|
|
12
12
|
export const lineThicknessSizeMap = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
xSmall: 1,
|
|
14
|
+
small: 1,
|
|
15
|
+
medium: 2,
|
|
16
|
+
large: 3,
|
|
17
|
+
xLarge: 4,
|
|
18
18
|
};
|
|
19
19
|
// Size coversion ramp from the Fluent ActivityIndicator size to the RN ActivityIndicator.
|
|
20
20
|
export function coreSizeFromFluentSize(fluentSize) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
if (typeof fluentSize === 'undefined') {
|
|
22
|
+
return fluentSize;
|
|
23
|
+
}
|
|
24
|
+
switch (fluentSize) {
|
|
25
|
+
case 'xSmall':
|
|
26
|
+
return 'small';
|
|
27
|
+
case 'small':
|
|
28
|
+
return 'small';
|
|
29
|
+
case 'medium':
|
|
30
|
+
return 'small';
|
|
31
|
+
case 'large':
|
|
32
|
+
return 'large';
|
|
33
|
+
case 'xLarge':
|
|
34
|
+
return 'large';
|
|
35
|
+
default:
|
|
36
|
+
assertNever(fluentSize);
|
|
37
|
+
}
|
|
38
38
|
}
|
|
39
39
|
export const stylingSettings = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
width: diameterSizeMap[tokens.size],
|
|
67
|
-
height: diameterSizeMap[tokens.size],
|
|
68
|
-
}),
|
|
69
|
-
['size'],
|
|
70
|
-
),
|
|
71
|
-
},
|
|
40
|
+
tokens: [
|
|
41
|
+
() => ({
|
|
42
|
+
activityIndicatorColor: Appearance.getColorScheme() === 'light' ? '#BDBDBD' : '#666666',
|
|
43
|
+
lineThickness: 'medium',
|
|
44
|
+
size: 'medium',
|
|
45
|
+
}),
|
|
46
|
+
activityIndicatorName,
|
|
47
|
+
],
|
|
48
|
+
tokensThatAreAlsoProps: 'all',
|
|
49
|
+
slotProps: {
|
|
50
|
+
root: buildProps((tokens) => ({
|
|
51
|
+
activityIndicatorColor: tokens.activityIndicatorColor,
|
|
52
|
+
size: tokens.size,
|
|
53
|
+
lineThickness: tokens.lineThickness != 'medium' ? tokens.lineThickness : tokens.size,
|
|
54
|
+
accessibilityLabel: 'progressbar',
|
|
55
|
+
accessible: true,
|
|
56
|
+
style: {
|
|
57
|
+
width: diameterSizeMap[tokens.size],
|
|
58
|
+
height: diameterSizeMap[tokens.size],
|
|
59
|
+
},
|
|
60
|
+
}), ['activityIndicatorColor', 'lineThickness', 'size']),
|
|
61
|
+
svg: buildProps((tokens) => ({
|
|
62
|
+
width: diameterSizeMap[tokens.size],
|
|
63
|
+
height: diameterSizeMap[tokens.size],
|
|
64
|
+
}), ['size']),
|
|
65
|
+
},
|
|
72
66
|
};
|
|
73
67
|
// Minimal styling settings for the RN Core ActivityIndicator
|
|
74
68
|
export const coreStylingSettings = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
['activityIndicatorColor', 'size'],
|
|
89
|
-
),
|
|
90
|
-
},
|
|
69
|
+
tokens: [
|
|
70
|
+
() => ({
|
|
71
|
+
size: 'small',
|
|
72
|
+
}),
|
|
73
|
+
activityIndicatorName,
|
|
74
|
+
],
|
|
75
|
+
tokensThatAreAlsoProps: 'all',
|
|
76
|
+
slotProps: {
|
|
77
|
+
root: buildProps((tokens) => ({
|
|
78
|
+
color: tokens.activityIndicatorColor,
|
|
79
|
+
...(tokens.size && { size: coreSizeFromFluentSize(tokens.size) }), // Only pass in the prop if defined
|
|
80
|
+
}), ['activityIndicatorColor', 'size']),
|
|
81
|
+
},
|
|
91
82
|
};
|
|
92
|
-
//# sourceMappingURL=ActivityIndicator.styling.js.map
|
|
83
|
+
//# sourceMappingURL=ActivityIndicator.styling.js.map
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import type { Animated, ActivityIndicatorProps as CoreActivityIndicatorProps } from 'react-native';
|
|
2
2
|
import type { SvgProps } from 'react-native-svg';
|
|
3
|
-
export declare const activityIndicatorName =
|
|
3
|
+
export declare const activityIndicatorName = "ActivityIndicator";
|
|
4
4
|
/**
|
|
5
5
|
* Specifies the possible sizes of the ActivityIndicator.
|
|
6
6
|
*/
|
|
7
7
|
export type ActivityIndicatorSize = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge';
|
|
8
8
|
export interface ActivityIndicatorTokens {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
/**
|
|
10
|
+
* ActivityIndicator element color
|
|
11
|
+
* @defaultValue 'BDBDBD' for light mode, '666666' for dark mode
|
|
12
|
+
*/
|
|
13
|
+
activityIndicatorColor?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Line thickness of the ActivityIndicator
|
|
16
|
+
* @defaultValue 'medium' or what size is set to
|
|
17
|
+
*/
|
|
18
|
+
lineThickness?: ActivityIndicatorSize;
|
|
19
|
+
/**
|
|
20
|
+
* Size of the ActivityIndicator view
|
|
21
|
+
* @defaultValue 'medium'
|
|
22
|
+
*/
|
|
23
|
+
size?: ActivityIndicatorSize;
|
|
24
24
|
}
|
|
25
25
|
export interface ActivityIndicatorProps extends ActivityIndicatorTokens, Omit<CoreActivityIndicatorProps, 'size'> {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
/**
|
|
27
|
+
* ActivityIndicator animating or not
|
|
28
|
+
* @defaultValue 'true'
|
|
29
|
+
*/
|
|
30
|
+
animating?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* ActivityIndicator hidden when not animating or not hidden
|
|
33
|
+
* @defaultValue 'true'
|
|
34
|
+
*/
|
|
35
|
+
hidesWhenStopped?: boolean;
|
|
36
36
|
}
|
|
37
37
|
export interface FluentActivityIndicatorSlotProps {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
root: ActivityIndicatorProps;
|
|
39
|
+
svg: Animated.AnimatedProps<SvgProps>;
|
|
40
40
|
}
|
|
41
41
|
export interface FluentActivityIndicatorType {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
props: ActivityIndicatorProps;
|
|
43
|
+
slotProps: FluentActivityIndicatorSlotProps;
|
|
44
|
+
tokens: ActivityIndicatorTokens;
|
|
45
45
|
}
|
|
46
46
|
export interface CoreActivityIndicatorSlotProps {
|
|
47
|
-
|
|
47
|
+
root: CoreActivityIndicatorProps;
|
|
48
48
|
}
|
|
49
49
|
export interface CoreActivityIndicatorType {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
props: ActivityIndicatorProps;
|
|
51
|
+
slotProps: CoreActivityIndicatorSlotProps;
|
|
52
|
+
tokens: ActivityIndicatorTokens;
|
|
53
53
|
}
|
|
54
|
-
//# sourceMappingURL=ActivityIndicator.types.d.ts.map
|
|
54
|
+
//# sourceMappingURL=ActivityIndicator.types.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const activityIndicatorName = 'ActivityIndicator';
|
|
2
|
-
//# sourceMappingURL=ActivityIndicator.types.js.map
|
|
2
|
+
//# sourceMappingURL=ActivityIndicator.types.js.map
|
|
@@ -4,10 +4,5 @@ import type { ActivityIndicatorProps } from './ActivityIndicator.types';
|
|
|
4
4
|
* Wrapper around React Native Core's ActivityIndicator for platforms we do not
|
|
5
5
|
* have a custom FluentUI React Native ActivityIndicator defined.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ActivityIndicator: import(
|
|
8
|
-
|
|
9
|
-
import('./ActivityIndicator.types').CoreActivityIndicatorSlotProps,
|
|
10
|
-
import('./ActivityIndicator.types').ActivityIndicatorTokens,
|
|
11
|
-
import('@fluentui-react-native/framework-base').ObjectBase
|
|
12
|
-
>;
|
|
13
|
-
//# sourceMappingURL=CoreActivityIndicator.d.ts.map
|
|
7
|
+
export declare const ActivityIndicator: import("@fluentui-react-native/framework").ComposableComponent<ActivityIndicatorProps, import("./ActivityIndicator.types").CoreActivityIndicatorSlotProps, import("./ActivityIndicator.types").ActivityIndicatorTokens, import("@fluentui-react-native/framework-base").ObjectBase>;
|
|
8
|
+
//# sourceMappingURL=CoreActivityIndicator.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from
|
|
1
|
+
import { jsx as _jsx } from "@fluentui-react-native/framework-base/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
3
3
|
import { ActivityIndicator as CoreActivityIndicator } from 'react-native';
|
|
4
4
|
import { compose } from '@fluentui-react-native/framework';
|
|
@@ -9,14 +9,14 @@ import { activityIndicatorName } from './ActivityIndicator.types';
|
|
|
9
9
|
* have a custom FluentUI React Native ActivityIndicator defined.
|
|
10
10
|
*/
|
|
11
11
|
export const ActivityIndicator = compose({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
displayName: activityIndicatorName,
|
|
13
|
+
...coreStylingSettings,
|
|
14
|
+
slots: {
|
|
15
|
+
root: CoreActivityIndicator,
|
|
16
|
+
},
|
|
17
|
+
useRender: (props, useSlots) => {
|
|
18
|
+
const Slots = useSlots(props);
|
|
19
|
+
return () => _jsx(Slots.root, {});
|
|
20
|
+
},
|
|
21
21
|
});
|
|
22
|
-
//# sourceMappingURL=CoreActivityIndicator.js.map
|
|
22
|
+
//# sourceMappingURL=CoreActivityIndicator.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ActivityIndicator } from './ActivityIndicator';
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ActivityIndicator } from './ActivityIndicator';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|