@aws-amplify/ui-react-native 1.2.13 → 1.2.15

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 (42) hide show
  1. package/.eslintrc.js +2 -2
  2. package/CHANGELOG.md +20 -0
  3. package/dist/Authenticator/Defaults/types.d.ts +22 -22
  4. package/dist/Authenticator/common/DefaultContainer/types.d.ts +1 -2
  5. package/dist/Authenticator/common/DefaultContent/types.d.ts +5 -5
  6. package/dist/Authenticator/common/DefaultFormFields/types.d.ts +4 -4
  7. package/dist/Authenticator/hooks/types.d.ts +12 -12
  8. package/dist/Authenticator/hooks/useFieldValues/types.d.ts +1 -1
  9. package/dist/Authenticator/hooks/useFieldValues/utils.js +3 -2
  10. package/dist/Authenticator/types.d.ts +2 -2
  11. package/dist/InAppMessaging/components/InAppMessageDisplay/types.d.ts +4 -4
  12. package/dist/InAppMessaging/hooks/useMessageImage/types.d.ts +3 -3
  13. package/dist/InAppMessaging/hooks/useMessageProps/types.d.ts +1 -1
  14. package/dist/hooks/useDeviceOrientation/useDeviceOrientation.d.ts +1 -1
  15. package/dist/primitives/Button/types.d.ts +1 -1
  16. package/dist/primitives/Heading/types.d.ts +2 -2
  17. package/dist/primitives/Icon/types.d.ts +2 -2
  18. package/dist/primitives/Label/types.d.ts +2 -2
  19. package/dist/primitives/Radio/types.d.ts +2 -2
  20. package/dist/primitives/RadioGroup/types.d.ts +1 -1
  21. package/dist/primitives/Tabs/types.d.ts +1 -1
  22. package/dist/primitives/TextField/TextField.js +2 -2
  23. package/dist/theme/types.d.ts +7 -7
  24. package/dist/version.d.ts +1 -1
  25. package/dist/version.js +1 -1
  26. package/package.json +4 -4
  27. package/src/Authenticator/Defaults/ConfirmResetPassword/__tests__/__snapshots__/ConfirmResetPassword.spec.tsx.snap +0 -6
  28. package/src/Authenticator/Defaults/ConfirmSignIn/__tests__/__snapshots__/ConfirmSignIn.spec.tsx.snap +0 -2
  29. package/src/Authenticator/Defaults/ForceNewPassword/__tests__/__snapshots__/ForceNewPassword.spec.tsx.snap +0 -3
  30. package/src/Authenticator/Defaults/ResetPassword/__tests__/__snapshots__/ResetPassword.spec.tsx.snap +0 -2
  31. package/src/Authenticator/Defaults/SetupTOTP/__tests__/__snapshots__/SetupTOTP.spec.tsx.snap +0 -2
  32. package/src/Authenticator/Defaults/SignIn/__tests__/__snapshots__/SignIn.spec.tsx.snap +0 -6
  33. package/src/Authenticator/Defaults/SignUp/__tests__/__snapshots__/SignUp.spec.tsx.snap +0 -20
  34. package/src/Authenticator/__tests__/Authenticator.spec.tsx +1 -1
  35. package/src/Authenticator/common/DefaultContainer/types.ts +0 -1
  36. package/src/Authenticator/hooks/useFieldValues/__tests__/utils.spec.ts +10 -2
  37. package/src/Authenticator/hooks/useFieldValues/utils.ts +3 -2
  38. package/src/primitives/PasswordField/__tests__/__snapshots__/PasswordField.spec.tsx.snap +0 -5
  39. package/src/primitives/PhoneNumberField/__tests__/__snapshots__/PhoneNumberField.spec.tsx.snap +0 -3
  40. package/src/primitives/TextField/TextField.tsx +1 -2
  41. package/src/primitives/TextField/__tests__/__snapshots__/TextField.spec.tsx.snap +0 -6
  42. package/src/version.ts +1 -1
