@aws-amplify/ui 6.0.10 → 6.0.12
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/helpers/authenticator/textUtil.mjs +1 -1
- package/dist/esm/helpers/authenticator/utils.mjs +13 -1
- package/dist/esm/i18n/dictionaries/authenticator/defaultTexts.mjs +2 -0
- package/dist/esm/i18n/dictionaries/authenticator/en.mjs +1 -0
- package/dist/esm/i18n/dictionaries/authenticator/he.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/machines/authenticator/index.mjs +1 -0
- package/dist/esm/theme/tokens/components/checkbox.mjs +4 -1
- package/dist/index.js +24 -3
- package/dist/styles/base.css +1 -0
- package/dist/styles/base.layer.css +1 -0
- package/dist/styles/checkbox.css +4 -1
- package/dist/styles/checkbox.layer.css +4 -1
- package/dist/styles/liveness.css +1 -1
- package/dist/styles/liveness.layer.css +1 -1
- package/dist/styles.css +6 -2
- package/dist/styles.layer.css +6 -2
- package/dist/theme.css +1 -0
- package/dist/types/helpers/authenticator/utils.d.ts +3 -0
- package/dist/types/i18n/dictionaries/authenticator/defaultTexts.d.ts +1 -0
- package/dist/types/i18n/dictionaries/index.d.ts +1 -0
- package/dist/types/i18n/translations.d.ts +1 -0
- package/dist/types/machines/authenticator/types.d.ts +1 -0
- package/dist/types/theme/tokens/components/checkbox.d.ts +1 -1
- package/dist/types/types/authenticator/form.d.ts +2 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ const getChallengeText = (challengeName) => {
|
|
|
10
10
|
case 'SOFTWARE_TOKEN_MFA':
|
|
11
11
|
return translate(DefaultTexts.CONFIRM_TOTP);
|
|
12
12
|
default:
|
|
13
|
-
|
|
13
|
+
return translate(DefaultTexts.CONFIRM_MFA_DEFAULT);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -21,6 +21,18 @@ const censorPhoneNumber = (val) => {
|
|
|
21
21
|
}
|
|
22
22
|
return split.join('');
|
|
23
23
|
};
|
|
24
|
+
// censors all but the first and last of the name of an email and keeps domain
|
|
25
|
+
const censorEmail = (val) => {
|
|
26
|
+
const splitEmail = val.split('@');
|
|
27
|
+
const censoredName = censorAllButFirstAndLast(splitEmail[0]);
|
|
28
|
+
return `${censoredName}@${splitEmail[1]}`;
|
|
29
|
+
};
|
|
30
|
+
// based on the ContactMethod type, returns a censored contact value
|
|
31
|
+
const censorContactMethod = (type, value) => {
|
|
32
|
+
return type === 'Phone Number'
|
|
33
|
+
? censorPhoneNumber(value)
|
|
34
|
+
: censorEmail(value);
|
|
35
|
+
};
|
|
24
36
|
const hasSpecialChars = (password) => ALLOWED_SPECIAL_CHARACTERS.some((char) => password.includes(char));
|
|
25
37
|
const getTotpCodeURL = (issuer, username, secret) => encodeURI(`otpauth://totp/${issuer}:${username}?secret=${secret}&issuer=${issuer}`);
|
|
26
38
|
function trimValues(values, ...ignored) {
|
|
@@ -35,4 +47,4 @@ const isValidEmail = (value) => {
|
|
|
35
47
|
return emailRegex.test(value);
|
|
36
48
|
};
|
|
37
49
|
|
|
38
|
-
export { censorAllButFirstAndLast, censorPhoneNumber, getTotpCodeURL, hasSpecialChars, isValidEmail, trimValues };
|
|
50
|
+
export { censorAllButFirstAndLast, censorContactMethod, censorEmail, censorPhoneNumber, getTotpCodeURL, hasSpecialChars, isValidEmail, trimValues };
|
|
@@ -15,6 +15,8 @@ const defaultTexts = {
|
|
|
15
15
|
CONFIRM_RESET_PASSWORD_HEADING: 'Reset your Password',
|
|
16
16
|
CONFIRM_SIGNUP_HEADING: 'Confirm Sign Up',
|
|
17
17
|
CONFIRM_SMS: 'Confirm SMS Code',
|
|
18
|
+
// If challenge name is not returned
|
|
19
|
+
CONFIRM_MFA_DEFAULT: 'Confirm MFA Code',
|
|
18
20
|
CONFIRM_TOTP: 'Confirm TOTP Code',
|
|
19
21
|
CONFIRM: 'Confirm',
|
|
20
22
|
CONFIRMATION_CODE: 'Confirmation Code',
|
|
@@ -9,6 +9,7 @@ const enDict = {
|
|
|
9
9
|
'Confirm Password': 'Confirm Password',
|
|
10
10
|
'Confirm Sign Up': 'Confirm Sign Up',
|
|
11
11
|
'Confirm SMS Code': 'Confirm SMS Code',
|
|
12
|
+
'Confirm MFA Code': 'Confirm MFA Code',
|
|
12
13
|
'Confirm TOTP Code': 'Confirm TOTP Code',
|
|
13
14
|
Confirm: 'Confirm',
|
|
14
15
|
'Confirmation Code': 'Confirmation Code',
|
|
@@ -20,7 +20,7 @@ const heDict = {
|
|
|
20
20
|
'Enter your Email': 'הכנס את המייל שלך',
|
|
21
21
|
'Enter your phone number': 'הכנס את מספר הטלפון שלך',
|
|
22
22
|
'Enter your username': 'הכנס את שם המתמש שלך',
|
|
23
|
-
'Forgot your password?': '
|
|
23
|
+
'Forgot your password?': 'שכחת סיסמא ?',
|
|
24
24
|
'Hide password': 'הסתר סיסמא',
|
|
25
25
|
Loading: 'טוען',
|
|
26
26
|
'New password': 'סיסמא חדשה',
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ export { defaultAuthHubHandler, listenToAuthHub } from './helpers/authenticator/
|
|
|
3
3
|
export { getNextServiceContextFacade, getNextServiceFacade, getSendEventAliases, getServiceContextFacade, getServiceFacade } from './helpers/authenticator/facade.mjs';
|
|
4
4
|
export { ALLOWED_SPECIAL_CHARACTERS, NAVIGABLE_ROUTE_EVENT, defaultFormFieldOptions, emailRegex } from './helpers/authenticator/constants.mjs';
|
|
5
5
|
export { getErrors, getFormDataFromEvent, isAuthFieldWithDefaults, setFormOrder } from './helpers/authenticator/form.mjs';
|
|
6
|
-
export { censorAllButFirstAndLast, censorPhoneNumber, getTotpCodeURL, hasSpecialChars, isValidEmail, trimValues } from './helpers/authenticator/utils.mjs';
|
|
6
|
+
export { censorAllButFirstAndLast, censorContactMethod, censorEmail, censorPhoneNumber, getTotpCodeURL, hasSpecialChars, isValidEmail, trimValues } from './helpers/authenticator/utils.mjs';
|
|
7
7
|
export { getCustomFormFields, getDefaultFormFields, getFormFields, getSortedFormFields, removeOrderKeys } from './helpers/authenticator/formFields/formFields.mjs';
|
|
8
8
|
export { DEFAULT_COUNTRY_CODE, defaultFormFieldsGetters, getAliasDefaultFormField } from './helpers/authenticator/formFields/defaults.mjs';
|
|
9
9
|
export { applyTranslation, getPrimaryAlias, sortFormFields } from './helpers/authenticator/formFields/utils.mjs';
|
|
@@ -276,6 +276,7 @@ function createAuthenticatorMachine(options) {
|
|
|
276
276
|
]),
|
|
277
277
|
setActorDoneData: assign({
|
|
278
278
|
actorDoneData: (context, event) => ({
|
|
279
|
+
challengeName: event.data.challengeName,
|
|
279
280
|
codeDeliveryDetails: event.data.codeDeliveryDetails,
|
|
280
281
|
missingAttributes: event.data.missingAttributes,
|
|
281
282
|
remoteError: event.data.remoteError,
|
package/dist/index.js
CHANGED
|
@@ -752,6 +752,7 @@ const enDict$1 = {
|
|
|
752
752
|
'Confirm Password': 'Confirm Password',
|
|
753
753
|
'Confirm Sign Up': 'Confirm Sign Up',
|
|
754
754
|
'Confirm SMS Code': 'Confirm SMS Code',
|
|
755
|
+
'Confirm MFA Code': 'Confirm MFA Code',
|
|
755
756
|
'Confirm TOTP Code': 'Confirm TOTP Code',
|
|
756
757
|
Confirm: 'Confirm',
|
|
757
758
|
'Confirmation Code': 'Confirmation Code',
|
|
@@ -1919,7 +1920,7 @@ const heDict$1 = {
|
|
|
1919
1920
|
'Enter your Email': 'הכנס את המייל שלך',
|
|
1920
1921
|
'Enter your phone number': 'הכנס את מספר הטלפון שלך',
|
|
1921
1922
|
'Enter your username': 'הכנס את שם המתמש שלך',
|
|
1922
|
-
'Forgot your password?': '
|
|
1923
|
+
'Forgot your password?': 'שכחת סיסמא ?',
|
|
1923
1924
|
'Hide password': 'הסתר סיסמא',
|
|
1924
1925
|
Loading: 'טוען',
|
|
1925
1926
|
'New password': 'סיסמא חדשה',
|
|
@@ -2050,6 +2051,8 @@ const defaultTexts$1 = {
|
|
|
2050
2051
|
CONFIRM_RESET_PASSWORD_HEADING: 'Reset your Password',
|
|
2051
2052
|
CONFIRM_SIGNUP_HEADING: 'Confirm Sign Up',
|
|
2052
2053
|
CONFIRM_SMS: 'Confirm SMS Code',
|
|
2054
|
+
// If challenge name is not returned
|
|
2055
|
+
CONFIRM_MFA_DEFAULT: 'Confirm MFA Code',
|
|
2053
2056
|
CONFIRM_TOTP: 'Confirm TOTP Code',
|
|
2054
2057
|
CONFIRM: 'Confirm',
|
|
2055
2058
|
CONFIRMATION_CODE: 'Confirmation Code',
|
|
@@ -2815,6 +2818,18 @@ const censorPhoneNumber = (val) => {
|
|
|
2815
2818
|
}
|
|
2816
2819
|
return split.join('');
|
|
2817
2820
|
};
|
|
2821
|
+
// censors all but the first and last of the name of an email and keeps domain
|
|
2822
|
+
const censorEmail = (val) => {
|
|
2823
|
+
const splitEmail = val.split('@');
|
|
2824
|
+
const censoredName = censorAllButFirstAndLast(splitEmail[0]);
|
|
2825
|
+
return `${censoredName}@${splitEmail[1]}`;
|
|
2826
|
+
};
|
|
2827
|
+
// based on the ContactMethod type, returns a censored contact value
|
|
2828
|
+
const censorContactMethod = (type, value) => {
|
|
2829
|
+
return type === 'Phone Number'
|
|
2830
|
+
? censorPhoneNumber(value)
|
|
2831
|
+
: censorEmail(value);
|
|
2832
|
+
};
|
|
2818
2833
|
const hasSpecialChars = (password) => ALLOWED_SPECIAL_CHARACTERS.some((char) => password.includes(char));
|
|
2819
2834
|
const getTotpCodeURL = (issuer, username, secret) => encodeURI(`otpauth://totp/${issuer}:${username}?secret=${secret}&issuer=${issuer}`);
|
|
2820
2835
|
function trimValues(values, ...ignored) {
|
|
@@ -3051,7 +3066,7 @@ const getChallengeText = (challengeName) => {
|
|
|
3051
3066
|
case 'SOFTWARE_TOKEN_MFA':
|
|
3052
3067
|
return translate(DefaultTexts.CONFIRM_TOTP);
|
|
3053
3068
|
default:
|
|
3054
|
-
|
|
3069
|
+
return translate(DefaultTexts.CONFIRM_MFA_DEFAULT);
|
|
3055
3070
|
}
|
|
3056
3071
|
};
|
|
3057
3072
|
/**
|
|
@@ -4888,6 +4903,7 @@ function createAuthenticatorMachine(options) {
|
|
|
4888
4903
|
]),
|
|
4889
4904
|
setActorDoneData: xstate.assign({
|
|
4890
4905
|
actorDoneData: (context, event) => ({
|
|
4906
|
+
challengeName: event.data.challengeName,
|
|
4891
4907
|
codeDeliveryDetails: event.data.codeDeliveryDetails,
|
|
4892
4908
|
missingAttributes: event.data.missingAttributes,
|
|
4893
4909
|
remoteError: event.data.remoteError,
|
|
@@ -6036,8 +6052,11 @@ const checkbox = {
|
|
|
6036
6052
|
},
|
|
6037
6053
|
},
|
|
6038
6054
|
label: {
|
|
6055
|
+
color: { value: '{components.text.color.value}' },
|
|
6039
6056
|
_disabled: {
|
|
6040
|
-
color: {
|
|
6057
|
+
color: {
|
|
6058
|
+
value: '{colors.font.disabled.value}',
|
|
6059
|
+
},
|
|
6041
6060
|
},
|
|
6042
6061
|
},
|
|
6043
6062
|
};
|
|
@@ -8323,6 +8342,8 @@ exports.authFieldsWithDefaults = authFieldsWithDefaults;
|
|
|
8323
8342
|
exports.authenticatorTextUtil = authenticatorTextUtil;
|
|
8324
8343
|
exports.capitalize = capitalize;
|
|
8325
8344
|
exports.censorAllButFirstAndLast = censorAllButFirstAndLast;
|
|
8345
|
+
exports.censorContactMethod = censorContactMethod;
|
|
8346
|
+
exports.censorEmail = censorEmail;
|
|
8326
8347
|
exports.censorPhoneNumber = censorPhoneNumber;
|
|
8327
8348
|
exports.changePassword = changePassword;
|
|
8328
8349
|
exports.classNameModifier = classNameModifier;
|
package/dist/styles/base.css
CHANGED
|
@@ -512,6 +512,7 @@
|
|
|
512
512
|
--amplify-components-checkbox-icon-indeterminate-opacity: var(--amplify-opacities-100);
|
|
513
513
|
--amplify-components-checkbox-icon-indeterminate-transform: scale(1);
|
|
514
514
|
--amplify-components-checkbox-icon-indeterminate-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
515
|
+
--amplify-components-checkbox-label-color: var(--amplify-components-text-color);
|
|
515
516
|
--amplify-components-checkbox-label-disabled-color: var(--amplify-colors-font-disabled);
|
|
516
517
|
--amplify-components-checkboxfield-align-items: flex-start;
|
|
517
518
|
--amplify-components-checkboxfield-align-content: center;
|
|
@@ -513,6 +513,7 @@
|
|
|
513
513
|
--amplify-components-checkbox-icon-indeterminate-opacity: var(--amplify-opacities-100);
|
|
514
514
|
--amplify-components-checkbox-icon-indeterminate-transform: scale(1);
|
|
515
515
|
--amplify-components-checkbox-icon-indeterminate-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
516
|
+
--amplify-components-checkbox-label-color: var(--amplify-components-text-color);
|
|
516
517
|
--amplify-components-checkbox-label-disabled-color: var(--amplify-colors-font-disabled);
|
|
517
518
|
--amplify-components-checkboxfield-align-items: flex-start;
|
|
518
519
|
--amplify-components-checkboxfield-align-content: center;
|
package/dist/styles/checkbox.css
CHANGED
package/dist/styles/liveness.css
CHANGED
package/dist/styles.css
CHANGED
|
@@ -512,6 +512,7 @@
|
|
|
512
512
|
--amplify-components-checkbox-icon-indeterminate-opacity: var(--amplify-opacities-100);
|
|
513
513
|
--amplify-components-checkbox-icon-indeterminate-transform: scale(1);
|
|
514
514
|
--amplify-components-checkbox-icon-indeterminate-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
515
|
+
--amplify-components-checkbox-label-color: var(--amplify-components-text-color);
|
|
515
516
|
--amplify-components-checkbox-label-disabled-color: var(--amplify-colors-font-disabled);
|
|
516
517
|
--amplify-components-checkboxfield-align-items: flex-start;
|
|
517
518
|
--amplify-components-checkboxfield-align-content: center;
|
|
@@ -3668,7 +3669,10 @@ strong.amplify-text {
|
|
|
3668
3669
|
}
|
|
3669
3670
|
|
|
3670
3671
|
.amplify-checkbox__label {
|
|
3671
|
-
color:
|
|
3672
|
+
color: var(--amplify-components-checkbox-label-color);
|
|
3673
|
+
}
|
|
3674
|
+
.amplify-checkbox__label--disabled {
|
|
3675
|
+
color: var(--amplify-components-checkbox-label-disabled-color);
|
|
3672
3676
|
}
|
|
3673
3677
|
|
|
3674
3678
|
.amplify-checkboxfield {
|
|
@@ -4201,7 +4205,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
|
|
|
4201
4205
|
|
|
4202
4206
|
.amplify-liveness-landscape-error-modal {
|
|
4203
4207
|
background-color: var(--amplify-colors-background-primary);
|
|
4204
|
-
direction: column;
|
|
4208
|
+
flex-direction: column;
|
|
4205
4209
|
text-align: center;
|
|
4206
4210
|
align-items: center;
|
|
4207
4211
|
justify-content: center;
|
package/dist/styles.layer.css
CHANGED
|
@@ -513,6 +513,7 @@
|
|
|
513
513
|
--amplify-components-checkbox-icon-indeterminate-opacity: var(--amplify-opacities-100);
|
|
514
514
|
--amplify-components-checkbox-icon-indeterminate-transform: scale(1);
|
|
515
515
|
--amplify-components-checkbox-icon-indeterminate-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
516
|
+
--amplify-components-checkbox-label-color: var(--amplify-components-text-color);
|
|
516
517
|
--amplify-components-checkbox-label-disabled-color: var(--amplify-colors-font-disabled);
|
|
517
518
|
--amplify-components-checkboxfield-align-items: flex-start;
|
|
518
519
|
--amplify-components-checkboxfield-align-content: center;
|
|
@@ -3669,7 +3670,10 @@ strong.amplify-text {
|
|
|
3669
3670
|
}
|
|
3670
3671
|
|
|
3671
3672
|
.amplify-checkbox__label {
|
|
3672
|
-
color:
|
|
3673
|
+
color: var(--amplify-components-checkbox-label-color);
|
|
3674
|
+
}
|
|
3675
|
+
.amplify-checkbox__label--disabled {
|
|
3676
|
+
color: var(--amplify-components-checkbox-label-disabled-color);
|
|
3673
3677
|
}
|
|
3674
3678
|
|
|
3675
3679
|
.amplify-checkboxfield {
|
|
@@ -4202,7 +4206,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
|
|
|
4202
4206
|
|
|
4203
4207
|
.amplify-liveness-landscape-error-modal {
|
|
4204
4208
|
background-color: var(--amplify-colors-background-primary);
|
|
4205
|
-
direction: column;
|
|
4209
|
+
flex-direction: column;
|
|
4206
4210
|
text-align: center;
|
|
4207
4211
|
align-items: center;
|
|
4208
4212
|
justify-content: center;
|
package/dist/theme.css
CHANGED
|
@@ -509,6 +509,7 @@
|
|
|
509
509
|
--amplify-components-checkbox-icon-indeterminate-opacity: var(--amplify-opacities-100);
|
|
510
510
|
--amplify-components-checkbox-icon-indeterminate-transform: scale(1);
|
|
511
511
|
--amplify-components-checkbox-icon-indeterminate-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
512
|
+
--amplify-components-checkbox-label-color: var(--amplify-components-text-color);
|
|
512
513
|
--amplify-components-checkbox-label-disabled-color: var(--amplify-colors-font-disabled);
|
|
513
514
|
--amplify-components-checkboxfield-align-items: flex-start;
|
|
514
515
|
--amplify-components-checkboxfield-align-content: center;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { ContactMethod } from '../../types';
|
|
1
2
|
export declare const censorAllButFirstAndLast: (value: string) => string;
|
|
2
3
|
export declare const censorPhoneNumber: (val: string) => string;
|
|
4
|
+
export declare const censorEmail: (val: string) => string;
|
|
5
|
+
export declare const censorContactMethod: (type: ContactMethod, value: string) => string;
|
|
3
6
|
export declare const hasSpecialChars: (password: string) => boolean;
|
|
4
7
|
export declare const getTotpCodeURL: (issuer: string, username: string, secret: string) => string;
|
|
5
8
|
export declare function trimValues<T extends Record<string, string>>(values: T, ...ignored: string[]): T;
|
|
@@ -26,6 +26,7 @@ export declare const DefaultTexts: {
|
|
|
26
26
|
readonly CONFIRM_RESET_PASSWORD_HEADING: string;
|
|
27
27
|
readonly CONFIRM_SIGNUP_HEADING: string;
|
|
28
28
|
readonly CONFIRM_SMS: string;
|
|
29
|
+
readonly CONFIRM_MFA_DEFAULT: string;
|
|
29
30
|
readonly CONFIRM_TOTP: string;
|
|
30
31
|
readonly CONFIRM: string;
|
|
31
32
|
readonly CONFIRMATION_CODE: string;
|
|
@@ -50,6 +50,7 @@ export interface AuthEvent {
|
|
|
50
50
|
* Data that actor returns when they are done and reach the final state
|
|
51
51
|
*/
|
|
52
52
|
export interface ActorDoneData {
|
|
53
|
+
challengeName?: ChallengeName;
|
|
53
54
|
codeDeliveryDetails?: V5CodeDeliveryDetails;
|
|
54
55
|
missingAttributes?: string[];
|
|
55
56
|
remoteError?: string;
|
|
@@ -20,7 +20,7 @@ export type CheckboxTokens<Output extends OutputVariantKey> = DesignTokenPropert
|
|
|
20
20
|
_disabled?: DesignTokenProperties<'cursor', Output>;
|
|
21
21
|
button?: ButtonToken<Output>;
|
|
22
22
|
icon?: IconToken<Output>;
|
|
23
|
-
label?: {
|
|
23
|
+
label?: DesignTokenProperties<'color', Output> & {
|
|
24
24
|
_disabled?: DesignTokenProperties<'color', Output>;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -51,6 +51,8 @@ export interface FormFieldOptions {
|
|
|
51
51
|
type?: string;
|
|
52
52
|
/** Desired autocomplete HTML attribute */
|
|
53
53
|
autocomplete?: string;
|
|
54
|
+
/** Whether the first character is auto-capitalized */
|
|
55
|
+
autocapitalize?: string;
|
|
54
56
|
}
|
|
55
57
|
export interface LegacyFormFieldOptions extends FormFieldOptions {
|
|
56
58
|
name: string;
|