@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.
@@ -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
  }
@@ -12,6 +12,7 @@ export interface CarouselPageIndicatorProps {
12
12
  activeStyle?: StyleProp<ViewStyle>;
13
13
  currentIndex: number | null;
14
14
  inactiveStyle?: StyleProp<ViewStyle>;
15
+ indicatorTestId?: string;
15
16
  numberOfItems: number;
16
17
  style?: StyleProp<ViewStyle>;
17
18
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "2.2.20";
1
+ export declare const VERSION = "2.3.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.2.20';
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
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.2.20';
4
+ exports.VERSION = '2.3.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react-native",
3
- "version": "2.2.20",
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.2",
35
- "@aws-amplify/ui-react-core-notifications": "2.0.33"
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": "^0.70 || ^0.71 || ^0.72 || ^0.73 || ^0.74 || ^0.75",
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>;
@@ -14,6 +14,7 @@ export interface CarouselPageIndicatorProps {
14
14
  activeStyle?: StyleProp<ViewStyle>;
15
15
  currentIndex: number | null;
16
16
  inactiveStyle?: StyleProp<ViewStyle>;
17
+ indicatorTestId?: string;
17
18
  numberOfItems: number;
18
19
  style?: StyleProp<ViewStyle>;
19
20
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.2.20';
1
+ export const VERSION = '2.3.1';