@aws-amplify/ui 3.12.5 → 3.13.2
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/facade.js +1 -1
- package/dist/esm/helpers/authenticator/form.js +1 -1
- package/dist/esm/helpers/authenticator/formFields/defaults.js +1 -1
- package/dist/esm/helpers/authenticator/formFields/util.js +1 -1
- package/dist/esm/helpers/authenticator/utils.js +1 -1
- package/dist/esm/i18n/dictionaries/index.js +1 -1
- package/dist/esm/i18n/translations.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/machines/authenticator/actions.js +1 -1
- package/dist/esm/machines/authenticator/actors/resetPassword.js +1 -1
- package/dist/esm/machines/authenticator/actors/signIn.js +1 -1
- package/dist/esm/machines/authenticator/defaultServices.js +1 -1
- package/dist/esm/machines/authenticator/index.js +1 -1
- package/dist/esm/machines/authenticator/signUp.js +1 -1
- package/dist/esm/theme/createTheme.js +1 -1
- package/dist/esm/theme/tokens/components/checkbox.js +1 -1
- package/dist/esm/theme/tokens/components/{countryCodeSelect.js → dialCodeSelect.js} +1 -1
- package/dist/esm/theme/tokens/components/index.js +1 -1
- package/dist/esm/theme/tokens/components/searchField.js +1 -1
- package/dist/esm/theme/tokens/components/select.js +1 -1
- package/dist/esm/theme/tokens/components/switchField.js +1 -1
- package/dist/esm/theme/utils.js +1 -1
- package/dist/esm/types/authenticator/attributes.js +1 -1
- package/dist/esm/types/authenticator/user.js +1 -1
- package/dist/esm/validators/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +22 -10
- package/dist/theme.css +7 -1
- package/dist/types/helpers/authenticator/facade.d.ts +25 -50
- package/dist/types/helpers/authenticator/utils.d.ts +1 -0
- package/dist/types/machines/authenticator/defaultServices.d.ts +2 -2
- package/dist/types/theme/tokens/components/checkbox.d.ts +6 -0
- package/dist/types/theme/tokens/components/dialCodeSelect.d.ts +5 -0
- package/dist/types/theme/tokens/components/index.d.ts +2 -2
- package/dist/types/theme/tokens/components/searchField.d.ts +2 -1
- package/dist/types/theme/tokens/components/select.d.ts +3 -0
- package/dist/types/theme/tokens/components/switchField.d.ts +1 -0
- package/dist/types/types/authenticator/stateMachine/context.d.ts +4 -4
- package/dist/types/types/authenticator/user.d.ts +3 -9
- package/dist/types/types/authenticator/validator.d.ts +0 -2
- package/package.json +4 -4
- package/dist/esm/node_modules/tslib/tslib.es6.js +0 -1
- package/dist/types/theme/tokens/components/countryCodeSelect.d.ts +0 -5
package/dist/styles.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Do not edit directly
|
|
6
|
-
* Generated on
|
|
6
|
+
* Generated on Tue, 06 Sep 2022 22:47:36 GMT
|
|
7
7
|
*/
|
|
8
8
|
:root, [data-amplify-theme] {
|
|
9
9
|
--amplify-transforms-slide-x-large: translateX(2em);
|
|
@@ -290,6 +290,7 @@
|
|
|
290
290
|
--amplify-components-checkboxfield-flex-direction: column;
|
|
291
291
|
--amplify-components-checkboxfield-align-content: center;
|
|
292
292
|
--amplify-components-checkboxfield-align-items: flex-start;
|
|
293
|
+
--amplify-components-checkbox-icon-indeterminate-transform: scale(1);
|
|
293
294
|
--amplify-components-checkbox-icon-checked-transform: scale(1);
|
|
294
295
|
--amplify-components-checkbox-icon-transition-timing-function: ease-in-out;
|
|
295
296
|
--amplify-components-checkbox-icon-transition-property: all;
|
|
@@ -440,6 +441,7 @@
|
|
|
440
441
|
--amplify-components-switchfield-label-padding: var(--amplify-space-xs);
|
|
441
442
|
--amplify-components-switchfield-small-font-size: var(--amplify-font-sizes-small);
|
|
442
443
|
--amplify-components-switchfield-large-font-size: var(--amplify-font-sizes-large);
|
|
444
|
+
--amplify-components-switchfield-font-size: var(--amplify-font-sizes-medium);
|
|
443
445
|
--amplify-components-switchfield-disabled-opacity: var(--amplify-opacities-60);
|
|
444
446
|
--amplify-components-stepperfield-button-background-color: var(--amplify-colors-transparent);
|
|
445
447
|
--amplify-components-sliderfield-thumb-border-width: var(--amplify-border-widths-medium);
|
|
@@ -583,6 +585,7 @@
|
|
|
583
585
|
--amplify-components-copy-tool-tip-bottom: var(--amplify-space-large);
|
|
584
586
|
--amplify-components-copy-gap: var(--amplify-space-relative-medium);
|
|
585
587
|
--amplify-components-copy-font-size: var(--amplify-font-sizes-xs);
|
|
588
|
+
--amplify-components-checkbox-icon-indeterminate-opacity: var(--amplify-opacities-100);
|
|
586
589
|
--amplify-components-checkbox-icon-checked-opacity: var(--amplify-opacities-100);
|
|
587
590
|
--amplify-components-checkbox-icon-transition-duration: var(--amplify-time-short);
|
|
588
591
|
--amplify-components-checkbox-icon-opacity: var(--amplify-opacities-0);
|
|
@@ -684,8 +687,10 @@
|
|
|
684
687
|
--amplify-components-sliderfield-thumb-background-color: var(--amplify-colors-background-primary);
|
|
685
688
|
--amplify-components-sliderfield-range-background-color: var(--amplify-colors-brand-primary-80);
|
|
686
689
|
--amplify-components-sliderfield-track-background-color: var(--amplify-colors-background-quaternary);
|
|
690
|
+
--amplify-components-select-option-disabled-color: var(--amplify-colors-font-disabled);
|
|
687
691
|
--amplify-components-select-option-color: var(--amplify-colors-font-primary);
|
|
688
692
|
--amplify-components-select-option-background-color: var(--amplify-colors-background-primary);
|
|
693
|
+
--amplify-components-searchfield-button-background-color: var(--amplify-colors-background-primary);
|
|
689
694
|
--amplify-components-rating-empty-color: var(--amplify-colors-background-tertiary);
|
|
690
695
|
--amplify-components-rating-filled-color: var(--amplify-colors-brand-secondary-80);
|
|
691
696
|
--amplify-components-radiogroup-radio-border-width: var(--amplify-components-radio-button-border-width);
|
|
@@ -895,6 +900,7 @@
|
|
|
895
900
|
--amplify-components-collection-pagination-button-hover-color: var(--amplify-components-pagination-button-hover-color);
|
|
896
901
|
--amplify-components-collection-pagination-button-color: var(--amplify-components-pagination-button-color);
|
|
897
902
|
--amplify-components-collection-pagination-current-color: var(--amplify-components-pagination-current-color);
|
|
903
|
+
--amplify-components-checkbox-icon-indeterminate-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
898
904
|
--amplify-components-checkbox-icon-checked-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
899
905
|
--amplify-components-checkbox-button-disabled-border-color: var(--amplify-colors-border-disabled);
|
|
900
906
|
--amplify-components-checkbox-button-focus-box-shadow: 0px 0px 0px 2px var(--amplify-colors-border-focus);
|
|
@@ -987,10 +993,8 @@ select {
|
|
|
987
993
|
}
|
|
988
994
|
}
|
|
989
995
|
[class*=amplify] {
|
|
990
|
-
all: unset;
|
|
991
|
-
/*
|
|
992
|
-
box-sizing: border-box;
|
|
993
|
-
/* set box-sizing after unset above */
|
|
996
|
+
all: unset; /* protect against external styles */
|
|
997
|
+
box-sizing: border-box; /* set box-sizing after unset above */
|
|
994
998
|
}
|
|
995
999
|
|
|
996
1000
|
.amplify-flex {
|
|
@@ -1124,7 +1128,6 @@ strong.amplify-text {
|
|
|
1124
1128
|
transition: all var(--amplify-components-button-transition-duration);
|
|
1125
1129
|
-webkit-user-select: none;
|
|
1126
1130
|
-moz-user-select: none;
|
|
1127
|
-
-ms-user-select: none;
|
|
1128
1131
|
user-select: none;
|
|
1129
1132
|
--amplify-internal-button-disabled-color: var(
|
|
1130
1133
|
--amplify-components-button-disabled-color
|
|
@@ -1449,7 +1452,6 @@ strong.amplify-text {
|
|
|
1449
1452
|
outline-offset: var(--amplify-components-fieldcontrol-outline-offset);
|
|
1450
1453
|
-webkit-user-select: text;
|
|
1451
1454
|
-moz-user-select: text;
|
|
1452
|
-
-ms-user-select: text;
|
|
1453
1455
|
user-select: text;
|
|
1454
1456
|
}
|
|
1455
1457
|
.amplify-input:focus {
|
|
@@ -1536,7 +1538,6 @@ strong.amplify-text {
|
|
|
1536
1538
|
outline-offset: var(--amplify-components-fieldcontrol-outline-offset);
|
|
1537
1539
|
-webkit-user-select: text;
|
|
1538
1540
|
-moz-user-select: text;
|
|
1539
|
-
-ms-user-select: text;
|
|
1540
1541
|
user-select: text;
|
|
1541
1542
|
white-space: pre-wrap;
|
|
1542
1543
|
}
|
|
@@ -2130,6 +2131,13 @@ strong.amplify-text {
|
|
|
2130
2131
|
--amplify-components-checkbox-icon-checked-disabled-background-color
|
|
2131
2132
|
);
|
|
2132
2133
|
}
|
|
2134
|
+
.amplify-checkbox__icon--indeterminate {
|
|
2135
|
+
opacity: var(--amplify-components-checkbox-icon-indeterminate-opacity);
|
|
2136
|
+
transform: var(--amplify-components-checkbox-icon-indeterminate-transform);
|
|
2137
|
+
--amplify-internal-checkbox-icon-disabled-background-color: var(
|
|
2138
|
+
--amplify-components-checkbox-icon-indeterminate-disabled-background-color
|
|
2139
|
+
);
|
|
2140
|
+
}
|
|
2133
2141
|
.amplify-checkbox__icon--disabled {
|
|
2134
2142
|
background-color: var(--amplify-internal-checkbox-icon-disabled-background-color);
|
|
2135
2143
|
}
|
|
@@ -2145,7 +2153,7 @@ strong.amplify-text {
|
|
|
2145
2153
|
justify-content: var(--amplify-components-checkboxfield-justify-content);
|
|
2146
2154
|
}
|
|
2147
2155
|
|
|
2148
|
-
.amplify-
|
|
2156
|
+
.amplify-dialcodeselect {
|
|
2149
2157
|
height: var(--amplify-components-countrycodeselect-height);
|
|
2150
2158
|
}
|
|
2151
2159
|
|
|
@@ -2840,6 +2848,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
|
|
|
2840
2848
|
}
|
|
2841
2849
|
.amplify-searchfield__search {
|
|
2842
2850
|
color: var(--amplify-components-searchfield-button-color);
|
|
2851
|
+
background-color: var(--amplify-components-searchfield-button-background-color);
|
|
2843
2852
|
}
|
|
2844
2853
|
.amplify-searchfield__search:active {
|
|
2845
2854
|
background-color: var(--amplify-components-button-active-background-color);
|
|
@@ -2967,6 +2976,9 @@ html[dir=rtl] .amplify-field-group__inner-start {
|
|
|
2967
2976
|
.amplify-select option {
|
|
2968
2977
|
color: initial;
|
|
2969
2978
|
}
|
|
2979
|
+
.amplify-select option[disabled=""] {
|
|
2980
|
+
color: var(--amplify-components-select-option-disabled-color);
|
|
2981
|
+
}
|
|
2970
2982
|
@-moz-document url-prefix() {
|
|
2971
2983
|
.amplify-select option {
|
|
2972
2984
|
background-color: var(--amplify-components-select-option-background-color);
|
|
@@ -3017,7 +3029,6 @@ html[dir=rtl] .amplify-field-group__inner-start {
|
|
|
3017
3029
|
touch-action: none;
|
|
3018
3030
|
-webkit-user-select: none;
|
|
3019
3031
|
-moz-user-select: none;
|
|
3020
|
-
-ms-user-select: none;
|
|
3021
3032
|
user-select: none;
|
|
3022
3033
|
--amplify-internal-sliderfield-root-height: var(
|
|
3023
3034
|
--amplify-components-sliderfield-thumb-height
|
|
@@ -3228,6 +3239,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
|
|
|
3228
3239
|
|
|
3229
3240
|
.amplify-switchfield {
|
|
3230
3241
|
display: inline-block;
|
|
3242
|
+
font-size: var(--amplify-components-switchfield-font-size);
|
|
3231
3243
|
}
|
|
3232
3244
|
.amplify-switchfield--small {
|
|
3233
3245
|
font-size: var(--amplify-components-switchfield-small-font-size);
|
package/dist/theme.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Tue, 06 Sep 2022 22:47:36 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
:root, [data-amplify-theme] {
|
|
@@ -288,6 +288,7 @@
|
|
|
288
288
|
--amplify-components-checkboxfield-flex-direction: column;
|
|
289
289
|
--amplify-components-checkboxfield-align-content: center;
|
|
290
290
|
--amplify-components-checkboxfield-align-items: flex-start;
|
|
291
|
+
--amplify-components-checkbox-icon-indeterminate-transform: scale(1);
|
|
291
292
|
--amplify-components-checkbox-icon-checked-transform: scale(1);
|
|
292
293
|
--amplify-components-checkbox-icon-transition-timing-function: ease-in-out;
|
|
293
294
|
--amplify-components-checkbox-icon-transition-property: all;
|
|
@@ -438,6 +439,7 @@
|
|
|
438
439
|
--amplify-components-switchfield-label-padding: var(--amplify-space-xs);
|
|
439
440
|
--amplify-components-switchfield-small-font-size: var(--amplify-font-sizes-small);
|
|
440
441
|
--amplify-components-switchfield-large-font-size: var(--amplify-font-sizes-large);
|
|
442
|
+
--amplify-components-switchfield-font-size: var(--amplify-font-sizes-medium);
|
|
441
443
|
--amplify-components-switchfield-disabled-opacity: var(--amplify-opacities-60);
|
|
442
444
|
--amplify-components-stepperfield-button-background-color: var(--amplify-colors-transparent);
|
|
443
445
|
--amplify-components-sliderfield-thumb-border-width: var(--amplify-border-widths-medium);
|
|
@@ -581,6 +583,7 @@
|
|
|
581
583
|
--amplify-components-copy-tool-tip-bottom: var(--amplify-space-large);
|
|
582
584
|
--amplify-components-copy-gap: var(--amplify-space-relative-medium);
|
|
583
585
|
--amplify-components-copy-font-size: var(--amplify-font-sizes-xs);
|
|
586
|
+
--amplify-components-checkbox-icon-indeterminate-opacity: var(--amplify-opacities-100);
|
|
584
587
|
--amplify-components-checkbox-icon-checked-opacity: var(--amplify-opacities-100);
|
|
585
588
|
--amplify-components-checkbox-icon-transition-duration: var(--amplify-time-short);
|
|
586
589
|
--amplify-components-checkbox-icon-opacity: var(--amplify-opacities-0);
|
|
@@ -682,8 +685,10 @@
|
|
|
682
685
|
--amplify-components-sliderfield-thumb-background-color: var(--amplify-colors-background-primary);
|
|
683
686
|
--amplify-components-sliderfield-range-background-color: var(--amplify-colors-brand-primary-80);
|
|
684
687
|
--amplify-components-sliderfield-track-background-color: var(--amplify-colors-background-quaternary);
|
|
688
|
+
--amplify-components-select-option-disabled-color: var(--amplify-colors-font-disabled);
|
|
685
689
|
--amplify-components-select-option-color: var(--amplify-colors-font-primary);
|
|
686
690
|
--amplify-components-select-option-background-color: var(--amplify-colors-background-primary);
|
|
691
|
+
--amplify-components-searchfield-button-background-color: var(--amplify-colors-background-primary);
|
|
687
692
|
--amplify-components-rating-empty-color: var(--amplify-colors-background-tertiary);
|
|
688
693
|
--amplify-components-rating-filled-color: var(--amplify-colors-brand-secondary-80);
|
|
689
694
|
--amplify-components-radiogroup-radio-border-width: var(--amplify-components-radio-button-border-width);
|
|
@@ -893,6 +898,7 @@
|
|
|
893
898
|
--amplify-components-collection-pagination-button-hover-color: var(--amplify-components-pagination-button-hover-color);
|
|
894
899
|
--amplify-components-collection-pagination-button-color: var(--amplify-components-pagination-button-color);
|
|
895
900
|
--amplify-components-collection-pagination-current-color: var(--amplify-components-pagination-current-color);
|
|
901
|
+
--amplify-components-checkbox-icon-indeterminate-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
896
902
|
--amplify-components-checkbox-icon-checked-disabled-background-color: var(--amplify-colors-background-disabled);
|
|
897
903
|
--amplify-components-checkbox-button-disabled-border-color: var(--amplify-colors-border-disabled);
|
|
898
904
|
--amplify-components-checkbox-button-focus-box-shadow: 0px 0px 0px 2px var(--amplify-colors-border-focus);
|
|
@@ -4,7 +4,24 @@
|
|
|
4
4
|
* `useAuthenticator` hook/composable/service.
|
|
5
5
|
*/
|
|
6
6
|
import { Sender } from 'xstate';
|
|
7
|
-
import { AuthEvent, AuthEventData, AuthMachineState } from '../../types';
|
|
7
|
+
import { AuthEvent, AuthEventData, AuthMachineState, CodeDeliveryDetails, CognitoUserAmplify, ValidationError } from '../../types';
|
|
8
|
+
declare type AuthenticatorRoute = 'authenticated' | 'autoSignIn' | 'confirmResetPassword' | 'confirmSignIn' | 'confirmSignUp' | 'confirmVerifyUser' | 'forceNewPassword' | 'idle' | 'resetPassword' | 'setup' | 'signOut' | 'setupTOTP' | 'signIn' | 'signUp' | 'verifyUser';
|
|
9
|
+
declare type AuthenticatorValidationErrors = ValidationError;
|
|
10
|
+
declare type AuthStatus = 'configuring' | 'authenticated' | 'unauthenticated';
|
|
11
|
+
interface AuthenticatorServiceContextFacade {
|
|
12
|
+
authStatus: AuthStatus;
|
|
13
|
+
codeDeliveryDetails: CodeDeliveryDetails;
|
|
14
|
+
error: string;
|
|
15
|
+
hasValidationErrors: boolean;
|
|
16
|
+
isPending: boolean;
|
|
17
|
+
route: AuthenticatorRoute;
|
|
18
|
+
user: CognitoUserAmplify;
|
|
19
|
+
validationErrors: AuthenticatorValidationErrors;
|
|
20
|
+
}
|
|
21
|
+
declare type SendEventAlias = 'resendCode' | 'signOut' | 'submitForm' | 'updateForm' | 'updateBlur' | 'toFederatedSignIn' | 'toResetPassword' | 'toSignIn' | 'toSignUp' | 'skipVerification';
|
|
22
|
+
declare type AuthenticatorSendEventAliases = Record<SendEventAlias, (data?: AuthEventData) => void>;
|
|
23
|
+
export interface AuthenticatorServiceFacade extends AuthenticatorSendEventAliases, AuthenticatorServiceContextFacade {
|
|
24
|
+
}
|
|
8
25
|
/**
|
|
9
26
|
* Creates public facing auth helpers that abstracts out xstate implementation
|
|
10
27
|
* detail. Each framework implementation can export these helpers so that
|
|
@@ -16,52 +33,10 @@ import { AuthEvent, AuthEventData, AuthMachineState } from '../../types';
|
|
|
16
33
|
* submit({ username, password})
|
|
17
34
|
* ```
|
|
18
35
|
*/
|
|
19
|
-
export declare const getSendEventAliases: (send: Sender<AuthEvent>) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
readonly toResetPassword: (data?: AuthEventData) => void;
|
|
27
|
-
readonly toSignIn: (data?: AuthEventData) => void;
|
|
28
|
-
readonly toSignUp: (data?: AuthEventData) => void;
|
|
29
|
-
readonly skipVerification: (data?: AuthEventData) => void;
|
|
30
|
-
};
|
|
31
|
-
export declare const getServiceContextFacade: (state: AuthMachineState) => {
|
|
32
|
-
error: string;
|
|
33
|
-
hasValidationErrors: boolean;
|
|
34
|
-
isPending: boolean;
|
|
35
|
-
route: string;
|
|
36
|
-
authStatus: string;
|
|
37
|
-
user: import("../../types").CognitoUserAmplify;
|
|
38
|
-
validationErrors: {
|
|
39
|
-
[x: string]: string | string[];
|
|
40
|
-
};
|
|
41
|
-
codeDeliveryDetails: import("../../types").CodeDeliveryDetails;
|
|
42
|
-
};
|
|
43
|
-
export declare const getServiceFacade: ({ send, state }: {
|
|
44
|
-
send: any;
|
|
45
|
-
state: any;
|
|
46
|
-
}) => {
|
|
47
|
-
error: string;
|
|
48
|
-
hasValidationErrors: boolean;
|
|
49
|
-
isPending: boolean;
|
|
50
|
-
route: string;
|
|
51
|
-
authStatus: string;
|
|
52
|
-
user: import("../../types").CognitoUserAmplify;
|
|
53
|
-
validationErrors: {
|
|
54
|
-
[x: string]: string | string[];
|
|
55
|
-
};
|
|
56
|
-
codeDeliveryDetails: import("../../types").CodeDeliveryDetails;
|
|
57
|
-
resendCode: (data?: AuthEventData) => void;
|
|
58
|
-
signOut: (data?: AuthEventData) => void;
|
|
59
|
-
submitForm: (data?: AuthEventData) => void;
|
|
60
|
-
updateForm: (data?: AuthEventData) => void;
|
|
61
|
-
updateBlur: (data?: AuthEventData) => void;
|
|
62
|
-
toFederatedSignIn: (data?: AuthEventData) => void;
|
|
63
|
-
toResetPassword: (data?: AuthEventData) => void;
|
|
64
|
-
toSignIn: (data?: AuthEventData) => void;
|
|
65
|
-
toSignUp: (data?: AuthEventData) => void;
|
|
66
|
-
skipVerification: (data?: AuthEventData) => void;
|
|
67
|
-
};
|
|
36
|
+
export declare const getSendEventAliases: (send: Sender<AuthEvent>) => AuthenticatorSendEventAliases;
|
|
37
|
+
export declare const getServiceContextFacade: (state: AuthMachineState) => AuthenticatorServiceContextFacade;
|
|
38
|
+
export declare const getServiceFacade: ({ send, state, }: {
|
|
39
|
+
send: Sender<AuthEvent>;
|
|
40
|
+
state: AuthMachineState;
|
|
41
|
+
}) => AuthenticatorServiceFacade;
|
|
42
|
+
export {};
|
|
@@ -16,3 +16,4 @@ export declare const defaultAuthHubHandler: HubHandler;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const listenToAuthHub: (service: AuthInterpreter, handler?: HubHandler) => () => void;
|
|
18
18
|
export declare const hasSpecialChars: (password: string) => boolean;
|
|
19
|
+
export declare const getTotpCode: (issuer: string, username: string, secret: string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthChallengeName, PasswordSettings, SignInResult, ValidatorResult } from '../../types';
|
|
2
2
|
export declare const defaultServices: {
|
|
3
3
|
getAmplifyConfig(): Promise<{}>;
|
|
4
4
|
getCurrentUser(): Promise<any>;
|
|
@@ -10,7 +10,7 @@ export declare const defaultServices: {
|
|
|
10
10
|
handleConfirmSignIn({ user, code, mfaType, }: {
|
|
11
11
|
user: any;
|
|
12
12
|
code: string;
|
|
13
|
-
mfaType:
|
|
13
|
+
mfaType: AuthChallengeName;
|
|
14
14
|
}): Promise<any>;
|
|
15
15
|
handleConfirmSignUp({ username, code, }: {
|
|
16
16
|
username: string;
|
|
@@ -47,6 +47,11 @@ interface IconCheckedToken {
|
|
|
47
47
|
transform: DesignToken<TransformValue>;
|
|
48
48
|
_disabled: IconCheckedDisabled;
|
|
49
49
|
}
|
|
50
|
+
interface IconIndeterminateToken {
|
|
51
|
+
opacity: DesignToken<OpacityValue>;
|
|
52
|
+
transform: DesignToken<TransformValue>;
|
|
53
|
+
_disabled: IconCheckedDisabled;
|
|
54
|
+
}
|
|
50
55
|
interface IconToken {
|
|
51
56
|
backgroundColor: DesignToken<BackgroundColorValue>;
|
|
52
57
|
borderRadius: DesignToken<BorderRadiusValue>;
|
|
@@ -56,6 +61,7 @@ interface IconToken {
|
|
|
56
61
|
transitionDuration: DesignToken<TransitionDurationValue>;
|
|
57
62
|
transitionTimingFunction: DesignToken<TransitionTimingFunctionValue>;
|
|
58
63
|
_checked: IconCheckedToken;
|
|
64
|
+
_indeterminate: IconIndeterminateToken;
|
|
59
65
|
}
|
|
60
66
|
interface LabelDisabledToken {
|
|
61
67
|
color: DesignToken<ColorValue>;
|
|
@@ -7,7 +7,7 @@ import { CheckboxTokens } from './checkbox';
|
|
|
7
7
|
import { CheckboxFieldTokens } from './checkboxField';
|
|
8
8
|
import { CollectionTokens } from './collection';
|
|
9
9
|
import { CopyTokens } from './copy';
|
|
10
|
-
import {
|
|
10
|
+
import { DialCodeSelectTokens } from './dialCodeSelect';
|
|
11
11
|
import { DividerTokens } from './divider';
|
|
12
12
|
import { ExpanderTokens } from './expander';
|
|
13
13
|
import { FieldTokens } from './field';
|
|
@@ -51,7 +51,7 @@ export interface ComponentTokens {
|
|
|
51
51
|
checkboxfield: CheckboxFieldTokens;
|
|
52
52
|
collection: CollectionTokens;
|
|
53
53
|
copy: CopyTokens;
|
|
54
|
-
countrycodeselect:
|
|
54
|
+
countrycodeselect: DialCodeSelectTokens;
|
|
55
55
|
divider: DividerTokens;
|
|
56
56
|
expander: ExpanderTokens;
|
|
57
57
|
field: FieldTokens;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ColorValue, DesignToken } from '../types/designToken';
|
|
1
|
+
import { BackgroundColorValue, ColorValue, DesignToken } from '../types/designToken';
|
|
2
2
|
import { StateTokens } from './button';
|
|
3
3
|
interface SearchTokens {
|
|
4
4
|
color: DesignToken<ColorValue>;
|
|
5
|
+
backgroundColor: DesignToken<BackgroundColorValue>;
|
|
5
6
|
_active: StateTokens;
|
|
6
7
|
_disabled: StateTokens;
|
|
7
8
|
_focus: StateTokens;
|
|
@@ -16,6 +16,9 @@ interface SelectIconWrapperTokens {
|
|
|
16
16
|
interface SelectOptionTokens {
|
|
17
17
|
backgroundColor: DesignToken<BackgroundColorValue>;
|
|
18
18
|
color: DesignToken<ColorValue>;
|
|
19
|
+
_disabled: {
|
|
20
|
+
color: DesignToken<ColorValue>;
|
|
21
|
+
};
|
|
19
22
|
}
|
|
20
23
|
interface SelectSizeTokens {
|
|
21
24
|
minWidth: DesignToken<SpaceValue>;
|
|
@@ -41,6 +41,7 @@ interface SwitchFieldTrackCheckedTokens {
|
|
|
41
41
|
backgroundColor: DesignToken<BackgroundColorValue>;
|
|
42
42
|
}
|
|
43
43
|
export interface SwitchFieldTokens {
|
|
44
|
+
fontSize: DesignToken<FontSizeValue>;
|
|
44
45
|
_disabled: SwitchFieldDisabledTokens;
|
|
45
46
|
_focused: SwitchFieldFocusedTokens;
|
|
46
47
|
large: SwitchFieldSizeTokens;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValidationError } from '../validator';
|
|
2
2
|
import { AuthFormData, AuthFormFields } from '../form';
|
|
3
|
-
import {
|
|
3
|
+
import { AuthChallengeName, CognitoUserAmplify } from '../user';
|
|
4
4
|
import { CodeDeliveryDetails as CognitoCodeDeliveryDetails } from 'amazon-cognito-identity-js';
|
|
5
5
|
import { LoginMechanism, SignUpAttribute, SocialProvider } from '../attributes';
|
|
6
6
|
import { defaultServices } from '../../../machines/authenticator/defaultServices';
|
|
@@ -35,7 +35,7 @@ export interface AuthContext {
|
|
|
35
35
|
username?: string;
|
|
36
36
|
password?: string;
|
|
37
37
|
code?: string;
|
|
38
|
-
mfaType?:
|
|
38
|
+
mfaType?: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA';
|
|
39
39
|
actorDoneData?: Omit<ActorDoneData, 'user'>;
|
|
40
40
|
hasSetup?: boolean;
|
|
41
41
|
}
|
|
@@ -48,7 +48,7 @@ interface BaseFormContext {
|
|
|
48
48
|
/** Any user attributes set that needs to persist between states */
|
|
49
49
|
authAttributes?: Record<string, any>;
|
|
50
50
|
/** Current challengeName issued by Cognnito */
|
|
51
|
-
challengeName?:
|
|
51
|
+
challengeName?: AuthChallengeName;
|
|
52
52
|
/** Required attributes for form submission */
|
|
53
53
|
requiredAttributes?: Array<string>;
|
|
54
54
|
/** Maps each input name to tis value */
|
|
@@ -91,7 +91,7 @@ export interface ResetPasswordContext extends BaseFormContext {
|
|
|
91
91
|
}
|
|
92
92
|
export interface SignOutContext {
|
|
93
93
|
authAttributes?: Record<string, any>;
|
|
94
|
-
challengeName?:
|
|
94
|
+
challengeName?: AuthChallengeName;
|
|
95
95
|
unverifiedAttributes?: Record<string, string>;
|
|
96
96
|
user?: CognitoUserAmplify;
|
|
97
97
|
formFields?: AuthFormFields;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { CognitoUser } from 'amazon-cognito-identity-js';
|
|
2
|
-
/**
|
|
3
|
-
export declare
|
|
4
|
-
SMS_MFA = "SMS_MFA",
|
|
5
|
-
SOFTWARE_TOKEN_MFA = "SOFTWARE_TOKEN_MFA",
|
|
6
|
-
NEW_PASSWORD_REQUIRED = "NEW_PASSWORD_REQUIRED",
|
|
7
|
-
RESET_REQUIRED = "RESET_REQUIRED",
|
|
8
|
-
MFA_SETUP = "MFA_SETUP"
|
|
9
|
-
}
|
|
1
|
+
import { ChallengeName, CognitoUser } from 'amazon-cognito-identity-js';
|
|
2
|
+
/** Known challenge names */
|
|
3
|
+
export declare type AuthChallengeName = ChallengeName;
|
|
10
4
|
/** Contact destinations that we can send user confirmation code to */
|
|
11
5
|
export declare type ContactMethod = 'Email' | 'Phone Number';
|
|
12
6
|
/** Federated IDPs that Authenticator supports */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PasswordSettings } from '.';
|
|
2
2
|
import { AuthFormData } from './form';
|
|
3
|
-
import { AuthChallengeNames } from './user';
|
|
4
3
|
/**
|
|
5
4
|
* Maps each input to its validation error, if any
|
|
6
5
|
*/
|
|
@@ -14,4 +13,3 @@ export declare type SignInResult = string;
|
|
|
14
13
|
* Validates the given formData. This can be synchronous or asynchronous.
|
|
15
14
|
*/
|
|
16
15
|
export declare type Validator = (formData: AuthFormData, touchData?: AuthFormData, passwordSettings?: PasswordSettings) => ValidatorResult | Promise<ValidatorResult>;
|
|
17
|
-
export declare type SignInTypes = (user: string, code: string, mfaType: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA) => SignInResult | Promise<SignInResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
27
|
-
"dist/esm/node_modules",
|
|
28
27
|
"LICENSE"
|
|
29
28
|
],
|
|
30
29
|
"scripts": {
|
|
@@ -43,7 +42,8 @@
|
|
|
43
42
|
"dependencies": {
|
|
44
43
|
"lodash": "4.17.21",
|
|
45
44
|
"style-dictionary": "3.7.0",
|
|
46
|
-
"xstate": "^4.
|
|
45
|
+
"xstate": "^4.33.0",
|
|
46
|
+
"tslib": "2.4.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@rollup/plugin-typescript": "^8.3.1",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"postcss": "^8.3.6",
|
|
59
59
|
"rimraf": "^3.0.2",
|
|
60
60
|
"rollup": "^2.70.0",
|
|
61
|
+
"rollup-plugin-node-externals": "^4.1.1",
|
|
61
62
|
"rollup-plugin-terser": "^7.0.2",
|
|
62
63
|
"sass": "^1.35.2",
|
|
63
64
|
"ts-jest": "^27.0.3",
|
|
64
65
|
"ts-node": "^10.2.1",
|
|
65
|
-
"tslib": "^2.3.0",
|
|
66
66
|
"type-fest": "^2.3.4"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=function(){return t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},t.apply(this,arguments)};function e(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function n(t,e,n,r){return new(n||(n=Promise))((function(o,a){function l(t){try{i(r.next(t))}catch(t){a(t)}}function c(t){try{i(r.throw(t))}catch(t){a(t)}}function i(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(l,c)}i((r=r.apply(t,e||[])).next())}))}function r(t,e){var n,r,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,r=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=l.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue}a=e.call(t,l)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function o(t,e,n){if(n||2===arguments.length)for(var r,o=0,a=e.length;o<a;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}export{t as __assign,n as __awaiter,r as __generator,e as __rest,o as __spreadArray};
|