package/.eslintrc.js CHANGED
@@ -1,9 +1,9 @@
1
1
  module.exports = {
2
2
  ignorePatterns: ['dist', '.eslintrc.js', '*.config.js', 'jest.setup.js'],
3
- extends: ['amplify-ui/react'],
3
+ extends: ['@aws-amplify/amplify-ui/react'],
4
4
  overrides: [
5
5
  {
6
- extends: ['amplify-ui/jest'],
6
+ extends: ['@aws-amplify/amplify-ui/jest'],
7
7
  files: ['**/__mocks__/**', '**/__tests__/**'],
8
8
  },
9
9
  ],
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @aws-amplify/ui-react-native
2
2
 
3
+ ## 1.2.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`4ca838978`](https://github.com/aws-amplify/amplify-ui/commit/4ca838978d23a086f80859a7cb57f184ff49e2d4), [`d6a3676f2`](https://github.com/aws-amplify/amplify-ui/commit/d6a3676f2295ed39fa83b9d31a9540f3437ba129), [`37d63424e`](https://github.com/aws-amplify/amplify-ui/commit/37d63424e23e971713f76d201ce829ec6974fc54)]:
8
+ - @aws-amplify/ui@5.6.1
9
+ - @aws-amplify/ui-react-core@2.1.20
10
+
11
+ ## 1.2.14
12
+
13
+ ### Patch Changes
14
+
15
+ - [#3654](https://github.com/aws-amplify/amplify-ui/pull/3654) [`579ace564`](https://github.com/aws-amplify/amplify-ui/commit/579ace564ef85c4ec465b4ddfed38587c2669140) Thanks [@calebpollman](https://github.com/calebpollman)! - fix(ui-react-native): remove themed selectionColor from TextField
16
+
17
+ - [#3674](https://github.com/aws-amplify/amplify-ui/pull/3674) [`2ad7c2f5b`](https://github.com/aws-amplify/amplify-ui/commit/2ad7c2f5b9b04b8beb4f1f9746cbdc5d37285851) Thanks [@calebpollman](https://github.com/calebpollman)! - chore(ui-react-native): loosen Authenticator.Container children prop, update docs
18
+
19
+ - Updated dependencies [[`bc3fd6d95`](https://github.com/aws-amplify/amplify-ui/commit/bc3fd6d951b1ab1b188722f59ce04118d04d16af), [`747516159`](https://github.com/aws-amplify/amplify-ui/commit/747516159d504b551dab09cbe8f214fa7b4505df)]:
20
+ - @aws-amplify/ui@5.6.0
21
+ - @aws-amplify/ui-react-core@2.1.19
22
+
3
23
  ## 1.2.13
4
24
 
5
25
  ### Patch Changes
@@ -20,69 +20,69 @@ export interface SignUpStyle {
20
20
  }
21
21
  export interface VerifyUserStyle {
22
22
  }
23
- export declare type DefaultComponents<FieldType = {}, Props = {}> = AuthenticatorComponentDefaults<FieldType, Props>;
24
- export declare type DefaultConfirmResetPasswordComponent = DefaultComponents<TextFieldOptionsType, {
23
+ export type DefaultComponents<FieldType = {}, Props = {}> = AuthenticatorComponentDefaults<FieldType, Props>;
24
+ export type DefaultConfirmResetPasswordComponent = DefaultComponents<TextFieldOptionsType, {
25
25
  style?: ConfirmResetPasswordStyle;
26
26
  }>['ConfirmResetPassword'];
27
- export declare type DefaultConfirmSignInComponent = DefaultComponents<TextFieldOptionsType, {
27
+ export type DefaultConfirmSignInComponent = DefaultComponents<TextFieldOptionsType, {
28
28
  style?: ConfirmSignInStyle;
29
29
  }>['ConfirmSignIn'];
30
- export declare type DefaultConfirmSignUpComponent = DefaultComponents<TextFieldOptionsType, {
30
+ export type DefaultConfirmSignUpComponent = DefaultComponents<TextFieldOptionsType, {
31
31
  style?: ConfirmSignUpStyle;
32
32
  }>['ConfirmSignUp'];
33
- export declare type DefaultConfirmVerifyUserComponent = DefaultComponents<TextFieldOptionsType, {
33
+ export type DefaultConfirmVerifyUserComponent = DefaultComponents<TextFieldOptionsType, {
34
34
  style?: ConfirmVerifyUserStyle;
35
35
  }>['ConfirmVerifyUser'];
36
- export declare type DefaultForceNewPasswordComponent = DefaultComponents<TextFieldOptionsType, {
36
+ export type DefaultForceNewPasswordComponent = DefaultComponents<TextFieldOptionsType, {
37
37
  style?: ForceNewPasswordStyle;
38
38
  }>['ForceNewPassword'];
39
- export declare type DefaultResetPasswordComponent = DefaultComponents<TextFieldOptionsType, {
39
+ export type DefaultResetPasswordComponent = DefaultComponents<TextFieldOptionsType, {
40
40
  style?: ResetPasswordStyle;
41
41
  }>['ResetPassword'];
42
- export declare type DefaultSetupTOTPComponent = DefaultComponents<TextFieldOptionsType, {
42
+ export type DefaultSetupTOTPComponent = DefaultComponents<TextFieldOptionsType, {
43
43
  style?: SetupTOTPStyle;
44
44
  }>['SetupTOTP'];
45
- export declare type DefaultSignInComponent = DefaultComponents<TextFieldOptionsType, {
45
+ export type DefaultSignInComponent = DefaultComponents<TextFieldOptionsType, {
46
46
  style?: SignInStyle;
47
47
  }>['SignIn'];
48
- export declare type DefaultSignUpComponent = DefaultComponents<TextFieldOptionsType, {
48
+ export type DefaultSignUpComponent = DefaultComponents<TextFieldOptionsType, {
49
49
  style?: SignUpStyle;
50
50
  }>['SignUp'];
51
- export declare type DefaultVerifyUserComponent = DefaultComponents<RadioFieldOptions, {
51
+ export type DefaultVerifyUserComponent = DefaultComponents<RadioFieldOptions, {
52
52
  style?: VerifyUserStyle;
53
53
  }>['VerifyUser'];
54
54
  /**
55
55
  * Custom Authenticator components
56
56
  */
57
- declare type OverrideComponents<FieldType = {}, Props = {}> = AuthenticatorComponentOverrides<FieldType, Props>;
58
- declare type ConfirmSignInComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
57
+ type OverrideComponents<FieldType = {}, Props = {}> = AuthenticatorComponentOverrides<FieldType, Props>;
58
+ type ConfirmSignInComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
59
59
  style?: ConfirmSignInStyle;
60
60
  } & P>['ConfirmSignIn'];
61
- declare type ConfirmSignUpComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
61
+ type ConfirmSignUpComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
62
62
  style?: ConfirmSignUpStyle;
63
63
  } & P>['ConfirmSignUp'];
64
- declare type ConfirmResetPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
64
+ type ConfirmResetPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
65
65
  style?: ConfirmResetPasswordStyle;
66
66
  } & P>['ConfirmResetPassword'];
67
- declare type ConfirmVerifyUserComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
67
+ type ConfirmVerifyUserComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
68
68
  style?: ConfirmVerifyUserStyle;
69
69
  } & P>['ConfirmVerifyUser'];
70
- declare type ForceNewPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
70
+ type ForceNewPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
71
71
  style?: ForceNewPasswordStyle;
72
72
  } & P>['ForceNewPassword'];
73
- declare type ResetPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
73
+ type ResetPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
74
74
  style?: ResetPasswordStyle;
75
75
  } & P>['ResetPassword'];
76
- declare type SetupTOTPComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
76
+ type SetupTOTPComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
77
77
  style?: SetupTOTPStyle;
78
78
  } & P>['SetupTOTP'];
79
- declare type SignInComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
79
+ type SignInComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
80
80
  style?: SignInStyle;
81
81
  } & P>['SignIn'];
82
- declare type SignUpComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
82
+ type SignUpComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
83
83
  style?: SignUpStyle;
84
84
  } & P>['SignUp'];
85
- declare type VerifyUserComponent<P = {}> = OverrideComponents<RadioFieldOptions, {
85
+ type VerifyUserComponent<P = {}> = OverrideComponents<RadioFieldOptions, {
86
86
  style?: VerifyUserStyle;
87
87
  } & P>['VerifyUser'];
88
88
  /**
@@ -6,11 +6,10 @@ export interface ContainerStyles {
6
6
  scrollView?: ViewStyle;
7
7
  }
8
8
  export interface ContainerProps extends ScrollViewProps, Pick<KeyboardAvoidingViewProps, 'behavior' | 'keyboardVerticalOffset'> {
9
- children: React.ReactNode;
10
9
  keyboardAvoidingViewStyle?: StyleProp<ViewStyle>;
11
10
  scrollViewContentContainerStyle?: StyleProp<ViewStyle>;
12
11
  }
13
- export declare type DefaultContainerComponent<P = {}> = React.ComponentType<ContainerProps & P>;
12
+ export type DefaultContainerComponent<P = {}> = React.ComponentType<ContainerProps & P>;
14
13
  export interface InnerContainerStyles {
15
14
  container: ViewStyle;
16
15
  }
@@ -24,19 +24,19 @@ export interface DefaultContentStyle {
24
24
  link?: ViewStyle;
25
25
  linksContainer?: ViewStyle;
26
26
  }
27
- export declare type DefaultContentStyleProps = {
27
+ export type DefaultContentStyleProps = {
28
28
  [Key in keyof DefaultContentStyle]: StyleProp<DefaultContentStyle[Key]>;
29
29
  } & DefaultFormFieldsStyle;
30
- declare type DefaultComponentProps<FieldsType> = AuthenticatorComponentDefaultProps<FieldsType>[AuthenticatorRouteComponentName];
31
- declare type AuthenticatorButtonProps = Omit<ButtonProps, 'children'> & {
30
+ type DefaultComponentProps<FieldsType> = AuthenticatorComponentDefaultProps<FieldsType>[AuthenticatorRouteComponentName];
31
+ type AuthenticatorButtonProps = Omit<ButtonProps, 'children'> & {
32
32
  children: string;
33
33
  };
34
- declare type DefaultButtons = {
34
+ type DefaultButtons = {
35
35
  primary: AuthenticatorButtonProps;
36
36
  secondary?: AuthenticatorButtonProps;
37
37
  links?: AuthenticatorButtonProps[];
38
38
  };
39
- export declare type DefaultContentProps<FieldsType extends TextFieldOptionsType | RadioFieldOptions | unknown = unknown> = Pick<DefaultComponentProps<FieldsType>, 'error' | 'Footer' | 'isPending'> & {
39
+ export type DefaultContentProps<FieldsType extends TextFieldOptionsType | RadioFieldOptions | unknown = unknown> = Pick<DefaultComponentProps<FieldsType>, 'error' | 'Footer' | 'isPending'> & {
40
40
  buttons: DefaultButtons;
41
41
  body?: React.ReactNode;
42
42
  fields: FieldsType[];
@@ -1,7 +1,7 @@
1
1
  import { StyleProp, TextStyle, ViewStyle } from 'react-native';
2
2
  import { AuthenticatorFormFieldsComponent } from '@aws-amplify/ui-react-core';
3
3
  import { RadioFieldOptions, TextFieldOptionsType } from '../../hooks';
4
- export declare type FieldProps = Omit<TextFieldOptionsType, 'name'> & {
4
+ export type FieldProps = Omit<TextFieldOptionsType, 'name'> & {
5
5
  disabled: boolean;
6
6
  };
7
7
  export interface FieldErrorsProps {
@@ -17,6 +17,6 @@ export interface DefaultFormFieldsStyle {
17
17
  fieldStyle?: StyleProp<TextStyle>;
18
18
  style?: StyleProp<ViewStyle>;
19
19
  }
20
- export declare type DefaultFormFieldsComponent<FieldsType> = AuthenticatorFormFieldsComponent<FieldsType, DefaultFormFieldsStyle>;
21
- export declare type DefaultTextFormFieldsComponent = DefaultFormFieldsComponent<TextFieldOptionsType>;
22
- export declare type DefaultRadioFormFieldsComponent = DefaultFormFieldsComponent<RadioFieldOptions>;
20
+ export type DefaultFormFieldsComponent<FieldsType> = AuthenticatorFormFieldsComponent<FieldsType, DefaultFormFieldsStyle>;
21
+ export type DefaultTextFormFieldsComponent = DefaultFormFieldsComponent<TextFieldOptionsType>;
22
+ export type DefaultRadioFormFieldsComponent = DefaultFormFieldsComponent<RadioFieldOptions>;
@@ -1,24 +1,24 @@
1
1
  import { TextFieldProps, PasswordFieldProps, PhoneNumberFieldProps, RadioProps } from '../../primitives';
2
- export declare type MachineFieldTypeKey = 'password' | 'tel';
3
- export declare type AuthenticatorFieldTypeKey = 'password' | 'phone' | 'default' | 'radio';
4
- declare type RadioFieldOnBlur = RadioProps<string>['onBlur'];
5
- export declare type TextFieldOnBlur = TextFieldProps['onBlur'];
6
- export declare type OnChangeText = TextFieldProps['onChangeText'];
7
- declare type FieldOptions<FieldProps, Type extends AuthenticatorFieldTypeKey> = {
2
+ export type MachineFieldTypeKey = 'password' | 'tel';
3
+ export type AuthenticatorFieldTypeKey = 'password' | 'phone' | 'default' | 'radio';
4
+ type RadioFieldOnBlur = RadioProps<string>['onBlur'];
5
+ export type TextFieldOnBlur = TextFieldProps['onBlur'];
6
+ export type OnChangeText = TextFieldProps['onChangeText'];
7
+ type FieldOptions<FieldProps, Type extends AuthenticatorFieldTypeKey> = {
8
8
  name: string;
9
9
  onBlur?: Type extends 'radio' ? RadioFieldOnBlur : TextFieldOnBlur;
10
10
  required?: boolean;
11
11
  type: Type;
12
12
  } & Omit<FieldProps, 'disabled' | 'onBlur'>;
13
- declare type PasswordFieldOptions = FieldOptions<PasswordFieldProps, 'password'>;
14
- declare type PhoneFieldOptions = FieldOptions<PhoneNumberFieldProps, 'phone'>;
15
- declare type DefaultFieldOptions = FieldOptions<TextFieldProps, 'default'>;
16
- export declare type TextFieldOptionsType = (PasswordFieldOptions | PhoneFieldOptions | DefaultFieldOptions) & {
13
+ type PasswordFieldOptions = FieldOptions<PasswordFieldProps, 'password'>;
14
+ type PhoneFieldOptions = FieldOptions<PhoneNumberFieldProps, 'phone'>;
15
+ type DefaultFieldOptions = FieldOptions<TextFieldProps, 'default'>;
16
+ export type TextFieldOptionsType = (PasswordFieldOptions | PhoneFieldOptions | DefaultFieldOptions) & {
17
17
  labelHidden?: boolean;
18
18
  };
19
- export declare type RadioFieldOptions = FieldOptions<RadioProps<string>, 'radio'>;
19
+ export type RadioFieldOptions = FieldOptions<RadioProps<string>, 'radio'>;
20
20
  /**
21
21
  * `field` options union
22
22
  */
23
- export declare type TypedField = RadioFieldOptions | TextFieldOptionsType;
23
+ export type TypedField = RadioFieldOptions | TextFieldOptionsType;
24
24
  export {};
@@ -1,6 +1,6 @@
1
1
  import { AuthenticatorComponentDefaultProps, AuthenticatorRouteComponentName } from '@aws-amplify/ui-react-core';
2
2
  import { TypedField } from '../types';
3
- export declare type MachineEventHandlers = Pick<AuthenticatorComponentDefaultProps[AuthenticatorRouteComponentName], 'handleBlur' | 'handleChange' | 'handleSubmit'>;
3
+ export type MachineEventHandlers = Pick<AuthenticatorComponentDefaultProps[AuthenticatorRouteComponentName], 'handleBlur' | 'handleChange' | 'handleSubmit'>;
4
4
  export interface UseFieldValuesParams<FieldType extends TypedField> {
5
5
  componentName: AuthenticatorRouteComponentName;
6
6
  fields: FieldType[];
@@ -66,6 +66,7 @@ const getFieldType = (type) => {
66
66
  */
67
67
  export const getTypedField = ({ type: machineFieldType, name, ...field }) => {
68
68
  const type = getFieldType(machineFieldType);
69
+ const testID = `authenticator__text-field__input-${name}`;
69
70
  return Object.entries(field).reduce((acc, [key, value]) => {
70
71
  // early return if key is not allowed
71
72
  if (!isKeyAllowed(key)) {
@@ -74,9 +75,9 @@ export const getTypedField = ({ type: machineFieldType, name, ...field }) => {
74
75
  // map to `required` prop
75
76
  if (key === 'isRequired' || key === 'required') {
76
77
  // `TypedField` props expects `required` key
77
- return { ...acc, required: value };
78
+ return { ...acc, required: value, testID };
78
79
  }
79
- return { ...acc, [key]: value };
80
+ return { ...acc, [key]: value, testID };
80
81
  },
81
82
  // initialize `acc` with field `name` and `type`
82
83
  { name, type });
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { AuthenticatorMachineOptions } from '@aws-amplify/ui';
3
3
  import { DefaultContainerComponent } from './common';
4
4
  import { Components } from './Defaults';
5
- declare type SupportedAuthenticatorMachineOptions = Omit<AuthenticatorMachineOptions, 'socialProviders' | 'formFields'>;
5
+ type SupportedAuthenticatorMachineOptions = Omit<AuthenticatorMachineOptions, 'socialProviders' | 'formFields'>;
6
6
  export interface AuthenticatorProps extends SupportedAuthenticatorMachineOptions {
7
7
  children?: React.ReactNode;
8
8
  Container?: DefaultContainerComponent;
@@ -10,5 +10,5 @@ export interface AuthenticatorProps extends SupportedAuthenticatorMachineOptions
10
10
  Header?: React.ComponentType;
11
11
  components?: Components;
12
12
  }
13
- export declare type WithAuthenticatorOptions = Omit<AuthenticatorProps, 'children'>;
13
+ export type WithAuthenticatorOptions = Omit<AuthenticatorProps, 'children'>;
14
14
  export {};
@@ -3,10 +3,10 @@ import { BannerMessageProps } from '../BannerMessage';
3
3
  import { CarouselMessageProps } from '../CarouselMessage';
4
4
  import { FullScreenMessageProps } from '../FullScreenMessage';
5
5
  import { ModalMessageProps } from '../ModalMessage';
6
- declare type BannerStyle = BannerMessageProps['style'];
7
- declare type CarouselStyle = CarouselMessageProps['style'];
8
- declare type FullScreenStyle = FullScreenMessageProps['style'];
9
- declare type ModalStyle = ModalMessageProps['style'];
6
+ type BannerStyle = BannerMessageProps['style'];
7
+ type CarouselStyle = CarouselMessageProps['style'];
8
+ type FullScreenStyle = FullScreenMessageProps['style'];
9
+ type ModalStyle = ModalMessageProps['style'];
10
10
  export interface MessageDefaultComponents {
11
11
  BannerMessage: BannerMessageComponent<BannerStyle>;
12
12
  CarouselMessage: CarouselMessageComponent<CarouselStyle>;
@@ -1,14 +1,14 @@
1
- export declare type ImageDimensions = {
1
+ export type ImageDimensions = {
2
2
  height: number | undefined;
3
3
  width: number | undefined;
4
4
  };
5
- export declare type ImageLoadingState = 'loaded' | 'failed';
5
+ export type ImageLoadingState = 'loaded' | 'failed';
6
6
  export declare enum ImagePrefetchStatus {
7
7
  Failure = "FAILURE",
8
8
  Fetching = "FETCHING",
9
9
  Success = "SUCCESS"
10
10
  }
11
- export declare type UseMessageImage = {
11
+ export type UseMessageImage = {
12
12
  hasRenderableImage: boolean;
13
13
  imageDimensions: ImageDimensions;
14
14
  isImageFetching: boolean;
@@ -22,7 +22,7 @@ export interface MessageComponentStyles {
22
22
  textContainer: StyleProp<ViewStyle>;
23
23
  wrapper: StyleProp<ViewStyle>;
24
24
  }
25
- export declare type GetDefaultStyle<AdditionalStyle = unknown> = (imageDimensions: ImageDimensions, additionalStyle?: AdditionalStyle) => MessageDefaultStyle;
25
+ export type GetDefaultStyle<AdditionalStyle = unknown> = (imageDimensions: ImageDimensions, additionalStyle?: AdditionalStyle) => MessageDefaultStyle;
26
26
  export interface UseMessageProps {
27
27
  hasButtons: boolean;
28
28
  hasPrimaryButton: boolean;
@@ -1,4 +1,4 @@
1
- export declare type DeviceOrientation = 'portrait' | 'landscape';
1
+ export type DeviceOrientation = 'portrait' | 'landscape';
2
2
  export default function useDeviceOrientation(): {
3
3
  deviceOrientation: DeviceOrientation;
4
4
  isLandscapeMode: boolean;
@@ -1,5 +1,5 @@
1
1
  import { PressableProps, StyleProp, TextStyle, ViewStyle } from 'react-native';
2
- export declare type ButtonVariant = 'primary' | 'default' | 'link';
2
+ export type ButtonVariant = 'primary' | 'default' | 'link';
3
3
  export interface ButtonProps extends PressableProps {
4
4
  textStyle?: StyleProp<TextStyle>;
5
5
  variant?: ButtonVariant;
@@ -1,9 +1,9 @@
1
1
  import { TextProps, TextStyle } from 'react-native';
2
- declare type Level = 1 | 2 | 3 | 4 | 5 | 6;
2
+ type Level = 1 | 2 | 3 | 4 | 5 | 6;
3
3
  export interface HeadingProps extends TextProps {
4
4
  level?: Level;
5
5
  }
6
- export declare type HeadingStyles = {
6
+ export type HeadingStyles = {
7
7
  text?: TextStyle;
8
8
  } & {
9
9
  [key in Level]: TextStyle;
@@ -1,6 +1,6 @@
1
1
  import { ColorValue, ImageProps, ImageStyle } from 'react-native';
2
- export declare type Size = 'xs' | 'small' | 'medium' | 'large' | 'xl';
3
- export declare type IconSizes = Record<Size, number>;
2
+ export type Size = 'xs' | 'small' | 'medium' | 'large' | 'xl';
3
+ export type IconSizes = Record<Size, number>;
4
4
  export interface IconStyles {
5
5
  icon?: ImageStyle;
6
6
  }
@@ -6,8 +6,8 @@ export interface LabelProps extends TextProps {
6
6
  */
7
7
  variant?: LabelVariant;
8
8
  }
9
- export declare type LabelPosition = 'start' | 'end' | 'top' | 'bottom';
10
- export declare type LabelVariant = 'primary' | 'secondary' | 'tertiary' | 'error' | 'warning' | 'info' | 'success';
9
+ export type LabelPosition = 'start' | 'end' | 'top' | 'bottom';
10
+ export type LabelVariant = 'primary' | 'secondary' | 'tertiary' | 'error' | 'warning' | 'info' | 'success';
11
11
  export interface LabelStyles {
12
12
  text?: TextStyle;
13
13
  primary?: TextStyle;
@@ -1,6 +1,6 @@
1
1
  import { PressableProps, StyleProp, TextStyle, ViewStyle } from 'react-native';
2
2
  import { LabelPosition } from '../Label/types';
3
- export declare type Size = number | 'small' | 'medium' | 'large';
3
+ export type Size = number | 'small' | 'medium' | 'large';
4
4
  export interface RadioProps<T> extends PressableProps {
5
5
  disabled?: boolean;
6
6
  label?: string;
@@ -13,7 +13,7 @@ export interface RadioProps<T> extends PressableProps {
13
13
  selected?: boolean;
14
14
  value: T;
15
15
  }
16
- export declare type RadioDimensions = Pick<ViewStyle, 'height' | 'width'>;
16
+ export type RadioDimensions = Pick<ViewStyle, 'height' | 'width'>;
17
17
  export interface RadioStyles {
18
18
  container?: ViewStyle;
19
19
  disabled?: ViewStyle;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { TextStyle, ViewProps, ViewStyle } from 'react-native';
3
3
  import { RadioProps } from '../Radio';
4
- export declare type Direction = 'vertical' | 'horizontal';
4
+ export type Direction = 'vertical' | 'horizontal';
5
5
  export interface RadioGroupProps<T> extends Pick<RadioProps<T>, 'accessibilityRole' | 'disabled' | 'label' | 'labelPosition' | 'labelStyle' | 'onChange' | 'size'>, ViewProps {
6
6
  children: React.ReactElement<RadioProps<T>>[];
7
7
  direction?: Direction;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { TextStyle, ViewProps, ViewStyle } from 'react-native';
3
3
  import { ButtonProps } from '../Button';
4
- declare type IndicatorPosition = 'top' | 'bottom';
4
+ type IndicatorPosition = 'top' | 'bottom';
5
5
  export interface TabsProps extends ViewProps {
6
6
  /**
7
7
  * @description
@@ -7,7 +7,7 @@ export const TEXTFIELD_CONTAINER_TEST_ID = 'amplify__text-field-container';
7
7
  export const INPUT_CONTAINER_TEST_ID = 'amplify__text-field__input-container';
8
8
  export default function TextField({ accessibilityLabel, accessibilityRole, accessibilityState, accessible = true, autoCapitalize = 'none', disabled, endAccessory, error, errorMessage, errorMessageStyle, fieldStyle, label, labelStyle, style, ...rest }) {
9
9
  const theme = useTheme();
10
- const themedStyle = getThemedStyles(theme);
10
+ const themedStyle = useMemo(() => getThemedStyles(theme), [theme]);
11
11
  const fieldContainerStyle = useMemo(() => ({
12
12
  ...themedStyle.fieldContainer,
13
13
  ...(disabled && themedStyle.disabled),
@@ -17,7 +17,7 @@ export default function TextField({ accessibilityLabel, accessibilityRole, acces
17
17
  {label}
18
18
  </Label>) : null}
19
19
  <View accessible style={fieldContainerStyle} testID={INPUT_CONTAINER_TEST_ID}>
20
- <TextInput {...rest} accessible={accessible} accessibilityLabel={label ? undefined : accessibilityLabel} accessibilityRole={accessibilityRole} accessibilityState={{ disabled, ...accessibilityState }} autoCapitalize={autoCapitalize} editable={!disabled} placeholderTextColor={theme.tokens.colors.font.tertiary} selectionColor={theme.tokens.colors.font.primary} style={[themedStyle.field, fieldStyle]}/>
20
+ <TextInput {...rest} accessible={accessible} accessibilityLabel={label ? undefined : accessibilityLabel} accessibilityRole={accessibilityRole} accessibilityState={{ disabled, ...accessibilityState }} autoCapitalize={autoCapitalize} editable={!disabled} placeholderTextColor={theme.tokens.colors.font.tertiary} style={[themedStyle.field, fieldStyle]}/>
21
21
  {endAccessory ?? null}
22
22
  </View>
23
23
  {error && errorMessage ? (<Label style={errorMessageStyle}>{errorMessage}</Label>) : null}
@@ -1,7 +1,7 @@
1
1
  import { ReactNativeTokens } from '@aws-amplify/ui';
2
2
  import { ButtonStyles, CheckboxStyles, DividerStyles, ErrorMessageStyles, HeadingStyles, IconStyles, IconButtonStyles, LabelStyles, PasswordFieldStyles, PhoneNumberFieldStyles, RadioStyles, RadioGroupStyles, TabsStyles, TextFieldStyles } from '../primitives';
3
- declare type ComponentTheme<ComponentType, Output> = Output extends 'output' ? ComponentType : ((tokens: StrictTheme['tokens']) => ComponentType) | ComponentType;
4
- export declare type Components<Output> = Record<string, object> & {
3
+ type ComponentTheme<ComponentType, Output> = Output extends 'output' ? ComponentType : ((tokens: StrictTheme['tokens']) => ComponentType) | ComponentType;
4
+ export type Components<Output> = Record<string, object> & {
5
5
  button?: ComponentTheme<ButtonStyles, Output>;
6
6
  checkbox?: ComponentTheme<CheckboxStyles, Output>;
7
7
  divider?: ComponentTheme<DividerStyles, Output>;
@@ -17,13 +17,13 @@ export declare type Components<Output> = Record<string, object> & {
17
17
  tabs?: ComponentTheme<TabsStyles, Output>;
18
18
  textField?: ComponentTheme<TextFieldStyles, Output>;
19
19
  };
20
- export declare type ColorMode = 'light' | 'dark' | 'system' | null;
21
- export declare type Override = Omit<Theme, 'overrides'> & {
20
+ export type ColorMode = 'light' | 'dark' | 'system' | null;
21
+ export type Override = Omit<Theme, 'overrides'> & {
22
22
  colorMode?: ColorMode;
23
23
  };
24
- export declare type StrictTokens = ReactNativeTokens<'required'>;
25
- export declare type Tokens = ReactNativeTokens<'optional'>;
26
- declare type OmittedComponents = 'checkbox' | 'divider' | 'tabs';
24
+ export type StrictTokens = ReactNativeTokens<'required'>;
25
+ export type Tokens = ReactNativeTokens<'optional'>;
26
+ type OmittedComponents = 'checkbox' | 'divider' | 'tabs';
27
27
  /**
28
28
  * A custom Theme with all properties optional.
29
29
  */
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.2.13";
1
+ export declare const VERSION = "1.2.15";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.2.13';
1
+ export const VERSION = '1.2.15';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react-native",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,6 +18,7 @@
18
18
  "typecheck": "tsc --noEmit"
19
19
  },
20
20
  "devDependencies": {
21
+ "@aws-amplify/eslint-config-amplify-ui": "0.0.0",
21
22
  "@babel/cli": "^7.17.10",
22
23
  "@babel/core": "^7.17.10",
23
24
  "@babel/preset-env": "^7.17.10",
@@ -28,7 +29,6 @@
28
29
  "@types/react-test-renderer": "^17.0.1",
29
30
  "babel-jest": "^28.0.3",
30
31
  "eslint": "^8.14.0",
31
- "eslint-config-amplify-ui": "0.0.0",
32
32
  "metro-react-native-babel-preset": "^0.70.2",
33
33
  "react": "^17.0.2",
34
34
  "react-native": "^0.68.1",
@@ -37,8 +37,8 @@
37
37
  "rimraf": "^3.0.2"
38
38
  },
39
39
  "dependencies": {
40
- "@aws-amplify/ui": "5.5.10",
41
- "@aws-amplify/ui-react-core": "2.1.18"
40
+ "@aws-amplify/ui": "5.6.1",
41
+ "@aws-amplify/ui-react-core": "2.1.20"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "aws-amplify": ">= 5.0.1",
@@ -96,7 +96,6 @@ Array [
96
96
  onChangeText={[Function]}
97
97
  placeholder="Code"
98
98
  placeholderTextColor="hsl(210, 10%, 40%)"
99
- selectionColor="hsl(210, 50%, 10%)"
100
99
  style={
101
100
  Array [
102
101
  Object {
@@ -181,7 +180,6 @@ Array [
181
180
  placeholder="New Password"
182
181
  placeholderTextColor="hsl(210, 10%, 40%)"
183
182
  secureTextEntry={true}
184
- selectionColor="hsl(210, 50%, 10%)"
185
183
  style={
186
184
  Array [
187
185
  Object {
@@ -330,7 +328,6 @@ Array [
330
328
  placeholder="Confirm Password"
331
329
  placeholderTextColor="hsl(210, 10%, 40%)"
332
330
  secureTextEntry={true}
333
- selectionColor="hsl(210, 50%, 10%)"
334
331
  style={
335
332
  Array [
336
333
  Object {
@@ -664,7 +661,6 @@ Array [
664
661
  onChangeText={[Function]}
665
662
  placeholder="Code"
666
663
  placeholderTextColor="hsl(210, 10%, 40%)"
667
- selectionColor="hsl(210, 50%, 10%)"
668
664
  style={
669
665
  Array [
670
666
  Object {
@@ -749,7 +745,6 @@ Array [
749
745
  placeholder="New Password"
750
746
  placeholderTextColor="hsl(210, 10%, 40%)"
751
747
  secureTextEntry={true}
752
- selectionColor="hsl(210, 50%, 10%)"
753
748
  style={
754
749
  Array [
755
750
  Object {
@@ -898,7 +893,6 @@ Array [
898
893
  placeholder="Confirm Password"
899
894
  placeholderTextColor="hsl(210, 10%, 40%)"
900
895
  secureTextEntry={true}
901
- selectionColor="hsl(210, 50%, 10%)"
902
896
  style={
903
897
  Array [
904
898
  Object {
@@ -96,7 +96,6 @@ Array [
96
96
  onChangeText={[Function]}
97
97
  placeholder="Code"
98
98
  placeholderTextColor="hsl(210, 10%, 40%)"
99
- selectionColor="hsl(210, 50%, 10%)"
100
99
  style={
101
100
  Array [
102
101
  Object {
@@ -375,7 +374,6 @@ Array [
375
374
  onChangeText={[Function]}
376
375
  placeholder="Code"
377
376
  placeholderTextColor="hsl(210, 10%, 40%)"
378
- selectionColor="hsl(210, 50%, 10%)"
379
377
  style={
380
378
  Array [
381
379
  Object {
@@ -73,7 +73,6 @@ Array [
73
73
  onChangeText={[Function]}
74
74
  placeholderTextColor="hsl(210, 10%, 40%)"
75
75
  secureTextEntry={true}
76
- selectionColor="hsl(210, 50%, 10%)"
77
76
  style={
78
77
  Array [
79
78
  Object {
@@ -393,7 +392,6 @@ Array [
393
392
  onChangeText={[Function]}
394
393
  placeholderTextColor="hsl(210, 10%, 40%)"
395
394
  secureTextEntry={true}
396
- selectionColor="hsl(210, 50%, 10%)"
397
395
  style={
398
396
  Array [
399
397
  Object {
@@ -656,7 +654,6 @@ Array [
656
654
  onChangeText={[Function]}
657
655
  placeholderTextColor="hsl(210, 10%, 40%)"
658
656
  secureTextEntry={true}
659
- selectionColor="hsl(210, 50%, 10%)"
660
657
  style={
661
658
  Array [
662
659
  Object {
@@ -96,7 +96,6 @@ Array [
96
96
  onChangeText={[Function]}
97
97
  placeholder="Username"
98
98
  placeholderTextColor="hsl(210, 10%, 40%)"
99
- selectionColor="hsl(210, 50%, 10%)"
100
99
  style={
101
100
  Array [
102
101
  Object {
@@ -375,7 +374,6 @@ Array [
375
374
  onChangeText={[Function]}
376
375
  placeholder="Username"
377
376
  placeholderTextColor="hsl(210, 10%, 40%)"
378
- selectionColor="hsl(210, 50%, 10%)"
379
377
  style={
380
378
  Array [
381
379
  Object {
@@ -141,7 +141,6 @@ Array [
141
141
  onChangeText={[Function]}
142
142
  placeholder="Code"
143
143
  placeholderTextColor="hsl(210, 10%, 40%)"
144
- selectionColor="hsl(210, 50%, 10%)"
145
144
  style={
146
145
  Array [
147
146
  Object {
@@ -465,7 +464,6 @@ Array [
465
464
  onChangeText={[Function]}
466
465
  placeholder="Code"
467
466
  placeholderTextColor="hsl(210, 10%, 40%)"
468
- selectionColor="hsl(210, 50%, 10%)"
469
467
  style={
470
468
  Array [
471
469
  Object {
@@ -96,7 +96,6 @@ Array [
96
96
  onChangeText={[Function]}
97
97
  placeholder="Username"
98
98
  placeholderTextColor="hsl(210, 10%, 40%)"
99
- selectionColor="hsl(210, 50%, 10%)"
100
99
  style={
101
100
  Array [
102
101
  Object {
@@ -181,7 +180,6 @@ Array [
181
180
  placeholder="Password"
182
181
  placeholderTextColor="hsl(210, 10%, 40%)"
183
182
  secureTextEntry={true}
184
- selectionColor="hsl(210, 50%, 10%)"
185
183
  style={
186
184
  Array [
187
185
  Object {
@@ -514,7 +512,6 @@ Array [
514
512
  onChangeText={[Function]}
515
513
  placeholder="Username"
516
514
  placeholderTextColor="hsl(210, 10%, 40%)"
517
- selectionColor="hsl(210, 50%, 10%)"
518
515
  style={
519
516
  Array [
520
517
  Object {
@@ -599,7 +596,6 @@ Array [
599
596
  placeholder="Password"
600
597
  placeholderTextColor="hsl(210, 10%, 40%)"
601
598
  secureTextEntry={true}
602
- selectionColor="hsl(210, 50%, 10%)"
603
599
  style={
604
600
  Array [
605
601
  Object {
@@ -884,7 +880,6 @@ Array [
884
880
  onChangeText={[Function]}
885
881
  placeholder="Username"
886
882
  placeholderTextColor="hsl(210, 10%, 40%)"
887
- selectionColor="hsl(210, 50%, 10%)"
888
883
  style={
889
884
  Array [
890
885
  Object {
@@ -969,7 +964,6 @@ Array [
969
964
  placeholder="Password"
970
965
  placeholderTextColor="hsl(210, 10%, 40%)"
971
966
  secureTextEntry={true}
972
- selectionColor="hsl(210, 50%, 10%)"
973
967
  style={
974
968
  Array [
975
969
  Object {
@@ -96,7 +96,6 @@ Array [
96
96
  onChangeText={[Function]}
97
97
  placeholder="Username"
98
98
  placeholderTextColor="hsl(210, 10%, 40%)"
99
- selectionColor="hsl(210, 50%, 10%)"
100
99
  style={
101
100
  Array [
102
101
  Object {
@@ -181,7 +180,6 @@ Array [
181
180
  placeholder="Password"
182
181
  placeholderTextColor="hsl(210, 10%, 40%)"
183
182
  secureTextEntry={true}
184
- selectionColor="hsl(210, 50%, 10%)"
185
183
  style={
186
184
  Array [
187
185
  Object {
@@ -330,7 +328,6 @@ Array [
330
328
  placeholder="Confirm Password"
331
329
  placeholderTextColor="hsl(210, 10%, 40%)"
332
330
  secureTextEntry={true}
333
- selectionColor="hsl(210, 50%, 10%)"
334
331
  style={
335
332
  Array [
336
333
  Object {
@@ -482,7 +479,6 @@ Array [
482
479
  onChangeText={[Function]}
483
480
  placeholder="Phone"
484
481
  placeholderTextColor="hsl(210, 10%, 40%)"
485
- selectionColor="hsl(210, 50%, 10%)"
486
482
  style={
487
483
  Array [
488
484
  Object {
@@ -706,7 +702,6 @@ Array [
706
702
  onChangeText={[Function]}
707
703
  placeholder="Username"
708
704
  placeholderTextColor="hsl(210, 10%, 40%)"
709
- selectionColor="hsl(210, 50%, 10%)"
710
705
  style={
711
706
  Array [
712
707
  Object {
@@ -791,7 +786,6 @@ Array [
791
786
  placeholder="Password"
792
787
  placeholderTextColor="hsl(210, 10%, 40%)"
793
788
  secureTextEntry={true}
794
- selectionColor="hsl(210, 50%, 10%)"
795
789
  style={
796
790
  Array [
797
791
  Object {
@@ -940,7 +934,6 @@ Array [
940
934
  placeholder="Confirm Password"
941
935
  placeholderTextColor="hsl(210, 10%, 40%)"
942
936
  secureTextEntry={true}
943
- selectionColor="hsl(210, 50%, 10%)"
944
937
  style={
945
938
  Array [
946
939
  Object {
@@ -1092,7 +1085,6 @@ Array [
1092
1085
  onChangeText={[Function]}
1093
1086
  placeholder="Phone"
1094
1087
  placeholderTextColor="hsl(210, 10%, 40%)"
1095
- selectionColor="hsl(210, 50%, 10%)"
1096
1088
  style={
1097
1089
  Array [
1098
1090
  Object {
@@ -1259,7 +1251,6 @@ Array [
1259
1251
  onChangeText={[Function]}
1260
1252
  placeholder="Username"
1261
1253
  placeholderTextColor="hsl(210, 10%, 40%)"
1262
- selectionColor="hsl(210, 50%, 10%)"
1263
1254
  style={
1264
1255
  Array [
1265
1256
  Object {
@@ -1345,7 +1336,6 @@ Array [
1345
1336
  placeholder="Password"
1346
1337
  placeholderTextColor="hsl(210, 10%, 40%)"
1347
1338
  secureTextEntry={true}
1348
- selectionColor="hsl(210, 50%, 10%)"
1349
1339
  style={
1350
1340
  Array [
1351
1341
  Object {
@@ -1497,7 +1487,6 @@ Array [
1497
1487
  placeholder="Confirm Password"
1498
1488
  placeholderTextColor="hsl(210, 10%, 40%)"
1499
1489
  secureTextEntry={true}
1500
- selectionColor="hsl(210, 50%, 10%)"
1501
1490
  style={
1502
1491
  Array [
1503
1492
  Object {
@@ -1652,7 +1641,6 @@ Array [
1652
1641
  onChangeText={[Function]}
1653
1642
  placeholder="Phone"
1654
1643
  placeholderTextColor="hsl(210, 10%, 40%)"
1655
- selectionColor="hsl(210, 50%, 10%)"
1656
1644
  style={
1657
1645
  Array [
1658
1646
  Object {
@@ -1876,7 +1864,6 @@ Array [
1876
1864
  onChangeText={[Function]}
1877
1865
  placeholder="Username"
1878
1866
  placeholderTextColor="hsl(210, 10%, 40%)"
1879
- selectionColor="hsl(210, 50%, 10%)"
1880
1867
  style={
1881
1868
  Array [
1882
1869
  Object {
@@ -1961,7 +1948,6 @@ Array [
1961
1948
  placeholder="Password"
1962
1949
  placeholderTextColor="hsl(210, 10%, 40%)"
1963
1950
  secureTextEntry={true}
1964
- selectionColor="hsl(210, 50%, 10%)"
1965
1951
  style={
1966
1952
  Array [
1967
1953
  Object {
@@ -2110,7 +2096,6 @@ Array [
2110
2096
  placeholder="Confirm Password"
2111
2097
  placeholderTextColor="hsl(210, 10%, 40%)"
2112
2098
  secureTextEntry={true}
2113
- selectionColor="hsl(210, 50%, 10%)"
2114
2099
  style={
2115
2100
  Array [
2116
2101
  Object {
@@ -2262,7 +2247,6 @@ Array [
2262
2247
  onChangeText={[Function]}
2263
2248
  placeholder="Phone"
2264
2249
  placeholderTextColor="hsl(210, 10%, 40%)"
2265
- selectionColor="hsl(210, 50%, 10%)"
2266
2250
  style={
2267
2251
  Array [
2268
2252
  Object {
@@ -2545,7 +2529,6 @@ Array [
2545
2529
  onChangeText={[Function]}
2546
2530
  placeholder="Username"
2547
2531
  placeholderTextColor="hsl(210, 10%, 40%)"
2548
- selectionColor="hsl(210, 50%, 10%)"
2549
2532
  style={
2550
2533
  Array [
2551
2534
  Object {
@@ -2660,7 +2643,6 @@ Array [
2660
2643
  placeholder="Password"
2661
2644
  placeholderTextColor="hsl(210, 10%, 40%)"
2662
2645
  secureTextEntry={true}
2663
- selectionColor="hsl(210, 50%, 10%)"
2664
2646
  style={
2665
2647
  Array [
2666
2648
  Object {
@@ -2812,7 +2794,6 @@ Array [
2812
2794
  placeholder="Confirm Password"
2813
2795
  placeholderTextColor="hsl(210, 10%, 40%)"
2814
2796
  secureTextEntry={true}
2815
- selectionColor="hsl(210, 50%, 10%)"
2816
2797
  style={
2817
2798
  Array [
2818
2799
  Object {
@@ -2967,7 +2948,6 @@ Array [
2967
2948
  onChangeText={[Function]}
2968
2949
  placeholder="Phone"
2969
2950
  placeholderTextColor="hsl(210, 10%, 40%)"
2970
- selectionColor="hsl(210, 50%, 10%)"
2971
2951
  style={
2972
2952
  Array [
2973
2953
  Object {
@@ -27,7 +27,7 @@ const TestComponent = () => {
27
27
  return null;
28
28
  };
29
29
 
30
- function Container({ children }: { children: React.ReactNode }) {
30
+ function Container({ children }: { children?: React.ReactNode }) {
31
31
  return <View testID={CONTAINER_TEST_ID}>{children}</View>;
32
32
  }
33
33
 
@@ -15,7 +15,6 @@ export interface ContainerStyles {
15
15
  export interface ContainerProps
16
16
  extends ScrollViewProps,
17
17
  Pick<KeyboardAvoidingViewProps, 'behavior' | 'keyboardVerticalOffset'> {
18
- children: React.ReactNode;
19
18
  keyboardAvoidingViewStyle?: StyleProp<ViewStyle>;
20
19
  scrollViewContentContainerStyle?: StyleProp<ViewStyle>;
21
20
  }
@@ -23,7 +23,11 @@ const phoneField = {
23
23
  name: 'phonenumber',
24
24
  type: 'tel',
25
25
  };
26
- const textField = { order: 3, name: 'username', isRequired: true };
26
+ const textField = {
27
+ order: 3,
28
+ name: 'username',
29
+ isRequired: true,
30
+ };
27
31
 
28
32
  const radioField = { type: 'radio', name: 'email', value: 'hello@world.com' };
29
33
 
@@ -191,7 +195,10 @@ describe('getRouteTypedFields', () => {
191
195
  });
192
196
 
193
197
  const expected = [
194
- passwordField,
198
+ {
199
+ ...passwordField,
200
+ testID: `authenticator__text-field__input-${passwordField.name}`,
201
+ },
195
202
  {
196
203
  name: phoneField.name,
197
204
  type: 'phone',
@@ -200,6 +207,7 @@ describe('getRouteTypedFields', () => {
200
207
  name: textField.name,
201
208
  required: textField.isRequired,
202
209
  type: 'default',
210
+ testID: `authenticator__text-field__input-${textField.name}`,
203
211
  },
204
212
  ];
205
213
 
@@ -130,6 +130,7 @@ export const getTypedField = ({
130
130
  ...field
131
131
  }: AuthenticatorLegacyField): TypedField => {
132
132
  const type = getFieldType(machineFieldType);
133
+ const testID = `authenticator__text-field__input-${name}`;
133
134
 
134
135
  return Object.entries(field).reduce(
135
136
  (acc, [key, value]) => {
@@ -141,10 +142,10 @@ export const getTypedField = ({
141
142
  // map to `required` prop
142
143
  if (key === 'isRequired' || key === 'required') {
143
144
  // `TypedField` props expects `required` key
144
- return { ...acc, required: value as boolean };
145
+ return { ...acc, required: value as boolean, testID };
145
146
  }
146
147
 
147
- return { ...acc, [key]: value };
148
+ return { ...acc, [key]: value, testID };
148
149
  },
149
150
  // initialize `acc` with field `name` and `type`
150
151
  { name, type } as TypedField
@@ -68,7 +68,6 @@ exports[`PasswordField applies theme and style props 1`] = `
68
68
  editable={true}
69
69
  placeholderTextColor="hsl(210, 10%, 40%)"
70
70
  secureTextEntry={true}
71
- selectionColor="hsl(210, 50%, 10%)"
72
71
  style={
73
72
  Array [
74
73
  Object {
@@ -202,7 +201,6 @@ exports[`PasswordField renders as expected 1`] = `
202
201
  editable={true}
203
202
  placeholderTextColor="hsl(210, 10%, 40%)"
204
203
  secureTextEntry={true}
205
- selectionColor="hsl(210, 50%, 10%)"
206
204
  style={
207
205
  Array [
208
206
  Object {
@@ -335,7 +333,6 @@ exports[`PasswordField renders as expected when disabled 1`] = `
335
333
  editable={false}
336
334
  placeholderTextColor="hsl(210, 10%, 40%)"
337
335
  secureTextEntry={true}
338
- selectionColor="hsl(210, 50%, 10%)"
339
336
  style={
340
337
  Array [
341
338
  Object {
@@ -474,7 +471,6 @@ exports[`PasswordField should be able to hide show password icon 1`] = `
474
471
  editable={true}
475
472
  placeholderTextColor="hsl(210, 10%, 40%)"
476
473
  secureTextEntry={true}
477
- selectionColor="hsl(210, 50%, 10%)"
478
474
  style={
479
475
  Array [
480
476
  Object {
@@ -558,7 +554,6 @@ exports[`PasswordField should be able to obscure text programmatically 1`] = `
558
554
  editable={true}
559
555
  placeholderTextColor="hsl(210, 10%, 40%)"
560
556
  secureTextEntry={false}
561
- selectionColor="hsl(210, 50%, 10%)"
562
557
  style={
563
558
  Array [
564
559
  Object {
@@ -40,7 +40,6 @@ exports[`PhoneNumberField applies theming 1`] = `
40
40
  editable={true}
41
41
  keyboardType="phone-pad"
42
42
  placeholderTextColor="hsl(210, 10%, 40%)"
43
- selectionColor="hsl(210, 50%, 10%)"
44
43
  style={
45
44
  Array [
46
45
  Object {
@@ -101,7 +100,6 @@ exports[`PhoneNumberField renders as expected 1`] = `
101
100
  editable={true}
102
101
  keyboardType="phone-pad"
103
102
  placeholderTextColor="hsl(210, 10%, 40%)"
104
- selectionColor="hsl(210, 50%, 10%)"
105
103
  style={
106
104
  Array [
107
105
  Object {
@@ -163,7 +161,6 @@ exports[`PhoneNumberField renders as expected when disabled 1`] = `
163
161
  editable={false}
164
162
  keyboardType="phone-pad"
165
163
  placeholderTextColor="hsl(210, 10%, 40%)"
166
- selectionColor="hsl(210, 50%, 10%)"
167
164
  style={
168
165
  Array [
169
166
  Object {
@@ -27,7 +27,7 @@ export default function TextField({
27
27
  ...rest
28
28
  }: TextFieldProps): JSX.Element {
29
29
  const theme = useTheme();
30
- const themedStyle = getThemedStyles(theme);
30
+ const themedStyle = useMemo(() => getThemedStyles(theme), [theme]);
31
31
 
32
32
  const fieldContainerStyle: ViewStyle = useMemo(
33
33
  () => ({
@@ -64,7 +64,6 @@ export default function TextField({
64
64
  autoCapitalize={autoCapitalize}
65
65
  editable={!disabled}
66
66
  placeholderTextColor={theme.tokens.colors.font.tertiary}
67
- selectionColor={theme.tokens.colors.font.primary}
68
67
  style={[themedStyle.field, fieldStyle]}
69
68
  />
70
69
  {endAccessory ?? null}
@@ -63,7 +63,6 @@ exports[`TextField doesn't render the errorMessage if error prop is false 1`] =
63
63
  editable={true}
64
64
  placeholder="Placeholder"
65
65
  placeholderTextColor="hsl(210, 10%, 40%)"
66
- selectionColor="hsl(210, 50%, 10%)"
67
66
  style={
68
67
  Array [
69
68
  Object {
@@ -144,7 +143,6 @@ exports[`TextField doesn't render the errorMessage if errorMessage prop is undef
144
143
  editable={true}
145
144
  placeholder="Placeholder"
146
145
  placeholderTextColor="hsl(210, 10%, 40%)"
147
- selectionColor="hsl(210, 50%, 10%)"
148
146
  style={
149
147
  Array [
150
148
  Object {
@@ -225,7 +223,6 @@ exports[`TextField renders as expected 1`] = `
225
223
  editable={true}
226
224
  placeholder="Placeholder"
227
225
  placeholderTextColor="hsl(210, 10%, 40%)"
228
- selectionColor="hsl(210, 50%, 10%)"
229
226
  style={
230
227
  Array [
231
228
  Object {
@@ -307,7 +304,6 @@ exports[`TextField renders as expected as password field 1`] = `
307
304
  placeholder="Placeholder"
308
305
  placeholderTextColor="hsl(210, 10%, 40%)"
309
306
  secureTextEntry={true}
310
- selectionColor="hsl(210, 50%, 10%)"
311
307
  style={
312
308
  Array [
313
309
  Object {
@@ -389,7 +385,6 @@ exports[`TextField renders as expected when disabled 1`] = `
389
385
  editable={false}
390
386
  placeholder="Placeholder"
391
387
  placeholderTextColor="hsl(210, 10%, 40%)"
392
- selectionColor="hsl(210, 50%, 10%)"
393
388
  style={
394
389
  Array [
395
390
  Object {
@@ -470,7 +465,6 @@ exports[`TextField renders as expected with error message 1`] = `
470
465
  editable={true}
471
466
  placeholder="Placeholder"
472
467
  placeholderTextColor="hsl(210, 10%, 40%)"
473
- selectionColor="hsl(210, 50%, 10%)"
474
468
  style={
475
469
  Array [
476
470
  Object {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.2.13';
1
+ export const VERSION = '1.2.15';