@aws-amplify/ui 3.0.15 → 3.1.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.
- package/dist/esm/index.js +15 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -1
- package/dist/theme.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ interface AuthContext {
|
|
|
56
56
|
loginMechanisms?: LoginMechanism[];
|
|
57
57
|
signUpAttributes?: SignUpAttribute[];
|
|
58
58
|
socialProviders?: SocialProvider[];
|
|
59
|
+
formFields?: FormFields;
|
|
59
60
|
initialState?: 'signIn' | 'signUp' | 'resetPassword';
|
|
60
61
|
};
|
|
61
62
|
services?: Partial<typeof defaultServices>;
|
|
@@ -89,6 +90,7 @@ interface BaseFormContext {
|
|
|
89
90
|
interface SignInContext extends BaseFormContext {
|
|
90
91
|
loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
|
|
91
92
|
socialProviders: Required<AuthContext>['config']['socialProviders'];
|
|
93
|
+
formFields?: FormFields;
|
|
92
94
|
attributeToVerify?: string;
|
|
93
95
|
redirectIntent?: string;
|
|
94
96
|
unverifiedAttributes?: Record<string, string>;
|
|
@@ -101,17 +103,20 @@ declare type SignUpAttribute = SignUpFieldsWithDefaults | SignUpFieldsWithoutDef
|
|
|
101
103
|
interface SignUpContext extends BaseFormContext {
|
|
102
104
|
loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
|
|
103
105
|
socialProviders: Required<AuthContext>['config']['socialProviders'];
|
|
106
|
+
formFields: FormFields;
|
|
104
107
|
unverifiedAttributes?: Record<string, string>;
|
|
105
108
|
}
|
|
106
109
|
interface ResetPasswordContext extends BaseFormContext {
|
|
107
110
|
username?: string;
|
|
108
111
|
unverifiedAttributes?: Record<string, string>;
|
|
112
|
+
formFields?: FormFields;
|
|
109
113
|
}
|
|
110
114
|
interface SignOutContext {
|
|
111
115
|
authAttributes?: Record<string, any>;
|
|
112
116
|
challengeName?: string;
|
|
113
117
|
unverifiedAttributes?: Record<string, string>;
|
|
114
118
|
user?: CognitoUserAmplify;
|
|
119
|
+
formFields?: FormFields;
|
|
115
120
|
}
|
|
116
121
|
declare type ActorContextWithForms = SignInContext | SignUpContext | ResetPasswordContext;
|
|
117
122
|
declare type SignInState = State<SignInContext, AuthEvent>;
|
|
@@ -145,8 +150,31 @@ interface InputAttributes {
|
|
|
145
150
|
autocomplete?: string;
|
|
146
151
|
}
|
|
147
152
|
declare const LoginMechanismArray: readonly ["username", "email", "phone_number"];
|
|
153
|
+
declare type CommonFields = 'username' | 'password' | 'confirm_password';
|
|
148
154
|
declare type LoginMechanism = typeof LoginMechanismArray[number];
|
|
149
155
|
declare type SocialProvider = 'amazon' | 'apple' | 'facebook' | 'google';
|
|
156
|
+
declare type formFieldComponents = 'signIn' | 'signUp' | 'forceNewPassword' | 'confirmResetPassword' | 'confirmSignIn' | 'confirmSignUp' | 'confirmVerifyUser' | 'resetPassword' | 'setupTOTP';
|
|
157
|
+
declare type FormFields = {
|
|
158
|
+
[key in formFieldComponents]?: formField;
|
|
159
|
+
};
|
|
160
|
+
interface formField {
|
|
161
|
+
[key: string]: formFieldTypes;
|
|
162
|
+
}
|
|
163
|
+
interface formFieldTypes {
|
|
164
|
+
labelHidden?: boolean;
|
|
165
|
+
label?: string;
|
|
166
|
+
placeholder?: string;
|
|
167
|
+
/**
|
|
168
|
+
* @deprecated Internal use only, please use `isRequired` instead.
|
|
169
|
+
*/
|
|
170
|
+
required?: boolean;
|
|
171
|
+
isRequired?: boolean;
|
|
172
|
+
dialCode?: string;
|
|
173
|
+
totpIssuer?: string;
|
|
174
|
+
totpUsername?: string;
|
|
175
|
+
dialCodeList?: Array<string>;
|
|
176
|
+
order?: number;
|
|
177
|
+
}
|
|
150
178
|
declare type AuthFieldsWithDefaults = LoginMechanism | SignUpFieldsWithDefaults | 'confirmation_code' | 'password';
|
|
151
179
|
declare type AuthInputAttributes = Record<AuthFieldsWithDefaults, InputAttributes>;
|
|
152
180
|
declare type AuthEventData = Record<PropertyKey, any>;
|
|
@@ -269,6 +297,7 @@ declare const censorPhoneNumber: (val: string) => string;
|
|
|
269
297
|
declare const getFormDataFromEvent: (event: Event) => {
|
|
270
298
|
[k: string]: FormDataEntryValue;
|
|
271
299
|
};
|
|
300
|
+
declare const setFormOrder: (formOverrides: formField, fieldNames: Array<SignUpAttribute | CommonFields>) => Array<string | number>;
|
|
272
301
|
|
|
273
302
|
declare const countryDialCodes: string[];
|
|
274
303
|
|
|
@@ -862,4 +891,4 @@ declare function createTheme(theme?: Theme, baseTheme?: BaseTheme): WebTheme;
|
|
|
862
891
|
|
|
863
892
|
declare const defaultTheme: WebTheme;
|
|
864
893
|
|
|
865
|
-
export { ActorContextWithForms, ActorDoneData, AuthActorContext, AuthActorState, AuthChallengeNames, AuthContext, AuthEvent, AuthEventData, AuthEventTypes, AuthFieldsWithDefaults, AuthFormData, AuthInputAttributes, AuthInterpreter, AuthMachineSend, AuthMachineState, AuthenticatorMachineOptions, BaseTheme, BorderWidthValue, CognitoAttributes, CognitoUserAmplify, ColorModeOverride, ColorValue, ContactMethod, DefaultTexts, DesignToken, Dict, FederatedIdentityProviders, FontSizeValue, FontValue, FontWeightValue, InputAttributes, InvokeActorEventTypes, LineHeightValue, LoginMechanism, LoginMechanismArray, MediaQueryOverride, NoInfer, OpacityValue, OutlineOffsetValue, OutlineWidthValue, Override, Phrase, RadiusValue, ResetPasswordContext, ResetPasswordState, SelectorOverride, ServicesContext, ShadowValue, SignInContext, SignInResult, SignInState, SignInTypes, SignOutContext, SignOutState, SignUpAttribute, SignUpContext, SignUpFieldsWithDefaults, SignUpFieldsWithoutDefaults, SignUpState, SocialProvider, SpaceValue, Theme, TimeValue, TransformValue, ValidationError, Validator, ValidatorResult, WebDesignToken, WebTheme, authInputAttributes, censorAllButFirstAndLast, censorPhoneNumber, countryDialCodes, createAuthenticatorMachine, createTheme, defaultTheme, getActorContext, getActorState, getAliasInfoFromContext, getConfiguredAliases, getFormDataFromEvent, getSendEventAliases, getServiceContextFacade, getServiceFacade, hasTranslation, isDesignToken, listenToAuthHub, signUpFieldsWithDefault, signUpFieldsWithoutDefault, translate, translations };
|
|
894
|
+
export { ActorContextWithForms, ActorDoneData, AuthActorContext, AuthActorState, AuthChallengeNames, AuthContext, AuthEvent, AuthEventData, AuthEventTypes, AuthFieldsWithDefaults, AuthFormData, AuthInputAttributes, AuthInterpreter, AuthMachineSend, AuthMachineState, AuthenticatorMachineOptions, BaseTheme, BorderWidthValue, CognitoAttributes, CognitoUserAmplify, ColorModeOverride, ColorValue, CommonFields, ContactMethod, DefaultTexts, DesignToken, Dict, FederatedIdentityProviders, FontSizeValue, FontValue, FontWeightValue, FormFields, InputAttributes, InvokeActorEventTypes, LineHeightValue, LoginMechanism, LoginMechanismArray, MediaQueryOverride, NoInfer, OpacityValue, OutlineOffsetValue, OutlineWidthValue, Override, Phrase, RadiusValue, ResetPasswordContext, ResetPasswordState, SelectorOverride, ServicesContext, ShadowValue, SignInContext, SignInResult, SignInState, SignInTypes, SignOutContext, SignOutState, SignUpAttribute, SignUpContext, SignUpFieldsWithDefaults, SignUpFieldsWithoutDefaults, SignUpState, SocialProvider, SpaceValue, Theme, TimeValue, TransformValue, ValidationError, Validator, ValidatorResult, WebDesignToken, WebTheme, authInputAttributes, censorAllButFirstAndLast, censorPhoneNumber, countryDialCodes, createAuthenticatorMachine, createTheme, defaultTheme, formField, formFieldComponents, formFieldTypes, getActorContext, getActorState, getAliasInfoFromContext, getConfiguredAliases, getFormDataFromEvent, getSendEventAliases, getServiceContextFacade, getServiceFacade, hasTranslation, isDesignToken, listenToAuthHub, setFormOrder, signUpFieldsWithDefault, signUpFieldsWithoutDefault, translate, translations };
|