@aws-amplify/ui-react-native 1.2.14 → 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.
- package/.eslintrc.js +2 -2
- package/CHANGELOG.md +8 -0
- package/dist/Authenticator/Defaults/types.d.ts +22 -22
- package/dist/Authenticator/common/DefaultContainer/types.d.ts +1 -1
- package/dist/Authenticator/common/DefaultContent/types.d.ts +5 -5
- package/dist/Authenticator/common/DefaultFormFields/types.d.ts +4 -4
- package/dist/Authenticator/hooks/types.d.ts +12 -12
- package/dist/Authenticator/hooks/useFieldValues/types.d.ts +1 -1
- package/dist/Authenticator/hooks/useFieldValues/utils.js +3 -2
- package/dist/Authenticator/types.d.ts +2 -2
- package/dist/InAppMessaging/components/InAppMessageDisplay/types.d.ts +4 -4
- package/dist/InAppMessaging/hooks/useMessageImage/types.d.ts +3 -3
- package/dist/InAppMessaging/hooks/useMessageProps/types.d.ts +1 -1
- package/dist/hooks/useDeviceOrientation/useDeviceOrientation.d.ts +1 -1
- package/dist/primitives/Button/types.d.ts +1 -1
- package/dist/primitives/Heading/types.d.ts +2 -2
- package/dist/primitives/Icon/types.d.ts +2 -2
- package/dist/primitives/Label/types.d.ts +2 -2
- package/dist/primitives/Radio/types.d.ts +2 -2
- package/dist/primitives/RadioGroup/types.d.ts +1 -1
- package/dist/primitives/Tabs/types.d.ts +1 -1
- package/dist/theme/types.d.ts +7 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/src/Authenticator/hooks/useFieldValues/__tests__/utils.spec.ts +10 -2
- package/src/Authenticator/hooks/useFieldValues/utils.ts +3 -2
- 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,13 @@
|
|
|
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
|
+
|
|
3
11
|
## 1.2.14
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -20,69 +20,69 @@ export interface SignUpStyle {
|
|
|
20
20
|
}
|
|
21
21
|
export interface VerifyUserStyle {
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type DefaultComponents<FieldType = {}, Props = {}> = AuthenticatorComponentDefaults<FieldType, Props>;
|
|
24
|
+
export type DefaultConfirmResetPasswordComponent = DefaultComponents<TextFieldOptionsType, {
|
|
25
25
|
style?: ConfirmResetPasswordStyle;
|
|
26
26
|
}>['ConfirmResetPassword'];
|
|
27
|
-
export
|
|
27
|
+
export type DefaultConfirmSignInComponent = DefaultComponents<TextFieldOptionsType, {
|
|
28
28
|
style?: ConfirmSignInStyle;
|
|
29
29
|
}>['ConfirmSignIn'];
|
|
30
|
-
export
|
|
30
|
+
export type DefaultConfirmSignUpComponent = DefaultComponents<TextFieldOptionsType, {
|
|
31
31
|
style?: ConfirmSignUpStyle;
|
|
32
32
|
}>['ConfirmSignUp'];
|
|
33
|
-
export
|
|
33
|
+
export type DefaultConfirmVerifyUserComponent = DefaultComponents<TextFieldOptionsType, {
|
|
34
34
|
style?: ConfirmVerifyUserStyle;
|
|
35
35
|
}>['ConfirmVerifyUser'];
|
|
36
|
-
export
|
|
36
|
+
export type DefaultForceNewPasswordComponent = DefaultComponents<TextFieldOptionsType, {
|
|
37
37
|
style?: ForceNewPasswordStyle;
|
|
38
38
|
}>['ForceNewPassword'];
|
|
39
|
-
export
|
|
39
|
+
export type DefaultResetPasswordComponent = DefaultComponents<TextFieldOptionsType, {
|
|
40
40
|
style?: ResetPasswordStyle;
|
|
41
41
|
}>['ResetPassword'];
|
|
42
|
-
export
|
|
42
|
+
export type DefaultSetupTOTPComponent = DefaultComponents<TextFieldOptionsType, {
|
|
43
43
|
style?: SetupTOTPStyle;
|
|
44
44
|
}>['SetupTOTP'];
|
|
45
|
-
export
|
|
45
|
+
export type DefaultSignInComponent = DefaultComponents<TextFieldOptionsType, {
|
|
46
46
|
style?: SignInStyle;
|
|
47
47
|
}>['SignIn'];
|
|
48
|
-
export
|
|
48
|
+
export type DefaultSignUpComponent = DefaultComponents<TextFieldOptionsType, {
|
|
49
49
|
style?: SignUpStyle;
|
|
50
50
|
}>['SignUp'];
|
|
51
|
-
export
|
|
51
|
+
export type DefaultVerifyUserComponent = DefaultComponents<RadioFieldOptions, {
|
|
52
52
|
style?: VerifyUserStyle;
|
|
53
53
|
}>['VerifyUser'];
|
|
54
54
|
/**
|
|
55
55
|
* Custom Authenticator components
|
|
56
56
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
type OverrideComponents<FieldType = {}, Props = {}> = AuthenticatorComponentOverrides<FieldType, Props>;
|
|
58
|
+
type ConfirmSignInComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
59
59
|
style?: ConfirmSignInStyle;
|
|
60
60
|
} & P>['ConfirmSignIn'];
|
|
61
|
-
|
|
61
|
+
type ConfirmSignUpComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
62
62
|
style?: ConfirmSignUpStyle;
|
|
63
63
|
} & P>['ConfirmSignUp'];
|
|
64
|
-
|
|
64
|
+
type ConfirmResetPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
65
65
|
style?: ConfirmResetPasswordStyle;
|
|
66
66
|
} & P>['ConfirmResetPassword'];
|
|
67
|
-
|
|
67
|
+
type ConfirmVerifyUserComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
68
68
|
style?: ConfirmVerifyUserStyle;
|
|
69
69
|
} & P>['ConfirmVerifyUser'];
|
|
70
|
-
|
|
70
|
+
type ForceNewPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
71
71
|
style?: ForceNewPasswordStyle;
|
|
72
72
|
} & P>['ForceNewPassword'];
|
|
73
|
-
|
|
73
|
+
type ResetPasswordComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
74
74
|
style?: ResetPasswordStyle;
|
|
75
75
|
} & P>['ResetPassword'];
|
|
76
|
-
|
|
76
|
+
type SetupTOTPComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
77
77
|
style?: SetupTOTPStyle;
|
|
78
78
|
} & P>['SetupTOTP'];
|
|
79
|
-
|
|
79
|
+
type SignInComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
80
80
|
style?: SignInStyle;
|
|
81
81
|
} & P>['SignIn'];
|
|
82
|
-
|
|
82
|
+
type SignUpComponent<P = {}> = OverrideComponents<TextFieldOptionsType, {
|
|
83
83
|
style?: SignUpStyle;
|
|
84
84
|
} & P>['SignUp'];
|
|
85
|
-
|
|
85
|
+
type VerifyUserComponent<P = {}> = OverrideComponents<RadioFieldOptions, {
|
|
86
86
|
style?: VerifyUserStyle;
|
|
87
87
|
} & P>['VerifyUser'];
|
|
88
88
|
/**
|
|
@@ -9,7 +9,7 @@ export interface ContainerProps extends ScrollViewProps, Pick<KeyboardAvoidingVi
|
|
|
9
9
|
keyboardAvoidingViewStyle?: StyleProp<ViewStyle>;
|
|
10
10
|
scrollViewContentContainerStyle?: StyleProp<ViewStyle>;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type DefaultContainerComponent<P = {}> = React.ComponentType<ContainerProps & P>;
|
|
13
13
|
export interface InnerContainerStyles {
|
|
14
14
|
container: ViewStyle;
|
|
15
15
|
}
|
|
@@ -24,19 +24,19 @@ export interface DefaultContentStyle {
|
|
|
24
24
|
link?: ViewStyle;
|
|
25
25
|
linksContainer?: ViewStyle;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type DefaultContentStyleProps = {
|
|
28
28
|
[Key in keyof DefaultContentStyle]: StyleProp<DefaultContentStyle[Key]>;
|
|
29
29
|
} & DefaultFormFieldsStyle;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
type DefaultComponentProps<FieldsType> = AuthenticatorComponentDefaultProps<FieldsType>[AuthenticatorRouteComponentName];
|
|
31
|
+
type AuthenticatorButtonProps = Omit<ButtonProps, 'children'> & {
|
|
32
32
|
children: string;
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
type DefaultButtons = {
|
|
35
35
|
primary: AuthenticatorButtonProps;
|
|
36
36
|
secondary?: AuthenticatorButtonProps;
|
|
37
37
|
links?: AuthenticatorButtonProps[];
|
|
38
38
|
};
|
|
39
|
-
export
|
|
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
|
|
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
|
|
21
|
-
export
|
|
22
|
-
export
|
|
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
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
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
|
|
19
|
+
export type RadioFieldOptions = FieldOptions<RadioProps<string>, 'radio'>;
|
|
20
20
|
/**
|
|
21
21
|
* `field` options union
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
1
|
+
export type ImageDimensions = {
|
|
2
2
|
height: number | undefined;
|
|
3
3
|
width: number | undefined;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
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
|
|
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
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { PressableProps, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
-
export
|
|
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
|
-
|
|
2
|
+
type Level = 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
3
|
export interface HeadingProps extends TextProps {
|
|
4
4
|
level?: Level;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
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
|
|
3
|
-
export
|
|
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
|
|
10
|
-
export
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
4
|
+
type IndicatorPosition = 'top' | 'bottom';
|
|
5
5
|
export interface TabsProps extends ViewProps {
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -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
|
-
|
|
4
|
-
export
|
|
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
|
|
21
|
-
export
|
|
20
|
+
export type ColorMode = 'light' | 'dark' | 'system' | null;
|
|
21
|
+
export type Override = Omit<Theme, 'overrides'> & {
|
|
22
22
|
colorMode?: ColorMode;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
|
|
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.
|
|
1
|
+
export declare const VERSION = "1.2.15";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.2.
|
|
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.
|
|
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.6.
|
|
41
|
-
"@aws-amplify/ui-react-core": "2.1.
|
|
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",
|
|
@@ -23,7 +23,11 @@ const phoneField = {
|
|
|
23
23
|
name: 'phonenumber',
|
|
24
24
|
type: 'tel',
|
|
25
25
|
};
|
|
26
|
-
const textField = {
|
|
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
|
-
|
|
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
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.2.
|
|
1
|
+
export const VERSION = '1.2.15';
|