@aws-amplify/ui-react-native 2.2.20 → 2.3.1
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/dist/primitives/Carousel/CarouselPageIndicator.d.ts +1 -1
- package/dist/primitives/Carousel/CarouselPageIndicator.js +2 -2
- package/dist/primitives/Carousel/types.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/lib/primitives/Carousel/CarouselPageIndicator.js +2 -2
- package/lib/version.js +1 -1
- package/package.json +4 -4
- package/src/primitives/Carousel/CarouselPageIndicator.tsx +4 -1
- package/src/primitives/Carousel/types.ts +1 -0
- package/src/version.ts +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CarouselPageIndicatorProps } from './types';
|
|
3
|
-
export default function CarouselPageIndicator({ activeStyle, currentIndex, inactiveStyle, numberOfItems, style, }: CarouselPageIndicatorProps): JSX.Element;
|
|
3
|
+
export default function CarouselPageIndicator({ activeStyle, currentIndex, inactiveStyle, indicatorTestId, numberOfItems, style, }: CarouselPageIndicatorProps): JSX.Element;
|
|
@@ -2,9 +2,9 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
4
|
import { DEFAULT_CAROUSEL_INDICATOR_ACTIVE_STYLE, DEFAULT_CAROUSEL_INDICATOR_INACTIVE_STYLE, } from './constants';
|
|
5
|
-
export default function CarouselPageIndicator({ activeStyle, currentIndex, inactiveStyle, numberOfItems, style, }) {
|
|
5
|
+
export default function CarouselPageIndicator({ activeStyle, currentIndex, inactiveStyle, indicatorTestId, numberOfItems, style, }) {
|
|
6
6
|
const items = useMemo(() => new Array(numberOfItems ?? 0)
|
|
7
7
|
.fill(null)
|
|
8
|
-
.map((_, index) => (currentIndex ?? 0) === index ? (<View style={[DEFAULT_CAROUSEL_INDICATOR_ACTIVE_STYLE, activeStyle]} key={`indicator-item-${index}`}/>) : (<View style={[DEFAULT_CAROUSEL_INDICATOR_INACTIVE_STYLE, inactiveStyle]} key={`indicator-item-${index}`}/>)), [activeStyle, currentIndex, inactiveStyle, numberOfItems]);
|
|
8
|
+
.map((_, index) => (currentIndex ?? 0) === index ? (<View style={[DEFAULT_CAROUSEL_INDICATOR_ACTIVE_STYLE, activeStyle]} key={`indicator-item-${index}`} testID={indicatorTestId}/>) : (<View style={[DEFAULT_CAROUSEL_INDICATOR_INACTIVE_STYLE, inactiveStyle]} key={`indicator-item-${index}`} testID={indicatorTestId}/>)), [activeStyle, currentIndex, inactiveStyle, indicatorTestId, numberOfItems]);
|
|
9
9
|
return <SafeAreaView style={style}>{items}</SafeAreaView>;
|
|
10
10
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.3.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.3.1';
|
|
@@ -5,10 +5,10 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const react_native_1 = require("react-native");
|
|
6
6
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
|
-
function CarouselPageIndicator({ activeStyle, currentIndex, inactiveStyle, numberOfItems, style, }) {
|
|
8
|
+
function CarouselPageIndicator({ activeStyle, currentIndex, inactiveStyle, indicatorTestId, numberOfItems, style, }) {
|
|
9
9
|
const items = (0, react_1.useMemo)(() => new Array(numberOfItems ?? 0)
|
|
10
10
|
.fill(null)
|
|
11
|
-
.map((_, index) => (currentIndex ?? 0) === index ? (<react_native_1.View style={[constants_1.DEFAULT_CAROUSEL_INDICATOR_ACTIVE_STYLE, activeStyle]} key={`indicator-item-${index}`}/>) : (<react_native_1.View style={[constants_1.DEFAULT_CAROUSEL_INDICATOR_INACTIVE_STYLE, inactiveStyle]} key={`indicator-item-${index}`}/>)), [activeStyle, currentIndex, inactiveStyle, numberOfItems]);
|
|
11
|
+
.map((_, index) => (currentIndex ?? 0) === index ? (<react_native_1.View style={[constants_1.DEFAULT_CAROUSEL_INDICATOR_ACTIVE_STYLE, activeStyle]} key={`indicator-item-${index}`} testID={indicatorTestId}/>) : (<react_native_1.View style={[constants_1.DEFAULT_CAROUSEL_INDICATOR_INACTIVE_STYLE, inactiveStyle]} key={`indicator-item-${index}`} testID={indicatorTestId}/>)), [activeStyle, currentIndex, inactiveStyle, indicatorTestId, numberOfItems]);
|
|
12
12
|
return <react_native_safe_area_context_1.SafeAreaView style={style}>{items}</react_native_safe_area_context_1.SafeAreaView>;
|
|
13
13
|
}
|
|
14
14
|
exports.default = CarouselPageIndicator;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react-native",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@aws-amplify/ui": "6.7.2",
|
|
34
|
-
"@aws-amplify/ui-react-core": "3.1
|
|
35
|
-
"@aws-amplify/ui-react-core-notifications": "2.
|
|
34
|
+
"@aws-amplify/ui-react-core": "3.2.1",
|
|
35
|
+
"@aws-amplify/ui-react-core-notifications": "2.1.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"aws-amplify": "^6.9.0",
|
|
39
39
|
"react": "*",
|
|
40
|
-
"react-native": "
|
|
40
|
+
"react-native": ">=0.70",
|
|
41
41
|
"react-native-safe-area-context": "^4.2.5"
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
@@ -12,6 +12,7 @@ export default function CarouselPageIndicator({
|
|
|
12
12
|
activeStyle,
|
|
13
13
|
currentIndex,
|
|
14
14
|
inactiveStyle,
|
|
15
|
+
indicatorTestId,
|
|
15
16
|
numberOfItems,
|
|
16
17
|
style,
|
|
17
18
|
}: CarouselPageIndicatorProps): JSX.Element {
|
|
@@ -24,15 +25,17 @@ export default function CarouselPageIndicator({
|
|
|
24
25
|
<View
|
|
25
26
|
style={[DEFAULT_CAROUSEL_INDICATOR_ACTIVE_STYLE, activeStyle]}
|
|
26
27
|
key={`indicator-item-${index}`}
|
|
28
|
+
testID={indicatorTestId}
|
|
27
29
|
/>
|
|
28
30
|
) : (
|
|
29
31
|
<View
|
|
30
32
|
style={[DEFAULT_CAROUSEL_INDICATOR_INACTIVE_STYLE, inactiveStyle]}
|
|
31
33
|
key={`indicator-item-${index}`}
|
|
34
|
+
testID={indicatorTestId}
|
|
32
35
|
/>
|
|
33
36
|
)
|
|
34
37
|
),
|
|
35
|
-
[activeStyle, currentIndex, inactiveStyle, numberOfItems]
|
|
38
|
+
[activeStyle, currentIndex, inactiveStyle, indicatorTestId, numberOfItems]
|
|
36
39
|
);
|
|
37
40
|
|
|
38
41
|
return <SafeAreaView style={style}>{items}</SafeAreaView>;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.3.1';
|