@aws-amplify/ui-react-native 1.2.27 → 2.0.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.
Files changed (137) hide show
  1. package/dist/Authenticator/Authenticator.d.ts +83 -12
  2. package/dist/Authenticator/Authenticator.js +19 -16
  3. package/dist/Authenticator/Defaults/{ResetPassword/ResetPassword.d.ts → ForgotPassword/ForgotPassword.d.ts} +2 -2
  4. package/dist/Authenticator/Defaults/{ResetPassword/ResetPassword.js → ForgotPassword/ForgotPassword.js} +1 -1
  5. package/dist/Authenticator/Defaults/ForgotPassword/index.d.ts +1 -0
  6. package/dist/Authenticator/Defaults/ForgotPassword/index.js +1 -0
  7. package/dist/Authenticator/Defaults/{SetupTOTP/SetupTOTP.d.ts → SetupTotp/SetupTotp.d.ts} +4 -4
  8. package/dist/Authenticator/Defaults/{SetupTOTP/SetupTOTP.js → SetupTotp/SetupTotp.js} +10 -10
  9. package/dist/Authenticator/Defaults/SetupTotp/index.d.ts +1 -0
  10. package/dist/Authenticator/Defaults/SetupTotp/index.js +1 -0
  11. package/dist/Authenticator/Defaults/SetupTotp/styles.d.ts +5 -0
  12. package/dist/Authenticator/Defaults/SignIn/SignIn.d.ts +1 -1
  13. package/dist/Authenticator/Defaults/SignIn/SignIn.js +6 -5
  14. package/dist/Authenticator/Defaults/SignUp/SignUp.d.ts +1 -1
  15. package/dist/Authenticator/Defaults/SignUp/SignUp.js +4 -3
  16. package/dist/Authenticator/Defaults/index.d.ts +2 -2
  17. package/dist/Authenticator/Defaults/index.js +2 -2
  18. package/dist/Authenticator/Defaults/types.d.ts +11 -11
  19. package/dist/Authenticator/common/FederatedProviderButton/FederatedProviderButton.js +2 -4
  20. package/dist/Authenticator/common/FederatedProviderButton/types.d.ts +3 -1
  21. package/dist/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.d.ts +1 -1
  22. package/dist/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.js +24 -11
  23. package/dist/Authenticator/common/FederatedProviderButtons/styles.d.ts +2 -1
  24. package/dist/Authenticator/common/FederatedProviderButtons/styles.js +14 -4
  25. package/dist/Authenticator/common/FederatedProviderButtons/types.d.ts +5 -3
  26. package/dist/Authenticator/hooks/useFieldValues/useFieldValues.js +1 -1
  27. package/dist/Authenticator/hooks/useFieldValues/utils.js +1 -1
  28. package/dist/Authenticator/types.d.ts +1 -1
  29. package/dist/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.js +2 -2
  30. package/dist/InAppMessaging/hooks/useMessageImage/useMessageImage.d.ts +2 -2
  31. package/dist/InAppMessaging/hooks/useMessageImage/useMessageImage.js +2 -2
  32. package/dist/InAppMessaging/hooks/useMessageImage/utils.d.ts +2 -2
  33. package/dist/InAppMessaging/hooks/useMessageImage/utils.js +2 -2
  34. package/dist/InAppMessaging/hooks/useMessageProps/types.d.ts +2 -2
  35. package/dist/InAppMessaging/hooks/useMessageProps/utils.d.ts +2 -2
  36. package/dist/InAppMessaging/index.d.ts +1 -1
  37. package/dist/InAppMessaging/index.js +1 -0
  38. package/dist/assets/icons/icons.ts +3 -0
  39. package/dist/primitives/Button/styles.js +4 -2
  40. package/dist/primitives/Carousel/Carousel.js +1 -11
  41. package/dist/primitives/Divider/styles.js +4 -3
  42. package/dist/primitives/ErrorMessage/ErrorMessage.d.ts +1 -1
  43. package/dist/primitives/ErrorMessage/ErrorMessage.js +2 -2
  44. package/dist/primitives/Icon/Icon.d.ts +1 -1
  45. package/dist/primitives/Icon/Icon.js +2 -1
  46. package/dist/primitives/Icon/styles.js +1 -1
  47. package/dist/primitives/Radio/styles.js +1 -1
  48. package/dist/primitives/RadioGroup/RadioGroup.d.ts +1 -1
  49. package/dist/primitives/RadioGroup/RadioGroup.js +2 -2
  50. package/dist/primitives/Tabs/Tabs.d.ts +1 -1
  51. package/dist/primitives/Tabs/Tabs.js +2 -2
  52. package/dist/primitives/Tabs/styles.js +3 -3
  53. package/dist/utils/platform.d.ts +1 -2
  54. package/dist/version.d.ts +1 -1
  55. package/dist/version.js +1 -1
  56. package/lib/Authenticator/Authenticator.js +17 -14
  57. package/lib/Authenticator/Defaults/{ResetPassword/ResetPassword.js → ForgotPassword/ForgotPassword.js} +1 -1
  58. package/lib/Authenticator/Defaults/ForgotPassword/index.js +8 -0
  59. package/lib/Authenticator/Defaults/{SetupTOTP/SetupTOTP.js → SetupTotp/SetupTotp.js} +10 -10
  60. package/lib/Authenticator/Defaults/{SetupTOTP → SetupTotp}/index.js +3 -3
  61. package/lib/Authenticator/Defaults/SignIn/SignIn.js +5 -4
  62. package/lib/Authenticator/Defaults/SignUp/SignUp.js +3 -2
  63. package/lib/Authenticator/Defaults/index.js +5 -5
  64. package/lib/Authenticator/common/FederatedProviderButton/FederatedProviderButton.js +2 -4
  65. package/lib/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.js +22 -9
  66. package/lib/Authenticator/common/FederatedProviderButtons/styles.js +16 -5
  67. package/lib/Authenticator/hooks/useFieldValues/useFieldValues.js +8 -8
  68. package/lib/Authenticator/hooks/useFieldValues/utils.js +2 -2
  69. package/lib/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.js +2 -2
  70. package/lib/InAppMessaging/hooks/useMessageImage/types.js +1 -1
  71. package/lib/InAppMessaging/hooks/useMessageImage/useMessageImage.js +5 -5
  72. package/lib/InAppMessaging/hooks/useMessageImage/utils.js +2 -2
  73. package/lib/InAppMessaging/index.js +1 -0
  74. package/lib/assets/icons/icons.ts +3 -0
  75. package/lib/primitives/Button/styles.js +4 -2
  76. package/lib/primitives/Carousel/Carousel.js +1 -11
  77. package/lib/primitives/Divider/styles.js +4 -3
  78. package/lib/primitives/ErrorMessage/ErrorMessage.js +2 -2
  79. package/lib/primitives/Icon/Icon.js +2 -1
  80. package/lib/primitives/Icon/styles.js +2 -2
  81. package/lib/primitives/Radio/styles.js +1 -1
  82. package/lib/primitives/RadioGroup/RadioGroup.js +2 -2
  83. package/lib/primitives/Tabs/Tabs.js +2 -2
  84. package/lib/primitives/Tabs/styles.js +3 -3
  85. package/lib/version.js +1 -1
  86. package/package.json +16 -31
  87. package/src/Authenticator/Authenticator.tsx +20 -17
  88. package/src/Authenticator/Defaults/{ResetPassword/ResetPassword.tsx → ForgotPassword/ForgotPassword.tsx} +3 -3
  89. package/src/Authenticator/Defaults/ForgotPassword/index.ts +1 -0
  90. package/src/Authenticator/Defaults/{SetupTOTP/SetupTOTP.tsx → SetupTotp/SetupTotp.tsx} +13 -13
  91. package/src/Authenticator/Defaults/SetupTotp/index.ts +1 -0
  92. package/src/Authenticator/Defaults/{SetupTOTP → SetupTotp}/styles.ts +2 -2
  93. package/src/Authenticator/Defaults/SignIn/SignIn.tsx +15 -3
  94. package/src/Authenticator/Defaults/SignUp/SignUp.tsx +12 -0
  95. package/src/Authenticator/Defaults/index.ts +2 -2
  96. package/src/Authenticator/Defaults/types.ts +13 -13
  97. package/src/Authenticator/common/FederatedProviderButton/FederatedProviderButton.tsx +2 -4
  98. package/src/Authenticator/common/FederatedProviderButton/types.ts +3 -1
  99. package/src/Authenticator/common/FederatedProviderButtons/FederatedProviderButtons.tsx +41 -13
  100. package/src/Authenticator/common/FederatedProviderButtons/styles.ts +19 -4
  101. package/src/Authenticator/common/FederatedProviderButtons/types.ts +9 -6
  102. package/src/Authenticator/hooks/useFieldValues/useFieldValues.ts +1 -1
  103. package/src/Authenticator/hooks/useFieldValues/utils.ts +1 -1
  104. package/src/Authenticator/types.ts +1 -4
  105. package/src/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.ts +2 -2
  106. package/src/InAppMessaging/hooks/useMessageImage/useMessageImage.ts +6 -6
  107. package/src/InAppMessaging/hooks/useMessageImage/utils.ts +5 -5
  108. package/src/InAppMessaging/hooks/useMessageProps/types.ts +3 -3
  109. package/src/InAppMessaging/hooks/useMessageProps/utils.ts +2 -2
  110. package/src/InAppMessaging/index.ts +9 -0
  111. package/src/assets/icons/icons.ts +3 -0
  112. package/src/hooks/useDeviceOrientation/useDeviceOrientation.ts +6 -1
  113. package/src/primitives/Button/styles.ts +4 -2
  114. package/src/primitives/Carousel/Carousel.tsx +1 -10
  115. package/src/primitives/Divider/styles.ts +4 -3
  116. package/src/primitives/ErrorMessage/ErrorMessage.tsx +4 -1
  117. package/src/primitives/Icon/Icon.tsx +2 -0
  118. package/src/primitives/Icon/styles.ts +1 -1
  119. package/src/primitives/Radio/styles.ts +1 -1
  120. package/src/primitives/RadioGroup/RadioGroup.tsx +6 -1
  121. package/src/primitives/Tabs/Tabs.tsx +4 -1
  122. package/src/primitives/Tabs/styles.ts +3 -3
  123. package/src/version.ts +1 -1
  124. package/dist/Authenticator/Defaults/ResetPassword/index.d.ts +0 -1
  125. package/dist/Authenticator/Defaults/ResetPassword/index.js +0 -1
  126. package/dist/Authenticator/Defaults/SetupTOTP/index.d.ts +0 -1
  127. package/dist/Authenticator/Defaults/SetupTOTP/index.js +0 -1
  128. package/dist/Authenticator/Defaults/SetupTOTP/styles.d.ts +0 -5
  129. package/dist/Authenticator/common/FederatedProviderButton/styles.d.ts +0 -2
  130. package/dist/Authenticator/common/FederatedProviderButton/styles.js +0 -18
  131. package/lib/Authenticator/Defaults/ResetPassword/index.js +0 -8
  132. package/lib/Authenticator/common/FederatedProviderButton/styles.js +0 -21
  133. package/src/Authenticator/Defaults/ResetPassword/index.ts +0 -1
  134. package/src/Authenticator/Defaults/SetupTOTP/index.ts +0 -1
  135. package/src/Authenticator/common/FederatedProviderButton/styles.ts +0 -21
  136. /package/dist/Authenticator/Defaults/{SetupTOTP → SetupTotp}/styles.js +0 -0
  137. /package/lib/Authenticator/Defaults/{SetupTOTP → SetupTotp}/styles.js +0 -0
