@aws-amplify/ui 4.0.1 → 5.0.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/helpers/authenticator/constants.js +1 -1
- package/dist/esm/helpers/authenticator/facade.js +1 -1
- package/dist/esm/helpers/authenticator/textUtil.js +1 -0
- package/dist/esm/helpers/authenticator/utils.js +1 -1
- package/dist/esm/i18n/dictionaries/authenticator/defaultTexts.js +1 -1
- package/dist/esm/i18n/dictionaries/authenticator/it.js +1 -1
- package/dist/esm/index.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/tokens/components/autocomplete.js +1 -0
- package/dist/esm/theme/tokens/components/highlightMatch.js +1 -0
- package/dist/esm/theme/tokens/components/inAppMessaging.js +1 -0
- package/dist/esm/theme/tokens/components/index.js +1 -1
- package/dist/esm/types/primitives/componentClassName.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +294 -98
- package/dist/theme.css +37 -1
- package/dist/types/helpers/authenticator/facade.d.ts +1 -1
- package/dist/types/helpers/authenticator/index.d.ts +1 -0
- package/dist/types/helpers/authenticator/textUtil.d.ts +44 -0
- package/dist/types/helpers/authenticator/utils.d.ts +7 -3
- package/dist/types/i18n/dictionaries/authenticator/defaultTexts.d.ts +0 -1
- package/dist/types/i18n/dictionaries/index.d.ts +0 -1
- package/dist/types/i18n/translations.d.ts +0 -1
- package/dist/types/machines/authenticator/defaultServices.d.ts +2 -1
- package/dist/types/theme/tokens/components/autocomplete.d.ts +42 -0
- package/dist/types/theme/tokens/components/highlightMatch.d.ts +9 -0
- package/dist/types/theme/tokens/components/inAppMessaging.d.ts +28 -0
- package/dist/types/theme/tokens/components/index.d.ts +6 -0
- package/dist/types/types/authenticator/stateMachine/authMachine.d.ts +5 -1
- package/dist/types/types/authenticator/stateMachine/event.d.ts +1 -1
- package/dist/types/types/primitives/componentClassName.d.ts +11 -0
- package/package.json +3 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AuthChallengeName, CodeDeliveryDetails, SocialProvider } from '../../types';
|
|
2
|
+
import { AuthenticatorRoute } from './facade';
|
|
3
|
+
export declare const authenticatorTextUtil: {
|
|
4
|
+
/** Shared */
|
|
5
|
+
readonly getBackToSignInText: () => string;
|
|
6
|
+
readonly getChangePasswordText: () => string;
|
|
7
|
+
readonly getChangingText: () => string;
|
|
8
|
+
readonly getConfirmText: () => string;
|
|
9
|
+
readonly getConfirmingText: () => string;
|
|
10
|
+
readonly getCopyText: () => string;
|
|
11
|
+
readonly getResendCodeText: () => string;
|
|
12
|
+
readonly getSendCodeText: () => string;
|
|
13
|
+
readonly getSendingText: () => string;
|
|
14
|
+
readonly getSubmitText: () => string;
|
|
15
|
+
readonly getSubmittingText: () => string;
|
|
16
|
+
readonly getLoadingText: () => string;
|
|
17
|
+
/** SignInSignUpTabs */
|
|
18
|
+
readonly getSignInTabText: () => string;
|
|
19
|
+
readonly getSignUpTabText: () => string;
|
|
20
|
+
/** SignIn */
|
|
21
|
+
readonly getForgotPasswordText: () => string;
|
|
22
|
+
readonly getSigningInText: () => string;
|
|
23
|
+
readonly getSignInText: () => string;
|
|
24
|
+
/** SignUp */
|
|
25
|
+
readonly getCreatingAccountText: () => string;
|
|
26
|
+
readonly getCreateAccountText: () => string;
|
|
27
|
+
/** ConfirmSignUp */
|
|
28
|
+
readonly getDeliveryMessageText: (codeDeliveryDetails: CodeDeliveryDetails) => string;
|
|
29
|
+
readonly getDeliveryMethodText: (codeDeliveryDetails: CodeDeliveryDetails) => string;
|
|
30
|
+
/** ConfirmSignIn */
|
|
31
|
+
readonly getChallengeText: (challengeName: AuthChallengeName) => string;
|
|
32
|
+
/** ResetPassword */
|
|
33
|
+
readonly getResetYourPasswordText: () => string;
|
|
34
|
+
/** SetupTOTP */
|
|
35
|
+
readonly getSetupTOTPText: () => string;
|
|
36
|
+
readonly getCopiedText: () => string;
|
|
37
|
+
/** FederatedSignIn */
|
|
38
|
+
readonly getSignInWithFederationText: (route: AuthenticatorRoute, provider: SocialProvider) => string;
|
|
39
|
+
/** VerifyUser */
|
|
40
|
+
readonly getSkipText: () => string;
|
|
41
|
+
readonly getVerifyText: () => string;
|
|
42
|
+
readonly getVerifyContactText: () => string;
|
|
43
|
+
readonly getAccountRecoveryInfoText: () => string;
|
|
44
|
+
};
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
* This file contains general helpers that state machine or authenticator
|
|
3
3
|
* implementations can use.
|
|
4
4
|
*/
|
|
5
|
-
import { AuthInterpreter,
|
|
5
|
+
import { AuthInterpreter, AuthMachineHubHandler } from '../../types';
|
|
6
6
|
export declare const censorAllButFirstAndLast: (value: string) => string;
|
|
7
7
|
export declare const censorPhoneNumber: (val: string) => string;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Handles Amplify JS Auth hub events, by forwarding hub events as appropriate
|
|
10
|
+
* xstate events.
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultAuthHubHandler: AuthMachineHubHandler;
|
|
9
13
|
/**
|
|
10
14
|
* Listens to external auth Hub events and sends corresponding event to
|
|
11
15
|
* the `authService` of interest
|
|
@@ -14,6 +18,6 @@ export declare const defaultAuthHubHandler: HubHandler;
|
|
|
14
18
|
*
|
|
15
19
|
* @returns function that unsubscribes to the hub evenmt
|
|
16
20
|
*/
|
|
17
|
-
export declare const listenToAuthHub: (service: AuthInterpreter, handler?:
|
|
21
|
+
export declare const listenToAuthHub: (service: AuthInterpreter, handler?: AuthMachineHubHandler) => () => void;
|
|
18
22
|
export declare const hasSpecialChars: (password: string) => boolean;
|
|
19
23
|
export declare const getTotpCodeURL: (issuer: string, username: string, secret: string) => string;
|
|
@@ -32,7 +32,6 @@ export declare const DefaultTexts: {
|
|
|
32
32
|
readonly FAMILY_NAME: string;
|
|
33
33
|
readonly GIVEN_NAME: string;
|
|
34
34
|
readonly FORGOT_YOUR_PASSWORD: string;
|
|
35
|
-
readonly FORGOT_YOUR_PASSWORD_LEGACY: string;
|
|
36
35
|
readonly HIDE_PASSWORD: string;
|
|
37
36
|
readonly LOADING: string;
|
|
38
37
|
readonly LOGIN_NAME: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/// <reference types="amazon-cognito-identity-js" />
|
|
1
2
|
import { AuthChallengeName, PasswordSettings, SignInResult, ValidatorResult } from '../../types';
|
|
2
3
|
export declare const defaultServices: {
|
|
3
4
|
getAmplifyConfig(): Promise<{}>;
|
|
4
5
|
getCurrentUser(): Promise<any>;
|
|
5
|
-
handleSignUp(formData: any): Promise<
|
|
6
|
+
handleSignUp(formData: any): Promise<import("amazon-cognito-identity-js").ISignUpResult>;
|
|
6
7
|
handleSignIn({ username, password, }: {
|
|
7
8
|
username: string;
|
|
8
9
|
password: string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AlignItemsValue, BackgroundColorValue, BorderColorValue, BorderWidthValue, BorderStyleValue, BorderRadiusValue, ColorValue, CursorValue, DesignToken, DisplayValue, FlexDirectionValue, SpaceValue, TransitionDurationValue, TransitionPropertyValue, TransitionTimingFunctionValue } from '../types/designToken';
|
|
2
|
+
export interface AutocompleteTokens {
|
|
3
|
+
menu: {
|
|
4
|
+
width: DesignToken<SpaceValue>;
|
|
5
|
+
marginBlockStart: DesignToken<SpaceValue>;
|
|
6
|
+
backgroundColor: DesignToken<BackgroundColorValue>;
|
|
7
|
+
borderColor: DesignToken<BorderColorValue>;
|
|
8
|
+
borderWidth: DesignToken<BorderWidthValue>;
|
|
9
|
+
borderStyle: DesignToken<BorderStyleValue>;
|
|
10
|
+
borderRadius: DesignToken<BorderRadiusValue>;
|
|
11
|
+
options: {
|
|
12
|
+
display: DesignToken<DisplayValue>;
|
|
13
|
+
flexDirection: DesignToken<FlexDirectionValue>;
|
|
14
|
+
maxHeight: DesignToken<SpaceValue>;
|
|
15
|
+
};
|
|
16
|
+
option: {
|
|
17
|
+
backgroundColor: DesignToken<BackgroundColorValue>;
|
|
18
|
+
color: DesignToken<ColorValue>;
|
|
19
|
+
cursor: DesignToken<CursorValue>;
|
|
20
|
+
transitionDuration: DesignToken<TransitionDurationValue>;
|
|
21
|
+
transitionProperty: DesignToken<TransitionPropertyValue>;
|
|
22
|
+
transitionTimingFunction: DesignToken<TransitionTimingFunctionValue>;
|
|
23
|
+
_active: {
|
|
24
|
+
backgroundColor: DesignToken<BackgroundColorValue>;
|
|
25
|
+
color: DesignToken<ColorValue>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
_empty: {
|
|
29
|
+
display: DesignToken<DisplayValue>;
|
|
30
|
+
};
|
|
31
|
+
_loading: {
|
|
32
|
+
alignItems: DesignToken<AlignItemsValue>;
|
|
33
|
+
display: DesignToken<DisplayValue>;
|
|
34
|
+
gap: DesignToken<SpaceValue>;
|
|
35
|
+
};
|
|
36
|
+
spaceShared: {
|
|
37
|
+
paddingBlock: DesignToken<SpaceValue>;
|
|
38
|
+
paddingInline: DesignToken<SpaceValue>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export declare const autocomplete: AutocompleteTokens;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DesignToken, FontWeightValue } from '../types/designToken';
|
|
2
|
+
interface HighlightMatchHighlightedTokens {
|
|
3
|
+
fontWeight: DesignToken<FontWeightValue>;
|
|
4
|
+
}
|
|
5
|
+
export interface HighlightMatchTokens {
|
|
6
|
+
highlighted: HighlightMatchHighlightedTokens;
|
|
7
|
+
}
|
|
8
|
+
export declare const highlightmatch: HighlightMatchTokens;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BorderRadiusValue, ColorValue, DesignToken, FontSizeValue, FontWeightValue, SpaceValue } from '../types/designToken';
|
|
2
|
+
interface BannerTokens {
|
|
3
|
+
height: DesignToken<SpaceValue>;
|
|
4
|
+
width: DesignToken<SpaceValue>;
|
|
5
|
+
}
|
|
6
|
+
interface ButtonTokens {
|
|
7
|
+
backgroundColor: DesignToken<ColorValue>;
|
|
8
|
+
borderRadius: DesignToken<BorderRadiusValue>;
|
|
9
|
+
color: DesignToken<ColorValue>;
|
|
10
|
+
}
|
|
11
|
+
interface DialogTokens {
|
|
12
|
+
height: DesignToken<SpaceValue>;
|
|
13
|
+
minHeight: DesignToken<SpaceValue>;
|
|
14
|
+
minWidth: DesignToken<SpaceValue>;
|
|
15
|
+
width: DesignToken<SpaceValue>;
|
|
16
|
+
}
|
|
17
|
+
interface HeaderTokens {
|
|
18
|
+
fontSize: DesignToken<FontSizeValue>;
|
|
19
|
+
fontWeight: DesignToken<FontWeightValue>;
|
|
20
|
+
}
|
|
21
|
+
export interface InAppMessagingTokens {
|
|
22
|
+
banner: BannerTokens;
|
|
23
|
+
button: ButtonTokens;
|
|
24
|
+
dialog: DialogTokens;
|
|
25
|
+
header: HeaderTokens;
|
|
26
|
+
}
|
|
27
|
+
export declare const inappmessaging: InAppMessagingTokens;
|
|
28
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AlertTokens } from './alert';
|
|
2
|
+
import { AutocompleteTokens } from './autocomplete';
|
|
2
3
|
import { AuthenticatorTokens } from './authenticator';
|
|
3
4
|
import { BadgeTokens } from './badge';
|
|
4
5
|
import { ButtonTokens } from './button';
|
|
@@ -16,8 +17,10 @@ import { FieldGroupTokens } from './fieldGroup';
|
|
|
16
17
|
import { FieldMessagesTokens } from './fieldMessages';
|
|
17
18
|
import { FlexTokens } from './flex';
|
|
18
19
|
import { HeadingTokens } from './heading';
|
|
20
|
+
import { HighlightMatchTokens } from './highlightMatch';
|
|
19
21
|
import { IconTokens } from './icon';
|
|
20
22
|
import { ImageTokens } from './image';
|
|
23
|
+
import { InAppMessagingTokens } from './inAppMessaging';
|
|
21
24
|
import { LinkTokens } from './link';
|
|
22
25
|
import { LoaderTokens } from './loader';
|
|
23
26
|
import { MenuTokens } from './menu';
|
|
@@ -44,6 +47,7 @@ import { ToggleButtonGroupTokens } from './toggleButtonGroup';
|
|
|
44
47
|
export interface ComponentTokens {
|
|
45
48
|
alert: AlertTokens;
|
|
46
49
|
authenticator: AuthenticatorTokens;
|
|
50
|
+
autocomplete: AutocompleteTokens;
|
|
47
51
|
badge: BadgeTokens;
|
|
48
52
|
button: ButtonTokens;
|
|
49
53
|
card: CardTokens;
|
|
@@ -61,7 +65,9 @@ export interface ComponentTokens {
|
|
|
61
65
|
flex: FlexTokens;
|
|
62
66
|
heading: HeadingTokens;
|
|
63
67
|
icon: IconTokens;
|
|
68
|
+
highlightmatch: HighlightMatchTokens;
|
|
64
69
|
image: ImageTokens;
|
|
70
|
+
inappmessaging: InAppMessagingTokens;
|
|
65
71
|
link: LinkTokens;
|
|
66
72
|
loader: LoaderTokens;
|
|
67
73
|
menu: MenuTokens;
|
|
@@ -16,4 +16,8 @@ export declare type AuthInterpreter = Interpreter<AuthContext, any, AuthEvent, a
|
|
|
16
16
|
* Function type for `send` in `authMachine`
|
|
17
17
|
*/
|
|
18
18
|
export declare type AuthMachineSend = AuthInterpreter['send'];
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Handles Amplify JS Auth hub events, by forwarding hub events as appropriate
|
|
21
|
+
* xstate events.
|
|
22
|
+
*/
|
|
23
|
+
export declare type AuthMachineHubHandler = (data: HubCapsule, service: AuthInterpreter) => Promise<void>;
|
|
@@ -5,7 +5,7 @@ export declare type InvokeActorEventTypes = 'done.invoke.signInActor' | 'done.in
|
|
|
5
5
|
/**
|
|
6
6
|
* All known explicit events for xstate
|
|
7
7
|
*/
|
|
8
|
-
export declare type AuthEventTypes = 'CHANGE' | 'BLUR' | 'FEDERATED_SIGN_IN' | 'RESEND' | 'RESET_PASSWORD' | 'SIGN_IN' | 'SIGN_OUT' | 'SIGN_UP' | 'SKIP' | 'SUBMIT' | 'INIT' | 'TOKEN_REFRESH' | InvokeActorEventTypes;
|
|
8
|
+
export declare type AuthEventTypes = 'CHANGE' | 'BLUR' | 'FEDERATED_SIGN_IN' | 'RESEND' | 'RESET_PASSWORD' | 'AUTO_SIGN_IN' | 'AUTO_SIGN_IN_FAILURE' | 'SIGN_IN' | 'SIGN_OUT' | 'SIGN_UP' | 'SKIP' | 'SUBMIT' | 'INIT' | 'TOKEN_REFRESH' | InvokeActorEventTypes;
|
|
9
9
|
/**
|
|
10
10
|
* Data payload for auth events
|
|
11
11
|
*/
|
|
@@ -4,6 +4,14 @@ export declare enum ComponentClassName {
|
|
|
4
4
|
AlertHeading = "amplify-alert__heading",
|
|
5
5
|
AlertBody = "amplify-alert__body",
|
|
6
6
|
AlertDismiss = "amplify-alert__dismiss",
|
|
7
|
+
Autocomplete = "amplify-autocomplete",
|
|
8
|
+
AutocompleteMenu = "amplify-autocomplete__menu",
|
|
9
|
+
AutocompleteMenuEmpty = "amplify-autocomplete__menu--empty",
|
|
10
|
+
AutocompleteMenuFooter = "amplify-autocomplete__menu__footer",
|
|
11
|
+
AutocompleteMenuHeader = "amplify-autocomplete__menu__header",
|
|
12
|
+
AutocompleteMenuLoading = "amplify-autocomplete__menu--loading",
|
|
13
|
+
AutocompleteMenuOption = "amplify-autocomplete__menu__option",
|
|
14
|
+
AutocompleteMenuOptions = "amplify-autocomplete__menu__options",
|
|
7
15
|
Badge = "amplify-badge",
|
|
8
16
|
Button = "amplify-button",
|
|
9
17
|
ButtonGroup = "amplify-buttongroup",
|
|
@@ -48,6 +56,8 @@ export declare enum ComponentClassName {
|
|
|
48
56
|
Flex = "amplify-flex",
|
|
49
57
|
Grid = "amplify-grid",
|
|
50
58
|
Heading = "amplify-heading",
|
|
59
|
+
HighlightMatch = "amplify-highlightmatch",
|
|
60
|
+
HighlightMatchHighlighted = "amplify-highlightmatch__highlighted",
|
|
51
61
|
Icon = "amplify-icon",
|
|
52
62
|
Image = "amplify-image",
|
|
53
63
|
Input = "amplify-input",
|
|
@@ -57,6 +67,7 @@ export declare enum ComponentClassName {
|
|
|
57
67
|
LoaderDeterminate = "amplify-loader--determinate",
|
|
58
68
|
LoaderPercentageText = "amplify-loader__percentage-text",
|
|
59
69
|
MenuContent = "amplify-menu-content",
|
|
70
|
+
MenuContentWrapper = "amplify-menu-content-wrapper",
|
|
60
71
|
MenuItem = "amplify-menu-content__item",
|
|
61
72
|
MenuTrigger = "amplify-menu-trigger",
|
|
62
73
|
Pagination = "amplify-pagination",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"import": "./dist/esm/index.js",
|
|
9
9
|
"require": "./dist/index.js"
|
|
10
10
|
},
|
|
11
|
+
"./package.json": "./package.json",
|
|
11
12
|
"./styles.css": "./dist/styles.css",
|
|
12
13
|
"./theme.css": "./dist/theme.css"
|
|
13
14
|
},
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"tslib": "2.4.0"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"aws-amplify": "
|
|
49
|
+
"aws-amplify": "5.x.x",
|
|
49
50
|
"xstate": "^4.33.6"
|
|
50
51
|
},
|
|
51
52
|
"peerDependenciesMeta": {
|