@@ -7,7 +7,6 @@ import {
7
7
  View,
8
8
  ViewToken,
9
9
  } from 'react-native';
10
- import { isFunction } from '@aws-amplify/ui';
11
10
 
12
11
  import CarouselPageIndicator from './CarouselPageIndicator';
13
12
  import { VIEWABILITY_CONFIG } from './constants';
@@ -65,15 +64,7 @@ export default function Carousel<T>(
65
64
  orientationHandler
66
65
  );
67
66
 
68
- // Clean up listener. Dimensions.removeEventListener is deprecated as of React Native 0.65 but it is technically
69
- // available so try to remove via a `EmitterSubscription` first before falling back to `removeEventListener`
70
- return () => {
71
- if (isFunction(subscription?.remove)) {
72
- subscription.remove();
73
- } else {
74
- Dimensions.removeEventListener('change', orientationHandler);
75
- }
76
- };
67
+ return subscription.remove;
77
68
  }, [updateOrientation]);
78
69
 
79
70
  const carouselRenderItem = (renderInfo: ListRenderItemInfo<T>) => (
@@ -5,7 +5,7 @@ import { DividerStyles } from './types';
5
5
 
6
6
  export const getThemedStyles = (theme: StrictTheme): DividerStyles => {
7
7
  const { tokens, components } = theme;
8
- const { colors, fontSizes, space } = tokens;
8
+ const { colors, fontSizes, space, borderWidths } = tokens;
9
9
 
10
10
  return StyleSheet.create({
11
11
  container: {
@@ -17,12 +17,13 @@ export const getThemedStyles = (theme: StrictTheme): DividerStyles => {
17
17
  fontSize: fontSizes.medium,
18
18
  margin: space.medium,
19
19
  textAlign: 'center',
20
+ color: colors.font.tertiary,
20
21
  ...components?.divider?.label,
21
22
  },
22
23
  line: {
23
- backgroundColor: colors.black,
24
+ backgroundColor: colors.border.secondary,
24
25
  flex: 1,
25
- height: StyleSheet.hairlineWidth,
26
+ height: borderWidths.small,
26
27
  ...components?.divider?.line,
27
28
  },
28
29
  });
@@ -13,6 +13,8 @@ export const CLOSE_BUTTON_TEST_ID =
13
13
  'authenticator--error-message--close-button';
14
14
 
15
15
  export default function ErrorMessage({
16
+ accessible = true,
17
+ accessibilityRole = 'alert',
16
18
  children,
17
19
  iconStyle,
18
20
  labelStyle,
@@ -26,7 +28,8 @@ export default function ErrorMessage({
26
28
  return (
27
29
  <View
28
30
  {...rest}
29
- accessibilityRole="alert"
31
+ accessible={accessible}
32
+ accessibilityRole={accessibilityRole}
30
33
  style={[themedStyle.container, style]}
31
34
  >
32
35
  <Icon
@@ -6,6 +6,7 @@ import { getThemedStyles } from './styles';
6
6
  import { IconProps } from './types';
7
7
 
8
8
  export default function Icon({
9
+ accessible = true,
9
10
  accessibilityRole = 'image',
10
11
  animated,
11
12
  color,
@@ -21,6 +22,7 @@ export default function Icon({
21
22
 
22
23
  const imageProps: IconProps = {
23
24
  ...rest,
25
+ accessible,
24
26
  accessibilityRole,
25
27
  style: [themedStyle.icon, style],
26
28
  };
@@ -1,5 +1,5 @@
1
1
  import { StyleSheet } from 'react-native';
2
- import { ConsoleLogger as Logger } from '@aws-amplify/core';
2
+ import { ConsoleLogger as Logger } from 'aws-amplify/utils';
3
3
 
4
4
  import { StrictTheme } from '../../theme';
5
5
  import { IconProps, IconStyles } from './types';
@@ -35,7 +35,7 @@ export const getThemedStyles = (theme: StrictTheme): Required<RadioStyles> => {
35
35
  ...components?.radio?.radioContainer,
36
36
  },
37
37
  radioDot: {
38
- backgroundColor: colors.brand.primary[80],
38
+ backgroundColor: colors.primary[80],
39
39
  borderRadius: ROUNDED_BORDER_RADIUS,
40
40
  ...components?.radio?.radioDot,
41
41
  },
@@ -20,6 +20,7 @@ import { getThemedStyles } from './styles';
20
20
  import { RadioGroupProps } from './types';
21
21
 
22
22
  export default function RadioGroup<T>({
23
+ accessible = true,
23
24
  accessibilityRole = 'radiogroup',
24
25
  children,
25
26
  direction = 'vertical',
@@ -73,7 +74,11 @@ export default function RadioGroup<T>({
73
74
 
74
75
  return (
75
76
  <View {...rest} style={[themedStyle.container, containerStyle, style]}>
76
- <View accessibilityRole={accessibilityRole} style={childContainerStyle}>
77
+ <View
78
+ accessible={accessible}
79
+ accessibilityRole={accessibilityRole}
80
+ style={childContainerStyle}
81
+ >
77
82
  {Children.map(children, (child) => {
78
83
  if (isValidElement<RadioProps<T>>(child)) {
79
84
  const {
@@ -6,6 +6,8 @@ import { getThemedStyles } from './styles';
6
6
  import { TabProps, TabsProps } from './types';
7
7
 
8
8
  export default function Tabs({
9
+ accessible = true,
10
+ accessibilityRole = 'tablist',
9
11
  children,
10
12
  indicatorPosition = 'bottom',
11
13
  onChange,
@@ -23,7 +25,8 @@ export default function Tabs({
23
25
  return (
24
26
  <View
25
27
  {...rest}
26
- accessibilityRole="tablist"
28
+ accessible={accessible}
29
+ accessibilityRole={accessibilityRole}
27
30
  style={[themedStyle.tabList, style]}
28
31
  >
29
32
  {Children.map(children, (child, index) => {
@@ -16,11 +16,11 @@ export const getThemedStyles = (
16
16
  const tabBorderStyles: ViewStyle = {};
17
17
 
18
18
  if (indicatorPosition && indicatorPosition === 'top') {
19
- selectedTabBorderStyles.borderTopColor = colors.brand.primary[80];
19
+ selectedTabBorderStyles.borderTopColor = colors.primary[80];
20
20
  tabBorderStyles.borderTopWidth = borderWidths.medium;
21
21
  tabBorderStyles.borderTopColor = colors.border.secondary;
22
22
  } else {
23
- selectedTabBorderStyles.borderBottomColor = colors.brand.primary[80];
23
+ selectedTabBorderStyles.borderBottomColor = colors.primary[80];
24
24
  tabBorderStyles.borderBottomWidth = borderWidths.medium;
25
25
  tabBorderStyles.borderBottomColor = colors.border.secondary;
26
26
  }
@@ -58,7 +58,7 @@ export const getThemedStyles = (
58
58
  },
59
59
  selected: {
60
60
  backgroundColor: colors.background.primary,
61
- color: colors.brand.primary[80],
61
+ color: colors.primary[80],
62
62
  ...selectedTabBorderStyles,
63
63
  ...components?.tabs?.selected,
64
64
  },
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.2.27';
1
+ export const VERSION = '1.2.28';
@@ -1 +0,0 @@
1
- export { default as ResetPassword } from './ResetPassword';
@@ -1 +0,0 @@
1
- export { default as ResetPassword } from './ResetPassword';
@@ -1 +0,0 @@
1
- export { default as SetupTOTP } from './SetupTOTP';
@@ -1 +0,0 @@
1
- export { default as SetupTOTP } from './SetupTOTP';
@@ -1,5 +0,0 @@
1
- import { TextStyle } from 'react-native';
2
- export interface SetupTOTPStyle {
3
- secretKeyText: TextStyle;
4
- }
5
- export declare const styles: SetupTOTPStyle;
@@ -1,2 +0,0 @@
1
- import { FederatedProviderButtonStyles } from './types';
2
- export declare const styles: FederatedProviderButtonStyles;
@@ -1,18 +0,0 @@
1
- import { StyleSheet } from 'react-native';
2
- export const styles = StyleSheet.create({
3
- container: {
4
- alignItems: 'center',
5
- borderRadius: 4,
6
- borderWidth: StyleSheet.hairlineWidth,
7
- flexDirection: 'row',
8
- justifyContent: 'center',
9
- paddingVertical: 8,
10
- width: '100%',
11
- },
12
- icon: {
13
- paddingHorizontal: 16,
14
- },
15
- label: {
16
- fontWeight: '400',
17
- },
18
- });
@@ -1,8 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ResetPassword = void 0;
7
- var ResetPassword_1 = require("./ResetPassword");
8
- Object.defineProperty(exports, "ResetPassword", { enumerable: true, get: function () { return __importDefault(ResetPassword_1).default; } });
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.styles = void 0;
4
- const react_native_1 = require("react-native");
5
- exports.styles = react_native_1.StyleSheet.create({
6
- container: {
7
- alignItems: 'center',
8
- borderRadius: 4,
9
- borderWidth: react_native_1.StyleSheet.hairlineWidth,
10
- flexDirection: 'row',
11
- justifyContent: 'center',
12
- paddingVertical: 8,
13
- width: '100%',
14
- },
15
- icon: {
16
- paddingHorizontal: 16,
17
- },
18
- label: {
19
- fontWeight: '400',
20
- },
21
- });
@@ -1 +0,0 @@
1
- export { default as ResetPassword } from './ResetPassword';
@@ -1 +0,0 @@
1
- export { default as SetupTOTP } from './SetupTOTP';
@@ -1,21 +0,0 @@
1
- import { StyleSheet } from 'react-native';
2
-
3
- import { FederatedProviderButtonStyles } from './types';
4
-
5
- export const styles: FederatedProviderButtonStyles = StyleSheet.create({
6
- container: {
7
- alignItems: 'center',
8
- borderRadius: 4,
9
- borderWidth: StyleSheet.hairlineWidth,
10
- flexDirection: 'row',
11
- justifyContent: 'center',
12
- paddingVertical: 8,
13
- width: '100%',
14
- },
15
- icon: {
16
- paddingHorizontal: 16,
17
- },
18
- label: {
19
- fontWeight: '400',
20
- },
21
- });